PageSourceSearch

https://www.tapbit.com/_next_app/price/0.1.227/_next/static/chunks/9921-1c5d267dd1abcecd.js

js tapbit.com collected 2026-10-03 21:39:24 UTC 33,698 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a1673dc2-9d1d-4793-95c4-00fba6b22263",e._sentryDebugIdIdentifier="sentry-dbid-a1673dc2-9d1d-4793-95c4-00fba6b22263")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9921],{17883:(e,t,n)=>{n.d(t,{AG:()=>b,D2:()=>o,YV:()=>l,cL:()=>c,dl:()=>h,qG:()=>u,ql:()=>i,w0:()=>d,z6:()=>g});var r=n(52030);function s(e){let t=Number(e);return Number.isFinite(t)?t:0}function i(e){let t=String(e||"").toUpperCase();return!t||"CRYPTO"===t}function o(e){return!i(e)}function a(e){return"CME_FUTURE"===String(e||"").toUpperCase()}function l(e){return!!(null==e?void 0:e.pre)}function c(e){return o(null==e?void 0:e.contractScope)&&!a(null==e?void 0:e.contractScope)&&!l(e)}function u(e){return a(null==e?void 0:e.contractScope)&&!l(e)}function h(e){return!1!==e}function d(e){return(null==e?void 0:e.indexSourceNormal)===!1}function p(e){var t,n,r,i;return Array.isArray(e)?{quantityMin:s(e[0]),quantityMax:s(e[1]),levelMin:s(e[2]),levelMax:s(e[3]),mmr:null!=(t=e[4])?t:""}:{quantityMin:s(null!=(n=e.qtyMin)?n:e.quantityMin),quantityMax:s(null!=(r=e.qtyMax)?r:e.quantityMax),levelMin:s(e.levelMin),levelMax:s(e.levelMax),mmr:null!=(i=e.mmr)?i:""}}function m(e){var t,n,s,i,o,a,l,c,u,h,d,m,g,b,f,T,S;let y=null!=(n=null==(t=e.gl)?void 0:t.map(e=>({groupCode:e.gc,sort:e.st})))?n:[];return{symbol:null!=(s=e.s)?s:"",cmcSlug:e.slug,baseAsset:null!=(i=e.ba)?i:"",quoteAsset:null!=(o=e.qa)?o:"",multiplier:null!=(a=e.m)?a:"",minTradeAmount:null!=(l=e.mta)?l:"",maxTradeAmount:null!=(c=e.xta)?c:"",costPriceMultiplier:null!=(u=e.cpm)?u:"",minPriceChange:null!=(h=e.mpc)?h:"",precision:null!=(d=e.p)?d:0,maxLeverage:null!=(m=e.ml)?m:0,priceProtectRate:null!=(g=e.ppr)?g:"",special:null!=(b=e.sp)?b:0,baseAssetName:null!=(f=e.ban)?f:"",groupList:y,contractScope:e.cs,ban:e.ban,en:null!=(T=e.en)?T:"",pre:!!e.pre,rebaseStartTime:(0,r.EJ)(e.rbs),rebaseEndTime:(0,r.EJ)(e.rbe),tiers:(null!=(S=e.tl)?S:[]).map(p)}}function g(e){var t,n,r,s;let i=(null!=(n=e.list)?n:[]).map(m).filter(e=>e.symbol),o=null!=(r=null==(t=e.groupList)?void 0:t.map(e=>{var t;return{groupCode:e.gc,name:e.n,tag:e.tag,sort:e.st,showOnHome:null!=(t=e.soh)&&t}}))?r:[],a=i.reduce((e,t)=>(e[t.symbol]=t,e),{});return{hash:e.hash,siteConfig:null!=(s=e.config)?s:null,symbolsConfig:i,symbolsConfigBySymbol:a,contractGroupList:o}}function b(){return{loaded:!1,loading:!1,hash:void 0,siteConfig:null,symbolsConfig:[],symbolsConfigBySymbol:{},contractGroupList:[],lastUpdatedAt:void 0,locale:void 0,error:void 0}}},25825:(e,t,n)=>{n.d(t,{G:()=>r});let r=(0,n(41809).v)(e=>({socket:null,connecting:!1,connected:!1,reconnecting:!1,connectionFailed:!1,isLogged:!1,toSend:[],link:null,topicData:{},setSocket:t=>e({socket:t}),setConnecting:t=>e({connecting:t}),setConnected:t=>e({connected:t}),setReconnecting:t=>e({reconnecting:t}),setConnectionFailed:t=>e({connectionFailed:t}),setLogged:t=>e({isLogged:t}),addToSend:t=>e(e=>({toSend:[...e.toSend,t]})),clearToSend:()=>e({toSend:[]}),setCurrentSocketLink:t=>e({link:t}),setTopicData:(t,n)=>{t&&e(e=>({topicData:{...e.topicData,[t]:n}}))},resetTopicSnapshotState:t=>{let n=Array.from(new Set(t.filter(Boolean)));0!==n.length&&e(e=>{let t;return n.forEach(n=>{let r=e.topicData[n];!(!r||"object"!=typeof r||Array.isArray(r))&&Object.prototype.hasOwnProperty.call(r,"hasFullSnapshot")&&(null!=t||(t={...e.topicData}),t[n]={...r,isFull:!1,hasFullSnapshot:!1,updates:[]})}),t?{topicData:t}:e})}}))},52030:(e,t,n)=>{function r(e){let t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t<1e12?1e3*t:t}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=null==e?void 0:e.rebaseStartTime,r=null==e?void 0:e.rebaseEndTime;return n&&r&&!(r<=n)?t<n?"before":t<r?"executing":"ended":"none"}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=Math.max(0,Math.floor((e-t)/1e3)),r=Math.floor(n/86400),s=[Math.floor(n%86400/3600),Math.floor(n%3600/60),n%60].map(e=>"".concat(e).padStart(2,"0")).join(":");return"".concat(r,"D ").concat(s)}n.d(t,{EJ:()=>r,Ev:()=>s,X3:()=>i})}
1,62302:(e,t,n)=>{n.d(t,{W:()=>ek});var r=n(83449),s=n(69534),i=n(9238),o=n(51025),a=n(15698),l=n(63110),c=n(48996);function u(e){if(!e)return"";try{let t=new URL(e);return"".concat(t.protocol,"//").concat(t.host).concat(t.pathname)}catch(n){var t;return null!=(t=e.split("?")[0])?t:e}}let h={1e3:"Normal Closure",1001:"Going Away",1002:"Protocol Error",1003:"Unsupported Data",1005:"No Status Received",1006:"Abnormal Closure",1007:"Invalid Frame Payload Data",1008:"Policy Violation",1009:"Message Too Big",1010:"Mandatory Ext.",1011:"Internal Server Error",1012:"Service Restart",1013:"Try Again Later",1015:"TLS Handshake"};function d(e){return e.reason||h[e.code]||"Close code: ".concat(e.code)}function p(e){var t,n;null==(n=window.tracker)||null==(t=n.sendWsConnectErrorLog)||t.call(n,e)}function m(e){let{result:t,durationMs:n,errorMessage:r,url:s,...i}=e,o=u(s);return{code:"success"===t?200:-1,duration:n,value:o,message:null!=r?r:"",extra:{...i,url:o}}}function g(e){(0,c.TY)().send(m(e))}function b(e){(0,c.Vy)().send(m(e))}let f={normal:200,manual:1,anomaly:-1,heartbeat_stall:-2};class T{setSocket(e){this.socket=e,this.socketUrl=e.url||null}calculateReconnectDelay(){return Math.min(this.maxDelay,this.baseDelay*Math.pow(this.reconnectDelayFactor,this.reconnectAttempts)+this.jitter)}resetReconnectState(){this.isConnected&&(this.reconnectAttempts=0),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}heartStart(){this.clientCheckTimer=setTimeout(()=>{this.onSendPing(),this.startPingTimeout(),this.serverCheckTimer=setTimeout(()=>{var e;null==(e=this.onStall)||e.call(this),this.close()},this.serverCheckTime)},this.clientCheckTime)}startPingTimeout(){this.pingTimeoutTimer&&clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=setTimeout(()=>{var e;p({eventType:"WEBSOCKET_HEARTBEAT_TIMEOUT",url:(null==(e=this.socket)?void 0:e.url)||this.socketUrl,errorMessage:"Ping timeout: No pong received within ".concat(this.pingTimeoutTime,"ms")}),this.pingTimeoutTimer=null},this.pingTimeoutTime)}onPongReceived(){this.pingTimeoutTimer&&(clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null)}heartReset(){this.clearHeartbeatTimers(),this.heartStart()}clearHeartbeatTimers(){this.clientCheckTimer&&clearTimeout(this.clientCheckTimer),this.serverCheckTimer&&clearTimeout(this.serverCheckTimer)}clearAllTimers(){this.clearHeartbeatTimers(),this.pingTimeoutTimer&&(clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null)}reconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return void this.onConnectionFailed();this.reconnectAttempts++;let e=this.calculateReconnectDelay();this.reconnectTimer=setTimeout(()=>{this.onReconnect()},e)}cleanup(){this.clearAllTimers(),this.resetReconnectState(),this.isConnected=!1,this.socket=null}close(){this.socket&&(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING)&&this.socket.close(),this.cleanup(),this.reconnect()}onmessage(){this.heartReset()}onopen(){this.isConnected=!0,this.resetReconnectState(),this.heartStart()}onclose(){this.cleanup(),this.reconnect()}constructor(e={},t){this.socket=null,this.clientCheckTimer=null,this.serverCheckTimer=null,this.reconnectTimer=null,this.pingTimeoutTimer=null,this.reconnectAttempts=0,this.isConnected=!1,this.socketUrl=null,this.clientCheckTime=e.clientCheckTime||1e4,this.serverCheckTime=e.serverCheckTime||5e3,this.pingTimeoutTime=e.pingTimeoutTime||5e3,this.maxReconnectAttempts=e.maxReconnectAttempts||5,this.reconnectDelayFactor=e.reconnectDelayFactor||1.5,this.baseDelay=e.baseDelay||1e3,this.maxDelay=e.maxDelay||3e4,this.jitter=Math.floor(1e3*Math.random()),this.onSendPing=t.onSendPing,this.onReconnect=t.onReconnect,this.onConnectionFailed=t.onConnectionFailed,this.onStall=t.onStall}}var S=n(65036),y=n(15476),v=n(47913);async function k(e,t){var n;let r=s.xM.getItem("G_WS_ALG"),i=await (0,v.PL)(e),o=new URL(e);return o.searchParams.set("auth",null!=i?i:""),o.searchParams.set("necessary",null!=(n=(0,S.wZ)(r))?n:""),t||o.searchParams.set("compress","true"),o.toString()}async function w(e,t){var n,r,s,i;let o,a;try{o=await k(e.url,t.isDebugMode)}catch(t){throw Error("WebSocket connection init failed for ".concat(e.url))}try{a=new WebSocket(o)}catch(t){throw Error("WebSocket connection init failed for ".concat(e.url))}return n=a,r=e.link,s=e.url,i=t.timeoutMs,new Promise((e,t)=>
1{let o=null,a=!1,l=Date.now(),c=e=>{a||(a=!0,o&&(clearTimeout(o),o=null),n.onopen=null,n.onerror=null,n.onclose=null,e())};o=setTimeout(()=>{c(()=>{p({eventType:"WEBSOCKET_CONNECTION_FAILURE",url:s,code:0,errorMessage:"ws-connection-timeout"});try{n.readyState===WebSocket.CONNECTING&&n.close()}catch(e){console.warn("Failed to close timeout socket:",e)}t(Error("WebSocket connection timeout for ".concat(s)))})},i),n.onopen=()=>{c(()=>{e({socket:n,link:r,time:Date.now()-l,url:s})})},n.onerror=e=>{c(()=>{p({eventType:"WEBSOCKET_CONNECTION_FAILURE",url:s,code:"code"in e?Number(e.code||0):0,errorMessage:"ws-connection-failure"});try{n.close()}catch(e){console.warn("Failed to close error socket:",e)}t(Error("WebSocket connection failed for ".concat(s)))})},n.onclose=()=>{c(()=>{p({eventType:"WEBSOCKET_CONNECTION_FAILURE",url:s,code:0,errorMessage:"ws-connection-closed"}),t(Error("WebSocket connection closed for ".concat(s)))})}})}async function C(e){let t=Date.now(),n=(await (0,y.g0)()).map((e,t)=>({link:t+1,url:e})),r=n.map(t=>w(t,e)),s=await Promise.allSettled(r),i=s.filter(e=>"fulfilled"===e.status&&e.value.socket.readyState===WebSocket.OPEN).map(e=>e.value);if(0===i.length)return p({eventType:"WEBSOCKET_SPEED_TEST_FAILURE"}),g({result:"failed",durationMs:Date.now()-t,timeoutMs:e.timeoutMs,totalCandidates:n.length,successCount:0,failedCount:s.length,errorMessage:"no-available-socket-connections"}),null;let o=i.reduce((e,t)=>t.time<e.time?t:e);return i.filter(e=>e!==o).forEach(e=>{try{e.socket.close()}catch(e){console.warn("Failed to close unused socket:",e)}}),g({result:"success",durationMs:Date.now()-t,timeoutMs:e.timeoutMs,totalCandidates:n.length,successCount:i.length,failedCount:s.length-i.length,selectedLink:o.link,selectedDurationMs:o.time,url:o.url}),o}var E=n(25825);function N(e){return!!(e&&(e.startsWith("usdt/orderBook")||"usdt/user.account"===e))}function D(e){return e.startsWith("usdt/orderBook")?"orderBook":"account"}function M(){var e;let t=window.location.pathname.match(/\/futures\/(?:grid\/)?([^/?#]+)/);return(null==t||null==(e=t[1])?void 0:e.toUpperCase())||null}class A{setSocketUrl(e){this.socketUrl=e}startSubscribeMonitoring(e){e.forEach(e=>{N(e)&&(this.clearSubscribeMonitoring(e),this.subscribeTimes[e]=Date.now(),this.subscribeTimers[e]=setTimeout(()=>{let t=this.subscribeTimes[e];t&&(p({eventType:"WEBSOCKET_SUBSCRIBE_DELAY",topic:D(e),symbol:M(),timeA:t,timeB:Date.now(),serverTime:-1,url:this.socketUrl}),this.clearSubscribeMonitoring(e))},3e3))})}clearSubscribeMonitoring(e){this.subscribeTimers[e]&&(clearTimeout(this.subscribeTimers[e]),delete this.subscribeTimers[e]),delete this.subscribeTimes[e]}startDataDelayMonitoring(e,t){if(!N(e))return;this.clearDataDelayMonitoring(e);let n=Date.now();this.lastDataTimes[e]=n,this.lastServerTimes[e]=function(e,t){if(e.startsWith("usdt/orderBook")){var n;return Array.isArray(t.data)&&(null==(n=t.data[0])?void 0:n.timestamp)||null}return t.timestamp||null}(e,t),this.dataDelayTimers[e]=setTimeout(()=>{var t;let n=this.lastDataTimes[e];n&&(p({eventType:"WEBSOCKET_DATA_DELAY",topic:D(e),symbol:M(),timeA:n,timeB:Date.now(),serverTime:null!=(t=this.lastServerTimes[e])?t:null,url:this.socketUrl}),this.clearDataDelayMonitoring(e))},1e4)}clearDataDelayMonitoring(e){this.dataDelayTimers[e]&&(clearTimeout(this.dataDelayTimers[e]),delete this.dataDelayTimers[e]),delete this.lastDataTimes[e],delete this.lastServerTimes[e]}onTopicMessage(e,t){N(e)&&(this.clearSubscribeMonitoring(e),this.startDataDelayMonitoring(e,t))}clearTopics(e){e.forEach(e=>{this.clearSubscribeMonitoring(e),this.clearDataDelayMonitoring(e)})}clearAll(){this.clearTopics([...Object.keys(this.subscribeTimers),...Object.keys(this.subscribeTimes),...Object.keys(this.dataDelayTimers),...Object.keys(this.lastDataTimes)])}constructor(){this.socketUrl=null,this.subscribeTimers={},this.subscribeTimes={},this.dataDelayTimers={},this.lastDataTimes={},this.lastServerTimes={}}}let x=new A;class W{register(e){this.handlers.push(e),this.handlers.sort((e,t)=>(e.priority||999)-(t.priority||999))}registerAll(e){e.forEach(e=>this.register(e))}handle(e,t){let n=this.handlers.find(t=>t.matches(e));if(n)try{return n.handle(t),!0}catch(t){console.error("Error handling topic ".concat(e,":"),t)}return!1}getHandlers(){return[...this.handlers]}clear(){this.handlers=[]}constructor(){this.handlers=[]}}let G=new W;class _{matches(e){return!0}handle(e){console.warn("Unknown WebSocket topic:",e.topic,e)}constructor(){this.priority=999}}class F{matches(e){return e.startsWith("exchangeRate")}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r}=E.G.getState();r(t,n)}}class O{matches(e){return"spot/commonEvent"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r}=E.G.getState();r(t,n)}}var P=n(64951);
1function R(e,t,n,r,s){var i,o;let a=[];return n?a=[...t]:(a=[...e],t.forEach(e=>{let t=a.findIndex(t=>Number(t.price)===Number(e.price));-1===t?a.push(e):0===Number(e.quantity)?a.splice(t,1):a.splice(t,1,e)})),a=a.filter(e=>0!==Number(e.quantity)),a="bid"===r?a.sort((i="price",(e,t)=>Number(t[i])-Number(e[i]))).slice(0,s):a.sort((o="price",(e,t)=>Number(e[o])-Number(t[o]))).slice(0,s).reverse()}class U{matches(e){return e.startsWith("spot/orderBook.")}handle(e){var t,n;let{topic:r,action:s,data:i=[]}=e;if(!r)return;let o=Number(r.split(".")[2])||200,a="insert"===s,l=(null==(t=i[0])?void 0:t.asks)||[],c=(null==(n=i[0])?void 0:n.bids)||[],u=l.map(e=>({price:e[0],quantity:e[1],total:0})),h=c.map(e=>({price:e[0],quantity:e[1],total:0})),d=(0,P.u)(r),{setTopicData:p,topicData:m}=E.G.getState(),g=m[d]||{asks:[],bids:[]},b=g.asks||[],f=g.bids||[];p(d,{asks:R(b,u,a,"ask",o),bids:R(f,h,a,"bid",o)})}}let I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{o:String(e[0]||""),h:String(e[1]||""),l:String(e[2]||""),c:String(e[3]||""),v:String(e[4]||""),t:Number(e[5])||0}};function L(e){let{topic:t,data:n=[],action:r}=e;if(!t)return!1;let s={id:t,topic:t,full:"insert"===r,items:n.map(I),timestamp:Number(new Date)},{topicData:i,setTopicData:o}=E.G.getState(),a=function(e,t){var n,r;let{id:s,full:i,event:o,topic:a}=t.payload;if("subscribe"===o)return{[s]:{...e[s],...t.payload,id:s,topic:a||"",isFull:i,hasFullSnapshot:!1,updates:[],items:[]}};let l=((null==(n=e[s])?void 0:n.items)||[]).slice(),c=t.payload.items||[],u=[];if(i)u=[...c];else{for(let e of c){let t=function(e,t){for(let n=e.length-1;n>=0;n--)if(n<e.length&&e[n]&&t(e[n]))return n;return -1}(l,t=>t.t===e.t);t<0?l.push(e):l[t]={...l[t],...e}}u=[...l]}return{[s]:{...e[s],...t.payload,id:s,topic:a,isFull:i,hasFullSnapshot:i||(null==(r=e[s])?void 0:r.hasFullSnapshot)===!0,updates:i?[]:c,items:u,timestamp:Number(new Date)}}}(i[t]?{[t]:i[t]}:{},{payload:s});return!!a[t]&&(o(t,a[t]),!0)}class B{matches(e){return e.startsWith("spot/simple/kline.")}handle(e){L(e)}}var q=n(17883);function z(e){if(0===Number(e.o24)||0===Number(e.op))return"0.00";let t=(Number(e.lp)-Number(e.op))/Number(e.op);return isNaN(t)?"0.00":t.toFixed(4)}function H(e){if(0===Number(e.o24)||0===Number(e.op))return"0.00";let t=e.lp&&e.lp.split(".")||[],n=(t[1]?t[1]:"").length||4,r=Number(e.lp)-Number(e.op),s=isNaN(r)?0:r.toFixed(n),i=r>0?"+":"";return"".concat(i).concat(s)}function j(e){return{symbol:e.s,last:e.lp,open:e.op,low:e.l24,high:e.h24,volume:e.v24,change:z(e),absChange:H(e)}}function J(e){return{symbol:e.s,last:e.lp,markPrice:e.mp,indexPrice:e.ip,open:e.o24,low:e.l24,high:e.h24,volume:e.v24,oi:e.oi,usdtVolume:e.v24,fundingRate:e.fr,indexSourceNormal:(0,q.dl)(e.sts),change:z(e),absChange:H(e)}}class K{matches(e){return e.startsWith("spot/simple/ticker.")&&!e.endsWith(".all")}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let r=j(n[0]||{}),{setTopicData:s}=E.G.getState();s(t,r)}}class Y{matches(e){return e.startsWith("spot/simple/ticker.all")}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r,topicData:s}=E.G.getState(),i=s[t]||[],o=this.formatTickerData(n);r(t,this.mergeTickerData(i,o))}formatTickerData(e){return e.map(e=>j(e))}mergeTickerData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0===e.length?t:e.map(e=>t.find(t=>t.symbol===e.symbol)||e)}}class V{matches(e){return e.startsWith("spot/tradeList.")}handle(e){let{topic:t,action:n,data:r=[]}=e;if(!t)return;let s=r.map(e=>({price:e[0],quantity:e[2],time:e[3],side:"b"===e[1]?"buy":"sell"})),{topicData:i,setTopicData:o}=E.G.getState(),a=i[t]||[];o(t,"insert"===n?s.slice(0,49):[...s,...a].slice(0,49))}}class Z{matches(e){return"spot/user.chat"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{topicData:r,setTopicData:s}=E.G.getState(),i=[...r[t]||[],...n];s(t,i)}}class ${matches(e){return"spot/userEvent"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r}=E.G.getState();r(t,n)}}var X=n(42093),Q=n(38113),ee=n(70335);let et=function(e,t){let n=null;return function(){for(var r=arguments.length,s=Array(r),i=0;i<r;i++)s[i]=arguments[i];n&&clearTimeout(n),n=setTimeout(()=>{e(...s),n=null},t)}}(()=>
1{if("undefined"==typeof document||!function(){let e=window,t=Date.now(),n=Number(e.__tapbitUserTipSoundLastPlayedAt||0);return(!(n>0)||!(t-n<1e3))&&(e.__tapbitUserTipSoundLastPlayedAt=t,!0)}())return;let e=document.createElement("audio");e.id=String(Math.floor(800*Math.random()+100)),e.src="https://cdn.tapbit.mobi/static/sound/tip.mp3",e.preload="auto",e.onended=()=>{e.remove()},e.onerror=()=>{e.remove()};try{let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{e.remove()})}catch(t){e.remove()}},1e3);class en{matches(e){return"spot/user.tip"===e}handle(e){let t=Array.isArray(e.data)?e.data:[];(function(){try{var e;let t=s.Ay.getItem("contract_plan_notify")||"111";return!!Number(null!=(e=String(t)[2])?e:"1")}catch(e){return!0}})()&&0!==t.length&&t.forEach(e=>{"usdt"===e.bizType&&(et(),function(e){if("undefined"==typeof document)return;let t=window.matchMedia("(max-width: 767px)").matches,n=document.createElement("div");n.style.position="fixed",n.style.left="16px",n.style.right="auto",n.style.top="auto",n.style.bottom=t?"16px":"20px",n.style.zIndex="9999",n.style.margin="0",n.style.pointerEvents="none",document.body.appendChild(n);let r=(0,ee.createRoot)(n);r.render(Q.createElement("div",{className:"pointer-events-auto flex w-[380px] max-w-[calc(100vw-32px)] items-start gap-s2 rounded-r2 border border-l1 bg-m1 px-s4 py-s3 shadow-3"},Q.createElement(X.B,{className:"text-p2 mt-[1px] h-5 w-5 shrink-0"}),Q.createElement("div",{className:"min-w-0 flex-1"},Q.createElement("div",{className:"text-t14 text-t1 line-clamp-2 break-words font-medium whitespace-normal"},e.title||""),e.body?Q.createElement("div",{className:"text-c12 text-t2 mt-s1 line-clamp-3 break-words whitespace-normal"},e.body):null))),window.setTimeout(()=>{r.unmount(),n.remove()},3e3)}(e))})}}class er{matches(e){return"usdt/commonEvent"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r}=E.G.getState();r(t,n)}}class es{matches(e){return"usdt/config.frontCalc"===e}handle(e){let{topic:t,data:n={}}=e;if(!t)return;let{setTopicData:r}=E.G.getState();r(t,n)}constructor(){this.priority=10}}let ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{symbol:e.s||"",markPrice:e.mp||"",indexPrice:e.ip||"",indexSourceNormal:(0,q.dl)(e.sts)}};class eo{matches(e){return e.startsWith("usdt/indexPrice.")}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let r=ei((null==n?void 0:n[0])||{});if(!r.symbol)return;let{setTopicData:s}=E.G.getState();s(t,r)}constructor(){this.priority=10}}let ea=e=>({price:String(e[0]||""),quantity:String(e[1]||""),total:0});function el(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:200,i=[];n?i=[...t]:(i=[...e],t.forEach(e=>{let t=i.findIndex(t=>Number(t.price)===Number(e.price));-1===t?i.push(e):0===Number(e.quantity)?i.splice(t,1):i.splice(t,1,e)})),i="bid"===r?i.sort((e,t)=>Number(t.price)-Number(e.price)).slice(0,s):i.sort((e,t)=>Number(e.price)-Number(t.price)).slice(0,s).reverse(),"ask"===r&&i.reverse();let o=0;return i=i.map(e=>(o=Number(e.quantity)+Number(o),{...e,total:o})),"ask"===r&&i.reverse(),i}class ec{matches(e){return e.startsWith("usdt/orderBook.")}handle(e){let{data:t=[],action:n,topic:r,event:s}=e;if(!r)return;let i="insert"===n,o=t[0]||{},a=(o.asks||[]).map(ea),l=(o.bids||[]).map(ea),c=(0,P.u)(r),{topicData:u,setTopicData:h}=E.G.getState(),d=u[c]||{asks:[],bids:[]},p=d.asks||[],m=d.bids||[];h(c,{asks:el(p,a,i,"ask").filter(e=>Number(e.quantity)>0),bids:el(m,l,i,"bid").filter(e=>Number(e.quantity)>0)})}constructor(){this.priority=10}}class eu{matches(e){return e.startsWith("usdt/simple/kline.")}handle(e){L(e)}constructor(){this.priority=10}}class eh{matches(e){return e.startsWith("usdt/simple/markPrice.")}handle(e){L(e)}constructor(){this.priority=10}}class ed{matches(e){return e.startsWith("usdt/simple/ticker.")&&!e.endsWith(".all")}handle(e){let{topic:t,data:n=[],action:r}=e;if(!t)return;let s=n[0]||{},i=J(s);if(!i.symbol)return void console.warn("[UsdtSimpleTicker] 无效的ticker数据:",s);let{setTopicData:o}=E.G.getState();o(t,{...i,full:"insert"===r})}constructor(){this.priority=10}}class ep{matches(e){return e.startsWith("usdt/simple/ticker.all")}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let{setTopicData:r,topicData:s}=E.G.getState(),i=s[t]||[],o=this.formatTickerData(n);r(t,this.mergeTickerData(i,o))}formatTickerData(e){return e.map(e=>J(e))}mergeTickerData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0===e.length)return t;{let n=new Map;for(let e of t)n.set(e.symbol,e);return e.map(e=>{var t;return null!=(t=n.get(e.symbol))?t:e})}}}let em=e=>({price:String(e[0]||""),quantity:String(e[2]||""),time:Number(e[3])||0,side:"b"===e[1]?"buy":"sell"});class eg{matches(e){return e.startsWith("usdt/tradeList.")}handle(e){let{topic:t,data:n=[],action:r}=e;if(!t)return;let s=n.map(em),{setTopicData:i,topicData:o}=E.G.getState(),a=o[t]||[];i(t,"insert"===r?s.slice(0,49):[...s,...a].slice(0,49))}constructor(){this.priority=10}}class eb{matches(e){return"usdt/user.account"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let r=(null==n?void 0:n[0])||{},{setTopicData:s}=E.G.getState();s(t,r)}constructor(){this.priority=10}}class ef{matches(e){return"usdt/userEvent"===e}handle(e){let{topic:t,data:n=[]}=e;t&&E.G.getState().setTopicData(t,n)}constructor(){this.priority=10}}class eT{matches(e){return"usdt/user.kline"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let r=(null==n?void 0:n[0])||{},{setTopicData:s}=E.G.getState();s(t,r)}constructor(){this.priority=10}}class eS{matches(e){return"usdt/user.position"===e}handle(e){let{topic:t,data:n=[]}=e;if(!t)return;let r=n.filter(e=>"common"===e.tradeType),s=n.filter(e=>"trader"===e.tradeType),i=n.filter(e=>"follower"===e.tradeType),{setTopicData:o}=E.G.getState();o(t,{all:n,common:r,trader:s,follower:i})}constructor(){this.priority=10}}function ey(){G.clear();let e=function(){let e=[];return e.push(new Y),e.push(new ep),e.push(new O),e.push(new er),e.push(new Z),e.push(new $),e.push(new en),e.push(new F),e.push(new eb),e.push(new eT),e.push(new eS),e.push(new ef),e.push(new U),e.push(new V),e.push(new K),e.push(new B),e.push(new eo),e.push(new ec),e.push(new eu),e.push(new eh),e.push(new ed),e.push(new eg),e.push(new es),e.push(new _),e}();G.registerAll(e)}class ev{get isDebugMode(){let e=(0,i.$Z)("debug");return"string"==typeof e&&"true"===e}ensureTopicHandlersInitialized(){this.handlersInitialized||(ey(),this.handlersInitialized=!0)}async connect(){let{setConnecting:e,setConnected:t,setConnectionFailed:n,setSocket:r,setCurrentSocketLink:s}=E.G.getState();this.ensureTopicHandlersInitialized(),e(!0),t(!1),n(!1);try{let t=await this.getFastestSocket();if(!t)return e(!1),this.handleConnectionFailed(),null;let{socket:n,link:i}=t;
1return n.onclose=e=>{this.handleClose(e,n)},n.onmessage=e=>{this.heartCheck.onmessage(),this.handleMessage(e)},n.onerror=e=>{let t=e.type||"error";console.error("WebSocket error:",e),b({result:"failed",link:i,url:n.url,readyState:n.readyState,event:e.type,errorMessage:t})},this.sessionOpenedAt=Date.now(),this.sessionLink=i,this.pendingCloseReason=null,this.heartCheck.setSocket(n),this.heartCheck.onopen(),x.setSocketUrl(n.url||null),r(n),s(i),e(!1),this.onConnected(),n}catch(t){throw this.captureSocketError(t,"connect_failed"),e(!1),this.handleConnectionFailed(),t}}send(e){let{socket:t,addToSend:n}=E.G.getState();t&&t.readyState===WebSocket.OPEN?t.send(e):n(e)}sendBacklog(){let{socket:e,toSend:t,clearToSend:n}=E.G.getState();e&&t.length>0&&(t.forEach(t=>e.send(t)),n())}onConnected(){let{setReconnecting:e,setConnectionFailed:t,setConnected:n}=E.G.getState();e(!1),t(!1),n(!0),this.sendBacklog();let r=this.getActiveTopics(),s=this.getUniqueTopics([...this.pendingTopics,...r]).filter(e=>!this.subscribedTopics.has(e));s.length>0&&(this.subscribeToTopics(s),this.pendingTopics=this.pendingTopics.filter(e=>!s.includes(e)))}handleMessage(e){this.parseMessage(e.data).then(e=>{this.processMessage(e)}).catch(e=>{console.error("Error parsing message:",e)})}async parseMessage(e){if(e instanceof Blob)return new Promise((t,n)=>{try{let r=new FileReader;r?(r.addEventListener("loadend",()=>{if(r.result)try{let e=l.UD(r.result,{to:"string"});"ping"===e||"pong"===e?t(e):t(JSON.parse(e))}catch(e){try{let e=new TextDecoder().decode(r.result);"ping"===e||"pong"===e?t(e):t(JSON.parse(e))}catch(e){n(e)}}else n(Error("Failed to read blob data"))}),r.onerror=n,r.readAsArrayBuffer(e)):n(Error("FileReader not available"))}catch(n){t(e)}});if("string"!=typeof e)return e;if("ping"===e||"pong"===e)return e;try{return JSON.parse(e)}catch(t){return e}}processMessage(e){if(e){if("string"==typeof e&&"ping"===e)return void this.send("pong");if("string"==typeof e&&"pong"===e)return void this.heartCheck.onPongReceived();if("subscribe"!==e.event&&"unsubscribe"!==e.event){if("error"===e.event)return void this.handleError(e);e.topic&&this.handleTopicMessage(e.topic,e)}}}handleError(e){let t=e.code,n=E.G.getState(),{socket:r,link:s}=n;switch(b({result:"failed",link:null!=s?s:void 0,url:null==r?void 0:r.url,readyState:null==r?void 0:r.readyState,code:t,event:e.event,topic:e.topic,op:e.op,errorMessage:"WebSocket message error: ".concat(null!=t?t:"unknown")}),t){case 10510:case 10511:this.handleTokenInvalid();break;case 10514:var i;this.captureSocketError("WebSocket illegal connection","illegal_connection",{...{event:e.event,topic:e.topic,code:e.code,op:e.op,argsCount:null==(i=e.args)?void 0:i.length},algType:e.algType},n),this.handleWsIllegal(e);break;default:console.warn("Unhandled WebSocket error:",e)}}getSocketSentryContext(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.G.getState(),{socket:n,connecting:r,connected:s,reconnecting:i,connectionFailed:o,toSend:a,link:l}=t;return{...e,readyState:null==n?void 0:n.readyState,link:l,route:window.location.pathname,visibilityState:"undefined"==typeof document?void 0:document.visibilityState,online:"undefined"==typeof navigator?void 0:navigator.onLine,connecting:r,connected:s,reconnecting:i,connectionFailed:o,pendingTopicsCount:this.pendingTopics.length,subscribedTopicsCount:this.subscribedTopics.size,activeTopicsCount:this.getActiveTopics().length,toSendCount:a.length}}captureSocketError(e,t,n,s){a.Cp((0,r.iT)(e),{tags:{module:"websocket-connection",action:t},extra:this.getSocketSentryContext({...n,errorMessage:(0,r.o_)((0,r.u1)(e))},s)})}handleTokenInvalid(){o.k.getState().refreshToken()}handleWsIllegal(e){let{algKey:t,algType:n}=e;s.xM.setItem("G_WS_ALG",{algKey:t,algType:n})}handleTopicMessage(e,t){x.onTopicMessage(e,t),G.handle(e,t)||console.warn("No handler found for WebSocket topic:",e,t)}handleClose(e,t){let{socket:n,setSocket:r,setReconnecting:s,setConnected:i}=E.G.getState(),o=this.manuallyClosedSockets.has(t);if(n!==t){o&&this.manuallyClosedSockets.delete(t);return}let a=o?"manual":"heartbeat_stall"===this.pendingCloseReason?"heartbeat_stall":e.wasClean&&1e3===e.code?"normal":"anomaly",{durationMs:l,closeType:h,url:m,link:g,wsCode:b,wasClean:T,message:S}={durationMs:null===this.sessionOpenedAt?void 0:Date.now()-this.sessionOpenedAt,closeType:a,url:t.url,link:this.sessionLink,wsCode:e.code,wasClean:e.wasClean,message:d(e)},y=u(m);if((0,c.aW)().send({code:f[h],duration:l,value:y,message:null!=S?S:"",extra:{closeType:h,link:g,wsCode:b,wasClean:T,url:y}}),this.sessionOpenedAt=null,this.sessionLink=null,this.pendingCloseReason=null,o||e.wasClean||1e3===e.code||p({eventType:"WEBSOCKET_DISCONNECT_ANOMALY",url:t.url,code:e.code,errorMessage:d(e)}),r(null),i(!1),this.subscribedTopics.clear(),o){this.manuallyClosedSockets.delete(t),s(!1),this.heartCheck.cleanup();return}s(!0),this.heartCheck.onclose()}handleConnectionFailed(){let{setConnectionFailed:e,setReconnecting:t,setConnected:n}=E.G.getState();t(!1),e(!0),n(!1)}sendPing(){this.send("ping")}reconnect(){let{setReconnecting:e}=E.G.getState();e(!0),setTimeout(()=>{this.connect().catch(e=>{console.error("WebSocket reconnect failed:",e),this.captureSocketError(e,"reconnect_failed"),this.handleConnectionFailed()})},2e3)}getFastestSocket(){return C({isDebugMode:this.isDebugMode,timeoutMs:this.socketProbeTimeoutMs})}reinitializeHandlers(e){ey(),this.handlersInitialized=!0,this.updateSubscriptions(e)}getSubscribedTopics(){return Array.from(this.subscribedTopics)}prepareTopicSnapshotState(e){let t=this.getUniqueTopics(e).filter(e=>!this.subscribedTopics.has(e));E.G.getState().resetTopicSnapshotState(t)}getTopicStatus(e){var t,n;let{socket:r,topicData:s}=E.G.getState(),i=!!r&&r.readyState===WebSocket.OPEN,o=this.subscribedTopics.has(e)?"subscribed":this.pendingTopics.includes(e)?"pending":"unsubscribed",a=null==s?void 0:s[e],l=!!a,c=(null==a?void 0:a.hasFullSnapshot)===!0;return{topic:e,subscribeState:o,refCount:null!=(t=this.topicSubscriptionCounts.get(e))?t:0,hasData:l,isReady:c,connected:i,url:null!=(n=null==r?void 0:r.url)?n:null,phase:c?"ready":"unsubscribed"===o?"unsubscribed":"pending"===o?"pending":"subscribed"}}getUniqueTopics(e){return Array.from(new Set(e.filter(Boolean)))}getActiveTopics(){return Array.from(this.topicSubscriptionCounts.entries()).filter(e=>{let[,t]=e;return t>0}).map(e=>{let[t]=e;return t})}subscribeToTopics(e){e.length>0&&(E.G.getState().resetTopicSnapshotState(e),this.send(JSON.stringify({op:"subscribe",args:e}
1)),x.startSubscribeMonitoring(e),e.forEach(e=>this.subscribedTopics.add(e)))}unsubscribeFromTopics(e){e.length>0&&(this.send(JSON.stringify({op:"unsubscribe",args:e})),x.clearTopics(e),e.forEach(e=>this.subscribedTopics.delete(e)))}subscribe(e){let{socket:t}=E.G.getState(),n=this.getUniqueTopics(e),r=[];n.forEach(e=>{let t=this.topicSubscriptionCounts.get(e)||0;this.topicSubscriptionCounts.set(e,t+1),this.subscribedTopics.has(e)||this.pendingTopics.includes(e)||r.push(e)}),0!==r.length&&(t&&t.readyState===WebSocket.OPEN?this.subscribeToTopics(r):this.pendingTopics=[...new Set([...this.pendingTopics,...r])])}unsubscribe(e){let{socket:t}=E.G.getState(),n=this.getUniqueTopics(e),r=[];n.forEach(e=>{let t=this.topicSubscriptionCounts.get(e)||0;if(!(t<=0)){if(t>1)return void this.topicSubscriptionCounts.set(e,t-1);this.topicSubscriptionCounts.delete(e),this.pendingTopics=this.pendingTopics.filter(t=>t!==e),this.subscribedTopics.has(e)&&r.push(e)}}),0!==r.length&&(t&&t.readyState===WebSocket.OPEN?this.unsubscribeFromTopics(r):(r.forEach(e=>this.subscribedTopics.delete(e)),x.clearTopics(r)))}updateSubscriptions(e){let t=this.getUniqueTopics(e),n=new Set(t),r=this.getActiveTopics(),s=t.filter(e=>!this.topicSubscriptionCounts.has(e)),i=r.filter(e=>!n.has(e));i.length>0&&(i.forEach(e=>this.topicSubscriptionCounts.set(e,1)),this.unsubscribe(i)),s.length>0&&this.subscribe(s)}disconnect(){let{socket:e}=E.G.getState();e&&(this.manuallyClosedSockets.add(e),e.close()),this.heartCheck.cleanup(),x.clearAll(),x.setSocketUrl(null)}constructor(){this.pendingTopics=[],this.subscribedTopics=new Set,this.topicSubscriptionCounts=new Map,this.handlersInitialized=!1,this.socketProbeTimeoutMs=5e3,this.manuallyClosedSockets=new WeakSet,this.sessionOpenedAt=null,this.sessionLink=null,this.pendingCloseReason=null,this.heartCheck=new T({},{onSendPing:this.sendPing.bind(this),onReconnect:this.reconnect.bind(this),onConnectionFailed:this.handleConnectionFailed.bind(this),onStall:()=>{this.pendingCloseReason="heartbeat_stall"}})}}let ek=new ev},64951:(e,t,n)=>{n.d(t,{u:()=>s});let r=/^(spot|usdt)\/orderBook\.([^.]+)(?:\.(\d+))?$/;function s(e){let t=e.match(r);if(!t)return e;let n=t[1],s=t[2];return"".concat(n,"/orderBook.").concat(s)}},83449:(e,t,n)=>{function r(e){return e instanceof Error?e.message:String(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return e.length<=t?e:"".concat(e.slice(0,t),"...")}function i(e){return e instanceof Error?e:Error(r(e))}n.d(t,{iT:()=>i,o_:()=>s,u1:()=>r})}}]);

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.