PageSourceSearch

https://www.bittradehq.ai/static/js/9803.abacf0cb.chunk.js

js bittradehq.ai collected 2026-10-05 13:29:49 UTC 25,506 bytes, 3 lines download raw bytes

1/*! For license information please see 9803.abacf0cb.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9803],{39292(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},49803(e,t,s){s.r(t),s.d(t,{default:()=>D});var a=s(89379),r=s(65043),l=s(45685),n=s(79722),i=s(69284),c=s(13390),d=s(92264),o=s(20556),p=s(84370),x=s(56328),m=s(37719),h=s(34537),u=s(65469),g=s(36210),f=s(75088),j=s(71360),b=s(50516),y=s(42489),N=s(23165),v=s(73782),w=s(44919),_=s(40614),A=s(20073),k=s(91122),C=s(70579);const S=[{id:"binance",name:"Binance"},{id:"okx",name:"OKX"},{id:"bybit",name:"Bybit"},{id:"kraken",name:"Kraken"},{id:"coinbase",name:"Coinbase"},{id:"kucoin",name:"KuCoin"}],T=["BTC/USDT","ETH/USDT","SOL/USDT","XRP/USDT","DOGE/USDT","ADA/USDT","AVAX/USDT","DOT/USDT","LINK/USDT","MATIC/USDT","BNB/USDT","SHIB/USDT","TRX/USDT","TON/USDT","NEAR/USDT"],U={pending:"bg-amber-500/10 text-amber-400",active:"bg-cyan-500/10 text-cyan-400",completed:"bg-emerald-500/10 text-emerald-400",cancelled:"bg-muted text-slate-400",error:"bg-red-500/10 text-red-400"},R={pending:f.A,active:h.A,completed:g.A,cancelled:_.A,error:m.A};function D(){const e=(0,l.Zp)(),[t,s]=(0,r.useState)([]),[m,h]=(0,r.useState)(!0),[g,D]=(0,r.useState)(!1),[L,z]=(0,r.useState)(!1),[q,E]=(0,r.useState)(""),[P,F]=(0,r.useState)("all"),[$,B]=(0,r.useState)({exchange:"binance",trading_pair:"BTC/USDT",side:"buy",entry_type:"market",entry_price:"",quantity:"",take_profit_targets:[],trailing_take_profit:!1,stop_loss_price:"",stop_loss_percent:"",trailing_stop_loss:!1}),[J,O]=(0,r.useState)({price:"",percent:""}),I=localStorage.getItem("token"),K={Authorization:"Bearer ".concat(I)};(0,r.useEffect)(()=>{M()},[P]);const M=async()=>{try{const e="all"===P?"".concat(i.nC,"/advanced-bots/smart-trades"):"".concat(i.nC,"/advanced-bots/smart-trades?status=").concat(P),t=await n.A.get(e,{headers:K});s(t.data)}catch(e){console.error("Failed to fetch smart trades:",e),x.oR.error("Failed to load smart trades")}finally{h(!1)}},V=(q&&T.filter(e=>e.toLowerCase().includes(q.toLowerCase())),t);return m?(0,C.jsx)("div",{className:"min-h-screen bg-slate-950 flex items-center justify-center",children:(0,C.jsxs)("div",{className:"text-center",children:[(0,C.jsx)("div",{className:"w-12 h-12 border-2 border-purple-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,C.jsx)("p",{className:"text-slate-400",children:"Loading smart trades..."})]})}):(0,C.jsxs)("div",{className:"min-h-screen bg-slate-950","data-testid":"smart-trades-page",children:[(0,C.jsx)("nav",{className:"fixed bg-slate-900/90 backdrop-blur-xl border-b border-white/10 top-0 left-0 right-0 z-50 px-4 py-3",children:(0,C.jsxs)("div",{className:"flex items-center justify-between max-w-6xl mx-auto",children:[(0,C.jsxs)("div",{className:"flex items-center gap-4",children:[(0,C.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>e("/dashboard"),children:(0,C.jsx)(u.A,{className:"w-5 h-5"})}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("div",{className:"w-8 h-8 bg-gradient-to-r from-purple-500 to-pink-600 rounded-lg flex items-center justify-center",children:(0,C.jsx)(A.A,{className:"w-4 h-4 text-white"})}),(0,C.jsx)("span",{className:"font-display text-lg font-semibold text-white",children:"SmartTrades"})]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsxs)(c.$,{variant:"outline",size:"sm",onClick:M,children:[(0,C.jsx)(b.A,{className:"w-4 h-4 mr-2"})," Refresh"]}),(0,C.jsxs)(c.$,{className:"bg-gradient-to-r from-purple-500 to-pink-600 hover:from-purple-600 hover:to-pink-700 text-white",size:"sm",onClick:()=>D(!0),children:[(0,C.jsx)(j.A,{className:"w-4 h-4 mr-2"})," New SmartTrade"]})]})]})}),(0,C.jsxs)("main",{className:"pt-20 pb-8 px-4 max-w-6xl mx-auto",children:[(0,C.jsx)("div",{className:"backdrop-blur-xl bg-gradient-to-r from-purple-500/10 to-pink-500/10 border border-purple-500/20 rounded-xl p-5 mb-6",children:(0,C.jsxs)("div",{className:"flex items-start gap-4",children:[(0,C.jsx)("div",{className:"w-12 h-12 bg-purple-500/20 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,C.jsx)(A.A,{className:"w-6 h-6 text-purple-400"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("h3",{className:"font-semibold text-white text-lg mb-2",children:"What is a Smart Trade?"}),(0,C.jsxs)("p",{className:"text-slate-300 text-sm mb-3",children:[(0,C.jsx)("strong",{children:"A Smart Trade is like setting up the perfect trade with all your safety nets in place."})," You tell it exactly where to buy, where to take profits, and where to stop if things go wrong. Once set up, the bot handles everything automatically!"]}),(0,C.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3 mt-3",children:[(0,C.jsxs)("div",{className:"p-2 bg-slate-800/50 rounded-lg text-center",children:[(0,C.jsx)("p",{className:"text-purple-400 font-semibold text-sm",children:"Best For"}),(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"Specific trade ideas"})]}),(0,C.jsxs)("div",{className:"p-2 bg-slate-800/50 rounded-lg text-center",children:[(0,C.jsx)("p",{className:"text-purple-400 font-semibold text-sm",children:"Key Feature"}),(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"Auto stop-loss protection"})]}),(0,C.jsxs)("div",{className:"p-2 bg-slate-800/50 rounded-lg text-center",children:[(0,C.jsx)("p",{className:"text-purple-400 font-semibold text-sm",children:"Profit Style"}),(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"Set target & walk away"})]})]})]})]})}),(0,C.jsx)("div",{className:"flex gap-2 mb-6 overflow-x-auto pb-2",children:["all","pending","active","completed","cancelled"].map(e=>(0,C.jsx)("button",{onClick:()=>F(e),className:"px-4 py-2 rounded-lg text-sm font-medium whitespace-nowrap transition-all ".concat(P===e?"bg-purple-500 text-white":"bg-slate-800 text-slate-400 hover:text-white"),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),g&&(0,C.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,C.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,C.jsxs)("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[(0,C.jsx)("h2",{className:"font-display text-xl font-semibold text-white",children:"Create SmartTrade"}),(0,C.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>D(!1),children:(0,C.jsx)("span",{className:"text-2xl",children:"\xd7"})})]}),(0,C.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),!$.quantity||parseFloat($.quantity)<=0)x.oR.error("Please enter a valid quantity");else if("limit"!==$.entry_type||$.entry_price){z(!0);try{const e={exchange:$.exchange,trading_pair:$.trading_pair,side:$.side,entry_type:$.entry_type,entry_price:$.entry_price?parseFloat($.entry_price):null,quantity:parseFloat($.quantity),take_profit_targets:$.take_profit_targets,trailing_take_profit:$.trailing_take_profit,stop_loss_price:$.stop_loss_price?parseFloat($.stop_loss_price):null,stop_loss_percent:$.stop_loss_percent?parseFloat($.stop_loss_percent):null,trailing_stop_loss:$.trailing_stop_loss};await n.A.post("".concat(i.nC,"/advanced-bots/smart-trades"),e,{headers:K});x.oR.success("SmartTrade created successfully!"),D(!1),M(),B((0,a.A)((0,a.A)({},$),{},{entry_price:"",quantity:"",take_profit_targets:[],stop_loss_price:"",stop_loss_percent:""}))}catch(r){var t,s;x.oR.error((null===(t=r.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.detail)||"Failed to create SmartTrade")}finally{z(!1)}}else x.oR.error("Limit orders require an entry price")},className:"p-6 space-y-6",children:[(0,C.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Exchange"}),(0,C.jsxs)(p.l6,{value:$.exchange,onValueChange:e=>B((0,a.A)((0,a.A)({},$),{},{exchange:e})),children:[(0,C.jsx)(p.bq,{className:"mt-1 bg-slate-800 border-white/20",children:(0,C.jsx)(p.yv,{})}),(0,C.jsx)(p.gC,{children:S.map(e=>(0,C.jsx)(p.eb,{value:e.id,children:e.name},e.id))})]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Trading Pair"}),(0,C.jsx)("div",{className:"mt-1",children:(0,C.jsx)(k.A,{value:$.trading_pair,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{trading_pair:e})),assetType:"crypto",placeholder:"Search or type any pair..."})})]})]}),(0,C.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Side"}),(0,C.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,C.jsxs)("button",{type:"button",onClick:()=>B((0,a.A)((0,a.A)({},$),{},{side:"buy"})),className:"flex-1 py-2 rounded-lg text-sm font-medium transition-all ".concat("buy"===$.side?"bg-emerald-500 text-white":"bg-slate-800 text-slate-400 hover:text-white"),children:[(0,C.jsx)(w.A,{className:"w-4 h-4 inline mr-1"})," Buy / Long"]}),(0,C.jsxs)("button",{type:"button",onClick:()=>B((0,a.A)((0,a.A)({},$),{},{side:"sell"})),className:"flex-1 py-2 rounded-lg text-sm font-medium transition-all ".concat("sell"===$.side?"bg-red-500 text-white":"bg-slate-800 text-slate-400 hover:text-white"),children:[(0,C.jsx)(v.A,{className:"w-4 h-4 inline mr-1"})," Sell / Short"]})]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Entry Type"}),(0,C.jsxs)(p.l6,{value:$.entry_type,onValueChange:e=>B((0,a.A)((0,a.A)({},$),{},{entry_type:e})),children:[(0,C.jsx)(p.bq,{className:"mt-1 bg-slate-800 border-white/20",children:(0,C.jsx)(p.yv,{})}),(0,C.jsxs)(p.gC,{children:[(0,C.jsx)(p.eb,{value:"market",children:"Market Order"}),(0,C.jsx)(p.eb,{value:"limit",children:"Limit Order"}),(0,C.jsx)(p.eb,{value:"conditional",children:"Conditional"})]})]})]})]}),(0,C.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:["market"!==$.entry_type&&(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Entry Price"}),(0,C.jsx)(d.p,{type:"number",step:"0.01",value:$.entry_price,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{entry_price:e.target.value})),placeholder:"0.00",className:"mt-1 bg-slate-800 border-white/20"})]}),(0,C.jsxs)("div",{className:"market"===$.entry_type?"md:col-span-2":"",children:[(0,C.jsx)(o.J,{children:"Quantity *"}),(0,C.jsx)(d.p,{type:"number",step:"0.0001",value:$.quantity,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{quantity:e.target.value})),placeholder:"0.01",className:"mt-1 bg-slate-800 border-white/20"})]})]}),(0,C.jsxs)("div",{className:"p-4 bg-slate-800/30 rounded-xl space-y-4",children:[(0,C.jsxs)("h3",{className:"font-semibold text-white flex items-center gap-2",children:[(0,C.jsx)(N.A,{className:"w-4 h-4 text-emerald-400"}),"Take Profit Targets"]}),$.take_profit_targets.length>0&&(0,C.jsx)("div",{className:"space-y-2",children:$.take_profit_targets.map((e,t)=>(0,C.jsxs)("div",{className:"flex items-center gap-2 p-2 bg-emerald-500/10 rounded-lg",children:[(0,C.jsxs)("span",{className:"text-sm text-emerald-400 font-medium",children:["Target ",t+1,": ",e.price?"$".concat(e.price):"".concat(e.percent,"%")]}),(0,C.jsx)("button",{type:"button",onClick:()=>{return e=t,void B((0,a.A)((0,a.A)({},$),{},{take_profit_targets:$.take_profit_targets.filter((t,s)=>s!==e)}));var e},className:"ml-auto text-slate-400 hover:text-red-400",children:(0,C.jsx)(_.A,{className:"w-4 h-4"})})]},t))}),(0,C.jsxs)("div",{className:"flex gap-2",children:[(0,C.jsx)(d.p,{type:"number",step:"0.01",value:J.price,onChange:e=>O((0,a.A)((0,a.A)({},J),{},{price:e.target.value,percent:""})),placeholder:"Price target",className:"flex-1"}),(0,C.jsx)("span",{className:"text-slate-400 self-center",children:"or"}),(0,C.jsx)(d.p,{type:"number",step:"0.1",value:J.percent,onChange:e=>O((0,a.A)((0,a.A)({},J),{},{percent:e.target.value,price:""})),placeholder:"% profit",className:"flex-1"}),(0,C.jsx)(c.$,{type:"button",variant:"outline",onClick:()=>{J.price||J.percent?(B((0,a.A)((0,a.A)({},$),{},{take_profit_targets:[...$.take_profit_targets,{price:J.price?parseFloat(J.price):null,percent:J.percent?parseFloat(J.percent):null}]})),O({price:"",percent:""})):x.oR.error("Enter a price or percentage for the target")},children:(0,C.jsx)(j.A,{className:"w-4 h-4"})})]}),(0,C.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,C.jsx)("input",{type:"checkbox",checked:$.trailing_take_profit,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{trailing_take_profit:e.target.checked})),className:"w-4 h-4 rounded"}),(0,C.jsx)("span",{className:"text-sm text-white",children:"Enable Trailing Take Profit"})]})]}),(0,C.jsxs)("div",{className:"p-4 bg-slate-800/30 rounded-xl space-y-4",children:[(0,C.jsxs)("h3",{className:"font-semibold text-white flex items-center gap-2",children:[(0,C.jsx)(y.A,{className:"w-4 h-4 text-red-400"}),"Stop Loss"]}),(0,C.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"Stop Loss Price"}),(0,C.jsx)(d.p,{type:"number",step:"0.01",value:$.stop_loss_price,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{stop_loss_price:e.target.value,stop_loss_percent:""})),placeholder:"0.00",className:"mt-1 bg-slate-800 border-white/20"})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.J,{children:"or Stop Loss %"}),(0,C.jsx)(d.p,{type:"number",step:"0.1",value:$.stop_loss_percent,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{stop_loss_percent:e.target.value,stop_loss_price:""})),placeholder:"5.0",className:"mt-1 bg-slate-800 border-white/20"})]})]}),(0,C.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,C.jsx)("input",{type:"checkbox",checked:$.trailing_stop_loss,onChange:e=>B((0,a.A)((0,a.A)({},$),{},{trailing_stop_loss:e.target.checked})),className:"w-4 h-4 rounded"}),(0,C.jsx)("span",{className:"text-sm text-white",children:"Enable Trailing Stop Loss"})]})]}),(0,C.jsxs)("div",{className:"flex gap-4 pt-4 border-t border-white/10",children:[(0,C.jsx)(c.$,{type:"button",variant:"outline",onClick:()=>D(!1),className:"flex-1",children:"Cancel"}),(0,C.jsx)(c.$,{type:"submit",className:"flex-1 bg-gradient-to-r from-purple-500 to-pink-600 hover:from-purple-600 hover:to-pink-700 text-white",disabled:L,children:L?"Creating...":"Create SmartTrade"})]})]})]})}),V.length>0?(0,C.jsx)("div",{className:"space-y-4",children:V.map(e=>{var t;const s=R[e.status]||f.A;return(0,C.jsx)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl overflow-hidden cursor-pointer hover:border-purple-500/40 transition-all","data-testid":"smart-trade-".concat(e.trade_id),children:(0,C.jsxs)("div",{className:"p-4 flex flex-col md:flex-row md:items-center gap-4",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,C.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center ".concat("buy"===e.side?"bg-emerald-500/10":"bg-red-500/10"),children:"buy"===e.side?(0,C.jsx)(w.A,{className:"w-5 h-5 text-emerald-400"}):(0,C.jsx)(v.A,{className:"w-5 h-5 text-red-400"})}),(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"font-semibold text-white",children:e.trading_pair}),(0,C.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat(U[e.status]),children:[(0,C.jsx)(s,{className:"w-3 h-3 inline mr-1"}),e.status]})]}),(0,C.jsxs)("p",{className:"text-xs text-slate-400",children:[e.exchange," \u2022 ",e.entry_type," ",e.side," \u2022 ",e.quantity]})]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-6",children:[(0,C.jsxs)("div",{className:"text-center",children:[(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"Entry"}),(0,C.jsx)("p",{className:"font-mono text-sm text-white",children:e.filled_price?"$".concat(e.filled_price):e.entry_price?"$".concat(e.entry_price):"Market"})]}),(null===(t=e.take_profit_targets)||void 0===t?void 0:t.length)>0&&(0,C.jsxs)("div",{className:"text-center",children:[(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"TP Targets"}),(0,C.jsx)("p",{className:"font-mono text-sm text-emerald-400",children:e.take_profit_targets.length})]}),(e.stop_loss_price||e.stop_loss_percent)&&(0,C.jsxs)("div",{className:"text-center",children:[(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"Stop Loss"}),(0,C.jsx)("p",{className:"font-mono text-sm text-red-400",ch
2ildren:e.stop_loss_price?"$".concat(e.stop_loss_price):"".concat(e.stop_loss_percent,"%")})]}),(0,C.jsxs)("div",{className:"text-center",children:[(0,C.jsx)("p",{className:"text-xs text-slate-400",children:"P&L"}),(0,C.jsxs)("p",{className:"font-mono text-sm ".concat((e.realized_pnl||e.unrealized_pnl||0)>=0?"text-emerald-400":"text-red-400"),children:[(e.realized_pnl||e.unrealized_pnl||0)>=0?"+":"","$",(e.realized_pnl||e.unrealized_pnl||0).toFixed(2)]})]})]}),"pending"===e.status&&(0,C.jsxs)(c.$,{variant:"outline",size:"sm",onClick:()=>(async e=>{if(confirm("Are you sure you want to cancel this SmartTrade?"))try{await n.A.put("".concat(i.nC,"/advanced-bots/smart-trades/").concat(e,"/cancel"),{},{headers:K}),x.oR.success("SmartTrade cancelled"),M()}catch(a){var t,s;x.oR.error((null===(t=a.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.detail)||"Failed to cancel trade")}})(e.trade_id),children:[(0,C.jsx)(_.A,{className:"w-4 h-4 mr-1"})," Cancel"]})]})},e.trade_id)})}):(0,C.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-12 text-center",children:[(0,C.jsx)(A.A,{className:"w-16 h-16 mx-auto mb-4 text-slate-400/30"}),(0,C.jsx)("h3",{className:"font-display text-xl mb-2 text-white",children:"No SmartTrades Yet"}),(0,C.jsx)("p",{className:"text-slate-400 mb-6",children:"all"!==P?"No ".concat(P," trades found. Try a different filter."):"Create your first SmartTrade with advanced order management."}),(0,C.jsxs)(c.$,{className:"bg-gradient-to-r from-purple-500 to-pink-600 hover:from-purple-600 hover:to-pink-700 text-white",onClick:()=>D(!0),children:[(0,C.jsx)(j.A,{className:"w-4 h-4 mr-2"})," Create SmartTrade"]})]})]})]})}},71360(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},84370(e,t,s){s.d(t,{bq:()=>N,eb:()=>A,gC:()=>_,l6:()=>b,yv:()=>y});var a=s(89379),r=s(53986),l=s(65043),n=s(26318),i=s(36210),c=s(92382),d=s(15711),o=s(99766),p=s(70579);const x=["className","children"],m=["className"],h=["className"],u=["className","children","position"],g=["className"],f=["className","children"],j=["className"],b=n.bL,y=(n.YJ,n.WT),N=l.forwardRef((e,t)=>{let{className:s,children:l}=e,i=(0,r.A)(e,x);return(0,p.jsxs)(n.l9,(0,a.A)((0,a.A)({ref:t,className:(0,o.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm text-white shadow-sm ring-offset-background data-[placeholder]:text-slate-400 focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s)},i),{},{children:[l,(0,p.jsx)(n.In,{asChild:!0,children:(0,p.jsx)(c.A,{className:"h-4 w-4 opacity-50"})})]}))});N.displayName=n.l9.displayName;const v=l.forwardRef((e,t)=>{let{className:s}=e,l=(0,r.A)(e,m);return(0,p.jsx)(n.PP,(0,a.A)((0,a.A)({ref:t,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",s)},l),{},{children:(0,p.jsx)(d.A,{className:"h-4 w-4"})}))});v.displayName=n.PP.displayName;const w=l.forwardRef((e,t)=>{let{className:s}=e,l=(0,r.A)(e,h);return(0,p.jsx)(n.wn,(0,a.A)((0,a.A)({ref:t,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",s)},l),{},{children:(0,p.jsx)(c.A,{className:"h-4 w-4"})}))});w.displayName=n.wn.displayName;const _=l.forwardRef((e,t)=>{let{className:s,children:l,position:i="popper"}=e,c=(0,r.A)(e,u);return(0,p.jsx)(n.ZL,{children:(0,p.jsxs)(n.UC,(0,a.A)((0,a.A)({ref:t,className:(0,o.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:i},c),{},{children:[(0,p.jsx)(v,{}),(0,p.jsx)(n.LM,{className:(0,o.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,p.jsx)(w,{})]}))})});_.displayName=n.UC.displayName;l.forwardRef((e,t)=>
2{let{className:s}=e,l=(0,r.A)(e,g);return(0,p.jsx)(n.JU,(0,a.A)({ref:t,className:(0,o.cn)("px-2 py-1.5 text-sm font-semibold",s)},l))}).displayName=n.JU.displayName;const A=l.forwardRef((e,t)=>{let{className:s,children:l}=e,c=(0,r.A)(e,f);return(0,p.jsxs)(n.q7,(0,a.A)((0,a.A)({ref:t,className:(0,o.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s)},c),{},{children:[(0,p.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,p.jsx)(n.VF,{children:(0,p.jsx)(i.A,{className:"h-4 w-4"})})}),(0,p.jsx)(n.p4,{children:l})]}))});A.displayName=n.q7.displayName;l.forwardRef((e,t)=>{let{className:s}=e,l=(0,r.A)(e,j);return(0,p.jsx)(n.wv,(0,a.A)({ref:t,className:(0,o.cn)("-mx-1 my-1 h-px bg-muted",s)},l))}).displayName=n.wv.displayName},91122(e,t,s){s.d(t,{A:()=>p});var a=s(65043),r=s(92382),l=s(55731),n=s(39292),i=s(40614),c=s(79722),d=s(69284),o=s(70579);function p(e){let{value:t,onChange:s,assetType:p,placeholder:x,className:m}=e;const[h,u]=(0,a.useState)(!1),[g,f]=(0,a.useState)(""),[j,b]=(0,a.useState)([]),[y,N]=(0,a.useState)(!1),v=(0,a.useRef)(null),w=(0,a.useRef)(null),_=localStorage.getItem("token"),A=(0,a.useRef)(0),k=(0,a.useCallback)(async e=>{const t=++A.current;N(!0);try{const s=new URLSearchParams;p&&s.set("asset_type",p),e&&s.set("search",e);const{data:a}=await c.A.get("".concat(d.nC,"/market/pairs?").concat(s),{headers:{Authorization:"Bearer ".concat(_)}});t===A.current&&b(a.pairs||[])}catch(s){t===A.current&&b([])}t===A.current&&N(!1)},[p,_]);(0,a.useEffect)(()=>{b([]),f(""),k("")},[k]),(0,a.useEffect)(()=>{const e=setTimeout(()=>{g.length>=1&&k(g)},200);return()=>clearTimeout(e)},[g,k]),(0,a.useEffect)(()=>{const e=e=>{w.current&&!w.current.contains(e.target)&&(u(!1),f(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const C=e=>{s(e),f(""),u(!1)};return(0,o.jsxs)("div",{className:"relative",ref:w,"data-testid":"trading-pair-input",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 bg-slate-800/50 border border-white/10 rounded-md px-3 h-9 cursor-text ".concat(m||""),onClick:()=>{var e;null===(e=v.current)||void 0===e||e.focus(),u(!0)},children:[(0,o.jsx)(n.A,{className:"w-3.5 h-3.5 text-gray-500 shrink-0"}),(0,o.jsx)("input",{ref:v,value:h?g||"":t||"",onChange:e=>{const t=e.target.value.toUpperCase();f(t),h||u(!0)},onFocus:()=>u(!0),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),g&&(s(g.toUpperCase()),f(""),u(!1))),"Escape"===e.key&&(u(!1),f(""))},placeholder:t||x||"Search or type any pair...",className:"bg-transparent text-sm text-white flex-1 outline-none placeholder-gray-600 w-full","data-testid":"pair-search-input"}),t&&!h&&(0,o.jsx)(i.A,{className:"w-3.5 h-3.5 text-gray-500 hover:text-white cursor-pointer shrink-0",onClick:e=>{e.stopPropagation(),s(""),f("")}}),(0,o.jsx)(r.A,{className:"w-3.5 h-3.5 text-gray-500 shrink-0 transition-transform ".concat(h?"rotate-180":"")})]}),h&&(0,o.jsxs)("div",{className:"absolute z-50 mt-1 w-full max-h-64 overflow-y-auto bg-slate-900 border border-white/10 rounded-md shadow-xl","data-testid":"pair-dropdown",children:[g&&!j.find(e=>e.symbol===g)&&(0,o.jsxs)("div",{className:"px-3 py-2 flex items-center gap-2 hover:bg-slate-800 cursor-pointer border-b border-white/5",onClick:()=>C(g),"data-testid":"pair-custom-option",children:[(0,o.jsx)(l.A,{className:"w-3.5 h-3.5 text-cyan-400"}),(0,o.jsxs)("span",{className:"text-sm text-cyan-400",children:["Use custom pair: ",(0,o.jsx)("strong",{children:g})]})]}),y?(0,o.jsx)("div",{className:"px-3 py-4 text-xs text-gray-500 text-center",children:"Loading pairs..."}):0!==j.length||g?j.slice(0,30).map(e=>(0,o.jsxs)("div",{className:"px-3 py-2 flex items-center justify-between hover:bg-slate-800 cursor-pointer ".concat(e.symbol===t?"bg-slate-800/70":""),onClick:()=>C(e.symbol),"data-testid":"pair-option-".concat(e.symbol.replace(/\//g,"-")),children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-sm font-mono text-white",children:e.symbol}),(0,o.jsx)("span",{className:"text-xs text-gray-500",children:e.name})]}),e.quote&&(0,o.jsx)("span",{className:"text-[10px] text-gray-600",children:e.quote})]},e.symbol)):(0,o.jsx)("div",{className:"px-3 py-4 text-xs text-gray-500 text-center",children:"Type to search for any trading pair"})]})]})}}}]);
3//# sourceMappingURL=9803.abacf0cb.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.