1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2584,6090],{84940:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/trade/[id]",function(){return n(30459)}])},78354:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var l=n(58474),r=n(63159),i=n(78961),a=n(13892),o=n(11458),s=n(50321),d=n(53886),c=n(53165),u=n(63618),p=n(57542),m=n(15004),h=n(3935),x=n(31256),f=n(86393);function v(){let e=(0,l._)(["\n color: ",";\n font-size: 12px;\n line-height: 14px;\n display: flex;\n justify-content: space-between;\n\n svg {\n width: 14px;\n color: ",";\n }\n"]);return v=function(){return e},e}function g(){let e=(0,l._)(["\n &.lbank-btn-only-icon,\n &.lbank-btn-icon-only {\n font-size: 20px;\n width: auto;\n height: auto;\n }\n"]);return g=function(){return e},e}let b=a.Ay.div(v(),s.fG,s.vZ),y=(0,a.Ay)(o.A)(g()),A=(0,d.memo)(e=>{let{usableAssets:t,assetCode:n}=e,{t:l}=(0,i.A)(),{openRecharge:a}=(0,h.V)({assetCode:n}),{navigateToLoginOrElseFn:o}=(0,p.A)(),s=(0,f.A)(),d=(0,u.default)(()=>{o(()=>a({title:"".concat(l("L0001444å
å¸")," / ").concat(l("L0000900å转")),sensorData:{eventName:"web_spot_depositPage_click",clickNameMap:{deposit:"deposit_cryptocurrency",transfer:"transfer",oneClickBuy:"one_click_buy",p2pTrading:"p2p_trading"},pageName:"available_icon"}}))});return(0,r.jsxs)(b,{className:"trade_avail",children:[(0,r.jsx)(c.A,{nowrap:!0,gap:4,tooltipProps:{placement:"topRight"},title:l("L0010555å¯ç¨çç¿»å¦Avail"),value:(0,r.jsx)(x.A,{children:t})}),!s&&(0,r.jsx)(y,{prefixIcon:(0,r.jsx)(m.A,{}),type:"link",onClick:d})]})})},37861:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var l=n(58474),r=n(63159),i=n(53886),a=n.n(i),o=n(60539),s=n(63618),d=n(13892),c=n(12692),u=n(50321),p=n(38132),m=n(18804);function h(){let e=(0,l._)(["\n position: relative;\n\n .lbk_dnd_sort_item {\n min-height: 40px;\n padding: 9px 14px;\n padding-right: 46px;\n position: relative;\n z-index: 1;\n background-color: #17181a;\n display: flex;\n align-items: center;\n\n &.lbk_dnd_sort_item_dragging {\n box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.6);\n background-color: #1f2024;\n z-index: 100;\n transition: none;\n }\n }\n\n .lbk_dnd_sort_item_wrapper {\n transition: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1;\n user-select: none;\n\n &.lbk_dnd_sort_item_wrapper_dragging {\n z-index: 100;\n transition: none;\n }\n }\n\n .lbk_dnd_drag_icon {\n padding: 10px 12px 10px 8px;\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n cursor: grab;\n display: flex;\n align-items: center;\n\n .lbank-icon {\n font-size: 20px;\n color: ",";\n }\n }\n\n &.lbk_dnd_dragging {\n .lbk_dnd_sort_item {\n transition: none;\n }\n\n .lbk_dnd_drag_icon {\n cursor: grabbing;\n }\n\n .lbk_dnd_sort_item_wrapper {\n transition: transform 300ms ease 0ms;\n }\n }\n"]);return h=function(){return e},e}let x=!c.default,f=!1;if(x)try{let e=Object.defineProperty({}
1,"passive",{get(){f=!0}});window.addEventListener("test",null,e)}catch(e){}function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(e=>{e&&e.clientHeight})}let g=d.Ay.div(h(),u.vZ),b=a().createContext({}),y=e=>{let{className:t,onInsert:n,children:l,onHeightChange:a}=e,d=(0,i.useRef)(null),c=(0,i.useRef)([]),[u,p]=(0,i.useState)(),m=(0,i.useRef)();(0,i.useEffect)(()=>{if(null==u)return;let e=!1,t=t=>{var n;if(!m.current||!d.current||e)return;t.preventDefault();let{startY:l,movingEl:r,item:i,itemsRect:a,wrapperRect:o}=m.current,{pageY:s}=(null===(n=t.touches)||void 0===n?void 0:n[0])||t;r.style.transform=r.style.webkitTransform="translate(0px,".concat(s-l,"px)");let u=-1,p=s-window.scrollY;if(p>o.bottom-a[a.length-1].rect.height/2)u=c.current.length-1;else for(let e=0;e<a.length;e++){let{rect:t}=a[e];p>t.bottom-t.height/2&&(u=e)}let h=a.findIndex(e=>e.el===i),x=a[0].rect.top;if(-1!==u&&u!==h){let e=a[h];a.splice(h,1),a.splice(u,0,e);let t=0;a.forEach(e=>{let{el:n,rect:l}=e;n!==i&&(n.style.transform=n.style.webkitTransform="translate(0px,".concat(t,"px)")),l.top=t+x,l.bottom=t+l.height+x,t+=l.he
1ight}),m.current.swapIndex=u}},l=()=>{var t;if(!m.current||e)return;e=!0,null===(t=d.current)||void 0===t||t.classList.remove("lbk_dnd_dragging");let{item:l,movingEl:r,swapIndex:i,itemsRect:a,oldIndex:o}=m.current;if(v(d.current),-1!==i){let e=r.getBoundingClientRect().top,t=0;a.forEach(e=>{let{el:n,rect:r}=e;n===l&&(l.style.transform=l.style.webkitTransform="translate(0px,".concat(t,"px)")),t+=r.height}),r.style.transition="none";let n=l.getBoundingClientRect();r.style.transform=r.style.webkitTransform="translate(0px,".concat(e-n.top,"px)"),v(r,l)}r.style.transition="transform 300ms ease 0s",r.style.transform=r.style.webkitTransform="translate(0px,0px)",setTimeout(()=>{l.style.transition="",r.style.transition="",r.style.transform="",-1!==i&&o!==i&&(null==n||n(o,i)),p(null),m.current=void 0,e=!1},300)},[,r,i,a]="ontouchstart"in document.body?["touchstart","touchmove","touchend","touchcancel"]:["mousedown","mousemove","mouseup"];return document.body.addEventListener(r,t,!!f&&{passive:!1}),document.body.addEventListener(i,l,!0),a&&document.body.addEventListener(a,l,!0),()=>{document.body.removeEventListener(r,t),document.body.removeEventListener(i,l,!0),a&&document.body.removeEventListener(a,l,!0)}},[u]);let h=(0,i.useRef)(0);return(0,o.A)(()=>{if(null!=u||!d.current)return;let e=[];d.current.querySelectorAll(".lbk_dnd_sort_item_wrapper").forEach(t=>{e.push(t)});let t=0;e.forEach(e=>{e.style.transform=e.style.webkitTransform="translate(0px,".concat(t,"px)"),t+=e.offsetHeight}),c.current=e,d.current.style.height="".concat(t,"px"),h.current!==t&&(h.current=t,null==a||a(t))}),(0,r.jsx)(b.Provider,{value:{draggingValue:u,items:c,dragStart:(0,s.default)((e,t,n,l)=>{var r;if(!d.current||m.current)return;let{pageX:i,pageY:a}=(null===(r=e.touches)||void 0===r?void 0:r[0])||e,o=c.current.map(e=>{let t=e.getBoundingClientRect();return{el:e,rect:{top:t.top,height:t.height,bottom:t.bottom}}}),s=c.current.indexOf(t);m.current={startX:i,startY:a,item:t,movingEl:n,value:l,wrapperRect:d.current.getBoundingClientRect(),itemsRect:o,swapIndex:-1,oldIndex:s},p(l)})},children:(0,r.jsx)(g,{ref:d,className:"lbk_dnd ".concat(null!=u?"lbk_dnd_dragging":""," ").concat(t||""),children:l})})};y.Item=e=>{let{wrapCls:t,className:n,children:l,value:a,iconType:o}=e,d=(0,i.useRef)(null),c=(0,i.useRef)(null),u=(0,i.useRef)(null),{dragStart:h,draggingValue:x}=(0,i.useContext)(b),f=(0,s.default)(e=>{h(e,d.current,c.current,a)});return(0,i.useEffect)(()=>{var e;let t="ontouchstart"in document.body?"touchstart":"mousedown";return null===(e=u.current)||void 0===e||e.addEventListener(t,f),()=>{var e;null===(e=u.current)||void 0===e||e.removeEventListener(t,f)}},[]),(0,r.jsx)("div",{ref:d,"data-dnd-value":a,className:"lbk_dnd_sort_item_wrapper ".concat(x===a?"lbk_dnd_sort_item_wrapper_dragging":""," ").concat(t||""),children:(0,r.jsxs)("div",{ref:c,className:"lbk_dnd_sort_item ".concat(x===a?"lbk_dnd_sort_item_dragging":""," ").concat(n||""),children:[l,(0,r.jsx)("div",{className:"lbk_dnd_drag_icon",ref:u,children:"list"===o?(0,r.jsx)(m.A,{}):(0,r.jsx)(p.A,{})})]})})};let A=y},82278:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>u,Zl:()=>h,aT:()=>m,iq:()=>x});var l=n(63159),r=n(82491),i=n(63618),a=n(12692),o=n(53886),s=n.n(o),d=n(46700);let c=s().createContext({}),u=c,p=new Map,m=e=>{let{guideKey:t,total:n,children:s,enabled:d=!0,pageable:u=!1,isFixedToBottom:m,onChange:h,onStart:x,guideRef:f}=e,v=(0,r.A)(),g="lbk-guide-".concat(t),[b,y]=(0,o.useState)(-1),A=(0,o.useRef)(b),j=(0,o.useCallback)(e=>{A.current=e,y(e)},[]);(0,o.useEffect)(()=>{d&&(j(a.default?0:Number(localStorage.getItem(g)||0)),null==x||x(b))},[d]);let L=(0,i.default)(()=>{j(b+1),null==h||h(b+1),b+1>n&&localStorage.setItem(g,"".concat(n))}),C=(0,i.default)(()=>{j(Math.max(b-1,0)),null==h||h(Math.max(b-1))}),w=(0,i.default)(()=>{j(n),null==h||h(n),localStorage.setItem(g,"".concat(n))});return(0,o.useEffect)(()=>{n&&b>=n&&localStorage.setItem(g,"".concat(n))},[b,n]),(0,o.useEffect)(()=>{let e=p.get(g)||{updateFns:new Set};p.set(g,{...e,total:n,current:b}),e.updateFns.forEach(e=>e())},[g,n,b]),(0,o.useImperativeHandle)(f,()=>({setCurrent:j,getCurrent:()=>A.current}),[j]),(0,l.jsx)(c.Provider,{value:{total:n,current:d?b:-1,pageable:u,isFixedToBottom:null!=m?m:v,prev:C,next:L,skip:w},children:s})},h=()=>(0,o.useContext)(c),x=e=>{let t=(0,d.A)(),n="lbk-guide-".concat(e),l=p.get(n);return l||(l={current:-1,total:0,updateFns:new Set},p.set(n,l)),l.updateFns.has(t)||l.updateFns.add(t),(0,o.useEffect)(()=>()=>{var e;null===(e=p.get(n))||void 0===e||e.updateFns.delete(t)},[n]),(null==l?void 0:l.current)!=null&&-1!==l.current&&l.current<l.total}},22840:(e,t,n)=>{"use strict";n.d(t,{aT:()=>l.aT,tS:()=>E,Zl:()=>l.Zl});var l=n(82278),r=n(58474),i=n(63159),a=n(39866),o=n.n(a),s=n(53886),d=n(60583),c=n(13892),u=n(11458),p=n(82491
1),m=n(11161),h=n(49457),x=n(92993),f=n(35382),v=n(50321),g=n(76025),b=n(60426),y=n(78961);function A(){let e=(0,r._)(["\n#__next {\n position: relative;\n}\n.lbk_guide_step_hl_wrapper {\n width: fit-content;\n > * {\n z-index: 1;\n position: relative;\n }\n .lbk_guide_step_hl_bg {\n position: absolute;\n top: -8px;\n left: -8px;\n right: -8px;\n bottom: -8px;\n z-index: 0;\n }\n}\nbody.scroll-lock {\n overflow: hidden;\n height: 100vh !important;\n height: 100dvh !important;\n}\n"]);return A=function(){return e},e}function j(){let e=(0,r._)(["\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n border: 0 solid rgba(0, 0, 0, 0.7);\n background-color: transparent;\n display: flex;\n flex-direction: column;\n &::after {\n display: block;\n flex: 1;\n content: '';\n background-color: rgba(0, 0, 0, 0.7);\n }\n .guild_mask_hl {\n overflow: hidden;\n position: absolute;\n top: 0;\n /* @noflip */\n left: 0;\n &::after {\n position: absolute;\n content: '';\n display: block;\n border-radius: 12px;\n border: 4px solid rgba(0, 0, 0, 0.7);\n width: 100%;\n height: 100%;\n box-sizing: content-box;\n /* @noflip */\n left: -4px;\n top: -4px;\n }\n }\n .guild_mask_right {\n background-color: rgba(0, 0, 0, 0.7);\n position: absolute;\n /* @noflip */\n right: 0;\n top: 0;\n }\n"]);return j=function(){return e},e}function L(){let e=(0,r._)([""]);return L=function(){return e},e}function C(){let e=(0,r._)(["\n &:not(.fixed_to_bottom) {\n padding: 16px;\n .guide_title {\n margin-bottom: 16px;\n font-size: 16px;\n line-height: 19px;\n }\n .guide_content {\n line-height: 16px;\n }\n .guide_footer {\n padding-top: 16px;\n .buttons {\n .lbank-btn {\n height: 24px;\n padding: 0 12px;\n .lbank-icon {\n font-size: 14px;\n }\n }\n }\n }\n }\n "]);return C=function(){return e},e}function w(){let e=(0,r._)(["\n padding: 24px 24px 20px 24px;\n border-radius: 12px;\n border: 1px solid ",";\n background: ",";\n\n position: absolute;\n width: fit-content;\n z-index: 10001;\n\n box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.2);\n\n .guide_title {\n color: #fff;\n font-size: 16px;\n font-weight: 500;\n line-height: 22px;\n margin-bottom: 26px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n .lbank-icon-close {\n font-size: 20px;\n color: ",";\n cursor: pointer;\n }\n }\n\n .guide_content {\n color: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n .label {\n color: #fff;\n font-weight: 500;\n margin-bottom: 4px;\n line-height: 16px;\n }\n .text {\n line-height: 14px;\n }\n .text + .label,\n .desc + .label {\n padding-top: 20px;\n }\n .message {\n color: ",";\n font-size: 12px;\n line-height: 14px;\n }\n }\n\n .guide_footer {\n padding-top: 30px;\n display: flex;\n align-items: center;\n .guide_steps {\n flex: 1;\n color: #9b9fa8;\n font-size: 12px;\n line-height: 17px;\n .current {\n color: #fff;\n font-size: 14px;\n }\n }\n .buttons {\n display: flex;\n align-items: center;\n\n .lbank-btn-ghost {\n border: 1px solid ",";\n margin-right: 16px;\n body[data-dir='rtl'] & {\n margin-left: 16px;\n }\n }\n .lbank-btn {\n height: 32px;\n .lbank-icon {\n font-size: 20px;\n }\n }\n }\n }\n\n &.pageable {\n .buttons {\n .lbank-btn {\n > span {\n display: flex;\n }\n }\n .lbank-btn-ghost {\n margin-right: 12px;\n body[data-dir='rtl'] & {\n margin-left: 12px;\n }\n }\n }\n }\n\n &.placement_topLeft:not(.fixed_to_bottom) {\n transform: translateY(-100%);\n }\n &.placement_topRight:not(.fixed_to_bottom) {\n transform: translateX(-100%);\n }\n &.placement_topRightAbove:not(.fixed_to_bottom) {\n /* @noflip */\n transform: translate(-100%, -100%);\n }\n &.placement_bottomLeft:not(.fixed_to_bottom) {\n transform: translateY(0%);\n }\n &.placement_bottomRight:not(.fixed_to_bottom) {\n /* @noflip */\n transform: translate(-100%, 0%);\n }\n &.placement_bottomCenter:not(.fixed_to_bottom) {\n /* @noflip */\n transform: translate(0%, 0%);\n }\n\n &.fixed_to_bottom {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 16px 14px 24px 14px;\n }\n\n ","\n"]);return w=function(){return e},e}let k=(0,d.DU)(A()),_=c.Ay.div(j()),N=c.Ay.div(w(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizBackgroun
1d[2]},v.z_,v.fG,v.fG,v.fG,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},(0,v.FE)({notMobile:(0,d.AH)(L()),mobile:(0,d.AH)(C())})),T=e=>{let{highlightArea:t={top:0,left:0,height:0,width:0},isFixed:n}=e,l=(0,p.A)();return(0,s.useEffect)(()=>{if(l)return document.body.classList.add("scroll-lock"),()=>{document.body.classList.remove("scroll-lock")}},[l]),o().createPortal((0,i.jsxs)(_,{onClick:e=>{e.stopPropagation()},style:{borderTopWidth:t.top,borderLeftWidth:t.left,paddingTop:t.height,position:n?"fixed":"absolute"},children:[(0,i.jsx)("div",{className:"guild_mask_hl",style:{width:t.width,height:t.height}}),(0,i.jsx)("p",{className:"guild_mask_right",style:{height:t.height,left:"".concat(t.width,"px")}})]}),document.getElementById("__next"))},S=e=>{let{placement:t,tipArea:n,offset:r,width:a,title:d,content:c,index:m,elRef:v,completeText:b,showNum:A=!0,noSkip:j,onComplete:L,isFixed:C}=e,{total:w,pageable:k,next:_,skip:T,prev:S,isFixedToBottom:E}=(0,s.useContext)(l.Ay),P=(0,p.A)(),{t:O}=(0,y.A)();return o().createPortal((0,i.jsxs)(N,{ref:v,onClick:e=>{e.stopPropagation()},className:"guide_tips ".concat(E?"fixed_to_bottom":""," placement_").concat(t," ").concat(k?"pageable":""),style:E?{position:"fixed",width:"100%",bottom:0,left:0}:{...n,marginTop:null==r?void 0:r.top,marginLeft:null==r?void 0:r.left,width:null!=a?a:P?260:380,position:C?"fixed":"absolute"},children:[(0,i.jsxs)("div",{className:"guide_title",children:[(0,i.jsx)("span",{children:d}),k?(0,i.jsx)(h.A,{onClick:T}):null]}),(0,i.jsx)("div",{className:"guide_content",children:c}),(0,i.jsxs)("div",{className:"guide_footer",children:[(0,i.jsx)("p",{className:"guide_steps",children:A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"current",children:m+1}),"/",w]})}),(0,i.jsxs)("div",{className:"buttons",children:[j||m===w-1||k?k&&0!==m?(0,i.jsx)(u.A,{type:"ghost",onClick:S,size:"middle",children:(0,i.jsx)(g.A,{children:(0,i.jsx)(x.A,{})})}):j?null:(0,i.jsx)(u.A,{type:"ghost",onClick:T,size:"middle",children:O("L0000216è·³è¿")}):(0,i.jsx)(u.A,{type:"ghost",onClick:T,size:"middle",children:O("L0000216è·³è¿")}),(0,i.jsx)(u.A,{variant:"primary",onClick:()=>{_(),m===w-1&&(null==L||L())},size:"middle",children:m===w-1?b||O("L0002045宿"):k?(0,i.jsx)(g.A,{children:(0,i.jsx)(f.A,{})}):O("L0000057ä¸ä¸æ¥")})]})]})]}),document.getElementById("__next"))},E=e=>{let{index:t,placement:n,highlightAreaOffset:r,highlightBg:a,children:o,title:d,content:c,offset:u,renderId:h,onShow:x,getHighlightEl:f,autoScrollIntoView:v=!0,preserveDom:g=!1,isFixed:y=!1,...A}=e,j=(0,p.A)(),{current:L,isFixedToBottom:C}=(0,s.useContext)(l.Ay),w=(0,s.useRef)(null),[_,N]=(0,s.useState)(),[E,P]=(0,s.useState)(),[O,R]=(0,s.use
1State)(""),I=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(w.current){let e=w.current,t=document.getElementById("__next"),n=new ResizeObserver(()=>{R("".concat(e.offsetLeft,"x").concat(e.offsetTop,"x").concat(null==e?void 0:e.offsetWidth,"x").concat(null==e?void 0:e.offsetHeight,"x").concat(document.body.scrollHeight))});return n.observe(e),t&&n.observe(t),()=>{n.disconnect()}}},[w.current]),(0,b.A)(()=>{let e=f?f(w.current):w.current;t===L&&e&&setTimeout(()=>{null==x||x(e);let{top:t,left:l,width:i,height:a}=e.getBoundingClientRect(),o=window.scrollY||document.documentElement.scrollTop||document.body.scrollTop,s=document.documentElement.scrollLeft||document.body.scrollLeft,d=(null==r?void 0:r.top)||0,c=(null==r?void 0:r.left)||0,u=(null==r?void 0:r.bottom)||0,p=(null==r?void 0:r.right)||0,h=(0,m.d)(e),f=h-o;N({top:h+d,left:l+s+c,width:i-c-p,height:a-d-u}),v&&setTimeout(()=>{var e;let{height:n,top:l}=(null===(e=I.current)||void 0===e?void 0:e.getBoundingClientRect())||{top:0,height:0},r=f+a+30+(n||0)-window.innerHeight;if(!j){let e=Math.min(l,t),r=Math.max(l+n,t+a);if(e>=0&&r<=window.innerHeight)return}window.scrollTo(0,r+o),document.documentElement.scrollTop=document.body.scrollTop=r+o},0);let g=("topRight"===n||"topRightAbove"===n||"bottomRight"===n?l+i:"bottomCenter"===n?l-190+i/2:l)+s;P({left:"bottomCenter"===n||"bottomLeft"===n?Math.max(0,Math.min(window.innerWidth-(window.innerWidth<780?260:380),g)):g,top:("bottomLeft"===n||"bottomRight"===n||"bottomCenter"===n?f+a:f)+o})})},16,[L,t,O,C,JSON.stringify(r),h,v,j]);let M=t===L;return g||M?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{}),M&&(0,i.jsx)(T,{highlightArea:_,isFixed:y}),(0,i.jsxs)("div",{className:"lbk_guide_step_hl_wrapper ".concat(a?" relative":""),ref:w,children:[o,M&&a?(0,i.jsx)("i",{className:"lbk_guide_step_hl_bg ".concat(a?" bg-bg2":"")}):null]}),M&&E&&(0,i.jsx)(S,{...A,offset:u,elRef:I,title:d,content:c,tipArea:E,index:t,placement:n,isFixed:y})]}):(0,i.jsx)(i.Fragment,{children:o})}},8211:(e,t,n)=>{"use strict";n.d(t,{A:()=>D});var l=n(58474),r=n(63159),i=n(53886),a=n(94402),o=n(78961),s=n(81491),d=n(13892),c=n(60583),u=n(50321),p=n(65609),m=n(79710),h=n(81965),x=n(59654),f=n(817),v=n.n(f),g=n(20671),b=n.n(g),y=n(595),A=n(76306),j=n(11458),L=n(12692),C=n(64691),w=n(31256),k=n(78928),_=n(89040),N=n(68734),T=n(96798);function S(){let e=(0,l._)(["\n .head {\n padding: 12px 14px 6px 14px;\n }\n .row {\n padding: 0 14px;\n }\n "]);return S=function(){return e},e}function E(){let e=(0,l._)(["\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n font-size: 12px;\n overflow: hidden;\n .os-host {\n flex: 1;\n }\n .head {\n display: flex;\n align-items: center;\n color: ",";\n font-size: 12px;\n line-height: 14px;\n padding: 12px 16px 6px 16px;\n li {\n ","\n }\n .price {\n flex: none;\n width: fit-content;\n margin-right: 4px;\n max-width: 80px;\n }\n .amount {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 2px;\n flex: 125;\n .text {\n ","\n flex: 1;\n min-width: 10px;\n line-height: 14px;\n }\n .icon,\n .filtered_icon {\n font-size: 14px;\n color: ",";\n cursor: pointer;\n position: relative;\n box-sizing: content-box;\n padding-right: 12px;\n margin-right: -12px;\n }\n .filtered_icon {\n display: flex;\n width: 14px;\n height: 14px;\n svg {\n width: 14px;\n height: 14px;\n }\n }\n }\n .time {\n width: 30%;\n max-width: 30%;\n flex: none;\n }\n }\n .row {\n display: flex;\n align-items: center;\n color: ",";\n font-size: 12px;\n /* font-weight: 500; */\n padding: 0 16px;\n height: 20px;\n .price {\n &.buy {\n color: ",";\n }\n &.sell {\n color: ",";\n }\n }\n }\n .price {\n flex: 142;\n min-width: 10px;\n }\n .time {\n flex: 109;\n min-width: 10px;\n text-align: right;\n }\n .amount {\n flex: 109;\n min-width: 10px;\n text-align: right;\n }\n &.on-scroll-x {\n cursor: pointer;\n .trading_last_trades {\n pointer-events: none;\n }\n .head {\n cursor: default;\n }\n }\n & .list-item {\n cursor: pointer;\n background-color: transparent;\n transition: background-color 200ms linear;\n &.active {\n background-color: ",";\n }\n &:hover {\n background-color: ",";\n }\n }
1\n .lbank-empty {\n width: 100%;\n width: calc(100% - 32px);\n }\n ","\n"]);return E=function(){return e},e}function P(){let e=(0,l._)(["\n display: flex;\n flex-direction: column;\n align-items: stretch;\n .lbank-input-number {\n min-height: 0;\n flex: none;\n }\n .mini_form_item {\n margin-bottom: 0;\n }\n .mini_form_error_msg {\n margin-top: 4px;\n margin-bottom: 0;\n }\n .footer {\n padding-top: 13px;\n display: flex;\n gap: 8px;\n .lbank-btn {\n min-width: 80px;\n }\n }\n"]);return P=function(){return e},e}let O=e=>(0,r.jsx)("span",{...e,className:"filtered_icon",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.064 4.375C13.0305 4.375 13.814 3.5915 13.814 2.625C13.814 1.6585 13.0305 0.875 12.064 0.875C11.0975 0.875 10.314 1.6585 10.314 2.625C10.314 3.5915 11.0975 4.375 12.064 4.375ZM9.48945 6.81795L12.1665 4.81014C12.1325 4.81171 12.0983 4.8125 12.064 4.8125C11.6988 4.8125 11.3545 4.72303 11.0519 4.56481L8.6481 6.36767C8.56336 6.43123 8.51348 6.53098 8.51348 6.6369V10.4808C8.51348 10.5969 8.45371 10.7047 8.35531 10.7662L6.50435 11.9231C6.2802 12.0631 5.98945 11.902 5.98945 11.6377V6.6369C5.98945 6.53098 5.93957 6.43123 5.85483 6.36767L2.75868 4.04556C2.67393 3.982 2.62406 3.88225 2.62406 3.77633V2.40291C2.62406 2.21704 2.77473 2.06637 2.9606 2.06637H9.94844C10.031 1.75284 10.1814 1.46684 10.3831 1.22502H2.11925C1.93339 1.22502 1.78271 1.37569 1.78271 1.56156V4.2266C1.78271 4.33253 1.83259 4.43228 1.91733 4.49583L5.01348 6.81795C5.09823 6.8815 5.1481 6.98125 5.1481 7.08718V13.1557C5.1481 13.42 5.43885 13.5811 5.663 13.4411L9.19666 11.2325C9.29505 11.171 9.35483 11.0632 9.35483 10.9471V7.08718C9.35483 6.98125 9.4047 6.8815 9.48945 6.81795Z",fill:"white"})})}),R=d.Ay.div(E(),u.fG,(0,u.L9)(1),(0,u.L9)(1),u.vZ,u.vZ,u.LG,u.gd,u.sR,u.sR,(0,u.FE)({mobile:(0,c.AH)(S())})),I=d.Ay.div(P()),M=b()(function(){this.classList.remove("on-scroll-x"),this.dataset.scroll=""},50),z=e=>function(t){t.preventDefault();let{scroll:n=""}=this.dataset;if(""!==n&&n!==e)return;let{parentElement:l}=this,{deltaX:r,deltaY:i}=t,{point:a=""}=i?this.dataset:{};""!==a&&(document.documentElement.scrollTop+=i),M.call(this),"x"===e&&r&&l&&(l.scrollLeft+=r,this.dataset.scroll="x",this.classList.add("on-scroll-x")),"y"===e&&i&&(this.dataset.scroll="y")},F=e=>{let{amountPrecision:t,data:n,pricePrecision:l,onItemClick:i,index:o}=e;return(0,r.jsxs)("ul",{className:"row list-item",onClick:()=>{null==i||i(n),k.A.d2463({side:n.direction===m.qq.BUY?"buy":"sell",tabName:"recent_trades",priceValue:n.price,rankIndex:o+1})},children:[(0,r.jsx)(_.A,{htmlType:"li",className:"price ".concat(n.direction===m.qq.BUY?"buy":"sell"),children:(0,r.jsx)(w.A,{children:(0,a.Qr)(l?(0,a.zJ)((0,a.Fl)(n,"price"),l):(0,a.Fl)(n,"price"))})}),(0,r.jsx)("li",{className:"amount",children:(0,s.qw)(t?(0,a.zJ)(n.volume,t,"floor",!0):n.volume)}),(0,r.jsx)("li",{className:"time",children:v()(n.tradeTime).format("HH:mm:ss")})]},n.tradeID)},D=(0,i.memo)(e=>{var t,n;let{list:l,loading:a,amountCurrency:s,amountPrecision:d,priceCurrency:c,pricePrecision:u,onItemClick:m}=e,{t:f}=(0,o.A)(),v=(0,i.useRef)(null),g=(0,i.useRef)(null),[b,w]=(0,i.useState)(""),_=!(null==l?void 0:l.length),S=(0,i.useRef)(null),[E]=N.A.useForm(),P=N.A.useValues(E).volume||"",M=(0,i.useRef)([]);(0,C.A)(()=>{M.current=[]},[b]);let D=(0,i.useMemo)(()=>b?(M.current=((null==l?void 0:l.filter(e=>(Number(e.volume)||0)>=(Number(b)||0)&&-1===M.current.findIndex(t=>t.uniqId===e.uniqId)))||[]).concat(M.current),M.current.slice(0,100)):l,[l,b]),U=()=>{var e;E.setFieldValue("volume",""),w(""),null===(e=S.current)||void 0===e||e.close()};(0,i.useEffect)(()=>{let e=v.current,t=z("x"),n=z("y");return e.addEventListener("wheel",t),e.addEventListener("wheel",n),()=>{e.removeEventListener("wheel",t),e.removeEventListener("wheel",n)}},[]),(0,i.useEffect)(()=>{U()},[s]);let B=(0,i.useMemo)(()=>(0,r.jsx)(T.A,{ref:S,placement:"bottomRight",trigger:!L.default&&"touchstart"in document.body?"click":"hover",onOpenChange:e=>{E.setFieldValue("volume",b||""),E.resetErrors(),e&&k.A.d2465()},overlay:()=>(0,r.jsxs)(I,{className:"trades_filter",children:[(0,r.jsx)(N.A,{form:E,validator:()=>{let e=E.getFieldValue("volume");return!e||0>=Number(e)?[{name:"volume",message:f("L0003972æ°éä¸è½ä¸ºç©º")}]:null},children:(0,r.jsx)(N.A.Item,{name:"volume",children:(0,r.jsx)(A.A.Number,{className:"mini_form_input",size:"middle",placeholder:f("L0015429è¾å
¥æ°éé大äº0æç
§æ ¼å¼ç¿»è¯æ"),value:P,onChange:e=>E.setFieldValue("volume",(e||"").replace(/-/,"")),controls:!1,precision:d,min:0,onBlur:()=>{E.resetErrors()}})})}),(0,r.jsxs)("div",{className:"footer",children:[(0,r.jsx)(j.A,{variant:"secondary",size:"middle",disabled:!P,onClick:U,children:f("L0000793éç½®")}),(0,r.jsx)(j.A,{variant:"primary",size:"middle",onClick:()=>{var e,t;null!==(e=E.validateFields())&&void 0!==e&&e.length||(w(P),null===(t=S.current)||void 0===t||t.close(),k.A.d2466({clickName:"
1confirm",quantity:P}))},children:f("L0000060确认")})]})]}),children:b?(0,r.jsx)(O,{}):(0,r.jsx)(y.A,{className:"icon"})}),[b,P,d,f]);return(0,r.jsxs)(R,{className:"trading_wrap_trades","data-point":_?"1":"",ref:v,children:[(0,r.jsxs)("ul",{className:"head",ref:g,children:[(0,r.jsx)("li",{className:"price",children:"".concat(f("L0000038ä»·æ ¼")," (").concat(c,")")}),(0,r.jsxs)("li",{className:"amount",children:[(0,r.jsx)("span",{className:"text",children:"".concat(f("L0000283æ°é")," (").concat(s,")")}),B]}),(0,r.jsx)("li",{className:"time",children:f("L0000282æ¶é´")})]}),a?(0,r.jsx)(p.A,{style:{height:"100%"}}):_?(0,r.jsx)(h.A,{}):(null==D?void 0:D.length)?(0,r.jsx)("div",{className:"trading_last_trades",children:(0,r.jsx)(x.A,{className:"LastTradesList",itemHeight:20,data:D,itemKey:e=>e.tradeID,fullHeight:!1,height:((null==v?void 0:null===(t=v.current)||void 0===t?void 0:t.offsetHeight)||960)-((null===(n=g.current)||void 0===n?void 0:n.offsetHeight)||36.85),children:e=>{let{item:t,index:n}=e;return(0,r.jsx)(F,{amountPrecision:d,data:t,pricePrecision:u,onItemClick:m,index:n},null==t?void 0:t.symbol)}})}):(0,r.jsx)(h.A,{desc:f("L0015430ææ æ°æ®è¯·çå¾
ææ°æ°æ®è·åæé"),style:{margin:"80px 16px"},children:(0,r.jsx)(j.A,{style:{marginTop:16},onClick:U,children:f("L0000793éç½®")})})]})})},76468:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var l=n(63159),r=n(53886),i=n(52863),a=n(78961),o=n(12605);let s=(0,i.m2)("/common/images/resources/3c695d45-62a3-4da0-b78f-bf485aaf97be.png"),d={small:{image:"h-16 w-16",textClassName:"text-[12px]"},middle:{image:"h-24 w-24",textClassName:"text-[12px]"},large:{image:"h-32 w-32",textClassName:"text-[14px]"}},c=(0,r.memo)(e=>{let{className:t,style:n,size:i="middle",description:c,retryText:u,loading:p,onRetry:m,hideRetryButton:h}=e,{t:x}=(0,a.A)(),f=(0,r.useRef)(null),{image:v,textClassName:g}=d[i],b=(0,r.useCallback)(()=>{if(!m)return;let e=Date.now();null!==f.current&&e-f.current<500||(f.current=e,m())},[m]);return(0,l.jsxs)("div",{className:["flex size-full flex-col items-center justify-center gap-6 text-center",t].filter(Boolean).join(" "),style:n,children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,l.jsx)("img",{alt:"","aria-hidden":"true",className:"select-none object-contain pointer-events-none ".concat(v),src:s}),(0,l.jsx)("div",{className:"leading-4 text-text3 ".concat(g),children:null!=c?c:x("L0003939请æ±å¤±è´¥")})]}),!h&&m?(0,l.jsx)(o.A,{height:32,minWidth:88,radius:16,loading:p,variant:"secondary",size:"middle",onClick:b,children:null!=u?u:x("L0008621ç¹å»éè¯")}):null]})})},9110:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var l=n(58474),r=n(63159),i=n(53886),a=n.n(i),o=n(13892),s=n(60583),d=n(41335),c=n(50321);function u(){let e=(0,l._)(["\n border-top: 1px solid ",";\n "]);return u=function(){return e},e}function p(){let e=(0,l._)(["\n border-bottom: 1px solid ",";\n "]);return p=function(){return e},e}function m(){let e=(0,l._)(["\n ","\n "]);return m=function(){return e},e}function h(){let e=(0,l._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: ","px;\n padding: ",";\n\n ","\n\n ","\n \n .date-picker {\n max-width: 248px;\n }\n\n .lbank-radio-group {\n height: 28px;\n .lbank-radio-tile {\n height: 100%;\n }\n }\n"]);return h=function(){return e},e}let x=o.Ay.div(h(),e=>e.$height||44,e=>e.$isMobile?"0 14px":"0 16px",e=>{if(e.$topBanner){var t;return(0,s.AH)(u(),null===(t=e.theme.palette)||void 0===t?void 0:t.bizFill.fill2)}return""},e=>{if(e.$bottomBorder){var t;return(0,s.AH)(m(),(0,c.FE)({mobile:(0,s.AH)(p(),null===(t=e.theme.palette)||void 0===t?void 0:t.bizLine.line3)}))}return""}),f=a().memo(e=>{let{children:t,topBorder:n=!1,bottomBorder:l=!0,height:i=44,className:a}=e,{sm:o}=(0,d.Px)();return(0,r.jsx)(x,{className:"order_filter_bar ".concat(a||""),$topBanner:n,$bottomBorder:l,$isMobile:o,$height:i,children:t})})},6633:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var l=n(58474),r=n(63159),i=n(53886),a=n.n(i),o=n(87192),s=n(13892),d=n(50321);function c(){let e=(0,l._)(["\n gap: 4px !important;\n"]);return c=function(){return e},e}function u(){let e=(0,l._)(["\n padding: 5px 8px;\n height: 28px;\n white-space: nowrap;\n border-radius: 4px;\n\n ",";\n text-align: center;\n\n ","\n\n &:hover {\n ",";\n }\n\n .lbank-radio {\n display: none !important;\n }\n\n &.lbank-radio-tile-checked {\n ",";\n background-color: ",";\n }\n"]);return u=function(){return e},e}let p=(0,s.Ay)(o.A.Group)(c()),m=(0,s.Ay)(o.A.Tile)(u(),d.FU,e=>e.theme.bizTypography.m12,d.Ft,d.Ft,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizFill.fill3}),h=a().memo(e=>
1{let{className:t,items:n,value:l,onChange:i}=e;return(0,r.jsx)(p,{hiddenCheckedIcon:!0,inline:!0,className:t,onChange:i,value:l,children:n.map(e=>(0,r.jsx)(a().Fragment,{children:(0,r.jsx)(m,{value:e.value,tile:(0,r.jsx)("span",{children:e.label})})},e.value))})})},44545:(e,t,n)=>{"use strict";n.d(t,{a:()=>v});var l=n(63159),r=n(53886),i=n(63681),a=n(11458),o=n(78961),s=n(7276),d=n.n(s),c=n(73255),u=n(46060),p=n(81852),m=n(77627),h=n(92077),x=n(50979);let f=d()(()=>Promise.all([n.e(2907),n.e(9910)]).then(n.bind(n,19910)),{loadableGenerated:{webpack:()=>[19910]},ssr:!1});function v(e){let{open:t,allocations:s,onClose:d,onUse:v}=e,{t:g}=(0,o.A)(),b=(0,r.useMemo)(()=>[...s].sort((e,t)=>{var n;return null!==(n=(0,x.FF)(t.percentage,e.percentage))&&void 0!==n?n:0}),[s]);return(0,r.useEffect)(()=>{Promise.all([n.e(2907),n.e(9910)]).then(n.bind(n,19910))},[]),(0,l.jsx)(i.A,{open:t,title:g("L6004781å¸ç§é
ç½®"),closable:!0,cancelText:null,okText:null,footer:v?(0,l.jsx)(a.A,{variant:"primary",size:"large",block:!0,onClick:v,children:g("L0013449使ç¨")}):null,width:480,shouldResponsive:!0,bodyOverflowAuto:!1,onCancel:d,children:(0,l.jsxs)("div",{className:"flex gap-[24px] max-h-[256px] h-[100%]",children:[(0,l.jsx)(r.Suspense,{fallback:(0,l.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,l.jsx)(u.A,{})}),children:(0,l.jsx)(f,{allocations:b})}),(0,l.jsx)("div",{className:"flex min-w-0 flex-1 flex-col gap-[8px] overflow-scroll scroll-bar",children:b.map((e,t)=>(0,l.jsxs)("div",{className:"flex items-center gap-[8px] rounded-[8px] bg-fill4 px-[8px] py-[10px]",children:[(0,l.jsx)("div",{className:"h-[16px] w-[2px] rounded-[100px]",style:{backgroundColor:p.b4[t%p.b4.length]}}),(0,l.jsx)("div",{className:"w-[22px] h-[22px] flex justify-center items-center border border-solid border-text2 rounded-[22px] overflow-hidden",children:(0,l.jsx)(c.A,{alias:e.symbol.split("_")[0],name:e.displayName,size:18})}),(0,l.jsxs)("span",{className:"min-w-0 flex items-center gap-[4px] truncate font-r14 text-text1",children:[e.displayName,e.tag?(0,l.jsx)(m.A,{tag:e.tag}):null]}),(0,l.jsx)("span",{className:"ltr shrink-0 tabular-nums font-r14 text-text1 flex-1 text-right",children:(0,h._2)(e.percentage)})]},e.symbol))})]})})}},81852:(e,t,n)=>{"use strict";n.d(t,{DP:()=>x,FF:()=>l,LV:()=>u,UQ:()=>c,US:()=>p,W7:()=>o,X7:()=>i,Zb:()=>r,_2:()=>a,b4:()=>v,d$:()=>h,gR:()=>f,gj:()=>m,p7:()=>d,vF:()=>s});let l="USDT",r=1,i=10,a="1",o="100",s="10",d="1",c={PRECIOUS_METAL:"L6660446è´µéå±",MAINSTREAM_CRYPTO:"L6660447主æµå¸",US_STOCK:"L6660445ç¾è¡"},u={US_STOCK:{color:"#0B73DB",bg:"#0E1B29"},PRECIOUS_METAL:{color:"#E7DBB6",bg:"#26241D"},MAINSTREAM_CRYPTO:{color:"#0BBA74",bg:"#0D241D"}},p=["1h","4h","8h","12h","day","week","month"],m={"1h":"L00026191å°æ¶","4h":"L00026204å°æ¶","8h":"L00026218å°æ¶","12h":"L000262212å°æ¶",day:"L6002028æ¯å¤©",week:"L6002029æ¯å¨",month:"L0016410æ¯æ"},h=40;function x(e){return e.slice(0,h)}function f(){return{source:"manual",planName:"",investmentAmount:"",autoEarnEnabled:!1,allocations:[{symbol:"BTC_USDT",displayName:"BTC",percentage:"100"}],schedule:{frequency:"day",firstExecution:"immediate",startAt:void 0}}}let v=["#5B9CF6","#66BB6A","#FFA726","#F7525F","#26C6DA","#BA68C8","#DC7A47","#00918A","#FF99C3","#7C61F2"]},77627:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var l=n(63159),r=n(53886),i=n(78961),a=n(81852);let o=(0,r.memo)(e=>{let{tag:t}=e,{t:n}=(0,i.A)(),r=a.LV[t]||{color:"#9E9E9E",bg:"#1A1A1A"};return(0,l.jsx)("span",{className:"rounded-[4px] min-w-[22px] max-w-[90px] truncate px-[4px] py-[1px] text-[11px] font-medium leading-[12px]",style:{color:r.color,backgroundColor:r.bg},children:n(a.UQ[t]||t)})})},58225:(e,t,n)=>{"use strict";function l(e){let t="object"==typeof e&&null!==e?e:void 0;return"undefined"!=typeof DOMException&&e instanceof DOMException&&"AbortError"===e.name||(null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.name)==="CanceledError"||(null==t?void 0:t.code)==="ERR_CANCELED"}function r(e){return l(e)}n.d(t,{y:()=>r,z:()=>l})},71649:(e,t,n)=>{"use strict";n.d(t,{E:()=>a,U:()=>o});var l=n(53886),r=n(34061),i=n(75773);function a(){let[e,t]=(0,l.useState)([]),{run:n,cancel:a,status:o,error:s}=(0,i.i)(async e=>{var n;let l=(null!==(n=(await r.A.postLbkTradingbotGatewaySpotApiV1ConfigDcaSymbolsList({page:1,pageSize:100},void 0,{signal:e})).resultList)&&void 0!==n?n:[]).map(e=>{var t,n,l;let r=(null!==(l=e.symbol)&&void 0!==l?l:"").toUpperCase();if(!r)throw Error("Missing Spot DCA symbol");return{symbol:r,displayName:(null===(t=e.displayName)||void 0===t?void 0:t.trim())||e.baseCoin||r.split("_")[0]||r,iconUrl:(null===(n=e.iconUrl)||void 0===n?void 0:n.trim())||void 0,quoteAssetCode:"USDT",status:"active",minInvestmentAmount:e.minInvestmentAmount,maxInvestmentAmount:e.maxAllowedPrice,investmentStep:e.investmentAmountStep,amountPrecision:e.priceScale,tag:e.tag}});return t(l),{items:l}}),d=(0,l.useCallback)(async()=>{await n().catch(()=>void 0)},[n]);return(0,l.useEffect)(()=>(n().catch(()=>void 0),a),[]),(0,l.useMemo)(()=>({items:e,loading:"loading"===o,error:"error"===o?s:void 0,refetch:d}),[s,e,d,o])}function o(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.symbol.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n)):e}},75773:(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var l=n(53886);let r={status:"loading"};function i(e){let t=(0,l.useRef)(e),n=(0,l.useRef)(),i=(0,l.useRef)(0),[a,o]=(0,l.useState)(r);t.current=e;let s=(0,l.useCallback)(()=>{var e;null===(e=n.current)||void 0===e||e.abort(),n.current=void 0},[]),d=(0,l.useCallback)(()=>{i.current+=1,s(),o(e=>({status:"idle",data:e.data}))},[s]),c=(0,l.useCallback)(async function(){for(var e,l=arguments.length,r=Array(l),a=0;a<l;a++)r[a]=arguments[a];null===(e=n.current)||void 0===e||e.abort();let s=new AbortController,d=i.current+1;n.current=s,i.current=d,o(e=>({status:"loading",data:e.data}));try{let e=await t.current(s.signal,...r);return i.current!==d||s.signal.aborted||o({status:"success",data:e}),e}catch(e){throw i.current!==d||s.signal.aborted||o(t=>({status:"error",data:t.data,error:e})),e}finally{i.current===d&&(n.current=void 0)}},[]);return(0,l.useEffect)(()=>()=>{i.current+=1,s()},[s]),{...a,run:c,cancel:d}}},54269:(e,t,n)=>{"use strict";n.d(t,{oD:()=>l.oD,S4:()=>eW,ew:()=>l.ew});var l=n(50093),r=n(63159),i=n(53886),a=n(24265),o=n(58609),s=n(78961),d=n(91985),c=n(99183),u=n(96798),p=n(17426),m=n(23985),h=n(71649),x=n(34061),f=n(75773),v=n(58225),g=n(75999);function b(e){return null!=e?e:36e5*Math.ceil((Date.now()+36e5)/36e5)}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"--";if(!e)return t;let n=new Date(e);return"".concat(n.getFullYear(),"/").concat("".concat(n.getMonth()+1).padStart(2,"0"),"/").concat("".concat(n.getDate()).padStart(2,"0")," ").concat("".concat(n.getHours()).padStart(2,"0"),":").concat("".concat(n.getMinutes()).padStart(2,"0"))}let A=(0,i.createContext)({items:[],loading:!1,refetch:async()=>void 0});function j(){return(0,i.useContext)(A)}var L=n(65609),C=n(30395),w=n.n(C),k=n(85801),_=n(76468),N=n(70662),T=n(61955),S=n(50167),E=n(81852),P=n(92077);async function O(e,t){var n;let l=await x.A.getLbkTradingbotGatewaySpotApiV1ConfigDcaAiRecsPortfolioIdDetail({portfolioId:e.id},void 0,{signal:t});return{...e,id:null!==(n=l.portfolioId)&&void 0!==n?n:e.id,title:l.name||"",allocations:l.allocations?l.allocations.map(P.KW):e.allocations}}
1var R=n(61297),I=n(34554),M=n(62141),z=n(33024),F=n(11458),D=n(73255),U=n(86334),B=n(40879),q=n(46701),H=n(98273),Z=n(89557),G=n(77627),W=n(44545);function V(e,t,n){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,r.jsx)(D.A,{alias:e.symbol.split("_")[0],name:e.displayName,size:14}),(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-[2px] font-r12 text-text2",children:[(0,r.jsx)("span",{className:"truncate",children:e.displayName}),(0,r.jsx)("span",{className:"shrink-0 ltr",children:(0,P._2)(e.percentage)})]})]},"".concat(e.symbol,"-").concat(t)),n.length-1!==t&&(0,r.jsx)("div",{className:"w-[1px] h-[8px] bg-text3 rounded-[100px]"})]})}function Q(e){var t,n;let{portfolio:l,disabled:a=!1,onUse:o}=e,{t:d}=(0,s.A)(),[c]=(0,B.Ay)(),[u,p]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),v=(0,i.useRef)(null),g=(0,i.useRef)(null),b=(0,R.default)(()=>{var e,t;let n=null===(e=v.current)||void 0===e?void 0:e.querySelector("h3");n&&h(n.scrollWidth>n.clientWidth);let l=null===(t=g.current)||void 0===t?void 0:t.querySelector("p");l&&f(l.scrollWidth>l.clientWidth)});(0,I.p)(()=>{b()},v),(0,I.p)(()=>{b()},g);let y=(t=l.annualizedReturn)?t.startsWith("-")?"down":"0"===t?"neutral":"up":"neutral",A=l.allocations.slice(0,3),j=Math.max(l.allocations.length-3,0),L=l.tags;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("article",{className:"w-full rounded-[16px] border-[1px] border-solid border-line2 bg-bg1 px-[12px] py-[12px]",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-[12px]",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{ref:v,children:(0,r.jsx)(q.A,{title:m?l.title:void 0,children:(0,r.jsx)("h3",{className:"truncate text-text1 text-[16px] font-medium leading-[18px]",children:l.title})})}),(0,r.jsxs)("div",{className:"mt-[4px] flex flex-wrap items-center gap-[4px]",children:[(n=l.usageCount,(0,r.jsxs)("span",{className:"inline-flex h-[16px] items-center gap-[2px] rounded-[4px] bg-fill3 px-[4px] text-text2 text-[11px] leading-[12px]",children:[(0,r.jsx)(M.A,{className:"h-[12px] w-[12px] text-text2"}),(0,r.jsx)("span",{className:"tabular-nums",children:n})]})),null==L?void 0:L.map(e=>(0,r.jsx)(G.A,{tag:e},e))]})]}),(0,r.jsx)(F.A,{variant:"primary",size:"middle",disabled:a,className:"!h-[32px] !shrink-0 !rounded-[16px] !px-[16px]",onClick:()=>o(l),children:d("L0013449使ç¨")})]}),(0,r.jsxs)("div",{className:"mt-[12px] flex items-end justify-between gap-[12px]",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-text2 font-r12",children:d("L6668647念年å")}),(0,r.jsx)("div",{className:"mt-[2px] tabular-nums text-[18px] font-medium leading-[20px]",style:{color:"up"===y?c.upColor:"down"===y?c.downColor:void 0},children:(0,Z.Y0)(l.annualizedReturn||"--",2)})]}),(0,r.jsx)(U.E,{values:l.trend,width:78,height:36,ariaLabel:l.title,className:"shrink-0"})]}),(0,r.jsxs)("div",{className:"mt-[12px] flex flex-wrap items-center gap-[8px]",children:[A.map(V),j>0?(0,r.jsxs)("div",{className:"cursor-pointer flex h-[16px] shrink-0 items-center gap-[2px] rounded-[4px] bg-fill3 px-[4px] py-[1px] text-text2 font-r12",onClick:()=>{(0,k.rB)({requirement_id:1004,track_sign:"aFinance.b4071.d4097.click.Click",clickName:l.title,pageName:"spot_trade",recommendedDcaPortfolioFe:l.id}),p(!0)},children:["+",j," ",(0,r.jsx)(H.A,{children:(0,r.jsx)(z.A,{})})]}):null]}),(0,r.jsx)("div",{ref:g,className:"mt-[12px]",children:(0,r.jsx)(q.A,{title:x?l.description:void 0,children:(0,r.jsx)("p",{className:"truncate text-text2 font-r12",children:l.description})})})]}),(0,r.jsx)(W.a,{open:u,allocations:l.allocations,onClose:()=>p(!1),onUse:()=>{o(l),p(!1)}})]})}function Y(e){let{items:t,loading:n,error:i,refetch:o}=e,d=(0,N.A)(e=>e.layoutType),{t:c}=(0,s.A)(),{applyPortfolio:u,resetDraft:p,setCreateMode:m,updateDraft:h}=(0,l.xA)((0,a.k)(e=>({applyPortfolio:e.applyPortfolio,resetDraft:e.resetDraft,setCreateMode:e.setCreateMode,updateDraft:e.updateDraft}))),x=async e=>{(0,k.rB)({requirement_id:1004,track_sign:"aFinance.b4071.d4086.click.Click",clickName:"use",pageName:"spot_trade",recommendedDcaPortfolioFe:e.id});try{let t=await O(e);p(),u(t),h({planName:(0,E.DP)(t.title)}),m("manual")}catch(e){}};return n&&0===t.length?(0,r.jsx)("div",{className:"flex min-h-[320px] items-center justify-center rounded-[16px] bg-bg2",children:(0,r.jsx)(L.A,{})}):!n&&i&&0===t.length?(0,r.jsx)("div",{className:"flex min-h-[320px] items-center justify-center rounded-[16px] bg-bg2 px-[24px]",children:(0,r.jsx)(_.A,{description:c("L0014783å 载失败"),retryText:c("L0003387éè¯"),onRetry:()=>o()})}):n||0!==t.length?(0,r.jsx)("div",{className:w()("flex-1 overflow-y-auto",d===T.me.Standard&&t.length>0?"grid grid-cols-[repeat(auto-fit,minmax(240px,1fr))] gap-[16px]":"flex flex-col gap-[12px]"),children:t.map(e=>(0,r.jsx)(Q,{portfolio:e,onUse:()=>x(e)},e.id))}):(0,r.jsx)("div",{className:"rounded-[16px] bg-bg2 px-[16px] py-[32px]",children:(0,r.jsx)(S.A,{desc:c("L0001440ææ æ°æ®"),iconType:S.T.Pa
1perPlane})})}var K=n(34926),$=n(3007),X=n(58705),J=n(49457),ee=n(63618),et=n(77663),en=n(1165),el=n(76306),er=n(63681),ei=n(22793),ea=n(10943);function eo(e){let{selectedSymbols:t,open:n,onSelect:l,onClose:a}=e,{t:o}=(0,s.A)(),[d,c]=(0,i.useState)(""),{items:u,loading:p,error:m,refetch:x}=j(),[f,v]=(0,i.useState)(t),g=(0,ea.al)();(0,i.useEffect)(()=>{v(t)},[t]);let b=(0,i.useMemo)(()=>(0,h.U)(u,d),[u,d]),y=(0,i.useMemo)(()=>new Set(f),[f]),A=(0,i.useMemo)(()=>f.map(e=>u.find(t=>t.symbol===e)).filter(Boolean),[u,f]),C=e=>{v(t=>t.includes(e.symbol)?t.filter(t=>t!==e.symbol):t.length>=10?($.A.error(o("L6668634æå¤éæ©10个å¸ç§")),t):[...t,e.symbol])};return(0,r.jsxs)(er.A,{open:n,closable:!0,shouldResponsive:!0,responsiveFullHeight:!0,title:o("L6004417æ·»å å¸ç§"),footer:(0,r.jsxs)("div",{className:"flex items-center justify-end gap-[16px] sm:w-full",children:[(0,r.jsx)(F.A,{type:g?void 0:"ghost",size:"middle",height:40,onClick:()=>{v([])},className:"sm:flex-1",children:o("L0000793éç½®")}),(0,r.jsxs)(F.A,{variant:"primary",size:"middle",height:40,className:"sm:flex-1",disabled:0===f.length,onClick:()=>{l(A),a()},children:[o("L0000564ç¡®å®"),"(",f.length,")"]})]}),width:480,bodyOverflowAuto:!1,bodyStyle:{minHeight:0,display:"flex",flexDirection:"column"},destroyOnClose:!0,onCancel:a,children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(el.A,{addonBefore:(0,r.jsx)(ei.A,{}),value:d,size:"middle",round:!0,variant:"filled",className:"pl-[36px]",placeholder:o("L0000903æç´¢"),onChange:e=>c(e||"")})}),(0,r.jsx)("div",{className:"mt-[12px] flex max-h-[314px] flex-1 flex-col gap-[8px] overflow-y-auto scroll-bar mx-[-14px] px-[14px]",children:p?(0,r.jsx)("div",{className:"flex min-h-[80px] items-center justify-center",children:(0,r.jsx)(L.A,{})}):m&&0===b.length?(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center py-[24px]",children:(0,r.jsx)(_.A,{size:"small",description:o("L0014783å 载失败"),retryText:o("L0003387éè¯"),onRetry:()=>x()})}):0===b.length?(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center py-[24px]",children:(0,r.jsx)(S.A,{desc:o("L0001440ææ æ°æ®"),iconType:S.T.PaperPlane})}):b.map(e=>{let t=y.has(e.symbol);return(0,r.jsxs)("div",{className:"flex cursor-pointer items-center justify-between px-[12px] py-[10px] text-left",onClick:()=>C(e),children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-[12px]",children:[(0,r.jsx)(D.A,{alias:e.symbol.split("_")[0],name:e.displayName,size:24,enableLazy:!1}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsx)("div",{className:"truncate text-text1 text-[16px] font-medium leading-[18px]",children:e.displayName})})]}),(0,r.jsx)("div",{className:"flex h-[20px] w-[20px] items-center justify-center",children:(0,r.jsx)(en.A,{checked:t,onChange:()=>C(e)})})]},e.symbol)})}),(0,r.jsxs)("div",{className:"mt-[12px] flex flex-col gap-[8px]",children:[(0,r.jsxs)("div",{className:"text-text2 font-r12",children:[o("L6668696æ¨æå¤å¯ä»¥éæ©")," ",(0,r.jsx)("span",{className:"font-medium text-text1",children:f.length}),"/"," ",o("L66686950个å¸ç§",{0:10})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-[8px]",children:A.map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-[6px] rounded-[4px] bg-fill3 px-[10px] py-[4px] text-text1 font-r14",children:[e.displayName,(0,r.jsx)("div",{className:"cursor-pointer flex h-[14px] w-[14px] items-center justify-center text-text2",onClick:t=>{t.stopPropagation(),C(e)},children:(0,r.jsx)(J.A,{})})]},e.symbol))})]})]})}function es(){let{t:e}=(0,s.A)(),{allocations:t,replaceAllocations:n,updateDraft:o,planNameManuallyEdited:d,allocationsManuallyEdited:c,markAllocationsManuallyEdited:u}=(0,l.xA)((0,a.k)(e=>({allocations:e.draft.allocations,replaceAllocations:e.replaceAllocations,updateDraft:e.updateDraft,allocationsManuallyEdited:e.allocationsManuallyEdited,markAllocationsManuallyEdited:e.markAllocationsManuallyEdited,planNameManuallyEdited:e.planNameManuallyEdited}))),[m,h]=(0,i.useState)(!1),x=(0,P.ru)(t.map(e=>e.percentage||"0"))||"0",f=t.reduce((e,t)=>e+Number(t.percentage||0),0),v=t.length>0&&100!==f,g=(e,l)=>{u(),n(t.map((t,n)=>n===e?{...t,...l}:t))},b=(0,ee.default)(()=>{h(!0)});(0,i.useEffect)(()=>{!d&&t.length>0&&o({planName:(0,E.DP)((0,P.HB)(t,e("L6668785宿ç»å")))})},[t,d,o,e]);let y=l=>{if(t.length<=E.Zb){$.A.error(e("L6668622è³å°ä¿çä¸ä¸ªå¸ç§"));return}let r=t.filter((e,t)=>
1t!==l),i=r;if(!c){let e=(0,P.FZ)(r.length);i=r.map((t,n)=>({...t,percentage:e[n]||t.percentage}))}n(i)};return(0,r.jsxs)("section",{className:"w-full",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-[12px]",children:[(0,r.jsx)("span",{className:"text-text1 font-r12",children:e("L6004781å¸ç§é
ç½®")}),(0,r.jsx)(F.A,{type:"link",size:"small",prefixIcon:(0,r.jsx)(X.A,{}),className:"!text-text2 font-r12",onClick:b,children:(0,r.jsx)("span",{children:e("L6004417æ·»å å¸ç§")})})]}),(0,r.jsx)("div",{className:"mt-[4px] flex flex-col gap-[8px]",children:t.map((n,l)=>(0,r.jsxs)("div",{className:"flex h-[40px] items-center gap-[8px] border border-solid border-line1 rounded-[4px] bg-bg1 px-[8px]",children:[(0,r.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-[8px] cursor-pointer ",children:[(0,r.jsx)(D.A,{alias:n.symbol.split("_")[0],name:n.displayName,size:22}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-[4px] text-left",onClick:b,children:[(0,r.jsx)("span",{className:"truncate text-text1 font-r14 min-w-[22px]",children:n.displayName||e("L6004417æ·»å å¸ç§")}),n.tag?(0,r.jsx)(G.A,{tag:n.tag}):null,(0,r.jsx)("span",{className:"text-text3 w-[16px] h-[16px] [&_svg]:w-[16px] [&_svg]:h-[16px]",children:(0,r.jsx)(p.A,{})})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-[4px]",children:[(0,r.jsx)(et.A,{value:n.percentage,size:"middle",controls:!1,className:"!w-[48px] !border-none !p-0 [&_input]:!text-right [[data-dir='rtl']_&_input]:!text-left",onChange:e=>g(l,{percentage:function(e){if(!e)return"";let t=e.replace(/[^0-9]/g,"");if(""===t)return"";let n=parseInt(t,10);return n<1?"":n>100?"100":String(n)}("".concat(e))})}),(0,r.jsx)("span",{className:"text-text1 font-r14",children:"%"})]}),(0,r.jsx)("div",{className:"w-[1px] h-[16px] bg-text4 rounded-[100px]"}),(0,r.jsx)("div",{className:"cursor-pointer w-[20px] h-[20px] [&_svg]:w-[20px] [&_svg]:h-[20px] ".concat(1===t.length?"!text-text4 !cursor-not-allowed":"!text-text3"),onClick:()=>1===t.length?()=>{}:y(l),children:(0,r.jsx)(J.A,{})})]},"".concat(n.symbol,"-").concat(l)))}),(0,r.jsx)("div",{className:["mt-[8px] font-r12",v?"text-danger":"hidden"].join(" "),children:e("L6668623è¯·ä¿ææèµæ¯ä¾ç¸å 为100")}),(0,r.jsxs)("div",{className:"mt-[8px] flex items-center justify-between gap-[12px] font-r12",children:[(0,r.jsxs)("span",{className:"text-text2",children:[e("L6668629å©ä½æå
¥æ¯ä¾")," ",(0,r.jsx)("span",{className:"ltr ml-[4px] ".concat(v?"text-danger":"text-text1"),children:(0,P._2)(x)})]}),(0,r.jsx)(F.A,{type:"link",size:"small",className:"!text-text6 font-r12",onClick:()=>{let e=(0,P.FZ)(t.length);n(t.map((t,n)=>({...t,percentage:e[n]||t.percentage})))},children:e("L6003675å¹³ååé
")})]}),(0,r.jsx)(eo,{open:m,selectedSymbols:t.map(e=>e.symbol),onSelect:e=>{if(0===e.length)return;if(!c){let t=(0,P.FZ)(e.length);n(e.map((e,n)=>({symbol:e.symbol,displayName:e.displayName,iconUrl:e.iconUrl,tag:e.tag,percentage:t[n]||""})));return}let l=new Map(t.map(e=>[e.symbol,e.percentage])),r=e.map(e=>({symbol:e.symbol,displayName:e.displayName,iconUrl:e.iconUrl,tag:e.tag,percentage:l.get(e.symbol)||""})),i=Math.max(0,100-r.filter(e=>l.has(e.symbol)).reduce((e,t)=>e+Number(t.percentage||0),0)),a=r.filter(e=>!l.has(e.symbol)).length;if(a>0){let e=Math.max(1,Math.floor(i/a)),t=i-e*a,n=0;for(let i=0;i<r.length;i+=1)l.has(r[i].symbol)||(r[i]={...r[i],percentage:String(e+(n<t?1:0))},n+=1)}n(r)},onClose:()=>h(!1)})]})}function ed(){let{t:e}=(0,s.A)(),{schedule:t,updateDraft:n}=(0,l.xA)((0,a.k)(e=>({schedule:e.draft.schedule,updateDraft:e.updateDraft})));return(0,r.jsxs)("section",{className:"w-full",children:[(0,r.jsx)("div",{className:"text-text1 font-r12",children:e("L6668675宿é¢ç")}),(0,r.jsx)("div",{className:"mt-[4px] grid grid-cols-4 gap-[8px]",children:E.US.map(l=>{let i=t.frequency===l;return(0,r.jsx)("div",{className:["cursor-pointer flex justify-center items-center px-[2px] py-[2px] !h-[32px] text-center !bg-transparent hover:!bg-none text-text1 border border-solid !rounded-[4px] font-r14",i?"!border-text1":"!border-line2"].join(" "),onClick:()=>n({schedule:{...t,frequency:l}}),children:(0,r.jsx)("span",{className:"line-clamp-2 break-words",children:e(E.gj[l])})},l)})})]})}var ec=n(17588);function eu(e,t){let n=new Date,l=new Date(n),r=l.getDay(),i=Number(e)-r;return i<0&&(i+=7),l.setDate(l.getDate()+i),l.setHours(Number(t),0,0,0),l.getTime()<=n.getTime()&&l.setDate(l.getDate()+7),l.getTime()}function ep(e,t){let n=new Date,l=Number(e),r=new Date(n.getFullYear(),n.getMonth(),l,Number(t),0,0,0);return r.getTime()<=n.getTime()&&r.setMonth(r.getMonth()+1),r.getTime()}let em=()=>{let{t:e}=(0,s.A)(),{schedule:t,updateDraft:n}
1=(0,l.xA)((0,a.k)(e=>({schedule:e.draft.schedule,updateDraft:e.updateDraft}))),[o,d]=(0,i.useState)("1"),[c,u]=(0,i.useState)("1"),[p,m]=(0,i.useState)("09"),h=(0,i.useMemo)(()=>[{value:"immediate",label:e("L0004038ç«å³ä¹°å
¥")},{value:"custom",label:e("L6668639èªå®ä¹æ¶é´")}],[e]),x=(0,i.useMemo)(()=>[{value:"1",label:e("L0004111å¨ä¸")},{value:"2",label:e("L0004112å¨äº")},{value:"3",label:e("L0004113å¨ä¸")},{value:"4",label:e("L0004114å¨å")},{value:"5",label:e("L0004115å¨äº")},{value:"6",label:e("L0004116å¨å
")},{value:"0",label:e("L0004117卿¥")}],[e]),f=(0,i.useMemo)(()=>Array.from({length:28},(t,n)=>({value:String(n+1),label:e("L0019927æ¥",{0:n+1})})),[e]),v=(0,i.useMemo)(()=>Array.from({length:24},(e,t)=>{let n="".concat(t).padStart(2,"0");return{value:n,label:"".concat(n,":00")}}),[]);(0,i.useEffect)(()=>{if(t.startAt){let e=new Date(t.startAt);d(String(e.getDay())),u(String(e.getDate())),m("".concat(e.getHours()).padStart(2,"0"))}},[t.startAt]);let g="day"===t.frequency,b="week"===t.frequency,y="month"===t.frequency,A=["1h","4h","8h","12h"].includes(t.frequency);return(0,r.jsx)("section",{className:"w-full",children:(0,r.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[(0,r.jsx)(K.A.Item,{name:"firstBuyType",label:(0,r.jsx)("span",{className:"text-text1 font-r12",children:e("L6668644馿¬¡ä¹°å
¥æ¶é´")}),children:(0,r.jsx)(ec.A,{size:"large",options:h,value:t.firstExecution,onChange:e=>{if("custom"===e){let e=function(){let e=new Date;return e.setHours(e.getHours()+1,0,0,0),{weekDay:String(e.getDay()),monthDay:String(e.getDate()),hour:"".concat(e.getHours()).padStart(2,"0"),timestamp:e.getTime()}}();d(e.weekDay),u(e.monthDay),m(e.hour),n({schedule:{...t,firstExecution:"custom",startAt:e.timestamp,timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}});return}n({schedule:{...t,firstExecution:e,startAt:"immediate"===e?void 0:t.startAt,timeZoneOffsetMinutes:"immediate"===e?void 0:t.t
1imeZoneOffsetMinutes}})}})}),"custom"===t.firstExecution?(0,r.jsxs)(r.Fragment,{children:[A||g?(0,r.jsx)(ec.A,{size:"large",options:v,value:p,onChange:e=>{m(e),n({schedule:{...t,firstExecution:"custom",startAt:function(e){let t=new Date,n=new Date(t);return n.setHours(Number(e),0,0,0),n.getTime()<=t.getTime()&&n.setDate(n.getDate()+1),n.getTime()}(e),timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}})}}):null,b?(0,r.jsxs)("div",{className:"flex gap-[8px]",children:[(0,r.jsx)("div",{className:"w-[120px]",children:(0,r.jsx)(ec.A,{size:"large",options:x,value:o,onChange:e=>{d(e),n({schedule:{...t,firstExecution:"custom",startAt:eu(e,p),timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}})}})}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(ec.A,{size:"large",options:v,value:p,onChange:e=>{m(e),n({schedule:{...t,firstExecution:"custom",startAt:eu(o,e),timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}})}})})]}):null,y?(0,r.jsxs)("div",{className:"flex gap-[8px]",children:[(0,r.jsx)("div",{className:"w-[120px]",children:(0,r.jsx)(ec.A,{size:"large",options:f,value:c,onChange:e=>{u(e),n({schedule:{...t,firstExecution:"custom",startAt:ep(e,p),timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}})}})}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(ec.A,{size:"large",options:v,value:p,onChange:e=>{m(e),n({schedule:{...t,firstExecution:"custom",startAt:ep(c,e),timeZoneOffsetMinutes:-new Date().getTimezoneOffset()}})}})})]}):null]}):null]})})};var eh=n(42185),ex=n(78354),ef=n(76124),ev=n(80250);let eg=e=>{let{form:t}=e,{t:n}=(0,s.A)(),{draft:o,updateDraft:d,usableAssets:c,assetCode:u,usableAssetsName:p}=(0,l.xA)((0,a.k)(e=>({draft:e.draft,updateDraft:e.updateDraft,usableAssets:e.usableAssets,assetCode:e.assetCode,usableAssetsName:e.usableAssetsName}))),{items:m}=j(),h=(0,i.useMemo)(()=>Number(c)||0,[c]),x=(0,i.useMemo)(()=>h>0?Math.round((Number(o.investmentAmount)||0)/(h/100)):0,[h,o.investmentAmount]),f=(0,ee.default)(e=>{let{code:t,meta:l}=e,r=(null==l?void 0:l.assetCode)||u||"USDT";switch(t){case"AMOUNT_INVALID":return n("L6668624请è¾å
¥æ¯æ¬¡æèµé¢");case"AMOUNT_BELOW_MIN":return n("L6668621æ¯æ¬¡æèµé¢é01",{0:(null==l?void 0:l.min)||E.vF,1:r});case"AMOUNT_PER_ASSET_BELOW_MIN":return n("L66686170ä¸åéé¢12æ æ³ä¸å",{0:(null==l?void 0:l.displayName)||"",1:null==l?void 0:l.min,2:r});default:return""}});return(0,r.jsxs)("div",{className:"flex flex-col gap-[8px] [&_.lbank-form-error-msg]:!mb-0 [&_.lbank-form-error-msg]:!mt-[8px]",children:[(0,r.jsx)("div",{children:(0,r.jsx)(K.A.Item,{name:"investmentAmount",controlled:!0,rules:[{required:!0,message:n("L6668624请è¾å
¥æ¯æ¬¡æèµé¢")},{validator:async e=>{let t=(0,ev._v)({...o,investmentAmount:e},u,m);return t?Promise.reject(Error(n(f(t)))):Promise.resolve()}}],label:(0,r.jsx)("span",{className:"text-text1 font-r12",children:n("L6668637æ¯æ¬¡æèµé¢")}),children:(0,r.jsx)(ef.A,{placeholder:"â¥".concat((0,ev.xs)(o.allocations,m)),unit:u.toLocaleUpperCase(),controls:!1,precision:2,min:1,onChange:e=>{d({investmentAmount:e}),t.setFieldValue("investmentAmount",e),t.validField("investmentAmount")}})})}),(0,r.jsx)(eh.A,{value:x,progress:!0,graduated:!0,shape:"diamond",max:100,min:0,onChange:e=>{let n=(0,Z.gO)(h*e/100,2);d({investmentAmount:"0"===n?"":n}),t.setFieldValue("investmentAmount",n)}}),(0,r.jsx)(ex.A,{usableAssets:"".concat((0,Z.LN)(null!=c?c:"--")," ").concat(null==p?void 0:p.toLocaleUpperCase()),assetCode:u})]})};var eb=n(36202),ey=n(32526),eA=n(63240),ej=n(57542),eL=n(8111),eC=n(49659);function ew(e){var t;let{apr:n,upColor:l,downColor:i}=e,a=Number(null!==(t=null==n?void 0:n.replace("%",""))&&void 0!==t?t:"0"),o=Number.isFinite(a)&&a>0,s=Number.isFinite(a)&&a<0,d=Number.isFinite(a)&&0!==a;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-[2px] rounded-[4px] px-[4px] py-[1px] h-[16px] text-[11px] font-[400] leading-[14px]",style:{color:o?l:s?i:"#fff"},children:[(0,r.jsx)("span",{children:"APY"}),d?(0,r.jsx)("span",{className:"flex items-center",children:(0,r.jsx)(eC.A,{style:{transform:o?"rotate(180deg)":"none",width:12,height:12}})}):null,(0,r.jsxs)("span",{className:"ltr",children:[n||"--","%"]})]})}function ek(){let{t:e}=(0,s.A)(),[t]=(0,i.useState)(!0),[n,o]=(0,i.useState)(!1),{planName:d,allocations:c,autoEarnEnabled:u,updateDraft:p,markPlanNameManuallyEdited:m}
1=(0,l.xA)((0,a.k)(e=>({planName:e.draft.planName,allocations:e.draft.allocations,autoEarnEnabled:e.draft.autoEarnEnabled,updateDraft:e.updateDraft,markPlanNameManuallyEdited:e.markPlanNameManuallyEdited}))),[h,x]=(0,i.useState)(""),{loading:f,enabled:v}=function(){let[e,t]=(0,i.useState)({loading:!0,enabled:!1});return(0,i.useEffect)(()=>{let e=!0;return eA.Ay.financeEarnCenterAutoStackingEnabledAutoStacking({}).then(n=>{e&&t({loading:!1,enabled:!!n.enabledAutoStacking})}).catch(n=>{e&&t({loading:!1,enabled:!1,error:n})}),()=>{e=!1}},[]),e}(),{navigateToLoginOrElseFn:g}=(0,ej.A)(),[{upColor:b,downColor:y}]=(0,B.Ay)(),A=function(e){let[t,n]=(0,i.useState)(),l=(0,i.useRef)(0),r=(0,i.useCallback)(async()=>{let t=Date.now();if(!(t-l.current<300)){l.current=t;try{var r;let t=[...new Set(e.map(e=>e.symbol.split("_")[0]).filter(Boolean))].join(",")||"";if(!t){n(void 0);return}let l=await eA.Ay.financeEarnCenterFinanceDrainageSpotEarn({assetCodeList:t.toLocaleLowerCase()}),i=(null!==(r=null==l?void 0:l.spotEarnDTOList)&&void 0!==r?r:[]).map(e=>{var t;return Number((null!==(t=e.apr)&&void 0!==t?t:"").replace("%",""))}).filter(e=>!Number.isNaN(e));if(0===i.length){n(void 0);return}n(String(Math.max(...i)))}catch(e){}}},[e]);return(0,i.useEffect)(()=>{r()},[r]),t}(c),j=(0,i.useMemo)(()=>{let t=d||(0,P.HB)(c,e("L6668785宿ç»å"));return(0,E.DP)(t)},[d,c,e]);(0,i.useEffect)(()=>{p({autoEarnEnabled:v})},[v]);let L=(0,ee.default)(async t=>{g(async()=>{try{p({autoEarnEnabled:t}),await eA.Ay.financeEarnCenterAutoStackingOperatorAutoStacking({enable:t}),p({autoEarnEnabled:t})}catch(l){var n;p({autoEarnEnabled:!t}),$.A.error(l instanceof Error?l.message:(n=e("L0021845å 载失败ï¼è¯·éè¯"),l instanceof Error?l.message:n))}})}),C=(0,ee.default)(()=>{x(j||""),o(!0)}),w=(0,ee.default)(()=>{o(!1)}),k=(0,ee.default)(()=>{p({planName:h.trim()}),m(),o(!1)});return(0,r.jsxs)("section",{className:"w-full",children:[t?(0,r.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-[12px]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[4px] min-w-0",children:[(0,r.jsx)("span",{className:"text-text3 font-r12",children:(0,r.jsx)(eL.A,{title:e("L6668633å¼å¯èªå¨èµå¸æ¯æå®æå¸ç§é»è®¤å"),placement:"topLeft",children:e("L0021120èªå¨èµå¸")})}),A?(0,r.jsx)(ew,{apr:A,upColor:b,downColor:y}):null]}),(0,r.jsx)(ey.A,{size:"small",checked:u,disabled:f,onChange:L})]}),(0,r.jsxs)("div",{className:"text-text1 flex justify-between items-start gap-[8px]",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0 text-text3 font-r12",children:e("L6669013å®æè®¡ååç§°")}),(0,r.jsxs)("div",{className:"cursor-pointer flex-1 text-text1 flex items-center gap-[2px] min-w-0 justify-end",onClick:C,children:[(0,r.jsx)("div",{className:"text-text1 font-r12 truncate",children:j}),(0,r.jsx)("div",{className:"text-text3 flex items-center w-[14px] h-[14px] [&_svg]:w-[14px] [&_svg]:h-[14px]",children:(0,r.jsx)(X.A,{})})]})]})]}):null,(0,r.jsxs)(er.A,{open:n,shouldResponsive:!0,title:e("L6669013å®æè®¡ååç§°"),cancelText:e("L0000195åæ¶"),okText:e("L0000060确认"),okButtonProps:{disabled:!h.trim()},destroyOnClose:!0,onOk:k,onCancel:w,children:[(0,r.jsx)(eb.A,{value:h,maxLength:E.d$,placeholder:e("L6668643请è¾å
¥å®æè®¡ååç§°"),onChange:e=>x(e||"")}),(0,r.jsx)("div",{className:"mt-[8px] flex justify-end text-text3 font-r12",children:"".concat(h.length,"/").concat(E.d$)})]})]})}var e_=n(3935),eN=n(31412),eT=n(72395),eS=n(12605),eE=n(86167),eP=n(20671),eO=n.n(eP),eR=n(50979),eI=n(13069),eM=n(44861);function ez(e){let{firstExecutionAt:t,firstExecution:n}=e,{t:l}=(0,s.A)(),i="immediate"===n?l("L0004038ç«å³ä¹°å
¥"):y(t);return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-[8px]",children:[(0,r.jsxs)("div",{className:"w-[120px] h-[120px] mx-auto mb-[16px]",children:[(0,r.jsx)(eI.default,{src:(0,eM.m2)("/common/images/resources/b2b87905-a911-4e44-8e68-b7f400884c7c.png"),width:120,height:120,alt:"success-icon"})," "]}),(0,r.jsx)("div",{className:"text-text1 font-m24",children:l("L0000962å建æå")}),(0,r.jsxs)("div",{className:"text-text3 font-r14 leading-[20px] text-center",children:[l("L6668646馿¬¡å®ææ¶é´"),": ",i]}),(0,r.jsx)("div",{className:"text-text3 font-r12 leading-[14px] text-center",children:l("L6668642请确ä¿å®ææé´æ¨çå¯ç¨ä½é¢å
è¶³")})]})}var eF=n(49730),eD=n(22905);function eU(e){let{open:t,draft:n,onClose:l,onConfirm:a}=e,{t:o}=(0,s.A)(),d=(0,ea.al)(),c=(0,i.useMemo)(()=>n.planName||(0,P.HB)(n.allocations,o("L6668785宿ç»å")),[n.planName,n.allocations,o]),u=(0,i.useMemo)(()=>o(E.gj[n.schedule.frequency])||n.schedule.frequency,[n.schedule.frequency,o]),p=(0,i.useMemo)(()=>"immediate"===n.schedule.firstExecution?o("L0004038ç«å³ä¹°å
¥"):n.schedule.startAt?y(n.schedule.startAt):"--",[n.schedule.firstExecution,n.schedule.startAt,o]);return(0,r.jsxs)(er.A,{open:t,title:o("L0021839å建确认"),cancelButtonProps:{style:{display:d?"none":"block"}}
1,okText:o("L0017984确认å建"),cancelText:o("L0000195åæ¶"),width:680,closable:!0,shouldResponsive:!0,destroyOnClose:!0,bodyOverflowAuto:!1,className:"sm:[&_.lbank-modal-body]:!min-h-0 sm:[&_.lbank-modal-body]:!flex sm:[&_.lbank-modal-body]:!flex-col ",onOk:a,onCancel:l,children:[(0,r.jsx)("div",{className:"flex items-center text-text1 font-m16",children:(0,r.jsx)("span",{className:"truncate",children:c})}),(0,r.jsxs)("div",{className:"p-[14px] mt-[20px] border border-solid border-line2 rounded-[8px]",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-[8px]",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-[4px]",children:[(0,r.jsx)("span",{className:"text-text3 font-r12",children:o("L6668637æ¯æ¬¡æèµé¢")}),(0,r.jsxs)("span",{className:"ltr text-text1 font-r12 text-left [[data-dir='rtl']_&]:!text-right",children:[n.investmentAmount||"--"," USDT"]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-[4px]",children:[(0,r.jsx)("span",{className:"text-text3 font-r12",children:o("L6668675宿é¢ç")}),(0,r.jsx)("span",{className:"text-text1 font-r12",children:u})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-[4px]",children:[(0,r.jsx)("span",{className:"text-text3 font-r12",children:o("L6668669䏿¬¡ä¹°å
¥æ¶é´")}),(0,r.jsx)("span",{className:"text-text1 font-r12",children:p})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-[4px]",children:[(0,r.jsx)("span",{className:"text-text3 font-r12",children:o("L0021120èªå¨èµå¸")}),(0,r.jsxs)("span",{className:"text-text1 font-r12 flex items-center gap-[4px]",children:[(0,r.jsx)("span",{className:"w-[14px] h-[14px] [&_svg]:h-[14px] [&_svg]:w-[14px]",children:n.autoEarnEnabled?(0,r.jsx)(eF.A,{className:"text-success"}):(0,r.jsx)(eD.A,{className:"text-danger"})}),(0,r.jsx)("span",{children:n.autoEarnEnabled?o("L6002359å¼å¯ç¿»è¯æEnable"):o("L0000831å
³é")})]})]})]}),(0,r.jsx)("div",{className:"mt-[14px] h-[0.5px] w-full bg-line2"}),(0,r.jsxs)("div",{className:"mt-[14px] sm:min-h-0 sm:flex-1 sm:flex sm:flex-col",children:[(0,r.jsx)("div",{className:"text-text3 font-r12",children:o("L6004781å¸ç§é
ç½®")}),(0,r.jsx)("div",{className:"mt-[8px] grid grid-cols-2 gap-[8px] sm:grid-cols-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto scroll-bar",children:n.allocations.map(e=>(0,r.jsxs)("div",{className:"min-w-0 flex items-center gap-[8px] rounded-[8px] bg-fill4 px-[8px] py-[10px]",children:[(0,r.jsx)(D.A,{alias:e.symbol.split("_")[0],name:e.displayName,size:22}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 flex items-center gap-[4px] font-r14 text-text1",children:[(0,r.jsx)("span",{className:"truncate",children:e.displayName}),e.tag?(0,r.jsx)(G.A,{tag:e.tag}):null]}),(0,r.jsx)("span",{className:"ltr shrink-0 font-r14 text-text1",children:(0,P._2)(e.percentage)})]},e.symbol))})]})]}),(0,r.jsx)("div",{className:"mt-[20px] font-r12 text-text3 sm:mt-[12px]",children:o("L6669040宿买å
¥æ¶ä¼ä½¿ç¨æ¨ç°è´§è´¦æ·ä¸ç")})]})}let eB=e=>{let{form:t}=e,{t:n}=(0,s.A)(),{isLogin:o}=(0,eN.Z)(),{draft:d,invalidatePlans:c,invalidateBalance:u,setPlanListType:p,usableAssets:m,assetCode:h}=(0,l.xA)((0,a.k)(e=>({draft:e.draft,invalidatePlans:e.invalidatePlans,invalidateBalance:e.invalidateBalance,setPlanListType:e.setPlanListType,usableAssets:e.usableAssets,assetCode:e.assetCode}))),f=(0,l.xA)(e=>e.updateDraft),[v,g]=(0,i.useState)(!1),[y,A]=(0,i.useState)(!1),{mounted:L}=(0,ea.qK)(),{checkShowSurvey:C}=(0,eE.A)(),{items:w}=j(),{openRecharge:_}=(0,e_.V)({assetCode:h}),N=0===(0,i.useMemo)(()=>(0,ev.eg)(d,w),[d,w]).length&&!v,T=(0,i.useMemo)(()=>{var e;if("--"===m)return!1;let t=d.investmentAmount;return!!t&&"0"!==t&&(null!==(e=(0,eR.FF)(m,t))&&void 0!==e?e:-1)<0},[m,d.investmentAmount]),S=(0,ee.default)(eO()(async()=>{if((0,k.rB)({requirement_id:1004,track_sign:"aFinance.b4071.d4088.click.Click",clickName:"dca_create_confirm",pageName:"spot_trade",recommendedDcaPortfolioFe:d.sourcePortfolioId||""}),!N){$.A.error(n("L6668641请å®å宿忰"));return}g(!0);try{let e=await x.A.postLbkTradingbotGatewaySpotApiV1DcaCreate({createSource:"recommended"===d.source?"RECOMMENDED_PORTFOLIO":"MANUA
1L",..."recommended"===d.source&&d.sourcePortfolioId?{sourcePortfolioId:d.sourcePortfolioId}:{},planName:d.planName.trim()||(0,P.HB)(d.allocations,n("L6668785宿ç»å"))||void 0,allocations:d.allocations.map(e=>{var t;return{symbol:e.symbol.toLowerCase(),allocationRate:null!==(t=(0,P.ON)(e.percentage))&&void 0!==t?t:"0"}}),schedule:{...function(e){return"month"===e?{frequencyUnit:"MONTH",interval:1}:"week"===e?{frequencyUnit:"WEEK",interval:1}:e.endsWith("h")?{frequencyUnit:"HOUR",interval:Number.parseInt(e,10)}:{frequencyUnit:"DAY",interval:1}}(d.schedule.frequency),firstExecutionType:"immediate"===d.schedule.firstExecution?"IMMEDIATE":"SCHEDULED",recurrenceStartAt:b(d.schedule.startAt)},investmentAmount:d.investmentAmount,advancedSettings:{priceRanges:[]}});if(!e.planId)throw Error("Missing Spot DCA plan id");c(),u(),p("Running"),t.setFieldValue("investmentAmount",""),f({investmentAmount:""}),(0,k.YH)({requirement_id:1004,track_sign:"aFinance.b4071.d4088.result.Callback",isSuccess:!0,pageName:"spot_dca",errorCode:"200",actionType:"click",recommendedDcaPortfolioFe:d.sourcePortfolioId||"",dcaPortfolioFe:e.planId}),er.A.success({width:380,title:"",okText:n("L0001610æç¥éäº"),okButtonProps:{className:"w-full"},onOk:t=>{let n=()=>{var t;C({bizType:"trade",scene:1,orderId:e.planId,tradePair:(null===(t=d.allocations[0])||void 0===t?void 0:t.symbol)||""})};eA.Ay.getUserProfileCenterUserRole({}).then(e=>{(null==e?void 0:e.marketMaker)&&(null==e?void 0:e.marketMaker)===1||n()}).catch(()=>{n()}).finally(()=>{t()})},content:(0,r.jsx)(ez,{firstExecutionAt:b(d.schedule.startAt),firstExecution:d.schedule.firstExecution})})}catch(e){(0,k.YH)({requirement_id:1004,track_sign:"aFinance.b4071.d4088.result.Callback",isSuccess:!1,pageName:"spot_dca",actionType:"click",errorCode:function(e){if(null!==e&&"object"==typeof e&&"code"in e){let{code:t}=e;if(null!=t)return String(t)}return""}(e),recommendedDcaPortfolioFe:d.sourcePortfolioId||"",dcaPortfolioFe:""}),$.A.error(function(e,t){return e instanceof Error?e.message:t}(e,n("L6668627å建失败请ç¨åéè¯")))}finally{g(!1)}},500)),E=(0,i.useMemo)(()=>{if(!L||null===o)return(0,r.jsx)(eS.A,{block:!0,style:{width:"100%"},size:"large",className:"loginBtn",children:n("L0000011å è½½ä¸")});let e=(0,r.jsx)(eT.A,{showLogin:!0,showRegister:!0});return o?(0,r.jsx)(eS.A,{variant:"primary",size:"large",block:!0,loading:v,className:"!h-[40px] text-[14px] font-medium leading-[16px] [&_.lbank-btn-inner]:!whitespace-normal [&_.lbank-btn-inner]:!line-clamp-2",onClick:()=>{if(t.validateFields(),N){if((0,k.rB)({requirement_id:1004,track_sign:"aFinance.b4071.d4087.click.Click",clickName:"dca_create",pageName:"spot_trading",recommendedDcaPortfolioFe:d.sourcePortfolioId||""}),T){let e=n("L0000406ä½é¢ä¸è¶³");setTimeout(()=>{_({title:e,sensorData:{eventName:"web_spot_depositPage_click",clickNameMap:{deposit:"deposit_cryptocurrency",transfer:"transfer",oneClickBuy:"one_click_buy",p2pTrading:"p2p_trading"},pageName:"spot_trade"}})});return}A(!0)}},children:n("L6668628åå»ºå®æ")}):e},[L,o,n,N,v,T,d.sourcePortfolioId]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("section",{className:"w-full",children:E}),(0,r.jsx)(eU,{open:y,draft:d,onClose:()=>{(0,k.rB)({requirement_id:1004,track_sign:"aFinance.b4071.d4092.click.Click",clickName:"cancel",pageName:"spot_trade"}),A(!1)},onConfirm:()=>{A(!1),S()}})]})},eq=(0,i.memo)(()=>{let{firstBuyType:e,investmentAmount:t,allocations:n}=(0,l.xA)((0,a.k)(e=>({firstBuyType:e.draft.schedule.firstExecution,investmentAmount:e.draft.investmentAmount,allocations:e.draft.allocations}))),[o]=K.A.useForm({initialValues:{firstBuyType:e,investmentAmount:t}});(0,i.useEffect)(()=>{o.setFieldValue("firstBuyType",e),o.setFieldValue("investmentAmount",t)},[e,o,t]);let s=(0,i.useMemo)(()=>n.map(e=>e.symbol).join(","),[n]),d=(0,i.useRef)(!0);return(0,i.useEffect)(()=>{if(d.current){d.current=!1;return}o.validField("investmentAmount")},[s]),!function(){let{items:e,loading:t}=j(),{allocations:n,updateDraft:r}=(0,l.xA)((0,a.k)(e=>({allocations:e.draft.allocations,updateDraft:e.updateDraft})));(0,i.useEffect)(()=>
1{if(t||0===e.length)return;let l=new Map(e.map(e=>[e.symbol,e.tag])),i=n.map(e=>{if(e.tag)return e;let t=l.get(e.symbol.toLowerCase())||l.get(e.symbol);return t?{...e,tag:t}:e});i.some((e,t)=>e.tag!==n[t].tag)&&r({allocations:i})},[t])}(),!function(){let{items:e,loading:t}=j(),{createMode:n,currentSymbol:r,source:o,allocations:s,replaceAllocations:d}=(0,l.xA)((0,a.k)(e=>({createMode:e.createMode,currentSymbol:e.currentSymbol,source:e.draft.source,allocations:e.draft.allocations,replaceAllocations:e.replaceAllocations}))),c=(0,i.useRef)(!1),u=(0,i.useRef)();(0,i.useEffect)(()=>{if(t||0===e.length||"manual"!==n||c.current||"recommended"===o)return;if(1!==s.length){c.current=!0;return}let l=s[0].symbol.toUpperCase();if(u.current&&l!==u.current){c.current=!0;return}let i=null==r?void 0:r.toUpperCase(),a=i?e.find(e=>e.symbol===i):void 0,p=null!=a?a:e.find(e=>"BTC_USDT"===e.symbol);p&&l!==p.symbol&&(d([{symbol:p.symbol,displayName:p.displayName,percentage:"100",tag:p.tag}]),u.current=p.symbol)},[t,e,n,r,o,s,d])}(),(0,r.jsx)("div",{className:"py-[16px] flex flex-col gap-[16px] [&_.lbank-form-item]:!mb-0",children:(0,r.jsxs)(K.A,{form:o,children:[(0,r.jsx)(es,{}),(0,r.jsx)(ed,{}),(0,r.jsx)(em,{}),(0,r.jsx)(eg,{form:o}),(0,r.jsx)(ek,{}),(0,r.jsx)(eB,{form:o})]})})});function eH(){let{t:e}=(0,s.A)(),{createMode:t,setCreateMode:n}=(0,l.xA)((0,a.k)(e=>({createMode:e.createMode,setCreateMode:e.setCreateMode}))),{items:o,sort:b,loading:y,error:j,setSort:L,refetch:C}=function(){let[e,t]=(0,i.useState)("usage"),[n,l]=(0,i.useState)([]),[r,a]=(0,i.useState)(1),[o,s]=(0,i.useState)(0),{locale:c}=(0,d.A)(),{run:u,cancel:p,status:m,error:h}=(0,f.i)(async(e,t)=>{var n,r,i,o;let d=await x.A.postLbkTradingbotGatewaySpotApiV1ConfigDcaAiRecsList({sortType:"annualized-return"===t?"BACKTEST_ANNUALIZED_RETURN":"newest"===t?"LATEST":"USAGE_COUNT",page:1,pageSize:100},void 0,{signal:e}),c=(null!==(r=d.resultList)&&void 0!==r?r:[]).map(g.q);return l(c),a(null!==(i=null===(n=d.page)||void 0===n?void 0:n.pageNo)&&void 0!==i?i:1),s(null!==(o=d.totalCount)&&void 0!==o?o:c.length),d});return(0,i.useEffect)(()=>(u(e).catch(()=>void 0),p),[e,c]),{items:n,page:r,total:o,sort:e,loading:"loading"===m,error:"error"===m?h:void 0,setSort:t,refetch:async()=>{try{await u(e)}catch(e){if((0,v.z)(e))return;throw e}}}}(),{items:w,loading:k,error:_,refetch:N}=(0,h.E)(),T=(0,i.useMemo)(()=>({items:w,loading:k,error:_,refetch:N}),[w,k,_,N]),S=(0,i.useMemo)(()=>[{value:"usage",label:e("L6668648æä½¿ç¨äººæ°ä»é«å°ä½")},{value:"annualized-return",label:e("L6668649æåæµå¹´åä»é«å°ä½")},{value:"newest",label:e("L6668650æææ°ä¸çº¿")}],[e]),E=(0,i.useMemo)(()=>[{key:"recommended",label:e("L6668694æ¨èç»å")},{key:"manual",label:e("L0002701æå¨å建")}],[e]);return(0,r.jsx)(A.Provider,{value:T,children:(0,r.jsxs)("div",{className:"w-full relative bg-bg1 px-[14px] pb-[16px]",children:[(0,r.jsx)("div",{className:"pt-[12px] sticky top-0 bg-bg1 z-[1] pb-[16px]",children:(0,r.jsx)(m.A,{children:(0,r.jsx)(c.A,{value:t,onChange:e=>n(e),buttonProps:{block:!0,size:"middle"},className:" flex w-full bg-fill4 rounded-[16px] px-0 py-0 h-[32px] [&_.lbank-btn]:flex-1 [&_.lbank-btn:first-child]:z-[1] [&_.lbank-btn:first-child]:h-[32px] [&_.lbank-btn]:!rounded-[16px] [&_.lbank-btn:nth-child(2)]:z-[1] [&_.lbank-btn:nth-child(2)]:h-[32px] [&_.lbank-btn.active]:!bg-fill2 [&_.lbank-btn.active]:!rounded-[16px] [&_.lbank-btn:not(.active)]:!bg-fill4",items:E.map(e=>({label:e.label,value:e.key}))})})}),"recommended"===t&&(0,r.jsx)("div",{className:"mb-[12px] sticky top-0 flex items-center justify-start [&_.lbank-picker-open]:!text-text1",children:(0,r.jsx)(u.A,{value:b,options:S,icon:(0,r.jsx)(p.A,{}),className:"!text-text3 !text-[12px] !leading-[14px] ",onChange:e=>L(e)})}),(0,r.jsx)("div",{className:"flex flex-col gap-[8px]",children:"manual"===t?(0,r.jsx)(eq,{}):(0,r.jsx)(Y,{items:o,loading:y,error:j,refetch:C})})]})})}function eZ(e,t,n,l){return O({id:e},l).then(e=>{0!==e.allocations.length&&("apply"===t?n.applyPortfolio(e):n.updateDraft({allocations:e.allocations.map(e=>({...e}))}))})}function eG(e,t){return e instanceof Error&&e.message?e.message:t}let eW=e=>{var t,n,c,u;let{usableAssets:p,assetCode:m,usableAssetsName:h,currentSymbol:x,preset:f,onPresetConsumed:g}=e,{t:b}=(0,s.A)(),y=(0,d.A)(),{initializeEntry:A,resetDraft:j,setUsableAssets:L,applyPortfolio:C,updateDraft:w,setCreateMode:k,urlPresetApplied:_,lastUrlPlanId:N,markUrlPresetApplied:T,setLastUrlPlanId:S}
1=(0,l.xA)((0,a.k)(e=>({initializeEntry:e.initializeEntry,resetDraft:e.resetDraft,setUsableAssets:e.setUsableAssets,applyPortfolio:e.applyPortfolio,updateDraft:e.updateDraft,setCreateMode:e.setCreateMode,urlPresetApplied:e.urlPresetApplied,lastUrlPlanId:e.lastUrlPlanId,markUrlPresetApplied:e.markUrlPresetApplied,setLastUrlPlanId:e.setLastUrlPlanId}))),[E,P]=(0,i.useState)();return(0,i.useEffect)(()=>{var e,t;if((null===(e=y.query)||void 0===e?void 0:e.tradeType)==="dca"){let e=(null===(t=y.query)||void 0===t?void 0:t.planId)||"";e!==(null!=N?N:"")&&(T(!1),S(e))}},[null===(t=y.query)||void 0===t?void 0:t.tradeType,null===(n=y.query)||void 0===n?void 0:n.planId]),(0,i.useEffect)(()=>{var e,t;if((null===(e=y.query)||void 0===e?void 0:e.tradeType)==="dca"){if(_)return;let e=null===(t=y.query)||void 0===t?void 0:t.planId;if(!e)return;T(!0),k("manual"),P({type:"portfolio",portfolio:{id:e}})}},[null===(c=y.query)||void 0===c?void 0:c.tradeType,null===(u=y.query)||void 0===u?void 0:u.planId,_,T,k]),(0,i.useEffect)(()=>{f||E||A({createMode:"recommended"})},[A,f,E]),(0,i.useEffect)(()=>{L(p,m||"usdt",h,x)},[p,m,h,x,L]),(0,i.useEffect)(()=>{if(!f)return;if("recreate"===f.type){j(),A(f.recreatePreset);let{draft:e}=f.recreatePreset;if((null==e?void 0:e.source)==="recommended"&&e.sourcePortfolioId){let t=new AbortController,n=!0;return eZ(e.sourcePortfolioId,"allocations",{applyPortfolio:C,updateDraft:w},t.signal).then(()=>{n&&(null==g||g())}).catch(e=>{!n||(0,v.z)(e)||(o.A.error(eG(e,b("L0001895æä½å¤±è´¥"))),null==g||g())}),()=>{n=!1,t.abort()}}return void(null==g||g())}let e=new AbortController,t=!0;return eZ(f.portfolio.id,"apply",{applyPortfolio:C,updateDraft:w},e.signal).then(()=>{t&&(null==g||g())}).catch(e=>{!t||(0,v.z)(e)||(o.A.error(eG(e,b("L0001895æä½å¤±è´¥"))),null==g||g())}),()=>{t=!1,e.abort()}},[C,A,g,f,j,b,w]),(0,i.useEffect)(()=>{if(!E||"portfolio"!==E.type)return;let e=new AbortController,t=!0;return eZ(E.portfolio.id,"apply",{applyPortfolio:C,updateDraft:w},e.signal).catch(e=>{!t||(0,v.z)(e)||o.A.error(eG(e,b("L0001895æä½å¤±è´¥")))}),()=>{t=!1,e.abort()}},[E,b]),(0,r.jsx)(eH,{})}},50093:(e,t,n)=>{"use strict";n.d(t,{oD:()=>L,ew:()=>A,m:()=>j,xA:()=>w});var l=n(63159),r=n(53886),i=n(30180);function a(){return{usableAssets:"--",assetCode:"USDT",usableAssetsName:"",currentSymbol:void 0}}let o=e=>({...a(),setUsableAssets(t,n,l,r){e({usableAssets:t,assetCode:n,usableAssetsName:l||"",currentSymbol:r})}});var s=n(81852);function d(){return{createMode:"recommended",draft:(0,s.gR)(),entryApplied:!1,urlPresetApplied:!1,lastUrlPlanId:void 0,planNameManuallyEdited:!1,allocationsManuallyEdited:!1}}let c=(e,t)=>({...d(),initializeEntry(n){t().entryApplied||e(e=>{var t,l;return{entryApplied:!0,createMode:null!==(t=null==n?void 0:n.createMode)&&void 0!==t?t:e.createMode,draft:(l=e.draft,(null==n?void 0:n.draft)?{...n.draft,planName:(0,s.DP)(n.draft.planName),allocations:n.draft.allocations.map(e=>({...e})),schedule:{...n.draft.schedule}}:(null==n?void 0:n.portfolioId)?{...l,source:"recommended",sourcePortfolioId:n.portfolioId}:l),planNameManuallyEdited:!0}})},setCreateMode(t){e({createMode:t})},applyPortfolio(t){e(e=>({createMode:"manual",planNameManuallyEdited:!0,allocationsManuallyEdited:!1,draft:{...e.draft,source:"recommended",sourcePortfolioId:t.id,planName:(0,s.DP)(t.title),investmentAmount:"",schedule:{frequency:"day",firstExecution:"immediate"},allocations:t.allocations.map(e=>({...e}))}}))},updateDraft(t){e(e=>({draft:{...e.draft,...t}}))},replaceAllocations(t){e(e=>{let n=e.draft.allocations.map(e=>e.symbol).sort().join(","),l=t.map(e=>e.symbol).sort().join(",");return{draft:{...e.draft,...n!==l?{source:"manual",sourcePortfolioId:""}:{},allocations:t.map(e=>({...e}))}}})},resetDraft(){e({...d(),urlPresetApplied:t().urlPresetApplied})},markUrlPresetApplied(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e({urlPresetApplied:t})},setLastUrlPlanId(t){e({lastUrlPlanId:t})},markPlanNameManuallyEdited(){e({planNameManuallyEdited:!0})},markAllocationsManuallyEdited(){e({allocationsManuallyEdited:!0})}});function u(){return{planListType:"Running",selectedPlanId:void 0}}let p=e=>({...u(),setPlanListType(t){e({planListType:t})},openPlanDetail(t){e({selectedPlanId:t})},clearSelectedPlan(){e({selectedPlanId:void 0})}});function m(e){return e>=Number.MAX_SAFE_INTEGER-1?1:e+1}function h(){return{plansRevision:0,balanceRevision:0,detailRevisionById:{}}}let x=e=>({...h(),invalidatePlans(){e(e=>({plansRevision:m(e.plansRevision)}))},invalidateBalance(){e(e=>({balanceRevision:m(e.balanceRevision)}))},invalidatePlanDetail(t){e(e=>{var n;let l={...e.detailRevisionById};if(!(t in l)&&Object.keys(l).length>=50){let e=Object.keys(l)[0];delete l[e]}return l[t]=m(null!==(n=l[t])&&void 0!==n?n:0),{detailRevisionById:l}})}});function f(){return{runningCount:0}}let v=e=>({...f(),setRunningCount(t){e({runningCount:t})}}),g=(0,r.createContext)(null);function b(e){let{children:t,initialState:n,onOpenFunds:s,accountScopeKey:m}=e,b=(0,r.useRef)(),y=(0,r.useRef)(s);b.current&&b.current.accountScopeKey===m||(b.current={accountScopeKey:m,store:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.y)()((t,n,l)=>({...c(t,n,l),...p(t,n,l),...x(t,n,l),...o(t,n,l),...v(t,n,l),...e,reset(){t({...d(),...u(),...h(),...a(),...f()})}}))}(n)}),y.current=s;let{store:A}=b.current,j=(0,r.useCallback)(()=>{var e;null===(e=y.current)||void 0===e||e.call(y)},[]),L=(0,r.useMemo)(()=>({store:A,openFunds:j,accountScopeKey:m}),[m,j,A]);return(0,l.jsx)(g.Provider,{value:L,children:t})}function y(e){let{children:t,initialState:n,onOpenFunds:r,accountScopeKey:i}=e;return(0,l.jsx)(b,{initialState:n,onOpenFunds:r,accountScopeKey:i,children:t})}function A(e){let{children:t,onOpenFunds:n,accountScopeKey:r}=e;return(0,l.jsx)(y,{onOpenFunds:n,accountScopeKey:r,children:t})}function j(){let e=(0,r.useContext)(g);if(!e)throw Error("SpotDcaScopeProvider is missing");return e}function L(e){let{children:t}=e,{accountScopeKey:n}=j();return(0,l.jsx)(r.Fragment,{children:t},null!=n?n:"anonymous")}var C=n(83152);function w(e){let{store:t}=j();return(0,C.P)(t,e)}},92077:(e,t,n)=>{"use strict";n.d(t,{FZ:()=>p,Fc:()=>c,HB:()=>h,KW:()=>d,ON:()=>a,Rg:()=>m,_2:()=>o,oC:()=>s,ru:()=>u});var l=n(96657),r=n(81852),i=n(50979);function a(e){let t=(0,i.CF)(e);if(t)return t.div(100).toFixed()}function o(e){return(0,i.Zw)(e)?"".concat(e,"%"):"--"}function s(e){let t=(0,i.CF)(e);if(t)return t.times(100).toFixed()}function d(e){var t,n,l;let r=(null!==(l=e.symbol)&&void 0!==l?l:"").toUpperCase();if(!r)throw Error("Missing Spot DCA symbol");return{symbol:r,displayName:(null===(t=e.displayName)||void 0===t?void 0:t.trim())||r.split("_")[0]||r,iconUrl:(null===(n=e.iconUrl)||void 0===n?void 0:n.trim())||void 0,percentage:function(e){let t=s(null!=e?e:"");if(void 0===t)throw Error("Invalid DCA allocation rate");return t}(e.allocationRate),tag:e.tag}}function c(e){if(e.every(i.Zw))return e.reduce((e,t)=>
1e.plus(t),new l.A(0)).toFixed()}function u(e){let t=c(e);if(t)return new l.A(r.W7).minus(t).toFixed()}function p(e){if(!Number.isInteger(e)||e<=0)return[];let t=Math.floor(100/e),n=100-t*e;return Array.from({length:e},(e,l)=>String(t+(l<n?1:0)))}function m(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function h(e,t){let n=e.map(e=>e.displayName).filter(Boolean);if(0===n.length)return"";let l=n.slice(0,3).join(","),r=n.length>3?"...":"";return"".concat(l).concat(r).concat(t)}},50979:(e,t,n)=>{"use strict";n.d(t,{CF:()=>a,FF:()=>o,Zw:()=>i,bT:()=>s});var l=n(96657);let r=/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/;function i(e){return r.test(e)}function a(e){if(i(e))return new l.A(e)}function o(e,t){let n=a(e),l=a(t);if(n&&l)return n.cmp(l)}function s(e,t,n){let l=a(e),r=a(t),i=void 0===n?void 0:a(n);return!l||!r||void 0!==n&&!i||void 0!==i&&r.gt(i)?"invalid":l.lt(r)?"below-min":void 0!==i&&l.gt(i)?"above-max":"valid"}},75999:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});var l=n(92077),r=n(50979);function i(e){var t,n,i,a,o,s,d;if(!e.portfolioId||!e.name)throw Error("Missing Spot DCA portfolio fields");return{id:e.portfolioId,title:e.name,description:(null===(t=e.description)||void 0===t?void 0:t.trim())||"",annualizedReturn:null===(n=(0,r.CF)(null!==(i=e.backtestAnnualizedReturn)&&void 0!==i?i:""))||void 0===n?void 0:n.toFixed(),trend:(null!==(a=e.backtestCurvePoints)&&void 0!==a?a:[]).map(e=>{var t;return Number((0,l.oC)(null!==(t=e.returnRate)&&void 0!==t?t:""))}).filter(Number.isFinite),allocations:(null!==(o=e.allocations)&&void 0!==o?o:[]).map(l.KW),usageCount:null!==(s=e.usageCount)&&void 0!==s?s:0,tags:null!==(d=e.tags)&&void 0!==d?d:[]}}},84490:(e,t,n)=>{"use strict";n.d(t,{Sv:()=>o,lq:()=>a,ng:()=>r,v1:()=>s,xP:()=>i});var l=n(81852);function r(e){return l.US.includes(e)}function i(e){return Number.isInteger(e)&&e>=1e12&&e<=0x9184e729fff}function a(e){return Number.isInteger(e)&&e>=-840&&e<=840}function o(e,t){return!!(i(e)&&a(t))&&(e+6e4*t)%36e5==0}function s(e){let t=-new Date().getTimezoneOffset(),n=e.startAt?new Date(e.startAt):new Date,l=n.getHours(),r=n.getDay(),i=n.getDate();return{startAt:e.frequency.endsWith("h")||"day"===e.frequency?function(e){let t=new Date,n=new Date(t);return n.setHours(e,0,0,0),n.getTime()<=t.getTime()&&n.setDate(n.getDate()+1),n.getTime()}(l):"week"===e.frequency?function(e,t){let n=new Date,l=new Date(n),r=e-l.getDay();return r<0&&(r+=7),l.setDate(l.getDate()+r),l.setHours(t,0,0,0),l.getTime()<=n.getTime()&&l.setDate(l.getDate()+7),l.getTime()}(r,l):function(e,t){let n=new Date,l=new Date(n.getFullYear(),n.getMonth(),e,t,0,0,0);return l.getTime()<=n.getTime()&&l.setMonth(l.getMonth()+1),l.getTime()}(i,l),timeZoneOffsetMinutes:t}}},80250:(e,t,n)=>{"use strict";n.d(t,{_v:()=>c,eg:()=>u,xs:()=>s});var l=n(96657),r=n(81852),i=n(50979),a=n(92077),o=n(84490);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new l.A(r.vF);if((0,a.Fc)(e.map(e=>e.percentage))!==r.W7)return n.toFixed(2);let o=new Map(t.map(e=>[e.symbol.toLowerCase(),e]));return e.reduce((e,t)=>{var n;let l=(0,i.CF)(t.percentage);if(!l||l.lte(0))return e;let a=o.get(t.symbol.toLowerCase()),s=(0,i.CF)(null!==(n=null==a?void 0:a.minInvestmentAmount)&&void 0!==n?n:r.p7);if(!s)return e;let d=s.times(100).div(l);return d.gt(e)?d:e},n).round(2,l.A.roundUp).toFixed(2)}function d(e,t,n){let l=new Map(t.map(e=>[e.symbol.toLowerCase(),e])),a=(0,i.CF)(e.investmentAmount);if(!a||!(0,i.Zw)(e.investmentAmount)||a.lte(0)){n.push({code:"AMOUNT_INVALID",path:"investmentAmount"});return}let o=s(e.allocations,t);a.lt(o)&&n.push({code:"AMOUNT_BELOW_MIN",path:"investmentAmount",meta:{min:o}}),e.allocations.forEach((e,t)=>{var o;let s=(0,i.CF)(e.percentage);if(!s)return;let d=a.times(s).div(100),c=l.get(e.symbol.toLowerCase()),u=null!==(o=null==c?void 0:c.minInvestmentAmount)&&void 0!==o?o:r.p7;d.lt(u)&&n.push({code:"AMOUNT_PER_ASSET_BELOW_MIN",path:"allocations.".concat(t,".percentage"),meta:{min:u,displayName:e.displayName||(null==c?void 0:c.displayName)}})})}function c(e,t,n){var l;let r=[];d(e,null!=n?n:[],r);let i=null!==(l=r[0])&&void 0!==l?l:null;return i?{...i,meta:{...i.meta,assetCode:t.toUpperCase()}}:null}function u(e,t){var n,l;let s=[],c=e.allocations.length;(c<r.Zb||c>r.X7)&&s.push({code:"ASSET_COUNT_OUT_OF_RANGE",path:"allocations",meta:{min:r.Zb,max:r.X7}});let u=new Set;e.allocations.forEach((e,t)=>{if(e.symbol.trim()||s.push({code:"ASSET_SYMBOL_REQUIRED",path:"allocations.".concat(t,".symbol")}),u.has(e.symbol)&&s.push({code:"ASSET_DUPLICATED",path:"allocations.".concat(t,".symbol")}),u.add(e.symbol),!(0,a.Rg)(e.percentage)){s.push({code:"ALLOCATION_NOT_INTEGER",path:"allocations.".concat(t,".percentage")});return}let n=(0,i.CF)(e.percentage);(!n||n.lt(r._2)||n.gt(r.W7))&&s.push({code:"ALLOCATION_OUT_OF_RANGE",path:"allocations.".concat(t,".percentage"),meta:{min:r._2,max:r.W7,percentage:null==n?void 0:n.toString()}})});let p=(0,a.Fc)(e.allocations.map(e=>e.percentage));
1return p!==r.W7&&s.push({code:"ALLOCATION_TOTAL_INVALID",path:"allocations",meta:{expected:r.W7,actual:null!=p?p:""}}),d(e,null!=t?t:[],s),!function(e,t){let{schedule:n}=e;(0,o.ng)(n.frequency)||t.push({code:"SCHEDULE_INVALID",path:"schedule.frequency"}),"custom"===n.firstExecution&&(void 0===n.startAt?t.push({code:"CUSTOM_START_TIME_REQUIRED",path:"schedule.startAt"}):(0,o.xP)(n.startAt)||t.push({code:"CUSTOM_START_TIME_INVALID",path:"schedule.startAt"}),void 0!==n.timeZoneOffsetMinutes&&(0,o.lq)(n.timeZoneOffsetMinutes)?void 0!==n.startAt&&(0,o.xP)(n.startAt)&&!(0,o.Sv)(n.startAt,n.timeZoneOffsetMinutes)&&t.push({code:"CUSTOM_START_TIME_NOT_HOUR_ALIGNED",path:"schedule.startAt"}):t.push({code:"TIME_ZONE_OFFSET_INVALID",path:"schedule.timeZoneOffsetMinutes"}))}(e,s),"recommended"!==e.source||(null===(n=e.sourcePortfolioId)||void 0===n?void 0:n.trim())||s.push({code:"RECOMMENDED_PORTFOLIO_REQUIRED",path:"sourcePortfolioId"}),(null===(l=e.planName)||void 0===l?void 0:l.trim())||0!==e.allocations.map(e=>e.displayName).filter(Boolean).length||s.push({code:"PLAN_NAME_REQUIRED",path:"planName"}),s}},64794:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var l=n(63159),r=n(32526),i=n(58574),a=n(53886),o=n(78961),s=n(57157),d=n(78928);let c=(0,a.memo)(e=>{let{item:t,autoLoading:n=!1,customTracker:a=!1}=e,{t:c}=(0,o.A)(),[u,p]=(0,s.A)(!1),m=async e=>{a||d.A.d2357({clickName:t.key,status:e}),await t.switchFn(t.key,e)};return(0,l.jsxs)(i.Ki,{children:[(0,l.jsx)("div",{className:"setting-title",children:c(t.title)}),(0,l.jsx)("div",{className:"setting-operate",children:(0,l.jsx)(r.A,{variant:"brand",size:"small",loading:n&&u,onChange:e=>p(m(e)),checked:t.checked})})]},t.key)})},57081:(e,t,n)=>{"use strict";n.d(t,{A:()=>g,S:()=>p.S});var l=n(63159),r=n(53886),i=n(78961),a=n(10840),o=n(71913),s=n(41427),d=n(76836),c=n(76025),u=n(64794),p=n(57824),m=n(31412),h=n(98435),x=n(17485),f=n(78928),v=n(58574);let g=(0,r.memo)(e=>{var t;let{extra:n,onClickItem:g,curPositionType:b}=e,{t:y}=(0,i.A)(),{isLogin:A}=(0,m.Z)(),[j]=(0,s.A)(d.t8,{}),L=null===(t=null==j?void 0:j.numberShowFormat)||void 0===t||t,C=(0,r.useCallback)((e,t)=>(0,l.jsx)(u.A,{item:e,autoLoading:t}),[]),[w]=(0,x.A)();return(0,r.useEffect)(()=>{f.A.d2356()},[]),(0,l.jsxs)(v.RH,{children:[(0,l.jsxs)(v.F$,{children:[(0,l.jsx)(v.hw,{children:y("L0019785交æå好")}),A&&e.isFuture&&(0,l.jsxs)(v.Ki,{cursor:!0,onClick:()=>{null==g||g(p.S.PositionType),f.A.d2357({clickName:p.S.PositionType})},children:[(0,l.jsx)("div",{className:"setting-title",children:(0,l.jsx)("span",{children:y("L0020112ä»ä½æ¨¡å¼æ°å¢")})}),(0,l.jsxs)("div",{className:"setting-operate",children:[(0,l.jsx)("div",{className:"setting-value",children:b||""}),(0,l.jsx)(c.A,{children:(0,l.jsx)(a.A,{className:"arrowIcon"})})]})]}),(0,l.jsxs)(v.Ki,{cursor:!0,onClick:()=>{null==g||g(p.S.NumberShowFormat),f.A.d2357({clickName:p.S.NumberShowFormat})},children:[(0,l.jsx)("div",{className:"setting-title",children:(0,l.jsx)("span",{children:y("L0016061ä»·æ ¼å±ç¤ºæ ¼å¼")})}),(0,l.jsxs)("div",{className:"setting-operate",children:[(0,l.jsx)("div",{className:"setting-value",children:y(L?"L0016063ç¼©åæ ¼å¼":"L0016065æ åæ ¼å¼")}),(0,l.jsx)(c.A,{children:(0,l.jsx)(a.A,{className:"arrowIcon"})})]})]})]}),(0,l.jsx)(v.GU,{}),A&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.hw,{children:y("L0001066ä¸å确认")}),(0,l.jsx)(v.P8,{children:(e.generalSettings||[]).map(e=>C(e,!0))}),e.dropSettings?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.GU,{}),(0,l.jsxs)(v.P8,{children:[(0,l.jsxs)(v.hw,{children:[(0,l.jsx)("span",{children:y("L0018726ææ½ç¡®è®¤ä¸è¦å¤ç¨appç就嫿")}),(0,l.jsx)(h.A,{title:y("L0022067å
³äºKçº¿ææ½ä¸åç确认"),action:w?"click":"hover",children:(0,l.jsx)(o.A,{})})]}),(e.dropSettings||[]).map(e=>C(e,!0))]})]}):null,(0,l.jsx)(v.GU,{})]}),A&&(e.notificationSettings?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(v.P8,{children:[(0,l.jsx)(v.hw,{children:(0,l.jsx)("span",{children:y("L0015064éç¥è®¾ç½®")})}),e.notificationSettings.map(e=>C(e,!0))]}),(0,l.jsx)(v.GU,{})]}):null),(0,l.jsxs)(v.A9,{children:[(0,l.jsxs)(v.Ki,{cursor:!0,onClick:()=>{null==g||g(p.S.TradeRule)},children:[(0,l.jsx)("div",{className:"setting-title",children:(0,l.jsx)("span",{children:y("L0008331交æè§å")})}),(0,l.jsx)("div",{className:"setting-operate",children:(0,l.jsx)(c.A,{children:(0,l.jsx)(a.A,{className:"arrowIcon"})})})]}),e.isFuture&&(0,l.jsxs)(v.Ki,{cursor:!0,onClick:()=>{null==g||g(p.S.Calculator)},children:[(0,l.jsx)("div",{className:"setting-title",children:(0,l.jsx)("span",{children:y("L0001090å约计ç®å¨")})}),(0,l.jsx)("div",{className:"setting-operate",children:(0,l.jsx)(c.A,{children:(0,l.jsx)(a.A,{className:"arrowIcon"})})})]})]}),n]})})}
1,58574:(e,t,n)=>{"use strict";n.d(t,{A9:()=>v,F$:()=>y,GU:()=>g,Ki:()=>b,P8:()=>f,RH:()=>h,hw:()=>x});var l=n(58474),r=n(50321),i=n(13892);function a(){let e=(0,l._)(["\n width: 100%;\n"]);return a=function(){return e},e}function o(){let e=(0,l._)(["\n color: ",";\n ",";\n display: flex;\n height: 44px;\n align-items: center;\n align-self: stretch;\n flex: 1;\n gap: 4px;\n\n .lbank-icon-Info {\n font-size: 16px;\n cursor: pointer;\n }\n"]);return o=function(){return e},e}function s(){let e=(0,l._)(["\n color: ",";\n ",";\n"]);return s=function(){return e},e}function d(){let e=(0,l._)([""]);return d=function(){return e},e}function c(){let e=(0,l._)(["\n margin: 16px 0;\n height: 1px;\n background-color: ",";\n"]);return c=function(){return e},e}function u(){let e=(0,l._)(["\n display: flex;\n min-height: 44px;\n justify-content: space-between;\n align-items: center;\n align-self: stretch;\n flex-wrap: wrap;\n cursor: ",";\n\n .setting-title {\n color: ",";\n ",";\n margin-right: 16px;\n padding: 14px 0;\n flex: 1;\n min-width: 100px;\n\n span {\n ","\n }\n }\n\n .setting-operate {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n .setting-value {\n ","\n color: ",";\n ",";\n }\n .arrowIcon svg {\n width: 20px;\n height: 20px;\n color: ",";\n }\n\n .lbank-switch-presentation-checked {\n background-color: ",";\n }\n }\n"]);return u=function(){return e},e}function p(){let e=(0,l._)([""]);return p=function(){return e},e}function m(){let e=(0,l._)([""]);return m=function(){return e},e}let h=i.Ay.div(a()),x=i.Ay.div(o(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>e.theme.bizTypography.r14),f=i.Ay.div(s(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1},e=>e.theme.bizTypography.r14),v=i.Ay.div(d()),g=i.Ay.div(c(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizLine.line3}),b=i.Ay.div(u(),e=>e.cursor?"pointer":"default",e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1},e=>e.theme.bizTypography.r14,(0,r.L9)(2),(0,r.L9)(2),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>e.theme.bizTypography.r12,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizFill.fill5}),y=i.Ay.div(p());i.Ay.div(m())},57824:(e,t,n)=>{"use strict";n.d(t,{S:()=>l});var l=function(e){return e.TradeRule="tradeRule",e.PositionType="positionType",e.NumberShowFormat="numberShowFormat",e.Calculator="calculator",e.Guide="guide",e}({})},53659:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var l=n(58474),r=n(63159),i=n(53886),a=n(57826),o=n(46060),s=n(13892),d=n(23472);function c(){let e=(0,l._)(["\n margin: 80px 0;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 110px;\n"]);return c=function(){return e},e}let u=s.Ay.div(c()),p=()=>(0,a.U)("max-width: 779px")?(0,r.jsx)(u,{className:"data-state-box",children:(0,r.jsx)(o.A,{})}):(0,r.jsx)(o.A,{}),m=i.forwardRef((e,t)=>{let{loading:n,shouldResponsive:l=!1,...i}=e,a="object"==typeof n?n:{open:n,indicator:(0,r.jsx)(p,{})};return(0,r.jsx)(d.A,{shouldResponsive:l,ref:t,loading:a,...i})})},40887:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var l=n(58474),r=n(63159),i=n(53886),a=n(35150),o=n(64691),s=n(78961),d=n(13892),c=n(50321),u=n(76239),p=n(32890),m=n(83602);let h=()=>{let[e,t]=(0,i.useState)(),n=(0,m.A)(),l=(0,i.useCallback)(()=>{t(!1)},[]),r=(0,i.useCallback)(()=>{t(!0)},[]);return(0,i.useEffect)(()=>(p.A.addEventListener(p.A.mq.CLOSE,l,!1),p.A.addEventListener(p.A.mq.OPEN,r,!1),()=>{p.A.removeEventListener(p.A.mq.CLOSE,l),p.A.removeEventListener(p.A.mq.OPEN,r)}),[]),{online:(0,i.useMemo)(()=>!(!1===n.online&&!1===e),[e,n])}};function x(){let e=(0,l._)(["\n margin-top: 2px;\n border-radius: 0;\n background-color: ",";\n\n .lbank-alert-title {\n color: ",";\n ",";\n }\n"]);return x=function(){return e},e}let f=(0,d.Ay)(a.A)(x(),c.qe,c.xY,e=>e.theme.bizTypography.r14),v=(0,i.memo)(()=>{let{t:e}=(0,s.A)(),{online:t}=h(),n=(0,o.A)(()=>{let n={show:!1,message:""};return!1===t&&(n.show=!0,n.message=e("L0017121ç½ç»è¿æ¥å¤±è´¥è¯·æ£æ¥ç½ç»è®¾ç½®")),n},[t,e]);return n.show?(0,r.jsx)(f,{type:"warning",closable:!0,icon:(0,r.jsx)(u.A,{}),title:n.message}):null})},34456:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>G});var l=n(58474),r=n(63159),i=n(53886),a=n(13892),o=n(60583),s=n(78961),d=n(60621),c=n(38175),u=n(86257),p=n(45078),m=n(50321),h=n(41335),x=n(86393),f=n(39700),v=n(30372),g=n(3289
10);let b=()=>{var e;let[t,n]=(0,i.useState)({status:"online",quality:"good",latency:null,lastPongTime:null}),l=(0,i.useRef)(null),r=(0,i.useCallback)(e=>e<=500?"good":e<=5e3?"normal":"poor",[]),a=(0,i.useCallback)((e,t,l)=>{n(n=>({...n,status:e,quality:t,latency:l,lastPongTime:"online"===e?Date.now():null}))},[]);return(0,i.useEffect)(()=>{let e=e=>{if("pong"===e.action&&e.pong){let t=Date.now()-Number(e.pong);l.current&&(clearTimeout(l.current),l.current=null),a("online",r(t),t)}};return g.A.mq.addEventListener(g.A.mq.MESSAGE,e),()=>{g.A.mq.removeEventListener(g.A.mq.MESSAGE,e)}},[r,a]),(0,i.useEffect)(()=>{let e=()=>{var e;g.A.isAlive&&(null===(e=g.A.ws)||void 0===e?void 0:e.readyState)===WebSocket.OPEN||a("offline","poor",null)},t=()=>{a("offline","poor",null)};return g.A.mq.addEventListener(g.A.mq.OPEN,e),g.A.mq.addEventListener(g.A.mq.CLOSE,e),g.A.mq.addEventListener(g.A.mq.RECONNECT,t),()=>{g.A.mq.removeEventListener(g.A.mq.OPEN,e),g.A.mq.removeEventListener(g.A.mq.CLOSE,e),g.A.mq.removeEventListener(g.A.mq.RECONNECT,t)}},[t.status,a]),(0,i.useEffect)(()=>{let e=setInterval(()=>{t.lastPongTime&&Date.now()-t.lastPongTime>6e3&&a("offline","poor",null)},3e3);return()=>clearInterval(e)},[t.lastPongTime,a]),{...t,isConnected:g.A.isAlive&&(null===(e=g.A.ws)||void 0===e?void 0:e.readyState)===WebSocket.OPEN}};function y(){let e=(0,l._)(["\n display: flex;\n align-items: center;\n gap: 4px;\n"]);return y=function(){return e},e}function A(){let e=(0,l._)(["\n width: 12px;\n height: 12px;\n flex-shrink: 0;\n color: ",";\n"]);return A=function(){return e},e}function j(){let e=(0,l._)(["\n text-align: center;\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n color: ",";\n"]);return j=function(){return e},e}let L=a.Ay.div(y()),C=(0,a.Ay)(v.A)(A(),e=>{if("offline"===e.$status)return m.WU;switch(e.$quality){case"good":return m.KA;case"normal":return m.xY;default:return m.WU}}),w=a.Ay.span(j(),e=>{if("offline"===e.$status)return m.WU;switch(e.$quality){case"good":return m.KA;case"normal":return m.xY;default:return m.WU}}),k=()=>{let{t:e}=(0,s.A)(),{status:t,quality:n}=b();console.log(t,n,"status, quality inner");let l=(0,i.useMemo)(()=>{if("offline"===t)return e("L0019454ç³»ç»è¿æ¥å¼å¸¸");switch(n){case"good":return e("L0019455ç³»ç»è¿æ¥ç¨³å®");case"normal":return e("L0019456ç³»ç»è½»å¾®å»¶è¿");default:return e("L0019454ç³»ç»è¿æ¥å¼å¸¸")}},[t,n,e]);return(0,r.jsxs)(L,{children:[(0,r.jsx)(C,{$status:t,$quality:n,"aria-label":"è¿æ¥ç¶æ: ".concat(l)}),(0,r.jsx)(w,{$status:t,$quality:n,children:l})]})};var _=n(53984),N=n(57157);let T=e=>{var t,n;let[l,r]=(0,N.A)(!1),[a,o]=(0,i.useState)(null);return(0,i.useEffect)(()=>{(async()=>{try{let t=await r(new _.LA({requestOptions:e}).setCodes(["ADS000117"]).setDevCodes(["ADS000287"]).then());if((null==t?void 0:t[0])&&t[0].length>0){let e=(0,_.Ct)(t,{dev:"AD00001204",prd:"AD00012840"});if(e&&e.length>0){let t=e[0];o({...t})}else o(null)}else o(null)}catch(e){o(null)}})()},[r,null==e?void 0:e.errorPolicy,null==e?void 0:null===(t=e.errorContext)||void 0===t?void 0:t.page,null==e?void 0:null===(n=e.errorContext)||void 0===n?void 0:n.trigger]),{adData:a,loading:l}};function S(){let e=(0,l._)(["\n display: none;\n "]);return S=function(){return e},e}function E(){let e=(0,l._)(["\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 197; // 忢å¸å¯¹å±çº§198ï¼åæ¢å¸å¯¹çå±çº§æ´é«ï¼ä¸å¾é«äº197\n background: ",";\n border-top: 1px solid ",";\n backdrop-filter: blur(10px);\n padding: 8px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n ","\n"]);return E=function(){return e},e}function P(){let e=(0,l._)(["\n display: flex;\n align-items: center;\n"]);return P=function(){return e},e}function O(){let e=(0,l._)(["\n display: flex;\n align-items: center;\n gap: 24px;\n"]);return O=function(){return e},e}function R(){let e=(0,l._)(["\n display: flex;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n color: ",";\n text-align: center;\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n\n &:hover {\n color: ",";\n }\n"]);return R=function(){return e},e}function I(){let e=(0,l._)(["\n ","\n"]);return I=function(){return e},e}function M(){let e=(0,l._)(["\n ","\n"]);return M=function(){return e},e}function z(){let e=(0,l._)(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n font-size: 12px;\n"]);return z=function(){return e},e}let F=a.Ay.div(E(),m.zz,m._O,h.XG.mobile((0,o.AH)(S()))),D=a.Ay.div(P()),U=a.Ay.div(O()),B=(0,o.AH)(R(),m.fG,m.vZ),q=a.Ay.div(I(),B),H=a.Ay.div(M(),B),Z=a.Ay.div(z()),G=(0,i.memo)(function(){let{requestOptions:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{t}=(0,s.A)(),n=(0,d.B$)(),l=(0,x.A)(),a=(0,f.A)(),{openLiveChat:o}=(0,c.A)(),{isMobile:m}=(0,h.Px)(),{adData:v}=T(e),g=(0,i.useCallback)(()=>{(null==v?void 0:v.targetPath)&&window.open(null==v?void 0:v.targetPath,"_blank")},[null==v?void 0:v.targetPath]),b=(0,i.useCallback)(()=>{a?o():n()},[a,o,n]);return m?null:(0,r.jsxs)(F,{role:"banner","aria-label":t("L0014394ç鍿´»å¨"),children:[(0,r.jsx)(D,{children:(0,r.jsx)(k,{})}),(0,r.jsxs)(U,{children:[(null==v?void 0:v.targetPath)&&!l?(0,r.jsxs)(q,{onClick:g,"aria-label":t("L0014394ç鍿´»å¨"),title:t("L0014394ç鍿´»å¨"),"data-suck-target":"hot-events",children:[(0,r.jsx)(Z,{"aria-hidden":"true",children:(0,r.jsx)(u.A,{})}),(0,r.jsx)("span",{children:t("L0014394ç鍿´»å¨")})]}):null,a||!l?(0,r.jsxs)(H,{onClick:b,"aria-label":t("L0003312å¨çº¿å®¢æ"),title:t("L0003312å¨çº¿å®¢æ"),children:[(0,r.jsx)(Z,{"aria-hidden":"true",children:(0,r.jsx)(p.A,{})}),(0,r.jsx)("span",{children:t("L0003312å¨çº¿å®¢æ")})]}):null]})]})})},76124:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var l=n(63159),r=n(63618),i=n(76306),a=n(96657);n(53886);let o=e=>{let{precision:t=0,min:n=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,value:s="",onCh
1ange:d,maxIntPartLength:c=0,prefix:u,suffix:p,addonBefore:m=u,addonAfter:h=p,noNegative:x=!1,...f}=e,v=(0,r.default)(e=>{if(t){if(""===e){null==d||d(e);return}let r=n<0;if(r&&"-"===e){null==d||d(e);return}if(c>0){var l;if(((null===(l=e.match(/^-?(\d+)(\.|$)/))||void 0===l?void 0:l[1])||"").length>c)return}let i=r?"-?":"",s=(0,a.A)(Math.max(0,t)).toFixed();new RegExp((0,a.A)(s).lte(0)?"^".concat(i,"[0-9]\\d*$"):"^".concat(i,"\\d*\\.?\\d{0,").concat(s,"}$")).test(e)&&(+e>=n||0==+e)&&+e<=o?null==d||d(e):!x&&0===o&&e>0&&(null==d||d(-e))}});return(0,l.jsx)(i.A.Number,{...f,precision:t,addonBefore:m,value:s,addonAfter:h,onChange:v})},s=e=>(0,l.jsx)(o,{...e,onChange:t=>{var n,l;"number"==typeof t?null===(n=e.onChange)||void 0===n||n.call(e,t):null===(l=e.onChange)||void 0===l||l.call(e,t.replace(/[^\d-.]/g,"").replace(/[.]/,"#").replace(/[.]/g,"").replace(/[#]/g,".").replace(/^0+([1-9])/,"$1"))}})},86334:(e,t,n)=>{"use strict";n.d(t,{E:()=>p});var l=n(63159),r=n(53886),i=n(40879);function a(e,t,n){return Math.min(Math.max(e,t),n)}function o(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.4,r=Math.hypot(t.x-e.x,t.y-e.y),i=r+Math.hypot(n.x-t.x,n.y-t.y),a=0===i?0:l*r/i,o=l-a;return{before:{x:t.x-a*(n.x-e.x),y:t.y-a*(n.y-e.y)},after:{x:t.x+o*(n.x-e.x),y:t.y+o*(n.y-e.y)}}}function s(e){return e.filter(Number.isFinite)}function d(e,t){t.forEach(t=>{e.bezierCurveTo(t.controlPoint1.x,t.controlPoint1.y,t.controlPoint2.x,t.controlPoint2.y,t.end.x,t.end.y)})}function c(e,t,n,l,r,i){if("up"===l)return r;if("down"===l)return i;let a=e.createLinearGradient(0,0,0,n);return a.addColorStop(0,r),a.addColorStop(t.zeroYRatio,r),a.addColorStop(t.zeroYRatio,i),a.addColorStop(1,i),a}function u(e,t){return Number.isFinite(e)&&e>0?e:t}let p=(0,r.memo)(function(e){let{values:t,width:n=100,height:p=40,direction:m,ariaLabel:h,className:x}=e,f=(0,r.useRef)(null),v=(0,r.useRef)(),[g]=(0,i.Ay)(),b=u(n,100),y=u(p,40),A=t.join(","),j=(0,r.useMemo)(()=>s(t),[A]),L=null!=m?m:function(e){var t;let n=s(e),l=null!==(t=n[n.length-1])&&void 0!==t?t:0;return l>0?"up":l<0?"down":"neutral"}(j),C=null!=m?m:"neutral",w="up"===L?"â":"down"===L?"â":"â";return(0,r.useEffect)(()=>{let e=f.current;if(!e)return;let t=!0,n=()=>{void 0!==v.current&&(window.cancelAnimationFrame(v.current),v.current=void 0)},l=()=>{t&&void 0===v.current&&(v.current=window.requestAnimationFrame(()=>{v.current=void 0;let t=e.getBoundingClientRect();t.width<=0||t.height<=0||function(e,t,n,l,r,i,u,p,m){let h=e.getContext("2d");if(!h)return;let x=Math.min(window.devicePixelRatio||1,3),f=Math.max(Math.round(n*x),1),v=Math.max(Math.round(l*x),1);(e.width!==f||e.height!==v)&&(e.width=f,e.height=v),h.setTransform(x,0,0,x,0,0),h.clearRect(0,0,n,l);let g=function(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,r=s(e);if(0===r.length||!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return;let{min:i,max:d}=r.reduce((e,t)=>({min:Math.min(e.min,t,0),max:Math.max(e.max,t,0)}),{min:0,max:0}),c=Math.max(Math.abs(i),Math.abs(d),1),u=i/c,p=d/c-u||1,m=Math.min((Number.isFinite(l)&&l>0?l:0)/2,t/2,n/2),h=Math.max(t-2*m,0),x=Math.max(n-2*m,0),f=n-m-(0-u)/p*x,v=1===r.length?0:h/(r.length-1),g=r.map((e,l)=>({x:1===r.length?t/2:m+l*v,y:n-m-(e/c-u)/p*x})),b=e=>({x:a(e.x,m,t-m),y:a(e.y,m,n-m)}),y=g.slice(0,-1).map((e,t)=>{let n=g[Math.max(t-1,0)],l=g[t+1],r=g[Math.min(t+2,g.length-1)],i=o(n,e,l),a=o(e,l,r);return{controlPoint1:b(i.after),controlPoint2:b(a.before),end:l}});return{points:g,segments:y,zeroY:f,zeroYRatio:f/n}}(t,n,l,2);if(!g)return;let b=window.getComputedStyle(e),y=b.getPropertyValue("--line-2").trim()||b.color,A=c(h,g,l,r,i,u),j=c(h,g,l,r,p,m);h.save(),h.beginPath(),h.strokeStyle=y,h.lineWidth=1,h.setLineDash([4,4]),h.moveTo(0,g.zeroY),h.lineTo(n,g.zeroY),h.stroke(),h.restore();let L=g.points[0];if(1===g.points.length){h.beginPath(),h.fillStyle=A,h.arc(L.x,L.y,2,0,2*Math.PI),h.fill();return}h.save(),h.beginPath(),h.moveTo(L.x,g.zeroY),h.lineTo(L.x,L.y),d(h,g.segments),h.lineTo(g.points[g.points.length-1].x,g.zeroY),h.closePath(),h.fillStyle=j,h.fill(),h.restore(
1),h.beginPath(),h.moveTo(L.x,L.y),d(h,g.segments),h.strokeStyle=A,h.lineWidth=2,h.lineCap="round",h.lineJoin="round",h.stroke()}(e,j,t.width,t.height,C,g.upColor,g.downColor,g.upColor2,g.downColor2)}))},r="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(l);null==r||r.observe(e),r||window.addEventListener("resize",l,{passive:!0});let i="undefined"==typeof IntersectionObserver?void 0:new IntersectionObserver(i=>{var a,o;let s=null!==(o=null===(a=i[0])||void 0===a?void 0:a.isIntersecting)&&void 0!==o&&o;if(s!==t){if(t=s){null==r||r.observe(e),l();return}null==r||r.unobserve(e),n(),e.width=1,e.height=1}});null==i||i.observe(e);let u="undefined"==typeof MutationObserver?void 0:new MutationObserver(l);return null==u||u.observe(document.documentElement,{attributes:!0,attributeFilter:["data-ui-color-schema"]}),l(),()=>{null==i||i.disconnect(),null==r||r.disconnect(),null==u||u.disconnect(),window.removeEventListener("resize",l),n()}},[C,y,j,b,g.downColor,g.downColor2,g.upColor,g.upColor2]),(0,l.jsx)("span",{className:x,style:{display:"inline-block",width:b,height:y},role:"img","aria-label":"".concat(w," ").concat(h),dir:"ltr",children:(0,l.jsx)("canvas",{ref:f,className:"block h-full w-full","aria-hidden":"true","data-direction":L})})})},84588:(e,t,n)=>{"use strict";n.d(t,{A:()=>v,f:()=>g});var l=n(58474),r=n(63159),i=n(53886),a=n(13892),o=n(82357),s=n(11458),d=n(50321),c=n(23897),u=n(78961),p=n(41335);function m(){let e=(0,l._)(["\n margin-top: 32px;\n a {\n color: ",";\n }\n"]);return m=function(){return e},e}function h(){let e=(0,l._)(["\n &.unauthorized-tip-mobile {\n .lbank-modal-header {\n padding: 24px 24px 0 24px;\n }\n .lbank-modal-body {\n padding: 12px 24px;\n }\n .lbank-modal-footer {\n padding: 12px 24px 24px;\n }\n }\n"]);return h=function(){return e},e}let x=a.Ay.p(m(),d.CQ),f=(0,a.Ay)(o.default)(h()),v=(0,i.memo)(e=>{let{open:t,onCancel:n,message:l}=e,{t:i}=(0,u.A)(),{isMobile:a}=(0,p.Px)(),o=i("L0013145éå¶åºå"),d=null!=l?l:i("L6663976å°æ¬çç¨æ·æä»¬æ£æµå°æ¨å½åçI"),m=i("L0005274LBankæå¡åè®®"),h=(0,c.A)("/support/articles/21436496711705"),v=i("L0001610æç¥éäº");return(0,r.jsx)(f,{open:t,onCancel:n,title:o,closable:a,width:a?311:480,className:a?"unauthorized-tip-mobile":"",footer:(0,r.jsx)(s.A,{type:"ghost",variant:"primary",height:36,onClick:n,children:v}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:d}),(0,r.jsx)(x,{children:(0,r.jsx)("a",{href:h,target:"_blank",rel:"noreferrer",children:m})})]})})}),g=e=>{let{message:t}=e,{t:n}=(0,u.A)(),l=null!=t?t:n("L6663976å°æ¬çç¨æ·æä»¬æ£æµå°æ¨å½åçI"),i=n("L0005274LBankæå¡åè®®"),a=(0,c.A)("/support/articles/21436496711705");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:l}),(0,r.jsx)(x,{children:(0,r.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",children:i})})]})}},93809:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var l=n(63159),r=n(53886);let i=e=>{let{src:t,poster:n,autoPlay:i}=e,a=(0,r.useRef)(null),[o,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(i){var e;null===(e=a.current)||void 0===e||e.play()}},[]),(0,l.jsx)("div",{style:{position:"relative",height:"100%"},children:(0,l.jsx)("video",{ref:a,src:t,controlsList:"nodownload noremoteplayback",playsInline:!0,onContextMenu:e=>e.preventDefault(),poster:n,style:{width:"100%",height:"100%"},disablePictureInPicture:!0,controls:!0,preload:"auto",autoPlay:i,children:"Your browser does not support the video tag."})})}},39700:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var l=n(36296);let r=()=>(0,l.wX)()},38160:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var l=n(53886),r=n(46935),i=n(79013),a=n(86393);let o=e=>{let{allAssetsInfo:t}=(0,i.A)(),n=(0,a.A)(),o=(0,l.useCallback)(e=>{var l;let i=null==t?void 0:null===(l=t[r.p7.symbolConfig])||void 0===l?void 0:l[e.replace("/","_").toLowerCase()];return!n&&!!(null==i?void 0:i.maxLeverageRatio)},[t,n]);return{isTradeLeverage:o,isLeverage:o(e)}}},53864:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var l=n(53886),r=n(97371);let i=function(){let[e,t]=(0,l.useState)("");return(0,l.useEffect)(()=>{t((0,r.Oc)())},[]),e}}
1,27999:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var l=n(53886);function r(e,t,n){let r=l.useRef(null),{interval:i,onCleanUp:a}=n;return l.useEffect(()=>{let t=!1;return async function n(){try{await e()}finally{r.current=!t&&setTimeout(n,i)}}(),()=>{t=!0,clearTimeout(r.current),null==a||a()}},[...t||[],i]),[r.current]}},6090:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>M,RV:()=>I,i0:()=>R});var l=n(63159),r=n(53886),i=n(78925),a=n(76790),o=n(31412),s=n(96021),d=n(32800),c=n(47872),u=n(73900),p=n(67261),m=n(16858),h=n(62132),x=n(39593),f=n(44339),v=n(23006),g=n(58474),b=n(13892),y=n(50321),A=n(78961),j=n(30395),L=n.n(j),C=n(63870);function w(){let e=(0,g._)(["\n .futures-notice-title {\n ",";\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 19px; /* 118.75% */\n\n &.up {\n color: ",";\n }\n\n &.down {\n color: ",";\n }\n }\n\n .prep {\n display: inline-block;\n margin-left: 4px;\n color: ",";\n height: 16px;\n padding: 1px 4px;\n background: ",";\n ",";\n border-radius: 12px;\n flex-shrink: 0;\n white-space: nowrap;\n }\n"]);return w=function(){return e},e}let k=b.Ay.div(w(),(0,y.L9)(2),e=>(0,y.LG)(e),e=>(0,y.gd)(e),y.fG,y._j,e=>e.theme.bizTypography.r12),_=(0,r.memo)(e=>{let{data:t,direction:n}=e,{t:r}=(0,A.A)();return(0,l.jsx)(k,{children:(0,l.jsxs)("span",{className:L()("futures-notice-title",n),children:[m.A.getDirectionName(t,r)," ",(0,l.jsx)(C.A,{instrumentID:null==t?void 0:t.instrumentID})," ",r(t.isCrossMargin===h.iU.ISOLATED?"L0001081éä»":"L6661899å
¨ä»")," . ",t.leverage,"x",(0,l.jsx)("span",{className:"prep",children:r("L0008309æ°¸ç»")})]})})});var N=n(94402),T=n(10932),S=n(79013),E=n(34812),P=n(44923),O=n(46816);let R=()=>{let{LBPush:e}=(0,i.Cb)(),{tradeWS:t}=(0,a.pP)(),{getAssetAlias:n}=(0,S.A)(),{isLogin:l}=(0,o.Z)(),[{pushOrderList:u},p]=(0,f.d4)(e=>({pushOrderList:e.pushOrderList})),m=(0,T.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.dealPushStatus}),h=(0,T.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.dealSoundStatus}),x=(0,v.A)(m),g=(0,v.A)(h),b=(0,v.A)(u);(0,r.useEffect)(()=>{let l=t=>{if([s.I.ORDERUPDATEV2,s.I.LEVERAGEORDERV2].includes(null==t?void 0:t.type)){var l,r,i,a,o,u,m,h,f,v,y,A,j,L,C,w,k;if((null===(l=t.orderUpdate)||void 0===l?void 0:l.orderStatus)===2){let[l,s]=((null==t?void 0:null===(r=t.orderUpdate)||void 0===r?void 0:r.symbol)||"").split("_"),_=n(l),N=n(s),T=(null==t?void 0:null===(i=t.orderUpdate)||void 0===i?void 0:i.avgPrice)||"";(null==t?void 0:null===(a=t.orderUpdate)||void 0===a?void 0:a.uuid)&&p({pushOrderList:b.current.add(null==t?void 0:null===(k=t.orderUpdate)||void 0===k?void 0:k.uuid)}),null==e||e.tradeOrderDeal({symbol:"".concat(_,"_").concat(N)||"",rawSymbol:(null==t?void 0:null===(o=t.orderUpdate)||void 0===o?void 0:o.symbol)||"",orderId:(null==t?void 0:null===(u=t.orderUpdate)||void 0===u?void 0:u.uuid)||"",delegateType:(null==t?void 0:null===(m=t.orderUpdate)||void 0===m?void 0:m.oco)===!0?c.ht.OCO:(null==t?void 0:null===(h=t.orderUpdate)||void 0===h?void 0:h.type)===d.MF.LIMIT?c.ht.LIMIT:(null==t?void 0:null===(f=t.orderUpdate)||void 0===f?void 0:f.type)===d.MF.MARKET?c.ht.MARKET:c.ht.PLAN,price:T,postUnit:N||"",baseUnit:_||"",pushTradeType:(null==t?void 0:null===(v=t.orderUpdate)||void 0===v?void 0:v.side)||"",direction:(null==t?void 0:null===(y=t.orderUpdate)||void 0===y?void 0:y.side)==="buy"?"up":"down",amount:(null==t?void 0:null===(A=t.orderUpdate)||void 0===A?void 0:A.type)===d.MF.MARKET&&(null==t?void 0:null===(j=t.orderUpdate)||void 0===j?void 0:j.side)==="buy"?(null==t?void 0:null===(L=t.orderUpdate)||void 0===L?void 0:L.dealQty)||"":(null==t?void 0:null===(C=t.orderUpdate)||void 0===C?void 0:C.amount)||"",dealTime:(null==t?void 0:null===(w=t.orderUpdate)||void 0===w?void 0:w.updateTime)||0,setting:{pushStatus:!!x.current,soundStatus:!!g.current}})}}};t.onReciveMessage(l);let r=t.getOrderUpdateV2WS();return()=>{r(),t.onNoReciveMessage(l)}},[l,t.getOrderUpdateV2WS])},I=()=>{let{isLogin:e}=(0,o.Z)(),{LBPush:t}=(0,i.Cb)(),n=(0,O.Ay)(),a=(0,T.bp)(e=>{var t,n;return null===(n=null===(t=e.futures)||void 0===t?void 0:t.dealSoundStatus)||void 0===n||n}),s=(0,T.bp)(e=>{var t,n;return null===(n=null===(t=e.futures)||void 0===t?void 0:t.dealPushStatus)||void 0===n||n}),d=(0,r.useMemo)(()=>({soundStatus:a,pushStatus:s}),[a,s]),{addOrdersPushedIDs:f}=(0,x.A)(),g=(0,v.A)(d);(0,u.X)(e=>{if(e.topic===p.KK.Order){var r,i,a,o;let s;let d=null===(i=e.data)||void 0===i?void 0:null===(r=i.slice(-1))||void 0===r?void 0:r[0];if(!d||(0,P.WF)(d))return;let u=m.A.isLimit(d),p=d.direction===h.qq.BUY;
1if(d.posiDirection===h.V9.NET)s=p?"up":"down";else switch(d.offsetFlag){case h.wH.OPEN:case h.wH.CLOSE_ALL:case h.wH.CLOSE:case h.wH.CLOSE_MAX:case h.wH.FORCE_CLOSE:s=p?"up":"down"}let x=n[d.instrumentID],v=(null==x?void 0:x.pricePrecision)||0,b=(null==x?void 0:x.volumePrecision)||0,y=d.offsetFlag===h.wH.FORCE_CLOSE;u&&"1"===d.orderStatus&&(f(d.orderSysID),null==t||t.futureOrderDeal({symbol:d.instrumentID||"",delegateType:d.orderPriceType===h.SJ.ANY||d.orderPriceType===h.SJ.MARKET?c.ht.MARKET:c.ht.LIMIT,price:"".concat((0,N.zJ)((y?d.triggerPrice:d.tradePrice)||"",v)),postUnit:"USDT",amount:"".concat((0,N.zJ)(d.volume||"",b)),baseUnit:null!==(a=(0,E.d)(x))&&void 0!==a?a:"",orderId:null!==(o=d.orderSysID)&&void 0!==o?o:"",pushTradeType:d.direction===h.qq.BUY?c.Z8.BUY:c.Z8.SELL,setting:g.current,titleRender:(0,l.jsx)(_,{data:d,direction:s}),direction:s,dealTime:1e3*Number(d.updateTime)}))}},!!e)},M=i.Cb},16858:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var l=n(70509),r=n(62132),i=n(94999);let a=e=>(null==e?void 0:e.triggerOrderType)===r.Ve.PLAN,o=e=>(null==e?void 0:e.triggerOrderType)===r.Ve.POSITION_STOP_PROFIT_LOSS||(null==e?void 0:e.triggerOrderType)===r.Ve.ORDER_STOP_PROFIT_LOSS,s=e=>(null==e?void 0:e.triggerOrderType)==null,d=e=>s(e)?r.ZN.LIMIT:a(e)?r.ZN.PLAN:r.ZN.STOP_PROFIT_LOSS,c={isPlan:a,isTpsl:o,isLimit:s,isNewPlan:e=>a(e)&&e.orderSysID.startsWith("n"),isOrderTpsl:e=>
1!!e.relatedOrderSysID&&o(e),getOrderType:d,getOrderTypeName:(e,t)=>s(e)?t(e.orderPriceType===r.SJ.MARKET?"L0000552å¸ä»·":"L0000258éä»·"):a(e)?t("L0013322计å"):o(e)?t("L0002596æ¢çæ¢æ"):"--",shortenOrderID:function(e){return e.replace(/^(.{3}).+(.{3})$/,"$1...$2")},filterTplsOrders:e=>null==e?void 0:e.filter(o),convertToOrderItem(e){let t={};return Object.keys(e).forEach(n=>{t[n.replace(/^(SL|TP|[A-Z])/,(e,t)=>t.toLowerCase())]=e[n]}),t.orderType=d(t),t},isBuy:e=>e.direction===r.qq.BUY,getDirectionName(e){let t,{direction:n,offsetFlag:i,posiDirection:a}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.t,s=c.isBuy({direction:n});if(a===r.V9.NET?t=r.CR.SINGLE_WAY:a&&(t=r.CR.BOTH_WAY),t===r.CR.SINGLE_WAY)return o(i===r.wH.FORCE_CLOSE?s?"L0007771ä¹°å
¥å¼ºå¹³":"L0007772ååºå¼ºå¹³":s?"L0001930ä¹°å
¥":"L0001931ååº");switch(i){case r.wH.OPEN:return o(s?"L0001072å¼å¤":"L0001073å¼ç©º");case r.wH.CLOSE_ALL:case r.wH.CLOSE:case r.wH.CLOSE_MAX:return o(s?"L0001228平空":"L0001227å¹³å¤");case r.wH.FORCE_CLOSE:return o(s?"L0007725强å¶å¹³ç©º":"L0007726强å¶å¹³å¤");default:return""}},getHistoryDirectionName(e){let{direction:t,offsetFlag:n}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.t,a=t===r.qq.BUY;switch(n){case r.wH.OPEN:return a?"".concat(i("L0007863ä¹°å
¥å¼ä»")):"".concat(i("L0007865ååºå¼ä»"));case r.wH.CLOSE_ALL:case r.wH.CLOSE:case r.wH.CLOSE_MAX:return i(a?"L0007864ä¹°å
¥å¹³ä»":"L0007866ååºå¹³ä»");case r.wH.FORCE_CLOSE:return i(a?"L0007771ä¹°å
¥å¼ºå¹³":"L0007772ååºå¼ºå¹³");default:return""}},getStatusName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.t;switch(e){case r._n.ALL_TRADE:return t("L0001196å
¨é¨æäº¤");case r._n.PARTIAL_TRADE:return t("L0002158é¨åæäº¤");case r._n.PARTIAL_TRADE_PARTIAL_REVOKE:return t("L0007173é¨åæäº¤å·²æ¤é");case r._n.UNSOLD:return t("L0000400æªæäº¤");case r._n.ALL_REVOKE:return t("L0000070å·²æ¤é");default:return t("L0007172æªç¥ç¶æ")}},getTypeName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.t;switch(e){case r.Ve.POSITION_STOP_PROFIT_LOSS:return t("L0007154æä»æ¢çæ¢æ");case r.Ve.ORDER_STOP_PROFIT_LOSS:return t("L0007155è®¢åæ¢çæ¢æ");case r.Ve.PLAN:return t("L0007112计åå§æ");default:return}},getTriggerStatusName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.t;switch(e){case r.FG.NOT_IN_QUEUE:return t("L0007174å¾
çæ");case r.FG.NOT_TRIGGER:return t("L0007755å·²çæ");case r.FG.TRIGGER_SUCCESS:return t("L0007175触åæå");case r.FG.TRIGGER_FAILED:return t("L0007176触å失败");case r.FG.REVOKE:return t("L0000070å·²æ¤é");default:return}},getPartialTpslList:(e,t)=>{var n;return null===(n=c.filterTplsOrders(t))||void 0===n?void 0:n.filter(t=>{let n=t.triggerOrderType===r.Ve.POSITION_STOP_PROFIT_LOSS&&t.positionID===e.positionID,l=t.triggerOrderType===r.Ve.ORDER_STOP_PROFIT_LOSS&&(t.relatedOrderSysI
1D===e.positionID||t.positionID===e.positionID);return(n||l)&&t.orderSysID!==e.closeOrderSysID&&!(0,i.A)(t)})}},u=c},30459:(e,t,n)=>{"use strict";let l;n.r(t),n.d(t,{__N_SSG:()=>sb,default:()=>sy});var r,i=n(63159),a=n(53886),o=n.n(a),s=n(76790),d=n(44339),c=n(50085),u=n(58474),p=n(40887),m=n(13892),h=n(60583),x=n(34456),f=n(41335),v=n(22840),g=n(32271),b=n(31412);let y=()=>{let{isLogin:e}=(0,b.A)(),{setInnovationTradePromptStatus:t}=(0,g.Pj)(e=>({status:e.innovationTradePromptStatus,setInnovationTradePromptStatus:e.setInnovationTradePromptStatus}));(0,a.useEffect)(()=>{!1===e&&t(!1)},[e])};var A=n(57095),j=n(69902),L=n(86393),C=n(35260),w=n(43175),k=n(54269),_=n(91985),N=n(66328),T=n(11458),S=n(78961),E=n(76025),P=n(60410);function O(){let e=(0,u._)(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"]);return O=function(){return e},e}function R(){let e=(0,u._)(["\n color: #fff;\n font-size: 40px;\n margin-top: 10px;\n"]);return R=function(){return e},e}function I(){let e=(0,u._)(["\n color: rgba(255, 255, 255, 0.8);\n font-size: 25px;\n font-weight: lighter;\n"]);return I=function(){return e},e}function M(){let e=(0,u._)(["\n width: 305px;\n height: 46px;\n margin-top: 65px;\n span {\n transform: translateY(-1px);\n padding-right: 6px;\n }\n"]);return M=function(){return e},e}let z=m.Ay.div(O()),F=m.Ay.p(R()),D=m.Ay.p(I()),U=(0,m.Ay)(T.A)(M()),B=function(e){let{message:t}=e,n=(0,_.A)(),{t:l}=(0,S.A)(),r=(0,a.useCallback)(()=>{n.push("/")},[]);return(0,i.jsxs)(z,{style:{minHeight:630},children:[(0,i.jsx)(N.Ay,{src:"/assets/404/404.png",width:366,height:145,alt:""}),(0,i.jsx)(F,{children:l("L0007735ç³ç³")}),t&&(0,i.jsx)(D,{children:t}),(0,i.jsxs)(U,{onClick:r,children:[(0,i.jsx)("span",{children:l("L0007737è¿å主页")}),(0,i.jsx)(E.A,{children:(0,i.jsx)(P.A,{})})]})]})};var q=n(96657),H=n(54558),Z=n.n(H),G=n(38890),W=n.n(G),V=n(50321),Q=n(94402),Y=n(38437),K=n(79710),$=n(79573),X=n(77781),J=n(12692),ee=n(17155),et=n(70361),en=n(82491
1),el=n(59678),er=n(6419),ei=n(63618),ea=n(23006),eo=n(60539),es=n(70085),ed=n(33024),ec=n(1128),eu=n(28177),ep=n(98435),em=n(31256),eh=n(92406),ex=n(25894),ef=n(68208),ev=n(42918),eg=n(81491),eb=n(87776),ey=n(38160),eA=n(63240),ej=n(82416),eL=n(77730),eC=n(27484);function ew(){let e=(0,u._)(["\n .interestRate-title {\n color: ",";\n ",";\n margin-bottom: 16px;\n }\n\n .interestRate-wrapper {\n ",";\n\n &:not(:last-child)::after {\n content: '';\n display: block;\n height: 1px;\n width: 100%;\n background: ",";\n margin: 14px 0;\n }\n\n .interestRate-item {\n ",";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n\n color: ",";\n ",";\n\n &-subtitle {\n color: ",";\n }\n\n &-value {\n flex: 1;\n text-align: right;\n white-space: nowrap;\n }\n }\n }\n"]);return ew=function(){return e},e}let ek=(0,m.Ay)(er.A)(ew(),V.vZ,e=>e.theme.bizTypography.r16,(0,V.Gb)(14),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizLine.line2},(0,V.SW)(6),V.vZ,e=>e.theme.bizTypography.r14,V.fG),e_=e=>{let{finalHourlyInterestRates:t}=e,{t:n}=(0,S.A)();return(0,i.jsxs)(ek,{children:[(0,i.jsx)("div",{className:"interestRate-title",children:n("L0002812å©ç")}),t.map((e,t)=>(0,i.jsxs)("div",{className:"interestRate-wrapper",children:[(0,i.jsxs)("div",{className:"interestRate-item",children:[(0,i.jsx)("div",{className:"interestRate-item-title",children:(0,i.jsx)(eC.default,{symbol:null==e?void 0:e.assetCode,type:"coin",showLogo:!0,showArrow:!1,fontSize:14,logoSize:16,delayCheckVisible:!0,enableLazy:!1})}),(0,i.jsx)("div",{className:"interestRate-item-value",children:n("L0016744å°æ¶å©çå¹´åå©ç")})]}),(0,i.jsxs)("div",{className:"interestRate-item",children:[(0,i.jsx)("div",{className:"interestRate-item-subtitle ",children:n("L0016661å½åå©ç")}),(0,i.jsxs)("div",{className:"interestRate-item-value",children:[(0,i.jsxs)(em.A,{children:[e.hourlyInterestRate,"%"]}),"/",(0,i.jsxs)(em.A,{children:[e.yearlyInterestRate,"%"]})]})]})]},(null==e?void 0:e.assetCode)+t))]})};var eN=n(44410);let eT=(0,a.createContext)({etfNetValue:null,activate:()=>()=>{},resetETFNetValue:()=>{}}),eS=()=>{let{etfNetValue:e,activate:t,resetETFNetValue:n}=(0,a.useContext)(eT);return(0,a.useEffect)(()=>t(),[]),[e,n]};var eE=n(37849),eP=n(40487);function eO(){let e=(0,u._)([""]);return eO=function(){return e},e}function eR(){let e=(0,u._)(["\n color: ",";\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n\n li {\n display: flex;\n }\n\n .more_notice {\n display: inline-block;\n color: ",";\n padding-top: 12px;\n cursor: pointer;\n user-select: none;\n font-size: 12px;\n overflow: hidden;\n }\n"]);return eR=function(){return e},e}let eI=m.Ay.div(eO()),eM=m.Ay.div(eR(),V.vZ,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizState.link[1]}),ez=()=>{let{t:e}=(0,S.A)(),[{postArea:t,tradeSymbol:n}]=(0,d.d4)(e=>({postArea:e.postArea,tradeSymbol:e.exchangeState.tradeSymbol,tradeTicker:e.tradeTicker})),l=(0,a.useMemo)(()=>(null==n?void 0:n.indexOf("3"))>-1?"L00045143L表示æ ç交æå¯¹ä»·æ ¼ä¸æ¶¨1该":(null==n?void 0:n.indexOf("5"))>-1?"L00049745L表示æ ç交æå¯¹ä»·æ ¼ä¸æ¶¨1该":"L00045143L表示æ ç交æå¯¹ä»·æ ¼ä¸æ¶¨1该",[n]),r=(0,a.useMemo)(()=>(null==n?void 0:n.indexOf("3"))>-1?"L00045153S表示æ ç交æå¯¹ä»·æ ¼ä¸è·1该":(null==n?void 0:n.indexOf("5"))>-1?"L00049755S表示æ ç交æå¯¹ä»·æ ¼ä¸è·1该":"L00045153S表示æ ç交æå¯¹ä»·æ ¼ä¸è·1该",[n]);return"ETF"===t?(0,i.jsx)(eu.A,{placement:"bottomLeft",stretch:"maxWidth",popupWidth:280,content:(0,i.jsxs)(eM,{children:[(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:[(0,i.jsx)(eI,{children:"1."}),e(l)]}),(0,i.jsxs)("li",{children:[(0,i.jsx)(eI,{children:"2."}),e(r)]}),(0,i.jsxs)("li",{children:[(0,i.jsx)(eI,{children:"3."}),e("L0004516å弿£å¸¸æ¯å¤©0ç¹è¿è¡è°æ´æç«¯è¡")]}),(0,i.jsxs)("li",{children:[(0,i.jsx)(eI,{children:"4."}),e("L0004517æ¯åæ æå°æå¤©æ¶åç¸åºç管çè´¹")]}),(0,i.jsxs)("li",{children:[(0,i.jsx)(eI,{children:"5."}),e("L0004518交æåè¯·æ³¨ææ¥çåå¼è¯¥äº§å卿")]})]}),(0,i.jsx)(eP.A,{className:"more_notice",target:"_blank",href:"/support/articles/21429016179609",rel:"noreferrer",children:e("L0000956æ´å¤è¯¦æ
请æ¥çå
Œ")})]}),children:(0,i.jsx)("span",{className:"etf_area",slot:"reference",children:(0,i.jsx)(ex.A,{bordered:!0,children:(0,i.jsx)(eE.A,{className:"icon",style:{fontSize:"16px"}})})})}):null};var eF=n(73975);function eD(){let e=(0,u._)(["\n display: none !important;\n "]);return eD=function(){return e},e}function eU(){let e=(0,u._)(["\n ","\n\n flex: 1;\n min-width: 0;\n\n .content {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n min-width: 10px;\n overflow: hidden;\n height: 32px;\n .item,\n .tooltip-item,\n .wrap-item {\n width: fit-content;\n position: relative;\n &:not(:last-child) {\n margin-right: 32px;\n }\n }\n }\n\n .more {\n position: absolute;\n top: 50%;\n right: -32px;\n padding: 2px;\n cursor: pointer;\n margin-top: -12px;\n width: 24px;\n height: 24px;\n color: ",";\n .lbank-icon-more {\n transform: rotate(90deg);
1\n width: 20px;\n height: 20px;\n }\n }\n"]);return eU=function(){return e},e}function eB(){let e=(0,u._)(["\n .change_price {\n font-size: 14px;\n font-style: normal;\n font-weight: 700;\n line-height: 16px; /* 114.286% */\n }\n\n .change_per {\n margin-top: 2px;\n ",";\n\n .change_p {\n margin-right: 2px;\n }\n }\n"]);return eB=function(){return e},e}function eq(){let e=(0,u._)(["\n && {\n width: 280px;\n max-width: 280px;\n .lbank-tooltip-content {\n padding: 16px;\n }\n }\n\n .more_tooltip-item {\n display: flex;\n align-items: center;\n width: 100%;\n }\n .item,\n .tooltip-item {\n display: flex;\n align-items: center;\n width: 100%;\n &:not(:last-child) {\n margin-bottom: 12px;\n }\n }\n .label {\n color: ",";\n font-size: 12px;\n line-height: 14px;\n white-space: nowrap;\n margin-right: 12px;\n ","\n }\n\n .value {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n line-height: 14px;\n white-space: nowrap;\n display: flex;\n flex: 1;\n text-align: right;\n justify-content: end;\n }\n\n .warning_color {\n color: ",";\n font-weight: 400;\n + span {\n font-weight: 400;\n min-width: 56px;\n }\n }\n"]);return eq=function(){return e},e}function eH(){let e=(0,u._)(["\n display: flex;\n flex-direction: column;\n width: fit-content;\n white-space: nowrap;\n .indicator_title {\n color: ",";\n ",";\n\n &.hourly {\n ","\n }\n\n &.dashed {\n ","\n &:hover {\n color: ",";\n ","\n text-decoration-color: ",";\n }\n }\n }\n\n .indicator_value {\n margin-top: 4px;\n min-width: 65px;\n color: ",";\n ",";\n }\n"]);return eH=function(){return e},e}function eZ(){let e=(0,u._)(["\n display: none;\n "]);return eZ=function(){return e},e}function eG(){let e=(0,u._)(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px 0;\n\n ","\n\n .item, .normal {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n }\n\n .normal {\n width: 100%;\n }\n\n .label {\n color: ",";\n font-size: 12px;\n line-height: 14px;\n word-break: break-word;\n\n span {\n text-underline-offset: 2px !important;\n }\n }\n\n .value {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n line-height: 14px;\n white-space: nowrap;\n align-items: center;\n padding-left: 3px;\n display: flex;\n flex: 1;\n text-align: right;\n justify-content: end;\n }\n\n .warning_color {\n color: ",";\n font-weight: 400;\n + span {\n font-weight: 400;\n // min-width: 56px;\n }\n }\n"]);return eG=function(){return e},e}function eW(){let e=(0,u._)(["\n flex-basis: 50%;\n padding: 4px 0 0 12px;\n overflow: hidden;\n\n .item,\n .tooltip-item {\n flex-basis: 100%;\n }\n"]);return eW=function(){return e},e}function eV(){let e=(0,u._)(["\n flex-basis: 100%;\n margin-top: 10px;\n\n .item,\n .tooltip-item {\n flex-basis: 50%;\n\n &:nth-child(even) {\n padding-left: 12px;\n }\n\n &:nth-child(odd) {\n padding-right: 12px;\n }\n }\n"]);return eV=function(){return e},e}function eQ(){let e=(0,u._)(["\n display: none !important;\n "]);return eQ=function(){return e},e}function eY(){let e=(0,u._)(["\n flex: 1;\n min-width: 0;\n ","\n\n .content {\n margin-right: 48px;\n }\n\n .follow-button.lbank-btn-secondary.lbank-btn-ghost {\n padding: 0 !important;\n }\n\n .follow-button {\n .lbank-icon {\n width: 16px;\n height: 16px;\n font-size: 16px;\n }\n }\n"]);return eY=function(){return e},e}function eK(){let e=(0,u._)(["\n position: absolute;\n padding: 0 4px;\n height: 8px;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n border-radius: 1px;\n cursor: pointer;\n background: ",";\n\n .icon {\n font-size: 14px;\n transition: all 0.2s ease-out;\n transform: ",";\n }\n"]);return eK=function(){return e},e}function e$(){let e=(0,u._)(["\n display: none !important;\n "]);return e$=function(){return e},e}function eX(){let e=(0,u._)(["\n flex-basis: 50%;\n overflow: hidden;\n ","\n"]);return eX=function(){return e},e}let eJ=(0,m.Ay)(er.A)(eU(),(0,V.FE)({mobile:(0,h.AH)(eD())}),V.vZ),e0=m.Ay.div(eB(),e=>e.theme.bizTypography.m12),e1=(0,m.Ay)(eu.A)(eq(),V.fG,(0,V.L9)(3),V.vZ,V.xY),e2=(0,m.Ay)(er.A)(eH(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>e.theme.bizTypography.r12,(0,V.z2)(1,3),(0,V.z2)(1,3),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1},(0,V.z2)(1,3),V.vZ,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1},e=>e.theme.bizTypography.m12),e6=m.Ay.div(eG(),(0,V.FE)({notMobile:(0,h.AH)(eZ())}),V.fG,V.vZ,V.xY),e4=(0,m.Ay)(e6)(eW()),e3=(0,m.Ay)(e6)(eV()),e5=(0,m.Ay)(er.A)(eY(),f.XG.mobile((0,h.AH)(eQ()))),e8=(0,m.Ay)(ed.A)(eK(),V._j,e=>e.fold?"none":"rotate(180deg)"),e7=m.Ay.div(eX(),(0,V.FE)({notMobile:(0,h.AH)(e$())})),e9=(0,eb.A)(ef.A),te=e=>{let{isOpenStatus:t,datas:n,mobileData:l,quoteCode:r="",baseCode:o="",tradeArea:s,symbol:c,assetItem:u}=e,p=(0,_.A)(),{t:m}=(0,S.A)(),[h,{width:x}]=(0,eL.A)(),{mounted:f}
1=(0,Y.A)(),v=(0,en.A)(),[b,y]=(0,a.useState)("--"),{lgtSymbol:A,rate:j}=(0,eh.A)(),[C]=eS(),{tradingType:w}=(0,g.Pj)(e=>({tradingType:e.tradingType})),[{tradeAsset:k,tradePost:N,tradeSymbol:T,tradePostAlias:E,tradeAssetAlias:P,tradeTicker:O}]=(0,d.d4)(e=>{var t,n,l;return{tradeSymbol:null===(t=e.exchangeState)||void 0===t?void 0:t.tradeSymbol,tradePostAlias:null===(n=e.exchangeState)||void 0===n?void 0:n.tradePostAlias,tradeAssetAlias:null===(l=e.exchangeState)||void 0===l?void 0:l.tradeAssetAlias,tradeTicker:e.tradeTicker,tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost}}),{isLeverage:R}=(0,ey.A)(T),[I,M]=(0,a.useState)(0),[z,F]=(0,a.useState)(!0),D=(0,ea.A)(s),U=(0,eF.uR)(v),B=(0,L.A)();(0,a.useEffect)(()=>{"ETF"!==D.current&&k&&"--"!==k&&eA.Ay.getSeoCoinCenterCoinMarketInfoList({symbolInList:k}).then(e=>{var t;M((null==e?void 0:null===(t=e[0])||void 0===t?void 0:t.marketCap)||0)})},[k]),(0,a.useEffect)(()=>{"ETF"===D.current&&T&&eA.Ay.getSpotTradeCenterEtfManagementRate({symbol:T}).then(e=>{e.managementRate&&y("".concat(100*Number(e.managementRate),"%"))})},[T]);let H=(0,a.useMemo)(()=>[{assetCode:k,hourlyInterestRate:(0,eg.UB)(null==n?void 0:n.baseHourlyInterestRate)?(0,Q.gO)((0,q.A)(n.baseHourlyInterestRate||0).times(100).toFixed(),8):"--",yearlyInterestRate:(0,eg.UB)(null==n?void 0:n.baseHourlyInterestRate)?(0,Q.gO)((0,q.A)(n.baseHourlyInterestRate||0).times(876e3).toFixed(),8):"--"},{assetCode:N,hourlyInterestRate:(0,eg.UB)(null==n?void 0:n.quoteHourlyInterestRate)?(0,Q.gO)((0,q.A)(n.quoteHourlyInterestRate||0).times(100).toFixed(),8):"--",yearlyInterestRate:(0,eg.UB)(null==n?void 0:n.quoteHourlyInterestRate)?(0,Q.gO)((0,q.A)(n.quoteHourlyInterestRate||0).times(876e3).toFixed(),8):"--"}],[n.baseHourlyInterestRate,n.quoteHourlyInterestRate]),Z=[{label:(0,i.jsx)(i.Fragment,{children:m("L000003424Hæé«ä»·")}),value:(0,i.jsx)(em.A,{children:(0,Q.Qr)((null==n?void 0:n.hPrice)||"0")})},{label:(0,i.jsx)(i.Fragment,{children:m("L000003524Hæä½ä»·")}),value:(0,i.jsx)(em.A,{children:(0,Q.Qr)((null==n?void 0:n.lPrice)||"0")})},{label:(0,i.jsxs)(i.Fragment,{children:[m("L000465524Hæäº¤é"),(null==n?void 0:n.vol)!=="--"&&" (".concat(f?null==P?void 0:P.toUpperCase():null==o?void 0:o.toUpperCase(),")")]}),value:(0,i.jsx)("span",{children:O?(0,Q.qw)(null==n?void 0:n.vol):"--"})},{label:(0,i.jsxs)(i.Fragment,{children:[m("L000431524Hæäº¤é¢"),(null==n?void 0:n.amount)!=="--"&&" (".concat(f?null==E?void 0:E.toUpperCase():null==r?void 0:r.toUpperCase(),")")]}),value:(0,i.jsx)("span",{children:O?(0,Q.qw)(null==n?void 0:n.amount):"--"})}];if("ETF"!==D.current&&I&&(0,eg.UB)(I)&&!(0,eg.w6)(I)&&Z.push({label:(0,i.jsx)(i.Fragment,{children:m("L0013614å¸å¼")}),value:(0,i.jsxs)(em.A,{children:[A,(0,Q.al)(+(I||0),j)]})}),!v&&f&&Z.unshift({label:(0,i.jsx)(i.Fragment,{children:m("L0013604æ³å¸æå")}),value:(0,i.jsx)("span",{children:(null==n?void 0:n.price)!=="--"?(0,i.jsxs)(em.A,{children:[A,(0,Q.al)(+n.price*(+n.toUsd||0),j)]}):"--"})}),"ETF"===D.current){if(v){var G,W;Z.push({label:(0,i.jsx)("li",{children:(0,i.jsx)(ep.A,{stretch:"maxWidth",popupWidth:280,placement:"bottomRight",title:(0,i.jsx)(em.A,{children:m("L0004519åå¼ä¸ä¸ªè°æ´æ¶ç¹çåå¼13ç°è´§",{0:(null===(W=p.query)||void 0===W?void 0:null===(G=W.id)||void 0===G?void 0:G.includes("5"))?5:3})}),children:(0,i.jsx)(e2,{style:{cursor:"pointer"},children:(0,i.jsx)("p",{className:"indicator_title dashed",children:m("L0000950åå¼")})})})}),value:(0,i.jsx)("span",{className:"indicator_value",children:t?0===C?0:C||"--":"--"})})}Z.push({label:(0,i.jsx)("li",{children:(0,i.jsx)(ep.A,{stretch:"maxWidth",popupWidth:280,placement:"bottomRight",title:(0,i.jsx)(eM,{children:m("L0004617ETFåºéç»åæ¯åæ ææ¯æ¥ä¼æ¶")}),children:(0,i.jsx)(e2,{style:{cursor:"pointer"},children:(0,i.jsx)("p",{className:"indicator_title dashed",children:m("L0004616管çè´¹ç")})})})}),value:(0,i.jsx)("span",{className:"indicator_value",children:b})})}w===eN.Nn.leverage&&R&&Z.push({label:(0,i.jsx)("p",{className:"indicator_title hourly",children:m("L0006861å°æ¶å©ç")}),value:(0,i.jsx)(em.A,{children:(null==n?void 0:n.hourlyInterestRate)&&(null==n?void 0:n.hourlyInterestRate)!=="--"?"".concat((0,Q.gO)((0,q.A)((null==n?void 0:n.hourlyInterestRate)||0).times(100).toFixed(),8),"%"):"--"}),renderTooltip:(e,t)=>(0,i.jsx)(eu.A,{stretch:"maxWidth",popupWidth:290,placement:"bottomLeft",action:v?"click":"hover",content:(0,i.jsx)(e_,{finalHourlyInterestRates:H}),children:(0,i.jsx)(e2,{className:"tooltip-item",style:{cursor:"pointer",width:"100%"},children:e})},t)}),v||B||Z.push({label:(0,i.jsx)("p",{className:"indicator_title",children:m("L0020962å¸ç§æ ç¾")}),value:(0,i.jsx)(ej.A,{symbol:(null==u?void 0:u.symbol)||"",tradeArea:s||"",type:K.nP.SPOT}),key:"symbolTags"});let[V,$]=(0,a.useState)(-1),X=(0,a.useRef)(null),J=(0,ei.default)(()=>{let e=X.current;if(e){let t=e.querySelectorAll(".item"),n=!1;for(let e=0;e<t.length;e++)if(t[e].offsetTop>16){$(e),n=!0;break}n||$(-1)}}),ee=(0,a.useRef)();(0,eo.A)(()=>{var e,t;(null===(e=X.current)||void 0===e?void 0:e.offsetWidth)!==ee.current&&(ee.current=null===(t=X.current)||void 0===t?void 0:t.offsetWidth,J())}),(0,es.A)("resize",()=>{J()},globalThis),(0,a.useEffect)(()=>{setTimeout(()=>{$(-1),J()},100)},[w,x,m,Z.length]),(0,a.useEffect)(()=>{let e=0,t=setInterval(()=>{e<10?(e+=1,J()):clearInterval(t)},500)},[]);let et=(0,a.useCallback)((e,t)=>"symbolTags"===e.key?(0,a.isValidElement)(e.value)&&(0,a.isValidElement)(e.value)?(0,a.cloneElement)(e.value,{wrapper:n=>(0,i.jsxs)(e2,{children:[(0,i.jsx)("div",{className:"indicator_title",children:e.label}),(0,i.jsx)("div",{className:"indicator_value",children:n})]},t)}):"":(0,i.jsxs)(e2,{children:[(0,i.jsx)("div",{className:"indicator_title",children:e.label}),(0,i.jsx)("div",{className:"indicator_value",children:e.value})]},t),[V,Z]),ef=(0,ei.default)(e=>-1!==V&&V-1===e?(0,i.jsx)(e1,{className:"more_tooltip",placement:"bottomRight",content:(0,i.jsx)(i.Fragment,{children:Z.slice(V).map((e,t)=>"symbolTags"===e.key?(0,a.isValidElement)(e.value)?(0,a.cloneElement)(e.value,{collapse:!0,posRight:0,wrapper:n=>(0,i.jsx)("div",{className:"item",children:e.renderTooltip?e.renderTooltip((0,i.jsxs)("ul",{className:"more_tooltip-item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:n})]},t),t):(0,i.jsxs)("ul",{className:"item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:n})]},t)})}):"":(0,i.jsx)("div",{className:"item",children:e.renderTooltip?e.renderTooltip((0,i.jsxs)("ul",{className:"more_tooltip-item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:e.value})]},t),t):(0,i.jsxs)("ul",{className:"item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:e.value})]},t)}))}),children:(0,i.jsx)("li",{className:"more",children:(0,i.jsx)(ex.A,{children:(0,i.jsx)(ec.A,{})})})}):null),eb=(0,a.useCallback)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"symbolTags"===e.key?(0,a.isValidElement)(e.value)?(0,a.cloneElement)(e.value,{collapse:!0,posRight:0,wrapper:l=>(0,i.jsxs)("ul",{className:n?"normal":"item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:l})]},t)}):"":(0,i.jsxs)("ul",{className:n?"normal":"item",children:[(0,i.jsx)("li",{className:"label",children:e.label}),(0,i.jsx)("li",{className:"value",children:e.value})]},t)},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e7,{children:(0,i.jsx)(e9,{symbol:c||T,type:"spot",tradeArea:D.current,data:l,showGuide:v,guideConfig:U})}),(0,i.jsx)(e4,{children:Z.slice(0,4).map((e,t)=>e.renderTooltip?e.renderTooltip(eb(e,t,!0),t):eb(e,t))}),z?null:(0,i.jsx)(e3,{children:Z.slice(4).map((e,t)=>e.renderTooltip?e.renderTooltip(eb(e,t,!0),t):eb(e,t))}),v&&Z.length>4?(0,i.jsx)(e8,{fold:z,onClick:()=>F(e=>!e),children:(0,i.jsx)(ed.A,{className:"icon"})}):null,(0,i.jsxs)(e5,{size:28,inline:!0,blockRef:e=>h(e),children:[(0,i.jsxs)(er.A,{size:16,inline:!0,align:"center",children:[(0,i.jsx)(e9,{symbol:c||T,type:"spot",tradeArea:D.current,assetItem:u,showGuide:!v,guideConfig:U}),(0,i.jsx)(ez,{}),(0,i.jsx)(ev.A,{symbol:T,bordered:!0}
1)]}),(0,i.jsxs)(eJ,{inline:!0,size:32,justify:"space-between",align:"center",children:[(0,i.jsx)(e0,{children:(0,i.jsxs)(el.A,{className:"symbol_price",change:null==n?void 0:n.change,children:[(0,i.jsx)("div",{className:"change_price",children:(0,i.jsx)(em.A,{children:(0,Q.Qr)((0,Q.Fl)(n,"price"))})}),(0,i.jsxs)("div",{className:"change_per",children:[(0,i.jsx)("span",{className:"change_p",children:null==n?void 0:n.changePrice}),(0,i.jsxs)(em.A,{children:["(",(0,Q.l9)((null==n?void 0:n.change)&&(null==n?void 0:n.change)!=="--"?(0,q.A)(null==n?void 0:n.change).div(100).toString():"--"),")"]})]})]})}),(0,i.jsx)("div",{className:"content",ref:X,children:Z.map((e,t)=>(0,i.jsxs)("div",{className:"item",children:[e.renderTooltip?e.renderTooltip(et(e,t),t):et(e,t),ef(t)]}))})]})]})]})};var tt=n(98528),tn=n(22152),tl=n(57081),tr=n(10932),ti=n(97371),ta=n(58574),to=n(10840),ts=n(3007),td=n(73408),tc=n(32800);let tu=(0,a.memo)(()=>{let{t:e}=(0,S.A)(),t=(0,_.A)(),[n]=(0,td.A)(),{isLogin:l}=(0,b.Z)(),{tradingType:r}=(0,g.Pj)(e=>({tradingType:e.tradingType})),[{tradeSymbol:o}]=(0,d.d4)(e=>{var t;return{tradeSymbol:null===(t=e.exchangeState)||void 0===t?void 0:t.tradeSymbol}}),s=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.limitOrderConfirm}),c=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.marketOrderConfirm}),u=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.limitProfitLossOrderConfirm}),p=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.ocoOrderConfirmStatus}),m=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.dealPushStatus}),h=(0,tr.bp)(e=>{var t;return null===(t=e.spot)||void 0===t?void 0:t.dealSoundStatus}),x=(0,tr.bp)(e=>null==e?void 0:e.updateSpotConfig),[f,v]=(0,tt.A)(tr.sc),y=(0,a.useCallback)(t=>{if(!l){(0,ti.$t)();return}return null==x?void 0:x(t,!1).then(()=>{ts.A.show({icon:"success",content:e("L0002191设置æå"),duration:1e3})}).catch(()=>{ts.A.show({icon:"error",content:e("L0010586设置失败"),duration:1e3})})},[l,e]),A=(0,a.useMemo)(()=>[{key:tc.Eo[tc.MF.LIMIT],title:e("L0001050éä»·å§æä¸å确认"),checked:s,switchFn:(e,t)=>{y({[e]:t})}},{key:tc.Eo[tc.MF.MARKET],title:e("L0001051å¸ä»·å§æä¸å确认"),checked:c,switchFn:(e,t)=>{y({[e]:t})}},{key:tc.Eo[tc.MF.PROFITLOSS],title:e("L0011057计åå§æä¸å确认"),checked:u,switchFn:(e,t)=>{y({[e]:t})}},{key:tc.Eo[tc.MF.OCO],title:e("L0015278OCOå§æä¸å确认"),checked:p,switchFn:(e,t)=>{y({[e]:t})}}],[e,s,c,u,p,y]),j=(0,a.useMemo)(()=>[{key:tc.Eo[tc.Vf.TRADENOTIFICATION],title:e("L0015068ç°è´§æäº¤éç¥"),checked:m,switchFn:(e,t)=>{y({[tc.Eo[tc.Vf.TRADENOTIFICATION]]:t,[tc.Eo[tc.Vf.TRADESOUND]]:t})}},{key:tc.Eo[tc.Vf.TRADESOUND],title:e("L0015067ç°è´§æäº¤æç¤ºé³"),checked:h,switchFn:(e,t)=>{y({[e]:t})}}],[e,m,h,y]),L=(0,ei.default)(e=>{if(e===tl.S.TradeRule)t.push("/trade/trading-rules?symbol=".concat(null!=o?o:""),void 0,{microEntrance:!0});else if(e===tl.S.NumberShowFormat)f();else if(e===tl.S.Guide){console.log("ç¹å»äºæ°ææå¦ï¼åå¤è§¦åshow_guideäºä»¶");let e=new CustomEvent("spotGuideEvent",{detail:{type:"show_guide"}});window.dispatchEvent(e),console.log("show_guideäºä»¶å·²è§¦å")}});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tn.A,{symbolTradeSetting:{isFuture:!1,generalSettings:A,notificationSettings:j,onClickItem:L,extra:r===eN.Nn.leverage?(0,i.jsx)("a",{href:"".concat("zh-TC"!==n?"":"/zh-TC","/support/articles/1948282160930619392"),target:"_blank",rel:"noreferrer",children:(0,i.jsxs)(ta.Ki,{cursor:!0,onClick:()=>{},children:[(0,i.jsx)("div",{className:"setting-title",children:(0,i.jsx)("span",{children:e("L0016883å©çååè´·éé¢")})}),(0,i.jsx)("div",{className:"setting-operate",children:(0,i.jsx)(E.A,{children:(0,i.jsx)(to.A,{className:"arrowIcon"})})})]})}):null},interfaceTradeSetting:{isFuture:!1,onClickItem:L}}),v()]})}),tp=(0,a.memo)(tu);function tm(){let e=(0,u._)(["\n .mounting {\n display: none;\n }\n "]);return tm=function(){return e},e}function th(){let e=(0,u._)(["\n justify-content: space-between;\n color: #ffffff;\n ","\n"]);return th=function(){return e},e}function tx(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n"]);return tx=function(){return e},e}let tf=(0,m.Ay)(c.A.Header)(th(),(0,V.FE)({mobile:(0,h.AH)(tm())})),tv=m.Ay.div(tx()),tg={price:"--",usd:"--",changePrice:"--",change:"--",hPrice:"--",lPrice:"--",vol:"--",amount:"--",toUsd:"--",hourlyInterestRate:"--",baseHourlyInterestRate:"--",quoteHourlyInterestRate:"--"},tb=e=>({price:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.price,usd:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.usd,hPrice:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.hPrice,lPrice:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.lPrice,vol:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.vol,amount:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.amount,change:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.change,changePrice:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.changePrice,toUsd:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.toUsd,baseHourlyInterestRate:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.baseHourlyInterestRate,quoteHourlyInterestRate:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.quoteHourlyInterestRate,hourlyInterestRate:(0,Q.w6)(null==e?void 0:e.price)?"--":null==e?void 0:e.hourlyInterestRate}),ty=(0,a.memo)(e=>{let{symbol:t,assetItem:n,tickerInfo:l,serverTradeArea:r,tradingType:o}
1=e,{mounted:s}=(0,Y.A)(),{isMobile:c}=(0,f.Px)(),u=(0,L.A)(),[{tradeSymbol:p,tradeAsset:m,tradePost:h,tradeArea:x,openStatus:v,isTrade:g,tradeTicker:b},y]=(0,d.d4)(e=>{var t,n,l,r,i,a;return{tradeSymbol:e.exchangeState.tradeSymbol,tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost,tradeArea:e.postArea,openStatus:null===(l=e.exchangeState)||void 0===l?void 0:null===(n=l.assetPairInfo)||void 0===n?void 0:null===(t=n.openTime)||void 0===t?void 0:t.openStatus,isTrade:null===(a=e.exchangeState)||void 0===a?void 0:null===(i=a.assetPairInfo)||void 0===i?void 0:null===(r=i.assetPair)||void 0===r?void 0:r.isTrade,tradeTicker:e.tradeTicker}}),A=(0,et.F)(b),{observeLeverageCurrencyHourlyRateUpdate:j}=(0,X.A)({symbol:t}),C=(0,a.useMemo)(()=>(x||r).toLocaleUpperCase(),[r,x]),[w,k]=(0,a.useState)(()=>W()(Z()({...l},tg),e=>(0,Q.w6)(e)?"--":e)),_=(0,a.useMemo)(()=>v&&g||!1,[v,g]);(0,a.useEffect)(()=>{p&&b&&_?k(e=>({...e,...tb(b)})):_||k(tg)},[p,b,_]),(0,a.useEffect)(()=>{let e=j(e=>{var t,n,l,r,i,a;if(!(p&&(null==e?void 0:e.data)))return;let o=((null==e?void 0:e.data)||[]).reduce((e,t)=>(e[null==t?void 0:t.currencyType]=t,e),{});y({tradeTicker:Object.assign(A.current,{baseHourlyInterestRate:null==o?void 0:null===(t=o[m])||void 0===t?void 0:t.hourlyInterestRate,quoteHourlyInterestRate:null==o?void 0:null===(n=o[h])||void 0===n?void 0:n.hourlyInterestRate,hourlyInterestRate:(0,q.A)((null==o?void 0:null===(l=o[m])||void 0===l?void 0:l.hourlyInterestRate)||0).gt((null==o?void 0:null===(r=o[h])||void 0===r?void 0:r.hourlyInterestRate)||0)?null==o?void 0:null===(i=o[m])||void 0===i?void 0:i.hourlyInterestRate:null==o?void 0:null===(a=o[h])||void 0===a?void 0:a.hourlyInterestRate})})});return()=>{e()}},[p,m,h]);let N=(0,a.useMemo)(()=>c||J.default?{lastPrice:(0,Q.Qr)((0,Q.LN)((0,Q.Fl)(w,"price"))),legalTender:(0,Q.al)(+w.price*(+w.toUsd||0)),change:(null==w?void 0:w.change)&&(null==w?void 0:w.change)!=="--"?(0,q.A)(null==w?void 0:w.change).div(100).toString():"--"}:void 0,[c,w]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(tf,{children:[(0,i.jsx)(te,{datas:w,symbol:t,mobileData:N,isOpenStatus:_,baseCode:null==n?void 0:n.baseCode,quoteCode:null==n?void 0:n.quoteCode,tradeArea:C,assetItem:n}),u?null:(0,i.jsxs)(tv,{className:s?"":"mounting",children:[(0,i.jsx)(ee.A,{type:"trade",tradeType:o}),(0,i.jsx)(tp,{})]})]}),(0,i.jsx)($.A,{type:"ETF"===C?K.nP.ETF:K.nP.SPOT})]})});var tA=n(67834),tj=n(64691),tL=n(79013),tC=n(11933),tw=n(58715),tk=n(7719),t_=n(57542),tN=n(4089);let tT=e=>{let{symbol:t}=e,{tradeWS:n}=(0,s.pP)(),{observeTradeDepthChartUpdate:l,observeTradeKbarUpdate:r,observeTradeTickUpdate:i}=(0,X.A)({symbol:t});return{getKlineHistory:(0,ei.default)(async(e,n)=>{try{if(n){eA.Ay.controller.abort();return}let l=await eA.Ay.getSpotMarketCenterKlines(e,void 0,(0,tN.J)("klines"));if(location.href.includes(t))return(null==l?void 0:l.klines)||[];return[]}catch(e){return console.log("history error",e),Promise.reject(e)}}),getWSDepthChat:n.getWSDepthChat,getKbar:n.getKbar,observeTradeDepthChartUpdate:l,observeTradeKbarUpdate:r,observeTradeTickUpdate:i}},tS={"1m":"1min","5m":"5min","3m":"3min","15m":"15min","30m":"30min","1h":"1hr","2h":"2hr","4h":"4hr","6h":"6hr","8h":"8hr","12h":"12hr","1d":"day","3d":"3day","1w":"week","1o":"month","3o":"3month"},tE={"1m":6e4,"3m":18e4,"5m":3e5,"15m":9e5,"30m":18e5,"1h":36e5,"2h":72e5,"4h":144e5,"6h":216e5,"8h":288e5,"12h":432e5,"1d":864e5,"3d":2592e5,"1w":6048e5,"1o":2592e6,"3o":7776e6};function tP(e){return tS[e]||"1min"}let tO=e=>["1d","3d","1w","1o","3o"].includes(e),tR=(e,t)=>{let{symbolConfig:n}=t,l=e.t;return{symbol:null==n?void 0:n.symbol,timestamp:l,time:l,close:+(e.c||0),open:+(e.o||0),high:+(e.h||0),low:+(e.l||0),volume:+(e.v||0),turnover:+(e.a||0)}},tI=["STABLECOINS"];var tM=n(43376);let tz=()=>{let[e]=(0,d.d4)(e=>{var t;return null===(t=e.tradeTicker)||void 0===t?void 0:t.price});return e},tF=(0,a.memo)(e=>{var t,n,l,r;let{extTabs:o}=e,c=(0,_.A)(),{t:u}=(0,S.A)(),{navigateToLoginOrElseFn:p}=(0,t_.A)(),{openTransferModal:m}=(0,tw.A)(),h=(0,ei.default)(()=>{p(()=>m(void 0,void 0,"FUTURES_TO_SPOT"))}),{getAssetPairConfigInfo:x}=(0,tM.A)(),[{tradeSymbol:f,tradeAcc:v,tradeAsset:g,postArea:b,assetPairInfo:y}]=(0,d.d4)(e=>({tradeSymbol:e.exchangeState.tradeSymbol,tradeAsset:e.exchangeState.tradeAsset,tradeAcc:e.exchangeState.tradeAcc,postArea:e.postArea,assetPairInfo:e.exchangeState.assetPairInfo})),{tradeWS:A}=(0,s.pP)(),{getKlineHistory:j,getWSDepthChat:L,getKbar:C,observeTradeDepthChartUpdate:w,observeTradeKbarUpdate:k,observeTradeTickUpdate:N}=tT({symbol:f}),E=(0,tC.n)("spot:trade-page"),{symbolConfig:P,assetInfo:O,getAssetIcon:R}=(0,tL.A)(),[I]=(0,tk.LV)(),M=(0,a.useRef)(null),z=(0,a.useCallback)(async e=>{let t=null==P?void 0:P[e];if(e!==f)return null;if(!t&&e===f){let[,n]=e.split("_");t={symbol:e,baseCode:g,quoteCode:n,minQua:v.minQua,priceAcc:v.priceAcc}}let n=F(t);if(t&&y){var l,r,i;n.openingTime=null===(l=y.openTime)||void 0===l?void 0:l.openTime,n.isStop=(null===(r=y.assetPair)||void 0===r?void 0:r.isTrade)!==void 0&&!(null===(i=y.assetPair)||void 0===i?void 0:i.isTrade)}return n||null},[P,f,null==y?void 0:null===(t=y.openTime)||void 0===t?void 0:t.openTime,null==y?void 0:null===(n=y.openTime)||void 0===n?void 0:n.serverTime,null==y?void 0:null===(l=y.openTime)||void 0===l?void 0:l.remainTime,null==y?void 0:null===(r=y.assetPair)||void 0===r?void 0:r.isTrade]),F=e=>{var t,n,l;return{symbolId:null==e?void 0:e.symbol,symbolCode:null==e?void 0:e.baseCode,quoteCode:null==e?void 0:e.quoteCode,symbolName:null==e?void 0:null===(t=e.alias)||void 0===t?void 0:t.replace("_","/").toLocaleUpperCase(),openingTime:z,icon:R(null==e?void 0:e.baseCode),tag:"",volumePrecision:null!==(n=null==e?void 0:e.minQua)&&void 0!==n?n:0,pricePrecision:null!==(l=null==e?void 0:e.priceAcc)&&void 0!==l?l:0}},D=(0,a.useMemo)(()=>Object.values(P||{}).map(e=>F(e)),[P]),U=(0,ei.default)(e=>{let t=null==P?void 0:P[e];if(!t){let t=D.find(t=>t.symbolName===e);if(t)return t}if(!t&&e===f){let[,t]=e.split("_");
1return F({symbol:e,baseCode:g,quoteCode:t,minQua:v.minQua,priceAcc:v.priceAcc})}return t?F(t):null}),B=(0,a.useCallback)(e=>{c.push("/trade/".concat(e.toLowerCase()),void 0,{shallow:!1})},[]),H=(0,ei.default)(e=>{e===f&&x({symbol:e})}),Z=(0,a.useMemo)(()=>["MA","EMA","BOLL","SAR"],[]),G=(0,a.useMemo)(()=>["VOL","MACD","KDJ","RSI","BIAS","BRAR","BOLL","CCI","DMI","CR","PSY","DMA","TRIX","VR","WR","MTM"],[]),W=(0,a.useRef)(!1),V=(0,tj.A)(()=>({prevKLineData:void 0,getSymbol:U,async getBars(e){let{symbolId:t,interval:n,from:l,to:r,count:i,cancelRequestKlineHistory:a}=e,o=null==P?void 0:P[t];V.prevKLineData=void 0;let s={symbol:t.toLowerCase(),interval:"1o"===n?"1M":"3o"===n?"3M":n,to:1e3*r,size:i};return(await j(s,a)||[]).map(e=>{var t;let l=tR(e,{symbolConfig:o});return(null===(t=M.current)||void 0===t?void 0:t.chartType)===tA.oT.TRADING_VIEW&&tO(n)&&(l.timestamp+=288e5,l.time+=288e5),l})},subscribeKLine:e=>{let{symbolId:t,period:n,onSubscribeSuccess:l,onMessage:r,onMarketMessage:i,getLastBarData:a}=e,o=null==P?void 0:P[t],s=C(tP(n),t),d=k(e=>{if(e&&(null==l||l(),e.kbar&&e.kbar.slot===tP(n)&&e.pair===t)){var i;let t=tR(e.kbar,{symbolConfig:o});t.timestamp=function(e){let t=0;return"string"==typeof e?t=new Date(e).getTime():"number"==typeof e&&(t=e),t}(e.kbar.ts||0),(null===(i=M.current)||void 0===i?void 0:i.chartType)===tA.oT.TRADING_VIEW&&tO(n)&&(t.timestamp+=288e5),t.time=t.timestamp;let l=t.timestamp,s=null==a?void 0:a(),d=null==s?void 0:s.time;if(d&&l-d>=tE[n]){let e=s.close;t.close=e,t.open=e,t.high=Math.max(e,t.high),t.low=Math.min(e,t.low)}V.prevKLineData=t,null==r||r([t],!0)}}),c=N(e=>{let n=Number(e.tick.cp);e.pair===t&&i({symbolId:t,price:n})});return()=>{d(),c(),s()}},subscribeDepth:e=>{let{symbolId:t,onSubscribeSuccess:n,onMessage:l}=e,r=e=>{let{asks:t,bids:n}=e,r={asks:[],bids:[]};if(t&&n){n=Object.assign([],n.slice(0,50)),t=Object.assign([],t.slice(0,50)).reverse();let e=[];for(let n=t.length-1;n>=0;--n)e.push(t[n]);e.forEach((e,t)=>{let n=t-1<0?Number(e[1]):Number((0,q.A)(Number(e[1])).plus(r.asks[t-1][1]));r.asks.push([(0,Q.gC)(Number(e[0])),n])}),n.forEach((e,t)=>{let n=t-1<0?Number(e[1]):Number((0,q.A)(Number(e[1])).plus(r.bids[0][1]));r.bids.splice(0,0,[(0,Q.gC)(Number(e[0])),n])})}else t=[],n=[];null==l||l({bids:r.bids.map(e=>{let[t,n]=e;return{price:t,volume:n}}),asks:r.asks.map(e=>{let[t,n]=e;return{price:t,volume:n}})})};eA.Ay.getSpotMarketCenterDepthList({symbol:t,dataType:"1",depth:"200",mergeLimit:"50"},void 0,(0,tN.J)("order_book")).then(e=>{let{asks:t=[],bids:n=[]}=(null==e?void 0:e.data)||{};r({asks:t.map(e=>[e.price,e.qty]),bids:n.map(e=>[e.price,e.qty])})}).finally(()=>{null==n||n()});let i=L({symbol:t}),a=w(e=>{if(!e){null==l||l({bids:[],asks:[]});return}r({asks:(null==e?void 0:e.asks)||[],bids:(null==e?void 0:e.bids)||[]})});return()=>{a(),i(),W.current=!1}}}),[P]);(0,a.useEffect)(()=>A.onReconnectSuccess(()=>{var e;null===(e=M.current)||void 0===e||e.reloadChart()}),[A]);let Y=(0,a.useMemo)(()=>{var e;return(0,i.jsx)(er.A,{inline:!0,align:"center",top:24,size:16,children:"ETF"!==b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T.A,{size:"middle",disabled:!g||!(null==O?void 0:null===(e=O[g])||void 0===e?void 0:e.depositStatus),onClick:()=>c.push("/wallet/account/main/deposit/crypto/".concat(g||"")),children:u("L0000155å
å¼")}),!I(tk.qR.Derivatives)&&(0,i.jsx)(T.A,{size:"middle",onClick:h,children:u("L0000900å转")})]}):null})},[g,O,u,I,b]);return(0,i.jsx)(tA.Ay,{ref:M,disableMultipleCharts:!0,isHiddenPostIntroduce:!tI.includes(b),bizType:tA.Ez.Spot,symbolId:f&&(null==P?void 0:P[f])?f:void 0,symbolList:D,gotoSymbol:B,onOpeningTimeout:H,mainTechIndicators:Z,subTechIndicators:G,datafeed:V,pageTracker:E,togglePriceBase:!1,tradingViewProps:{enabledLines:!1,showTimeFrame:!0},orderBookPrecision:"".concat(v.priceAcc),extTabs:o,useLastPrice:tz,CountdownExtra:Y})});var tD=n(61297),tU=n(33285),tB=n(99183),tq=n(97330),tH=n(40879),tZ=n(70662),tG=n(61955),tW=n(65445),tV=n(37876),tQ=n(97204),tY=n(39866),tK=n.n(tY),t$=n(82357),tX=n(57157),tJ=n(49730),t0=n(93268),t1=n(39409),t2=n(82211);let t6=e=>{let{asset:t,enablePercent:n,enableUnitConversion:l}=e,{currentExchangeRate:r,showAssetLgt:i,rateList:a}=(0,g.Pj)(e=>{var t;return{currentExchangeRate:e.currentExchangeRate,rateList:(null===(t=e.rateList)||void 0===t?void 0:t.list)||[],showAssetLgt:e.showAmountLgt}}
1),{symbol:s,code:d}=r||{},c=o().useMemo(()=>({btc:null==t?void 0:t.toBtc,usdt:null==t?void 0:t.toUsd,cny:null==t?void 0:t.toCny}),[t]),u=(0,t2.h)((null==t?void 0:t.toUsd)||0,a);return{totalConvertAmount:o().useMemo(()=>{var e,t;return"btc"===i||"usdt"===i||"cny"===i?l?(0,eg.tu)(c[i],n||("cny"===i?2:4)):(0,q.A)((null==c?void 0:c[i])||"0").toFixed(n||("cny"===i?2:4)):l?(0,eg.tu)(u[null===(e="".concat(d))||void 0===e?void 0:e.toLocaleLowerCase()]||"0",n||2):(0,q.A)(u[null===(t="".concat(d))||void 0===t?void 0:t.toLocaleLowerCase()]||"0").toFixed(n||2)},[i,l,u,d,n,c]),lgtSymbolValue:o().useMemo(()=>"btc"===i?"฿":"usdt"===i?"$":"cny"===i?"\xa5":s,[i,s]),showAssetLgt:i}};var t4=n(35535);function t3(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 700;\n font-size: 25px;\n color: #ffffff;\n line-height: 25px;\n margin-top: 25px;\n white-space: nowrap;\n /* @noflip */\n direction: ltr !important;\n gap: 16px;\n"]);return t3=function(){return e},e}function t5(){let e=(0,u._)(["\n // margin-right: 6px;\n"]);return t5=function(){return e},e}function t8(){let e=(0,u._)(["\n margin-right: 2px;\n"]);return t8=function(){return e},e}let t7=m.Ay.div(t3()),t9=m.Ay.span(t5()),ne=m.Ay.span(t8()),nt=e=>{let{asset:t,showUnit:n=!1,className:l,showLgtSymbol:r=!1,none:s=!1,enableMinusShowZero:d=!1,fontSize:c=32,showApproximately:u=!1,unitClassName:p,enableLgt:m=!1,enablePercent:h=0,enableUnitConversion:x=!0,enableRemoveZeroPercent:f=0,enableFontSize:v=!0,enableIncreaseOrdecrease:b=!1}=e,[y,A]=(0,a.useState)(c),{currentExchangeRate:j}=(0,g.Pj)(e=>({currentExchangeRate:e.currentExchangeRate})),{code:L="usd"}=j||{},{RTLLeft:C}=(0,t4._)(),{totalConvertAmount:w,lgtSymbolValue:k,showAssetLgt:_}=t6({asset:t,enablePercent:h,enableUnitConversion:x}),[N,T]=(0,a.useState)(),S=(0,a.useRef)(null);(0,t1.A)(()=>S.current?T(S.current.offsetWidth):()=>{},[S.current]);let E=e=>-1!==String(e).indexOf("-")?"0.00":e,P=e=>e&&-1!==String(e).indexOf("-")?e.replace(/-/,""):e,O=o().useMemo(()=>{if(s)return(0,eg.w1)(d?E(w):w,f,"B");let e=b?P(w):w;return(0,eg.w1)(d?E(e):e,f,"B")},[s,w,d,t,b]),R=(0,a.useMemo)(()=>{if(b){if(Number(null==t?void 0:t.toUsd)>0)return"+";if(0>Number(null==t?void 0:t.toUsd)&&!s)return"-"}return""},[t,s,b]);return(0,i.jsx)(t7,{className:l||"",ref:S,children:(0,i.jsxs)(em.A,{children:[R,u?(0,i.jsx)(ne,{children:"â"}):"",k&&r&&(0,i.jsx)(t9,{style:{fontSize:y},children:k}),(0,i.jsx)(t0.A,{className:"total-asset-fontsize",fixedWidth:v?N:void 0,defaultFontSize:c,getFontSize:A,children:O}),n&&(0,i.jsx)(t9,{style:{["margin".concat(C())]:"6px"},className:p,children:s?"USDT":m?L.toUpperCase():null==_?void 0:_.toLocaleUpperCase()})]})})};function nn(){let e=(0,u._)(["\n width: 100px;\n "]);return nn=function(){return e},e}function nl(){let e=(0,u._)(["\n ","\n\n .assetInfo {\n ","\n\n &-item {\n display: flex;\n padding: 2px 0px;\n align-items: center;\n\n ","\n\n &-title {\n color: ",";\n ",";\n }\n\n &-value {\n color: ",";\n ",";\n }\n }\n\n .user-account-value {\n margin-top: 0;\n color: ",";\n ",";\n }\n }\n\n .ml-list {\n border-top: 1px solid ",";\n\n .ml-item {\n border-bottom: 1px solid ",";\n display: flex;\n align-items: center;\n overflow: hidden;\n\n &-title {\n color: ",";\n ",";\n padding: 13px 0;\n width: 116px;\n\n ","\n }\n\n &-value {\n border-left: 1px solid ",";\n color: ",";\n ",";\n padding: 13px 12px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n flex: 1;\n margin-bottom: -8px;\n\n ","\n\n &-item {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n ","\n\n span {\n white-space: nowrap;\n }\n\n svg {\n width: 14px;\n height: 14px;\n }\n\n &.isMarginNotice {\n color: ",";\n }\n\n &.forceClose {\n color: ",";\n }\n }\n }\n }\n }\n"]);return nl=function(){return e},e}let nr=m.Ay.div(nl(),(0,V.Gb)(12),(0,V.Gb)(2),(0,V.SW)(4),V.fG,e=>e.theme.bizTypography.r12,V.vZ,e=>e.theme.bizTypography.m12,V.vZ,e=>e.theme.bizTypography.r12,V.f8,V.f8,V.vZ,e=>e.theme.bizTypography.m12,f.XG.mobile((0,h.AH)(nn())),V.f8,V.vZ,e=>e.theme.bizTypography.m12,(0,V.SW)(10),(0,V.SW)(4),V.xY,V.WU),ni={deal:"L0000005交æ",borrow:"L0016379忬¾",repay:"L0002308转åº",exchange:"L0000702å
æ¢"},na=(0,a.memo)(e=>{let{assetSummary:t}=e,{t:n}=(0,S.A)(),l=(0,a.useMemo)(()=>[{min:2,desc:"ML > 2",candoList:["deal","borrow","repay","exchange"]},{min:1.5,max:2,desc:"1.5 < ML ⤠2",candoList:["deal","borrow","exchange"]},{min:1.3,max:1.5,desc:"1.3 < ML ⤠1.5",candoList:["deal","exchange"]},{min:1.1,max:1.3,desc:"1.1 < ML ⤠1.3",candoList:["deal"],isMarginNotice:!0},{max:1.1,desc:"ML ⤠1.1",candoList:[],forceClose:!0}],[]);return(0,i.jsxs)(nr,{children:[(0,i.jsxs)("div",{className:"assetInfo",children:[(0,i.jsxs)("div",{className:"assetInfo-item",children:[(0,i.jsxs)("div",{className:"assetInfo-item-title",children:[n("L0000985æ»èµäº§"),":"]}),(0,i.jsx)("div",{className:"assetInfo-item-value",children:(0,i.jsx)(nt,{className:"user-account-value",fontSize:12,asset:{toBtc:null==t?void 0:t.toBtc,toUsd:null==t?void 0:t.toUsd,toCny:null==t?void 0:t.toCny},enableMinusShowZero:!1,enableFontSize:!1,showLgtSymbol:!0,enableIncreaseOrdecrease:!1,none:!1})})]}),(0,i.jsxs)("div",{className:"assetInfo-item",children:[(0,i.jsxs)("div",{className:"assetInfo-item-title",children:[n("L0016376æ»è´åº"),":"]}),(0,i.jsx)("div",{className:"assetInfo-item-value",children:(0,i.jsx)(nt,{className:"user-account-value",fontSize:12,asset:{toBtc:null==t?void 0:t.debtAssetToBtc,toUsd:null==t?void 0:t.debtAssetToUsd,toCny:null==t?void 0:t.debtAssetToCny},enableMinusShowZero:!1,enableFontSize:!1,showLgtSymbol:!0,enableIncreaseOrdecrease:!1})})]})]}),(0,i.jsx)("div",{className:"ml-list",children:l.map(e=>(0,i.jsxs)("div",{className:"ml-item",children:[(0,i.jsx)("div",{className:"ml-item-title",children:(0,i.jsx)(em.A,{children:e.desc})}),(0,i.jsxs)("div",{className:"ml-item-value",children:[e.candoList.map((e,t)=>(0,i.jsxs)("div",{className:"ml-item-value-item",children:[(0,i.jsx)(tJ.A,{}),(0,i.jsx)("span",{children:n(ni[e])})]},e+t)),!!e.isMarginNotice&&(0,i.jsx)("div",{className:"ml-item-value-item isMarginNotice",children:n("L0016811追å ä¿è¯éæ¨é")}),!!e.forceClose&&(0,i.jsx)("div",{className:"ml-item-value-item forceClose",children:n("L0010831强平")})]})]},e.desc))})]})}),no=()=>(0,i.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.9979 19.7406C32.0429 22.514 31.3661 25.2515 30.0339 27.6844L25.6501 25.284C26.5106 23.7158 27 21.9151 27 20C27 13.9249 22.0751 9 16 9C9.92487 9 5 13.9249 5 20C5 21.8913 5.47731 23.6711 6.31804 25.2255L1.91986 27.5993C0.602427 25.1584 -0.0577966 22.4168 0.00396796 19.6437C0.0657326 16.8706 0.847363 14.1612 2.27217 11.7813C3.69698 9.40144 5.71601 7.43284 8.13117 6.06869C10.5463 4.70453 13.2746 3.99168 16.0484 4.00007C18.8222 4.00847 21.5462 4.73782 23.953 6.11657C26.3599 7.49532 28.367 9.4761 29.7773 11.8646C31.1877 14.253 31.9529 16.9671 31.9979
119.7406Z",fill:"#EB4B6D"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.632 16.5881C32.455 20.3586 31.8874 24.2994 30.0339 27.6844L25.6502 25.284C26.5107 23.7158 27.0001 21.9151 27.0001 20C27.0001 13.9249 22.0752 9.00002 16.0001 9.00002C12.9376 9.00002 10.1675 10.2515 8.17316 12.2709L4.61548 8.75764C7.32716 6.01166 10.94 4.33832 14.7881 4.04599C18.6362 3.75366 22.4604 4.86205 25.5557 7.16689C28.6511 9.47172 30.8091 12.8177 31.632 16.5881Z",fill:"#FFDB00"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.8456 17.7829C32.3227 21.1924 31.6874 24.6648 30.0339 27.6845L25.6501 25.2841C26.5106 23.7159 27 21.9152 27 20.0001C27 16.9878 25.7892 14.2583 23.8276 12.2717L27.3856 8.75879C29.8045 11.2086 31.3686 14.3733 31.8456 17.7829Z",fill:"#2EB265"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.48413 18.0745C6.27942 18.009 6.12964 18.2685 6.28869 18.413L13.529 24.9931C13.7308 25.2773 13.9955 25.5236 14.3171 25.7093C15.5129 26.3997 17.0419 25.99 17.7322 24.7943C18.4226 23.5985 18.0129 22.0696 16.8171 21.3792C16.4955 21.1935 16.1498 21.0874 15.8028 21.0548L6.48413 18.0745Z",fill:"#B9B9B9"}),(0,i.jsx)("circle",{cx:"15.5671",cy:"23.5442",r:"1.5",transform:"rotate(-60 15.5671 23.5442)",fill:"#D9D9D9"})]}),ns=()=>(0,i.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.9979 19.7406C32.0429 22.514 31.3661 25.2515 30.0339 27.6844L25.6501 25.284C26.5106 23.7158 27 21.9151 27 20C27 13.9249 22.0751 9 16 9C9.92487 9 5 13.9249 5 20C5 21.8913 5.47731 23.6711 6.31804 25.2255L1.91986 27.5993C0.602427 25.1584 -0.0577966 22.4168 0.00396796 19.6437C0.0657326 16.8706 0.847363 14.1612 2.27217 11.7813C3.69698 9.40144 5.71601 7.43284 8.13117 6.06869C10.5463 4.70453 13.2746 3.99168 16.0484 4.00007C18.8222 4.00847 21.5462 4.73782 23.953 6.11657C26.3599 7.49532 28.367 9.4761 29.7773 11.8646C31.1877 14.253 31.9529 16.9671 31.9979 19.7406Z",fill:"#EB4B6D"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.632 16.5881C32.455 20.3586 31.8874 24.2994 30.0339 27.6844L25.6502 25.284C26.5107 23.7158 27.0001 21.9151 27.0001 20C27.0001 13.9249 22.0752 9.00002 16.0001 9.00002C12.9376 9.00002 10.1675 10.2515 8.17316 12.2709L4.61548 8.75764C7.32716 6.01166 10.94 4.33832 14.7881 4.04599C18.6362 3.75366 22.4604 4.86205 25.5557 7.16689C28.6511 9.47172 30.8091 12.8177 31.632 16.5881Z",fill:"#FFDB00"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.8456 17.7829C32.3227 21.1924 31.6874 24.6648 30.0339 27.6845L25.6501 25.2841C26.5106 23.7159 27 21.9152 27 20.0001C27 16.9878 25.7892 14.2583 23.8276 12.2717L27.3856 8.75879C29.8045 11.2086 31.3686 14.3733 31.8456 17.7829Z",fill:"#2EB265"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6954 12.8992C15.6498 12.6892 15.3502 12.6892 15.3046 12.8992L13.2262 22.4595C13.081 22.7764 13 23.1288 13 23.5002C13 24.8809 14.1193 26.0002 15.5 26.0002C16.8807 26.0002 18 24.8809 18 23.5002C18 23.1288 17.919 22.7764 17.7738 22.4595L15.6954 12.8992Z",fill:"#B9B9B9"}),(0,i.jsx)("circle",{cx:"15.5",cy:"23.5",r:"1.5",fill:"#D9D9D9"})]}),nd=()=>(0,i.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.9979 19.7406C32.0429 22.514 31.3661 25.2515 30.0339 27.6844L25.6501 25.284C26.5106 23.7158 27 21.9151 27 20C27 13.9249 22.0751 9 16 9C9.92487 9 5 13.9249 5 20C5 21.8913 5.47731 23.6711 6.31804 25.2255L1.91986 27.5993C0.602427 25.1584 -0.0577966 22.4168 0.00396796 19.6437C0.0657326 16.8706 0.847363 14.1612 2.27217 11.7813C3.69698 9.40144 5.71601 7.43284 8.13117 6.06869C10.5463 4.70453 13.2746 3.99168 16.0484 4.00007C18.8222 4.00847 21.5462 4.73782 23.953 6.11657C26.3599 7.49532 28.367 9.4761 29.7773 11.8646C31.1877 14.253 31.9529 16.9671 31.9979 19.7406Z",fill:"#EB4B6D"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.632 16.5881C32.455 20.3586 31.8874 24.2994 30.0339 27.6844L25.6502 25.284C26.5107 23.7158 27.0001 21.9151 27.0001 20C27.0001 13.9249 22.0752 9.00002 16.0001 9.00002C12.9376 9.00002 10.1675 10.2515 8.17316 12.2709L4.61548 8.75764C7.32716 6.01166 10.94 4.33832
114.7881 4.04599C18.6362 3.75366 22.4604 4.86205 25.5557 7.16689C28.6511 9.47172 30.8091 12.8177 31.632 16.5881Z",fill:"#FFDB00"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.8456 17.7829C32.3227 21.1924 31.6874 24.6648 30.0339 27.6845L25.6501 25.2841C26.5106 23.7159 27 21.9152 27 20.0001C27 16.9878 25.7892 14.2583 23.8276 12.2717L27.3856 8.75879C29.8045 11.2086 31.3686 14.3733 31.8456 17.7829Z",fill:"#2EB265"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.6935 18.4131C24.8525 18.2685 24.7028 18.0091 24.498 18.0746L15.1794 21.0548C14.8324 21.0875 14.4867 21.1936 14.165 21.3793C12.9693 22.0696 12.5596 23.5986 13.25 24.7943C13.9403 25.9901 15.4693 26.3997 16.665 25.7094C16.9867 25.5237 17.2514 25.2773 17.4532 24.9931L24.6935 18.4131Z",fill:"#B9B9B9"}),(0,i.jsx)("circle",{cx:"15.4151",cy:"23.5442",r:"1.5",transform:"rotate(60 15.4151 23.5442)",fill:"#D9D9D9"})]});function nc(){let e=(0,u._)(["\n padding: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n min-height: 20px;\n\n .risk-rate-title {\n color: ",";\n ",";\n margin-right: 12px;\n }\n"]);return nc=function(){return e},e}function nu(){let e=(0,u._)(["\n &:hover {\n background: transparent;\n }\n "]);return nu=function(){return e},e}function np(){let e=(0,u._)(["\n width: 20px;\n height: 20px;\n "]);return np=function(){return e},e}function nm(){let e=(0,u._)(["\n width: 22px;\n height: 22px;\n "]);return nm=function(){return e},e}function nh(){let e=(0,u._)(["\n width: 14px;\n height: 14px;\n "]);return nh=function(){return e},e}function nx(){let e=(0,u._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: ",";\n border-radius: 4px;\n\n &:hover {\n background: ",";\n }\n\n ","\n\n ",";\n\n .risk-rate-btn {\n color: ",";\n display: flex;\n align-items: center;\n cursor: pointer;\n\n svg {\n ",";\n }\n }\n"]);return nx=function(){return e},e}function nf(){let e=(0,u._)(["\n color: ",";\n ",";\n display: flex;\n align-items: center;\n\n .risk-rate {\n display: flex;\n align-items: center;\n }\n\n svg {\n width: 24px;\n height: 24px;\n margin-right: 6px;\n margin-left: 4px;\n }\n"]);return nf=function(){return e},e}m.Ay.div(nc(),V.vZ,e=>e.theme.bizTypography.r14);let nv=m.Ay.div(nx(),e=>{let{noPadding:t}=e;return t?0:"4px 8px"},e=>{var t;let{noPadding:n,theme:l}=e;return n?"transparent":null===(t=l.palette)||void 0===t?void 0:t.bizBackground[2]},f.XG.mobile((0,h.AH)(nu())),e=>"large"===e.size?e.theme.bizTypography.m14:"xl"===e.size?e.theme.bizTypography.b20:e.theme.bizTypography.m12,V.vZ,e=>"large"===e.size?(0,h.AH)(np()):"xl"===e.size?(0,h.AH)(nm()):(0,h.AH)(nh())),ng=m.Ay.div(nf(),V.vZ,e=>e.theme.bizTypography.m16),nb={green:"#2CA860",yellow:"#FFDB00",red:"#EB4B6D"},ny=o().forwardRef((e,t)=>{let{size:n="small",noPadding:l,assetSummaryFromProps:r}=e,{t:o}=(0,S.A)(),[d,c]=(0,a.useState)(!1),[u,p]=(0,tX.A)(!0),{tradeWS:m}=(0,s.pP)(),{observeLeverageAssetInfoUpdate:h}=(0,X.A)(),[x,f]=(0,a.useState)(r||null);(0,a.useEffect)(()=>{void 0===r&&p(eA.Ay.getLeverageTradeCenterPositionAssetSummary({},void 0,(0,tN.u)("risk_summary"))).then(e=>{f(e)}).catch(()=>void 0)},[]),(0,a.useEffect)(()=>{void 0!==r&&f(null!=r?r:null)},[r]),(0,a.useEffect)(()=>{m.getLeverageAssetInfoWS()},[m.getLeverageAssetInfoWS]),(0,a.useEffect)(()=>{let e=h(e=>{if(null==e?void 0:e.data){let t=(null==e?void 0:e.data)||{};f(e=>({...e||{},toBtc:t.toBtc,toUsd:t.toUsd,toCny:t.toCny,netAssetToBtc:t.netAssetToBtc,netAssetToUsd:t.netAssetToUsd,netAssetToCny:t.netAssetToCny,debtAssetToBtc:t.debtAssetToBtc,debtAssetToUsd:t.debtAssetToUsd,debtAssetToCny:t.debtAssetToCny,riskRate:t.riskRateValue}))}});return()=>{e()}},[]);let v=(0,a.useMemo)(()=>{let e=+((null==x?void 0:x.riskRate)||999);return e>2?{text:(0,i.jsx)("span",{style:{color:nb.green},children:e}),flag:(0,i.jsx)(nd,{}),color:nb.green}:e>1.3?{text:(0,i.jsx)("span",{style:{color:nb.yellow},children:e}),flag:(0,i.jsx)(ns,{}),color:nb.yellow}:{text:(0,i.jsx)("span",{style:{color:nb.red},children:e}),flag:(0,i.jsx)(no,{}),color:nb.red}},[null==x?void 0:x.riskRate]),g=(0,a.useMemo)(()=>(0,i.jsxs)(ng,{children:[(0,i.jsxs)("span",{children:[o("L0016743æ æé£é©ç"),"ï¼MLï¼"]}),(0,i.jsx)(em.A,{children:(0,i.jsxs)("div",{className:"risk-rate",children:[v.flag,v.text]})})]}),[v,o]),b=(0,tD.default)(()=>{c(!0)});return(0,a.useImperativeHandle)(t,()=>({open:b})),u&&!r?null:(0,i.jsxs)(nv,{size:n,noPadding:l,className:"risk-rate-wrapper",children:[(0,i.jsx)(em.A,{children:(0,i.jsx)("div",{className:"risk-rate-btn",onClick:b,children:(0,i.jsxs)(er.A,{inline:!0,align:"center",size:4,children:[v.flag,(0,i.jsx)("span",{style:{color:v.color},className:"name",children:"ML"}),v.text]})})}),(0,i.jsx)(t$.default,{shouldResponsive:!0,open:d,onCancel:()=>c(!1),icon:null,maskClosable:!0,closable:!0,title:g,width:480,footer:null,children:(0,i.jsx)(na,{assetSummary:x})})]})}),nA=(0,a.memo)((0,s.xn)(ny));var nj=n(92993);function nL(){let e=(0,u._)(["\n margin-bottom: 48px;\n "]);return nL=function(){return e},e}function nC(){let e=(0,u._)(["\n display: flex;\n margin: 0 16px;\n padding: 8px 8px 8px 10px;\n justify-content: center;\n align-items: center;\n border-radius: 2px;\n // todo\n background: ",";\n cursor: pointer;\n .status-text {\n padding-left: 4px;\n color: ",";\n ",";\n text-align: left;\n }\n svg {\n font-size: 16px;\n color: ",";\n }\n ","\n"]);return nC=function(){return e},e}let nw=n(23040).A.assetPrefix,nk=m.Ay.div(nC(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizFill.fill6},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text6},e=>e.theme.bizTypography.m12,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text6},f.XG.mobile((0,h.AH)(nL()))),n_=e=>{var t,n;let{symbol:l}=e,[r,o]=(0,a.useState)(null),s=(0,_.A)(),{t:d}=(0,S.A)(),c=(0,t4.A)(),u=(0,L.A)(),p=null==l?void 0:null===(n=l.split("_"))||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.toUpperCase(),m=(0,a.useMemo)(()=>{let e="";switch(null==r?void 0:r.activityStatus){case 0:e=d("L0015998é¢åç°è´§äº¤æä¿é",{0:p});break;case 1:case 2:e=d("L0015999ç°è´§äº¤æä¿éæªå¼å§",{0:p});break;case 3:e=d("L0016000ç°è´§äº¤æä¿éä¸",{0:p});break;case 4:e=d("L0016988ç°è´§äº¤æä¿éå·²ç»æ",{0:p});break;default:e=""}return e||""},[r,d,p]);return((0,a.useEffect)(()=>{s.isReady&&eA.Ay.getHuliBazaarCenterNewActivityBaoPeiUserActInfo({symbol
1:l}).then(e=>{o(e)})},[l,null==s?void 0:s.isReady]),r&&r.urlParam&&m&&!u)?(0,i.jsxs)(nk,{onClick:()=>{r&&s.push("/price-guard/".concat(null==r?void 0:r.urlParam))},children:[(0,i.jsx)("img",{src:"".concat(nw,"/assets/icons/protect_icon.svg"),width:16,height:16,alt:""}),(0,i.jsx)("span",{className:"status-text",children:m}),c?(0,i.jsx)(nj.A,{}):(0,i.jsx)(to.A,{})]}):null};var nN=n(32526),nT=n(50093),nS=n(85801),nE=n(49806),nP=n(71787),nO=n(1165);function nR(){let e=(0,u._)(["\n margin-bottom: 16px;\n"]);return nR=function(){return e},e}function nI(){let e=(0,u._)(["\n .lbank-radio-checker {\n color: ",";\n }\n"]);return nI=function(){return e},e}let nM=m.Ay.p(nR()),nz=(0,m.Ay)(nO.A)(nI(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3}),nF=()=>{let{t:e}=(0,S.A)(),{modal:t}=(0,nP.A)(),n=(0,a.useRef)(null),{status:l,setPlanTradePromptStatus:r}=(0,g.Pj)(e=>({status:e.planTradePromptStatus,setPlanTradePromptStatus:e.setPlanTradePromptStatus})),o=(0,a.useRef)("close"===l);return{openPlanTradePrompt:(0,tD.default)(()=>new Promise((l,a)=>{n.current=t.confirm({title:e("L0006047æç¤º"),closable:!0,width:380,content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nM,{children:e("L0010927ç±äºè¡æ
æ³¢å¨çåå 计åå§æè§¦å")}),(0,i.jsx)(nz,{onChange:(e,t)=>
1{o.current=t},size:"middle",children:e("L0008313ä¸åæç¤º")})]}),onOk:e=>{e(),o.current&&r("close"),l(!0)},onCancel:()=>{n.current.destroy(),a()}})}))}};var nD=n(28948),nU=n(79144),nB=n(90857),nq=n(44861),nH=n(8111);function nZ(){let e=(0,u._)(["\n font-size: 16px;\n margin-right: 16px;\n &.no_right_margin {\n margin-right: 0;\n }\n cursor: pointer;\n color: ",";\n\n &:hover {\n color: ",";\n }\n"]);return nZ=function(){return e},e}function nG(){let e=(0,u._)(["\n .title1 {\n color: ",";\n ",";\n line-height: 20px; /* 142.857% */\n\n a {\n color: ",";\n }\n }\n\n .title2 {\n margin-top: 16px;\n color: ",";\n ",";\n line-height: 20px; /* 142.857% */\n }\n"]);return nG=function(){return e},e}let nW=(0,m.Ay)(nB.A)(nZ(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1}),nV=m.Ay.div(nG(),V.mi,e=>e.theme.bizTypography.r14,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizState.link[1]},V.fG,e=>e.theme.bizTypography.r12),nQ=e=>{let{orderOption:t,noRightMargin:n}=e,{t:l}=(0,S.A)(),[{postArea:r}]=(0,d.d4)(e=>({postArea:e.postArea})),o=(0,L.A)(),s=(0,a.useMemo)(()=>[{key:eN.xo.limited,label:l("L0000923éä»·å§æ"),value:eN.xo.limited,description:{title:"L0006982éä»·å§ææ¯æä»¥é宿æ´ä¼ä»·æ ¼è¿",chart:{title:"L0006966å¾ç¤ºè¯´æ",info:[{label:"L0001930ä¹°å
¥",key:"buy",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/limit-order-buy-chart-dark.svg")),light:"".concat((0,nq.m2)("/assets/images/ordermode/limit-order-buy-chart-light.svg"))},context:["L0010880å½åä»·æ ¼ä¸è·å°è®¢åçå§æä»·æ ¼æ","L0006967举ä¾è¯´æ","L0013969妿å½åå¸åºä»·æ ¼æ¯3000以1","L0013970妿ç®åå¸ä»·æ¯3000以350"]},{label:"L0001931ååº",key:"sell",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/limit-order-sell-chart-dark.svg")),light:"".concat((0,nq.m2)("/assets/images/ordermode/limit-order-sell-chart-light.svg"))},context:["L0010878å½åä»·æ ¼ä¸æ¶¨è³è®¢åçå§æä»·æ ¼æ","L0006967举ä¾è¯´æ","L0013971妿ç®åå¸ä»·æ¯1500以300","L0013972妿ç®åå¸ä»·æ¯1500以100"]}]}}},{key:eN.xo.market,label:l("L0000928å¸ä»·å§æ"),value:eN.xo.market,description:{title:"L0006971å¸ä»·å§ææ¯ææç
§ç®åå¸åºæä¼ä»·",chart:{title:"L0006966å¾ç¤ºè¯´æ",info:[{label:"L0001930ä¹°å
¥",key:"buy",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/market-order-buy-chart-dark.svg")),light:"".concat((0,nq.m2)("/assets/images/ordermode/market-order-buy-chart-light.svg"))},context:["L0006670夿³¨","L0010890å½åä»·æ ¼2400æ¤æ¶ä¸åä¸ç¬å¸","L00069731对äºå¸ä»·ä¹°åæäº¤åä»·ä¼ç¥é«äº"]}]}}},{key:eN.xo.plan,label:"L0007112计åå§æ",value:eN.xo.plan,description:{title:"L0010875计åå§æå¯ä»¥è®©äº¤æè
é¢å
设å®ç®",chart:{title:"L0006966å¾ç¤ºè¯´æ",info:[{label:"L0001930ä¹°å
¥",key:"buy",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/plan-order-chart-dark.png")),light:"".concat((0,nq.m2)("/assets/images/ordermode/plan-order-chart-light.png"))},context:["L0010886妿å½åå¸åºä»·æ ¼æ¯100触åä»·"]}]}}},..."ETF"===r?[]:[{key:eN.xo.oco,label:"OCO",value:eN.xo.oco,description:{title:(0,i.jsxs)(nV,{children:[l("L0015241OCOOneCancelsTh"),o?null:(0,i.jsx)(eP.A,{target:"_blank",rel:"noreferrer",href:"/support/articles/44365578384921",children:l("L0015242æ¥çæç¨")}),(0,i.jsxs)("div",{className:"title2",children:[l("L0015243ä¹°å
¥æ¶ä¸ä¸ªéä»·æåºåä¸ä¸ªé价追"),(0,i.jsx)("br",{}),l("L0015244ååºæ¶ä¸ä¸ªéä»·æ¢çåä¸ä¸ªéä»·æ¢")]})]}),chart:{title:"L0006966å¾ç¤ºè¯´æ",info:[{label:"L0001930ä¹°å
¥",key:"buy",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/oco-buy-dark.png")),light:"".concat((0,nq.m2)("/assets/images/ordermode/oco-buy-light.png"))},context:["L0015245ææä¹°å
¥æ¶ç¨æ·å¯ä»¥åæ¶è®¾å®å¨ä½","".concat(l("L0006967举ä¾è¯´æ"),"\n").concat(l("L0015246å½åææ°ä»·æ ¼æ¯2000Aå½ä»·æ ¼"),"\n").concat(l("L0015247åä¹å½ä»·æ ¼ä¸æ¶¨è³3000Cæ¶è¿½"))]},{label:"L0001931ååº",key:"sell",img:{dark:"".concat((0,nq.m2)("/assets/images/ordermode/oco-sell-dark.png")),light:"".concat((0,nq.m2)("/assets/images/ordermode/oco-sell-light.png"))}
1,context:["L0015248ææååºæ¶ç¨æ·å¯ä»¥åæ¶è®¾å®å¨é«","".concat(l("L0006967举ä¾è¯´æ"),"\n").concat(l("L0015249å½åææ°ä»·æ ¼æ¯2000Aå½ä»·æ ¼"),"\n").concat(l("L0015250åä¹å½ä»·æ ¼ä¸è·è³1000Cæ¶æ¢"))]}]}}}]],[l,r,o]).find(e=>e.key===t);return s?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nH.A,{popupWidth:360,placement:"top",title:(0,i.jsxs)("div",{className:"text-xs leading-4 font-normal",children:[(0,i.jsx)("p",{children:l(s.label)}),(0,i.jsxs)("p",{children:["string"==typeof s.description.title?l(s.description.title):s.description.title,!o&&(0,i.jsx)(eP.A,{target:"_blank",href:"/support/articles/21425396248089",rel:"noreferrer",children:l("L0003821äºè§£æ´å¤")})]})]}),children:(0,i.jsx)(nW,{className:"info_outlined ".concat(n?"no_right_margin":""),style:{marginLeft:16}})})}):null};var nY=n(89312);let nK=e=>{let{symbol:t,matchBusiness:n,enabled:l=!0}=e,[r,i]=(0,a.useState)(null),[o,s]=(0,a.useState)(!1),d=(0,a.useMemo)(()=>r&&(r.contractSymbolMaxLeverRatio||r.defaultContractSymbolMaxLeverRatio)||null,[r]),c=(0,a.useMemo)(()=>r&&(r.contractSymbol||r.defaultContractSymbol)||null,[r]),u=(0,a.useMemo)(()=>!!r&&!!r.defaultContractSymbol&&!!r.defaultContractSymbolMaxLeverRatio,[r]),p=(0,ei.default)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t&&n&&l){s(!0);try{let l=await eA.Ay.coinWalletCenterConfigAssetSymbolMatchBusiness({symbol
1:t,matchBusiness:n},void 0,e?(0,tN.u)("leverage_ratio"):void 0);i(l)}catch(e){console.error("è·åæ æåæ°å¤±è´¥:",e)}finally{s(!1)}}}),m=(0,a.useCallback)(()=>{p()},[p]);return(0,a.useEffect)(()=>{p(!0)},[t,n,l]),{data:r,loading:o,refetch:m,leverageRatio:d,contractSymbol:c,isContractTrade:u}},n$=e=>{let{className:t}=e;return(0,i.jsxs)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.825 1.5C12.85 1.5 14.5 3.15 14.5 5.175C14.5 6.235 14.05 7.19 13.325 7.855C13.355 8.085 13.37 8.325 13.37 8.565C13.37 11.84 10.71 14.5 7.435 14.5C4.16 14.5 1.5 11.835 1.5 8.565C1.5 5.295 4.16 2.63 7.435 2.63C7.675 2.63 7.915 2.645 8.145 2.675C8.81 1.95 9.765 1.5 10.825 1.5ZM7.435 13.5C10.155 13.5 12.37 11.285 12.37 8.565V8.505C12.365 8.14 12.32 7.78 12.24 7.44C11.815 5.62 10.38 4.185 8.56 3.76C8.22 3.68 7.86 3.635 7.495 3.63H7.435C4.715 3.63 2.5 5.845 2.5 8.565C2.5 11.285 4.715 13.5 7.435 13.5ZM10.825 2.5C10.28 2.5 9.775 2.665 9.35 2.95C11.085 3.54 12.46 4.915 13.05 6.65C13.335 6.225 13.5 5.72 13.5 5.175C13.5 3.7 12.3 2.5 10.825 2.5ZM5.91397 8.57935L7.3291 7.16421L8.74423 8.57935L7.3291 9.99448L5.91397 8.57935ZM7.20536 5.87374C7.2737 5.8054 7.3845 5.8054 7.45285 5.87374L10.0347 8.4556C10.103 8.52394 10.103 8.63475 10.0347 8.70309L7.45285 11.2849C7.3845 11.3533 7.2737 11.3533 7.20536 11.2849L4.6235 8.70309C4.55516 8.63475 4.55516 8.52394 4.6235 8.4556L7.20536 5.87374Z",fill:"url(#paint0_linear_2248_118167)"}),(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{id:"paint0_linear_2248_118167",x1:"1.5",y1:"9.76429",x2:"14.5",y2:"9.76429",gradientUnits:"userSpaceOnUse",children:[(0,i.jsx)("stop",{stopColor:"#19FABE"}),(0,i.jsx)("stop",{offset:"0.35184",stopColor:"#84F7C1"}),(0,i.jsx)("stop",{offset:"0.700035",stopColor:"#E7EC62"}),(0,i.jsx)("stop",{offset:"1",stopColor:"#FFDB00"})]})})]})};function nX(){let e=(0,u._)(["\n &::before {\n content: '';\n display: block;\n width: 1px;\n height: 16px;\n background-color: ",";\n }\n "]);return nX=function(){return e},e}function nJ(){let e=(0,u._)(["\n justify-content: ",";\n\n .to_futures_trade_button {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n ","\n }\n"]);return nJ=function(){return e},e}function n0(){let e=(0,u._)(["\n font-size: ",";\n padding: 2px;\n\n & {\n font-weight: 500;\n color: ",";\n /** @noflip */\n background: var(\n --gradient-green-yellow,\n linear-gradient(90deg, #19fabe 0%, #84f7c1 35.18%, #e7ec62 70%, #ffdb00 100%)\n );\n background-clip: text;\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n }\n svg {\n font-size: 16px !important;\n margin-right: 2px;\n }\n"]);return n0=function(){return e},e}let n1=(0,m.Ay)(nY.A)(nJ(),e=>e.flexEnd?"flex-end":"space-between",e=>!e.flexEnd&&(0,h.AH)(nX(),V.f8)),n2=(0,m.Ay)(T.A)(n0(),e=>(e.splitBuySell,"14px"),V.vZ),n6=(0,a.memo)(e=>{let{after:t,splitBuySell:n}=e,{t:l}=(0,S.A)(),r=(0,_.A)(),[o]=(0,tk.LV)(),s=o(tk.qR.Contract),{modal:c}=(0,nP.A)(),[{postArea:u,exchangeState:p}]=(0,d.d4)(e=>({postArea:e.postArea,exchangeState:e.exchangeState})),{isMobile:m}=(0,f.Px)(),h=(0,a.useMemo)(()=>"ETF"===u?"ETF":"SPOT",[u]),{leverageRatio:x,contractSymbol:v,isContractTrade:g}=nK({symbol:(null==p?void 0:p.tradeSymbol)||"",matchBusiness:h,enabled:!!(null==p?void 0:p.tradeSymbol)}),b=(0,a.useMemo)(()=>"/futures/".concat((v||"").toLowerCase()),[v]),y=(0,a.useMemo)(()=>x&&!s&&"ETF"!==u,[s,u,x]),A=(0,a.useMemo)(()=>(0,i.jsx)(i.Fragment,{children:x&&"".concat(x,"x")}),[x,l]),j=(0,a.useCallback)(()=>{if(g){let e=c.confirm({title:l("L0000720温馨æç¤º"),width:m?311:380,closable:!0,okText:l("L0007906ç«å³åå¾"),content:l("L0019069该èµäº§çåçº¦äº¤æææªä¸çº¿è¦åå¾"),onOk:()=>{e.destroy(),r.push(b)}});return}r.push(b)},[g,b,c,l,r,m]);return(0,i.jsxs)(n1,{align:"center",size:2,flexEnd:!t,children:[(0,i.jsx)("div",{className:"to_futures_trade_button",children:y&&(0,i.jsx)(n2,{splitBuySell:n,size:"middle",type:"text",shape:"square",hovered:!1,height:20,variant:"secondary",onClick:j,children:(0,i.jsxs)(er.A,{inline:!0,align:"center",children:[(0,i.jsx)(n$,{className:"futureIcon"}),A]})})}),t]})}),n4=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{debug:t=!1}=e,{t:n}=(0,S.A)(),l=(0,a.useRef)(null),[r,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=()=>{let e=l.current;e&&(e.clientWidth>330?r&&(i(!1),t&&console.log("宽度è¶
è¿330pxï¼è§£é¤æå ç¶æ :>>",{clientWidth:e.clientWidth}
1)):i(!0))};e();let n=new ResizeObserver(()=>{e()});return l.current&&n.observe(l.current),()=>{n.disconnect()}},[n]),{ref:l,isOverflow:r}};var n3=n(17426),n5=n(42185),n8=n(46700),n7=n(57478),n9=n(70509),le=n(17195);let lt={getName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n9.t;return e?t(e===le.wM.ISOLATED?"L0001081éä»":"L6661899å
¨ä»"):""},getTitle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n9.t;return e?t(e===le.wM.ISOLATED?"é仿 æ":"L0016382å
¨ä»æ æ"):""},getLeverageModeTitle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n9.t;return t(e===le.lO.NORMAL?"L0018023æ®éç¹æ®è¯´ææ¢ä¸ä¸ªæ°çkeyè±":e===le.lO.AUTOLOAN?"L0016354èªå¨å款":"L0016356èªå¨è¿æ¬¾")}};function ln(){let e=(0,u._)(["\n border-radius: 20px 20px 0px 0px;\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n .subTitle {\n color: ",";\n }\n .lbank-modal-body {\n }\n .current_lever {\n color: ",";\n font-size: 14px;\n line-height: 16px;\n margin-bottom: 6px;\n }\n .lbank-slider-mark-content {\n ","\n }\n .input_wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n margin-bottom: 8px;\n .input_adjust {\n border-radius: 2px;\n border: 1px solid ",";\n height: 40px;\n padding: 12px 8px;\n margin: 0;\n display: flex;\n align-items: baseline;\n flex: 1;\n cursor: text;\n &:hover {\n background: ",";\n }\n &.focused {\n background: ",";\n border: 1px solid ",";\n }\n }\n .lever_input {\n background-color: transparent;\n border: 0;\n outline: 0;\n font-size: 14px;\n line-height: 16px;\n color: ",";\n }\n .x {\n color: ",";\n font-size: 14px;\n line-height: 16px;\n }\n span.lever_input {\n position: absolute;\n pointer-events: none;\n opacity: 0;\n min-width: 5px;\n }\n &.long {\n .lever_input,\n .x {\n color: ",";\n }\n }\n &.short {\n .lever_input,\n .x {\n color: ",";\n }\n }\n }\n\n .set_btn {\n width: 28px;\n height: 28px;\n background-color: transparent;\n color: ",";\n line-height: 24px;\n border: 0;\n .lbank-icon {\n font-size: 28px;\n }\n }\n\n .warning {\n color: ",";\n font-size: 12px;\n line-height: 14px;\n padding-top: 12px;\n min-height: 26px;\n\n &.error {\n color: ",";\n }\n\n + .current_lever {\n padding-top: 20px;\n }\n }\n\n .footer {\n padding-top: 34px;\n .btn_confirm {\n width: 100%;\n height: 44px;\n }\n }\n"]);return ln=function(){return e},e}let ll=(0,m.Ay)(n7.default)(ln(),V.vZ,V.vZ,e=>e.theme.bizTypography.r14,V.m$,e=>{var t;return(null===(t=e.theme.components.Input)||void 0===t?void 0:t.hoverBgColor)||"#1F2024"},e=>{var t;return(null===(t=e.theme.components.Input)||void 0===t?void 0:t.focusBgColor)||"#1F2024"},e=>{var t;return null===(t=e.theme.components.Input)||void 0===t?void 0:t.focusBorderColor},V.vZ,V.vZ,V.LG,V.gd,V.fG,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizState.warning[1]},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizState.danger[1]}),lr=e=>{let{lever:t,numLever:n,setLever:l,updateLever:r}=e,o=(0,a.useRef)(null),s=(0,a.useRef)(null);(0,eo.A)(()=>{s.current&&(s.current.style.width="".concat(o.current.offsetWidth,"px"))});let[d,c]=(0,a.useState)(!1);return(0,i.jsxs)("div",{className:"input_adjust ".concat(d?"focused":""),onClick:()=>{var e;null===(e=s.current)||void 0===e||e.focus()},children:[(0,i.jsx)("input",{ref:s,value:t,className:"lever_input",onChange:e=>{e.target.value?r(parseInt(e.target.value.replace(/[^\d]+/g,""),10)||n):l("")},onFocus:()=>{c(!0)},onBlur:()=>{c(!1),""===t&&r(1)},type:"text"}),(0,i.jsx)("span",{ref:o,className:"lever_input",children:t}),(0,i.jsx)("span",{className:"x",children:"x"})]})},li=(0,a.memo)(e=>
1{let{title:t,inputLever:n,onLeverChange:l}=e,{tradeType:r}=(0,nD.pI)(),[{tradeSymbol:o}]=(0,d.d4)(e=>({tradeSymbol:e.exchangeState.tradeSymbol})),{assetItem:s}=(0,tL.A)(o,"spot"),c=(0,a.useRef)(n),u="BUY"===r?null==s?void 0:s.maxQuoteLeverageRatio:null==s?void 0:s.maxBaseLeverageRatio,p=(0,n8.A)(),m=(0,tD.default)(e=>{l(e)});(0,a.useEffect)(()=>{n&&(m(n),c.current=n,p())},[n]);let h=Number(n||1),x=Math.floor(+(u||0)),f=(0,ei.default)(e=>{m(Math.min(x||1,Math.max(1,e)))});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"current_lever",children:t}),(0,i.jsx)("div",{className:"input_wrapper",children:(0,i.jsx)(lr,{lever:n,numLever:h,setLever:m,updateLever:f})}),(0,i.jsx)(n5.A,{className:"slider",step:1,breakPointCount:x,renderTooltip:e=>"".concat(e,"x"),graduated:!0,progress:!0,min:1,max:x,value:h,onChange:m,onlyInclusioMark:!1,renderMark:e=>{let t=Math.round(1/x*100),n=100/(x-1);return"".concat(Math.round((e-t)/n)+1,"x")}})]})}),la=(0,a.memo)(e=>{let{visible:t,onCancel:n,onOk:l}=e,{t:r}=(0,S.A)(),{isLogin:o}=(0,b.Z)(),{tradeType:s}=(0,nD.pI)(),[c,u]=(0,tX.A)(!1),[{assetLeverageRatio:p,postLeverageRatio:m,positionType:h,tradeAsset:x,tradePost:f},v]=(0,d.d4)(e=>({tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost,positionType:e.exchangeState.positionType,assetLeverageRatio:e.exchangeState.assetLeverageRatio,postLeverageRatio:e.exchangeState.postLeverageRatio})),[g,y]=(0,a.useState)(("BUY"===s?m:p)||0);return(0,i.jsx)(ll,{className:"leverages_settings_modal",closable:!0,title:lt.getTitle(h,r),destroyOnClose:!0,open:t,onCancel:n,cancelButtonProps:o?void 0:{style:{display:"none"}},okButtonProps:{loading:c,...o?null:{block:!0}},okText:r(o?"L0000060确认":"L0015469ç»å½åæ´æ¹"),onOk:()=>u(null==l?void 0:l({assetCode:"BUY"===s?f:x,leverage:Number(g)||1})).finally(()=>{v({exchangeState:"BUY"===s?{postLeverageRatio:Number(g)||1}:{assetLeverageRatio:Number(g)||1}})}),children:(0,i.jsx)(li,{title:r("L0001074æ æåæ°"),inputLever:g,onLeverChange:e=>{y(e)}})})}),lo=(0,a.memo)(e=>{let{children:t}=e,{t:n}=(0,S.A)(),{isLogin:l}=(0,b.Z)(),r=(0,_.A)(),{isMobile:o}=(0,f.Px)(),[s,c]=(0,tX.A)(!0),[u,p]=(0,a.useState)({}),[m,h]=(0,eL.A)(),[{assetLeverageRatio:x,postLeverageRatio:v,positionType:g,tradeSymbol:y},A]=(0,d.d4)(e=>({tradeSymbol:e.exchangeState.tradeSymbol,assetLeverageRatio:e.exchangeState.assetLeverageRatio,postLeverageRatio:e.exchangeState.postLeverageRatio,positionType:e.exchangeState.positionType})),{assetItem:j}=(0,tL.A)(y,"spot"),{getCurrencyPairLoanCalc:L}=(0,tM.A)();(0,ei.default)(()=>{var e;if(!(null===(e=r.query)||void 0===e?void 0:e.id))return;let t=r.query.id.split("_");c(eA.Ay.getLeverageTradeCenterApiUserGet({currencyTypes:t.join(",")})).then(e=>{var t;p(null==e?void 0:null===(t=e.resultList)||void 0===t?void 0:t.reduce((e,t)=>(e[t.currencyType]=t,e),{}))})});let{tradeType:C}=(0,nD.pI)(),w="BUY"===C?v:x,[k,N,P]=(0,tt.A)(la),O=async()=>{o&&ts.A.show(n("L0017967æä¸æ¯æä¿®æ¹æ æåæ°"))};return(0,i.jsxs)(i.Fragment,{children:[t?t({showModal:O}):(0,i.jsxs)(T.A,{className:"btn_lever",onClick:O,ref:e=>m(e),shape:"round",size:"middle",children:[(0,i.jsx)("div",{className:"center",children:(0,i.jsx)(t0.A,{fixedWidth:h.width?h.width-34:void 0,defaultFontSize:12,lineHeight:14,fontWeight:400,minFontSize:1,children:lt.getName(g,n)})}),"\xa0",w&&(0,i.jsxs)("div",{className:"leverageRatio title",children:[w||"--","x"]}),w&&(0,i.jsx)(E.A,{children:(0,i.jsx)(n3.A,{})})]}),N()]})});var ls=n(79936);let ld=(0,a.memo)(()=>{let{t:e}=(0,S.A)(),{isLogin:t}=(0,b.Z)(),{tradeType:n}=(0,nD.pI)(),[l,r]=(0,a.useState)(!1),[o,s]=(0,eL.A)(),[{leverageBaseMode:c,leveragePostMode:u,tradeSymbol:p},m]=(0,d.d4)(e=>({tradeSymbol:e.exchangeState.tradeSymbol,leverageBaseMode:e.exchangeState.leverageBaseMode,leveragePostMode:e.exchangeState.leveragePostMode})),h="BUY"===n?u:c,x=(0,tD.default)(async e=>{m({exchangeState:"BUY"===n?{leveragePostMode:e}:{leverageBaseMode:e}}),p&&r(!1)}),f=[{key:le.lO.NORMAL,title:e("L0018023æ®éç¹æ®è¯´ææ¢ä¸ä¸ªæ°çkeyè±"),desc:e("L0016791使ç¨ç¨æ·å·²æèµäº§äº¤æ")},{key:le.lO.AUTOLOAN,title:e("L0016354èªå¨å款"),desc:e("L0016792ç³»ç»æ ¹æ®äº¤æé
1æ±èªå¨å款")},{key:le.lO.AUTOPAY,title:e("L0016356èªå¨è¿æ¬¾"),desc:e("L0016793ç³»ç»æ ¹æ®äº¤æéæ±èªå¨å¿è¿å款")}],v=async()=>{r(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(T.A,{onClick:v,className:"btn_margin_mode",ref:e=>o(e),shape:"round",size:"middle",children:[(0,i.jsx)("div",{className:"center",children:(0,i.jsx)(t0.A,{defaultFontSize:12,lineHeight:14,fontWeight:400,minFontSize:1,fixedWidth:s.width?s.width-18:void 0,className:"title",children:lt.getLeverageModeTitle(h,e)})}),(0,i.jsx)(E.A,{children:(0,i.jsx)(n3.A,{})})]}),(0,i.jsx)(ls.A,{options:f,open:l,title:e("L0016847忬¾è¿æ¬¾æ¨¡å¼"),value:h,onCancel:()=>{r(!1)},onOk:e=>{x(e)}})]})});function lc(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n margin: 12px 16px 0 16px;\n background-clip: content-box;\n ","\n\n .btn_lever,\n .btn_margin_mode {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 500;\n line-height: 14px;\n min-width: 0;\n\n > span {\n min-width: 10px;\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .center {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n\n .title {\n }\n }\n\n .up {\n margin-right: 8px;\n }\n .lbank-icon-ArrowDown svg {\n font-size: 14px;\n color: ",";\n margin-left: 4px;\n }\n }\n\n .btn_lever {\n cursor: not-allowed;\n .lbank-icon-ArrowDown svg {\n color: ",";\n }\n }\n"]);return lc=function(){return e},e}let lu=m.Ay.div(lc(),(0,V.SW)(8),V.vZ,V.fG),lp=(0,a.memo)(()=>(0,i.jsxs)(lu,{className:"trade_orderboard_topbar",children:[(0,i.jsx)(lo,{}),(0,i.jsx)(ld,{})]}));var lm=n(71948),lh=n(58993),lx=function(e){return e.borrow="borrow",e.repay="repay",e}({}),lf=function(e){return e.quantity="quantity",e.percent="percent",e.assetCode="assetCode",e.userLeverage="userLeverage",e}({}),lv=n(47706),lg=n(11595),lb=n(43663),ly=n.n(lb),lA=n(76124),lj=n(59606),lL=n(20502),lC=n(85060),lw=n.n(lC);let lk=e=>{let{assetCode:t,tradingType:n=eN.Nn.leverage}=e,{openTransferModal:l}=(0,tw.A)({leverCode:t}),{navigateToLoginOrElseFn:r}=(0,t_.A)();return{goToDeposit:(0,ei.default)(()=>{r(()=>l(void 0,eg.lQ,n===eN.Nn.leverage?"SPOT_TO_LEVER":"FUTURES_TO_SPOT"))})}};var l_=n(19837),lN=n(35150),lT=n(65826),lS=n(47521),lE=n(31497);function lP(){let e=(0,u._)(["\n margin-left: 4px;\n &.lbank-btn-only-icon,\n &.lbank-btn-icon-only {\n font-size: 20px;\n width: auto;\n height: auto;\n }\n"]);return lP=function(){return e},e}function lO(){let e=(0,u._)(["\n min-width: 10px;\n\n &.ant-form {\n .ant-form-item label {\n ",";\n }\n .ant-form-item {\n margin-bottom: 12px !important;\n .ant-form-item-label {\n margin-bottom: 8px;\n width: fit-content;\n & > label {\n ",";\n }\n }\n .ant-form-item-explain-error {\n margin-top: 4px;\n }\n }\n }\n"]);return lO=function(){return e},e}function lR(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n ",";\n color: ",";\n\n .text {\n margin-right: 12px;\n }\n\n .divide {\n width: 0.5px;\n height: 12px;\n background-color: ",";\n }\n\n .allButton {\n margin-left: 12px;\n color: ",";\n cursor: pointer;\n }\n"]);return lR=function(){return e},e}function lI(){let e=(0,u._)(["\n clear: both;\n"]);return lI=function(){return e},e}function lM(){let e=(0,u._)(["\n min-height: 322px;\n .loan-info {\n color: ",";\n ",";\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n &-title {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n margin-left: 2px;\n }\n\n .question-icon {\n cursor: pointer;\n }\n }\n\n &-value {\n color: ",";\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n font-size: 16px;\n color: ",";\n }\n }\n }\n\n .more_info {\n color: ",";\n display: inline-flex;
1\n align-items: center;\n\n svg {\n margin-left: 4px;\n font-size: 16px;\n color: ",";\n }\n }\n\n .alert-info {\n margin-top: 20px;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n gap: 6px;\n align-self: stretch;\n border-radius: 4px;\n background: ",";\n\n .lbank-alert-header {\n align-items: center;\n }\n\n .lbank-alert-icon {\n svg {\n width: 20px;\n height: 20px;\n }\n }\n .lbank-alert-title {\n color: ",";\n ","\n min-width: 0;\n }\n }\n"]);return lM=function(){return e},e}let lz=(0,m.Ay)(T.A)(lP()),lF=(0,m.Ay)(lg.A)(lO(),e=>e.theme.bizTypography.r12,e=>e.theme.bizTypography.r14),lD=m.Ay.div(lR(),e=>e.theme.bizTypography.r14,V.fG,V.fG,V.D$),lU=m.Ay.div(lI()),lB=m.Ay.div(lM(),V.fG,e=>e.theme.bizTypography.r14,V.vZ,V.vZ,V.D$,V.D$,V.fn,V.mi,e=>e.theme.bizTypography.r14),lq=(0,a.memo)(e=>{let{form:t,loanType:n,defaultAssetCode:l="usdt",onFieldsChange:r,setOkHidden:o}=e,{t:s}=(0,S.A)(),{prefix:d,withClassPrefix:c}=(0,lv.A)("loan-form"),u=(0,t4.A)(),[p,m]=(0,tX.A)(!0),{mounted:h}=(0,Y.A)(),[x]=(0,td.A)(),[f,v]=(0,a.useState)({}),g=(0,L.A)(),b=(0,et.F)(f),[y,A]=(0,a.useState)(0),j=lF.useWatch([],t),{assetItem:C}=(0,tL.A)(null==j?void 0:j.assetCode,"coin"),{observeLeverageLoanRepaymentNotificationUpdate:w}=(0,X.A)(),[k,_]=(0,a.useState)(""),N=(0,a.useMemo)(()=>{var e;return null===(e=(null==C?void 0:C.alias)||l)||void 0===e?void 0:e.toLocaleUpperCase()},[null==C?void 0:C.alias,l]),T=(0,a.useMemo)(()=>(0,q.A)((null==f?void 0:f.borrowedQuantity)||0).plus((null==f?void 0:f.interestQuantity)||0).toFixed(),[null==f?void 0:f.borrowedQuantity,null==f?void 0:f.interestQuantity]),E=n===lx.borrow?(null==f?void 0:f.maxBorrowQuantity)||0:(0,q.A)(T).gt((null==f?void 0:f.availableQuantity)||0)?(null==f?void 0:f.availableQuantity)||0:T,{goToDeposit:P}=lk({assetCode:null==j?void 0:j.assetCode,tradingType:lT.N.leverage});(0,a.useEffect)(()=>{(null==j?void 0:j.assetCode)&&(t.setFields([{name:lf.userLeverage,value:"",errors:[]}]),_(""),m(eA.Ay.postLeverageTradeCenterApiLoanBorrowCalc({currency:j.assetCode})).then(e=>{v(e),(null==e?void 0:e.userLeverage)&&t.setFields([{name:lf.userLeverage,value:null==e?void 0:e.userLeverage,errors:[]}])}).catch(e=>{(null==e?void 0:e.message)&&_(e.message),v({})}))},[null==j?void 0:j.assetCode,n]),(0,a.useEffect)(()=>{let e=w(e=>{if((null==e?void 0:e.data)&&(null==e?void 0:e.data.pair)===(null==j?void 0:j.assetCode)){let t=(null==e?void 0:e.data)||{};v({...b.current,hourlyInterestRate:t.hourlyInterestRate||b.current.hourlyInterestRate,availableQuantity:t.availableBalance||b.current.availableQuantity,borrowedQuantity:t.alreadyBorrowed||b.current.borrowedQuantity,maxBorrowQuantity:t.maxAlreadyBorrowed||b.current.maxBorrowQuantity,minBorrowQuantity:b.current.minBorrowQuantity,interestQuantity:t.interest||b.current.interestQuantity,maxOpenQuantity:t.availableOpen||b.current.maxOpenQuantity,minRepayQuantity:b.current.minRepayQuantity})}});return()=>{e()}},[null==j?void 0:j.assetCode]);let O=(0,tD.default)((e,t)=>{let{quantity:n,percent:l}=e,r=n,i=l;return t===lf.percent?r=(0,l_.mj)(E,l,(null==C?void 0:C.precision)||8):i=(0,l_.kn)(r,E),{quantity:r,percent:i}}),R=(0,tD.default)(e=>{let{percent:t}=O({quantity:e},lf.quantity);return A(parseInt(null!=t?t:"0",10)),e}),I=async e=>{if(k)return Promise.reject(Error(k));if(!e)return Promise.reject(Error(s("L0000508请è¾å
¥æ°é")));if(n===lx.borrow){if(Number(e)<Number(null==f?void 0:f.minBorrowQuantity))return Promise.reject(Error(s("L0016495æå°å款æ°é为",{0:null==f?void 0:f.minBorrowQuantity})));if(Number(e)>Number(null==f?void 0:f.maxBorrowQuantity))return Promise.reject(Error(s("L0016846æå¤§å¯åæ°é为",{0:null==f?void 0:f.maxBorrowQuantity})))}else if(Number(e)<Number(null==f?void 0:f.minRepayQuantity))return Promise.reject(Error(s("L0016493æå°è¿æ¬¾æ°é为",{0:null==f?void 0:f.minRepayQuantity})));else if(Number(e)>Number(T))return Promise.reject(Error(s("L0016845æå¤§è¿æ¬¾æ°é为",{0:T})));return Promise.resolve()},M=(0,tD.default)(e=>{t.setFields([{name:e,errors:[]}])}),z=(0,tD.default)(e=>{let t=document.activeElement;
1e.target.focus(),t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"center"})},300)}),F=(0,tD.default)(e=>{let{quantity:n}=O({percent:"".concat(e)},lf.percent);t.setFieldsValue({quantity:n}),t.validateFields([lf.quantity]),A(e)}),D=(0,tD.default)(()=>{setTimeout(()=>{t.setFieldsValue({quantity:E}),R(E),setTimeout(()=>{t.validateFields([lf.quantity])})})});(0,a.useEffect)(()=>{t.resetFields(),t.setFields([{name:lf.assetCode,value:l,errors:[]}])},[n,l]),(0,a.useEffect)(()=>{t.resetFields([lf.quantity]),A(0),n===lx.repay&&(null==f?void 0:f.borrowedQuantity)==="0"?null==o||o(!0):null==o||o(!1)},[null==j?void 0:j.assetCode,n,null==f?void 0:f.borrowedQuantity]);let U=n===lx.borrow?[{label:(0,i.jsxs)(i.Fragment,{children:[s("L0006861å°æ¶å©ç"),(0,i.jsx)(lL.A,{placement:"topLeft",title:s("L0016738åå
¥èµäº§æ¶ä¼ç«å³äº§ç1å°æ¶çå©"),children:(0,i.jsx)(nB.A,{className:"question-icon"})})]}),value:(0,i.jsx)(em.A,{children:(null==f?void 0:f.hourlyInterestRate)&&(null==f?void 0:f.hourlyInterestRate)!=="--"?"".concat((0,Q.gO)((0,q.A)((null==f?void 0:f.hourlyInterestRate)||0).times(100).toFixed(),8),"%"):"--"})},{label:s("L0007349å¯ç¨"),value:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.availableQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]}),!g&&(0,i.jsx)(lz,{prefixIcon:(0,i.jsx)(lj.A,{}),type:"link",onClick:P})]})},{label:(0,i.jsx)(i.Fragment,{children:s("L0016378å·²å")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.borrowedQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]})},{label:(0,i.jsx)(i.Fragment,{children:s("L0016662æå¤§å¯å")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.maxBorrowQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]})}]:[{label:s("L0007349å¯ç¨"),value:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.availableQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]}),!g&&(0,i.jsx)(lz,{prefixIcon:(0,i.jsx)(lj.A,{}),type:"link",onClick:P})]})},{label:(0,i.jsx)(i.Fragment,{children:s("L0016378å·²å")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.borrowedQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]})},{label:(0,i.jsx)(i.Fragment,{children:s("L0002788婿¯")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((null==f?void 0:f.interestQuantity)||"--",(null==C?void 0:C.precision)||8))," ",N]})},{label:(0,i.jsx)(i.Fragment,{children:s("L0016663å
¨é¨å款")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)((0,Q.w6)(T)?"--":T,(null==C?void 0:C.precision)||8))," ",N]})}];return(0,i.jsx)(lB,{children:(0,i.jsxs)(lF,{form:t,layout:"vertical",className:c(),onFieldsChange:r,children:[(0,i.jsx)(lF.Item,{name:lf.assetCode,label:s("L0018024å¸ç§ç¹æ®è¯´ææ¢ä¸ä¸ªæ°çkeyè±"),className:d("assetCode"),children:(0,i.jsx)(lS.A,{})}),n===lx.repay&&0==+(null==f?void 0:f.borrowedQuantity)?(0,i.jsx)(lN.A,{type:"info",className:"alert-info",title:(0,i.jsx)(lE.A,{placement:u?"topRight":"topLeft",noTooltip:!0,children:"".concat(s("L0016804æ¨è¿æªåè¿")," ").concat(((null==C?void 0:C.alias)||"").toLocaleUpperCase())})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(er.A,{inline:!0,direction:"vertical",size:8,top:8,bottom:20,children:[U.map(e=>(0,i.jsxs)("div",{className:"loan-info",children:[(0,i.jsx)("div",{className:"loan-info-title",children:e.label}),(0,i.jsx)("div",{className:"loan-info-value",children:e.value})]})),(0,i.jsx)("div",{children:(0,i.jsxs)(eP.A,{target:"_blank",href:"/support/articles/1948282160930619392",className:"more_info",children:[s("L0016789ç¹å»æ¥çæ´å¤åè´·å©çåéé¢")," ",(0,i.jsx)(to.A,{})]})})]}),(0,i.jsx)(lF.Item,{name:lf.quantity,getValueFromEvent:R,className:d("quantity"),validateTrigger:["onBlur","onChange"],label:s(n===lx.borrow?"L0016665忬¾æ°é":"L0006886è¿æ¬¾æ°é"),rules:[()=>({required:!0,validator:(e,t)=>I(t)})],children:(0,i.jsx)(lA.A,{addonAfter:(0,i.jsxs)(lD,{children:[(0,i.jsx)("div",{className:"text",children:N}),(0,i.jsx)("div",{className:"divide"}),(0,i.jsx)("div",{className:"allButton",onClick:D,children:"All"})]}),onFocus:lw()(z,ly()(M,"quantity")),precision:(null==C?void 0:C.precision)||8,noNegative:!0,placeholder:s("L0001979请è¾å
¥"),controls:!1})}),(0,i.jsx)(lU,{className:"slider_wrapper",children:(0,i.jsx)(n5.A,{value:y,graduated:!0,onChange:F,breakPointCount:5,onlyInclusioMark:!1,shape:"diamond",progress:!0,renderMark:e=>"".concat(e,"%"),min:0,max:100})})]}),(0,i.jsx)(lF.Item,{name:lf.userLeverage,noStyle:!0})]})})});function lH(){let e=(0,u._)(["\n margin-bottom: -16px;\n "]);return lH=function(){return e},e}function lZ(){let e=(0,u._)(["\n border-radius: 20px 20px 0px 0px;\n pointer-events: none;\n\n .lbank-modal-header {\n margin-bottom: -20px;\n padding-top: 9px;\n padding-bottom: 20px;\n\n ","\n }\n\n .modal-title-wrapper,\n .modal-title-content {\n width: 100%;\n }\n\n .lbank-modal-close {\n margin-top: 15px;\n }\n\n .leverage_loan_tabs {\n }\n\n .subTitle {\n color: ",";\n }\n .current_close {\n color: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 20px;\n }\n\n .avail_close {\n display: flex;\n justify-content: space-between;
1\n align-items: center;\n margin-bottom: 8px;\n\n &_title {\n color: ",";\n ",";\n }\n\n &_title_zero {\n color: ",";\n display: flex;\n align-items: center;\n\n svg {\n margin-left: 2px;\n color: ",";\n }\n ",";\n }\n\n &_info {\n color: ",";\n ",";\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n &-flag {\n color: ",";\n margin-right: 4px;\n }\n\n &-value {\n display: flex;\n align-items: center;\n\n svg {\n color: ",";\n font-size: 16px;\n }\n }\n }\n }\n\n .closeâasset {\n padding-top: 20px;\n color: ",";\n ",";\n\n &-title {\n margin-bottom: 8px;\n }\n\n .estimate-close-asset {\n margin-top: 4px;\n color: ",";\n display: flex;\n align-items: center;\n\n .estimate-close-title {\n margin-right: 4px;\n color: ",";\n }\n }\n }\n\n .position-sort-item {\n height: 60px;\n display: flex;\n align-items: center;\n color: ",";\n ",";\n background: ",";\n padding: 0;\n margin: 0 -24px;\n padding-left: 24px;\n }\n\n .lbk_dnd_drag_icon {\n right: 10px;\n svg {\n font-size: 20px;\n }\n }\n"]);return lZ=function(){return e},e}let lG=(0,m.Ay)(n7.default)(lZ(),f.XG.mobile((0,h.AH)(lH())),V.vZ,V.vZ,V.vZ,e=>e.theme.bizTypography.r14,V.fG,V.fG,e=>e.theme.bizTypography.r14,V.vZ,e=>e.theme.bizTypography.r14,V.fG,V.vZ,V.vZ,e=>e.theme.bizTypography.r14,V.vZ,V.fG,V.vZ,e=>e.theme.bizTypography.m14,V.zz),lW=(0,s.ih)((0,a.memo)(e=>{var t;let{visible:n,onCancel:l,onOk:r,defaultAssetCode:o,defaultLoanType:d,symbol:c}=e,{t:u}=(0,S.A)(),{isLogin:p}=(0,b.Z)(),[m,h]=(0,a.useState)(!1),[x,f]=(0,tX.A)(!1),[v]=lg.A.useForm(),g=lg.A.useWatch([],v),[y,A]=(0,a.useState)(!1),[j,L]=(0,a.useState)(d||lx.borrow),C=(0,_.A)(),w=c||(null===(t=C.query)||void 0===t?void 0:t.id)||"",k=(0,a.useRef)(w),{tradeWS:N}=(0,s.pP)(),{observeLeverageLoanStatusNotificationUpdate:T}=(0,X.A)();(0,a.useEffect)(()=>{let e=T(e=>{if((null==e?void 0:e.data)&&(null==e?void 0:e.data.pair)===(null==g?void 0:g.assetCode)){let t=(null==e?void 0:e.data)||{};1===t.loanStatus?ts.A.success(u(1===t.loanType?"L0016848å
¨ä»å款æå":"L0016672å
¨ä»è¿æ¬¾æå")):2===t.loanStatus&&ts.A.error(u(1===t.loanType?"L0016849å
¨ä»å款失败":"L0017039å
¨ä»è¿æ¬¾å¤±è´¥"))}});return()=>{e()}},[u]),(0,a.useEffect)(()=>{L(d||lx.borrow)},[d]);let E=(0,a.useCallback)(()=>{h(!(null==g?void 0:g.quantity)||(null==g?void 0:g.quantity)==="--"||(0,eg.w6)(null==g?void 0:g.quantity)||!!v.getFieldsError().filter(e=>{let{errors:t}=e;return t.length}).length)},[v,null==g?void 0:g.quantity]),P=(0,tD.default)(()=>{let e=k.current?k.current.split("_").filter(Boolean):[];N.setLeveragePairs(e.join(","))}),O=(0,tD.default)(async()=>{if(await v.validateFields(),j===lx.borrow)(null==g?void 0:g.assetCode)&&g.quantity&&g.userLeverage&&f(eA.Ay.postLeverageTradeCenterApiLoanBorrow({currency:g.assetCode,amount:g.quantity,leverage:+g.userLeverage})).then(()=>null==r?void 0:r({}).finally(()=>{})).catch(e=>{(null==e?void 0:e.message)&&ts.A.error(u((null==e?void 0:e.message)||"L0016849å
¨ä»å款失败"))});else{if(!(null==g?void 0:g.assetCode)||!g.quantity)return;f(eA.Ay.postLeverageTradeCenterApiLoanRepay({currency:g.assetCode,amount:g.quantity})).then(()=>(P(),null==r?void 0:r({}).finally(()=>{}))).catch(e=>{(null==e?void 0:e.message)&&ts.A.error(u((null==e?void 0:e.message)||"L0017039å
¨ä»è¿æ¬¾å¤±è´¥"))})}});return(0,a.useEffect)(()=>{h(!0)},[j]),(0,a.useEffect)(()=>{let e=k.current?k.current.split("_").filter(Boolean):[];!(null==g?void 0:g.assetCode)||e.includes(null==g?void 0:g.assetCode)?N.setLeveragePairs(e.join(",")):N.setLeveragePairs([...e,null==g?void 0:g.assetCode].join(","))},[null==g?void 0:g.assetCode]),(0,i.jsx)(lG,{className:"leverage_loan_modal",closable:!0,title:(0,i.jsx)(tq.A,{containerPaddingInline:0,showIndicator:!0,borderPosition:"none",tabNavGap:20,tabNavheight:48,size:"xl",activeKey:j,className:"leverage_loan_tabs",enableFastScroll:!0,onlyMenu:!0,items:[{key:lx.borrow,label:u("L0016379忬¾")},{key:lx.repay,label:u("L0016380è¿æ¬¾")}],onChange:L}),destroyOnClose:!0,open:n,cancelButtonProps:{hidden:!0},okButtonProps:{loading:x,disabled:m,style:{visibility:y?"hidden":"visible"}},onCancel:()=>{P(),null==l||l()},okText:p?u("L0000060确认"):u("L0015469ç»å½åæ´æ¹"),onOk:O,children:(0,i.jsx)(lq,{onFieldsChange:E,loanType:j,form:v,defaultAssetCode:o,setOkHidden:A})})})),lV=()=>{let{isLogin:e}=(0,b.Z)(),[t,n,l]=(0,tt.A)(lW),r=(0,a.useCallback)(n=>{let{onClose:l,defaultAssetCode:r,defaultLoanType:i=lx.borrow}=n;if(!e){(0,ti.$t)();return}t({onCancel:l,defaultAssetCode:r,defaultLoanType:i})},[e]),{tradeWS:i}=(0,s.pP)();return(0,a.useEffect)(()=>i.getLeverageLoanRepaymentNotificationWS(),[i.getLeverageLoanRepaymentNotificationWS]),{openLeverageLoanModal:r,renderLeverageLoanModal:n,closeLeverageLoanModal:l}},lQ=(0,a.memo)((r=T.A,e=>{var t,l;let{onClose:o,children:s,container:d,defaultAssetCode:c,defaultLoanType:u=lx.borrow,onClick:p,...m}=e,{t:h}=(0,S.A)(),{isLogin:x}=(0,b.Z)(),{isMobile:v}=(0,f.Px)(),[g,y]=(0,tt.A)(lW),A=(0,a.useCallback)(()=>
1{if(null==p||p(),!x){(0,ti.$t)();return}g({onCancel:o,defaultAssetCode:c,defaultLoanType:u})},[p,x,c,u]),j=(0,a.useMemo)(()=>(0,i.jsx)(r,{onClick:A,...m,children:s}),[A,m,s,h,v]),L=d||(v?null===(l=n.g)||void 0===l?void 0:null===(t=l.document)||void 0===t?void 0:t.querySelector("#xxx-setting"):null);return(0,i.jsxs)(i.Fragment,{children:[L?tK().createPortal(j,L):j,y()]})}));function lY(){let e=(0,u._)(["\n display: flex;\n"]);return lY=function(){return e},e}function lK(){let e=(0,u._)(["\n transform: rotate(90deg);\n width: 20px;\n height: 20px;\n"]);return lK=function(){return e},e}function l$(){let e=(0,u._)(["\n cursor: pointer;\n color: ",";\n ",";\n width: 100%;\n"]);return l$=function(){return e},e}let lX=(0,m.Ay)(er.A)(lY()),lJ=(0,m.Ay)(ec.A)(lK()),l0=m.Ay.div(l$(),V.vZ,e=>e.theme.bizTypography.r14),l1=(0,a.memo)(()=>{let{t:e}=(0,S.A)(),[{tradePost:t}]=(0,d.d4)(e=>({tradePost:e.exchangeState.tradePost})),{isMobile:n}=(0,f.Px)(),{goToDeposit:l}=lk({assetCode:t,tradingType:eN.Nn.leverage}),{renderLeverageLoanModal:r,openLeverageLoanModal:a}=lV();return(0,i.jsxs)(i.Fragment,{children:[n?(0,i.jsx)(lh.A,{size:"small",placement:"bottomRight",overlayStyle:{width:106},labelKey:"label",valueKey:"value",trigger:n?["click"]:["hover","click"],autoAdjustOverflow:!0,menu:{items:[{label:(0,i.jsx)(l0,{onClick:()=>a({defaultAssetCode:t}),children:e("L0016379忬¾")}),value:"borrow"},{label:(0,i.jsx)(l0,{onClick:()=>a({defaultAssetCode:t,defaultLoanType:lx.borrow}),children:e("L0016380è¿æ¬¾")}),value:"repay"},{label:(0,i.jsx)(l0,{onClick:l,children:e("L0000900å转")}),value:"transfer"}]},children:(0,i.jsx)(lJ,{className:"bank-icon-more "})}):(0,i.jsxs)(lX,{inline:!0,justify:"space-between",align:"center",size:6,children:[(0,i.jsx)(T.A,{size:"small",shape:"square",onClick:()=>a({defaultAssetCode:t}),children:e("L0016737忬¾è¿æ¬¾")}),(0,i.jsx)(T.A,{size:"small",shape:"square",onClick:l,children:e("L0000900å转")})]}),r()]})});var l2=n(27990);function l6(){let e=(0,u._)(["\n flex: 1 1 0% !important;\n min-height: 10px !important;\n"]);return l6=function(){return e},e}function l4(){let e=(0,u._)(["\n display: flex !important;\n flex-direction: column !important;\n flex: 1 1 0% !important;\n height: auto !important;\n .trade_way_tabs {\n &,\n .lbank-tabs-nav {\n height: 38px !important;\n .lbank-tabs-nav-item {\n font-size: 14px !important;\n }\n }\n .lbank-tabs-nav-scroller {\n padding: 0px 14px !important;\n }\n }\n .ant-form .ant-form-item .ant-form-item-label > label {\n font-size: 14px !important;\n line-height: 16px;\n .lbank-dropdown-picker-trigger {\n font-size: 14px !important;\n }\n }\n "]);return l4=function(){return e},e}function l3(){let e=(0,u._)(["\n min-height: 10px;\n overflow-y: scroll;\n ",";\n\n .lbank-tabs-nav {\n flex: initial;\n }\n\n .trade_way_tabs .lbank-tabs-nav > div:first-child {\n flex: inherit;\n }\n\n .trade_way_tabs .lbank-tabs-nav-extra-right {\n flex: 1;\n }\n\n ","\n"]);return l3=function(){return e},e}function l5(){let e=(0,u._)(["\n padding: 0 14px;\n "]);return l5=function(){return e},e}function l8(){let e=(0,u._)(["\n margin-top: 14px;\n display: flex;\n width: 100%;\n padding: 0 16px;\n height: 32px;\n position: relative;\n .lbank-btn {\n flex: 1;\n }\n .lbank-btn:first-child {\n border-radius: 25px !important;\n position: relative;\n z-index: 1;\n height: 32px;\n }\n .lbank-btn:nth-child(2) {\n position: relative;\n border-radius: 25px !important;\n z-index: 1;\n height: 32px;\n }\n\n .lbank-btn-secondary:hover {\n background-color: "," !important;\n }\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 50%;\n margin-left: -25px;\n z-index: 0;\n background-color: ",";\n width: 50px;\n height: 100%;\n }\n ","\n"]);return l8=function(){return e},e}function l7(){let e=(0,u._)(["\n --tabs-line-color: ",";\n margin-top: 4px;\n"]);return l7=function(){return e},e}function l9(){let e=(0,u._)(["\n display: flex;\n min-width: 0;\n\n > .form-detail {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;
1\n .lbank-input-controls {\n transition: none;\n }\n }\n"]);return l9=function(){return e},e}function re(){let e=(0,u._)(["\n min-height: 10px;\n flex: 1;\n .lbank-tabs-tabpane-content-holder,\n .lbank-tabs-tabpane-content {\n min-height: 10px;\n flex: 1;\n display: flex;\n flex-direction: column;\n .lbank-tabs-tabpane {\n flex: 1;\n min-height: 10px;\n }\n }\n"]);return re=function(){return e},e}function rt(){let e=(0,u._)(["\n .lbank-tabs-nav {\n display: flex;\n height: 48px !important;\n }\n "]);return rt=function(){return e},e}function rn(){let e=(0,u._)(["\n ","\n\n &.orderboard_tabs .lbank-tabs-nav > div:first-child {\n flex: inherit;\n }\n &.orderboard_tabs .lbank-tabs-nav .lbank-tabs-nav-extra-right {\n flex: 1;\n }\n"]);return rn=function(){return e},e}function rl(){let e=(0,u._)(["\n width: 1px;\n height: 16px;\n background-color: ",";\n"]);return rl=function(){return e},e}function rr(){let e=(0,u._)(["\n color: ",";\n display: flex;\n align-items: center;\n ",";\n\n .leverage-switcher-title {\n white-space: nowrap;\n margin-right: 4px;\n }\n"]);return rr=function(){return e},e}let ri=(0,m.Ay)(er.A)(l6()),ra=m.Ay.div(l3(),V.lq,f.XG.mobile((0,h.AH)(l4()))),ro=(0,m.Ay)(tB.A)(l8(),V.qQ,V.qQ,(0,V.FE)({mobile:(0,h.AH)(l5())})),rs=(0,m.Ay)(tq.A)(l7(),V._O),rd=m.Ay.div(l9()),rc=(0,m.Ay)(tV.A)(re()),ru=(0,m.Ay)(tV.A)(rn(),f.XG.mobile((0,h.AH)(rt()))),rp=m.Ay.div(rl(),V.f8),rm=m.Ay.div(rr(),V.vZ,e=>e.theme.bizTypography.m14),rh=(0,eb.A)(rs),rx=e=>{var t,l,r,o,s,c,u,p,m,h,x,v;let{currentSymbol:y,memeLaunchTabProps:A,onSplitBuySellChange:j,initTradeType:C,serverTradeArea:w,container:N,assetItem:T}=e,{t:E}=(0,S.A)(),{isMobile:P}=(0,f.Px)(),{isLogin:O}=(0,b.Z)(),R=(0,_.A)(),{ref:I,isOverflow:M}=n4({debug:!0}),z=null!==(x=(0,tZ.A)(e=>e.layoutType))&&void 0!==x?x:tG.me.ProfessionalRight,F=!!(0,tZ.A)(e=>e.isMobile),D=(0,tZ.A)(e=>e.event$),[U,B]=(0,a.useState)(C||eN.Gr.buy),[q,H]=(0,a.useState)();(0,a.useEffect)(()=>{C&&B(C)},[C]);let Z=(0,a.useRef)(null),G=(0,a.useRef)(null),[W]=(0,tH.Ay)(),{openPlanTradePrompt:V}=nF(),{status:Q,tradingType:Y,setTradeType:K,tradeWay:$,setTradeWay:X,tradeWayETF:J,setTradeWayETF:ee}=(0,g.Pj)(e=>({status:e.planTradePromptStatus,tradingType:e.tradingType,setTradeType:e.setTradeType,tradeWay:e.tradeWay,setTradeWay:e.setTradeWay,tradeWayETF:e.tradeWayETF,setTradeWayETF:e.setTradeWayETF}));(0,a.useEffect)(()=>{var e;"dca"===(null===(e=R.query)||void 0===e?void 0:e.tradeType)&&(K(eN.Nn.dca),F&&D.emit({type:"show_h5_orderboard_model"}))},[null===(t=R.query)||void 0===t?void 0:t.tradeType,null===(l=R.query)||void 0===l?void 0:l.planId]);let{getUserUsableAsset:et,getCurrencyPairLoanCalc:en}=(0,tM.A)(),[{tradeArea:el,tradeSymbol:ei,showVipDefaultTooltip:ea,exchangeState:es,isMaker:ed}]=(0,d.d4)(e=>({tradeArea:e.postArea,tradeSymbol:e.exchangeState.tradeSymbol,showVipDefaultTooltip:e.showVipDefaultTooltip,exchangeState:e.exchangeState,isMaker:e.isMaker}));(0,a.useEffect)(()=>{ed&&Y===eN.Nn.dca&&K(eN.Nn.trade)},[ed,Y,K]);let ec=(0,tD.default)(()=>{H(void 0)}),eu=(0,tD.default)(e=>{H(e),K(eN.Nn.dca),F&&D.emit({type:"show_h5_orderboard_model"})});(0,a.useEffect)(()=>(0,l2.$h)(eu),[eu]);let ep=(0,tU.A)(ea,{wait:3e3}),em=(0,a.useMemo)(()=>(el||w||"").toUpperCase(),[w,el]),{checkLeverageAccountStatus:eh}=(0,lm.A)(),ex=(0,tD.default)(async e=>{K(e),e===eN.Nn.leverage&&await eh({}),e===eN.Nn.dca&&(0,nS.Z2)({requirement_id:1004,track_sign:"aFinance.b4071.pageview.Pageview",pageName:"spot_trade"})}),ef=(0,tD.default)(e=>{if(e===eN.xo.plan&&"open"===Q){V().then(()=>{em&&"ETF"===em?ee(e):X(e)});return}if(e===eN.xo.oco){var t,n,l,r;null===(n=Z.current)||void 0===n||null===(t=n.form)||void 0===t||t.setFields([{name:eN.dm.price,value:"",errors:[]}]),null===(r=G.current)||void 0===r||null===(l=r.form)||void 0===l||l.setFields([{name:eN.dm.price,value:"",errors:[]}])}em&&"ETF"===em?ee(e):X(e)}),[ev,eg]=(0,tW.A)(),eb=(0,a.useRef)(null),eA=(0,a.useCallback)(e=>{eb.current=e,e&&ev(e)},[ev]),ej=(0,nT.xA)(e=>e.createMode);(0,a.useEffect)(()=>{var e,t;null===(t=eb.current)||void 0===t||null===(e=t.scrollTo)||void 0===e||e.call(t,{top:0})},[ej]);let{isLeverage:eL}=(0,ey.A)(ei),eC=(0,a.useMemo)(()=>eL||(null==T?void 0:T.maxLeverageRatio),[eL,null==T?void 0:T.maxLeverageRatio]);(0,a.useEffect)(()=>{void 0===eC||eC||Y!==eN.Nn.leverage||K(eN.Nn.trade)},[eC,Y,K]);let ew=!F&&(eg.width?eg.width>620:z===tG.me.Standard),ek=!!(I.current&&(null===(r=I.current)||void 0===r?void 0:r.clientWidth)>330),e_=M&&!ek;(0,eo.A)(()=>{null==j||j(ew)},[ew]);let eT=(0,a.useMemo)(()=>{let e=[{label:E("L0000258éä»·"),key:eN.xo.limited},{label:E("L0000552å¸ä»·"),key:eN.xo.market},{label:E("L0007112计åå§æ"),key:eN.xo.plan}];return em&&"ETF"!==em&&e.push({label:E("OCO"),key:eN.xo.oco}),e},[em,E]),eS=(0,a.useMemo)(()=>ew?[{tradeWay:em&&"ETF"===em?J:$,tradeType:"BUY",splitBuySell:ew,form:Z,tradingType:Y},{tradeWay:em&&"ETF"===em?J:$,tradeType:"SELL",splitBuySell:ew,form:G,tradingType:Y}]:[{tradeWay:em&&"ETF"===em?J:$,tradeType:U,splitBuySell:ew,form:"BUY"===U?Z:G,tradingType:Y}],[$,em,J,U,ew,eT,Y]),eE=(0,eF.Qi)(ek,F),eP=(0,L.A)(),eO=(0,a.useMemo)(()=>(0,i.jsx)(ru,{activeKey:eN.Nn.leverage===Y?eN.Nn.trade:Y,enableFastScroll:!0,onlyMenu:!0,size:P?"xl":"middle",showTabsLine:!P,borderPosition:P?"none":"bottom",items:[{key:eN.Nn.trade,label:E("L0000005交æ")},...ed||eP?[]:[{key:eN.Nn.dca,label:(0,i.jsxs)("span",{className:"relative inline-flex items-center gap-[4px]",children:[E("L6668791宿"),(0,i.jsx)("span",{className:"font-r10 px-[4px] py-px rounded-[3px] leading-none text-text5",style:{background:"var(--Gradient-2, linear-gradient(91deg, var(--gradient-20, #FFECAE) -1.25%, var(--gradient-2100, #F3C441) 90.47%))"},children:"New"})]})}]],onChange:ex,navRef:I,addonTabBarAfter:eP||Y===eN.Nn.dca?null:(0,i.jsxs)(er.A,{inline:!0,justify:"end",align:"center",width:"100%",size:12,right:16,children:[ew&&!e_&&!P&&(0,i.jsx)(nE.A,{enableAutoShowTooltip:ep,symbol:y}),ew&&!e_&&!P&&(0,i.jsx)(rp,{}),(0,i.jsx)(n6,{model:e_?"h5":"pc",splitBuySell:ew}),eC&&(0,i.jsxs)(rm,{children:[(0,i.jsx)("span",{className:"leverage-switcher-title",children:E("L0018022æ æç¹æ®è¯´ææ¢ä¸ä¸ªæ°çkeyè±")}
1),(0,i.jsx)(nN.A,{variant:"brand",size:"small",checked:Y===eN.Nn.leverage,onChange:e=>ex(e?eN.Nn.leverage:eN.Nn.trade)})]}),P&&Y===eN.Nn.leverage&&(0,i.jsx)(l1,{})]})}),[Y,ew,e_,eC,P,E,ep,ed]),eR=N||(P?null===(s=n.g)||void 0===s?void 0:null===(o=s.document)||void 0===o?void 0:o.querySelector("#trade_title_spot"):null),eI=null===(p=n.g)||void 0===p?void 0:null===(u=p.document)||void 0===u?void 0:null===(c=u.querySelector)||void 0===c?void 0:c.call(u,"#trade_leverage_choose");return(0,a.useEffect)(()=>{if(!O||!U||Y!==eN.Nn.trade&&Y!==eN.Nn.dca&&Y!==eN.Nn.leverage)return()=>{};let e=setTimeout(()=>{et(!0)},150);return()=>clearTimeout(e)},[et,null===(m=R.query)||void 0===m?void 0:m.id,O,U,Y]),(0,a.useEffect)(()=>{if(!O||!U||Y!==eN.Nn.leverage)return()=>{};let e=setTimeout(()=>{en()},150);return()=>clearTimeout(e)},[en,null===(h=R.query)||void 0===h?void 0:h.id,O,U,Y]),(0,i.jsxs)(ri,{width:"100%",inline:!0,direction:"vertical",className:"orderboard_block orderboard_tabs trade_orderboard_tabs",children:[eR?tK().createPortal(eO,eR):eO,(0,i.jsxs)(ra,{ref:eA,children:[(0,i.jsx)("div",{id:"trade_leverage_choose"}),Y===eN.Nn.dca?(0,i.jsx)(k.oD,{children:(0,i.jsx)(k.S4,{usableAssets:null!==(v=null==es?void 0:es.usableBuyPost)&&void 0!==v?v:"--",usableAssetsName:((null==es?void 0:es.usableBuyPostName)||(null==es?void 0:es.tradePostAlias)||"").toLocaleUpperCase(),assetCode:"usdt",currentSymbol:ei,preset:q,onPresetConsumed:ec})}):(0,i.jsxs)(i.Fragment,{children:[ew?null:(0,i.jsx)(ro,{value:U,onChange:e=>B(e),buttonProps:{block:!0,size:"middle"},items:[{label:E("L0001930ä¹°å
¥"),activeVariant:W.upColorIsGreen?"success":"error",value:eN.Gr.buy},{label:E("L0001931ååº"),activeVariant:W.upColorIsGreen?"error":"success",value:eN.Gr.sell}]}),(0,i.jsx)(rh,{className:"trade_way_tabs",activeKey:em&&"ETF"===em?J:$,borderPosition:"bottom",size:"middle",tabNavGap:16,style:ew?{padding:"0 16px"}:void 0,onlyMenu:!0,tabNavheight:36,showIndicator:!0,contentPaddingWidth:ew?0:16,onChange:ef,items:eT,addonTabBarAfter:(0,i.jsxs)(er.A,{inline:!0,justify:ew?"space-between":"end",align:"center",width:"100%",children:[(0,i.jsx)(nQ,{orderOption:$,noRightMargin:ew}),ew&&(0,i.jsxs)(er.A,{inline:!0,justify:"space-between",align:"center",size:6,children:[Y===eN.Nn.leverage&&(0,i.jsx)(nA,{}),Y===eN.Nn.leverage&&(0,i.jsx)(l1,{})]})]}),enableFastScroll:!0,showGuide:!0,guideConfig:eE}),(0,i.jsx)(rd,{children:eS.map(e=>(0,i.jsx)("div",{className:"form-detail",children:(0,i.jsxs)(nD.QI,{value:e,children:[Y===eN.Nn.leverage?eI&&!ew?tK().createPortal((0,i.jsx)(lp,{}),eI):(0,i.jsx)(lp,{}):null,(0,i.jsx)(nU.Ay,{ref:e.form})]},e.tradeType)},e.tradeType))}),!eC&&(0,i.jsx)(n_,{symbol:y||""})]})]}),A?(0,i.jsx)(tQ.A,{height:2}):void 0,A?(0,i.jsx)(rc,{className:"meme_launch_tabs",activeKey:"holderBoard",items:[A.tab],addonTabBarAfter:A.addonTabBarAfter},"holderBoard"):null]})};var rf=n(85790);let rv=()=>{let[e,t]=(0,a.useState)(!1),[{postArea:n}]=(0,d.d4)(e=>({postArea:e.postArea}));(0,a.useEffect)(()=>{"ETF"!==n||rf.I.get(tc.Y7)?t(!1):t(!0)},[n]);let l=(0,ei.default)(e=>{t(!1),e&&rf.I.set(tc.Y7,!0)});return{etfShowWarning:e,setEtfShowWarning:t,acceptAction:l}};var rg=n(70232);let rb=()=>{let{t:e}=(0,S.A)(),{etfShowWarning:t,setEtfShowWarning:n,acceptAction:l}=rv(),{isMobile:r}=(0,f.Px)(),o=(0,ei.default)(e=>{null==l||l(e),n(!1)}),[s,d]=(0,a.useState)(!1),c=(0,a.useMemo)(()=>(0,i.jsxs)(rg.Ri,{children:[(0,i.jsx)(er.A,{inline:!0,left:r?0:24,right:r?0:24,justify:"start",children:(0,i.jsx)(nO.A,{appearance:"round",className:"risk-hint_aggree",value:"checked",size:"small",onChange:(e,t)=>
1{d(t)},children:e("L0001450æå·²é
读并åæ")})}),(0,i.jsx)(rg.XK,{children:(0,i.jsx)(T.A,{size:r?"large":"middle",enableTouchRipple:!0,onClick:()=>null==o?void 0:o(s),variant:"primary",children:e("L0001610æç¥éäº")})})]}),[e,s,r]);return(0,i.jsx)(rg.K$,{width:380,title:e("L0001095é£é©æç¤º"),open:t,centered:!0,autoHeight:!0,closable:r,contentAutoFlex:!0,contentAutoFlexHeight:"100vh",footer:c,onCancel:()=>n(!1),children:(0,i.jsxs)(rg.$m,{children:[(0,i.jsxs)("div",{className:"risk-hint",style:{marginTop:0},children:[e("L0013603å°æ¬çå®¢æ·æ¨å¥½"),(0,i.jsx)("br",{}),e("L0004509æè°¢æ¨ç»é并使ç¨LBankå¹³å°"),(0,i.jsxs)("p",{children:[e("L0004510请ç¹å»æ¤é
读ETF产å说æ")," ",(0,i.jsxs)(eP.A,{target:"_blank",href:"/support/articles/21429016179609",rel:"noreferrer",children:["ã",e("L0002376æ æETF产åFAQ"),"ã"]})]})]}),(0,i.jsxs)("div",{className:"risk-hint_second",children:[(0,i.jsxs)("div",{className:"risk-hint_second-title",children:[e("L0001095é£é©æç¤º"),"ï¼"]}),(0,i.jsxs)("div",{className:"risk-hint_second-content",children:[(0,i.jsx)("span",{className:"label",children:"1."}),(0,i.jsx)("span",{children:e("L0004511æ¨è´ä¹°åºå®çä»·æ ¼ä¸åºè¯¥è¾åä½å")})]}),(0,i.jsxs)("div",{className:"risk-hint_second-content",children:[(0,i.jsx)("span",{className:"label",children:"2."}),(0,i.jsx)("span",{children:e("L0004512妿æ¹å夿éè¯¯å¨æç«¯è¡æ
ä¸ä¼")})]})]}),(0,i.jsx)("div",{className:"risk-hint_three",children:e("L0004513LBankå¹³å°å¨æ¤ééçæéæ¨")})]})})},ry=e=>{let{open:t,setOpen:n,onConfirm:l}=e,{t:r}=(0,S.A)(),[{etfMergeInfoState:o}]=(0,d.d4)(e=>({etfMergeInfoState:e.etfMergeInfoState})),s=(0,ei.default)(()=>{null==l||l(),rf.I.set("etfMergeId",o.mergeId),n(!1)}),c=(0,a.useMemo)(()=>(0,i.jsx)(rg.Ri,{children:(0,i.jsx)(rg.XK,{children:(0,i.jsx)(T.A,{enableTouchRipple:!0,onClick:s,variant:"primary",children:r("L0001610æç¥éäº")})})}),[r]);return(0,i.jsx)(rg.K$,{width:380,title:r("L0006830ETF产å份é¢åå¹¶æç¤º"),open:t,centered:!0,autoHeight:!0,contentAutoFlex:!0,contentAutoFlexHeight:"100vh",footer:c,onCancel:()=>n(!1),children:(0,i.jsxs)(rg.$m,{children:[(0,i.jsx)("div",{className:"risk-hint",children:r("L0006831ç±äºæ¨ææçETF产åä¸")}),(0,i.jsxs)("div",{className:"risk-hint",children:[(o.mergeData||[]).map(e=>(0,i.jsxs)("p",{className:"symbol",children:[(0,i.jsxs)("span",{style:{color:"#FFCC66"},children:[(e.symbol||"").split("_")[0].toUpperCase()," "]}),(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:r("L0006837产ååå¼ä½äº",{0:e.threshold})}})]},e.symbol)),(0,i.jsx)("p",{className:"etfMergeLimit",children:r("L0006847触åäºLBankETF产å份é¢")}),(0,i.jsx)("p",{children:r("L0006836æ¨çè´¦æ·åæ")}),(o.mergeDetail||[]).map(e=>(0,i.jsxs)("p",{className:"symbol",children:[(0,i.jsxs)("span",{style:{color:"#FFCC66"},children:[(e.symbol||"").split("_")[0].toUpperCase(),":"," "]}),(0,i.jsx)("span",{className:"etfMergeLimit",dangerouslySetInnerHTML:{__html:r("L0006838份å为份æ°çåä½åå¼å¢é¿å",{0:"".concat(e.beforeNum),1:(e.symbol||"").split("_")[0].toUpperCase(),2:e.newNum,3:(e.symbol||"").split("_")[0].toUpperCase(),4:e.multiple})}})]},"de".concat(e.symbol))),(0,i.jsx)("br",{}),(0,i.jsxs)("p",{className:"details",children:["*\xa0",r("L0006851详æ
请è§")," ",(0,i.jsx)(eP.A,{target:"_blank",href:"/support/sections/CO00000083",rel:"noreferrer",children:r("L0006848å
Œ")})]})]})]})})};var rA=n(41551);let rj=()=>{let[{tradeSymbol:e,tradeArea:t}]=(0,d.d4)(e=>({tradeSymbol:e.exchangeState.tradeSymbol,tradeArea:e.postArea})),{assetItem:n}=(0,tL.A)(e,K.nP.SPOT),l=(0,a.useMemo)(()=>(null==n?void 0:n.isEtf)?K.nP.ETF:K.nP.SPOT,[n]);return(0,i.jsx)(rA.default,{symbol:e,defaultTradeType:l,currentTradeArea:t,isInTradeContent:!0,fontSize:12})};var rL=n(8211);let rC=new Map,rw=e=>{let{symbol:t,onRefresh:n}=e,{observeTradeV2Update:l}=(0,X.A)();(0,a.useEffect)(()=>{if(t){let e=l(e=>{if(window.location.href.includes(null==e?void 0:e.pair)){var t,l,r,i,a;n({dir:(null===(l=e.trade)||void 0===l?void 0:null===(t=l.dir)||void 0===t?void 0:t.includes("sell"))?1:0,price:null===(r=e.trade)||void 0===r?void 0:r.p,quantity:null===(i=e.trade)||void 0===i?void 0:i.vol,timestamp:null===(a=e.trade)||void 0===a?void 0:a.t})}});return()=>{e()}}},[t])},rk=e=>{let{symbol:t}=e,{tradeWS:n}=(0,s.pP)(),[l,r]=(0,a.useState)([]),[i,o]=(0,tX.A)(),d=(0,a.useRef)(0);return(0,a.useEffect)(()=>
1{if(t){let e=rC.get(t);if(e&&Date.now()-e.timestamp<1e3)o(e.promise).then(e=>{r(e.map(e=>({...e,uniqId:d.current++})))});else{let e=o(eA.Ay.getSpotMarketCenterTradeList({symbol:t,limit:"".concat(50)},void 0,(0,tN.J)("trade_list"))),n=Date.now();rC.set(t,{promise:e,timestamp:n}),e.finally(()=>{setTimeout(()=>{let e=rC.get(t);e&&e.timestamp===n&&rC.delete(t)},1e3)}),e.then(e=>{r(e.map(e=>({...e,uniqId:d.current++})))})}n.getTradeV2(t)}},[t,n,o]),rw({symbol:t,onRefresh(e){r(t=>(t.unshift({...e,uniqId:d.current++}),d.current>=0x3b9ac9ff&&(d.current=0),t.slice(0,50)))}}),{tradeList:l,loading:i}},r_=(0,a.memo)(()=>{var e;let[{exchangeState:t},n]=(0,d.d4)(e=>({exchangeState:e.exchangeState})),{tradeList:l,loading:r}=rk({symbol:t.tradeSymbol}),a=(0,ei.default)(e=>{n({listSeletedPrice:"",listSeletedCount:""});let t={listSeletedPrice:e.price};e.volume&&(t.listSeletedCount=e.volume),n(t)});return(0,i.jsx)(rL.A,{list:l.map((e,n)=>({tradeID:"".concat(n),direction:"".concat(e.dir),symbolId:t.tradeSymbol,price:e.price||"",tradeTime:Number(e.timestamp),volume:e.quantity||"",uniqId:e.uniqId})),loading:r,onItemClick:e=>{a(e)},priceCurrency:t.tradePostAlias,amountCurrency:t.tradeAssetAlias,amountPrecision:null===(e=t.tradeAcc)||void 0===e?void 0:e.minQua})});var rN=n(11115);let rT=e=>{var t,n;let{open:l,setOpen:r,onConfirm:a}=e,{t:o}=(0,S.A)(),s=(0,_.A)(),d=(0,ei.default)(()=>{null==a||a(),r(!1)});return(0,i.jsx)(n7.default,{title:o("L0010735åå¼ä»·"),open:l,centered:!0,onCancel:()=>r(!1),cancelButtonProps:{hidden:!0},okText:o("L0001610æç¥éäº"),onOk:d,children:(0,i.jsx)("div",{className:"common-hint",children:o("L0004519åå¼ä¸ä¸ªè°æ´æ¶ç¹çåå¼13ç°è´§",{0:(null===(n=s.query)||void 0===n?void 0:null===(t=n.id)||void 0===t?void 0:t.includes("5"))?5:3})})})};var rS=n(23512),rE=n(96021);let rP=e=>{let t=e.trim();if(!/[eE]/.test(t))return t;let[n,l]=t.toLowerCase().split("e"),r=Number(l);if(!Number.isInteger(r))return t;let i=n.startsWith("-")?"-":"",[a,o=""]=n.replace(/^[+-]/,"").split("."),s="".concat(a).concat(o),d=a.length+r;return d<=0?"".concat(i,"0.").concat("0".repeat(Math.abs(d))).concat(s):d>=s.length?"".concat(i).concat(s).concat("0".repeat(d-s.length)):"".concat(i).concat(s.slice(0,d),".").concat(s.slice(d))},rO=e=>{let t=e.replace(/^\+/,"");return t.includes(".")?t.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,""):t},rR=e=>{if(null==e)return;let t=rO(rP(String(e))),n=Number(t);if(Number.isFinite(n)&&!(n<=0))return t},rI=e=>"1"===e?"0":/^0\.0*1$/.test(e)?String(e.split(".")[1].length):/^10+$/.test(e)?String(-(e.length-1)):void 0,rM=e=>rO(rP((0,q.A)(1).div(e).toString())),rz=e=>{let t=new Set;return e.reduce((e,n)=>{let l=rR(n);return!l||t.has(l)||(t.add(l),e.push({precision:l,mergeAcc:rI(l),wsType:rM(l)})),e},[])},rF=function(){let{apiPrecisions:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rz(e||[])},rD=e=>{var t;let{symbol:n,totalType:l}=e,r=(0,rS.useRouter)(),i=(0,a.useMemo)(()=>{var e;return n||(null===(e=r.query)||void 0===e?void 0:e.id)},[n,null===(t=r.query)||void 0===t?void 0:t.id]),[{exchangeState:o,postArea:c}]=(0,d.d4)(e=>({exchangeState:e.exchangeState,postArea:e.postArea})),{tradeWS:u}=(0,s.pP)(),[p,m]=(0,a.useState)([]),[h,x]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[g,b]=(0,a.useState)([]),[y,A]=(0,a.useState)([]),[j,L]=(0,a.useState)(!1),[C]=eS(),w=(0,a.useRef)(null),k=(0,a.useRef)();(0,a.useEffect)(()=>{var e;m([]),x(""),v(""),b([]),A([]),L(!1),w.current=null,null===(e=k.current)||void 0===e||e.call(k),k.current=void 0},[i]);let _=(0,ei.default)((e,t)=>{0!==e.length&&(m(e),x(n=>{if(e.some(e=>e.precision===n))return n;let l=rR(t);return l&&e.some(e=>e.precision===l)?l:e[0].precision}))}),N=(0,ei.default)(async()=>{try{let e=await eA.Ay.getSpotMarketCenterV2DepthPrecisionList({symbol:"".concat(i)}),t=rF({apiPrecisions:(null==e?void 0:e.depthPrecisions)||(null==e?void 0:e.availablePrecisions)});_(t,null==e?void 0:e.defaultPrecision)}catch(e){console.error("[useOrderBook] getSpotMarketCenterV2DepthPrecisionList 请æ±å¤±è´¥:",i,e)}}),T=(0,ei.default)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{asks:t=[],bids:n=[]}=e;A(t),b(n)}),S=(0,ei.default)(async e=>{try{let t=await eA.Ay.getSpotMarketCenterDepthList(e,void 0,(0,tN.J)("order_book"));T(null==t?void 0:t.data)}catch(t){console.error("[useOrderBook] getSpotMarketCenterDepthList 请æ±å¤±è´¥:",e.symbol,t)}}),E=(0,ei.default)(e=>{var t;null===(t=k.current)||void 0===t||t.call(k),k.current=u.getWSDepth(e)}),P=(0,ei.default)(e=>p.find(t=>t.precision===e)||p[0]),O=e=>{let t=e||p[0];if(!t)return;v(t.mergeAcc||"");
1let n={symbol:"".concat(i),dataType:l,depth:200,mergeLimit:50};void 0!==t.mergeAcc&&Object.assign(n,{mergeAcc:t.mergeAcc});let r={...n,wsType:t.wsType};w.current&&(0,l_.e_)(r,w.current)||(A(()=>[]),b(()=>[]),S(n),E(r),w.current=r)};return(0,a.useEffect)(()=>{var e,t,n,l,r;o.assetPairInfo&&(null===(t=o.assetPairInfo)||void 0===t?void 0:null===(e=t.assetPair)||void 0===e?void 0:e.isTrade)&&(null===(l=o.assetPairInfo)||void 0===l?void 0:null===(n=l.openTime)||void 0===n?void 0:n.openStatus)&&(null===(r=o.assetPairInfo)||void 0===r?void 0:r.assetPair.currency)===i&&N()},[o.assetPairInfo,i]),(0,a.useEffect)(()=>{let e=e=>{(null==e?void 0:e.type)===rE.I.DEPTH&&i===(null==e?void 0:e.pair)&&T((0,l_.zV)(e.depth,e.dataType))};return u.onReciveMessage(e),()=>{var t;A(()=>[]),b(()=>[]),u.onNoReciveMessage(e),null===(t=k.current)||void 0===t||t.call(k),k.current=void 0,w.current=null}},[i]),(0,a.useEffect)(()=>{L("ETF"===c)},[c]),(0,a.useEffect)(()=>{var e,t,n;i&&l&&o.assetPairInfo&&0!==p.length&&(null===(e=o.assetPairInfo.assetPair)||void 0===e?void 0:e.isTrade)&&(null===(t=o.assetPairInfo.openTime)||void 0===t?void 0:t.openStatus)&&""!==h&&(null===(n=o.assetPairInfo)||void 0===n?void 0:n.assetPair.currency)===i&&O(P(h))},[h,l,o.assetPairInfo,i,p]),{bidList:g,askList:y,mergeAcc:f,precisions:p.map(e=>e.precision),currentPrecision:h,setCurrentPrecision:x,isShowNetValue:j,ETFNetValue:C}},rU=e=>{let{symbol:t,mergeAcc:n}=e,{isLeverage:l}=(0,ey.A)(t),{tradingType:r}=(0,g.Pj)(e=>({tradingType:e.tradingType})),[{orderUpdate:i},o]=(0,d.d4)(e=>({orderUpdate:e.orderUpdate})),{isLogin:s}=(0,b.Z)(),c=(0,ei.default)(async function(){let{type:e,precision:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let i=e?{type:null==e?void 0:e.toUpperCase()}:{},a=n?{mergeAcc:"".concat(n?Number(n):0)}:{},o={category:t,__autoLogin:!0,...i,...a},s=l&&r===eN.Nn.leverage?eA.Ay.getLeverageTradeCenterOrderAllOrderingPrice(o,void 0,(0,tN.u)("current_orders_polling")):eA.Ay.getSpotTradeCenterOrderAllOrderingPrice(o,void 0,(0,tN.J)("current_orders_polling"));return await s}catch(e){return console.log("err :>> ",e),Promise.reject(e)}});(0,a.useEffect)(()=>{s&&n&&c({type:tc.MF.LIMIT,precision:n}).then(e=>{o({currentAllOrderPrice:e})}).catch(()=>void 0)},[i,t,s,n,l,r])};function rB(){let e=(0,u._)(["\n .markedPrice {\n font-weight: 500;\n font-size: 12px;\n line-height: 14px;\n color: ",";\n }\n"]);return rB=function(){return e},e}function rq(){let e=(0,u._)(["\n cursor: pointer;\n display: inline-block;\n color: ",";\n ","\n span {\n border-bottom: 1px dashed ",";\n &:hover {\n color: ",";\n border-bottom: 1px dashed ",";\n }\n }\n"]);return rq=function(){return e},e}function rH(){let e=(0,u._)(["\n display: inline-block;\n color: ",";\n ","\n"]);return rH=function(){return e},e}let rZ=(0,m.Ay)(rN.Ay)(rB(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3}),rG=m.Ay.div(rq(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>e.theme.bizTypography.r12,e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1},e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text1}),rW=m.Ay.div(rH(),e=>{var t;return null===(t=e.theme.palette)||void 0===t?void 0:t.bizText.text3},e=>e.theme.bizTypography.r12),rV=(0,a.memo)(()=>{var e,t,n,l;let r=(0,tZ.A)(e=>e.orderBookTotalType),[o,s]=(0,a.useState)(!1),[c,u]=(0,a.useState)(rN.Kd.Split),{lgtSymbol:p,rate:m}=(0,eh.A)(),{t:h}=(0,S.A)(),x=(0,_.A)(),[{tradePostAlias:f,tradeAssetAlias:v,exchangeState:g,postArea:b,tradeTicker:y,latestChange:A},j]=(0,d.d4)(e=>({postArea:e.postArea,tradeTicker:e.tradeTicker,tradePostAlias:e.exchangeState.tradePostAlias,tradeAssetAlias:e.exchangeState.tradeAssetAlias,exchangeState:e.exchangeState,latestChange:e.latestChange})),L=(0,a.useMemo)(()=>{var e,t,n,l;return(null===(t=g.assetPairInfo)||void 0===t?void 0:null===(e=t.openTime)||void 0===e?void 0:e.openStatus)&&(null===(l=g.assetPairInfo)||void 0===l?void 0:null===(n=l.assetPair)||void 0===n?void 0:n.isTrade)||!1}
1,[g.assetPairInfo]),{bidList:C,askList:w,mergeAcc:k,precisions:N,currentPrecision:T,setCurrentPrecision:E,isShowNetValue:P,ETFNetValue:O}=rD({symbol:g.tradeSymbol,totalType:r}),{tradeList:R}=rk({symbol:g.tradeSymbol});rU({symbol:g.tradeSymbol,mergeAcc:k});let[{currentAllOrderPrice:I}]=(0,d.d4)(e=>({currentAllOrderPrice:e.currentAllOrderPrice})),[M,z]=(0,a.useMemo)(()=>{var e,t;return[null==I?void 0:null===(e=I.buyList)||void 0===e?void 0:e.map(e=>({price:null==e?void 0:e.price,volume:null==e?void 0:e.amount})),null==I?void 0:null===(t=I.sellList)||void 0===t?void 0:t.map(e=>({price:null==e?void 0:e.price,volume:null==e?void 0:e.amount}))]},[I,g.tradeSymbol]),{observeTradeTickUpdate:F}=(0,X.A)(),D=(0,ea.A)(R),U=e=>({price:e.price,amount:e.qty,totalAmount:null==e?void 0:e.totalQty,dealAmount:null==e?void 0:e.dealAmount}),B=(0,a.useMemo)(()=>N.map(e=>({label:(0,Q.Qr)(e),value:e})),[N]),q=(0,ei.default)(e=>{j({listSeletedPrice:"",listSeletedCount:""});let t={listSeletedPrice:e.price};e.amount&&(t.listSeletedCount=e.amount),j(t)});return(0,a.useEffect)(()=>{j({tradeDepth:{bids:C,asks:w}})},[C,w]),(0,a.useEffect)(()=>{let e=F(e=>{let t=Number(e.tick.cp);e.pair===g.tradeSymbol&&(D.current[1].price?j({latestChange:t>=D.current[1].price?1:-1}):j({latestChange:0}))});return()=>{e()}},[g.tradeSymbol]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rZ,{price:!L||(0,Q.w6)(null==y?void 0:y.price)?"--":y.price,otherPrice:(0,i.jsxs)(i.Fragment,{children:[P&&null!==O&&(0,i.jsx)(ep.A,{title:h("L0004519åå¼ä¸ä¸ªè°æ´æ¶ç¹çåå¼13ç°è´§",{0:(null===(t=x.query)||void 0===t?void 0:null===(e=t.id)||void 0===e?void 0:e.includes("5"))?5:3}),children:(0,i.jsx)(rG,{children:(0,i.jsx)(t0.A,{defaultFontSize:12,children:L?0===O?0:O||"":"--"})})}),"ETF"!==b&&null!==y.price&&(0,i.jsxs)(rW,{children:[(0,i.jsx)(t0.A,{defaultFontSize:12,children:p}),(0,i.jsx)(t0.A,{defaultFontSize:12,children:L?(0,Q.al)(+y.price*(+y.toUsd||0),m):"--"})]})]}),change:L?A:0,symbolPostCurrency:null==f?void 0:f.toUpperCase(),symbolCurrency:null==v?void 0:v.toUpperCase(),asks:g.tradeSymbol?null==w?void 0:w.map(U):void 0,bids:g.tradeSymbol?C.map(U):void 0,orderBookType:c,onOrderBookTypeChange:u,precision:T,precisionOptions:B,onPrecisionChange:E,isNeedFormatAmount:!1,isNeedFormatPrice:!1,onItemClick:q,onPriceClick:()=>q({price:y.price}),bidsLimitOrders:M,asksLimitOrders:z,pricePrecision:null===(n=g.tradeAcc)||void 0===n?void 0:n.priceAcc,amountPrecision:null===(l=g.tradeAcc)||void 0===l?void 0:l.minQua}),(0,i.jsx)(rT,{open:o,setOpen:s})]})}),rQ=e=>{let{currentSymbol:t,children:n}=e,{tradeWS:l}=(0,s.pP)(),[{postArea:r}]=(0,d.d4)(e=>({postArea:e.postArea})),[o,c]=(0,a.useState)(null),u=(0,a.useRef)(0),[p,m]=(0,a.useState)(!1),h=(0,a.useCallback)(()=>{c(null)},[]);return(0,a.useEffect)(()=>{c(null)},[t]),(0,a.useEffect)(()=>{if(p){let e=e=>{if((null==e?void 0:e.type)===rE.I.ETFNETVALUE&&t===(null==e?void 0:e.pair)){var n;let t=null==e?void 0:null===(n=e.etfNetValue)||void 0===n?void 0:n.netValue;t&&Number(t)&&c(t)}};return l.onReciveMessage(e),()=>{c(null),l.onNoReciveMessage(e)}}},[t,p]),(0,a.useEffect)(()=>{"ETF"===r&&p&&(eA.Ay.getSpotTradeCenterEtfNetValue({symbol:t}).then(e=>{(null==e?void 0:e.netValue)&&c(null==e?void 0:e.netValue)}
1),l.getEtfNetValue(t))},[t,r,p]),(0,i.jsx)(eT.Provider,{value:{etfNetValue:o,activate:()=>(u.current+=1,m(!0),()=>{u.current-=1,u.current<=0&&(u.current=0,m(!1))}),resetETFNetValue:h},children:n})};var rY=n(23985);function rK(){let e=(0,u._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 16px;\n background: ",";\n\n .overflowView {\n overflow: initial;\n }\n\n .right_arrow,\n .left_arrow {\n background-color: ",";\n height: 18px;\n display: flex;\n flex-direction: column;\n }\n\n .left_arrow {\n &::after {\n background: linear-gradient(90deg, "," 0%, rgba(17, 18, 18, 0) 100%);\n [data-dir='rtl'] & {\n background: linear-gradient(270deg, "," 0%, rgba(255, 255, 255, 0) 100%);\n }\n }\n }\n\n .right_arrow {\n &::after {\n background: linear-gradient(270deg, "," 0%, rgba(17, 18, 18, 0) 100%);\n [data-dir='rtl'] & {\n background: linear-gradient(90deg, "," 0%, rgba(255, 255, 255, 0) 100%);\n }\n }\n }\n\n .lev-guide-title {\n color: ",";\n margin-right: 4px;\n white-space: nowrap;\n ",";\n }\n\n .lev-guide-step {\n color: ",";\n white-space: nowrap;\n ",";\n }\n\n .lev-guide-arrow {\n color: ",";\n margin: 0 6px;\n line-height: 14px;\n }\n\n .lev-guide-btn {\n color: ",";\n display: flex;\n align-items: center;\n cursor: pointer;\n white-space: nowrap;\n margin-left: 6px;\n\n .btn_guide {\n padding: 0;\n background-color: transparent;\n margin-left: 4px;\n ",";\n }\n svg {\n font-size: 14px;\n }\n }\n"]);return rK=function(){return e},e}let r$=m.Ay.div(rK(),V.sR,V.sR,V.sR,V.sR,V.sR,V.sR,V.vZ,e=>e.theme.bizTypography.m12,V.fG,e=>e.theme.bizTypography.m12,V.fG,V.vZ,e=>e.theme.bizTypography.r12),rX=()=>{let{t:e}=(0,S.A)(),{showGuideModal:t}=(0,lm.A)();return(0,i.jsxs)(r$,{children:[(0,i.jsxs)(rY.A,{className:"overflowView",children:[(0,i.jsxs)("div",{className:"lev-guide-title",children:[e("L0016855æ æäº¤ææ¥éª¤"),"ï¼"]}),(0,i.jsx)("div",{className:"lev-guide-step",children:e("L0016856ä¿è¯éå转")}),(0,i.jsx)("div",{className:"lev-guide-arrow",children:">"}),(0,i.jsx)("div",{className:"lev-guide-step",children:(0,i.jsx)(nH.A,{title:e("L0016858宿ä¿è¯éå转åå¨è¿è¡æ æäº¤æ"),children:e("L0016857èªå¨å款交æ")})}),(0,i.jsx)("div",{className:"lev-guide-arrow",children:">"}),(0,i.jsx)("div",{className:"lev-guide-step",children:(0,i.jsx)(nH.A,{title:e("L0016860å¦éè¿æ¬¾å¨è¿è¡æ æäº¤ææ¶å¯éæ©"),children:e("L0016859èªå¨è¿æ¬¾äº¤æ")})})]}),(0,i.jsxs)("div",{className:"lev-guide-btn",onClick:()=>t({onlyShowGuide:!0}),children:[(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[(0,i.jsx)("rect",{width:"14",height:"14",rx:"7",fill:"#323439"}),(0,i.jsx)("path",{d:"M4.8125 4.67811C4.8125 4.46219 5.04805 4.32883 5.23319 4.43992L9.10301 6.76181C9.28283 6.8697 9.28283 7.1303 9.10301 7.23819L5.23319 9.56008C5.04805 9.67117 4.8125 9.53781 4.8125 9.32189V4.67811Z",fill:"white"})]}),(0,i.jsx)("div",{className:"btn_guide",children:e("L0016862æ ææç¨")})]})]})};var rJ=n(9110),r0=n(83272);let r1=e=>{let{symbol:t,hideOther:n,orderType:l}=e,[{orderUpdate:r},i]=(0,d.d4)(e=>({orderUpdate:e.orderUpdate})),{isLogin:o}=(0,b.Z)(),s=(0,a.useRef)(),{observeLeveragePositionInfoUpdate:c}=(0,X.A)();(0,a.useEffect)(()=>{let e=c(e=>{if(null==e?void 0:e.data){let t=(null==e?void 0:e.data)||{};i({exchangeState:{totalLeveragePositionCount:(null==t?void 0:t.positionCount)||0}})}});return()=>{e()}},[]);let u=(0,ei.default)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{return await eA.Ay.getLeverageTradeCenterOrderSummary({category:n?t:"all",__autoLogin:!0},void 0,e?(0,tN.u)("open_orders_count_polling"):void 0)}catch(e){return console.log("err :>> ",e),Promise.reject(e)}});(0,a.useEffect)(()=>{let e=s.current,a=!e||e.isLogin!==o||e.orderUpdate!==r||e.symbol!==t;s.current={isLogin:o,orderUpdate:r,symbol:t,hideOther:n,orderType:l},o&&(u(a).then(e=>{i({exchangeState:{totalCurrentLeverageOrders:(null==e?void 0:e.totalCount)||0,totalCurrentLimitLeverageOrders:(null==e?void 0:e.limitCount)||0,totalCurrentProfitLossLeverageOrders:(null==e?void 0:e.profitLossCount)||0,totalCurrentOcoLeverageOrders:(null==e?void 0:e.ocoCount)||0,totalLeveragePositionCount:(null==e?void 0:e.positionCount)||0}})}).catch(()=>void 0),eA.Ay.getLeverageTradeCenterPositionList({},void 0,a?(0,tN.u)("position_list_polling"):void 0).then(e=>(i({exchangeState:{totalLeveragePositionCount:(e||[]).length}}),e)).catch(()=>void 0))},[r,t,n,l,o])};var r2=n(56631),r6=n(79375),r4=n(11173),r3=n(53864);
1function r5(){let e=(0,u._)(["\n width: 20px;\n height: 20px;\n padding: 2px;\n &.lbank-btn-sm {\n border-radius: 2px;\n }\n &.lbank-btn-sm > span {\n height: 20px;\n }\n .lbank-icon {\n font-size: 20px;\n }\n &.lbank-btn-secondary.lbank-btn-hovered:hover {\n background: ",";\n }\n &:active {\n background-color: ",";\n }\n"]);return r5=function(){return e},e}function r8(){let e=(0,u._)(["\n display: inline-flex !important;\n height: 100%;\n line-height: normal;\n align-items: center;\n"]);return r8=function(){return e},e}let r7=(0,m.Ay)(T.A)(r5(),V.sR,V._j),r9=(0,m.Ay)(eP.A)(r8()),ie=(0,a.memo)(e=>{let{from:t}=e,{t:n}=(0,S.A)(),{isLogin:l}=(0,b.Z)(),r=(0,r3.A)(),o=(0,a.useMemo)(()=>l?"/wallet/orders/margin/".concat(t):r,[l,r,t]);return(0,i.jsx)(r9,{href:"".concat(o),passHref:!0,prefetch:!1,target:l?"_blank":"",rel:"noreferrer",microEntrance:!0,children:(0,i.jsx)(ep.A,{title:n("L0013324订åä¸å¿"),autoAdjustOverflow:!0,placement:"topRight",children:(0,i.jsx)(r7,{size:"small",shape:"square",type:"text",prefixIcon:(0,i.jsx)(r4.A,{})})})})});function it(){let e=(0,u._)(["\n > * {\n position: relative;\n\n .line {\n padding-left: 13px;\n }\n .line::before {\n content: '|';\n position: absolute;\n left: -1px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n font-size: 16px;\n pointer-events: none;\n }\n .line-right {\n padding-right: 13px;\n }\n .line-right::before {\n content: '|';\n position: absolute;\n right: -1px;\n top: 50%;\n transform: translateY(-50%);\n color: ",";\n font-size: 16px;\n pointer-events: none;\n }\n }\n"]);return it=function(){return e},e}let il=(0,m.Ay)(nY.A)(it(),V._j,V._j),ir=(0,a.memo)(e=>{let{children:t,align:n}=e;return(0,i.jsx)(il,{size:12,block:!0,align:n,children:t})}),ii=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,containerRef:l}=e,{t:r}=(0,S.A)(),{isLogin:o}=(0,b.Z)(),{sm:s}=(0,f.Px)(),[d,c]=(0,a.useState)(!1);return((0,a.useLayoutEffect)(()=>{l.current&&c(!0)},[l]),(0,a.useEffect)(()=>{if(l.current){c(!0);return}let e=setTimeout(()=>{l.current&&c(!0)},0);return()=>{clearTimeout(e)}},[l]),d&&l.current)?tK().createPortal((0,i.jsxs)(ir,{children:[s||!o?null:(0,i.jsx)(r6.cO,{size:"small",disabled:!o,appearance:"square",checked:t,onChange:(e,t)=>
1{n(t)},children:r("L0010791ä»
æ¾ç¤ºå½å")}),o&&(0,i.jsx)("div",{className:s?"":"line",children:(0,i.jsx)(ie,{from:"open-history"})})]}),l.current):null});var ia=n(81965),io=n(72395),is=n(79208);function id(){let e=(0,u._)(["\n height: 547px;\n .login {\n width: 100%;\n height: 100%;\n padding-top: ",";\n justify-content: center;\n }\n"]);return id=function(){return e},e}let ic=m.Ay.div(id(),e=>e.isMobile?"40px":"80px"),iu=(0,a.memo)(()=>{let{isLogin:e}=(0,b.Z)(),{isMobile:t}=(0,f.Px)(),[{postArea:n}]=(0,d.d4)(e=>({postArea:e.postArea})),[l,r]=(0,is.A)("trade",n);return(0,i.jsx)(ic,{className:"order_no_login",isMobile:t,children:(0,i.jsx)(nY.A,{block:!0,align:"center",className:"login",children:null==e?null:t?(0,i.jsx)(ia.A,{style:{margin:0}}):(0,i.jsx)(io.A,{type:"link",className:"",sensorClick:[l,{buttonLocation:"location2",...r}]})})})});var ip=n(6633);let im=e=>{let{value:t,onChange:n,counts:l,showMarketLabel:r=!1}=e,{t:a}=(0,S.A)(),o=l?"(".concat((null==l?void 0:l[tc.MF.LIMIT])||0,")"):"",s=l?"(".concat((null==l?void 0:l[tc.MF.PROFITLOSS])||0,")"):"",d=l?"(".concat((null==l?void 0:l[tc.MF.OCO])||0,")"):"";return(0,i.jsx)(ip.A,{value:t,onChange:e=>null==n?void 0:n(e),items:[{value:tc.MF.LIMIT,label:"".concat(a("L0000258éä»·")).concat(r?" | ".concat(a("L0000552å¸ä»·")):""," ").concat(o)},{value:tc.MF.PROFITLOSS,label:"".concat(a("L0013322计å")," ").concat(s)},{value:tc.MF.OCO,label:"".concat(a("OCO")," ").concat(d)}]})},ih=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,availableList:l,removeMoreOrders:r,removeLoading:a}=e,{t:o}=(0,S.A)(),{isLogin:s}=(0,b.Z)();return(0,i.jsxs)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:[(0,i.jsx)(r6.cO,{size:"small",disabled:!s,appearance:"square",checked:t,onChange:(e,t)=>
1{n(t)},children:o("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(T.A,{disabled:!(null==l?void 0:l.length),size:"small",loading:a,onClick:r,children:o("L0000968å
¨é¨æ¤å")})]})});var ix=n(53659),iv=n(76468),ig=n(33572);function ib(){let e=(0,u._)(["\n &:not(.table_no_padding) {\n table > thead > tr:first-child th:first-child,\n table > tbody > tr > td:first-child {\n padding-left: 16px !important;\n }\n table > thead > tr:last-child th:last-child,\n table > tbody > tr > td:last-child {\n padding-right: 16px !important;\n }\n }\n"]);return ib=function(){return e},e}let iy=(0,m.Ay)(ix.A)(ib()),iA=(0,a.memo)(function(e){let{t}=(0,S.A)(),{noPadding:n,error:l,onRetry:r,data:o,loading:s,...d}=e,[c,u]=(0,tW.A)(),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(444),x=e=>{c(e),p.current=e},f=(0,a.useRef)(0),v=(0,a.useRef)(0);(0,eo.A)(()=>{let e=Math.round(u.height),t=p.current.querySelector(".orders_table"),n=p.current.querySelector(".ant-table-body");if(t&&n&&e&&(e!==f.current||v.current!==n.scrollHeight)){f.current=e,v.current=n.scrollHeight;let l=n.offsetHeight;h(e-(t.offsetHeight-l))}});let g=!o||Array.isArray(o)&&0===o.length;return l&&!s&&g?(0,i.jsx)(ig.F9,{ref:x,children:(0,i.jsx)(iv.A,{description:t("L0014783å 载失败"),retryText:t("L0003387éè¯"),onRetry:r})}):(0,i.jsx)(ig.F9,{ref:x,children:(0,i.jsx)(iy,{shouldResponsive:!0,visibleLine:2,sepColumn:2,stickyHeader:!0,className:"orders_table ".concat(n?"table_no_padding":""),scroll:{x:600,y:m},data:o,loading:s,...d})})});var ij=n(60205),iL=n(76217);function iC(){let e=(0,u._)(["\n white-space: normal;\n justify-content: flex-start;\n align-items: flex-start;\n text-align: left;\n display: inline-block;\n "]);return iC=function(){return e},e}function iw(){let e=(0,u._)(["\n color: ",";\n text-align: left;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n padding: 0;\n display: flex;\n white-space: nowrap;\n overflow: hidden;\n a {\n display: inline-block;\n margin: 0 3px;\n white-space: nowrap;\n color: ",";\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n ::after {\n content: '';\n width: 100%;\n display: block;\n height: 1px;\n background-color: ",";\n }\n\n &:hover {\n color: "," !important;\n }\n }\n\n ","\n"]);return iw=function(){return e},e}let ik=m.Ay.div(iw(),V.fG,V.vZ,V.vZ,V.vZ,f.XG.mobile((0,h.AH)(iC()))),i_=(0,a.memo)(e=>{let{from:t}=e,{t:n}=(0,S.A)(),{isLogin:l}=(0,b.Z)(),r=(0,r3.A)(),o=(0,a.useMemo)(()=>l?"/wallet/orders/margin/".concat(t):r,[l,r,t]);return(0,i.jsx)(ik,{children:(0,iL.A)(n,"L0013418æå¤å±ç¤º20æ¡æ°æ®è¯·å徿¥çæ´",{0:(0,i.jsxs)(i.Fragment,{children:["\xa0",(0,i.jsx)(eP.A,{href:"".concat(o),passHref:!0,prefetch:!1,target:l?"_blank":"",rel:"noreferrer",children:n("L0013324订åä¸å¿")}),"\xa0"]})})})}),iN=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{isLogin:l}=(0,b.Z)(),[r,o]=(0,a.useState)(!1),[s,c]=(0,a.useState)(tc.MF.LIMIT),[{totalCurrentLimitOrders:u,totalCurrentProfitLossOrders:p,totalCurrentOcoOrders:m}]=(0,d.d4)(e=>({totalCurrentLimitOrders:e.exchangeState.totalCurrentLimitLeverageOrders,totalCurrentProfitLossOrders:e.exchangeState.totalCurrentProfitLossLeverageOrders,totalCurrentOcoOrders:e.exchangeState.totalCurrentOcoLeverageOrders}));r1({symbol:t,hideOther:r,orderType:s});let{loading:h,columns:x,ordersList:v,orderItem:g,open:y,setOpen:A,removeMoreOrders:j,removeLoading:L}=(0,r2.A)({symbol:t,hideOther:r,orderType:s,from:"trade"}),{sm:C}=(0,f.Px)();return(0,i.jsxs)(r6.Wv,{children:[(0,i.jsx)(ii,{containerRef:n,hideOther:r,setHideOther:o,availableList:v,removeMoreOrders:j,removeLoading:L}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rJ.A,{bottomBorder:!1,children:(0,i.jsx)(im,{value:s,counts:{[tc.MF.LIMIT]:(0,r0.h6)(u),[tc.MF.PROFITLOSS]:(0,r0.h6)(p),[tc.MF.OCO]:(0,r0.h6)(m)},onChange:e=>{c(e)}})}),C?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:36,children:(0,i.jsx)(ih,{hideOther:r,setHideOther:o,availableList:v,removeMoreOrders:j,removeLoading:L})}):null,(0,i.jsx)(iA,{rowKey:["uuid","side","type"],rowHeight:60,bordered:!1,columns:x,data:v,loading:h,pagination:!1,footer:v.length?(0,i.jsx)(i_,{from:"open-history"}):null}),(0,i.jsx)(ij.A,{data:g,open:y,setOpen:A})]}):(0,i.jsx)(iu,{})]})});var iT=n(33089),iS=n(69667),iE=n(817),iP=n.n(iE);function iO(){let e=(0,u._)(["\n ",";\n font-size: 20px;\n cursor: pointer;\n"]);return iO=function(){return e},e}function iR(){let e=(0,u._)(["\n width: 100%;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n "]);return iR=function(){return e},e}function iI(){let e=(0,u._)(["\n display: flex;\n align-items: center;
1\n color: ",";\n\n ","\n\n .order_date_picker.lbank-input-outlined {\n --input-font-size: 12px;\n border: 0 !important;\n height: 28px;\n gap: 0;\n width: auto;\n &.lbank-picker-open {\n border-radius: 4px;\n background: ",";\n }\n .lbank-toggle-picker-select-inner {\n overflow: visible;\n }\n .lbank-toggle-picker-value {\n font-size: 12px;\n overflow: visible;\n width: auto;\n }\n .lbank-icon-date {\n font-size: 14px !important;\n margin-left: 8px;\n }\n }\n .divider {\n margin-left: 4px;\n margin-right: 12px;\n }\n .time_title {\n color: ",";\n font-size: 12px;\n margin-right: 4px;\n }\n"]);return iI=function(){return e},e}let iM=(0,m.Ay)(iT.A)(iO(),V.Ft),iz=e=>e.valueOf()<iP()().startOf("day").subtract(89,"days").valueOf()||e.valueOf()>iP()().valueOf(),iF=[iP()().subtract(29,"day"),iP()()],iD=m.Ay.div(iI(),V.fG,f.XG.mobile((0,h.AH)(iR())),V.fn,V.fG),iU=()=>{let{isLogin:e}=(0,w.A)(),{t}=(0,S.A)(),{isMobile:n}=(0,f.Px)(),l=(0,a.useRef)(!1),[r,o]=(0,a.useState)([iP()().subtract(29,"days").valueOf(),iP()().valueOf()]),s=Math.round((Number(null==r?void 0:r[1])-Number(null==r?void 0:r[0]))/864e5);return[r,()=>(0,i.jsxs)(iD,{className:"order_date_picker_wrapper",children:[n?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ip.A,{value:s+1,onChange:e=>{l.current=!0,o([iP()().subtract(e,"day").add(1,"day").valueOf(),iP()().valueOf()])},items:[{value:7,label:t("L0004110è¿7æ¥")},{value:30,label:t("L0016081è¿30æ¥")},{value:90,label:t("L0016082è¿90æ¥")}]}),(0,i.jsx)(tQ.A,{width:1,height:16,left:8,right:8,style:{backgroundColor:"var(--line-2)"}}),(0,i.jsx)("span",{className:"time_title",children:t("L0000282æ¶é´")})]}),(0,i.jsx)(iS.A,{disabled:!e,className:"order_date_picker",size:"middle",shouldDisableDate:iz,selectableRange:iF,value:r,onChange:e=>{l.current=!0,o(e)},children:n?(0,i.jsx)(iM,{}):void 0})]}),l]};var iB=n(16420);let iq=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,containerRef:l}=e,{t:r}=(0,S.A)(),{isLogin:a}=(0,b.Z)(),{sm:o}=(0,f.Px)();return l.current?tK().createPortal((0,i.jsxs)(ir,{children:[!a||o?null:(0,i.jsx)(r6.cO,{size:"small",disabled:!a,appearance:"square",checked:t,onChange:(e,t)=>
1n(t),children:r("L0010566éèå·²æ¤é")}),a&&(0,i.jsx)("div",{className:o?"":"line",children:(0,i.jsx)(ie,{from:"order-history"})})]}),l.current):null}),iH=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,b.Z)();return r&&(0,i.jsx)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:(0,i.jsx)(r6.cO,{size:"small",disabled:!r,appearance:"square",checked:t,onChange:(e,t)=>n(t),children:l("L0010566éèå·²æ¤é")})})}),iZ=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{isLogin:l}=(0,b.Z)(),[r,o]=(0,a.useState)(!1),[s,d]=(0,a.useState)(tc.MF.LIMIT),[c,u]=iU();r1({symbol:t,hideOther:!1});let{loading:p,columns:m,ordersList:h,orderItem:x,open:v,setOpen:g}=(0,iB.A)({symbol:t,hideOther:r,placeType:s,timeRange:c,paginationOptions:{defaultPageSize:20,defaultPageNo:1}}),{sm:y}=(0,f.Px)();return(0,i.jsxs)(r6.Wv,{children:[(0,i.jsx)(iq,{containerRef:n,hideOther:r,setHideOther:o}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rJ.A,{bottomBorder:!1,children:(0,i.jsxs)("div",{className:"w-full flex items-center ".concat(y?"justify-between":""),children:[(0,i.jsx)(im,{value:s,onChange:e=>{d(e)},showMarketLabel:!0}),y?null:(0,i.jsx)(tQ.A,{width:1,height:16,left:8,right:8,style:{backgroundColor:"var(--line-2)",marginRight:"8px !important"}}),u()]})}),y?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:36,children:(0,i.jsx)(iH,{hideOther:r,setHideOther:o})}):null,(0,i.jsx)(iA,{rowKey:["uuid","side","type"],rowHeight:60,bordered:!1,style:{minHeight:270},columns:m,data:h,loading:p,pagination:!1,footer:h.length?(0,i.jsx)(i_,{from:"order-history"}):null}),(0,i.jsx)(ij.A,{data:x,open:v,setOpen:g})]}):(0,i.jsx)(iu,{})]})}),iG=(0,a.memo)(e=>{let{containerRef:t}=e,{isLogin:n}=(0,b.Z)();return t.current?tK().createPortal((0,i.jsx)(ir,{children:n&&(0,i.jsx)(ie,{from:"trade-history"})}),t.current):null});var iW=n(46624);let iV=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{isLogin:l}=(0,b.Z)(),[r,a]=iU(),{loading:o,columns:s,tradeList:d}
1=(0,iW.A)({symbol:t,timeRange:r,paginationOptions:{defaultPageSize:20}});return r1({symbol:t,hideOther:!1,orderType:tc.MF.LIMIT}),(0,i.jsxs)(r6.Wv,{children:[(0,i.jsx)(iG,{containerRef:n}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rJ.A,{bottomBorder:!1,children:a()}),(0,i.jsx)(iA,{rowKey:["orderUuid","txUuid"],rowHeight:60,bordered:!1,style:{minHeight:270},columns:s,data:d,loading:o,pagination:!1,footer:d.length?(0,i.jsx)(i_,{from:"trade-history"}):null})]}):(0,i.jsx)(iu,{})]})});var iQ=n(35716),iY=n(45236),iK=n(4646);function i$(){let e=(0,u._)(["\n ","\n"]);return i$=function(){return e},e}function iX(){let e=(0,u._)(["\n position: relative;\n .new_tag {\n color: ",";\n display: inline-block;\n height: 13px;\n width: 29px;\n text-align: center;\n line-height: 13px;\n border-radius: 2px;\n font-size: 10px;\n background: var(--gradient-5);\n position: absolute;\n right: -8px;\n top: -10px;\n }\n"]);return iX=function(){return e},e}let iJ=(0,m.Ay)(iQ.A)(i$(),e=>e.$block&&"\n display: flex !important;\n & > * {\n flex: 1 !important;\n }\n "),i0=(0,m.Ay)(T.A)(iX(),V.tW),i1=(0,a.memo)(e=>{let{record:t,handleOpenSpotEarnModal:n,block:l=!1,isLeverage:r,sensorActionClick:a}=e,o=(0,_.A)(),{t:s}=(0,S.A)(),d=(0,en.A)();return(0,i.jsxs)(iJ,{size:8,$block:l,children:[r&&(0,i.jsx)(tw.$,{needOpenFutures:!1,leverCode:r?t.assetCode:"",type:r?"SPOT_TO_LEVER":"FUTURES_TO_SPOT",children:(0,i.jsx)(T.A,{size:"small",onClick:()=>o.push(""),style:{width:l?"100%":"auto"},block:l,children:s("L0000900å转")})}),!r&&(0,i.jsxs)(i.Fragment,{children:["usdt"===t.assetCode&&(0,i.jsx)(tw.$,{needOpenFutures:!1,leverCode:r?t.assetCode:"",type:r?"SPOT_TO_LEVER":"FUTURES_TO_SPOT",children:(0,i.jsx)(T.A,{size:"small",style:{width:l?"100%":"auto",padding:0},block:l,children:(0,i.jsx)("div",{className:"px-[12px] py-[5px]",onClick:()=>{null==a||a({buttonName:"transfer"})},children:s("L0000900å转")})})}),(0,i.jsx)(T.A,{size:"small",style:{width:l?"100%":"auto"},block:l,disabled:!t.drawSwitch&&!t.stationDrawSwitch,onClick:()=>{null==a||a({buttonName:"withdraw"}),o.push("/wallet/account/main/withdrawal/crypto/".concat(t.assetCode||"btc"))},children:s("L0000154æç°")}),(0,i.jsx)(T.A,{size:"small",style:{width:l?"100%":"auto"},block:l,disabled:!t.depositSwitch,onClick:()=>{null==a||a({buttonName:"deposit"}),o.push("/wallet/account/main/deposit/crypto/".concat(t.assetCode))},children:s("L0000155å
å¼")})]}),t.spotEarnApr&&!d?(0,i.jsxs)(i0,{size:"small",block:l,onClick:()=>{null==a||a({buttonName:"earn"}),null==n||n(t.spotEarnProductId)},children:[s("L0006016çè´¢"),(0,i.jsx)("span",{className:"new_tag",children:"New"})]}):null]})});var i2=n(34802),i6=n(49659);function i4(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px;\n cursor: ",";\n .apr_tag {\n display: flex;\n align-items: center;\n border-radius: 4px;\n height: 16px;\n padding: 1px 4px;\n font-size: 11px;\n font-weight: 500;\n line-height: 12px;\n .lbank-icon-DirectionDown {\n font-size: 12px;\n }\n &.up {\n .lbank-icon-DirectionDown {\n transform: rotate(180deg);\n }\n }\n }\n"]);return i4=function(){return e},e}let i3=m.Ay.div(i4(),e=>e.$enableClick?"pointer":"default"),i5=(0,a.memo)(e=>{let{record:t,className:n,enableClick:l=!0,onClick:r}=e;if(!t.spotEarnApr)return null;let a=t.spotEarnApr.replace("%","");return(0,i.jsx)(i3,{$enableClick:l,className:n,onClick:r,children:(0,i.jsxs)(el.A,{change:Number(a)||0,className:"apr_tag",type:"primary",children:["APY ",(0,i.jsx)(i6.A,{})," ",t.spotEarnApr]})})}),i8=new Map,i7=e=>{let{symbol:t,shelfStatus:n="ON",hideOther:l,hideSmallAmount:r}=e,{t:o}=(0,S.A)(),{isLogin:c}=(0,w.A)(),u=(0,en.A)(),[p,m]=(0,tX.A)(!0),[h,x]=(0,a.useState)({}),f=(0,et.F)(h),{loading:v}=(0,tL.A)(),[{tradeAsset:g,tradePost:b},y]=(0,d.d4)(e=>({tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost})),A=(0,et.F)(g),j=(0,et.F)(b),{lgtSymbol:L,rate:C}=(0,eh.A)(),{renderModal:k,openModal:_}=(0,iY.Ay)({pageName:iK.fR.SPOT_TRADING}),N=(0,a.useCallback)(e=>{e&&_(e)},[]),T=(0,a.useMemo)(()=>{var e,t;return{tradeAsset:null===(e=A.current)||void 0===e?void 0:e.toLowerCase(),tradePost:null===(t=j.current)||void 0===t?void 0:t.toLowerCase()}},[A,j]),E=(0,a.useCallback)(e=>{var t;let n=null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase();return n===T.tradeAsset?0:n===T.tradePost?1:2},[T]),P=(0,a.useCallback)(e=>e.filter(e=>{var t,n;let l=(null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase())===T.tradeAsset||(null===(n=e.assetCode)||void 0===n?void 0:n.toLowerCase())===T.tradePost,r=new q.A(e.toUsd||0),i=new q.A(e.debtAssetAmt||0);return l||r.gt(0)||i.gt(0)}),[T]),O=(0,a.useCallback)(e=>e.filter(e=>{var t;let n=null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase(),l=n===T.tradeAsset||n===T.tradePost,r=e.basicToUsd&&e.assetAmt?(0,q.A)(+e.assetAmt).times(+e.basicToUsd):(0,q.A)(0),i=e.basicToUsd&&e.debtAssetAmt?(0,q.A)(+e.debtAssetAmt).times(+e.basicToUsd):(0,q.A)(0),a=r.gte(1),o=i.gte(1);return l||a||o}),[T]),{tradeWS:R}=(0,s.pP)(),{observeLeverageCurrencyInfoUpdate:I}=(0,X.A)();(0,a.useEffect)(()=>{R.getLeverageCurrencyInfoWS()},[R]),(0,a.useEffect)(()=>
1{let e=I(e=>{if(null==e?void 0:e.data){let t=(null==e?void 0:e.data)||{},{pair:n}=t;if(!n)return;let l=f.current[n];f.current[n]={...l,assetCode:n,...t},y({baseAssetLeverageDetail:{...f.current[A.current]||le.Pn},postAssetLeverageDetail:{...f.current[j.current]||le.Pn}}),x({...f.current})}});return()=>{e()}},[I,A,j,y,f]);let M=(0,a.useCallback)((e,t)=>{let n=new Map;return t.forEach(e=>{e.assetCode&&n.set(e.assetCode.toLowerCase(),e)}),e.map(e=>{var t;let l=null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase(),r=l?n.get(l):void 0;return{...e,...r&&{spotEarnApr:r.apr,spotEarnMinAmt:r.minAmt,spotEarnProductId:r.productId}}})},[]),z=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!v&&c)try{let r={shelfStatus:n,needSwitch:"true",isHolding:"false"};if(t){let e=t.split("_");l&&(r.assetCodes=e.join(","))}let i=JSON.stringify({params:r,isAutoRequest:e}),a=i8.get(i);if(a&&Date.now()-a.timestamp<1e3){let[e,t]=await a.promise;if(e){let n=M(e||[],t.spotEarnDTOList||[]),l=P(n).sort((e,t)=>E(e)-E(t)).reduce((e,t)=>(e[t.assetCode]=t,e),{});x(l),y({baseAssetLeverageDetail:{...l[A.current]||le.Pn},postAssetLeverageDetail:{...l[j.current]||le.Pn}})}return}y({baseAssetLeverageDetail:le.Pn,postAssetLeverageDetail:le.Pn});let o=m(Promise.all([eA.Ay.getLeverageTradeCenterPositionCondition(r,void 0,e?(0,tN.u)("asset_condition_polling"):void 0),eA.Ay.financeEarnCenterFinanceDrainageSpotEarn({},void 0,e?(0,tN.u)("asset_earn_polling"):void 0)])),s=Date.now();i8.set(i,{promise:o,timestamp:s}),o.finally(()=>{setTimeout(()=>{let e=i8.get(i);e&&e.timestamp===s&&i8.delete(i)},1e3)}).catch(()=>void 0);let[d,c]=await o;if(d){let e=M(d||[],c.spotEarnDTOList||[]),t=P(e).sort((e,t)=>E(e)-E(t)).reduce((e,t)=>(e[t.assetCode]=t,e),{});x(t),y({baseAssetLeverageDetail:{...t[A.current]||le.Pn},postAssetLeverageDetail:{...t[j.current]||le.Pn}})}}catch(e){console.error("è·åæ æèµäº§ç¶åµå¤±è´¥:",e)}},[v,c,t,l,n,y,m,P,A,j,E,M]),F=(0,a.useCallback)((e,t)=>{if(!e||!t)return"--";try{let n=(0,q.A)(+e).times(+t).toFixed();return L+(0,Q.al)((0,Q.w1)(n,4),C)}catch(e){return"--"}},[L,C]),D=(0,a.useMemo)(()=>[{key:"assetCode",title:o("L0003447èµäº§"),align:"left",fixed:"left",excludedField:!0,render:(e,t)=>(0,i.jsxs)(er.A,{size:4,inline:!0,children:[(0,i.jsx)(i2.A,{type:"coin",showHover:!1,category:null==t?void 0:t.assetCode,fontSize:12,showArrow:!1,enableClick:!1}),(0,i.jsx)(i5,{record:t,onClick:()=>u&&N(t.spotEarnProductId),enableClick:u})]})},{key:"availableAssetAmt",title:o("L0000149å¯ç¨"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.availableAssetAmt?(0,Q.w1)(t.availableAssetAmt,4):"--"}),(0,i.jsx)("span",{children:F(t.availableAssetAmt,t.basicToUsd)})]})},{key:"assetAmt",title:o("L0000926æ»é¢"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.assetAmt?(0,Q.w1)(t.assetAmt,4):"--"}),(0,i.jsx)("span",{children:F(t.assetAmt,t.basicToUsd)})]})},{key:"freezeAssetAmt",title:o("L0011616å»ç»"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.freezeAssetAmt?(0,Q.w1)(t.freezeAssetAmt,4):"--"}),(0,i.jsx)("span",{children:F(t.freezeAssetAmt,t.basicToUsd)})]})},{key:"debtAssetAmt",title:o("L0016747è´åº"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.debtAssetAmt?(0,Q.w1)(t.debtAssetAmt,4):"--"}),(0,i.jsx)("span",{children:F(t.debtAssetAmt,t.basicToUsd)})]})},{key:"transferAssetAmt",title:o("L0016748å¯è½¬"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.transferAssetAmt?(0,Q.w1)(t.transferAssetAmt,4):"--"}),(0,i.jsx)("span",{children:F(t.transferAssetAmt,t.basicToUsd)})]})},{key:"action",title:o("L0002044æä½"),align:"right",excludedField:!0,render:(e,t)=>(0,i.jsx)(i1,{record:t,isLeverage:!0,handleOpenSpotEarnModal:N})},{key:"assetHeader",title:o("L0003447èµäº§"),align:"left",fixed:"left",hidden:!0,isHeader:!0,render:(e,t)=>(0,i.jsx)(eC.default,{type:"coin",symbol:null==t?void 0:t.assetCode,fontSize:12,showLogo:!1,showArrow:!1,customIdentifier:(0,i.jsx)(i5,{record:t,onClick:()=>N(t.spotEarnProductId)})})},{key:"actionFooter",title:o("L0002044æä½"),align:"right",hidden:!0,isFooter:!0,render:(e,t)=>(0,i.jsx)(r6.fn,{children:(0,i.jsx)(i1,{record:t,block:!0,isLeverage:!0})})}],[o,u]);return(0,a.useMemo)(()=>{z(!0)},[z]),{loading:p,columns:D,renderSpotEarnModal:k,assetCondition:(0,a.useMemo)(()=>{let e=Object.values(h);return r?O(e).sort((e,t)=>
1E(e)-E(t)).slice(0,20):e.slice(0,20)},[h,r,E,O]),assetConditionMap:h,fetch:z}},i9=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideSmallAmount:l,setHideSmallAmount:r,containerRef:a}=e,{t:o}=(0,S.A)(),{isLogin:s}=(0,b.Z)(),{sm:d}=(0,f.Px)();return a.current?tK().createPortal((0,i.jsx)(ir,{children:d||!s?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r6.cO,{size:"small",disabled:!s,appearance:"square",checked:t,onChange:(e,t)=>{n(t)},children:o("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(r6.cO,{size:"small",disabled:!s,appearance:"square",checked:!!l,onChange:(e,t)=>{null==r||r(t)},children:(0,i.jsx)(nH.A,{title:o("L0019637éèä»·å¼åè´åºé½å°äº1USDç"),action:"hover",zIndex:9999,children:o("L0000284éèå°é¢èµäº§")})})]})}),a.current):null}),ae=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideSmallAmount:l,setHideSmallAmount:r}=e,{t:a}=(0,S.A)(),{isLogin:o}=(0,b.Z)();return(0,i.jsx)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:(0,i.jsxs)(er.A,{size:16,align:"center",inline:!0,children:[(0,i.jsx)(r6.cO,{size:"small",disabled:!o,appearance:"square",checked:t,onChange:(e,t)=>
1{n(t)},children:a("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(r6.cO,{size:"small",disabled:!o,appearance:"square",checked:!!l,onChange:(e,t)=>{null==r||r(t)},children:(0,i.jsx)(nH.A,{title:a("L0019637éèä»·å¼åè´åºé½å°äº1USDç"),action:"click",zIndex:9999,children:a("L0000284éèå°é¢èµäº§")})})]})})});function at(){let e=(0,u._)(["\n white-space: normal;\n justify-content: flex-start;\n align-items: flex-start;\n text-align: left;\n display: inline-block;\n "]);return at=function(){return e},e}function an(){let e=(0,u._)(["\n color: ",";\n text-align: left;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n padding: 0;\n display: flex;\n white-space: nowrap;\n overflow: hidden;\n a {\n display: inline-block;\n margin: 0 3px;\n white-space: nowrap;\n color: ",";\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n ::after {\n content: '';\n width: 100%;\n display: block;\n height: 1px;\n background-color: ",";\n }\n\n &:hover {\n color: "," !important;\n }\n }\n\n ","\n"]);return an=function(){return e},e}let al=m.Ay.div(an(),V.fG,V.vZ,V.vZ,V.vZ,f.XG.mobile((0,h.AH)(at()))),ar=(0,a.memo)(e=>{let{from:t,url:n,text:l}=e,{t:r}=(0,S.A)(),{isLogin:o}=(0,b.Z)(),s=(0,r3.A)(),d=(0,a.useMemo)(()=>o?n||"/wallet/orders/exchange/".concat(t):s,[o,s,t,n]);return(0,i.jsx)(al,{children:(0,iL.A)(r,"L0013418æå¤å±ç¤º20æ¡æ°æ®è¯·å徿¥çæ´",{0:(0,i.jsxs)(i.Fragment,{children:["\xa0",(0,i.jsx)(eP.A,{href:"".concat(d),passHref:!0,prefetch:!1,target:o?"_blank":"",rel:"noreferrer",microEntrance:!0,children:l||r("L0013324订åä¸å¿")}),"\xa0"]})})})}),ai=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,w.A)(),o=(0,en.A)(),[s,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),{loading:p,columns:m,assetCondition:h,renderSpotEarnModal:x}=i7({symbol:t,hideOther:s,hideSmallAmount:c});return r1({symbol:t,hideOther:!1,orderType:tc.MF.LIMIT}),(0,i.jsxs)(r6.Wv,{children:[(0,i.jsx)(i9,{containerRef:n,hideOther:s,setHideOther:d,hideSmallAmount:c,setHideSmallAmount:u}),r?(0,i.jsxs)(i.Fragment,{children:[x(),o?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:36,children:(0,i.jsx)(ae,{hideOther:s,setHideOther:d,hideSmallAmount:c,setHideSmallAmount:u})}):null,(0,i.jsx)(iA,{rowKey:["assetCode","assetId"],rowHeight:60,bordered:!1,style:{minHeight:270},columns:m,data:h,loading:p,pagination:!1,footer:h.length?(0,i.jsx)(ar,{from:"spot-assets",url:"/wallet/margin",text:l("L0002030æ æè´¦æ·")}):null})]}):(0,i.jsx)(iu,{})]})}),aa=(0,a.memo)(e=>{let{wrapperRef:t}=e;return(0,i.jsx)("div",{className:"spot_orders_toolbar",ref:t})});var ao=n(17331),as=n(27999);let ad=e=>{let{symbol:t,openClose:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,b.Z)(),[o,c]=(0,tX.A)(!0),[u,p]=(0,a.useState)({}),m=(0,et.F)(u),{symbolConfig:h,loading:x,assetInfo:v}=(0,tL.A)(t,"spot"),{isMobile:g}=(0,f.Px)(),{tradeWS:y}=(0,s.pP)(),{observeLeveragePositionInfoUpdate:A}=(0,X.A)(),{lgtSymbol:j}=(0,eh.A)();(0,a.useEffect)(()=>y.getLeveragePositionInfoWS(),[y.getLeveragePositionInfoWS]),(0,a.useEffect)(()=>{let e=A(e=>{if(null==e?void 0:e.data){let t=(null==e?void 0:e.data)||{};if(t.pair){let e=m.current[t.pair];t.isHolding?e?m.current[t.pair]={...e,...t,assetCode:e.assetCode||t.pair}:m.current[t.pair]={...t,assetCode:t.pair}:delete m.current[t.pair],p({...m.current})}}});return()=>{e()}},[]);let[{exchangeState:L,assetUpdate:C},w]=(0,d.d4)(e=>({exchangeState:e.exchangeState,assetUpdate:e.assetUpdate})),k=(0,a.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!x&&r){if("--"===L.tradeAsset||"--"===L.tradePost)return;let n=t?(0,tN.u)("position_list_polling"):void 0;(e?c(eA.Ay.getLeverageTradeCenterPositionList({},void 0,n)):eA.Ay.getLeverageTradeCenterPositionList({},void 0,n)).then(e=>(p((e||[]).reduce((e,t)=>(e[t.assetCode]=t,e),{})),w({exchangeState:{totalLeveragePositionCount:(e||[]).length}}),e)).catch(()=>void 0)}},[x,r,L.tradeAsset,L.tradePost]),_=(0,ei.default)(e=>{let t=(null==e?void 0:e.assetCode)||(null==e?void 0:e.pair);return(0,i.jsx)(r6.Z,{noHover:(null==t?void 0:t.toLocaleUpperCase())==="USDT",href:(null==t?void 0:t.toLocaleUpperCase())!=="USDT"?"/trade/".concat(t,"_usdt"):"javascript:;",children:(0,i.jsx)(eC.default,{symbol:t,showLogo:!1,showArrow:(null==t?void 0:t.toLocaleUpperCase())!=="USDT",fontSize:g?16:12,fontWeight:500,arrowSize:g?18:16,showNickName:!0,showUnit:!1})})}),N=(0,a.useMemo)(()=>[{key:"assetCode",title:l("L0018024å¸ç§ç¹æ®è¯´ææ¢ä¸ä¸ªæ°çkeyè±"),align:"left",fixed:"left",excludedField:!0,render:(e,t)=>_(t)},{key:"assetAmt",title:l("L0008270ä»ä½"),align:"left",render:(e,t)=>{var n,l,r;return(0,i.jsx)(iQ.A,{direction:"vertical",size:2,children:(0,i.jsx)(el.A,{change:t.assetAmt,children:(0,i.jsxs)(em.A,{children:[(0,Q.LN)(null!==(r=t.assetAmt)&&void 0!==r?r:"--")," ",null==v?void 0:null===(l=v[t.assetCode||""])||void 0===l?void 0:null===(n=l.alias)||void 0===n?void 0:n.toLocaleUpperCase()]})})})}},{key:"indexPrice",title:l("L0016024ææ°ä»·æ ¼"),align:"left",render:(e,t)=>{var n,l,r;return"usdt"===t.assetCode?"--":(0,i.jsx)(iQ.A,{direction:"vertical",size:2,children:(0,i.jsxs)(em.A,{children:[(0,Q.Qr)(null!==(r=t.indexPrice)&&void 0!==r?r:"--")," ",null==v?void 0:null===(l=v[t.settleAssetCode||""])||void 0===l?void 0:null===(n=l.alias)||void 0===n?void 0:n.toLocaleUpperCase()]})})}},{key:"entryPrice",title:l("L0002524å¼ä»ä»·æ ¼"),align:"left",render:(e,t)=>{var n,l,r;return"usdt"===t.assetCode?"--":(0,i.jsx)(iQ.A,{direction:"vertical",size:2,children:(0,i.jsxs)(em.A,{children:[(0,Q.Qr)(null!==(r=t.entryPrice)&&void 0!==r?r:"--")," ",null==v?void 0:null===(l=v[t.settleAssetCode||""])||void 0===l?void 0:null===(n=l.alias)||void 0===n?void 0:n.toLocaleUpperCase()]})})}},{key:"profit",title:l("L0001495çäº"),align:"left",render:(e,t)=>{var n,l,r;return"usdt"===t.assetCode?"--":(0,i.jsx)(iQ.A,{direction:"vertical",size:2,children:(0,i.jsx)(el.A,{change:t.profit,children:(0,i.jsxs)(em.A,{children:[(0,Q.LN)(null!==(r=t.profit)&&void 0!==r?r:"--")," ",null==v?void 0:null===(l=v[t.settleAssetCode||""])||void 0===l?void 0:null===(n=l.alias)||void 0===n?void 0:n.toLocaleUpperCase()]})})})}},{key:"liquidationPrice",title:(0,i.jsx)(nH.A,{title:l("L0018145é¢ä¼°å¼ºå¹³ä»·æ ¼ä»
ä½åèå®é
触å强"),children:l("L0016583é¢ä¼°å¼ºå¹³ä»·")}),align:"left",render:(e,t)=>{var n,l;return"usdt"!==t.assetCode&&t.liquidationPrice?(0,i.jsx)(iQ.A,{direction:"vertical",size:2,children:(0,i.jsxs)(em.A,{children:[(0,Q.Qr)(t.liquidationPrice)," ",null==v?void 0:null===(l=v[t.settleAssetCode||""])||void 0===l?void 0:null===(n=l.alias)||void 0===n?void 0:n.toLocaleUpperCase()]})}):"--"}},{key:"action",title:l("L0002044æä½"),align:"right",excludedField:!0,render:(e,t)=>(null==t?void 0:t.assetCode)==="usdt"&&+((null==t?void 0:t.assetAmt)||0)>
10&&0==+((null==t?void 0:t.debtAssetAmt)||0)?(0,i.jsx)(tw.$,{needOpenFutures:!1,leverCode:t.assetCode||"",type:"LEVER_TO_SPOT",children:(0,i.jsx)(T.A,{size:"small",children:l("L0000900å转")})}):(0,i.jsx)(T.A,{size:"small",onClick:()=>n(t),children:l("L0001061å¹³ä»")})},{key:"assetHeader",title:l("L0003447èµäº§"),align:"left",fixed:"left",hidden:!0,isHeader:!0,render:(e,t)=>(0,i.jsxs)(r6.dU,{children:[_(t),(0,i.jsx)(ao.A,{className:"icon",onClick:()=>n(t)})]})}],[l,h,v,j]);return(0,a.useMemo)(()=>{k(!0,!0)},[k,C]),(0,as.A)(()=>k(!1,!0),[],{interval:5e3}),{loading:o,columns:N,positionList:Object.values(u),fetch:k}};var ac=n(63850),au=n.n(ac),ap=n(60426),am=function(e){return e.quantity="quantity",e.percent="percent",e.closeAsset="closeAsset",e.disposalAssetCodes="disposalAssetCodes",e}({});function ah(){let e=(0,u._)(["\n display: flex;\n flex-wrap: wrap;\n"]);return ah=function(){return e},e}function ax(){let e=(0,u._)(["\n cursor: pointer;\n"]);return ax=function(){return e},e}let af=(0,m.Ay)(er.A)(ah()),av=m.Ay.div(ax()),ag=o().forwardRef((e,t)=>{let{value:n,onChange:l,assetCode:r}=e,[o,s]=(0,a.useState)([]),[d,c]=(0,a.useState)([]);return(0,a.useEffect)(()=>{r&&eA.Ay.getLeverageTradeCenterPositionSettlementAssetList({assetCode:r}).then(e=>{let t=e||[];s(t);let n="usdt";if(n){var i,a;t.find(e=>e.assetCode===n)?null==l||l(n):(null===(i=t[0])||void 0===i?void 0:i.assetCode)&&(null==l||l(null===(a=t[0])||void 0===a?void 0:a.assetCode))}0!==t.length&&eA.Ay.getLeverageTradeCenterLeverageGet({symbol:t.map(e=>"".concat(r,"_").concat(e.assetCode)).join(",")}).then(e=>{c(e.resultList||[])})})},[r]),(0,a.useImperativeHandle)(t,()=>({assetsConfig:d,assetList:o}),[d,o]),(0,i.jsx)(af,{style:{marginBottom:-8},inline:!0,size:[8,8],align:"center",wrap:!0,children:o.map(e=>(0,i.jsx)(av,{className:"".concat(e.assetCode===n?"active":""),onClick:()=>null==l?void 0:l(e.assetCode),children:(0,i.jsx)(eC.default,{showLogo:!0,symbol:e.assetCode,type:"coin",fontSize:14,fontWeight:400,noTooltip:!0,logoGap:4,enableLazy:!1})},e.assetCode))})}),ab=(0,a.memo)(ag);function ay(){let e=(0,u._)(["\n padding: 16px 14px;\n "]);return ay=function(){return e},e}function aA(){let e=(0,u._)(["\n min-width: 10px;\n\n ","\n\n &.ant-form {\n .ant-form-item label {\n ",";\n }\n .ant-form-item {\n margin-bottom: 12px !important;\n .ant-form-item-label {\n margin-bottom: 4px;\n width: fit-content;\n & > label {\n ",";\n }\n }\n .ant-form-item-explain-error {\n margin-top: 4px;\n }\n }\n }\n"]);return aA=function(){return e},e}let aj=(0,m.Ay)(lg.A)(aA(),f.XG.mobile((0,h.AH)(ay())),e=>e.theme.bizTypography.r12,e=>e.theme.bizTypography.r14);function aL(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n ",";\n color: ",";\n\n .text {\n margin-right: 12px;\n }\n\n .divide {\n width: 0.5px;\n height: 12px;\n background-color: ",";\n }\n\n .allButton {\n margin-left: 12px;\n color: ",";\n cursor: pointer;\n }\n"]);return aL=function(){return e},e}function aC(){let e=(0,u._)(["\n clear: both;\n"]);return aC=function(){return e},e}let aw=m.Ay.div(aL(),e=>e.theme.bizTypography.r14,V.fG,V.fG,V.D$),ak=m.Ay.div(aC()),a_=(0,a.memo)(e=>{var t,n;let{form:l,record:r}=e,{t:o}=(0,S.A)(),[s,d]=(0,a.useState)(""),c=(0,a.useRef)(null),u=(0,a.useMemo)(()=>{var e;return(null==r?void 0:null===(e=r.assetCode)||void 0===e?void 0:e.toLocaleLowerCase())==="usdt"},[null==r?void 0:r.assetCode]),p=u||0==+((null==r?void 0:r.assetAmt)||0),m=p?(null==r?void 0:r.debtAssetAmt)||"--":(null==r?void 0:r.assetAmt)||"--",[h,x]=(0,a.useState)(0),f=aj.useWatch([],l),{assetItem:v,assetInfo:g}=(0,tL.A)("".concat((null==r?void 0:r.assetCode)||""),"coin"),b=(0,a.useMemo)(()=>{var e;return null===(e=(null==v?void 0:v.alias)||(null==r?void 0:r.assetCode)||"")||void 0===e?void 0:e.toLocaleUpperCase()},[null==v?void 0:v.alias,null==r?void 0:r.assetCode]),y=(0,a.useMemo)(()=>{var e;return(null==f?void 0:f.closeAsset)?((null==g?void 0:null===(e=g[null==f?void 0:f.closeAsset])||void 0===e?void 0:e.alias)||(null==f?void 0:f.closeAsset)||"").toLocaleUpperCase():""},[null==f?void 0:f.closeAsset,g]),A=(0,tD.default)((e,t)=>{let{quantity:n,percent:l}=e,r=n,i=l;if(t===am.percent){var a,o;r=(0,l_.mj)(m,l,"100"===l?(null==v?void 0:v.precision)||8:+((null==v?void 0:null===(o=v.acrc)||void 0===o?void 0:null===(a=o[null==f?void 0:f.closeAsset])||void 0===a?void 0:a.minQua)||4))}else i=(0,l_.kn)(r,m);return{quantity:r,percent:i}}),j=(0,tD.default)(e=>{let{percent:t}=A({quantity:e},am.quantity);return x(parseInt(null!=t?t:"0",10)),e}),L=async e=>{var t,n,l;return e?!p&&(null==v?void 0:null===(t=v.minTranQua)||void 0===t?void 0:t[null==f?void 0:f.closeAsset])&&Number(e)<Number(null==v?void 0:null===(n=v.minTranQua)||void 0===n?void 0:n[null==f?void 0:f.closeAsset])?Promise.reject(Error(o("⥠".concat(null==v?void 0:null===(l=v.minTranQua)||void 0===l?void 0:l[null==f?void 0:f.closeAsset]," ").concat(b)))):m&&+e>+m?Promise.reject(Error(o(p?"L0019406è¶
åºå½åå¯è¿æ°é":"L0016745è¶
åºå½åå¯å¹³ä»æ°é"))):Promise.resolve():Promise.reject(Error(o("L0000508请è¾å
¥æ°é")))},C=(0,tD.default)(e=>{l.setFields([{name:e,errors:[]}])}),w=(0,tD.default)(e=>{let{quantity:t}=A({percent:"".concat(e)},am.percent);l.setFieldsValue({quantity:t}),l.validateFields([am.quantity]),x(e)}),k=(0,tD.default)(async()=>{var e;let t=(null==f?void 0:f.closeAsset)?null==g?void 0:null===(e=g[null==f?void 0:f.closeAsset])||void 0===e?void 0:e.precision:0;if(!(null==r?void 0:r.assetCode)||!(null==f?void 0:f.closeAsset)||!+((null==f?void 0:f.quantity)||0)){d((0,Q.gO)(0,t));return}let n=await eA.Ay.getLeverageTradeCenterPositionSettlementAmount({assetCode:null==r?void 0:r.assetCode,pairCode:null==f?void 0:f.closeAsset,amount:null==f?void 0:f.quantity});d((0,Q.gO)((null==f?void 0:f.quantity)&&(null==n?void 0:n.settlementAmount)||0,t))});(0,ap.A)(k,500,[null==r?void 0:r.assetCode,null==f?void 0:f.closeAsset,null==f?void 0:f.quantity]);let _=(0,tD.default)(()=>{setTimeout(()=>{l.setFieldsValue({quantity:m}),j(m),setTimeout(()=>{l.validateFields([am.quantity])})})}),N=(0,tD.default)(e=>{let t=document.activeElement;
1e.target.focus(),t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"center"})},300)}),T=(0,a.useMemo)(()=>{var e,t,n,l;return u?(null==g?void 0:null===(e=g[null==r?void 0:r.assetCode])||void 0===e?void 0:e.precision)||8:+((null==r?void 0:r.assetAmt)||0)>0?(null==v?void 0:null===(n=v.acrc)||void 0===n?void 0:null===(t=n.usdt)||void 0===t?void 0:t.minQua)||4:(null==g?void 0:null===(l=g[null==r?void 0:r.assetCode])||void 0===l?void 0:l.precision)||8},[u,g,null==r?void 0:r.assetCode,null==r?void 0:r.assetAmt,null==v?void 0:null===(n=v.acrc)||void 0===n?void 0:null===(t=n.usdt)||void 0===t?void 0:t.minQua]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"current_close",children:u?o("L0019142å½åå¯ç¨ä½é¢è´åºå°ç´æ¥ä½¿ç¨å¯ç¨",{0:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.availableAssetAmt)||"--",T)),1:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.debtAssetAmt)||"--",T))}):0==+((null==r?void 0:r.assetAmt)||0)?o("L0019141å½åå¯ç¨ä½é¢è´åºå°ç´æ¥ä½¿ç¨å¯ç¨",{0:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.availableAssetAmt)||"--",T)),1:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.debtAssetAmt)||"--",T))}):o("L0016736å¿è¿è´åºå¹¶æå¸ä»·åå°å©ä½èµäº§åº")}),(0,i.jsxs)("div",{className:"avail_close",children:[(0,i.jsx)("div",{className:"avail_close_title",children:o(u||0==+((null==r?void 0:r.assetAmt)||0)?"L0006886è¿æ¬¾æ°é":"L0001109平仿°é")}),(0,i.jsxs)("div",{className:"avail_close_info",children:[(0,i.jsx)("div",{className:"avail_close_info-flag",children:o(u||0==+((null==r?void 0:r.assetAmt)||0)?"L0019012å¯è¿":"L0004683å¯å¹³")}),(0,i.jsx)("div",{className:"avail_close_info-value",children:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)(u||0==+((null==r?void 0:r.assetAmt)||0)?(null==r?void 0:r.debtAssetAmt)||"--":(null==r?void 0:r.assetAmt)||"--",T))," ",b]})})]})]}),(0,i.jsx)(aj.Item,{name:am.quantity,getValueFromEvent:j,className:"quantity",validateTrigger:["onChange","onBlur"],rules:[()=>({validator:(e,t)=>L(t)})],children:(0,i.jsx)(lA.A,{addonAfter:(0,i.jsxs)(aw,{children:[(0,i.jsx)("div",{className:"text",children:b}),(0,i.jsx)("div",{className:"divide"}),(0,i.jsx)("div",{className:"allButton",onClick:_,children:"All"})]}),onFocus:lw()(N,ly()(C,"quantity")),precision:T,noNegative:!0,placeholder:o("L0001979请è¾å
¥"),controls:!1})}),(0,i.jsx)(ak,{className:"slider_wrapper",children:(0,i.jsx)(n5.A,{value:h,graduated:!0,onChange:w,breakPointCount:5,onlyInclusioMark:!1,progress:!0,shape:"diamond",renderMark:e=>"".concat(e,"%"),min:0,max:100})}),u||0==+((null==r?void 0:r.assetAmt)||0)?(0,i.jsx)(aj.Item,{name:am.closeAsset,className:"close_asset-temp",noStyle:!0,initialValue:"usdt",children:(0,i.jsx)("input",{type:"hidden",value:"usdt"})}):(0,i.jsxs)("div",{className:"closeâasset",children:[(0,i.jsxs)("div",{className:"closeâasset-temp",children:[(0,i.jsx)("div",{className:"closeâasset-title-temp",children:o("L0007146ç»ç®å¸ç§")}),(0,i.jsx)(aj.Item,{name:am.closeAsset,className:"close_asset-temp",noStyle:!0,children:(0,i.jsx)(ab,{assetCode:null==r?void 0:r.assetCode,ref:c})})]}),(0,i.jsxs)("div",{className:"estimate-close-asset",children:[(0,i.jsx)("div",{className:"estimate-close-title",children:o("L0016790é¢ä¼°å¯ç»ç®æ°é")}),(0,i.jsxs)("div",{className:"estimate-close-value",children:[(0,Q.LN)(s||"--")," ",y]})]})]})]})});var aN=n(37861);function aT(){let e=(0,u._)(["\n .alert-info {\n margin-top: 20px;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n gap: 6px;\n align-self: stretch;\n border-radius: 4px;\n background: ",";\n\n .lbank-alert-header {\n align-items: center;\n }\n\n .lbank-alert-icon {\n svg {\n width: 20px;\n height: 20px;\n }\n }\n .lbank-alert-title {\n color: ",";\n ","\n }\n }\n"]);return aT=function(){return e},e}function aS(){let e=(0,u._)(["\n width: 100%;\n\n label.lbank-checkbox {\n ",";\n ",";\n white-space: wrap;\n word-break: break-word;\n width: 100%;\n display: inline-block;\n }\n\n .position-item {\n display: flex;\n align-items: center;\n width: calc(100% - 52px);\n\n &-title {\n display: inline-block;\n flex: 1;\n ","\n ",";\n margin-right: 12px;\n min-width: 181px;\n }\n\n &-available {\n display: inline-block;\n min-width: 183px;\n ",";\n }\n }\n"]);return aS=function(){return e},e}function aE(){let e=(0,u._)(["\n width: ",";\n"]);return aE=function(){return e},e}let aP=m.Ay.div(aT(),V.fn,V.mi,e=>e.theme.bizTypography.r14),aO=(0,m.Ay)(nO.A)(aS(),e=>e.theme.bizTypography.m14,V.Ft,(0,V.L9)(2),e=>e.theme.bizTypography.m14,e=>e.theme.bizTypography.m14),aR=m.Ay.div(aE(),e=>{let{maxWidth:t}=e;return t?"".concat(t,"px"):"auto"}),aI=(0,a.memo)(e=>{var t,l;let{record:r,onChange:o}=e,{t:s}=(0,S.A)(),[d,c]=(0,a.useState)([]),[u,p]=(0,a.useState)(),[m,h]=(0,a.useState)(),{assetInfo:x}=(0,tL.A)(),[f,v]=(0,tX.A)(!0);(0,a.useEffect)(()=>{(null==r?void 0:r.assetCode)&&v(eA.Ay.getLeverageTradeCenterPositionDisposalAssetList({assetCode:r.assetCode})).then(e=>{c((e||[]).map(e=>{var t;return{title:((null==x?void 0:null===(t=x[e.assetCode])||void 0===t?void 0:t.alias)||e.assetCode||"").toLocaleUpperCase(),value:e.assetCode,available:e.availableAssetAmt,checked:!0}}))})},[null==r?void 0:r.assetCode]),(0,a.useEffect)(()=>{null==o||o(0===d.length?["noList"]:(d||[]).map(e=>
1e.checked?e.value:"").filter(Boolean))},[d]);let{assetItem:g}=(0,tL.A)("".concat((null==r?void 0:r.assetCode)||""),"coin"),b=(0,a.useMemo)(()=>{var e;return(null==x?void 0:null===(e=x[null==r?void 0:r.assetCode])||void 0===e?void 0:e.precision)||8},[null==r?void 0:r.assetCode,x]),y=(0,tD.default)((e,t)=>{let n=[...d],l=n.find(t=>t.value===e);l&&(l.checked=t,c(n))}),A=[{label:(0,i.jsx)(i.Fragment,{children:s("L0016663å
¨é¨å款")}),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((null==r?void 0:r.debtAssetAmt)||"--")," ",null===(t=(null==g?void 0:g.alias)||(null==r?void 0:r.assetCode))||void 0===t?void 0:t.toLocaleUpperCase()]})},{label:s("L0007349å¯ç¨"),value:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((null==r?void 0:r.availableAssetAmt)||"--")," ",null===(l=(null==g?void 0:g.alias)||(null==r?void 0:r.assetCode))||void 0===l?void 0:l.toLocaleUpperCase()]})}];return(0,eo.A)(()=>{var e,t,l;let r=[...(null===(l=n.g)||void 0===l?void 0:null===(t=l.document)||void 0===t?void 0:null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,".position-item-available"))||[]].map(e=>(null==e?void 0:e.offsetWidth)||0),i=Math.max(...r);h(r.findIndex(e=>e===i)),p(i)}),(0,i.jsxs)(aP,{children:[A.map(e=>(0,i.jsxs)("div",{className:"avail_close",children:[(0,i.jsx)("div",{className:"avail_close_title_zero",children:e.label}),(0,i.jsx)("div",{className:"avail_close_info",children:(0,i.jsx)("div",{className:"avail_close_info-value",children:e.value})})]})),(0,i.jsx)(er.A,{className:"current_close",top:20,children:s("L0016813è¿æ¬¾éé¢å¯ç¨ä½é¢ææå¯ç¨ä½é¢å°",{0:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.debtAssetAmt)||"--",b)),1:(0,Q.LN)((0,Q.gO)((null==r?void 0:r.availableAssetAmt)||"--",b))})}),!f&&(0===d.length?(0,i.jsx)(lN.A,{type:"info",className:"alert-info",title:"".concat(s("L0017730å½åæ å
¶ä»å¯ç¨èµäº§"))}):(0,i.jsx)(aN.A,{onInsert:(e,t)=>{let n=[...d],l=n[e];n.splice(e,1),n.splice(t,0,l),c(n)},children:null==d?void 0:d.map(e=>(0,i.jsx)(aN.A.Item,{value:e.value,className:"position-sort-item",children:(0,i.jsx)(aO,{size:"large",value:e.value,appearance:"square",onCh
1ange:y,checked:e.checked,children:(0,i.jsxs)("div",{className:"position-item",children:[(0,i.jsx)("span",{className:"position-item-title",children:e.title}),e.available&&(0,i.jsx)(aR,{maxWidth:u,className:"position-item-available",children:(0,i.jsxs)(em.A,{children:[(0,Q.LN)((0,Q.gO)(e.available,b))," ",e.title]})})]})})},e.value))}))]})});var aM=n(25882);function az(){let e=(0,u._)(["\n padding: 0;\n "]);return az=function(){return e},e}function aF(){let e=(0,u._)(["\n border-radius: 20px 20px 0px 0px;\n\n .lbank-close-position {\n ","\n }\n\n .subTitle {\n color: ",";\n }\n .lbank-modal-body {\n }\n .current_close {\n color: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 20px;\n }\n\n .avail_close {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n\n &_title {\n color: ",";\n ",";\n }\n\n &_title_zero {\n color: ",";\n display: flex;\n align-items: center;\n\n svg {\n margin-left: 2px;\n color: ",";\n }\n ",";\n }\n\n &_info {\n color: ",";\n ",";\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-wrap: wrap;\n\n &-flag {\n color: ",";\n margin-right: 4px;\n }\n\n &-value {\n display: flex;\n align-items: center;\n text-align: right;\n\n svg {\n color: ",";\n font-size: 16px;\n }\n }\n }\n }\n\n .closeâasset {\n padding-top: 20px;\n color: ",";\n ",";\n\n .closeâasset-temp {\n display: flex;\n align-items: center;\n line-height: 20px;\n margin-bottom: 12px;\n\n .closeâasset-title-temp {\n color: ",";\n margin-right: 8px;\n }\n }\n\n &-title {\n margin-bottom: 8px;\n }\n\n .estimate-close-asset {\n margin-top: 4px;\n color: ",";\n display: flex;\n align-items: center;\n\n .estimate-close-title {\n margin-right: 4px;\n color: ",";\n }\n }\n }\n\n .position-sort-item {\n height: 60px;\n display: flex;\n align-items: center;\n color: ",";\n ",";\n background: ",";\n padding: 0;\n margin: 0 -24px;\n padding-left: 24px;\n }\n\n .lbk_dnd_drag_icon {\n right: 10px;\n svg {\n font-size: 20px;\n }\n }\n"]);return aF=function(){return e},e}let aD=(0,m.Ay)(n7.default)(aF(),f.XG.mobile((0,h.AH)(az())),V.vZ,V.vZ,V.vZ,e=>e.theme.bizTypography.r14,V.fG,V.fG,e=>e.theme.bizTypography.r14,V.vZ,e=>e.theme.bizTypography.r14,V.fG,V.vZ,V.vZ,e=>e.theme.bizTypography.r14,V.fG,V.vZ,V.fG,V.vZ,e=>e.theme.bizTypography.m14,V.zz),aU=(0,a.memo)(e=>{let{visible:t,onCancel:n,onOk:l,record:r,positionList:o}=e,{t:s}=(0,S.A)(),{isLogin:c}=(0,b.Z)(),{withClassPrefix:u}=(0,lv.A)("close-position"),[p,m]=(0,a.useState)(!0),{tradeType:h}=(0,nD.pI)(),[x,f]=(0,tX.A)(!1),[v]=aj.useForm(),g=aj.useWatch([],v),[y,A]=(0,a.useState)(),{getPayPwd:j,PayPwdElement:L}=(0,aM.L)(),C=(0,a.useMemo)(()=>{var e;return(null==y?void 0:null===(e=y.assetCode)||void 0===e?void 0:e.toLocaleLowerCase())==="usdt"},[null==y?void 0:y.assetCode]);(0,a.useEffect)(()=>{A(r)},[r]);let[{tradeAsset:w,tradePost:k}]=(0,d.d4)(e=>({tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost})),_=au()((0,tD.default)(async function(){let{paypwd:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{paypwd:""};if(null==r?void 0:r.assetCode)try{await f(eA.Ay.postLeverageTradeCenterPositionClose(+((null==r?void 0:r.assetAmt)||0)>0||!C&&0==+((null==r?void 0:r.assetAmt)||0)?{assetCode:r.assetCode,assetAmt:g.quantity,settleCurrency:g.closeAsset,type:1,paypwd:e}:{assetCode:r.assetCode,type:2,disposalAssetCodes:g.disposalAssetCodes,paypwd:e})),setTimeout(()=>{ts.A.success(s("L0001507平仿å"))}),null==l||l({assetCode:"BUY"===h?k:w}).finally(()=>{})}catch(e){console.error(e," trade close error"),(null==e?void 0:e.message)&&ts.A.error(e.message)}}),300),N=au()((0,tD.default)(async()=>{var e;0>
1=+((null==r?void 0:r.assetAmt)||0)&&(null==g?void 0:null===(e=g.disposalAssetCodes)||void 0===e?void 0:e[0])==="noList"?null==n||n():C?+((null==y?void 0:y.assetAmt)||0)>=0?_():j({},_):0==+((null==y?void 0:y.assetAmt)||0)?_():j({},_)})),T=(0,a.useCallback)(()=>{var e,t;m(+((null==r?void 0:r.assetAmt)||0)>=0?0==+((null==g?void 0:g.quantity)||0)||!(null==g?void 0:g.closeAsset)||!!v.getFieldsError().filter(e=>{let{errors:t}=e;return t.length}).length:(null==g?void 0:null===(e=g.disposalAssetCodes)||void 0===e?void 0:e[0])!=="noList"&&(null==g?void 0:null===(t=g.disposalAssetCodes)||void 0===t?void 0:t.length)===0)},[v,null==g?void 0:g.quantity,null==g?void 0:g.closeAsset,null==r?void 0:r.assetAmt,null==g?void 0:g.disposalAssetCodes]);return(0,a.useEffect)(()=>{T()},[null==g?void 0:g.closeAsset,null==g?void 0:g.disposalAssetCodes]),(0,i.jsxs)(i.Fragment,{children:[L,(0,i.jsx)(aD,{className:"closeages_settings_modal",closable:!0,title:s((C?+((null==y?void 0:y.assetAmt)||0)>=0:0==+((null==y?void 0:y.assetAmt)||0))?"L0016380è¿æ¬¾":"L0001061å¹³ä»"),destroyOnClose:!0,open:t,cancelButtonProps:{hidden:!0},okButtonProps:{loading:x,disabled:p},onCancel:n,okText:c?s("L0000060确认"):s("L0015469ç»å½åæ´æ¹"),onOk:N,children:(0,i.jsx)(aj,{form:v,layout:"vertical",className:u(),onFieldsChange:T,children:+((null==y?void 0:y.assetAmt)||0)>=0?(0,i.jsx)(a_,{form:v,record:y}):(0,i.jsx)(aj.Item,{name:am.disposalAssetCodes,className:"close_asset",children:(0,i.jsx)(aI,{form:v,record:y,positionList:o})})})})]})}),aB=(0,a.memo)(e=>{let{symbol:t}=e,{isLogin:n}=(0,b.Z)(),[l,r,a]=(0,tt.A)(aU),{loading:o,columns:s,positionList:d}=ad({symbol:t,openClose:e=>l({record:e,positionList:d,onCancel:a})});return r1({symbol:t,hideOther:!1}),(0,i.jsxs)(r6.Wv,{children:[n?(0,i.jsx)(iA,{rowKey:["assetCode","assetId"],rowHeight:60,bordered:!1,style:{minHeight:270},columns:s,data:d,loading:o,pagination:!1}):(0,i.jsx)(iu,{}),r()]})});function aq(){let e=(0,u._)(["\n height: 100%;\n "]);return aq=function(){return e},e}function aH(){let e=(0,u._)(["\n // order_tabs_container\n width: 100%;\n height: 493px;\n\n ","\n\n .futures-orders-tabs-toolbar {\n padding-right: ",";\n }\n .lbank-tabs-nav-middle {\n height: 44px !important;\n }\n"]);return aH=function(){return e},e}function aZ(){let e=(0,u._)(["\n --tabs-line-color: ",";\n"]);return aZ=function(){return e},e}let aG=(0,m.Ay)(c.A.OrderTabsContainer)(aH(),f.XG.mobile((0,h.AH)(aq())),e=>e.isMobile?"12px":"16px"),aW=(0,m.Ay)(tq.A)(aZ(),V._O),aV=(0,eb.A)(aW),aQ=e=>{let{symbol:t,serverTradeArea:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,b.Z)(),[{totalCurrentOrders:o,totalLeveragePositionCount:s}]=(0,d.d4)(e=>({totalCurrentOrders:e.exchangeState.totalCurrentLeverageOrders,totalLeveragePositionCount:e.exchangeState.totalLeveragePositionCount})),c=(0,a.useRef)(null),[u,p]=(0,a.useState)("order"),m=(0,a.useMemo)(()=>[{key:"order",label:(0,i.jsxs)(i.Fragment,{children:[l("L0000774å½åå§æ"),(0,i.jsxs)(r6.M_,{children:["(",(0,r0.h6)(r?o:0),")"]})]}),children:(0,i.jsx)(iN,{toolbarRef:c,symbol:t})},{key:"orderHistory",label:l("L0000775åå²å§æ"),children:(0,i.jsx)(iZ,{toolbarRef:c,symbol:t})},{key:"transactionHistory",label:l("L0003942æäº¤è®°å½"),children:(0,i.jsx)(iV,{toolbarRef:c,symbol:t})},{key:"spotAssets",label:l("L0003447èµäº§"),children:(0,i.jsx)(ai,{toolbarRef:c,symbol:t})},{key:"positionList",label:(0,i.jsxs)(i.Fragment,{children:[l("L0008270ä»ä½"),(0,i.jsxs)(r6.M_,{children:["(",(0,r0.h6)(r?s:0),")"]})]}),children:(0,i.jsx)(aB,{symbol:t})}],[t,l,o,s,r]),h=(0,a.useMemo)(()=>{var e;return(null==m?void 0:null===(e=m.map(e=>null==e?void 0:e.key))||void 0===e?void 0:e.includes(u))?u:"order"},[m,u]),{sm:x}=(0,f.Px)(),v=(0,eF.e1)();return(0,i.jsx)(aG,{id:"futures_order_tabs",isMobile:x,children:(0,i.jsx)(aV,{className:"order-tabs",containerPaddingInline:x?14:16,tabNavGap:20,showIndicator:!0,enableFastScroll:!0,borderPosition:"bottom",size:"middle",activeKey:h,onChange:e=>p(e),items:m,destroyInactiveTabPane:!0,animated:!1,addonTabBarAfter:(0,i.jsx)("span",{className:"futures-orders-tabs-toolbar",children:(0,i.jsx)(aa,{wrapperRef:c})}),showGuide:!0,guideConfig:v})})};var aY=n(6090),aK=n(56253);
1function a$(){let e=(0,u._)(["\n width: 20px;\n height: 20px;\n padding: 2px;\n margin-right: 16px;\n &.lbank-btn-sm {\n border-radius: 2px;\n }\n &.lbank-btn-sm > span {\n height: 20px;\n }\n .lbank-icon {\n font-size: 20px;\n }\n &.lbank-btn-secondary.lbank-btn-hovered:hover {\n background: ",";\n }\n &:active {\n background-color: ",";\n }\n"]);return a$=function(){return e},e}function aX(){let e=(0,u._)(["\n font-size: 20px;\n"]);return aX=function(){return e},e}let aJ=(0,m.Ay)(T.A)(a$(),V.sR,V._j),a0=(0,m.Ay)(aK.A)(aX());var a1=n(48694),a2=n(74418),a6=n(27456);let a4=e=>{let{memeCoinSymbol:t}=e,[n,l]=(0,a.useState)(!1),[r,i]=(0,a.useState)([]),o=(0,a.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];try{var n;e&&l(!0);let r=await eA.Ay.getSpotMarketCenterMemeCoinHolder({memeCoinSymbol:t});i((null==r?void 0:null===(n=r.slice(0,51))||void 0===n?void 0:n.map((e,t)=>({...e,rank:t+1})))||[])}catch(e){console.error(e)}finally{l(!1)}},[t]);return(0,a.useEffect)(()=>{o()},[t,o]),(0,a6.A)(()=>{o(!1)},3e4),{holderList:r,loading:n}};var a3=n(70053),a5=n(45572),a8=n.n(a5);function a7(){let e=(0,u._)(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n .lbank-icon {\n font-size: 20px;\n }\n"]);return a7=function(){return e},e}let a9=m.Ay.div(a7()),oe=(0,a.memo)(e=>{let{rank:t}=e;return 1===t?(0,i.jsx)(a9,{children:(0,i.jsx)(a3.A,{})}):2===t?(0,i.jsx)(a9,{children:(0,i.jsx)(a8(),{src:"/assets/memecoin/rank1.png",alt:"rank",width:32,height:32})}):3===t?(0,i.jsx)(a9,{children:(0,i.jsx)(a8(),{src:"/assets/memecoin/rank2.png",alt:"rank",width:32,height:32})}):4===t?(0,i.jsx)(a9,{children:(0,i.jsx)(a8(),{src:"/assets/memecoin/rank3.png",alt:"rank",width:32,height:32})}):(0,i.jsx)(a9,{children:(0,i.jsx)("div",{className:"text-primary",children:t-1})})});function ot(){let e=(0,u._)(["\n padding-top: 12px;\n height: 100%;\n flex: 1;\n min-height: 10px;\n .holder-list-table {\n height: 100%;\n max-height: 606px;\n overflow-y: scroll;\n min-height: 100%;\n }\n .holder-list-table.lbank-table-middle .lbank-table-row:first-child {\n position: ",";\n top: ","px;\n z-index: 2;\n td {\n background: ",";\n }\n }\n .holder-list-table.lbank-table-middle .lbank-table-row .lbank-table-cell-item {\n color: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n }\n .holder-list-table.lbank-table-middle .lbank-table-row .lbank-table-cell {\n padding: 0 12px !important;\n }\n\n .holder-list-table.lbank-table-middle .lbank-table-head-row .lbank-table-cell {\n padding: 8px 12px;\n }\n"]);return ot=function(){return e},e}function on(){let e=(0,u._)(["\n max-width: 150px;\n white-space: normal;\n text-align: left;\n"]);return on=function(){return e},e}function ol(){let e=(0,u._)(["\n width: auto;\n display: flex;\n padding: 2px 4px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n\n border-radius: 2px;\n border: 1px solid ",";\n\n color: ",";\n text-align: center;\n\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n"]);return ol=function(){return e},e}let or=m.Ay.div(ot(),e=>{let{firstRowHeight:t}=e;return t?"sticky":"relative"},e=>{let{firstRowHeight:t}=e;return t||0},V.fn,V.vZ),oi=m.Ay.div(on()),oa=m.Ay.div(ol(),V.CQ,V.CQ);var oo=n(51224);let os=e=>{var t;let{t:n}=(0,S.A)(),r=(0,_.A)(),{tradeWS:o}=(0,s.pP)(),[c,u]=(0,a.useState)(!1),p=(0,tZ.A)(e=>e.layoutType),m=(0,a.useMemo)(()=>{var t;return(null==e?void 0:e.symbol)||(null===(t=r.query)||void 0===t?void 0:t.id)||""},[null===(t=r.query)||void 0===t?void 0:t.id,null==e?void 0:e.symbol]),{assetItem:h}=(0,tL.A)(m,"spot"),{isLogin:x}=(0,b.Z)(),[f,v]=(0,a.useState)({}),{tradingType:y}=(0,g.Pj)(e=>({tradingType:e.tradingType})),[{postArea:A},j,L]=(0,d.d4)(e=>({postArea:e.postArea}));(0,aY.i0)(),(0,oo.A)();let{observeTradeAssetUpdate:C,observeTradeOrderUpdate:w,observeCurrentTradeTickUpdate:k,observeLeverageLoanRepaymentNotificationUpdate:N}=(0,X.A)({symbol:m}),{getAssetPairConfigInfo:T,getLatestPrice:E,getTradeOrderConfig:P,getRuleData:O,getMergeInfo:R,mergeShow:I,setMergeShow:M,getLeverageAccountStatus:z}=(0,tM.A)({currentSymbol:m}),F=(0,ei.default)(()=>{m&&(v({}),T({symbol:m}).catch(e=>{(null==e?void 0:e.code)===20294&&v(e)}).finally(()=>
1j({tradeLoading:!1})))});(0,a.useEffect)(()=>{F(),E()},[m]),(0,a.useEffect)(()=>{x&&z(!0)},[x]),(0,a.useEffect)(()=>{m&&O({symbol:m,isAutoRequest:!0}).catch(e=>{50301===e.code&&u(!0)})},[r.locale,m,x]),(0,a.useEffect)(()=>{void 0!==x&&!x&&l&&(l(),j({exchangeState:{usableBuyPost:"0.0000",usableSellAsset:"0.0000",totalCurrentOrders:0}}))},[x]),(0,a.useEffect)(()=>{let e=C(),t=w(),n=k();return()=>{e(),t(),n()}},[m]),(0,a.useEffect)(()=>{let e;return m&&(o.getTickerOne(m),e&&clearInterval(e),e=setInterval(()=>{v({}),T({symbol:m}).catch(e=>{null==e||e.code}).finally(()=>j({tradeLoading:!1}))},6e5)),()=>{clearInterval(e)}},[m,x]),(0,a.useEffect)(()=>{m&&(l=o.getAssetUpdateWS())},[m,o.getAssetUpdateWS]),(0,a.useEffect)(()=>{if(!m||y===eN.Nn.trade)return eg.lQ;let e=m.split("_").join(",");return o.getLeverageCurrencyHourlyRateWS(e)},[m,y,o.getLeverageCurrencyHourlyRateWS]),(0,a.useEffect)(()=>m&&y!==eN.Nn.trade?o.getLeverageOrderWS():eg.lQ,[m,y,o.getLeverageOrderWS]),(0,a.useEffect)(()=>m&&y!==eN.Nn.trade?o.getLeverageLoanStatusNotificationWS():eg.lQ,[m,y,o.getLeverageLoanStatusNotificationWS]),(0,a.useEffect)(()=>m&&y!==eN.Nn.trade?o.getLeveragePositionInfoWS():eg.lQ,[m,y,o.getLeveragePositionInfoWS]),lV(),(0,a.useEffect)(()=>{if(!m||y===eN.Nn.trade)return eg.lQ;let e=m.split("_"),t=N(t=>{if(null==t?void 0:t.data){let n=(null==t?void 0:t.data)||{},l=(null==t?void 0:t.data.pair)===e[0]?L().baseLoanCalc||{}:L().postLoanCalc||{},r=(null==t?void 0:t.data.pair)===e[0]?"baseLoanCalc":(null==t?void 0:t.data.pair)===e[1]?"postLoanCalc":"";r&&j({[r]:{...l,hourlyInterestRate:n.interest||l.hourlyInterestRate,availableQuantity:n.availableBalance||l.availableQuantity,borrowedQuantity:n.alreadyBorrowed||l.borrowedQuantity,maxBorrowQuantity:n.maxAlreadyBorrowed||l.maxBorrowQuantity,interestQuantity:n.interest||l.interestQuantity,maxOpenQuantity:n.availableOpen||l.maxOpenQuantity}})}});return()=>{t()}},[m,y]),(0,a.useEffect)(()=>{"ETF"===A&&x&&R()},[A,x]);let D=(0,a.useMemo)(()=>{if("ETF"!==A)return(0,i.jsx)("div",{id:"trade_title_spot",className:"left-0 right-[34px] [[data-dir='rtl']_&]:left-[34px] [[data-dir='rtl']_&]:right-0",style:{position:"absolute",top:2.8}})},[A,n]),{stBlocking:U}=(0,a1.A)({symbol:m});return{tradeModalTitle:D,memeLaunchTabProps:void 0,countryLimitShow:c,layoutType:p,currentSymbol:m,assetItem:h,error:f,postArea:A,tradingType:y,initData:F,getLatestPrice:E,getTradeOrderConfig:P,getRuleData:O,getMergeInfo:R,mergeShow:I,setMergeShow:M,getAssetPairConfigInfo:T,stBlocking:U}};var od=n(58533),oc=n(97308),ou=n(38443);let op={INITIAL_DELAY_TIME:3e3,REDUCED_DELAY_TIME:2e3,ST_BLOCKING_DEBOUNCE:500,HIDE_ORDERBOARD_STEPS:[0,3,4],SHOW_ORDERBOARD_STEPS:[1,2]},om=e=>{let{currentSymbol:t,stBlocking:n,error:l}=e,[r,i]=(0,a.useState)(op.INITIAL_DELAY_TIME),[o,s]=(0,a.useState)(!1),c=(0,en.A)(),u=(0,oc.A)(),{etfShowWarning:p}=rv(),[,m]=(0,d.d4)(),h=(0,a.useRef)(null),x=(0,a.useRef)(),f=(0,tU.A)(n,{wait:op.ST_BLOCKING_DEBOUNCE}),g=(0,a.useMemo)(()=>!!o&&!!u||!!(t&&!f&&!(null==l?void 0:l.message)&&!p&&u),[t,null==l?void 0:l.message,o,f,p,u]),b=(0,a.useMemo)(()=>"spot-".concat(c?"h5":"web","-").concat(u),[c,u]),y=(0,tU.A)(g,{wait:r});(0,a.useEffect)(()=>{var e;let t=null===(e=h.current)||void 0===e?void 0:e.getCurrent();f||p||0===t?m({showVipDefaultTooltip:!1}):m({showVipDefaultTooltip:!0})},[f,p,m]),(0,a.useEffect)(()=>{var e;let t=null===(e=h.current)||void 0===e?void 0:e.getCurrent();!f&&(!g||y&&Number(t||0)>0)&&(0,ou.jJ)("spot",{guide:2})},[f,g,y]);let A=(0,a.useCallback)(()=>{var e;x.current=()=>{var e;null===(e=h.current)||void 0===e||e.setCurrent(0)},null===(e=h.current)||void 0===e||e.setCurrent(0),s(!0)},[]);(0,a.useEffect)(()=>()=>i(op.REDUCED_DELAY_TIME),[t]),(0,a.useEffect)(()=>{let e=e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.type)==="show_guide"&&A()};return window.addEventListener("spotGuideEvent",e),()=>{window.removeEventListener("spotGuideEvent",e)}},[A]);let j=(0,a.useCallback)(e=>op.HIDE_ORDERBOARD_STEPS.includes(e)?"hide_h5_orderboard_model":op.SHOW_ORDERBOARD_STEPS.includes(e)?"show_h5_orderboard_model":null,[]);
1return{guideRef:h,guideOnStartRef:x,guideKey:b,debouncedCanShowNewUserGuide:y,setShowGuide:s,etfShowWarning:p,GuideHandle:()=>{let{current:e,total:t}=(0,v.Zl)(),n=(0,od.A)();return(0,a.useEffect)(()=>{let t=j(e);t&&n({type:t})},[e,t,n]),null}}};var oh=n(7276),ox=n.n(oh),of=n(71913),ov=n(46060),og=n(30476),ob=n(24265),oy=n(34061),oA=n(58225),oj=n(75773),oL=n(60990);let oC=e=>{let{symbol:t,hideOther:n,orderType:l}=e,[{orderUpdate:r},i]=(0,d.d4)(e=>({orderUpdate:e.orderUpdate})),{isLogin:o}=(0,b.Z)(),s=(0,ei.default)(async()=>{try{return await eA.Ay.getSpotTradeCenterV2OrderSummary({category:n?t:"all",__autoLogin:!0})}catch(e){return console.log("err :>> ",e),Promise.reject(e)}});(0,a.useEffect)(()=>{o&&s().then(e=>{i({exchangeState:{totalCurrentOrders:(null==e?void 0:e.totalCount)||0,totalCurrentLimitOrders:(null==e?void 0:e.limitCount)||0,totalCurrentProfitLossOrders:(null==e?void 0:e.profitLossCount)||0,totalCurrentOcoOrders:(null==e?void 0:e.ocoCount)||0}})})},[r,t,n,l,o])};var ow=n(5790);function ok(){let e=(0,u._)(["\n display: inline-flex !important;\n height: 100%;\n line-height: normal;\n align-items: center;\n"]);return ok=function(){return e},e}function o_(){let e=(0,u._)(["\n width: 20px;\n height: 20px;\n padding: 2px;\n &.lbank-btn-sm {\n border-radius: 2px;\n }\n &.lbank-btn-sm > span {\n height: 20px;\n }\n .lbank-icon {\n font-size: 20px;\n }\n &.lbank-btn-secondary.lbank-btn-hovered:hover {\n background: ",";\n }\n &:active {\n background-color: ",";\n }\n"]);return o_=function(){return e},e}let oN=(0,m.Ay)(eP.A)(ok()),oT=(0,m.Ay)(T.A)(o_(),V.sR,V._j),oS=(0,a.memo)(e=>{let{from:t}=e,{t:n}=(0,S.A)(),{isLogin:l}=(0,b.Z)(),r=(0,r3.A)(),o=(0,a.useMemo)(()=>l?"/wallet/orders/exchange/".concat(t):r,[l,r,t]);return(0,i.jsx)(oN,{href:"".concat(o),passHref:!0,prefetch:!1,target:l?"_blank":"",rel:"noreferrer",microEntrance:!0,children:(0,i.jsx)(ep.A,{title:n("L0013324订åä¸å¿"),autoAdjustOverflow:!0,placement:"topRight",children:(0,i.jsx)(oT,{size:"small",shape:"square",type:"text",prefixIcon:(0,i.jsx)(r4.A,{})})})})}),oE=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,containerRef:l}=e,{t:r}=(0,S.A)(),{isLogin:o}=(0,b.Z)(),{sm:s}=(0,f.Px)(),[d,c]=(0,a.useState)(!1);return((0,a.useLayoutEffect)(()=>{l.current&&c(!0)},[l]),(0,a.useEffect)(()=>{if(l.current){c(!0);return}let e=setTimeout(()=>{l.current&&c(!0)},0);return()=>{clearTimeout(e)}},[l]),d&&l.current)?tK().createPortal((0,i.jsxs)(ir,{children:[s||!o?null:(0,i.jsx)(ig.cO,{size:"small",disabled:!o,appearance:"square",checked:t,onChange:(e,t)=>
1{n(t)},children:r("L0010791ä»
æ¾ç¤ºå½å")}),o&&(0,i.jsx)("div",{className:s?"":"line",children:(0,i.jsx)(oS,{from:"open-order"})})]}),l.current):null});var oP=n(11794);let oO=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,availableList:l,removeMoreOrders:r,removeLoading:a}=e,{t:o}=(0,S.A)(),{isLogin:s}=(0,b.Z)();return(0,i.jsxs)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:[(0,i.jsx)(ig.cO,{size:"small",disabled:!s,appearance:"square",checked:t,onChange:(e,t)=>{n(t)},children:o("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(T.A,{disabled:!(null==l?void 0:l.length),size:"small",loading:a,onClick:r,children:o("L0000968å
¨é¨æ¤å")})]})});var oR=n(3171);let oI=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{isLogin:l}=(0,b.Z)(),{symbolConfig:r}=(0,tL.A)(),o=(0,et.F)(r),[s,c]=(0,a.useState)(!1),[u,p]=(0,a.useState)(tc.MF.LIMIT),[{totalCurrentLimitOrders:m,totalCurrentProfitLossOrders:h,totalCurrentOcoOrders:x}]=(0,d.d4)(e=>({totalCurrentLimitOrders:e.exchangeState.totalCurrentLimitOrders,totalCurrentProfitLossOrders:e.exchangeState.totalCurrentProfitLossOrders,totalCurrentOcoOrders:e.exchangeState.totalCurrentOcoOrders})),[v,g]=(0,tt.A)(oR.A);oC({symbol:t,hideOther:s,orderType:u});let{loading:y,columns:A,ordersList:j,orderItem:L,open:C,setOpen:w,removeMoreOrders:k,removeLoading:_,error:N,refetch:T}=(0,oL.A)({symbol:t,hideOther:s,orderType:u,from:"trade",onEdit:e=>{var t,n,l;v({record:e,tradeType:(null===(t=e.side||"")||void 0===t?void 0:t.includes("buy"))?eN.Gr.buy:eN.Gr.sell,tradeWay:e.type,postArea:(null===(l=o.current)||void 0===l?void 0:null===(n=l[e.symbol])||void 0===n?void 0:n.areaCode)||"",tradingType:eN.Nn.trade})}}),{sm:S}=(0,f.Px)();return(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),currentTradingPair:s,tabName:"openOrders"})},[s]),(0,i.jsxs)(ig.Wv,{children:[(0,i.jsx)(oE,{containerRef:n,hideOther:s,setHideOther:c}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rJ.A,{bottomBorder:!1,children:(0,i.jsx)(im,{value:u,counts:{[tc.MF.LIMIT]:(0,r0.h6)(m),[tc.MF.PROFITLOSS]:(0,r0.h6)(h),[tc.MF.OCO]:(0,r0.h6)(x)},onChange:e=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2385.click.Click",clickName:"orderTypeClick",pageName:(0,ow.b)(),orderType:"profitLoss"===e?"trigger":e,tradeManner:"profitLoss"===e?"trigger":e}),p(e)}})}),S?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:36,children:(0,i.jsx)(oO,{hideOther:s,setHideOther:c,availableList:j,removeMoreOrders:k,removeLoading:_})}):null,(0,i.jsx)(iA,{rowKey:["uuid","side","type"],rowHeight:60,bordered:!1,shouldResponsive:!0,columns:A,data:j,loading:y,error:N,onRetry:T,pagination:!1,footer:j.length?(0,i.jsx)(ar,{from:"open-order"}):null}),(0,i.jsx)(oP.A,{data:L,open:C,setOpen:w}),g()]}):(0,i.jsx)(iu,{})]})});var oM=n(23945),oz=n(52837);let oF=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideOtherSymbol:l,setHideOtherSymbol:r,containerRef:a,orderSortTime:o,setOrderSortTime:s}=e,{t:d}=(0,S.A)(),{isLogin:c}=(0,b.Z)(),{sm:u}=(0,f.Px)();return a.current?tK().createPortal((0,i.jsxs)(ir,{children:[u||!c?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"line-right",children:(0,i.jsx)(ig.zg,{bordered:!1,disabled:!c,noPadding:!0,showSelected:!1,orderSortTime:o,setOrderSortTime:s})}),(0,i.jsx)(ig.cO,{size:"small",disabled:!c,appearance:"square",checked:l,onChange:(e,t)=>
1{null==r||r(t)},children:d("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(ig.cO,{size:"small",disabled:!c,appearance:"square",checked:t,onChange:(e,t)=>n(t),children:d("L0010566éèå·²æ¤é")})]}),c&&(0,i.jsx)("div",{className:u?"":"line",children:(0,i.jsx)(oS,{from:"order-history"})})]}),a.current):null}),oD=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideOtherSymbol:l,setHideOtherSymbol:r,orderSortTime:a,setOrderSortTime:o}=e,{t:s}=(0,S.A)(),{isLogin:d}=(0,b.Z)();return(0,i.jsxs)(ig.gw,{children:[(0,i.jsx)("div",{className:"line-right",children:(0,i.jsx)(ig.eT,{children:(0,i.jsx)(ig.zg,{bordered:!1,disabled:!d,showSelected:!1,noPadding:!0,orderSortTime:a,setOrderSortTime:o})})}),(0,i.jsxs)(ig.LL,{children:[(0,i.jsx)(ig.cO,{size:"small",disabled:!d,appearance:"square",checked:l,onChange:(e,t)=>{null==r||r(t)},children:s("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(ig.cO,{size:"small",disabled:!d,appearance:"square",checked:t,onChange:(e,t)=>n(t),children:s("L0010566éèå·²æ¤é")})]})]})}),oU=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{isLogin:l}=(0,b.Z)(),{getCachedOrderSort:r,setCachedOrderSort:o}=(0,oz.A)(),[s,d,c]=iU(),[u,p]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),[x,v]=(0,a.useState)(tc.MF.LIMIT),[g,y]=(0,a.useState)(()=>r());
1oC({symbol:t,hideOther:!1}),(0,a.useEffect)(()=>{if(null==c?void 0:c.current){let e=Math.round((Number(null==s?void 0:s[1])-Number(null==s?void 0:s[0]))/864e5)+1;(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2452.click.Click",clickName:"dateRangeClick",pageName:(0,ow.b)(),tabName:"orderHistory",dateRange:e})}},[s]);let{loading:A,columns:j,ordersList:L,orderItem:C,open:w,setOpen:k,error:_,refetch:N}=(0,oM.A)({symbol:t,hideOther:u,hideOtherSymbol:m,placeType:x,orderSortTime:g,timeRange:s,paginationOptions:{defaultPageSize:20,defaultPageNo:1}}),{sm:T}=(0,f.Px)(),S=e=>{y(e),o(e)};return(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2453.click.Click",clickName:"filterClick",pageName:(0,ow.b)(),sortType:{order_time:"byOrderType",update_time:"byUpdateTime"}[g],tabName:"orderHistory"})},[g]),(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),tabName:"orderHistory",hideCanceledOrders:u})},[u]),(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),currentTradingPair:m,tabName:"orderHistory"})},[m]),(0,i.jsxs)(ig.Wv,{children:[(0,i.jsx)(oF,{containerRef:n,hideOther:u,setHideOther:p,hideOtherSymbol:m,setHideOtherSymbol:h,orderSortTime:g,setOrderSortTime:S}),l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rJ.A,{bottomBorder:!1,children:(0,i.jsxs)("div",{className:"w-full flex items-center ".concat(T?"justify-between":""),children:[(0,i.jsx)(im,{value:x,onChange:e=>{var t,n;let l={profitLoss:"trigger",limit:"limit|market"};(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2385.click.Click",clickName:"orderTypeClick",pageName:(0,ow.b)(),orderType:null!==(t=l[e])&&void 0!==t?t:e,tradeManner:null!==(n=l[e])&&void 0!==n?n:e}),v(e)},showMarketLabel:!0}),T?null:(0,i.jsx)(tQ.A,{width:1,height:16,left:8,right:8,style:{backgroundColor:"var(--line-2)",marginRight:"8px !important"}}),d()]})}),T?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:36,children:(0,i.jsx)(oD,{hideOther:u,setHideOther:p,orderSortTime:g,setOrderSortTime:S,hideOtherSymbol:m,setHideOtherSymbol:h})}):null,(0,i.jsx)(iA,{rowKey:["uuid","side","type"],rowHeight:60,bordered:!1,style:{minHeight:270},shouldResponsive:!0,columns:j,data:L,loading:A,error:_,onRetry:N,pagination:!1,footer:L.length?(0,i.jsx)(ar,{from:"order-history"}):null}),(0,i.jsx)(oP.A,{data:C,open:w,setOpen:k})]}):(0,i.jsx)(iu,{})]})});var oB=n(57067);let oq=(0,a.memo)(e=>{let{containerRef:t,hideOther:n,setHideOther:l,isMaker:r}=e,{t:a}=(0,S.A)(),{isLogin:o}=(0,b.Z)(),{sm:s}=(0,f.Px)();return t.current?tK().createPortal((0,i.jsxs)(ir,{children:[s||r||!o?null:(0,i.jsx)(ig.cO,{size:"small",disabled:!o,appearance:"square",checked:n,onChange:(e,t)=>
1{l(t)},children:a("L0010791ä»
æ¾ç¤ºå½å")}),o&&(0,i.jsx)("div",{className:s?"":"line",children:(0,i.jsx)(oS,{from:"trade-history"})})]}),t.current):null}),oH=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,b.Z)();return(0,i.jsx)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:(0,i.jsx)(ig.cO,{size:"small",disabled:!r,appearance:"square",checked:t,onChange:(e,t)=>{n(t)},children:l("L0010791ä»
æ¾ç¤ºå½å")})})}),oZ=(0,a.memo)(e=>{let{symbol:t,isMaker:n,toolbarRef:l}=e,{isLogin:r}=(0,w.A)(),{sm:o}=(0,f.Px)(),[s,d]=(0,a.useState)(!1),[c,u,p]=iU(),{loading:m,columns:h,tradeList:x,error:v,refetch:g}=(0,oB.A)({symbol:t,hideOther:!!n||s,timeRange:c});return oC({symbol:t,hideOther:!1,orderType:tc.MF.LIMIT}),(0,a.useEffect)(()=>{if(null==p?void 0:p.current){let e=Math.round((Number(null==c?void 0:c[1])-Number(null==c?void 0:c[0]))/864e5)+1;(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2452.click.Click",clickName:"dateRangeClick",pageName:(0,ow.b)(),tabName:"transactionHistory",dateRange:e})}},[c]),(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),tabName:"transactionHistory",currentTradingPair:s})},[s]),(0,i.jsxs)(ig.Wv,{children:[(0,i.jsx)(oq,{containerRef:l,hideOther:s,setHideOther:d,isMaker:n}),r?(0,i.jsxs)(i.Fragment,{children:[!o&&(0,i.jsx)(rJ.A,{bottomBorder:!1,children:u()}),o&&!n?(0,i.jsxs)(rJ.A,{bottomBorder:!1,height:44,children:[(0,i.jsx)(oH,{hideOther:s,setHideOther:d}),u()]}):null,(0,i.jsx)(iA,{rowKey:["orderUuid","txUuid"],rowHeight:60,bordered:!1,style:{minHeight:270},columns:h,data:x,loading:m,error:v,onRetry:g,pagination:!1,footer:x.length?(0,i.jsx)(ar,{from:"trade-history"}):null})]}):(0,i.jsx)(iu,{})]})}),oG=e=>{let{symbol:t,shelfStatus:n="ON",hideOther:l,hideSmallAmount:r}=e,{t:o}=(0,S.A)(),{isLogin:s}=(0,w.A)(),c=(0,en.A)(),[u,p]=(0,tX.A)(!0),[m,h]=(0,a.useState)([]),[x,f]=(0,a.useState)(null),{loading:v}=(0,tL.A)(t,"spot"),[{exchangeState:g,assetUpdate:b}]=(0,d.d4)(e=>({exchangeState:e.exchangeState,assetUpdate:e.assetUpdate})),{lgtSymbol:y,rate:A}=(0,eh.A)(),{renderModal:j,openModal:L}=(0,iY.Ay)({pageName:iK.fR.SPOT_TRADING}),C=(0,a.useCallback)(e=>{e&&L(e)},[]),k=(0,a.useMemo)(()=>{var e,t;return{tradeAsset:null===(e=g.tradeAsset)||void 0===e?void 0:e.toLowerCase(),tradePost:null===(t=g.tradePost)||void 0===t?void 0:t.toLowerCase()}},[g.tradeAsset,g.tradePost]),_=(0,a.useCallback)(e=>{var t;let n=null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase();return n===k.tradeAsset?0:n===k.tradePost?1:2},[k]),N=(0,a.useCallback)(e=>e.filter(e=>{var t,n;let l=(null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase())===k.tradeAsset||(null===(n=e.assetCode)||void 0===n?void 0:n.toLowerCase())===k.tradePost,r=new q.A(e.toUsd||0);return l||r.gt(0)}),[k]),T=(0,a.useCallback)(e=>e.filter(e=>{var t,n;let l=(null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase())===k.tradeAsset||(null===(n=e.assetCode)||void 0===n?void 0:n.toLowerCase())===k.tradePost,r=new q.A(e.toUsd||0).gte(1);return l||r}),[k]),E=(0,a.useCallback)((e,t)=>{let n=new Map;return t.forEach(e=>{e.assetCode&&n.set(e.assetCode.toLowerCase(),e)}),e.map(e=>{var t;let l=null===(t=e.assetCode)||void 0===t?void 0:t.toLowerCase(),r=l?n.get(l):void 0;return{...e,...r&&{spotEarnApr:r.apr,spotEarnHasParticipate:r.hasParticipate,spotEarnMinAmt:r.minAmt,spotEarnProductId:r.productId}}})},[]),P=(0,a.useCallback)(async()=>{if(!v&&s&&"--"!==g.tradeAsset&&"--"!==g.tradePost)try{let[e,t]=await p(Promise.all([eA.Ay.coinWalletCenterCustomerAssetCondition({assetCodes:l?[g.tradeAsset,g.tradePost].join(","):void 0,shelfStatus:n,needSwitch:"true",isHolding:"false"}),eA.Ay.financeEarnCenterFinanceDrainageSpotEarn({})])),r=E(e||[],t.spotEarnDTOList||[]),i=N(r).sort((e,t)=>_(e)-_(t));h(i),f(null)}catch(e){f(e)}},[v,s,g.tradeAsset,g.tradePost,l,n,p,N,_,E]),O=(0,a.useCallback)((e,t,n)=>{if(!e||!t||!n||0===Number(t))return"--";try{let l=(0,q.A)(+e).div(+t).times(+n).toFixed();return y+(0,Q.al)((0,Q.w1)(l,4),A)}catch(e){return"--"}},[y,A]),R=(0,ei.default)(e=>{let{buttonName:t}=e;(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2468.click.Click",clickName:"buttonClick",pageName:(0,ow.b)(),tabName:"assets",buttonName:t})}),I=(0,a.useMemo)(()=>[{key:"assetCode",title:o("L0003447èµäº§"),align:"left",fixed:"left",excludedField:!0,render:(e,t)=>(0,i.jsxs)(er.A,{size:4,inline:!0,children:[(0,i.jsx)(i2.A,{showHover:!1,type:"coin",category:null==t?void 0:t.assetCode,fontSize:12,showArrow:!1,enableClick:!1}),(0,i.jsx)(i5,{record:t,onClick:()=>c&&C(t.spotEarnProductId),enableClick:c})]})},{key:"usableAmt",title:o("L0000149å¯ç¨"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.usableAmt?(0,Q.w1)(t.usableAmt,4):"--"}),(0,i.jsx)("span",{className:"fiatValue",children:O(t.usableAmt,t.assetAmt,t.toUsd)})]})},{key:"assetAmt",title:o("L0000926æ»é¢"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.assetAmt?(0,Q.w1)(t.assetAmt,4):"--"}),(0,i.jsx)("span",{className:"fiatValue",children:t.toUsd?y+(0,Q.al)((0,Q.w1)(t.toUsd,4),A):"--"})]})},{key:"freezeAmt",title:o("L0011616å»ç»"),align:"left",render:(e,t)=>(0,i.jsxs)(iQ.A,{direction:"vertical",size:2,children:[(0,i.jsx)("span",{children:t.freezeAmt?(0,Q.w1)(t.freezeAmt,4):"--"}),(0,i.jsx)("span",{className:"fiatValue",children:O(t.freezeAmt,t.assetAmt,t.toUsd)})]})},{key:"action",title:o("L0002044æä½"),align:"right",width:290,excludedField:!0,render:(e,t)=>(0,i.jsx)(i1,{record:t,handleOpenSpotEarnModal:C,sensorActionClick:R})},{key:"assetHeader",title:o("L0003447èµäº§"),align:"left",fixed:"left",hidden:!0,isHeader:!0,render:(e,t)=>(0,i.jsx)(eC.default,{type:"coin",symbol:null==t?void 0:t.assetCode,fontSize:12,showLogo:!1,showArrow:!1,customIdentifier:(0,i.jsx)(i5,{record:t,onClick:()=>C(t.spotEarnProductId)})})},{key:"actionFooter",title:o("L0002044æä½"),align:"right",hidden:!0,isFooter:!0,render:(e,t)=>(0,i.jsx)(ig.fn,{children:(0,i.jsx)(i1,{record:t,block:!0,sensorActionClick:R})})}],[o,c,C,O,y,A,R]),M=(0,a.useMemo)(()=>r?T(m).sort((e,t)=>
1_(e)-_(t)).slice(0,20):m.slice(0,20),[m,r,T,_]);return(0,a.useEffect)(()=>{let e=setTimeout(()=>{P()},150);return()=>clearTimeout(e)},[P,b]),{loading:u,columns:I,renderSpotEarnModal:j,assetCondition:M,error:x,refetch:P,assetConditionMap:(0,a.useMemo)(()=>(M||[]).reduce((e,t)=>(t.assetCode&&(e[t.assetCode.toLowerCase()]=t),e),{}),[M]),fetch:P}},oW=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideSmallAmount:l,setHideSmallAmount:r,containerRef:a}=e,{t:o}=(0,S.A)(),{isLogin:s}=(0,b.Z)(),{sm:d}=(0,f.Px)();return a.current?tK().createPortal((0,i.jsx)(ir,{children:d||!s?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ig.cO,{size:"small",disabled:!s,appearance:"square",checked:t,onChange:(e,t)=>{n(t)},children:o("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(ig.cO,{size:"small",disabled:!s,appearance:"square",checked:!!l,onChange:(e,t)=>{null==r||r(t)},children:(0,i.jsx)(nH.A,{title:o("L0017473éèä»·å¼1USDçèµäº§"),action:"hover",zIndex:9999,className:"tooltip-text",children:o("L0000284éèå°é¢èµäº§")})})]})}),a.current):null}),oV=(0,a.memo)(e=>{let{hideOther:t,setHideOther:n,hideSmallAmount:l,setHideSmallAmount:r}=e,{t:a}=(0,S.A)(),{isLogin:o}=(0,b.Z)();return(0,i.jsx)(nY.A,{block:!0,align:"center",style:{justifyContent:"space-between"},children:(0,i.jsxs)(er.A,{size:16,align:"center",inline:!0,children:[(0,i.jsx)(ig.cO,{size:"small",disabled:!o,appearance:"square",checked:t,onChange:(e,t)=>
1{n(t)},children:a("L0010791ä»
æ¾ç¤ºå½å")}),(0,i.jsx)(ig.cO,{size:"small",disabled:!o,appearance:"square",checked:!!l,onChange:(e,t)=>{null==r||r(t)},children:(0,i.jsx)(nH.A,{title:a("L0017473éèä»·å¼1USDçèµäº§"),action:"click",zIndex:9999,children:a("L0000284éèå°é¢èµäº§")})})]})})}),oQ=(0,a.memo)(e=>{let{symbol:t,toolbarRef:n}=e,{t:l}=(0,S.A)(),{isLogin:r}=(0,w.A)(),o=(0,en.A)(),[s,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),{loading:p,columns:m,assetCondition:h,renderSpotEarnModal:x,error:f,refetch:v}=oG({symbol:t,shelfStatus:"ON",hideOther:s,hideSmallAmount:c});return oC({symbol:t,hideOther:!1,orderType:tc.MF.LIMIT}),(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),tabName:"assets",currentTradingPair:s})},[s]),(0,a.useEffect)(()=>{(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2424.click.Click",clickName:"checkboxClick",pageName:(0,ow.b)(),tabName:"assets",hideSmallAssets:c})},[c]),(0,i.jsxs)(ig.Wv,{children:[(0,i.jsx)(oW,{containerRef:n,hideOther:s,setHideOther:d,hideSmallAmount:c,setHideSmallAmount:u}),r?(0,i.jsxs)(i.Fragment,{children:[x(),o?(0,i.jsx)(rJ.A,{bottomBorder:!1,height:44,children:(0,i.jsx)(oV,{hideOther:s,setHideOther:d,hideSmallAmount:c,setHideSmallAmount:u})}):null,(0,i.jsx)(iA,{rowKey:"assetCode",rowHeight:60,style:{minHeight:270},shouldResponsive:!0,bordered:!1,columns:m,data:h,loading:p,error:f,onRetry:v,pagination:!1,footer:h.length?(0,i.jsx)(ar,{from:"spot-assets",url:"/wallet/currency",text:l("L0003548ç°è´§è´¦æ·")}):null})]}):(0,i.jsx)(iu,{})]})}),oY=e=>{let{symbol:t,pageNo:n="1",pageSize:l="20"}=e,{t:r}=(0,S.A)(),o=(0,_.A)(),[s,d]=(0,tX.A)(!0),[c,u]=(0,a.useState)(0),[p,m]=(0,a.useState)([]),[h,x]=(0,a.useState)(null),{symbolConfig:f}=(0,tL.A)(t,"spot"),v=(0,a.useMemo)(()=>[{key:"orderHeader",dataIndex:"symbol",title:r("L0003494交æå¯¹"),align:"left",hidden:!0,isHeader:!0,render:(e,t)=>(0,i.jsx)(i2.A,{category:null==t?void 0:t.symbol,fontSize:16})},{key:"symbol",dataIndex:"symbol",title:r("L0003494交æå¯¹"),align:"left",fixed:"left",excludedField:!0,render:(e,t)=>(0,i.jsx)(i2.A,{category:null==t?void 0:t.symbol})},{key:"mergeTime",dataIndex:"mergeTime",title:r("L0003481å§ææ¶é´"),align:"left",render:(e,t)=>(null==t?void 0:t.mergeTime)?(0,Q.lf)(t.mergeTime,"YYYY/MM/DD HH:mm:ss"):"--"},{key:"beforePrice",dataIndex:"beforePrice",title:r("L0006852åå¹¶åä»·æ ¼"),align:"left",render:(e,t)=>{let{postUpcase:n}=(0,r0.Nn)(f,null==t?void 0:t.symbol);return(null==t?void 0:t.beforePrice)?"".concat((0,Q.LN)(t.beforePrice)," ").concat(n):"--"}},{key:"newPrice",dataIndex:"newPrice",title:r("L0006853åå¹¶åä»·æ ¼"),align:"left",render:(e,t)=>{let{postUpcase:n}=(0,r0.Nn)(f,null==t?void 0:t.symbol);return(null==t?void 0:t.newPrice)?"".concat((0,Q.LN)(t.newPrice)," ").concat(n):"--"}},{key:"beforeNum",dataIndex:"beforeNum",title:r("L0006854åå¹¶åæä»"),align:"left",render:(e,t)=>{let{assetUpcase:n}=(0,r0.Nn)(f,null==t?void 0:t.symbol);return(null==t?void 0:t.beforeNum)?"".concat((0,Q.LN)(t.beforeNum)," ").concat(n):"--"}},{key:"newNum",dataIndex:"newNum",title:r("L0006855åå¹¶åæä»"),align:"left",render:(e,t)=>{let{assetUpcase:n}=(0,r0.Nn)(f,null==t?void 0:t.symbol);return(null==t?void 0:t.newNum)?"".concat((0,Q.LN)(t.newNum)," ").concat(n):"--"}},{key:"multiple",dataIndex:"multiple",title:r("L0006826åå¹¶åæ°"),align:"left",render:(e,t)=>(null==t?void 0:t.multiple)?"".concat(t.multiple," ").concat(r("L0006846å")):"--"}],[r,f,o.asPath]),g=(0,a.useCallback)(()=>{d(eA.Ay.getSpotTradeCenterEtfMergeRecordPage({pageNo:n,pageSize:l})).then(e=>{m((null==e?void 0:e.resultList)||[]),u((null==e?void 0:e.totalCount)||0),x(null)}).catch(e=>{console.log("err :>> ",e),x(e)})},[n,l,d]);return(0,a.useEffect)(()=>{g()},[g]),{list:p,columns:v,loading:s,total:c,error:h,refetch:g}},oK=e=>{let{symbol:t}=e,{t:n}=(0,S.A)(),l=(0,t4.A)(),{isLogin:r}=(0,b.Z)(),[o,s]=(0,a.useState)(1),[d,c]=(0,a.useState)(20),{list:u,columns:p,loading:m,total:h,error:x,refetch:f}=oY({symbol:t,pageNo:String(o),pageSize:String(d)}),v=(0,a.useMemo)(()=>(0,r0.$g)(p,l),[p,l,n]);
1return oC({symbol:t,hideOther:!1,orderType:tc.MF.LIMIT}),(0,i.jsx)(ig.Wv,{children:r?(0,i.jsx)(iA,{rowKey:["symbol","side"],rowHeight:60,style:{minHeight:300},columns:v,data:u,loading:m,error:x,onRetry:f,pagination:{current:o,hideOnSinglePage:!1,pageSize:d,showQuickJumper:!0,showSizeChanger:!1,total:h,onChange:(e,t)=>{s(e),c(t)}}}):(0,i.jsx)(iu,{})})};function o$(){let e=(0,u._)(["\n height: 100%;\n min-height: 648px;\n "]);return o$=function(){return e},e}function oX(){let e=(0,u._)(["\n // order_tabs_container\n width: 100%;\n height: 493px;\n\n ","\n\n > .lbk_guide_step_hl_wrapper {\n display: flex;\n flex: 1;\n min-height: 0;\n flex-direction: column;\n }\n\n .futures-orders-tabs-toolbar {\n padding-right: ",";\n }\n .lbank-tabs-nav-middle {\n height: 44px !important;\n }\n"]);return oX=function(){return e},e}function oJ(){let e=(0,u._)(["\n --tabs-line-color: ",";\n"]);return oJ=function(){return e},e}let o0=ox()(()=>Promise.all([n.e(8909),n.e(3946),n.e(5463),n.e(1909)]).then(n.bind(n,11909)),{loadableGenerated:{webpack:()=>[11909]},ssr:!1,loading:()=>(0,i.jsx)(ov.A,{className:"min-h-[420px]"})}),o1=(0,m.Ay)(c.A.OrderTabsContainer)(oX(),f.XG.mobile((0,h.AH)(o$())),e=>e.isMobile?"12px":"16px"),o2=(0,m.Ay)(tq.A)(oJ(),V._O),o6=(0,eb.A)(o2),o4=e=>{let{symbol:t,serverTradeArea:l}=e,{t:r}=(0,S.A)(),{isLogin:o}=(0,w.A)(),s=function(e){let{store:t}=(0,nT.m)(),{revision:n,runningCount:l,setRunningCount:r}=(0,nT.xA)((0,ob.k)(e=>({revision:e.plansRevision,runningCount:e.runningCount,setRunningCount:e.setRunningCount}))),i=(0,oj.i)((0,a.useCallback)(async e=>{var n;return{store:t,runningCount:null!==(n=(await oy.A.getLbkTradingbotGatewaySpotApiV1DcaRunningCount({},void 0,{signal:e})).runningCount)&&void 0!==n?n:0}},[t]));return(0,a.useEffect)(()=>{var e;"success"===i.status&&(null===(e=i.data)||void 0===e?void 0:e.store)===t&&r(i.data.runningCount)},[i.data,i.status,r,t]),(0,a.useEffect)(()=>{if(!e){i.cancel(),r(0);return}return i.run().catch(e=>{(0,oA.y)(e)||console.error("Failed to fetch Spot DCA running count",e)}),i.cancel},[e,i.cancel,i.run,n,r,t]),l}(o),c=r("L6668791宿"),[{tradeArea:u,totalCurrentOrders:p,isMaker:m}]=(0,d.d4)(e=>({tradeArea:e.postArea,totalCurrentOrders:e.exchangeState.totalCurrentOrders,isMaker:e.isMaker})),h=(0,L.A)(),x=(0,a.useMemo)(()=>(u||l||"").toUpperCase(),[l,u]),v=(0,a.useRef)(null),[g,b]=(0,a.useState)(null),y=(0,a.useCallback)(e=>{v.current=e,b(e)},[]),[A,j]=(0,a.useState)("order");(0,a.useEffect)(()=>(0,l2.Xi)(()=>{var e;j("spotDca"),null===(e=document.getElementById("futures_order_tabs"))||void 0===e||e.scrollIntoView({block:"nearest"})}),[]),(0,a.useEffect)(()=>((0,l2.vH)("spotDca"===A),()=>(0,l2.vH)(!1)),[A]),(0,a.useEffect)(()=>{"spotDca"!==A&&(0,og.rB)({requirement_id:439,track_sign:"aspot.b2378.d2381.click.Click",clickName:"tabClick",pageName:n.g.location.href.includes("futures")?"futures":"spot",tabName:{order:"openOrders",orderHistory:"orderHistory",transactionHistory:"transactionHistory",spotAssets:"assets",etfMerge:"etfMerge"}[A]})},[A]);let C=(0,eF.e1)(),k=(0,a.useMemo)(()=>[{key:"order",label:(0,i.jsxs)(i.Fragment,{children:[r("L0000774å½åå§æ"),(0,i.jsxs)(ig.M_,{children:["(",(0,r0.h6)(p),")"]})]}),children:(0,i.jsx)(oI,{toolbarRef:v,symbol:t})},{key:"orderHistory",label:r("L0000775åå²å§æ"),children:(0,i.jsx)(oU,{toolbarRef:v,symbol:t})},{key:"transactionHistory",label:r("L0003942æäº¤è®°å½"),children:(0,i.jsx)(oZ,{toolbarRef:v,symbol:t,isMaker:!!m})},...h?[]:[{key:"spotAssets",label:r("L0003447èµäº§"),children:(0,i.jsx)(oQ,{symbol:t,toolbarRef:v})}],..."ETF"===x?[{key:"etfMerge",label:(0,i.jsxs)(nY.A,{size:6,align:"center",children:[r("L0006818åå¹¶è®°å½"),(0,i.jsx)(ep.A,{placement:"topLeft",title:r("L0006819å½å¸ä»·ç²¾åº¦è¿ä½æ¶å°ä¼å¯¼è´äº¤ææ»"),children:(0,i.jsx)(of.A,{})})]}),children:(0,i.jsx)(oK,{symbol:t})}]:[],...m||h?[]:[{key:"spotDca",label:(0,i.jsxs)(i.Fragment,{children:[c,(0,i.jsxs)(ig.M_,{children:["(",(0,r0.h6)(s),")"]})]}),children:(0,i.jsx)(o0,{toolbarContainer:g})}]],[t,r,p,x,m,h,c,s,g]),_=(0,a.useMemo)(()=>{var e;return(null==k?void 0:null===(e=k.map(e=>null==e?void 0:e.key))||void 0===e?void 0:e.includes(A))?A:"order"},[k,A]),{sm:N}=(0,f.Px)();return(0,i.jsx)(o1,{id:"futures_order_tabs",isMobile:N,children:(0,i.jsx)(o6,{className:"order-tabs",containerPaddingInline:N?14:16,tabNavGap:20,showIndicator:!0,enableFastScroll:!0,borderPosition:"bottom",size:"middle",activeKey:_,onChange:e=>j(e),items:k,destroyInactiveTabPane:!0,animated:!1,addonTabBarAfter:(0,i.jsx)("span",{className:"futures-orders-tabs-toolbar",children:(0,i.jsx)(aa,{wrapperRef:y})}),showGuide:!0,guideConfig:C})})};var o3=n(79011),o5=n.n(o3),o8=n(27775);let o7=e=>{var t,n,l,r;let{symbol:a,store:o={exchange:{}},lastPrice:s,isGrid:c,alias:u}=e,{e6eTicker:p}
1=o.exchange,[{tradeTicker:m}]=(0,d.d4)(e=>({tradeTicker:e.tradeTicker})),h=(0,tj.A)(()=>p||m,[p,m]),x=(null==h?void 0:h.price)==="--"?s||"--":null==h?void 0:h.price,f=(null===(n=u||a)||void 0===n?void 0:null===(t=n.replace("_","/"))||void 0===t?void 0:t.toUpperCase())||"--",v=(null===(l=f.split("/"))||void 0===l?void 0:l[0])||"",g=(null===(r=f.split("/"))||void 0===r?void 0:r[1])||"",{title:b,description:y}=(0,o8.YM)(c?{title:"L0014040ç½æ ¼äº¤æå®æ¶ä»·æ ¼å¾è¡¨LBank",description:"L0014041å¨LBankç°è´§äº¤ææè¿è¡ç½æ ¼"}:{title:"L0014038ç°è´§äº¤æå®æ¶ä»·æ ¼å¾è¡¨LBank",description:"L0014039å¨LBankç°è´§äº¤ææäº¤æäº«å"},{title:{0:(0,Q.Qr)(x),1:"".concat(v,"/").concat(g)},description:{0:f,1:v}}),A=(0,o8.kY)(),j=(0,L.A)();return(0,i.jsxs)(o5(),{children:[(0,i.jsx)("meta",{name:"description",content:(0,Q.YW)(y||"Buy and sell ".concat(f,", BTC, ETH, and more by spot trading."),j)},"description"),(0,i.jsx)("title",{children:(0,Q.YW)(b||"".concat((0,Q.Qr)(x)," | Trade ").concat(f," | LBank Spot Trade"),j)},"title"),(0,o8.$O)(),(0,o8.qG)({url:A,title:(0,Q.YW)(b,j),description:(0,Q.YW)(y,j)}),(0,o8.j_)({title:(0,Q.YW)(b,j),description:(0,Q.YW)(y,j)}),(0,o8.A)(),(0,o8.T_)(A),(0,o8.Ez)({title:(0,Q.YW)(b,j),description:(0,Q.YW)(y,j)})]})};function o9(){let e=(0,u._)(["\n display: flex !important;\n & > * {\n flex: 1 !important;\n min-width: 0;\n > button {\n padding: 8px 10px;\n width: 100%;\n\n > span {\n display: inline-block;\n overflow: hidden;\n width: 100%;\n }\n }\n }\n "]);return o9=function(){return e},e}function se(){let e=(0,u._)(["\n ","\n"]);return se=function(){return e},e}let st=(0,m.Ay)(iQ.A)(se(),e=>e.$block&&(0,h.AH)(o9())),sn=(0,a.memo)(e=>{let{block:t=!1}=e,n=(0,_.A)(),{t:l}=(0,S.A)(),{tradingType:r}=(0,g.Pj)(e=>({tradingType:e.tradingType})),a=(0,L.A)(),[{tradePost:o}]=(0,d.d4)(e=>({tradePost:e.exchangeState.tradePost})),{goToDeposit:s}=lk({assetCode:o,tradingType:r}),c=(0,ei.default)(e=>{let{buttonName:t}=e;(0,og.rB)({requirement_id:298,track_sign:"aspot.b1992.d1995.click.Click",clickName:"buttonClick",pageName:"spotTradingPage",button_name:t})});return(0,i.jsxs)(st,{size:8,$block:t,children:[r===eN.Nn.leverage?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lQ,{size:"middle",block:t,defaultAssetCode:o,onClick:()=>c({buttonName:"borrow"}),defaultLoanType:lx.borrow,children:(0,i.jsx)(t0.A,{defaultFontSize:14,minFontSize:1,lineHeight:16,children:l("L0016379忬¾")})}),(0,i.jsx)(lQ,{size:"middle",block:t,defaultAssetCode:o,onClick:()=>c({buttonName:"repay"}),defaultLoanType:lx.repay,children:(0,i.jsx)(t0.A,{defaultFontSize:14,minFontSize:1,lineHeight:16,children:l("L0016380è¿æ¬¾")})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T.A,{size:"middle",block:t,onClick:()=>{c({buttonName:"deposit"}),n.push("/wallet/account/main/deposit/crypto/".concat(o))},children:(0,i.jsx)(t0.A,{defaultFontSize:14,minFontSize:1,lineHeight:16,children:l("L0000155å
å¼")})}),(0,i.jsx)(T.A,{size:"middle",block:t,onClick:()=>{c({buttonName:"withdraw"}),n.push("/wallet/account/main/withdrawal/crypto/".concat(o||"btc"))},children:(0,i.jsx)(t0.A,{defaultFontSize:14,minFontSize:1,lineHeight:16,children:l("L0000154æç°")})})]}),a?null:(0,i.jsx)(T.A,{size:"middle",onClick:()=>{c({buttonName:"transfer"}),s()},block:t,children:(0,i.jsx)(t0.A,{defaultFontSize:14,minFontSize:1,lineHeight:16,children:l("L0000900å转")})})]})});function sl(){let e=(0,u._)(["\n width: 100%;\n .spot-assets-title {\n padding: 12px 16px;\n color: ",";\n ",";\n display: flex;\n line-height: 20px;\n flex-direction: column;\n justify-content: center;
1\n align-items: flex-start;\n border-bottom: 1px solid ",";\n }\n\n .list-title {\n display: flex;\n justify-content: space-between;\n align-items: start;\n align-self: stretch;\n max-width: 60%;\n color: ",";\n }\n\n .list-value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n color: ",";\n ",";\n }\n\n .spot_legal_currency {\n color: ",";\n ",";\n }\n .apr-tag {\n padding: 4px 4px 4px 0;\n }\n .no-login-container {\n height: auto;\n }\n"]);return sl=function(){return e},e}let sr=m.Ay.div(sl(),V.vZ,e=>e.theme.bizTypography.m14,V._O,V.vZ,V.vZ,e=>e.theme.bizTypography.r12,V.fG,e=>e.theme.bizTypography.r10),si=(0,a.memo)(()=>{let{t:e}=(0,S.A)(),{isLogin:t}=(0,w.A)(),{splitBuySell:n}=(0,nD.pI)(),l=(0,L.A)(),{renderModal:r,openModal:o}=(0,iY.Ay)({pageName:iK.fR.SPOT_TRADING}),s=(0,a.useCallback)((e,t)=>{e&&((0,og.rB)({requirement_id:298,track_sign:"aspot.b1992.d2154.click.Click",clickName:"earnClick",pageName:"spotTradingPage",earnRate:t,earnProductId:e}),o(e))},[]),[{tradeAsset:c,tradePost:u,tradeSymbol:p}]=(0,d.d4)(e=>({tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost,tradeSymbol:e.exchangeState.tradeSymbol})),{assetConditionMap:m}=oG({symbol:p,shelfStatus:"ALL"}),{lgtSymbol:h,rate:x}=(0,eh.A)(),f=(0,a.useMemo)(()=>[{assetCode:c,...c?m[c]:{}},{assetCode:u,...u?m[u]:{}}],[m,c,u]),v=(0,a.useMemo)(()=>f.map(e=>({asset:e,label:(0,i.jsx)(eC.default,{className:"trade-pair-value",symbol:null==e?void 0:e.assetCode,type:"coin",fontSize:12,showArrow:!1,showLogo:!1,symbolNameGap:8,customIdentifier:l?null:(0,i.jsx)(i5,{className:"apr-tag",record:e,onClick:()=>s(null==e?void 0:e.spotEarnProductId,null==e?void 0:e.spotEarnApr)})}),value:(0,i.jsxs)(er.A,{direction:"vertical",size:2,inline:!0,align:"end",children:[(0,i.jsx)("span",{children:(0,i.jsx)(t0.A,{defaultFontSize:12,minFontSize:1,fontWeight:400,children:(0,eg.w1)(e.assetAmt||"0",4)})}),(0,i.jsx)("span",{className:"spot_legal_currency",children:(0,i.jsx)(t0.A,{defaultFontSize:12,minFontSize:1,fontWeight:400,children:"â".concat(null!=h?h:"").concat(e.toUsd?(0,Q.al)((0,eg.w1)(e.toUsd||"0",4),x):0)})})]})})),[f,h,s,x,l]);return n?null:(0,i.jsxs)(i.Fragment,{children:[r(),(0,i.jsxs)(sr,{children:[(0,i.jsx)("div",{className:"spot-assets-title",children:e("L0003447èµäº§")}),t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(er.A,{top:16,bottom:16,left:16,right:16,size:8,inline:!0,direction:"vertical",children:v.map((e,t)=>(0,i.jsxs)(er.A,{inline:!0,justify:"space-between",align:"center",children:[(0,i.jsx)("div",{className:"list-title",children:e.label}),(0,i.jsx)("div",{className:"list-value",children:e.value})]},e.asset.assetCode+t))}),(0,i.jsx)(er.A,{left:16,right:16,children:(0,i.jsx)(sn,{block:!0})})]}):(0,i.jsx)("div",{className:"no-login-container",children:(0,i.jsx)(iu,{})})]})]})});function sa(){let e=(0,u._)(["\n width: 100%;\n .spot-assets-title {\n padding: 12px 16px;\n color: ",";\n ",";\n display: flex;\n line-height: 20px;\n flex-direction: column;\n justify-content: center;
1\n align-items: flex-start;\n border-bottom: 1px solid ",";\n }\n\n .risk-rate-title {\n ",";\n }\n\n .list-title {\n display: flex;\n justify-content: space-between;\n align-items: start;\n align-self: stretch;\n max-width: 60%;\n color: ",";\n\n &.center {\n align-items: center;\n }\n }\n\n .list-value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n color: ",";\n ",";\n }\n\n .spot_legal_currency {\n color: ",";\n ",";\n }\n .apr-tag {\n padding: 4px 4px 4px 0;\n }\n .no-login-container {\n height: auto;\n }\n"]);return sa=function(){return e},e}let so=m.Ay.div(sa(),V.vZ,e=>e.theme.bizTypography.r14,V._O,e=>e.theme.bizTypography.r12,V.vZ,V.vZ,e=>e.theme.bizTypography.r12,V.fG,e=>e.theme.bizTypography.r10),ss=(0,a.memo)(()=>{var e;let{t}=(0,S.A)(),{isLogin:n}=(0,w.A)(),{splitBuySell:l}=(0,nD.pI)(),r=(0,h.DP)(),{renderModal:o,openModal:s}=(0,iY.Ay)({pageName:iK.fR.SPOT_TRADING}),c=(0,a.useCallback)(e=>{e&&s(e)},[]),[{tradeAsset:u,tradePost:p,tradeSymbol:m}]=(0,d.d4)(e=>({tradeAsset:e.exchangeState.tradeAsset,tradePost:e.exchangeState.tradePost,tradeSymbol:e.exchangeState.tradeSymbol})),{assetConditionMap:x}=i7({symbol:m}),{lgtSymbol:f,rate:v}=(0,eh.A)(),g=(0,a.useMemo)(()=>[{assetCode:u,...u?x[u]:{}},{assetCode:p,...p?x[p]:{}}],[x,u,p]),b=(0,a.useMemo)(()=>g.map(e=>({asset:e,label:(0,i.jsx)(eC.default,{symbol:null==e?void 0:e.assetCode,type:"coin",fontSize:12,showArrow:!1,showLogo:!1,enableLazy:!1,symbolNameGap:8,customIdentifier:(0,i.jsx)(i5,{className:"apr-tag",record:e,onClick:()=>c(null==e?void 0:e.spotEarnProductId)})}),value:(0,i.jsxs)(er.A,{direction:"vertical",size:2,inline:!0,align:"end",children:[(0,i.jsx)("span",{children:(0,i.jsx)(t0.A,{defaultFontSize:12,minFontSize:1,fontWeight:400,children:(0,eg.w1)(e.assetAmt||"0",4)})}),(0,i.jsx)("span",{className:"spot_legal_currency",children:(0,i.jsx)(t0.A,{defaultFontSize:12,minFontSize:1,fontWeight:400,children:f+(e.toUsd?(0,Q.al)((0,eg.w1)(e.toUsd||"0",4),v):0)})})]})})),[g,f,c,v]);return l?null:(0,i.jsxs)(i.Fragment,{children:[o(),(0,i.jsxs)(so,{children:[(0,i.jsx)("div",{className:"spot-assets-title",children:t("L0003447èµäº§")}),n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(er.A,{top:16,bottom:16,left:16,right:16,size:8,inline:!0,direction:"vertical",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)(er.A,{inline:!0,justify:"space-between",align:"center",children:[(0,i.jsx)("div",{className:"list-title center",children:(0,i.jsx)("div",{className:"risk-rate-title",children:t("L0016743æ æé£é©ç")})}),(0,i.jsx)("div",{className:"list-value",children:(0,i.jsx)(er.A,{direction:"vertical",size:2,inline:!0,align:"end",children:(0,i.jsx)(nA,{noPadding:!0})})})]},"risk"),(0,i.jsx)(tQ.A,{style:{backgroundColor:null==r?void 0:null===(e=r.palette)||void 0===e?void 0:e.bizLine.line3},height:2,top:16,bottom:8})]}),b.map((e,t)=>(0,i.jsxs)(er.A,{inline:!0,justify:"space-between",align:"center",children:[(0,i.jsx)("div",{className:"list-title",children:e.label}),(0,i.jsx)("div",{className:"list-value",children:e.value})]},e.asset.assetCode+t))]}),(0,i.jsx)(er.A,{left:16,right:16,children:(0,i.jsx)(sn,{block:!0})})]}):(0,i.jsx)("div",{className:"no-login-container",children:(0,i.jsx)(iu,{})})]})]})});function sd(){let e=(0,u._)(["\n position: relative;\n"]);return sd=function(){return e},e}function sc(){let e=(0,u._)(["\n height: 604px !important;\n "]);return sc=function(){return e},e}function su(){let e=(0,u._)(["\n position: relative;\n width: 100%;\n display: flex;\n flex-direction: column;\n ","\n"]);return su=function(){return e},e}function sp(){let e=(0,u._)([""]);return sp=function(){return e},e}let sm=m.Ay.div(sd()),sh=m.Ay.div(su(),f.XG.mobile((0,h.AH)(sc()))),sx=m.Ay.div(sp()),sf=e=>{let{extTabs:t,children:n}=e;return(0,i.jsxs)(sh,{children:[(0,i.jsx)(tF,{extTabs:t}),n]})},sv=e=>{var t,n,l,r;let o=(0,a.useRef)(null),{auth:s}=(0,w.A)(),d=(0,L.A)(),{tradeModalTitle:u,countryLimitShow:m,currentSymbol:h,assetItem:f,error:g,tradingType:b,mergeShow:_,setMergeShow:N,postArea:T,stBlocking:S}=os(e);y();
1let{guideRef:E,guideOnStartRef:P,guideKey:O,debouncedCanShowNewUserGuide:R,setShowGuide:I,GuideHandle:M}=om({currentSymbol:h,stBlocking:S,error:g});return(0,A.Yr)({rootRef:o,currentSymbol:h}),(0,i.jsxs)(sx,{children:[(null==g?void 0:g.message)?(0,i.jsx)(B,{message:null==g?void 0:g.message}):(0,i.jsx)(v.aT,{guideRef:E,guideKey:O,enabled:R&&!d,total:5,pageable:!0,isFixedToBottom:!1,onStart:()=>{var e;null===(e=P.current)||void 0===e||e.call(P)},onChange:e=>{e>=5&&(I(!1),P.current=void 0)},children:(0,i.jsxs)(rQ,{currentSymbol:h,children:[(0,i.jsx)(M,{}),(0,i.jsxs)(sm,{ref:o,children:[(0,i.jsx)(o7,{symbol:h,alias:(null===(t=e.assetItem)||void 0===t?void 0:t.alias)||(null==f?void 0:f.alias),store:e.store,lastPrice:e.lastPrice,isGrid:e.isGrid}),(0,i.jsx)(j.A,{}),(0,i.jsx)(ty,{symbol:h,assetItem:e.assetItem,tickerInfo:e.tickerInfo,serverTradeArea:(null===(n=e.assetItem)||void 0===n?void 0:n.areaCode)||"",tradingType:b}),(0,i.jsx)(p.default,{}),(0,i.jsx)(k.ew,{accountScopeKey:null==s?void 0:s.token,children:(0,i.jsx)(c.A.Main,{countryLimit:m,from:["trade",T],market:()=>(0,i.jsx)(rj,{}),chart:(0,i.jsx)(sf,{children:b===eN.Nn.leverage&&(0,i.jsx)(rX,{})}),renderOrderBook:()=>(0,i.jsx)(rV,{}),renderTrades:()=>(0,i.jsx)(r_,{}),orderBoard:t=>{var n;return(0,i.jsx)(rx,{currentSymbol:h,initTradeType:null==t?void 0:"sell"===t?"SELL":"BUY",assetItem:e.assetItem,serverTradeArea:(null===(n=e.assetItem)||void 0===n?void 0:n.areaCode)||""})},orderTables:b===eN.Nn.leverage?(0,i.jsx)(aQ,{symbol:h,serverTradeArea:(null===(l=e.assetItem)||void 0===l?void 0:l.areaCode)||""}):(0,i.jsx)(o4,{symbol:h,serverTradeArea:(null===(r=e.assetItem)||void 0===r?void 0:r.areaCode)||""}),tradeModalTitle:u,rights:b===eN.Nn.trade?(0,i.jsx)(si,{}):(0,i.jsx)(ss,{})})}),(0,i.jsx)(rb,{}),(0,i.jsx)(ry,{open:_,setOpen:N}),(0,i.jsx)(x.default,{})]})]})}),(0,i.jsx)(C.A,{})]})},sg=a.memo(e=>(0,i.jsx)(d.Rc,{children:(0,i.jsx)(s.Sd,{children:(0,i.jsx)(sv,{...e})})}));sg.createLayout=()=>c.A;var sb=!0;let sy=sg},71948:(e,t,n)=>{"use strict";n.d(t,{A:()=>z});var l=n(58474),r=n(63159),i=n(41335),a=n(13892),o=n(60583),s=n(71787),d=n(78961),c=n(57157),u=n(63618),p=n(61297),m=n(63240),h=n(11595),x=n(3007),f=n(53886),v=n(50321),g=n(6419),b=n(11458),y=n(1165),A=n(44339),j=n(93809),L=n(73408),C=n(63850),w=n.n(C),k=n(40487),_=n(36296),N=n(70232),T=n(43376);function S(){let e=(0,l._)(["\n margin-left: -14px;\n margin-right: -14px;\n padding-left: 14px;\n padding-right: 14px;\n "]);return S=function(){return e},e}function E(){let e=(0,l._)(["\n display: flex;\n flex-direction: column;\n margin-left: -24px;\n margin-right: -24px;\n padding-left: 24px;\n padding-right: 24px;\n margin-bottom: 0;\n\n ","\n\n .hint {\n color: ",";\n ",";\n line-height: 16px;\n }\n\n .video {\n margin: 20px 0;\n background-color: ",";\n max-height: 356px;\n aspect-ratio: 632 / 356;\n }\n\n .bottom-hint {\n color: ",";\n ",";\n line-height: 16px;\n }\n"]);return E=function(){return e},e}function P(){let e=(0,l._)(["\n margin: 16px 0 0 0;\n "]);return P=function(){return e},e}function O(){let e=(0,l._)(["\n .risk-hint_aggree {\n margin: 0;\n margin-top: 20px;\n\n .lbank-checkbox {\n color: ",";\n }\n }\n\n .tradeConfirmButton {\n padding: 0;\n margin: 32px 0 0 0;\n ","\n }\n"]);return O=function(){return e},e}let R=(0,a.Ay)(N.$m)(E(),i.XG.mobile((0,o.AH)(S())),v.vZ,e=>e.theme.bizTypography.r12,v.sR,v.xY,e=>e.theme.bizTypography.r12),I=(0,a.Ay)(N.Ri)(O(),v.vZ,i.XG.mobile((0,o.AH)(P()))),M=e=>{let{onOk:t,onlyShowGuide:n=!1}=e,{t:l}=(0,d.A)(),[a]=h.A.useForm(),[o,s]=(0,f.useState)(!1),[p,v]=(0,f.useState)({}),{isMobile:A}=(0,i.Px)(),[C,k]=(0,c.A)(!1),[T]=(0,L.A)(),S=w()((0,u.default)(()=>{if(n||!o){null==t||t();return}k(m.Ay.postLeverageTradeCenterAccountNoTips({__autoLogin:!0})).then(()=>{null==t||t()}).catch(e=>{(null==e?void 0:e.message)&&x.A.error(null==e?void 0:e.message)})})),E=(0,f.useMemo)(()=>(0,r.jsxs)(I,{children:[!n&&(0,r.jsx)(g.A,{inline:!0,left:0,right:A?0:24,justify:"start",children:(0,r.jsx)(y.A,{className:"risk-hint_aggree",value:"checked",appearance:"square",size:"small",onChange:(e,t)=>
1{s(t)},children:l("L0008313ä¸åæç¤º")})}),(0,r.jsx)(N.XK,{className:"tradeConfirmButton",children:(0,r.jsx)(b.A,{loading:C,size:A?"large":"middle",enableTouchRipple:!0,onClick:()=>null==S?void 0:S(),variant:"primary",children:l("L0001610æç¥éäº")})})]}),[l,A,p,C]);return(0,r.jsxs)(h.A,{form:a,onValuesChange:(e,t)=>v(t),children:[(0,r.jsxs)(R,{children:[(0,r.jsx)("div",{className:"hint",style:{marginTop:0},children:l("L0016800使ç¨åå¸äº¤æåæ¨å¯å¨äº¤ææ¶åå
¥")}),(0,r.jsx)("div",{className:"video",children:(0,r.jsx)(j.A,{src:"zh-TC"===T?"".concat(_.Cu?"https://jia.rerrkvifj.com":"/static-client","/common/videos/leverage/margin-trading-zh.mp4"):"".concat(_.Cu?"https://jia.rerrkvifj.com":"/static-client","/common/videos/leverage/margin-trading-en.mp4"),poster:"zh-TC"===T?"".concat(_.Cu?"https://jia.rerrkvifj.com":"/static-client","/common/images/resources/margin-trading-zh.png?x-oss-process=image/format,webp"):"".concat(_.Cu?"https://jia.rerrkvifj.com":"/static-client","/common/images/resources/margin-trading-en.png?x-oss-process=image/format,webp")})}),(0,r.jsx)("div",{className:"bottom-hint",style:{marginTop:0},children:l("L0016861æ æäº¤æå
·æé«é£é©å¯è½å¯¼è´èµäº§")})]}),E]})},z=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let{modal:e}=(0,s.A)(),t=(0,f.useRef)(null),{t:n}=(0,d.A)(),{getLeverageAccountStatus:l}=(0,T.A)(),[{leverageAccountDetail:i},a]=(0,A.d4)(e=>({leverageAccountDetail:null==e?void 0:e.leverageAccountDetail})),o=(0,p.default)(async()=>{try{return await Promise.resolve(i)}catch(e){return Promise.resolve({})}}),c=(0,p.default)(o=>{let{resolve:s,onlyShowGuide:d=!1}=o;t.current=e.info({width:680,icon:null,closable:!0,maskClosable:!0,shouldResponsive:!0,footer:null,minViewportDistance:40,title:n("L0016799æ æäº¤ææå"),onCancel:()=>{null==s||s(!0),t.current.destroy()},content:(0,r.jsx)(M,{onOk:()=>{a({leverageAccountDetail:{...i,noTips:1}}),l(),null==s||s(!0),t.current.destroy()},onlyShowGuide:d}),okButtonProps:{hidden:!0}})}),u=(0,p.default)(async t=>{let{tradeSymbol:l}=t;return new Promise(async(t,l)=>{try{let i=await o();(null==i?void 0:i.limitedTrade)===1?(e.info({icon:null,closable:!0,title:n("L0013145éå¶åºå"),maskClosable:!0,content:(0,r.jsxs)(r.Fragment,{children:[n("ç±äºç¸å
³æ³å¾æ³è§çè¦æ±ï¼æä»¬ç平尿 æ³å¨æ¨æå¨çå°åºæä¾æå¡ãç±æ¤ç»æ¨å¸¦æ¥çä¸ä¾¿æä»¬æ·±è¡¨ææã"),(0,r.jsx)(k.A,{target:"_blank",rel:"noreferrer",href:"/support/articles/44365578384921",children:n("L0003821äºè§£æ´å¤")})]}),okText:n("L0001610æç¥éäº")}),l(Error(!1))):i.status&&!i.noTips?c({resolve:t,reject:l}):t(!0)}catch(e){t(!0)}})});return{getLeverageAccountStatus:o,checkLeverageAccountStatus:u,showGuideModal:c}}},34061:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var l=n(31052),r=n(81491),i=n(77844);let a={postLbkTradingbotGatewaySpotApiV1DcaCreate:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/create"},postLbkTradingbotGatewaySpotApiV1DcaList:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/list"},getLbkTradingbotGatewaySpotApiV1DcaPlanIdDetail:{method:"get",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/{planId}/detail"},postLbkTradingbotGatewaySpotApiV1DcaOrders:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/orders"},postLbkTradingbotGatewaySpotApiV1DcaClose:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/close"},postLbkTradingbotGatewaySpotApiV1DcaInvestmentAmountUpdate:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/investment-amount/update"},getLbkTradingbotGatewaySpotApiV1DcaRunningCount:{method:"get",url:"/lbk-tradingbot-gateway/spot/api/v1/dca/running-count"},postLbkTradingbotGatewaySpotApiV1ConfigDcaAiRecsList:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/config/dca/ai-recs/list"},postLbkTradingbotGatewaySpotApiV1ConfigDcaSymbolsList:{method:"post",url:"/lbk-tradingbot-gateway/spot/api/v1/config/dca/symbols/list"},getLbkTradingbotGatewaySpotApiV1ConfigDcaAiRecsPortfolioIdDetail:{method:"get",url:"/lbk-tradingbot-gateway/spot/api/v1/config/dca/ai-recs/{portfolioId}/detail"}};var o=n(65399),s=n(197);let d={abortController:new AbortController,get controller(){return d.abortController},set controller(ctrl){d.abortController=ctrl}},c=new Proxy(d,{get:(e,t)=>"symbol"==typeof t||"then"===t||t in e?e[t]:async function(e,n){let{method:d,url:c}=(0,o.BQ)(t,a);return(0,i.uf)(c,e,d,{baseUrl:(0,s.Vp)(l.IW),headers:{...(0,o.Gc)(),"ex-time-zone":(0,r.I_)()},...n})}})},11161:(e,t,n)=>{"use strict";n.d(t,{d:()=>function e(t,n){if(!t)return 0;let r=t,i=0;for(;r&&r!==document.body&&r!==document.documentElement&&(!n||l(r,n));
1)i+=r.offsetTop-r.scrollTop,r=r.offsetParent;return n&&l(n,r)&&(i-=e(n,r)),i}});let l=(e,t)=>e&&e!==t&&(null==t?void 0:t.contains(e))},98273:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var l=n(58474),r=n(63159),i=n(55806),a=n(13892);function o(){let e=(0,l._)(["\n /* @noflip */\n transform: "," !important;\n display: inline-flex;\n align-items: center;\n"]);return o=function(){return e},e}n(53886);let s=a.Ay.span(o(),e=>e.isRTL?"rotateY(180deg)":"rotate(0)"),d=e=>{let{children:t,className:n=""}=e,l=(0,i.A)();return(0,r.jsx)(s,{className:"".concat(n),isRTL:l,children:t})}},57167:()=>{}},e=>{var t=t=>e(e.s=t);e.O(0,[2625,9013,8196,5050,7588,216,4175,8440,271,3472,1613,9111,8715,270,6533,367,2605,3466,6376,8229,9371,1642,1904,3125,8333,8466,6457,6082,8248,7114,2172,5298,931,7553,9133,915,1551,9528,9415,1950,636,6593,8792],()=>t(84940)),_N_E=e.O()}]);
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.