@orbs-network/spot-react 0.0.28 → 0.0.30

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.
@@ -1,4 +1,4 @@
1
- (function(R,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],M):(R=typeof globalThis<"u"?globalThis:R||self,M(R.SpotReact={},R.React,R.jsxRuntime,R.ReactDOM))})(this,(function(R,M,B,ka){"use strict";var LW=Object.defineProperty;var B5=R=>{throw TypeError(R)};var zW=(R,M,B)=>M in R?LW(R,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[M]=B;var Yu=(R,M,B)=>zW(R,typeof M!="symbol"?M+"":M,B),Em=(R,M,B)=>M.has(R)||B5("Cannot "+B);var N=(R,M,B)=>(Em(R,M,"read from private field"),B?B.call(R):M.get(R)),le=(R,M,B)=>M.has(R)?B5("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(R):M.set(R,B),ee=(R,M,B,ka)=>(Em(R,M,"write to private field"),ka?ka.call(R,B):M.set(R,B),B),Ae=(R,M,B)=>(Em(R,M,"access private method"),B);var Ku=(R,M,B,ka)=>({set _(Xu){ee(R,M,Xu,B)},get _(){return N(R,M,ka)}});var fn,pa,f5,fa,gs,go,m5,xo,xs,wo,h5,ma,b5,ha,vo,Br,ba,Bt,xc,ya,Kr,Yn,y5,sr,De,wc,qt,ga,Eo,Gn,ws,vc,ko,Co,xa,wa,vs,To,Ve,Cc,km,Cm,Tm,Sm,Am,Pm,Im,F5,g5,Ec,mn,Yt,va,hn,Ss,x5,jn,Zr,kc,w5,Vn,Es,ar,Wn,qn,Zu,Bm,v5,bn,E5,ft,ks,Cs,So,Ao,Ts,Po,Io,k5;function Xu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gt=Xu(M),Dt={SpookySwap:{chainName:"ftm",chainId:250,twapVersion:4,twapAddress:"0xd3B290FEB04E353d1821bc0a12397FdEa9a846C0",lensAddress:"0x0221EfDF1Fd3212AF87F23cceB7693a65fAF1d7f",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwap",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0xdF7CCd5fc7077E9de5f27a7b7bfDC837c82f8496",exchangeType:"ExchangeV2",pathfinderKey:""},SpookySwapSonic:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwapSonic",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0x6699bE3aF75e5c1B807b1031dBde6dA9A67739F3",exchangeType:"ExchangeV2",pathfinderKey:""},QuickSwap:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:"QuickSwap,QuickSwapV3"},QuickSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0xb7a3d74895bfd3aff6780525e36d79fcf26a895f",exchangeType:"ExchangeV2",pathfinderKey:""},Chronos:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Chronos",partner:"Orbs:TWAP:Chronos",exchangeAddress:"0x0178e50adAF3b925F27aC518FCd952CE7F9A3B36",exchangeType:"ExchangeV2",pathfinderKey:"Chronos Stable,Chronos Volatile,Chronos V3"},BaseSwap:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BaseSwap",partner:"Orbs:TWAP:BaseSwap",exchangeAddress:"0xAca3155c17530C4aA96746F226fcC049658490d2",exchangeType:"ExchangeV2",pathfinderKey:"BaseSwap,BaseSwapX"},Arbidex:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Arbidex",partner:"Orbs:TWAP:Arbidex",exchangeAddress:"0x49d21052f4695d16C7cce6eF561301Aa4d840420",exchangeType:"ExchangeV2",pathfinderKey:"Arbidex Classic,Arbidex Quantum"},Thena:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Thena",partner:"Orbs:TWAP:Thena",exchangeAddress:"0x2B2fABDbfa4a15da0d351F947C14F4520db0bDc1",exchangeType:"ExchangeV2",pathfinderKey:"43,47"},PancakeSwap:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0x1A2bb6B75D58b740d88413ef4840D6fa3F637940",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapArbitrum:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapLinea:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},Lynex:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"Lynex",partner:"Orbs:TWAP:Lynex",exchangeAddress:"0x04C06C96d7D19977156016DD408B5992af0570a2",exchangeType:"ExchangeV2",pathfinderKey:"19,18"},SyncSwap:{chainName:"zkSync",chainId:324,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"SyncSwap",partner:"Orbs:TWAP:SyncSwap",exchangeAddress:"0x422623a40c42f026Ed33A9910078Aa843FD66e27",exchangeType:"ExchangeV2",pathfinderKey:"2,3"},Retro:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Retro",partner:"Orbs:TWAP:Retro",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2",pathfinderKey:"retro,retro-v3"},SushiArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiArb",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiBase",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiEth:{chainName:"eth",chainId:1,twapVersion:4,twapAddress:"0xb1ed8BCAD1EaC8a1DF0764700472391800D12946",lensAddress:"0x0967f448c4d4dbd14c355E635AE9CbF68cc44A60",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:200,name:"SushiEth",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiKatana:{chainName:"katana",chainId:747474,twapVersion:4,twapAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",lensAddress:"0x1579EED0527781B1A748043AA1f59a3858Ace4a7",takers:["0xF74437A3Fc45a518640828E5D6A3E8c9A9BbDC3a","0x07A6C715063e94c0D95e809efefFCbF4EBEdfD55"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiKatana",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x92209481507e6B2d14C9b5b70Ed287024177220E",exchangeType:"ExchangeV2",pathfinderKey:""},DragonSwap:{chainName:"sei",chainId:1329,twapVersion:4,twapAddress:"0xde737dB24548F8d41A4a3Ca2Bac8aaaDc4DBA099",lensAddress:"0xa1376f2Bb80D3cF6c2D8ebEf34b3d122e9af4020",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"DragonSwap",partner:"Orbs:TWAP:DragonSwap",exchangeAddress:"0xf2F933FafbDB97062CfA3c447ff373e76A90Efd6",exchangeType:"ExchangeV2",pathfinderKey:""},TeaFi:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"TeaFi",partner:"Orbs:TWAP:TeaFi",exchangeAddress:"0xE9D3b4Cf5B0CC392e78C1a4DD9885D449EEF9793",exchangeType:"ParaswapExchange",pathfinderKey:"AaveV2,AaveV3,AaveV3Stata,AngleStakedStableEUR,AngleStakedStableUSD,ApeSwap,AugustusRFQ,BalancerV2,ComethSwap,CurveV1,CurveV1Factory,CurveV1StableNg,CurveV2,Dfyn,DODOV2,Dystopia,Hashflow,IronV2,JarvisV6,KyberDmm,QuickSwap,QuickSwapV3,Retro,SushiSwap,SushiSwapV3,SwaapV2,Synapse,UniswapV2,UniswapV3,WaultFinance,Wmatic,WooFiV2,wUSDM"},SparkDEX:{chainName:"flare",chainId:14,twapVersion:4,twapAddress:"0x9D70B0b90915Bb8b9bdAC7e6a7e6435bBF1feC4D",lensAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SparkDEX",partner:"Orbs:TWAP:SparkDEX",exchangeAddress:"0xe59c53C76bB7EEc01401A18fA8215B94bC65Bf56",exchangeType:"P2Exchange"},Ramses:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Ramses",partner:"Orbs:TWAP:Ramses",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:""},SwapX:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SwapX",partner:"Orbs:TWAP:SwapX",exchangeAddress:"0xDA902994b7F7a1ecDd8De02E4a17dbFF2E6F67b7",exchangeType:"ExchangeV2",pathfinderKey:""},H2Finance:{chainName:"cronos-zkevm",chainId:388,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"H2Finance",partner:"Orbs:TWAP:H2Finance",exchangeAddress:"0x2f1f10dc311722Be609e6B427bF3FBac6e44093B",exchangeType:"ExchangeV2"},Shadow:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Shadow",partner:"Orbs:TWAP:Shadow",exchangeAddress:"0x69e3c891450161b7BF27f181eE85E7bAE69E5b07",exchangeType:"ExchangeV2"},Kodiak:{chainName:"berachain",chainId:80094,twapVersion:4,twapAddress:"0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E",lensAddress:"0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Kodiak",partner:"Orbs:TWAP:Kodiak",exchangeAddress:"0x69B7aE1250B8d1309954CaD65b6607ae478Ec6eE",exchangeType:"ExchangeV2"},OmniBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"OmniBase",partner:"Orbs:TWAP:OmniBase",exchangeAddress:"0x54435FcFDF3A08150Ed799b6EF472A20a432303F",exchangeType:"ParaswapExchange"},OmniArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"OmniArb",partner:"Orbs:TWAP:OmniArb",exchangeAddress:"0xF0607785424d342Cceb33E708f4579CA97a3b392",exchangeType:"ParaswapExchange"},BlackholeAvax:{chainName:"avax",chainId:43114,twapVersion:4,twapAddress:"0xf77Ad005aBF7e31f669ce89a6568B2f39Ca92cDe",lensAddress:"0x48466B82Ce1575c5c9eCa168ac1090048dD47fA3",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BlackholeAvax",partner:"Orbs:TWAP:BlackholeAvax",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2"},NewEraBnb:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"NewEraBnb",partner:"Orbs:TWAP:NewEraBnb",exchangeAddress:"0xA22D7Df24d9Ea4D4EF6dC96b2204bd550430eC42",exchangeType:"ExchangeV2"}},U5=[{constant:!1,inputs:[{name:"wad",type:"uint256"}],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[],name:"deposit",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"}],O5=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],D5=JSON.parse('[{"inputs":[{"internalType":"address","name":"_iweth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"name":"OrderBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"OrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"}],"name":"OrderCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstAmountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcFilledAmount","type":"uint256"}],"name":"OrderFilled","type":"event"},{"inputs":[],"name":"MIN_BID_DELAY_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_OUTBID_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_BASE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_BID_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_CANCELED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_COMPLETED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"_ask","type":"tuple"}],"name":"ask","outputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"book","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"fill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"makerOrders","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"order","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"internalType":"struct OrderLib.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"orderIdsByMaker","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"prune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]'),_5=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"cancel",inputs:[{name:"digests",type:"bytes32[]",internalType:"bytes32[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"hashTypedData",inputs:[{name:"structHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"digest",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"repermitWitnessTransferFrom",inputs:[{name:"permit",type:"tuple",internalType:"struct RePermitLib.RePermitTransferFrom",components:[{name:"permitted",type:"tuple",internalType:"struct RePermitLib.TokenPermissions",components:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"}]},{name:"request",type:"tuple",internalType:"struct RePermitLib.TransferRequest",components:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"signer",type:"address",internalType:"address"},{name:"witness",type:"bytes32",internalType:"bytes32"},{name:"witnessTypeString",type:"string",internalType:"string"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"spent",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"event",name:"Cancel",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"digest",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"Spend",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"permitHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"totalSpent",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"Canceled",inputs:[]},{type:"error",name:"Expired",inputs:[]},{type:"error",name:"InsufficientAllowance",inputs:[]},{type:"error",name:"InvalidShortString",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"StringTooLong",inputs:[{name:"str",type:"string",internalType:"string"}]}],Om=U5,M5=O5,Dm=_5,_m=D5;var Ee=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(Ee||{}),ut=(e=>(e.Open="OPEN",e.Canceled="CANCELED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ut||{}),Gt=(e=>(e[e.Minutes=6e4]="Minutes",e[e.Hours=36e5]="Hours",e[e.Weeks=6048e5]="Weeks",e[e.Days=864e5]="Days",e[e.Months=2592e6]="Months",e[e.Years=31536e6]="Years",e))(Gt||{}),dt=(e=>(e.LIMIT="limit",e.TWAP_LIMIT="twap-limit",e.TWAP_MARKET="twap-market",e.TRIGGER_PRICE_MARKET="trigger-price-market",e.TRIGGER_PRICE_LIMIT="trigger-price-limit",e))(dt||{}),Mm=(e=>(e.Arbidex="arbidex",e.Blackhole="blackhole",e.Chronos="chronos",e.Dragon="dragon",e.Kodiak="kodiak",e.Lynex="lynex",e.Nami="nami",e.Newera="newera",e.Omni="omni",e.Pancake="pancake",e.Quick="quick",e.Ramses="ramses",e.Shadow="shadow",e.Spark="spark",e.Spooky="spooky",e.Swapx="swapx",e.Teafi="teafi",e.Thena="thena",e.Yowie="yowie",e))(Mm||{});const xt="0x0000000000000000000000000000000000000000",Ft={eth:{id:1,name:"Ethereum",shortname:"eth",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://eth.llamarpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://etherscan.io",eip1559:!0},bsc:{id:56,name:"BinanceSmartChain",shortname:"bsc",native:{address:xt,symbol:"BNB",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},wToken:{symbol:"WBNB",address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},publicRpcUrl:"https://bsc-dataseed.binance.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/bsc_2.svg",explorer:"https://bscscan.com",eip1559:!1},poly:{id:137,name:"Polygon",shortname:"poly",native:{address:xt,symbol:"POL",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"},wToken:{symbol:"WPOL",address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png"},publicRpcUrl:"https://polygon-rpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/polygon.svg",explorer:"https://polygonscan.com",eip1559:!0},arb:{id:42161,name:"Arbitrum",shortname:"arb",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://arb1.arbitrum.io/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/arbitrum.svg",explorer:"https://arbiscan.io",eip1559:!0},sei:{id:1329,name:"Sei",shortname:"sei",native:{address:xt,symbol:"SEI",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png"},wToken:{symbol:"WSEI",address:"0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://evm-rpc.sei-apis.com",logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png",explorer:"https://seitrace.com",eip1559:!1},avax:{id:43114,name:"Avalanche",shortname:"avax",native:{address:xt,symbol:"AVAX",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg"},wToken:{symbol:"WAVAX",address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png"},publicRpcUrl:"https://api.avax.network/ext/bc/C/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg",explorer:"https://snowtrace.io",eip1559:!0},ftm:{id:250,name:"Fantom",shortname:"ftm",native:{address:xt,symbol:"FTM",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg"},wToken:{symbol:"WFTM",address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png"},publicRpcUrl:"https://rpc.ftm.tools",logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg",explorer:"https://ftmscan.com",eip1559:!0},base:{id:8453,name:"Base",shortname:"base",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.base.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/base.svg",explorer:"https://basescan.org",eip1559:!1},linea:{id:59144,name:"Linea",shortname:"linea",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.linea.build",logoUrl:"https://lineascan.build/images/logo.svg",explorer:"https://lineascan.build",eip1559:!1},zksync:{id:324,name:"zksync",shortname:"zksync",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.era.zksync.io",logoUrl:"https://raw.githubusercontent.com/matter-labs/zksync/0a4ca2145a0c95b5bafa84c2f095c644907a8825/zkSyncLogo.svg",explorer:"https://explorer.zksync.io/",eip1559:!0},zkevm:{id:1101,name:"zkevm",shortname:"zkevm",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zkevm-rpc.com",logoUrl:"https://user-images.githubusercontent.com/18598517/235932702-bc47eae5-d672-4dd9-9da2-8ea8f51a93f3.png",explorer:"https://zkevm.polygonscan.com/",eip1559:!0},manta:{id:169,name:"manta",shortname:"manta",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg"},wToken:{symbol:"WETH",address:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://pacific-rpc.manta.network/http",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg",explorer:"https://manta.socialscan.io/",eip1559:!0},blast:{id:81457,name:"blast",shortname:"blast",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast"},wToken:{symbol:"WETH",address:"0x4300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.ankr.com/blast",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast",explorer:"https://blastscan.io/",eip1559:!0},sonic:{id:146,name:"sonic",shortname:"sonic",native:{address:xt,symbol:"S",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},wToken:{symbol:"WS",address:"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},publicRpcUrl:"https://rpc.soniclabs.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic",explorer:"https://www.sonicscan.org/",eip1559:!0},scroll:{id:534352,name:"scroll",shortname:"scroll",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll"},wToken:{symbol:"WETH",address:"0x5300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://scroll-rpc.publicnode.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll",explorer:"https://scrollscan.com/",eip1559:!0},zircuit:{id:48900,name:"Zircuit",shortname:"zircuit",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"hhttps://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zircuit-mainnet.drpc.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://explorer.zircuit.com/",eip1559:!0},flare:{id:14,name:"flare",shortname:"flare",native:{address:xt,symbol:"FLR",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48"},wToken:{symbol:"WFLR",address:"0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d",decimals:18,logoUrl:"https://res.cloudinary.com/sparkdex/image/upload/q_100/v1/website-assets/coins/wflr?_a=DATAg1AAZAA0"},publicRpcUrl:"https://flare.network",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48",explorer:"https://flarescan.com",eip1559:!0},cronosZkEvm:{id:388,name:"Cronos zkEVM",shortname:"cronosZkEvm",native:{address:"0x000000000000000000000000000000000000800a",symbol:"zkCRO",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},wToken:{symbol:"wzkCRO",address:"0xC1bF55EE54E16229d9b369a5502Bfe5fC9F20b6d",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},publicRpcUrl:"https://rpc.zkevm.cronos.org",logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png",explorer:"https://explorer.zkevm.cronos.org",eip1559:!0},katana:{id:747474,name:"Katana",shortname:"katana",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://katana.network/assets/katana-logo.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://katana.network/assets/weth-logo.svg"},publicRpcUrl:"https://rpc.katana.network",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://explorer.katana.garden",eip1559:!0},bera:{id:80094,name:"Bera",shortname:"bera",native:{address:xt,symbol:"BERA",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/24647.png"},wToken:{symbol:"WBERA",address:"0x6969696969696969696969696969696969696969",decimals:18,logoUrl:"https://berascan.com/token/images/wrappedbera_ofc_64.png"},publicRpcUrl:"wss://rpc.berachain-apis.com",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://berascan.com",eip1559:!0},monad:{id:143,name:"Monad",shortname:"monad",native:{address:xt,symbol:"MONAD",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png"},wToken:{symbol:"WMON",address:"0x3bd359c1119da7da1d913d1c4d2b7c461115433a",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/70784/standard/wmon.png?1766028904"},publicRpcUrl:"https://monad-mainnet.drpc.org",logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png",explorer:"https://monad.network",eip1559:!0}};var N5=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Qu=Math.ceil,gr=Math.floor,Kt="[BigNumber Error] ",Nm=Kt+"Number primitive has more than 15 significant digits: ",Ur=1e14,ge=14,Ju=9007199254740991,ed=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Kn=1e7,At=1e9;function Lm(e){var t,r,n,s=v.prototype={constructor:v,toString:null,valueOf:null},a=new v(1),o=20,i=4,c=-7,l=21,u=-1e7,d=1e7,f=!1,m=1,y=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function v(h,b){var x,A,I,F,_,k,P,O,U=this;if(!(U instanceof v))return new v(h,b);if(b==null){if(h&&h._isBigNumber===!0){U.s=h.s,!h.c||h.e>d?U.c=U.e=null:h.e<u?U.c=[U.e=0]:(U.e=h.e,U.c=h.c.slice());return}if((k=typeof h=="number")&&h*0==0){if(U.s=1/h<0?(h=-h,-1):1,h===~~h){for(F=0,_=h;_>=10;_/=10,F++);F>d?U.c=U.e=null:(U.e=F,U.c=[h]);return}O=String(h)}else{if(!N5.test(O=String(h)))return n(U,O,k);U.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}(F=O.indexOf("."))>-1&&(O=O.replace(".","")),(_=O.search(/e/i))>0?(F<0&&(F=_),F+=+O.slice(_+1),O=O.substring(0,_)):F<0&&(F=O.length)}else{if(it(b,2,E.length,"Base"),b==10&&w)return U=new v(h),L(U,o+U.e+1,i);if(O=String(h),k=typeof h=="number"){if(h*0!=0)return n(U,O,k,b);if(U.s=1/h<0?(O=O.slice(1),-1):1,v.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Nm+h)}else U.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(x=E.slice(0,b),F=_=0,P=O.length;_<P;_++)if(x.indexOf(A=O.charAt(_))<0){if(A=="."){if(_>F){F=P;continue}}else if(!I&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){I=!0,_=-1,F=0;continue}return n(U,String(h),k,b)}k=!1,O=r(O,b,10,U.s),(F=O.indexOf("."))>-1?O=O.replace(".",""):F=O.length}for(_=0;O.charCodeAt(_)===48;_++);for(P=O.length;O.charCodeAt(--P)===48;);if(O=O.slice(_,++P)){if(P-=_,k&&v.DEBUG&&P>15&&(h>Ju||h!==gr(h)))throw Error(Nm+U.s*h);if((F=F-_-1)>d)U.c=U.e=null;else if(F<u)U.c=[U.e=0];else{if(U.e=F,U.c=[],_=(F+1)%ge,F<0&&(_+=ge),_<P){for(_&&U.c.push(+O.slice(0,_)),P-=ge;_<P;)U.c.push(+O.slice(_,_+=ge));_=ge-(O=O.slice(_)).length}else _-=P;for(;_--;O+="0");U.c.push(+O)}}else U.c=[U.e=0]}v.clone=Lm,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(h){var b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],it(x,0,At,b),o=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],it(x,0,8,b),i=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(it(x[0],-At,0,b),it(x[1],0,At,b),c=x[0],l=x[1]):(it(x,-At,At,b),c=-(l=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)it(x[0],-At,-1,b),it(x[1],1,At,b),u=x[0],d=x[1];else if(it(x,-At,At,b),x)u=-(d=x<0?-x:x);else throw Error(Kt+b+" cannot be zero: "+x);if(h.hasOwnProperty(b="CRYPTO"))if(x=h[b],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=x;else throw f=!x,Error(Kt+"crypto unavailable");else f=x;else throw Error(Kt+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],it(x,0,9,b),m=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],it(x,0,At,b),y=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")g=x;else throw Error(Kt+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))w=x.slice(0,10)=="0123456789",E=x;else throw Error(Kt+b+" invalid: "+x)}else throw Error(Kt+"Object expected: "+h);return{DECIMAL_PLACES:o,ROUNDING_MODE:i,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:y,FORMAT:g,ALPHABET:E}},v.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var b,x,A=h.c,I=h.e,F=h.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&I>=-At&&I<=At&&I===gr(I)){if(A[0]===0){if(I===0&&A.length===1)return!0;break e}if(b=(I+1)%ge,b<1&&(b+=ge),String(A[0]).length==b){for(b=0;b<A.length;b++)if(x=A[b],x<0||x>=Ur||x!==gr(x))break e;if(x!==0)return!0}}}else if(A===null&&I===null&&(F===null||F===1||F===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},v.maximum=v.max=function(){return C(arguments,-1)},v.minimum=v.min=function(){return C(arguments,1)},v.random=(function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return gr(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var A,I,F,_,k,P=0,O=[],U=new v(a);if(x==null?x=o:it(x,0,At),_=Qu(x/ge),f)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(_*=2));P<_;)k=A[P]*131072+(A[P+1]>>>11),k>=9e15?(I=crypto.getRandomValues(new Uint32Array(2)),A[P]=I[0],A[P+1]=I[1]):(O.push(k%1e14),P+=2);P=_/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(_*=7);P<_;)k=(A[P]&31)*281474976710656+A[P+1]*1099511627776+A[P+2]*4294967296+A[P+3]*16777216+(A[P+4]<<16)+(A[P+5]<<8)+A[P+6],k>=9e15?crypto.randomBytes(7).copy(A,P):(O.push(k%1e14),P+=7);P=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;P<_;)k=b(),k<9e15&&(O[P++]=k%1e14);for(_=O[--P],x%=ge,_&&x&&(k=ed[ge-x],O[P]=gr(_/k)*k);O[P]===0;O.pop(),P--);if(P<0)O=[F=0];else{for(F=-1;O[0]===0;O.splice(0,1),F-=ge);for(P=1,k=O[0];k>=10;k/=10,P++);P<ge&&(F-=ge-P)}return U.e=F,U.c=O,U}})(),v.sum=function(){for(var h=1,b=arguments,x=new v(b[0]);h<b.length;)x=x.plus(b[h++]);return x},r=(function(){var h="0123456789";function b(x,A,I,F){for(var _,k=[0],P,O=0,U=x.length;O<U;){for(P=k.length;P--;k[P]*=A);for(k[0]+=F.indexOf(x.charAt(O++)),_=0;_<k.length;_++)k[_]>I-1&&(k[_+1]==null&&(k[_+1]=0),k[_+1]+=k[_]/I|0,k[_]%=I)}return k.reverse()}return function(x,A,I,F,_){var k,P,O,U,z,H,G,J,pe=x.indexOf("."),he=o,ie=i;for(pe>=0&&(U=y,y=0,x=x.replace(".",""),J=new v(A),H=J.pow(x.length-pe),y=U,J.c=b(yn(wr(H.c),H.e,"0"),10,I,h),J.e=J.c.length),G=b(x,A,I,_?(k=E,h):(k=h,E)),O=U=G.length;G[--U]==0;G.pop());if(!G[0])return k.charAt(0);if(pe<0?--O:(H.c=G,H.e=O,H.s=F,H=t(H,J,he,ie,I),G=H.c,z=H.r,O=H.e),P=O+he+1,pe=G[P],U=I/2,z=z||P<0||G[P+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>U||pe==U&&(ie==4||z||ie==6&&G[P-1]&1||ie==(H.s<0?8:7)),P<1||!G[0])x=z?yn(k.charAt(1),-he,k.charAt(0)):k.charAt(0);else{if(G.length=P,z)for(--I;++G[--P]>I;)G[P]=0,P||(++O,G=[1].concat(G));for(U=G.length;!G[--U];);for(pe=0,x="";pe<=U;x+=k.charAt(G[pe++]));x=yn(x,O,k.charAt(0))}return x}})(),t=(function(){function h(A,I,F){var _,k,P,O,U=0,z=A.length,H=I%Kn,G=I/Kn|0;for(A=A.slice();z--;)P=A[z]%Kn,O=A[z]/Kn|0,_=G*P+O*H,k=H*P+_%Kn*Kn+U,U=(k/F|0)+(_/Kn|0)+G*O,A[z]=k%F;return U&&(A=[U].concat(A)),A}function b(A,I,F,_){var k,P;if(F!=_)P=F>_?1:-1;else for(k=P=0;k<F;k++)if(A[k]!=I[k]){P=A[k]>I[k]?1:-1;break}return P}function x(A,I,F,_){for(var k=0;F--;)A[F]-=k,k=A[F]<I[F]?1:0,A[F]=k*_+A[F]-I[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,I,F,_,k){var P,O,U,z,H,G,J,pe,he,ie,de,Be,Q,we,_e,$e,ot,Se=A.s==I.s?1:-1,ve=A.c,be=I.c;if(!ve||!ve[0]||!be||!be[0])return new v(!A.s||!I.s||(ve?be&&ve[0]==be[0]:!be)?NaN:ve&&ve[0]==0||!be?Se*0:Se/0);for(pe=new v(Se),he=pe.c=[],O=A.e-I.e,Se=F+O+1,k||(k=Ur,O=xr(A.e/ge)-xr(I.e/ge),Se=Se/ge|0),U=0;be[U]==(ve[U]||0);U++);if(be[U]>(ve[U]||0)&&O--,Se<0)he.push(1),z=!0;else{for(we=ve.length,$e=be.length,U=0,Se+=2,H=gr(k/(be[0]+1)),H>1&&(be=h(be,H,k),ve=h(ve,H,k),$e=be.length,we=ve.length),Q=$e,ie=ve.slice(0,$e),de=ie.length;de<$e;ie[de++]=0);ot=be.slice(),ot=[0].concat(ot),_e=be[0],be[1]>=k/2&&_e++;do{if(H=0,P=b(be,ie,$e,de),P<0){if(Be=ie[0],$e!=de&&(Be=Be*k+(ie[1]||0)),H=gr(Be/_e),H>1)for(H>=k&&(H=k-1),G=h(be,H,k),J=G.length,de=ie.length;b(G,ie,J,de)==1;)H--,x(G,$e<J?ot:be,J,k),J=G.length,P=1;else H==0&&(P=H=1),G=be.slice(),J=G.length;if(J<de&&(G=[0].concat(G)),x(ie,G,de,k),de=ie.length,P==-1)for(;b(be,ie,$e,de)<1;)H++,x(ie,$e<de?ot:be,de,k),de=ie.length}else P===0&&(H++,ie=[0]);he[U++]=H,ie[0]?ie[de++]=ve[Q]||0:(ie=[ve[Q]],de=1)}while((Q++<we||ie[0]!=null)&&Se--);z=ie[0]!=null,he[0]||he.splice(0,1)}if(k==Ur){for(U=1,Se=he[0];Se>=10;Se/=10,U++);L(pe,F+(pe.e=U+O*ge-1)+1,_,z)}else pe.e=O,pe.r=+z;return pe}})();function S(h,b,x,A){var I,F,_,k,P;if(x==null?x=i:it(x,0,8),!h.c)return h.toString();if(I=h.c[0],_=h.e,b==null)P=wr(h.c),P=A==1||A==2&&(_<=c||_>=l)?Sc(P,_):yn(P,_,"0");else if(h=L(new v(h),b,x),F=h.e,P=wr(h.c),k=P.length,A==1||A==2&&(b<=F||F<=c)){for(;k<b;P+="0",k++);P=Sc(P,F)}else if(b-=_+(A===2&&F>_),P=yn(P,F,"0"),F+1>k){if(--b>0)for(P+=".";b--;P+="0");}else if(b+=F-k,b>0)for(F+1==k&&(P+=".");b--;P+="0");return h.s<0&&I?"-"+P:P}function C(h,b){for(var x,A,I=1,F=new v(h[0]);I<h.length;I++)A=new v(h[I]),(!A.s||(x=As(F,A))===b||x===0&&F.s===b)&&(F=A);return F}function D(h,b,x){for(var A=1,I=b.length;!b[--I];b.pop());for(I=b[0];I>=10;I/=10,A++);return(x=A+x*ge-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=b),h}n=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,_,k,P){var O,U=k?_:_.replace(I,"");if(A.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!k&&(U=U.replace(h,function(z,H,G){return O=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!P||P==O?H:z}),P&&(O=P,U=U.replace(b,"$1").replace(x,"0.$1")),_!=U))return new v(U,O);if(v.DEBUG)throw Error(Kt+"Not a"+(P?" base "+P:"")+" number: "+_);F.s=null}F.c=F.e=null}})();function L(h,b,x,A){var I,F,_,k,P,O,U,z=h.c,H=ed;if(z){e:{for(I=1,k=z[0];k>=10;k/=10,I++);if(F=b-I,F<0)F+=ge,_=b,P=z[O=0],U=gr(P/H[I-_-1]%10);else if(O=Qu((F+1)/ge),O>=z.length)if(A){for(;z.length<=O;z.push(0));P=U=0,I=1,F%=ge,_=F-ge+1}else break e;else{for(P=k=z[O],I=1;k>=10;k/=10,I++);F%=ge,_=F-ge+I,U=_<0?0:gr(P/H[I-_-1]%10)}if(A=A||b<0||z[O+1]!=null||(_<0?P:P%H[I-_-1]),A=x<4?(U||A)&&(x==0||x==(h.s<0?3:2)):U>5||U==5&&(x==4||A||x==6&&(F>0?_>0?P/H[I-_]:0:z[O-1])%10&1||x==(h.s<0?8:7)),b<1||!z[0])return z.length=0,A?(b-=h.e+1,z[0]=H[(ge-b%ge)%ge],h.e=-b||0):z[0]=h.e=0,h;if(F==0?(z.length=O,k=1,O--):(z.length=O+1,k=H[ge-F],z[O]=_>0?gr(P/H[I-_]%H[_])*k:0),A)for(;;)if(O==0){for(F=1,_=z[0];_>=10;_/=10,F++);for(_=z[0]+=k,k=1;_>=10;_/=10,k++);F!=k&&(h.e++,z[0]==Ur&&(z[0]=1));break}else{if(z[O]+=k,z[O]!=Ur)break;z[O--]=0,k=1}for(F=z.length;z[--F]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function T(h){var b,x=h.e;return x===null?h.toString():(b=wr(h.c),b=x<=c||x>=l?Sc(b,x):yn(b,x,"0"),h.s<0?"-"+b:b)}return s.absoluteValue=s.abs=function(){var h=new v(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,b){return As(this,new v(h,b))},s.decimalPlaces=s.dp=function(h,b){var x,A,I,F=this;if(h!=null)return it(h,0,At),b==null?b=i:it(b,0,8),L(new v(F),h+F.e+1,b);if(!(x=F.c))return null;if(A=((I=x.length-1)-xr(this.e/ge))*ge,I=x[I])for(;I%10==0;I/=10,A--);return A<0&&(A=0),A},s.dividedBy=s.div=function(h,b){return t(this,new v(h,b),o,i)},s.dividedToIntegerBy=s.idiv=function(h,b){return t(this,new v(h,b),0,1)},s.exponentiatedBy=s.pow=function(h,b){var x,A,I,F,_,k,P,O,U,z=this;if(h=new v(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+T(h));if(b!=null&&(b=new v(b)),k=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return U=new v(Math.pow(+T(z),k?h.s*(2-Tc(h)):+T(h))),b?U.mod(b):U;if(P=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new v(NaN);A=!P&&z.isInteger()&&b.isInteger(),A&&(z=z.mod(b))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||k&&z.c[1]>=24e7:z.c[0]<8e13||k&&z.c[0]<=9999975e7)))return F=z.s<0&&Tc(h)?-0:0,z.e>-1&&(F=1/F),new v(P?1/F:F);y&&(F=Qu(y/ge+2))}for(k?(x=new v(.5),P&&(h.s=1),O=Tc(h)):(I=Math.abs(+T(h)),O=I%2),U=new v(a);;){if(O){if(U=U.times(z),!U.c)break;F?U.c.length>F&&(U.c.length=F):A&&(U=U.mod(b))}if(I){if(I=gr(I/2),I===0)break;O=I%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)O=Tc(h);else{if(I=+T(h),I===0)break;O=I%2}z=z.times(z),F?z.c&&z.c.length>F&&(z.c.length=F):A&&(z=z.mod(b))}return A?U:(P&&(U=a.div(U)),b?U.mod(b):F?L(U,y,i,_):U)},s.integerValue=function(h){var b=new v(this);return h==null?h=i:it(h,0,8),L(b,b.e+1,h)},s.isEqualTo=s.eq=function(h,b){return As(this,new v(h,b))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,b){return As(this,new v(h,b))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,b){return(b=As(this,new v(h,b)))===1||b===0},s.isInteger=function(){return!!this.c&&xr(this.e/ge)>this.c.length-2},s.isLessThan=s.lt=function(h,b){return As(this,new v(h,b))<0},s.isLessThanOrEqualTo=s.lte=function(h,b){return(b=As(this,new v(h,b)))===-1||b===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(h,b){var x,A,I,F,_=this,k=_.s;if(h=new v(h,b),b=h.s,!k||!b)return new v(NaN);if(k!=b)return h.s=-b,_.plus(h);var P=_.e/ge,O=h.e/ge,U=_.c,z=h.c;if(!P||!O){if(!U||!z)return U?(h.s=-b,h):new v(z?_:NaN);if(!U[0]||!z[0])return z[0]?(h.s=-b,h):new v(U[0]?_:i==3?-0:0)}if(P=xr(P),O=xr(O),U=U.slice(),k=P-O){for((F=k<0)?(k=-k,I=U):(O=P,I=z),I.reverse(),b=k;b--;I.push(0));I.reverse()}else for(A=(F=(k=U.length)<(b=z.length))?k:b,k=b=0;b<A;b++)if(U[b]!=z[b]){F=U[b]<z[b];break}if(F&&(I=U,U=z,z=I,h.s=-h.s),b=(A=z.length)-(x=U.length),b>0)for(;b--;U[x++]=0);for(b=Ur-1;A>k;){if(U[--A]<z[A]){for(x=A;x&&!U[--x];U[x]=b);--U[x],U[A]+=Ur}U[A]-=z[A]}for(;U[0]==0;U.splice(0,1),--O);return U[0]?D(h,U,O):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,b){var x,A,I=this;return h=new v(h,b),!I.c||!h.s||h.c&&!h.c[0]?new v(NaN):!h.c||I.c&&!I.c[0]?new v(I):(m==9?(A=h.s,h.s=1,x=t(I,h,0,3),h.s=A,x.s*=A):x=t(I,h,0,m),h=I.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=I.s),h)},s.multipliedBy=s.times=function(h,b){var x,A,I,F,_,k,P,O,U,z,H,G,J,pe,he,ie=this,de=ie.c,Be=(h=new v(h,b)).c;if(!de||!Be||!de[0]||!Be[0])return!ie.s||!h.s||de&&!de[0]&&!Be||Be&&!Be[0]&&!de?h.c=h.e=h.s=null:(h.s*=ie.s,!de||!Be?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=xr(ie.e/ge)+xr(h.e/ge),h.s*=ie.s,P=de.length,z=Be.length,P<z&&(J=de,de=Be,Be=J,I=P,P=z,z=I),I=P+z,J=[];I--;J.push(0));for(pe=Ur,he=Kn,I=z;--I>=0;){for(x=0,H=Be[I]%he,G=Be[I]/he|0,_=P,F=I+_;F>I;)O=de[--_]%he,U=de[_]/he|0,k=G*O+U*H,O=H*O+k%he*he+J[F]+x,x=(O/pe|0)+(k/he|0)+G*U,J[F--]=O%pe;J[F]=x}return x?++A:J.splice(0,1),D(h,J,A)},s.negated=function(){var h=new v(this);return h.s=-h.s||null,h},s.plus=function(h,b){var x,A=this,I=A.s;if(h=new v(h,b),b=h.s,!I||!b)return new v(NaN);if(I!=b)return h.s=-b,A.minus(h);var F=A.e/ge,_=h.e/ge,k=A.c,P=h.c;if(!F||!_){if(!k||!P)return new v(I/0);if(!k[0]||!P[0])return P[0]?h:new v(k[0]?A:I*0)}if(F=xr(F),_=xr(_),k=k.slice(),I=F-_){for(I>0?(_=F,x=P):(I=-I,x=k),x.reverse();I--;x.push(0));x.reverse()}for(I=k.length,b=P.length,I-b<0&&(x=P,P=k,k=x,b=I),I=0;b;)I=(k[--b]=k[b]+P[b]+I)/Ur|0,k[b]=Ur===k[b]?0:k[b]%Ur;return I&&(k=[I].concat(k),++_),D(h,k,_)},s.precision=s.sd=function(h,b){var x,A,I,F=this;if(h!=null&&h!==!!h)return it(h,1,At),b==null?b=i:it(b,0,8),L(new v(F),h,b);if(!(x=F.c))return null;if(I=x.length-1,A=I*ge+1,I=x[I]){for(;I%10==0;I/=10,A--);for(I=x[0];I>=10;I/=10,A++);}return h&&F.e+1>A&&(A=F.e+1),A},s.shiftedBy=function(h){return it(h,-Ju,Ju),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,b,x,A,I,F=this,_=F.c,k=F.s,P=F.e,O=o+4,U=new v("0.5");if(k!==1||!_||!_[0])return new v(!k||k<0&&(!_||_[0])?NaN:_?F:1/0);if(k=Math.sqrt(+T(F)),k==0||k==1/0?(b=wr(_),(b.length+P)%2==0&&(b+="0"),k=Math.sqrt(+b),P=xr((P+1)/2)-(P<0||P%2),k==1/0?b="5e"+P:(b=k.toExponential(),b=b.slice(0,b.indexOf("e")+1)+P),x=new v(b)):x=new v(k+""),x.c[0]){for(P=x.e,k=P+O,k<3&&(k=0);;)if(I=x,x=U.times(I.plus(t(F,I,O,1))),wr(I.c).slice(0,k)===(b=wr(x.c)).slice(0,k))if(x.e<P&&--k,b=b.slice(k-3,k+1),b=="9999"||!A&&b=="4999"){if(!A&&(L(I,I.e+o+2,0),I.times(I).eq(F))){x=I;break}O+=4,k+=4,A=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(F));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,b){return h!=null&&(it(h,0,At),h++),S(this,h,b,1)},s.toFixed=function(h,b){return h!=null&&(it(h,0,At),h=h+this.e+1),S(this,h,b)},s.toFormat=function(h,b,x){var A,I=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=g;else if(typeof x!="object")throw Error(Kt+"Argument not an object: "+x);if(A=I.toFixed(h,b),I.c){var F,_=A.split("."),k=+x.groupSize,P=+x.secondaryGroupSize,O=x.groupSeparator||"",U=_[0],z=_[1],H=I.s<0,G=H?U.slice(1):U,J=G.length;if(P&&(F=k,k=P,P=F,J-=F),k>0&&J>0){for(F=J%k||k,U=G.substr(0,F);F<J;F+=k)U+=O+G.substr(F,k);P>0&&(U+=O+G.slice(F)),H&&(U="-"+U)}A=z?U+(x.decimalSeparator||"")+((P=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+P+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):U}return(x.prefix||"")+A+(x.suffix||"")},s.toFraction=function(h){var b,x,A,I,F,_,k,P,O,U,z,H,G=this,J=G.c;if(h!=null&&(k=new v(h),!k.isInteger()&&(k.c||k.s!==1)||k.lt(a)))throw Error(Kt+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+T(k));if(!J)return new v(G);for(b=new v(a),O=x=new v(a),A=P=new v(a),H=wr(J),F=b.e=H.length-G.e-1,b.c[0]=ed[(_=F%ge)<0?ge+_:_],h=!h||k.comparedTo(b)>0?F>0?b:O:k,_=d,d=1/0,k=new v(H),P.c[0]=0;U=t(k,b,0,1),I=x.plus(U.times(A)),I.comparedTo(h)!=1;)x=A,A=I,O=P.plus(U.times(I=O)),P=I,b=k.minus(U.times(I=b)),k=I;return I=t(h.minus(x),A,0,1),P=P.plus(I.times(O)),x=x.plus(I.times(A)),P.s=O.s=G.s,F=F*2,z=t(O,A,F,i).minus(G).abs().comparedTo(t(P,x,F,i).minus(G).abs())<1?[O,A]:[P,x],d=_,z},s.toNumber=function(){return+T(this)},s.toPrecision=function(h,b){return h!=null&&it(h,1,At),S(this,h,b,2)},s.toString=function(h){var b,x=this,A=x.s,I=x.e;return I===null?A?(b="Infinity",A<0&&(b="-"+b)):b="NaN":(h==null?b=I<=c||I>=l?Sc(wr(x.c),I):yn(wr(x.c),I,"0"):h===10&&w?(x=L(new v(x),o+I+1,i),b=yn(wr(x.c),x.e,"0")):(it(h,2,E.length,"Base"),b=r(yn(wr(x.c),I,"0"),10,h,A,!0)),A<0&&x.c[0]&&(b="-"+b)),b},s.valueOf=s.toJSON=function(){return T(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&v.set(e),v}function xr(e){var t=e|0;return e>0||e===t?t:t-1}function wr(e){for(var t,r,n=1,s=e.length,a=e[0]+"";n<s;){for(t=e[n++]+"",r=ge-t.length;r--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function As(e,t){var r,n,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(r=s&&!s[0],n=a&&!a[0],r||n)return r?n?0:-i:o;if(o!=i)return o;if(r=o<0,n=c==l,!s||!a)return n?0:!s^r?1:-1;if(!n)return c>l^r?1:-1;for(i=(c=s.length)<(l=a.length)?c:l,o=0;o<i;o++)if(s[o]!=a[o])return s[o]>a[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function it(e,t,r,n){if(e<t||e>r||e!==gr(e))throw Error(Kt+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Tc(e){var t=e.c.length-1;return xr(e.e/ge)==t&&e.c[t]%2!=0}function Sc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function yn(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(n=e.length,++t>n){for(s=r,t-=n;--t;s+=r);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=Lm();const Xr=(e,t)=>{if(!e||!t)return"";const r=j(10).pow(e||0);return j(t).times(r).idiv(r).div(r).toFixed()},Ac=(e,t)=>!e||!t?"":z5(t).times(j(10).pow(e)).decimalPlaces(0).toFixed(0),L5=j(0);j(1),j(10),j(1e18);function zm(e,t){return e instanceof j?e:e?j(e,t):L5}function Ps(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}function z5(e,t,r){if(typeof e!="string")return zm(e);const n=".",s=e.replace(new RegExp(`[^${n}\\d-]+`,"g"),"");return zm(s)}const Is=e=>!!Wm.find(t=>Ps(t,e||""));function R5(e){return[Gt.Years,Gt.Months,Gt.Weeks,Gt.Days,Gt.Hours,Gt.Minutes].find(r=>r<=e)||Gt.Minutes}const Zn=e=>e?e.value*e.unit:0,H5=e=>!e||e==="NaN"?"0":j(e).decimalPlaces(0).toFixed(),Bs=e=>Object.values(Ft).find(t=>t.id===e),$5=e=>{if(!e)return;const t=e.map(a=>_t(a)),r=Object.entries(qm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),n=e.map(a=>a.exchangeAddress),s=new Set([...n,...r].map(a=>a.toLowerCase()));return Array.from(s)},td=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+cd(t):(e.fillDelay||0)*1e3,Fo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),Rm=e=>xh().filter(t=>t.name===e).map(t=>t.chainId),Hm="https://order-sink-dev.orbs.network",rd="https://order-sink.orbs.network";let nd;const G5=e=>{nd=e},sd=()=>{const e=Fo("env");return e==="prod"?rd:e==="dev"?Hm:nd==="prod"?rd:nd==="dev"?Hm:rd},j5=100,V5=1,Pc=300*1e3,Ca=365*24*60*60*1e3,ad=300*1e3,$m=new Date(Pc).getMinutes(),Gm=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,vr="https://hub.orbs.network/api/apikey/subgraphs/id",jm={[Ft.eth.id]:`${vr}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ft.bsc.id]:`${vr}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ft.poly.id]:`${vr}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ft.arb.id]:`${vr}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ft.base.id]:`${vr}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ft.sei.id]:`${vr}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ft.linea.id]:`${vr}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ft.sonic.id]:`${vr}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ft.ftm.id]:`${vr}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ft.katana.id]:`${vr}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ft.avax.id]:`${vr}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ft.bera.id]:`${vr}/H7aY53mY1hgaSURwXj3ZVirwNSifExwjgEL5GNtTqmEj`,[Ft.flare.id]:Gm("flare"),[Ft.cronosZkEvm.id]:Gm("cronos-zkevm")},Vm="0x0000000000000000000000000000000000000000",Wm=[Vm,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],W5="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,qm={[_t(Dt.SushiArb)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.SushiBase)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.SushiEth)]:["0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.PancakeSwap)]:["0xb2BAFe188faD927240038cC4FfF2d771d8A58905","0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"],[_t(Dt.PancakeSwapArbitrum)]:["0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F","0x807488ADAD033e95C438F998277bE654152594dc"],[_t(Dt.PancakeSwapBase)]:["0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c","0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Dt.PancakeSwapLinea)]:["0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Dt.QuickSwap)]:["0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"],[_t(Dt.Thena)]:["0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"],[_t(Dt.Lynex)]:["0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"],[_t(Dt.DragonSwap)]:["0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"],[_t(Dt.SpookySwapSonic)]:["0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"],[_t(Dt.SpookySwap)]:["0x3924d62219483015f982b160d48c0fa5Fd436Cba"],[_t(Dt.SwapX)]:["0xE5012eBDe5e26EE3Ea41992154731a03023CF274"]},Ic={unit:Gt.Minutes,value:$m},q5=.25,Y5="100",Ym="RePermitWitnessTransferFrom",Km={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"stop",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},od="https://www.orbs.com/dtwap-and-dlimit-faq/",K5="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",Z5="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",X5="https://www.orbs.com/assets/img/common/logo.svg",Q5="https://www.orbs.com/",J5="https://www.orbs.com/dtwap-dlimit-disclaimer";var Bc=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e))(Bc||{});const Zm="-5",Xm="10",Qm="-10",Jm="5",ew="Something went wrong";function tw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function rw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const nw={14:{dex:{spark:{type:"default:spark",adapter:"0xB18c633B6584A33E45a8840a759f56dF17117b1D",fee:"0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b"}}},56:{dex:{thena:{type:"default:odos-v2",adapter:"0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67",fee:"0x15eBc8b5b3877512FFF23650188694A9a8891FAc"},pancake:{type:"p2:pancakeswap-v2",adapter:"0x654272F7e6e6E912D38650f783eFd44452fD6ee5",fee:"0x37A957f10F458e0d7fDECBE2917971b57F15c927"},newera:{type:"default:odos-v2",adapter:"0x845f459271D800f6Ab32D78400b8Aa18414E80b0",fee:"0x4E7454909eB6D539111D56b50d68897E933D2d11"}}},137:{dex:{quick:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},teafi:{type:"paraswap:paraswap-v5",adapter:"0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29",fee:"0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50"}}},143:{dex:{yowie:{type:"default:openocean-v2",adapter:"0x18bc9533c3539073B9A9acF12b0AbF7cB73e0F1f",fee:"0x6AF3eE77A3A3257777F5649aFa611b4C7Fd975Ef"}}},146:{dex:{spooky:{type:"default:magpie-v3",adapter:"0xdCee7FDdB932104329d528144Cd17A408722B7e2",fee:"0x840Df4684B35BC68BcdA3F6707A3c82A0D662f8b"},swapx:{type:"default:openocean-v2",adapter:"0xecc733D6F6f2DEa341832D650E30822118884FEb",fee:"0x6E03f7BC0f141894612AA017796096399623895F"},shadow:{type:"default:magpie-v3",adapter:"0x5f3E5F6ACCfc65243A01Da3E93b5A700285592C3",fee:"0xb9e3751fAF3187E1bC468E56a707a8A91754460e"}}},1329:{dex:{dragon:{type:"default:dragon",adapter:"0x02d9d5882129241b67ec21Ebc2C86e1BE9BC9890",fee:"0x0dc1E0525202b32e89bA78ed55b1e5cEdB751334"},nami:{type:"default:openocean-v2",adapter:"0x2D4A1237A98f8cb03C3C85960e859aA44036a306",fee:"0xeB58450e23632003f013568703F54446070E2E80"}}},8453:{dex:{quick:{type:"default:kyber-v2",adapter:"0xc73F03c929A123Ee2f3A98EC18BB240f03980AE5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"}}},42161:{dex:{arbidex:{type:"default:odos-v2",adapter:"0xa734b32151108139e48dCA06eE721538d90A9Ef6",fee:"0xa0c11852f8A44e32F9EC10AD25986A53842f72Ca"},ramses:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xB5BaCB60ECDa0bEF809B2A26eC9B4B926835D7af"},omni:{type:"paraswap:paraswap-v5",adapter:"0xa1baE146161223cd9dCa7137F68eb385934130BE",fee:"0xba5291526c30B097E9F1Fd1Be301E2ab6E0782aa"},chronos:{type:"default:odos-v2",adapter:"0x4Ff90F32aceD08b3e3257B018EA495Fd1Bfe4455",fee:"0x5729af83240EFecAa18eafaAE82961c2DD045Dbe"}}},43114:{dex:{blackhole:{type:"default:kyber-v2",adapter:"0x426ec4bc0d58B80959CDE77576a1942dd40592Fa",fee:"0x7f8B62520D9B5DA0ED517cc36e8dcb2a356f1928"}}},59144:{dex:{lynex:{type:"default:openocean",adapter:"0x4FF6A97A67fe395212f168f011D71fE79E4396f2",fee:"0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423"}}},80094:{dex:{kodiak:{type:"default:kodiak",adapter:"0xBbaa527Aac00b1Ee9A3909D4D8c4447630E29B1F",fee:"0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4"}}},"*":{wm:"0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000",repermit:"0x00002a9C4D9497df5Bd31768eC5d30eEf5405000",cosigner:"0x0007ec53404c423C935e830ec21903e184690000",reactor:"0x0006a959430e8fBB858D81B2D1140B0ae5c26001",executor:"0x000eBA869d76C618ddc4A6D685A0820A620Ce002",refinery:"0x000E474c0D7084EAA35A501035E73269f4b009A5",salt:{wm:"0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152",repermit:"0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7",cosigner:"0x37576f2ac1d2a602f00777611edf6f0cbc27611b0980b29bc7856fa79b2b8073",reactor:"0x034169222370f2fd587ef8998082d762cceef58a272330215f5110ec0d76d400",executor:"0xea139bc421fa5e272bed3db74233b2e02077e0aacf8b855f87961e98f2fb467f",refinery:"0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec"}}};var id,eh;function sw(){if(eh)return id;eh=1;const e=nw,t=s=>rw(`./out/${s}.sol/${s}.json`).abi,r=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function n(s,a){if(!s||!(a!=null&&a.trim()))return;const{dex:o,...i}=e["*"]??{},c=e[s];if(!c)return;const{dex:l,...u}=c,d=l==null?void 0:l[a];if(d)return{...i,...u,...d}}return id={config:n,abis:r,raw:e},id}var th=sw();const rh=(e,t,r)=>{if(!e||!t||!r)return;const n=j(e).times(t),s=j(10).pow(r);return n.div(s).toFixed(0)},nh=(e,t,r,n)=>{if(r||!n||!e||!t)return j(0).toString();const s=j(e).times(j(t)),a=j(10).pow(n),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)},sh=(e,t,r,n)=>{if(e===Ee.TWAP||e===Ee.LIMIT)return"0";if(!n||!t||!r)return;const s=j(t).times(j(r)),a=j(10).pow(n),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)||"0"},ah=(e,t,r,n)=>{const s=Zn(r)*2*t,a=R5(s);return n||(e===Ee.LIMIT?{unit:Gt.Days,value:7}:e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?{unit:Gt.Days,value:1}:{unit:a,value:Number(j(s/a).toFixed(2))})},oh=(e,t,r)=>t!==Ee.TWAP?1:r!==void 0?r:e,ih=(e,t,r,n)=>{if(!t||!r||!n)return 1;const a=j(r).times(t).div(n).integerValue(j.ROUND_FLOOR).toNumber(),o=Math.floor(Ca/2/Zn(e));return Math.max(1,Math.min(a,o))},aw=e=>cd(e)/1e3/60,ch=(e,t)=>e+Zn(t)+6e4,cd=e=>e.bidDelaySeconds*1e3*2,lh=(e,t)=>!e||!t?"0":j(e).div(t).integerValue(j.ROUND_FLOOR).toFixed(0),ow=(e,t)=>({isError:!(e.unit===Ic.unit&&e.value===Ic.value)&&Zn(e)*t>Ca,value:Math.floor(Ca/t)}),uh=(e="",t="",r)=>{if(r===Ee.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},dh=(e="",t="",r)=>{if(r===Ee.TAKE_PROFIT)return{isError:j(t||0).lte(j(e||0)),value:e}},ph=(e="",t="",r=!1,n)=>{if(!r&&n===Ee.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},fh=(e="",t="",r=!1,n)=>{if(!r&&n===Ee.TAKE_PROFIT)return{isError:j(t||0).gte(j(e||0)),value:e}},mh=(e,t)=>e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?{isError:Zn(t)>5184e6,value:5184e6}:{isError:Zn(t)>Ca,value:Ca},hh=e=>({isError:Zn(e)<ad,value:ad}),bh=e=>({isError:Zn(e)<Pc,value:Pc}),yh=(e,t,r)=>({isError:j(t||0).multipliedBy(e||0).isLessThan(r),value:r}),gh=(e,t,r)=>({isError:r===Ee.TWAP&&j(e).isGreaterThan(t),value:t}),ld=(e,t)=>{var r;try{if(!e||!t)throw new Error("Invalid chainId or _dex");const n=(r=Object.entries(Dt).find(([i,c])=>c.chainId===e&&i.toLowerCase().indexOf(t.toLowerCase())>=0))==null?void 0:r[1],{abi:s,...a}=th.config(e,t);return{...a,partner:t,twapConfig:n}}catch{return}},xh=()=>{const e=th.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,r])=>{const n=r==null?void 0:r.dex;return!n||typeof n!="object"?[]:Object.entries(n).map(([s])=>({chainId:Number(t),name:s,config:ld(Number(t),s)}))}).sort((t,r)=>t.name.localeCompare(r.name))},wh=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l,triggerAmountPerTrade:u,config:d})=>{const f=Date.now().toString(),m=parseInt((a/1e3).toFixed(0)),y=H5(s/1e3),g=Fo(Bc.FRESHNESS),E=g?parseInt(g):60,w={permitted:{token:t,amount:n},spender:d.reactor,nonce:f,deadline:y,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:0,data:"0x"},swapper:i,nonce:f,deadline:y,chainid:e,exclusivity:0,epoch:m,slippage:o,freshness:E,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:l||"0",stop:!u||j(u||0).isZero()?"0":u,recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:w,types:Km,primaryType:Ym}},iw={version:"0.0.17"},cw=`https://bi.orbs.network/putes/twap-ui-${.7}`,vh=iw.version;let ud="unknown";function Eh(e){ud=e}function dd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),r=Date.now().toString(36);return`id_${e+t+r}`}const lw=(e,t,r)=>{var n,s,a,o,i,c,l,u,d;return{spotVersion:vh,partner:e.partner,adapter:e.adapter,cosigner:e.cosigner,executor:e.executor,fee:e.fee,reactor:e.reactor,refinery:e.refinery,repermit:e.repermit,router:e.router,type:e.type,wm:e.wm,chainName:((n=e.twapConfig)==null?void 0:n.chainName)||"",chainId:r||0,twapVersion:((s=e.twapConfig)==null?void 0:s.twapVersion)||0,twapAddress:((a=e.twapConfig)==null?void 0:a.twapAddress)||"",lensAddress:((o=e.twapConfig)==null?void 0:o.lensAddress)||"",bidDelaySeconds:((i=e.twapConfig)==null?void 0:i.bidDelaySeconds)||0,minChunkSizeUsd:t,name:((c=e.twapConfig)==null?void 0:c.name)||"",exchangeAddress:((l=e.twapConfig)==null?void 0:l.exchangeAddress)||"",exchangeType:((u=e.twapConfig)==null?void 0:u.exchangeType)||"",pathfinderKey:((d=e.twapConfig)==null?void 0:d.pathfinderKey)||""}},kh=async e=>{try{await fetch(cw,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then()}catch(t){console.error("Failed to send BI",t)}};class uw{constructor(){Yu(this,"timeout");Yu(this,"config");Yu(this,"data",{_id:dd()})}async updateAndSend(t={},r=!1,n){try{this.data={...this.data,...t},r?(await kh(this.data),n==null||n()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{kh(this.data),n==null||n()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,r){this.updateAndSend({cancelOrderIdsV1:r===1?t:void 0,cancelOrderIdsV2:r===2?t:void 0,action:"cancel order",cancelOrderSuccess:!1,cancelOrderTxHash:void 0,actionError:void 0})}onCancelOrderSuccess(t){this.updateAndSend({cancelOrderTxHash:t,cancelOrderSuccess:!0})}onCancelOrderError(t){this.onTxError(t)}onWrapSuccess(t){this.updateAndSend({wrapTxHash:t})}onWrapRequest(){this.updateAndSend({action:"wrap"})}onWrapError(t){this.onTxError(t)}onApproveRequest(){this.updateAndSend({action:"approve"})}onApproveSuccess(t){this.updateAndSend({approvalTxHash:t})}onApproveError(t){this.onTxError(t)}onCrash(t){var r;this.updateAndSend({action:"crash",actionError:((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var n;const r=((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:r})}onRequestOrder({account:t,chainId:r,module:n,srcToken:s,dstToken:a,fromTokenAmount:o,srcChunkAmount:i,minDstAmountOutPerTrade:c="",triggerPricePerTrade:l="",deadline:u,fillDelay:d,slippage:f,isMarketOrder:m}){const y=j(o).div(i).integerValue(j.ROUND_FLOOR).toNumber();this.updateAndSend({toTokenAddress:a.address,toTokenSymbol:a.symbol,fromTokenAddress:s.address,fromTokenSymbol:s.symbol,fromTokenAmount:o,chunksAmount:y,srcChunkAmount:i,minDstAmountOutPerTrade:c,triggerPricePerTrade:l,deadline:u,fillDelay:d,slippage:f,chainId:r,walletAddress:t,module:n,orderType:m?"market":"limit",actionError:void 0})}onSignOrderRequest(t){this.updateAndSend({action:"sign order",order:t})}onSignOrderError(t){this.onTxError(t)}onSignOrderSuccess(t){this.updateAndSend({action:"sign order",signature:t})}init(t,r,n){var s;this.config=t,n!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:dd(),action:"module-import",uiVersion:ud,...lw(t,r,n),origin:window.location.origin},this.updateAndSend(this.data))}onCreateOrderError(t){this.onTxError(t)}onCreateOrderRequest(){this.updateAndSend({action:"create order"})}async onCreateOrderSuccess(t){this.updateAndSend({orderHash:t,orderSuccess:!0},void 0,()=>{this.data={_id:dd(),action:"reset",uiVersion:ud,origin:this.data.origin,spotVersion:vh,partner:this.data.partner,adapter:this.data.adapter,cosigner:this.data.cosigner,executor:this.data.executor,fee:this.data.fee,reactor:this.data.reactor,refinery:this.data.refinery,repermit:this.data.repermit,router:this.data.router,type:this.data.type,wm:this.data.wm,chainName:this.data.chainName||"",chainId:this.data.chainId||0,twapVersion:this.data.twapVersion||0,twapAddress:this.data.twapAddress||"",lensAddress:this.data.lensAddress||"",bidDelaySeconds:this.data.bidDelaySeconds||0,minChunkSizeUsd:this.data.minChunkSizeUsd||0,name:this.data.name||"",exchangeAddress:this.data.exchangeAddress||"",exchangeType:this.data.exchangeType||"",pathfinderKey:this.data.pathfinderKey||""}})}onLoad(){this.updateAndSend({action:"module-import",origin:window.location.origin})}}const ct=new uw,dw=e=>{var s;const t=j(e.order.witness.output.limit||0).gt(1),r=j(e.order.witness.output.stop||0).gt(0),n=((s=e.metadata.chunks)==null?void 0:s.length)||j(e.order.witness.input.maxAmount).div(j(e.order.witness.input.amount)).toNumber();return r&&t?dt.TRIGGER_PRICE_LIMIT:r?dt.TRIGGER_PRICE_MARKET:!t&&n<=1?dt.TWAP_MARKET:n>=1&&t?dt.TWAP_LIMIT:t?dt.LIMIT:dt.TWAP_MARKET},pw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,r=e.metadata.expectedChunks||0,n=j(t).dividedBy(r).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},fw=(e,t)=>e.metadata.status==="completed"||t>=99?ut.Completed:["pending","eligible"].includes(e.metadata.status)?ut.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?ut.Canceled:ut.Expired,mw=e=>{var r;return(((r=e.metadata.chunks)==null?void 0:r.filter(n=>n.status==="success"))||[]).map(n=>({inAmount:n.inAmount,outAmount:n.outAmount,timestamp:new Date(n.timestamp).getTime(),txHash:n.txHash}))},hw=(e,t)=>{var n;const r=e.length;return r>=t&&((n=e[r-1])==null?void 0:n.timestamp)||0},Ch=e=>{const t=pw(e),r=Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,n=e.metadata.expectedChunks||1,s=mw(e);return{id:e.hash,hash:e.hash,version:2,type:dw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:s.reduce((a,o)=>a.plus(o.inAmount),new j(0)).toFixed()||"",dstAmountFilled:s.reduce((a,o)=>a.plus(o.outAmount),new j(0)).toFixed()||"",fills:s,srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:e.metadata.displayOnlyInputTokenPriceUSD?j(e.metadata.displayOnlyInputTokenPriceUSD).toFixed(6):"",fillDelay:e.order.witness.epoch,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,dstMinAmountPerTrade:r,triggerPricePerTrade:j(e.order.witness.output.stop||0).isZero()?"":e.order.witness.output.stop,dstMinAmountTotal:j(r).multipliedBy(n).toString(),srcAmountPerTrade:e.order.witness.input.amount,totalTradesAmount:n,isMarketPrice:j(r||0).lte(1),chainId:e.order.witness.chainid,filledOrderTimestamp:hw(s,n),status:fw(e,t),rawOrder:e}},bw=async({chainId:e,signal:t,account:r})=>r?(await(await fetch(`${sd()}/orders?swapper=${r}&chainId=${e}`,{signal:t})).json()).orders.map(Ch):[],Th=async(e,t)=>{try{const r={signature:t,order:e,status:"pending"};console.log("body",r),ct.onCreateOrderRequest();const s=await(await fetch(`${sd()}/orders/new`,{method:"POST",body:JSON.stringify(r)})).json();if(!s.success)throw new Error(`error:${s.message}, code:${s.code}`);const a=Ch(s.signedOrder);return ct.onCreateOrderSuccess(a.id),a}catch(r){throw ct.onCreateOrderError(r),console.error(r),r}},gn=(e,t)=>e&&e.length?e.map(t||(r=>`${r}`)):void 0,yw=e=>{if(e)return jm[e]},pd=async({chainId:e,buildQuery:t,extractResults:r,signal:n,retries:s=1,limit:a=1e3,page:o})=>{const i=yw(e);if(!i)throw new kw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:n,headers:{"Content-Type":"application/json"}});if(!m.ok)throw new Error(`HTTP error: ${m.status}`);const y=await m.json();if(y.errors)throw new Error(y.errors[0].message);return r(y)}catch(m){if(f===s)throw m;await new Promise(y=>setTimeout(y,500*2**f)),f++}return[]};let l=0;const u=[];if(o!==void 0){const d=t(o,a);try{return await c(d)}catch{console.warn(`Page ${o} failed, retrying one final time...`);try{return await c(d)}catch{return[]}}}for(;;){const d=t(l,a);let f;try{f=await c(d)}catch{console.warn(`Page ${l} failed, retrying one final time...`);try{f=await c(d)}catch{return u}}if(u.push(...f),f.length<a)break;l++}return u},Sh=e=>e.map(t=>({inAmount:t.srcAmountIn,outAmount:t.dstAmountOut,timestamp:t.timestamp,txHash:t.transactionHash})),Ah=(e,t)=>{const r=j(e||0).gt(1);return!r&&t===1?dt.TWAP_MARKET:t>1&&r?dt.TWAP_LIMIT:r?dt.LIMIT:dt.TWAP_MARKET},gw=(e,t,r,n)=>{var f;const s=Sh(r||[]),a=new j(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(j.ROUND_FLOOR).toNumber(),i=(r==null?void 0:r.length)===a?(f=r==null?void 0:r[(r==null?void 0:r.length)-1])==null?void 0:f.timestamp:void 0,c=s.reduce((m,y)=>m.plus(y.inAmount),new j(0)).toFixed(),l=s.reduce((m,y)=>m.plus(y.outAmount),new j(0)).toFixed(),u=Ph(e.ask_srcAmount,c),d=Ah(e.ask_dstMinAmount,a);return{version:1,id:e.Contract_id.toString(),hash:"",type:Ah(e.ask_dstMinAmount,a),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:u,dstAmountFilled:l,srcAmountFilled:c,orderDollarValueIn:j(e.dollarValueIn||0).toFixed(6),srcAmount:e.ask_srcAmount,dstMinAmountTotal:j(e.ask_dstMinAmount).multipliedBy(a).toString(),fills:s,fillDelay:e.ask_fillDelay,deadline:e.ask_deadline*1e3,createdAt:new Date(e.timestamp).getTime(),dstMinAmountPerTrade:j(e.ask_dstMinAmount).eq(1)?"":e.ask_dstMinAmount,triggerPricePerTrade:"",srcAmountPerTrade:e.ask_srcBidAmount,txHash:e.transactionHash,totalTradesAmount:a,isMarketPrice:[dt.TWAP_MARKET,dt.TRIGGER_PRICE_MARKET].includes(d),chainId:t,filledOrderTimestamp:i||0,status:n,rawOrder:e}},xw=e=>{var d;if(!e)return"";const t=gn(e.accounts,f=>`"${f.toLowerCase()}"`),r=gn($5(e.configs),f=>`"${f.toLowerCase()}"`),n=gn(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=gn(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=gn(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=gn(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=gn(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=gn(e.orderIds,f=>`"${f}"`),l=r!=null&&r.length?"":gn((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[r?`exchange_in: [${r.join(", ")}]`:"",l?`twapAddress_in: [${l.join(", ")}]`:"",t?`maker_in: [${t.join(", ")}]`:"",i?`transactionHash_in: [${i.join(", ")}]`:"",c?`Contract_id_in: [${c.join(", ")}]`:"",u?`dollarValueIn_gte: ${u}`:"",n?`srcTokenSymbol_in: [${n.join(", ")}]`:"",s?`dstTokenSymbol_in: [${s.join(", ")}]`:"",a?`srcTokenAddress_in: [${a.join(", ")}]`:"",o?`dstTokenAddress_in: [${o.join(", ")}]`:"",e!=null&&e.startDate?`blockTimestamp_gte: ${e.startDate}`:"",e!=null&&e.endDate?`blockTimestamp_lte: ${e.endDate}`:"",(e==null?void 0:e.orderType)==="limit"?"ask_dstMinAmount_gt: 1":"",(e==null?void 0:e.orderType)==="market"?"ask_dstMinAmount_lte: 1":""].filter(Boolean).join(", ")};async function ww({chainId:e,signal:t,page:r,limit:n,filters:s}){const a=n||1e3,o=xw(s);return await pd({chainId:e,signal:t,limit:a,page:r,buildQuery:(c,l)=>`
1
+ (function(R,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],M):(R=typeof globalThis<"u"?globalThis:R||self,M(R.SpotReact={},R.React,R.jsxRuntime,R.ReactDOM))})(this,(function(R,M,B,ka){"use strict";var zW=Object.defineProperty;var B5=R=>{throw TypeError(R)};var RW=(R,M,B)=>M in R?zW(R,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[M]=B;var Yu=(R,M,B)=>RW(R,typeof M!="symbol"?M+"":M,B),Em=(R,M,B)=>M.has(R)||B5("Cannot "+B);var N=(R,M,B)=>(Em(R,M,"read from private field"),B?B.call(R):M.get(R)),le=(R,M,B)=>M.has(R)?B5("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(R):M.set(R,B),ee=(R,M,B,ka)=>(Em(R,M,"write to private field"),ka?ka.call(R,B):M.set(R,B),B),Ae=(R,M,B)=>(Em(R,M,"access private method"),B);var Ku=(R,M,B,ka)=>({set _(Xu){ee(R,M,Xu,B)},get _(){return N(R,M,ka)}});var fn,pa,f5,fa,gs,go,m5,xo,xs,wo,h5,ma,b5,ha,vo,Br,ba,Bt,xc,ya,Kr,Yn,y5,sr,De,wc,qt,ga,Eo,Gn,ws,vc,ko,Co,xa,wa,vs,To,Ve,Cc,km,Cm,Tm,Sm,Am,Pm,Im,F5,g5,Ec,mn,Yt,va,hn,Ss,x5,jn,Zr,kc,w5,Vn,Es,ar,Wn,qn,Zu,Bm,v5,bn,E5,ft,ks,Cs,So,Ao,Ts,Po,Io,k5;function Xu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gt=Xu(M),Dt={SpookySwap:{chainName:"ftm",chainId:250,twapVersion:4,twapAddress:"0xd3B290FEB04E353d1821bc0a12397FdEa9a846C0",lensAddress:"0x0221EfDF1Fd3212AF87F23cceB7693a65fAF1d7f",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwap",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0xdF7CCd5fc7077E9de5f27a7b7bfDC837c82f8496",exchangeType:"ExchangeV2",pathfinderKey:""},SpookySwapSonic:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwapSonic",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0x6699bE3aF75e5c1B807b1031dBde6dA9A67739F3",exchangeType:"ExchangeV2",pathfinderKey:""},QuickSwap:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:"QuickSwap,QuickSwapV3"},QuickSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0xb7a3d74895bfd3aff6780525e36d79fcf26a895f",exchangeType:"ExchangeV2",pathfinderKey:""},Chronos:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Chronos",partner:"Orbs:TWAP:Chronos",exchangeAddress:"0x0178e50adAF3b925F27aC518FCd952CE7F9A3B36",exchangeType:"ExchangeV2",pathfinderKey:"Chronos Stable,Chronos Volatile,Chronos V3"},BaseSwap:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BaseSwap",partner:"Orbs:TWAP:BaseSwap",exchangeAddress:"0xAca3155c17530C4aA96746F226fcC049658490d2",exchangeType:"ExchangeV2",pathfinderKey:"BaseSwap,BaseSwapX"},Arbidex:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Arbidex",partner:"Orbs:TWAP:Arbidex",exchangeAddress:"0x49d21052f4695d16C7cce6eF561301Aa4d840420",exchangeType:"ExchangeV2",pathfinderKey:"Arbidex Classic,Arbidex Quantum"},Thena:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Thena",partner:"Orbs:TWAP:Thena",exchangeAddress:"0x2B2fABDbfa4a15da0d351F947C14F4520db0bDc1",exchangeType:"ExchangeV2",pathfinderKey:"43,47"},PancakeSwap:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0x1A2bb6B75D58b740d88413ef4840D6fa3F637940",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapArbitrum:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapLinea:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},Lynex:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"Lynex",partner:"Orbs:TWAP:Lynex",exchangeAddress:"0x04C06C96d7D19977156016DD408B5992af0570a2",exchangeType:"ExchangeV2",pathfinderKey:"19,18"},SyncSwap:{chainName:"zkSync",chainId:324,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"SyncSwap",partner:"Orbs:TWAP:SyncSwap",exchangeAddress:"0x422623a40c42f026Ed33A9910078Aa843FD66e27",exchangeType:"ExchangeV2",pathfinderKey:"2,3"},Retro:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Retro",partner:"Orbs:TWAP:Retro",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2",pathfinderKey:"retro,retro-v3"},SushiArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiArb",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiBase",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiEth:{chainName:"eth",chainId:1,twapVersion:4,twapAddress:"0xb1ed8BCAD1EaC8a1DF0764700472391800D12946",lensAddress:"0x0967f448c4d4dbd14c355E635AE9CbF68cc44A60",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:200,name:"SushiEth",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiKatana:{chainName:"katana",chainId:747474,twapVersion:4,twapAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",lensAddress:"0x1579EED0527781B1A748043AA1f59a3858Ace4a7",takers:["0xF74437A3Fc45a518640828E5D6A3E8c9A9BbDC3a","0x07A6C715063e94c0D95e809efefFCbF4EBEdfD55"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiKatana",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x92209481507e6B2d14C9b5b70Ed287024177220E",exchangeType:"ExchangeV2",pathfinderKey:""},DragonSwap:{chainName:"sei",chainId:1329,twapVersion:4,twapAddress:"0xde737dB24548F8d41A4a3Ca2Bac8aaaDc4DBA099",lensAddress:"0xa1376f2Bb80D3cF6c2D8ebEf34b3d122e9af4020",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"DragonSwap",partner:"Orbs:TWAP:DragonSwap",exchangeAddress:"0xf2F933FafbDB97062CfA3c447ff373e76A90Efd6",exchangeType:"ExchangeV2",pathfinderKey:""},TeaFi:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"TeaFi",partner:"Orbs:TWAP:TeaFi",exchangeAddress:"0xE9D3b4Cf5B0CC392e78C1a4DD9885D449EEF9793",exchangeType:"ParaswapExchange",pathfinderKey:"AaveV2,AaveV3,AaveV3Stata,AngleStakedStableEUR,AngleStakedStableUSD,ApeSwap,AugustusRFQ,BalancerV2,ComethSwap,CurveV1,CurveV1Factory,CurveV1StableNg,CurveV2,Dfyn,DODOV2,Dystopia,Hashflow,IronV2,JarvisV6,KyberDmm,QuickSwap,QuickSwapV3,Retro,SushiSwap,SushiSwapV3,SwaapV2,Synapse,UniswapV2,UniswapV3,WaultFinance,Wmatic,WooFiV2,wUSDM"},SparkDEX:{chainName:"flare",chainId:14,twapVersion:4,twapAddress:"0x9D70B0b90915Bb8b9bdAC7e6a7e6435bBF1feC4D",lensAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SparkDEX",partner:"Orbs:TWAP:SparkDEX",exchangeAddress:"0xe59c53C76bB7EEc01401A18fA8215B94bC65Bf56",exchangeType:"P2Exchange"},Ramses:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Ramses",partner:"Orbs:TWAP:Ramses",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:""},SwapX:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SwapX",partner:"Orbs:TWAP:SwapX",exchangeAddress:"0xDA902994b7F7a1ecDd8De02E4a17dbFF2E6F67b7",exchangeType:"ExchangeV2",pathfinderKey:""},H2Finance:{chainName:"cronos-zkevm",chainId:388,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"H2Finance",partner:"Orbs:TWAP:H2Finance",exchangeAddress:"0x2f1f10dc311722Be609e6B427bF3FBac6e44093B",exchangeType:"ExchangeV2"},Shadow:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Shadow",partner:"Orbs:TWAP:Shadow",exchangeAddress:"0x69e3c891450161b7BF27f181eE85E7bAE69E5b07",exchangeType:"ExchangeV2"},Kodiak:{chainName:"berachain",chainId:80094,twapVersion:4,twapAddress:"0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E",lensAddress:"0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Kodiak",partner:"Orbs:TWAP:Kodiak",exchangeAddress:"0x69B7aE1250B8d1309954CaD65b6607ae478Ec6eE",exchangeType:"ExchangeV2"},OmniBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"OmniBase",partner:"Orbs:TWAP:OmniBase",exchangeAddress:"0x54435FcFDF3A08150Ed799b6EF472A20a432303F",exchangeType:"ParaswapExchange"},OmniArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"OmniArb",partner:"Orbs:TWAP:OmniArb",exchangeAddress:"0xF0607785424d342Cceb33E708f4579CA97a3b392",exchangeType:"ParaswapExchange"},BlackholeAvax:{chainName:"avax",chainId:43114,twapVersion:4,twapAddress:"0xf77Ad005aBF7e31f669ce89a6568B2f39Ca92cDe",lensAddress:"0x48466B82Ce1575c5c9eCa168ac1090048dD47fA3",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BlackholeAvax",partner:"Orbs:TWAP:BlackholeAvax",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2"},NewEraBnb:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"NewEraBnb",partner:"Orbs:TWAP:NewEraBnb",exchangeAddress:"0xA22D7Df24d9Ea4D4EF6dC96b2204bd550430eC42",exchangeType:"ExchangeV2"}},U5=[{constant:!1,inputs:[{name:"wad",type:"uint256"}],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[],name:"deposit",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"}],O5=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],D5=JSON.parse('[{"inputs":[{"internalType":"address","name":"_iweth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"name":"OrderBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"OrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"}],"name":"OrderCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstAmountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcFilledAmount","type":"uint256"}],"name":"OrderFilled","type":"event"},{"inputs":[],"name":"MIN_BID_DELAY_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_OUTBID_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_BASE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_BID_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_CANCELED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_COMPLETED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"_ask","type":"tuple"}],"name":"ask","outputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"book","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"fill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"makerOrders","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"order","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"internalType":"struct OrderLib.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"orderIdsByMaker","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"prune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]'),_5=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"cancel",inputs:[{name:"digests",type:"bytes32[]",internalType:"bytes32[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"hashTypedData",inputs:[{name:"structHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"digest",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"repermitWitnessTransferFrom",inputs:[{name:"permit",type:"tuple",internalType:"struct RePermitLib.RePermitTransferFrom",components:[{name:"permitted",type:"tuple",internalType:"struct RePermitLib.TokenPermissions",components:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"}]},{name:"request",type:"tuple",internalType:"struct RePermitLib.TransferRequest",components:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"signer",type:"address",internalType:"address"},{name:"witness",type:"bytes32",internalType:"bytes32"},{name:"witnessTypeString",type:"string",internalType:"string"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"spent",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"event",name:"Cancel",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"digest",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"Spend",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"permitHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"totalSpent",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"Canceled",inputs:[]},{type:"error",name:"Expired",inputs:[]},{type:"error",name:"InsufficientAllowance",inputs:[]},{type:"error",name:"InvalidShortString",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"StringTooLong",inputs:[{name:"str",type:"string",internalType:"string"}]}],Om=U5,M5=O5,Dm=_5,_m=D5;var Ee=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(Ee||{}),ut=(e=>(e.Open="OPEN",e.Canceled="CANCELED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ut||{}),Gt=(e=>(e[e.Minutes=6e4]="Minutes",e[e.Hours=36e5]="Hours",e[e.Weeks=6048e5]="Weeks",e[e.Days=864e5]="Days",e[e.Months=2592e6]="Months",e[e.Years=31536e6]="Years",e))(Gt||{}),dt=(e=>(e.LIMIT="limit",e.TWAP_LIMIT="twap-limit",e.TWAP_MARKET="twap-market",e.TRIGGER_PRICE_MARKET="trigger-price-market",e.TRIGGER_PRICE_LIMIT="trigger-price-limit",e))(dt||{}),Mm=(e=>(e.Arbidex="arbidex",e.Blackhole="blackhole",e.Chronos="chronos",e.Dragon="dragon",e.Kodiak="kodiak",e.Lynex="lynex",e.Nami="nami",e.Newera="newera",e.Omni="omni",e.Pancake="pancake",e.Quick="quick",e.Ramses="ramses",e.Shadow="shadow",e.Spark="spark",e.Spooky="spooky",e.Swapx="swapx",e.Teafi="teafi",e.Thena="thena",e.Yowie="yowie",e))(Mm||{});const xt="0x0000000000000000000000000000000000000000",Ft={eth:{id:1,name:"Ethereum",shortname:"eth",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://eth.llamarpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://etherscan.io",eip1559:!0},bsc:{id:56,name:"BinanceSmartChain",shortname:"bsc",native:{address:xt,symbol:"BNB",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},wToken:{symbol:"WBNB",address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},publicRpcUrl:"https://bsc-dataseed.binance.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/bsc_2.svg",explorer:"https://bscscan.com",eip1559:!1},poly:{id:137,name:"Polygon",shortname:"poly",native:{address:xt,symbol:"POL",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"},wToken:{symbol:"WPOL",address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png"},publicRpcUrl:"https://polygon-rpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/polygon.svg",explorer:"https://polygonscan.com",eip1559:!0},arb:{id:42161,name:"Arbitrum",shortname:"arb",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://arb1.arbitrum.io/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/arbitrum.svg",explorer:"https://arbiscan.io",eip1559:!0},sei:{id:1329,name:"Sei",shortname:"sei",native:{address:xt,symbol:"SEI",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png"},wToken:{symbol:"WSEI",address:"0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://evm-rpc.sei-apis.com",logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png",explorer:"https://seitrace.com",eip1559:!1},avax:{id:43114,name:"Avalanche",shortname:"avax",native:{address:xt,symbol:"AVAX",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg"},wToken:{symbol:"WAVAX",address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png"},publicRpcUrl:"https://api.avax.network/ext/bc/C/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg",explorer:"https://snowtrace.io",eip1559:!0},ftm:{id:250,name:"Fantom",shortname:"ftm",native:{address:xt,symbol:"FTM",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg"},wToken:{symbol:"WFTM",address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png"},publicRpcUrl:"https://rpc.ftm.tools",logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg",explorer:"https://ftmscan.com",eip1559:!0},base:{id:8453,name:"Base",shortname:"base",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.base.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/base.svg",explorer:"https://basescan.org",eip1559:!1},linea:{id:59144,name:"Linea",shortname:"linea",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.linea.build",logoUrl:"https://lineascan.build/images/logo.svg",explorer:"https://lineascan.build",eip1559:!1},zksync:{id:324,name:"zksync",shortname:"zksync",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.era.zksync.io",logoUrl:"https://raw.githubusercontent.com/matter-labs/zksync/0a4ca2145a0c95b5bafa84c2f095c644907a8825/zkSyncLogo.svg",explorer:"https://explorer.zksync.io/",eip1559:!0},zkevm:{id:1101,name:"zkevm",shortname:"zkevm",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zkevm-rpc.com",logoUrl:"https://user-images.githubusercontent.com/18598517/235932702-bc47eae5-d672-4dd9-9da2-8ea8f51a93f3.png",explorer:"https://zkevm.polygonscan.com/",eip1559:!0},manta:{id:169,name:"manta",shortname:"manta",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg"},wToken:{symbol:"WETH",address:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://pacific-rpc.manta.network/http",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg",explorer:"https://manta.socialscan.io/",eip1559:!0},blast:{id:81457,name:"blast",shortname:"blast",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast"},wToken:{symbol:"WETH",address:"0x4300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.ankr.com/blast",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast",explorer:"https://blastscan.io/",eip1559:!0},sonic:{id:146,name:"sonic",shortname:"sonic",native:{address:xt,symbol:"S",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},wToken:{symbol:"WS",address:"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},publicRpcUrl:"https://rpc.soniclabs.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic",explorer:"https://www.sonicscan.org/",eip1559:!0},scroll:{id:534352,name:"scroll",shortname:"scroll",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll"},wToken:{symbol:"WETH",address:"0x5300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://scroll-rpc.publicnode.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll",explorer:"https://scrollscan.com/",eip1559:!0},zircuit:{id:48900,name:"Zircuit",shortname:"zircuit",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"hhttps://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zircuit-mainnet.drpc.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://explorer.zircuit.com/",eip1559:!0},flare:{id:14,name:"flare",shortname:"flare",native:{address:xt,symbol:"FLR",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48"},wToken:{symbol:"WFLR",address:"0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d",decimals:18,logoUrl:"https://res.cloudinary.com/sparkdex/image/upload/q_100/v1/website-assets/coins/wflr?_a=DATAg1AAZAA0"},publicRpcUrl:"https://flare.network",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48",explorer:"https://flarescan.com",eip1559:!0},cronosZkEvm:{id:388,name:"Cronos zkEVM",shortname:"cronosZkEvm",native:{address:"0x000000000000000000000000000000000000800a",symbol:"zkCRO",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},wToken:{symbol:"wzkCRO",address:"0xC1bF55EE54E16229d9b369a5502Bfe5fC9F20b6d",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},publicRpcUrl:"https://rpc.zkevm.cronos.org",logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png",explorer:"https://explorer.zkevm.cronos.org",eip1559:!0},katana:{id:747474,name:"Katana",shortname:"katana",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://katana.network/assets/katana-logo.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://katana.network/assets/weth-logo.svg"},publicRpcUrl:"https://rpc.katana.network",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://explorer.katana.garden",eip1559:!0},bera:{id:80094,name:"Bera",shortname:"bera",native:{address:xt,symbol:"BERA",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/24647.png"},wToken:{symbol:"WBERA",address:"0x6969696969696969696969696969696969696969",decimals:18,logoUrl:"https://berascan.com/token/images/wrappedbera_ofc_64.png"},publicRpcUrl:"wss://rpc.berachain-apis.com",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://berascan.com",eip1559:!0},monad:{id:143,name:"Monad",shortname:"monad",native:{address:xt,symbol:"MONAD",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png"},wToken:{symbol:"WMON",address:"0x3bd359c1119da7da1d913d1c4d2b7c461115433a",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/70784/standard/wmon.png?1766028904"},publicRpcUrl:"https://monad-mainnet.drpc.org",logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png",explorer:"https://monad.network",eip1559:!0}};var N5=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Qu=Math.ceil,gr=Math.floor,Kt="[BigNumber Error] ",Nm=Kt+"Number primitive has more than 15 significant digits: ",Ur=1e14,ge=14,Ju=9007199254740991,ed=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Kn=1e7,At=1e9;function Lm(e){var t,r,n,s=v.prototype={constructor:v,toString:null,valueOf:null},a=new v(1),o=20,i=4,c=-7,l=21,u=-1e7,d=1e7,f=!1,m=1,y=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function v(h,b){var x,A,I,F,_,k,P,O,U=this;if(!(U instanceof v))return new v(h,b);if(b==null){if(h&&h._isBigNumber===!0){U.s=h.s,!h.c||h.e>d?U.c=U.e=null:h.e<u?U.c=[U.e=0]:(U.e=h.e,U.c=h.c.slice());return}if((k=typeof h=="number")&&h*0==0){if(U.s=1/h<0?(h=-h,-1):1,h===~~h){for(F=0,_=h;_>=10;_/=10,F++);F>d?U.c=U.e=null:(U.e=F,U.c=[h]);return}O=String(h)}else{if(!N5.test(O=String(h)))return n(U,O,k);U.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}(F=O.indexOf("."))>-1&&(O=O.replace(".","")),(_=O.search(/e/i))>0?(F<0&&(F=_),F+=+O.slice(_+1),O=O.substring(0,_)):F<0&&(F=O.length)}else{if(it(b,2,E.length,"Base"),b==10&&w)return U=new v(h),L(U,o+U.e+1,i);if(O=String(h),k=typeof h=="number"){if(h*0!=0)return n(U,O,k,b);if(U.s=1/h<0?(O=O.slice(1),-1):1,v.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Nm+h)}else U.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(x=E.slice(0,b),F=_=0,P=O.length;_<P;_++)if(x.indexOf(A=O.charAt(_))<0){if(A=="."){if(_>F){F=P;continue}}else if(!I&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){I=!0,_=-1,F=0;continue}return n(U,String(h),k,b)}k=!1,O=r(O,b,10,U.s),(F=O.indexOf("."))>-1?O=O.replace(".",""):F=O.length}for(_=0;O.charCodeAt(_)===48;_++);for(P=O.length;O.charCodeAt(--P)===48;);if(O=O.slice(_,++P)){if(P-=_,k&&v.DEBUG&&P>15&&(h>Ju||h!==gr(h)))throw Error(Nm+U.s*h);if((F=F-_-1)>d)U.c=U.e=null;else if(F<u)U.c=[U.e=0];else{if(U.e=F,U.c=[],_=(F+1)%ge,F<0&&(_+=ge),_<P){for(_&&U.c.push(+O.slice(0,_)),P-=ge;_<P;)U.c.push(+O.slice(_,_+=ge));_=ge-(O=O.slice(_)).length}else _-=P;for(;_--;O+="0");U.c.push(+O)}}else U.c=[U.e=0]}v.clone=Lm,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(h){var b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],it(x,0,At,b),o=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],it(x,0,8,b),i=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(it(x[0],-At,0,b),it(x[1],0,At,b),c=x[0],l=x[1]):(it(x,-At,At,b),c=-(l=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)it(x[0],-At,-1,b),it(x[1],1,At,b),u=x[0],d=x[1];else if(it(x,-At,At,b),x)u=-(d=x<0?-x:x);else throw Error(Kt+b+" cannot be zero: "+x);if(h.hasOwnProperty(b="CRYPTO"))if(x=h[b],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=x;else throw f=!x,Error(Kt+"crypto unavailable");else f=x;else throw Error(Kt+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],it(x,0,9,b),m=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],it(x,0,At,b),y=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")g=x;else throw Error(Kt+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))w=x.slice(0,10)=="0123456789",E=x;else throw Error(Kt+b+" invalid: "+x)}else throw Error(Kt+"Object expected: "+h);return{DECIMAL_PLACES:o,ROUNDING_MODE:i,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:y,FORMAT:g,ALPHABET:E}},v.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var b,x,A=h.c,I=h.e,F=h.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&I>=-At&&I<=At&&I===gr(I)){if(A[0]===0){if(I===0&&A.length===1)return!0;break e}if(b=(I+1)%ge,b<1&&(b+=ge),String(A[0]).length==b){for(b=0;b<A.length;b++)if(x=A[b],x<0||x>=Ur||x!==gr(x))break e;if(x!==0)return!0}}}else if(A===null&&I===null&&(F===null||F===1||F===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},v.maximum=v.max=function(){return C(arguments,-1)},v.minimum=v.min=function(){return C(arguments,1)},v.random=(function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return gr(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var A,I,F,_,k,P=0,O=[],U=new v(a);if(x==null?x=o:it(x,0,At),_=Qu(x/ge),f)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(_*=2));P<_;)k=A[P]*131072+(A[P+1]>>>11),k>=9e15?(I=crypto.getRandomValues(new Uint32Array(2)),A[P]=I[0],A[P+1]=I[1]):(O.push(k%1e14),P+=2);P=_/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(_*=7);P<_;)k=(A[P]&31)*281474976710656+A[P+1]*1099511627776+A[P+2]*4294967296+A[P+3]*16777216+(A[P+4]<<16)+(A[P+5]<<8)+A[P+6],k>=9e15?crypto.randomBytes(7).copy(A,P):(O.push(k%1e14),P+=7);P=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;P<_;)k=b(),k<9e15&&(O[P++]=k%1e14);for(_=O[--P],x%=ge,_&&x&&(k=ed[ge-x],O[P]=gr(_/k)*k);O[P]===0;O.pop(),P--);if(P<0)O=[F=0];else{for(F=-1;O[0]===0;O.splice(0,1),F-=ge);for(P=1,k=O[0];k>=10;k/=10,P++);P<ge&&(F-=ge-P)}return U.e=F,U.c=O,U}})(),v.sum=function(){for(var h=1,b=arguments,x=new v(b[0]);h<b.length;)x=x.plus(b[h++]);return x},r=(function(){var h="0123456789";function b(x,A,I,F){for(var _,k=[0],P,O=0,U=x.length;O<U;){for(P=k.length;P--;k[P]*=A);for(k[0]+=F.indexOf(x.charAt(O++)),_=0;_<k.length;_++)k[_]>I-1&&(k[_+1]==null&&(k[_+1]=0),k[_+1]+=k[_]/I|0,k[_]%=I)}return k.reverse()}return function(x,A,I,F,_){var k,P,O,U,z,H,G,J,pe=x.indexOf("."),he=o,ie=i;for(pe>=0&&(U=y,y=0,x=x.replace(".",""),J=new v(A),H=J.pow(x.length-pe),y=U,J.c=b(yn(wr(H.c),H.e,"0"),10,I,h),J.e=J.c.length),G=b(x,A,I,_?(k=E,h):(k=h,E)),O=U=G.length;G[--U]==0;G.pop());if(!G[0])return k.charAt(0);if(pe<0?--O:(H.c=G,H.e=O,H.s=F,H=t(H,J,he,ie,I),G=H.c,z=H.r,O=H.e),P=O+he+1,pe=G[P],U=I/2,z=z||P<0||G[P+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>U||pe==U&&(ie==4||z||ie==6&&G[P-1]&1||ie==(H.s<0?8:7)),P<1||!G[0])x=z?yn(k.charAt(1),-he,k.charAt(0)):k.charAt(0);else{if(G.length=P,z)for(--I;++G[--P]>I;)G[P]=0,P||(++O,G=[1].concat(G));for(U=G.length;!G[--U];);for(pe=0,x="";pe<=U;x+=k.charAt(G[pe++]));x=yn(x,O,k.charAt(0))}return x}})(),t=(function(){function h(A,I,F){var _,k,P,O,U=0,z=A.length,H=I%Kn,G=I/Kn|0;for(A=A.slice();z--;)P=A[z]%Kn,O=A[z]/Kn|0,_=G*P+O*H,k=H*P+_%Kn*Kn+U,U=(k/F|0)+(_/Kn|0)+G*O,A[z]=k%F;return U&&(A=[U].concat(A)),A}function b(A,I,F,_){var k,P;if(F!=_)P=F>_?1:-1;else for(k=P=0;k<F;k++)if(A[k]!=I[k]){P=A[k]>I[k]?1:-1;break}return P}function x(A,I,F,_){for(var k=0;F--;)A[F]-=k,k=A[F]<I[F]?1:0,A[F]=k*_+A[F]-I[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,I,F,_,k){var P,O,U,z,H,G,J,pe,he,ie,de,Be,Q,we,_e,$e,ot,Se=A.s==I.s?1:-1,ve=A.c,be=I.c;if(!ve||!ve[0]||!be||!be[0])return new v(!A.s||!I.s||(ve?be&&ve[0]==be[0]:!be)?NaN:ve&&ve[0]==0||!be?Se*0:Se/0);for(pe=new v(Se),he=pe.c=[],O=A.e-I.e,Se=F+O+1,k||(k=Ur,O=xr(A.e/ge)-xr(I.e/ge),Se=Se/ge|0),U=0;be[U]==(ve[U]||0);U++);if(be[U]>(ve[U]||0)&&O--,Se<0)he.push(1),z=!0;else{for(we=ve.length,$e=be.length,U=0,Se+=2,H=gr(k/(be[0]+1)),H>1&&(be=h(be,H,k),ve=h(ve,H,k),$e=be.length,we=ve.length),Q=$e,ie=ve.slice(0,$e),de=ie.length;de<$e;ie[de++]=0);ot=be.slice(),ot=[0].concat(ot),_e=be[0],be[1]>=k/2&&_e++;do{if(H=0,P=b(be,ie,$e,de),P<0){if(Be=ie[0],$e!=de&&(Be=Be*k+(ie[1]||0)),H=gr(Be/_e),H>1)for(H>=k&&(H=k-1),G=h(be,H,k),J=G.length,de=ie.length;b(G,ie,J,de)==1;)H--,x(G,$e<J?ot:be,J,k),J=G.length,P=1;else H==0&&(P=H=1),G=be.slice(),J=G.length;if(J<de&&(G=[0].concat(G)),x(ie,G,de,k),de=ie.length,P==-1)for(;b(be,ie,$e,de)<1;)H++,x(ie,$e<de?ot:be,de,k),de=ie.length}else P===0&&(H++,ie=[0]);he[U++]=H,ie[0]?ie[de++]=ve[Q]||0:(ie=[ve[Q]],de=1)}while((Q++<we||ie[0]!=null)&&Se--);z=ie[0]!=null,he[0]||he.splice(0,1)}if(k==Ur){for(U=1,Se=he[0];Se>=10;Se/=10,U++);L(pe,F+(pe.e=U+O*ge-1)+1,_,z)}else pe.e=O,pe.r=+z;return pe}})();function S(h,b,x,A){var I,F,_,k,P;if(x==null?x=i:it(x,0,8),!h.c)return h.toString();if(I=h.c[0],_=h.e,b==null)P=wr(h.c),P=A==1||A==2&&(_<=c||_>=l)?Sc(P,_):yn(P,_,"0");else if(h=L(new v(h),b,x),F=h.e,P=wr(h.c),k=P.length,A==1||A==2&&(b<=F||F<=c)){for(;k<b;P+="0",k++);P=Sc(P,F)}else if(b-=_+(A===2&&F>_),P=yn(P,F,"0"),F+1>k){if(--b>0)for(P+=".";b--;P+="0");}else if(b+=F-k,b>0)for(F+1==k&&(P+=".");b--;P+="0");return h.s<0&&I?"-"+P:P}function C(h,b){for(var x,A,I=1,F=new v(h[0]);I<h.length;I++)A=new v(h[I]),(!A.s||(x=As(F,A))===b||x===0&&F.s===b)&&(F=A);return F}function D(h,b,x){for(var A=1,I=b.length;!b[--I];b.pop());for(I=b[0];I>=10;I/=10,A++);return(x=A+x*ge-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=b),h}n=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,_,k,P){var O,U=k?_:_.replace(I,"");if(A.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!k&&(U=U.replace(h,function(z,H,G){return O=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!P||P==O?H:z}),P&&(O=P,U=U.replace(b,"$1").replace(x,"0.$1")),_!=U))return new v(U,O);if(v.DEBUG)throw Error(Kt+"Not a"+(P?" base "+P:"")+" number: "+_);F.s=null}F.c=F.e=null}})();function L(h,b,x,A){var I,F,_,k,P,O,U,z=h.c,H=ed;if(z){e:{for(I=1,k=z[0];k>=10;k/=10,I++);if(F=b-I,F<0)F+=ge,_=b,P=z[O=0],U=gr(P/H[I-_-1]%10);else if(O=Qu((F+1)/ge),O>=z.length)if(A){for(;z.length<=O;z.push(0));P=U=0,I=1,F%=ge,_=F-ge+1}else break e;else{for(P=k=z[O],I=1;k>=10;k/=10,I++);F%=ge,_=F-ge+I,U=_<0?0:gr(P/H[I-_-1]%10)}if(A=A||b<0||z[O+1]!=null||(_<0?P:P%H[I-_-1]),A=x<4?(U||A)&&(x==0||x==(h.s<0?3:2)):U>5||U==5&&(x==4||A||x==6&&(F>0?_>0?P/H[I-_]:0:z[O-1])%10&1||x==(h.s<0?8:7)),b<1||!z[0])return z.length=0,A?(b-=h.e+1,z[0]=H[(ge-b%ge)%ge],h.e=-b||0):z[0]=h.e=0,h;if(F==0?(z.length=O,k=1,O--):(z.length=O+1,k=H[ge-F],z[O]=_>0?gr(P/H[I-_]%H[_])*k:0),A)for(;;)if(O==0){for(F=1,_=z[0];_>=10;_/=10,F++);for(_=z[0]+=k,k=1;_>=10;_/=10,k++);F!=k&&(h.e++,z[0]==Ur&&(z[0]=1));break}else{if(z[O]+=k,z[O]!=Ur)break;z[O--]=0,k=1}for(F=z.length;z[--F]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function T(h){var b,x=h.e;return x===null?h.toString():(b=wr(h.c),b=x<=c||x>=l?Sc(b,x):yn(b,x,"0"),h.s<0?"-"+b:b)}return s.absoluteValue=s.abs=function(){var h=new v(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,b){return As(this,new v(h,b))},s.decimalPlaces=s.dp=function(h,b){var x,A,I,F=this;if(h!=null)return it(h,0,At),b==null?b=i:it(b,0,8),L(new v(F),h+F.e+1,b);if(!(x=F.c))return null;if(A=((I=x.length-1)-xr(this.e/ge))*ge,I=x[I])for(;I%10==0;I/=10,A--);return A<0&&(A=0),A},s.dividedBy=s.div=function(h,b){return t(this,new v(h,b),o,i)},s.dividedToIntegerBy=s.idiv=function(h,b){return t(this,new v(h,b),0,1)},s.exponentiatedBy=s.pow=function(h,b){var x,A,I,F,_,k,P,O,U,z=this;if(h=new v(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+T(h));if(b!=null&&(b=new v(b)),k=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return U=new v(Math.pow(+T(z),k?h.s*(2-Tc(h)):+T(h))),b?U.mod(b):U;if(P=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new v(NaN);A=!P&&z.isInteger()&&b.isInteger(),A&&(z=z.mod(b))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||k&&z.c[1]>=24e7:z.c[0]<8e13||k&&z.c[0]<=9999975e7)))return F=z.s<0&&Tc(h)?-0:0,z.e>-1&&(F=1/F),new v(P?1/F:F);y&&(F=Qu(y/ge+2))}for(k?(x=new v(.5),P&&(h.s=1),O=Tc(h)):(I=Math.abs(+T(h)),O=I%2),U=new v(a);;){if(O){if(U=U.times(z),!U.c)break;F?U.c.length>F&&(U.c.length=F):A&&(U=U.mod(b))}if(I){if(I=gr(I/2),I===0)break;O=I%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)O=Tc(h);else{if(I=+T(h),I===0)break;O=I%2}z=z.times(z),F?z.c&&z.c.length>F&&(z.c.length=F):A&&(z=z.mod(b))}return A?U:(P&&(U=a.div(U)),b?U.mod(b):F?L(U,y,i,_):U)},s.integerValue=function(h){var b=new v(this);return h==null?h=i:it(h,0,8),L(b,b.e+1,h)},s.isEqualTo=s.eq=function(h,b){return As(this,new v(h,b))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,b){return As(this,new v(h,b))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,b){return(b=As(this,new v(h,b)))===1||b===0},s.isInteger=function(){return!!this.c&&xr(this.e/ge)>this.c.length-2},s.isLessThan=s.lt=function(h,b){return As(this,new v(h,b))<0},s.isLessThanOrEqualTo=s.lte=function(h,b){return(b=As(this,new v(h,b)))===-1||b===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(h,b){var x,A,I,F,_=this,k=_.s;if(h=new v(h,b),b=h.s,!k||!b)return new v(NaN);if(k!=b)return h.s=-b,_.plus(h);var P=_.e/ge,O=h.e/ge,U=_.c,z=h.c;if(!P||!O){if(!U||!z)return U?(h.s=-b,h):new v(z?_:NaN);if(!U[0]||!z[0])return z[0]?(h.s=-b,h):new v(U[0]?_:i==3?-0:0)}if(P=xr(P),O=xr(O),U=U.slice(),k=P-O){for((F=k<0)?(k=-k,I=U):(O=P,I=z),I.reverse(),b=k;b--;I.push(0));I.reverse()}else for(A=(F=(k=U.length)<(b=z.length))?k:b,k=b=0;b<A;b++)if(U[b]!=z[b]){F=U[b]<z[b];break}if(F&&(I=U,U=z,z=I,h.s=-h.s),b=(A=z.length)-(x=U.length),b>0)for(;b--;U[x++]=0);for(b=Ur-1;A>k;){if(U[--A]<z[A]){for(x=A;x&&!U[--x];U[x]=b);--U[x],U[A]+=Ur}U[A]-=z[A]}for(;U[0]==0;U.splice(0,1),--O);return U[0]?D(h,U,O):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,b){var x,A,I=this;return h=new v(h,b),!I.c||!h.s||h.c&&!h.c[0]?new v(NaN):!h.c||I.c&&!I.c[0]?new v(I):(m==9?(A=h.s,h.s=1,x=t(I,h,0,3),h.s=A,x.s*=A):x=t(I,h,0,m),h=I.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=I.s),h)},s.multipliedBy=s.times=function(h,b){var x,A,I,F,_,k,P,O,U,z,H,G,J,pe,he,ie=this,de=ie.c,Be=(h=new v(h,b)).c;if(!de||!Be||!de[0]||!Be[0])return!ie.s||!h.s||de&&!de[0]&&!Be||Be&&!Be[0]&&!de?h.c=h.e=h.s=null:(h.s*=ie.s,!de||!Be?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=xr(ie.e/ge)+xr(h.e/ge),h.s*=ie.s,P=de.length,z=Be.length,P<z&&(J=de,de=Be,Be=J,I=P,P=z,z=I),I=P+z,J=[];I--;J.push(0));for(pe=Ur,he=Kn,I=z;--I>=0;){for(x=0,H=Be[I]%he,G=Be[I]/he|0,_=P,F=I+_;F>I;)O=de[--_]%he,U=de[_]/he|0,k=G*O+U*H,O=H*O+k%he*he+J[F]+x,x=(O/pe|0)+(k/he|0)+G*U,J[F--]=O%pe;J[F]=x}return x?++A:J.splice(0,1),D(h,J,A)},s.negated=function(){var h=new v(this);return h.s=-h.s||null,h},s.plus=function(h,b){var x,A=this,I=A.s;if(h=new v(h,b),b=h.s,!I||!b)return new v(NaN);if(I!=b)return h.s=-b,A.minus(h);var F=A.e/ge,_=h.e/ge,k=A.c,P=h.c;if(!F||!_){if(!k||!P)return new v(I/0);if(!k[0]||!P[0])return P[0]?h:new v(k[0]?A:I*0)}if(F=xr(F),_=xr(_),k=k.slice(),I=F-_){for(I>0?(_=F,x=P):(I=-I,x=k),x.reverse();I--;x.push(0));x.reverse()}for(I=k.length,b=P.length,I-b<0&&(x=P,P=k,k=x,b=I),I=0;b;)I=(k[--b]=k[b]+P[b]+I)/Ur|0,k[b]=Ur===k[b]?0:k[b]%Ur;return I&&(k=[I].concat(k),++_),D(h,k,_)},s.precision=s.sd=function(h,b){var x,A,I,F=this;if(h!=null&&h!==!!h)return it(h,1,At),b==null?b=i:it(b,0,8),L(new v(F),h,b);if(!(x=F.c))return null;if(I=x.length-1,A=I*ge+1,I=x[I]){for(;I%10==0;I/=10,A--);for(I=x[0];I>=10;I/=10,A++);}return h&&F.e+1>A&&(A=F.e+1),A},s.shiftedBy=function(h){return it(h,-Ju,Ju),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,b,x,A,I,F=this,_=F.c,k=F.s,P=F.e,O=o+4,U=new v("0.5");if(k!==1||!_||!_[0])return new v(!k||k<0&&(!_||_[0])?NaN:_?F:1/0);if(k=Math.sqrt(+T(F)),k==0||k==1/0?(b=wr(_),(b.length+P)%2==0&&(b+="0"),k=Math.sqrt(+b),P=xr((P+1)/2)-(P<0||P%2),k==1/0?b="5e"+P:(b=k.toExponential(),b=b.slice(0,b.indexOf("e")+1)+P),x=new v(b)):x=new v(k+""),x.c[0]){for(P=x.e,k=P+O,k<3&&(k=0);;)if(I=x,x=U.times(I.plus(t(F,I,O,1))),wr(I.c).slice(0,k)===(b=wr(x.c)).slice(0,k))if(x.e<P&&--k,b=b.slice(k-3,k+1),b=="9999"||!A&&b=="4999"){if(!A&&(L(I,I.e+o+2,0),I.times(I).eq(F))){x=I;break}O+=4,k+=4,A=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(F));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,b){return h!=null&&(it(h,0,At),h++),S(this,h,b,1)},s.toFixed=function(h,b){return h!=null&&(it(h,0,At),h=h+this.e+1),S(this,h,b)},s.toFormat=function(h,b,x){var A,I=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=g;else if(typeof x!="object")throw Error(Kt+"Argument not an object: "+x);if(A=I.toFixed(h,b),I.c){var F,_=A.split("."),k=+x.groupSize,P=+x.secondaryGroupSize,O=x.groupSeparator||"",U=_[0],z=_[1],H=I.s<0,G=H?U.slice(1):U,J=G.length;if(P&&(F=k,k=P,P=F,J-=F),k>0&&J>0){for(F=J%k||k,U=G.substr(0,F);F<J;F+=k)U+=O+G.substr(F,k);P>0&&(U+=O+G.slice(F)),H&&(U="-"+U)}A=z?U+(x.decimalSeparator||"")+((P=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+P+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):U}return(x.prefix||"")+A+(x.suffix||"")},s.toFraction=function(h){var b,x,A,I,F,_,k,P,O,U,z,H,G=this,J=G.c;if(h!=null&&(k=new v(h),!k.isInteger()&&(k.c||k.s!==1)||k.lt(a)))throw Error(Kt+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+T(k));if(!J)return new v(G);for(b=new v(a),O=x=new v(a),A=P=new v(a),H=wr(J),F=b.e=H.length-G.e-1,b.c[0]=ed[(_=F%ge)<0?ge+_:_],h=!h||k.comparedTo(b)>0?F>0?b:O:k,_=d,d=1/0,k=new v(H),P.c[0]=0;U=t(k,b,0,1),I=x.plus(U.times(A)),I.comparedTo(h)!=1;)x=A,A=I,O=P.plus(U.times(I=O)),P=I,b=k.minus(U.times(I=b)),k=I;return I=t(h.minus(x),A,0,1),P=P.plus(I.times(O)),x=x.plus(I.times(A)),P.s=O.s=G.s,F=F*2,z=t(O,A,F,i).minus(G).abs().comparedTo(t(P,x,F,i).minus(G).abs())<1?[O,A]:[P,x],d=_,z},s.toNumber=function(){return+T(this)},s.toPrecision=function(h,b){return h!=null&&it(h,1,At),S(this,h,b,2)},s.toString=function(h){var b,x=this,A=x.s,I=x.e;return I===null?A?(b="Infinity",A<0&&(b="-"+b)):b="NaN":(h==null?b=I<=c||I>=l?Sc(wr(x.c),I):yn(wr(x.c),I,"0"):h===10&&w?(x=L(new v(x),o+I+1,i),b=yn(wr(x.c),x.e,"0")):(it(h,2,E.length,"Base"),b=r(yn(wr(x.c),I,"0"),10,h,A,!0)),A<0&&x.c[0]&&(b="-"+b)),b},s.valueOf=s.toJSON=function(){return T(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&v.set(e),v}function xr(e){var t=e|0;return e>0||e===t?t:t-1}function wr(e){for(var t,r,n=1,s=e.length,a=e[0]+"";n<s;){for(t=e[n++]+"",r=ge-t.length;r--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function As(e,t){var r,n,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(r=s&&!s[0],n=a&&!a[0],r||n)return r?n?0:-i:o;if(o!=i)return o;if(r=o<0,n=c==l,!s||!a)return n?0:!s^r?1:-1;if(!n)return c>l^r?1:-1;for(i=(c=s.length)<(l=a.length)?c:l,o=0;o<i;o++)if(s[o]!=a[o])return s[o]>a[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function it(e,t,r,n){if(e<t||e>r||e!==gr(e))throw Error(Kt+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Tc(e){var t=e.c.length-1;return xr(e.e/ge)==t&&e.c[t]%2!=0}function Sc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function yn(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(n=e.length,++t>n){for(s=r,t-=n;--t;s+=r);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=Lm();const Xr=(e,t)=>{if(!e||!t)return"";const r=j(10).pow(e||0);return j(t).times(r).idiv(r).div(r).toFixed()},Ac=(e,t)=>!e||!t?"":z5(t).times(j(10).pow(e)).decimalPlaces(0).toFixed(0),L5=j(0);j(1),j(10),j(1e18);function zm(e,t){return e instanceof j?e:e?j(e,t):L5}function Ps(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}function z5(e,t,r){if(typeof e!="string")return zm(e);const n=".",s=e.replace(new RegExp(`[^${n}\\d-]+`,"g"),"");return zm(s)}const Is=e=>!!Wm.find(t=>Ps(t,e||""));function R5(e){return[Gt.Years,Gt.Months,Gt.Weeks,Gt.Days,Gt.Hours,Gt.Minutes].find(r=>r<=e)||Gt.Minutes}const Zn=e=>e?e.value*e.unit:0,H5=e=>!e||e==="NaN"?"0":j(e).decimalPlaces(0).toFixed(),Bs=e=>Object.values(Ft).find(t=>t.id===e),$5=e=>{if(!e)return;const t=e.map(a=>_t(a)),r=Object.entries(qm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),n=e.map(a=>a.exchangeAddress),s=new Set([...n,...r].map(a=>a.toLowerCase()));return Array.from(s)},td=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+cd(t):(e.fillDelay||0)*1e3,Fo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),Rm=e=>xh().filter(t=>t.name===e).map(t=>t.chainId),Hm="https://order-sink-dev.orbs.network",rd="https://order-sink.orbs.network";let nd;const G5=e=>{nd=e},sd=()=>{const e=Fo("env");return e==="prod"?rd:e==="dev"?Hm:nd==="prod"?rd:nd==="dev"?Hm:rd},j5=100,V5=1,Pc=300*1e3,Ca=365*24*60*60*1e3,ad=300*1e3,$m=new Date(Pc).getMinutes(),Gm=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,vr="https://hub.orbs.network/api/apikey/subgraphs/id",jm={[Ft.eth.id]:`${vr}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ft.bsc.id]:`${vr}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ft.poly.id]:`${vr}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ft.arb.id]:`${vr}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ft.base.id]:`${vr}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ft.sei.id]:`${vr}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ft.linea.id]:`${vr}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ft.sonic.id]:`${vr}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ft.ftm.id]:`${vr}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ft.katana.id]:`${vr}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ft.avax.id]:`${vr}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ft.bera.id]:`${vr}/H7aY53mY1hgaSURwXj3ZVirwNSifExwjgEL5GNtTqmEj`,[Ft.flare.id]:Gm("flare"),[Ft.cronosZkEvm.id]:Gm("cronos-zkevm")},Vm="0x0000000000000000000000000000000000000000",Wm=[Vm,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],W5="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,qm={[_t(Dt.SushiArb)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.SushiBase)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.SushiEth)]:["0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Dt.PancakeSwap)]:["0xb2BAFe188faD927240038cC4FfF2d771d8A58905","0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"],[_t(Dt.PancakeSwapArbitrum)]:["0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F","0x807488ADAD033e95C438F998277bE654152594dc"],[_t(Dt.PancakeSwapBase)]:["0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c","0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Dt.PancakeSwapLinea)]:["0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Dt.QuickSwap)]:["0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"],[_t(Dt.Thena)]:["0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"],[_t(Dt.Lynex)]:["0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"],[_t(Dt.DragonSwap)]:["0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"],[_t(Dt.SpookySwapSonic)]:["0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"],[_t(Dt.SpookySwap)]:["0x3924d62219483015f982b160d48c0fa5Fd436Cba"],[_t(Dt.SwapX)]:["0xE5012eBDe5e26EE3Ea41992154731a03023CF274"]},Ic={unit:Gt.Minutes,value:$m},q5=.25,Y5="100",Ym="RePermitWitnessTransferFrom",Km={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"stop",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},od="https://www.orbs.com/dtwap-and-dlimit-faq/",K5="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",Z5="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",X5="https://www.orbs.com/assets/img/common/logo.svg",Q5="https://www.orbs.com/",J5="https://www.orbs.com/dtwap-dlimit-disclaimer";var Bc=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e))(Bc||{});const Zm="-5",Xm="10",Qm="-10",Jm="5",ew="Something went wrong";function tw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function rw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const nw={14:{dex:{spark:{type:"default:spark",adapter:"0xB18c633B6584A33E45a8840a759f56dF17117b1D",fee:"0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b"}}},56:{dex:{thena:{type:"default:odos-v2",adapter:"0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67",fee:"0x15eBc8b5b3877512FFF23650188694A9a8891FAc"},pancake:{type:"p2:pancakeswap-v2",adapter:"0x654272F7e6e6E912D38650f783eFd44452fD6ee5",fee:"0x37A957f10F458e0d7fDECBE2917971b57F15c927"},newera:{type:"default:odos-v2",adapter:"0x845f459271D800f6Ab32D78400b8Aa18414E80b0",fee:"0x4E7454909eB6D539111D56b50d68897E933D2d11"}}},137:{dex:{quick:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},teafi:{type:"paraswap:paraswap-v5",adapter:"0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29",fee:"0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50"}}},143:{dex:{yowie:{type:"default:openocean-v2",adapter:"0x18bc9533c3539073B9A9acF12b0AbF7cB73e0F1f",fee:"0x6AF3eE77A3A3257777F5649aFa611b4C7Fd975Ef"}}},146:{dex:{spooky:{type:"default:magpie-v3",adapter:"0xdCee7FDdB932104329d528144Cd17A408722B7e2",fee:"0x840Df4684B35BC68BcdA3F6707A3c82A0D662f8b"},swapx:{type:"default:openocean-v2",adapter:"0xecc733D6F6f2DEa341832D650E30822118884FEb",fee:"0x6E03f7BC0f141894612AA017796096399623895F"},shadow:{type:"default:magpie-v3",adapter:"0x5f3E5F6ACCfc65243A01Da3E93b5A700285592C3",fee:"0xb9e3751fAF3187E1bC468E56a707a8A91754460e"}}},1329:{dex:{dragon:{type:"default:dragon",adapter:"0x02d9d5882129241b67ec21Ebc2C86e1BE9BC9890",fee:"0x0dc1E0525202b32e89bA78ed55b1e5cEdB751334"},nami:{type:"default:openocean-v2",adapter:"0x2D4A1237A98f8cb03C3C85960e859aA44036a306",fee:"0xeB58450e23632003f013568703F54446070E2E80"}}},8453:{dex:{quick:{type:"default:kyber-v2",adapter:"0xc73F03c929A123Ee2f3A98EC18BB240f03980AE5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"}}},42161:{dex:{arbidex:{type:"default:odos-v2",adapter:"0xa734b32151108139e48dCA06eE721538d90A9Ef6",fee:"0xa0c11852f8A44e32F9EC10AD25986A53842f72Ca"},ramses:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xB5BaCB60ECDa0bEF809B2A26eC9B4B926835D7af"},omni:{type:"paraswap:paraswap-v5",adapter:"0xa1baE146161223cd9dCa7137F68eb385934130BE",fee:"0xba5291526c30B097E9F1Fd1Be301E2ab6E0782aa"},chronos:{type:"default:odos-v2",adapter:"0x4Ff90F32aceD08b3e3257B018EA495Fd1Bfe4455",fee:"0x5729af83240EFecAa18eafaAE82961c2DD045Dbe"}}},43114:{dex:{blackhole:{type:"default:kyber-v2",adapter:"0x426ec4bc0d58B80959CDE77576a1942dd40592Fa",fee:"0x7f8B62520D9B5DA0ED517cc36e8dcb2a356f1928"}}},59144:{dex:{lynex:{type:"default:openocean",adapter:"0x4FF6A97A67fe395212f168f011D71fE79E4396f2",fee:"0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423"}}},80094:{dex:{kodiak:{type:"default:kodiak",adapter:"0xBbaa527Aac00b1Ee9A3909D4D8c4447630E29B1F",fee:"0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4"}}},"*":{wm:"0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000",repermit:"0x00002a9C4D9497df5Bd31768eC5d30eEf5405000",cosigner:"0x0007ec53404c423C935e830ec21903e184690000",reactor:"0x0006a959430e8fBB858D81B2D1140B0ae5c26001",executor:"0x000eBA869d76C618ddc4A6D685A0820A620Ce002",refinery:"0x000E474c0D7084EAA35A501035E73269f4b009A5",salt:{wm:"0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152",repermit:"0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7",cosigner:"0x37576f2ac1d2a602f00777611edf6f0cbc27611b0980b29bc7856fa79b2b8073",reactor:"0x034169222370f2fd587ef8998082d762cceef58a272330215f5110ec0d76d400",executor:"0xea139bc421fa5e272bed3db74233b2e02077e0aacf8b855f87961e98f2fb467f",refinery:"0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec"}}};var id,eh;function sw(){if(eh)return id;eh=1;const e=nw,t=s=>rw(`./out/${s}.sol/${s}.json`).abi,r=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function n(s,a){if(!s||!(a!=null&&a.trim()))return;const{dex:o,...i}=e["*"]??{},c=e[s];if(!c)return;const{dex:l,...u}=c,d=l==null?void 0:l[a];if(d)return{...i,...u,...d}}return id={config:n,abis:r,raw:e},id}var th=sw();const rh=(e,t,r)=>{if(!e||!t||!r)return;const n=j(e).times(t),s=j(10).pow(r);return n.div(s).toFixed(0)},nh=(e,t,r,n)=>{if(r||!n||!e||!t)return j(0).toString();const s=j(e).times(j(t)),a=j(10).pow(n),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)},sh=(e,t,r,n)=>{if(e===Ee.TWAP||e===Ee.LIMIT)return"0";if(!n||!t||!r)return;const s=j(t).times(j(r)),a=j(10).pow(n),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)||"0"},ah=(e,t,r,n)=>{const s=Zn(r)*2*t,a=R5(s);return n||(e===Ee.LIMIT?{unit:Gt.Days,value:7}:e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?{unit:Gt.Days,value:1}:{unit:a,value:Number(j(s/a).toFixed(2))})},oh=(e,t,r)=>t!==Ee.TWAP?1:r!==void 0?r:e,ih=(e,t,r,n)=>{if(!t||!r||!n)return 1;const a=j(r).times(t).div(n).integerValue(j.ROUND_FLOOR).toNumber(),o=Math.floor(Ca/2/Zn(e));return Math.max(1,Math.min(a,o))},aw=e=>cd(e)/1e3/60,ch=(e,t)=>e+Zn(t)+6e4,cd=e=>e.bidDelaySeconds*1e3*2,lh=(e,t)=>!e||!t?"0":j(e).div(t).integerValue(j.ROUND_FLOOR).toFixed(0),ow=(e,t)=>({isError:!(e.unit===Ic.unit&&e.value===Ic.value)&&Zn(e)*t>Ca,value:Math.floor(Ca/t)}),uh=(e="",t="",r)=>{if(r===Ee.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},dh=(e="",t="",r)=>{if(r===Ee.TAKE_PROFIT)return{isError:j(t||0).lte(j(e||0)),value:e}},ph=(e="",t="",r=!1,n)=>{if(!r&&n===Ee.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},fh=(e="",t="",r=!1,n)=>{if(!r&&n===Ee.TAKE_PROFIT)return{isError:j(t||0).gte(j(e||0)),value:e}},mh=(e,t)=>e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?{isError:Zn(t)>5184e6,value:5184e6}:{isError:Zn(t)>Ca,value:Ca},hh=e=>({isError:Zn(e)<ad,value:ad}),bh=e=>({isError:Zn(e)<Pc,value:Pc}),yh=(e,t,r)=>({isError:j(t||0).multipliedBy(e||0).isLessThan(r),value:r}),gh=(e,t,r)=>({isError:r===Ee.TWAP&&j(e).isGreaterThan(t),value:t}),ld=(e,t)=>{var r;try{if(!e||!t)throw new Error("Invalid chainId or _dex");const n=(r=Object.entries(Dt).find(([i,c])=>c.chainId===e&&i.toLowerCase().indexOf(t.toLowerCase())>=0))==null?void 0:r[1],{abi:s,...a}=th.config(e,t);return{...a,partner:t,twapConfig:n}}catch{return}},xh=()=>{const e=th.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,r])=>{const n=r==null?void 0:r.dex;return!n||typeof n!="object"?[]:Object.entries(n).map(([s])=>({chainId:Number(t),name:s,config:ld(Number(t),s)}))}).sort((t,r)=>t.name.localeCompare(r.name))},wh=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l,triggerAmountPerTrade:u,config:d})=>{const f=Date.now().toString(),m=parseInt((a/1e3).toFixed(0)),y=H5(s/1e3),g=Fo(Bc.FRESHNESS),E=g?parseInt(g):60,w={permitted:{token:t,amount:n},spender:d.reactor,nonce:f,deadline:y,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:0,data:"0x"},swapper:i,nonce:f,deadline:y,chainid:e,exclusivity:0,epoch:m,slippage:o,freshness:E,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:l||"0",stop:!u||j(u||0).isZero()?"0":u,recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:w,types:Km,primaryType:Ym}},iw={version:"0.0.17"},cw=`https://bi.orbs.network/putes/twap-ui-${.7}`,vh=iw.version;let ud="unknown";function Eh(e){ud=e}function dd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),r=Date.now().toString(36);return`id_${e+t+r}`}const lw=(e,t,r)=>{var n,s,a,o,i,c,l,u,d;return{spotVersion:vh,partner:e.partner,adapter:e.adapter,cosigner:e.cosigner,executor:e.executor,fee:e.fee,reactor:e.reactor,refinery:e.refinery,repermit:e.repermit,router:e.router,type:e.type,wm:e.wm,chainName:((n=e.twapConfig)==null?void 0:n.chainName)||"",chainId:r||0,twapVersion:((s=e.twapConfig)==null?void 0:s.twapVersion)||0,twapAddress:((a=e.twapConfig)==null?void 0:a.twapAddress)||"",lensAddress:((o=e.twapConfig)==null?void 0:o.lensAddress)||"",bidDelaySeconds:((i=e.twapConfig)==null?void 0:i.bidDelaySeconds)||0,minChunkSizeUsd:t,name:((c=e.twapConfig)==null?void 0:c.name)||"",exchangeAddress:((l=e.twapConfig)==null?void 0:l.exchangeAddress)||"",exchangeType:((u=e.twapConfig)==null?void 0:u.exchangeType)||"",pathfinderKey:((d=e.twapConfig)==null?void 0:d.pathfinderKey)||""}},kh=async e=>{try{await fetch(cw,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then()}catch(t){console.error("Failed to send BI",t)}};class uw{constructor(){Yu(this,"timeout");Yu(this,"config");Yu(this,"data",{_id:dd()})}async updateAndSend(t={},r=!1,n){try{this.data={...this.data,...t},r?(await kh(this.data),n==null||n()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{kh(this.data),n==null||n()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,r){this.updateAndSend({cancelOrderIdsV1:r===1?t:void 0,cancelOrderIdsV2:r===2?t:void 0,action:"cancel order",cancelOrderSuccess:!1,cancelOrderTxHash:void 0,actionError:void 0})}onCancelOrderSuccess(t){this.updateAndSend({cancelOrderTxHash:t,cancelOrderSuccess:!0})}onCancelOrderError(t){this.onTxError(t)}onWrapSuccess(t){this.updateAndSend({wrapTxHash:t})}onWrapRequest(){this.updateAndSend({action:"wrap"})}onWrapError(t){this.onTxError(t)}onApproveRequest(){this.updateAndSend({action:"approve"})}onApproveSuccess(t){this.updateAndSend({approvalTxHash:t})}onApproveError(t){this.onTxError(t)}onCrash(t){var r;this.updateAndSend({action:"crash",actionError:((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var n;const r=((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:r})}onRequestOrder({account:t,chainId:r,module:n,srcToken:s,dstToken:a,fromTokenAmount:o,srcChunkAmount:i,minDstAmountOutPerTrade:c="",triggerPricePerTrade:l="",deadline:u,fillDelay:d,slippage:f,isMarketOrder:m}){const y=j(o).div(i).integerValue(j.ROUND_FLOOR).toNumber();this.updateAndSend({toTokenAddress:a.address,toTokenSymbol:a.symbol,fromTokenAddress:s.address,fromTokenSymbol:s.symbol,fromTokenAmount:o,chunksAmount:y,srcChunkAmount:i,minDstAmountOutPerTrade:c,triggerPricePerTrade:l,deadline:u,fillDelay:d,slippage:f,chainId:r,walletAddress:t,module:n,orderType:m?"market":"limit",actionError:void 0})}onSignOrderRequest(t){this.updateAndSend({action:"sign order",order:t})}onSignOrderError(t){this.onTxError(t)}onSignOrderSuccess(t){this.updateAndSend({action:"sign order",signature:t})}init(t,r,n){var s;this.config=t,n!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:dd(),action:"module-import",uiVersion:ud,...lw(t,r,n),origin:window.location.origin},this.updateAndSend(this.data))}onCreateOrderError(t){this.onTxError(t)}onCreateOrderRequest(){this.updateAndSend({action:"create order"})}async onCreateOrderSuccess(t){this.updateAndSend({orderHash:t,orderSuccess:!0},void 0,()=>{this.data={_id:dd(),action:"reset",uiVersion:ud,origin:this.data.origin,spotVersion:vh,partner:this.data.partner,adapter:this.data.adapter,cosigner:this.data.cosigner,executor:this.data.executor,fee:this.data.fee,reactor:this.data.reactor,refinery:this.data.refinery,repermit:this.data.repermit,router:this.data.router,type:this.data.type,wm:this.data.wm,chainName:this.data.chainName||"",chainId:this.data.chainId||0,twapVersion:this.data.twapVersion||0,twapAddress:this.data.twapAddress||"",lensAddress:this.data.lensAddress||"",bidDelaySeconds:this.data.bidDelaySeconds||0,minChunkSizeUsd:this.data.minChunkSizeUsd||0,name:this.data.name||"",exchangeAddress:this.data.exchangeAddress||"",exchangeType:this.data.exchangeType||"",pathfinderKey:this.data.pathfinderKey||""}})}onLoad(){this.updateAndSend({action:"module-import",origin:window.location.origin})}}const ct=new uw,dw=e=>{var s;const t=j(e.order.witness.output.limit||0).gt(1),r=j(e.order.witness.output.stop||0).gt(0),n=((s=e.metadata.chunks)==null?void 0:s.length)||j(e.order.witness.input.maxAmount).div(j(e.order.witness.input.amount)).toNumber();return r&&t?dt.TRIGGER_PRICE_LIMIT:r?dt.TRIGGER_PRICE_MARKET:!t&&n<=1?dt.TWAP_MARKET:n>=1&&t?dt.TWAP_LIMIT:t?dt.LIMIT:dt.TWAP_MARKET},pw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,r=e.metadata.expectedChunks||0,n=j(t).dividedBy(r).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},fw=(e,t)=>e.metadata.status==="completed"||t>=99?ut.Completed:["pending","eligible"].includes(e.metadata.status)?ut.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?ut.Canceled:ut.Expired,mw=e=>{var r;return(((r=e.metadata.chunks)==null?void 0:r.filter(n=>n.status==="success"))||[]).map(n=>({inAmount:n.inAmount,outAmount:n.outAmount,timestamp:new Date(n.timestamp).getTime(),txHash:n.txHash}))},hw=(e,t)=>{var n;const r=e.length;return r>=t&&((n=e[r-1])==null?void 0:n.timestamp)||0},Ch=e=>{const t=pw(e),r=Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,n=e.metadata.expectedChunks||1,s=mw(e);return{id:e.hash,hash:e.hash,version:2,type:dw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:s.reduce((a,o)=>a.plus(o.inAmount),new j(0)).toFixed()||"",dstAmountFilled:s.reduce((a,o)=>a.plus(o.outAmount),new j(0)).toFixed()||"",fills:s,srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:e.metadata.displayOnlyInputTokenPriceUSD?j(e.metadata.displayOnlyInputTokenPriceUSD).toFixed(6):"",fillDelay:e.order.witness.epoch,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,dstMinAmountPerTrade:r,triggerPricePerTrade:j(e.order.witness.output.stop||0).isZero()?"":e.order.witness.output.stop,dstMinAmountTotal:j(r).multipliedBy(n).toString(),srcAmountPerTrade:e.order.witness.input.amount,totalTradesAmount:n,isMarketPrice:j(r||0).lte(1),chainId:e.order.witness.chainid,filledOrderTimestamp:hw(s,n),status:fw(e,t),rawOrder:e}},bw=async({chainId:e,signal:t,account:r})=>r?(await(await fetch(`${sd()}/orders?swapper=${r}&chainId=${e}`,{signal:t})).json()).orders.map(Ch):[],Th=async(e,t)=>{try{const r={signature:t,order:e,status:"pending"};console.log("body",r),ct.onCreateOrderRequest();const s=await(await fetch(`${sd()}/orders/new`,{method:"POST",body:JSON.stringify(r)})).json();if(!s.success)throw new Error(`error:${s.message}, code:${s.code}`);const a=Ch(s.signedOrder);return ct.onCreateOrderSuccess(a.id),a}catch(r){throw ct.onCreateOrderError(r),console.error(r),r}},gn=(e,t)=>e&&e.length?e.map(t||(r=>`${r}`)):void 0,yw=e=>{if(e)return jm[e]},pd=async({chainId:e,buildQuery:t,extractResults:r,signal:n,retries:s=1,limit:a=1e3,page:o})=>{const i=yw(e);if(!i)throw new kw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:n,headers:{"Content-Type":"application/json"}});if(!m.ok)throw new Error(`HTTP error: ${m.status}`);const y=await m.json();if(y.errors)throw new Error(y.errors[0].message);return r(y)}catch(m){if(f===s)throw m;await new Promise(y=>setTimeout(y,500*2**f)),f++}return[]};let l=0;const u=[];if(o!==void 0){const d=t(o,a);try{return await c(d)}catch{console.warn(`Page ${o} failed, retrying one final time...`);try{return await c(d)}catch{return[]}}}for(;;){const d=t(l,a);let f;try{f=await c(d)}catch{console.warn(`Page ${l} failed, retrying one final time...`);try{f=await c(d)}catch{return u}}if(u.push(...f),f.length<a)break;l++}return u},Sh=e=>e.map(t=>({inAmount:t.srcAmountIn,outAmount:t.dstAmountOut,timestamp:t.timestamp,txHash:t.transactionHash})),Ah=(e,t)=>{const r=j(e||0).gt(1);return!r&&t===1?dt.TWAP_MARKET:t>1&&r?dt.TWAP_LIMIT:r?dt.LIMIT:dt.TWAP_MARKET},gw=(e,t,r,n)=>{var f;const s=Sh(r||[]),a=new j(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(j.ROUND_FLOOR).toNumber(),i=(r==null?void 0:r.length)===a?(f=r==null?void 0:r[(r==null?void 0:r.length)-1])==null?void 0:f.timestamp:void 0,c=s.reduce((m,y)=>m.plus(y.inAmount),new j(0)).toFixed(),l=s.reduce((m,y)=>m.plus(y.outAmount),new j(0)).toFixed(),u=Ph(e.ask_srcAmount,c),d=Ah(e.ask_dstMinAmount,a);return{version:1,id:e.Contract_id.toString(),hash:"",type:Ah(e.ask_dstMinAmount,a),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:u,dstAmountFilled:l,srcAmountFilled:c,orderDollarValueIn:j(e.dollarValueIn||0).toFixed(6),srcAmount:e.ask_srcAmount,dstMinAmountTotal:j(e.ask_dstMinAmount).multipliedBy(a).toString(),fills:s,fillDelay:e.ask_fillDelay,deadline:e.ask_deadline*1e3,createdAt:new Date(e.timestamp).getTime(),dstMinAmountPerTrade:j(e.ask_dstMinAmount).eq(1)?"":e.ask_dstMinAmount,triggerPricePerTrade:"",srcAmountPerTrade:e.ask_srcBidAmount,txHash:e.transactionHash,totalTradesAmount:a,isMarketPrice:[dt.TWAP_MARKET,dt.TRIGGER_PRICE_MARKET].includes(d),chainId:t,filledOrderTimestamp:i||0,status:n,rawOrder:e}},xw=e=>{var d;if(!e)return"";const t=gn(e.accounts,f=>`"${f.toLowerCase()}"`),r=gn($5(e.configs),f=>`"${f.toLowerCase()}"`),n=gn(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=gn(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=gn(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=gn(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=gn(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=gn(e.orderIds,f=>`"${f}"`),l=r!=null&&r.length?"":gn((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[r?`exchange_in: [${r.join(", ")}]`:"",l?`twapAddress_in: [${l.join(", ")}]`:"",t?`maker_in: [${t.join(", ")}]`:"",i?`transactionHash_in: [${i.join(", ")}]`:"",c?`Contract_id_in: [${c.join(", ")}]`:"",u?`dollarValueIn_gte: ${u}`:"",n?`srcTokenSymbol_in: [${n.join(", ")}]`:"",s?`dstTokenSymbol_in: [${s.join(", ")}]`:"",a?`srcTokenAddress_in: [${a.join(", ")}]`:"",o?`dstTokenAddress_in: [${o.join(", ")}]`:"",e!=null&&e.startDate?`blockTimestamp_gte: ${e.startDate}`:"",e!=null&&e.endDate?`blockTimestamp_lte: ${e.endDate}`:"",(e==null?void 0:e.orderType)==="limit"?"ask_dstMinAmount_gt: 1":"",(e==null?void 0:e.orderType)==="market"?"ask_dstMinAmount_lte: 1":""].filter(Boolean).join(", ")};async function ww({chainId:e,signal:t,page:r,limit:n,filters:s}){const a=n||1e3,o=xw(s);return await pd({chainId:e,signal:t,limit:a,page:r,buildQuery:(c,l)=>`
2
2
  {
3
3
  orderCreateds(
4
4
  ${o?`where: { ${o} }`:""},
@@ -61,7 +61,7 @@
61
61
  dollarValueOut
62
62
  }
63
63
  }
64
- `,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class kw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Cw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{const a=await ww({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Ew({chainId:e,orders:a,signal:t}),vw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return gw(l,e,u,Tw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Tw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Sh(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Ph(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Ph=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?ut.Completed:r==="CANCELED"?ut.Canceled:r==="COMPLETED"?ut.Completed:t>Date.now()?ut.Open:ut.Expired,Ih=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Cw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),bw({chainId:r,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Bh=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},Aw=(e=>e?Bh(e):Bh),Pw=e=>e;function Iw(e,t=Pw){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const Fh=e=>{const t=Aw(e),r=n=>Iw(t,n);return Object.assign(r,t),r},Bw=(e=>e?Fh(e):Fh),Uh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Bw((e,t)=>({state:Uh,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...Uh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Fw={version:"0.0.28"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Uw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ow=(f5=class{constructor(){le(this,fn,Uw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fn),provider:e}),ee(this,fn,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fn).setTimeout(e,t)}clearTimeout(e){N(this,fn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,pa=new WeakMap,f5),Fs=new Ow;function Dw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function _w(e,t){return typeof e=="function"?e(t):e}function md(e){return typeof e=="number"&&e>=0&&e!==1/0}function Oh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function Dh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==hd(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function _h(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function hd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>yd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Mw=Object.prototype.hasOwnProperty;function bd(e,t){if(e===t)return e;const r=Mh(e)&&Mh(t);if(!r&&!(yd(e)&&yd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Mw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=bd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Mh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yd(e){if(!Nh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Nh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nw(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function gd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return bd(e,t)}return t}function Lw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function zw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Uc=Symbol();function Lh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Uc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Uc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function zh(e,t){return typeof e=="function"?e(...t):!!e}var Rw=(m5=class extends Ta{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var r;ee(this,go,t),(r=N(this,gs))==null||r.call(this),ee(this,gs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,m5),xd=new Rw;function wd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Hw=Dw;function $w(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Hw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Et=$w(),Gw=(h5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var r;ee(this,wo,t),(r=N(this,xs))==null||r.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),Oc=new Gw;function jw(e){return Math.min(1e3*2**e,3e4)}function Rh(e){return(e??"online")==="online"?Oc.isOnline():!0}var vd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hh(e){let t=!1,r=0,n;const s=wd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const w=new vd(g);f(w),(E=e.onCancel)==null||E.call(e,w)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>xd.isFocused()&&(e.networkMode==="always"||Oc.isOnline())&&e.canRun(),u=()=>Rh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=w=>{(a()||l())&&g(w)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var L;if(a())return;const v=e.retry??(Us?0:3),S=e.retryDelay??jw,C=typeof S=="function"?S(r,w):S,D=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,w);if(t||!D){f(w);return}r++,(L=e.onFail)==null||L.call(e,r,w),Nw(C).then(()=>l()?void 0:m()).then(()=>{t?f(w):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var $h=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&ee(this,ma,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Fs.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Vw=(y5=class extends $h{constructor(t){super();le(this,Kr);le(this,ha);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,xc);le(this,ya);ee(this,ya,!1),ee(this,xc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Vh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,xc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Vh(this.options);r.data!==void 0&&(this.setState(jh(r.data,r.dataUpdatedAt)),ee(this,ha,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=gd(this.state.data,t,this.options);return Ae(this,Kr,Yn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ae(this,Kr,Yn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>Er(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Oh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,Kr,Yn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,y,g,E,w,v,S;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),n.signal)})},a=()=>{const C=Lh(this.options,r),L=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return ee(this,ya,!1),this.options.persister?this.options.persister(C,L,this):C(L)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Ae(this,Kr,Yn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Hh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof vd&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Ae(this,Kr,Yn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Ae(this,Kr,Yn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,Kr,Yn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(m=(f=N(this,Br).config).onSuccess)==null||m.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof vd){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ae(this,Kr,Yn).call(this,{type:"error",error:C}),(w=(E=N(this,Br).config).onError)==null||w.call(E,C,this),(S=(v=N(this,Br).config).onSettled)==null||S.call(v,this.state.data,C,this),C}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,xc=new WeakMap,ya=new WeakMap,Kr=new WeakSet,Yn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Gh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...jh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Et.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},y5);function Gh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Rh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function jh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ww=(g5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,De);le(this,wc);le(this,qt);le(this,ga);le(this,Eo);le(this,Gn);le(this,ws);le(this,vc);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,vs);le(this,To,new Set);this.options=r,ee(this,sr,t),ee(this,ws,null),ee(this,Gn,wd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,De).addObserver(this),Wh(N(this,De),this.options)?Ae(this,Ve,Cc).call(this):this.updateResult(),Ae(this,Ve,Sm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ed(N(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ed(N(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ve,Am).call(this),Ae(this,Ve,Pm).call(this),N(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,De);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Er(this.options.enabled,N(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ve,Im).call(this),N(this,De).setOptions(this.options),r._defaulted&&!Fc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,De),observer:this});const s=this.hasListeners();s&&qh(N(this,De),n,this.options,r)&&Ae(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||Xn(this.options.staleTime,N(this,De))!==Xn(r.staleTime,N(this,De)))&&Ae(this,Ve,km).call(this);const a=Ae(this,Ve,Cm).call(this);s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||a!==N(this,vs))&&Ae(this,Ve,Tm).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Yw(this,n)&&(ee(this,qt,n),ee(this,Eo,this.options),ee(this,ga,N(this,De).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ae(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,De),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,wc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),A=!x&&Wh(t,r),I=x&&qh(t,n,r,s);(A||I)&&(d={...d,...Gh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;m=d.data;let w=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,w=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",m=gd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!w)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,vc))m=N(this,ko);else try{ee(this,vc,r.select),m=r.select(m),m=gd(a==null?void 0:a.data,m,r),ee(this,ko,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,ko),g=Date.now(),E="error");const v=d.fetchStatus==="fetching",S=E==="pending",C=E==="error",D=S&&v,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:S,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!S,isLoadingError:C&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&L,isStale:kd(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:Er(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},A=()=>{const F=ee(this,Gn,h.promise=wd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(h.status==="error"||h.data!==I.value)&&A();break;case"rejected":(h.status!=="error"||h.error!==I.reason)&&A();break}}return h}updateResult(){const t=N(this,qt),r=this.createResult(N(this,De),this.options);if(ee(this,ga,N(this,De).state),ee(this,Eo,this.options),N(this,ga).data!==void 0&&ee(this,Co,N(this,De)),Fc(r,t))return;ee(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Ae(this,Ve,F5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ve,Sm).call(this)}},sr=new WeakMap,De=new WeakMap,wc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,Gn=new WeakMap,ws=new WeakMap,vc=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,To=new WeakMap,Ve=new WeakSet,Cc=function(t){Ae(this,Ve,Im).call(this);let r=N(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},km=function(){Ae(this,Ve,Am).call(this);const t=Xn(this.options.staleTime,N(this,De));if(Us||N(this,qt).isStale||!md(t))return;const n=Oh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Cm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,De)):this.options.refetchInterval)??!1},Tm=function(t){Ae(this,Ve,Pm).call(this),ee(this,vs,t),!(Us||Er(this.options.enabled,N(this,De))===!1||!md(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||xd.isFocused())&&Ae(this,Ve,Cc).call(this)},N(this,vs)))},Sm=function(){Ae(this,Ve,km).call(this),Ae(this,Ve,Tm).call(this,Ae(this,Ve,Cm).call(this))},Am=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Pm=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),ee(this,wa,void 0))},Im=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,De))return;const r=N(this,De);ee(this,De,t),ee(this,wc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},F5=function(t){Et.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,De),type:"observerResultsUpdated"})})},g5);function qw(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wh(e,t){return qw(e,t)||e.state.data!==void 0&&Ed(e,t,t.refetchOnMount)}function Ed(e,t,r){if(Er(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&kd(e,t)}return!1}function qh(e,t,r,n){return(e!==t||Er(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&kd(e,r)}function kd(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function Yw(e,t){return!Fc(e.getCurrentResult(),t)}function Yh(e){return{onFetch:(t,r)=>{var u,d,f,m,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Lh(t.options,t.fetchOptions),v=async(S,C,D)=>{if(g)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const T=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(A),A})(),h=await w(T),{maxPages:b}=t.options,x=D?zw:Lw;return{pages:x(S.pages,h,b),pageParams:x(S.pageParams,C,b)}};if(s&&a.length){const S=s==="backward",C=S?Kw:Kh,D={pages:a,pageParams:o},L=C(n,D);i=await v(D,L,S)}else{const S=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Kh(n,i);if(c>0&&C==null)break;i=await v(i,C),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Kh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Kw(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Zw=(x5=class extends $h{constructor(t){super();le(this,hn);le(this,Ec);le(this,mn);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mn,[]),this.state=t.state||Zh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,mn).includes(t)||(N(this,mn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mn,N(this,mn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,E,w,v,S,C,D,L,T,h,b;const r=()=>{Ae(this,hn,Ss).call(this,{type:"continue"})},n={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Hh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,A)=>{Ae(this,hn,Ss).call(this,{type:"failed",failureCount:x,error:A})},onPause:()=>{Ae(this,hn,Ss).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Ae(this,hn,Ss).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const A=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));A!==this.state.context&&Ae(this,hn,Ss).call(this,{type:"pending",context:A,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,x,null,t,this.state.context,n)),Ae(this,hn,Ss).call(this,{type:"success",data:x}),x}catch(x){try{throw await((S=(v=N(this,Yt).config).onError)==null?void 0:S.call(v,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(L=N(this,Yt).config).onSettled)==null?void 0:T.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,n)),x}finally{Ae(this,hn,Ss).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mn=new WeakMap,Yt=new WeakMap,va=new WeakMap,hn=new WeakSet,Ss=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Et.batch(()=>{N(this,mn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Zh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xw=(w5=class extends Ta{constructor(t={}){super();le(this,jn);le(this,Zr);le(this,kc);this.config=t,ee(this,jn,new Set),ee(this,Zr,new Map),ee(this,kc,0)}build(t,r,n){const s=new Zw({client:t,mutationCache:this,mutationId:++Ku(this,kc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);n?n.push(t):N(this,Zr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Zr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Dc(t);if(typeof r=="string"){const s=(n=N(this,Zr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Et.batch(()=>{N(this,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Zr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>_h(r,n))}findAll(t={}){return this.getAll().filter(r=>_h(t,r))}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Et.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},jn=new WeakMap,Zr=new WeakMap,kc=new WeakMap,w5);function Dc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qw=(v5=class extends Ta{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Es);le(this,ar);le(this,Wn);ee(this,Vn,t),this.setOptions(r),this.bindMethods(),Ae(this,qn,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,Vn).defaultMutationOptions(t),Fc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Ae(this,qn,Zu).call(this),Ae(this,qn,Bm).call(this,t)}getCurrentResult(){return N(this,Es)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),ee(this,ar,void 0),Ae(this,qn,Zu).call(this),Ae(this,qn,Bm).call(this)}mutate(t,r){var n;return ee(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),ee(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Es=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Zu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Zh();ee(this,Es,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Bm=function(t){Et.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Es).variables,d=N(this,Es).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Es))})})},v5),Jw=(E5=class extends Ta{constructor(t={}){super();le(this,bn);this.config=t,ee(this,bn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??hd(s,r);let o=this.get(a);return o||(o=new Vw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,bn).has(t.queryHash)||(N(this,bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,bn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,bn).get(t)}getAll(){return[...N(this,bn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Dh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Dh(t,n)):r}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bn=new WeakMap,E5),e3=(k5=class{constructor(e={}){le(this,ft);le(this,ks);le(this,Cs);le(this,So);le(this,Ao);le(this,Ts);le(this,Po);le(this,Io);ee(this,ft,e.queryCache||new Jw),ee(this,ks,e.mutationCache||new Xw),ee(this,Cs,e.defaultOptions||{}),ee(this,So,new Map),ee(this,Ao,new Map),ee(this,Ts,0)}mount(){Ku(this,Ts)._++,N(this,Ts)===1&&(ee(this,Po,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Io,Oc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Ts)._--,N(this,Ts)===0&&((e=N(this,Po))==null||e.call(this),ee(this,Po,void 0),(t=N(this,Io))==null||t.call(this),ee(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,ks).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Xn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=_w(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Et.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);Et.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return Et.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Et.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return Et.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Et.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Yh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Yh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oc.isOnline()?N(this,ks).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,ks)}getDefaultOptions(){return N(this,Cs)}setDefaultOptions(e){ee(this,Cs,e)}setQueryDefaults(e,t){N(this,So).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Ao).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=hd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Uc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,ks).clear()}},ft=new WeakMap,ks=new WeakMap,Cs=new WeakMap,So=new WeakMap,Ao=new WeakMap,Ts=new WeakMap,Po=new WeakMap,Io=new WeakMap,k5),Xh=gt.createContext(void 0),_c=e=>{const t=gt.useContext(Xh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Xh.Provider,{value:e,children:t})),Qh=gt.createContext(!1),r3=()=>gt.useContext(Qh);Qh.Provider;function n3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var s3=gt.createContext(n3()),a3=()=>gt.useContext(s3),o3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},i3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},c3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||zh(r,[e.error,n])),l3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},u3=(e,t)=>e.isLoading&&e.isFetching&&!t,d3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Jh=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function p3(e,t,r){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=r3(),s=a3(),a=_c(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",l3(o),o3(o,s),i3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(E=>{const w=u?c.subscribe(Et.batchCalls(E)):jt;return c.updateResult(),w},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),d3(o,l))throw Jh(o,c,s);if(c3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Us&&u3(l,n)){const E=i?Jh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function f3(e,t){return p3(e,Ww)}function xn(e,t){const r=_c(),[n]=gt.useState(()=>new Qw(r,e));gt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>n.subscribe(Et.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=gt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&zh(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const m3=M.createContext(null),Cd={didCatch:!1,error:null};class h3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Cd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Cd)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&b3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(Cd)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(m3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function b3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const e1=M.createContext({});function y3({children:e,...t}){return B.jsx(e1.Provider,{value:t,children:e})}const Qr=()=>M.useContext(e1);var kt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(kt||{});const g3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Mc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(k3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(x3,{link:r,text:n}),a]})}const x3=({link:e,text:t})=>{const{swapStatus:r}=Qr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(T3,{}),e?B.jsx(w3,{link:e,text:t}):r===kt.FAILED?void 0:B.jsx(Oo,{children:t})]})},w3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function v3(){const{components:e}=Qr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function E3(){const{components:e}=Qr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const k3=()=>{const{swapStatus:e}=Qr();return e===kt.SUCCESS?B.jsx(v3,{}):e===kt.FAILED?B.jsx(E3,{}):B.jsx(C3,{})},C3=()=>{const{components:e}=Qr();return e.Loader?e.Loader:B.jsx(g3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},T3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Qr();return r!==kt.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Mc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function A3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const t1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Qr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(r1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(A3,{}),B.jsx(r1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},r1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function P3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Mc,{title:e,className:Ne("Success"),body:!n&&B.jsx(t1,{}),footerLink:t,footerText:r})}const n1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function s1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const I3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(s1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(s1,{className:`${Ne("MainContentRectengularLoader")}`})]}),B3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Qr(),d=B.jsx(o1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(F3,{}):B.jsxs(n1,{children:[d,B.jsx(I3,{})]}):B.jsx(n1,{children:d})},a1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function F3(){const{currentStep:e}=Qr();return e?B.jsx(Mc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(t1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const o1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(a1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(a1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(y3,{...e,children:B.jsx(U3,{})}),U3=()=>{const{swapStatus:e,components:t,className:r}=Qr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===kt.SUCCESS?t==null?void 0:t.Success:e===kt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qn.Success=P3,Qn.Failed=S3,Qn.Main=B3,Qn.StepLayout=Mc;var Mt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e))(Mt||{}),Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const O3=e=>e.replace(/,/g,""),D3=async e=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy failed",t),!1}},i1=e=>{if(!e)return"";const t=Math.floor(e/1e3),r=Math.floor(t/(1440*60)),n=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return r&&o.push(`${r} days `),n&&o.push(`${n} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Td=(e,t)=>e?`${e.substring(0,(t==null?void 0:t.start)||6)}...${e.substring(e.length-((t==null?void 0:t.end)||5))}`:"",_3=e=>{const t="An error occurred.";if(!e||!e.message)return t;try{return e.message.toLowerCase().indexOf("rejected")?"Transaction Rejected":t}catch{return t}};function Do(e,t=6,r=8){if(!e)return"";const n=e.startsWith("-")?"-":"",s=n?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return n+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return n+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>r)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?n+"0."+c+u:"0"}const Sd=e=>{var t,r,n,s;if(e!=null&&e.message)return((r=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:r.includes("rejected"))||((s=(n=e.message)==null?void 0:n.toLowerCase())==null?void 0:s.includes("denied"))},M3=e=>{switch(e){case Ft.base.id:return 1e-4;default:return .01}},c1=(e,t,r)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const n=Xr(t,e.srcAmountFilled),s=Xr(r,e.dstAmountFilled);return j(s).div(n).toFixed()},l1=(e,t,r)=>{if(e.type===dt.TWAP_MARKET)return"";const n=Xr(t,e.srcAmountPerTrade),s=Xr(r,e.dstMinAmountPerTrade);return j(s).div(n).toFixed()},u1=(e,t)=>{const r=Bs(t);return r&&Is(e.address)?r.wToken:e};function d1(e){return e?e/864e5:0}function Ad(e){return e?e/6e4:0}const N3=(e,t)=>e?dt.TWAP_MARKET:t===1?dt.LIMIT:dt.TWAP_LIMIT,Pd=(e,t,r)=>{const n=Bs(r);return Is((e==null?void 0:e.address)||"")&&Ps((t==null?void 0:t.address)||"",(n==null?void 0:n.wToken.address)||"")},Id=(e,t,r)=>{const n=Bs(r);return Ps((e==null?void 0:e.address)||"",(n==null?void 0:n.wToken.address)||"")&&Is((t==null?void 0:t.address)||"")},_o=(e,t)=>{if(!t)return"";const r=Bs(t);return`${r==null?void 0:r.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const a=typeof s=="function"?s(n):s,o={...n,...a};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function L3(){return{}}const z3=p({id:16600,name:"0G Newton Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-newton.0g.ai"}},testnet:!0}),R3=p({id:16601,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),H3=p({id:16661,name:"0G Mainnet",nativeCurrency:{name:"0G",symbol:"0G",decimals:18},rpcUrls:{default:{http:["https://evmrpc.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan.0g.ai"}},testnet:!1}),$3=p({id:16602,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),G3=p({id:995,name:"5ireChain",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Mainnet Explorer",url:"https://5irescan.io/"}},testnet:!1}),j3=p({id:179,name:"ABEY Mainnet",nativeCurrency:{name:"ABEY",symbol:"ABEY",decimals:18},rpcUrls:{default:{http:["https://rpc.abeychain.com"]}},blockExplorers:{default:{name:"Abey Scan",url:"https://abeyscan.com"}},testnet:!1}),p1="2.43.3";let Mo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${p1}`},$=class Fm extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Fm?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Fm&&r.cause.docsPath||r.docsPath,a=(i=Mo.getDocsUrl)==null?void 0:i.call(Mo,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Mo.version?[`Version: ${Mo.version}`]:[]].join(`
64
+ `,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class kw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Cw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{const a=await ww({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Ew({chainId:e,orders:a,signal:t}),vw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return gw(l,e,u,Tw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Tw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Sh(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Ph(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Ph=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?ut.Completed:r==="CANCELED"?ut.Canceled:r==="COMPLETED"?ut.Completed:t>Date.now()?ut.Open:ut.Expired,Ih=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Cw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),bw({chainId:r,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Bh=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},Aw=(e=>e?Bh(e):Bh),Pw=e=>e;function Iw(e,t=Pw){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const Fh=e=>{const t=Aw(e),r=n=>Iw(t,n);return Object.assign(r,t),r},Bw=(e=>e?Fh(e):Fh),Uh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Bw((e,t)=>({state:Uh,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...Uh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Fw={version:"0.0.30"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Uw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ow=(f5=class{constructor(){le(this,fn,Uw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fn),provider:e}),ee(this,fn,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fn).setTimeout(e,t)}clearTimeout(e){N(this,fn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,pa=new WeakMap,f5),Fs=new Ow;function Dw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function _w(e,t){return typeof e=="function"?e(t):e}function md(e){return typeof e=="number"&&e>=0&&e!==1/0}function Oh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function Dh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==hd(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function _h(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function hd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>yd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Mw=Object.prototype.hasOwnProperty;function bd(e,t){if(e===t)return e;const r=Mh(e)&&Mh(t);if(!r&&!(yd(e)&&yd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Mw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=bd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Mh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yd(e){if(!Nh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Nh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nw(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function gd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return bd(e,t)}return t}function Lw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function zw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Uc=Symbol();function Lh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Uc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Uc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function zh(e,t){return typeof e=="function"?e(...t):!!e}var Rw=(m5=class extends Ta{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var r;ee(this,go,t),(r=N(this,gs))==null||r.call(this),ee(this,gs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,m5),xd=new Rw;function wd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Hw=Dw;function $w(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Hw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Et=$w(),Gw=(h5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var r;ee(this,wo,t),(r=N(this,xs))==null||r.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),Oc=new Gw;function jw(e){return Math.min(1e3*2**e,3e4)}function Rh(e){return(e??"online")==="online"?Oc.isOnline():!0}var vd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hh(e){let t=!1,r=0,n;const s=wd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const w=new vd(g);f(w),(E=e.onCancel)==null||E.call(e,w)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>xd.isFocused()&&(e.networkMode==="always"||Oc.isOnline())&&e.canRun(),u=()=>Rh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=w=>{(a()||l())&&g(w)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var L;if(a())return;const v=e.retry??(Us?0:3),S=e.retryDelay??jw,C=typeof S=="function"?S(r,w):S,D=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,w);if(t||!D){f(w);return}r++,(L=e.onFail)==null||L.call(e,r,w),Nw(C).then(()=>l()?void 0:m()).then(()=>{t?f(w):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var $h=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&ee(this,ma,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Fs.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Vw=(y5=class extends $h{constructor(t){super();le(this,Kr);le(this,ha);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,xc);le(this,ya);ee(this,ya,!1),ee(this,xc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Vh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,xc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Vh(this.options);r.data!==void 0&&(this.setState(jh(r.data,r.dataUpdatedAt)),ee(this,ha,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=gd(this.state.data,t,this.options);return Ae(this,Kr,Yn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ae(this,Kr,Yn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>Er(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Oh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,Kr,Yn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,y,g,E,w,v,S;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),n.signal)})},a=()=>{const C=Lh(this.options,r),L=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return ee(this,ya,!1),this.options.persister?this.options.persister(C,L,this):C(L)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Ae(this,Kr,Yn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Hh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof vd&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Ae(this,Kr,Yn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Ae(this,Kr,Yn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,Kr,Yn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(m=(f=N(this,Br).config).onSuccess)==null||m.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof vd){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ae(this,Kr,Yn).call(this,{type:"error",error:C}),(w=(E=N(this,Br).config).onError)==null||w.call(E,C,this),(S=(v=N(this,Br).config).onSettled)==null||S.call(v,this.state.data,C,this),C}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,xc=new WeakMap,ya=new WeakMap,Kr=new WeakSet,Yn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Gh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...jh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Et.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},y5);function Gh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Rh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function jh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ww=(g5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,De);le(this,wc);le(this,qt);le(this,ga);le(this,Eo);le(this,Gn);le(this,ws);le(this,vc);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,vs);le(this,To,new Set);this.options=r,ee(this,sr,t),ee(this,ws,null),ee(this,Gn,wd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,De).addObserver(this),Wh(N(this,De),this.options)?Ae(this,Ve,Cc).call(this):this.updateResult(),Ae(this,Ve,Sm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ed(N(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ed(N(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ve,Am).call(this),Ae(this,Ve,Pm).call(this),N(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,De);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Er(this.options.enabled,N(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ve,Im).call(this),N(this,De).setOptions(this.options),r._defaulted&&!Fc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,De),observer:this});const s=this.hasListeners();s&&qh(N(this,De),n,this.options,r)&&Ae(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||Xn(this.options.staleTime,N(this,De))!==Xn(r.staleTime,N(this,De)))&&Ae(this,Ve,km).call(this);const a=Ae(this,Ve,Cm).call(this);s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||a!==N(this,vs))&&Ae(this,Ve,Tm).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Yw(this,n)&&(ee(this,qt,n),ee(this,Eo,this.options),ee(this,ga,N(this,De).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ae(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,De),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,wc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),A=!x&&Wh(t,r),I=x&&qh(t,n,r,s);(A||I)&&(d={...d,...Gh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;m=d.data;let w=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,w=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",m=gd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!w)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,vc))m=N(this,ko);else try{ee(this,vc,r.select),m=r.select(m),m=gd(a==null?void 0:a.data,m,r),ee(this,ko,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,ko),g=Date.now(),E="error");const v=d.fetchStatus==="fetching",S=E==="pending",C=E==="error",D=S&&v,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:S,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!S,isLoadingError:C&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&L,isStale:kd(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:Er(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},A=()=>{const F=ee(this,Gn,h.promise=wd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(h.status==="error"||h.data!==I.value)&&A();break;case"rejected":(h.status!=="error"||h.error!==I.reason)&&A();break}}return h}updateResult(){const t=N(this,qt),r=this.createResult(N(this,De),this.options);if(ee(this,ga,N(this,De).state),ee(this,Eo,this.options),N(this,ga).data!==void 0&&ee(this,Co,N(this,De)),Fc(r,t))return;ee(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Ae(this,Ve,F5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ve,Sm).call(this)}},sr=new WeakMap,De=new WeakMap,wc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,Gn=new WeakMap,ws=new WeakMap,vc=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,To=new WeakMap,Ve=new WeakSet,Cc=function(t){Ae(this,Ve,Im).call(this);let r=N(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},km=function(){Ae(this,Ve,Am).call(this);const t=Xn(this.options.staleTime,N(this,De));if(Us||N(this,qt).isStale||!md(t))return;const n=Oh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Cm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,De)):this.options.refetchInterval)??!1},Tm=function(t){Ae(this,Ve,Pm).call(this),ee(this,vs,t),!(Us||Er(this.options.enabled,N(this,De))===!1||!md(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||xd.isFocused())&&Ae(this,Ve,Cc).call(this)},N(this,vs)))},Sm=function(){Ae(this,Ve,km).call(this),Ae(this,Ve,Tm).call(this,Ae(this,Ve,Cm).call(this))},Am=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Pm=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),ee(this,wa,void 0))},Im=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,De))return;const r=N(this,De);ee(this,De,t),ee(this,wc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},F5=function(t){Et.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,De),type:"observerResultsUpdated"})})},g5);function qw(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wh(e,t){return qw(e,t)||e.state.data!==void 0&&Ed(e,t,t.refetchOnMount)}function Ed(e,t,r){if(Er(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&kd(e,t)}return!1}function qh(e,t,r,n){return(e!==t||Er(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&kd(e,r)}function kd(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function Yw(e,t){return!Fc(e.getCurrentResult(),t)}function Yh(e){return{onFetch:(t,r)=>{var u,d,f,m,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Lh(t.options,t.fetchOptions),v=async(S,C,D)=>{if(g)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const T=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(A),A})(),h=await w(T),{maxPages:b}=t.options,x=D?zw:Lw;return{pages:x(S.pages,h,b),pageParams:x(S.pageParams,C,b)}};if(s&&a.length){const S=s==="backward",C=S?Kw:Kh,D={pages:a,pageParams:o},L=C(n,D);i=await v(D,L,S)}else{const S=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Kh(n,i);if(c>0&&C==null)break;i=await v(i,C),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Kh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Kw(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Zw=(x5=class extends $h{constructor(t){super();le(this,hn);le(this,Ec);le(this,mn);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mn,[]),this.state=t.state||Zh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,mn).includes(t)||(N(this,mn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mn,N(this,mn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,E,w,v,S,C,D,L,T,h,b;const r=()=>{Ae(this,hn,Ss).call(this,{type:"continue"})},n={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Hh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,A)=>{Ae(this,hn,Ss).call(this,{type:"failed",failureCount:x,error:A})},onPause:()=>{Ae(this,hn,Ss).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Ae(this,hn,Ss).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const A=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));A!==this.state.context&&Ae(this,hn,Ss).call(this,{type:"pending",context:A,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,x,null,t,this.state.context,n)),Ae(this,hn,Ss).call(this,{type:"success",data:x}),x}catch(x){try{throw await((S=(v=N(this,Yt).config).onError)==null?void 0:S.call(v,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(L=N(this,Yt).config).onSettled)==null?void 0:T.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,n)),x}finally{Ae(this,hn,Ss).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mn=new WeakMap,Yt=new WeakMap,va=new WeakMap,hn=new WeakSet,Ss=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Et.batch(()=>{N(this,mn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Zh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xw=(w5=class extends Ta{constructor(t={}){super();le(this,jn);le(this,Zr);le(this,kc);this.config=t,ee(this,jn,new Set),ee(this,Zr,new Map),ee(this,kc,0)}build(t,r,n){const s=new Zw({client:t,mutationCache:this,mutationId:++Ku(this,kc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);n?n.push(t):N(this,Zr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Zr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Dc(t);if(typeof r=="string"){const n=N(this,Zr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Dc(t);if(typeof r=="string"){const s=(n=N(this,Zr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Et.batch(()=>{N(this,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Zr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>_h(r,n))}findAll(t={}){return this.getAll().filter(r=>_h(t,r))}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Et.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},jn=new WeakMap,Zr=new WeakMap,kc=new WeakMap,w5);function Dc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qw=(v5=class extends Ta{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Es);le(this,ar);le(this,Wn);ee(this,Vn,t),this.setOptions(r),this.bindMethods(),Ae(this,qn,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,Vn).defaultMutationOptions(t),Fc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Ae(this,qn,Zu).call(this),Ae(this,qn,Bm).call(this,t)}getCurrentResult(){return N(this,Es)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),ee(this,ar,void 0),Ae(this,qn,Zu).call(this),Ae(this,qn,Bm).call(this)}mutate(t,r){var n;return ee(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),ee(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Es=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Zu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Zh();ee(this,Es,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Bm=function(t){Et.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Es).variables,d=N(this,Es).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Es))})})},v5),Jw=(E5=class extends Ta{constructor(t={}){super();le(this,bn);this.config=t,ee(this,bn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??hd(s,r);let o=this.get(a);return o||(o=new Vw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,bn).has(t.queryHash)||(N(this,bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,bn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,bn).get(t)}getAll(){return[...N(this,bn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Dh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Dh(t,n)):r}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bn=new WeakMap,E5),e3=(k5=class{constructor(e={}){le(this,ft);le(this,ks);le(this,Cs);le(this,So);le(this,Ao);le(this,Ts);le(this,Po);le(this,Io);ee(this,ft,e.queryCache||new Jw),ee(this,ks,e.mutationCache||new Xw),ee(this,Cs,e.defaultOptions||{}),ee(this,So,new Map),ee(this,Ao,new Map),ee(this,Ts,0)}mount(){Ku(this,Ts)._++,N(this,Ts)===1&&(ee(this,Po,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Io,Oc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Ts)._--,N(this,Ts)===0&&((e=N(this,Po))==null||e.call(this),ee(this,Po,void 0),(t=N(this,Io))==null||t.call(this),ee(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,ks).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Xn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=_w(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Et.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);Et.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return Et.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Et.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return Et.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Et.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Yh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Yh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oc.isOnline()?N(this,ks).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,ks)}getDefaultOptions(){return N(this,Cs)}setDefaultOptions(e){ee(this,Cs,e)}setQueryDefaults(e,t){N(this,So).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Ao).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=hd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Uc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,ks).clear()}},ft=new WeakMap,ks=new WeakMap,Cs=new WeakMap,So=new WeakMap,Ao=new WeakMap,Ts=new WeakMap,Po=new WeakMap,Io=new WeakMap,k5),Xh=gt.createContext(void 0),_c=e=>{const t=gt.useContext(Xh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Xh.Provider,{value:e,children:t})),Qh=gt.createContext(!1),r3=()=>gt.useContext(Qh);Qh.Provider;function n3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var s3=gt.createContext(n3()),a3=()=>gt.useContext(s3),o3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},i3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},c3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||zh(r,[e.error,n])),l3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},u3=(e,t)=>e.isLoading&&e.isFetching&&!t,d3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Jh=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function p3(e,t,r){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=r3(),s=a3(),a=_c(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",l3(o),o3(o,s),i3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(E=>{const w=u?c.subscribe(Et.batchCalls(E)):jt;return c.updateResult(),w},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),d3(o,l))throw Jh(o,c,s);if(c3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Us&&u3(l,n)){const E=i?Jh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function f3(e,t){return p3(e,Ww)}function xn(e,t){const r=_c(),[n]=gt.useState(()=>new Qw(r,e));gt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>n.subscribe(Et.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=gt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&zh(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const m3=M.createContext(null),Cd={didCatch:!1,error:null};class h3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Cd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Cd)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&b3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(Cd)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(m3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function b3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const e1=M.createContext({});function y3({children:e,...t}){return B.jsx(e1.Provider,{value:t,children:e})}const Qr=()=>M.useContext(e1);var kt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(kt||{});const g3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Mc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(k3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(x3,{link:r,text:n}),a]})}const x3=({link:e,text:t})=>{const{swapStatus:r}=Qr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(T3,{}),e?B.jsx(w3,{link:e,text:t}):r===kt.FAILED?void 0:B.jsx(Oo,{children:t})]})},w3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function v3(){const{components:e}=Qr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function E3(){const{components:e}=Qr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const k3=()=>{const{swapStatus:e}=Qr();return e===kt.SUCCESS?B.jsx(v3,{}):e===kt.FAILED?B.jsx(E3,{}):B.jsx(C3,{})},C3=()=>{const{components:e}=Qr();return e.Loader?e.Loader:B.jsx(g3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},T3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Qr();return r!==kt.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Mc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function A3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const t1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Qr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(r1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(A3,{}),B.jsx(r1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},r1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function P3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Mc,{title:e,className:Ne("Success"),body:!n&&B.jsx(t1,{}),footerLink:t,footerText:r})}const n1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function s1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const I3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(s1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(s1,{className:`${Ne("MainContentRectengularLoader")}`})]}),B3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Qr(),d=B.jsx(o1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(F3,{}):B.jsxs(n1,{children:[d,B.jsx(I3,{})]}):B.jsx(n1,{children:d})},a1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function F3(){const{currentStep:e}=Qr();return e?B.jsx(Mc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(t1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const o1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(a1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(a1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(y3,{...e,children:B.jsx(U3,{})}),U3=()=>{const{swapStatus:e,components:t,className:r}=Qr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===kt.SUCCESS?t==null?void 0:t.Success:e===kt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qn.Success=P3,Qn.Failed=S3,Qn.Main=B3,Qn.StepLayout=Mc;var Mt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e))(Mt||{}),Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const O3=e=>e.replace(/,/g,""),D3=async e=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy failed",t),!1}},i1=e=>{if(!e)return"";const t=Math.floor(e/1e3),r=Math.floor(t/(1440*60)),n=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return r&&o.push(`${r} days `),n&&o.push(`${n} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Td=(e,t)=>e?`${e.substring(0,(t==null?void 0:t.start)||6)}...${e.substring(e.length-((t==null?void 0:t.end)||5))}`:"",_3=e=>{const t="An error occurred.";if(!e||!e.message)return t;try{return e.message.toLowerCase().indexOf("rejected")?"Transaction Rejected":t}catch{return t}};function Do(e,t=6,r=8){if(!e)return"";const n=e.startsWith("-")?"-":"",s=n?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return n+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return n+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>r)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?n+"0."+c+u:"0"}const Sd=e=>{var t,r,n,s;if(e!=null&&e.message)return((r=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:r.includes("rejected"))||((s=(n=e.message)==null?void 0:n.toLowerCase())==null?void 0:s.includes("denied"))},M3=e=>{switch(e){case Ft.base.id:return 1e-4;default:return .01}},c1=(e,t,r)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const n=Xr(t,e.srcAmountFilled),s=Xr(r,e.dstAmountFilled);return j(s).div(n).toFixed()},l1=(e,t,r)=>{if(e.type===dt.TWAP_MARKET)return"";const n=Xr(t,e.srcAmountPerTrade),s=Xr(r,e.dstMinAmountPerTrade);return j(s).div(n).toFixed()},u1=(e,t)=>{const r=Bs(t);return r&&Is(e.address)?r.wToken:e};function d1(e){return e?e/864e5:0}function Ad(e){return e?e/6e4:0}const N3=(e,t)=>e?dt.TWAP_MARKET:t===1?dt.LIMIT:dt.TWAP_LIMIT,Pd=(e,t,r)=>{const n=Bs(r);return Is((e==null?void 0:e.address)||"")&&Ps((t==null?void 0:t.address)||"",(n==null?void 0:n.wToken.address)||"")},Id=(e,t,r)=>{const n=Bs(r);return Ps((e==null?void 0:e.address)||"",(n==null?void 0:n.wToken.address)||"")&&Is((t==null?void 0:t.address)||"")},_o=(e,t)=>{if(!t)return"";const r=Bs(t);return`${r==null?void 0:r.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const a=typeof s=="function"?s(n):s,o={...n,...a};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function L3(){return{}}const z3=p({id:16600,name:"0G Newton Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-newton.0g.ai"}},testnet:!0}),R3=p({id:16601,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),H3=p({id:16661,name:"0G Mainnet",nativeCurrency:{name:"0G",symbol:"0G",decimals:18},rpcUrls:{default:{http:["https://evmrpc.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan.0g.ai"}},testnet:!1}),$3=p({id:16602,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),G3=p({id:995,name:"5ireChain",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Mainnet Explorer",url:"https://5irescan.io/"}},testnet:!1}),j3=p({id:179,name:"ABEY Mainnet",nativeCurrency:{name:"ABEY",symbol:"ABEY",decimals:18},rpcUrls:{default:{http:["https://rpc.abeychain.com"]}},blockExplorers:{default:{name:"Abey Scan",url:"https://abeyscan.com"}},testnet:!1}),p1="2.43.3";let Mo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${p1}`},$=class Fm extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Fm?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Fm&&r.cause.docsPath||r.docsPath,a=(i=Mo.getDocsUrl)==null?void 0:i.call(Mo,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Mo.version?[`Version: ${Mo.version}`]:[]].join(`
65
65
  `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=p1}walk(t){return f1(this,t)}};function f1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?f1(e.cause,t):t?null:e}let m1=class extends ${constructor({max:t,min:r,signed:n,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},V3=class extends ${constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class W3 extends ${constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let q3=class extends ${constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Or(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function lt(e){return Or(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Zt(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let s=0;s<r.length-1&&r[t==="left"?s:r.length-s-1].toString()==="0";s++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}let h1=class extends ${constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},b1=class extends ${constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class y1 extends ${constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}function _s(e,{dir:t,size:r=32}={}){return typeof e=="string"?Jn(e,{dir:t,size:r}):Y3(e,{dir:t,size:r})}function Jn(e,{dir:t,size:r=32}={}){if(r===null)return e;const n=e.replace("0x","");if(n.length>r*2)throw new b1({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function Y3(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new b1({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let s=0;s<r;s++){const a=t==="right";n[a?s:r-s-1]=e[a?s:e.length-s-1]}return n}const K3=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Fe(e,t={}){return typeof e=="number"||typeof e=="bigint"?q(e,t):typeof e=="string"?Sa(e,t):typeof e=="boolean"?g1(e,t):wt(e,t)}function g1(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{size:t.size})):r}function wt(e,t={}){let r="";for(let s=0;s<e.length;s++)r+=K3[e[s]];const n=`0x${r}`;return typeof t.size=="number"?(Dr(n,{size:t.size}),_s(n,{dir:"right",size:t.size})):n}function q(e,t={}){const{signed:r,size:n}=t,s=BigInt(e);let a;n?r?a=(1n<<BigInt(n)*8n-1n)-1n:a=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&r?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new m1({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${e}${c}`})}const i=`0x${(r&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?_s(i,{size:n}):i}const Z3=new TextEncoder;function Sa(e,t={}){const r=Z3.encode(e);return wt(r,t)}const X3=new TextEncoder;function wn(e,t={}){return typeof e=="number"||typeof e=="bigint"?J3(e,t):typeof e=="boolean"?Q3(e,t):Or(e)?or(e,t):Ms(e,t)}function Q3(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{size:t.size})):r}const vn={zero:48,nine:57,A:65,F:70,a:97,f:102};function x1(e){if(e>=vn.zero&&e<=vn.nine)return e-vn.zero;if(e>=vn.A&&e<=vn.F)return e-(vn.A-10);if(e>=vn.a&&e<=vn.f)return e-(vn.a-10)}function or(e,t={}){let r=e;t.size&&(Dr(r,{size:t.size}),r=_s(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const s=n.length/2,a=new Uint8Array(s);for(let o=0,i=0;o<s;o++){const c=x1(n.charCodeAt(i++)),l=x1(n.charCodeAt(i++));if(c===void 0||l===void 0)throw new $(`Invalid byte sequence ("${n[i-2]}${n[i-1]}" in "${n}").`);a[o]=c*16+l}return a}function J3(e,t){const r=q(e,t);return or(r)}function Ms(e,t={}){const r=X3.encode(e);return typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{dir:"right",size:t.size})):r}function Dr(e,{size:t}){if(lt(e)>t)throw new q3({givenSize:lt(e),maxSize:t})}function Le(e,t={}){const{signed:r}=t;t.size&&Dr(e,{size:t.size});const n=BigInt(e);if(!r)return n;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return n<=a?n:n-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function e8(e,t={}){let r=e;if(t.size&&(Dr(r,{size:t.size}),r=Zt(r)),Zt(r)==="0x00")return!1;if(Zt(r)==="0x01")return!0;throw new W3(r)}function ir(e,t={}){return Number(Le(e,t))}function Nc(e,t){return({exclude:r,format:n})=>({exclude:r,format:(s,a)=>{const o=t(s,a);if(r)for(const i of r)delete o[i];return{...o,...n(s,a)}},type:e})}const w1={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ns(e,t){const r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ir(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ir(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?w1[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=t8(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}const Lc=Nc("transaction",Ns);function t8(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Bd(e,t){const r=(e.transactions??[]).map(n=>typeof n=="string"?n:Ns(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Fd=Nc("block",Bd);function Jr(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}const v1={"0x0":"reverted","0x1":"success"};function zc(e,t){const r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>Jr(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ir(e.transactionIndex):null,status:e.status?v1[e.status]:null,type:e.type?w1[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}const Ud=Nc("transactionReceipt",zc),r8={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function _r(e,t){const r={};return typeof e.authorizationList<"u"&&(r.authorizationList=n8(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?r.blobs=e.blobs.map(n=>wt(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),e.account&&(r.from=e.account.address),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=q(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=q(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=r8[e.type]),typeof e.value<"u"&&(r.value=q(e.value)),r}const Od=Nc("transactionRequest",_r);function n8(e){return e.map(t=>({address:t.address,r:t.r?q(BigInt(t.r)):t.r,s:t.s?q(BigInt(t.s)):t.s,chainId:q(t.chainId),nonce:q(t.nonce),...typeof t.yParity<"u"?{yParity:q(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:q(t.v)}:{}}))}const s8=2n**16n-1n,Ls=2n**256n-1n,Dd=50000n,E1=s8*32n,k1={block:Fd({format(e){var r;const t=(r=e.transactions)==null?void 0:r.map(n=>{var a;if(typeof n=="string")return n;const s=(a=k1.transaction)==null?void 0:a.format(n);return s.typeHex==="0x71"?s.type="eip712":s.typeHex==="0xff"&&(s.type="priority"),s});return{l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?Le(e.l1BatchTimestamp):null,transactions:t}}}),transaction:Lc({format(e){const t={};return e.type==="0x71"?t.type="eip712":e.type==="0xff"&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Le(e.l1BatchTxIndex):null}}}),transactionReceipt:Ud({format(e){return{l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Le(e.l1BatchTxIndex):null,logs:e.logs.map(t=>({...Jr(t),l1BatchNumber:t.l1BatchNumber?Le(t.l1BatchNumber):null,transactionLogIndex:ir(t.transactionLogIndex),logType:t.logType})),l2ToL1Logs:e.l2ToL1Logs.map(t=>({blockNumber:Le(t.blockHash),blockHash:t.blockHash,l1BatchNumber:t.l1BatchNumber?Le(t.l1BatchNumber):null,transactionIndex:Le(t.transactionIndex),shardId:Le(t.shardId),isService:t.isService,sender:t.sender,key:t.key,value:t.value,transactionHash:t.transactionHash,logIndex:Le(t.logIndex)}))}}}),transactionRequest:Od({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Fe(e.gasPerPubdata)}:{gasPerPubdata:Fe(Dd)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(or(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(t=>Array.from(or(t)))}:{},...e.customSignature?{customSignature:Array.from(or(e.customSignature))}:{}},type:"0x71"}:{}}})};function cr(e){return typeof e[0]=="string"?lr(e):a8(e)}function a8(e){let t=0;for(const s of e)t+=s.length;const r=new Uint8Array(t);let n=0;for(const s of e)r.set(s,n),n+=s.length;return r}function lr(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}let C1=class extends ${constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},T1=class extends ${constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},o8=class extends ${constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const i8={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o8({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new T1({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new C1({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new C1({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function _d(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(i8);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}function en(e,t="hex"){const r=S1(e),n=_d(new Uint8Array(r.length));return r.encode(n),t==="hex"?wt(n.bytes):n.bytes}function S1(e){return Array.isArray(e)?c8(e.map(t=>S1(t))):l8(e)}function c8(e){const t=e.reduce((s,a)=>s+a.length,0),r=A1(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function l8(e){const t=typeof e=="string"?or(e):e,r=A1(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function A1(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new $("Length is too large.")}const u8={gwei:9,wei:18},d8={ether:-9,wei:9};function P1(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[s,a]=[r.slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${a?`.${a}`:""}`}function Md(e,t="wei"){return P1(e,u8[t])}function Xt(e,t="wei"){return P1(e,d8[t])}function No(e){const t=Object.entries(e).map(([n,s])=>s===void 0||s===!1?null:[n,s]).filter(Boolean),r=t.reduce((n,[s])=>Math.max(n,s.length),0);return t.map(([n,s])=>` ${`${n}:`.padEnd(r+1)} ${s}`).join(`
66
66
  `)}class p8 extends ${constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class f8 extends ${constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",No(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}let m8=class extends ${constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};class h8 extends ${constructor(t,{account:r,docsPath:n,chain:s,data:a,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var y;const m=No({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${Md(f)} ${((y=s==null?void 0:s.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof i<"u"&&`${Xt(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${Xt(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Xt(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class I1 extends ${constructor({blockHash:t,blockNumber:r,blockTag:n,hash:s,index:a}){let o="Transaction";n&&a!==void 0&&(o=`Transaction at block time "${n}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),r&&a!==void 0&&(o=`Transaction at block number "${r}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class B1 extends ${constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class F1 extends ${constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class b8 extends ${constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}function y8(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const{chainId:n,nonce:s,...a}=r,o=r.address;t.push([n?Fe(n):"0x",o,s?Fe(s):"0x",..._a({},a)])}return t}function Nd(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(a=>or(a)):e.blobs,s=[];for(const a of n)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return r==="bytes"?s:s.map(a=>wt(a))}function Ld(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(o=>or(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>or(o)):e.commitments,a=[];for(let o=0;o<n.length;o++){const i=n[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(i,c)))}return r==="bytes"?a:a.map(o=>wt(o))}const Aa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g8(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Lo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function zs(e,...t){if(!g8(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function x8(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Lo(e.outputLen),Lo(e.blockLen)}function Pa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function U1(e,t){zs(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function w8(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function es(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function zd(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function tn(e,t){return e<<32-t|e>>>t}const v8=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function E8(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function k8(e){for(let t=0;t<e.length;t++)e[t]=E8(e[t]);return e}const O1=v8?e=>e:k8;function C8(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Rc(e){return typeof e=="string"&&(e=C8(e)),zs(e),e}function T8(...e){let t=0;for(let n=0;n<e.length;n++){const s=e[n];zs(s),t+=s.length}const r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){const a=e[n];r.set(a,s),s+=a.length}return r}class Rd{}function Hc(e){const t=n=>e().update(Rc(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S8(e=32){if(Aa&&typeof Aa.getRandomValues=="function")return Aa.getRandomValues(new Uint8Array(e));if(Aa&&typeof Aa.randomBytes=="function")return Uint8Array.from(Aa.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function A8(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const s=BigInt(32),a=BigInt(4294967295),o=Number(r>>s&a),i=Number(r&a),c=n?4:0,l=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+l,i,n)}function P8(e,t,r){return e&t^~e&r}function I8(e,t,r){return e&t^e&r^t&r}class D1 extends Rd{constructor(t,r,n,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=s,this.buffer=new Uint8Array(t),this.view=zd(this.buffer)}update(t){Pa(this),t=Rc(t),zs(t);const{view:r,buffer:n,blockLen:s}=this,a=t.length;for(let o=0;o<a;){const i=Math.min(s-this.pos,a-o);if(i===s){const c=zd(t);for(;s<=a-o;o+=s)this.process(c,o);continue}n.set(t.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Pa(this),U1(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:s,isLE:a}=this;let{pos:o}=this;r[o++]=128,es(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(n,0),o=0);for(let d=o;d<s;d++)r[d]=0;A8(n,s-8,BigInt(this.length*8),a),this.process(n,0);const i=zd(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)i.setUint32(4*d,u[d],a)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:s,finished:a,destroyed:o,pos:i}=this;return t.destroyed=o,t.finished=a,t.length=s,t.pos=i,s%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const ts=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Nt=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Lt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),$c=BigInt(2**32-1),_1=BigInt(32);function B8(e,t=!1){return t?{h:Number(e&$c),l:Number(e>>_1&$c)}:{h:Number(e>>_1&$c)|0,l:Number(e&$c)|0}}function M1(e,t=!1){const r=e.length;let n=new Uint32Array(r),s=new Uint32Array(r);for(let a=0;a<r;a++){const{h:o,l:i}=B8(e[a],t);[n[a],s[a]]=[o,i]}return[n,s]}const N1=(e,t,r)=>e>>>r,L1=(e,t,r)=>e<<32-r|t>>>r,Ia=(e,t,r)=>e>>>r|t<<32-r,Ba=(e,t,r)=>e<<32-r|t>>>r,Gc=(e,t,r)=>e<<64-r|t>>>r-32,jc=(e,t,r)=>e>>>r-32|t<<64-r,F8=(e,t,r)=>e<<r|t>>>32-r,U8=(e,t,r)=>t<<r|e>>>32-r,O8=(e,t,r)=>t<<r-32|e>>>64-r,D8=(e,t,r)=>e<<r-32|t>>>64-r;function En(e,t,r,n){const s=(t>>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:s|0}}const _8=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),M8=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,N8=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),L8=(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0,z8=(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0),R8=(e,t,r,n,s,a)=>t+r+n+s+a+(e/2**32|0)|0,H8=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rs=new Uint32Array(64);class $8 extends D1{constructor(t=32){super(64,t,8,!1),this.A=ts[0]|0,this.B=ts[1]|0,this.C=ts[2]|0,this.D=ts[3]|0,this.E=ts[4]|0,this.F=ts[5]|0,this.G=ts[6]|0,this.H=ts[7]|0}get(){const{A:t,B:r,C:n,D:s,E:a,F:o,G:i,H:c}=this;return[t,r,n,s,a,o,i,c]}set(t,r,n,s,a,o,i,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=i|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)rs[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){const f=rs[d-15],m=rs[d-2],y=tn(f,7)^tn(f,18)^f>>>3,g=tn(m,17)^tn(m,19)^m>>>10;rs[d]=g+rs[d-7]+y+rs[d-16]|0}let{A:n,B:s,C:a,D:o,E:i,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=tn(i,6)^tn(i,11)^tn(i,25),m=u+f+P8(i,c,l)+H8[d]+rs[d]|0,g=(tn(n,2)^tn(n,13)^tn(n,22))+I8(n,s,a)|0;u=l,l=c,c=i,i=o+m|0,o=a,a=s,s=n,n=m+g|0}n=n+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,i=i+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,s,a,o,i,c,l,u)}roundClean(){es(rs)}destroy(){this.set(0,0,0,0,0,0,0,0),es(this.buffer)}}const z1=M1(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),G8=z1[0],j8=z1[1],ns=new Uint32Array(80),ss=new Uint32Array(80);class R1 extends D1{constructor(t=64){super(128,t,16,!1),this.Ah=Lt[0]|0,this.Al=Lt[1]|0,this.Bh=Lt[2]|0,this.Bl=Lt[3]|0,this.Ch=Lt[4]|0,this.Cl=Lt[5]|0,this.Dh=Lt[6]|0,this.Dl=Lt[7]|0,this.Eh=Lt[8]|0,this.El=Lt[9]|0,this.Fh=Lt[10]|0,this.Fl=Lt[11]|0,this.Gh=Lt[12]|0,this.Gl=Lt[13]|0,this.Hh=Lt[14]|0,this.Hl=Lt[15]|0}get(){const{Ah:t,Al:r,Bh:n,Bl:s,Ch:a,Cl:o,Dh:i,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:m,Gl:y,Hh:g,Hl:E}=this;return[t,r,n,s,a,o,i,c,l,u,d,f,m,y,g,E]}set(t,r,n,s,a,o,i,c,l,u,d,f,m,y,g,E){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=a|0,this.Cl=o|0,this.Dh=i|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=m|0,this.Gl=y|0,this.Hh=g|0,this.Hl=E|0}process(t,r){for(let S=0;S<16;S++,r+=4)ns[S]=t.getUint32(r),ss[S]=t.getUint32(r+=4);for(let S=16;S<80;S++){const C=ns[S-15]|0,D=ss[S-15]|0,L=Ia(C,D,1)^Ia(C,D,8)^N1(C,D,7),T=Ba(C,D,1)^Ba(C,D,8)^L1(C,D,7),h=ns[S-2]|0,b=ss[S-2]|0,x=Ia(h,b,19)^Gc(h,b,61)^N1(h,b,6),A=Ba(h,b,19)^jc(h,b,61)^L1(h,b,6),I=N8(T,A,ss[S-7],ss[S-16]),F=L8(I,L,x,ns[S-7],ns[S-16]);ns[S]=F|0,ss[S]=I|0}let{Ah:n,Al:s,Bh:a,Bl:o,Ch:i,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:m,Fl:y,Gh:g,Gl:E,Hh:w,Hl:v}=this;for(let S=0;S<80;S++){const C=Ia(d,f,14)^Ia(d,f,18)^Gc(d,f,41),D=Ba(d,f,14)^Ba(d,f,18)^jc(d,f,41),L=d&m^~d&g,T=f&y^~f&E,h=z8(v,D,T,j8[S],ss[S]),b=R8(h,w,C,L,G8[S],ns[S]),x=h|0,A=Ia(n,s,28)^Gc(n,s,34)^Gc(n,s,39),I=Ba(n,s,28)^jc(n,s,34)^jc(n,s,39),F=n&a^n&i^a&i,_=s&o^s&c^o&c;w=g|0,v=E|0,g=m|0,E=y|0,m=d|0,y=f|0,{h:d,l:f}=En(l|0,u|0,b|0,x|0),l=i|0,u=c|0,i=a|0,c=o|0,a=n|0,o=s|0;const k=_8(x,I,_);n=M8(k,b,A,F),s=k|0}({h:n,l:s}=En(this.Ah|0,this.Al|0,n|0,s|0)),{h:a,l:o}=En(this.Bh|0,this.Bl|0,a|0,o|0),{h:i,l:c}=En(this.Ch|0,this.Cl|0,i|0,c|0),{h:l,l:u}=En(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=En(this.Eh|0,this.El|0,d|0,f|0),{h:m,l:y}=En(this.Fh|0,this.Fl|0,m|0,y|0),{h:g,l:E}=En(this.Gh|0,this.Gl|0,g|0,E|0),{h:w,l:v}=En(this.Hh|0,this.Hl|0,w|0,v|0),this.set(n,s,a,o,i,c,l,u,d,f,m,y,g,E,w,v)}roundClean(){es(ns,ss)}destroy(){es(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class V8 extends R1{constructor(){super(48),this.Ah=Nt[0]|0,this.Al=Nt[1]|0,this.Bh=Nt[2]|0,this.Bl=Nt[3]|0,this.Ch=Nt[4]|0,this.Cl=Nt[5]|0,this.Dh=Nt[6]|0,this.Dl=Nt[7]|0,this.Eh=Nt[8]|0,this.El=Nt[9]|0,this.Fh=Nt[10]|0,this.Fl=Nt[11]|0,this.Gh=Nt[12]|0,this.Gl=Nt[13]|0,this.Hh=Nt[14]|0,this.Hl=Nt[15]|0}}const Hd=Hc(()=>new $8),W8=Hc(()=>new R1),q8=Hc(()=>new V8),H1=Hd;function $1(e,t){const r=t||"hex",n=H1(Or(e,{strict:!1})?wn(e):e);return r==="bytes"?n:Fe(n)}function Y8(e){const{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),s=$1(t,"bytes");return s.set([r],0),n==="bytes"?s:wt(s)}function G1(e){const{commitments:t,version:r}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Y8({commitment:a,to:n,version:r}));return s}const j1=6,V1=32,$d=4096,W1=V1*$d,q1=W1*j1-1-1*$d*j1,Y1=1;class K8 extends ${constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class K1 extends ${constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Z8 extends ${constructor({hash:t,size:r}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class X8 extends ${constructor({hash:t,version:r}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Y1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function Q8(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),r=typeof e.data=="string"?or(e.data):e.data,n=lt(r);if(!n)throw new K1;if(n>q1)throw new K8({maxSize:q1,size:n});const s=[];let a=!0,o=0;for(;a;){const i=_d(new Uint8Array(W1));let c=0;for(;c<$d;){const l=r.slice(o,o+(V1-1));if(i.pushByte(0),i.pushBytes(l),l.length<31){i.pushByte(128),a=!1;break}c++,o+=31}s.push(i)}return t==="bytes"?s.map(i=>i.bytes):s.map(i=>wt(i.bytes))}function Z1(e){const{data:t,kzg:r,to:n}=e,s=e.blobs??Q8({data:t,to:n}),a=e.commitments??Nd({blobs:s,kzg:r,to:n}),o=e.proofs??Ld({blobs:s,commitments:a,kzg:r,to:n}),i=[];for(let c=0;c<s.length;c++)i.push({blob:s[c],commitment:a[c],proof:o[c]});return i}let Ct=class extends ${constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};class Gd extends ${constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class J8 extends ${constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class ev extends ${constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
67
67
  `),{name:"ChainNotFoundError"})}}class X1 extends ${constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}let Fa=class extends ${constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};class Ua extends ${constructor({cause:t,message:r}={}){var s;const n=(s=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ua,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Ua,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});let as=class extends ${constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Xt(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(as,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class jd extends ${constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Xt(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(jd,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Vd extends ${constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Vd,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Wd extends ${constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
@@ -103,10 +103,10 @@ ${bS(m)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessa
103
103
  `)})}}Object.defineProperty(ti,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class js extends Jt{constructor(t){super(t,{code:js.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(js,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class is extends Jt{constructor(t){super(t,{code:is.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
104
104
  `)})}}Object.defineProperty(is,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ri extends Jt{constructor(t){super(t,{code:ri.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ri,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ni extends Jt{constructor(t){super(t,{code:ni.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ni,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class si extends Jt{constructor(t){super(t,{code:si.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(si,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Vs extends Jt{constructor(t,{method:r}={}){super(t,{code:Vs.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Vs,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Ga extends Jt{constructor(t){super(t,{code:Ga.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Ga,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class ai extends Jt{constructor(t){super(t,{code:ai.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(ai,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class ja extends pr{constructor(t){super(t,{code:ja.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(ja,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class oi extends pr{constructor(t){super(t,{code:oi.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(oi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ii extends pr{constructor(t,{method:r}={}){super(t,{code:ii.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(ii,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ci extends pr{constructor(t){super(t,{code:ci.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ci,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class li extends pr{constructor(t){super(t,{code:li.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(li,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ui extends pr{constructor(t){super(t,{code:ui.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ui,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Va extends pr{constructor(t){super(t,{code:Va.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(Va,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class di extends pr{constructor(t){super(t,{code:di.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(di,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class pi extends pr{constructor(t){super(t,{code:pi.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(pi,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class fi extends pr{constructor(t){super(t,{code:fi.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(fi,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class mi extends pr{constructor(t){super(t,{code:mi.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(mi,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class hi extends pr{constructor(t){super(t,{code:hi.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(hi,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Wa extends pr{constructor(t){super(t,{code:Wa.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Wa,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class vS extends Jt{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function ll(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof $?e.walk(s=>(s==null?void 0:s.code)===Ua.code):e;return n instanceof $?new Ua({cause:e,message:n.details}):Ua.nodeMessage.test(r)?new Ua({cause:e,message:e.details}):as.nodeMessage.test(r)?new as({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):jd.nodeMessage.test(r)?new jd({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Vd.nodeMessage.test(r)?new Vd({cause:e,nonce:t==null?void 0:t.nonce}):Wd.nodeMessage.test(r)?new Wd({cause:e,nonce:t==null?void 0:t.nonce}):qd.nodeMessage.test(r)?new qd({cause:e,nonce:t==null?void 0:t.nonce}):Yd.nodeMessage.test(r)?new Yd({cause:e}):Kd.nodeMessage.test(r)?new Kd({cause:e,gas:t==null?void 0:t.gas}):Zd.nodeMessage.test(r)?new Zd({cause:e,gas:t==null?void 0:t.gas}):Xd.nodeMessage.test(r)?new Xd({cause:e}):Oa.nodeMessage.test(r)?new Oa({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new zo({cause:e})}function kp(e,{docsPath:t,...r}){const n=(()=>{const s=ll(e,r);return s instanceof zo?e:s})();return new Kb(n,{docsPath:t,...r})}function Ws(e,{format:t}){if(!t)return{};const r={};function n(a){const o=Object.keys(a);for(const i of o)i in e&&(r[i]=e[i]),a[i]&&typeof a[i]=="object"&&!Array.isArray(a[i])&&n(a[i])}const s=t(e||{});return n(s),r}function rn(e){const{account:t,maxFeePerGas:r,maxPriorityFeePerGas:n,to:s}=e,a=t?Ke(t):void 0;if(a&&!rt(a.address))throw new Ct({address:a.address});if(s&&!rt(s))throw new Ct({address:s});if(r&&r>Ls)throw new as({maxFeePerGas:r});if(n&&r&&n>r)throw new Oa({maxFeePerGas:r,maxPriorityFeePerGas:n})}async function ES(e,t){var s,a,o;const{account:r=e.account}=t;if(!r)throw new kn;const n=Ke(r);try{const{accessList:i,blockNumber:c,blockTag:l,data:u,gas:d,gasPrice:f,maxFeePerGas:m,maxPriorityFeePerGas:y,nonce:g,to:E,value:w,...v}=t,C=(typeof c=="bigint"?q(c):void 0)||l;rn(t);const D=(o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionRequest)==null?void 0:o.format,T=(D||_r)({...Ws(v,{format:D}),account:n,accessList:i,data:u,gas:d,gasPrice:f,maxFeePerGas:m,maxPriorityFeePerGas:y,nonce:g,to:E,value:w},"estimateGas"),{baseFeePerGas:h,gasLimit:b,priorityFeePerGas:x}=await e.request({method:"linea_estimateGas",params:C?[T,C]:[T]});return{baseFeePerGas:BigInt(h),gasLimit:BigInt(b),priorityFeePerGas:BigInt(x)}}catch(i){throw kp(i,{...t,account:n,chain:e.chain})}}const Cp={fees:{estimateFeesPerGas:Qb,async maxPriorityFeePerGas({block:e,client:t,request:r}){const n=await Qb({block:e,client:t,multiply:s=>s,request:r,type:"eip1559"});return n!=null&&n.maxPriorityFeePerGas?n.maxPriorityFeePerGas:null}}};async function Qb({client:e,multiply:t,request:r,type:n}){try{const s=await ES(e,{...r,account:r==null?void 0:r.account}),{priorityFeePerGas:a}=s,i=t(BigInt(s.baseFeePerGas))+a;return n==="legacy"?{gasPrice:i}:{maxFeePerGas:i,maxPriorityFeePerGas:a}}catch{return null}}const kS=p({...Cp,id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),CS=p({id:59140,name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build",apiUrl:"https://api-goerli.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),TS=p({...Cp,id:59141,name:"Linea Sepolia Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.linea.build"],webSocket:["wss://rpc.sepolia.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.lineascan.build",apiUrl:"https://api-sepolia.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:227427},ensRegistry:{address:"0x5B2636F0f2137B4aE722C01dd5122D7d3e9541f7",blockCreated:2395094},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:17168484}},ensTlds:[".linea.eth"],testnet:!0}),SS=p({id:59140,name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build",apiUrl:"https://goerli.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),ul=1,AS=p({...V,id:1135,name:"Lisk",network:"lisk",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.api.lisk.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.lisk.com",apiUrl:"https://blockscout.lisk.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xA9d71E1dd7ca26F26e656E66d6AA81ed7f745bf0"},l2OutputOracle:{[ul]:{address:"0x113cB99283AF242Da0A0C54347667edF531Aa7d6"}},portal:{[ul]:{address:"0x26dB93F8b8b4f7016240af62F7730979d353f9A7"}},l1StandardBridge:{[ul]:{address:"0x2658723Bf70c7667De6B25F99fcce13A16D25d08"}}},sourceId:ul}),dl=11155111,PS=p({...V,id:4202,network:"lisk-sepolia",name:"Lisk Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia-api.lisk.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.lisk.com",apiUrl:"https://sepolia-blockscout.lisk.com/api"}},contracts:{...V.contracts,l2OutputOracle:{[dl]:{address:"0xA0E35F56C318DE1bD5D9ca6A94Fe7e37C5663348"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[dl]:{address:"0xe3d90F21490686Ec7eF37BE788E02dfC12787264"}},l1StandardBridge:{[dl]:{address:"0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5"}}},testnet:!0,sourceId:dl}),IS=p({id:9496,name:"Load Alphanet",nativeCurrency:{name:"Testnet LOAD",symbol:"tLOAD",decimals:18},rpcUrls:{default:{http:["https://alphanet.load.network"]}},blockExplorers:{default:{name:"Load Alphanet Explorer",url:"https://explorer.load.network"}},testnet:!0}),BS=p({id:1337,name:"Localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),FS=p({id:15551,name:"LoopNetwork Mainnet",nativeCurrency:{name:"LOOP",symbol:"LOOP",decimals:18},rpcUrls:{default:{http:["https://api.mainnetloop.com"]}},blockExplorers:{default:{name:"LoopNetwork Blockchain Explorer",url:"https://explorer.mainnetloop.com/"}},testnet:!1}),US=p({id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network",apiUrl:"https://api.explorer.execution.mainnet.lukso.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:468183}}}),OS=p({id:4201,name:"LUKSO Testnet",nativeCurrency:{decimals:18,name:"LUKSO Testnet",symbol:"LYXt"},rpcUrls:{default:{http:["https://rpc.testnet.lukso.network"],webSocket:["wss://ws-rpc.testnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Testnet Explorer",url:"https://explorer.execution.testnet.lukso.network",apiUrl:"https://api.explorer.execution.testnet.lukso.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:605348}},testnet:!0}),DS=p({id:994873017,name:"Lumia Mainnet",network:"LumiaMainnet",nativeCurrency:{name:"Lumia",symbol:"LUMIA",decimals:18},rpcUrls:{default:{http:["https://mainnet-rpc.lumia.org"]}},blockExplorers:{default:{name:"Lumia Explorer",url:"https://explorer.lumia.org/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3975939}},testnet:!1}),_S=p({id:1952959480,name:"Lumia Testnet",network:"LumiaTestnet",nativeCurrency:{name:"Lumia",symbol:"LUMIA",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.lumia.org"]}},blockExplorers:{default:{name:"Lumia Testnet Explorer",url:"https://testnet-explorer.lumia.org/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2235063}},testnet:!0}),MS=p({id:96370,name:"Lumoz",nativeCurrency:{decimals:18,name:"Lumoz Token",symbol:"MOZ"},rpcUrls:{default:{http:["https://rpc.lumoz.org"]}},blockExplorers:{default:{name:"Lumoz Scan",url:"https://scan.lumoz.info"}},testnet:!1}),NS=p({id:105363,name:"Lumoz Testnet",nativeCurrency:{decimals:18,name:"Lumoz Testnet Token",symbol:"MOZ"},rpcUrls:{default:{http:["https://testnet-rpc.lumoz.org"]}},testnet:!0}),LS=p({id:721,name:"Lycan",nativeCurrency:{decimals:18,name:"Lycan",symbol:"LYC"},rpcUrls:{default:{http:["https://rpc.lycanchain.com","https://us-east.lycanchain.com","https://us-west.lycanchain.com","https://eu-north.lycanchain.com","https://eu-west.lycanchain.com","https://asia-southeast.lycanchain.com"],webSocket:["wss://rpc.lycanchain.com","wss://us-east.lycanchain.com","wss://us-west.lycanchain.com","wss://eu-north.lycanchain.com","wss://eu-west.lycanchain.com","wss://asia-southeast.lycanchain.com"]}},blockExplorers:{default:{name:"Lycan Explorer",url:"https://explorer.lycanchain.com"}}}),zS=p({id:957,name:"Lyra Chain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.lyra.finance"]}},blockExplorers:{default:{name:"Lyra Explorer",url:"https://explorer.lyra.finance",apiUrl:"https://explorer.lyra.finance/api/v2"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1935198}}}),RS=p({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),HS=p({id:595,name:"Mandala TC9",network:"mandala",nativeCurrency:{name:"Mandala",symbol:"mACA",decimals:18},rpcUrls:{default:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]}},blockExplorers:{default:{name:"Mandala Blockscout",url:"https://blockscout.mandala.aca-staging.network",apiUrl:"https://blockscout.mandala.aca-staging.network/api"}},testnet:!0}),$S=p({id:169,name:"Manta Pacific Mainnet",network:"manta",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.manta.network/http"]}},blockExplorers:{default:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network",apiUrl:"https://pacific-explorer.manta.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:332890}}}),GS=p({id:3441006,name:"Manta Pacific Sepolia Testnet",network:"manta-sepolia",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.sepolia-testnet.manta.network/http"]}},blockExplorers:{default:{name:"Manta Sepolia Testnet Explorer",url:"https://pacific-explorer.sepolia-testnet.manta.network",apiUrl:"https://pacific-explorer.sepolia-testnet.manta.network/api"}},contracts:{multicall3:{address:"0xca54918f7B525C8df894668846506767412b53E3",blockCreated:479584}},testnet:!0}),jS=p({id:3441005,name:"Manta Pacific Testnet",network:"manta-testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://manta-testnet.calderachain.xyz/http"]}},blockExplorers:{default:{name:"Manta Testnet Explorer",url:"https://pacific-explorer.testnet.manta.network",apiUrl:"https://pacific-explorer.testnet.manta.network/api"}},contracts:{multicall3:{address:"0x211B1643b95Fe76f11eD8880EE810ABD9A4cf56C",blockCreated:419915}},testnet:!0}),VS=p({id:5e3,name:"Mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Explorer",url:"https://mantlescan.xyz/",apiUrl:"https://api.mantlescan.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),WS=p({id:5003,name:"Mantle Sepolia Testnet",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.sepolia.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Testnet Explorer",url:"https://explorer.sepolia.mantle.xyz/",apiUrl:"https://explorer.sepolia.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4584012}},testnet:!0}),qS=p({id:5001,name:"Mantle Testnet",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.testnet.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Testnet Explorer",url:"https://explorer.testnet.mantle.xyz",apiUrl:"https://explorer.testnet.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:561333}},testnet:!0}),YS=p({id:5887,name:"MANTRA DuKong EVM Testnet",nativeCurrency:{decimals:18,name:"MANTRA",symbol:"MANTRA"},rpcUrls:{default:{http:["https://evm.dukong.mantrachain.io"]}},blockExplorers:{default:{name:"MANTRAScan",url:"https://mantrascan.io/dukong"}},testnet:!0}),KS=p({id:5888,name:"MANTRA EVM",nativeCurrency:{decimals:18,name:"OM",symbol:"OM"},rpcUrls:{default:{http:["https://evm.mantrachain.io"],webSocket:["https://evm.mantrachain.io/ws"]}},blockExplorers:{default:{name:"MANTRA Scan",url:"https://mantrascan.io/mainnet"}}}),ZS=p({id:22776,name:"MAP Protocol",nativeCurrency:{decimals:18,name:"MAPO",symbol:"MAPO"},rpcUrls:{default:{http:["https://rpc.maplabs.io"]}},blockExplorers:{default:{name:"MAPO Scan",url:"https://maposcan.io"}},testnet:!1}),XS=p({id:698,name:"Matchain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://rpc.matchain.io"]}},blockExplorers:{default:{name:"Matchain Scan",url:"https://matchscan.io"}}}),QS=p({id:699,name:"Matchain Testnet",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.matchain.io"]}},blockExplorers:{default:{name:"Matchain Scan",url:"https://testnet.matchscan.io"}},testnet:!0}),JS=p({id:29548,name:"MCH Verse",nativeCurrency:{name:"Oasys",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.oasys.mycryptoheroes.net"]}},blockExplorers:{default:{name:"MCH Verse Explorer",url:"https://explorer.oasys.mycryptoheroes.net",apiUrl:"https://explorer.oasys.mycryptoheroes.net/api"}},testnet:!1}),eA=p({id:6342,blockTime:1e3,name:"MegaETH Testnet",nativeCurrency:{name:"MegaETH Testnet Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://carrot.megaeth.com/rpc"],webSocket:["wss://carrot.megaeth.com/ws"]}},blockExplorers:{default:{name:"MegaETH Testnet Explorer",url:"https://www.megaexplorer.xyz/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}},testnet:!0}),tA=p({id:7078815900,name:"Mekong Pectra Devnet",nativeCurrency:{name:"eth",symbol:"eth",decimals:18},rpcUrls:{default:{http:["https://rpc.mekong.ethpandaops.io"]}},blockExplorers:{default:{name:"Block Explorer",url:"https://explorer.mekong.ethpandaops.io"}},testnet:!0}),rA=p({id:333000333,name:"Meld",nativeCurrency:{decimals:18,name:"Meld",symbol:"MELD"},rpcUrls:{default:{http:["https://rpc-1.meld.com"]}},blockExplorers:{default:{name:"MELDscan",url:"https://meldscan.io"}},contracts:{multicall3:{address:"0x769ee5a8e82c15c1b6e358f62ac8eb6e3abe8dc5",blockCreated:360069}}}),nA=p({id:4352,name:"MemeCore",nativeCurrency:{decimals:18,name:"M",symbol:"M"},rpcUrls:{default:{http:["https://rpc.memecore.net"],webSocket:["wss://ws.memecore.net"]}},blockExplorers:{default:{name:"MemeCore Explorer",url:"https://memecorescan.io",apiUrl:"https://api.memecorescan.io/api"},okx:{name:"MemeCore Explorer",url:"https://web3.okx.com/explorer/memecore"},memecore:{name:"MemeCore Explorer",url:"https://blockscout.memecore.com",apiUrl:"https://blockscout.memecore.com/api"}}}),sA=p({id:43521,name:"Formicarium",nativeCurrency:{decimals:18,name:"M",symbol:"M"},rpcUrls:{default:{http:["https://rpc.formicarium.memecore.net"],webSocket:["wss://ws.formicarium.memecore.net"]}},blockExplorers:{default:{name:"MemeCore Testnet Explorer",url:"https://formicarium.memecorescan.io"},okx:{name:"MemeCore Testnet Explorer",url:"https://web3.okx.com/explorer/formicarium-testnet"},memecore:{name:"MemeCore Testnet Explorer",url:"https://formicarium.blockscout.memecore.com",apiUrl:"https://formicarium.blockscout.memecore.com/api"}},testnet:!0}),aA=p({id:4200,name:"Merlin",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc.merlinchain.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://scan.merlinchain.io",apiUrl:"https://scan.merlinchain.io/api"}}}),oA=p({id:4203,name:"Merlin Erigon Testnet",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://testnet-erigon-rpc.merlinchain.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://testnet-erigon-scan.merlinchain.io",apiUrl:"https://testnet-erigon-scan.merlinchain.io/api"}},testnet:!0}),iA=p({id:571,name:"MetaChain Mainnet",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://rpc.metatime.com"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://explorer.metatime.com"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}}}),cA=p({id:1453,name:"MetaChain Istanbul",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://istanbul-rpc.metachain.dev"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://istanbul-explorer.metachain.dev"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}},testnet:!0}),lA=p({id:11,name:"Metadium Network",nativeCurrency:{decimals:18,name:"META",symbol:"META"},rpcUrls:{default:{http:["https://api.metadium.com/prod"]}},blockExplorers:{default:{name:"Metadium Explorer",url:"https://explorer.metadium.com"}},testnet:!1}),pl=1,uA=p({...V,id:1750,name:"Metal L2",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.metall2.com"],webSocket:["wss://rpc.metall2.com"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.metall2.com",apiUrl:"https://explorer.metall2.com/api"}},contracts:{...V.contracts,l2OutputOracle:{[pl]:{address:"0x3B1F7aDa0Fcc26B13515af752Dd07fB1CAc11426"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},portal:{[pl]:{address:"0x3F37aBdE2C6b5B2ed6F8045787Df1ED1E3753956"}},l1StandardBridge:{[pl]:{address:"0x6d0f65D59b55B0FEC5d2d15365154DcADC140BF3"}}},sourceId:pl}),dA=p({id:82,name:"Meter",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpc.meter.io"]}},blockExplorers:{default:{name:"MeterScan",url:"https://scan.meter.io"}}}),pA=p({id:83,name:"Meter Testnet",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpctest.meter.io"]}},blockExplorers:{default:{name:"MeterTestnetScan",url:"https://scan-warringstakes.meter.io"}}}),fA=p({id:1088,name:"Metis",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://metis.rpc.hypersync.xyz","https://metis-pokt.nodies.app","https://api.blockeden.xyz/metis/67nCBdZQSH9z3YqDDjdm","https://metis-andromeda.rpc.thirdweb.com","https://metis-andromeda.gateway.tenderly.co","https://metis.api.onfinality.io/public","https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"],webSocket:["wss://metis-rpc.publicnode.com","wss://metis.drpc.org"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io",apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),mA=p({id:599,name:"Metis Goerli",nativeCurrency:{decimals:18,name:"Metis Goerli",symbol:"METIS"},rpcUrls:{default:{http:["https://goerli.gateway.metisdevops.link"]}},blockExplorers:{default:{name:"Metis Goerli Explorer",url:"https://goerli.explorer.metisdevops.link",apiUrl:"https://goerli.explorer.metisdevops.link/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1006207}}}),hA=p({id:59902,name:"Metis Sepolia",nativeCurrency:{decimals:18,name:"Test Metis",symbol:"tMETIS"},rpcUrls:{default:{http:["https://sepolia.metisdevops.link","https://metis-sepolia-rpc.publicnode.com","https://metis-sepolia.gateway.tenderly.co"],webSocket:["wss://metis-sepolia-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Metis Sepolia Explorer",url:"https://sepolia-explorer.metisdevops.link",apiUrl:"https://sepolia-explorer.metisdevops.link/api-docs"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:224185}}}),bA=p({id:7518,name:"MEVerse Chain Mainnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversemainnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://www.meversescan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:86881340}}}),yA=p({id:4759,name:"MEVerse Chain Testnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversetestnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.meversescan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:64371115}},testnet:!0}),gA=p({id:185,name:"Mint Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.mintchain.io"]}},blockExplorers:{default:{name:"Mintchain explorer",url:"https://explorer.mintchain.io"}},testnet:!1}),xA=p({id:1686,name:"Mint Sepolia Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.mintchain.io"]}},blockExplorers:{default:{name:"Mintchain Testnet explorer",url:"https://testnet-explorer.mintchain.io"}},testnet:!0}),wA=p({id:124832,name:"Mitosis Testnet",nativeCurrency:{name:"MITO",symbol:"MITO",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.mitosis.org"]}},blockExplorers:{default:{name:"Mitosis testnet explorer",url:"https://testnet.mitosiscan.xyz"}},testnet:!0}),fl=1,vA=p({...V,id:34443,name:"Mode Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.mode.network"]}},blockExplorers:{default:{name:"Modescan",url:"https://modescan.io"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2465882},l2OutputOracle:{[fl]:{address:"0x4317ba146D4933D889518a3e5E11Fe7a53199b04"}},portal:{[fl]:{address:"0x8B34b14c7c7123459Cf3076b8Cb929BE097d0C07"}},l1StandardBridge:{[fl]:{address:"0x735aDBbE72226BD52e818E7181953f42E3b0FF21"}}},sourceId:fl}),ml=11155111,EA=p({...V,id:919,name:"Mode Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.mode.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia.explorer.mode.network",apiUrl:"https://sepolia.explorer.mode.network/api"}},contracts:{...V.contracts,l2OutputOracle:{[ml]:{address:"0x2634BD65ba27AB63811c74A63118ACb312701Bfa",blockCreated:3778393}},portal:{[ml]:{address:"0x320e1580effF37E008F1C92700d1eBa47c1B23fD",blockCreated:3778395}},l1StandardBridge:{[ml]:{address:"0xbC5C679879B2965296756CD959C3C739769995E2",blockCreated:3778392}},multicall3:{address:"0xBAba8373113Fb7a68f195deF18732e01aF8eDfCF",blockCreated:3019007}},testnet:!0,sourceId:ml}),kA=p({id:143,name:"Monad",blockTime:400,nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://rpc.monad.xyz","https://rpc1.monad.xyz"],webSocket:["wss://rpc.monad.xyz","wss://rpc1.monad.xyz"]}},blockExplorers:{default:{name:"MonadVision",url:"https://monadvision.com"},monadscan:{name:"Monadscan",url:"https://monadscan.com",apiUrl:"https://api.monadscan.com/api"}},testnet:!1,contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:9248132}}}),CA=p({id:10143,name:"Monad Testnet",blockTime:400,nativeCurrency:{name:"Testnet MON Token",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.monad.xyz"]}},blockExplorers:{default:{name:"Monad Testnet explorer",url:"https://testnet.monadexplorer.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:251449}},testnet:!0}),TA=p({id:1287,name:"Moonbase Alpha",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["https://rpc.api.moonbase.moonbeam.network"],webSocket:["wss://wss.api.moonbase.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonbase.moonscan.io",apiUrl:"https://moonbase.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1850686}},testnet:!0}),SA=p({id:1284,name:"Moonbeam",nativeCurrency:{decimals:18,name:"GLMR",symbol:"GLMR"},rpcUrls:{default:{http:["https://rpc.api.moonbeam.network"],webSocket:["wss://wss.api.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonscan.io",apiUrl:"https://api-moonbeam.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:609002}},testnet:!1}),AA=p({id:1281,name:"Moonbeam Development Node",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["http://127.0.0.1:9944"],webSocket:["wss://127.0.0.1:9944"]}}}),PA=p({id:1285,name:"Moonriver",nativeCurrency:{decimals:18,name:"MOVR",symbol:"MOVR"},rpcUrls:{default:{http:["https://rpc.api.moonriver.moonbeam.network"],webSocket:["wss://wss.api.moonriver.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonriver.moonscan.io",apiUrl:"https://api-moonriver.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1597904}},testnet:!1}),IA=p({id:2818,name:"Morph",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.morphl2.io"],webSocket:["wss://rpc.morphl2.io:8443"]}},blockExplorers:{default:{name:"Morph Explorer",url:"https://explorer.morphl2.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3654913}},testnet:!1}),BA=p({id:2810,name:"Morph Holesky",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-quicknode-holesky.morphl2.io"],webSocket:["wss://rpc-quicknode-holesky.morphl2.io"]}},blockExplorers:{default:{name:"Morph Holesky Explorer",url:"https://explorer-holesky.morphl2.io",apiUrl:"https://explorer-api-holesky.morphl2.io/api?"}},testnet:!0}),FA=p({id:2710,name:"Morph Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.morphl2.io"]}},blockExplorers:{default:{name:"Morph Testnet Explorer",url:"https://explorer-testnet.morphl2.io",apiUrl:"https://explorer-api-testnet.morphl2.io/api"}},testnet:!0}),UA=p({id:5551,name:"Nahmii 2 Mainnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://l2.nahmii.io"]}},blockExplorers:{default:{name:"Nahmii 2 Explorer",url:"https://explorer.n2.nahmii.io"}},testnet:!1}),OA=p({id:22222,name:"Nautilus Mainnet",nativeCurrency:{name:"ZBC",symbol:"ZBC",decimals:9},rpcUrls:{default:{http:["https://api.nautilus.nautchain.xyz"]}},blockExplorers:{default:{name:"NautScan",url:"https://nautscan.com"}}}),DA=p({id:397,name:"NEAR Protocol",nativeCurrency:{decimals:18,name:"NEAR",symbol:"NEAR"},rpcUrls:{default:{http:["https://eth-rpc.mainnet.near.org"]}},blockExplorers:{default:{name:"NEAR Explorer",url:"https://eth-explorer.near.org"}},testnet:!1}),_A=p({id:398,name:"NEAR Protocol Testnet",nativeCurrency:{decimals:18,name:"NEAR",symbol:"NEAR"},rpcUrls:{default:{http:["https://eth-rpc.testnet.near.org"]}},blockExplorers:{default:{name:"NEAR Explorer",url:"https://eth-explorer-testnet.near.org"}},testnet:!0}),MA=p({id:245022926,name:"Neon EVM DevNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://devnet.neonevm.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://devnet.neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:205206112}},testnet:!0}),NA=p({id:245022934,network:"neonMainnet",name:"Neon EVM MainNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://neon-proxy-mainnet.solana.p2p.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:206545524}},testnet:!1}),LA=p({id:47763,name:"Neo X Mainnet",nativeCurrency:{name:"Gas",symbol:"GAS",decimals:18},rpcUrls:{default:{http:["https://mainnet-1.rpc.banelabs.org","https://mainnet-2.rpc.banelabs.org"]}},blockExplorers:{default:{name:"Neo X - Explorer",url:"https://xexplorer.neo.org"}},testnet:!1}),zA=p({id:12227332,name:"Neo X Testnet T4",nativeCurrency:{name:"Gas",symbol:"GAS",decimals:18},rpcUrls:{default:{http:["https://testnet.rpc.banelabs.org/"]}},blockExplorers:{default:{name:"neox-scan",url:"https://xt4scan.ngd.network"}},testnet:!0}),RA=p({id:1012,name:"Newton",nativeCurrency:{name:"Newton",symbol:"NEW",decimals:18},rpcUrls:{default:{http:["https://global.rpc.mainnet.newtonproject.org"]}},blockExplorers:{default:{name:"NewFi explorer",url:"https://explorer.newtonproject.org/"}},testnet:!1}),HA=p({id:4242,name:"Nexi",nativeCurrency:{name:"Nexi",symbol:"NEXI",decimals:18},rpcUrls:{default:{http:["https://rpc.chain.nexi.technology"]}},blockExplorers:{default:{name:"NexiScan",url:"https://www.nexiscan.com",apiUrl:"https://www.nexiscan.com/api"}},contracts:{multicall3:{address:"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E",blockCreated:25770160}}}),$A=p({id:240,name:"Nexilix Smart Chain",nativeCurrency:{decimals:18,name:"Nexilix",symbol:"NEXILIX"},rpcUrls:{default:{http:["https://rpcurl.pos.nexilix.com"]}},blockExplorers:{default:{name:"NexilixScan",url:"https://scan.nexilix.com"}},contracts:{multicall3:{address:"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244",blockCreated:74448}}}),GA=p({id:6900,name:"Nibiru",nativeCurrency:{decimals:18,name:"NIBI",symbol:"NIBI"},rpcUrls:{default:{http:["https://evm-rpc.nibiru.fi"]}},blockExplorers:{default:{name:"NibiScan",url:"https://nibiscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:19587573}}}),jA=p({id:200024,name:"Nitrograph Testnet",testnet:!0,rpcUrls:{default:{http:["https://rpc-testnet.nitrograph.foundation"]}},nativeCurrency:{name:"Nitro",symbol:"NOS",decimals:18},blockExplorers:{default:{url:"https://explorer-testnet.nitrograph.foundation",name:"Nitrograph Explorer"}}}),VA=p({id:166,name:"Nomina",nativeCurrency:{name:"Nomina",symbol:"NOM",decimals:18},rpcUrls:{default:{http:["https://mainnet.nomina.io"],webSocket:["wss://mainnet.nomina.io"]}},blockExplorers:{default:{name:"Nomina Explorer",url:"https://nomscan.io"}},testnet:!1}),WA=p({id:4090,network:"oasis-testnet",name:"Oasis Testnet",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.oasis.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://oasis.ftnscan.com",apiUrl:"https://oasis.ftnscan.com/api"}},testnet:!0}),qA=p({id:248,name:"Oasys",nativeCurrency:{name:"Oasys",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.oasys.games"]}},blockExplorers:{default:{name:"OasysScan",url:"https://scan.oasys.games",apiUrl:"https://scan.oasys.games/api"}}}),YA=p({id:911867,name:"Odyssey Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://odyssey.ithaca.xyz"]}},blockExplorers:{default:{name:"Odyssey Explorer",url:"https://odyssey-explorer.ithaca.xyz",apiUrl:"https://odyssey-explorer.ithaca.xyz/api"}},testnet:!0}),KA=p({id:66,name:"OKC",nativeCurrency:{decimals:18,name:"OKT",symbol:"OKT"},rpcUrls:{default:{http:["https://exchainrpc.okex.org"]}},blockExplorers:{default:{name:"oklink",url:"https://www.oklink.com/okc"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10364792}}}),ZA=p({id:311,name:"Omax Mainnet",nativeCurrency:{decimals:18,name:"OMAX",symbol:"OMAX"},rpcUrls:{default:{http:["https://mainapi.omaxray.com"]}},blockExplorers:{default:{name:"Omax Explorer",url:"https://omaxscan.com"}},testnet:!1}),XA=p({id:166,name:"Omni",nativeCurrency:{name:"Omni",symbol:"OMNI",decimals:18},rpcUrls:{default:{http:["https://mainnet.omni.network"],webSocket:["wss://mainnet.omni.network"]}},blockExplorers:{default:{name:"OmniScan",url:"https://omniscan.network"}},testnet:!1}),QA=p({id:164,name:"Omni Omega",nativeCurrency:{name:"Omni",symbol:"OMNI",decimals:18},rpcUrls:{default:{http:["https://omega.omni.network"],webSocket:["wss://omega.omni.network"]}},blockExplorers:{default:{name:"Omega OmniScan",url:"https://omega.omniscan.network/"}},testnet:!0}),JA=p({id:309075,name:"One World Chain Mainnet",nativeCurrency:{decimals:18,name:"OWCT",symbol:"OWCT"},rpcUrls:{default:{http:["https://mainnet-rpc.oneworldchain.org"]}},blockExplorers:{default:{name:"One World Explorer",url:"https://mainnet.oneworldchain.org"}},testnet:!1}),eP=p({id:9700,name:"OORT MainnetDev",nativeCurrency:{decimals:18,name:"OORT",symbol:"OORT"},rpcUrls:{default:{http:["https://dev-rpc.oortech.com"]}},blockExplorers:{default:{name:"OORT MainnetDev Explorer",url:"https://dev-scan.oortech.com"}}}),hl=56,tP=p({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opBNB (BSCScan)",url:"https://opbnb.bscscan.com",apiUrl:"https://api-opbnb.bscscan.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881},l2OutputOracle:{[hl]:{address:"0x153CAB79f4767E2ff862C94aa49573294B13D169"}},portal:{[hl]:{address:"0x1876EA7702C0ad0C6A2ae6036DE7733edfBca519"}},l1StandardBridge:{[hl]:{address:"0xF05F0e4362859c3331Cb9395CBC201E3Fa6757Ea"}}},sourceId:hl}),bl=97,rP=p({id:5611,name:"opBNB Testnet",nativeCurrency:{decimals:18,name:"tBNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://opbnb-testnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://testnet.opbnbscan.com"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3705108},l2OutputOracle:{[bl]:{address:"0xFf2394Bb843012562f4349C6632a0EcB92fC8810"}},portal:{[bl]:{address:"0x4386C8ABf2009aC0c263462Da568DD9d46e52a31"}},l1StandardBridge:{[bl]:{address:"0x677311Fd2cCc511Bbc0f581E8d9a07B033D5E840"}}},testnet:!0,sourceId:bl}),nP=p({id:1612,name:"OpenLedger",nativeCurrency:{name:"Open",symbol:"OPEN",decimals:18},rpcUrls:{default:{http:["https://rpc.openledger.xyz"]}},blockExplorers:{default:{name:"OpenLedger Explorer",url:"https://scan.openledger.xyz"}},testnet:!1}),bi=1,sP=p({...V,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...V.contracts,disputeGameFactory:{[bi]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[bi]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[bi]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[bi]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:bi}),yl=5,aP=p({...V,id:420,name:"Optimism Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io",apiUrl:"https://goerli-optimism.etherscan.io/api"}},contracts:{...V.contracts,l2OutputOracle:{[yl]:{address:"0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},portal:{[yl]:{address:"0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"}},l1StandardBridge:{[yl]:{address:"0x636Af16bf2f682dD3109e60102b8E1A089FedAa8"}}},testnet:!0,sourceId:yl}),yi=11155111,oP=p({...V,id:11155420,name:"OP Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com",apiUrl:"https://optimism-sepolia.blockscout.com/api"}},contracts:{...V.contracts,disputeGameFactory:{[yi]:{address:"0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1"}},l2OutputOracle:{[yi]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[yi]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[yi]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:yi}),iP=p({id:62050,name:"Optopia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-mainnet.optopia.ai"]}},blockExplorers:{default:{name:"Optopia Explorer",url:"https://scan.optopia.ai"}},testnet:!1}),cP=p({id:62049,name:"Optopia Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.optopia.ai"]}},blockExplorers:{default:{name:"Optopia Explorer",url:"https://scan-testnet.optopia.ai"}},testnet:!0}),lP=p({id:291,name:"Orderly",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.orderly.network"]}},blockExplorers:{default:{name:"Orderly Explorer",url:"https://explorer.orderly.network"}},testnet:!1}),uP=p({id:4460,name:"Orderly Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://l2-orderly-l2-4460-sepolia-8tc3sd7dvy.t.conduit.xyz"]}},blockExplorers:{default:{name:"Orderly Explorer",url:"https://explorerl2new-orderly-l2-4460-sepolia-8tc3sd7dvy.t.conduit.xyz"}},testnet:!0}),dP=p({id:41144114,name:"Otim Devnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["http://devnet.otim.xyz"]}},contracts:{batchInvoker:{address:"0x5FbDB2315678afecb367f032d93F642f64180aa3"}}}),pP=p({id:11297108109,name:"Palm",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}}}),fP=p({id:11297108099,name:"Palm Testnet",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}},testnet:!0}),mP=p({id:3338,name:"Peaq",nativeCurrency:{decimals:18,name:"peaq",symbol:"PEAQ"},rpcUrls:{default:{http:["https://quicknode1.peaq.xyz","https://quicknode2.peaq.xyz","https://quicknode3.peaq.xyz"],webSocket:["wss://quicknode1.peaq.xyz","wss://quicknode2.peaq.xyz","wss://quicknode3.peaq.xyz"]}},blockExplorers:{default:{name:"Subscan",url:"https://peaq.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3566354}}}),gl=1,hP=p({id:424,network:"pgn",name:"PGN",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Explorer",url:"https://explorer.publicgoods.network",apiUrl:"https://explorer.publicgoods.network/api"}},contracts:{l2OutputOracle:{[gl]:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3380209},portal:{[gl]:{address:"0xb26Fd985c5959bBB382BAFdD0b879E149e48116c"}},l1StandardBridge:{[gl]:{address:"0xD0204B9527C1bA7bD765Fa5CCD9355d38338272b"}}},formatters:ap,sourceId:gl}),xl=11155111,bP=p({id:58008,network:"pgn-testnet",name:"PGN",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network",apiUrl:"https://explorer.sepolia.publicgoods.network/api"}},contracts:{l2OutputOracle:{[xl]:{address:"0xD5bAc3152ffC25318F848B3DD5dA6C85171BaEEe"}},portal:{[xl]:{address:"0xF04BdD5353Bb0EFF6CA60CfcC78594278eBfE179"}},l1StandardBridge:{[xl]:{address:"0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},formatters:ap,sourceId:xl,testnet:!0}),yP=p({id:13381,name:"Phoenix Blockchain",nativeCurrency:{name:"Phoenix",symbol:"PHX",decimals:18},rpcUrls:{default:{http:["https://rpc.phoenixplorer.com"]}},blockExplorers:{default:{name:"Phoenixplorer",url:"https://phoenixplorer.com",apiUrl:"https://phoenixplorer.com/api"}},contracts:{multicall3:{address:"0x498cF757a575cFF2c2Ed9f532f56Efa797f86442",blockCreated:5620192}}}),gP=p({id:7070,name:"Planq Mainnet",nativeCurrency:{decimals:18,name:"PLQ",symbol:"PLQ"},rpcUrls:{default:{http:["https://planq-rpc.nodies.app","https://evm-rpc.planq.network","https://jsonrpc.planq.nodestake.top"]}},blockExplorers:{default:{name:"Planq Explorer",url:"https://evm.planq.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:8470015}},testnet:!1}),xP=p({id:9745,name:"Plasma",blockTime:1e3,nativeCurrency:{name:"Plasma",symbol:"XPL",decimals:18},rpcUrls:{default:{http:["https://rpc.plasma.to"]}},blockExplorers:{default:{name:"PlasmaScan",url:"https://plasmascan.to"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}}}),wP=p({id:9747,name:"Plasma Devnet",nativeCurrency:{name:"Devnet Plasma",symbol:"XPL",decimals:18},rpcUrls:{default:{http:["https://devnet-rpc.plasma.to"]}},testnet:!0,contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}}}),vP=p({id:9746,name:"Plasma Testnet",nativeCurrency:{name:"Testnet Plasma",symbol:"XPL",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.plasma.to"]}},blockExplorers:{default:{name:"RouteScan",url:"https://testnet.plasmascan.to"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}},testnet:!0}),EP=p({...ur,id:1612127,name:"PlayFi Albireo Testnet",network:"albireo",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://albireo-rpc.playfi.ai"],webSocket:["wss://albireo-rpc-ws.playfi.ai/ws"]}},blockExplorers:{default:{name:"PlayFi Albireo Explorer",url:"https://albireo-explorer.playfi.ai"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),kP=p({id:242,name:"Plinga",nativeCurrency:{name:"Plinga",symbol:"PLINGA",decimals:18},rpcUrls:{default:{http:["https://rpcurl.mainnet.plgchain.com"]}},blockExplorers:{default:{name:"Plgscan",url:"https://www.plgscan.com"}},contracts:{multicall3:{address:"0x0989576160f2e7092908BB9479631b901060b6e4",blockCreated:204489}}}),CP=p({id:98865,name:"Plume (Legacy)",nativeCurrency:{name:"Plume Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.plumenetwork.xyz"],webSocket:["wss://rpc.plumenetwork.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.plumenetwork.xyz",apiUrl:"https://explorer.plumenetwork.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:48577}},sourceId:1}),TP=p({id:98864,name:"Plume Devnet (Legacy)",nativeCurrency:{name:"Plume Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://test-rpc.plumenetwork.xyz"],webSocket:["wss://test-rpc.plumenetwork.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://test-explorer.plumenetwork.xyz",apiUrl:"https://test-explorer.plumenetwork.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:481948}},testnet:!0,sourceId:11155111}),SP=p({id:98866,name:"Plume",nativeCurrency:{name:"Plume",symbol:"PLUME",decimals:18},rpcUrls:{default:{http:["https://rpc.plume.org"],webSocket:["wss://rpc.plume.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.plume.org",apiUrl:"https://explorer.plume.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:39679}},sourceId:1}),AP=p({id:98867,name:"Plume Testnet",nativeCurrency:{name:"Plume",symbol:"PLUME",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.plume.org"],webSocket:["wss://testnet-rpc.plume.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.plume.org",apiUrl:"https://testnet-explorer.plume.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:199712}},testnet:!0,sourceId:11155111}),PP=p({id:161221135,name:"Plume Testnet (Legacy)",nativeCurrency:{name:"Plume Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.plumenetwork.xyz/http"],webSocket:["wss://testnet-rpc.plumenetwork.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.plumenetwork.xyz",apiUrl:"https://testnet-explorer.plumenetwork.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:6022332}},testnet:!0,sourceId:11155111}),IP=p({id:631571,name:"Polter Testnet",nativeCurrency:{decimals:18,name:"Polter GHST",symbol:"GHST"},rpcUrls:{default:{http:["https://geist-polter.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Blockscout",url:"https://polter-testnet.explorer.alchemy.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11245}},testnet:!0}),BP=p({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),FP=p({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),UP=p({id:80001,name:"Polygon Mumbai",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://80001.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com",apiUrl:"https://api-testnet.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),OP=p({id:1101,name:"Polygon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com",apiUrl:"https://api-zkevm.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),DP=p({id:2442,name:"Polygon zkEVM Cardona",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.cardona.zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://cardona-zkevm.polygonscan.com",apiUrl:"https://cardona-zkevm.polygonscan.com/api"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:114091}}}),_P=p({id:1442,name:"Polygon zkEVM Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.public.zkevm-test.net"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://testnet-zkevm.polygonscan.com",apiUrl:"https://testnet-zkevm.polygonscan.com/api"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:525686}}}),MP=p({id:8008,name:"Polynomial",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.polynomial.fi"]}},blockExplorers:{default:{name:"Polynomial Scan",url:"https://polynomialscan.io"}},testnet:!1,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}}}),NP=p({id:80008,name:"Polynomia Sepolia",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.sepolia.polynomial.fi"]}},blockExplorers:{default:{name:"Polynomial Scan",url:"https://sepolia.polynomialscan.io"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}}}),LP=p({id:60603,name:"POTOS Mainnet",nativeCurrency:{decimals:18,name:"POTOS Token",symbol:"POT"},rpcUrls:{default:{http:["https://rpc.potos.hk"]}},blockExplorers:{default:{name:"POTOS Mainnet explorer",url:"https://scan.potos.hk"}},testnet:!1}),zP=p({id:60600,name:"POTOS Testnet",nativeCurrency:{decimals:18,name:"POTOS Token",symbol:"POT"},rpcUrls:{default:{http:["https://rpc-testnet.potos.hk"]}},blockExplorers:{default:{name:"POTOS Testnet explorer",url:"https://scan-testnet.potos.hk"}},testnet:!0}),RP=p({id:23023,name:"PremiumBlock Testnet",nativeCurrency:{name:"Premium Block",symbol:"PBLK",decimals:18},rpcUrls:{default:{http:["https://rpc.premiumblock.org"]}},blockExplorers:{default:{name:"PremiumBlocks Explorer",url:"https://scan.premiumblock.org"}},testnet:!0}),HP=p({id:369,name:"PulseChain",nativeCurrency:{name:"Pulse",symbol:"PLS",decimals:18},testnet:!1,blockTime:1e4,rpcUrls:{default:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://ipfs.scan.pulsechain.com",apiUrl:"https://api.scan.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),$P=p({id:943,name:"PulseChain V4",testnet:!0,nativeCurrency:{name:"V4 Pulse",symbol:"v4PLS",decimals:18},blockTime:1e4,rpcUrls:{default:{http:["https://rpc.v4.testnet.pulsechain.com"],webSocket:["wss://ws.v4.testnet.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.v4.testnet.pulsechain.com",apiUrl:"https://scan.v4.testnet.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),GP=p({id:490092,name:"Pumpfi Testnet",nativeCurrency:{decimals:18,name:"PMPT",symbol:"PMPT"},rpcUrls:{default:{http:["https://rpc1testnet.pumpfi.me"]}},blockExplorers:{default:{name:"Pumpfi Testnet Scan",url:"https://testnetscan.pumpfi.me"}},testnet:!0}),Jb=11155111,jP=p({...V,name:"Pyrope Testnet",testnet:!0,id:695569,sourceId:Jb,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.pyropechain.com"],webSocket:["wss://rpc.pyropechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://pyrope.blockscout.com"}},contracts:{...V.contracts,l1StandardBridge:{[Jb]:{address:"0xC24932c31D9621aE9e792576152B7ef010cFC2F8"}}}}),VP=p({id:766,name:"QL1",nativeCurrency:{decimals:18,name:"QOM",symbol:"QOM"},rpcUrls:{default:{http:["https://rpc.qom.one"]}},blockExplorers:{default:{name:"Ql1 Explorer",url:"https://scan.qom.one"}},contracts:{multicall3:{address:"0x7A52370716ea730585884F5BDB0f6E60C39b8C64"}},testnet:!1}),WP=p({id:35441,name:"Q Mainnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.q.org"]}},blockExplorers:{default:{name:"Q Mainnet Explorer",url:"https://explorer.q.org",apiUrl:"https://explorer.q.org/api"}}}),qP=p({id:35443,name:"Q Testnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.qtestnet.org"]}},blockExplorers:{default:{name:"Q Testnet Explorer",url:"https://explorer.qtestnet.org",apiUrl:"https://explorer.qtestnet.org/api"}},testnet:!0}),YP=p({id:9,name:"Quai Network Mainnet",nativeCurrency:{decimals:18,name:"Quai",symbol:"QUAI"},rpcUrls:{default:{http:["https://rpc.quai.network/cyprus1"]}},blockExplorers:{default:{name:"Quaiscan",url:"https://quaiscan.io",apiUrl:"https://quaiscan.io/api"}},testnet:!1}),KP=p({id:15e3,name:"Quai Network Testnet",nativeCurrency:{decimals:18,name:"Quai",symbol:"QUAI"},rpcUrls:{default:{http:["https://orchard.rpc.quai.network/cyprus1"]}},blockExplorers:{default:{name:"Orchard Quaiscan",url:"https://orchard.quaiscan.io",apiUrl:"https://orchard.quaiscan.io/api"}},testnet:!0}),ZP=p({id:5318007,name:"Reactive Lasna Testnet",nativeCurrency:{decimals:18,name:"Lasna React",symbol:"lREACT"},rpcUrls:{default:{http:["https://lasna-rpc.rnk.dev"]}},blockExplorers:{default:{name:"Reactscan",url:"https://lasna.reactscan.net"}},testnet:!0}),XP=p({id:111188,name:"re.al",nativeCurrency:{name:"reETH",decimals:18,symbol:"reETH"},rpcUrls:{default:{http:["https://rpc.realforreal.gelato.digital"]}},blockExplorers:{default:{name:"re.al Explorer",url:"https://explorer.re.al",apiUrl:"https://explorer.re.al/api/v2"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:695}}}),QP=p({id:151,name:"Redbelly Network Mainnet",nativeCurrency:{name:"Redbelly Native Coin",symbol:"RBNT",decimals:18},rpcUrls:{default:{http:["https://governors.mainnet.redbelly.network"]}},blockExplorers:{default:{name:"Routescan",url:"https://redbelly.routescan.io",apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/151/etherscan/api"}},testnet:!1}),JP=p({id:153,name:"Redbelly Network Testnet",nativeCurrency:{name:"Redbelly Native Coin",symbol:"RBNT",decimals:18},rpcUrls:{default:{http:["https://governors.testnet.redbelly.network"]}},blockExplorers:{default:{name:"Routescan",url:"https://redbelly.testnet.routescan.io",apiUrl:"https://api.routescan.io/v2/network/testnet/evm/153_2/etherscan/api"}},testnet:!0}),eI=p({id:50342,name:"Reddio",nativeCurrency:{name:"Reddio",symbol:"RED",decimals:18},rpcUrls:{default:{http:["https://mainnet.reddio.com/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://reddio.cloud.blockscout.com",apiUrl:"https://reddio.cloud.blockscout.com/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:848849}},testnet:!1}),tI=p({id:50341,name:"Reddio Sepolia",nativeCurrency:{name:"Reddio",symbol:"RED",decimals:18},rpcUrls:{default:{http:["https://reddio-dev.reddio.com"]}},blockExplorers:{default:{name:"Reddioscan",url:"https://reddio-devnet.l2scan.co",apiUrl:"https://reddio-devnet.l2scan.co/api"}},testnet:!0}),wl=1,rI=p({...V,name:"Redstone",id:690,sourceId:wl,nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.redstonechain.com"],webSocket:["wss://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[wl]:{address:"0xC7bCb0e8839a28A1cFadd1CF716de9016CdA51ae",blockCreated:19578329}},l2OutputOracle:{[wl]:{address:"0xa426A052f657AEEefc298b3B5c35a470e4739d69",blockCreated:19578337}},l1StandardBridge:{[wl]:{address:"0xc473ca7E02af24c129c2eEf51F2aDf0411c1Df69",blockCreated:19578331}}}}),nI=p({id:47805,name:"REI Mainnet",nativeCurrency:{decimals:18,name:"REI",symbol:"REI"},rpcUrls:{default:{http:["https://rpc.rei.network"],webSocket:["wss://rpc.rei.network"]}},blockExplorers:{default:{name:"REI Scan",url:"https://scan.rei.network"}},testnet:!1}),sI=p({id:1729,name:"Reya Network",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.reya.network"],webSocket:["wss://ws.reya.network"]}},blockExplorers:{default:{name:"Reya Network Explorer",url:"https://explorer.reya.network"}},testnet:!1}),aI=p({id:11155931,name:"RISE Testnet",nativeCurrency:{name:"RISE Testnet Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.riselabs.xyz"],webSocket:["wss://testnet.riselabs.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.testnet.riselabs.xyz/",apiUrl:"https://explorer.testnet.riselabs.xyz/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}},testnet:!0}),oI=p({id:753,name:"Rivalz",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rivalz.calderachain.xyz/http"]}},blockExplorers:{default:{name:"Rivalz Caldera Explorer",url:"https://rivalz.calderaexplorer.xyz"}},testnet:!1}),iI=p({id:570,name:"Rollux Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.rollux.com"],webSocket:["wss://rpc.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxExplorer",url:"https://explorer.rollux.com",apiUrl:"https://explorer.rollux.com/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:119222}}}),cI=p({id:57e3,name:"Rollux Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc-tanenbaum.rollux.com/"],webSocket:["wss://rpc-tanenbaum.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxTestnetExplorer",url:"https://rollux.tanenbaum.io",apiUrl:"https://rollux.tanenbaum.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1813675}}}),lI=p({id:2020,name:"Ronin",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://api.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Ronin Explorer",url:"https://app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:26023535}}}),uI=p({id:7668,name:"The Root Network",nativeCurrency:{decimals:18,name:"XRP",symbol:"XRP"},rpcUrls:{default:{http:["https://root.rootnet.live/archive"],webSocket:["wss://root.rootnet.live/archive/ws"]}},blockExplorers:{default:{name:"Rootscan",url:"https://rootscan.io"}},contracts:{multicall3:{address:"0xc9C2E2429AeC354916c476B30d729deDdC94988d",blockCreated:9218338}}}),dI=p({id:7672,name:"The Root Network - Porcini",nativeCurrency:{decimals:18,name:"XRP",symbol:"XRP"},rpcUrls:{default:{http:["https://porcini.rootnet.app/archive"],webSocket:["wss://porcini.rootnet.app/archive/ws"]}},blockExplorers:{default:{name:"Rootscan",url:"https://porcini.rootscan.io"}},contracts:{multicall3:{address:"0xc9C2E2429AeC354916c476B30d729deDdC94988d",blockCreated:10555692}},testnet:!0}),pI=p({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{default:{http:["https://public-node.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),fI=p({id:31,name:"Rootstock Testnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"tRBTC"},rpcUrls:{default:{http:["https://public-node.testnet.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.testnet.rootstock.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2771150}},testnet:!0}),vl=1,mI=p({...V,id:12553,name:"RSS3 VSL Mainnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Mainnet Scan",url:"https://scan.rss3.io",apiUrl:"https://scan.rss3.io/api"}},contracts:{...V.contracts,l2OutputOracle:{[vl]:{address:"0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14193},portal:{[vl]:{address:"0x6A12432491bbbE8d3babf75F759766774C778Db4",blockCreated:19387057}},l1StandardBridge:{[vl]:{address:"0x4cbab69108Aa72151EDa5A3c164eA86845f18438"}}},sourceId:vl}),El=11155111,hI=p({...V,id:2331,name:"RSS3 VSL Sepolia Testnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Sepolia Testnet Scan",url:"https://scan.testnet.rss3.io",apiUrl:"https://scan.testnet.rss3.io/api"}},contracts:{...V.contracts,l2OutputOracle:{[El]:{address:"0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:55697},portal:{[El]:{address:"0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57",blockCreated:5345035}},l1StandardBridge:{[El]:{address:"0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B"}}},testnet:!0,sourceId:El}),bI=p({id:7225878,name:"Saakuru Mainnet",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.saakuru.network"]}},blockExplorers:{default:{name:"Saakuru Explorer",url:"https://explorer.saakuru.network"}},testnet:!1}),yI=p({id:5464,name:"Saga",network:"saga",nativeCurrency:{decimals:18,name:"gas",symbol:"GAS"},rpcUrls:{default:{http:["https://sagaevm.jsonrpc.sagarpc.io"]}},blockExplorers:{default:{name:"Saga Explorer",url:"https://sagaevm.sagaexplorer.io"}},contracts:{multicall3:{address:"0x864DDc9B50B9A0dF676d826c9B9EDe9F8913a160",blockCreated:467530}}}),gI=p({id:2021,name:"Saigon Testnet",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://saigon-testnet.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Saigon Explorer",url:"https://saigon-app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18736871}},testnet:!0}),xI=p({id:1996,name:"Sanko",nativeCurrency:{name:"DMT",symbol:"DMT",decimals:18},rpcUrls:{default:{http:["https://mainnet.sanko.xyz"]}},blockExplorers:{default:{name:"Sanko Explorer",url:"https://explorer.sanko.xyz"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:37}},testnet:!1}),wI=p({id:23294,name:"Oasis Sapphire",network:"sapphire",nativeCurrency:{name:"Sapphire Rose",symbol:"ROSE",decimals:18},rpcUrls:{default:{http:["https://sapphire.oasis.io"],webSocket:["wss://sapphire.oasis.io/ws"]}},blockExplorers:{default:{name:"Oasis Explorer",url:"https://explorer.oasis.io/mainnet/sapphire"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:734531}}}),vI=p({id:23295,name:"Oasis Sapphire Testnet",network:"sapphire-testnet",nativeCurrency:{name:"Sapphire Test Rose",symbol:"TEST",decimals:18},rpcUrls:{default:{http:["https://testnet.sapphire.oasis.dev"],webSocket:["wss://testnet.sapphire.oasis.dev/ws"]}},blockExplorers:{default:{name:"Oasis Explorer",url:"https://explorer.oasis.io/testnet/sapphire"}},testnet:!0}),EI=p({id:3109,name:"SatoshiVM Alpha Mainnet",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://alpha-rpc-node-http.svmscan.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://svmscan.io",apiUrl:"https://svmscan.io/api"}}}),kI=p({id:3110,name:"SatoshiVM Testnet",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://test-rpc-node-http.svmscan.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://testnet.svmscan.io",apiUrl:"https://testnet.svmscan.io/api"}},testnet:!0}),CI=p({id:534352,name:"Scroll",blockTime:3e3,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),TI=p({id:534351,name:"Scroll Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.scroll.io"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://sepolia.scrollscan.com",apiUrl:"https://api-sepolia.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9473}},testnet:!0}),SI=p({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com",apiUrl:"https://seitrace.com/pacific-1/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),AI=p({id:713715,name:"Sei Devnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-arctic-1.sei-apis.com"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com"}},testnet:!0}),PI=p({id:5124,name:"Seismic Devnet",nativeCurrency:{name:"Seismic Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://node-2.seismicdev.net/rpc"]}},blockExplorers:{default:{name:"Seismic Devnet Explorer",url:"https://explorer-2.seismicdev.net"}},testnet:!0}),II=p({id:1328,name:"Sei Testnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-testnet.sei-apis.com"],webSocket:["wss://evm-ws-testnet.sei-apis.com"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:98697651}},testnet:!0}),BI=p({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),kl=1,FI=p({...V,id:360,name:"Shape",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.shape.network"]}},blockExplorers:{default:{name:"shapescan",url:"https://shapescan.xyz",apiUrl:"https://shapescan.xyz/api"}},contracts:{...V.contracts,l2OutputOracle:{[kl]:{address:"0x6Ef8c69CfE4635d866e3E02732068022c06e724D",blockCreated:20369940}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1},portal:{[kl]:{address:"0xEB06fFa16011B5628BaB98E29776361c83741dd3",blockCreated:20369933}},l1StandardBridge:{[kl]:{address:"0x62Edd5f4930Ea92dCa3fB81689bDD9b9d076b57B",blockCreated:20369935}}},sourceId:kl}),UI=p({...V,id:11011,name:"Shape Sepolia Testnet",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.shape.network"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer-sepolia.shape.network/",apiUrl:"https://explorer-sepolia.shape.network/api/v2"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1}},testnet:!0,sourceId:11155111}),OI=p({id:8118,name:"Shardeum",nativeCurrency:{name:"Shardeum",symbol:"SHM",decimals:18},rpcUrls:{default:{http:["https://api.shardeum.org"]}},blockExplorers:{default:{name:"Shardeum Explorer",url:"https://explorer.shardeum.org"}},testnet:!1}),DI=p({id:8082,name:"Shardeum Sphinx",nativeCurrency:{name:"SHARDEUM",symbol:"SHM",decimals:18},rpcUrls:{default:{http:["https://sphinx.shardeum.org"]}},blockExplorers:{default:{name:"Shardeum Explorer",url:"https://explorer-sphinx.shardeum.org"}},testnet:!0}),_I=p({id:109,name:"Shibarium",network:"shibarium",nativeCurrency:{name:"Bone",symbol:"BONE",decimals:18},rpcUrls:{default:{http:["https://rpc.shibrpc.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://shibariumscan.io"}},contracts:{multicall3:{address:"0x864Bf681ADD6052395188A89101A1B37d3B4C961",blockCreated:265900}}}),MI=p({id:157,name:"Puppynet Shibarium",nativeCurrency:{decimals:18,name:"Bone",symbol:"BONE"},rpcUrls:{default:{http:["https://puppynet.shibrpc.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://puppyscan.shib.io",apiUrl:"https://puppyscan.shib.io/api"}},contracts:{multicall3:{address:"0xA4029b74FBA366c926eDFA7Dd10B21C621170a4c",blockCreated:3035769}},testnet:!0}),NI=p({id:336,name:"Shiden",nativeCurrency:{decimals:18,name:"SDN",symbol:"SDN"},rpcUrls:{default:{http:["https://shiden.public.blastapi.io"],webSocket:["wss://shiden-rpc.dwellir.com"]}},blockExplorers:{default:{name:"Shiden Scan",url:"https://shiden.subscan.io"}},testnet:!1}),LI=p({id:148,name:"Shimmer",network:"shimmer",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.shimmer.network",apiUrl:"https://explorer.evm.shimmer.network/api"}}}),zI=p({id:1073,name:"Shimmer Testnet",network:"shimmer-testnet",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.testnet.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.testnet.shimmer.network",apiUrl:"https://explorer.evm.testnet.shimmer.network/api"}},testnet:!0}),RI=p({id:97453,name:"Sidra Chain",nativeCurrency:{decimals:18,name:"Sidra Digital Asset",symbol:"SDA"},rpcUrls:{default:{http:["https://node.sidrachain.com"]}},blockExplorers:{default:{name:"Sidra Chain Explorer",url:"https://ledger.sidrachain.com"}}}),HI=p({id:380929,name:"Silent Data Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.silentdata.com"]}},blockExplorers:{default:{name:"Silent Data Mainnet Explorer",url:"https://explorer-mainnet.rollup.silentdata.com"}},testnet:!1}),$I=p({id:2355,name:"Silicon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.silicon.network","https://silicon-mainnet.nodeinfra.com"]}},blockExplorers:{default:{name:"SiliconScope",url:"https://scope.silicon.network"}}}),GI=p({id:1722641160,name:"Silicon Sepolia zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-sepolia.silicon.network","https://silicon-testnet.nodeinfra.com"]}},blockExplorers:{default:{name:"SiliconSepoliaScope",url:"https://scope-sepolia.silicon.network"}},testnet:!0}),jI=p({id:98,name:"Six Protocol",nativeCurrency:{decimals:18,name:"SIX",symbol:"SIX"},rpcUrls:{default:{http:["https://sixnet-rpc-evm.sixprotocol.net"]}},blockExplorers:{default:{name:"Six Protocol Scan",url:"https://sixscan.io/sixnet"}},testnet:!1}),VI=p({id:391845894,name:"SKALE | Block Brawlers",nativeCurrency:{name:"BRAWL",symbol:"BRAWL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/frayed-decent-antares"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/frayed-decent-antares"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://frayed-decent-antares.explorer.mainnet.skalenodes.com"}},contracts:{}}),WI=p({id:1564830818,name:"SKALE Calypso Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/honorable-steel-rasalhague"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3107626}}}),qI=p({id:974399131,name:"SKALE Calypso Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/giant-half-dual-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/giant-half-dual-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:103220}},testnet:!0}),YI=p({id:1026062157,name:"SKALE | CryptoBlades",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/affectionate-immediate-pollux"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com"}},contracts:{}}),KI=p({id:1032942172,name:"SKALE | Crypto Colosseum",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/haunting-devoted-deneb"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/haunting-devoted-deneb"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com"}},contracts:{}}),ZI=p({id:2046399126,name:"SKALE Europa Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/elated-tan-skat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/elated-tan-skat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3113495}}}),XI=p({id:1444673419,name:"SKALE Europa Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/juicy-low-small-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/juicy-low-small-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://juicy-low-small-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:110858}},testnet:!0}),QI=p({id:2139927552,name:"Exorde Network",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/light-vast-diphda"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/light-vast-diphda"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://light-vast-diphda.explorer.mainnet.skalenodes.com"}},contracts:{}}),JI=p({id:1273227453,name:"SKALE | Human Protocol",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/wan-red-ain"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/wan-red-ain"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://wan-red-ain.explorer.mainnet.skalenodes.com"}},contracts:{}}),eB=p({id:1482601649,name:"SKALE Nebula Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/green-giddy-denebola"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/green-giddy-denebola"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2372986}}}),tB=p({id:37084624,name:"SKALE Nebula Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/lanky-ill-funny-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:105141}},testnet:!0}),rB=p({id:278611351,name:"SKALE | Razor Network",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/turbulent-unique-scheat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/turbulent-unique-scheat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com"}},contracts:{}}),nB=p({id:1187947933,name:"SKALE Base",nativeCurrency:{name:"Credits",symbol:"CREDIT",decimals:18},rpcUrls:{default:{http:["https://skale-base.skalenodes.com/v1/base"],webSocket:["wss://skale-base.skalenodes.com/v1/ws/base"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://skale-base-explorer.skalenodes.com/"}},testnet:!0}),sB=p({id:324705682,name:"SKALE Base Sepolia Testnet",nativeCurrency:{name:"Credits",symbol:"CREDIT",decimals:18},rpcUrls:{default:{http:["https://base-sepolia-testnet.skalenodes.com/v1/base-testnet"],webSocket:["wss://base-sepolia-testnet.skalenodes.com/v1/ws/base-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://base-sepolia-testnet-explorer.skalenodes.com/"}},testnet:!0}),aB=p({id:1350216234,name:"SKALE Titan Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/parallel-stormy-spica"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/parallel-stormy-spica"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2076458}}}),oB=p({id:1020352220,name:"SKALE Titan Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/aware-fake-trim-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/aware-fake-trim-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:104072}},testnet:!0}),iB=p({id:984123,name:"Forma Sketchpad",network:"sketchpad",nativeCurrency:{symbol:"TIA",name:"TIA",decimals:18},rpcUrls:{default:{http:["https://rpc.sketchpad-1.forma.art"],webSocket:["wss://ws.sketchpad-1.forma.art"]}},blockExplorers:{default:{name:"Sketchpad Explorer",url:"https://explorer.sketchpad-1.forma.art"}},testnet:!0}),gi=1,cB=p({...V,id:2192,network:"snaxchain-mainnet",name:"SnaxChain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.snaxchain.io"]}},blockExplorers:{default:{name:"Snax Explorer",url:"https://explorer.snaxchain.io",apiUrl:"https://explorer.snaxchain.io/api"}},contracts:{...V.contracts,disputeGameFactory:{[gi]:{address:"0x472562Fcf26D6b2793f8E0b0fB660ba0E5e08A46"}},l2OutputOracle:{[gi]:{address:"0x2172e492Fc807F5d5645D0E3543f139ECF539294"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[gi]:{address:"0x79f446D024d74D0Bb6E699C131c703463c5D65E9"}},l1StandardBridge:{[gi]:{address:"0x6534Bdb6b5c060d3e6aa833433333135eFE8E0aA"}}},sourceId:gi}),xi=11155111,lB=p({...V,id:13001,network:"snaxchain-testnet",name:"SnaxChain Testnet",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.snaxchain.io"]}},blockExplorers:{default:{name:"Snax Explorer",url:"https://testnet-explorer.snaxchain.io",apiUrl:"https://testnet-explorer.snaxchain.io/api"}},contracts:{...V.contracts,disputeGameFactory:{[xi]:{address:"0x206a75d89d45F146C54020F132FF93bEDD09f55E"}},l2OutputOracle:{[xi]:{address:"0x60e3A368a4cdCEf85ffB964e372726F56A46221e"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[xi]:{address:"0xb5afdd0E8dDF081Ef90e8A3e0c7b5798e66E954E"}},l1StandardBridge:{[xi]:{address:"0xbd37E1a59D4C00C9A46F75018dffd84061bC5f74"}}},testnet:!0,sourceId:xi}),uB=p({id:5031,name:"Somnia",nativeCurrency:{name:"Somnia",symbol:"SOMI",decimals:18},rpcUrls:{default:{http:["https://api.infra.mainnet.somnia.network"]}},blockExplorers:{default:{name:"Somnia Explorer",url:"https://explorer.somnia.network",apiUrl:"https://explorer.somnia.network/api"}},testnet:!1}),dB=p({id:50312,name:"Somnia Testnet",nativeCurrency:{name:"STT",symbol:"STT",decimals:18},rpcUrls:{default:{http:["https://dream-rpc.somnia.network"]}},blockExplorers:{default:{name:"Somnia Testnet Explorer",url:"https://shannon-explorer.somnia.network/",apiUrl:"https://shannon-explorer.somnia.network/api"}},contracts:{multicall3:{address:"0x841b8199E6d3Db3C6f264f6C2bd8848b3cA64223",blockCreated:71314235}},testnet:!0}),wi=1,pB=p({...V,id:1868,name:"Soneium Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com",apiUrl:"https://soneium.blockscout.com/api"}},contracts:{...V.contracts,disputeGameFactory:{[wi]:{address:"0x512a3d2c7a43bd9261d2b8e8c9c70d4bd4d503c0"}},l2OutputOracle:{[wi]:{address:"0x0000000000000000000000000000000000000000"}},portal:{[wi]:{address:"0x88e529a6ccd302c948689cd5156c83d4614fae92",blockCreated:7061266}},l1StandardBridge:{[wi]:{address:"0xeb9bf100225c214efc3e7c651ebbadcf85177607",blockCreated:7061266}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}},sourceId:wi}),vi=11155111,fB=p({...V,id:1946,name:"Soneium Minato Testnet",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.minato.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium-minato.blockscout.com",apiUrl:"https://soneium-minato.blockscout.com/api"}},contracts:{...V.contracts,disputeGameFactory:{[vi]:{address:"0xB3Ad2c38E6e0640d7ce6aA952AB3A60E81bf7a01"}},l2OutputOracle:{[vi]:{address:"0x710e5286C746eC38beeB7538d0146f60D27be343"}},portal:{[vi]:{address:"0x65ea1489741A5D72fFdD8e6485B216bBdcC15Af3",blockCreated:6466136}},l1StandardBridge:{[vi]:{address:"0x5f5a404A5edabcDD80DB05E8e54A78c9EBF000C2",blockCreated:6466136}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}},testnet:!0,sourceId:vi}),mB=p({id:19,name:"Songbird Canary-Network",nativeCurrency:{decimals:18,name:"Songbird",symbol:"SGB"},rpcUrls:{default:{http:["https://songbird-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Songbird Explorer",url:"https://songbird-explorer.flare.network",apiUrl:"https://songbird-explorer.flare.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13382504}}}),hB=p({id:16,name:"Songbird Testnet Coston",nativeCurrency:{decimals:18,name:"Coston Flare",symbol:"CFLR"},rpcUrls:{default:{http:["https://coston-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston Explorer",url:"https://coston-explorer.flare.network",apiUrl:"https://coston-explorer.flare.network/api"}},testnet:!0}),bB=p({id:146,name:"Sonic",blockTime:630,nativeCurrency:{decimals:18,name:"Sonic",symbol:"S"},rpcUrls:{default:{http:["https://rpc.soniclabs.com"]}},blockExplorers:{default:{name:"Sonic Explorer",url:"https://sonicscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:60}},testnet:!1}),yB=p({id:57054,name:"Sonic Blaze Testnet",nativeCurrency:{decimals:18,name:"Sonic",symbol:"S"},rpcUrls:{default:{http:["https://rpc.blaze.soniclabs.com"]}},blockExplorers:{default:{name:"Sonic Blaze Testnet Explorer",url:"https://testnet.sonicscan.org"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1100}},testnet:!0}),gB=p({id:64165,name:"Sonic Testnet",nativeCurrency:{decimals:18,name:"Sonic",symbol:"S"},rpcUrls:{default:{http:["https://rpc.testnet.soniclabs.com"]}},blockExplorers:{default:{name:"Sonic Testnet Explorer",url:"https://testnet.soniclabs.com/"}},testnet:!0}),xB=p({...ur,blockTime:200,id:50104,name:"Sophon",nativeCurrency:{decimals:18,name:"Sophon",symbol:"SOPH"},rpcUrls:{default:{http:["https://rpc.sophon.xyz"],webSocket:["wss://rpc.sophon.xyz/ws"]}},blockExplorers:{default:{name:"Sophon Block Explorer",url:"https://explorer.sophon.xyz"}},contracts:{multicall3:{address:"0x5f4867441d2416cA88B1b3fd38f21811680CD2C8",blockCreated:116}},testnet:!1}),wB=p({...ur,blockTime:200,id:531050104,name:"Sophon Testnet",nativeCurrency:{decimals:18,name:"Sophon",symbol:"SOPH"},rpcUrls:{default:{http:["https://rpc.testnet.sophon.xyz"],webSocket:["wss://rpc.testnet.sophon.xyz/ws"]}},blockExplorers:{default:{name:"Sophon Block Explorer",url:"https://explorer.testnet.sophon.xyz"}},contracts:{multicall3:{address:"0x83c04d112adedA2C6D9037bb6ecb42E7f0b108Af",blockCreated:15642}},testnet:!0}),vB=p({id:100021,name:"Sova",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.sova.io"]}},blockExplorers:{default:{name:"Sova Block Explorer",url:"hhttps://explorer.sova.io"}},testnet:!1}),EB=p({id:120893,name:"Sova Network Sepolia",nativeCurrency:{decimals:18,name:"Sepolia Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.testnet.sova.io"]}},blockExplorers:{default:{name:"Sova Sepolia Explorer",url:"https://explorer.testnet.sova.io"}},testnet:!0}),kB=p({id:88882,name:"Chiliz Spicy Testnet",network:"chiliz-spicy-Testnet",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://spicy-rpc.chiliz.com","https://chiliz-spicy-rpc.publicnode.com"],webSocket:["wss://spicy-rpc-ws.chiliz.com","wss://chiliz-spicy-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"http://spicy-explorer.chiliz.com",apiUrl:"http://spicy-explorer.chiliz.com/api"}},testnet:!0}),CB=p({id:2201,name:"Stable Testnet",nativeCurrency:{decimals:18,name:"gUSDT",symbol:"gUSDT"},rpcUrls:{default:{http:["https://rpc.testnet.stable.xyz"],webSocket:["wss://rpc.testnet.stable.xyz"]}},blockExplorers:{default:{name:"Stablescan",url:"https://testnet.stablescan.xyz",apiUrl:"https://testnet.stablescan.xyz/api"}},testnet:!0}),ey=p({...Cp,id:1660990954,name:"Status Network Sepolia",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://public.sepolia.rpc.status.network"],webSocket:["wss://public.sepolia.rpc.status.network/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepoliascan.status.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1578364}},testnet:!0}),TB=p({id:1234,name:"Step Network",nativeCurrency:{name:"FITFI",symbol:"FITFI",decimals:18},rpcUrls:{default:{http:["https://rpc.step.network"]}},blockExplorers:{default:{name:"Step Scan",url:"https://stepscan.io"}},testnet:!1}),SB=p({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story explorer",url:"https://storyscan.io",apiUrl:"https://storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1}),AB=p({id:1315,name:"Story Aeneid",network:"story-aeneid",nativeCurrency:{decimals:18,name:"IP",symbol:"IP"},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1792},ensRegistry:{address:"0x5dC881dDA4e4a8d312be3544AD13118D1a04Cb17",blockCreated:1322033},ensUniversalResolver:{address:"0x6D3B3F99177FB2A5de7F9E928a9BD807bF7b5BAD",blockCreated:1322097}},rpcUrls:{default:{http:["https://aeneid.storyrpc.io"]}},blockExplorers:{default:{name:"Story Aeneid Explorer",url:"https://aeneid.storyscan.io",apiUrl:"https://aeneid.storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!0}),PB=p({id:1516,name:"Story Odyssey",nativeCurrency:{decimals:18,name:"IP",symbol:"IP"},rpcUrls:{default:{http:["https://rpc.odyssey.storyrpc.io"]}},blockExplorers:{default:{name:"Story Odyssey Explorer",url:"https://odyssey.storyscan.xyz"}},testnet:!0}),IB=p({id:1513,name:"Story Testnet",nativeCurrency:{decimals:18,name:"IP",symbol:"IP"},rpcUrls:{default:{http:["https://testnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story Testnet Explorer",url:"https://testnet.storyscan.xyz"}},testnet:!0}),BB=p({id:105105,name:"Stratis Mainnet",network:"stratis",nativeCurrency:{name:"Stratis",symbol:"STRAX",decimals:18},rpcUrls:{default:{http:["https://rpc.stratisevm.com"]}},blockExplorers:{default:{name:"Stratis Explorer",url:"https://explorer.stratisevm.com"}}}),FB=p({id:8866,name:"SuperLumio",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.lumio.io"]}},blockExplorers:{default:{name:"Lumio explorer",url:"https://explorer.lumio.io"}},testnet:!1}),UB=p({id:55244,name:"Superposition",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.superposition.so"]}},blockExplorers:{default:{name:"Superposition Explorer",url:"https://explorer.superposition.so"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:39}},testnet:!1}),Ei=1,OB=p({...V,id:5330,name:"Superseed",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.superseed.xyz"]}},blockExplorers:{default:{name:"Superseed Explorer",url:"https://explorer.superseed.xyz",apiUrl:"https://explorer.superseed.xyz/api/v2"}},contracts:{...V.contracts,disputeGameFactory:{[Ei]:{address:"0x8b097CF1f9BbD9cbFD0DD561858a1FCbC8857Be0",blockCreated:20737481}},l2OutputOracle:{[Ei]:{address:"0x693A0F8854F458D282DE3C5b69E8eE5EEE8aA949",blockCreated:20737481}},portal:{[Ei]:{address:"0x2c2150aa5c75A24fB93d4fD2F2a895D618054f07",blockCreated:20737481}},l1StandardBridge:{[Ei]:{address:"0x8b0576E39F1233679109F9b40cFcC2a7E0901Ede",blockCreated:20737481}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}},sourceId:Ei}),Tp=11155111,DB=p({...V,id:53302,name:"Superseed Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.superseed.xyz"]}},blockExplorers:{default:{name:"Superseed Sepolia Explorer",url:"https://sepolia-explorer.superseed.xyz",apiUrl:"https://sepolia-explorer.superseed.xyz/api/v2"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"},portal:{[Tp]:{address:"0x7A0db8C51432d2C3eb4e8f360a2EeB26FF2809fB",blockCreated:5523438}},l1StandardBridge:{[Tp]:{address:"0x2B227A603fAAdB3De0ED050b63ADD232B5f2c28C",blockCreated:5523442}}},testnet:!0,sourceId:Tp}),_B=p({id:763375,name:"Surge Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://l2-rpc.hoodi.surge.wtf"],webSocket:["wss://l2-ws.hoodi.surge.wtf"]}},blockExplorers:{default:{name:"Surge Testnet Blockscout",url:"https://explorer.hoodi.surge.wtf"}},testnet:!0}),MB=p({id:254,name:"Swan Chain Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet-rpc.swanchain.org"]}},blockExplorers:{default:{name:"Swan Explorer",url:"https://swanscan.io"}},testnet:!1}),NB=p({id:20241133,name:"Swan Proxima Testnet",nativeCurrency:{name:"Swan Ether",symbol:"sETH",decimals:18},rpcUrls:{default:{http:["https://rpc-proxima.swanchain.io"]}},blockExplorers:{default:{name:"Swan Explorer",url:"https://proxima-explorer.swanchain.io"}},testnet:!0}),LB=p({id:2024,name:"Swan Saturn Testnet",nativeCurrency:{name:"Swan Ether",symbol:"sETH",decimals:18},rpcUrls:{default:{http:["https://saturn-rpc.swanchain.io"]}},blockExplorers:{default:{name:"Swan Explorer",url:"https://saturn-explorer.swanchain.io"}},testnet:!0}),zB=p({...V,id:1923,name:"Swellchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://swell-mainnet.alt.technology"]}},blockExplorers:{default:{name:"Swell Explorer",url:"https://explorer.swellnetwork.io",apiUrl:"https://explorer.swellnetwork.io/api"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}}}),RB=p({...V,id:1924,name:"Swellchain Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://swell-testnet.alt.technology"]}},blockExplorers:{default:{name:"Swellchain Testnet Explorer",url:"https://swell-testnet-explorer.alt.technology",apiUrl:"https://swell-testnet-explorer.alt.technology/api"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}}}),HB=p({id:94,name:"SwissDLT Mainnet",nativeCurrency:{decimals:18,name:"BCTS",symbol:"BCTS"},rpcUrls:{default:{http:["https://rpc.swissdlt.ch"]}},blockExplorers:{default:{name:"SwissDLT Explorer",url:"https://explorer.swissdlt.ch"}},testnet:!1}),$B=p({id:57,name:"Syscoin Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.syscoin.org"],webSocket:["wss://rpc.syscoin.org/wss"]}},blockExplorers:{default:{name:"SyscoinExplorer",url:"https://explorer.syscoin.org",apiUrl:"https://explorer.syscoin.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:287139}}}),GB=p({id:5700,name:"Syscoin Tanenbaum Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.tanenbaum.io"],webSocket:["wss://rpc.tanenbaum.io/wss"]}},blockExplorers:{default:{name:"SyscoinTestnetExplorer",url:"https://tanenbaum.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:271288}}}),jB=p({id:239,name:"TAC",nativeCurrency:{name:"TAC",symbol:"TAC",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/tac"]}},blockExplorers:{default:{name:"Blockscout",url:"https://tac.blockscout.com",apiUrl:"https://tac.blockscout.com/api"},native:{name:"TAC Explorer",url:"https://explorer.tac.build",apiUrl:"https://explorer.tac.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0}}}),VB=p({id:2391,name:"TAC SPB Testnet",nativeCurrency:{name:"TAC",symbol:"TAC",decimals:18},rpcUrls:{default:{http:["https://spb.rpc.tac.build"]}},blockExplorers:{default:{name:"TAC",url:"https://spb.explorer.tac.build",apiUrl:"https://spb.explorer.tac.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:471429}},testnet:!0}),WB=p({id:167e3,name:"Taiko Mainnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.mainnet.taiko.xyz"],webSocket:["wss://ws.mainnet.taiko.xyz"]}},blockExplorers:{default:{name:"Etherscan",url:"https://taikoscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:11269}}}),qB=p({id:167009,name:"Taiko Hekla L2",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.hekla.taiko.xyz"]}},blockExplorers:{default:{name:"Taikoscan",url:"https://hekla.taikoscan.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:59757}},testnet:!0}),YB=p({id:167013,name:"Taiko Hoodi",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.hoodi.taiko.xyz"],webSocket:["wss://ws.hoodi.taiko.xyz"]}},blockExplorers:{default:{name:"Etherscan",url:"https://hoodi.taikoscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:581116}},testnet:!0}),KB=p({id:167007,name:"Taiko Jolnir (Alpha-5 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.jolnir.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.jolnir.taiko.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:732706}},testnet:!0}),ZB=p({id:167008,name:"Taiko Katla (Alpha-6 Testnet)",network:"tko-katla",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.katla.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.katla.taiko.xyz"}}}),XB=p({id:167005,name:"Taiko (Alpha-3 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.test.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.test.taiko.xyz"}}}),QB=p({id:841,name:"Taraxa Mainnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.mainnet.taraxa.io"}}}),JB=p({id:842,name:"Taraxa Testnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.testnet.taraxa.io"}},testnet:!0}),eF=p({id:10218,name:"Tea Sepolia",nativeCurrency:{name:"Sepolia Tea",symbol:"TEA",decimals:18},rpcUrls:{default:{http:["https://tea-sepolia.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Tea Sepolia Explorer",url:"https://sepolia.tea.xyz"}},testnet:!0}),tF=p({id:2017,name:"Telcoin Adiri Testnet",nativeCurrency:{name:"Telcoin",symbol:"TEL",decimals:18},rpcUrls:{default:{http:["https://rpc.telcoin.network"]}},blockExplorers:{default:{name:"telscan",url:"https://telscan.io"}},testnet:!0}),rF=p({id:40,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://rpc.telos.net"]}},blockExplorers:{default:{name:"Teloscan",url:"https://www.teloscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:246530709}}}),nF=p({id:41,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://rpc.testnet.telos.net"]}},blockExplorers:{default:{name:"Teloscan (testnet)",url:"https://testnet.teloscan.io/"}},testnet:!0});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Sp=BigInt(0),Ap=BigInt(1);function ki(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Pp(e){if(!ki(e))throw new Error("Uint8Array expected")}function Ci(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Cl(e){const t=e.toString(16);return t.length&1?"0"+t:t}function ty(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Sp:BigInt("0x"+e)}const ry=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",sF=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ti(e){if(Pp(e),ry)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=sF[e[r]];return t}const An={_0:48,_9:57,A:65,F:70,a:97,f:102};function ny(e){if(e>=An._0&&e<=An._9)return e-An._0;if(e>=An.A&&e<=An.F)return e-(An.A-10);if(e>=An.a&&e<=An.f)return e-(An.a-10)}function Tl(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(ry)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let s=0,a=0;s<r;s++,a+=2){const o=ny(e.charCodeAt(a)),i=ny(e.charCodeAt(a+1));if(o===void 0||i===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}n[s]=o*16+i}return n}function qs(e){return ty(Ti(e))}function sy(e){return Pp(e),ty(Ti(Uint8Array.from(e).reverse()))}function Si(e,t){return Tl(e.toString(16).padStart(t*2,"0"))}function ay(e,t){return Si(e,t).reverse()}function kr(e,t,r){let n;if(typeof t=="string")try{n=Tl(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(ki(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=n.length;if(typeof r=="number"&&s!==r)throw new Error(e+" of length "+r+" expected, got "+s);return n}function Sl(...e){let t=0;for(let n=0;n<e.length;n++){const s=e[n];Pp(s),t+=s.length}const r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){const a=e[n];r.set(a,s),s+=a.length}return r}const Ip=e=>typeof e=="bigint"&&Sp<=e;function Bp(e,t,r){return Ip(e)&&Ip(t)&&Ip(r)&&t<=e&&e<r}function qa(e,t,r,n){if(!Bp(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function aF(e){let t;for(t=0;e>Sp;e>>=Ap,t+=1);return t}const Al=e=>(Ap<<BigInt(e))-Ap,Fp=e=>new Uint8Array(e),oy=e=>Uint8Array.from(e);function oF(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Fp(e),s=Fp(e),a=0;const o=()=>{n.fill(1),s.fill(0),a=0},i=(...d)=>r(s,n,...d),c=(d=Fp(0))=>{s=i(oy([0]),d),n=i(),d.length!==0&&(s=i(oy([1]),d),n=i())},l=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<t;){n=i();const m=n.slice();f.push(m),d+=n.length}return Sl(...f)};return(d,f)=>{o(),c(d);let m;for(;!(m=f(l()));)c();return o(),m}}const iF={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||ki(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Pl(e,t,r={}){const n=(s,a,o)=>{const i=iF[a];if(typeof i!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!i(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+a+", got "+c)};for(const[s,a]of Object.entries(t))n(s,a,!1);for(const[s,a]of Object.entries(r))n(s,a,!0);return e}function iy(e){const t=new WeakMap;return(r,...n)=>{const s=t.get(r);if(s!==void 0)return s;const a=e(r,...n);return t.set(r,a),a}}const cF="0.1.1";function lF(){return cF}class oe extends Error{static setStaticOptions(t){oe.prototype.docsOrigin=t.docsOrigin,oe.prototype.showVersion=t.showVersion,oe.prototype.version=t.version}constructor(t,r={}){const n=(()=>{var u;if(r.cause instanceof oe){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:(u=r.cause)!=null&&u.message?r.cause.message:r.details})(),s=r.cause instanceof oe&&r.cause.docsPath||r.docsPath,a=r.docsOrigin??oe.prototype.docsOrigin,o=`${a}${s??""}`,i=!!(r.version??oe.prototype.showVersion),c=r.version??oe.prototype.version,l=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||s||i?["",n?`Details: ${n}`:void 0,s?`See: ${o}`:void 0,i?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(`
105
105
  `);super(l,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=o,this.docsOrigin=a,this.docsPath=s,this.shortMessage=t,this.showVersion=i,this.version=c}walk(t){return cy(this,t)}}Object.defineProperty(oe,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${lF()}`}}),oe.setStaticOptions(oe.defaultStaticOptions);function cy(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?cy(e.cause,t):t?null:e}function Ya(e,t){if(Ka(e)>t)throw new DF({givenSize:Ka(e),maxSize:t})}const Pn={zero:48,nine:57,A:65,F:70,a:97,f:102};function ly(e){if(e>=Pn.zero&&e<=Pn.nine)return e-Pn.zero;if(e>=Pn.A&&e<=Pn.F)return e-(Pn.A-10);if(e>=Pn.a&&e<=Pn.f)return e-(Pn.a-10)}function uF(e,t={}){const{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new _F({size:e.length,targetSize:n,type:"Bytes"});const s=new Uint8Array(n);for(let a=0;a<n;a++){const o=r==="right";s[o?a:n-a-1]=e[o?a:e.length-a-1]}return s}function uy(e,t={}){const{dir:r="left"}=t;let n=e,s=0;for(let a=0;a<n.length-1&&n[r==="left"?a:n.length-a-1].toString()==="0";a++)s++;return n=r==="left"?n.slice(s):n.slice(0,n.length-s),n}function Il(e,t){if(ht(e)>t)throw new xF({givenSize:ht(e),maxSize:t})}function dF(e,t){if(typeof t=="number"&&t>0&&t>ht(e)-1)throw new gy({offset:t,position:"start",size:ht(e)})}function pF(e,t,r){if(typeof t=="number"&&typeof r=="number"&&ht(e)!==r-t)throw new gy({offset:r,position:"end",size:ht(e)})}function dy(e,t={}){const{dir:r,size:n=32}=t;if(n===0)return e;const s=e.replace("0x","");if(s.length>n*2)throw new wF({size:Math.ceil(s.length/2),targetSize:n,type:"Hex"});return`0x${s[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function fF(e,t={}){const{dir:r="left"}=t;let n=e.replace("0x",""),s=0;for(let a=0;a<n.length-1&&n[r==="left"?a:n.length-a-1].toString()==="0";a++)s++;return n=r==="left"?n.slice(s):n.slice(0,n.length-s),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}const mF="#__bigint";function Ai(e,t,r){return JSON.stringify(e,(n,s)=>typeof s=="bigint"?s.toString()+mF:s,r)}const hF=new TextEncoder,bF=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yF(e,t={}){const{strict:r=!1}=t;if(!e)throw new by(e);if(typeof e!="string")throw new by(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new yy(e);if(!e.startsWith("0x"))throw new yy(e)}function pt(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function Bl(e){return e instanceof Uint8Array?Pt(e):Array.isArray(e)?Pt(new Uint8Array(e)):e}function py(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(Il(r,t.size),Ys(r,t.size)):r}function Pt(e,t={}){let r="";for(let s=0;s<e.length;s++)r+=bF[e[s]];const n=`0x${r}`;return typeof t.size=="number"?(Il(n,t.size),Ks(n,t.size)):n}function X(e,t={}){const{signed:r,size:n}=t,s=BigInt(e);let a;n?r?a=(1n<<BigInt(n)*8n-1n)-1n:a=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&r?-a-1n:0;if(a&&s>a||s<o){const l=typeof e=="bigint"?"n":"";throw new hy({max:a?`${a}${l}`:void 0,min:`${o}${l}`,signed:r,size:n,value:`${e}${l}`})}const c=`0x${(r&&s<0?BigInt.asUintN(n*8,BigInt(s)):s).toString(16)}`;return n?Ys(c,n):c}function Pi(e,t={}){return Pt(hF.encode(e),t)}function Ys(e,t){return dy(e,{dir:"left",size:t})}function Ks(e,t){return dy(e,{dir:"right",size:t})}function fy(e){return Pt(AF(e))}function Pe(e,t,r,n={}){const{strict:s}=n;dF(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return s&&pF(a,t,r),a}function ht(e){return Math.ceil((e.length-2)/2)}function Up(e){return fF(e,{dir:"left"})}function bt(e,t={}){const{signed:r}=t;t.size&&Il(e,t.size);const n=BigInt(e);if(!r)return n;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n)-1n,o=a>>1n;return n<=o?n:n-a-1n}function Ii(e,t={}){const{signed:r,size:n}=t;return Number(!r&&!n?e:bt(e,t))}function my(e,t={}){const{size:r}=t;let n=cs(e);return r&&(Ya(n,r),n=vy(n)),new TextDecoder().decode(n)}function Nr(e,t={}){const{strict:r=!1}=t;try{return yF(e,{strict:r}),!0}catch{return!1}}class hy extends oe{constructor({max:t,min:r,signed:n,size:s,value:a}){super(`Number \`${a}\` is not in safe${s?` ${s*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class by extends oe{constructor(t){super(`Value \`${typeof t=="object"?Ai(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class yy extends oe{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class gF extends oe{constructor(t){super(`Hex value \`"${t}"\` is an odd length (${t.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}let xF=class extends oe{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};class gy extends oe{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}let wF=class extends oe{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};const vF=new TextDecoder,EF=new TextEncoder;function kF(e){if(!(e instanceof Uint8Array)){if(!e)throw new Fl(e);if(typeof e!="object")throw new Fl(e);if(!("BYTES_PER_ELEMENT"in e))throw new Fl(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new Fl(e)}}function CF(...e){let t=0;for(const n of e)t+=n.length;const r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){const a=e[n];r.set(a,s),s+=a.length}return r}function Op(e){return e instanceof Uint8Array?e:typeof e=="string"?cs(e):TF(e)}function TF(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function cs(e,t={}){const{size:r}=t;let n=e;r&&(Il(e,r),n=Ks(e,r));let s=n.slice(2);s.length%2&&(s=`0${s}`);const a=s.length/2,o=new Uint8Array(a);for(let i=0,c=0;i<a;i++){const l=ly(s.charCodeAt(c++)),u=ly(s.charCodeAt(c++));if(l===void 0||u===void 0)throw new oe(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[i]=l<<4|u}return o}function xy(e,t={}){const{size:r}=t,n=EF.encode(e);return typeof r=="number"?(Ya(n,r),SF(n,r)):n}function SF(e,t){return uF(e,{dir:"right",size:t})}function AF(e){return crypto.getRandomValues(new Uint8Array(e))}function Ka(e){return e.length}function PF(e,t,r,n={}){const{strict:s}=n;return e.slice(t,r)}function IF(e,t={}){const{size:r}=t;typeof r<"u"&&Ya(e,r);const n=Pt(e,t);return bt(n,t)}function BF(e,t={}){const{size:r}=t;let n=e;if(typeof r<"u"&&(Ya(n,r),n=wy(n)),n.length>1||n[0]>1)throw new OF(n);return!!n[0]}function In(e,t={}){const{size:r}=t;typeof r<"u"&&Ya(e,r);const n=Pt(e,t);return Ii(n,t)}function FF(e,t={}){const{size:r}=t;let n=e;return typeof r<"u"&&(Ya(n,r),n=vy(n)),vF.decode(n)}function wy(e){return uy(e,{dir:"left"})}function vy(e){return uy(e,{dir:"right"})}function UF(e){try{return kF(e),!0}catch{return!1}}class OF extends oe{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class Fl extends oe{constructor(t){super(`Value \`${typeof t=="object"?Ai(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class DF extends oe{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class _F extends oe{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}class MF extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const Dp={checksum:new MF(8192)}.checksum;function Bi(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=sb(Op(e));return r==="Bytes"?n:Pt(n)}function NF(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=H1(Op(e));return r==="Bytes"?n:Pt(n)}function LF(e){return Nr(e)&&ht(e)===32}function Ey(e,t={}){const{compressed:r}=t,{prefix:n,x:s,y:a}=e;if(r===!1||typeof s=="bigint"&&typeof a=="bigint"){if(n!==4)throw new Cy({prefix:n,cause:new jF});return}if(r===!0||typeof s=="bigint"&&typeof a>"u"){if(n!==3&&n!==2)throw new Cy({prefix:n,cause:new GF});return}throw new $F({publicKey:e})}function zF(e){const t=(()=>{if(Nr(e))return ky(e);if(UF(e))return RF(e);const{prefix:r,x:n,y:s}=e;return typeof n=="bigint"&&typeof s=="bigint"?{prefix:r??4,x:n,y:s}:{prefix:r,x:n}})();return Ey(t),t}function RF(e){return ky(Pt(e))}function ky(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new VF({publicKey:e});if(e.length===130){const n=BigInt(Pe(e,0,32)),s=BigInt(Pe(e,32,64));return{prefix:4,x:n,y:s}}if(e.length===132){const n=Number(Pe(e,0,1)),s=BigInt(Pe(e,1,33)),a=BigInt(Pe(e,33,65));return{prefix:n,x:s,y:a}}const t=Number(Pe(e,0,1)),r=BigInt(Pe(e,1,33));return{prefix:t,x:r}}function HF(e,t={}){return cs(_p(e,t))}function _p(e,t={}){Ey(e);const{prefix:r,x:n,y:s}=e,{includePrefix:a=!0}=t;return pt(a?X(r,{size:1}):"0x",X(n,{size:32}),typeof s=="bigint"?X(s,{size:32}):"0x")}class $F extends oe{constructor({publicKey:t}){super(`Value \`${Ai(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Cy extends oe{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class GF extends oe{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class jF extends oe{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let VF=class extends oe{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${ht(Bl(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const WF=/^0x[a-fA-F0-9]{40}$/;function Lr(e,t={}){const{strict:r=!0}=t;if(!WF.test(e))throw new Ty({address:e,cause:new YF});if(r){if(e.toLowerCase()===e)return;if(Mp(e)!==e)throw new Ty({address:e,cause:new KF})}}function Mp(e){if(Dp.has(e))return Dp.get(e);Lr(e,{strict:!1});const t=e.substring(2).toLowerCase(),r=Bi(xy(t),{as:"Bytes"}),n=t.split("");for(let a=0;a<40;a+=2)r[a>>1]>>4>=8&&n[a]&&(n[a]=n[a].toUpperCase()),(r[a>>1]&15)>=8&&n[a+1]&&(n[a+1]=n[a+1].toUpperCase());const s=`0x${n.join("")}`;return Dp.set(e,s),s}function qF(e,t={}){const{checksum:r=!1}=t;return Lr(e),r?Mp(e):e}function Ul(e,t={}){const r=Bi(`0x${_p(e).slice(4)}`).substring(26);return qF(`0x${r}`,t)}function Np(e,t){return Lr(e,{strict:!1}),Lr(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function Ol(e,t={}){const{strict:r=!0}=t??{};try{return Lr(e,{strict:r}),!0}catch{return!1}}class Ty extends oe{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class YF extends oe{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class KF extends oe{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const er=BigInt(0),Vt=BigInt(1),Zs=BigInt(2),ZF=BigInt(3),Sy=BigInt(4),Ay=BigInt(5),Py=BigInt(8);function tr(e,t){const r=e%t;return r>=er?r:t+r}function Cr(e,t,r){let n=e;for(;t-- >er;)n*=n,n%=r;return n}function Lp(e,t){if(e===er)throw new Error("invert: expected non-zero number");if(t<=er)throw new Error("invert: expected positive modulus, got "+t);let r=tr(e,t),n=t,s=er,a=Vt;for(;r!==er;){const i=n/r,c=n%r,l=s-a*i;n=r,r=c,s=a,a=l}if(n!==Vt)throw new Error("invert: does not exist");return tr(s,t)}function Iy(e,t){const r=(e.ORDER+Vt)/Sy,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function XF(e,t){const r=(e.ORDER-Ay)/Py,n=e.mul(t,Zs),s=e.pow(n,r),a=e.mul(t,s),o=e.mul(e.mul(a,Zs),s),i=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(i),t))throw new Error("Cannot find square root");return i}function QF(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Vt,r=0;for(;t%Zs===er;)t/=Zs,r++;let n=Zs;const s=Za(e);for(;Fy(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Iy;let a=s.pow(n,t);const o=(t+Vt)/Zs;return function(c,l){if(c.is0(l))return l;if(Fy(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,a),f=c.pow(l,t),m=c.pow(l,o);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let y=1,g=c.sqr(f);for(;!c.eql(g,c.ONE);)if(y++,g=c.sqr(g),y===u)throw new Error("Cannot find square root");const E=Vt<<BigInt(u-y-1),w=c.pow(d,E);u=y,d=c.sqr(w),f=c.mul(f,d),m=c.mul(m,w)}return m}}function JF(e){return e%Sy===ZF?Iy:e%Py===Ay?XF:QF(e)}const eU=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tU(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=eU.reduce((n,s)=>(n[s]="function",n),t);return Pl(e,r)}function rU(e,t,r){if(r<er)throw new Error("invalid exponent, negatives unsupported");if(r===er)return e.ONE;if(r===Vt)return t;let n=e.ONE,s=t;for(;r>er;)r&Vt&&(n=e.mul(n,s)),s=e.sqr(s),r>>=Vt;return n}function By(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),s=t.reduce((o,i,c)=>e.is0(i)?o:(n[c]=o,e.mul(o,i)),e.ONE),a=e.inv(s);return t.reduceRight((o,i,c)=>e.is0(i)?o:(n[c]=e.mul(o,n[c]),e.mul(o,i)),a),n}function Fy(e,t){const r=(e.ORDER-Vt)/Zs,n=e.pow(t,r),s=e.eql(n,e.ONE),a=e.eql(n,e.ZERO),o=e.eql(n,e.neg(e.ONE));if(!s&&!a&&!o)throw new Error("invalid Legendre symbol result");return s?1:a?0:-1}function Uy(e,t){t!==void 0&&Lo(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Za(e,t,r=!1,n={}){if(e<=er)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=Uy(e,t);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const i=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:a,MASK:Al(s),ZERO:er,ONE:Vt,create:c=>tr(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return er<=c&&c<e},is0:c=>c===er,isOdd:c=>(c&Vt)===Vt,neg:c=>tr(-c,e),eql:(c,l)=>c===l,sqr:c=>tr(c*c,e),add:(c,l)=>tr(c+l,e),sub:(c,l)=>tr(c-l,e),mul:(c,l)=>tr(c*l,e),pow:(c,l)=>rU(i,c,l),div:(c,l)=>tr(c*Lp(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Lp(c,e),sqrt:n.sqrt||(c=>(o||(o=JF(e)),o(i,c))),toBytes:c=>r?ay(c,a):Si(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return r?sy(c):qs(c)},invertBatch:c=>By(i,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(i)}function Oy(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Dy(e){const t=Oy(e);return t+Math.ceil(t/2)}function nU(e,t,r=!1){const n=e.length,s=Oy(t),a=Dy(t);if(n<16||n<a||n>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+n);const o=r?sy(e):qs(e),i=tr(o,t-Vt)+Vt;return r?ay(i,s):Si(i,s)}class _y extends Rd{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,x8(t);const n=Rc(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(n.length>s?t.create().update(n).digest():n);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),es(a)}update(t){return Pa(this),this.iHash.update(t),this}digestInto(t){Pa(this),zs(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:s,destroyed:a,blockLen:o,outputLen:i}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=i,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const My=(e,t,r)=>new _y(e,t).update(r).digest();My.create=(e,t)=>new _y(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ny=BigInt(0),zp=BigInt(1);function Rp(e,t){const r=t.negate();return e?r:t}function Ly(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Hp(e,t){Ly(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),s=2**e,a=Al(e),o=BigInt(e);return{windows:r,windowSize:n,mask:a,maxNumber:s,shiftBy:o}}function zy(e,t,r){const{windowSize:n,mask:s,maxNumber:a,shiftBy:o}=r;let i=Number(e&s),c=e>>o;i>n&&(i-=a,c+=zp);const l=t*n,u=l+Math.abs(i)-1,d=i===0,f=i<0,m=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:m,offsetF:l}}function sU(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function aU(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const $p=new WeakMap,Ry=new WeakMap;function Gp(e){return Ry.get(e)||1}function oU(e,t){return{constTimeNegate:Rp,hasPrecomputes(r){return Gp(r)!==1},unsafeLadder(r,n,s=e.ZERO){let a=r;for(;n>Ny;)n&zp&&(s=s.add(a)),a=a.double(),n>>=zp;return s},precomputeWindow(r,n){const{windows:s,windowSize:a}=Hp(n,t),o=[];let i=r,c=i;for(let l=0;l<s;l++){c=i,o.push(c);for(let u=1;u<a;u++)c=c.add(i),o.push(c);i=c.double()}return o},wNAF(r,n,s){let a=e.ZERO,o=e.BASE;const i=Hp(r,t);for(let c=0;c<i.windows;c++){const{nextN:l,offset:u,isZero:d,isNeg:f,isNegF:m,offsetF:y}=zy(s,c,i);s=l,d?o=o.add(Rp(m,n[y])):a=a.add(Rp(f,n[u]))}return{p:a,f:o}},wNAFUnsafe(r,n,s,a=e.ZERO){const o=Hp(r,t);for(let i=0;i<o.windows&&s!==Ny;i++){const{nextN:c,offset:l,isZero:u,isNeg:d}=zy(s,i,o);if(s=c,!u){const f=n[l];a=a.add(d?f.negate():f)}}return a},getPrecomputes(r,n,s){let a=$p.get(n);return a||(a=this.precomputeWindow(n,r),r!==1&&$p.set(n,s(a))),a},wNAFCached(r,n,s){const a=Gp(r);return this.wNAF(a,this.getPrecomputes(a,r,s),n)},wNAFCachedUnsafe(r,n,s,a){const o=Gp(r);return o===1?this.unsafeLadder(r,n,a):this.wNAFUnsafe(o,this.getPrecomputes(o,r,s),n,a)},setWindowSize(r,n){Ly(n,t),Ry.set(r,n),$p.delete(r)}}}function iU(e,t,r,n){sU(r,e),aU(n,t);const s=r.length,a=n.length;if(s!==a)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,i=aF(BigInt(s));let c=1;i>12?c=i-3:i>4?c=i-2:i>0&&(c=2);const l=Al(c),u=new Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c;let f=o;for(let m=d;m>=0;m-=c){u.fill(o);for(let g=0;g<a;g++){const E=n[g],w=Number(E>>BigInt(m)&l);u[w]=u[w].add(r[g])}let y=o;for(let g=u.length-1,E=o;g>0;g--)E=E.add(u[g]),y=y.add(E);if(f=f.add(y),m!==0)for(let g=0;g<c;g++)f=f.double()}return f}function Hy(e){return tU(e.Fp),Pl(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Uy(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $y(e){e.lowS!==void 0&&Ci("lowS",e.lowS),e.prehash!==void 0&&Ci("prehash",e.prehash)}function cU(e){const t=Hy(e);Pl(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:r,Fp:n,a:s}=t;if(r){if(!n.eql(s,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class lU extends Error{constructor(t=""){super(t)}}const Bn={Err:lU,_tlv:{encode:(e,t)=>{const{Err:r}=Bn;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,s=Cl(n);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const a=n>127?Cl(s.length/2|128):"";return Cl(e)+a+s+t},decode(e,t){const{Err:r}=Bn;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[n++],a=!!(s&128);let o=0;if(!a)o=s;else{const c=s&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const l=t.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const i=t.subarray(n,n+o);if(i.length!==o)throw new r("tlv.decode: wrong value length");return{v:i,l:t.subarray(n+o)}}},_int:{encode(e){const{Err:t}=Bn;if(e<Fn)throw new t("integer: negative integers are not allowed");let r=Cl(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=Bn;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return qs(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=Bn,s=kr("signature",e),{v:a,l:o}=n.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:i,l:c}=n.decode(2,a),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(i),s:r.decode(l)}},hexFromSig(e){const{_tlv:t,_int:r}=Bn,n=t.encode(2,r.encode(e.r)),s=t.encode(2,r.encode(e.s)),a=n+s;return t.encode(48,a)}};function jp(e,t){return Ti(Si(e,t))}const Fn=BigInt(0),It=BigInt(1);BigInt(2);const Vp=BigInt(3),uU=BigInt(4);function dU(e){const t=cU(e),{Fp:r}=t,n=Za(t.n,t.nBitLength),s=t.toBytes||((S,C,D)=>{const L=C.toAffine();return Sl(Uint8Array.from([4]),r.toBytes(L.x),r.toBytes(L.y))}),a=t.fromBytes||(S=>{const C=S.subarray(1),D=r.fromBytes(C.subarray(0,r.BYTES)),L=r.fromBytes(C.subarray(r.BYTES,2*r.BYTES));return{x:D,y:L}});function o(S){const{a:C,b:D}=t,L=r.sqr(S),T=r.mul(L,S);return r.add(r.add(T,r.mul(S,C)),D)}function i(S,C){const D=r.sqr(C),L=o(S);return r.eql(D,L)}if(!i(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=r.mul(r.pow(t.a,Vp),uU),l=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,l)))throw new Error("bad curve params: a or b");function u(S){return Bp(S,It,t.n)}function d(S){const{allowedPrivateKeyLengths:C,nByteLength:D,wrapPrivateKey:L,n:T}=t;if(C&&typeof S!="bigint"){if(ki(S)&&(S=Ti(S)),typeof S!="string"||!C.includes(S.length))throw new Error("invalid private key");S=S.padStart(D*2,"0")}let h;try{h=typeof S=="bigint"?S:qs(kr("private key",S,D))}catch{throw new Error("invalid private key, expected hex or "+D+" bytes, got "+typeof S)}return L&&(h=tr(h,T)),qa("private key",h,It,T),h}function f(S){if(!(S instanceof g))throw new Error("ProjectivePoint expected")}const m=iy((S,C)=>{const{px:D,py:L,pz:T}=S;if(r.eql(T,r.ONE))return{x:D,y:L};const h=S.is0();C==null&&(C=h?r.ONE:r.inv(T));const b=r.mul(D,C),x=r.mul(L,C),A=r.mul(T,C);if(h)return{x:r.ZERO,y:r.ZERO};if(!r.eql(A,r.ONE))throw new Error("invZ was invalid");return{x:b,y:x}}),y=iy(S=>{if(S.is0()){if(t.allowInfinityPoint&&!r.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:C,y:D}=S.toAffine();if(!r.isValid(C)||!r.isValid(D))throw new Error("bad point: x or y not FE");if(!i(C,D))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(C,D,L){if(C==null||!r.isValid(C))throw new Error("x required");if(D==null||!r.isValid(D)||r.is0(D))throw new Error("y required");if(L==null||!r.isValid(L))throw new Error("z required");this.px=C,this.py=D,this.pz=L,Object.freeze(this)}static fromAffine(C){const{x:D,y:L}=C||{};if(!C||!r.isValid(D)||!r.isValid(L))throw new Error("invalid affine point");if(C instanceof g)throw new Error("projective point not allowed");const T=h=>r.eql(h,r.ZERO);return T(D)&&T(L)?g.ZERO:new g(D,L,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const D=By(r,C.map(L=>L.pz));return C.map((L,T)=>L.toAffine(D[T])).map(g.fromAffine)}static fromHex(C){const D=g.fromAffine(a(kr("pointHex",C)));return D.assertValidity(),D}static fromPrivateKey(C){return g.BASE.multiply(d(C))}static msm(C,D){return iU(g,n,C,D)}_setWindowSize(C){v.setWindowSize(this,C)}assertValidity(){y(this)}hasEvenY(){const{y:C}=this.toAffine();if(r.isOdd)return!r.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){f(C);const{px:D,py:L,pz:T}=this,{px:h,py:b,pz:x}=C,A=r.eql(r.mul(D,x),r.mul(h,T)),I=r.eql(r.mul(L,x),r.mul(b,T));return A&&I}negate(){return new g(this.px,r.neg(this.py),this.pz)}double(){const{a:C,b:D}=t,L=r.mul(D,Vp),{px:T,py:h,pz:b}=this;let x=r.ZERO,A=r.ZERO,I=r.ZERO,F=r.mul(T,T),_=r.mul(h,h),k=r.mul(b,b),P=r.mul(T,h);return P=r.add(P,P),I=r.mul(T,b),I=r.add(I,I),x=r.mul(C,I),A=r.mul(L,k),A=r.add(x,A),x=r.sub(_,A),A=r.add(_,A),A=r.mul(x,A),x=r.mul(P,x),I=r.mul(L,I),k=r.mul(C,k),P=r.sub(F,k),P=r.mul(C,P),P=r.add(P,I),I=r.add(F,F),F=r.add(I,F),F=r.add(F,k),F=r.mul(F,P),A=r.add(A,F),k=r.mul(h,b),k=r.add(k,k),F=r.mul(k,P),x=r.sub(x,F),I=r.mul(k,_),I=r.add(I,I),I=r.add(I,I),new g(x,A,I)}add(C){f(C);const{px:D,py:L,pz:T}=this,{px:h,py:b,pz:x}=C;let A=r.ZERO,I=r.ZERO,F=r.ZERO;const _=t.a,k=r.mul(t.b,Vp);let P=r.mul(D,h),O=r.mul(L,b),U=r.mul(T,x),z=r.add(D,L),H=r.add(h,b);z=r.mul(z,H),H=r.add(P,O),z=r.sub(z,H),H=r.add(D,T);let G=r.add(h,x);return H=r.mul(H,G),G=r.add(P,U),H=r.sub(H,G),G=r.add(L,T),A=r.add(b,x),G=r.mul(G,A),A=r.add(O,U),G=r.sub(G,A),F=r.mul(_,H),A=r.mul(k,U),F=r.add(A,F),A=r.sub(O,F),F=r.add(O,F),I=r.mul(A,F),O=r.add(P,P),O=r.add(O,P),U=r.mul(_,U),H=r.mul(k,H),O=r.add(O,U),U=r.sub(P,U),U=r.mul(_,U),H=r.add(H,U),P=r.mul(O,H),I=r.add(I,P),P=r.mul(G,H),A=r.mul(z,A),A=r.sub(A,P),P=r.mul(z,O),F=r.mul(G,F),F=r.add(F,P),new g(A,I,F)}subtract(C){return this.add(C.negate())}is0(){return this.equals(g.ZERO)}wNAF(C){return v.wNAFCached(this,C,g.normalizeZ)}multiplyUnsafe(C){const{endo:D,n:L}=t;qa("scalar",C,Fn,L);const T=g.ZERO;if(C===Fn)return T;if(this.is0()||C===It)return this;if(!D||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,C,g.normalizeZ);let{k1neg:h,k1:b,k2neg:x,k2:A}=D.splitScalar(C),I=T,F=T,_=this;for(;b>Fn||A>Fn;)b&It&&(I=I.add(_)),A&It&&(F=F.add(_)),_=_.double(),b>>=It,A>>=It;return h&&(I=I.negate()),x&&(F=F.negate()),F=new g(r.mul(F.px,D.beta),F.py,F.pz),I.add(F)}multiply(C){const{endo:D,n:L}=t;qa("scalar",C,It,L);let T,h;if(D){const{k1neg:b,k1:x,k2neg:A,k2:I}=D.splitScalar(C);let{p:F,f:_}=this.wNAF(x),{p:k,f:P}=this.wNAF(I);F=v.constTimeNegate(b,F),k=v.constTimeNegate(A,k),k=new g(r.mul(k.px,D.beta),k.py,k.pz),T=F.add(k),h=_.add(P)}else{const{p:b,f:x}=this.wNAF(C);T=b,h=x}return g.normalizeZ([T,h])[0]}multiplyAndAddUnsafe(C,D,L){const T=g.BASE,h=(x,A)=>A===Fn||A===It||!x.equals(T)?x.multiplyUnsafe(A):x.multiply(A),b=h(this,D).add(h(C,L));return b.is0()?void 0:b}toAffine(C){return m(this,C)}isTorsionFree(){const{h:C,isTorsionFree:D}=t;if(C===It)return!0;if(D)return D(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:D}=t;return C===It?this:D?D(g,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return Ci("isCompressed",C),this.assertValidity(),s(g,this,C)}toHex(C=!0){return Ci("isCompressed",C),Ti(this.toRawBytes(C))}}g.BASE=new g(t.Gx,t.Gy,r.ONE),g.ZERO=new g(r.ZERO,r.ONE,r.ZERO);const{endo:E,nBitLength:w}=t,v=oU(g,E?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:u}}function pU(e){const t=Hy(e);return Pl(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function fU(e){const t=pU(e),{Fp:r,n,nByteLength:s,nBitLength:a}=t,o=r.BYTES+1,i=2*r.BYTES+1;function c(k){return tr(k,n)}function l(k){return Lp(k,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:m}=dU({...t,toBytes(k,P,O){const U=P.toAffine(),z=r.toBytes(U.x),H=Sl;return Ci("isCompressed",O),O?H(Uint8Array.from([P.hasEvenY()?2:3]),z):H(Uint8Array.from([4]),z,r.toBytes(U.y))},fromBytes(k){const P=k.length,O=k[0],U=k.subarray(1);if(P===o&&(O===2||O===3)){const z=qs(U);if(!Bp(z,It,r.ORDER))throw new Error("Point is not on curve");const H=f(z);let G;try{G=r.sqrt(H)}catch(he){const ie=he instanceof Error?": "+he.message:"";throw new Error("Point is not on curve"+ie)}const J=(G&It)===It;return(O&1)===1!==J&&(G=r.neg(G)),{x:z,y:G}}else if(P===i&&O===4){const z=r.fromBytes(U.subarray(0,r.BYTES)),H=r.fromBytes(U.subarray(r.BYTES,2*r.BYTES));return{x:z,y:H}}else{const z=o,H=i;throw new Error("invalid Point, expected length of "+z+", or uncompressed "+H+", got "+P)}}});function y(k){const P=n>>It;return k>P}function g(k){return y(k)?c(-k):k}const E=(k,P,O)=>qs(k.slice(P,O));class w{constructor(P,O,U){qa("r",P,It,n),qa("s",O,It,n),this.r=P,this.s=O,U!=null&&(this.recovery=U),Object.freeze(this)}static fromCompact(P){const O=s;return P=kr("compactSignature",P,O*2),new w(E(P,0,O),E(P,O,2*O))}static fromDER(P){const{r:O,s:U}=Bn.toSig(kr("DER",P));return new w(O,U)}assertValidity(){}addRecoveryBit(P){return new w(this.r,this.s,P)}recoverPublicKey(P){const{r:O,s:U,recovery:z}=this,H=T(kr("msgHash",P));if(z==null||![0,1,2,3].includes(z))throw new Error("recovery id invalid");const G=z===2||z===3?O+t.n:O;if(G>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const J=(z&1)===0?"02":"03",pe=u.fromHex(J+jp(G,r.BYTES)),he=l(G),ie=c(-H*he),de=c(U*he),Be=u.BASE.multiplyAndAddUnsafe(pe,ie,de);if(!Be)throw new Error("point at infinify");return Be.assertValidity(),Be}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Tl(this.toDERHex())}toDERHex(){return Bn.hexFromSig(this)}toCompactRawBytes(){return Tl(this.toCompactHex())}toCompactHex(){const P=s;return jp(this.r,P)+jp(this.s,P)}}const v={isValidPrivateKey(k){try{return d(k),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const k=Dy(t.n);return nU(t.randomBytes(k),t.n)},precompute(k=8,P=u.BASE){return P._setWindowSize(k),P.multiply(BigInt(3)),P}};function S(k,P=!0){return u.fromPrivateKey(k).toRawBytes(P)}function C(k){if(typeof k=="bigint")return!1;if(k instanceof u)return!0;const O=kr("key",k).length,U=r.BYTES,z=U+1,H=2*U+1;if(!(t.allowedPrivateKeyLengths||s===z))return O===z||O===H}function D(k,P,O=!0){if(C(k)===!0)throw new Error("first arg must be private key");if(C(P)===!1)throw new Error("second arg must be public key");return u.fromHex(P).multiply(d(k)).toRawBytes(O)}const L=t.bits2int||function(k){if(k.length>8192)throw new Error("input is too large");const P=qs(k),O=k.length*8-a;return O>0?P>>BigInt(O):P},T=t.bits2int_modN||function(k){return c(L(k))},h=Al(a);function b(k){return qa("num < 2^"+a,k,Fn,h),Si(k,s)}function x(k,P,O=A){if(["recovered","canonical"].some(we=>we in O))throw new Error("sign() legacy options not supported");const{hash:U,randomBytes:z}=t;let{lowS:H,prehash:G,extraEntropy:J}=O;H==null&&(H=!0),k=kr("msgHash",k),$y(O),G&&(k=kr("prehashed msgHash",U(k)));const pe=T(k),he=d(P),ie=[b(he),b(pe)];if(J!=null&&J!==!1){const we=J===!0?z(r.BYTES):J;ie.push(kr("extraEntropy",we))}const de=Sl(...ie),Be=pe;function Q(we){const _e=L(we);if(!m(_e))return;const $e=l(_e),ot=u.BASE.multiply(_e).toAffine(),Se=c(ot.x);if(Se===Fn)return;const ve=c($e*c(Be+Se*he));if(ve===Fn)return;let be=(ot.x===Se?0:2)|Number(ot.y&It),Ze=ve;return H&&y(ve)&&(Ze=g(ve),be^=1),new w(Se,Ze,be)}return{seed:de,k2sig:Q}}const A={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function F(k,P,O=A){const{seed:U,k2sig:z}=x(k,P,O),H=t;return oF(H.hash.outputLen,H.nByteLength,H.hmac)(U,z)}u.BASE._setWindowSize(8);function _(k,P,O,U=I){var be;const z=k;P=kr("msgHash",P),O=kr("publicKey",O);const{lowS:H,prehash:G,format:J}=U;if($y(U),"strict"in U)throw new Error("options.strict was renamed to lowS");if(J!==void 0&&J!=="compact"&&J!=="der")throw new Error("format must be compact or der");const pe=typeof z=="string"||ki(z),he=!pe&&!J&&typeof z=="object"&&z!==null&&typeof z.r=="bigint"&&typeof z.s=="bigint";if(!pe&&!he)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ie,de;try{if(he&&(ie=new w(z.r,z.s)),pe){try{J!=="compact"&&(ie=w.fromDER(z))}catch(Ze){if(!(Ze instanceof Bn.Err))throw Ze}!ie&&J!=="der"&&(ie=w.fromCompact(z))}de=u.fromHex(O)}catch{return!1}if(!ie||H&&ie.hasHighS())return!1;G&&(P=t.hash(P));const{r:Be,s:Q}=ie,we=T(P),_e=l(Q),$e=c(we*_e),ot=c(Be*_e),Se=(be=u.BASE.multiplyAndAddUnsafe(de,$e,ot))==null?void 0:be.toAffine();return Se?c(Se.x)===Be:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:D,sign:F,verify:_,ProjectivePoint:u,Signature:w,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function mU(e){return{hash:e,hmac:(t,...r)=>My(e,t,T8(...r)),randomBytes:S8}}function Dl(e,t){const r=n=>fU({...e,...mU(n)});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gy=Za(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),hU=Gy.create(BigInt("-3")),bU=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),yU=Dl({a:hU,b:bU,Fp:Gy,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},Hd),jy=Za(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff")),gU=jy.create(BigInt("-3")),xU=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");Dl({a:gU,b:xU,Fp:jy,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},q8);const Vy=Za(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),wU=Vy.create(BigInt("-3")),vU=BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");Dl({a:wU,b:vU,Fp:Vy,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},W8);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const EU=yU;function Wy(e){const{hash:t,payload:r,publicKey:n,signature:s}=e;return EU.verify(s,r instanceof Uint8Array?r:cs(r),_p(n).substring(2),...t?[{prehash:!0,lowS:!0}]:[])}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qy=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Yy=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),kU=BigInt(0),CU=BigInt(1),Wp=BigInt(2),Ky=(e,t)=>(e+t/Wp)/t;function TU(e){const t=qy,r=BigInt(3),n=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),i=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Cr(u,r,t)*u%t,f=Cr(d,r,t)*u%t,m=Cr(f,Wp,t)*l%t,y=Cr(m,s,t)*m%t,g=Cr(y,a,t)*y%t,E=Cr(g,i,t)*g%t,w=Cr(E,c,t)*E%t,v=Cr(w,i,t)*g%t,S=Cr(v,r,t)*u%t,C=Cr(S,o,t)*y%t,D=Cr(C,n,t)*l%t,L=Cr(D,Wp,t);if(!qp.eql(qp.sqr(L),e))throw new Error("Cannot find square root");return L}const qp=Za(qy,void 0,void 0,{sqrt:TU}),Fi=Dl({a:kU,b:BigInt(7),Fp:qp,n:Yy,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Yy,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-CU*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,o=BigInt("0x100000000000000000000000000000000"),i=Ky(a*e,t),c=Ky(-n*e,t);let l=tr(e-i*r-c*s,t),u=tr(-i*n-c*a,t);const d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Hd),SU=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Fi},Symbol.toStringTag,{value:"Module"}));function Zy(e){return Ul(AU(e))}function AU(e){const{payload:t,signature:r}=e,{r:n,s,yParity:a}=r,i=new Fi.Signature(BigInt(n),BigInt(s)).addRecoveryBit(a).recoverPublicKey(Bl(t).substring(2));return zF(i)}function PU(e){const{address:t,hash:r,payload:n,publicKey:s,signature:a}=e;return t?Np(t,Zy({payload:n,signature:a})):Fi.verify(a,Op(n),HF(s),...r?[{prehash:!0,lowS:!0}]:[])}const IU=/^(.*)\[([0-9]*)\]$/,BU=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Xy=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Qy=2n**256n-1n;function _l(e,t={}){const{recovered:r}=t;if(typeof e.r>"u")throw new Qp({signature:e});if(typeof e.s>"u")throw new Qp({signature:e});if(r&&typeof e.yParity>"u")throw new Qp({signature:e});if(e.r<0n||e.r>Qy)throw new NU({value:e.r});if(e.s<0n||e.s>Qy)throw new LU({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Nl({value:e.yParity})}function FU(e){return Yp(Pt(e))}function Yp(e){if(e.length!==130&&e.length!==132)throw new MU({signature:e});const t=BigInt(Pe(e,0,32)),r=BigInt(Pe(e,32,64)),n=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return Zp(s)}catch{throw new Nl({value:s})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function Jy(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Ml(e)}function Ml(e){const t=typeof e=="string"?Yp(e):e instanceof Uint8Array?FU(e):typeof e.r=="string"?Kp(e):e.v?UU(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return _l(t),t}function UU(e){return{r:e.r,s:e.s,yParity:Zp(e.v)}}function Kp(e){const t=(()=>{const r=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=Zp(r)),typeof n!="number")throw new Nl({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function OU(e){const[t,r,n]=e;return Ml({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function DU(e){_l(e);const t=e.r,r=e.s;return pt(X(t,{size:32}),X(r,{size:32}),typeof e.yParity=="number"?X(Xp(e.yParity),{size:1}):"0x")}function eg(e){const{r:t,s:r,yParity:n}=e;return{r:X(t,{size:32}),s:X(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function _U(e){const{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":Up(X(t)),r===0n?"0x":Up(X(r))]}function Zp(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new zU({value:e})}function Xp(e){if(e===0)return 27;if(e===1)return 28;throw new Nl({value:e})}class MU extends oe{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ht(Bl(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Qp extends oe{constructor({signature:t}){super(`Signature \`${Ai(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class NU extends oe{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class LU extends oe{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Nl extends oe{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class zU extends oe{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}const RU=new TextEncoder;Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[t,e.charCodeAt(0)]);const Ll={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[e.charCodeAt(0),t])),61:0,45:62,95:63};function HU(e){const t=e.replace(/=+$/,""),r=t.length,n=new Uint8Array(r+3);RU.encodeInto(t+"===",n);for(let a=0,o=0;a<t.length;a+=4,o+=3){const i=(Ll[n[a]]<<18)+(Ll[n[a+1]]<<12)+(Ll[n[a+2]]<<6)+Ll[n[a+3]];n[o]=i>>16,n[o+1]=i>>8&255,n[o+2]=i&255}const s=(r>>2)*3+(r%4&&r%4-1);return new Uint8Array(n.buffer,0,s)}Uint8Array.from([105,171,180,181,160,222,75,198,42,42,32,31,141,37,186,233]);function $U(e){const{challenge:t,hash:r=!0,metadata:n,publicKey:s,signature:a}=e,{authenticatorData:o,challengeIndex:i,clientDataJSON:c,typeIndex:l,userVerificationRequired:u}=n,d=cs(o);if(d.length<37)return!1;const f=d[32];if((f&1)!==1||u&&(f&4)!==4||(f&8)!==8&&(f&16)===16)return!1;if(l!==void 0){const v='"type":"webauthn.get"';if(v!==c.slice(Number(l),v.length+1))return!1}const m=i!==void 0?c.slice(Number(i)).match(/^"challenge":"(.*?)"/):c.match(/"challenge":"(.*?)"/);if(!m)return!1;const[y,g]=m;if(Pt(HU(g))!==t)return!1;const E=NF(xy(c),{as:"Bytes"}),w=CF(d,E);return Wy({hash:r,payload:w,publicKey:s,signature:a})}const Jp="0x01",ef="0x02",tg="0x03",Xs="0x7777777777777777777777777777777777777777777777777777777777777777";function Xa(e){const t=e.endsWith(Xs.slice(2))?Pe(e,0,-ht(Xs)):e;if(ht(t)===65){const o=Yp(t);return _l(o),{signature:o,type:"secp256k1"}}const n=Pe(t,0,1),s=Pe(t,1),a=ht(s);if(n===Jp){if(a!==129)throw new Di({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${a} bytes`,serialized:t});return{publicKey:{prefix:4,x:bt(Pe(s,64,96)),y:bt(Pe(s,96,128))},prehash:Ii(Pe(s,128,129))!==0,signature:{r:bt(Pe(s,0,32)),s:bt(Pe(s,32,64))},type:"p256"}}if(n===ef){if(a<128)throw new Di({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${a} bytes`,serialized:t});const o=a-128,i=Pe(s,0,o);let c,l;for(let u=37;u<o;u++){const d=my(Pe(i,u));if(d.startsWith("{")&&d.endsWith("}"))try{JSON.parse(d),c=Pe(i,0,u),l=d;break}catch{}}if(!c||!l)throw new Di({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:t});return{publicKey:{prefix:4,x:bt(Pe(s,o+64,o+96)),y:bt(Pe(s,o+96,o+128))},metadata:{authenticatorData:c,clientDataJSON:l},signature:{r:bt(Pe(s,o,o+32)),s:bt(Pe(s,o+32,o+64))},type:"webAuthn"}}if(n===tg){const o=Pe(s,0,20),i=Xa(Pe(s,20));return{userAddress:o,inner:i,type:"keychain"}}throw new Di({reason:`Unknown signature type identifier: ${n}. Expected ${Jp} (P256) or ${ef} (WebAuthn)`,serialized:t})}function Ui(e){if(typeof e=="string")return Xa(e);if(typeof e=="object"&&e!==null&&"r"in e&&"s"in e&&"yParity"in e)return{signature:e,type:"secp256k1"};const t=tf(e);return{...e,...t==="p256"?{prehash:e.prehash}:{},type:t}}function zl(e){if(e.type==="secp256k1")return{signature:Kp(e),type:"secp256k1"};if(e.type==="p256")return{prehash:e.preHash,publicKey:{prefix:4,x:bt(e.pubKeyX),y:bt(e.pubKeyY)},signature:{r:bt(e.r),s:bt(e.s)},type:"p256"};if(e.type==="webAuthn"){const t=e.webauthnData,r=ht(t);let n,s;for(let a=37;a<r;a++){const o=my(Pe(t,a));if(o.startsWith("{")&&o.endsWith("}"))try{JSON.parse(o),n=Pe(t,0,a),s=o;break}catch{}}if(!n||!s)throw new Di({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:t});return{metadata:{authenticatorData:n,clientDataJSON:s},publicKey:{prefix:4,x:bt(e.pubKeyX),y:bt(e.pubKeyY)},signature:{r:bt(e.r),s:bt(e.s)},type:"webAuthn"}}if(e.type==="keychain"||"userAddress"in e&&"signature"in e)return{type:"keychain",userAddress:e.userAddress,inner:zl(e.signature)};throw new Oi({envelope:e})}function tf(e){if(typeof e!="object"||e===null)throw new Oi({envelope:e});if("type"in e&&e.type)return e.type;if("signature"in e&&!("publicKey"in e)&&typeof e.signature=="object"&&e.signature!==null&&"r"in e.signature&&"s"in e.signature&&"yParity"in e.signature||"r"in e&&"s"in e&&"yParity"in e)return"secp256k1";if("signature"in e&&"prehash"in e&&"publicKey"in e&&typeof e.prehash=="boolean")return"p256";if("signature"in e&&"metadata"in e&&"publicKey"in e)return"webAuthn";if("userAddress"in e&&"inner"in e)return"keychain";throw new Oi({envelope:e})}function Rl(e,t={}){const r=tf(e);if(r==="secp256k1")return pt(DU(e.signature),t.magic?Xs:"0x");if(r==="p256"){const n=e;return pt(Jp,X(n.signature.r,{size:32}),X(n.signature.s,{size:32}),X(n.publicKey.x,{size:32}),X(n.publicKey.y,{size:32}),X(n.prehash?1:0,{size:1}),t.magic?Xs:"0x")}if(r==="webAuthn"){const n=e,s=pt(n.metadata.authenticatorData,Pi(n.metadata.clientDataJSON));return pt(ef,s,X(n.signature.r,{size:32}),X(n.signature.s,{size:32}),X(n.publicKey.x,{size:32}),X(n.publicKey.y,{size:32}),t.magic?Xs:"0x")}if(r==="keychain"){const n=e;return pt(tg,n.userAddress,Rl(n.inner),t.magic?Xs:"0x")}throw new Oi({envelope:e})}function rf(e){const t=tf(e);if(t==="secp256k1")return{...eg(e.signature),type:"secp256k1"};if(t==="p256"){const r=e;return{preHash:r.prehash,pubKeyX:X(r.publicKey.x,{size:32}),pubKeyY:X(r.publicKey.y,{size:32}),r:X(r.signature.r,{size:32}),s:X(r.signature.s,{size:32}),type:"p256"}}if(t==="webAuthn"){const r=e,n=pt(r.metadata.authenticatorData,Pi(r.metadata.clientDataJSON));return{pubKeyX:X(r.publicKey.x,{size:32}),pubKeyY:X(r.publicKey.y,{size:32}),r:X(r.signature.r,{size:32}),s:X(r.signature.s,{size:32}),type:"webAuthn",webauthnData:n}}if(t==="keychain"){const r=e;return{type:"keychain",userAddress:r.userAddress,signature:rf(r.inner)}}throw new Oi({envelope:e})}function GU(e,t){const{payload:r}=t,n=(()=>{if(t.address)return t.address;if(t.publicKey)return Ul(t.publicKey)})();if(!n)return!1;const s=Ui(e);if(s.type==="secp256k1")return n?PU({address:n,payload:r,signature:s.signature}):!1;if(s.type==="p256"){const a=Ul(s.publicKey);return Np(a,n)?Wy({hash:s.prehash,publicKey:s.publicKey,payload:r,signature:s.signature}):!1}if(s.type==="webAuthn"){const a=Ul(s.publicKey);return Np(a,n)?$U({challenge:Bl(r),metadata:s.metadata,publicKey:s.publicKey,signature:s.signature}):!1}throw new jU(`Unable to verify signature envelope of type "${s.type}".`)}class Oi extends oe{constructor({envelope:t}){super(`Unable to coerce value (\`${Ai(t)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}let Di=class extends oe{constructor({reason:t,serialized:r}){super(`Unable to deserialize signature envelope: ${t}`,{metaMessages:[`Serialized: ${r}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}},jU=class extends oe{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.VerificationError"})}};async function Hl(e,{address:t,blockNumber:r,blockTag:n="latest"}){const s=r!==void 0?q(r):void 0,a=await e.request({method:"eth_getCode",params:[t,s||n]},{dedupe:!!s});if(a!=="0x")return a}function Qa(e,t,r){const{checksumAddress:n,staticPosition:s}=r,a=of(t.type);if(a){const[o,i]=a;return WU(e,{...t,type:i},{checksumAddress:n,length:o,staticPosition:s})}if(t.type==="tuple")return ZU(e,t,{checksumAddress:n,staticPosition:s});if(t.type==="address")return VU(e,{checksum:n});if(t.type==="bool")return qU(e);if(t.type.startsWith("bytes"))return YU(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return KU(e,t);if(t.type==="string")return XU(e,{staticPosition:s});throw new df(t.type)}const rg=32,nf=32;function VU(e,t={}){const{checksum:r=!1}=t,n=e.readBytes(32);return[(a=>r?Mp(a):a)(Pt(PF(n,-20))),32]}function WU(e,t,r){const{checksumAddress:n,length:s,staticPosition:a}=r;if(!s){const c=In(e.readBytes(nf)),l=a+c,u=l+rg;e.setPosition(l);const d=In(e.readBytes(rg)),f=_i(t);let m=0;const y=[];for(let g=0;g<d;++g){e.setPosition(u+(f?g*32:m));const[E,w]=Qa(e,t,{checksumAddress:n,staticPosition:u});m+=w,y.push(E)}return e.setPosition(a+32),[y,32]}if(_i(t)){const c=In(e.readBytes(nf)),l=a+c,u=[];for(let d=0;d<s;++d){e.setPosition(l+d*32);const[f]=Qa(e,t,{checksumAddress:n,staticPosition:l});u.push(f)}return e.setPosition(a+32),[u,32]}let o=0;const i=[];for(let c=0;c<s;++c){const[l,u]=Qa(e,t,{checksumAddress:n,staticPosition:a+o});o+=u,i.push(l)}return[i,o]}function qU(e){return[BF(e.readBytes(32),{size:32}),32]}function YU(e,t,{staticPosition:r}){const[n,s]=t.type.split("bytes");if(!s){const o=In(e.readBytes(32));e.setPosition(r+o);const i=In(e.readBytes(32));if(i===0)return e.setPosition(r+32),["0x",32];const c=e.readBytes(i);return e.setPosition(r+32),[Pt(c),32]}return[Pt(e.readBytes(Number.parseInt(s,10),32)),32]}function KU(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[n>48?IF(s,{signed:r}):In(s,{signed:r}),32]}function ZU(e,t,r){const{checksumAddress:n,staticPosition:s}=r,a=t.components.length===0||t.components.some(({name:c})=>!c),o=a?[]:{};let i=0;if(_i(t)){const c=In(e.readBytes(nf)),l=s+c;for(let u=0;u<t.components.length;++u){const d=t.components[u];e.setPosition(l+i);const[f,m]=Qa(e,d,{checksumAddress:n,staticPosition:l});i+=m,o[a?u:d==null?void 0:d.name]=f}return e.setPosition(s+32),[o,32]}for(let c=0;c<t.components.length;++c){const l=t.components[c],[u,d]=Qa(e,l,{checksumAddress:n,staticPosition:s});o[a?c:l==null?void 0:l.name]=u,i+=d}return[o,i]}function XU(e,{staticPosition:t}){const r=In(e.readBytes(32)),n=t+r;e.setPosition(n);const s=In(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),o=FF(wy(a));return e.setPosition(t+32),[o,32]}function QU({checksumAddress:e,parameters:t,values:r}){const n=[];for(let s=0;s<t.length;s++)n.push(sf({checksumAddress:e,parameter:t[s],value:r[s]}));return n}function sf({checksumAddress:e=!1,parameter:t,value:r}){const n=t,s=of(n.type);if(s){const[a,o]=s;return eO(r,{checksumAddress:e,length:a,parameter:{...n,type:o}})}if(n.type==="tuple")return aO(r,{checksumAddress:e,parameter:n});if(n.type==="address")return JU(r,{checksum:e});if(n.type==="bool")return rO(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){const a=n.type.startsWith("int"),[,,o="256"]=Xy.exec(n.type)??[];return nO(r,{signed:a,size:Number(o)})}if(n.type.startsWith("bytes"))return tO(r,{type:n.type});if(n.type==="string")return sO(r);throw new df(n.type)}function af(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:i}=e[a];o?t+=32:t+=ht(i)}const r=[],n=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:i}=e[a];o?(r.push(X(t+s,{size:32})),n.push(i),s+=ht(i)):r.push(i)}return pt(...r,...n)}function JU(e,t){const{checksum:r=!1}=t;return Lr(e,{strict:r}),{dynamic:!1,encoded:Ys(e.toLowerCase())}}function eO(e,t){const{checksumAddress:r,length:n,parameter:s}=t,a=n===null;if(!Array.isArray(e))throw new fO(e);if(!a&&e.length!==n)throw new pO({expectedLength:n,givenLength:e.length,type:`${s.type}[${n}]`});let o=!1;const i=[];for(let c=0;c<e.length;c++){const l=sf({checksumAddress:r,parameter:s,value:e[c]});l.dynamic&&(o=!0),i.push(l)}if(a||o){const c=af(i);if(a){const l=X(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?pt(l,c):l}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:pt(...i.map(({encoded:c})=>c))}}function tO(e,{type:t}){const[,r]=t.split("bytes"),n=ht(e);if(!r){let s=e;return n%32!==0&&(s=Ks(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:pt(Ys(X(n,{size:32})),s)}}if(n!==Number.parseInt(r,10))throw new ag({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:Ks(e)}}function rO(e){if(typeof e!="boolean")throw new oe(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ys(py(e))}}function nO(e,{signed:t,size:r}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,s=t?-n-1n:0n;if(e>n||e<s)throw new hy({max:n.toString(),min:s.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:X(e,{size:32,signed:t})}}function sO(e){const t=Pi(e),r=Math.ceil(ht(t)/32),n=[];for(let s=0;s<r;s++)n.push(Ks(Pe(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:pt(Ks(X(ht(t),{size:32})),...n)}}function aO(e,t){const{checksumAddress:r,parameter:n}=t;let s=!1;const a=[];for(let o=0;o<n.components.length;o++){const i=n.components[o],c=Array.isArray(e)?o:i.name,l=sf({checksumAddress:r,parameter:i,value:e[c]});a.push(l),l.dynamic&&(s=!0)}return{dynamic:s,encoded:s?af(a):pt(...a.map(({encoded:o})=>o))}}function of(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function _i(e){var n;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(n=e.components)==null?void 0:n.some(_i);const r=of(e.type);return!!(r&&_i({...e,type:r[1]}))}const oO={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new cO({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new iO({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ng({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ng({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function cf(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(oO);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class ng extends oe{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class iO extends oe{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class cO extends oe{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function lO(e,t,r={}){const{as:n="Array",checksumAddress:s=!1}=r,a=typeof t=="string"?cs(t):t,o=cf(a);if(Ka(a)===0&&e.length>0)throw new dO;if(Ka(a)&&Ka(a)<32)throw new uO({data:typeof t=="string"?t:Pt(t),parameters:e,size:Ka(a)});let i=0;const c=n==="Array"?[]:{};for(let l=0;l<e.length;++l){const u=e[l];o.setPosition(i);const[d,f]=Qa(o,u,{checksumAddress:s,staticPosition:0});i+=f,n==="Array"?c.push(d):c[u.name??l]=d}return c}function lf(e,t,r){const{checksumAddress:n=!1}={};if(e.length!==t.length)throw new og({expectedLength:e.length,givenLength:t.length});const s=QU({checksumAddress:n,parameters:e,values:t}),a=af(s);return a.length===0?"0x":a}function uf(e,t){if(e.length!==t.length)throw new og({expectedLength:e.length,givenLength:t.length});const r=[];for(let n=0;n<e.length;n++){const s=e[n],a=t[n];r.push(uf.encode(s,a))}return pt(...r)}(function(e){function t(r,n,s=!1){if(r==="address"){const c=n;return Lr(c),Ys(c.toLowerCase(),s?32:0)}if(r==="string")return Pi(n);if(r==="bytes")return n;if(r==="bool")return Ys(py(n),s?32:1);const a=r.match(Xy);if(a){const[c,l,u="256"]=a,d=Number.parseInt(u,10)/8;return X(n,{size:s?32:d,signed:l==="int"})}const o=r.match(BU);if(o){const[c,l]=o;if(Number.parseInt(l,10)!==(n.length-2)/2)throw new ag({expectedSize:Number.parseInt(l,10),value:n});return Ks(n,s?32:0)}const i=r.match(IU);if(i&&Array.isArray(n)){const[c,l]=i,u=[];for(let d=0;d<n.length;d++)u.push(t(l,n[d],!0));return u.length===0?"0x":pt(...u)}throw new df(r)}e.encode=t})(uf||(uf={}));function sg(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Hb(e):e}class uO extends oe{constructor({data:t,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ra(r)})`,`Data: ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class dO extends oe{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class pO extends oe{constructor({expectedLength:t,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class ag extends oe{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${ht(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class og extends oe{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(`
106
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class fO extends oe{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class df extends oe{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}const ig="0x6492649264926492649264926492649264926492649264926492649264926492";function mO(e){if(Pe(e,-32)!==ig)throw new yO(e)}function hO(e){const{data:t,signature:r,to:n}=e;return pt(lf(sg("address, bytes, bytes"),[n,t,r]),ig)}function bO(e){try{return mO(e),!0}catch{return!1}}let yO=class extends oe{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};function gO(e){return xO(e,"Hex")}function xO(e,t){const r=t,n=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new gF(e);return cs(e)}return e})(),s=cf(n,{recursiveReadLimit:Number.POSITIVE_INFINITY});return cg(s,r)}function cg(e,t="Hex"){if(e.bytes.length===0)return t==="Hex"?Pt(e.bytes):e.bytes;const r=e.readByte();if(r<128&&e.decrementPosition(1),r<192){const s=lg(e,r,128),a=e.readBytes(s);return t==="Hex"?Pt(a):a}const n=lg(e,r,192);return wO(e,n,t)}function lg(e,t,r){if(r===128&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new oe("Invalid RLP prefix")}function wO(e,t,r){const n=e.position,s=[];for(;e.position-n<t;)s.push(cg(e,r));return s}function vO(e,t){const{as:r}=t,n=ug(e),s=cf(new Uint8Array(n.length));return n.encode(s),r==="Hex"?Pt(s.bytes):s.bytes}function EO(e,t={}){const{as:r="Hex"}=t;return vO(e,{as:r})}function ug(e){return Array.isArray(e)?kO(e.map(t=>ug(t))):CO(e)}function kO(e){const t=e.reduce((s,a)=>s+a.length,0),r=dg(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function CO(e){const t=typeof e=="string"?cs(e):e,r=dg(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function dg(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new oe("Length is too large.")}function TO(e,t={}){return typeof e.chainId=="string"?pg(e):{...e,...t.signature}}function pg(e){const{address:t,chainId:r,nonce:n}=e,s=Jy(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...s}}function SO(e){return e.map(pg)}function AO(e){const{address:t,chainId:r,nonce:n,...s}=e;return{address:t,chainId:X(r),nonce:X(n),...eg(s)}}function PO(e){return e.map(AO)}const IO="0x8010801080108010801080108010801080108010801080108010801080108010",BO=sg("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function fg(e){if(typeof e=="string"){if(Pe(e,-32)!==IO)throw new OO(e)}else _l(e.authorization)}function FO(e){fg(e);const t=Ii(Pe(e,-64,-32)),r=Pe(e,-t-64,-64),n=Pe(e,0,-t-64),[s,a,o]=lO(BO,r);return{authorization:TO({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:n,...o&&o!=="0x"?{data:o,to:a}:{}}}function UO(e){try{return fg(e),!0}catch{return!1}}class OO extends oe{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}const $l=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],pf=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],mg=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],hg=[...mg,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],DO=[...mg,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],bg=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],yg=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],gg=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],xg=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],wg=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],vg="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",_O="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",MO="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ff="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",mf="/docs/contract/encodeDeployData";function Gl(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new VT({docsPath:mf});if(!("inputs"in s))throw new xb({docsPath:mf});if(!s.inputs||s.inputs.length===0)throw new xb({docsPath:mf});const a=os(s.inputs,r);return lr([n,a])}const Eg="/docs/contract/encodeFunctionData";function NO(e){const{abi:t,args:r,functionName:n}=e;let s=t[0];if(n){const a=$s({abi:t,args:r,name:n});if(!a)throw new za(n,{docsPath:Eg});s=a}if(s.type!=="function")throw new za(void 0,{docsPath:Eg});return{abi:[s],functionName:Yo(Mr(s))}}function fr(e){const{args:t}=e,{abi:r,functionName:n}=(()=>{var i;return e.abi.length===1&&((i=e.functionName)!=null&&i.startsWith("0x"))?e:NO(e)})(),s=r[0],a=n,o="inputs"in s&&s.inputs?os(s.inputs,t??[]):void 0;return lr([a,o??"0x"])}function Ja(e,t){if(!rt(e,{strict:!1}))throw new Ct({address:e});if(!rt(t,{strict:!1}))throw new Ct({address:t});return e.toLowerCase()===t.toLowerCase()}function LO(e){const t=Ut(`0x${e.substring(4)}`).substring(26);return Ho(`0x${t}`)}async function zO({hash:e,signature:t}){const r=Or(e)?e:Fe(e),{secp256k1:n}=await Promise.resolve().then(()=>SU);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:d,yParity:f}=t,m=Number(f??d),y=kg(m);return new n.Signature(Le(l),Le(u)).addRecoveryBit(y)}const o=Or(t)?t:Fe(t);if(lt(o)!==65)throw new Error("invalid signature length");const i=ir(`0x${o.slice(130)}`),c=kg(i);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function kg(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Cg({hash:e,signature:t}){return LO(await zO({hash:e,signature:t}))}function RO(e){const{chainId:t,nonce:r,to:n}=e,s=e.contractAddress??e.address,a=Ut(lr(["0x05",en([t?q(t):"0x",s,r?q(r):"0x"])]));return n==="bytes"?or(a):a}async function jl(e){const{authorization:t,signature:r}=e;return Cg({hash:RO(t),signature:r??t})}async function HO({address:e,authorization:t,signature:r}){return Ja(ep(e),await jl({authorization:t,signature:r}))}function ne(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const s=e[r];return typeof s=="function"?s:a=>t(e,a)}function $O({r:e,s:t,to:r="hex",v:n,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new Fi.Signature(Le(e),Le(t)).toCompactHex()}${a===0?"1b":"1c"}`;return r==="hex"?o:or(o)}function GO(e){return{address:e.address,amount:X(e.amount),index:X(e.index),validatorIndex:X(e.validatorIndex)}}function Tg(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:X(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:X(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:X(e.gasLimit)},...typeof e.number=="bigint"&&{number:X(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:X(e.prevRandao)},...typeof e.time=="bigint"&&{time:X(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(GO)}}}const jO="0x82ad56cb",hf="/docs/contract/decodeFunctionResult";function Qs(e){const{abi:t,args:r,functionName:n,data:s}=e;let a=t[0];if(n){const i=$s({abi:t,args:r,name:n});if(!i)throw new za(n,{docsPath:hf});a=i}if(a.type!=="function")throw new za(void 0,{docsPath:hf});if(!a.outputs)throw new Cb(a.name,{docsPath:hf});const o=Ko(a.outputs,s);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}function bf(){let e=()=>{},t=()=>{};return{promise:new Promise((n,s)=>{e=n,t=s}),resolve:e,reject:t}}const yf=new Map;function Sg({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:s}){const a=async()=>{const u=c();o();const d=u.map(({args:f})=>f);d.length!==0&&e(d).then(f=>{s&&Array.isArray(f)&&f.sort(s);for(let m=0;m<u.length;m++){const{resolve:y}=u[m];y==null||y([f[m],f])}}).catch(f=>{for(let m=0;m<u.length;m++){const{reject:y}=u[m];y==null||y(f)}})},o=()=>yf.delete(t),i=()=>c().map(({args:u})=>u),c=()=>yf.get(t)||[],l=u=>yf.set(t,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:f,reject:m}=bf();return(r==null?void 0:r([...i(),u]))&&a(),c().length>0?(l({args:u,resolve:f,reject:m}),d):(l({args:u,resolve:f,reject:m}),setTimeout(a,n),d)}}}function Ag(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new y1({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new y1({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function VO(e){const{balance:t,nonce:r,state:n,stateDiff:s,code:a}=e,o={};if(a!==void 0&&(o.code=a),t!==void 0&&(o.balance=q(t)),r!==void 0&&(o.nonce=q(r)),n!==void 0&&(o.state=Ag(n)),s!==void 0){if(o.state)throw new hS;o.stateDiff=Ag(s)}return o}function gf(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!rt(r,{strict:!1}))throw new Ct({address:r});if(t[r])throw new mS({address:r});t[r]=VO(n)}return t}async function Mi(e,t){var F,_,k,P;const{account:r=e.account,authorizationList:n,batch:s=!!((F=e.batch)!=null&&F.multicall),blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",accessList:i,blobs:c,blockOverrides:l,code:u,data:d,factory:f,factoryData:m,gas:y,gasPrice:g,maxFeePerBlobGas:E,maxFeePerGas:w,maxPriorityFeePerGas:v,nonce:S,to:C,value:D,stateOverride:L,...T}=t,h=r?Ke(r):void 0;if(u&&(f||m))throw new $("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&C)throw new $("Cannot provide both `code` & `to` as parameters.");const b=u&&d,x=f&&m&&C&&d,A=b||x,I=b?Pg({code:u,data:d}):x?YO({data:d,factory:f,factoryData:m,to:C}):d;try{rn(t);const U=(typeof a=="bigint"?q(a):void 0)||o,z=l?Tg(l):void 0,H=gf(L),G=(P=(k=(_=e.chain)==null?void 0:_.formatters)==null?void 0:k.transactionRequest)==null?void 0:P.format,pe=(G||_r)({...Ws(T,{format:G}),accessList:i,account:h,authorizationList:n,blobs:c,data:I,gas:y,gasPrice:g,maxFeePerBlobGas:E,maxFeePerGas:w,maxPriorityFeePerGas:v,nonce:S,to:A?void 0:C,value:D},"call");if(s&&WO({request:pe})&&!H&&!z)try{return await qO(e,{...pe,blockNumber:a,blockTag:o})}catch(de){if(!(de instanceof X1)&&!(de instanceof Gd))throw de}const he=(()=>{const de=[pe,U];return H&&z?[...de,H,z]:H?[...de,H]:z?[...de,{},z]:de})(),ie=await e.request({method:"eth_call",params:he});return ie==="0x"?{data:void 0}:{data:ie}}catch(O){const U=KO(O),{offchainLookup:z,offchainLookupSignature:H}=await Promise.resolve().then(()=>IN);if(e.ccipRead!==!1&&(U==null?void 0:U.slice(0,10))===H&&C)return{data:await z(e,{data:U,to:C})};throw A&&(U==null?void 0:U.slice(0,10))==="0x101bb98d"?new xS({factory:f}):kp(O,{...t,account:h,chain:e.chain})}}function WO({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(jO)||!r||Object.values(n).filter(s=>typeof s<"u").length>0)}async function qO(e,t){var g;const{batchSize:r=1024,deployless:n=!1,wait:s=0}=typeof((g=e.batch)==null?void 0:g.multicall)=="object"?e.batch.multicall:{},{blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",data:i,to:c}=t,l=(()=>{if(n)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Ma({blockNumber:a,chain:e.chain,contract:"multicall3"});throw new X1})(),d=(typeof a=="bigint"?q(a):void 0)||o,{schedule:f}=Sg({id:`${e.uid}.${d}`,wait:s,shouldSplitBatch(E){return E.reduce((v,{data:S})=>v+(S.length-2),0)>r*2},fn:async E=>{const w=E.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),v=fr({abi:$l,args:[w],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...l===null?{data:Pg({code:ff,data:v})}:{to:l,data:v}},d]});return Qs({abi:$l,args:[w],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:m,success:y}]=await f({data:i,to:c});if(!y)throw new cl({data:m});return m==="0x"?{data:void 0}:{data:m}}function Pg(e){const{code:t,data:r}=e;return Gl({abi:zb(["constructor(bytes, bytes)"]),bytecode:vg,args:[t,r]})}function YO(e){const{data:t,factory:r,factoryData:n,to:s}=e;return Gl({abi:zb(["constructor(address, bytes, address, bytes)"]),bytecode:_O,args:[s,t,r,n]})}function KO(e){var r;if(!(e instanceof $))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(r=t.data)==null?void 0:r.data:t.data}const ZO=3;function Js(e,{abi:t,address:r,args:n,docsPath:s,functionName:a,sender:o}){const i=e instanceof cl?e:e instanceof $?e.walk(y=>"data"in y)||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=i,m=e instanceof qo?new gS({functionName:a}):[ZO,js.code].includes(c)&&(l||u||d||f)||c===is.code&&u==="execution reverted"&&l?new vp({abi:t,data:typeof l=="object"?l.data:l,functionName:a,message:i instanceof Ep?u:f??d}):e;return new Zb(m,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:a,sender:o})}async function zr(e,t){const{abi:r,address:n,args:s,functionName:a,...o}=t,i=fr({abi:r,args:s,functionName:a});try{const{data:c}=await ne(e,Mi,"call")({...o,data:i,to:n});return Qs({abi:r,args:s,functionName:a,data:c||"0x"})}catch(c){throw Js(c,{abi:r,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function Ni(e,t){var c,l,u,d;const{address:r,chain:n=e.chain,hash:s,erc6492VerifierAddress:a=t.universalSignatureVerifierAddress??((l=(c=n==null?void 0:n.contracts)==null?void 0:c.erc6492Verifier)==null?void 0:l.address),multicallAddress:o=t.multicallAddress??((d=(u=n==null?void 0:n.contracts)==null?void 0:u.multicall3)==null?void 0:d.address)}=t;if(n!=null&&n.verifyHash)return await n.verifyHash(e,t);const i=(()=>{const f=t.signature;return Or(f)?f:typeof f=="object"&&"r"in f&&"s"in f?$O(f):wt(f)})();try{return UO(i)?await XO(e,{...t,multicallAddress:o,signature:i}):await QO(e,{...t,verifierAddress:a,signature:i})}catch(f){try{if(Ja(ep(r),await Cg({hash:s,signature:i})))return!0}catch{}if(f instanceof ea)return!1;throw f}}async function XO(e,t){var E;const{address:r,blockNumber:n,blockTag:s,hash:a,multicallAddress:o}=t,{authorization:i,data:c,signature:l,to:u}=FO(t.signature);if(await Hl(e,{address:r,blockNumber:n,blockTag:s})===lr(["0xef0100",i.address]))return await JO(e,{address:r,blockNumber:n,blockTag:s,hash:a,signature:l});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:q(i.r,{size:32}),s:q(i.s,{size:32}),yParity:i.yParity};if(!await HO({address:r,authorization:f}))throw new ea;const y=await ne(e,zr,"readContract")({...o?{address:o}:{code:ff},authorizationList:[f],abi:$l,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:u??r,callData:c}]:[],{allowFailure:!0,target:r,callData:fr({abi:gg,functionName:"isValidSignature",args:[a,l]})}]]}),g=(E=y[y.length-1])==null?void 0:E.returnData;if(g!=null&&g.startsWith("0x1626ba7e"))return!0;throw new ea}async function QO(e,t){const{address:r,factory:n,factoryData:s,hash:a,signature:o,verifierAddress:i,...c}=t,l=await(async()=>!n&&!s||bO(o)?o:hO({data:s,signature:o,to:n}))(),u=i?{to:i,data:fr({abi:xg,functionName:"isValidSig",args:[r,a,l]}),...c}:{data:Gl({abi:xg,args:[r,a,l],bytecode:MO}),...c},{data:d}=await ne(e,Mi,"call")(u).catch(f=>{throw f instanceof Kb?new ea:f});if(e8(d??"0x0"))return!0;throw new ea}async function JO(e,t){const{address:r,blockNumber:n,blockTag:s,hash:a,signature:o}=t;if((await ne(e,zr,"readContract")({address:r,abi:gg,args:[a,o],blockNumber:n,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof Zb?new ea:c})).startsWith("0x1626ba7e"))return!0;throw new ea}class ea extends Error{}function eD(e,t={}){return typeof e.chainId=="string"?Ig(e):t.signature?{...e,signature:t.signature}:e}function Ig(e){const{address:t,chainId:r,nonce:n}=e,s=zl(e.signature);return{address:t,chainId:Number(r),nonce:BigInt(n),signature:s}}function tD(e){return e.map(t=>Ig(t))}function rD(e){const[t,r,n,s]=e,a={address:r,chainId:t==="0x"?0:Number(t),nonce:n==="0x"?0n:BigInt(n)};return s&&(a.signature=Xa(s)),eD(a)}function nD(e){const t=[];for(const r of e)t.push(rD(r));return t}function sD(e){const{address:t,chainId:r,nonce:n,signature:s}=e;return{address:t,chainId:X(r),nonce:X(n),signature:rf(s)}}function aD(e){return e.map(t=>sD(t))}function oD(e){const{address:t,chainId:r,nonce:n}=e,s=e.signature?Rl(e.signature):void 0;return[r?X(r):"0x",t,n?X(n):"0x",...s?[s]:[]]}function iD(e){if(!e||e.length===0)return[];const t=[];for(const r of e)t.push(oD(r));return t}function cD(e,t={}){return typeof e.expiry=="string"?Bg(e):t.signature?{...e,signature:Ui(t.signature)}:e}function Bg(e){const{chainId:t="0x0",keyId:r,expiry:n=0,limits:s,keyType:a}=e,o=zl(e.signature);return{address:r,chainId:t==="0x"?0n:bt(t),expiry:Number(n),limits:s==null?void 0:s.map(i=>({token:i.token,limit:BigInt(i.limit)})),signature:o,type:a}}function lD(e){const[t,r]=e,[n,s,a,o,i]=t,c=(()=>{switch(s){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";default:throw new Error(`Invalid key type: ${s}`)}})(),l={address:a,expiry:typeof o<"u"?Ii(o):void 0,type:c,...n!=="0x"?{chainId:bt(n)}:{},...typeof o<"u"?{expiry:Ii(o)}:{},...typeof i<"u"?{limits:i.map(([u,d])=>({token:u,limit:BigInt(d)}))}:{}};return r&&(l.signature=Xa(r)),cD(l)}function uD(e){const{address:t,chainId:r=0n,expiry:n,limits:s,type:a,signature:o}=e;return{chainId:r===0n?"0x":X(r),expiry:typeof n=="number"?X(n):null,limits:s==null?void 0:s.map(({token:i,limit:c})=>({token:i,limit:X(c)})),keyId:t,signature:rf(o),keyType:a}}function dD(e){const{address:t,chainId:r=0n,expiry:n,limits:s}=e,a=e.signature?Rl(e.signature):void 0,o=(()=>{switch(e.type){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";default:throw new Error(`Invalid key type: ${e.type}`)}})();return[[r===0n?"0x":X(r),o,t,typeof n=="number"?X(n):void 0,(s==null?void 0:s.map(c=>[c.token,X(c.limit)]))??void 0].filter(Boolean),...a?[a]:[]]}const pD="0x20c0";function Fg(e){if(typeof e=="string")return Lr(e),e;const t=X(e,{size:18});return pt(pD,t)}const Ug={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},Og={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function fD(e,t={}){if(!e)return null;const r=Jy(e),n={...e,...r};return n.blockNumber=e.blockNumber?BigInt(e.blockNumber):null,n.data=e.input,n.gas=BigInt(e.gas??0n),n.nonce=BigInt(e.nonce??0n),n.transactionIndex=e.transactionIndex?Number(e.transactionIndex):null,n.value=BigInt(e.value??0n),e.authorizationList&&(n.authorizationList=SO(e.authorizationList)),e.chainId&&(n.chainId=Number(e.chainId)),e.gasPrice&&(n.gasPrice=BigInt(e.gasPrice)),e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=BigInt(e.maxFeePerBlobGas)),e.maxFeePerGas&&(n.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.type&&(n.type=Og[e.type]??e.type),r&&(n.v=Xp(r.yParity)),n}const Dg={...Ug,tempo:"0x76"},mD={...Og,"0x76":"tempo"};function hD(e,t={}){if(!e)return null;const r=fD(e);return r.type=mD[e.type],e.aaAuthorizationList&&(r.authorizationList=tD(e.aaAuthorizationList),delete r.aaAuthorizationList),e.calls&&(r.calls=e.calls.map(n=>({to:n.to,value:n.value&&n.value!=="0x"?BigInt(n.value):void 0,data:n.input||n.data||"0x"}))),e.feeToken&&(r.feeToken=e.feeToken),e.nonceKey&&(r.nonceKey=BigInt(e.nonceKey)),e.signature&&(r.signature=zl(e.signature)),e.validAfter&&(r.validAfter=Number(e.validAfter)),e.validBefore&&(r.validBefore=Number(e.validBefore)),e.keyAuthorization&&(r.keyAuthorization=Bg(e.keyAuthorization)),e.feePayerSignature&&(r.feePayerSignature=Kp(e.feePayerSignature),r.feePayerSignature.v=Xp(r.feePayerSignature.yParity)),r}function bD(e){const t={};return typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.authorizationList<"u"&&(t.authorizationList=PO(e.authorizationList)),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(t.blobs=e.blobs),typeof e.chainId<"u"&&(t.chainId=X(e.chainId)),typeof e.data<"u"?(t.data=e.data,t.input=e.data):typeof e.input<"u"&&(t.data=e.input,t.input=e.input),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=X(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=X(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=X(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=X(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=X(e.maxPriorityFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=X(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=X(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Ug[e.type]||e.type),typeof e.value<"u"&&(t.value=X(e.value)),t}function yD(e){const t=bD({...e,authorizationList:void 0});e.authorizationList&&(t.authorizationList=aD(e.authorizationList)),e.calls&&(t.calls=e.calls.map(n=>({to:n.to,value:n.value?X(n.value):"0x",data:n.data??"0x"}))),typeof e.feeToken<"u"&&(t.feeToken=Fg(e.feeToken)),e.keyAuthorization&&(t.keyAuthorization=uD(e.keyAuthorization)),typeof e.validBefore<"u"&&(t.validBefore=X(e.validBefore)),typeof e.validAfter<"u"&&(t.validAfter=X(e.validAfter));const r=(()=>{if(e.nonceKey==="random")return fy(6);if(typeof e.nonceKey=="bigint")return X(e.nonceKey)})();return r&&(t.nonceKey=r),(typeof e.calls<"u"||typeof e.feeToken<"u"||typeof e.keyAuthorization<"u"||typeof e.nonceKey<"u"||typeof e.validBefore<"u"||typeof e.validAfter<"u"||e.type==="tempo")&&(t.type=Dg.tempo,delete t.data,delete t.input,delete t.to,delete t.value),t}function gD(e){const t=[];for(let r=0;r<e.length;r++){const[n,s]=e[r];n&&Lr(n,{strict:!1}),t.push({address:n,storageKeys:s.map(a=>LF(a)?a:Up(a))})}return t}function xD(e){if(!e||e.length===0)return[];const t=[];for(const{address:r,storageKeys:n}of e){for(let s=0;s<n.length;s++)if(ht(n[s])!==32)throw new wD({storageKey:n[s]});r&&Lr(r,{strict:!1}),t.push([r,n])}return t}class wD extends oe{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${ht(t)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}const _g={wei:0,gwei:9,szabo:12,finney:15,ether:18};function vD(e,t=0){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[s,a]=[r.slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${a?`.${a}`:""}`}function xf(e,t="wei"){return vD(e,_g.gwei-_g[t])}class ED extends oe{constructor({feeCap:t}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${t?` = ${xf(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class kD extends oe{constructor({chainId:t}){super(typeof t<"u"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class CD extends oe{constructor({attributes:t,serialized:r,type:n}){const s=Object.entries(t).map(([a,o])=>typeof o>"u"?a:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${n}" was provided.`,{metaMessages:[`Serialized Transaction: "${r}"`,s.length>0?`Missing Attributes: ${s.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class TD extends oe{constructor({maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${xf(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${xf(r)} gwei`:""}).`].join(`
107
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}const SD="0x78",AD="0x76",Mg="tempo";function wf(e){const{calls:t,chainId:r,maxFeePerGas:n,maxPriorityFeePerGas:s,validBefore:a,validAfter:o}=e;if(!t||t.length===0)throw new OD;if(typeof a=="number"&&typeof o=="number"&&a<=o)throw new DD({validBefore:a,validAfter:o});if(t)for(const i of t)i.to&&Lr(i.to,{strict:!1});if(r<=0)throw new kD({chainId:r});if(n&&BigInt(n)>2n**256n-1n)throw new ED({feeCap:n});if(s&&n&&s>n)throw new TD({maxFeePerGas:n,maxPriorityFeePerGas:s})}function PD(e){const t=gO(Pe(e,1)),[r,n,s,a,o,i,c,l,u,d,f,m,y,g,E]=t,w=Array.isArray(g)?g:void 0,v=w?E:g;if(!(t.length===13||t.length===14||t.length===15))throw new CD({attributes:{authorizationList:y,chainId:r,maxPriorityFeePerGas:n,maxFeePerGas:s,gas:a,calls:o,accessList:i,keyAuthorization:w,nonceKey:c,nonce:l,validBefore:u,validAfter:d,feeToken:f,feePayerSignatureOrSender:m,...t.length>12?{signature:v}:{}},serialized:e,type:Mg});let S={chainId:Number(r),type:Mg};if(Nr(a)&&a!=="0x"&&(S.gas=BigInt(a)),Nr(l)&&(S.nonce=l==="0x"?0n:BigInt(l)),Nr(s)&&s!=="0x"&&(S.maxFeePerGas=BigInt(s)),Nr(n)&&n!=="0x"&&(S.maxPriorityFeePerGas=BigInt(n)),Nr(c)&&(S.nonceKey=c==="0x"?0n:BigInt(c)),Nr(u)&&u!=="0x"&&(S.validBefore=Number(u)),Nr(d)&&d!=="0x"&&(S.validAfter=Number(d)),Nr(f)&&f!=="0x"&&(S.feeToken=f),o&&o!=="0x"){const D=o;S.calls=D.map(L=>{const[T,h,b]=L,x={};return T&&T!=="0x"&&(x.to=T),h&&h!=="0x"&&(x.value=BigInt(h)),b&&b!=="0x"&&(x.data=b),x})}(i==null?void 0:i.length)!==0&&i!=="0x"&&(S.accessList=gD(i)),(y==null?void 0:y.length)!==0&&y!=="0x"&&(S.authorizationList=nD(y)),m!=="0x"&&m!==void 0&&(m==="0x00"||Ol(m)?S.feePayerSignature=null:S.feePayerSignature=OU(m)),w&&(S.keyAuthorization=lD(w));const C=v?Xa(v):void 0;return C&&(S={...S,signature:C}),wf(S),S}function ID(e,t={}){const{feePayerSignature:r,signature:n}=t,s=typeof e=="string"?PD(e):e;return wf(s),{...s,...n?{signature:Ui(n)}:{},...r?{feePayerSignature:Ml(r)}:{},type:"tempo"}}function Li(e,t={}){const{accessList:r,authorizationList:n,calls:s,chainId:a,feeToken:o,gas:i,keyAuthorization:c,nonce:l,nonceKey:u,maxFeePerGas:d,maxPriorityFeePerGas:f,validBefore:m,validAfter:y}=e;wf(e);const g=xD(r),E=t.signature||e.signature,w=iD(n),v=s.map(D=>[D.to??"0x",D.value?X(D.value):"0x",D.data??"0x"]),S=(()=>{if(t.sender)return t.sender;const D=typeof t.feePayerSignature<"u"?t.feePayerSignature:e.feePayerSignature;return D===null?"0x00":D?_U(D):"0x"})(),C=[X(a),f?X(f):"0x",d?X(d):"0x",i?X(i):"0x",v,g,u?X(u):"0x",l?X(l):"0x",typeof m=="number"?X(m):"0x",typeof y=="number"?X(y):"0x",typeof o=="bigint"||typeof o=="string"?Fg(o):"0x",S,w,...c?[dD(c)]:[],...E?[Rl(Ui(E))]:[]];return pt(t.format==="feePayer"?SD:AD,EO(C))}function BD(e){return FD(e,{presign:!0})}function FD(e,t={}){const r=Li({...e,...t.presign?{signature:void 0}:{}});return Bi(r)}function UD(e,t){const{sender:r}=t,n=Li({...e,signature:void 0},{sender:r,format:"feePayer"});return Bi(n)}class OD extends oe{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class DD extends oe{constructor({validBefore:t,validAfter:r}){super(`validBefore (${t}) must be greater than validAfter (${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}function Ng(e){const t=e.account;return t!=null&&t.keyType&&t.keyType!=="secp256k1"||typeof e.calls<"u"||typeof e.feePayer<"u"||typeof e.feeToken<"u"||typeof e.keyAuthorization<"u"||typeof e.nonceKey<"u"||typeof e.signature<"u"||typeof e.validBefore<"u"||typeof e.validAfter<"u"?"tempo":e.type?e.type:sp(e)}function vf(e){try{return Ng(e)==="tempo"}catch{return!1}}async function _D(e,t){if(!vf(e)){if(t&&"type"in t&&t.type!=="secp256k1")throw new Error("Unsupported signature type. Expected `secp256k1` but got `"+t.type+"`.");if(t&&"type"in t){const{r:n,s,yParity:a}=t==null?void 0:t.signature;return Vc(e,{r:X(n,{size:32}),s:X(s,{size:32}),yParity:a})}return Vc(e,t)}if(Ng(e)==="tempo")return MD(e,t);throw new Error("Unsupported transaction type")}async function MD(e,t){var l;const r=(()=>{if(e.signature)return e.signature;if(t&&"type"in t)return t;if(t)return Ui({r:BigInt(t.r),s:BigInt(t.s),yParity:Number(t.yParity)})})(),{chainId:n,feePayer:s,feePayerSignature:a,nonce:o,...i}=e,c={...i,calls:(l=i.calls)!=null&&l.length?i.calls:[{to:i.to||(!i.data||i.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:i.value,data:i.data}],chainId:Number(n),feePayerSignature:a?{r:BigInt(a.r),s:BigInt(a.s),yParity:Number(a.yParity)}:s?null:void 0,type:"tempo",...o?{nonce:BigInt(o)}:{}};if(s===!0&&delete c.feeToken,r&&typeof e.feePayer=="object"){const u=ID(c,{signature:r}),d=(()=>{if(e.from)return e.from;if(r.type==="secp256k1")return Zy({payload:BD(u),signature:r.signature});throw new Error("Unable to extract sender from transaction or signature.")})(),f=UD(u,{sender:d}),m=await e.feePayer.sign({hash:f});return Li(u,{feePayerSignature:Ml(m)})}if(s===!0){const u=Li(c,{feePayerSignature:null,signature:r});return e.from&&r?pt(u,e.from,"0xfeefeefeefee"):u}return Li({...c,...s?{feeToken:void 0}:{}},{feePayerSignature:void 0,signature:r})}function ND(e){if(!vf(e))return Ns(e);const{feePayerSignature:t,gasPrice:r,nonce:n,...s}=hD(e);return{...s,accessList:s.accessList,feePayerSignature:t?{r:X(t.r,{size:32}),s:X(t.s,{size:32}),v:BigInt(t.v??27),yParity:t.yParity}:void 0,nonce:Number(n),typeHex:Dg[s.type],type:s.type}}function LD(e){return zc(e)}function zD(e,t){const r=e,n=r.account?Ke(r.account):void 0;if(!vf(r))return _r(e);t&&(r.calls=r.calls??[{to:e.to||(!e.data||e.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:e.value,data:e.data}]),r.feePayer===!0&&delete r.feeToken;const s=yD({...r,type:"tempo"});t==="estimateGas"&&(s.maxFeePerGas=void 0,s.maxPriorityFeePerGas=void 0),s.to=void 0,s.data=void 0,s.value=void 0;const[a,o]=(()=>{const c=n&&"keyType"in n?n.keyType:n==null?void 0:n.source;return c?c==="webAuthn"?["webAuthn",`0x${"ff".repeat(1400)}`]:["p256","secp256k1"].includes(c)?[c,void 0]:[void 0,void 0]:[void 0,void 0]})(),i=n&&"accessKeyAddress"in n?n.accessKeyAddress:void 0;return{...s,...o?{keyData:o}:{},...i?{keyId:i}:{},...a?{keyType:a}:{},...r.feePayer?{feePayer:typeof r.feePayer=="object"?Ke(r.feePayer):r.feePayer}:{}}}const RD=HD();function HD(){return new Map}function $D(e){return`${e.address.toLowerCase()}-${e.chainId}`}function Lg(e,t){const r=$D(t);let n=e.get(r);return n||(n={counter:0,resetScheduled:!1},e.set(r,n)),n}function GD(e,t){const r=Lg(e,t);r.counter=0,r.resetScheduled=!1}function jD(e,t){const r=Lg(e,t);r.resetScheduled||(r.resetScheduled=!0,queueMicrotask(()=>GD(e,t)));const n=r.counter;return r.counter++,n===0?0n:bt(fy(6))}const Ef={blockTime:1e3,extendSchema:L3(),formatters:{transaction:Lc({exclude:["aaAuthorizationList"],format:ND}),transactionReceipt:Ud({format:LD}),transactionRequest:Od({format:zD})},prepareTransactionRequest:[async(e,{phase:t})=>{var n;const r=e;return t==="afterFillParameters"?(typeof r.nonceKey=="bigint"&&r.nonceKey>0n&&(r.gas=(r.gas??0n)+40000n),r):(r.nonceKey=(()=>{var o;if(typeof r.nonceKey<"u"&&r.nonceKey!=="random")return r.nonceKey;const s=((o=r.account)==null?void 0:o.address)??r.from;if(!s||!r.chain)return;const a=jD(RD,{address:s,chainId:r.chain.id});if(a!==0n)return a})(),r.nonce=(()=>{if(typeof r.nonce=="number")return r.nonce;if(r.nonceKey)return 0})(),!r.feeToken&&((n=r.chain)!=null&&n.feeToken)&&(r.feeToken=r.chain.feeToken),r)},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:((e,t)=>_D(e,t))},async verifyHash(e,t){const{address:r,hash:n,signature:s}=t;if(typeof s=="string"&&s.endsWith(Xs.slice(2))){const a=Xa(s);if(a.type!=="keychain"){const o=await Hl(e,{address:r,blockNumber:t.blockNumber,blockTag:t.blockTag});if(!o||o==="0xef01007702c00000000000000000000000000000000000")return GU(a,{address:r,payload:n})}}return await ne(e,Ni,"verifyHash")({...t,chain:null})}},VD=p({...Ef,id:42429,name:"Tempo Devnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.devnet.tempoxyz.dev"],webSocket:["wss://rpc.devnet.tempoxyz.dev"]}}}),WD=p({...Ef,id:1337,name:"Tempo",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["http://localhost:8545"]}}}),qD=p({...Ef,id:42429,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},name:"Tempo Testnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.testnet.tempo.xyz"],webSocket:["wss://rpc.testnet.tempo.xyz"]}}}),YD=p({id:1559,name:"Tenet",network:"tenet-mainnet",nativeCurrency:{name:"TENET",symbol:"TENET",decimals:18},rpcUrls:{default:{http:["https://rpc.tenet.org"]}},blockExplorers:{default:{name:"TenetScan Mainnet",url:"https://tenetscan.io",apiUrl:"https://tenetscan.io/api"}},testnet:!1}),KD=p({id:752025,name:"Ternoa",nativeCurrency:{name:"Capsule Coin",symbol:"CAPS",decimals:18},rpcUrls:{default:{http:["https://rpc-mainnet.zkevm.ternoa.network"]}},blockExplorers:{default:{name:"Ternoa Explorer",url:"https://explorer-mainnet.zkevm.ternoa.network"}},testnet:!1}),ZD=p({id:7,name:"ThaiChain",nativeCurrency:{name:"TCH",symbol:"TCH",decimals:18},rpcUrls:{default:{http:["https://rpc.thaichain.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp.thaichain.org",apiUrl:"https://exp.thaichain.org/api"}},contracts:{multicall3:{address:"0x0DaD6130e832c21719C5CE3bae93454E16A84826",blockCreated:4806386}},testnet:!1}),XD=p({id:8428,name:"THAT Mainnet",nativeCurrency:{name:"THAT",symbol:"THAT",decimals:18},rpcUrls:{default:{http:["https://api.thatchain.io/mainnet"]}},blockExplorers:{default:{name:"Blockscout",url:"https://that.blockscout.com"}},testnet:!1}),QD=p({id:361,name:"Theta Mainnet",nativeCurrency:{name:"TFUEL",symbol:"TFUEL",decimals:18},rpcUrls:{default:{http:["https://eth-rpc-api.thetatoken.org/rpc"]}},blockExplorers:{default:{name:"Theta Explorer",url:"https://explorer.thetatoken.org"}},testnet:!1}),JD=p({id:365,name:"Theta Testnet",nativeCurrency:{name:"TFUEL",symbol:"TFUEL",decimals:18},rpcUrls:{default:{http:["https://eth-rpc-api-testnet.thetatoken.org/rpc"]}},blockExplorers:{default:{name:"Theta Explorer",url:"https://testnet-explorer.thetatoken.org"}},testnet:!0}),e_=p({id:108,name:"ThunderCore Mainnet",nativeCurrency:{name:"TT",symbol:"TT",decimals:18},rpcUrls:{default:{http:["https://mainnet-rpc.thundercore.com"]}},blockExplorers:{default:{name:"ThunderCore Explorer",url:"https://explorer-mainnet.thundercore.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}},testnet:!1}),t_=p({id:997,name:"5ireChain Thunder Testnet",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Thunder Explorer",url:"https://testnet.5irescan.io/"}},testnet:!0}),r_=p({id:62092,name:"TikTrix Testnet",nativeCurrency:{name:"tTTX",symbol:"tTTX",decimals:18},rpcUrls:{default:{http:["https://tiktrix-rpc.xyz"]}},blockExplorers:{default:{name:"TikTrix Testnet Explorer",url:"https://tiktrix.xyz"}},testnet:!0}),n_=p({id:6969,name:"Tomb Mainnet",nativeCurrency:{name:"TOMB",symbol:"TOMB",decimals:18},rpcUrls:{default:{http:["https://rpc.tombchain.com"]}},blockExplorers:{default:{name:"Tomb Explorer",url:"https://tombscout.com"}},testnet:!1}),s_=p({...ur,id:61166,name:"Treasure",nativeCurrency:{decimals:18,name:"MAGIC",symbol:"MAGIC"},rpcUrls:{default:{http:["https://rpc.treasure.lol"],webSocket:["wss://rpc.treasure.lol/ws"]}},blockExplorers:{default:{name:"Treasure Block Explorer",url:"https://treasurescan.io"}},contracts:{multicall3:{address:"0x2e29fe39496a56856D8698bD43e1dF4D0CE6266a",blockCreated:101}},testnet:!1}),a_=p({...ur,id:978658,name:"Treasure Topaz Testnet",nativeCurrency:{decimals:18,name:"MAGIC",symbol:"MAGIC"},rpcUrls:{default:{http:["https://rpc.topaz.treasure.lol"],webSocket:["wss://rpc.topaz.treasure.lol/ws"]}},blockExplorers:{default:{name:"Treasure Topaz Block Explorer",url:"https://topaz.treasurescan.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:108112}},testnet:!0}),o_=p({id:728126428,name:"Tron",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://api.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://tronscan.org",apiUrl:"https://apilist.tronscanapi.com/api"}}}),i_=p({id:3448148188,name:"Tron Nile",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://nile.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://nile.tronscan.org"}},testnet:!0}),c_=p({id:2494104990,name:"Tron Shasta",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://api.shasta.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://shasta.tronscan.org"}},testnet:!0}),l_=p({id:8,name:"Ubiq Mainnet",nativeCurrency:{name:"UBQ",symbol:"UBQ",decimals:18},rpcUrls:{default:{http:["https://pyrus2.ubiqscan.io"]}},blockExplorers:{default:{name:"Ubiq Scan",url:"https://ubiqscan.io"}},testnet:!1}),u_=p({id:19991,name:"Ultra EVM",nativeCurrency:{decimals:18,name:"Ultra Token",symbol:"UOS"},rpcUrls:{default:{http:["https://evm.ultra.eosusa.io"]}},blockExplorers:{default:{name:"Ultra EVM Explorer",url:"https://evmexplorer.ultra.io"}}}),d_=p({id:18881,name:"Ultra EVM Testnet",nativeCurrency:{decimals:18,name:"Ultra Token",symbol:"UOS"},rpcUrls:{default:{http:["https://evm.test.ultra.eosusa.io"]}},blockExplorers:{default:{name:"Ultra EVM Testnet Explorer",url:"https://evmexplorer.testnet.ultra.io"}},testnet:!0}),p_=p({id:1231,name:"Ultron Mainnet",nativeCurrency:{name:"ULX",symbol:"ULX",decimals:18},rpcUrls:{default:{http:["https://ultron-rpc.net"]}},blockExplorers:{default:{name:"Ultron Scan",url:"https://ulxscan.com"}},testnet:!1}),f_=p({id:1230,name:"Ultron Testnet",nativeCurrency:{name:"ULX",symbol:"ULX",decimals:18},rpcUrls:{default:{http:["https://ultron-dev.io"]}},blockExplorers:{default:{name:"Ultron Scan",url:"https://explorer.ultron-dev.io"}},testnet:!0}),Vl=1,m_=p({...V,id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz",apiUrl:"https://api.uniscan.xyz/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[Vl]:{address:"0x2F12d621a16e2d3285929C9996f478508951dFe4"}},portal:{[Vl]:{address:"0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2"}},l1StandardBridge:{[Vl]:{address:"0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA"}}},sourceId:Vl}),Wl=11155111,h_=p({...V,id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://sepolia.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://sepolia.uniscan.xyz",apiUrl:"https://api-sepolia.uniscan.xyz/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},portal:{[Wl]:{address:"0x0d83dab629f0e0F9d36c0Cbc89B69a489f0751bD"}},l1StandardBridge:{[Wl]:{address:"0xea58fcA6849d79EAd1f26608855c2D6407d54Ce2"}},disputeGameFactory:{[Wl]:{address:"0xeff73e5aa3B9AEC32c659Aa3E00444d20a84394b"}}},testnet:!0,sourceId:Wl}),b_=p({id:8880,name:"Unique Mainnet",nativeCurrency:{decimals:18,name:"UNQ",symbol:"UNQ"},rpcUrls:{default:{http:["https://rpc.unique.network"]}},blockExplorers:{default:{name:"Unique Subscan",url:"https://unique.subscan.io/"}}}),y_=p({id:8882,name:"Opal Testnet",nativeCurrency:{decimals:18,name:"OPL",symbol:"OPL"},rpcUrls:{default:{http:["https://rpc-opal.unique.network"]}},blockExplorers:{default:{name:"Opal Subscan",url:"https://opal.subscan.io/"}},testnet:!0}),g_=p({id:8881,name:"Quartz Mainnet",nativeCurrency:{decimals:18,name:"QTZ",symbol:"QTZ"},rpcUrls:{default:{http:["https://rpc-quartz.unique.network"]}},blockExplorers:{default:{name:"Quartz Subscan",url:"https://quartz.subscan.io/"}}}),x_=p({id:18233,name:"Unreal",nativeCurrency:{name:"reETH",decimals:18,symbol:"reETH"},rpcUrls:{default:{http:["https://rpc.unreal-orbit.gelato.digital"]}},blockExplorers:{default:{name:"Unreal Explorer",url:"https://unreal.blockscout.com",apiUrl:"https://unreal.blockscout.com/api/v2"}},testnet:!0,contracts:{multicall3:{address:"0x8b6B0e60D8CD84898Ea8b981065A12F876eA5677",blockCreated:1745}}}),w_=p({id:1480,name:"Vana",blockTime:6e3,nativeCurrency:{decimals:18,name:"Vana",symbol:"VANA"},rpcUrls:{default:{http:["https://rpc.vana.org/"]}},blockExplorers:{default:{name:"Vana Block Explorer",url:"https://vanascan.io",apiUrl:"https://vanascan.io/api"}},contracts:{multicall3:{address:"0xD8d2dFca27E8797fd779F8547166A2d3B29d360E",blockCreated:716763}}}),v_=p({id:14800,name:"Vana Moksha Testnet",blockTime:6e3,nativeCurrency:{decimals:18,name:"Vana",symbol:"VANA"},rpcUrls:{default:{http:["https://rpc.moksha.vana.org"]}},blockExplorers:{default:{name:"Vana Moksha Testnet",url:"https://moksha.vanascan.io",apiUrl:"https://moksha.vanascan.io/api"}},contracts:{multicall3:{address:"0xD8d2dFca27E8797fd779F8547166A2d3B29d360E",blockCreated:732283}},testnet:!0}),E_=p({id:2040,name:"Vanar Mainnet",nativeCurrency:{name:"VANRY",symbol:"VANRY",decimals:18},rpcUrls:{default:{http:["https://rpc.vanarchain.com"]}},blockExplorers:{default:{name:"Vanar Mainnet Explorer",url:"https://explorer.vanarchain.com/"}},testnet:!1}),k_=p({id:100009,name:"Vechain",nativeCurrency:{name:"VeChain",symbol:"VET",decimals:18},rpcUrls:{default:{http:["https://mainnet.vechain.org"]}},blockExplorers:{default:{name:"Vechain Explorer",url:"https://explore.vechain.org"},vechainStats:{name:"Vechain Stats",url:"https://vechainstats.com"}}}),C_=p({id:106,name:"Velas EVM Mainnet",nativeCurrency:{name:"VLX",symbol:"VLX",decimals:18},rpcUrls:{default:{http:["https://evmexplorer.velas.com/rpc"]}},blockExplorers:{default:{name:"Velas Explorer",url:"https://evmexplorer.velas.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:55883577}},testnet:!1}),T_=p({id:88,name:"Viction",nativeCurrency:{name:"Viction",symbol:"VIC",decimals:18},rpcUrls:{default:{http:["https://rpc.viction.xyz"]}},blockExplorers:{default:{name:"VIC Scan",url:"https://vicscan.xyz"}},testnet:!1}),S_=p({id:89,name:"Viction Testnet",nativeCurrency:{name:"Viction",symbol:"VIC",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.viction.xyz"]}},blockExplorers:{default:{name:"VIC Scan",url:"https://testnet.vicscan.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:12170179}},testnet:!0}),A_=p({id:888888,name:"Vision",nativeCurrency:{name:"VISION",symbol:"VS",decimals:18},rpcUrls:{default:{http:["https://infragrid.v.network/ethereum/compatible"]}},blockExplorers:{default:{name:"Vision Scan",url:"https://visionscan.org"}},testnet:!1}),P_=p({id:666666,name:"Vision Testnet",nativeCurrency:{name:"VISION",symbol:"VS",decimals:18},rpcUrls:{default:{http:["https://vpioneer.infragrid.v.network/ethereum/compatible"]}},blockExplorers:{default:{name:"Vision Scan",url:"https://visionscan.org/?chain=vpioneer"}},testnet:!0}),I_=p({id:888,name:"Wanchain",nativeCurrency:{name:"WANCHAIN",symbol:"WAN",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]}},blockExplorers:{default:{name:"WanScan",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB",blockCreated:25312390}}}),B_=p({id:999,name:"Wanchain Testnet",nativeCurrency:{name:"WANCHAIN",symbol:"WANt",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:46891"]}},blockExplorers:{default:{name:"WanScanTest",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0x11c89bF4496c39FB80535Ffb4c92715839CC5324",blockCreated:24743448}},testnet:!0}),F_=p({id:9496,name:"WeaveVM Alphanet",nativeCurrency:{name:"Testnet WeaveVM",symbol:"tWVM",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.wvm.dev"]}},blockExplorers:{default:{name:"WeaveVM Alphanet Explorer",url:"https://explorer.wvm.dev"}},testnet:!0}),U_=p({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://api.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://explorer.wemix.com"}}}),O_=p({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com",apiUrl:"https://testnet.wemixscan.com/api"}},testnet:!0}),D_=p({id:420420421,name:"Westend Asset Hub",nativeCurrency:{decimals:18,name:"Westies",symbol:"WND"},rpcUrls:{default:{http:["https://westend-asset-hub-eth-rpc.polkadot.io"]}},blockExplorers:{default:{name:"subscan",url:"https://westend-asset-hub-eth-explorer.parity.io"}},testnet:!0}),__=p({testnet:!1,name:"Whitechain",blockExplorers:{default:{name:"Whitechain Explorer",url:"https://explorer.whitechain.io"}},id:1875,rpcUrls:{default:{http:["https://rpc.whitechain.io"]}},nativeCurrency:{decimals:18,name:"WhiteBIT Coin",symbol:"WBT"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:25212237}}}),M_=p({testnet:!0,name:"Whitechain Testnet",blockExplorers:{default:{name:"Whitechain Explorer",url:"https://testnet.whitechain.io"}},id:2625,rpcUrls:{default:{http:["https://rpc-testnet.whitechain.io"]}},nativeCurrency:{decimals:18,name:"WhiteBIT Coin",symbol:"WBT"}}),N_=p({id:42070,name:"WMC Testnet",nativeCurrency:{name:"WMTx",symbol:"WMTx",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet-base.worldmobile.net"]}},blockExplorers:{default:{name:"WMC Explorer",url:"https://explorer2-base-testnet.worldmobile.net"}},testnet:!0}),zi=1,L_=p({...V,id:480,name:"World Chain",network:"worldchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan",url:"https://worldscan.org",apiUrl:"https://api.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-mainnet.explorer.alchemy.com",apiUrl:"https://worldchain-mainnet.explorer.alchemy.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[zi]:{address:"0x069c4c579671f8c120b1327a73217D01Ea2EC5ea"}},l2OutputOracle:{[zi]:{address:"0x19A6d1E9034596196295CF148509796978343c5D"}},portal:{[zi]:{address:"0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C"}},l1StandardBridge:{[zi]:{address:"0x470458C91978D2d929704489Ad730DC3E3001113"}}},testnet:!1,sourceId:zi}),Ri=11155111,z_=p({...V,id:4801,name:"World Chain Sepolia",network:"worldchain-sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-sepolia.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan Sepolia",url:"https://sepolia.worldscan.org",apiUrl:"https://api-sepolia.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-sepolia.explorer.alchemy.com",apiUrl:"https://worldchain-sepolia.explorer.alchemy.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[Ri]:{address:"0x8Ec1111f67Dad6b6A93B3F42DfBC92D81c98449A"}},l2OutputOracle:{[Ri]:{address:"0xc8886f8BAb6Eaeb215aDB5f1c686BF699248300e"}},portal:{[Ri]:{address:"0xFf6EBa109271fe6d4237EeeD4bAb1dD9A77dD1A4"}},l1StandardBridge:{[Ri]:{address:"0xd7DF54b3989855eb66497301a4aAEc33Dbb3F8DE"}}},testnet:!0,sourceId:Ri}),R_=p({id:103,name:"WorldLand Mainnet",nativeCurrency:{decimals:18,name:"WLC",symbol:"WLC"},rpcUrls:{default:{http:["https://seoul.worldland.foundation"]}},blockExplorers:{default:{name:"WorldLand Scan",url:"https://scan.worldland.foundation"}},testnet:!1}),H_=p({id:660279,name:"Xai Mainnet",nativeCurrency:{name:"Xai",symbol:"XAI",decimals:18},rpcUrls:{default:{http:["https://xai-chain.net/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.xai-chain.net"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:222549}},testnet:!1}),$_=p({id:37714555429,name:"Xai Testnet",nativeCurrency:{name:"sXai",symbol:"sXAI",decimals:18},rpcUrls:{default:{http:["https://testnet-v2.xai-chain.net/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer-v2.xai-chain.net"}},testnet:!0}),G_=p({id:50,name:"XDC Network",nativeCurrency:{decimals:18,name:"XDC",symbol:"XDC"},rpcUrls:{default:{http:["https://rpc.xdcrpc.com"]}},blockExplorers:{default:{name:"XDCScan",url:"https://xdcscan.com"}},contracts:{multicall3:{address:"0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF",blockCreated:75884020}}}),j_=p({id:51,name:"Apothem Network",nativeCurrency:{decimals:18,name:"TXDC",symbol:"TXDC"},rpcUrls:{default:{http:["https://erpc.apothem.network"]}},blockExplorers:{default:{name:"XDCScan",url:"https://testnet.xdcscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:59765389}}}),V_=p({id:196,name:"X Layer Mainnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://rpc.xlayer.tech"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/xlayer",apiUrl:"https://www.oklink.com/api/v5/explorer/xlayer/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:47416}}}),zg=p({id:195,name:"X1 Testnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://xlayertestrpc.okx.com"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/xlayer-test"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:624344}},testnet:!0}),W_=p({id:3721,name:"Xone Chain Mainnet",nativeCurrency:{decimals:18,name:"XOC",symbol:"XOC"},rpcUrls:{default:{http:["https://rpc.xone.org"]}},blockExplorers:{default:{name:"Xone Mainnet Explorer",url:"https://xonescan.com",apiUrl:"http://api.xonescan.com/api"}},testnet:!1}),q_=p({id:33772211,name:"Xone Chain Testnet",nativeCurrency:{decimals:18,name:"XOC",symbol:"XOC"},rpcUrls:{default:{http:["https://rpc-testnet.xone.org","https://rpc-testnet.xone.plus","https://rpc-testnet.knight.center"]}},blockExplorers:{default:{name:"Xone Testnet Explorer",url:"https://testnet.xonescan.com",apiUrl:"http://api.testnet.xonescan.com/api"}},testnet:!0}),Y_=p({id:20250217,name:"Xphere Mainnet",nativeCurrency:{decimals:18,name:"XP",symbol:"XP"},rpcUrls:{default:{http:["https://en-bkk.x-phere.com"]}},blockExplorers:{default:{name:"Xphere Tamsa Explorer",url:"https://xp.tamsa.io"}},testnet:!1}),K_=p({id:1998991,name:"Xphere Testnet",nativeCurrency:{decimals:18,name:"XPT",symbol:"XPT"},rpcUrls:{default:{http:["http://testnet.x-phere.com"]}},blockExplorers:{default:{name:"Xphere Tamsa Explorer",url:"https://xpt.tamsa.io"}},testnet:!0}),Z_=p({id:273,name:"XR One",nativeCurrency:{decimals:18,name:"XR1",symbol:"XR1"},rpcUrls:{default:{http:["https://xr1.calderachain.xyz/http"],webSocket:["wss://xr1.calderachain.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://xr1.calderaexplorer.xyz"}},testnet:!1}),X_=p({id:144e4,name:"XRPL EVM",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.xrplevm.org"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.xrplevm.org",apiUrl:"https://explorer.xrplevm.org/api/v2"}},testnet:!1}),Q_=p({id:1440002,name:"XRPL EVM Devnet",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.xrplevm.org/"]},public:{http:["https://rpc.xrplevm.org/"]}},blockExplorers:{default:{name:"XRPLEVM Devnet Explorer",url:"https://explorer.xrplevm.org/"}},contracts:{multicall3:{address:"0x82Cc144D7d0AD4B1c27cb41420e82b82Ad6e9B31",blockCreated:15237286}},testnet:!0}),J_=p({id:1449e3,name:"XRPL EVM Testnet",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.xrplevm.org"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.testnet.xrplevm.org",apiUrl:"https://explorer.testnet.xrplevm.org/api/v2"}},contracts:{multicall3:{address:"0x82Cc144D7d0AD4B1c27cb41420e82b82Ad6e9B31",blockCreated:492302}},testnet:!0}),eM=p({id:2730,name:"XR Sepolia",nativeCurrency:{decimals:18,name:"tXR",symbol:"tXR"},rpcUrls:{default:{http:["https://xr-sepolia-testnet.rpc.caldera.xyz/http"]}},blockExplorers:{default:{name:"Blockscout",url:"https://xr-sepolia-testnet.explorer.caldera.xyz"}},testnet:!0}),tM=p({id:50005,name:"Yooldo Verse",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Explorer",url:"https://explorer.yooldo-verse.xyz"}}}),rM=p({id:50006,name:"Yooldo Verse Testnet",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Testnet Explorer",url:"https://explorer.testnet.yooldo-verse.xyz"}},testnet:!0}),nM=p({id:8408,name:"ZenChain Testnet",nativeCurrency:{decimals:18,name:"ZTC",symbol:"ZTC"},rpcUrls:{default:{http:["https://zenchain-testnet.api.onfinality.io/public"],webSocket:["wss://zenchain-testnet.api.onfinality.io/public-ws"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:230019}},blockExplorers:{default:{name:"Zentrace",url:"https://zentrace.io"}},testnet:!0}),sM=p({id:383414847825,name:"Zeniq Mainnet",nativeCurrency:{name:"ZENIQ",symbol:"ZENIQ",decimals:18},rpcUrls:{default:{http:["https://api.zeniq.network"]}},blockExplorers:{default:{name:"Zeniq Explorer",url:"https://zeniqscan.com"}},testnet:!1}),aM=p({id:543210,name:"Zero Network",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zerion.io/v1/zero"]}},blockExplorers:{default:{name:"Zero Network Explorer",url:"https://explorer.zero.network"}},testnet:!1}),oM=p({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1632781}},blockExplorers:{default:{name:"ZetaScan",url:"https://zetascan.com"}},testnet:!1}),iM=p({id:7001,name:"ZetaChain Athens Testnet",nativeCurrency:{decimals:18,name:"Zeta",symbol:"aZETA"},rpcUrls:{default:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2715217}},blockExplorers:{default:{name:"ZetaScan",url:"https://testnet.zetascan.com"}},testnet:!0}),cM=p({id:1337803,name:"Zhejiang",nativeCurrency:{name:"Zhejiang Ether",symbol:"ZhejETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zhejiang.ethpandaops.io"]}},blockExplorers:{default:{name:"Beaconchain",url:"https://zhejiang.beaconcha.in"}},testnet:!0}),lM=p({id:32769,name:"Zilliqa",network:"zilliqa",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.zilliqa.com"}},testnet:!1}),uM=p({id:33101,name:"Zilliqa Testnet",network:"zilliqa-testnet",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://dev-api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.testnet.zilliqa.com"}},testnet:!0}),kf=1,dM=p({...V,id:48900,name:"Zircuit Mainnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.zircuit.com","https://zircuit1-mainnet.liquify.com","https://zircuit1-mainnet.p2pify.com","https://zircuit-mainnet.drpc.org"]}},blockExplorers:{default:{name:"Zircuit Explorer",url:"https://explorer.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"},l2OutputOracle:{[kf]:{address:"0x92Ef6Af472b39F1b363da45E35530c24619245A4"}},portal:{[kf]:{address:"0x17bfAfA932d2e23Bd9B909Fd5B4D2e2a27043fb1"}},l1StandardBridge:{[kf]:{address:"0x386B76D9cA5F5Fb150B6BFB35CF5379B22B26dd8"}}},testnet:!1}),Cf=11155111,pM=p({...V,id:48898,name:"Zircuit Garfield Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://garfield-testnet.zircuit.com/"]}},blockExplorers:{default:{name:"Zircuit Garfield Testnet Explorer",url:"https://explorer.garfield-testnet.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"},l2OutputOracle:{[Cf]:{address:"0xd69D3AC5CA686cCF94b258291772bc520FEAf211"}},portal:{[Cf]:{address:"0x4E21A71Ac3F7607Da5c06153A17B1DD20E702c21"}},l1StandardBridge:{[Cf]:{address:"0x87a7E2bCA9E35BA49282E832a28A6023904460D8"}}},testnet:!0}),Tf=11155111,fM=p({...V,id:48899,name:"Zircuit Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.zircuit.com","https://zircuit1-testnet.p2pify.com","https://zircuit1-testnet.liquify.com"]}},blockExplorers:{default:{name:"Zircuit Testnet Explorer",url:"https://explorer.testnet.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:6040287},l2OutputOracle:{[Tf]:{address:"0x740C2dac453aEf7140809F80b72bf0e647af8148"}},portal:{[Tf]:{address:"0x787f1C8c5924178689E0560a43D848bF8E54b23e"}},l1StandardBridge:{[Tf]:{address:"0x0545c5fe980098C16fcD0eCB5E79753afa6d9af9"}}},testnet:!0}),mM=p({id:42766,name:"ZKFair Mainnet",network:"zkfair-mainnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://scan.zkfair.io",apiUrl:"https://scan.zkfair.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6090959}},testnet:!1}),hM=p({id:43851,name:"ZKFair Testnet",network:"zkfair-testnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://testnet-rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://testnet-scan.zkfair.io"}},testnet:!0}),bM=p({id:810180,name:"zkLink Nova",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zklink.io"]}},blockExplorers:{default:{name:"zkLink Nova Block Explorer",url:"https://explorer.zklink.io"}}}),yM=p({id:810181,name:"zkLink Nova Sepolia Testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zklink.io"]}},blockExplorers:{default:{name:"zkLink Nova Block Explorer",url:"https://sepolia.explorer.zklink.io"}}}),Rg=p({...ur,blockTime:200,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),Hg=p({...ur,id:260,name:"ZKsync InMemory Node",network:"zksync-in-memory-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8011"]}},testnet:!0}),gM=p({...ur,id:272,name:"ZKsync CLI Local Custom Hyperchain",nativeCurrency:{name:"BAT",symbol:"BAT",decimals:18},rpcUrls:{default:{http:["http://localhost:15200"],webSocket:["ws://localhost:15201"]}},blockExplorers:{default:{name:"ZKsync explorer",url:"http://localhost:15005/",apiUrl:"http://localhost:15005/api"}},testnet:!0}),xM=p({...ur,id:270,name:"ZKsync CLI Local Hyperchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:15100"],webSocket:["ws://localhost:15101"]}},blockExplorers:{default:{name:"ZKsync explorer",url:"http://localhost:15005/",apiUrl:"http://localhost:15005/api"}},testnet:!0}),wM=p({id:9,name:"ZKsync CLI Local Hyperchain L1",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:15045"]}},blockExplorers:{default:{name:"Blockscout",url:"http://localhost:15001/",apiUrl:"http://localhost:15001/api/v2"}},testnet:!0}),$g=p({...ur,id:270,name:"ZKsync CLI Local Node",network:"zksync-cli-local-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:3050"]}},testnet:!0}),Gg=p({...ur,blockTime:200,id:300,name:"ZKsync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia-era.zksync.network/",apiUrl:"https://api-sepolia-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://sepolia.explorer.zksync.io/",blockExplorerApi:"https://block-explorer-api.sepolia.zksync.dev/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:3855712}},testnet:!0}),ql=1,vM=p({...V,id:7777777,name:"Zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy",apiUrl:"https://explorer.zora.energy/api"}},contracts:{...V.contracts,l2OutputOracle:{[ql]:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{[ql]:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{[ql]:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:ql}),Yl=11155111,EM=p({...V,id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/",apiUrl:"https://sepolia.explorer.zora.energy/api"}},contracts:{...V.contracts,l2OutputOracle:{[Yl]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[Yl]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[Yl]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:Yl,testnet:!0}),jg=5,kM=p({...V,id:999,name:"Zora Goerli Testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy",apiUrl:"https://testnet.explorer.zora.energy/api"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{[jg]:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:jg,testnet:!0}),CM=Object.freeze(Object.defineProperty({__proto__:null,abey:j3,abstract:Bv,abstractTestnet:Fv,acala:Uv,acria:Ov,adf:Dv,agungTestnet:_v,aioz:Mv,alephZero:Nv,alephZeroTestnet:Lv,alienx:zv,alienxHalTestnet:Rv,ancient8:Vv,ancient8Sepolia:Wv,anvil:qv,apeChain:Yv,apexTestnet:Kv,apollo:Zv,arbitrum:Xv,arbitrumGoerli:Qv,arbitrumNova:Jv,arbitrumSepolia:eE,arcTestnet:tE,arenaz:rE,areonNetwork:nE,areonNetworkTestnet:sE,areum:aE,artelaTestnet:oE,arthera:iE,artheraTestnet:cE,assetChain:lE,assetChainTestnet:uE,astar:dE,astarZkEVM:pE,astarZkyoto:fE,atletaOlympia:mE,aurora:hE,auroraTestnet:bE,auroria:yE,autheoTestnet:gE,avalanche:xE,avalancheFuji:wE,b3:vE,b3Sepolia:EE,bahamut:kE,base:pb,baseGoerli:SE,basePreconf:CE,baseSepolia:fb,baseSepoliaPreconf:AE,basecampTestnet:TE,beam:PE,beamTestnet:IE,bearNetworkChainMainnet:BE,bearNetworkChainTestnet:FE,berachain:UE,berachainBepolia:OE,berachainTestnet:DE,berachainTestnetbArtio:_E,bevmMainnet:ME,bifrost:NE,birdlayer:LE,bitTorrent:VE,bitTorrentTestnet:WE,bitgert:zE,bitkub:RE,bitkubTestnet:HE,bitlayer:$E,bitlayerTestnet:GE,bitrock:jE,blast:qE,blastSepolia:YE,bob:KE,bobSepolia:QE,boba:ZE,bobaSepolia:XE,boolBetaMainnet:JE,botanix:ek,botanixTestnet:tk,bounceBit:rk,bounceBitTestnet:nk,bronos:sk,bronosTestnet:ak,bsc:ok,bscGreenfield:ik,bscTestnet:ck,bsquared:lk,bsquaredTestnet:uk,btr:dk,btrTestnet:pk,bxn:fk,bxnTestnet:mk,cannon:hk,canto:bk,celo:Ak,celoAlfajores:Pk,celoSepolia:Ik,chang:Bk,chiliz:Fk,chips:Uk,citreaTestnet:Ok,classic:Dk,coinbit:_k,coinex:Mk,confluxESpace:Nk,confluxESpaceTestnet:Lk,coreDao:zk,coreTestnet1:Rk,coreTestnet2:Hk,corn:$k,cornTestnet:Gk,crab:jk,creatorTestnet:Vk,creditCoin3Devnet:Wk,creditCoin3Mainnet:qk,creditCoin3Testnet:Yk,cronos:Kk,cronosTestnet:Zk,cronoszkEVM:Xk,cronoszkEVMTestnet:Qk,crossbell:Jk,crossfi:e7,curtis:t7,cyber:r7,cyberTestnet:n7,dailyNetwork:s7,dailyNetworkTestnet:a7,darwinia:o7,datahavenTestnet:i7,dbkchain:c7,dchain:l7,dchainTestnet:u7,defichainEvm:d7,defichainEvmTestnet:p7,degen:f7,dfk:m7,diode:h7,disChain:b7,dodochainTestnet:y7,dogechain:g7,domaTestnet:x7,donatuz:w7,dosChain:v7,dosChainTestnet:E7,dreyerxMainnet:k7,dreyerxTestnet:C7,dustboyIoT:T7,dymension:S7,edexa:A7,edexaTestnet:P7,edgeless:I7,edgelessTestnet:B7,edgeware:F7,edgewareTestnet:U7,eduChain:O7,eduChainTestnet:D7,ekta:_7,ektaTestnet:M7,elastos:N7,elastosTestnet:L7,electroneum:z7,electroneumTestnet:R7,elysiumTestnet:H7,energy:$7,eni:G7,eniTestnet:j7,enuls:V7,eon:W7,eos:q7,eosTestnet:Y7,eteria:K7,etherlink:Z7,etherlinkShadownetTestnet:X7,etherlinkTestnet:Q7,ethernity:J7,etp:eC,evmos:tC,evmosTestnet:rC,excelonMainnet:nC,expanse:sC,exsat:aC,exsatTestnet:oC,fantom:iC,fantomSonicTestnet:cC,fantomTestnet:lC,fibo:uC,filecoin:dC,filecoinCalibration:pC,filecoinHyperspace:fC,fireChain:G3,flame:mC,flare:hC,flareTestnet:bC,flowMainnet:yC,flowPreviewnet:gC,flowTestnet:xC,fluence:wC,fluenceStage:vC,fluenceTestnet:EC,fluentTestnet:kC,form:CC,formTestnet:SC,forma:TC,formicarium:sA,forta:AC,foundry:PC,fraxtal:IC,fraxtalTestnet:BC,funkiMainnet:FC,funkiSepolia:UC,fuse:OC,fuseSparknet:DC,fusion:_C,fusionTestnet:MC,garnet:NC,gatechain:LC,geist:zC,genesys:RC,giwaSepolia:bb,giwaSepoliaPreconf:HC,glideL1Protocol:$C,glideL2Protocol:GC,gnosis:jC,gnosisChiado:VC,goChain:YC,goat:WC,gobi:qC,godwoken:KC,goerli:ZC,graphite:XC,graphiteTestnet:QC,gravity:JC,gunz:e9,guruNetwork:t9,guruTestnet:r9,ham:n9,happychainTestnet:s9,haqqMainnet:a9,haqqTestedge2:o9,hardhat:i9,harmonyOne:c9,hashkey:l9,hashkeyTestnet:u9,haustTestnet:d9,hedera:p9,hederaPreviewnet:f9,hederaTestnet:m9,hela:h9,heliosTestnet:b9,hemi:y9,hemiSepolia:g9,henesys:x9,holesky:w9,hoodi:v9,hpb:E9,hpp:k9,hppSepolia:C9,huddle01Mainnet:T9,huddle01Testnet:S9,humanity:A9,humanityTestnet:P9,humanode:I9,humanodeTestnet5:B9,hychain:F9,hychainTestnet:U9,hyperEvm:yb,hyperliquid:yb,hyperliquidEvmTestnet:O9,iSunCoin:K9,icbNetwork:D9,idchain:_9,immutableZkEvm:M9,immutableZkEvmTestnet:N9,inEVM:L9,initVerse:z9,initVerseGenesis:R9,injective:H9,injectiveTestnet:$9,ink:G9,inkSepolia:j9,iota:V9,iotaTestnet:W9,iotex:q9,iotexTestnet:Y9,jasmyChain:Z9,jasmyChainTestnet:X9,jbc:Q9,jbcTestnet:J9,jocMainnet:eT,jocTestnet:tT,jovay:rT,jovaySepolia:nT,juneo:sT,juneoBCH1Chain:aT,juneoDAI1Chain:oT,juneoDOGE1Chain:iT,juneoEUR1Chain:cT,juneoGLD1Chain:lT,juneoLINK1Chain:uT,juneoLTC1Chain:dT,juneoSGD1Chain:fT,juneoSocotraTestnet:mT,juneoUSD1Chain:hT,juneoUSDT1Chain:bT,juneomBTC1Chain:pT,kaia:yT,kairos:gT,kakarotSepolia:xT,kakarotStarknetSepolia:wT,kardiaChain:vT,karura:ET,katana:kT,kava:CT,kavaTestnet:TT,kcc:ST,kiiTestnetOro:AT,kinto:PT,klaytn:IT,klaytnBaobab:BT,koi:FT,kroma:UT,kromaSepolia:OT,l3x:DT,l3xTestnet:_T,lavita:MT,lens:NT,lensTestnet:LT,lestnet:zT,lightlinkPegasus:RT,lightlinkPhoenix:HT,linea:kS,lineaGoerli:CS,lineaSepolia:TS,lineaTestnet:SS,lisk:AS,liskSepolia:PS,loadAlphanet:IS,localhost:BS,loop:FS,lukso:US,luksoTestnet:OS,lumiaMainnet:DS,lumiaTestnet:_S,lumoz:MS,lumozTestnet:NS,lycan:LS,lyra:zS,mainnet:RS,mandala:HS,manta:$S,mantaSepoliaTestnet:GS,mantaTestnet:jS,mantle:VS,mantleSepoliaTestnet:WS,mantleTestnet:qS,mantraDuKongEVMTestnet:YS,mantraEVM:KS,mapProtocol:ZS,matchain:XS,matchainTestnet:QS,mchVerse:JS,megaethTestnet:eA,mekong:tA,meld:rA,memecore:nA,merlin:aA,merlinErigonTestnet:oA,metachain:iA,metachainIstanbul:cA,metadium:lA,metalL2:uA,meter:dA,meterTestnet:pA,metis:fA,metisGoerli:mA,metisSepolia:hA,mev:bA,mevTestnet:yA,mint:gA,mintSepoliaTestnet:xA,mitosisTestnet:wA,mode:vA,modeTestnet:EA,monad:kA,monadTestnet:CA,moonbaseAlpha:TA,moonbeam:SA,moonbeamDev:AA,moonriver:PA,morph:IA,morphHolesky:BA,morphSepolia:FA,nahmii:UA,nautilus:OA,near:DA,nearTestnet:_A,neonDevnet:MA,neonMainnet:NA,neoxMainnet:LA,neoxT4:zA,newton:RA,nexi:HA,nexilix:$A,nibiru:GA,nitrographTestnet:jA,nomina:VA,oasisTestnet:WA,oasys:qA,odysseyTestnet:YA,okc:KA,omax:ZA,omni:XA,omniOmega:QA,oneWorld:JA,oortMainnetDev:eP,opBNB:tP,opBNBTestnet:rP,openledger:nP,optimism:sP,optimismGoerli:aP,optimismSepolia:oP,optopia:iP,optopiaTestnet:cP,orderly:lP,orderlySepolia:uP,otimDevnet:dP,palm:pP,palmTestnet:fP,peaq:mP,pgn:hP,pgnTestnet:bP,phoenix:yP,planq:gP,plasma:xP,plasmaDevnet:wP,plasmaTestnet:vP,playfiAlbireo:EP,plinga:kP,plume:CP,plumeDevnet:TP,plumeMainnet:SP,plumeSepolia:AP,plumeTestnet:PP,polterTestnet:IP,polygon:BP,polygonAmoy:FP,polygonMumbai:UP,polygonZkEvm:OP,polygonZkEvmCardona:DP,polygonZkEvmTestnet:_P,polynomial:MP,polynomialSepolia:NP,potos:LP,potosTestnet:zP,premiumBlockTestnet:RP,pulsechain:HP,pulsechainV4:$P,pumpfiTestnet:GP,pyrope:jP,qMainnet:WP,qTestnet:qP,ql1:VP,quai:YP,quaiTestnet:KP,reactiveTestnet:ZP,real:XP,redbellyMainnet:QP,redbellyTestnet:JP,reddio:eI,reddioSepolia:tI,redstone:rI,rei:nI,reyaNetwork:sI,riseTestnet:aI,rivalz:oI,rollux:iI,rolluxTestnet:cI,ronin:lI,root:uI,rootPorcini:dI,rootstock:pI,rootstockTestnet:fI,rss3:mI,rss3Sepolia:hI,saakuru:bI,saga:yI,saigon:gI,sanko:xI,sapphire:wI,sapphireTestnet:vI,satoshiVM:EI,satoshiVMTestnet:kI,scroll:CI,scrollSepolia:TI,sei:SI,seiDevnet:AI,seiTestnet:II,seismicDevnet:PI,sepolia:BI,shape:FI,shapeSepolia:UI,shardeum:OI,shardeumSphinx:DI,shibarium:_I,shibariumTestnet:MI,shiden:NI,shimmer:LI,shimmerTestnet:zI,sidraChain:RI,silentData:HI,silicon:$I,siliconSepolia:GI,sixProtocol:jI,skaleBase:nB,skaleBaseSepoliaTestnet:sB,skaleBlockBrawlers:VI,skaleCalypso:WI,skaleCalypsoTestnet:qI,skaleCryptoBlades:YI,skaleCryptoColosseum:KI,skaleEuropa:ZI,skaleEuropaTestnet:XI,skaleExorde:QI,skaleHumanProtocol:JI,skaleNebula:eB,skaleNebulaTestnet:tB,skaleRazor:rB,skaleTitan:aB,skaleTitanTestnet:oB,sketchpad:iB,snax:cB,snaxTestnet:lB,somnia:uB,somniaTestnet:dB,soneium:pB,soneiumMinato:fB,songbird:mB,songbirdTestnet:hB,sonic:bB,sonicBlazeTestnet:yB,sonicTestnet:gB,sophon:xB,sophonTestnet:wB,sova:vB,sovaSepolia:EB,spicy:kB,stableTestnet:CB,statusNetworkSepolia:ey,statusSepolia:ey,step:TB,story:SB,storyAeneid:AB,storyOdyssey:PB,storyTestnet:IB,stratis:BB,superlumio:FB,superposition:UB,superseed:OB,superseedSepolia:DB,surgeTestnet:_B,swan:MB,swanProximaTestnet:NB,swanSaturnTestnet:LB,swellchain:zB,swellchainTestnet:RB,swissdlt:HB,syscoin:$B,syscoinTestnet:GB,tac:jB,tacSPB:VB,taiko:WB,taikoHekla:qB,taikoHoodi:YB,taikoJolnir:KB,taikoKatla:ZB,taikoTestnetSepolia:XB,taraxa:QB,taraxaTestnet:JB,teaSepolia:eF,telcoinTestnet:tF,telos:rF,telosTestnet:nF,tempoDevnet:VD,tempoLocalnet:WD,tempoTestnet:qD,tenet:YD,ternoa:KD,thaiChain:ZD,that:XD,theta:QD,thetaTestnet:JD,thunderCore:e_,thunderTestnet:t_,tiktrixTestnet:r_,tomb:n_,treasure:s_,treasureTopaz:a_,tron:o_,tronNile:i_,tronShasta:c_,ubiq:l_,ultra:u_,ultraTestnet:d_,ultron:p_,ultronTestnet:f_,unichain:m_,unichainSepolia:h_,unique:b_,uniqueOpal:y_,uniqueQuartz:g_,unreal:x_,vana:w_,vanaMoksha:v_,vanar:E_,vechain:k_,velas:C_,viction:T_,victionTestnet:S_,vision:A_,visionTestnet:P_,wanchain:I_,wanchainTestnet:B_,weaveVMAlphanet:F_,wemix:U_,wemixTestnet:O_,westendAssetHub:D_,whitechain:__,whitechainTestnet:M_,wmcTestnet:N_,worldLand:R_,worldchain:L_,worldchainSepolia:z_,x1Testnet:zg,xLayer:V_,xLayerTestnet:zg,xai:H_,xaiTestnet:$_,xdc:G_,xdcTestnet:j_,xoneMainnet:W_,xoneTestnet:q_,xphereMainnet:Y_,xphereTestnet:K_,xrOne:Z_,xrSepolia:eM,xrplevm:X_,xrplevmDevnet:Q_,xrplevmTestnet:J_,yooldoVerse:tM,yooldoVerseTestnet:rM,zenchainTestnet:nM,zeniq:sM,zeroG:z3,zeroGGalileoTestnet:R3,zeroGMainnet:H3,zeroGTestnet:$3,zeroNetwork:aM,zetachain:oM,zetachainAthensTestnet:iM,zhejiang:cM,zilliqa:lM,zilliqaTestnet:uM,zircuit:dM,zircuitGarfieldTestnet:pM,zircuitTestnet:fM,zkFair:mM,zkFairTestnet:hM,zkLinkNova:bM,zkLinkNovaSepoliaTestnet:yM,zkSync:Rg,zkSyncInMemoryNode:Hg,zkSyncLocalNode:$g,zkSyncSepoliaTestnet:Gg,zksync:Rg,zksyncInMemoryNode:Hg,zksyncLocalCustomHyperchain:gM,zksyncLocalHyperchain:xM,zksyncLocalHyperchainL1:wM,zksyncLocalNode:$g,zksyncSepoliaTestnet:Gg,zora:vM,zoraSepolia:EM,zoraTestnet:kM},Symbol.toStringTag,{value:"Module"}));class TM extends ${constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Vg="/docs/contract/encodeEventTopics";function Hi(e){var c;const{abi:t,eventName:r,args:n}=e;let s=t[0];if(r){const l=$s({abi:t,name:r});if(!l)throw new kb(r,{docsPath:Vg});s=l}if(s.type!=="event")throw new kb(void 0,{docsPath:Vg});const a=Mr(s),o=il(a);let i=[];if(n&&"inputs"in s){const l=(c=s.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(d=>n[d.name]))??[]:[];u.length>0&&(i=(l==null?void 0:l.map((d,f)=>Array.isArray(u[f])?u[f].map((m,y)=>Wg({param:d,value:u[f][y]})):typeof u[f]<"u"&&u[f]!==null?Wg({param:d,value:u[f]}):null))??[])}return[o,...i]}function Wg({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Ut(wn(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new TM(e.type);return os([e],[t])}function Kl(e,{method:t}){var n,s;const r={};return e.transport.type==="fallback"&&((s=(n=e.transport).onResponse)==null||s.call(n,({method:a,response:o,status:i,transport:c})=>{i==="success"&&t===a&&(r[o]=c.request)})),(a=>r[a]||e.request)}async function qg(e,t){const{address:r,abi:n,args:s,eventName:a,fromBlock:o,strict:i,toBlock:c}=t,l=Kl(e,{method:"eth_newFilter"}),u=a?Hi({abi:n,args:s,eventName:a}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?q(o):o,toBlock:typeof c=="bigint"?q(c):c,topics:u}]});return{abi:n,args:s,eventName:a,id:d,request:l(d),strict:!!i,type:"event"}}class SM extends ${constructor(t,{account:r,docsPath:n,chain:s,data:a,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var y;const m=No({from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${Md(f)} ${((y=s==null?void 0:s.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof i<"u"&&`${Xt(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${Xt(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Xt(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",m].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function AM(e,{docsPath:t,...r}){const n=(()=>{const s=ll(e,r);return s instanceof zo?e:s})();return new SM(n,{docsPath:t,...r})}class Yg extends ${constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Sf extends ${constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class PM extends ${constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Xt(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Kg extends ${constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}async function Rr(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:s}={}){var l,u,d;const a=s??!1,o=r!==void 0?q(r):void 0;let i=null;if(t?i=await e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):i=await e.request({method:"eth_getBlockByNumber",params:[o||n,a]},{dedupe:!!o}),!i)throw new Kg({blockHash:t,blockNumber:r});return(((d=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:d.format)||Bd)(i,"getBlock")}async function Af(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function IM(e,t){return Zg(e,t)}async function Zg(e,t){var a,o;const{block:r,chain:n=e.chain,request:s}=t||{};try{const i=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof i=="function"){const l=r||await ne(e,Rr,"getBlock")({}),u=await i({block:l,client:e,request:s});if(u===null)throw new Error;return u}if(typeof i<"u")return i;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return Le(c)}catch{const[i,c]=await Promise.all([r?Promise.resolve(r):ne(e,Rr,"getBlock")({}),ne(e,Af,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new Sf;const l=c-i.baseFeePerGas;return l<0n?0n:l}}async function BM(e,t){return Pf(e,t)}async function Pf(e,t){var f,m;const{block:r,chain:n=e.chain,request:s,type:a="eip1559"}=t||{},o=await(async()=>{var y,g;return typeof((y=n==null?void 0:n.fees)==null?void 0:y.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:s}):((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(o<1)throw new Yg;const c=10**(((f=o.toString().split(".")[1])==null?void 0:f.length)??0),l=y=>y*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await ne(e,Rr,"getBlock")({});if(typeof((m=n==null?void 0:n.fees)==null?void 0:m.estimateFeesPerGas)=="function"){const y=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:l,request:s,type:a});if(y!==null)return y}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Sf;const y=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await Zg(e,{block:u,chain:n,request:s}),g=l(u.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??g+y,maxPriorityFeePerGas:y}}return{gasPrice:(s==null?void 0:s.gasPrice)??l(await ne(e,Af,"getGasPrice")({}))}}async function If(e,{address:t,blockTag:r="latest",blockNumber:n}){const s=await e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?q(n):r]},{dedupe:!!n});return ir(s)}function Zl(e,{docsPath:t,...r}){const n=(()=>{const s=ll(e,r);return s instanceof zo?e:s})();return new h8(n,{docsPath:t,...r})}async function ls(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return ir(t)}async function Bf(e,t){var h,b,x,A,I;const{account:r=e.account,accessList:n,authorizationList:s,chain:a=e.chain,blobVersionedHashes:o,blobs:i,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:y,nonceManager:g,to:E,type:w,value:v,...S}=t,C=await(async()=>{if(!r||!g||typeof y<"u")return y;const F=Ke(r),_=a?a.id:await ne(e,ls,"getChainId")({});return await g.consume({address:F.address,chainId:_,client:e})})();rn(t);const D=(b=(h=a==null?void 0:a.formatters)==null?void 0:h.transactionRequest)==null?void 0:b.format,T=(D||_r)({...Ws(S,{format:D}),account:r?Ke(r):void 0,accessList:n,authorizationList:s,blobs:i,blobVersionedHashes:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:C,to:E,type:w,value:v},"fillTransaction");try{const F=await e.request({method:"eth_fillTransaction",params:[T]}),k=(((A=(x=a==null?void 0:a.formatters)==null?void 0:x.transaction)==null?void 0:A.format)||Ns)(F.tx);delete k.blockHash,delete k.blockNumber,delete k.r,delete k.s,delete k.transactionIndex,delete k.v,delete k.yParity,k.data=k.input,k.gas&&(k.gas=t.gas??k.gas),k.gasPrice&&(k.gasPrice=t.gasPrice??k.gasPrice),k.maxFeePerBlobGas&&(k.maxFeePerBlobGas=t.maxFeePerBlobGas??k.maxFeePerBlobGas),k.maxFeePerGas&&(k.maxFeePerGas=t.maxFeePerGas??k.maxFeePerGas),k.maxPriorityFeePerGas&&(k.maxPriorityFeePerGas=t.maxPriorityFeePerGas??k.maxPriorityFeePerGas),k.nonce&&(k.nonce=t.nonce??k.nonce);const P=await(async()=>{var H,G;if(typeof((H=a==null?void 0:a.fees)==null?void 0:H.baseFeeMultiplier)=="function"){const J=await ne(e,Rr,"getBlock")({});return a.fees.baseFeeMultiplier({block:J,client:e,request:t})}return((G=a==null?void 0:a.fees)==null?void 0:G.baseFeeMultiplier)??1.2})();if(P<1)throw new Yg;const U=10**(((I=P.toString().split(".")[1])==null?void 0:I.length)??0),z=H=>H*BigInt(Math.ceil(P*U))/BigInt(U);return k.maxFeePerGas&&!t.maxFeePerGas&&(k.maxFeePerGas=z(k.maxFeePerGas)),k.gasPrice&&!t.gasPrice&&(k.gasPrice=z(k.gasPrice)),{raw:F.raw,transaction:{from:T.from,...k}}}catch(F){throw Zl(F,{...t,chain:e.chain})}}const Ff=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Xg=new Map,Uf=new Da(128);async function $i(e,t){var C,D,L;let r=t;r.account??(r.account=e.account),r.parameters??(r.parameters=Ff);const{account:n,chain:s=e.chain,nonceManager:a,parameters:o}=r,i=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let c;async function l(){return c||(typeof r.chainId<"u"?r.chainId:s?s.id:(c=await ne(e,ls,"getChainId")({}),c))}const u=n&&Ke(n);let d=r.nonce;if(o.includes("nonce")&&typeof d>"u"&&u&&a){const T=await l();d=await a.consume({address:u.address,chainId:T,client:e})}i!=null&&i.fn&&((C=i.runAt)!=null&&C.includes("beforeFillTransaction"))&&(r=await i.fn({...r,chain:s},{phase:"beforeFillTransaction"}),d??(d=r.nonce));const m=((o.includes("blobVersionedHashes")||o.includes("sidecars"))&&r.kzg&&r.blobs||Uf.get(e.uid)===!1||!["fees","gas"].some(h=>o.includes(h))?!1:!!(o.includes("chainId")&&typeof r.chainId!="number"||o.includes("nonce")&&typeof d!="number"||o.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||o.includes("gas")&&typeof r.gas!="bigint"))?await ne(e,Bf,"fillTransaction")({...r,nonce:d}).then(T=>{const{chainId:h,from:b,gas:x,gasPrice:A,nonce:I,maxFeePerBlobGas:F,maxFeePerGas:_,maxPriorityFeePerGas:k,type:P,...O}=T.transaction;return Uf.set(e.uid,!0),{...r,...b?{from:b}:{},...P?{type:P}:{},...typeof h<"u"?{chainId:h}:{},...typeof x<"u"?{gas:x}:{},...typeof A<"u"?{gasPrice:A}:{},...typeof I<"u"?{nonce:I}:{},...typeof F<"u"?{maxFeePerBlobGas:F}:{},...typeof _<"u"?{maxFeePerGas:_}:{},...typeof k<"u"?{maxPriorityFeePerGas:k}:{},..."nonceKey"in O&&typeof O.nonceKey<"u"?{nonceKey:O.nonceKey}:{}}}).catch(T=>{var x;const h=T;return h.name!=="TransactionExecutionError"||((x=h.walk)==null?void 0:x.call(h,A=>{const I=A;return I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError"}))&&Uf.set(e.uid,!1),r}):r;d??(d=m.nonce),r={...m,...u?{from:u==null?void 0:u.address}:{},...d?{nonce:d}:{}};const{blobs:y,gas:g,kzg:E,type:w}=r;i!=null&&i.fn&&((D=i.runAt)!=null&&D.includes("beforeFillParameters"))&&(r=await i.fn({...r,chain:s},{phase:"beforeFillParameters"}));let v;async function S(){return v||(v=await ne(e,Rr,"getBlock")({blockTag:"latest"}),v)}if(o.includes("nonce")&&typeof d>"u"&&u&&!a&&(r.nonce=await ne(e,If,"getTransactionCount")({address:u.address,blockTag:"pending"})),(o.includes("blobVersionedHashes")||o.includes("sidecars"))&&y&&E){const T=Nd({blobs:y,kzg:E});if(o.includes("blobVersionedHashes")){const h=G1({commitments:T,to:"hex"});r.blobVersionedHashes=h}if(o.includes("sidecars")){const h=Ld({blobs:y,commitments:T,kzg:E}),b=Z1({blobs:y,commitments:T,proofs:h,to:"hex"});r.sidecars=b}}if(o.includes("chainId")&&(r.chainId=await l()),(o.includes("fees")||o.includes("type"))&&typeof w>"u")try{r.type=sp(r)}catch{let T=Xg.get(e.uid);if(typeof T>"u"){const h=await S();T=typeof(h==null?void 0:h.baseFeePerGas)=="bigint",Xg.set(e.uid,T)}r.type=T?"eip1559":"legacy"}if(o.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const T=await S(),{maxFeePerGas:h,maxPriorityFeePerGas:b}=await Pf(e,{block:T,chain:s,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<b)throw new PM({maxPriorityFeePerGas:b});r.maxPriorityFeePerGas=b,r.maxFeePerGas=h}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new Sf;if(typeof r.gasPrice>"u"){const T=await S(),{gasPrice:h}=await Pf(e,{block:T,chain:s,request:r,type:"legacy"});r.gasPrice=h}}return o.includes("gas")&&typeof g>"u"&&(r.gas=await ne(e,Of,"estimateGas")({...r,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),i!=null&&i.fn&&((L=i.runAt)!=null&&L.includes("afterFillParameters"))&&(r=await i.fn({...r,chain:s},{phase:"afterFillParameters"})),rn(r),delete r.parameters,r}async function Of(e,t){var o,i,c;const{account:r=e.account,prepare:n=!0}=t,s=r?Ke(r):void 0,a=(()=>{if(Array.isArray(n))return n;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await jl({authorization:t.authorizationList[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:m,blockNumber:y,blockTag:g,data:E,gas:w,gasPrice:v,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:D,nonce:L,value:T,stateOverride:h,...b}=n?await $i(e,{...t,parameters:a,to:l}):t;if(w&&t.gas!==w)return w;const A=(typeof y=="bigint"?q(y):void 0)||g,I=gf(h);rn(t);const F=(c=(i=(o=e.chain)==null?void 0:o.formatters)==null?void 0:i.transactionRequest)==null?void 0:c.format,k=(F||_r)({...Ws(b,{format:F}),account:s,accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:m,data:E,gasPrice:v,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:D,nonce:L,to:l,value:T},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:I?[k,A??e.experimental_blockTag??"latest",I]:A?[k,A]:[k]}))}catch(l){throw AM(l,{...t,account:s,chain:e.chain})}}async function FM(e,t){const{abi:r,address:n,args:s,functionName:a,dataSuffix:o,...i}=t,c=fr({abi:r,args:s,functionName:a});try{return await ne(e,Of,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:n,...i})}catch(l){const u=i.account?Ke(i.account):void 0;throw Js(l,{abi:r,address:n,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:u==null?void 0:u.address})}}const Qg="/docs/contract/decodeEventLog";function Xl(e){const{abi:t,data:r,strict:n,topics:s}=e,a=n??!0,[o,...i]=s;if(!o)throw new ZT({docsPath:Qg});const c=t.find(g=>g.type==="event"&&o===il(Mr(g)));if(!(c&&"name"in c)||c.type!=="event")throw new XT(o,{docsPath:Qg});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(g=>!("name"in g&&g.name)),f=d?[]:{},m=u.map((g,E)=>[g,E]).filter(([g])=>"indexed"in g&&g.indexed);for(let g=0;g<m.length;g++){const[E,w]=m[g],v=i[g];if(!v)throw new up({abiItem:c,param:E});f[d?w:E.name||w]=UM({param:E,value:v})}const y=u.filter(g=>!("indexed"in g&&g.indexed));if(y.length>0){if(r&&r!=="0x")try{const g=Ko(y,r);if(g)if(d)for(let E=0;E<u.length;E++)f[E]=f[E]??g.shift();else for(let E=0;E<y.length;E++)f[y[E].name]=g[E]}catch(g){if(a)throw g instanceof wb||g instanceof T1?new sl({abiItem:c,data:r,params:y,size:lt(r)}):g}else if(a)throw new sl({abiItem:c,data:"0x",params:y,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function UM({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Ko([e],t)||[])[0]}function Df(e){const{abi:t,args:r,logs:n,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return n.map(o=>{var u;const i=t.filter(d=>d.type==="event"&&o.topics[0]===il(d));if(i.length===0)return null;let c,l;for(const d of i)try{c=Xl({...o,abi:[d],strict:!0}),l=d;break}catch{}if(!c&&!s){l=i[0];try{c=Xl({...o,abi:[l],strict:!1})}catch{const d=(u=l.inputs)==null?void 0:u.some(f=>!("name"in f&&f.name));return{...o,args:d?[]:{},eventName:l.name}}}return!c||!l||a&&!a.includes(c.eventName)||!OM({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...o}}).filter(Boolean)}function OM(e){const{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function s(a,o,i){try{return a.type==="address"?Ja(o,i):a.type==="string"||a.type==="bytes"?Ut(wn(o))===i:o===i}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((a,o)=>{if(a==null)return!0;const i=r[o];return i?(Array.isArray(a)?a:[a]).some(l=>s(i,l,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([a,o])=>{if(o==null)return!0;const i=r.find(l=>l.name===a);return i?(Array.isArray(o)?o:[o]).some(l=>s(i,l,t[a])):!1}):!1}async function _f(e,{address:t,blockHash:r,fromBlock:n,toBlock:s,event:a,events:o,args:i,strict:c}={}){const l=c??!1,u=o??(a?[a]:void 0);let d=[];u&&(d=[u.flatMap(g=>Hi({abi:[g],eventName:g.name,args:o?void 0:i}))],a&&(d=d[0]));let f;r?f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof n=="bigint"?q(n):n,toBlock:typeof s=="bigint"?q(s):s}]});const m=f.map(y=>Jr(y));return u?Df({abi:u,args:i,logs:m,strict:l}):m}async function Jg(e,t){const{abi:r,address:n,args:s,blockHash:a,eventName:o,fromBlock:i,toBlock:c,strict:l}=t,u=o?$s({abi:r,name:o}):void 0,d=u?void 0:r.filter(f=>f.type==="event");return ne(e,_f,"getLogs")({address:n,args:s,blockHash:a,event:u,events:d,fromBlock:i,toBlock:c,strict:l})}async function DM(e,t){const{abi:r,address:n,args:s,dataSuffix:a,functionName:o,...i}=t,c=i.account?Ke(i.account):e.account,l=fr({abi:r,args:s,functionName:o});try{const{data:u}=await ne(e,Mi,"call")({batch:!1,data:`${l}${a?a.replace("0x",""):""}`,to:n,...i,account:c}),d=Qs({abi:r,args:s,functionName:o,data:u||"0x"}),f=r.filter(m=>"name"in m&&m.name===t.functionName);return{result:d,request:{abi:f,address:n,args:s,dataSuffix:a,functionName:o,...i,account:c}}}catch(u){throw Js(u,{abi:r,address:n,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}const Mf=new Map,e6=new Map;let _M=0;function Un(e,t,r){const n=++_M,s=()=>Mf.get(e)||[],a=()=>{const u=s();Mf.set(e,u.filter(d=>d.id!==n))},o=()=>{const u=s();if(!u.some(f=>f.id===n))return;const d=e6.get(e);if(u.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}a()},i=s();if(Mf.set(e,[...i,{id:n,fns:t}]),i&&i.length>0)return o;const c={};for(const u in t)c[u]=((...d)=>{var m,y;const f=s();if(f.length!==0)for(const g of f)(y=(m=g.fns)[u])==null||y.call(m,...d)});const l=r(c);return typeof l=="function"&&e6.set(e,l),o}async function Nf(e){return new Promise(t=>setTimeout(t,e))}function eo(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let s=!0;const a=()=>s=!1;return(async()=>{let i;t&&(i=await e({unpoll:a}));const c=await(r==null?void 0:r(i))??n;await Nf(c);const l=async()=>{s&&(await e({unpoll:a}),await Nf(n),l())};l()})(),a}const MM=new Map,NM=new Map;function LM(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),r=t(e,MM),n=t(e,NM);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function zM(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){const n=LM(t),s=n.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let a=n.promise.get();a||(a=e(),n.promise.set(a));try{const o=await a;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}const RM=e=>`blockNumber.${e}`;async function Gi(e,{cacheTime:t=e.cacheTime}={}){const r=await zM(()=>e.request({method:"eth_blockNumber"}),{cacheKey:RM(e.uid),cacheTime:t});return BigInt(r)}async function Ql(e,{filter:t}){const r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;const s=n.map(a=>Jr(a));return!("abi"in t)||!t.abi?s:Df({abi:t.abi,logs:s,strict:r})}async function Jl(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function HM(e,t){const{abi:r,address:n,args:s,batch:a=!0,eventName:o,fromBlock:i,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:f}=t;return(typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const E=f??!1,w=mt(["watchContractEvent",n,s,a,e.uid,o,d,E,i]);return Un(w,{onLogs:l,onError:c},v=>{let S;i!==void 0&&(S=i-1n);let C,D=!1;const L=eo(async()=>{var T;if(!D){try{C=await ne(e,qg,"createContractEventFilter")({abi:r,address:n,args:s,eventName:o,strict:E,fromBlock:i})}catch{}D=!0;return}try{let h;if(C)h=await ne(e,Ql,"getFilterChanges")({filter:C});else{const b=await ne(e,Gi,"getBlockNumber")({});S&&S<b?h=await ne(e,Jg,"getContractEvents")({abi:r,address:n,args:s,eventName:o,fromBlock:S+1n,toBlock:b,strict:E}):h=[],S=b}if(h.length===0)return;if(a)v.onLogs(h);else for(const b of h)v.onLogs([b])}catch(h){C&&h instanceof is&&(D=!1),(T=v.onError)==null||T.call(v,h)}},{emitOnBegin:!0,interval:d});return async()=>{C&&await ne(e,Jl,"uninstallFilter")({filter:C}),L()}})})():(()=>{const E=f??!1,w=mt(["watchContractEvent",n,s,a,e.uid,o,d,E]);let v=!0,S=()=>v=!1;return Un(w,{onLogs:l,onError:c},C=>((async()=>{try{const D=(()=>{if(e.transport.type==="fallback"){const h=e.transport.transports.find(b=>b.config.type==="webSocket"||b.config.type==="ipc");return h?h.value:e.transport}return e.transport})(),L=o?Hi({abi:r,eventName:o,args:s}):[],{unsubscribe:T}=await D.subscribe({params:["logs",{address:n,topics:L}],onData(h){var x;if(!v)return;const b=h.result;try{const{eventName:A,args:I}=Xl({abi:r,data:b.data,topics:b.topics,strict:f}),F=Jr(b,{args:I,eventName:A});C.onLogs([F])}catch(A){let I,F;if(A instanceof sl||A instanceof up){if(f)return;I=A.abiItem.name,F=(x=A.abiItem.inputs)==null?void 0:x.some(k=>!("name"in k&&k.name))}const _=Jr(b,{args:F?[]:{},eventName:I});C.onLogs([_])}},onError(h){var b;(b=C.onError)==null||b.call(C,h)}});S=T,v||S()}catch(D){c==null||c(D)}})(),()=>S()))})()}async function Lf(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const zf=new Da(128);async function eu(e,t){var v,S,C,D;const{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:a,blobs:o,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,type:y,value:g,...E}=t;if(typeof r>"u")throw new kn({docsPath:"/docs/actions/wallet/sendTransaction"});const w=r?Ke(r):null;try{rn(t);const L=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await jl({authorization:a[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`.")})})();if((w==null?void 0:w.type)==="json-rpc"||w===null){let T;n!==null&&(T=await ne(e,ls,"getChainId")({}),lp({currentChainId:T,chain:n}));const h=(C=(S=(v=e.chain)==null?void 0:v.formatters)==null?void 0:S.transactionRequest)==null?void 0:C.format,x=(h||_r)({...Ws(E,{format:h}),accessList:s,account:w,authorizationList:a,blobs:o,chainId:T,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,to:L,type:y,value:g},"sendTransaction"),A=zf.get(e.uid),I=A?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:I,params:[x]},{retryCount:0})}catch(F){if(A===!1)throw F;const _=F;if(_.name==="InvalidInputRpcError"||_.name==="InvalidParamsRpcError"||_.name==="MethodNotFoundRpcError"||_.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[x]},{retryCount:0}).then(k=>(zf.set(e.uid,!0),k)).catch(k=>{const P=k;throw P.name==="MethodNotFoundRpcError"||P.name==="MethodNotSupportedRpcError"?(zf.set(e.uid,!1),_):P});throw _}}if((w==null?void 0:w.type)==="local"){const T=await ne(e,$i,"prepareTransactionRequest")({account:w,accessList:s,authorizationList:a,blobs:o,chain:n,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,nonceManager:w.nonceManager,parameters:[...Ff,"sidecars"],type:y,value:g,...E,to:L}),h=(D=n==null?void 0:n.serializers)==null?void 0:D.transaction,b=await w.signTransaction(T,{serializer:h});return await ne(e,Lf,"sendRawTransaction")({serializedTransaction:b})}throw(w==null?void 0:w.type)==="smart"?new Hs({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Hs({docsPath:"/docs/actions/wallet/sendTransaction",type:w==null?void 0:w.type})}catch(L){throw L instanceof Hs?L:Zl(L,{...t,account:w,chain:t.chain||void 0})}}async function ji(e,t){return ji.internal(e,eu,"sendTransaction",t)}(function(e){async function t(r,n,s,a){const{abi:o,account:i=r.account,address:c,args:l,dataSuffix:u,functionName:d,...f}=a;if(typeof i>"u")throw new kn({docsPath:"/docs/contract/writeContract"});const m=i?Ke(i):null,y=fr({abi:o,args:l,functionName:d});try{return await ne(r,n,s)({data:`${y}${u?u.replace("0x",""):""}`,to:c,account:m,...f})}catch(g){throw Js(g,{abi:o,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:m==null?void 0:m.address})}}e.internal=t})(ji||(ji={}));class $M extends ${constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}function tu(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((s,a)=>{const o=async({count:i=0}={})=>{const c=async({error:l})=>{const u=typeof t=="function"?t({count:i,error:l}):t;u&&await Nf(u),o({count:i+1})};try{const l=await e();s(l)}catch(l){if(i<r&&await n({count:i,error:l}))return c({error:l});a(l)}};o()})}const t6="0x5792579257925792579257925792579257925792579257925792579257925792",r6=q(0,{size:32});async function n6(e,t){const{account:r=e.account,capabilities:n,chain:s=e.chain,experimental_fallback:a,experimental_fallbackDelay:o=32,forceAtomic:i=!1,id:c,version:l="2.0.0"}=t,u=r?Ke(r):null,d=t.calls.map(f=>{const m=f,y=m.abi?fr({abi:m.abi,functionName:m.functionName,args:m.args}):m.data;return{data:m.dataSuffix&&y?cr([y,m.dataSuffix]):y,to:m.to,value:m.value?q(m.value):void 0}});try{const f=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:i,calls:d,capabilities:n,chainId:q(s.id),from:u==null?void 0:u.address,id:c,version:l}]},{retryCount:0});return typeof f=="string"?{id:f}:f}catch(f){const m=f;if(a&&(m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError"||m.name==="UnknownRpcError"||m.details.toLowerCase().includes("does not exist / is not available")||m.details.toLowerCase().includes("missing or invalid. request()")||m.details.toLowerCase().includes("did not match any variant of untagged enum")||m.details.toLowerCase().includes("account upgraded to unsupported contract")||m.details.toLowerCase().includes("eip-7702 not supported")||m.details.toLowerCase().includes("unsupported wc_ method")||m.details.toLowerCase().includes("feature toggled misconfigured")||m.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(n&&Object.values(n).some(v=>!v.optional)){const v="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new Va(new $(v,{details:v}))}if(i&&d.length>1){const w="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new Wa(new $(w,{details:w}))}const y=[];for(const w of d){const v=eu(e,{account:u,chain:s,data:w.data,to:w.to,value:w.value?Le(w.value):void 0});y.push(v),o>0&&await new Promise(S=>setTimeout(S,o))}const g=await Promise.allSettled(y);if(g.every(w=>w.status==="rejected"))throw g[0].reason;const E=g.map(w=>w.status==="fulfilled"?w.value:r6);return{id:cr([...E,q(s.id,{size:32}),t6])}}throw Zl(f,{...t,account:u,chain:t.chain})}}async function s6(e,t){async function r(u){if(u.endsWith(t6.slice(2))){const f=Zt(rp(u,-64,-32)),m=rp(u,0,-64).slice(2).match(/.{1,64}/g),y=await Promise.all(m.map(E=>r6.slice(2)!==E?e.request({method:"eth_getTransactionReceipt",params:[`0x${E}`]},{dedupe:!0}):void 0)),g=y.some(E=>E===null)?100:y.every(E=>(E==null?void 0:E.status)==="0x1")?200:y.every(E=>(E==null?void 0:E.status)==="0x0")?500:600;return{atomic:!1,chainId:ir(f),receipts:y.filter(Boolean),status:g,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[u]})}const{atomic:n=!1,chainId:s,receipts:a,version:o="2.0.0",...i}=await r(t.id),[c,l]=(()=>{const u=i.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...i,atomic:n,chainId:s?ir(s):void 0,receipts:(a==null?void 0:a.map(u=>({...u,blockNumber:Le(u.blockNumber),gasUsed:Le(u.gasUsed),status:v1[u.status]})))??[],statusCode:l,status:c,version:o}}async function a6(e,t){const{id:r,pollingInterval:n=e.pollingInterval,status:s=({statusCode:g})=>g===200||g>=300,retryCount:a=4,retryDelay:o=({count:g})=>~~(1<<g)*200,timeout:i=6e4,throwOnFailure:c=!1}=t,l=mt(["waitForCallsStatus",e.uid,r]),{promise:u,resolve:d,reject:f}=bf();let m;const y=Un(l,{resolve:d,reject:f},g=>{const E=eo(async()=>{const w=v=>{clearTimeout(m),E(),v(),y()};try{const v=await tu(async()=>{const S=await ne(e,s6,"getCallsStatus")({id:r});if(c&&S.status==="failure")throw new $M(S);return S},{retryCount:a,delay:o});if(!s(v))return;w(()=>g.resolve(v))}catch(v){w(()=>g.reject(v))}},{interval:n,emitOnBegin:!0});return E});return m=i?setTimeout(()=>{y(),clearTimeout(m),f(new GM({id:r}))},i):void 0,await u}class GM extends ${constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const Rf=256;let ru=Rf,nu;function o6(e=11){if(!nu||ru+e>Rf*2){nu="",ru=0;for(let t=0;t<Rf;t++)nu+=(256+Math.random()*256|0).toString(16).substring(1)}return nu.substring(ru,ru+++e)}function i6(e){const{batch:t,chain:r,ccipRead:n,key:s="base",name:a="Base Client",type:o="base"}=e,i=e.experimental_blockTag??(typeof(r==null?void 0:r.experimental_preconfirmationTime)=="number"?"pending":void 0),c=(r==null?void 0:r.blockTime)??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),u=e.pollingInterval??l,d=e.cacheTime??u,f=e.account?Ke(e.account):void 0,{config:m,request:y,value:g}=e.transport({account:f,chain:r,pollingInterval:u}),E={...m,...g},w={account:f,batch:t,cacheTime:d,ccipRead:n,chain:r,key:s,name:a,pollingInterval:u,request:y,transport:E,type:o,uid:o6(),...i?{experimental_blockTag:i}:{}};function v(S){return C=>{const D=C(S);for(const T in w)delete D[T];const L={...S,...D};return Object.assign(L,{extend:v(L)})}}return Object.assign(w,{extend:v(w)})}function Hf(e){var r,n,s,a,o,i;if(!(e instanceof $))return!1;const t=e.walk(c=>c instanceof vp);return t instanceof vp?((r=t.data)==null?void 0:r.errorName)==="HttpError"||((n=t.data)==null?void 0:n.errorName)==="ResolverError"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotContract"||((a=t.data)==null?void 0:a.errorName)==="ResolverNotFound"||((o=t.data)==null?void 0:o.errorName)==="ReverseAddressMismatch"||((i=t.data)==null?void 0:i.errorName)==="UnsupportedResolverProfile":!1}function jM(e){const{abi:t,data:r}=e,n=Rs(r,0,4),s=t.find(a=>a.type==="function"&&n===Yo(Mr(a)));if(!s)throw new QT(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Ko(s.inputs,Rs(r,4)):void 0}}const $f="/docs/contract/encodeErrorResult";function c6(e){const{abi:t,errorName:r,args:n}=e;let s=t[0];if(r){const c=$s({abi:t,args:n,name:r});if(!c)throw new vb(r,{docsPath:$f});s=c}if(s.type!=="error")throw new vb(void 0,{docsPath:$f});const a=Mr(s),o=Yo(a);let i="0x";if(n&&n.length>0){if(!s.inputs)throw new KT(s.name,{docsPath:$f});i=os(s.inputs,n)}return lr([o,i])}const Gf="/docs/contract/encodeFunctionResult";function VM(e){const{abi:t,functionName:r,result:n}=e;let s=t[0];if(r){const o=$s({abi:t,name:r});if(!o)throw new za(r,{docsPath:Gf});s=o}if(s.type!=="function")throw new za(void 0,{docsPath:Gf});if(!s.outputs)throw new Cb(s.name,{docsPath:Gf});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new Tb(n)})();return os(s.outputs,a)}const Vi="x-batch-gateway:true";async function l6(e){const{data:t,ccipRequest:r}=e,{args:[n]}=jM({abi:pf,data:t}),s=[],a=[];return await Promise.all(n.map(async(o,i)=>{try{a[i]=o.urls.includes(Vi)?await l6({data:o.data,ccipRequest:r}):await r(o),s[i]=!1}catch(c){s[i]=!0,a[i]=WM(c)}})),VM({abi:pf,functionName:"query",result:[s,a]})}function WM(e){return e.name==="HttpRequestError"&&e.status?c6({abi:pf,errorName:"HttpError",args:[e.status,e.shortMessage]}):c6({abi:[gb],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function u6(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Or(t)?t:null}function jf(e){let t=new Uint8Array(32).fill(0);if(!e)return wt(t);const r=e.split(".");for(let n=r.length-1;n>=0;n-=1){const s=u6(r[n]),a=s?wn(s):Ut(Ms(r[n]),"bytes");t=Ut(cr([t,a]),"bytes")}return wt(t)}function qM(e){return`[${e.slice(2)}]`}function YM(e){const t=new Uint8Array(32).fill(0);return e?u6(e)||Ut(Ms(e)):wt(t)}function Vf(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const r=new Uint8Array(Ms(t).byteLength+2);let n=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=Ms(s[a]);o.byteLength>255&&(o=Ms(qM(YM(s[a])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function KM(e,t){const{blockNumber:r,blockTag:n,coinType:s,name:a,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>a.endsWith(f)))return null;const d=s!=null?[jf(a),BigInt(s)]:[jf(a)];try{const f=fr({abi:yg,functionName:"addr",args:d}),m={address:l,abi:hg,functionName:"resolveWithGateways",args:[Fe(Vf(a)),f,o??[Vi]],blockNumber:r,blockTag:n},g=await ne(e,zr,"readContract")(m);if(g[0]==="0x")return null;const E=Qs({abi:yg,args:d,functionName:"addr",data:g[0]});return E==="0x"||Zt(E)==="0x00"?null:E}catch(f){if(i)throw f;if(Hf(f))return null;throw f}}class ZM extends ${constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Wi extends ${constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Wf extends ${constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class XM extends ${constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const QM=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,JM=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,eN=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,tN=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function rN(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const r=t.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function d6(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function p6({uri:e,gatewayUrls:t}){const r=eN.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=d6(t==null?void 0:t.ipfs,"https://ipfs.io"),s=d6(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(QM),{protocol:o,subpath:i,target:c,subtarget:l=""}=(a==null?void 0:a.groups)||{},u=o==="ipns:/"||i==="ipns/",d=o==="ipfs:/"||i==="ipfs/"||JM.test(e);if(e.startsWith("http")&&!u&&!d){let m=e;return t!=null&&t.arweave&&(m=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:m,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(tN,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new Wf({uri:e})}function f6(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new ZM({data:e});return e.image||e.image_url||e.image_data}async function nN({gatewayUrls:e,uri:t}){try{const r=await fetch(t).then(s=>s.json());return await qf({gatewayUrls:e,uri:f6(r)})}catch{throw new Wf({uri:t})}}async function qf({gatewayUrls:e,uri:t}){const{uri:r,isOnChain:n}=p6({uri:t,gatewayUrls:e});if(n||await rN(r))return r;throw new Wf({uri:t})}function sN(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[r,n,s]=t.split("/"),[a,o]=r.split(":"),[i,c]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new Wi({reason:"Only EIP-155 supported"});if(!o)throw new Wi({reason:"Chain ID not found"});if(!c)throw new Wi({reason:"Contract address not found"});if(!s)throw new Wi({reason:"Token ID not found"});if(!i)throw new Wi({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:i.toLowerCase(),contractAddress:c,tokenID:s}}async function aN(e,{nft:t}){if(t.namespace==="erc721")return zr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return zr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new XM({namespace:t.namespace})}async function oN(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?iN(e,{gatewayUrls:t,record:r}):qf({uri:r,gatewayUrls:t})}async function iN(e,{gatewayUrls:t,record:r}){const n=sN(r),s=await aN(e,{nft:n}),{uri:a,isOnChain:o,isEncoded:i}=p6({uri:s,gatewayUrls:t});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const l=i?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(l);return qf({uri:f6(u),gatewayUrls:t})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),nN({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function m6(e,t){const{blockNumber:r,blockTag:n,key:s,name:a,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>a.endsWith(d)))return null;try{const d={address:l,abi:hg,args:[Fe(Vf(a)),fr({abi:bg,functionName:"text",args:[jf(a),s]}),o??[Vi]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},m=await ne(e,zr,"readContract")(d);if(m[0]==="0x")return null;const y=Qs({abi:bg,functionName:"text",data:m[0]});return y===""?null:y}catch(d){if(i)throw d;if(Hf(d))return null;throw d}}async function cN(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:s,gatewayUrls:a,strict:o,universalResolverAddress:i}){const c=await ne(e,m6,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:s,universalResolverAddress:i,gatewayUrls:a,strict:o});if(!c)return null;try{return await oN(e,{record:c,gatewayUrls:n})}catch{return null}}async function lN(e,t){const{address:r,blockNumber:n,blockTag:s,coinType:a=60n,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:DO,args:[r,a,o??[Vi]],functionName:"reverseWithGateways",blockNumber:n,blockTag:s},d=ne(e,zr,"readContract"),[f]=await d(u);return f||null}catch(u){if(i)throw u;if(Hf(u))return null;throw u}}async function uN(e,t){const{blockNumber:r,blockTag:n,name:s}=t,{chain:a}=e,o=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})(),i=a==null?void 0:a.ensTlds;if(i&&!i.some(l=>s.endsWith(l)))throw new Error(`${s} is not a valid ENS TLD (${i==null?void 0:i.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[c]=await ne(e,zr,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Fe(Vf(s))],blockNumber:r,blockTag:n});return c}async function h6(e,t){var E,w,v;const{account:r=e.account,blockNumber:n,blockTag:s="latest",blobs:a,data:o,gas:i,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:m,...y}=t,g=r?Ke(r):void 0;try{rn(t);const C=(typeof n=="bigint"?q(n):void 0)||s,D=(v=(w=(E=e.chain)==null?void 0:E.formatters)==null?void 0:w.transactionRequest)==null?void 0:v.format,T=(D||_r)({...Ws(y,{format:D}),account:g,blobs:a,data:o,gas:i,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:m},"createAccessList"),h=await e.request({method:"eth_createAccessList",params:[T,C]});return{accessList:h.accessList,gasUsed:BigInt(h.gasUsed)}}catch(S){throw kp(S,{...t,account:g,chain:e.chain})}}async function dN(e){const t=Kl(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}async function b6(e,{address:t,args:r,event:n,events:s,fromBlock:a,strict:o,toBlock:i}={}){const c=s??(n?[n]:void 0),l=Kl(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(m=>Hi({abi:[m],eventName:m.name,args:r}))],n&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?q(a):a,toBlock:typeof i=="bigint"?q(i):i,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:a,id:d,request:l(d),strict:!!o,toBlock:i,type:"event"}}async function y6(e){const t=Kl(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}async function pN(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){const s=typeof r=="bigint"?q(r):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||n]});return BigInt(a)}async function fN(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function mN(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const s=r!==void 0?q(r):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),ir(a)}class hN extends ${constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function bN(e,t){const{address:r,factory:n,factoryData:s}=t;try{const[a,o,i,c,l,u,d]=await ne(e,zr,"readContract")({abi:yN,address:r,functionName:"eip712Domain",factory:n,factoryData:s});return{domain:{name:o,version:i,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:a}}catch(a){const o=a;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new hN({address:r}):o}}const yN=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function gN(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(r=>r.map(n=>BigInt(n)))}}async function xN(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:s}){const a=typeof r=="bigint"?q(r):void 0,o=await e.request({method:"eth_feeHistory",params:[q(t),a||n,s]},{dedupe:!!a});return gN(o)}async function wN(e,{filter:t}){const r=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>Jr(a));return t.abi?Df({abi:t.abi,logs:s,strict:r}):s}const su=new Da(8192);function vN(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(su.get(r))return su.get(r);const n=e().finally(()=>su.delete(r));return su.set(r,n),n}function EN(e,t={}){return async(r,n={})=>{var d;const{dedupe:s=!1,methods:a,retryDelay:o=150,retryCount:i=3,uid:c}={...t,...n},{method:l}=r;if((d=a==null?void 0:a.exclude)!=null&&d.includes(l))throw new Vs(new Error("method not supported"),{method:l});if(a!=null&&a.include&&!a.include.includes(l))throw new Vs(new Error("method not supported"),{method:l});const u=s?Sa(`${c}.${mt(r)}`):void 0;return vN(()=>tu(async()=>{try{return await e(r)}catch(f){const m=f;switch(m.code){case Qo.code:throw new Qo(m);case Jo.code:throw new Jo(m);case ei.code:throw new ei(m,{method:r.method});case ti.code:throw new ti(m);case js.code:throw new js(m);case is.code:throw new is(m);case ri.code:throw new ri(m);case ni.code:throw new ni(m);case si.code:throw new si(m);case Vs.code:throw new Vs(m,{method:r.method});case Ga.code:throw new Ga(m);case ai.code:throw new ai(m);case ja.code:throw new ja(m);case oi.code:throw new oi(m);case ii.code:throw new ii(m);case ci.code:throw new ci(m);case li.code:throw new li(m);case ui.code:throw new ui(m);case Va.code:throw new Va(m);case di.code:throw new di(m);case pi.code:throw new pi(m);case fi.code:throw new fi(m);case mi.code:throw new mi(m);case hi.code:throw new hi(m);case Wa.code:throw new Wa(m);case 5e3:throw new ja(m);default:throw f instanceof $?f:new vS(m)}}},{delay:({count:f,error:m})=>{var y;if(m&&m instanceof Gs){const g=(y=m==null?void 0:m.headers)==null?void 0:y.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g,10)*1e3}return~~(1<<f)*o},retryCount:i,shouldRetry:({error:f})=>kN(f)}),{enabled:s,id:u})}}function kN(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Ga.code||e.code===js.code:e instanceof Gs&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class CN extends ${constructor({callbackSelector:t,cause:r,data:n,extraData:s,sender:a,urls:o}){var i;super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],(i=r.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(c=>` ${Xo(c)}`)],` Sender: ${a}`,` Data: ${n}`,` Callback selector: ${t}`,` Extra data: ${s}`].flat(),name:"OffchainLookupError"})}}class TN extends ${constructor({result:t,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Xo(r)}`,`Response: ${mt(t)}`],name:"OffchainLookupResponseMalformedError"})}}class SN extends ${constructor({sender:t,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const AN="0x556f1830",g6={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function PN(e,{blockNumber:t,blockTag:r,data:n,to:s}){const{args:a}=Vb({data:n,abi:[g6]}),[o,i,c,l,u]=a,{ccipRead:d}=e,f=d&&typeof(d==null?void 0:d.request)=="function"?d.request:x6;try{if(!Ja(s,o))throw new SN({sender:o,to:s});const m=i.includes(Vi)?await l6({data:c,ccipRequest:f}):await f({data:c,sender:o,urls:i}),{data:y}=await Mi(e,{blockNumber:t,blockTag:r,data:cr([l,os([{type:"bytes"},{type:"bytes"}],[m,u])]),to:s});return y}catch(m){throw new CN({callbackSelector:l,cause:m,data:n,extraData:u,sender:o,urls:i})}}async function x6({data:e,sender:t,urls:r}){var s;let n=new Error("An unknown error occurred.");for(let a=0;a<r.length;a++){const o=r[a],i=o.includes("{data}")?"GET":"POST",c=i==="POST"?{data:e,sender:t}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(o.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:l,method:i});let d;if((s=u.headers.get("Content-Type"))!=null&&s.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){n=new Gs({body:c,details:d!=null&&d.error?mt(d.error):u.statusText,headers:u.headers,status:u.status,url:o});continue}if(!Or(d)){n=new TN({result:d,url:o});continue}return d}catch(u){n=new Gs({body:c,details:u.message,url:o})}}throw n}const IN=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:x6,offchainLookup:PN,offchainLookupAbiItem:g6,offchainLookupSignature:AN},Symbol.toStringTag,{value:"Module"}));function BN(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((s,a)=>{(async()=>{let o;try{const i=new AbortController;r>0&&(o=setTimeout(()=>{n&&i.abort()},r)),s(await e({signal:(i==null?void 0:i.signal)||null}))}catch(i){(i==null?void 0:i.name)==="AbortError"&&a(t),a(i)}finally{clearTimeout(o)}})()})}function FN(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const w6=FN();function UN(e,t={}){return{async request(r){var f;const{body:n,fetchFn:s=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:o=t.onResponse,timeout:i=t.timeout??1e4}=r,c={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:u,signal:d}=c;try{const m=await BN(async({signal:g})=>{const E={...c,body:Array.isArray(n)?mt(n.map(C=>({jsonrpc:"2.0",id:C.id??w6.take(),...C}))):mt({jsonrpc:"2.0",id:n.id??w6.take(),...n}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:d||(i>0?g:null)},w=new Request(e,E),v=await(a==null?void 0:a(w,E))??{...E,url:e};return await s(v.url??e,v)},{errorInstance:new Xb({body:n,url:e}),timeout:i,signal:!0});o&&await o(m);let y;if((f=m.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))y=await m.json();else{y=await m.text();try{y=JSON.parse(y||"{}")}catch(g){if(m.ok)throw g;y={error:y}}}if(!m.ok)throw new Gs({body:n,details:mt(y.error)||m.statusText,headers:m.headers,status:m.status,url:e});return y}catch(m){throw m instanceof Gs||m instanceof Xb?m:new Gs({body:n,cause:m,url:e})}}}}const ON=`Ethereum Signed Message:
108
- `;function DN(e){const t=typeof e=="string"?Sa(e):typeof e.raw=="string"?e.raw:wt(e.raw),r=Sa(`${ON}${lt(t)}`);return cr([r,t])}function v6(e,t){return Ut(DN(e),t)}class _N extends ${constructor({domain:t}){super(`Invalid domain "${mt(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class MN extends ${constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class NN extends ${constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function LN(e){const{domain:t,message:r,primaryType:n,types:s}=e,a=(c,l)=>{const u={...l};for(const d of c){const{name:f,type:m}=d;m==="address"&&(u[f]=u[f].toLowerCase())}return u},o=s.EIP712Domain?t?a(s.EIP712Domain,t):{}:{},i=(()=>{if(n!=="EIP712Domain")return a(s[n],r)})();return mt({domain:o,message:i,primaryType:n,types:s})}function E6(e){const{domain:t,message:r,primaryType:n,types:s}=e,a=(o,i)=>{for(const c of o){const{name:l,type:u}=c,d=i[l],f=u.match(Gb);if(f&&(typeof d=="number"||typeof d=="bigint")){const[g,E,w]=f;q(d,{signed:E==="int",size:Number.parseInt(w,10)/8})}if(u==="address"&&typeof d=="string"&&!rt(d))throw new Ct({address:d});const m=u.match(Q4);if(m){const[g,E]=m;if(E&&lt(d)!==Number.parseInt(E,10))throw new e4({expectedSize:Number.parseInt(E,10),givenSize:lt(d)})}const y=s[u];y&&(zN(u),a(y,d))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new _N({domain:t});a(s.EIP712Domain,t)}if(n!=="EIP712Domain")if(s[n])a(s[n],r);else throw new MN({primaryType:n,types:s})}function k6({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function zN(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new NN({type:e})}function RN(e){const{domain:t={},message:r,primaryType:n}=e,s={EIP712Domain:k6({domain:t}),...e.types};E6({domain:t,message:r,primaryType:n,types:s});const a=["0x1901"];return t&&a.push(HN({domain:t,types:s})),n!=="EIP712Domain"&&a.push(C6({data:r,primaryType:n,types:s})),Ut(cr(a))}function HN({domain:e,types:t}){return C6({data:e,primaryType:"EIP712Domain",types:t})}function C6({data:e,primaryType:t,types:r}){const n=T6({data:e,primaryType:t,types:r});return Ut(n)}function T6({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],s=[$N({primaryType:t,types:r})];for(const a of r[t]){const[o,i]=A6({types:r,name:a.name,type:a.type,value:e[a.name]});n.push(o),s.push(i)}return os(n,s)}function $N({primaryType:e,types:t}){const r=Fe(GN({primaryType:e,types:t}));return Ut(r)}function GN({primaryType:e,types:t}){let r="";const n=S6({primaryType:e,types:t});n.delete(e);const s=[e,...Array.from(n).sort()];for(const a of s)r+=`${a}(${t[a].map(({name:o,type:i})=>`${i} ${o}`).join(",")})`;return r}function S6({primaryType:e,types:t},r=new Set){const n=e.match(/^\w*/u),s=n==null?void 0:n[0];if(r.has(s)||t[s]===void 0)return r;r.add(s);for(const a of t[s])S6({primaryType:a.type,types:t},r);return r}function A6({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},Ut(T6({data:n,primaryType:r,types:e}))];if(r==="bytes")return[{type:"bytes32"},Ut(n)];if(r==="string")return[{type:"bytes32"},Ut(Fe(n))];if(r.lastIndexOf("]")===r.length-1){const s=r.slice(0,r.lastIndexOf("[")),a=n.map(o=>A6({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},Ut(os(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:r},n]}function jN(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function VN(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ir(e.nonce):void 0,storageProof:e.storageProof?jN(e.storageProof):void 0}}async function WN(e,{address:t,blockNumber:r,blockTag:n,storageKeys:s}){const a=n??"latest",o=r!==void 0?q(r):void 0,i=await e.request({method:"eth_getProof",params:[t,s,o||a]});return VN(i)}async function qN(e,{address:t,blockNumber:r,blockTag:n="latest",slot:s}){const a=r!==void 0?q(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||n]})}async function Yf(e,{blockHash:t,blockNumber:r,blockTag:n,hash:s,index:a,sender:o,nonce:i}){var f,m,y;const c=n||"latest",l=r!==void 0?q(r):void 0;let u=null;if(s?u=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,q(a)]},{dedupe:!0}):typeof a=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,q(a)]},{dedupe:!!l}):o&&typeof i=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[o,q(i)]},{dedupe:!0})),!u)throw new I1({blockHash:t,blockNumber:r,blockTag:c,hash:s,index:a});return(((y=(m=(f=e.chain)==null?void 0:f.formatters)==null?void 0:m.transaction)==null?void 0:y.format)||Ns)(u,"getTransaction")}async function YN(e,{hash:t,transactionReceipt:r}){const[n,s]=await Promise.all([ne(e,Gi,"getBlockNumber")({}),t?ne(e,Yf,"getTransaction")({hash:t}):void 0]),a=(r==null?void 0:r.blockNumber)||(s==null?void 0:s.blockNumber);return a?n-a+1n:0n}async function au(e,{hash:t}){var s,a,o;const r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new B1({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||zc)(r,"getTransactionReceipt")}async function KN(e,t){var v;const{account:r,authorizationList:n,allowFailure:s=!0,blockNumber:a,blockOverrides:o,blockTag:i,stateOverride:c}=t,l=t.contracts,{batchSize:u=t.batchSize??1024,deployless:d=t.deployless??!1}=typeof((v=e.batch)==null?void 0:v.multicall)=="object"?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Ma({blockNumber:a,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),m=[[]];let y=0,g=0;for(let S=0;S<l.length;S++){const{abi:C,address:D,args:L,functionName:T}=l[S];try{const h=fr({abi:C,args:L,functionName:T});g+=(h.length-2)/2,u>0&&g>u&&m[y].length>0&&(y++,g=(h.length-2)/2,m[y]=[]),m[y]=[...m[y],{allowFailure:!0,callData:h,target:D}]}catch(h){const b=Js(h,{abi:C,address:D,args:L,docsPath:"/docs/contract/multicall",functionName:T,sender:r});if(!s)throw b;m[y]=[...m[y],{allowFailure:!0,callData:"0x",target:D}]}}const E=await Promise.allSettled(m.map(S=>ne(e,zr,"readContract")({...f===null?{code:ff}:{address:f},abi:$l,account:r,args:[S],authorizationList:n,blockNumber:a,blockOverrides:o,blockTag:i,functionName:"aggregate3",stateOverride:c}))),w=[];for(let S=0;S<E.length;S++){const C=E[S];if(C.status==="rejected"){if(!s)throw C.reason;for(let L=0;L<m[S].length;L++)w.push({status:"failure",error:C.reason,result:void 0});continue}const D=C.value;for(let L=0;L<D.length;L++){const{returnData:T,success:h}=D[L],{callData:b}=m[S][L],{abi:x,address:A,functionName:I,args:F}=l[w.length];try{if(b==="0x")throw new qo;if(!h)throw new cl({data:T});const _=Qs({abi:x,args:F,data:T,functionName:I});w.push(s?{result:_,status:"success"}:_)}catch(_){const k=Js(_,{abi:x,address:A,args:F,docsPath:"/docs/contract/multicall",functionName:I});if(!s)throw k;w.push({error:k,result:void 0,status:"failure"})}}}if(w.length!==l.length)throw new $("multicall results mismatch");return w}async function Kf(e,t){const{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:a,traceTransfers:o,validation:i}=t;try{const c=[];for(const f of s){const m=f.blockOverrides?Tg(f.blockOverrides):void 0,y=f.calls.map(E=>{const w=E,v=w.account?Ke(w.account):void 0,S=w.abi?fr(w):w.data,C={...w,account:v,data:w.dataSuffix?cr([S||"0x",w.dataSuffix]):S,from:w.from??(v==null?void 0:v.address)};return rn(C),_r(C)}),g=f.stateOverrides?gf(f.stateOverrides):void 0;c.push({blockOverrides:m,calls:y,stateOverrides:g})}const u=(typeof r=="bigint"?q(r):void 0)||n;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:i},u]})).map((f,m)=>({...Bd(f),calls:f.calls.map((y,g)=>{var x,A;const{abi:E,args:w,functionName:v,to:S}=s[m].calls[g],C=((x=y.error)==null?void 0:x.data)??y.returnData,D=BigInt(y.gasUsed),L=(A=y.logs)==null?void 0:A.map(I=>Jr(I)),T=y.status==="0x1"?"success":"failure",h=E&&T==="success"&&C!=="0x"?Qs({abi:E,data:C,functionName:v}):null,b=(()=>{var F;if(T==="success")return;let I;if(((F=y.error)==null?void 0:F.data)==="0x"?I=new qo:y.error&&(I=new cl(y.error)),!!I)return Js(I,{abi:E??[],address:S??"0x",args:w,functionName:v??"<unknown>"})})();return{data:C,gasUsed:D,logs:L,status:T,...T==="success"?{result:h}:{error:b}}})}))}catch(c){const l=c,u=ll(l,{});throw u instanceof zo?l:u}}function Zf(e){let t=!0,r="",n=0,s="",a=!1;for(let o=0;o<e.length;o++){const i=e[o];if(["(",")",","].includes(i)&&(t=!0),i==="("&&n++,i===")"&&n--,!!t){if(n===0){if(i===" "&&["event","function","error",""].includes(s))s="";else if(s+=i,i===")"){a=!0;break}continue}if(i===" "){e[o-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=i,r+=i}}if(!a)throw new oe("Unable to normalize signature.");return s}function Xf(e,t){const r=typeof e,n=t.type;switch(n){case"address":return Ol(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>Xf(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>Xf(s,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function P6(e,t,r){for(const n in e){const s=e[n],a=t[n];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return P6(s.components,a.components,r[n]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Ol(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Ol(r[n],{strict:!1}):!1)return o}}function I6(e,t={}){const{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?Rb(e):e;return{...n,...r?{hash:to(n)}:{}}}function ou(e,t,r){const{args:n=[],prepare:s=!0}=r??{},a=Nr(t,{strict:!1}),o=e.filter(l=>a?l.type==="function"||l.type==="error"?B6(l)===Pe(t,0,4):l.type==="event"?to(l)===t:!1:"name"in l&&l.name===t);if(o.length===0)throw new iu({name:t});if(o.length===1)return{...o[0],...s?{hash:to(o[0])}:{}};let i;for(const l of o){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...s?{hash:to(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((d,f)=>{const m="inputs"in l&&l.inputs[f];return m?Xf(d,m):!1})){if(i&&"inputs"in i&&i.inputs){const d=P6(l.inputs,i.inputs,n);if(d)throw new XN({abiItem:l,type:d[0]},{abiItem:i,type:d[1]})}i=l}}const c=(()=>{if(i)return i;const[l,...u]=o;return{...l,overloads:u}})();if(!c)throw new iu({name:t});return{...c,...s?{hash:to(c)}:{}}}function B6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ou(r,n)}return e[0]})();return Pe(to(t),0,4)}function ZN(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,s]=e;return ou(n,s)}return e[0]})(),r=typeof t=="string"?t:al(t);return Zf(r)}function to(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ou(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Bi(Pi(ZN(t)))}class XN extends oe{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Zf(al(t.abiItem))}\`, and`,`\`${r.type}\` in \`${Zf(al(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class iu extends oe{constructor({name:t,data:r,type:n="item"}){const s=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function QN(...e){var a;const[t,r]=(()=>{if(Array.isArray(e[0])){const[o,i]=e;return[eL(o),i]}return e})(),{bytecode:n,args:s}=r;return pt(n,(a=t.inputs)!=null&&a.length&&(s!=null&&s.length)?lf(t.inputs,s):"0x")}function JN(e){return I6(e)}function eL(e){const t=e.find(r=>r.type==="constructor");if(!t)throw new iu({name:"constructor"});return t}function tL(...e){const[t,r=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,d]=e;return[F6(l,u,{args:d}),d]}const[i,c]=e;return[i,c]})(),{overloads:n}=t,s=n?F6([t,...n],t.name,{args:r}):t,a=rL(s),o=r.length>0?lf(s.inputs,r):void 0;return o?pt(a,o):a}function ro(e,t={}){return I6(e,t)}function F6(e,t,r){const n=ou(e,t,r);if(n.type!=="function")throw new iu({name:t,type:"function"});return n}function rL(e){return B6(e)}const nL="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",nn="0x0000000000000000000000000000000000000000",sL="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function aL(e,t){const{blockNumber:r,blockTag:n,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:i,validation:c}=t,l=t.account?Ke(t.account):void 0;if(o&&!l)throw new $("`account` is required when `traceAssetChanges` is true");const u=l?QN(JN("constructor(bytes, bytes)"),{bytecode:vg,args:[sL,tL(ro("function getBalance(address)"),[l.address])]}):void 0,d=o?await Promise.all(t.calls.map(async U=>{if(!U.data&&!U.abi)return;const{accessList:z}=await h6(e,{account:l.address,...U,data:U.abi?fr(U):U.data});return z.map(({address:H,storageKeys:G})=>G.length>0?H:null)})).then(U=>U.flat().filter(Boolean)):[],f=await Kf(e,{blockNumber:r,blockTag:n,blocks:[...o?[{calls:[{data:u}],stateOverrides:a},{calls:d.map((U,z)=>({abi:[ro("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]}]:[],{calls:[...s,{}].map(U=>({...U,from:l==null?void 0:l.address})),stateOverrides:a},...o?[{calls:[{data:u}]},{calls:d.map((U,z)=>({abi:[ro("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function decimals() returns (uint256)")],functionName:"decimals",from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function symbol() returns (string)")],functionName:"symbol",from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]}]:[]],traceTransfers:i,validation:c}),m=o?f[2]:f[0],[y,g,,E,w,v,S,C]=o?f:[],{calls:D,...L}=m,T=D.slice(0,-1)??[],h=(y==null?void 0:y.calls)??[],b=(g==null?void 0:g.calls)??[],x=[...h,...b].map(U=>U.status==="success"?Le(U.data):null),A=(E==null?void 0:E.calls)??[],I=(w==null?void 0:w.calls)??[],F=[...A,...I].map(U=>U.status==="success"?Le(U.data):null),_=((v==null?void 0:v.calls)??[]).map(U=>U.status==="success"?U.result:null),k=((C==null?void 0:C.calls)??[]).map(U=>U.status==="success"?U.result:null),P=((S==null?void 0:S.calls)??[]).map(U=>U.status==="success"?U.result:null),O=[];for(const[U,z]of F.entries()){const H=x[U];if(typeof z!="bigint"||typeof H!="bigint")continue;const G=_[U-1],J=k[U-1],pe=P[U-1],he=U===0?{address:nL,decimals:18,symbol:"ETH"}:{address:d[U-1],decimals:pe||G?Number(G??1):void 0,symbol:J??void 0};O.some(ie=>ie.token.address===he.address)||O.push({token:he,value:{pre:H,post:z,diff:z-H}})}return{assetChanges:O,block:L,results:T}}async function oL(e,{address:t,message:r,factory:n,factoryData:s,signature:a,...o}){const i=v6(r);return ne(e,Ni,"verifyHash")({address:t,factory:n,factoryData:s,hash:i,signature:a,...o})}async function iL(e,t){const{address:r,factory:n,factoryData:s,signature:a,message:o,primaryType:i,types:c,domain:l,...u}=t,d=RN({message:o,primaryType:i,types:c,domain:l});return ne(e,Ni,"verifyHash")({address:r,factory:n,factoryData:s,hash:d,signature:a,...u})}function U6(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:s,poll:a,pollingInterval:o=e.pollingInterval}){const i=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let c;return i?(()=>{const d=mt(["watchBlockNumber",e.uid,t,r,o]);return Un(d,{onBlockNumber:n,onError:s},f=>eo(async()=>{var m;try{const y=await ne(e,Gi,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(y===c)return;if(y-c>1&&r)for(let g=c+1n;g<y;g++)f.onBlockNumber(g,c),c=g}(c===void 0||y>c)&&(f.onBlockNumber(y,c),c=y)}catch(y){(m=f.onError)==null||m.call(f,y)}},{emitOnBegin:t,interval:o}))})():(()=>{const d=mt(["watchBlockNumber",e.uid,t,r]);return Un(d,{onBlockNumber:n,onError:s},f=>{let m=!0,y=()=>m=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(v=>v.config.type==="webSocket"||v.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:E}=await g.subscribe({params:["newHeads"],onData(w){var S;if(!m)return;const v=Le((S=w.result)==null?void 0:S.number);f.onBlockNumber(v,c),c=v},onError(w){var v;(v=f.onError)==null||v.call(f,w)}});y=E,m||y()}catch(g){s==null||s(g)}})(),()=>y()})})()}async function O6(e,t){const{checkReplacement:r=!0,confirmations:n=1,hash:s,onReplaced:a,retryCount:o=6,retryDelay:i=({count:D})=>~~(1<<D)*200,timeout:c=18e4}=t,l=mt(["waitForTransactionReceipt",e.uid,s]),u=(()=>{var D;return t.pollingInterval?t.pollingInterval:(D=e.chain)!=null&&D.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,f,m,y=!1,g,E;const{promise:w,resolve:v,reject:S}=bf(),C=c?setTimeout(()=>{E==null||E(),g==null||g(),S(new b8({hash:s}))},c):void 0;return g=Un(l,{onReplaced:a,resolve:v,reject:S},async D=>{if(m=await ne(e,au,"getTransactionReceipt")({hash:s}).catch(()=>{}),m&&n<=1){clearTimeout(C),D.resolve(m),g==null||g();return}E=ne(e,U6,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(L){const T=b=>{clearTimeout(C),E==null||E(),b(),g==null||g()};let h=L;if(!y)try{if(m){if(n>1&&(!m.blockNumber||h-m.blockNumber+1n<n))return;T(()=>D.resolve(m));return}if(r&&!d&&(y=!0,await tu(async()=>{d=await ne(e,Yf,"getTransaction")({hash:s}),d.blockNumber&&(h=d.blockNumber)},{delay:i,retryCount:o}),y=!1),m=await ne(e,au,"getTransactionReceipt")({hash:s}),n>1&&(!m.blockNumber||h-m.blockNumber+1n<n))return;T(()=>D.resolve(m))}catch(b){if(b instanceof I1||b instanceof B1){if(!d){y=!1;return}try{f=d,y=!0;const x=await tu(()=>ne(e,Rr,"getBlock")({blockNumber:h,includeTransactions:!0}),{delay:i,retryCount:o,shouldRetry:({error:F})=>F instanceof Kg});y=!1;const A=x.transactions.find(({from:F,nonce:_})=>F===f.from&&_===f.nonce);if(!A||(m=await ne(e,au,"getTransactionReceipt")({hash:A.hash}),n>1&&(!m.blockNumber||h-m.blockNumber+1n<n)))return;let I="replaced";A.to===f.to&&A.value===f.value&&A.input===f.input?I="repriced":A.from===A.to&&A.value===0n&&(I="cancelled"),T(()=>{var F;(F=D.onReplaced)==null||F.call(D,{reason:I,replacedTransaction:f,transaction:A,transactionReceipt:m}),D.resolve(m)})}catch(x){T(()=>D.reject(x))}}else T(()=>D.reject(b))}}})}),w}function cL(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:s,onError:a,includeTransactions:o,poll:i,pollingInterval:c=e.pollingInterval}){const l=typeof i<"u"?i:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=o??!1;let d;return l?(()=>{const y=mt(["watchBlocks",e.uid,t,r,n,u,c]);return Un(y,{onBlock:s,onError:a},g=>eo(async()=>{var E;try{const w=await ne(e,Rr,"getBlock")({blockTag:t,includeTransactions:u});if(w.number!==null&&(d==null?void 0:d.number)!=null){if(w.number===d.number)return;if(w.number-d.number>1&&r)for(let v=(d==null?void 0:d.number)+1n;v<w.number;v++){const S=await ne(e,Rr,"getBlock")({blockNumber:v,includeTransactions:u});g.onBlock(S,d),d=S}}((d==null?void 0:d.number)==null||t==="pending"&&(w==null?void 0:w.number)==null||w.number!==null&&w.number>d.number)&&(g.onBlock(w,d),d=w)}catch(w){(E=g.onError)==null||E.call(g,w)}},{emitOnBegin:n,interval:c}))})():(()=>{let y=!0,g=!0,E=()=>y=!1;return(async()=>{try{n&&ne(e,Rr,"getBlock")({blockTag:t,includeTransactions:u}).then(S=>{y&&g&&(s(S,void 0),g=!1)}).catch(a);const w=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:v}=await w.subscribe({params:["newHeads"],async onData(S){var D;if(!y)return;const C=await ne(e,Rr,"getBlock")({blockNumber:(D=S.result)==null?void 0:D.number,includeTransactions:u}).catch(()=>{});y&&(s(C,d),g=!1,d=C)},onError(S){a==null||a(S)}});E=v,y||E()}catch(w){a==null||a(w)}})(),()=>E()})()}function lL(e,{address:t,args:r,batch:n=!0,event:s,events:a,fromBlock:o,onError:i,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){const f=typeof l<"u"?l:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),m=d??!1;return f?(()=>{const E=mt(["watchEvent",t,r,n,e.uid,s,u,o]);return Un(E,{onLogs:c,onError:i},w=>{let v;o!==void 0&&(v=o-1n);let S,C=!1;const D=eo(async()=>{var L;if(!C){try{S=await ne(e,b6,"createEventFilter")({address:t,args:r,event:s,events:a,strict:m,fromBlock:o})}catch{}C=!0;return}try{let T;if(S)T=await ne(e,Ql,"getFilterChanges")({filter:S});else{const h=await ne(e,Gi,"getBlockNumber")({});v&&v!==h?T=await ne(e,_f,"getLogs")({address:t,args:r,event:s,events:a,fromBlock:v+1n,toBlock:h}):T=[],v=h}if(T.length===0)return;if(n)w.onLogs(T);else for(const h of T)w.onLogs([h])}catch(T){S&&T instanceof is&&(C=!1),(L=w.onError)==null||L.call(w,T)}},{emitOnBegin:!0,interval:u});return async()=>{S&&await ne(e,Jl,"uninstallFilter")({filter:S}),D()}})})():(()=>{let E=!0,w=()=>E=!1;return(async()=>{try{const v=(()=>{if(e.transport.type==="fallback"){const L=e.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return L?L.value:e.transport}return e.transport})(),S=a??(s?[s]:void 0);let C=[];S&&(C=[S.flatMap(T=>Hi({abi:[T],eventName:T.name,args:r}))],s&&(C=C[0]));const{unsubscribe:D}=await v.subscribe({params:["logs",{address:t,topics:C}],onData(L){var h;if(!E)return;const T=L.result;try{const{eventName:b,args:x}=Xl({abi:S??[],data:T.data,topics:T.topics,strict:m}),A=Jr(T,{args:x,eventName:b});c([A])}catch(b){let x,A;if(b instanceof sl||b instanceof up){if(d)return;x=b.abiItem.name,A=(h=b.abiItem.inputs)==null?void 0:h.some(F=>!("name"in F&&F.name))}const I=Jr(T,{args:A?[]:{},eventName:x});c([I])}},onError(L){i==null||i(L)}});w=D,E||w()}catch(v){i==null||i(v)}})(),()=>w()})()}function uL(e,{batch:t=!0,onError:r,onTransactions:n,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=mt(["watchPendingTransactions",e.uid,t,a]);return Un(l,{onTransactions:n,onError:r},u=>{let d;const f=eo(async()=>{var m;try{if(!d)try{d=await ne(e,y6,"createPendingTransactionFilter")({});return}catch(g){throw f(),g}const y=await ne(e,Ql,"getFilterChanges")({filter:d});if(y.length===0)return;if(t)u.onTransactions(y);else for(const g of y)u.onTransactions([g])}catch(y){(m=u.onError)==null||m.call(u,y)}},{emitOnBegin:!0,interval:a});return async()=>{d&&await ne(e,Jl,"uninstallFilter")({filter:d}),f()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!l)return;const m=f.result;n([m])},onError(f){r==null||r(f)}});u=d,l||u()}catch(d){r==null||r(d)}})(),()=>u()})()}function dL(e){var d,f,m;const{scheme:t,statement:r,...n}=((d=e.match(pL))==null?void 0:d.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:i,requestId:c,...l}=((f=e.match(fL))==null?void 0:f.groups)??{},u=(m=e.split("Resources:")[1])==null?void 0:m.split(`
109
- - `).slice(1);return{...n,...l,...s?{chainId:Number(s)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}const pL=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,fL=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function mL(e){const{address:t,domain:r,message:n,nonce:s,scheme:a,time:o=new Date}=e;if(r&&n.domain!==r||s&&n.nonce!==s||a&&n.scheme!==a||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||!rt(n.address,{strict:!1})||t&&!Ja(n.address,t))return!1}catch{return!1}return!0}async function hL(e,t){const{address:r,domain:n,message:s,nonce:a,scheme:o,signature:i,time:c=new Date,...l}=t,u=dL(s);if(!u.address||!mL({address:r,domain:n,message:u,nonce:a,scheme:o,time:c}))return!1;const f=v6(s);return Ni(e,{address:u.address,hash:f,signature:i,...l})}async function Qf(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:n}){var i,c,l;const s=await e.request({method:"eth_sendRawTransactionSync",params:n?[t,q(n)]:[t]},{retryCount:0}),o=(((l=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||zc)(s);if(o.status==="reverted"&&r)throw new F1({receipt:o});return o}function bL(e){return{call:t=>Mi(e,t),createAccessList:t=>h6(e,t),createBlockFilter:()=>dN(e),createContractEventFilter:t=>qg(e,t),createEventFilter:t=>b6(e,t),createPendingTransactionFilter:()=>y6(e),estimateContractGas:t=>FM(e,t),estimateGas:t=>Of(e,t),getBalance:t=>pN(e,t),getBlobBaseFee:()=>fN(e),getBlock:t=>Rr(e,t),getBlockNumber:t=>Gi(e,t),getBlockTransactionCount:t=>mN(e,t),getBytecode:t=>Hl(e,t),getChainId:()=>ls(e),getCode:t=>Hl(e,t),getContractEvents:t=>Jg(e,t),getEip712Domain:t=>bN(e,t),getEnsAddress:t=>KM(e,t),getEnsAvatar:t=>cN(e,t),getEnsName:t=>lN(e,t),getEnsResolver:t=>uN(e,t),getEnsText:t=>m6(e,t),getFeeHistory:t=>xN(e,t),estimateFeesPerGas:t=>BM(e,t),getFilterChanges:t=>Ql(e,t),getFilterLogs:t=>wN(e,t),getGasPrice:()=>Af(e),getLogs:t=>_f(e,t),getProof:t=>WN(e,t),estimateMaxPriorityFeePerGas:t=>IM(e,t),fillTransaction:t=>Bf(e,t),getStorageAt:t=>qN(e,t),getTransaction:t=>Yf(e,t),getTransactionConfirmations:t=>YN(e,t),getTransactionCount:t=>If(e,t),getTransactionReceipt:t=>au(e,t),multicall:t=>KN(e,t),prepareTransactionRequest:t=>$i(e,t),readContract:t=>zr(e,t),sendRawTransaction:t=>Lf(e,t),sendRawTransactionSync:t=>Qf(e,t),simulate:t=>Kf(e,t),simulateBlocks:t=>Kf(e,t),simulateCalls:t=>aL(e,t),simulateContract:t=>DM(e,t),verifyHash:t=>Ni(e,t),verifyMessage:t=>oL(e,t),verifySiweMessage:t=>hL(e,t),verifyTypedData:t=>iL(e,t),uninstallFilter:t=>Jl(e,t),waitForTransactionReceipt:t=>O6(e,t),watchBlocks:t=>cL(e,t),watchBlockNumber:t=>U6(e,t),watchContractEvent:t=>HM(e,t),watchEvent:t=>lL(e,t),watchPendingTransactions:t=>uL(e,t)}}function yL(e){const{key:t="public",name:r="Public Client"}=e;return i6({...e,key:t,name:r,type:"publicClient"}).extend(bL)}async function gL(e,{chain:t}){const{id:r,name:n,nativeCurrency:s,rpcUrls:a,blockExplorers:o}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:q(r),chainName:n,nativeCurrency:s,rpcUrls:a.default.http,blockExplorerUrls:o?Object.values(o).map(({url:i})=>i):void 0}]},{dedupe:!0,retryCount:0})}function xL(e,t){const{abi:r,args:n,bytecode:s,...a}=t,o=Gl({abi:r,args:n,bytecode:s});return eu(e,{...a,...a.authorizationList?{to:null}:{},data:o})}async function wL(e){var r;return((r=e.account)==null?void 0:r.type)==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ho(n))}async function vL(e,t={}){const{account:r=e.account,chainId:n}=t,s=r?Ke(r):void 0,a=n?[s==null?void 0:s.address,[q(n)]]:[s==null?void 0:s.address],o=await e.request({method:"wallet_getCapabilities",params:a}),i={};for(const[c,l]of Object.entries(o)){i[Number(c)]={};for(let[u,d]of Object.entries(l))u==="addSubAccount"&&(u="unstable_addSubAccount"),i[Number(c)][u]=d}return typeof n=="number"?i[n]:i}async function EL(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function D6(e,t){var c;const{account:r=e.account,chainId:n,nonce:s}=t;if(!r)throw new kn({docsPath:"/docs/eip7702/prepareAuthorization"});const a=Ke(r),o=(()=>{if(t.executor)return t.executor==="self"?t.executor:Ke(t.executor)})(),i={address:t.contractAddress??t.address,chainId:n,nonce:s};return typeof i.chainId>"u"&&(i.chainId=((c=e.chain)==null?void 0:c.id)??await ne(e,ls,"getChainId")({})),typeof i.nonce>"u"&&(i.nonce=await ne(e,If,"getTransactionCount")({address:a.address,blockTag:"pending"}),(o==="self"||o!=null&&o.address&&Ja(o.address,a.address))&&(i.nonce+=1)),i}async function kL(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>ep(r))}async function CL(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function TL(e,t){const{chain:r=e.chain}=t,n=t.timeout??Math.max(((r==null?void 0:r.blockTime)??0)*3,5e3),s=await n6(e,t);return await a6(e,{...t,id:s.id,timeout:n})}const Jf=new Da(128);async function _6(e,t){var D,L,T,h;const{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:a,blobs:o,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,pollingInterval:y,throwOnReceiptRevert:g,type:E,value:w,...v}=t,S=t.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof r>"u")throw new kn({docsPath:"/docs/actions/wallet/sendTransactionSync"});const C=r?Ke(r):null;try{rn(t);const b=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await jl({authorization:a[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let x;n!==null&&(x=await ne(e,ls,"getChainId")({}),lp({currentChainId:x,chain:n}));const A=(T=(L=(D=e.chain)==null?void 0:D.formatters)==null?void 0:L.transactionRequest)==null?void 0:T.format,F=(A||_r)({...Ws(v,{format:A}),accessList:s,account:C,authorizationList:a,blobs:o,chainId:x,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,to:b,type:E,value:w},"sendTransaction"),_=Jf.get(e.uid),k=_?"wallet_sendTransaction":"eth_sendTransaction",P=await(async()=>{try{return await e.request({method:k,params:[F]},{retryCount:0})}catch(U){if(_===!1)throw U;const z=U;if(z.name==="InvalidInputRpcError"||z.name==="InvalidParamsRpcError"||z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(H=>(Jf.set(e.uid,!0),H)).catch(H=>{const G=H;throw G.name==="MethodNotFoundRpcError"||G.name==="MethodNotSupportedRpcError"?(Jf.set(e.uid,!1),z):G});throw z}})(),O=await ne(e,O6,"waitForTransactionReceipt")({checkReplacement:!1,hash:P,pollingInterval:y,timeout:S});if(g&&O.status==="reverted")throw new F1({receipt:O});return O}if((C==null?void 0:C.type)==="local"){const x=await ne(e,$i,"prepareTransactionRequest")({account:C,accessList:s,authorizationList:a,blobs:o,chain:n,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,nonceManager:C.nonceManager,parameters:[...Ff,"sidecars"],type:E,value:w,...v,to:b}),A=(h=n==null?void 0:n.serializers)==null?void 0:h.transaction,I=await C.signTransaction(x,{serializer:A});return await ne(e,Qf,"sendRawTransactionSync")({serializedTransaction:I,throwOnReceiptRevert:g})}throw(C==null?void 0:C.type)==="smart"?new Hs({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Hs({docsPath:"/docs/actions/wallet/sendTransactionSync",type:C==null?void 0:C.type})}catch(b){throw b instanceof Hs?b:Zl(b,{...t,account:C,chain:t.chain||void 0})}}async function SL(e,t){const{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function AL(e,t){const{account:r=e.account}=t;if(!r)throw new kn({docsPath:"/docs/eip7702/signAuthorization"});const n=Ke(r);if(!n.signAuthorization)throw new Hs({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const s=await D6(e,t);return n.signAuthorization(s)}async function PL(e,{account:t=e.account,message:r}){if(!t)throw new kn({docsPath:"/docs/actions/wallet/signMessage"});const n=Ke(t);if(n.signMessage)return n.signMessage({message:r});const s=typeof r=="string"?Sa(r):r.raw instanceof Uint8Array?Fe(r.raw):r.raw;return e.request({method:"personal_sign",params:[s,n.address]},{retryCount:0})}async function IL(e,t){var l,u,d,f;const{account:r=e.account,chain:n=e.chain,...s}=t;if(!r)throw new kn({docsPath:"/docs/actions/wallet/signTransaction"});const a=Ke(r);rn({account:a,...t});const o=await ne(e,ls,"getChainId")({});n!==null&&lp({currentChainId:o,chain:n});const i=(n==null?void 0:n.formatters)||((l=e.chain)==null?void 0:l.formatters),c=((u=i==null?void 0:i.transactionRequest)==null?void 0:u.format)||_r;return a.signTransaction?a.signTransaction({...s,chainId:o},{serializer:(f=(d=e.chain)==null?void 0:d.serializers)==null?void 0:f.transaction}):await e.request({method:"eth_signTransaction",params:[{...c({...s,account:a},"signTransaction"),chainId:q(o),from:a.address}]},{retryCount:0})}async function BL(e,t){const{account:r=e.account,domain:n,message:s,primaryType:a}=t;if(!r)throw new kn({docsPath:"/docs/actions/wallet/signTypedData"});const o=Ke(r),i={EIP712Domain:k6({domain:n}),...t.types};if(E6({domain:n,message:s,primaryType:a,types:i}),o.signTypedData)return o.signTypedData({domain:n,message:s,primaryType:a,types:i});const c=LN({domain:n,message:s,primaryType:a,types:i});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function FL(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:q(t)}]},{retryCount:0})}async function UL(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}async function OL(e,t){return ji.internal(e,_6,"sendTransactionSync",t)}function DL(e){return{addChain:t=>gL(e,t),deployContract:t=>xL(e,t),fillTransaction:t=>Bf(e,t),getAddresses:()=>wL(e),getCallsStatus:t=>s6(e,t),getCapabilities:t=>vL(e,t),getChainId:()=>ls(e),getPermissions:()=>EL(e),prepareAuthorization:t=>D6(e,t),prepareTransactionRequest:t=>$i(e,t),requestAddresses:()=>kL(e),requestPermissions:t=>CL(e,t),sendCalls:t=>n6(e,t),sendCallsSync:t=>TL(e,t),sendRawTransaction:t=>Lf(e,t),sendRawTransactionSync:t=>Qf(e,t),sendTransaction:t=>eu(e,t),sendTransactionSync:t=>_6(e,t),showCallsStatus:t=>SL(e,t),signAuthorization:t=>AL(e,t),signMessage:t=>PL(e,t),signTransaction:t=>IL(e,t),signTypedData:t=>BL(e,t),switchChain:t=>FL(e,t),waitForCallsStatus:t=>a6(e,t),watchAsset:t=>UL(e,t),writeContract:t=>ji(e,t),writeContractSync:t=>OL(e,t)}}function _L(e){const{key:t="wallet",name:r="Wallet Client",transport:n}=e;return i6({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(DL)}function M6({key:e,methods:t,name:r,request:n,retryCount:s=3,retryDelay:a=150,timeout:o,type:i},c){const l=o6();return{config:{key:e,methods:t,name:r,request:n,retryCount:s,retryDelay:a,timeout:o,type:i},request:EN(n,{methods:t,retryCount:s,retryDelay:a,uid:l}),value:c}}function ML(e,t={}){const{key:r="custom",methods:n,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>M6({key:r,methods:n,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class NL extends ${constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function LL(e,t={}){const{batch:r,fetchFn:n,fetchOptions:s,key:a="http",methods:o,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=t;return({chain:f,retryCount:m,timeout:y})=>{const{batchSize:g=1e3,wait:E=0}=typeof r=="object"?r:{},w=t.retryCount??m,v=y??t.timeout??1e4,S=f==null?void 0:f.rpcUrls.default.http[0];if(!S)throw new NL;const C=UN(S,{fetchFn:n,fetchOptions:s,onRequest:c,onResponse:l,timeout:v});return M6({key:a,methods:o,name:i,async request({method:D,params:L}){const T={method:D,params:L},{schedule:h}=Sg({id:S,wait:E,shouldSplitBatch(I){return I.length>g},fn:I=>C.request({body:I}),sort:(I,F)=>I.id-F.id}),b=async I=>r?h(I):[await C.request({body:I})],[{error:x,result:A}]=await b(T);if(d)return{error:x,result:A};if(x)throw new Ep({body:T,error:x,url:S});return A},retryCount:w,retryDelay:u,timeout:v,type:"http"},{fetchOptions:s,url:S})}}function zL(e){const{r:t,s:r}=Fi.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[s,a]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof s<"u"?{r:q(t,{size:32}),s:q(r,{size:32}),v:s,yParity:a}:{r:q(t,{size:32}),s:q(r,{size:32}),yParity:a}}const RL=(e,t)=>{const r=Object.values(CM).find(o=>o.id===e);if(!r)return{walletClient:void 0,publicClient:void 0};const n=t?ML(t):void 0,s=n?_L({chain:r,transport:n}):void 0,a=yL({chain:r,transport:n||LL()});return{walletClient:s,publicClient:a}},HL=()=>B.jsx("div",{className:"twap-error-fallback",children:B.jsx("p",{style:{fontSize:20,fontWeight:600,textAlign:"center",width:"100%",marginTop:40},children:"Something went wrong"})});function $L({children:e}){return B.jsx(h3,{FallbackComponent:HL,onError:t=>ct.onCrash(t),children:B.jsx(B.Fragment,{children:e})})}const e0=M.createContext({}),GL=new e3({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),jL=e=>{var n,s,a;const t=Z(o=>o.updateState),r=Z(o=>o.state.isMarketOrder);return M.useEffect(()=>{setInterval(()=>{t({currentTime:Date.now()})},6e4)},[t]),M.useEffect(()=>{var o,i,c,l,u,d,f,m,y,g,E,w;t({isMarketOrder:e.module!==Ee.LIMIT?!1:(i=(o=e.overrides)==null?void 0:o.state)==null?void 0:i.isMarketOrder,typedChunks:(l=(c=e.overrides)==null?void 0:c.state)==null?void 0:l.chunks,typedFillDelay:(d=(u=e.overrides)==null?void 0:u.state)==null?void 0:d.fillDelay,typedDuration:(m=(f=e.overrides)==null?void 0:f.state)==null?void 0:m.duration,typedLimitPrice:(g=(y=e.overrides)==null?void 0:y.state)==null?void 0:g.limitPrice,typedTriggerPrice:(w=(E=e.overrides)==null?void 0:E.state)==null?void 0:w.triggerPrice,triggerPricePercent:void 0,limitPricePercent:void 0})},[(n=e.overrides)==null?void 0:n.state,e.module]),M.useEffect(()=>{var o,i,c,l;t({typedLimitPrice:(i=(o=e.overrides)==null?void 0:o.state)==null?void 0:i.limitPrice,typedTriggerPrice:(l=(c=e.overrides)==null?void 0:c.state)==null?void 0:l.triggerPrice,triggerPricePercent:void 0,limitPricePercent:void 0})},[(s=e.srcToken)==null?void 0:s.address,(a=e.dstToken)==null?void 0:a.address]),M.useEffect(()=>{e.module===Ee.LIMIT&&t({isMarketOrder:!1})},[e.module]),M.useEffect(()=>{r&&t({isInvertedTrade:!1})},[r]),null},VL=({marketReferencePrice:e,srcToken:t,dstToken:r,chainId:n})=>{const s=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{if(Pd(t,r,n)||Id(t,r,n))return{isLoading:!1,noLiquidity:!1,value:Ac((t==null?void 0:t.decimals)||18,s||"0")};if(j(e.value||0).isZero()||j(s||0).isZero())return e;const a=j(e.value||0).dividedBy(s||0).toFixed();return{...e,value:a}},[e,s,t,r,n])},WL=e=>{const t=Fo(Bc.MIN_CHUNK_SIZE_USD);return t?parseInt(t):e},qL=e=>{const t=Z(c=>c.state.acceptedMarketPrice),{walletClient:r,publicClient:n}=M.useMemo(()=>RL(e.chainId,e.provider),[e.chainId,e.provider]),s=M.useMemo(()=>ld(e.chainId,e.partner),[e.chainId,e.partner]),a=VL(e),o=M.useMemo(()=>WL(e.minChunkSizeUsd),[e.minChunkSizeUsd]);M.useEffect(()=>{ct.onLoad(),s&&e.chainId&&ct.init(s,o,e.chainId)},[s,e.chainId,o]);const i=M.useMemo(()=>s?Rm(s.partner):[],[s]);return B.jsxs(e0.Provider,{value:{...e,minChunkSizeUsd:o,account:e.account,walletClient:r,publicClient:n,marketPrice:t||a.value,marketPriceLoading:!t&&a.isLoading,noLiquidity:!t&&a.noLiquidity,config:s,slippage:e.priceProtection,supportedChains:i},children:[B.jsx(jL,{...e}),B.jsx($L,{children:e.children})]})},YL=e=>B.jsx(t3,{client:GL,children:B.jsx(qL,{...e})}),se=()=>{if(!e0)throw new Error("useSpotContext must be used within a WidgetProvider");return M.useContext(e0)},KL=2e4,ZL=[{text:"Minutes",value:Gt.Minutes},{text:"Hours",value:Gt.Hours},{text:"Days",value:Gt.Days}],XL="The protocol uses an oracle price to help protect users from unfavorable executions. If the execution price is worse than the oracle price by more than the allowed percentage, the transaction will not be executed.";var t0={},QL=[{id:"fa",name:"Font Awesome",projectUrl:"https://fontawesome.com/",license:"CC BY 4.0 License",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"io",name:"Ionicons 4",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"io5",name:"Ionicons 5",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"md",name:"Material Design icons",projectUrl:"http://google.github.io/material-design-icons/",license:"Apache License Version 2.0",licenseUrl:"https://github.com/google/material-design-icons/blob/master/LICENSE"},{id:"ti",name:"Typicons",projectUrl:"http://s-ings.com/typicons/",license:"CC BY-SA 3.0",licenseUrl:"https://creativecommons.org/licenses/by-sa/3.0/"},{id:"go",name:"Github Octicons icons",projectUrl:"https://octicons.github.com/",license:"MIT",licenseUrl:"https://github.com/primer/octicons/blob/master/LICENSE"},{id:"fi",name:"Feather",projectUrl:"https://feathericons.com/",license:"MIT",licenseUrl:"https://github.com/feathericons/feather/blob/master/LICENSE"},{id:"gi",name:"Game Icons",projectUrl:"https://game-icons.net/",license:"CC BY 3.0",licenseUrl:"https://creativecommons.org/licenses/by/3.0/"},{id:"wi",name:"Weather Icons",projectUrl:"https://erikflowers.github.io/weather-icons/",license:"SIL OFL 1.1",licenseUrl:"http://scripts.sil.org/OFL"},{id:"di",name:"Devicons",projectUrl:"https://vorillaz.github.io/devicons/",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ai",name:"Ant Design Icons",projectUrl:"https://github.com/ant-design/ant-design-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"bs",name:"Bootstrap Icons",projectUrl:"https://github.com/twbs/icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ri",name:"Remix Icon",projectUrl:"https://github.com/Remix-Design/RemixIcon",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"fc",name:"Flat Color Icons",projectUrl:"https://github.com/icons8/flat-color-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"gr",name:"Grommet-Icons",projectUrl:"https://github.com/grommet/grommet-icons",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"hi",name:"Heroicons",projectUrl:"https://github.com/refactoringui/heroicons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"si",name:"Simple Icons",projectUrl:"https://simpleicons.org/",license:"CC0 1.0 Universal",licenseUrl:"https://creativecommons.org/publicdomain/zero/1.0/"},{id:"im",name:"IcoMoon Free",projectUrl:"https://github.com/Keyamoon/IcoMoon-Free",license:"CC BY 4.0 License"},{id:"bi",name:"BoxIcons",projectUrl:"https://github.com/atisawd/boxicons",license:"CC BY 4.0 License"},{id:"cg",name:"css.gg",projectUrl:"https://github.com/astrit/css.gg",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"vsc",name:"VS Code Icons",projectUrl:"https://github.com/microsoft/vscode-codicons",license:"CC BY 4.0",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"}],r0={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},n0=M.createContext&&M.createContext(r0),us=function(){return us=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},us.apply(this,arguments)},JL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};function N6(e){return e&&e.map(function(t,r){return M.createElement(t.tag,us({key:r},t.attr),N6(t.child))})}function ez(e){return function(t){return M.createElement(L6,us({attr:us({},e.attr)},t),N6(e.child))}}function L6(e){var t=function(r){var n=e.attr,s=e.size,a=e.title,o=JL(e,["attr","size","title"]),i=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),M.createElement("svg",us({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:c,style:us(us({color:e.color||r.color},r.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),a&&M.createElement("title",null,a),e.children)};return n0!==void 0?M.createElement(n0.Consumer,null,function(r){return t(r)}):t(r0)}const cu=tw(Object.freeze(Object.defineProperty({__proto__:null,DefaultContext:r0,GenIcon:ez,IconBase:L6,IconContext:n0,IconsManifest:QL},Symbol.toStringTag,{value:"Module"})));var z6;function tz(){if(z6)return t0;z6=1;var e=cu.GenIcon;return t0.IoIosArrowDown=function(r){return e({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"}}]})(r)},t0}var rz=tz(),s0={},R6;function nz(){if(R6)return s0;R6=1;var e=cu.GenIcon;return s0.AiOutlineCopy=function(r){return e({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]})(r)},s0}var sz=nz();//! moment.js
106
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class fO extends oe{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class df extends oe{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}const ig="0x6492649264926492649264926492649264926492649264926492649264926492";function mO(e){if(Pe(e,-32)!==ig)throw new yO(e)}function hO(e){const{data:t,signature:r,to:n}=e;return pt(lf(sg("address, bytes, bytes"),[n,t,r]),ig)}function bO(e){try{return mO(e),!0}catch{return!1}}let yO=class extends oe{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};function gO(e){return xO(e,"Hex")}function xO(e,t){const r=t,n=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new gF(e);return cs(e)}return e})(),s=cf(n,{recursiveReadLimit:Number.POSITIVE_INFINITY});return cg(s,r)}function cg(e,t="Hex"){if(e.bytes.length===0)return t==="Hex"?Pt(e.bytes):e.bytes;const r=e.readByte();if(r<128&&e.decrementPosition(1),r<192){const s=lg(e,r,128),a=e.readBytes(s);return t==="Hex"?Pt(a):a}const n=lg(e,r,192);return wO(e,n,t)}function lg(e,t,r){if(r===128&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new oe("Invalid RLP prefix")}function wO(e,t,r){const n=e.position,s=[];for(;e.position-n<t;)s.push(cg(e,r));return s}function vO(e,t){const{as:r}=t,n=ug(e),s=cf(new Uint8Array(n.length));return n.encode(s),r==="Hex"?Pt(s.bytes):s.bytes}function EO(e,t={}){const{as:r="Hex"}=t;return vO(e,{as:r})}function ug(e){return Array.isArray(e)?kO(e.map(t=>ug(t))):CO(e)}function kO(e){const t=e.reduce((s,a)=>s+a.length,0),r=dg(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function CO(e){const t=typeof e=="string"?cs(e):e,r=dg(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function dg(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new oe("Length is too large.")}function TO(e,t={}){return typeof e.chainId=="string"?pg(e):{...e,...t.signature}}function pg(e){const{address:t,chainId:r,nonce:n}=e,s=Jy(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...s}}function SO(e){return e.map(pg)}function AO(e){const{address:t,chainId:r,nonce:n,...s}=e;return{address:t,chainId:X(r),nonce:X(n),...eg(s)}}function PO(e){return e.map(AO)}const IO="0x8010801080108010801080108010801080108010801080108010801080108010",BO=sg("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function fg(e){if(typeof e=="string"){if(Pe(e,-32)!==IO)throw new OO(e)}else _l(e.authorization)}function FO(e){fg(e);const t=Ii(Pe(e,-64,-32)),r=Pe(e,-t-64,-64),n=Pe(e,0,-t-64),[s,a,o]=lO(BO,r);return{authorization:TO({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:n,...o&&o!=="0x"?{data:o,to:a}:{}}}function UO(e){try{return fg(e),!0}catch{return!1}}class OO extends oe{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}const $l=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],pf=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],mg=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],hg=[...mg,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],DO=[...mg,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],bg=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],yg=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],gg=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],xg=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],wg=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],vg="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",_O="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",MO="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ff="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",mf="/docs/contract/encodeDeployData";function Gl(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new VT({docsPath:mf});if(!("inputs"in s))throw new xb({docsPath:mf});if(!s.inputs||s.inputs.length===0)throw new xb({docsPath:mf});const a=os(s.inputs,r);return lr([n,a])}const Eg="/docs/contract/encodeFunctionData";function NO(e){const{abi:t,args:r,functionName:n}=e;let s=t[0];if(n){const a=$s({abi:t,args:r,name:n});if(!a)throw new za(n,{docsPath:Eg});s=a}if(s.type!=="function")throw new za(void 0,{docsPath:Eg});return{abi:[s],functionName:Yo(Mr(s))}}function fr(e){const{args:t}=e,{abi:r,functionName:n}=(()=>{var i;return e.abi.length===1&&((i=e.functionName)!=null&&i.startsWith("0x"))?e:NO(e)})(),s=r[0],a=n,o="inputs"in s&&s.inputs?os(s.inputs,t??[]):void 0;return lr([a,o??"0x"])}function Ja(e,t){if(!rt(e,{strict:!1}))throw new Ct({address:e});if(!rt(t,{strict:!1}))throw new Ct({address:t});return e.toLowerCase()===t.toLowerCase()}function LO(e){const t=Ut(`0x${e.substring(4)}`).substring(26);return Ho(`0x${t}`)}async function zO({hash:e,signature:t}){const r=Or(e)?e:Fe(e),{secp256k1:n}=await Promise.resolve().then(()=>SU);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:d,yParity:f}=t,m=Number(f??d),y=kg(m);return new n.Signature(Le(l),Le(u)).addRecoveryBit(y)}const o=Or(t)?t:Fe(t);if(lt(o)!==65)throw new Error("invalid signature length");const i=ir(`0x${o.slice(130)}`),c=kg(i);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function kg(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Cg({hash:e,signature:t}){return LO(await zO({hash:e,signature:t}))}function RO(e){const{chainId:t,nonce:r,to:n}=e,s=e.contractAddress??e.address,a=Ut(lr(["0x05",en([t?q(t):"0x",s,r?q(r):"0x"])]));return n==="bytes"?or(a):a}async function jl(e){const{authorization:t,signature:r}=e;return Cg({hash:RO(t),signature:r??t})}async function HO({address:e,authorization:t,signature:r}){return Ja(ep(e),await jl({authorization:t,signature:r}))}function se(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const s=e[r];return typeof s=="function"?s:a=>t(e,a)}function $O({r:e,s:t,to:r="hex",v:n,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new Fi.Signature(Le(e),Le(t)).toCompactHex()}${a===0?"1b":"1c"}`;return r==="hex"?o:or(o)}function GO(e){return{address:e.address,amount:X(e.amount),index:X(e.index),validatorIndex:X(e.validatorIndex)}}function Tg(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:X(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:X(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:X(e.gasLimit)},...typeof e.number=="bigint"&&{number:X(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:X(e.prevRandao)},...typeof e.time=="bigint"&&{time:X(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(GO)}}}const jO="0x82ad56cb",hf="/docs/contract/decodeFunctionResult";function Qs(e){const{abi:t,args:r,functionName:n,data:s}=e;let a=t[0];if(n){const i=$s({abi:t,args:r,name:n});if(!i)throw new za(n,{docsPath:hf});a=i}if(a.type!=="function")throw new za(void 0,{docsPath:hf});if(!a.outputs)throw new Cb(a.name,{docsPath:hf});const o=Ko(a.outputs,s);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}function bf(){let e=()=>{},t=()=>{};return{promise:new Promise((n,s)=>{e=n,t=s}),resolve:e,reject:t}}const yf=new Map;function Sg({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:s}){const a=async()=>{const u=c();o();const d=u.map(({args:f})=>f);d.length!==0&&e(d).then(f=>{s&&Array.isArray(f)&&f.sort(s);for(let m=0;m<u.length;m++){const{resolve:y}=u[m];y==null||y([f[m],f])}}).catch(f=>{for(let m=0;m<u.length;m++){const{reject:y}=u[m];y==null||y(f)}})},o=()=>yf.delete(t),i=()=>c().map(({args:u})=>u),c=()=>yf.get(t)||[],l=u=>yf.set(t,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:f,reject:m}=bf();return(r==null?void 0:r([...i(),u]))&&a(),c().length>0?(l({args:u,resolve:f,reject:m}),d):(l({args:u,resolve:f,reject:m}),setTimeout(a,n),d)}}}function Ag(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new y1({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new y1({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function VO(e){const{balance:t,nonce:r,state:n,stateDiff:s,code:a}=e,o={};if(a!==void 0&&(o.code=a),t!==void 0&&(o.balance=q(t)),r!==void 0&&(o.nonce=q(r)),n!==void 0&&(o.state=Ag(n)),s!==void 0){if(o.state)throw new hS;o.stateDiff=Ag(s)}return o}function gf(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!rt(r,{strict:!1}))throw new Ct({address:r});if(t[r])throw new mS({address:r});t[r]=VO(n)}return t}async function Mi(e,t){var F,_,k,P;const{account:r=e.account,authorizationList:n,batch:s=!!((F=e.batch)!=null&&F.multicall),blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",accessList:i,blobs:c,blockOverrides:l,code:u,data:d,factory:f,factoryData:m,gas:y,gasPrice:g,maxFeePerBlobGas:E,maxFeePerGas:w,maxPriorityFeePerGas:v,nonce:S,to:C,value:D,stateOverride:L,...T}=t,h=r?Ke(r):void 0;if(u&&(f||m))throw new $("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&C)throw new $("Cannot provide both `code` & `to` as parameters.");const b=u&&d,x=f&&m&&C&&d,A=b||x,I=b?Pg({code:u,data:d}):x?YO({data:d,factory:f,factoryData:m,to:C}):d;try{rn(t);const U=(typeof a=="bigint"?q(a):void 0)||o,z=l?Tg(l):void 0,H=gf(L),G=(P=(k=(_=e.chain)==null?void 0:_.formatters)==null?void 0:k.transactionRequest)==null?void 0:P.format,pe=(G||_r)({...Ws(T,{format:G}),accessList:i,account:h,authorizationList:n,blobs:c,data:I,gas:y,gasPrice:g,maxFeePerBlobGas:E,maxFeePerGas:w,maxPriorityFeePerGas:v,nonce:S,to:A?void 0:C,value:D},"call");if(s&&WO({request:pe})&&!H&&!z)try{return await qO(e,{...pe,blockNumber:a,blockTag:o})}catch(de){if(!(de instanceof X1)&&!(de instanceof Gd))throw de}const he=(()=>{const de=[pe,U];return H&&z?[...de,H,z]:H?[...de,H]:z?[...de,{},z]:de})(),ie=await e.request({method:"eth_call",params:he});return ie==="0x"?{data:void 0}:{data:ie}}catch(O){const U=KO(O),{offchainLookup:z,offchainLookupSignature:H}=await Promise.resolve().then(()=>IN);if(e.ccipRead!==!1&&(U==null?void 0:U.slice(0,10))===H&&C)return{data:await z(e,{data:U,to:C})};throw A&&(U==null?void 0:U.slice(0,10))==="0x101bb98d"?new xS({factory:f}):kp(O,{...t,account:h,chain:e.chain})}}function WO({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(jO)||!r||Object.values(n).filter(s=>typeof s<"u").length>0)}async function qO(e,t){var g;const{batchSize:r=1024,deployless:n=!1,wait:s=0}=typeof((g=e.batch)==null?void 0:g.multicall)=="object"?e.batch.multicall:{},{blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",data:i,to:c}=t,l=(()=>{if(n)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Ma({blockNumber:a,chain:e.chain,contract:"multicall3"});throw new X1})(),d=(typeof a=="bigint"?q(a):void 0)||o,{schedule:f}=Sg({id:`${e.uid}.${d}`,wait:s,shouldSplitBatch(E){return E.reduce((v,{data:S})=>v+(S.length-2),0)>r*2},fn:async E=>{const w=E.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),v=fr({abi:$l,args:[w],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...l===null?{data:Pg({code:ff,data:v})}:{to:l,data:v}},d]});return Qs({abi:$l,args:[w],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:m,success:y}]=await f({data:i,to:c});if(!y)throw new cl({data:m});return m==="0x"?{data:void 0}:{data:m}}function Pg(e){const{code:t,data:r}=e;return Gl({abi:zb(["constructor(bytes, bytes)"]),bytecode:vg,args:[t,r]})}function YO(e){const{data:t,factory:r,factoryData:n,to:s}=e;return Gl({abi:zb(["constructor(address, bytes, address, bytes)"]),bytecode:_O,args:[s,t,r,n]})}function KO(e){var r;if(!(e instanceof $))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(r=t.data)==null?void 0:r.data:t.data}const ZO=3;function Js(e,{abi:t,address:r,args:n,docsPath:s,functionName:a,sender:o}){const i=e instanceof cl?e:e instanceof $?e.walk(y=>"data"in y)||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=i,m=e instanceof qo?new gS({functionName:a}):[ZO,js.code].includes(c)&&(l||u||d||f)||c===is.code&&u==="execution reverted"&&l?new vp({abi:t,data:typeof l=="object"?l.data:l,functionName:a,message:i instanceof Ep?u:f??d}):e;return new Zb(m,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:a,sender:o})}async function zr(e,t){const{abi:r,address:n,args:s,functionName:a,...o}=t,i=fr({abi:r,args:s,functionName:a});try{const{data:c}=await se(e,Mi,"call")({...o,data:i,to:n});return Qs({abi:r,args:s,functionName:a,data:c||"0x"})}catch(c){throw Js(c,{abi:r,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function Ni(e,t){var c,l,u,d;const{address:r,chain:n=e.chain,hash:s,erc6492VerifierAddress:a=t.universalSignatureVerifierAddress??((l=(c=n==null?void 0:n.contracts)==null?void 0:c.erc6492Verifier)==null?void 0:l.address),multicallAddress:o=t.multicallAddress??((d=(u=n==null?void 0:n.contracts)==null?void 0:u.multicall3)==null?void 0:d.address)}=t;if(n!=null&&n.verifyHash)return await n.verifyHash(e,t);const i=(()=>{const f=t.signature;return Or(f)?f:typeof f=="object"&&"r"in f&&"s"in f?$O(f):wt(f)})();try{return UO(i)?await XO(e,{...t,multicallAddress:o,signature:i}):await QO(e,{...t,verifierAddress:a,signature:i})}catch(f){try{if(Ja(ep(r),await Cg({hash:s,signature:i})))return!0}catch{}if(f instanceof ea)return!1;throw f}}async function XO(e,t){var E;const{address:r,blockNumber:n,blockTag:s,hash:a,multicallAddress:o}=t,{authorization:i,data:c,signature:l,to:u}=FO(t.signature);if(await Hl(e,{address:r,blockNumber:n,blockTag:s})===lr(["0xef0100",i.address]))return await JO(e,{address:r,blockNumber:n,blockTag:s,hash:a,signature:l});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:q(i.r,{size:32}),s:q(i.s,{size:32}),yParity:i.yParity};if(!await HO({address:r,authorization:f}))throw new ea;const y=await se(e,zr,"readContract")({...o?{address:o}:{code:ff},authorizationList:[f],abi:$l,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:u??r,callData:c}]:[],{allowFailure:!0,target:r,callData:fr({abi:gg,functionName:"isValidSignature",args:[a,l]})}]]}),g=(E=y[y.length-1])==null?void 0:E.returnData;if(g!=null&&g.startsWith("0x1626ba7e"))return!0;throw new ea}async function QO(e,t){const{address:r,factory:n,factoryData:s,hash:a,signature:o,verifierAddress:i,...c}=t,l=await(async()=>!n&&!s||bO(o)?o:hO({data:s,signature:o,to:n}))(),u=i?{to:i,data:fr({abi:xg,functionName:"isValidSig",args:[r,a,l]}),...c}:{data:Gl({abi:xg,args:[r,a,l],bytecode:MO}),...c},{data:d}=await se(e,Mi,"call")(u).catch(f=>{throw f instanceof Kb?new ea:f});if(e8(d??"0x0"))return!0;throw new ea}async function JO(e,t){const{address:r,blockNumber:n,blockTag:s,hash:a,signature:o}=t;if((await se(e,zr,"readContract")({address:r,abi:gg,args:[a,o],blockNumber:n,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof Zb?new ea:c})).startsWith("0x1626ba7e"))return!0;throw new ea}class ea extends Error{}function eD(e,t={}){return typeof e.chainId=="string"?Ig(e):t.signature?{...e,signature:t.signature}:e}function Ig(e){const{address:t,chainId:r,nonce:n}=e,s=zl(e.signature);return{address:t,chainId:Number(r),nonce:BigInt(n),signature:s}}function tD(e){return e.map(t=>Ig(t))}function rD(e){const[t,r,n,s]=e,a={address:r,chainId:t==="0x"?0:Number(t),nonce:n==="0x"?0n:BigInt(n)};return s&&(a.signature=Xa(s)),eD(a)}function nD(e){const t=[];for(const r of e)t.push(rD(r));return t}function sD(e){const{address:t,chainId:r,nonce:n,signature:s}=e;return{address:t,chainId:X(r),nonce:X(n),signature:rf(s)}}function aD(e){return e.map(t=>sD(t))}function oD(e){const{address:t,chainId:r,nonce:n}=e,s=e.signature?Rl(e.signature):void 0;return[r?X(r):"0x",t,n?X(n):"0x",...s?[s]:[]]}function iD(e){if(!e||e.length===0)return[];const t=[];for(const r of e)t.push(oD(r));return t}function cD(e,t={}){return typeof e.expiry=="string"?Bg(e):t.signature?{...e,signature:Ui(t.signature)}:e}function Bg(e){const{chainId:t="0x0",keyId:r,expiry:n=0,limits:s,keyType:a}=e,o=zl(e.signature);return{address:r,chainId:t==="0x"?0n:bt(t),expiry:Number(n),limits:s==null?void 0:s.map(i=>({token:i.token,limit:BigInt(i.limit)})),signature:o,type:a}}function lD(e){const[t,r]=e,[n,s,a,o,i]=t,c=(()=>{switch(s){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";default:throw new Error(`Invalid key type: ${s}`)}})(),l={address:a,expiry:typeof o<"u"?Ii(o):void 0,type:c,...n!=="0x"?{chainId:bt(n)}:{},...typeof o<"u"?{expiry:Ii(o)}:{},...typeof i<"u"?{limits:i.map(([u,d])=>({token:u,limit:BigInt(d)}))}:{}};return r&&(l.signature=Xa(r)),cD(l)}function uD(e){const{address:t,chainId:r=0n,expiry:n,limits:s,type:a,signature:o}=e;return{chainId:r===0n?"0x":X(r),expiry:typeof n=="number"?X(n):null,limits:s==null?void 0:s.map(({token:i,limit:c})=>({token:i,limit:X(c)})),keyId:t,signature:rf(o),keyType:a}}function dD(e){const{address:t,chainId:r=0n,expiry:n,limits:s}=e,a=e.signature?Rl(e.signature):void 0,o=(()=>{switch(e.type){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";default:throw new Error(`Invalid key type: ${e.type}`)}})();return[[r===0n?"0x":X(r),o,t,typeof n=="number"?X(n):void 0,(s==null?void 0:s.map(c=>[c.token,X(c.limit)]))??void 0].filter(Boolean),...a?[a]:[]]}const pD="0x20c0";function Fg(e){if(typeof e=="string")return Lr(e),e;const t=X(e,{size:18});return pt(pD,t)}const Ug={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},Og={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function fD(e,t={}){if(!e)return null;const r=Jy(e),n={...e,...r};return n.blockNumber=e.blockNumber?BigInt(e.blockNumber):null,n.data=e.input,n.gas=BigInt(e.gas??0n),n.nonce=BigInt(e.nonce??0n),n.transactionIndex=e.transactionIndex?Number(e.transactionIndex):null,n.value=BigInt(e.value??0n),e.authorizationList&&(n.authorizationList=SO(e.authorizationList)),e.chainId&&(n.chainId=Number(e.chainId)),e.gasPrice&&(n.gasPrice=BigInt(e.gasPrice)),e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=BigInt(e.maxFeePerBlobGas)),e.maxFeePerGas&&(n.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.type&&(n.type=Og[e.type]??e.type),r&&(n.v=Xp(r.yParity)),n}const Dg={...Ug,tempo:"0x76"},mD={...Og,"0x76":"tempo"};function hD(e,t={}){if(!e)return null;const r=fD(e);return r.type=mD[e.type],e.aaAuthorizationList&&(r.authorizationList=tD(e.aaAuthorizationList),delete r.aaAuthorizationList),e.calls&&(r.calls=e.calls.map(n=>({to:n.to,value:n.value&&n.value!=="0x"?BigInt(n.value):void 0,data:n.input||n.data||"0x"}))),e.feeToken&&(r.feeToken=e.feeToken),e.nonceKey&&(r.nonceKey=BigInt(e.nonceKey)),e.signature&&(r.signature=zl(e.signature)),e.validAfter&&(r.validAfter=Number(e.validAfter)),e.validBefore&&(r.validBefore=Number(e.validBefore)),e.keyAuthorization&&(r.keyAuthorization=Bg(e.keyAuthorization)),e.feePayerSignature&&(r.feePayerSignature=Kp(e.feePayerSignature),r.feePayerSignature.v=Xp(r.feePayerSignature.yParity)),r}function bD(e){const t={};return typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.authorizationList<"u"&&(t.authorizationList=PO(e.authorizationList)),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(t.blobs=e.blobs),typeof e.chainId<"u"&&(t.chainId=X(e.chainId)),typeof e.data<"u"?(t.data=e.data,t.input=e.data):typeof e.input<"u"&&(t.data=e.input,t.input=e.input),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=X(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=X(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=X(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=X(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=X(e.maxPriorityFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=X(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=X(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Ug[e.type]||e.type),typeof e.value<"u"&&(t.value=X(e.value)),t}function yD(e){const t=bD({...e,authorizationList:void 0});e.authorizationList&&(t.authorizationList=aD(e.authorizationList)),e.calls&&(t.calls=e.calls.map(n=>({to:n.to,value:n.value?X(n.value):"0x",data:n.data??"0x"}))),typeof e.feeToken<"u"&&(t.feeToken=Fg(e.feeToken)),e.keyAuthorization&&(t.keyAuthorization=uD(e.keyAuthorization)),typeof e.validBefore<"u"&&(t.validBefore=X(e.validBefore)),typeof e.validAfter<"u"&&(t.validAfter=X(e.validAfter));const r=(()=>{if(e.nonceKey==="random")return fy(6);if(typeof e.nonceKey=="bigint")return X(e.nonceKey)})();return r&&(t.nonceKey=r),(typeof e.calls<"u"||typeof e.feeToken<"u"||typeof e.keyAuthorization<"u"||typeof e.nonceKey<"u"||typeof e.validBefore<"u"||typeof e.validAfter<"u"||e.type==="tempo")&&(t.type=Dg.tempo,delete t.data,delete t.input,delete t.to,delete t.value),t}function gD(e){const t=[];for(let r=0;r<e.length;r++){const[n,s]=e[r];n&&Lr(n,{strict:!1}),t.push({address:n,storageKeys:s.map(a=>LF(a)?a:Up(a))})}return t}function xD(e){if(!e||e.length===0)return[];const t=[];for(const{address:r,storageKeys:n}of e){for(let s=0;s<n.length;s++)if(ht(n[s])!==32)throw new wD({storageKey:n[s]});r&&Lr(r,{strict:!1}),t.push([r,n])}return t}class wD extends oe{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${ht(t)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}const _g={wei:0,gwei:9,szabo:12,finney:15,ether:18};function vD(e,t=0){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[s,a]=[r.slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${a?`.${a}`:""}`}function xf(e,t="wei"){return vD(e,_g.gwei-_g[t])}class ED extends oe{constructor({feeCap:t}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${t?` = ${xf(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class kD extends oe{constructor({chainId:t}){super(typeof t<"u"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class CD extends oe{constructor({attributes:t,serialized:r,type:n}){const s=Object.entries(t).map(([a,o])=>typeof o>"u"?a:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${n}" was provided.`,{metaMessages:[`Serialized Transaction: "${r}"`,s.length>0?`Missing Attributes: ${s.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class TD extends oe{constructor({maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${xf(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${xf(r)} gwei`:""}).`].join(`
107
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}const SD="0x78",AD="0x76",Mg="tempo";function wf(e){const{calls:t,chainId:r,maxFeePerGas:n,maxPriorityFeePerGas:s,validBefore:a,validAfter:o}=e;if(!t||t.length===0)throw new OD;if(typeof a=="number"&&typeof o=="number"&&a<=o)throw new DD({validBefore:a,validAfter:o});if(t)for(const i of t)i.to&&Lr(i.to,{strict:!1});if(r<=0)throw new kD({chainId:r});if(n&&BigInt(n)>2n**256n-1n)throw new ED({feeCap:n});if(s&&n&&s>n)throw new TD({maxFeePerGas:n,maxPriorityFeePerGas:s})}function PD(e){const t=gO(Pe(e,1)),[r,n,s,a,o,i,c,l,u,d,f,m,y,g,E]=t,w=Array.isArray(g)?g:void 0,v=w?E:g;if(!(t.length===13||t.length===14||t.length===15))throw new CD({attributes:{authorizationList:y,chainId:r,maxPriorityFeePerGas:n,maxFeePerGas:s,gas:a,calls:o,accessList:i,keyAuthorization:w,nonceKey:c,nonce:l,validBefore:u,validAfter:d,feeToken:f,feePayerSignatureOrSender:m,...t.length>12?{signature:v}:{}},serialized:e,type:Mg});let S={chainId:Number(r),type:Mg};if(Nr(a)&&a!=="0x"&&(S.gas=BigInt(a)),Nr(l)&&(S.nonce=l==="0x"?0n:BigInt(l)),Nr(s)&&s!=="0x"&&(S.maxFeePerGas=BigInt(s)),Nr(n)&&n!=="0x"&&(S.maxPriorityFeePerGas=BigInt(n)),Nr(c)&&(S.nonceKey=c==="0x"?0n:BigInt(c)),Nr(u)&&u!=="0x"&&(S.validBefore=Number(u)),Nr(d)&&d!=="0x"&&(S.validAfter=Number(d)),Nr(f)&&f!=="0x"&&(S.feeToken=f),o&&o!=="0x"){const D=o;S.calls=D.map(L=>{const[T,h,b]=L,x={};return T&&T!=="0x"&&(x.to=T),h&&h!=="0x"&&(x.value=BigInt(h)),b&&b!=="0x"&&(x.data=b),x})}(i==null?void 0:i.length)!==0&&i!=="0x"&&(S.accessList=gD(i)),(y==null?void 0:y.length)!==0&&y!=="0x"&&(S.authorizationList=nD(y)),m!=="0x"&&m!==void 0&&(m==="0x00"||Ol(m)?S.feePayerSignature=null:S.feePayerSignature=OU(m)),w&&(S.keyAuthorization=lD(w));const C=v?Xa(v):void 0;return C&&(S={...S,signature:C}),wf(S),S}function ID(e,t={}){const{feePayerSignature:r,signature:n}=t,s=typeof e=="string"?PD(e):e;return wf(s),{...s,...n?{signature:Ui(n)}:{},...r?{feePayerSignature:Ml(r)}:{},type:"tempo"}}function Li(e,t={}){const{accessList:r,authorizationList:n,calls:s,chainId:a,feeToken:o,gas:i,keyAuthorization:c,nonce:l,nonceKey:u,maxFeePerGas:d,maxPriorityFeePerGas:f,validBefore:m,validAfter:y}=e;wf(e);const g=xD(r),E=t.signature||e.signature,w=iD(n),v=s.map(D=>[D.to??"0x",D.value?X(D.value):"0x",D.data??"0x"]),S=(()=>{if(t.sender)return t.sender;const D=typeof t.feePayerSignature<"u"?t.feePayerSignature:e.feePayerSignature;return D===null?"0x00":D?_U(D):"0x"})(),C=[X(a),f?X(f):"0x",d?X(d):"0x",i?X(i):"0x",v,g,u?X(u):"0x",l?X(l):"0x",typeof m=="number"?X(m):"0x",typeof y=="number"?X(y):"0x",typeof o=="bigint"||typeof o=="string"?Fg(o):"0x",S,w,...c?[dD(c)]:[],...E?[Rl(Ui(E))]:[]];return pt(t.format==="feePayer"?SD:AD,EO(C))}function BD(e){return FD(e,{presign:!0})}function FD(e,t={}){const r=Li({...e,...t.presign?{signature:void 0}:{}});return Bi(r)}function UD(e,t){const{sender:r}=t,n=Li({...e,signature:void 0},{sender:r,format:"feePayer"});return Bi(n)}class OD extends oe{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class DD extends oe{constructor({validBefore:t,validAfter:r}){super(`validBefore (${t}) must be greater than validAfter (${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}function Ng(e){const t=e.account;return t!=null&&t.keyType&&t.keyType!=="secp256k1"||typeof e.calls<"u"||typeof e.feePayer<"u"||typeof e.feeToken<"u"||typeof e.keyAuthorization<"u"||typeof e.nonceKey<"u"||typeof e.signature<"u"||typeof e.validBefore<"u"||typeof e.validAfter<"u"?"tempo":e.type?e.type:sp(e)}function vf(e){try{return Ng(e)==="tempo"}catch{return!1}}async function _D(e,t){if(!vf(e)){if(t&&"type"in t&&t.type!=="secp256k1")throw new Error("Unsupported signature type. Expected `secp256k1` but got `"+t.type+"`.");if(t&&"type"in t){const{r:n,s,yParity:a}=t==null?void 0:t.signature;return Vc(e,{r:X(n,{size:32}),s:X(s,{size:32}),yParity:a})}return Vc(e,t)}if(Ng(e)==="tempo")return MD(e,t);throw new Error("Unsupported transaction type")}async function MD(e,t){var l;const r=(()=>{if(e.signature)return e.signature;if(t&&"type"in t)return t;if(t)return Ui({r:BigInt(t.r),s:BigInt(t.s),yParity:Number(t.yParity)})})(),{chainId:n,feePayer:s,feePayerSignature:a,nonce:o,...i}=e,c={...i,calls:(l=i.calls)!=null&&l.length?i.calls:[{to:i.to||(!i.data||i.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:i.value,data:i.data}],chainId:Number(n),feePayerSignature:a?{r:BigInt(a.r),s:BigInt(a.s),yParity:Number(a.yParity)}:s?null:void 0,type:"tempo",...o?{nonce:BigInt(o)}:{}};if(s===!0&&delete c.feeToken,r&&typeof e.feePayer=="object"){const u=ID(c,{signature:r}),d=(()=>{if(e.from)return e.from;if(r.type==="secp256k1")return Zy({payload:BD(u),signature:r.signature});throw new Error("Unable to extract sender from transaction or signature.")})(),f=UD(u,{sender:d}),m=await e.feePayer.sign({hash:f});return Li(u,{feePayerSignature:Ml(m)})}if(s===!0){const u=Li(c,{feePayerSignature:null,signature:r});return e.from&&r?pt(u,e.from,"0xfeefeefeefee"):u}return Li({...c,...s?{feeToken:void 0}:{}},{feePayerSignature:void 0,signature:r})}function ND(e){if(!vf(e))return Ns(e);const{feePayerSignature:t,gasPrice:r,nonce:n,...s}=hD(e);return{...s,accessList:s.accessList,feePayerSignature:t?{r:X(t.r,{size:32}),s:X(t.s,{size:32}),v:BigInt(t.v??27),yParity:t.yParity}:void 0,nonce:Number(n),typeHex:Dg[s.type],type:s.type}}function LD(e){return zc(e)}function zD(e,t){const r=e,n=r.account?Ke(r.account):void 0;if(!vf(r))return _r(e);t&&(r.calls=r.calls??[{to:e.to||(!e.data||e.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:e.value,data:e.data}]),r.feePayer===!0&&delete r.feeToken;const s=yD({...r,type:"tempo"});t==="estimateGas"&&(s.maxFeePerGas=void 0,s.maxPriorityFeePerGas=void 0),s.to=void 0,s.data=void 0,s.value=void 0;const[a,o]=(()=>{const c=n&&"keyType"in n?n.keyType:n==null?void 0:n.source;return c?c==="webAuthn"?["webAuthn",`0x${"ff".repeat(1400)}`]:["p256","secp256k1"].includes(c)?[c,void 0]:[void 0,void 0]:[void 0,void 0]})(),i=n&&"accessKeyAddress"in n?n.accessKeyAddress:void 0;return{...s,...o?{keyData:o}:{},...i?{keyId:i}:{},...a?{keyType:a}:{},...r.feePayer?{feePayer:typeof r.feePayer=="object"?Ke(r.feePayer):r.feePayer}:{}}}const RD=HD();function HD(){return new Map}function $D(e){return`${e.address.toLowerCase()}-${e.chainId}`}function Lg(e,t){const r=$D(t);let n=e.get(r);return n||(n={counter:0,resetScheduled:!1},e.set(r,n)),n}function GD(e,t){const r=Lg(e,t);r.counter=0,r.resetScheduled=!1}function jD(e,t){const r=Lg(e,t);r.resetScheduled||(r.resetScheduled=!0,queueMicrotask(()=>GD(e,t)));const n=r.counter;return r.counter++,n===0?0n:bt(fy(6))}const Ef={blockTime:1e3,extendSchema:L3(),formatters:{transaction:Lc({exclude:["aaAuthorizationList"],format:ND}),transactionReceipt:Ud({format:LD}),transactionRequest:Od({format:zD})},prepareTransactionRequest:[async(e,{phase:t})=>{var n;const r=e;return t==="afterFillParameters"?(typeof r.nonceKey=="bigint"&&r.nonceKey>0n&&(r.gas=(r.gas??0n)+40000n),r):(r.nonceKey=(()=>{var o;if(typeof r.nonceKey<"u"&&r.nonceKey!=="random")return r.nonceKey;const s=((o=r.account)==null?void 0:o.address)??r.from;if(!s||!r.chain)return;const a=jD(RD,{address:s,chainId:r.chain.id});if(a!==0n)return a})(),r.nonce=(()=>{if(typeof r.nonce=="number")return r.nonce;if(r.nonceKey)return 0})(),!r.feeToken&&((n=r.chain)!=null&&n.feeToken)&&(r.feeToken=r.chain.feeToken),r)},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:((e,t)=>_D(e,t))},async verifyHash(e,t){const{address:r,hash:n,signature:s}=t;if(typeof s=="string"&&s.endsWith(Xs.slice(2))){const a=Xa(s);if(a.type!=="keychain"){const o=await Hl(e,{address:r,blockNumber:t.blockNumber,blockTag:t.blockTag});if(!o||o==="0xef01007702c00000000000000000000000000000000000")return GU(a,{address:r,payload:n})}}return await se(e,Ni,"verifyHash")({...t,chain:null})}},VD=p({...Ef,id:42429,name:"Tempo Devnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.devnet.tempoxyz.dev"],webSocket:["wss://rpc.devnet.tempoxyz.dev"]}}}),WD=p({...Ef,id:1337,name:"Tempo",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["http://localhost:8545"]}}}),qD=p({...Ef,id:42429,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},name:"Tempo Testnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.testnet.tempo.xyz"],webSocket:["wss://rpc.testnet.tempo.xyz"]}}}),YD=p({id:1559,name:"Tenet",network:"tenet-mainnet",nativeCurrency:{name:"TENET",symbol:"TENET",decimals:18},rpcUrls:{default:{http:["https://rpc.tenet.org"]}},blockExplorers:{default:{name:"TenetScan Mainnet",url:"https://tenetscan.io",apiUrl:"https://tenetscan.io/api"}},testnet:!1}),KD=p({id:752025,name:"Ternoa",nativeCurrency:{name:"Capsule Coin",symbol:"CAPS",decimals:18},rpcUrls:{default:{http:["https://rpc-mainnet.zkevm.ternoa.network"]}},blockExplorers:{default:{name:"Ternoa Explorer",url:"https://explorer-mainnet.zkevm.ternoa.network"}},testnet:!1}),ZD=p({id:7,name:"ThaiChain",nativeCurrency:{name:"TCH",symbol:"TCH",decimals:18},rpcUrls:{default:{http:["https://rpc.thaichain.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp.thaichain.org",apiUrl:"https://exp.thaichain.org/api"}},contracts:{multicall3:{address:"0x0DaD6130e832c21719C5CE3bae93454E16A84826",blockCreated:4806386}},testnet:!1}),XD=p({id:8428,name:"THAT Mainnet",nativeCurrency:{name:"THAT",symbol:"THAT",decimals:18},rpcUrls:{default:{http:["https://api.thatchain.io/mainnet"]}},blockExplorers:{default:{name:"Blockscout",url:"https://that.blockscout.com"}},testnet:!1}),QD=p({id:361,name:"Theta Mainnet",nativeCurrency:{name:"TFUEL",symbol:"TFUEL",decimals:18},rpcUrls:{default:{http:["https://eth-rpc-api.thetatoken.org/rpc"]}},blockExplorers:{default:{name:"Theta Explorer",url:"https://explorer.thetatoken.org"}},testnet:!1}),JD=p({id:365,name:"Theta Testnet",nativeCurrency:{name:"TFUEL",symbol:"TFUEL",decimals:18},rpcUrls:{default:{http:["https://eth-rpc-api-testnet.thetatoken.org/rpc"]}},blockExplorers:{default:{name:"Theta Explorer",url:"https://testnet-explorer.thetatoken.org"}},testnet:!0}),e_=p({id:108,name:"ThunderCore Mainnet",nativeCurrency:{name:"TT",symbol:"TT",decimals:18},rpcUrls:{default:{http:["https://mainnet-rpc.thundercore.com"]}},blockExplorers:{default:{name:"ThunderCore Explorer",url:"https://explorer-mainnet.thundercore.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}},testnet:!1}),t_=p({id:997,name:"5ireChain Thunder Testnet",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Thunder Explorer",url:"https://testnet.5irescan.io/"}},testnet:!0}),r_=p({id:62092,name:"TikTrix Testnet",nativeCurrency:{name:"tTTX",symbol:"tTTX",decimals:18},rpcUrls:{default:{http:["https://tiktrix-rpc.xyz"]}},blockExplorers:{default:{name:"TikTrix Testnet Explorer",url:"https://tiktrix.xyz"}},testnet:!0}),n_=p({id:6969,name:"Tomb Mainnet",nativeCurrency:{name:"TOMB",symbol:"TOMB",decimals:18},rpcUrls:{default:{http:["https://rpc.tombchain.com"]}},blockExplorers:{default:{name:"Tomb Explorer",url:"https://tombscout.com"}},testnet:!1}),s_=p({...ur,id:61166,name:"Treasure",nativeCurrency:{decimals:18,name:"MAGIC",symbol:"MAGIC"},rpcUrls:{default:{http:["https://rpc.treasure.lol"],webSocket:["wss://rpc.treasure.lol/ws"]}},blockExplorers:{default:{name:"Treasure Block Explorer",url:"https://treasurescan.io"}},contracts:{multicall3:{address:"0x2e29fe39496a56856D8698bD43e1dF4D0CE6266a",blockCreated:101}},testnet:!1}),a_=p({...ur,id:978658,name:"Treasure Topaz Testnet",nativeCurrency:{decimals:18,name:"MAGIC",symbol:"MAGIC"},rpcUrls:{default:{http:["https://rpc.topaz.treasure.lol"],webSocket:["wss://rpc.topaz.treasure.lol/ws"]}},blockExplorers:{default:{name:"Treasure Topaz Block Explorer",url:"https://topaz.treasurescan.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:108112}},testnet:!0}),o_=p({id:728126428,name:"Tron",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://api.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://tronscan.org",apiUrl:"https://apilist.tronscanapi.com/api"}}}),i_=p({id:3448148188,name:"Tron Nile",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://nile.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://nile.tronscan.org"}},testnet:!0}),c_=p({id:2494104990,name:"Tron Shasta",nativeCurrency:{name:"TRON",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://api.shasta.trongrid.io/jsonrpc"]}},blockExplorers:{default:{name:"Tronscan",url:"https://shasta.tronscan.org"}},testnet:!0}),l_=p({id:8,name:"Ubiq Mainnet",nativeCurrency:{name:"UBQ",symbol:"UBQ",decimals:18},rpcUrls:{default:{http:["https://pyrus2.ubiqscan.io"]}},blockExplorers:{default:{name:"Ubiq Scan",url:"https://ubiqscan.io"}},testnet:!1}),u_=p({id:19991,name:"Ultra EVM",nativeCurrency:{decimals:18,name:"Ultra Token",symbol:"UOS"},rpcUrls:{default:{http:["https://evm.ultra.eosusa.io"]}},blockExplorers:{default:{name:"Ultra EVM Explorer",url:"https://evmexplorer.ultra.io"}}}),d_=p({id:18881,name:"Ultra EVM Testnet",nativeCurrency:{decimals:18,name:"Ultra Token",symbol:"UOS"},rpcUrls:{default:{http:["https://evm.test.ultra.eosusa.io"]}},blockExplorers:{default:{name:"Ultra EVM Testnet Explorer",url:"https://evmexplorer.testnet.ultra.io"}},testnet:!0}),p_=p({id:1231,name:"Ultron Mainnet",nativeCurrency:{name:"ULX",symbol:"ULX",decimals:18},rpcUrls:{default:{http:["https://ultron-rpc.net"]}},blockExplorers:{default:{name:"Ultron Scan",url:"https://ulxscan.com"}},testnet:!1}),f_=p({id:1230,name:"Ultron Testnet",nativeCurrency:{name:"ULX",symbol:"ULX",decimals:18},rpcUrls:{default:{http:["https://ultron-dev.io"]}},blockExplorers:{default:{name:"Ultron Scan",url:"https://explorer.ultron-dev.io"}},testnet:!0}),Vl=1,m_=p({...V,id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz",apiUrl:"https://api.uniscan.xyz/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[Vl]:{address:"0x2F12d621a16e2d3285929C9996f478508951dFe4"}},portal:{[Vl]:{address:"0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2"}},l1StandardBridge:{[Vl]:{address:"0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA"}}},sourceId:Vl}),Wl=11155111,h_=p({...V,id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://sepolia.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://sepolia.uniscan.xyz",apiUrl:"https://api-sepolia.uniscan.xyz/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},portal:{[Wl]:{address:"0x0d83dab629f0e0F9d36c0Cbc89B69a489f0751bD"}},l1StandardBridge:{[Wl]:{address:"0xea58fcA6849d79EAd1f26608855c2D6407d54Ce2"}},disputeGameFactory:{[Wl]:{address:"0xeff73e5aa3B9AEC32c659Aa3E00444d20a84394b"}}},testnet:!0,sourceId:Wl}),b_=p({id:8880,name:"Unique Mainnet",nativeCurrency:{decimals:18,name:"UNQ",symbol:"UNQ"},rpcUrls:{default:{http:["https://rpc.unique.network"]}},blockExplorers:{default:{name:"Unique Subscan",url:"https://unique.subscan.io/"}}}),y_=p({id:8882,name:"Opal Testnet",nativeCurrency:{decimals:18,name:"OPL",symbol:"OPL"},rpcUrls:{default:{http:["https://rpc-opal.unique.network"]}},blockExplorers:{default:{name:"Opal Subscan",url:"https://opal.subscan.io/"}},testnet:!0}),g_=p({id:8881,name:"Quartz Mainnet",nativeCurrency:{decimals:18,name:"QTZ",symbol:"QTZ"},rpcUrls:{default:{http:["https://rpc-quartz.unique.network"]}},blockExplorers:{default:{name:"Quartz Subscan",url:"https://quartz.subscan.io/"}}}),x_=p({id:18233,name:"Unreal",nativeCurrency:{name:"reETH",decimals:18,symbol:"reETH"},rpcUrls:{default:{http:["https://rpc.unreal-orbit.gelato.digital"]}},blockExplorers:{default:{name:"Unreal Explorer",url:"https://unreal.blockscout.com",apiUrl:"https://unreal.blockscout.com/api/v2"}},testnet:!0,contracts:{multicall3:{address:"0x8b6B0e60D8CD84898Ea8b981065A12F876eA5677",blockCreated:1745}}}),w_=p({id:1480,name:"Vana",blockTime:6e3,nativeCurrency:{decimals:18,name:"Vana",symbol:"VANA"},rpcUrls:{default:{http:["https://rpc.vana.org/"]}},blockExplorers:{default:{name:"Vana Block Explorer",url:"https://vanascan.io",apiUrl:"https://vanascan.io/api"}},contracts:{multicall3:{address:"0xD8d2dFca27E8797fd779F8547166A2d3B29d360E",blockCreated:716763}}}),v_=p({id:14800,name:"Vana Moksha Testnet",blockTime:6e3,nativeCurrency:{decimals:18,name:"Vana",symbol:"VANA"},rpcUrls:{default:{http:["https://rpc.moksha.vana.org"]}},blockExplorers:{default:{name:"Vana Moksha Testnet",url:"https://moksha.vanascan.io",apiUrl:"https://moksha.vanascan.io/api"}},contracts:{multicall3:{address:"0xD8d2dFca27E8797fd779F8547166A2d3B29d360E",blockCreated:732283}},testnet:!0}),E_=p({id:2040,name:"Vanar Mainnet",nativeCurrency:{name:"VANRY",symbol:"VANRY",decimals:18},rpcUrls:{default:{http:["https://rpc.vanarchain.com"]}},blockExplorers:{default:{name:"Vanar Mainnet Explorer",url:"https://explorer.vanarchain.com/"}},testnet:!1}),k_=p({id:100009,name:"Vechain",nativeCurrency:{name:"VeChain",symbol:"VET",decimals:18},rpcUrls:{default:{http:["https://mainnet.vechain.org"]}},blockExplorers:{default:{name:"Vechain Explorer",url:"https://explore.vechain.org"},vechainStats:{name:"Vechain Stats",url:"https://vechainstats.com"}}}),C_=p({id:106,name:"Velas EVM Mainnet",nativeCurrency:{name:"VLX",symbol:"VLX",decimals:18},rpcUrls:{default:{http:["https://evmexplorer.velas.com/rpc"]}},blockExplorers:{default:{name:"Velas Explorer",url:"https://evmexplorer.velas.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:55883577}},testnet:!1}),T_=p({id:88,name:"Viction",nativeCurrency:{name:"Viction",symbol:"VIC",decimals:18},rpcUrls:{default:{http:["https://rpc.viction.xyz"]}},blockExplorers:{default:{name:"VIC Scan",url:"https://vicscan.xyz"}},testnet:!1}),S_=p({id:89,name:"Viction Testnet",nativeCurrency:{name:"Viction",symbol:"VIC",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.viction.xyz"]}},blockExplorers:{default:{name:"VIC Scan",url:"https://testnet.vicscan.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:12170179}},testnet:!0}),A_=p({id:888888,name:"Vision",nativeCurrency:{name:"VISION",symbol:"VS",decimals:18},rpcUrls:{default:{http:["https://infragrid.v.network/ethereum/compatible"]}},blockExplorers:{default:{name:"Vision Scan",url:"https://visionscan.org"}},testnet:!1}),P_=p({id:666666,name:"Vision Testnet",nativeCurrency:{name:"VISION",symbol:"VS",decimals:18},rpcUrls:{default:{http:["https://vpioneer.infragrid.v.network/ethereum/compatible"]}},blockExplorers:{default:{name:"Vision Scan",url:"https://visionscan.org/?chain=vpioneer"}},testnet:!0}),I_=p({id:888,name:"Wanchain",nativeCurrency:{name:"WANCHAIN",symbol:"WAN",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]}},blockExplorers:{default:{name:"WanScan",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB",blockCreated:25312390}}}),B_=p({id:999,name:"Wanchain Testnet",nativeCurrency:{name:"WANCHAIN",symbol:"WANt",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:46891"]}},blockExplorers:{default:{name:"WanScanTest",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0x11c89bF4496c39FB80535Ffb4c92715839CC5324",blockCreated:24743448}},testnet:!0}),F_=p({id:9496,name:"WeaveVM Alphanet",nativeCurrency:{name:"Testnet WeaveVM",symbol:"tWVM",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.wvm.dev"]}},blockExplorers:{default:{name:"WeaveVM Alphanet Explorer",url:"https://explorer.wvm.dev"}},testnet:!0}),U_=p({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://api.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://explorer.wemix.com"}}}),O_=p({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com",apiUrl:"https://testnet.wemixscan.com/api"}},testnet:!0}),D_=p({id:420420421,name:"Westend Asset Hub",nativeCurrency:{decimals:18,name:"Westies",symbol:"WND"},rpcUrls:{default:{http:["https://westend-asset-hub-eth-rpc.polkadot.io"]}},blockExplorers:{default:{name:"subscan",url:"https://westend-asset-hub-eth-explorer.parity.io"}},testnet:!0}),__=p({testnet:!1,name:"Whitechain",blockExplorers:{default:{name:"Whitechain Explorer",url:"https://explorer.whitechain.io"}},id:1875,rpcUrls:{default:{http:["https://rpc.whitechain.io"]}},nativeCurrency:{decimals:18,name:"WhiteBIT Coin",symbol:"WBT"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:25212237}}}),M_=p({testnet:!0,name:"Whitechain Testnet",blockExplorers:{default:{name:"Whitechain Explorer",url:"https://testnet.whitechain.io"}},id:2625,rpcUrls:{default:{http:["https://rpc-testnet.whitechain.io"]}},nativeCurrency:{decimals:18,name:"WhiteBIT Coin",symbol:"WBT"}}),N_=p({id:42070,name:"WMC Testnet",nativeCurrency:{name:"WMTx",symbol:"WMTx",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet-base.worldmobile.net"]}},blockExplorers:{default:{name:"WMC Explorer",url:"https://explorer2-base-testnet.worldmobile.net"}},testnet:!0}),zi=1,L_=p({...V,id:480,name:"World Chain",network:"worldchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan",url:"https://worldscan.org",apiUrl:"https://api.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-mainnet.explorer.alchemy.com",apiUrl:"https://worldchain-mainnet.explorer.alchemy.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[zi]:{address:"0x069c4c579671f8c120b1327a73217D01Ea2EC5ea"}},l2OutputOracle:{[zi]:{address:"0x19A6d1E9034596196295CF148509796978343c5D"}},portal:{[zi]:{address:"0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C"}},l1StandardBridge:{[zi]:{address:"0x470458C91978D2d929704489Ad730DC3E3001113"}}},testnet:!1,sourceId:zi}),Ri=11155111,z_=p({...V,id:4801,name:"World Chain Sepolia",network:"worldchain-sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-sepolia.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan Sepolia",url:"https://sepolia.worldscan.org",apiUrl:"https://api-sepolia.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-sepolia.explorer.alchemy.com",apiUrl:"https://worldchain-sepolia.explorer.alchemy.com/api"}},contracts:{...V.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[Ri]:{address:"0x8Ec1111f67Dad6b6A93B3F42DfBC92D81c98449A"}},l2OutputOracle:{[Ri]:{address:"0xc8886f8BAb6Eaeb215aDB5f1c686BF699248300e"}},portal:{[Ri]:{address:"0xFf6EBa109271fe6d4237EeeD4bAb1dD9A77dD1A4"}},l1StandardBridge:{[Ri]:{address:"0xd7DF54b3989855eb66497301a4aAEc33Dbb3F8DE"}}},testnet:!0,sourceId:Ri}),R_=p({id:103,name:"WorldLand Mainnet",nativeCurrency:{decimals:18,name:"WLC",symbol:"WLC"},rpcUrls:{default:{http:["https://seoul.worldland.foundation"]}},blockExplorers:{default:{name:"WorldLand Scan",url:"https://scan.worldland.foundation"}},testnet:!1}),H_=p({id:660279,name:"Xai Mainnet",nativeCurrency:{name:"Xai",symbol:"XAI",decimals:18},rpcUrls:{default:{http:["https://xai-chain.net/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.xai-chain.net"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:222549}},testnet:!1}),$_=p({id:37714555429,name:"Xai Testnet",nativeCurrency:{name:"sXai",symbol:"sXAI",decimals:18},rpcUrls:{default:{http:["https://testnet-v2.xai-chain.net/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer-v2.xai-chain.net"}},testnet:!0}),G_=p({id:50,name:"XDC Network",nativeCurrency:{decimals:18,name:"XDC",symbol:"XDC"},rpcUrls:{default:{http:["https://rpc.xdcrpc.com"]}},blockExplorers:{default:{name:"XDCScan",url:"https://xdcscan.com"}},contracts:{multicall3:{address:"0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF",blockCreated:75884020}}}),j_=p({id:51,name:"Apothem Network",nativeCurrency:{decimals:18,name:"TXDC",symbol:"TXDC"},rpcUrls:{default:{http:["https://erpc.apothem.network"]}},blockExplorers:{default:{name:"XDCScan",url:"https://testnet.xdcscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:59765389}}}),V_=p({id:196,name:"X Layer Mainnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://rpc.xlayer.tech"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/xlayer",apiUrl:"https://www.oklink.com/api/v5/explorer/xlayer/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:47416}}}),zg=p({id:195,name:"X1 Testnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://xlayertestrpc.okx.com"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/xlayer-test"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:624344}},testnet:!0}),W_=p({id:3721,name:"Xone Chain Mainnet",nativeCurrency:{decimals:18,name:"XOC",symbol:"XOC"},rpcUrls:{default:{http:["https://rpc.xone.org"]}},blockExplorers:{default:{name:"Xone Mainnet Explorer",url:"https://xonescan.com",apiUrl:"http://api.xonescan.com/api"}},testnet:!1}),q_=p({id:33772211,name:"Xone Chain Testnet",nativeCurrency:{decimals:18,name:"XOC",symbol:"XOC"},rpcUrls:{default:{http:["https://rpc-testnet.xone.org","https://rpc-testnet.xone.plus","https://rpc-testnet.knight.center"]}},blockExplorers:{default:{name:"Xone Testnet Explorer",url:"https://testnet.xonescan.com",apiUrl:"http://api.testnet.xonescan.com/api"}},testnet:!0}),Y_=p({id:20250217,name:"Xphere Mainnet",nativeCurrency:{decimals:18,name:"XP",symbol:"XP"},rpcUrls:{default:{http:["https://en-bkk.x-phere.com"]}},blockExplorers:{default:{name:"Xphere Tamsa Explorer",url:"https://xp.tamsa.io"}},testnet:!1}),K_=p({id:1998991,name:"Xphere Testnet",nativeCurrency:{decimals:18,name:"XPT",symbol:"XPT"},rpcUrls:{default:{http:["http://testnet.x-phere.com"]}},blockExplorers:{default:{name:"Xphere Tamsa Explorer",url:"https://xpt.tamsa.io"}},testnet:!0}),Z_=p({id:273,name:"XR One",nativeCurrency:{decimals:18,name:"XR1",symbol:"XR1"},rpcUrls:{default:{http:["https://xr1.calderachain.xyz/http"],webSocket:["wss://xr1.calderachain.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://xr1.calderaexplorer.xyz"}},testnet:!1}),X_=p({id:144e4,name:"XRPL EVM",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.xrplevm.org"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.xrplevm.org",apiUrl:"https://explorer.xrplevm.org/api/v2"}},testnet:!1}),Q_=p({id:1440002,name:"XRPL EVM Devnet",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.xrplevm.org/"]},public:{http:["https://rpc.xrplevm.org/"]}},blockExplorers:{default:{name:"XRPLEVM Devnet Explorer",url:"https://explorer.xrplevm.org/"}},contracts:{multicall3:{address:"0x82Cc144D7d0AD4B1c27cb41420e82b82Ad6e9B31",blockCreated:15237286}},testnet:!0}),J_=p({id:1449e3,name:"XRPL EVM Testnet",nativeCurrency:{name:"XRP",symbol:"XRP",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.xrplevm.org"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.testnet.xrplevm.org",apiUrl:"https://explorer.testnet.xrplevm.org/api/v2"}},contracts:{multicall3:{address:"0x82Cc144D7d0AD4B1c27cb41420e82b82Ad6e9B31",blockCreated:492302}},testnet:!0}),eM=p({id:2730,name:"XR Sepolia",nativeCurrency:{decimals:18,name:"tXR",symbol:"tXR"},rpcUrls:{default:{http:["https://xr-sepolia-testnet.rpc.caldera.xyz/http"]}},blockExplorers:{default:{name:"Blockscout",url:"https://xr-sepolia-testnet.explorer.caldera.xyz"}},testnet:!0}),tM=p({id:50005,name:"Yooldo Verse",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Explorer",url:"https://explorer.yooldo-verse.xyz"}}}),rM=p({id:50006,name:"Yooldo Verse Testnet",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Testnet Explorer",url:"https://explorer.testnet.yooldo-verse.xyz"}},testnet:!0}),nM=p({id:8408,name:"ZenChain Testnet",nativeCurrency:{decimals:18,name:"ZTC",symbol:"ZTC"},rpcUrls:{default:{http:["https://zenchain-testnet.api.onfinality.io/public"],webSocket:["wss://zenchain-testnet.api.onfinality.io/public-ws"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:230019}},blockExplorers:{default:{name:"Zentrace",url:"https://zentrace.io"}},testnet:!0}),sM=p({id:383414847825,name:"Zeniq Mainnet",nativeCurrency:{name:"ZENIQ",symbol:"ZENIQ",decimals:18},rpcUrls:{default:{http:["https://api.zeniq.network"]}},blockExplorers:{default:{name:"Zeniq Explorer",url:"https://zeniqscan.com"}},testnet:!1}),aM=p({id:543210,name:"Zero Network",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zerion.io/v1/zero"]}},blockExplorers:{default:{name:"Zero Network Explorer",url:"https://explorer.zero.network"}},testnet:!1}),oM=p({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1632781}},blockExplorers:{default:{name:"ZetaScan",url:"https://zetascan.com"}},testnet:!1}),iM=p({id:7001,name:"ZetaChain Athens Testnet",nativeCurrency:{decimals:18,name:"Zeta",symbol:"aZETA"},rpcUrls:{default:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2715217}},blockExplorers:{default:{name:"ZetaScan",url:"https://testnet.zetascan.com"}},testnet:!0}),cM=p({id:1337803,name:"Zhejiang",nativeCurrency:{name:"Zhejiang Ether",symbol:"ZhejETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zhejiang.ethpandaops.io"]}},blockExplorers:{default:{name:"Beaconchain",url:"https://zhejiang.beaconcha.in"}},testnet:!0}),lM=p({id:32769,name:"Zilliqa",network:"zilliqa",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.zilliqa.com"}},testnet:!1}),uM=p({id:33101,name:"Zilliqa Testnet",network:"zilliqa-testnet",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://dev-api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.testnet.zilliqa.com"}},testnet:!0}),kf=1,dM=p({...V,id:48900,name:"Zircuit Mainnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.zircuit.com","https://zircuit1-mainnet.liquify.com","https://zircuit1-mainnet.p2pify.com","https://zircuit-mainnet.drpc.org"]}},blockExplorers:{default:{name:"Zircuit Explorer",url:"https://explorer.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"},l2OutputOracle:{[kf]:{address:"0x92Ef6Af472b39F1b363da45E35530c24619245A4"}},portal:{[kf]:{address:"0x17bfAfA932d2e23Bd9B909Fd5B4D2e2a27043fb1"}},l1StandardBridge:{[kf]:{address:"0x386B76D9cA5F5Fb150B6BFB35CF5379B22B26dd8"}}},testnet:!1}),Cf=11155111,pM=p({...V,id:48898,name:"Zircuit Garfield Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://garfield-testnet.zircuit.com/"]}},blockExplorers:{default:{name:"Zircuit Garfield Testnet Explorer",url:"https://explorer.garfield-testnet.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"},l2OutputOracle:{[Cf]:{address:"0xd69D3AC5CA686cCF94b258291772bc520FEAf211"}},portal:{[Cf]:{address:"0x4E21A71Ac3F7607Da5c06153A17B1DD20E702c21"}},l1StandardBridge:{[Cf]:{address:"0x87a7E2bCA9E35BA49282E832a28A6023904460D8"}}},testnet:!0}),Tf=11155111,fM=p({...V,id:48899,name:"Zircuit Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.zircuit.com","https://zircuit1-testnet.p2pify.com","https://zircuit1-testnet.liquify.com"]}},blockExplorers:{default:{name:"Zircuit Testnet Explorer",url:"https://explorer.testnet.zircuit.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:6040287},l2OutputOracle:{[Tf]:{address:"0x740C2dac453aEf7140809F80b72bf0e647af8148"}},portal:{[Tf]:{address:"0x787f1C8c5924178689E0560a43D848bF8E54b23e"}},l1StandardBridge:{[Tf]:{address:"0x0545c5fe980098C16fcD0eCB5E79753afa6d9af9"}}},testnet:!0}),mM=p({id:42766,name:"ZKFair Mainnet",network:"zkfair-mainnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://scan.zkfair.io",apiUrl:"https://scan.zkfair.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6090959}},testnet:!1}),hM=p({id:43851,name:"ZKFair Testnet",network:"zkfair-testnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://testnet-rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://testnet-scan.zkfair.io"}},testnet:!0}),bM=p({id:810180,name:"zkLink Nova",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zklink.io"]}},blockExplorers:{default:{name:"zkLink Nova Block Explorer",url:"https://explorer.zklink.io"}}}),yM=p({id:810181,name:"zkLink Nova Sepolia Testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zklink.io"]}},blockExplorers:{default:{name:"zkLink Nova Block Explorer",url:"https://sepolia.explorer.zklink.io"}}}),Rg=p({...ur,blockTime:200,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),Hg=p({...ur,id:260,name:"ZKsync InMemory Node",network:"zksync-in-memory-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8011"]}},testnet:!0}),gM=p({...ur,id:272,name:"ZKsync CLI Local Custom Hyperchain",nativeCurrency:{name:"BAT",symbol:"BAT",decimals:18},rpcUrls:{default:{http:["http://localhost:15200"],webSocket:["ws://localhost:15201"]}},blockExplorers:{default:{name:"ZKsync explorer",url:"http://localhost:15005/",apiUrl:"http://localhost:15005/api"}},testnet:!0}),xM=p({...ur,id:270,name:"ZKsync CLI Local Hyperchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:15100"],webSocket:["ws://localhost:15101"]}},blockExplorers:{default:{name:"ZKsync explorer",url:"http://localhost:15005/",apiUrl:"http://localhost:15005/api"}},testnet:!0}),wM=p({id:9,name:"ZKsync CLI Local Hyperchain L1",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:15045"]}},blockExplorers:{default:{name:"Blockscout",url:"http://localhost:15001/",apiUrl:"http://localhost:15001/api/v2"}},testnet:!0}),$g=p({...ur,id:270,name:"ZKsync CLI Local Node",network:"zksync-cli-local-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:3050"]}},testnet:!0}),Gg=p({...ur,blockTime:200,id:300,name:"ZKsync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia-era.zksync.network/",apiUrl:"https://api-sepolia-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://sepolia.explorer.zksync.io/",blockExplorerApi:"https://block-explorer-api.sepolia.zksync.dev/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:3855712}},testnet:!0}),ql=1,vM=p({...V,id:7777777,name:"Zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy",apiUrl:"https://explorer.zora.energy/api"}},contracts:{...V.contracts,l2OutputOracle:{[ql]:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{[ql]:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{[ql]:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:ql}),Yl=11155111,EM=p({...V,id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/",apiUrl:"https://sepolia.explorer.zora.energy/api"}},contracts:{...V.contracts,l2OutputOracle:{[Yl]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[Yl]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[Yl]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:Yl,testnet:!0}),jg=5,kM=p({...V,id:999,name:"Zora Goerli Testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy",apiUrl:"https://testnet.explorer.zora.energy/api"}},contracts:{...V.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{[jg]:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:jg,testnet:!0}),CM=Object.freeze(Object.defineProperty({__proto__:null,abey:j3,abstract:Bv,abstractTestnet:Fv,acala:Uv,acria:Ov,adf:Dv,agungTestnet:_v,aioz:Mv,alephZero:Nv,alephZeroTestnet:Lv,alienx:zv,alienxHalTestnet:Rv,ancient8:Vv,ancient8Sepolia:Wv,anvil:qv,apeChain:Yv,apexTestnet:Kv,apollo:Zv,arbitrum:Xv,arbitrumGoerli:Qv,arbitrumNova:Jv,arbitrumSepolia:eE,arcTestnet:tE,arenaz:rE,areonNetwork:nE,areonNetworkTestnet:sE,areum:aE,artelaTestnet:oE,arthera:iE,artheraTestnet:cE,assetChain:lE,assetChainTestnet:uE,astar:dE,astarZkEVM:pE,astarZkyoto:fE,atletaOlympia:mE,aurora:hE,auroraTestnet:bE,auroria:yE,autheoTestnet:gE,avalanche:xE,avalancheFuji:wE,b3:vE,b3Sepolia:EE,bahamut:kE,base:pb,baseGoerli:SE,basePreconf:CE,baseSepolia:fb,baseSepoliaPreconf:AE,basecampTestnet:TE,beam:PE,beamTestnet:IE,bearNetworkChainMainnet:BE,bearNetworkChainTestnet:FE,berachain:UE,berachainBepolia:OE,berachainTestnet:DE,berachainTestnetbArtio:_E,bevmMainnet:ME,bifrost:NE,birdlayer:LE,bitTorrent:VE,bitTorrentTestnet:WE,bitgert:zE,bitkub:RE,bitkubTestnet:HE,bitlayer:$E,bitlayerTestnet:GE,bitrock:jE,blast:qE,blastSepolia:YE,bob:KE,bobSepolia:QE,boba:ZE,bobaSepolia:XE,boolBetaMainnet:JE,botanix:ek,botanixTestnet:tk,bounceBit:rk,bounceBitTestnet:nk,bronos:sk,bronosTestnet:ak,bsc:ok,bscGreenfield:ik,bscTestnet:ck,bsquared:lk,bsquaredTestnet:uk,btr:dk,btrTestnet:pk,bxn:fk,bxnTestnet:mk,cannon:hk,canto:bk,celo:Ak,celoAlfajores:Pk,celoSepolia:Ik,chang:Bk,chiliz:Fk,chips:Uk,citreaTestnet:Ok,classic:Dk,coinbit:_k,coinex:Mk,confluxESpace:Nk,confluxESpaceTestnet:Lk,coreDao:zk,coreTestnet1:Rk,coreTestnet2:Hk,corn:$k,cornTestnet:Gk,crab:jk,creatorTestnet:Vk,creditCoin3Devnet:Wk,creditCoin3Mainnet:qk,creditCoin3Testnet:Yk,cronos:Kk,cronosTestnet:Zk,cronoszkEVM:Xk,cronoszkEVMTestnet:Qk,crossbell:Jk,crossfi:e7,curtis:t7,cyber:r7,cyberTestnet:n7,dailyNetwork:s7,dailyNetworkTestnet:a7,darwinia:o7,datahavenTestnet:i7,dbkchain:c7,dchain:l7,dchainTestnet:u7,defichainEvm:d7,defichainEvmTestnet:p7,degen:f7,dfk:m7,diode:h7,disChain:b7,dodochainTestnet:y7,dogechain:g7,domaTestnet:x7,donatuz:w7,dosChain:v7,dosChainTestnet:E7,dreyerxMainnet:k7,dreyerxTestnet:C7,dustboyIoT:T7,dymension:S7,edexa:A7,edexaTestnet:P7,edgeless:I7,edgelessTestnet:B7,edgeware:F7,edgewareTestnet:U7,eduChain:O7,eduChainTestnet:D7,ekta:_7,ektaTestnet:M7,elastos:N7,elastosTestnet:L7,electroneum:z7,electroneumTestnet:R7,elysiumTestnet:H7,energy:$7,eni:G7,eniTestnet:j7,enuls:V7,eon:W7,eos:q7,eosTestnet:Y7,eteria:K7,etherlink:Z7,etherlinkShadownetTestnet:X7,etherlinkTestnet:Q7,ethernity:J7,etp:eC,evmos:tC,evmosTestnet:rC,excelonMainnet:nC,expanse:sC,exsat:aC,exsatTestnet:oC,fantom:iC,fantomSonicTestnet:cC,fantomTestnet:lC,fibo:uC,filecoin:dC,filecoinCalibration:pC,filecoinHyperspace:fC,fireChain:G3,flame:mC,flare:hC,flareTestnet:bC,flowMainnet:yC,flowPreviewnet:gC,flowTestnet:xC,fluence:wC,fluenceStage:vC,fluenceTestnet:EC,fluentTestnet:kC,form:CC,formTestnet:SC,forma:TC,formicarium:sA,forta:AC,foundry:PC,fraxtal:IC,fraxtalTestnet:BC,funkiMainnet:FC,funkiSepolia:UC,fuse:OC,fuseSparknet:DC,fusion:_C,fusionTestnet:MC,garnet:NC,gatechain:LC,geist:zC,genesys:RC,giwaSepolia:bb,giwaSepoliaPreconf:HC,glideL1Protocol:$C,glideL2Protocol:GC,gnosis:jC,gnosisChiado:VC,goChain:YC,goat:WC,gobi:qC,godwoken:KC,goerli:ZC,graphite:XC,graphiteTestnet:QC,gravity:JC,gunz:e9,guruNetwork:t9,guruTestnet:r9,ham:n9,happychainTestnet:s9,haqqMainnet:a9,haqqTestedge2:o9,hardhat:i9,harmonyOne:c9,hashkey:l9,hashkeyTestnet:u9,haustTestnet:d9,hedera:p9,hederaPreviewnet:f9,hederaTestnet:m9,hela:h9,heliosTestnet:b9,hemi:y9,hemiSepolia:g9,henesys:x9,holesky:w9,hoodi:v9,hpb:E9,hpp:k9,hppSepolia:C9,huddle01Mainnet:T9,huddle01Testnet:S9,humanity:A9,humanityTestnet:P9,humanode:I9,humanodeTestnet5:B9,hychain:F9,hychainTestnet:U9,hyperEvm:yb,hyperliquid:yb,hyperliquidEvmTestnet:O9,iSunCoin:K9,icbNetwork:D9,idchain:_9,immutableZkEvm:M9,immutableZkEvmTestnet:N9,inEVM:L9,initVerse:z9,initVerseGenesis:R9,injective:H9,injectiveTestnet:$9,ink:G9,inkSepolia:j9,iota:V9,iotaTestnet:W9,iotex:q9,iotexTestnet:Y9,jasmyChain:Z9,jasmyChainTestnet:X9,jbc:Q9,jbcTestnet:J9,jocMainnet:eT,jocTestnet:tT,jovay:rT,jovaySepolia:nT,juneo:sT,juneoBCH1Chain:aT,juneoDAI1Chain:oT,juneoDOGE1Chain:iT,juneoEUR1Chain:cT,juneoGLD1Chain:lT,juneoLINK1Chain:uT,juneoLTC1Chain:dT,juneoSGD1Chain:fT,juneoSocotraTestnet:mT,juneoUSD1Chain:hT,juneoUSDT1Chain:bT,juneomBTC1Chain:pT,kaia:yT,kairos:gT,kakarotSepolia:xT,kakarotStarknetSepolia:wT,kardiaChain:vT,karura:ET,katana:kT,kava:CT,kavaTestnet:TT,kcc:ST,kiiTestnetOro:AT,kinto:PT,klaytn:IT,klaytnBaobab:BT,koi:FT,kroma:UT,kromaSepolia:OT,l3x:DT,l3xTestnet:_T,lavita:MT,lens:NT,lensTestnet:LT,lestnet:zT,lightlinkPegasus:RT,lightlinkPhoenix:HT,linea:kS,lineaGoerli:CS,lineaSepolia:TS,lineaTestnet:SS,lisk:AS,liskSepolia:PS,loadAlphanet:IS,localhost:BS,loop:FS,lukso:US,luksoTestnet:OS,lumiaMainnet:DS,lumiaTestnet:_S,lumoz:MS,lumozTestnet:NS,lycan:LS,lyra:zS,mainnet:RS,mandala:HS,manta:$S,mantaSepoliaTestnet:GS,mantaTestnet:jS,mantle:VS,mantleSepoliaTestnet:WS,mantleTestnet:qS,mantraDuKongEVMTestnet:YS,mantraEVM:KS,mapProtocol:ZS,matchain:XS,matchainTestnet:QS,mchVerse:JS,megaethTestnet:eA,mekong:tA,meld:rA,memecore:nA,merlin:aA,merlinErigonTestnet:oA,metachain:iA,metachainIstanbul:cA,metadium:lA,metalL2:uA,meter:dA,meterTestnet:pA,metis:fA,metisGoerli:mA,metisSepolia:hA,mev:bA,mevTestnet:yA,mint:gA,mintSepoliaTestnet:xA,mitosisTestnet:wA,mode:vA,modeTestnet:EA,monad:kA,monadTestnet:CA,moonbaseAlpha:TA,moonbeam:SA,moonbeamDev:AA,moonriver:PA,morph:IA,morphHolesky:BA,morphSepolia:FA,nahmii:UA,nautilus:OA,near:DA,nearTestnet:_A,neonDevnet:MA,neonMainnet:NA,neoxMainnet:LA,neoxT4:zA,newton:RA,nexi:HA,nexilix:$A,nibiru:GA,nitrographTestnet:jA,nomina:VA,oasisTestnet:WA,oasys:qA,odysseyTestnet:YA,okc:KA,omax:ZA,omni:XA,omniOmega:QA,oneWorld:JA,oortMainnetDev:eP,opBNB:tP,opBNBTestnet:rP,openledger:nP,optimism:sP,optimismGoerli:aP,optimismSepolia:oP,optopia:iP,optopiaTestnet:cP,orderly:lP,orderlySepolia:uP,otimDevnet:dP,palm:pP,palmTestnet:fP,peaq:mP,pgn:hP,pgnTestnet:bP,phoenix:yP,planq:gP,plasma:xP,plasmaDevnet:wP,plasmaTestnet:vP,playfiAlbireo:EP,plinga:kP,plume:CP,plumeDevnet:TP,plumeMainnet:SP,plumeSepolia:AP,plumeTestnet:PP,polterTestnet:IP,polygon:BP,polygonAmoy:FP,polygonMumbai:UP,polygonZkEvm:OP,polygonZkEvmCardona:DP,polygonZkEvmTestnet:_P,polynomial:MP,polynomialSepolia:NP,potos:LP,potosTestnet:zP,premiumBlockTestnet:RP,pulsechain:HP,pulsechainV4:$P,pumpfiTestnet:GP,pyrope:jP,qMainnet:WP,qTestnet:qP,ql1:VP,quai:YP,quaiTestnet:KP,reactiveTestnet:ZP,real:XP,redbellyMainnet:QP,redbellyTestnet:JP,reddio:eI,reddioSepolia:tI,redstone:rI,rei:nI,reyaNetwork:sI,riseTestnet:aI,rivalz:oI,rollux:iI,rolluxTestnet:cI,ronin:lI,root:uI,rootPorcini:dI,rootstock:pI,rootstockTestnet:fI,rss3:mI,rss3Sepolia:hI,saakuru:bI,saga:yI,saigon:gI,sanko:xI,sapphire:wI,sapphireTestnet:vI,satoshiVM:EI,satoshiVMTestnet:kI,scroll:CI,scrollSepolia:TI,sei:SI,seiDevnet:AI,seiTestnet:II,seismicDevnet:PI,sepolia:BI,shape:FI,shapeSepolia:UI,shardeum:OI,shardeumSphinx:DI,shibarium:_I,shibariumTestnet:MI,shiden:NI,shimmer:LI,shimmerTestnet:zI,sidraChain:RI,silentData:HI,silicon:$I,siliconSepolia:GI,sixProtocol:jI,skaleBase:nB,skaleBaseSepoliaTestnet:sB,skaleBlockBrawlers:VI,skaleCalypso:WI,skaleCalypsoTestnet:qI,skaleCryptoBlades:YI,skaleCryptoColosseum:KI,skaleEuropa:ZI,skaleEuropaTestnet:XI,skaleExorde:QI,skaleHumanProtocol:JI,skaleNebula:eB,skaleNebulaTestnet:tB,skaleRazor:rB,skaleTitan:aB,skaleTitanTestnet:oB,sketchpad:iB,snax:cB,snaxTestnet:lB,somnia:uB,somniaTestnet:dB,soneium:pB,soneiumMinato:fB,songbird:mB,songbirdTestnet:hB,sonic:bB,sonicBlazeTestnet:yB,sonicTestnet:gB,sophon:xB,sophonTestnet:wB,sova:vB,sovaSepolia:EB,spicy:kB,stableTestnet:CB,statusNetworkSepolia:ey,statusSepolia:ey,step:TB,story:SB,storyAeneid:AB,storyOdyssey:PB,storyTestnet:IB,stratis:BB,superlumio:FB,superposition:UB,superseed:OB,superseedSepolia:DB,surgeTestnet:_B,swan:MB,swanProximaTestnet:NB,swanSaturnTestnet:LB,swellchain:zB,swellchainTestnet:RB,swissdlt:HB,syscoin:$B,syscoinTestnet:GB,tac:jB,tacSPB:VB,taiko:WB,taikoHekla:qB,taikoHoodi:YB,taikoJolnir:KB,taikoKatla:ZB,taikoTestnetSepolia:XB,taraxa:QB,taraxaTestnet:JB,teaSepolia:eF,telcoinTestnet:tF,telos:rF,telosTestnet:nF,tempoDevnet:VD,tempoLocalnet:WD,tempoTestnet:qD,tenet:YD,ternoa:KD,thaiChain:ZD,that:XD,theta:QD,thetaTestnet:JD,thunderCore:e_,thunderTestnet:t_,tiktrixTestnet:r_,tomb:n_,treasure:s_,treasureTopaz:a_,tron:o_,tronNile:i_,tronShasta:c_,ubiq:l_,ultra:u_,ultraTestnet:d_,ultron:p_,ultronTestnet:f_,unichain:m_,unichainSepolia:h_,unique:b_,uniqueOpal:y_,uniqueQuartz:g_,unreal:x_,vana:w_,vanaMoksha:v_,vanar:E_,vechain:k_,velas:C_,viction:T_,victionTestnet:S_,vision:A_,visionTestnet:P_,wanchain:I_,wanchainTestnet:B_,weaveVMAlphanet:F_,wemix:U_,wemixTestnet:O_,westendAssetHub:D_,whitechain:__,whitechainTestnet:M_,wmcTestnet:N_,worldLand:R_,worldchain:L_,worldchainSepolia:z_,x1Testnet:zg,xLayer:V_,xLayerTestnet:zg,xai:H_,xaiTestnet:$_,xdc:G_,xdcTestnet:j_,xoneMainnet:W_,xoneTestnet:q_,xphereMainnet:Y_,xphereTestnet:K_,xrOne:Z_,xrSepolia:eM,xrplevm:X_,xrplevmDevnet:Q_,xrplevmTestnet:J_,yooldoVerse:tM,yooldoVerseTestnet:rM,zenchainTestnet:nM,zeniq:sM,zeroG:z3,zeroGGalileoTestnet:R3,zeroGMainnet:H3,zeroGTestnet:$3,zeroNetwork:aM,zetachain:oM,zetachainAthensTestnet:iM,zhejiang:cM,zilliqa:lM,zilliqaTestnet:uM,zircuit:dM,zircuitGarfieldTestnet:pM,zircuitTestnet:fM,zkFair:mM,zkFairTestnet:hM,zkLinkNova:bM,zkLinkNovaSepoliaTestnet:yM,zkSync:Rg,zkSyncInMemoryNode:Hg,zkSyncLocalNode:$g,zkSyncSepoliaTestnet:Gg,zksync:Rg,zksyncInMemoryNode:Hg,zksyncLocalCustomHyperchain:gM,zksyncLocalHyperchain:xM,zksyncLocalHyperchainL1:wM,zksyncLocalNode:$g,zksyncSepoliaTestnet:Gg,zora:vM,zoraSepolia:EM,zoraTestnet:kM},Symbol.toStringTag,{value:"Module"}));class TM extends ${constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Vg="/docs/contract/encodeEventTopics";function Hi(e){var c;const{abi:t,eventName:r,args:n}=e;let s=t[0];if(r){const l=$s({abi:t,name:r});if(!l)throw new kb(r,{docsPath:Vg});s=l}if(s.type!=="event")throw new kb(void 0,{docsPath:Vg});const a=Mr(s),o=il(a);let i=[];if(n&&"inputs"in s){const l=(c=s.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(d=>n[d.name]))??[]:[];u.length>0&&(i=(l==null?void 0:l.map((d,f)=>Array.isArray(u[f])?u[f].map((m,y)=>Wg({param:d,value:u[f][y]})):typeof u[f]<"u"&&u[f]!==null?Wg({param:d,value:u[f]}):null))??[])}return[o,...i]}function Wg({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Ut(wn(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new TM(e.type);return os([e],[t])}function Kl(e,{method:t}){var n,s;const r={};return e.transport.type==="fallback"&&((s=(n=e.transport).onResponse)==null||s.call(n,({method:a,response:o,status:i,transport:c})=>{i==="success"&&t===a&&(r[o]=c.request)})),(a=>r[a]||e.request)}async function qg(e,t){const{address:r,abi:n,args:s,eventName:a,fromBlock:o,strict:i,toBlock:c}=t,l=Kl(e,{method:"eth_newFilter"}),u=a?Hi({abi:n,args:s,eventName:a}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?q(o):o,toBlock:typeof c=="bigint"?q(c):c,topics:u}]});return{abi:n,args:s,eventName:a,id:d,request:l(d),strict:!!i,type:"event"}}class SM extends ${constructor(t,{account:r,docsPath:n,chain:s,data:a,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var y;const m=No({from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${Md(f)} ${((y=s==null?void 0:s.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof i<"u"&&`${Xt(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${Xt(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Xt(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",m].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function AM(e,{docsPath:t,...r}){const n=(()=>{const s=ll(e,r);return s instanceof zo?e:s})();return new SM(n,{docsPath:t,...r})}class Yg extends ${constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Sf extends ${constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class PM extends ${constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Xt(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Kg extends ${constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}async function Rr(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:s}={}){var l,u,d;const a=s??!1,o=r!==void 0?q(r):void 0;let i=null;if(t?i=await e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):i=await e.request({method:"eth_getBlockByNumber",params:[o||n,a]},{dedupe:!!o}),!i)throw new Kg({blockHash:t,blockNumber:r});return(((d=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:d.format)||Bd)(i,"getBlock")}async function Af(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function IM(e,t){return Zg(e,t)}async function Zg(e,t){var a,o;const{block:r,chain:n=e.chain,request:s}=t||{};try{const i=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof i=="function"){const l=r||await se(e,Rr,"getBlock")({}),u=await i({block:l,client:e,request:s});if(u===null)throw new Error;return u}if(typeof i<"u")return i;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return Le(c)}catch{const[i,c]=await Promise.all([r?Promise.resolve(r):se(e,Rr,"getBlock")({}),se(e,Af,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new Sf;const l=c-i.baseFeePerGas;return l<0n?0n:l}}async function BM(e,t){return Pf(e,t)}async function Pf(e,t){var f,m;const{block:r,chain:n=e.chain,request:s,type:a="eip1559"}=t||{},o=await(async()=>{var y,g;return typeof((y=n==null?void 0:n.fees)==null?void 0:y.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:s}):((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(o<1)throw new Yg;const c=10**(((f=o.toString().split(".")[1])==null?void 0:f.length)??0),l=y=>y*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await se(e,Rr,"getBlock")({});if(typeof((m=n==null?void 0:n.fees)==null?void 0:m.estimateFeesPerGas)=="function"){const y=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:l,request:s,type:a});if(y!==null)return y}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Sf;const y=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await Zg(e,{block:u,chain:n,request:s}),g=l(u.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??g+y,maxPriorityFeePerGas:y}}return{gasPrice:(s==null?void 0:s.gasPrice)??l(await se(e,Af,"getGasPrice")({}))}}async function If(e,{address:t,blockTag:r="latest",blockNumber:n}){const s=await e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?q(n):r]},{dedupe:!!n});return ir(s)}function Zl(e,{docsPath:t,...r}){const n=(()=>{const s=ll(e,r);return s instanceof zo?e:s})();return new h8(n,{docsPath:t,...r})}async function ls(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return ir(t)}async function Bf(e,t){var h,b,x,A,I;const{account:r=e.account,accessList:n,authorizationList:s,chain:a=e.chain,blobVersionedHashes:o,blobs:i,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:y,nonceManager:g,to:E,type:w,value:v,...S}=t,C=await(async()=>{if(!r||!g||typeof y<"u")return y;const F=Ke(r),_=a?a.id:await se(e,ls,"getChainId")({});return await g.consume({address:F.address,chainId:_,client:e})})();rn(t);const D=(b=(h=a==null?void 0:a.formatters)==null?void 0:h.transactionRequest)==null?void 0:b.format,T=(D||_r)({...Ws(S,{format:D}),account:r?Ke(r):void 0,accessList:n,authorizationList:s,blobs:i,blobVersionedHashes:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:C,to:E,type:w,value:v},"fillTransaction");try{const F=await e.request({method:"eth_fillTransaction",params:[T]}),k=(((A=(x=a==null?void 0:a.formatters)==null?void 0:x.transaction)==null?void 0:A.format)||Ns)(F.tx);delete k.blockHash,delete k.blockNumber,delete k.r,delete k.s,delete k.transactionIndex,delete k.v,delete k.yParity,k.data=k.input,k.gas&&(k.gas=t.gas??k.gas),k.gasPrice&&(k.gasPrice=t.gasPrice??k.gasPrice),k.maxFeePerBlobGas&&(k.maxFeePerBlobGas=t.maxFeePerBlobGas??k.maxFeePerBlobGas),k.maxFeePerGas&&(k.maxFeePerGas=t.maxFeePerGas??k.maxFeePerGas),k.maxPriorityFeePerGas&&(k.maxPriorityFeePerGas=t.maxPriorityFeePerGas??k.maxPriorityFeePerGas),k.nonce&&(k.nonce=t.nonce??k.nonce);const P=await(async()=>{var H,G;if(typeof((H=a==null?void 0:a.fees)==null?void 0:H.baseFeeMultiplier)=="function"){const J=await se(e,Rr,"getBlock")({});return a.fees.baseFeeMultiplier({block:J,client:e,request:t})}return((G=a==null?void 0:a.fees)==null?void 0:G.baseFeeMultiplier)??1.2})();if(P<1)throw new Yg;const U=10**(((I=P.toString().split(".")[1])==null?void 0:I.length)??0),z=H=>H*BigInt(Math.ceil(P*U))/BigInt(U);return k.maxFeePerGas&&!t.maxFeePerGas&&(k.maxFeePerGas=z(k.maxFeePerGas)),k.gasPrice&&!t.gasPrice&&(k.gasPrice=z(k.gasPrice)),{raw:F.raw,transaction:{from:T.from,...k}}}catch(F){throw Zl(F,{...t,chain:e.chain})}}const Ff=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Xg=new Map,Uf=new Da(128);async function $i(e,t){var C,D,L;let r=t;r.account??(r.account=e.account),r.parameters??(r.parameters=Ff);const{account:n,chain:s=e.chain,nonceManager:a,parameters:o}=r,i=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let c;async function l(){return c||(typeof r.chainId<"u"?r.chainId:s?s.id:(c=await se(e,ls,"getChainId")({}),c))}const u=n&&Ke(n);let d=r.nonce;if(o.includes("nonce")&&typeof d>"u"&&u&&a){const T=await l();d=await a.consume({address:u.address,chainId:T,client:e})}i!=null&&i.fn&&((C=i.runAt)!=null&&C.includes("beforeFillTransaction"))&&(r=await i.fn({...r,chain:s},{phase:"beforeFillTransaction"}),d??(d=r.nonce));const m=((o.includes("blobVersionedHashes")||o.includes("sidecars"))&&r.kzg&&r.blobs||Uf.get(e.uid)===!1||!["fees","gas"].some(h=>o.includes(h))?!1:!!(o.includes("chainId")&&typeof r.chainId!="number"||o.includes("nonce")&&typeof d!="number"||o.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||o.includes("gas")&&typeof r.gas!="bigint"))?await se(e,Bf,"fillTransaction")({...r,nonce:d}).then(T=>{const{chainId:h,from:b,gas:x,gasPrice:A,nonce:I,maxFeePerBlobGas:F,maxFeePerGas:_,maxPriorityFeePerGas:k,type:P,...O}=T.transaction;return Uf.set(e.uid,!0),{...r,...b?{from:b}:{},...P?{type:P}:{},...typeof h<"u"?{chainId:h}:{},...typeof x<"u"?{gas:x}:{},...typeof A<"u"?{gasPrice:A}:{},...typeof I<"u"?{nonce:I}:{},...typeof F<"u"?{maxFeePerBlobGas:F}:{},...typeof _<"u"?{maxFeePerGas:_}:{},...typeof k<"u"?{maxPriorityFeePerGas:k}:{},..."nonceKey"in O&&typeof O.nonceKey<"u"?{nonceKey:O.nonceKey}:{}}}).catch(T=>{var x;const h=T;return h.name!=="TransactionExecutionError"||((x=h.walk)==null?void 0:x.call(h,A=>{const I=A;return I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError"}))&&Uf.set(e.uid,!1),r}):r;d??(d=m.nonce),r={...m,...u?{from:u==null?void 0:u.address}:{},...d?{nonce:d}:{}};const{blobs:y,gas:g,kzg:E,type:w}=r;i!=null&&i.fn&&((D=i.runAt)!=null&&D.includes("beforeFillParameters"))&&(r=await i.fn({...r,chain:s},{phase:"beforeFillParameters"}));let v;async function S(){return v||(v=await se(e,Rr,"getBlock")({blockTag:"latest"}),v)}if(o.includes("nonce")&&typeof d>"u"&&u&&!a&&(r.nonce=await se(e,If,"getTransactionCount")({address:u.address,blockTag:"pending"})),(o.includes("blobVersionedHashes")||o.includes("sidecars"))&&y&&E){const T=Nd({blobs:y,kzg:E});if(o.includes("blobVersionedHashes")){const h=G1({commitments:T,to:"hex"});r.blobVersionedHashes=h}if(o.includes("sidecars")){const h=Ld({blobs:y,commitments:T,kzg:E}),b=Z1({blobs:y,commitments:T,proofs:h,to:"hex"});r.sidecars=b}}if(o.includes("chainId")&&(r.chainId=await l()),(o.includes("fees")||o.includes("type"))&&typeof w>"u")try{r.type=sp(r)}catch{let T=Xg.get(e.uid);if(typeof T>"u"){const h=await S();T=typeof(h==null?void 0:h.baseFeePerGas)=="bigint",Xg.set(e.uid,T)}r.type=T?"eip1559":"legacy"}if(o.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const T=await S(),{maxFeePerGas:h,maxPriorityFeePerGas:b}=await Pf(e,{block:T,chain:s,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<b)throw new PM({maxPriorityFeePerGas:b});r.maxPriorityFeePerGas=b,r.maxFeePerGas=h}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new Sf;if(typeof r.gasPrice>"u"){const T=await S(),{gasPrice:h}=await Pf(e,{block:T,chain:s,request:r,type:"legacy"});r.gasPrice=h}}return o.includes("gas")&&typeof g>"u"&&(r.gas=await se(e,Of,"estimateGas")({...r,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),i!=null&&i.fn&&((L=i.runAt)!=null&&L.includes("afterFillParameters"))&&(r=await i.fn({...r,chain:s},{phase:"afterFillParameters"})),rn(r),delete r.parameters,r}async function Of(e,t){var o,i,c;const{account:r=e.account,prepare:n=!0}=t,s=r?Ke(r):void 0,a=(()=>{if(Array.isArray(n))return n;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await jl({authorization:t.authorizationList[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:m,blockNumber:y,blockTag:g,data:E,gas:w,gasPrice:v,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:D,nonce:L,value:T,stateOverride:h,...b}=n?await $i(e,{...t,parameters:a,to:l}):t;if(w&&t.gas!==w)return w;const A=(typeof y=="bigint"?q(y):void 0)||g,I=gf(h);rn(t);const F=(c=(i=(o=e.chain)==null?void 0:o.formatters)==null?void 0:i.transactionRequest)==null?void 0:c.format,k=(F||_r)({...Ws(b,{format:F}),account:s,accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:m,data:E,gasPrice:v,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:D,nonce:L,to:l,value:T},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:I?[k,A??e.experimental_blockTag??"latest",I]:A?[k,A]:[k]}))}catch(l){throw AM(l,{...t,account:s,chain:e.chain})}}async function FM(e,t){const{abi:r,address:n,args:s,functionName:a,dataSuffix:o,...i}=t,c=fr({abi:r,args:s,functionName:a});try{return await se(e,Of,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:n,...i})}catch(l){const u=i.account?Ke(i.account):void 0;throw Js(l,{abi:r,address:n,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:u==null?void 0:u.address})}}const Qg="/docs/contract/decodeEventLog";function Xl(e){const{abi:t,data:r,strict:n,topics:s}=e,a=n??!0,[o,...i]=s;if(!o)throw new ZT({docsPath:Qg});const c=t.find(g=>g.type==="event"&&o===il(Mr(g)));if(!(c&&"name"in c)||c.type!=="event")throw new XT(o,{docsPath:Qg});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(g=>!("name"in g&&g.name)),f=d?[]:{},m=u.map((g,E)=>[g,E]).filter(([g])=>"indexed"in g&&g.indexed);for(let g=0;g<m.length;g++){const[E,w]=m[g],v=i[g];if(!v)throw new up({abiItem:c,param:E});f[d?w:E.name||w]=UM({param:E,value:v})}const y=u.filter(g=>!("indexed"in g&&g.indexed));if(y.length>0){if(r&&r!=="0x")try{const g=Ko(y,r);if(g)if(d)for(let E=0;E<u.length;E++)f[E]=f[E]??g.shift();else for(let E=0;E<y.length;E++)f[y[E].name]=g[E]}catch(g){if(a)throw g instanceof wb||g instanceof T1?new sl({abiItem:c,data:r,params:y,size:lt(r)}):g}else if(a)throw new sl({abiItem:c,data:"0x",params:y,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function UM({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Ko([e],t)||[])[0]}function Df(e){const{abi:t,args:r,logs:n,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return n.map(o=>{var u;const i=t.filter(d=>d.type==="event"&&o.topics[0]===il(d));if(i.length===0)return null;let c,l;for(const d of i)try{c=Xl({...o,abi:[d],strict:!0}),l=d;break}catch{}if(!c&&!s){l=i[0];try{c=Xl({...o,abi:[l],strict:!1})}catch{const d=(u=l.inputs)==null?void 0:u.some(f=>!("name"in f&&f.name));return{...o,args:d?[]:{},eventName:l.name}}}return!c||!l||a&&!a.includes(c.eventName)||!OM({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...o}}).filter(Boolean)}function OM(e){const{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function s(a,o,i){try{return a.type==="address"?Ja(o,i):a.type==="string"||a.type==="bytes"?Ut(wn(o))===i:o===i}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((a,o)=>{if(a==null)return!0;const i=r[o];return i?(Array.isArray(a)?a:[a]).some(l=>s(i,l,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([a,o])=>{if(o==null)return!0;const i=r.find(l=>l.name===a);return i?(Array.isArray(o)?o:[o]).some(l=>s(i,l,t[a])):!1}):!1}async function _f(e,{address:t,blockHash:r,fromBlock:n,toBlock:s,event:a,events:o,args:i,strict:c}={}){const l=c??!1,u=o??(a?[a]:void 0);let d=[];u&&(d=[u.flatMap(g=>Hi({abi:[g],eventName:g.name,args:o?void 0:i}))],a&&(d=d[0]));let f;r?f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof n=="bigint"?q(n):n,toBlock:typeof s=="bigint"?q(s):s}]});const m=f.map(y=>Jr(y));return u?Df({abi:u,args:i,logs:m,strict:l}):m}async function Jg(e,t){const{abi:r,address:n,args:s,blockHash:a,eventName:o,fromBlock:i,toBlock:c,strict:l}=t,u=o?$s({abi:r,name:o}):void 0,d=u?void 0:r.filter(f=>f.type==="event");return se(e,_f,"getLogs")({address:n,args:s,blockHash:a,event:u,events:d,fromBlock:i,toBlock:c,strict:l})}async function DM(e,t){const{abi:r,address:n,args:s,dataSuffix:a,functionName:o,...i}=t,c=i.account?Ke(i.account):e.account,l=fr({abi:r,args:s,functionName:o});try{const{data:u}=await se(e,Mi,"call")({batch:!1,data:`${l}${a?a.replace("0x",""):""}`,to:n,...i,account:c}),d=Qs({abi:r,args:s,functionName:o,data:u||"0x"}),f=r.filter(m=>"name"in m&&m.name===t.functionName);return{result:d,request:{abi:f,address:n,args:s,dataSuffix:a,functionName:o,...i,account:c}}}catch(u){throw Js(u,{abi:r,address:n,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}const Mf=new Map,e6=new Map;let _M=0;function Un(e,t,r){const n=++_M,s=()=>Mf.get(e)||[],a=()=>{const u=s();Mf.set(e,u.filter(d=>d.id!==n))},o=()=>{const u=s();if(!u.some(f=>f.id===n))return;const d=e6.get(e);if(u.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}a()},i=s();if(Mf.set(e,[...i,{id:n,fns:t}]),i&&i.length>0)return o;const c={};for(const u in t)c[u]=((...d)=>{var m,y;const f=s();if(f.length!==0)for(const g of f)(y=(m=g.fns)[u])==null||y.call(m,...d)});const l=r(c);return typeof l=="function"&&e6.set(e,l),o}async function Nf(e){return new Promise(t=>setTimeout(t,e))}function eo(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let s=!0;const a=()=>s=!1;return(async()=>{let i;t&&(i=await e({unpoll:a}));const c=await(r==null?void 0:r(i))??n;await Nf(c);const l=async()=>{s&&(await e({unpoll:a}),await Nf(n),l())};l()})(),a}const MM=new Map,NM=new Map;function LM(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),r=t(e,MM),n=t(e,NM);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function zM(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){const n=LM(t),s=n.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let a=n.promise.get();a||(a=e(),n.promise.set(a));try{const o=await a;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}const RM=e=>`blockNumber.${e}`;async function Gi(e,{cacheTime:t=e.cacheTime}={}){const r=await zM(()=>e.request({method:"eth_blockNumber"}),{cacheKey:RM(e.uid),cacheTime:t});return BigInt(r)}async function Ql(e,{filter:t}){const r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;const s=n.map(a=>Jr(a));return!("abi"in t)||!t.abi?s:Df({abi:t.abi,logs:s,strict:r})}async function Jl(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function HM(e,t){const{abi:r,address:n,args:s,batch:a=!0,eventName:o,fromBlock:i,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:f}=t;return(typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const E=f??!1,w=mt(["watchContractEvent",n,s,a,e.uid,o,d,E,i]);return Un(w,{onLogs:l,onError:c},v=>{let S;i!==void 0&&(S=i-1n);let C,D=!1;const L=eo(async()=>{var T;if(!D){try{C=await se(e,qg,"createContractEventFilter")({abi:r,address:n,args:s,eventName:o,strict:E,fromBlock:i})}catch{}D=!0;return}try{let h;if(C)h=await se(e,Ql,"getFilterChanges")({filter:C});else{const b=await se(e,Gi,"getBlockNumber")({});S&&S<b?h=await se(e,Jg,"getContractEvents")({abi:r,address:n,args:s,eventName:o,fromBlock:S+1n,toBlock:b,strict:E}):h=[],S=b}if(h.length===0)return;if(a)v.onLogs(h);else for(const b of h)v.onLogs([b])}catch(h){C&&h instanceof is&&(D=!1),(T=v.onError)==null||T.call(v,h)}},{emitOnBegin:!0,interval:d});return async()=>{C&&await se(e,Jl,"uninstallFilter")({filter:C}),L()}})})():(()=>{const E=f??!1,w=mt(["watchContractEvent",n,s,a,e.uid,o,d,E]);let v=!0,S=()=>v=!1;return Un(w,{onLogs:l,onError:c},C=>((async()=>{try{const D=(()=>{if(e.transport.type==="fallback"){const h=e.transport.transports.find(b=>b.config.type==="webSocket"||b.config.type==="ipc");return h?h.value:e.transport}return e.transport})(),L=o?Hi({abi:r,eventName:o,args:s}):[],{unsubscribe:T}=await D.subscribe({params:["logs",{address:n,topics:L}],onData(h){var x;if(!v)return;const b=h.result;try{const{eventName:A,args:I}=Xl({abi:r,data:b.data,topics:b.topics,strict:f}),F=Jr(b,{args:I,eventName:A});C.onLogs([F])}catch(A){let I,F;if(A instanceof sl||A instanceof up){if(f)return;I=A.abiItem.name,F=(x=A.abiItem.inputs)==null?void 0:x.some(k=>!("name"in k&&k.name))}const _=Jr(b,{args:F?[]:{},eventName:I});C.onLogs([_])}},onError(h){var b;(b=C.onError)==null||b.call(C,h)}});S=T,v||S()}catch(D){c==null||c(D)}})(),()=>S()))})()}async function Lf(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const zf=new Da(128);async function eu(e,t){var v,S,C,D;const{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:a,blobs:o,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,type:y,value:g,...E}=t;if(typeof r>"u")throw new kn({docsPath:"/docs/actions/wallet/sendTransaction"});const w=r?Ke(r):null;try{rn(t);const L=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await jl({authorization:a[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`.")})})();if((w==null?void 0:w.type)==="json-rpc"||w===null){let T;n!==null&&(T=await se(e,ls,"getChainId")({}),lp({currentChainId:T,chain:n}));const h=(C=(S=(v=e.chain)==null?void 0:v.formatters)==null?void 0:S.transactionRequest)==null?void 0:C.format,x=(h||_r)({...Ws(E,{format:h}),accessList:s,account:w,authorizationList:a,blobs:o,chainId:T,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,to:L,type:y,value:g},"sendTransaction"),A=zf.get(e.uid),I=A?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:I,params:[x]},{retryCount:0})}catch(F){if(A===!1)throw F;const _=F;if(_.name==="InvalidInputRpcError"||_.name==="InvalidParamsRpcError"||_.name==="MethodNotFoundRpcError"||_.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[x]},{retryCount:0}).then(k=>(zf.set(e.uid,!0),k)).catch(k=>{const P=k;throw P.name==="MethodNotFoundRpcError"||P.name==="MethodNotSupportedRpcError"?(zf.set(e.uid,!1),_):P});throw _}}if((w==null?void 0:w.type)==="local"){const T=await se(e,$i,"prepareTransactionRequest")({account:w,accessList:s,authorizationList:a,blobs:o,chain:n,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,nonceManager:w.nonceManager,parameters:[...Ff,"sidecars"],type:y,value:g,...E,to:L}),h=(D=n==null?void 0:n.serializers)==null?void 0:D.transaction,b=await w.signTransaction(T,{serializer:h});return await se(e,Lf,"sendRawTransaction")({serializedTransaction:b})}throw(w==null?void 0:w.type)==="smart"?new Hs({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Hs({docsPath:"/docs/actions/wallet/sendTransaction",type:w==null?void 0:w.type})}catch(L){throw L instanceof Hs?L:Zl(L,{...t,account:w,chain:t.chain||void 0})}}async function ji(e,t){return ji.internal(e,eu,"sendTransaction",t)}(function(e){async function t(r,n,s,a){const{abi:o,account:i=r.account,address:c,args:l,dataSuffix:u,functionName:d,...f}=a;if(typeof i>"u")throw new kn({docsPath:"/docs/contract/writeContract"});const m=i?Ke(i):null,y=fr({abi:o,args:l,functionName:d});try{return await se(r,n,s)({data:`${y}${u?u.replace("0x",""):""}`,to:c,account:m,...f})}catch(g){throw Js(g,{abi:o,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:m==null?void 0:m.address})}}e.internal=t})(ji||(ji={}));class $M extends ${constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}function tu(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((s,a)=>{const o=async({count:i=0}={})=>{const c=async({error:l})=>{const u=typeof t=="function"?t({count:i,error:l}):t;u&&await Nf(u),o({count:i+1})};try{const l=await e();s(l)}catch(l){if(i<r&&await n({count:i,error:l}))return c({error:l});a(l)}};o()})}const t6="0x5792579257925792579257925792579257925792579257925792579257925792",r6=q(0,{size:32});async function n6(e,t){const{account:r=e.account,capabilities:n,chain:s=e.chain,experimental_fallback:a,experimental_fallbackDelay:o=32,forceAtomic:i=!1,id:c,version:l="2.0.0"}=t,u=r?Ke(r):null,d=t.calls.map(f=>{const m=f,y=m.abi?fr({abi:m.abi,functionName:m.functionName,args:m.args}):m.data;return{data:m.dataSuffix&&y?cr([y,m.dataSuffix]):y,to:m.to,value:m.value?q(m.value):void 0}});try{const f=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:i,calls:d,capabilities:n,chainId:q(s.id),from:u==null?void 0:u.address,id:c,version:l}]},{retryCount:0});return typeof f=="string"?{id:f}:f}catch(f){const m=f;if(a&&(m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError"||m.name==="UnknownRpcError"||m.details.toLowerCase().includes("does not exist / is not available")||m.details.toLowerCase().includes("missing or invalid. request()")||m.details.toLowerCase().includes("did not match any variant of untagged enum")||m.details.toLowerCase().includes("account upgraded to unsupported contract")||m.details.toLowerCase().includes("eip-7702 not supported")||m.details.toLowerCase().includes("unsupported wc_ method")||m.details.toLowerCase().includes("feature toggled misconfigured")||m.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(n&&Object.values(n).some(v=>!v.optional)){const v="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new Va(new $(v,{details:v}))}if(i&&d.length>1){const w="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new Wa(new $(w,{details:w}))}const y=[];for(const w of d){const v=eu(e,{account:u,chain:s,data:w.data,to:w.to,value:w.value?Le(w.value):void 0});y.push(v),o>0&&await new Promise(S=>setTimeout(S,o))}const g=await Promise.allSettled(y);if(g.every(w=>w.status==="rejected"))throw g[0].reason;const E=g.map(w=>w.status==="fulfilled"?w.value:r6);return{id:cr([...E,q(s.id,{size:32}),t6])}}throw Zl(f,{...t,account:u,chain:t.chain})}}async function s6(e,t){async function r(u){if(u.endsWith(t6.slice(2))){const f=Zt(rp(u,-64,-32)),m=rp(u,0,-64).slice(2).match(/.{1,64}/g),y=await Promise.all(m.map(E=>r6.slice(2)!==E?e.request({method:"eth_getTransactionReceipt",params:[`0x${E}`]},{dedupe:!0}):void 0)),g=y.some(E=>E===null)?100:y.every(E=>(E==null?void 0:E.status)==="0x1")?200:y.every(E=>(E==null?void 0:E.status)==="0x0")?500:600;return{atomic:!1,chainId:ir(f),receipts:y.filter(Boolean),status:g,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[u]})}const{atomic:n=!1,chainId:s,receipts:a,version:o="2.0.0",...i}=await r(t.id),[c,l]=(()=>{const u=i.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...i,atomic:n,chainId:s?ir(s):void 0,receipts:(a==null?void 0:a.map(u=>({...u,blockNumber:Le(u.blockNumber),gasUsed:Le(u.gasUsed),status:v1[u.status]})))??[],statusCode:l,status:c,version:o}}async function a6(e,t){const{id:r,pollingInterval:n=e.pollingInterval,status:s=({statusCode:g})=>g===200||g>=300,retryCount:a=4,retryDelay:o=({count:g})=>~~(1<<g)*200,timeout:i=6e4,throwOnFailure:c=!1}=t,l=mt(["waitForCallsStatus",e.uid,r]),{promise:u,resolve:d,reject:f}=bf();let m;const y=Un(l,{resolve:d,reject:f},g=>{const E=eo(async()=>{const w=v=>{clearTimeout(m),E(),v(),y()};try{const v=await tu(async()=>{const S=await se(e,s6,"getCallsStatus")({id:r});if(c&&S.status==="failure")throw new $M(S);return S},{retryCount:a,delay:o});if(!s(v))return;w(()=>g.resolve(v))}catch(v){w(()=>g.reject(v))}},{interval:n,emitOnBegin:!0});return E});return m=i?setTimeout(()=>{y(),clearTimeout(m),f(new GM({id:r}))},i):void 0,await u}class GM extends ${constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const Rf=256;let ru=Rf,nu;function o6(e=11){if(!nu||ru+e>Rf*2){nu="",ru=0;for(let t=0;t<Rf;t++)nu+=(256+Math.random()*256|0).toString(16).substring(1)}return nu.substring(ru,ru+++e)}function i6(e){const{batch:t,chain:r,ccipRead:n,key:s="base",name:a="Base Client",type:o="base"}=e,i=e.experimental_blockTag??(typeof(r==null?void 0:r.experimental_preconfirmationTime)=="number"?"pending":void 0),c=(r==null?void 0:r.blockTime)??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),u=e.pollingInterval??l,d=e.cacheTime??u,f=e.account?Ke(e.account):void 0,{config:m,request:y,value:g}=e.transport({account:f,chain:r,pollingInterval:u}),E={...m,...g},w={account:f,batch:t,cacheTime:d,ccipRead:n,chain:r,key:s,name:a,pollingInterval:u,request:y,transport:E,type:o,uid:o6(),...i?{experimental_blockTag:i}:{}};function v(S){return C=>{const D=C(S);for(const T in w)delete D[T];const L={...S,...D};return Object.assign(L,{extend:v(L)})}}return Object.assign(w,{extend:v(w)})}function Hf(e){var r,n,s,a,o,i;if(!(e instanceof $))return!1;const t=e.walk(c=>c instanceof vp);return t instanceof vp?((r=t.data)==null?void 0:r.errorName)==="HttpError"||((n=t.data)==null?void 0:n.errorName)==="ResolverError"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotContract"||((a=t.data)==null?void 0:a.errorName)==="ResolverNotFound"||((o=t.data)==null?void 0:o.errorName)==="ReverseAddressMismatch"||((i=t.data)==null?void 0:i.errorName)==="UnsupportedResolverProfile":!1}function jM(e){const{abi:t,data:r}=e,n=Rs(r,0,4),s=t.find(a=>a.type==="function"&&n===Yo(Mr(a)));if(!s)throw new QT(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Ko(s.inputs,Rs(r,4)):void 0}}const $f="/docs/contract/encodeErrorResult";function c6(e){const{abi:t,errorName:r,args:n}=e;let s=t[0];if(r){const c=$s({abi:t,args:n,name:r});if(!c)throw new vb(r,{docsPath:$f});s=c}if(s.type!=="error")throw new vb(void 0,{docsPath:$f});const a=Mr(s),o=Yo(a);let i="0x";if(n&&n.length>0){if(!s.inputs)throw new KT(s.name,{docsPath:$f});i=os(s.inputs,n)}return lr([o,i])}const Gf="/docs/contract/encodeFunctionResult";function VM(e){const{abi:t,functionName:r,result:n}=e;let s=t[0];if(r){const o=$s({abi:t,name:r});if(!o)throw new za(r,{docsPath:Gf});s=o}if(s.type!=="function")throw new za(void 0,{docsPath:Gf});if(!s.outputs)throw new Cb(s.name,{docsPath:Gf});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new Tb(n)})();return os(s.outputs,a)}const Vi="x-batch-gateway:true";async function l6(e){const{data:t,ccipRequest:r}=e,{args:[n]}=jM({abi:pf,data:t}),s=[],a=[];return await Promise.all(n.map(async(o,i)=>{try{a[i]=o.urls.includes(Vi)?await l6({data:o.data,ccipRequest:r}):await r(o),s[i]=!1}catch(c){s[i]=!0,a[i]=WM(c)}})),VM({abi:pf,functionName:"query",result:[s,a]})}function WM(e){return e.name==="HttpRequestError"&&e.status?c6({abi:pf,errorName:"HttpError",args:[e.status,e.shortMessage]}):c6({abi:[gb],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function u6(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Or(t)?t:null}function jf(e){let t=new Uint8Array(32).fill(0);if(!e)return wt(t);const r=e.split(".");for(let n=r.length-1;n>=0;n-=1){const s=u6(r[n]),a=s?wn(s):Ut(Ms(r[n]),"bytes");t=Ut(cr([t,a]),"bytes")}return wt(t)}function qM(e){return`[${e.slice(2)}]`}function YM(e){const t=new Uint8Array(32).fill(0);return e?u6(e)||Ut(Ms(e)):wt(t)}function Vf(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const r=new Uint8Array(Ms(t).byteLength+2);let n=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=Ms(s[a]);o.byteLength>255&&(o=Ms(qM(YM(s[a])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function KM(e,t){const{blockNumber:r,blockTag:n,coinType:s,name:a,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>a.endsWith(f)))return null;const d=s!=null?[jf(a),BigInt(s)]:[jf(a)];try{const f=fr({abi:yg,functionName:"addr",args:d}),m={address:l,abi:hg,functionName:"resolveWithGateways",args:[Fe(Vf(a)),f,o??[Vi]],blockNumber:r,blockTag:n},g=await se(e,zr,"readContract")(m);if(g[0]==="0x")return null;const E=Qs({abi:yg,args:d,functionName:"addr",data:g[0]});return E==="0x"||Zt(E)==="0x00"?null:E}catch(f){if(i)throw f;if(Hf(f))return null;throw f}}class ZM extends ${constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Wi extends ${constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Wf extends ${constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class XM extends ${constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const QM=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,JM=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,eN=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,tN=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function rN(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const r=t.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function d6(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function p6({uri:e,gatewayUrls:t}){const r=eN.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=d6(t==null?void 0:t.ipfs,"https://ipfs.io"),s=d6(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(QM),{protocol:o,subpath:i,target:c,subtarget:l=""}=(a==null?void 0:a.groups)||{},u=o==="ipns:/"||i==="ipns/",d=o==="ipfs:/"||i==="ipfs/"||JM.test(e);if(e.startsWith("http")&&!u&&!d){let m=e;return t!=null&&t.arweave&&(m=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:m,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(tN,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new Wf({uri:e})}function f6(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new ZM({data:e});return e.image||e.image_url||e.image_data}async function nN({gatewayUrls:e,uri:t}){try{const r=await fetch(t).then(s=>s.json());return await qf({gatewayUrls:e,uri:f6(r)})}catch{throw new Wf({uri:t})}}async function qf({gatewayUrls:e,uri:t}){const{uri:r,isOnChain:n}=p6({uri:t,gatewayUrls:e});if(n||await rN(r))return r;throw new Wf({uri:t})}function sN(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[r,n,s]=t.split("/"),[a,o]=r.split(":"),[i,c]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new Wi({reason:"Only EIP-155 supported"});if(!o)throw new Wi({reason:"Chain ID not found"});if(!c)throw new Wi({reason:"Contract address not found"});if(!s)throw new Wi({reason:"Token ID not found"});if(!i)throw new Wi({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:i.toLowerCase(),contractAddress:c,tokenID:s}}async function aN(e,{nft:t}){if(t.namespace==="erc721")return zr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return zr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new XM({namespace:t.namespace})}async function oN(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?iN(e,{gatewayUrls:t,record:r}):qf({uri:r,gatewayUrls:t})}async function iN(e,{gatewayUrls:t,record:r}){const n=sN(r),s=await aN(e,{nft:n}),{uri:a,isOnChain:o,isEncoded:i}=p6({uri:s,gatewayUrls:t});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const l=i?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(l);return qf({uri:f6(u),gatewayUrls:t})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),nN({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function m6(e,t){const{blockNumber:r,blockTag:n,key:s,name:a,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>a.endsWith(d)))return null;try{const d={address:l,abi:hg,args:[Fe(Vf(a)),fr({abi:bg,functionName:"text",args:[jf(a),s]}),o??[Vi]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},m=await se(e,zr,"readContract")(d);if(m[0]==="0x")return null;const y=Qs({abi:bg,functionName:"text",data:m[0]});return y===""?null:y}catch(d){if(i)throw d;if(Hf(d))return null;throw d}}async function cN(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:s,gatewayUrls:a,strict:o,universalResolverAddress:i}){const c=await se(e,m6,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:s,universalResolverAddress:i,gatewayUrls:a,strict:o});if(!c)return null;try{return await oN(e,{record:c,gatewayUrls:n})}catch{return null}}async function lN(e,t){const{address:r,blockNumber:n,blockTag:s,coinType:a=60n,gatewayUrls:o,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:DO,args:[r,a,o??[Vi]],functionName:"reverseWithGateways",blockNumber:n,blockTag:s},d=se(e,zr,"readContract"),[f]=await d(u);return f||null}catch(u){if(i)throw u;if(Hf(u))return null;throw u}}async function uN(e,t){const{blockNumber:r,blockTag:n,name:s}=t,{chain:a}=e,o=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Ma({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})(),i=a==null?void 0:a.ensTlds;if(i&&!i.some(l=>s.endsWith(l)))throw new Error(`${s} is not a valid ENS TLD (${i==null?void 0:i.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[c]=await se(e,zr,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Fe(Vf(s))],blockNumber:r,blockTag:n});return c}async function h6(e,t){var E,w,v;const{account:r=e.account,blockNumber:n,blockTag:s="latest",blobs:a,data:o,gas:i,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:m,...y}=t,g=r?Ke(r):void 0;try{rn(t);const C=(typeof n=="bigint"?q(n):void 0)||s,D=(v=(w=(E=e.chain)==null?void 0:E.formatters)==null?void 0:w.transactionRequest)==null?void 0:v.format,T=(D||_r)({...Ws(y,{format:D}),account:g,blobs:a,data:o,gas:i,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:m},"createAccessList"),h=await e.request({method:"eth_createAccessList",params:[T,C]});return{accessList:h.accessList,gasUsed:BigInt(h.gasUsed)}}catch(S){throw kp(S,{...t,account:g,chain:e.chain})}}async function dN(e){const t=Kl(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}async function b6(e,{address:t,args:r,event:n,events:s,fromBlock:a,strict:o,toBlock:i}={}){const c=s??(n?[n]:void 0),l=Kl(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(m=>Hi({abi:[m],eventName:m.name,args:r}))],n&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?q(a):a,toBlock:typeof i=="bigint"?q(i):i,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:a,id:d,request:l(d),strict:!!o,toBlock:i,type:"event"}}async function y6(e){const t=Kl(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}async function pN(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){const s=typeof r=="bigint"?q(r):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||n]});return BigInt(a)}async function fN(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function mN(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const s=r!==void 0?q(r):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),ir(a)}class hN extends ${constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function bN(e,t){const{address:r,factory:n,factoryData:s}=t;try{const[a,o,i,c,l,u,d]=await se(e,zr,"readContract")({abi:yN,address:r,functionName:"eip712Domain",factory:n,factoryData:s});return{domain:{name:o,version:i,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:a}}catch(a){const o=a;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new hN({address:r}):o}}const yN=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function gN(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(r=>r.map(n=>BigInt(n)))}}async function xN(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:s}){const a=typeof r=="bigint"?q(r):void 0,o=await e.request({method:"eth_feeHistory",params:[q(t),a||n,s]},{dedupe:!!a});return gN(o)}async function wN(e,{filter:t}){const r=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>Jr(a));return t.abi?Df({abi:t.abi,logs:s,strict:r}):s}const su=new Da(8192);function vN(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(su.get(r))return su.get(r);const n=e().finally(()=>su.delete(r));return su.set(r,n),n}function EN(e,t={}){return async(r,n={})=>{var d;const{dedupe:s=!1,methods:a,retryDelay:o=150,retryCount:i=3,uid:c}={...t,...n},{method:l}=r;if((d=a==null?void 0:a.exclude)!=null&&d.includes(l))throw new Vs(new Error("method not supported"),{method:l});if(a!=null&&a.include&&!a.include.includes(l))throw new Vs(new Error("method not supported"),{method:l});const u=s?Sa(`${c}.${mt(r)}`):void 0;return vN(()=>tu(async()=>{try{return await e(r)}catch(f){const m=f;switch(m.code){case Qo.code:throw new Qo(m);case Jo.code:throw new Jo(m);case ei.code:throw new ei(m,{method:r.method});case ti.code:throw new ti(m);case js.code:throw new js(m);case is.code:throw new is(m);case ri.code:throw new ri(m);case ni.code:throw new ni(m);case si.code:throw new si(m);case Vs.code:throw new Vs(m,{method:r.method});case Ga.code:throw new Ga(m);case ai.code:throw new ai(m);case ja.code:throw new ja(m);case oi.code:throw new oi(m);case ii.code:throw new ii(m);case ci.code:throw new ci(m);case li.code:throw new li(m);case ui.code:throw new ui(m);case Va.code:throw new Va(m);case di.code:throw new di(m);case pi.code:throw new pi(m);case fi.code:throw new fi(m);case mi.code:throw new mi(m);case hi.code:throw new hi(m);case Wa.code:throw new Wa(m);case 5e3:throw new ja(m);default:throw f instanceof $?f:new vS(m)}}},{delay:({count:f,error:m})=>{var y;if(m&&m instanceof Gs){const g=(y=m==null?void 0:m.headers)==null?void 0:y.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g,10)*1e3}return~~(1<<f)*o},retryCount:i,shouldRetry:({error:f})=>kN(f)}),{enabled:s,id:u})}}function kN(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Ga.code||e.code===js.code:e instanceof Gs&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class CN extends ${constructor({callbackSelector:t,cause:r,data:n,extraData:s,sender:a,urls:o}){var i;super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],(i=r.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(c=>` ${Xo(c)}`)],` Sender: ${a}`,` Data: ${n}`,` Callback selector: ${t}`,` Extra data: ${s}`].flat(),name:"OffchainLookupError"})}}class TN extends ${constructor({result:t,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Xo(r)}`,`Response: ${mt(t)}`],name:"OffchainLookupResponseMalformedError"})}}class SN extends ${constructor({sender:t,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const AN="0x556f1830",g6={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function PN(e,{blockNumber:t,blockTag:r,data:n,to:s}){const{args:a}=Vb({data:n,abi:[g6]}),[o,i,c,l,u]=a,{ccipRead:d}=e,f=d&&typeof(d==null?void 0:d.request)=="function"?d.request:x6;try{if(!Ja(s,o))throw new SN({sender:o,to:s});const m=i.includes(Vi)?await l6({data:c,ccipRequest:f}):await f({data:c,sender:o,urls:i}),{data:y}=await Mi(e,{blockNumber:t,blockTag:r,data:cr([l,os([{type:"bytes"},{type:"bytes"}],[m,u])]),to:s});return y}catch(m){throw new CN({callbackSelector:l,cause:m,data:n,extraData:u,sender:o,urls:i})}}async function x6({data:e,sender:t,urls:r}){var s;let n=new Error("An unknown error occurred.");for(let a=0;a<r.length;a++){const o=r[a],i=o.includes("{data}")?"GET":"POST",c=i==="POST"?{data:e,sender:t}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(o.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:l,method:i});let d;if((s=u.headers.get("Content-Type"))!=null&&s.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){n=new Gs({body:c,details:d!=null&&d.error?mt(d.error):u.statusText,headers:u.headers,status:u.status,url:o});continue}if(!Or(d)){n=new TN({result:d,url:o});continue}return d}catch(u){n=new Gs({body:c,details:u.message,url:o})}}throw n}const IN=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:x6,offchainLookup:PN,offchainLookupAbiItem:g6,offchainLookupSignature:AN},Symbol.toStringTag,{value:"Module"}));function BN(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((s,a)=>{(async()=>{let o;try{const i=new AbortController;r>0&&(o=setTimeout(()=>{n&&i.abort()},r)),s(await e({signal:(i==null?void 0:i.signal)||null}))}catch(i){(i==null?void 0:i.name)==="AbortError"&&a(t),a(i)}finally{clearTimeout(o)}})()})}function FN(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const w6=FN();function UN(e,t={}){return{async request(r){var f;const{body:n,fetchFn:s=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:o=t.onResponse,timeout:i=t.timeout??1e4}=r,c={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:u,signal:d}=c;try{const m=await BN(async({signal:g})=>{const E={...c,body:Array.isArray(n)?mt(n.map(C=>({jsonrpc:"2.0",id:C.id??w6.take(),...C}))):mt({jsonrpc:"2.0",id:n.id??w6.take(),...n}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:d||(i>0?g:null)},w=new Request(e,E),v=await(a==null?void 0:a(w,E))??{...E,url:e};return await s(v.url??e,v)},{errorInstance:new Xb({body:n,url:e}),timeout:i,signal:!0});o&&await o(m);let y;if((f=m.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))y=await m.json();else{y=await m.text();try{y=JSON.parse(y||"{}")}catch(g){if(m.ok)throw g;y={error:y}}}if(!m.ok)throw new Gs({body:n,details:mt(y.error)||m.statusText,headers:m.headers,status:m.status,url:e});return y}catch(m){throw m instanceof Gs||m instanceof Xb?m:new Gs({body:n,cause:m,url:e})}}}}const ON=`Ethereum Signed Message:
108
+ `;function DN(e){const t=typeof e=="string"?Sa(e):typeof e.raw=="string"?e.raw:wt(e.raw),r=Sa(`${ON}${lt(t)}`);return cr([r,t])}function v6(e,t){return Ut(DN(e),t)}class _N extends ${constructor({domain:t}){super(`Invalid domain "${mt(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class MN extends ${constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class NN extends ${constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function LN(e){const{domain:t,message:r,primaryType:n,types:s}=e,a=(c,l)=>{const u={...l};for(const d of c){const{name:f,type:m}=d;m==="address"&&(u[f]=u[f].toLowerCase())}return u},o=s.EIP712Domain?t?a(s.EIP712Domain,t):{}:{},i=(()=>{if(n!=="EIP712Domain")return a(s[n],r)})();return mt({domain:o,message:i,primaryType:n,types:s})}function E6(e){const{domain:t,message:r,primaryType:n,types:s}=e,a=(o,i)=>{for(const c of o){const{name:l,type:u}=c,d=i[l],f=u.match(Gb);if(f&&(typeof d=="number"||typeof d=="bigint")){const[g,E,w]=f;q(d,{signed:E==="int",size:Number.parseInt(w,10)/8})}if(u==="address"&&typeof d=="string"&&!rt(d))throw new Ct({address:d});const m=u.match(Q4);if(m){const[g,E]=m;if(E&&lt(d)!==Number.parseInt(E,10))throw new e4({expectedSize:Number.parseInt(E,10),givenSize:lt(d)})}const y=s[u];y&&(zN(u),a(y,d))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new _N({domain:t});a(s.EIP712Domain,t)}if(n!=="EIP712Domain")if(s[n])a(s[n],r);else throw new MN({primaryType:n,types:s})}function k6({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function zN(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new NN({type:e})}function RN(e){const{domain:t={},message:r,primaryType:n}=e,s={EIP712Domain:k6({domain:t}),...e.types};E6({domain:t,message:r,primaryType:n,types:s});const a=["0x1901"];return t&&a.push(HN({domain:t,types:s})),n!=="EIP712Domain"&&a.push(C6({data:r,primaryType:n,types:s})),Ut(cr(a))}function HN({domain:e,types:t}){return C6({data:e,primaryType:"EIP712Domain",types:t})}function C6({data:e,primaryType:t,types:r}){const n=T6({data:e,primaryType:t,types:r});return Ut(n)}function T6({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],s=[$N({primaryType:t,types:r})];for(const a of r[t]){const[o,i]=A6({types:r,name:a.name,type:a.type,value:e[a.name]});n.push(o),s.push(i)}return os(n,s)}function $N({primaryType:e,types:t}){const r=Fe(GN({primaryType:e,types:t}));return Ut(r)}function GN({primaryType:e,types:t}){let r="";const n=S6({primaryType:e,types:t});n.delete(e);const s=[e,...Array.from(n).sort()];for(const a of s)r+=`${a}(${t[a].map(({name:o,type:i})=>`${i} ${o}`).join(",")})`;return r}function S6({primaryType:e,types:t},r=new Set){const n=e.match(/^\w*/u),s=n==null?void 0:n[0];if(r.has(s)||t[s]===void 0)return r;r.add(s);for(const a of t[s])S6({primaryType:a.type,types:t},r);return r}function A6({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},Ut(T6({data:n,primaryType:r,types:e}))];if(r==="bytes")return[{type:"bytes32"},Ut(n)];if(r==="string")return[{type:"bytes32"},Ut(Fe(n))];if(r.lastIndexOf("]")===r.length-1){const s=r.slice(0,r.lastIndexOf("[")),a=n.map(o=>A6({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},Ut(os(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:r},n]}function jN(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function VN(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ir(e.nonce):void 0,storageProof:e.storageProof?jN(e.storageProof):void 0}}async function WN(e,{address:t,blockNumber:r,blockTag:n,storageKeys:s}){const a=n??"latest",o=r!==void 0?q(r):void 0,i=await e.request({method:"eth_getProof",params:[t,s,o||a]});return VN(i)}async function qN(e,{address:t,blockNumber:r,blockTag:n="latest",slot:s}){const a=r!==void 0?q(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||n]})}async function Yf(e,{blockHash:t,blockNumber:r,blockTag:n,hash:s,index:a,sender:o,nonce:i}){var f,m,y;const c=n||"latest",l=r!==void 0?q(r):void 0;let u=null;if(s?u=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,q(a)]},{dedupe:!0}):typeof a=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,q(a)]},{dedupe:!!l}):o&&typeof i=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[o,q(i)]},{dedupe:!0})),!u)throw new I1({blockHash:t,blockNumber:r,blockTag:c,hash:s,index:a});return(((y=(m=(f=e.chain)==null?void 0:f.formatters)==null?void 0:m.transaction)==null?void 0:y.format)||Ns)(u,"getTransaction")}async function YN(e,{hash:t,transactionReceipt:r}){const[n,s]=await Promise.all([se(e,Gi,"getBlockNumber")({}),t?se(e,Yf,"getTransaction")({hash:t}):void 0]),a=(r==null?void 0:r.blockNumber)||(s==null?void 0:s.blockNumber);return a?n-a+1n:0n}async function au(e,{hash:t}){var s,a,o;const r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new B1({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||zc)(r,"getTransactionReceipt")}async function KN(e,t){var v;const{account:r,authorizationList:n,allowFailure:s=!0,blockNumber:a,blockOverrides:o,blockTag:i,stateOverride:c}=t,l=t.contracts,{batchSize:u=t.batchSize??1024,deployless:d=t.deployless??!1}=typeof((v=e.batch)==null?void 0:v.multicall)=="object"?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Ma({blockNumber:a,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),m=[[]];let y=0,g=0;for(let S=0;S<l.length;S++){const{abi:C,address:D,args:L,functionName:T}=l[S];try{const h=fr({abi:C,args:L,functionName:T});g+=(h.length-2)/2,u>0&&g>u&&m[y].length>0&&(y++,g=(h.length-2)/2,m[y]=[]),m[y]=[...m[y],{allowFailure:!0,callData:h,target:D}]}catch(h){const b=Js(h,{abi:C,address:D,args:L,docsPath:"/docs/contract/multicall",functionName:T,sender:r});if(!s)throw b;m[y]=[...m[y],{allowFailure:!0,callData:"0x",target:D}]}}const E=await Promise.allSettled(m.map(S=>se(e,zr,"readContract")({...f===null?{code:ff}:{address:f},abi:$l,account:r,args:[S],authorizationList:n,blockNumber:a,blockOverrides:o,blockTag:i,functionName:"aggregate3",stateOverride:c}))),w=[];for(let S=0;S<E.length;S++){const C=E[S];if(C.status==="rejected"){if(!s)throw C.reason;for(let L=0;L<m[S].length;L++)w.push({status:"failure",error:C.reason,result:void 0});continue}const D=C.value;for(let L=0;L<D.length;L++){const{returnData:T,success:h}=D[L],{callData:b}=m[S][L],{abi:x,address:A,functionName:I,args:F}=l[w.length];try{if(b==="0x")throw new qo;if(!h)throw new cl({data:T});const _=Qs({abi:x,args:F,data:T,functionName:I});w.push(s?{result:_,status:"success"}:_)}catch(_){const k=Js(_,{abi:x,address:A,args:F,docsPath:"/docs/contract/multicall",functionName:I});if(!s)throw k;w.push({error:k,result:void 0,status:"failure"})}}}if(w.length!==l.length)throw new $("multicall results mismatch");return w}async function Kf(e,t){const{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:a,traceTransfers:o,validation:i}=t;try{const c=[];for(const f of s){const m=f.blockOverrides?Tg(f.blockOverrides):void 0,y=f.calls.map(E=>{const w=E,v=w.account?Ke(w.account):void 0,S=w.abi?fr(w):w.data,C={...w,account:v,data:w.dataSuffix?cr([S||"0x",w.dataSuffix]):S,from:w.from??(v==null?void 0:v.address)};return rn(C),_r(C)}),g=f.stateOverrides?gf(f.stateOverrides):void 0;c.push({blockOverrides:m,calls:y,stateOverrides:g})}const u=(typeof r=="bigint"?q(r):void 0)||n;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:i},u]})).map((f,m)=>({...Bd(f),calls:f.calls.map((y,g)=>{var x,A;const{abi:E,args:w,functionName:v,to:S}=s[m].calls[g],C=((x=y.error)==null?void 0:x.data)??y.returnData,D=BigInt(y.gasUsed),L=(A=y.logs)==null?void 0:A.map(I=>Jr(I)),T=y.status==="0x1"?"success":"failure",h=E&&T==="success"&&C!=="0x"?Qs({abi:E,data:C,functionName:v}):null,b=(()=>{var F;if(T==="success")return;let I;if(((F=y.error)==null?void 0:F.data)==="0x"?I=new qo:y.error&&(I=new cl(y.error)),!!I)return Js(I,{abi:E??[],address:S??"0x",args:w,functionName:v??"<unknown>"})})();return{data:C,gasUsed:D,logs:L,status:T,...T==="success"?{result:h}:{error:b}}})}))}catch(c){const l=c,u=ll(l,{});throw u instanceof zo?l:u}}function Zf(e){let t=!0,r="",n=0,s="",a=!1;for(let o=0;o<e.length;o++){const i=e[o];if(["(",")",","].includes(i)&&(t=!0),i==="("&&n++,i===")"&&n--,!!t){if(n===0){if(i===" "&&["event","function","error",""].includes(s))s="";else if(s+=i,i===")"){a=!0;break}continue}if(i===" "){e[o-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=i,r+=i}}if(!a)throw new oe("Unable to normalize signature.");return s}function Xf(e,t){const r=typeof e,n=t.type;switch(n){case"address":return Ol(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>Xf(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>Xf(s,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function P6(e,t,r){for(const n in e){const s=e[n],a=t[n];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return P6(s.components,a.components,r[n]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Ol(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Ol(r[n],{strict:!1}):!1)return o}}function I6(e,t={}){const{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?Rb(e):e;return{...n,...r?{hash:to(n)}:{}}}function ou(e,t,r){const{args:n=[],prepare:s=!0}=r??{},a=Nr(t,{strict:!1}),o=e.filter(l=>a?l.type==="function"||l.type==="error"?B6(l)===Pe(t,0,4):l.type==="event"?to(l)===t:!1:"name"in l&&l.name===t);if(o.length===0)throw new iu({name:t});if(o.length===1)return{...o[0],...s?{hash:to(o[0])}:{}};let i;for(const l of o){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...s?{hash:to(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((d,f)=>{const m="inputs"in l&&l.inputs[f];return m?Xf(d,m):!1})){if(i&&"inputs"in i&&i.inputs){const d=P6(l.inputs,i.inputs,n);if(d)throw new XN({abiItem:l,type:d[0]},{abiItem:i,type:d[1]})}i=l}}const c=(()=>{if(i)return i;const[l,...u]=o;return{...l,overloads:u}})();if(!c)throw new iu({name:t});return{...c,...s?{hash:to(c)}:{}}}function B6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ou(r,n)}return e[0]})();return Pe(to(t),0,4)}function ZN(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,s]=e;return ou(n,s)}return e[0]})(),r=typeof t=="string"?t:al(t);return Zf(r)}function to(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ou(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Bi(Pi(ZN(t)))}class XN extends oe{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Zf(al(t.abiItem))}\`, and`,`\`${r.type}\` in \`${Zf(al(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class iu extends oe{constructor({name:t,data:r,type:n="item"}){const s=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function QN(...e){var a;const[t,r]=(()=>{if(Array.isArray(e[0])){const[o,i]=e;return[eL(o),i]}return e})(),{bytecode:n,args:s}=r;return pt(n,(a=t.inputs)!=null&&a.length&&(s!=null&&s.length)?lf(t.inputs,s):"0x")}function JN(e){return I6(e)}function eL(e){const t=e.find(r=>r.type==="constructor");if(!t)throw new iu({name:"constructor"});return t}function tL(...e){const[t,r=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,d]=e;return[F6(l,u,{args:d}),d]}const[i,c]=e;return[i,c]})(),{overloads:n}=t,s=n?F6([t,...n],t.name,{args:r}):t,a=rL(s),o=r.length>0?lf(s.inputs,r):void 0;return o?pt(a,o):a}function ro(e,t={}){return I6(e,t)}function F6(e,t,r){const n=ou(e,t,r);if(n.type!=="function")throw new iu({name:t,type:"function"});return n}function rL(e){return B6(e)}const nL="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",nn="0x0000000000000000000000000000000000000000",sL="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function aL(e,t){const{blockNumber:r,blockTag:n,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:i,validation:c}=t,l=t.account?Ke(t.account):void 0;if(o&&!l)throw new $("`account` is required when `traceAssetChanges` is true");const u=l?QN(JN("constructor(bytes, bytes)"),{bytecode:vg,args:[sL,tL(ro("function getBalance(address)"),[l.address])]}):void 0,d=o?await Promise.all(t.calls.map(async U=>{if(!U.data&&!U.abi)return;const{accessList:z}=await h6(e,{account:l.address,...U,data:U.abi?fr(U):U.data});return z.map(({address:H,storageKeys:G})=>G.length>0?H:null)})).then(U=>U.flat().filter(Boolean)):[],f=await Kf(e,{blockNumber:r,blockTag:n,blocks:[...o?[{calls:[{data:u}],stateOverrides:a},{calls:d.map((U,z)=>({abi:[ro("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]}]:[],{calls:[...s,{}].map(U=>({...U,from:l==null?void 0:l.address})),stateOverrides:a},...o?[{calls:[{data:u}]},{calls:d.map((U,z)=>({abi:[ro("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function decimals() returns (uint256)")],functionName:"decimals",from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]},{calls:d.map((U,z)=>({to:U,abi:[ro("function symbol() returns (string)")],functionName:"symbol",from:nn,nonce:z})),stateOverrides:[{address:nn,nonce:0}]}]:[]],traceTransfers:i,validation:c}),m=o?f[2]:f[0],[y,g,,E,w,v,S,C]=o?f:[],{calls:D,...L}=m,T=D.slice(0,-1)??[],h=(y==null?void 0:y.calls)??[],b=(g==null?void 0:g.calls)??[],x=[...h,...b].map(U=>U.status==="success"?Le(U.data):null),A=(E==null?void 0:E.calls)??[],I=(w==null?void 0:w.calls)??[],F=[...A,...I].map(U=>U.status==="success"?Le(U.data):null),_=((v==null?void 0:v.calls)??[]).map(U=>U.status==="success"?U.result:null),k=((C==null?void 0:C.calls)??[]).map(U=>U.status==="success"?U.result:null),P=((S==null?void 0:S.calls)??[]).map(U=>U.status==="success"?U.result:null),O=[];for(const[U,z]of F.entries()){const H=x[U];if(typeof z!="bigint"||typeof H!="bigint")continue;const G=_[U-1],J=k[U-1],pe=P[U-1],he=U===0?{address:nL,decimals:18,symbol:"ETH"}:{address:d[U-1],decimals:pe||G?Number(G??1):void 0,symbol:J??void 0};O.some(ie=>ie.token.address===he.address)||O.push({token:he,value:{pre:H,post:z,diff:z-H}})}return{assetChanges:O,block:L,results:T}}async function oL(e,{address:t,message:r,factory:n,factoryData:s,signature:a,...o}){const i=v6(r);return se(e,Ni,"verifyHash")({address:t,factory:n,factoryData:s,hash:i,signature:a,...o})}async function iL(e,t){const{address:r,factory:n,factoryData:s,signature:a,message:o,primaryType:i,types:c,domain:l,...u}=t,d=RN({message:o,primaryType:i,types:c,domain:l});return se(e,Ni,"verifyHash")({address:r,factory:n,factoryData:s,hash:d,signature:a,...u})}function U6(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:s,poll:a,pollingInterval:o=e.pollingInterval}){const i=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let c;return i?(()=>{const d=mt(["watchBlockNumber",e.uid,t,r,o]);return Un(d,{onBlockNumber:n,onError:s},f=>eo(async()=>{var m;try{const y=await se(e,Gi,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(y===c)return;if(y-c>1&&r)for(let g=c+1n;g<y;g++)f.onBlockNumber(g,c),c=g}(c===void 0||y>c)&&(f.onBlockNumber(y,c),c=y)}catch(y){(m=f.onError)==null||m.call(f,y)}},{emitOnBegin:t,interval:o}))})():(()=>{const d=mt(["watchBlockNumber",e.uid,t,r]);return Un(d,{onBlockNumber:n,onError:s},f=>{let m=!0,y=()=>m=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(v=>v.config.type==="webSocket"||v.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:E}=await g.subscribe({params:["newHeads"],onData(w){var S;if(!m)return;const v=Le((S=w.result)==null?void 0:S.number);f.onBlockNumber(v,c),c=v},onError(w){var v;(v=f.onError)==null||v.call(f,w)}});y=E,m||y()}catch(g){s==null||s(g)}})(),()=>y()})})()}async function O6(e,t){const{checkReplacement:r=!0,confirmations:n=1,hash:s,onReplaced:a,retryCount:o=6,retryDelay:i=({count:D})=>~~(1<<D)*200,timeout:c=18e4}=t,l=mt(["waitForTransactionReceipt",e.uid,s]),u=(()=>{var D;return t.pollingInterval?t.pollingInterval:(D=e.chain)!=null&&D.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,f,m,y=!1,g,E;const{promise:w,resolve:v,reject:S}=bf(),C=c?setTimeout(()=>{E==null||E(),g==null||g(),S(new b8({hash:s}))},c):void 0;return g=Un(l,{onReplaced:a,resolve:v,reject:S},async D=>{if(m=await se(e,au,"getTransactionReceipt")({hash:s}).catch(()=>{}),m&&n<=1){clearTimeout(C),D.resolve(m),g==null||g();return}E=se(e,U6,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(L){const T=b=>{clearTimeout(C),E==null||E(),b(),g==null||g()};let h=L;if(!y)try{if(m){if(n>1&&(!m.blockNumber||h-m.blockNumber+1n<n))return;T(()=>D.resolve(m));return}if(r&&!d&&(y=!0,await tu(async()=>{d=await se(e,Yf,"getTransaction")({hash:s}),d.blockNumber&&(h=d.blockNumber)},{delay:i,retryCount:o}),y=!1),m=await se(e,au,"getTransactionReceipt")({hash:s}),n>1&&(!m.blockNumber||h-m.blockNumber+1n<n))return;T(()=>D.resolve(m))}catch(b){if(b instanceof I1||b instanceof B1){if(!d){y=!1;return}try{f=d,y=!0;const x=await tu(()=>se(e,Rr,"getBlock")({blockNumber:h,includeTransactions:!0}),{delay:i,retryCount:o,shouldRetry:({error:F})=>F instanceof Kg});y=!1;const A=x.transactions.find(({from:F,nonce:_})=>F===f.from&&_===f.nonce);if(!A||(m=await se(e,au,"getTransactionReceipt")({hash:A.hash}),n>1&&(!m.blockNumber||h-m.blockNumber+1n<n)))return;let I="replaced";A.to===f.to&&A.value===f.value&&A.input===f.input?I="repriced":A.from===A.to&&A.value===0n&&(I="cancelled"),T(()=>{var F;(F=D.onReplaced)==null||F.call(D,{reason:I,replacedTransaction:f,transaction:A,transactionReceipt:m}),D.resolve(m)})}catch(x){T(()=>D.reject(x))}}else T(()=>D.reject(b))}}})}),w}function cL(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:s,onError:a,includeTransactions:o,poll:i,pollingInterval:c=e.pollingInterval}){const l=typeof i<"u"?i:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=o??!1;let d;return l?(()=>{const y=mt(["watchBlocks",e.uid,t,r,n,u,c]);return Un(y,{onBlock:s,onError:a},g=>eo(async()=>{var E;try{const w=await se(e,Rr,"getBlock")({blockTag:t,includeTransactions:u});if(w.number!==null&&(d==null?void 0:d.number)!=null){if(w.number===d.number)return;if(w.number-d.number>1&&r)for(let v=(d==null?void 0:d.number)+1n;v<w.number;v++){const S=await se(e,Rr,"getBlock")({blockNumber:v,includeTransactions:u});g.onBlock(S,d),d=S}}((d==null?void 0:d.number)==null||t==="pending"&&(w==null?void 0:w.number)==null||w.number!==null&&w.number>d.number)&&(g.onBlock(w,d),d=w)}catch(w){(E=g.onError)==null||E.call(g,w)}},{emitOnBegin:n,interval:c}))})():(()=>{let y=!0,g=!0,E=()=>y=!1;return(async()=>{try{n&&se(e,Rr,"getBlock")({blockTag:t,includeTransactions:u}).then(S=>{y&&g&&(s(S,void 0),g=!1)}).catch(a);const w=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:v}=await w.subscribe({params:["newHeads"],async onData(S){var D;if(!y)return;const C=await se(e,Rr,"getBlock")({blockNumber:(D=S.result)==null?void 0:D.number,includeTransactions:u}).catch(()=>{});y&&(s(C,d),g=!1,d=C)},onError(S){a==null||a(S)}});E=v,y||E()}catch(w){a==null||a(w)}})(),()=>E()})()}function lL(e,{address:t,args:r,batch:n=!0,event:s,events:a,fromBlock:o,onError:i,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){const f=typeof l<"u"?l:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),m=d??!1;return f?(()=>{const E=mt(["watchEvent",t,r,n,e.uid,s,u,o]);return Un(E,{onLogs:c,onError:i},w=>{let v;o!==void 0&&(v=o-1n);let S,C=!1;const D=eo(async()=>{var L;if(!C){try{S=await se(e,b6,"createEventFilter")({address:t,args:r,event:s,events:a,strict:m,fromBlock:o})}catch{}C=!0;return}try{let T;if(S)T=await se(e,Ql,"getFilterChanges")({filter:S});else{const h=await se(e,Gi,"getBlockNumber")({});v&&v!==h?T=await se(e,_f,"getLogs")({address:t,args:r,event:s,events:a,fromBlock:v+1n,toBlock:h}):T=[],v=h}if(T.length===0)return;if(n)w.onLogs(T);else for(const h of T)w.onLogs([h])}catch(T){S&&T instanceof is&&(C=!1),(L=w.onError)==null||L.call(w,T)}},{emitOnBegin:!0,interval:u});return async()=>{S&&await se(e,Jl,"uninstallFilter")({filter:S}),D()}})})():(()=>{let E=!0,w=()=>E=!1;return(async()=>{try{const v=(()=>{if(e.transport.type==="fallback"){const L=e.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return L?L.value:e.transport}return e.transport})(),S=a??(s?[s]:void 0);let C=[];S&&(C=[S.flatMap(T=>Hi({abi:[T],eventName:T.name,args:r}))],s&&(C=C[0]));const{unsubscribe:D}=await v.subscribe({params:["logs",{address:t,topics:C}],onData(L){var h;if(!E)return;const T=L.result;try{const{eventName:b,args:x}=Xl({abi:S??[],data:T.data,topics:T.topics,strict:m}),A=Jr(T,{args:x,eventName:b});c([A])}catch(b){let x,A;if(b instanceof sl||b instanceof up){if(d)return;x=b.abiItem.name,A=(h=b.abiItem.inputs)==null?void 0:h.some(F=>!("name"in F&&F.name))}const I=Jr(T,{args:A?[]:{},eventName:x});c([I])}},onError(L){i==null||i(L)}});w=D,E||w()}catch(v){i==null||i(v)}})(),()=>w()})()}function uL(e,{batch:t=!0,onError:r,onTransactions:n,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=mt(["watchPendingTransactions",e.uid,t,a]);return Un(l,{onTransactions:n,onError:r},u=>{let d;const f=eo(async()=>{var m;try{if(!d)try{d=await se(e,y6,"createPendingTransactionFilter")({});return}catch(g){throw f(),g}const y=await se(e,Ql,"getFilterChanges")({filter:d});if(y.length===0)return;if(t)u.onTransactions(y);else for(const g of y)u.onTransactions([g])}catch(y){(m=u.onError)==null||m.call(u,y)}},{emitOnBegin:!0,interval:a});return async()=>{d&&await se(e,Jl,"uninstallFilter")({filter:d}),f()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!l)return;const m=f.result;n([m])},onError(f){r==null||r(f)}});u=d,l||u()}catch(d){r==null||r(d)}})(),()=>u()})()}function dL(e){var d,f,m;const{scheme:t,statement:r,...n}=((d=e.match(pL))==null?void 0:d.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:i,requestId:c,...l}=((f=e.match(fL))==null?void 0:f.groups)??{},u=(m=e.split("Resources:")[1])==null?void 0:m.split(`
109
+ - `).slice(1);return{...n,...l,...s?{chainId:Number(s)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}const pL=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,fL=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function mL(e){const{address:t,domain:r,message:n,nonce:s,scheme:a,time:o=new Date}=e;if(r&&n.domain!==r||s&&n.nonce!==s||a&&n.scheme!==a||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||!rt(n.address,{strict:!1})||t&&!Ja(n.address,t))return!1}catch{return!1}return!0}async function hL(e,t){const{address:r,domain:n,message:s,nonce:a,scheme:o,signature:i,time:c=new Date,...l}=t,u=dL(s);if(!u.address||!mL({address:r,domain:n,message:u,nonce:a,scheme:o,time:c}))return!1;const f=v6(s);return Ni(e,{address:u.address,hash:f,signature:i,...l})}async function Qf(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:n}){var i,c,l;const s=await e.request({method:"eth_sendRawTransactionSync",params:n?[t,q(n)]:[t]},{retryCount:0}),o=(((l=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||zc)(s);if(o.status==="reverted"&&r)throw new F1({receipt:o});return o}function bL(e){return{call:t=>Mi(e,t),createAccessList:t=>h6(e,t),createBlockFilter:()=>dN(e),createContractEventFilter:t=>qg(e,t),createEventFilter:t=>b6(e,t),createPendingTransactionFilter:()=>y6(e),estimateContractGas:t=>FM(e,t),estimateGas:t=>Of(e,t),getBalance:t=>pN(e,t),getBlobBaseFee:()=>fN(e),getBlock:t=>Rr(e,t),getBlockNumber:t=>Gi(e,t),getBlockTransactionCount:t=>mN(e,t),getBytecode:t=>Hl(e,t),getChainId:()=>ls(e),getCode:t=>Hl(e,t),getContractEvents:t=>Jg(e,t),getEip712Domain:t=>bN(e,t),getEnsAddress:t=>KM(e,t),getEnsAvatar:t=>cN(e,t),getEnsName:t=>lN(e,t),getEnsResolver:t=>uN(e,t),getEnsText:t=>m6(e,t),getFeeHistory:t=>xN(e,t),estimateFeesPerGas:t=>BM(e,t),getFilterChanges:t=>Ql(e,t),getFilterLogs:t=>wN(e,t),getGasPrice:()=>Af(e),getLogs:t=>_f(e,t),getProof:t=>WN(e,t),estimateMaxPriorityFeePerGas:t=>IM(e,t),fillTransaction:t=>Bf(e,t),getStorageAt:t=>qN(e,t),getTransaction:t=>Yf(e,t),getTransactionConfirmations:t=>YN(e,t),getTransactionCount:t=>If(e,t),getTransactionReceipt:t=>au(e,t),multicall:t=>KN(e,t),prepareTransactionRequest:t=>$i(e,t),readContract:t=>zr(e,t),sendRawTransaction:t=>Lf(e,t),sendRawTransactionSync:t=>Qf(e,t),simulate:t=>Kf(e,t),simulateBlocks:t=>Kf(e,t),simulateCalls:t=>aL(e,t),simulateContract:t=>DM(e,t),verifyHash:t=>Ni(e,t),verifyMessage:t=>oL(e,t),verifySiweMessage:t=>hL(e,t),verifyTypedData:t=>iL(e,t),uninstallFilter:t=>Jl(e,t),waitForTransactionReceipt:t=>O6(e,t),watchBlocks:t=>cL(e,t),watchBlockNumber:t=>U6(e,t),watchContractEvent:t=>HM(e,t),watchEvent:t=>lL(e,t),watchPendingTransactions:t=>uL(e,t)}}function yL(e){const{key:t="public",name:r="Public Client"}=e;return i6({...e,key:t,name:r,type:"publicClient"}).extend(bL)}async function gL(e,{chain:t}){const{id:r,name:n,nativeCurrency:s,rpcUrls:a,blockExplorers:o}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:q(r),chainName:n,nativeCurrency:s,rpcUrls:a.default.http,blockExplorerUrls:o?Object.values(o).map(({url:i})=>i):void 0}]},{dedupe:!0,retryCount:0})}function xL(e,t){const{abi:r,args:n,bytecode:s,...a}=t,o=Gl({abi:r,args:n,bytecode:s});return eu(e,{...a,...a.authorizationList?{to:null}:{},data:o})}async function wL(e){var r;return((r=e.account)==null?void 0:r.type)==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ho(n))}async function vL(e,t={}){const{account:r=e.account,chainId:n}=t,s=r?Ke(r):void 0,a=n?[s==null?void 0:s.address,[q(n)]]:[s==null?void 0:s.address],o=await e.request({method:"wallet_getCapabilities",params:a}),i={};for(const[c,l]of Object.entries(o)){i[Number(c)]={};for(let[u,d]of Object.entries(l))u==="addSubAccount"&&(u="unstable_addSubAccount"),i[Number(c)][u]=d}return typeof n=="number"?i[n]:i}async function EL(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function D6(e,t){var c;const{account:r=e.account,chainId:n,nonce:s}=t;if(!r)throw new kn({docsPath:"/docs/eip7702/prepareAuthorization"});const a=Ke(r),o=(()=>{if(t.executor)return t.executor==="self"?t.executor:Ke(t.executor)})(),i={address:t.contractAddress??t.address,chainId:n,nonce:s};return typeof i.chainId>"u"&&(i.chainId=((c=e.chain)==null?void 0:c.id)??await se(e,ls,"getChainId")({})),typeof i.nonce>"u"&&(i.nonce=await se(e,If,"getTransactionCount")({address:a.address,blockTag:"pending"}),(o==="self"||o!=null&&o.address&&Ja(o.address,a.address))&&(i.nonce+=1)),i}async function kL(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>ep(r))}async function CL(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function TL(e,t){const{chain:r=e.chain}=t,n=t.timeout??Math.max(((r==null?void 0:r.blockTime)??0)*3,5e3),s=await n6(e,t);return await a6(e,{...t,id:s.id,timeout:n})}const Jf=new Da(128);async function _6(e,t){var D,L,T,h;const{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:a,blobs:o,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,pollingInterval:y,throwOnReceiptRevert:g,type:E,value:w,...v}=t,S=t.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof r>"u")throw new kn({docsPath:"/docs/actions/wallet/sendTransactionSync"});const C=r?Ke(r):null;try{rn(t);const b=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await jl({authorization:a[0]}).catch(()=>{throw new $("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let x;n!==null&&(x=await se(e,ls,"getChainId")({}),lp({currentChainId:x,chain:n}));const A=(T=(L=(D=e.chain)==null?void 0:D.formatters)==null?void 0:L.transactionRequest)==null?void 0:T.format,F=(A||_r)({...Ws(v,{format:A}),accessList:s,account:C,authorizationList:a,blobs:o,chainId:x,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,to:b,type:E,value:w},"sendTransaction"),_=Jf.get(e.uid),k=_?"wallet_sendTransaction":"eth_sendTransaction",P=await(async()=>{try{return await e.request({method:k,params:[F]},{retryCount:0})}catch(U){if(_===!1)throw U;const z=U;if(z.name==="InvalidInputRpcError"||z.name==="InvalidParamsRpcError"||z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(H=>(Jf.set(e.uid,!0),H)).catch(H=>{const G=H;throw G.name==="MethodNotFoundRpcError"||G.name==="MethodNotSupportedRpcError"?(Jf.set(e.uid,!1),z):G});throw z}})(),O=await se(e,O6,"waitForTransactionReceipt")({checkReplacement:!1,hash:P,pollingInterval:y,timeout:S});if(g&&O.status==="reverted")throw new F1({receipt:O});return O}if((C==null?void 0:C.type)==="local"){const x=await se(e,$i,"prepareTransactionRequest")({account:C,accessList:s,authorizationList:a,blobs:o,chain:n,data:i,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:m,nonceManager:C.nonceManager,parameters:[...Ff,"sidecars"],type:E,value:w,...v,to:b}),A=(h=n==null?void 0:n.serializers)==null?void 0:h.transaction,I=await C.signTransaction(x,{serializer:A});return await se(e,Qf,"sendRawTransactionSync")({serializedTransaction:I,throwOnReceiptRevert:g})}throw(C==null?void 0:C.type)==="smart"?new Hs({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Hs({docsPath:"/docs/actions/wallet/sendTransactionSync",type:C==null?void 0:C.type})}catch(b){throw b instanceof Hs?b:Zl(b,{...t,account:C,chain:t.chain||void 0})}}async function SL(e,t){const{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function AL(e,t){const{account:r=e.account}=t;if(!r)throw new kn({docsPath:"/docs/eip7702/signAuthorization"});const n=Ke(r);if(!n.signAuthorization)throw new Hs({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const s=await D6(e,t);return n.signAuthorization(s)}async function PL(e,{account:t=e.account,message:r}){if(!t)throw new kn({docsPath:"/docs/actions/wallet/signMessage"});const n=Ke(t);if(n.signMessage)return n.signMessage({message:r});const s=typeof r=="string"?Sa(r):r.raw instanceof Uint8Array?Fe(r.raw):r.raw;return e.request({method:"personal_sign",params:[s,n.address]},{retryCount:0})}async function IL(e,t){var l,u,d,f;const{account:r=e.account,chain:n=e.chain,...s}=t;if(!r)throw new kn({docsPath:"/docs/actions/wallet/signTransaction"});const a=Ke(r);rn({account:a,...t});const o=await se(e,ls,"getChainId")({});n!==null&&lp({currentChainId:o,chain:n});const i=(n==null?void 0:n.formatters)||((l=e.chain)==null?void 0:l.formatters),c=((u=i==null?void 0:i.transactionRequest)==null?void 0:u.format)||_r;return a.signTransaction?a.signTransaction({...s,chainId:o},{serializer:(f=(d=e.chain)==null?void 0:d.serializers)==null?void 0:f.transaction}):await e.request({method:"eth_signTransaction",params:[{...c({...s,account:a},"signTransaction"),chainId:q(o),from:a.address}]},{retryCount:0})}async function BL(e,t){const{account:r=e.account,domain:n,message:s,primaryType:a}=t;if(!r)throw new kn({docsPath:"/docs/actions/wallet/signTypedData"});const o=Ke(r),i={EIP712Domain:k6({domain:n}),...t.types};if(E6({domain:n,message:s,primaryType:a,types:i}),o.signTypedData)return o.signTypedData({domain:n,message:s,primaryType:a,types:i});const c=LN({domain:n,message:s,primaryType:a,types:i});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function FL(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:q(t)}]},{retryCount:0})}async function UL(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}async function OL(e,t){return ji.internal(e,_6,"sendTransactionSync",t)}function DL(e){return{addChain:t=>gL(e,t),deployContract:t=>xL(e,t),fillTransaction:t=>Bf(e,t),getAddresses:()=>wL(e),getCallsStatus:t=>s6(e,t),getCapabilities:t=>vL(e,t),getChainId:()=>ls(e),getPermissions:()=>EL(e),prepareAuthorization:t=>D6(e,t),prepareTransactionRequest:t=>$i(e,t),requestAddresses:()=>kL(e),requestPermissions:t=>CL(e,t),sendCalls:t=>n6(e,t),sendCallsSync:t=>TL(e,t),sendRawTransaction:t=>Lf(e,t),sendRawTransactionSync:t=>Qf(e,t),sendTransaction:t=>eu(e,t),sendTransactionSync:t=>_6(e,t),showCallsStatus:t=>SL(e,t),signAuthorization:t=>AL(e,t),signMessage:t=>PL(e,t),signTransaction:t=>IL(e,t),signTypedData:t=>BL(e,t),switchChain:t=>FL(e,t),waitForCallsStatus:t=>a6(e,t),watchAsset:t=>UL(e,t),writeContract:t=>ji(e,t),writeContractSync:t=>OL(e,t)}}function _L(e){const{key:t="wallet",name:r="Wallet Client",transport:n}=e;return i6({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(DL)}function M6({key:e,methods:t,name:r,request:n,retryCount:s=3,retryDelay:a=150,timeout:o,type:i},c){const l=o6();return{config:{key:e,methods:t,name:r,request:n,retryCount:s,retryDelay:a,timeout:o,type:i},request:EN(n,{methods:t,retryCount:s,retryDelay:a,uid:l}),value:c}}function ML(e,t={}){const{key:r="custom",methods:n,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>M6({key:r,methods:n,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class NL extends ${constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function LL(e,t={}){const{batch:r,fetchFn:n,fetchOptions:s,key:a="http",methods:o,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=t;return({chain:f,retryCount:m,timeout:y})=>{const{batchSize:g=1e3,wait:E=0}=typeof r=="object"?r:{},w=t.retryCount??m,v=y??t.timeout??1e4,S=f==null?void 0:f.rpcUrls.default.http[0];if(!S)throw new NL;const C=UN(S,{fetchFn:n,fetchOptions:s,onRequest:c,onResponse:l,timeout:v});return M6({key:a,methods:o,name:i,async request({method:D,params:L}){const T={method:D,params:L},{schedule:h}=Sg({id:S,wait:E,shouldSplitBatch(I){return I.length>g},fn:I=>C.request({body:I}),sort:(I,F)=>I.id-F.id}),b=async I=>r?h(I):[await C.request({body:I})],[{error:x,result:A}]=await b(T);if(d)return{error:x,result:A};if(x)throw new Ep({body:T,error:x,url:S});return A},retryCount:w,retryDelay:u,timeout:v,type:"http"},{fetchOptions:s,url:S})}}function zL(e){const{r:t,s:r}=Fi.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[s,a]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof s<"u"?{r:q(t,{size:32}),s:q(r,{size:32}),v:s,yParity:a}:{r:q(t,{size:32}),s:q(r,{size:32}),yParity:a}}const RL=(e,t)=>{const r=Object.values(CM).find(o=>o.id===e);if(!r)return{walletClient:void 0,publicClient:void 0};const n=t?ML(t):void 0,s=n?_L({chain:r,transport:n}):void 0,a=yL({chain:r,transport:n||LL()});return{walletClient:s,publicClient:a}},HL=()=>B.jsx("div",{className:"twap-error-fallback",children:B.jsx("p",{style:{fontSize:20,fontWeight:600,textAlign:"center",width:"100%",marginTop:40},children:"Something went wrong"})});function $L({children:e}){return B.jsx(h3,{FallbackComponent:HL,onError:t=>ct.onCrash(t),children:B.jsx(B.Fragment,{children:e})})}const e0=M.createContext({}),GL=new e3({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),jL=e=>{var n,s,a;const t=Z(o=>o.updateState),r=Z(o=>o.state.isMarketOrder);return M.useEffect(()=>{setInterval(()=>{t({currentTime:Date.now()})},6e4)},[t]),M.useEffect(()=>{var o,i,c,l,u,d,f,m,y,g,E,w;t({isMarketOrder:e.module!==Ee.LIMIT?!1:(i=(o=e.overrides)==null?void 0:o.state)==null?void 0:i.isMarketOrder,typedChunks:(l=(c=e.overrides)==null?void 0:c.state)==null?void 0:l.chunks,typedFillDelay:(d=(u=e.overrides)==null?void 0:u.state)==null?void 0:d.fillDelay,typedDuration:(m=(f=e.overrides)==null?void 0:f.state)==null?void 0:m.duration,typedLimitPrice:(g=(y=e.overrides)==null?void 0:y.state)==null?void 0:g.limitPrice,typedTriggerPrice:(w=(E=e.overrides)==null?void 0:E.state)==null?void 0:w.triggerPrice,triggerPricePercent:void 0,limitPricePercent:void 0})},[(n=e.overrides)==null?void 0:n.state,e.module]),M.useEffect(()=>{var o,i,c,l;t({typedLimitPrice:(i=(o=e.overrides)==null?void 0:o.state)==null?void 0:i.limitPrice,typedTriggerPrice:(l=(c=e.overrides)==null?void 0:c.state)==null?void 0:l.triggerPrice,triggerPricePercent:void 0,limitPricePercent:void 0})},[(s=e.srcToken)==null?void 0:s.address,(a=e.dstToken)==null?void 0:a.address]),M.useEffect(()=>{e.module===Ee.LIMIT&&t({isMarketOrder:!1})},[e.module]),M.useEffect(()=>{r&&t({isInvertedTrade:!1})},[r]),null},VL=({marketReferencePrice:e,srcToken:t,dstToken:r,chainId:n})=>{const s=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{if(Pd(t,r,n)||Id(t,r,n))return{isLoading:!1,noLiquidity:!1,value:Ac((t==null?void 0:t.decimals)||18,s||"0")};if(j(e.value||0).isZero()||j(s||0).isZero())return e;const a=j(e.value||0).dividedBy(s||0).toFixed();return{...e,value:a}},[e,s,t,r,n])},WL=e=>{const t=Fo(Bc.MIN_CHUNK_SIZE_USD);return t?parseInt(t):e},qL=e=>{const t=Z(c=>c.state.acceptedMarketPrice),{walletClient:r,publicClient:n}=M.useMemo(()=>RL(e.chainId,e.provider),[e.chainId,e.provider]),s=M.useMemo(()=>ld(e.chainId,e.partner),[e.chainId,e.partner]),a=VL(e),o=M.useMemo(()=>WL(e.minChunkSizeUsd),[e.minChunkSizeUsd]);M.useEffect(()=>{ct.onLoad(),s&&e.chainId&&ct.init(s,o,e.chainId)},[s,e.chainId,o]);const i=M.useMemo(()=>s?Rm(s.partner):[],[s]);return B.jsxs(e0.Provider,{value:{...e,minChunkSizeUsd:o,account:e.account,walletClient:r,publicClient:n,marketPrice:t||a.value,marketPriceLoading:!t&&a.isLoading,noLiquidity:!t&&a.noLiquidity,config:s,slippage:e.priceProtection,supportedChains:i},children:[B.jsx(jL,{...e}),B.jsx($L,{children:e.children})]})},YL=e=>B.jsx(t3,{client:GL,children:B.jsx(qL,{...e})}),ne=()=>{if(!e0)throw new Error("useSpotContext must be used within a WidgetProvider");return M.useContext(e0)},KL=2e4,ZL=[{text:"Minutes",value:Gt.Minutes},{text:"Hours",value:Gt.Hours},{text:"Days",value:Gt.Days}],XL="The protocol uses an oracle price to help protect users from unfavorable executions. If the execution price is worse than the oracle price by more than the allowed percentage, the transaction will not be executed.";var t0={},QL=[{id:"fa",name:"Font Awesome",projectUrl:"https://fontawesome.com/",license:"CC BY 4.0 License",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"io",name:"Ionicons 4",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"io5",name:"Ionicons 5",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"md",name:"Material Design icons",projectUrl:"http://google.github.io/material-design-icons/",license:"Apache License Version 2.0",licenseUrl:"https://github.com/google/material-design-icons/blob/master/LICENSE"},{id:"ti",name:"Typicons",projectUrl:"http://s-ings.com/typicons/",license:"CC BY-SA 3.0",licenseUrl:"https://creativecommons.org/licenses/by-sa/3.0/"},{id:"go",name:"Github Octicons icons",projectUrl:"https://octicons.github.com/",license:"MIT",licenseUrl:"https://github.com/primer/octicons/blob/master/LICENSE"},{id:"fi",name:"Feather",projectUrl:"https://feathericons.com/",license:"MIT",licenseUrl:"https://github.com/feathericons/feather/blob/master/LICENSE"},{id:"gi",name:"Game Icons",projectUrl:"https://game-icons.net/",license:"CC BY 3.0",licenseUrl:"https://creativecommons.org/licenses/by/3.0/"},{id:"wi",name:"Weather Icons",projectUrl:"https://erikflowers.github.io/weather-icons/",license:"SIL OFL 1.1",licenseUrl:"http://scripts.sil.org/OFL"},{id:"di",name:"Devicons",projectUrl:"https://vorillaz.github.io/devicons/",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ai",name:"Ant Design Icons",projectUrl:"https://github.com/ant-design/ant-design-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"bs",name:"Bootstrap Icons",projectUrl:"https://github.com/twbs/icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ri",name:"Remix Icon",projectUrl:"https://github.com/Remix-Design/RemixIcon",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"fc",name:"Flat Color Icons",projectUrl:"https://github.com/icons8/flat-color-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"gr",name:"Grommet-Icons",projectUrl:"https://github.com/grommet/grommet-icons",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"hi",name:"Heroicons",projectUrl:"https://github.com/refactoringui/heroicons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"si",name:"Simple Icons",projectUrl:"https://simpleicons.org/",license:"CC0 1.0 Universal",licenseUrl:"https://creativecommons.org/publicdomain/zero/1.0/"},{id:"im",name:"IcoMoon Free",projectUrl:"https://github.com/Keyamoon/IcoMoon-Free",license:"CC BY 4.0 License"},{id:"bi",name:"BoxIcons",projectUrl:"https://github.com/atisawd/boxicons",license:"CC BY 4.0 License"},{id:"cg",name:"css.gg",projectUrl:"https://github.com/astrit/css.gg",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"vsc",name:"VS Code Icons",projectUrl:"https://github.com/microsoft/vscode-codicons",license:"CC BY 4.0",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"}],r0={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},n0=M.createContext&&M.createContext(r0),us=function(){return us=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},us.apply(this,arguments)},JL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};function N6(e){return e&&e.map(function(t,r){return M.createElement(t.tag,us({key:r},t.attr),N6(t.child))})}function ez(e){return function(t){return M.createElement(L6,us({attr:us({},e.attr)},t),N6(e.child))}}function L6(e){var t=function(r){var n=e.attr,s=e.size,a=e.title,o=JL(e,["attr","size","title"]),i=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),M.createElement("svg",us({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:c,style:us(us({color:e.color||r.color},r.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),a&&M.createElement("title",null,a),e.children)};return n0!==void 0?M.createElement(n0.Consumer,null,function(r){return t(r)}):t(r0)}const cu=tw(Object.freeze(Object.defineProperty({__proto__:null,DefaultContext:r0,GenIcon:ez,IconBase:L6,IconContext:n0,IconsManifest:QL},Symbol.toStringTag,{value:"Module"})));var z6;function tz(){if(z6)return t0;z6=1;var e=cu.GenIcon;return t0.IoIosArrowDown=function(r){return e({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"}}]})(r)},t0}var rz=tz(),s0={},R6;function nz(){if(R6)return s0;R6=1;var e=cu.GenIcon;return s0.AiOutlineCopy=function(r){return e({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]})(r)},s0}var sz=nz();//! moment.js
110
110
  //! version : 2.30.1
111
111
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
112
112
  //! license : MIT
@@ -123,4 +123,4 @@ te.version="2.30.1",az(Je),te.fn=Y,te.min=qR,te.max=YR,te.now=KR,te.utc=sn,te.un
123
123
  Prefix can't start with '-' when allowNegative is true.
124
124
  prefix: `+s+`
125
125
  allowNegative: `+a+`
126
- `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function vG(e){e=wG(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=z0);var a=e.onBlur;a===void 0&&(a=z0);var o=e.thousandSeparator,i=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,m=e.onValueChange,y=aG(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=Bu(e),E=g.decimalSeparator,w=g.allowedDecimalSeparators,v=function(P){return V2(P,e)},S=function(P,O){return gG(P,O,e)},C=fo(d)?u:d,D=f??yG(C,l,t);fo(d)?fo(u)||(D=D||typeof u=="number"):D=D||typeof d=="number";var L=function(P){return z2(P)?P:(typeof P=="number"&&(P=G2(P)),D&&typeof i=="number"?j2(P,i,!!c):P)},T=mG(L(d),L(u),!!D,v,S,m),h=T[0],b=h.numAsString,x=h.formattedValue,A=T[1],I=function(P){var O=P.target,U=P.key,z=O.selectionStart,H=O.selectionEnd,G=O.value;if(G===void 0&&(G=""),(U==="Backspace"||U==="Delete")&&H<l.length){P.preventDefault();return}if(z!==H){s(P);return}U==="Backspace"&&G[0]==="-"&&z===l.length+1&&r&&sc(O,1),i&&c&&(U==="Backspace"&&G[z-1]===E?(sc(O,z-1),P.preventDefault()):U==="Delete"&&G[z]===E&&P.preventDefault()),w!=null&&w.includes(U)&&G[z]===E&&sc(O,z+1);var J=o===!0?",":o;U==="Backspace"&&G[z-1]===J&&sc(O,z-1),U==="Delete"&&G[z]===J&&sc(O,z+1),s(P)},F=function(P){var O=b;if(O.match(/\d/g)||(O=""),n||(O=dG(O)),c&&i&&(O=j2(O,i,c)),O!==b){var U=V2(O,e);A({formattedValue:U,value:O,floatValue:parseFloat(O)},{event:P,source:L0.event})}a(P)},_=function(P){return P===E?!0:L2(P)},k=function(P){var O=P.currentValue,U=P.lastValue,z=P.formattedValue,H=P.currentValueIndex,G=P.formattedValueIndex,J=O[H],pe=z[G],he=pG(U,O),ie=he.to,de=function(Be){return S(Be).indexOf(".")+l.length};return d===0&&c&&i&&O[ie.start]===E&&de(O)<H&&de(z)>G?!1:H>=ie.start&&H<ie.end&&w&&w.includes(J)&&pe===E?!0:J===pe};return Object.assign(Object.assign({},y),{value:x,valueIsNumericString:!1,isValidInputCharacter:_,isCharacterSame:k,onValueChange:A,format:v,removeFormatting:S,getCaretBoundary:function(P){return xG(P,e)},onKeyDown:I,onBlur:F})}const Fu=(e,t)=>M.useMemo(()=>Ac(e,t),[e,t]),Vr=(e,t)=>M.useMemo(()=>Xr(e,t),[e,t]),ac=()=>{const{chainId:e}=se();return M.useMemo(()=>Bs(e),[e])},H0=e=>{const t=ac();return M.useMemo(()=>{if(!(!e||!t))return _o(e,t.id)},[e,t])},aa=(e,t)=>M.useMemo(()=>!e||!t||j(e||"0").isZero()||j(t||"0").isZero()?"":j(e||"0").times(t).toFixed(),[e,t]),EG=()=>{const{srcToken:e,dstToken:t,chainId:r}=se();return M.useMemo(()=>Pd(e,t,r),[e,t,r])},kG=()=>{const{srcToken:e,dstToken:t,chainId:r}=se();return M.useMemo(()=>Id(e,t,r),[e,t,r])},CG=()=>{const e=EG(),t=kG();return e||t},$0=e=>{const{overrides:t}=se();return M.useMemo(()=>t!=null&&t.dateFormat?t.dateFormat(e||0):te(e).format("DD/MM/YYYY HH:mm"),[e,t==null?void 0:t.dateFormat])};function TG(){const{callbacks:e}=se();return M.useCallback(async t=>{var r;try{await navigator.clipboard.writeText(t),(r=e==null?void 0:e.onCopy)==null||r.call(e)}catch(n){console.error("Copy failed:",n)}},[e==null?void 0:e.onCopy])}const SG=(e,t)=>M.useMemo(()=>Do(e==null?void 0:e.toString(),t),[e,t]),Ge=({value:e,decimalScale:t=3,prefix:r,suffix:n})=>{var c;const s=SG(e,t),{overrides:a}=se(),o=a==null?void 0:a.numberFormat,i=vG({allowLeadingZeros:!0,thousandSeparator:",",displayType:"text",value:s||"",decimalScale:18,prefix:r,suffix:n});return o?o(e||""):(c=i.value)==null?void 0:c.toString()},AG={expirationTooltip:"This is the date and time marking the end of the period which you have selected for your order to be executed.",tradeSizeTooltip:"The number of input tokens that will be removed from your balance and swapped for the output token in each individual trade.",totalTradesTooltip:"The total number of individual trades that will be scheduled as part of your order. Note that in limit orders, not all trades that are scheduled will be executed.",minDstAmountTooltip:" This is the minimum number of tokens that may be received. NOTE: This minimum only refers to executed trades. Some trades may not be executed if the limit price is higher than the available market prices and your order may only be partially filled.",limitPriceTooltip:"Trades will only execute if the available market price is better than the limit price, potentially resulting in partial fills or orders remaining unfilled upon expiration.",maxDurationTooltip:"This is the time period during which the order will be active. Please note that orders may be completed earlier than this time, partially filled, or remain unfilled based on the specified parameters.",tradeIntervalTootlip:"The estimated time that will elapse between each trade in your order. Note that as this time includes an allowance of two minutes for bidder auction and block settlement, which cannot be predicted exactly, actual time may vary.",triggerPriceTooltip:"The price at which the order will be executed. If the market price is higher than the trigger price, the order will be executed at the market price.",placeOrder:"Place order",enterAmount:"Enter an amount",emptyLimitPrice:"Limit price is required",insufficientFunds:"Insufficient Balance",tradeIntervalLabel:"Trade interval",expirationLabel:"Expiration",limitPrice:"Limit Price",finalExcecutionPrice:"Final execution price",marketPrice:"Market price",from:"From",to:"To (estimated)",Open:"Open",Completed:"Completed",Expired:"Expired",Canceled:"Canceled",minReceivedPerTrade:"Min. received per trade",triggerPricePerChunk:"Trigger Price per trade",maxChunksError:"Max. trades amount is {maxChunks}",minChunksError:"Min. trades amount is",minTradeSizeError:"Min. trade size is ${minTradeSize}",allOrders:"All",minFillDelayError:"Min. trade interval is {fillDelay}",maxFillDelayError:"Max. trade interval is {fillDelay}",recipient:"Recipient",marketOrderWarning:"Each individual trade in this order will be filled at the current market price at the time of execution.",limitPriceMessage:"Limit orders may not execute when the token's price is equal or close to the limit price, due to gas and standard swap fees.",limit:"Limit",maxDurationError:"Max. expiry is {duration}",minDurationError:"Min. expiry is {duration}",expiry:"Expiry",individualTradeSize:"Individual trade size",numberOfTrades:"No. of trades",AverageExecutionPrice:"Avg. execution price",twapMarket:"TWAP-market",twapLimit:"TWAP-limit",stopLoss:"Stop-loss",triggerPriceMarket:"Trigger Market Price ",triggerPriceLimit:"Trigger Limit Price ",takeProfit:"Take-profit",minReceived:"Min. received",noOrders:"No {status} Orders",noLiquidity:"No liquidity for this pair",excecutionSummary:"Execution summary",orderInfo:"Order info",wrapAction:"Wrap {symbol}",approveAction:"Approve {symbol}",createOrderAction:"Create {name} order",amountReceived:"Amount received",createdAt:"Created at",amountOut:"Amount out",status:"Status",progress:"Progress",minutes:"minutes",days:"days",tradeIntervalTitle:"Every",tradesAmountTitle:"Over",stopLossTooltip:"The trigger price at which your stop-loss order will be activated.",takeProfitTooltip:"The trigger price at which your take-profit order will be activated.",stopLossLabel:"Trigger Price",StopLossTriggerPriceError:"Trigger price must be less than market price",TakeProfitTriggerPriceError:"Trigger price must be greater than market price",triggerLimitPriceError:"Limit price must be less than trigger price",triggerPrice:"Trigger Price",tradePrice:"Trade Price",triggerMarketPriceDisclaimer:" In extreme market movements, slippage may occur and the executed price of the market order may be worse than the specified trigger price.",stopLossLimitPriceTooltip:"The stop loss order will execute at the specified limit price or better, once the stop price is triggered.",stopLossDurationTooltip:"This is the time period during which the order will be active. Please note that orders may be completed earlier than this time, or remain unfilled based on the specified parameters.",emptyTriggerPrice:"Trigger price is required",id:"ID",fees:"Fees {value}",version:"Version",maxOrderSizeError:"Max. trade size is {maxOrderSize} USD",viewOnExplorer:"View on explorer",proceedInWallet:"Proceed in wallet",wrapMsg:"Note: {symbol} was wrapped to {wSymbol}",createOrderActionSuccess:"{name} order placed"};function PG(e){let t=e;const r=/\{[^{}]*\}/g;for(;r.test(t);)t=t.replace(r,"");return t}const Ue=()=>{const e=se();return M.useCallback((r,n)=>{var o,i;const s=(o=e.getTranslation)==null?void 0:o.call(e,r,n);if(s&&s!==r)return s;const a=((i=e.translations)==null?void 0:i[r])||AG[r];return PG(a.replace(/{(\w+)}/g,(c,l)=>(n==null?void 0:n[l])||c))},[e.getTranslation,e.translations])},Uu=({value:e})=>{const t=Ge({value:e,decimalScale:2});return t?B.jsx("small",{className:"twap-order-details__detail-row-value-usd",children:` ($${t})`}):null},IG=({deadline:e,label:t,tooltip:r})=>{const n=$0(e);return B.jsx(hr,{title:t,tooltip:r,children:n})},BG=({price:e,dstToken:t,label:r,tooltip:n,usd:s})=>{const a=Ge({value:e});return j(e||0).isZero()?null:B.jsx(hr,{title:r,tooltip:n,children:B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[`${a||"-"} ${t==null?void 0:t.symbol}`,B.jsx(Uu,{value:s})]})})},FG=({price:e,dstToken:t,percentage:r,isMarketOrder:n})=>{const s=Ge({value:e}),a=Ue();return n?null:B.jsx(hr,{title:a("limitPrice")||"",tooltip:a("limitPriceTooltip")||"",children:B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[`${s||"-"} ${t==null?void 0:t.symbol}`,r&&B.jsx("small",{children:`(${r}%)`})]})})},UG=({tradeSize:e,srcToken:t,trades:r,label:n,tooltip:s})=>r===1?null:B.jsx(hr,{title:n,tooltip:s,children:`${e||"-"} ${(t==null?void 0:t.symbol)||""}`}),OG=({dstToken:e,dstMinAmountOut:t,label:r,tooltip:n,usd:s})=>{const a=Ge({value:t});return j(t||0).isZero()?null:B.jsxs(hr,{title:r,tooltip:n,children:[`${t?a:"-"} ${e==null?void 0:e.symbol}`,B.jsx(Uu,{value:s})]})},DG=({trades:e,label:t,tooltip:r})=>e===1?null:B.jsx(hr,{title:t,tooltip:r,children:e}),_G=()=>{var s;const e=Ue(),{account:t}=se(),r=(s=ac())==null?void 0:s.explorer,n=Td(t);return B.jsx(hr,{title:e("recipient")||"",children:r?B.jsx("a",{href:`${r}/address/${t}`,target:"_blank",children:n}):n})},MG=({fillDelayMillis:e,chunks:t=0,label:r,tooltip:n})=>{const s=M.useMemo(()=>i1(e),[e]);return t===1?null:B.jsx(hr,{title:r,tooltip:n,children:s})},hr=({title:e,tooltip:t,children:r,className:n="",onClick:s,style:a})=>{const{components:o}=se(),i=o.Tooltip;return B.jsxs("div",{className:`${n} twap-order-details__detail-row`,onClick:s,style:a,children:[B.jsxs("div",{className:"twap-order-details__detail-row-label",children:[B.jsx("p",{className:"twap-order-details__detail-row-label-value",children:e}),t&&i&&B.jsx(i,{tooltipText:t})]}),B.jsx("div",{className:"twap-order-details__detail-row-value",children:r})]})},NG=({id:e})=>{const{components:t}=se(),r=t==null?void 0:t.Tooltip,n=TG();return e.startsWith("0x")?B.jsx(hr,{title:"ID",onClick:()=>n(e),style:{cursor:"pointer"},children:r&&B.jsx(r,{tooltipText:e,children:B.jsxs("div",{className:"twap-order-details__detail-row-value-id",children:[B.jsx("p",{children:Td(e)}),B.jsx(sz.AiOutlineCopy,{})]})})}):B.jsx(hr,{title:"ID",children:e})},LG=({version:e})=>B.jsx(hr,{title:"Version",children:e});function xe({children:e,className:t=""}){return B.jsx("div",{className:`${t} twap-order-details`,children:e})}const zG=({children:e})=>e,RG=({fees:e,label:t,usd:r,dstTokenSymbol:n})=>{const s=Ge({value:e});return B.jsxs(hr,{title:t,children:[`${e?s:"-"} ${n}`,B.jsx(Uu,{value:r})]})};xe.Deadline=IG,xe.Fees=RG,xe.TradeSize=UG,xe.MinDestAmount=OG,xe.TradesAmount=DG,xe.Recipient=_G,xe.TradeInterval=MG,xe.DetailRow=hr,xe.TriggerPrice=BG,xe.LimitPrice=FG,xe.OrderID=NG,xe.Container=zG,xe.OrderVersion=LG,xe.USD=Uu;const G0=()=>{const{publicClient:e}=se();return xn({mutationFn:async t=>{if(!e)throw new Error("publicClient is not defined");const r=10;let n=0,s=1e3;for(;n<r;)try{return await e.waitForTransactionReceipt({hash:t,confirmations:2,retryDelay:s})}catch(a){if(n++,n>=r)throw new Error(`Failed after ${r} attempts: ${a}`);await new Promise(o=>setTimeout(o,s)),s*=2}}}).mutateAsync},j0=()=>{const{account:e,walletClient:t,publicClient:r,config:n,callbacks:s,chainId:a}=se(),o=G0(),i=Z(u=>u.updateState),c=async u=>{ct.onCancelOrderRequest(u.map(d=>d.id.toString()),1);try{return(await Promise.all(u.map(f=>t.writeContract({account:e,address:f.twapAddress,abi:_m,functionName:"cancel",args:[f.id],chain:t.chain}))))[0]}catch(d){throw ct.onCancelOrderError(d),d}},l=async u=>{var d;try{ct.onCancelOrderRequest(u.map(y=>y.hash),2);const f=await t.writeContract({account:e,address:n.repermit,abi:Dm,functionName:"cancel",args:[u.map(y=>y.hash)],chain:t.chain}),m=await o(f);if(!m)throw new Error("failed to get transaction receipt");if(m.status==="reverted")throw new Error("failed to cancel order");return ct.onCancelOrderSuccess(f),(d=s==null?void 0:s.onCancelOrderSuccess)==null||d.call(s,{orders:u,txHash:f,explorerUrl:_o(f,a)}),m.transactionHash}catch(f){throw ct.onCancelOrderError(f),f}};return xn({mutationFn:async({orders:u})=>{var d,f;if(!e||!t||!r||!n)throw new Error("missing required parameters");try{(d=s==null?void 0:s.onCancelOrderRequest)==null||d.call(s,u),i({cancelOrderStatus:kt.LOADING,cancelOrderTxHash:void 0,cancelOrderError:void 0});const m=u.filter(w=>w.version===1),y=u.filter(w=>w.version===2),[g,E]=await Promise.all([m.length?c(m):Promise.resolve(""),y.length?l(y):Promise.resolve("")]);return i({cancelOrderStatus:kt.SUCCESS,orderIdsToCancel:[]}),[...g||[],E]}catch(m){console.error("cancel order error",m),(f=s==null?void 0:s.onCancelOrderFailed)==null||f.call(s,m),Sd(m)?i({cancelOrderStatus:void 0}):(i({cancelOrderStatus:kt.FAILED}),ct.onCancelOrderError(m))}}})},W2=e=>{const t=Ue();return M.useMemo(()=>e?e.type===dt.TRIGGER_PRICE_MARKET?t("triggerPriceMarket"):e.type===dt.TRIGGER_PRICE_LIMIT?t("triggerPriceLimit"):e.type===dt.TWAP_MARKET?t("twapMarket"):e.type===dt.TWAP_LIMIT?t("twapLimit"):t("twapMarket"):t("twapMarket"),[t,e==null?void 0:e.type])},V0=()=>{const{account:e,config:t,chainId:r}=se();return M.useMemo(()=>["useTwapOrderHistoryManager",e,t==null?void 0:t.partner,r],[e,t,r])},HG=()=>{const e=_c(),{account:t}=se(),r=V0();return M.useCallback(n=>{e.setQueryData(r,s=>s?s!=null&&s.some(a=>a.id===n.id)?s:[n,...s]:[n])},[e,r,t])},$G=()=>{const{callbacks:e,refetchBalances:t}=se(),r=_c(),n=V0();return M.useCallback(s=>{var c;const a=r.getQueryData(n);let o=!1;const i=[];a&&a.forEach(l=>{var d;const u=s.find(f=>f.id===l.id);u&&u.progress!==l.progress&&(o=!0,i.push(u),u.status===ut.Completed&&((d=e==null?void 0:e.onOrderFilled)==null||d.call(e,u)))}),o&&((c=e==null?void 0:e.onOrdersProgressUpdate)==null||c.call(e,i),t==null||t())},[r,n,e,t])},GG=()=>{const{account:e,config:t,chainId:r}=se(),n=V0(),s=$G();return f3({refetchInterval:KL,refetchOnWindowFocus:!0,retry:!1,staleTime:1/0,queryKey:n,queryFn:async({signal:a})=>{if(!e||!r||!t)return[];const o=await Ih({signal:a,chainId:r,config:t.twapConfig,account:e});return s(o),o.map(i=>t!=null&&t.twapConfig?{...i,fillDelayMillis:td(i,t.twapConfig)}:i)}})},Ou=()=>{const{data:e,isLoading:t,error:r,refetch:n,isRefetching:s}=GG(),{mutateAsync:a}=j0();return M.useMemo(()=>({orders:{all:e??[],open:Du(e??[],ut.Open),completed:Du(e??[],ut.Completed),expired:Du(e??[],ut.Expired),canceled:Du(e??[],ut.Canceled)},isLoading:t,error:r,refetch:()=>n().then(o=>o.data),cancelOrder:a,isRefetching:s}),[e,t,r,n,a,s])},q2=()=>{const e=Z(r=>r.state.orderHistoryStatusFilter),{orders:t}=Ou();return M.useMemo(()=>e?t.all.filter(r=>r.status.toLowerCase()===e.toLowerCase())||[]:t.all,[e,t])},Du=(e,t)=>e.filter(r=>r.status===t).sort((r,n)=>n.createdAt-r.createdAt),jG=(e,t,r)=>M.useMemo(()=>{if(!(!e||!t||!r||r!=null&&r.isMarketPrice))return l1(r,e==null?void 0:e.decimals,t==null?void 0:t.decimals)},[r,e,t]),VG=(e,t,r)=>M.useMemo(()=>{if(!(!e||!t||!r))return c1(r,e.decimals,t.decimals)},[r,e,t]),Y2=()=>{const e=Z(r=>r.updateState),t=Z(r=>r.state.orderIdsToCancel);return M.useCallback(r=>{t!=null&&t.includes(r)?e({orderIdsToCancel:t==null?void 0:t.filter(n=>n!==r)}):e({orderIdsToCancel:[...t||[],r]})},[e,t])},WG=()=>{var T,h;const e=Ue(),{orders:t,isLoading:r,refetch:n,isRefetching:s}=Ou(),{mutateAsync:a,isPending:o}=j0(),i=q2(),c=Z(b=>b.updateState),l=Z(b=>b.state.orderHistoryStatusFilter),u=Z(b=>b.state.cancelOrdersMode),d=Z(b=>b.state.orderIdsToCancel),f=M.useCallback(b=>c({cancelOrdersMode:b,orderIdsToCancel:[]}),[c]),m=M.useCallback(()=>c({selectedOrderID:void 0}),[c]),y=M.useCallback(b=>a({orders:b}),[a]),g=M.useCallback(b=>c({orderHistoryStatusFilter:b}),[]),E=M.useMemo(()=>{const b=Object.keys(ut).map(x=>({text:x,value:x}));return[{text:e("allOrders"),value:""},...b]},[e]),w=Y2(),v=Z(b=>b.state.selectedOrderID),S=Z2(v),C=M.useMemo(()=>t.all.filter(b=>d==null?void 0:d.includes(b.id)),[t,d]),D=M.useCallback(()=>c({orderIdsToCancel:t.open.map(b=>b.id)}),[c,t]),L=M.useCallback(b=>a({orders:[b]}).then(x=>(x==null?void 0:x[0])||""),[a]);return{refetch:n,onHideSelectedOrder:m,onCancelOrders:y,onCancelOrder:L,onSelectStatus:g,onToggleCancelOrdersMode:f,onSelectOrder:w,isRefetching:s,orders:t,ordersToDisplay:i,isLoading:r,selectedOrder:v?S:void 0,openOrdersCount:((T=t==null?void 0:t.open)==null?void 0:T.length)||0,isCancelOrdersLoading:o,selectedStatus:l||((h=E[0])==null?void 0:h.value)||"",statuses:E,cancelOrdersMode:u,ordersToCancel:C,onSelectAllOrdersToCancel:D}},K2=e=>{var c,l,u,d,f;const t=Ue(),r=Ge({value:Vr((c=e.srcToken)==null?void 0:c.decimals,e.srcAmount)}),n=Ge({value:Vr((l=e.srcToken)==null?void 0:l.decimals,e.srcAmountPerTrade)}),s=Ge({value:Vr((u=e.dstToken)==null?void 0:u.decimals,e.minDestAmountPerTrade&&j(e.minDestAmountPerTrade).lte(1)?"":e.minDestAmountPerTrade)}),a=Ge({value:Vr((d=e.dstToken)==null?void 0:d.decimals,e.triggerPricePerTrade)}),o=Fu((f=e.dstToken)==null?void 0:f.decimals,e.limitPrice),i=Ge({value:e.limitPrice});return M.useMemo(()=>({data:{srcToken:e.srcToken,dstToken:e.dstToken,limitPrice:o,deadline:e.deadline,srcAmount:e.srcAmount,srcAmountPerTrade:e.srcAmountPerTrade,totalTrades:e.totalTrades,minDestAmountPerTrade:e.minDestAmountPerTrade,tradeInterval:e.tradeInterval,triggerPricePerTrade:e.triggerPricePerTrade,maker:e.maker},display:{limitPrice:{label:t("limitPrice"),value:i||""},deadline:{tooltip:t("expirationTooltip"),label:t("expirationLabel"),value:e.deadline||0},srcAmount:{label:t("amountOut"),value:r||"",token:e.srcToken},tradeSize:{tooltip:t("tradeSizeTooltip"),label:t("individualTradeSize"),value:n||"",token:e.srcToken},totalTrades:{tooltip:t("totalTradesTooltip"),label:t("numberOfTrades"),value:e.totalTrades||0},minDestAmountPerTrade:{tooltip:t("minDstAmountTooltip"),label:e.totalTrades&&e.totalTrades>1?t("minReceivedPerTrade"):t("minReceived"),value:s||"",token:e.dstToken},tradeInterval:{tooltip:t("tradeIntervalTootlip"),label:t("tradeIntervalLabel"),value:e.tradeInterval||0},triggerPricePerTrade:{tooltip:t("triggerPriceTooltip"),label:e.totalTrades&&e.totalTrades>1?t("triggerPricePerChunk"):t("triggerPrice"),value:a||"",token:e.dstToken},recipient:{label:t("recipient"),value:e.maker||""}}}),[e,t,r,n,s,a,i])},Z2=e=>{const{orders:t}=Ou(),{config:r,useToken:n}=se(),s=Ue(),a=M.useMemo(()=>t==null?void 0:t.all.find(g=>g.id===e),[t,e])||{},o=W2(a),i=n==null?void 0:n(a==null?void 0:a.srcTokenAddress),c=n==null?void 0:n(a==null?void 0:a.dstTokenAddress),l=jG(i,c,a),u=Ge({value:VG(i,c,a)}),d=Ge({value:Vr(i==null?void 0:i.decimals,a==null?void 0:a.srcAmountFilled)}),f=Ge({value:Vr(c==null?void 0:c.decimals,a==null?void 0:a.dstAmountFilled)}),m=Ge({value:a==null?void 0:a.progress,decimalScale:2}),y=K2({srcToken:i,dstToken:c,limitPrice:l,deadline:a==null?void 0:a.deadline,srcAmount:a==null?void 0:a.srcAmount,srcAmountPerTrade:a==null?void 0:a.srcAmountPerTrade,totalTrades:a==null?void 0:a.totalTradesAmount,minDestAmountPerTrade:a==null?void 0:a.dstMinAmountPerTrade,tradeInterval:(a==null?void 0:a.totalTradesAmount)===1||!a||!(r!=null&&r.twapConfig)?void 0:td(a,r.twapConfig),triggerPricePerTrade:a==null?void 0:a.triggerPricePerTrade,maker:a==null?void 0:a.maker});return M.useMemo(()=>({original:a,...y,title:o,createdAt:{label:s("createdAt"),value:a==null?void 0:a.createdAt},id:{label:s("id"),value:a==null?void 0:a.id},amountInFilled:{label:s("amountOut"),value:d,token:i},amountOutFilled:{label:s("amountReceived"),value:f,token:c},progress:{label:s("progress"),value:m},excecutionPrice:{label:(a==null?void 0:a.totalTradesAmount)===1?s("finalExcecutionPrice"):s("AverageExecutionPrice"),value:u,sellToken:i,buyToken:c},version:{label:s("version"),value:a==null?void 0:a.version}}),[a,s,u,d,f,m,o,i,c,y])},X2=M.createContext({}),Rt=()=>M.useContext(X2),qG=()=>{const e=Z(c=>c.state.selectedOrderID),t=Z2(e),r=Ue(),[n,s]=M.useState("panel1"),{components:a}=se(),o=a.TokenLogo;M.useEffect(()=>{s("panel1")},[t.id.value]);const i=c=>{s(n===c?!1:c)};return t?B.jsx(X2.Provider,{value:{order:t},children:B.jsxs("div",{className:"twap-orders__selected-order",children:[B.jsx(o1,{SrcTokenLogo:o&&B.jsx(o,{token:t.data.srcToken}),DstTokenLogo:o&&B.jsx(o,{token:t.data.dstToken}),fromTitle:r("from"),inToken:t.data.srcToken,toTitle:r("to"),outToken:t.data.dstToken}),B.jsx(xe.Container,{children:B.jsxs("div",{className:"twap-orders__selected-order-bottom",children:[B.jsxs("div",{className:"twap-orders__selected-order-accordions",children:[B.jsx(Q2,{title:r("excecutionSummary"),onClick:()=>i("panel1"),expanded:n==="panel1",children:B.jsx(rj,{})}),B.jsx(Q2,{title:r("orderInfo"),expanded:n==="panel2",onClick:()=>i("panel2"),children:B.jsx(YG,{})})]}),B.jsx(sj,{})]})})]})}):null},Q2=({expanded:e,onClick:t,children:r,title:n})=>B.jsxs("div",{className:"twap-orders__selected-order-accordion",children:[B.jsxs("div",{onClick:t,className:"twap-orders__selected-order-accordion-trigger",children:[B.jsx("p",{children:n}),B.jsx(rz.IoIosArrowDown,{style:{transform:e?"rotate(180deg)":"rotate(0deg)"}})]}),e&&B.jsx("div",{className:"twap-orders__selected-order-accordion-details",children:r})]}),YG=()=>B.jsxs(xe,{children:[B.jsx(tj,{}),B.jsx(aj,{}),B.jsx(QG,{}),B.jsx(oj,{}),B.jsx(KG,{}),B.jsx(ZG,{}),B.jsx(XG,{}),B.jsx(JG,{}),B.jsx(ej,{}),B.jsx(dj,{}),B.jsx(xe.Recipient,{})]}),KG=()=>{const{order:e}=Rt();return B.jsx(xe.TradeSize,{tradeSize:e.display.tradeSize.value,srcToken:e.data.srcToken,label:e.display.tradeSize.label,tooltip:e.display.tradeSize.tooltip,trades:e.display.totalTrades.value})},ZG=()=>{const{order:e}=Rt();return B.jsx(xe.TradesAmount,{trades:e.display.totalTrades.value,label:e.display.totalTrades.label,tooltip:e.display.totalTrades.tooltip})},XG=()=>{const{order:e}=Rt();return B.jsx(xe.MinDestAmount,{dstToken:e.data.dstToken,dstMinAmountOut:e.display.minDestAmountPerTrade.value,label:e.display.minDestAmountPerTrade.label,tooltip:e.display.minDestAmountPerTrade.tooltip})},QG=()=>{const{order:e}=Rt();return B.jsx(xe.Deadline,{deadline:e.display.deadline.value,label:e.display.deadline.label,tooltip:e.display.deadline.tooltip})},JG=()=>{const{order:e}=Rt();return B.jsx(xe.TradeInterval,{fillDelayMillis:e.display.tradeInterval.value,chunks:e.display.totalTrades.value,label:e.display.tradeInterval.label,tooltip:e.display.tradeInterval.tooltip})},ej=()=>{const{order:e}=Rt();return B.jsx(xe.TriggerPrice,{dstToken:e.data.dstToken,price:e.display.triggerPricePerTrade.value,label:e.display.triggerPricePerTrade.label,tooltip:e.display.triggerPricePerTrade.tooltip})},tj=()=>{const{order:e}=Rt();return B.jsx(xe.OrderID,{id:e.id.value||""})},rj=()=>B.jsxs(xe,{children:[B.jsx(lj,{}),B.jsx(ij,{}),B.jsx(nj,{}),B.jsx(uj,{}),B.jsx(pj,{})]}),nj=()=>{var r;const{order:e}=Rt(),t=Ge({value:e.amountOutFilled.value,decimalScale:3});return e.amountOutFilled.value?B.jsx(xe.DetailRow,{title:e.amountOutFilled.label,children:B.jsxs("p",{children:[t||"-"," ",(r=e.data.dstToken)==null?void 0:r.symbol]})}):null},sj=()=>{const{order:e}=Rt(),{mutateAsync:t,isPending:r}=j0(),{components:n}=se(),s=n.Button,a=M.useCallback(async()=>t({orders:[e.original]}),[t,e]);return!e||e.original.status!==ut.Open||!s?null:B.jsx(s,{loading:r,onClick:a,disabled:r,className:"twap-cancel-order",children:"Cancel"})},aj=()=>{const{order:e}=Rt(),t=Ue(),r=$0(e.createdAt.value);return B.jsx(xe.DetailRow,{title:t("createdAt")||"",children:B.jsx("p",{children:r})})},oj=()=>{var n;const{order:e}=Rt(),t=Ue(),r=Ge({value:e.display.srcAmount.value,decimalScale:3});return B.jsx(xe.DetailRow,{title:t("amountOut")||"",children:B.jsxs("p",{children:[r||0," ",(n=e.data.srcToken)==null?void 0:n.symbol]})})},ij=()=>{var r;const{order:e}=Rt(),t=Ge({value:e.amountInFilled.value,decimalScale:3});return B.jsx(xe.DetailRow,{title:e.amountInFilled.label,children:B.jsxs("p",{children:[t||"-"," ",(r=e.data.srcToken)==null?void 0:r.symbol]})})},cj=()=>{const{order:e}=Rt(),t=Ue();return M.useMemo(()=>{switch(e.original.status){case ut.Open:return t("Open")||"";case ut.Completed:return t("Completed")||"";case ut.Expired:return t("Expired")||"";case ut.Canceled:return t("Canceled")||""}},[e.original.status,t])},lj=()=>{const e=Ue(),t=cj();return B.jsx(xe.DetailRow,{title:e("status")||"",children:B.jsx("p",{children:t})})},uj=()=>{const{order:e}=Rt(),t=Ge({value:e.progress.value,decimalScale:2});return B.jsx(xe.DetailRow,{title:e.progress.label,children:B.jsxs("p",{children:[t||0,"%"]})})},dj=()=>{const{order:e}=Rt(),t=Ue();return e.display.limitPrice.value?B.jsx(J2,{title:t("limitPrice")||"",price:e.display.limitPrice.value,srcToken:e.data.srcToken,dstToken:e.data.dstToken}):null},pj=()=>{const{order:e}=Rt();return e.excecutionPrice.value?B.jsx(J2,{title:e.excecutionPrice.label,price:e.excecutionPrice.value,srcToken:e.data.srcToken,dstToken:e.data.dstToken}):null},J2=({price:e,srcToken:t,dstToken:r,title:n})=>{const s=Ge({value:e,decimalScale:3});return B.jsx(xe.DetailRow,{title:n,children:j(e||0).isZero()?B.jsx("p",{children:"-"}):B.jsxs("p",{children:["1 ",t==null?void 0:t.symbol," = ",s," ",r==null?void 0:r.symbol]})})};var W0={},ex;function fj(){if(ex)return W0;ex=1;var e=cu.GenIcon;return W0.HiArrowRight=function(r){return e({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"}}]})(r)},W0}var mj=fj();const _u=0,ms=1,mo=2,tx=4;function rx(e){return()=>e}function hj(e){e()}function nx(e,t){return r=>e(t(r))}function sx(e,t){return()=>e(t)}function bj(e,t){return r=>e(t,r)}function q0(e){return e!==void 0}function yj(...e){return()=>{e.map(hj)}}function ho(){}function Mu(e,t){return t(e),e}function gj(e,t){return t(e)}function et(...e){return e}function je(e,t){return e(ms,t)}function Ce(e,t){e(_u,t)}function Y0(e){e(mo)}function st(e){return e(tx)}function ce(e,t){return je(e,bj(t,_u))}function Wr(e,t){const r=e(ms,n=>{r(),t(n)});return r}function ax(e){let t,r;return n=>s=>{t=s,r&&clearTimeout(r),r=setTimeout(()=>{n(t)},e)}}function ox(e,t){return e===t}function tt(e=ox){let t;return r=>n=>{e(t,n)||(t=n,r(n))}}function fe(e){return t=>r=>{e(r)&&t(r)}}function re(e){return t=>nx(t,e)}function ln(e){return t=>()=>{t(e)}}function W(e,...t){const r=xj(...t);return(n,s)=>{switch(n){case mo:Y0(e);return;case ms:return je(e,r(s))}}}function un(e,t){return r=>n=>{r(t=e(t,n))}}function oa(e){return t=>r=>{e>0?e--:t(r)}}function $n(e){let t=null,r;return n=>s=>{t=s,!r&&(r=setTimeout(()=>{r=void 0,n(t)},e))}}function Te(...e){const t=new Array(e.length);let r=0,n=null;const s=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const i=Math.pow(2,o);je(a,c=>{const l=r;r=r|i,t[o]=c,l!==s&&r===s&&n&&(n(),n=null)})}),a=>o=>{const i=()=>{a([o].concat(t))};r===s?i():n=i}}function xj(...e){return t=>e.reduceRight(gj,t)}function wj(e){let t,r;const n=()=>t==null?void 0:t();return function(s,a){switch(s){case ms:return a?r===a?void 0:(n(),r=a,t=je(e,a),t):(n(),ho);case mo:n(),r=null;return}}}function K(e){let t=e;const r=Oe();return(n,s)=>{switch(n){case _u:t=s;break;case ms:{s(t);break}case tx:return t}return r(n,s)}}function Ht(e,t){return Mu(K(t),r=>ce(e,r))}function Oe(){const e=[];return(t,r)=>{switch(t){case _u:e.slice().forEach(n=>{n(r)});return;case mo:e.splice(0,e.length);return;case ms:return e.push(r),()=>{const n=e.indexOf(r);n>-1&&e.splice(n,1)}}}}function br(e){return Mu(Oe(),t=>ce(e,t))}function He(e,t=[],{singleton:r}={singleton:!0}){return{constructor:e,dependencies:t,id:vj(),singleton:r}}const vj=()=>Symbol();function Ej(e){const t=new Map,r=({constructor:n,dependencies:s,id:a,singleton:o})=>{if(o&&t.has(a))return t.get(a);const i=n(s.map(c=>r(c)));return o&&t.set(a,i),i};return r(e)}function vt(...e){const t=Oe(),r=new Array(e.length);let n=0;const s=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const i=Math.pow(2,o);je(a,c=>{r[o]=c,n=n|i,n===s&&Ce(t,r)})}),function(a,o){switch(a){case mo:{Y0(t);return}case ms:return n===s&&o(r),je(t,o)}}}function me(e,t=ox){return W(e,tt(t))}function K0(...e){return function(t,r){switch(t){case mo:return;case ms:return yj(...e.map(n=>je(n,r)))}}}var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const kj={0:"debug",3:"error",1:"log",2:"warn"},Cj=()=>typeof globalThis>"u"?window:globalThis,hs=He(()=>{const e=K(3);return{log:K((t,r,n=1)=>{var s;const a=(s=Cj().VIRTUOSO_LOG_LEVEL)!=null?s:st(e);n>=a&&console[kj[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,r)}),logLevel:e}},[],{singleton:!0});function ia(e,t,r){return Z0(e,t,r).callbackRef}function Z0(e,t,r){const n=M.useRef(null);let s=o=>{};const a=M.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const i=()=>{const c=o[0].target;c.offsetParent!==null&&e(c)};r?i():requestAnimationFrame(i)}):null,[e,r]);return s=o=>{o&&t?(a==null||a.observe(o),n.current=o):(n.current&&(a==null||a.unobserve(n.current)),n.current=null)},{callbackRef:s,ref:n}}function Tj(e,t,r,n,s,a,o,i,c){const l=M.useCallback(u=>{const d=Sj(u.children,t,i?"offsetWidth":"offsetHeight",s);let f=u.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const m=f.lastElementChild.dataset.viewportType==="window";let y;m&&(y=f.ownerDocument.defaultView);const g=o?i?o.scrollLeft:o.scrollTop:m?i?y.scrollX||y.document.documentElement.scrollLeft:y.scrollY||y.document.documentElement.scrollTop:i?f.scrollLeft:f.scrollTop,E=o?i?o.scrollWidth:o.scrollHeight:m?i?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight:i?f.scrollWidth:f.scrollHeight,w=o?i?o.offsetWidth:o.offsetHeight:m?i?y.innerWidth:y.innerHeight:i?f.offsetWidth:f.offsetHeight;n({scrollHeight:E,scrollTop:Math.max(g,0),viewportHeight:w}),a==null||a(i?ix("column-gap",getComputedStyle(u).columnGap,s):ix("row-gap",getComputedStyle(u).rowGap,s)),d!==null&&e(d)},[e,t,s,a,o,n,i]);return Z0(l,r,c)}function Sj(e,t,r,n){const s=e.length;if(s===0)return null;const a=[];for(let o=0;o<s;o++){const i=e.item(o);if(i.dataset.index===void 0)continue;const c=parseInt(i.dataset.index),l=parseFloat(i.dataset.knownSize),u=t(i,r);if(u===0&&n("Zero-sized element, this should not happen",{child:i},nr.ERROR),u===l)continue;const d=a[a.length-1];a.length===0||d.size!==u||d.endIndex!==c-1?a.push({endIndex:c,size:u,startIndex:c}):a[a.length-1].endIndex++}return a}function ix(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function cx(e,t,r){const n=M.useRef(null),s=M.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const l=c.getBoundingClientRect(),u=l.width;let d,f;if(t){const m=t.getBoundingClientRect(),y=l.top-m.top;f=m.height-Math.max(0,y),d=y+t.scrollTop}else{const m=o.current.ownerDocument.defaultView;f=m.innerHeight-Math.max(0,l.top),d=l.top+m.scrollY}n.current={offsetTop:d,visibleHeight:f,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:a,ref:o}=Z0(s,!0,r),i=M.useCallback(()=>{s(o.current)},[s,o]);return M.useEffect(()=>{var c;if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(()=>{requestAnimationFrame(i)});return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else{const l=(c=o.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",i),l==null||l.addEventListener("resize",i),()=>{l==null||l.removeEventListener("scroll",i),l==null||l.removeEventListener("resize",i)}}},[i,t,o]),a}const Wt=He(()=>{const e=Oe(),t=Oe(),r=K(0),n=Oe(),s=K(0),a=Oe(),o=Oe(),i=K(0),c=K(0),l=K(0),u=K(0),d=Oe(),f=Oe(),m=K(!1),y=K(!1),g=K(!1);return ce(W(e,re(({scrollTop:E})=>E)),t),ce(W(e,re(({scrollHeight:E})=>E)),o),ce(t,s),{deviation:r,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:i,horizontalDirection:y,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:m,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:n,statefulScrollTop:s,viewportHeight:a}},[],{singleton:!0}),oc={lvl:0};function lx(e,t){const r=e.length;if(r===0)return[];let{index:n,value:s}=t(e[0]);const a=[];for(let o=1;o<r;o++){const{index:i,value:c}=t(e[o]);a.push({end:i-1,start:n,value:s}),n=i,s=c}return a.push({end:1/0,start:n,value:s}),a}function qe(e){return e===oc}function ic(e,t){if(!qe(e))return t===e.k?e.v:t<e.k?ic(e.l,t):ic(e.r,t)}function qr(e,t,r="k"){if(qe(e))return[-1/0,void 0];if(Number(e[r])===t)return[e.k,e.v];if(Number(e[r])<t){const n=qr(e.r,t,r);return n[0]===-1/0?[e.k,e.v]:n}return qr(e.l,t,r)}function yr(e,t,r){return qe(e)?px(t,r,1):t===e.k?St(e,{k:t,v:r}):t<e.k?fx(St(e,{l:yr(e.l,t,r)})):fx(St(e,{r:yr(e.r,t,r)}))}function bo(){return oc}function yo(e,t,r){if(qe(e))return[];const n=qr(e,t)[0];return Aj(Q0(e,n,r))}function X0(e,t){if(qe(e))return oc;const{k:r,l:n,r:s}=e;if(t===r){if(qe(n))return s;if(qe(s))return n;{const[a,o]=dx(n);return Nu(St(e,{k:a,l:ux(n),v:o}))}}else return t<r?Nu(St(e,{l:X0(n,t)})):Nu(St(e,{r:X0(s,t)}))}function ca(e){return qe(e)?[]:[...ca(e.l),{k:e.k,v:e.v},...ca(e.r)]}function Q0(e,t,r){if(qe(e))return[];const{k:n,l:s,r:a,v:o}=e;let i=[];return n>t&&(i=i.concat(Q0(s,t,r))),n>=t&&n<=r&&i.push({k:n,v:o}),n<=r&&(i=i.concat(Q0(a,t,r))),i}function Nu(e){const{l:t,lvl:r,r:n}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(J0(t))return mx(St(e,{lvl:r-1}));if(!qe(t)&&!qe(t.r))return St(t.r,{l:St(t,{r:t.r.l}),lvl:r,r:St(e,{l:t.r.r,lvl:r-1})});throw new Error("Unexpected empty nodes")}else{if(J0(e))return em(St(e,{lvl:r-1}));if(!qe(n)&&!qe(n.l)){const s=n.l,a=J0(s)?n.lvl-1:n.lvl;return St(s,{l:St(e,{lvl:r-1,r:s.l}),lvl:s.lvl+1,r:em(St(n,{l:s.r,lvl:a}))})}else throw new Error("Unexpected empty nodes")}}function St(e,t){return px(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function ux(e){return qe(e.r)?e.l:Nu(St(e,{r:ux(e.r)}))}function J0(e){return qe(e)||e.lvl>e.r.lvl}function dx(e){return qe(e.r)?[e.k,e.v]:dx(e.r)}function px(e,t,r,n=oc,s=oc){return{k:e,l:n,lvl:r,r:s,v:t}}function fx(e){return em(mx(e))}function mx(e){const{l:t}=e;return!qe(t)&&t.lvl===e.lvl?St(t,{r:St(e,{l:t.r})}):e}function em(e){const{lvl:t,r}=e;return!qe(r)&&!qe(r.r)&&r.lvl===t&&r.r.lvl===t?St(r,{l:St(e,{r:r.l}),lvl:t+1}):e}function Aj(e){return lx(e,({k:t,v:r})=>({index:t,value:r}))}function hx(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function cc(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const tm=He(()=>({recalcInProgress:K(!1)}),[],{singleton:!0});function bx(e,t,r){return e[Lu(e,t,r)]}function Lu(e,t,r,n=0){let s=e.length-1;for(;n<=s;){const a=Math.floor((n+s)/2),o=e[a],i=r(o,t);if(i===0)return a;if(i===-1){if(s-n<2)return a-1;s=a-1}else{if(s===n)return a;n=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Pj(e,t,r,n){const s=Lu(e,t,n),a=Lu(e,r,n,s);return e.slice(s,a+1)}function bs(e,t){return Math.round(e.getBoundingClientRect()[t])}function zu(e){return!qe(e.groupOffsetTree)}function rm({index:e},t){return t===e?0:t<e?-1:1}function Ij(){return{groupIndices:[],groupOffsetTree:bo(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:bo()}}function Bj(e,t){let r=qe(e)?0:1/0;for(const n of t){const{endIndex:s,size:a,startIndex:o}=n;if(r=Math.min(r,o),qe(e)){e=yr(e,0,a);continue}const i=yo(e,o-1,s+1);if(i.some(Nj(n)))continue;let c=!1,l=!1;for(const{end:u,start:d,value:f}of i)c?(s>=d||a===f)&&(e=X0(e,d)):(l=f!==a,c=!0),u>s&&s>=d&&f!==a&&(e=yr(e,s+1,f));l&&(e=yr(e,o,a))}return[e,r]}function Fj(e){return typeof e.groupIndex<"u"}function Uj({offset:e},t){return t===e?0:t<e?-1:1}function lc(e,t,r){if(t.length===0)return 0;const{index:n,offset:s,size:a}=bx(t,e,rm),o=e-n,i=a*o+(o-1)*r+s;return i>0?i+r:i}function yx(e,t){if(!zu(t))return e;let r=0;for(;t.groupIndices[r]<=e+r;)r++;return e+r}function gx(e,t,r){if(Fj(e))return t.groupIndices[e.groupIndex]+1;{const n=e.index==="LAST"?r:e.index;let s=yx(n,t);return s=Math.max(0,s,Math.min(r,s)),s}}function Oj(e,t,r,n=0){return n>0&&(t=Math.max(t,bx(e,n,rm).offset)),lx(Pj(e,t,r,Uj),Mj)}function Dj(e,[t,r,n,s]){t.length>0&&n("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,i=0;if(r.length>0&&qe(a)&&t.length===2){const f=t[0].size,m=t[1].size;o=r.reduce((y,g)=>yr(yr(y,g,f),g+1,m),o)}else[o,i]=Bj(o,t);if(o===a)return e;const{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=nm(e.offsetTree,i,o,s);return{groupIndices:r,groupOffsetTree:r.reduce((f,m)=>yr(f,m,lc(m,d,s)),bo()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function _j(e){return ca(e).map(({k:t,v:r},n,s)=>{const a=s[n+1];return{endIndex:a?a.k-1:1/0,size:r,startIndex:t}})}function xx(e,t){let r=0,n=0;for(;r<e;)r+=t[n+1]-t[n]-1,n++;return n-(r===e?0:1)}function nm(e,t,r,n){let s=e,a=0,o=0,i=0,c=0;if(t!==0){c=Lu(s,t-1,rm),i=s[c].offset;const l=qr(r,t-1);a=l[0],o=l[1],s.length&&s[c].size===qr(r,t)[1]&&(c-=1),s=s.slice(0,c+1)}else s=[];for(const{start:l,value:u}of yo(r,t,1/0)){const d=l-a,f=d*o+i+d*n;s.push({index:l,offset:f,size:u}),a=l,i=f,o=u}return{lastIndex:a,lastOffset:i,lastSize:o,offsetTree:s}}function Mj(e){return{index:e.index,value:e}}function Nj(e){const{endIndex:t,size:r,startIndex:n}=e;return s=>s.start===n&&(s.end===t||s.end===1/0)&&s.value===r}const Lj={offsetHeight:"height",offsetWidth:"width"},dn=He(([{log:e},{recalcInProgress:t}])=>{const r=Oe(),n=Oe(),s=Ht(n,0),a=Oe(),o=Oe(),i=K(0),c=K([]),l=K(void 0),u=K(void 0),d=K(void 0),f=K(void 0),m=K((T,h)=>bs(T,Lj[h])),y=K(void 0),g=K(0),E=Ij(),w=Ht(W(r,Te(c,e,g),un(Dj,E),tt()),E),v=Ht(W(c,tt(),un((T,h)=>({current:h,prev:T.current}),{current:[],prev:[]}),re(({prev:T})=>T)),[]);ce(W(c,fe(T=>T.length>0),Te(w,g),re(([T,h,b])=>{const x=T.reduce((A,I,F)=>yr(A,I,lc(I,h.offsetTree,b)||F),bo());return{...h,groupIndices:T,groupOffsetTree:x}})),w),ce(W(n,Te(w),fe(([T,{lastIndex:h}])=>T<h),re(([T,{lastIndex:h,lastSize:b}])=>[{endIndex:h,size:b,startIndex:T}])),r),ce(l,u);const S=Ht(W(l,re(T=>T===void 0)),!0);ce(W(u,fe(T=>T!==void 0&&qe(st(w).sizeTree)),re(T=>{const h=st(d),b=st(c).length>0;return h?b?[{endIndex:0,size:h,startIndex:0},{endIndex:1,size:T,startIndex:1}]:[]:[{endIndex:0,size:T,startIndex:0}]})),r),ce(W(f,fe(T=>T!==void 0&&T.length>0&&qe(st(w).sizeTree)),re(T=>{const h=[];let b=T[0],x=0;for(let A=1;A<T.length;A++){const I=T[A];I!==b&&(h.push({endIndex:A-1,size:b,startIndex:x}),b=I,x=A)}return h.push({endIndex:T.length-1,size:b,startIndex:x}),h})),r),ce(W(c,Te(d,u),fe(([,T,h])=>T!==void 0&&h!==void 0),re(([T,h,b])=>{const x=[];for(let A=0;A<T.length;A++){const I=T[A],F=T[A+1];x.push({startIndex:I,endIndex:I,size:h}),F!==void 0&&x.push({startIndex:I+1,endIndex:F-1,size:b})}return x})),r);const C=br(W(r,Te(w),un(({sizes:T},[h,b])=>({changed:b!==T,sizes:b}),{changed:!1,sizes:E}),re(T=>T.changed)));je(W(i,un((T,h)=>({diff:T.prev-h,prev:h}),{diff:0,prev:0}),re(T=>T.diff)),T=>{const{groupIndices:h}=st(w);if(T>0)Ce(t,!0),Ce(a,T+xx(T,h));else if(T<0){const b=st(v);b.length>0&&(T-=xx(-T,b)),Ce(o,T)}}),je(W(i,Te(e)),([T,h])=>{T<0&&h("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:i},nr.ERROR)});const D=br(a);ce(W(a,Te(w),re(([T,h])=>{const b=h.groupIndices.length>0,x=[],A=h.lastSize;if(b){const I=ic(h.sizeTree,0);let F=0,_=0;for(;F<T;){const P=h.groupIndices[_],O=h.groupIndices.length===_+1?1/0:h.groupIndices[_+1]-P-1;x.push({endIndex:P,size:I,startIndex:P}),x.push({endIndex:P+1+O-1,size:A,startIndex:P+1}),_++,F+=O+1}const k=ca(h.sizeTree);return F!==T&&k.shift(),k.reduce((P,{k:O,v:U})=>{let z=P.ranges;return P.prevSize!==0&&(z=[...P.ranges,{endIndex:O+T-1,size:P.prevSize,startIndex:P.prevIndex}]),{prevIndex:O+T,prevSize:U,ranges:z}},{prevIndex:T,prevSize:0,ranges:x}).ranges}return ca(h.sizeTree).reduce((I,{k:F,v:_})=>({prevIndex:F+T,prevSize:_,ranges:[...I.ranges,{endIndex:F+T-1,size:I.prevSize,startIndex:I.prevIndex}]}),{prevIndex:0,prevSize:A,ranges:[]}).ranges})),r);const L=br(W(o,Te(w,g),re(([T,{offsetTree:h},b])=>{const x=-T;return lc(x,h,b)})));return ce(W(o,Te(w,g),re(([T,h,b])=>{if(h.groupIndices.length>0){if(qe(h.sizeTree))return h;let x=bo();const A=st(v);let I=0,F=0,_=0;for(;I<-T;){_=A[F];const k=A[F+1]-_-1;F++,I+=k+1}if(x=ca(h.sizeTree).reduce((k,{k:P,v:O})=>yr(k,Math.max(0,P+T),O),x),I!==-T){const k=ic(h.sizeTree,_);x=yr(x,0,k);const P=qr(h.sizeTree,-T+1)[1];x=yr(x,1,P)}return{...h,sizeTree:x,...nm(h.offsetTree,0,x,b)}}else{const x=ca(h.sizeTree).reduce((A,{k:I,v:F})=>yr(A,Math.max(0,I+T),F),bo());return{...h,sizeTree:x,...nm(h.offsetTree,0,x,b)}}})),w),{beforeUnshiftWith:D,data:y,defaultItemSize:u,firstItemIndex:i,fixedItemSize:l,fixedGroupSize:d,gap:g,groupIndices:c,heightEstimates:f,itemSize:m,listRefresh:C,shiftWith:o,shiftWithOffset:L,sizeRanges:r,sizes:w,statefulTotalCount:s,totalCount:n,trackItemSizes:S,unshiftWith:a}},et(hs,tm),{singleton:!0});function zj(e){return e.reduce((t,r)=>(t.groupIndices.push(t.totalCount),t.totalCount+=r+1,t),{groupIndices:[],totalCount:0})}const wx=He(([{groupIndices:e,sizes:t,totalCount:r},{headerHeight:n,scrollTop:s}])=>{const a=Oe(),o=Oe(),i=br(W(a,re(zj)));return ce(W(i,re(c=>c.totalCount)),r),ce(W(i,re(c=>c.groupIndices)),e),ce(W(vt(s,t,n),fe(([c,l])=>zu(l)),re(([c,l,u])=>qr(l.groupOffsetTree,Math.max(c-u,0),"v")[0]),tt(),re(c=>[c])),o),{groupCounts:a,topItemsIndexes:o}},et(dn,Wt)),ys=He(([{log:e}])=>{const t=K(!1),r=br(W(t,fe(n=>n),tt()));return je(t,n=>{n&&st(e)("props updated",{},nr.DEBUG)}),{didMount:r,propsReady:t}},et(hs),{singleton:!0}),Rj=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function vx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Rj)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const uc=He(([{gap:e,listRefresh:t,sizes:r,totalCount:n},{fixedFooterHeight:s,fixedHeaderHeight:a,footerHeight:o,headerHeight:i,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const m=Oe(),y=Oe(),g=K(0);let E=null,w=null,v=null;function S(){E&&(E(),E=null),v&&(v(),v=null),w&&(clearTimeout(w),w=null),Ce(c,!1)}return ce(W(m,Te(r,d,n,g,i,o,f),Te(e,a,s),re(([[C,D,L,T,h,b,x,A],I,F,_])=>{const k=vx(C),{align:P,behavior:O,offset:U}=k,z=T-1,H=gx(k,D,z);let G=lc(H,D.offsetTree,I)+b;P==="end"?(G+=F+qr(D.sizeTree,H)[1]-L+_,H===z&&(G+=x)):P==="center"?G+=(F+qr(D.sizeTree,H)[1]-L+_)/2:G-=h,U&&(G+=U);const J=pe=>{S(),pe?(A("retrying to scroll to",{location:C},nr.DEBUG),Ce(m,C)):(Ce(y,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(S(),O==="smooth"){let pe=!1;v=je(t,he=>{pe=pe||he}),E=Wr(u,()=>{J(pe)})}else E=Wr(W(t,Hj(150)),J);return w=setTimeout(()=>{S()},1200),Ce(c,!0),A("scrolling from index to",{behavior:O,index:H,top:G},nr.DEBUG),{behavior:O,top:G}})),l),{scrollTargetReached:y,scrollToIndex:m,topListHeight:g}},et(dn,Wt,hs),{singleton:!0});function Hj(e){return t=>{const r=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(r))}}}function sm(e,t){e==0?t():requestAnimationFrame(()=>{sm(e-1,t)})}function am(e,t){const r=t-1;return typeof e=="number"?e:e.index==="LAST"?r:e.index}const dc=He(([{defaultItemSize:e,listRefresh:t,sizes:r},{scrollTop:n},{scrollTargetReached:s,scrollToIndex:a},{didMount:o}])=>{const i=K(!0),c=K(0),l=K(!0);return ce(W(o,Te(c),fe(([u,d])=>!!d),ln(!1)),i),ce(W(o,Te(c),fe(([u,d])=>!!d),ln(!1)),l),je(W(vt(t,o),Te(i,r,e,l),fe(([[,u],d,{sizeTree:f},m,y])=>u&&(!qe(f)||q0(m))&&!d&&!y),Te(c)),([,u])=>{Wr(s,()=>{Ce(l,!0)}),sm(4,()=>{Wr(n,()=>{Ce(i,!0)}),Ce(a,u)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:i}},et(dn,Wt,uc,ys),{singleton:!0});function Ex(e,t){return Math.abs(e-t)<1.01}const pc="up",fc="down",$j="none",Gj={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},jj=0,mc=He(([{footerHeight:e,headerHeight:t,scrollBy:r,scrollContainerState:n,scrollTop:s,viewportHeight:a}])=>{const o=K(!1),i=K(!0),c=Oe(),l=Oe(),u=K(4),d=K(jj),f=Ht(W(K0(W(me(s),oa(1),ln(!0)),W(me(s),oa(1),ln(!1),ax(100))),tt()),!1),m=Ht(W(K0(W(r,ln(!0)),W(r,ln(!1),ax(200))),tt()),!1);ce(W(vt(me(s),me(d)),re(([v,S])=>v<=S),tt()),i),ce(W(i,$n(50)),l);const y=br(W(vt(n,me(a),me(t),me(e),me(u)),un((v,[{scrollHeight:S,scrollTop:C},D,L,T,h])=>{const b=C+D-S>-h,x={scrollHeight:S,scrollTop:C,viewportHeight:D};if(b){let I,F;return C>v.state.scrollTop?(I="SCROLLED_DOWN",F=v.state.scrollTop-C):(I="SIZE_DECREASED",F=v.state.scrollTop-C||v.scrollTopDelta),{atBottom:!0,atBottomBecause:I,scrollTopDelta:F,state:x}}let A;return x.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":D<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":C<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:x}},Gj),tt((v,S)=>v&&v.atBottom===S.atBottom))),g=Ht(W(n,un((v,{scrollHeight:S,scrollTop:C,viewportHeight:D})=>{if(Ex(v.scrollHeight,S))return{changed:!1,jump:0,scrollHeight:S,scrollTop:C};{const L=S-(C+D)<1;return v.scrollTop!==C&&L?{changed:!0,jump:v.scrollTop-C,scrollHeight:S,scrollTop:C}:{changed:!0,jump:0,scrollHeight:S,scrollTop:C}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),fe(v=>v.changed),re(v=>v.jump)),0);ce(W(y,re(v=>v.atBottom)),o),ce(W(o,$n(50)),c);const E=K(fc);ce(W(n,re(({scrollTop:v})=>v),tt(),un((v,S)=>st(m)?{direction:v.direction,prevScrollTop:S}:{direction:S<v.prevScrollTop?pc:fc,prevScrollTop:S},{direction:fc,prevScrollTop:0}),re(v=>v.direction)),E),ce(W(n,$n(50),ln($j)),E);const w=K(0);return ce(W(f,fe(v=>!v),ln(0)),w),ce(W(s,$n(100),Te(f),fe(([v,S])=>!!S),un(([v,S],[C])=>[S,C],[0,0]),re(([v,S])=>S-v)),w),{atBottomState:y,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:i,isScrolling:f,lastJumpDueToItemResize:g,scrollDirection:E,scrollVelocity:w}},et(Wt)),hc="top",bc="bottom",kx="none";function Cx(e,t,r){return typeof e=="number"?r===pc&&t===hc||r===fc&&t===bc?e:0:r===pc?t===hc?e.main:e.reverse:t===bc?e.main:e.reverse}function Tx(e,t){var r;return typeof e=="number"?e:(r=e[t])!=null?r:0}const om=He(([{deviation:e,fixedHeaderHeight:t,headerHeight:r,scrollTop:n,viewportHeight:s}])=>{const a=Oe(),o=K(0),i=K(0),c=K(0),l=Ht(W(vt(me(n),me(s),me(r),me(a,cc),me(c),me(o),me(t),me(e),me(i)),re(([u,d,f,[m,y],g,E,w,v,S])=>{const C=u-v,D=E+w,L=Math.max(f-C,0);let T=kx;const h=Tx(S,hc),b=Tx(S,bc);return m-=v,m+=f+w,y+=f+w,y-=v,m>u+D-h&&(T=pc),y<u-L+d+b&&(T=fc),T!==kx?[Math.max(C-f-Cx(g,hc,T)-h,0),C-L-w+d+Cx(g,bc,T)+b]:null}),fe(u=>u!=null),tt(cc)),[0,0]);return{increaseViewportBy:i,listBoundary:a,overscan:c,topListHeight:o,visibleRange:l}},et(Wt),{singleton:!0});function Vj(e,t,r){if(zu(t)){const n=yx(e,t);return[{index:qr(t.groupOffsetTree,n)[0],offset:0,size:0},{data:r==null?void 0:r[0],index:n,offset:0,size:0}]}return[{data:r==null?void 0:r[0],index:e,offset:0,size:0}]}const im={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ru(e,t,r,n,s,a){const{lastIndex:o,lastOffset:i,lastSize:c}=s;let l=0,u=0;if(e.length>0){l=e[0].offset;const g=e[e.length-1];u=g.offset+g.size}const d=r-o,f=i+d*c+(d-1)*n,m=l,y=f-u;return{bottom:u,firstItemIndex:a,items:Ax(e,s,a),offsetBottom:y,offsetTop:l,top:m,topItems:Ax(t,s,a),topListHeight:t.reduce((g,E)=>E.size+g,0),totalCount:r}}function Sx(e,t,r,n,s,a){let o=0;if(r.groupIndices.length>0)for(const u of r.groupIndices){if(u-o>=e)break;o++}const i=e+o,c=am(t,i),l=Array.from({length:i}).map((u,d)=>({data:a[d+c],index:d+c,offset:0,size:0}));return Ru(l,[],i,s,r,n)}function Ax(e,t,r){if(e.length===0)return[];if(!zu(t))return e.map(l=>({...l,index:l.index+r,originalIndex:l.index}));const n=e[0].index,s=e[e.length-1].index,a=[],o=yo(t.groupOffsetTree,n,s);let i,c=0;for(const l of e){(!i||i.end<l.index)&&(i=o.shift(),c=t.groupIndices.indexOf(i.start));let u;l.index===i.start?u={index:c,type:"group"}:u={groupIndex:c,index:l.index-(c+1)+r},a.push({...u,data:l.data,offset:l.offset,originalIndex:l.index,size:l.size})}return a}function Px(e,t){var r;return e===void 0?0:typeof e=="number"?e:(r=e[t])!=null?r:0}const la=He(([{data:e,firstItemIndex:t,gap:r,sizes:n,totalCount:s},a,{listBoundary:o,topListHeight:i,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:m},{recalcInProgress:y}])=>{const g=K([]),E=K(0),w=Oe(),v=K(0);ce(a.topItemsIndexes,g);const S=Ht(W(vt(m,y,me(c,cc),me(s),me(n),me(l),u,me(g),me(t),me(r),me(v),e),fe(([T,h,,b,,,,,,,,x])=>{const A=x&&x.length!==b;return T&&!h&&!A}),re(([,,[T,h],b,x,A,I,F,_,k,P,O])=>{var U,z,H,G;const J=x,{offsetTree:pe,sizeTree:he}=J,ie=st(E);if(b===0)return{...im,totalCount:b};if(T===0&&h===0)return ie===0?{...im,totalCount:b}:Sx(ie,A,x,_,k,O||[]);if(qe(he))return ie>0?null:Ru(Vj(am(A,b),J,O),[],b,k,J,_);const de=[];if(F.length>0){const Se=F[0],ve=F[F.length-1];let be=0;for(const Ze of yo(he,Se,ve)){const Ye=Ze.value,Xe=Math.max(Ze.start,Se),Fr=Math.min(Ze.end,ve);for(let Ot=Xe;Ot<=Fr;Ot++)de.push({data:O==null?void 0:O[Ot],index:Ot,offset:be,size:Ye}),be+=Ye}}if(!I)return Ru([],de,b,k,J,_);const Be=F.length>0?F[F.length-1]+1:0,Q=Oj(pe,T,h,Be);if(Q.length===0)return null;const we=b-1,_e=Mu([],Se=>{for(const ve of Q){const be=ve.value;let Ze=be.offset,Ye=ve.start;const Xe=be.size;if(be.offset<T){Ye+=Math.floor((T-be.offset+k)/(Xe+k));const Ot=Ye-ve.start;Ze+=Ot*Xe+Ot*k}Ye<Be&&(Ze+=(Be-Ye)*Xe,Ye=Be);const Fr=Math.min(ve.end,we);for(let Ot=Ye;Ot<=Fr&&!(Ze>=h);Ot++)Se.push({data:O==null?void 0:O[Ot],index:Ot,offset:Ze,size:Xe}),Ze+=Xe+k}}),$e=Px(P,hc),ot=Px(P,bc);if(_e.length>0&&($e>0||ot>0)){const Se=_e[0],ve=_e[_e.length-1];if($e>0&&Se.index>Be){const be=Math.min($e,Se.index-Be),Ze=[];let Ye=Se.offset;for(let Xe=Se.index-1;Xe>=Se.index-be;Xe--){const Fr=(z=(U=yo(he,Xe,Xe)[0])==null?void 0:U.value)!=null?z:Se.size;Ye-=Fr+k,Ze.unshift({data:O==null?void 0:O[Xe],index:Xe,offset:Ye,size:Fr})}_e.unshift(...Ze)}if(ot>0&&ve.index<we){const be=Math.min(ot,we-ve.index);let Ze=ve.offset+ve.size+k;for(let Ye=ve.index+1;Ye<=ve.index+be;Ye++){const Xe=(G=(H=yo(he,Ye,Ye)[0])==null?void 0:H.value)!=null?G:ve.size;_e.push({data:O==null?void 0:O[Ye],index:Ye,offset:Ze,size:Xe}),Ze+=Xe+k}}}return Ru(_e,de,b,k,J,_)}),fe(T=>T!==null),tt()),im);ce(W(e,fe(q0),re(T=>T==null?void 0:T.length)),s),ce(W(S,re(T=>T.topListHeight)),d),ce(d,i),ce(W(S,re(T=>[T.top,T.bottom])),o),ce(W(S,re(T=>T.items)),w);const C=br(W(S,fe(({items:T})=>T.length>0),Te(s,e),fe(([{items:T},h])=>T[T.length-1].originalIndex===h-1),re(([,T,h])=>[T-1,h]),tt(cc),re(([T])=>T))),D=br(W(S,$n(200),fe(({items:T,topItems:h})=>T.length>0&&T[0].originalIndex===h.length),re(({items:T})=>T[0].index),tt())),L=br(W(S,fe(({items:T})=>T.length>0),re(({items:T})=>{let h=0,b=T.length-1;for(;T[h].type==="group"&&h<b;)h++;for(;T[b].type==="group"&&b>h;)b--;return{endIndex:T[b].index,startIndex:T[h].index}}),tt(hx)));return{endReached:C,initialItemCount:E,itemsRendered:w,listState:S,minOverscanItemCount:v,rangeChanged:L,startReached:D,topItemsIndexes:g,...f}},et(dn,wx,om,dc,uc,mc,ys,tm),{singleton:!0}),Ix=He(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:r,headerHeight:n},{listState:s}])=>{const a=Oe(),o=Ht(W(vt(r,e,n,t,s),re(([i,c,l,u,d])=>i+c+l+u+d.offsetBottom+d.bottom)),0);return ce(me(o),a),{totalListHeight:o,totalListHeightChanged:a}},et(Wt,la),{singleton:!0}),Wj=He(([{viewportHeight:e},{totalListHeight:t}])=>{const r=K(!1),n=Ht(W(vt(r,e,t),fe(([s])=>s),re(([,s,a])=>Math.max(0,s-a)),$n(0),tt()),0);return{alignToBottom:r,paddingTopAddition:n}},et(Wt,Ix),{singleton:!0}),Bx=He(()=>({context:K(null)})),qj=({itemBottom:e,itemTop:t,locationParams:{align:r,behavior:n,...s},viewportBottom:a,viewportTop:o})=>t<o?{...s,align:r??"start",behavior:n}:e>a?{...s,align:r??"end",behavior:n}:null,Fx=He(([{gap:e,sizes:t,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:s,headerHeight:a,scrollingInProgress:o,scrollTop:i,viewportHeight:c},{scrollToIndex:l}])=>{const u=Oe();return ce(W(u,Te(t,c,r,a,s,n,i),Te(e),re(([[d,f,m,y,g,E,w,v],S])=>{const{align:C,behavior:D,calculateViewLocation:L=qj,done:T,...h}=d,b=gx(d,f,y-1),x=lc(b,f.offsetTree,S)+g+E,A=x+qr(f.sizeTree,b)[1],I=v+E,F=v+m-w,_=L({itemBottom:A,itemTop:x,locationParams:{align:C,behavior:D,...h},viewportBottom:F,viewportTop:I});return _?T&&Wr(W(o,fe(k=>!k),oa(st(o)?1:2)),T):T&&T(),_}),fe(d=>d!==null)),l),{scrollIntoView:u}},et(dn,Wt,uc,la,hs),{singleton:!0});function Ux(e){return e?e==="smooth"?"smooth":"auto":!1}const Yj=(e,t)=>typeof e=="function"?Ux(e(t)):t&&Ux(e),Kj=He(([{listRefresh:e,totalCount:t,fixedItemSize:r,data:n},{atBottomState:s,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:i},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:m}])=>{const y=K(!1),g=Oe();let E=null;function w(D){Ce(o,{align:"end",behavior:D,index:"LAST"})}je(W(vt(W(me(t),oa(1)),c),Te(me(y),a,i,d),re(([[D,L],T,h,b,x])=>{let A=L&&b,I="auto";return A&&(I=Yj(T,h||x),A=A&&!!I),{followOutputBehavior:I,shouldFollow:A,totalCount:D}}),fe(({shouldFollow:D})=>D)),({followOutputBehavior:D,totalCount:L})=>{E&&(E(),E=null),st(r)?requestAnimationFrame(()=>{st(u)("following output to ",{totalCount:L},nr.DEBUG),w(D)}):E=Wr(e,()=>{st(u)("following output to ",{totalCount:L},nr.DEBUG),w(D),E=null})});function v(D){const L=Wr(s,T=>{D&&!T.atBottom&&T.notAtBottomBecause==="SIZE_INCREASED"&&!E&&(st(u)("scrolling to bottom due to increased size",{},nr.DEBUG),w("auto"))});setTimeout(L,100)}je(W(vt(me(y),t,l),fe(([D,,L])=>D&&L),un(({value:D},[,L])=>({refreshed:D===L,value:L}),{refreshed:!1,value:0}),fe(({refreshed:D})=>D),Te(y,t)),([,D])=>{st(i)&&v(D!==!1)}),je(g,()=>{v(st(y)!==!1)}),je(vt(me(y),s),([D,L])=>{D&&!L.atBottom&&L.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&w("auto")});const S=K(null),C=Oe();return ce(K0(W(me(n),re(D=>{var L;return(L=D==null?void 0:D.length)!=null?L:0})),W(me(t))),C),je(W(vt(W(C,oa(1)),c),Te(me(S),i,d,f),re(([[D,L],T,h,b,x])=>L&&h&&(T==null?void 0:T({context:x,totalCount:D,scrollingInProgress:b}))),fe(D=>!!D),$n(0)),D=>{E&&(E(),E=null),st(r)?requestAnimationFrame(()=>{st(u)("scrolling into view",{}),Ce(m,D)}):E=Wr(e,()=>{st(u)("scrolling into view",{}),Ce(m,D),E=null})}),{autoscrollToBottom:g,followOutput:y,scrollIntoViewOnChange:S}},et(dn,mc,uc,dc,ys,hs,Wt,Bx,Fx)),Zj=He(([{data:e,firstItemIndex:t,gap:r,sizes:n},{initialTopMostItemIndex:s},{initialItemCount:a,listState:o},{didMount:i}])=>(ce(W(i,Te(a),fe(([,c])=>c!==0),Te(s,n,t,r,e),re(([[,c],l,u,d,f,m=[]])=>Sx(c,l,u,d,f,m))),o),{}),et(dn,dc,la,ys),{singleton:!0}),Xj=He(([{didMount:e},{scrollTo:t},{listState:r}])=>{const n=K(0);return je(W(e,Te(n),fe(([,s])=>s!==0),re(([,s])=>({top:s}))),s=>{Wr(W(r,oa(1),fe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{Ce(t,s)})})}),{initialScrollTop:n}},et(ys,Wt,la),{singleton:!0}),Ox=He(([{scrollVelocity:e}])=>{const t=K(!1),r=Oe(),n=K(!1);return ce(W(e,Te(n,t,r),fe(([s,a])=>!!a),re(([s,a,o,i])=>{const{enter:c,exit:l}=a;if(o){if(l(s,i))return!1}else if(c(s,i))return!0;return o}),tt()),t),je(W(vt(t,e,r),Te(n)),([[s,a,o],i])=>{s&&i&&i.change&&i.change(a,o)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:r,scrollVelocity:e}},et(mc),{singleton:!0}),cm=He(([{scrollContainerState:e,scrollTo:t}])=>{const r=Oe(),n=Oe(),s=Oe(),a=K(!1),o=K(void 0);return ce(W(vt(r,n),re(([{scrollHeight:i,scrollTop:c,viewportHeight:l},{offsetTop:u}])=>({scrollHeight:i,scrollTop:Math.max(0,c-u),viewportHeight:l}))),e),ce(W(t,Te(n),re(([i,{offsetTop:c}])=>({...i,top:i.top+c}))),s),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:r,windowScrollTo:s,windowViewportRect:n}},et(Wt)),Qj=He(([{sizeRanges:e,sizes:t},{headerHeight:r,scrollTop:n},{initialTopMostItemIndex:s},{didMount:a},{useWindowScroll:o,windowScrollContainerState:i,windowViewportRect:c}])=>{const l=Oe(),u=K(void 0),d=K(null),f=K(null);return ce(i,d),ce(c,f),je(W(l,Te(t,n,o,d,f,r)),([m,y,g,E,w,v,S])=>{const C=_j(y.sizeTree);E&&w!==null&&v!==null&&(g=w.scrollTop-v.offsetTop),g-=S,m({ranges:C,scrollTop:g})}),ce(W(u,fe(q0),re(Jj)),s),ce(W(a,Te(u),fe(([,m])=>m!==void 0),tt(),re(([,m])=>m.ranges)),e),{getState:l,restoreStateFrom:u}},et(dn,Wt,dc,ys,cm));function Jj(e){return{align:"start",index:0,offset:e.scrollTop}}const eV=He(([{topItemsIndexes:e}])=>{const t=K(0);return ce(W(t,fe(r=>r>=0),re(r=>Array.from({length:r}).map((n,s)=>s))),e),{topItemCount:t}},et(la));function Dx(e){let t=!1,r;return()=>(t||(t=!0,r=e()),r)}const tV=Dx(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),rV=He(([{deviation:e,scrollBy:t,scrollingInProgress:r,scrollTop:n},{isAtBottom:s,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:i},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:m},{recalcInProgress:y}])=>{const g=br(W(c,Te(o),un(([,w,v,S],[{bottom:C,items:D,offsetBottom:L,totalCount:T},h])=>{const b=C+L;let x=0;return v===T&&w.length>0&&D.length>0&&(D[0].originalIndex===0&&w[0].originalIndex===0||(x=b-S,x!==0&&(x+=h))),[x,D,T,b]},[0,[],0,0]),fe(([w])=>w!==0),Te(n,i,r,s,m,y),fe(([,w,v,S,,,C])=>!C&&!S&&w!==0&&v===pc),re(([[w],,,,,v])=>(v("Upward scrolling compensation",{amount:w},nr.DEBUG),w))));function E(w){w>0?(Ce(t,{behavior:"auto",top:-w}),Ce(e,0)):(Ce(e,0),Ce(t,{behavior:"auto",top:-w}))}return je(W(g,Te(e,a)),([w,v,S])=>{S&&tV()?Ce(e,v-w):E(-w)}),je(W(vt(Ht(a,!1),e,y),fe(([w,v,S])=>!w&&!S&&v!==0),re(([w,v])=>v),$n(1)),E),ce(W(d,re(w=>({top:-w}))),t),je(W(l,Te(f,u),re(([w,{groupIndices:v,lastSize:S,sizeTree:C},D])=>{function L(T){return T*(S+D)}if(v.length===0)return L(w);{let T=0;const h=ic(C,0);let b=0,x=0;for(;b<w;){b++,T+=h;let A=v.length===x+1?1/0:v[x+1]-v[x]-1;b+A>w&&(T-=h,A=w-b+1),b+=A,T+=L(A),x++}return T}})),w=>{Ce(e,w),requestAnimationFrame(()=>{Ce(t,{top:w}),requestAnimationFrame(()=>{Ce(e,0),Ce(y,!1)})})}),{deviation:e}},et(Wt,mc,la,dn,hs,tm)),nV=He(([e,t,r,n,s,a,o,i,c,l,u])=>({...e,...t,...r,...n,...s,...a,...o,...i,...c,...l,...u}),et(om,Zj,ys,Ox,Ix,Xj,Wj,cm,Fx,hs,Bx)),_x=He(([{data:e,defaultItemSize:t,firstItemIndex:r,fixedItemSize:n,fixedGroupSize:s,gap:a,groupIndices:o,heightEstimates:i,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:m},{initialItemFinalLocationReached:y,initialTopMostItemIndex:g,scrolledToInitialItem:E},w,v,S,C,{scrollToIndex:D},L,{topItemCount:T},{groupCounts:h},b])=>{const{listState:x,minOverscanItemCount:A,topItemsIndexes:I,rangeChanged:F,..._}=C;return ce(F,b.scrollSeekRangeChanged),ce(W(b.windowViewportRect,re(k=>k.visibleHeight)),w.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:r,fixedItemHeight:n,fixedGroupHeight:s,gap:a,groupCounts:h,heightEstimates:i,initialItemFinalLocationReached:y,initialTopMostItemIndex:g,scrolledToInitialItem:E,sizeRanges:l,topItemCount:T,topItemsIndexes:I,totalCount:f,...S,groupIndices:o,itemSize:c,listState:x,minOverscanItemCount:A,scrollToIndex:D,statefulTotalCount:d,trackItemSizes:m,rangeChanged:F,..._,...b,...w,sizes:u,...v}},et(dn,dc,Wt,Qj,Kj,la,uc,rV,eV,wx,nV));function sV(e,t){const r={},n={};let s=0;const a=e.length;for(;s<a;)n[e[s]]=1,s+=1;for(const o in t)Object.hasOwn(n,o)||(r[o]=t[o]);return r}const Hu=typeof document<"u"?M.useLayoutEffect:M.useEffect;function Mx(e,t,r){const n=Object.keys(t.required||{}),s=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),i=M.createContext({});function c(E,w){E.propsReady&&Ce(E.propsReady,!1);for(const v of n){const S=E[t.required[v]];Ce(S,w[v])}for(const v of s)if(v in w){const S=E[t.optional[v]];Ce(S,w[v])}E.propsReady&&Ce(E.propsReady,!0)}function l(E){return a.reduce((w,v)=>(w[v]=S=>{const C=E[t.methods[v]];Ce(C,S)},w),{})}function u(E){return o.reduce((w,v)=>(w[v]=wj(E[t.events[v]]),w),{})}const d=M.forwardRef((E,w)=>{const{children:v,...S}=E,[C]=M.useState(()=>Mu(Ej(e),T=>{c(T,S)})),[D]=M.useState(sx(u,C));Hu(()=>{for(const T of o)T in S&&je(D[T],S[T]);return()=>{Object.values(D).map(Y0)}},[S,D,C]),Hu(()=>{c(C,S)}),M.useImperativeHandle(w,rx(l(C)));const L=r;return B.jsx(i.Provider,{value:C,children:r?B.jsx(L,{...sV([...n,...s,...o],S),children:v}):v})}),f=E=>{const w=M.useContext(i);return M.useCallback(v=>{Ce(w[E],v)},[w,E])},m=E=>{const w=M.useContext(i)[E],v=M.useCallback(S=>je(w,S),[w]);return M.useSyncExternalStore(v,()=>st(w),()=>st(w))},y=E=>{const w=M.useContext(i)[E],[v,S]=M.useState(sx(st,w));return Hu(()=>je(w,C=>{C!==v&&S(rx(C))}),[w,v]),v},g=M.version.startsWith("18")?m:y;return{Component:d,useEmitter:(E,w)=>{const v=M.useContext(i)[E];Hu(()=>je(v,w),[w,v])},useEmitterValue:g,usePublisher:f}}const Nx=M.createContext(void 0),Lx=M.createContext(void 0),zx=typeof document<"u"?M.useLayoutEffect:M.useEffect;function lm(e){return"self"in e}function aV(e){return"body"in e}function Rx(e,t,r,n=ho,s,a){const o=M.useRef(null),i=M.useRef(null),c=M.useRef(null),l=M.useCallback(f=>{let m,y,g;const E=f.target;if(aV(E)||lm(E)){const v=lm(E)?E:E.defaultView;g=a?v.scrollX:v.scrollY,m=a?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight,y=a?v.innerWidth:v.innerHeight}else g=a?E.scrollLeft:E.scrollTop,m=a?E.scrollWidth:E.scrollHeight,y=a?E.offsetWidth:E.offsetHeight;const w=()=>{e({scrollHeight:m,scrollTop:Math.max(g,0),viewportHeight:y})};f.suppressFlushSync?w():ka.flushSync(w),i.current!==null&&(g===i.current||g<=0||g===m-y)&&(i.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);M.useEffect(()=>{const f=s||o.current;return n(s||o.current),l({suppressFlushSync:!0,target:f}),f.addEventListener("scroll",l,{passive:!0}),()=>{n(null),f.removeEventListener("scroll",l)}},[o,l,r,n,s]);function u(f){const m=o.current;if(!m||(a?"offsetWidth"in m&&m.offsetWidth===0:"offsetHeight"in m&&m.offsetHeight===0))return;const y=f.behavior==="smooth";let g,E,w;lm(m)?(E=Math.max(bs(m.document.documentElement,a?"width":"height"),a?m.document.documentElement.scrollWidth:m.document.documentElement.scrollHeight),g=a?m.innerWidth:m.innerHeight,w=a?window.scrollX:window.scrollY):(E=m[a?"scrollWidth":"scrollHeight"],g=bs(m,a?"width":"height"),w=m[a?"scrollLeft":"scrollTop"]);const v=E-g;if(f.top=Math.ceil(Math.max(Math.min(v,f.top),0)),Ex(g,E)||f.top===w){e({scrollHeight:E,scrollTop:w,viewportHeight:g}),y&&t(!0);return}y?(i.current=f.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,i.current=null,t(!0)},1e3)):i.current=null,a&&(f={behavior:f.behavior,left:f.top}),m.scrollTo(f)}function d(f){a&&(f={behavior:f.behavior,left:f.top}),o.current.scrollBy(f)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}const um="-webkit-sticky",Hx="sticky",dm=Dx(()=>{if(typeof document>"u")return Hx;const e=document.createElement("div");return e.style.position=um,e.style.position===um?um:Hx});function pm(e){return e}const oV=He(()=>{const e=K(i=>`Item ${i}`),t=K(i=>`Group ${i}`),r=K({}),n=K(pm),s=K("div"),a=K(ho),o=(i,c=null)=>Ht(W(r,re(l=>l[i]),tt()),c);return{components:r,computeItemKey:n,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:s,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),iV=He(([e,t])=>({...e,...t}),et(_x,oV)),cV=({height:e})=>B.jsx("div",{style:{height:e}}),lV={overflowAnchor:"none",position:dm(),zIndex:1},$x={overflowAnchor:"none"},uV={...$x,display:"inline-block",height:"100%"},Gx=M.memo(function({showTopList:e=!1}){const t=ye("listState"),r=Pr("sizeRanges"),n=ye("useWindowScroll"),s=ye("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),i=s||n?a:o,c=ye("itemContent"),l=ye("context"),u=ye("groupContent"),d=ye("trackItemSizes"),f=ye("itemSize"),m=ye("log"),y=Pr("gap"),g=ye("horizontalDirection"),{callbackRef:E}=Tj(r,f,d,e?ho:i,m,y,s,g,ye("skipAnimationFrameInResizeObserver")),[w,v]=M.useState(0);fm("deviation",_=>{w!==_&&v(_)});const S=ye("EmptyPlaceholder"),C=ye("ScrollSeekPlaceholder")||cV,D=ye("ListComponent"),L=ye("ItemComponent"),T=ye("GroupComponent"),h=ye("computeItemKey"),b=ye("isSeeking"),x=ye("groupIndices").length>0,A=ye("alignToBottom"),I=ye("initialItemFinalLocationReached"),F=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:w!==0?w:A?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:w!==0?w:A?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...I?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&S?B.jsx(S,{...$t(S,l)}):B.jsx(D,{...$t(D,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:E,style:F,children:(e?t.topItems:t.items).map(_=>{const k=_.originalIndex,P=h(k+t.firstItemIndex,_.data,l);return b?M.createElement(C,{...$t(C,l),height:_.size,index:_.index,key:P,type:_.type||"item",..._.type==="group"?{}:{groupIndex:_.groupIndex}}):_.type==="group"?M.createElement(T,{...$t(T,l),"data-index":k,"data-item-index":_.index,"data-known-size":_.size,key:P,style:lV},u(_.index,l)):M.createElement(L,{...$t(L,l),...mV(L,_.data),"data-index":k,"data-item-group-index":_.groupIndex,"data-item-index":_.index,"data-known-size":_.size,key:P,style:g?uV:$x},x?c(_.index,_.groupIndex,_.data,l):c(_.index,_.data,l))})})}),dV={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},pV={outline:"none",overflowX:"auto",position:"relative"},$u=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),fV={position:dm(),top:0,width:"100%",zIndex:1};function $t(e,t){if(typeof e!="string")return{context:t}}function mV(e,t){return{item:typeof e=="string"?void 0:t}}const hV=M.memo(function(){const e=ye("HeaderComponent"),t=Pr("headerHeight"),r=ye("HeaderFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,ye("skipAnimationFrameInResizeObserver")),s=ye("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),bV=M.memo(function(){const e=ye("FooterComponent"),t=Pr("footerHeight"),r=ye("HeaderFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,ye("skipAnimationFrameInResizeObserver")),s=ye("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null});function jx({useEmitter:e,useEmitterValue:t,usePublisher:r}){return M.memo(function({children:n,style:s,context:a,...o}){const i=r("scrollContainerState"),c=t("ScrollerComponent"),l=r("smoothScrollTargetReached"),u=t("scrollerRef"),d=t("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:m,scrollToCallback:y}=Rx(i,l,c,u,void 0,d);return e("scrollTo",y),e("scrollBy",f),B.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:m,style:{...d?pV:dV,...s},tabIndex:0,...o,...$t(c,a),children:n})})}function Vx({useEmitter:e,useEmitterValue:t,usePublisher:r}){return M.memo(function({children:n,style:s,context:a,...o}){const i=r("windowScrollContainerState"),c=t("ScrollerComponent"),l=r("smoothScrollTargetReached"),u=t("totalListHeight"),d=t("deviation"),f=t("customScrollParent"),m=M.useRef(null),y=t("scrollerRef"),{scrollByCallback:g,scrollerRef:E,scrollToCallback:w}=Rx(i,l,c,y,f);return zx(()=>{var v;return E.current=f||((v=m.current)==null?void 0:v.ownerDocument.defaultView),()=>{E.current=null}},[E,f]),e("windowScrollTo",w),e("scrollBy",g),B.jsx(c,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...s,...u!==0?{height:u+d}:{}},...o,...$t(c,a),children:n})})}const yV=({children:e})=>{const t=M.useContext(Nx),r=Pr("viewportHeight"),n=Pr("fixedItemHeight"),s=ye("alignToBottom"),a=ye("horizontalDirection"),o=M.useMemo(()=>nx(r,c=>bs(c,a?"width":"height")),[r,a]),i=ia(o,!0,ye("skipAnimationFrameInResizeObserver"));return M.useEffect(()=>{t&&(r(t.viewportHeight),n(t.itemHeight))},[t,r,n]),B.jsx("div",{"data-viewport-type":"element",ref:i,style:$u(s),children:e})},gV=({children:e})=>{const t=M.useContext(Nx),r=Pr("windowViewportRect"),n=Pr("fixedItemHeight"),s=ye("customScrollParent"),a=cx(r,s,ye("skipAnimationFrameInResizeObserver")),o=ye("alignToBottom");return M.useEffect(()=>{t&&(n(t.itemHeight),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,r,n]),B.jsx("div",{"data-viewport-type":"window",ref:a,style:$u(o),children:e})},xV=({children:e})=>{const t=ye("TopItemListComponent")||"div",r=ye("headerHeight"),n={...fV,marginTop:`${r}px`},s=ye("context");return B.jsx(t,{style:n,...$t(t,s),children:e})},wV=M.memo(function(e){const t=ye("useWindowScroll"),r=ye("topItemsIndexes").length>0,n=ye("customScrollParent"),s=ye("context");return B.jsxs(n||t?kV:EV,{...e,context:s,children:[r&&B.jsx(xV,{children:B.jsx(Gx,{showTopList:!0})}),B.jsxs(n||t?gV:yV,{children:[B.jsx(hV,{}),B.jsx(Gx,{}),B.jsx(bV,{})]})]})}),{Component:vV,useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}=Mx(iV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},wV),EV=jx({useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}),kV=Vx({useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}),CV=vV;et(_x,He(()=>{const e=K(l=>B.jsxs("td",{children:["Item $",l]})),t=K(null),r=K(l=>B.jsxs("td",{colSpan:1e3,children:["Group ",l]})),n=K(null),s=K(null),a=K({}),o=K(pm),i=K(ho),c=(l,u=null)=>Ht(W(a,re(d=>d[l]),tt()),u);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:s,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}})),dm();const Wx={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},TV={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:qx,floor:Gu,max:yc,min:mm,round:Yx}=Math;function Kx(e,t,r){return Array.from({length:t-e+1}).map((n,s)=>({data:r===null?null:r[s+e],index:s+e}))}function SV(e){return{...TV,items:e}}function ju(e,t){return e&&e.width===t.width&&e.height===t.height}function AV(e,t){return e&&e.column===t.column&&e.row===t.row}const PV=He(([{increaseViewportBy:e,listBoundary:t,overscan:r,visibleRange:n},{footerHeight:s,headerHeight:a,scrollBy:o,scrollContainerState:i,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,m,{didMount:y,propsReady:g},{customScrollParent:E,useWindowScroll:w,windowScrollContainerState:v,windowScrollTo:S,windowViewportRect:C},D])=>{const L=K(0),T=K(0),h=K(Wx),b=K({height:0,width:0}),x=K({height:0,width:0}),A=Oe(),I=Oe(),F=K(0),_=K(null),k=K({column:0,row:0}),P=Oe(),O=Oe(),U=K(!1),z=K(0),H=K(!0),G=K(!1),J=K(!1);je(W(y,Te(z),fe(([Q,we])=>!!we)),()=>{Ce(H,!1)}),je(W(vt(y,H,x,b,z,G),fe(([Q,we,_e,$e,,ot])=>Q&&!we&&_e.height!==0&&$e.height!==0&&!ot)),([,,,,Q])=>{Ce(G,!0),sm(1,()=>{Ce(A,Q)}),Wr(W(l),()=>{Ce(t,[0,0]),Ce(H,!0)})}),ce(W(O,fe(Q=>Q!=null&&Q.scrollTop>0),ln(0)),T),je(W(y,Te(O),fe(([,Q])=>Q!=null)),([,Q])=>{Q&&(Ce(b,Q.viewport),Ce(x,Q.item),Ce(k,Q.gap),Q.scrollTop>0&&(Ce(U,!0),Wr(W(l,oa(1)),we=>{Ce(U,!1)}),Ce(c,{top:Q.scrollTop})))}),ce(W(b,re(({height:Q})=>Q)),d),ce(W(vt(me(b,ju),me(x,ju),me(k,(Q,we)=>Q&&Q.column===we.column&&Q.row===we.row),me(l)),re(([Q,we,_e,$e])=>({gap:_e,item:we,scrollTop:$e,viewport:Q}))),P),ce(W(vt(me(L),n,me(k,AV),me(x,ju),me(b,ju),me(_),me(T),me(U),me(H),me(z)),fe(([,,,,,,,Q])=>!Q),re(([Q,[we,_e],$e,ot,Se,ve,be,,Ze,Ye])=>{const{column:Xe,row:Fr}=$e,{height:Ot,width:vm}=ot,{width:C5}=Se;if(be===0&&(Q===0||C5===0))return Wx;if(vm===0){const I5=am(Ye,Q),NW=I5+Math.max(be-1,0);return SV(Kx(I5,NW,ve))}const qu=Zx(C5,vm,Xe);let Bo,Ea;Ze?we===0&&_e===0&&be>0?(Bo=0,Ea=be-1):(Bo=qu*Gu((we+Fr)/(Ot+Fr)),Ea=qu*qx((_e+Fr)/(Ot+Fr))-1,Ea=mm(Q-1,yc(Ea,qu-1)),Bo=mm(Ea,yc(0,Bo))):(Bo=0,Ea=-1);const T5=Kx(Bo,Ea,ve),{bottom:S5,top:A5}=Xx(Se,$e,ot,T5),P5=qx(Q/qu),MW=P5*Ot+(P5-1)*Fr-S5;return{bottom:S5,itemHeight:Ot,items:T5,itemWidth:vm,offsetBottom:MW,offsetTop:A5,top:A5}})),h),ce(W(_,fe(Q=>Q!==null),re(Q=>Q.length)),L),ce(W(vt(b,x,h,k),fe(([Q,we,{items:_e}])=>_e.length>0&&we.height!==0&&Q.height!==0),re(([Q,we,{items:_e},$e])=>{const{bottom:ot,top:Se}=Xx(Q,$e,we,_e);return[Se,ot]}),tt(cc)),t);const pe=K(!1);ce(W(l,Te(pe),re(([Q,we])=>we||Q!==0)),pe);const he=br(W(vt(h,L),fe(([{items:Q}])=>Q.length>0),Te(pe),fe(([[Q,we],_e])=>{const $e=Q.items[Q.items.length-1].index===we-1;return(_e||Q.bottom>0&&Q.itemHeight>0&&Q.offsetBottom===0&&Q.items.length===we)&&$e}),re(([[,Q]])=>Q-1),tt())),ie=br(W(me(h),fe(({items:Q})=>Q.length>0&&Q[0].index===0),ln(0),tt())),de=br(W(me(h),Te(U),fe(([{items:Q},we])=>Q.length>0&&!we),re(([{items:Q}])=>({endIndex:Q[Q.length-1].index,startIndex:Q[0].index})),tt(hx),$n(0)));ce(de,m.scrollSeekRangeChanged),ce(W(A,Te(b,x,L,k),re(([Q,we,_e,$e,ot])=>{const Se=vx(Q),{align:ve,behavior:be,offset:Ze}=Se;let Ye=Se.index;Ye==="LAST"&&(Ye=$e-1),Ye=yc(0,Ye,mm($e-1,Ye));let Xe=hm(we,ot,_e,Ye);return ve==="end"?Xe=Yx(Xe-we.height+_e.height):ve==="center"&&(Xe=Yx(Xe-we.height/2+_e.height/2)),Ze&&(Xe+=Ze),{behavior:be,top:Xe}})),c);const Be=Ht(W(h,re(Q=>Q.offsetBottom+Q.bottom)),0);return ce(W(C,re(Q=>({height:Q.visibleHeight,width:Q.visibleWidth}))),b),{customScrollParent:E,data:_,deviation:F,footerHeight:s,gap:k,headerHeight:a,increaseViewportBy:e,initialItemCount:T,itemDimensions:x,overscan:r,restoreStateFrom:O,scrollBy:o,scrollContainerState:i,scrollHeight:I,scrollTo:c,scrollToIndex:A,scrollTop:l,smoothScrollTargetReached:u,totalCount:L,useWindowScroll:w,viewportDimensions:b,windowScrollContainerState:v,windowScrollTo:S,windowViewportRect:C,...m,gridState:h,horizontalDirection:J,initialTopMostItemIndex:z,totalListHeight:Be,...f,endReached:he,propsReady:g,rangeChanged:de,startReached:ie,stateChanged:P,stateRestoreInProgress:U,...D}},et(om,Wt,mc,Ox,ys,cm,hs));function Zx(e,t,r){return yc(1,Gu((e+r)/(Gu(t)+r)))}function Xx(e,t,r,n){const{height:s}=r;if(s===void 0||n.length===0)return{bottom:0,top:0};const a=hm(e,t,r,n[0].index);return{bottom:hm(e,t,r,n[n.length-1].index)+s,top:a}}function hm(e,t,r,n){const s=Zx(e.width,r.width,t.column),a=Gu(n/s),o=a*r.height+yc(0,a-1)*t.row;return o>0?o+t.row:o}const IV=He(()=>{const e=K(d=>`Item ${d}`),t=K({}),r=K(null),n=K("virtuoso-grid-item"),s=K("virtuoso-grid-list"),a=K(pm),o=K("div"),i=K(ho),c=(d,f=null)=>Ht(W(t,re(m=>m[d]),tt()),f),l=K(!1),u=K(!1);return ce(me(u),l),{components:t,computeItemKey:a,context:r,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:o,itemClassName:n,ItemComponent:c("Item","div"),itemContent:e,listClassName:s,ListComponent:c("List","div"),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),BV=He(([e,t])=>({...e,...t}),et(PV,IV)),FV=M.memo(function(){const e=at("gridState"),t=at("listClassName"),r=at("itemClassName"),n=at("itemContent"),s=at("computeItemKey"),a=at("isSeeking"),o=Ir("scrollHeight"),i=at("ItemComponent"),c=at("ListComponent"),l=at("ScrollSeekPlaceholder"),u=at("context"),d=Ir("itemDimensions"),f=Ir("gap"),m=at("log"),y=at("stateRestoreInProgress"),g=Ir("reportReadyState"),E=ia(M.useMemo(()=>w=>{const v=w.parentElement.parentElement.scrollHeight;o(v);const S=w.firstChild;if(S){const{height:C,width:D}=S.getBoundingClientRect();d({height:C,width:D})}f({column:Jx("column-gap",getComputedStyle(w).columnGap,m),row:Jx("row-gap",getComputedStyle(w).rowGap,m)})},[o,d,f,m]),!0,!1);return zx(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),y?null:B.jsx(c,{className:t,ref:E,...$t(c,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(w=>{const v=s(w.index,w.data,u);return a?B.jsx(l,{...$t(l,u),height:e.itemHeight,index:w.index,width:e.itemWidth},v):M.createElement(i,{...$t(i,u),className:r,"data-index":w.index,key:v},n(w.index,w.data,u))})})}),UV=M.memo(function(){const e=at("HeaderComponent"),t=Ir("headerHeight"),r=at("headerFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,!1),s=at("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),OV=M.memo(function(){const e=at("FooterComponent"),t=Ir("footerHeight"),r=at("headerFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,!1),s=at("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),DV=({children:e})=>{const t=M.useContext(Lx),r=Ir("itemDimensions"),n=Ir("viewportDimensions"),s=ia(M.useMemo(()=>a=>{n(a.getBoundingClientRect())},[n]),!0,!1);return M.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),r({height:t.itemHeight,width:t.itemWidth}))},[t,n,r]),B.jsx("div",{ref:s,style:$u(!1),children:e})},_V=({children:e})=>{const t=M.useContext(Lx),r=Ir("windowViewportRect"),n=Ir("itemDimensions"),s=at("customScrollParent"),a=cx(r,s,!1);return M.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,r,n]),B.jsx("div",{ref:a,style:$u(!1),children:e})},MV=M.memo(function({...e}){const t=at("useWindowScroll"),r=at("customScrollParent"),n=r||t?LV:NV,s=r||t?_V:DV,a=at("context");return B.jsx(n,{...e,...$t(n,a),children:B.jsxs(s,{children:[B.jsx(UV,{}),B.jsx(FV,{}),B.jsx(OV,{})]})})}),{useEmitter:Qx,useEmitterValue:at,usePublisher:Ir}=Mx(BV,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},MV),NV=jx({useEmitter:Qx,useEmitterValue:at,usePublisher:Ir}),LV=Vx({useEmitter:Qx,useEmitterValue:at,usePublisher:Ir});function Jx(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}var bm={},e5;function zV(){if(e5)return bm;e5=1;var e=cu.GenIcon;return bm.AiFillQuestionCircle=function(r){return e({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 0 0-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z"}}]})(r)},bm}var RV=zV();function HV({logo:e,className:t="",style:r={},alt:n="Token logo"}){const[s,a]=M.useState(!1);return M.useEffect(()=>{a(!1)},[e]),e&&!s?B.jsx("img",{alt:n,style:r,onError:()=>a(!0),className:`twap-token-logo ${t}`,src:e}):B.jsx(RV.AiFillQuestionCircle,{style:{width:20,height:20},className:"twap-token-svg"})}const $V=()=>B.jsx("div",{className:"twap-orders__loader",children:B.jsx("p",{children:"Loading..."})}),GV=()=>{const{isLoading:e}=Ou(),t=q2(),r=Z(a=>a.state.orderIdsToCancel),n=Z(a=>a.state.cancelOrdersMode),s=Y2();return B.jsx(B.Fragment,{children:e?B.jsx($V,{}):t!=null&&t.length?B.jsx("div",{className:`twap-orders__list ${n?"twap-orders__list-select-mode":""}`,children:B.jsx(CV,{style:{height:"100%"},data:t,itemContent:(a,o)=>B.jsx(jV,{cancelOrdersMode:!!n,selected:(r==null?void 0:r.includes(o.id))||!1,selectOrder:s,order:o},a)})}):B.jsx(VV,{})})},jV=({order:e,selectOrder:t,selected:r,cancelOrdersMode:n})=>{const s=Z(i=>i.updateState),a=gt.useCallback(()=>{s({selectedOrderID:e==null?void 0:e.id})},[s,e==null?void 0:e.id]),o=gt.useCallback(()=>{n?t(e==null?void 0:e.id):a()},[n,t,a,e==null?void 0:e.id]);return B.jsx("div",{className:`twap-orders__list-item twap-orders__list-item-${e.status} ${n?"twap-orders__list-item-select-mode":""} ${r?"twap-orders__list-item-selected":""}`,onClick:o,children:B.jsxs("div",{className:"twap-orders__list-item-content",children:[B.jsx(WV,{order:e}),B.jsx(qV,{value:e.progress||0}),B.jsxs("div",{className:"twap-orders__list-item-tokens",children:[B.jsx(t5,{address:e.srcTokenAddress}),B.jsx(mj.HiArrowRight,{className:"twap-orders__list-item-tokens-arrow"}),B.jsx(t5,{address:e.dstTokenAddress})]})]})})},VV=()=>{const e=Z(n=>n.state.orderHistoryStatusFilter),t=Ue(),r=gt.useMemo(()=>e||"",[e]);return B.jsx("div",{className:"twap-orders__list-empty",children:B.jsx("p",{children:t("noOrders",{status:r})})})},WV=({order:e})=>{const t=e&&e.status,r=W2(e),n=$0(e.createdAt);return B.jsxs("div",{className:"twap-orders__list-item-header",children:[B.jsxs("p",{className:"twap-orders__list-item-header-title",children:[r," ",B.jsx("span",{children:`(${n})`})]}),B.jsx("p",{className:"twap-orders__list-item-header-status",children:t})]})},t5=e=>{const{useToken:t,components:r}=se(),n=t==null?void 0:t(e.address);return B.jsx("div",{className:"twap-orders__list-item-token",children:n?B.jsxs(B.Fragment,{children:[B.jsx("div",{className:"twap-orders__list-item-token-logo",children:r.TokenLogo?B.jsx(r.TokenLogo,{token:n}):B.jsx(HV,{logo:n==null?void 0:n.logoUrl})}),B.jsx("p",{className:"twap-orders__list-item-token-symbol",children:n==null?void 0:n.symbol})]}):B.jsx("div",{})})};function qV(e){return B.jsxs("div",{className:"twap-orders__list-item-progress",children:[B.jsx("div",{className:"twap-orders__list-item-progress-bar",children:B.jsx("div",{className:"twap-orders__list-item-progress-bar-filled",style:{width:`${e.value}%`}})}),B.jsx("div",{className:"twap-orders__list-item-token-progress-label",children:B.jsx("p",{children:`${Math.round(e.value)}%`})})]})}const YV=()=>{const e=Z(r=>r.state.selectedOrderID),t=e!==void 0;return B.jsx("div",{className:`twap-orders ${e!==void 0?"twap-orders__show-selected":""}`,children:t?B.jsx(qG,{}):B.jsx(GV,{})})},KV=e=>{const t=Ue(),{marketPrice:r}=se(),n=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{const{isError:a,value:o}=bh(e);if(!(!a||j(n||"0").isZero()||!r))return{type:Mt.MIN_FILL_DELAY,value:o,message:t("minFillDelayError",{fillDelay:`${Ad(o)} ${t("minutes")}`})}},[e,t,n,r])},ua=()=>{const e=Z(s=>s.state.typedFillDelay),t=Z(s=>s.updateState),r=M.useMemo(()=>e||Ic,[e]),n=KV(r);return{fillDelay:r,onChange:M.useCallback(s=>t({typedFillDelay:s}),[t]),error:n}},ZV=()=>{const{onChange:e,fillDelay:t,error:r}=ua(),n=Ue(),s=M.useCallback(o=>e({unit:t.unit,value:Number(o)}),[e,t]),a=M.useCallback(o=>e({unit:o,value:t.value}),[e,t]);return{onInputChange:s,onUnitSelect:a,onChange:e,milliseconds:t.unit*t.value,fillDelay:t,error:r,label:n("tradeIntervalTitle"),tooltip:n("tradeIntervalTootlip")}},Yr=()=>{const{srcToken:e}=se(),t=Ue(),r=Z(a=>a.state.typedSrcAmount),s=Z(a=>a.state.acceptedSrcAmount)||r;return{amountWei:Fu(e==null?void 0:e.decimals,s),amountUI:s,error:j(s||0).isZero()?t("enterAmount"):void 0}},XV=(e,t)=>{const{module:r,srcUsd1Token:n,marketPrice:s,minChunkSizeUsd:a}=se(),o=Ue(),i=Z(c=>c.state.typedSrcAmount);return M.useMemo(()=>{if(j(i||"0").isZero()||!s)return;if(!e)return{type:Mt.MIN_CHUNKS,value:1,message:`${o("minChunksError")} 1`};const{isError:c}=gh(e,t,r);if(c)return{type:Mt.MAX_CHUNKS,value:t,message:o("maxChunksError",{maxChunks:`${t}`})};const{isError:l,value:u}=yh(i||"",n||"",a||0);if(l)return{type:Mt.MIN_TRADE_SIZE,value:u,message:o("minTradeSizeError",{minTradeSize:`${u}`})}},[e,t,r,i,n,a,o,s])},pn=()=>{const{srcToken:e,srcUsd1Token:t,module:r,minChunkSizeUsd:n}=se(),s=Z(g=>g.state.typedChunks),a=ua().fillDelay,o=Z(g=>g.updateState),{amountWei:i,amountUI:c}=Yr(),l=M.useMemo(()=>ih(a,c||"",t||"",n||0),[c,t,n,a]),u=M.useMemo(()=>oh(l,r,s),[l,s,r]),d=M.useCallback(g=>o({typedChunks:g}),[o]),f=M.useMemo(()=>lh(i||"",u),[i,u]),m=Vr(e==null?void 0:e.decimals,f),y=M.useMemo(()=>t?j(m||"0").times(t||0).toString():"0",[m,t]);return{totalTrades:u,maxTrades:l,amountPerTradeUI:m,amountPerTradeWei:f,amountPerTradeUsd:y,onChange:d,error:XV(u,l)}},QV=()=>{const{srcToken:e,dstToken:t}=se(),r=Ue(),{onChange:n,totalTrades:s,amountPerTradeUsd:a,amountPerTradeUI:o,error:i,maxTrades:c,amountPerTradeWei:l}=pn(),u=Ge({value:o}),d=Ge({value:a});return{error:i,maxTrades:c,totalTrades:s,amountPerTrade:u,amountPerTradeWei:l,onChange:n,label:r("tradesAmountTitle"),tooltip:r("totalTradesTooltip"),amountPerTradeUsd:d,fromToken:e,toToken:t}},JV=()=>{const{srcToken:e,dstToken:t,marketPrice:r}=se(),[n,s]=M.useState(!1),a=M.useMemo(()=>{if(j(r||"0").isZero()||!t)return"0";const o=Xr(t==null?void 0:t.decimals,r);return n?j(1).div(o||0).toFixed():o},[n,r,e==null?void 0:e.decimals,t==null?void 0:t.decimals]);return{fromToken:n?t:e,toToken:n?e:t,price:Ge({value:a}),priceWei:Fu(t==null?void 0:t.decimals,r),onInvert:M.useCallback(()=>s(!n),[n])}},eW=e=>{const{module:t,marketPrice:r}=se(),n=Ue();return M.useMemo(()=>{const s=mh(t,e),a=hh(e);if(r){if(s.isError)return{type:Mt.MAX_ORDER_DURATION,value:s.value,message:n("maxDurationError",{duration:`${Math.floor(d1(s.value)).toFixed(0)} ${n("days")}`})};if(a.isError)return{type:Mt.MIN_ORDER_DURATION,value:a.value,message:n("minDurationError",{duration:`${Math.floor(Ad(a.value)).toFixed(0)} ${n("minutes")}`})}}},[e,n,t,r])},ym=()=>{const{module:e}=se(),t=Z(i=>i.state.typedDuration),r=Z(i=>i.updateState),n=pn().totalTrades,s=ua().fillDelay,a=M.useMemo(()=>ah(e,n,s,t),[n,s,t,e]),o=eW(a);return{duration:a,setDuration:M.useCallback(i=>r({typedDuration:i}),[r]),error:o}},tW=()=>{const{module:e}=se(),t=Ue(),{duration:r,setDuration:n,error:s}=ym(),a=M.useCallback(c=>{n({unit:r.unit,value:Number(c)})},[n,r]),o=M.useCallback(c=>{n({unit:c,value:r.value})},[n,r]),i=M.useMemo(()=>e===Ee.STOP_LOSS?t("stopLossDurationTooltip"):t("maxDurationTooltip"),[t,e]);return{duration:r,onChange:n,milliseconds:r.unit*r.value,onInputChange:a,onUnitSelect:o,label:t("expiry"),tooltip:i,error:s}},rW=()=>{const e=Z(s=>s.state.isMarketOrder),{module:t}=se(),r=Ue(),n=t===Ee.STOP_LOSS||t===Ee.TAKE_PROFIT;return M.useMemo(()=>{if(!n)return{text:r(e?"marketOrderWarning":"limitPriceMessage"),url:"https://www.orbs.com/dtwap-and-dlimit-faq/"}},[e,r,n])},gm=()=>{const e=Z(r=>r.state.currentTime),t=ym().duration;return M.useMemo(()=>ch(e,t),[e,t])},Vu=()=>{const{srcToken:e,dstToken:t,marketPriceLoading:r}=se(),n=Z(l=>l.updateState),s=Z(l=>l.state.isInvertedTrade),a=Z(l=>l.state.typedTriggerPrice),o=Z(l=>l.state.typedLimitPrice),i=Z(l=>l.state.isMarketOrder);return{onInvert:M.useCallback(()=>{a!==void 0&&n({typedTriggerPrice:j(1).div(a).toFixed()}),o!==void 0&&n({typedLimitPrice:j(1).div(o).toFixed()}),n({isInvertedTrade:!s})},[n,s,a,o,r]),isInverted:s,fromToken:s?t:e,toToken:s?e:t,isMarketPrice:i}},r5=({typedValue:e,tokenDecimals:t=18,initialPrice:r="0",percentage:n,setValue:s,setPercentage:a})=>{const{srcUsd1Token:o,dstUsd1Token:i}=se(),{isInverted:c}=Vu(),l=M.useMemo(()=>{if(e!==void 0){const g=c?j(e).isZero()?j(0):j(1).div(e):j(e);return Ac(t,g.toFixed())}if(n!==void 0&&j(r||"0").gt(0)&&!j(r||"0").isNaN()){const g=j(r||"0"),E=j(n||0).div(100);return g.plus(g.multipliedBy(E)).decimalPlaces(0).toFixed()}return j(r).gt(0)?r:""},[e,n,t,r,c]),u=M.useCallback(g=>{s(g),a(null)},[s,a]),d=M.useCallback(g=>{s(void 0),a(g)},[s,a]),f=M.useMemo(()=>{if(!r||j(r).isZero())return"";if(n!=null)return n;if(l){const g=j(r),w=j(l).minus(g).div(g).multipliedBy(100).decimalPlaces(2).toString();return j(w||"0").isZero()?"":w}return""},[l,r,n]),m=M.useMemo(()=>{let g="";if(e!==void 0)g=e;else{const E=Xr(t,l);if(j(E||"0").isZero())return"";g=c?j(1).div(E).toFixed():E}return Do(g,6,t)},[e,t,l,c]),y=aa(c?o:i,m||"0");return{amountWei:j(l).isNaN()?"":l,amountUI:j(m).isNaN()?"":m,selectedPercentage:f,onChange:u,onPercentageChange:d,isInverted:c,usd:j(y).isNaN()?"":y}},nW=()=>{const{module:e}=se();return M.useMemo(()=>e===Ee.STOP_LOSS?Zm:Xm,[e])},xm=()=>{const{module:e}=se(),t=Z(r=>r.state.isMarketOrder);return M.useMemo(()=>e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT||t?void 0:e===Ee.STOP_LOSS?Qm:Jm,[e,t])},sW=(e="")=>{const{module:t,marketPrice:r}=se(),n=Ue(),s=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{if(j(s||"0").isZero()||!r||t!==Ee.STOP_LOSS&&t!==Ee.TAKE_PROFIT)return;const a=uh(r||"",e||"",t);if(a!=null&&a.isError)return{type:Mt.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE,value:a.value,message:n("StopLossTriggerPriceError")||""};const o=dh(r||"",e||"",t);if(o!=null&&o.isError)return{type:Mt.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE,value:o.value,message:n("TakeProfitTriggerPriceError")||""};if(!e||j(e||0).isZero())return{type:Mt.EMPTY_TRIGGER_PRICE,value:e,message:n("emptyTriggerPrice")||""}},[r,e,t,n,s])},aW=e=>{const{srcToken:t,dstToken:r,module:n}=se(),s=pn().amountPerTradeWei,a=Z(i=>i.state.isMarketOrder),o=M.useMemo(()=>sh(n,s,e,(t==null?void 0:t.decimals)||0),[e,s,a,t==null?void 0:t.decimals,n]);return{amountWei:o,amountUI:Vr((r==null?void 0:r.decimals)||0,o)}},da=()=>{const{dstToken:e,marketPrice:t,module:r}=se(),n=Z(m=>m.updateState),s=nW(),a=Z(m=>m.state.triggerPricePercent),o=M.useCallback(m=>{n({triggerPricePercent:m})},[n]),i=a===void 0?s:a,c=r===Ee.STOP_LOSS||r===Ee.TAKE_PROFIT,l=r5({typedValue:Z(m=>m.state.typedTriggerPrice),percentage:i,tokenDecimals:e==null?void 0:e.decimals,initialPrice:c?t:void 0,setValue:M.useCallback(m=>n({typedTriggerPrice:m}),[n]),setPercentage:o}),u=sW(l.amountWei),{amountWei:d,amountUI:f}=aW(l.amountWei);return M.useMemo(()=>({...l,error:u,pricePerChunkWei:d,pricePerChunkUI:f}),[l,u,d,f])},oW=()=>{const{module:e,marketPrice:t,marketPriceLoading:r}=se(),n=Ue(),{amountUI:s,onChange:a,onPercentageChange:o,usd:i,selectedPercentage:c,error:l}=da(),u=Z(v=>v.state.isMarketOrder),d=Z(v=>v.updateState),{isInverted:f,onInvert:m,fromToken:y,toToken:g}=Vu(),E=M.useCallback(()=>{d({triggerPricePercent:void 0,typedTriggerPrice:void 0})},[d]),w=e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT;return{price:s,error:l,label:n("stopLossLabel"),tooltip:e===Ee.STOP_LOSS?n("stopLossTooltip"):n("takeProfitTooltip"),onChange:a,onPercentageChange:o,percentage:c,isActive:!u,onReset:E,usd:i,fromToken:y,toToken:g,prefix:"",isLoading:r||!t,isInverted:f,hide:w,onInvert:m}},iW=e=>{const{module:t,marketPrice:r}=se(),n=Ue(),{amountWei:s}=da(),a=Z(i=>i.state.isMarketOrder),o=Z(i=>i.state.typedSrcAmount);return M.useMemo(()=>{if(j(o||"0").isZero()||!s||!r)return;const i=ph(s,e,a,t),c=fh(s,e,a,t);if(i!=null&&i.isError)return{type:Mt.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE,message:n("triggerLimitPriceError")||"",value:i.value};if(c!=null&&c.isError)return{type:Mt.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE,message:n("triggerLimitPriceError")||"",value:c.value};if(e&&j(e||0).isZero())return{type:Mt.MISSING_LIMIT_PRICE,message:n("emptyLimitPrice")||"",value:e||""}},[e,n,s,t,a,o,r])},Wu=()=>{const{dstToken:e,marketPrice:t,module:r}=se(),n=Z(l=>l.updateState),s=xm(),a=Z(l=>l.state.limitPricePercent),o=a===void 0?s:a,i=r5({typedValue:Z(l=>l.state.typedLimitPrice),percentage:o,tokenDecimals:e==null?void 0:e.decimals,initialPrice:t,setValue:M.useCallback(l=>n({typedLimitPrice:l}),[n]),setPercentage:M.useCallback(l=>{n({limitPricePercent:l})},[n,r])}),c=iW(i.amountWei);return M.useMemo(()=>({...i,error:c}),[i,c])},cW=()=>{const{module:e}=se(),t=Z(i=>i.updateState),r=Z(i=>i.state.isMarketOrder),n=xm(),s=Z(i=>i.state.triggerPricePercent)||0,a=e===Ee.LIMIT,o=M.useCallback(()=>{!r&&e===Ee.STOP_LOSS&&t({limitPricePercent:n}),t({isMarketOrder:!r})},[t,s,e,r,n]);return{isLimitPrice:!r,toggleLimitPrice:o,hide:a}},lW=()=>{const{module:e,marketPriceLoading:t}=se(),r=Ue(),{amountUI:n,onChange:s,onPercentageChange:a,usd:o,selectedPercentage:i,error:c}=Wu(),l=Z(L=>L.state.isMarketOrder),u=Z(L=>L.updateState),d=xm(),{isLimitPrice:f,toggleLimitPrice:m}=cW(),{triggerPricePercent:y}=Z(L=>L.state),{isInverted:g,onInvert:E,fromToken:w,toToken:v}=Vu(),S=M.useMemo(()=>{if(!(e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT||!l))return{text:r("triggerMarketPriceDisclaimer"),url:od}},[y,r,e,l]),C=M.useCallback(()=>{u({typedLimitPrice:void 0}),u({limitPricePercent:d})},[u,e,d]),D=M.useMemo(()=>e===Ee.STOP_LOSS?r("stopLossLimitPriceTooltip"):r("limitPriceTooltip"),[r,e]);return{price:n,error:c,warning:S,label:r("limitPrice"),tooltip:D,onChange:s,onPercentageChange:a,onReset:C,usd:o,fromToken:w,toToken:v,percentage:i,isInverted:g,isLoading:t,isLimitPrice:f,toggleLimitPrice:m,onInvert:E}},n5=()=>{const{module:e,marketPrice:t}=se(),r=Wu().amountWei,n=da().amountWei,s=Z(a=>a.state.isMarketOrder);return e===Ee.LIMIT||!s?r||"":e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?n||"":t||""},gc=()=>{const{srcToken:e,dstToken:t}=se(),r=n5(),n=Yr().amountWei,s=M.useMemo(()=>rh(n||"",r,(e==null?void 0:e.decimals)||0),[n,r,e==null?void 0:e.decimals]);return{amountWei:s,amountUI:Vr(t==null?void 0:t.decimals,s)}},wm=()=>{const{srcToken:e,dstToken:t,dstUsd1Token:r}=se(),n=n5(),s=pn().amountPerTradeWei,a=Z(c=>c.state.isMarketOrder),o=M.useMemo(()=>nh(s,n,!!a,(e==null?void 0:e.decimals)||0),[s,n,a,e==null?void 0:e.decimals]),i=Vr(t==null?void 0:t.decimals,o);return{amountWei:o,amountUI:i,usd:aa(i,r)}},uW=()=>{const{srcUsd1Token:e,dstUsd1Token:t}=se(),r=Yr().amountUI,n=gc().amountUI,s=aa(r,e),a=aa(n,t);return{srcAmountUsd:s,dstAmountUsd:a}},dW=()=>{const{fees:e,dstUsd1Token:t}=se(),{amountUI:r}=gc(),n=M.useMemo(()=>!e||!r?"":j(r).multipliedBy(e).dividedBy(100).toFixed(),[r]);return{amount:Ge({value:n}),percent:Ge({value:e}),usd:aa(n,t)}},pW=()=>{const e=Yr().amountUI,t=gc().amountUI,r=M.useMemo(()=>j(t||0).dividedBy(e||0).toString(),[t,e]);return Ge({value:r,decimalScale:4})},s5=()=>{const{srcToken:e,dstToken:t,account:r}=se(),n=Ue(),{amountWei:s}=Yr(),{amountWei:a,usd:o}=wm(),{totalTrades:i,amountPerTradeWei:c}=pn(),{amountWei:l,usd:u}=da(),{fillDelay:d}=ua(),f=gm(),{amountUI:m,usd:y}=Wu(),{amount:g,percent:E,usd:w}=dW(),v=Ge({value:pW(),decimalScale:4}),{srcAmountUsd:S,dstAmountUsd:C}=uW(),D=K2({srcToken:e,dstToken:t,srcAmount:s,minDestAmountPerTrade:a,totalTrades:i,triggerPricePerTrade:l,deadline:f,srcAmountPerTrade:c,maker:r,tradeInterval:d.unit*d.value,limitPrice:m});return M.useMemo(()=>({...D,srcAmountUsd:S,dstAmountUsd:C,fee:{label:n("fees",{value:`${E}%`}),value:g,usd:w},display:{...D.display,minDestAmountPerTrade:{...D.display.minDestAmountPerTrade,usd:o},triggerPricePerTrade:{...D.display.triggerPricePerTrade,usd:u},limitPrice:{...D.display.limitPrice,usd:y}}}),[D,E,g,n,v,e,t,S,C,o,u,w,y])},a5=()=>{const{srcBalance:e}=se(),t=Ue(),r=Yr().amountWei;return M.useMemo(()=>{if(e&&j(r).gt(e))return{type:Mt.INSUFFICIENT_BALANCE,message:t("insufficientFunds"),value:e||""}},[e,r,t])};function o5(){const{marketPrice:e,marketPriceLoading:t}=se(),r=Z(u=>u.state.typedSrcAmount),n=a5(),{error:s}=da(),{error:a}=Wu(),{error:o}=pn(),{error:i}=ua(),{error:c}=ym(),l=M.useMemo(()=>Fo("ignore-errors"),[]);if(!(j(e||0).isZero()||j(r||0).isZero()||t||l))return s||a||o||i||c||n}const i5=()=>{const{srcToken:e,dstToken:t,chainId:r,account:n,slippage:s,config:a}=se(),o=pn().amountPerTradeWei,i=Yr().amountWei,c=gm(),l=da().pricePerChunkWei,u=wm().amountWei,d=ua().fillDelay,f=pn().totalTrades,m=s*100,y=!f||f===1?0:d.unit*d.value;return M.useMemo(()=>{var E;const g=Is((e==null?void 0:e.address)||"")?(E=Bs(r))==null?void 0:E.wToken.address:e==null?void 0:e.address;if(!(!g||!t||!r||!n||!c||!i||!a))return wh({chainId:r,srcToken:g,dstToken:t.address,srcAmount:i,deadlineMillis:c,fillDelayMillis:y,slippage:m,account:n,srcAmountPerTrade:o,dstMinAmountPerTrade:u,triggerAmountPerTrade:l,config:a})},[e,t,r,n,i,c,o,l,m,u,d,f,a])},fW=()=>{var c;const{account:e,walletClient:t,overrides:r,refetchBalances:n,callbacks:s,chainId:a}=se(),o=(c=ac())==null?void 0:c.wToken,i=G0();return xn({mutationFn:async({onHash:l,srcAmountWei:u})=>{var m,y;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!o)throw new Error("tokenAddress is not defined");let d;ct.onWrapRequest(),(m=s==null?void 0:s.onWrapRequest)==null||m.call(s),r!=null&&r.wrap?d=await r.wrap(BigInt(u)):d=await t.writeContract({abi:Om,functionName:"deposit",account:e,address:o.address,value:BigInt(u),chain:t.chain}),l==null||l(d);const f=await i(d);if(!f)throw new Error("failed to get transaction receipt");if(f.status==="reverted")throw new Error("failed to wrap token");return ct.onWrapSuccess(d),(y=s==null?void 0:s.onWrapSuccess)==null||y.call(s,{txHash:f.transactionHash,explorerUrl:_o(f.transactionHash,a),amount:Xr(o.decimals,u)}),n==null||n(),f},onError:l=>{throw ct.onWrapError(l),l}})},mW=()=>{const{account:e,walletClient:t,chainId:r,callbacks:n}=se(),s=i5(),a=HG();return xn({mutationFn:async()=>{var y,g,E,w;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!r)throw new Error("missing chainId");if(!s)throw new Error("rePermitOrderData is not defined");const{order:o,domain:i,types:c,primaryType:l}=s;ct.onSignOrderRequest(o),(y=n==null?void 0:n.onSignOrderRequest)==null||y.call(n),console.log({domain:i,types:c,primaryType:l,message:o,account:e}),console.log("Using domain:",i),console.log("Using types:",c),console.log("Order data to sign:",JSON.stringify(o,null,2)),console.log(`Account address: ${e}`);let u;try{u=await(t==null?void 0:t.signTypedData({domain:i,types:c,primaryType:l,message:o,account:e}))}catch(v){throw(g=n==null?void 0:n.onSignOrderError)==null||g.call(n,v),ct.onSignOrderError(v),v}ct.onSignOrderSuccess(u),(E=n==null?void 0:n.onSignOrderSuccess)==null||E.call(n,u);const d=zL(u),f={v:q(d.v||0),r:d.r,s:d.s},m=await Th(o,f);return(w=n==null?void 0:n.onOrderCreated)==null||w.call(n,m),a(m),m}})},c5=()=>{const{account:e,publicClient:t,config:r}=se();return xn({mutationFn:async({tokenAddress:n,srcAmountWei:s})=>{if(!t)throw new Error("missing publicClient");if(!e)throw new Error("missing account");if(!r)throw new Error("missing config");const a=await t.readContract({address:n,abi:wg,functionName:"allowance",args:[e,r.repermit]}).then(i=>i.toString()),o=j(a||"0").lt(j(s).toString());return{allowance:a,approvalRequired:o}}})},hW=()=>{const{account:e,walletClient:t,overrides:r,config:n,chainId:s,callbacks:a}=se(),o=G0(),{mutateAsync:i}=c5();return xn({onError:c=>{ct.onApproveError(c)},mutationFn:async({token:c,onHash:l,srcAmountWei:u})=>{var y,g;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!n)throw new Error("missing config");(y=a==null?void 0:a.onApproveRequest)==null||y.call(a),ct.onApproveRequest();let d;if(r!=null&&r.approveOrder?d=await r.approveOrder({tokenAddress:c.address,spenderAddress:n.repermit,amount:Ls}):d=await t.writeContract({abi:wg,functionName:"approve",account:e,address:c.address,args:[n.repermit,Ls],chain:t.chain}),!d)throw new Error("failed to approve token");l(d);const f=await o(d);if(!f)throw new Error("failed to get transaction receipt");if(f.status==="reverted")throw new Error("failed to approve token");let m=!1;for(let E=0;E<3;E++){const{approvalRequired:w}=await i({tokenAddress:c.address,srcAmountWei:u});if(!w){m=!0;break}E<2&&await new Promise(v=>setTimeout(v,3e3))}if(!m)throw new Error(`Insufficient ${c.symbol} allowance to perform the swap. Please approve the token first.`);return ct.onApproveSuccess(f.transactionHash),(g=a==null?void 0:a.onApproveSuccess)==null||g.call(a,{txHash:f.transactionHash,explorerUrl:_o(f.transactionHash,s),token:c,amount:Xr(c.decimals,u)}),f}})},bW=()=>{const{account:e,chainId:t,srcToken:r,dstToken:n,module:s,slippage:a}=se(),o=da(),i=Yr().amountWei,c=pn().amountPerTradeWei,l=gm(),u=ua().fillDelay,d=wm().amountWei,f=Z(m=>m.state.isMarketOrder);return xn({mutationFn:async()=>{ct.onRequestOrder({account:e,chainId:t,module:s,srcToken:r,dstToken:n,fromTokenAmount:i,srcChunkAmount:c,triggerPricePerTrade:o.pricePerChunkWei,deadline:l,fillDelay:u.unit*u.value,minDstAmountOutPerTrade:d,slippage:a,isMarketOrder:f||!1})}})};function yW(e){const t=e.message,r=t.match(/,\s*code\s*:\s*(\d+)/i);return{message:t.replace(/^error\s*:/i,"").replace(/,\s*code\s*:\s*\d+/i,"").trim()||"",code:r?Number(r[1]):0,error:e}}const gW=()=>{const{srcToken:e,dstToken:t,chainId:r,callbacks:n}=se(),s=hW().mutateAsync,a=fW().mutateAsync,o=mW().mutateAsync,{mutateAsync:i}=c5(),c=Z(d=>d.updateSwapExecution),{amountWei:l}=Yr(),u=bW().mutate;return xn({mutationFn:async()=>{var f,m;const d=Is((e==null?void 0:e.address)||" ");try{if(!e)throw new Error("missing srcToken");if(!t)throw new Error("missing dstToken");if(!r)throw new Error("missing chainId");const y=u1(e,r);c({allowanceLoading:!0});const{approvalRequired:g}=await i({tokenAddress:y.address,srcAmountWei:l});let E=0,w=1;d&&w++,g&&w++,c({totalSteps:w,stepIndex:E,allowanceLoading:!1,status:kt.LOADING}),u(),d&&(c({step:Ds.WRAP}),await a({onHash:S=>c({wrapTxHash:S}),srcAmountWei:l}),E++,c({stepIndex:E})),g&&(c({step:Ds.APPROVE}),await s({token:y,onHash:S=>c({approveTxHash:S}),srcAmountWei:l}),E++,c({stepIndex:E})),c({step:Ds.CREATE});const v=await o();return c({status:kt.SUCCESS,orderId:v.id}),v}catch(y){if(Sd(y))(f=n==null?void 0:n.onSubmitOrderRejected)==null||f.call(n),c({step:void 0,status:void 0,stepIndex:void 0});else{const g=yW(y);(m=n==null?void 0:n.onSubmitOrderFailed)==null||m.call(n,g),c({status:kt.FAILED,error:g})}}}})},xW=()=>{const{marketPrice:e,srcToken:t,dstToken:r,marketPriceLoading:n,srcBalance:s,srcUsd1Token:a,noLiquidity:o}=se(),i=Ue(),c=gW(),l=Z(h=>h.updateState),{amountUI:u,amountWei:d}=Yr(),f=Z(h=>h.resetState),m=Z(h=>h.state.swapExecution),y=Z(h=>h.state.typedSrcAmount),g=n||j(a||"0").isZero()||s===void 0||j(e||"0").isZero(),E=!!(t&&r&&y&&g),w=o5(),v=M.useMemo(()=>o?i("noLiquidity"):j(y||"0").isZero()?i("enterAmount"):(w==null?void 0:w.type)===Mt.INSUFFICIENT_BALANCE?i("insufficientFunds"):i("placeOrder"),[w,i,y,o]),S=M.useCallback(()=>{(m==null?void 0:m.status)===kt.SUCCESS&&(l({typedSrcAmount:""}),setTimeout(()=>{f()},1e3))},[m==null?void 0:m.status,f,l]),C=M.useCallback(()=>{(m==null?void 0:m.status)!==kt.LOADING&&l({acceptedSrcAmount:void 0,acceptedMarketPrice:void 0,swapExecution:{srcToken:t,dstToken:r}})},[l,t,r]),D=xn({mutationFn:async()=>(l({acceptedSrcAmount:u,acceptedMarketPrice:e}),await c.mutateAsync())}),L=M.useCallback(()=>D.mutateAsync(),[D]),T=s5();return M.useMemo(()=>({resetSwap:f,onCloseModal:S,onOpenModal:C,onSubmitOrder:L,...m,swapLoading:(m==null?void 0:m.status)===kt.LOADING||(m==null?void 0:m.allowanceLoading),swapSubmitted:!!(m!=null&&m.status),order:T,srcAmountWei:d,srcAmount:d,openSubmitModalButton:{disabled:!!(w||o||E||j(y||"0").isZero()||!t||!r),text:v,loading:E}}),[m,t,r,T,f,S,C,L,v,E,w,o,y])},l5=(e,t)=>{const{marketPriceLoading:r,srcToken:n,dstToken:s,srcBalance:a,dstBalance:o}=se(),i=Z(C=>C.state.typedSrcAmount),c=Z(C=>C.updateState),{srcUsd1Token:l,dstUsd1Token:u}=se(),d=aa(i,l),f=aa(t,u),m=CG(),y=e?n:s,g=Vr(y==null?void 0:y.decimals,e?a:o),E=a5(),w=M.useCallback(C=>{e&&c({typedSrcAmount:C})},[c,e]),v=M.useCallback(()=>{e&&c({typedSrcAmount:Do(g,8)})},[c,e,g]),S=m||e?i:Do(t||"",8);return{balance:g,usd:e||m?d:f,value:S||"",valueWei:Fu(y==null?void 0:y.decimals,S),onChange:w,onMax:v,isLoading:i?e?!1:r:!1,token:y,isInsufficientBalance:e?E:void 0}},wW=()=>l5(!0),vW=()=>{const e=gc().amountUI,t=Z(r=>r.state.typedSrcAmount);return l5(!1,t?e:"")},EW=()=>{const e=Z(n=>n.state.isMarketOrder),t=Z(n=>n.updateState),r=M.useCallback(()=>{t({isMarketOrder:!e})},[t,e]);return{isMarketPrice:!e,togglePrice:r}},u5=M.createContext({}),kW=({children:e,...t})=>B.jsx(u5.Provider,{value:t,children:e}),CW=()=>M.useContext(u5),d5=()=>{var s,a;const e=Ue(),{wrapTxHash:t,srcToken:r}=Z(o=>o.state.swapExecution),n=(a=(s=ac())==null?void 0:s.wToken)==null?void 0:a.symbol;return t?B.jsx("p",{className:"twap-error-wrap-msg",children:e("wrapMsg",{symbol:(r==null?void 0:r.symbol)||"",wSymbol:n||""})}):null},TW=(e=!1,t=1)=>{const{module:r}=se(),n=Ue();return M.useMemo(()=>r===Ee.STOP_LOSS?n("stopLoss"):r===Ee.TAKE_PROFIT?n("takeProfit"):n(e?"twapMarket":t===1?"limit":"twapLimit"),[n,r,e,t])},SW=({price:e,dstTokenSymbol:t,label:r,usd:n})=>B.jsxs(xe.DetailRow,{title:r,children:[`${e||"-"} ${t||""}`,B.jsx(xe.USD,{value:n})]}),p5=()=>{const e=Ue(),t=Z(a=>a.state.isMarketOrder),r=Z(a=>a.state.swapExecution.status),{totalTrades:n}=pn(),s=TW(t,n);return r===kt.SUCCESS?e("createOrderActionSuccess",{name:s}):e("createOrderAction",{name:s})},AW=()=>{const e=Z(y=>y.state.swapExecution.srcToken),t=Ue(),{step:r,wrapTxHash:n,approveTxHash:s}=Z(y=>y.state.swapExecution),a=ac(),o=H0(n),i=H0(n),c=H0(s),l=Z(y=>y.state.swapExecution.status),d=Is((e==null?void 0:e.address)||"")?(a==null?void 0:a.native.symbol)||"":(e==null?void 0:e.symbol)||"",f=a==null?void 0:a.wToken.symbol,m=p5();return M.useMemo(()=>r===Ds.WRAP?{title:t("wrapAction",{symbol:d}),footerLink:o,footerText:t(o?"viewOnExplorer":"proceedInWallet")}:r===Ds.APPROVE?{title:t("approveAction",{symbol:d}),footerLink:c,footerText:t(c?"viewOnExplorer":"proceedInWallet")}:{title:m,footerText:l===kt.LOADING?t("proceedInWallet"):void 0},[r,c,d,m,t,o,i,f,l])},PW=({error:e})=>B.jsxs("div",{className:"twap-error",children:[B.jsx("h2",{className:"twap-error-title",children:"Transaction failed"}),(e==null?void 0:e.code)&&B.jsxs("p",{className:"twap-error-code",children:["Error code: ",e==null?void 0:e.code]}),B.jsx(d5,{})]});function IW({error:e}){const{components:t}=se(),r=Ue(),n=Z(o=>{var i;return(i=o.state.swapExecution)==null?void 0:i.wrapTxHash}),s=t.SubmitOrderErrorView,a=B.jsx(Qn.Failed,{error:B.jsx(PW,{error:e}),footerLink:od,footerText:r("viewOnExplorer")});return s?B.jsx(s,{wrapTxHash:n,error:e,children:a}):a}const BW=()=>{const{components:e}=se(),t=Z(f=>f.state.swapExecution.srcToken),r=Z(f=>f.state.swapExecution.dstToken),{reviewDetails:n}=CW(),s=Ue(),a=Z(f=>{var m;return!!((m=f.state.swapExecution)!=null&&m.status)}),o=s5(),i=Ge({value:o.srcAmountUsd,decimalScale:2}),c=Ge({value:o.dstAmountUsd,decimalScale:2}),l=e.USD,u=e.SubmitOrderMainView,d=B.jsxs(B.Fragment,{children:[B.jsx(Qn.Main,{fromTitle:s("from"),toTitle:s("to"),inUsd:l?B.jsx(l,{value:o.srcAmountUsd,isLoading:!1}):`$${i}`,outUsd:l?B.jsx(l,{value:o.dstAmountUsd,isLoading:!1}):`$${c}`}),!a&&B.jsxs("div",{className:"twap-create-order-bottom",children:[B.jsx(xe.Container,{children:B.jsxs("div",{className:"twap-create-order-details",children:[B.jsx(xe.Deadline,{deadline:o.display.deadline.value,label:o.display.deadline.label,tooltip:o.display.deadline.tooltip||""}),B.jsx(xe.TriggerPrice,{price:o.display.triggerPricePerTrade.value,dstToken:r,label:o.display.triggerPricePerTrade.label,tooltip:o.display.triggerPricePerTrade.tooltip||"",usd:o.display.triggerPricePerTrade.usd}),B.jsx(SW,{price:o.display.limitPrice.value,dstTokenSymbol:r==null?void 0:r.symbol,label:o.display.limitPrice.label,usd:o.display.limitPrice.usd}),B.jsx(xe.MinDestAmount,{dstToken:r,dstMinAmountOut:o.display.minDestAmountPerTrade.value,label:o.display.minDestAmountPerTrade.label,tooltip:o.display.minDestAmountPerTrade.tooltip||"",usd:o.display.minDestAmountPerTrade.usd}),B.jsx(xe.TradeSize,{tradeSize:o.display.tradeSize.value,trades:o.display.totalTrades.value,srcToken:t,label:o.display.tradeSize.label,tooltip:o.display.tradeSize.tooltip}),B.jsx(xe.TradesAmount,{trades:o.display.totalTrades.value,label:o.display.totalTrades.label,tooltip:o.display.totalTrades.tooltip}),B.jsx(xe.TradeInterval,{chunks:o.display.totalTrades.value,fillDelayMillis:o.display.tradeInterval.value,label:o.display.tradeInterval.label,tooltip:o.display.tradeInterval.tooltip}),B.jsx(xe.Recipient,{}),o.fee.value&&B.jsx(xe.Fees,{fees:o.fee.value,label:o.fee.label,usd:o.fee.usd,dstTokenSymbol:r==null?void 0:r.symbol})]})}),n]})]});return u?B.jsx(u,{children:d}):d},FW=e=>{const{status:t,stepIndex:r,totalSteps:n,error:s}=Z(v=>v.state.swapExecution),{components:a}=se(),o=a.Spinner,i=a.SuccessIcon,c=a.ErrorIcon,l=a.TokenLogo,{srcToken:u,dstToken:d}=se(),f=Yr().amountUI,m=gc().amountUI,y=Ge({value:f,decimalScale:2}),g=Ge({value:m,decimalScale:2}),E=M.useMemo(()=>({symbol:u==null?void 0:u.symbol,logoUrl:u==null?void 0:u.logoUrl}),[u]),w=M.useMemo(()=>({symbol:d==null?void 0:d.symbol,logoUrl:d==null?void 0:d.logoUrl}),[d]);return B.jsx(kW,{...e,children:B.jsx(Qn,{inAmount:y,outAmount:g,swapStatus:t,totalSteps:n,currentStep:AW(),currentStepIndex:r,inToken:E,outToken:w,components:{SrcTokenLogo:l&&B.jsx(l,{token:u}),DstTokenLogo:l&&B.jsx(l,{token:d}),Failed:B.jsx(IW,{error:s}),Success:B.jsx(UW,{}),Main:B.jsx(BW,{}),Loader:o,SuccessIcon:i,FailedIcon:c}})})},UW=()=>{const e=p5(),{components:t}=se(),r=Z(a=>a.state.swapExecution.orderId),n=t.SubmitOrderSuccessView,s=B.jsxs(B.Fragment,{children:[B.jsx(Qn.Success,{title:e}),B.jsx(d5,{})]});return n?B.jsx(n,{newOrderId:r,children:s}):s},OW=()=>{const{supportedChains:e}=se();return M.useMemo(()=>e,[e])};Eh(Fw.version);const DW=()=>{const e=Z(t=>t.updateState);return{amount:Z(t=>t.state.typedSrcAmount),reset:M.useCallback(()=>e({typedSrcAmount:""}),[e])}},_W={SubmitOrderPanel:FW,Orders:YV};R.CRASH_ERROR_MESSAGE=ew,R.Components=_W,R.Configs=Dt,R.DEFAULT_DURATION_OPTIONS=ZL,R.DEFAULT_FILL_DELAY=Ic,R.DEFAULT_STOP_LOSS_LIMIT_PERCENTAGE=Qm,R.DEFAULT_STOP_LOSS_PERCENTAGE=Zm,R.DEFAULT_TAKE_PROFIT_LIMIT_PERCENTAGE=Jm,R.DEFAULT_TAKE_PROFIT_PERCENTAGE=Xm,R.DISCLAIMER_URL=J5,R.EIP712_TYPES=Km,R.ERC20_ABI=M5,R.EXCLUSIVITY_OVERRIDE_BPS=Y5,R.FEES=q5,R.IWETH_ABI=Om,R.InputErrors=Mt,R.LEGACY_EXCHANGES_MAP=qm,R.MAX_ORDER_DURATION_MILLIS=Ca,R.MIN_CHUNKS=V5,R.MIN_FILL_DELAY_MILLIS=Pc,R.MIN_FILL_DELAY_MINUTES=$m,R.MIN_ORDER_DURATION_MILLIS=ad,R.Module=Ee,R.ORBS_LOGO=Z5,R.ORBS_LOGO_FALLBACK=X5,R.ORBS_SLTP_FAQ_URL=K5,R.ORBS_TWAP_FAQ_URL=od,R.ORBS_WEBSITE_URL=Q5,R.OrderStatus=ut,R.OrderType=dt,R.PRICE_PROTECTION_SETTINGS=XL,R.Partners=Mm,R.QUERY_PARAMS=Bc,R.REPERMIT_ABI=Dm,R.REPERMIT_PRIMARY_TYPE=Ym,R.SUGGEST_CHUNK_VALUE=j5,R.SpotProvider=YL,R.Steps=Ds,R.SwapStatus=kt,R.THE_GRAPH_ORDERS_API=jm,R.TWAP_ABI=_m,R.TimeUnit=Gt,R.amountBN=Ac,R.amountUi=Xr,R.analytics=ct,R.buildRePermitOrderData=wh,R.copy=D3,R.ensureWrappedToken=u1,R.eqIgnoreCase=Ps,R.fillDelayText=i1,R.formatDecimals=Do,R.getAccountOrders=Ih,R.getApiEndpoint=sd,R.getChunks=oh,R.getConfig=ld,R.getDeadline=ch,R.getDestTokenAmount=rh,R.getDestTokenMinAmountPerChunk=nh,R.getDuration=ah,R.getEstimatedDelayBetweenChunksMillis=cd,R.getExplorerUrl=_o,R.getMaxChunksError=gh,R.getMaxFillDelayError=ow,R.getMaxOrderDurationError=mh,R.getMaxPossibleChunks=ih,R.getMinFillDelayError=bh,R.getMinNativeBalance=M3,R.getMinOrderDurationError=hh,R.getMinTradeSizeError=yh,R.getMinimumDelayMinutes=aw,R.getNetwork=Bs,R.getOrderExcecutionRate=c1,R.getOrderFillDelayMillis=td,R.getOrderLimitPriceRate=l1,R.getOrderType=N3,R.getPartnerChains=Rm,R.getPartnerIdentifier=_t,R.getPartners=xh,R.getQueryParam=Fo,R.getSrcTokenChunkAmount=lh,R.getStopLossLimitPriceError=ph,R.getStopLossPriceError=uh,R.getTakeProfitLimitPriceError=fh,R.getTakeProfitPriceError=dh,R.getTriggerPricePerChunk=sh,R.isNativeAddress=Is,R.isTxRejected=Sd,R.makeElipsisAddress=Td,R.maxUint256=W5,R.millisToDays=d1,R.millisToMinutes=Ad,R.nativeTokenAddresses=Wm,R.networks=Ft,R.parseError=_3,R.removeCommas=O3,R.setApiMode=G5,R.setUIVersion=Eh,R.shouldUnwrapOnly=Id,R.shouldWrapOnly=Pd,R.submitOrder=Th,R.useBuildRePermitOrderDataCallback=i5,R.useDisclaimerPanel=rW,R.useDstTokenPanel=vW,R.useDurationPanel=tW,R.useFillDelayPanel=ZV,R.useFormatNumber=Ge,R.useInputErrors=o5,R.useInvertTradePanel=Vu,R.useLimitPricePanel=lW,R.useMarketPricePanel=JV,R.useOrderHistoryPanel=WG,R.useSrcTokenPanel=wW,R.useSubmitSwapPanel=xW,R.useSupportedChains=OW,R.useTogglePricePanel=EW,R.useTradesPanel=QV,R.useTranslations=Ue,R.useTriggerPricePanel=oW,R.useTypedSrcAmount=DW,R.zeroAddress=Vm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
126
+ `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function vG(e){e=wG(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=z0);var a=e.onBlur;a===void 0&&(a=z0);var o=e.thousandSeparator,i=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,m=e.onValueChange,y=aG(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=Bu(e),E=g.decimalSeparator,w=g.allowedDecimalSeparators,v=function(P){return V2(P,e)},S=function(P,O){return gG(P,O,e)},C=fo(d)?u:d,D=f??yG(C,l,t);fo(d)?fo(u)||(D=D||typeof u=="number"):D=D||typeof d=="number";var L=function(P){return z2(P)?P:(typeof P=="number"&&(P=G2(P)),D&&typeof i=="number"?j2(P,i,!!c):P)},T=mG(L(d),L(u),!!D,v,S,m),h=T[0],b=h.numAsString,x=h.formattedValue,A=T[1],I=function(P){var O=P.target,U=P.key,z=O.selectionStart,H=O.selectionEnd,G=O.value;if(G===void 0&&(G=""),(U==="Backspace"||U==="Delete")&&H<l.length){P.preventDefault();return}if(z!==H){s(P);return}U==="Backspace"&&G[0]==="-"&&z===l.length+1&&r&&sc(O,1),i&&c&&(U==="Backspace"&&G[z-1]===E?(sc(O,z-1),P.preventDefault()):U==="Delete"&&G[z]===E&&P.preventDefault()),w!=null&&w.includes(U)&&G[z]===E&&sc(O,z+1);var J=o===!0?",":o;U==="Backspace"&&G[z-1]===J&&sc(O,z-1),U==="Delete"&&G[z]===J&&sc(O,z+1),s(P)},F=function(P){var O=b;if(O.match(/\d/g)||(O=""),n||(O=dG(O)),c&&i&&(O=j2(O,i,c)),O!==b){var U=V2(O,e);A({formattedValue:U,value:O,floatValue:parseFloat(O)},{event:P,source:L0.event})}a(P)},_=function(P){return P===E?!0:L2(P)},k=function(P){var O=P.currentValue,U=P.lastValue,z=P.formattedValue,H=P.currentValueIndex,G=P.formattedValueIndex,J=O[H],pe=z[G],he=pG(U,O),ie=he.to,de=function(Be){return S(Be).indexOf(".")+l.length};return d===0&&c&&i&&O[ie.start]===E&&de(O)<H&&de(z)>G?!1:H>=ie.start&&H<ie.end&&w&&w.includes(J)&&pe===E?!0:J===pe};return Object.assign(Object.assign({},y),{value:x,valueIsNumericString:!1,isValidInputCharacter:_,isCharacterSame:k,onValueChange:A,format:v,removeFormatting:S,getCaretBoundary:function(P){return xG(P,e)},onKeyDown:I,onBlur:F})}const Fu=(e,t)=>M.useMemo(()=>Ac(e,t),[e,t]),Vr=(e,t)=>M.useMemo(()=>Xr(e,t),[e,t]),ac=()=>{const{chainId:e}=ne();return M.useMemo(()=>Bs(e),[e])},H0=e=>{const t=ac();return M.useMemo(()=>{if(!(!e||!t))return _o(e,t.id)},[e,t])},aa=(e,t)=>M.useMemo(()=>!e||!t||j(e||"0").isZero()||j(t||"0").isZero()?"":j(e||"0").times(t).toFixed(),[e,t]),EG=()=>{const{srcToken:e,dstToken:t,chainId:r}=ne();return M.useMemo(()=>Pd(e,t,r),[e,t,r])},kG=()=>{const{srcToken:e,dstToken:t,chainId:r}=ne();return M.useMemo(()=>Id(e,t,r),[e,t,r])},CG=()=>{const e=EG(),t=kG();return e||t},$0=e=>{const{overrides:t}=ne();return M.useMemo(()=>t!=null&&t.dateFormat?t.dateFormat(e||0):te(e).format("DD/MM/YYYY HH:mm"),[e,t==null?void 0:t.dateFormat])};function TG(){const{callbacks:e}=ne();return M.useCallback(async t=>{var r;try{await navigator.clipboard.writeText(t),(r=e==null?void 0:e.onCopy)==null||r.call(e)}catch(n){console.error("Copy failed:",n)}},[e==null?void 0:e.onCopy])}const SG=(e,t)=>M.useMemo(()=>Do(e==null?void 0:e.toString(),t),[e,t]),Ge=({value:e,decimalScale:t=3,prefix:r,suffix:n})=>{var c;const s=SG(e,t),{overrides:a}=ne(),o=a==null?void 0:a.numberFormat,i=vG({allowLeadingZeros:!0,thousandSeparator:",",displayType:"text",value:s||"",decimalScale:18,prefix:r,suffix:n});return o?o(e||""):(c=i.value)==null?void 0:c.toString()},AG={expirationTooltip:"This is the date and time marking the end of the period which you have selected for your order to be executed.",tradeSizeTooltip:"The number of input tokens that will be removed from your balance and swapped for the output token in each individual trade.",totalTradesTooltip:"The total number of individual trades that will be scheduled as part of your order. Note that in limit orders, not all trades that are scheduled will be executed.",minDstAmountTooltip:" This is the minimum number of tokens that may be received. NOTE: This minimum only refers to executed trades. Some trades may not be executed if the limit price is higher than the available market prices and your order may only be partially filled.",limitPriceTooltip:"Trades will only execute if the available market price is better than the limit price, potentially resulting in partial fills or orders remaining unfilled upon expiration.",maxDurationTooltip:"This is the time period during which the order will be active. Please note that orders may be completed earlier than this time, partially filled, or remain unfilled based on the specified parameters.",tradeIntervalTootlip:"The estimated time that will elapse between each trade in your order. Note that as this time includes an allowance of two minutes for bidder auction and block settlement, which cannot be predicted exactly, actual time may vary.",triggerPriceTooltip:"The price at which the order will be executed. If the market price is higher than the trigger price, the order will be executed at the market price.",placeOrder:"Place order",enterAmount:"Enter an amount",emptyLimitPrice:"Limit price is required",insufficientFunds:"Insufficient Balance",tradeIntervalLabel:"Trade interval",expirationLabel:"Expiration",limitPrice:"Limit Price",finalExcecutionPrice:"Final execution price",marketPrice:"Market price",from:"From",to:"To (estimated)",Open:"Open",Completed:"Completed",Expired:"Expired",Canceled:"Canceled",minReceivedPerTrade:"Min. received per trade",triggerPricePerChunk:"Trigger Price per trade",maxChunksError:"Max. trades amount is {maxChunks}",minChunksError:"Min. trades amount is",minTradeSizeError:"Min. trade size is ${minTradeSize}",allOrders:"All",minFillDelayError:"Min. trade interval is {fillDelay}",maxFillDelayError:"Max. trade interval is {fillDelay}",recipient:"Recipient",marketOrderWarning:"Each individual trade in this order will be filled at the current market price at the time of execution.",limitPriceMessage:"Limit orders may not execute when the token's price is equal or close to the limit price, due to gas and standard swap fees.",limit:"Limit",maxDurationError:"Max. expiry is {duration}",minDurationError:"Min. expiry is {duration}",expiry:"Expiry",individualTradeSize:"Individual trade size",numberOfTrades:"No. of trades",AverageExecutionPrice:"Avg. execution price",twapMarket:"TWAP-market",twapLimit:"TWAP-limit",stopLoss:"Stop-loss",triggerPriceMarket:"Trigger Market Price ",triggerPriceLimit:"Trigger Limit Price ",takeProfit:"Take-profit",minReceived:"Min. received",noOrders:"No {status} Orders",noLiquidity:"No liquidity for this pair",excecutionSummary:"Execution summary",orderInfo:"Order info",wrapAction:"Wrap {symbol}",approveAction:"Approve {symbol}",createOrderAction:"Create {name} order",amountReceived:"Amount received",createdAt:"Created at",amountOut:"Amount out",status:"Status",progress:"Progress",minutes:"minutes",days:"days",tradeIntervalTitle:"Every",tradesAmountTitle:"Over",stopLossTooltip:"The trigger price at which your stop-loss order will be activated.",takeProfitTooltip:"The trigger price at which your take-profit order will be activated.",stopLossLabel:"Trigger Price",StopLossTriggerPriceError:"Trigger price must be less than market price",TakeProfitTriggerPriceError:"Trigger price must be greater than market price",triggerLimitPriceError:"Limit price must be less than trigger price",triggerPrice:"Trigger Price",tradePrice:"Trade Price",triggerMarketPriceDisclaimer:" In extreme market movements, slippage may occur and the executed price of the market order may be worse than the specified trigger price.",stopLossLimitPriceTooltip:"The stop loss order will execute at the specified limit price or better, once the stop price is triggered.",stopLossDurationTooltip:"This is the time period during which the order will be active. Please note that orders may be completed earlier than this time, or remain unfilled based on the specified parameters.",emptyTriggerPrice:"Trigger price is required",id:"ID",fees:"Fees {value}",version:"Version",maxOrderSizeError:"Max. trade size is {maxOrderSize} USD",viewOnExplorer:"View on explorer",proceedInWallet:"Proceed in wallet",wrapMsg:"Note: {symbol} was wrapped to {wSymbol}",createOrderActionSuccess:"{name} order placed"};function PG(e){let t=e;const r=/\{[^{}]*\}/g;for(;r.test(t);)t=t.replace(r,"");return t}const Ue=()=>{const e=ne();return M.useCallback((r,n)=>{var o,i;const s=(o=e.getTranslation)==null?void 0:o.call(e,r,n);if(s&&s!==r)return s;const a=((i=e.translations)==null?void 0:i[r])||AG[r];return PG(a.replace(/{(\w+)}/g,(c,l)=>(n==null?void 0:n[l])||c))},[e.getTranslation,e.translations])},Uu=({value:e})=>{const t=Ge({value:e,decimalScale:2});return t?B.jsx("small",{className:"twap-order-details__detail-row-value-usd",children:` ($${t})`}):null},IG=({deadline:e,label:t,tooltip:r})=>{const n=$0(e);return B.jsx(hr,{title:t,tooltip:r,children:n})},BG=({price:e,dstToken:t,label:r,tooltip:n,usd:s})=>{const a=Ge({value:e});return j(e||0).isZero()?null:B.jsx(hr,{title:r,tooltip:n,children:B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[`${a||"-"} ${t==null?void 0:t.symbol}`,B.jsx(Uu,{value:s})]})})},FG=({price:e,dstToken:t,percentage:r,isMarketOrder:n})=>{const s=Ge({value:e}),a=Ue();return n?null:B.jsx(hr,{title:a("limitPrice")||"",tooltip:a("limitPriceTooltip")||"",children:B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[`${s||"-"} ${t==null?void 0:t.symbol}`,r&&B.jsx("small",{children:`(${r}%)`})]})})},UG=({tradeSize:e,srcToken:t,trades:r,label:n,tooltip:s})=>r===1?null:B.jsx(hr,{title:n,tooltip:s,children:`${e||"-"} ${(t==null?void 0:t.symbol)||""}`}),OG=({dstToken:e,dstMinAmountOut:t,label:r,tooltip:n,usd:s})=>{const a=Ge({value:t});return j(t||0).isZero()?null:B.jsxs(hr,{title:r,tooltip:n,children:[`${t?a:"-"} ${e==null?void 0:e.symbol}`,B.jsx(Uu,{value:s})]})},DG=({trades:e,label:t,tooltip:r})=>e===1?null:B.jsx(hr,{title:t,tooltip:r,children:e}),_G=()=>{var s;const e=Ue(),{account:t}=ne(),r=(s=ac())==null?void 0:s.explorer,n=Td(t);return B.jsx(hr,{title:e("recipient")||"",children:r?B.jsx("a",{href:`${r}/address/${t}`,target:"_blank",children:n}):n})},MG=({fillDelayMillis:e,chunks:t=0,label:r,tooltip:n})=>{const s=M.useMemo(()=>i1(e),[e]);return t===1?null:B.jsx(hr,{title:r,tooltip:n,children:s})},hr=({title:e,tooltip:t,children:r,className:n="",onClick:s,style:a})=>{const{components:o}=ne(),i=o.Tooltip;return B.jsxs("div",{className:`${n} twap-order-details__detail-row`,onClick:s,style:a,children:[B.jsxs("div",{className:"twap-order-details__detail-row-label",children:[B.jsx("p",{className:"twap-order-details__detail-row-label-value",children:e}),t&&i&&B.jsx(i,{tooltipText:t})]}),B.jsx("div",{className:"twap-order-details__detail-row-value",children:r})]})},NG=({id:e})=>{const{components:t}=ne(),r=t==null?void 0:t.Tooltip,n=TG();return e.startsWith("0x")?B.jsx(hr,{title:"ID",onClick:()=>n(e),style:{cursor:"pointer"},children:r&&B.jsx(r,{tooltipText:e,children:B.jsxs("div",{className:"twap-order-details__detail-row-value-id",children:[B.jsx("p",{children:Td(e)}),B.jsx(sz.AiOutlineCopy,{})]})})}):B.jsx(hr,{title:"ID",children:e})},LG=({version:e})=>B.jsx(hr,{title:"Version",children:e});function xe({children:e,className:t=""}){return B.jsx("div",{className:`${t} twap-order-details`,children:e})}const zG=({children:e})=>e,RG=({fees:e,label:t,usd:r,dstTokenSymbol:n})=>{const s=Ge({value:e});return B.jsxs(hr,{title:t,children:[`${e?s:"-"} ${n}`,B.jsx(Uu,{value:r})]})};xe.Deadline=IG,xe.Fees=RG,xe.TradeSize=UG,xe.MinDestAmount=OG,xe.TradesAmount=DG,xe.Recipient=_G,xe.TradeInterval=MG,xe.DetailRow=hr,xe.TriggerPrice=BG,xe.LimitPrice=FG,xe.OrderID=NG,xe.Container=zG,xe.OrderVersion=LG,xe.USD=Uu;const G0=()=>{const{publicClient:e}=ne();return xn({mutationFn:async t=>{if(!e)throw new Error("publicClient is not defined");const r=10;let n=0,s=1e3;for(;n<r;)try{return await e.waitForTransactionReceipt({hash:t,confirmations:2,retryDelay:s})}catch(a){if(n++,n>=r)throw new Error(`Failed after ${r} attempts: ${a}`);await new Promise(o=>setTimeout(o,s)),s*=2}}}).mutateAsync},j0=()=>{const{account:e,walletClient:t,publicClient:r,config:n,callbacks:s,chainId:a}=ne(),o=G0(),i=Z(u=>u.updateState),c=async u=>{ct.onCancelOrderRequest(u.map(d=>d.id.toString()),1);try{return(await Promise.all(u.map(f=>t.writeContract({account:e,address:f.twapAddress,abi:_m,functionName:"cancel",args:[f.id],chain:t.chain}))))[0]}catch(d){throw ct.onCancelOrderError(d),d}},l=async u=>{var d;try{ct.onCancelOrderRequest(u.map(y=>y.hash),2);const f=await t.writeContract({account:e,address:n.repermit,abi:Dm,functionName:"cancel",args:[u.map(y=>y.hash)],chain:t.chain}),m=await o(f);if(!m)throw new Error("failed to get transaction receipt");if(m.status==="reverted")throw new Error("failed to cancel order");return ct.onCancelOrderSuccess(f),(d=s==null?void 0:s.onCancelOrderSuccess)==null||d.call(s,{orders:u,txHash:f,explorerUrl:_o(f,a)}),m.transactionHash}catch(f){throw ct.onCancelOrderError(f),f}};return xn({mutationFn:async({orders:u})=>{var d,f;if(!e||!t||!r||!n)throw new Error("missing required parameters");try{(d=s==null?void 0:s.onCancelOrderRequest)==null||d.call(s,u),i({cancelOrderStatus:kt.LOADING,cancelOrderTxHash:void 0,cancelOrderError:void 0});const m=u.filter(w=>w.version===1),y=u.filter(w=>w.version===2),[g,E]=await Promise.all([m.length?c(m):Promise.resolve(""),y.length?l(y):Promise.resolve("")]);return i({cancelOrderStatus:kt.SUCCESS,orderIdsToCancel:[]}),[...g||[],E]}catch(m){console.error("cancel order error",m),(f=s==null?void 0:s.onCancelOrderFailed)==null||f.call(s,m),Sd(m)?i({cancelOrderStatus:void 0}):(i({cancelOrderStatus:kt.FAILED}),ct.onCancelOrderError(m))}}})},W2=e=>{const t=Ue();return M.useMemo(()=>e?e.type===dt.TRIGGER_PRICE_MARKET?t("triggerPriceMarket"):e.type===dt.TRIGGER_PRICE_LIMIT?t("triggerPriceLimit"):e.type===dt.TWAP_MARKET?t("twapMarket"):e.type===dt.TWAP_LIMIT?t("twapLimit"):t("twapMarket"):t("twapMarket"),[t,e==null?void 0:e.type])},V0=()=>{const{account:e,config:t,chainId:r}=ne();return M.useMemo(()=>["useTwapOrderHistoryManager",e,t==null?void 0:t.partner,r],[e,t,r])},HG=()=>{const e=_c(),{account:t}=ne(),r=V0();return M.useCallback(n=>{e.setQueryData(r,s=>s?s!=null&&s.some(a=>a.id===n.id)?s:[n,...s]:[n])},[e,r,t])},$G=()=>{const{callbacks:e,refetchBalances:t}=ne(),r=_c(),n=V0();return M.useCallback(s=>{var c;const a=r.getQueryData(n);let o=!1;const i=[];a&&a.forEach(l=>{var d;const u=s.find(f=>f.id===l.id);u&&u.progress!==l.progress&&(o=!0,i.push(u),u.status===ut.Completed&&((d=e==null?void 0:e.onOrderFilled)==null||d.call(e,u)))}),o&&((c=e==null?void 0:e.onOrdersProgressUpdate)==null||c.call(e,i),t==null||t())},[r,n,e,t])},GG=()=>{const{account:e,config:t,chainId:r}=ne(),n=V0(),s=$G();return f3({refetchInterval:KL,refetchOnWindowFocus:!0,retry:!1,staleTime:1/0,queryKey:n,queryFn:async({signal:a})=>{if(!e||!r||!t)return[];const o=await Ih({signal:a,chainId:r,config:t.twapConfig,account:e});return s(o),o.map(i=>t!=null&&t.twapConfig?{...i,fillDelayMillis:td(i,t.twapConfig)}:i)}})},Ou=()=>{const{data:e,isLoading:t,error:r,refetch:n,isRefetching:s}=GG(),{mutateAsync:a}=j0();return M.useMemo(()=>({orders:{all:e??[],open:Du(e??[],ut.Open),completed:Du(e??[],ut.Completed),expired:Du(e??[],ut.Expired),canceled:Du(e??[],ut.Canceled)},isLoading:t,error:r,refetch:()=>n().then(o=>o.data),cancelOrder:a,isRefetching:s}),[e,t,r,n,a,s])},q2=()=>{const e=Z(r=>r.state.orderHistoryStatusFilter),{orders:t}=Ou();return M.useMemo(()=>e?t.all.filter(r=>r.status.toLowerCase()===e.toLowerCase())||[]:t.all,[e,t])},Du=(e,t)=>e.filter(r=>r.status===t).sort((r,n)=>n.createdAt-r.createdAt),jG=(e,t,r)=>M.useMemo(()=>{if(!(!e||!t||!r||r!=null&&r.isMarketPrice))return l1(r,e==null?void 0:e.decimals,t==null?void 0:t.decimals)},[r,e,t]),VG=(e,t,r)=>M.useMemo(()=>{if(!(!e||!t||!r))return c1(r,e.decimals,t.decimals)},[r,e,t]),Y2=()=>{const e=Z(r=>r.updateState),t=Z(r=>r.state.orderIdsToCancel);return M.useCallback(r=>{t!=null&&t.includes(r)?e({orderIdsToCancel:t==null?void 0:t.filter(n=>n!==r)}):e({orderIdsToCancel:[...t||[],r]})},[e,t])},WG=()=>{var T,h;const e=Ue(),{orders:t,isLoading:r,refetch:n,isRefetching:s}=Ou(),{mutateAsync:a,isPending:o}=j0(),i=q2(),c=Z(b=>b.updateState),l=Z(b=>b.state.orderHistoryStatusFilter),u=Z(b=>b.state.cancelOrdersMode),d=Z(b=>b.state.orderIdsToCancel),f=M.useCallback(b=>c({cancelOrdersMode:b,orderIdsToCancel:[]}),[c]),m=M.useCallback(()=>c({selectedOrderID:void 0}),[c]),y=M.useCallback(b=>a({orders:b}),[a]),g=M.useCallback(b=>c({orderHistoryStatusFilter:b}),[]),E=M.useMemo(()=>{const b=Object.keys(ut).map(x=>({text:x,value:x}));return[{text:e("allOrders"),value:""},...b]},[e]),w=Y2(),v=Z(b=>b.state.selectedOrderID),S=Z2(v),C=M.useMemo(()=>t.all.filter(b=>d==null?void 0:d.includes(b.id)),[t,d]),D=M.useCallback(()=>c({orderIdsToCancel:t.open.map(b=>b.id)}),[c,t]),L=M.useCallback(b=>a({orders:[b]}).then(x=>(x==null?void 0:x[0])||""),[a]);return{refetch:n,onHideSelectedOrder:m,onCancelOrders:y,onCancelOrder:L,onSelectStatus:g,onToggleCancelOrdersMode:f,onSelectOrder:w,isRefetching:s,orders:t,ordersToDisplay:i,isLoading:r,selectedOrder:v?S:void 0,openOrdersCount:((T=t==null?void 0:t.open)==null?void 0:T.length)||0,isCancelOrdersLoading:o,selectedStatus:l||((h=E[0])==null?void 0:h.value)||"",statuses:E,cancelOrdersMode:u,ordersToCancel:C,onSelectAllOrdersToCancel:D}},K2=e=>{var c,l,u,d,f;const t=Ue(),r=Ge({value:Vr((c=e.srcToken)==null?void 0:c.decimals,e.srcAmount)}),n=Ge({value:Vr((l=e.srcToken)==null?void 0:l.decimals,e.srcAmountPerTrade)}),s=Ge({value:Vr((u=e.dstToken)==null?void 0:u.decimals,e.minDestAmountPerTrade&&j(e.minDestAmountPerTrade).lte(1)?"":e.minDestAmountPerTrade)}),a=Ge({value:Vr((d=e.dstToken)==null?void 0:d.decimals,e.triggerPricePerTrade)}),o=Fu((f=e.dstToken)==null?void 0:f.decimals,e.limitPrice),i=Ge({value:e.limitPrice});return M.useMemo(()=>({data:{srcToken:e.srcToken,dstToken:e.dstToken,limitPrice:o,deadline:e.deadline,srcAmount:e.srcAmount,srcAmountPerTrade:e.srcAmountPerTrade,totalTrades:e.totalTrades,minDestAmountPerTrade:e.minDestAmountPerTrade,tradeInterval:e.tradeInterval,triggerPricePerTrade:e.triggerPricePerTrade,maker:e.maker},display:{limitPrice:{label:t("limitPrice"),value:i||""},deadline:{tooltip:t("expirationTooltip"),label:t("expirationLabel"),value:e.deadline||0},srcAmount:{label:t("amountOut"),value:r||"",token:e.srcToken},tradeSize:{tooltip:t("tradeSizeTooltip"),label:t("individualTradeSize"),value:n||"",token:e.srcToken},totalTrades:{tooltip:t("totalTradesTooltip"),label:t("numberOfTrades"),value:e.totalTrades||0},minDestAmountPerTrade:{tooltip:t("minDstAmountTooltip"),label:e.totalTrades&&e.totalTrades>1?t("minReceivedPerTrade"):t("minReceived"),value:s||"",token:e.dstToken},tradeInterval:{tooltip:t("tradeIntervalTootlip"),label:t("tradeIntervalLabel"),value:e.tradeInterval||0},triggerPricePerTrade:{tooltip:t("triggerPriceTooltip"),label:e.totalTrades&&e.totalTrades>1?t("triggerPricePerChunk"):t("triggerPrice"),value:a||"",token:e.dstToken},recipient:{label:t("recipient"),value:e.maker||""}}}),[e,t,r,n,s,a,i])},Z2=e=>{const{orders:t}=Ou(),{config:r,useToken:n}=ne(),s=Ue(),a=M.useMemo(()=>t==null?void 0:t.all.find(g=>g.id===e),[t,e])||{},o=W2(a),i=n==null?void 0:n(a==null?void 0:a.srcTokenAddress),c=n==null?void 0:n(a==null?void 0:a.dstTokenAddress),l=jG(i,c,a),u=Ge({value:VG(i,c,a)}),d=Ge({value:Vr(i==null?void 0:i.decimals,a==null?void 0:a.srcAmountFilled)}),f=Ge({value:Vr(c==null?void 0:c.decimals,a==null?void 0:a.dstAmountFilled)}),m=Ge({value:a==null?void 0:a.progress,decimalScale:2}),y=K2({srcToken:i,dstToken:c,limitPrice:l,deadline:a==null?void 0:a.deadline,srcAmount:a==null?void 0:a.srcAmount,srcAmountPerTrade:a==null?void 0:a.srcAmountPerTrade,totalTrades:a==null?void 0:a.totalTradesAmount,minDestAmountPerTrade:a==null?void 0:a.dstMinAmountPerTrade,tradeInterval:(a==null?void 0:a.totalTradesAmount)===1||!a||!(r!=null&&r.twapConfig)?void 0:td(a,r.twapConfig),triggerPricePerTrade:a==null?void 0:a.triggerPricePerTrade,maker:a==null?void 0:a.maker});return M.useMemo(()=>({original:a,...y,title:o,createdAt:{label:s("createdAt"),value:a==null?void 0:a.createdAt},id:{label:s("id"),value:a==null?void 0:a.id},amountInFilled:{label:s("amountOut"),value:d,token:i},amountOutFilled:{label:s("amountReceived"),value:f,token:c},progress:{label:s("progress"),value:m},excecutionPrice:{label:(a==null?void 0:a.totalTradesAmount)===1?s("finalExcecutionPrice"):s("AverageExecutionPrice"),value:u,sellToken:i,buyToken:c},version:{label:s("version"),value:a==null?void 0:a.version}}),[a,s,u,d,f,m,o,i,c,y])},X2=M.createContext({}),Rt=()=>M.useContext(X2),qG=()=>{const e=Z(c=>c.state.selectedOrderID),t=Z2(e),r=Ue(),[n,s]=M.useState("panel1"),{components:a}=ne(),o=a.TokenLogo;M.useEffect(()=>{s("panel1")},[t.id.value]);const i=c=>{s(n===c?!1:c)};return t?B.jsx(X2.Provider,{value:{order:t},children:B.jsxs("div",{className:"twap-orders__selected-order",children:[B.jsx(o1,{SrcTokenLogo:o&&B.jsx(o,{token:t.data.srcToken}),DstTokenLogo:o&&B.jsx(o,{token:t.data.dstToken}),fromTitle:r("from"),inToken:t.data.srcToken,toTitle:r("to"),outToken:t.data.dstToken}),B.jsx(xe.Container,{children:B.jsxs("div",{className:"twap-orders__selected-order-bottom",children:[B.jsxs("div",{className:"twap-orders__selected-order-accordions",children:[B.jsx(Q2,{title:r("excecutionSummary"),onClick:()=>i("panel1"),expanded:n==="panel1",children:B.jsx(rj,{})}),B.jsx(Q2,{title:r("orderInfo"),expanded:n==="panel2",onClick:()=>i("panel2"),children:B.jsx(YG,{})})]}),B.jsx(sj,{})]})})]})}):null},Q2=({expanded:e,onClick:t,children:r,title:n})=>B.jsxs("div",{className:"twap-orders__selected-order-accordion",children:[B.jsxs("div",{onClick:t,className:"twap-orders__selected-order-accordion-trigger",children:[B.jsx("p",{children:n}),B.jsx(rz.IoIosArrowDown,{style:{transform:e?"rotate(180deg)":"rotate(0deg)"}})]}),e&&B.jsx("div",{className:"twap-orders__selected-order-accordion-details",children:r})]}),YG=()=>B.jsxs(xe,{children:[B.jsx(tj,{}),B.jsx(aj,{}),B.jsx(QG,{}),B.jsx(oj,{}),B.jsx(KG,{}),B.jsx(ZG,{}),B.jsx(XG,{}),B.jsx(JG,{}),B.jsx(ej,{}),B.jsx(dj,{}),B.jsx(xe.Recipient,{})]}),KG=()=>{const{order:e}=Rt();return B.jsx(xe.TradeSize,{tradeSize:e.display.tradeSize.value,srcToken:e.data.srcToken,label:e.display.tradeSize.label,tooltip:e.display.tradeSize.tooltip,trades:e.display.totalTrades.value})},ZG=()=>{const{order:e}=Rt();return B.jsx(xe.TradesAmount,{trades:e.display.totalTrades.value,label:e.display.totalTrades.label,tooltip:e.display.totalTrades.tooltip})},XG=()=>{const{order:e}=Rt();return B.jsx(xe.MinDestAmount,{dstToken:e.data.dstToken,dstMinAmountOut:e.display.minDestAmountPerTrade.value,label:e.display.minDestAmountPerTrade.label,tooltip:e.display.minDestAmountPerTrade.tooltip})},QG=()=>{const{order:e}=Rt();return B.jsx(xe.Deadline,{deadline:e.display.deadline.value,label:e.display.deadline.label,tooltip:e.display.deadline.tooltip})},JG=()=>{const{order:e}=Rt();return B.jsx(xe.TradeInterval,{fillDelayMillis:e.display.tradeInterval.value,chunks:e.display.totalTrades.value,label:e.display.tradeInterval.label,tooltip:e.display.tradeInterval.tooltip})},ej=()=>{const{order:e}=Rt();return B.jsx(xe.TriggerPrice,{dstToken:e.data.dstToken,price:e.display.triggerPricePerTrade.value,label:e.display.triggerPricePerTrade.label,tooltip:e.display.triggerPricePerTrade.tooltip})},tj=()=>{const{order:e}=Rt();return B.jsx(xe.OrderID,{id:e.id.value||""})},rj=()=>B.jsxs(xe,{children:[B.jsx(lj,{}),B.jsx(ij,{}),B.jsx(nj,{}),B.jsx(uj,{}),B.jsx(pj,{})]}),nj=()=>{var r;const{order:e}=Rt(),t=Ge({value:e.amountOutFilled.value,decimalScale:3});return e.amountOutFilled.value?B.jsx(xe.DetailRow,{title:e.amountOutFilled.label,children:B.jsxs("p",{children:[t||"-"," ",(r=e.data.dstToken)==null?void 0:r.symbol]})}):null},sj=()=>{const{order:e}=Rt(),{mutateAsync:t,isPending:r}=j0(),{components:n}=ne(),s=n.Button,a=M.useCallback(async()=>t({orders:[e.original]}),[t,e]);return!e||e.original.status!==ut.Open||!s?null:B.jsx(s,{loading:r,onClick:a,disabled:r,className:"twap-cancel-order",children:"Cancel"})},aj=()=>{const{order:e}=Rt(),t=Ue(),r=$0(e.createdAt.value);return B.jsx(xe.DetailRow,{title:t("createdAt")||"",children:B.jsx("p",{children:r})})},oj=()=>{var n;const{order:e}=Rt(),t=Ue(),r=Ge({value:e.display.srcAmount.value,decimalScale:3});return B.jsx(xe.DetailRow,{title:t("amountOut")||"",children:B.jsxs("p",{children:[r||0," ",(n=e.data.srcToken)==null?void 0:n.symbol]})})},ij=()=>{var r;const{order:e}=Rt(),t=Ge({value:e.amountInFilled.value,decimalScale:3});return B.jsx(xe.DetailRow,{title:e.amountInFilled.label,children:B.jsxs("p",{children:[t||"-"," ",(r=e.data.srcToken)==null?void 0:r.symbol]})})},cj=()=>{const{order:e}=Rt(),t=Ue();return M.useMemo(()=>{switch(e.original.status){case ut.Open:return t("Open")||"";case ut.Completed:return t("Completed")||"";case ut.Expired:return t("Expired")||"";case ut.Canceled:return t("Canceled")||""}},[e.original.status,t])},lj=()=>{const e=Ue(),t=cj();return B.jsx(xe.DetailRow,{title:e("status")||"",children:B.jsx("p",{children:t})})},uj=()=>{const{order:e}=Rt(),t=Ge({value:e.progress.value,decimalScale:2});return B.jsx(xe.DetailRow,{title:e.progress.label,children:B.jsxs("p",{children:[t||0,"%"]})})},dj=()=>{const{order:e}=Rt(),t=Ue();return e.display.limitPrice.value?B.jsx(J2,{title:t("limitPrice")||"",price:e.display.limitPrice.value,srcToken:e.data.srcToken,dstToken:e.data.dstToken}):null},pj=()=>{const{order:e}=Rt();return e.excecutionPrice.value?B.jsx(J2,{title:e.excecutionPrice.label,price:e.excecutionPrice.value,srcToken:e.data.srcToken,dstToken:e.data.dstToken}):null},J2=({price:e,srcToken:t,dstToken:r,title:n})=>{const s=Ge({value:e,decimalScale:3});return B.jsx(xe.DetailRow,{title:n,children:j(e||0).isZero()?B.jsx("p",{children:"-"}):B.jsxs("p",{children:["1 ",t==null?void 0:t.symbol," = ",s," ",r==null?void 0:r.symbol]})})};var W0={},ex;function fj(){if(ex)return W0;ex=1;var e=cu.GenIcon;return W0.HiArrowRight=function(r){return e({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"}}]})(r)},W0}var mj=fj();const _u=0,ms=1,mo=2,tx=4;function rx(e){return()=>e}function hj(e){e()}function nx(e,t){return r=>e(t(r))}function sx(e,t){return()=>e(t)}function bj(e,t){return r=>e(t,r)}function q0(e){return e!==void 0}function yj(...e){return()=>{e.map(hj)}}function ho(){}function Mu(e,t){return t(e),e}function gj(e,t){return t(e)}function et(...e){return e}function je(e,t){return e(ms,t)}function Ce(e,t){e(_u,t)}function Y0(e){e(mo)}function st(e){return e(tx)}function ce(e,t){return je(e,bj(t,_u))}function Wr(e,t){const r=e(ms,n=>{r(),t(n)});return r}function ax(e){let t,r;return n=>s=>{t=s,r&&clearTimeout(r),r=setTimeout(()=>{n(t)},e)}}function ox(e,t){return e===t}function tt(e=ox){let t;return r=>n=>{e(t,n)||(t=n,r(n))}}function fe(e){return t=>r=>{e(r)&&t(r)}}function re(e){return t=>nx(t,e)}function ln(e){return t=>()=>{t(e)}}function W(e,...t){const r=xj(...t);return(n,s)=>{switch(n){case mo:Y0(e);return;case ms:return je(e,r(s))}}}function un(e,t){return r=>n=>{r(t=e(t,n))}}function oa(e){return t=>r=>{e>0?e--:t(r)}}function $n(e){let t=null,r;return n=>s=>{t=s,!r&&(r=setTimeout(()=>{r=void 0,n(t)},e))}}function Te(...e){const t=new Array(e.length);let r=0,n=null;const s=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const i=Math.pow(2,o);je(a,c=>{const l=r;r=r|i,t[o]=c,l!==s&&r===s&&n&&(n(),n=null)})}),a=>o=>{const i=()=>{a([o].concat(t))};r===s?i():n=i}}function xj(...e){return t=>e.reduceRight(gj,t)}function wj(e){let t,r;const n=()=>t==null?void 0:t();return function(s,a){switch(s){case ms:return a?r===a?void 0:(n(),r=a,t=je(e,a),t):(n(),ho);case mo:n(),r=null;return}}}function K(e){let t=e;const r=Oe();return(n,s)=>{switch(n){case _u:t=s;break;case ms:{s(t);break}case tx:return t}return r(n,s)}}function Ht(e,t){return Mu(K(t),r=>ce(e,r))}function Oe(){const e=[];return(t,r)=>{switch(t){case _u:e.slice().forEach(n=>{n(r)});return;case mo:e.splice(0,e.length);return;case ms:return e.push(r),()=>{const n=e.indexOf(r);n>-1&&e.splice(n,1)}}}}function br(e){return Mu(Oe(),t=>ce(e,t))}function He(e,t=[],{singleton:r}={singleton:!0}){return{constructor:e,dependencies:t,id:vj(),singleton:r}}const vj=()=>Symbol();function Ej(e){const t=new Map,r=({constructor:n,dependencies:s,id:a,singleton:o})=>{if(o&&t.has(a))return t.get(a);const i=n(s.map(c=>r(c)));return o&&t.set(a,i),i};return r(e)}function vt(...e){const t=Oe(),r=new Array(e.length);let n=0;const s=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const i=Math.pow(2,o);je(a,c=>{r[o]=c,n=n|i,n===s&&Ce(t,r)})}),function(a,o){switch(a){case mo:{Y0(t);return}case ms:return n===s&&o(r),je(t,o)}}}function me(e,t=ox){return W(e,tt(t))}function K0(...e){return function(t,r){switch(t){case mo:return;case ms:return yj(...e.map(n=>je(n,r)))}}}var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const kj={0:"debug",3:"error",1:"log",2:"warn"},Cj=()=>typeof globalThis>"u"?window:globalThis,hs=He(()=>{const e=K(3);return{log:K((t,r,n=1)=>{var s;const a=(s=Cj().VIRTUOSO_LOG_LEVEL)!=null?s:st(e);n>=a&&console[kj[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,r)}),logLevel:e}},[],{singleton:!0});function ia(e,t,r){return Z0(e,t,r).callbackRef}function Z0(e,t,r){const n=M.useRef(null);let s=o=>{};const a=M.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const i=()=>{const c=o[0].target;c.offsetParent!==null&&e(c)};r?i():requestAnimationFrame(i)}):null,[e,r]);return s=o=>{o&&t?(a==null||a.observe(o),n.current=o):(n.current&&(a==null||a.unobserve(n.current)),n.current=null)},{callbackRef:s,ref:n}}function Tj(e,t,r,n,s,a,o,i,c){const l=M.useCallback(u=>{const d=Sj(u.children,t,i?"offsetWidth":"offsetHeight",s);let f=u.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const m=f.lastElementChild.dataset.viewportType==="window";let y;m&&(y=f.ownerDocument.defaultView);const g=o?i?o.scrollLeft:o.scrollTop:m?i?y.scrollX||y.document.documentElement.scrollLeft:y.scrollY||y.document.documentElement.scrollTop:i?f.scrollLeft:f.scrollTop,E=o?i?o.scrollWidth:o.scrollHeight:m?i?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight:i?f.scrollWidth:f.scrollHeight,w=o?i?o.offsetWidth:o.offsetHeight:m?i?y.innerWidth:y.innerHeight:i?f.offsetWidth:f.offsetHeight;n({scrollHeight:E,scrollTop:Math.max(g,0),viewportHeight:w}),a==null||a(i?ix("column-gap",getComputedStyle(u).columnGap,s):ix("row-gap",getComputedStyle(u).rowGap,s)),d!==null&&e(d)},[e,t,s,a,o,n,i]);return Z0(l,r,c)}function Sj(e,t,r,n){const s=e.length;if(s===0)return null;const a=[];for(let o=0;o<s;o++){const i=e.item(o);if(i.dataset.index===void 0)continue;const c=parseInt(i.dataset.index),l=parseFloat(i.dataset.knownSize),u=t(i,r);if(u===0&&n("Zero-sized element, this should not happen",{child:i},nr.ERROR),u===l)continue;const d=a[a.length-1];a.length===0||d.size!==u||d.endIndex!==c-1?a.push({endIndex:c,size:u,startIndex:c}):a[a.length-1].endIndex++}return a}function ix(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function cx(e,t,r){const n=M.useRef(null),s=M.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const l=c.getBoundingClientRect(),u=l.width;let d,f;if(t){const m=t.getBoundingClientRect(),y=l.top-m.top;f=m.height-Math.max(0,y),d=y+t.scrollTop}else{const m=o.current.ownerDocument.defaultView;f=m.innerHeight-Math.max(0,l.top),d=l.top+m.scrollY}n.current={offsetTop:d,visibleHeight:f,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:a,ref:o}=Z0(s,!0,r),i=M.useCallback(()=>{s(o.current)},[s,o]);return M.useEffect(()=>{var c;if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(()=>{requestAnimationFrame(i)});return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else{const l=(c=o.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",i),l==null||l.addEventListener("resize",i),()=>{l==null||l.removeEventListener("scroll",i),l==null||l.removeEventListener("resize",i)}}},[i,t,o]),a}const Wt=He(()=>{const e=Oe(),t=Oe(),r=K(0),n=Oe(),s=K(0),a=Oe(),o=Oe(),i=K(0),c=K(0),l=K(0),u=K(0),d=Oe(),f=Oe(),m=K(!1),y=K(!1),g=K(!1);return ce(W(e,re(({scrollTop:E})=>E)),t),ce(W(e,re(({scrollHeight:E})=>E)),o),ce(t,s),{deviation:r,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:i,horizontalDirection:y,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:m,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:n,statefulScrollTop:s,viewportHeight:a}},[],{singleton:!0}),oc={lvl:0};function lx(e,t){const r=e.length;if(r===0)return[];let{index:n,value:s}=t(e[0]);const a=[];for(let o=1;o<r;o++){const{index:i,value:c}=t(e[o]);a.push({end:i-1,start:n,value:s}),n=i,s=c}return a.push({end:1/0,start:n,value:s}),a}function qe(e){return e===oc}function ic(e,t){if(!qe(e))return t===e.k?e.v:t<e.k?ic(e.l,t):ic(e.r,t)}function qr(e,t,r="k"){if(qe(e))return[-1/0,void 0];if(Number(e[r])===t)return[e.k,e.v];if(Number(e[r])<t){const n=qr(e.r,t,r);return n[0]===-1/0?[e.k,e.v]:n}return qr(e.l,t,r)}function yr(e,t,r){return qe(e)?px(t,r,1):t===e.k?St(e,{k:t,v:r}):t<e.k?fx(St(e,{l:yr(e.l,t,r)})):fx(St(e,{r:yr(e.r,t,r)}))}function bo(){return oc}function yo(e,t,r){if(qe(e))return[];const n=qr(e,t)[0];return Aj(Q0(e,n,r))}function X0(e,t){if(qe(e))return oc;const{k:r,l:n,r:s}=e;if(t===r){if(qe(n))return s;if(qe(s))return n;{const[a,o]=dx(n);return Nu(St(e,{k:a,l:ux(n),v:o}))}}else return t<r?Nu(St(e,{l:X0(n,t)})):Nu(St(e,{r:X0(s,t)}))}function ca(e){return qe(e)?[]:[...ca(e.l),{k:e.k,v:e.v},...ca(e.r)]}function Q0(e,t,r){if(qe(e))return[];const{k:n,l:s,r:a,v:o}=e;let i=[];return n>t&&(i=i.concat(Q0(s,t,r))),n>=t&&n<=r&&i.push({k:n,v:o}),n<=r&&(i=i.concat(Q0(a,t,r))),i}function Nu(e){const{l:t,lvl:r,r:n}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(J0(t))return mx(St(e,{lvl:r-1}));if(!qe(t)&&!qe(t.r))return St(t.r,{l:St(t,{r:t.r.l}),lvl:r,r:St(e,{l:t.r.r,lvl:r-1})});throw new Error("Unexpected empty nodes")}else{if(J0(e))return em(St(e,{lvl:r-1}));if(!qe(n)&&!qe(n.l)){const s=n.l,a=J0(s)?n.lvl-1:n.lvl;return St(s,{l:St(e,{lvl:r-1,r:s.l}),lvl:s.lvl+1,r:em(St(n,{l:s.r,lvl:a}))})}else throw new Error("Unexpected empty nodes")}}function St(e,t){return px(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function ux(e){return qe(e.r)?e.l:Nu(St(e,{r:ux(e.r)}))}function J0(e){return qe(e)||e.lvl>e.r.lvl}function dx(e){return qe(e.r)?[e.k,e.v]:dx(e.r)}function px(e,t,r,n=oc,s=oc){return{k:e,l:n,lvl:r,r:s,v:t}}function fx(e){return em(mx(e))}function mx(e){const{l:t}=e;return!qe(t)&&t.lvl===e.lvl?St(t,{r:St(e,{l:t.r})}):e}function em(e){const{lvl:t,r}=e;return!qe(r)&&!qe(r.r)&&r.lvl===t&&r.r.lvl===t?St(r,{l:St(e,{r:r.l}),lvl:t+1}):e}function Aj(e){return lx(e,({k:t,v:r})=>({index:t,value:r}))}function hx(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function cc(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const tm=He(()=>({recalcInProgress:K(!1)}),[],{singleton:!0});function bx(e,t,r){return e[Lu(e,t,r)]}function Lu(e,t,r,n=0){let s=e.length-1;for(;n<=s;){const a=Math.floor((n+s)/2),o=e[a],i=r(o,t);if(i===0)return a;if(i===-1){if(s-n<2)return a-1;s=a-1}else{if(s===n)return a;n=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Pj(e,t,r,n){const s=Lu(e,t,n),a=Lu(e,r,n,s);return e.slice(s,a+1)}function bs(e,t){return Math.round(e.getBoundingClientRect()[t])}function zu(e){return!qe(e.groupOffsetTree)}function rm({index:e},t){return t===e?0:t<e?-1:1}function Ij(){return{groupIndices:[],groupOffsetTree:bo(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:bo()}}function Bj(e,t){let r=qe(e)?0:1/0;for(const n of t){const{endIndex:s,size:a,startIndex:o}=n;if(r=Math.min(r,o),qe(e)){e=yr(e,0,a);continue}const i=yo(e,o-1,s+1);if(i.some(Nj(n)))continue;let c=!1,l=!1;for(const{end:u,start:d,value:f}of i)c?(s>=d||a===f)&&(e=X0(e,d)):(l=f!==a,c=!0),u>s&&s>=d&&f!==a&&(e=yr(e,s+1,f));l&&(e=yr(e,o,a))}return[e,r]}function Fj(e){return typeof e.groupIndex<"u"}function Uj({offset:e},t){return t===e?0:t<e?-1:1}function lc(e,t,r){if(t.length===0)return 0;const{index:n,offset:s,size:a}=bx(t,e,rm),o=e-n,i=a*o+(o-1)*r+s;return i>0?i+r:i}function yx(e,t){if(!zu(t))return e;let r=0;for(;t.groupIndices[r]<=e+r;)r++;return e+r}function gx(e,t,r){if(Fj(e))return t.groupIndices[e.groupIndex]+1;{const n=e.index==="LAST"?r:e.index;let s=yx(n,t);return s=Math.max(0,s,Math.min(r,s)),s}}function Oj(e,t,r,n=0){return n>0&&(t=Math.max(t,bx(e,n,rm).offset)),lx(Pj(e,t,r,Uj),Mj)}function Dj(e,[t,r,n,s]){t.length>0&&n("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,i=0;if(r.length>0&&qe(a)&&t.length===2){const f=t[0].size,m=t[1].size;o=r.reduce((y,g)=>yr(yr(y,g,f),g+1,m),o)}else[o,i]=Bj(o,t);if(o===a)return e;const{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=nm(e.offsetTree,i,o,s);return{groupIndices:r,groupOffsetTree:r.reduce((f,m)=>yr(f,m,lc(m,d,s)),bo()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function _j(e){return ca(e).map(({k:t,v:r},n,s)=>{const a=s[n+1];return{endIndex:a?a.k-1:1/0,size:r,startIndex:t}})}function xx(e,t){let r=0,n=0;for(;r<e;)r+=t[n+1]-t[n]-1,n++;return n-(r===e?0:1)}function nm(e,t,r,n){let s=e,a=0,o=0,i=0,c=0;if(t!==0){c=Lu(s,t-1,rm),i=s[c].offset;const l=qr(r,t-1);a=l[0],o=l[1],s.length&&s[c].size===qr(r,t)[1]&&(c-=1),s=s.slice(0,c+1)}else s=[];for(const{start:l,value:u}of yo(r,t,1/0)){const d=l-a,f=d*o+i+d*n;s.push({index:l,offset:f,size:u}),a=l,i=f,o=u}return{lastIndex:a,lastOffset:i,lastSize:o,offsetTree:s}}function Mj(e){return{index:e.index,value:e}}function Nj(e){const{endIndex:t,size:r,startIndex:n}=e;return s=>s.start===n&&(s.end===t||s.end===1/0)&&s.value===r}const Lj={offsetHeight:"height",offsetWidth:"width"},dn=He(([{log:e},{recalcInProgress:t}])=>{const r=Oe(),n=Oe(),s=Ht(n,0),a=Oe(),o=Oe(),i=K(0),c=K([]),l=K(void 0),u=K(void 0),d=K(void 0),f=K(void 0),m=K((T,h)=>bs(T,Lj[h])),y=K(void 0),g=K(0),E=Ij(),w=Ht(W(r,Te(c,e,g),un(Dj,E),tt()),E),v=Ht(W(c,tt(),un((T,h)=>({current:h,prev:T.current}),{current:[],prev:[]}),re(({prev:T})=>T)),[]);ce(W(c,fe(T=>T.length>0),Te(w,g),re(([T,h,b])=>{const x=T.reduce((A,I,F)=>yr(A,I,lc(I,h.offsetTree,b)||F),bo());return{...h,groupIndices:T,groupOffsetTree:x}})),w),ce(W(n,Te(w),fe(([T,{lastIndex:h}])=>T<h),re(([T,{lastIndex:h,lastSize:b}])=>[{endIndex:h,size:b,startIndex:T}])),r),ce(l,u);const S=Ht(W(l,re(T=>T===void 0)),!0);ce(W(u,fe(T=>T!==void 0&&qe(st(w).sizeTree)),re(T=>{const h=st(d),b=st(c).length>0;return h?b?[{endIndex:0,size:h,startIndex:0},{endIndex:1,size:T,startIndex:1}]:[]:[{endIndex:0,size:T,startIndex:0}]})),r),ce(W(f,fe(T=>T!==void 0&&T.length>0&&qe(st(w).sizeTree)),re(T=>{const h=[];let b=T[0],x=0;for(let A=1;A<T.length;A++){const I=T[A];I!==b&&(h.push({endIndex:A-1,size:b,startIndex:x}),b=I,x=A)}return h.push({endIndex:T.length-1,size:b,startIndex:x}),h})),r),ce(W(c,Te(d,u),fe(([,T,h])=>T!==void 0&&h!==void 0),re(([T,h,b])=>{const x=[];for(let A=0;A<T.length;A++){const I=T[A],F=T[A+1];x.push({startIndex:I,endIndex:I,size:h}),F!==void 0&&x.push({startIndex:I+1,endIndex:F-1,size:b})}return x})),r);const C=br(W(r,Te(w),un(({sizes:T},[h,b])=>({changed:b!==T,sizes:b}),{changed:!1,sizes:E}),re(T=>T.changed)));je(W(i,un((T,h)=>({diff:T.prev-h,prev:h}),{diff:0,prev:0}),re(T=>T.diff)),T=>{const{groupIndices:h}=st(w);if(T>0)Ce(t,!0),Ce(a,T+xx(T,h));else if(T<0){const b=st(v);b.length>0&&(T-=xx(-T,b)),Ce(o,T)}}),je(W(i,Te(e)),([T,h])=>{T<0&&h("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:i},nr.ERROR)});const D=br(a);ce(W(a,Te(w),re(([T,h])=>{const b=h.groupIndices.length>0,x=[],A=h.lastSize;if(b){const I=ic(h.sizeTree,0);let F=0,_=0;for(;F<T;){const P=h.groupIndices[_],O=h.groupIndices.length===_+1?1/0:h.groupIndices[_+1]-P-1;x.push({endIndex:P,size:I,startIndex:P}),x.push({endIndex:P+1+O-1,size:A,startIndex:P+1}),_++,F+=O+1}const k=ca(h.sizeTree);return F!==T&&k.shift(),k.reduce((P,{k:O,v:U})=>{let z=P.ranges;return P.prevSize!==0&&(z=[...P.ranges,{endIndex:O+T-1,size:P.prevSize,startIndex:P.prevIndex}]),{prevIndex:O+T,prevSize:U,ranges:z}},{prevIndex:T,prevSize:0,ranges:x}).ranges}return ca(h.sizeTree).reduce((I,{k:F,v:_})=>({prevIndex:F+T,prevSize:_,ranges:[...I.ranges,{endIndex:F+T-1,size:I.prevSize,startIndex:I.prevIndex}]}),{prevIndex:0,prevSize:A,ranges:[]}).ranges})),r);const L=br(W(o,Te(w,g),re(([T,{offsetTree:h},b])=>{const x=-T;return lc(x,h,b)})));return ce(W(o,Te(w,g),re(([T,h,b])=>{if(h.groupIndices.length>0){if(qe(h.sizeTree))return h;let x=bo();const A=st(v);let I=0,F=0,_=0;for(;I<-T;){_=A[F];const k=A[F+1]-_-1;F++,I+=k+1}if(x=ca(h.sizeTree).reduce((k,{k:P,v:O})=>yr(k,Math.max(0,P+T),O),x),I!==-T){const k=ic(h.sizeTree,_);x=yr(x,0,k);const P=qr(h.sizeTree,-T+1)[1];x=yr(x,1,P)}return{...h,sizeTree:x,...nm(h.offsetTree,0,x,b)}}else{const x=ca(h.sizeTree).reduce((A,{k:I,v:F})=>yr(A,Math.max(0,I+T),F),bo());return{...h,sizeTree:x,...nm(h.offsetTree,0,x,b)}}})),w),{beforeUnshiftWith:D,data:y,defaultItemSize:u,firstItemIndex:i,fixedItemSize:l,fixedGroupSize:d,gap:g,groupIndices:c,heightEstimates:f,itemSize:m,listRefresh:C,shiftWith:o,shiftWithOffset:L,sizeRanges:r,sizes:w,statefulTotalCount:s,totalCount:n,trackItemSizes:S,unshiftWith:a}},et(hs,tm),{singleton:!0});function zj(e){return e.reduce((t,r)=>(t.groupIndices.push(t.totalCount),t.totalCount+=r+1,t),{groupIndices:[],totalCount:0})}const wx=He(([{groupIndices:e,sizes:t,totalCount:r},{headerHeight:n,scrollTop:s}])=>{const a=Oe(),o=Oe(),i=br(W(a,re(zj)));return ce(W(i,re(c=>c.totalCount)),r),ce(W(i,re(c=>c.groupIndices)),e),ce(W(vt(s,t,n),fe(([c,l])=>zu(l)),re(([c,l,u])=>qr(l.groupOffsetTree,Math.max(c-u,0),"v")[0]),tt(),re(c=>[c])),o),{groupCounts:a,topItemsIndexes:o}},et(dn,Wt)),ys=He(([{log:e}])=>{const t=K(!1),r=br(W(t,fe(n=>n),tt()));return je(t,n=>{n&&st(e)("props updated",{},nr.DEBUG)}),{didMount:r,propsReady:t}},et(hs),{singleton:!0}),Rj=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function vx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Rj)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const uc=He(([{gap:e,listRefresh:t,sizes:r,totalCount:n},{fixedFooterHeight:s,fixedHeaderHeight:a,footerHeight:o,headerHeight:i,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const m=Oe(),y=Oe(),g=K(0);let E=null,w=null,v=null;function S(){E&&(E(),E=null),v&&(v(),v=null),w&&(clearTimeout(w),w=null),Ce(c,!1)}return ce(W(m,Te(r,d,n,g,i,o,f),Te(e,a,s),re(([[C,D,L,T,h,b,x,A],I,F,_])=>{const k=vx(C),{align:P,behavior:O,offset:U}=k,z=T-1,H=gx(k,D,z);let G=lc(H,D.offsetTree,I)+b;P==="end"?(G+=F+qr(D.sizeTree,H)[1]-L+_,H===z&&(G+=x)):P==="center"?G+=(F+qr(D.sizeTree,H)[1]-L+_)/2:G-=h,U&&(G+=U);const J=pe=>{S(),pe?(A("retrying to scroll to",{location:C},nr.DEBUG),Ce(m,C)):(Ce(y,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(S(),O==="smooth"){let pe=!1;v=je(t,he=>{pe=pe||he}),E=Wr(u,()=>{J(pe)})}else E=Wr(W(t,Hj(150)),J);return w=setTimeout(()=>{S()},1200),Ce(c,!0),A("scrolling from index to",{behavior:O,index:H,top:G},nr.DEBUG),{behavior:O,top:G}})),l),{scrollTargetReached:y,scrollToIndex:m,topListHeight:g}},et(dn,Wt,hs),{singleton:!0});function Hj(e){return t=>{const r=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(r))}}}function sm(e,t){e==0?t():requestAnimationFrame(()=>{sm(e-1,t)})}function am(e,t){const r=t-1;return typeof e=="number"?e:e.index==="LAST"?r:e.index}const dc=He(([{defaultItemSize:e,listRefresh:t,sizes:r},{scrollTop:n},{scrollTargetReached:s,scrollToIndex:a},{didMount:o}])=>{const i=K(!0),c=K(0),l=K(!0);return ce(W(o,Te(c),fe(([u,d])=>!!d),ln(!1)),i),ce(W(o,Te(c),fe(([u,d])=>!!d),ln(!1)),l),je(W(vt(t,o),Te(i,r,e,l),fe(([[,u],d,{sizeTree:f},m,y])=>u&&(!qe(f)||q0(m))&&!d&&!y),Te(c)),([,u])=>{Wr(s,()=>{Ce(l,!0)}),sm(4,()=>{Wr(n,()=>{Ce(i,!0)}),Ce(a,u)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:i}},et(dn,Wt,uc,ys),{singleton:!0});function Ex(e,t){return Math.abs(e-t)<1.01}const pc="up",fc="down",$j="none",Gj={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},jj=0,mc=He(([{footerHeight:e,headerHeight:t,scrollBy:r,scrollContainerState:n,scrollTop:s,viewportHeight:a}])=>{const o=K(!1),i=K(!0),c=Oe(),l=Oe(),u=K(4),d=K(jj),f=Ht(W(K0(W(me(s),oa(1),ln(!0)),W(me(s),oa(1),ln(!1),ax(100))),tt()),!1),m=Ht(W(K0(W(r,ln(!0)),W(r,ln(!1),ax(200))),tt()),!1);ce(W(vt(me(s),me(d)),re(([v,S])=>v<=S),tt()),i),ce(W(i,$n(50)),l);const y=br(W(vt(n,me(a),me(t),me(e),me(u)),un((v,[{scrollHeight:S,scrollTop:C},D,L,T,h])=>{const b=C+D-S>-h,x={scrollHeight:S,scrollTop:C,viewportHeight:D};if(b){let I,F;return C>v.state.scrollTop?(I="SCROLLED_DOWN",F=v.state.scrollTop-C):(I="SIZE_DECREASED",F=v.state.scrollTop-C||v.scrollTopDelta),{atBottom:!0,atBottomBecause:I,scrollTopDelta:F,state:x}}let A;return x.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":D<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":C<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:x}},Gj),tt((v,S)=>v&&v.atBottom===S.atBottom))),g=Ht(W(n,un((v,{scrollHeight:S,scrollTop:C,viewportHeight:D})=>{if(Ex(v.scrollHeight,S))return{changed:!1,jump:0,scrollHeight:S,scrollTop:C};{const L=S-(C+D)<1;return v.scrollTop!==C&&L?{changed:!0,jump:v.scrollTop-C,scrollHeight:S,scrollTop:C}:{changed:!0,jump:0,scrollHeight:S,scrollTop:C}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),fe(v=>v.changed),re(v=>v.jump)),0);ce(W(y,re(v=>v.atBottom)),o),ce(W(o,$n(50)),c);const E=K(fc);ce(W(n,re(({scrollTop:v})=>v),tt(),un((v,S)=>st(m)?{direction:v.direction,prevScrollTop:S}:{direction:S<v.prevScrollTop?pc:fc,prevScrollTop:S},{direction:fc,prevScrollTop:0}),re(v=>v.direction)),E),ce(W(n,$n(50),ln($j)),E);const w=K(0);return ce(W(f,fe(v=>!v),ln(0)),w),ce(W(s,$n(100),Te(f),fe(([v,S])=>!!S),un(([v,S],[C])=>[S,C],[0,0]),re(([v,S])=>S-v)),w),{atBottomState:y,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:i,isScrolling:f,lastJumpDueToItemResize:g,scrollDirection:E,scrollVelocity:w}},et(Wt)),hc="top",bc="bottom",kx="none";function Cx(e,t,r){return typeof e=="number"?r===pc&&t===hc||r===fc&&t===bc?e:0:r===pc?t===hc?e.main:e.reverse:t===bc?e.main:e.reverse}function Tx(e,t){var r;return typeof e=="number"?e:(r=e[t])!=null?r:0}const om=He(([{deviation:e,fixedHeaderHeight:t,headerHeight:r,scrollTop:n,viewportHeight:s}])=>{const a=Oe(),o=K(0),i=K(0),c=K(0),l=Ht(W(vt(me(n),me(s),me(r),me(a,cc),me(c),me(o),me(t),me(e),me(i)),re(([u,d,f,[m,y],g,E,w,v,S])=>{const C=u-v,D=E+w,L=Math.max(f-C,0);let T=kx;const h=Tx(S,hc),b=Tx(S,bc);return m-=v,m+=f+w,y+=f+w,y-=v,m>u+D-h&&(T=pc),y<u-L+d+b&&(T=fc),T!==kx?[Math.max(C-f-Cx(g,hc,T)-h,0),C-L-w+d+Cx(g,bc,T)+b]:null}),fe(u=>u!=null),tt(cc)),[0,0]);return{increaseViewportBy:i,listBoundary:a,overscan:c,topListHeight:o,visibleRange:l}},et(Wt),{singleton:!0});function Vj(e,t,r){if(zu(t)){const n=yx(e,t);return[{index:qr(t.groupOffsetTree,n)[0],offset:0,size:0},{data:r==null?void 0:r[0],index:n,offset:0,size:0}]}return[{data:r==null?void 0:r[0],index:e,offset:0,size:0}]}const im={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ru(e,t,r,n,s,a){const{lastIndex:o,lastOffset:i,lastSize:c}=s;let l=0,u=0;if(e.length>0){l=e[0].offset;const g=e[e.length-1];u=g.offset+g.size}const d=r-o,f=i+d*c+(d-1)*n,m=l,y=f-u;return{bottom:u,firstItemIndex:a,items:Ax(e,s,a),offsetBottom:y,offsetTop:l,top:m,topItems:Ax(t,s,a),topListHeight:t.reduce((g,E)=>E.size+g,0),totalCount:r}}function Sx(e,t,r,n,s,a){let o=0;if(r.groupIndices.length>0)for(const u of r.groupIndices){if(u-o>=e)break;o++}const i=e+o,c=am(t,i),l=Array.from({length:i}).map((u,d)=>({data:a[d+c],index:d+c,offset:0,size:0}));return Ru(l,[],i,s,r,n)}function Ax(e,t,r){if(e.length===0)return[];if(!zu(t))return e.map(l=>({...l,index:l.index+r,originalIndex:l.index}));const n=e[0].index,s=e[e.length-1].index,a=[],o=yo(t.groupOffsetTree,n,s);let i,c=0;for(const l of e){(!i||i.end<l.index)&&(i=o.shift(),c=t.groupIndices.indexOf(i.start));let u;l.index===i.start?u={index:c,type:"group"}:u={groupIndex:c,index:l.index-(c+1)+r},a.push({...u,data:l.data,offset:l.offset,originalIndex:l.index,size:l.size})}return a}function Px(e,t){var r;return e===void 0?0:typeof e=="number"?e:(r=e[t])!=null?r:0}const la=He(([{data:e,firstItemIndex:t,gap:r,sizes:n,totalCount:s},a,{listBoundary:o,topListHeight:i,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:m},{recalcInProgress:y}])=>{const g=K([]),E=K(0),w=Oe(),v=K(0);ce(a.topItemsIndexes,g);const S=Ht(W(vt(m,y,me(c,cc),me(s),me(n),me(l),u,me(g),me(t),me(r),me(v),e),fe(([T,h,,b,,,,,,,,x])=>{const A=x&&x.length!==b;return T&&!h&&!A}),re(([,,[T,h],b,x,A,I,F,_,k,P,O])=>{var U,z,H,G;const J=x,{offsetTree:pe,sizeTree:he}=J,ie=st(E);if(b===0)return{...im,totalCount:b};if(T===0&&h===0)return ie===0?{...im,totalCount:b}:Sx(ie,A,x,_,k,O||[]);if(qe(he))return ie>0?null:Ru(Vj(am(A,b),J,O),[],b,k,J,_);const de=[];if(F.length>0){const Se=F[0],ve=F[F.length-1];let be=0;for(const Ze of yo(he,Se,ve)){const Ye=Ze.value,Xe=Math.max(Ze.start,Se),Fr=Math.min(Ze.end,ve);for(let Ot=Xe;Ot<=Fr;Ot++)de.push({data:O==null?void 0:O[Ot],index:Ot,offset:be,size:Ye}),be+=Ye}}if(!I)return Ru([],de,b,k,J,_);const Be=F.length>0?F[F.length-1]+1:0,Q=Oj(pe,T,h,Be);if(Q.length===0)return null;const we=b-1,_e=Mu([],Se=>{for(const ve of Q){const be=ve.value;let Ze=be.offset,Ye=ve.start;const Xe=be.size;if(be.offset<T){Ye+=Math.floor((T-be.offset+k)/(Xe+k));const Ot=Ye-ve.start;Ze+=Ot*Xe+Ot*k}Ye<Be&&(Ze+=(Be-Ye)*Xe,Ye=Be);const Fr=Math.min(ve.end,we);for(let Ot=Ye;Ot<=Fr&&!(Ze>=h);Ot++)Se.push({data:O==null?void 0:O[Ot],index:Ot,offset:Ze,size:Xe}),Ze+=Xe+k}}),$e=Px(P,hc),ot=Px(P,bc);if(_e.length>0&&($e>0||ot>0)){const Se=_e[0],ve=_e[_e.length-1];if($e>0&&Se.index>Be){const be=Math.min($e,Se.index-Be),Ze=[];let Ye=Se.offset;for(let Xe=Se.index-1;Xe>=Se.index-be;Xe--){const Fr=(z=(U=yo(he,Xe,Xe)[0])==null?void 0:U.value)!=null?z:Se.size;Ye-=Fr+k,Ze.unshift({data:O==null?void 0:O[Xe],index:Xe,offset:Ye,size:Fr})}_e.unshift(...Ze)}if(ot>0&&ve.index<we){const be=Math.min(ot,we-ve.index);let Ze=ve.offset+ve.size+k;for(let Ye=ve.index+1;Ye<=ve.index+be;Ye++){const Xe=(G=(H=yo(he,Ye,Ye)[0])==null?void 0:H.value)!=null?G:ve.size;_e.push({data:O==null?void 0:O[Ye],index:Ye,offset:Ze,size:Xe}),Ze+=Xe+k}}}return Ru(_e,de,b,k,J,_)}),fe(T=>T!==null),tt()),im);ce(W(e,fe(q0),re(T=>T==null?void 0:T.length)),s),ce(W(S,re(T=>T.topListHeight)),d),ce(d,i),ce(W(S,re(T=>[T.top,T.bottom])),o),ce(W(S,re(T=>T.items)),w);const C=br(W(S,fe(({items:T})=>T.length>0),Te(s,e),fe(([{items:T},h])=>T[T.length-1].originalIndex===h-1),re(([,T,h])=>[T-1,h]),tt(cc),re(([T])=>T))),D=br(W(S,$n(200),fe(({items:T,topItems:h})=>T.length>0&&T[0].originalIndex===h.length),re(({items:T})=>T[0].index),tt())),L=br(W(S,fe(({items:T})=>T.length>0),re(({items:T})=>{let h=0,b=T.length-1;for(;T[h].type==="group"&&h<b;)h++;for(;T[b].type==="group"&&b>h;)b--;return{endIndex:T[b].index,startIndex:T[h].index}}),tt(hx)));return{endReached:C,initialItemCount:E,itemsRendered:w,listState:S,minOverscanItemCount:v,rangeChanged:L,startReached:D,topItemsIndexes:g,...f}},et(dn,wx,om,dc,uc,mc,ys,tm),{singleton:!0}),Ix=He(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:r,headerHeight:n},{listState:s}])=>{const a=Oe(),o=Ht(W(vt(r,e,n,t,s),re(([i,c,l,u,d])=>i+c+l+u+d.offsetBottom+d.bottom)),0);return ce(me(o),a),{totalListHeight:o,totalListHeightChanged:a}},et(Wt,la),{singleton:!0}),Wj=He(([{viewportHeight:e},{totalListHeight:t}])=>{const r=K(!1),n=Ht(W(vt(r,e,t),fe(([s])=>s),re(([,s,a])=>Math.max(0,s-a)),$n(0),tt()),0);return{alignToBottom:r,paddingTopAddition:n}},et(Wt,Ix),{singleton:!0}),Bx=He(()=>({context:K(null)})),qj=({itemBottom:e,itemTop:t,locationParams:{align:r,behavior:n,...s},viewportBottom:a,viewportTop:o})=>t<o?{...s,align:r??"start",behavior:n}:e>a?{...s,align:r??"end",behavior:n}:null,Fx=He(([{gap:e,sizes:t,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:s,headerHeight:a,scrollingInProgress:o,scrollTop:i,viewportHeight:c},{scrollToIndex:l}])=>{const u=Oe();return ce(W(u,Te(t,c,r,a,s,n,i),Te(e),re(([[d,f,m,y,g,E,w,v],S])=>{const{align:C,behavior:D,calculateViewLocation:L=qj,done:T,...h}=d,b=gx(d,f,y-1),x=lc(b,f.offsetTree,S)+g+E,A=x+qr(f.sizeTree,b)[1],I=v+E,F=v+m-w,_=L({itemBottom:A,itemTop:x,locationParams:{align:C,behavior:D,...h},viewportBottom:F,viewportTop:I});return _?T&&Wr(W(o,fe(k=>!k),oa(st(o)?1:2)),T):T&&T(),_}),fe(d=>d!==null)),l),{scrollIntoView:u}},et(dn,Wt,uc,la,hs),{singleton:!0});function Ux(e){return e?e==="smooth"?"smooth":"auto":!1}const Yj=(e,t)=>typeof e=="function"?Ux(e(t)):t&&Ux(e),Kj=He(([{listRefresh:e,totalCount:t,fixedItemSize:r,data:n},{atBottomState:s,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:i},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:m}])=>{const y=K(!1),g=Oe();let E=null;function w(D){Ce(o,{align:"end",behavior:D,index:"LAST"})}je(W(vt(W(me(t),oa(1)),c),Te(me(y),a,i,d),re(([[D,L],T,h,b,x])=>{let A=L&&b,I="auto";return A&&(I=Yj(T,h||x),A=A&&!!I),{followOutputBehavior:I,shouldFollow:A,totalCount:D}}),fe(({shouldFollow:D})=>D)),({followOutputBehavior:D,totalCount:L})=>{E&&(E(),E=null),st(r)?requestAnimationFrame(()=>{st(u)("following output to ",{totalCount:L},nr.DEBUG),w(D)}):E=Wr(e,()=>{st(u)("following output to ",{totalCount:L},nr.DEBUG),w(D),E=null})});function v(D){const L=Wr(s,T=>{D&&!T.atBottom&&T.notAtBottomBecause==="SIZE_INCREASED"&&!E&&(st(u)("scrolling to bottom due to increased size",{},nr.DEBUG),w("auto"))});setTimeout(L,100)}je(W(vt(me(y),t,l),fe(([D,,L])=>D&&L),un(({value:D},[,L])=>({refreshed:D===L,value:L}),{refreshed:!1,value:0}),fe(({refreshed:D})=>D),Te(y,t)),([,D])=>{st(i)&&v(D!==!1)}),je(g,()=>{v(st(y)!==!1)}),je(vt(me(y),s),([D,L])=>{D&&!L.atBottom&&L.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&w("auto")});const S=K(null),C=Oe();return ce(K0(W(me(n),re(D=>{var L;return(L=D==null?void 0:D.length)!=null?L:0})),W(me(t))),C),je(W(vt(W(C,oa(1)),c),Te(me(S),i,d,f),re(([[D,L],T,h,b,x])=>L&&h&&(T==null?void 0:T({context:x,totalCount:D,scrollingInProgress:b}))),fe(D=>!!D),$n(0)),D=>{E&&(E(),E=null),st(r)?requestAnimationFrame(()=>{st(u)("scrolling into view",{}),Ce(m,D)}):E=Wr(e,()=>{st(u)("scrolling into view",{}),Ce(m,D),E=null})}),{autoscrollToBottom:g,followOutput:y,scrollIntoViewOnChange:S}},et(dn,mc,uc,dc,ys,hs,Wt,Bx,Fx)),Zj=He(([{data:e,firstItemIndex:t,gap:r,sizes:n},{initialTopMostItemIndex:s},{initialItemCount:a,listState:o},{didMount:i}])=>(ce(W(i,Te(a),fe(([,c])=>c!==0),Te(s,n,t,r,e),re(([[,c],l,u,d,f,m=[]])=>Sx(c,l,u,d,f,m))),o),{}),et(dn,dc,la,ys),{singleton:!0}),Xj=He(([{didMount:e},{scrollTo:t},{listState:r}])=>{const n=K(0);return je(W(e,Te(n),fe(([,s])=>s!==0),re(([,s])=>({top:s}))),s=>{Wr(W(r,oa(1),fe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{Ce(t,s)})})}),{initialScrollTop:n}},et(ys,Wt,la),{singleton:!0}),Ox=He(([{scrollVelocity:e}])=>{const t=K(!1),r=Oe(),n=K(!1);return ce(W(e,Te(n,t,r),fe(([s,a])=>!!a),re(([s,a,o,i])=>{const{enter:c,exit:l}=a;if(o){if(l(s,i))return!1}else if(c(s,i))return!0;return o}),tt()),t),je(W(vt(t,e,r),Te(n)),([[s,a,o],i])=>{s&&i&&i.change&&i.change(a,o)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:r,scrollVelocity:e}},et(mc),{singleton:!0}),cm=He(([{scrollContainerState:e,scrollTo:t}])=>{const r=Oe(),n=Oe(),s=Oe(),a=K(!1),o=K(void 0);return ce(W(vt(r,n),re(([{scrollHeight:i,scrollTop:c,viewportHeight:l},{offsetTop:u}])=>({scrollHeight:i,scrollTop:Math.max(0,c-u),viewportHeight:l}))),e),ce(W(t,Te(n),re(([i,{offsetTop:c}])=>({...i,top:i.top+c}))),s),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:r,windowScrollTo:s,windowViewportRect:n}},et(Wt)),Qj=He(([{sizeRanges:e,sizes:t},{headerHeight:r,scrollTop:n},{initialTopMostItemIndex:s},{didMount:a},{useWindowScroll:o,windowScrollContainerState:i,windowViewportRect:c}])=>{const l=Oe(),u=K(void 0),d=K(null),f=K(null);return ce(i,d),ce(c,f),je(W(l,Te(t,n,o,d,f,r)),([m,y,g,E,w,v,S])=>{const C=_j(y.sizeTree);E&&w!==null&&v!==null&&(g=w.scrollTop-v.offsetTop),g-=S,m({ranges:C,scrollTop:g})}),ce(W(u,fe(q0),re(Jj)),s),ce(W(a,Te(u),fe(([,m])=>m!==void 0),tt(),re(([,m])=>m.ranges)),e),{getState:l,restoreStateFrom:u}},et(dn,Wt,dc,ys,cm));function Jj(e){return{align:"start",index:0,offset:e.scrollTop}}const eV=He(([{topItemsIndexes:e}])=>{const t=K(0);return ce(W(t,fe(r=>r>=0),re(r=>Array.from({length:r}).map((n,s)=>s))),e),{topItemCount:t}},et(la));function Dx(e){let t=!1,r;return()=>(t||(t=!0,r=e()),r)}const tV=Dx(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),rV=He(([{deviation:e,scrollBy:t,scrollingInProgress:r,scrollTop:n},{isAtBottom:s,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:i},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:m},{recalcInProgress:y}])=>{const g=br(W(c,Te(o),un(([,w,v,S],[{bottom:C,items:D,offsetBottom:L,totalCount:T},h])=>{const b=C+L;let x=0;return v===T&&w.length>0&&D.length>0&&(D[0].originalIndex===0&&w[0].originalIndex===0||(x=b-S,x!==0&&(x+=h))),[x,D,T,b]},[0,[],0,0]),fe(([w])=>w!==0),Te(n,i,r,s,m,y),fe(([,w,v,S,,,C])=>!C&&!S&&w!==0&&v===pc),re(([[w],,,,,v])=>(v("Upward scrolling compensation",{amount:w},nr.DEBUG),w))));function E(w){w>0?(Ce(t,{behavior:"auto",top:-w}),Ce(e,0)):(Ce(e,0),Ce(t,{behavior:"auto",top:-w}))}return je(W(g,Te(e,a)),([w,v,S])=>{S&&tV()?Ce(e,v-w):E(-w)}),je(W(vt(Ht(a,!1),e,y),fe(([w,v,S])=>!w&&!S&&v!==0),re(([w,v])=>v),$n(1)),E),ce(W(d,re(w=>({top:-w}))),t),je(W(l,Te(f,u),re(([w,{groupIndices:v,lastSize:S,sizeTree:C},D])=>{function L(T){return T*(S+D)}if(v.length===0)return L(w);{let T=0;const h=ic(C,0);let b=0,x=0;for(;b<w;){b++,T+=h;let A=v.length===x+1?1/0:v[x+1]-v[x]-1;b+A>w&&(T-=h,A=w-b+1),b+=A,T+=L(A),x++}return T}})),w=>{Ce(e,w),requestAnimationFrame(()=>{Ce(t,{top:w}),requestAnimationFrame(()=>{Ce(e,0),Ce(y,!1)})})}),{deviation:e}},et(Wt,mc,la,dn,hs,tm)),nV=He(([e,t,r,n,s,a,o,i,c,l,u])=>({...e,...t,...r,...n,...s,...a,...o,...i,...c,...l,...u}),et(om,Zj,ys,Ox,Ix,Xj,Wj,cm,Fx,hs,Bx)),_x=He(([{data:e,defaultItemSize:t,firstItemIndex:r,fixedItemSize:n,fixedGroupSize:s,gap:a,groupIndices:o,heightEstimates:i,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:m},{initialItemFinalLocationReached:y,initialTopMostItemIndex:g,scrolledToInitialItem:E},w,v,S,C,{scrollToIndex:D},L,{topItemCount:T},{groupCounts:h},b])=>{const{listState:x,minOverscanItemCount:A,topItemsIndexes:I,rangeChanged:F,..._}=C;return ce(F,b.scrollSeekRangeChanged),ce(W(b.windowViewportRect,re(k=>k.visibleHeight)),w.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:r,fixedItemHeight:n,fixedGroupHeight:s,gap:a,groupCounts:h,heightEstimates:i,initialItemFinalLocationReached:y,initialTopMostItemIndex:g,scrolledToInitialItem:E,sizeRanges:l,topItemCount:T,topItemsIndexes:I,totalCount:f,...S,groupIndices:o,itemSize:c,listState:x,minOverscanItemCount:A,scrollToIndex:D,statefulTotalCount:d,trackItemSizes:m,rangeChanged:F,..._,...b,...w,sizes:u,...v}},et(dn,dc,Wt,Qj,Kj,la,uc,rV,eV,wx,nV));function sV(e,t){const r={},n={};let s=0;const a=e.length;for(;s<a;)n[e[s]]=1,s+=1;for(const o in t)Object.hasOwn(n,o)||(r[o]=t[o]);return r}const Hu=typeof document<"u"?M.useLayoutEffect:M.useEffect;function Mx(e,t,r){const n=Object.keys(t.required||{}),s=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),i=M.createContext({});function c(E,w){E.propsReady&&Ce(E.propsReady,!1);for(const v of n){const S=E[t.required[v]];Ce(S,w[v])}for(const v of s)if(v in w){const S=E[t.optional[v]];Ce(S,w[v])}E.propsReady&&Ce(E.propsReady,!0)}function l(E){return a.reduce((w,v)=>(w[v]=S=>{const C=E[t.methods[v]];Ce(C,S)},w),{})}function u(E){return o.reduce((w,v)=>(w[v]=wj(E[t.events[v]]),w),{})}const d=M.forwardRef((E,w)=>{const{children:v,...S}=E,[C]=M.useState(()=>Mu(Ej(e),T=>{c(T,S)})),[D]=M.useState(sx(u,C));Hu(()=>{for(const T of o)T in S&&je(D[T],S[T]);return()=>{Object.values(D).map(Y0)}},[S,D,C]),Hu(()=>{c(C,S)}),M.useImperativeHandle(w,rx(l(C)));const L=r;return B.jsx(i.Provider,{value:C,children:r?B.jsx(L,{...sV([...n,...s,...o],S),children:v}):v})}),f=E=>{const w=M.useContext(i);return M.useCallback(v=>{Ce(w[E],v)},[w,E])},m=E=>{const w=M.useContext(i)[E],v=M.useCallback(S=>je(w,S),[w]);return M.useSyncExternalStore(v,()=>st(w),()=>st(w))},y=E=>{const w=M.useContext(i)[E],[v,S]=M.useState(sx(st,w));return Hu(()=>je(w,C=>{C!==v&&S(rx(C))}),[w,v]),v},g=M.version.startsWith("18")?m:y;return{Component:d,useEmitter:(E,w)=>{const v=M.useContext(i)[E];Hu(()=>je(v,w),[w,v])},useEmitterValue:g,usePublisher:f}}const Nx=M.createContext(void 0),Lx=M.createContext(void 0),zx=typeof document<"u"?M.useLayoutEffect:M.useEffect;function lm(e){return"self"in e}function aV(e){return"body"in e}function Rx(e,t,r,n=ho,s,a){const o=M.useRef(null),i=M.useRef(null),c=M.useRef(null),l=M.useCallback(f=>{let m,y,g;const E=f.target;if(aV(E)||lm(E)){const v=lm(E)?E:E.defaultView;g=a?v.scrollX:v.scrollY,m=a?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight,y=a?v.innerWidth:v.innerHeight}else g=a?E.scrollLeft:E.scrollTop,m=a?E.scrollWidth:E.scrollHeight,y=a?E.offsetWidth:E.offsetHeight;const w=()=>{e({scrollHeight:m,scrollTop:Math.max(g,0),viewportHeight:y})};f.suppressFlushSync?w():ka.flushSync(w),i.current!==null&&(g===i.current||g<=0||g===m-y)&&(i.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);M.useEffect(()=>{const f=s||o.current;return n(s||o.current),l({suppressFlushSync:!0,target:f}),f.addEventListener("scroll",l,{passive:!0}),()=>{n(null),f.removeEventListener("scroll",l)}},[o,l,r,n,s]);function u(f){const m=o.current;if(!m||(a?"offsetWidth"in m&&m.offsetWidth===0:"offsetHeight"in m&&m.offsetHeight===0))return;const y=f.behavior==="smooth";let g,E,w;lm(m)?(E=Math.max(bs(m.document.documentElement,a?"width":"height"),a?m.document.documentElement.scrollWidth:m.document.documentElement.scrollHeight),g=a?m.innerWidth:m.innerHeight,w=a?window.scrollX:window.scrollY):(E=m[a?"scrollWidth":"scrollHeight"],g=bs(m,a?"width":"height"),w=m[a?"scrollLeft":"scrollTop"]);const v=E-g;if(f.top=Math.ceil(Math.max(Math.min(v,f.top),0)),Ex(g,E)||f.top===w){e({scrollHeight:E,scrollTop:w,viewportHeight:g}),y&&t(!0);return}y?(i.current=f.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,i.current=null,t(!0)},1e3)):i.current=null,a&&(f={behavior:f.behavior,left:f.top}),m.scrollTo(f)}function d(f){a&&(f={behavior:f.behavior,left:f.top}),o.current.scrollBy(f)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}const um="-webkit-sticky",Hx="sticky",dm=Dx(()=>{if(typeof document>"u")return Hx;const e=document.createElement("div");return e.style.position=um,e.style.position===um?um:Hx});function pm(e){return e}const oV=He(()=>{const e=K(i=>`Item ${i}`),t=K(i=>`Group ${i}`),r=K({}),n=K(pm),s=K("div"),a=K(ho),o=(i,c=null)=>Ht(W(r,re(l=>l[i]),tt()),c);return{components:r,computeItemKey:n,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:s,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),iV=He(([e,t])=>({...e,...t}),et(_x,oV)),cV=({height:e})=>B.jsx("div",{style:{height:e}}),lV={overflowAnchor:"none",position:dm(),zIndex:1},$x={overflowAnchor:"none"},uV={...$x,display:"inline-block",height:"100%"},Gx=M.memo(function({showTopList:e=!1}){const t=ye("listState"),r=Pr("sizeRanges"),n=ye("useWindowScroll"),s=ye("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),i=s||n?a:o,c=ye("itemContent"),l=ye("context"),u=ye("groupContent"),d=ye("trackItemSizes"),f=ye("itemSize"),m=ye("log"),y=Pr("gap"),g=ye("horizontalDirection"),{callbackRef:E}=Tj(r,f,d,e?ho:i,m,y,s,g,ye("skipAnimationFrameInResizeObserver")),[w,v]=M.useState(0);fm("deviation",_=>{w!==_&&v(_)});const S=ye("EmptyPlaceholder"),C=ye("ScrollSeekPlaceholder")||cV,D=ye("ListComponent"),L=ye("ItemComponent"),T=ye("GroupComponent"),h=ye("computeItemKey"),b=ye("isSeeking"),x=ye("groupIndices").length>0,A=ye("alignToBottom"),I=ye("initialItemFinalLocationReached"),F=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:w!==0?w:A?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:w!==0?w:A?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...I?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&S?B.jsx(S,{...$t(S,l)}):B.jsx(D,{...$t(D,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:E,style:F,children:(e?t.topItems:t.items).map(_=>{const k=_.originalIndex,P=h(k+t.firstItemIndex,_.data,l);return b?M.createElement(C,{...$t(C,l),height:_.size,index:_.index,key:P,type:_.type||"item",..._.type==="group"?{}:{groupIndex:_.groupIndex}}):_.type==="group"?M.createElement(T,{...$t(T,l),"data-index":k,"data-item-index":_.index,"data-known-size":_.size,key:P,style:lV},u(_.index,l)):M.createElement(L,{...$t(L,l),...mV(L,_.data),"data-index":k,"data-item-group-index":_.groupIndex,"data-item-index":_.index,"data-known-size":_.size,key:P,style:g?uV:$x},x?c(_.index,_.groupIndex,_.data,l):c(_.index,_.data,l))})})}),dV={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},pV={outline:"none",overflowX:"auto",position:"relative"},$u=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),fV={position:dm(),top:0,width:"100%",zIndex:1};function $t(e,t){if(typeof e!="string")return{context:t}}function mV(e,t){return{item:typeof e=="string"?void 0:t}}const hV=M.memo(function(){const e=ye("HeaderComponent"),t=Pr("headerHeight"),r=ye("HeaderFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,ye("skipAnimationFrameInResizeObserver")),s=ye("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),bV=M.memo(function(){const e=ye("FooterComponent"),t=Pr("footerHeight"),r=ye("HeaderFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,ye("skipAnimationFrameInResizeObserver")),s=ye("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null});function jx({useEmitter:e,useEmitterValue:t,usePublisher:r}){return M.memo(function({children:n,style:s,context:a,...o}){const i=r("scrollContainerState"),c=t("ScrollerComponent"),l=r("smoothScrollTargetReached"),u=t("scrollerRef"),d=t("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:m,scrollToCallback:y}=Rx(i,l,c,u,void 0,d);return e("scrollTo",y),e("scrollBy",f),B.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:m,style:{...d?pV:dV,...s},tabIndex:0,...o,...$t(c,a),children:n})})}function Vx({useEmitter:e,useEmitterValue:t,usePublisher:r}){return M.memo(function({children:n,style:s,context:a,...o}){const i=r("windowScrollContainerState"),c=t("ScrollerComponent"),l=r("smoothScrollTargetReached"),u=t("totalListHeight"),d=t("deviation"),f=t("customScrollParent"),m=M.useRef(null),y=t("scrollerRef"),{scrollByCallback:g,scrollerRef:E,scrollToCallback:w}=Rx(i,l,c,y,f);return zx(()=>{var v;return E.current=f||((v=m.current)==null?void 0:v.ownerDocument.defaultView),()=>{E.current=null}},[E,f]),e("windowScrollTo",w),e("scrollBy",g),B.jsx(c,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...s,...u!==0?{height:u+d}:{}},...o,...$t(c,a),children:n})})}const yV=({children:e})=>{const t=M.useContext(Nx),r=Pr("viewportHeight"),n=Pr("fixedItemHeight"),s=ye("alignToBottom"),a=ye("horizontalDirection"),o=M.useMemo(()=>nx(r,c=>bs(c,a?"width":"height")),[r,a]),i=ia(o,!0,ye("skipAnimationFrameInResizeObserver"));return M.useEffect(()=>{t&&(r(t.viewportHeight),n(t.itemHeight))},[t,r,n]),B.jsx("div",{"data-viewport-type":"element",ref:i,style:$u(s),children:e})},gV=({children:e})=>{const t=M.useContext(Nx),r=Pr("windowViewportRect"),n=Pr("fixedItemHeight"),s=ye("customScrollParent"),a=cx(r,s,ye("skipAnimationFrameInResizeObserver")),o=ye("alignToBottom");return M.useEffect(()=>{t&&(n(t.itemHeight),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,r,n]),B.jsx("div",{"data-viewport-type":"window",ref:a,style:$u(o),children:e})},xV=({children:e})=>{const t=ye("TopItemListComponent")||"div",r=ye("headerHeight"),n={...fV,marginTop:`${r}px`},s=ye("context");return B.jsx(t,{style:n,...$t(t,s),children:e})},wV=M.memo(function(e){const t=ye("useWindowScroll"),r=ye("topItemsIndexes").length>0,n=ye("customScrollParent"),s=ye("context");return B.jsxs(n||t?kV:EV,{...e,context:s,children:[r&&B.jsx(xV,{children:B.jsx(Gx,{showTopList:!0})}),B.jsxs(n||t?gV:yV,{children:[B.jsx(hV,{}),B.jsx(Gx,{}),B.jsx(bV,{})]})]})}),{Component:vV,useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}=Mx(iV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},wV),EV=jx({useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}),kV=Vx({useEmitter:fm,useEmitterValue:ye,usePublisher:Pr}),CV=vV;et(_x,He(()=>{const e=K(l=>B.jsxs("td",{children:["Item $",l]})),t=K(null),r=K(l=>B.jsxs("td",{colSpan:1e3,children:["Group ",l]})),n=K(null),s=K(null),a=K({}),o=K(pm),i=K(ho),c=(l,u=null)=>Ht(W(a,re(d=>d[l]),tt()),u);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:s,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}})),dm();const Wx={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},TV={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:qx,floor:Gu,max:yc,min:mm,round:Yx}=Math;function Kx(e,t,r){return Array.from({length:t-e+1}).map((n,s)=>({data:r===null?null:r[s+e],index:s+e}))}function SV(e){return{...TV,items:e}}function ju(e,t){return e&&e.width===t.width&&e.height===t.height}function AV(e,t){return e&&e.column===t.column&&e.row===t.row}const PV=He(([{increaseViewportBy:e,listBoundary:t,overscan:r,visibleRange:n},{footerHeight:s,headerHeight:a,scrollBy:o,scrollContainerState:i,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,m,{didMount:y,propsReady:g},{customScrollParent:E,useWindowScroll:w,windowScrollContainerState:v,windowScrollTo:S,windowViewportRect:C},D])=>{const L=K(0),T=K(0),h=K(Wx),b=K({height:0,width:0}),x=K({height:0,width:0}),A=Oe(),I=Oe(),F=K(0),_=K(null),k=K({column:0,row:0}),P=Oe(),O=Oe(),U=K(!1),z=K(0),H=K(!0),G=K(!1),J=K(!1);je(W(y,Te(z),fe(([Q,we])=>!!we)),()=>{Ce(H,!1)}),je(W(vt(y,H,x,b,z,G),fe(([Q,we,_e,$e,,ot])=>Q&&!we&&_e.height!==0&&$e.height!==0&&!ot)),([,,,,Q])=>{Ce(G,!0),sm(1,()=>{Ce(A,Q)}),Wr(W(l),()=>{Ce(t,[0,0]),Ce(H,!0)})}),ce(W(O,fe(Q=>Q!=null&&Q.scrollTop>0),ln(0)),T),je(W(y,Te(O),fe(([,Q])=>Q!=null)),([,Q])=>{Q&&(Ce(b,Q.viewport),Ce(x,Q.item),Ce(k,Q.gap),Q.scrollTop>0&&(Ce(U,!0),Wr(W(l,oa(1)),we=>{Ce(U,!1)}),Ce(c,{top:Q.scrollTop})))}),ce(W(b,re(({height:Q})=>Q)),d),ce(W(vt(me(b,ju),me(x,ju),me(k,(Q,we)=>Q&&Q.column===we.column&&Q.row===we.row),me(l)),re(([Q,we,_e,$e])=>({gap:_e,item:we,scrollTop:$e,viewport:Q}))),P),ce(W(vt(me(L),n,me(k,AV),me(x,ju),me(b,ju),me(_),me(T),me(U),me(H),me(z)),fe(([,,,,,,,Q])=>!Q),re(([Q,[we,_e],$e,ot,Se,ve,be,,Ze,Ye])=>{const{column:Xe,row:Fr}=$e,{height:Ot,width:vm}=ot,{width:C5}=Se;if(be===0&&(Q===0||C5===0))return Wx;if(vm===0){const I5=am(Ye,Q),LW=I5+Math.max(be-1,0);return SV(Kx(I5,LW,ve))}const qu=Zx(C5,vm,Xe);let Bo,Ea;Ze?we===0&&_e===0&&be>0?(Bo=0,Ea=be-1):(Bo=qu*Gu((we+Fr)/(Ot+Fr)),Ea=qu*qx((_e+Fr)/(Ot+Fr))-1,Ea=mm(Q-1,yc(Ea,qu-1)),Bo=mm(Ea,yc(0,Bo))):(Bo=0,Ea=-1);const T5=Kx(Bo,Ea,ve),{bottom:S5,top:A5}=Xx(Se,$e,ot,T5),P5=qx(Q/qu),NW=P5*Ot+(P5-1)*Fr-S5;return{bottom:S5,itemHeight:Ot,items:T5,itemWidth:vm,offsetBottom:NW,offsetTop:A5,top:A5}})),h),ce(W(_,fe(Q=>Q!==null),re(Q=>Q.length)),L),ce(W(vt(b,x,h,k),fe(([Q,we,{items:_e}])=>_e.length>0&&we.height!==0&&Q.height!==0),re(([Q,we,{items:_e},$e])=>{const{bottom:ot,top:Se}=Xx(Q,$e,we,_e);return[Se,ot]}),tt(cc)),t);const pe=K(!1);ce(W(l,Te(pe),re(([Q,we])=>we||Q!==0)),pe);const he=br(W(vt(h,L),fe(([{items:Q}])=>Q.length>0),Te(pe),fe(([[Q,we],_e])=>{const $e=Q.items[Q.items.length-1].index===we-1;return(_e||Q.bottom>0&&Q.itemHeight>0&&Q.offsetBottom===0&&Q.items.length===we)&&$e}),re(([[,Q]])=>Q-1),tt())),ie=br(W(me(h),fe(({items:Q})=>Q.length>0&&Q[0].index===0),ln(0),tt())),de=br(W(me(h),Te(U),fe(([{items:Q},we])=>Q.length>0&&!we),re(([{items:Q}])=>({endIndex:Q[Q.length-1].index,startIndex:Q[0].index})),tt(hx),$n(0)));ce(de,m.scrollSeekRangeChanged),ce(W(A,Te(b,x,L,k),re(([Q,we,_e,$e,ot])=>{const Se=vx(Q),{align:ve,behavior:be,offset:Ze}=Se;let Ye=Se.index;Ye==="LAST"&&(Ye=$e-1),Ye=yc(0,Ye,mm($e-1,Ye));let Xe=hm(we,ot,_e,Ye);return ve==="end"?Xe=Yx(Xe-we.height+_e.height):ve==="center"&&(Xe=Yx(Xe-we.height/2+_e.height/2)),Ze&&(Xe+=Ze),{behavior:be,top:Xe}})),c);const Be=Ht(W(h,re(Q=>Q.offsetBottom+Q.bottom)),0);return ce(W(C,re(Q=>({height:Q.visibleHeight,width:Q.visibleWidth}))),b),{customScrollParent:E,data:_,deviation:F,footerHeight:s,gap:k,headerHeight:a,increaseViewportBy:e,initialItemCount:T,itemDimensions:x,overscan:r,restoreStateFrom:O,scrollBy:o,scrollContainerState:i,scrollHeight:I,scrollTo:c,scrollToIndex:A,scrollTop:l,smoothScrollTargetReached:u,totalCount:L,useWindowScroll:w,viewportDimensions:b,windowScrollContainerState:v,windowScrollTo:S,windowViewportRect:C,...m,gridState:h,horizontalDirection:J,initialTopMostItemIndex:z,totalListHeight:Be,...f,endReached:he,propsReady:g,rangeChanged:de,startReached:ie,stateChanged:P,stateRestoreInProgress:U,...D}},et(om,Wt,mc,Ox,ys,cm,hs));function Zx(e,t,r){return yc(1,Gu((e+r)/(Gu(t)+r)))}function Xx(e,t,r,n){const{height:s}=r;if(s===void 0||n.length===0)return{bottom:0,top:0};const a=hm(e,t,r,n[0].index);return{bottom:hm(e,t,r,n[n.length-1].index)+s,top:a}}function hm(e,t,r,n){const s=Zx(e.width,r.width,t.column),a=Gu(n/s),o=a*r.height+yc(0,a-1)*t.row;return o>0?o+t.row:o}const IV=He(()=>{const e=K(d=>`Item ${d}`),t=K({}),r=K(null),n=K("virtuoso-grid-item"),s=K("virtuoso-grid-list"),a=K(pm),o=K("div"),i=K(ho),c=(d,f=null)=>Ht(W(t,re(m=>m[d]),tt()),f),l=K(!1),u=K(!1);return ce(me(u),l),{components:t,computeItemKey:a,context:r,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:o,itemClassName:n,ItemComponent:c("Item","div"),itemContent:e,listClassName:s,ListComponent:c("List","div"),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),BV=He(([e,t])=>({...e,...t}),et(PV,IV)),FV=M.memo(function(){const e=at("gridState"),t=at("listClassName"),r=at("itemClassName"),n=at("itemContent"),s=at("computeItemKey"),a=at("isSeeking"),o=Ir("scrollHeight"),i=at("ItemComponent"),c=at("ListComponent"),l=at("ScrollSeekPlaceholder"),u=at("context"),d=Ir("itemDimensions"),f=Ir("gap"),m=at("log"),y=at("stateRestoreInProgress"),g=Ir("reportReadyState"),E=ia(M.useMemo(()=>w=>{const v=w.parentElement.parentElement.scrollHeight;o(v);const S=w.firstChild;if(S){const{height:C,width:D}=S.getBoundingClientRect();d({height:C,width:D})}f({column:Jx("column-gap",getComputedStyle(w).columnGap,m),row:Jx("row-gap",getComputedStyle(w).rowGap,m)})},[o,d,f,m]),!0,!1);return zx(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),y?null:B.jsx(c,{className:t,ref:E,...$t(c,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(w=>{const v=s(w.index,w.data,u);return a?B.jsx(l,{...$t(l,u),height:e.itemHeight,index:w.index,width:e.itemWidth},v):M.createElement(i,{...$t(i,u),className:r,"data-index":w.index,key:v},n(w.index,w.data,u))})})}),UV=M.memo(function(){const e=at("HeaderComponent"),t=Ir("headerHeight"),r=at("headerFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,!1),s=at("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),OV=M.memo(function(){const e=at("FooterComponent"),t=Ir("footerHeight"),r=at("headerFooterTag"),n=ia(M.useMemo(()=>a=>{t(bs(a,"height"))},[t]),!0,!1),s=at("context");return e?B.jsx(r,{ref:n,children:B.jsx(e,{...$t(e,s)})}):null}),DV=({children:e})=>{const t=M.useContext(Lx),r=Ir("itemDimensions"),n=Ir("viewportDimensions"),s=ia(M.useMemo(()=>a=>{n(a.getBoundingClientRect())},[n]),!0,!1);return M.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),r({height:t.itemHeight,width:t.itemWidth}))},[t,n,r]),B.jsx("div",{ref:s,style:$u(!1),children:e})},_V=({children:e})=>{const t=M.useContext(Lx),r=Ir("windowViewportRect"),n=Ir("itemDimensions"),s=at("customScrollParent"),a=cx(r,s,!1);return M.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,r,n]),B.jsx("div",{ref:a,style:$u(!1),children:e})},MV=M.memo(function({...e}){const t=at("useWindowScroll"),r=at("customScrollParent"),n=r||t?LV:NV,s=r||t?_V:DV,a=at("context");return B.jsx(n,{...e,...$t(n,a),children:B.jsxs(s,{children:[B.jsx(UV,{}),B.jsx(FV,{}),B.jsx(OV,{})]})})}),{useEmitter:Qx,useEmitterValue:at,usePublisher:Ir}=Mx(BV,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},MV),NV=jx({useEmitter:Qx,useEmitterValue:at,usePublisher:Ir}),LV=Vx({useEmitter:Qx,useEmitterValue:at,usePublisher:Ir});function Jx(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}var bm={},e5;function zV(){if(e5)return bm;e5=1;var e=cu.GenIcon;return bm.AiFillQuestionCircle=function(r){return e({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 0 0-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z"}}]})(r)},bm}var RV=zV();function HV({logo:e,className:t="",style:r={},alt:n="Token logo"}){const[s,a]=M.useState(!1);return M.useEffect(()=>{a(!1)},[e]),e&&!s?B.jsx("img",{alt:n,style:r,onError:()=>a(!0),className:`twap-token-logo ${t}`,src:e}):B.jsx(RV.AiFillQuestionCircle,{style:{width:20,height:20},className:"twap-token-svg"})}const $V=()=>B.jsx("div",{className:"twap-orders__loader",children:B.jsx("p",{children:"Loading..."})}),GV=()=>{const{isLoading:e}=Ou(),t=q2(),r=Z(a=>a.state.orderIdsToCancel),n=Z(a=>a.state.cancelOrdersMode),s=Y2();return B.jsx(B.Fragment,{children:e?B.jsx($V,{}):t!=null&&t.length?B.jsx("div",{className:`twap-orders__list ${n?"twap-orders__list-select-mode":""}`,children:B.jsx(CV,{style:{height:"100%"},data:t,itemContent:(a,o)=>B.jsx(jV,{cancelOrdersMode:!!n,selected:(r==null?void 0:r.includes(o.id))||!1,selectOrder:s,order:o},a)})}):B.jsx(VV,{})})},jV=({order:e,selectOrder:t,selected:r,cancelOrdersMode:n})=>{const s=Z(i=>i.updateState),a=gt.useCallback(()=>{s({selectedOrderID:e==null?void 0:e.id})},[s,e==null?void 0:e.id]),o=gt.useCallback(()=>{n?t(e==null?void 0:e.id):a()},[n,t,a,e==null?void 0:e.id]);return B.jsx("div",{className:`twap-orders__list-item twap-orders__list-item-${e.status} ${n?"twap-orders__list-item-select-mode":""} ${r?"twap-orders__list-item-selected":""}`,onClick:o,children:B.jsxs("div",{className:"twap-orders__list-item-content",children:[B.jsx(WV,{order:e}),B.jsx(qV,{value:e.progress||0}),B.jsxs("div",{className:"twap-orders__list-item-tokens",children:[B.jsx(t5,{address:e.srcTokenAddress}),B.jsx(mj.HiArrowRight,{className:"twap-orders__list-item-tokens-arrow"}),B.jsx(t5,{address:e.dstTokenAddress})]})]})})},VV=()=>{const e=Z(n=>n.state.orderHistoryStatusFilter),t=Ue(),r=gt.useMemo(()=>e||"",[e]);return B.jsx("div",{className:"twap-orders__list-empty",children:B.jsx("p",{children:t("noOrders",{status:r})})})},WV=({order:e})=>{const t=e&&e.status,r=W2(e),n=$0(e.createdAt);return B.jsxs("div",{className:"twap-orders__list-item-header",children:[B.jsxs("p",{className:"twap-orders__list-item-header-title",children:[r," ",B.jsx("span",{children:`(${n})`})]}),B.jsx("p",{className:"twap-orders__list-item-header-status",children:t})]})},t5=e=>{const{useToken:t,components:r}=ne(),n=t==null?void 0:t(e.address);return B.jsx("div",{className:"twap-orders__list-item-token",children:n?B.jsxs(B.Fragment,{children:[B.jsx("div",{className:"twap-orders__list-item-token-logo",children:r.TokenLogo?B.jsx(r.TokenLogo,{token:n}):B.jsx(HV,{logo:n==null?void 0:n.logoUrl})}),B.jsx("p",{className:"twap-orders__list-item-token-symbol",children:n==null?void 0:n.symbol})]}):B.jsx("div",{})})};function qV(e){return B.jsxs("div",{className:"twap-orders__list-item-progress",children:[B.jsx("div",{className:"twap-orders__list-item-progress-bar",children:B.jsx("div",{className:"twap-orders__list-item-progress-bar-filled",style:{width:`${e.value}%`}})}),B.jsx("div",{className:"twap-orders__list-item-token-progress-label",children:B.jsx("p",{children:`${Math.round(e.value)}%`})})]})}const YV=()=>{const e=Z(r=>r.state.selectedOrderID),t=e!==void 0;return B.jsx("div",{className:`twap-orders ${e!==void 0?"twap-orders__show-selected":""}`,children:t?B.jsx(qG,{}):B.jsx(GV,{})})},KV=e=>{const t=Ue(),{marketPrice:r}=ne(),n=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{const{isError:a,value:o}=bh(e);if(!(!a||j(n||"0").isZero()||!r))return{type:Mt.MIN_FILL_DELAY,value:o,message:t("minFillDelayError",{fillDelay:`${Ad(o)} ${t("minutes")}`})}},[e,t,n,r])},ua=()=>{const e=Z(s=>s.state.typedFillDelay),t=Z(s=>s.updateState),r=M.useMemo(()=>e||Ic,[e]),n=KV(r);return{fillDelay:r,onChange:M.useCallback(s=>t({typedFillDelay:s}),[t]),error:n}},ZV=()=>{const{onChange:e,fillDelay:t,error:r}=ua(),n=Ue(),s=M.useCallback(o=>e({unit:t.unit,value:Number(o)}),[e,t]),a=M.useCallback(o=>e({unit:o,value:t.value}),[e,t]);return{onInputChange:s,onUnitSelect:a,onChange:e,milliseconds:t.unit*t.value,fillDelay:t,error:r,label:n("tradeIntervalTitle"),tooltip:n("tradeIntervalTootlip")}},Yr=()=>{const{srcToken:e}=ne(),t=Ue(),r=Z(a=>a.state.typedSrcAmount),s=Z(a=>a.state.acceptedSrcAmount)||r;return{amountWei:Fu(e==null?void 0:e.decimals,s),amountUI:s,error:j(s||0).isZero()?t("enterAmount"):void 0}},XV=(e,t)=>{const{module:r,srcUsd1Token:n,marketPrice:s,minChunkSizeUsd:a}=ne(),o=Ue(),i=Z(c=>c.state.typedSrcAmount);return M.useMemo(()=>{if(j(i||"0").isZero()||!s)return;if(!e)return{type:Mt.MIN_CHUNKS,value:1,message:`${o("minChunksError")} 1`};const{isError:c}=gh(e,t,r);if(c)return{type:Mt.MAX_CHUNKS,value:t,message:o("maxChunksError",{maxChunks:`${t}`})};const{isError:l,value:u}=yh(i||"",n||"",a||0);if(l)return{type:Mt.MIN_TRADE_SIZE,value:u,message:o("minTradeSizeError",{minTradeSize:`${u}`})}},[e,t,r,i,n,a,o,s])},pn=()=>{const{srcToken:e,srcUsd1Token:t,module:r,minChunkSizeUsd:n}=ne(),s=Z(g=>g.state.typedChunks),a=ua().fillDelay,o=Z(g=>g.updateState),{amountWei:i,amountUI:c}=Yr(),l=M.useMemo(()=>ih(a,c||"",t||"",n||0),[c,t,n,a]),u=M.useMemo(()=>oh(l,r,s),[l,s,r]),d=M.useCallback(g=>o({typedChunks:g}),[o]),f=M.useMemo(()=>lh(i||"",u),[i,u]),m=Vr(e==null?void 0:e.decimals,f),y=M.useMemo(()=>t?j(m||"0").times(t||0).toString():"0",[m,t]);return{totalTrades:u,maxTrades:l,amountPerTradeUI:m,amountPerTradeWei:f,amountPerTradeUsd:y,onChange:d,error:XV(u,l)}},QV=()=>{const{srcToken:e,dstToken:t}=ne(),r=Ue(),{onChange:n,totalTrades:s,amountPerTradeUsd:a,amountPerTradeUI:o,error:i,maxTrades:c,amountPerTradeWei:l}=pn(),u=Ge({value:o}),d=Ge({value:a});return{error:i,maxTrades:c,totalTrades:s,amountPerTrade:u,amountPerTradeWei:l,onChange:n,label:r("tradesAmountTitle"),tooltip:r("totalTradesTooltip"),amountPerTradeUsd:d,fromToken:e,toToken:t}},JV=()=>{const{srcToken:e,dstToken:t,marketPrice:r}=ne(),[n,s]=M.useState(!1),a=M.useMemo(()=>{if(j(r||"0").isZero()||!t)return"0";const o=Xr(t==null?void 0:t.decimals,r);return n?j(1).div(o||0).toFixed():o},[n,r,e==null?void 0:e.decimals,t==null?void 0:t.decimals]);return{fromToken:n?t:e,toToken:n?e:t,price:Ge({value:a}),priceWei:Fu(t==null?void 0:t.decimals,r),onInvert:M.useCallback(()=>s(!n),[n])}},eW=e=>{const{module:t,marketPrice:r}=ne(),n=Ue();return M.useMemo(()=>{const s=mh(t,e),a=hh(e);if(r){if(s.isError)return{type:Mt.MAX_ORDER_DURATION,value:s.value,message:n("maxDurationError",{duration:`${Math.floor(d1(s.value)).toFixed(0)} ${n("days")}`})};if(a.isError)return{type:Mt.MIN_ORDER_DURATION,value:a.value,message:n("minDurationError",{duration:`${Math.floor(Ad(a.value)).toFixed(0)} ${n("minutes")}`})}}},[e,n,t,r])},ym=()=>{const{module:e}=ne(),t=Z(i=>i.state.typedDuration),r=Z(i=>i.updateState),n=pn().totalTrades,s=ua().fillDelay,a=M.useMemo(()=>ah(e,n,s,t),[n,s,t,e]),o=eW(a);return{duration:a,setDuration:M.useCallback(i=>r({typedDuration:i}),[r]),error:o}},tW=()=>{const{module:e}=ne(),t=Ue(),{duration:r,setDuration:n,error:s}=ym(),a=M.useCallback(c=>{n({unit:r.unit,value:Number(c)})},[n,r]),o=M.useCallback(c=>{n({unit:c,value:r.value})},[n,r]),i=M.useMemo(()=>e===Ee.STOP_LOSS?t("stopLossDurationTooltip"):t("maxDurationTooltip"),[t,e]);return{duration:r,onChange:n,milliseconds:r.unit*r.value,onInputChange:a,onUnitSelect:o,label:t("expiry"),tooltip:i,error:s}},rW=()=>{const e=Z(s=>s.state.isMarketOrder),{module:t}=ne(),r=Ue(),n=t===Ee.STOP_LOSS||t===Ee.TAKE_PROFIT;return M.useMemo(()=>{if(!n)return{text:r(e?"marketOrderWarning":"limitPriceMessage"),url:"https://www.orbs.com/dtwap-and-dlimit-faq/"}},[e,r,n])},gm=()=>{const e=Z(r=>r.state.currentTime),t=ym().duration;return M.useMemo(()=>ch(e,t),[e,t])},Vu=()=>{const{srcToken:e,dstToken:t,marketPriceLoading:r}=ne(),n=Z(l=>l.updateState),s=Z(l=>l.state.isInvertedTrade),a=Z(l=>l.state.typedTriggerPrice),o=Z(l=>l.state.typedLimitPrice),i=Z(l=>l.state.isMarketOrder);return{onInvert:M.useCallback(()=>{a!==void 0&&n({typedTriggerPrice:j(1).div(a).toFixed()}),o!==void 0&&n({typedLimitPrice:j(1).div(o).toFixed()}),n({isInvertedTrade:!s})},[n,s,a,o,r]),isInverted:s,fromToken:s?t:e,toToken:s?e:t,isMarketPrice:i}},r5=({typedValue:e,tokenDecimals:t=18,initialPrice:r="0",percentage:n,setValue:s,setPercentage:a})=>{const{srcUsd1Token:o,dstUsd1Token:i}=ne(),{isInverted:c}=Vu(),l=M.useMemo(()=>{if(e!==void 0){const g=c?j(e).isZero()?j(0):j(1).div(e):j(e);return Ac(t,g.toFixed())}if(n!==void 0&&j(r||"0").gt(0)&&!j(r||"0").isNaN()){const g=j(r||"0"),E=j(n||0).div(100);return g.plus(g.multipliedBy(E)).decimalPlaces(0).toFixed()}return j(r).gt(0)?r:""},[e,n,t,r,c]),u=M.useCallback(g=>{s(g),a(null)},[s,a]),d=M.useCallback(g=>{s(void 0),a(g)},[s,a]),f=M.useMemo(()=>{if(!r||j(r).isZero())return"";if(n!=null)return n;if(l){const g=j(r),w=j(l).minus(g).div(g).multipliedBy(100).decimalPlaces(2).toString();return j(w||"0").isZero()?"":w}return""},[l,r,n]),m=M.useMemo(()=>{let g="";if(e!==void 0)g=e;else{const E=Xr(t,l);if(j(E||"0").isZero())return"";g=c?j(1).div(E).toFixed():E}return Do(g,6,t)},[e,t,l,c]),y=aa(c?o:i,m||"0");return{amountWei:j(l).isNaN()?"":l,amountUI:j(m).isNaN()?"":m,selectedPercentage:f,onChange:u,onPercentageChange:d,isInverted:c,usd:j(y).isNaN()?"":y}},nW=()=>{const{module:e}=ne();return M.useMemo(()=>e===Ee.STOP_LOSS?Zm:Xm,[e])},xm=()=>{const{module:e}=ne(),t=Z(r=>r.state.isMarketOrder);return M.useMemo(()=>e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT||t?void 0:e===Ee.STOP_LOSS?Qm:Jm,[e,t])},sW=(e="")=>{const{module:t,marketPrice:r}=ne(),n=Ue(),s=Z(a=>a.state.typedSrcAmount);return M.useMemo(()=>{if(j(s||"0").isZero()||!r||t!==Ee.STOP_LOSS&&t!==Ee.TAKE_PROFIT)return;const a=uh(r||"",e||"",t);if(a!=null&&a.isError)return{type:Mt.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE,value:a.value,message:n("StopLossTriggerPriceError")||""};const o=dh(r||"",e||"",t);if(o!=null&&o.isError)return{type:Mt.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE,value:o.value,message:n("TakeProfitTriggerPriceError")||""};if(!e||j(e||0).isZero())return{type:Mt.EMPTY_TRIGGER_PRICE,value:e,message:n("emptyTriggerPrice")||""}},[r,e,t,n,s])},aW=e=>{const{srcToken:t,dstToken:r,module:n}=ne(),s=pn().amountPerTradeWei,a=Z(i=>i.state.isMarketOrder),o=M.useMemo(()=>sh(n,s,e,(t==null?void 0:t.decimals)||0),[e,s,a,t==null?void 0:t.decimals,n]);return{amountWei:o,amountUI:Vr((r==null?void 0:r.decimals)||0,o)}},da=()=>{const{dstToken:e,marketPrice:t,module:r}=ne(),n=Z(m=>m.updateState),s=nW(),a=Z(m=>m.state.triggerPricePercent),o=M.useCallback(m=>{n({triggerPricePercent:m})},[n]),i=a===void 0?s:a,c=r===Ee.STOP_LOSS||r===Ee.TAKE_PROFIT,l=r5({typedValue:Z(m=>m.state.typedTriggerPrice),percentage:i,tokenDecimals:e==null?void 0:e.decimals,initialPrice:c?t:void 0,setValue:M.useCallback(m=>n({typedTriggerPrice:m}),[n]),setPercentage:o}),u=sW(l.amountWei),{amountWei:d,amountUI:f}=aW(l.amountWei);return M.useMemo(()=>({...l,error:u,pricePerChunkWei:d,pricePerChunkUI:f}),[l,u,d,f])},oW=()=>{const{module:e,marketPrice:t,marketPriceLoading:r}=ne(),n=Ue(),{amountUI:s,onChange:a,onPercentageChange:o,usd:i,selectedPercentage:c,error:l}=da(),u=Z(v=>v.state.isMarketOrder),d=Z(v=>v.updateState),{isInverted:f,onInvert:m,fromToken:y,toToken:g}=Vu(),E=M.useCallback(()=>{d({triggerPricePercent:void 0,typedTriggerPrice:void 0})},[d]),w=e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT;return{price:s,error:l,label:n("stopLossLabel"),tooltip:e===Ee.STOP_LOSS?n("stopLossTooltip"):n("takeProfitTooltip"),onChange:a,onPercentageChange:o,percentage:c,isActive:!u,onReset:E,usd:i,fromToken:y,toToken:g,prefix:"",isLoading:r||!t,isInverted:f,hide:w,onInvert:m}},iW=e=>{const{module:t,marketPrice:r}=ne(),n=Ue(),{amountWei:s}=da(),a=Z(i=>i.state.isMarketOrder),o=Z(i=>i.state.typedSrcAmount);return M.useMemo(()=>{if(j(o||"0").isZero()||!s||!r)return;const i=ph(s,e,a,t),c=fh(s,e,a,t);if(i!=null&&i.isError)return{type:Mt.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE,message:n("triggerLimitPriceError")||"",value:i.value};if(c!=null&&c.isError)return{type:Mt.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE,message:n("triggerLimitPriceError")||"",value:c.value};if(e&&j(e||0).isZero())return{type:Mt.MISSING_LIMIT_PRICE,message:n("emptyLimitPrice")||"",value:e||""}},[e,n,s,t,a,o,r])},Wu=()=>{const{dstToken:e,marketPrice:t,module:r}=ne(),n=Z(l=>l.updateState),s=xm(),a=Z(l=>l.state.limitPricePercent),o=a===void 0?s:a,i=r5({typedValue:Z(l=>l.state.typedLimitPrice),percentage:o,tokenDecimals:e==null?void 0:e.decimals,initialPrice:t,setValue:M.useCallback(l=>n({typedLimitPrice:l}),[n]),setPercentage:M.useCallback(l=>{n({limitPricePercent:l})},[n,r])}),c=iW(i.amountWei);return M.useMemo(()=>({...i,error:c}),[i,c])},cW=()=>{const{module:e}=ne(),t=Z(i=>i.updateState),r=Z(i=>i.state.isMarketOrder),n=xm(),s=Z(i=>i.state.triggerPricePercent)||0,a=e===Ee.LIMIT,o=M.useCallback(()=>{!r&&e===Ee.STOP_LOSS&&t({limitPricePercent:n}),t({isMarketOrder:!r})},[t,s,e,r,n]);return{isLimitPrice:!r,toggleLimitPrice:o,hide:a}},lW=()=>{const{module:e,marketPriceLoading:t}=ne(),r=Ue(),{amountUI:n,onChange:s,onPercentageChange:a,usd:o,selectedPercentage:i,error:c}=Wu(),l=Z(L=>L.state.isMarketOrder),u=Z(L=>L.updateState),d=xm(),{isLimitPrice:f,toggleLimitPrice:m}=cW(),{triggerPricePercent:y}=Z(L=>L.state),{isInverted:g,onInvert:E,fromToken:w,toToken:v}=Vu(),S=M.useMemo(()=>{if(!(e!==Ee.STOP_LOSS&&e!==Ee.TAKE_PROFIT||!l))return{text:r("triggerMarketPriceDisclaimer"),url:od}},[y,r,e,l]),C=M.useCallback(()=>{u({typedLimitPrice:void 0}),u({limitPricePercent:d})},[u,e,d]),D=M.useMemo(()=>e===Ee.STOP_LOSS?r("stopLossLimitPriceTooltip"):r("limitPriceTooltip"),[r,e]);return{price:n,error:c,warning:S,label:r("limitPrice"),tooltip:D,onChange:s,onPercentageChange:a,onReset:C,usd:o,fromToken:w,toToken:v,percentage:i,isInverted:g,isLoading:t,isLimitPrice:f,toggleLimitPrice:m,onInvert:E}},n5=()=>{const{module:e,marketPrice:t}=ne(),r=Wu().amountWei,n=da().amountWei,s=Z(a=>a.state.isMarketOrder);return e===Ee.LIMIT||!s?r||"":e===Ee.STOP_LOSS||e===Ee.TAKE_PROFIT?n||"":t||""},gc=()=>{const{srcToken:e,dstToken:t}=ne(),r=n5(),n=Yr().amountWei,s=M.useMemo(()=>rh(n||"",r,(e==null?void 0:e.decimals)||0),[n,r,e==null?void 0:e.decimals]);return{amountWei:s,amountUI:Vr(t==null?void 0:t.decimals,s)}},wm=()=>{const{srcToken:e,dstToken:t,dstUsd1Token:r}=ne(),n=n5(),s=pn().amountPerTradeWei,a=Z(c=>c.state.isMarketOrder),o=M.useMemo(()=>nh(s,n,!!a,(e==null?void 0:e.decimals)||0),[s,n,a,e==null?void 0:e.decimals]),i=Vr(t==null?void 0:t.decimals,o);return{amountWei:o,amountUI:i,usd:aa(i,r)}},uW=()=>{const{srcUsd1Token:e,dstUsd1Token:t}=ne(),r=Yr().amountUI,n=gc().amountUI,s=aa(r,e),a=aa(n,t);return{srcAmountUsd:s,dstAmountUsd:a}},dW=()=>{const{fees:e,dstUsd1Token:t}=ne(),{amountUI:r}=gc(),n=M.useMemo(()=>!e||!r?"":j(r).multipliedBy(e).dividedBy(100).toFixed(),[r]);return{amount:Ge({value:n}),percent:Ge({value:e}),usd:aa(n,t)}},pW=()=>{const e=Yr().amountUI,t=gc().amountUI,r=M.useMemo(()=>j(t||0).dividedBy(e||0).toString(),[t,e]);return Ge({value:r,decimalScale:4})},s5=()=>{const{srcToken:e,dstToken:t,account:r}=ne(),n=Ue(),{amountWei:s}=Yr(),{amountWei:a,usd:o}=wm(),{totalTrades:i,amountPerTradeWei:c}=pn(),{amountWei:l,usd:u}=da(),{fillDelay:d}=ua(),f=gm(),{amountUI:m,usd:y}=Wu(),{amount:g,percent:E,usd:w}=dW(),v=Ge({value:pW(),decimalScale:4}),{srcAmountUsd:S,dstAmountUsd:C}=uW(),D=K2({srcToken:e,dstToken:t,srcAmount:s,minDestAmountPerTrade:a,totalTrades:i,triggerPricePerTrade:l,deadline:f,srcAmountPerTrade:c,maker:r,tradeInterval:d.unit*d.value,limitPrice:m});return M.useMemo(()=>({...D,srcAmountUsd:S,dstAmountUsd:C,fee:{label:n("fees",{value:`${E}%`}),amount:g,usd:w,percentage:E},display:{...D.display,minDestAmountPerTrade:{...D.display.minDestAmountPerTrade,usd:o},triggerPricePerTrade:{...D.display.triggerPricePerTrade,usd:u},limitPrice:{...D.display.limitPrice,usd:y}}}),[D,E,g,n,v,e,t,S,C,o,u,w,y])},a5=()=>{const{srcBalance:e}=ne(),t=Ue(),r=Yr().amountWei;return M.useMemo(()=>{if(e&&j(r).gt(e))return{type:Mt.INSUFFICIENT_BALANCE,message:t("insufficientFunds"),value:e||""}},[e,r,t])};function o5(){const{marketPrice:e,marketPriceLoading:t}=ne(),r=Z(u=>u.state.typedSrcAmount),n=a5(),{error:s}=da(),{error:a}=Wu(),{error:o}=pn(),{error:i}=ua(),{error:c}=ym(),l=M.useMemo(()=>Fo("ignore-errors"),[]);if(!(j(e||0).isZero()||j(r||0).isZero()||t||l))return s||a||o||i||c||n}const i5=()=>{const{srcToken:e,dstToken:t,chainId:r,account:n,slippage:s,config:a}=ne(),o=pn().amountPerTradeWei,i=Yr().amountWei,c=gm(),l=da().pricePerChunkWei,u=wm().amountWei,d=ua().fillDelay,f=pn().totalTrades,m=s*100,y=!f||f===1?0:d.unit*d.value;return M.useMemo(()=>{var E;const g=Is((e==null?void 0:e.address)||"")?(E=Bs(r))==null?void 0:E.wToken.address:e==null?void 0:e.address;if(!(!g||!t||!r||!n||!c||!i||!a))return wh({chainId:r,srcToken:g,dstToken:t.address,srcAmount:i,deadlineMillis:c,fillDelayMillis:y,slippage:m,account:n,srcAmountPerTrade:o,dstMinAmountPerTrade:u,triggerAmountPerTrade:l,config:a})},[e,t,r,n,i,c,o,l,m,u,d,f,a])},fW=()=>{var c;const{account:e,walletClient:t,overrides:r,refetchBalances:n,callbacks:s,chainId:a}=ne(),o=(c=ac())==null?void 0:c.wToken,i=G0();return xn({mutationFn:async({onHash:l,srcAmountWei:u})=>{var m,y;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!o)throw new Error("tokenAddress is not defined");let d;ct.onWrapRequest(),(m=s==null?void 0:s.onWrapRequest)==null||m.call(s),r!=null&&r.wrap?d=await r.wrap(BigInt(u)):d=await t.writeContract({abi:Om,functionName:"deposit",account:e,address:o.address,value:BigInt(u),chain:t.chain}),l==null||l(d);const f=await i(d);if(!f)throw new Error("failed to get transaction receipt");if(f.status==="reverted")throw new Error("failed to wrap token");return ct.onWrapSuccess(d),(y=s==null?void 0:s.onWrapSuccess)==null||y.call(s,{txHash:f.transactionHash,explorerUrl:_o(f.transactionHash,a),amount:Xr(o.decimals,u)}),n==null||n(),f},onError:l=>{throw ct.onWrapError(l),l}})},mW=()=>{const{account:e,walletClient:t,chainId:r,callbacks:n}=ne(),s=i5(),a=HG();return xn({mutationFn:async()=>{var y,g,E,w;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!r)throw new Error("missing chainId");if(!s)throw new Error("rePermitOrderData is not defined");const{order:o,domain:i,types:c,primaryType:l}=s;ct.onSignOrderRequest(o),(y=n==null?void 0:n.onSignOrderRequest)==null||y.call(n),console.log({domain:i,types:c,primaryType:l,message:o,account:e}),console.log("Using domain:",i),console.log("Using types:",c),console.log("Order data to sign:",JSON.stringify(o,null,2)),console.log(`Account address: ${e}`);let u;try{u=await(t==null?void 0:t.signTypedData({domain:i,types:c,primaryType:l,message:o,account:e}))}catch(v){throw(g=n==null?void 0:n.onSignOrderError)==null||g.call(n,v),ct.onSignOrderError(v),v}ct.onSignOrderSuccess(u),(E=n==null?void 0:n.onSignOrderSuccess)==null||E.call(n,u);const d=zL(u),f={v:q(d.v||0),r:d.r,s:d.s},m=await Th(o,f);return(w=n==null?void 0:n.onOrderCreated)==null||w.call(n,m),a(m),m}})},c5=()=>{const{account:e,publicClient:t,config:r}=ne();return xn({mutationFn:async({tokenAddress:n,srcAmountWei:s})=>{if(!t)throw new Error("missing publicClient");if(!e)throw new Error("missing account");if(!r)throw new Error("missing config");const a=await t.readContract({address:n,abi:wg,functionName:"allowance",args:[e,r.repermit]}).then(i=>i.toString()),o=j(a||"0").lt(j(s).toString());return{allowance:a,approvalRequired:o}}})},hW=()=>{const{account:e,walletClient:t,overrides:r,config:n,chainId:s,callbacks:a}=ne(),o=G0(),{mutateAsync:i}=c5();return xn({onError:c=>{ct.onApproveError(c)},mutationFn:async({token:c,onHash:l,srcAmountWei:u})=>{var y,g;if(!e)throw new Error("missing account");if(!t)throw new Error("missing walletClient");if(!n)throw new Error("missing config");(y=a==null?void 0:a.onApproveRequest)==null||y.call(a),ct.onApproveRequest();let d;if(r!=null&&r.approveOrder?d=await r.approveOrder({tokenAddress:c.address,spenderAddress:n.repermit,amount:Ls}):d=await t.writeContract({abi:wg,functionName:"approve",account:e,address:c.address,args:[n.repermit,Ls],chain:t.chain}),!d)throw new Error("failed to approve token");l(d);const f=await o(d);if(!f)throw new Error("failed to get transaction receipt");if(f.status==="reverted")throw new Error("failed to approve token");let m=!1;for(let E=0;E<3;E++){const{approvalRequired:w}=await i({tokenAddress:c.address,srcAmountWei:u});if(!w){m=!0;break}E<2&&await new Promise(v=>setTimeout(v,3e3))}if(!m)throw new Error(`Insufficient ${c.symbol} allowance to perform the swap. Please approve the token first.`);return ct.onApproveSuccess(f.transactionHash),(g=a==null?void 0:a.onApproveSuccess)==null||g.call(a,{txHash:f.transactionHash,explorerUrl:_o(f.transactionHash,s),token:c,amount:Xr(c.decimals,u)}),f}})},bW=()=>{const{account:e,chainId:t,srcToken:r,dstToken:n,module:s,slippage:a}=ne(),o=da(),i=Yr().amountWei,c=pn().amountPerTradeWei,l=gm(),u=ua().fillDelay,d=wm().amountWei,f=Z(m=>m.state.isMarketOrder);return xn({mutationFn:async()=>{ct.onRequestOrder({account:e,chainId:t,module:s,srcToken:r,dstToken:n,fromTokenAmount:i,srcChunkAmount:c,triggerPricePerTrade:o.pricePerChunkWei,deadline:l,fillDelay:u.unit*u.value,minDstAmountOutPerTrade:d,slippage:a,isMarketOrder:f||!1})}})};function yW(e){const t=e.message,r=t.match(/,\s*code\s*:\s*(\d+)/i);return{message:t.replace(/^error\s*:/i,"").replace(/,\s*code\s*:\s*\d+/i,"").trim()||"",code:r?Number(r[1]):0,error:e}}const gW=()=>{const{srcToken:e,dstToken:t,chainId:r,callbacks:n}=ne(),s=hW().mutateAsync,a=fW().mutateAsync,o=mW().mutateAsync,{mutateAsync:i}=c5(),c=Z(d=>d.updateSwapExecution),{amountWei:l}=Yr(),u=bW().mutate;return xn({mutationFn:async()=>{var f,m;const d=Is((e==null?void 0:e.address)||" ");try{if(!e)throw new Error("missing srcToken");if(!t)throw new Error("missing dstToken");if(!r)throw new Error("missing chainId");const y=u1(e,r);c({allowanceLoading:!0});const{approvalRequired:g}=await i({tokenAddress:y.address,srcAmountWei:l});let E=0,w=1;d&&w++,g&&w++,c({totalSteps:w,stepIndex:E,allowanceLoading:!1,status:kt.LOADING}),u(),d&&(c({step:Ds.WRAP}),await a({onHash:S=>c({wrapTxHash:S}),srcAmountWei:l}),E++,c({stepIndex:E})),g&&(c({step:Ds.APPROVE}),await s({token:y,onHash:S=>c({approveTxHash:S}),srcAmountWei:l}),E++,c({stepIndex:E})),c({step:Ds.CREATE});const v=await o();return c({status:kt.SUCCESS,orderId:v.id}),v}catch(y){if(Sd(y))(f=n==null?void 0:n.onSubmitOrderRejected)==null||f.call(n),c({step:void 0,status:void 0,stepIndex:void 0});else{const g=yW(y);(m=n==null?void 0:n.onSubmitOrderFailed)==null||m.call(n,g),c({status:kt.FAILED,error:g})}}}})},xW=()=>{const{marketPrice:e,srcToken:t,dstToken:r,marketPriceLoading:n,srcBalance:s,srcUsd1Token:a,noLiquidity:o}=ne(),i=Ue(),c=gW(),l=Z(h=>h.updateState),{amountUI:u,amountWei:d}=Yr(),f=Z(h=>h.resetState),m=Z(h=>h.state.swapExecution),y=Z(h=>h.state.typedSrcAmount),g=n||j(a||"0").isZero()||s===void 0||j(e||"0").isZero(),E=!!(t&&r&&y&&g),w=o5(),v=M.useMemo(()=>o?i("noLiquidity"):j(y||"0").isZero()?i("enterAmount"):(w==null?void 0:w.type)===Mt.INSUFFICIENT_BALANCE?i("insufficientFunds"):i("placeOrder"),[w,i,y,o]),S=M.useCallback(()=>{(m==null?void 0:m.status)===kt.SUCCESS&&(l({typedSrcAmount:""}),setTimeout(()=>{f()},1e3))},[m==null?void 0:m.status,f,l]),C=M.useCallback(()=>{(m==null?void 0:m.status)!==kt.LOADING&&l({acceptedSrcAmount:void 0,acceptedMarketPrice:void 0,swapExecution:{srcToken:t,dstToken:r}})},[l,t,r]),D=xn({mutationFn:async()=>(l({acceptedSrcAmount:u,acceptedMarketPrice:e}),await c.mutateAsync())}),L=M.useCallback(()=>D.mutateAsync(),[D]),T=s5();return M.useMemo(()=>({resetSwap:f,onCloseModal:S,onOpenModal:C,onSubmitOrder:L,...m,swapLoading:(m==null?void 0:m.status)===kt.LOADING||(m==null?void 0:m.allowanceLoading),swapSubmitted:!!(m!=null&&m.status),order:T,srcAmountWei:d,srcAmount:d,openSubmitModalButton:{disabled:!!(w||o||E||j(y||"0").isZero()||!t||!r),text:v,loading:E}}),[m,t,r,T,f,S,C,L,v,E,w,o,y])},l5=(e,t)=>{const{marketPriceLoading:r,srcToken:n,dstToken:s,srcBalance:a,dstBalance:o}=ne(),i=Z(C=>C.state.typedSrcAmount),c=Z(C=>C.updateState),{srcUsd1Token:l,dstUsd1Token:u}=ne(),d=aa(i,l),f=aa(t,u),m=CG(),y=e?n:s,g=Vr(y==null?void 0:y.decimals,e?a:o),E=a5(),w=M.useCallback(C=>{e&&c({typedSrcAmount:C})},[c,e]),v=M.useCallback(()=>{e&&c({typedSrcAmount:Do(g,8)})},[c,e,g]),S=m||e?i:Do(t||"",8);return{balance:g,usd:e||m?d:f,value:S||"",valueWei:Fu(y==null?void 0:y.decimals,S),onChange:w,onMax:v,isLoading:i?e?!1:r:!1,token:y,isInsufficientBalance:e?E:void 0}},wW=()=>l5(!0),vW=()=>{const e=gc().amountUI,t=Z(r=>r.state.typedSrcAmount);return l5(!1,t?e:"")},EW=()=>{const e=Z(n=>n.state.isMarketOrder),t=Z(n=>n.updateState),r=M.useCallback(()=>{t({isMarketOrder:!e})},[t,e]);return{isMarketPrice:!e,togglePrice:r}},u5=M.createContext({}),kW=({children:e,...t})=>B.jsx(u5.Provider,{value:t,children:e}),CW=()=>M.useContext(u5),d5=()=>{var s,a;const e=Ue(),{wrapTxHash:t,srcToken:r}=Z(o=>o.state.swapExecution),n=(a=(s=ac())==null?void 0:s.wToken)==null?void 0:a.symbol;return t?B.jsx("p",{className:"twap-error-wrap-msg",children:e("wrapMsg",{symbol:(r==null?void 0:r.symbol)||"",wSymbol:n||""})}):null},TW=(e=!1,t=1)=>{const{module:r}=ne(),n=Ue();return M.useMemo(()=>r===Ee.STOP_LOSS?n("stopLoss"):r===Ee.TAKE_PROFIT?n("takeProfit"):n(e?"twapMarket":t===1?"limit":"twapLimit"),[n,r,e,t])},SW=({price:e,dstTokenSymbol:t,label:r,usd:n})=>B.jsxs(xe.DetailRow,{title:r,children:[`${e||"-"} ${t||""}`,B.jsx(xe.USD,{value:n})]}),p5=()=>{const e=Ue(),t=Z(a=>a.state.isMarketOrder),r=Z(a=>a.state.swapExecution.status),{totalTrades:n}=pn(),s=TW(t,n);return r===kt.SUCCESS?e("createOrderActionSuccess",{name:s}):e("createOrderAction",{name:s})},AW=()=>{const e=Z(y=>y.state.swapExecution.srcToken),t=Ue(),{step:r,wrapTxHash:n,approveTxHash:s}=Z(y=>y.state.swapExecution),a=ac(),o=H0(n),i=H0(n),c=H0(s),l=Z(y=>y.state.swapExecution.status),d=Is((e==null?void 0:e.address)||"")?(a==null?void 0:a.native.symbol)||"":(e==null?void 0:e.symbol)||"",f=a==null?void 0:a.wToken.symbol,m=p5();return M.useMemo(()=>r===Ds.WRAP?{title:t("wrapAction",{symbol:d}),footerLink:o,footerText:t(o?"viewOnExplorer":"proceedInWallet")}:r===Ds.APPROVE?{title:t("approveAction",{symbol:d}),footerLink:c,footerText:t(c?"viewOnExplorer":"proceedInWallet")}:{title:m,footerText:l===kt.LOADING?t("proceedInWallet"):void 0},[r,c,d,m,t,o,i,f,l])},PW=({error:e})=>B.jsxs("div",{className:"twap-error",children:[B.jsx("h2",{className:"twap-error-title",children:"Transaction failed"}),(e==null?void 0:e.code)&&B.jsxs("p",{className:"twap-error-code",children:["Error code: ",e==null?void 0:e.code]}),B.jsx(d5,{})]});function IW({error:e}){const{components:t}=ne(),r=Ue(),n=Z(o=>{var i;return(i=o.state.swapExecution)==null?void 0:i.wrapTxHash}),s=t.SubmitOrderErrorView,a=B.jsx(Qn.Failed,{error:B.jsx(PW,{error:e}),footerLink:od,footerText:r("viewOnExplorer")});return s?B.jsx(s,{wrapTxHash:n,error:e,children:a}):a}const BW=()=>{const{components:e}=ne(),t=Z(f=>f.state.swapExecution.srcToken),r=Z(f=>f.state.swapExecution.dstToken),{reviewDetails:n}=CW(),s=Ue(),a=Z(f=>{var m;return!!((m=f.state.swapExecution)!=null&&m.status)}),o=s5(),i=Ge({value:o.srcAmountUsd,decimalScale:2}),c=Ge({value:o.dstAmountUsd,decimalScale:2}),l=e.USD,u=e.SubmitOrderMainView,d=B.jsxs(B.Fragment,{children:[B.jsx(Qn.Main,{fromTitle:s("from"),toTitle:s("to"),inUsd:l?B.jsx(l,{value:o.srcAmountUsd,isLoading:!1}):`$${i}`,outUsd:l?B.jsx(l,{value:o.dstAmountUsd,isLoading:!1}):`$${c}`}),!a&&B.jsxs("div",{className:"twap-create-order-bottom",children:[B.jsx(xe.Container,{children:B.jsxs("div",{className:"twap-create-order-details",children:[B.jsx(xe.Deadline,{deadline:o.display.deadline.value,label:o.display.deadline.label,tooltip:o.display.deadline.tooltip||""}),B.jsx(xe.TriggerPrice,{price:o.display.triggerPricePerTrade.value,dstToken:r,label:o.display.triggerPricePerTrade.label,tooltip:o.display.triggerPricePerTrade.tooltip||"",usd:o.display.triggerPricePerTrade.usd}),B.jsx(SW,{price:o.display.limitPrice.value,dstTokenSymbol:r==null?void 0:r.symbol,label:o.display.limitPrice.label,usd:o.display.limitPrice.usd}),B.jsx(xe.MinDestAmount,{dstToken:r,dstMinAmountOut:o.display.minDestAmountPerTrade.value,label:o.display.minDestAmountPerTrade.label,tooltip:o.display.minDestAmountPerTrade.tooltip||"",usd:o.display.minDestAmountPerTrade.usd}),B.jsx(xe.TradeSize,{tradeSize:o.display.tradeSize.value,trades:o.display.totalTrades.value,srcToken:t,label:o.display.tradeSize.label,tooltip:o.display.tradeSize.tooltip}),B.jsx(xe.TradesAmount,{trades:o.display.totalTrades.value,label:o.display.totalTrades.label,tooltip:o.display.totalTrades.tooltip}),B.jsx(xe.TradeInterval,{chunks:o.display.totalTrades.value,fillDelayMillis:o.display.tradeInterval.value,label:o.display.tradeInterval.label,tooltip:o.display.tradeInterval.tooltip}),B.jsx(xe.Recipient,{}),o.fee.amount&&B.jsx(xe.Fees,{fees:o.fee.amount,label:o.fee.label,usd:o.fee.usd,dstTokenSymbol:r==null?void 0:r.symbol})]})}),n]})]});return u?B.jsx(u,{children:d}):d},FW=e=>{const{status:t,stepIndex:r,totalSteps:n,error:s}=Z(v=>v.state.swapExecution),{components:a}=ne(),o=a.Spinner,i=a.SuccessIcon,c=a.ErrorIcon,l=a.TokenLogo,{srcToken:u,dstToken:d}=ne(),f=Yr().amountUI,m=gc().amountUI,y=Ge({value:f,decimalScale:2}),g=Ge({value:m,decimalScale:2}),E=M.useMemo(()=>({symbol:u==null?void 0:u.symbol,logoUrl:u==null?void 0:u.logoUrl}),[u]),w=M.useMemo(()=>({symbol:d==null?void 0:d.symbol,logoUrl:d==null?void 0:d.logoUrl}),[d]);return B.jsx(kW,{...e,children:B.jsx(Qn,{inAmount:y,outAmount:g,swapStatus:t,totalSteps:n,currentStep:AW(),currentStepIndex:r,inToken:E,outToken:w,components:{SrcTokenLogo:l&&B.jsx(l,{token:u}),DstTokenLogo:l&&B.jsx(l,{token:d}),Failed:B.jsx(IW,{error:s}),Success:B.jsx(UW,{}),Main:B.jsx(BW,{}),Loader:o,SuccessIcon:i,FailedIcon:c}})})},UW=()=>{const e=p5(),{components:t}=ne(),r=Z(a=>a.state.swapExecution.orderId),n=t.SubmitOrderSuccessView,s=B.jsxs(B.Fragment,{children:[B.jsx(Qn.Success,{title:e}),B.jsx(d5,{})]});return n?B.jsx(n,{newOrderId:r,children:s}):s},OW=()=>{const{supportedChains:e}=ne();return M.useMemo(()=>e,[e])},DW=()=>{const{config:e}=ne();return M.useMemo(()=>({spender:(e==null?void 0:e.repermit)??""}),[e])};Eh(Fw.version);const _W=()=>{const e=Z(t=>t.updateState);return{amount:Z(t=>t.state.typedSrcAmount),reset:M.useCallback(()=>e({typedSrcAmount:""}),[e])}},MW={SubmitOrderPanel:FW,Orders:YV};R.CRASH_ERROR_MESSAGE=ew,R.Components=MW,R.Configs=Dt,R.DEFAULT_DURATION_OPTIONS=ZL,R.DEFAULT_FILL_DELAY=Ic,R.DEFAULT_STOP_LOSS_LIMIT_PERCENTAGE=Qm,R.DEFAULT_STOP_LOSS_PERCENTAGE=Zm,R.DEFAULT_TAKE_PROFIT_LIMIT_PERCENTAGE=Jm,R.DEFAULT_TAKE_PROFIT_PERCENTAGE=Xm,R.DISCLAIMER_URL=J5,R.EIP712_TYPES=Km,R.ERC20_ABI=M5,R.EXCLUSIVITY_OVERRIDE_BPS=Y5,R.FEES=q5,R.IWETH_ABI=Om,R.InputErrors=Mt,R.LEGACY_EXCHANGES_MAP=qm,R.MAX_ORDER_DURATION_MILLIS=Ca,R.MIN_CHUNKS=V5,R.MIN_FILL_DELAY_MILLIS=Pc,R.MIN_FILL_DELAY_MINUTES=$m,R.MIN_ORDER_DURATION_MILLIS=ad,R.Module=Ee,R.ORBS_LOGO=Z5,R.ORBS_LOGO_FALLBACK=X5,R.ORBS_SLTP_FAQ_URL=K5,R.ORBS_TWAP_FAQ_URL=od,R.ORBS_WEBSITE_URL=Q5,R.OrderStatus=ut,R.OrderType=dt,R.PRICE_PROTECTION_SETTINGS=XL,R.Partners=Mm,R.QUERY_PARAMS=Bc,R.REPERMIT_ABI=Dm,R.REPERMIT_PRIMARY_TYPE=Ym,R.SUGGEST_CHUNK_VALUE=j5,R.SpotProvider=YL,R.Steps=Ds,R.SwapStatus=kt,R.THE_GRAPH_ORDERS_API=jm,R.TWAP_ABI=_m,R.TimeUnit=Gt,R.amountBN=Ac,R.amountUi=Xr,R.analytics=ct,R.buildRePermitOrderData=wh,R.copy=D3,R.ensureWrappedToken=u1,R.eqIgnoreCase=Ps,R.fillDelayText=i1,R.formatDecimals=Do,R.getAccountOrders=Ih,R.getApiEndpoint=sd,R.getChunks=oh,R.getConfig=ld,R.getDeadline=ch,R.getDestTokenAmount=rh,R.getDestTokenMinAmountPerChunk=nh,R.getDuration=ah,R.getEstimatedDelayBetweenChunksMillis=cd,R.getExplorerUrl=_o,R.getMaxChunksError=gh,R.getMaxFillDelayError=ow,R.getMaxOrderDurationError=mh,R.getMaxPossibleChunks=ih,R.getMinFillDelayError=bh,R.getMinNativeBalance=M3,R.getMinOrderDurationError=hh,R.getMinTradeSizeError=yh,R.getMinimumDelayMinutes=aw,R.getNetwork=Bs,R.getOrderExcecutionRate=c1,R.getOrderFillDelayMillis=td,R.getOrderLimitPriceRate=l1,R.getOrderType=N3,R.getPartnerChains=Rm,R.getPartnerIdentifier=_t,R.getPartners=xh,R.getQueryParam=Fo,R.getSrcTokenChunkAmount=lh,R.getStopLossLimitPriceError=ph,R.getStopLossPriceError=uh,R.getTakeProfitLimitPriceError=fh,R.getTakeProfitPriceError=dh,R.getTriggerPricePerChunk=sh,R.isNativeAddress=Is,R.isTxRejected=Sd,R.makeElipsisAddress=Td,R.maxUint256=W5,R.millisToDays=d1,R.millisToMinutes=Ad,R.nativeTokenAddresses=Wm,R.networks=Ft,R.parseError=_3,R.removeCommas=O3,R.setApiMode=G5,R.setUIVersion=Eh,R.shouldUnwrapOnly=Id,R.shouldWrapOnly=Pd,R.submitOrder=Th,R.useAddresses=DW,R.useBuildRePermitOrderDataCallback=i5,R.useDisclaimerPanel=rW,R.useDstTokenPanel=vW,R.useDurationPanel=tW,R.useFillDelayPanel=ZV,R.useFormatNumber=Ge,R.useInputErrors=o5,R.useInvertTradePanel=Vu,R.useLimitPricePanel=lW,R.useMarketPricePanel=JV,R.useOrderHistoryPanel=WG,R.useSrcTokenPanel=wW,R.useSubmitSwapPanel=xW,R.useSupportedChains=OW,R.useTogglePricePanel=EW,R.useTradesPanel=QV,R.useTranslations=Ue,R.useTriggerPricePanel=oW,R.useTypedSrcAmount=_W,R.zeroAddress=Vm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));