PageSourceSearch

https://cdn-mp.dmarket.com/prod/static/chunk-TZU2NBVH-EOPSRFLP.js

js dmarket.com collected 2026-10-01 11:57:44 UTC 9,092 bytes, 1 lines download raw bytes

1import{a as b,b as v}from"./chunk-AX37GTZI.js";import{b as $}from"./chunk-S46OKC2S.js";import{Ca as N,Qa as P,Rb as U}from"./chunk-JNGJABXR.js";import{h as x}from"./chunk-LC35BJX7.js";import{N as R,Pa as O,Qa as A,R as F,Sa as I,be as m,r as k,sa as f,u as T,xa as d,y as M}from"./chunk-YO2RX74J.js";import{a as S,b as w,i as l}from"./chunk-CJN3JB5D.js";var C=(function(s){return s.LiveFeedEvent="ItemSold",s.EthGasPriceRate="EthGasPriceRate",s.Online="online",s.History="HistoryUpdatedMessage",s.Balance="BalanceUpdatedMessage",s.InstantPriceChanged="InstantPriceChangedMessage",s.InstantPriceUnavailable="InstantPriceUnavailableMessage",s.AccountUpdatedMessage="AccountUpdatedMessage",s.MoneyMessage="MoneyMessage",s.FeedCreatedMessage="FeedCreatedMessage",s.FeedUpdatedMessage="FeedUpdatedMessage",s.DepositForceRematchMessage="DepositForceRematchMessage",s.Stream="stream",s.InventoryBlacklisted="InventoryBlacklisted",s.Kyc="Kyc",s.TransferStatusChanged="TransferStatusChanged",s.Chatbot="aichat:user",s})(C||{});var a=(function(s){return s.Private="private",s.Public="public",s})(a||{}),h=(function(s){return s.General="general",s})(h||{});var L=(()=>{class s extends v{constructor(){super(b.CentrifugoAuth),this.http=d(x)}getGeneralPrivateConnectionJwtToken(e){let t=`${this.rootPath}/generate`;return this.http.post(t,{},{headers:e?{"X-Client-Type":"web","X-Client-App-Version":e.client_version??"",[P]:e[P]??""}:{}})}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var u=(function(s){return s.Public="public",s.Message="message",s.EthGasPriceRate="ethGasPriceRate",s.Kyc="kycFeed",s.Overmind="overmind",s})(u||{});var E=3,j=500,G="https://cdn-mp.dmarket.com/prod/v2-97-17/assets/proto-files/",W=(()=>{class s{constructor(){this.#s=d(A),this.protoFilesNames={[u.Public]:"public",[u.Message]:"message",[u.EthGasPriceRate]:"eth-gas-price-rate",[u.Kyc]:"kyc_feed",[u.Overmind]:"overmind"},this.protoDecoders={[u.Public]:void 0,[u.Message]:void 0,[u.EthGasPriceRate]:void 0,[u.Kyc]:void 0,[u.Overmind]:void 0}}#s;initProtoDecoders(){return l(this,null,function*(){let[{default:e},{default:t},{default:i}]=yield Promise.all([import("./chunk-U6I6VRFT.js"),import("./chunk-UZWJ7VYY.js"),import("./chunk-JIACUW4Z.js")]);i.util.Long=e,i.configure();let o=Object.keys(this.protoFilesNames),n=[];for(let r=0;r<E;r++){if(r>0){let c=j*N**(r-1);yield new Promise(p=>setTimeout(p,c))}if(n=yield this.#t(t,o,r===E-1),o=o.filter(c=>this.protoDecoders[c]===null),!o.length)return}this.#s.handleError(new Error(`Error loading proto files after ${E} attempts: ${n.join(", ")}`))})}decodeMessage(e,t,i){let o=this.protoDecoders[e.decoderType];if(o!=null){let n=e.messageProtoName||e.channel,c=o.lookupType(this.removeMessageNamespace(n)).decode(t);i?i(c):console.warn(`The event from ${e.channel} is got, but the callback handler is not defined.`)}}encodeMessage(e,t){let i=this.protoDecoders[e.decoderType];if(i){let o=e.encodeProtoName||e.channel;return i.lookupType(this.removeMessageNamespace(o)).encode(t).finish()}return null}removeMessageNamespace(e){let t=e.split(":");return t[t.length-1]}#t(e,t,i=!1){return l(this,null,function*(){let o=new e.Root;o.resolvePath=(r,c)=>{let p=G+c;return i&&U(p)||p};let n=[];return yield Promise.all(t.map(r=>l(this,null,function*(){try{this.protoDecoders[r]=yield e.load(this.protoFilesNames[r]+".proto",o)}catch(c){n.push(`${r} (${c instanceof Error?c.message:String(c)})`),this.protoDecoders[r]=null}}))),n})}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var g=s=>`${s.channel.channel}|${s.wsAuthType}|${s.wsConnectionKey}`,H=["publication","error","subscribed","unsubscribed"],ge=(()=>{class s extends v{#s;#t;#e;constructor(){super(b.Websocket),this.zone=d(O),this.protobufService=d(W),this.centrifugeApiService=d(L),this.#s=d($),this.privateConnectionsInitiated=I(!1),this.#e=[],this.wsConnection={[a.Public]:{[h.General]:void 0},[a.Private]:{[h.General]:void 0}},this.channelSubscriptions={[a.Public]:{[h.General]:[]},[a.Private]:{[h.General]:[]}},this.wsConnectionEndpoints={[h.General]:this.#s.getValue("wssUrl")+"connection/websocket"}}initConnection(e,t){return l(this,null,function*(){let i=yield this.#o();
1Object.keys(this.wsConnection[e]).forEach(n=>{if(!this.getWsConnection(e,n)){let r=this.wsConnectionEndpoints[n];if(!this.#n(r))throw new Error(`Centrifuge endpoint is not a valid ws(s) URL: ${JSON.stringify(r)}`);this.wsConnection[e][n]=this.setUpCentrifugeConnection(i,r,e,t),this.wsConnection?.[e]?.[n]?.connect(),this.wsHandlers(n,e)}this.#c(e,n)})})}#o(){return this.#t??=import("./chunk-JSQJPYIX.js").then(e=>e.Centrifuge),this.#t}#n(e){return typeof e=="string"&&/^wss?:\/\/.+/.test(e)}disconnectPrivateWs(){Object.keys(this.wsConnection[a.Private]).forEach(t=>{this.wsConnection[a.Private][t]!==void 0&&(this.wsConnection?.[a.Private]?.[t]?.disconnect(),this.wsConnection[a.Private][t]=void 0)})}subscribeToChannels(e,t,i){return l(this,null,function*(){if(!e.length||!this.#t)return;yield this.#t,this.getRequiredWsConnectionKeysForChannelsList(e,t).forEach(n=>{this.wsConnection[t][n]&&this.getChannelsForRequiredConnection(e,n).forEach(c=>this.subscribeToChannel(c,t,n,i))}),t===a.Private&&this.privateConnectionsInitiated.set(!0)})}fetchChannelHistory(e,t=null){let i=t;t||(i=(this.channelSubscriptions[e.authType][e.socketConnection]??[]).find(n=>n.channel===e.channel)?.subscription??null),i?.history(e.historyOptions??{}).then(o=>{o.publications.forEach(n=>this.protobufService.decodeMessage(e,n.data,e.callback))}).catch(o=>{console.warn(`${i?.channel} history error`,o)})}wsHandlers(e,t){this.wsConnection?.[t]?.[e]?.on("disconnected",i=>{i||this.cleanWsConnection(e,t)})}cleanWsConnection(e,t){this.channelSubscriptions?.[t]?.[e]&&this.unsubscribeFromEvents(this.channelSubscriptions[t][e]),this.channelSubscriptions[t][e]=[]}unsubscribeFromEvents(e){e&&e.length&&e.forEach(t=>{t.subscription.unsubscribe(),t.subscription.removeAllListeners()})}subscribeToChannel(e,t,i,o){this.zone.runOutsideAngular(()=>{let n=this.buildChannelName(e.channel,e.uidRequired===!1?"":o??"",e.authType,e?.skipPrivateNamespace??!1),r=this.getWsConnection(t,i);if(!r){this.#r({channel:e,wsAuthType:t,wsConnectionKey:i,userId:o});return}let c=r.getSubscription(n);if(c)c.state==="unsubscribed"&&(this.channelSubscriptions?.[e.authType]?.[i]?.push({channel:e.channel,subscription:c}),H.forEach(p=>c.removeAllListeners(p)),this.#i(c,e),c.subscribe(),e.historyOptions&&Object.values(e.historyOptions).length&&this.fetchChannelHistory(e,c));else{let p=new TextEncoder().encode(JSON.stringify(e?.data??{})),y=r.newSubscription(n,{data:p,maxResubscribeDelay:5e3});this.channelSubscriptions?.[e.authType]?.[i]?.push({channel:e.channel,subscription:y}),this.#i(y,e),y.subscribe()}})}#i(e,t){e.on("publication",i=>{this.protobufService.decodeMessage(t,i.data,t.callback)}),e.on("error",i=>m()&&console.error("subscription error",t,i)),e.on("subscribed",i=>{m()&&console.info("subscribed",i.channel),t.subscribedCallback&&this.protobufService.decodeMessage(t,i.data,t.subscribedCallback),t.historyOptions&&this.fetchChannelHistory(t)}),e.on("unsubscribed",i=>m()&&console.info("unsubscribed",i))}#r(e){this.#e.some(t=>g(t)===g(e))||this.#e.push(e)}#c(e,t){let i=this.#e.filter(o=>o.wsAuthType===e&&o.wsConnectionKey===t);this.#e=this.#e.filter(o=>!i.includes(o)),i.forEach(o=>this.subscribeToChannel(o.channel,o.wsAuthType,o.wsConnectionKey,o.userId))}unsubscribeFromChannel(e){let t=g({channel:e,wsAuthType:e.authType,wsConnectionKey:e.socketConnection});this.#e=this.#e.filter(n=>g(n)!==t);let i=this.channelSubscriptions[e.authType]?.[e.socketConnection],o=i?.findIndex(n=>n.channel===e.channel)??-1;o>=0&&(i?.[o]?.subscription?.unsubscribe(),i?.splice(o,1))}buildChannelName(e,t,i,o){let n=o?"":`${a.Private}:`;return i===a.Private?`${n}${e}${t&&e!==C.Online?"#"+t:""}`:`${a.Public}:${e}`}getWsConnection(e,t){return this.wsConnection[e][t]}getAllWsConnectionKeysByAuthType(e){return Object.keys(this.wsConnection[e])}getRequiredWsConnectionKeysForChannelsList(e,t){return this.getAllWsConnectionKeysByAuthType(t).filter(o=>e.find(n=>n.socketConnection===o))}getChannelsForRequiredConnection(e,t){return e.filter(i=>i.socketConnection===t)}setUpCentrifugeConnection(e,t,i,o){let n={debug:!1,maxServerPingDelay:5e3,maxReconnectDelay:5e3,minReconnectDelay:1e3,t
1imeout:5e3};return i===a.Public?new e(t,n):new e(t,w(S({},n),{getToken:()=>T(this.centrifugeApiService.getGeneralPrivateConnectionJwtToken(o).pipe(F(1),M(r=>r?.token),R(r=>k(()=>r))))}))}sendMessage(e,t,i,o){let n=this.getWsConnection(i,o),r=this.protobufService.encodeMessage(e,t);return n?.rpc(e.channel,r)}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var _=(function(s){return s[s.OnWsConnection=0]="OnWsConnection",s[s.Custom=1]="Custom",s})(_||{});export{C as a,u as b,_ as c,a as d,h as e,W as f,ge as g};

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.