PageSourceSearch

https://txm7.xyz/media/assets/app/dist/js/components/websockets/reconnecting-websocket-iife.min.js?fc9f269511

js txm7.xyz collected 2026-10-09 22:32:04 UTC 9,160 bytes, 1 lines download raw bytes

vendor: 5,224 bytes, line 1
1var ReconnectingWebSocket=function(){"use strict";function a(a,b){function d(){this.constructor=a}c(a,b),a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}function b(a,b){var c="function"==typeof Symbol&&a[Symbol.iterator];if(!c)return a;var d,e,f=c.call(a),g=[];try{for(;(void 0===b||b-- >0)&&!(d=f.next()).done;)g.push(d.value)}catch(a){e={error:a}}finally{try{d&&!d.done&&(c=f.return)&&c.call(f)}finally{if(e)throw e.error}}return g}var c=function(a,b){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,b)},d=function(){return function(a,b){this.target=b,this.type=a}}(),e=function(b){function c(a,c){var d=b.call(this,"error",c)||this;return d.message=a.message,d.error=a,d}return a(c,b),c}(d),f=function(b){function c(a,c,d){void 0===a&&(a=1e3),void 0===c&&(c="");var e=b.call(this,"close",d)||this;return e.wasClean=!0,e.code=a,e.reason=c,e}return a(c,b),c}(d),g=function(){if("undefined"!=typeof WebSocket)return WebSocket},h={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1};return function(){function a(a,b,c){var d=this;void 0===c&&(c={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(a){d._debug("open event");var b=d._options.minUptime,c=void 0===b?h.minUptime:b;clearTimeout(d._connectTimeout),d._uptimeTimeout=setTimeout(function(){return d._acceptOpen()},c),d._ws.binaryType=d._binaryType,d._messageQueue.forEach(function(a){return d._ws.send(a)}),d._messageQueue=[],d.onopen&&d.onopen(a),d._listeners.open.forEach(function(b){return d._callEventListener(a,b)})},this._handleMessage=function(a){d._debug("message event"),d.onmessage&&d.onmessage(a),d._listeners.message.forEach(function(b){return d._callEventListener(a,b)})},this._handleError=function(a){d._debug("error event",a.message),d._disconnect(void 0,"TIMEOUT"===a.message?"timeout":void 0),d.onerror&&d.onerror(a),d._debug("exec error listeners"),d._listeners.error.forEach(function(b){return d._callEventListener(a,b)}),d._connect()},this._handleClose=function(a){d._debug("close event"),d._clearTimeouts(),d._shouldReconnect&&d._connect(),d.onclose&&d.onclose(a),d._listeners.close.forEach(function(b){return d._callEventListener(a,b)})},this._url=a,this._protocols=b,this._options=c,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(a,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(a,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(a,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(a,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"CONNECTING",{get:function(){return a.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"OPEN",{get:function(){return a.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"CLOSING",{get:function(){return a.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"CLOSED",{get:function(){return a.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(a){this._binaryType=a,this._ws&&(this._ws.binaryType=a)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce(function(a,b){return"string"==typeof b?a+=b.length:b instanceof Blob?a+=b.size:a+=b.byteLength,a},0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?a.CLOSED:a.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),a.prototype.close=function(a,b){void 0===a&&(a=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(a,b):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},a.prototype.reconnect=function(a,b){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(a,b),this._connect()):this._connect()}
vendor: 3,936 bytes, line 1
1,a.prototype.send=function(a){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",a),this._ws.send(a);else{var b=this._options.maxEnqueuedMessages,c=void 0===b?h.maxEnqueuedMessages:b;this._messageQueue.length<c&&(this._debug("enqueue",a),this._messageQueue.push(a))}},a.prototype.addEventListener=function(a,b){this._listeners[a]&&this._listeners[a].push(b)},a.prototype.dispatchEvent=function(a){var b,c,d=this._listeners[a.type];if(d)try{for(var e=function(a){var b="function"==typeof Symbol&&a[Symbol.iterator],c=0;return b?b.call(a):{next:function(){return a&&c>=a.length&&(a=void 0),{value:a&&a[c++],done:!a}}}}(d),f=e.next();!f.done;f=e.next()){var g=f.value;this._callEventListener(a,g)}}catch(a){b={error:a}}finally{try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(b)throw b.error}}return!0},a.prototype.removeEventListener=function(a,b){this._listeners[a]&&(this._listeners[a]=this._listeners[a].filter(function(a){return a!==b}))},a.prototype._debug=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];this._options.debug&&console.log.apply(console,function(){for(var a=[],c=0;c<arguments.length;c++)a=a.concat(b(arguments[c]));return a}(["RWS>"],a))},a.prototype._getNextDelay=function(){var a=this._options,b=a.reconnectionDelayGrowFactor,c=void 0===b?h.reconnectionDelayGrowFactor:b,d=a.minReconnectionDelay,e=void 0===d?h.minReconnectionDelay:d,f=a.maxReconnectionDelay,g=void 0===f?h.maxReconnectionDelay:f,i=0;return this._retryCount>0&&(i=e*Math.pow(c,this._retryCount-1))>g&&(i=g),this._debug("next delay",i),i},a.prototype._wait=function(){var a=this;return new Promise(function(b){setTimeout(b,a._getNextDelay())})},a.prototype._getNextUrl=function(a){if("string"==typeof a)return Promise.resolve(a);if("function"==typeof a){var b=a();if("string"==typeof b)return Promise.resolve(b);if(b.then)return b}throw Error("Invalid URL")},a.prototype._connect=function(){var a=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var b=this._options,c=b.maxRetries,d=void 0===c?h.maxRetries:c,e=b.connectionTimeout,f=void 0===e?h.connectionTimeout:e,i=b.WebSocket,j=void 0===i?g():i;if(this._retryCount>=d)this._debug("max retries reached",this._retryCount,">=",d);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(k=j)||!k||2!==k.CLOSING)throw Error("No valid WebSocket class provided");var k;this._wait().then(function(){return a._getNextUrl(a._url)}).then(function(b){a._closeCalled||(a._debug("connect",{url:b,protocols:a._protocols}),a._ws=a._protocols?new j(b,a._protocols):new j(b),a._ws.binaryType=a._binaryType,a._connectLock=!1,a._addListeners(),a._connectTimeout=setTimeout(function(){return a._handleTimeout()},f))})}}},a.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new e(Error("TIMEOUT"),this))},a.prototype._disconnect=function(a,b){if(void 0===a&&(a=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(a,b),this._handleClose(new f(a,b,this))}catch(a){}}},a.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},a.prototype._callEventListener=function(a,b){"handleEvent"in b?b.handleEvent(a):b(a)},a.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},a.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},a.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},a}()}();

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.