@edgex-web/components 0.1.0-beta.28 → 0.1.0-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -27,12 +27,12 @@ Check the top-level render call using <`+Y+">.")}return U}}function ea(D,U){{if(
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Ao,At,gh,At),na[At+Ao]=!0}}return D===r?fh(me):ch(me),me}}function dh(D,U,Y){return ra(D,U,Y,!0)}function ph(D,U,Y){return ra(D,U,Y,!1)}var mh=ph,hh=dh;Ht.Fragment=r,Ht.jsx=mh,Ht.jsxs=hh}()),Ht}process.env.NODE_ENV==="production"?Qn.exports=sa():Qn.exports=la();var C=Qn.exports;const aa={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 250,000。若充值金额大于250,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
31
- 充值金额大于 250,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},ua={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 250,000. If your deposit exceeds 250,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
32
- If the deposit amount exceeds 250,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds in approximately {{v}} minutes (after reaching {{v1}} block confirmations)",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},ca={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は250,000です。250,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
33
- 入金金額が 250,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},fa={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 250 000. Если сумма превышает 250 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
34
- Если сумма депозита превышает 250 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},da={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 250,000。若充值金額大於 250,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
35
- 充值金額大於 250,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Jn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Io={"en-US":ua,"ja-JP":ca,"ru-RU":fa,"zh-CN":aa,"zh-TW":da},un="en-US",pa={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ma=e=>Jn.includes(e)?Io[e]:Io[un],ha=e=>Jn.includes(e),jo=m.createContext(null),ga=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ha(r)?r:un,i=ma(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(jo.Provider,{value:n,children:t})},Fo=()=>{const e=m.useContext(jo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var va=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Zn=Math.ceil,je=Math.floor,Ce="[BigNumber Error] ",Ro=Ce+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,er=9007199254740991,tr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ge=1e9;function ko(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),l=20,u=4,s=-7,a=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var x,$,A,P,S,O,T,L,y=this;if(!(y instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){y.s=h.s,!h.c||h.e>d?y.c=y.e=null:h.e<c?y.c=[y.e=0]:(y.e=h.e,y.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(y.s=1/h<0?(h=-h,-1):1,h===~~h){for(P=0,S=h;S>=10;S/=10,P++);P>d?y.c=y.e=null:(y.e=P,y.c=[h]);return}L=String(h)}else{if(!va.test(L=String(h)))return r(y,L,O);y.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(S=L.search(/e/i))>0?(P<0&&(P=S),P+=+L.slice(S+1),L=L.substring(0,S)):P<0&&(P=L.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return y=new w(h),k(y,l+y.e+1,u);if(L=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,L,O,b);if(y.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else y.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(x=E.slice(0,b),P=S=0,T=L.length;S<T;S++)if(x.indexOf($=L.charAt(S))<0){if($=="."){if(S>P){P=T;continue}}else if(!A&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){A=!0,S=-1,P=0;continue}return r(y,String(h),O,b)}O=!1,L=n(L,b,10,y.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(S=0;L.charCodeAt(S)===48;S++);for(T=L.length;L.charCodeAt(--T)===48;);if(L=L.slice(S,++T)){if(T-=S,O&&w.DEBUG&&T>15&&(h>er||h!==je(h)))throw Error(Ro+y.s*h);if((P=P-S-1)>d)y.c=y.e=null;else if(P<c)y.c=[y.e=0];else{if(y.e=P,y.c=[],S=(P+1)%Q,P<0&&(S+=Q),S<T){for(S&&y.c.push(+L.slice(0,S)),T-=Q;S<T;)y.c.push(+L.slice(S,S+=Q));S=Q-(L=L.slice(S)).length}else S-=T;for(;S--;L+="0");y.c.push(+L)}}else y.c=[y.e=0]}w.clone=ko,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],ce(x,0,ge,b),l=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ce(x,0,8,b),u=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ce(x[0],-ge,0,b),ce(x[1],0,ge,b),s=x[0],a=x[1]):(ce(x,-ge,ge,b),s=-(a=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ce(x[0],-ge,-1,b),ce(x[1],1,ge,b),c=x[0],d=x[1];else if(ce(x,-ge,ge,b),x)c=-(d=x<0?-x:x);else throw Error(Ce+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))p=x;else throw p=!x,Error(Ce+"crypto unavailable");else p=x;else throw Error(Ce+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],ce(x,0,9,b),f=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ce(x,0,ge,b),g=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")v=x;else throw Error(Ce+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))M=x.slice(0,10)=="0123456789",E=x;else throw Error(Ce+b+" invalid: "+x)}else throw Error(Ce+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,$=h.c,A=h.e,P=h.s;e:if({}.toString.call($)=="[object Array]"){if((P===1||P===-1)&&A>=-ge&&A<=ge&&A===je(A)){if($[0]===0){if(A===0&&$.length===1)return!0;break e}if(b=(A+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(x=$[b],x<0||x>=Ge||x!==je(x))break e;if(x!==0)return!0}}}else if($===null&&A===null&&(P===null||P===1||P===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var $,A,P,S,O,T=0,L=[],y=new w(i);if(x==null?x=l:ce(x,0,ge),S=Zn(x/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(S*=2));T<S;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),$[T]=A[0],$[T+1]=A[1]):(L.push(O%1e14),T+=2);T=S/2}else if(crypto.randomBytes){for($=crypto.randomBytes(S*=7);T<S;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(L.push(O%1e14),T+=7);T=S/7}else throw p=!1,Error(Ce+"crypto unavailable");if(!p)for(;T<S;)O=b(),O<9e15&&(L[T++]=O%1e14);for(S=L[--T],x%=Q,S&&x&&(O=tr[Q-x],L[T]=je(S/O)*O);L[T]===0;L.pop(),T--);if(T<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=Q);for(T=1,O=L[0];O>=10;O/=10,T++);T<Q&&(P-=Q-T)}return y.e=P,y.c=L,y}}(),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,$,A,P){for(var S,O=[0],T,L=0,y=x.length;L<y;){for(T=O.length;T--;O[T]*=$);for(O[0]+=P.indexOf(x.charAt(L++)),S=0;S<O.length;S++)O[S]>A-1&&(O[S+1]==null&&(O[S+1]=0),O[S+1]+=O[S]/A|0,O[S]%=A)}return O.reverse()}return function(x,$,A,P,S){var O,T,L,y,I,_,V,z,G=x.indexOf("."),q=l,B=u;for(G>=0&&(y=g,g=0,x=x.replace(".",""),z=new w($),_=z.pow(x.length-G),g=y,z.c=b(st(Re(_.c),_.e,"0"),10,A,h),z.e=z.c.length),V=b(x,$,A,S?(O=E,h):(O=h,E)),L=y=V.length;V[--y]==0;V.pop());if(!V[0])return O.charAt(0);if(G<0?--L:(_.c=V,_.e=L,_.s=P,_=t(_,z,q,B,A),V=_.c,I=_.r,L=_.e),T=L+q+1,G=V[T],y=A/2,I=I||T<0||V[T+1]!=null,I=B<4?(G!=null||I)&&(B==0||B==(_.s<0?3:2)):G>y||G==y&&(B==4||I||B==6&&V[T-1]&1||B==(_.s<0?8:7)),T<1||!V[0])x=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--A;++V[--T]>A;)V[T]=0,T||(++L,V=[1].concat(V));for(y=V.length;!V[--y];);for(G=0,x="";G<=y;x+=O.charAt(V[G++]));x=st(x,L,O.charAt(0))}return x}}(),t=function(){function h($,A,P){var S,O,T,L,y=0,I=$.length,_=A%ht,V=A/ht|0;for($=$.slice();I--;)T=$[I]%ht,L=$[I]/ht|0,S=V*T+L*_,O=_*T+S%ht*ht+y,y=(O/P|0)+(S/ht|0)+V*L,$[I]=O%P;return y&&($=[y].concat($)),$}function b($,A,P,S){var O,T;if(P!=S)T=P>S?1:-1;else for(O=T=0;O<P;O++)if($[O]!=A[O]){T=$[O]>A[O]?1:-1;break}return T}function x($,A,P,S){for(var O=0;P--;)$[P]-=O,O=$[P]<A[P]?1:0,$[P]=O*S+$[P]-A[P];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,A,P,S,O){var T,L,y,I,_,V,z,G,q,B,K,H,Z,ae,Ae,$e,it,ye=$.s==A.s?1:-1,he=$.c,se=A.c;if(!he||!he[0]||!se||!se[0])return new w(!$.s||!A.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(G=new w(ye),q=G.c=[],L=$.e-A.e,ye=P+L+1,O||(O=Ge,L=Fe($.e/Q)-Fe(A.e/Q),ye=ye/Q|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&L--,ye<0)q.push(1),I=!0;else{for(ae=he.length,$e=se.length,y=0,ye+=2,_=je(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,ae=he.length),Z=$e,B=he.slice(0,$e),K=B.length;K<$e;B[K++]=0);it=se.slice(),it=[0].concat(it),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,T=b(se,B,$e,K),T<0){if(H=B[0],$e!=K&&(H=H*O+(B[1]||0)),_=je(H/Ae),_>1)for(_>=O&&(_=O-1),V=h(se,_,O),z=V.length,K=B.length;b(V,B,z,K)==1;)_--,x(V,$e<z?it:se,z,O),z=V.length,T=1;else _==0&&(T=_=1),V=se.slice(),z=V.length;if(z<K&&(V=[0].concat(V)),x(B,V,K,O),K=B.length,T==-1)for(;b(se,B,$e,K)<1;)_++,x(B,$e<K?it:se,K,O),K=B.length}else T===0&&(_++,B=[0]);q[y++]=_,B[0]?B[K++]=he[Z]||0:(B=[he[Z]],K=1)}while((Z++<ae||B[0]!=null)&&ye--);I=B[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(y=1,ye=q[0];ye>=10;ye/=10,y++);k(G,P+(G.e=y+L*Q-1)+1,S,I)}else G.e=L,G.r=+I;return G}}();function N(h,b,x,$){var A,P,S,O,T;if(x==null?x=u:ce(x,0,8),!h.c)return h.toString();if(A=h.c[0],S=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(S<=s||S>=a)?fn(T,S):st(T,S,"0");else if(h=k(new w(h),b,x),P=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=P||P<=s)){for(;O<b;T+="0",O++);T=fn(T,P)}else if(b-=S+($===2&&P>S),T=st(T,P,"0"),P+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=P-O,b>0)for(P+1==O&&(T+=".");b--;T+="0");return h.s<0&&A?"-"+T:T}function j(h,b){for(var x,$,A=1,P=new w(h[0]);A<h.length;A++)$=new w(h[A]),(!$.s||(x=Et(P,$))===b||x===0&&P.s===b)&&(P=$);return P}function F(h,b,x){for(var $=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,$++);return(x=$+x*Q-1)>d?h.c=h.e=null:x<c?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,S,O,T){var L,y=O?S:S.replace(A,"");if($.test(y))P.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,V){return L=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==L?_:I}),T&&(L=T,y=y.replace(b,"$1").replace(x,"0.$1")),S!=y))return new w(y,L);if(w.DEBUG)throw Error(Ce+"Not a"+(T?" base "+T:"")+" number: "+S);P.s=null}P.c=P.e=null}}();function k(h,b,x,$){var A,P,S,O,T,L,y,I=h.c,_=tr;if(I){e:{for(A=1,O=I[0];O>=10;O/=10,A++);if(P=b-A,P<0)P+=Q,S=b,T=I[L=0],y=je(T/_[A-S-1]%10);else if(L=Zn((P+1)/Q),L>=I.length)if($){for(;I.length<=L;I.push(0));T=y=0,A=1,P%=Q,S=P-Q+1}else break e;else{for(T=O=I[L],A=1;O>=10;O/=10,A++);P%=Q,S=P-Q+A,y=S<0?0:je(T/_[A-S-1]%10)}if($=$||b<0||I[L+1]!=null||(S<0?T:T%_[A-S-1]),$=x<4?(y||$)&&(x==0||x==(h.s<0?3:2)):y>5||y==5&&(x==4||$||x==6&&(P>0?S>0?T/_[A-S]:0:I[L-1])%10&1||x==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(P==0?(I.length=L,O=1,L--):(I.length=L+1,O=_[Q-P],I[L]=S>0?je(T/_[A-S]%_[S])*O:0),$)for(;;)if(L==0){for(P=1,S=I[0];S>=10;S/=10,P++);for(S=I[0]+=O,O=1;S>=10;S/=10,O++);P!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[L]+=O,I[L]!=Ge)break;I[L--]=0,O=1}for(P=I.length;I[--P]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var b,x=h.e;return x===null?h.toString():(b=Re(h.c),b=x<=s||x>=a?fn(b,x):st(b,x,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var x,$,A,P=this;if(h!=null)return ce(h,0,ge),b==null?b=u:ce(b,0,8),k(new w(P),h+P.e+1,b);if(!(x=P.c))return null;if($=((A=x.length-1)-Fe(this.e/Q))*Q,A=x[A])for(;A%10==0;A/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var x,$,A,P,S,O,T,L,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(b!=null&&(b=new w(b)),O=h.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!h.c||!h.c[0])return y=new w(Math.pow(+W(I),O?h.s*(2-cn(h)):+W(h))),b?y.mod(b):y;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}else{if(h.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||O&&I.c[1]>=24e7:I.c[0]<8e13||O&&I.c[0]<=9999975e7)))return P=I.s<0&&cn(h)?-0:0,I.e>-1&&(P=1/P),new w(T?1/P:P);g&&(P=Zn(g/Q+2))}for(O?(x=new w(.5),T&&(h.s=1),L=cn(h)):(A=Math.abs(+W(h)),L=A%2),y=new w(i);;){if(L){if(y=y.times(I),!y.c)break;P?y.c.length>P&&(y.c.length=P):$&&(y=y.mod(b))}if(A){if(A=je(A/2),A===0)break;L=A%2}else if(h=h.times(x),k(h,h.e+1,1),h.e>14)L=cn(h);else{if(A=+W(h),A===0)break;L=A%2}I=I.times(I),P?I.c&&I.c.length>P&&(I.c.length=P):$&&(I=I.mod(b))}return $?y:(T&&(y=i.div(y)),b?y.mod(b):P?k(y,g,u,S):y)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),k(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(h,b){var x,$,A,P,S=this,O=S.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,S.plus(h);var T=S.e/Q,L=h.e/Q,y=S.c,I=h.c;if(!T||!L){if(!y||!I)return y?(h.s=-b,h):new w(I?S:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-b,h):new w(y[0]?S:u==3?-0:0)}if(T=Fe(T),L=Fe(L),y=y.slice(),O=T-L){for((P=O<0)?(O=-O,A=y):(L=T,A=I),A.reverse(),b=O;b--;A.push(0));A.reverse()}else for($=(P=(O=y.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(y[b]!=I[b]){P=y[b]<I[b];break}if(P&&(A=y,y=I,I=A,h.s=-h.s),b=($=I.length)-(x=y.length),b>0)for(;b--;y[x++]=0);for(b=Ge-1;$>O;){if(y[--$]<I[$]){for(x=$;x&&!y[--x];y[x]=b);--y[x],y[$]+=Ge}y[$]-=I[$]}for(;y[0]==0;y.splice(0,1),--L);return y[0]?F(h,y,L):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var x,$,A=this;return h=new w(h,b),!A.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||A.c&&!A.c[0]?new w(A):(f==9?($=h.s,h.s=1,x=t(A,h,0,3),h.s=$,x.s*=$):x=t(A,h,0,f),h=A.minus(x.times(h)),!h.c[0]&&f==1&&(h.s=A.s),h)},o.multipliedBy=o.times=function(h,b){var x,$,A,P,S,O,T,L,y,I,_,V,z,G,q,B=this,K=B.c,H=(h=new w(h,b)).c;if(!K||!H||!K[0]||!H[0])return!B.s||!h.s||K&&!K[0]&&!H||H&&!H[0]&&!K?h.c=h.e=h.s=null:(h.s*=B.s,!K||!H?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(B.e/Q)+Fe(h.e/Q),h.s*=B.s,T=K.length,I=H.length,T<I&&(z=K,K=H,H=z,A=T,T=I,I=A),A=T+I,z=[];A--;z.push(0));for(G=Ge,q=ht,A=I;--A>=0;){for(x=0,_=H[A]%q,V=H[A]/q|0,S=T,P=A+S;P>A;)L=K[--S]%q,y=K[S]/q|0,O=V*L+y*_,L=_*L+O%q*q+z[P]+x,x=(L/G|0)+(O/q|0)+V*y,z[P--]=L%G;z[P]=x}return x?++$:z.splice(0,1),F(h,z,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var x,$=this,A=$.s;if(h=new w(h,b),b=h.s,!A||!b)return new w(NaN);if(A!=b)return h.s=-b,$.minus(h);var P=$.e/Q,S=h.e/Q,O=$.c,T=h.c;if(!P||!S){if(!O||!T)return new w(A/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:A*0)}if(P=Fe(P),S=Fe(S),O=O.slice(),A=P-S){for(A>0?(S=P,x=T):(A=-A,x=O),x.reverse();A--;x.push(0));x.reverse()}for(A=O.length,b=T.length,A-b<0&&(x=T,T=O,O=x,b=A),A=0;b;)A=(O[--b]=O[b]+T[b]+A)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return A&&(O=[A].concat(O),++S),F(h,O,S)},o.precision=o.sd=function(h,b){var x,$,A,P=this;if(h!=null&&h!==!!h)return ce(h,1,ge),b==null?b=u:ce(b,0,8),k(new w(P),h,b);if(!(x=P.c))return null;if(A=x.length-1,$=A*Q+1,A=x[A]){for(;A%10==0;A/=10,$--);for(A=x[0];A>=10;A/=10,$++);}return h&&P.e+1>$&&($=P.e+1),$},o.shiftedBy=function(h){return ce(h,-er,er),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,x,$,A,P=this,S=P.c,O=P.s,T=P.e,L=l+4,y=new w("0.5");if(O!==1||!S||!S[0])return new w(!O||O<0&&(!S||S[0])?NaN:S?P:1/0);if(O=Math.sqrt(+W(P)),O==0||O==1/0?(b=Re(S),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),x=new w(b)):x=new w(O+""),x.c[0]){for(T=x.e,O=T+L,O<3&&(O=0);;)if(A=x,x=y.times(A.plus(t(P,A,L,1))),Re(A.c).slice(0,O)===(b=Re(x.c)).slice(0,O))if(x.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(A,A.e+l+2,0),A.times(A).eq(P))){x=A;break}L+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(x,x.e+l+2,1),h=!x.times(x).eq(P));break}}return k(x,x.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ge),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ge),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,x){var $,A=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=v;else if(typeof x!="object")throw Error(Ce+"Argument not an object: "+x);if($=A.toFixed(h,b),A.c){var P,S=$.split("."),O=+x.groupSize,T=+x.secondaryGroupSize,L=x.groupSeparator||"",y=S[0],I=S[1],_=A.s<0,V=_?y.slice(1):y,z=V.length;if(T&&(P=O,O=T,T=P,z-=P),O>0&&z>0){for(P=z%O||O,y=V.substr(0,P);P<z;P+=O)y+=L+V.substr(P,O);T>0&&(y+=L+V.slice(P)),_&&(y="-"+y)}$=I?y+(x.decimalSeparator||"")+((T=+x.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):I):y}return(x.prefix||"")+$+(x.suffix||"")},o.toFraction=function(h){var b,x,$,A,P,S,O,T,L,y,I,_,V=this,z=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Ce+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+W(O));if(!z)return new w(V);for(b=new w(i),L=x=new w(i),$=T=new w(i),_=Re(z),P=b.e=_.length-V.e-1,b.c[0]=tr[(S=P%Q)<0?Q+S:S],h=!h||O.comparedTo(b)>0?P>0?b:L:O,S=d,d=1/0,O=new w(_),T.c[0]=0;y=t(O,b,0,1),A=x.plus(y.times($)),A.comparedTo(h)!=1;)x=$,$=A,L=T.plus(y.times(A=L)),T=A,b=O.minus(y.times(A=b)),O=A;return A=t(h.minus(x),$,0,1),T=T.plus(A.times(L)),x=x.plus(A.times($)),T.s=L.s=V.s,P=P*2,I=t(L,$,P,u).minus(V).abs().comparedTo(t(T,x,P,u).minus(V).abs())<1?[L,$]:[T,x],d=S,I},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ge),N(this,h,b,2)},o.toString=function(h){var b,x=this,$=x.s,A=x.e;return A===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=A<=s||A>=a?fn(Re(x.c),A):st(Re(x.c),A,"0"):h===10&&M?(x=k(new w(x),l+A+1,u),b=st(Re(x.c),x.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(x.c),A,"0"),10,h,$,!0)),$<0&&x.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function Re(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(e,t){var n,r,o=e.c,i=t.c,l=e.s,u=t.s,s=e.e,a=t.e;if(!l||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:l;if(l!=u)return l;if(n=l<0,r=s==a,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>a^n?1:-1;for(u=(s=o.length)<(a=i.length)?s:a,l=0;l<u;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return s==a?0:s>a^n?1:-1}function ce(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function st(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Oe=ko();const ba=(e,t=6)=>{try{const n=new Oe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Oe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ye=()=>{const{translations:e,currentLocale:t}=Fo();return{t:(i,l)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let a=typeof s=="string"?s:i;return l&&typeof a=="string"&&Object.keys(l).forEach(c=>{const d=`{{${c}}}`;a=a.replace(new RegExp(d,"g"),String(l[c]))}),a}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(l){return console.warn(`Translation object error for key "${i}":`,l),{}}},hasTranslation:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},xa=()=>({openDeposit:m.useCallback(t=>{},[])}),ya=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
30
+ <%s key={someKey} {...props} />`,Ao,At,gh,At),na[At+Ao]=!0}}return D===r?fh(me):ch(me),me}}function dh(D,U,Y){return ra(D,U,Y,!0)}function ph(D,U,Y){return ra(D,U,Y,!1)}var mh=ph,hh=dh;Ht.Fragment=r,Ht.jsx=mh,Ht.jsxs=hh}()),Ht}process.env.NODE_ENV==="production"?Qn.exports=sa():Qn.exports=la();var C=Qn.exports;const aa={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
31
+ 充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},ua={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
32
+ If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds in approximately {{v}} minutes (after reaching {{v1}} block confirmations)",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},ca={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
33
+ 入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},fa={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
34
+ Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},da={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
35
+ 充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Jn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Io={"en-US":ua,"ja-JP":ca,"ru-RU":fa,"zh-CN":aa,"zh-TW":da},un="en-US",pa={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ma=e=>Jn.includes(e)?Io[e]:Io[un],ha=e=>Jn.includes(e),jo=m.createContext(null),ga=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ha(r)?r:un,i=ma(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(jo.Provider,{value:n,children:t})},Fo=()=>{const e=m.useContext(jo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var va=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Zn=Math.ceil,je=Math.floor,Ce="[BigNumber Error] ",Ro=Ce+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,er=9007199254740991,tr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ge=1e9;function ko(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),l=20,u=4,s=-7,a=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var x,$,A,P,S,O,T,L,y=this;if(!(y instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){y.s=h.s,!h.c||h.e>d?y.c=y.e=null:h.e<c?y.c=[y.e=0]:(y.e=h.e,y.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(y.s=1/h<0?(h=-h,-1):1,h===~~h){for(P=0,S=h;S>=10;S/=10,P++);P>d?y.c=y.e=null:(y.e=P,y.c=[h]);return}L=String(h)}else{if(!va.test(L=String(h)))return r(y,L,O);y.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(S=L.search(/e/i))>0?(P<0&&(P=S),P+=+L.slice(S+1),L=L.substring(0,S)):P<0&&(P=L.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return y=new w(h),k(y,l+y.e+1,u);if(L=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,L,O,b);if(y.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else y.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(x=E.slice(0,b),P=S=0,T=L.length;S<T;S++)if(x.indexOf($=L.charAt(S))<0){if($=="."){if(S>P){P=T;continue}}else if(!A&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){A=!0,S=-1,P=0;continue}return r(y,String(h),O,b)}O=!1,L=n(L,b,10,y.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(S=0;L.charCodeAt(S)===48;S++);for(T=L.length;L.charCodeAt(--T)===48;);if(L=L.slice(S,++T)){if(T-=S,O&&w.DEBUG&&T>15&&(h>er||h!==je(h)))throw Error(Ro+y.s*h);if((P=P-S-1)>d)y.c=y.e=null;else if(P<c)y.c=[y.e=0];else{if(y.e=P,y.c=[],S=(P+1)%Q,P<0&&(S+=Q),S<T){for(S&&y.c.push(+L.slice(0,S)),T-=Q;S<T;)y.c.push(+L.slice(S,S+=Q));S=Q-(L=L.slice(S)).length}else S-=T;for(;S--;L+="0");y.c.push(+L)}}else y.c=[y.e=0]}w.clone=ko,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],ce(x,0,ge,b),l=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ce(x,0,8,b),u=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ce(x[0],-ge,0,b),ce(x[1],0,ge,b),s=x[0],a=x[1]):(ce(x,-ge,ge,b),s=-(a=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ce(x[0],-ge,-1,b),ce(x[1],1,ge,b),c=x[0],d=x[1];else if(ce(x,-ge,ge,b),x)c=-(d=x<0?-x:x);else throw Error(Ce+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))p=x;else throw p=!x,Error(Ce+"crypto unavailable");else p=x;else throw Error(Ce+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],ce(x,0,9,b),f=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ce(x,0,ge,b),g=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")v=x;else throw Error(Ce+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))M=x.slice(0,10)=="0123456789",E=x;else throw Error(Ce+b+" invalid: "+x)}else throw Error(Ce+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,$=h.c,A=h.e,P=h.s;e:if({}.toString.call($)=="[object Array]"){if((P===1||P===-1)&&A>=-ge&&A<=ge&&A===je(A)){if($[0]===0){if(A===0&&$.length===1)return!0;break e}if(b=(A+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(x=$[b],x<0||x>=Ge||x!==je(x))break e;if(x!==0)return!0}}}else if($===null&&A===null&&(P===null||P===1||P===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var $,A,P,S,O,T=0,L=[],y=new w(i);if(x==null?x=l:ce(x,0,ge),S=Zn(x/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(S*=2));T<S;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),$[T]=A[0],$[T+1]=A[1]):(L.push(O%1e14),T+=2);T=S/2}else if(crypto.randomBytes){for($=crypto.randomBytes(S*=7);T<S;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(L.push(O%1e14),T+=7);T=S/7}else throw p=!1,Error(Ce+"crypto unavailable");if(!p)for(;T<S;)O=b(),O<9e15&&(L[T++]=O%1e14);for(S=L[--T],x%=Q,S&&x&&(O=tr[Q-x],L[T]=je(S/O)*O);L[T]===0;L.pop(),T--);if(T<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=Q);for(T=1,O=L[0];O>=10;O/=10,T++);T<Q&&(P-=Q-T)}return y.e=P,y.c=L,y}}(),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,$,A,P){for(var S,O=[0],T,L=0,y=x.length;L<y;){for(T=O.length;T--;O[T]*=$);for(O[0]+=P.indexOf(x.charAt(L++)),S=0;S<O.length;S++)O[S]>A-1&&(O[S+1]==null&&(O[S+1]=0),O[S+1]+=O[S]/A|0,O[S]%=A)}return O.reverse()}return function(x,$,A,P,S){var O,T,L,y,I,_,V,z,G=x.indexOf("."),q=l,B=u;for(G>=0&&(y=g,g=0,x=x.replace(".",""),z=new w($),_=z.pow(x.length-G),g=y,z.c=b(st(Re(_.c),_.e,"0"),10,A,h),z.e=z.c.length),V=b(x,$,A,S?(O=E,h):(O=h,E)),L=y=V.length;V[--y]==0;V.pop());if(!V[0])return O.charAt(0);if(G<0?--L:(_.c=V,_.e=L,_.s=P,_=t(_,z,q,B,A),V=_.c,I=_.r,L=_.e),T=L+q+1,G=V[T],y=A/2,I=I||T<0||V[T+1]!=null,I=B<4?(G!=null||I)&&(B==0||B==(_.s<0?3:2)):G>y||G==y&&(B==4||I||B==6&&V[T-1]&1||B==(_.s<0?8:7)),T<1||!V[0])x=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--A;++V[--T]>A;)V[T]=0,T||(++L,V=[1].concat(V));for(y=V.length;!V[--y];);for(G=0,x="";G<=y;x+=O.charAt(V[G++]));x=st(x,L,O.charAt(0))}return x}}(),t=function(){function h($,A,P){var S,O,T,L,y=0,I=$.length,_=A%ht,V=A/ht|0;for($=$.slice();I--;)T=$[I]%ht,L=$[I]/ht|0,S=V*T+L*_,O=_*T+S%ht*ht+y,y=(O/P|0)+(S/ht|0)+V*L,$[I]=O%P;return y&&($=[y].concat($)),$}function b($,A,P,S){var O,T;if(P!=S)T=P>S?1:-1;else for(O=T=0;O<P;O++)if($[O]!=A[O]){T=$[O]>A[O]?1:-1;break}return T}function x($,A,P,S){for(var O=0;P--;)$[P]-=O,O=$[P]<A[P]?1:0,$[P]=O*S+$[P]-A[P];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,A,P,S,O){var T,L,y,I,_,V,z,G,q,B,K,H,Z,ae,Ae,$e,it,ye=$.s==A.s?1:-1,he=$.c,se=A.c;if(!he||!he[0]||!se||!se[0])return new w(!$.s||!A.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(G=new w(ye),q=G.c=[],L=$.e-A.e,ye=P+L+1,O||(O=Ge,L=Fe($.e/Q)-Fe(A.e/Q),ye=ye/Q|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&L--,ye<0)q.push(1),I=!0;else{for(ae=he.length,$e=se.length,y=0,ye+=2,_=je(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,ae=he.length),Z=$e,B=he.slice(0,$e),K=B.length;K<$e;B[K++]=0);it=se.slice(),it=[0].concat(it),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,T=b(se,B,$e,K),T<0){if(H=B[0],$e!=K&&(H=H*O+(B[1]||0)),_=je(H/Ae),_>1)for(_>=O&&(_=O-1),V=h(se,_,O),z=V.length,K=B.length;b(V,B,z,K)==1;)_--,x(V,$e<z?it:se,z,O),z=V.length,T=1;else _==0&&(T=_=1),V=se.slice(),z=V.length;if(z<K&&(V=[0].concat(V)),x(B,V,K,O),K=B.length,T==-1)for(;b(se,B,$e,K)<1;)_++,x(B,$e<K?it:se,K,O),K=B.length}else T===0&&(_++,B=[0]);q[y++]=_,B[0]?B[K++]=he[Z]||0:(B=[he[Z]],K=1)}while((Z++<ae||B[0]!=null)&&ye--);I=B[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(y=1,ye=q[0];ye>=10;ye/=10,y++);k(G,P+(G.e=y+L*Q-1)+1,S,I)}else G.e=L,G.r=+I;return G}}();function N(h,b,x,$){var A,P,S,O,T;if(x==null?x=u:ce(x,0,8),!h.c)return h.toString();if(A=h.c[0],S=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(S<=s||S>=a)?fn(T,S):st(T,S,"0");else if(h=k(new w(h),b,x),P=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=P||P<=s)){for(;O<b;T+="0",O++);T=fn(T,P)}else if(b-=S+($===2&&P>S),T=st(T,P,"0"),P+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=P-O,b>0)for(P+1==O&&(T+=".");b--;T+="0");return h.s<0&&A?"-"+T:T}function j(h,b){for(var x,$,A=1,P=new w(h[0]);A<h.length;A++)$=new w(h[A]),(!$.s||(x=Et(P,$))===b||x===0&&P.s===b)&&(P=$);return P}function F(h,b,x){for(var $=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,$++);return(x=$+x*Q-1)>d?h.c=h.e=null:x<c?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,S,O,T){var L,y=O?S:S.replace(A,"");if($.test(y))P.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,V){return L=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==L?_:I}),T&&(L=T,y=y.replace(b,"$1").replace(x,"0.$1")),S!=y))return new w(y,L);if(w.DEBUG)throw Error(Ce+"Not a"+(T?" base "+T:"")+" number: "+S);P.s=null}P.c=P.e=null}}();function k(h,b,x,$){var A,P,S,O,T,L,y,I=h.c,_=tr;if(I){e:{for(A=1,O=I[0];O>=10;O/=10,A++);if(P=b-A,P<0)P+=Q,S=b,T=I[L=0],y=je(T/_[A-S-1]%10);else if(L=Zn((P+1)/Q),L>=I.length)if($){for(;I.length<=L;I.push(0));T=y=0,A=1,P%=Q,S=P-Q+1}else break e;else{for(T=O=I[L],A=1;O>=10;O/=10,A++);P%=Q,S=P-Q+A,y=S<0?0:je(T/_[A-S-1]%10)}if($=$||b<0||I[L+1]!=null||(S<0?T:T%_[A-S-1]),$=x<4?(y||$)&&(x==0||x==(h.s<0?3:2)):y>5||y==5&&(x==4||$||x==6&&(P>0?S>0?T/_[A-S]:0:I[L-1])%10&1||x==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(P==0?(I.length=L,O=1,L--):(I.length=L+1,O=_[Q-P],I[L]=S>0?je(T/_[A-S]%_[S])*O:0),$)for(;;)if(L==0){for(P=1,S=I[0];S>=10;S/=10,P++);for(S=I[0]+=O,O=1;S>=10;S/=10,O++);P!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[L]+=O,I[L]!=Ge)break;I[L--]=0,O=1}for(P=I.length;I[--P]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var b,x=h.e;return x===null?h.toString():(b=Re(h.c),b=x<=s||x>=a?fn(b,x):st(b,x,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var x,$,A,P=this;if(h!=null)return ce(h,0,ge),b==null?b=u:ce(b,0,8),k(new w(P),h+P.e+1,b);if(!(x=P.c))return null;if($=((A=x.length-1)-Fe(this.e/Q))*Q,A=x[A])for(;A%10==0;A/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var x,$,A,P,S,O,T,L,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(b!=null&&(b=new w(b)),O=h.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!h.c||!h.c[0])return y=new w(Math.pow(+W(I),O?h.s*(2-cn(h)):+W(h))),b?y.mod(b):y;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}else{if(h.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||O&&I.c[1]>=24e7:I.c[0]<8e13||O&&I.c[0]<=9999975e7)))return P=I.s<0&&cn(h)?-0:0,I.e>-1&&(P=1/P),new w(T?1/P:P);g&&(P=Zn(g/Q+2))}for(O?(x=new w(.5),T&&(h.s=1),L=cn(h)):(A=Math.abs(+W(h)),L=A%2),y=new w(i);;){if(L){if(y=y.times(I),!y.c)break;P?y.c.length>P&&(y.c.length=P):$&&(y=y.mod(b))}if(A){if(A=je(A/2),A===0)break;L=A%2}else if(h=h.times(x),k(h,h.e+1,1),h.e>14)L=cn(h);else{if(A=+W(h),A===0)break;L=A%2}I=I.times(I),P?I.c&&I.c.length>P&&(I.c.length=P):$&&(I=I.mod(b))}return $?y:(T&&(y=i.div(y)),b?y.mod(b):P?k(y,g,u,S):y)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),k(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(h,b){var x,$,A,P,S=this,O=S.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,S.plus(h);var T=S.e/Q,L=h.e/Q,y=S.c,I=h.c;if(!T||!L){if(!y||!I)return y?(h.s=-b,h):new w(I?S:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-b,h):new w(y[0]?S:u==3?-0:0)}if(T=Fe(T),L=Fe(L),y=y.slice(),O=T-L){for((P=O<0)?(O=-O,A=y):(L=T,A=I),A.reverse(),b=O;b--;A.push(0));A.reverse()}else for($=(P=(O=y.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(y[b]!=I[b]){P=y[b]<I[b];break}if(P&&(A=y,y=I,I=A,h.s=-h.s),b=($=I.length)-(x=y.length),b>0)for(;b--;y[x++]=0);for(b=Ge-1;$>O;){if(y[--$]<I[$]){for(x=$;x&&!y[--x];y[x]=b);--y[x],y[$]+=Ge}y[$]-=I[$]}for(;y[0]==0;y.splice(0,1),--L);return y[0]?F(h,y,L):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var x,$,A=this;return h=new w(h,b),!A.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||A.c&&!A.c[0]?new w(A):(f==9?($=h.s,h.s=1,x=t(A,h,0,3),h.s=$,x.s*=$):x=t(A,h,0,f),h=A.minus(x.times(h)),!h.c[0]&&f==1&&(h.s=A.s),h)},o.multipliedBy=o.times=function(h,b){var x,$,A,P,S,O,T,L,y,I,_,V,z,G,q,B=this,K=B.c,H=(h=new w(h,b)).c;if(!K||!H||!K[0]||!H[0])return!B.s||!h.s||K&&!K[0]&&!H||H&&!H[0]&&!K?h.c=h.e=h.s=null:(h.s*=B.s,!K||!H?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(B.e/Q)+Fe(h.e/Q),h.s*=B.s,T=K.length,I=H.length,T<I&&(z=K,K=H,H=z,A=T,T=I,I=A),A=T+I,z=[];A--;z.push(0));for(G=Ge,q=ht,A=I;--A>=0;){for(x=0,_=H[A]%q,V=H[A]/q|0,S=T,P=A+S;P>A;)L=K[--S]%q,y=K[S]/q|0,O=V*L+y*_,L=_*L+O%q*q+z[P]+x,x=(L/G|0)+(O/q|0)+V*y,z[P--]=L%G;z[P]=x}return x?++$:z.splice(0,1),F(h,z,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var x,$=this,A=$.s;if(h=new w(h,b),b=h.s,!A||!b)return new w(NaN);if(A!=b)return h.s=-b,$.minus(h);var P=$.e/Q,S=h.e/Q,O=$.c,T=h.c;if(!P||!S){if(!O||!T)return new w(A/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:A*0)}if(P=Fe(P),S=Fe(S),O=O.slice(),A=P-S){for(A>0?(S=P,x=T):(A=-A,x=O),x.reverse();A--;x.push(0));x.reverse()}for(A=O.length,b=T.length,A-b<0&&(x=T,T=O,O=x,b=A),A=0;b;)A=(O[--b]=O[b]+T[b]+A)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return A&&(O=[A].concat(O),++S),F(h,O,S)},o.precision=o.sd=function(h,b){var x,$,A,P=this;if(h!=null&&h!==!!h)return ce(h,1,ge),b==null?b=u:ce(b,0,8),k(new w(P),h,b);if(!(x=P.c))return null;if(A=x.length-1,$=A*Q+1,A=x[A]){for(;A%10==0;A/=10,$--);for(A=x[0];A>=10;A/=10,$++);}return h&&P.e+1>$&&($=P.e+1),$},o.shiftedBy=function(h){return ce(h,-er,er),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,x,$,A,P=this,S=P.c,O=P.s,T=P.e,L=l+4,y=new w("0.5");if(O!==1||!S||!S[0])return new w(!O||O<0&&(!S||S[0])?NaN:S?P:1/0);if(O=Math.sqrt(+W(P)),O==0||O==1/0?(b=Re(S),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),x=new w(b)):x=new w(O+""),x.c[0]){for(T=x.e,O=T+L,O<3&&(O=0);;)if(A=x,x=y.times(A.plus(t(P,A,L,1))),Re(A.c).slice(0,O)===(b=Re(x.c)).slice(0,O))if(x.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(A,A.e+l+2,0),A.times(A).eq(P))){x=A;break}L+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(x,x.e+l+2,1),h=!x.times(x).eq(P));break}}return k(x,x.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ge),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ge),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,x){var $,A=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=v;else if(typeof x!="object")throw Error(Ce+"Argument not an object: "+x);if($=A.toFixed(h,b),A.c){var P,S=$.split("."),O=+x.groupSize,T=+x.secondaryGroupSize,L=x.groupSeparator||"",y=S[0],I=S[1],_=A.s<0,V=_?y.slice(1):y,z=V.length;if(T&&(P=O,O=T,T=P,z-=P),O>0&&z>0){for(P=z%O||O,y=V.substr(0,P);P<z;P+=O)y+=L+V.substr(P,O);T>0&&(y+=L+V.slice(P)),_&&(y="-"+y)}$=I?y+(x.decimalSeparator||"")+((T=+x.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):I):y}return(x.prefix||"")+$+(x.suffix||"")},o.toFraction=function(h){var b,x,$,A,P,S,O,T,L,y,I,_,V=this,z=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Ce+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+W(O));if(!z)return new w(V);for(b=new w(i),L=x=new w(i),$=T=new w(i),_=Re(z),P=b.e=_.length-V.e-1,b.c[0]=tr[(S=P%Q)<0?Q+S:S],h=!h||O.comparedTo(b)>0?P>0?b:L:O,S=d,d=1/0,O=new w(_),T.c[0]=0;y=t(O,b,0,1),A=x.plus(y.times($)),A.comparedTo(h)!=1;)x=$,$=A,L=T.plus(y.times(A=L)),T=A,b=O.minus(y.times(A=b)),O=A;return A=t(h.minus(x),$,0,1),T=T.plus(A.times(L)),x=x.plus(A.times($)),T.s=L.s=V.s,P=P*2,I=t(L,$,P,u).minus(V).abs().comparedTo(t(T,x,P,u).minus(V).abs())<1?[L,$]:[T,x],d=S,I},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ge),N(this,h,b,2)},o.toString=function(h){var b,x=this,$=x.s,A=x.e;return A===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=A<=s||A>=a?fn(Re(x.c),A):st(Re(x.c),A,"0"):h===10&&M?(x=k(new w(x),l+A+1,u),b=st(Re(x.c),x.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(x.c),A,"0"),10,h,$,!0)),$<0&&x.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function Re(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(e,t){var n,r,o=e.c,i=t.c,l=e.s,u=t.s,s=e.e,a=t.e;if(!l||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:l;if(l!=u)return l;if(n=l<0,r=s==a,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>a^n?1:-1;for(u=(s=o.length)<(a=i.length)?s:a,l=0;l<u;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return s==a?0:s>a^n?1:-1}function ce(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function st(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Oe=ko();const ba=(e,t=6)=>{try{const n=new Oe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Oe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ye=()=>{const{translations:e,currentLocale:t}=Fo();return{t:(i,l)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let a=typeof s=="string"?s:i;return l&&typeof a=="string"&&Object.keys(l).forEach(c=>{const d=`{{${c}}}`;a=a.replace(new RegExp(d,"g"),String(l[c]))}),a}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(l){return console.warn(`Translation object error for key "${i}":`,l),{}}},hasTranslation:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},xa=()=>({openDeposit:m.useCallback(t=>{},[])}),ya=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
36
36
  * @license lucide-react v0.540.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
@@ -116,5 +116,5 @@ React keys must be passed directly to JSX without using spread:
116
116
  relative
117
117
  ${u}
118
118
  ${i}
119
- `,children:[t,o&&C.jsx(Al,{ref:d,placement:g.placement||n})]})})]})},Co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",Dm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>gp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(fl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),C.jsx(Rp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),l&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),C.jsxs("div",{className:"text-sm",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),C.jsx(sn,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),C.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},Mm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ye(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(j=>j.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(j=>j.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.token===d);return!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?C.jsxs(C.Fragment,{children:[C.jsx(to,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx(Dm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),C.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{i&&i({amount:"",chainId:a,tokenAddress:(g==null?void 0:g.tokenAddress)||"",tokenSymbol:d}),u()},children:s("deposit.title")})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Im=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return Im.includes(t)},jm={USDT:!0},Oo=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!jm[t.toUpperCase()]:!0},ln=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const i=t?`loading-${t}`:"",l=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Fm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ye(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(Oo(o==null?void 0:o.chainId,t))try{const F=new Oe(j),k=new Oe("250000");F.gt(k)&&(j="250000")}catch(F){console.warn("Error calculating max amount limit:",F)}return j},[s,o==null?void 0:o.chainId,t]),M=m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(e||"0"),F=new Oe("250000");return j.isNaN()||F.isNaN()?!1:j.gte(F)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(s||"0"),F=new Oe("250000");return j.gt(F)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=j=>{const F=j.target.value,k=E(),W=no(F,k);if(W.isValid)c(W.formattedValue),W.errorType;else return W.errorType==="exceed_balance",void 0},N=()=>{const j=parseFloat(s||"0"),F=parseFloat(e||"0");if(F>0){const k=j-F,W=Xe(Math.max(0,k).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),W," ",t]})}return`${Xe(s||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:w,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:()=>{const j=E();c(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:p("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:N()})]})]}),!r&&pp(e||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),C.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?C.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),M&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!M&&C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),C.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),C.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Xe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Xe(a)} ${t}`})]})})]})},Rm=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,a;const l=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(a=o==null?void 0:o.useReadContract)==null?void 0:a.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:l,allowance:u})},[l,u,e.tokenAddress,i]),null},$l=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[l,u]=m.useState({}),s=m.useCallback((v,E)=>{u(M=>({...M,[v]:E}))},[]),a=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement(Rm,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=a!=null&&a.data?{value:a.data.value,formatted:a.data.formatted,decimals:a.data.decimals,symbol:a.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},E=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.balance,k=F==null?void 0:F.data;return{address:N.tokenAddress,value:(k==null?void 0:k.value)||BigInt(0),formatted:(k==null?void 0:k.formatted)||"0",decimals:(k==null?void 0:k.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.allowance,k=F==null?void 0:F.data,W=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,j)=>{const F=M.find(k=>k.address===j.address);return{...N,[j.address]:{balance:j,allowance:F||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:E,allowanceList:M,baseTokenBalance:v,combinedData:w}},[a,l,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(a==null?void 0:a.isLoading)||!1,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const km={symbol:"USDT"},Dl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),C.jsx(Rl,{isOpen:n,isLoading:o,onClose:c,config:l.config||km,currentActiveAccount:l.currentActiveAccount||ro,smartWallet:l.smartWallet||oo,chains:l.chains||vp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||io,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Dl.displayName="DepositManager";const Ml=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},Il=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},jl=e=>{Pe&&Pe.updateDepositOptions(e)},Yn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},_m=()=>Pe?Pe.isOpen():!1,Fl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Ml,closeDeposit:Il,updateDepositOptions:jl,setDepositLoading:Yn,isOpen:_m,isLoading:Fl}),Bm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var q;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var B;return!e||e.length===0?1:t||((B=e[0])==null?void 0:B.chainId)||1}),[j,F]=m.useState(()=>{var Z;if(!e||e.length===0)return"";const B=t||((Z=e[0])==null?void 0:Z.chainId),K=e.find(ae=>ae.chainId===B);if(!K||!K.tokenList||K.tokenList.length===0)return"";const H=K.tokenList.find(ae=>ae.tokenAddress===n)||K.tokenList[0];return(H==null?void 0:H.token)||""}),[k,W]=m.useState(r),h=m.useCallback(B=>{N(B),g==null||g(B)},[g]),b=m.useCallback(B=>{F(B),v==null||v(B)},[v]),x=m.useRef(!0),$=m.useRef(j),A=m.useRef(w);m.useEffect(()=>{if(x.current){x.current=!1,$.current=j,A.current=w;return}($.current!==j||A.current!==w)&&(W(""),$.current=j,A.current=w)},[j,w]);const P=e&&e.length>0?e.find(B=>B.chainId===w)||e[0]:null,S=(q=P==null?void 0:P.tokenList)==null?void 0:q.find(B=>B.token===j),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:L}=$l({account:O,chainId:w,contractAddress:void 0,tokens:(P==null?void 0:P.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var K;if(!S)return;if(!S.tokenAddress||S.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const B=T.combinedData[S.tokenAddress];return((K=B==null?void 0:B.balance)==null?void 0:K.formatted)||"0"},[S,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const B=parseFloat(k||"0"),K=10,Z=mp(k,y||"0",I);return!k||B===0||!I?{text:E("deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:B<K?{text:E("deposit.minDepositParsed",{amount:K,token:j}),disabled:!0,isNetworkSwitch:!1}:{text:E("deposit.confirmDeposit"),disabled:!Z,isNetworkSwitch:!1}},[k,j,y,I,_,E]),z=m.useCallback(async()=>{h&&h(w)},[h,w]),G=m.useCallback(async()=>{Yn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(S==null?void 0:S.tokenAddress)||"",tokenSymbol:j})}catch(B){console.error("Deposit error:",B),Yn(!1)}},[p,k,w,S==null?void 0:S.tokenAddress,j]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):P?C.jsxs(C.Fragment,{children:[L,C.jsx(to,{currentActiveChain:P,chainList:e,onChainChange:h,curSelectToken:j,onTokenChange:b,walletType:"evm"}),C.jsx(Fm,{depositAmount:k,curSelectToken:j,curSelectTokenData:{balance:S==null?void 0:S.balance,allowance:S==null?void 0:S.allowance},approved:I,currentActiveChain:P,currentEquity:l||0,amount:k,decimals:(S==null?void 0:S.decimals)||6,tokenBalance:y,platformBalance:u,onDepositAmountChange:W,onApproved:async()=>{d&&await d()}}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:V.isNetworkSwitch?z:G,disabled:V.disabled||s,children:[s&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Rl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:j}=Ye(),F=m.useMemo(()=>{var W;return o?Vo(o,i,!1,(W=l[0])==null?void 0:W.chainId,"0","0"):null},[o,i,l]),k=(F==null?void 0:F.getWalletType())==="mpc";return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:W=>{W.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:j("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),k?C.jsx(Mm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):C.jsx(Bm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Um=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Vm=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Kn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o<=e?C.jsx(Um,{}):C.jsx(Vm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const zm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ye(),d=m.useMemo(()=>{if(!pt(n==null?void 0:n.chainId)){const E=new Oe(e||"0").minus(o||"0").decimalPlaces(2,Oe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=no(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Xe(Math.max(0,w).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Xe(r||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:c("deposit.amount"),value:e,onChange:f,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:c("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(n==null?void 0:n.chainId)&&C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}),C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:pt(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.noticeDesc")}),C.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:c("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.crossChainTips")})}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-text-tertiary text-xs",children:c("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(sn,{content:C.jsxs("div",{children:[C.jsx("div",{children:c("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.FAST,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.Medium,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.SLOW,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(Kn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c("withdraw.fee")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Hm=[],Gm={};let Le=null;const kl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g||{chains:[]}),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Le={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Le=null}),[s,c,a,d,p,f]),C.jsx(Vl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Hm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Gm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});kl.displayName="WithdrawManager";const _l=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.openWithdraw(e||{chains:[]})},Wl=()=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.closeWithdraw()},Bl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.updateWithdrawOptions(e)},qn=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.setWithdrawLoading(e)},Ym=()=>Le?Le.isOpen():!1,Ul=()=>Le?Le.isLoading():!1,Km=()=>({openWithdraw:_l,closeWithdraw:Wl,updateWithdrawOptions:Bl,setWithdrawLoading:qn,isOpen:Ym,isLoading:Ul}),qm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var G;const{t:E}=Ye(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,j]=m.useState(()=>{var H;if(!e||e.length===0)return"";const q=t||((H=e[0])==null?void 0:H.chainId),B=e.find(Z=>Z.chainId===q);if(!B||!B.tokenList||B.tokenList.length===0)return"";const K=B.tokenList.find(Z=>Z.tokenAddress===n)||B.tokenList[0];return(K==null?void 0:K.token)||""}),[F,k]=m.useState(r),[W,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",x=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{j(q),g==null||g(q)},[g]),A=m.useRef(!0),P=m.useRef(N),S=m.useRef(M);m.useEffect(()=>{if(A.current){A.current=!1,P.current=N,S.current=M;return}(P.current!==N||S.current!==M)&&(k(""),P.current=N,S.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(G=O==null?void 0:O.tokenList)==null?void 0:G.find(q=>q.token===N),L=o==null?void 0:o.getDisplayAddress(),{multicallResult:y,queryComponents:I}=$l({account:L,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var B;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return y.baseTokenBalance.formatted;const q=y.combinedData[T.tokenAddress];return((B=q==null?void 0:q.balance)==null?void 0:B.formatted)||"0"},[T,y]),V=m.useMemo(()=>{const q=new Oe(F||"0"),B=new Oe(s||"0"),K=pt(M);return!F||q.isZero()||!K&&q.isLessThan(B)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!K&&!W.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,F,b,W,s]),z=m.useCallback(async()=>{qn(!0);try{if(d){const q=new Oe(F||"0"),B=new Oe(s||"0"),H={amount:(pt(M)?q:q.minus(B)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(H.receiverAddress=W),d(H)}}catch{qn(!1)}},[d,F,s,M,T==null?void 0:T.tokenAddress,N,b,W]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):O?C.jsxs(C.Fragment,{children:[I,C.jsx(to,{currentActiveChain:O,chainList:e,onChainChange:x,curSelectToken:N,onTokenChange:$,walletType:"evm"}),C.jsx(zm,{withdrawAmount:F,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:W,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:V.disabled||a,children:[a&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Vl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),j=m.useMemo(()=>{var F;return o?Vo(o,i,!1,(F=l[0])==null?void 0:F.chainId,"0","0"):null},[o,i,l]);return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:F=>{F.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:N("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),C.jsx(qm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};J.ChromeLoader=ln,J.ComponentProvider=ga,J.DEFAULT_LOCALE=un,J.Deposit=Rl,J.DepositManager=Dl,J.LOCALE_NAMES=pa,J.LoadingSpinner=ln,J.SUPPORTED_LOCALES=Jn,J.Tooltip=sn,J.Withdraw=Vl,J.WithdrawManager=kl,J.closeDeposit=Il,J.closeWithdraw=Wl,J.formatThousands=ba,J.isDepositLoading=Fl,J.isWithdrawLoading=Ul,J.openDeposit=Ml,J.openWithdraw=_l,J.setDepositLoading=Yn,J.setWithdrawLoading=qn,J.updateDepositOptions=jl,J.updateWithdrawOptions=Bl,J.useComponentConfig=Fo,J.useDeposit=xa,J.useDepositManager=Wm,J.useTranslation=Ye,J.useWithdraw=ya,J.useWithdrawManager=Km,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
119
+ `,children:[t,o&&C.jsx(Al,{ref:d,placement:g.placement||n})]})})]})},Co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",Dm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>gp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(fl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),C.jsx(Rp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),l&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),C.jsxs("div",{className:"text-sm",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),C.jsx(sn,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),C.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},Mm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ye(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(j=>j.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(j=>j.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.token===d);return!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?C.jsxs(C.Fragment,{children:[C.jsx(to,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx(Dm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),C.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{i&&i({amount:"",chainId:a,tokenAddress:(g==null?void 0:g.tokenAddress)||"",tokenSymbol:d}),u()},children:s("deposit.title")})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Im=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return Im.includes(t)},jm={USDT:!0},Oo=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!jm[t.toUpperCase()]:!0},ln=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const i=t?`loading-${t}`:"",l=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Fm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ye(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(Oo(o==null?void 0:o.chainId,t))try{const F=new Oe(j),k=new Oe("200000");F.gt(k)&&(j="200000")}catch(F){console.warn("Error calculating max amount limit:",F)}return j},[s,o==null?void 0:o.chainId,t]),M=m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(e||"0"),F=new Oe("200000");return j.isNaN()||F.isNaN()?!1:j.gte(F)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(s||"0"),F=new Oe("200000");return j.gt(F)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=j=>{const F=j.target.value,k=E(),W=no(F,k);if(W.isValid)c(W.formattedValue),W.errorType;else return W.errorType==="exceed_balance",void 0},N=()=>{const j=parseFloat(s||"0"),F=parseFloat(e||"0");if(F>0){const k=j-F,W=Xe(Math.max(0,k).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),W," ",t]})}return`${Xe(s||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:w,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:()=>{const j=E();c(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:p("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:N()})]})]}),!r&&pp(e||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),C.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?C.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),M&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!M&&C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),C.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),C.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Xe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Xe(a)} ${t}`})]})})]})},Rm=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,a;const l=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(a=o==null?void 0:o.useReadContract)==null?void 0:a.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:l,allowance:u})},[l,u,e.tokenAddress,i]),null},$l=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[l,u]=m.useState({}),s=m.useCallback((v,E)=>{u(M=>({...M,[v]:E}))},[]),a=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement(Rm,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=a!=null&&a.data?{value:a.data.value,formatted:a.data.formatted,decimals:a.data.decimals,symbol:a.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},E=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.balance,k=F==null?void 0:F.data;return{address:N.tokenAddress,value:(k==null?void 0:k.value)||BigInt(0),formatted:(k==null?void 0:k.formatted)||"0",decimals:(k==null?void 0:k.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.allowance,k=F==null?void 0:F.data,W=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,j)=>{const F=M.find(k=>k.address===j.address);return{...N,[j.address]:{balance:j,allowance:F||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:E,allowanceList:M,baseTokenBalance:v,combinedData:w}},[a,l,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(a==null?void 0:a.isLoading)||!1,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const km={symbol:"USDT"},Dl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),C.jsx(Rl,{isOpen:n,isLoading:o,onClose:c,config:l.config||km,currentActiveAccount:l.currentActiveAccount||ro,smartWallet:l.smartWallet||oo,chains:l.chains||vp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||io,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Dl.displayName="DepositManager";const Ml=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},Il=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},jl=e=>{Pe&&Pe.updateDepositOptions(e)},Yn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},_m=()=>Pe?Pe.isOpen():!1,Fl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Ml,closeDeposit:Il,updateDepositOptions:jl,setDepositLoading:Yn,isOpen:_m,isLoading:Fl}),Bm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var q;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var B;return!e||e.length===0?1:t||((B=e[0])==null?void 0:B.chainId)||1}),[j,F]=m.useState(()=>{var Z;if(!e||e.length===0)return"";const B=t||((Z=e[0])==null?void 0:Z.chainId),K=e.find(ae=>ae.chainId===B);if(!K||!K.tokenList||K.tokenList.length===0)return"";const H=K.tokenList.find(ae=>ae.tokenAddress===n)||K.tokenList[0];return(H==null?void 0:H.token)||""}),[k,W]=m.useState(r),h=m.useCallback(B=>{N(B),g==null||g(B)},[g]),b=m.useCallback(B=>{F(B),v==null||v(B)},[v]),x=m.useRef(!0),$=m.useRef(j),A=m.useRef(w);m.useEffect(()=>{if(x.current){x.current=!1,$.current=j,A.current=w;return}($.current!==j||A.current!==w)&&(W(""),$.current=j,A.current=w)},[j,w]);const P=e&&e.length>0?e.find(B=>B.chainId===w)||e[0]:null,S=(q=P==null?void 0:P.tokenList)==null?void 0:q.find(B=>B.token===j),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:L}=$l({account:O,chainId:w,contractAddress:void 0,tokens:(P==null?void 0:P.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var K;if(!S)return;if(!S.tokenAddress||S.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const B=T.combinedData[S.tokenAddress];return((K=B==null?void 0:B.balance)==null?void 0:K.formatted)||"0"},[S,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const B=parseFloat(k||"0"),K=10,Z=mp(k,y||"0",I);return!k||B===0||!I?{text:E("deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:B<K?{text:E("deposit.minDepositParsed",{amount:K,token:j}),disabled:!0,isNetworkSwitch:!1}:{text:E("deposit.confirmDeposit"),disabled:!Z,isNetworkSwitch:!1}},[k,j,y,I,_,E]),z=m.useCallback(async()=>{h&&h(w)},[h,w]),G=m.useCallback(async()=>{Yn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(S==null?void 0:S.tokenAddress)||"",tokenSymbol:j})}catch(B){console.error("Deposit error:",B),Yn(!1)}},[p,k,w,S==null?void 0:S.tokenAddress,j]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):P?C.jsxs(C.Fragment,{children:[L,C.jsx(to,{currentActiveChain:P,chainList:e,onChainChange:h,curSelectToken:j,onTokenChange:b,walletType:"evm"}),C.jsx(Fm,{depositAmount:k,curSelectToken:j,curSelectTokenData:{balance:S==null?void 0:S.balance,allowance:S==null?void 0:S.allowance},approved:I,currentActiveChain:P,currentEquity:l||0,amount:k,decimals:(S==null?void 0:S.decimals)||6,tokenBalance:y,platformBalance:u,onDepositAmountChange:W,onApproved:async()=>{d&&await d()}}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:V.isNetworkSwitch?z:G,disabled:V.disabled||s,children:[s&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Rl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:j}=Ye(),F=m.useMemo(()=>{var W;return o?Vo(o,i,!1,(W=l[0])==null?void 0:W.chainId,"0","0"):null},[o,i,l]),k=(F==null?void 0:F.getWalletType())==="mpc";return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:W=>{W.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:j("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),k?C.jsx(Mm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):C.jsx(Bm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Um=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Vm=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Kn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o<=e?C.jsx(Um,{}):C.jsx(Vm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const zm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ye(),d=m.useMemo(()=>{if(!pt(n==null?void 0:n.chainId)){const E=new Oe(e||"0").minus(o||"0").decimalPlaces(2,Oe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=no(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Xe(Math.max(0,w).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Xe(r||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:c("deposit.amount"),value:e,onChange:f,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),C.jsx("button",{onClick:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(sn,{content:c("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(n==null?void 0:n.chainId)&&C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}),C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:pt(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.noticeDesc")}),C.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:c("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.crossChainTips")})}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-text-tertiary text-xs",children:c("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(sn,{content:C.jsxs("div",{children:[C.jsx("div",{children:c("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.FAST,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.Medium,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.SLOW,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(Kn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c("withdraw.fee")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Hm=[],Gm={};let Le=null;const kl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g||{chains:[]}),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Le={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Le=null}),[s,c,a,d,p,f]),C.jsx(Vl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Hm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Gm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});kl.displayName="WithdrawManager";const _l=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.openWithdraw(e||{chains:[]})},Wl=()=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.closeWithdraw()},Bl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.updateWithdrawOptions(e)},qn=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.setWithdrawLoading(e)},Ym=()=>Le?Le.isOpen():!1,Ul=()=>Le?Le.isLoading():!1,Km=()=>({openWithdraw:_l,closeWithdraw:Wl,updateWithdrawOptions:Bl,setWithdrawLoading:qn,isOpen:Ym,isLoading:Ul}),qm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var G;const{t:E}=Ye(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,j]=m.useState(()=>{var H;if(!e||e.length===0)return"";const q=t||((H=e[0])==null?void 0:H.chainId),B=e.find(Z=>Z.chainId===q);if(!B||!B.tokenList||B.tokenList.length===0)return"";const K=B.tokenList.find(Z=>Z.tokenAddress===n)||B.tokenList[0];return(K==null?void 0:K.token)||""}),[F,k]=m.useState(r),[W,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",x=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{j(q),g==null||g(q)},[g]),A=m.useRef(!0),P=m.useRef(N),S=m.useRef(M);m.useEffect(()=>{if(A.current){A.current=!1,P.current=N,S.current=M;return}(P.current!==N||S.current!==M)&&(k(""),P.current=N,S.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(G=O==null?void 0:O.tokenList)==null?void 0:G.find(q=>q.token===N),L=o==null?void 0:o.getDisplayAddress(),{multicallResult:y,queryComponents:I}=$l({account:L,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var B;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return y.baseTokenBalance.formatted;const q=y.combinedData[T.tokenAddress];return((B=q==null?void 0:q.balance)==null?void 0:B.formatted)||"0"},[T,y]),V=m.useMemo(()=>{const q=new Oe(F||"0"),B=new Oe(s||"0"),K=pt(M);return!F||q.isZero()||!K&&q.isLessThan(B)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!K&&!W.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,F,b,W,s]),z=m.useCallback(async()=>{qn(!0);try{if(d){const q=new Oe(F||"0"),B=new Oe(s||"0"),H={amount:(pt(M)?q:q.minus(B)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(H.receiverAddress=W),d(H)}}catch{qn(!1)}},[d,F,s,M,T==null?void 0:T.tokenAddress,N,b,W]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):O?C.jsxs(C.Fragment,{children:[I,C.jsx(to,{currentActiveChain:O,chainList:e,onChainChange:x,curSelectToken:N,onTokenChange:$,walletType:"evm"}),C.jsx(zm,{withdrawAmount:F,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:W,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:V.disabled||a,children:[a&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Vl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),j=m.useMemo(()=>{var F;return o?Vo(o,i,!1,(F=l[0])==null?void 0:F.chainId,"0","0"):null},[o,i,l]);return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:F=>{F.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:N("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),C.jsx(qm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};J.ChromeLoader=ln,J.ComponentProvider=ga,J.DEFAULT_LOCALE=un,J.Deposit=Rl,J.DepositManager=Dl,J.LOCALE_NAMES=pa,J.LoadingSpinner=ln,J.SUPPORTED_LOCALES=Jn,J.Tooltip=sn,J.Withdraw=Vl,J.WithdrawManager=kl,J.closeDeposit=Il,J.closeWithdraw=Wl,J.formatThousands=ba,J.isDepositLoading=Fl,J.isWithdrawLoading=Ul,J.openDeposit=Ml,J.openWithdraw=_l,J.setDepositLoading=Yn,J.setWithdrawLoading=qn,J.updateDepositOptions=jl,J.updateWithdrawOptions=Bl,J.useComponentConfig=Fo,J.useDeposit=xa,J.useDepositManager=Wm,J.useTranslation=Ye,J.useWithdraw=ya,J.useWithdrawManager=Km,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
120
120
  //# sourceMappingURL=index.umd.js.map