@orbs-network/spot-react 0.0.22 → 0.0.23

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,Ea){"use strict";var VW=Object.defineProperty;var B5=R=>{throw TypeError(R)};var WW=(R,M,B)=>M in R?VW(R,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[M]=B;var Yu=(R,M,B)=>WW(R,typeof M!="symbol"?M+"":M,B),km=(R,M,B)=>M.has(R)||B5("Cannot "+B);var N=(R,M,B)=>(km(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,Ea)=>(km(R,M,"write to private field"),Ea?Ea.call(R,B):M.set(R,B),B),Se=(R,M,B)=>(km(R,M,"access private method"),B);var Ku=(R,M,B,Ea)=>({set _(Xu){ee(R,M,Xu,B)},get _(){return N(R,M,Ea)}});var fr,pa,f5,fa,gs,go,m5,xo,xs,wo,h5,ma,b5,ha,vo,On,ba,Bt,wc,ya,Zn,Yr,y5,sn,Ue,vc,qt,ga,ko,Gr,ws,kc,Eo,To,xa,wa,vs,Co,Ve,Cc,Em,Tm,Cm,Am,Sm,Im,Pm,O5,g5,Ec,mr,Yt,va,hr,As,x5,jr,Xn,Tc,w5,Vr,ks,an,Wr,qr,Zu,Bm,v5,br,k5,ft,Es,Ts,Ao,So,Cs,Io,Po,E5;function Xu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}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"}},F5=[{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"}],U5=[{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('[{"type":"constructor","inputs":[{"name":"_repermit","type":"address","internalType":"address"},{"name":"_cosigner","type":"address","internalType":"address"},{"name":"_wm","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"cosigner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"epochs","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"executeWithCallback","inputs":[{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"pause","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"paused","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"repermit","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"unpause","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"wm","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"event","name":"Fill","inputs":[{"name":"hash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"executor","type":"address","indexed":true,"internalType":"address"},{"name":"swapper","type":"address","indexed":true,"internalType":"address"},{"name":"epoch","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"name":"account","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"name":"account","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"error","name":"CosignedExceedsStop","inputs":[]},{"type":"error","name":"EnforcedPause","inputs":[]},{"type":"error","name":"ExpectedPause","inputs":[]},{"type":"error","name":"FailedCall","inputs":[]},{"type":"error","name":"FutureCosignatureTimestamp","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[{"name":"balance","type":"uint256","internalType":"uint256"},{"name":"needed","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidCosignature","inputs":[]},{"type":"error","name":"InvalidCosignatureChainid","inputs":[]},{"type":"error","name":"InvalidCosignatureCosigner","inputs":[]},{"type":"error","name":"InvalidCosignatureInputToken","inputs":[]},{"type":"error","name":"InvalidCosignatureOutputToken","inputs":[]},{"type":"error","name":"InvalidCosignatureReactor","inputs":[]},{"type":"error","name":"InvalidCosignatureZeroInputValue","inputs":[]},{"type":"error","name":"InvalidCosignatureZeroOutputValue","inputs":[]},{"type":"error","name":"InvalidEpoch","inputs":[]},{"type":"error","name":"InvalidFreshness","inputs":[]},{"type":"error","name":"InvalidFreshnessVsEpoch","inputs":[]},{"type":"error","name":"InvalidOrderAdapterZero","inputs":[]},{"type":"error","name":"InvalidOrderChainid","inputs":[]},{"type":"error","name":"InvalidOrderDeadlineExpired","inputs":[]},{"type":"error","name":"InvalidOrderExchangeShareBps","inputs":[]},{"type":"error","name":"InvalidOrderExecutorZero","inputs":[]},{"type":"error","name":"InvalidOrderInputAmountGtMax","inputs":[]},{"type":"error","name":"InvalidOrderInputAmountZero","inputs":[]},{"type":"error","name":"InvalidOrderInputTokenZero","inputs":[]},{"type":"error","name":"InvalidOrderOutputLimitGtStop","inputs":[]},{"type":"error","name":"InvalidOrderOutputRecipientZero","inputs":[]},{"type":"error","name":"InvalidOrderReactorMismatch","inputs":[]},{"type":"error","name":"InvalidOrderReactorZero","inputs":[]},{"type":"error","name":"InvalidOrderSameToken","inputs":[]},{"type":"error","name":"InvalidOrderSlippageTooHigh","inputs":[]},{"type":"error","name":"InvalidOrderSwapperZero","inputs":[]},{"type":"error","name":"InvalidSender","inputs":[]},{"type":"error","name":"NotAllowed","inputs":[]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"StaleCosignature","inputs":[]}]'),_5=JSON.parse('[{"type":"constructor","inputs":[{"name":"_reactor","type":"address","internalType":"address"},{"name":"_allowed","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"execute","inputs":[{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"reactor","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"reactorCallback","inputs":[{"name":"hash","type":"bytes32","internalType":"bytes32"},{"name":"resolvedAmountOut","type":"uint256","internalType":"uint256"},{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"wm","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"event","name":"Settled","inputs":[{"name":"orderHash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"swapper","type":"address","indexed":true,"internalType":"address"},{"name":"exchange","type":"address","indexed":true,"internalType":"address"},{"name":"inToken","type":"address","indexed":false,"internalType":"address"},{"name":"outToken","type":"address","indexed":false,"internalType":"address"},{"name":"inAmount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"outAmount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"minOut","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Surplus","inputs":[{"name":"ref","type":"address","indexed":true,"internalType":"address"},{"name":"swapper","type":"address","indexed":false,"internalType":"address"},{"name":"token","type":"address","indexed":false,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"refshare","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"AddressEmptyCode","inputs":[{"name":"target","type":"address","internalType":"address"}]},{"type":"error","name":"FailedCall","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[{"name":"balance","type":"uint256","internalType":"uint256"},{"name":"needed","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidOrder","inputs":[]},{"type":"error","name":"InvalidSender","inputs":[]},{"type":"error","name":"NotAllowed","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"name":"token","type":"address","internalType":"address"}]}]'),M5=[{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"}]}],N5=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"}]'),L5=JSON.parse('[{"inputs":[{"internalType":"contract TWAP","name":"_twap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"uint256","name":"srcBidAmountNext","type":"uint256"}],"name":"hasAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"uint256","name":"srcBidAmountNext","type":"uint256"}],"name":"hasBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"makerOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint64","name":"lastIndex","type":"uint64"},{"internalType":"uint64","name":"pageSize","type":"uint64"}],"name":"takerBiddableOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint64","name":"lastIndex","type":"uint64"},{"internalType":"uint64","name":"pageSize","type":"uint64"}],"name":"takerFillableOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twap","outputs":[{"internalType":"contract TWAP","name":"","type":"address"}],"stateMutability":"view","type":"function"}]'),z5=D5,R5=_5,Um=M5,Dm=F5,H5=U5,_m=N5,$5=L5;var ke=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(ke||{}),Qe=(e=>(e.Open="OPEN",e.Canceled="CANCELED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(Qe||{}),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",Ot={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 G5=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Qu=Math.ceil,xn=Math.floor,Kt="[BigNumber Error] ",Nm=Kt+"Number primitive has more than 15 significant digits: ",Un=1e14,ge=14,Ju=9007199254740991,ed=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Kr=1e7,St=1e9;function Lm(e){var t,n,r,s=w.prototype={constructor:w,toString:null,valueOf:null},a=new w(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:""},k="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function w(h,b){var x,S,P,O,_,E,I,U,F=this;if(!(F instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){F.s=h.s,!h.c||h.e>d?F.c=F.e=null:h.e<u?F.c=[F.e=0]:(F.e=h.e,F.c=h.c.slice());return}if((E=typeof h=="number")&&h*0==0){if(F.s=1/h<0?(h=-h,-1):1,h===~~h){for(O=0,_=h;_>=10;_/=10,O++);O>d?F.c=F.e=null:(F.e=O,F.c=[h]);return}U=String(h)}else{if(!G5.test(U=String(h)))return r(F,U,E);F.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}(O=U.indexOf("."))>-1&&(U=U.replace(".","")),(_=U.search(/e/i))>0?(O<0&&(O=_),O+=+U.slice(_+1),U=U.substring(0,_)):O<0&&(O=U.length)}else{if(ct(b,2,k.length,"Base"),b==10&&v)return F=new w(h),L(F,o+F.e+1,i);if(U=String(h),E=typeof h=="number"){if(h*0!=0)return r(F,U,E,b);if(F.s=1/h<0?(U=U.slice(1),-1):1,w.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(Nm+h)}else F.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(x=k.slice(0,b),O=_=0,I=U.length;_<I;_++)if(x.indexOf(S=U.charAt(_))<0){if(S=="."){if(_>O){O=I;continue}}else if(!P&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){P=!0,_=-1,O=0;continue}return r(F,String(h),E,b)}E=!1,U=n(U,b,10,F.s),(O=U.indexOf("."))>-1?U=U.replace(".",""):O=U.length}for(_=0;U.charCodeAt(_)===48;_++);for(I=U.length;U.charCodeAt(--I)===48;);if(U=U.slice(_,++I)){if(I-=_,E&&w.DEBUG&&I>15&&(h>Ju||h!==xn(h)))throw Error(Nm+F.s*h);if((O=O-_-1)>d)F.c=F.e=null;else if(O<u)F.c=[F.e=0];else{if(F.e=O,F.c=[],_=(O+1)%ge,O<0&&(_+=ge),_<I){for(_&&F.c.push(+U.slice(0,_)),I-=ge;_<I;)F.c.push(+U.slice(_,_+=ge));_=ge-(U=U.slice(_)).length}else _-=I;for(;_--;U+="0");F.c.push(+U)}}else F.c=[F.e=0]}w.clone=Lm,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],ct(x,0,St,b),o=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ct(x,0,8,b),i=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ct(x[0],-St,0,b),ct(x[1],0,St,b),c=x[0],l=x[1]):(ct(x,-St,St,b),c=-(l=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ct(x[0],-St,-1,b),ct(x[1],1,St,b),u=x[0],d=x[1];else if(ct(x,-St,St,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],ct(x,0,9,b),m=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ct(x,0,St,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))v=x.slice(0,10)=="0123456789",k=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:k}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,S=h.c,P=h.e,O=h.s;e:if({}.toString.call(S)=="[object Array]"){if((O===1||O===-1)&&P>=-St&&P<=St&&P===xn(P)){if(S[0]===0){if(P===0&&S.length===1)return!0;break e}if(b=(P+1)%ge,b<1&&(b+=ge),String(S[0]).length==b){for(b=0;b<S.length;b++)if(x=S[b],x<0||x>=Un||x!==xn(x))break e;if(x!==0)return!0}}}else if(S===null&&P===null&&(O===null||O===1||O===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return xn(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var S,P,O,_,E,I=0,U=[],F=new w(a);if(x==null?x=o:ct(x,0,St),_=Qu(x/ge),f)if(crypto.getRandomValues){for(S=crypto.getRandomValues(new Uint32Array(_*=2));I<_;)E=S[I]*131072+(S[I+1]>>>11),E>=9e15?(P=crypto.getRandomValues(new Uint32Array(2)),S[I]=P[0],S[I+1]=P[1]):(U.push(E%1e14),I+=2);I=_/2}else if(crypto.randomBytes){for(S=crypto.randomBytes(_*=7);I<_;)E=(S[I]&31)*281474976710656+S[I+1]*1099511627776+S[I+2]*4294967296+S[I+3]*16777216+(S[I+4]<<16)+(S[I+5]<<8)+S[I+6],E>=9e15?crypto.randomBytes(7).copy(S,I):(U.push(E%1e14),I+=7);I=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;I<_;)E=b(),E<9e15&&(U[I++]=E%1e14);for(_=U[--I],x%=ge,_&&x&&(E=ed[ge-x],U[I]=xn(_/E)*E);U[I]===0;U.pop(),I--);if(I<0)U=[O=0];else{for(O=-1;U[0]===0;U.splice(0,1),O-=ge);for(I=1,E=U[0];E>=10;E/=10,I++);I<ge&&(O-=ge-I)}return F.e=O,F.c=U,F}})(),w.sum=function(){for(var h=1,b=arguments,x=new w(b[0]);h<b.length;)x=x.plus(b[h++]);return x},n=(function(){var h="0123456789";function b(x,S,P,O){for(var _,E=[0],I,U=0,F=x.length;U<F;){for(I=E.length;I--;E[I]*=S);for(E[0]+=O.indexOf(x.charAt(U++)),_=0;_<E.length;_++)E[_]>P-1&&(E[_+1]==null&&(E[_+1]=0),E[_+1]+=E[_]/P|0,E[_]%=P)}return E.reverse()}return function(x,S,P,O,_){var E,I,U,F,z,H,G,J,pe=x.indexOf("."),he=o,ie=i;for(pe>=0&&(F=y,y=0,x=x.replace(".",""),J=new w(S),H=J.pow(x.length-pe),y=F,J.c=b(yr(vn(H.c),H.e,"0"),10,P,h),J.e=J.c.length),G=b(x,S,P,_?(E=k,h):(E=h,k)),U=F=G.length;G[--F]==0;G.pop());if(!G[0])return E.charAt(0);if(pe<0?--U:(H.c=G,H.e=U,H.s=O,H=t(H,J,he,ie,P),G=H.c,z=H.r,U=H.e),I=U+he+1,pe=G[I],F=P/2,z=z||I<0||G[I+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>F||pe==F&&(ie==4||z||ie==6&&G[I-1]&1||ie==(H.s<0?8:7)),I<1||!G[0])x=z?yr(E.charAt(1),-he,E.charAt(0)):E.charAt(0);else{if(G.length=I,z)for(--P;++G[--I]>P;)G[I]=0,I||(++U,G=[1].concat(G));for(F=G.length;!G[--F];);for(pe=0,x="";pe<=F;x+=E.charAt(G[pe++]));x=yr(x,U,E.charAt(0))}return x}})(),t=(function(){function h(S,P,O){var _,E,I,U,F=0,z=S.length,H=P%Kr,G=P/Kr|0;for(S=S.slice();z--;)I=S[z]%Kr,U=S[z]/Kr|0,_=G*I+U*H,E=H*I+_%Kr*Kr+F,F=(E/O|0)+(_/Kr|0)+G*U,S[z]=E%O;return F&&(S=[F].concat(S)),S}function b(S,P,O,_){var E,I;if(O!=_)I=O>_?1:-1;else for(E=I=0;E<O;E++)if(S[E]!=P[E]){I=S[E]>P[E]?1:-1;break}return I}function x(S,P,O,_){for(var E=0;O--;)S[O]-=E,E=S[O]<P[O]?1:0,S[O]=E*_+S[O]-P[O];for(;!S[0]&&S.length>1;S.splice(0,1));}return function(S,P,O,_,E){var I,U,F,z,H,G,J,pe,he,ie,de,Be,Q,we,De,$e,it,Ae=S.s==P.s?1:-1,ve=S.c,be=P.c;if(!ve||!ve[0]||!be||!be[0])return new w(!S.s||!P.s||(ve?be&&ve[0]==be[0]:!be)?NaN:ve&&ve[0]==0||!be?Ae*0:Ae/0);for(pe=new w(Ae),he=pe.c=[],U=S.e-P.e,Ae=O+U+1,E||(E=Un,U=wn(S.e/ge)-wn(P.e/ge),Ae=Ae/ge|0),F=0;be[F]==(ve[F]||0);F++);if(be[F]>(ve[F]||0)&&U--,Ae<0)he.push(1),z=!0;else{for(we=ve.length,$e=be.length,F=0,Ae+=2,H=xn(E/(be[0]+1)),H>1&&(be=h(be,H,E),ve=h(ve,H,E),$e=be.length,we=ve.length),Q=$e,ie=ve.slice(0,$e),de=ie.length;de<$e;ie[de++]=0);it=be.slice(),it=[0].concat(it),De=be[0],be[1]>=E/2&&De++;do{if(H=0,I=b(be,ie,$e,de),I<0){if(Be=ie[0],$e!=de&&(Be=Be*E+(ie[1]||0)),H=xn(Be/De),H>1)for(H>=E&&(H=E-1),G=h(be,H,E),J=G.length,de=ie.length;b(G,ie,J,de)==1;)H--,x(G,$e<J?it:be,J,E),J=G.length,I=1;else H==0&&(I=H=1),G=be.slice(),J=G.length;if(J<de&&(G=[0].concat(G)),x(ie,G,de,E),de=ie.length,I==-1)for(;b(be,ie,$e,de)<1;)H++,x(ie,$e<de?it:be,de,E),de=ie.length}else I===0&&(H++,ie=[0]);he[F++]=H,ie[0]?ie[de++]=ve[Q]||0:(ie=[ve[Q]],de=1)}while((Q++<we||ie[0]!=null)&&Ae--);z=ie[0]!=null,he[0]||he.splice(0,1)}if(E==Un){for(F=1,Ae=he[0];Ae>=10;Ae/=10,F++);L(pe,O+(pe.e=F+U*ge-1)+1,_,z)}else pe.e=U,pe.r=+z;return pe}})();function A(h,b,x,S){var P,O,_,E,I;if(x==null?x=i:ct(x,0,8),!h.c)return h.toString();if(P=h.c[0],_=h.e,b==null)I=vn(h.c),I=S==1||S==2&&(_<=c||_>=l)?Sc(I,_):yr(I,_,"0");else if(h=L(new w(h),b,x),O=h.e,I=vn(h.c),E=I.length,S==1||S==2&&(b<=O||O<=c)){for(;E<b;I+="0",E++);I=Sc(I,O)}else if(b-=_+(S===2&&O>_),I=yr(I,O,"0"),O+1>E){if(--b>0)for(I+=".";b--;I+="0");}else if(b+=O-E,b>0)for(O+1==E&&(I+=".");b--;I+="0");return h.s<0&&P?"-"+I:I}function T(h,b){for(var x,S,P=1,O=new w(h[0]);P<h.length;P++)S=new w(h[P]),(!S.s||(x=Ss(O,S))===b||x===0&&O.s===b)&&(O=S);return O}function D(h,b,x){for(var S=1,P=b.length;!b[--P];b.pop());for(P=b[0];P>=10;P/=10,S++);return(x=S+x*ge-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,_,E,I){var U,F=E?_:_.replace(P,"");if(S.test(F))O.s=isNaN(F)?null:F<0?-1:1;else{if(!E&&(F=F.replace(h,function(z,H,G){return U=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!I||I==U?H:z}),I&&(U=I,F=F.replace(b,"$1").replace(x,"0.$1")),_!=F))return new w(F,U);if(w.DEBUG)throw Error(Kt+"Not a"+(I?" base "+I:"")+" number: "+_);O.s=null}O.c=O.e=null}})();function L(h,b,x,S){var P,O,_,E,I,U,F,z=h.c,H=ed;if(z){e:{for(P=1,E=z[0];E>=10;E/=10,P++);if(O=b-P,O<0)O+=ge,_=b,I=z[U=0],F=xn(I/H[P-_-1]%10);else if(U=Qu((O+1)/ge),U>=z.length)if(S){for(;z.length<=U;z.push(0));I=F=0,P=1,O%=ge,_=O-ge+1}else break e;else{for(I=E=z[U],P=1;E>=10;E/=10,P++);O%=ge,_=O-ge+P,F=_<0?0:xn(I/H[P-_-1]%10)}if(S=S||b<0||z[U+1]!=null||(_<0?I:I%H[P-_-1]),S=x<4?(F||S)&&(x==0||x==(h.s<0?3:2)):F>5||F==5&&(x==4||S||x==6&&(O>0?_>0?I/H[P-_]:0:z[U-1])%10&1||x==(h.s<0?8:7)),b<1||!z[0])return z.length=0,S?(b-=h.e+1,z[0]=H[(ge-b%ge)%ge],h.e=-b||0):z[0]=h.e=0,h;if(O==0?(z.length=U,E=1,U--):(z.length=U+1,E=H[ge-O],z[U]=_>0?xn(I/H[P-_]%H[_])*E:0),S)for(;;)if(U==0){for(O=1,_=z[0];_>=10;_/=10,O++);for(_=z[0]+=E,E=1;_>=10;_/=10,E++);O!=E&&(h.e++,z[0]==Un&&(z[0]=1));break}else{if(z[U]+=E,z[U]!=Un)break;z[U--]=0,E=1}for(O=z.length;z[--O]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function C(h){var b,x=h.e;return x===null?h.toString():(b=vn(h.c),b=x<=c||x>=l?Sc(b,x):yr(b,x,"0"),h.s<0?"-"+b:b)}return s.absoluteValue=s.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,b){return Ss(this,new w(h,b))},s.decimalPlaces=s.dp=function(h,b){var x,S,P,O=this;if(h!=null)return ct(h,0,St),b==null?b=i:ct(b,0,8),L(new w(O),h+O.e+1,b);if(!(x=O.c))return null;if(S=((P=x.length-1)-wn(this.e/ge))*ge,P=x[P])for(;P%10==0;P/=10,S--);return S<0&&(S=0),S},s.dividedBy=s.div=function(h,b){return t(this,new w(h,b),o,i)},s.dividedToIntegerBy=s.idiv=function(h,b){return t(this,new w(h,b),0,1)},s.exponentiatedBy=s.pow=function(h,b){var x,S,P,O,_,E,I,U,F,z=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+C(h));if(b!=null&&(b=new w(b)),E=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return F=new w(Math.pow(+C(z),E?h.s*(2-Ac(h)):+C(h))),b?F.mod(b):F;if(I=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);S=!I&&z.isInteger()&&b.isInteger(),S&&(z=z.mod(b))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||E&&z.c[1]>=24e7:z.c[0]<8e13||E&&z.c[0]<=9999975e7)))return O=z.s<0&&Ac(h)?-0:0,z.e>-1&&(O=1/O),new w(I?1/O:O);y&&(O=Qu(y/ge+2))}for(E?(x=new w(.5),I&&(h.s=1),U=Ac(h)):(P=Math.abs(+C(h)),U=P%2),F=new w(a);;){if(U){if(F=F.times(z),!F.c)break;O?F.c.length>O&&(F.c.length=O):S&&(F=F.mod(b))}if(P){if(P=xn(P/2),P===0)break;U=P%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)U=Ac(h);else{if(P=+C(h),P===0)break;U=P%2}z=z.times(z),O?z.c&&z.c.length>O&&(z.c.length=O):S&&(z=z.mod(b))}return S?F:(I&&(F=a.div(F)),b?F.mod(b):O?L(F,y,i,_):F)},s.integerValue=function(h){var b=new w(this);return h==null?h=i:ct(h,0,8),L(b,b.e+1,h)},s.isEqualTo=s.eq=function(h,b){return Ss(this,new w(h,b))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,b){return Ss(this,new w(h,b))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,b){return(b=Ss(this,new w(h,b)))===1||b===0},s.isInteger=function(){return!!this.c&&wn(this.e/ge)>this.c.length-2},s.isLessThan=s.lt=function(h,b){return Ss(this,new w(h,b))<0},s.isLessThanOrEqualTo=s.lte=function(h,b){return(b=Ss(this,new w(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,S,P,O,_=this,E=_.s;if(h=new w(h,b),b=h.s,!E||!b)return new w(NaN);if(E!=b)return h.s=-b,_.plus(h);var I=_.e/ge,U=h.e/ge,F=_.c,z=h.c;if(!I||!U){if(!F||!z)return F?(h.s=-b,h):new w(z?_:NaN);if(!F[0]||!z[0])return z[0]?(h.s=-b,h):new w(F[0]?_:i==3?-0:0)}if(I=wn(I),U=wn(U),F=F.slice(),E=I-U){for((O=E<0)?(E=-E,P=F):(U=I,P=z),P.reverse(),b=E;b--;P.push(0));P.reverse()}else for(S=(O=(E=F.length)<(b=z.length))?E:b,E=b=0;b<S;b++)if(F[b]!=z[b]){O=F[b]<z[b];break}if(O&&(P=F,F=z,z=P,h.s=-h.s),b=(S=z.length)-(x=F.length),b>0)for(;b--;F[x++]=0);for(b=Un-1;S>E;){if(F[--S]<z[S]){for(x=S;x&&!F[--x];F[x]=b);--F[x],F[S]+=Un}F[S]-=z[S]}for(;F[0]==0;F.splice(0,1),--U);return F[0]?D(h,F,U):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,b){var x,S,P=this;return h=new w(h,b),!P.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||P.c&&!P.c[0]?new w(P):(m==9?(S=h.s,h.s=1,x=t(P,h,0,3),h.s=S,x.s*=S):x=t(P,h,0,m),h=P.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=P.s),h)},s.multipliedBy=s.times=function(h,b){var x,S,P,O,_,E,I,U,F,z,H,G,J,pe,he,ie=this,de=ie.c,Be=(h=new w(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(S=wn(ie.e/ge)+wn(h.e/ge),h.s*=ie.s,I=de.length,z=Be.length,I<z&&(J=de,de=Be,Be=J,P=I,I=z,z=P),P=I+z,J=[];P--;J.push(0));for(pe=Un,he=Kr,P=z;--P>=0;){for(x=0,H=Be[P]%he,G=Be[P]/he|0,_=I,O=P+_;O>P;)U=de[--_]%he,F=de[_]/he|0,E=G*U+F*H,U=H*U+E%he*he+J[O]+x,x=(U/pe|0)+(E/he|0)+G*F,J[O--]=U%pe;J[O]=x}return x?++S:J.splice(0,1),D(h,J,S)},s.negated=function(){var h=new w(this);return h.s=-h.s||null,h},s.plus=function(h,b){var x,S=this,P=S.s;if(h=new w(h,b),b=h.s,!P||!b)return new w(NaN);if(P!=b)return h.s=-b,S.minus(h);var O=S.e/ge,_=h.e/ge,E=S.c,I=h.c;if(!O||!_){if(!E||!I)return new w(P/0);if(!E[0]||!I[0])return I[0]?h:new w(E[0]?S:P*0)}if(O=wn(O),_=wn(_),E=E.slice(),P=O-_){for(P>0?(_=O,x=I):(P=-P,x=E),x.reverse();P--;x.push(0));x.reverse()}for(P=E.length,b=I.length,P-b<0&&(x=I,I=E,E=x,b=P),P=0;b;)P=(E[--b]=E[b]+I[b]+P)/Un|0,E[b]=Un===E[b]?0:E[b]%Un;return P&&(E=[P].concat(E),++_),D(h,E,_)},s.precision=s.sd=function(h,b){var x,S,P,O=this;if(h!=null&&h!==!!h)return ct(h,1,St),b==null?b=i:ct(b,0,8),L(new w(O),h,b);if(!(x=O.c))return null;if(P=x.length-1,S=P*ge+1,P=x[P]){for(;P%10==0;P/=10,S--);for(P=x[0];P>=10;P/=10,S++);}return h&&O.e+1>S&&(S=O.e+1),S},s.shiftedBy=function(h){return ct(h,-Ju,Ju),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,b,x,S,P,O=this,_=O.c,E=O.s,I=O.e,U=o+4,F=new w("0.5");if(E!==1||!_||!_[0])return new w(!E||E<0&&(!_||_[0])?NaN:_?O:1/0);if(E=Math.sqrt(+C(O)),E==0||E==1/0?(b=vn(_),(b.length+I)%2==0&&(b+="0"),E=Math.sqrt(+b),I=wn((I+1)/2)-(I<0||I%2),E==1/0?b="5e"+I:(b=E.toExponential(),b=b.slice(0,b.indexOf("e")+1)+I),x=new w(b)):x=new w(E+""),x.c[0]){for(I=x.e,E=I+U,E<3&&(E=0);;)if(P=x,x=F.times(P.plus(t(O,P,U,1))),vn(P.c).slice(0,E)===(b=vn(x.c)).slice(0,E))if(x.e<I&&--E,b=b.slice(E-3,E+1),b=="9999"||!S&&b=="4999"){if(!S&&(L(P,P.e+o+2,0),P.times(P).eq(O))){x=P;break}U+=4,E+=4,S=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(O));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,b){return h!=null&&(ct(h,0,St),h++),A(this,h,b,1)},s.toFixed=function(h,b){return h!=null&&(ct(h,0,St),h=h+this.e+1),A(this,h,b)},s.toFormat=function(h,b,x){var S,P=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(S=P.toFixed(h,b),P.c){var O,_=S.split("."),E=+x.groupSize,I=+x.secondaryGroupSize,U=x.groupSeparator||"",F=_[0],z=_[1],H=P.s<0,G=H?F.slice(1):F,J=G.length;if(I&&(O=E,E=I,I=O,J-=O),E>0&&J>0){for(O=J%E||E,F=G.substr(0,O);O<J;O+=E)F+=U+G.substr(O,E);I>0&&(F+=U+G.slice(O)),H&&(F="-"+F)}S=z?F+(x.decimalSeparator||"")+((I=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):F}return(x.prefix||"")+S+(x.suffix||"")},s.toFraction=function(h){var b,x,S,P,O,_,E,I,U,F,z,H,G=this,J=G.c;if(h!=null&&(E=new w(h),!E.isInteger()&&(E.c||E.s!==1)||E.lt(a)))throw Error(Kt+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+C(E));if(!J)return new w(G);for(b=new w(a),U=x=new w(a),S=I=new w(a),H=vn(J),O=b.e=H.length-G.e-1,b.c[0]=ed[(_=O%ge)<0?ge+_:_],h=!h||E.comparedTo(b)>0?O>0?b:U:E,_=d,d=1/0,E=new w(H),I.c[0]=0;F=t(E,b,0,1),P=x.plus(F.times(S)),P.comparedTo(h)!=1;)x=S,S=P,U=I.plus(F.times(P=U)),I=P,b=E.minus(F.times(P=b)),E=P;return P=t(h.minus(x),S,0,1),I=I.plus(P.times(U)),x=x.plus(P.times(S)),I.s=U.s=G.s,O=O*2,z=t(U,S,O,i).minus(G).abs().comparedTo(t(I,x,O,i).minus(G).abs())<1?[U,S]:[I,x],d=_,z},s.toNumber=function(){return+C(this)},s.toPrecision=function(h,b){return h!=null&&ct(h,1,St),A(this,h,b,2)},s.toString=function(h){var b,x=this,S=x.s,P=x.e;return P===null?S?(b="Infinity",S<0&&(b="-"+b)):b="NaN":(h==null?b=P<=c||P>=l?Sc(vn(x.c),P):yr(vn(x.c),P,"0"):h===10&&v?(x=L(new w(x),o+P+1,i),b=yr(vn(x.c),x.e,"0")):(ct(h,2,k.length,"Base"),b=n(yr(vn(x.c),P,"0"),10,h,S,!0)),S<0&&x.c[0]&&(b="-"+b)),b},s.valueOf=s.toJSON=function(){return C(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&w.set(e),w}function wn(e){var t=e|0;return e>0||e===t?t:t-1}function vn(e){for(var t,n,r=1,s=e.length,a=e[0]+"";r<s;){for(t=e[r++]+"",n=ge-t.length;n--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function Ss(e,t){var n,r,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(n=s&&!s[0],r=a&&!a[0],n||r)return n?r?0:-i:o;if(o!=i)return o;if(n=o<0,r=c==l,!s||!a)return r?0:!s^n?1:-1;if(!r)return c>l^n?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]^n?1:-1;return c==l?0:c>l^n?1:-1}function ct(e,t,n,r){if(e<t||e>n||e!==xn(e))throw Error(Kt+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Ac(e){var t=e.c.length-1;return wn(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 yr(e,t,n){var r,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(r=e.length,++t>r){for(s=n,t-=r;--t;s+=n);e+=s}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=Lm();const Qn=(e,t)=>{if(!e||!t)return"";const n=j(10).pow(e||0);return j(t).times(n).idiv(n).div(n).toFixed()},Ic=(e,t)=>!e||!t?"":V5(t).times(j(10).pow(e)).decimalPlaces(0).toFixed(0),j5=j(0);j(1),j(10),j(1e18);function zm(e,t){return e instanceof j?e:e?j(e,t):j5}function Is(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}function V5(e,t,n){if(typeof e!="string")return zm(e);const r=".",s=e.replace(new RegExp(`[^${r}\\d-]+`,"g"),"");return zm(s)}const Ps=e=>!!Vm.find(t=>Is(t,e||""));function W5(e){return[Gt.Years,Gt.Months,Gt.Weeks,Gt.Days,Gt.Hours,Gt.Minutes].find(n=>n<=e)||Gt.Minutes}const Zr=e=>e?e.value*e.unit:0,q5=e=>!e||e==="NaN"?"0":j(e).decimalPlaces(0).toFixed(),Bs=e=>Object.values(Ot).find(t=>t.id===e),Y5=e=>{if(!e)return;const t=e.map(a=>_t(a)),n=Object.entries(Wm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),r=e.map(a=>a.exchangeAddress),s=new Set([...r,...n].map(a=>a.toLowerCase()));return Array.from(s)},td=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+cd(t):(e.fillDelay||0)*1e3,Oo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),K5=e=>gh().filter(t=>t.name===e).map(t=>t.chainId),Rm="https://order-sink-dev.orbs.network",nd="https://order-sink.orbs.network";let rd;const Z5=e=>{rd=e},sd=()=>{const e=Oo("env");return e==="prod"?nd:e==="dev"?Rm:rd==="prod"?nd:rd==="dev"?Rm:nd},X5=100,Q5=1,Pc=300*1e3,Ta=365*24*60*60*1e3,ad=300*1e3,Hm=new Date(Pc).getMinutes(),$m=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,kn="https://hub.orbs.network/api/apikey/subgraphs/id",Gm={[Ot.eth.id]:`${kn}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ot.bsc.id]:`${kn}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ot.poly.id]:`${kn}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ot.arb.id]:`${kn}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ot.base.id]:`${kn}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ot.sei.id]:`${kn}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ot.linea.id]:`${kn}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ot.sonic.id]:`${kn}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ot.ftm.id]:`${kn}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ot.katana.id]:`${kn}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ot.avax.id]:`${kn}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ot.bera.id]:`${kn}/H7aY53mY1hgaSURwXj3ZVirwNSifExwjgEL5GNtTqmEj`,[Ot.flare.id]:$m("flare"),[Ot.cronosZkEvm.id]:$m("cronos-zkevm")},jm="0x0000000000000000000000000000000000000000",Vm=[jm,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],J5="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,Wm={[_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"]},Bc={unit:Gt.Minutes,value:Hm},ew=.25,tw="100",qm="RePermitWitnessTransferFrom",Ym={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/",nw="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",rw="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",sw="https://www.orbs.com/assets/img/common/logo.svg",aw="https://www.orbs.com/",ow="https://www.orbs.com/dtwap-dlimit-disclaimer";var Oc=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e))(Oc||{});const Km="-5",Zm="10",Xm="-10",Qm="5",iw="Something went wrong";function cw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}function lw(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 uw={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,Jm;function dw(){if(Jm)return id;Jm=1;const e=uw,t=s=>lw(`./out/${s}.sol/${s}.json`).abi,n=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function r(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:r,abis:n,raw:e},id}var eh=dw();const th=(e,t,n)=>{if(!e||!t||!n)return;const r=j(e).times(t),s=j(10).pow(n);return r.div(s).toFixed(0)},nh=(e,t,n,r)=>{if(n||!r||!e||!t)return j(0).toString();const s=j(e).times(j(t)),a=j(10).pow(r),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)},rh=(e,t,n,r)=>{if(e===ke.TWAP||e===ke.LIMIT)return"0";if(!r||!t||!n)return;const s=j(t).times(j(n)),a=j(10).pow(r),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)||"0"},sh=(e,t,n,r)=>{const s=Zr(n)*2*t,a=W5(s);return r||(e===ke.LIMIT?{unit:Gt.Days,value:7}:e===ke.STOP_LOSS||e===ke.TAKE_PROFIT?{unit:Gt.Days,value:1}:{unit:a,value:Number(j(s/a).toFixed(2))})},ah=(e,t,n)=>t!==ke.TWAP?1:n!==void 0?n:e,oh=(e,t,n,r)=>{if(!t||!n||!r)return 1;const a=j(n).times(t).div(r).integerValue(j.ROUND_FLOOR).toNumber(),o=Math.floor(Ta/2/Zr(e));return Math.max(1,Math.min(a,o))},pw=e=>cd(e)/1e3/60,ih=(e,t)=>e+Zr(t)+6e4,cd=e=>e.bidDelaySeconds*1e3*2,ch=(e,t)=>!e||!t?"0":j(e).div(t).integerValue(j.ROUND_FLOOR).toFixed(0),fw=(e,t)=>({isError:!(e.unit===Bc.unit&&e.value===Bc.value)&&Zr(e)*t>Ta,value:Math.floor(Ta/t)}),lh=(e="",t="",n)=>{if(n===ke.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},uh=(e="",t="",n)=>{if(n===ke.TAKE_PROFIT)return{isError:j(t||0).lte(j(e||0)),value:e}},dh=(e="",t="",n=!1,r)=>{if(!n&&r===ke.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},ph=(e="",t="",n=!1,r)=>{if(!n&&r===ke.TAKE_PROFIT)return{isError:j(t||0).gte(j(e||0)),value:e}},fh=(e,t)=>e===ke.STOP_LOSS||e===ke.TAKE_PROFIT?{isError:Zr(t)>5184e6,value:5184e6}:{isError:Zr(t)>Ta,value:Ta},mh=e=>({isError:Zr(e)<ad,value:ad}),hh=e=>({isError:Zr(e)<Pc,value:Pc}),bh=(e,t,n)=>({isError:j(t||0).multipliedBy(e||0).isLessThan(n),value:n}),yh=(e,t,n)=>({isError:n===ke.TWAP&&j(e).isGreaterThan(t),value:t}),ld=(e,t)=>{var n;try{if(!e||!t)throw new Error("Invalid chainId or _dex");const r=(n=Object.entries(Dt).find(([i,c])=>c.chainId===e&&i.toLowerCase().indexOf(t.toLowerCase())>=0))==null?void 0:n[1],{abi:s,...a}=eh.config(e,t);return{...a,partner:t,twapConfig:r}}catch{return}},gh=()=>{const e=eh.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,n])=>{const r=n==null?void 0:n.dex;return!r||typeof r!="object"?[]:Object.entries(r).map(([s])=>({chainId:Number(t),name:s,config:ld(Number(t),s)}))}).sort((t,n)=>t.name.localeCompare(n.name))},xh=({chainId:e,srcToken:t,dstToken:n,srcAmount:r,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=q5(s/1e3),g=Oo(Oc.FRESHNESS),k=g?parseInt(g):60,v={permitted:{token:t,amount:r},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:k,input:{token:t,amount:c,maxAmount:r},output:{token:n,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:v,types:Ym,primaryType:qm}},mw={version:"0.0.13"},hw=`https://bi.orbs.network/putes/twap-ui-${.7}`,wh=mw.version;let ud="unknown";function vh(e){ud=e}function dd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),n=Date.now().toString(36);return`id_${e+t+n}`}const bw=(e,t,n)=>{var r,s,a,o,i,c,l,u,d;return{spotVersion:wh,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:((r=e.twapConfig)==null?void 0:r.chainName)||"",chainId:n||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(hw,{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 yw{constructor(){Yu(this,"timeout");Yu(this,"config");Yu(this,"data",{_id:dd()})}async updateAndSend(t={},n=!1,r){try{this.data={...this.data,...t},n?(await kh(this.data),r==null||r()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{kh(this.data),r==null||r()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,n){this.updateAndSend({cancelOrderIdsV1:n===1?t:void 0,cancelOrderIdsV2:n===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 n;this.updateAndSend({action:"crash",actionError:((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var r;const n=((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:n})}onRequestOrder({account:t,chainId:n,module:r,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:n,walletAddress:t,module:r,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,n,r){var s;this.config=t,r!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:dd(),action:"module-import",uiVersion:ud,...bw(t,n,r),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:wh,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 lt=new yw,gw=e=>{var s;const t=j(e.order.witness.output.limit||0).gt(1),n=j(e.order.witness.output.stop||0).gt(0),r=((s=e.metadata.chunks)==null?void 0:s.length)||j(e.order.witness.input.maxAmount).div(j(e.order.witness.input.amount)).toNumber();return n&&t?dt.TRIGGER_PRICE_LIMIT:n?dt.TRIGGER_PRICE_MARKET:!t&&r<=1?dt.TWAP_MARKET:r>=1&&t?dt.TWAP_LIMIT:t?dt.LIMIT:dt.TWAP_MARKET},xw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,n=e.metadata.expectedChunks||0,r=j(t).dividedBy(n).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},ww=["pending","eligible"],vw=(e,t)=>e.metadata.status==="completed"||t>=99?Qe.Completed:ww.includes(e.metadata.status)?Qe.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?Qe.Canceled:Qe.Expired,Eh=e=>{var s,a;const t=xw(e),n=Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,r=e.metadata.expectedChunks||1;return{id:e.hash,hash:e.hash,version:2,type:gw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:((s=e.metadata.chunks)==null?void 0:s.reduce((o,i)=>o.plus(i.inAmount),new j(0)).toString())||"",dstAmountFilled:((a=e.metadata.chunks)==null?void 0:a.reduce((o,i)=>o.plus(i.outAmount),new j(0)).toString())||"",dollarValueInFilled:"",dollarValueOutFilled:"",feesFilled:"",fills:[],srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:"",fillDelay:e.order.witness.epoch,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,dstMinAmountPerTrade:n,triggerPricePerTrade:j(e.order.witness.output.stop||0).isZero()?"":e.order.witness.output.stop,dstMinAmountTotal:j(n).multipliedBy(r).toString(),srcAmountPerTrade:e.order.witness.input.amount,txHash:"",totalTradesAmount:r,isMarketPrice:!1,chainId:e.order.witness.chainid,filledOrderTimestamp:0,status:vw(e,t),rawOrder:e}},kw=async({chainId:e,signal:t,account:n})=>n?(await(await fetch(`${sd()}/orders?swapper=${n}&chainId=${e}`,{signal:t})).json()).orders.map(Eh):[],Th=async(e,t)=>{try{const n={signature:t,order:e,status:"pending"};console.log("body",n),lt.onCreateOrderRequest();const s=await(await fetch(`${sd()}/orders/new`,{method:"POST",body:JSON.stringify(n)})).json();if(!s.success)throw new Error(`error:${s.message}, code:${s.code}`);const a=Eh(s.signedOrder);return lt.onCreateOrderSuccess(a.id),a}catch(n){throw lt.onCreateOrderError(n),console.error(n),n}},gr=(e,t)=>e&&e.length?e.map(t||(n=>`${n}`)):void 0,Ew=e=>{if(e)return Gm[e]},pd=async({chainId:e,buildQuery:t,extractResults:n,signal:r,retries:s=1,limit:a=1e3,page:o})=>{const i=Ew(e);if(!i)throw new Bw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:r,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 n(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},Ch=e=>{const t={dstAmountOut:j(0),srcAmountIn:j(0),dollarValueIn:j(0),dollarValueOut:j(0),dexFee:j(0)},n=e.reduce((r,s)=>({dstAmountOut:r.dstAmountOut.plus(j(s.dstAmountOut||0)),srcAmountIn:r.srcAmountIn.plus(j(s.srcAmountIn||0)),dollarValueIn:r.dollarValueIn.plus(j(s.dollarValueIn||0)),dollarValueOut:r.dollarValueOut.plus(j(s.dollarValueOut||0)),dexFee:r.dexFee.plus(j(s.dstFee||0))}),t);return{filledDstAmount:n.dstAmountOut.toFixed(),filledSrcAmount:n.srcAmountIn.toFixed(),filledDollarValueIn:n.dollarValueIn.toFixed(),filledDollarValueOut:n.dollarValueOut.toFixed(),dexFee:n.dexFee.toFixed()}},Ah=(e,t)=>{const n=j(e||0).gt(1);return!n&&t===1?dt.TWAP_MARKET:t>1&&n?dt.TWAP_LIMIT:n?dt.LIMIT:dt.TWAP_MARKET},Tw=e=>e===dt.TWAP_MARKET||e===dt.TRIGGER_PRICE_MARKET,Cw=(e,t,n,r)=>{var y;const{filledDstAmount:s,filledSrcAmount:a,filledDollarValueIn:o,filledDollarValueOut:i,dexFee:c}=Ch(n||[]),l=new j(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(j.ROUND_FLOOR).toNumber(),d=(n==null?void 0:n.length)===l?(y=n==null?void 0:n[(n==null?void 0:n.length)-1])==null?void 0:y.timestamp:void 0,f=Sh(e.ask_srcAmount,a),m=Ah(e.ask_dstMinAmount,l);return{version:1,id:e.Contract_id.toString(),hash:"",type:Ah(e.ask_dstMinAmount,l),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:f,dstAmountFilled:n?s:"",srcAmountFilled:n?a:"",orderDollarValueIn:e.dollarValueIn,srcAmount:e.ask_srcAmount,dollarValueInFilled:n?o:"",dollarValueOutFilled:n?i:"",feesFilled:n?c:"",dstMinAmountTotal:j(e.ask_dstMinAmount).multipliedBy(l).toString(),fills:n||[],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:l,isMarketPrice:Tw(m),chainId:t,filledOrderTimestamp:d||0,status:r,rawOrder:e}},Aw=e=>{var d;if(!e)return"";const t=gr(e.accounts,f=>`"${f.toLowerCase()}"`),n=gr(Y5(e.configs),f=>`"${f.toLowerCase()}"`),r=gr(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=gr(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=gr(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=gr(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=gr(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=gr(e.orderIds,f=>`"${f}"`),l=n!=null&&n.length?"":gr((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[n?`exchange_in: [${n.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}`:"",r?`srcTokenSymbol_in: [${r.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 Sw({chainId:e,signal:t,page:n,limit:r,filters:s}){const a=r||1e3,o=Aw(s);return await pd({chainId:e,signal:t,limit:a,page:n,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,Ea){"use strict";var VW=Object.defineProperty;var B5=R=>{throw TypeError(R)};var WW=(R,M,B)=>M in R?VW(R,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[M]=B;var Yu=(R,M,B)=>WW(R,typeof M!="symbol"?M+"":M,B),km=(R,M,B)=>M.has(R)||B5("Cannot "+B);var N=(R,M,B)=>(km(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,Ea)=>(km(R,M,"write to private field"),Ea?Ea.call(R,B):M.set(R,B),B),Se=(R,M,B)=>(km(R,M,"access private method"),B);var Ku=(R,M,B,Ea)=>({set _(Xu){ee(R,M,Xu,B)},get _(){return N(R,M,Ea)}});var fr,pa,f5,fa,gs,go,m5,xo,xs,wo,h5,ma,b5,ha,vo,On,ba,Bt,wc,ya,Zn,Yr,y5,sn,Ue,vc,qt,ga,ko,Gr,ws,kc,Eo,To,xa,wa,vs,Co,Ve,Cc,Em,Tm,Cm,Am,Sm,Im,Pm,O5,g5,Ec,mr,Yt,va,hr,As,x5,jr,Xn,Tc,w5,Vr,ks,an,Wr,qr,Zu,Bm,v5,br,k5,ft,Es,Ts,Ao,So,Cs,Io,Po,E5;function Xu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}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"}},F5=[{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"}],U5=[{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('[{"type":"constructor","inputs":[{"name":"_repermit","type":"address","internalType":"address"},{"name":"_cosigner","type":"address","internalType":"address"},{"name":"_wm","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"cosigner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"epochs","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"executeWithCallback","inputs":[{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"pause","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"paused","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"repermit","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"unpause","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"wm","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"event","name":"Fill","inputs":[{"name":"hash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"executor","type":"address","indexed":true,"internalType":"address"},{"name":"swapper","type":"address","indexed":true,"internalType":"address"},{"name":"epoch","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"name":"account","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"name":"account","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"error","name":"CosignedExceedsStop","inputs":[]},{"type":"error","name":"EnforcedPause","inputs":[]},{"type":"error","name":"ExpectedPause","inputs":[]},{"type":"error","name":"FailedCall","inputs":[]},{"type":"error","name":"FutureCosignatureTimestamp","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[{"name":"balance","type":"uint256","internalType":"uint256"},{"name":"needed","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidCosignature","inputs":[]},{"type":"error","name":"InvalidCosignatureChainid","inputs":[]},{"type":"error","name":"InvalidCosignatureCosigner","inputs":[]},{"type":"error","name":"InvalidCosignatureInputToken","inputs":[]},{"type":"error","name":"InvalidCosignatureOutputToken","inputs":[]},{"type":"error","name":"InvalidCosignatureReactor","inputs":[]},{"type":"error","name":"InvalidCosignatureZeroInputValue","inputs":[]},{"type":"error","name":"InvalidCosignatureZeroOutputValue","inputs":[]},{"type":"error","name":"InvalidEpoch","inputs":[]},{"type":"error","name":"InvalidFreshness","inputs":[]},{"type":"error","name":"InvalidFreshnessVsEpoch","inputs":[]},{"type":"error","name":"InvalidOrderAdapterZero","inputs":[]},{"type":"error","name":"InvalidOrderChainid","inputs":[]},{"type":"error","name":"InvalidOrderDeadlineExpired","inputs":[]},{"type":"error","name":"InvalidOrderExchangeShareBps","inputs":[]},{"type":"error","name":"InvalidOrderExecutorZero","inputs":[]},{"type":"error","name":"InvalidOrderInputAmountGtMax","inputs":[]},{"type":"error","name":"InvalidOrderInputAmountZero","inputs":[]},{"type":"error","name":"InvalidOrderInputTokenZero","inputs":[]},{"type":"error","name":"InvalidOrderOutputLimitGtStop","inputs":[]},{"type":"error","name":"InvalidOrderOutputRecipientZero","inputs":[]},{"type":"error","name":"InvalidOrderReactorMismatch","inputs":[]},{"type":"error","name":"InvalidOrderReactorZero","inputs":[]},{"type":"error","name":"InvalidOrderSameToken","inputs":[]},{"type":"error","name":"InvalidOrderSlippageTooHigh","inputs":[]},{"type":"error","name":"InvalidOrderSwapperZero","inputs":[]},{"type":"error","name":"InvalidSender","inputs":[]},{"type":"error","name":"NotAllowed","inputs":[]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"StaleCosignature","inputs":[]}]'),_5=JSON.parse('[{"type":"constructor","inputs":[{"name":"_reactor","type":"address","internalType":"address"},{"name":"_allowed","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"execute","inputs":[{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"reactor","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"reactorCallback","inputs":[{"name":"hash","type":"bytes32","internalType":"bytes32"},{"name":"resolvedAmountOut","type":"uint256","internalType":"uint256"},{"name":"co","type":"tuple","internalType":"struct CosignedOrder","components":[{"name":"order","type":"tuple","internalType":"struct Order","components":[{"name":"reactor","type":"address","internalType":"address"},{"name":"executor","type":"address","internalType":"address"},{"name":"exchange","type":"tuple","internalType":"struct Exchange","components":[{"name":"adapter","type":"address","internalType":"address"},{"name":"ref","type":"address","internalType":"address"},{"name":"share","type":"uint32","internalType":"uint32"},{"name":"data","type":"bytes","internalType":"bytes"}]},{"name":"swapper","type":"address","internalType":"address"},{"name":"nonce","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"exclusivity","type":"uint32","internalType":"uint32"},{"name":"epoch","type":"uint32","internalType":"uint32"},{"name":"slippage","type":"uint32","internalType":"uint32"},{"name":"freshness","type":"uint32","internalType":"uint32"},{"name":"input","type":"tuple","internalType":"struct Input","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"maxAmount","type":"uint256","internalType":"uint256"}]},{"name":"output","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}]},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"cosignatureData","type":"tuple","internalType":"struct Cosignature","components":[{"name":"cosigner","type":"address","internalType":"address"},{"name":"reactor","type":"address","internalType":"address"},{"name":"chainid","type":"uint256","internalType":"uint256"},{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"input","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]},{"name":"output","type":"tuple","internalType":"struct CosignedValue","components":[{"name":"token","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"decimals","type":"uint8","internalType":"uint8"}]}]},{"name":"cosignature","type":"bytes","internalType":"bytes"}]},{"name":"x","type":"tuple","internalType":"struct Execution","components":[{"name":"minAmountOut","type":"uint256","internalType":"uint256"},{"name":"fee","type":"tuple","internalType":"struct Output","components":[{"name":"token","type":"address","internalType":"address"},{"name":"limit","type":"uint256","internalType":"uint256"},{"name":"stop","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"name":"data","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"wm","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"event","name":"Settled","inputs":[{"name":"orderHash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"swapper","type":"address","indexed":true,"internalType":"address"},{"name":"exchange","type":"address","indexed":true,"internalType":"address"},{"name":"inToken","type":"address","indexed":false,"internalType":"address"},{"name":"outToken","type":"address","indexed":false,"internalType":"address"},{"name":"inAmount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"outAmount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"minOut","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Surplus","inputs":[{"name":"ref","type":"address","indexed":true,"internalType":"address"},{"name":"swapper","type":"address","indexed":false,"internalType":"address"},{"name":"token","type":"address","indexed":false,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"refshare","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"AddressEmptyCode","inputs":[{"name":"target","type":"address","internalType":"address"}]},{"type":"error","name":"FailedCall","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[{"name":"balance","type":"uint256","internalType":"uint256"},{"name":"needed","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidOrder","inputs":[]},{"type":"error","name":"InvalidSender","inputs":[]},{"type":"error","name":"NotAllowed","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"name":"token","type":"address","internalType":"address"}]}]'),M5=[{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"}]}],N5=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"}]'),L5=JSON.parse('[{"inputs":[{"internalType":"contract TWAP","name":"_twap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"uint256","name":"srcBidAmountNext","type":"uint256"}],"name":"hasAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"uint256","name":"srcBidAmountNext","type":"uint256"}],"name":"hasBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"makerOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint64","name":"lastIndex","type":"uint64"},{"internalType":"uint64","name":"pageSize","type":"uint64"}],"name":"takerBiddableOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint64","name":"lastIndex","type":"uint64"},{"internalType":"uint64","name":"pageSize","type":"uint64"}],"name":"takerFillableOrders","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":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twap","outputs":[{"internalType":"contract TWAP","name":"","type":"address"}],"stateMutability":"view","type":"function"}]'),z5=D5,R5=_5,Um=M5,Dm=F5,H5=U5,_m=N5,$5=L5;var ke=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(ke||{}),Qe=(e=>(e.Open="OPEN",e.Canceled="CANCELED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(Qe||{}),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",Ot={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 G5=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Qu=Math.ceil,xn=Math.floor,Kt="[BigNumber Error] ",Nm=Kt+"Number primitive has more than 15 significant digits: ",Un=1e14,ge=14,Ju=9007199254740991,ed=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Kr=1e7,St=1e9;function Lm(e){var t,n,r,s=w.prototype={constructor:w,toString:null,valueOf:null},a=new w(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:""},k="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function w(h,b){var x,S,P,O,_,E,I,U,F=this;if(!(F instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){F.s=h.s,!h.c||h.e>d?F.c=F.e=null:h.e<u?F.c=[F.e=0]:(F.e=h.e,F.c=h.c.slice());return}if((E=typeof h=="number")&&h*0==0){if(F.s=1/h<0?(h=-h,-1):1,h===~~h){for(O=0,_=h;_>=10;_/=10,O++);O>d?F.c=F.e=null:(F.e=O,F.c=[h]);return}U=String(h)}else{if(!G5.test(U=String(h)))return r(F,U,E);F.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}(O=U.indexOf("."))>-1&&(U=U.replace(".","")),(_=U.search(/e/i))>0?(O<0&&(O=_),O+=+U.slice(_+1),U=U.substring(0,_)):O<0&&(O=U.length)}else{if(ct(b,2,k.length,"Base"),b==10&&v)return F=new w(h),L(F,o+F.e+1,i);if(U=String(h),E=typeof h=="number"){if(h*0!=0)return r(F,U,E,b);if(F.s=1/h<0?(U=U.slice(1),-1):1,w.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(Nm+h)}else F.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(x=k.slice(0,b),O=_=0,I=U.length;_<I;_++)if(x.indexOf(S=U.charAt(_))<0){if(S=="."){if(_>O){O=I;continue}}else if(!P&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){P=!0,_=-1,O=0;continue}return r(F,String(h),E,b)}E=!1,U=n(U,b,10,F.s),(O=U.indexOf("."))>-1?U=U.replace(".",""):O=U.length}for(_=0;U.charCodeAt(_)===48;_++);for(I=U.length;U.charCodeAt(--I)===48;);if(U=U.slice(_,++I)){if(I-=_,E&&w.DEBUG&&I>15&&(h>Ju||h!==xn(h)))throw Error(Nm+F.s*h);if((O=O-_-1)>d)F.c=F.e=null;else if(O<u)F.c=[F.e=0];else{if(F.e=O,F.c=[],_=(O+1)%ge,O<0&&(_+=ge),_<I){for(_&&F.c.push(+U.slice(0,_)),I-=ge;_<I;)F.c.push(+U.slice(_,_+=ge));_=ge-(U=U.slice(_)).length}else _-=I;for(;_--;U+="0");F.c.push(+U)}}else F.c=[F.e=0]}w.clone=Lm,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],ct(x,0,St,b),o=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ct(x,0,8,b),i=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ct(x[0],-St,0,b),ct(x[1],0,St,b),c=x[0],l=x[1]):(ct(x,-St,St,b),c=-(l=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ct(x[0],-St,-1,b),ct(x[1],1,St,b),u=x[0],d=x[1];else if(ct(x,-St,St,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],ct(x,0,9,b),m=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ct(x,0,St,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))v=x.slice(0,10)=="0123456789",k=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:k}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,S=h.c,P=h.e,O=h.s;e:if({}.toString.call(S)=="[object Array]"){if((O===1||O===-1)&&P>=-St&&P<=St&&P===xn(P)){if(S[0]===0){if(P===0&&S.length===1)return!0;break e}if(b=(P+1)%ge,b<1&&(b+=ge),String(S[0]).length==b){for(b=0;b<S.length;b++)if(x=S[b],x<0||x>=Un||x!==xn(x))break e;if(x!==0)return!0}}}else if(S===null&&P===null&&(O===null||O===1||O===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return xn(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var S,P,O,_,E,I=0,U=[],F=new w(a);if(x==null?x=o:ct(x,0,St),_=Qu(x/ge),f)if(crypto.getRandomValues){for(S=crypto.getRandomValues(new Uint32Array(_*=2));I<_;)E=S[I]*131072+(S[I+1]>>>11),E>=9e15?(P=crypto.getRandomValues(new Uint32Array(2)),S[I]=P[0],S[I+1]=P[1]):(U.push(E%1e14),I+=2);I=_/2}else if(crypto.randomBytes){for(S=crypto.randomBytes(_*=7);I<_;)E=(S[I]&31)*281474976710656+S[I+1]*1099511627776+S[I+2]*4294967296+S[I+3]*16777216+(S[I+4]<<16)+(S[I+5]<<8)+S[I+6],E>=9e15?crypto.randomBytes(7).copy(S,I):(U.push(E%1e14),I+=7);I=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;I<_;)E=b(),E<9e15&&(U[I++]=E%1e14);for(_=U[--I],x%=ge,_&&x&&(E=ed[ge-x],U[I]=xn(_/E)*E);U[I]===0;U.pop(),I--);if(I<0)U=[O=0];else{for(O=-1;U[0]===0;U.splice(0,1),O-=ge);for(I=1,E=U[0];E>=10;E/=10,I++);I<ge&&(O-=ge-I)}return F.e=O,F.c=U,F}})(),w.sum=function(){for(var h=1,b=arguments,x=new w(b[0]);h<b.length;)x=x.plus(b[h++]);return x},n=(function(){var h="0123456789";function b(x,S,P,O){for(var _,E=[0],I,U=0,F=x.length;U<F;){for(I=E.length;I--;E[I]*=S);for(E[0]+=O.indexOf(x.charAt(U++)),_=0;_<E.length;_++)E[_]>P-1&&(E[_+1]==null&&(E[_+1]=0),E[_+1]+=E[_]/P|0,E[_]%=P)}return E.reverse()}return function(x,S,P,O,_){var E,I,U,F,z,H,G,J,pe=x.indexOf("."),he=o,ie=i;for(pe>=0&&(F=y,y=0,x=x.replace(".",""),J=new w(S),H=J.pow(x.length-pe),y=F,J.c=b(yr(vn(H.c),H.e,"0"),10,P,h),J.e=J.c.length),G=b(x,S,P,_?(E=k,h):(E=h,k)),U=F=G.length;G[--F]==0;G.pop());if(!G[0])return E.charAt(0);if(pe<0?--U:(H.c=G,H.e=U,H.s=O,H=t(H,J,he,ie,P),G=H.c,z=H.r,U=H.e),I=U+he+1,pe=G[I],F=P/2,z=z||I<0||G[I+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>F||pe==F&&(ie==4||z||ie==6&&G[I-1]&1||ie==(H.s<0?8:7)),I<1||!G[0])x=z?yr(E.charAt(1),-he,E.charAt(0)):E.charAt(0);else{if(G.length=I,z)for(--P;++G[--I]>P;)G[I]=0,I||(++U,G=[1].concat(G));for(F=G.length;!G[--F];);for(pe=0,x="";pe<=F;x+=E.charAt(G[pe++]));x=yr(x,U,E.charAt(0))}return x}})(),t=(function(){function h(S,P,O){var _,E,I,U,F=0,z=S.length,H=P%Kr,G=P/Kr|0;for(S=S.slice();z--;)I=S[z]%Kr,U=S[z]/Kr|0,_=G*I+U*H,E=H*I+_%Kr*Kr+F,F=(E/O|0)+(_/Kr|0)+G*U,S[z]=E%O;return F&&(S=[F].concat(S)),S}function b(S,P,O,_){var E,I;if(O!=_)I=O>_?1:-1;else for(E=I=0;E<O;E++)if(S[E]!=P[E]){I=S[E]>P[E]?1:-1;break}return I}function x(S,P,O,_){for(var E=0;O--;)S[O]-=E,E=S[O]<P[O]?1:0,S[O]=E*_+S[O]-P[O];for(;!S[0]&&S.length>1;S.splice(0,1));}return function(S,P,O,_,E){var I,U,F,z,H,G,J,pe,he,ie,de,Be,Q,we,De,$e,it,Ae=S.s==P.s?1:-1,ve=S.c,be=P.c;if(!ve||!ve[0]||!be||!be[0])return new w(!S.s||!P.s||(ve?be&&ve[0]==be[0]:!be)?NaN:ve&&ve[0]==0||!be?Ae*0:Ae/0);for(pe=new w(Ae),he=pe.c=[],U=S.e-P.e,Ae=O+U+1,E||(E=Un,U=wn(S.e/ge)-wn(P.e/ge),Ae=Ae/ge|0),F=0;be[F]==(ve[F]||0);F++);if(be[F]>(ve[F]||0)&&U--,Ae<0)he.push(1),z=!0;else{for(we=ve.length,$e=be.length,F=0,Ae+=2,H=xn(E/(be[0]+1)),H>1&&(be=h(be,H,E),ve=h(ve,H,E),$e=be.length,we=ve.length),Q=$e,ie=ve.slice(0,$e),de=ie.length;de<$e;ie[de++]=0);it=be.slice(),it=[0].concat(it),De=be[0],be[1]>=E/2&&De++;do{if(H=0,I=b(be,ie,$e,de),I<0){if(Be=ie[0],$e!=de&&(Be=Be*E+(ie[1]||0)),H=xn(Be/De),H>1)for(H>=E&&(H=E-1),G=h(be,H,E),J=G.length,de=ie.length;b(G,ie,J,de)==1;)H--,x(G,$e<J?it:be,J,E),J=G.length,I=1;else H==0&&(I=H=1),G=be.slice(),J=G.length;if(J<de&&(G=[0].concat(G)),x(ie,G,de,E),de=ie.length,I==-1)for(;b(be,ie,$e,de)<1;)H++,x(ie,$e<de?it:be,de,E),de=ie.length}else I===0&&(H++,ie=[0]);he[F++]=H,ie[0]?ie[de++]=ve[Q]||0:(ie=[ve[Q]],de=1)}while((Q++<we||ie[0]!=null)&&Ae--);z=ie[0]!=null,he[0]||he.splice(0,1)}if(E==Un){for(F=1,Ae=he[0];Ae>=10;Ae/=10,F++);L(pe,O+(pe.e=F+U*ge-1)+1,_,z)}else pe.e=U,pe.r=+z;return pe}})();function A(h,b,x,S){var P,O,_,E,I;if(x==null?x=i:ct(x,0,8),!h.c)return h.toString();if(P=h.c[0],_=h.e,b==null)I=vn(h.c),I=S==1||S==2&&(_<=c||_>=l)?Sc(I,_):yr(I,_,"0");else if(h=L(new w(h),b,x),O=h.e,I=vn(h.c),E=I.length,S==1||S==2&&(b<=O||O<=c)){for(;E<b;I+="0",E++);I=Sc(I,O)}else if(b-=_+(S===2&&O>_),I=yr(I,O,"0"),O+1>E){if(--b>0)for(I+=".";b--;I+="0");}else if(b+=O-E,b>0)for(O+1==E&&(I+=".");b--;I+="0");return h.s<0&&P?"-"+I:I}function T(h,b){for(var x,S,P=1,O=new w(h[0]);P<h.length;P++)S=new w(h[P]),(!S.s||(x=Ss(O,S))===b||x===0&&O.s===b)&&(O=S);return O}function D(h,b,x){for(var S=1,P=b.length;!b[--P];b.pop());for(P=b[0];P>=10;P/=10,S++);return(x=S+x*ge-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,_,E,I){var U,F=E?_:_.replace(P,"");if(S.test(F))O.s=isNaN(F)?null:F<0?-1:1;else{if(!E&&(F=F.replace(h,function(z,H,G){return U=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!I||I==U?H:z}),I&&(U=I,F=F.replace(b,"$1").replace(x,"0.$1")),_!=F))return new w(F,U);if(w.DEBUG)throw Error(Kt+"Not a"+(I?" base "+I:"")+" number: "+_);O.s=null}O.c=O.e=null}})();function L(h,b,x,S){var P,O,_,E,I,U,F,z=h.c,H=ed;if(z){e:{for(P=1,E=z[0];E>=10;E/=10,P++);if(O=b-P,O<0)O+=ge,_=b,I=z[U=0],F=xn(I/H[P-_-1]%10);else if(U=Qu((O+1)/ge),U>=z.length)if(S){for(;z.length<=U;z.push(0));I=F=0,P=1,O%=ge,_=O-ge+1}else break e;else{for(I=E=z[U],P=1;E>=10;E/=10,P++);O%=ge,_=O-ge+P,F=_<0?0:xn(I/H[P-_-1]%10)}if(S=S||b<0||z[U+1]!=null||(_<0?I:I%H[P-_-1]),S=x<4?(F||S)&&(x==0||x==(h.s<0?3:2)):F>5||F==5&&(x==4||S||x==6&&(O>0?_>0?I/H[P-_]:0:z[U-1])%10&1||x==(h.s<0?8:7)),b<1||!z[0])return z.length=0,S?(b-=h.e+1,z[0]=H[(ge-b%ge)%ge],h.e=-b||0):z[0]=h.e=0,h;if(O==0?(z.length=U,E=1,U--):(z.length=U+1,E=H[ge-O],z[U]=_>0?xn(I/H[P-_]%H[_])*E:0),S)for(;;)if(U==0){for(O=1,_=z[0];_>=10;_/=10,O++);for(_=z[0]+=E,E=1;_>=10;_/=10,E++);O!=E&&(h.e++,z[0]==Un&&(z[0]=1));break}else{if(z[U]+=E,z[U]!=Un)break;z[U--]=0,E=1}for(O=z.length;z[--O]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function C(h){var b,x=h.e;return x===null?h.toString():(b=vn(h.c),b=x<=c||x>=l?Sc(b,x):yr(b,x,"0"),h.s<0?"-"+b:b)}return s.absoluteValue=s.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,b){return Ss(this,new w(h,b))},s.decimalPlaces=s.dp=function(h,b){var x,S,P,O=this;if(h!=null)return ct(h,0,St),b==null?b=i:ct(b,0,8),L(new w(O),h+O.e+1,b);if(!(x=O.c))return null;if(S=((P=x.length-1)-wn(this.e/ge))*ge,P=x[P])for(;P%10==0;P/=10,S--);return S<0&&(S=0),S},s.dividedBy=s.div=function(h,b){return t(this,new w(h,b),o,i)},s.dividedToIntegerBy=s.idiv=function(h,b){return t(this,new w(h,b),0,1)},s.exponentiatedBy=s.pow=function(h,b){var x,S,P,O,_,E,I,U,F,z=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+C(h));if(b!=null&&(b=new w(b)),E=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return F=new w(Math.pow(+C(z),E?h.s*(2-Ac(h)):+C(h))),b?F.mod(b):F;if(I=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);S=!I&&z.isInteger()&&b.isInteger(),S&&(z=z.mod(b))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||E&&z.c[1]>=24e7:z.c[0]<8e13||E&&z.c[0]<=9999975e7)))return O=z.s<0&&Ac(h)?-0:0,z.e>-1&&(O=1/O),new w(I?1/O:O);y&&(O=Qu(y/ge+2))}for(E?(x=new w(.5),I&&(h.s=1),U=Ac(h)):(P=Math.abs(+C(h)),U=P%2),F=new w(a);;){if(U){if(F=F.times(z),!F.c)break;O?F.c.length>O&&(F.c.length=O):S&&(F=F.mod(b))}if(P){if(P=xn(P/2),P===0)break;U=P%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)U=Ac(h);else{if(P=+C(h),P===0)break;U=P%2}z=z.times(z),O?z.c&&z.c.length>O&&(z.c.length=O):S&&(z=z.mod(b))}return S?F:(I&&(F=a.div(F)),b?F.mod(b):O?L(F,y,i,_):F)},s.integerValue=function(h){var b=new w(this);return h==null?h=i:ct(h,0,8),L(b,b.e+1,h)},s.isEqualTo=s.eq=function(h,b){return Ss(this,new w(h,b))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,b){return Ss(this,new w(h,b))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,b){return(b=Ss(this,new w(h,b)))===1||b===0},s.isInteger=function(){return!!this.c&&wn(this.e/ge)>this.c.length-2},s.isLessThan=s.lt=function(h,b){return Ss(this,new w(h,b))<0},s.isLessThanOrEqualTo=s.lte=function(h,b){return(b=Ss(this,new w(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,S,P,O,_=this,E=_.s;if(h=new w(h,b),b=h.s,!E||!b)return new w(NaN);if(E!=b)return h.s=-b,_.plus(h);var I=_.e/ge,U=h.e/ge,F=_.c,z=h.c;if(!I||!U){if(!F||!z)return F?(h.s=-b,h):new w(z?_:NaN);if(!F[0]||!z[0])return z[0]?(h.s=-b,h):new w(F[0]?_:i==3?-0:0)}if(I=wn(I),U=wn(U),F=F.slice(),E=I-U){for((O=E<0)?(E=-E,P=F):(U=I,P=z),P.reverse(),b=E;b--;P.push(0));P.reverse()}else for(S=(O=(E=F.length)<(b=z.length))?E:b,E=b=0;b<S;b++)if(F[b]!=z[b]){O=F[b]<z[b];break}if(O&&(P=F,F=z,z=P,h.s=-h.s),b=(S=z.length)-(x=F.length),b>0)for(;b--;F[x++]=0);for(b=Un-1;S>E;){if(F[--S]<z[S]){for(x=S;x&&!F[--x];F[x]=b);--F[x],F[S]+=Un}F[S]-=z[S]}for(;F[0]==0;F.splice(0,1),--U);return F[0]?D(h,F,U):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,b){var x,S,P=this;return h=new w(h,b),!P.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||P.c&&!P.c[0]?new w(P):(m==9?(S=h.s,h.s=1,x=t(P,h,0,3),h.s=S,x.s*=S):x=t(P,h,0,m),h=P.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=P.s),h)},s.multipliedBy=s.times=function(h,b){var x,S,P,O,_,E,I,U,F,z,H,G,J,pe,he,ie=this,de=ie.c,Be=(h=new w(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(S=wn(ie.e/ge)+wn(h.e/ge),h.s*=ie.s,I=de.length,z=Be.length,I<z&&(J=de,de=Be,Be=J,P=I,I=z,z=P),P=I+z,J=[];P--;J.push(0));for(pe=Un,he=Kr,P=z;--P>=0;){for(x=0,H=Be[P]%he,G=Be[P]/he|0,_=I,O=P+_;O>P;)U=de[--_]%he,F=de[_]/he|0,E=G*U+F*H,U=H*U+E%he*he+J[O]+x,x=(U/pe|0)+(E/he|0)+G*F,J[O--]=U%pe;J[O]=x}return x?++S:J.splice(0,1),D(h,J,S)},s.negated=function(){var h=new w(this);return h.s=-h.s||null,h},s.plus=function(h,b){var x,S=this,P=S.s;if(h=new w(h,b),b=h.s,!P||!b)return new w(NaN);if(P!=b)return h.s=-b,S.minus(h);var O=S.e/ge,_=h.e/ge,E=S.c,I=h.c;if(!O||!_){if(!E||!I)return new w(P/0);if(!E[0]||!I[0])return I[0]?h:new w(E[0]?S:P*0)}if(O=wn(O),_=wn(_),E=E.slice(),P=O-_){for(P>0?(_=O,x=I):(P=-P,x=E),x.reverse();P--;x.push(0));x.reverse()}for(P=E.length,b=I.length,P-b<0&&(x=I,I=E,E=x,b=P),P=0;b;)P=(E[--b]=E[b]+I[b]+P)/Un|0,E[b]=Un===E[b]?0:E[b]%Un;return P&&(E=[P].concat(E),++_),D(h,E,_)},s.precision=s.sd=function(h,b){var x,S,P,O=this;if(h!=null&&h!==!!h)return ct(h,1,St),b==null?b=i:ct(b,0,8),L(new w(O),h,b);if(!(x=O.c))return null;if(P=x.length-1,S=P*ge+1,P=x[P]){for(;P%10==0;P/=10,S--);for(P=x[0];P>=10;P/=10,S++);}return h&&O.e+1>S&&(S=O.e+1),S},s.shiftedBy=function(h){return ct(h,-Ju,Ju),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,b,x,S,P,O=this,_=O.c,E=O.s,I=O.e,U=o+4,F=new w("0.5");if(E!==1||!_||!_[0])return new w(!E||E<0&&(!_||_[0])?NaN:_?O:1/0);if(E=Math.sqrt(+C(O)),E==0||E==1/0?(b=vn(_),(b.length+I)%2==0&&(b+="0"),E=Math.sqrt(+b),I=wn((I+1)/2)-(I<0||I%2),E==1/0?b="5e"+I:(b=E.toExponential(),b=b.slice(0,b.indexOf("e")+1)+I),x=new w(b)):x=new w(E+""),x.c[0]){for(I=x.e,E=I+U,E<3&&(E=0);;)if(P=x,x=F.times(P.plus(t(O,P,U,1))),vn(P.c).slice(0,E)===(b=vn(x.c)).slice(0,E))if(x.e<I&&--E,b=b.slice(E-3,E+1),b=="9999"||!S&&b=="4999"){if(!S&&(L(P,P.e+o+2,0),P.times(P).eq(O))){x=P;break}U+=4,E+=4,S=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(O));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,b){return h!=null&&(ct(h,0,St),h++),A(this,h,b,1)},s.toFixed=function(h,b){return h!=null&&(ct(h,0,St),h=h+this.e+1),A(this,h,b)},s.toFormat=function(h,b,x){var S,P=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(S=P.toFixed(h,b),P.c){var O,_=S.split("."),E=+x.groupSize,I=+x.secondaryGroupSize,U=x.groupSeparator||"",F=_[0],z=_[1],H=P.s<0,G=H?F.slice(1):F,J=G.length;if(I&&(O=E,E=I,I=O,J-=O),E>0&&J>0){for(O=J%E||E,F=G.substr(0,O);O<J;O+=E)F+=U+G.substr(O,E);I>0&&(F+=U+G.slice(O)),H&&(F="-"+F)}S=z?F+(x.decimalSeparator||"")+((I=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):F}return(x.prefix||"")+S+(x.suffix||"")},s.toFraction=function(h){var b,x,S,P,O,_,E,I,U,F,z,H,G=this,J=G.c;if(h!=null&&(E=new w(h),!E.isInteger()&&(E.c||E.s!==1)||E.lt(a)))throw Error(Kt+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+C(E));if(!J)return new w(G);for(b=new w(a),U=x=new w(a),S=I=new w(a),H=vn(J),O=b.e=H.length-G.e-1,b.c[0]=ed[(_=O%ge)<0?ge+_:_],h=!h||E.comparedTo(b)>0?O>0?b:U:E,_=d,d=1/0,E=new w(H),I.c[0]=0;F=t(E,b,0,1),P=x.plus(F.times(S)),P.comparedTo(h)!=1;)x=S,S=P,U=I.plus(F.times(P=U)),I=P,b=E.minus(F.times(P=b)),E=P;return P=t(h.minus(x),S,0,1),I=I.plus(P.times(U)),x=x.plus(P.times(S)),I.s=U.s=G.s,O=O*2,z=t(U,S,O,i).minus(G).abs().comparedTo(t(I,x,O,i).minus(G).abs())<1?[U,S]:[I,x],d=_,z},s.toNumber=function(){return+C(this)},s.toPrecision=function(h,b){return h!=null&&ct(h,1,St),A(this,h,b,2)},s.toString=function(h){var b,x=this,S=x.s,P=x.e;return P===null?S?(b="Infinity",S<0&&(b="-"+b)):b="NaN":(h==null?b=P<=c||P>=l?Sc(vn(x.c),P):yr(vn(x.c),P,"0"):h===10&&v?(x=L(new w(x),o+P+1,i),b=yr(vn(x.c),x.e,"0")):(ct(h,2,k.length,"Base"),b=n(yr(vn(x.c),P,"0"),10,h,S,!0)),S<0&&x.c[0]&&(b="-"+b)),b},s.valueOf=s.toJSON=function(){return C(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&w.set(e),w}function wn(e){var t=e|0;return e>0||e===t?t:t-1}function vn(e){for(var t,n,r=1,s=e.length,a=e[0]+"";r<s;){for(t=e[r++]+"",n=ge-t.length;n--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function Ss(e,t){var n,r,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(n=s&&!s[0],r=a&&!a[0],n||r)return n?r?0:-i:o;if(o!=i)return o;if(n=o<0,r=c==l,!s||!a)return r?0:!s^n?1:-1;if(!r)return c>l^n?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]^n?1:-1;return c==l?0:c>l^n?1:-1}function ct(e,t,n,r){if(e<t||e>n||e!==xn(e))throw Error(Kt+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Ac(e){var t=e.c.length-1;return wn(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 yr(e,t,n){var r,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(r=e.length,++t>r){for(s=n,t-=r;--t;s+=n);e+=s}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=Lm();const Qn=(e,t)=>{if(!e||!t)return"";const n=j(10).pow(e||0);return j(t).times(n).idiv(n).div(n).toFixed()},Ic=(e,t)=>!e||!t?"":V5(t).times(j(10).pow(e)).decimalPlaces(0).toFixed(0),j5=j(0);j(1),j(10),j(1e18);function zm(e,t){return e instanceof j?e:e?j(e,t):j5}function Is(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}function V5(e,t,n){if(typeof e!="string")return zm(e);const r=".",s=e.replace(new RegExp(`[^${r}\\d-]+`,"g"),"");return zm(s)}const Ps=e=>!!Vm.find(t=>Is(t,e||""));function W5(e){return[Gt.Years,Gt.Months,Gt.Weeks,Gt.Days,Gt.Hours,Gt.Minutes].find(n=>n<=e)||Gt.Minutes}const Zr=e=>e?e.value*e.unit:0,q5=e=>!e||e==="NaN"?"0":j(e).decimalPlaces(0).toFixed(),Bs=e=>Object.values(Ot).find(t=>t.id===e),Y5=e=>{if(!e)return;const t=e.map(a=>_t(a)),n=Object.entries(Wm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),r=e.map(a=>a.exchangeAddress),s=new Set([...r,...n].map(a=>a.toLowerCase()));return Array.from(s)},td=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+cd(t):(e.fillDelay||0)*1e3,Oo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),K5=e=>gh().filter(t=>t.name===e).map(t=>t.chainId),Rm="https://order-sink-dev.orbs.network",nd="https://order-sink.orbs.network";let rd;const Z5=e=>{rd=e},sd=()=>{const e=Oo("env");return e==="prod"?nd:e==="dev"?Rm:rd==="prod"?nd:rd==="dev"?Rm:nd},X5=100,Q5=1,Pc=300*1e3,Ta=365*24*60*60*1e3,ad=300*1e3,Hm=new Date(Pc).getMinutes(),$m=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,kn="https://hub.orbs.network/api/apikey/subgraphs/id",Gm={[Ot.eth.id]:`${kn}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ot.bsc.id]:`${kn}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ot.poly.id]:`${kn}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ot.arb.id]:`${kn}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ot.base.id]:`${kn}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ot.sei.id]:`${kn}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ot.linea.id]:`${kn}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ot.sonic.id]:`${kn}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ot.ftm.id]:`${kn}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ot.katana.id]:`${kn}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ot.avax.id]:`${kn}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ot.bera.id]:`${kn}/H7aY53mY1hgaSURwXj3ZVirwNSifExwjgEL5GNtTqmEj`,[Ot.flare.id]:$m("flare"),[Ot.cronosZkEvm.id]:$m("cronos-zkevm")},jm="0x0000000000000000000000000000000000000000",Vm=[jm,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],J5="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,Wm={[_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"]},Bc={unit:Gt.Minutes,value:Hm},ew=.25,tw="100",qm="RePermitWitnessTransferFrom",Ym={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/",nw="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",rw="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",sw="https://www.orbs.com/assets/img/common/logo.svg",aw="https://www.orbs.com/",ow="https://www.orbs.com/dtwap-dlimit-disclaimer";var Oc=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e))(Oc||{});const Km="-5",Zm="10",Xm="-10",Qm="5",iw="Something went wrong";function cw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}function lw(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 uw={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,Jm;function dw(){if(Jm)return id;Jm=1;const e=uw,t=s=>lw(`./out/${s}.sol/${s}.json`).abi,n=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function r(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:r,abis:n,raw:e},id}var eh=dw();const th=(e,t,n)=>{if(!e||!t||!n)return;const r=j(e).times(t),s=j(10).pow(n);return r.div(s).toFixed(0)},nh=(e,t,n,r)=>{if(n||!r||!e||!t)return j(0).toString();const s=j(e).times(j(t)),a=j(10).pow(r),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)},rh=(e,t,n,r)=>{if(e===ke.TWAP||e===ke.LIMIT)return"0";if(!r||!t||!n)return;const s=j(t).times(j(n)),a=j(10).pow(r),o=s.div(a);return j.max(1,o).integerValue(j.ROUND_FLOOR).toFixed(0)||"0"},sh=(e,t,n,r)=>{const s=Zr(n)*2*t,a=W5(s);return r||(e===ke.LIMIT?{unit:Gt.Days,value:7}:e===ke.STOP_LOSS||e===ke.TAKE_PROFIT?{unit:Gt.Days,value:1}:{unit:a,value:Number(j(s/a).toFixed(2))})},ah=(e,t,n)=>t!==ke.TWAP?1:n!==void 0?n:e,oh=(e,t,n,r)=>{if(!t||!n||!r)return 1;const a=j(n).times(t).div(r).integerValue(j.ROUND_FLOOR).toNumber(),o=Math.floor(Ta/2/Zr(e));return Math.max(1,Math.min(a,o))},pw=e=>cd(e)/1e3/60,ih=(e,t)=>e+Zr(t)+6e4,cd=e=>e.bidDelaySeconds*1e3*2,ch=(e,t)=>!e||!t?"0":j(e).div(t).integerValue(j.ROUND_FLOOR).toFixed(0),fw=(e,t)=>({isError:!(e.unit===Bc.unit&&e.value===Bc.value)&&Zr(e)*t>Ta,value:Math.floor(Ta/t)}),lh=(e="",t="",n)=>{if(n===ke.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},uh=(e="",t="",n)=>{if(n===ke.TAKE_PROFIT)return{isError:j(t||0).lte(j(e||0)),value:e}},dh=(e="",t="",n=!1,r)=>{if(!n&&r===ke.STOP_LOSS)return{isError:j(t||0).gte(j(e||0)),value:e}},ph=(e="",t="",n=!1,r)=>{if(!n&&r===ke.TAKE_PROFIT)return{isError:j(t||0).gte(j(e||0)),value:e}},fh=(e,t)=>e===ke.STOP_LOSS||e===ke.TAKE_PROFIT?{isError:Zr(t)>5184e6,value:5184e6}:{isError:Zr(t)>Ta,value:Ta},mh=e=>({isError:Zr(e)<ad,value:ad}),hh=e=>({isError:Zr(e)<Pc,value:Pc}),bh=(e,t,n)=>({isError:j(t||0).multipliedBy(e||0).isLessThan(n),value:n}),yh=(e,t,n)=>({isError:n===ke.TWAP&&j(e).isGreaterThan(t),value:t}),ld=(e,t)=>{var n;try{if(!e||!t)throw new Error("Invalid chainId or _dex");const r=(n=Object.entries(Dt).find(([i,c])=>c.chainId===e&&i.toLowerCase().indexOf(t.toLowerCase())>=0))==null?void 0:n[1],{abi:s,...a}=eh.config(e,t);return{...a,partner:t,twapConfig:r}}catch{return}},gh=()=>{const e=eh.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,n])=>{const r=n==null?void 0:n.dex;return!r||typeof r!="object"?[]:Object.entries(r).map(([s])=>({chainId:Number(t),name:s,config:ld(Number(t),s)}))}).sort((t,n)=>t.name.localeCompare(n.name))},xh=({chainId:e,srcToken:t,dstToken:n,srcAmount:r,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=q5(s/1e3),g=Oo(Oc.FRESHNESS),k=g?parseInt(g):60,v={permitted:{token:t,amount:r},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:k,input:{token:t,amount:c,maxAmount:r},output:{token:n,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:v,types:Ym,primaryType:qm}},mw={version:"0.0.14"},hw=`https://bi.orbs.network/putes/twap-ui-${.7}`,wh=mw.version;let ud="unknown";function vh(e){ud=e}function dd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),n=Date.now().toString(36);return`id_${e+t+n}`}const bw=(e,t,n)=>{var r,s,a,o,i,c,l,u,d;return{spotVersion:wh,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:((r=e.twapConfig)==null?void 0:r.chainName)||"",chainId:n||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(hw,{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 yw{constructor(){Yu(this,"timeout");Yu(this,"config");Yu(this,"data",{_id:dd()})}async updateAndSend(t={},n=!1,r){try{this.data={...this.data,...t},n?(await kh(this.data),r==null||r()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{kh(this.data),r==null||r()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,n){this.updateAndSend({cancelOrderIdsV1:n===1?t:void 0,cancelOrderIdsV2:n===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 n;this.updateAndSend({action:"crash",actionError:((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var r;const n=((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:n})}onRequestOrder({account:t,chainId:n,module:r,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:n,walletAddress:t,module:r,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,n,r){var s;this.config=t,r!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:dd(),action:"module-import",uiVersion:ud,...bw(t,n,r),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:wh,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 lt=new yw,gw=e=>{var s;const t=j(e.order.witness.output.limit||0).gt(1),n=j(e.order.witness.output.stop||0).gt(0),r=((s=e.metadata.chunks)==null?void 0:s.length)||j(e.order.witness.input.maxAmount).div(j(e.order.witness.input.amount)).toNumber();return n&&t?dt.TRIGGER_PRICE_LIMIT:n?dt.TRIGGER_PRICE_MARKET:!t&&r<=1?dt.TWAP_MARKET:r>=1&&t?dt.TWAP_LIMIT:t?dt.LIMIT:dt.TWAP_MARKET},xw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,n=e.metadata.expectedChunks||0,r=j(t).dividedBy(n).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},ww=["pending","eligible"],vw=(e,t)=>e.metadata.status==="completed"||t>=99?Qe.Completed:ww.includes(e.metadata.status)?Qe.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?Qe.Canceled:Qe.Expired,Eh=e=>{var s,a;const t=xw(e),n=Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,r=e.metadata.expectedChunks||1;return{id:e.hash,hash:e.hash,version:2,type:gw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:((s=e.metadata.chunks)==null?void 0:s.reduce((o,i)=>o.plus(i.inAmount),new j(0)).toString())||"",dstAmountFilled:((a=e.metadata.chunks)==null?void 0:a.reduce((o,i)=>o.plus(i.outAmount),new j(0)).toString())||"",dollarValueInFilled:"",dollarValueOutFilled:"",feesFilled:"",fills:[],srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:"",fillDelay:e.order.witness.epoch,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,dstMinAmountPerTrade:n,triggerPricePerTrade:j(e.order.witness.output.stop||0).isZero()?"":e.order.witness.output.stop,dstMinAmountTotal:j(n).multipliedBy(r).toString(),srcAmountPerTrade:e.order.witness.input.amount,txHash:"",totalTradesAmount:r,isMarketPrice:j(n||0).lte(1),chainId:e.order.witness.chainid,filledOrderTimestamp:0,status:vw(e,t),rawOrder:e}},kw=async({chainId:e,signal:t,account:n})=>n?(await(await fetch(`${sd()}/orders?swapper=${n}&chainId=${e}`,{signal:t})).json()).orders.map(Eh):[],Th=async(e,t)=>{try{const n={signature:t,order:e,status:"pending"};console.log("body",n),lt.onCreateOrderRequest();const s=await(await fetch(`${sd()}/orders/new`,{method:"POST",body:JSON.stringify(n)})).json();if(!s.success)throw new Error(`error:${s.message}, code:${s.code}`);const a=Eh(s.signedOrder);return lt.onCreateOrderSuccess(a.id),a}catch(n){throw lt.onCreateOrderError(n),console.error(n),n}},gr=(e,t)=>e&&e.length?e.map(t||(n=>`${n}`)):void 0,Ew=e=>{if(e)return Gm[e]},pd=async({chainId:e,buildQuery:t,extractResults:n,signal:r,retries:s=1,limit:a=1e3,page:o})=>{const i=Ew(e);if(!i)throw new Bw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:r,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 n(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},Ch=e=>{const t={dstAmountOut:j(0),srcAmountIn:j(0),dollarValueIn:j(0),dollarValueOut:j(0),dexFee:j(0)},n=e.reduce((r,s)=>({dstAmountOut:r.dstAmountOut.plus(j(s.dstAmountOut||0)),srcAmountIn:r.srcAmountIn.plus(j(s.srcAmountIn||0)),dollarValueIn:r.dollarValueIn.plus(j(s.dollarValueIn||0)),dollarValueOut:r.dollarValueOut.plus(j(s.dollarValueOut||0)),dexFee:r.dexFee.plus(j(s.dstFee||0))}),t);return{filledDstAmount:n.dstAmountOut.toFixed(),filledSrcAmount:n.srcAmountIn.toFixed(),filledDollarValueIn:n.dollarValueIn.toFixed(),filledDollarValueOut:n.dollarValueOut.toFixed(),dexFee:n.dexFee.toFixed()}},Ah=(e,t)=>{const n=j(e||0).gt(1);return!n&&t===1?dt.TWAP_MARKET:t>1&&n?dt.TWAP_LIMIT:n?dt.LIMIT:dt.TWAP_MARKET},Tw=e=>e===dt.TWAP_MARKET||e===dt.TRIGGER_PRICE_MARKET,Cw=(e,t,n,r)=>{var y;const{filledDstAmount:s,filledSrcAmount:a,filledDollarValueIn:o,filledDollarValueOut:i,dexFee:c}=Ch(n||[]),l=new j(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(j.ROUND_FLOOR).toNumber(),d=(n==null?void 0:n.length)===l?(y=n==null?void 0:n[(n==null?void 0:n.length)-1])==null?void 0:y.timestamp:void 0,f=Sh(e.ask_srcAmount,a),m=Ah(e.ask_dstMinAmount,l);return{version:1,id:e.Contract_id.toString(),hash:"",type:Ah(e.ask_dstMinAmount,l),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:f,dstAmountFilled:n?s:"",srcAmountFilled:n?a:"",orderDollarValueIn:e.dollarValueIn,srcAmount:e.ask_srcAmount,dollarValueInFilled:n?o:"",dollarValueOutFilled:n?i:"",feesFilled:n?c:"",dstMinAmountTotal:j(e.ask_dstMinAmount).multipliedBy(l).toString(),fills:n||[],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:l,isMarketPrice:Tw(m),chainId:t,filledOrderTimestamp:d||0,status:r,rawOrder:e}},Aw=e=>{var d;if(!e)return"";const t=gr(e.accounts,f=>`"${f.toLowerCase()}"`),n=gr(Y5(e.configs),f=>`"${f.toLowerCase()}"`),r=gr(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=gr(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=gr(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=gr(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=gr(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=gr(e.orderIds,f=>`"${f}"`),l=n!=null&&n.length?"":gr((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[n?`exchange_in: [${n.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}`:"",r?`srcTokenSymbol_in: [${r.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 Sw({chainId:e,signal:t,page:n,limit:r,filters:s}){const a=r||1e3,o=Aw(s);return await pd({chainId:e,signal:t,limit:a,page:n,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 Bw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Ow=async({chainId:e,signal:t,page:n,limit:r,filters:s})=>{const a=await Sw({chainId:e,signal:t,page:n,limit:r,filters:s}),[o,i]=await Promise.all([Pw({chainId:e,orders:a,signal:t}),Iw({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)&&Is(d.exchange,l.exchange)&&Is(d.twapAddress,l.twapAddress));return Cw(l,e,u,Fw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Fw=(e,t,n)=>{var o;const r=(o=n==null?void 0:n.find(i=>i.twapId===e.Contract_id.toString()&&Is(i.twapAddress,e.twapAddress)))==null?void 0:o.status,{filledSrcAmount:s}=Ch(t),a=Sh(e.ask_srcAmount,s);return Uw(a,e.ask_deadline*1e3,r)},Sh=(e,t)=>{if(!t||!e)return 0;const n=j(t).dividedBy(e).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Uw=(e,t,n)=>e===100?Qe.Completed:n==="CANCELED"?Qe.Canceled:n==="COMPLETED"?Qe.Completed:t>Date.now()?Qe.Open:Qe.Expired,Ih=async({signal:e,page:t,chainId:n,limit:r,config:s,account:a})=>(await Promise.all([s?Ow({chainId:n,signal:e,page:t,limit:r,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),kw({chainId:n,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Ph=e=>{let t;const n=new Set,r=(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),n.forEach(m=>m(t,f))}},s=()=>t,i={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,i);return i},Dw=(e=>e?Ph(e):Ph),_w=e=>e;function Mw(e,t=_w){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Bh=e=>{const t=Dw(e),n=r=>Mw(t,r);return Object.assign(n,t),n},Nw=(e=>e?Bh(e):Bh),Oh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Nw((e,t)=>({state:Oh,updateState:n=>e(r=>({state:{...r.state,...n}})),updateSwapExecution:n=>e(r=>({state:{...r.state,swapExecution:{...r.state.swapExecution,...n}}})),resetState:()=>{e({state:{...Oh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Lw={version:"0.0.22"};var Ca=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(){}},zw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Rw=(f5=class{constructor(){le(this,fr,zw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fr),provider:e}),ee(this,fr,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,fr).setTimeout(e,t)}clearTimeout(e){N(this,fr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setInterval(e,t)}clearInterval(e){N(this,fr).clearInterval(e)}},fr=new WeakMap,pa=new WeakMap,f5),Os=new Rw;function Hw(e){setTimeout(e,0)}var Fs=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 Fh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xr(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Uh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(r){if(t.queryHash!==hd(o,t.options))return!1}else if(!Fo(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Dh(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Us(t.options.mutationKey)!==Us(a))return!1}else if(!Fo(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function hd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Us)(e)}function Us(e){return JSON.stringify(e,(t,n)=>yd(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fo(e[n],t[n])):!1}var Gw=Object.prototype.hasOwnProperty;function bd(e,t){if(e===t)return e;const n=_h(e)&&_h(t);if(!n&&!(yd(e)&&yd(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,i=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=n?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(n?l<s:Gw.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 n in e)if(e[n]!==t[n])return!1;return!0}function _h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yd(e){if(!Mh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Mh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Mh(e){return Object.prototype.toString.call(e)==="[object Object]"}function jw(e){return new Promise(t=>{Os.setTimeout(t,e)})}function gd(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bd(e,t)}catch(r){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. [${n.queryHash}]: ${r}`),r}return bd(e,t)}return t}function Vw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ww(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uc=Symbol();function Nh(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 Lh(e,t){return typeof e=="function"?e(...t):!!e}var qw=(m5=class extends Ca{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}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 n;ee(this,go,t),(n=N(this,gs))==null||n.call(this),ee(this,gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(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 qw;function wd(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Yw=Hw;function Kw(){let e=[],t=0,n=i=>{i()},r=i=>{i()},s=Yw;const a=i=>{t?e.push(i):s(()=>{n(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{r(()=>{i.forEach(c=>{n(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=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{s=i}}}var kt=Kw(),Zw=(h5=class extends Ca{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Fs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}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 n;ee(this,wo,t),(n=N(this,xs))==null||n.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),Dc=new Zw;function Xw(e){return Math.min(1e3*2**e,3e4)}function zh(e){return(e??"online")==="online"?Dc.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 Rh(e){let t=!1,n=0,r;const s=wd(),a=()=>s.status!=="pending",o=g=>{var k;if(!a()){const v=new vd(g);f(v),(k=e.onCancel)==null||k.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>xd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>zh(e.networkMode)&&e.canRun(),d=g=>{a()||(r==null||r(),s.resolve(g))},f=g=>{a()||(r==null||r(),s.reject(g))},m=()=>new Promise(g=>{var k;r=v=>{(a()||l())&&g(v)},(k=e.onPause)==null||k.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const k=n===0?e.initialPromise:void 0;try{g=k??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Fs?0:3),A=e.retryDelay??Xw,T=typeof A=="function"?A(n,v):A,D=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!D){f(v);return}n++,(L=e.onFail)==null||L.call(e,n,v),jw(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Hh=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&ee(this,ma,Os.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Os.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Qw=(y5=class extends Hh{constructor(t){super();le(this,Zn);le(this,ha);le(this,vo);le(this,On);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,On,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,jh(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,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=jh(this.options);n.data!==void 0&&(this.setState(Gh(n.data,n.dataUpdatedAt)),ee(this,ha,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,On).remove(this)}setData(t,n){const r=gd(this.state.data,t,this.options);return Se(this,Zn,Yr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Se(this,Zn,Yr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Bt))==null?void 0:r.promise;return(s=N(this,Bt))==null||s.cancel(t),n?n.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=>En(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=>Xr(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:!Fh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Zn,Yr).call(this,{type:"invalidate"})}async fetch(t,n){var c,l,u,d,f,m,y,g,k,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.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 T=this.observers.find(D=>D.options.queryFn);T&&this.setOptions(T.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 r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),r.signal)})},a=()=>{const T=Nh(this.options,n),L=(()=>{const C={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,ya,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(T),T})();(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))&&Se(this,Zn,Yr).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Rh({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof vd&&T.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),r.abort()},onFail:(T,D)=>{Se(this,Zn,Yr).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Zn,Yr).call(this,{type:"pause"})},onContinue:()=>{Se(this,Zn,Yr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===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(T),(m=(f=N(this,On).config).onSuccess)==null||m.call(f,T,this),(g=(y=N(this,On).config).onSettled)==null||g.call(y,T,this.state.error,this),T}catch(T){if(T instanceof vd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Zn,Yr).call(this,{type:"error",error:T}),(v=(k=N(this,On).config).onError)==null||v.call(k,T,this),(A=(w=N(this,On).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,On=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Zn=new WeakSet,Yr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...$h(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Gh(t.data,t.dataUpdatedAt),dataUpdateCount:r.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{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,On).notify({query:this,type:"updated",action:t})})},y5);function $h(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jw=(g5=class extends Ca{constructor(t,n){super();le(this,Ve);le(this,sn);le(this,Ue);le(this,vc);le(this,qt);le(this,ga);le(this,ko);le(this,Gr);le(this,ws);le(this,kc);le(this,Eo);le(this,To);le(this,xa);le(this,wa);le(this,vs);le(this,Co,new Set);this.options=n,ee(this,sn,t),ee(this,ws,null),ee(this,Gr,wd()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ue).addObserver(this),Vh(N(this,Ue),this.options)?Se(this,Ve,Cc).call(this):this.updateResult(),Se(this,Ve,Am).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kd(N(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kd(N(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Sm).call(this),Se(this,Ve,Im).call(this),N(this,Ue).removeObserver(this)}setOptions(t){const n=this.options,r=N(this,Ue);if(this.options=N(this,sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,N(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Pm).call(this),N(this,Ue).setOptions(this.options),n._defaulted&&!Fc(this.options,n)&&N(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ue),observer:this});const s=this.hasListeners();s&&Wh(N(this,Ue),r,this.options,n)&&Se(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||Xr(this.options.staleTime,N(this,Ue))!==Xr(n.staleTime,N(this,Ue)))&&Se(this,Ve,Em).call(this);const a=Se(this,Ve,Tm).call(this);s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||a!==N(this,vs))&&Se(this,Ve,Cm).call(this,a)}getOptimisticResult(t){const n=N(this,sn).getQueryCache().build(N(this,sn),t),r=this.createResult(n,t);return t3(this,r)&&(ee(this,qt,r),ee(this,ko,this.options),ee(this,ga,N(this,Ue).state)),r}getCurrentResult(){return N(this,qt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gr).status==="pending"&&N(this,Gr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){N(this,Co).add(t)}getCurrentQuery(){return N(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,sn).defaultQueryOptions(t),r=N(this,sn).getQueryCache().build(N(this,sn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Se(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,n){var b;const r=N(this,Ue),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,ko),l=t!==r?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(n._optimisticResults){const x=this.hasListeners(),S=!x&&Vh(t,n),P=x&&Wh(t,r,n,s);(S||P)&&(d={...d,...$h(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:k}=d;m=d.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&k==="pending"){let x;a!=null&&a.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof n.placeholderData=="function"?n.placeholderData((b=N(this,To))==null?void 0:b.state.data,N(this,To)):n.placeholderData,x!==void 0&&(k="success",m=gd(a==null?void 0:a.data,x,n),f=!0)}if(n.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&n.select===N(this,kc))m=N(this,Eo);else try{ee(this,kc,n.select),m=n.select(m),m=gd(a==null?void 0:a.data,m,n),ee(this,Eo,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,Eo),g=Date.now(),k="error");const w=d.fetchStatus==="fetching",A=k==="pending",T=k==="error",D=A&&w,L=m!==void 0,h={status:k,fetchStatus:d.fetchStatus,isPending:A,isSuccess:k==="success",isError:T,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:w,isRefetching:w&&!A,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:Ed(t,n),refetch:this.refetch,promise:N(this,Gr),isEnabled:En(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=O=>{h.status==="error"?O.reject(h.error):h.data!==void 0&&O.resolve(h.data)},S=()=>{const O=ee(this,Gr,h.promise=wd());x(O)},P=N(this,Gr);switch(P.status){case"pending":t.queryHash===r.queryHash&&x(P);break;case"fulfilled":(h.status==="error"||h.data!==P.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==P.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),n=this.createResult(N(this,Ue),this.options);if(ee(this,ga,N(this,Ue).state),ee(this,ko,this.options),N(this,ga).data!==void 0&&ee(this,To,N(this,Ue)),Fc(n,t))return;ee(this,qt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Co).size)return!0;const o=new Set(a??N(this,Co));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)})};Se(this,Ve,O5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Am).call(this)}},sn=new WeakMap,Ue=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,ko=new WeakMap,Gr=new WeakMap,ws=new WeakMap,kc=new WeakMap,Eo=new WeakMap,To=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,Co=new WeakMap,Ve=new WeakSet,Cc=function(t){Se(this,Ve,Pm).call(this);let n=N(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},Em=function(){Se(this,Ve,Sm).call(this);const t=Xr(this.options.staleTime,N(this,Ue));if(Fs||N(this,qt).isStale||!md(t))return;const r=Fh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Os.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},r))},Tm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ue)):this.options.refetchInterval)??!1},Cm=function(t){Se(this,Ve,Im).call(this),ee(this,vs,t),!(Fs||En(this.options.enabled,N(this,Ue))===!1||!md(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Os.setInterval(()=>{(this.options.refetchIntervalInBackground||xd.isFocused())&&Se(this,Ve,Cc).call(this)},N(this,vs)))},Am=function(){Se(this,Ve,Em).call(this),Se(this,Ve,Cm).call(this,Se(this,Ve,Tm).call(this))},Sm=function(){N(this,xa)&&(Os.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Im=function(){N(this,wa)&&(Os.clearInterval(N(this,wa)),ee(this,wa,void 0))},Pm=function(){const t=N(this,sn).getQueryCache().build(N(this,sn),this.options);if(t===N(this,Ue))return;const n=N(this,Ue);ee(this,Ue,t),ee(this,vc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},O5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,qt))}),N(this,sn).getQueryCache().notify({query:N(this,Ue),type:"observerResultsUpdated"})})},g5);function e3(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Vh(e,t){return e3(e,t)||e.state.data!==void 0&&kd(e,t,t.refetchOnMount)}function kd(e,t,n){if(En(t.enabled,e)!==!1&&Xr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ed(e,t)}return!1}function Wh(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ed(e,n)}function Ed(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(Xr(t.staleTime,e))}function t3(e,t){return!Fc(e.getCurrentResult(),t)}function qh(e){return{onFetch:(t,n)=>{var u,d,f,m,y;const r=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 k=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Nh(t.options,t.fetchOptions),w=async(A,T,D)=>{if(g)return Promise.reject();if(T==null&&A.pages.length)return Promise.resolve(A);const C=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return k(S),S})(),h=await v(C),{maxPages:b}=t.options,x=D?Ww:Vw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,T,b)}};if(s&&a.length){const A=s==="backward",T=A?n3:Yh,D={pages:a,pageParams:o},L=T(r,D);i=await w(D,L,A)}else{const A=e??a.length;do{const T=c===0?o[0]??r.initialPageParam:Yh(r,i);if(c>0&&T==null)break;i=await w(i,T),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,k;return(k=(g=t.options).persister)==null?void 0:k.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function Yh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function n3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var r3=(x5=class extends Hh{constructor(t){super();le(this,hr);le(this,Ec);le(this,mr);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mr,[]),this.state=t.state||Kh(),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,mr).includes(t)||(N(this,mr).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mr,N(this,mr).filter(n=>n!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mr).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,k,v,w,A,T,D,L,C,h,b;const n=()=>{Se(this,hr,As).call(this,{type:"continue"})},r={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Rh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,hr,As).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,hr,As).call(this,{type:"pause"})},onContinue:n,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)n();else{Se(this,hr,As).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,r));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));S!==this.state.context&&Se(this,hr,As).call(this,{type:"pending",context:S,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,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,r)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,x,null,t,this.state.context,r)),Se(this,hr,As).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,r)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,r)),await((C=(L=N(this,Yt).config).onSettled)==null?void 0:C.call(L,void 0,x,this.state.variables,this.state.context,this,r)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,r)),x}finally{Se(this,hr,As).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mr=new WeakMap,Yt=new WeakMap,va=new WeakMap,hr=new WeakSet,As=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{N(this,mr).forEach(r=>{r.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Kh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s3=(w5=class extends Ca{constructor(t={}){super();le(this,jr);le(this,Xn);le(this,Tc);this.config=t,ee(this,jr,new Set),ee(this,Xn,new Map),ee(this,Tc,0)}build(t,n,r){const s=new r3({client:t,mutationCache:this,mutationId:++Ku(this,Tc)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){N(this,jr).add(t);const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);r?r.push(t):N(this,Xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jr).delete(t)){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&N(this,Xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=_c(t);if(typeof n=="string"){const s=(r=N(this,Xn).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,jr).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jr).clear(),N(this,Xn).clear()})}getAll(){return Array.from(N(this,jr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Dh(n,r))}findAll(t={}){return this.getAll().filter(n=>Dh(t,n))}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},jr=new WeakMap,Xn=new WeakMap,Tc=new WeakMap,w5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var a3=(v5=class extends Ca{constructor(t,n){super();le(this,qr);le(this,Vr);le(this,ks);le(this,an);le(this,Wr);ee(this,Vr,t),this.setOptions(n),this.bindMethods(),Se(this,qr,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=N(this,Vr).defaultMutationOptions(t),Fc(this.options,n)||N(this,Vr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,an),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Us(n.mutationKey)!==Us(this.options.mutationKey)?this.reset():((r=N(this,an))==null?void 0:r.state.status)==="pending"&&N(this,an).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,an))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,qr,Zu).call(this),Se(this,qr,Bm).call(this,t)}getCurrentResult(){return N(this,ks)}reset(){var t;(t=N(this,an))==null||t.removeObserver(this),ee(this,an,void 0),Se(this,qr,Zu).call(this),Se(this,qr,Bm).call(this)}mutate(t,n){var r;return ee(this,Wr,n),(r=N(this,an))==null||r.removeObserver(this),ee(this,an,N(this,Vr).getMutationCache().build(N(this,Vr),this.options)),N(this,an).addObserver(this),N(this,an).execute(t)}},Vr=new WeakMap,ks=new WeakMap,an=new WeakMap,Wr=new WeakMap,qr=new WeakSet,Zu=function(){var n;const t=((n=N(this,an))==null?void 0:n.state)??Kh();ee(this,ks,{...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){kt.batch(()=>{var n,r,s,a,o,i,c,l;if(N(this,Wr)&&this.hasListeners()){const u=N(this,ks).variables,d=N(this,ks).context,f={client:N(this,Vr),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((r=(n=N(this,Wr)).onSuccess)==null||r.call(n,t.data,u,d,f),(a=(s=N(this,Wr)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wr)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wr)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,ks))})})},v5),o3=(k5=class extends Ca{constructor(t={}){super();le(this,br);this.config=t,ee(this,br,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??hd(s,n);let o=this.get(a);return o||(o=new Qw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,br).has(t.queryHash)||(N(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,br).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,br).get(t)}getAll(){return[...N(this,br).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Uh(t,r)):n}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,k5),i3=(E5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,Ts);le(this,Ao);le(this,So);le(this,Cs);le(this,Io);le(this,Po);ee(this,ft,e.queryCache||new o3),ee(this,Es,e.mutationCache||new s3),ee(this,Ts,e.defaultOptions||{}),ee(this,Ao,new Map),ee(this,So,new Map),ee(this,Cs,0)}mount(){Ku(this,Cs)._++,N(this,Cs)===1&&(ee(this,Io,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Po,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Io))==null||e.call(this),ee(this,Io,void 0),(t=N(this,Po))==null||t.call(this),ee(this,Po,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,ft).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(r.queryHash),a=s==null?void 0:s.state.data,o=$w(t,a);if(o!==void 0)return N(this,ft).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,ft);return kt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,ft).build(this,t);return n.isStaleByTime(Xr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=qh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=qh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,Ts)}setDefaultOptions(e){ee(this,Ts,e)}setQueryDefaults(e,t){N(this,Ao).set(Us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],n={};return t.forEach(r=>{Fo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,So).set(Us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],n={};return t.forEach(r=>{Fo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ts).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,Ts).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,Ts=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Io=new WeakMap,Po=new WeakMap,E5),Zh=gt.createContext(void 0),Uo=e=>{const t=gt.useContext(Zh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},c3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Zh.Provider,{value:e,children:t})),Xh=gt.createContext(!1),l3=()=>gt.useContext(Xh);Xh.Provider;function u3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var d3=gt.createContext(u3()),p3=()=>gt.useContext(d3),f3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},m3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},h3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Lh(n,[e.error,r])),b3=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},y3=(e,t)=>e.isLoading&&e.isFetching&&!t,g3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Qh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function x3(e,t,n){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 r=l3(),s=p3(),a=Uo(),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=r?"isRestoring":"optimistic",b3(o),f3(o,s),m3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(k=>{const v=u?c.subscribe(kt.batchCalls(k)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),g3(o,l))throw Qh(o,c,s);if(h3({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&&!Fs&&y3(l,r)){const k=i?Qh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;k==null||k.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function w3(e,t){return x3(e,Jw)}function xr(e,t){const n=Uo(),[r]=gt.useState(()=>new a3(n,e));gt.useEffect(()=>{r.setOptions(e)},[r,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>r.subscribe(kt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=gt.useCallback((o,i)=>{r.mutate(o,i).catch(jt)},[r]);if(s.error&&Lh(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const v3=M.createContext(null),Td={didCatch:!1,error:null};class k3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Td}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:a,reason:"imperative-api"}),this.setState(Td)}}componentDidCatch(t,n){var r,s;(r=(s=this.props).onError)===null||r===void 0||r.call(s,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:s}=this.props;if(r&&n.error!==null&&E3(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(Td)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(c);else if(r)i=M.createElement(r,c);else if(s!==void 0)i=s;else throw o}return M.createElement(v3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function E3(){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((n,r)=>!Object.is(n,t[r]))}(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 Do({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const Jh=M.createContext({});function T3({children:e,...t}){return B.jsx(Jh.Provider,{value:t,children:e})}const Jn=()=>M.useContext(Jh);var Et=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(Et||{});const C3=({className:e="",size:t=38,borderWidth:n=3,borderColor:r="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${n}px`,"--border-color":r,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Mc({className:e="",body:t,footerLink:n,footerText:r,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(B3,{}),s&&B.jsx(Do,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(A3,{link:n,text:r}),a]})}const A3=({link:e,text:t})=>{const{swapStatus:n}=Jn();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(F3,{}),e?B.jsx(S3,{link:e,text:t}):n===Et.FAILED?void 0:B.jsx(Do,{children:t})]})},S3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function I3(){const{components:e}=Jn();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 P3(){const{components:e}=Jn();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 B3=()=>{const{swapStatus:e}=Jn();return e===Et.SUCCESS?B.jsx(I3,{}):e===Et.FAILED?B.jsx(P3,{}):B.jsx(O3,{})},O3=()=>{const{components:e}=Jn();return e.Loader?e.Loader:B.jsx(C3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},F3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:n}=Jn();return n!==Et.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")})})},U3=({error:e,footerLink:t,footerText:n})=>B.jsx(Mc,{footerLink:t,footerText:n,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function D3(){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 e1=({inTokenOnly:e})=>{const{inToken:t,outToken:n,inAmount:r,outAmount:s,components:a}=Jn();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(t1,{token:t,amount:r,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(D3,{}),B.jsx(t1,{token:n,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},t1=({token:e,amount:t,Logo:n})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[n||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Do,{children:[t," ",e==null?void 0:e.symbol]})]});function _3({title:e,footerLink:t,footerText:n,hideTokens:r}){return B.jsx(Mc,{title:e,className:Ne("Success"),body:!r&&B.jsx(e1,{}),footerLink:t,footerText:n})}const n1=({$gap:e=10,$alignItems:t="flex-start",children:n,className:r="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${r}`,style:a,children:n})};function r1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const M3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(r1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(r1,{className:`${Ne("MainContentRectengularLoader")}`})]}),N3=({fromTitle:e,toTitle:t,inUsd:n,outUsd:r})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Jn(),d=B.jsx(a1,{fromTitle:e,inUsd:n,inToken:i,toTitle:t,outUsd:r,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(L3,{}):B.jsxs(n1,{children:[d,B.jsx(M3,{})]}):B.jsx(n1,{children:d})},s1=({amount:e,token:t,usd:n,title:r,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Do,{className:`${Ne("MainTokenTitle")}`,children:r}),B.jsx(Do,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),n&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:n})]}),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 L3(){const{currentStep:e}=Jn();return e?B.jsx(Mc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(e1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const a1=({fromTitle:e,inUsd:t,inToken:n,toTitle:r,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(s1,{title:e||"Swap from",usd:t,token:n,amount:o,Logo:c}),B.jsx(s1,{title:r||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qr=e=>B.jsx(T3,{...e,children:B.jsx(z3,{})}),z3=()=>{const{swapStatus:e,components:t,className:n}=Jn();return B.jsx("div",{className:`${Ne("SwapFlow")} ${n}`,children:e===Et.SUCCESS?t==null?void 0:t.Success:e===Et.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qr.Success=_3,Qr.Failed=U3,Qr.Main=N3,Qr.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 R3=e=>e.replace(/,/g,""),H3=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}},o1=e=>{if(!e)return"";const t=Math.floor(e/1e3),n=Math.floor(t/(1440*60)),r=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return n&&o.push(`${n} days `),r&&o.push(`${r} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Cd=(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 _o(e,t=6,n=8){if(!e)return"";const r=e.startsWith("-")?"-":"",s=r?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return r+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return r+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>n)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?r+"0."+c+u:"0"}const Ad=e=>{var t,n,r,s;if(e!=null&&e.message)return((n=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:n.includes("rejected"))||((s=(r=e.message)==null?void 0:r.toLowerCase())==null?void 0:s.includes("denied"))},G3=e=>{switch(e){case Ot.base.id:return 1e-4;default:return .01}},i1=(e,t,n)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const r=Qn(t,e.srcAmountFilled),s=Qn(n,e.dstAmountFilled);return j(s).div(r).toFixed()},c1=(e,t,n)=>{if(e.type===dt.TWAP_MARKET)return"";const r=Qn(t,e.srcAmountPerTrade),s=Qn(n,e.dstMinAmountPerTrade);return j(s).div(r).toFixed()},l1=(e,t)=>{const n=Bs(t);return n&&Ps(e.address)?n.wToken:e};function u1(e){return e?e/864e5:0}function Sd(e){return e?e/6e4:0}const j3=(e,t)=>e?dt.TWAP_MARKET:t===1?dt.LIMIT:dt.TWAP_LIMIT,Id=(e,t,n)=>{const r=Bs(n);return Ps((e==null?void 0:e.address)||"")&&Is((t==null?void 0:t.address)||"",(r==null?void 0:r.wToken.address)||"")},Pd=(e,t,n)=>{const r=Bs(n);return Is((e==null?void 0:e.address)||"",(r==null?void 0:r.wToken.address)||"")&&Ps((t==null?void 0:t.address)||"")},Mo=(e,t)=>{if(!t)return"";const n=Bs(t);return`${n==null?void 0:n.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const a=typeof s=="function"?s(r):s,o={...r,...a};return Object.assign(o,{extend:n(o)})}}return Object.assign(t,{extend:n(t)})}function V3(){return{}}const W3=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}),q3=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}),Y3=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}),K3=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}),Z3=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}),X3=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}),d1="2.43.3";let No={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${d1}`},$=class Om extends Error{constructor(t,n={}){var i;const r=(()=>{var c;return n.cause instanceof Om?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof Om&&n.cause.docsPath||n.docsPath,a=(i=No.getDocsUrl)==null?void 0:i.call(No,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...No.version?[`Version: ${No.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 Bw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Ow=async({chainId:e,signal:t,page:n,limit:r,filters:s})=>{const a=await Sw({chainId:e,signal:t,page:n,limit:r,filters:s}),[o,i]=await Promise.all([Pw({chainId:e,orders:a,signal:t}),Iw({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)&&Is(d.exchange,l.exchange)&&Is(d.twapAddress,l.twapAddress));return Cw(l,e,u,Fw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Fw=(e,t,n)=>{var o;const r=(o=n==null?void 0:n.find(i=>i.twapId===e.Contract_id.toString()&&Is(i.twapAddress,e.twapAddress)))==null?void 0:o.status,{filledSrcAmount:s}=Ch(t),a=Sh(e.ask_srcAmount,s);return Uw(a,e.ask_deadline*1e3,r)},Sh=(e,t)=>{if(!t||!e)return 0;const n=j(t).dividedBy(e).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Uw=(e,t,n)=>e===100?Qe.Completed:n==="CANCELED"?Qe.Canceled:n==="COMPLETED"?Qe.Completed:t>Date.now()?Qe.Open:Qe.Expired,Ih=async({signal:e,page:t,chainId:n,limit:r,config:s,account:a})=>(await Promise.all([s?Ow({chainId:n,signal:e,page:t,limit:r,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),kw({chainId:n,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Ph=e=>{let t;const n=new Set,r=(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),n.forEach(m=>m(t,f))}},s=()=>t,i={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,i);return i},Dw=(e=>e?Ph(e):Ph),_w=e=>e;function Mw(e,t=_w){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Bh=e=>{const t=Dw(e),n=r=>Mw(t,r);return Object.assign(n,t),n},Nw=(e=>e?Bh(e):Bh),Oh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Nw((e,t)=>({state:Oh,updateState:n=>e(r=>({state:{...r.state,...n}})),updateSwapExecution:n=>e(r=>({state:{...r.state,swapExecution:{...r.state.swapExecution,...n}}})),resetState:()=>{e({state:{...Oh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Lw={version:"0.0.23"};var Ca=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(){}},zw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Rw=(f5=class{constructor(){le(this,fr,zw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fr),provider:e}),ee(this,fr,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,fr).setTimeout(e,t)}clearTimeout(e){N(this,fr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setInterval(e,t)}clearInterval(e){N(this,fr).clearInterval(e)}},fr=new WeakMap,pa=new WeakMap,f5),Os=new Rw;function Hw(e){setTimeout(e,0)}var Fs=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 Fh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xr(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Uh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(r){if(t.queryHash!==hd(o,t.options))return!1}else if(!Fo(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Dh(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Us(t.options.mutationKey)!==Us(a))return!1}else if(!Fo(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function hd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Us)(e)}function Us(e){return JSON.stringify(e,(t,n)=>yd(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fo(e[n],t[n])):!1}var Gw=Object.prototype.hasOwnProperty;function bd(e,t){if(e===t)return e;const n=_h(e)&&_h(t);if(!n&&!(yd(e)&&yd(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,i=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=n?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(n?l<s:Gw.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 n in e)if(e[n]!==t[n])return!1;return!0}function _h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yd(e){if(!Mh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Mh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Mh(e){return Object.prototype.toString.call(e)==="[object Object]"}function jw(e){return new Promise(t=>{Os.setTimeout(t,e)})}function gd(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bd(e,t)}catch(r){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. [${n.queryHash}]: ${r}`),r}return bd(e,t)}return t}function Vw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ww(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uc=Symbol();function Nh(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 Lh(e,t){return typeof e=="function"?e(...t):!!e}var qw=(m5=class extends Ca{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}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 n;ee(this,go,t),(n=N(this,gs))==null||n.call(this),ee(this,gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(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 qw;function wd(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Yw=Hw;function Kw(){let e=[],t=0,n=i=>{i()},r=i=>{i()},s=Yw;const a=i=>{t?e.push(i):s(()=>{n(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{r(()=>{i.forEach(c=>{n(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=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{s=i}}}var kt=Kw(),Zw=(h5=class extends Ca{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Fs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}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 n;ee(this,wo,t),(n=N(this,xs))==null||n.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),Dc=new Zw;function Xw(e){return Math.min(1e3*2**e,3e4)}function zh(e){return(e??"online")==="online"?Dc.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 Rh(e){let t=!1,n=0,r;const s=wd(),a=()=>s.status!=="pending",o=g=>{var k;if(!a()){const v=new vd(g);f(v),(k=e.onCancel)==null||k.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>xd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>zh(e.networkMode)&&e.canRun(),d=g=>{a()||(r==null||r(),s.resolve(g))},f=g=>{a()||(r==null||r(),s.reject(g))},m=()=>new Promise(g=>{var k;r=v=>{(a()||l())&&g(v)},(k=e.onPause)==null||k.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const k=n===0?e.initialPromise:void 0;try{g=k??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Fs?0:3),A=e.retryDelay??Xw,T=typeof A=="function"?A(n,v):A,D=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!D){f(v);return}n++,(L=e.onFail)==null||L.call(e,n,v),jw(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Hh=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&ee(this,ma,Os.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Os.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Qw=(y5=class extends Hh{constructor(t){super();le(this,Zn);le(this,ha);le(this,vo);le(this,On);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,On,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,jh(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,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=jh(this.options);n.data!==void 0&&(this.setState(Gh(n.data,n.dataUpdatedAt)),ee(this,ha,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,On).remove(this)}setData(t,n){const r=gd(this.state.data,t,this.options);return Se(this,Zn,Yr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Se(this,Zn,Yr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Bt))==null?void 0:r.promise;return(s=N(this,Bt))==null||s.cancel(t),n?n.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=>En(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=>Xr(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:!Fh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Zn,Yr).call(this,{type:"invalidate"})}async fetch(t,n){var c,l,u,d,f,m,y,g,k,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.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 T=this.observers.find(D=>D.options.queryFn);T&&this.setOptions(T.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 r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),r.signal)})},a=()=>{const T=Nh(this.options,n),L=(()=>{const C={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,ya,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(T),T})();(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))&&Se(this,Zn,Yr).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Rh({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof vd&&T.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),r.abort()},onFail:(T,D)=>{Se(this,Zn,Yr).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Zn,Yr).call(this,{type:"pause"})},onContinue:()=>{Se(this,Zn,Yr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===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(T),(m=(f=N(this,On).config).onSuccess)==null||m.call(f,T,this),(g=(y=N(this,On).config).onSettled)==null||g.call(y,T,this.state.error,this),T}catch(T){if(T instanceof vd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Zn,Yr).call(this,{type:"error",error:T}),(v=(k=N(this,On).config).onError)==null||v.call(k,T,this),(A=(w=N(this,On).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,On=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Zn=new WeakSet,Yr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...$h(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Gh(t.data,t.dataUpdatedAt),dataUpdateCount:r.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{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,On).notify({query:this,type:"updated",action:t})})},y5);function $h(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jw=(g5=class extends Ca{constructor(t,n){super();le(this,Ve);le(this,sn);le(this,Ue);le(this,vc);le(this,qt);le(this,ga);le(this,ko);le(this,Gr);le(this,ws);le(this,kc);le(this,Eo);le(this,To);le(this,xa);le(this,wa);le(this,vs);le(this,Co,new Set);this.options=n,ee(this,sn,t),ee(this,ws,null),ee(this,Gr,wd()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ue).addObserver(this),Vh(N(this,Ue),this.options)?Se(this,Ve,Cc).call(this):this.updateResult(),Se(this,Ve,Am).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kd(N(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kd(N(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Sm).call(this),Se(this,Ve,Im).call(this),N(this,Ue).removeObserver(this)}setOptions(t){const n=this.options,r=N(this,Ue);if(this.options=N(this,sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,N(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Pm).call(this),N(this,Ue).setOptions(this.options),n._defaulted&&!Fc(this.options,n)&&N(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ue),observer:this});const s=this.hasListeners();s&&Wh(N(this,Ue),r,this.options,n)&&Se(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||Xr(this.options.staleTime,N(this,Ue))!==Xr(n.staleTime,N(this,Ue)))&&Se(this,Ve,Em).call(this);const a=Se(this,Ve,Tm).call(this);s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||a!==N(this,vs))&&Se(this,Ve,Cm).call(this,a)}getOptimisticResult(t){const n=N(this,sn).getQueryCache().build(N(this,sn),t),r=this.createResult(n,t);return t3(this,r)&&(ee(this,qt,r),ee(this,ko,this.options),ee(this,ga,N(this,Ue).state)),r}getCurrentResult(){return N(this,qt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gr).status==="pending"&&N(this,Gr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){N(this,Co).add(t)}getCurrentQuery(){return N(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,sn).defaultQueryOptions(t),r=N(this,sn).getQueryCache().build(N(this,sn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Se(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,n){var b;const r=N(this,Ue),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,ko),l=t!==r?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(n._optimisticResults){const x=this.hasListeners(),S=!x&&Vh(t,n),P=x&&Wh(t,r,n,s);(S||P)&&(d={...d,...$h(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:k}=d;m=d.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&k==="pending"){let x;a!=null&&a.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof n.placeholderData=="function"?n.placeholderData((b=N(this,To))==null?void 0:b.state.data,N(this,To)):n.placeholderData,x!==void 0&&(k="success",m=gd(a==null?void 0:a.data,x,n),f=!0)}if(n.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&n.select===N(this,kc))m=N(this,Eo);else try{ee(this,kc,n.select),m=n.select(m),m=gd(a==null?void 0:a.data,m,n),ee(this,Eo,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,Eo),g=Date.now(),k="error");const w=d.fetchStatus==="fetching",A=k==="pending",T=k==="error",D=A&&w,L=m!==void 0,h={status:k,fetchStatus:d.fetchStatus,isPending:A,isSuccess:k==="success",isError:T,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:w,isRefetching:w&&!A,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:Ed(t,n),refetch:this.refetch,promise:N(this,Gr),isEnabled:En(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=O=>{h.status==="error"?O.reject(h.error):h.data!==void 0&&O.resolve(h.data)},S=()=>{const O=ee(this,Gr,h.promise=wd());x(O)},P=N(this,Gr);switch(P.status){case"pending":t.queryHash===r.queryHash&&x(P);break;case"fulfilled":(h.status==="error"||h.data!==P.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==P.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),n=this.createResult(N(this,Ue),this.options);if(ee(this,ga,N(this,Ue).state),ee(this,ko,this.options),N(this,ga).data!==void 0&&ee(this,To,N(this,Ue)),Fc(n,t))return;ee(this,qt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Co).size)return!0;const o=new Set(a??N(this,Co));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)})};Se(this,Ve,O5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Am).call(this)}},sn=new WeakMap,Ue=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,ko=new WeakMap,Gr=new WeakMap,ws=new WeakMap,kc=new WeakMap,Eo=new WeakMap,To=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,Co=new WeakMap,Ve=new WeakSet,Cc=function(t){Se(this,Ve,Pm).call(this);let n=N(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},Em=function(){Se(this,Ve,Sm).call(this);const t=Xr(this.options.staleTime,N(this,Ue));if(Fs||N(this,qt).isStale||!md(t))return;const r=Fh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Os.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},r))},Tm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ue)):this.options.refetchInterval)??!1},Cm=function(t){Se(this,Ve,Im).call(this),ee(this,vs,t),!(Fs||En(this.options.enabled,N(this,Ue))===!1||!md(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Os.setInterval(()=>{(this.options.refetchIntervalInBackground||xd.isFocused())&&Se(this,Ve,Cc).call(this)},N(this,vs)))},Am=function(){Se(this,Ve,Em).call(this),Se(this,Ve,Cm).call(this,Se(this,Ve,Tm).call(this))},Sm=function(){N(this,xa)&&(Os.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Im=function(){N(this,wa)&&(Os.clearInterval(N(this,wa)),ee(this,wa,void 0))},Pm=function(){const t=N(this,sn).getQueryCache().build(N(this,sn),this.options);if(t===N(this,Ue))return;const n=N(this,Ue);ee(this,Ue,t),ee(this,vc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},O5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,qt))}),N(this,sn).getQueryCache().notify({query:N(this,Ue),type:"observerResultsUpdated"})})},g5);function e3(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Vh(e,t){return e3(e,t)||e.state.data!==void 0&&kd(e,t,t.refetchOnMount)}function kd(e,t,n){if(En(t.enabled,e)!==!1&&Xr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ed(e,t)}return!1}function Wh(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ed(e,n)}function Ed(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(Xr(t.staleTime,e))}function t3(e,t){return!Fc(e.getCurrentResult(),t)}function qh(e){return{onFetch:(t,n)=>{var u,d,f,m,y;const r=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 k=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Nh(t.options,t.fetchOptions),w=async(A,T,D)=>{if(g)return Promise.reject();if(T==null&&A.pages.length)return Promise.resolve(A);const C=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return k(S),S})(),h=await v(C),{maxPages:b}=t.options,x=D?Ww:Vw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,T,b)}};if(s&&a.length){const A=s==="backward",T=A?n3:Yh,D={pages:a,pageParams:o},L=T(r,D);i=await w(D,L,A)}else{const A=e??a.length;do{const T=c===0?o[0]??r.initialPageParam:Yh(r,i);if(c>0&&T==null)break;i=await w(i,T),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,k;return(k=(g=t.options).persister)==null?void 0:k.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function Yh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function n3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var r3=(x5=class extends Hh{constructor(t){super();le(this,hr);le(this,Ec);le(this,mr);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mr,[]),this.state=t.state||Kh(),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,mr).includes(t)||(N(this,mr).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mr,N(this,mr).filter(n=>n!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mr).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,k,v,w,A,T,D,L,C,h,b;const n=()=>{Se(this,hr,As).call(this,{type:"continue"})},r={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Rh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,hr,As).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,hr,As).call(this,{type:"pause"})},onContinue:n,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)n();else{Se(this,hr,As).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,r));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));S!==this.state.context&&Se(this,hr,As).call(this,{type:"pending",context:S,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,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,r)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,x,null,t,this.state.context,r)),Se(this,hr,As).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,r)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,r)),await((C=(L=N(this,Yt).config).onSettled)==null?void 0:C.call(L,void 0,x,this.state.variables,this.state.context,this,r)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,r)),x}finally{Se(this,hr,As).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mr=new WeakMap,Yt=new WeakMap,va=new WeakMap,hr=new WeakSet,As=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{N(this,mr).forEach(r=>{r.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Kh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s3=(w5=class extends Ca{constructor(t={}){super();le(this,jr);le(this,Xn);le(this,Tc);this.config=t,ee(this,jr,new Set),ee(this,Xn,new Map),ee(this,Tc,0)}build(t,n,r){const s=new r3({client:t,mutationCache:this,mutationId:++Ku(this,Tc)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){N(this,jr).add(t);const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);r?r.push(t):N(this,Xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jr).delete(t)){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&N(this,Xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=_c(t);if(typeof n=="string"){const s=(r=N(this,Xn).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,jr).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jr).clear(),N(this,Xn).clear()})}getAll(){return Array.from(N(this,jr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Dh(n,r))}findAll(t={}){return this.getAll().filter(n=>Dh(t,n))}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},jr=new WeakMap,Xn=new WeakMap,Tc=new WeakMap,w5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var a3=(v5=class extends Ca{constructor(t,n){super();le(this,qr);le(this,Vr);le(this,ks);le(this,an);le(this,Wr);ee(this,Vr,t),this.setOptions(n),this.bindMethods(),Se(this,qr,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=N(this,Vr).defaultMutationOptions(t),Fc(this.options,n)||N(this,Vr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,an),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Us(n.mutationKey)!==Us(this.options.mutationKey)?this.reset():((r=N(this,an))==null?void 0:r.state.status)==="pending"&&N(this,an).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,an))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,qr,Zu).call(this),Se(this,qr,Bm).call(this,t)}getCurrentResult(){return N(this,ks)}reset(){var t;(t=N(this,an))==null||t.removeObserver(this),ee(this,an,void 0),Se(this,qr,Zu).call(this),Se(this,qr,Bm).call(this)}mutate(t,n){var r;return ee(this,Wr,n),(r=N(this,an))==null||r.removeObserver(this),ee(this,an,N(this,Vr).getMutationCache().build(N(this,Vr),this.options)),N(this,an).addObserver(this),N(this,an).execute(t)}},Vr=new WeakMap,ks=new WeakMap,an=new WeakMap,Wr=new WeakMap,qr=new WeakSet,Zu=function(){var n;const t=((n=N(this,an))==null?void 0:n.state)??Kh();ee(this,ks,{...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){kt.batch(()=>{var n,r,s,a,o,i,c,l;if(N(this,Wr)&&this.hasListeners()){const u=N(this,ks).variables,d=N(this,ks).context,f={client:N(this,Vr),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((r=(n=N(this,Wr)).onSuccess)==null||r.call(n,t.data,u,d,f),(a=(s=N(this,Wr)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wr)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wr)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,ks))})})},v5),o3=(k5=class extends Ca{constructor(t={}){super();le(this,br);this.config=t,ee(this,br,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??hd(s,n);let o=this.get(a);return o||(o=new Qw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,br).has(t.queryHash)||(N(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,br).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,br).get(t)}getAll(){return[...N(this,br).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Uh(t,r)):n}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,k5),i3=(E5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,Ts);le(this,Ao);le(this,So);le(this,Cs);le(this,Io);le(this,Po);ee(this,ft,e.queryCache||new o3),ee(this,Es,e.mutationCache||new s3),ee(this,Ts,e.defaultOptions||{}),ee(this,Ao,new Map),ee(this,So,new Map),ee(this,Cs,0)}mount(){Ku(this,Cs)._++,N(this,Cs)===1&&(ee(this,Io,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Po,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Io))==null||e.call(this),ee(this,Io,void 0),(t=N(this,Po))==null||t.call(this),ee(this,Po,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,ft).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(r.queryHash),a=s==null?void 0:s.state.data,o=$w(t,a);if(o!==void 0)return N(this,ft).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,ft);return kt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,ft).build(this,t);return n.isStaleByTime(Xr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=qh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=qh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,Ts)}setDefaultOptions(e){ee(this,Ts,e)}setQueryDefaults(e,t){N(this,Ao).set(Us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],n={};return t.forEach(r=>{Fo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,So).set(Us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],n={};return t.forEach(r=>{Fo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ts).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,Ts).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,Ts=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Io=new WeakMap,Po=new WeakMap,E5),Zh=gt.createContext(void 0),Uo=e=>{const t=gt.useContext(Zh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},c3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Zh.Provider,{value:e,children:t})),Xh=gt.createContext(!1),l3=()=>gt.useContext(Xh);Xh.Provider;function u3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var d3=gt.createContext(u3()),p3=()=>gt.useContext(d3),f3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},m3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},h3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Lh(n,[e.error,r])),b3=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},y3=(e,t)=>e.isLoading&&e.isFetching&&!t,g3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Qh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function x3(e,t,n){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 r=l3(),s=p3(),a=Uo(),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=r?"isRestoring":"optimistic",b3(o),f3(o,s),m3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(k=>{const v=u?c.subscribe(kt.batchCalls(k)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),g3(o,l))throw Qh(o,c,s);if(h3({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&&!Fs&&y3(l,r)){const k=i?Qh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;k==null||k.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function w3(e,t){return x3(e,Jw)}function xr(e,t){const n=Uo(),[r]=gt.useState(()=>new a3(n,e));gt.useEffect(()=>{r.setOptions(e)},[r,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>r.subscribe(kt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=gt.useCallback((o,i)=>{r.mutate(o,i).catch(jt)},[r]);if(s.error&&Lh(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const v3=M.createContext(null),Td={didCatch:!1,error:null};class k3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Td}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:a,reason:"imperative-api"}),this.setState(Td)}}componentDidCatch(t,n){var r,s;(r=(s=this.props).onError)===null||r===void 0||r.call(s,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:s}=this.props;if(r&&n.error!==null&&E3(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(Td)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(c);else if(r)i=M.createElement(r,c);else if(s!==void 0)i=s;else throw o}return M.createElement(v3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function E3(){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((n,r)=>!Object.is(n,t[r]))}(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 Do({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const Jh=M.createContext({});function T3({children:e,...t}){return B.jsx(Jh.Provider,{value:t,children:e})}const Jn=()=>M.useContext(Jh);var Et=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(Et||{});const C3=({className:e="",size:t=38,borderWidth:n=3,borderColor:r="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${n}px`,"--border-color":r,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Mc({className:e="",body:t,footerLink:n,footerText:r,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(B3,{}),s&&B.jsx(Do,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(A3,{link:n,text:r}),a]})}const A3=({link:e,text:t})=>{const{swapStatus:n}=Jn();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(F3,{}),e?B.jsx(S3,{link:e,text:t}):n===Et.FAILED?void 0:B.jsx(Do,{children:t})]})},S3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function I3(){const{components:e}=Jn();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 P3(){const{components:e}=Jn();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 B3=()=>{const{swapStatus:e}=Jn();return e===Et.SUCCESS?B.jsx(I3,{}):e===Et.FAILED?B.jsx(P3,{}):B.jsx(O3,{})},O3=()=>{const{components:e}=Jn();return e.Loader?e.Loader:B.jsx(C3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},F3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:n}=Jn();return n!==Et.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")})})},U3=({error:e,footerLink:t,footerText:n})=>B.jsx(Mc,{footerLink:t,footerText:n,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function D3(){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 e1=({inTokenOnly:e})=>{const{inToken:t,outToken:n,inAmount:r,outAmount:s,components:a}=Jn();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(t1,{token:t,amount:r,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(D3,{}),B.jsx(t1,{token:n,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},t1=({token:e,amount:t,Logo:n})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[n||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Do,{children:[t," ",e==null?void 0:e.symbol]})]});function _3({title:e,footerLink:t,footerText:n,hideTokens:r}){return B.jsx(Mc,{title:e,className:Ne("Success"),body:!r&&B.jsx(e1,{}),footerLink:t,footerText:n})}const n1=({$gap:e=10,$alignItems:t="flex-start",children:n,className:r="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${r}`,style:a,children:n})};function r1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const M3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(r1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(r1,{className:`${Ne("MainContentRectengularLoader")}`})]}),N3=({fromTitle:e,toTitle:t,inUsd:n,outUsd:r})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Jn(),d=B.jsx(a1,{fromTitle:e,inUsd:n,inToken:i,toTitle:t,outUsd:r,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(L3,{}):B.jsxs(n1,{children:[d,B.jsx(M3,{})]}):B.jsx(n1,{children:d})},s1=({amount:e,token:t,usd:n,title:r,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Do,{className:`${Ne("MainTokenTitle")}`,children:r}),B.jsx(Do,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),n&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:n})]}),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 L3(){const{currentStep:e}=Jn();return e?B.jsx(Mc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(e1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const a1=({fromTitle:e,inUsd:t,inToken:n,toTitle:r,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(s1,{title:e||"Swap from",usd:t,token:n,amount:o,Logo:c}),B.jsx(s1,{title:r||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qr=e=>B.jsx(T3,{...e,children:B.jsx(z3,{})}),z3=()=>{const{swapStatus:e,components:t,className:n}=Jn();return B.jsx("div",{className:`${Ne("SwapFlow")} ${n}`,children:e===Et.SUCCESS?t==null?void 0:t.Success:e===Et.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qr.Success=_3,Qr.Failed=U3,Qr.Main=N3,Qr.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 R3=e=>e.replace(/,/g,""),H3=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}},o1=e=>{if(!e)return"";const t=Math.floor(e/1e3),n=Math.floor(t/(1440*60)),r=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return n&&o.push(`${n} days `),r&&o.push(`${r} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Cd=(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 _o(e,t=6,n=8){if(!e)return"";const r=e.startsWith("-")?"-":"",s=r?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return r+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return r+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>n)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?r+"0."+c+u:"0"}const Ad=e=>{var t,n,r,s;if(e!=null&&e.message)return((n=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:n.includes("rejected"))||((s=(r=e.message)==null?void 0:r.toLowerCase())==null?void 0:s.includes("denied"))},G3=e=>{switch(e){case Ot.base.id:return 1e-4;default:return .01}},i1=(e,t,n)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const r=Qn(t,e.srcAmountFilled),s=Qn(n,e.dstAmountFilled);return j(s).div(r).toFixed()},c1=(e,t,n)=>{if(e.type===dt.TWAP_MARKET)return"";const r=Qn(t,e.srcAmountPerTrade),s=Qn(n,e.dstMinAmountPerTrade);return j(s).div(r).toFixed()},l1=(e,t)=>{const n=Bs(t);return n&&Ps(e.address)?n.wToken:e};function u1(e){return e?e/864e5:0}function Sd(e){return e?e/6e4:0}const j3=(e,t)=>e?dt.TWAP_MARKET:t===1?dt.LIMIT:dt.TWAP_LIMIT,Id=(e,t,n)=>{const r=Bs(n);return Ps((e==null?void 0:e.address)||"")&&Is((t==null?void 0:t.address)||"",(r==null?void 0:r.wToken.address)||"")},Pd=(e,t,n)=>{const r=Bs(n);return Is((e==null?void 0:e.address)||"",(r==null?void 0:r.wToken.address)||"")&&Ps((t==null?void 0:t.address)||"")},Mo=(e,t)=>{if(!t)return"";const n=Bs(t);return`${n==null?void 0:n.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const a=typeof s=="function"?s(r):s,o={...r,...a};return Object.assign(o,{extend:n(o)})}}return Object.assign(t,{extend:n(t)})}function V3(){return{}}const W3=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}),q3=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}),Y3=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}),K3=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}),Z3=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}),X3=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}),d1="2.43.3";let No={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${d1}`},$=class Om extends Error{constructor(t,n={}){var i;const r=(()=>{var c;return n.cause instanceof Om?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof Om&&n.cause.docsPath||n.docsPath,a=(i=No.getDocsUrl)==null?void 0:i.call(No,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...No.version?[`Version: ${No.version}`]:[]].join(`
65
65
  `);super(o,n.cause?{cause:n.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=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=d1}walk(t){return p1(this,t)}};function p1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?p1(e.cause,t):t?null:e}let f1=class extends ${constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Q3=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 J3 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 e8=class extends ${constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Dn(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ut(e){return Dn(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Zt(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}let m1=class extends ${constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},h1=class extends ${constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class b1 extends ${constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function _s(e,{dir:t,size:n=32}={}){return typeof e=="string"?Jr(e,{dir:t,size:n}):t8(e,{dir:t,size:n})}function Jr(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new h1({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function t8(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new h1({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";r[a?s:n-s-1]=e[a?s:e.length-s-1]}return r}const n8=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Oe(e,t={}){return typeof e=="number"||typeof e=="bigint"?q(e,t):typeof e=="string"?Aa(e,t):typeof e=="boolean"?y1(e,t):wt(e,t)}function y1(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(_n(n,{size:t.size}),_s(n,{size:t.size})):n}function wt(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=n8[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(_n(r,{size:t.size}),_s(r,{dir:"right",size:t.size})):r}function q(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new f1({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const i=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?_s(i,{size:r}):i}const r8=new TextEncoder;function Aa(e,t={}){const n=r8.encode(e);return wt(n,t)}const s8=new TextEncoder;function wr(e,t={}){return typeof e=="number"||typeof e=="bigint"?o8(e,t):typeof e=="boolean"?a8(e,t):Dn(e)?on(e,t):Ms(e,t)}function a8(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(_n(n,{size:t.size}),_s(n,{size:t.size})):n}const vr={zero:48,nine:57,A:65,F:70,a:97,f:102};function g1(e){if(e>=vr.zero&&e<=vr.nine)return e-vr.zero;if(e>=vr.A&&e<=vr.F)return e-(vr.A-10);if(e>=vr.a&&e<=vr.f)return e-(vr.a-10)}function on(e,t={}){let n=e;t.size&&(_n(n,{size:t.size}),n=_s(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,a=new Uint8Array(s);for(let o=0,i=0;o<s;o++){const c=g1(r.charCodeAt(i++)),l=g1(r.charCodeAt(i++));if(c===void 0||l===void 0)throw new $(`Invalid byte sequence ("${r[i-2]}${r[i-1]}" in "${r}").`);a[o]=c*16+l}return a}function o8(e,t){const n=q(e,t);return on(n)}function Ms(e,t={}){const n=s8.encode(e);return typeof t.size=="number"?(_n(n,{size:t.size}),_s(n,{dir:"right",size:t.size})):n}function _n(e,{size:t}){if(ut(e)>t)throw new e8({givenSize:ut(e),maxSize:t})}function Le(e,t={}){const{signed:n}=t;t.size&&_n(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return r<=a?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function i8(e,t={}){let n=e;if(t.size&&(_n(n,{size:t.size}),n=Zt(n)),Zt(n)==="0x00")return!1;if(Zt(n)==="0x01")return!0;throw new J3(n)}function cn(e,t={}){return Number(Le(e,t))}function Nc(e,t){return({exclude:n,format:r})=>({exclude:n,format:(s,a)=>{const o=t(s,a);if(n)for(const i of n)delete o[i];return{...o,...r(s,a)}},type:e})}const x1={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ns(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?cn(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?cn(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?x1[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&&(n.authorizationList=c8(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Lc=Nc("transaction",Ns);function c8(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 n=(e.transactions??[]).map(r=>typeof r=="string"?r:Ns(r));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:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Od=Nc("block",Bd);function er(e,{args:t,eventName:n}={}){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,...n?{args:t,eventName:n}:{}}}const w1={"0x0":"reverted","0x1":"success"};function zc(e,t){const n={...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(r=>er(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?cn(e.transactionIndex):null,status:e.status?w1[e.status]:null,type:e.type?x1[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Fd=Nc("transactionReceipt",zc),l8={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Mn(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=u8(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>wt(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=q(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=q(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=l8[e.type]),typeof e.value<"u"&&(n.value=q(e.value)),n}const Ud=Nc("transactionRequest",Mn);function u8(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 d8=2n**16n-1n,Ls=2n**256n-1n,Dd=50000n,v1=d8*32n,k1={block:Od({format(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>{var a;if(typeof r=="string")return r;const s=(a=k1.transaction)==null?void 0:a.format(r);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:Fd({format(e){return{l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Le(e.l1BatchTxIndex):null,logs:e.logs.map(t=>({...er(t),l1BatchNumber:t.l1BatchNumber?Le(t.l1BatchNumber):null,transactionLogIndex:cn(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:Ud({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Oe(e.gasPerPubdata)}:{gasPerPubdata:Oe(Dd)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(on(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(t=>Array.from(on(t)))}:{},...e.customSignature?{customSignature:Array.from(on(e.customSignature))}:{}},type:"0x71"}:{}}})};function ln(e){return typeof e[0]=="string"?un(e):p8(e)}function p8(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function un(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}let E1=class extends ${constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},T1=class extends ${constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},f8=class extends ${constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const m8={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 f8({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 E1({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 E1({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 n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(e);return this.position+=t??e,n},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 n=Object.create(m8);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function tr(e,t="hex"){const n=C1(e),r=_d(new Uint8Array(n.length));return n.encode(r),t==="hex"?wt(r.bytes):r.bytes}function C1(e){return Array.isArray(e)?h8(e.map(t=>C1(t))):b8(e)}function h8(e){const t=e.reduce((s,a)=>s+a.length,0),n=A1(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function b8(e){const t=typeof e=="string"?on(e):e,n=A1(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+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+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===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 y8={gwei:9,wei:18},g8={ether:-9,wei:9};function S1(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${a?`.${a}`:""}`}function Md(e,t="wei"){return S1(e,y8[t])}function Xt(e,t="wei"){return S1(e,g8[t])}function Lo(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
66
66
  `)}class x8 extends ${constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class w8 extends ${constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Lo(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 v8=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 k8 extends ${constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var y;const m=Lo({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.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:r,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:n,blockTag:r,hash:s,index:a}){let o="Transaction";r&&a!==void 0&&(o=`Transaction at block time "${r}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),n&&a!==void 0&&(o=`Transaction at block number "${n}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class P1 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 B1 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 E8 extends ${constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}function T8(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...a}=n,o=n.address;t.push([r?Oe(r):"0x",o,s?Oe(s):"0x",..._a({},a)])}return t}function Nd(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>on(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>wt(a))}function Ld(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>on(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>on(o)):e.commitments,a=[];for(let o=0;o<r.length;o++){const i=r[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(i,c)))}return n==="bytes"?a:a.map(o=>wt(o))}const Sa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function C8(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function zo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function zs(e,...t){if(!C8(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 A8(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");zo(e.outputLen),zo(e.blockLen)}function Ia(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 O1(e,t){zs(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function S8(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 nr(e,t){return e<<32-t|e>>>t}const I8=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function P8(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function B8(e){for(let t=0;t<e.length;t++)e[t]=P8(e[t]);return e}const F1=I8?e=>e:B8;function O8(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=O8(e)),zs(e),e}function F8(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];zs(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}class Rd{}function Hc(e){const t=r=>e().update(Rc(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function U8(e=32){if(Sa&&typeof Sa.getRandomValues=="function")return Sa.getRandomValues(new Uint8Array(e));if(Sa&&typeof Sa.randomBytes=="function")return Uint8Array.from(Sa.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function D8(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),i=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,i,r)}function _8(e,t,n){return e&t^~e&n}function M8(e,t,n){return e&t^e&n^t&n}class U1 extends Rd{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=zd(this.buffer)}update(t){Ia(this),t=Rc(t),zs(t);const{view:n,buffer:r,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}r.set(t.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Ia(this),O1(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,es(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;D8(r,s-8,BigInt(this.length*8),a),this.process(r,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:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:i}=this;return t.destroyed=o,t.finished=a,t.length=s,t.pos=i,s%n&&t.buffer.set(r),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),D1=BigInt(32);function N8(e,t=!1){return t?{h:Number(e&$c),l:Number(e>>D1&$c)}:{h:Number(e>>D1&$c)|0,l:Number(e&$c)|0}}function _1(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let a=0;a<n;a++){const{h:o,l:i}=N8(e[a],t);[r[a],s[a]]=[o,i]}return[r,s]}const M1=(e,t,n)=>e>>>n,N1=(e,t,n)=>e<<32-n|t>>>n,Pa=(e,t,n)=>e>>>n|t<<32-n,Ba=(e,t,n)=>e<<32-n|t>>>n,Gc=(e,t,n)=>e<<64-n|t>>>n-32,jc=(e,t,n)=>e>>>n-32|t<<64-n,L8=(e,t,n)=>e<<n|t>>>32-n,z8=(e,t,n)=>t<<n|e>>>32-n,R8=(e,t,n)=>t<<n-32|e>>>64-n,H8=(e,t,n)=>e<<n-32|t>>>64-n;function kr(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const $8=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),G8=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,j8=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),V8=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,W8=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),q8=(e,t,n,r,s,a)=>t+n+r+s+a+(e/2**32|0)|0,Y8=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]),ns=new Uint32Array(64);class K8 extends U1{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:n,C:r,D:s,E:a,F:o,G:i,H:c}=this;return[t,n,r,s,a,o,i,c]}set(t,n,r,s,a,o,i,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=i|0,this.H=c|0}process(t,n){for(let d=0;d<16;d++,n+=4)ns[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=ns[d-15],m=ns[d-2],y=nr(f,7)^nr(f,18)^f>>>3,g=nr(m,17)^nr(m,19)^m>>>10;ns[d]=g+ns[d-7]+y+ns[d-16]|0}let{A:r,B:s,C:a,D:o,E:i,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=nr(i,6)^nr(i,11)^nr(i,25),m=u+f+_8(i,c,l)+Y8[d]+ns[d]|0,g=(nr(r,2)^nr(r,13)^nr(r,22))+M8(r,s,a)|0;u=l,l=c,c=i,i=o+m|0,o=a,a=s,s=r,r=m+g|0}r=r+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(r,s,a,o,i,c,l,u)}roundClean(){es(ns)}destroy(){this.set(0,0,0,0,0,0,0,0),es(this.buffer)}}const L1=_1(["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))),Z8=L1[0],X8=L1[1],rs=new Uint32Array(80),ss=new Uint32Array(80);class z1 extends U1{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:n,Bh:r,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:k}=this;return[t,n,r,s,a,o,i,c,l,u,d,f,m,y,g,k]}set(t,n,r,s,a,o,i,c,l,u,d,f,m,y,g,k){this.Ah=t|0,this.Al=n|0,this.Bh=r|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=k|0}process(t,n){for(let A=0;A<16;A++,n+=4)rs[A]=t.getUint32(n),ss[A]=t.getUint32(n+=4);for(let A=16;A<80;A++){const T=rs[A-15]|0,D=ss[A-15]|0,L=Pa(T,D,1)^Pa(T,D,8)^M1(T,D,7),C=Ba(T,D,1)^Ba(T,D,8)^N1(T,D,7),h=rs[A-2]|0,b=ss[A-2]|0,x=Pa(h,b,19)^Gc(h,b,61)^M1(h,b,6),S=Ba(h,b,19)^jc(h,b,61)^N1(h,b,6),P=j8(C,S,ss[A-7],ss[A-16]),O=V8(P,L,x,rs[A-7],rs[A-16]);rs[A]=O|0,ss[A]=P|0}let{Ah:r,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:k,Hh:v,Hl:w}=this;for(let A=0;A<80;A++){const T=Pa(d,f,14)^Pa(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,C=f&y^~f&k,h=W8(w,D,C,X8[A],ss[A]),b=q8(h,v,T,L,Z8[A],rs[A]),x=h|0,S=Pa(r,s,28)^Gc(r,s,34)^Gc(r,s,39),P=Ba(r,s,28)^jc(r,s,34)^jc(r,s,39),O=r&a^r&i^a&i,_=s&o^s&c^o&c;v=g|0,w=k|0,g=m|0,k=y|0,m=d|0,y=f|0,{h:d,l:f}=kr(l|0,u|0,b|0,x|0),l=i|0,u=c|0,i=a|0,c=o|0,a=r|0,o=s|0;const E=$8(x,P,_);r=G8(E,b,S,O),s=E|0}({h:r,l:s}=kr(this.Ah|0,this.Al|0,r|0,s|0)),{h:a,l:o}=kr(this.Bh|0,this.Bl|0,a|0,o|0),{h:i,l:c}=kr(this.Ch|0,this.Cl|0,i|0,c|0),{h:l,l:u}=kr(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=kr(this.Eh|0,this.El|0,d|0,f|0),{h:m,l:y}=kr(this.Fh|0,this.Fl|0,m|0,y|0),{h:g,l:k}=kr(this.Gh|0,this.Gl|0,g|0,k|0),{h:v,l:w}=kr(this.Hh|0,this.Hl|0,v|0,w|0),this.set(r,s,a,o,i,c,l,u,d,f,m,y,g,k,v,w)}roundClean(){es(rs,ss)}destroy(){es(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Q8 extends z1{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 K8),J8=Hc(()=>new z1),ev=Hc(()=>new Q8),R1=Hd;function H1(e,t){const n=t||"hex",r=R1(Dn(e,{strict:!1})?wr(e):e);return n==="bytes"?r:Oe(r)}function tv(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=H1(t,"bytes");return s.set([n],0),r==="bytes"?s:wt(s)}function $1(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(tv({commitment:a,to:r,version:n}));return s}const G1=6,j1=32,$d=4096,V1=j1*$d,W1=V1*G1-1-1*$d*G1,q1=1;class nv extends ${constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Y1 extends ${constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class rv extends ${constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class sv extends ${constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${q1}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function av(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?on(e.data):e.data,r=ut(n);if(!r)throw new Y1;if(r>W1)throw new nv({maxSize:W1,size:r});const s=[];let a=!0,o=0;for(;a;){const i=_d(new Uint8Array(V1));let c=0;for(;c<$d;){const l=n.slice(o,o+(j1-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 K1(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??av({data:t,to:r}),a=e.commitments??Nd({blobs:s,kzg:n,to:r}),o=e.proofs??Ld({blobs:s,commitments:a,kzg:n,to:r}),i=[];for(let c=0;c<s.length;c++)i.push({blob:s[c],commitment:a[c],proof:o[c]});return i}let Tt=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:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ov extends ${constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class iv 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 Z1 extends ${constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}let Oa=class extends ${constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};class Fa extends ${constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Fa,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Fa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});let as=class extends ${constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xt(n)} 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:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xt(n)}`:""} 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:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}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:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`