1(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[4258],{31734(e,t,n){const s={"./ar_EG.js":[2658,[2658]],"./az_AZ.js":[17593,[17593]],"./bg_BG.js":[6837,[6837]],"./bn_BD.js":[13849,[13849]],"./by_BY.js":[56902,[34521]],"./ca_ES.js":[74903,[74903]],"./context.js":[91789,[91789]],"./cs_CZ.js":[42672,[42672]],"./da_DK.js":[95115,[95115]],"./de_DE.js":[8829,[8829]],"./el_GR.js":[98737,[98737]],"./en_GB.js":[82263,[82263]],"./en_US.js":[45430,[45430]],"./es_ES.js":[38319,[38319]],"./et_EE.js":[43589,[65970]],"./eu_ES.js":[28473,[28473]],"./fa_IR.js":[24231,[24231]],"./fi_FI.js":[53145,[53145]],"./fr_BE.js":[84330,[84330]],"./fr_CA.js":[27239,[27239]],"./fr_FR.js":[73975,[73975]],"./ga_IE.js":[44517,[44517]],"./gl_ES.js":[77842,[77842]],"./he_IL.js":[41883,[41883]],"./hi_IN.js":[66993,[66993]],"./hr_HR.js":[89099,[89099]],"./hu_HU.js":[41349,[41349]],"./hy_AM.js":[17424,[17424]],"./id_ID.js":[63769,[63769]],"./index.js":[58530,[58530]],"./is_IS.js":[25023,[25023]],"./it_IT.js":[79961,[79961]],"./ja_JP.js":[70554,[70554]],"./ka_GE.js":[70227,[70227]],"./kk_KZ.js":[72360,[72360]],"./km_KH.js":[9432,[9432]],"./kmr_IQ.js":[81729,[81729]],"./kn_IN.js":[18659,[18659]],"./ko_KR.js":[10060,[10060]],"./ku_IQ.js":[43609,[43609]],"./lt_LT.js":[96275,[96275]],"./lv_LV.js":[73875,[73875]],"./mk_MK.js":[61279,[61279]],"./ml_IN.js":[55131,[55131]],"./mn_MN.js":[51601,[51601]],"./ms_MY.js":[20329,[20329]],"./my_MM.js":[67863,[67863]],"./nb_NO.js":[83732,[83732]],"./ne_NP.js":[5030,[5030]],"./nl_BE.js":[20860,[20860]],"./nl_NL.js":[44895,[44895]],"./ph_PH.js":[55267,[55267]],"./pl_PL.js":[77227,[77227]],"./pt_BR.js":[24579,[24579]],"./pt_PT.js":[47259,[47259]],"./ro_RO.js":[98277,[98277]],"./ru_RU.js":[21753,[21753]],"./si_LK.js":[19794,[19794]],"./sk_SK.js":[5231,[5231]],"./sl_SI.js":[41702,[41702]],"./sr_RS.js":[50999,[50999]],"./sv_SE.js":[84368,[84368]],"./ta_IN.js":[8637,[8637]],"./th_TH.js":[44523,[44523]],"./tk_TK.js":[37881,[37881]],"./tr_TR.js":[88235,[88235]],"./uk_UA.js":[50457,[50457]],"./ur_PK.js":[77827,[77827]],"./useLocale.js":[63891,[63891]],"./uz_UZ.js":[14857,[14857]],"./vi_VN.js":[28524,[28524]],"./zh_CN.js":[29404,[29404]],"./zh_HK.js":[42236,[42236]],"./zh_TW.js":[34140,[34140]]};function r(e){try{if(!n.o(s,e))return Promise.resolve().then((()=>{const t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}catch(e){return Promise.reject(e)}const t=s[e],r=t[0];return n.e(t[1][0]).then((()=>n(r)))}r.keys=()=>Object.keys(s),r.id=31734,e.exports=r},3143(e,t,n){const s={"./ar_SA.js":[12840,[12840]],"./az_AZ.js":[28531,[28531]],"./bg.js":[63581,[63581]],"./de_DE.js":[49287,[49287]],"./en.js":[13497,[13497]],"./en_CA.js":[72168,[72168]],"./en_GB.js":[84261,[84261]],"./en_US.js":[22416,[]],"./es_001.js":[23838,[23838]],"./es_AR.js":[46646,[46646]],"./es_BG.js":[61010,[61010]],"./es_ES.js":[5169,[5169]],"./fil_PH.js":[31142,[31142]],"./fr_FR.js":[93713,[93713]],"./in_ID.js":[55413,[55413]],"./it_IT.js":[92371,[92371]],"./ja_JP.js":[66980,[66980]],"./ko1_KR1.js":[68662,[68662]],"./nl_NL.js":[15497,[15497]],"./ph_PH.js":[34701,[34701]],"./pl_PL.js":[9013,[9013]],"./pt_BR.js":[57061,[57061]],"./pt_PT.js":[44162,[21781]],"./ru_RU.js":[91811,[91811]],"./sv_SE.js":[11750,[11750]],"./th_TH.js":[96749,[96749]],"./tr_TR.js":[47341,[47341]],"./uk_UA.js":[67399,[67399]],"./uz_UZ.js":[1056,[78675]],"./vi_VN.js":[73450,[73450]],"./zh_CN.js":[14786,[14786]],"./zh_TW.js":[44342,[44342]]};function r(e){try{if(!n.o(s,e))return Promise.resolve().then((()=>{const t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}catch(e){return Promise.reject(e)}const t=s[e],r=t[0];return Promise.all(t[1].map(n.e)).then((()=>n(r)))}r.keys=()=>Object.keys(s),r.id=3143,e.exports=r},95033(e,t,n){"use strict";n.d(t,{dR:()=>u,pf:()=>l,RA:()=>c,eP:()=>a});var s=n(72768),r=n(96242);const o=(0,n(5057).A)("");let i=function(e){return e.getUserIdentity="v1/trigger/trace/user/identity",e.getPortfolioInfoApi="v1/trace/spot/portfolio/uta/getPortfolioInfo",e.traderGetTransferAssetsApi="v1/trace/spot/portfolio/uta/getTransferAssets",e.traderAdjustInvestmentApi="v1/trace/spot/portfolio/uta/adjustInvestment",e.spotUTAConfigApi="v1/trace/spot/public/uta/config",e.userOverviewGetApi="v1/user/overview/web-get",e.userOverviewSetApi="v1/user/overview/set",e.uploadAvatarApi="v1/user/files/upload",e.getAssetsApi="v1/assets/getAssets",e.createPortfolioApi="v1/trace/spot/portfolio/uta/create",e.positionHistory="v1/trace/spot/portfolio/uta/positionHistory",e}({});const a=(e,t,n)=>(0,s.I)({queryKey:["useTraderGetTransferAssets",t],queryFn:()=>(e=>o.post(i.traderGetTransferAssetsApi,e))(n),enabled:e,retry:0}),c=()=>(0,r.n)({mutationKey:["traderAdjustInvestmentApi"],mutationFn:e=>(e=>o.post(i.traderAdjustInvestmentApi,e))(e)}),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.I)({queryKey:["getAssets",e.accountType,e.transferCoinId],queryFn:async()=>{const t=await(e=>o.post(i.getAssetsApi,e))(e);return t.data},enabled:t,retry:0})},u=()=>(0,r.n)({mutationKey:["createPortfolio"],mutationFn:e=>(e=>o.post(i.createPortfolioApi,e))(e)})},5880(e,t,n){"use strict";var s=n(61557),r=n(97732),o=n(41594),i=n(9270),a=n(91787),c=n(52867),l=n(22718),u=n(25599),d=n(44198),m=n(97500),f=n.n(m),p=n(11902),_=n(50447),h=n(38033),x=n(11537),y=n(98535),A=n(96495),g=n(55994),b=n(17114),v=n(90045),j=n(11871),N=n(49884),w=n(73350),T=n(25276),k=n(86070);const S="font-normal leading-[140%] text-contentTertiary cursor-pointer underline decoration-dashed decoration-ds-color-text-disabled underline-offset-[4px] [text-decoration-skip-ink:none] [text-underline-position:from-font] [font-variant-numeric:lining-nums_tabular-nums]";function I(e,t){const n=t?.feeRate?.find((t=>Number(t.symbolId)===Number(e.symbolId)));if(n?.takerFeeRate)return n.takerFeeRate;if(!e.feeRates?.length)return;const s=e.feeRates.find((e=>e.vipLevel===(t?.vipLevel??0)));return s?.takerFeeRate}function R(e){const{balances:t,crossPositions:n,currentOrders:s,tickerMap:r,exchangeRateMap:o,futuresSymbolConfigList:i,userSettings:a}=e,u=function(e){return e.map((e=>({tokenId:e.token,balance:e.balance||"0",frozen:e.frozen||"0",autoBorrow:e.autoBorrow||"0",manualBorrow:e.manualBorrow||"0"})))}(t),d=function(e,t){const n={};for(const s of e)n[s.token]=t[s.token]||s.usdExchangeRate||"0";return n}(t,o),m=function(e){const t={};for(const[n,s]of Object.entries(e))s?.markPrice&&(t[n]=s.markPrice);return t}(r),f=function(e){return e.map((e=>({symbolId:String(e.symbolId),posSide:"Long"===e.positionSide?"long":"short",holdSize:e.holdQty,avgOpenPrice:e.avgOpenPrice,settlementTokenId:e.settleToken})))}(n),{contractTierMap:p,takerFeeRateMap:_,quoteTokenIdMap:h}=function(e,t){const n={},s={},r={};for(const o of e){if(r[String(o.symbolId)]=o.settlementToken,o.futuresTier?.length){const e=[...o.futuresTier].sort(((e,t)=>Number(e.tierMinAmount)-Number(t.tierMinAmount)));n[String(o.symbolId)]=e.map(((e,t)=>({tierLevel:t+1,tierMinAmount:e.tierMinAmount,tierMaxAmount:e.tierMaxAmount,leverage:Number(e.leverage),mmr:e.mmr})))}const e=I(o,t);e&&(s[String(o.symbolId)]=e)}return{contractTierMap:n,takerFeeRateMap:s,quoteTokenIdMap:r}}(i,a),{userLeverageMap:x,defaultLeverageMap:y}=function(e,t){const n={},s={};for(const t of e)n[t.symbol]=String(t.symbolId),t.defaultLeverage&&(s[String(t.symbolId)]=t.defaultLeverage);const r={};for(const e of t?.symbolLeverage??[]){const t=n[e.symbol];t&&(r[t]=e.leverage)}return{userLeverageMap:r,defaultLeverageMap:s}}(i,a),A=function(e){return e.filter((e=>"futures"===e.category?.toLowerCase())).map((e=>({symbolId:String(e.symbolId),side:e.side?.toLowerCase(),remainingQty:e.remainingQty??"0",price:e.price,orderType:e.type?.toLowerCase(),settlementTokenId:e.settleToken,isReduceOnly:e.reduceOnly,status:e.status,bbo:null})))}(s),g={assets:u,positions:f,contractOrders:A};return(0,l.J4)(g,m,d,p,_,h,x,{},{},{},y).totalIm.toFixed(2,c.A.ROUND_UP)}const C=e=>{const{className:t}=e,n=(0,T.$n)(),m=(0,r.md)(s.Df),I=(0,r.md)(s.lx),C=(0,r.md)(N.Hx),P=(0,r.md)(N.pN),M=(0,r.md)(w.s5),O=(0,r.md)(w.Wb),E=(0,r.md)(w.D8),L=(0,r.md)(w.jd),U=(0,r.md)(s.Qv),{formatNumberString:D}=(0,d.Ay)(),z=(0,x.sp)(),{isConnected:F,address:B}=(0,b.v)(),$=(0,v.m)(B),{depositDisabled:q,withdrawDisabled:K}=(0,j.l)(),H=e=>(0,h.A)(e)?"--":`$ ${(0,i.zJ)(e)}`,Z=(0,o.useMemo)((()=>
1{if(!m?.balances?.length)return null;const e=m.balances.map((e=>({tokenId:e.token,balance:e.balance||"0",frozen:e.frozen||"0",autoBorrow:e.autoBorrow||"0",manualBorrow:e.manualBorrow||"0"}))),t={};for(const e of m.balances)t[e.token]=O[e.token]||e.usdExchangeRate||"0";const n={};for(const[e,t]of Object.entries(M))t?.markPrice&&(n[e]=t.markPrice);const s={assets:e,positions:C.map((e=>({symbolId:String(e.symbolId),posSide:"Long"===e.positionSide?"long":"short",holdSize:e.holdQty,avgOpenPrice:e.avgOpenPrice,settlementTokenId:e.settleToken}))),contractOrders:[]};return(0,l.kv)(s,n,t).toFixed(2,c.A.ROUND_DOWN)}),[m?.balances,C,M,O]),W=(0,o.useMemo)((()=>{if(!m?.balances?.length)return null;const e=m.balances.map((e=>({tokenId:e.token,balance:e.balance||"0",frozen:e.frozen||"0",autoBorrow:e.autoBorrow||"0",manualBorrow:e.manualBorrow||"0"}))),t={};for(const e of m.balances)t[e.token]=O[e.token]||e.usdExchangeRate||"0";const n={};for(const[e,t]of Object.entries(M))t?.markPrice&&(n[e]=t.markPrice);const s=C.map((e=>({symbolId:String(e.symbolId),posSide:"Long"===e.positionSide?"long":"short",holdSize:e.holdQty,avgOpenPrice:e.avgOpenPrice,settlementTokenId:e.settleToken}))),r={},o={},i={};for(const e of L){if(i[String(e.symbolId)]=e.settlementToken,e.futuresTier?.length){const t=[...e.futuresTier].sort(((e,t)=>Number(e.tierMinAmount)-Number(t.tierMinAmount)));r[String(e.symbolId)]=t.map(((e,t)=>({tierLevel:t+1,tierMinAmount:e.tierMinAmount,tierMaxAmount:e.tierMaxAmount,leverage:Number(e.leverage),mmr:e.mmr})))}const t=U?.feeRate?.find((t=>Number(t.symbolId)===Number(e.symbolId)));if(t?.takerFeeRate)o[String(e.symbolId)]=t.takerFeeRate;else if(e.feeRates?.length){const t=e.feeRates.find((e=>e.vipLevel===(U?.vipLevel??0)));
1t?.takerFeeRate&&(o[String(e.symbolId)]=t.takerFeeRate)}}const a={assets:e,positions:s,contractOrders:P.filter((e=>"futures"===e.category?.toLowerCase())).map((e=>({symbolId:String(e.symbolId),side:e.side?.toLowerCase(),remainingQty:e.remainingQty??"0",price:e.price,orderType:e.type?.toLowerCase(),settlementTokenId:e.settleToken,isReduceOnly:e.reduceOnly,status:e.status,bbo:null})))};return(0,l.up)(a,n,t,r,{},o,i,{},!0)}),[m?.balances,C,P,M,O,L,U]),Y=(0,o.useMemo)((()=>W?.totalMm.toFixed(2,c.A.ROUND_UP)??null),[W]),Q=(0,o.useMemo)((()=>W?W.totalContractPositionUsdValue.plus(W.totalDebtUsdValue).toFixed(2,c.A.ROUND_DOWN):null),[W]),V=(0,o.useMemo)((()=>m?.balances?.length?R({balances:m.balances,crossPositions:C,currentOrders:P,tickerMap:M,exchangeRateMap:O,futuresSymbolConfigList:L,userSettings:U}):null),[m?.balances,C,P,M,O,L,U]),G=(0,o.useMemo)((()=>{if(!m?.balances?.length)return null;const e=m.balances.map((e=>({tokenId:e.token,balance:e.balance||"0",frozen:e.frozen||"0",autoBorrow:e.autoBorrow||"0",manualBorrow:e.manualBorrow||"0"}))),t={};for(const e of m.balances)t[e.token]=O[e.token]||e.usdExchangeRate||"0";const n={};for(const[e,t]of Object.entries(M))t?.markPrice&&(n[e]=t.markPrice);const s=C.map((e=>({symbolId:String(e.symbolId),posSide:"Long"===e.positionSide?"long":"short",holdSize:e.holdQty,avgOpenPrice:e.avgOpenPrice,settlementTokenId:e.settleToken}))),r=E,o={assets:e,positions:s,contractOrders:[]};return(0,l.q)(o,n,t,r).toFixed(2,c.A.ROUND_DOWN)}),[m?.balances,C,M,O,E]),J=(0,o.useMemo)((()=>{if(!Y||!G)return"0";const e=new c.A(G);return e.isZero()?"0":new c.A(Y).div(e).toFixed(4)}),[Y,G]),X=e=>null!=e?new c.A(e).toFixed(2):e,ee=X(I?.totalCollateral)??G,te=X(I?.initialMargin)??V,ne=X(I?.maintenanceMargin)??Y,se=X(I?.positionValue)??Q,re=X(I?.accountEquity)??Z,oe=I?.crossMarginRatio??J,ie=(0,o.useMemo)((()=>{const e=new c.A(oe);return e.lt(.6)?"text-contentTradeBuy":e.gt(.6)&&e.lte(.8)?"text-contentWarning":"text-contentTradeSell"}),[oe]),ae=(0,o.useMemo)((()=>{if(!Q||!G)return"0";const e=new c.A(G);return e.isZero()?"0":new c.A(Q).div(e).toFixed(2)}),[Q,G]),ce=(0,o.useMemo)((()=>{if(!m?.balances?.length)return"0";const e={};for(const t of m.balances)e[t.token]=O[t.token]||t.usdExchangeRate||"0";const t={};for(const[e,n]of Object.entries(M))n?.markPrice&&(t[e]=n.markPrice);const n=C.map((e=>({symbolId:String(e.symbolId),posSide:"Long"===e.positionSide?"long":"short",holdSize:e.holdQty,avgOpenPrice:e.avgOpenPrice,settlementTokenId:e.settleToken})));let s=new c.A(0);for(const r of n){const n=t[r.symbolId];if(null==n)continue;const o=e[r.settlementTokenId];if(null==o)continue;const i=new c.A(o);if(i.isZero())continue;const a=(0,l.eE)(r,n);s=s.plus(a.times(i))}const r=s.isNegative()?c.A.ROUND_FLOOR:c.A.ROUND_DOWN;return s.toFixed(2,r)}),[m?.balances,C,M,O]),le=I?.effectiveLeverage?new c.A(I.effectiveLeverage).toFixed(2):ae,ue=X(I?.upl)??ce,de=(0,o.useMemo)((()=>{const e=new c.A(ue||0);return e.gt(0)?"text-ds-color-function-trade-buy":e.lt(0)?"text-ds-color-function-trade-sell":"text-contentPrimary"}),[ue]);return(0,k.jsxs)("div",{className:f()("px-4 py-4",t),children:[(0,k.jsxs)("div",{className:"grid grid-cols-2 gap-2 mb-4",children:[(0,k.jsx)(p.A,{block:!0,className:"!rounded-[100px] !px-[10px] !py-[6px] !text-[12px]",onClick:()=>{z(y.q,{},y.Y)},disabled:!F||q,children:n("wallet.info.deposit","Deposit")}),(0,k.jsx)(p.A,{block:!0,className:"!rounded-[100px] !px-[10px] !py-[6px] !text-[12px]",onClick:()=>{z(A._,{},g.s)},disabled:!F||!$||K,children:n("wallet.info.withdraw","Withdraw")})]}),(0,k.jsxs)("div",{className:"mb-4",children:[(0,k.jsx)("div",{className:"text-[12px] font-[550] text-contentPrimary mb-[8px]",children:n("account.title.account_equity","Account Equity")}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:n("account.label.total_equity","Total equity")}),(0,k.jsx)("div",{className:"text-[12px] font-normal text-contentPrimary",children:H(re)})]})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{className:"text-[12px] font-[550] text-contentPrimary mb-[8px]",children:n("account.title.margin_overview","Margin Overview")}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:(0,k.jsx)(_.A,{title:(0,k.jsxs)("span",{children:[(0,k.jsx)(u.s,{id:"uta_asset.cross_margin_rate_desc_a",defaultMessage:"Cross margin rate = maintenance margin ÷ valid margin"}),(0,k.jsx)("br",{}),(0,k.jsx)(u.s,{id:"uta_asset.cross_margin_rate_desc_b",defaultMessage:"The cross margin rate measures the risk level of positions in your account. A higher cross margin rate indicates increased position risk. If the cross margin rate reaches 100% or more, partial or full liquidation will be triggered."})]}),children:(0,k.jsx)("span",{className:S,children:n("account.label.cross_margin_ratio","Cross Margin Ratio")})})}),(0,k.jsx)("div",{className:"flex items-center",children:(0,k.jsx)("span",{className:f()("text-[12px] font-medium",ie),children:D((0,i.zJ)(new c.A(oe).times(100).toFixed(2,c.A.ROUND_UP)),"%")})})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:(0,k.jsx)(_.A,{title:(0,k.jsx)(u.s,{id:"uta_asset.effective_margin_desc",defaultMessage:"The net value (converted to a fiat currency) of assets in the account that can be used as margin for spot and perpetual futures trading in cross margin mode."}),children:(0,k.jsx)("span",{className:S,children:n("account.label.collateral_value","Collateral Value")})})}),(0,k.jsx)("div",{className:"text-[12px] text-contentPrimary",children:H(ee)})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:n("account.label.total_unrealized_pnl","Total unrealized PnL")}),(0,k.jsx)("div",{className:f()("text-[12px]",de),children:F?H(ue):"--"})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:n("account.label.initial_margin","Initial Margin")}),(0,k.jsx)("div",{className:"text-[12px] text-contentPrimary",children:H(te)})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:(0,k.jsx)(_.A,{title:(0,k.jsx)(u.s,{id:"uta_asset.maintenance_margin_desc",defaultMessage:"Maintenance margin is the minimum margin needed to keep a position open."}),children:(0,k.jsx)("span",{className:S,children:n("account.label.maintenance_margin","Maintenance Margin")})})}),(0,k.jsx)("div",{className:"text-[12px] text-contentPrimary",children:H(ne)})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-[8px]",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:(0,k.jsx)(_.A,{title:(0,k.jsx)(u.s,{id:"uta_asset.account_leverage_desc",defaultMessage:"Overall account leverage is calculated as follows: Account leverage = position value ÷ valid margin"}),children:(0,k.jsx)("span",{className:S,children:n("account.label.cross_account_leverage","Cross A
1ccount Leverage")})})}),(0,k.jsx)("div",{className:"text-[12px] text-contentPrimary",children:F?(0,k.jsx)(u.s,{id:"unified_account.leverage",defaultMessage:"{0}x",values:{0:(0,i.zJ)((0,a.aW)(le))}}):"--"})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center",children:[(0,k.jsx)("div",{className:"text-[12px] text-contentTertiary",children:(0,k.jsx)(_.A,{title:(0,k.jsxs)("span",{children:[(0,k.jsx)(u.s,{id:"uta_asset.position_value_desc_a",defaultMessage:"Total value of all cross margin positions in USD."}),(0,k.jsx)("br",{}),(0,k.jsx)(u.s,{id:"uta_asset.position_value_desc_e",defaultMessage:"Margin position value = abs(debt à index price)."}),(0,k.jsx)("br",{}),(0,k.jsx)(u.s,{id:"uta_asset.position_value_desc_f",defaultMessage:"Futures position value = max(long position value + long order value, short position value + short order value)."})]}),children:(0,k.jsx)("span",{className:S,children:n("account.label.total_position_value","Total Position Value")})})}),(0,k.jsx)("div",{className:"text-[12px] text-contentPrimary",children:H(se)})]})]})]})};n.d(t,["A",0,C])},6734(e,t,n){"use strict";n.d(t,{y:()=>o});var s=n(52867);const r=new s.A(0);function o(e,t){if(!t||0===t.length)return r;if(e.lte(0))return r;const n=[...t].sort(((e,t)=>new s.A(e.tierMinAmount).minus(new s.A(t.tierMinAmount)).toNumber()));let o=r,i=e;for(const e of n){if(i.lte(0))break;const t=new s.A(e.tierMaxAmount).minus(new s.A(e.tierMinAmount)),n=i.gte(t)?t:i;o=o.plus(n.times(new s.A(e.discountRate))),i=i.minus(n)}return o}},51987(e,t,n){"use strict";n.d(t,{q:()=>c});var s=n(52867),r=n(23973),o=n(6734),i=n(61003);const a=new s.A(0);function c(e,t,n,c){let l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const u={};for(const t of e.assets){const e=n[t.tokenId];if(null==e)continue;const r=new s.A(e);if(r.isZero())continue;const o=new s.A(t.balance).plus(new s.A(t.frozen)).minus(new s.A(t.autoBorrow)).minus(new s.A(t.manualBorrow));u[t.tokenId]=o.times(r)}for(const o of e.positions){const e=t[o.symbolId];if(null==e)continue;const i=new s.A(e);if(i.isZero())continue;const c=n[o.settlementTokenId];if(null==c)continue;const l=new s.A(c);if(l.isZero())continue;const d=(0,r.e)(o,i).times(l);u[o.settlementTokenId]=(u[o.settlementTokenId]??a).plus(d)}let d=a,m=a;for(const[e,t]of Object.entries(u))t.gt(0)?d=d.plus((0,o.y)(t,c[e])):t.lt(0)&&(m=m.plus(t));const f=d.plus(m),p=(0,i.If)(e.contractOrders,t,l,n),_=a;return f.minus(p).minus(_)}},88302(e,t,n){"use strict";n.d(t,{J4:()=>f,fC:()=>l,xN:()=>p});n(50769),n(43117),n(93642),n(9643),n(26709),n(73581),n(931),n(64109),n(7899),n(27622),n(20130),n(61112),n(57249),n(39017),n(30003),n(76253),n(5531),n(67508),n(741),n(12815),n(52544),n(66591),n(77766),n(74258),n(75594),n(51156),n(15602),n(79495),n(45843);var s=n(52867),r=n(64154);const o=new s.A(0),i=new s.A(1),a=new s.A(2);function c(e,t){if(!t.length)return o;const n=function(e){return[...e].sort(((e,t)=>e.tierLevel-t.tierLevel))}(t);for(const t of n){const n=new s.A(t.tierMinAmount),r=new s.A(t.tierMaxAmount);if(e.gte(n)&&e.lt(r))return new s.A(t.leverage)}const r=n[n.length-1];return new s.A(r.leverage)}function l(e,t,n,l,u,d,m){let f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};const p=new s.A(n),_=new s.A(l),h=new s.A(u),x=new s.A(m);if(p.isZero()||_.isZero())return[o,o,o];const y=function(e,t,n){let r=o;for(const o of e.positions)o.symbolId===t&&"long"===o.posSide&&(r=r.plus(new s.A(o.holdSize).times(n)));return r}(e,t,p).plus(function(e,t,n,i){let a=o;for(const o of e.contractOrders){if(o.symbolId!==t||"buy"!==o.side)continue;const e=i[t]??null,c=(0,r.N)({side:"Buy",orderType:"limit"===o.orderType?"Limit":"Market",orderPrice:o.price,orderStatus:o.status,bbo:e?o.bbo:null,symbolPrice:e?{ask1:e.ask1,bid1:e.bid1,ask5:e.ask5,bid5:e.bid5,lastPrice:e.lastPrice??0}:null,markPrice:n});a=a.plus(c.times(new s.A(o.remainingQty)))}return a}(e,t,p,f)),A=function(e,t,n){let r=o;for(const o of e.positions)o.symbolId===t&&"short"===o.posSide&&(r=r.plus(new s.A(o.holdSize).times(n)));return r}(e,t,p).plus(function(e,t,n,i){let a=o;for(const o of e.contractOrders){if(o.symbolId!==t||"sell"!==o.side)continue;const e=i[t]??null,c=(0,r.N)({side:"Sell",orderType:"limit"===o.orderType?"Limit":"Market",orderPrice:o.price,orderStatus:o.status,bbo:e?o.bbo:null,symbolPrice:e?{ask1:e.ask1,bid1:e.bid1,ask5:e.ask5,bid5:e.bid5,lastPrice:e.lastPrice??0}:null,markPrice:n});a=a.plus(c.times(new s.A(o.remainingQty)))}return a}(e,t,p,f)),g=c(s.A.max(y,A),d);if(g.lte(o))return[o,o,o];const b=s.A.min(g,x);if(b.lte(o))return[o,o,o];const v=i.div(b);let j=o;for(const n of e.positions)if(n.symbolId===t&&"long"===n.posSide){const e=new s.A(n.holdSize).times(p);j=j.plus(e.times(v.plus(h)).times(_))}let N=o;for(const n of e.positions)if(n.symbolId===t&&"short"===n.posSide){const e=new s.A(n.holdSize).times(p);N=N.plus(e.times(v.plus(h)).times(_))}let w=o,T=o;for(const n of e.contractOrders){if(n.symbolId!==t)continue;if(n.isReduceOnly)continue;const e=f[t]??null,o=(0,r.N)({side:"buy"===n.side?"Buy":"Sell",orderType:"limit"===n.orderType?"Limit":"Market",orderPrice:n.price,orderStatus:n.status,bbo:e?n.bbo:null,symbolPrice:e?{ask1:e.ask1,bid1:e.bid1,ask5:e.ask5,bid5:e.bid5,lastPrice:e.lastPrice??0}:null,markPrice:p}).times(new s.A(n.remainingQty)).times(v.plus(h.times(a))).times(_);"buy"===n.side?w=w.plus(o):T=T.plus(o)}return[j.plus(w),N.plus(T),b]}function u(e,t){if(!t.length)return o;const n=[...t].sort(((e,t)=>e.tierLevel-t.tierLevel));for(const t of n){const n=new s.A(t.tierMinAmount),r=new s.A(t.tierMaxAmount);if(e.gte(n)&&e.lt(r))return new s.A(t.leverage)}const r=n[n.length-1];return new s.A(r.leverage)}function d(e,t){for(const n of e.assets){if(n.tokenId!==t)continue;const e=new s.A(n.autoBorrow||0),r=new s.A(n.manualBorrow||0),i=new s.A(n.balance||0),a=new s.A(n.frozen||0);return s.A.max(o,e.plus(r).minus(i).minus(a))}return o}function m(e,t){return void 0!==e?new s.A(e):void 0!==t?new s.A(t):i}function f(e,t,n,r,i,a,c){let f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},p=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{},_=arguments.length>9&&void 0!==arguments[9]?arguments[9]:{},h=arguments.length>10&&void 0!==arguments[10]?arguments[10]:{};const x=new Set;for(const t of e.positions)x.add(t.symbolId);for(const t of e.contractOrders)t.isReduceOnly||x.add(t.symbolId);const y=new Map;let A=o;for(const u of x){const d=t[u];
1if(null==d)continue;const f=new s.A(d);if(f.isZero())continue;const p=a[u];if(!p)continue;const x=n[p];if(null==x)continue;const g=new s.A(x);if(g.isZero())continue;const b=i[u],v=void 0!==b?new s.A(b):o,j=r[u];if(!j?.length)continue;const N=m(c[u],h[u]),[w,T,k]=l(e,u,f,g,v,j,N,_),S=s.A.max(w,T);y.set(u,{symbolId:u,longTotalIm:w,shortTotalIm:T,symbolIm:S,effectiveLeverage:k}),A=A.plus(S)}const g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=o;for(const a of e.assets){const c=a.tokenId,l=d(e,c);if(l.lte(o))continue;const m=t[c];if(null==m)continue;const f=new s.A(m);if(f.lte(o))continue;const p=l.times(f),_=n[c];if(!_?.length)continue;const h=u(l,_);if(h.lte(o))continue;const x=r[c],y=void 0!==x?new s.A(x):h,A=s.A.min(h,y);A.gt(o)&&(i=i.plus(p.div(A)))}return i}(e,n,f,p),b=A.plus(g);return{symbolDetails:y,futuresIm:A,leverageIm:g,totalIm:b}}function p(e){let{holdSize:t,markPrice:n,userLeverage:r,takerFeeRate:a,quoteUsdPrice:l,contractTiers:u}=e;const d=new s.A(t||0),m=new s.A(n||0),f=new s.A(r||0),p=new s.A(a||0),_=new s.A(l||0);if(d.lte(0)||m.lte(0)||f.lte(0)||_.lte(0))return o;const h=d.times(m),x=c(h,u);if(x.lte(0))return o;const y=s.A.min(x,f);if(y.lte(0))return o;const A=i.div(y);return h.times(A.plus(p)).times(_)}},28908(e,t,n){"use strict";n.d(t,{TX:()=>i});var s=n(52867),r=n(51987);n(61003);function o(e,t){if(!t||0===t.length)return null;if(e.lte(0))return null;const n=[...t].sort(((e,t)=>e.tierLevel-t.tierLevel));for(const t of n){const n=new s.A(t.tierMinAmount),r=new s.A(t.tierMaxAmount);if(e.gte(n)&&e.lte(r))return new s.A(t.mmr)}const r=n[n.length-1];return e.gt(new s.A(r.tierMaxAmount))?new s.A(r.mmr):new s.A(n[0].mmr)}function i(e){let{symbolId:t,longSize:n,shortSize:i,accountMm:a,takerFeeRate:c,settlementTokenUsdPrice:l,tiers:u,account:d,markPrices:m,tokenPrices:f,discountRates:p,bboPrices:_={}}=e;const h=m[t];if(null==h)return null;return function(e){let{markPrice:t,longSize:n,shortSize:r,effectiveMargin:i,accountMm:a,takerFeeRate:c,settlementTokenUsdPrice:l,tiers:u}=e;const d=new s.A(n),m=new s.A(r);if(d.isZero()&&m.isZero())return null;const f=new s.A(l);if(f.isZero())return null;const p=new s.A(t),_=s.A.max(d,m),h=o(_.times(p),u);if(null===h)return null;const x=new s.A(a),y=new s.A(c),A=i.minus(x),g=_.times(h.plus(y)).minus(d).plus(m);return g.isZero()?null:p.plus(A.div(f).div(g))}({markPrice:h,longSize:n,shortSize:i,effectiveMargin:(0,r.q)(d,m,f,p,_),accountMm:a,takerFeeRate:c,settlementTokenUsdPrice:l,tiers:u})}},6373(e,t,n){"use strict";n.d(t,{up:()=>l});n(50769),n(43117),n(93642),n(9643),n(26709),n(73581),n(931),n(64109),n(7899),n(27622),n(20130),n(61112),n(57249),n(39017),n(30003),n(76253),n(5531),n(67508),n(741),n(12815),n(52544),n(66591),n(77766),n(74258),n(75594),n(51156),n(15602),n(79495),n(45843);var s=n(52867),r=n(64154),o=n(91787);const i=new s.A(0);function a(e,t,n){const r=new s.A(e),o=new s.A(n);if(r.lte(i))return[1,i];const a=function(e){return[...e].sort(((e,t)=>e.tierLevel-t.tierLevel))}(t);if(!a.length)return[1,i];let c=i,l=r,u=1;for(const e of a){if(l.lte(i))break;const t=new s.A(e.tierMinAmount),n=new s.A(e.tierMaxAmount).minus(t),r=l.lte(n)?l:n;c=c.plus(r.times(new s.A(e.mmr).plus(o))),l=l.minus(r),e.tierLevel>u&&(u=e.tierLevel)}if(l.gt(i)&&a.length){const e=a[a.length-1];c=c.plus(l.times(new s.A(e.mmr).plus(o)))}return[u,c]}function c(e,t,n){const r=new s.A(e),o=new s.A(t);if(r.lte(i))return i;const a=function(e){return[...e].sort(((e,t)=>e.tierLevel-t.tierLevel))}(n);if(!a.length)return i;let c=i,l=r;for(const e of a){if(l.lte(i))break;const t=new s.A(e.tierMinAmount),n=new s.A(e.tierMaxAmount).minus(t),r=l.gte(n)?n:l,a=r.times(o);c=c.plus(a.times(new s.A(e.mmr))),l=l.minus(r)}if(l.gt(i)&&a.length){const e=a[a.length-1],t=l.times(o);c=c.plus(t.times(new s.A(e.mmr)))}return c}function l(e,t,n,l,u,d,m){let f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},p=arguments.length>8&&void 0!==arguments[8]&&arguments[8];const _=new Set;for(const t of e.positions)_.add(t.symbolId);if(p)for(const t of e.contractOrders)t.isReduceOnly||_.add(t.symbolId);const h=new Map;let x=i,y=i;for(const c of _){const u=t[c];if(null==u)continue;const _=new s.A((0,o.j_)(u));if(_.isZero())continue;const A=m[c];if(!A)continue;const g=n[A];if(null==g)continue;const b=new s.A((0,o.j_)(g));if(b.isZero())continue;const v=d[c],j=void 0!==v?new s.A((0,o.j_)(v)):i,N=l[c];if(!N?.length)continue;let w=i,T=i;for(const t of e.positions){if(t.symbolId!==c)continue;const e=new s.A((0,o.j_)(t.holdSize)).times(_);"long"===t.posSide?w=w.plus(e):"short"===t.posSide&&(T=T.plus(e))}let k=i,S=i;if(p)for(const t of e.contractOrders){if(t.symbolId!==c||t.isReduceOnly)continue;
1const e=f[c]??null,n=(0,r.N)({side:"buy"===t.side?"Buy":"Sell",orderType:"limit"===t.orderType?"Limit":"Market",orderPrice:t.price,orderStatus:t.status,bbo:e?t.bbo:null,symbolPrice:e?{ask1:e.ask1,bid1:e.bid1,ask5:e.ask5,bid5:e.bid5,lastPrice:e.lastPrice??0}:null,markPrice:_}).times(new s.A((0,o.j_)(t.remainingQty)));"buy"===t.side?k=k.plus(n):S=S.plus(n)}const I=w.plus(k),R=T.plus(S),C=s.A.max(I,R),P=s.A.max(w,T);y=y.plus(P.times(b));const[M,O]=a(C,N,j),E=O.times(b);h.set(c,{symbolId:c,mm:E,quoteTokenId:A,quoteTokenPrice:b,markPrice:_,positionTier:M,takerFeeRate:j}),x=x.plus(E)}const[A,g]=function(e,t,n){let r=i,o=i;for(const a of e.assets){const e=new s.A(a.autoBorrow||0),l=new s.A(a.manualBorrow||0),u=new s.A(a.balance||0),d=new s.A(a.frozen||0),m=s.A.max(i,e.plus(l).minus(u).minus(d));if(m.lte(i))continue;const f=t[a.tokenId];if(null==f)continue;const p=new s.A(f);if(p.lte(i))continue;const _=m.times(p);o=o.plus(_);const h=n[a.tokenId];if(!h?.length)continue;const x=c(m,p,h);r=r.plus(x)}return[r,o]}(e,n,u),b=x.plus(A);return{symbolDetails:h,mm2:x,mm1:A,totalMm:b,totalContractPositionUsdValue:y,totalDebtUsdValue:g}}},61003(e,t,n){"use strict";n.d(t,{If:()=>i});var s=n(52867);const r=new s.A(0);function o(e,t,n,o){let i;const a="buy"===e.side?1:-1;if("limit"===e.orderType)i=new s.A(e.price);else{i=function(e,t,n){if(!t)return n;if("buy"===e){let e=n;const r=new s.A(t.lastPrice),o=new s.A(t.bid1);return r.gt(0)&&(e=s.A.min(e,r)),o.gt(0)&&(e=s.A.min(e,o)),e}{let e=n;const r=new s.A(t.lastPrice),o=new s.A(t.ask1);return r.gt(0)&&(e=s.A.max(e,r)),o.gt(0)&&(e=s.A.max(e,o)),e}}("buy"===e.side?"sell":"buy",t,n)}const c=new s.A(e.remainingQty).times(n.minus(i)).times(a);return(c.isNeg()?c.abs():r).times(o)}function i(e,t,n,i){let a=r;for(const r of e){const e=t[r.symbolId];if(null==e)continue;const c=new s.A(e);if(c.isZero())continue;const l=i[r.settlementTokenId];if(null==l)continue;const u=new s.A(l);if(u.isZero())continue;const d=n[r.symbolId]??null;a=a.plus(o(r,d,c,u))}return a}},64154(e,t,n){"use strict";n.d(t,{I:()=>m,N:()=>d});n(27931);var s=n(52867);const r=new s.A(0),o=new s.A(1),i=new s.A(2);function a(e,t){return e.gt(r)?e:t}function c(e,t,n){return"Buy"===e?new s.A(t):new s.A(n)}function l(e,t,n){return"Buy"===e?new s.A(t??0):new s.A(n??0)}const u=["WaitToSend","PendingNew","PendingCancel"];function d(e){let{side:t,orderType:n,orderPrice:o,orderStatus:i,bbo:d,symbolPrice:m,markPrice:f}=e;let p,_=new s.A(f);if(m){const e=new s.A(m.ask1),t=new s.A(m.lastPrice);e.gt(r)?_=e:t.gt(r)&&(_=t)}if("Limit"===n){const e=new s.A(o);if("Buy"===t)p=e;else{p=u.includes(i??"")?s.A.max(e,_):e}}else p=_;return d&&"None"!==d&&(p=function(e,t,n,s){if(!n)return s;switch(t){case"Counterparty1":return a(c(e,n.ask1,n.bid1),s);case"Counterparty5":return a(l(e,n.ask5,n.bid5),s);case"Queue1":return a(c(e,n.bid1,n.ask1),s);case"Queue5":return a(l(e,n.bid5,n.ask5),s);default:return s}}(t,d,m??null,p)),p}function m(e){let{qty:t,indicativePrice:n,leverage:a,takerFeeRate:c}=e;const l=new s.A(t||0),u=new s.A(n||0),d=new s.A(a||0),m=new s.A(c||0);if(l.lte(0)||u.lte(0)||d.lte(0))return r;const f=o.div(d);return l.times(u).times(f.plus(m.times(i)))}},23973(e,t,n){"use strict";n.d(t,{e:()=>i});var s=n(52867),r=n(91787);const o=new s.A(0);function i(e,t){const n=new s.A((0,r.j_)(t)),i=new s.A((0,r.j_)(e.avgOpenPrice)),a=new s.A((0,r.j_)(e.holdSize));return"long"===e.posSide?n.minus(i).times(a):"short"===e.posSide?i.minus(n).times(a):o}},22718(e,t,n){"use strict";n.d(t,{kv:()=>a,Nv:()=>d.N,I2:()=>d.I,$h:()=>u,eE:()=>s.e,q:()=>r.q,J4:()=>m.J4,up:()=>c.up});var s=n(23973),r=(n(6734),n(61003),n(51987)),o=(n(28908),n(52867));const i=new o.A(0);function a(e,t,n){const r={};for(const t of e.assets){const e=n[t.tokenId];if(null==e)continue;const s=new o.A(e);if(s.isZero())continue;const i=new o.A(t.balance).plus(new o.A(t.frozen)).minus(new o.A(t.autoBorrow)).minus(new o.A(t.manualBorrow));r[t.tokenId]=i.times(s)}for(const a of e.positions){const e=t[a.symbolId];if(null==e)continue;const c=new o.A(e);if(c.isZero())continue;const l=n[a.settlementTokenId];if(null==l)continue;const u=new o.A(l);if(u.isZero())continue;const d=(0,s.e)(a,c).times(u);r[a.settlementTokenId]=(r[a.settlementTokenId]??i).plus(d)}return Object.values(r).reduce(((e,t)=>e.plus(t)),i)}var c=n(6373);const l=new o.A(0);function u(e){let{orderType:t,qty:n,limitPrice:s,markPrice:r,triggerPrice:i}=e;const a=new o.A(n||0);if(a.lte(0))return l;const c=function(e,t){switch(e){case"limit":case"trigger_limit":return new o.A(t.limitPrice||0);case"market":return new o.A(t.markPrice||0);case"trigger_market":return new o.A(t.triggerPrice||0);default:return l}}(t,{limitPrice:s,markPrice:r,triggerPrice:i});return c.lte(0)?l:c.times(a)}var d=n(64154),m=n(88302)},74801(e,t,n){"use strict";n.d(t,{A:()=>T});var s=n(25599),r=n(11902),o=n(41594),i=n.n(o),a=n(9270),c=n(52867),l=n(37372),u=n(97732),d=n(6930),m=n(5441),f=n(44198),p=n(86070);const _=e=>{let{value:t,prefixStr:n="",suffixStr:s="",showPlus:r=!1,onlyPrimaryText:i=!1,defaultColorClass:c="text-ds-color-text-primary",className:l=""}=e;const{formatNumberString:u}=(0,f.Ay)(),d=(0,o.useMemo)((()=>{const e=Number(t);if(isNaN(e))return t;const o=(0,a.zJ)(Math.abs(e));let i=o;return e>0&&r?i=`+${o}`:e<0&&(i=`-${o}`),u(i,n||s)}),[t,n,s,r,u]),m=(0,o.useMemo)((()=>
1{if(i)return c;const e=Number(t);return isNaN(e)||0===e?c:e>0?"text-ds-color-function-trade-buy":e<0?"text-ds-color-function-trade-sell":void 0}),[t,i,c]);return(0,p.jsx)("span",{className:`${m} ${l}`,children:d})},h=i().memo(_);const x=(e,t)=>{const{holdCount:n,holdAvgPrice:s,symbolCode:r}=e,o=((e,t)=>{if(!t||0===t.length)return"0.0000";const n=t.find((t=>t.symbolCode===e));return n?n.price:"0.0000"})(r,t);if(!n||!s||!o||"0"===n||"0"===s||"0.0000"===o)return null;try{const e=new c.A(n),t=new c.A(s),r=new c.A(o),i=e.mul(r),a=e.mul(t);return i.sub(a)}catch(e){return null}},y=(e,t)=>{if(!e||0===e.length)return"0.00";try{let n=new c.A(0);e.forEach((e=>{const s=x(e,t);s&&(n=n.add(s))}));const s=n.isPositive()?c.A.ROUND_DOWN:c.A.ROUND_UP;return n.toFixed(2,s)}catch(e){return"0.00"}};var A=n(33441),g=n(16191),b=n(32596),v=n(62e3),j=n(25642),N=n(78099),w=n(4580);const T=e=>{let{className:t}=e;const n=(0,u.md)(l.r0),i=(0,u.md)(d.Bq),f=(0,u.md)(m.Ke),_=(0,u.md)(d.__),x=(0,u.Xr)(d.vC),T=(0,u.md)(g.Il),k=(0,u.md)(g.Tj),{openCopyTradingTransfer:S}=(0,A.A)(),I=(0,b.u)(),R=(0,u.md)(v.T0),C=(0,u.md)(m.YC),P=(0,o.useMemo)((()=>{if(!i.length||!f.length)return"0.00";let e=new c.A(0);i.forEach((t=>{const s=new c.A(t.balance||0).plus(new c.A(t.frozen||0));if(s.isZero())return;const r=f.find((e=>e.coinId===t.tokenId));if(!r)return;const o=r.coinName.toUpperCase();if(o===j.z8.USDT)e=e.plus(s);else{const t=`${o}USDT`.toUpperCase(),r=n.find((e=>e.symbolCode?.toUpperCase()===t));if(r&&r.price){const t=s.times(new c.A(r.price));e=e.plus(t)}}}));return e.times(new c.A(k)).toFixed(2,c.A.ROUND_DOWN)}),[i,f,n,k]),M=(0,o.useMemo)((()=>{const e=y(_,n);return new c.A(e).times(new c.A(k)).toFixed(2,c.A.ROUND_DOWN)}),[_,n,k]);(0,o.useEffect)((()=>{const e=y(_,n);x(e)}),[_,n,x]);const O=(0,o.useCallback)((()=>{const e=(0,w.BN)("copy-trading/spot-center/overview",C);(0,N.a)(e)}),[C]);return(0,p.jsx)("div",{className:`px-4 ${t||""}`,children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:"font-semibold text-[14px] leading-[20px] text-contentPrimary py-4 draggableHandleClass",children:(0,p.jsx)(s.s,{id:"header_nav.assets.account",defaultMessage:"Accounts"})}),(0,p.jsx)("div",{className:"font-semibold text-[12px] mb-2 text-contentPrimary",children:(0,p.jsx)(s.s,{id:"futures.asset_mode.asset",defaultMessage:"Assets"})}),(0,p.jsxs)("div",{className:"text-xs flex justify-between items-center mb-2",children:[(0,p.jsx)("div",{className:"text-contentTertiary",children:(0,p.jsx)(s.s,{id:"unified_asset.all_asset_voluation",defaultMessage:"Total asset valuation"})}),(0,p.jsxs)("div",{className:"text-contentPrimary",children:[(0,a.zJ)(P)," ",T.toUpperCase()]})]}),(0,p.jsxs)("div",{className:"text-xs flex justify-between items-center mb-2",children:[(0,p.jsx)("div",{className:"text-contentTertiary",children:(0,p.jsx)(s.s,{id:"position_block_text.position_unrealised_pnl",defaultMessage:"Unrealized PnL"})}),(0,p.jsx)(h,{value:M,suffixStr:` ${T.toUpperCase()}`,showPlus:!0})]}),!I&&R&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.A,{className:"w-full mb-2",onClick:S,children:(0,p.jsx)(s.s,{id:"copy_spot.transfer.main_title",defaultMessage:"Adjust Balance"})}),(0,p.jsx)(r.A,{className:"w-full",onClick:O,children:(0,p.jsx)(s.s,{id:"home.spot_revision.apply_create_view",defaultMessage:"View portfolio"})})]})]})})}},33441(e,t,n){"use strict";n.d(t,{A:()=>T});var s=n(97732),r=n(11537),o=n(25276),i=n(6930),a=n(41594),c=n(89449),l=n(50440),u=n(50447),d=n(11902),m=n(27796),f=n(28661),p=n(25599),_=n(23289),h=n(31533),x=n(62e3),y=n(34996),A=n(95033),g=n(91787),b=n(93599),v=n(91773),j=n(86070),N=function(e){return e.IN="in",e.OUT="out",e}(N||{});const w=e=>{let{portfolioId:t,close:n}=e;const r=(0,o.$n)(),w=(0,_.G)(),T=(0,s.md)(x.Od),k=(0,s.Xr)(v.Tj),[S,I]=(0,a.useState)(N.IN),[R,C]=(0,a.useState)("0"),[P,M]=(0,a.useState)(""),O=(0,s.md)(i.Sg),E=(0,a.useRef)(null),{data:L,refetch:U,isLoading:D}=(0,A.eP)(!!t,S,{portfolioId:t,tokenId:2}),{mutateAsync:z,isLoading:F}=(0,A.RA)(),B=(0,s.md)(v.Tj);(0,a.useEffect)((()=>{t&&U()}),[t,S,U]),(0,a.useEffect)((()=>{B&&t&&(U(),k(!1))}),[B,t,U,k]),(0,a.useEffect)((()=>
1{if(L&&(0,g.oJ)(L.code)){const e=S===N.IN?(0,g.aW)(Number(L?.data.availAbleAmount)):(0,g.aW)(Number(L?.data.maxWithdrawalAmount));C(e)}}),[L,S]);const $=(0,a.useMemo)((()=>({tokenId:L?.data.tokenId||2,tokenName:L?.data.tokenName||"USDT"})),[L]),q=(0,a.useMemo)((()=>T?r("copy_spot.transfer.funding_account","Funding Account"):r("copy_spot.transfer.spot_account","Spot Account")),[r,T]),K=(0,a.useMemo)((()=>({size:"large",decimal:2,placeholder:r("copy_spot.transfer.transfer_input_placeholder","Enter amount"),max:Number(R)||0,min:0,round:!1,validate:(e,t)=>e&&0!==Number(e)?Number(e)>Number(R)?(t(r("copy_spot.transfer.input_amount_over_msg","Exceeding the available amount that can be transferred out.")),!1):(t(),!0):(t(r("copy_spot.transfer.transfer_input_placeholder","Enter amount")),!1)})),[r,R]),H=(0,a.useMemo)((()=>[{key:N.IN,label:r("copy_spot.transfer.transfer_button_in","Add")},{key:N.OUT,label:r("copy_spot.transfer.transfer_button_out","Transfer out")}]),[r]);return(0,j.jsxs)("div",{children:[(0,j.jsx)("div",{className:"py-[12px]",children:(0,j.jsx)("span",{className:"text-ds-color-text-secondary",children:((e,t)=>e===N.IN?r("copy_spot.transfer.transfer_tip_in","Add funds to your elite portfolio from your {0}.",{0:(0,j.jsx)("span",{className:"font-medium text-ds-color-text-primary",children:t})}):r("copy_spot.transfer.transfer_tip_out","Transfer out assets from your elite portfolio to your {0}.",{0:(0,j.jsx)("span",{className:"font-medium text-ds-color-text-primary",children:t})}))(S,q)})}),(0,j.jsx)("div",{className:"py-[14px]",children:(0,j.jsx)(l.A,{items:H,onChange:e=>{I(e),M(""),E.current?.resetFields()},type:"segmented",block:!0,noHeaderMargin:!0})}),(0,j.jsx)(h.A,{ref:E,value:P,onChange:e=>{E.current?.resetFields(),M(e)},options:K,isShowSlider:!1,inputClassName:"!rounded-[8px] bg-ds-color-background-tertiary [&>input]:bg-ds-color-background-tertiary",suffix:(0,j.jsxs)("div",{className:"flex items-center text-fs14 font-[500]",children:[(0,j.jsx)("div",{className:"me-[8px]",children:$.tokenName}),(0,j.jsx)("div",{onClick:()=>{R&&Number(R)>0&&E.current?.resetFields(),M(R)},className:"text-ds-color-function-brand cursor-pointer",children:"MAX"})]})}),(0,j.jsxs)("div",{className:"py-[12px] flex items-center justify-between",children:[(0,j.jsx)("div",{className:"text-ds-color-text-secondary",children:S===N.IN?(0,j.jsx)("div",{children:r("copy_spot.transfer.amount_tip_in","Available to add")}):(0,j.jsxs)("div",{className:"flex gap-[4px] items-center",children:[r("copy_spot.transfer.amount_tip_out","Available to transfer out"),(0,j.jsx)(u.A,{title:r("copy_spot.transfer.amount_tip_out_info","You need to keep at least {0} USDT in your elite portfolio. To transfer everything out, you'll need to close the portfolio first.",{0:O?.portfolioVO?.portfolioMinInvestment||100}),children:(0,j.jsx)(m.A,{className:"w-[16px] h-[16px] cursor-pointer"})})]})}),(0,j.jsx)("div",{children:(0,j.jsxs)("div",{className:"flex gap-[4px]",children:[(0,j.jsx)("div",{className:"text-ds-color-text-primary font-medium",children:(0,b.g_)({number:R,symbol:$.tokenName,place:2})}),S===N.IN?(0,j.jsx)("div",{onClick:()=>{w({tokenId:2,fromAccountType:y.BK.USDT_MIX,toAccountType:y.BK.SPOT,successCallBack:()=>{U(),k(!0)}})},className:"cursor-pointer h-[16px]",children:(0,j.jsx)(f.A,{className:"w-[16px] h-[16px]"})}):null]})})]}),(0,j.jsxs)("div",{className:"pt-[8px] flex items-center gap-[12px]",children:[(0,j.jsx)(d.A,{onClick:n,size:"medium",block:!0,children:(0,j.jsx)(p.s,{id:"btn_cancel",defaultMessage:"Cancel"})}),(0,j.jsx)(d.A,{onClick:async()=>{if(!await(E.current?.validate()))return;if(!((e,t)=>!(!e||Number(t)<Number(e)))(P,R))return;const e={portfolioId:t,tokenId:2,transferType:S===N.IN?0:1,transferAmount:P,transferAccountMode:T?1:0};z(e).then((()=>{c.Ay.success(r("uta_asset.success_tip","Successful")),U(),k(!0),M(""),n?.()}))},loading:F||D,size:"medium",type:"main",block:!0,children:(0,j.jsx)(p.s,{id:"btn_confirm",defaultMessage:"Confirm"})})]})]})},T=()=>{const e=(0,r.sp)(),t=(0,o.$n)(),n=(0,s.md)(i.ip);return{openCopyTradingTransfer:()=>{n.publicPortfolioId&&e(w,{portfolioId:n.publicPortfolioId},{title:t("copy_spot.transfer.main_title","Adjust balance"),footer:null,width:480})}}}},83330(e,t,n){"use strict";n.d(t,{s:()=>c,X:()=>l});var s=n(41594),r=n(59196);class o extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t),(0,r.l2)(e,{componentStack:t?.componentStack,errorBoundary:"BitErrorBoundary",...e?.cause?{cause:String(e.cause)}:{},...t?.digest?{digest:t.digest}:{}})}render(){return this.state.hasError&&this.props.fallback?this.props.fallback:this.props.children}}var i=n(88476),a=n(86070);const c=e=>{let{children:t,fallback:n}=e;return(0,a.jsx)(o,{fallback:n??(0,a.jsx)(i.default,{}),children:t})},l=e=>{const t=(0,s.forwardRef)(((t,n)=>(0,a.jsx)(c,{children:(0,a.jsx)(e,{...t,ref:n})})));return t.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,t}},88476(e,t,n){"use strict";n.r(t);var s=n(25276),r=n(97732),o=n(11902),i=n(54586),a=n(87305),c=n(5441),l=n(86070);const u=()=>{const e=(0,s.$n)(),t=(0,r.md)(c.xn);return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center w-full h-full",children:[(0,l.jsx)("img",{src:t?i:a,alt:"error",className:"mt-4 w-[120px]"}),(0,l.jsx)("div",{className:"my-5 text-thirdText",children:e("netstatus.connect_unstable")}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsx)(o.A,{onClick:()=>window.location.reload(),children:e("strategy_grid_text.refresh")})})]})};n.d(t,["default",0,u])},30647(e,t,n){"use strict";n.d(t,["v",0,{CONTRACT_LIST_MD5_KEY:"ua_future_all_symbols_md5_key_unified",CONTRACT_LIST_DATA:"ua_future_all_symbols_md5_data_unified",CONTRACT_GRADIENT_MD5_KEY:"contract-gradient-md5-key",CONTRACT_GRADIENT_DATA:"contract-gradient-data",CONTRACT_IS_FUTURES_COUPON_MODE:"popdex:mix-isFuturesCouponMode",CONTRACT_IS_CREATION_DEMO_ACCOUNT:"popdex:mix-isCreationDemoAccount",SPOT_L
1IST_MD5_KEY:"get_all_symbol_config_list_md5_key_unified",SPOT_LIST_DATA:"spot_all_symbol_config_md5_data_unified",spot_isolated_config_md5:"spot_isolated_config_md5_unified",spot_isolated_config_Md5_data:"spot_isolated_config_Md5_data_unified",spot_cross_config_md5:"spot_cross_config_md5_unified",spot_cross_config_md5_data:"spot_cross_config_md5_data_unified",SPOT_PARTITION_MD5:"spot_partition_md5_unified",SPOT_PARTITION_MD5_DATA:"spot_partition_md5_data_unified",SPOT_ASSEST_MD5:"spot_assest_md5_unified",SPOT_ASSEST_MD5_DATA:"spot_assest_md5_data_unified",SPOT_CONVERT_LIST_MD5:"spot_convert_list_md5_unified",SPOT_CONVERT_LIST_MD5_DATA:"spot_convert_list_md5_data_unified",SPOT_PRICE_DEVIATION_TIP:"spot_price_deviation_tip",KLINE_INTERVAL_DEX:"kline_interval_dex",KLINE_INTERVAL_UTA:"kline_interval_uta",TV_INFO:"popdex-kline-saved-mix",CHART_TYPE:"popdex::tv::chartType-spot",SYMBOL:"popdex-kline-m-layout-mix",DELISTED_TIME_KEY:"delisted_copy_trading_no_show_today",SIMULATION_TRADE:"simulation-trade",SIMULATION_CONTRACT_LIST_MD5_KEY:"simulation__future_all_symbols_md5_key_unified",SIMULATION_CONTRACT_LIST_DATA:"simulation_future_all_symbols_md5_data_unified",SIMULATION_SPOT_LIST_MD5_KEY:"simulation_all_symbol_config_list_md5_key_unified",SIMULATION_SPOT_LIST_DATA:"simulation_all_symbol_config_md5_data_unified",SIMULATION_SPOT_PARTITION_MD5:"simulation_spot_partition_md5_unified",SIMULATION_SPOT_PARTITION_MD5_DATA:"simulation_spot_partition_md5_data_unified",TRADFI_CHART_TYPE:"popdex::tv::chartType-tradfi",KLINE_INTERVAL_TRADFI:"kline_interval_tradfi",TRADFI_SYMBOL_LIST_MD5_KEY:"tradfi_symbol_list_md5_key_unified",TRADFI_SYMBOL_LIST_DATA:"tradfi_symbol_list_data_unified",TRADFI_SEARCH_HISTORY:"tradfi_search_history_unified",HELP_CENTER_TIP:"help_center_tip",PREFERENCES_PNL_CALCULATION:"preferences_pnl_calculation",PREFERENCES_ORDER_CONFIRM_LIMIT_ORDER:"preferences_order_confirm_limit_order",PREFERENCES_ORDER_CONFIRM_MARKET_ORDER:"preferences_order_confirm_market_order",PREFERENCES_ORDER_CONFIRM_TRIGGER_ORDER:"preferences_order_confirm_trigger_order",PREFERENCES_ORDER_CONFIRM_PARTIAL_TPSL:"preferences_order_confirm_partial_tpsl",PREFERENCES_ORDER_CONFIRM_FULL_TPSL:"preferences_order_confirm_full_tpsl",PREFERENCES_ORDER_CONFIRM_REVERSE_ORDER:"preferences_order_confirm_reverse_order",PREFERENCES_TRADE_UNIT:"preferences_trade_unit",PREFERENCES_ORDER_BOOK_UNIT:"preferences_order_book_unit",CONTRACT_ORDER_FORM_TYPE:"contract_order_form_type",CONTRACT_ORDER_TIME_IN_FORCE:"contract_order_time_in_force",PREFERENCES_DISPLAY_PROGRESS_CARD:"preferences_display_progress_card",MegaPopCardClosedPrefix:"megapop:cardClosed"}])},26563(e,t,n){"use strict";n.d(t,["Il",0,"0x0000000000000000000000000000000000001011","J2",0,"0x0000000000000000000000000000000000001000","VP",0,"0x0000000000000000000000000000000000001009","Wz",0,"0x0000000000000000000000000000000000001003","eO",0,"0x0000000000000000000000000000000000000000","iE",0,"0x000000000000000000000000000000000000100f","pi",0,"0x000000000000000000000000000000000000100e","wR",0,"0x0000000000000000000000000000000000001008"])},77909(e,t,n){"use strict";n.d(t,{O:()=>o});var s=n(77274);function r(e){return 0===e.length?null:[e[0],...e.slice(1)]}function o(e){const{abi:t,eventName:n,map:o}=e;return e=>{const i=[];for(const l of e)try{const e=l.topics;if(!e)continue;const u=r(e);if(!u)continue;const d=(0,s.j)({abi:t,data:(c=l.data,c??"0x"),topics:u});if(d.eventName!==n)continue;if("object"!=typeof(a=d.args)||null===a||Array.isArray(a))continue;i.push(o(d.args))}catch{}var a,c;return i}}},4580(e,t,n){"use strict";n.d(t,{BN:()=>r,_W:()=>o,o4:()=>a,rR:()=>i});var s=n(44198);n(86263),n(58460);function r(e,t){let n=window.location.host.replace("mix.","");return window.location.host.indexOf("localwww")>-1&&(n="localwww.itssofast.com:3000"),"https:"===window.location.protocol&&(n=window.location.host),t="en"===t?"":"/"+t,0===e.indexOf("/otc")&&(t=""),e.startsWith("/")||(e="/"+e),"//"+n+t+e}function o(e){let{currentLocale:t}=e;const n=window.location.href.split("?")[1]||"";return r(`/login?from=${`${window.location.pathname}&${n}`}&source=mix`,t)}function i(e,t){return(t="en"===t?"":"/"+t)+e}function a(e){return(0,s.Yl)(e,"%")}},95209(e,t,n){"use strict";n(27931);var s=n(41594),r=n(30314),o=n(79791);const i=()=>{const{pathname:e}=(0,r.zy)();return(0,s.useMemo)((()=>e?.includes(o.fo.TradeCopySpot)||!1),[e])},a=i;n.d(t,["A",0,a,"n",0,i])}
1,32596(e,t,n){"use strict";var s=n(41594),r=n(97732),o=n(62e3),i=n(6930),a=n(95209);n.d(t,["u",0,()=>{const e=(0,r.md)(o.T0),t=(0,a.n)(),n=(0,r.md)(i.ip);return(0,s.useMemo)((()=>e&&t&&!n?.publicPortfolioId),[e,t,n?.publicPortfolioId])}])},11740(e,t,n){"use strict";n.d(t,{d:()=>o});var s=n(41594),r=n(47851);function o(e){const{waitTime:t=200,activeFn:n,deps:o=[]}=e;return(0,s.useCallback)((0,r.A)(n,t),[...o])}},23289(e,t,n){"use strict";n.d(t,{G:()=>f});var s=n(97732),r=n(62e3),o=n(5441),i=n(41594),a=n(4580),c=n(78099),l=(n(54599),n(69584)),u=n(34996),d=n(43878),m=n(41866);function f(){const e=(0,s.md)(o.YC),t=(0,s.md)((0,d.Rq)(r.If)),n=(0,s.md)(r.T0),f=(0,s.md)(o.jQ);(0,s.md)(r.Od);return(0,i.useCallback)((async s=>{const{tokenId:r,fromAccountType:o=u.BK.SPOT,toAccountType:i=u.BK.UTA,closeCallBack:d,successCallBack:p,..._}=s||{};if(!n){const t=(0,a._W)({currentLocale:e});return void(0,c.ug)(t)}if(document.getElementById("common-transfer-dialog"))return;const h=document.createElement("div");if(h.setAttribute("class","ct"),h.setAttribute("id","common-transfer-dialog"),document.body.appendChild(h),"hasData"===t?.state){let n={from:o,to:i,initCoinId:r,userInfo:t?.data?.userInfo||{},modalTheme:f,locale:e,initVisible:!0,isDialogLayout:!0,httpRequest:l.Nj,isRawResponse:!0,showSlider:!0,onSuccess:()=>{p&&p?.()},onClose:()=>{d&&d?.(),m.Yz.unmount(h)}};n={...n,..._},await m.Yz.init("",h,n)}}),[n,e,t?.state,t?.data,f])}},44198(e,t,n){"use strict";n.d(t,{Ay:()=>c});n(27931);var s=n(86263),r=n(30314),o=n(98775);const i=e=>{const t=e.indexOf("+"),n=e.indexOf("-");return-1!==t&&-1!==n?Math.min(t,n):-1!==t?t:-1!==n?n:-1},a=e=>{const{direction:t,input:n,symbol:r,isCrypto:o,isCurrency:a,isZeroToCrossbar:c=!1}=e;if(""===n.trim()||"null"===n||"undefined"===n||"--"===n||"-"===n||"NaN"===n)return"--";if(c&&0===Number(n))return"--";const l=["%","X","x"],u=["X","x"];let d="",m=n;const f=r||"";let p="";const _=i(n);return-1!==_&&(d=n[_],m=n.slice(_+1)),p=t===s.ig.LTR?a?`${f}${d}${m}`:o?`${d}${m} ${f}`:l.includes(f)?`${d}${m}${f}`:`${d}${m} ${f}`:o?`${m}${d} ${f}`:a?`${f}${m}${d}`:u.includes(f)?`${d}${m}${f}`:`${f}${m}${d}`,p};function c(){const{locales:e}=(0,r.g)(),t=s.d4.includes(e)?s.ig.RTL:s.ig.LTR;return{direction:t,formatNumberString:(e,n)=>a({direction:t,input:String(e),symbol:n}),formatCurrencyString:(e,n)=>a({direction:t,input:String(e),symbol:n,isCurrency:!0}),formatCryptoString:function(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a({direction:t,input:String(e),symbol:n,isCrypto:!0,...s})},formatNumberString2:(e,n)=>(e=>{const{direction:t,input:n,symbol:r,isCrypto:o,isCurrency:a}=e;if(""===n.trim()||"null"===n||"undefined"===n||"--"===n||"-"===n||"NaN"===n)return"--";const c=["%","x"],l=["x"];let u="",d=n;const m=r||"";let f="";const p=i(n);return-1!==p&&(u=n[p],d=n.slice(p+1)),f=t===s.ig.LTR?a?`${m}${u}${d}`:o?`${u}${d} ${m}`:c.includes(m)?`${u}${d}${m}`:`${u}${d} ${m}`:o?`${d}${u} ${m}`:a?`${m}${d}${u}`:l.includes(m)?`${u}${d}${m}`:`${m}${d}${u}`,f})({direction:t,input:String(e),symbol:n})}}const l=()=>{const e=o.Ay.get(o.eT.LANG)||"en";return s.d4.includes(e)?s.ig.RTL:s.ig.LTR};n.d(t,["C8",0,(e,t)=>a({direction:l(),input:String(e),symbol:t,isCrypto:!0}),"Yl",0,(e,t)=>a({direction:l(),input:String(e),symbol:t})])},58460(e,t,n){"use strict";n.d(t,{A:()=>i});var s=n(59619),r=n(41594),o=n(3636);function i(){const e=(0,r.useContext)(o.Ay);return s.OL?window.location:{hash:"",host:e.request.host,hostname:e.request.hostname,href:e.request.href,origin:e.request.origin,pathname:e.request.path,protocol:e.request.protocol+":",search:e.request.querystring?"?"+e.request.querystring:"",assign:function(t){e.redirect(t)},reload:function(t){t?e.redirect(e.request.href):e.body=e.body},replace:function(t){e.redirect(t)},toString:function(){return e.request.href}}}},55619(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>de});n(21536),n(28162);var s=n(97500),r=n.n(s),o=n(97732),i=n(41594),a=n.n(i),c=n(88499),l=n(70840),u=n(86885),d=n(36359),m=n(11740),f=n(5441),p=n(91773),_=n(30702),h=n(62e3),x=n(64044),y=n(69943),A=n(73350),g=n(991),b=n(20357),v=n(51831),j=n(36341);const N=()=>{const e=(0,j.A)();return(0,i.useMemo)((()=>v.cC.xxs===e),[e])};n(27931);const w=()=>{const e=(0,j.A)();return(0,i.useMemo)((()=>e&&[v.cC.xxs,v.cC.xs].includes(e)),[e])};var T=n(17114),k=n(96973),S=n(68701),I=n(85048),R=n(5880),C=n(74801),P=n(95209),M=n(32596),O=n(83330),E=n(88476),L=n(86070);const U=a().forwardRef(((e,t)=>{const n=N(),s=(0,P.n)(),r=(0,M.u)(),o=(0,i.useRef)(null),[a,c]=(0,i.useState)(!1),l=(0,i.useCallback)((()=>!!o.current&&Math.floor(o.current.scrollHeight)>Math.ceil(o.current.scrollTop+o.current.clientHeight)),[]),u=(0,i.useCallback)((()=>{c(l())}),[l]);return(0,i.useEffect)((()=>{const{current:e}=o,t=()=>{c(l())};return t(),e?.addEventListener("resize",t),()=>e?.removeEventListener("resize",t)}),[l]),s&&r?(0,L.jsx)("div",{ref:t,className:"h-full"}):(0,L.jsxs)("div",{ref:t,className:"h-full flex flex-col rounded-[4px] relative",children:[(0,L.jsx)("div",{ref:o,className:"cursor-auto overflow-auto w-full scrollbar-hide flex-1",onScroll:u,children:s?(0,L.jsx)(C.A,{}):(0,L.jsx)(R.A,{})}
1),a&&n&&(0,L.jsx)("div",{className:"absolute bottom-[1px] flex items-center justify-start w-full cursor-pointer h-10 z-[1] pointer-events-none",style:{backgroundImage:"linear-gradient(to top, var(--background-base) 40%, transparent)"}})]})}));U.displayName="Assets";const D=(0,L.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,L.jsx)(E.default,{})}),z=a().forwardRef(((e,t)=>(0,L.jsx)(O.s,{fallback:D,children:(0,L.jsx)(U,{ref:t})})));z.displayName="AssetsWithBoundary";const F=z,B=a().forwardRef(((e,t)=>(0,L.jsx)("div",{ref:t,className:"h-full",children:e.children})));B.displayName="Depth";const $=(0,O.X)(B),q=a().forwardRef(((e,t)=>(0,L.jsx)("div",{ref:t,className:"bg-ds-color-background-secondary h-full",children:e?.children})));q.displayName="KLine";const K=(0,O.X)(q),H=(0,L.jsx)("div",{className:"h-full w-full overflow-hidden rounded-[8px]",style:{borderRadius:8,border:"1px solid #352F52",background:"linear-gradient(154deg, #020203 -9.76%, #1B1842 82.85%)"},"data-testid":"megapop-card-skeleton"}),Z=(0,I.A)({resolved:{},chunkName:()=>"components-ContractOrderPlacer-components-MegaPopCard",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>Promise.all([n.e(60867),n.e(17508),n.e(33838)]).then(n.bind(n,2150)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>2150},{ssr:!1,loading:H}),W=a().forwardRef(((e,t)=>(0,L.jsx)("div",{ref:t,className:"relative z-[2] flex h-full w-full flex-col overflow-visible",children:(0,L.jsx)(Z,{})})));W.displayName="MegaPop";const Y=(0,L.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,L.jsx)(E.default,{})}),Q=a().forwardRef(((e,t)=>(0,L.jsx)(O.s,{fallback:Y,children:(0,L.jsx)(W,{ref:t})})));Q.displayName="MegaPopWithBoundary";const V=Q,G=a().forwardRef(((e,t)=>{const n=N(),s=(0,P.n)(),r=(0,M.u)(),{isConnected:a}=(0,T.v)(),c=(0,o.md)(k.b9),l=!((0,S.HK)()&&a&&c),u=(0,i.useRef)(null),d=(0,i.useRef)(null),m=(0,o.Xr)(_.e0),[f,p]=(0,i.useState)(!1);(0,i.useEffect)((()=>{const e=d.current;if(!e||l)return void m(0);const t=()=>m(Math.ceil(e.getBoundingClientRect().height));t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}),[l,m]);const h=(0,i.useCallback)((()=>!!u.current&&Math.floor(u.current.scrollHeight)>Math.ceil(u.current.scrollTop+u.current.clientHeight)),[]),x=(0,i.useCallback)((()=>{p(h())}),[h]);return(0,i.useEffect)((()=>{const{current:e}=u,t=()=>{p(h())};return t(),e?.addEventListener("resize",t),()=>e?.removeEventListener("resize",t)}),[h,l]),(0,L.jsxs)("div",{ref:t,className:"relative flex h-full flex-col items-start justify-start rounded-[4px]",children:[(0,L.jsxs)("div",{ref:u,className:"scrollbar-hide w-full cursor-auto overflow-auto "+(l?"min-h-0 flex-1":"h-full"),onScroll:x,children:[(0,L.jsx)("div",{ref:d,className:l?void 0:"pb-3",children:e.children}),l?s?!r&&(0,L.jsx)(C.A,{className:"border-t-ds-color-border-subtle border-solid border-0 border-t mt-4"}):(0,L.jsx)(R.A,{className:"border-t-ds-color-border-subtle border-solid border-0 border-t mt-4"}):null]}),f&&n&&l?(0,L.jsx)("div",{className:"pointer-events-none absolute bottom-[1px] z-[1] flex h-10 w-full cursor-pointer items-center justify-start",style:{backgroundImage:"linear-gradient(to top, var(--background-base) 40%, transparent)"}}):null]})}));G.displayName="Order";const J=(0,L.jsx)("div",{className:"flex h-screen w-full items-center justify-center",children:(0,L.jsx)(E.default,{})}),X=a().forwardRef(((e,t)=>(0,L.jsx)(O.s,{fallback:J,children:(0,L.jsx)(G,{...e,ref:t})})));X.displayName="OrderWithBoundary";const ee=X,te=a().forwardRef(((e,t)=>(0,L.jsx)("div",{ref:t,className:"h-full",children:e.children})));te.displayName="Position";const ne=(0,O.X)(te),se=(0,I.A)({resolved:{},chunkName:()=>"components-TradingView",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>Promise.all([n.e(30964),n.e(17099),n.e(43531),n.e(10091),n.e(17508),n.e(62593),n.e(75488),n.e(93942),n.e(92336),n.e(56241),n.e(37255),n.e(68378),n.e(39120)]).then(n.bind(n,82623)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>82623},{ssr:!1,loading:!0}),re=(0,I.A)({resolved:{},chunkName:()=>"components-Depth",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>n.e(27043).then(n.bind(n,28871)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>28871},{ssr:!1,loading:!0}),oe=(0,I.A)({resolved:{},chunkName:()=>"components-DexPositionAndList",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>Promise.all([n.e(30964),n.e(17099),n.e(43531),n.e(28809),n.e(17508),n.e(62593),n.e(75488),n.e(93942),n.e(92336),n.e(99052),n.e(95793),n.e(71361)]).then(n.bind(n,89196)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>89196},{ssr:!1,loading:!0}),ie=(0,I.A)({resolved:{},chunkName:()=>"components-SelectedCoin",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>n.e(61236).then(n.bind(n,95711)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>95711},{ssr:!1,loading:!1}),ae=(0,I.A)({resolved:{},chunkName:()=>"components-TradeMarket",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>Promise.all([n.e(30964),n.e(17099),n.e(11972),n.e(17686)]).then(n.bind(n,91510)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>91510},{ssr:!1,loading:!1}),ce=(0,I.A)({resolved:{},chunkName:()=>"components-SymbolStatusBanner",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>n.e(14592).then(n.bind(n,83)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return n(t)},resolve:()=>83},{ssr:!1,loading:!1}),le=(0,c.WidthProvider)(c.Responsive),ue=e=>{const{orderPlace:t}=e,[n]=(0,o.fp)(f.jQ),[s,a]=(0,o.fp)(_.SH),c=(0,o.md)(h.T0),[j,I]=(0,o.fp)(_.EI),R=(0,o.md)(_.OB),C=(0,o.md)(_.i),P=(0,o.md)(h.uw),M=w(),O=N(),{isConnected:E}=(0,T.v)(),U=(0,o.md)(k.b9),D=(0,o.md)(y.__),z=(0,o.md)(_.e0),B=(0,o.md)(y.rW),q=(0,S.HK)()&&E&&U,H=(0,i.useMemo)((()=>q&&D&&B?(0,x.Tz)(B):0),[q,D,B]),Z=(0,b.B)()===g.M.SPOT,W=(0,o.md)(A.un),Y=(0,o.md)(A.QQ),Q=Z?W:Y,G=!!Q&&("Trading"!==Q.status&&"PreTrading"!==Q.status||!!Q.delistTime),[J,X]=(0,i.useState)(null),te=(0,i.useRef)(null);(0,i.useEffect)((()=>{const e=te.current;if(!e||!G)return void X(null);const t=()=>{const t=e.getBoundingClientRect().height,n=Math.round((t-16)/16);X((()=>n+.4))};requestAnimationFrame(t);const n=new ResizeObserver((()=>t()));return n.observe(e),()=>n.disconnect()}),[G]),(0,i.useEffect)((()=>{(!j||s||!Object.values(j).some((e=>e.length>0&&e.some((e=>
1e.i===d.N.ContractSymbolStatusBanner)))))&&(a(!1),(0,x.b7)(),I((0,v.kK)({layoutDirection:R})))}),[s,j,I,a,c,R]);const ue=(0,i.useRef)(),de=(0,i.useRef)(),me=(0,i.useRef)(null),fe=(0,o.md)(p.OH),[pe,_e]=(0,i.useState)(!0),he=(0,i.useRef)(),xe=(0,i.useRef)(1e4);(0,i.useEffect)((()=>{const e=()=>{if(xe.current<=0)return _e(!1),he.current&&clearTimeout(he.current);xe.current=xe.current-1e3,he.current=window.setTimeout((()=>{e()}),1e3)};return fe?(_e(!0),xe.current=1e4):e(),()=>{he.current&&clearTimeout(he.current)}}),[fe]);const ye=(0,i.useMemo)((()=>[{key:d.N.ContractHotList,component:(0,L.jsx)(ie,{})},{key:d.N.ContractSymbolDetail,component:(0,L.jsx)(ae,{})},{key:d.N.ContractSymbolStatusBanner,component:(0,L.jsx)(ce,{})},{key:d.N.ContractDepthAndHistory,component:(0,L.jsx)($,{ref:ue,children:(0,L.jsx)("div",{className:"h-full text-white",children:(0,L.jsx)(re,{})})})},{key:d.N.ContractKline,component:pe?(0,L.jsx)(K,{ref:de,children:(0,L.jsx)("div",{className:"h-full text-white",children:(0,L.jsx)(se,{})})}):(0,L.jsx)("div",{className:"h-full w-full bg-ds-color-background-secondary",children:(0,L.jsx)(l.A,{})})},{key:d.N.ContractPosition,component:(0,L.jsx)(ne,{children:(0,L.jsx)("div",{className:"text-white h-full",children:(0,L.jsx)(oe,{ref:me})})})},{key:d.N.ContractOperationSide,component:(0,L.jsx)(ee,{ref:ue,children:(0,L.jsx)(t,{})})},{key:d.N.ContractMegaPop,independentClass:!0,component:(0,L.jsx)(V,{})},{key:d.N.ContractAssetsInfo,component:(0,L.jsx)(F,{})}]),[t,pe]),Ae=(0,i.useMemo)((()=>{const e=(0,v.cX)();return ye.filter((t=>j?.[e]?.some((e=>{const n=t.key===e.i,s=!1!==e.visible,r=!(t.key===d.N.ContractHotList&&P),o=!(t.key===d.N.ContractMegaPop&&!q),i=!(t.key===d.N.ContractAssetsInfo&&!q);return n&&s&&r&&o&&i}))))}),[ye,j,P,q]),ge=(0,i.useMemo)((()=>Ae.map((e=>{let{component:t,key:n,independentClass:s}=e,o="";C&&(o=n===d.N.ContractKline?"!w-[100vw] !h-[100vh] !fixed !left-0 !top-0 !transform-none z-[100] rounded-none":"hidden");const i=n===d.N.ContractSymbolStatusBanner,a=n===d.N.ContractMegaPop;return(0,L.jsx)("div",{className:r()(o,"drag-wrap group/parent",{"border border-solid border-ds-color-border-subtle rounded-[8px] overflow-hidden bg-ds-color-background-secondary":!i&&!s,"!h-auto [&_.resize-handle]:hidden":i,"[&_.resize-handle]:hidden":a,"z-[1]":n===d.N.ContractPosition&&O}),children:i?(0,L.jsx)("div",{ref:te,className:"w-full",children:t}):(0,L.jsx)("div",{className:" h-full w-full",children:t})},n)}))),[C,O,Ae]),be=(0,i.useMemo)((()=>!q||z<=0?0:(0,v.$H)(z+2)),[q,z]),ve=(0,i.useMemo)((()=>{const e={};for(const t in j){const n=t,s=j[n],r=s.find((e=>e.i===d.N.ContractSymbolStatusBanner))?.h??0,o=G?null!=J&&J>0?J:r:0,i=o-r,a=s.filter((e=>{const t=!(e.i===d.N.ContractHotList&&P);return e.visible&&t})).map((e=>e.i===d.N.ContractSymbolStatusBanner?{...e,h:o}:0!==i&&e.i===d.N.ContractKline?{...e,h:e.h-i}:e.i===d.N.ContractMegaPop?{...e,isResizable:!1}:e));if(!q){e[n]=(0,x.d6)(a);continue}const c=D?(0,x.TZ)((0,x.CG)(a),H):(0,x.yy)(a);e[n]=be>0?(0,x.MO)(c,be):c}return e}),[j,P,G,J,q,D,H,be]);(0,i.useEffect)((()=>{ue.current?.resize?.(),me.current?.resize?.()}),[q,D]);const je=(0,m.d)({activeFn:(e,t)=>{const n={};for(const e in j){const s=e,r=j[s],o=t[s]??[];n[s]=r.map((e=>{const t=o.find((t=>t.i===e.i));return e.i===d.N.ContractMegaPop||e.i===d.N.ContractOperationSide||e.i===d.N.ContractAssetsInfo?e:t?{...t,visible:e.visible}:e}))}JSON.stringify(n)!==JSON.stringify(j)&&((0,x.Q)(n),I(n),ue.current&&ue.current.resize?.(),me.current&&me.current.resize?.())},waitTime:500,deps:[j,x.Q,ue,de,me,q,D]}),Ne=()=>{const e=document.querySelector(".trading-view-recover");e&&e.classList.remove("hidden");const t=document.querySelector("#root");t&&(t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.msUserSelect="none",t.style.MozUserSelect="none")},we=()=>{const e=document.querySelector(".trading-view-recover");e&&(e.classList.contains("hidden")||e.classList.add("hidden"));const t=document.querySelector("#root");t&&(t.style.userSelect="",t.style.webkitUserSelect="",t.style.msUserSelect="",t.style.MozUserSelect="")},[Te,ke]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{ke(!0)}),[]),(0,L.jsx)(le,{layouts:ve,breakpoints:v.bM,cols:v.sW,autoSize:!0,measureBeforeMount:!1,className:r()(Te?"":"invisible","[&_.react-grid-item]:duration-[0s] [&_.react-grid-item]:transition-custom layout bg-ds-color-background-primary",n===u.CV.DARK?"[&_div.react-grid-placeholder]:!bg-[rgba(255,255,255,0.2)]":"[&_div.react-grid-placeholder]:!bg-[rgba(0,0,0,0.2)]"),rowHeight:16,margin:[4,4],useCSSTransforms:!1,resizeHandle:(0,L.jsx)("div",{className:r()("resize-handle opacity-0",{"group-hover/parent:opacity-100":!M})}),draggableHandle:".draggableHandleClass",draggableCancel:".draggableCancelClass",onLayoutChange:je,isDraggable:!M,isResizable:!M,onDragStart:Ne,onDragStop:we,onResizeStart:Ne,onResizeStop:we,children:ge})},de=e=>{let{orderPlace:t,delistNotice:n}=e;return(0,L.jsxs)("div",{className:"w-full h-full",children:[n?(0,L.jsx)(n,{}):null,(0,L.jsx)(ue,{orderPlace:t})]})}},91773(e,t,n){"use strict";var s=n(57816),r=n(69584),o=n(91787),i=n(49626);const a=(0,s.eU)(),c=(0,s.eU)([]),l=((0,s.eU)([]),(0,s.eU)(1)),u=(0,s.eU)([]),d=(0,s.eU)([]),m=(0,s.eU)((async()=>{const e=await(0,r.Hb)();if((0,o.oJ)(e?.code)&&e.data)return e.data;throw e.msg})),f=((0,s.eU)([]),(0,s.eU)({}),(0,s.eU)(!1)),p=(0,s.eU)(i.v.Connecting);let _=function(e){return e[e.NOMALUSER=1]="NOMALUSER",e[e.APIUSER=2]="APIUSER",e}({});const h={1:{spotLever:10,contractLever:20},2:{spotLever:3,contractLever:10}},x=(0,s.eU)(_.NOMALUSER),y=(0,s.eU)(h);n.d(t,["I_",0,c,"J9",0,a,"OH",0,l,"TP",0,d,"Tj",0,f,"ZG",0,x,"cg",0,y,"ci",0,u,"eM",0,h,"qw",0,p,"vd",0,m])},6930(e,t,n){"use strict";var s=n(57816),r=n(80435);const o=(0,s.eU)([]),i=((0,r.y3)("key"),(0,s.eU)([])),a=((0,r.y3)("key"),(0,s.eU)("0.00")),c=(0,s.eU)(null),l=(0,s.eU)({});(0,s.eU)(!1),(0,s.eU)(!1);n.d(t,["Bq",0,o,"Sg",0,c,"__",0,i,"ip",0,l,"vC",0,a])},49626(e,t,n){"use strict";n.d(t,{v:()=>s});let s=function(e){return e.Connected="connected",e.Disconnected="disconnected",e.Connecting="connecting",e}({})},69943(e,t,n){"use strict";var s=n(57816);const r=(0,s.eU)(null),o=(0,s.eU)(null),i=(0,s.eU)(!1),a=(0,s.eU)(0);n.d(t,["MF",0,o,"__",0,i,"jT",0,r,"rW",0,a])}
1,16191(e,t,n){"use strict";var s=n(57816),r=n(98775);n(34996);const o=(0,s.eU)(function(){const e=r.Ay.get(r.eT.UNIT);return"string"==typeof e?e.toUpperCase():"USD"}()),i=(0,s.eU)((e=>e(o)),((e,t,n)=>{n=n.toUpperCase();try{r.Ay.set(r.eT.UNIT,n),t(o,n)}catch(e){}})),a={rates:{},country:{},supported:[]},c=(0,s.eU)(a),l=(0,s.eU)((e=>e(c)),((e,t,n)=>{t(c,n)})),u=(0,s.eU)((e=>{const t=e(l);return t?.supported||[]})),d=((0,s.eU)((e=>{const t=e(l);return t?.country||{}})),(0,s.eU)((e=>{const t=e(l);return t?.rates||{}}))),m=(0,s.eU)((e=>{const t=e(i),n=e(u);return n.find((e=>e?.name?.toUpperCase()===t))?.symbol||""})),f=(0,s.eU)((e=>{const t=e(i),n=e(u);return n.find((e=>e?.name?.toUpperCase()===t))?.name||""})),p=(0,s.eU)((e=>{const t=e(i),n=e(u),s=e(d),r=n.find((e=>e?.name?.toUpperCase()===t))?.value||"";return r in s?s[r]:"1"}));(0,s.eU)(!1);n.d(t,["$o",0,a,"Hk",0,l,"Il",0,f,"Jx",0,d,"Tj",0,p,"lU",0,i,"tv",0,m])},36341(e,t,n){"use strict";var s=n(41594),r=n(51831);const o=()=>{const[e,t]=(0,s.useState)((0,r.cX)()),n=(0,s.useCallback)((()=>{t((0,r.cX)())}),[]);return(0,s.useEffect)((()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n))),[n]),e};n.d(t,["A",0,o])},93599(e,t,n){"use strict";n.d(t,{by:()=>l,gC:()=>c});var s=n(52867),r=n(22317),o=n(88430),i=n(9270),a=n(44198);function c(e){const t=e.toExponential().match(/\d(?:\.(\d*))?e([+-]\d+)/)||[];return e.toFixed(Math.max(0,(t[1]||"").length-+t[2]))}function l(e){if(!e)return"0";try{const t=parseFloat(e);return isNaN(t)?e:c(t)}catch{return"/"}}n.d(t,["g_",0,e=>{let{number:t=0,symbol:n="",place:r=4,direction:o,type:c="crypto"}=e;return("crypto"===c?a.C8:a.Yl)((0,i.zJ)((e=>{let{number:t,round:n=s.A.rounding,decimal:r=8}=e;const o=Number(t);return!isNaN(o)&&isFinite(o)||(t=0),0===t?"0.00":new s.A(t).toFixed(r,n)})({number:t,decimal:r,round:o})),n)},"tp",0,e=>{try{if((0,o.A)(e)||(0,r.A)(e))return"--";if(new s.A(e||0).isZero())return"0.00";{const t=String(e);return(0,i.zJ)(l(t))}}catch{return e}}])},54586(e,t,n){"use strict";e.exports=n.p+"media/b1af75e5b6d7b14e7ba8.png"}
1,87305(e,t,n){"use strict";e.exports=n.p+"media/531de39de8e4bb7f427a.webp"}}]); 2//# sourceMappingURL=4258.8d04b22f7d8a093371d3.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.