1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4759],{2219:(e,t,l)=>{"use strict";e.exports=l.p+"static/media/ic_voucher_contract_bg.3556352b.svg"},4555:(e,t,l)=>{"use strict";l.d(t,{Su:()=>b,Zn:()=>h,zi:()=>g});var a=l(13048);l(69760);var r=l(83066),s=l(50029),n=l(23246),i=l(30481),o=l(70140),c=l(98503),d=l(41886),x=l(53208),m=l(57454),u=l(44168).Buffer;let p=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t})),f=e=>{let t={...e},l=(e=>"number"==typeof e?e:"bigint"==typeof e||"string"==typeof e&&e?Number(e):void 0)(t.type),a=void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas,r=void 0!==t.gasPrice;return a?(delete t.gasPrice,1===l&&(t.type=2)):(1===l&&!r&&(delete t.type,(e=>Array.isArray(e)&&0===e.length)(t.accessList)&&delete t.accessList),0===l&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.accessList),2===l&&delete t.gasPrice),p(t)},h=async(e,t)=>{let l=a.VersionedTransaction.deserialize(u.from(e,"base64"));if(!t)return void(0,d.P0)("error",(0,i.t)("home.sign_not_available"),d.KW);try{let e=await (0,o.Ml)({chain:"solana"});e&&e.blockhash&&(l.message.recentBlockhash=e.blockhash)}catch(e){console.log(e)}return btoa(String.fromCharCode(...(await t(l)).serialize()))},g=async(e,t,l)=>{if(!t||!l)return void(0,d.P0)("error",(0,i.t)("home.sign_not_available"),d.KW);let a=function(e,t){let l=e;if("string"==typeof e){let t=e.trim();t.startsWith("0x")?l=r.Z.from(e):t.startsWith("{")&&(l=JSON.parse(e))}return l instanceof r.Z?(console.log("buildEvmTransactionParams",l),f(p({from:t,to:l.to||void 0,data:l.data,value:l.value,chainId:l.chainId,nonce:l.nonce,gasLimit:l.gasLimit,gasPrice:l.gasPrice,maxFeePerGas:l.maxFeePerGas,maxPriorityFeePerGas:l.maxPriorityFeePerGas,accessList:l.accessList,type:l.type}))):"object"==typeof l&&null!==l?f({from:t,...l}):f(l)}(e,l),o=a instanceof r.Z?Number(a.chainId):void 0,c=new s.k(t,o),x=new n.cP(c,l);return(await x.sendTransaction(a)).hash},b=async e=>{if(!m.kH.getState().isLogined)return;(0,c.$s)(c.P_),(0,m.wm)(e);let t=x.U.getState().appKit;try{await (0,o.xu)(),(0,m.AX)(),null==t||t.disconnect(),(0,m.ri)()}catch(e){console.error("Logout failed:",e),(0,m.AX)(),null==t||t.disconnect(),(0,m.ri)()}}},6560:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a=l(80069),r=l(66693),s=l(20801);let n=l.p+"static/media/ic_token_default.9222699e.svg",i=e=>{let{image:t,className:l,width:i,height:o}=e,[c,d]=s.useState(!0),[x,m]=s.useState(!1);return(0,a.jsxs)("div",{className:"".concat(l," relative }"),children:[t&&!x&&(0,a.jsx)(r.default,{className:"".concat(l),src:t,width:i,height:o,onLoad:()=>d(!1),onError:()=>m(!0),alt:""}),(!t||c||x)&&(0,a.jsx)("div",{className:"".concat(l," absolute top-0 flex items-center justify-center"),children:(0,a.jsx)("img",{src:n,className:"".concat(l),alt:""})})]})}},16031:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a,r,s,n=l(20801);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let o=function(e){return n.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),a||(a=n.createElement("path",{fill:"#0B0E11",d:"M0 9a9 9 0 1 0 18 0A9 9 0 0 0 0 9"})),r||(r=n.createElement("g",{clipPath:"url(#ic_mini_bsc_svg__a)"},n.createElement("path",{fill:"#F0B90B",d:"M6.124 5.185 9.02 3.5l2.895 1.685-1.065.622-1.83-1.062-1.83 1.062zm5.79 2.125-1.065-.623L9.02 7.75l-1.83-1.063-1.065.623v1.245l1.83 1.062v2.125l1.065.622 1.064-.622V9.617l1.83-1.062zm0 3.37V9.435l-1.065.622v1.245zm.755.44-1.83 1.062v1.245l2.894-1.685v-3.37l-1.064.623zm-1.064-4.873 1.064.623v1.245l1.064-.623V6.247l-1.064-.622zm-3.65 6.386v1.245l1.064.622 1.064-.622v-1.245l-1.064.622zm-1.83-1.953 1.064.622v-1.245l-1.065-.622zm1.83-4.433 1.064.623 1.064-.623-1.064-.622zm-2.586.623 1.064-.623-1.064-.622-1.064.622v1.245l1.064.623zm0 2.125-1.064-.623v3.37l2.894 1.685v-1.245L5.37 11.12z"}))),s||(s=n.createElement("defs",null,n.createElement("clipPath",{id:"ic_mini_bsc_svg__a"},n.createElement("path",{fill:"#fff",d:"M3.5 3.5h11v11h-11z"})))))}},18184:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(80069),r=l(81983),s=l(20801);function n(e){let{trigger:t,children:l,className:n}
1=e,[i,o]=(0,s.useState)(!1),c=(0,s.useRef)(null),d=(0,s.useRef)(null),x=(0,s.useRef)(null);return(0,a.jsxs)("div",{ref:d,className:"w-full relative inline-block ".concat(n),children:[(0,a.jsx)("div",{ref:x,className:"w-full flex items-center cursor-pointer",onClick:e=>{var t,l;i?(null==(t=c.current)||t.hide(),o(!1)):(null==(l=c.current)||l.show(e,d.current),o(!0))},children:t}),(0,a.jsx)(r.j,{ref:c,className:"!bg-transparent !mt-0",style:{visibility:"hidden"},dismissable:!0,onHide:()=>o(!1),onShow:()=>{var e;let t=x.current,l=null==(e=c.current)?void 0:e.getElement();t&&l&&(l.style.visibility="hidden",requestAnimationFrame(()=>{l.style.left="0px",l.style.top="60px",l.style.visibility="visible"}))},children:l(()=>{var e;null==(e=c.current)||e.hide(),o(!1)})})]})}},22505:(e,t,l)=>{"use strict";e.exports=l.p+"static/media/ic_btn_loading.2b3843e4.svg"},23682:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var a=l(80069),r=l(99065),s=l(20801),n=l(66926),i=l(81999),o=l(72146),c=l(98503),d=l(57454),x=l(76273),m=l(35500),u=l(34733);let p=e=>{let{value:t,fromDialog:l,selectSegment:p,leverage:f,price:h,spread:g,tokenDecimal:b,estimatedProfitAndLossValue:v,marginMode:w,onChange:j}=e,{t:N}=(0,n.Bd)(),_=(0,d.kH)(e=>e.language),[k,y]=(0,s.useState)(t?String(t):""),[E,A]=(0,s.useState)(t),[C,S]=(0,s.useState)(""),D=(0,s.useRef)(!1),[P,M]=(0,s.use
1State)(""),O=(0,s.useRef)(null),R="cross"===w,L=(0,m.hw)(k,_),F=e=>{if(D.current)return;if(""===h||""===e){S(""),j("");return}let t=(0,m.j8)(e,2);if(0===t){S(""),j("0");return}let l=(0,m.j8)(h,b),a=Number(g)||0,r=t/f/100,s=0===p?l*(1-r)+a:l*(1+r)-a,n=(0,u.hE)(s,b,!1);O.current=(0,x.sX)(s,n),S(n),s<=0||!R&&t>100||t<=0?j("-1"):j(t.toString())},B=e=>{if(!D.current)return;if(""===h||""===e){A(0),y(""),j("");return}let t=Number(e);if(0===t){A(0),y("0"),j("0");return}let l=(0,m.j8)(h,b),a=Number(g)||0,r=(0===p?1-(t-a)/l:(t+a)/l-1)*f*100,s=Number.isInteger(r)?r.toString():r.toFixed(2);A(Number(s=I(s))),y(s),t<=0||!R&&Number(s)>100||0>=Number(s)?j("-1"):j(s)},I=e=>e.replace(/\.?0+$/,"");return(0,s.useEffect)(()=>{D.current?B(C):F(k)},[p,f,h,w]),(0,s.useEffect)(()=>{if(""===h||""===k)return void M((0,u.hE)(0));let e=Number(k);if(0===e||""===v)return void M((0,u.hE)(0));let t=(0,x.ez)(e,(0,x.BP)(v.replaceAll(",",""),100));M((0,u.hE)(t))},[k,v]),(0,a.jsxs)("div",{className:"text-text-light text-xs flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["".concat(N("trade.estimated_loss",{loss:P})),(0,a.jsx)(i.A,{className:"profit-panel-tip"}),(0,a.jsx)(r.m,{target:".profit-panel-tip",position:"top",content:N("trade.profit_loss_panel_tip"),pt:{root:{className:"w-[200px]"}}})]}),(0,a.jsxs)("div",{className:"flex flex-row mt-3 gap-2",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-2 ".concat(l?"bg-voucher-progress-bg-color":"bg-trade-input-background"," border ").concat(C&&0>=Number(C)||!R&&E>100||E<0?"border-[#E43C5A]":"border-border-color"," rounded-[8px] items-center justify-between px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border"),children:[(0,a.jsx)("label",{htmlFor:"limitPriceLossInput",className:"text-text-light text-xs shrink select-none cursor-text",children:N("trade.limit_price_loss_price_input_placeholder")}),(0,a.jsx)("div",{className:"flex flex-1 h-9 items-center",children:(0,a.jsx)(o.A,{id:"limitPriceProfitInput",className:"flex-1 w-full h-9 min-w-0 text-sm font-medium ".concat(""!==k&&(!R&&E>100||E<0)?"text-[#E43C5A]":"text-text-dark"," text-right mr-1 transfer"),value:C,onChange:e=>{S(e),B(e)},decimalScale:b,maxLength:12,onFocus:()=>void(D.current=!0)})})]}),(0,a.jsx)("div",{className:"mb-2 flex flex-1 ".concat(l?"bg-voucher-progress-bg-color":"bg-trade-input-background"," border ").concat(C&&0>=Number(C)||!R&&E>100||E<0?"border-[#E43C5A]":"border-border-color"," rounded-[8px] items-center justify-between px-2.5 input-wrapper"),children:(0,a.jsx)("div",{className:"flex flex-1 h-9 items-center",children:(0,a.jsx)("input",{className:"flex-1 w-full h-9 min-w-0 text-sm font-medium ".concat(""!==k&&(C&&0>=Number(C)||!R&&E>100||E<0)?"text-[#E43C5A]":"text-text-dark"," text-left ml-1 transfer caret-text-dark placeholder:!text-text-light placeholder:!font-normal"),type:"text",placeholder:N("trade.loss_percent_placeholder"),value:0!==E?L:"",onKeyDown:e=>{var t;let l=e.target,a=null!=(t=l.selectionStart)?t:0;"Backspace"===e.key&&a===L.length&&(e.preventDefault(),requestAnimationFrame(()=>{let e=L.length-1;l.setSelectionRange(e,e)}))},onBeforeInput:e=>{var t;let l=e.target,a=null!=(t=l.selectionStart)?t:0;if(!(l.value.length>=11)&&a>L.length-1){e.preventDefault();let t=L.slice(0,-1),a=(0,m.gd)(t+e.data,_);A(Number(a||0)),y(a),F(a),requestAnimationFrame(()=>{let e=Math.max(0,(0,m.hw)(a,_).length-1);l.setSelectionRange(e,e)})}},onChange:e=>{if(e.target.value.length>=11)return;let t=(0,m.gd)(e.target.value,_);if(""===t){A(0),y(""),F("");return}A(Number(t)),y(t),F(t)},onFocus:()=>void(D.current=!1)})})})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:[10,30,50,70,0].map(e=>(0,a.jsx)("div",{className:"flex-1 flex ".concat(l?"h-8":"h-6.5"," rounded-md items-center justify-center input-wrapper cursor-pointer ").concat(E===e?"text-[#E43C5A] bg-[#E43C5A26] font-[600]":l?"text-text-light bg-voucher-progress-bg-color h-8":"text-text-light bg-trade-input-background h-6.5"),onClick:()=>(e=>{D.current=!1,A(e),y(String(e)),F(String(e)),(0,c.$s)(c.Wx,(0,u.Pj)(e))})(e),children:(0,a.jsx)("span",{className:"text-[13px] ",children:0!==e?"".concat(e,"%"):N("trade.none")})},e))}),(0,a.jsxs)("div",{className:"flex flex-row justify-end text-[#E43C5A] text-xs mt-3",children:[""!==k&&E<0&&(0,a.jsx)(a.Fragment,{children:"".concat(0===p?N("trade.sl_price_below_entry_price"):N("trade.tp_price_above_entry_price"))}),!R&&""!==k&&E>100&&(0,a.jsx)(a.Fragment,{children:N("trade.sl_max_200")}),R&&C&&0>=Number(C)&&(0,a.jsx)(a.Fragment,{children:N("trade.sl_price_above_zero")})]})]})}},24683:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var a,r,s,n,i=l(20801);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let c=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),a||(a=i.createElement("circle",{cx:9,cy:9,r:9,fill:"#000"})),i.createElement("g",{clipPath:"url(#ic_mini_solana_svg__a)"},i.createElement("mask",{id:"ic_mini_solana_svg__b",width:12,height:10,x:3,y:4,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},r||(r=i.createElement("path",{fill:"#fff",d:"M14.4 4.176H3.601v8.98h10.797z"}))),s||(s=i.createElement("g",{mask:"url(#ic_mini_solana_svg__b)"},i.createElement("path",{fill:"url(#ic_mini_solana_svg__c)",d:"m14.344 11.256-1.783 1.777a.42.42 0 0 1-.303.123h-8.45q-.062 0-.113-.032a.2.2 0 0 1-.076-.084.18.18 0 0 1 .038-.208l1.784-1.777a.42.42 0 0 1 .302-.123h8.45q.061 0 .113.032.05.032.076.084a.2.2 0 0 1 .014.11.2.2 0 0 1-.053.098m-1.783-3.58a.42.42 0 0 0-.303-.122h-8.45q-.062 0-.113.031a.2.2 0 0 0-.076.085.18.18 0 0 0 .038.208l1.784 1.777q.059.06.137.09a.4.4 0 0 0 .165.033h8.45q.061 0 .113-.032.05-.031.076-.084a.2.2 0 0 0 .014-.11.2.2 0 0 0-.053-.098zM3.808 6.4h8.45a.44.44 0 0 0 .303-.122L14.344 4.5a.2.2 0 0 0 .052-.098.2.2 0 0 0-.014-.11.2.2 0 0 0-.076-.084.2.2 0 0 0-.114-.031h-8.45a.44.44 0 0 0-.301.122L3.658 6.076a.18.18 0 0 0-.039.208.2.2 0 0 0 .076.084q.052.03.113.031"})))),n||(n=i.createElement("defs",null,i.createElement("linearGradient",{id:"ic_mini_solana_svg__c",x1:4.513,x2:12.661,y1:13.37,y2:3.493,gradientUnits:"userSpaceOnUse"},i.createElement("stop",{offset:.08,stopColor:"#9945FF"}),i.createElement("stop",{offset:.3,stopColor:"#8752F3"}),i.createElement("stop",{offset:.5,stopColor:"#5497D5"}),i.createElement("stop",{offset:.6,stopColor:"#43B4CA"}),i.createElement("stop",{offset:.72,stopColor:"#28E0B9"}),i.createElement("stop",{offset:.97,stopColor:"#19FB9B"})),i.createElement("clipPath",{id:"ic_mini_solana_svg__a"},i.createElement("path",{fill:"#fff",d:"M3.602 4.176h10.8v9h-10.8z"})))))}},28852:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a,r,s=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let i=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),a||(a=s.createElement("path",{fill:"#EA941D",d:"M10.6 6A4.6 4.6 0 1 1 6 1.4V0a6 6 0 1 0 0 12A6 6 0 0 0 6 0v1.4A4.6 4.6 0 0 1 10.6 6"})),r||(r=s.createElement("path",{fill:"#EA941D",fillRule:"evenodd",d:"M6 8.25a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5m0-6a.75.75 0 0 0-.75.75v3.75a.75.75 0 0 0 1.5 0V3A.75.75 0 0 0 6 2.25",clipRule:"evenodd"})))}},30061:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a,r=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let n=function(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:8,height:8,fill:"none"},e),a||(a=r.createElement("path",{d:"M1.138.195a.667.667 0 1 0-.943.943L3.057 4 .195 6.862a.667.667 0 0 0 .943.943L4 4.943l2.862 2.862a.667.667 0 1 0 .943-.943L4.943 4l2.862-2.862a.667.667 0 1 0-.943-.943L4 3.057z"})))}},33291:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a,r=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let n=function(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),a||(a=r.createElement("path",{stroke:"#6C757D",strokeLinecap:"round",strokeOpacity:.8,strokeWidth:2,d:"M17 17 7 7m10 0L7 17"})))}},34202:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(80069);l(20801);let r=l.p+"static/media/ic_empty_data.3b2c1464.svg";var s=l(34733);let n=e=>{let{className:t,text:l}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex flex-col items-center justify-center text-text-light text-[13px] gap-3",t),children:[(0,a.jsx)("img",{className:"w-[56px] h-auto",src:r,alt:""}),(0,a.jsx)("span",{className:"text-center",children:l})]})}},41028:(e,t,l)=>{"use strict";l.d(t,{U:()=>i});var a=l(17268),r=l(76273),s=l(35500),n=l(34733);function i(e,t){var l;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,c=(null==t?void 0:t.lotSize)||1,d=null==t?void 0:t.minOrderQuantity,x="number"==typeof(l=e||0)?l:(0,s.A8)(l)||"0",m=new a.A(x);return d&&m.isLessThan(d)?"< ".concat((0,n.HD)((0,r.BP)(d,c),o)):(0,n.HD)((0,r.BP)(x,c),i)}},47805:(e,t,l)=>{"use strict";l.d(t,{D9:()=>u,JH:()=>x,iQ:()=>m,zW:()=>p});var a=l(6558),r=l(41445),s=l(70140),n=l(39580),i=l(57684),o=l(81430),c=l(57454);let d=e=>[...null!=e?e:[]].sort((e,t)=>
1e-t).join(","),x=(0,a.v)()((0,r.Zr)((e,t)=>({configInfo:void 0,setConfigInfo:t=>e({configInfo:t}),requestConfig:async(l,a)=>{var r;let n=null==(r=t().configInfo)?void 0:r.marginMode,i=await (0,s.zj)(l);return i&&e({configInfo:i}),(0,c.W5)()&&(null==a?void 0:a.refreshSymbolMarginModeOnMarginModeChange)&&((e,t)=>(null==e?void 0:e.defaultMarginMode)!==(null==t?void 0:t.defaultMarginMode)||d(null==e?void 0:e.enabledMarginModes)!==d(null==t?void 0:t.enabledMarginModes))(n,null==i?void 0:i.marginMode)&&(0,o.JZ)(),g(),h(),i},getMarginLimitBySymbol:e=>{var l,a;let r=null==(l=t().configInfo)?void 0:l.marginLimit;if(!r)return;let s=null==(a=r.symbolLimits)?void 0:a.find(t=>t.symbol===e);if(s)return s;let{symbolLimits:n,...i}=r;return i},getMaintenanceMarginRatioBySymbol:(e,l)=>{var a,r;let s=null==(a=t().configInfo)?void 0:a.maintenanceMarginRatioByMode;if(!s)return;let n=s["cross"===l?"CROSS":"ISOLATED"];if(n)return null!=(r=n[e])?r:n.DEFAULT},getTokenImageUrlBySymbol:e=>{var l;let a=null==(l=t().configInfo)?void 0:l.tokenList;if(!a)return;let r=a.find(t=>t.symbol===e);if(r)return r.imageUrl;let s=a.find(t=>t.symbol.startsWith("".concat(e,"/")));return null==s?void 0:s.imageUrl},clear:()=>e({configInfo:void 0})}),{name:"config_store",partialize:e=>({configInfo:e.configInfo})})),m=(e,t)=>x.getState().requestConfig(e,t),u=e=>x.getState().getMarginLimitBySymbol(e),p=e=>x.getState().getTokenImageUrlBySymbol(e),f=e=>{if((null==e?void 0:e.key)==="market_config")return void(0,i.tE)();m(void 0,{refreshSymbolMarginModeOnMarginModeChange:!0})},h=()=>{n.z.subscribe("public_config",f)},g=()=>{n.z.unsubscribe("public_config",f)}},53208:(e,t,l)=>{"use strict";l.d(t,{U:()=>s,w:()=>r});var a=l(6558);let r=e=>{s.setState({appKit:e})},s=(0,a.v)(()=>({appKit:void 0}))},55669:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a,r,s=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let i=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),a||(a=s.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,clipPath:"url(#ic_calendar_svg__a)"},s.createElement("path",{d:"M11.999 2.666h-8a2.667 2.667 0 0 0-2.667 2.667v6.666a2.667 2.667 0 0 0 2.667 2.667h8a2.667 2.667 0 0 0 2.666-2.667V5.333A2.667 2.667 0 0 0 12 2.666M5.332 1.334v2.667M10.668 1.334v2.667M1.332 6.666h13.333"}))),r||(r=s.createElement("defs",null,s.createElement("clipPath",{id:"ic_calendar_svg__a"},s.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))}},56006:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var a=l(80069),r=l(20801);function s(e){let{value:t="",maxLength:l=12,placeholder:s="",filter:n,onChange:i,inputClass:o,countClass:c}=e,[d,x]=(0,r.useState)(t),m=(0,r.useRef)(!1),u=(0,r.useRef)(t);(0,r.useEffect)(()=>{x(t),u.current=t},[t]);let p=e=>{!(e.length>l)&&(!n||n(e))&&(u.current=e,x(e),null==i||i(e))};return(0,a.jsxs)("div",{className:"flex w-full h-full items-center",children:[(0,a.jsx)("input",{type:"text",className:o,value:d,placeholder:s,maxLength:l,onChange:e=>{let t=e.target.value;if(m.current)return void x(t);p(t)},onCompositionStart:()=>{m.current=!0},onCompositionEnd:e=>{m.current=!1;let t=e.currentTarget.value;if(n&&!n(t))return void x(u.current);p(t)}}),(0,a.jsxs)("div",{className:c,children:[d.length,"/",l]})]})}},57422:(e,t,l)=>{"use strict";e.exports=l.p+"static/media/ic_voucher_bg.d39fb18f.svg"},57684:(e,t,l)=>{"use strict";l.d(t,{Pg:()=>v,UD:()=>u,tE:()=>g,e0:()=>x});var a=l(6558),r=l(41445),s=l(70140),n=l(34733);let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{let{start:t,end:l}=e;return{start:t,end:l}}).sort((e,t)=>new Date("".concat(e.start,"Z")).getTime()-new Date("".concat(t.start,"Z")).getTime())},o=e=>((e,t)=>e.some(e=>{let l=new Date("".concat(e.start,"Z")).getTime(),a=new Date("".concat(e.end,"Z")).getTime();return t>=l&&t<=a}))(e,(0,n.mI)()),c={},d={},x=(0,a.v)()((0,r.Zr)(e=>({symbolStatusMap:{},setSymbolStatus:(t,l)=>e(e=>({symbolStatusMap:{...e.symbolStatusMap,[t]:l}})),updateShowOffHour:(t,l)=>e(e=>({symbolStatusMap:{...e.symbolStatusMap,[t]:{...e.symbolStatusMap[t],showOffHour:l}}})),updateRestrictionActive:(t,l)=>e(e=>({symbolStatusMap:{...e.symbolStatusMap,[t]:{...e.symbolStatusMap[t],isRestrictionActive:l}}})),clear:()=>{b(),e({symbolStatusMap:{}}
1)}}),{name:"market_hours_store",partialize:e=>({symbolStatusMap:e.symbolStatusMap})})),m=async()=>{try{return await (0,s.jq)()}catch(e){return(0,n.Rm)("[marketHours] first request failed, retrying...",e),await (0,s.jq)()}},u=async()=>{try{let e=await m(),t=(e=>{let t={};return e.forEach(e=>{e.symbols&&0!==e.symbols.length&&e.symbols.forEach(l=>{t[l]=e})}),t})(e),l=x.getState();b(),Object.entries(t).forEach(e=>{let[t,a]=e,r=!1,s=i(a.eventRestrictionRange);a.isExistClosedRange&&a.closedRange.length>0&&(r=a.closedRange.some(e=>(0,n.AM)(e.start,e.end)),a.closedRange.forEach(e=>{p(t,e.start,e.end)})),s.forEach(e=>{p(t,e.start,e.end)}),l.setSymbolStatus(t,{marketClosedDay:a,showOffHour:r,restrictionTimeRanges:s,isRestrictionActive:o(s)})})}catch(e){console.error("Error fetching market closed day:",e)}},p=(e,t,l)=>{let a="".concat(t,"_").concat(l);d[a]||(d[a]=new Set),d[a].add(e),c[a]||(c[a]=setInterval(()=>{let e=x.getState(),t=d[a],l=!1;t.forEach(t=>{var a,r,s,i;let c=e.symbolStatusMap[t],d=null!=(s=null==c||null==(r=c.marketClosedDay)||null==(a=r.closedRange)?void 0:a.some(e=>(0,n.AM)(e.start,e.end)))&&s,x=o(null!=(i=null==c?void 0:c.restrictionTimeRanges)?i:[]);c&&c.showOffHour!==d&&(e.updateShowOffHour(t,d),d||(l=!0)),c&&c.isRestrictionActive!==x&&(e.updateRestrictionActive(t,x),x||(l=!0))}),l&&g()},1e3))},f=!1,h=0,g=async()=>{let e=Date.now();if(!f&&!(e-h<1e3)){f=!0,h=e;try{await u()}finally{f=!1}}},b=()=>{Object.keys(c).forEach(e=>(e=>{c[e]&&(clearInterval(c[e]),delete c[e],delete d[e])})(e))},v=e=>{var t,l;return null!=(l=null==(t=x.getState().symbolStatusMap[e])?void 0:t.showOffHour)&&l}},58475:(e,t,l)=>{"use strict";l.d(t,{V:()=>n});var a=l(6558),r=l(41445),s=l(70140);let n=(0,a.v)()((0,r.Zr)(e=>({symbols:[],setSymbols:t=>e({symbols:t}),requestSymbolList:async()=>{let t=await (0,s.pX)();t&&e({symbols:t})},clearSymbols:()=>e({symbols:[]})}),{name:"symbol-storage"}))},63514:()=>{},71338:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var a,r,s,n,i=l(20801);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let c=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),i.createElement("g",{clipPath:"url(#ic_mini_monad_svg__a)"},i.createElement("mask",{id:"ic_mini_monad_svg__b",width:18,height:18,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},a||(a=i.createElement("path",{fill:"#fff",d:"M18 0H0v18h18z"}))),i.createElement("g",{mask:"url(#ic_mini_monad_svg__b)"},i.createElement("mask",{id:"ic_mini_monad_svg__c",width:18,height:18,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},r||(r=i.createElement("path",{fill:"#fff",d:"M18 0H0v18h18z"}))),s||(s=i.createElement("g",{mask:"url(#ic_mini_monad_svg__c)"},i.createElement("path",{fill:"#6E54FF",d:"M0 9a9 9 0 1 0 18 0A9 9 0 0 0 0 9"}),i.createElement("g",{filter:"url(#ic_mini_monad_svg__d)"},i.createElement("path",{fill:"#fff",d:"M9.005 3.375c-1.626 0-5.63 4-5.63 5.625s4.004 5.625 5.63 5.625 5.63-4 5.63-5.625-4.004-5.625-5.63-5.625m-.877 8.842c-.686-.187-2.53-3.409-2.342-4.094s3.41-2.526 4.096-2.34c.686.187 2.53 3.409 2.343 4.094s-3.412 2.526-4.097 2.34"})))))),n||(n=i.createElement("defs",null,i.createElement("clipPath",{id:"ic_mini_monad_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h18v18H0z"})),i.createElement("filter",{id:"ic_mini_monad_svg__d",width:41.258,height:41.25,x:-11.625,y:3.375,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},i.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),i.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),i.createElement("feOffset",{dy:15}),i.createElement("feGaussianBlur",{stdDeviation:7.5}),i.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),i.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.125 0"}),i.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_13438_5607"}),i.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_13438_5607",result:"shape"})))))}},72103:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a=l(80069),r=l(20801),s=l(81430),n=l(34733);let i=e=>{let{value:t,tabs:l,showNum:i=!1,showPadding:o=!0,showActiveLine:c=!0,showTabLine:d=!0,onChange:x,className:m,tabClassName:u}=e,p=(0,s.WG)(e=>e.positionNum),f=(0,s.WG)(e=>e.openOrderNum),h=(0,r.useRef)([]),g=(0,r.useRef)(null),b=(0,r.useRef)(null),v=(0,r.useRef)(null),w=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=h.current[t];e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[t]),(0,r.useEffect)(()=>{let e=g.current;if(!e)return;let t=e=>{let t=e.touches[0];t&&(b.current={x:t.clientX,y:t.clientY},w.current={x:t.clientX},v.current=null)},l=t=>{let l=b.current,a=t.touches[0];if(!l||!a)return;let r=a.clientX-l.x,s=a.clientY-l.y;if(!v.current){let e=Math.abs(r),t=Math.abs(s);if(e<6&&t<6)return;v.current=e>t?"x":"y"}if("x"===v.current){let l=e.scrollWidth>e.clientWidth,r=w.current;if(l&&r){let l=a.clientX-r.x;e.scrollLeft-=l,w.current={x:a.clientX},t.preventDefault()}}};return e.addEventListener("touchstart",t,{passive:!0}),e.addEventListener("touchmove",l,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",l)}},[]),(0,a.jsx)("div",{ref:g,className:(0,n.cn)("w-full h-[50px] mb-3 ".concat(d?"border-b border-border-color":""," md:border-panel-border-color flex items-center overflow-x-auto scrollbar-none text-text-dark space-x-8 touch-p
1an-y overscroll-x-contain ").concat(o?"px-4":""),u),children:l.map((e,l)=>(0,a.jsxs)("button",{ref:e=>{h.current[l]=e},onClick:()=>{x({index:l})},className:(0,n.cn)("\n h-full\n relative whitespace-nowrap\n transition-colors\n cursor-pointer\n ".concat(t===l?"text-text-dark font-bold":"text-text-light font-medium","\n "),m),children:[i&&0===l?"".concat(e).concat(p>0?"(".concat(p,")"):""):i&&1===l?"".concat(e).concat(f>0?"(".concat(f,")"):""):e,c&&t===l&&(0,a.jsx)("span",{className:"absolute left-1/2 -translate-x-1/2 bottom-0 w-[24px] h-[3px] bg-text-dark rounded-full transition-all"})]},l))})}},72146:(e,t,l)=>{"use strict";l.d(t,{A:()=>x});var a=l(80069),r=l(20801),s=l(57454),n=l(35500),i=l(34733);function o(e,t){if(!e)return"";if("."===e){let{decimal:e}=(0,n.DL)(t);return"0".concat(e)}return(0,n.yU)(e,!0,t)}function c(e,t,l){return(0,n.A8)(e.slice(0,t),l).length}let d=e=>{let{ref:t,value:l="",decimalScale:d=2,maxLength:x,onChange:m,className:u,onFocus:p,inputMode:f,onBlur:h,...g}=e,b=(0,s.kH)(e=>e.language),v=function(e){return!Number.isFinite(e)||e<0?0:Math.floor(e)}(d),w=(0,n.x0)(l,v),[j,N]=(0,r.useState)(w),_=(0,r.useRef)(null),k=(0,r.useRef)(null),y=(0,r.useRef)({start:0,end:0});(0,r.useEffect)(()=>{N(e=>e===w?e:w)},[w]),(0,r.useLayoutEffect)(()=>{if(null===k.current||!_.current)return;let e=k.current;_.current.setSelectionRange(e,e),k.current=null},[j,b]);let E=e=>{N(e),null==m||m(e)},A=(e,t,l)=>{let a=Math.min(null!=l?l:t.length,t.length);e.value=t,e.setSelectionRange(a,a)},C=(e,t,l)=>{var a,r;let s=(0,n.vN)(t,v,b);if("number"==typeof x&&x>=0&&s.length>x)return void(a=y.current.start,A(e,o(j,b),a));let i=o(s,b);if(null!==l){let e=t.slice(0,l);k.current=Math.min(o((0,n.vN)(e,v,b),b).length,i.length),y.current={start:k.current,end:k.current}}if(s===j){A(e,o(j,b),null!=(r=k.current)?r:l),k.current=null;return}E(s)},S=e=>{var t,l;let a=o(j,b),r=null!=(t=e.selectionStart)?t:a.length,s=null!=(l=e.selectionEnd)?l:r;return{start:c(a,r,b),end:c(a,s,b)}};return(0,a.jsx)("input",{...g,ref:e=>{_.current=e,function(e,t){if("function"==typeof e)return e(t);e&&(e.current=t)}(t,e)},type:"text",className:(0,i.cn)(u),inputMode:null!=f?f:v>0?"decimal":"numeric",value:o(j,b),onSelect:e=>{var t,l,a;y.current={start:null!=(l=e.currentTarget.selectionStart)?l:0,end:null!=(a=e.currentTarget.selectionEnd)?a:0},null==(t=g.onSelect)||t.call(g,e)},onKeyDown:e=>{var t;let l=e.currentTarget.selectionStart,a=e.currentTarget.selectionEnd;if(y.current={start:null!=l?l:0,end:null!=a?a:0},null!==l&&null!==a&&("Backspace"===e.key||"Delete"===e.key)&&((e,t,l)=>{if(t!==l)return!1;let a=o(j,b),r="Backspace"===e?t-1:t;if(r<0||!(0,n.$D)(a[r],b))return!1;let s=c(a,t,b),i="Backspace"===e?s-1:s,d=function(e,t){return t<0||t>=e.length?e:"".concat(e.slice(0,t)).concat(e.slice(t+1))}(j,i),x="Backspace"===e?Math.max(i,0):s;return k.current=o(d.slice(0,x),b).length,y.current={start:k.current,end:k.current},E(d),!0})(e.key,l,a))return void e.preventDefault();null==(t=g.onKeyDown)||t.call(g,e)},onBeforeInput:e=>{var t;let l=e.nativeEvent;if((e=>!!e&&1===e.length&&null===(0,n.Dq)(e,b))(l.data)||((e,t)=>{if(!t||1!==t.length||"."!==(0,n.Dq)(t,b))return!1;if(v<=0)return!0;let l=j.indexOf(".");if(-1===l)return!1;let{start:a,end:r}=S(e);return!(a<=l&&l<r)})(e.currentTarget,l.data)||((e,t)=>{if(!t||!/^\d+$/.test(t)||v<=0)return!1;let l=j.indexOf(".");if(-1===l)return!1;let{start:a,end:r}=S(e);if(a<=l)return!1;let s=j.slice(Math.max(a,l+1),r).length;return j.length-l-1-s+t.length>v})(e.currentTarget,l.data))return void e.preventDefault();null==(t=g.onBeforeInput)||t.call(g,e)},onChange:e=>{C(e.currentTarget,e.target.value,e.target.selectionStart)},onCompositionStart:e=>{var t;null==(t=g.onCompositionStart)||t.call(g,e)},onCompositionEnd:e=>{var t;C(e.currentTarget,e.currentTarget.value,e.currentTarget.selectionStart),null==(t=g.onCompositionEnd)||t.call(g,e)},onFocus:()=>p?p():"",onBlur:()=>h?h():""})};d.displayName="NumericInput";let x=d},72542:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a,r=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let n=function(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),a||(a=r.createElement("path",{fill:"currentColor",d:"M6.313 2.863a.494.494 0 0 1 .708 0l1.958 1.993a.515.515 0 0 1 0 .72L4.667 9.965H11c.552 0 1 .456 1 1.017 0 .562-.448 1.018-1 1.018H.5a.505.505 0 0 1-.5-.509V9.497c0-.135.053-.265.146-.36zM8.98.149a.494.494 0 0 1 .707 0l1.96 1.993a.516.516 0 0 1 0 .72l-1.293 1.315a.494.494 0 0 1-.708 0l-1.96-1.993a.516.516 0 0 1 0-.72z"})))}},74649:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a,r,s=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let i=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),a||(a=s.createElement("path",{fill:"currentColor",d:"M3 2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2V4a2 2 0 0 0-2-2z"})),r||(r=s.createElement("path",{fill:"currentColor",d:"M2 3a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h
15a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z"})))}},75555:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var a=l(80069),r=l(99065),s=l(20801),n=l(66926),i=l(81999),o=l(72146),c=l(98503),d=l(57454),x=l(76273),m=l(35500),u=l(34733);let p=e=>{let{value:t,fromDialog:l,selectSegment:p,leverage:f,price:h,spread:g,tokenDecimal:b,estimatedProfitAndLossValue:v,onChange:w}=e,{t:j}=(0,n.Bd)(),N=(0,d.kH)(e=>e.language),[_,k]=(0,s.useState)(t?String(t):""),[y,E]=(0,s.useState)(t),[A,C]=(0,s.useState)(""),S=(0,s.useRef)(!1),[D,P]=(0,s.useState)(""),M=y<0,O=()=>{S.current=!1},R=(0,m.hw)(_,N),L=e=>{if(S.current)return;if(""===h||""===e){C(""),w("");return}let t=(0,m.j8)(e,2);if(0===t){C(""),w("0");return}let l=(0,m.j8)(h,b),a=Number(g)||0,r=t/f/100;C((0,u.hE)(0===p?l*(1+r)+a:l*(1-r)-a,b,!1)),t<=0?w("0"):w(t.toString())},F=e=>{if(!S.current)return;if(""===h||""===e){E(0),k(""),w("");return}let t=Number(e);if(0===t){E(0),k("0"),w("0");return}let l=(0,m.j8)(h,b),a=Number(g)||0,r=(0===p?(t-a)/l-1:1-(t+a)/l)*f*100,s=Number.isInteger(r)?r.toString():r.toFixed(2);E(Number(s=B(s))),k(s),0>=Number(s)?w("0"):w(s)},B=e=>e.replace(/\.?0+$/,"");return(0,s.useEffect)(()=>{S.current?F(A):L(_)},[p,f,h,S]),(0,s.useEffect)(()=>{if(""===_)return void P((0,u.hE)(0));let e=Number(_);if(0===e||""===v)return void P((0,u.hE)(0));let t=(0,x.ez)(e,(0,x.BP)(v.replaceAll(",",""),100));P((0,u.hE)(t))},[_,v]),(0,a.jsxs)("div",{className:"text-text-light text-xs flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["".concat(j("trade.estimated_profit",{profit:D})),(0,a.jsx)(i.A,{className:"profit-panel-tip"}),(0,a.jsx)(r.m,{target:".profit-panel-tip",position:"top",content:j("trade.profit_loss_panel_tip"),pt:{root:{className:"w-[200px]"}}})]}),(0,a.jsxs)("div",{className:"flex flex-row mt-3 gap-2",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-2 ".concat(l?"bg-voucher-progress-bg-color":"bg-trade-input-background"," border ").concat(A&&0>=Number(A)||M?"border-[#E43C5A]":"border-border-color"," rounded-[8px] items-center justify-between px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border"),children:[(0,a.jsx)("label",{htmlFor:"limitPriceProfitInput",className:"text-text-light text-xs shrink select-none cursor-text border-",children:j("trade.limit_price_profit_price_input_placeholder")}),(0,a.jsx)("div",{className:"flex flex-1 h-9 items-center",children:(0,a.jsx)(o.A,{id:"limitPriceProfitInput",className:"flex-1 w-full h-9 min-w-0 text-sm font-medium ".concat(""!==_&&M?"text-[#E43C5A]":"text-text-dark"," text-right mr-1 transfer"),value:A,onChange:e=>{C(e),F(e)},decimalScale:b,maxLength:12,onFocus:()=>void(S.current=!0),onBlur:()=>O()})})]}),(0,a.jsx)("div",{className:"mb-2 flex flex-1 ".concat(l?"bg-voucher-progress-bg-color":"bg-trade-input-background"," border ").concat(M?"border-[#E43C5A]":"border-border-color"," rounded-[8px] items-center justify-between px-2.5 input-wrapper"),children:(0,a.jsx)("div",{className:"flex flex-1 h-9 items-center",children:(0,a.jsx)("input",{className:"flex-1 w-full h-9 min-w-0 text-sm font-medium ".concat(""!==_&&M?"text-[#E43C5A]":"text-text-dark"," text-left ml-1 transfer caret-text-dark placeholder:!text-text-light placeholder:!font-normal"),type:"text",placeholder:j("trade.profit_percent_placeholder"),value:0!==y?R:"",onKeyDown:e=>{var t;let l=e.target,a=null!=(t=l.selectionStart)?t:0;"Backspace"===e.key&&a===R.length&&(e.preventDefault(),requestAnimationFrame(()=>{let e=R.length-1;l.setSelectionRange(e,e)}))},onBeforeInput:e=>{var t;let l=e.target;if((null!=(t=l.selectionStart)?t:0)>R.length-1){e.preventDefault();let t=R.slice(0,-1),a=(0,m.gd)(t+e.data,N);E(Number(a||0)),k(a),L(a),requestAnimationFrame(()=>{let e=Math.max(0,(0,m.hw)(a,N).length-1);l.setSelectionRange(e,e)})}},onChange:e=>{if(e.target.value.length>=11)return;let t=(0,m.gd)(e.target.value,N);if(""===t){E(0),k(""),L("");return}E(Number(t)),k(t),L(t)},onFocus:()=>O()})})})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:[25,50,100,200,0].map(e=>(0,a.jsx)("div",{className:"flex-1 flex ".concat(l?"h-8":"h-6.5"," rounded-md items-center justify-center input-wrapper cursor-pointer ").concat(y===e?"text-[#2ebd85] bg-[#2ebd8526] font-[600]":l?"text-text-light bg-voucher-progress-bg-color":"text-text-light bg-trade-input-background"),onClick:()=>(e=>{S.current=!1,E(e),k(String(e)),L(String(e)),(0,c.$s)(c.j,(0,u.Pj)(e))})(e),children:(0,a.jsx)("span",{className:"text-[13px] ",children:0!==e?"".concat(e,"%"):j("trade.none")})},e))}),(0,a.jsx)("div",{className:"flex flex-row justify-end text-[#E43C5A] text-xs mt-3",children:""!==_&&y<0&&(0,a.jsx)(a.Fragment,{children:"".concat(0===p?j("trade.tp_price_above_entry_price"):j("trade.sl_price_below_entry_price"))})})]})}},76055:(e,t,l)=>{"use strict";l.d(t,{s:()=>rZ});var a,r,s,n,i,o,c,d,x,m,u,p,f,h,g,b,v,w,j,N,_,k,y,E,A,C,S,D,P,M,O,R,L,F,B,I,T,U,z,H,W,V,G,$,q,Q,X,K,Z,J,Y,ee,et,el,ea,er,es,en,ei,eo,ec,ed,ex,em,eu,ep,ef,eh,eg,eb,ev,ew,ej,eN,e_,ek,ey,eE,eA,eC,eS,eD,eP,eM,eO,eR,eL,eF,eB=l(80069),eI=l(79531),eT=l(85087),eU=l(20801),ez=l(66926),eH=l(70140),eW=l(22505),eV=l(4188
16),eG=l(57454);let e$=e=>{let{children:t,className:l}=e;return(0,eB.jsx)("div",{className:"".concat(l),children:t})},eq=()=>{let{t:e}=(0,ez.Bd)(),{hideDialog:t}=rZ(),[l,a]=(0,eU.useState)(""),[r,s]=(0,eU.useState)(!1),[n,i]=(0,eU.useState)(""),o=async()=>{s(!0);try{let a=await (0,eH.sB)({code:l});console.log("handleActive",a),await (0,eG.xJ)(),(0,eV.P0)("success",e("trade.active_code_success"),3e3),t()}catch(e){i(e.message)}finally{s(!1)}};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-[16px] pt-6 w-[calc(100vw-60px)] md:w-[420px] flex flex-col items-center px-5 pb-4",children:[(0,eB.jsx)("div",{className:"flex flex-col items-center justify-center w-full mt-4",children:(0,eB.jsx)("span",{className:"text-base text-text-dark font-medium",children:e("trade.active_code_title")})}),(0,eB.jsx)("div",{className:"w-full flex flex-col h-9.5 rounded-[8px] mt-[14px] bg-dialog-hover-color border border-border-color",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9 min-w-0 text-sm font-medium text-text-dark text-left ml-2.5 transfer placeholder:text-[#808080]",type:"text",placeholder:e("trade.active_code_input_placeholder"),value:l,onChange:e=>{var t;return t=e.target.value,void(i(""),a(t))}})}),(0,eB.jsxs)("div",{className:"w-full flex mt-6 relative gap-2.5",children:[(0,eB.jsx)("div",{className:"w-full flex-1",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-dialog-border-color !border-none !text-text-dark !text-[14px] !py-1.75 !rounded-lg",rounded:!0,label:e("trade.cancel"),onClick:()=>t()})}),(0,eB.jsxs)("div",{className:"w-full flex-1 select-none",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-main-color !border-none !text-white !text-[14px] !py-1.75 !rounded-lg",disabled:!l||0===Number(l)||r,rounded:!0,label:e("trade.active_code_btn_active"),onClick:()=>o()}),r?(0,eB.jsx)("img",{className:"w-4 h-4 circle-progress absolute right-8 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]}),(0,eB.jsx)("div",{className:"flex flex-col w-full mt-4",children:""!==n?(0,eB.jsx)("span",{className:"text-sm text-[#E43C5A]",children:n}):null})]})};var eQ=l(76273);let eX=e=>
1{let{childRate:t,parentRate:l,childRateText:a,minInput:r=0,maxInput:s=20,childRateCallback:n,parentRateCallback:i,inputErrorCallback:o}=e,{t:c}=(0,ez.Bd)(),[d,x]=(0,eU.useState)("".concat(t)),[m,u]=(0,eU.useState)("".concat(l)),p=(0,eU.useRef)(t+l);return(0,eB.jsxs)("div",{className:"flex flex-col border border-border-color md:border-panel-border-color rounded-lg p-4 mt-2 pb-1 ",children:[(0,eB.jsxs)("div",{className:"flex mt-1 gap-2",children:[(0,eB.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark",children:a||c("partner.referee")}),(0,eB.jsxs)("div",{className:"relative flex w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:[(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-4",type:"text",value:d,placeholder:c("partner.split_child_rate_hint",{max:s}),onChange:e=>(e=>{if(""===e){x(e);let t="".concat(p.current);u(t),n(e),i(t);return}if(!/^(?:0|[1-9]\d?)$/.test(e))return;let t=Number(e);if(t<=s){x(e);let l="".concat(p.current-t);u(l),n(e),i(l),o&&(t<r?o(!0):o(!1))}})(e.target.value)}),(0,eB.jsx)("span",{className:"absolute text-text-dark text-sm font-medium right-2.5",children:"%"})]})]}),(0,eB.jsx)("span",{className:"text-xl text-text-dark font-semibold h-9.5 mt-auto leading-9.5",children:"+"}),(0,eB.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark",children:c("partner.my")}),(0,eB.jsxs)("div",{className:"relative flex items-center h-10 w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] cursor-not-allowed px-2.5 input-wrapper",children:[(0,eB.jsx)("span",{className:"flex-1 w-full min-w-0 text-sm text-text-light/30 transfer pr-4",children:m}),(0,eB.jsx)("span",{className:"absolute text-text-light/30 text-sm font-medium right-2.5",children:"%"})]})]}),(0,eB.jsx)("span",{className:"text-xl text-text-dark font-semibold h-9.5 mt-auto leading-9.5",children:"="}),(0,eB.jsxs)("div",{className:"flex flex-col",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark",children:c("partner.total")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold h-9.5 mt-auto leading-9.5",children:"".concat((0,eQ.gF)(t,l),"%")})]})]}),(0,eB.jsx)("span",{className:"text-[#E43C5A] text-xs mt-1.5 ".concat(d?"invisible":"visible"),children:c("partner.please_input_value")})]})};var eK=l(56006),eZ=l(84243),eJ=l(33291),eY=l(34733);let e0=e=>{let{alighn:t="left",className:l,text:a}=e,{hideDialog:r}=rZ();return(0,eB.jsxs)("div",{className:(0,eY.cn)("relative flex flex-row items-center w-full",l),children:[(0,eB.jsx)("span",{className:(0,eY.cn)("text-xl text-text-dark font-semibold","center"===t?"absolute left-8 right-8 text-center":"flex-1 text-left"),children:a}),(0,eB.jsx)("div",{className:"ml-auto cursor-pointer",onClick:()=>r(),children:(0,eB.jsx)(eJ.A,{className:"w-6 h-6"})})]})},e1=e=>{let{type:t,data:l,callback:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s}=rZ(),n=(0,eZ.lu)(e=>e.maxRate),[i,o]=(0,eU.useState)(!1),[c,d]=(0,eU.useState)("".concat((null==l?void 0:l.childCommissionRate)||0)),[x,m]=(0,eU.useState)("".concat((null==l?void 0:l.parentCommissionRate)||n)),[u,p]=(0,eU.useState)((null==l?void 0:l.remark)||""),[f,h]=(0,eU.useState)((null==l?void 0:l.userAccount)||""),[g,b]=(0,eU.useState)(""),[v,w]=(0,eU.useState)(""),[j,N]=(0,eU.useState)(!1);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl py-6 w-screen md:w-[420px] max-h-[85svh] md:h-full flex flex-col items-center px-4 md:px-6",children:[(0,eB.jsx)(e0,{text:r("partner.add_custom")}),(0,eB.jsxs)("div",{className:"w-full flex flex-1 flex-col items-center overflow-y-auto relative",children:[(0,eB.jsxs)("div",{className:"flex w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold whitespace-pre-wrap",children:r("partner.custom_nature")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-normal",children:r("partner.super_agent")})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-8",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.login_account")}
1),(0,eB.jsx)("div",{className:"flex w-full mt-2 min-h-9.5 bg-segment-background border border-segment-background rounded-[8px] items-center",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer px-2 placeholder:!text-text-light placeholder:!text-sm",type:"text",value:f,readOnly:!!l,placeholder:r("partner.input_login_account"),onChange:e=>(e=>{e.length<=60&&h(e),b(""),w("")})(e.target.value)})}),g&&(0,eB.jsx)("span",{className:"text-sm text-[#E43C5A] font-medium mt-2",children:"ï¼ ".concat(g)})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.custom_remark")}),(0,eB.jsx)("div",{className:"flex w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)(eK.A,{value:u,maxLength:12,placeholder:r("partner.enter_note"),inputClass:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-2 placeholder:!text-text-light placeholder:!text-sm",countClass:"text-sm text-text-light",onChange:e=>(e=>e.length<=20&&(p(e),!0))(e)})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsxs)("div",{className:"flex",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.set_rebate_ratio")}),(0,eB.jsx)("span",{className:"text-sm text-main-color font-semibold ml-1",children:"".concat(n,"%")})]}),(0,eB.jsx)(eX,{childRate:Number(c),parentRate:Number(x),childRateText:r("partner.affiliate"),minInput:(null==l?void 0:l.childCommissionRate)||0,maxInput:n,childRateCallback:e=>d(e),parentRateCallback:e=>m(e),inputErrorCallback:e=>{1===t&&N(e)}})]}),(0,eB.jsx)("span",{className:"w-full text-sm font-medium mt-2.5 ".concat(j?"text-[#E43C5A]":"text-text-dark"),children:r("partner.add_custom_hint")}),(0,eB.jsxs)("div",{className:"w-full mt-2 flex flex-col gap-2.5 sticky bottom-0 bg-dialog-background pt-3",children:[(0,eB.jsxs)("div",{className:"w-full flex-1 relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:l?r("trade.save"):r("partner.sure_add"),disabled:i||j,onClick:()=>{if(!f)return void b(r("partner.input_login_account"));o(!0),l?1===t?(0,eH.SD)({id:l.id,userId:l.userId,remark:u,childCommissionRate:c,parentCommissionRate:x}).then(()=>{a(),s()}).finally(()=>{o(!1)}):(0,eH.nU)({id:l.id,userId:l.userId,remark:u,childCommissionRate:c,parentCommissionRate:x}).then(()=>{a(),s()}).finally(()=>{o(!1)}):(0,eH.ij)({userAccount:f,userType:2,remark:u,childCommissionRate:c,parentCommissionRate:x,maxRate:n}).then(()=>{a(),s()}).catch(e=>{switch(e.code){case 7022:w(e.message);break;case 7023:case 7024:b(e.message)}}).finally(()=>{o(!1)})}}),i?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]}),v&&(0,eB.jsx)("span",{className:"text-sm text-[#E43C5A] font-medium mt-2",children:"ï¼ ".concat(v)})]})]})]})};var e2=l(95702),e5=l(30061),e3=l(42351);let e6=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),r=(0,e2.useRouter)(),{hideDialog:s,showDeleteApikeyDialog:n}=rZ();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-2.5 pb-6 w-screen md:w-[518px] flex flex-col items-center",children:[(0,eB.jsx)("div",{className:"flex justify-center w-full",children:(0,eB.jsx)("div",{className:"w-[42px] h-1 rounded-[3px] bg-text-dark"})}),(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full relative mt-4 px-4",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:a("trade.action")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>s(),children:(0,eB.jsx)(e5.A,{className:"w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsx)("div",{className:"border-t border-panel-border-color w-full mt-4"}),(0,eB.jsx)("div",{className:"flex items-center w-full px-4 py-3",onClick:()=>{sessionStorage.setItem(e3.VX,JSON.stringify(t)),r.push("/api/create"),s()},children:(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:a("api.action_detail")})}),(0,eB.jsx)("div",{className:"border-t border-panel-border-color w-[calc(100%-32px)]"}),(0,eB.jsx)("div",{className:"flex items-center w-full px-4 py-3",onClick:()=>{n(t,()=>{l(),s()})},children:(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:a("api.action_delete")})}),(0,eB.jsx)("div",{className:"border-t border-panel-border-color w-[calc(100%-32px)]"})]})};var e4=l(85784);let e7=function(){let{t:e}=(0,ez.Bd)(),t=(0,e4.OJ)(e=>{var t;return null==(t=e.userConfig)?void 0:t.apiKeyMaxCount}),{hideDialog:l}=rZ();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-2xl pt-2.5 pb-6 ml-4 w-[calc(100%-32px)] md:w-[518px] flex flex-col items-center",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full relative mt-[14px] px-4",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:e("api.reminder")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>l(),children:(0,eB.jsx)(e5.A,{className:"w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full h-fit px-4 ",children:[(0,eB.jsx)("div",{className:"text-sm md:text-xs font-medium text-text-dark mt-5",children:(0,eB.jsx)(ez.x6,{i18nKey:"api.hint_content",components:{white:(0,eB.jsx)("span",{className:"text-main-color cursor-pointer",onClick:eY.LH})}})}),(0,eB.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,eB.jsx)("span",{children:"1."}),(0,eB.jsx)("span",{children:e("api.hint_des1",{num:null!=t?t:0})})]}),(0,eB.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,eB.jsx)("span",{children:"2."}),(0,eB.jsx)("span",{children:e("api.hint_des2")})]}),(0,eB.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,eB.jsx)("span",{children:"3."}),(0,eB.jsx)("span",{children:e("api.hint_des3")})]})]})]})};var e8=l(99065),e9=l(98503),te=l(39580),tt=l(57684),tl=l(81430);let ta=()=>{let{t:e}=(0,ez.Bd)(),{hideDialog:t}=rZ(),l=(0,tl.WG)(e=>e.positionList),a=(0,eU.useRef)(l[0]),r=(0,tl.WG)(e=>e.tokenList.find(e=>{var t;return e.symbol===(null==(t=l[0])?void 0:t.symbol)})),[s,n]=(0,eU.useState)(!1),i=(0,eU.useRef)(!1),o=a.current.timestamp,c=(0,eQ.gF)(o,1e3*a.current.minHoldSeconds),d=(0,eU.useRef)(null);null===d.current&&(d.current=Math.floor((Number(c)-(0,eY.mI)())/1e3));let x=d.current,[m,u]=(0,eU.useState)(x),p=(0,eU.useRef)(x),f=(0,eU.useRef)(null),h=(0,eU.useRef)(!1),g=(0,eU.useRef)(!1),b=(0,eU.useRef)(Math.floor(((0,eY.mI)()-o)/1e3));(0,eU.useEffect)(()=>
1{if((0,e9.$s)(e9.f_),l.length>0){let e=a.current.timestamp;Number((0,eQ.gF)(e,1e3*a.current.minHoldSeconds))-(0,eY.mI)()>=0&&v(),l.forEach(e=>{let t=e.timestamp,l=(0,eQ.gF)(t,1e3*e.minHoldSeconds);Number(l)-(0,eY.mI)()>=0&&(g.current=!0),Number(l)-(0,eY.mI)()<0&&(h.current=!0)})}return()=>w()},[]);let v=()=>{f.current=setInterval(()=>{let e=Number(c)-(0,eY.mI)();p.current=e,e>0?u(e):(i.current&&(h.current=!0,g.current=!1,N()),w())},1e3)},w=()=>{f.current&&clearInterval(f.current)},j=(0,tt.e0)(e=>{let t=Object.values(e.symbolStatusMap);return 0!==t.length&&t.every(e=>{var t;return(null==(t=e.marketClosedDay)?void 0:t.isExistClosedRange)===!0&&e.showOffHour})}),N=()=>{(0,e9.$s)(e9.Pr),(0,eH.xs)().then(()=>{te.z.isConnected()||(0,tl.K)(),l.some(e=>(0,tt.Pg)(e.symbol))&&(0,eV.P0)("warn",e("trade.close_all_positions_market_closed_toast")),h.current&&!g.current&&t(),(0,eG.V6)()}).finally(()=>{h.current&&!g.current&&(n(!1),i.current=!1)})},_=(0,eU.useMemo)(()=>{if(!s||!a.current)return e("partner.confirm");{let t=Math.floor(m/1e3);return t<=20?t<=5?e("partner.confirm"):e("trade.entering_text"):e("trade.processing_text")}},[s,m]);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[518px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{alighn:"center",text:e("trade.close_all_positions")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-normal mt-4 whitespace-pre-wrap text-center",children:e("trade.close_all_positions_des")}),(0,eB.jsxs)("div",{className:"w-full flex mt-8 gap-2.5 mb-2 md:mb-0",children:[(0,eB.jsx)("div",{className:"flex-1 relative",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-withdraw-button-color !border-none !text-text-dark !text-[14px] !h-10 !rounded-lg !font-medium",rounded:!0,label:e("trade.cancel"),onClick:()=>{t(),(0,e9.$s)(e9.AV)}})}),(0,eB.jsxs)("div",{className:"flex-1 relative",children:[(0,eB.jsx)(eT.$,{className:"w-full main-button !border-none !text-[14px] !h-10 !rounded-lg !font-medium",rounded:!0,onClick:()=>{n(!0),i.current=!0,(p.current<=0||h.current)&&(h.current=!0,g.current=!1,N())},label:j?e("trade.market_is_closed"):_,disabled:j||s}),s?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-3 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]}),x>5&&(0,eB.jsx)("div",{className:"w-full text-xs text-text-light mt-2",children:"ï¼ ".concat(e("trade.close_position_dialog_hint",{seconds:a.current.minHoldSeconds}))}),(()=>{var t,l;let a=null!=(l=null==r||null==(t=r.lpFeeConfig)?void 0:t.tend)?l:0;return b.current<a&&(null==r?void 0:r.lpFeeConfig)?(0,eB.jsxs)("div",{className:"w-full mt-2 font-normal text-[12px] text-text-light",children:[(0,eB.jsx)(e8.m,{target:".minium-amount-tip",position:"top",content:e("trade.lp_fee_tips",{fee:Number(100*((null==r?void 0:r.lpFeeConfig.r)||5e-4)).toFixed(4),time:(null==r?void 0:r.lpFeeConfig.tend)||30}),pt:{root:{className:"w-[280px]"}}}),"ï¼",e("trade.lp_fee_warning2_prefix"),(0,eB.jsx)("span",{className:"minium-amount-tip underline decoration-dotted decoration-0.5 underline-offset-2 text-brand-color mx-0.5",children:e("trade.view_rules")}),e("trade.lp_fee_warning_suffix")]}):null})()]})};var tr=l(41028);let ts=e=>{var t;let{data:l,callback:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s}=rZ(),[n,i]=(0,eU.useState)(!1),o=(0,tl.WG)(e=>e.tokenList.find(e=>e.symbol===l.symbol)),c=(0,tl.WG)(e=>e.positionList.find(e=>e.positionId===l.positionId)),d=null!=(t=null==c?void 0:c.unrealizedPnl)?t:l.unrealizedPnl,x=(0,eU.useRef)(!1),[m]=(0,eU.useState)("100"),[u]=(0,eU.useState)((0,eY.HD)(l.quantity,4,!0)),p=l.timestamp,f=(0,eQ.gF)(p,1e3*l.minHoldSeconds),h=(0,eU.useRef)(Math.floor((Number(f)-(0,eY.mI)())/1e3)).current,[g,b]=(0,eU.useState)(h),v=(0,eU.useRef)(h),w=(0,eU.useRef)(null),j=(0,eU.useRef)(Math.floor(((0,eY.mI)()-p)/1e3)),N=()=>{let e=u;100===Number(m)&&(e=l.quantity);let t={positionId:l.positionId,quantity:e};(0,e9.$s)(e9.L5,{symbol:l.symbol,direction:l.positionSide,leverage:(0,eY.Pj)(Number(l.leverage)),amount:(0,eY.Pj)(l.margin)}),(0,eH.oR)(t).then(()=>{te.z.isConnected()||(0,tl.K)(),(0,e9.$s)(e9.AE),(0,eG.V6)(),s(),a()}).catch(e=>{(0,e9.$s)(e9.V3,{error_msg:e.message})}).finally(()=>{i(!1),x.current=!1})};(0,eU.useEffect)(()=>((0,e9.$s)(e9.GE),h>
10&&_(),()=>k()),[]);let _=()=>{w.current=setInterval(()=>{let e=Number(f)-(0,eY.mI)();v.current=e,e>0?b(e):(x.current&&N(),k())},1e3)},k=()=>{w.current&&clearInterval(w.current)},y=(0,eU.useMemo)(()=>{if(!n)return r("trade.close_position");{let e=Math.floor(g/1e3);if(e<=20)return e<=5?r("trade.close_position"):r("trade.entering_text");let t=h-e;if(t<2)return r("trade.submitting_text");if(t<5)return r("trade.processing_text");if(t<10)return r("trade.confirming_text")}},[n,g]);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[518px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{alighn:"center",text:r("trade.market_close")}),(0,eB.jsx)("span",{className:"w-full text-text-dark text-sm font-medium mt-4 text-center",children:r("trade.close_position_hint")}),(0,eB.jsxs)("div",{className:"w-full flex items-center mt-6 text-base font-semibold gap-1",children:[(0,eB.jsx)("span",{className:"text-text-dark",children:"".concat(l.name," ").concat(l.symbol," \xb7 ").concat(l.leverage,"x \xb7 ")}),(0,eB.jsx)("span",{className:"long"===l.positionSide?"text-[#E43C5A]":"text-[#2EBD85]",children:r("long"===l.positionSide?"trade.close_long":"trade.close_short")})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between items-center mt-4",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:r("trade.enter_price")}),(0,eB.jsx)("span",{className:"text-sm font-medium text-text-dark",children:(0,eY.hE)(l.showEntryPrice,l.pricePrecision,!0,"round")})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between items-center mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:r("trade.size")}),(0,eB.jsx)("span",{className:"text-sm font-medium text-text-dark",children:"".concat((0,tr.U)(u,o)," ").concat(r("trade.lot_unit"))})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between items-center mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:r("trade.est_pnl")}),(0,eB.jsx)("span",{className:"text-sm font-medium ".concat(d>0?"text-[#2EBD85]":"text-[#E43C5A]"),children:(0,eY.ax)(d,2)})]}),(0,eB.jsxs)("div",{className:"w-full hidden justify-between items-center mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:r("trade.redemption_amount")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark",children:"".concat((0,eY.HD)((0,eQ.ez)(l.quantity,l.marketPrice),2,!0)," USD")})]}),(0,eB.jsxs)("div",{className:"w-full mt-8 relative mb-2 md:mb-0",children:[(0,eB.jsx)(eT.$,{className:"w-full main-button !border-none !text-[14px] !h-10 !rounded-lg !font-medium",rounded:!0,label:(0,tt.Pg)(l.symbol)?r("trade.market_is_closed"):y,onClick:()=>{i(!0),x.current=!0,v.current<=0&&N()},disabled:(0,tt.Pg)(l.symbol)||0>=Number(u)||n}),n?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]}),h>5&&(0,eB.jsx)("div",{className:"w-full font-normal text-xs text-text-light mt-2",children:"ï¼ ".concat(r("trade.close_position_dialog_hint",{seconds:l.minHoldSeconds}))}),(()=>{var e,t;let l=null!=(t=null==o||null==(e=o.lpFeeConfig)?void 0:e.tend)?t:0;return j.current<l&&(null==o?void 0:o.lpFeeConfig)?(0,eB.jsxs)("div",{className:"w-full mt-2 font-normal text-[12px] text-text-light",children:[(0,eB.jsx)(e8.m,{target:".minium-amount-tip",position:"top",content:r("trade.lp_fee_tips",{fee:(0,eY.tu)(Number(100*((null==o?void 0:o.lpFeeConfig.r)||5e-4)).toFixed(4),4),time:(null==o?void 0:o.lpFeeConfig.tend)||30}),pt:{root:{className:"w-[280px]"}}}),r("trade.lp_fee_warning_prefix"),(0,eB.jsx)("span",{className:"minium-amount-tip underline decoration-dotted decoration-0.5 underline-offset-2 text-brand-color mx-0.5",children:r("trade.view_rules")}),r("trade.lp_fee_warning_suffix")]}):null})()]})};var tn=l(17268),ti=l(55608),to=l(18181),tc=l(45907);l(89221);let td=e=>{let{value:t,marks:l,format:a,max:r=100,min:s=0,defaultValue:n,railBgColor:i,onSliderChange:o}=e;return(0,eB.jsx)("div",{className:"",children:(0,eB.jsx)(tc.A,{value:t,defaultValue:n,styles:{track:{background:"var(--slide-track-color)"},rail:{background:i},handle:{background:"var(--text-dark)",border:"none",opacity:1}},marks:l,max:r,min:s,onChange:e=>{o(e)},dotStyle:{background:"var(--slide-active-dot)",border:"none",width:"4px",height:"4px",bottom:0},tabIndex:-1,activeDotStyle:{background:"var(--slide-active-dot)",border:"none",width:"4px",height:"4px"},handleRender:(e,t)=>eU.cloneElement(e,{},[t.dragging&&(0,eB.jsxs)("div",{style:{position:"absolute",top:-35,left:"50%",textAlign:"center",transform:"translateX(-50%)",padding:"2px 6px",backgroundColor:"#40404A",color:"#fff",fontSize:12,borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[t.value,a,(0,eB.jsx)("div",{style:{position:"absolute",bottom:-6,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #40404A"}})]},"tooltip"),e.props.children])})})},tx=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(!1),[i,o]=(0,eU.useState)((0,eY.HD)((0,eQ.ez)(t.quantity,t.marketPrice),2)),[c,d]=(0,eU.useState)("100"),[x,m]=(0,eU.useState)((0,eY.HD)(t.quantity,2)),u=(0,eU.useRef)(2),p=[{id:1,name:"USD"},{id:2,name:(0,eY.vT)(t.symbol)}],[f,h]=(0,eU.useState)(p[0]),g=(0,tl.WG)(e=>e.positionList),[b,v]=(0,eU.useState)(100),[w,j]=(0,eU.useState)(""),N=e=>{r(),l(e)},_=e=>(0,eB.jsx)("div",{className:"flex items-center",children:(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})}),k=(e,l)=>{if(Number(e)>0)if(Number(1===f.id?(0,eY.HD)(l):l)>=Number(t.quantity))m((0,eY.HD)(t.quantity)),v(100),d("100");else{let e=(0,eY.HD)(l);m(e);let a=(0,eQ.ez)((0,eQ.BP)(e,(0,eY.HD)(t.quantity)),100);v(Number(a));let r=new tn.A(a).decimalPlaces(0).toNumber();r>100&&(r=100),d("".concat(r))}else m("0"),v(0)},y=async()=>{n(!0);let e=x;100===Number(c)&&(e=t.quantity);let l={positionId:t.positionId,profitPrice:w.replaceAll(",",""),quantity:e};(0,eH.qp)(l).then(()=>{(0,eG.xJ)(),N(!0),(0,eV.P0)("success",a("trade.limit_open_submitted"))}).finally(()=>{n(!1)})};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-[16px] pt-3 w-[calc(100vw-60px)] md:w-[518px] flex flex-col items-center pb-4",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full pb-2.5 relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-lg text-text-dark font-medium text-center",children:a("trade.limit_close")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer w-6 h-6 mr-2.5 absolute right-0 top-0",onClick:()=>N(!1),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsx)("span",{className:"w-full text-text-dark text-sm mt-2.5 text-center",children:a("trade.close_position_limit_hint")}),(0,eB.jsx)("div",{className:"w-full px-[18px] mt-3",children:(0,eB.jsxs)("div",{className:"flex bg-dialog-input-background border border-border-color roun
1ded-lg items-center justify-between px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:[(0,eB.jsx)("label",{htmlFor:"limitPriceInput",className:"text-text-light text-sm shrink select-none cursor-text",children:a("trade.limit_price_input_placeholder")}),(0,eB.jsx)("div",{className:"flex flex-1 h-9 items-center",children:(0,eB.jsx)("input",{id:"limitPriceInput",className:"flex-1 w-full h-9 min-w-0 text-sm font-medium text-text-dark text-right mr-1 transfer",type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",value:w,onChange:e=>(e=>{let t=e;if(/^\d*(?:\.\d*)?$/.test(t)){if(t.includes(".")){let[,e]=t.split(".");if(e.length>2)return}t.length>12||(t.startsWith(".")&&(t="0".concat(t)),j(t))}})(e.target.value)})}),(0,eB.jsx)("span",{className:"text-[#2ebd85] text-sm ml-2 cursor-pointer",onClick:()=>(()=>{let e=g.filter(e=>e.symbol===t.symbol);e&&e.length>0&&j("".concat(e[0].marketPrice))})(),children:"Last"})]})}),(0,eB.jsx)("div",{className:"w-full px-[18px] mt-3",children:(0,eB.jsxs)("div",{className:"flex flex-1 bg-dialog-input-background border border-border-color rounded-lg items-center justify-between px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm shrink",children:a("trade.redemption_amount")}),(0,eB.jsxs)("div",{className:"flex flex-1 h-9 items-center",children:[(0,eB.jsx)("input",{className:"flex-1 w-full h-9 min-w-0 text-sm font-medium text-text-dark text-right pr-1 transfer",type:"text",value:i,onChange:e=>(e=>{if(!s){if(""===e){o(""),m("0"),v(0),d("0");return}if(/^\d*(?:\.\d*)?$/.test(e)){if(e.includes(".")){let[,t]=e.split(".");if(t.length>u.current)return}if(!(e.length>12))if(o(e),1===f.id){let l=(0,eQ.BP)(e,t.marketPrice);k(e,l)}else k(e,e)}}})(e.target.value)}),(0,eB.jsx)(ti.m,{value:f,onChange:e=>(e=>{let l=e.value;if(h(l),i)if(1===l.id){let e=(0,eQ.ez)((0,eQ.ez)(t.quantity,(0,eQ.BP)(b,100)),t.marketPrice);o((0,eY.HD)(e)),u.current=2}else{let e=(0,eQ.ez)(t.quantity,(0,eQ.BP)(b,100));o((0,eY.HD)(e,2));let l=(0,eY.HD)(t.quantity,2).split(".")[1].length;l<=4&&(l=4),u.current=l}})(e),options:p,optionLabel:"name",itemTemplate:_,valueTemplate:_,pt:{root:()=>({className:(0,to.xW)("focus:outline-none focus:outline-offset-0")}),input:()=>({className:(0,to.xW)("!p-0")}),trigger:()=>({className:(0,to.xW)("!w-6")}),panel:()=>({className:(0,to.xW)("!ml-2 !mt-3")})}})]})]})}),(0,eB.jsxs)("div",{className:"w-full flex mt-2 items-center",children:[(0,eB.jsx)("div",{className:"flex-1 pl-6 pr-6",children:(0,eB.jsx)(td,{value:b,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},onSliderChange:e=>{if(v(e),d("".concat(e)),e>0){let l=(0,eQ.ez)((0,eY.HD)(t.quantity),(0,eQ.BP)(e,100));if(m((0,eY.HD)(l)),1===f.id){let l=(0,eQ.ez)((0,eQ.ez)(t.quantity,t.marketPrice),(0,eQ.BP)(e,100));o((0,eY.HD)(l))}else o((0,eY.HD)(l))}else m("0"),o("")},defaultValue:100,railBgColor:"var(--slide-rail-color)",format:"%"})}),(0,eB.jsxs)("div",{className:"flex items-center w-[45px] bg-dialog-input-background rounded-[4px] mr-[18px] p-1.5",children:[(0,eB.jsx)("input",{className:"flex-1 w-full min-w-0 text-xs font-medium text-text-dark text-right mr-1 transfer",type:"text",value:c,onChange:e=>(e=>{if(s)return;if(""===e){d(""),v(0),o(""),m("0");return}if(!/^\d+$/.test(e))return;let l=Number(e);if(!(e.length>1&&e.startsWith("0"))&&l>=0&&l<=100){d(e),v(l);let a=(0,eQ.ez)((0,eY.HD)(t.quantity),(0,eQ.BP)(l,100));if(m((0,eY.HD)(a)),1===f.id){let e=(0,eQ.ez)((0,eQ.ez)(t.quantity,(0,eQ.BP)(l,100)),t.marketPrice);o((0,eY.HD)(e))}else{let e=(0,eQ.ez)(t.quantity,(0,eQ.BP)(l,100));o((0,eY.HD)(e))}}})(e.target.value)}),(0,eB.jsx)("span",{className:"text-text-dark text-xs",children:"%"})]})]}),(0,eB.jsxs)("div",{className:"w-full px-4.5 mt-6 relative",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-main-color !border-none !text-white !text-[14px] !py-1.75 !rounded-lg",rounded:!0,label:(0,tt.Pg)(t.symbol)?a("trade.market_is_closed"):a("trade.close_position"),onClick:()=>{y()},disabled:(0,tt.Pg)(t.symbol)||0>=Number(x)||s||""===w}),s?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})};function tm(){return(tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tu=function(e){return eU.createElement("svg",tm({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),a||(a=eU.createElement("rect",{width:15,height:15,x:.5,y:.5,stroke:"currentColor",rx:1.5})),r||(r=eU.createElement("rect",{width:10,height:10,x:3,y:3,fill:"
1currentColor",rx:1})))};function tp(){return(tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tf=function(e){return eU.createElement("svg",tp({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),s||(s=eU.createElement("rect",{width:15,height:15,x:.5,y:.5,stroke:"#6C757D",rx:1.5})))},th=e=>{let{remainNum:t,data:l,callback:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s}=rZ(),[n,i]=(0,eU.useState)(!1),[o,c]=(0,eU.useState)(!1),[d,x]=(0,eU.useState)("0"),[m,u]=(0,eU.useState)("".concat(l.maxRate)),[p,f]=(0,eU.useState)(""),[h,g]=(0,eU.useState)("");return(0,eU.useEffect)(()=>{let e=()=>{let e=document.activeElement;null!=e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName)&&window.setTimeout(()=>{"scrollIntoView"in e?e.scrollIntoView(!1):e.scrollIntoViewIfNeeded(!1)},0)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl w-screen md:w-[420px] flex flex-col items-center md:p-6 px-4 py-6",children:[(0,eB.jsx)(e0,{text:r("partner.create_referral_link")}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsxs)("div",{className:"flex",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.total_commission_split")}),(0,eB.jsx)("span",{className:"text-sm text-main-color font-bold ml-1.5",children:"".concat(l.maxRate,"%")})]}),(0,eB.jsx)(eX,{childRate:0,parentRate:l.maxRate,childRateCallback:e=>x(e),parentRateCallback:e=>u(e)})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.custom_referral_code",{remainNum:t})}),(0,eB.jsx)("div",{className:"flex w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)(eK.A,{maxLength:12,filter:e=>/^[a-z0-9]{0,12}$/i.test(e),placeholder:r("partner.custom_referral_code_hint"),inputClass:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-2 placeholder:!text-text-light placeholder:!text-sm",countClass:"text-sm text-text-light",onChange:e=>f(e)})}),(0,eB.jsx)("span",{className:"text-xs mt-2 ".concat(p&&p.length<5?"text-[#E43C5A]":"text-text-light"),children:p&&p.length<5?r("partner.custom_referral_code_hint"):r("partner.input_referral_code_hint")})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:r("partner.add_remark")}),(0,eB.jsx)("div",{className:"flex w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)(eK.A,{maxLength:12,placeholder:r("partner.add_remark_hint"),inputClass:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-2 placeholder:!text-text-light placeholder:!text-sm",countClass:"text-sm text-text-light",onChange:e=>g(e)})})]}),(0,eB.jsxs)("div",{className:"mt-8 w-full flex items-center",onClick:()=>c(!o),children:[o?(0,eB.jsx)(tu,{className:"text-text-dark"}):(0,eB.jsx)(tf,{}),(0,eB.jsx)("span",{className:"text-xs text-text-dark font-medium ml-2",children:r("partner.set_default_referral_link")})]}),(0,eB.jsxs)("div",{className:"w-full relative h-9.5 mt-4",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,onClick:()=>{if(!m||!d||p&&p.length<5)return void(0,eV.P0)("error",r("partner.please_check_input"));i(!0),(0,eH.d)({parentCommissionRate:m,childCommissionRate:d,customCode:p,remark:h,isDefault:o}).then(()=>{(0,eV.P0)("success",r("partner.create_success")),a(),s()}).finally(()=>{i(!1)})},label:r("partner.create"),disabled:n||p.length>=1&&p.length<5||t<=0}),n?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-1 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})};var tg=l(36915),tb=l(55669);let tv=()=>{let e=new Date,t=new Date;t.setDate(e.getDate()-30);let[l,a]=(0,eU.useState)([t,e]),[r,s]=(0,eU.useState)();return{dates:l,minDate:r,today:e,handleCalendarChange:e=>{let[t,l]=e.value||[];if(a(e.value),t&&!l){let e=new Date(new Date(t));e.setDate(e.getDate()-60),s(e)}t&&l&&s(void 0)},resetDates:()=>{a([t,e])}}},tw=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(""),{dates:i,minDate:o,today:c,handleCalendarChange:d,resetDates:x}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.customer_wallet_address")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:s,placeholder:a("partner.customer_wallet_address_hint"),onChange:e=>{n(e.target.value)}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.input_trade_date")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:i,onChange:d,minDate:o,maxDate:c,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(i)||x()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-33 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color roun
1ded-lg",onClick:()=>{r(),null==t||t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{r(),null==l||l(s,i)},children:a("partner.search")})]})]})};var tj=l(28852);let tN=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(!1);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl py-6 w-screen md:w-[518px] flex flex-col items-center px-4 md:px-6",children:[(0,eB.jsx)(e0,{alighn:"center",text:a("api.delete_api_key")}),(0,eB.jsxs)("div",{className:"flex items-center w-full mt-4 py-[9px] bg-[#EA941D0F] border border-[#EA941D]/20 rounded-[12px] px-4",children:[(0,eB.jsx)(tj.A,{className:"shrink-0"}),(0,eB.jsx)("span",{className:"text-[#EA941D] text-sm ml-1.5",children:a("api.delete_api_key_hint")})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-base text-text-light",children:a("api.api_remark")}),(0,eB.jsx)("span",{className:"text-base text-text-dark",children:t.name})]}),(0,eB.jsxs)("div",{className:"w-full mt-8 flex items-center gap-2.5",children:[(0,eB.jsx)("span",{className:"flex-1 bg-withdraw-button-color h-9.5 leading-9.5 rounded-[10px] text-center text-text-dark text-sm font-medium cursor-pointer",onClick:r,children:a("trade.cancel")}),(0,eB.jsxs)("div",{className:"w-full flex-1 relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-medium !rounded-[10px]",rounded:!0,label:a("api.action_delete"),disabled:s,onClick:()=>{n(!0),(0,eH.Lh)({id:t.id}).then(()=>{l(),r()}).finally(()=>{n(!1)})}}),s?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})]})};var t_=l(22500);function tk(){return(tk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let ty=function(e){return eU.createElement("svg",tk({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none"},e),n||(n=eU.createElement("path",{fill:"#000",d:"M15.478 14.337a.85.85 0 0 1-.6-.248.843.843 0 0 1 .6-1.442.82.82 0 0 0 .581-.24.82.82 0 0 0 .24-.577V4.507a.815.815 0 0 0-.82-.818H8.115a.82.82 0 0 0-.581.24.82.82
10 0 0-.24.578.852.852 0 0 1-1.699 0 2.5 2.5 0 0 1 .74-1.772A2.53 2.53 0 0 1 8.115 2h7.362a2.53 2.53 0 0 1 1.78.735c.473.47.74 1.107.74 1.772v7.323a2.5 2.5 0 0 1-.74 1.77 2.53 2.53 0 0 1-1.78.737"})),i||(i=eU.createElement("path",{fill:"#000",d:"M11.712 18H4.66a2.67 2.67 0 0 1-1.884-.775A2.65 2.65 0 0 1 2 15.352V8.31a2.63 2.63 0 0 1 .778-1.874 2.66 2.66 0 0 1 1.884-.775h7.05a2.67 2.67 0 0 1 1.884.775 2.64 2.64 0 0 1 .779 1.873v7.042c.028 1.465-1.19 2.649-2.662 2.649M4.66 7.35a.96.96 0 0 0-.892.59.95.95 0 0 0-.071.368v7.042a.95.95 0 0 0 .593.887 1 1 0 0 0 .37.07h7.05a.96.96 0 0 0 .892-.59.95.95 0 0 0 .072-.367V8.309a.95.95 0 0 0-.594-.887 1 1 0 0 0-.37-.07z"})))},tE=l.p+"static/media/ic_hint.52702ccb.svg",tA=l.p+"static/media/ic_solana.75ca8cec.svg",tC=l.p+"static/media/ic_usdc.2bffc1e1.svg",tS=l.p+"static/media/ic_usdt.494c33f1.svg",tD=()=>{let{t:e}=(0,ez.Bd)(),{hideDialog:t}=rZ(),l=(0,eG.kH)(e=>e.userInfo),a=[{id:1,name:"USDC",icon:tC},{id:2,name:"USDT",icon:tS}],[r,s]=(0,eU.useState)(a[0]),n=()=>"".concat(null==l?void 0:l.wallets[0].address),i=e=>(0,eB.jsxs)("div",{className:"flex items-center",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5 mr-1.5"}),(0,eB.jsx)("div",{className:"text-text-dark text-[13px]",children:e.name})]});return(0,eU.useEffect)(()=>{(0,eH.r3)()},[]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-[16px] pt-6 w-[calc(100vw-60px)] md:w-[420px] flex flex-col items-center px-5 pb-4",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-base text-text-dark font-semibold",children:e("home.deposit")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>t(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:e("trade.select_token")}),(0,eB.jsx)("div",{className:"bg-dialog-input-background rounded-[6px] mt-2",children:(0,eB.jsx)(ti.m,{value:r,onChange:e=>s(e.value),options:a,optionLabel:"name",itemTemplate:i,valueTemplate:i,pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full h-9","!flex !justify-start")}),input:()=>({className:(0,to.xW)("!py-[9px]")}),wrapper:{className:"!bg-dialog-background !rounded-[8px]"}}})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-col mt-[14px]",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light",children:e("trade.currently_supported_networks")}),(0,eB.jsxs)("div",{className:"flex items-center gap-2 bg-dialog-input-background rounded-[6px] pl-3 py-[9px] mt-2",children:[(0,eB.jsx)("img",{className:"w-5 h-5",src:tA,alt:""}),(0,eB.jsx)("span",{className:"text-[13px] text-text-dark",children:"Solana"})]})]}),(0,eB.jsx)("span",{className:"w-full text-text-light text-sm mt-5",children:e("trade.deposit_details")}),(0,eB.jsxs)("div",{className:"w-full bg-withdraw-code-background mt-2.5 rounded-[8px] p-4 flex flex-col justify-center items-center",children:[(0,eB.jsxs)("div",{className:"flex justify-center items-center relative bg-white p-2 rounded-[8px]",children:[(0,eB.jsx)(t_.h,{value:n(),size:130,level:"H"}),(0,eB.jsx)("div",{className:"bg-white rounded-full p-[5px] absolute",children:(0,eB.jsx)("img",{className:"inset-0 m-auto w-7.5 h-7.5",src:tA,alt:""})})]}),(0,eB.jsxs)("div",{className:"flex flex-1 items-center border border-dialog-border-color rounded-[8px] px-3 py-2 mt-4 gap-8.5",children:[(0,eB.jsx)("span",{className:"flex-1 text-xs text-text-dark break-all",children:n()}),(0,eB.jsx)("div",{className:"shrink w-7 h-7 rounded-[8px] bg-[#F4F4F5] items-center flex cursor-pointer",onClick:()=>{l&&(0,eY.Dk)(n())},children:(0,eB.jsx)(ty,{className:"inset-0 m-auto w-5 h-5"})})]})]}),(0,eB.jsxs)("div",{className:"mt-2.5 flex flex-row items-center px-4 rounded-[8px] w-full border border-dialog-border-color",children:[(0,eB.jsx)("img",{className:"inset-0 m-auto w-4 h-4",width:16,height:16,src:tE,alt:""}),(0,eB.jsx)("span",{className:"text-text-light text-xs py-1.75 ml-2.5",children:e("trade.deposit_hint2")})]})]})};var tP=l(79477);let tM=l.p+"static/media/ic_deposit_hint01.3ed93dff.svg",tO=l.p+"static/media/ic_deposit_hint02.7e9d2a58.svg",tR=l.p+"static/media/ic_deposit_hint03.258772c3.svg";var tL=l(81999);function tF(){return(tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tB=function(e){return eU.createElement("svg",tF({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),o||(o=eU.createElement("path",{d:"m8.765 13.758 4.146-6.363a.55.55 0 0 0-.148-.754.52.52 0 0 0-.295-.091h-3.26V2.544c0-.3-.237-.544-.53-.544a.53.53 0 0 0-.443.242L4.089 8.605a.55.55 0 0 0 .148.754c.087.06.19.092.295.092h3.26v4.005c0 .3.237.544.53.544.179 0 .345-.09.443-.242"})))},tI=l.p+"static/media/ic_bsc.3ac63713.svg";function tT(){return(tT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tU=function(e){return eU.createElement("svg",tT({xmlns:"http://www.w3.org/2000/svg",width:12,height:13,fill:"none"},e),c||(c=eU.createElement("path",{fill:"#6C757D",d:"M6.018 0c.017.018 1.162 1.22 3.08 1.606 1.925.388 2.663.423 2.663.423s.852 3.722-.662 6.615c-1.355 2.588-3.45 3.615-5.081 4.279h-.035C4.35 12.259 2.256 11.233.9 8.643-.614 5.752.239 2.03.239 2.03s.738-.035 2.663-.423C4.834 1.217 5.982 0 5.982 0zm2.616 5.212a.46.46 0 0 0-.652 0L5.538 7.654 4.48 6.597a.461.461 0 1 0-.653.652l1.385 1.385c.18.18.472.18.652 0l2.77-2.77a.46.46 0 0 0 0-.652"})))},tz=l.p+"static/media/ic_monad.8f4dab86.svg",tH=l.p+"static/media/ic_sui.ff8207a9.svg",tW
1=e=>{let{price:t}=e,[l,a]=(0,eU.useState)(t);async function r(){a(await (0,eH.zR)("solana"))}return(0,eU.useEffect)(()=>{l<=0&&r();let e=0,t=setInterval(()=>{(e+=1)>=5&&(e=0,r())},1e3);return()=>clearInterval(t)},[]),(0,eB.jsx)("div",{className:"flex flex-row items-center text-sm",children:(0,eB.jsx)("div",{className:"ml-auto text-text-dark font-medium",children:"1 SOL â ".concat((0,eY.tu)(l)," USD")})})},tV=[{id:1,name:"USDC",icon:tC},{id:2,name:"USDT",icon:tS},{id:3,name:"SOL",icon:tA}],tG=[{id:"solana",name:"Solana",icon:tA,tokenIds:[1,2,3]},{id:"monad",name:"Monad",icon:tz,tokenIds:[1]},{id:"bsc",name:"BNB Chain",icon:tI,tokenIds:[1,2]},{id:"sui",name:"Sui",icon:tH,tokenIds:[1]}],t$=(e,t)=>e.find(e=>e.id===(null==t?void 0:t.toLowerCase()))||e[0]||tG[0],tq=e=>{let{handleChooseDeposit:t}=e,{t:l}=(0,ez.Bd)(),a=(0,eG.kH)(e=>e.userInfo),r=(0,eU.useMemo)(()=>(e=>{if(!(null==e?void 0:e.length))return tG;let t=new Set(e.map(e=>{var t;return null==(t=e.chain)?void 0:t.toLowerCase()}).filter(Boolean)),l=tG.filter(e=>t.has(e.id));return l.length>0?l:tG})(null==a?void 0:a.wallets),[null==a?void 0:a.wallets]),s=t$(r,null==a?void 0:a.chain),n=tV.find(e=>s.tokenIds.includes(e.id))||tV[0],[i,o]=(0,eU.useState)(s),[c,d]=(0,eU.useState)(n),x=tV.filter(e=>i.tokenIds.includes(e.id));(0,eU.useEffect)(()=>{let e=t$(r,null==a?void 0:a.chain);if(i.id===e.id)return;let l=tV.filter(t=>e.tokenIds.includes(t.id)),s=l.find(e=>e.id===c.id)||l[0];o(e),d(s),t(+(3!==s.id))},[null==a?void 0:a.chain,r]);let m=()=>{let e=(null==a?void 0:a.wallets.find(e=>{var t;return(null==(t=e.chain)?void 0:t.toLowerCase())===i.id}))||(null==a?void 0:a.wallets[0]);return"".concat((null==e?void 0:e.address)||"")},u=e=>(0,eB.jsxs)("div",{className:"flex items-center",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5 mr-1.5"}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]}),p=e=>(0,eB.jsxs)("div",{className:"flex items-center",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5 mr-1.5"}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]});return(0,eB.jsxs)("div",{className:"flex flex-col w-full",children:[(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:l("trade.select_token")}),3===c.id&&(0,eB.jsx)("div",{className:"ml-auto",children:(0,eB.jsx)(tW,{price:0})})]}),(0,eB.jsx)("div",{className:"bg-segment-background rounded-lg mt-2",children:(0,eB.jsx)(ti.m,{value:c,onChange:e=>(e=>{let l=e.value;3===l.id?t(0):t(1),d(l),(0,e9.$s)(e9.cN,{token:l.name})})(e),options:x,optionLabel:"name",itemTemplate:u,valueTemplate:u,dropdownIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current"}),collapseIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current rotate-180"}),pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full h-9","!flex !justify-start")}),input:()=>({className:(0,to.xW)("!py-[9px]")}),wrapper:{className:"!bg-segment-background !rounded-[8px]"}}})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-col mt-[14px]",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light",children:l("trade.currently_supported_networks")}),(0,eB.jsx)("div",{className:"bg-segment-background rounded-lg mt-2",children:(0,eB.jsx)(ti.m,{value:i,onChange:e=>(e=>{let l=e.value,a=tV.filter(e=>l.tokenIds.includes(e.id)),r=a.find(e=>e.id===c.id)||a[0];o(l),d(r),t(+(3!==r.id)),(0,e9.$s)(e9.Ph,{network:l.id})})(e),options:r,optionLabel:"name",itemTemplate:p,valueTemplate:p,dropdownIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current"}),collapseIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current rotate-180"}),pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full h-9","!flex !justify-start")}),input:()=>({className:(0,to.xW)("!py-[9px]")}),wrapper:{className:"!bg-segment-background !rounded-[8px]"}}})})]}),(0,eB.jsxs)("div",{className:"flex flex-row items-center text-sm mt-5",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.deposit_details")}),(0,eB.jsx)(tL.A,{className:"demo-mode-tip ml-1.5 mt-0.5"}),(0,eB.jsx)(e8.m,{target:".demo-mode-tip",position:"bottom",content:l("trade.deposit_details_tips"),pt:{root:{className:"w-[200px]"}}})]}),(0,eB.jsxs)("div",{className:"w-full bg-withdraw-code-background mt-2.5 rounded-[8px] p-3 flex flex-col justify-center items-center",children:[(0,eB.jsxs)("div",{className:"flex justify-center items-center relative bg-white rounded-[8px] border-4 border-black",children:[(0,eB.jsx)(t_.h,{value:m(),size:120,level:"H"}),(0,eB.jsx)("div",{className:"bg-white rounded-full p-[5px] absolute",children:(0,eB.jsx)("img",{className:"inset-0 m-auto w-7.5 h-7.5",src:i.icon,alt:""})})]}),(0,eB.jsxs)("div",{className:"flex flex-1 items-center border border-dialog-border-color roun
1ded-[8px] px-3 py-1.5 mt-3 gap-8.5",children:[(0,eB.jsx)("span",{className:"flex-1 text-xs text-text-dark break-all",children:m()}),(0,eB.jsx)("div",{className:"shrink w-7 h-7 rounded-[8px] bg-[#F4F4F5] items-center flex cursor-pointer",onClick:()=>{a&&(0,eY.Dk)(m())},children:(0,eB.jsx)(ty,{className:"inset-0 m-auto w-5 h-5"})})]})]}),(0,eB.jsxs)("div",{className:"mt-4 flex flex-row items-center px-3.5 py-1.5 rounded-[8px] text-xs w-full border border-dialog-input-background mb-3 md:mb-0",children:[(0,eB.jsx)(tU,{className:"w-3 shrink-0"}),(0,eB.jsx)("div",{className:"text-xs ml-1.5 text-text-light",children:(0,eB.jsx)(ez.x6,{i18nKey:"trade.deposit_shield_info",components:{black:(0,eB.jsx)("span",{className:"text-text-dark font-bold"})}})})]})]})};var tQ=l(75114),tX=l(4806),tK=l(44671),tZ=l(85202),tJ=l(35500),tY=l(4555);let t0=e=>{var t;let{handleChooseDeposit:l}=e,{t:a}=(0,ez.Bd)(),{signTransaction:r}=(0,tZ.v)(),s=(0,eG.kH)(e=>e.userInfo),n=(0,eG.kH)(e=>e.language),[i,o]=(0,eU.useState)(""),[c,d]=(0,eU.useState)(!1),x=[{id:1,name:"USDC",icon:tC},{id:2,name:"USDT",icon:tS},{id:3,name:"SOL",icon:tA}],m=null==s||null==(t=s.chain)?void 0:t.toLowerCase(),u="monad"===m||"bsc"===m,p=null!=m?m:"solana",f="monad"===m?{name:"Monad",icon:tz}:"bsc"===m?{name:"BNB Chain",icon:tI}:"sui"===m?{name:"Sui",icon:tH}:{name:"Solana",icon:tA},h="monad"===m?x.filter(e=>1===e.id):"bsc"===m?x.filter(e=>1===e.id||2===e.id):"sui"===m?x.filter(e=>1===e.id):x,[g,b]=(0,eU.useState)(x[0]),[v,w]=(0,eU.useState)({}),{walletProvider:j}=(0,tK.AX)("solana"),{walletProvider:N}=(0,tK.AX)("eip155"),{walletProvider:_}=(0,tK.AX)("sui"),k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.id;return 3===e?4:2},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.id,l=new tn.A(e||0);if(!l.isFinite()||l.isZero())return"0";let a=k(t);return l.decimalPlaces(a,tn.A.ROUND_DOWN).toFixed(a).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")},E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.id;return(0,tJ.Z1)(y(e,t),n)},A=()=>{switch(g.id){case 1:return v.usdc||0;case 2:return v.usdt||0;case 3:return v.balance||0;default:return 0}},C=(e=>{if(!e)return"";let t=(()=>{var e,t;return 3===g.id?.01:(null==s||null==(t=s.wallets)||null==(e=t[0])?void 0:e.depositMinAmount)||1})();return Number(e)<t?3===g.id?a("home.withdraw_amount_hint2",{amount:(0,eY.tu)(.01)}):a("trade.min_withdraw_hint",{amount:(0,eY.tu)(t)}):Number(e)>Number(A())?a("trade.insufficient_balance"):""})(i),S=async e=>await j.signTransaction(e),D=async e=>{try{if(u){if(!await (0,tY.zi)(e,N,null==s?void 0:s.accountAddress))return void d(!1);(0,eV.P0)("success",a("trade.transaction_submitted"),1e4),(0,eG.Z)("processing"),d(!1);return}if("sui"===p){let t=null==_?void 0:_.accounts.find(e=>e.address.toLowerCase()===(null==s?void 0:s.accountAddress.toLowerCase()));if(!_||!t){(0,eV.P0)("error",a("home.sign_not_available"),eV.KW),d(!1);return}await (0,tX.m)(_,{account:t,chain:"sui:mainnet",transaction:tQ.Z.from(e)}),(0,eV.P0)("success",a("trade.transaction_submitted"),1e4),(0,eG.Z)("processing"),d(!1);return}let t=j?await (0,tY.Zn)(e,S):await (0,tY.Zn)(e,r);if(!t)return void d(!1);(0,eH.Bc)({tx:t,chain:p}).then(e=>{e&&((0,eV.P0)("success",a("trade.transaction_submitted"),1e4),(0,eG.Z)("processing"))}).catch(()=>{(0,e9.$s)(e9.QW,{amount:(0,eY.Pj)(Number(i)),token:g.name})}).finally(()=>{d(!1)})}catch(e){console.log(e),d(!1)}};return(0,eU.useEffect)(()=>{h.some(e=>e.id===g.id)||(b(h[0]),l(+(3!==h[0].id)))},[null==s?void 0:s.chain]),(0,eU.useEffect)(()=>{s&&(0,eH.mX)({address:null==s?void 0:s.accountAddress,chain:null==s?void 0:s.chain}).then(e=>{if(e){let t=h.find(t=>((e,t)=>
1{switch(e){case 1:return t.usdc||0;case 2:return t.usdt||0;case 3:return t.balance||0;default:return 0}})(t.id,e)>0)||h[0];w(e),t&&t.id!==g.id&&(b(t),l(+(3!==t.id)))}})},[null==s?void 0:s.accountAddress,null==s?void 0:s.chain]),(0,eB.jsxs)("div",{className:"flex flex-col w-full",children:[(0,eB.jsxs)("div",{className:"w-full flex flex-col mt-[14px]",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light",children:a("trade.currently_supported_networks")}),(0,eB.jsxs)("div",{className:"flex items-center gap-2 bg-segment-background rounded-lg pl-3 py-[9px] mt-2",children:[(0,eB.jsx)("img",{className:"w-5 h-5",src:f.icon,alt:""}),(0,eB.jsx)("span",{className:"text-[14px] text-text-dark font-medium",children:f.name})]})]}),(0,eB.jsxs)("div",{className:"flex flex-row items-center text-sm mt-5",children:[(0,eB.jsx)("span",{className:"text-text-light",children:a("trade.deposit_details")}),(0,eB.jsx)(tL.A,{className:"demo-mode-tip ml-1.5"}),(0,eB.jsx)(e8.m,{target:".demo-mode-tip",position:"bottom",content:a("trade.deposit_details_tips"),pt:{root:{className:"w-[200px]"}}}),3===g.id&&(0,eB.jsx)("div",{className:"ml-auto",children:(0,eB.jsx)(tW,{price:v.solPrice})})]}),(0,eB.jsx)("div",{className:"w-full flex mt-2 flex-1 bg-segment-background border border-segment-background rounded-lg items-center justify-between input-wrapper ".concat(C?"focus-within:border-[#E43C5A99]":"focus-within:border-input-hover-border"),children:(0,eB.jsx)(ti.m,{value:g,onChange:e=>(e=>{let t=e.value;l(+(3!==t.id)),b(t),(0,e9.$s)(e9.cN,{token:t.name})})(e),options:h,optionLabel:"name",itemTemplate:e=>(0,eB.jsxs)("div",{className:"w-full h-7 flex justify-start items-center gap-1.5",children:[(0,eB.jsx)("img",{className:"w-5 h-5",src:e.icon,alt:""}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium ml-auto",children:"".concat(a("trade.balance"),":")}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium ml-1",children:E((e=>{switch(e){case"USDC":return v.usdc||0;case"USDT":return v.usdt||0;case"SOL":return v.balance||0;default:return 0}})(e.name),e.id)})]}),valueTemplate:e=>(0,eB.jsxs)("div",{className:"w-full flex flex-row items-center gap-1.5",children:[(0,eB.jsx)("input",{className:"flex-1 w-full h-full text-sm font-medium text-text-dark pr-1 transfer placeholder:!text-text-light placeholder:!font-normal",type:"text",value:(0,tJ.Z1)(i,n),placeholder:3===g.id?a("home.withdraw_amount_hint2",{amount:(0,eY.tu)(.01)}):a("home.withdraw_amount_hint",{amount:(0,eY.tu)((null==s?void 0:s.wallets[0].depositMinAmount)||1)}),onChange:e=>(e=>{if(c)return;let t=(0,tJ.Mr)(e,{locale:n,maxDecimalPlaces:k(),maxLength:12});null!==t&&o(t)})(e.target.value)}),(0,eB.jsx)("img",{className:"w-5 h-5 ml-auto",src:e.icon,alt:""}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]}),dropdownIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current"}),collapseIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current rotate-180"}),pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full h-9","!flex !justify-start")}),input:()=>({className:(0,to.xW)("!pl-[9px] !pr-0")}),itemLabel:()=>({className:(0,to.xW)("w-full")}),panel:()=>({className:(0,to.xW)("!mt-1")}),wrapper:{className:"!bg-segment-background"}}})}),(0,eB.jsx)("span",{className:"w-full h-[14px] mt-2 text-[#E43C5A] text-xs font-normal ".concat(C?"visible":"invisible"),children:C}),(0,eB.jsxs)("div",{className:"w-full flex items-center justify-between mt-3 text-xs",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light",children:a("assets.available_balance")}),(0,eB.jsxs)("div",{className:"flex items-center text-[14px] whitespace-pre-wrap gap-0.5",children:[(0,eB.jsx)("span",{className:"text-text-dark font-semibold",children:"".concat(E(A())," ").concat(g.name)}),(0,eB.jsx)("span",{className:"text-main-color font-semibold cursor-pointer",onClick:()=>{let e=y(A());o(e),(0,e9.$s)(e9.fq,{available_balance:(0,eY.Pj)(Number(e))})},children:a("trade.max")})]})]}),(0,eB.jsxs)("div",{className:"mt-4 flex flex-row items-center px-3.5 py-1.5 rounded-[8px] text-xs w-full border border-dialog-input-background mb-0",children:[(0,eB.jsx)(tU,{className:"w-3 shrink-0"}),(0,eB.jsx)("div",{className:"text-xs ml-1.5 text-text-light",children:(0,eB.jsx)(ez.x6,{i18nKey:"trade.deposit_shield_info",components:{black:(0,eB.jsx)("span",{className:"text-text-dark font-bold"})}})})]}),(0,eB.jsxs)("div",{className:"w-full mt-4 relative mb-3 md:mb-0",children:[(0,eB.jsx)(eT.$,{className:"w-full main-button !border-none
1!text-[14px] !h-10 !rounded-[10px]",rounded:!0,label:a("trade.pay"),onClick:()=>{if(!c){if((0,e9.$s)(e9.Lm,{amount:(0,eY.Pj)(Number(i))}),!(()=>{switch(g.id){case 1:return v.availableUsdc;case 2:return v.availableUsdt;case 3:return v.availableSol;default:return!1}})())return void(0,eV.P0)("error",a("trade.deposit_not_available_toast",{amount:(()=>{switch(p){case"bsc":return"BNB";case"monad":return"MON";case"sui":return"SUI";default:return"SOL"}})()}),eV.KW);d(!0),(()=>{if(!s)return;let e={symbol:g.name,amount:i,address:null==s?void 0:s.accountAddress,chain:p};(0,eH.lU)(e).then(e=>{e&&D(e)}).catch(()=>{d(!1)})})()}},disabled:!i||(()=>{let e=Number(i);return 3===g.id?e<.01:e<((null==s?void 0:s.wallets[0].depositMinAmount)||1)})()||Number(i)>A()||c}),c?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})},t1=e=>{let{onlyNormalDeposit:t=!1}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),r=[{name:l("trade.quick_deposit"),value:"quick"},{name:l("trade.normal_deposit"),value:"normal"}],s=[{hint01:l("trade.deposit_sol_hint01"),hint02:l("trade.deposit_sol_hint02")},{hint01:l("trade.deposit_usd_hint01"),hint02:l("trade.deposit_usd_hint02")}],n=(0,eU.useRef)(0),i=(0,eU.useRef)(1),o=(0,eU.useRef)(1),[c,d]=(0,eU.useState)(1),[x,m]=(0,eU.useState)(+!!t),[u,p]=(0,eU.useState)(!1);(0,eU.useEffect)(()=>{(0,e9.$s)(e9.MD),(0,eH.r3)()},[]);let f=(0,eG.kH)(e=>e.depositRemindStatus);return(0,eU.useEffect)(()=>{"processing"===f&&a()},[f,a]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[420px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{text:l("home.deposit")}),!t&&(0,eB.jsx)("div",{className:"w-full p-1 border border-dialog-input-background flex items-center rounded-lg mt-4",children:(0,eB.jsx)("div",{className:"flex w-full h-[30px] rounded-md",children:r.map((e,t)=>(0,eB.jsxs)("div",{onClick:()=>(e=>{m(e),n.current=e,0===e?((0,e9.$s)(e9.CB),d(i.current)):((0,e9.$s)(e9.mH),d(o.current))})(t),className:"cursor-pointer flex items-center justify-center text-sm flex-1 rounded-[4px] ".concat(x===t?"text-text-dark font-semibold bg-dialog-cancel-background":"text-text-light bg-transparent"),children:[0===t&&(0,eB.jsx)(tB,{className:"text-dark fill-current"}),e.name]},t))})}),!t&&(0,eB.jsx)("div",{className:"w-full ".concat(0===x?"block":"hidden"),children:(0,eB.jsx)(t0,{handleChooseDeposit:e=>{i.current=e,d(e)}})}),(0,eB.jsx)("div",{className:"w-full ".concat(1===x?"block":"hidden"),children:(0,eB.jsx)(tq,{handleChooseDeposit:e=>{o.current=e,d(e)}})}),(0,eB.jsxs)("div",{className:"mt-0 md:mt-2.5 flex flex-col px-4 py-1 rounded-[8px] w-full border border-dialog-input-background mb-2 md:mb-0",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center",onClick:()=>{p(!u)},children:[(0,eB.jsx)("img",{className:"inset-0 w-3 h-3",width:12,height:12,src:tM,alt:""}),(0,eB.jsx)("span",{className:"text-text-light text-xs py-1 ml-1.5",children:"".concat(s[c].hint01)}),(0,eB.jsx)(tL.A,{className:"demo-mode-tip0 ml-1.5"}),(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light ml-auto fill-current ".concat(u?"rotate-180":"")}),(0,eB.jsx)(e8.m,{target:".demo-mode-tip0",position:"top",content:l("trade.deposit_hint_tips0"),pt:{root:{className:"w-[200px]"}}})]}),u&&(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center",children:[(0,eB.jsx)("img",{className:"inset-0 w-3 h-3",width:12,height:12,src:tO,alt:""}),(0,eB.jsx)("span",{className:"text-text-light text-xs py-1 ml-1.5",children:"".concat(s[c].hint02)}),(0,eB.jsx)(tL.A,{className:"demo-mode-tip1 ml-1.5"}),(0,eB.jsx)(e8.m,{target:".demo-mode-tip1",position:"top",content:l("trade.deposit_hint_tips1"),pt:{root:{className:"w-[200px]"}}})]}),(0,eB.jsxs)("div",{className:"flex flex-row items-center",children:[(0,eB.jsx)("img",{className:"inset-0 w-3 h-3",width:12,height:12,src:tR,alt:""}),(0,eB.jsx)("span",{className:"text-text-light text-xs py-1 ml-1.5",children:l("trade.deposit_hint03")})]})]})]})]})};var t2=l(87671),t5=l(58205);function t3(){return(t3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let t6=function(e){return eU.createElement("svg",t3({xmlns:"http://www.w3.org/2000/svg",width:10,height:11,fill:"none"}
1,e),d||(d=eU.createElement("g",{clipPath:"url(#ic_delete_svg__a)"},eU.createElement("path",{fill:"gray",d:"M6.5.75a.5.5 0 0 1 .5.5v.5h2.68c.111 0 .151.012.192.034q.061.032.095.094c.021.04.033.081.033.193v.358c0 .112-.011.152-.034.193a.23.23 0 0 1-.094.095c-.04.022-.081.033-.192.033H9v7.5a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-7.5H.32c-.111 0-.151-.011-.192-.034a.23.23 0 0 1-.094-.094C.01 2.582 0 2.541 0 2.43v-.36c0-.111.012-.151.034-.192a.23.23 0 0 1 .094-.094c.04-.022.081-.034.193-.034H3v-.5a.5.5 0 0 1 .5-.5zm1.5 2H2v7h6zm-3.75 1.5a.25.25 0 0 1 .25.25V8a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 3.5 8V4.5a.25.25 0 0 1 .25-.25zm2 0a.25.25 0 0 1 .25.25V8a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5.5 8V4.5a.25.25 0 0 1 .25-.25z"}))),x||(x=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_delete_svg__a"},eU.createElement("path",{fill:"#fff",d:"M0 .75h10v10H0z"})))))};function t4(){return(t4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let t7=function(e){return eU.createElement("svg",t4({xmlns:"http://www.w3.org/2000/svg",width:10,height:10,fill:"none"},e),m||(m=eU.createElement("g",{clipPath:"url(#ic_edit_svg__a)"},eU.createElement("path",{fill:"#2ebd85",d:"M6.647 4.42 5.47 3.24 1.228 7.483.933 8.955l1.473-.295zm.884-3.241L6.058 2.652 7.237 3.83 8.71 2.357zm-4.535 8.07-.093.08a.8.8 0 0 1-.333.149l-1.473.294-.109.015A.835.835 0 0 1 .101 8.9l.015-.108.295-1.473a.8.8 0 0 1 .148-.334l.08-.092L6.942.589a.833.833 0 0 1 1.179 0l1.178 1.179a.833.833 0 0 1 0 1.178z"}))),u||(u=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_edit_svg__a"},eU.createElement("path",{d:"M0 0h10v10H0z"})))))},t8=e=>{let{category:t,positionId:l,callback:a}=e,{t:r}=(0,ez.Bd)(),s=(0,tl.WG)(e=>{var t;return null!=(t=e.positionList.find(e=>e.positionId===l))?t:eH.OS}),{hideDialog:n}=rZ(),[i,o]=(0,eU.useState)(t),c=[r("trade.limit_orders"),r("trade.position_tp_sl")],d=()=>(0,eB.jsx)("div",{className:"flex flex-col items-center justify-center text-text-light text-xs",children:r("trade.no_open_orders")}),x=e=>{let t=(e.triggerPrice-s.entryPrice)*Number(s.quantity),l=Number((100*t/(s.entryPrice*Number(e.quantity)/Number(s.leverage))).toFixed(2));return(0,eB.jsx)("div",{className:"flex ".concat(t<0?"text-[#E43C5A]":"text-[#2ebd85]"),children:"".concat((0,eY.hE)(t)," USD (").concat((0,eY.wd)(l),"%)")})},m=e=>(0,eB.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,eY.HD)(e.quantity))});return(0,eU.useEffect)(()=>{s&&0!==s.positionId||n()},[s,n]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-[16px] pt-3 w-[calc(100vw-60px)] md:w-[518px] flex flex-col pb-4",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full pb-2.5 relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-lg text-text-dark font-medium text-center",children:r("trade.open_order_tpsl_title")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer w-6 h-6 mr-2.5 absolute right-0 top-0.5",onClick:()=>n(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-row text-text-dark px-4.5 items-center",children:[(0,eB.jsx)("span",{className:"font-medium",children:"".concat(s.name," ").concat(s.symbol)}),(0,eB.jsx)("span",{className:"ml-[6px] text-xs px-[6px] py-[2px] h-fit roun
1ded-sm ".concat("long"===s.positionSide?"text-[#2EBD85] bg-[#2ebd851A]":"text-[#E43C5A] bg-[#E43C5A1A]"),children:r("long"===s.positionSide?"trade.long":"trade.short")}),(0,eB.jsx)("span",{className:"ml-[6px] text-xs px-[6px] py-[2px] h-fit rounded-sm bg-dialog-input-background",children:"".concat(s.leverage,"x")})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-row mt-3 px-4.5",children:[(0,eB.jsxs)("div",{className:"w-[134px]",children:[(0,eB.jsx)("div",{className:"text-text-light text-sm",children:r("trade.enter_price")}),(0,eB.jsx)("div",{className:"text-text-dark font-medium",children:(0,eY.hE)(s.entryPrice)})]}),(0,eB.jsxs)("div",{className:"",children:[(0,eB.jsx)("div",{className:"text-text-light text-sm",children:r("trade.current_price")}),(0,eB.jsx)("div",{className:"text-text-dark font-medium",children:(0,eY.hE)(s.marketPrice)})]})]}),(0,eB.jsx)("div",{className:"flex items-center border-b border-panel-border-color mt-8 mx-4.5 gap-4",children:c.map((e,t)=>(0,eB.jsxs)("div",{className:"pb-2.5 flex justify-center relative text-base cursor-pointer",onClick:()=>(e=>{e!==i&&o(e)})(t),children:[(0,eB.jsx)("span",{className:"text-sm ".concat(i===t?"text-text-dark font-medium":"text-text-light font-normal"),children:0===t&&s.limitList.length>0?"".concat(e,"(").concat(s.limitList.length,")"):e}),i===t&&(0,eB.jsx)("div",{className:"w-full h-0.5 bg-text-dark absolute bottom-0"})]},e))}),(0,eB.jsxs)("div",{className:"flex flex-row mt-4 mx-4.5 text-text-light text-sm",children:[(0,eB.jsx)("div",{className:"flex-1",children:r("trade.order_actions")}),0===i&&(0,eB.jsxs)("div",{className:"flex flex-row text-text-dark text-xs gap-2.5",children:[(0,eB.jsx)("div",{className:"bg-dialog-border-color rounded-[6px] px-3 py-1 cursor-pointer",onClick:()=>void(0,eH.Qh)("").then(()=>{(0,eV.P0)("success",r("trade.open_order_cancel_success"))}).catch(()=>{}),children:r("trade.cancel_all")}),(0,eB.jsx)("div",{className:"bg-[#1A91F3] rounded-[6px] px-3 py-1 cursor-pointer text-white",onClick:()=>void(n(),a(0,0)),children:r("trade.add_more")})]})]}),0===i&&(0,eB.jsx)("div",{className:"w-full cus-table mt-3",children:(0,eB.jsxs)(t5.b,{value:s.limitList,emptyMessage:d,children:[(0,eB.jsx)(t2.V,{body:e=>(0,eB.jsx)("div",{className:"flex ml-4.5 text-text-dark",children:"".concat((0,eY.hE)(e.triggerPrice))}),header:r("trade.trigger_price"),style:{width:"25%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-sm !p-0"})}}),(0,eB.jsx)(t2.V,{body:x,header:r("trade.est_pnl"),pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-sm !py-1"})}}),(0,eB.jsx)(t2.V,{body:m,header:r("trade.size"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-sm !py-1"})}}),(0,eB.jsx)(t2.V,{body:e=>(0,eB.jsx)("div",{className:"flex text-text-dark",onClick:()=>{var t;return t=e,void(0,eH.Qh)(t.orderId).then(()=>{(0,eV.P0)("success",r("trade.open_order_cancel_success"))}).catch(()=>{})},children:(0,eB.jsx)(t6,{className:"w-3 h-3 ml-1.5"})}),header:r("trade.action"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-[10px] !py-1"})}})]})}),1===i&&(0,eB.jsx)("div",{className:"w-full cus-table mt-3",children:(0,eB.jsxs)(t5.b,{value:s.takeProfitStopLossOrders,emptyMessage:d,children:[(0,eB.jsx)(t2.V,{body:e=>(0,eB.jsx)("div",{className:"flex ml-4.5 text-text-dark",children:"".concat((0,eY.hE)(e.triggerPrice),"(").concat("take_profit_market"===e.type?r("trade.tp"):r("trade.sl"),")")}),header:r("trade.trigger_price"),style:{width:"25%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-sm !p-0"})}}),(0,eB.jsx)(t2.V,{body:x,header:r("trade.est_pnl"),pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-sm !py-2"})}}),(0,eB.jsx)(t2.V,{body:m,header:r("trade.size"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-sm !py-2"})}}),(0,eB.jsx)(t2.V,{body:e=>{let t=+("take_profit_market"!==e.type);return(0,eB.jsx)("div",{className:"flex text-text-dark",onClick:()=>{var e;return e=t,void(n(),a(1,e))},children:(0,eB.jsx)(t7,{className:"w-3 h-3 ml-1.5"})})},header:r("trade.action"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-sm font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-[10px] !py-2"})}})]})})]})};var t9=l(75555);let le=e=>{let{data:t}=e,{t:l}=(0,ez.Bd)();return(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"w-full flex flex-row text-text-dark mt-4 items-center",children:[(0,eB.jsx)("span",{className:"font-medium",children:"".concat(t.name," ").concat(t.symbol)}),(0,eB.jsx)("span",{className:"ml-[6px] text-xs px-[6px] py-[2px] h-fit roun
1ded-sm ".concat("long"===t.positionSide?"text-[#2EBD85] bg-[#2ebd8526]":"text-[#E43C5A] bg-[#E43C5A26]"),children:l("long"===t.positionSide?"trade.long":"trade.short")}),(0,eB.jsx)("span",{className:"ml-[6px] text-xs px-[6px] py-[2px] h-fit rounded-sm bg-dialog-input-background",children:"".concat(t.leverage,"x")})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-row mt-4",children:[(0,eB.jsxs)("div",{className:"w-[134px]",children:[(0,eB.jsx)("div",{className:"text-text-light text-sm",children:l("trade.enter_price")}),(0,eB.jsx)("div",{className:"text-text-dark font-medium",children:(0,eY.hE)((0,eY.Ik)(t.positionSide,t.entryPrice,0),t.pricePrecision)})]}),(0,eB.jsxs)("div",{className:"",children:[(0,eB.jsx)("div",{className:"text-text-light text-sm",children:l("trade.current_rate")}),(0,eB.jsx)("div",{className:"text-text-dark font-medium",children:(0,eY.hE)(t.marketPrice,t.pricePrecision||2,!0,"round")})]})]})]})};var lt=l(23682);let ll=e=>{let{type:t,positionId:l,callback:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s}=rZ(),n=(0,tl.WG)(e=>{var t;return null!=(t=e.positionList.find(e=>e.positionId===l))?t:eH.OS}),[i,o]=(0,eU.useState)(!1),c=[r("trade.open_order_edit_tp_title"),r("trade.open_order_edit_sl_title")][t],[d,x]=(0,eU.useState)(0),[m,u]=(0,eU.useState)(0),p=e=>{e||(0,e9.$s)(e9.n5),s(),a(e)};return(0,eU.useEffect)(()=>{n&&0!==n.positionId||s()},[n,s]),(0,eB.jsxs)(e$,{className:"rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[518px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{text:c}),(0,eB.jsx)(le,{data:n}),(0,eB.jsx)("div",{className:"w-full",children:(0,eB.jsx)("div",{className:"w-full h-[1px] border-t border-dialog-border-color mt-4"})}),0===t&&(0,eB.jsx)("div",{className:"w-full mt-4",children:(0,eB.jsx)(t9.A,{value:(()=>{let e=n.takeProfitStopLossOrders.find(e=>"take_profit_market"===e.type);return e?Number((0,eQ.ez)(e.takeProfitRate,100)):0})(),fromDialog:!0,onChange:e=>{x(""===e?0:Number(e))},selectSegment:+("long"!==n.positionSide),leverage:Number(n.leverage),price:"".concat(n.entryPrice),estimatedProfitAndLossValue:"".concat(n.margin),spread:n.spread,tokenDecimal:n.pricePrecision||2})}),0===t&&(0,eB.jsx)("div",{className:"w-full mt-4",children:(0,eB.jsx)(lt.A,{value:(()=>{let e=n.takeProfitStopLossOrders.find(e=>"stop_market"===e.type);return e?Number((0,eQ.ez)(e.stopLossRate,100)):0})(),fromDialog:!0,onChange:e=>{u(""===e?0:Number(e))},selectSegment:+("long"!==n.positionSide),leverage:Number(n.leverage),price:"".concat(n.entryPrice),estimatedProfitAndLossValue:"".concat(n.margin),spread:n.spread,tokenDecimal:n.pricePrecision||2,marginMode:n.marginMode})}),(0,eB.jsxs)("div",{className:"w-full mt-8 flex flex-row gap-2.5",children:[(0,eB.jsx)("div",{className:"w-full flex-1 relative",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-withdraw-button-color !border-none !text-text-dark !text-[14px] !h-10 !rounded-lg",rounded:!0,label:r("trade.cancel"),onClick:()=>p(!1)})}),(0,eB.jsxs)("div",{className:"w-full flex-1 relative",children:[(0,eB.jsx)(eT.$,{className:"w-full main-button !border-none !text-[14px] !h-10 !rounded-lg",rounded:!0,disabled:d<0||m<0||i,label:r("trade.save"),onClick:()=>{(0,e9.$s)(e9.ql),(()=>{let e,l;o(!0),0===t&&(e=d/100,l=m/100);let a={positionId:n.positionId,takeProfitRate:e};m>=0&&(a.stopLossRate=l),(0,eH.lx)(a).then(()=>{(0,eG.xJ)(),p(!0),(0,eV.P0)("success",r("trade.edit_tp_sl_success"))}).finally(()=>{o(!1)})})()}}),i?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]}),(0,eB.jsx)("span",{className:"w-full text-center text-text-light text-xs mt-4 mb-2 md:mb-0",children:r("trade.open_order_edit_hint1")})]})};function la(){return(la=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lr=function(e){return eU.createElement("svg",la({xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none"},e),p||(p=eU.createElement("circle",{cx:28,cy:28,r:28,fill:"#000"})),f||(f=eU.createElement("path",{fill:"#fff",d:"M32.061 23.312h-8.094a.627.627 0 0 0-.625.625v8.094c0 .344.282.626.625.626h8.094a.63.63 0 0 0 .626-.
1626v-8.093a.627.627 0 0 0-.626-.626M22.72 14h-8.095a.627.627 0 0 0-.625.625v8.094c0 .344.282.625.625.625h8.095a.627.627 0 0 0 .625-.625v-8.094A.63.63 0 0 0 22.72 14M41.376 14h-8.094a.627.627 0 0 0-.626.625v8.094c0 .344.282.625.626.625h8.094A.627.627 0 0 0 42 22.72v-8.094a.627.627 0 0 0-.625-.625M22.72 32.624h-8.095a.63.63 0 0 0-.625.626v8.093c0 .344.282.626.625.626h8.095a.627.627 0 0 0 .625-.626V33.25a.63.63 0 0 0-.625-.626M41.376 32.624h-8.094a.63.63 0 0 0-.626.626v8.093c0 .344.282.626.626.626h8.094a.627.627 0 0 0 .625-.626V33.25a.63.63 0 0 0-.625-.626"})))};function ls(){return(ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let ln=function(e){return eU.createElement("svg",ls({xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none"},e),h||(h=eU.createElement("circle",{cx:28,cy:28,r:28,fill:"#AB9FF2"})),g||(g=eU.createElement("path",{fill:"#FFFDF8",fillRule:"evenodd",d:"M24.137 36.391c-2.199 3.37-5.883 7.633-10.786 7.633-2.318 0-4.546-.954-4.546-5.098 0-10.555 14.41-26.895 27.782-26.895 7.606 0 10.637 5.278 10.637 11.27 0 7.694-4.992 16.49-9.954 16.49-1.575 0-2.347-.865-2.347-2.237q0-.536.178-1.163c-1.694 2.892-4.962 5.576-8.023 5.576-2.228 0-3.357-1.401-3.357-3.37 0-.715.148-1.46.416-2.206m18.067-13.297c0 1.746-1.03 2.62-2.183 2.62-1.17 0-2.183-.874-2.183-2.62 0-1.747 1.013-2.62 2.183-2.62 1.152 0 2.183.874 2.183 2.62m-6.55 0c0 1.746-1.03 2.62-2.182 2.62-1.17 0-2.183-.874-2.183-2.62s1.013-2.62 2.183-2.62c1.152 0 2.183.874 2.183 2.62",clipRule:"evenodd"})))},li=e=>{let{walletName:t}=e,{showSelectWalletDialog:l,hideDialog:a}=rZ(),{t:r}=(0,ez.Bd)(),s=[{name:"Phantom",id:1,image:(0,eB.jsx)(ln,{className:"w-14 h-14"}),downloadUrl:"https://phantom.com/download",walletName:"Phantom"},{name:"OKX",id:2,image:(0,eB.jsx)(lr,{className:"w-14 h-14"}),downloadUrl:"https://web3.okx.com",walletName:"OKX Wallet"}].filter(e=>e.walletName===t)[0],n=()=>{a(),l()};return(0,eB.jsxs)(e$,{className:"px-6 bg-dialog-background rounded-t-2xl md:rounded-2xl pt-6 pb-10 w-screen md:w-[408px] flex flex-col items-center",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-base text-text-dark font-semibold",children:r("home.connect_wallet")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>n(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col items-center w-full",children:[(0,eB.jsx)("div",{className:"mt-8",children:s.image}),(0,eB.jsx)("span",{className:"w-[274px] text-sm text-text-light text-center mt-4",children:r("trade.install_wallet_hint")}),(0,eB.jsx)("span",{className:"w-full h-[52px] bg-dialog-border-color rounded-[10px] text-center leading-[52px] text-text-dark text-sm mt-8 cursor-pointer",onClick:n,children:r("trade.change_wallet")}),(0,eB.jsx)("span",{className:"w-full h-[52px] bg-[#1A91F3] rounded-[10px] text-center leading-[52px] text-white text-sm mt-2.5 cursor-pointer",onClick:()=>{window.open(s.downloadUrl,"_blank")},children:r("trade.install_wallet",{walletName:s.walletName})})]})]})};var lo=l(66693);let lc=l.p+"static/media/ic_join_group_bg.60771adc.svg",ld=l.p+"static/media/ic_join_group_bg_moblie.9831f77c.svg",lx=l.p+"static/media/ic_join_group_close.48e458fa.svg",lm={src:"/_next/static/media/ic_join_group_coin.880b6d05.webp",height:458,width:566,blurDataURL:"data:image/webp;base64,UklGRrIAAABXRUJQVlA4WAoAAAAQAAAABwAABQAAQUxQSDEAAAAAAAAAYyAJAAAAAGH04vQtIQAaiJfw6FgJAFf/+///WwIDHLz//9soDAABDUyIFQoAAFZQOCBaAAAA8AEAnQEqCAAGAAJAOCWMAnQBDvHqvMAAAP7tCTCW/4Wmgfjyz37/J378Gy2S+GNi8aRN+YcxfQMNs4CaG9o6lWsdR4iyUvbFSSysTn+SYlw+VB5dGu5nUAAA",blurWidth:8,blurHeight:6},lu={src:"/_next/static/media/ic_join_group_coin_mobile.06d49bee.webp",height:338,width:416,blurDataURL:"data:image/webp;base64,UklGRrgAAABXRUJQVlA4WAoAAAAQAAAABwAABgAAQUxQSDkAAAAAAAKRZgYgAAAEbfL1580kLQ2L1f3/yycYrOWP5e7oMACV//////81CR7u////lg0EBiVyvYMIEQAAVlA4IFgAAADQAQCdASoIAAcAAkA4JQBOgCPQOwamgAD+5vgyN2MYkEku2ueXw4xKXuLoSfMdufXfFXHlfIeIxJ/mlWjMUEnNSP7A7YqQiY1pm+UaHb9ean4F78iezZAA",blurWidth:8,blurHeight:7},lp=l.p+"static/media/ic_join_group_tg.7cd84103.svg";var lf=l(83548);let lh=()=>{let{t:e}=(0,ez.Bd)(),t=(0,lf.l)(e=>e.isMobile),{hideDialog:l}=rZ();return(0,eB.jsxs)(e$,{className:"bg-[#070808] rounded-[16px] w-[345px] md:w-[528px] flex flex-col items-center pb-17 md:pb-8",children:[t?(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsx)("img",{className:"absolute",src:ld,alt:""}),(0,eB.jsx)(lo.default,{className:"w-[200px] h-[180px] absolute right-0 bottom-2",src:lu,alt:""})]}):(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsx)("img",{className:"absolute",src:lc,alt:""}),(0,eB.jsx)(lo.default,{className:"w-[283px] h-[229px] absolute right-0 bottom-6",src:lm,alt:""})]}),(0,eB.jsxs)("div",{className:"relative flex flex-col w-full py-5 pl-5 md:pl-8 pr-5",children:[(0,eB.jsx)("img",{className:"z-10 ml-auto cursor-pointer",src:lx,alt:"",onClick:l}),(0,eB.jsxs)("div",{className:"flex flex-col",children:[(0,eB.jsxs)("div",{className:"flex flex-col items-baseline -mt-5",children:[(0,eB.jsx)("span",{className:"text-[56px] md:text-[64px] font-bold text-transparent bg-clip-text bg-gradient-to-r from-[#F5C064] via-[#FFECDC] to-[#F5C064] bg-[length:200%_100%_100%] text-center",children:e("trade.bonus_500u")}),(0,eB.jsx)("span",{className:"text-[24px] md:text-[28px] text-white font-medium ",children:e("trade.weekly_bonus")})]}),(0,eB.jsx)("span",{className:"text-[16px] text-white mt-2 whitespace-pre-line",children:e("trade.join_group_sub_title_new1")})]}),(0,eB.jsx)("div",{className:"flex justify-center w-fit px-3 md:px-0 md:w-[176px] h-10 bg-[#1A91F3] cursor-pointer rounded-[10px] mt-12 mb-4 md:mb-0",onClick:()=>{window.open(e3.Us),l()},children:(0,eB.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eB.jsx)("img",{className:"w-[18px] h-[15px]",src:lp,alt:""}),(0,eB.jsx)("span",{className:"text-white text-[14px] font-medium text-center",children:e("trade.join_group_join_now")})]})})]})]})};function lg(){return(lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lb=function(e){return eU.createElement("svg",lg({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),b||(b=eU.createElement("circle",{cx:12,cy:12,r:12,fill:"#fff",fillOpacity:.06})),v||(v=eU.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.75,d:"M8 12h9M11.5 7.5 7 12l4.5 4.5"})))};function lv(){return(lv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lw=function(e){return eU.createElement("svg",lv({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),w||(w=eU.createElement("path",{d:"M9.138 8.195a.667.667 0 1 0-.943.943L11.057 12l-2.862 2.862a.667.667 0 1 0 .943.943L12 12.943l2.862 2.862a.667.667 0 1 0 .943-.943L12.943 12l2.862-2.862a.667.667 0 1 0-.943-.943L12 11.057z"})))}
1,lj=function(e){let{className:t,title:l,onBack:a,onCancel:r}=e;return(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full ".concat(t),children:[a&&(0,eB.jsx)(lb,{className:"w-6 h-6 mr-auto cursor-pointer text-text-dark fill-current",onClick:a}),l&&(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold text-center",children:l}),r&&(0,eB.jsx)(lw,{className:"ml-auto w-6 h-6 cursor-pointer text-text-dark fill-current",onClick:r})]})},lN=()=>{let{showSelectWalletDialog:e,hideDialog:t}=rZ();return(0,eB.jsxs)(e$,{className:"px-5 bg-main-background rounded-[24px] pt-6 pb-10 w-screen md:w-[360px] flex flex-col items-center ",children:[(0,eB.jsx)(lj,{onCancel:()=>t()}),(0,eB.jsx)("span",{className:"text-2xl text-black font-[600] mt-6",children:"Welcome"}),(0,eB.jsx)("div",{className:"bg-main-background border-solid border border-b-normal rounded-[24px] w-full flex justify-center items-center py-2.5 mb-4 cursor-pointer hover:bg-b-hover",onClick:()=>void((0,eG.Xc)(),t(),e()),children:(0,eB.jsx)("span",{className:"text-black text-14px font-[400]",children:"Continue with a wallet"})})]})};var l_=l(32590),lk=l(13434),ly=l(96180),lE=l(69760);function lA(){return(lA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lC=function(e){return eU.createElement("svg",lA({xmlns:"http://www.w3.org/2000/svg",width:96,height:96,fill:"none"},e),j||(j=eU.createElement("circle",{cx:48,cy:48,r:46,stroke:"#EDBE18",strokeOpacity:.2,strokeWidth:4})),N||(N=eU.createElement("path",{stroke:"#EDBE18",strokeWidth:4,d:"M2 48c0 25.405 20.595 46 46 46s46-20.595 46-46S73.405 2 48 2"})))};function lS(){return(lS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lD=function(e){return eU.createElement("svg",lS({xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none"},e),eU.createElement("mask",{id:"ic_more_wallet_svg__a",width:56,height:56,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},_||(_=eU.createElement("path",{fill:"#fff",d:"M0 28c0 15.464 12.536 28 28 28s28-12.536 28-28S43.464 0 28 0 0 12.536 0 28"}))),k||(k=eU.createElement("g",{mask:"url(#ic_more_wallet_svg__a)"},eU.createElement("path",{fill:"#212529",d:"M43.979 0H12.021C5.382 0 0 5.382 0 12.021v31.958C0 50.618 5.382 56 12.021 56h31.958C50.618 56 56 50.618 56 43.979V12.021C56 5.382 50.618 0 43.979 0"}),eU.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M39.898 27.666h-3.59c-1.898 0-3.308 1.412-3.308 3s1.41 3 3.308 3h3.59l.033-.001c.274-.017.393-.202.402-.314v-5.37c-.01-.112-.128-.297-.402-.314zm-.098-2q.133-.001.252.005c1.162.07 2.19.947 2.276 2.17.005.081.005.168.005.248v5.154c0 .08 0 .167-.005.247-.087 1.224-1.114 2.1-2.276 2.171q-.119.006-.252.005h-3.492c-2.86 0-5.308-2.17-5.308-5s2.447-5 5.308-5H39.8",clipRule:"evenodd"}),eU.createElement("path",{fill:"#fff",d:"M37.335 30.667a1.333 1.333 0 1 1-2.667 0 1.333 1.333 0 0 1 2.667 0"}),eU.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M39.801 25.667q.134-.001.252.004c.301.019.593.09.861.21-.142-2.143-.535-3.794-1.768-5.026-.998-.998-2.263-1.44-3.826-1.65l-.056-.008-.043-.03-4.981-3.303a5.32 5.32 0 0 0-5.81 0l-4.981 3.303-.043.03-.057.007c-1.563.21-2.828.653-3.826 1.651s-1.44 2.263-1.65 3.826c-.205 1.52-.205 3.46-.205 5.91v.15c0 2.451 0 4.392.204 5.911.21 1.563.653 2.828 1.651 3.826s2.263 1.44 3.826 1.651c1.52.204 3.46.204 5.91.204h4.15c2.451 0 4.392 0 5.911-.204 1.563-.21 2.828-.653 3.826-1.65 1.233-1.233 1.626-2.884 1.768-5.026-.268.118-.56.19-.86.209q-.119.006-.253.005h-.909c-.152 1.788-.495 2.733-1.16 3.397-.564.564-1.337.903-2.678 1.083-1.37.184-3.177.186-5.72.186h-4c-2.542 0-4.348-.002-5.718-.186-1.342-.18-2.115-.519-2.679-1.083s-.902-1.337-1.083-2.678c-.184-1.37-.186-3.177-.186-5.72s.002-4.348.186-5.718c.18-1.342.519-2.114 1.083-2.679.564-.564 1.337-.902 2.679-1.083 1.37-.184 3.176-.186 5.719-.186h4c2.542 0 4.348.002 5.719.186 1.34.18 2.114.519 2.678 1.083.665.665 1.008 1.61 1.16 3.398h.909M25.26 19h4.15q1.034-.001 1.948.005l-2.222-1.474a3.32 3.32 0 0 0-3.6 0l-2.223 1.474q.915-.006 1.947-.
1005",clipRule:"evenodd"}),eU.createElement("path",{fill:"#fff",d:"M20 24.334a1 1 0 1 0 0 2h5.333a1 1 0 1 0 0-2z"}),eU.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M37.335 30.667a1.333 1.333 0 1 1-2.667 0 1.333 1.333 0 0 1 2.667 0",clipRule:"evenodd"}))))};var lP=l(96788);let lM=()=>(0,lP.d)().get().filter(e=>e.chains.some(e=>e.startsWith("sui:"))).map(e=>({id:e.name,name:e.name,icon:e.icon}));function lO(e){let{wallets:t}=(0,tZ.v)(),[l,a]=(0,eU.useReducer)((e,t)=>t,[],lM),[r,s]=(0,eU.useReducer)((e,t)=>t,[]);(0,eU.useEffect)(()=>{let e=(0,lP.d)(),t=()=>a(lM());t();let l=e.on("register",t),r=e.on("unregister",t);return()=>{l(),r()}},[]),(0,eU.useEffect)(()=>{if("eip155"!==e)return;let t=new Map,l=()=>{s(t.size>0?[...t.values()]:(()=>{if(!window.ethereum)return[];let e=window.ethereum,t=e.isMetaMask?"MetaMask":e.isOkxWallet?"OKX Wallet":e.isTrust?"Trust Wallet":"Browser Wallet";return[{id:t.toLowerCase(),name:t,icon:""}]})())},a=e=>{let a=e.detail;(null==a?void 0:a.info)&&(t.set(a.info.uuid,{id:a.info.rdns,name:a.info.name,icon:a.info.icon}),l())};return window.addEventListener("eip6963:announceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),l(),()=>window.removeEventListener("eip6963:announceProvider",a)},[e]);let n=(0,eU.useMemo)(()=>t.filter(e=>!["Trust Wallet","Trust"].includes(e.adapter.name)).map(e=>({id:e.adapter.name,name:e.adapter.name,icon:e.adapter.icon})),[t]);return"sui"===e?l:"eip155"===e?r:n}let lR={okx:"okx",okxwallet:"okx",phantom:"phantom",solflare:"solflare",trust:"trust",metamask:"metamask",binance:"binance",binancewallet:"binance",trustwallet:"trust"},lL=e=>{let{walletName:t,chainNamespace:l,chain:a}=e,{t:r}=(0,ez.Bd)(),s=lO(l).find(e=>e.name===t),{showSelectWalletDialog:n,hideDialog:i}=rZ(),[o,c]=(0,eU.useState)("0"),d=(0,e2.useSearchParams)(),[x,m]=(0,eU.useState)(!1),{disconnect:u}=(0,tK.uP)(),p=(0,tK.G8)({namespace:"solana"}),f=(0,tK.G8)({namespace:"eip155"}),h=(0,tK.G8)({namespace:"sui"}),{walletProvider:g}=(0,tK.AX)("solana"),{walletProvider:b}=(0,tK.AX)("eip155"),{walletProvider:v}=(0,tK.AX)("sui"),w=(0,eU.useRef)(!1),j=(0,eU.useRef)(!1),N=(0,eU.useRef)(""),{connect:_,isReady:k}=(0,ly.A9)({namespace:l,onError(e){console.error("connect appkit wallet error:",e),c("2"),(0,e9.$s)(e9.C5,{error_msg:5})}});(0,eU.useEffect)(()=>{!j.current&&(k||"walletConnect"===S()&&C())&&(j.current=!0,(0,eY.Rm)("LoginLoadingDialog start....",t,l),y())},[l,k]),(0,eU.useEffect)(()=>{I(),T(),"2"===o&&u()},[o]),(0,eU.useEffect)(()=>{if("0"===o&&!w.current){if("eip155"===l&&"connected"===f.status&&f.address)return void L(f.address,E(b),"eip155");"solana"===l&&"connected"===p.status&&p.address&&L(p.address,E(g),"solana"),"sui"===l&&"connected"===h.status&&h.address&&L(h.address,E(v),"sui")}},[l,f.status,f.address,p.status,p.address,o,h.status,h.address]);let y=()=>{D()},E=e=>(null==e?void 0:e.name)||t||"Wallet",A=e=>e.toLowerCase().replaceAll(/[^a-z0-9]/g,""),C=()=>{let e=A(t);return l_.a.getConnectorsByNamespace(l).find(t=>(console.log("getLocalConnector",e,t.name,t.id),"WALLET_CONNECT"!==t.type&&(A(t.name)===e||A(t.id)===e)))},S=()=>{let e=A(t),l=lR[e];return console.log("getAppKitWallet",e,l),l||"walletConnect"},D=async()=>{try{let e=S();if("walletConnect"===e){let e=C();if(e){console.log("getLocalConnector...",e.name),await lk.g.connectExternal(e);return}}await _(e)}catch(e){console.error("connect appkit wallet error:",e),c("2"),(0,e9.$s)(e9.C5,{error_msg:5})}},P=e=>"By signing, you agree to XStable Terms of Use and Privacy Policy. Your authentication nonce is:".concat(e),M=async e=>{if(g){let t=new TextEncoder().encode(P(e));console.log("solanaWalletProvider.signMessage",g.signMessage);let l=await g.signMessage(t);return lE.A.encode(l)}},O=async(e,t)=>{if(!b)return;let l=await b.request({method:"personal_sign",params:[P(e),t]});return"string"==typeof l?l:void 0},R=async(e,t)=>{var l,a;let r=null==v||null==(l=v.features)?void 0:l["sui:signPersonalMessage"],s=null==v||null==(a=v.accounts)?void 0:a.find(e=>e.address.toLowerCase()===t.toLowerCase());if(r&&s)return(await r.signPersonalMessage({account:s,message:new TextEncoder().encode(P(e))})).signature},L=async(e,t,l)=>{let r="eip155"===l?a:l,s="".concat(r,":").concat(e);
1if(N.current!==s)try{N.current=s,w.current=!0;let a=await (0,eH.xy)({walletAddress:e,chain:r});if(a){let s="eip155"===l?await O(a.uId,e):"sui"===l?await R(a.uId,e):await M(a.uId);if(s){let l=d.get("ref");(0,eG.kM)(e,s||"",t,l,r).then(()=>{(e=>{localStorage.setItem(e3.l_,e),c("1"),(0,e9.$s)(e9.PQ,{wallet:e}),setTimeout(()=>{F(),(0,eG.l8)()},2e3)})(t)}).catch(async e=>{await u(),w.current=!1,8061===e.code||7026===e.errorCode?(N.current="",m(!0)):(c("2"),(0,e9.$s)(e9.C5,{error_msg:e.code||e.errorCode}))})}}}catch(e){(e instanceof Error?e.message:"").includes("User rejected")?console.warn("sign rejected"):console.error("sign error:",e),w.current=!1,c("2"),(0,e9.$s)(e9.C5,{error_msg:5})}};(0,eU.useEffect)(()=>{x&&(B(),m(!1))},[x]);let F=()=>{c("0"),i()},B=()=>{c("0"),w.current=!1,N.current="",y()},I=()=>"0"===o?r("home.connecting"):"1"===o?r("home.successfully_connected",{walletName:t}):r("home.connection_failed"),T=()=>"0"===o?r("home.wait_moment"):"1"===o?"":r("home.try_connecting_again");return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-5 w-screen md:w-[360px] flex flex-col items-center",children:[(0,eB.jsx)(lj,{className:"",onCancel:()=>F()}),(0,eB.jsxs)("div",{className:"relative flex justify-center items-center w-[96px] h-[96px]",children:[(0,eB.jsx)("div",{className:"absolute",children:(null==s?void 0:s.icon)?(0,eB.jsx)("img",{className:"w-14 h-14",src:s.icon,alt:s.name}):(0,eB.jsx)(lD,{className:"w-14 h-14"})}),"0"===o?(0,eB.jsx)(lC,{className:"circle-progress w-[96px] h-[96px]"}):"1"===o?(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#2EBD85] w-[96px] h-[96px]"}):(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#E43C5A] w-[96px] h-[96px]"})]}),(0,eB.jsx)("span",{className:"text-text-dark text-base mt-[14px] text-center",children:I()}),(0,eB.jsx)("span",{className:"mt-1 text-text-light text-sm text-center",children:T()}),(0,eB.jsx)("div",{className:"rounded-[12px] w-full h-[40px] mt-4 text-sm flex items-center justify-center main-button hover:opacity-80 cursor-pointer ".concat("2"===o?"":"hidden"),onClick:B,children:r("home.retry")}),(0,eB.jsx)("div",{className:"p-1 text-text-light text-xs mt-2 cursor-pointer ".concat("2"===o?"":"hidden"),onClick:()=>{F(),n()},children:r("trade.change_wallet")})]})},lF=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(!1),[i,o]=(0,eU.useState)("".concat(t.childCommissionRate)),[c,d]=(0,eU.useState)("".concat(t.parentCommissionRate)),[x,m]=(0,eU.useState)(t.remark);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl py-6 w-screen md:w-[420px] flex flex-col items-center px-4 md:px-6",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:a("partner.manage_referrals")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>r(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.wallet_address")}),(0,eB.jsx)("div",{className:"flex w-full mt-2 min-h-9.5 bg-segment-background border border-segment-background rounded-[8px] items-center p-2.5",children:(0,eB.jsx)("span",{className:"flex-1 w-full min-w-0 text-xs text-text-dark transfer break-all",children:"".concat(t.walletAddress)})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.referral_note")}),(0,eB.jsx)("div",{className:"flex w-full mt-2 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)(eK.A,{value:x,maxLength:12,placeholder:a("partner.enter_note"),inputClass:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-2 placeholder:!text-text-light placeholder:!text-sm",countClass:"text-sm text-text-light",onCh
1ange:e=>(e=>e.length<=20&&(m(e),!0))(e)})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.set_commission_split")}),(0,eB.jsx)(eX,{childRate:Number(i),parentRate:Number(c),childRateCallback:e=>o(e),parentRateCallback:e=>d(e)})]}),(0,eB.jsxs)("div",{className:"w-full mt-8 flex items-center gap-2.5",children:[(0,eB.jsx)("span",{className:"flex-1 bg-withdraw-button-color h-9.5 leading-9.5 rounded-[10px] text-center text-text-dark text-sm font-semibold cursor-pointer",onClick:r,children:a("trade.cancel")}),(0,eB.jsxs)("div",{className:"w-full flex-1 relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:a("partner.confirm"),disabled:s,onClick:()=>{n(!0),(0,eH.Gk)({id:t.id,remark:x,childCommissionRate:i,parentCommissionRate:c}).then(()=>{l(),r()}).finally(()=>{n(!1)})}}),s?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})]})};function lB(){return(lB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lI=function(e){return eU.createElement("svg",lB({xmlns:"http://www.w3.org/2000/svg",width:8,height:6,fill:"none"},e),y||(y=eU.createElement("path",{fill:"currentColor",d:"M6.203.237a.75.75 0 1 1 1.094 1.025l-3.75 4a.75.75 0 0 1-1.045.048l-2.25-2a.75.75 0 0 1 .996-1.12l1.704 1.514z"})))},lT=e=>{let{symbol:t,marginMode:l,callback:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s,showSelectWalletDialog:n}=rZ(),[i,o]=(0,eU.useState)(!1),[c,d]=(0,eU.useState)(+("cross"!==l)),x=(0,eU.useRef)(c),m=(0,eG.kH)(e=>e.isLogined),u=(0,tl.WG)(e=>e.positionList),p=(0,tl.WG)(e=>e.openOrderList),f=u.some(e=>e.symbol===t),h=p.some(e=>e.symbol===t),g=m&&(f||h),b=(0,eU.useRef)(""===t),v=e=>{b.current&&0===e||(d(e),x.current=e)};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] md:rounded-[16px] pt-6 px-5 pb-6 w-screen md:w-[420px] flex flex-col items-center ",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:r("trade.margin_mode")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>s(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsx)("div",{className:"w-full mt-4 border-t border-dialog-divide-color"}),(0,eB.jsx)("div",{className:"w-full mt-4 text-base font-semibold text-text-dark",children:t}),(0,eB.jsxs)("div",{className:"w-full flex items-center gap-2 mt-4",children:[(0,eB.jsxs)("div",{className:"flex flex-1 h-8 items-center justify-center border rounded-[10px] text-base font-medium relative ".concat(b.current?"cursor-default":"cursor-pointer"," ").concat(0===c?"text-text-dark border-marin-mode-border":"text-text-light border-dialog-divide-color"),onClick:()=>v(0),children:[(0,eB.jsxs)("div",{className:"flex items-baseline whitespace-pre-line",children:[(0,eB.jsx)("span",{children:r("trade.cross")}),(0,eB.jsx)("span",{className:"text-xs ".concat(b.current?"visible":"hidden"),children:r("trade.upgrading")})]}),0===c&&(0,eB.jsx)("div",{className:"w-4 h-4 bg-text-dark absolute -bottom-[1px] -right-[1px] rounded-tl-[10px] rounded-br-[10px] flex items-center justify-center",children:(0,eB.jsx)(lI,{className:"text-phone-setting-avator-path2"})})]}),(0,eB.jsxs)("div",{className:"flex flex-1 h-8 items-center justify-center border rounded-[10px] text-base font-medium relative cursor-pointer ".concat(1===c?"text-text-dark border-marin-mode-border":"text-text-light border-dialog-divide-color"),onClick:()=>v(1),children:[(0,eB.jsx)("span",{children:r("trade.isolated")}),1===c&&(0,eB.jsx)("div",{className:"w-4 h-4 bg-text-dark absolute -bottom-[1px] -right-[1px] rounded-tl-[10px] rounded-br-[10px] flex items-center justify-center",children:(0,eB.jsx)(lI,{className:"text-phone-setting-avator-path2"})})]})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full text-text-light text-sm gap-3 mt-4 font-medium leading-5.5",children:[(0,eB.jsx)("span",{children:r("trade.margin_mode_des1")}),(0,eB.jsx)("div",{children:(0,eB.jsx)(ez.x6,{i18nKey:"trade.margin_mode_des2",components:{white:(0,eB.jsx)("span",{className:"text-text-dark font-semibold"})}})}),(0,eB.jsx)("div",{children:(0,eB.jsx)(ez.x6,{i18nKey:"trade.margin_mode_des3",components:{white:(0,eB.jsx)("span",{className:"text-text-dark font-semibold"})}})}),g&&(0,eB.jsx)("span",{className:"text-[#E43C5A] font-medium",children:r("trade.margin_mode_hint")})]}),(0,eB.jsx)("div",{className:"w-full mt-8 border-t border-dialog-divide-color"}),(0,eB.jsx)("div",{className:"flex w-full mt-4 gap-2.5 mb-2 md:mb-0",children:(0,eB.jsxs)("div",{className:"flex-1 ml-auto relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !border-none
1!text-sm h-9.5 !font-semibold !rounded-[10px] !bg-text-dark !text-affiliate-search-text ".concat(i||g?"!opacity-40":"!opacity-100"),rounded:!0,onClick:()=>{m?(()=>{if(i)return;o(!0);let e=0===x.current?"cross":"isolated";(0,eH.nz)({symbol:t,marginMode:e}).then(()=>{(0,tl.x0)(t,e),a(e),s()}).finally(()=>{o(!1)})})():n()},label:r(m?"partner.confirm":"home.connect_wallet"),disabled:i||g}),i?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-5 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})})]})};function lU(){return(lU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lz=function(e){return eU.createElement("svg",lU({xmlns:"http://www.w3.org/2000/svg",width:60,height:60,fill:"none"},e),E||(E=eU.createElement("g",{clipPath:"url(#ic_partner_link_hint_svg__a)"},eU.createElement("path",{fill:"#1A91F3",d:"M30 52.5c12.425 0 22.5-10.075 22.5-22.5S42.425 7.5 30 7.5 7.5 17.575 7.5 30 17.575 52.5 30 52.5m-1.2-19.286a.403.403 0 0 1-.402-.401V19.15c0-.22.181-.401.402-.401h2.41c.22 0 .402.18.402.401v13.662a.403.403 0 0 1-.402.4zm1.205 8.036a2.412 2.412 0 1 1 0-4.823 2.412 2.412 0 0 1 0 4.823"}),eU.createElement("circle",{cx:30,cy:30,r:28.5,stroke:"#1A91F3",strokeOpacity:.4,strokeWidth:3}))),A||(A=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_partner_link_hint_svg__a"},eU.createElement("path",{fill:"#fff",d:"M0 60h60V0H0z"})))))},lH=e=>{let{callback:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-6 w-screen md:w-[420px] flex flex-col items-center p-6",children:[(0,eB.jsxs)("div",{className:"flex flex-col items-center justify-center w-full",children:[(0,eB.jsx)(lz,{}),(0,eB.jsx)("span",{className:"text-text-dark text-xl font-semibold mt-4",children:l("partner.update_default_link")}),(0,eB.jsx)("span",{className:"text-text-dark text-base mt-4",children:l("partner.update_default_link_hint")})]}),(0,eB.jsxs)("div",{className:"w-full mt-6 flex items-center gap-2.5",children:[(0,eB.jsx)("span",{className:"flex-1 bg-border-color h-9.5 leading-9.5 rounded-[10px] text-center text-text-dark text-sm font-semibold cursor-pointer",onClick:a,children:l("trade.cancel")}),(0,eB.jsx)("span",{className:"flex-1 bg-text-dark h-9.5 leading-9.5 rounded-[10px] text-center text-affiliate-search-text text-sm font-semibold cursor-pointer",onClick:()=>{t(),a()},children:l("partner.confirm")})]})]})};var lW=l(40268);let lV=e=>{let{tokenName:t,symbol:l,lever:a,minLever:r,maxLever:s,restrictedMaxLever:n,leverageRange:i,callback:o}=e,{t:c,i18n:d}=(0,ez.Bd)(),{hideDialog:x}=rZ(),m=(0,tt.e0)(e=>{var t,a;return null!=(a=null==(t=e.symbolStatusMap[l])?void 0:t.isRestrictionActive)&&a}),u=(0,eU.useRef)(a),[p,f]=(0,eU.useState)(a),h=p!==a;return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] md:rounded-[16px] p-6 px-4 md:px-6 w-screen md:w-[420px] flex flex-col items-center ",children:[(0,eB.jsxs)("div",{className:"w-full hidden flex-row",children:[(0,eB.jsx)("span",{className:"flex-1 text-lg text-text-dark font-medium",children:c("trade.modify_lever")}),(0,eB.jsx)("span",{className:"text-xl text-text-dark font-medium",children:"".concat(u.current,"x")})]}),(0,eB.jsx)(e0,{text:c("trade.modify_lever")}),(0,eB.jsx)("div",{className:"w-full flex flex-row text-text-light mt-4 items-center",children:(0,eB.jsx)("span",{className:"font-medium",children:"".concat(t," ").concat(l)})}),(0,eB.jsx)("div",{className:"w-full h-21.75 flex items-center justify-center",children:(0,eB.jsx)("span",{className:"text-4xl text-text-dark font-semibold",children:"".concat(u.current,"x")})}),(0,eB.jsx)("div",{className:"w-full pl-2 pr-3 mt-4 hidden",children:(0,eB.jsx)(td,{marks:{[r]:"",[s]:""},onSliderChange:e=>{u.current=e,f(e)},value:p,railBgColor:"var(--slide-rail-color)",min:r,max:s,format:"x"})}),(0,eB.jsx)("div",{className:"w-full flex flex-row items-center gap-1 mt-4 text-sm",children:i.map(e=>(0,eB.jsx)("div",{className:"flex-1 flex h-8 text-[13px] rounded-md items-center justify-center cursor-pointer ".concat(p===e?"text-text-dark bg-wallet-list-item-hover font-semibold":"font-medium text-text-light bg-dialog-tpsl-input-background"),onClick:()=>(e=>{u.current=e,f(e)})(e),children:(0,eB.jsx)("span",{className:"leading-[1] text-center",children:"".concat(e,"x")})},e))}),m&&(0,eB.jsx)("div",{className:"mt-4 flex h-[60px] w-full items-center rounded-[10px] border border-[#ea941d33] bg-[#ea941d0f] px-3",children:(0,eB.jsxs)("div",{className:"flex h-10 min-w-0 flex-1 flex-col justify-center",children:[(0,eB.jsx)("span",{className:"truncate text-[14px] font-medium leading-[18px] text-[#ea941d]",children:c("trade.modify_lever_market_limit",{leverage:n})}),(0,eB.jsxs)("a",{className:"mt-0.5 flex w-fit items-center text-[14px] font-medium leading-[18px] text-text-light underline",href:(d.language,"/help/leverage-restriction"),target:"_blank",rel:"noopener noreferrer",children:[c("trade.modify_lever_view_more"),(0,eB.jsx)(lW.A,{className:"ml-0.5 h-4 w-4",strokeWidth:2})]})]})}),(0,eB.jsxs)("div",{className:"flex w-full mt-8 gap-2.5 mb-2 md:mb-0",children:[(0,eB.jsx)("span",{className:"flex w-full h-10 items-center justify-center bg-order-setting-cancel-bg text-text-dark text-[14px] font-medium text-center rounded-[10px] cursor-pointer",onClick:x,children:c("trade.cancel")}),(0,eB.jsx)("button",{type:"button",className:"flex w-full h-10 items-center justify-center bg-text-dark text-order-setting-text text-[14px] font-medium text-center rounded-[10px] cursor-pointer disabled:cursor-not-allowed disabled:opacity-40",disabled:!h,onClick:()=>{h&&(o(u.current),localStorage.setItem("".concat(l,"_lever"),u.current.toString()),x())},children:c("partner.confirm")})]})]})};var lG=l(74649),l$=l(72542);function lq(){return(lq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lQ=function(e){return eU.createElement("svg",lq({xmlns:"http://www.w3.org/2000/svg",width:14,height:16,fill:"none"},e),C||(C=eU.createElement("path",{fill:"currentColor",d:"M0 12.672V8.806c0-.365 0-.677.016-.933.018-.263.056-.522.159-.776a2.33 2.33 0 0 1 1.244-1.279l.186-.067c.187-.056.377-.081.569-.095.25-.017.552-.017.907-.017a.74.74 0 0 1 .73.75.74.74 0 0 1-.73.7
15c-.375 0-.62 0-.808.013a1 1 0 0 0-.296.052.85.85 0 0 0-.454.467 1 1 0 0 0-.05.305c-.013.193-.014.444-.014.83v3.866c0 .463.001.766.02.997.017.222.047.311.072.36.08.163.209.295.366.377.047.025.134.056.35.074.225.02.518.02.968.02h7.53c.45 0 .744 0 .968-.02.216-.018.303-.049.35-.074a.85.85 0 0 0 .366-.377c.024-.049.055-.137.072-.36.019-.23.02-.532.02-.994v-3.87c0-.385-.001-.636-.014-.83a1 1 0 0 0-.05-.304.85.85 0 0 0-.378-.43l-.075-.037a1 1 0 0 0-.297-.052 13 13 0 0 0-.808-.013.74.74 0 0 1-.73-.75.74.74 0 0 1 .73-.75c.355 0 .659 0 .908.017.255.018.508.057.755.162.563.24 1.01.7 1.243 1.279l.066.191c.055.193.08.388.093.585.017.256.016.568.016.933v3.869c0 .438 0 .811-.024 1.117-.025.315-.08.624-.226.919a2.34 2.34 0 0 1-.846.94l-.158.092c-.287.15-.588.207-.893.233-.298.025-.662.024-1.087.024h-7.53c-.427 0-.79 0-1.088-.024a2.4 2.4 0 0 1-.785-.181l-.109-.052a2.33 2.33 0 0 1-1.003-1.032c-.147-.296-.202-.605-.227-.92-.025-.306-.024-.68-.024-1.12m6.27-3.866V2.56L5.165 3.697a.717.717 0 0 1-1.033 0 .765.765 0 0 1 0-1.06L6.484.22a.716.716 0 0 1 1.032 0l2.352 2.417a.765.765 0 0 1 0 1.06.716.716 0 0 1-1.032 0L7.73 2.56v6.246a.74.74 0 0 1-.73.75.74.74 0 0 1-.73-.75"})))};function lX(){return(lX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let lK=function(e){return eU.createElement("svg",lX({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),S||(S=eU.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0m3.901 7.478a.818.818 0 1 0-1.257-1.047l-3.517 4.22-1.821-1.82a.818.818 0 0 0-1.157 1.157l2.454 2.454a.82.82 0 0 0 1.207-.055z",clipRule:"evenodd"})))},lZ=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r,showModifyDefaultLinkDialog:s}=rZ(),[n,i]=(0,eU.useState)("".concat(t.childCommissionRate)),[o,c]=(0,eU.useState)("".concat(t.parentCommissionRate)),[d,x]=(0,eU.useState)(!1),[m,u]=(0,eU.useState)(t.isDefault),[p,f]=(0,eU.useState)(t.remark),[h,g]=(0,eU.useState)(!1),b=e=>{if((0,eG.Iv)())return void(0,eV.P0)("error",a("referrals.trial_account_copy_hint"));(0,eY.Dk)(e)};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-6 w-screen md:w-[420px] max-h-[85svh] flex flex-col items-center p-6",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:a("partner.referral_link_detail")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>r(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-1 flex-col items-center overflow-y-auto relative",children:[(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.link")}),(0,eB.jsxs)("div",{className:"flex items-center mt-2 gap-2",children:[(0,eB.jsx)("div",{className:"flex w-full h-9.5 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper",children:(0,eB.jsx)("span",{className:"flex-1 w-full min-w-0 text-xs text-text-dark transfer",children:(0,eY.aK)(t.code)})}),(0,eB.jsx)("div",{className:"w-9.5 h-9.5 flex shrink-0 items-center justify-center md:hidden bg-segment-background rounded-[8px]",onClick:()=>b((0,eY.aK)(t.code)),children:(0,eB.jsx)(lQ,{className:"text-text-dark"})})]})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.invitation_code")}),(0,eB.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:t.code}),(0,eB.jsx)("div",{className:"cursor-pointer text-text-light",onClick:()=>b(t.code),children:(0,eB.jsx)(lG.A,{})})]})]}),(0,eB.jsxs)("div",{className:"w-full flex items-center justify-between mt-2.5 h-[26px]",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.remark")}),(0,eB.jsx)("div",{className:"flex items-center gap-1.5",children:(0,eB.jsx)("div",{children:h?(0,eB.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eB.jsx)("div",{className:"relative flex w-[245px] bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)(eK.A,{value:p,maxLength:12,inputClass:"flex-1 w-full h-[26px] min-w-0 text-sm text-text-dark transfer pr-2",countClass:"text-sm text-text-light",onCh
1ange:e=>(e=>e.length<=20&&(f(e),!0))(e)})}),(0,eB.jsx)(lK,{className:"cursor-pointer text-text-dark",onClick:()=>g(!1)})]}):(0,eB.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:p}),(0,eB.jsx)(l$.A,{className:"cursor-pointer text-text-light",onClick:()=>g(!0)})]})})})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2.5",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.created_at")}),(0,eB.jsx)("div",{className:"flex items-center gap-1.5",children:(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:(0,eY._b)(t.createdTime)})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.set_commission_split")}),(0,eB.jsx)(eX,{childRate:Number(n),parentRate:Number(o),childRateCallback:e=>i(e),parentRateCallback:e=>c(e)})]}),(0,eB.jsx)("span",{className:"w-full text-[14px] mt-2 text-text-dark",children:a("partner.split_dialog_hint")}),(0,eB.jsxs)("div",{className:"w-full flex flex-col mt-4",children:[(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:a("partner.data_overview")}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.total_commission")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:(0,eY.tu)(t.totalCommission)})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.trading_volume_usd")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:(0,eY.tu)(t.referredVolume)})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.unique_clicks")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:t.clickCount})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.referrals")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:t.referredFriends})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.active_traders")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:t.tradeUserCount})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between mt-2",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:a("partner.funded_users")}),(0,eB.jsx)("span",{className:"text-sm text-text-dark font-semibold",children:t.depositUserCount})]})]}),(0,eB.jsxs)("div",{className:"w-full flex items-center mt-6",onClick:()=>{t.isDefault||(m?u(!m):s(()=>{u(!0)}))},children:[!m&&(0,eB.jsx)(tf,{}),m&&(0,eB.jsx)(tu,{className:"".concat(t.isDefault?"text-text-light":"text-text-dark")}),(0,eB.jsx)("span",{className:"text-xs font-medium ml-2 ".concat(t.isDefault?"text-text-light":"text-text-dark"),children:a("partner.set_default_referral_link")})]}),(0,eB.jsxs)("div",{className:"w-full mt-2 flex items-center gap-2.5 sticky bottom-0 bg-dialog-background pt-2",children:[(0,eB.jsx)("span",{className:"flex-1 bg-withdraw-button-color h-9.5 leading-9.5 rounded-[10px] text-center text-text-dark text-sm font-semibold cursor-pointer",onClick:r,children:a("trade.cancel")}),(0,eB.jsxs)("div",{className:"w-full flex-1 relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:a("partner.confirm"),disabled:d,onClick:()=>{if(!o||!n)return void(0,eV.P0)("error",a("partner.please_check_input"));x(!0);let e={id:t.id,remark:p,isDefault:m,parentCommissionRate:o,childCommissionRate:n};(0,eH.jN)(e).then(()=>{l(),r()}).finally(()=>{x(!1)})}}),d?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})]})]})},lJ=e=>{let{type:t,data:l,remark:a,callback:r}=e,{t:s}=(0,ez.Bd)(),{hideDialog:n}=rZ(),[i,o]=(0,eU.useState)(a),[c,d]=(0,eU.useState)(!1),x=(0,eU.useRef)(!1);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] md:rounded-[16px] p-6 w-screen md:w-[420px] flex flex-col items-center ",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold",children:s("partner.modify_remark")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>n(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-row items-center gap-1 mt-4 text-sm relative",children:[(0,eB.jsx)("textarea",{className:"w-full h-20 bg-segment-background resize-none rounded-lg p-2 text-sm text-text-dark font-medium",value:i,maxLength:12,onCompositionStart:()=>{x.current=!0},onCompositionEnd:e=>{x.current=!1;let t=e.currentTarget.value;t.length<=12&&o(t)},onChange:e=>(e=>{if(x.current)return void o(e);e.length<=12&&o(e)})(e.target.value)}),(0,eB.jsx)("div",{className:"absolute right-2 bottom-2 text-xs text-text-light",children:"".concat(i?i.length:0,"/").concat(12)})]}),(0,eB.jsxs)("div",{className:"flex w-full mt-6 gap-2.5 mb-4 md:mb-0",children:[(0,eB.jsx)("span",{className:"flex-1 bg-withdraw-button-color text-text-dark text-[14px] font-medium h-9.5 leading-9.5 text-center rounded-[10px] cursor-pointer",onClick:n,children:s("trade.cancel")}),(0,eB.jsxs)("div",{className:"flex-1 ml-auto relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none
1!text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,onClick:()=>{1===t?(d(!0),(0,eH.G4)({remark:i,code:l}).then(()=>{r(),n()}).finally(()=>{d(!1)})):2===t?(d(!0),(0,eH.gF)({remark:i,customerAddress:l}).then(()=>{r(),n()}).finally(()=>{d(!1)})):3===t?(d(!0),(0,eH.at)({remark:i,id:l.id,userId:l.userId}).then(()=>{r(),n()}).finally(()=>{d(!1)})):4===t&&(d(!0),(0,eH.He)({remark:i,id:l.id,userId:l.userId}).then(()=>{r(),n()}).finally(()=>{d(!1)}))},label:s("partner.confirm"),disabled:c}),c?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-5 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})]})};var lY=l(8760),l0=l.n(lY);let l1={src:"/_next/static/media/ic_new_user_gift.af5f3e62.webp",height:378,width:534,blurDataURL:"data:image/webp;base64,UklGRrIAAABXRUJQVlA4WAoAAAAQAAAABwAABQAAQUxQSDEAAAAAAAAdzDBAAAAAAr/9/5oAAAAJj8zx4goAAAXz///rCQAABeT//4ANAAADFafNBgAAAFZQOCBaAAAA0AEAnQEqCAAGAAJAOCUAToAekf5kMAAA/u0mNxys/ELsY9Pf/Hshx9Ynxh36jVfUT0z6UFJN2kRSentPLmS9zcb84dem5H4PVutzksutcq0qq2UOw7jBBYAA",blurWidth:8,blurHeight:6},l2=e=>{let{onHide:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ();return(0,eB.jsxs)(e$,{className:"bg-new-user-dialog-start rounded-[16px] pt-6 w-[calc(100vw-48px)] md:w-[420px] flex flex-col items-center px-4 pb-4",children:[(0,eB.jsx)("div",{className:"flex flex-col items-center justify-center w-full",children:(0,eB.jsx)("span",{className:"text-xl text-text-dark font-medium",children:l("home.new_user_bonus")})}),(0,eB.jsx)("div",{className:"mt-2 text-[26px] text-text-dark tracking-tight text-center leading-8 whitespace-pre-line ".concat(l0().className),children:(0,eB.jsx)(ez.x6,{i18nKey:"home.new_user_bonus_des",components:{white:(0,eB.jsx)("span",{className:"text-main-color"})}})}),(0,eB.jsx)(lo.default,{className:"mt-4 w-[267px] h-auto",src:l1,alt:""}),(0,eB.jsx)("div",{className:"mt-8.5 w-full flex-1 select-none",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-main-color !border-none !text-white !text-[14px] !py-1.75 !rounded-lg",rounded:!0,label:l("home.claim_now"),onClick:()=>void(t(),a())})}),(0,eB.jsx)("div",{className:"mt-4 flex items-center text-center text-text-light text-sm",children:l("home.claim_rule")})]})};function l5(){return(l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let l3=function(e){return eU.createElement("svg",l5({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),D||(D=eU.createElement("g",{fill:"currentColor",clipPath:"url(#ic_radio_selected_svg__a)"},eU.createElement("path",{fillRule:"evenodd",d:"M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0",className:"ic_radio_selected_svg__path1",clipRule:"evenodd"}),eU.createElement("circle",{cx:9,cy:9,r:3,className:"ic_radio_selected_svg__path2"}))),P||(P=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_radio_selected_svg__a"},eU.createElement("path",{fill:"currentColor",d:"M0 0h18v18H0z",className:"ic_radio_selected_svg__path2"})))))};function l6(){return(l6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let l4=function(e){return eU.createElement("svg",l6({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none"},e),M||(M=eU.createElement("g",{clipPath:"url(#ic_radio_unselected_svg__a)"},eU.createElement("path",{fill:"#6C757D",fillOpacity:.06,fillRule:"evenodd",d:"M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0",clipRule:"evenodd"}),eU.createElement("path",{stroke:"#6C757D",strokeOpacity:.4,d:"M9 .5a8.5 8.5 0 1 1 0 17 8.5 8.5 0 0 1 0-17Z"}))),O||(O=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_radio_unselected_svg__a"},eU.createElement("path",{fill:"#fff",d:"M0 0h18v18H0z"})))))},l7=e=>{let{unit:t,onConfirm:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(t);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 w-screen md:w-[420px] flex flex-col items-center px-4 md:px-6",children:[(0,eB.jsx)(e0,{text:a("trade.order_settings")}),(0,eB.jsx)("div",{className:"flex flex-row w-full mt-4",onClick:()=>n(0),children:(0,eB.jsxs)("div",{className:"flex flex-col flex-1 p-4 rounded-[10px] border ".concat(0===s?"border-text-dark":"border-dialog-border-color"),children:[(0,eB.jsx)("div",{className:"text-base font-semibold text-text-dark",children:a("trade.order_settings_lot_title")}
1),(0,eB.jsx)("div",{className:"text-sm font-medium mt-2 text-text-light",children:a("trade.order_settings_lot_desc")})]})}),(0,eB.jsx)("div",{className:"flex flex-row w-full mt-4",children:(0,eB.jsxs)("div",{className:"flex flex-col flex-1 p-4 rounded-[10px] border ".concat(0!==s?"border-text-dark":"border-dialog-border-color"),children:[(0,eB.jsx)("div",{className:"text-base font-semibold text-text-dark",onClick:()=>n(1),children:"USD"}),(0,eB.jsx)("div",{className:"text-sm font-medium mt-2 text-text-light",onClick:()=>n(1),children:a("trade.order_settings_usd_desc")}),(0,eB.jsxs)("div",{className:"flex flex-row text-base font-medium mt-5 gap-2",children:[(0,eB.jsxs)("div",{className:"flex flex-row justify-start items-center min-w-1/2 h-8 cursor-pointer gap-2",onClick:()=>n(1),children:[1===s?(0,eB.jsx)(l3,{className:"w-4.5 h-4.5"}):(0,eB.jsx)(l4,{className:"w-4.5 h-4.5"}),(0,eB.jsx)("span",{className:" ".concat(1===s?"text-text-dark":"text-text-light"),children:a("trade.order_size")})]}),(0,eB.jsxs)("div",{className:"flex flex-row justify-start items-center max-w-1/2 h-8 cursor-pointer gap-2",onClick:()=>n(2),children:[2===s?(0,eB.jsx)(l3,{className:"w-4.5 h-4.5"}):(0,eB.jsx)(l4,{className:"w-4.5 h-4.5"}),(0,eB.jsx)("span",{className:" ".concat(2===s?"text-text-dark":"text-text-light"),children:a("trade.cost_money")})]})]})]})}),(0,eB.jsxs)("div",{className:"flex flex-row justify-end w-full mt-8 text-sm font-medium gap-3 mb-2 md:mb-0",children:[(0,eB.jsx)("div",{className:"flex flex-col justify-center items-center w-full h-10 bg-order-setting-cancel-bg text-text-dark rounded-[10px] cursor-pointer",onClick:()=>{r()},children:a("trade.cancel")}),(0,eB.jsx)("div",{className:"flex flex-col justify-center items-center w-full h-10 bg-text-dark text-order-setting-text rounded-[10px] cursor-pointer",onClick:()=>{l(s),r()},children:a("partner.confirm")})]})]})},l8=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(""),i=new Date,o="".concat(a("partner.start_date")," - ").concat(a("partner.end_date")),[c,d]=(0,eU.useState)(null),[x,m]=(0,eU.useState)(),{dates:u,minDate:p,handleCalendarChange:f,resetDates:h}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.search_filter")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:s,placeholder:a("partner.partner_list_filter_input_hint"),onChange:e=>{n(e.target.value)}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.partner_list_become_time")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:c,onChange:e=>{let[t,l]=e.value||[];if(d(e.value),t&&!l){let e=new Date(new Date(t));e.setDate(e.getDate()-60),m(e)}t&&l&&m(void 0)},minDate:x,maxDate:i,dateFormat:"yy-mm-dd",selectionMode:"range",placeholder:o,readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(null==c?void 0:c[0])&&!(null==c?void 0:c[1])&&d(null)},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.trading_time")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:u,onChange:f,minDate:p,maxDate:i,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(u)||h()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-13 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color roun
1ded-lg",onClick:()=>{r(),null==t||t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{!((null==c?void 0:c[0])&&!(null==c?void 0:c[1]))&&(0,eY.ph)(u)&&(r(),null==l||l(s,c,u))},children:a("partner.search")})]})]})};var l9=l(18184),ae=l(90647),at=l(58475);let al=e=>{let{value:t,onChange:l}=e,{t:a}=(0,ez.Bd)(),r=[{label:a("partner.all")}];return(0,at.V)(e=>e.symbols).forEach(e=>{r.push({label:e})}),(0,eB.jsx)("div",{className:"flex flex-col-reverse bg-[#00000040] w-screen h-[calc(100vh-60px)]",onClick:()=>{l(t)},children:(0,eB.jsx)("div",{className:"h-fit bg-dialog-background border border-border-color rounded-t-[16px] pt-4 pb-10",children:r.map(e=>(0,eB.jsxs)("div",{className:"h-12.5 flex flex-row justify-between items-center px-4 cursor-pointer",onClick:t=>{var a;return a=e.label,void(t.stopPropagation(),l(a))},children:[(0,eB.jsx)("div",{className:"text-text-dark",children:e.label}),(0,eB.jsx)(ae.A,{className:"w-6 h-6 text-text-dark fill-current ".concat(e.label===t?"flex":"hidden")})]},e.label))})})},aa=e=>{let{selectValue:t,onReset:l,onSearch:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s}=rZ(),[n,i]=(0,eU.useState)(""),[o,c]=(0,eU.useState)(t&&"ALL"!==t?t:r("partner.all")),{dates:d,minDate:x,today:m,handleCalendarChange:u,resetDates:p}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:r("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:r("partner.customer_wallet_address")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:n,placeholder:r("partner.customer_wallet_address_hint"),onChange:e=>{i(e.target.value)}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:r("partner.trading_pairs")}),(0,eB.jsx)(l9.A,{trigger:(0,eB.jsxs)("div",{className:"self-start flex w-full h-9.5 mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:[(0,eB.jsx)("div",{className:"flex-1 w-full min-w-0 text-sm text-text-dark transfer",children:o}),(0,eB.jsx)(tP.A,{className:"w-4 h-4 ml-2 text-text-dark fill-current"})]}),children:e=>(0,eB.jsx)(al,{value:o,onChange:t=>{c(t),e()}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:r("partner.input_trade_date")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:d,onChange:u,minDate:x,maxDate:m,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(d)||p()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-33 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color rounded-lg",onClick:()=>{s(),null==l||l()},children:r("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{s();let e=o;e.includes("/")||(e="ALL"),null==a||a(n,e,d)},children:r("partner.search")})]})]})},ar=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(""),{dates:i,minDate:o,today:c,handleCalendarChange:d,resetDates:x}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.customer_wallet_address")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:s,placeholder:a("partner.customer_wallet_address_hint"),onChange:e=>{n(e.target.value)}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.deposit_withdraw_time")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:i,onChange:d,minDate:o,maxDate:c,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(i)||x()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-33 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color roun
1ded-lg",onClick:()=>{r(),null==t||t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{r(),null==l||l(s,i)},children:a("partner.search")})]})]})},as=e=>{let{data:t,callback:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(!1),[i,o]=(0,eU.useState)(!1),c=e=>{1===e?n(!0):o(!0),(0,eH.l5)({messageId:t.id,authStatus:e}).then(t=>{t&&(1===e&&(0,eG.xJ)(),l(),r())}).finally(()=>{1===e?n(!1):o(!1)})};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-8 w-screen md:w-[518px] max-h-[85svh] md:h-full flex flex-col items-center pb-8 px-6 md:px-8 relative",children:[(0,eB.jsxs)("div",{className:"flex flex-row justify-between items-center w-full relative",children:[(0,eB.jsx)("span",{className:"flex-1 pl-6 text-xl text-text-dark text-center font-semibold",children:t.parsedContent.title}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer",onClick:()=>r(),children:(0,eB.jsx)(e5.A,{className:"w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full mt-5 h-[230px] md:h-full max-h-[100%-62px] overflow-y-auto mb-[70px]",children:[(0,eB.jsx)("span",{className:"w-full mt-8 text-text-dark text-base font-medium",children:a("home.notice_invite_confirm_des")}),(0,eB.jsxs)("div",{className:"bg-border-color w-full rounded-[10px] mt-4 flex flex-col p-4 gap-2",children:[(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"\xb7 ".concat(a("home.notice_invite_confirm_account",{account:(0,eY.mb)(t.parsedContent.invitedBy)}))}),(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"\xb7 ".concat(a("home.notice_invite_confirm_time",{time:(0,eY._b)(t.sendTime)}))}),(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"\xb7 ".concat(t.parsedContent.description)})]}),"DELETED"===t.deleteStatus?(0,eB.jsx)("div",{className:"flex w-[calc(100%-48px)] md:w-[calc(100%-64px)] bg-dialog-background pt-8 mb-8 md:mb-4 gap-2.5 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)("div",{className:"w-full bg-border-color border-none text-text-light text-sm h-9.5 font-semibold rounded-[10px] flex items-center justify-center",children:a("vouchers.expired")})}):""===t.processResult?(0,eB.jsxs)("div",{className:"flex w-[calc(100%-48px)] md:w-[calc(100%-64px)] bg-dialog-background pt-8 mb-8 md:mb-4 gap-2.5 absolute bottom-0 md:bottom-3",children:[(0,eB.jsxs)("div",{className:"flex-1 ml-auto relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-border-color !border-none !text-text-dark !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,disabled:s||i,label:a("home.reject"),onClick:()=>c(2)}),i?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]}),(0,eB.jsxs)("div",{className:"flex-1 ml-auto relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,disabled:s||i,label:a("home.agree"),onClick:()=>c(1)}),s?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-10 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]}):"1"===t.processResult?(0,eB.jsx)("div",{className:"flex w-[calc(100%-48px)] md:w-[calc(100%-64px)] bg-dialog-background pt-8 mb-8 md:mb-4 gap-2.5 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)("div",{className:"w-full bg-border-color border-none text-text-light text-sm h-9.5 font-semibold rounded-[10px] flex items-center justify-center",children:a("partner.already_agree")})}):(0,eB.jsx)("div",{className:"flex w-[calc(100%-48px)] md:w-[calc(100%-64px)] bg-dialog-background pt-8 mb-8 md:mb-4 gap-2.5 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)("div",{className:"w-full bg-border-color border-none text-text-light text-sm h-9.5 font-semibold rounded-[10px] flex items-center justify-center",children:a("partner.already_reject")})})]})]})},an=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)("");return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.search_filter")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:s,placeholder:a("partner.partner_list_filter_input_hint"),onChange:e=>{n(e.target.value)}})}),(0,eB.jsxs)("div",{className:"mt-13 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color roun
1ded-lg",onClick:()=>{r(),null==t||t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{r(),null==l||l(s)},children:a("partner.search")})]})]})},ai=e=>{let{data:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-8 w-screen md:w-[518px] max-h-[85svh] md:h-full flex flex-col items-center pb-8 px-6 md:px-8 relative",children:[(0,eB.jsxs)("div",{className:"flex flex-row justify-between items-center w-full relative",children:[(0,eB.jsx)("span",{className:"flex-1 pl-6 text-xl text-text-dark text-center font-semibold",children:t.parsedContent.title}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer ",onClick:()=>a(),children:(0,eB.jsx)(e5.A,{className:"w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full mt-5 h-[350px] md:h-full max-h-[100%-62px] overflow-y-auto mb-[70px]",children:[(0,eB.jsx)("span",{className:"w-full mt-8 text-text-dark text-base font-medium",children:l("home.notice_invite_result_content")}),(0,eB.jsxs)("div",{className:"bg-border-color w-full rounded-[10px] mt-4 flex flex-col p-4 gap-2",children:[(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"\xb7 ".concat(l("home.notice_invite_result_account",{account:(0,eY.mb)(t.parsedContent.subAffiliateAccount)}))}),(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"".concat(l("home.notice_invite_result_time",{time:(0,eY._b)(t.sendTime)}))}),(0,eB.jsx)("span",{className:"text-text-dark text-base font-medium",children:"\xb7 ".concat(t.parsedContent.description)})]})]}),(0,eB.jsx)("div",{className:"flex w-[calc(100%-48px)] md:w-[calc(100%-64px)] bg-dialog-background pt-8 mb-8 md:mb-4 gap-2.5 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)("div",{className:"flex-1 ml-auto relative h-9.5",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:l("trade.ok"),onClick:a})})})]})},ao=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(""),{dates:i,minDate:o,today:c,handleCalendarChange:d,resetDates:x}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.search_filter")}),(0,eB.jsx)("div",{className:"self-start flex w-full mt-3 bg-segment-background border border-segment-background rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer placeholder:!text-text-light placeholder:!text-sm",type:"text",value:s,placeholder:a("partner.input_code_remark"),onChange:e=>{n(e.target.value)}})}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.input_trade_date")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:i,onChange:d,minDate:o,maxDate:c,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(i)||x()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-33 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color rounded-lg",onClick:()=>{r(),null==t||t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{r(),null==l||l(s,i)},children:a("partner.search")})]})]})};var ac=l(57422),ad=l(2219);let ax=e=>{let{data:t,onHide:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),{showVoucherDetailDialog:s}=rZ(),n=()=>
1{l(),r()},i={CARD:{nameKey:"vouchers.voucher_name",desKey:"vouchers.receive_dialog_des",image:ac},TRIAL_FUND:{nameKey:"vouchers.voucher_name_contract",desKey:"vouchers.voucher_des_contract",image:ad}};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] md:rounded-[16px] p-6 w-screen md:w-[420px] flex flex-col items-center ",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold text-center",children:a("vouchers.receive_dialog_title")}),(0,eB.jsx)("div",{className:"absolute right-0 p-2 cursor-pointer",onClick:()=>n(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col w-full items-center justify-center mt-8",children:[(0,eB.jsx)("div",{className:"w-50 h-29.5 flex flex-col items-center justify-center bg-cover bg-center pl-[38px]",style:{backgroundImage:"url(".concat(i[t.rewardDefinitionType].image,")")},children:(0,eB.jsx)("span",{className:"text-4xl font-semibold bg-gradient-to-r from-[#FFFFFF] ".concat("CARD"===t.rewardDefinitionType?"to-[#6CBDFF]":"to-[#AA79F1]"," bg-clip-text text-transparent"),children:"".concat(t.rewardDefinitionValue," USD")})}),(0,eB.jsxs)("div",{className:"flex flex-col items-center justify-center mt-4",children:[(0,eB.jsx)("span",{className:"text-base text-text-dark font-medium text-center",children:(e=>{let{desKey:t}=i[e.rewardDefinitionType];return"function"==typeof t?t(e):a(t)})(t)}),2===t.status?(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:"".concat((0,eY._b)(t.endTime)," ").concat(a("vouchers.expired"))}):(0,eB.jsx)("span",{className:"text-sm text-text-light font-medium",children:-1===t.validityType?a("vouchers.valid_forever"):a(0===t.status?"vouchers.effective_time":"vouchers.receive_dialog_time",{time:(0,eY._b)(0===t.status?t.startTime:t.endTime,"-")})})]})]}),(0,eB.jsxs)("div",{className:"flex w-full mt-8 gap-2.5 mb-4 md:mb-0",children:[(0,eB.jsx)("span",{className:"flex-1 h-9.5 leading-9.5 bg-border-color text-text-dark text-[14px] font-medium text-center rounded-[10px] cursor-pointer",onClick:n,children:a("vouchers.receive_dialog_know")}),(0,eB.jsx)("div",{className:"flex-1 ml-auto relative h-9.5",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,onClick:n,label:a("vouchers.receive_dialog_confirm")})})]}),(0,eB.jsx)("div",{className:"w-full flex justify-center mt-4 text-sm text-text-light font-normal",children:(0,eB.jsx)("span",{className:"underline decoration-dotted cursor-pointer",onClick:()=>{s(t,1)},children:a("vouchers.receive_dialog_rule")})})]})};var am=l(65910),au=l(73562);let ap={src:"/_next/static/media/ic_receive_voucher_v2_gift.f75e7b14.webp",height:376,width:508,blurDataURL:"data:image/webp;base64,UklGRqoAAABXRUJQVlA4WAoAAAAQAAAABwAABQAAQUxQSDEAAAAAAAAFRzgDBAAAAFT158ZiAAAB8sa58F8AAADS/f/AFwAAAvT///8dAAApeMHJhCkAAFZQOCBSAAAA0AEAnQEqCAAGAAJAOCUAToAelOb4NTAA/vNjJVCTwixZUJe2ewQHtebCyRgG8Wcipfwp9pqgE688Pe4dY3HRy2ug12NF60WBg6IuMRuImYaAAA==",blurWidth:8,blurHeight:6};function af(e,t){if(-1===e.validityType)return t("vouchers.valid_forever");let l=new Date("".concat(e.endTime,"Z")).getTime();if(!e.endTime||Number.isNaN(l))return"";let a=Math.max(l-Date.now(),0);return t("vouchers.receive_dialog_v2_expires_in",{days:Math.floor(a/864e5),hours:Math.floor(a%864e5/36e5)})}let ah=e=>{let{data:t,onHide:l,onDepositClick:a}=e,{t:r}=(0,ez.Bd)(),{hideDialog:s,showVoucherDetailDialog:n}=rZ();function i(){l(),s()}return(0,eU.useEffect)(()=>{(0,e9.$s)(e9.lj)},[]),(0,eB.jsxs)(e$,{className:"relative mt-[100px] w-screen md:w-[518px] rounded-t-[16px] bg-[#141517] px-6 pb-6 pt-[100px] md:rounded-[16px]",children:[(0,eB.jsx)(lo.default,{src:ap,alt:"",width:254,height:188,className:"pointer-events-none absolute left-1/2 top-[-100px] h-[188px] w-[254px] -translate-x-1/2 object-contain"}),(0,eB.jsx)("div",{className:"absolute right-4 top-4 flex size-6 cursor-pointer items-center justify-center",onClick:function(){(0,e9.$s)(e9.UX),i()},children:(0,eB.jsx)(e5.A,{className:"size-3 text-[#8D8E92] fill-current"})}),(0,eB.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,eB.jsx)("span",{className:"text-xl font-semibold text-[#F2F4F7]",children:r("vouchers.receive_dialog_v2_title")}),(0,eB.jsxs)("div",{className:"mt-3 flex flex-col items-center bg-gradient-to-b from-[#FDF1D0] to-[#D7B784] bg-clip-text text-transparent",children:[(0,eB.jsx)("span",{className:"text-[56px] leading-[73px] font-bold",children:"".concat(t.rewardDefinitionValue,"U")}),(0,eB.jsx)("span",{className:"text-xl leading-[24px] font-bold",children:r("vouchers.receive_dialog_v2_bonus_unit")})]}),(0,eB.jsxs)("div",{className:"mt-3 flex w-full flex-col gap-1.5 rounded-[16px] border border-white/10 bg-white/6 px-3 py-2",children:[(0,eB.jsx)("span",{className:"text-sm text-center font-normal text-[#8D8E92] leading-tight",children:(0,eB.jsx)(ez.x6,{i18nKey:"vouchers.receive_dialog_v2_bonus_des",components:{gold:(0,eB.jsx)("span",{className:"text-[#D7B784]"})}})}),(0,eB.jsx)("span",{className:"text-sm text-center font-normal text-[#8D8E92] leading-tight",children:(0,eB.jsx)(ez.x6,{i18nKey:"vouchers.receive_dialog_v2_activate_des",components:{blue:(0,eB.jsx)("span",{className:"font-semibold text-main-color"})}})})]}),af(t,r)&&(0,eB.jsxs)("div",{className:"mt-3 flex items-center gap-2 rounded-[6px] border border-white/10 px-3 py-1 text-sm font-normal text-[#F2F4F7]",children:[(0,eB.jsx)(am.A,{className:"size-4 text-[#D7B784]"}),(0,eB.jsx)("span",{children:af(t,r)})]})]}),(0,eB.jsxs)("div",{className:"mt-8 flex flex-col-reverse md:flex-row w-full gap-3",children:[(0,eB.jsx)("button",{type:"button",className:"flex min-h-11 h-11 flex-1 cursor-pointer items-center justify-center rounded-[10px] border border-[#484C51] bg-[#141517] px-4 text-base font-medium leading-[44px] text-[#F2F4F7]",onClick:function(){(0,e9.$s)(e9.gL),i()},children:r("vouchers.receive_dialog_v2_maybe_later")}),(0,eB.jsxs)("button",{type:"button",className:"flex min-h-11 h-11 flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-[10px] bg-main-color px-4 text-base font-medium leading-[44px] text-[#F2F4F7]",onClick:function(){(0,e9.$s)(e9.eP),i(),a&&a()},children:[(0,eB.jsx)("span",{children:r("vouchers.receive_dialog_v2_deposit_trade")}),(0,eB.jsx)(au.A,{className:"size-4"})]})]}),(0,eB.jsx)("div",{className:"mt-4 flex w-full justify-center text-sm font-normal text-[#8D8E92]",children:(0,eB.jsx)("span",{className:"cursor-pointer underline decoration-dotted",onClick:function(){n(t,1)},children:r("vouchers.receive_dialog_v2_terms")})})]})},ag=e=>{let{callback:t,code:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),[s,n]=(0,eU.useState)(""),[i,o]=(0,eU.useState)(!1),c=!!l,d=async e=>{o(!0),(0,eH.kO)({referralCode:e}).then(e=>{e&&((0,e9.$s)(e9.uN),(0,eV.P0)("success",a("referrals.bind_link_success"),eV.KW),t(),r())}).catch(()=>{(0,e9.$s)(e9.p3)}).finally(()=>{o(!1)})},x=async()=>
1{if(i)return;let e=s;s.includes("ref=")&&(e=s.split("ref=")[1]),d(e)};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[518px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{alighn:"center",text:a("referrals.enter_code")}),(0,eB.jsxs)("div",{className:"w-full flex flex-col gap-4 mt-4",children:[c?(0,eB.jsx)("div",{className:"flex items-baseline justify-center text-text-light",children:(0,eB.jsx)(ez.x6,{i18nKey:"referrals.current_referral_code",values:{code:l},components:{white:(0,eB.jsx)("span",{className:"text-text-dark text-xl ml-0.5"})}})}):(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsx)("span",{className:"text-text-light text-sm text-center",children:a("referrals.enter_code_hint")}),(0,eB.jsx)("div",{className:"flex bg-dialog-input-background border border-border-color rounded-[8px] items-center px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,eB.jsx)("input",{className:"flex-1 w-full h-9.5 min-w-0 text-base text-text-dark transfer",type:"text",value:s,onChange:e=>{var t;return t=e.target.value,void(!i&&n(t))}})})]}),(0,eB.jsxs)("div",{className:"w-full mt-2 relative mb-2 md:mb-0",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-order-setting-text !text-[14px] !h-10 !rounded-lg",rounded:!0,label:a("referrals.enter"),onClick:x,disabled:c||!s||i}),i?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-45 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]})]})};var ab=l(30481);let av=e=>{let{dataList:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),r=[l("referrals.launch_phase"),l("referrals.growth_phase"),l("referrals.stable_phase")];return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] md:rounded-[16px] pt-6 w-screen md:w-[518px] flex flex-col items-center pb-6",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-[20px] text-text-dark font-semibold text-center",children:l("referrals.referral_rewards")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer w-6 h-6 mr-2.5 absolute right-0 top-0",onClick:()=>a(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-col px-6 gap-3 mt-5",children:[t.map((e,t)=>(0,eB.jsxs)("div",{className:"flex-1 border border-dialog-border-color flex flex-col rounded-[12px] px-6 py-3 gap-1.5",children:[(0,eB.jsx)("span",{className:"text-text-dark text-xl font-semibold",children:r[t]}),(0,eB.jsx)("div",{className:"text-text-dark text-sm",children:(0,eB.jsx)(ez.x6,{i18nKey:"referrals.earn_commission_hint",values:{percent:e.commissionRate,percent2:e.discountRate},components:{blue:(0,eB.jsx)("span",{className:"text-[#1A91F3] font-semibold"})}})}),(0,eB.jsx)("span",{className:"text-text-dark text-sm",children:(0,eY.tX)(e.startDay,e.endDay,ab.Ay.language)})]},t)),(0,eB.jsx)("p",{className:"text-text-light text-sm mt-2 mb-4 md:mb-0",children:l("referrals.limited_time_hint")})]})]})};function aw(){return(aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aj=function(e){return eU.createElement("svg",aw({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none"},e),R||(R=eU.createElement("rect",{width:32,height:32,fill:"#0B0E11",rx:8})),L||(L=eU.createElement("g",{clipPath:"url(#ic_chain_bsc_svg__a)"},eU.createElement("path",{fill:"#F0B90B",d:"M10.241 8.37 16.031 5l5.788 3.37-2.128 1.245-3.66-2.125-3.662 2.125zm11.578 4.25-2.128-1.245-3.66 2.124-3.662-2.124-2.128 1.245v2.49l3.66 2.124v4.25l2.13 1.245 2.128-1.245v-4.25l3.66-2.125zm0 6.739v-2.49l-2.128 1.245v2.49zm1.511.88-3.66 2.125v2.49l5.789-3.37v-6.74L23.33 15.99zm-2.128-9.744 2.128 1.245v2.49l2.129-1.246v-2.49L23.33 9.25zm-7.3 12.77v2.49L16.03 27l2.128-1.245v-2.49L16.03 24.51zM10.24 19.36l2.128 1.245v-2.49l-2.128-1.245zm3.66-8.864 2.13 1.245 2.128-1.245L16.03 9.25zM8.73 11.74l2.128-1.245L8.73 9.25l-2.128 1.245v2.49l2.128 1.244zm0 4.25-2.128-1.246v6.74l5.789 3.37v-2.49L8.73 20.239z"}))),F||(F=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_chain_bsc_svg__a"},eU.createElement("path",{fill:"#fff",d:"M5 5h22v22H5z"})))))};function aN(){return(aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let a_=function(e){return eU.createElement("svg",aN({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none"},e),B||(B=eU.createElement("rect",{width:32,height:32,fill:"#6E54FE",rx:8})),I||(I=eU.createElement("path",{fill:"#fff",d:"M16 5C12.823 5 5 12.823 5 16s7.823 11 11 11 11-7.823 11-11S19.177 5 16 5m-1.714 17.29c-1.34-.365-4.941-6.665-4.576-8.004.365-1.34 6.665-4.941 8.004-4.576 1.34.365 4.941 6.665 4.576 8.004-.365 1.34-6.665 4.941-8.004 4.576"})))};function ak(){return(ak=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let ay=function(e){return eU.createElement("svg",ak({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none"},e),T||(T=eU.createElement("rect",{width:32,height:32,fill:"#000",rx:8})),eU.createElement("g",{clipPath:"url(#ic_chain_solana_svg__a)"},eU.createElement("mask",{id:"ic_chain_solana_svg__b",width:20,height:17,x:6,y:8,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},U||(U=eU.createElement("path",{fill:"#fff",d:"M25.996 8H6v16.962h19.996z"}))),z||(z=eU.createElement("g",{mask:"url(#ic_chain_solana_svg__b)"},eU.createElement("path",{fill:"url(#ic_chain_solana_svg__c)",d:"m25.893 21.374-3.301 3.357a.8.8 0 0 1-.56.231H6.382a.4.4 0 0 1-.21-.06.37.37 0 0 1-.141-.158.35.35 0 0 1 .071-.393l3.303-3.358a.8.8 0 0 1 .255-.17q.146-.06.304-.06h15.647c.075 0 .148.02.21.059a.37.37 0 0 1 .142.159.35.35 0 0 1-.072.393m-3.301-6.762a.8.8 0 0 0-.255-.17.8.8 0 0 0-.306-.06H6.383a.4.4 0 0 0-.21.059.37.37 0 0 0-.141.159.35.35 0 0 0 .071.393l3.303 3.357q.109.11.255.17t.304.061h15.647c.075 0 .148-.02.21-.06a.37.37 0 0 0 .142-.158.35.35 0 0 0-.072-.393zM6.383 12.2h15.648a.8.8 0 0 0 .56-.23l3.301-3.359a.347.347 0 0 0 .071-.393.37.37 0 0 0-.14-.158.4.4 0 0 0-.21-.06H9.964a.8.8 0 0 0-.559.231l-3.302 3.358a.346.346 0 0 0-.071.393.37.37 0 0 0 .14.158c.063.04.136.06.21.06"})))),H||(H=eU.createElement("defs",null,eU.createElement("linearGradient",{id:"ic_chain_solana_svg__c",x1:7.688,x2:23.133,y1:25.367,y2:7.01,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{offset:.08,stopColor:"#9945FF"}),eU.createElement("stop",{offset:.3,stopColor:"#8752F3"}),eU.createElement("stop",{offset:.5,stopColor:"#5497D5"}),eU.createElement("stop",{offset:.6,stopColor:"#43B4CA"}),eU.createElement("stop",{offset:.72,stopColor:"#28E0B9"}),eU.createElement("stop",{offset:.97,stopColor:"#19FB9B"})),eU.createElement("clipPath",{id:"ic_chain_solana_svg__a"},eU.createElement("path",{fill:"#fff",d:"M6 8h20v17H6z"})))))};function aE(){return(aE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aA=function(e){return eU.createElement("svg",aE({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),W||(W=eU.createElement("path",{fill:"#6C757D",fillRule:"evenodd",d:"M10.772 12.995a.78.78 0 0 0 0-1.1L6.878 8l3.894-3.894a.778.778 0 0 0-1.1-1.1L5.228 7.45a.78.78 0 0 0 0 1.1l4.444 4.445a.78.78 0 0 0 1.1 0",clipRule:"evenodd"})))};function aC(){return(aC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aS=function(e){return eU.createElement("svg",aC({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),V||(V=eU.createElement("path",{fill:"#6C757D",fillRule:"evenodd",d:"M5.228 12.995a.78.78 0 0 1 0-1.1L9.122 8 5.228 4.106a.778.778 0 1 1 1.1-1.1l4.444 4.444a.78.78 0 0 1 0 1.1l-4.444 4.445a.78.78 0 0 1-1.1 0",clipRule:"evenodd"})))},aD=[{label:"Solana",namespace:"solana",chain:"solana"},{label:"Monad",namespace:"eip155",chain:"monad"},{label:"BSC",namespace:"eip155",chain:"bsc"}],aP=e=>{let{walletName:t,walletIcon:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r,showLoginLoadingDialog:s,showSelectWalletDialog:n}=rZ();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-5 w-screen md:w-[360px] flex flex-col items-center",children:[(0,eB.jsxs)("div",{className:"h-6 w-full flex items-center justify-between",children:[(0,eB.jsx)(aA,{className:"w-4 h-4 cursor-pointer text-text-light fill-current",onClick:()=>{r(),n()}}),(0,eB.jsx)(lw,{className:"ml-auto w-6 h-6 cursor-pointer text-text-dark fill-current",onClick:()=>r()})]}),l?(0,eB.jsx)("img",{className:"w-14 h-14 mt-3",src:l,alt:t}):(0,eB.jsx)(lr,{className:"w-14 h-14 mt-3"}),(0,eB.jsx)("span",{className:"mt-3 text-text-dark text-2xl leading-[31px] font-medium text-center",children:t}),(0,eB.jsx)("span",{className:"mt-3 text-text-light text-sm leading-[18px] text-center",children:a("home.select_chain_to_connect")}),(0,eB.jsx)("div",{className:"mt-8 w-full flex flex-col gap-3",children:aD.map(e=>
1(0,eB.jsxs)("button",{type:"button",className:"w-full h-14 rounded-xl px-4 flex items-center text-left cursor-pointer bg-add-balance-background hover:bg-wallet-list-item-hover",onClick:()=>(e=>{r(),s(t,{chainNamespace:e.namespace,chain:e.chain})})(e),children:[(e=>"solana"===e.chain?(0,eB.jsx)(ay,{className:"w-8 h-8 shrink-0"}):"bsc"===e.chain?(0,eB.jsx)(aj,{className:"w-8 h-8 shrink-0"}):(0,eB.jsx)(a_,{className:"w-8 h-8 shrink-0"}))(e),(0,eB.jsx)("span",{className:"ml-5 text-text-dark text-sm font-medium leading-[18px] flex-1 truncate",children:e.label}),(0,eB.jsx)(aS,{className:"w-4 h-4 shrink-0"})]},e.label))})]})};var aM=l(50989),aO=l(34852);function aR(){return(aR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aL=function(e){return eU.createElement("svg",aR({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none"},e),G||(G=eU.createElement("rect",{width:32,height:32,y:.004,fill:"#fff",rx:8})),eU.createElement("g",{clipPath:"url(#ic_google_svg__a)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3462.52,height:3462.52,x:-1731.26,y:-1731.26,transform:"matrix(.01015 -.00587 .00586 .01016 12.867 15.012)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),$||($=eU.createElement("path",{d:"M27.5 16.706c0-.85-.076-1.669-.218-2.454H19v4.647h3.442c-.283 1.495-1.133 2.76-2.408 3.611v3.022h3.89c2.268-2.095 3.576-5.171 3.576-8.826","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":20.305124282836914,"m01":11.720788002014160,"m02":-3.1455023288726807,"m10":-11.730762481689453,"m11":20.322402954101562,"m12":10.715899467468262},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_svg__b)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3462.52,height:3462.52,x:-1731.26,y:-1731.26,transform:"matrix(.01015 -.00587 .00586 .01016 12.867 15.012)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),q||(q=eU.createElement("path",{d:"M15.99 28.434c3.237 0 5.951-1.07 7.935-2.902l-3.891-3.022c-1.069.72-2.431 1.156-4.044 1.156-3.118 0-5.766-2.105-6.714-4.942h-3.99v3.099c1.973 3.916 6.017 6.61 10.704 6.61","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":20.305124282836914,"m01":11.720788002014160,"m02":-3.1455023288726807,"m10":-11.730762481689453,"m11":20.322402954101562,"m12":10.715899467468262},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_svg__c)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3462.52,height:3462.52,x:-1731.26,y:-1731.26,transform:"matrix(.01015 -.00587 .00586 .01016 12.867 15.012)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),Q||(Q=eU.createElement("path",{d:"M9.276 18.714a7.2 7.2 0 0 1-.382-2.28c0-.797.142-1.56.382-2.28v-3.099h-3.99A11.86 11.86 0 0 0 4 16.434c0 1.941.469 3.763 1.286 5.378l3.107-2.422z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":20.305124282836914,"m01":11.720788002014160,"m02":-3.1455023288726807,"m10":-11.730762481689453,"m11":20.322402954101562,"m12":10.715899467468262},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_svg__d)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3462.52,height:3462.52,x:-1731.26,y:-1731.26,transform:"matrix(.01015 -.00587 .00586 .01016 12.867 15.012)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),X||(X=eU.createElement("path",{d:"M15.99 9.212c1.766 0 3.335.61 4.589 1.789l3.433-3.436c-2.082-1.942-4.785-3.131-8.022-3.131-4.687 0-8.731 2.694-10.704 6.621l3.99 3.099c.948-2.837 3.596-4.942 6.714-4.942","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95
1686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":20.305124282836914,"m01":11.720788002014160,"m02":-3.1455023288726807,"m10":-11.730762481689453,"m11":20.322402954101562,"m12":10.715899467468262},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),K||(K=eU.createElement("path",{fill:"#4285F4",d:"M16 18.901V14.25h3v4.651z"})),Z||(Z=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_google_svg__a"},eU.createElement("path",{d:"M27.5 16.706c0-.85-.076-1.669-.218-2.454H19v4.647h3.442c-.283 1.495-1.133 2.76-2.408 3.611v3.022h3.89c2.268-2.095 3.576-5.171 3.576-8.826"})),eU.createElement("clipPath",{id:"ic_google_svg__b"},eU.createElement("path",{d:"M15.99 28.434c3.237 0 5.951-1.07 7.935-2.902l-3.891-3.022c-1.069.72-2.431 1.156-4.044 1.156-3.118 0-5.766-2.105-6.714-4.942h-3.99v3.099c1.973 3.916 6.017 6.61 10.704 6.61"})),eU.createElement("clipPath",{id:"ic_google_svg__c"},eU.createElement("path",{d:"M9.276 18.714a7.2 7.2 0 0 1-.382-2.28c0-.797.142-1.56.382-2.28v-3.099h-3.99A11.86 11.86 0 0 0 4 16.434c0 1.941.469 3.763 1.286 5.378l3.107-2.422z"})),eU.createElement("clipPath",{id:"ic_google_svg__d"},eU.createElement("path",{d:"M15.99 9.212c1.766 0 3.335.61 4.589 1.789l3.433-3.436c-2.082-1.942-4.785-3.131-8.022-3.131-4.687 0-8.731 2.694-10.704 6.621l3.99 3.099c.948-2.837 3.596-4.942 6.714-4.942"})))))};function aF(){return(aF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aB=function(e){return eU.createElement("svg",aF({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none"},e),J||(J=eU.createElement("path",{fill:"#EDBE18",d:"M16.336 40.146a2.66 2.66 0 0 1 0 3.759l-8.773 8.772a4.43 4.43 0 0 1-6.265-6.266l8.772-8.772a2.66 2.66 0 0 1 3.76 0z"})),Y||(Y=eU.createElement("path",{fill:"#EDBE18",d:"M35.29 39.058a4.43 4.43 0 0 1-.157 6.1L17.589 62.702a4.43 4.43 0 1 1-6.266-6.265L24.48 43.278a1.77 1.77 0 0 0 0-2.506L1.298 17.59a4.43 4.43 0 0 1 6.265-6.266l27.57 27.57q.08.08.157.165M52.677 56.437a4.43 4.43 0 0 1-6.266 6.265L37.64 53.93a2.66 2.66 0 0 1 0-3.76l2.506-2.506a2.66 2.66 0 0 1 3.76 0zM26.36 10.07a2.66 2.66 0 0 1 0 3.76l-2.505 2.506a2.66 2.66 0 0 1-3.76 0l-8.772-8.773a4.43 4.43 0 0 1 6.266-6.265zM
152.677 1.298a4.43 4.43 0 0 1 0 6.265L39.52 20.722a1.77 1.77 0 0 0 0 2.506L62.702 46.41a4.43 4.43 0 1 1-6.265 6.266l-27.57-27.57a4.43 4.43 0 0 1 0-6.265L46.411 1.298a4.43 4.43 0 0 1 6.266 0"})),ee||(ee=eU.createElement("path",{fill:"#EDBE18",d:"M62.702 11.323a4.43 4.43 0 0 1 0 6.266L53.93 26.36a2.66 2.66 0 0 1-3.76 0l-2.506-2.506a2.66 2.66 0 0 1 0-3.76l8.773-8.772a4.43 4.43 0 0 1 6.265 0"})))},aI=l.p+"static/media/ic_login_more_wallet.927d0b31.svg",aT=l.p+"static/media/ic_login_more_wallet_light.75c319b0.svg";var aU=l(16031),az=l(71338),aH=l(24683),aW=l(53208);let aV=()=>{let{hideDialog:e,showWalletLoginLoadingDialog:t,showLoginLoadingDialog:l}=rZ(),a=localStorage.getItem(e3.l_)||"",{t:r}=(0,ez.Bd)(),{caipNetwork:s}=(0,tK.HV)(),n=(0,tK.G8)(),{disconnect:i}=(0,tK.uP)(),o=(0,e2.useSearchParams)(),c=(0,aW.U)(e=>e.appKit),d=function(){let{initialized:e}=(0,tK.KN)();return e}(),{theme:x}=(0,aO.D)(),m=(null==s?void 0:s.name)==="Sui",u=lO(m?"sui":(null==s?void 0:s.chainNamespace)==="eip155"?"eip155":"solana"),[p,f]=(0,eU.useState)(!1),h=(0,eU.useRef)(!1),g=(0,eU.useRef)(!1),b=async t=>{if(g.current)return;g.current=!0;let a=(console.log("caipNetwork",s),(null==s?void 0:s.id)===aM.NBY.id)?{chainNamespace:"eip155",chain:"bsc"}:(null==s?void 0:s.id)===aM.aUf.id?{chainNamespace:"eip155",chain:"monad"}:m?{chainNamespace:"sui",chain:"sui"}:{chainNamespace:"solana",chain:"solana"};(0,e9.$s)(e9.uu,{wallet_type:t});try{"connected"===n.status&&await i(),e(),l(t,a)}catch(e){console.error("disconnect before connecting wallet failed:",e)}finally{g.current=!1}},v=async()=>{if(d){if("connected"===n.status){h.current=!0;try{await i()}catch(e){console.error("disconnect before opening more wallets failed:",e)}}f(!0),null==c||c.open({view:"ConnectingWalletConnectBasic"})}};return(0,eU.useEffect)(()=>{if(console.log("useEffect appKitAccount",n),p){if(h.current){"connected"!==n.status&&(h.current=!1);return}"connected"===n.status&&n.address&&""!==n.address&&(e(),t())}},[n,p]),(0,eU.useEffect)(()=>{(0,e9.$s)(e9.KW)},[]),(0,eB.jsxs)(e$,{className:"px-6 bg-dialog-background rounded-t-2xl md:rounded-2xl pb-10 w-screen md:w-[408px] flex flex-col items-center",children:[(0,eB.jsx)(lw,{className:"mt-6 ml-auto w-6 h-6 cursor-pointer text-text-dark fill-current",onClick:()=>e()}),(0,eB.jsxs)("div",{className:"w-full mt-1 flex flex-col items-center",children:[(0,eB.jsx)(aB,{className:"w-16 h-16"}),(0,eB.jsx)("span",{className:"text-text-dark text-[24px] font-medium mt-4",children:r("home.login_hint1")}),(0,eB.jsx)("span",{className:"text-text-light text-sm mt-2",children:r("home.login_hint2")})]}),(0,eB.jsxs)("div",{className:"flex items-center w-full h-14 px-4 cursor-pointer mt-2.5 mx-6 rounded-xl bg-add-balance-background hover:bg-wallet-list-item-hover",onClick:()=>(()=>{let e=(0,eG.IP)(),t="guid=".concat(e),l=o.get("ref");l&&""!==l&&((0,eG.cZ)(l),t="".concat(t,"&ref=").concat(l)),window.location.href="".concat("https://api.xstable.ai/","xstable/user-service/oauth2/authorize/google?").concat(t)})(),children:[(0,eB.jsx)(aL,{className:"w-8 h-8"}),(0,eB.jsx)("span",{className:"text-text-dark ml-2.5 font-600 text-sm",children:"Google"}),"Google"===a?(0,eB.jsx)("div",{className:"flex-1 flex flex-row justify-end",children:(0,eB.jsx)("span",{className:"text-sm text-text-dark bg-login-recent-background rounded px-3 py-0.5",children:r("trade.recent")})}):(0,eB.jsx)(eB.Fragment,{})]}),(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"w-full flex flex-row items-center my-3.5",children:[(0,eB.jsx)("div",{className:"w-full flex-1 h-[1px] bg-market-border-color ml-4 mr-2.5 "}),(0,eB.jsx)("div",{className:"text-text-light",children:r("home.or")}),(0,eB.jsx)("div",{className:"w-full flex-1 h-[1px] bg-market-border-color ml-2.5 mr-4"})]}),u.map((e,t)=>(0,eB.jsxs)("button",{className:"flex items-center w-full h-14 px-4 cursor-pointer mt-2.5 mx-6 rounded-xl bg-add-balance-background hover:bg-wallet-list-item-hover",type:"button",onClick:()=>b(e.name),children:[(0,eB.jsx)("img",{className:"w-8 h-8 rounded-lg shrink-0",src:e.icon,alt:e.name}),(0,eB.jsxs)("div",{className:"ml-2.5 flex items-center min-w-0 flex-1",children:[(0,eB.jsx)("span",{className:"text-text-dark font-medium text-sm leading-[18px] truncate",children:e.name}),a===e.name&&(0,eB.jsx)("span",{className:"ml-2 h-[22px] px-2 rounded-md bg-text-light/10 text-text-light text-sm font-medium leading-[22px] flex items-center shrink-0",children:r("trade.recent")}
1)]}),(0,eB.jsxs)("div",{className:"ml-3 hidden items-center shrink-0",children:[(0,eB.jsx)("div",{className:"w-5 h-5 rounded-full border border-add-balance-background bg-black flex items-center justify-center overflow-hidden",children:(0,eB.jsx)(aH.A,{className:"w-[18px] h-[18px]"})}),(0,eB.jsx)("div",{className:"w-5 h-5 -ml-1 rounded-full border border-add-balance-background bg-[#6E54FF] flex items-center justify-center overflow-hidden",children:(0,eB.jsx)(az.A,{className:"w-[18px] h-[18px]"})}),(0,eB.jsx)("div",{className:"w-5 h-5 -ml-1 rounded-full border border-add-balance-background bg-[#0B0E11] flex items-center justify-center overflow-hidden",children:(0,eB.jsx)(aU.A,{className:"w-[18px] h-[18px]"})}),(0,eB.jsx)(aS,{className:"ml-3 w-4 h-4"})]})]},t)),(0,eB.jsxs)("div",{className:"flex items-center w-full h-14 px-4 bg-add-balance-background mt-2.5 mx-6 rounded-xl ".concat(d?"cursor-pointer hover:bg-wallet-list-item-hover":"cursor-not-allowed opacity-50"),onClick:()=>v(),children:[(0,eB.jsx)("img",{className:"w-8 h-8",src:"light"===x?aT:aI,alt:""}),(0,eB.jsx)("span",{className:"text-text-dark ml-2.5 font-600 text-sm",children:d?"More Wallet":"Loading..."})]})]})]})};function aG(){return(aG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let a$=function(e){return eU.createElement("svg",aG({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none"},e),et||(et=eU.createElement("path",{fill:"currentColor",d:"M6 4a3 3 0 0 1 3-3h7.5a3 3 0 0 1 3 3v7.5a3 3 0 0 1-3 3V7a3 3 0 0 0-3-3z"})),el||(el=eU.createElement("path",{fill:"currentColor",d:"M4.5 5.5a3 3 0 0 0-3 3V16a3 3 0 0 0 3 3H12a3 3 0 0 0 3-3V8.5a3 3 0 0 0-3-3z"})))};function aq(){return(aq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aQ=function(e){return eU.createElement("svg",aq({xmlns:"http://www.w3.org/2000/svg",width:14,height:14,fill:"none"},e),ea||(ea=eU.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.3,d:"M7.9 6.098a2.55 2.55 0 0 0-3.602 0L2.496 7.899A2.548 2.548 0 1 0 6.1 11.502l.901-.9"})),er||(er=eU.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.3,d:"M6.102 7.9a2.55 2.55 0 0 0 3.603 0l1.801-1.8a2.548 2.548 0 1 0-3.603-3.604l-.9.901"})))};function aX(){return(aX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aK=function(e){return eU.createElement("svg",aX({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none"},e),es||(es=eU.createElement("path",{fill:"currentColor",d:"M17.391 13.732c.612 0 1.109.526 1.109 1.175v3.918c0 .648-.497 1.175-1.109 1.175H2.61c-.612 0-1.109-.527-1.109-1.175v-3.918c0-.649.497-1.175 1.109-1.175s1.11.526 1.11 1.175v2.741H16.28v-2.741c0-.649.498-1.175 1.11-1.175"})),en||(en=eU.createElement("path",{fill:"currentColor",d:"M12.429 0c.67 0 1.214.561 1.214 1.254v4.985h2.349c1.125 0 1.712 1.296.949 2.096l-5.993 6.278a1.32 1.32 0 0 1-1.895 0L3.059 8.335c-.763-.8-.176-2.096.949-2.096h2.35V1.254C6.357.56 6.9 0 7.57 0z"})))};function aZ(){return(aZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let aJ=function(e){return eU.createElement("svg",aZ({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none"},e),eU.createElement("mask",{id:"ic_share_profit_user_svg__a",width:64,height:64,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},ei||(ei=eU.createElement("path",{fill:"#212529",d:"M32 64c-13.332 0-19.999 0-24.672-3.395a17.8 17.8 0 0 1-3.933-3.933C0 51.999 0 45.332 0 32S0 12.001 3.395 7.328a17.8 17.8 0 0 1 3.933-3.933C12.001 0 18.668 0 32 0s19.999 0 24.672 3.395a17.8 17.8 0 0 1 3.933 3.933C64 12.001 64 18.668 64 32s0 19.999-3.395 24.672a17.8 17.8 0 0 1-3.933 3.933C51.999 64 45.332 64 32 64"}))),eo||(eo=eU.createElement("g",{mask:"url(#ic_share_profit_user_svg__a)"},eU.createElement("path",{fill:"#212529",d:"M32 64c-13.332 0-19.999 0-24.672-3.395a17.8 17.8 0 0 1-3.933-3.933C0 51.999 0 45.332 0 32S0 12.001 3.395 7.328a17.8 17.8 0 0 1 3.933-3.933C12.001 0 18.668 0 32 0s19.999 0 24.672 3.395a17.8 17.8 0 0 1 3.933 3.933C64 12.001 64 18.668 64 32s0 19.999-3.395 24.672a17.8 17.8 0 0 1-3.933 3.933C51.999 64 45.332 64 32 64"}),eU.createElement("path",{fill:"#EDBE18",d:"M9.602 54.643c4.163-8.028 12.653-13.526 22.448-13.526 9.72 0 18.154 5.414 22.352 13.34M40.444 26.246c0 4.774-3.937 8.644-8.794 8.644-4.856 0-8.793-3.87-8.793-8.644s3.937-8.644 8.794-8.644c4.856 0 8.793 3.87 8.793 8.644"}),eU.createElement("path",{fill:"#EDBE18",d:"M9.602 54.643c4.163-8.028 12.653-13.526 22.448-13.526 9.72 0 18.154 5.414 22.352 13.34v6.345h-44.8z"}),eU.createElement("path",{fill:"#fff",d:"M9.602 54.643c4.163-8.028 12.653-13.526 22.448-13.526 9.72 0 18.154 5.413 22.352 13.34"}),eU.createElement("path",{fill:"#fff",d:"M9.602 54.643c4.163-8.028 12.653-13.526 22.448-13.526 9.72 0 18.154 5.413 22.352 13.34V60.8h-44.8z"}),eU.createElement("path",{stroke:"#212529",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M32 1.5c6.7 0 11.604.002 15.422.416 3.79.41 6.33 1.212 8.368 2.692a16.3 16.3 0 0 1 3.602 3.602c1.48 2.038 2.281 4.579 2.692 8.368.414 3.818.416 8.722.416 15.422s-.002 11.604-.416 15.422c-.41 3.79-1.212 6.33-2.692 8.368a16.3 16.3 0 0 1-3.602 3.602c-2.038 1.48-4.579 2.281-8.368 2.692-3.818.414-8.722.416-15.422.416s-11.604-.002-15.422-.416c-3.79-.41-6.33-1.212-8.368-2.692a16.3 16.3 0 0 1-3.602-3.602c-1.48-2.038-2.281-4.579-2.692-8.368C1.502 43.604 1.5 38.7 1.5 32s.002-11.604.416-15.422c.41-3.79 1.212-6.33 2.692-8.368A16.3 16.3 0 0 1 8.21 4.608c2.038-1.48 4.579-2.281 8.368-2.692C20.396 1.502 25.3 1.5 32 1.5"}),eU.createElement("path",{fill:"url(#ic_share_profit_user_svg__b)",fillOpacity:.8,d:"M.523 9.496a40 40 0 0 0-.529 6.506c0 22.091 17.909 40 40 40 13.746 0 25.87-6.934 33.07-17.494-3.107 18.997-19.594 33.494-39.47 33.494-22.092 0-40-17.909-40-40A39.8 39.8 0 0 1 .524 9.496"}),eU.createElement("path",{fill:"url(#ic_share_profit_user_svg__c)",fillOpacity:.8,d:"M64.32 22.012c-3.552 18.454-19.784 32.394-39.275 32.394-13.622 0-25.651-6.811-32.874-17.212a40 40 0 0 0-.726 7.606c0 22.091 17.909 40 40 40s40-17.909 40-40a39.8 39.8 0 0 0-7.125-22.788"}))),ec||(ec=eU.createElement("defs",null,eU.createElement("linearGradient",{id:"ic_share_profit_user_svg__b",x1:73.064,x2:-6.406,y1:40.749,y2:40.749,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#EDBE18",stopOpacity:0}),eU.createElement("stop",{offset:1,stopColor:"#EDBE18"})),eU.createElement("linearGradient",{id:"ic_share_profit_user_svg__c",x1:-8.555,x2:71.445,y1:53.406,y2:53.406,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#EDBE18",stopOpacity:.4}),eU.createElement("stop",{offset:1,stopColor:"#EDBE18",stopOpacity:.4})))))},aY=l.p+"static/media/ic_share_profit_user.b610f78d.svg";function a0(){return(a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let a1=function(e){return eU.createElement("svg",a0({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none"},e),ed||(ed=eU.createElement("path",{fill:"currentColor",d:"M15.676 2h2.76l-6.03 6.778L19.5 18h-5.555l-4.35-5.594L4.617 18H1.855l6.45-7.25L1.5 2h5.695l3.933 5.113zm-.969 14.375h1.53L6.364 3.54h-1.64z"})))};var a2=l(47805);let a5="https://cdn.xstable.ai",a3="20260910_0000",a6=["".concat(a5,"/share/share_profit_1.png?v=").concat(a3),"".concat(a5,"/share/share_profit_2.png?v=").concat(a3),"".concat(a5,"/share/share_profit_3.png?v=").concat(a3),"".concat(a5,"/share/share_profit_4.png?v=").concat(a3)],a4=["".concat(a5,"/share/share_profit_loss_1.png?v=").concat(a3),"".concat(a5,"/share/share_profit_loss_2.png?v=").concat(a3)];function a7(e){let{data:t,backgroundSrc:l}=e,{date:a,zoneTime:r}=rs(t.time),{amount:s,unit:n}=rn(t.profitAmount),i=!s.startsWith("-"),o="SHORT"===t.side,c=(0,eU.useMemo)(()=>{var e;return null!=(e=(0,a2.zW)(t.symbol))?e:""},[t.symbol]);
1return(0,eB.jsx)("div",{className:"mx-auto shrink-0 overflow-hidden rounded-xl",style:{width:324,height:445.5},children:(0,eB.jsxs)("div",{className:"relative origin-top-left overflow-hidden text-white",style:{width:1080,height:1485,transform:"scale(".concat(.3,")")},children:[(0,eB.jsx)(lo.default,{src:l,alt:"",fill:!0,className:"object-fill",priority:!0}),(0,eB.jsxs)("div",{className:"absolute right-[68px] top-[72px] w-[280px] text-right text-[28px] leading-[36px] text-white/60",children:[(0,eB.jsx)("div",{children:a}),(0,eB.jsx)("div",{className:"whitespace-nowrap",children:r})]}),(0,eB.jsxs)("div",{className:"absolute left-[68px] top-[280px] flex h-[73px] items-center gap-6",children:[(0,eB.jsx)(a8,{imageUrl:c}),(0,eB.jsx)("span",{className:"w-[242px] shrink-0 text-[56px] font-medium leading-[73px]",children:t.symbol}),(0,eB.jsxs)("span",{className:"flex h-[54px] w-[236px] shrink-0 items-center justify-center rounded-[38px] border text-[32px] leading-[42px] ".concat(o?"border-[#E43C5A66] bg-[#E43C5A29] text-[#E43C5A]":"border-[#2EBD8566] bg-[#2EBD8529] text-[#13E895]"),children:[t.side," ",t.leverage,"x"]})]}),(0,eB.jsx)("div",{className:"absolute left-[68px] top-[464px] text-[116px] font-medium leading-none ".concat(i?"text-[#13E895]":"text-[#E43C5A]"),children:t.profitPercent}),(0,eB.jsxs)("div",{className:"absolute left-[68px] top-[610px] text-[56px] font-medium leading-none",children:[(0,eB.jsx)("span",{className:i?"text-[#13E895]":"text-[#E43C5A]",children:s}),n&&(0,eB.jsxs)(eB.Fragment,{children:[" ",(0,eB.jsx)("span",{children:n})]})]}),(0,eB.jsxs)("div",{className:"absolute left-[68px] top-[786px] text-[36px] leading-[54px]",children:[(0,eB.jsx)("div",{className:"text-white/60 font-normal",children:t.entryPriceLabel}),(0,eB.jsx)("div",{className:"font-medium",children:t.entryPrice}),(0,eB.jsx)("div",{className:"mt-8 text-white/60 font-normal",children:t.closePriceLabel}),(0,eB.jsx)("div",{className:"font-medium",children:t.closePrice})]}),(0,eB.jsxs)("div",{className:"absolute right-0 top-[1048px] flex h-[104px] w-[400px] items-center rounded-l-[52px] bg-black/60 py-5 pl-6 pr-20",children:[(0,eB.jsx)(aJ,{className:"h-16 w-16 shrink-0"}),(0,eB.jsx)("span",{className:"ml-6 text-[40px] leading-[52px]",children:t.displayName})]}),(0,eB.jsxs)("div",{className:"absolute bottom-0 left-12 flex h-[260px] flex-col justify-center",children:[(0,eB.jsx)("div",{className:"text-[36px] font-medium leading-[46px] text-[#6C757D] whitespace-pre",children:t.scanText}),(0,eB.jsxs)("div",{className:"mt-6 text-[56px] font-semibold leading-[46px] text-[#212529]",children:[t.referralCodeLabel,":"," ",t.referralCode]})]}),(0,eB.jsx)("div",{className:"absolute bottom-[30px] right-12 flex h-[200px] w-[200px] items-center justify-center bg-white",children:(0,eB.jsx)(t_.X,{id:"share-profit-card-qr",value:t.link,size:174,marginSize:0})})]})})}function a8(e){let{imageUrl:t}=e;return(0,eB.jsx)("img",{src:t,alt:"",className:"h-16 w-16 shrink-0 object-cover"})}function a9(e){let{icon:t,label:l,onClick:a}=e;return(0,eB.jsxs)("button",{type:"button",className:"flex cursor-pointer flex-col items-center gap-3 text-text-dark md:gap-1.5",onClick:a,children:[(0,eB.jsx)("span",{className:"flex w-13 h-13 items-center justify-center rounded-full bg-dialog-tpsl-input-background md:h-11 md:w-11",children:(0,eB.jsx)("span",{className:"flex h-5 w-5 items-center justify-center",children:t})}),(0,eB.jsx)("span",{className:"text-sm font-medium md:text-xs",children:l})]})}async function re(e,t){var l;let a=document.createElement("canvas");a.width=1080,a.height=1485;let r=a.getContext("2d");if(!r)return;let s=await rr(t),n=document.getElementById("share-profit-card-qr"),i=null!=(l=(0,a2.zW)(e.symbol))?l:"",o=i?await rr(i):null,c=await rr(aY);r.drawImage(s,0,0,1080,1485),await rt(r,e,o,c),r.fillStyle="#FFFFFF",r.fillRect(832,1255,200,200),n&&r.drawImage(n,845,1268,174,174),a.toBlob(t=>{if(!t)return;let l=URL.createObjectURL(t),a=document.createElement("a");a.href=l,a.download="xstable-profit-".concat(e.referralCode,".png"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(l)},"image/png")}async function rt(e,t,l,a){let{date:r,zoneTime:s}=rs(t.time),{amount:n,unit:i}=rn(t.profitAmount),o=!n.startsWith("-"),c="SHORT"===t.side;e.textBaseline="top",e.textAlign="right",e.fillStyle="rgba(255, 255, 255, 0.6)",e.font="400 28px 'IBM Plex Sans', Arial, sans-serif",e.fillText(r,1012,72),e.fillText(s,1012,108);await rl(e,68,284.5,l),e.textAlign="left",e.fillStyle="#FFFFFF",e.font="500 56px 'IBM Plex Sans', Arial, sans-serif",ra(e,t.symbol,156,280,242,73,"left"),function(e,t,l,a,r){let s=27;e.beginPath(),e.moveTo(422+s,l),e.lineTo(t+236-s,l),e.arc(t+a-s,l+s,s,-Math.PI/2,Math.PI/2),e.lineTo(t+s,l+r),e.arc(t+s,l+s,s,Math.PI/2,-Math.PI/2),e.closePath()}(e,422,289.5,236,54),e.fillStyle=c?"rgba(228, 60, 90, 0.16)":"rgba(46, 189, 133, 0.16)",e.fill(),e.strokeStyle=c?"rgba(228, 60, 90, 0.4)":"rgba(46, 189, 133, 0.4)",e.lineWidth=2,e.stroke(),e.fillStyle=c?"#E43C5A":"#13E895",e.font="400 32px 'IBM Plex Sans', Arial, sans-serif",ra(e,"".concat(t.side," ").concat(t.leverage,"x"),422,289.5,236,54,"center"),e.textBaseline="top",e.fillStyle=o?"#13E895":"#E43C5A",e.font="500 116px 'IBM Plex Sans', Arial, sans-serif",e.fillText(t.profitPercent,68,464),e.fillStyle=o?"#13E895":"#E43C5A",e.font="500 56px 'IBM Plex Sans', Arial, sans-serif",e.fillText(n,68,610),i&&(e.fillStyle="#FFFFFF",e.fillText(i,68+e.measureText("".concat(n," ")).width,610)),e.font="400 36px 'IBM Plex Sans', Arial, sans-serif",e.fillStyle="rgba(255, 255, 255, 0.6)",e.fillText(t.entryPriceLabel,68,786),e.fillStyle="#FFFFFF",e.font="500 36px 'IBM Plex Sans', Arial, sans-serif",e.fillText(t.entryPrice,68,840),e.fillStyle="rgba(255, 255, 255, 0.6)",e.font="400 36px 'IBM Plex Sans', Arial, sans-serif",e.fillText(t.closePriceLabel,68,926),e.fillStyle="#FFFFFF",e.font="500 36px 'IBM Plex Sans', Arial, sans-serif",e.fillText(t.closePrice,68,980),function(e,t,l,a,r){let s=52;e.beginPath(),e.moveTo(680+s,1048),e.lineTo(t+400,l),e.lineTo(t+a,l+r),e.lineTo(t+s,l+r),e.arc(t+s,l+s,s,Math.PI/2,-Math.PI/2),e.closePath()}(e,680,1048,400,104),e.fillStyle="rgba(0, 0, 0, 0.6)",e.fill(),e.drawImage(a,704,1068,64,64),e.fillStyle="#FFFFFF",e.font="400 40px 'IBM Plex Sans', Arial, sans-serif",e.fillText(t.displayName,792,1084);let d=t.scanText.split(/\r?\n/).length,x=1225+(260-(46*d+24+67))/2;e.fillStyle="#6C757D",e.font="500 36px 'IBM Plex Sans', Arial, sans-serif",function(e,t,l,a,r){let s=t.split(/\r?\n/);
1s.forEach((t,l)=>{e.fillText(t,48,a+46*l)}),s.length}(e,t.scanText,48,x,46),e.fillStyle="#212529",e.font="600 56px 'IBM Plex Sans', Arial, sans-serif",e.fillText("".concat(t.referralCodeLabel,": ").concat(t.referralCode),48,x+46*d+24)}async function rl(e,t,l,a){a&&e.drawImage(a,t,l,64,64)}function ra(e,t,l,a,r,s,n){let i=e.textAlign,o=e.textBaseline;e.textAlign=n,e.textBaseline="alphabetic";let c=e.measureText(t),d=c.actualBoundingBoxAscent,x=c.actualBoundingBoxDescent;e.fillText(t,"center"===n?l+r/2:l,a+s/2+(d-x)/2),e.textAlign=i,e.textBaseline=o}function rr(e){return new Promise((t,l)=>{let a=new window.Image;a.crossOrigin="anonymous",a.onload=()=>t(a),a.onerror=l,a.src=e})}function rs(e){let t=e.indexOf("(UTC"),l=e.indexOf(")",t);if(t<0||l<0)return{date:e,zoneTime:""};let a=e.slice(0,t).trim(),r=e.slice(t,l+1),s=e.slice(l+1).trim();return{date:a,zoneTime:"".concat(r," ").concat(s).trim()}}function rn(e){let[t,...l]=e.split(" ");return{amount:t,unit:l.join(" ")}}let ri=e=>{let{data:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ();(0,eU.useEffect)(()=>{(0,e9.$s)(e9.az)},[]);let r=t.referralLink||(0,eY.aK)(t.referralCode),s=l("partner.share_profit_default_message"),[n,i]=(0,eU.useState)(t.message||s),o=(0,eU.useMemo)(()=>{var e;return function(e){if(e){let e=Math.floor(Math.random()*a6.length);return a6[e]}let t=Math.floor(Math.random()*a4.length);return a4[t]}(!(null==(e=t.profitAmount)?void 0:e.startsWith("-")))},[t.profitAmount]),c=(0,eU.useMemo)(()=>({symbol:t.symbol||"GBP/USD",side:t.side||"LONG",leverage:t.leverage||500,profitPercent:t.profitPercent||"+19.20%",profitAmount:t.profitAmount||"+47.39 USD",entryPrice:t.entryPrice||"1.32024 USD",closePrice:t.closePrice||"1.32078 USD",displayName:t.displayName||"HhejD...akiU",time:t.time||"2026
1/06/25 (UTC+0) 16:02:15",referralCode:t.referralCode,link:r,referralCodeLabel:l("partner.share_profit_referral_code"),scanText:l("partner.share_profit_scan"),sharedTimeLabel:l("partner.share_profit_card_shared_time"),symbolLabel:l("partner.share_profit_card_symbol"),directionLabel:l("partner.share_profit_card_direction"),leverageLabel:l("partner.share_profit_card_leverage"),entryPriceLabel:l("partner.share_profit_card_entry_price"),closePriceLabel:t.isOpenPosition?l("partner.share_profit_card_latest_price"):l("partner.share_profit_card_close_price"),pnlLabel:l("partner.share_profit_card_pnl")}),[t,r,l]),d="".concat(n," ").concat(r),x=()=>{(0,eY.Dk)(d,l("partner.share_profit_copy_success"))},m=()=>{(0,e9.$s)(e9.Gl);let e=new URL("https://twitter.com/intent/tweet");e.searchParams.set("text",d),window.open(e.toString(),"_blank","noopener,noreferrer")},u=async()=>{(0,e9.$s)(e9.E4),await re(c,o),(0,eV.P0)("success",l("partner.share_profit_save_success"))};return(0,eB.jsxs)(e$,{className:"w-screen rounded-t-2xl text-text-dark md:w-[718px] md:overflow-y-auto md:rounded-2xl",children:[(0,eB.jsxs)("div",{className:"sticky top-0 z-10 flex h-16 rounded-t-2xl items-center justify-center bg-dialog-background px-4 after:absolute after:bottom-0 after:left-4 after:right-4 after:h-px after:bg-dialog-border-color md:justify-start md:items-start md:pt-6 md:px-6 md:after:left-6 md:after:right-6",children:[(0,eB.jsx)("span",{className:"text-xl font-semibold md:text-[20px]",children:l("partner.share_profit_title")}),(0,eB.jsx)("button",{type:"button","aria-label":l("home.close"),className:"absolute right-4 flex h-8 w-8 cursor-pointer items-center justify-center md:right-6",onClick:()=>{(0,e9.$s)(e9.rk),a()},children:(0,eB.jsx)(lw,{className:"h-6 w-6 text-text-light fill-current"})})]}),(0,eB.jsxs)("div",{className:"flex flex-col gap-8 px-4 py-4 pb-[150px] overflow-y-auto md:flex-row md:gap-7 md:px-6 md:py-4 md:pb-6",children:[(0,eB.jsx)(a7,{data:c,backgroundSrc:o}),(0,eB.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col md:w-[318px] md:flex-none md:pt-0",children:[(0,eB.jsx)("label",{className:"h-[18px] text-sm font-medium leading-[18px] text-text-dark",htmlFor:"share-profit-message",children:l("partner.share_profit_customize_message")}),(0,eB.jsxs)("div",{className:"mt-4 flex h-[95px] w-full flex-col rounded-lg border border-border-color px-3 py-3",children:[(0,eB.jsx)("textarea",{id:"share-profit-message",className:"h-14 w-full resize-none bg-transparent text-sm font-normal leading-[18px] text-text-light outline-none placeholder:text-text-light",maxLength:200,value:n,onChange:e=>i(e.target.value)}),(0,eB.jsxs)("div",{className:"h-4 text-right text-xs leading-4 text-text-light",children:[n.length,"/",200]})]}),(0,eB.jsxs)("button",{type:"button",className:"mt-4 flex h-[38px] w-full cursor-pointer items-center gap-3 rounded-lg bg-dialog-tpsl-input-background px-3 text-left",onClick:()=>{(0,eY.Dk)(r,l("partner.share_profit_copy_success"))},children:[(0,eB.jsx)(aQ,{className:"h-3.5 w-3.5 shrink-0 text-text-light"}),(0,eB.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-text-light",children:r}),(0,eB.jsx)(lG.A,{className:"h-3 w-3 shrink-0 text-text-dark"})]}),(0,eB.jsx)("div",{className:"mt-8 hidden h-[18px] text-sm font-medium leading-[18px] text-text-dark md:block",children:l("partner.share_profit_share")}),(0,eB.jsxs)("div",{className:"mt-3 hidden grid-cols-3 gap-8 md:flex md:gap-6 md:mt-3",children:[(0,eB.jsx)(a9,{icon:(0,eB.jsx)(aK,{className:"h-full w-full"}),label:l("partner.share_profit_save"),onClick:u}),(0,eB.jsx)(a9,{icon:(0,eB.jsx)(a$,{className:"h-full w-full"}),label:l("partner.share_profit_copy"),onClick:x}),(0,eB.jsx)(a9,{icon:(0,eB.jsx)(a1,{className:"h-full w-full"}),label:l("partner.share_profit_post_to_x"),onClick:m})]})]})]}),(0,eB.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-20 border-t border-dialog-border-color bg-dialog-background px-4 pt-4 pb-8 md:hidden",children:(0,eB.jsxs)("div",{className:"mx-auto grid w-[228px] grid-cols-3 gap-8",children:[(0,eB.jsx)(a9,{icon:(0,eB.jsx)(aK,{className:"h-full w-full"}),label:l("partner.share_profit_save"),onClick:u}),(0,eB.jsx)(a9,{icon:(0,eB.jsx)(a$,{className:"h-full w-full"}
1),label:l("partner.share_profit_copy"),onClick:x}),(0,eB.jsx)(a9,{icon:(0,eB.jsx)(a1,{className:"h-full w-full"}),label:l("partner.share_profit_post_to_x"),onClick:m})]})})]})},ro=e=>{let{onReset:t,onSearch:l}=e,{t:a}=(0,ez.Bd)(),{hideDialog:r}=rZ(),{dates:s,minDate:n,today:i,handleCalendarChange:o,resetDates:c}=tv();return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] pt-6 w-screen md:w-[420px] flex flex-col items-center px-5 pb-8",children:[(0,eB.jsx)(e0,{text:a("partner.search_filter")}),(0,eB.jsx)("span",{className:"self-start text-sm text-text-dark mt-4",children:a("partner.input_trade_date")}),(0,eB.jsxs)("div",{className:"flex justify-center items-center w-full h-10 mt-3 relative",children:[(0,eB.jsx)(tg.V,{className:"self-start flex w-full h-10 partner-calendar",value:s,onChange:o,minDate:n,maxDate:i,dateFormat:"yy-mm-dd",selectionMode:"range",readOnlyInput:!0,hideOnRangeSelection:!0,onHide:()=>{(0,eY.ph)(s)||c()},pt:{root:()=>({className:(0,to.xW)("!bg-segment-background rounded-[8px]")})}}),(0,eB.jsx)(tb.A,{className:"absolute top-1/2 right-4 -translate-y-1/2 text-text-dark"})]}),(0,eB.jsxs)("div",{className:"mt-33 w-full text-sm flex flex-row items-center justify-between gap-2",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-withdraw-button-color rounded-lg",onClick:()=>{r(),t()},children:a("partner.reset")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg",onClick:()=>{r(),l(s)},children:a("partner.search")})]})]})};function rc(){return(rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let rd=function(e){return eU.createElement("svg",rc({xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none"},e),ex||(ex=eU.createElement("circle",{cx:28,cy:28,r:28,fill:"#FCFCFC"})),eU.createElement("g",{clipPath:"url(#ic_google_loading_svg__a)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3369.94,height:3369.94,x:-1684.97,y:-1684.97,transform:"matrix(.01685 -.00973 .00973 .01686 23.716 25.555)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),em||(em=eU.createElement("path",{d:"M48 28.368c0-1.413-.127-2.77-.362-4.074H33.894v7.713h5.713c-.47 2.48-1.882 4.58-3.998 5.992v5.015h6.458C45.829 39.538 48 34.432 48 28.367","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":33.697864532470703,"m01":19.451520919799805,"m02":-2.8584930896759033,"m10":-19.468074798583984,"m11":33.726539611816406,"m12":18.425954818725586},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_loading_svg__b)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3369.94,height:3369.94,x:-1684.97,y:-1684.97,transform:"matrix(.01685 -.00973 .00973 .01686 23.716 25.555)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),eu||(eu=eU.createElement("path",{d:"M28.898 47.83c5.372 0 9.877-1.774 13.169-4.816l-6.458-5.015c-1.773 1.195-4.034 1.92-6.711 1.92-5.174 0-9.57-3.495-11.143-8.202h-6.62v5.142c3.274 6.499 9.985 10.97 17.763 10.97","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":33.697864532470703,"m01":19.451520919799805,"m02":-2.8584930896759033,"m10":-19.468074798583984,"m11":33.726539611816406,"m12":18.425954818725586},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_loading_svg__c)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3369.94,height:3369.94,x:-1684.97,y:-1684.97,transform:"matrix(.01685 -.00973 .00973 .01686 23.716 25.555)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),ep||(ep=eU.createElement("path",{d:"M17.755 31.699a12 12 0 0 1-.633-3.784c0-1.322.235-2.589.633-3.784V18.99h-6.62A19.7 19.7 0 0 0 9 27.915c0 3.223.778 6.246 2.134 8.925l5.156-4.019z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":33.697864532470703,"m01":19.451520919799805,"m02":-2.8584930896759033,"m10":-19.468074798583984,"m11":33.726539611816406,"m12":18.425954818725586},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eU.createElement("g",{clipPath:"url(#ic_google_loading_s
1vg__d)","data-figma-skip-parse":"true"},eU.createElement("foreignObject",{width:3369.94,height:3369.94,x:-1684.97,y:-1684.97,transform:"matrix(.01685 -.00973 .00973 .01686 23.716 25.555)"},eU.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:"conic-gradient(from 90deg,#de4742 0deg,#4285f4 22.5deg,#4285f4 44.855deg,#4285f4 63.6458deg,#0a99bb 79.974deg,#34a353 92.4419deg,#34a353 114.043deg,#a8c500 152.174deg,#fbbc05 177.896deg,#fbbc05 208.082deg,#fbbc05 228.415deg,#ff9115 259.788deg,#ff5c31 283.929deg,#ea4335 300.907deg,#ea4335 318.092deg,#ea4335 358.332deg,#de4742 360deg)",height:"100%",width:"100%",opacity:1}}))),ef||(ef=eU.createElement("path",{d:"M28.898 15.93c2.93 0 5.535 1.014 7.616 2.969l5.697-5.703C38.758 9.973 34.272 8 28.899 8c-7.778 0-14.49 4.472-17.763 10.99l6.62 5.141c1.574-4.707 5.97-8.201 11.143-8.201","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"stopsVar":[{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.06250},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.12459725886583328},{"color":{"r":0.25882354378700256,"g":0.52156865596771240,"b":0.95686274766921997,"a":1.0},"position":0.17679402232170105},{"color":{"r":0.039215687662363052,"g":0.60000002384185791,"b":0.73333334922790527,"a":1.0},"position":0.22215011715888977},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.25678315758705139},{"color":{"r":0.20392157137393951,"g":0.63921570777893066,"b":0.32549020648002625,"a":1.0},"position":0.31678476929664612},{"color":{"r":0.65882354974746704,"g":0.77254903316497803,"b":0.0,"a":1.0},"position":0.42270514369010925},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.49415481090545654},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.57800447940826416},{"color":{"r":0.98431372642517090,"g":0.73725491762161255,"b":0.019607843831181526,"a":1.0},"position":0.63448750972747803},{"color":{"r":1.0,"g":0.56862747669219971,"b":0.082352943718433380,"a":1.0},"position":0.72163331508636475},{"color":{"r":1.0,"g":0.36078432202339172,"b":0.19215686619281769,"a":1.0},"position":0.78869134187698364},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.83585250377655029},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.88358932733535767},{"color":{"r":0.91764706373214722,"g":0.26274511218070984,"b":0.20784313976764679,"a":1.0},"position":0.99536776542663574}],"transform":{"m00":33.697864532470703,"m01":19.451520919799805,"m02":-2.8584930896759033,"m10":-19.468074798583984,"m11":33.726539611816406,"m12":18.425954818725586},"opacity":1.0,"blendMode":"NORMAL","visible":true}'})),eh||(eh=eU.createElement("path",{fill:"#4285F4",d:"M28.914 32v-7.7h4.979V32z"})),eg||(eg=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_google_loading_svg__a"},eU.createElement("path",{d:"M48 28.368c0-1.413-.127-2.77-.362-4.074H33.894v7.713h5.713c-.47 2.48-1.882 4.58-3.998 5.992v5.015h6.458C45.829 39.538 48 34.432 48 28.367"})),eU.createElement("clipPath",{id:"ic_google_loading_svg__b"},eU.createElement("path",{d:"M28.898 47.83c5.372 0 9.877-1.774 13.169-4.816l-6.458-5.015c-1.773 1.195-4.034 1.92-6.711 1.92-5.174 0-9.57-3.495-11.143-8.202h-6.62v5.142c3.274 6.499 9.985 10.97 17.763 10.97"})),eU.createElement("clipPath",{id:"ic_google_loading_svg__c"},eU.createElement("path",{d:"M17.755 31.699a12 12 0 0 1-.633-3.784c0-1.322.235-2.589.633-3.784V18.99h-6.62A19.7 19.7 0 0 0 9 27.915c0 3.223.778 6.246 2.134 8.925l5.156-4.019z"})),eU.createElement("clipPath",{id:"ic_google_loading_svg__d"},eU.createElement("path",{d:"M28.898 15.93c2.93 0 5.535 1.014 7.616 2.969l5.697-5.703C38.758 9.973 34.272 8 28.899 8c-7.778 0-14.49 4.472-17.763 10.99l6.62 5.
1141c1.574-4.707 5.97-8.201 11.143-8.201"})))))},rx=e=>{let{walletName:t}=e,{t:l}=(0,ez.Bd)(),{showSelectWalletDialog:a,hideDialog:r}=rZ(),[s,n]=(0,eU.useState)("0"),i=(0,e2.useSearchParams)(),o=(0,e2.useRouter)(),[c,d]=(0,eU.useState)(!1);(0,eU.useEffect)(()=>{(0,eY.Rm)("ThridLoginLoadingDialog start....",t),x()},[]),(0,eU.useEffect)(()=>{p(),f()},[s]);let x=async()=>{console.log("handleLogin");try{let e=i.get("token");e&&""!==e?(await (0,eG.Tp)(e),localStorage.setItem(e3.l_,t),n("1"),setTimeout(()=>{m(),(0,eG.l8)()},2e3)):n("2")}catch(e){console.error("sign error:",e),n("2"),(0,e9.$s)(e9.C5,{error_msg:5})}finally{o.replace("/trade")}};(0,eU.useEffect)(()=>{c&&(u(),d(!1))},[c]);let m=()=>{n("0"),r()},u=()=>{n("0"),r();let e=(0,eG.IP)(),t="guid=".concat(e),l=(0,eG.cX)();l&&""!==l&&(t="".concat(t,"&ref=").concat(l)),console.log("handleRetry",t),window.location.href="".concat("https://api.xstable.ai/","xstable/user-service/oauth2/authorize/google?").concat(t)},p=()=>"0"===s?l("home.logging_in"):"1"===s?l("home.successfully_signed",{walletName:t}):l("home.logging_in_failed"),f=()=>"0"===s?l("home.wait_moment"):"1"===s?"":l("home.try_logging_in_again");return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-[16px] p-5 w-full md:w-[360px] flex flex-col items-center",children:[(0,eB.jsx)(lj,{className:"",onCancel:()=>m()}),(0,eB.jsxs)("div",{className:"relative flex justify-center items-center w-[96px] h-[96px]",children:[(0,eB.jsx)("div",{className:"absolute",children:(0,eB.jsx)(rd,{className:"w-14 h-14"})}),"0"===s?(0,eB.jsx)(lC,{className:"circle-progress w-[96px] h-[96px]"}):"1"===s?(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#2EBD85] w-[96px] h-[96px]"}):(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#E43C5A] w-[96px] h-[96px]"})]}),(0,eB.jsx)("span",{className:"text-text-dark text-base mt-[14px] text-center",children:p()}),(0,eB.jsx)("span",{className:"mt-1 text-text-light text-sm text-center",children:f()}),(0,eB.jsx)("div",{className:"rounded-[12px] w-full h-[40px] mt-4 text-sm flex items-center justify-center main-button hover:opacity-80 cursor-pointer ".concat("2"===s?"":"hidden"),onClick:u,children:l("home.retry")}),(0,eB.jsx)("div",{className:"p-1 text-text-light text-xs mt-2 cursor-pointer ".concat("2"===s?"":"hidden"),onClick:()=>{m(),a()},children:l("home.change_login_method")})]})};var rm=l(68495),ru=l(6560);function rp(e){let{symbol:t,pricePrecision:l}=e,{price:a,decimals:r}=(0,tl.WG)((0,rm.k)(e=>{var a,r,s;let n=e.tokenMap[t];return{price:null!=(a=null==n?void 0:n.currentPrice)?a:0,decimals:null!=(s=null!=(r=null==n?void 0:n.pricePrecision)?r:l)?s:2}}));return(0,eB.jsx)("span",{className:"text-sm font-bold text-text-dark",children:(0,eY.hE)(a,r,!0,"round")})}let rf=eU.memo(e=>{let{item:t,isPressed:l,onPointerDown:a,onPointerUp:r,onPointerLeave:s,onPointerCancel:n,onClick:i}=e,{t:o}=(0,ez.Bd)(),c=(0,tt.e0)(e=>{var l,a;return null!=(a=null==(l=e.symbolStatusMap[t.symbol])?void 0:l.showOffHour)&&a});return(0,eB.jsxs)("div",{role:"button",tabIndex:0,className:"flex w-full justify-between items-center p-4 ".concat(l?"bg-dialog-divide-color":""),onPointerDown:a,onPointerUp:r,onPointerLeave:s,onPointerCancel:n,onClick:i,children:[(0,eB.jsxs)("div",{className:"flex items-center text-sm text-text-dark font-semibold gap-3",children:[(0,eB.jsx)(ru.A,{className:"w-8 h-8 shrink-1",image:t.imageUrl,width:32,height:32,name:t.name,symbol:t.symbol}),(0,eB.jsx)("span",{children:t.symbol})]}),(0,eB.jsxs)("div",{className:"flex flex-col items-end",children:[(0,eB.jsx)(rp,{symbol:t.symbol,pricePrecision:t.pricePrecision}),(0,eB.jsx)("span",{className:"text-sm whitespace-nowrap ".concat(c?"text-text-light font-normal":t.changePercent>0?"text-[#2ebd85]":"text-[#E43C5A]"),children:c?o("trade.closed"):t.changePercent>0?"+".concat((0,eY.hE)(t.changePercent),"%"):"".concat((0,eY.hE)(t.changePercent),"%")})]})]},t.symbol)});rf.displayName="DialogRow";let rh=e=>{let{callback:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),r=(0,tl.WG)(e=>e.tokenListDisplay),[s,n]=(0,eU.useState)(-1),i=(0,eU.useCallback)(e=>{var l;let r=null!=(l=tl.WG.getState().tokenMap[e.symbol])?l:e;(0,e9.$s)(e9.De,{symbol:r.symbol}),t(r),a()},[t,a]);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] w-screen h-[85svh] md:w-[410px] flex flex-col items-center pb-4",children:[(0,eB.jsx)("div",{className:"w-[42px] h-1 rounded-full bg-text-light mt-2.5"}),(0,eB.jsxs)("div",{className:"w-full text-xs text-text-light flex justify-between items-center px-4 mt-5 shrink-0",children:[(0,eB.jsx)("span",{children:l("trade.token")}),(0,eB.jsx)("span",{children:"".concat(l("trade.current_price")," / ").concat(l("trade.24h_change"))})]}),(0,eB.jsx)("div",{className:"w-full flex-1 mt-2 overflow-y-auto",children:r.map((e,t)=>(0,eB.jsx)(rf,{item:e,isPressed:s===t,onPointerDown:()=>n(t),onPointerUp:()=>n(-1),onPointerLeave:()=>n(-1),onPointerCancel:()=>n(-1),onClick:()=>i(e)},e.symbol))})]})};function rg(e){let{label:t,value:l,clickableUrl:a}=e;return(0,eB.jsxs)("div",{className:"flex justify-between items-center gap-2 min-w-0",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm sm:text-sm leading-[18px] shrink-0",children:t}),a?(0,eB.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-[#2EBD85] text-sm sm:text-sm leading-[18px] hover:opacity-80 transition-opacity text-right overflow-hidden text-ellipsis cursor-pointer underline decoration-dotted decoration-0.5 underline-offset-2",children:l}):(0,eB.jsx)("span",{className:"text-text-dark text-sm sm:text-sm leading-[18px] text-right overflow-hidden text-ellipsis",title:l,children:l})]})}function rb(e){let{hash:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=(0,eI._E)(),[r,s]=(0,eU.useState)(null),[n,i]=(0,eU.useState)(!0),o=e=>e.length<=12?e:"".concat(e.slice(0,6),"...").concat(e.slice(-4));return(0,eU.useEffect)(()=>
1{if(!t)return void i(!1);(async()=>{i(!0);try{let e=await fetch("".concat("https://api.xstable.ai/","user-service/order/chain/").concat(t),{headers:{"Content-Type":"application/json"}});if(!e.ok)return void s(null);let l=await e.json();if(!l.success||!l.data)return void s(null);let{data:a}=l,r=a.symbol.split("/")[0],n=(0,eY._b)(a.chainBlockTime,"/"),i=a.userAccount.length>16?"".concat(a.userAccount.slice(0,8),"...").concat(a.userAccount.slice(-6)):a.userAccount;s({hash:a.hash,block:a.chainSlot.toString(),time:n,user:i,side:a.side,priceValue:a.price,quantity:a.quantity,token:r,chainNet:a.chainNet})}catch(e){console.error("Failed to fetch transaction details:",e),s(null)}finally{i(!1)}})()},[t]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-[16px] w-screen h-[60svh] md:w-[410px] flex flex-col items-center pb-4",children:[(0,eB.jsx)(lj,{className:"mt-6",title:l("tx.transaction_details"),onCancel:()=>void a()}),(0,eB.jsx)("div",{className:"w-full text-text-dark text-base sm:text-xl leading-[20px] sm:leading-[26px] break-all px-4 mt-4",children:l("tx.hash_prefix",{hash:t?o(t):""})}),n?(0,eB.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,eB.jsx)("div",{className:"text-text-light text-sm",children:l("tx.loading")})}):r?(0,eB.jsx)("div",{className:"w-full flex flex-col px-4 mt-4",children:(0,eB.jsxs)("div",{className:"bg-border-color rounded-lg flex flex-col gap-3 sm:gap-4 px-3 py-4",children:[(0,eB.jsx)("div",{className:"text-text-dark text-sm sm:text-base font-semibold leading-[18px] sm:leading-[21px]",children:l("partner.overview")}),(0,eB.jsx)(rg,{label:l("tx.hash"),value:o(r.hash),clickableUrl:((e,t)=>{let l="https://solscan.io/tx/".concat(e);return"devnet"===t||"testnet"===t?"".concat(l,"?cluster=").concat(t):l})(r.hash,r.chainNet)}),(0,eB.jsx)(rg,{label:l("tx.block"),value:r.block,clickableUrl:((e,t)=>{let l="https://solscan.io/block/".concat(e);return"devnet"===t||"testnet"===t?"".concat(l,"?cluster=").concat(t):l})(r.block,r.chainNet)}),(0,eB.jsx)(rg,{label:l("trade.time"),value:r.time}),(0,eB.jsx)(rg,{label:l("tx.action"),value:l("trade.".concat(r.side))}),(0,eB.jsx)(rg,{label:l("trade.price"),value:"".concat((0,eY.tu)(r.priceValue)," USD")}),(0,eB.jsx)(rg,{label:l("tx.size"),value:"".concat((0,eY.HD)(r.quantity,4)," ").concat(r.token)})]})}):(0,eB.jsx)("div",{className:"text-center py-16 text-text-light text-sm",children:l("tx.not_found")})]})}var rv=l(13645);function rw(){return(rw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let rj=function(e){return eU.createElement("svg",rw({xmlns:"http://www.w3.org/2000/svg",width:20,height:19,fill:"none"},e),eb||(eb=eU.createElement("path",{fill:"url(#ic_sparkles_svg__a)",fillRule:"evenodd",d:"M10.763.255c.6-.253 1.26-.32 1.898-.19.638.129 1.221.448 1.676.913a3.33 3.33 0 0 1 .888 1.692 3.36 3.36 0 0 1-.295 2.143h3.151c1.081 0 1.919.89 1.919 1.937v1.375c0 .853-.556 1.6-1.346 1.848v6.748c0 .597-.233 1.174-.654 1.604-.42.43-.997.675-1.602.675H3.602A2.24 2.24 0 0 1 2 18.325a2.3 2.3 0 0 1-.654-1.604V9.973A1.94 1.94 0 0 1 0 8.125V6.75c0-1.047.838-1.936 1.919-1.937h2.477a3.33 3.33 0 0 1-.293-2.143A3.33 3.33 0 0 1 4.989.978 3.25 3.25 0 0 1 6.665.064a3.23 3.23 0 0 1 2.998.958c.309-.327.682-.59 1.1-.767M9.09 9.953v7.238h1.818V9.953zM7.029 1.838a1.43 1.43 0 0 0-.739.404 1.5 1.5 0 0 0-.403.772c-.057.296-.028.603.085.88.112.277.301.51.54.672.237.162.513.247.794.247h1.449V3.312c0-.302-.088-.597-.25-.845a1.46 1.46 0 0 0-.652-.546 1.4 1.4 0 0 0-.824-.083m5.27 0a1.4 1.4 0 0 0-.826.083c-.261.11-.49.3-.652.546a1.54 1.54 0 0 0-.248.845v1.501h1.447c.281 0 .558-.085.795-.247a1.5 1.5 0 0 0 .54-.672c.112-.277.141-.584.084-.88a1.5 1.5 0 0 0-.403-.772 1.43 1.43 0 0 0-.737-.404",clipRule:"evenodd"})),ev||(ev=eU.createElement("defs",null,eU.createElement("linearGradient",{id:"ic_sparkles_svg__a",x1:5.75,x2:13.131,y1:-.452,y2:16.177,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#FDF1D0"}),eU.createElement("stop",{offset:.854,stopColor:"#D7B784"})))))};function rN(){return(rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let r_=function(e){return eU.createElement("svg",rN({xmlns:"http://www.w3.org/2000/svg",width:14,height:16,fill:"none"},e),ew||(ew=eU.createElement("path",{fill:"url(#ic_sparkles_2_svg__a)",fillRule:"evenodd",d:"M6.387.193A1.065 1.065 0 0 1 7.61.191l.128.09c.019.015.933.653 2.354 1.214a8.9 8.9 0 0 0 2.683.567h.003l.635.01a.587.587 0 0 1 .586.578L14 8.933c0 .844-.255 1.726-.758 2.622a9.4 9.4 0 0 1-1.788 2.223 10.2 10.2 0 0 1-2.23 1.586C8.408 15.78 7.64 16 7 16c-.643 0-1.405-.215-2.21-.626a10.2 10.2 0 0 1-2.245-1.596C.926 12.274 0 10.508 0 8.934V3.079c0-.554.457-1.006 1.027-1.014l.197-.003a8.5 8.5 0 0 0 2.687-.567C5.337.93 6.226.308 6.268.278zm4.082 5.345a.85.85 0 0 0-1.178 0L6.246 8.504 4.858 7.152a.85.85 0 0 0-1.178 0 .796.796 0 0 0 0 1.147l1.977 1.926a.845.845 0 0 0 1.178 0l3.634-3.54a.797.797 0 0 0 0-1.147",clipRule:"evenodd"})),ej||(ej=eU.createElement("defs",null,eU.createElement("linearGradient",{id:"ic_sparkles_2_svg__a",x1:4.025,x2:10.99,y1:-.381,y2:12.663,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#FDF1D0"}),eU.createElement("stop",{offset:.854,stopColor:"#D7B784"})))))},rk={src:"/_next/static/media/ic_trial_fund_activated.b9fb48c6.webp",height:322,width:480,blurDataURL:"data:image/webp;base64,UklGRqQAAABXRUJQVlA4WAoAAAAQAAAABwAABAAAQUxQSCkAAAAAAAAOzdgXAAAANcr//9cjAACi/////6QAM6r/////ji5ElWSYwu2OAgBWUDggVAAAAPABAJ0BKggABQACQDgliAJ0ARd+lqkwAAD+7S089u10yymlXfUOATLZIf5IH8P8o2ZHZC0721wNw7r003HeJ6BARM/qCvpCd0q7cbcunQ/Rnw7gAA==",blurWidth:8,blurHeight:5},ry=function(e){let{data:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),r=(0,e2.useRouter)();(0,eU.useEffect)(()=>{(0,e9.$s)(e9.vZ)},[]);let s=()=>{(0,e9.$s)(e9._p),a()};return(0,eB.jsxs)(e$,{className:"relative mt-[100px] w-screen md:w-[518px] rounded-t-[16px] md:rounded-[16px] bg-[#141517] px-6 pb-6 pt-[85px]",children:[(0,eB.jsx)(lo.default,{src:rk,alt:"",width:240,height:161,className:"pointer-events-none absolute left-1/2 top-[-70px] h-[161px] w-[240px] -translate-x-1/2 object-contain md:top-[-80px]"}),(0,eB.jsx)("div",{className:"absolute right-4 top-6 flex size-6 cursor-pointer items-center justify-center md:top-4",onClick:s,children:(0,eB.jsx)(e5.A,{className:"size-3 text-[#8D8E92] fill-current"})}),(0,eB.jsxs)("div",{className:"flex flex-col items-center text-center mt-4 md:mt-2",children:[(0,eB.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eB.jsx)(rv.A,{className:"size-5 text-[#F2F4F7]/60"}),(0,eB.jsx)("span",{className:"text-xl font-semibold text-[#F2F4F7]",children:l("vouchers.trial_fund_activated_title")})]}),(0,eB.jsxs)("div",{className:"mt-3 flex items-baseline justify-center bg-gradient-to-r from-[#F5C064] via-[#FFECCC] to-[#F5C064] bg-clip-text text-transparent",children:[(0,eB.jsx)("span",{className:"text-base font-normal text-[#8D8E92]",children:l("vouchers.trial_fund_activated_amount_prefix")}),(0,eB.jsx)("span",{className:"text-[28px] font-semibold text-main-color mx-1.5",children:t.creditedAmount}),(0,eB.jsx)("span",{className:"text-base font-normal text-[#8D8E92]",children:"USD"})]}),(0,eB.jsxs)("div",{className:"mt-3 flex w-full max-w-[361px] md:max-w-[470px] flex-col items-center gap-3 rounded-[16px] border border-white/6 p-4",children:[(0,eB.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eB.jsx)(rj,{className:"size-5 text-[#FDF1D0]"}),(0,eB.jsx)("span",{className:"text-xl font-semibold bg-gradient-to-b from-[#FDF1D0] to-[#D7B784] bg-clip-text text-transparent",children:l("vouchers.trial_fund_activated_activated_title")})]}),(0,eB.jsxs)("div",{className:"flex w-full md:w-[382px] items-center gap-2 rounded-[6px] border border-white/10 bg-white/6 px-3 py-1.5",children:[(0,eB.jsx)(r_,{className:"size-4 shrink-0 text-[#FDF1D0]"}),(0,eB.jsx)("span",{className:"text-sm md:text-base text-left font-normal text-[#8D8E92]",children:(0,eB.jsx)(ez.x6,{i18nKey:"vouchers.trial_fund_activated_margin_info",values:{value:t.trialFundActivatedAmount,total:t.creditedAmount+t.trialFundActivatedAmount},components:{blue:(0,eB.jsx)("span",{className:"font-semibold text-main-color"}),gray:(0,eB.jsx)("span",{className:"font-semibold text-[#F2F4F7]"}),small:(0,eB.jsx)("span",{className:"text-xs"})}})})]})]})]}),(0,eB.jsxs)("div",{className:"mt-4 flex w-full flex-col gap-3 md:gap-4",children:[(0,eB.jsxs)("button",{type:"button",className:"flex h-11 w-full cursor-pointer items-center justify-center gap-1.5 rounded-[10px] bg-main-color px-4 text-base font-medium text-[#F2F4F7]",onClick:()=>
1{(0,e9.$s)(e9.Wu),(0,eG.oG)(),eG.kH.setState({pendingGuideStart:!0}),a(),r.push("/trade/XAU")},children:[(0,eB.jsx)("span",{children:l("vouchers.trial_fund_activated_deposit_trade")}),(0,eB.jsx)(au.A,{className:"size-4"})]}),(0,eB.jsx)("div",{className:"flex w-full justify-center text-sm font-normal text-[#8D8E92]",children:(0,eB.jsx)("span",{className:"cursor-pointer",onClick:s,children:l("vouchers.trial_fund_activated_back")})})]})]})},rE=e=>{let{data:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),[r]=(0,eU.useState)(!1);return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-6 w-screen md:w-[518px] flex flex-col items-center pb-4 px-8",children:[(0,eB.jsxs)("div",{className:"flex flex-row items-center w-full pb-2.5 relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-xl text-text-dark font-semibold text-center",children:l("take_profit_market"===t.orderTypeDetail?"trade.trigger_tp_sl_dialog_profit_title":"trade.trigger_tp_sl_dialog_loss_title")}),(0,eB.jsx)("div",{className:"p-2 cursor-pointer w-6 h-6 absolute right-0 top-0",onClick:()=>a(),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}),(0,eB.jsx)("span",{className:"w-full text-text-light text-sm mt-2.5 px-8 text-center font-normal",children:l("trade.trigger_tp_sl_dialog_des")}),(0,eB.jsxs)("div",{className:"w-full flex flex-col border border-partner-data-background rounded-xl mt-8 p-4",children:[(0,eB.jsx)("span",{className:"text-xs text-text-dark font-bold",children:t.symbol}),(0,eB.jsx)("span",{className:"text-xs text-text-light font-medium",children:(0,eY.Ey)(t.timestamp)}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.collateral")}),(0,eB.jsx)("span",{className:"text-text-dark",children:"".concat((0,eY.hE)(t.margin))})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-1",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.direction")}),(0,eB.jsx)("span",{className:"".concat("long"===t.side?"text-[#2ebd85]":"text-[#E43C5A]"),children:"".concat("long"===t.side?"Long":"Short")})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-1",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.leverage")}),(0,eB.jsx)("span",{className:"text-text-dark",children:"".concat(t.leverage,"x")})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-1",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.trigger_tp_sl_dialog_close_price")}),(0,eB.jsx)("span",{className:"text-text-dark",children:"$".concat((0,eY.hE)(t.price))})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-1",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("take_profit_market"===t.orderTypeDetail?"trade.trigger_tp_sl_dialog_profit_trigger":"trade.trigger_tp_sl_dialog_loss_trigger")}),(0,eB.jsx)("span",{className:"text-text-dark",children:"".concat((0,eY.Ix)("take_profit_market"===t.orderTypeDetail?(0,eQ.ez)(t.takeProfitRate,100):(0,eQ.ez)(t.stopLossRate,100)),"%")})]}),(0,eB.jsxs)("div",{className:"w-full flex justify-between text-sm font-medium mt-1",children:[(0,eB.jsx)("span",{className:"text-text-light",children:l("trade.trigger_tp_sl_dialog_pnl")}),(0,eB.jsx)("span",{className:"".concat(t.realizedPnl>0?"text-[#2ebd85]":"text-[#E43C5A]"),children:(0,eY.AV)(t.realizedPnl)})]})]}),(0,eB.jsxs)("div",{className:"w-full mt-8 flex items-center gap-2.5",children:[(0,eB.jsx)("span",{className:"flex-1 bg-border-color h-9.5 leading-9.5 rounded-[10px] text-center text-text-dark text-sm font-semibold cursor-pointer",onClick:a,children:l("trade.trigger_tp_sl_dialog_cancel")}),(0,eB.jsxs)("div",{className:"w-full flex-1 relative h-9.5",children:[(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-white !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:l("trade.trigger_tp_sl_dialog_confirm"),disabled:r,onClick:()=>{}}),r?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-2 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]})]}),(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium my-4 text-center",children:l("trade.trigger_tp_sl_dialog_hint")})]})};var rA=l(72103);let rC=e=>{let{type:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ();return(0,eB.jsxs)("div",{className:"h-full",children:[(0,eB.jsx)("div",{className:"h-[calc(100%-54px)] border border-voucher-item-border rounded-xl pl-4 py-4",children:(0,eB.jsx)("div",{className:"h-full pr-3 mr-1 whitespace-pre-line text-sm text-voucher-des-text font-normal overflow-y-auto custom-scrollbar",children:(()=>{switch(t){case"CARD":return(0,eB.jsx)(ez.x6,{i18nKey:"vouchers.des_content",components:{white:(0,eB.jsx)("span",{className:"text-text-dark font-bold"})}});case"TRIAL_FUND":return(0,eB.jsx)(ez.x6,{i18nKey:"vouchers.contract_des_content",components:{white:(0,eB.jsx)("span",{className:"text-text-dark font-bold"})}})}})()})}),(0,eB.jsx)("div",{className:"w-[calc(100%-32px)] md:w-[calc(100%-48px)] bg-dialog-background pt-4 gap-2.5 mb-8 md:mb-4 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none
1!text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:l("trade.ok"),onClick:a})})]})};var rS=l(83046);let rD=e=>{let{showLoading:t,data:l}=e,{t:a}=(0,ez.Bd)(),r=(0,e2.useRouter)(),{hideDialog:s}=rZ();return(0,eB.jsx)("div",{className:"w-full ",children:t?(0,eB.jsx)("div",{className:"text-text-dark h-[200px] flex items-center justify-center",children:(0,eB.jsx)(rS.A,{className:"w-12 h-12"})}):(0,eB.jsxs)("div",{className:"flex flex-col",children:[(0,eB.jsxs)("div",{className:"flex flex-col w-full border border-voucher-item-border rounded-xl p-4 mb-[54px]",children:[(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.voucher_name_text")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:a({CARD:{nameKey:"vouchers.voucher_name"},TRIAL_FUND:{nameKey:"vouchers.voucher_name_contract"}}[l.rewardDefinitionType].nameKey)})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("partner.status")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:(()=>{switch(l.status){case 0:return a("vouchers.coming_force_soon");case 1:return a("vouchers.status_effect");case 2:return 0===l.balanceValue?a("vouchers.used"):a("vouchers.expired")}})()})]}),(0,eB.jsx)("div",{className:"w-full h-[1px] bg-panel-border-color mt-3"}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.voucher_amount")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat(l.rewardDefinitionValue," USD")})]}),(()=>{switch(l.rewardDefinitionType){case"CARD":return(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.deduction_ratio")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.tu)(l.maxDeductionRate),"%")})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.deduction_limit")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.tu)(l.maxDeductionValue)," USD")})]})]});case"TRIAL_FUND":return(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.margin_usage_ratio")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"1:1"})]}),"CONTRACT_TRIAL_FUND_FIX_HEDGING"===l.rewardDefinitionBusinessType&&(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.bonus_profit_ratio")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.tu)(l.profitSettlementPercent),"%")})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.bonus_profit_cap_per_ratio")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.tu)(l.profitTopPercent),"%")})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.daily_net_profit_ratio")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.tu)(l.businessTrialFundProfitMax)," USD")})]})]})]})}})(),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.remaining_balance")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.hE)(l.balanceValue,2)," USD")}
1)]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.used_balance")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold",children:"".concat((0,eY.hE)(l.useValue,2)," USD")})]}),(0,eB.jsx)("div",{className:"w-full h-[1px] bg-panel-border-color mt-3"}),l.startTime&&l.createdTime>=l.startTime&&(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.effective_time_text")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold whitespace-nowrap overflow-hidden text-ellipsis",children:"".concat((0,eY._b)(l.startTime,"-"))})]}),l.startTime&&l.createdTime<l.startTime&&(0,eB.jsxs)(eB.Fragment,{children:[(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.claimed_time_text")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold whitespace-nowrap overflow-hidden text-ellipsis",children:"".concat((0,eY._b)(l.createdTime,"-"))})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.effective_time_text")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold whitespace-nowrap overflow-hidden text-ellipsis",children:"".concat((0,eY._b)(l.startTime,"-"))})]})]}),(0,eB.jsxs)("div",{className:"flex w-full items-center justify-between mt-3",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm font-medium",children:a("vouchers.expiration_time_text")}),(0,eB.jsx)("span",{className:"text-text-dark text-sm font-semibold whitespace-nowrap overflow-hidden text-ellipsis",children:-1===l.validityType?a("vouchers.valid_forever"):"".concat((0,eY._b)(l.endTime,"-"))})]})]}),(0,eB.jsxs)("div",{className:"flex w-[calc(100%-32px)] md:w-[calc(100%-48px)] bg-dialog-background pt-4 gap-2.5 mb-8 md:mb-4 absolute bottom-0 md:bottom-3",children:[(0,eB.jsx)("span",{className:"flex-1 h-9.5 leading-9.5 bg-withdraw-button-color text-text-dark text-[14px] font-medium text-center rounded-[10px] cursor-pointer",onClick:s,children:a("trade.cancel")}),(0,eB.jsx)("div",{className:"flex-1 ml-auto relative h-9.5",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,disabled:1!==l.status,label:(()=>{switch(l.status){case 0:return a("vouchers.coming_force_soon");case 1:return a("vouchers.start_use");case 2:return 0===l.balanceValue?a("vouchers.used"):a("vouchers.expired")}})(),onClick:()=>{1===l.status&&((0,e9.$s)(e9.Qr),"TRIAL_FUND"===l.rewardDefinitionType?r.push("/trade?p=true"):r.push("/trade"),s())}})})]})]})})};var rP=l(34202);let rM=e=>{let{id:t}=e,{t:l}=(0,ez.Bd)(),{hideDialog:a}=rZ(),[r,s]=(0,eU.useState)([]),[n,i]=(0,eU.useState)(!0);return(0,eU.useEffect)(()=>{(0,eH.fs)(t).then(e=>{e&&s(e)}).finally(()=>{i(!1)})},[]),(0,eB.jsxs)("div",{className:"flex h-[calc(100%-54px)]",children:[n?(0,eB.jsx)("div",{className:"text-text-dark w-full h-full flex items-center justify-center",children:(0,eB.jsx)(rS.A,{className:"w-12 h-12"})}):r.length>0?(0,eB.jsx)("div",{className:"border border-voucher-item-border rounded-xl flex flex-col px-4 w-full h-full overflow-y-auto mb-[70px]",children:r.map((e,t)=>(0,eB.jsxs)("div",{className:"flex items-center justify-between py-3 ".concat(t===r.length-1?"":"border-b border-panel-border-color"),children:[(0,eB.jsxs)("div",{className:"flex flex-col",children:[(0,eB.jsx)("span",{className:"text-base text-text-dark font-medium",children:(e=>{switch(e.operationType){case"GRANT":return l("vouchers.futures_bonus_issued");case"DEDUCT":return l("vouchers.futures_bonus_deducted");case"RETURN":return l("vouchers.futures_bonus_returned");case"EXPIRE":return l("vouchers.futures_bonus_expired");case"RECLAIM":return l("vouchers.futures_bonus_reclaimed")}})(e)}),(0,eB.jsx)("span",{className:"text-xs text-text-light font-medium",children:(0,eY._b)(e.createdTime,"-")})]}),(0,eB.jsx)("span",{className:"text-base text-text-dark font-semibold",children:"".concat((e=>{switch(e.operationType){case"GRANT":case"RETURN":return"+";case"DEDUCT":case"EXPIRE":case"RECLAIM":return"-"}})(e)).concat((0,eY.Ix)(e.useValue,2)," USD")}
1)]},t))}):(0,eB.jsx)("div",{className:"text-text-dark w-full h-full flex items-center justify-center",children:(0,eB.jsx)(rP.A,{text:l("vouchers.no_vouchers_usage_record")})}),(0,eB.jsx)("div",{className:"w-[calc(100%-32px)] md:w-[calc(100%-48px)] bg-dialog-background pt-4 gap-2.5 mb-8 md:mb-4 absolute bottom-0 md:bottom-3",children:(0,eB.jsx)(eT.$,{className:"w-full !bg-text-dark !border-none !text-affiliate-search-text !text-sm h-9.5 !font-semibold !rounded-[10px]",rounded:!0,label:l("trade.ok"),onClick:a})})]})},rO=e=>{let{data:t,index:l}=e,{t:a}=(0,ez.Bd)(),[r,s]=(0,eU.useState)(!0),[n,i]=(0,eU.useState)({}),o=[a("vouchers.voucher_detail"),a("vouchers.usage_des"),a("vouchers.usage_records")],[c,d]=(0,eU.useState)(l||0);return(0,eU.useEffect)(()=>{(0,eH.Sn)(t.id).then(e=>{e&&i(e)}).finally(()=>{s(!1)})},[]),(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-3 w-screen md:w-[518px] max-h-[85svh] md:h-full flex flex-col items-center pb-8 px-4 md:px-6 relative",children:[(0,eB.jsx)("div",{className:"flex flex-row items-center w-full relative",children:(0,eB.jsx)("div",{className:"w-full",children:(0,eB.jsx)(rA.A,{value:c,tabs:o,showPadding:!1,onChange:e=>{d(e.index)}})})}),(0,eB.jsxs)("div",{className:"w-full mt-5 h-[406px] max-h-[100%-62px] overflow-y-auto",children:[0===c&&(0,eB.jsx)(rD,{showLoading:r,data:n}),1===c&&(0,eB.jsx)(rC,{type:t.rewardDefinitionType}),2===c&&(0,eB.jsx)(rM,{id:t.id})]})]})};function rR(){return(rR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}function rL(){return(rL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}function rF(){return(rF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let rB=function(e){return eU.createElement("svg",rF({xmlns:"http://www.w3.org/2000/svg",width:14,height:14,fill:"none"},e),eS||(eS=eU.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.722 4.345a1.077 1.077 0 0 0-.154-1.584 1.256 1.256 0 0 0-1.69.144L5.72 8.708 3.05 6.205a1.257 1.257 0 0 0-1.698 0 1.076 1.076 0 0 0 0 1.59l3.6 3.376c.239.223.567.342.903.328a1.23 1.23 0 0 0 .868-.404z",clipRule:"evenodd"})))};function rI(){return(rI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}function rT(){return(rT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}var rU=l(83248);let rz=[{label:"Solana",icon:function(e){return eU.createElement("svg",rI({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),eD||(eD=eU.createElement("circle",{cx:12,cy:12,r:12,fill:"#000"})),eP||(eP=eU.createElement("path",{fill:"url(#ic_solana_24_svg__a)",d:"M7.142 14.242a.48.48 0 0 1 .333-.133h11.492c.046 0 .092.014.13.038q.06.039.088.101a.22.22 0 0 1-.052.246l-2.27 2.172a.47.47 0 0 1-.333.132H5.04a.24.24 0 0 1-.13-.038.23.23 0 0 1-.086-.1.22.22 0 0 1 .05-.245z"})),eM||(eM=eU.createElement("path",{fill:"url(#ic_solana_24_svg__b)",d:"M7.142 6.132A.5.5 0 0 1 7.475 6h11.492c.046 0 .092.013.13.038q.06.038.088.101a.22.22 0 0 1-.052.246l-2.27 2.172a.47.47 0 0 1-.333.132H5.04a.24.24 0 0 1-.13-.038.23.23 0 0 1-.086-.101.22.22 0 0 1 .05-.244z"})),eO||(eO=eU.createElement("path",{fill:"url(#ic_solana_24_svg__c)",d:"M16.865 10.163a.47.47 0 0 0-.333-.132H5.04a.24.24 0 0 0-.13.038.23.23 0 0 0-.087.101.22.22 0 0 0 .05.246l2.27 2.172a.47.47 0 0 0 .334.132h11.491a.24.24 0 0 0 .131-.038.23.23 0 0 0 .087-.101.22.22 0 0 0-.051-.246z"})),eR||(eR=eU.createElement("defs",null,eU.createElement("linearGradient",{id:"ic_solana_24_svg__a",x1:17.869,x2:10.451,y1:4.702,y2:19.547,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#00FFA3"}),eU.createElement("stop",{offset:1,stopColor:"#DC1FFF"})),eU.createElement("linearGradient",{id:"ic_solana_24_svg__b",x1:14.392,x2:6.974,y1:2.965,y2:17.811,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#00FFA3"}),eU.createElement("stop",{offset:1,stopColor:"#DC1FFF"})),eU.createElement("linearGradient",{id:"ic_solana_24_svg__c",x1:16.121,x2:8.703,y1:3.83,y2:18.675,gradientUnits:"userSpaceOnUse"},eU.createElement("stop",{stopColor:"#00FFA3"}),eU.createElement("stop",{offset:1,stopColor:"#DC1FFF"})))))},network:aM.tWt},{label:"Sui",icon:function(e){return eU.createElement("svg",rT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),eL||(eL=eU.createElement("path",{fill:"#298DFF",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0 0 5.373 0 12"})),eF||(eF=eU.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M15.745 10.67a4.78 4.78 0 0 1 1.043 2.983c0 1.127-.4 2.195-1.072 3.021l-.058.071-.017-.091a6 6 0 0 0-.046-.234c-.334-1.473-1.427-2.737-3.23-3.764-1.214-.688-1.91-1.519-2.094-2.462-.117-.609-.03-1.222.137-1.748.171-.526.422-.964.635-1.227l.7-.855a.307.307 0 0 1 .476 0zm1.106-.855L12.16 4.08a.225.225 0 0 0-.347 0L7.12 9.815l-.016.02a6.24 6.24 0 0 0-1.377 3.914C5.727 17.2 8.53 20 11.986 20c3.454 0 6.258-2.8 6.258-6.25a6.22 6.22 0 0 0-1.38-3.915zm-8.608.838.417-.513.012.096q.013.113.038.225c.271 1.423 1.243 2.612 2.862 3.53 1.41.802 2.229 1.724 2.467 2.738.1.421.116.838.075 1.201l-.005.021-.02.009a4.8 4.8 0 0 1-2.108.484 4.795 4.795 0 0 1-4.798-4.79 4.75 4.75 0 0 1 1.06-3",clipRule:"evenodd"})))},network:rU.cF},{label:"Monad",icon:function(e){return eU.createElement("svg",rL({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),eU.createElement("g",{clipPath:"url(#ic_monad_24_svg__a)"},eU.createElement("mask",{id:"ic_monad_24_svg__b",width:24,height:24,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},ey||(ey=eU.createElement("path",{fill:"#fff",d:"M24 0H0v24h24z"}))),eU.createElement("g",{mask:"url(#ic_monad_24_svg__b)"},eU.createElement("mask",{id:"ic_monad_24_svg__c",width:24,height:24,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},eE||(eE=eU.createElement("path",{fill:"#fff",d:"M24 0H0v24h24z"}))),eA||(eA=eU.createElement("g",{mask:"url(#ic_monad_24_svg__c)"},eU.createElement("path",{fill:"#6E54FF",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0 0 5.373 0 12"}
1),eU.createElement("g",{filter:"url(#ic_monad_24_svg__d)"},eU.createElement("path",{fill:"#fff",d:"M12.007 4.5C9.839 4.5 4.5 9.834 4.5 12s5.339 7.5 7.507 7.5 7.507-5.334 7.507-7.5-5.34-7.5-7.507-7.5m-1.17 11.789c-.914-.25-3.372-4.545-3.123-5.458.25-.913 4.549-3.369 5.463-3.12s3.372 4.544 3.122 5.458c-.249.913-4.548 3.369-5.462 3.12"})))))),eC||(eC=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_monad_24_svg__a"},eU.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})),eU.createElement("filter",{id:"ic_monad_24_svg__d",width:45.016,height:45,x:-10.5,y:4.5,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},eU.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),eU.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),eU.createElement("feOffset",{dy:15}),eU.createElement("feGaussianBlur",{stdDeviation:7.5}),eU.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),eU.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.125 0"}),eU.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_13749_10400"}),eU.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_13749_10400",result:"shape"})))))},network:aM.aUf},{label:"BNB Chain",icon:function(e){return eU.createElement("svg",rR({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),eN||(eN=eU.createElement("path",{fill:"#0B0E11",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0 0 5.373 0 12"})),e_||(e_=eU.createElement("g",{clipPath:"url(#ic_bsc_24_svg__a)"},eU.createElement("path",{fill:"#F0B90B",d:"m8.16 6.914 3.86-2.246 3.86 2.246-1.42.83-2.44-1.416-2.44 1.416zm7.72 2.834-1.42-.83-2.44 1.416-2.44-1.416-1.42.83v1.66l2.441 1.416v2.833l1.42.83 1.418-.83v-2.833l2.44-1.416zm0 4.493v-1.66l-1.42.83v1.66zm1.007.586-2.44 1.417v1.66l3.859-2.247v-4.493l-1.42.83zm-1.419-6.496 1.419.83v1.66l1.419-.83V8.33l-1.42-.83zm-4.867 8.514v1.66l1.42.83 1.418-.83v-1.66l-1.419.83zm-2.44-2.604 1.419.83v-1.66l-1.42-.83zm2.44-5.91 1.42.83 1.418-.83-1.419-.83zm-3.448.83 1.42-.83-1.42-.83-1.419.83v1.66l1.42.83zm0 2.833-1.419-.83v4.493l3.86 2.247v-1.66l-2.44-1.417z"}))),ek||(ek=eU.createElement("defs",null,eU.createElement("clipPath",{id:"ic_bsc_24_svg__a"},eU.createElement("path",{fill:"#fff",d:"M4.664 4.668h14.667v14.667H4.664z"})))))},network:aM.NBY}],rH=e=>{let{onClose:t}=e,{hideDialog:l}=rZ(),{caipNetwork:a,switchNetwork:r}=(0,tK.HV)(),s=(0,eU.useRef)(null==a?void 0:a.id),n=(0,e2.usePathname)();(0,eU.useEffect)(()=>{s.current=null==a?void 0:a.id},[a]);let i=()=>{null==t||t(),l()},o=async e=>{if(s.current===e.id)return void i();await r(e),await (0,tY.Su)(n),(0,e9.$s)(e9.$m,{network:e.name}),i()};return(0,eB.jsxs)(e$,{className:"w-screen bg-dialog-background border border-panel-border-color rounded-t-[16px] px-4 pt-2.5 pb-8",children:[(0,eB.jsx)("div",{className:"mx-auto h-1 w-[42px] rounded-[3px] bg-text-light"}),(0,eB.jsx)("div",{className:"mt-4 flex w-full flex-col gap-3",children:rz.map(e=>{let t=e.icon,l=(null==a?void 0:a.id)===e.network.id;return(0,eB.jsxs)("button",{type:"button",className:"flex h-11 w-full cursor-pointer items-center rounded-xl hover:bg-token-list-item-hover-color px-3 py-1 text-left",onClick:()=>o(e.network),children:[(0,eB.jsx)(t,{className:"h-6 w-6 shrink-0"}),(0,eB.jsx)("span",{className:"ml-2.5 text-base font-medium leading-[21px] text-text-dark",children:e.label}),l&&(0,eB.jsx)(rB,{className:"ml-auto h-3.5 w-3.5 text-text-dark fill-current"})]},e.label)})})]})},rW={INIT:"0",SUCCESS:"1",FAILURE:"2"},rV=()=>{let{t:e}=(0,ez.Bd)(),{showSelectWalletDialog:t,hideDialog:l}=rZ(),a=(0,aW.U)(e=>e.appKit),[r,s]=(0,eU.useState)(rW.INIT),n=(0,e2.useSearchParams)(),{disconnect:i}=(0,tK.uP)(),[o,c]=(0,eU.useState)(!1),d=(0,tK.G8)(),{caipNetworkId:x}=(0,tK.HV)(),{walletProvider:m}=(0,tK.AX)("solana"),{walletProvider:u}=(0,tK.AX)("eip155"),{walletProvider:p}=(0,tK.AX)("sui"),f=(0,eU.useRef)(!1),h=(0,eU.useRef)("");(0,eU.useEffect)(()=>{if(r===rW.INIT&&!f.current&&(console.log("WalletLoginLoadingDialog",d),"connected"===d.status&&d.address&&""!==d.address)){let e="eip155"===E()?u:"sui"===E()?p:m;N(d.address,g(e))}},[d.status,d.address,x,r]);let g=e=>(null==e?void 0:e.name)||"Wallet",b=e=>"By signing, you agree to XStable Terms of Use and Privacy Policy. Your authentication nonce is:".concat(e),v=async e=>
1{if(console.log("signSolanaMessage"),m){let t=new TextEncoder().encode(b(e)),l=await m.signMessage(t);return lE.A.encode(l)}},w=async(e,t)=>{let l;if(console.log("signEvmMessage"),!u)return;let a=b(e);try{l=await u.request({method:"personal_sign",params:[a,t]})}catch(r){if(!(e=>{let t="object"==typeof e&&null!==e&&"code"in e?e.code:void 0,l=e instanceof Error?e.message.toLowerCase():"";return -32601===t||l.includes("method not found")||l.includes("does not exist")||l.includes("not available")})(r))throw r;let e=function(e){let t=new TextEncoder().encode(e);return"0x".concat(Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join(""))}(a);l=await u.request({method:"eth_sign",params:[t,e]})}return"string"==typeof l?l:void 0},j=async(e,t)=>{var l,a;let r=null==p||null==(l=p.features)?void 0:l["sui:signPersonalMessage"],s=null==p||null==(a=p.accounts)?void 0:a.find(e=>e.address.toLowerCase()===t.toLowerCase());if(r&&s)return(await r.signPersonalMessage({account:s,message:new TextEncoder().encode(b(e))})).signature};(0,eU.useEffect)(()=>{D(),P(),r===rW.FAILURE&&i()},[r]);let N=async(e,t)=>{let l=E(),a=A(),r="".concat(a,":").concat(e);if(h.current!==r)try{h.current=r,f.current=!0;let o=await (0,eH.xy)({walletAddress:e,chain:a});if(o){let r="eip155"===l?await w(o.uId,e):"sui"===l?await j(o.uId,e):await v(o.uId);if(!r)throw Error("sign method not found");let d=n.get("ref");(0,eG.kM)(e,r,t,d,a).then(()=>{localStorage.setItem(e3.l_,t),s(rW.SUCCESS),(0,e9.$s)(e9.PQ,{wallet:t}),setTimeout(()=>{_(),(0,eG.l8)()},2e3)}).catch(async e=>{await i(),8061===e.code||7026===e.errorCode?(h.current="",c(!0)):(s(rW.FAILURE),(0,e9.$s)(e9.C5,{error_msg:e.code}))})}}catch(e){(e instanceof Error?e.message:"").includes("User rejected")?console.warn("sign rejected"):console.error("sign error:",e),f.current=!1,s(rW.FAILURE),(0,e9.$s)(e9.C5,{error_msg:5})}};(0,eU.useEffect)(()=>{o&&(y(),c(!1))},[o]);let _=()=>{s(rW.INIT),l()},k=async()=>{try{await i()}catch(e){console.error("disconnect after cancelling wallet login failed:",e)}_()},y=()=>{s(rW.INIT),f.current=!1,h.current="",null==a||a.open({view:"AllWallets"})},E=()=>(null==x?void 0:x.startsWith("eip155:"))?"eip155":(null==x?void 0:x.startsWith("sui:"))?"sui":"solana",A=()=>"sui"===E()?"sui":"solana"===E()?"solana":C(),C=()=>x==="eip155:".concat(56)?"bsc":"monad",S=async()=>{try{await i()}catch(e){console.error("disconnect before changing wallet failed:",e)}_(),t()},D=()=>r===rW.INIT?e("home.connecting"):r===rW.SUCCESS?e("home.successfully_connected",{walletName:g("eip155"===E()?u:"sui"===E()?p:m)}):e("home.connection_failed"),P=()=>r===rW.INIT?e("home.wait_moment"):r===rW.SUCCESS?"":e("home.try_connecting_again");return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-5 w-screen md:w-[360px] flex flex-col items-center",children:[(0,eB.jsx)(lj,{className:"",onCancel:()=>k()}),(0,eB.jsxs)("div",{className:"relative flex justify-center items-center w-[96px] h-[96px]",children:[(0,eB.jsx)("div",{className:"absolute",children:(0,eB.jsx)(lD,{className:"w-14 h-14"})}),r===rW.INIT?(0,eB.jsx)(lC,{className:"circle-progress w-[96px] h-[96px]"}):r===rW.SUCCESS?(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#2EBD85] w-[96px] h-[96px]"}):(0,eB.jsx)("div",{className:"rounded-full border-4 border-[#E43C5A] w-[96px] h-[96px]"})]}),(0,eB.jsx)("span",{className:"text-text-dark text-base mt-[14px] text-center",children:D()}),(0,eB.jsx)("span",{className:"mt-1 text-text-light text-sm text-center",children:P()}),(0,eB.jsx)("div",{className:"rounded-[12px] w-full h-[40px] mt-4 text-sm flex items-center justify-center main-button hover:opacity-80 cursor-pointer ".concat(r===rW.FAILURE?"":"hidden"),onClick:y,children:e("home.retry")}),(0,eB.jsx)("div",{className:"p-1 text-text-light text-xs mt-2 cursor-pointer ".concat(r===rW.FAILURE?"":"hidden"),onClick:S,children:e("trade.change_wallet")})]})};var rG=l(83247);let r$=[{id:1,name:"USDC",icon:tC},{id:2,name:"USDT",icon:tS}],rq=[{id:"solana",name:"Solana",icon:tA,tokenIds:[1,2]},{id:"monad",name:"Monad",icon:tz,tokenIds:[1]},{id:"bsc",name:"BNB Chain",icon:tI,tokenIds:[1,2]},{id:"sui",name:"Sui",icon:tH,tokenIds:[1]}],rQ=(e,t)=>e.find(e=>e.id===(null==t?void 0:t.toLowerCase()))||e[0]||rq[0],rX=()=>{let{t:e}=(0,ez.Bd)(),{hideDialog:t}=rZ(),l=(0,eG.kH)(e=>e.userInfo),a=(0,eG.kH)(e=>e.language),r=(0,eU.useMemo)(()=>(e=>{if(!(null==e?void 0:e.length))return rq;let t=new Set(e.map(e=>{var t;return null==(t=e.chain)?void 0:t.toLowerCase()}
1).filter(Boolean)),l=rq.filter(e=>t.has(e.id));return l.length>0?l:rq})(null==l?void 0:l.wallets),[null==l?void 0:l.wallets]),s=rQ(r,null==l?void 0:l.chain),n=r$.find(e=>s.tokenIds.includes(e.id))||r$[0],[i,o]=(0,eU.useState)(s),[c,d]=(0,eU.useState)(n),[x,m]=(0,eU.useState)(),[u,p]=(0,eU.useState)(""),[f,h]=(0,eU.useState)(!1),[g,b]=(0,eU.useState)(!1),[v,w]=(0,eU.useState)(""),j=(0,eG.kH)(e=>e.crossAvailableBalance),N=null==l?void 0:l.usedMargin,_=(0,tl.WG)(e=>e.positionList),k=(0,tt.e0)(e=>e.symbolStatusMap),y=(0,a2.JH)(e=>{var t;return null==(t=e.configInfo)?void 0:t.withdrawMinMarginRatio}),E=r$.filter(e=>i.tokenIds.includes(e.id)),A=(null==l?void 0:l.wallets.find(e=>{var t;return(null==(t=e.chain)?void 0:t.toLowerCase())===i.id}))||(null==l?void 0:l.wallets[0]),C=(null==A?void 0:A.withdrawMinAmount)||1,S=(e=>{let{hasRestrictedPosition:t,withdrawMinMarginRatio:l,usedMargin:a,availableBalance:r}=e;if(!(!t||!Number.isFinite(l)||0>=Number(l)||!Number.isFinite(a)||0>=Number(a))&&Number.isFinite(r)&&!(r<=0))return tn.A.max(0,new tn.A(r).minus(new tn.A(Number(a)).multipliedBy(new tn.A(Number(l)).minus(1)))).decimalPlaces(6,tn.A.ROUND_DOWN).toNumber()})({hasRestrictedPosition:_.some(e=>{var t;let l=new tn.A(e.quantity||0);return l.isFinite()&&!l.isZero()&&(null==(t=k[e.symbol])?void 0:t.isRestrictionActive)===!0}),withdrawMinMarginRatio:y,usedMargin:N,availableBalance:j}),D=void 0===S?j:S,P=void 0!==S&&S<C,M=!!u&&((e,t)=>void 0!==t&&new tn.A(e||0).isGreaterThan(t))(u,S),O=void 0!==S?e("withdraw.margin_limit_tip",{amount:(0,eY.tu)(P?0:S),ratio:new tn.A(Number(y)).multipliedBy(100).toFixed(0)}):"",R=e=>(0,eB.jsxs)("div",{className:"flex items-center",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5 mr-1.5"}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]}),L=e=>{if(f)return;let t=(0,tJ.Mr)(e,{locale:a,maxDecimalPlaces:6});null!==t&&(p(t),F(t))},F=function(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E,r=(null==l?void 0:l.withdrawMinAmount)||1;b(!1),t&&Number(t)<r?w(e("trade.min_withdraw_hint",{amount:(null==l?void 0:l.withdrawMinAmount)||1})):Number(t)>Number(j)?w(e("trade.max_withdraw_hint")):Number(t)>=1e3&&a.some(e=>2===e.id)?(d(r$[1]),b(!0),w(e("assets.withdrawals_over_hint"))):w("")};(0,eU.useEffect)(()=>{(0,e9.$s)(e9.Fp)},[]),(0,eU.useEffect)(()=>{let e=rQ(r,null==l?void 0:l.chain);if(i.id===e.id)return;let t=r$.filter(t=>e.tokenIds.includes(t.id)),a=t.find(e=>e.id===c.id)||t[0];o(e),d(a),b(!1)},[null==l?void 0:l.chain,r]);let B=v.length>0&&!g||M||P;return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl p-6 px-4 md:px-6 w-screen md:w-[420px] flex flex-col items-center",children:[(0,eB.jsx)(e0,{text:e("home.withdrawal")}),(0,eB.jsxs)("div",{className:"flex flex-col w-full mt-4",children:[(0,eB.jsx)("span",{className:"text-text-light text-sm",children:e("trade.select_token")}),(0,eB.jsx)("div",{className:"bg-segment-background rounded-[8px] mt-2",children:(0,eB.jsx)(ti.m,{value:c,onChange:e=>(e=>{let t=e.value;d(t),(0,e9.$s)(e9.A,{token:t.name})})(e),options:E,optionLabel:"name",disabled:g,selectOnFocus:!1,itemTemplate:e=>(0,eB.jsxs)("div",{className:"flex items-center py-1 gap-1.5",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5"}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]}),valueTemplate:e=>(0,eB.jsxs)("div",{className:"flex py-[0.5px] gap-1.5",children:[(0,eB.jsx)("img",{alt:"",src:e.icon,className:"w-5 h-5"}),(0,eB.jsx)("div",{className:"text-text-dark text-sm font-medium",children:e.name})]}),dropdownIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current"}),collapseIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current rotate-180"}),pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full","!flex !justify-start")}),input:()=>({className:(0,to.xW)("!py-[8.5px]")}),wrapper:{className:"!bg-segment-background !rounded-[8px]"}}})})]}),(0,eB.jsxs)("div",{className:"w-full flex flex-col mt-[14px]",children:[(0,eB.jsx)("span",{className:"text-sm text-text-light",children:e("trade.currently_supported_networks")}),(0,eB.jsx)("div",{className:"bg-segment-background rounded-lg mt-2",children:(0,eB.jsx)(ti.m,{value:i,onChange:e=>(e=>{let t=e.value,a=r$.filter(e=>t.tokenIds.includes(e.id)),r=a.find(e=>e.id===c.id)||a[0];o(t),d(r),b(!1),u&&F(u,(null==l?void 0:l.wallets.find(e=>{var l;return(null==(l=e.chain)?void 0:l.toLowerCase())===t.id}))||(null==l?void 0:l.wallets[0]),a),(0,e9.$s)(e9.v_,{network:t.id})})(e),options:r,optionLabel:"name",itemTemplate:R,valueTemplate:R,dropdownIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current"}),collapseIcon:(0,eB.jsx)(tP.A,{className:"w-4 h-4 text-text-light fill-current rotate-180"}),pt:{root:()=>({className:(0,to.xW)("w-full","focus:outline-none focus:outline-offset-0")}),item:()=>({className:(0,to.xW)("w-full h-9","!flex !justify-start")}
1),input:()=>({className:(0,to.xW)("!py-[9px]")}),wrapper:{className:"!bg-segment-background !rounded-[8px]"}}})})]}),(0,eB.jsx)("span",{className:"w-full text-text-light text-sm mt-[14px]",children:e("trade.recipient_address")}),(0,eB.jsx)("div",{className:"w-full border border-segment-background rounded-[8px] mt-2 input-wrapper focus-within:border-input-hover-border",children:(0,eB.jsx)(rG.S,{className:"w-full !font-medium !text-text-dark !text-sm !py-[9px] !px-3 !rounded-[8px] !bg-segment-background !border-none placeholder:!text-text-light placeholder:!font-normal",placeholder:e("home.withdraw_recipient_address"),value:x,onChange:e=>m(e.target.value)})}),(0,eB.jsx)("span",{className:"w-full text-text-light text-sm mt-[14px]",children:e("trade.withdrawal_amount")}),(0,eB.jsxs)("div",{className:"w-full bg-segment-background rounded-[8px] px-3 py-2 mt-2 flex border border-segment-background items-center justify-between input-wrapper ".concat(v||M?"focus-within:border-[#E43C5A99]":"focus-within:border-input-hover-border"),children:[(0,eB.jsx)("input",{className:"flex-1 w-full min-w-0 text-sm font-medium text-text-dark mr-1 transfer placeholder:!text-text-light placeholder:!font-normal",type:"text",placeholder:e("home.withdraw_amount_hint",{amount:(null==A?void 0:A.withdrawMinAmount)||1}),value:(0,tJ.Z1)(u,a),onChange:e=>L(e.target.value)}),(0,eB.jsx)("button",{type:"button",className:"text-xs whitespace-nowrap ".concat(P?"cursor-not-allowed text-text-light opacity-40":"cursor-pointer text-main-color"),disabled:P,onClick:()=>{P||(L((0,eY.Ix)(D,2)),(0,e9.$s)(e9.hi))},children:e("trade.max")})]}),(0,eB.jsx)("span",{className:"w-full h-[14px] mt-2 text-[#E43C5A] text-xs font-normal ".concat(v?"visible":"invisible"),children:v}),(0,eB.jsxs)("div",{className:"w-full flex items-center justify-between mt-3 text-xs",children:[!O&&(0,eB.jsxs)("div",{className:"flex items-center whitespace-pre-wrap",children:[(0,eB.jsx)("span",{className:"text-text-light",children:e("trade.available_balance1")}),(0,eB.jsx)("span",{className:"text-text-dark font-semibold",children:"".concat((0,eY.tu)(j)," USD")})]}),(0,eB.jsxs)("div",{className:"flex items-center whitespace-pre-wrap",children:[(0,eB.jsx)("span",{className:"text-text-light",children:e("trade.network_fee")}),(0,eB.jsx)("span",{className:"text-text-dark font-semibold",children:"".concat((0,eY.tu)(null==A?void 0:A.withdrawFee)," USD")})]})]}),(0,eB.jsxs)("div",{className:"w-full mt-4 relative mb-2 md:mb-0",children:[(0,eB.jsx)(eT.$,{className:"w-full main-button !border-none !text-[14px] !h-10 !rounded-[10px]",rounded:!0,label:e("home.withdrawal"),onClick:()=>{var l;h(!0),(0,e9.$s)(e9.kr,{amount:(0,eY.Pj)(Number(u))}),l={network:i.id,address:x,amount:u,asset:c.name},(0,eH.du)(l).then(()=>{t(),(0,eV.P0)("success",e("home.withdrawal_request_submitted"))}).finally(()=>{h(!1)})},disabled:!x||0===x.trim().length||!u||0===Number(u)||f||B}),f?(0,eB.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eW,alt:""}):null]}),O&&(0,eB.jsxs)("div",{className:"mt-2 w-full text-center text-xs font-normal leading-4 text-text-light",children:[O," ",(0,eB.jsxs)("a",{href:"/help/leverage-restriction",className:"inline-flex items-center font-medium text-text-light",target:"_blank",rel:"noopener noreferrer",children:[e("common.learn_more"),(0,eB.jsx)(lW.A,{className:"h-4 w-4",strokeWidth:2})]})]})]})},rK=e=>{let{type:t,onCancel:l,onConfirm:a,onJump:r}=e,{t:s}=(0,ez.Bd)(),{hideDialog:n}=rZ(),i=(0,e2.useRouter)(),o=(0,lf.l)(e=>e.isMobile),c=()=>{l(),n()};return(0,eB.jsxs)(e$,{className:"bg-dialog-background rounded-t-2xl md:rounded-2xl pt-6 w-screen md:w-[420px] flex flex-col items-center p-8",children:[(0,eB.jsxs)("div",{className:"w-full flex flex-row items-center justify-between gap-4 relative",children:[(0,eB.jsx)("span",{className:"flex-1 text-[20px] text-text-dark text-center font-semibold mx-6",children:s(1===t?"assets.active_trial_funds_position":"assets.trial_funds_revoked")}),(0,eB.jsx)("div",{className:"shrink-0 absolute right-0 cursor-pointer p-2",onClick:c,"aria-label":s("trade.close"),children:(0,eB.jsx)(e5.A,{className:"ml-auto w-2 h-2 text-text-dark fill-current"})})]}
1),(0,eB.jsx)("div",{className:"w-full bg-border-color rounded-[10px] p-4 mt-8",children:(0,eB.jsx)("span",{className:"text-base leading-8 font-medium text-text-dark",children:s(1===t?"assets.active_trial_funds_position_content":"assets.trial_funds_revoked_content")})}),(0,eB.jsxs)("div",{className:"mt-8 w-full flex flex-row items-center justify-between gap-2 text-sm",children:[(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-text-dark bg-border-color rounded-lg cursor-pointer",onClick:c,children:s("trade.cancel")}),(0,eB.jsx)("div",{className:"flex-1 h-10 flex justify-center items-center text-affiliate-search-text bg-text-dark rounded-lg cursor-pointer",onClick:()=>{1===t?(o?i.push("/orders"):i.push("/trade"),r()):a(),n()},children:s("partner.confirm")})]})]})};function rZ(){let{showDialog:e,hideDialog:t}=(0,eI._E)();return{showDialog:e,hideDialog:t,showLoginDialog:()=>{e({content:(0,eB.jsx)(lN,{})})},showSelectWalletDialog:()=>{e({content:(0,eB.jsx)(aV,{})})},showSelectChainDialog:(t,l)=>{e({content:(0,eB.jsx)(aP,{walletName:t,walletIcon:l})})},showLoginLoadingDialog:(t,l)=>{e({content:(0,eB.jsx)(lL,{walletName:t,...l})})},showDepositCodeDialog:()=>{e({content:(0,eB.jsx)(tD,{})})},showWithdrawalDialog:()=>{e({content:(0,eB.jsx)(rX,{})})},showModifyLeverDialog:(t,l,a,r,s,n,i,o)=>{e({content:(0,eB.jsx)(lV,{tokenName:t,symbol:l,lever:a,callback:o,minLever:r,maxLever:s,restrictedMaxLever:n,leverageRange:i})})},showClosePositionDialog:(t,l)=>{e({content:(0,eB.jsx)(ts,{data:t,callback:l})})},showClosePositionLimitDialog:(t,l)=>{e({content:(0,eB.jsx)(tx,{data:t,callback:l})})},showActiveCodeDialog:()=>{e({content:(0,eB.jsx)(eq,{})})},showEditOpenOrderDialog:(t,l,a)=>{e({content:(0,eB.jsx)(t8,{category:t,positionId:l,callback:a})})},showEditOpenOrderTPSLDialog:(t,l,a)=>{e({content:(0,eB.jsx)(ll,{positionId:l,type:t,callback:a}),contentClassName:"!bg-dialog-background rounded-t-2xl md:!rounded-2xl !p-0 !m-0"})},showReferralRewardDialog:t=>{e({content:(0,eB.jsx)(av,{dataList:t})})},showReferralEnterCodeDialog:(t,l)=>{e({content:(0,eB.jsx)(ag,{callback:t,code:l})})},showDepositDialog:t=>{e({content:(0,eB.jsx)(t1,{onlyNormalDeposit:t})})},showInstallWalletDialog:t=>{e({content:(0,eB.jsx)(li,{walletName:t})})},showNewUserBonusDialog:l=>{e({content:(0,eB.jsx)(l2,{onHide:l}),dismissableMask:!0,position:"center",customHideDialog:()=>{l(),t()}})},showThridLoginLoadingDialog:()=>{e({content:(0,eB.jsx)(rx,{walletName:"Google"}),position:"center"})},showCloseAllPositionDialog:()=>{e({content:(0,eB.jsx)(ta,{})})},showTokenListDialog:t=>{e({content:(0,eB.jsx)(rh,{callback:t}),dismissableMask:!0})},showManageReferralsDialog:(t,l)=>{e({content:(0,eB.jsx)(lF,{data:t,callback:l}),dismissableMask:!0})},showCreateLinkDialog:(t,l,a)=>{e({content:(0,eB.jsx)(th,{remainNum:t,data:l,callback:a})})},showCustomerManagementFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(tw,{onReset:t,onSearch:l})})},showModifyReferralLinkDialog:(t,l)=>{e({content:(0,eB.jsx)(lZ,{data:t,callback:l})})},showModifyDefaultLinkDialog:t=>{e({content:(0,eB.jsx)(lH,{callback:t}),dismissableMask:!0})},showPartnerCommissionFilterDialog:(t,l,a)=>{e({content:(0,eB.jsx)(aa,{selectValue:t,onReset:l,onSearch:a})})},showPartnerReferralLinksFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(ao,{onReset:t,onSearch:l})})},showWalletLoginLoadingDialog:()=>{e({content:(0,eB.jsx)(rV,{})})},showWalletChainDialog:l=>{e({content:(0,eB.jsx)(rH,{onClose:l}),position:"bottom",dismissableMask:!0,customHideDialog:()=>{null==l||l(),t()}})},showStaticticsFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(ro,{onReset:t,onSearch:l})})},showModifyRemarkDialog:(t,l,a,r)=>{e({content:(0,eB.jsx)(lJ,{type:t,data:l,remark:a,callback:r})})},showTriggerTPSLDialog:t=>{e({content:(0,eB.jsx)(rE,{data:t})})},showReceiveVoucherLDialog:(l,a)=>{e({content:(0,eB.jsx)(ax,{data:l,onHide:a}),customHideDialog:()=>{a(),t()}})},showReceiveVoucherV2Dialog:(l,a,r)=>{e({content:(0,eB.jsx)(ah,{data:l,onHide:a,onDepositClick:r}),customHideDialog:()=>{a(),t()}})},showTrialFundActivatedDialog:(l,a)=>{e({content:(0,eB.jsx)(ry,{data:l}),customHideDialog:()=>{a(),t()}})},showVoucherDetailDialog:(t,l)=>{e({content:(0,eB.jsx)(rO,{data:t,index:l}
1),dismissableMask:!0})},showOrderSettingsDialog:(t,l,a)=>{e({content:(0,eB.jsx)(l7,{symbol:t,unit:l,onConfirm:a})})},showPartnerInviteConfirmDialog:(t,l)=>{e({content:(0,eB.jsx)(as,{data:t,callback:l})})},showPartnerInviteResultDialog:t=>{e({content:(0,eB.jsx)(ai,{data:t})})},showAddReferralsDialog:(t,l,a)=>{e({content:(0,eB.jsx)(e1,{type:t,data:l,callback:a})})},showPartnerAffiliateListFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(l8,{onReset:t,onSearch:l})})},showPartnerInviteListFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(an,{onReset:t,onSearch:l})})},showJoinGroupDialog:()=>{e({content:(0,eB.jsx)(lh,{}),position:"center"})},showWithdrawalHintDialog:(t,l,a,r)=>{e({content:(0,eB.jsx)(rK,{type:t,onCancel:l,onConfirm:a,onJump:r})})},showPartnerDepositWithdrawFilterDialog:(t,l)=>{e({content:(0,eB.jsx)(ar,{onReset:t,onSearch:l})})},showMarginModeDialog:(t,l,a)=>{e({content:(0,eB.jsx)(lT,{symbol:t,marginMode:l,callback:a})})},showTransactionDetailsDialog:t=>{e({content:(0,eB.jsx)(rb,{hash:t}),position:"bottom"})},showDeleteApikeyDialog:(t,l)=>{e({content:(0,eB.jsx)(tN,{data:t,callback:l}),dismissableMask:!0})},showApikeyActionDialog:(t,l)=>{e({content:(0,eB.jsx)(e6,{data:t,callback:l}),dismissableMask:!0})},showApikeyHintDialog:()=>{e({content:(0,eB.jsx)(e7,{}),dismissableMask:!0,position:"center"})},showShareProfitDialog:t=>{(0,e9.$s)(e9.cC),e({content:(0,eB.jsx)(ri,{data:t}),contentClassName:"!bg-dialog-background rounded-t-2xl md:!rounded-2xl !p-0 !m-0"})}}}},79477:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a,r=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let n=function(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),a||(a=r.createElement("path",{d:"M3.218 5.228a.72.72 0 0 1 1.053 0L8 9.122l3.729-3.894a.72.72 0 0 1 1.053 0c.29.304.29.796 0 1.1l-4.255 4.444a.723.723 0 0 1-1.054 0L3.218 6.328a.8.8 0 0 1 0-1.1",clipRule:"evenodd"})))}},79531:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>d,_E:()=>c});var a=l(80069),r=l(44533),s=l(20801),n=l(44362),i=l(83548);let o=(0,s.createContext)(void 0);function c(){let e=(0,s.use)(o);if(!e)throw Error("dialogContext must be used within a DialogProvider");return e}let d=e=>{let{children:t}=e,l=(0,i.l)(e=>e.isMobile),[c,d]=(0,s.useState)([]),x=()=>{d(e=>e.slice(0,-1))};return(0,a.jsxs)(o,{value:{showDialog:e=>{let{content:t,contentClassName:a="!bg-transparent !p-0 !m-0",position:r=l?"bottom":"center",dismissableMask:s=!1,customHideDialog:i}=e;d(e=>[...e,{id:(0,n.A)(),content:t,contentClassName:a,position:r,dismissableMask:s,customHideDialog:i}])},hideDialog:x},children:[t,c.map((e,t)=>{let l=t===c.length-1;return(0,a.jsx)(r.l,{contentClassName:e.contentClassName,showHeader:!1,visible:!0,onHide:e.customHideDialog?e.customHideDialog:l?x:()=>{},position:e.position,dismissableMask:e.dismissableMask,focusOnShow:!1,modal:!0,baseZIndex:1e3+100*t,children:e.content},e.id)})]})}},81999:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a,r,s=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let i=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),a||(a=s.createElement("path",{fill:"#6C757D",fillOpacity:.6,d:"M10.6 6A4.6 4.6 0 1 0 6 10.6V12A6 6 0 1 1 6 0a6 6 0 0 1 0 12v-1.4A4.6 4.6 0 0 0 10.6 6"})),r||(r=s.createElement("path",{fill:"#6C757D",fillOpacity:.6,fillRule:"evenodd",d:"M6 3.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5m0 6A.75.75 0 0 1 5.25 9V5.25a.75.75 0 0 1 1.5 0V9a.75.75 0 0 1-.75.75",clipRule:"evenodd"})))}},83046:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var a,r,s,n,i,o=l(80069),c=l(20801);function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let x=function(e){return c.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",width:48,height:48,fill:"none"}
1,e),a||(a=c.createElement("path",{stroke:"url(#ic_loading_circle_svg__a)",strokeLinecap:"round",strokeWidth:3,d:"M24 1.5C11.574 1.5 1.5 11.574 1.5 24S11.574 46.5 24 46.5"})),r||(r=c.createElement("defs",null,c.createElement("linearGradient",{id:"ic_loading_circle_svg__a",x1:24,x2:24,y1:46.5,y2:1.5,gradientUnits:"userSpaceOnUse"},c.createElement("stop",{stopColor:"#EDBE18",stopOpacity:0}),c.createElement("stop",{offset:1,stopColor:"#EDBE18"})))))};function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let u=function(e){return c.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:48,height:48,fill:"none"},e),s||(s=c.createElement("path",{fill:"#EDBE18",d:"M17.636 27.31a1.08 1.08 0 0 1 0 1.526L14.073 32.4a1.8 1.8 0 0 1-2.546-2.545l3.564-3.564a1.08 1.08 0 0 1 1.527 0z"})),n||(n=c.createElement("path",{fill:"#EDBE18",d:"M25.337 26.867a1.8 1.8 0 0 1-.064 2.479l-7.128 7.127a1.8 1.8 0 0 1-2.545-2.546l5.345-5.345a.72.72 0 0 0 0-1.018l-9.418-9.419a1.8 1.8 0 0 1 2.546-2.545l11.2 11.2zM32.4 33.927a1.8 1.8 0 0 1-2.545 2.546l-3.564-3.564a1.08 1.08 0 0 1 0-1.527l1.018-1.018a1.08 1.08 0 0 1 1.527 0zM21.71 15.09a1.08 1.08 0 0 1 0 1.528l-1.02 1.018a1.08 1.08 0 0 1-1.526 0L15.6 14.073a1.8 1.8 0 0 1 2.545-2.546zM32.4 11.527a1.8 1.8 0 0 1 0 2.546l-5.345 5.345a.72.72 0 0 0 0 1.018l9.418 9.419a1.8 1.8 0 0 1-2.546 2.545l-11.2-11.2a1.8 1.8 0 0 1 0-2.546l7.128-7.127a1.8 1.8 0 0 1 2.545 0"})),i||(i=c.createElement("path",{fill:"#EDBE18",d:"M36.473 15.6a1.8 1.8 0 0 1 0 2.545l-3.564 3.564a1.08 1.08 0 0 1-1.527 0l-1.018-1.018a1.08 1.08 0 0 1 0-1.527l3.563-3.564a1.8 1.8 0 0 1 2.546 0"})))},p=e=>{let{className:t}=e;return(0,o.jsxs)("div",{className:"".concat(t," relative"),children:[(0,o.jsx)(x,{className:"w-full h-full circle-progress stroke-3 stroke-loading-circle-stroke"}),(0,o.jsx)(u,{className:"w-full h-full absolute top-0 left-0"})]})}},83248:(e,t,l)=>{"use strict";l.d(t,{uJ:()=>S,Y8:()=>C,cF:()=>v});var a=l(37037),r=l(23476),s=l(84984),n=l(50989),i=l(96788),o=l(31480),c=l(32590),d=l(3770),x=l(33432),m=l(90411);let u=e=>e.chains.some(e=>e.startsWith("sui:")),p=(e,t)=>e.features[t];class f{get chains(){return this.requestedChains.filter(e=>{let t,l;return t=this.wallet,l=e.id,t.chains.some(e=>e==="sui:".concat(l)||"sui:mainnet"===e)})}async connect(){let e=p(this.wallet,"standard:connect");
1if(!e)throw Error("".concat(this.name," does not support Wallet Standard connection"));let{accounts:t}=await e.connect(),l=t[0];if(!l)throw Error("No Sui account was authorized by the wallet");return l.address}async disconnect(){var e;await (null==(e=p(this.wallet,"standard:disconnect"))?void 0:e.disconnect())}async getAccounts(){return this.wallet.accounts.map(e=>({address:e.address,namespace:"sui",type:"eoa"}))}constructor(e,t){this.wallet=e,this.requestedChains=t,this.type="ANNOUNCED",this.chain="sui",this.name=c.a.getConnectorName(e.name)||e.name,this.explorerId=o.L.ConnectorExplorerIds[this.name],this.id=this.explorerId||this.name,this.imageUrl=e.icon,this.provider=e}}class h extends d.X{syncConnectors(){var e=this;if(!x.w.isClient())return;let t=function(){for(var t=arguments.length,l=Array(t),a=0;a<t;a++)l[a]=arguments[a];let r=l.filter(u).map(t=>new f(t,e.getCaipNetworks())).filter(t=>!e.connectors.some(e=>e.id===t.id));r.length>0&&e.addConnector(...r)},l=(0,i.d)();t(...l.get()),l.on("register",function(){for(var e=arguments.length,l=Array(e),a=0;a<e;a++)l[a]=arguments[a];return t(...l)})}async setUniversalProvider(e){this.universalProvider=e,this.addConnector(new m.F({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"sui"}))}async connect(e){let t=this.connectors.find(t=>t.id===e.id);if(!t)throw Error("Sui wallet provider was not found");let l=e.address||"";if("WALLET_CONNECT"===t.type){var a;l=(null==(a=(await t.provider.request({method:"sui_getAccounts",params:{}},"sui:mainnet"))[0])?void 0:a.address)||""}else l=await t.connect();if(!l)throw Error("No Sui account was authorized by the wallet");let r=e.chainId||"mainnet",s=this.getCaipNetworks().find(e=>e.id===r);return this.addConnection({connectorId:t.id,accounts:[{address:l}],caipNetwork:s}),this.emit("accountChanged",{address:l,chainId:r,connector:t}),{id:t.id,type:t.type,chainId:r,provider:"WALLET_CONNECT"===t.type?t.provider:t.wallet,address:l}}async getAccounts(e){let t=this.connectors.find(t=>t.id===e.id);return t&&"WALLET_CONNECT"!==t.type?{accounts:await t.getAccounts()}:{accounts:[]}}async signMessage(e){let t=e.provider,l=t&&p(t,"sui:signPersonalMessage"),a=t&&t.accounts.find(t=>t.address.toLowerCase()===e.address.toLowerCase());if(!l||!a)throw Error("The selected Sui wallet does not support personal-message signing");return{signature:(await l.signPersonalMessage({account:a,message:new TextEncoder().encode(e.message)})).signature}}async disconnect(e){let t=(null==e?void 0:e.id)?this.connectors.find(t=>t.id===e.id):this.connector;(null==t?void 0:t.type)==="WALLET_CONNECT"?await t.provider.disconnect():await (null==t?void 0:t.disconnect());let l=this.connections;return this.clearConnections(!0),this.emit("disconnect"),{connections:l}}async getBalance(){return{balance:"0",symbol:"SUI"}}syncConnections(){return Promise.resolve()}async syncConnection(e){return this.connect({...e,type:""})}async estimateGas(){return{gas:BigInt(0)}}async sendTransaction(){throw Error("Sui transactions are not enabled yet")}async writeContract(){throw Error("Sui transactions are not enabled yet")}async writeSolanaTransaction(){throw Error("Sui transactions are not enabled yet")}parseUnits(){return BigInt(0)}formatUnits(){return"0"}getWalletConnectProvider(){return this.universalProvider}async getCapabilities(){return{}}async grantPermissions(){return{}}async revokePermissions(){return"0x"}async walletGetAssets(){return{}}constructor(){super({adapterType:"sui",namespace:"sui"})}}let g=[n.tWt],b=[n.aUf,n.NBY],v={id:"mainnet",caipNetworkId:"sui:mainnet",chainNamespace:"sui",name:"Sui",nativeCurrency:{name:"Sui",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.mainnet.sui.io:443"]}}},w="a91487f22b50836d9b62f576d6ba9dff";if(!w)throw Error("NEXT_PUBLIC_PROJECT_ID is not set");let j={CustomWallets:[],ProjectId:w,SolanaNetworks:g,EvmNetworks:b,SuiNetworks:[v]},N={name:"XStable",description:"Trade precious metals securely with real-time prices and market trends. Support for Gold (XAU/USD), Silver (XAG/USD), Platinum (XPT/USD), Palladium (XPD/USD), and Copper (HG/USD). Spot and contract trading available with professional tools and fast execution.",url:a.wE.isClient()?window.location.origin:"",icons:["https://cdn.xstable.ai/web/logo.png"]},_={termsConditionsUrl:"https://www.xstable.ai/terms-of-service",privacyPolicyUrl:"https://www.xstable.ai/privacy-policy",customWallets:j.CustomWallets,allowUnsupportedChain:!0,projectId:j.ProjectId,metadata:N,themeVariables:{"--apkt-font-family":"'IBM Plex Sans', 'IBM Plex Sans Fallback', Arial, sans-serif"}},k={monad:{..._,adapters:["ethers"],networks:j.EvmNetworks,defaultNetwork:n.tWt},multiChain:{..._,adapters:["ethers","solana","sui"],networks:[...j.EvmNetworks,...j.SolanaNetworks,...j.SuiNetworks],defaultNetwork:n.tWt},solana:{..._,adapters:["solana"],networks:j.SolanaNetworks,includeWalletIds:["a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393","8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4","971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
1a09c0faed0709","5d9f1395b3a8e848684848dc4147cbd05c8d54bb737eac78fe103901fe6b01a1","c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96"]}},y=new s.S,E=new r.H,A=new h;function C(e){return k[e]||void 0}function S(e){let t=[];return null==e||e.forEach(e=>{"ethers"===e&&t.push(E),"solana"===e&&t.push(y),"sui"===e&&t.push(A)}),t}},83548:(e,t,l)=>{"use strict";l.d(t,{J:()=>r,l:()=>s});var a=l(6558);let r=e=>{s.setState({isMobile:e,ready:!0})},s=(0,a.v)(()=>({isMobile:!1,ready:!1}))},84243:(e,t,l)=>{"use strict";l.d(t,{IY:()=>u,L6:()=>x,MO:()=>m,OD:()=>h,SK:()=>c,Y_:()=>o,f6:()=>f,lu:()=>g,sT:()=>i});var a=l(6558),r=l(70140),s=l(39580),n=l(57454);let i=async()=>{let e=await (0,r.Un)();e&&g.setState({unReadNum:e.count})},o=async()=>{let e=await (0,r.wQ)();e&&g.setState({maxRate:e})},c=()=>{let e=g.getState().unReadNum;e>0&&g.setState({unReadNum:e-1})},d=()=>{i(),window.dispatchEvent(new CustomEvent("RECEIVE_NEW_NOTICE"))},x=()=>{s.z.subscribe("inbox",d)},m=()=>{g.setState({unReadNum:0}),s.z.unsubscribe("inbox",d)},u=()=>{g.setState({unReadNum:0})},p=()=>{(0,n.fp)(),window.dispatchEvent(new CustomEvent("RECEIVE_REWARD_ARRIVE"))},f=()=>{s.z.subscribe("rewards",p)},h=()=>{s.z.unsubscribe("rewards",p)},g=(0,a.v)(()=>({noticeList:[],unReadNum:0,maxRate:0}))},90647:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a,r=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let n=function(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),a||(a=r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1m4.768 9.14a1 1 0 1 0-1.536-1.28l-4.3 5.159-2.225-2.226a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.475-.067z",clipRule:"evenodd"})))}}}]);
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.