@ar.io/sdk 2.4.0-alpha.7 → 2.4.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,7 +129,7 @@ ${JSON.stringify(ge.from(r))},${JSON.stringify(ge.from(a))},${h} => ${JSON.strin
129
129
  `)+`
130
130
  `)}static register(e,r){if(r||(r=e.locale),y8e)try{let a=window;a._ethers&&a._ethers.wordlists&&(a._ethers.wordlists[r]||hr(a._ethers.wordlists,r,e))}catch{}}};X();ee();Q();X();ee();Q();var _8e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",vg=null;function fJ(t){if(vg==null&&(vg=_8e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),u1.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw vg=null,new Error("BIP39 Wordlist for en (English) FAILED")}var CR=class extends u1{constructor(){super("en")}getWord(e){return fJ(this),vg[e]}getWordIndex(e){return fJ(this),vg.indexOf(e)}},LR=new CR;u1.register(LR);var d8={en:LR};X();ee();Q();var uJ="hdnode/5.7.0";var v8=new tr(uJ),M8e=on.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),x8e=qa("Bitcoin seed"),mg=2147483648;function cJ(t){return(1<<t)-1<<8-t}function S8e(t){return(1<<t)-1}function p8(t){return ka(fr(t),32)}function hJ(t){return PR.encode(Io([t,kh(j0(j0(t)),0,4)]))}function DR(t){if(t==null)return d8.en;if(typeof t=="string"){let e=d8[t];return e==null&&v8.throwArgumentError("unknown locale","wordlist",t),e}return t}var h1={},Z0="m/44'/60'/0'/0/0",sl=class t{constructor(e,r,a,i,h,c,d,b){if(e!==h1)throw new Error("HDNode constructor cannot be called directly");if(r){let g=new Bu(r);hr(this,"privateKey",g.privateKey),hr(this,"publicKey",g.compressedPublicKey)}else hr(this,"privateKey",null),hr(this,"publicKey",fr(a));hr(this,"parentFingerprint",i),hr(this,"fingerprint",kh(NR(j0(this.publicKey)),0,4)),hr(this,"address",Rs(this.publicKey)),hr(this,"chainCode",h),hr(this,"index",c),hr(this,"depth",d),b==null?(hr(this,"mnemonic",null),hr(this,"path",null)):typeof b=="string"?(hr(this,"mnemonic",null),hr(this,"path",b)):(hr(this,"mnemonic",b),hr(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return hJ(Io([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",fr(this.depth),this.parentFingerprint,ka(fr(this.index),4),this.chainCode,this.privateKey!=null?Io(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new t(h1,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~mg));let a=new Uint8Array(37);if(e&mg){if(!this.privateKey)throw new Error("cannot derive child of neutered node");a.set(Lt(this.privateKey),1),r&&(r+="'")}else a.set(Lt(this.publicKey));for(let M=24;M>=0;M-=8)a[33+(M>>3)]=e>>24-M&255;let i=Lt(z0(ol.sha512,this.chainCode,a)),h=i.slice(0,32),c=i.slice(32),d=null,b=null;this.privateKey?d=p8(on.from(h).add(this.privateKey).mod(M8e)):b=new Bu(fr(h))._addPoint(this.publicKey);let g=r,y=this.mnemonic;return y&&(g=Object.freeze({phrase:y.phrase,path:r,locale:y.locale||"en"})),new t(h1,d,b,this.fingerprint,p8(c),e,this.depth+1,g)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let a=this;for(let i=0;i<r.length;i++){let h=r[i];if(h.match(/^[0-9]+'$/)){let c=parseInt(h.substring(0,h.length-1));if(c>=mg)throw new Error("invalid path index - "+h);a=a._derive(mg+c)}else if(h.match(/^[0-9]+$/)){let c=parseInt(h);if(c>=mg)throw new Error("invalid path index - "+h);a=a._derive(c)}else throw new Error("invalid path component - "+h)}return a}static _fromSeed(e,r){let a=Lt(e);if(a.length<16||a.length>64)throw new Error("invalid seed");let i=Lt(z0(ol.sha512,x8e,a));return new t(h1,p8(i.slice(0,32)),null,"0x00000000",p8(i.slice(32)),0,0,r)}static fromMnemonic(e,r,a){return a=DR(a),e=gg($R(e,a),a),t._fromSeed(E8e(e,r),{phrase:e,path:"m",locale:a.locale})}static fromSeed(e){return t._fromSeed(e,null)}static fromExtendedKey(e){let r=PR.decode(e);(r.length!==82||hJ(r.slice(0,78))!==e)&&v8.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let a=r[4],i=fr(r.slice(5,9)),h=parseInt(fr(r.slice(9,13)).substring(2),16),c=fr(r.slice(13,45)),d=r.slice(45,78);switch(fr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(h1,null,fr(d),i,c,h,a,null);case"0x0488ade4":case"0x04358394 ":if(d[0]!==0)break;return new t(h1,fr(d.slice(1)),null,i,c,h,a,null)}return v8.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function E8e(t,e){e||(e="");let r=qa("mnemonic"+e,Mu.NFKD);return H0(qa(t,Mu.NFKD),r,2048,64,"sha512")}function $R(t,e){e=DR(e),v8.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let a=Lt(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let g=0;g<r.length;g++){let y=e.getWordIndex(r[g].normalize("NFKD"));if(y===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)y&1<<10-M&&(a[i>>3]|=1<<7-i%8),i++}let h=32*r.length/3,c=r.length/3,d=cJ(c);if((Lt(j0(a.slice(0,h/8)))[0]&d)!==(a[a.length-1]&d))throw new Error("invalid checksum");return fr(a.slice(0,h/8))}function gg(t,e){if(e=DR(e),t=Lt(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],a=11;for(let c=0;c<t.length;c++)a>8?(r[r.length-1]<<=8,r[r.length-1]|=t[c],a-=8):(r[r.length-1]<<=a,r[r.length-1]|=t[c]>>8-a,r.push(t[c]&S8e(8-a)),a+=3);let i=t.length/4,h=Lt(j0(t))[0]&cJ(i);return r[r.length-1]<<=i,r[r.length-1]|=h>>8-i,e.join(r.map(c=>e.getWord(c)))}X();ee();Q();X();ee();Q();X();ee();Q();var lJ="random/5.7.0";var UR=new tr(lJ);function A8e(){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")}var dJ=A8e(),m8=dJ.crypto||dJ.msCrypto;(!m8||!m8.getRandomValues)&&(UR.warn("WARNING: Missing strong random number source"),m8={getRandomValues:function(t){return UR.throwError("no secure random source avaialble",tr.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function fl(t){(t<=0||t>1024||t%1||t!=t)&&UR.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return m8.getRandomValues(e),Lt(e)}X();ee();Q();X();ee();Q();var jR=mi(FR());X();ee();Q();var g8="json-wallets/5.7.0";X();ee();Q();function Ch(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Lt(t)}function c1(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function bg(t){return typeof t=="string"?qa(t,Mu.NFKC):Lt(t)}function fn(t,e){let r=t,a=e.toLowerCase().split("/");for(let i=0;i<a.length;i++){let h=null;for(let c in r)if(c.toLowerCase()===a[i]){h=r[c];break}if(h===null)return null;r=h}return r}function vJ(t){let e=Lt(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=fr(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var R8e=new tr(g8),zR=class extends $0{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function HR(t,e){let r=JSON.parse(t);e=bg(e);let a=Ia(fn(r,"ethaddr")),i=Ch(fn(r,"encseed"));(!i||i.length%16!==0)&&R8e.throwArgumentError("invalid encseed","json",t);let h=Lt(H0(e,e,2e3,32,"sha256")).slice(0,16),c=i.slice(0,16),d=i.slice(16),b=new jR.default.ModeOfOperation.cbc(h,c),g=jR.default.padding.pkcs7.strip(Lt(b.decrypt(d))),y="";for(let E=0;E<g.length;E++)y+=String.fromCharCode(g[E]);let M=qa(y),x=an(M);return new zR({_isCrowdsaleAccount:!0,address:a,privateKey:x})}X();ee();Q();function ZR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function KR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}X();ee();Q();var Lh=mi(FR()),b8=mi(gJ());var T8e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function d(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(d,b)}g((a=a.apply(t,e||[])).next())})},VR=new tr(g8);function bJ(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var GR=class extends $0{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function k8e(t,e,r){if(fn(t,"crypto/cipher")==="aes-128-ctr"){let i=Ch(fn(t,"crypto/cipherparams/iv")),h=new Lh.default.Counter(i),c=new Lh.default.ModeOfOperation.ctr(e,h);return Lt(c.decrypt(r))}return null}function yJ(t,e){let r=Ch(fn(t,"crypto/ciphertext"));if(fr(an(Io([e.slice(16,32),r]))).substring(2)!==fn(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let i=k8e(t,e.slice(0,16),r);i||VR.throwError("unsupported cipher",tr.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let h=e.slice(32,64),c=Rs(i);if(t.address){let b=t.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),Ia(b)!==c)throw new Error("address mismatch")}let d={_isKeystoreAccount:!0,address:c,privateKey:fr(i)};if(fn(t,"x-ethers/version")==="0.1"){let b=Ch(fn(t,"x-ethers/mnemonicCiphertext")),g=Ch(fn(t,"x-ethers/mnemonicCounter")),y=new Lh.default.Counter(g),M=new Lh.default.ModeOfOperation.ctr(h,y),x=fn(t,"x-ethers/path")||Z0,E=fn(t,"x-ethers/locale")||"en",A=Lt(M.decrypt(b));try{let k=gg(A,E),O=sl.fromMnemonic(k,null,E).derivePath(x);if(O.privateKey!=d.privateKey)throw new Error("mnemonic mismatch");d.mnemonic=O.mnemonic}catch(k){if(k.code!==tr.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new GR(d)}function wJ(t,e,r,a,i){return Lt(H0(t,e,r,a,i))}function I8e(t,e,r,a,i){return Promise.resolve(wJ(t,e,r,a,i))}function _J(t,e,r,a,i){let h=bg(e),c=fn(t,"crypto/kdf");if(c&&typeof c=="string"){let d=function(b,g){return VR.throwArgumentError("invalid key-derivation function parameters",b,g)};if(c.toLowerCase()==="scrypt"){let b=Ch(fn(t,"crypto/kdfparams/salt")),g=parseInt(fn(t,"crypto/kdfparams/n")),y=parseInt(fn(t,"crypto/kdfparams/r")),M=parseInt(fn(t,"crypto/kdfparams/p"));(!g||!y||!M)&&d("kdf",c),g&g-1&&d("N",g);let x=parseInt(fn(t,"crypto/kdfparams/dklen"));return x!==32&&d("dklen",x),a(h,b,g,y,M,64,i)}else if(c.toLowerCase()==="pbkdf2"){let b=Ch(fn(t,"crypto/kdfparams/salt")),g=null,y=fn(t,"crypto/kdfparams/prf");y==="hmac-sha256"?g="sha256":y==="hmac-sha512"?g="sha512":d("prf",y);let M=parseInt(fn(t,"crypto/kdfparams/c")),x=parseInt(fn(t,"crypto/kdfparams/dklen"));return x!==32&&d("dklen",x),r(h,b,M,x,g)}}return VR.throwArgumentError("unsupported key-derivation function","kdf",c)}function MJ(t,e){let r=JSON.parse(t),a=_J(r,e,wJ,b8.default.syncScrypt);return yJ(r,a)}function xJ(t,e,r){return T8e(this,void 0,void 0,function*(){let a=JSON.parse(t),i=yield _J(a,e,I8e,b8.default.scrypt,r);return yJ(a,i)})}function YR(t,e,r,a){try{if(Ia(t.address)!==Rs(t.privateKey))throw new Error("address/privateKey mismatch");if(bJ(t)){let O=t.mnemonic;if(sl.fromMnemonic(O.phrase,null,O.locale).derivePath(O.path||Z0).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(O){return Promise.reject(O)}typeof r=="function"&&!a&&(a=r,r={}),r||(r={});let i=Lt(t.privateKey),h=bg(e),c=null,d=null,b=null;if(bJ(t)){let O=t.mnemonic;c=Lt($R(O.phrase,O.locale||"en")),d=O.path||Z0,b=O.locale||"en"}let g=r.client;g||(g="ethers.js");let y=null;r.salt?y=Lt(r.salt):y=fl(32);let M=null;if(r.iv){if(M=Lt(r.iv),M.length!==16)throw new Error("invalid iv")}else M=fl(16);let x=null;if(r.uuid){if(x=Lt(r.uuid),x.length!==16)throw new Error("invalid uuid")}else x=fl(16);let E=1<<17,A=8,k=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(A=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),b8.default.scrypt(h,y,E,A,k,64,a).then(O=>{O=Lt(O);let N=O.slice(0,16),L=O.slice(16,32),C=O.slice(32,64),Y=new Lh.default.Counter(M),G=new Lh.default.ModeOfOperation.ctr(N,Y),ie=Lt(G.encrypt(i)),D=an(Io([L,ie])),q={address:t.address.substring(2).toLowerCase(),id:vJ(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fr(M).substring(2)},ciphertext:fr(ie).substring(2),kdf:"scrypt",kdfparams:{salt:fr(y).substring(2),n:E,dklen:32,p:k,r:A},mac:D.substring(2)}};if(c){let V=fl(16),_=new Lh.default.Counter(V),n=new Lh.default.ModeOfOperation.ctr(C,_),s=Lt(n.encrypt(c)),f=new Date,u=f.getUTCFullYear()+"-"+c1(f.getUTCMonth()+1,2)+"-"+c1(f.getUTCDate(),2)+"T"+c1(f.getUTCHours(),2)+"-"+c1(f.getUTCMinutes(),2)+"-"+c1(f.getUTCSeconds(),2)+".0Z";q["x-ethers"]={client:g,gethFilename:"UTC--"+u+"--"+q.address,mnemonicCounter:fr(V).substring(2),mnemonicCiphertext:fr(s).substring(2),path:d,locale:b,version:"0.1"}}return JSON.stringify(q)})}function SJ(t,e,r){if(ZR(t)){r&&r(0);let a=HR(t,e);return r&&r(1),Promise.resolve(a)}return KR(t)?xJ(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function EJ(t,e){if(ZR(t))return HR(t,e);if(KR(t))return MJ(t,e);throw new Error("invalid JSON wallet")}X();ee();Q();var AJ="wallet/5.7.0";var RJ=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function d(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(d,b)}g((a=a.apply(t,e||[])).next())})},l1=new tr(AJ);function B8e(t){return t!=null&&Fn(t.privateKey,32)&&t.address!=null}function O8e(t){let e=t.mnemonic;return e&&e.phrase}var d1=class t extends c8{constructor(e,r){if(super(),B8e(e)){let a=new Bu(e.privateKey);if(hr(this,"_signingKey",()=>a),hr(this,"address",Rs(this.publicKey)),this.address!==Ia(e.address)&&l1.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),O8e(e)){let i=e.mnemonic;hr(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Z0,locale:i.locale||"en"}));let h=this.mnemonic,c=sl.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);Rs(c.privateKey)!==this.address&&l1.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else hr(this,"_mnemonic",()=>null)}else{if(Bu.isSigningKey(e))e.curve!=="secp256k1"&&l1.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),hr(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let a=new Bu(e);hr(this,"_signingKey",()=>a)}hr(this,"_mnemonic",()=>null),hr(this,"address",Rs(this.publicKey))}r&&!h8.isProvider(r)&&l1.throwArgumentError("invalid provider","provider",r),hr(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new t(this,e)}signTransaction(e){return Bh(e).then(r=>{r.from!=null&&(Ia(r.from)!==this.address&&l1.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let a=this._signingKey().signDigest(an(OR(r)));return OR(r,a)})}signMessage(e){return RJ(this,void 0,void 0,function*(){return aR(this._signingKey().signDigest(rl(e)))})}_signTypedData(e,r,a){return RJ(this,void 0,void 0,function*(){let i=yield U0.resolveNames(e,r,a,h=>(this.provider==null&&l1.throwError("cannot resolve ENS names without a provider",tr.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:h}),this.provider.resolveName(h)));return aR(this._signingKey().signDigest(U0.hash(i.domain,r,i.value)))})}encrypt(e,r,a){if(typeof r=="function"&&!a&&(a=r,r={}),a&&typeof a!="function")throw new Error("invalid callback");return r||(r={}),YR(this,e,r,a)}static createRandom(e){let r=fl(16);e||(e={}),e.extraEntropy&&(r=Lt(kh(an(Io([r,e.extraEntropy])),0,16)));let a=gg(r,e.locale);return t.fromMnemonic(a,e.path,e.locale)}static fromEncryptedJson(e,r,a){return SJ(e,r,a).then(i=>new t(i))}static fromEncryptedJsonSync(e,r){return new t(EJ(e,r))}static fromMnemonic(e,r,a){return r||(r=Z0),new t(sl.fromMnemonic(e,null,a).derivePath(r))}};function TJ(t,e){return BR(rl(t),e)}function y8(t,e,r,a){return BR(U0.hash(t,e,r),a)}var JR=class{signer;publicKey;ownerLength=Gr[Mr.ETHEREUM].pubLength;signatureLength=Gr[Mr.ETHEREUM].sigLength;signatureType=Mr.ETHEREUM;constructor(e){this.signer=e.getSigner()}async setPublicKey(){let e="sign this message to connect to Bundlr.Network",r=await this.signer.signMessage(e),a=await rl(e),i=u8(Lt(a),r);this.publicKey=ge.from(Lt(i))}async sign(e){this.publicKey||await this.setPublicKey();let r=await this.signer.signMessage(e);return ge.from(r.slice(2),"hex")}static verify(e,r,a){let i=Rs(e);return TJ(r,a)===i}};X();ee();Q();var p1=mi(NJ(),1),Dh=class extends Ro{get publicKey(){return p1.default.decode(this.pk)}get key(){return p1.default.decode(this._key)}constructor(e){let r=p1.default.decode(e);super(p1.default.encode(r.subarray(0,32)),p1.default.encode(r.subarray(32,64)))}};X();ee();Q();X();ee();Q();X();ee();Q();var QQ=mi(zo(),1),ZT=mi(mT(),1);X();ee();Q();mo();var KQ=mi(ZQ(),1);function HT(t){return t=WQ(t),(0,KQ.default)("keccak256").update(t).digest()}function WQ(t){if(!ge.isBuffer(t))if(Array.isArray(t))t=ge.from(t);else if(typeof t=="string")VQ(t)?t=ge.from(J8(GQ(t)),"hex"):t=ge.from(t);else if(typeof t=="number")t=JQ(t);else if(typeof t=="bigint")t=G5e(t);else if(t==null)t=ge.allocUnsafe(0);else throw new Error("invalid type");return t}function VQ(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function J8(t){if(typeof t!="string")throw new Error(`while padding to even, value must be string, is currently ${typeof t}, while padToEven.`);return t.length%2&&(t=`0${t}`),t}function GQ(t){return typeof t!="string"?t:YQ(t)?t.slice(2):t}function YQ(t){if(typeof t!="string")throw new Error("value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.startsWith("0x")}function JQ(t){let e=XQ(t);return ge.from(J8(e.slice(2)),"hex")}function XQ(t){return`0x${t.toString(16)}`}function G5e(t){let e=t.toString(16);return ge.from(J8(e),"hex")}typeof window<"u"&&(window.keccak256=HT);var Ig=HT,Y5e={intToBuffer:JQ,intToHex:XQ,isHexPrefixed:YQ,stripHexPrefix:GQ,padToEven:J8,isHexString:VQ,toBuffer:WQ};var od=class{_key;ownerLength=Gr[Mr.ETHEREUM].pubLength;signatureLength=Gr[Mr.ETHEREUM].sigLength;signatureType=Mr.ETHEREUM;pk;constructor(e,r){this._key=e,this.pk=r.toString("hex")}get publicKey(){throw new Error("You must implement `publicKey`")}get key(){return ge.from(this._key,"hex")}static async verify(e,r,a){let i=e;typeof e=="string"&&(i=QQ.default.toBuffer(e));let h=!1;try{h=ZT.default.ecdsaVerify(a,Ig(ge.from(r)),i)}catch{}return h}async sign(e){return ZT.default.ecdsaSign(Ig(ge.from(e)),ge.from(this.key)).signature}};var KT=mi(mT(),1),eee=mi(zo(),1);var No=class extends od{get publicKey(){return ge.from(this.pk,"hex")}constructor(e){e.startsWith("0x")&&(e=e.slice(2));let r=ge.from(e,"hex"),a=KT.default.publicKeyCreate(r,!1);super(e,ge.from(a))}async sign(e){return new d1(this._key).signMessage(e).then(a=>ge.from(a.slice(2),"hex"))}static async verify(e,r,a){return KT.default.ecdsaVerify(a.length===65?a.slice(0,-1):a,Lt(rl(r)),typeof e=="string"?eee.default.toBuffer(e):e)}};var Bg=class extends No{};X();ee();Q();var Og=class extends Dh{constructor(e){super(e.replace("ed25519:",""))}};X();ee();Q();var Pg=class extends Ro{get publicKey(){return ge.from(this.pk)}get key(){return ge.from(this._key)}constructor(e,r){super(e.subarray(0,32),r)}};X();ee();Q();var sd=class extends L0{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(ge.from(ge.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,ge.from(ge.from(r).toString("hex")),a)}};X();ee();Q();var Ng=class extends Dh{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(ge.from(ge.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,ge.from(ge.from(r).toString("hex")),a)}};X();ee();Q();var Cg=class extends Ro{constructor(e,r){super(e,r)}get publicKey(){return ge.from(this.pk.slice(2),"hex")}get key(){return ge.from(this._key.slice(2),"hex")}};X();ee();Q();var fd=class{_publicKey;ownerLength=Gr[Mr.INJECTEDAPTOS].pubLength;signatureLength=Gr[Mr.INJECTEDAPTOS].sigLength;signatureType=Mr.INJECTEDAPTOS;pem;provider;constructor(e,r){this.provider=e,this._publicKey=r}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");let a=(await this.provider.signMessage({message:ge.from(e).toString("hex"),nonce:"bundlr"})).signature;return typeof a=="string"?ge.from(a,"hex"):a.data.toUint8Array()}static async verify(e,r,a){let i=e;return Wc(ge.from(a),ge.from(`APTOS
131
131
  message: ${ge.from(r).toString("hex")}
132
- nonce: bundlr`),ge.from(i))}};X();ee();Q();var ud=class{_publicKey;ownerLength=Gr[Mr.MULTIAPTOS].pubLength;signatureLength=Gr[Mr.MULTIAPTOS].sigLength;signatureType=Mr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let d=ge.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&d.set(r[b++],g*64);return d.set(h,this.signatureLength-4),d}static async verify(e,r,a){let h=Gr[Mr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),d=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((d[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Wc(ge.from(E),ge.from(r),ge.from(A))||(b=!0)}}return!b}};X();ee();Q();var hd=class extends No{ownerLength=Gr[Mr.TYPEDETHEREUM].pubLength;signatureLength=Gr[Mr.TYPEDETHEREUM].sigLength;signatureType=Mr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+Ig(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new d1(e)}get publicKey(){return ge.from(this.address)}async sign(e){let r=await this.signer._signTypedData(Lg,Dg,{address:this.address,"Transaction hash":e});return ge.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=y8(Lg,Dg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},Lg={name:"Bundlr",version:"1"},Dg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};X();ee();Q();var WT=class{ownerLength=Gr[Mr.TYPEDETHEREUM].pubLength;signatureLength=Gr[Mr.TYPEDETHEREUM].sigLength;signatureType=Mr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=ge.from(this.address)}async sign(e){let r=await this.signer._signTypedData(Lg,Dg,{address:this.address,"Transaction hash":e});return ge.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=y8(Lg,Dg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};X();ee();Q();var tee=mi(zo(),1);var A1=class{signer;publicKey;ownerLength=Gr[Mr.ARWEAVE].pubLength;signatureLength=Gr[Mr.ARWEAVE].sigLength;signatureType=Mr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=tee.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await En().verify(e,r,a)}};X();ee();Q();var $g=class extends No{signatureType=Mr.KYVE};var Ug={1:Qc,2:Ro,3:No,4:sd,5:fd,6:ud,7:hd};X();ee();Q();X();ee();Q();async function J5e(t){return Vc([(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var qg=J5e;X();ee();Q();X();ee();Q();function Fg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function X8(t){return Fg(8,t)}function VT(t){return Fg(2,t)}function X5e(t){return Fg(16,t)}function Q8(t){return Fg(32,t)}function _n(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}X();ee();Q();var zg=mi(zo(),1);X();ee();Q();var Ns=mi(zo(),1);mo();X();ee();Q();var jg=class{buf;pos;constructor(e=ge.alloc(e4),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=ge.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,d,b;for(h=0,c=r;h<c;h++)d=e.charCodeAt(h),d<128?a[i++]=d:d<2048?(a[i++]=d>>6|192,a[i++]=d&63|128):(d&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(b&1023),h++,a[i++]=d>>18|240,a[i++]=d>>12&63|128,a[i++]=d>>6&63|128,a[i++]=d&63|128):(a[i++]=d>>12|224,a[i++]=d>>6&63|128,a[i++]=d&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,d;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,d=268435456;do i=a[this.pos++],c+=(i&127)*d,d*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function GT(t){if(t?.length===0)return ge.allocUnsafe(0);let e=new jg;return e.writeTags(t),e.toBuffer()}function R1(t){return new jg(t).readTags()}Sh();var r4=80,e4=4096,t4=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=_n(this.binary.subarray(0,2));if(Mr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Ns.default.encode(this.rawId)}set id(e){this._id=Ns.default.toBuffer(e)}get rawId(){return xh("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ns.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Gr[this.signatureType].sigLength}get owner(){return Ns.default.encode(this.rawOwner)}get ownerLength(){return Gr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):ge.alloc(0)}get target(){return Ns.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):ge.alloc(0)}get anchor(){return Ns.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=_n(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(_n(this.binary.subarray(e,e+8))==0)return[];let a=_n(this.binary.subarray(e+8,e+16));return R1(ge.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Ns.default.encode(r.name),value:Ns.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=_n(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=_n(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Ns.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await i4(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=ge.from(await En().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Ns.default.encode(e.name),value:Ns.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<r4)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=_n(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),d=_n(c);if(d>e4)return!1;if(h>0)try{if(R1(ge.from(e.subarray(i+16,i+16+d))).length!==h)return!1}catch{return!1}let b=Ug[a],g=await qg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return qg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},T1=t4;Sh();var Lu=32,n4=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Lu;r<Lu+64*this.length;r+=64)e.push(_n(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Lu;r<Lu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(zg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return zg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,zg.default)(xh("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Lu;a<Lu+64*this.length;a+=64){let i=_n(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(ge.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=Lu;y<Lu+64*this.length;y+=64){if(h=_n(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let d=a+r,b=this.binary.subarray(d,d+h),g=new T1(b);return g.rawId=c,g}getById(e){let r=zg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new T1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return _n(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Lu;h<Lu+64*this.length;h+=64){let c=_n(this.binary.subarray(h,h+32)),d=this.binary.subarray(h+32,h+64);if(d.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new T1(g);y.rawId=d,e[i]=y,i++}return e}},YT=n4;function Q5e(t){return new YT(t)}async function e7e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let d=h.isSigned()?h.rawId:await i4(h,e),b=new Uint8Array(64);return b.set(Q8(h.getRaw().byteLength),0),b.set(d,32),r.set(b,64*c),h.getRaw()})).then(h=>ge.concat(h)),i=ge.concat([ge.from(Q8(t.length)),ge.from(r),a]);return new YT(i)}async function ree(t,e){let r=await qg(t),a=await e.sign(r),i=await En().hash(a);return{signature:ge.from(a),id:ge.from(i)}}async function i4(t,e){let{signature:r,id:a}=await ree(t,e);return t.getRaw().set(r,2),a}X();ee();Q();var iee=mi(zo(),1);function Hg(t,e,r){let a=e.publicKey,i=r?.target?iee.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,d=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?GT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?ge.from(t):ge.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+d+g+M,E=ge.alloc(x);if(E.set(VT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(X8(r?.tags?.length??0),O);let N=X8(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new T1(E)}X();ee();Q();X();ee();Q();var JT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};X();ee();Q();X();ee();Q();var tk={};$a(tk,{default:()=>i7e,processStream:()=>fee,streamExportForTesting:()=>n7e,streamSigner:()=>r7e});X();ee();Q();a4();var cd=mi(zo(),1);Sh();async function fee(t){let e=uee(t),r=(await e.next()).value;r=await Fa(e,r,32);let a=_n(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await Fa(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[_n(r.subarray(b,b+32)),(0,cd.default)(ge.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,d=[];for(let[b,g]of h){r=await Fa(e,r,r4),r=await Fa(e,r,2);let y=_n(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Gr[y];r=await Fa(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await Fa(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await Fa(e,r,1);let O=r[0]===1;O&&(r=await Fa(e,r,33));let N=O?r.subarray(1,33):ge.allocUnsafe(0);r=r.subarray(O?33:1),r=await Fa(e,r,1);let L=r[0]===1;L&&(r=await Fa(e,r,33));let C=L?r.subarray(1,33):ge.allocUnsafe(0);r=r.subarray(L?33:1),r=await Fa(e,r,8);let Y=_n(r.subarray(0,8));r=r.subarray(8),r=await Fa(e,r,8);let G=_n(r.subarray(0,8));r=r.subarray(8),r=await Fa(e,r,G);let ie=r.subarray(0,G),D=Y!==0&&G!==0?R1(ge.from(ie)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let q=new oee;q._transform=function(f,u,l){this.push(f),l()};let V=Vc([(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(y.toString()),k,N,C,ie,q]),_=2+M+x+(O?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)q.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(q.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?q.write(r.subarray(0,r.byteLength-(f-n))):q.write(r)}r=r.subarray(r.byteLength-(f-n))}if(q.end(),g!==(0,cd.default)(xh("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Ug[y].verify(k,await V,A))throw new Error("Invalid signature");d.push({id:g,sigName:E,signature:(0,cd.default)(ge.from(A)),target:(0,cd.default)(ge.from(N)),anchor:(0,cd.default)(ge.from(C)),owner:(0,cd.default)(ge.from(k)),tags:D,dataOffset:c+_,dataSize:n}),c+=_+n}return d}async function r7e(t,e,r,a){let i=Hg("",r,a),h=new see,c=[(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],d=await Vc(c),b=ge.from(await r.sign(d));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function Fa(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return Fa(t,ge.concat([ge.from(e),ge.from(i)]),r)}async function*uee(t){for await(let e of t)yield e}var i7e=fee,n7e={readBytes:Fa,getReader:uee};var a7e={...XT,stream:tk};globalThis.arbundles??=a7e;X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var o4=new RegExp("^[a-zA-Z0-9_-]{43}$"),tlt=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),rlt=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),ilt=xe.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",nlt="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",o7e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",alt=o7e,k1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",s4="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",rk=1e6,hee="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",ik="pOh2yupSaQCrLI_-ah8tVTiusUdVNTxxeWTQQHNdf30",cee="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var nk=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},ak=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("IOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMIO(){return new ok(Math.floor(this.value*rk))}toString(){return`${this.value}`}},ok=class t extends nk{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toIO(){return new ak(this.valueOf()/rk)}};X();ee();Q();X();ee();Q();var lee=t=>o4.test(t);function mlt(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}function Fh(t){return"process"in t}function jh(t){return"processId"in t&&typeof t.processId=="string"&&lee(t.processId)===!0}function Mlt(t){return t.type==="lease"}X();ee();Q();X();ee();Q();var Of=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},dee=class extends Of{},pee=class extends Of{},vee=class extends Of{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},mee=class extends Of{},f4=class extends Of{},gee=class extends Of{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Du=class extends Of{constructor(){super("Invalid contract configuration")}},bee=class extends Of{constructor(){super("Invalid process configuration")}},yee=class extends Of{};X();ee();Q();var Ff=mi(Uoe(),1);X();ee();Q();var Y1="2.4.0-alpha.6";var $s=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Ff.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Y1},format:Ff.format.combine(Ff.format.timestamp(),Ff.format.json()),transports:[new Ff.transports.Console({format:Ff.format.combine(Ff.format.timestamp(),Ff.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};X();ee();Q();X();ee();Q();var ci;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(let d of h)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(ci||(ci={}));var uB;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(uB||(uB={}));var Jt=ci.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xl=t=>{switch(typeof t){case"undefined":return Jt.undefined;case"string":return Jt.string;case"number":return isNaN(t)?Jt.nan:Jt.number;case"boolean":return Jt.boolean;case"function":return Jt.function;case"bigint":return Jt.bigint;case"symbol":return Jt.symbol;case"object":return Array.isArray(t)?Jt.array:t===null?Jt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Jt.promise:typeof Map<"u"&&t instanceof Map?Jt.map:typeof Set<"u"&&t instanceof Set?Jt.set:typeof Date<"u"&&t instanceof Date?Jt.date:Jt.object;default:return Jt.unknown}},Pt=ci.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"]),oOe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Do=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let 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){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let d=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(r(c))):d[g]=d[g]||{_errors:[]},d=d[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ci.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Do.create=t=>new Do(t);var Q1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Jt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ci.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${ci.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ci.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${ci.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.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}"`:ci.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.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 Pt.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 Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,ci.assertNever(t)}return{message:r}},joe=Q1;function sOe(t){joe=t}function vw(){return joe}var mw=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let d="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)d=g(c,{data:e,defaultError:d}).message;return{...i,path:h,message:d}},fOe=[];function Vt(t,e){let r=vw(),a=mw({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Q1?void 0:Q1].filter(i=>!!i)});t.common.issues.push(a)}var Ca=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},vr=Object.freeze({status:"aborted"}),X1=t=>({status:"dirty",value:t}),Za=t=>({status:"valid",value:t}),hB=t=>t.status==="aborted",cB=t=>t.status==="dirty",O2=t=>t.status==="valid",P2=t=>typeof Promise<"u"&&t instanceof Promise;function gw(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function zoe(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var I2,B2,qs=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,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}},qoe=(t,e)=>{if(O2(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;let r=new Do(t.common.issues);return this._error=r,this._error}}};function Pr(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))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:(c,d)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??d.defaultError}:typeof d.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:d.defaultError}},description:i}}var Nr=class{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 xl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ca,ctx:{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(P2(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return qoe(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(P2(i)?i:Promise.resolve(i));return qoe(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),d=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new $o({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Us.create(this,this._def)}nullable(){return Zu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jh.create(this,this._def)}promise(){return Al.create(this,this._def)}or(e){return Cd.create([this,e],this._def)}and(e){return Ld.create(this,e,this._def)}transform(e){return new $o({...Pr(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Fd({...Pr(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new N2({typeName:lr.ZodBranded,type:this,...Pr(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new jd({...Pr(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return C2.create(this,e)}readonly(){return zd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},uOe=/^c[^\s-]{8,}$/i,hOe=/^[0-9a-z]+$/,cOe=/^[0-9A-HJKMNP-TV-Z]{26}$/,lOe=/^[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,dOe=/^[a-z0-9_-]{21}$/i,pOe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vOe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mOe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fB,gOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bOe=/^(([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})))$/,yOe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Hoe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wOe=new RegExp(`^${Hoe}$`);function Zoe(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function _Oe(t){return new RegExp(`^${Zoe(t)}$`)}function Koe(t){let e=`${Hoe}T${Zoe(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function MOe(t,e){return!!((e==="v4"||!e)&&gOe.test(t)||(e==="v6"||!e)&&bOe.test(t))}var Sl=class t extends Nr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Jt.string){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.string,received:h.parsedType}),vr}let a=new Ca,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,d=e.data.length<h.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?Vt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):d&&Vt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")vOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")fB||(fB=new RegExp(mOe,"u")),fB.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")lOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")dOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")uOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")hOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")cOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Vt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?Koe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?wOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?_Oe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?pOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?MOe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?yOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):ci.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...ir.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Sl.create=t=>{var e;return new Sl({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Pr(t)})};function xOe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var kd=class t extends Nr{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)!==Jt.number){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.number,received:h.parsedType}),vr}let a,i=new Ca;for(let h of this._def.checks)h.kind==="int"?ci.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?xOe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):ci.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let 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"&&ci.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};kd.create=t=>new kd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Pr(t)});var Id=class t extends Nr{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)!==Jt.bigint){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.bigint,received:h.parsedType}),vr}let a,i=new Ca;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):ci.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Id.create=t=>{var e;return new Id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Pr(t)})};var Bd=class extends Nr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Jt.boolean){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.boolean,received:a.parsedType}),vr}return Za(e.data)}};Bd.create=t=>new Bd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Pr(t)});var Od=class t extends Nr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Jt.date){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_date}),vr}let a=new Ca,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):ci.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let 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(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Od.create=t=>new Od({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Pr(t)});var ev=class extends Nr{_parse(e){if(this._getType(e)!==Jt.symbol){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.symbol,received:a.parsedType}),vr}return Za(e.data)}};ev.create=t=>new ev({typeName:lr.ZodSymbol,...Pr(t)});var Pd=class extends Nr{_parse(e){if(this._getType(e)!==Jt.undefined){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.undefined,received:a.parsedType}),vr}return Za(e.data)}};Pd.create=t=>new Pd({typeName:lr.ZodUndefined,...Pr(t)});var Nd=class extends Nr{_parse(e){if(this._getType(e)!==Jt.null){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.null,received:a.parsedType}),vr}return Za(e.data)}};Nd.create=t=>new Nd({typeName:lr.ZodNull,...Pr(t)});var El=class extends Nr{constructor(){super(...arguments),this._any=!0}_parse(e){return Za(e.data)}};El.create=t=>new El({typeName:lr.ZodAny,...Pr(t)});var Yh=class extends Nr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Za(e.data)}};Yh.create=t=>new Yh({typeName:lr.ZodUnknown,...Pr(t)});var jf=class extends Nr{_parse(e){let r=this._getOrReturnCtx(e);return Vt(r,{code:Pt.invalid_type,expected:Jt.never,received:r.parsedType}),vr}};jf.create=t=>new jf({typeName:lr.ZodNever,...Pr(t)});var tv=class extends Nr{_parse(e){if(this._getType(e)!==Jt.undefined){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.void,received:a.parsedType}),vr}return Za(e.data)}};tv.create=t=>new tv({typeName:lr.ZodVoid,...Pr(t)});var Jh=class t extends Nr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Jt.array)return Vt(r,{code:Pt.invalid_type,expected:Jt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(Vt(r,{code:c?Pt.too_big:Pt.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Vt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Vt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new qs(r,c,r.path,d)))).then(c=>Ca.mergeArray(a,c));let h=[...r.data].map((c,d)=>i.type._parseSync(new qs(r,c,r.path,d)));return Ca.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Jh.create=(t,e)=>new Jh({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Pr(e)});function J1(t){if(t instanceof lo){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Us.create(J1(a))}return new lo({...t._def,shape:()=>e})}else return t instanceof Jh?new Jh({...t._def,type:J1(t.element)}):t instanceof Us?Us.create(J1(t.unwrap())):t instanceof Zu?Zu.create(J1(t.unwrap())):t instanceof Hu?Hu.create(t.items.map(e=>J1(e))):t}var lo=class t extends Nr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ci.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Jt.object){let g=this._getOrReturnCtx(e);return Vt(g,{code:Pt.invalid_type,expected:Jt.object,received:g.parsedType}),vr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof jf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||d.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new qs(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof jf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of d)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")d.length>0&&(Vt(i,{code:Pt.unrecognized_keys,keys:d}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of d){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new qs(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ca.mergeObjectSync(a,g)):Ca.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,d;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(d=ir.errToObj(e).message)!==null&&d!==void 0?d:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return ci.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return J1(this)}partial(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Us;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return Woe(ci.objectKeys(this.shape))}};lo.create=(t,e)=>new lo({shape:()=>t,unknownKeys:"strip",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});lo.strictCreate=(t,e)=>new lo({shape:()=>t,unknownKeys:"strict",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});lo.lazycreate=(t,e)=>new lo({shape:t,unknownKeys:"strip",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});var Cd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let d of h)if(d.result.status==="valid")return d.result;for(let d of h)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;let c=h.map(d=>new Do(d.ctx.common.issues));return Vt(r,{code:Pt.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let d=c.map(b=>new Do(b));return Vt(r,{code:Pt.invalid_union,unionErrors:d}),vr}}get options(){return this._def.options}};Cd.create=(t,e)=>new Cd({options:t,typeName:lr.ZodUnion,...Pr(e)});var Gh=t=>t instanceof Dd?Gh(t.schema):t instanceof $o?Gh(t.innerType()):t instanceof $d?[t.value]:t instanceof Ud?t.options:t instanceof qd?ci.objectValues(t.enum):t instanceof Fd?Gh(t._def.innerType):t instanceof Pd?[void 0]:t instanceof Nd?[null]:t instanceof Us?[void 0,...Gh(t.unwrap())]:t instanceof Zu?[null,...Gh(t.unwrap())]:t instanceof N2||t instanceof zd?Gh(t.unwrap()):t instanceof jd?Gh(t._def.innerType):[],bw=class t extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.object)return Vt(r,{code:Pt.invalid_type,expected:Jt.object,received:r.parsedType}),vr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Vt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Gh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Pr(a)})}};function lB(t,e){let r=xl(t),a=xl(e);if(t===e)return{valid:!0,data:t};if(r===Jt.object&&a===Jt.object){let i=ci.objectKeys(e),h=ci.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(let d of h){let b=lB(t[d],e[d]);if(!b.valid)return{valid:!1};c[d]=b.data}return{valid:!0,data:c}}else if(r===Jt.array&&a===Jt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],d=e[h],b=lB(c,d);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Jt.date&&a===Jt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ld=class extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(hB(h)||hB(c))return vr;let d=lB(h.value,c.value);return d.valid?((cB(h)||cB(c))&&r.dirty(),{status:r.value,value:d.data}):(Vt(a,{code:Pt.invalid_intersection_types}),vr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Ld.create=(t,e,r)=>new Ld({left:t,right:e,typeName:lr.ZodIntersection,...Pr(r)});var Hu=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.array)return Vt(a,{code:Pt.invalid_type,expected:Jt.array,received:a.parsedType}),vr;if(a.data.length<this._def.items.length)return Vt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&a.data.length>this._def.items.length&&(Vt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,d)=>{let b=this._def.items[d]||this._def.rest;return b?b._parse(new qs(a,c,a.path,d)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>Ca.mergeArray(r,c)):Ca.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Hu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Hu({items:t,typeName:lr.ZodTuple,rest:null,...Pr(e)})};var yw=class t extends Nr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.object)return Vt(a,{code:Pt.invalid_type,expected:Jt.object,received:a.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let d in a.data)i.push({key:h._parse(new qs(a,d,a.path,d)),value:c._parse(new qs(a,a.data[d],a.path,d)),alwaysSet:d in a.data});return a.common.async?Ca.mergeObjectAsync(r,i):Ca.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Nr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Pr(a)}):new t({keyType:Sl.create(),valueType:e,typeName:lr.ZodRecord,...Pr(r)})}},rv=class extends Nr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.map)return Vt(a,{code:Pt.invalid_type,expected:Jt.map,received:a.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([d,b],g)=>({key:i._parse(new qs(a,d,a.path,[g,"key"])),value:h._parse(new qs(a,b,a.path,[g,"value"]))}));if(a.common.async){let d=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),d.set(g.value,y.value)}return{status:r.value,value:d}})}else{let d=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),d.set(g.value,y.value)}return{status:r.value,value:d}}}};rv.create=(t,e,r)=>new rv({valueType:e,keyType:t,typeName:lr.ZodMap,...Pr(r)});var iv=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.set)return Vt(a,{code:Pt.invalid_type,expected:Jt.set,received:a.parsedType}),vr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Vt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Vt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return vr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let d=[...a.data.values()].map((b,g)=>h._parse(new qs(a,b,a.path,g)));return a.common.async?Promise.all(d).then(b=>c(b)):c(d)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};iv.create=(t,e)=>new iv({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Pr(e)});var ww=class t extends Nr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.function)return Vt(r,{code:Pt.invalid_type,expected:Jt.function,received:r.parsedType}),vr;function a(d,b){return mw({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vw(),Q1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(d,b){return mw({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vw(),Q1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Al){let d=this;return Za(async function(...b){let g=new Do([]),y=await d._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await d._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let d=this;return Za(function(...b){let g=d._def.args.safeParse(b,h);if(!g.success)throw new Do([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=d._def.returns.safeParse(y,h);if(!M.success)throw new Do([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Hu.create(e).rest(Yh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Hu.create([]).rest(Yh.create()),returns:r||Yh.create(),typeName:lr.ZodFunction,...Pr(a)})}},Dd=class extends Nr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Dd.create=(t,e)=>new Dd({getter:t,typeName:lr.ZodLazy,...Pr(e)});var $d=class extends Nr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Vt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};$d.create=(t,e)=>new $d({value:t,typeName:lr.ZodLiteral,...Pr(e)});function Woe(t,e){return new Ud({values:t,typeName:lr.ZodEnum,...Pr(e)})}var Ud=class t extends Nr{constructor(){super(...arguments),I2.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{expected:ci.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),vr}if(gw(this,I2,"f")||zoe(this,I2,new Set(this._def.values),"f"),!gw(this,I2,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),vr}return Za(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};I2=new WeakMap;Ud.create=Woe;var qd=class extends Nr{constructor(){super(...arguments),B2.set(this,void 0)}_parse(e){let r=ci.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Jt.string&&a.parsedType!==Jt.number){let i=ci.objectValues(r);return Vt(a,{expected:ci.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),vr}if(gw(this,B2,"f")||zoe(this,B2,new Set(ci.getValidEnumValues(this._def.values)),"f"),!gw(this,B2,"f").has(e.data)){let i=ci.objectValues(r);return Vt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),vr}return Za(e.data)}get enum(){return this._def.values}};B2=new WeakMap;qd.create=(t,e)=>new qd({values:t,typeName:lr.ZodNativeEnum,...Pr(e)});var Al=class extends Nr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.promise&&r.common.async===!1)return Vt(r,{code:Pt.invalid_type,expected:Jt.promise,received:r.parsedType}),vr;let a=r.parsedType===Jt.promise?r.data:Promise.resolve(r.data);return Za(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Al.create=(t,e)=>new Al({type:t,typeName:lr.ZodPromise,...Pr(e)});var $o=class extends Nr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Vt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?X1(b.value):b});{if(r.value==="aborted")return vr;let d=this._def.schema._parseSync({data:c,path:a.path,parent:a});return d.status==="aborted"?vr:d.status==="dirty"||r.value==="dirty"?X1(d.value):d}}if(i.type==="refinement"){let c=d=>{let b=i.refinement(d,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){let d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?vr:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?vr:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!O2(c))return c;let d=i.transform(c.value,h);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>O2(c)?Promise.resolve(i.transform(c.value,h)).then(d=>({status:r.value,value:d})):c);ci.assertNever(i)}};$o.create=(t,e,r)=>new $o({schema:t,typeName:lr.ZodEffects,effect:e,...Pr(r)});$o.createWithPreprocess=(t,e,r)=>new $o({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Pr(r)});var Us=class extends Nr{_parse(e){return this._getType(e)===Jt.undefined?Za(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Us.create=(t,e)=>new Us({innerType:t,typeName:lr.ZodOptional,...Pr(e)});var Zu=class extends Nr{_parse(e){return this._getType(e)===Jt.null?Za(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zu.create=(t,e)=>new Zu({innerType:t,typeName:lr.ZodNullable,...Pr(e)});var Fd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Jt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Fd.create=(t,e)=>new Fd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Pr(e)});var jd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return P2(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Do(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Do(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};jd.create=(t,e)=>new jd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Pr(e)});var nv=class extends Nr{_parse(e){if(this._getType(e)!==Jt.nan){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.nan,received:a.parsedType}),vr}return{status:"valid",value:e.data}}};nv.create=t=>new nv({typeName:lr.ZodNaN,...Pr(t)});var SOe=Symbol("zod_brand"),N2=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},C2=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),X1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},zd=class extends Nr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(O2(i)&&(i.value=Object.freeze(i.value)),i);return P2(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};zd.create=(t,e)=>new zd({innerType:t,typeName:lr.ZodReadonly,...Pr(e)});function Voe(t,e={},r){return t?El.create().superRefine((a,i)=>{var h,c;if(!t(a)){let d=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=d.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...g,fatal:b})}}):El.create()}var EOe={object:lo.lazycreate},lr;(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"})(lr||(lr={}));var AOe=(t,e={message:`Input not instance of ${t.name}`})=>Voe(r=>r instanceof t,e),Goe=Sl.create,Yoe=kd.create,ROe=nv.create,TOe=Id.create,Joe=Bd.create,kOe=Od.create,IOe=ev.create,BOe=Pd.create,OOe=Nd.create,POe=El.create,NOe=Yh.create,COe=jf.create,LOe=tv.create,DOe=Jh.create,$Oe=lo.create,UOe=lo.strictCreate,qOe=Cd.create,FOe=bw.create,jOe=Ld.create,zOe=Hu.create,HOe=yw.create,ZOe=rv.create,KOe=iv.create,WOe=ww.create,VOe=Dd.create,GOe=$d.create,YOe=Ud.create,JOe=qd.create,XOe=Al.create,Foe=$o.create,QOe=Us.create,ePe=Zu.create,tPe=$o.createWithPreprocess,rPe=C2.create,iPe=()=>Goe().optional(),nPe=()=>Yoe().optional(),aPe=()=>Joe().optional(),oPe={string:t=>Sl.create({...t,coerce:!0}),number:t=>kd.create({...t,coerce:!0}),boolean:t=>Bd.create({...t,coerce:!0}),bigint:t=>Id.create({...t,coerce:!0}),date:t=>Od.create({...t,coerce:!0})},sPe=vr,mr=Object.freeze({__proto__:null,defaultErrorMap:Q1,setErrorMap:sOe,getErrorMap:vw,makeIssue:mw,EMPTY_PATH:fOe,addIssueToContext:Vt,ParseStatus:Ca,INVALID:vr,DIRTY:X1,OK:Za,isAborted:hB,isDirty:cB,isValid:O2,isAsync:P2,get util(){return ci},get objectUtil(){return uB},ZodParsedType:Jt,getParsedType:xl,ZodType:Nr,datetimeRegex:Koe,ZodString:Sl,ZodNumber:kd,ZodBigInt:Id,ZodBoolean:Bd,ZodDate:Od,ZodSymbol:ev,ZodUndefined:Pd,ZodNull:Nd,ZodAny:El,ZodUnknown:Yh,ZodNever:jf,ZodVoid:tv,ZodArray:Jh,ZodObject:lo,ZodUnion:Cd,ZodDiscriminatedUnion:bw,ZodIntersection:Ld,ZodTuple:Hu,ZodRecord:yw,ZodMap:rv,ZodSet:iv,ZodFunction:ww,ZodLazy:Dd,ZodLiteral:$d,ZodEnum:Ud,ZodNativeEnum:qd,ZodPromise:Al,ZodEffects:$o,ZodTransformer:$o,ZodOptional:Us,ZodNullable:Zu,ZodDefault:Fd,ZodCatch:jd,ZodNaN:nv,BRAND:SOe,ZodBranded:N2,ZodPipeline:C2,ZodReadonly:zd,custom:Voe,Schema:Nr,ZodSchema:Nr,late:EOe,get ZodFirstPartyTypeKind(){return lr},coerce:oPe,any:POe,array:DOe,bigint:TOe,boolean:Joe,date:kOe,discriminatedUnion:FOe,effect:Foe,enum:YOe,function:WOe,instanceof:AOe,intersection:jOe,lazy:VOe,literal:GOe,map:ZOe,nan:ROe,nativeEnum:JOe,never:COe,null:OOe,nullable:ePe,number:Yoe,object:$Oe,oboolean:aPe,onumber:nPe,optional:QOe,ostring:iPe,pipeline:rPe,preprocess:tPe,promise:XOe,record:HOe,set:KOe,strictObject:UOe,string:Goe,symbol:IOe,transformer:Foe,tuple:zOe,undefined:BOe,union:qOe,unknown:NOe,void:LOe,NEVER:sPe,ZodIssueCode:Pt,quotelessJson:oOe,ZodError:Do});X();ee();Q();var Xh=mr.string({description:"Arweave Transaction ID"}).refine(t=>o4.test(t),{message:"Must be an Arweave Transaction ID"}),Xoe=mr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),fPe=mr.string(),ese=mr.array(mr.string()),_w=mr.object({transactionId:Xh.describe("The Target ID of the undername"),ttlSeconds:mr.number()}),dB=mr.record(mr.string(),_w),pB=mr.array(Xh.describe("Controller address")),vB=mr.record(Xh.describe("Holder address"),mr.number()),tse=mr.object({Name:mr.string().describe("The name of the ANT."),Ticker:mr.string().describe("The ticker symbol for the ANT."),Description:mr.string().describe("The description for the ANT."),Keywords:ese.describe("The keywords for the ANT."),Denomination:mr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:Xh.describe("The Owners address."),Controllers:pB.describe("Controllers of the ANT who have administrative privileges."),Records:dB.describe("Records associated with the ANT."),Balances:vB.describe("Balance details for each address holding the ANT."),Logo:Xh.describe("Transaction ID of the ANT logo."),TotalSupply:mr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:mr.boolean().describe("Flag indicating whether the ANT has been initialized."),"Source-Code-TX-ID":Xh.describe("Transaction ID of the Source Code for the ANT.")}),uPe=["evolve","_eval","_default","transfer","balance","balances","totalSupply","info","addController","removeController","controllers","setRecord","removeRecord","record","records","setName","setTicker","setDescription","setKeywords","initializeState","state","releaseName"],Qoe=mr.array(mr.string({description:"Handler Name"})).refine(t=>uPe.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),rse=mr.object({Name:mr.string().describe("The name of the ANT."),Owner:Xh.describe("The Owners address."),"Source-Code-TX-ID":Xh.describe("Transaction ID of the Source Code for the ANT."),Ticker:mr.string().describe("The ticker symbol for the ANT."),"Total-Supply":Xoe.describe("Total supply of the ANT in circulation."),Description:fPe.describe("The description for the ANT."),Keywords:ese.describe("The keywords for the ANT."),Logo:Xh.describe("Transaction ID of the ANT logo."),Denomination:Xoe.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:Qoe.optional().describe("List of handlers for the ANT."),HandlerNames:Qoe.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});X();ee();Q();X();ee();Q();var hPe=Object.create,YB=Object.defineProperty,cPe=Object.getOwnPropertyDescriptor,Tse=Object.getOwnPropertyNames,lPe=Object.getPrototypeOf,dPe=Object.prototype.hasOwnProperty,Uo=(t,e)=>function(){return e||(0,t[Tse(t)[0]])((e={exports:{}}).exports,e),e.exports},kse=(t,e)=>{for(var r in e)YB(t,r,{get:e[r],enumerable:!0})},pPe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tse(e))!dPe.call(t,i)&&i!==r&&YB(t,i,{get:()=>e[i],enumerable:!(a=cPe(e,i))||a.enumerable});return t},JB=(t,e,r)=>(r=t!=null?hPe(lPe(t)):{},pPe(e||!t||!t.__esModule?YB(r,"default",{value:t,enumerable:!0}):r,t)),vPe=Uo({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),mPe=Uo({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),XB=Uo({"node_modules/obliterator/foreach.js"(t,e){var r=mPe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,d){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof d!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)d(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(d);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)d(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&d(c[g],g)}}}),QB=Uo({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var d={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,O;for(k=0,O=b.length;k<O;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=d[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),Ise=Uo({"node_modules/mnemonist/utils/iterables.js"(t){var e=XB(),r=QB();function a(d){return Array.isArray(d)||r.isTypedArray(d)}function i(d){if(typeof d.length=="number")return d.length;if(typeof d.size=="number")return d.size}function h(d){var b=i(d),g=typeof b=="number"?new Array(b):[],y=0;return e(d,function(M){g[y++]=M}),g}function c(d){var b=i(d),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(d,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),gPe=Uo({"node_modules/mnemonist/lru-cache.js"(t,e){var r=vPe(),a=XB(),i=QB(),h=Ise();function c(d,b,g){if(arguments.length<2&&(g=d,d=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof d=="function"?new d(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(d){var b=this.head;if(this.head===d)return this;var g=this.backward[d],y=this.forward[d];return this.tail===d?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=d,this.head=d,this.forward[d]=b,this},c.prototype.set=function(d,b){var g=this.items[d];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[d]=g,this.K[g]=d,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(d,b){var g=null,y=null,M=this.items[d];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:d,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[d]=M,this.K[M]=d,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(d){return d in this.items},c.prototype.get=function(d){var b=this.items[d];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(d){var b=this.items[d];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(d,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)d.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var d=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(d>=b)return{done:!0};var x=y[g];return d++,d<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var d=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(d>=b)return{done:!0};var x=y[g];return d++,d<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var d=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(d>=b)return{done:!0};var E=y[g],A=M[g];return d++,d<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var d=new Map,b=this.entries(),g;g=b.next(),!g.done;)d.set(g.value[0],g.value[1]);return Object.defineProperty(d,"constructor",{value:c,enumerable:!1}),d},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(d,b,g,y){if(arguments.length<2){if(y=h.guessLength(d),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(d,function(x,E){M.set(E,x)}),M},e.exports=c}}),bPe=Uo({"node_modules/mnemonist/lru-map.js"(t,e){var r=gPe(),a=XB(),i=QB(),h=Ise();function c(d,b,g){if(arguments.length<2&&(g=d,d=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof d=="function"?new d(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(d,b){var g=this.items.get(d);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(d,g),this.K[g]=d,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(d,b){var g=null,y=null,M=this.items.get(d);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:d,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(d,M),this.K[M]=d,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(d){return this.items.has(d)},c.prototype.get=function(d){var b=this.items.get(d);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(d){var b=this.items.get(d);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(d,b,g,y){if(arguments.length<2){if(y=h.guessLength(d),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(d,function(x,E){M.set(E,x)}),M},e.exports=c}}),yPe=Uo({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,d=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*d;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var O=E>=A*1.5;return Math.round(x/A)+" "+k+(O?"s":"")}}}),wPe=Uo({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=d,h.enabled=g,h.humanize=yPe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,O,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ie=G-(A||G);Y.diff=ie,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(O!==h.namespaces&&(O=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function d(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),O=k.length;for(A=0;A<O;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),_Pe=Uo({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof xe<"u"&&"env"in xe&&(b=xe.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=wPe()(t);var{formatters:d}=e.exports;d.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),MPe=Uo({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function d(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=d(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=d(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ie;for(ie=0;ie<G;ie+=4)k=r[A.charCodeAt(ie)]<<18|r[A.charCodeAt(ie+1)]<<12|r[A.charCodeAt(ie+2)]<<6|r[A.charCodeAt(ie+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ie)]<<2|r[A.charCodeAt(ie+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ie)]<<10|r[A.charCodeAt(ie+1)]<<4|r[A.charCodeAt(ie+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),xPe=Uo({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,d,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(d=c&(1<<-M)-1,c>>=-M,M+=i;M>0;d=d*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return d?NaN:(A?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-y}return(A?-1:1)*d*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var d,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,d=M):(d=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(d++,g/=2),d+x>=M?(b=0,d=M):d+x>=1?(b=(r*g-1)*Math.pow(2,h),d=d+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),d=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(d=d<<h|b,y+=h;y>0;e[a+A]=d&255,A+=k,d/=256,y-=8);e[a+A-k]|=O*128}}}),SPe=Uo({"node_modules/buffer/index.js"(t){"use strict";var e=MPe(),r=xPe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,d.TYPED_ARRAY_SUPPORT=h(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,d.prototype),I}function d(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}d.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return d.from(U,I,P);let Z=O(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return d.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}d.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}d.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}d.allocUnsafe=function(T){return M(T)},d.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!d.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),Z=U.write(T,I);return Z!==P&&(U=U.slice(0,Z)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,d.prototype),U}function O(T){if(d.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),d.alloc(+T)}d.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==d.prototype},d.compare=function(I,P){if(ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),ut(P,Uint8Array)&&(P=d.from(P,P.offset,P.byteLength)),!d.isBuffer(I)||!d.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===P)return 0;let U=I.length,Z=P.length;for(let W=0,fe=Math.min(U,Z);W<fe;++W)if(I[W]!==P[W]){U=I[W],Z=P[W];break}return U<Z?-1:Z<U?1:0},d.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(I,P){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return d.alloc(0);let U;if(P===void 0)for(P=0,U=0;U<I.length;++U)P+=I[U].length;let Z=d.allocUnsafe(P),W=0;for(U=0;U<I.length;++U){let fe=I[U];if(ut(fe,Uint8Array))W+fe.length>Z.length?(d.isBuffer(fe)||(fe=d.from(fe)),fe.copy(Z,W)):Uint8Array.prototype.set.call(Z,fe,W);else if(d.isBuffer(fe))fe.copy(Z,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return Z};function C(T,I){if(d.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let Z=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return be(T).length;default:if(Z)return U?-1:oe(T).length;I=(""+I).toLowerCase(),Z=!0}}d.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return p(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}d.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}d.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<I;P+=2)G(this,P,P+1);return this},d.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<I;P+=4)G(this,P,P+3),G(this,P+1,P+2);return this},d.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<I;P+=8)G(this,P,P+7),G(this,P+1,P+6),G(this,P+2,P+5),G(this,P+3,P+4);return this},d.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(I){if(!d.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:d.compare(this,I)===0},d.prototype.inspect=function(){let I="",P=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(I+=" ... "),"<Buffer "+I+">"},a&&(d.prototype[a]=d.prototype.inspect),d.prototype.compare=function(I,P,U,Z,W){if(ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),!d.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(P===void 0&&(P=0),U===void 0&&(U=I?I.length:0),Z===void 0&&(Z=0),W===void 0&&(W=this.length),P<0||U>I.length||Z<0||W>this.length)throw new RangeError("out of range index");if(Z>=W&&P>=U)return 0;if(Z>=W)return-1;if(P>=U)return 1;if(P>>>=0,U>>>=0,Z>>>=0,W>>>=0,this===I)return 0;let fe=W-Z,st=U-P,ue=Math.min(fe,st),me=this.slice(Z,W),pe=I.slice(P,U);for(let ye=0;ye<ue;++ye)if(me[ye]!==pe[ye]){fe=me[ye],st=pe[ye];break}return fe<st?-1:st<fe?1:0};function ie(T,I,P,U,Z){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=Z?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(Z)return-1;P=T.length-1}else if(P<0)if(Z)P=0;else return-1;if(typeof I=="string"&&(I=d.from(I,U)),d.isBuffer(I))return I.length===0?-1:D(T,I,P,U,Z);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):D(T,[I],P,U,Z);throw new TypeError("val must be string, number or Buffer")}function D(T,I,P,U,Z){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,ye){return W===1?pe[ye]:pe.readUInt16BE(ye*W)}let me;if(Z){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let ye=0;ye<st;ye++)if(ue(T,me+ye)!==ue(I,ye)){pe=!1;break}if(pe)return me}return-1}d.prototype.includes=function(I,P,U){return this.indexOf(I,P,U)!==-1},d.prototype.indexOf=function(I,P,U){return ie(this,I,P,U,!0)},d.prototype.lastIndexOf=function(I,P,U){return ie(this,I,P,U,!1)};function q(T,I,P,U){P=Number(P)||0;let Z=T.length-P;U?(U=Number(U),U>Z&&(U=Z)):U=Z;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Ee(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Ee(le(I),T,P,U)}function n(T,I,P,U){return Ee(be(I),T,P,U)}function s(T,I,P,U){return Ee(ot(I,T.length-P),T,P,U)}d.prototype.write=function(I,P,U,Z){if(P===void 0)Z="utf8",U=this.length,P=0;else if(U===void 0&&typeof P=="string")Z=P,U=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(U)?(U=U>>>0,Z===void 0&&(Z="utf8")):(Z=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-P;if((U===void 0||U>W)&&(U=W),I.length>0&&(U<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let fe=!1;for(;;)switch(Z){case"hex":return q(this,I,P,U);case"utf8":case"utf-8":return V(this,I,P,U);case"ascii":case"latin1":case"binary":return _(this,I,P,U);case"base64":return n(this,I,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,P,U);default:if(fe)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),fe=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],Z=I;for(;Z<P;){let W=T[Z],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(Z+st<=P){let ue,me,pe,ye;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[Z+1],(ue&192)===128&&(ye=(W&31)<<6|ue&63,ye>127&&(fe=ye));break;case 3:ue=T[Z+1],me=T[Z+2],(ue&192)===128&&(me&192)===128&&(ye=(W&15)<<12|(ue&63)<<6|me&63,ye>2047&&(ye<55296||ye>57343)&&(fe=ye));break;case 4:ue=T[Z+1],me=T[Z+2],pe=T[Z+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(ye=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,ye>65535&&ye<1114112&&(fe=ye))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),Z+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]&127);return U}function p(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let Z="";for(let W=I;W<P;++W)Z+=Ye[T[W]];return Z}function v(T,I,P){let U=T.slice(I,P),Z="";for(let W=0;W<U.length-1;W+=2)Z+=String.fromCharCode(U[W]+U[W+1]*256);return Z}d.prototype.slice=function(I,P){let U=this.length;I=~~I,P=P===void 0?U:~~P,I<0?(I+=U,I<0&&(I=0)):I>U&&(I=U),P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),P<I&&(P=I);let Z=this.subarray(I,P);return Object.setPrototypeOf(Z,d.prototype),Z};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)Z+=this[I+fe]*W;return Z},d.prototype.readUintBE=d.prototype.readUIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I+--P],W=1;for(;P>0&&(W*=256);)Z+=this[I+--P]*W;return Z},d.prototype.readUint8=d.prototype.readUInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]|this[I+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]<<8|this[I+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},d.prototype.readBigUInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+U*2**24;return BigInt(Z)+(BigInt(W)<<BigInt(32))}),d.prototype.readBigUInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=P*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U;return(BigInt(Z)<<BigInt(32))+BigInt(W)}),d.prototype.readIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)Z+=this[I+fe]*W;return W*=128,Z>=W&&(Z-=Math.pow(2,8*P)),Z},d.prototype.readIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=P,W=1,fe=this[I+--Z];for(;Z>0&&(W*=256);)fe+=this[I+--Z]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*P)),fe},d.prototype.readInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},d.prototype.readInt16LE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I]|this[I+1]<<8;return U&32768?U|4294901760:U},d.prototype.readInt16BE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I+1]|this[I]<<8;return U&32768?U|4294901760:U},d.prototype.readInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},d.prototype.readInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},d.prototype.readBigInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(U<<24);return(BigInt(Z)<<BigInt(32))+BigInt(P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),d.prototype.readBigInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=(P<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(Z)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U)}),d.prototype.readFloatLE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!0,23,4)},d.prototype.readFloatBE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!1,23,4)},d.prototype.readDoubleLE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!0,52,8)},d.prototype.readDoubleBE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,P,U,Z,W){if(!d.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Z||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(I,P,U,Z){if(I=+I,P=P>>>0,U=U>>>0,!Z){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=1,fe=0;for(this[P]=I&255;++fe<U&&(W*=256);)this[P+fe]=I/W&255;return P+U},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(I,P,U,Z){if(I=+I,P=P>>>0,U=U>>>0,!Z){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=U-1,fe=1;for(this[P+W]=I&255;--W>=0&&(fe*=256);)this[P+W]=I/fe&255;return P+U},d.prototype.writeUint8=d.prototype.writeUInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,255,0),this[P]=I&255,P+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I&255,this[P+1]=I>>>8,P+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I>>>8,this[P+1]=I&255,P+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P+3]=I>>>24,this[P+2]=I>>>16,this[P+1]=I>>>8,this[P]=I&255,P+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4};function B(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}d.prototype.writeBigUInt64LE=ct(function(I,P=0){return B(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ct(function(I,P=0){return F(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(I,P,U,Z){if(I=+I,P=P>>>0,!Z){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=0,fe=1,st=0;for(this[P]=I&255;++W<U&&(fe*=256);)I<0&&st===0&&this[P+W-1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},d.prototype.writeIntBE=function(I,P,U,Z){if(I=+I,P=P>>>0,!Z){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=U-1,fe=1,st=0;for(this[P+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[P+W+1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},d.prototype.writeInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,127,-128),I<0&&(I=255+I+1),this[P]=I&255,P+1},d.prototype.writeInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I&255,this[P+1]=I>>>8,P+2},d.prototype.writeInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I>>>8,this[P+1]=I&255,P+2},d.prototype.writeInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),this[P]=I&255,this[P+1]=I>>>8,this[P+2]=I>>>16,this[P+3]=I>>>24,P+4},d.prototype.writeInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4},d.prototype.writeBigInt64LE=ct(function(I,P=0){return B(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ct(function(I,P=0){return F(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,P,U,Z,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function ae(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}d.prototype.writeFloatLE=function(I,P,U){return ae(this,I,P,!0,U)},d.prototype.writeFloatBE=function(I,P,U){return ae(this,I,P,!1,U)};function re(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}d.prototype.writeDoubleLE=function(I,P,U){return re(this,I,P,!0,U)},d.prototype.writeDoubleBE=function(I,P,U){return re(this,I,P,!1,U)},d.prototype.copy=function(I,P,U,Z){if(!d.isBuffer(I))throw new TypeError("argument should be a Buffer");if(U||(U=0),!Z&&Z!==0&&(Z=this.length),P>=I.length&&(P=I.length),P||(P=0),Z>0&&Z<U&&(Z=U),Z===U||I.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),I.length-P<Z-U&&(Z=I.length-P+U);let W=Z-U;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,U,Z):Uint8Array.prototype.set.call(I,this.subarray(U,Z),P),W},d.prototype.fill=function(I,P,U,Z){if(typeof I=="string"){if(typeof P=="string"?(Z=P,P=0,U=this.length):typeof U=="string"&&(Z=U,U=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!d.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(I.length===1){let fe=I.charCodeAt(0);(Z==="utf8"&&fe<128||Z==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(P<0||this.length<P||this.length<U)throw new RangeError("Out of range index");if(U<=P)return this;P=P>>>0,U=U===void 0?this.length:U>>>0,I||(I=0);let W;if(typeof I=="number")for(W=P;W<U;++W)this[W]=I;else{let fe=d.isBuffer(I)?I:d.from(I,Z),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<U-P;++W)this[W+P]=fe[W%st]}return this};var H={};function K(T,I,P){H[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,Z=P;return Number.isInteger(P)&&Math.abs(P)>2**32?Z=ce(String(P)):typeof P=="bigint"&&(Z=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(Z=ce(Z)),Z+="n"),U+=` It must be ${I}. Received ${Z}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function ne(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&te(I,T.length-(P+1))}function j(T,I,P,U,Z,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new H.ERR_OUT_OF_RANGE("value",st,T)}ne(U,Z,W)}function J(T,I){if(typeof T!="number")throw new H.ERR_INVALID_ARG_TYPE(I,"number",T)}function te(T,I,P){throw Math.floor(T)!==T?(J(T,P),new H.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function ke(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,Z=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!Z){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}Z=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),Z=P;continue}P=(Z-55296<<10|P-56320)+65536}else Z&&(I-=3)>-1&&W.push(239,191,189);if(Z=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,Z,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,Z=P%256,W.push(Z),W.push(U);return W}function be(T){return e.toByteArray(ke(T))}function Ee(T,I,P,U){let Z;for(Z=0;Z<U&&!(Z+P>=I.length||Z>=T.length);++Z)I[Z+P]=T[Z];return Z}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ye=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let Z=0;Z<16;++Z)I[U+Z]=T[P]+T[Z]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),EPe={"@@functional/placeholder":!0};function Xi(t){return t===EPe}function Ka(t){return function e(r){return arguments.length===0||Xi(r)?e:t.apply(this,arguments)}}function Hn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Xi(r)?e:Ka(function(i){return t(r,i)});default:return Xi(r)&&Xi(a)?e:Xi(r)?Ka(function(i){return t(i,a)}):Xi(a)?Ka(function(i){return t(r,i)}):t(r,a)}}}function Xw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,d){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,d,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,d,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,d,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,d,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Bse(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,d=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Xi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Xi(b)?d=!0:h-=1,c+=1}return!d&&h<=0?r.apply(this,a):Xw(Math.max(0,h),Bse(t,a,r))}}var APe=Hn(function(t,e){return t===1?Ka(e):Xw(t,Bse(t,[],e))}),Ose=APe;function eO(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Xi(r)?e:Hn(function(h,c){return t(r,h,c)});case 2:return Xi(r)&&Xi(a)?e:Xi(r)?Hn(function(h,c){return t(h,a,c)}):Xi(a)?Hn(function(h,c){return t(r,h,c)}):Ka(function(h){return t(r,a,h)});default:return Xi(r)&&Xi(a)&&Xi(i)?e:Xi(r)&&Xi(a)?Hn(function(h,c){return t(h,c,i)}):Xi(r)&&Xi(i)?Hn(function(h,c){return t(h,a,c)}):Xi(a)&&Xi(i)?Hn(function(h,c){return t(r,h,c)}):Xi(r)?Ka(function(h){return t(h,a,i)}):Xi(a)?Ka(function(h){return t(r,h,i)}):Xi(i)?Ka(function(h){return t(r,a,h)}):t(r,a,i)}}}var tO=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function RPe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function rO(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!tO(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(RPe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function TPe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var G2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function ise(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function nse(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function kPe(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function Tw(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function IPe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var mB=typeof Object.is=="function"?Object.is:IPe,ase=Object.prototype.toString,BPe=function(){return ase.call(arguments)==="[object Arguments]"?function(t){return ase.call(t)==="[object Arguments]"}:function(t){return Tw("callee",t)}}(),OPe=BPe,PPe=!{toString:null}.propertyIsEnumerable("toString"),ose=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],sse=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),NPe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},CPe=Ka(typeof Object.keys=="function"&&!sse?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=sse&&OPe(t);for(e in t)Tw(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(PPe)for(r=ose.length-1;r>=0;)e=ose[r],Tw(e,t)&&!NPe(a,e)&&(a[a.length]=e),r-=1;return a}),lv=CPe,LPe=Ka(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),fse=LPe;function use(t,e,r,a){var i=ise(t),h=ise(e);function c(d,b){return iO(d,b,r.slice(),a.slice())}return!nse(function(d,b){return!nse(c,b,d)},h,i)}function iO(t,e,r,a){if(mB(t,e))return!0;var i=fse(t);if(i!==fse(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&kPe(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&mB(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!mB(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:use(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:use(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=lv(t);if(c.length!==lv(e).length)return!1;var d=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(Tw(g,e)&&iO(e[g],t[g],d,b)))return!1;h-=1}return!0}var DPe=Hn(function(t,e){return iO(t,e,[],[])}),Pse=DPe;function $Pe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(Pse(t[r],e))return r;r+=1}return-1}function UPe(t,e){return $Pe(e,t,0)>=0}function W2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function gB(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var L2=function(t){return(t<10?"0":"")+t},qPe=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+L2(t.getUTCMonth()+1)+"-"+L2(t.getUTCDate())+"T"+L2(t.getUTCHours())+":"+L2(t.getUTCMinutes())+":"+L2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},FPe=qPe;function jPe(t){return function(){return!t.apply(this,arguments)}}function Nse(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function zPe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function HPe(t){return Object.prototype.toString.call(t)==="[object Object]"}var ZPe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=G2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function KPe(t){return function(e){return new ZPe(t,e)}}var WPe=Hn(rO(["fantasy-land/filter","filter"],KPe,function(t,e){return HPe(e)?Nse(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},lv(e)):zPe(t,e)})),VPe=WPe,GPe=Hn(function(t,e){return VPe(jPe(t),e)}),YPe=GPe;function Cse(t,e){var r=function(h){var c=e.concat([t]);return UPe(h,c)?"<Circular>":Cse(h,c)},a=function(h,c){return W2(function(d){return gB(d)+": "+r(h[d])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+W2(r,t).join(", ")+"))";case"[object Array]":return"["+W2(r,t).concat(a(t,YPe(function(h){return/^\d+$/.test(h)},lv(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):gB(FPe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":gB(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,lv(t)).join(", ")+"}"}}var JPe=Ka(function(t){return Cse(t,[])}),hse=JPe,XPe=Hn(function(t,e){if(t===e)return e;function r(d,b){if(d>b!=b>d)return b>d?b:d}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=hse(t),c=r(h,hse(e));return c!==void 0&&c===h?t:e}),QPe=XPe,eNe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=G2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),tNe=function(t){return function(e){return new eNe(t,e)}},rNe=tNe,iNe=Hn(rO(["fantasy-land/map","map"],rNe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return Ose(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return Nse(function(r,a){return r[a]=t(e[a]),r},{},lv(e));default:return W2(t,e)}})),nNe=iNe,Lse=Number.isInteger||function(t){return t<<0===t};function Dse(t){return Object.prototype.toString.call(t)==="[object String]"}function $se(t,e){var r=t<0?e.length+t:t;return Dse(e)?e.charAt(r):e[r]}var aNe=Hn(function(t,e){if(e!=null)return Lse(t)?$se(t,e):e[t]}),Qw=aNe,oNe=Hn(function(t,e){return nNe(Qw(t),e)}),sNe=oNe,fNe=Ka(function(t){return tO(t)?!0:!t||typeof t!="object"||Dse(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),uNe=fNe,cse=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function hNe(t,e,r){return function(a,i,h){if(uNe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[cse]!=null)return r(a,i,h[cse]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function cNe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var lNe=Hn(function(t,e){return Xw(t.length,function(){return t.apply(e,arguments)})}),dNe=lNe;function pNe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function vNe(t,e,r,a){return t["@@transducer/result"](r[a](dNe(t["@@transducer/step"],t),e))}var mNe=hNe(cNe,vNe,pNe),gNe=mNe,bNe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function yNe(t){return new bNe(t)}var wNe=eO(function(t,e,r){return gNe(typeof t=="function"?yNe(t):t,e,r)}),Use=wNe;function _Ne(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function qse(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return tO(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var MNe=eO(qse("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),xNe=MNe,SNe=Ka(qse("tail",xNe(1,1/0))),ENe=SNe;function Fse(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Xw(arguments[0].length,Use(_Ne,arguments[0],ENe(arguments)))}var ANe=Hn(function(t,e){return Ose(Use(QPe,0,sNe("length",e)),function(){var r=arguments,a=this;return t.apply(a,W2(function(i){return i.apply(a,r)},e))})}),RNe=ANe,TNe=Hn(function(t,e){return e==null||e!==e?t:e}),EB=TNe,kNe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=TPe(this.xf["@@transducer/step"](e,r))),e},t}();function INe(t){return function(e){return new kNe(t,e)}}var BNe=Hn(rO(["find"],INe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),ONe=BNe,PNe=Ka(function(t){return RNe(function(){return Array.prototype.slice.call(arguments,0)},t)}),NNe=PNe;function CNe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];Lse(i)?r=$se(i,r):r=r[i]}return r}var LNe=Hn(CNe),jse=LNe,DNe=eO(function(t,e,r){return Pse(t,Qw(e,r))}),$Ne=DNe,kw=class extends Error{name="InvalidSchedulerLocation"},UNe=class extends Error{name="SchedulerTagNotFound"},qNe=class extends Error{name="TransactionNotFound"},FNe="Url",jNe="Time-To-Live",zNe="Scheduler",AB=t=>Fse(EB([]),ONe($Ne(t,"name")),EB({}),Qw("value")),zse=t=>Fse(e=>{if(!e)throw new qNe(t);return e},Qw("tags"),EB([]));function Hse({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function HNe({fetch:t,GRAPHQL_URL:e}){let r=Hse({fetch:t,GRAPHQL_URL:e}),a=Zse({fetch:t,GRAPHQL_URL:e}),i=`
132
+ nonce: bundlr`),ge.from(i))}};X();ee();Q();var ud=class{_publicKey;ownerLength=Gr[Mr.MULTIAPTOS].pubLength;signatureLength=Gr[Mr.MULTIAPTOS].sigLength;signatureType=Mr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let d=ge.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&d.set(r[b++],g*64);return d.set(h,this.signatureLength-4),d}static async verify(e,r,a){let h=Gr[Mr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),d=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((d[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Wc(ge.from(E),ge.from(r),ge.from(A))||(b=!0)}}return!b}};X();ee();Q();var hd=class extends No{ownerLength=Gr[Mr.TYPEDETHEREUM].pubLength;signatureLength=Gr[Mr.TYPEDETHEREUM].sigLength;signatureType=Mr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+Ig(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new d1(e)}get publicKey(){return ge.from(this.address)}async sign(e){let r=await this.signer._signTypedData(Lg,Dg,{address:this.address,"Transaction hash":e});return ge.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=y8(Lg,Dg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},Lg={name:"Bundlr",version:"1"},Dg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};X();ee();Q();var WT=class{ownerLength=Gr[Mr.TYPEDETHEREUM].pubLength;signatureLength=Gr[Mr.TYPEDETHEREUM].sigLength;signatureType=Mr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=ge.from(this.address)}async sign(e){let r=await this.signer._signTypedData(Lg,Dg,{address:this.address,"Transaction hash":e});return ge.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=y8(Lg,Dg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};X();ee();Q();var tee=mi(zo(),1);var A1=class{signer;publicKey;ownerLength=Gr[Mr.ARWEAVE].pubLength;signatureLength=Gr[Mr.ARWEAVE].sigLength;signatureType=Mr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=tee.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await En().verify(e,r,a)}};X();ee();Q();var $g=class extends No{signatureType=Mr.KYVE};var Ug={1:Qc,2:Ro,3:No,4:sd,5:fd,6:ud,7:hd};X();ee();Q();X();ee();Q();async function J5e(t){return Vc([(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var qg=J5e;X();ee();Q();X();ee();Q();function Fg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function X8(t){return Fg(8,t)}function VT(t){return Fg(2,t)}function X5e(t){return Fg(16,t)}function Q8(t){return Fg(32,t)}function _n(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}X();ee();Q();var zg=mi(zo(),1);X();ee();Q();var Ns=mi(zo(),1);mo();X();ee();Q();var jg=class{buf;pos;constructor(e=ge.alloc(e4),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=ge.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,d,b;for(h=0,c=r;h<c;h++)d=e.charCodeAt(h),d<128?a[i++]=d:d<2048?(a[i++]=d>>6|192,a[i++]=d&63|128):(d&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(b&1023),h++,a[i++]=d>>18|240,a[i++]=d>>12&63|128,a[i++]=d>>6&63|128,a[i++]=d&63|128):(a[i++]=d>>12|224,a[i++]=d>>6&63|128,a[i++]=d&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,d;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,d=268435456;do i=a[this.pos++],c+=(i&127)*d,d*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function GT(t){if(t?.length===0)return ge.allocUnsafe(0);let e=new jg;return e.writeTags(t),e.toBuffer()}function R1(t){return new jg(t).readTags()}Sh();var r4=80,e4=4096,t4=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=_n(this.binary.subarray(0,2));if(Mr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Ns.default.encode(this.rawId)}set id(e){this._id=Ns.default.toBuffer(e)}get rawId(){return xh("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ns.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Gr[this.signatureType].sigLength}get owner(){return Ns.default.encode(this.rawOwner)}get ownerLength(){return Gr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):ge.alloc(0)}get target(){return Ns.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):ge.alloc(0)}get anchor(){return Ns.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=_n(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(_n(this.binary.subarray(e,e+8))==0)return[];let a=_n(this.binary.subarray(e+8,e+16));return R1(ge.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Ns.default.encode(r.name),value:Ns.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=_n(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=_n(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Ns.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await i4(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=ge.from(await En().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Ns.default.encode(e.name),value:Ns.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<r4)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=_n(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),d=_n(c);if(d>e4)return!1;if(h>0)try{if(R1(ge.from(e.subarray(i+16,i+16+d))).length!==h)return!1}catch{return!1}let b=Ug[a],g=await qg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return qg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},T1=t4;Sh();var Lu=32,n4=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Lu;r<Lu+64*this.length;r+=64)e.push(_n(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Lu;r<Lu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(zg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return zg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,zg.default)(xh("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Lu;a<Lu+64*this.length;a+=64){let i=_n(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(ge.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=Lu;y<Lu+64*this.length;y+=64){if(h=_n(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let d=a+r,b=this.binary.subarray(d,d+h),g=new T1(b);return g.rawId=c,g}getById(e){let r=zg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new T1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return _n(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Lu;h<Lu+64*this.length;h+=64){let c=_n(this.binary.subarray(h,h+32)),d=this.binary.subarray(h+32,h+64);if(d.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new T1(g);y.rawId=d,e[i]=y,i++}return e}},YT=n4;function Q5e(t){return new YT(t)}async function e7e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let d=h.isSigned()?h.rawId:await i4(h,e),b=new Uint8Array(64);return b.set(Q8(h.getRaw().byteLength),0),b.set(d,32),r.set(b,64*c),h.getRaw()})).then(h=>ge.concat(h)),i=ge.concat([ge.from(Q8(t.length)),ge.from(r),a]);return new YT(i)}async function ree(t,e){let r=await qg(t),a=await e.sign(r),i=await En().hash(a);return{signature:ge.from(a),id:ge.from(i)}}async function i4(t,e){let{signature:r,id:a}=await ree(t,e);return t.getRaw().set(r,2),a}X();ee();Q();var iee=mi(zo(),1);function Hg(t,e,r){let a=e.publicKey,i=r?.target?iee.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,d=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?GT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?ge.from(t):ge.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+d+g+M,E=ge.alloc(x);if(E.set(VT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(X8(r?.tags?.length??0),O);let N=X8(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new T1(E)}X();ee();Q();X();ee();Q();var JT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};X();ee();Q();X();ee();Q();var tk={};$a(tk,{default:()=>i7e,processStream:()=>fee,streamExportForTesting:()=>n7e,streamSigner:()=>r7e});X();ee();Q();a4();var cd=mi(zo(),1);Sh();async function fee(t){let e=uee(t),r=(await e.next()).value;r=await Fa(e,r,32);let a=_n(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await Fa(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[_n(r.subarray(b,b+32)),(0,cd.default)(ge.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,d=[];for(let[b,g]of h){r=await Fa(e,r,r4),r=await Fa(e,r,2);let y=_n(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Gr[y];r=await Fa(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await Fa(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await Fa(e,r,1);let O=r[0]===1;O&&(r=await Fa(e,r,33));let N=O?r.subarray(1,33):ge.allocUnsafe(0);r=r.subarray(O?33:1),r=await Fa(e,r,1);let L=r[0]===1;L&&(r=await Fa(e,r,33));let C=L?r.subarray(1,33):ge.allocUnsafe(0);r=r.subarray(L?33:1),r=await Fa(e,r,8);let Y=_n(r.subarray(0,8));r=r.subarray(8),r=await Fa(e,r,8);let G=_n(r.subarray(0,8));r=r.subarray(8),r=await Fa(e,r,G);let ie=r.subarray(0,G),D=Y!==0&&G!==0?R1(ge.from(ie)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let q=new oee;q._transform=function(f,u,l){this.push(f),l()};let V=Vc([(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(y.toString()),k,N,C,ie,q]),_=2+M+x+(O?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)q.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(q.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?q.write(r.subarray(0,r.byteLength-(f-n))):q.write(r)}r=r.subarray(r.byteLength-(f-n))}if(q.end(),g!==(0,cd.default)(xh("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Ug[y].verify(k,await V,A))throw new Error("Invalid signature");d.push({id:g,sigName:E,signature:(0,cd.default)(ge.from(A)),target:(0,cd.default)(ge.from(N)),anchor:(0,cd.default)(ge.from(C)),owner:(0,cd.default)(ge.from(k)),tags:D,dataOffset:c+_,dataSize:n}),c+=_+n}return d}async function r7e(t,e,r,a){let i=Hg("",r,a),h=new see,c=[(0,Ni.stringToBuffer)("dataitem"),(0,Ni.stringToBuffer)("1"),(0,Ni.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],d=await Vc(c),b=ge.from(await r.sign(d));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function Fa(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return Fa(t,ge.concat([ge.from(e),ge.from(i)]),r)}async function*uee(t){for await(let e of t)yield e}var i7e=fee,n7e={readBytes:Fa,getReader:uee};var a7e={...XT,stream:tk};globalThis.arbundles??=a7e;X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var o4=new RegExp("^[a-zA-Z0-9_-]{43}$"),tlt=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),rlt=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),ilt=xe.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",nlt="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",o7e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",alt=o7e,k1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",s4="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",rk=1e6,hee="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",ik="pOh2yupSaQCrLI_-ah8tVTiusUdVNTxxeWTQQHNdf30",cee="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var nk=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},ak=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("IOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMIO(){return new ok(Math.floor(this.value*rk))}toString(){return`${this.value}`}},ok=class t extends nk{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toIO(){return new ak(this.valueOf()/rk)}};X();ee();Q();X();ee();Q();var lee=t=>o4.test(t);function mlt(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}function Fh(t){return"process"in t}function jh(t){return"processId"in t&&typeof t.processId=="string"&&lee(t.processId)===!0}function Mlt(t){return t.type==="lease"}X();ee();Q();X();ee();Q();var Of=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},dee=class extends Of{},pee=class extends Of{},vee=class extends Of{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},mee=class extends Of{},f4=class extends Of{},gee=class extends Of{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Du=class extends Of{constructor(){super("Invalid contract configuration")}},bee=class extends Of{constructor(){super("Invalid process configuration")}},yee=class extends Of{};X();ee();Q();var Ff=mi(Uoe(),1);X();ee();Q();var Y1="2.4.0-alpha.8";var $s=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Ff.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Y1},format:Ff.format.combine(Ff.format.timestamp(),Ff.format.json()),transports:[new Ff.transports.Console({format:Ff.format.combine(Ff.format.timestamp(),Ff.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};X();ee();Q();X();ee();Q();var ci;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(let d of h)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(ci||(ci={}));var uB;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(uB||(uB={}));var Jt=ci.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xl=t=>{switch(typeof t){case"undefined":return Jt.undefined;case"string":return Jt.string;case"number":return isNaN(t)?Jt.nan:Jt.number;case"boolean":return Jt.boolean;case"function":return Jt.function;case"bigint":return Jt.bigint;case"symbol":return Jt.symbol;case"object":return Array.isArray(t)?Jt.array:t===null?Jt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Jt.promise:typeof Map<"u"&&t instanceof Map?Jt.map:typeof Set<"u"&&t instanceof Set?Jt.set:typeof Date<"u"&&t instanceof Date?Jt.date:Jt.object;default:return Jt.unknown}},Pt=ci.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"]),oOe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Do=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let 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){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let d=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(r(c))):d[g]=d[g]||{_errors:[]},d=d[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ci.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Do.create=t=>new Do(t);var Q1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Jt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ci.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${ci.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ci.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${ci.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.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}"`:ci.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.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 Pt.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 Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,ci.assertNever(t)}return{message:r}},joe=Q1;function sOe(t){joe=t}function vw(){return joe}var mw=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let d="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)d=g(c,{data:e,defaultError:d}).message;return{...i,path:h,message:d}},fOe=[];function Vt(t,e){let r=vw(),a=mw({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Q1?void 0:Q1].filter(i=>!!i)});t.common.issues.push(a)}var Ca=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},vr=Object.freeze({status:"aborted"}),X1=t=>({status:"dirty",value:t}),Za=t=>({status:"valid",value:t}),hB=t=>t.status==="aborted",cB=t=>t.status==="dirty",O2=t=>t.status==="valid",P2=t=>typeof Promise<"u"&&t instanceof Promise;function gw(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function zoe(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var I2,B2,qs=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,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}},qoe=(t,e)=>{if(O2(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;let r=new Do(t.common.issues);return this._error=r,this._error}}};function Pr(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))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:(c,d)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??d.defaultError}:typeof d.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:d.defaultError}},description:i}}var Nr=class{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 xl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ca,ctx:{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(P2(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return qoe(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(P2(i)?i:Promise.resolve(i));return qoe(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),d=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new $o({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Us.create(this,this._def)}nullable(){return Zu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jh.create(this,this._def)}promise(){return Al.create(this,this._def)}or(e){return Cd.create([this,e],this._def)}and(e){return Ld.create(this,e,this._def)}transform(e){return new $o({...Pr(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Fd({...Pr(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new N2({typeName:lr.ZodBranded,type:this,...Pr(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new jd({...Pr(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return C2.create(this,e)}readonly(){return zd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},uOe=/^c[^\s-]{8,}$/i,hOe=/^[0-9a-z]+$/,cOe=/^[0-9A-HJKMNP-TV-Z]{26}$/,lOe=/^[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,dOe=/^[a-z0-9_-]{21}$/i,pOe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vOe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mOe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fB,gOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bOe=/^(([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})))$/,yOe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Hoe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wOe=new RegExp(`^${Hoe}$`);function Zoe(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function _Oe(t){return new RegExp(`^${Zoe(t)}$`)}function Koe(t){let e=`${Hoe}T${Zoe(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function MOe(t,e){return!!((e==="v4"||!e)&&gOe.test(t)||(e==="v6"||!e)&&bOe.test(t))}var Sl=class t extends Nr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Jt.string){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.string,received:h.parsedType}),vr}let a=new Ca,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,d=e.data.length<h.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?Vt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):d&&Vt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")vOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")fB||(fB=new RegExp(mOe,"u")),fB.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")lOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")dOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")uOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")hOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")cOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Vt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?Koe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?wOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?_Oe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?pOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?MOe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?yOe.test(e.data)||(i=this._getOrReturnCtx(e,i),Vt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):ci.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...ir.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Sl.create=t=>{var e;return new Sl({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Pr(t)})};function xOe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var kd=class t extends Nr{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)!==Jt.number){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.number,received:h.parsedType}),vr}let a,i=new Ca;for(let h of this._def.checks)h.kind==="int"?ci.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?xOe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):ci.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let 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"&&ci.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};kd.create=t=>new kd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Pr(t)});var Id=class t extends Nr{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)!==Jt.bigint){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.bigint,received:h.parsedType}),vr}let a,i=new Ca;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):ci.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Id.create=t=>{var e;return new Id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Pr(t)})};var Bd=class extends Nr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Jt.boolean){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.boolean,received:a.parsedType}),vr}return Za(e.data)}};Bd.create=t=>new Bd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Pr(t)});var Od=class t extends Nr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Jt.date){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_type,expected:Jt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Vt(h,{code:Pt.invalid_date}),vr}let a=new Ca,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Vt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):ci.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let 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(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Od.create=t=>new Od({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Pr(t)});var ev=class extends Nr{_parse(e){if(this._getType(e)!==Jt.symbol){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.symbol,received:a.parsedType}),vr}return Za(e.data)}};ev.create=t=>new ev({typeName:lr.ZodSymbol,...Pr(t)});var Pd=class extends Nr{_parse(e){if(this._getType(e)!==Jt.undefined){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.undefined,received:a.parsedType}),vr}return Za(e.data)}};Pd.create=t=>new Pd({typeName:lr.ZodUndefined,...Pr(t)});var Nd=class extends Nr{_parse(e){if(this._getType(e)!==Jt.null){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.null,received:a.parsedType}),vr}return Za(e.data)}};Nd.create=t=>new Nd({typeName:lr.ZodNull,...Pr(t)});var El=class extends Nr{constructor(){super(...arguments),this._any=!0}_parse(e){return Za(e.data)}};El.create=t=>new El({typeName:lr.ZodAny,...Pr(t)});var Yh=class extends Nr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Za(e.data)}};Yh.create=t=>new Yh({typeName:lr.ZodUnknown,...Pr(t)});var jf=class extends Nr{_parse(e){let r=this._getOrReturnCtx(e);return Vt(r,{code:Pt.invalid_type,expected:Jt.never,received:r.parsedType}),vr}};jf.create=t=>new jf({typeName:lr.ZodNever,...Pr(t)});var tv=class extends Nr{_parse(e){if(this._getType(e)!==Jt.undefined){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.void,received:a.parsedType}),vr}return Za(e.data)}};tv.create=t=>new tv({typeName:lr.ZodVoid,...Pr(t)});var Jh=class t extends Nr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Jt.array)return Vt(r,{code:Pt.invalid_type,expected:Jt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(Vt(r,{code:c?Pt.too_big:Pt.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Vt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Vt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new qs(r,c,r.path,d)))).then(c=>Ca.mergeArray(a,c));let h=[...r.data].map((c,d)=>i.type._parseSync(new qs(r,c,r.path,d)));return Ca.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Jh.create=(t,e)=>new Jh({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Pr(e)});function J1(t){if(t instanceof lo){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Us.create(J1(a))}return new lo({...t._def,shape:()=>e})}else return t instanceof Jh?new Jh({...t._def,type:J1(t.element)}):t instanceof Us?Us.create(J1(t.unwrap())):t instanceof Zu?Zu.create(J1(t.unwrap())):t instanceof Hu?Hu.create(t.items.map(e=>J1(e))):t}var lo=class t extends Nr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ci.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Jt.object){let g=this._getOrReturnCtx(e);return Vt(g,{code:Pt.invalid_type,expected:Jt.object,received:g.parsedType}),vr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof jf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||d.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new qs(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof jf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of d)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")d.length>0&&(Vt(i,{code:Pt.unrecognized_keys,keys:d}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of d){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new qs(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ca.mergeObjectSync(a,g)):Ca.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,d;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(d=ir.errToObj(e).message)!==null&&d!==void 0?d:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return ci.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return J1(this)}partial(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return ci.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Us;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return Woe(ci.objectKeys(this.shape))}};lo.create=(t,e)=>new lo({shape:()=>t,unknownKeys:"strip",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});lo.strictCreate=(t,e)=>new lo({shape:()=>t,unknownKeys:"strict",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});lo.lazycreate=(t,e)=>new lo({shape:t,unknownKeys:"strip",catchall:jf.create(),typeName:lr.ZodObject,...Pr(e)});var Cd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let d of h)if(d.result.status==="valid")return d.result;for(let d of h)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;let c=h.map(d=>new Do(d.ctx.common.issues));return Vt(r,{code:Pt.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let d=c.map(b=>new Do(b));return Vt(r,{code:Pt.invalid_union,unionErrors:d}),vr}}get options(){return this._def.options}};Cd.create=(t,e)=>new Cd({options:t,typeName:lr.ZodUnion,...Pr(e)});var Gh=t=>t instanceof Dd?Gh(t.schema):t instanceof $o?Gh(t.innerType()):t instanceof $d?[t.value]:t instanceof Ud?t.options:t instanceof qd?ci.objectValues(t.enum):t instanceof Fd?Gh(t._def.innerType):t instanceof Pd?[void 0]:t instanceof Nd?[null]:t instanceof Us?[void 0,...Gh(t.unwrap())]:t instanceof Zu?[null,...Gh(t.unwrap())]:t instanceof N2||t instanceof zd?Gh(t.unwrap()):t instanceof jd?Gh(t._def.innerType):[],bw=class t extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.object)return Vt(r,{code:Pt.invalid_type,expected:Jt.object,received:r.parsedType}),vr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Vt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Gh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Pr(a)})}};function lB(t,e){let r=xl(t),a=xl(e);if(t===e)return{valid:!0,data:t};if(r===Jt.object&&a===Jt.object){let i=ci.objectKeys(e),h=ci.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(let d of h){let b=lB(t[d],e[d]);if(!b.valid)return{valid:!1};c[d]=b.data}return{valid:!0,data:c}}else if(r===Jt.array&&a===Jt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],d=e[h],b=lB(c,d);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Jt.date&&a===Jt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ld=class extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(hB(h)||hB(c))return vr;let d=lB(h.value,c.value);return d.valid?((cB(h)||cB(c))&&r.dirty(),{status:r.value,value:d.data}):(Vt(a,{code:Pt.invalid_intersection_types}),vr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Ld.create=(t,e,r)=>new Ld({left:t,right:e,typeName:lr.ZodIntersection,...Pr(r)});var Hu=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.array)return Vt(a,{code:Pt.invalid_type,expected:Jt.array,received:a.parsedType}),vr;if(a.data.length<this._def.items.length)return Vt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&a.data.length>this._def.items.length&&(Vt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,d)=>{let b=this._def.items[d]||this._def.rest;return b?b._parse(new qs(a,c,a.path,d)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>Ca.mergeArray(r,c)):Ca.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Hu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Hu({items:t,typeName:lr.ZodTuple,rest:null,...Pr(e)})};var yw=class t extends Nr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.object)return Vt(a,{code:Pt.invalid_type,expected:Jt.object,received:a.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let d in a.data)i.push({key:h._parse(new qs(a,d,a.path,d)),value:c._parse(new qs(a,a.data[d],a.path,d)),alwaysSet:d in a.data});return a.common.async?Ca.mergeObjectAsync(r,i):Ca.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Nr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Pr(a)}):new t({keyType:Sl.create(),valueType:e,typeName:lr.ZodRecord,...Pr(r)})}},rv=class extends Nr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.map)return Vt(a,{code:Pt.invalid_type,expected:Jt.map,received:a.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([d,b],g)=>({key:i._parse(new qs(a,d,a.path,[g,"key"])),value:h._parse(new qs(a,b,a.path,[g,"value"]))}));if(a.common.async){let d=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),d.set(g.value,y.value)}return{status:r.value,value:d}})}else{let d=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),d.set(g.value,y.value)}return{status:r.value,value:d}}}};rv.create=(t,e,r)=>new rv({valueType:e,keyType:t,typeName:lr.ZodMap,...Pr(r)});var iv=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.set)return Vt(a,{code:Pt.invalid_type,expected:Jt.set,received:a.parsedType}),vr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Vt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Vt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return vr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let d=[...a.data.values()].map((b,g)=>h._parse(new qs(a,b,a.path,g)));return a.common.async?Promise.all(d).then(b=>c(b)):c(d)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};iv.create=(t,e)=>new iv({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Pr(e)});var ww=class t extends Nr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.function)return Vt(r,{code:Pt.invalid_type,expected:Jt.function,received:r.parsedType}),vr;function a(d,b){return mw({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vw(),Q1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(d,b){return mw({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vw(),Q1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Al){let d=this;return Za(async function(...b){let g=new Do([]),y=await d._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await d._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let d=this;return Za(function(...b){let g=d._def.args.safeParse(b,h);if(!g.success)throw new Do([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=d._def.returns.safeParse(y,h);if(!M.success)throw new Do([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Hu.create(e).rest(Yh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Hu.create([]).rest(Yh.create()),returns:r||Yh.create(),typeName:lr.ZodFunction,...Pr(a)})}},Dd=class extends Nr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Dd.create=(t,e)=>new Dd({getter:t,typeName:lr.ZodLazy,...Pr(e)});var $d=class extends Nr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Vt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};$d.create=(t,e)=>new $d({value:t,typeName:lr.ZodLiteral,...Pr(e)});function Woe(t,e){return new Ud({values:t,typeName:lr.ZodEnum,...Pr(e)})}var Ud=class t extends Nr{constructor(){super(...arguments),I2.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{expected:ci.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),vr}if(gw(this,I2,"f")||zoe(this,I2,new Set(this._def.values),"f"),!gw(this,I2,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),vr}return Za(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};I2=new WeakMap;Ud.create=Woe;var qd=class extends Nr{constructor(){super(...arguments),B2.set(this,void 0)}_parse(e){let r=ci.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Jt.string&&a.parsedType!==Jt.number){let i=ci.objectValues(r);return Vt(a,{expected:ci.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),vr}if(gw(this,B2,"f")||zoe(this,B2,new Set(ci.getValidEnumValues(this._def.values)),"f"),!gw(this,B2,"f").has(e.data)){let i=ci.objectValues(r);return Vt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),vr}return Za(e.data)}get enum(){return this._def.values}};B2=new WeakMap;qd.create=(t,e)=>new qd({values:t,typeName:lr.ZodNativeEnum,...Pr(e)});var Al=class extends Nr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.promise&&r.common.async===!1)return Vt(r,{code:Pt.invalid_type,expected:Jt.promise,received:r.parsedType}),vr;let a=r.parsedType===Jt.promise?r.data:Promise.resolve(r.data);return Za(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Al.create=(t,e)=>new Al({type:t,typeName:lr.ZodPromise,...Pr(e)});var $o=class extends Nr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Vt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?X1(b.value):b});{if(r.value==="aborted")return vr;let d=this._def.schema._parseSync({data:c,path:a.path,parent:a});return d.status==="aborted"?vr:d.status==="dirty"||r.value==="dirty"?X1(d.value):d}}if(i.type==="refinement"){let c=d=>{let b=i.refinement(d,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){let d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?vr:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?vr:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!O2(c))return c;let d=i.transform(c.value,h);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>O2(c)?Promise.resolve(i.transform(c.value,h)).then(d=>({status:r.value,value:d})):c);ci.assertNever(i)}};$o.create=(t,e,r)=>new $o({schema:t,typeName:lr.ZodEffects,effect:e,...Pr(r)});$o.createWithPreprocess=(t,e,r)=>new $o({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Pr(r)});var Us=class extends Nr{_parse(e){return this._getType(e)===Jt.undefined?Za(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Us.create=(t,e)=>new Us({innerType:t,typeName:lr.ZodOptional,...Pr(e)});var Zu=class extends Nr{_parse(e){return this._getType(e)===Jt.null?Za(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zu.create=(t,e)=>new Zu({innerType:t,typeName:lr.ZodNullable,...Pr(e)});var Fd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Jt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Fd.create=(t,e)=>new Fd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Pr(e)});var jd=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return P2(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Do(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Do(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};jd.create=(t,e)=>new jd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Pr(e)});var nv=class extends Nr{_parse(e){if(this._getType(e)!==Jt.nan){let a=this._getOrReturnCtx(e);return Vt(a,{code:Pt.invalid_type,expected:Jt.nan,received:a.parsedType}),vr}return{status:"valid",value:e.data}}};nv.create=t=>new nv({typeName:lr.ZodNaN,...Pr(t)});var SOe=Symbol("zod_brand"),N2=class extends Nr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},C2=class t extends Nr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),X1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},zd=class extends Nr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(O2(i)&&(i.value=Object.freeze(i.value)),i);return P2(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};zd.create=(t,e)=>new zd({innerType:t,typeName:lr.ZodReadonly,...Pr(e)});function Voe(t,e={},r){return t?El.create().superRefine((a,i)=>{var h,c;if(!t(a)){let d=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=d.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...g,fatal:b})}}):El.create()}var EOe={object:lo.lazycreate},lr;(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"})(lr||(lr={}));var AOe=(t,e={message:`Input not instance of ${t.name}`})=>Voe(r=>r instanceof t,e),Goe=Sl.create,Yoe=kd.create,ROe=nv.create,TOe=Id.create,Joe=Bd.create,kOe=Od.create,IOe=ev.create,BOe=Pd.create,OOe=Nd.create,POe=El.create,NOe=Yh.create,COe=jf.create,LOe=tv.create,DOe=Jh.create,$Oe=lo.create,UOe=lo.strictCreate,qOe=Cd.create,FOe=bw.create,jOe=Ld.create,zOe=Hu.create,HOe=yw.create,ZOe=rv.create,KOe=iv.create,WOe=ww.create,VOe=Dd.create,GOe=$d.create,YOe=Ud.create,JOe=qd.create,XOe=Al.create,Foe=$o.create,QOe=Us.create,ePe=Zu.create,tPe=$o.createWithPreprocess,rPe=C2.create,iPe=()=>Goe().optional(),nPe=()=>Yoe().optional(),aPe=()=>Joe().optional(),oPe={string:t=>Sl.create({...t,coerce:!0}),number:t=>kd.create({...t,coerce:!0}),boolean:t=>Bd.create({...t,coerce:!0}),bigint:t=>Id.create({...t,coerce:!0}),date:t=>Od.create({...t,coerce:!0})},sPe=vr,mr=Object.freeze({__proto__:null,defaultErrorMap:Q1,setErrorMap:sOe,getErrorMap:vw,makeIssue:mw,EMPTY_PATH:fOe,addIssueToContext:Vt,ParseStatus:Ca,INVALID:vr,DIRTY:X1,OK:Za,isAborted:hB,isDirty:cB,isValid:O2,isAsync:P2,get util(){return ci},get objectUtil(){return uB},ZodParsedType:Jt,getParsedType:xl,ZodType:Nr,datetimeRegex:Koe,ZodString:Sl,ZodNumber:kd,ZodBigInt:Id,ZodBoolean:Bd,ZodDate:Od,ZodSymbol:ev,ZodUndefined:Pd,ZodNull:Nd,ZodAny:El,ZodUnknown:Yh,ZodNever:jf,ZodVoid:tv,ZodArray:Jh,ZodObject:lo,ZodUnion:Cd,ZodDiscriminatedUnion:bw,ZodIntersection:Ld,ZodTuple:Hu,ZodRecord:yw,ZodMap:rv,ZodSet:iv,ZodFunction:ww,ZodLazy:Dd,ZodLiteral:$d,ZodEnum:Ud,ZodNativeEnum:qd,ZodPromise:Al,ZodEffects:$o,ZodTransformer:$o,ZodOptional:Us,ZodNullable:Zu,ZodDefault:Fd,ZodCatch:jd,ZodNaN:nv,BRAND:SOe,ZodBranded:N2,ZodPipeline:C2,ZodReadonly:zd,custom:Voe,Schema:Nr,ZodSchema:Nr,late:EOe,get ZodFirstPartyTypeKind(){return lr},coerce:oPe,any:POe,array:DOe,bigint:TOe,boolean:Joe,date:kOe,discriminatedUnion:FOe,effect:Foe,enum:YOe,function:WOe,instanceof:AOe,intersection:jOe,lazy:VOe,literal:GOe,map:ZOe,nan:ROe,nativeEnum:JOe,never:COe,null:OOe,nullable:ePe,number:Yoe,object:$Oe,oboolean:aPe,onumber:nPe,optional:QOe,ostring:iPe,pipeline:rPe,preprocess:tPe,promise:XOe,record:HOe,set:KOe,strictObject:UOe,string:Goe,symbol:IOe,transformer:Foe,tuple:zOe,undefined:BOe,union:qOe,unknown:NOe,void:LOe,NEVER:sPe,ZodIssueCode:Pt,quotelessJson:oOe,ZodError:Do});X();ee();Q();var Xh=mr.string({description:"Arweave Transaction ID"}).refine(t=>o4.test(t),{message:"Must be an Arweave Transaction ID"}),Xoe=mr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),fPe=mr.string(),ese=mr.array(mr.string()),_w=mr.object({transactionId:Xh.describe("The Target ID of the undername"),ttlSeconds:mr.number()}),dB=mr.record(mr.string(),_w),pB=mr.array(Xh.describe("Controller address")),vB=mr.record(Xh.describe("Holder address"),mr.number()),tse=mr.object({Name:mr.string().describe("The name of the ANT."),Ticker:mr.string().describe("The ticker symbol for the ANT."),Description:mr.string().describe("The description for the ANT."),Keywords:ese.describe("The keywords for the ANT."),Denomination:mr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:Xh.describe("The Owners address."),Controllers:pB.describe("Controllers of the ANT who have administrative privileges."),Records:dB.describe("Records associated with the ANT."),Balances:vB.describe("Balance details for each address holding the ANT."),Logo:Xh.describe("Transaction ID of the ANT logo."),TotalSupply:mr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:mr.boolean().describe("Flag indicating whether the ANT has been initialized."),"Source-Code-TX-ID":Xh.describe("Transaction ID of the Source Code for the ANT.")}),uPe=["evolve","_eval","_default","transfer","balance","balances","totalSupply","info","addController","removeController","controllers","setRecord","removeRecord","record","records","setName","setTicker","setDescription","setKeywords","initializeState","state","releaseName","reassignName"],Qoe=mr.array(mr.string({description:"Handler Name"})).refine(t=>uPe.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),rse=mr.object({Name:mr.string().describe("The name of the ANT."),Owner:Xh.describe("The Owners address."),"Source-Code-TX-ID":Xh.describe("Transaction ID of the Source Code for the ANT."),Ticker:mr.string().describe("The ticker symbol for the ANT."),"Total-Supply":Xoe.describe("Total supply of the ANT in circulation."),Description:fPe.describe("The description for the ANT."),Keywords:ese.describe("The keywords for the ANT."),Logo:Xh.describe("Transaction ID of the ANT logo."),Denomination:Xoe.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:Qoe.optional().describe("List of handlers for the ANT."),HandlerNames:Qoe.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});X();ee();Q();X();ee();Q();var hPe=Object.create,YB=Object.defineProperty,cPe=Object.getOwnPropertyDescriptor,Tse=Object.getOwnPropertyNames,lPe=Object.getPrototypeOf,dPe=Object.prototype.hasOwnProperty,Uo=(t,e)=>function(){return e||(0,t[Tse(t)[0]])((e={exports:{}}).exports,e),e.exports},kse=(t,e)=>{for(var r in e)YB(t,r,{get:e[r],enumerable:!0})},pPe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tse(e))!dPe.call(t,i)&&i!==r&&YB(t,i,{get:()=>e[i],enumerable:!(a=cPe(e,i))||a.enumerable});return t},JB=(t,e,r)=>(r=t!=null?hPe(lPe(t)):{},pPe(e||!t||!t.__esModule?YB(r,"default",{value:t,enumerable:!0}):r,t)),vPe=Uo({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),mPe=Uo({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),XB=Uo({"node_modules/obliterator/foreach.js"(t,e){var r=mPe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,d){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof d!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)d(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(d);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)d(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&d(c[g],g)}}}),QB=Uo({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var d={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,O;for(k=0,O=b.length;k<O;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=d[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),Ise=Uo({"node_modules/mnemonist/utils/iterables.js"(t){var e=XB(),r=QB();function a(d){return Array.isArray(d)||r.isTypedArray(d)}function i(d){if(typeof d.length=="number")return d.length;if(typeof d.size=="number")return d.size}function h(d){var b=i(d),g=typeof b=="number"?new Array(b):[],y=0;return e(d,function(M){g[y++]=M}),g}function c(d){var b=i(d),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(d,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),gPe=Uo({"node_modules/mnemonist/lru-cache.js"(t,e){var r=vPe(),a=XB(),i=QB(),h=Ise();function c(d,b,g){if(arguments.length<2&&(g=d,d=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof d=="function"?new d(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(d){var b=this.head;if(this.head===d)return this;var g=this.backward[d],y=this.forward[d];return this.tail===d?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=d,this.head=d,this.forward[d]=b,this},c.prototype.set=function(d,b){var g=this.items[d];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[d]=g,this.K[g]=d,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(d,b){var g=null,y=null,M=this.items[d];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:d,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[d]=M,this.K[M]=d,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(d){return d in this.items},c.prototype.get=function(d){var b=this.items[d];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(d){var b=this.items[d];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(d,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)d.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var d=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(d>=b)return{done:!0};var x=y[g];return d++,d<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var d=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(d>=b)return{done:!0};var x=y[g];return d++,d<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var d=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(d>=b)return{done:!0};var E=y[g],A=M[g];return d++,d<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var d=new Map,b=this.entries(),g;g=b.next(),!g.done;)d.set(g.value[0],g.value[1]);return Object.defineProperty(d,"constructor",{value:c,enumerable:!1}),d},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(d,b,g,y){if(arguments.length<2){if(y=h.guessLength(d),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(d,function(x,E){M.set(E,x)}),M},e.exports=c}}),bPe=Uo({"node_modules/mnemonist/lru-map.js"(t,e){var r=gPe(),a=XB(),i=QB(),h=Ise();function c(d,b,g){if(arguments.length<2&&(g=d,d=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof d=="function"?new d(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(d,b){var g=this.items.get(d);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(d,g),this.K[g]=d,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(d,b){var g=null,y=null,M=this.items.get(d);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:d,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(d,M),this.K[M]=d,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(d){return this.items.has(d)},c.prototype.get=function(d){var b=this.items.get(d);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(d){var b=this.items.get(d);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(d,b,g,y){if(arguments.length<2){if(y=h.guessLength(d),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(d,function(x,E){M.set(E,x)}),M},e.exports=c}}),yPe=Uo({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,d=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*d;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var O=E>=A*1.5;return Math.round(x/A)+" "+k+(O?"s":"")}}}),wPe=Uo({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=d,h.enabled=g,h.humanize=yPe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,O,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ie=G-(A||G);Y.diff=ie,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(O!==h.namespaces&&(O=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function d(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),O=k.length;for(A=0;A<O;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),_Pe=Uo({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof xe<"u"&&"env"in xe&&(b=xe.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=wPe()(t);var{formatters:d}=e.exports;d.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),MPe=Uo({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function d(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=d(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=d(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ie;for(ie=0;ie<G;ie+=4)k=r[A.charCodeAt(ie)]<<18|r[A.charCodeAt(ie+1)]<<12|r[A.charCodeAt(ie+2)]<<6|r[A.charCodeAt(ie+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ie)]<<2|r[A.charCodeAt(ie+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ie)]<<10|r[A.charCodeAt(ie+1)]<<4|r[A.charCodeAt(ie+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),xPe=Uo({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,d,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(d=c&(1<<-M)-1,c>>=-M,M+=i;M>0;d=d*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return d?NaN:(A?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-y}return(A?-1:1)*d*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var d,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,d=M):(d=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(d++,g/=2),d+x>=M?(b=0,d=M):d+x>=1?(b=(r*g-1)*Math.pow(2,h),d=d+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),d=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(d=d<<h|b,y+=h;y>0;e[a+A]=d&255,A+=k,d/=256,y-=8);e[a+A-k]|=O*128}}}),SPe=Uo({"node_modules/buffer/index.js"(t){"use strict";var e=MPe(),r=xPe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,d.TYPED_ARRAY_SUPPORT=h(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,d.prototype),I}function d(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}d.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return d.from(U,I,P);let Z=O(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return d.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}d.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}d.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}d.allocUnsafe=function(T){return M(T)},d.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!d.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),Z=U.write(T,I);return Z!==P&&(U=U.slice(0,Z)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,d.prototype),U}function O(T){if(d.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),d.alloc(+T)}d.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==d.prototype},d.compare=function(I,P){if(ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),ut(P,Uint8Array)&&(P=d.from(P,P.offset,P.byteLength)),!d.isBuffer(I)||!d.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===P)return 0;let U=I.length,Z=P.length;for(let W=0,fe=Math.min(U,Z);W<fe;++W)if(I[W]!==P[W]){U=I[W],Z=P[W];break}return U<Z?-1:Z<U?1:0},d.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(I,P){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return d.alloc(0);let U;if(P===void 0)for(P=0,U=0;U<I.length;++U)P+=I[U].length;let Z=d.allocUnsafe(P),W=0;for(U=0;U<I.length;++U){let fe=I[U];if(ut(fe,Uint8Array))W+fe.length>Z.length?(d.isBuffer(fe)||(fe=d.from(fe)),fe.copy(Z,W)):Uint8Array.prototype.set.call(Z,fe,W);else if(d.isBuffer(fe))fe.copy(Z,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return Z};function C(T,I){if(d.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let Z=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return be(T).length;default:if(Z)return U?-1:oe(T).length;I=(""+I).toLowerCase(),Z=!0}}d.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return p(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}d.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}d.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<I;P+=2)G(this,P,P+1);return this},d.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<I;P+=4)G(this,P,P+3),G(this,P+1,P+2);return this},d.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<I;P+=8)G(this,P,P+7),G(this,P+1,P+6),G(this,P+2,P+5),G(this,P+3,P+4);return this},d.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(I){if(!d.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:d.compare(this,I)===0},d.prototype.inspect=function(){let I="",P=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(I+=" ... "),"<Buffer "+I+">"},a&&(d.prototype[a]=d.prototype.inspect),d.prototype.compare=function(I,P,U,Z,W){if(ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),!d.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(P===void 0&&(P=0),U===void 0&&(U=I?I.length:0),Z===void 0&&(Z=0),W===void 0&&(W=this.length),P<0||U>I.length||Z<0||W>this.length)throw new RangeError("out of range index");if(Z>=W&&P>=U)return 0;if(Z>=W)return-1;if(P>=U)return 1;if(P>>>=0,U>>>=0,Z>>>=0,W>>>=0,this===I)return 0;let fe=W-Z,st=U-P,ue=Math.min(fe,st),me=this.slice(Z,W),pe=I.slice(P,U);for(let ye=0;ye<ue;++ye)if(me[ye]!==pe[ye]){fe=me[ye],st=pe[ye];break}return fe<st?-1:st<fe?1:0};function ie(T,I,P,U,Z){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=Z?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(Z)return-1;P=T.length-1}else if(P<0)if(Z)P=0;else return-1;if(typeof I=="string"&&(I=d.from(I,U)),d.isBuffer(I))return I.length===0?-1:D(T,I,P,U,Z);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):D(T,[I],P,U,Z);throw new TypeError("val must be string, number or Buffer")}function D(T,I,P,U,Z){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,ye){return W===1?pe[ye]:pe.readUInt16BE(ye*W)}let me;if(Z){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let ye=0;ye<st;ye++)if(ue(T,me+ye)!==ue(I,ye)){pe=!1;break}if(pe)return me}return-1}d.prototype.includes=function(I,P,U){return this.indexOf(I,P,U)!==-1},d.prototype.indexOf=function(I,P,U){return ie(this,I,P,U,!0)},d.prototype.lastIndexOf=function(I,P,U){return ie(this,I,P,U,!1)};function q(T,I,P,U){P=Number(P)||0;let Z=T.length-P;U?(U=Number(U),U>Z&&(U=Z)):U=Z;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Ee(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Ee(le(I),T,P,U)}function n(T,I,P,U){return Ee(be(I),T,P,U)}function s(T,I,P,U){return Ee(ot(I,T.length-P),T,P,U)}d.prototype.write=function(I,P,U,Z){if(P===void 0)Z="utf8",U=this.length,P=0;else if(U===void 0&&typeof P=="string")Z=P,U=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(U)?(U=U>>>0,Z===void 0&&(Z="utf8")):(Z=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-P;if((U===void 0||U>W)&&(U=W),I.length>0&&(U<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let fe=!1;for(;;)switch(Z){case"hex":return q(this,I,P,U);case"utf8":case"utf-8":return V(this,I,P,U);case"ascii":case"latin1":case"binary":return _(this,I,P,U);case"base64":return n(this,I,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,P,U);default:if(fe)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),fe=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],Z=I;for(;Z<P;){let W=T[Z],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(Z+st<=P){let ue,me,pe,ye;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[Z+1],(ue&192)===128&&(ye=(W&31)<<6|ue&63,ye>127&&(fe=ye));break;case 3:ue=T[Z+1],me=T[Z+2],(ue&192)===128&&(me&192)===128&&(ye=(W&15)<<12|(ue&63)<<6|me&63,ye>2047&&(ye<55296||ye>57343)&&(fe=ye));break;case 4:ue=T[Z+1],me=T[Z+2],pe=T[Z+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(ye=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,ye>65535&&ye<1114112&&(fe=ye))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),Z+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]&127);return U}function p(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let Z="";for(let W=I;W<P;++W)Z+=Ye[T[W]];return Z}function v(T,I,P){let U=T.slice(I,P),Z="";for(let W=0;W<U.length-1;W+=2)Z+=String.fromCharCode(U[W]+U[W+1]*256);return Z}d.prototype.slice=function(I,P){let U=this.length;I=~~I,P=P===void 0?U:~~P,I<0?(I+=U,I<0&&(I=0)):I>U&&(I=U),P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),P<I&&(P=I);let Z=this.subarray(I,P);return Object.setPrototypeOf(Z,d.prototype),Z};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)Z+=this[I+fe]*W;return Z},d.prototype.readUintBE=d.prototype.readUIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I+--P],W=1;for(;P>0&&(W*=256);)Z+=this[I+--P]*W;return Z},d.prototype.readUint8=d.prototype.readUInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]|this[I+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]<<8|this[I+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},d.prototype.readBigUInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+U*2**24;return BigInt(Z)+(BigInt(W)<<BigInt(32))}),d.prototype.readBigUInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=P*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U;return(BigInt(Z)<<BigInt(32))+BigInt(W)}),d.prototype.readIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)Z+=this[I+fe]*W;return W*=128,Z>=W&&(Z-=Math.pow(2,8*P)),Z},d.prototype.readIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let Z=P,W=1,fe=this[I+--Z];for(;Z>0&&(W*=256);)fe+=this[I+--Z]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*P)),fe},d.prototype.readInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},d.prototype.readInt16LE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I]|this[I+1]<<8;return U&32768?U|4294901760:U},d.prototype.readInt16BE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I+1]|this[I]<<8;return U&32768?U|4294901760:U},d.prototype.readInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},d.prototype.readInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},d.prototype.readBigInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(U<<24);return(BigInt(Z)<<BigInt(32))+BigInt(P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),d.prototype.readBigInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&te(I,this.length-8);let Z=(P<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(Z)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U)}),d.prototype.readFloatLE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!0,23,4)},d.prototype.readFloatBE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!1,23,4)},d.prototype.readDoubleLE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!0,52,8)},d.prototype.readDoubleBE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,P,U,Z,W){if(!d.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Z||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(I,P,U,Z){if(I=+I,P=P>>>0,U=U>>>0,!Z){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=1,fe=0;for(this[P]=I&255;++fe<U&&(W*=256);)this[P+fe]=I/W&255;return P+U},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(I,P,U,Z){if(I=+I,P=P>>>0,U=U>>>0,!Z){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=U-1,fe=1;for(this[P+W]=I&255;--W>=0&&(fe*=256);)this[P+W]=I/fe&255;return P+U},d.prototype.writeUint8=d.prototype.writeUInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,255,0),this[P]=I&255,P+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I&255,this[P+1]=I>>>8,P+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I>>>8,this[P+1]=I&255,P+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P+3]=I>>>24,this[P+2]=I>>>16,this[P+1]=I>>>8,this[P]=I&255,P+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4};function B(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}d.prototype.writeBigUInt64LE=ct(function(I,P=0){return B(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ct(function(I,P=0){return F(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(I,P,U,Z){if(I=+I,P=P>>>0,!Z){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=0,fe=1,st=0;for(this[P]=I&255;++W<U&&(fe*=256);)I<0&&st===0&&this[P+W-1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},d.prototype.writeIntBE=function(I,P,U,Z){if(I=+I,P=P>>>0,!Z){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=U-1,fe=1,st=0;for(this[P+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[P+W+1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},d.prototype.writeInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,127,-128),I<0&&(I=255+I+1),this[P]=I&255,P+1},d.prototype.writeInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I&255,this[P+1]=I>>>8,P+2},d.prototype.writeInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I>>>8,this[P+1]=I&255,P+2},d.prototype.writeInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),this[P]=I&255,this[P+1]=I>>>8,this[P+2]=I>>>16,this[P+3]=I>>>24,P+4},d.prototype.writeInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4},d.prototype.writeBigInt64LE=ct(function(I,P=0){return B(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ct(function(I,P=0){return F(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,P,U,Z,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function ae(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}d.prototype.writeFloatLE=function(I,P,U){return ae(this,I,P,!0,U)},d.prototype.writeFloatBE=function(I,P,U){return ae(this,I,P,!1,U)};function re(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}d.prototype.writeDoubleLE=function(I,P,U){return re(this,I,P,!0,U)},d.prototype.writeDoubleBE=function(I,P,U){return re(this,I,P,!1,U)},d.prototype.copy=function(I,P,U,Z){if(!d.isBuffer(I))throw new TypeError("argument should be a Buffer");if(U||(U=0),!Z&&Z!==0&&(Z=this.length),P>=I.length&&(P=I.length),P||(P=0),Z>0&&Z<U&&(Z=U),Z===U||I.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),I.length-P<Z-U&&(Z=I.length-P+U);let W=Z-U;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,U,Z):Uint8Array.prototype.set.call(I,this.subarray(U,Z),P),W},d.prototype.fill=function(I,P,U,Z){if(typeof I=="string"){if(typeof P=="string"?(Z=P,P=0,U=this.length):typeof U=="string"&&(Z=U,U=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!d.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(I.length===1){let fe=I.charCodeAt(0);(Z==="utf8"&&fe<128||Z==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(P<0||this.length<P||this.length<U)throw new RangeError("Out of range index");if(U<=P)return this;P=P>>>0,U=U===void 0?this.length:U>>>0,I||(I=0);let W;if(typeof I=="number")for(W=P;W<U;++W)this[W]=I;else{let fe=d.isBuffer(I)?I:d.from(I,Z),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<U-P;++W)this[W+P]=fe[W%st]}return this};var H={};function K(T,I,P){H[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,Z=P;return Number.isInteger(P)&&Math.abs(P)>2**32?Z=ce(String(P)):typeof P=="bigint"&&(Z=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(Z=ce(Z)),Z+="n"),U+=` It must be ${I}. Received ${Z}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function ne(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&te(I,T.length-(P+1))}function j(T,I,P,U,Z,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new H.ERR_OUT_OF_RANGE("value",st,T)}ne(U,Z,W)}function J(T,I){if(typeof T!="number")throw new H.ERR_INVALID_ARG_TYPE(I,"number",T)}function te(T,I,P){throw Math.floor(T)!==T?(J(T,P),new H.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function ke(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,Z=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!Z){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}Z=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),Z=P;continue}P=(Z-55296<<10|P-56320)+65536}else Z&&(I-=3)>-1&&W.push(239,191,189);if(Z=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,Z,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,Z=P%256,W.push(Z),W.push(U);return W}function be(T){return e.toByteArray(ke(T))}function Ee(T,I,P,U){let Z;for(Z=0;Z<U&&!(Z+P>=I.length||Z>=T.length);++Z)I[Z+P]=T[Z];return Z}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ye=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let Z=0;Z<16;++Z)I[U+Z]=T[P]+T[Z]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),EPe={"@@functional/placeholder":!0};function Xi(t){return t===EPe}function Ka(t){return function e(r){return arguments.length===0||Xi(r)?e:t.apply(this,arguments)}}function Hn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Xi(r)?e:Ka(function(i){return t(r,i)});default:return Xi(r)&&Xi(a)?e:Xi(r)?Ka(function(i){return t(i,a)}):Xi(a)?Ka(function(i){return t(r,i)}):t(r,a)}}}function Xw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,d){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,d,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,d,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,d,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,d,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Bse(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,d=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Xi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Xi(b)?d=!0:h-=1,c+=1}return!d&&h<=0?r.apply(this,a):Xw(Math.max(0,h),Bse(t,a,r))}}var APe=Hn(function(t,e){return t===1?Ka(e):Xw(t,Bse(t,[],e))}),Ose=APe;function eO(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Xi(r)?e:Hn(function(h,c){return t(r,h,c)});case 2:return Xi(r)&&Xi(a)?e:Xi(r)?Hn(function(h,c){return t(h,a,c)}):Xi(a)?Hn(function(h,c){return t(r,h,c)}):Ka(function(h){return t(r,a,h)});default:return Xi(r)&&Xi(a)&&Xi(i)?e:Xi(r)&&Xi(a)?Hn(function(h,c){return t(h,c,i)}):Xi(r)&&Xi(i)?Hn(function(h,c){return t(h,a,c)}):Xi(a)&&Xi(i)?Hn(function(h,c){return t(r,h,c)}):Xi(r)?Ka(function(h){return t(h,a,i)}):Xi(a)?Ka(function(h){return t(r,h,i)}):Xi(i)?Ka(function(h){return t(r,a,h)}):t(r,a,i)}}}var tO=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function RPe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function rO(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!tO(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(RPe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function TPe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var G2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function ise(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function nse(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function kPe(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function Tw(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function IPe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var mB=typeof Object.is=="function"?Object.is:IPe,ase=Object.prototype.toString,BPe=function(){return ase.call(arguments)==="[object Arguments]"?function(t){return ase.call(t)==="[object Arguments]"}:function(t){return Tw("callee",t)}}(),OPe=BPe,PPe=!{toString:null}.propertyIsEnumerable("toString"),ose=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],sse=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),NPe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},CPe=Ka(typeof Object.keys=="function"&&!sse?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=sse&&OPe(t);for(e in t)Tw(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(PPe)for(r=ose.length-1;r>=0;)e=ose[r],Tw(e,t)&&!NPe(a,e)&&(a[a.length]=e),r-=1;return a}),lv=CPe,LPe=Ka(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),fse=LPe;function use(t,e,r,a){var i=ise(t),h=ise(e);function c(d,b){return iO(d,b,r.slice(),a.slice())}return!nse(function(d,b){return!nse(c,b,d)},h,i)}function iO(t,e,r,a){if(mB(t,e))return!0;var i=fse(t);if(i!==fse(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&kPe(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&mB(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!mB(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:use(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:use(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=lv(t);if(c.length!==lv(e).length)return!1;var d=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(Tw(g,e)&&iO(e[g],t[g],d,b)))return!1;h-=1}return!0}var DPe=Hn(function(t,e){return iO(t,e,[],[])}),Pse=DPe;function $Pe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(Pse(t[r],e))return r;r+=1}return-1}function UPe(t,e){return $Pe(e,t,0)>=0}function W2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function gB(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var L2=function(t){return(t<10?"0":"")+t},qPe=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+L2(t.getUTCMonth()+1)+"-"+L2(t.getUTCDate())+"T"+L2(t.getUTCHours())+":"+L2(t.getUTCMinutes())+":"+L2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},FPe=qPe;function jPe(t){return function(){return!t.apply(this,arguments)}}function Nse(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function zPe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function HPe(t){return Object.prototype.toString.call(t)==="[object Object]"}var ZPe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=G2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function KPe(t){return function(e){return new ZPe(t,e)}}var WPe=Hn(rO(["fantasy-land/filter","filter"],KPe,function(t,e){return HPe(e)?Nse(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},lv(e)):zPe(t,e)})),VPe=WPe,GPe=Hn(function(t,e){return VPe(jPe(t),e)}),YPe=GPe;function Cse(t,e){var r=function(h){var c=e.concat([t]);return UPe(h,c)?"<Circular>":Cse(h,c)},a=function(h,c){return W2(function(d){return gB(d)+": "+r(h[d])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+W2(r,t).join(", ")+"))";case"[object Array]":return"["+W2(r,t).concat(a(t,YPe(function(h){return/^\d+$/.test(h)},lv(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):gB(FPe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":gB(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,lv(t)).join(", ")+"}"}}var JPe=Ka(function(t){return Cse(t,[])}),hse=JPe,XPe=Hn(function(t,e){if(t===e)return e;function r(d,b){if(d>b!=b>d)return b>d?b:d}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=hse(t),c=r(h,hse(e));return c!==void 0&&c===h?t:e}),QPe=XPe,eNe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=G2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),tNe=function(t){return function(e){return new eNe(t,e)}},rNe=tNe,iNe=Hn(rO(["fantasy-land/map","map"],rNe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return Ose(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return Nse(function(r,a){return r[a]=t(e[a]),r},{},lv(e));default:return W2(t,e)}})),nNe=iNe,Lse=Number.isInteger||function(t){return t<<0===t};function Dse(t){return Object.prototype.toString.call(t)==="[object String]"}function $se(t,e){var r=t<0?e.length+t:t;return Dse(e)?e.charAt(r):e[r]}var aNe=Hn(function(t,e){if(e!=null)return Lse(t)?$se(t,e):e[t]}),Qw=aNe,oNe=Hn(function(t,e){return nNe(Qw(t),e)}),sNe=oNe,fNe=Ka(function(t){return tO(t)?!0:!t||typeof t!="object"||Dse(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),uNe=fNe,cse=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function hNe(t,e,r){return function(a,i,h){if(uNe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[cse]!=null)return r(a,i,h[cse]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function cNe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var lNe=Hn(function(t,e){return Xw(t.length,function(){return t.apply(e,arguments)})}),dNe=lNe;function pNe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function vNe(t,e,r,a){return t["@@transducer/result"](r[a](dNe(t["@@transducer/step"],t),e))}var mNe=hNe(cNe,vNe,pNe),gNe=mNe,bNe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function yNe(t){return new bNe(t)}var wNe=eO(function(t,e,r){return gNe(typeof t=="function"?yNe(t):t,e,r)}),Use=wNe;function _Ne(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function qse(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return tO(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var MNe=eO(qse("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),xNe=MNe,SNe=Ka(qse("tail",xNe(1,1/0))),ENe=SNe;function Fse(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Xw(arguments[0].length,Use(_Ne,arguments[0],ENe(arguments)))}var ANe=Hn(function(t,e){return Ose(Use(QPe,0,sNe("length",e)),function(){var r=arguments,a=this;return t.apply(a,W2(function(i){return i.apply(a,r)},e))})}),RNe=ANe,TNe=Hn(function(t,e){return e==null||e!==e?t:e}),EB=TNe,kNe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=G2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=TPe(this.xf["@@transducer/step"](e,r))),e},t}();function INe(t){return function(e){return new kNe(t,e)}}var BNe=Hn(rO(["find"],INe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),ONe=BNe,PNe=Ka(function(t){return RNe(function(){return Array.prototype.slice.call(arguments,0)},t)}),NNe=PNe;function CNe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];Lse(i)?r=$se(i,r):r=r[i]}return r}var LNe=Hn(CNe),jse=LNe,DNe=eO(function(t,e,r){return Pse(t,Qw(e,r))}),$Ne=DNe,kw=class extends Error{name="InvalidSchedulerLocation"},UNe=class extends Error{name="SchedulerTagNotFound"},qNe=class extends Error{name="TransactionNotFound"},FNe="Url",jNe="Time-To-Live",zNe="Scheduler",AB=t=>Fse(EB([]),ONe($Ne(t,"name")),EB({}),Qw("value")),zse=t=>Fse(e=>{if(!e)throw new qNe(t);return e},Qw("tags"),EB([]));function Hse({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function HNe({fetch:t,GRAPHQL_URL:e}){let r=Hse({fetch:t,GRAPHQL_URL:e}),a=Zse({fetch:t,GRAPHQL_URL:e}),i=`
133
133
  query GetTransactions ($transactionIds: [ID!]!) {
134
134
  transactions(ids: $transactionIds) {
135
135
  edges {
@@ -184,7 +184,7 @@ nonce: bundlr`),ge.from(i))}};X();ee();Q();var ud=class{_publicKey;ownerLength=G
184
184
  }
185
185
  }
186
186
  }
187
- }`,i=_t.object({data:_t.object({transactions:_t.object({edges:_t.array(_t.object({node:_t.record(_t.any())}))})})});return h=>Zr(h).chain(Ui(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async d=>{if(d.ok)return d.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${d.status}: ${await d.text()}`)}).then(i.parse).then(r$e(["data","transactions","edges","0","node"])))).toPromise()}var dUe=JB(_Pe(),1),Jfe=(t="@permaweb/aoconnect")=>{let e=(0,dUe.default)(t);return e.child=r=>Jfe(`${e.namespace}:${r}`),e.tap=(r,...a)=>u$e((...i)=>e(r,...a,...i)),e},Xfe=({url:t,path:e})=>e?e.startsWith("/")?Xfe({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function pUe(t){return _v(a5([]),wv((e,r)=>_v(a$e([],r.name),dO(r.value),Zs(r.name,ic,e))(e),{}),i5(e=>e.length>1?e:e[0]))(t)}function js(t,e){return r=>_fe(pDe([xse(t,"name"),vO(lO(e),xse(e,"value"),uO)]),r)}function Ase(t){return Bfe([[V2(String),hv(t)],[V2(Array),WDe(t)],[uO,SLe]])}function Xd(t){let e;return V2(zs,t)?(e=new Error(vUe(t)),e.stack+=t.stack):V2(Error,t)?e=t:HDe("message",t)?e=new Error(t.message):V2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function vUe(t){return _v(e=>function r(a,i,h){return wv((c,d)=>_v(Bfe([[hv(Tt.invalid_arguments),()=>r(d.argumentsError,422,"Invalid Arguments")],[hv(Tt.invalid_return_type),()=>r(d.returnTypeError,500,"Invalid Return")],[hv(Tt.invalid_union),()=>IDe(b=>r(b,400,"Invalid Union"),d.unionErrors)],[uO,()=>[{...d,status:i,contextCode:h}]]]),pO(c))(d.code),[],a.issues)}(e,400,""),e=>wv((r,a)=>{let{message:i,path:h,contextCode:c}=a,d=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${d}': ${i}.`),r},[],e),QDe(" | "))(t)}var mUe=_t.object({id:_t.string().min(1,{message:"message is required to be a message id"}),processId:_t.string().min(1,{message:"process is required to be a process id"})});function gUe(){return t=>Zr(t).map(mUe.parse).map(()=>t)}var Bb=_t.object({name:_t.string(),value:_t.string()}),bUe=_t.function().args(_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))})).returns(_t.promise(_t.any())),yUe=_t.function().args(_t.object({id:_t.string().min(1,{message:"message id is required"}),processId:_t.string().min(1,{message:"process id is required"})})).returns(_t.promise(_t.any())),wUe=_t.function().args(_t.object({process:_t.string().min(1,{message:"process id is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()})).returns(_t.promise(_t.object({edges:_t.array(_t.object({cursor:_t.string(),node:_t.object({Output:_t.any().optional(),Messages:_t.array(_t.any()).optional(),Spawns:_t.array(_t.any()).optional(),Error:_t.any().optional()})}))}))),Qfe=_t.function().args(_t.object({processId:_t.string(),data:_t.any(),tags:_t.array(Bb),anchor:_t.string().optional(),signer:_t.any()})).returns(_t.promise(_t.object({messageId:_t.string()}).passthrough())),_Ue=_t.function().args(_t.object({data:_t.any(),tags:_t.array(Bb),signer:_t.any()})).returns(_t.promise(_t.object({processId:_t.string()}).passthrough())),MUe=_t.function().args(_t.object({process:_t.string(),message:_t.string(),baseLayer:_t.boolean().optional(),exclude:_t.array(_t.string()).optional()})).returns(_t.promise(_t.object({assignmentId:_t.string()}).passthrough())),eue=Qfe,Qbt=_t.function().args(_t.object({suUrl:_t.string().url(),processId:_t.string()})).returns(_t.promise(_t.object({tags:_t.array(Bb)}).passthrough())),eyt=_t.function().args(_t.string()).returns(_t.promise(_t.object({url:_t.string()}))),xUe=_t.function().args(_t.string()).returns(_t.promise(_t.boolean())),SUe=_t.function().args(_t.string()).returns(_t.promise(_t.object({tags:_t.array(Bb)}).passthrough())),o5=_t.function().args(_t.object({data:_t.any(),tags:_t.array(Bb),target:_t.string().optional(),anchor:_t.string().optional()})).returns(_t.promise(_t.object({id:_t.string(),raw:_t.any()})));function EUe({loadResult:t}){return t=Ui(yUe.implement(t)),e=>Zr({id:e.id,processId:e.processId}).chain(t)}function AUe(t){let e=gUe(t),r=EUe(t);return({message:a,process:i})=>Zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(Xd,Jd).toPromise()}var RUe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function TUe(){return t=>Zr(t.tags).map(a5([])).map(js("Data-Protocol","ao")).map(js("Variant")).map(js("Type")).map(js("SDK")).map(pO(ic,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(RUe.parse).map(Zs("tags",ic,t))}function kUe({logger:t}){return e=>Zr(e).chain(vO(lO(e.data),()=>Wd(e),()=>Wd(Math.random().toString().slice(-4)).map(Zs("data",ic,e)).map(r=>_v(Yd("tags"),js("Content-Type"),dO({name:"Content-Type",value:"text/plain"}),Zs("tags",ic,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function IUe(t){let e=TUe(t),r=kUe(t),a=Qfe.implement(t.deployMessage);return i=>Zr(i).chain(e).chain(r).chain(Ui(({id:h,data:c,tags:d,anchor:b,signer:g})=>a({processId:h,data:c,tags:d,anchor:b,signer:o5.implement(g)}))).map(h=>Zs("messageId",h.messageId,i))}function BUe(t){let e=IUe(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>Zr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(d=>d.messageId).bimap(Xd,Jd).toPromise()}var $2=(t,e,r)=>a=>e(a[t])?Wd(a):Ll(`Tag '${t}': ${r}`);function OUe({loadTransactionMeta:t,logger:e}){return t=Ui(SUe.implement(t)),r=>Zr(r).chain(t).map(Yd("tags")).map(pUe).chain($2("Data-Protocol",Ase("ao"),"value 'ao' was not found on module")).chain($2("Type",Ase("Module"),"value 'Module' was not found on module")).chain($2("Module-Format",MB,"was not found on module")).chain($2("Input-Encoding",MB,"was not found on module")).chain($2("Output-Encoding",MB,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function PUe({logger:t,validateScheduler:e}){return e=Ui(xUe.implement(e)),r=>Zr(r).chain(a=>e(a).chain(i=>i?Wd(a):Ll(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function NUe({logger:t}){return e=>Zr(e).map(t.tap("Checking for signer")).chain(r=>r?Wd(r):Ll("signer not found"))}function CUe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=OUe(t),a=PUe(t),i=NUe(t);return h=>Zr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var LUe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function DUe(){return t=>Zr(t).map(Yd("tags")).map(a5([])).map(js("Data-Protocol","ao")).map(js("Variant")).map(js("Type")).map(js("Module")).map(js("Scheduler")).map(js("SDK")).map(pO(ic,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(LUe.parse).map(Zs("tags",ic,t))}function $Ue({logger:t}){return e=>Zr(e).chain(vO(lO(e.data),()=>Wd(e),()=>Wd(Math.random().toString().slice(-4)).map(Zs("data",ic,e)).map(r=>_v(Yd("tags"),js("Content-Type"),dO({name:"Content-Type",value:"text/plain"}),Zs("tags",ic,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function UUe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=DUe(t),a=$Ue(t),i=_Ue.implement(t.deployProcess);return h=>Zr(h).chain(r).chain(a).chain(Ui(({data:c,tags:d,signer:b})=>i({data:c,tags:d,signer:o5.implement(b)}))).map(c=>Zs("processId",c.processId,h))}function qUe(t){let e=CUe(t),r=UUe(t);return({module:a,scheduler:i,signer:h,tags:c,data:d})=>Zr({module:a,scheduler:i,signer:h,tags:c,data:d}).chain(e).chain(r).map(b=>b.processId).bimap(Xd,Jd).toPromise()}function FUe(t){let e=eue.implement(t.deployMonitor);return r=>Zr(r).chain(Ui(({id:a,signer:i})=>e({processId:a,signer:o5.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Zs("monitorId",a.messageId,r))}function jUe(t){let e=FUe(t);return({process:r,signer:a})=>Zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Xd,Jd).toPromise()}function zUe(t){let e=eue.implement(t.deployUnmonitor);return r=>Zr(r).chain(Ui(({id:a,signer:i})=>e({processId:a,signer:o5.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Zs("monitorId",a.messageId,r))}function HUe(t){let e=zUe(t);return({process:r,signer:a})=>Zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Xd,Jd).toPromise()}var ZUe=_t.object({process:_t.string().min(1,{message:"process identifier is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()});function KUe(){return t=>Zr(t).map(ZUe.parse).map(()=>t)}function WUe({queryResults:t}){return t=Ui(wUe.implement(t)),e=>Zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function VUe(t){let e=KUe(t),r=WUe(t);return({process:a,from:i,to:h,sort:c,limit:d})=>Zr({process:a,from:i,to:h,sort:c,limit:d}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(Xd,Jd).toPromise()}var GUe=_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))});function YUe(){return t=>Zr(t).map(GUe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function JUe({dryrunFetch:t}){return Ui(bUe.implement(t))}function XUe(t){let e=YUe(t),r=JUe(t);return a=>Zr(a).map(QUe).chain(e).chain(r).toPromise()}function QUe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function eqe(t){let e=MUe.implement(t.deployAssign);return r=>Zr(r).chain(Ui(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>Zs("assignmentId",a.assignmentId,r))}function tqe(t){let e=eqe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>Zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Xd,Jd).toPromise()}var rqe="https://arweave.net",iqe="https://mu.ao-testnet.xyz",nqe="https://cu.ao-testnet.xyz";function Rv({GRAPHQL_URL:t,GATEWAY_URL:e=rqe,MU_URL:r=iqe,CU_URL:a=nqe}={}){let i=Jfe();t||(t=Xfe({url:e,path:"/graphql"}));let{validate:h}=gfe({cacheSize:100,GRAPHQL_URL:t}),c=MLe({MAX_SIZE:25}),d=i.child("result"),b=AUe({loadResult:yLe({fetch,CU_URL:a,logger:d}),logger:d}),g=i.child("message"),y=BUe({loadProcessMeta:yB({fetch,cache:c,logger:g}),deployMessage:dLe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=qUe({loadTransactionMeta:lUe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:pLe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=jUe({loadProcessMeta:yB({fetch,cache:c,logger:E}),deployMonitor:vLe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),O=HUe({loadProcessMeta:yB({fetch,cache:c,logger:k}),deployUnmonitor:mLe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=VUe({queryResults:wLe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=XUe({dryrunFetch:bLe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ie=tqe({deployAssign:gLe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:O,dryrun:Y,assign:ie}}var tue={};kse(tue,{createDataItemSigner:()=>kqe});var rue=JB(SPe(),1),iue={};kse(iue,{AVSCTap:()=>Ob,ArweaveSigner:()=>wO,DataItem:()=>Rb,MAX_TAG_BYTES:()=>s5,MIN_BINARY_SIZE:()=>xO,SIG_CONFIG:()=>Av,SignatureConfig:()=>Fs,Signer:()=>sue,createData:()=>cue,default:()=>Aqe,deserializeTags:()=>Jw,indexToType:()=>_O,serializeTags:()=>MO,tagsExceedLimit:()=>hue,warparbundles:()=>Rqe});var aqe=Object.create,bO=Object.defineProperty,oqe=Object.getOwnPropertyDescriptor,sqe=Object.getOwnPropertyNames,fqe=Object.getPrototypeOf,uqe=Object.prototype.hasOwnProperty,ac=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hqe=(t,e)=>{for(var r in e)bO(t,r,{get:e[r],enumerable:!0})},cqe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sqe(e))!uqe.call(t,i)&&i!==r&&bO(t,i,{get:()=>e[i],enumerable:!(a=oqe(e,i))||a.enumerable});return t},Qd=(t,e,r)=>(r=t!=null?aqe(fqe(t)):{},cqe(e||!t||!t.__esModule?bO(r,"default",{value:t,enumerable:!0}):r,t)),lqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,d=a-h,b=i+d,g=ge.alloc(b);for(g.write(r);d--;)g.write("=",c++);return g.toString()}t.default=e}),dqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=lqe();function r(b,g){return g===void 0&&(g="utf8"),ge.isBuffer(b)?h(b.toString("base64")):h(ge.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),ge.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return ge.from(i(b),"base64")}var d=r;d.encode=r,d.decode=a,d.toBase64=i,d.fromBase64=h,d.toBuffer=c,t.default=d}),yO=ac((t,e)=>{e.exports=dqe().default,e.exports.default=e.exports}),nue=ac(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function d(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=d(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=d(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ie;for(ie=0;ie<G;ie+=4)k=r[A.charCodeAt(ie)]<<18|r[A.charCodeAt(ie+1)]<<12|r[A.charCodeAt(ie+2)]<<6|r[A.charCodeAt(ie+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ie)]<<2|r[A.charCodeAt(ie+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ie)]<<10|r[A.charCodeAt(ie+1)]<<4|r[A.charCodeAt(ie+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),aue=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=nue();function r(x){let E=0;for(let O=0;O<x.length;O++)E+=x[O].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let O=1;O<x.length;O++)A.set(new Uint8Array(x[O]),k),k+=x[O].byteLength;return A}t.concatBuffers=r;function a(x){let E=d(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function d(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=d;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),pqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=aue(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},d=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},d,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},d,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((d.algorithm.modulusLength-1)/8)-b.byteLength-2},d,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),d=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},d,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),d=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},d,a.slice(16));return e.concatBuffers([g])}};t.default=r}),vqe=ac(t=>{t.read=function(e,r,a,i,h){var c,d,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(d=c&(1<<-M)-1,c>>=-M,M+=i;M>0;d=d*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return d?NaN:(A?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-y}return(A?-1:1)*d*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var d,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,d=M):(d=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(d++,g/=2),d+x>=M?(b=0,d=M):d+x>=1?(b=(r*g-1)*Math.pow(2,h),d=d+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),d=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(d=d<<h|b,y+=h;y>0;e[a+A]=d&255,A+=k,d/=256,y-=8);e[a+A-k]|=O*128}}),VB=ac(t=>{"use strict";var e=nue(),r=vqe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,d.TYPED_ARRAY_SUPPORT=h(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,d.prototype),I}function d(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}d.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return d.from(U,I,P);let Z=O(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return d.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}d.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}d.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}d.allocUnsafe=function(T){return M(T)},d.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!d.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),Z=U.write(T,I);return Z!==P&&(U=U.slice(0,Z)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,d.prototype),U}function O(T){if(d.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),d.alloc(+T)}d.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==d.prototype},d.compare=function(T,I){if(ut(T,Uint8Array)&&(T=d.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),!d.isBuffer(T)||!d.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let Z=0,W=Math.min(P,U);Z<W;++Z)if(T[Z]!==I[Z]){P=T[Z],U=I[Z];break}return P<U?-1:U<P?1:0},d.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return d.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=d.allocUnsafe(I),Z=0;for(P=0;P<T.length;++P){let W=T[P];if(ut(W,Uint8Array))Z+W.length>U.length?(d.isBuffer(W)||(W=d.from(W)),W.copy(U,Z)):Uint8Array.prototype.set.call(U,W,Z);else if(d.isBuffer(W))W.copy(U,Z);else throw new TypeError('"list" argument must be an Array of Buffers');Z+=W.length}return U};function C(T,I){if(d.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let Z=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return be(T).length;default:if(Z)return U?-1:oe(T).length;I=(""+I).toLowerCase(),Z=!0}}d.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return p(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}d.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}d.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},d.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},d.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},d.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(T){if(!d.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:d.compare(this,T)===0},d.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(d.prototype[a]=d.prototype.inspect),d.prototype.compare=function(T,I,P,U,Z){if(ut(T,Uint8Array)&&(T=d.from(T,T.offset,T.byteLength)),!d.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),Z===void 0&&(Z=this.length),I<0||P>T.length||U<0||Z>this.length)throw new RangeError("out of range index");if(U>=Z&&I>=P)return 0;if(U>=Z)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,Z>>>=0,this===T)return 0;let W=Z-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,Z),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ie(T,I,P,U,Z){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=Z?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(Z)return-1;P=T.length-1}else if(P<0)if(Z)P=0;else return-1;if(typeof I=="string"&&(I=d.from(I,U)),d.isBuffer(I))return I.length===0?-1:D(T,I,P,U,Z);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):D(T,[I],P,U,Z);throw new TypeError("val must be string, number or Buffer")}function D(T,I,P,U,Z){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,ye){return W===1?pe[ye]:pe.readUInt16BE(ye*W)}let me;if(Z){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let ye=0;ye<st;ye++)if(ue(T,me+ye)!==ue(I,ye)){pe=!1;break}if(pe)return me}return-1}d.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},d.prototype.indexOf=function(T,I,P){return ie(this,T,I,P,!0)},d.prototype.lastIndexOf=function(T,I,P){return ie(this,T,I,P,!1)};function q(T,I,P,U){P=Number(P)||0;let Z=T.length-P;U?(U=Number(U),U>Z&&(U=Z)):U=Z;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Ee(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Ee(le(I),T,P,U)}function n(T,I,P,U){return Ee(be(I),T,P,U)}function s(T,I,P,U){return Ee(ot(I,T.length-P),T,P,U)}d.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Z=this.length-I;if((P===void 0||P>Z)&&(P=Z),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return q(this,T,I,P);case"utf8":case"utf-8":return V(this,T,I,P);case"ascii":case"latin1":case"binary":return _(this,T,I,P);case"base64":return n(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],Z=I;for(;Z<P;){let W=T[Z],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(Z+st<=P){let ue,me,pe,ye;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[Z+1],(ue&192)===128&&(ye=(W&31)<<6|ue&63,ye>127&&(fe=ye));break;case 3:ue=T[Z+1],me=T[Z+2],(ue&192)===128&&(me&192)===128&&(ye=(W&15)<<12|(ue&63)<<6|me&63,ye>2047&&(ye<55296||ye>57343)&&(fe=ye));break;case 4:ue=T[Z+1],me=T[Z+2],pe=T[Z+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(ye=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,ye>65535&&ye<1114112&&(fe=ye))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),Z+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]&127);return U}function p(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let Z="";for(let W=I;W<P;++W)Z+=Ye[T[W]];return Z}function v(T,I,P){let U=T.slice(I,P),Z="";for(let W=0;W<U.length-1;W+=2)Z+=String.fromCharCode(U[W]+U[W+1]*256);return Z}d.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,d.prototype),U};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],Z=1,W=0;for(;++W<I&&(Z*=256);)U+=this[T+W]*Z;return U},d.prototype.readUintBE=d.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T+--I],Z=1;for(;I>0&&(Z*=256);)U+=this[T+--I]*Z;return U},d.prototype.readUint8=d.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},d.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,Z=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(Z)<<BigInt(32))}),d.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],Z=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(Z)}),d.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],Z=1,W=0;for(;++W<I&&(Z*=256);)U+=this[T+W]*Z;return Z*=128,U>=Z&&(U-=Math.pow(2,8*I)),U},d.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=I,Z=1,W=this[T+--U];for(;U>0&&(Z*=256);)W+=this[T+--U]*Z;return Z*=128,W>=Z&&(W-=Math.pow(2,8*I)),W},d.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},d.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},d.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},d.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},d.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},d.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),d.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),d.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},d.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},d.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},d.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,P,U,Z,W){if(!d.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Z||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let Z=1,W=0;for(this[I]=T&255;++W<P&&(Z*=256);)this[I+W]=T/Z&255;return I+P},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let Z=P-1,W=1;for(this[I+Z]=T&255;--Z>=0&&(W*=256);)this[I+Z]=T/W&255;return I+P},d.prototype.writeUint8=d.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,255,0),this[I]=T&255,I+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}d.prototype.writeBigUInt64LE=ct(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ct(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let Z=0,W=1,fe=0;for(this[I]=T&255;++Z<P&&(W*=256);)T<0&&fe===0&&this[I+Z-1]!==0&&(fe=1),this[I+Z]=(T/W>>0)-fe&255;return I+P},d.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let Z=P-1,W=1,fe=0;for(this[I+Z]=T&255;--Z>=0&&(W*=256);)T<0&&fe===0&&this[I+Z+1]!==0&&(fe=1),this[I+Z]=(T/W>>0)-fe&255;return I+P},d.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},d.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},d.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},d.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},d.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},d.prototype.writeBigInt64LE=ct(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ct(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,P,U,Z,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function ae(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}d.prototype.writeFloatLE=function(T,I,P){return ae(this,T,I,!0,P)},d.prototype.writeFloatBE=function(T,I,P){return ae(this,T,I,!1,P)};function re(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}d.prototype.writeDoubleLE=function(T,I,P){return re(this,T,I,!0,P)},d.prototype.writeDoubleBE=function(T,I,P){return re(this,T,I,!1,P)},d.prototype.copy=function(T,I,P,U){if(!d.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let Z=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),Z},d.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!d.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let Z;if(typeof T=="number")for(Z=I;Z<P;++Z)this[Z]=T;else{let W=d.isBuffer(T)?T:d.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(Z=0;Z<P-I;++Z)this[Z+I]=W[Z%fe]}return this};var H={};function K(T,I,P){H[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,Z=P;return Number.isInteger(P)&&Math.abs(P)>2**32?Z=ce(String(P)):typeof P=="bigint"&&(Z=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(Z=ce(Z)),Z+="n"),U+=` It must be ${I}. Received ${Z}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function ne(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&te(I,T.length-(P+1))}function j(T,I,P,U,Z,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new H.ERR_OUT_OF_RANGE("value",st,T)}ne(U,Z,W)}function J(T,I){if(typeof T!="number")throw new H.ERR_INVALID_ARG_TYPE(I,"number",T)}function te(T,I,P){throw Math.floor(T)!==T?(J(T,P),new H.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function ke(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,Z=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!Z){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}Z=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),Z=P;continue}P=(Z-55296<<10|P-56320)+65536}else Z&&(I-=3)>-1&&W.push(239,191,189);if(Z=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,Z,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,Z=P%256,W.push(Z),W.push(U);return W}function be(T){return e.toByteArray(ke(T))}function Ee(T,I,P,U){let Z;for(Z=0;Z<U&&!(Z+P>=I.length||Z>=T.length);++Z)I[Z+P]=T[Z];return Z}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ye=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let Z=0;Z<16;++Z)I[U+Z]=T[P]+T[Z]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),mqe=ac((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:VB().Buffer,Crypto:window.crypto}):e.exports={Buffer:VB().Buffer,Crypto:crypto}}),oue={};hqe(oue,{AVSCTap:()=>Ob,ArweaveSigner:()=>wO,DataItem:()=>Rb,MAX_TAG_BYTES:()=>s5,MIN_BINARY_SIZE:()=>xO,SIG_CONFIG:()=>Av,SignatureConfig:()=>Fs,Signer:()=>sue,createData:()=>cue,deserializeTags:()=>Jw,indexToType:()=>_O,serializeTags:()=>MO,tagsExceedLimit:()=>hue});var sue=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},gqe=Qd(yO(),1),Zf=Qd(aue(),1);async function fue(t){if(Array.isArray(t)){let i=(0,Zf.concatBuffers)([(0,Zf.stringToBuffer)("list"),(0,Zf.stringToBuffer)(t.length.toString())]);return await uue(t,await tc().hash(i,"SHA-384"))}let e=t,r=(0,Zf.concatBuffers)([(0,Zf.stringToBuffer)("blob"),(0,Zf.stringToBuffer)(e.byteLength.toString())]),a=(0,Zf.concatBuffers)([await tc().hash(r,"SHA-384"),await tc().hash(e,"SHA-384")]);return await tc().hash(a,"SHA-384")}async function uue(t,e){if(t.length<1)return e;let r=(0,Zf.concatBuffers)([e,await fue(t[0])]),a=await tc().hash(r,"SHA-384");return await uue(t.slice(1),a)}var SB=Qd(pqe(),1),bqe=SB.default.default?SB.default.default:SB.default,yqe=class extends bqe{getPublicKey(t){throw new Error("Unimplemented")}},wqe;function tc(){return wqe??=new yqe}var Fs;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Fs||(Fs={}));var Av={[Fs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Fs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Fs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Fs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Fs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Fs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Fs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},wO=class{signatureType=1;ownerLength=Av[1].pubLength;signatureLength=Av[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return gqe.default.toBuffer(this.pk)}sign(t){return tc().sign(this.jwk,t)}static async verify(t,e,r){return await tc().verify(t,e,r)}},_O={1:wO},Ku=Qd(yO(),1);async function GB(t){return fue([(0,Zf.stringToBuffer)("dataitem"),(0,Zf.stringToBuffer)("1"),(0,Zf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function _qe(t,e){let r=await GB(t),a=await e.sign(r),i=await tc().hash(a);return{signature:ge.from(a),id:ge.from(i)}}async function Mqe(t,e){let{signature:r,id:a}=await _qe(t,e);return t.getRaw().set(r,2),a}var Ob=class{buf;pos;constructor(t=ge.alloc(s5),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=ge.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,d;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((d=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(d&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function MO(t){let e=new Ob;return e.writeTags(t),e.toBuffer()}function hue(t){let e=new Ob;return e.writeTags(t),e.tagsExceedLimit()}function Jw(t){return new Ob(t).readTags()}function Rl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function xqe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function Rse(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var Sqe=Qd(mqe(),1),ov=Qd(VB(),1),s5=4096,xO=80,Rb=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=Rl(this.binary.subarray(0,2));if(Fs?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return Rb.verify(this.binary)}get id(){return(async()=>Ku.default.encode(await this.rawId))()}set id(t){this._id=Ku.default.toBuffer(t)}get rawId(){return(async()=>ov.Buffer.from(await Sqe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ku.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Av[this.signatureType].sigLength}get owner(){return Ku.default.encode(this.rawOwner)}get ownerLength(){return Av[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ov.Buffer.alloc(0)}get target(){return Ku.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ov.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=Rl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(Rl(this.binary.subarray(t,t+8))==0)return[];let e=Rl(this.binary.subarray(t+8,t+16));return Jw(ov.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Ku.default.encode(t.name),value:Ku.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=Rl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=Rl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Ku.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await Mqe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=ov.Buffer.from(await tc().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Ku.default.encode(t.name),value:Ku.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<xO)return!1;let e=new Rb(t),r=e.signatureType,a=e.getTagsStart(),i=Rl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=Rl(h);if(c>s5)return!1;if(i>0)try{if(Jw(ov.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let d=_O[r],b=await GB(e);return await d.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return GB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},Eqe=Qd(yO(),1);function cue(t,e,r){let a=e.publicKey,i=r?.target?Eqe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,d=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?MO(r.tags):null,g=16+(b?b.byteLength:0),y=ge.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+d+g+M,E=ge.alloc(x);if(E.set(xqe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(Rse(r?.tags?.length??0),O);let N=Rse(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new Rb(E)}var SO={...oue};globalThis.arbundles??=SO;var Aqe=SO,Rqe=SO;globalThis.Buffer||(globalThis.Buffer=rue.Buffer);var{DataItem:Tqe}=iue;function kqe(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=d=>new Tqe(d)})=>{let d=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c(rue.Buffer.from(d));return{id:await b.id,raw:await b.getRaw()}}}var Iqe=globalThis.GATEWAY_URL||void 0,Bqe=globalThis.MU_URL||void 0,Oqe=globalThis.CU_URL||void 0,Pqe=globalThis.GRAPHQL_URL||void 0,{result:tyt,results:ryt,message:iyt,spawn:nyt,monitor:ayt,unmonitor:oyt,dryrun:syt,assign:fyt}=Rv({GATEWAY_URL:Iqe,MU_URL:Bqe,CU_URL:Oqe,GRAPHQL_URL:Pqe}),lue=tue.createDataItemSigner;X();ee();Q();var ahe=mi(nhe(),1),zb=ahe.default.init({host:"arweave.net",port:443,protocol:"https"});async function Q3t({signer:t,module:e=hee,luaCodeTxId:r=ik,ao:a=Rv(),scheduler:i=cee,state:h,stateContractTxId:c,antRegistryId:d=s4,logger:b=$s.default,arweave:g=zb}){let y=ep.init({process:new La({processId:d,ao:a,logger:b}),signer:t}),M=await g.transactions.getData(r,{decode:!0,string:!0}),x=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:d}]}),E=new La({processId:x,ao:a,logger:b}),{id:A}=await E.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:M,signer:t});if(b.info("Spawned ANT",{processId:x,module:e,scheduler:i,luaCodeTxId:r,evalId:A}),h){let{id:O}=await E.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(h),signer:t});b.info("Initialized ANT",{processId:x,module:e,scheduler:i,initializeMsgId:O})}let{id:k}=await y.register({processId:x});return b.info("Registered ANT to ANT Registry",{processId:x,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:d}),x}async function e8t({signer:t,processId:e,luaCodeTxId:r=ik,ao:a=Rv(),logger:i=$s.default,arweave:h=zb}){let c=new La({processId:e,ao:a,logger:i}),d=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:d,signer:t});return i.info("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function QFe(t){let e=mr.object({name:mr.string(),value:mr.union([mr.string(),mr.number()])}),r=mr.function().args(mr.object({data:mr.union([mr.string(),mr.instanceof(ge)]),tags:mr.array(e).optional(),target:mr.string().optional(),anchor:mr.string().optional()})).returns(mr.promise(mr.object({id:mr.string(),raw:mr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Ul(t){return QFe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let c=Hg(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:lue(t)}X();ee();Q();function ql(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var v5=class{static init({signer:e,strict:r=!1,...a}){if(Fh(a)||jh(a))return e?new eP({signer:e,strict:r,...a}):new m5({strict:r,...a});throw new Du}},m5=class{process;strict;constructor(e){if(this.strict=e.strict||!1,Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&ql(tse.passthrough().and(mr.object({Records:mr.record(mr.string(),_w.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&ql(rse.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&ql(_w.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&ql(dB,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&ql(pB,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&ql(vB,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&ql(mr.number(),i),i}},eP=class extends m5{signer;constructor({signer:e,...r}){super(r),this.signer=Ul(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Description",value:JSON.stringify(e)}],signer:this.signer})}async releaseName({name:e,ioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r}],signer:this.signer})}};X();ee();Q();var ep=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new tP({...a,signer:r})}return new g5(e)}},g5=class{process;constructor(e){if(e&&(jh(e)||Fh(e)))if(Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du;else this.process=new La({processId:s4})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},tP=class extends g5{signer;constructor({signer:e,...r}){super(r),this.signer=Ul(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};X();ee();Q();X();ee();Q();X();ee();Q();function rP(t){try{return JSON.parse(t)}catch{return t}}var La=class{logger;processId;ao;constructor({processId:e,ao:r=Rv(),logger:a=$s.default}){this.processId=e,this.logger=a,this.ao=r}async read({tags:e,retries:r=3}){let a=0,i;for(;a<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let h=await this.ao.dryrun({process:this.processId,tags:e});if(h.Messages===void 0||h.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let d=h.Messages[0].Tags.find(g=>g.name==="Error");if(d)throw new Error(`${d.Value}: ${h.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:h.Messages[0].Data}),h.Messages[0].Data===void 0?{}:rP(h.Messages[0].Data)}catch(h){a++,this.logger.debug(`Read attempt ${a} failed`,{error:h,tags:e}),i=h,await new Promise(c=>setTimeout(c,2**a*1e3))}throw i}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let d=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:Y1}],data:r,signer:a});this.logger.debug("Sent message to process",{messageId:d,processId:this.processId});let b=await this.ao.result({message:d,process:this.processId});if(this.logger.debug("Message result",{output:b,messageId:d,processId:this.processId}),b.Messages?.length===0||b.Messages===void 0)return{id:d};let y=b.Messages[0].Tags.find(x=>x.name==="Error");if(y){let x=b.Messages[0].Data;throw new f4(`${y.Value}: ${x}`)}if(b.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(b.Messages[0].Data===void 0)return{id:d};let M=rP(b.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:d,processId:this.processId}),{id:d,result:M}}catch(d){if(this.logger.error("Error sending message to process",{error:d.message,processId:this.processId,tags:e}),d.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:d.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=d;else throw d}throw c}};var Hb=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new iP({...a,signer:r})}return new b5(e)}},b5=class{process;arweave;constructor(e,r=zb){if(!e)this.process=new La({processId:k1});else if(Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du;this.arweave=r}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(e){let a=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getEpoch(e){let a=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){let a=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){let a=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGateways(e){let a=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(e=>({timestamp:e.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(e){let a=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getPrescribedNames(e){let a=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getObservations(e){let a=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getDistributions(e){let a=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h}){let d=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(b=>({timestamp:b.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(b=>b.value!==void 0);return this.process.read({tags:d})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getAuctions(e){let a=[{name:"Action",value:"Auctions"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getAuction({name:e}){let r=[{name:"Action",value:"Auction-Info"},{name:"Name",value:e}];return this.process.read({tags:r})}async getAuctionPrices({name:e,type:r,years:a,timestamp:i,intervalMs:h}){let c=[{name:"Action",value:"Auction-Prices"},{name:"Name",value:e},{name:"Timestamp",value:i?.toString()??Date.now().toString()},{name:"Purchase-Type",value:r??"lease"},{name:"Years",value:r==null||r==="lease"?a?.toString()??"1":void 0},{name:"Price-Interval-Ms",value:h?.toString()??"900000"}].filter(d=>d.value!==void 0);return this.process.read({tags:c})}},iP=class extends b5{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new La({processId:k1})}),this.signer=Ul(e);else if(Fh(r))super({process:r.process}),this.signer=Ul(e);else if(jh(r))super({process:new La({processId:r.processId})}),this.signer=Ul(e);else throw new Du}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:d,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},O=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"FQDN",value:i},{name:"Label",value:h},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Note",value:d},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Auto-Stake",value:M?.toString()},{name:"Observer-Address",value:x}].filter(N=>N.value!==void 0);return this.process.send({signer:this.signer,tags:O})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,delegateRewardShareRatio:r,fqdn:a,label:i,minDelegatedStake:h,note:c,port:d,properties:b,protocol:g,autoStake:y,observerAddress:M},x){let{tags:E=[]}=x||{},k=[...E,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:i},{name:"Note",value:c},{name:"FQDN",value:a},{name:"Port",value:d?.toString()},{name:"Properties",value:b},{name:"Protocol",value:g},{name:"Observer-Address",value:M},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Delegate-Reward-Share-Ratio",value:r?.toString()},{name:"Min-Delegated-Stake",value:h?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(O=>O.value!==void 0);return this.process.send({signer:this.signer,tags:k})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async upgradeRecord(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name}]})}async extendLease(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()}]})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()}]})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async submitAuctionBid(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Auction-Bid"},{name:"Name",value:e.name},{name:"Process-Id",value:e.processId},{name:"Quantity",value:e.quantity?.toString()??void 0},{name:"Purchase-Type",value:e.type||"lease"},{name:"Years",value:e.years?.toString()??void 0}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();function Zb(t,e){return function(){return t.apply(e,arguments)}}var{toString:eje}=Object.prototype,{getPrototypeOf:oP}=Object,w5=(t=>e=>{let r=eje.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xf=t=>(t=t.toLowerCase(),e=>w5(e)===t),_5=t=>e=>typeof e===t,{isArray:kv}=Array,Kb=_5("undefined");function tje(t){return t!==null&&!Kb(t)&&t.constructor!==null&&!Kb(t.constructor)&&jo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var fhe=Xf("ArrayBuffer");function rje(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&fhe(t.buffer),e}var ije=_5("string"),jo=_5("function"),uhe=_5("number"),M5=t=>t!==null&&typeof t=="object",nje=t=>t===!0||t===!1,y5=t=>{if(w5(t)!=="object")return!1;let e=oP(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},aje=Xf("Date"),oje=Xf("File"),sje=Xf("Blob"),fje=Xf("FileList"),uje=t=>M5(t)&&jo(t.pipe),hje=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||jo(t.append)&&((e=w5(t))==="formdata"||e==="object"&&jo(t.toString)&&t.toString()==="[object FormData]"))},cje=Xf("URLSearchParams"),[lje,dje,pje,vje]=["ReadableStream","Request","Response","Headers"].map(Xf),mje=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wb(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let a,i;if(typeof t!="object"&&(t=[t]),kv(t))for(a=0,i=t.length;a<i;a++)e.call(null,t[a],a,t);else{let h=r?Object.getOwnPropertyNames(t):Object.keys(t),c=h.length,d;for(a=0;a<c;a++)d=h[a],e.call(null,t[d],d,t)}}function hhe(t,e){e=e.toLowerCase();let r=Object.keys(t),a=r.length,i;for(;a-- >0;)if(i=r[a],e===i.toLowerCase())return i;return null}var tp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,che=t=>!Kb(t)&&t!==tp;function aP(){let{caseless:t}=che(this)&&this||{},e={},r=(a,i)=>{let h=t&&hhe(e,i)||i;y5(e[h])&&y5(a)?e[h]=aP(e[h],a):y5(a)?e[h]=aP({},a):kv(a)?e[h]=a.slice():e[h]=a};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Wb(arguments[a],r);return e}var gje=(t,e,r,{allOwnKeys:a}={})=>(Wb(e,(i,h)=>{r&&jo(i)?t[h]=Zb(i,r):t[h]=i},{allOwnKeys:a}),t),bje=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yje=(t,e,r,a)=>{t.prototype=Object.create(e.prototype,a),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},wje=(t,e,r,a)=>{let i,h,c,d={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),h=i.length;h-- >0;)c=i[h],(!a||a(c,t,e))&&!d[c]&&(e[c]=t[c],d[c]=!0);t=r!==!1&&oP(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},_je=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let a=t.indexOf(e,r);return a!==-1&&a===r},Mje=t=>{if(!t)return null;if(kv(t))return t;let e=t.length;if(!uhe(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},xje=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&oP(Uint8Array)),Sje=(t,e)=>{let a=(t&&t[Symbol.iterator]).call(t),i;for(;(i=a.next())&&!i.done;){let h=i.value;e.call(t,h[0],h[1])}},Eje=(t,e)=>{let r,a=[];for(;(r=t.exec(e))!==null;)a.push(r);return a},Aje=Xf("HTMLFormElement"),Rje=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,i){return a.toUpperCase()+i}),ohe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Tje=Xf("RegExp"),lhe=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),a={};Wb(r,(i,h)=>{let c;(c=e(i,h,t))!==!1&&(a[h]=c||i)}),Object.defineProperties(t,a)},kje=t=>{lhe(t,(e,r)=>{if(jo(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let a=t[r];if(jo(a)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ije=(t,e)=>{let r={},a=i=>{i.forEach(h=>{r[h]=!0})};return kv(t)?a(t):a(String(t).split(e)),r},Bje=()=>{},Oje=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,nP="abcdefghijklmnopqrstuvwxyz",she="0123456789",dhe={DIGIT:she,ALPHA:nP,ALPHA_DIGIT:nP+nP.toUpperCase()+she},Pje=(t=16,e=dhe.ALPHA_DIGIT)=>{let r="",{length:a}=e;for(;t--;)r+=e[Math.random()*a|0];return r};function Nje(t){return!!(t&&jo(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Cje=t=>{let e=new Array(10),r=(a,i)=>{if(M5(a)){if(e.indexOf(a)>=0)return;if(!("toJSON"in a)){e[i]=a;let h=kv(a)?[]:{};return Wb(a,(c,d)=>{let b=r(c,i+1);!Kb(b)&&(h[d]=b)}),e[i]=void 0,h}}return a};return r(t,0)},Lje=Xf("AsyncFunction"),Dje=t=>t&&(M5(t)||jo(t))&&jo(t.then)&&jo(t.catch),phe=((t,e)=>t?setImmediate:e?((r,a)=>(tp.addEventListener("message",({source:i,data:h})=>{i===tp&&h===r&&a.length&&a.shift()()},!1),i=>{a.push(i),tp.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",jo(tp.postMessage)),$je=typeof queueMicrotask<"u"?queueMicrotask.bind(tp):typeof xe<"u"&&xe.nextTick||phe,vt={isArray:kv,isArrayBuffer:fhe,isBuffer:tje,isFormData:hje,isArrayBufferView:rje,isString:ije,isNumber:uhe,isBoolean:nje,isObject:M5,isPlainObject:y5,isReadableStream:lje,isRequest:dje,isResponse:pje,isHeaders:vje,isUndefined:Kb,isDate:aje,isFile:oje,isBlob:sje,isRegExp:Tje,isFunction:jo,isStream:uje,isURLSearchParams:cje,isTypedArray:xje,isFileList:fje,forEach:Wb,merge:aP,extend:gje,trim:mje,stripBOM:bje,inherits:yje,toFlatObject:wje,kindOf:w5,kindOfTest:Xf,endsWith:_je,toArray:Mje,forEachEntry:Sje,matchAll:Eje,isHTMLForm:Aje,hasOwnProperty:ohe,hasOwnProp:ohe,reduceDescriptors:lhe,freezeMethods:kje,toObjectSet:Ije,toCamelCase:Rje,noop:Bje,toFiniteNumber:Oje,findKey:hhe,global:tp,isContextDefined:che,ALPHABET:dhe,generateString:Pje,isSpecCompliantForm:Nje,toJSONObject:Cje,isAsyncFn:Lje,isThenable:Dje,setImmediate:phe,asap:$je};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();function Iv(t,e,r,a,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),a&&(this.request=a),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(Iv,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});var vhe=Iv.prototype,mhe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{mhe[t]={value:t}});Object.defineProperties(Iv,mhe);Object.defineProperty(vhe,"isAxiosError",{value:!0});Iv.from=(t,e,r,a,i,h)=>{let c=Object.create(vhe);return vt.toFlatObject(t,c,function(b){return b!==Error.prototype},d=>d!=="isAxiosError"),Iv.call(c,t.message,e,r,a,i),c.cause=t,c.name=t.name,h&&Object.assign(c,h),c};var wr=Iv;X();ee();Q();var x5=null;function sP(t){return vt.isPlainObject(t)||vt.isArray(t)}function bhe(t){return vt.endsWith(t,"[]")?t.slice(0,-2):t}function ghe(t,e,r){return t?t.concat(e).map(function(i,h){return i=bhe(i),!r&&h?"["+i+"]":i}).join(r?".":""):e}function Uje(t){return vt.isArray(t)&&!t.some(sP)}var qje=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Fje(t,e,r){if(!vt.isObject(t))throw new TypeError("target must be an object");e=e||new(x5||FormData),r=vt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,O){return!vt.isUndefined(O[k])});let a=r.metaTokens,i=r.visitor||y,h=r.dots,c=r.indexes,b=(r.Blob||typeof Blob<"u"&&Blob)&&vt.isSpecCompliantForm(e);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function g(A){if(A===null)return"";if(vt.isDate(A))return A.toISOString();if(!b&&vt.isBlob(A))throw new wr("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(A)||vt.isTypedArray(A)?b&&typeof Blob=="function"?new Blob([A]):ge.from(A):A}function y(A,k,O){let N=A;if(A&&!O&&typeof A=="object"){if(vt.endsWith(k,"{}"))k=a?k:k.slice(0,-2),A=JSON.stringify(A);else if(vt.isArray(A)&&Uje(A)||(vt.isFileList(A)||vt.endsWith(k,"[]"))&&(N=vt.toArray(A)))return k=bhe(k),N.forEach(function(C,Y){!(vt.isUndefined(C)||C===null)&&e.append(c===!0?ghe([k],Y,h):c===null?k:k+"[]",g(C))}),!1}return sP(A)?!0:(e.append(ghe(O,k,h),g(A)),!1)}let M=[],x=Object.assign(qje,{defaultVisitor:y,convertValue:g,isVisitable:sP});function E(A,k){if(!vt.isUndefined(A)){if(M.indexOf(A)!==-1)throw Error("Circular reference detected in "+k.join("."));M.push(A),vt.forEach(A,function(N,L){(!(vt.isUndefined(N)||N===null)&&i.call(e,N,vt.isString(L)?L.trim():L,k,x))===!0&&E(N,k?k.concat(L):[L])}),M.pop()}}if(!vt.isObject(t))throw new TypeError("data must be an object");return E(t),e}var Fl=Fje;function yhe(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(a){return e[a]})}function whe(t,e){this._pairs=[],t&&Fl(t,this,e)}var _he=whe.prototype;_he.append=function(e,r){this._pairs.push([e,r])};_he.toString=function(e){let r=e?function(a){return e.call(this,a,yhe)}:yhe;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var S5=whe;function jje(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vb(t,e,r){if(!e)return t;let a=r&&r.encode||jje,i=r&&r.serialize,h;if(i?h=i(e,r):h=vt.isURLSearchParams(e)?e.toString():new S5(e,r).toString(a),h){let c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+h}return t}X();ee();Q();var fP=class{constructor(){this.handlers=[]}use(e,r,a){return this.handlers.push({fulfilled:e,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(a){a!==null&&e(a)})}},uP=fP;X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var E5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var Mhe=typeof URLSearchParams<"u"?URLSearchParams:S5;X();ee();Q();var xhe=typeof FormData<"u"?FormData:null;X();ee();Q();var She=typeof Blob<"u"?Blob:null;var Ehe={isBrowser:!0,classes:{URLSearchParams:Mhe,FormData:xhe,Blob:She},protocols:["http","https","file","blob","url","data"]};var lP={};$a(lP,{hasBrowserEnv:()=>cP,hasStandardBrowserEnv:()=>zje,hasStandardBrowserWebWorkerEnv:()=>Hje,navigator:()=>hP,origin:()=>Zje});X();ee();Q();var cP=typeof window<"u"&&typeof document<"u",hP=typeof navigator=="object"&&navigator||void 0,zje=cP&&(!hP||["ReactNative","NativeScript","NS"].indexOf(hP.product)<0),Hje=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zje=cP&&window.location.href||"http://localhost";var Rn={...lP,...Ehe};function dP(t,e){return Fl(t,new Rn.classes.URLSearchParams,Object.assign({visitor:function(r,a,i,h){return Rn.isNode&&vt.isBuffer(r)?(this.append(a,r.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},e))}X();ee();Q();function Kje(t){return vt.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Wje(t){let e={},r=Object.keys(t),a,i=r.length,h;for(a=0;a<i;a++)h=r[a],e[h]=t[h];return e}function Vje(t){function e(r,a,i,h){let c=r[h++];if(c==="__proto__")return!0;let d=Number.isFinite(+c),b=h>=r.length;return c=!c&&vt.isArray(i)?i.length:c,b?(vt.hasOwnProp(i,c)?i[c]=[i[c],a]:i[c]=a,!d):((!i[c]||!vt.isObject(i[c]))&&(i[c]=[]),e(r,a,i[c],h)&&vt.isArray(i[c])&&(i[c]=Wje(i[c])),!d)}if(vt.isFormData(t)&&vt.isFunction(t.entries)){let r={};return vt.forEachEntry(t,(a,i)=>{e(Kje(a),i,r,0)}),r}return null}var A5=Vje;function Gje(t,e,r){if(vt.isString(t))try{return(e||JSON.parse)(t),vt.trim(t)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(t)}var pP={transitional:E5,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let a=r.getContentType()||"",i=a.indexOf("application/json")>-1,h=vt.isObject(e);if(h&&vt.isHTMLForm(e)&&(e=new FormData(e)),vt.isFormData(e))return i?JSON.stringify(A5(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(h){if(a.indexOf("application/x-www-form-urlencoded")>-1)return dP(e,this.formSerializer).toString();if((d=vt.isFileList(e))||a.indexOf("multipart/form-data")>-1){let b=this.env&&this.env.FormData;return Fl(d?{"files[]":e}:e,b&&new b,this.formSerializer)}}return h||i?(r.setContentType("application/json",!1),Gje(e)):e}],transformResponse:[function(e){let r=this.transitional||pP.transitional,a=r&&r.forcedJSONParsing,i=this.responseType==="json";if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(a&&!this.responseType||i)){let c=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(d){if(c)throw d.name==="SyntaxError"?wr.from(d,wr.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rn.classes.FormData,Blob:Rn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],t=>{pP.headers[t]={}});var Bv=pP;X();ee();Q();X();ee();Q();var Yje=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ahe=t=>{let e={},r,a,i;return t&&t.split(`
187
+ }`,i=_t.object({data:_t.object({transactions:_t.object({edges:_t.array(_t.object({node:_t.record(_t.any())}))})})});return h=>Zr(h).chain(Ui(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async d=>{if(d.ok)return d.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${d.status}: ${await d.text()}`)}).then(i.parse).then(r$e(["data","transactions","edges","0","node"])))).toPromise()}var dUe=JB(_Pe(),1),Jfe=(t="@permaweb/aoconnect")=>{let e=(0,dUe.default)(t);return e.child=r=>Jfe(`${e.namespace}:${r}`),e.tap=(r,...a)=>u$e((...i)=>e(r,...a,...i)),e},Xfe=({url:t,path:e})=>e?e.startsWith("/")?Xfe({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function pUe(t){return _v(a5([]),wv((e,r)=>_v(a$e([],r.name),dO(r.value),Zs(r.name,ic,e))(e),{}),i5(e=>e.length>1?e:e[0]))(t)}function js(t,e){return r=>_fe(pDe([xse(t,"name"),vO(lO(e),xse(e,"value"),uO)]),r)}function Ase(t){return Bfe([[V2(String),hv(t)],[V2(Array),WDe(t)],[uO,SLe]])}function Xd(t){let e;return V2(zs,t)?(e=new Error(vUe(t)),e.stack+=t.stack):V2(Error,t)?e=t:HDe("message",t)?e=new Error(t.message):V2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function vUe(t){return _v(e=>function r(a,i,h){return wv((c,d)=>_v(Bfe([[hv(Tt.invalid_arguments),()=>r(d.argumentsError,422,"Invalid Arguments")],[hv(Tt.invalid_return_type),()=>r(d.returnTypeError,500,"Invalid Return")],[hv(Tt.invalid_union),()=>IDe(b=>r(b,400,"Invalid Union"),d.unionErrors)],[uO,()=>[{...d,status:i,contextCode:h}]]]),pO(c))(d.code),[],a.issues)}(e,400,""),e=>wv((r,a)=>{let{message:i,path:h,contextCode:c}=a,d=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${d}': ${i}.`),r},[],e),QDe(" | "))(t)}var mUe=_t.object({id:_t.string().min(1,{message:"message is required to be a message id"}),processId:_t.string().min(1,{message:"process is required to be a process id"})});function gUe(){return t=>Zr(t).map(mUe.parse).map(()=>t)}var Bb=_t.object({name:_t.string(),value:_t.string()}),bUe=_t.function().args(_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))})).returns(_t.promise(_t.any())),yUe=_t.function().args(_t.object({id:_t.string().min(1,{message:"message id is required"}),processId:_t.string().min(1,{message:"process id is required"})})).returns(_t.promise(_t.any())),wUe=_t.function().args(_t.object({process:_t.string().min(1,{message:"process id is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()})).returns(_t.promise(_t.object({edges:_t.array(_t.object({cursor:_t.string(),node:_t.object({Output:_t.any().optional(),Messages:_t.array(_t.any()).optional(),Spawns:_t.array(_t.any()).optional(),Error:_t.any().optional()})}))}))),Qfe=_t.function().args(_t.object({processId:_t.string(),data:_t.any(),tags:_t.array(Bb),anchor:_t.string().optional(),signer:_t.any()})).returns(_t.promise(_t.object({messageId:_t.string()}).passthrough())),_Ue=_t.function().args(_t.object({data:_t.any(),tags:_t.array(Bb),signer:_t.any()})).returns(_t.promise(_t.object({processId:_t.string()}).passthrough())),MUe=_t.function().args(_t.object({process:_t.string(),message:_t.string(),baseLayer:_t.boolean().optional(),exclude:_t.array(_t.string()).optional()})).returns(_t.promise(_t.object({assignmentId:_t.string()}).passthrough())),eue=Qfe,Qbt=_t.function().args(_t.object({suUrl:_t.string().url(),processId:_t.string()})).returns(_t.promise(_t.object({tags:_t.array(Bb)}).passthrough())),eyt=_t.function().args(_t.string()).returns(_t.promise(_t.object({url:_t.string()}))),xUe=_t.function().args(_t.string()).returns(_t.promise(_t.boolean())),SUe=_t.function().args(_t.string()).returns(_t.promise(_t.object({tags:_t.array(Bb)}).passthrough())),o5=_t.function().args(_t.object({data:_t.any(),tags:_t.array(Bb),target:_t.string().optional(),anchor:_t.string().optional()})).returns(_t.promise(_t.object({id:_t.string(),raw:_t.any()})));function EUe({loadResult:t}){return t=Ui(yUe.implement(t)),e=>Zr({id:e.id,processId:e.processId}).chain(t)}function AUe(t){let e=gUe(t),r=EUe(t);return({message:a,process:i})=>Zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(Xd,Jd).toPromise()}var RUe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function TUe(){return t=>Zr(t.tags).map(a5([])).map(js("Data-Protocol","ao")).map(js("Variant")).map(js("Type")).map(js("SDK")).map(pO(ic,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(RUe.parse).map(Zs("tags",ic,t))}function kUe({logger:t}){return e=>Zr(e).chain(vO(lO(e.data),()=>Wd(e),()=>Wd(Math.random().toString().slice(-4)).map(Zs("data",ic,e)).map(r=>_v(Yd("tags"),js("Content-Type"),dO({name:"Content-Type",value:"text/plain"}),Zs("tags",ic,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function IUe(t){let e=TUe(t),r=kUe(t),a=Qfe.implement(t.deployMessage);return i=>Zr(i).chain(e).chain(r).chain(Ui(({id:h,data:c,tags:d,anchor:b,signer:g})=>a({processId:h,data:c,tags:d,anchor:b,signer:o5.implement(g)}))).map(h=>Zs("messageId",h.messageId,i))}function BUe(t){let e=IUe(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>Zr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(d=>d.messageId).bimap(Xd,Jd).toPromise()}var $2=(t,e,r)=>a=>e(a[t])?Wd(a):Ll(`Tag '${t}': ${r}`);function OUe({loadTransactionMeta:t,logger:e}){return t=Ui(SUe.implement(t)),r=>Zr(r).chain(t).map(Yd("tags")).map(pUe).chain($2("Data-Protocol",Ase("ao"),"value 'ao' was not found on module")).chain($2("Type",Ase("Module"),"value 'Module' was not found on module")).chain($2("Module-Format",MB,"was not found on module")).chain($2("Input-Encoding",MB,"was not found on module")).chain($2("Output-Encoding",MB,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function PUe({logger:t,validateScheduler:e}){return e=Ui(xUe.implement(e)),r=>Zr(r).chain(a=>e(a).chain(i=>i?Wd(a):Ll(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function NUe({logger:t}){return e=>Zr(e).map(t.tap("Checking for signer")).chain(r=>r?Wd(r):Ll("signer not found"))}function CUe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=OUe(t),a=PUe(t),i=NUe(t);return h=>Zr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var LUe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function DUe(){return t=>Zr(t).map(Yd("tags")).map(a5([])).map(js("Data-Protocol","ao")).map(js("Variant")).map(js("Type")).map(js("Module")).map(js("Scheduler")).map(js("SDK")).map(pO(ic,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(LUe.parse).map(Zs("tags",ic,t))}function $Ue({logger:t}){return e=>Zr(e).chain(vO(lO(e.data),()=>Wd(e),()=>Wd(Math.random().toString().slice(-4)).map(Zs("data",ic,e)).map(r=>_v(Yd("tags"),js("Content-Type"),dO({name:"Content-Type",value:"text/plain"}),Zs("tags",ic,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function UUe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=DUe(t),a=$Ue(t),i=_Ue.implement(t.deployProcess);return h=>Zr(h).chain(r).chain(a).chain(Ui(({data:c,tags:d,signer:b})=>i({data:c,tags:d,signer:o5.implement(b)}))).map(c=>Zs("processId",c.processId,h))}function qUe(t){let e=CUe(t),r=UUe(t);return({module:a,scheduler:i,signer:h,tags:c,data:d})=>Zr({module:a,scheduler:i,signer:h,tags:c,data:d}).chain(e).chain(r).map(b=>b.processId).bimap(Xd,Jd).toPromise()}function FUe(t){let e=eue.implement(t.deployMonitor);return r=>Zr(r).chain(Ui(({id:a,signer:i})=>e({processId:a,signer:o5.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Zs("monitorId",a.messageId,r))}function jUe(t){let e=FUe(t);return({process:r,signer:a})=>Zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Xd,Jd).toPromise()}function zUe(t){let e=eue.implement(t.deployUnmonitor);return r=>Zr(r).chain(Ui(({id:a,signer:i})=>e({processId:a,signer:o5.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Zs("monitorId",a.messageId,r))}function HUe(t){let e=zUe(t);return({process:r,signer:a})=>Zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Xd,Jd).toPromise()}var ZUe=_t.object({process:_t.string().min(1,{message:"process identifier is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()});function KUe(){return t=>Zr(t).map(ZUe.parse).map(()=>t)}function WUe({queryResults:t}){return t=Ui(wUe.implement(t)),e=>Zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function VUe(t){let e=KUe(t),r=WUe(t);return({process:a,from:i,to:h,sort:c,limit:d})=>Zr({process:a,from:i,to:h,sort:c,limit:d}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(Xd,Jd).toPromise()}var GUe=_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))});function YUe(){return t=>Zr(t).map(GUe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function JUe({dryrunFetch:t}){return Ui(bUe.implement(t))}function XUe(t){let e=YUe(t),r=JUe(t);return a=>Zr(a).map(QUe).chain(e).chain(r).toPromise()}function QUe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function eqe(t){let e=MUe.implement(t.deployAssign);return r=>Zr(r).chain(Ui(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>Zs("assignmentId",a.assignmentId,r))}function tqe(t){let e=eqe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>Zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Xd,Jd).toPromise()}var rqe="https://arweave.net",iqe="https://mu.ao-testnet.xyz",nqe="https://cu.ao-testnet.xyz";function Rv({GRAPHQL_URL:t,GATEWAY_URL:e=rqe,MU_URL:r=iqe,CU_URL:a=nqe}={}){let i=Jfe();t||(t=Xfe({url:e,path:"/graphql"}));let{validate:h}=gfe({cacheSize:100,GRAPHQL_URL:t}),c=MLe({MAX_SIZE:25}),d=i.child("result"),b=AUe({loadResult:yLe({fetch,CU_URL:a,logger:d}),logger:d}),g=i.child("message"),y=BUe({loadProcessMeta:yB({fetch,cache:c,logger:g}),deployMessage:dLe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=qUe({loadTransactionMeta:lUe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:pLe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=jUe({loadProcessMeta:yB({fetch,cache:c,logger:E}),deployMonitor:vLe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),O=HUe({loadProcessMeta:yB({fetch,cache:c,logger:k}),deployUnmonitor:mLe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=VUe({queryResults:wLe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=XUe({dryrunFetch:bLe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ie=tqe({deployAssign:gLe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:O,dryrun:Y,assign:ie}}var tue={};kse(tue,{createDataItemSigner:()=>kqe});var rue=JB(SPe(),1),iue={};kse(iue,{AVSCTap:()=>Ob,ArweaveSigner:()=>wO,DataItem:()=>Rb,MAX_TAG_BYTES:()=>s5,MIN_BINARY_SIZE:()=>xO,SIG_CONFIG:()=>Av,SignatureConfig:()=>Fs,Signer:()=>sue,createData:()=>cue,default:()=>Aqe,deserializeTags:()=>Jw,indexToType:()=>_O,serializeTags:()=>MO,tagsExceedLimit:()=>hue,warparbundles:()=>Rqe});var aqe=Object.create,bO=Object.defineProperty,oqe=Object.getOwnPropertyDescriptor,sqe=Object.getOwnPropertyNames,fqe=Object.getPrototypeOf,uqe=Object.prototype.hasOwnProperty,ac=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hqe=(t,e)=>{for(var r in e)bO(t,r,{get:e[r],enumerable:!0})},cqe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sqe(e))!uqe.call(t,i)&&i!==r&&bO(t,i,{get:()=>e[i],enumerable:!(a=oqe(e,i))||a.enumerable});return t},Qd=(t,e,r)=>(r=t!=null?aqe(fqe(t)):{},cqe(e||!t||!t.__esModule?bO(r,"default",{value:t,enumerable:!0}):r,t)),lqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,d=a-h,b=i+d,g=ge.alloc(b);for(g.write(r);d--;)g.write("=",c++);return g.toString()}t.default=e}),dqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=lqe();function r(b,g){return g===void 0&&(g="utf8"),ge.isBuffer(b)?h(b.toString("base64")):h(ge.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),ge.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return ge.from(i(b),"base64")}var d=r;d.encode=r,d.decode=a,d.toBase64=i,d.fromBase64=h,d.toBuffer=c,t.default=d}),yO=ac((t,e)=>{e.exports=dqe().default,e.exports.default=e.exports}),nue=ac(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function d(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=d(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=d(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ie;for(ie=0;ie<G;ie+=4)k=r[A.charCodeAt(ie)]<<18|r[A.charCodeAt(ie+1)]<<12|r[A.charCodeAt(ie+2)]<<6|r[A.charCodeAt(ie+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ie)]<<2|r[A.charCodeAt(ie+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ie)]<<10|r[A.charCodeAt(ie+1)]<<4|r[A.charCodeAt(ie+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),aue=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=nue();function r(x){let E=0;for(let O=0;O<x.length;O++)E+=x[O].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let O=1;O<x.length;O++)A.set(new Uint8Array(x[O]),k),k+=x[O].byteLength;return A}t.concatBuffers=r;function a(x){let E=d(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function d(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=d;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),pqe=ac(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=aue(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},d=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},d,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},d,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((d.algorithm.modulusLength-1)/8)-b.byteLength-2},d,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),d=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},d,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),d=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},d,a.slice(16));return e.concatBuffers([g])}};t.default=r}),vqe=ac(t=>{t.read=function(e,r,a,i,h){var c,d,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(d=c&(1<<-M)-1,c>>=-M,M+=i;M>0;d=d*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return d?NaN:(A?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-y}return(A?-1:1)*d*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var d,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,d=M):(d=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(d++,g/=2),d+x>=M?(b=0,d=M):d+x>=1?(b=(r*g-1)*Math.pow(2,h),d=d+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),d=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(d=d<<h|b,y+=h;y>0;e[a+A]=d&255,A+=k,d/=256,y-=8);e[a+A-k]|=O*128}}),VB=ac(t=>{"use strict";var e=nue(),r=vqe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,d.TYPED_ARRAY_SUPPORT=h(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,d.prototype),I}function d(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}d.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return d.from(U,I,P);let Z=O(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return d.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}d.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}d.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}d.allocUnsafe=function(T){return M(T)},d.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!d.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),Z=U.write(T,I);return Z!==P&&(U=U.slice(0,Z)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,d.prototype),U}function O(T){if(d.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),d.alloc(+T)}d.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==d.prototype},d.compare=function(T,I){if(ut(T,Uint8Array)&&(T=d.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),!d.isBuffer(T)||!d.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let Z=0,W=Math.min(P,U);Z<W;++Z)if(T[Z]!==I[Z]){P=T[Z],U=I[Z];break}return P<U?-1:U<P?1:0},d.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return d.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=d.allocUnsafe(I),Z=0;for(P=0;P<T.length;++P){let W=T[P];if(ut(W,Uint8Array))Z+W.length>U.length?(d.isBuffer(W)||(W=d.from(W)),W.copy(U,Z)):Uint8Array.prototype.set.call(U,W,Z);else if(d.isBuffer(W))W.copy(U,Z);else throw new TypeError('"list" argument must be an Array of Buffers');Z+=W.length}return U};function C(T,I){if(d.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let Z=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return be(T).length;default:if(Z)return U?-1:oe(T).length;I=(""+I).toLowerCase(),Z=!0}}d.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return p(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}d.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}d.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},d.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},d.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},d.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(T){if(!d.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:d.compare(this,T)===0},d.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(d.prototype[a]=d.prototype.inspect),d.prototype.compare=function(T,I,P,U,Z){if(ut(T,Uint8Array)&&(T=d.from(T,T.offset,T.byteLength)),!d.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),Z===void 0&&(Z=this.length),I<0||P>T.length||U<0||Z>this.length)throw new RangeError("out of range index");if(U>=Z&&I>=P)return 0;if(U>=Z)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,Z>>>=0,this===T)return 0;let W=Z-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,Z),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ie(T,I,P,U,Z){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=Z?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(Z)return-1;P=T.length-1}else if(P<0)if(Z)P=0;else return-1;if(typeof I=="string"&&(I=d.from(I,U)),d.isBuffer(I))return I.length===0?-1:D(T,I,P,U,Z);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):D(T,[I],P,U,Z);throw new TypeError("val must be string, number or Buffer")}function D(T,I,P,U,Z){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,ye){return W===1?pe[ye]:pe.readUInt16BE(ye*W)}let me;if(Z){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let ye=0;ye<st;ye++)if(ue(T,me+ye)!==ue(I,ye)){pe=!1;break}if(pe)return me}return-1}d.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},d.prototype.indexOf=function(T,I,P){return ie(this,T,I,P,!0)},d.prototype.lastIndexOf=function(T,I,P){return ie(this,T,I,P,!1)};function q(T,I,P,U){P=Number(P)||0;let Z=T.length-P;U?(U=Number(U),U>Z&&(U=Z)):U=Z;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Ee(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Ee(le(I),T,P,U)}function n(T,I,P,U){return Ee(be(I),T,P,U)}function s(T,I,P,U){return Ee(ot(I,T.length-P),T,P,U)}d.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Z=this.length-I;if((P===void 0||P>Z)&&(P=Z),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return q(this,T,I,P);case"utf8":case"utf-8":return V(this,T,I,P);case"ascii":case"latin1":case"binary":return _(this,T,I,P);case"base64":return n(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],Z=I;for(;Z<P;){let W=T[Z],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(Z+st<=P){let ue,me,pe,ye;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[Z+1],(ue&192)===128&&(ye=(W&31)<<6|ue&63,ye>127&&(fe=ye));break;case 3:ue=T[Z+1],me=T[Z+2],(ue&192)===128&&(me&192)===128&&(ye=(W&15)<<12|(ue&63)<<6|me&63,ye>2047&&(ye<55296||ye>57343)&&(fe=ye));break;case 4:ue=T[Z+1],me=T[Z+2],pe=T[Z+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(ye=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,ye>65535&&ye<1114112&&(fe=ye))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),Z+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]&127);return U}function p(T,I,P){let U="";P=Math.min(T.length,P);for(let Z=I;Z<P;++Z)U+=String.fromCharCode(T[Z]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let Z="";for(let W=I;W<P;++W)Z+=Ye[T[W]];return Z}function v(T,I,P){let U=T.slice(I,P),Z="";for(let W=0;W<U.length-1;W+=2)Z+=String.fromCharCode(U[W]+U[W+1]*256);return Z}d.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,d.prototype),U};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],Z=1,W=0;for(;++W<I&&(Z*=256);)U+=this[T+W]*Z;return U},d.prototype.readUintBE=d.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T+--I],Z=1;for(;I>0&&(Z*=256);)U+=this[T+--I]*Z;return U},d.prototype.readUint8=d.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},d.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,Z=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(Z)<<BigInt(32))}),d.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],Z=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(Z)}),d.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],Z=1,W=0;for(;++W<I&&(Z*=256);)U+=this[T+W]*Z;return Z*=128,U>=Z&&(U-=Math.pow(2,8*I)),U},d.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=I,Z=1,W=this[T+--U];for(;U>0&&(Z*=256);)W+=this[T+--U]*Z;return Z*=128,W>=Z&&(W-=Math.pow(2,8*I)),W},d.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},d.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},d.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},d.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},d.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},d.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),d.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&te(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),d.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},d.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},d.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},d.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,P,U,Z,W){if(!d.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Z||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let Z=1,W=0;for(this[I]=T&255;++W<P&&(Z*=256);)this[I+W]=T/Z&255;return I+P},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let Z=P-1,W=1;for(this[I+Z]=T&255;--Z>=0&&(W*=256);)this[I+Z]=T/W&255;return I+P},d.prototype.writeUint8=d.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,255,0),this[I]=T&255,I+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,Z){j(I,U,Z,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}d.prototype.writeBigUInt64LE=ct(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ct(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let Z=0,W=1,fe=0;for(this[I]=T&255;++Z<P&&(W*=256);)T<0&&fe===0&&this[I+Z-1]!==0&&(fe=1),this[I+Z]=(T/W>>0)-fe&255;return I+P},d.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let Z=P-1,W=1,fe=0;for(this[I+Z]=T&255;--Z>=0&&(W*=256);)T<0&&fe===0&&this[I+Z+1]!==0&&(fe=1),this[I+Z]=(T/W>>0)-fe&255;return I+P},d.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},d.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},d.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},d.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},d.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},d.prototype.writeBigInt64LE=ct(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ct(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,P,U,Z,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function ae(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}d.prototype.writeFloatLE=function(T,I,P){return ae(this,T,I,!0,P)},d.prototype.writeFloatBE=function(T,I,P){return ae(this,T,I,!1,P)};function re(T,I,P,U,Z){return I=+I,P=P>>>0,Z||$(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}d.prototype.writeDoubleLE=function(T,I,P){return re(this,T,I,!0,P)},d.prototype.writeDoubleBE=function(T,I,P){return re(this,T,I,!1,P)},d.prototype.copy=function(T,I,P,U){if(!d.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let Z=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),Z},d.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!d.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let Z;if(typeof T=="number")for(Z=I;Z<P;++Z)this[Z]=T;else{let W=d.isBuffer(T)?T:d.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(Z=0;Z<P-I;++Z)this[Z+I]=W[Z%fe]}return this};var H={};function K(T,I,P){H[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,Z=P;return Number.isInteger(P)&&Math.abs(P)>2**32?Z=ce(String(P)):typeof P=="bigint"&&(Z=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(Z=ce(Z)),Z+="n"),U+=` It must be ${I}. Received ${Z}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function ne(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&te(I,T.length-(P+1))}function j(T,I,P,U,Z,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new H.ERR_OUT_OF_RANGE("value",st,T)}ne(U,Z,W)}function J(T,I){if(typeof T!="number")throw new H.ERR_INVALID_ARG_TYPE(I,"number",T)}function te(T,I,P){throw Math.floor(T)!==T?(J(T,P),new H.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function ke(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,Z=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!Z){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}Z=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),Z=P;continue}P=(Z-55296<<10|P-56320)+65536}else Z&&(I-=3)>-1&&W.push(239,191,189);if(Z=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,Z,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,Z=P%256,W.push(Z),W.push(U);return W}function be(T){return e.toByteArray(ke(T))}function Ee(T,I,P,U){let Z;for(Z=0;Z<U&&!(Z+P>=I.length||Z>=T.length);++Z)I[Z+P]=T[Z];return Z}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ye=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let Z=0;Z<16;++Z)I[U+Z]=T[P]+T[Z]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),mqe=ac((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:VB().Buffer,Crypto:window.crypto}):e.exports={Buffer:VB().Buffer,Crypto:crypto}}),oue={};hqe(oue,{AVSCTap:()=>Ob,ArweaveSigner:()=>wO,DataItem:()=>Rb,MAX_TAG_BYTES:()=>s5,MIN_BINARY_SIZE:()=>xO,SIG_CONFIG:()=>Av,SignatureConfig:()=>Fs,Signer:()=>sue,createData:()=>cue,deserializeTags:()=>Jw,indexToType:()=>_O,serializeTags:()=>MO,tagsExceedLimit:()=>hue});var sue=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},gqe=Qd(yO(),1),Zf=Qd(aue(),1);async function fue(t){if(Array.isArray(t)){let i=(0,Zf.concatBuffers)([(0,Zf.stringToBuffer)("list"),(0,Zf.stringToBuffer)(t.length.toString())]);return await uue(t,await tc().hash(i,"SHA-384"))}let e=t,r=(0,Zf.concatBuffers)([(0,Zf.stringToBuffer)("blob"),(0,Zf.stringToBuffer)(e.byteLength.toString())]),a=(0,Zf.concatBuffers)([await tc().hash(r,"SHA-384"),await tc().hash(e,"SHA-384")]);return await tc().hash(a,"SHA-384")}async function uue(t,e){if(t.length<1)return e;let r=(0,Zf.concatBuffers)([e,await fue(t[0])]),a=await tc().hash(r,"SHA-384");return await uue(t.slice(1),a)}var SB=Qd(pqe(),1),bqe=SB.default.default?SB.default.default:SB.default,yqe=class extends bqe{getPublicKey(t){throw new Error("Unimplemented")}},wqe;function tc(){return wqe??=new yqe}var Fs;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Fs||(Fs={}));var Av={[Fs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Fs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Fs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Fs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Fs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Fs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Fs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},wO=class{signatureType=1;ownerLength=Av[1].pubLength;signatureLength=Av[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return gqe.default.toBuffer(this.pk)}sign(t){return tc().sign(this.jwk,t)}static async verify(t,e,r){return await tc().verify(t,e,r)}},_O={1:wO},Ku=Qd(yO(),1);async function GB(t){return fue([(0,Zf.stringToBuffer)("dataitem"),(0,Zf.stringToBuffer)("1"),(0,Zf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function _qe(t,e){let r=await GB(t),a=await e.sign(r),i=await tc().hash(a);return{signature:ge.from(a),id:ge.from(i)}}async function Mqe(t,e){let{signature:r,id:a}=await _qe(t,e);return t.getRaw().set(r,2),a}var Ob=class{buf;pos;constructor(t=ge.alloc(s5),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=ge.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=ge.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,d;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((d=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(d&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function MO(t){let e=new Ob;return e.writeTags(t),e.toBuffer()}function hue(t){let e=new Ob;return e.writeTags(t),e.tagsExceedLimit()}function Jw(t){return new Ob(t).readTags()}function Rl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function xqe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function Rse(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var Sqe=Qd(mqe(),1),ov=Qd(VB(),1),s5=4096,xO=80,Rb=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=Rl(this.binary.subarray(0,2));if(Fs?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return Rb.verify(this.binary)}get id(){return(async()=>Ku.default.encode(await this.rawId))()}set id(t){this._id=Ku.default.toBuffer(t)}get rawId(){return(async()=>ov.Buffer.from(await Sqe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ku.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Av[this.signatureType].sigLength}get owner(){return Ku.default.encode(this.rawOwner)}get ownerLength(){return Av[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ov.Buffer.alloc(0)}get target(){return Ku.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):ov.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=Rl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(Rl(this.binary.subarray(t,t+8))==0)return[];let e=Rl(this.binary.subarray(t+8,t+16));return Jw(ov.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Ku.default.encode(t.name),value:Ku.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=Rl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=Rl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Ku.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await Mqe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=ov.Buffer.from(await tc().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Ku.default.encode(t.name),value:Ku.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<xO)return!1;let e=new Rb(t),r=e.signatureType,a=e.getTagsStart(),i=Rl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=Rl(h);if(c>s5)return!1;if(i>0)try{if(Jw(ov.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let d=_O[r],b=await GB(e);return await d.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return GB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},Eqe=Qd(yO(),1);function cue(t,e,r){let a=e.publicKey,i=r?.target?Eqe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?ge.from(r.anchor):null,d=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?MO(r.tags):null,g=16+(b?b.byteLength:0),y=ge.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+d+g+M,E=ge.alloc(x);if(E.set(xqe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(Rse(r?.tags?.length??0),O);let N=Rse(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new Rb(E)}var SO={...oue};globalThis.arbundles??=SO;var Aqe=SO,Rqe=SO;globalThis.Buffer||(globalThis.Buffer=rue.Buffer);var{DataItem:Tqe}=iue;function kqe(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=d=>new Tqe(d)})=>{let d=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c(rue.Buffer.from(d));return{id:await b.id,raw:await b.getRaw()}}}var Iqe=globalThis.GATEWAY_URL||void 0,Bqe=globalThis.MU_URL||void 0,Oqe=globalThis.CU_URL||void 0,Pqe=globalThis.GRAPHQL_URL||void 0,{result:tyt,results:ryt,message:iyt,spawn:nyt,monitor:ayt,unmonitor:oyt,dryrun:syt,assign:fyt}=Rv({GATEWAY_URL:Iqe,MU_URL:Bqe,CU_URL:Oqe,GRAPHQL_URL:Pqe}),lue=tue.createDataItemSigner;X();ee();Q();var ahe=mi(nhe(),1),zb=ahe.default.init({host:"arweave.net",port:443,protocol:"https"});async function Q3t({signer:t,module:e=hee,luaCodeTxId:r=ik,ao:a=Rv(),scheduler:i=cee,state:h,stateContractTxId:c,antRegistryId:d=s4,logger:b=$s.default,arweave:g=zb}){let y=ep.init({process:new La({processId:d,ao:a,logger:b}),signer:t}),M=await g.transactions.getData(r,{decode:!0,string:!0}),x=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:d}]}),E=new La({processId:x,ao:a,logger:b}),{id:A}=await E.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:M,signer:t});if(b.info("Spawned ANT",{processId:x,module:e,scheduler:i,luaCodeTxId:r,evalId:A}),h){let{id:O}=await E.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(h),signer:t});b.info("Initialized ANT",{processId:x,module:e,scheduler:i,initializeMsgId:O})}let{id:k}=await y.register({processId:x});return b.info("Registered ANT to ANT Registry",{processId:x,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:d}),x}async function e8t({signer:t,processId:e,luaCodeTxId:r=ik,ao:a=Rv(),logger:i=$s.default,arweave:h=zb}){let c=new La({processId:e,ao:a,logger:i}),d=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:d,signer:t});return i.info("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function QFe(t){let e=mr.object({name:mr.string(),value:mr.union([mr.string(),mr.number()])}),r=mr.function().args(mr.object({data:mr.union([mr.string(),mr.instanceof(ge)]),tags:mr.array(e).optional(),target:mr.string().optional(),anchor:mr.string().optional()})).returns(mr.promise(mr.object({id:mr.string(),raw:mr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Ul(t){return QFe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let c=Hg(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:lue(t)}X();ee();Q();function ql(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var v5=class{static init({signer:e,strict:r=!1,...a}){if(Fh(a)||jh(a))return e?new eP({signer:e,strict:r,...a}):new m5({strict:r,...a});throw new Du}},m5=class{process;strict;constructor(e){if(this.strict=e.strict||!1,Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&ql(tse.passthrough().and(mr.object({Records:mr.record(mr.string(),_w.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&ql(rse.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&ql(_w.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&ql(dB,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&ql(pB,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&ql(vB,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&ql(mr.number(),i),i}},eP=class extends m5{signer;constructor({signer:e,...r}){super(r),this.signer=Ul(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Description",value:JSON.stringify(e)}],signer:this.signer})}async releaseName({name:e,ioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,ioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}};X();ee();Q();var ep=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new tP({...a,signer:r})}return new g5(e)}},g5=class{process;constructor(e){if(e&&(jh(e)||Fh(e)))if(Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du;else this.process=new La({processId:s4})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},tP=class extends g5{signer;constructor({signer:e,...r}){super(r),this.signer=Ul(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};X();ee();Q();X();ee();Q();X();ee();Q();function rP(t){try{return JSON.parse(t)}catch{return t}}var La=class{logger;processId;ao;constructor({processId:e,ao:r=Rv(),logger:a=$s.default}){this.processId=e,this.logger=a,this.ao=r}async read({tags:e,retries:r=3}){let a=0,i;for(;a<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let h=await this.ao.dryrun({process:this.processId,tags:e});if(h.Messages===void 0||h.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let d=h.Messages[0].Tags.find(g=>g.name==="Error");if(d)throw new Error(`${d.Value}: ${h.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:h.Messages[0].Data}),h.Messages[0].Data===void 0?{}:rP(h.Messages[0].Data)}catch(h){a++,this.logger.debug(`Read attempt ${a} failed`,{error:h,tags:e}),i=h,await new Promise(c=>setTimeout(c,2**a*1e3))}throw i}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let d=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:Y1}],data:r,signer:a});this.logger.debug("Sent message to process",{messageId:d,processId:this.processId});let b=await this.ao.result({message:d,process:this.processId});if(this.logger.debug("Message result",{output:b,messageId:d,processId:this.processId}),b.Messages?.length===0||b.Messages===void 0)return{id:d};let y=b.Messages[0].Tags.find(x=>x.name==="Error");if(y){let x=b.Messages[0].Data;throw new f4(`${y.Value}: ${x}`)}if(b.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(b.Messages[0].Data===void 0)return{id:d};let M=rP(b.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:d,processId:this.processId}),{id:d,result:M}}catch(d){if(this.logger.error("Error sending message to process",{error:d.message,processId:this.processId,tags:e}),d.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:d.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=d;else throw d}throw c}};var Hb=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new iP({...a,signer:r})}return new b5(e)}},b5=class{process;arweave;constructor(e,r=zb){if(!e)this.process=new La({processId:k1});else if(Fh(e))this.process=e.process;else if(jh(e))this.process=new La({processId:e.processId});else throw new Du;this.arweave=r}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(e){let a=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getEpoch(e){let a=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){let a=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){let a=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGateways(e){let a=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(e=>({timestamp:e.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(e){let a=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getPrescribedNames(e){let a=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getObservations(e){let a=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getDistributions(e){let a=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(i=>({timestamp:i.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h}){let d=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(b=>({timestamp:b.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(b=>b.value!==void 0);return this.process.read({tags:d})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getArNSAuctions(e){let a=[{name:"Action",value:"Auctions"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}].filter(i=>i.value!==void 0);return this.process.read({tags:a})}async getArNSAuction({name:e}){let r=[{name:"Action",value:"Auction-Info"},{name:"Name",value:e}];return this.process.read({tags:r})}async getArNSAuctionPrices({name:e,type:r,years:a,timestamp:i,intervalMs:h}){let c=[{name:"Action",value:"Auction-Prices"},{name:"Name",value:e},{name:"Timestamp",value:i?.toString()??Date.now().toString()},{name:"Purchase-Type",value:r??"lease"},{name:"Years",value:r==null||r==="lease"?a?.toString()??"1":void 0},{name:"Price-Interval-Ms",value:h?.toString()??"900000"}].filter(d=>d.value!==void 0);return this.process.read({tags:c})}},iP=class extends b5{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new La({processId:k1})}),this.signer=Ul(e);else if(Fh(r))super({process:r.process}),this.signer=Ul(e);else if(jh(r))super({process:new La({processId:r.processId})}),this.signer=Ul(e);else throw new Du}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:d,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},O=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"FQDN",value:i},{name:"Label",value:h},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Note",value:d},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Auto-Stake",value:M?.toString()},{name:"Observer-Address",value:x}].filter(N=>N.value!==void 0);return this.process.send({signer:this.signer,tags:O})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,delegateRewardShareRatio:r,fqdn:a,label:i,minDelegatedStake:h,note:c,port:d,properties:b,protocol:g,autoStake:y,observerAddress:M},x){let{tags:E=[]}=x||{},k=[...E,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:i},{name:"Note",value:c},{name:"FQDN",value:a},{name:"Port",value:d?.toString()},{name:"Properties",value:b},{name:"Protocol",value:g},{name:"Observer-Address",value:M},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Delegate-Reward-Share-Ratio",value:r?.toString()},{name:"Min-Delegated-Stake",value:h?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(O=>O.value!==void 0);return this.process.send({signer:this.signer,tags:k})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async upgradeRecord(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name}]})}async extendLease(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()}]})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()}]})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}async submitAuctionBid(e,r){let{tags:a=[]}=r||{},h=[...a,{name:"Action",value:"Auction-Bid"},{name:"Name",value:e.name},{name:"Process-Id",value:e.processId},{name:"Quantity",value:e.quantity?.toString()??void 0},{name:"Purchase-Type",value:e.type||"lease"},{name:"Years",value:e.years?.toString()??void 0}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:h})}};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();function Zb(t,e){return function(){return t.apply(e,arguments)}}var{toString:eje}=Object.prototype,{getPrototypeOf:oP}=Object,w5=(t=>e=>{let r=eje.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xf=t=>(t=t.toLowerCase(),e=>w5(e)===t),_5=t=>e=>typeof e===t,{isArray:kv}=Array,Kb=_5("undefined");function tje(t){return t!==null&&!Kb(t)&&t.constructor!==null&&!Kb(t.constructor)&&jo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var fhe=Xf("ArrayBuffer");function rje(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&fhe(t.buffer),e}var ije=_5("string"),jo=_5("function"),uhe=_5("number"),M5=t=>t!==null&&typeof t=="object",nje=t=>t===!0||t===!1,y5=t=>{if(w5(t)!=="object")return!1;let e=oP(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},aje=Xf("Date"),oje=Xf("File"),sje=Xf("Blob"),fje=Xf("FileList"),uje=t=>M5(t)&&jo(t.pipe),hje=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||jo(t.append)&&((e=w5(t))==="formdata"||e==="object"&&jo(t.toString)&&t.toString()==="[object FormData]"))},cje=Xf("URLSearchParams"),[lje,dje,pje,vje]=["ReadableStream","Request","Response","Headers"].map(Xf),mje=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wb(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let a,i;if(typeof t!="object"&&(t=[t]),kv(t))for(a=0,i=t.length;a<i;a++)e.call(null,t[a],a,t);else{let h=r?Object.getOwnPropertyNames(t):Object.keys(t),c=h.length,d;for(a=0;a<c;a++)d=h[a],e.call(null,t[d],d,t)}}function hhe(t,e){e=e.toLowerCase();let r=Object.keys(t),a=r.length,i;for(;a-- >0;)if(i=r[a],e===i.toLowerCase())return i;return null}var tp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,che=t=>!Kb(t)&&t!==tp;function aP(){let{caseless:t}=che(this)&&this||{},e={},r=(a,i)=>{let h=t&&hhe(e,i)||i;y5(e[h])&&y5(a)?e[h]=aP(e[h],a):y5(a)?e[h]=aP({},a):kv(a)?e[h]=a.slice():e[h]=a};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Wb(arguments[a],r);return e}var gje=(t,e,r,{allOwnKeys:a}={})=>(Wb(e,(i,h)=>{r&&jo(i)?t[h]=Zb(i,r):t[h]=i},{allOwnKeys:a}),t),bje=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yje=(t,e,r,a)=>{t.prototype=Object.create(e.prototype,a),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},wje=(t,e,r,a)=>{let i,h,c,d={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),h=i.length;h-- >0;)c=i[h],(!a||a(c,t,e))&&!d[c]&&(e[c]=t[c],d[c]=!0);t=r!==!1&&oP(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},_je=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let a=t.indexOf(e,r);return a!==-1&&a===r},Mje=t=>{if(!t)return null;if(kv(t))return t;let e=t.length;if(!uhe(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},xje=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&oP(Uint8Array)),Sje=(t,e)=>{let a=(t&&t[Symbol.iterator]).call(t),i;for(;(i=a.next())&&!i.done;){let h=i.value;e.call(t,h[0],h[1])}},Eje=(t,e)=>{let r,a=[];for(;(r=t.exec(e))!==null;)a.push(r);return a},Aje=Xf("HTMLFormElement"),Rje=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,i){return a.toUpperCase()+i}),ohe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Tje=Xf("RegExp"),lhe=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),a={};Wb(r,(i,h)=>{let c;(c=e(i,h,t))!==!1&&(a[h]=c||i)}),Object.defineProperties(t,a)},kje=t=>{lhe(t,(e,r)=>{if(jo(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let a=t[r];if(jo(a)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ije=(t,e)=>{let r={},a=i=>{i.forEach(h=>{r[h]=!0})};return kv(t)?a(t):a(String(t).split(e)),r},Bje=()=>{},Oje=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,nP="abcdefghijklmnopqrstuvwxyz",she="0123456789",dhe={DIGIT:she,ALPHA:nP,ALPHA_DIGIT:nP+nP.toUpperCase()+she},Pje=(t=16,e=dhe.ALPHA_DIGIT)=>{let r="",{length:a}=e;for(;t--;)r+=e[Math.random()*a|0];return r};function Nje(t){return!!(t&&jo(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Cje=t=>{let e=new Array(10),r=(a,i)=>{if(M5(a)){if(e.indexOf(a)>=0)return;if(!("toJSON"in a)){e[i]=a;let h=kv(a)?[]:{};return Wb(a,(c,d)=>{let b=r(c,i+1);!Kb(b)&&(h[d]=b)}),e[i]=void 0,h}}return a};return r(t,0)},Lje=Xf("AsyncFunction"),Dje=t=>t&&(M5(t)||jo(t))&&jo(t.then)&&jo(t.catch),phe=((t,e)=>t?setImmediate:e?((r,a)=>(tp.addEventListener("message",({source:i,data:h})=>{i===tp&&h===r&&a.length&&a.shift()()},!1),i=>{a.push(i),tp.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",jo(tp.postMessage)),$je=typeof queueMicrotask<"u"?queueMicrotask.bind(tp):typeof xe<"u"&&xe.nextTick||phe,vt={isArray:kv,isArrayBuffer:fhe,isBuffer:tje,isFormData:hje,isArrayBufferView:rje,isString:ije,isNumber:uhe,isBoolean:nje,isObject:M5,isPlainObject:y5,isReadableStream:lje,isRequest:dje,isResponse:pje,isHeaders:vje,isUndefined:Kb,isDate:aje,isFile:oje,isBlob:sje,isRegExp:Tje,isFunction:jo,isStream:uje,isURLSearchParams:cje,isTypedArray:xje,isFileList:fje,forEach:Wb,merge:aP,extend:gje,trim:mje,stripBOM:bje,inherits:yje,toFlatObject:wje,kindOf:w5,kindOfTest:Xf,endsWith:_je,toArray:Mje,forEachEntry:Sje,matchAll:Eje,isHTMLForm:Aje,hasOwnProperty:ohe,hasOwnProp:ohe,reduceDescriptors:lhe,freezeMethods:kje,toObjectSet:Ije,toCamelCase:Rje,noop:Bje,toFiniteNumber:Oje,findKey:hhe,global:tp,isContextDefined:che,ALPHABET:dhe,generateString:Pje,isSpecCompliantForm:Nje,toJSONObject:Cje,isAsyncFn:Lje,isThenable:Dje,setImmediate:phe,asap:$je};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();function Iv(t,e,r,a,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),a&&(this.request=a),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(Iv,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});var vhe=Iv.prototype,mhe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{mhe[t]={value:t}});Object.defineProperties(Iv,mhe);Object.defineProperty(vhe,"isAxiosError",{value:!0});Iv.from=(t,e,r,a,i,h)=>{let c=Object.create(vhe);return vt.toFlatObject(t,c,function(b){return b!==Error.prototype},d=>d!=="isAxiosError"),Iv.call(c,t.message,e,r,a,i),c.cause=t,c.name=t.name,h&&Object.assign(c,h),c};var wr=Iv;X();ee();Q();var x5=null;function sP(t){return vt.isPlainObject(t)||vt.isArray(t)}function bhe(t){return vt.endsWith(t,"[]")?t.slice(0,-2):t}function ghe(t,e,r){return t?t.concat(e).map(function(i,h){return i=bhe(i),!r&&h?"["+i+"]":i}).join(r?".":""):e}function Uje(t){return vt.isArray(t)&&!t.some(sP)}var qje=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Fje(t,e,r){if(!vt.isObject(t))throw new TypeError("target must be an object");e=e||new(x5||FormData),r=vt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,O){return!vt.isUndefined(O[k])});let a=r.metaTokens,i=r.visitor||y,h=r.dots,c=r.indexes,b=(r.Blob||typeof Blob<"u"&&Blob)&&vt.isSpecCompliantForm(e);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function g(A){if(A===null)return"";if(vt.isDate(A))return A.toISOString();if(!b&&vt.isBlob(A))throw new wr("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(A)||vt.isTypedArray(A)?b&&typeof Blob=="function"?new Blob([A]):ge.from(A):A}function y(A,k,O){let N=A;if(A&&!O&&typeof A=="object"){if(vt.endsWith(k,"{}"))k=a?k:k.slice(0,-2),A=JSON.stringify(A);else if(vt.isArray(A)&&Uje(A)||(vt.isFileList(A)||vt.endsWith(k,"[]"))&&(N=vt.toArray(A)))return k=bhe(k),N.forEach(function(C,Y){!(vt.isUndefined(C)||C===null)&&e.append(c===!0?ghe([k],Y,h):c===null?k:k+"[]",g(C))}),!1}return sP(A)?!0:(e.append(ghe(O,k,h),g(A)),!1)}let M=[],x=Object.assign(qje,{defaultVisitor:y,convertValue:g,isVisitable:sP});function E(A,k){if(!vt.isUndefined(A)){if(M.indexOf(A)!==-1)throw Error("Circular reference detected in "+k.join("."));M.push(A),vt.forEach(A,function(N,L){(!(vt.isUndefined(N)||N===null)&&i.call(e,N,vt.isString(L)?L.trim():L,k,x))===!0&&E(N,k?k.concat(L):[L])}),M.pop()}}if(!vt.isObject(t))throw new TypeError("data must be an object");return E(t),e}var Fl=Fje;function yhe(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(a){return e[a]})}function whe(t,e){this._pairs=[],t&&Fl(t,this,e)}var _he=whe.prototype;_he.append=function(e,r){this._pairs.push([e,r])};_he.toString=function(e){let r=e?function(a){return e.call(this,a,yhe)}:yhe;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var S5=whe;function jje(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vb(t,e,r){if(!e)return t;let a=r&&r.encode||jje,i=r&&r.serialize,h;if(i?h=i(e,r):h=vt.isURLSearchParams(e)?e.toString():new S5(e,r).toString(a),h){let c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+h}return t}X();ee();Q();var fP=class{constructor(){this.handlers=[]}use(e,r,a){return this.handlers.push({fulfilled:e,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(a){a!==null&&e(a)})}},uP=fP;X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var E5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};X();ee();Q();X();ee();Q();X();ee();Q();X();ee();Q();var Mhe=typeof URLSearchParams<"u"?URLSearchParams:S5;X();ee();Q();var xhe=typeof FormData<"u"?FormData:null;X();ee();Q();var She=typeof Blob<"u"?Blob:null;var Ehe={isBrowser:!0,classes:{URLSearchParams:Mhe,FormData:xhe,Blob:She},protocols:["http","https","file","blob","url","data"]};var lP={};$a(lP,{hasBrowserEnv:()=>cP,hasStandardBrowserEnv:()=>zje,hasStandardBrowserWebWorkerEnv:()=>Hje,navigator:()=>hP,origin:()=>Zje});X();ee();Q();var cP=typeof window<"u"&&typeof document<"u",hP=typeof navigator=="object"&&navigator||void 0,zje=cP&&(!hP||["ReactNative","NativeScript","NS"].indexOf(hP.product)<0),Hje=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zje=cP&&window.location.href||"http://localhost";var Rn={...lP,...Ehe};function dP(t,e){return Fl(t,new Rn.classes.URLSearchParams,Object.assign({visitor:function(r,a,i,h){return Rn.isNode&&vt.isBuffer(r)?(this.append(a,r.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},e))}X();ee();Q();function Kje(t){return vt.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Wje(t){let e={},r=Object.keys(t),a,i=r.length,h;for(a=0;a<i;a++)h=r[a],e[h]=t[h];return e}function Vje(t){function e(r,a,i,h){let c=r[h++];if(c==="__proto__")return!0;let d=Number.isFinite(+c),b=h>=r.length;return c=!c&&vt.isArray(i)?i.length:c,b?(vt.hasOwnProp(i,c)?i[c]=[i[c],a]:i[c]=a,!d):((!i[c]||!vt.isObject(i[c]))&&(i[c]=[]),e(r,a,i[c],h)&&vt.isArray(i[c])&&(i[c]=Wje(i[c])),!d)}if(vt.isFormData(t)&&vt.isFunction(t.entries)){let r={};return vt.forEachEntry(t,(a,i)=>{e(Kje(a),i,r,0)}),r}return null}var A5=Vje;function Gje(t,e,r){if(vt.isString(t))try{return(e||JSON.parse)(t),vt.trim(t)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(t)}var pP={transitional:E5,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let a=r.getContentType()||"",i=a.indexOf("application/json")>-1,h=vt.isObject(e);if(h&&vt.isHTMLForm(e)&&(e=new FormData(e)),vt.isFormData(e))return i?JSON.stringify(A5(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(h){if(a.indexOf("application/x-www-form-urlencoded")>-1)return dP(e,this.formSerializer).toString();if((d=vt.isFileList(e))||a.indexOf("multipart/form-data")>-1){let b=this.env&&this.env.FormData;return Fl(d?{"files[]":e}:e,b&&new b,this.formSerializer)}}return h||i?(r.setContentType("application/json",!1),Gje(e)):e}],transformResponse:[function(e){let r=this.transitional||pP.transitional,a=r&&r.forcedJSONParsing,i=this.responseType==="json";if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(a&&!this.responseType||i)){let c=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(d){if(c)throw d.name==="SyntaxError"?wr.from(d,wr.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rn.classes.FormData,Blob:Rn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],t=>{pP.headers[t]={}});var Bv=pP;X();ee();Q();X();ee();Q();var Yje=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ahe=t=>{let e={},r,a,i;return t&&t.split(`
188
188
  `).forEach(function(c){i=c.indexOf(":"),r=c.substring(0,i).trim().toLowerCase(),a=c.substring(i+1).trim(),!(!r||e[r]&&Yje[r])&&(r==="set-cookie"?e[r]?e[r].push(a):e[r]=[a]:e[r]=e[r]?e[r]+", "+a:a)}),e};var Rhe=Symbol("internals");function Gb(t){return t&&String(t).trim().toLowerCase()}function R5(t){return t===!1||t==null?t:vt.isArray(t)?t.map(R5):String(t)}function Jje(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,a;for(;a=r.exec(t);)e[a[1]]=a[2];return e}var Xje=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function vP(t,e,r,a,i){if(vt.isFunction(a))return a.call(this,e,r);if(i&&(e=r),!!vt.isString(e)){if(vt.isString(a))return e.indexOf(a)!==-1;if(vt.isRegExp(a))return a.test(e)}}function Qje(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,a)=>r.toUpperCase()+a)}function eze(t,e){let r=vt.toCamelCase(" "+e);["get","set","has"].forEach(a=>{Object.defineProperty(t,a+r,{value:function(i,h,c){return this[a].call(this,e,i,h,c)},configurable:!0})})}var Ov=class{constructor(e){e&&this.set(e)}set(e,r,a){let i=this;function h(d,b,g){let y=Gb(b);if(!y)throw new Error("header name must be a non-empty string");let M=vt.findKey(i,y);(!M||i[M]===void 0||g===!0||g===void 0&&i[M]!==!1)&&(i[M||b]=R5(d))}let c=(d,b)=>vt.forEach(d,(g,y)=>h(g,y,b));if(vt.isPlainObject(e)||e instanceof this.constructor)c(e,r);else if(vt.isString(e)&&(e=e.trim())&&!Xje(e))c(Ahe(e),r);else if(vt.isHeaders(e))for(let[d,b]of e.entries())h(b,d,a);else e!=null&&h(r,e,a);return this}get(e,r){if(e=Gb(e),e){let a=vt.findKey(this,e);if(a){let i=this[a];if(!r)return i;if(r===!0)return Jje(i);if(vt.isFunction(r))return r.call(this,i,a);if(vt.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Gb(e),e){let a=vt.findKey(this,e);return!!(a&&this[a]!==void 0&&(!r||vP(this,this[a],a,r)))}return!1}delete(e,r){let a=this,i=!1;function h(c){if(c=Gb(c),c){let d=vt.findKey(a,c);d&&(!r||vP(a,a[d],d,r))&&(delete a[d],i=!0)}}return vt.isArray(e)?e.forEach(h):h(e),i}clear(e){let r=Object.keys(this),a=r.length,i=!1;for(;a--;){let h=r[a];(!e||vP(this,this[h],h,e,!0))&&(delete this[h],i=!0)}return i}normalize(e){let r=this,a={};return vt.forEach(this,(i,h)=>{let c=vt.findKey(a,h);if(c){r[c]=R5(i),delete r[h];return}let d=e?Qje(h):String(h).trim();d!==h&&delete r[h],r[d]=R5(i),a[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return vt.forEach(this,(a,i)=>{a!=null&&a!==!1&&(r[i]=e&&vt.isArray(a)?a.join(", "):a)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
189
189
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let a=new this(e);return r.forEach(i=>a.set(i)),a}static accessor(e){let a=(this[Rhe]=this[Rhe]={accessors:{}}).accessors,i=this.prototype;function h(c){let d=Gb(c);a[d]||(eze(i,c),a[d]=!0)}return vt.isArray(e)?e.forEach(h):h(e),this}};Ov.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);vt.reduceDescriptors(Ov.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(a){this[r]=a}}});vt.freezeMethods(Ov);var Kn=Ov;function Yb(t,e){let r=this||Bv,a=e||r,i=Kn.from(a.headers),h=a.data;return vt.forEach(t,function(d){h=d.call(r,h,i.normalize(),e?e.status:void 0)}),i.normalize(),h}X();ee();Q();function Jb(t){return!!(t&&t.__CANCEL__)}X();ee();Q();function The(t,e,r){wr.call(this,t??"canceled",wr.ERR_CANCELED,e,r),this.name="CanceledError"}vt.inherits(The,wr,{__CANCEL__:!0});var Qu=The;X();ee();Q();X();ee();Q();X();ee();Q();function Xb(t,e,r){let a=r.config.validateStatus;!r.status||!a||a(r.status)?t(r):e(new wr("Request failed with status code "+r.status,[wr.ERR_BAD_REQUEST,wr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}X();ee();Q();function mP(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}X();ee();Q();X();ee();Q();function tze(t,e){t=t||10;let r=new Array(t),a=new Array(t),i=0,h=0,c;return e=e!==void 0?e:1e3,function(b){let g=Date.now(),y=a[h];c||(c=g),r[i]=b,a[i]=g;let M=h,x=0;for(;M!==i;)x+=r[M++],M=M%t;if(i=(i+1)%t,i===h&&(h=(h+1)%t),g-c<e)return;let E=y&&g-y;return E?Math.round(x*1e3/E):void 0}}var khe=tze;X();ee();Q();function rze(t,e){let r=0,a=1e3/e,i,h,c=(g,y=Date.now())=>{r=y,i=null,h&&(clearTimeout(h),h=null),t.apply(null,g)};return[(...g)=>{let y=Date.now(),M=y-r;M>=a?c(g,y):(i=g,h||(h=setTimeout(()=>{h=null,c(i)},a-M)))},()=>i&&c(i)]}var Ihe=rze;var Pv=(t,e,r=3)=>{let a=0,i=khe(50,250);return Ihe(h=>{let c=h.loaded,d=h.lengthComputable?h.total:void 0,b=c-a,g=i(b),y=c<=d;a=c;let M={loaded:c,total:d,progress:d?c/d:void 0,bytes:b,rate:g||void 0,estimated:g&&d&&y?(d-c)/g:void 0,event:h,lengthComputable:d!=null,[e?"download":"upload"]:!0};t(M)},r)},gP=(t,e)=>{let r=t!=null;return[a=>e[0]({lengthComputable:r,total:t,loaded:a}),e[1]]},bP=t=>(...e)=>vt.asap(()=>t(...e));X();ee();Q();X();ee();Q();var Bhe=Rn.hasStandardBrowserEnv?function(){let e=Rn.navigator&&/(msie|trident)/i.test(Rn.navigator.userAgent),r=document.createElement("a"),a;function i(h){let c=h;return e&&(r.setAttribute("href",c),c=r.href),r.setAttribute("href",c),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return a=i(window.location.href),function(c){let d=vt.isString(c)?i(c):c;return d.protocol===a.protocol&&d.host===a.host}}():function(){return function(){return!0}}();X();ee();Q();var Ohe=Rn.hasStandardBrowserEnv?{write(t,e,r,a,i,h){let c=[t+"="+encodeURIComponent(e)];vt.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),vt.isString(a)&&c.push("path="+a),vt.isString(i)&&c.push("domain="+i),h===!0&&c.push("secure"),document.cookie=c.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};X();ee();Q();X();ee();Q();function yP(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}X();ee();Q();function wP(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Qb(t,e){return t&&!yP(e)?wP(t,e):e}X();ee();Q();var Phe=t=>t instanceof Kn?{...t}:t;function Qf(t,e){e=e||{};let r={};function a(g,y,M){return vt.isPlainObject(g)&&vt.isPlainObject(y)?vt.merge.call({caseless:M},g,y):vt.isPlainObject(y)?vt.merge({},y):vt.isArray(y)?y.slice():y}function i(g,y,M){if(vt.isUndefined(y)){if(!vt.isUndefined(g))return a(void 0,g,M)}else return a(g,y,M)}function h(g,y){if(!vt.isUndefined(y))return a(void 0,y)}function c(g,y){if(vt.isUndefined(y)){if(!vt.isUndefined(g))return a(void 0,g)}else return a(void 0,y)}function d(g,y,M){if(M in e)return a(g,y);if(M in t)return a(void 0,g)}let b={url:h,method:h,data:h,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(g,y)=>i(Phe(g),Phe(y),!0)};return vt.forEach(Object.keys(Object.assign({},t,e)),function(y){let M=b[y]||i,x=M(t[y],e[y],y);vt.isUndefined(x)&&M!==d||(r[y]=x)}),r}var T5=t=>{let e=Qf({},t),{data:r,withXSRFToken:a,xsrfHeaderName:i,xsrfCookieName:h,headers:c,auth:d}=e;e.headers=c=Kn.from(c),e.url=Vb(Qb(e.baseURL,e.url),t.params,t.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let b;if(vt.isFormData(r)){if(Rn.hasStandardBrowserEnv||Rn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((b=c.getContentType())!==!1){let[g,...y]=b?b.split(";").map(M=>M.trim()).filter(Boolean):[];c.setContentType([g||"multipart/form-data",...y].join("; "))}}if(Rn.hasStandardBrowserEnv&&(a&&vt.isFunction(a)&&(a=a(e)),a||a!==!1&&Bhe(e.url))){let g=i&&h&&Ohe.read(h);g&&c.set(i,g)}return e};var ize=typeof XMLHttpRequest<"u",Nhe=ize&&function(t){return new Promise(function(r,a){let i=T5(t),h=i.data,c=Kn.from(i.headers).normalize(),{responseType:d,onUploadProgress:b,onDownloadProgress:g}=i,y,M,x,E,A;function k(){E&&E(),A&&A(),i.cancelToken&&i.cancelToken.unsubscribe(y),i.signal&&i.signal.removeEventListener("abort",y)}let O=new XMLHttpRequest;O.open(i.method.toUpperCase(),i.url,!0),O.timeout=i.timeout;function N(){if(!O)return;let C=Kn.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),G={data:!d||d==="text"||d==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:C,config:t,request:O};Xb(function(D){r(D),k()},function(D){a(D),k()},G),O=null}"onloadend"in O?O.onloadend=N:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(N)},O.onabort=function(){O&&(a(new wr("Request aborted",wr.ECONNABORTED,t,O)),O=null)},O.onerror=function(){a(new wr("Network Error",wr.ERR_NETWORK,t,O)),O=null},O.ontimeout=function(){let Y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",G=i.transitional||E5;i.timeoutErrorMessage&&(Y=i.timeoutErrorMessage),a(new wr(Y,G.clarifyTimeoutError?wr.ETIMEDOUT:wr.ECONNABORTED,t,O)),O=null},h===void 0&&c.setContentType(null),"setRequestHeader"in O&&vt.forEach(c.toJSON(),function(Y,G){O.setRequestHeader(G,Y)}),vt.isUndefined(i.withCredentials)||(O.withCredentials=!!i.withCredentials),d&&d!=="json"&&(O.responseType=i.responseType),g&&([x,A]=Pv(g,!0),O.addEventListener("progress",x)),b&&O.upload&&([M,E]=Pv(b),O.upload.addEventListener("progress",M),O.upload.addEventListener("loadend",E)),(i.cancelToken||i.signal)&&(y=C=>{O&&(a(!C||C.type?new Qu(null,t,O):C),O.abort(),O=null)},i.cancelToken&&i.cancelToken.subscribe(y),i.signal&&(i.signal.aborted?y():i.signal.addEventListener("abort",y)));let L=mP(i.url);if(L&&Rn.protocols.indexOf(L)===-1){a(new wr("Unsupported protocol "+L+":",wr.ERR_BAD_REQUEST,t));return}O.send(h||null)})};X();ee();Q();X();ee();Q();var nze=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let a=new AbortController,i,h=function(g){if(!i){i=!0,d();let y=g instanceof Error?g:this.reason;a.abort(y instanceof wr?y:new Qu(y instanceof Error?y.message:y))}},c=e&&setTimeout(()=>{c=null,h(new wr(`timeout ${e} of ms exceeded`,wr.ETIMEDOUT))},e),d=()=>{t&&(c&&clearTimeout(c),c=null,t.forEach(g=>{g.unsubscribe?g.unsubscribe(h):g.removeEventListener("abort",h)}),t=null)};t.forEach(g=>g.addEventListener("abort",h));let{signal:b}=a;return b.unsubscribe=()=>vt.asap(d),b}},Che=nze;X();ee();Q();var aze=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let a=0,i;for(;a<r;)i=a+e,yield t.slice(a,i),a=i},oze=async function*(t,e){for await(let r of sze(t))yield*aze(r,e)},sze=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:a}=await e.read();if(r)break;yield a}}finally{await e.cancel()}},_P=(t,e,r,a)=>{let i=oze(t,e),h=0,c,d=b=>{c||(c=!0,a&&a(b))};return new ReadableStream({async pull(b){try{let{done:g,value:y}=await i.next();if(g){d(),b.close();return}let M=y.byteLength;if(r){let x=h+=M;r(x)}b.enqueue(new Uint8Array(y))}catch(g){throw d(g),g}},cancel(b){return d(b),i.return()}},{highWaterMark:2})};var I5=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Dhe=I5&&typeof ReadableStream=="function",fze=I5&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),$he=(t,...e)=>{try{return!!t(...e)}catch{return!1}},uze=Dhe&&$he(()=>{let t=!1,e=new Request(Rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Lhe=64*1024,MP=Dhe&&$he(()=>vt.isReadableStream(new Response("").body)),k5={stream:MP&&(t=>t.body)};I5&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!k5[e]&&(k5[e]=vt.isFunction(t[e])?r=>r[e]():(r,a)=>{throw new wr(`Response type '${e}' is not supported`,wr.ERR_NOT_SUPPORT,a)})})})(new Response);var hze=async t=>{if(t==null)return 0;if(vt.isBlob(t))return t.size;if(vt.isSpecCompliantForm(t))return(await new Request(Rn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(vt.isArrayBufferView(t)||vt.isArrayBuffer(t))return t.byteLength;if(vt.isURLSearchParams(t)&&(t=t+""),vt.isString(t))return(await fze(t)).byteLength},cze=async(t,e)=>{let r=vt.toFiniteNumber(t.getContentLength());return r??hze(e)},Uhe=I5&&(async t=>{let{url:e,method:r,data:a,signal:i,cancelToken:h,timeout:c,onDownloadProgress:d,onUploadProgress:b,responseType:g,headers:y,withCredentials:M="same-origin",fetchOptions:x}=T5(t);g=g?(g+"").toLowerCase():"text";let E=Che([i,h&&h.toAbortSignal()],c),A,k=E&&E.unsubscribe&&(()=>{E.unsubscribe()}),O;try{if(b&&uze&&r!=="get"&&r!=="head"&&(O=await cze(y,a))!==0){let G=new Request(e,{method:"POST",body:a,duplex:"half"}),ie;if(vt.isFormData(a)&&(ie=G.headers.get("content-type"))&&y.setContentType(ie),G.body){let[D,q]=gP(O,Pv(bP(b)));a=_P(G.body,Lhe,D,q)}}vt.isString(M)||(M=M?"include":"omit");let N="credentials"in Request.prototype;A=new Request(e,{...x,signal:E,method:r.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:N?M:void 0});let L=await fetch(A),C=MP&&(g==="stream"||g==="response");if(MP&&(d||C&&k)){let G={};["status","statusText","headers"].forEach(V=>{G[V]=L[V]});let ie=vt.toFiniteNumber(L.headers.get("content-length")),[D,q]=d&&gP(ie,Pv(bP(d),!0))||[];L=new Response(_P(L.body,Lhe,D,()=>{q&&q(),k&&k()}),G)}g=g||"text";let Y=await k5[vt.findKey(k5,g)||"text"](L,t);return!C&&k&&k(),await new Promise((G,ie)=>{Xb(G,ie,{data:Y,headers:Kn.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:A})})}catch(N){throw k&&k(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new wr("Network Error",wr.ERR_NETWORK,t,A),{cause:N.cause||N}):wr.from(N,N&&N.code,t,A)}});var xP={http:x5,xhr:Nhe,fetch:Uhe};vt.forEach(xP,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var qhe=t=>`- ${t}`,lze=t=>vt.isFunction(t)||t===null||t===!1,B5={getAdapter:t=>{t=vt.isArray(t)?t:[t];let{length:e}=t,r,a,i={};for(let h=0;h<e;h++){r=t[h];let c;if(a=r,!lze(r)&&(a=xP[(c=String(r)).toLowerCase()],a===void 0))throw new wr(`Unknown adapter '${c}'`);if(a)break;i[c||"#"+h]=a}if(!a){let h=Object.entries(i).map(([d,b])=>`adapter ${d} `+(b===!1?"is not supported by the environment":"is not available in the build")),c=e?h.length>1?`since :
190
190
  `+h.map(qhe).join(`