@quotemedia.com/streamer 2.55.0 → 2.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/enduser-example.html +1 -1
- package/examples/enterprise-token-example.html +1 -1
- package/examples/reconnect-example.html +1 -1
- package/examples/stomp-3rd-party-library-example.html +1 -1
- package/examples/subscription-example.html +1 -1
- package/examples/wmid-example.html +1 -1
- package/package.json +1 -1
- package/{qmci-streamer-2.55.0.js → qmci-streamer-2.56.0.js} +1 -1
- package/{qmci-streamer-2.55.0.min.js → qmci-streamer-2.56.0.min.js} +1 -1
package/package.json
CHANGED
|
@@ -15570,7 +15570,7 @@ exports.__esModule = true;
|
|
|
15570
15570
|
*/
|
|
15571
15571
|
|
|
15572
15572
|
var LIBRARY_NAME = exports.LIBRARY_NAME = "JavaScript";
|
|
15573
|
-
var VERSION = exports.VERSION = "2.
|
|
15573
|
+
var VERSION = exports.VERSION = "2.56.0";
|
|
15574
15574
|
|
|
15575
15575
|
/**
|
|
15576
15576
|
* Streamer API namespace.
|
|
@@ -44,7 +44,7 @@ D(460,"Websocket error")};o.onclose=function(e){if(y("websocket.onclose"),clearT
|
|
|
44
44
|
Copyright (C) 2010-2013 [Jeff Mesnil](http://jmesnil.net/)
|
|
45
45
|
Copyright (C) 2012 [FuseSource, Inc.](http://fusesource.com)
|
|
46
46
|
*/
|
|
47
|
-
(function(){var b,r,E,l,o={}.hasOwnProperty,s=[].slice;b={LF:"\n",NULL:"\0"},E=function(){var s;function g(e,t,n){this.command=e,this.headers=null!=t?t:{},this.body=null!=n?n:""}return g.prototype.toString=function(){var e,t,n,r,i;for(t in(n=!(e=[this.command])===this.headers["content-length"])&&delete this.headers["content-length"],i=this.headers)o.call(i,t)&&(r=i[t],e.push(t+":"+r));return this.body&&!n&&e.push("content-length:"+g.sizeOfUTF8(this.body)),e.push(b.LF+this.body),e.join(b.LF)},g.sizeOfUTF8=function(e){return e?encodeURI(e).match(/%..|./g).length:0},s=function(e){var t,n,r,i,o,s,a,u,l,c,f,d,p,h,m,E,_;for(i=e.search(RegExp(""+b.LF+b.LF)),r=(o=e.substring(0,i).split(b.LF)).shift(),s={},d=function(e){return e.replace(/^\s+|\s+$/g,"")},p=0,m=(E=o.reverse()).length;p<m;p++)u=(c=E[p]).indexOf(":"),s[d(c.substring(0,u))]=d(c.substring(u+1));if(t="",f=i+2,s["content-length"])l=parseInt(s["content-length"]),t=(""+e).substring(f,f+l);else for(n=null,a=h=f,_=e.length;(f<=_?h<_:_<h)&&(n=e.charAt(a))!==b.NULL;a=f<=_?++h:--h)t+=n;return new g(r,s,t)},g.unmarshall=function(i){var o;return function(){var e,t,n,r;for(r=[],e=0,t=(n=i.split(RegExp(""+b.NULL+b.LF+"*"))).length;e<t;e++)0<(null!=(o=n[e])?o.length:void 0)&&r.push(s(o));return r}()},g.marshall=function(e,t,n){return new g(e,t,n).toString()+b.NULL},g}(),r=function(){var m;function e(e){this.ws=e,this.ws.binaryType="arraybuffer",this.counter=0,this.connected=!1,this.heartbeat={outgoing:1e4,incoming:1e4},this.maxWebSocketFrameSize=16384,this.subscriptions={}}return e.prototype.debug=function(e){var t;return"undefined"!=typeof window&&null!==window&&null!=(t=window.console)?t.log(e):void 0},m=function(){return Date.now?Date.now():(new Date).valueOf},e.prototype._transmit=function(e,t,n){var r;for(r=E.marshall(e,t,n),"function"==typeof this.debug&&this.debug(">>> "+r);;){if(!(r.length>this.maxWebSocketFrameSize))return this.ws.send(r);this.ws.send(r.substring(0,this.maxWebSocketFrameSize)),r=r.substring(this.maxWebSocketFrameSize),"function"==typeof this.debug&&this.debug("remaining = "+r.length)}},e.prototype._setupHeartbeat=function(i){var e,t,n,o,r,s,a,u;if((r=i.version)===l.VERSIONS.V1_1||r===l.VERSIONS.V1_2)return t=(s=function(){var e,t,n,r;for(r=[],e=0,t=(n=i["heart-beat"].split(",")).length;e<t;e++)o=n[e],r.push(parseInt(o));return r}())[0],e=s[1],0!==this.heartbeat.outgoing&&0!==e&&(n=Math.max(this.heartbeat.outgoing,e),"function"==typeof this.debug&&this.debug("send PING every "+n+"ms"),this.pinger=l.setInterval(n,(a=this,function(){return a.ws.send(b.LF),"function"==typeof a.debug?a.debug(">>> PING"):void 0}))),0!==this.heartbeat.incoming&&0!==t?(n=Math.max(this.heartbeat.incoming,t),"function"==typeof this.debug&&this.debug("check PONG every "+n+"ms"),this.ponger=l.setInterval(n,(u=this,function(){var e;if(e=m()-u.serverActivity,2*n<e)return"function"==typeof u.debug&&u.debug("did not receive server activity for the last "+e+"ms"),u.ws.close()}))):void 0},e.prototype._parseConnect=function(){var e,t,n,r;switch(r={},(e=1<=arguments.length?s.call(arguments,0):[]).length){case 2:r=e[0],t=e[1];break;case 3:e[1]instanceof Function?(r=e[0],t=e[1],n=e[2]):(r.login=e[0],r.passcode=e[1],t=e[2]);break;case 4:r.login=e[0],r.passcode=e[1],t=e[2],n=e[3];break;default:r.login=e[0],r.passcode=e[1],t=e[2],n=e[3],r.host=e[4]}return[r,t,n]},e.prototype.connect=function(){var e,p,t,n,h,r,i;return e=1<=arguments.length?s.call(arguments,0):[],n=this._parseConnect.apply(this,e),t=n[0],this.connectCallback=n[1],p=n[2],"function"==typeof this.debug&&this.debug("Opening Web Socket..."),this.ws.onmessage=(h=this,function(e){var r,i,t,n,o,s,a,u,l,c,f,d;if(n="undefined"!=typeof ArrayBuffer&&e.data instanceof ArrayBuffer?(r=new Uint8Array(e.data),"function"==typeof h.debug&&h.debug("--- got data length: "+r.length),function(){var e,t,n;for(n=[],e=0,t=r.length;e<t;e++)i=r[e],n.push(String.fromCharCode(i));return n}().join("")):e.data,h.serverActivity=m(),n!==b.LF){for("function"==typeof h.debug&&h.debug("<<< "+n),d=[],l=0,c=(f=E.unmarshall(n)).length;l<c;l++)switch((o=f[l]).command){case"CONNECTED":"function"==typeof h.debug&&h.debug("connected to server "+o.headers.server),h.connected=!0,h._setupHeartbeat(o.headers),d.push("function"==typeof h.connectCallback?h.connectCallback(o):void 0);break;case"MESSAGE":u=o.headers.subscription,(a=h.subscriptions[u]||h.onreceive)?(t=h,s=o.headers["message-id"],o.ack=function(e){return null==e&&(e={}),t.ack(s,u,e)},o.nack=function(e){return null==e&&(e={}),t.nack(s,u,e)},d.push(a(o))):d.push("function"==typeof h.debug?h.debug("Unhandled received MESSAGE: "+o):void 0);break;case"RECEIPT":d.push("function"==typeof h.onreceipt?h.onreceipt(o):void 0);break;case"ERROR":d.push("function"==typeof p?p(o):void 0);break;default:d.push("function"==typeof h.debug?h.debug("Unhandled frame: "+o):void 0)}return d}"function"==typeof h.debug&&h.debug("<<< PONG")}),this.ws.onclose=(r=this,function(){var e;return e="Whoops! Lost connection to "+r.ws.url,"function"==typeof r.debug&&r.debug(e),r._cleanUp(),"function"==typeof p?p(e):void 0}),this.ws.onopen=(i=this,function(){return"function"==typeof i.debug&&i.debug("Web Socket Opened..."),t["accept-version"]=l.VERSIONS.supportedVersions(),t["heart-beat"]=[i.heartbeat.outgoing,i.heartbeat.incoming].join(","),i._transmit("CONNECT",t)})},e.prototype.disconnect=function(e,t){return null==t&&(t={}),this._transmit("DISCONNECT",t),this.ws.onclose=null,this.ws.close(),this._cleanUp(),"function"==typeof e?e():void 0},e.prototype._cleanUp=function(){if(this.connected=!1,this.pinger&&l.clearInterval(this.pinger),this.ponger)return l.clearInterval(this.ponger)},e.prototype.sendCustomFrame=function(e,t,n,r){return null==n&&(n={}),null==r&&(r=""),n.destination=e,this._transmit(t,n,r)},e.prototype.send=function(e,t,n){return null==t&&(t={}),null==n&&(n=""),t.destination=e,this._transmit("SEND",t,n)},e.prototype.subscribe=function(e,t,n){var r;return null==n&&(n={}),n.id||(n.id="sub-"+this.counter++),n.destination=e,this.subscriptions[n.id]=t,this._transmit("SUBSCRIBE",n),r=this,{id:n.id,unsubscribe:function(){return r.unsubscribe(n.id)}}},e.prototype.unsubscribe=function(e){return delete this.subscriptions[e],this._transmit("UNSUBSCRIBE",{id:e})},e.prototype.begin=function(e){var t,n;return n=e||"tx-"+this.counter++,this._transmit("BEGIN",{transaction:n}),t=this,{id:n,commit:function(){return t.commit(n)},abort:function(){return t.abort(n)}}},e.prototype.commit=function(e){return this._transmit("COMMIT",{transaction:e})},e.prototype.abort=function(e){return this._transmit("ABORT",{transaction:e})},e.prototype.ack=function(e,t,n){return null==n&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("ACK",n)},e.prototype.nack=function(e,t,n){return null==n&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("NACK",n)},e}(),l={VERSIONS:{V1_0:"1.0",V1_1:"1.1",V1_2:"1.2",supportedVersions:function(){return"1.1,1.0"}},client:function(e,t){var n;return null==t&&(t=["v10.stomp","v11.stomp"]),n=new(l.WebSocketClass||WebSocket)(e,t),new r(n)},over:function(e){return new r(e)},Frame:E},null!=f&&(f.Stomp=l),"undefined"!=typeof window&&null!==window?(l.setInterval=function(e,t){return window.setInterval(t,e)},l.clearInterval=function(e){return window.clearInterval(e)},window.Stomp=l):f||(self.Stomp=l)}).call(undefined)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/stomp.js/lib/stomp.js","/lib/stomp.js/lib")},{_process:131,buffer:121,timers:152}],105:[function(_,e,g){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";g.__esModule=!0;var f=_("../logging.js"),d=m(_("../EventSupport.js")),p=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}}(_("../streamer-events.js")),h=m(_("../http.js"));function m(e){return e&&e.__esModule?e:{"default":e}}var E=function(){function o(e,t,n){var r=3<arguments.length&&arguments[3]!==undefined?arguments[3]:3,i=arguments[4];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.openSocket=t,this.createTransmitter=e,this.log=(0,f.asLogger)(n),this.events=new d["default"](this),this.currentConn="",this.maxReconnectAttempts=r,this.maxReconnectsTotal=3,this.isFirstConnection=!0,this.pingUrl=i}return o.prototype.open=function(){var i=this,e={send:function(e){return i.socket.send(e)},sendCustomFrame:function(e,t,n,r){return i.socket.sendCustomFrame(e,t,n,r)}};this.isFirstConnection&&(this.on("reopen",function(e){var t=i.currentConn;i.currentConn=e.connectionId,i.events.fire("reconnect",p.event("Reconnection success",{previousConnectionId:t,currentConnectionId:i.currentConn}))}),this.transmitter=this.createTransmitter(e),this.transmitter.on("message",function(e){i.events.fire("message",e)})),this.socket=this.openSocket(function(e){return i.request=e,i.reconnect=!1,{onOpen:function(e){if("CONNECTED"===e.command){i.isConnectionUp=!0;var t=p.event("open",{connectionId:e.headers["user-name"]});i.log.info(t),i.events.fire("open",t),i.isFirstConnection||(i.maxReconnectsTotal--,i.events.fire("reopen",t)),i.currentConn=e.headers["user-name"]}},onError:function(e){i.isConnectionUp=!1,i.isServerUp(function(e,t){null!==e?(i.reconnect=!1,i.log.warn("Connection lost, Streamer Server isn't Up")):(i.reconnect=!0,i.log.warn("Connection lost, Streamer Server is Up"))})},onClose:function(){i.isConnectionUp=!1},onMessage:function(e){var t=JSON.parse(e.body);t.code!==undefined&&(401!=t.code&&403!=t.code||(i.log.info("Unable to reconnect with code: "+t.code+", reason: "+t.reason),i.reconnect=!1,i.isConnectionUp=!1)),i.transmitter.onMessage(e.body)}}},this.currentConn)},o.prototype.close=function(){if(this.socket)try{this.socket.close(),this.socket=null,this.reconnect&&this.tryReopen()}catch(e){this.events.fire("error",p.error("Error closing",{reason:e.message,cause:e,code:-3}))}},o.prototype.tryReopen=function(){var t=this;if(this.isConnectionUp||this.maxReconnectsTotal<=0)this.log.error("Connection is already open or max reconnects was reached, won't try to reconnect");else{this.isFirstConnection=!1;var n=this.maxReconnectAttempts;setTimeout(function e(){if(n<=0)return t.reconnect=!1,t.log.error("Error while reconnecting. No attempts left."),void(t.maxReconnectAttempts=0);!t.isConnectionUp&&t.reconnect&&(t.log.info("Attempting reconnect. Attempts left: "+n),t.reopen(n),n--,setTimeout(e,500))},500)}},o.prototype.reopen=function(e){try{this.open()}catch(t){this.log.warn("There was an error while reopening attempt #"+e),this.events.fire("error",t)}},o.prototype.send=function(e){try{this.transmitter.send(e)}catch(t){this.events.fire("error",p.error("Error sending message",{reason:t.message,cause:t,code:-4}))}},o.prototype.sendCustomFrame=function(e,t,n,r){try{this.transmitter.sendCustomFrame(e,t,n,r)}catch(i){this.events.fire("error",p.error("Error sending custom frame message",{reason:i.message,cause:i,code:-4}))}},o.prototype.isReconnect=function(){return this.request["x-Stream-isReconnect"]},o.prototype.setReconnect=function(e){this.reconnect=e},o.prototype.setServer=function(e){this.request["X-Stream-Instance"]=e},o.prototype.isClosed=function(){return null==this.socket},o.prototype.isServerUp=function(t){(0,h["default"])({url:this.pingUrl,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.setConnectionUp=function(e){this.isConnectionUp=e},o.prototype.on=function(e,t){return this.events.on(e,t)},o}();g["default"]=E}).call(this,_("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],_("timers").setImmediate,_("timers").clearImmediate,"/lib/stomp/StompConnection.js","/lib/stomp")},{"../EventSupport.js":2,"../http.js":14,"../logging.js":16,"../streamer-events.js":109,_process:131,buffer:121,timers:152}],106:[function(b,e,T){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";T.__esModule=!0,b("../polyfills.js");var f=b("../streamer-api.js"),d=b("../streamer-utils.js"),p=b("../logging.js"),O=b("../utils.js"),h=_(b("../UShortId.js")),m=_(b("../EventSupport.js")),E=b("../formatting.js"),w=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}}(b("../streamer-events.js"));function _(e){return e&&e.__esModule?e:{"default":e}}var g=function(){function i(e,t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.events=new m["default"],this.streamingService=e,this.format=t,this.log=(0,p.asLogger)(n),this.conn=e.createStompConnection(),this.conn.on("message",function(e){r._handlejsonmsg(e)}).on("close",function(e){r.doClose(e)}).on("error",function(e){r.pendingConnection&&r.pendingConnection(e),r.events.fire("error",e)}).on("reconnect",function(e){r.reconnectSuccess(e)}),this.requestid=new h["default"],this.pendingsubscriptions={},this.pendingUnsubscriptions={},this.pendingExchangeSubscriptions={},this.pendingExchangeUnsubscriptions={},this.pendingNewsSubscriptions={},this.pendingNewsUnsubscriptions={},this.pendingAlertSubscription={},this.pendingTradeSubscription={},this.pendingTradeUnsubscription={},this.pendingSCFMessages={},this.pendingCorpEventSubscription={},this.on("error",function(e){r.log.warn(e)})}return i.prototype.openStomp=function(e){try{this.pendingConnection=e,this.conn.open()}catch(t){e&&e(t)}},i.prototype.reconnectSuccess=function(e){this.events.fire("reconnectSuccess",e),this.log.info("Successful reconnection. Previous Id: "+e.previousConnectionId+" Current Id = "+e.currentConnectionId)},i.prototype.on=function(e,t){return this.events.on(e,t)},i.prototype.SCFSendMessage=function(e,t,n,r,i){var o=i||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={ids:[],callback:o},u=this.requestid.next(),l=void 0;if(r&&""!==r){try{l=JSON.parse(r)}catch(c){return this.log.info("Error parsing message content: "+c.message),void o(null,null)}a.dataTypes=l["@T"],a.action=l.action,l.id=u}a.ids.push(u),this.pendingSCFMessages[u]=a,this.sendCustomFrame(e,t,n,l)},i.prototype.subscribe=function(e,t,n,r){var i=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()}),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=n&&"function"!=typeof n?n:null,s=r||(n&&"function"==typeof n?n:null);if(this.isClosed()){var a=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",a),void(s&&s(a))}var u={ids:[],types:t,mimetype:this.format,callback:s,result:{subscribed:[],rejected:[],unentitled:[],invalidSymbols:[],messageFilters:[]}};0!==e.length&&0!==t.length?this._prepareSubscriptionRequests(e,u,f.messages.control.Action.SUBSCRIBE,o).forEach(function(e){var t=i.requestid.next();u.ids.push(t),i.pendingsubscriptions[t]=u,e.id=t,i.send(e)}):s(null,u.result)},i.prototype.subscribeExchange=function(e,t,n){var r=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()});var i=t&&"function"!=typeof t?t:null,o=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={callback:o,mimetype:this.format,id:[],result:{subscribed:[],rejected:[]}};0===e.length&&o(null,a.result),this.prepareExchangeSubscriptionRequest(e,a,f.messages.control.Action.SUBSCRIBE,i).forEach(function(e){var t=r.requestid.next();a.id.push(t),a.exchange=e.exchange,a.conflation=e.conflation,r.pendingExchangeSubscriptions[t]=a,e.id=t,r.send(e)})},i.prototype.subscribeNews=function(e,t,n){var r=t&&"function"!=typeof t?t:null,i=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var o=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",o),void(i&&i(o))}var s={callback:i,mimetype:this.format,id:[],result:{newsFilters:[],rejectedNewsFilters:[],unentitledNewsFilters:[]}};0===e.length&&i(null,s.result);var a=this.buildNewsSubscribeRequest(e,s,f.messages.control.Action.SUBSCRIBE,r),u=this.requestid.next();this.pendingNewsSubscriptions[u]=s,a.id=u,this.send(a)},i.prototype.subscribeCorpEvents=function(e,t,n,r,i){e&&(e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()})),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=i||(r&&"function"==typeof r?r:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",s)}else{var a={id:[],symbols:e,corpEventTypes:t,allCorpEvents:n,mimeType:this.format,callback:o,result:{subscribed:[],unsubscribed:[],invalid:[]}};0===t.length&&o(null,a.result);var u=this.buildCorpEventRequest(e,a,f.messages.control.Action.SUBSCRIBE),l=this.requestid.next();a.id.push(l),this.pendingCorpEventSubscription[l]=a,u.id=l,this.send(u)}},i.prototype.subUnsubAlerts=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{operation:""}},s=this.buildAlertsSubUnsubRequest(e,o),a=this.requestid.next();o.id.push(a),this.pendingAlertSubscription[a]=o,s.id=a,this.send(s)}},i.prototype.subscribeTrade=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{notificationType:""}},s=this.buildTradeSubscribeRequest(e,o,f.messages.control.Action.SUBSCRIBE),a=this.requestid.next();o.id.push(a),this.pendingTradeSubscription[a]=o,s.id=a,this.send(s)}},i.prototype.getSessionStats=function(){if(this.isClosed()){var e=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",e)}else{var t=new f.messages.control.StatsMessage;this.send(t)}},i.prototype.cmdFilterRefreshNews=function(e){var t=e||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var n=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(t&&t(n))}var r={callback:t,mimetype:this.format},i=this.buildNewsCommandRequest(r,"NEWSCMDFILTERREFRESH");this.send(i)},i.prototype.cmdFilterNews=function(e){var t=e||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var n=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(t&&t(n))}var r={callback:t,mimetype:this.format},i=this.buildNewsCommandRequest(r,"NEWSCMDFILTER");this.send(i)},i.prototype.unsubscribe=function(e,t,n,r){var i=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()}),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=n&&"function"!=typeof n?n:null,s=r||(n&&"function"==typeof n?n:null);if(this.isClosed()){var a=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",a),void(s&&s(a))}var u={ids:[],types:t,mimetype:this.format,callback:s,result:{unsubscribed:[]}};0!==e.length&&0!==t.length||s&&s(null,u.result),this._prepareSubscriptionRequests(e,u,f.messages.control.Action.UNSUBSCRIBE,o).forEach(function(e){var t=i.requestid.next();u.ids.push(t),i.pendingUnsubscriptions[t]=u,e.id=t,i.send(e)})},i.prototype.unsubscribeExchange=function(e,t,n){var r=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()});var i=t&&"function"!=typeof t?t:null,o=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={callback:o,mimetype:this.format,id:[],result:{subscribed:[],rejected:[]}};0===e.length&&o(null,a.result),this.prepareExchangeSubscriptionRequest(e,a,f.messages.control.Action.UNSUBSCRIBE,i).forEach(function(e){var t=r.requestid.next();a.id.push(t),a.exchange=e.exchange,a.conflation=e.conflation,r.pendingExchangeUnsubscriptions[t]=a,e.id=t,r.send(e)})},i.prototype.unsubscribeNews=function(e,t,n){e=Array.isArray(e)?e:[e];var r=t&&"function"!=typeof t?t:null,i=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var o=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",o),void(i&&i(o))}var s={callback:i,mimetype:this.format,id:[],result:{unsubscribed:[]}};0===e.length&&i&&i(null,s.result);var a=this.buildNewsSubscribeRequest(e,s,f.messages.control.Action.UNSUBSCRIBE,r),u=this.requestid.next();s.id.push(u),this.pendingNewsUnsubscriptions[u]=s,a.id=u,this.send(a)},i.prototype.unsubscribeCorpEvents=function(e,t,n,r,i){e&&(e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()})),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=i||(r&&"function"==typeof r?r:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",s)}else{var a={id:[],symbols:e,corpEventTypes:t,allCorpEvents:n,mimeType:this.format,callback:o,result:{subscribed:[],unsubscribed:[],invalid:[]}};0===t.length&&o(null,a.result);var u=this.buildCorpEventRequest(e,a,f.messages.control.Action.UNSUBSCRIBE),l=this.requestid.next();a.id.push(l),this.pendingCorpEventSubscription[l]=a,u.id=l,this.send(u)}},i.prototype.unsubscribeTrade=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{notificationType:""}},s=this.buildTradeSubscribeRequest(e,o,f.messages.control.Action.UNSUBSCRIBE),a=this.requestid.next();o.id.push(a),this.pendingTradeUnsubscription[a]=o,s.id=a,this.send(s)}},i.prototype._handlejsonmsg=function(e){(0,d.iscontrolmessage)(e)&&e.__id in this.pendingSCFMessages?this.SCFHandlectrlmsg(e):(0,d.iscontrolmessage)(e)?this.handlectrlmsg(e):(0,d.isdatamessage)(e)?this._handledatamsg(e):this.events.fire("error",e)},i.prototype._prepareSubscriptionRequests=function(e,t,n,r){for(var i=0,o=-1,s=e.length,a=t.types.includes("ORDERBOOK"),u=[],l=0;l<s;l++)((i=this._getUpdatedNumberOfEntitlements(t.types.length,i,e[l],a))>=this.maxEntitlementsPerSubscription||l===s-1)&&(u.push(this._buildRequest(e.slice(o+1,l+1),t,n,r)),o=l,i=0);return u},i.prototype._buildRequest=function(e,t,n,r){var i=new f.messages.control.SubscribeMessage;return i.action=n,i.symbols=e,i.types=t.types,i.mimetype=t.mimetype,r&&r.skipHeavyInitialLoad&&(i.skipHeavyInitialLoad=!0),r&&(i.conflation=r.conflation,i.intervalPeriod=r.intervalPeriod),i},i.prototype.prepareExchangeSubscriptionRequest=function(e,t,n,r){for(var i=[],o=e.length,s=0;s<o;s++)i.push(this.buildExchangeRequest(e[s],t,n,r));return i},i.prototype.buildExchangeRequest=function(e,t,n,r){var i=new f.messages.control.ExchangeSubscribeMessage;return i.action=n,i.exchange=e,i.mimetype=t.mimetype,r&&(i.conflation=r.conflation),i},i.prototype.buildNewsSubscribeRequest=function(e,t,n,r){var i=new f.messages.control.NewsSubscribeMessage;return i.action=n,i.newsFilters=e,i.mimetype=t.mimetype,r&&r.skipHeavyInitialLoad&&(i.skipHeavyInitialLoad=r.skipHeavyInitialLoad),i},i.prototype.buildCorpEventRequest=function(e,t,n){var r=new f.messages.control.CorpEventSubscribeMessage;return r.symbols=e,r.action=n,r.corpEventTypes=t.corpEventTypes,r.allCorpEvents=t.allCorpEvents,r.mimeType=t.mimeType,r},i.prototype.buildAlertsSubUnsubRequest=function(e,t){var n=new f.messages.control.AlertsSubUnsubMessage;return n.operation=e,n.mimetype=t.mimetype,n},i.prototype.buildTradeSubscribeRequest=function(e,t,n){var r=new f.messages.control.TradeSubscribeMessage;return r.action=n,r.notificationType=e,r.mimetype=t.mimetype,r},i.prototype.buildNewsCommandRequest=function(e,t){var n=new f.messages.control.NewsCommandMessage;return n.newsAction=t,n.mimetype=e.mimetype,n},i.prototype._getUpdatedNumberOfEntitlements=function(e,t,n,r){var i=t;return r&&n.endsWith(":CC")?i+=14*e:i+=e,i},i.prototype.handlectrlmsg=function(e){switch(this.log.debug(E.msgfmt.fmt(e)),(0,d.messagetype)(e)){case f.messages.MessageTypeNames.ctrl.HEARTBEAT:this.onHeartbeat(e);break;case f.messages.MessageTypeNames.ctrl.SUBSCRIBE_RESPONSE:this.onSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.EXCHANGE_RESPONSE:this.onExchangeSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_SUBSCRIBE_RESPONSE:this.onNewsSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.ALERTS_SUBUNSUB_RESPONSE:this.onAlertsSubUnsubResponse(e);break;case f.messages.MessageTypeNames.ctrl.TRADE_SUBSCRIBE_RESPONSE:this.onTradeSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.UNSUBSCRIBE_RESPONSE:this.onUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.EXCHANGE_UNSUBSCRIBE_RESPONSE:this.onExchangeUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_UNSUBSCRIBE_RESPONSE:this.onNewsUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_CMD_FILTER_REFRESH_RESPONSE:this.onNewsCmdFilterRefreshResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_CMD_FILTER_RESPONSE:this.onNewsCmdFilterResponse(e);break;case f.messages.MessageTypeNames.ctrl.CORP_EVENT_RESPONSE:this.onCorpEventResponse(e);break;case f.messages.MessageTypeNames.ctrl.TRADE_UNSUBSCRIBE_RESPONSE:this.onTradeUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.CONNECT_RESPONSE:this.onConnectResponse(e);break;case f.messages.MessageTypeNames.ctrl.CONNECTION_CLOSE:this.onConnectionClose(e);break;case f.messages.MessageTypeNames.ctrl.SLOW_CONNECTION:this.onSlowConnection(e);break;case f.messages.MessageTypeNames.ctrl.STATS_RESPONSE:this.onStatsResponse(e);break;case f.messages.MessageTypeNames.ctrl.INITIAL_DATA_SENT:this.onInitialDataSent(e);break;case f.messages.MessageTypeNames.ctrl.RESUBSCRIBE_MESSAGE:this.onResubscribeMessage(e);break;case f.messages.MessageTypeNames.ctrl.OPEN_FLOW:this.onOpenFlow(e);break;case f.messages.MessageTypeNames.ctrl.RECONNECT_RESPONSE:this.onReconnectMessage(e);break;case f.messages.MessageTypeNames.ctrl.MISSED_DATA_SENT:this.onMissedDataSent(e)}},i.prototype.SCFHandlectrlmsg=function(e){this.log.debug(E.msgfmt.fmt(e));var t=this.pendingSCFMessages[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingSCFMessages[e.__id],200!=e.code){var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.ids.length&&n&&n(null,t)},i.prototype.onHeartbeat=function(e){},i.prototype.onSubscribeResponse=function(e){var t=this.pendingsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingsubscriptions[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;if(e.entitlements){var o=e.entitlements,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u,c=l,f=c.symbol,d=c.marketdatatype,p=c.entitlement;l={symbol:f,type:d},"NA"!==p?(this.log.debug("SUBSCRIBED <"+f+", "+d+">"),l.entitlement=p,i.subscribed.push(l)):(this.log.warn("NOT ENTITLED <"+f+","+d+">"),i.unentitled.push(l))}}if(e.rejectedSymbols){var h=e.rejectedSymbols,m=Array.isArray(h),E=0;for(h=m?h:h[Symbol.iterator]();;){var _;if(m){if(E>=h.length)break;_=h[E++]}else{if((E=h.next()).done)break;_=E.value}f=_;this.log.warn("REJECTED "+f),i.rejected.push(f)}}if(e.invalidSymbols){var g=e.invalidSymbols,b=Array.isArray(g),T=0;for(g=b?g:g[Symbol.iterator]();;){var y,S;if(b){if(T>=g.length)break;S=g[T++]}else{if((T=g.next()).done)break;S=T.value}var v=S;this.log.warn("INVALID SYMBOL "+v),(y=i.invalidSymbols).push.apply(y,e.invalidSymbols)}}0!==t.ids.length||t.failed||n&&n(null,t.result)},i.prototype.onExchangeSubscribeResponse=function(e){var t=this.pendingExchangeSubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingExchangeSubscriptions[e.__id],200!=e.code){var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.id.length&&n&&n(null,t)},i.prototype.onNewsSubscribeResponse=function(e){var t=this.pendingNewsSubscriptions[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingNewsSubscriptions[e.__id];var r=t.result;if(200!=e.code){var i=w.error("Error subscribing to news",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.newsFilters){var o=e.newsFilters,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.newsFilters.push(l)}}if(e.rejectedNewsFilters){var c=e.rejectedNewsFilters,f=Array.isArray(c),d=0;for(c=f?c:c[Symbol.iterator]();;){var p;if(f){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var h=p;r.rejectedNewsFilters.push(h)}}if(e.unentitledNewsFilters){var m=e.unentitledNewsFilters,E=Array.isArray(m),_=0;for(m=E?m:m[Symbol.iterator]();;){var g;if(E){if(_>=m.length)break;g=m[_++]}else{if((_=m.next()).done)break;g=_.value}var b=g;r.unentitledNewsFilters.push(b)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onCorpEventResponse=function(e){var t=this.pendingCorpEventSubscription[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingCorpEventSubscription[e.__id];var r=t.result;if(200!=e.code){var i=w.error("Error subscribing to Corporate Events",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.subscribed){var o=e.subscribed,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.subscribed.push(l)}}if(e.unsubscribed){var c=e.unsubscribed,f=Array.isArray(c),d=0;for(c=f?c:c[Symbol.iterator]();;){var p;if(f){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var h=p;r.unsubscribed.push(h)}}if(e.invalid){var m=e.invalid,E=Array.isArray(m),_=0;for(m=E?m:m[Symbol.iterator]();;){var g;if(E){if(_>=m.length)break;g=m[_++]}else{if((_=m.next()).done)break;g=_.value}var b=g;r.invalid.push(b)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onAlertsSubUnsubResponse=function(e){var t=this.pendingAlertSubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingAlertSubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.operation&&(this.log.debug("Alerts "+e.operation),i.operation=e.operation),0===t.id.length&&n&&n(null,t.result)},i.prototype.onTradeSubscribeResponse=function(e){var t=this.pendingTradeSubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingTradeSubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.notificationType&&(this.log.debug("Trade "+e.notificationType),i.notificationType=e.notificationType),0===t.id.length&&n&&n(null,t.result)},i.prototype.onNewsUnsubscribeResponse=function(e){var t=this.pendingNewsUnsubscriptions[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingNewsUnsubscriptions[e.__id];var r=t.result;if(200!=e.code&&!t.failed){t.failed=!0;var i=w.error("Error unsubscribing to news",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.newsFilters){var o=e.newsFilters,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.unsubscribed.push(l)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onTradeUnsubscribeResponse=function(e){var t=this.pendingTradeUnsubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingTradeUnsubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.notificationType&&(this.log.debug("Trade "+e.notificationType),i.notificationType=e.notificationType),0===t.id.length&&n&&n(null,t.result)},i.prototype.onNewsCmdFilterRefreshResponse=function(e){if(200==e.code)this.events.fire("msg",e);else{var t=w.error("Error Refreshing News Filters",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onNewsCmdFilterResponse=function(e){if(200==e.code)this.events.fire("filter status",e);else{var t=w.error("Error Getting News Filters Status",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onUnsubscribeResponse=function(e){var t=this.pendingUnsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingUnsubscriptions[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&n(r))}for(var i=0;i<e.unsubscribed.length;++i){var o=t.result,s=e.unsubscribed[i],a=s.symbol,u=s.marketdatatype;this.log.debug("UNSUBSCRIBED <"+a+", "+u+">"),o.unsubscribed.push({symbol:a,type:u})}0!==t.ids.length||t.failed||n&&n(null,t.result)},i.prototype.onExchangeUnsubscribeResponse=function(e){var t=this.pendingExchangeUnsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingExchangeUnsubscriptions[e.__id],200!=e.code){var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.id.length&&n&&n(null,t)},i.prototype.onReconnectMessage=function(e){450===e.code&&(this.events.fire("slow","Reconnection recieved a slow code: "+e.code),this._isSlowConnection=!0,this.conn.setReconnect=!1),this.events.fire("reconnectMessage",e)},i.prototype.onConnectResponse=function(e){if(200!==e.code){var t=w.error("Connection failed",{code:e.code,reason:e.reason});return this.events.fire("error",t),this.pendingConnection&&this.pendingConnection(t),void this.doClose(t)}if(this._serverversion=e.version,this.maxEntitlementsPerSubscription=e.maxEntitlementsPerSubscription,this.isClosed()){var n=w.error("Connection was already closed",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(this.pendingConnection&&this.pendingConnection(n))}this.conn.setServer(e.serverInstance),this.pendingConnection&&this.pendingConnection(null,this)},i.prototype.onConnectionClose=function(e){this.doClose(w.close({reason:e.reason,code:e.code}))},i.prototype.onSlowConnection=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("slow",e)},i.prototype.onStatsResponse=function(e){if(200==e.code)this.events.fire("stats",e);else{var t=w.error("Error getting stats",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onInitialDataSent=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("initialDataSent",e)},i.prototype.onResubscribeMessage=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("resubscribeMessage",e)},i.prototype.onMissedDataSent=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("missedDataSent",e)},i.prototype.onOpenFlow=function(e){this.conn.send(e)},i.prototype._handledatamsg=function(e){this.events.fire("message",e)},i.prototype.send=function(e){this.conn&&this.conn.send(e)},i.prototype.sendCustomFrame=function(e,t,n,r){this.conn&&this.conn.sendCustomFrame(e,t,n,r)},i.prototype.doClose=function(e){if(!this.isClosed()){var t=this.conn;this.conn=null,t.close(),this.events.fire("close",e),t.isReconnect()&&(this.events=new m["default"],this.conn=t)}},i.prototype.performReconnect=function(e){if(null!=this.conn&&this.conn.isReconnect()){if(this.conn.isConnectionUp)return void this.log.warn("Connection is not closed and won't try reconnect.");this.conn.setReconnect(!0),this.conn.tryReopen(),e&&e()}else this.log.warn("Reconnect flag is set to false")},i.prototype.close=function(e){this.doClose(w.close({reason:"Manually closed",code:200})),e&&e()},i.prototype.isClosed=function(){return null==this.conn},i}();T["default"]=g}).call(this,b("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},b("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],b("timers").setImmediate,b("timers").clearImmediate,"/lib/stomp/StompStream.js","/lib/stomp")},{"../EventSupport.js":2,"../UShortId.js":9,"../formatting.js":13,"../logging.js":16,"../polyfills.js":18,"../streamer-api.js":108,"../streamer-events.js":109,"../streamer-utils.js":110,"../utils.js":115,_process:131,buffer:121,timers:152}],107:[function(v,e,O){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";O.__esModule=!0,v("../polyfills.js");var f=v("../logging.js"),p=v("../streamer-api.js"),h=v("../message.js"),d=_(v("../transmission/JsonStompTransmitter.js")),m=_(v("./StompConnection.js")),E=_(v("./StompStream.js"));function _(e){return e&&e.__esModule?e:{"default":e}}var g="/ping/v1",b="/version/v1",T="/stream/connect",y="",S=function(){function o(e,t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.http=e,this.stompJs=t,this.log=(0,f.asLogger)(n),this.config=r||{},this.maxReconnectAttempts=this.config.maxReconnectAttempts,this.format=this.config.format,"application/json"===this.config.format&&(this.createTransmitter=function(e){return new d["default"](e,i.log)})}return o.prototype.openStompSocket=function(t,e){y="";var n={"X-Stream-Version":p.VERSION,"X-Stream-Lib":p.LIBRARY_NAME};this.addToHeaderParams("X-Stream-Version",p.VERSION),this.addToHeaderParams("X-Stream-Lib",p.LIBRARY_NAME);var r=this.config.conflation;null!=r&&""!==r&&(n["X-Stream-Conflation"]=r,this.addToHeaderParams("X-Stream-Conflation",r)),null!=e&&""!==e&&(n["X-Stream-Previous-Connection-Id"]=e,this.addToHeaderParams("X-Stream-Previous-Connection-Id",e));var i=this.config.intervalPeriod;null!=i&&""!==i&&(n["X-Stream-Interval-Period"]=i,this.addToHeaderParams("X-Stream-Interval-Period",i));var o=this.config.rejectExcessiveConnection;null!=o&&""!==o&&(n["X-Stream-Reject"]=o,this.addToHeaderParams("X-Stream-Reject",o)),"application/json"!==this.config.format&&this.config.format!==h.MimeTypes.QITCH||(n["X-Stream-Format"]=this.format,this.addToHeaderParams("X-Stream-Format",this.format)),"true"===this.config.updatesOnly&&(n["X-Stream-UpdatesOnly"]=!0,this.addToHeaderParams("X-Stream-UpdatesOnly",!0));var s=this.config.isReconnect;null!=s&&""!==s&&(n["x-Stream-isReconnect"]=s,this.addToHeaderParams("x-Stream-isReconnect",s));var a=this.config.alwaysReconnect;null!=a&&""!==a&&(n["x-Stream-isAlwaysReopen"]=a,this.addToHeaderParams("x-Stream-isAlwaysReopen",a)),"ALL"===this.config.isMissedData?(n["X-Stream-isReceiveAllMissedData"]=!0,this.addToHeaderParams("X-Stream-isReceiveAllMissedData",!0)):"LATEST"===this.config.isMissedData&&(n["X-Stream-isReceiveLatestMissedData"]=!0,this.addToHeaderParams("X-Stream-isReceiveLatestMissedData",!0));var u=this.config.stompWmid;null!=u&&(n.wmid=u,this.addToHeaderParams("wmid",u));var l=this.config.userSymbology;null!=l&&""!==l&&(n["X-Stream-User-Symbology"]=l,this.addToHeaderParams("X-Stream-User-Symbology",l)),Object.assign(n,this.config.credentials.getHeaders());var c=this.config.url+T+y,f=this.stompJs.Stomp.client(c),d=new p.messages.control.AuthenticationMessage;return this.config.credentials.sid!==undefined?(d.authenticationMethod="sid",d.authorization=this.config.credentials.sid):this.config.credentials.wmid!==undefined&&this.config.credentials.token!==undefined?(d.authenticationMethod="enterprise",d.wmid=this.config.credentials.wmid,d.authorization=this.config.credentials.token):this.config.credentials.wmid!==undefined?(d.authenticationMethod="wmid",d.authorization=this.config.credentials.wmid):this.config.credentials.data_token!==undefined&&(d.authenticationMethod="datatool",d.authorization=this.config.credentials.data_token),null!=this.config.conflation&&""!==this.config.conflation&&(d.conflation=this.config.conflation),null!=this.config.rejectExcessiveConnection&&""!==this.config.rejectExcessiveConnection&&(d.rejectExcessiveConnection=this.config.rejectExcessiveConnection),null!=this.config.entMax&&""!==this.config.entMax&&(d.entMax=this.config.entMax),f.connect(n,function(e){f.subscribe("/user/queue/messages",function(e){t(n).onMessage(e)}),t(n).onOpen(e),f.send("/stream/message",n,JSON.stringify(d))},function(e){t(n).onError(e)}),{send:function(e){f.send("/stream/message",n,e)},close:function(){f.disconnect(function(){t(n).onClose()})},sendCustomFrame:function(e,t,n,r){f.sendCustomFrame(e,t,n,r)}}},o.prototype.createStompConnection=function(){var n=this;return new m["default"](function(e){return n.createTransmitter(e)},function(e,t){return n.openStompSocket(e,t)},this.log,this.maxReconnectAttempts,this.config.host+g)},o.prototype.openStompStream=function(e){new E["default"](this,this.format,this.log).openStomp(e)},o.prototype.ping=function(t){this.http({url:this.config.host+g,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.getVersion=function(t){this.http({url:this.config.host+b,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.addToHeaderParams=function(e,t){y=""===y?y+"?"+e+"="+t:y+"&"+e+"="+t},o}();O["default"]=S}).call(this,v("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},v("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],v("timers").setImmediate,v("timers").clearImmediate,"/lib/stomp/StompStreamingService.js","/lib/stomp")},{"../logging.js":16,"../message.js":17,"../polyfills.js":18,"../streamer-api.js":108,"../transmission/JsonStompTransmitter.js":111,"./StompConnection.js":105,"./StompStream.js":106,_process:131,buffer:121,timers:152}],108:[function(e,t,d){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";d.__esModule=!0;d.LIBRARY_NAME="JavaScript",d.VERSION="2.55.0";var f=d.messages={};f.control={},f.market={},f.JSON_TYPE_PROPERTY="@T",f.MessageTypeNames={ctrl:{HEARTBEAT:"C1",SUBSCRIBE:"C2",SUBSCRIBE_RESPONSE:"C3",UNSUBSCRIBE_RESPONSE:"C4",CONNECT_RESPONSE:"C5",CONNECTION_CLOSE:"C6",FLOW:"C7",SLOW_CONNECTION:"C8",INITIAL_DATA_SENT:"C9",RESUBSCRIBE_MESSAGE:"C10",STATS:"C12",STATS_RESPONSE:"C13",EXCHANGE_SUBSCRIBE:"C14",EXCHANGE_RESPONSE:"C15",EXCHANGE_UNSUBSCRIBE_RESPONSE:"C16",NEWS_SUBSCRIBE:"C17",NEWS_SUBSCRIBE_RESPONSE:"C18",ALERTS_SUBUNSUB:"C19",ALERTS_SUBUNSUB_RESPONSE:"C20",TRADE_SUBSCRIBE:"C21",TRADE_SUBSCRIBE_RESPONSE:"C22",NEWS_UNSUBSCRIBE_RESPONSE:"C23",NEWS_COMMAND:"C24",NEWS_CMD_FILTER_REFRESH_RESPONSE:"C25",NEWS_CMD_FILTER_RESPONSE:"C26",AUTHENTICATION:"C27",OPEN_FLOW:"C28",RECONNECT_RESPONSE:"C29",TRADE_UNSUBSCRIBE_RESPONSE:"C30",MISSED_DATA_SENT:"C31",CORP_EVENT_MESSAGE:"C33",CORP_EVENT_RESPONSE:"C34"},data:{QUOTE:"D1",PRICEDATA:"D2",TRADE:"D3",BOOKORDER:"D4",BOOKDELETE:"D5",PURGEBOOK:"D6",MMQUOTE:"D7",INTERVAL:"D8",NETHOUSEPOSITION:"D9",SYMBOLINFO:"D10",SYMBOLSTATUS:"D11",DERIVATIVEINFO:"D12",LASTSALE:"D13",LIMITUPLIMITDOWN:"D14",IVGREEKS:"D15",IMBALANCESTATUS:"D16",ALERT:"D17",NEWS:"D18",TRADENOTIFICATION:"D19",NEWSCMDFILTER:"D20",NEWSERROR:"D21",DIVIDEND:"D22",EARNINGS:"D23",SPLIT:"D24",SYMBOLCHANGED:"D25",PRICELEVEL:"D26",MMPRICELEVEL:"D27"}},f.Message=function(){},f.Message.prototype.init=function(e){this[f.JSON_TYPE_PROPERTY]=e},f.control.CtrlMessage=function(){},f.control.CtrlMessage.prototype=new f.Message,f.control.Heartbeat=function(){this.init(f.MessageTypeNames.ctrl.HEARTBEAT),this.timestamp=null},f.control.Heartbeat.prototype=new f.control.CtrlMessage,f.control.StatsMessage=function(){this.init(f.MessageTypeNames.ctrl.STATS)},f.control.StatsMessage.prototype=new f.control.CtrlMessage,f.control.SubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.SUBSCRIBE),this.action=null,this.symbols=[],this.types=[],this.mimetype=null,this.conflation=null},f.control.SubscribeMessage.prototype=new f.control.CtrlMessage,f.control.ExchangeSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_SUBSCRIBE),this.action=null,this.exchange=null,this.mimetype=null,this.conflation=null},f.control.ExchangeSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.NewsSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.NEWS_SUBSCRIBE),this.action=null,this.newsFilters=null,this.mimetype=null},f.control.NewsSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.NewsCommandMessage=function(){this.init(f.MessageTypeNames.ctrl.NEWS_COMMAND),this.newsAction=null,this.mimetype=null},f.control.NewsCommandMessage.prototype=new f.control.CtrlMessage,f.control.CorpEventSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.CORP_EVENT_MESSAGE),this.action=null,this.symbols=[],this.corpEventTypes=[],this.allCorpEvents=null,this.mimeType=null},f.control.CorpEventSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.AlertsSubUnsubMessage=function(){this.init(f.MessageTypeNames.ctrl.ALERTS_SUBUNSUB),this.operation=null,this.mimetype=null},f.control.AlertsSubUnsubMessage.prototype=new f.control.CtrlMessage,f.control.TradeSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.TRADE_SUBSCRIBE),this.action=null,this.notificationType=null,this.mimetype=null},f.control.TradeSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.BaseResponse=function(){this.code=null,this.reason=null},f.control.BaseResponse.prototype=new f.control.CtrlMessage,f.control.SubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.SUBSCRIBE_RESPONSE),this.entitlements=null,this.invalidsymbols=null,this.rejectedsymbols=null,this.messagefilters=null},f.control.SubscribeResponse.prototype=new f.control.BaseResponse,f.control.ExchangeSubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_RESPONSE)},f.control.ExchangeSubscribeResponse.prototype=new f.control.BaseResponse,f.control.AlertSubUnsubResponse=function(){this.init(f.MessageTypeNames.ctrl.ALERTS_SUBUNSUB_RESPONSE)},f.control.AlertSubUnsubResponse.prototype=new f.control.BaseResponse,f.control.TradeSubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.TRADE_SUBSCRIBE_RESPONSE)},f.control.TradeSubscribeResponse.prototype=new f.control.BaseResponse,f.control.UnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.UNSUBSCRIBE_RESPONSE),this.unsubscribed=null},f.control.UnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.ExchangeUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_UNSUBSCRIBE_RESPONSE)},f.control.ExchangeUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.NewsUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.NEWS_UNSUBSCRIBE_RESPONSE),this.unsubscribed=null},f.control.NewsUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.CorporateEventResponse=function(){this.init(f.MessageTypeNames.ctrl.CORP_EVENT_RESPONSE),this.subscribed=[],this.unsubscribed=[],this.invalid=[]},f.control.CorporateEventResponse.prototype=new f.control.BaseResponse,f.control.TradeUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.TRADE_UNSUBSCRIBE_RESPONSE)},f.control.TradeUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.StreamEntitlement=function(){this.symbol=null,this.marketdatatype=null,this.entitlement=null},f.control.ConnectResponse=function(){this.init(f.MessageTypeNames.ctrl.CONNECT_RESPONSE),this.version=null,this.flowControlCheckInterval=null,this.serverInstance=null,this.conflationMs=null},f.control.ConnectResponse.prototype=new f.control.BaseResponse,f.control.ReconnectResponse=function(){undefined.init(f.MessageTypeNames.ctrl.RECONNECT_RESPONSE),undefined.version=null,undefined.flowControlCheckInterval=null,undefined.serverInstance=null,undefined.conflationMs=null,undefined.previousSubscriptions=null},f.control.ConnectionClose=function(){this.init(f.MessageTypeNames.ctrl.CONNECTION_CLOSE),this.code=null,this.reason=null},f.control.ConnectionClose.prototype=new f.control.CtrlMessage,f.control.SlowConnection=function(){this.init(f.MessageTypeNames.ctrl.SLOW_CONNECTION),this.timesExceeded=null,this.maxExceed=null},f.control.SlowConnection.prototype=new f.control.CtrlMessage,f.control.FlowMessage=function(){this.init(f.MessageTypeNames.ctrl.FLOW),this.sequence=null},f.control.FlowMessage.prototype=new f.control.CtrlMessage,f.control.AuthenticationMessage=function(){this.init(f.MessageTypeNames.ctrl.AUTHENTICATION),this.authenticationMethod=null,this.wmid=null,this.authorization=null,this.conflation=150,this.rejectExcessiveConnection=!1,this.entMax=null},f.control.AuthenticationMessage.prototype=new f.control.CtrlMessage,f.control.StatsResponse=function(){this.init(f.MessageTypeNames.ctrl.STATS_RESPONSE),this.numberOfSubscribedSymbolsL1=null,this.numberOfAvailableSymbolsL1=null,this.numberOfSubscribedSymbolsL2=null,this.numberOfAvailableSymbolsL2=null,this.numberOfOpenedConnections=null,this.numberOfAvailableConnections=null,this.numberOfSubscribedExchanges=null,this.numberOfSubscribedTrades=null},f.control.StatsResponse.prototype=new f.control.BaseResponse,f.control.InitialDataSent=function(){this.init(f.MessageTypeNames.ctrl.INITIAL_DATA_SENT),this.timestamp=null},f.control.InitialDataSent.prototype=new f.control.CtrlMessage,f.control.ResubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.RESUBSCRIBE_MESSAGE),this.timestamp=null},f.control.ResubscribeMessage.prototype=new f.control.CtrlMessage,f.control.MissedDataSent=function(){this.init(f.MessageTypeNames.ctrl.MISSED_DATA_SENT),this.timestamp=null},f.control.MissedDataSent.prototype=new f.control.CtrlMessage,f.control.StreamEntitlementType={RT:"Realtime",RTO:"Realtime CBOE ONE",RTN:"Realtime NASDAQ",RTB:"Realtime BATS",DL:"Delayed",DLO:"Delayed CBOE One",DLN:"Delayed NASDAQ",NA:"Not Entitled"},f.control.Action={SUBSCRIBE:"SUBSCRIBE",UNSUBSCRIBE:"UNSUBSCRIBE"},f.control.Association={AND:"AND",OR:"OR",NOT:"NOT"},f.control.MarketdataType={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",MMQUOTE:"MMQUOTE",ORDERBOOK:"ORDERBOOK",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",LASTSALE:"LASTSALE",BOOKORDER:"BOOKORDER",BOOKDELETE:"BOOKDELETE",PRICELEVEL:"PRICELEVEL",MMPRICELEVEL:"MMPRICELEVEL",PURGEBOOK:"PURGEBOOK",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS"},f.market.SubscriptionTypes={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",MMQUOTE:"MMQUOTE",ORDERBOOK:"ORDERBOOK",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",LASTSALE:"LASTSALE",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS"},f.market.CorporateEventTypes={DIVIDEND:"DIVIDEND",SPLIT:"SPLIT",EARNINGS:"EARNINGS",SYMBOLCHANGED:"SYMBOLCHANGED"},f.market.MarketDataResponseTypes={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",MMQUOTE:"MMQUOTE",PRICELEVEL:"PRICELEVEL",MMPRICELEVEL:"MMPRICELEVEL",BOOKORDER:"BOOKORDER",PURGEBOOK:"PURGEBOOK",BOOKDELETE:"BOOKDELETE",SYMBOLINFO:"SYMBOLINFO",SYMBOLSTATUS:"SYMBOLSTATUS",DERIVATIVEINFO:"DERIVATIVEINFO",LASTSALE:"LASTSALE",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS",ALERT:"ALERT",NEWS:"NEWS",TRADENOTIFICATION:"TRADENOTIFICATION",NEWSCMDFILTER:"NEWSCMDFILTER",NEWSERROR:"NEWSERROR",DIVIDEND:"DIVIDEND"},f.control.ResponseCodes={OK_CODE:200,OK_REASON:"OK",BADREQUEST_CODE:400,BADREQUEST_REASON:"Bad Request",UNAUTHORIZED_CODE:401,UNAUTHORIZED_REASON:"Unauthorized",TOOSLOW_CODE:450,TOOSLOW_REASON:"Too slow",DATA_SOURCE_RESET:454,DATA_SOURCE_RESET_REASON:"Data Source Was Reset",CONNECTION_LIMIT_EXCEEDED_CODE:452,CONNECTION_LIMIT_EXCEEDED_REASON:"Connection Limit Exceeded",INTERNALSERVERERROR_CODE:500,INTERNALSERVERERROR_REASON:"Internal Server Error"},f.market.DataMessage=function(){this.messageType=null},f.market.DataMessage.prototype=new f.Message,f.market.Quote=function(){this.init(f.MessageTypeNames.data.QUOTE)},f.market.Quote.prototype=new f.market.DataMessage,f.market.PriceData=function(){this.init(f.MessageTypeNames.data.PRICEDATA)},f.market.PriceData.prototype=new f.market.DataMessage,f.market.Trade=function(){this.init(f.MessageTypeNames.data.TRADE)},f.market.Trade.prototype=new f.market.DataMessage,f.market.MMQuote=function(){this.init(f.MessageTypeNames.data.MMQUOTE)},f.market.MMQuote.prototype=new f.market.DataMessage,f.market.PurgeBook=function(){this.init(f.MessageTypeNames.data.PURGEBOOK)},f.market.PurgeBook.prototype=new f.market.DataMessage,f.market.BookOrder=function(){this.init(f.MessageTypeNames.data.BOOKORDER)},f.market.BookOrder.prototype=new f.market.DataMessage,f.market.BookDelete=function(){this.init(f.MessageTypeNames.data.BOOKDELETE)},f.market.BookDelete.prototype=new f.market.DataMessage,f.market.PriceLevel=function(){this.init(f.MessageTypeNames.data.PRICELEVEL)},f.market.PriceLevel.prototype=new f.market.DataMessage,f.market.MMPriceLevel=function(){this.init(f.MessageTypeNames.data.MMPRICELEVEL)},f.market.MMPriceLevel.prototype=new f.market.DataMessage,f.market.Interval=function(){this.init(f.MessageTypeNames.data.INTERVAL)},f.market.Interval.prototype=new f.market.DataMessage,f.market.NethousePosition=function(){this.init(f.MessageTypeNames.data.NETHOUSEPOSITION)},f.market.NethousePosition.prototype=new f.market.DataMessage,f.market.SymbolInfo=function(){this.init(f.MessageTypeNames.data.SYMBOLINFO)},f.market.SymbolInfo.prototype=new f.market.DataMessage,f.market.SymbolStatus=function(){this.init(f.MessageTypeNames.data.SYMBOLSTATUS)},f.market.SymbolStatus.prototype=new f.market.DataMessage,f.market.DerivativeInfo=function(){this.init(f.MessageTypeNames.data.DERIVATIVEINFO)},f.market.DerivativeInfo.prototype=new f.market.DataMessage,f.market.IVGreeks=function(){this.init(f.MessageTypeNames.data.IVGREEKS)},f.market.IVGreeks.prototype=new f.market.DataMessage,f.market.LastSale=function(){this.init(f.MessageTypeNames.data.LASTSALE)},f.market.LastSale.prototype=new f.market.DataMessage,f.market.LimitUpLimitDown=function(){this.init(f.MessageTypeNames.data.LIMITUPLIMITDOWN)},f.market.LimitUpLimitDown.prototype=new f.market.DataMessage,f.market.ImbalanceStatus=function(){this.init(f.MessageTypeNames.data.IMBALANCESTATUS)},f.market.ImbalanceStatus.prototype=new f.market.DataMessage,f.market.Alert=function(){this.init(f.MessageTypeNames.data.ALERT)},f.market.Alert.prototype=new f.market.DataMessage,f.market.InstrumentType={1:"CASH",2:"BOND",3:"COMPOSITE",4:"FUTURE",5:"FUTURE_OPTION",6:"FOREX",7:"INDEX",8:"MUTUAL_FUND",9:"MONEY_MARKET_FUND",10:"MARKET_STAT",11:"EQUITY",12:"EQUITY_OPTION",13:"GOVT_BOND",14:"MUNI_BOND",15:"CORP_BOND",16:"ETF",17:"FUTURE_SPREAD",97:"OPTION_ROOT",98:"UNKNOWN",99:"RATE"},f.market.OrderSide={BUYSIDE:"B",SELLSIDE:"S"},f.market.ImbalanceType={0:"NONE",1:"MARKET",2:"MOC",3:"REGULATORY_IMBALANCE",4:"OPENING_IMBALANCE",5:"CLOSING_IMBALANCE",6:"IPO_IMBALANCE",7:"HALT_IMBALANCE",8:"EQUILIBRIUM"},f.market.OrderChangeType={A:"ADD",M:"MODIFY",C:"CANCEL",E:"EXECUTE"}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/streamer-api.js","/lib")},{_process:131,buffer:121,timers:152}],109:[function(p,e,h){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";h.__esModule=!0,p("./polyfills");var f=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Object.assign(this,e)}return t.prototype.toString=function(){var e=this.type+"{",t=!0;for(var n in this)"type"!==n&&"function"!=typeof this[n]&&(t||(e+=", "),e+=n+": "+JSON.stringify(this[n]),t=!1);return e+="}"},t}(),d=h.event=function(e,t){return new f(Object.assign({type:e},t))};h.error=function(e,t){return d("error",Object.assign({description:e},t))},h.close=function(e){return d("close",e)}}).call(this,p("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],p("timers").setImmediate,p("timers").clearImmediate,"/lib/streamer-events.js","/lib")},{"./polyfills":18,_process:131,buffer:121,timers:152}],110:[function(p,e,h){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";h.__esModule=!0,h.getMessageName=h.entitlement=h.isvalid=h.iscontrolmessage=h.isdatamessage=h.messagetype=undefined;var f,d=p("./streamer-api.js");h.messagetype=function(e){return null===e?null:e[d.messages.JSON_TYPE_PROPERTY]},h.isdatamessage=function(e){if(null===e)return!1;var t=h.messagetype(e);return null!==t&&t.startsWith("D")},h.iscontrolmessage=function(e){if(null===e)return!1;var t=h.messagetype(e);return null!==t&&t.startsWith("C")},h.isvalid=function(e,t){var n=t.invalidSymbols;if(null==n)return!0;for(var r=0;r<n.length;r++){if(n[r]===e)return!1}return!0},h.entitlement=function(e,t,n){var r=n.entitlements;if(null!=r)for(var i=0;i<r.length;i++){var o=r[i];if(o.symbol===e&&o.marketdatatype===t)return o.entitlement}return null},h.getMessageName=(f={},function(e){var t=e[d.messages.JSON_TYPE_PROPERTY];if(!f[t]){var n=d.messages.MessageTypeNames.ctrl;for(var r in n)if(n[r]===t)return f[t]=r;var i=d.messages.MessageTypeNames.data;for(var o in i)if(i[o]===t)return f[t]=o;return f[t]=t}return f[t]})}).call(this,p("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],p("timers").setImmediate,p("timers").clearImmediate,"/lib/streamer-utils.js","/lib")},{"./streamer-api.js":108,_process:131,buffer:121,timers:152}],111:[function(m,e,E){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";E.__esModule=!0;var f,d=m("../EventSupport.js"),p=(f=d)&&f.__esModule?f:{"default":f};var h=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.socket=e,this.log=t,this.events=new p["default"](this)}return n.prototype.send=function(e,t){this.socket.send(JSON.stringify(e))},n.prototype.sendCustomFrame=function(e,t,n,r){this.socket.sendCustomFrame(e.toString(),t.toString(),JSON.parse(n),JSON.stringify(r))},n.prototype.onMessage=function(e){var t=null;try{t=JSON.parse(e)}catch(r){return void this.log.error(r)}var n=t;n.__id=n.requestId,this.events.fire("message",n)},n.prototype.on=function(e,t){return this.events.on(e,t)},n}();E["default"]=h}).call(this,m("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],m("timers").setImmediate,m("timers").clearImmediate,"/lib/transmission/JsonStompTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,_process:131,buffer:121,timers:152}],112:[function(m,e,E){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";E.__esModule=!0;m("../message.js");var f,d=m("../EventSupport.js"),p=(f=d)&&f.__esModule?f:{"default":f};var h=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.socket=e,this.log=t,this.events=new p["default"](this)}return n.prototype.send=function(e,t){this.socket.push({trackMessageLength:!0,data:JSON.stringify(e)})},n.prototype.onMessage=function(e){var t=null;try{t=JSON.parse(e)}catch(o){return void this.log.error(o)}this.events.fire("sequence",t.seq);for(var n=t.data.length,r=0;r<n;r++){var i=t.data[r];i.__id=i.requestId,this.events.fire("message",i)}},n.prototype.on=function(e,t){return this.events.on(e,t)},n}();E["default"]=h}).call(this,m("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],m("timers").setImmediate,m("timers").clearImmediate,"/lib/transmission/JsonTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../message.js":17,_process:131,buffer:121,timers:152}],113:[function(S,e,v){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";v.__esModule=!0;var f=T(S("../EventSupport.js")),d=T(S("../SMessage")),p=S("../qitch/decoder/QitchDecoder"),h=T(p),m=T(S("../qitch/encoder/QitchEncoder")),E=T(S("../UShortId.js")),_=S("../message.js"),g=T(S("../qitch/LocateCodeInjector")),b=S("../utils");function T(e){return e&&e.__esModule?e:{"default":e}}var y=function(){function r(e,t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.socket=e,!(t instanceof m["default"]))throw"Wrong encoder";this.encoder=t,this.log=n,this.events=new f["default"](this),this.decoder=new h["default"](r.prototype.DEFAULT_BUFFERSIZE),this.locateCodeInjector=new g["default"]}return r.prototype.send=function(e,t){var n=new d["default"];n.sequencenumber=e.sequenceNumber,n.timestamp=(new Date).getTime(),n.id=null!=t?t:E["default"].NULL,n.encoding=_.Encodings.NONE_CHAR,n.mimetype=_.MimeTypes.QITCH_CHAR,n.payload=e;var r={trackMessageLength:!1,data:this.encoder.encode(n,0)};this.socket.push(r)},r.prototype.onMessage=function(e){var t=void 0;t=e instanceof ArrayBuffer?e:(0,b.asciiStringToArrayBuffer)(e);var n=null;try{n=this.decoder.decode(new Int8Array(t))}catch(o){return void this.log.error(o)}if(null!=n)for(var r=0;r<n.length;r++)if(n[r]instanceof p.MessageBlock)for(var i=0;i<n[r].messages.length;i++)this._processMessage(n[r].messages[i]);else this._processMessage(n[r]);else this.log.debug("Couldn't decode message. Ignoring unsupported message")},r.prototype.on=function(e,t){return this.events.on(e,t)},r.prototype._processMessage=function(e){this.locateCodeInjector.injectLocateCode(e.decodedPayload),this.events.fire("sequence",e.sequencenumber),e.decodedPayload.__id=e.id,this.events.fire("message",e.decodedPayload)},r}();y.prototype.DEFAULT_BUFFERSIZE=4096,v["default"]=y}).call(this,S("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],S("timers").setImmediate,S("timers").clearImmediate,"/lib/transmission/QitchTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../SMessage":5,"../UShortId.js":9,"../message.js":17,"../qitch/LocateCodeInjector":23,"../qitch/decoder/QitchDecoder":46,"../qitch/encoder/QitchEncoder":76,"../utils":115,_process:131,buffer:121,timers:152}],114:[function(_,e,g){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";g.__esModule=!0;var f=_("../message.js"),d=m(_("../SMessage.js")),p=m(_("../UShortId.js")),h=m(_("../EventSupport.js"));_("../formatting.js");function m(e){return e&&e.__esModule?e:{"default":e}}var E=function(){function i(e,t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.socket=e,this.encoder=t,this.decoder=n,this.log=r,this.events=new h["default"](this)}return i.prototype.send=function(e,t){var n=new d["default"];n.sequencenumber=e.sequenceNumber,n.timestamp=(new Date).getTime(),n.id=null!=t?t:p["default"].NULL,n.encoding=f.Encodings.NONE_CHAR,n.mimetype=f.MimeTypes.JSON_CHAR,n.payload=JSON.stringify(e);var r={trackMessageLength:!0,data:this.encoder.encode(n)};this.socket.push(r)},i.prototype.onMessage=function(e){var t=this.decoder.decode(e);if(this.events.fire("sequence",t.sequencenumber),t.encoding===f.Encodings.NONE_CHAR)if(t.mimetype===f.MimeTypes.JSON_CHAR){var n=null;try{n=JSON.parse(t.payload)}catch(r){return void this.log.error(r)}n.__id=t.id,this.events.fire("message",n)}else this.log.debug("Unhandled mimetype: "+t.mimeType+" - "+t.payload);else this.log.debug("Unhandled encoding: "+t.encoding+" - "+t.payload)},i.prototype.on=function(e,t){return this.events.on(e,t)},i}();g["default"]=E}).call(this,_("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],_("timers").setImmediate,_("timers").clearImmediate,"/lib/transmission/SMessageTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../SMessage.js":5,"../UShortId.js":9,"../formatting.js":13,"../message.js":17,_process:131,buffer:121,timers:152}],115:[function(e,t,d){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";d.__esModule=!0;d.forEachPartition=function(e,t,n){if(e)for(var r=0;r<e.length;r+=t){n(e.slice(r,r+t))}};var f=d.indexOf=function(e,t){for(var n=e.length,r=0;r<n;++r)if(t===e[r])return r;return-1};d.removeFromArray=function(e){for(var t,n,r=arguments.length<=1?0:arguments.length-1;0<r&&e.length;){var i;for(i=1+--r,t=arguments.length<=i?undefined:arguments[i];-1!==(n=f(e,t));)e.splice(n,1)}return e},d.asciiStringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/utils.js","/lib")},{_process:131,buffer:121,timers:152}],116:[function(e,f,t){(function(e,t,n,r,i,o,s,a,u,l,c){f.exports=function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/node_modules/array-equal/index.js","/node_modules/array-equal")},{_process:131,buffer:121,timers:152}],117:[function(e,t,b){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";b.byteLength=function(e){var t=_(e),n=t[0],r=t[1];return 3*(n+r)/4-r},b.toByteArray=function(e){for(var t,n=_(e),r=n[0],i=n[1],o=new p((l=r,c=i,3*(l+c)/4-c)),s=0,a=0<i?r-4:r,u=0;u<a;u+=4)t=d[e.charCodeAt(u)]<<18|d[e.charCodeAt(u+1)]<<12|d[e.charCodeAt(u+2)]<<6|d[e.charCodeAt(u+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;var l,c;2===i&&(t=d[e.charCodeAt(u)]<<2|d[e.charCodeAt(u+1)]>>4,o[s++]=255&t);1===i&&(t=d[e.charCodeAt(u)]<<10|d[e.charCodeAt(u+1)]<<4|d[e.charCodeAt(u+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},b.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,s=n-r;o<s;o+=16383)i.push(g(e,o,s<o+16383?s:o+16383));1===r?(t=e[n-1],i.push(f[t>>2]+f[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(f[t>>10]+f[t>>4&63]+f[t<<2&63]+"="));return i.join("")};for(var f=[],d=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,E=h.length;m<E;++m)f[m]=h[m],d[h.charCodeAt(m)]=m;function _(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function g(e,t,n){for(var r,i,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(f[(i=r)>>18&63]+f[i>>12&63]+f[i>>6&63]+f[63&i]);return o.join("")}d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/node_modules/base64-js/index.js","/node_modules/base64-js")},{_process:131,buffer:121,timers:152}],118:[function(e,f,t){(function(e,t,n,r,i,o,s,a,u,l,c){!function(t){"use strict";
|
|
47
|
+
(function(){var b,r,E,l,o={}.hasOwnProperty,s=[].slice;b={LF:"\n",NULL:"\0"},E=function(){var s;function g(e,t,n){this.command=e,this.headers=null!=t?t:{},this.body=null!=n?n:""}return g.prototype.toString=function(){var e,t,n,r,i;for(t in(n=!(e=[this.command])===this.headers["content-length"])&&delete this.headers["content-length"],i=this.headers)o.call(i,t)&&(r=i[t],e.push(t+":"+r));return this.body&&!n&&e.push("content-length:"+g.sizeOfUTF8(this.body)),e.push(b.LF+this.body),e.join(b.LF)},g.sizeOfUTF8=function(e){return e?encodeURI(e).match(/%..|./g).length:0},s=function(e){var t,n,r,i,o,s,a,u,l,c,f,d,p,h,m,E,_;for(i=e.search(RegExp(""+b.LF+b.LF)),r=(o=e.substring(0,i).split(b.LF)).shift(),s={},d=function(e){return e.replace(/^\s+|\s+$/g,"")},p=0,m=(E=o.reverse()).length;p<m;p++)u=(c=E[p]).indexOf(":"),s[d(c.substring(0,u))]=d(c.substring(u+1));if(t="",f=i+2,s["content-length"])l=parseInt(s["content-length"]),t=(""+e).substring(f,f+l);else for(n=null,a=h=f,_=e.length;(f<=_?h<_:_<h)&&(n=e.charAt(a))!==b.NULL;a=f<=_?++h:--h)t+=n;return new g(r,s,t)},g.unmarshall=function(i){var o;return function(){var e,t,n,r;for(r=[],e=0,t=(n=i.split(RegExp(""+b.NULL+b.LF+"*"))).length;e<t;e++)0<(null!=(o=n[e])?o.length:void 0)&&r.push(s(o));return r}()},g.marshall=function(e,t,n){return new g(e,t,n).toString()+b.NULL},g}(),r=function(){var m;function e(e){this.ws=e,this.ws.binaryType="arraybuffer",this.counter=0,this.connected=!1,this.heartbeat={outgoing:1e4,incoming:1e4},this.maxWebSocketFrameSize=16384,this.subscriptions={}}return e.prototype.debug=function(e){var t;return"undefined"!=typeof window&&null!==window&&null!=(t=window.console)?t.log(e):void 0},m=function(){return Date.now?Date.now():(new Date).valueOf},e.prototype._transmit=function(e,t,n){var r;for(r=E.marshall(e,t,n),"function"==typeof this.debug&&this.debug(">>> "+r);;){if(!(r.length>this.maxWebSocketFrameSize))return this.ws.send(r);this.ws.send(r.substring(0,this.maxWebSocketFrameSize)),r=r.substring(this.maxWebSocketFrameSize),"function"==typeof this.debug&&this.debug("remaining = "+r.length)}},e.prototype._setupHeartbeat=function(i){var e,t,n,o,r,s,a,u;if((r=i.version)===l.VERSIONS.V1_1||r===l.VERSIONS.V1_2)return t=(s=function(){var e,t,n,r;for(r=[],e=0,t=(n=i["heart-beat"].split(",")).length;e<t;e++)o=n[e],r.push(parseInt(o));return r}())[0],e=s[1],0!==this.heartbeat.outgoing&&0!==e&&(n=Math.max(this.heartbeat.outgoing,e),"function"==typeof this.debug&&this.debug("send PING every "+n+"ms"),this.pinger=l.setInterval(n,(a=this,function(){return a.ws.send(b.LF),"function"==typeof a.debug?a.debug(">>> PING"):void 0}))),0!==this.heartbeat.incoming&&0!==t?(n=Math.max(this.heartbeat.incoming,t),"function"==typeof this.debug&&this.debug("check PONG every "+n+"ms"),this.ponger=l.setInterval(n,(u=this,function(){var e;if(e=m()-u.serverActivity,2*n<e)return"function"==typeof u.debug&&u.debug("did not receive server activity for the last "+e+"ms"),u.ws.close()}))):void 0},e.prototype._parseConnect=function(){var e,t,n,r;switch(r={},(e=1<=arguments.length?s.call(arguments,0):[]).length){case 2:r=e[0],t=e[1];break;case 3:e[1]instanceof Function?(r=e[0],t=e[1],n=e[2]):(r.login=e[0],r.passcode=e[1],t=e[2]);break;case 4:r.login=e[0],r.passcode=e[1],t=e[2],n=e[3];break;default:r.login=e[0],r.passcode=e[1],t=e[2],n=e[3],r.host=e[4]}return[r,t,n]},e.prototype.connect=function(){var e,p,t,n,h,r,i;return e=1<=arguments.length?s.call(arguments,0):[],n=this._parseConnect.apply(this,e),t=n[0],this.connectCallback=n[1],p=n[2],"function"==typeof this.debug&&this.debug("Opening Web Socket..."),this.ws.onmessage=(h=this,function(e){var r,i,t,n,o,s,a,u,l,c,f,d;if(n="undefined"!=typeof ArrayBuffer&&e.data instanceof ArrayBuffer?(r=new Uint8Array(e.data),"function"==typeof h.debug&&h.debug("--- got data length: "+r.length),function(){var e,t,n;for(n=[],e=0,t=r.length;e<t;e++)i=r[e],n.push(String.fromCharCode(i));return n}().join("")):e.data,h.serverActivity=m(),n!==b.LF){for("function"==typeof h.debug&&h.debug("<<< "+n),d=[],l=0,c=(f=E.unmarshall(n)).length;l<c;l++)switch((o=f[l]).command){case"CONNECTED":"function"==typeof h.debug&&h.debug("connected to server "+o.headers.server),h.connected=!0,h._setupHeartbeat(o.headers),d.push("function"==typeof h.connectCallback?h.connectCallback(o):void 0);break;case"MESSAGE":u=o.headers.subscription,(a=h.subscriptions[u]||h.onreceive)?(t=h,s=o.headers["message-id"],o.ack=function(e){return null==e&&(e={}),t.ack(s,u,e)},o.nack=function(e){return null==e&&(e={}),t.nack(s,u,e)},d.push(a(o))):d.push("function"==typeof h.debug?h.debug("Unhandled received MESSAGE: "+o):void 0);break;case"RECEIPT":d.push("function"==typeof h.onreceipt?h.onreceipt(o):void 0);break;case"ERROR":d.push("function"==typeof p?p(o):void 0);break;default:d.push("function"==typeof h.debug?h.debug("Unhandled frame: "+o):void 0)}return d}"function"==typeof h.debug&&h.debug("<<< PONG")}),this.ws.onclose=(r=this,function(){var e;return e="Whoops! Lost connection to "+r.ws.url,"function"==typeof r.debug&&r.debug(e),r._cleanUp(),"function"==typeof p?p(e):void 0}),this.ws.onopen=(i=this,function(){return"function"==typeof i.debug&&i.debug("Web Socket Opened..."),t["accept-version"]=l.VERSIONS.supportedVersions(),t["heart-beat"]=[i.heartbeat.outgoing,i.heartbeat.incoming].join(","),i._transmit("CONNECT",t)})},e.prototype.disconnect=function(e,t){return null==t&&(t={}),this._transmit("DISCONNECT",t),this.ws.onclose=null,this.ws.close(),this._cleanUp(),"function"==typeof e?e():void 0},e.prototype._cleanUp=function(){if(this.connected=!1,this.pinger&&l.clearInterval(this.pinger),this.ponger)return l.clearInterval(this.ponger)},e.prototype.sendCustomFrame=function(e,t,n,r){return null==n&&(n={}),null==r&&(r=""),n.destination=e,this._transmit(t,n,r)},e.prototype.send=function(e,t,n){return null==t&&(t={}),null==n&&(n=""),t.destination=e,this._transmit("SEND",t,n)},e.prototype.subscribe=function(e,t,n){var r;return null==n&&(n={}),n.id||(n.id="sub-"+this.counter++),n.destination=e,this.subscriptions[n.id]=t,this._transmit("SUBSCRIBE",n),r=this,{id:n.id,unsubscribe:function(){return r.unsubscribe(n.id)}}},e.prototype.unsubscribe=function(e){return delete this.subscriptions[e],this._transmit("UNSUBSCRIBE",{id:e})},e.prototype.begin=function(e){var t,n;return n=e||"tx-"+this.counter++,this._transmit("BEGIN",{transaction:n}),t=this,{id:n,commit:function(){return t.commit(n)},abort:function(){return t.abort(n)}}},e.prototype.commit=function(e){return this._transmit("COMMIT",{transaction:e})},e.prototype.abort=function(e){return this._transmit("ABORT",{transaction:e})},e.prototype.ack=function(e,t,n){return null==n&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("ACK",n)},e.prototype.nack=function(e,t,n){return null==n&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("NACK",n)},e}(),l={VERSIONS:{V1_0:"1.0",V1_1:"1.1",V1_2:"1.2",supportedVersions:function(){return"1.1,1.0"}},client:function(e,t){var n;return null==t&&(t=["v10.stomp","v11.stomp"]),n=new(l.WebSocketClass||WebSocket)(e,t),new r(n)},over:function(e){return new r(e)},Frame:E},null!=f&&(f.Stomp=l),"undefined"!=typeof window&&null!==window?(l.setInterval=function(e,t){return window.setInterval(t,e)},l.clearInterval=function(e){return window.clearInterval(e)},window.Stomp=l):f||(self.Stomp=l)}).call(undefined)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/stomp.js/lib/stomp.js","/lib/stomp.js/lib")},{_process:131,buffer:121,timers:152}],105:[function(_,e,g){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";g.__esModule=!0;var f=_("../logging.js"),d=m(_("../EventSupport.js")),p=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}}(_("../streamer-events.js")),h=m(_("../http.js"));function m(e){return e&&e.__esModule?e:{"default":e}}var E=function(){function o(e,t,n){var r=3<arguments.length&&arguments[3]!==undefined?arguments[3]:3,i=arguments[4];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.openSocket=t,this.createTransmitter=e,this.log=(0,f.asLogger)(n),this.events=new d["default"](this),this.currentConn="",this.maxReconnectAttempts=r,this.maxReconnectsTotal=3,this.isFirstConnection=!0,this.pingUrl=i}return o.prototype.open=function(){var i=this,e={send:function(e){return i.socket.send(e)},sendCustomFrame:function(e,t,n,r){return i.socket.sendCustomFrame(e,t,n,r)}};this.isFirstConnection&&(this.on("reopen",function(e){var t=i.currentConn;i.currentConn=e.connectionId,i.events.fire("reconnect",p.event("Reconnection success",{previousConnectionId:t,currentConnectionId:i.currentConn}))}),this.transmitter=this.createTransmitter(e),this.transmitter.on("message",function(e){i.events.fire("message",e)})),this.socket=this.openSocket(function(e){return i.request=e,i.reconnect=!1,{onOpen:function(e){if("CONNECTED"===e.command){i.isConnectionUp=!0;var t=p.event("open",{connectionId:e.headers["user-name"]});i.log.info(t),i.events.fire("open",t),i.isFirstConnection||(i.maxReconnectsTotal--,i.events.fire("reopen",t)),i.currentConn=e.headers["user-name"]}},onError:function(e){i.isConnectionUp=!1,i.isServerUp(function(e,t){null!==e?(i.reconnect=!1,i.log.warn("Connection lost, Streamer Server isn't Up")):(i.reconnect=!0,i.log.warn("Connection lost, Streamer Server is Up"))})},onClose:function(){i.isConnectionUp=!1},onMessage:function(e){var t=JSON.parse(e.body);t.code!==undefined&&(401!=t.code&&403!=t.code||(i.log.info("Unable to reconnect with code: "+t.code+", reason: "+t.reason),i.reconnect=!1,i.isConnectionUp=!1)),i.transmitter.onMessage(e.body)}}},this.currentConn)},o.prototype.close=function(){if(this.socket)try{this.socket.close(),this.socket=null,this.reconnect&&this.tryReopen()}catch(e){this.events.fire("error",p.error("Error closing",{reason:e.message,cause:e,code:-3}))}},o.prototype.tryReopen=function(){var t=this;if(this.isConnectionUp||this.maxReconnectsTotal<=0)this.log.error("Connection is already open or max reconnects was reached, won't try to reconnect");else{this.isFirstConnection=!1;var n=this.maxReconnectAttempts;setTimeout(function e(){if(n<=0)return t.reconnect=!1,t.log.error("Error while reconnecting. No attempts left."),void(t.maxReconnectAttempts=0);!t.isConnectionUp&&t.reconnect&&(t.log.info("Attempting reconnect. Attempts left: "+n),t.reopen(n),n--,setTimeout(e,500))},500)}},o.prototype.reopen=function(e){try{this.open()}catch(t){this.log.warn("There was an error while reopening attempt #"+e),this.events.fire("error",t)}},o.prototype.send=function(e){try{this.transmitter.send(e)}catch(t){this.events.fire("error",p.error("Error sending message",{reason:t.message,cause:t,code:-4}))}},o.prototype.sendCustomFrame=function(e,t,n,r){try{this.transmitter.sendCustomFrame(e,t,n,r)}catch(i){this.events.fire("error",p.error("Error sending custom frame message",{reason:i.message,cause:i,code:-4}))}},o.prototype.isReconnect=function(){return this.request["x-Stream-isReconnect"]},o.prototype.setReconnect=function(e){this.reconnect=e},o.prototype.setServer=function(e){this.request["X-Stream-Instance"]=e},o.prototype.isClosed=function(){return null==this.socket},o.prototype.isServerUp=function(t){(0,h["default"])({url:this.pingUrl,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.setConnectionUp=function(e){this.isConnectionUp=e},o.prototype.on=function(e,t){return this.events.on(e,t)},o}();g["default"]=E}).call(this,_("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],_("timers").setImmediate,_("timers").clearImmediate,"/lib/stomp/StompConnection.js","/lib/stomp")},{"../EventSupport.js":2,"../http.js":14,"../logging.js":16,"../streamer-events.js":109,_process:131,buffer:121,timers:152}],106:[function(b,e,T){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";T.__esModule=!0,b("../polyfills.js");var f=b("../streamer-api.js"),d=b("../streamer-utils.js"),p=b("../logging.js"),O=b("../utils.js"),h=_(b("../UShortId.js")),m=_(b("../EventSupport.js")),E=b("../formatting.js"),w=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}}(b("../streamer-events.js"));function _(e){return e&&e.__esModule?e:{"default":e}}var g=function(){function i(e,t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.events=new m["default"],this.streamingService=e,this.format=t,this.log=(0,p.asLogger)(n),this.conn=e.createStompConnection(),this.conn.on("message",function(e){r._handlejsonmsg(e)}).on("close",function(e){r.doClose(e)}).on("error",function(e){r.pendingConnection&&r.pendingConnection(e),r.events.fire("error",e)}).on("reconnect",function(e){r.reconnectSuccess(e)}),this.requestid=new h["default"],this.pendingsubscriptions={},this.pendingUnsubscriptions={},this.pendingExchangeSubscriptions={},this.pendingExchangeUnsubscriptions={},this.pendingNewsSubscriptions={},this.pendingNewsUnsubscriptions={},this.pendingAlertSubscription={},this.pendingTradeSubscription={},this.pendingTradeUnsubscription={},this.pendingSCFMessages={},this.pendingCorpEventSubscription={},this.on("error",function(e){r.log.warn(e)})}return i.prototype.openStomp=function(e){try{this.pendingConnection=e,this.conn.open()}catch(t){e&&e(t)}},i.prototype.reconnectSuccess=function(e){this.events.fire("reconnectSuccess",e),this.log.info("Successful reconnection. Previous Id: "+e.previousConnectionId+" Current Id = "+e.currentConnectionId)},i.prototype.on=function(e,t){return this.events.on(e,t)},i.prototype.SCFSendMessage=function(e,t,n,r,i){var o=i||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={ids:[],callback:o},u=this.requestid.next(),l=void 0;if(r&&""!==r){try{l=JSON.parse(r)}catch(c){return this.log.info("Error parsing message content: "+c.message),void o(null,null)}a.dataTypes=l["@T"],a.action=l.action,l.id=u}a.ids.push(u),this.pendingSCFMessages[u]=a,this.sendCustomFrame(e,t,n,l)},i.prototype.subscribe=function(e,t,n,r){var i=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()}),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=n&&"function"!=typeof n?n:null,s=r||(n&&"function"==typeof n?n:null);if(this.isClosed()){var a=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",a),void(s&&s(a))}var u={ids:[],types:t,mimetype:this.format,callback:s,result:{subscribed:[],rejected:[],unentitled:[],invalidSymbols:[],messageFilters:[]}};0!==e.length&&0!==t.length?this._prepareSubscriptionRequests(e,u,f.messages.control.Action.SUBSCRIBE,o).forEach(function(e){var t=i.requestid.next();u.ids.push(t),i.pendingsubscriptions[t]=u,e.id=t,i.send(e)}):s(null,u.result)},i.prototype.subscribeExchange=function(e,t,n){var r=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()});var i=t&&"function"!=typeof t?t:null,o=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={callback:o,mimetype:this.format,id:[],result:{subscribed:[],rejected:[]}};0===e.length&&o(null,a.result),this.prepareExchangeSubscriptionRequest(e,a,f.messages.control.Action.SUBSCRIBE,i).forEach(function(e){var t=r.requestid.next();a.id.push(t),a.exchange=e.exchange,a.conflation=e.conflation,r.pendingExchangeSubscriptions[t]=a,e.id=t,r.send(e)})},i.prototype.subscribeNews=function(e,t,n){var r=t&&"function"!=typeof t?t:null,i=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var o=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",o),void(i&&i(o))}var s={callback:i,mimetype:this.format,id:[],result:{newsFilters:[],rejectedNewsFilters:[],unentitledNewsFilters:[]}};0===e.length&&i(null,s.result);var a=this.buildNewsSubscribeRequest(e,s,f.messages.control.Action.SUBSCRIBE,r),u=this.requestid.next();this.pendingNewsSubscriptions[u]=s,a.id=u,this.send(a)},i.prototype.subscribeCorpEvents=function(e,t,n,r,i){e&&(e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()})),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=i||(r&&"function"==typeof r?r:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",s)}else{var a={id:[],symbols:e,corpEventTypes:t,allCorpEvents:n,mimeType:this.format,callback:o,result:{subscribed:[],unsubscribed:[],invalid:[]}};0===t.length&&o(null,a.result);var u=this.buildCorpEventRequest(e,a,f.messages.control.Action.SUBSCRIBE),l=this.requestid.next();a.id.push(l),this.pendingCorpEventSubscription[l]=a,u.id=l,this.send(u)}},i.prototype.subUnsubAlerts=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{operation:""}},s=this.buildAlertsSubUnsubRequest(e,o),a=this.requestid.next();o.id.push(a),this.pendingAlertSubscription[a]=o,s.id=a,this.send(s)}},i.prototype.subscribeTrade=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{notificationType:""}},s=this.buildTradeSubscribeRequest(e,o,f.messages.control.Action.SUBSCRIBE),a=this.requestid.next();o.id.push(a),this.pendingTradeSubscription[a]=o,s.id=a,this.send(s)}},i.prototype.getSessionStats=function(){if(this.isClosed()){var e=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",e)}else{var t=new f.messages.control.StatsMessage;this.send(t)}},i.prototype.cmdFilterRefreshNews=function(e){var t=e||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var n=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(t&&t(n))}var r={callback:t,mimetype:this.format},i=this.buildNewsCommandRequest(r,"NEWSCMDFILTERREFRESH");this.send(i)},i.prototype.cmdFilterNews=function(e){var t=e||(optsOrCallback&&"function"==typeof optsOrCallback?optsOrCallback:null);if(this.isClosed()){var n=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(t&&t(n))}var r={callback:t,mimetype:this.format},i=this.buildNewsCommandRequest(r,"NEWSCMDFILTER");this.send(i)},i.prototype.unsubscribe=function(e,t,n,r){var i=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()}),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=n&&"function"!=typeof n?n:null,s=r||(n&&"function"==typeof n?n:null);if(this.isClosed()){var a=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",a),void(s&&s(a))}var u={ids:[],types:t,mimetype:this.format,callback:s,result:{unsubscribed:[]}};0!==e.length&&0!==t.length||s&&s(null,u.result),this._prepareSubscriptionRequests(e,u,f.messages.control.Action.UNSUBSCRIBE,o).forEach(function(e){var t=i.requestid.next();u.ids.push(t),i.pendingUnsubscriptions[t]=u,e.id=t,i.send(e)})},i.prototype.unsubscribeExchange=function(e,t,n){var r=this;e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()});var i=t&&"function"!=typeof t?t:null,o=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",s),void(o&&o(s))}var a={callback:o,mimetype:this.format,id:[],result:{subscribed:[],rejected:[]}};0===e.length&&o(null,a.result),this.prepareExchangeSubscriptionRequest(e,a,f.messages.control.Action.UNSUBSCRIBE,i).forEach(function(e){var t=r.requestid.next();a.id.push(t),a.exchange=e.exchange,a.conflation=e.conflation,r.pendingExchangeUnsubscriptions[t]=a,e.id=t,r.send(e)})},i.prototype.unsubscribeNews=function(e,t,n){e=Array.isArray(e)?e:[e];var r=t&&"function"!=typeof t?t:null,i=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var o=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});return this.events.fire("error",o),void(i&&i(o))}var s={callback:i,mimetype:this.format,id:[],result:{unsubscribed:[]}};0===e.length&&i&&i(null,s.result);var a=this.buildNewsSubscribeRequest(e,s,f.messages.control.Action.UNSUBSCRIBE,r),u=this.requestid.next();s.id.push(u),this.pendingNewsUnsubscriptions[u]=s,a.id=u,this.send(a)},i.prototype.unsubscribeCorpEvents=function(e,t,n,r,i){e&&(e=(Array.isArray(e)?e:[e]).map(function(e){return e.toUpperCase()})),t=Array.isArray(t)?t:[t].map(function(e){return e.toUpperCase()});var o=i||(r&&"function"==typeof r?r:null);if(this.isClosed()){var s=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",s)}else{var a={id:[],symbols:e,corpEventTypes:t,allCorpEvents:n,mimeType:this.format,callback:o,result:{subscribed:[],unsubscribed:[],invalid:[]}};0===t.length&&o(null,a.result);var u=this.buildCorpEventRequest(e,a,f.messages.control.Action.UNSUBSCRIBE),l=this.requestid.next();a.id.push(l),this.pendingCorpEventSubscription[l]=a,u.id=l,this.send(u)}},i.prototype.unsubscribeTrade=function(e,t,n){var r=n||(t&&"function"==typeof t?t:null);if(this.isClosed()){var i=w.error("Stream is disconnected",{code:-1,reason:"Already disconnected"});this.events.fire("error",i)}else{var o={id:[],mimetype:this.format,callback:r,result:{notificationType:""}},s=this.buildTradeSubscribeRequest(e,o,f.messages.control.Action.UNSUBSCRIBE),a=this.requestid.next();o.id.push(a),this.pendingTradeUnsubscription[a]=o,s.id=a,this.send(s)}},i.prototype._handlejsonmsg=function(e){(0,d.iscontrolmessage)(e)&&e.__id in this.pendingSCFMessages?this.SCFHandlectrlmsg(e):(0,d.iscontrolmessage)(e)?this.handlectrlmsg(e):(0,d.isdatamessage)(e)?this._handledatamsg(e):this.events.fire("error",e)},i.prototype._prepareSubscriptionRequests=function(e,t,n,r){for(var i=0,o=-1,s=e.length,a=t.types.includes("ORDERBOOK"),u=[],l=0;l<s;l++)((i=this._getUpdatedNumberOfEntitlements(t.types.length,i,e[l],a))>=this.maxEntitlementsPerSubscription||l===s-1)&&(u.push(this._buildRequest(e.slice(o+1,l+1),t,n,r)),o=l,i=0);return u},i.prototype._buildRequest=function(e,t,n,r){var i=new f.messages.control.SubscribeMessage;return i.action=n,i.symbols=e,i.types=t.types,i.mimetype=t.mimetype,r&&r.skipHeavyInitialLoad&&(i.skipHeavyInitialLoad=!0),r&&(i.conflation=r.conflation,i.intervalPeriod=r.intervalPeriod),i},i.prototype.prepareExchangeSubscriptionRequest=function(e,t,n,r){for(var i=[],o=e.length,s=0;s<o;s++)i.push(this.buildExchangeRequest(e[s],t,n,r));return i},i.prototype.buildExchangeRequest=function(e,t,n,r){var i=new f.messages.control.ExchangeSubscribeMessage;return i.action=n,i.exchange=e,i.mimetype=t.mimetype,r&&(i.conflation=r.conflation),i},i.prototype.buildNewsSubscribeRequest=function(e,t,n,r){var i=new f.messages.control.NewsSubscribeMessage;return i.action=n,i.newsFilters=e,i.mimetype=t.mimetype,r&&r.skipHeavyInitialLoad&&(i.skipHeavyInitialLoad=r.skipHeavyInitialLoad),i},i.prototype.buildCorpEventRequest=function(e,t,n){var r=new f.messages.control.CorpEventSubscribeMessage;return r.symbols=e,r.action=n,r.corpEventTypes=t.corpEventTypes,r.allCorpEvents=t.allCorpEvents,r.mimeType=t.mimeType,r},i.prototype.buildAlertsSubUnsubRequest=function(e,t){var n=new f.messages.control.AlertsSubUnsubMessage;return n.operation=e,n.mimetype=t.mimetype,n},i.prototype.buildTradeSubscribeRequest=function(e,t,n){var r=new f.messages.control.TradeSubscribeMessage;return r.action=n,r.notificationType=e,r.mimetype=t.mimetype,r},i.prototype.buildNewsCommandRequest=function(e,t){var n=new f.messages.control.NewsCommandMessage;return n.newsAction=t,n.mimetype=e.mimetype,n},i.prototype._getUpdatedNumberOfEntitlements=function(e,t,n,r){var i=t;return r&&n.endsWith(":CC")?i+=14*e:i+=e,i},i.prototype.handlectrlmsg=function(e){switch(this.log.debug(E.msgfmt.fmt(e)),(0,d.messagetype)(e)){case f.messages.MessageTypeNames.ctrl.HEARTBEAT:this.onHeartbeat(e);break;case f.messages.MessageTypeNames.ctrl.SUBSCRIBE_RESPONSE:this.onSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.EXCHANGE_RESPONSE:this.onExchangeSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_SUBSCRIBE_RESPONSE:this.onNewsSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.ALERTS_SUBUNSUB_RESPONSE:this.onAlertsSubUnsubResponse(e);break;case f.messages.MessageTypeNames.ctrl.TRADE_SUBSCRIBE_RESPONSE:this.onTradeSubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.UNSUBSCRIBE_RESPONSE:this.onUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.EXCHANGE_UNSUBSCRIBE_RESPONSE:this.onExchangeUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_UNSUBSCRIBE_RESPONSE:this.onNewsUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_CMD_FILTER_REFRESH_RESPONSE:this.onNewsCmdFilterRefreshResponse(e);break;case f.messages.MessageTypeNames.ctrl.NEWS_CMD_FILTER_RESPONSE:this.onNewsCmdFilterResponse(e);break;case f.messages.MessageTypeNames.ctrl.CORP_EVENT_RESPONSE:this.onCorpEventResponse(e);break;case f.messages.MessageTypeNames.ctrl.TRADE_UNSUBSCRIBE_RESPONSE:this.onTradeUnsubscribeResponse(e);break;case f.messages.MessageTypeNames.ctrl.CONNECT_RESPONSE:this.onConnectResponse(e);break;case f.messages.MessageTypeNames.ctrl.CONNECTION_CLOSE:this.onConnectionClose(e);break;case f.messages.MessageTypeNames.ctrl.SLOW_CONNECTION:this.onSlowConnection(e);break;case f.messages.MessageTypeNames.ctrl.STATS_RESPONSE:this.onStatsResponse(e);break;case f.messages.MessageTypeNames.ctrl.INITIAL_DATA_SENT:this.onInitialDataSent(e);break;case f.messages.MessageTypeNames.ctrl.RESUBSCRIBE_MESSAGE:this.onResubscribeMessage(e);break;case f.messages.MessageTypeNames.ctrl.OPEN_FLOW:this.onOpenFlow(e);break;case f.messages.MessageTypeNames.ctrl.RECONNECT_RESPONSE:this.onReconnectMessage(e);break;case f.messages.MessageTypeNames.ctrl.MISSED_DATA_SENT:this.onMissedDataSent(e)}},i.prototype.SCFHandlectrlmsg=function(e){this.log.debug(E.msgfmt.fmt(e));var t=this.pendingSCFMessages[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingSCFMessages[e.__id],200!=e.code){var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.ids.length&&n&&n(null,t)},i.prototype.onHeartbeat=function(e){},i.prototype.onSubscribeResponse=function(e){var t=this.pendingsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingsubscriptions[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;if(e.entitlements){var o=e.entitlements,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u,c=l,f=c.symbol,d=c.marketdatatype,p=c.entitlement;l={symbol:f,type:d},"NA"!==p?(this.log.debug("SUBSCRIBED <"+f+", "+d+">"),l.entitlement=p,i.subscribed.push(l)):(this.log.warn("NOT ENTITLED <"+f+","+d+">"),i.unentitled.push(l))}}if(e.rejectedSymbols){var h=e.rejectedSymbols,m=Array.isArray(h),E=0;for(h=m?h:h[Symbol.iterator]();;){var _;if(m){if(E>=h.length)break;_=h[E++]}else{if((E=h.next()).done)break;_=E.value}f=_;this.log.warn("REJECTED "+f),i.rejected.push(f)}}if(e.invalidSymbols){var g=e.invalidSymbols,b=Array.isArray(g),T=0;for(g=b?g:g[Symbol.iterator]();;){var y,S;if(b){if(T>=g.length)break;S=g[T++]}else{if((T=g.next()).done)break;S=T.value}var v=S;this.log.warn("INVALID SYMBOL "+v),(y=i.invalidSymbols).push.apply(y,e.invalidSymbols)}}0!==t.ids.length||t.failed||n&&n(null,t.result)},i.prototype.onExchangeSubscribeResponse=function(e){var t=this.pendingExchangeSubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingExchangeSubscriptions[e.__id],200!=e.code){var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.id.length&&n&&n(null,t)},i.prototype.onNewsSubscribeResponse=function(e){var t=this.pendingNewsSubscriptions[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingNewsSubscriptions[e.__id];var r=t.result;if(200!=e.code){var i=w.error("Error subscribing to news",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.newsFilters){var o=e.newsFilters,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.newsFilters.push(l)}}if(e.rejectedNewsFilters){var c=e.rejectedNewsFilters,f=Array.isArray(c),d=0;for(c=f?c:c[Symbol.iterator]();;){var p;if(f){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var h=p;r.rejectedNewsFilters.push(h)}}if(e.unentitledNewsFilters){var m=e.unentitledNewsFilters,E=Array.isArray(m),_=0;for(m=E?m:m[Symbol.iterator]();;){var g;if(E){if(_>=m.length)break;g=m[_++]}else{if((_=m.next()).done)break;g=_.value}var b=g;r.unentitledNewsFilters.push(b)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onCorpEventResponse=function(e){var t=this.pendingCorpEventSubscription[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingCorpEventSubscription[e.__id];var r=t.result;if(200!=e.code){var i=w.error("Error subscribing to Corporate Events",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.subscribed){var o=e.subscribed,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.subscribed.push(l)}}if(e.unsubscribed){var c=e.unsubscribed,f=Array.isArray(c),d=0;for(c=f?c:c[Symbol.iterator]();;){var p;if(f){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var h=p;r.unsubscribed.push(h)}}if(e.invalid){var m=e.invalid,E=Array.isArray(m),_=0;for(m=E?m:m[Symbol.iterator]();;){var g;if(E){if(_>=m.length)break;g=m[_++]}else{if((_=m.next()).done)break;g=_.value}var b=g;r.invalid.push(b)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onAlertsSubUnsubResponse=function(e){var t=this.pendingAlertSubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingAlertSubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.operation&&(this.log.debug("Alerts "+e.operation),i.operation=e.operation),0===t.id.length&&n&&n(null,t.result)},i.prototype.onTradeSubscribeResponse=function(e){var t=this.pendingTradeSubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingTradeSubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error subscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.notificationType&&(this.log.debug("Trade "+e.notificationType),i.notificationType=e.notificationType),0===t.id.length&&n&&n(null,t.result)},i.prototype.onNewsUnsubscribeResponse=function(e){var t=this.pendingNewsUnsubscriptions[e.__id],n=t.callback;(0,O.removeFromArray)(t.id,e.__id),delete this.pendingNewsUnsubscriptions[e.__id];var r=t.result;if(200!=e.code&&!t.failed){t.failed=!0;var i=w.error("Error unsubscribing to news",{code:e.code,reason:e.reason});return this.events.fire("error",i),void(n&&t.callback(i))}if(e.newsFilters){var o=e.newsFilters,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u;r.unsubscribed.push(l)}}0===t.id.length&&n&&n(null,t.result)},i.prototype.onTradeUnsubscribeResponse=function(e){var t=this.pendingTradeUnsubscription[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingTradeUnsubscription[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}var i=t.result;e.notificationType&&(this.log.debug("Trade "+e.notificationType),i.notificationType=e.notificationType),0===t.id.length&&n&&n(null,t.result)},i.prototype.onNewsCmdFilterRefreshResponse=function(e){if(200==e.code)this.events.fire("msg",e);else{var t=w.error("Error Refreshing News Filters",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onNewsCmdFilterResponse=function(e){if(200==e.code)this.events.fire("filter status",e);else{var t=w.error("Error Getting News Filters Status",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onUnsubscribeResponse=function(e){var t=this.pendingUnsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.ids,e.__id),delete this.pendingUnsubscriptions[e.__id],200!=e.code&&!t.failed){t.failed=!0;var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&n(r))}for(var i=0;i<e.unsubscribed.length;++i){var o=t.result,s=e.unsubscribed[i],a=s.symbol,u=s.marketdatatype;this.log.debug("UNSUBSCRIBED <"+a+", "+u+">"),o.unsubscribed.push({symbol:a,type:u})}0!==t.ids.length||t.failed||n&&n(null,t.result)},i.prototype.onExchangeUnsubscribeResponse=function(e){var t=this.pendingExchangeUnsubscriptions[e.__id],n=t.callback;if((0,O.removeFromArray)(t.id,e.__id),delete this.pendingExchangeUnsubscriptions[e.__id],200!=e.code){var r=w.error("Error unsubscribing",{code:e.code,reason:e.reason});return this.events.fire("error",r),void(n&&t.callback(r))}0===t.id.length&&n&&n(null,t)},i.prototype.onReconnectMessage=function(e){450===e.code&&(this.events.fire("slow","Reconnection recieved a slow code: "+e.code),this._isSlowConnection=!0,this.conn.setReconnect=!1),this.events.fire("reconnectMessage",e)},i.prototype.onConnectResponse=function(e){if(200!==e.code){var t=w.error("Connection failed",{code:e.code,reason:e.reason});return this.events.fire("error",t),this.pendingConnection&&this.pendingConnection(t),void this.doClose(t)}if(this._serverversion=e.version,this.maxEntitlementsPerSubscription=e.maxEntitlementsPerSubscription,this.isClosed()){var n=w.error("Connection was already closed",{code:-1,reason:"Already disconnected"});return this.events.fire("error",n),void(this.pendingConnection&&this.pendingConnection(n))}this.conn.setServer(e.serverInstance),this.pendingConnection&&this.pendingConnection(null,this)},i.prototype.onConnectionClose=function(e){this.doClose(w.close({reason:e.reason,code:e.code}))},i.prototype.onSlowConnection=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("slow",e)},i.prototype.onStatsResponse=function(e){if(200==e.code)this.events.fire("stats",e);else{var t=w.error("Error getting stats",{code:e.code,reason:e.reason});this.events.fire("error",t)}},i.prototype.onInitialDataSent=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("initialDataSent",e)},i.prototype.onResubscribeMessage=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("resubscribeMessage",e)},i.prototype.onMissedDataSent=function(e){this.log.debug(E.msgfmt.fmt(e)),this.events.fire("missedDataSent",e)},i.prototype.onOpenFlow=function(e){this.conn.send(e)},i.prototype._handledatamsg=function(e){this.events.fire("message",e)},i.prototype.send=function(e){this.conn&&this.conn.send(e)},i.prototype.sendCustomFrame=function(e,t,n,r){this.conn&&this.conn.sendCustomFrame(e,t,n,r)},i.prototype.doClose=function(e){if(!this.isClosed()){var t=this.conn;this.conn=null,t.close(),this.events.fire("close",e),t.isReconnect()&&(this.events=new m["default"],this.conn=t)}},i.prototype.performReconnect=function(e){if(null!=this.conn&&this.conn.isReconnect()){if(this.conn.isConnectionUp)return void this.log.warn("Connection is not closed and won't try reconnect.");this.conn.setReconnect(!0),this.conn.tryReopen(),e&&e()}else this.log.warn("Reconnect flag is set to false")},i.prototype.close=function(e){this.doClose(w.close({reason:"Manually closed",code:200})),e&&e()},i.prototype.isClosed=function(){return null==this.conn},i}();T["default"]=g}).call(this,b("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},b("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],b("timers").setImmediate,b("timers").clearImmediate,"/lib/stomp/StompStream.js","/lib/stomp")},{"../EventSupport.js":2,"../UShortId.js":9,"../formatting.js":13,"../logging.js":16,"../polyfills.js":18,"../streamer-api.js":108,"../streamer-events.js":109,"../streamer-utils.js":110,"../utils.js":115,_process:131,buffer:121,timers:152}],107:[function(v,e,O){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";O.__esModule=!0,v("../polyfills.js");var f=v("../logging.js"),p=v("../streamer-api.js"),h=v("../message.js"),d=_(v("../transmission/JsonStompTransmitter.js")),m=_(v("./StompConnection.js")),E=_(v("./StompStream.js"));function _(e){return e&&e.__esModule?e:{"default":e}}var g="/ping/v1",b="/version/v1",T="/stream/connect",y="",S=function(){function o(e,t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.http=e,this.stompJs=t,this.log=(0,f.asLogger)(n),this.config=r||{},this.maxReconnectAttempts=this.config.maxReconnectAttempts,this.format=this.config.format,"application/json"===this.config.format&&(this.createTransmitter=function(e){return new d["default"](e,i.log)})}return o.prototype.openStompSocket=function(t,e){y="";var n={"X-Stream-Version":p.VERSION,"X-Stream-Lib":p.LIBRARY_NAME};this.addToHeaderParams("X-Stream-Version",p.VERSION),this.addToHeaderParams("X-Stream-Lib",p.LIBRARY_NAME);var r=this.config.conflation;null!=r&&""!==r&&(n["X-Stream-Conflation"]=r,this.addToHeaderParams("X-Stream-Conflation",r)),null!=e&&""!==e&&(n["X-Stream-Previous-Connection-Id"]=e,this.addToHeaderParams("X-Stream-Previous-Connection-Id",e));var i=this.config.intervalPeriod;null!=i&&""!==i&&(n["X-Stream-Interval-Period"]=i,this.addToHeaderParams("X-Stream-Interval-Period",i));var o=this.config.rejectExcessiveConnection;null!=o&&""!==o&&(n["X-Stream-Reject"]=o,this.addToHeaderParams("X-Stream-Reject",o)),"application/json"!==this.config.format&&this.config.format!==h.MimeTypes.QITCH||(n["X-Stream-Format"]=this.format,this.addToHeaderParams("X-Stream-Format",this.format)),"true"===this.config.updatesOnly&&(n["X-Stream-UpdatesOnly"]=!0,this.addToHeaderParams("X-Stream-UpdatesOnly",!0));var s=this.config.isReconnect;null!=s&&""!==s&&(n["x-Stream-isReconnect"]=s,this.addToHeaderParams("x-Stream-isReconnect",s));var a=this.config.alwaysReconnect;null!=a&&""!==a&&(n["x-Stream-isAlwaysReopen"]=a,this.addToHeaderParams("x-Stream-isAlwaysReopen",a)),"ALL"===this.config.isMissedData?(n["X-Stream-isReceiveAllMissedData"]=!0,this.addToHeaderParams("X-Stream-isReceiveAllMissedData",!0)):"LATEST"===this.config.isMissedData&&(n["X-Stream-isReceiveLatestMissedData"]=!0,this.addToHeaderParams("X-Stream-isReceiveLatestMissedData",!0));var u=this.config.stompWmid;null!=u&&(n.wmid=u,this.addToHeaderParams("wmid",u));var l=this.config.userSymbology;null!=l&&""!==l&&(n["X-Stream-User-Symbology"]=l,this.addToHeaderParams("X-Stream-User-Symbology",l)),Object.assign(n,this.config.credentials.getHeaders());var c=this.config.url+T+y,f=this.stompJs.Stomp.client(c),d=new p.messages.control.AuthenticationMessage;return this.config.credentials.sid!==undefined?(d.authenticationMethod="sid",d.authorization=this.config.credentials.sid):this.config.credentials.wmid!==undefined&&this.config.credentials.token!==undefined?(d.authenticationMethod="enterprise",d.wmid=this.config.credentials.wmid,d.authorization=this.config.credentials.token):this.config.credentials.wmid!==undefined?(d.authenticationMethod="wmid",d.authorization=this.config.credentials.wmid):this.config.credentials.data_token!==undefined&&(d.authenticationMethod="datatool",d.authorization=this.config.credentials.data_token),null!=this.config.conflation&&""!==this.config.conflation&&(d.conflation=this.config.conflation),null!=this.config.rejectExcessiveConnection&&""!==this.config.rejectExcessiveConnection&&(d.rejectExcessiveConnection=this.config.rejectExcessiveConnection),null!=this.config.entMax&&""!==this.config.entMax&&(d.entMax=this.config.entMax),f.connect(n,function(e){f.subscribe("/user/queue/messages",function(e){t(n).onMessage(e)}),t(n).onOpen(e),f.send("/stream/message",n,JSON.stringify(d))},function(e){t(n).onError(e)}),{send:function(e){f.send("/stream/message",n,e)},close:function(){f.disconnect(function(){t(n).onClose()})},sendCustomFrame:function(e,t,n,r){f.sendCustomFrame(e,t,n,r)}}},o.prototype.createStompConnection=function(){var n=this;return new m["default"](function(e){return n.createTransmitter(e)},function(e,t){return n.openStompSocket(e,t)},this.log,this.maxReconnectAttempts,this.config.host+g)},o.prototype.openStompStream=function(e){new E["default"](this,this.format,this.log).openStomp(e)},o.prototype.ping=function(t){this.http({url:this.config.host+g,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.getVersion=function(t){this.http({url:this.config.host+b,success:function(e){return t(null,e)},type:"GET",failure:t})},o.prototype.addToHeaderParams=function(e,t){y=""===y?y+"?"+e+"="+t:y+"&"+e+"="+t},o}();O["default"]=S}).call(this,v("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},v("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],v("timers").setImmediate,v("timers").clearImmediate,"/lib/stomp/StompStreamingService.js","/lib/stomp")},{"../logging.js":16,"../message.js":17,"../polyfills.js":18,"../streamer-api.js":108,"../transmission/JsonStompTransmitter.js":111,"./StompConnection.js":105,"./StompStream.js":106,_process:131,buffer:121,timers:152}],108:[function(e,t,d){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";d.__esModule=!0;d.LIBRARY_NAME="JavaScript",d.VERSION="2.56.0";var f=d.messages={};f.control={},f.market={},f.JSON_TYPE_PROPERTY="@T",f.MessageTypeNames={ctrl:{HEARTBEAT:"C1",SUBSCRIBE:"C2",SUBSCRIBE_RESPONSE:"C3",UNSUBSCRIBE_RESPONSE:"C4",CONNECT_RESPONSE:"C5",CONNECTION_CLOSE:"C6",FLOW:"C7",SLOW_CONNECTION:"C8",INITIAL_DATA_SENT:"C9",RESUBSCRIBE_MESSAGE:"C10",STATS:"C12",STATS_RESPONSE:"C13",EXCHANGE_SUBSCRIBE:"C14",EXCHANGE_RESPONSE:"C15",EXCHANGE_UNSUBSCRIBE_RESPONSE:"C16",NEWS_SUBSCRIBE:"C17",NEWS_SUBSCRIBE_RESPONSE:"C18",ALERTS_SUBUNSUB:"C19",ALERTS_SUBUNSUB_RESPONSE:"C20",TRADE_SUBSCRIBE:"C21",TRADE_SUBSCRIBE_RESPONSE:"C22",NEWS_UNSUBSCRIBE_RESPONSE:"C23",NEWS_COMMAND:"C24",NEWS_CMD_FILTER_REFRESH_RESPONSE:"C25",NEWS_CMD_FILTER_RESPONSE:"C26",AUTHENTICATION:"C27",OPEN_FLOW:"C28",RECONNECT_RESPONSE:"C29",TRADE_UNSUBSCRIBE_RESPONSE:"C30",MISSED_DATA_SENT:"C31",CORP_EVENT_MESSAGE:"C33",CORP_EVENT_RESPONSE:"C34"},data:{QUOTE:"D1",PRICEDATA:"D2",TRADE:"D3",BOOKORDER:"D4",BOOKDELETE:"D5",PURGEBOOK:"D6",MMQUOTE:"D7",INTERVAL:"D8",NETHOUSEPOSITION:"D9",SYMBOLINFO:"D10",SYMBOLSTATUS:"D11",DERIVATIVEINFO:"D12",LASTSALE:"D13",LIMITUPLIMITDOWN:"D14",IVGREEKS:"D15",IMBALANCESTATUS:"D16",ALERT:"D17",NEWS:"D18",TRADENOTIFICATION:"D19",NEWSCMDFILTER:"D20",NEWSERROR:"D21",DIVIDEND:"D22",EARNINGS:"D23",SPLIT:"D24",SYMBOLCHANGED:"D25",PRICELEVEL:"D26",MMPRICELEVEL:"D27"}},f.Message=function(){},f.Message.prototype.init=function(e){this[f.JSON_TYPE_PROPERTY]=e},f.control.CtrlMessage=function(){},f.control.CtrlMessage.prototype=new f.Message,f.control.Heartbeat=function(){this.init(f.MessageTypeNames.ctrl.HEARTBEAT),this.timestamp=null},f.control.Heartbeat.prototype=new f.control.CtrlMessage,f.control.StatsMessage=function(){this.init(f.MessageTypeNames.ctrl.STATS)},f.control.StatsMessage.prototype=new f.control.CtrlMessage,f.control.SubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.SUBSCRIBE),this.action=null,this.symbols=[],this.types=[],this.mimetype=null,this.conflation=null},f.control.SubscribeMessage.prototype=new f.control.CtrlMessage,f.control.ExchangeSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_SUBSCRIBE),this.action=null,this.exchange=null,this.mimetype=null,this.conflation=null},f.control.ExchangeSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.NewsSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.NEWS_SUBSCRIBE),this.action=null,this.newsFilters=null,this.mimetype=null},f.control.NewsSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.NewsCommandMessage=function(){this.init(f.MessageTypeNames.ctrl.NEWS_COMMAND),this.newsAction=null,this.mimetype=null},f.control.NewsCommandMessage.prototype=new f.control.CtrlMessage,f.control.CorpEventSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.CORP_EVENT_MESSAGE),this.action=null,this.symbols=[],this.corpEventTypes=[],this.allCorpEvents=null,this.mimeType=null},f.control.CorpEventSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.AlertsSubUnsubMessage=function(){this.init(f.MessageTypeNames.ctrl.ALERTS_SUBUNSUB),this.operation=null,this.mimetype=null},f.control.AlertsSubUnsubMessage.prototype=new f.control.CtrlMessage,f.control.TradeSubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.TRADE_SUBSCRIBE),this.action=null,this.notificationType=null,this.mimetype=null},f.control.TradeSubscribeMessage.prototype=new f.control.CtrlMessage,f.control.BaseResponse=function(){this.code=null,this.reason=null},f.control.BaseResponse.prototype=new f.control.CtrlMessage,f.control.SubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.SUBSCRIBE_RESPONSE),this.entitlements=null,this.invalidsymbols=null,this.rejectedsymbols=null,this.messagefilters=null},f.control.SubscribeResponse.prototype=new f.control.BaseResponse,f.control.ExchangeSubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_RESPONSE)},f.control.ExchangeSubscribeResponse.prototype=new f.control.BaseResponse,f.control.AlertSubUnsubResponse=function(){this.init(f.MessageTypeNames.ctrl.ALERTS_SUBUNSUB_RESPONSE)},f.control.AlertSubUnsubResponse.prototype=new f.control.BaseResponse,f.control.TradeSubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.TRADE_SUBSCRIBE_RESPONSE)},f.control.TradeSubscribeResponse.prototype=new f.control.BaseResponse,f.control.UnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.UNSUBSCRIBE_RESPONSE),this.unsubscribed=null},f.control.UnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.ExchangeUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.EXCHANGE_UNSUBSCRIBE_RESPONSE)},f.control.ExchangeUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.NewsUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.NEWS_UNSUBSCRIBE_RESPONSE),this.unsubscribed=null},f.control.NewsUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.CorporateEventResponse=function(){this.init(f.MessageTypeNames.ctrl.CORP_EVENT_RESPONSE),this.subscribed=[],this.unsubscribed=[],this.invalid=[]},f.control.CorporateEventResponse.prototype=new f.control.BaseResponse,f.control.TradeUnsubscribeResponse=function(){this.init(f.MessageTypeNames.ctrl.TRADE_UNSUBSCRIBE_RESPONSE)},f.control.TradeUnsubscribeResponse.prototype=new f.control.BaseResponse,f.control.StreamEntitlement=function(){this.symbol=null,this.marketdatatype=null,this.entitlement=null},f.control.ConnectResponse=function(){this.init(f.MessageTypeNames.ctrl.CONNECT_RESPONSE),this.version=null,this.flowControlCheckInterval=null,this.serverInstance=null,this.conflationMs=null},f.control.ConnectResponse.prototype=new f.control.BaseResponse,f.control.ReconnectResponse=function(){undefined.init(f.MessageTypeNames.ctrl.RECONNECT_RESPONSE),undefined.version=null,undefined.flowControlCheckInterval=null,undefined.serverInstance=null,undefined.conflationMs=null,undefined.previousSubscriptions=null},f.control.ConnectionClose=function(){this.init(f.MessageTypeNames.ctrl.CONNECTION_CLOSE),this.code=null,this.reason=null},f.control.ConnectionClose.prototype=new f.control.CtrlMessage,f.control.SlowConnection=function(){this.init(f.MessageTypeNames.ctrl.SLOW_CONNECTION),this.timesExceeded=null,this.maxExceed=null},f.control.SlowConnection.prototype=new f.control.CtrlMessage,f.control.FlowMessage=function(){this.init(f.MessageTypeNames.ctrl.FLOW),this.sequence=null},f.control.FlowMessage.prototype=new f.control.CtrlMessage,f.control.AuthenticationMessage=function(){this.init(f.MessageTypeNames.ctrl.AUTHENTICATION),this.authenticationMethod=null,this.wmid=null,this.authorization=null,this.conflation=150,this.rejectExcessiveConnection=!1,this.entMax=null},f.control.AuthenticationMessage.prototype=new f.control.CtrlMessage,f.control.StatsResponse=function(){this.init(f.MessageTypeNames.ctrl.STATS_RESPONSE),this.numberOfSubscribedSymbolsL1=null,this.numberOfAvailableSymbolsL1=null,this.numberOfSubscribedSymbolsL2=null,this.numberOfAvailableSymbolsL2=null,this.numberOfOpenedConnections=null,this.numberOfAvailableConnections=null,this.numberOfSubscribedExchanges=null,this.numberOfSubscribedTrades=null},f.control.StatsResponse.prototype=new f.control.BaseResponse,f.control.InitialDataSent=function(){this.init(f.MessageTypeNames.ctrl.INITIAL_DATA_SENT),this.timestamp=null},f.control.InitialDataSent.prototype=new f.control.CtrlMessage,f.control.ResubscribeMessage=function(){this.init(f.MessageTypeNames.ctrl.RESUBSCRIBE_MESSAGE),this.timestamp=null},f.control.ResubscribeMessage.prototype=new f.control.CtrlMessage,f.control.MissedDataSent=function(){this.init(f.MessageTypeNames.ctrl.MISSED_DATA_SENT),this.timestamp=null},f.control.MissedDataSent.prototype=new f.control.CtrlMessage,f.control.StreamEntitlementType={RT:"Realtime",RTO:"Realtime CBOE ONE",RTN:"Realtime NASDAQ",RTB:"Realtime BATS",DL:"Delayed",DLO:"Delayed CBOE One",DLN:"Delayed NASDAQ",NA:"Not Entitled"},f.control.Action={SUBSCRIBE:"SUBSCRIBE",UNSUBSCRIBE:"UNSUBSCRIBE"},f.control.Association={AND:"AND",OR:"OR",NOT:"NOT"},f.control.MarketdataType={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",MMQUOTE:"MMQUOTE",ORDERBOOK:"ORDERBOOK",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",LASTSALE:"LASTSALE",BOOKORDER:"BOOKORDER",BOOKDELETE:"BOOKDELETE",PRICELEVEL:"PRICELEVEL",MMPRICELEVEL:"MMPRICELEVEL",PURGEBOOK:"PURGEBOOK",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS"},f.market.SubscriptionTypes={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",MMQUOTE:"MMQUOTE",ORDERBOOK:"ORDERBOOK",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",LASTSALE:"LASTSALE",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS"},f.market.CorporateEventTypes={DIVIDEND:"DIVIDEND",SPLIT:"SPLIT",EARNINGS:"EARNINGS",SYMBOLCHANGED:"SYMBOLCHANGED"},f.market.MarketDataResponseTypes={QUOTE:"QUOTE",PRICEDATA:"PRICEDATA",TRADE:"TRADE",INTERVAL:"INTERVAL",NETHOUSEPOSITION:"NETHOUSEPOSITION",MMQUOTE:"MMQUOTE",PRICELEVEL:"PRICELEVEL",MMPRICELEVEL:"MMPRICELEVEL",BOOKORDER:"BOOKORDER",PURGEBOOK:"PURGEBOOK",BOOKDELETE:"BOOKDELETE",SYMBOLINFO:"SYMBOLINFO",SYMBOLSTATUS:"SYMBOLSTATUS",DERIVATIVEINFO:"DERIVATIVEINFO",LASTSALE:"LASTSALE",LIMITUPLIMITDOWN:"LIMITUPLIMITDOWN",IVGREEKS:"IVGREEKS",IMBALANCESTATUS:"IMBALANCESTATUS",ALERT:"ALERT",NEWS:"NEWS",TRADENOTIFICATION:"TRADENOTIFICATION",NEWSCMDFILTER:"NEWSCMDFILTER",NEWSERROR:"NEWSERROR",DIVIDEND:"DIVIDEND"},f.control.ResponseCodes={OK_CODE:200,OK_REASON:"OK",BADREQUEST_CODE:400,BADREQUEST_REASON:"Bad Request",UNAUTHORIZED_CODE:401,UNAUTHORIZED_REASON:"Unauthorized",TOOSLOW_CODE:450,TOOSLOW_REASON:"Too slow",DATA_SOURCE_RESET:454,DATA_SOURCE_RESET_REASON:"Data Source Was Reset",CONNECTION_LIMIT_EXCEEDED_CODE:452,CONNECTION_LIMIT_EXCEEDED_REASON:"Connection Limit Exceeded",INTERNALSERVERERROR_CODE:500,INTERNALSERVERERROR_REASON:"Internal Server Error"},f.market.DataMessage=function(){this.messageType=null},f.market.DataMessage.prototype=new f.Message,f.market.Quote=function(){this.init(f.MessageTypeNames.data.QUOTE)},f.market.Quote.prototype=new f.market.DataMessage,f.market.PriceData=function(){this.init(f.MessageTypeNames.data.PRICEDATA)},f.market.PriceData.prototype=new f.market.DataMessage,f.market.Trade=function(){this.init(f.MessageTypeNames.data.TRADE)},f.market.Trade.prototype=new f.market.DataMessage,f.market.MMQuote=function(){this.init(f.MessageTypeNames.data.MMQUOTE)},f.market.MMQuote.prototype=new f.market.DataMessage,f.market.PurgeBook=function(){this.init(f.MessageTypeNames.data.PURGEBOOK)},f.market.PurgeBook.prototype=new f.market.DataMessage,f.market.BookOrder=function(){this.init(f.MessageTypeNames.data.BOOKORDER)},f.market.BookOrder.prototype=new f.market.DataMessage,f.market.BookDelete=function(){this.init(f.MessageTypeNames.data.BOOKDELETE)},f.market.BookDelete.prototype=new f.market.DataMessage,f.market.PriceLevel=function(){this.init(f.MessageTypeNames.data.PRICELEVEL)},f.market.PriceLevel.prototype=new f.market.DataMessage,f.market.MMPriceLevel=function(){this.init(f.MessageTypeNames.data.MMPRICELEVEL)},f.market.MMPriceLevel.prototype=new f.market.DataMessage,f.market.Interval=function(){this.init(f.MessageTypeNames.data.INTERVAL)},f.market.Interval.prototype=new f.market.DataMessage,f.market.NethousePosition=function(){this.init(f.MessageTypeNames.data.NETHOUSEPOSITION)},f.market.NethousePosition.prototype=new f.market.DataMessage,f.market.SymbolInfo=function(){this.init(f.MessageTypeNames.data.SYMBOLINFO)},f.market.SymbolInfo.prototype=new f.market.DataMessage,f.market.SymbolStatus=function(){this.init(f.MessageTypeNames.data.SYMBOLSTATUS)},f.market.SymbolStatus.prototype=new f.market.DataMessage,f.market.DerivativeInfo=function(){this.init(f.MessageTypeNames.data.DERIVATIVEINFO)},f.market.DerivativeInfo.prototype=new f.market.DataMessage,f.market.IVGreeks=function(){this.init(f.MessageTypeNames.data.IVGREEKS)},f.market.IVGreeks.prototype=new f.market.DataMessage,f.market.LastSale=function(){this.init(f.MessageTypeNames.data.LASTSALE)},f.market.LastSale.prototype=new f.market.DataMessage,f.market.LimitUpLimitDown=function(){this.init(f.MessageTypeNames.data.LIMITUPLIMITDOWN)},f.market.LimitUpLimitDown.prototype=new f.market.DataMessage,f.market.ImbalanceStatus=function(){this.init(f.MessageTypeNames.data.IMBALANCESTATUS)},f.market.ImbalanceStatus.prototype=new f.market.DataMessage,f.market.Alert=function(){this.init(f.MessageTypeNames.data.ALERT)},f.market.Alert.prototype=new f.market.DataMessage,f.market.InstrumentType={1:"CASH",2:"BOND",3:"COMPOSITE",4:"FUTURE",5:"FUTURE_OPTION",6:"FOREX",7:"INDEX",8:"MUTUAL_FUND",9:"MONEY_MARKET_FUND",10:"MARKET_STAT",11:"EQUITY",12:"EQUITY_OPTION",13:"GOVT_BOND",14:"MUNI_BOND",15:"CORP_BOND",16:"ETF",17:"FUTURE_SPREAD",97:"OPTION_ROOT",98:"UNKNOWN",99:"RATE"},f.market.OrderSide={BUYSIDE:"B",SELLSIDE:"S"},f.market.ImbalanceType={0:"NONE",1:"MARKET",2:"MOC",3:"REGULATORY_IMBALANCE",4:"OPENING_IMBALANCE",5:"CLOSING_IMBALANCE",6:"IPO_IMBALANCE",7:"HALT_IMBALANCE",8:"EQUILIBRIUM"},f.market.OrderChangeType={A:"ADD",M:"MODIFY",C:"CANCEL",E:"EXECUTE"}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/streamer-api.js","/lib")},{_process:131,buffer:121,timers:152}],109:[function(p,e,h){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";h.__esModule=!0,p("./polyfills");var f=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Object.assign(this,e)}return t.prototype.toString=function(){var e=this.type+"{",t=!0;for(var n in this)"type"!==n&&"function"!=typeof this[n]&&(t||(e+=", "),e+=n+": "+JSON.stringify(this[n]),t=!1);return e+="}"},t}(),d=h.event=function(e,t){return new f(Object.assign({type:e},t))};h.error=function(e,t){return d("error",Object.assign({description:e},t))},h.close=function(e){return d("close",e)}}).call(this,p("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],p("timers").setImmediate,p("timers").clearImmediate,"/lib/streamer-events.js","/lib")},{"./polyfills":18,_process:131,buffer:121,timers:152}],110:[function(p,e,h){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";h.__esModule=!0,h.getMessageName=h.entitlement=h.isvalid=h.iscontrolmessage=h.isdatamessage=h.messagetype=undefined;var f,d=p("./streamer-api.js");h.messagetype=function(e){return null===e?null:e[d.messages.JSON_TYPE_PROPERTY]},h.isdatamessage=function(e){if(null===e)return!1;var t=h.messagetype(e);return null!==t&&t.startsWith("D")},h.iscontrolmessage=function(e){if(null===e)return!1;var t=h.messagetype(e);return null!==t&&t.startsWith("C")},h.isvalid=function(e,t){var n=t.invalidSymbols;if(null==n)return!0;for(var r=0;r<n.length;r++){if(n[r]===e)return!1}return!0},h.entitlement=function(e,t,n){var r=n.entitlements;if(null!=r)for(var i=0;i<r.length;i++){var o=r[i];if(o.symbol===e&&o.marketdatatype===t)return o.entitlement}return null},h.getMessageName=(f={},function(e){var t=e[d.messages.JSON_TYPE_PROPERTY];if(!f[t]){var n=d.messages.MessageTypeNames.ctrl;for(var r in n)if(n[r]===t)return f[t]=r;var i=d.messages.MessageTypeNames.data;for(var o in i)if(i[o]===t)return f[t]=o;return f[t]=t}return f[t]})}).call(this,p("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],p("timers").setImmediate,p("timers").clearImmediate,"/lib/streamer-utils.js","/lib")},{"./streamer-api.js":108,_process:131,buffer:121,timers:152}],111:[function(m,e,E){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";E.__esModule=!0;var f,d=m("../EventSupport.js"),p=(f=d)&&f.__esModule?f:{"default":f};var h=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.socket=e,this.log=t,this.events=new p["default"](this)}return n.prototype.send=function(e,t){this.socket.send(JSON.stringify(e))},n.prototype.sendCustomFrame=function(e,t,n,r){this.socket.sendCustomFrame(e.toString(),t.toString(),JSON.parse(n),JSON.stringify(r))},n.prototype.onMessage=function(e){var t=null;try{t=JSON.parse(e)}catch(r){return void this.log.error(r)}var n=t;n.__id=n.requestId,this.events.fire("message",n)},n.prototype.on=function(e,t){return this.events.on(e,t)},n}();E["default"]=h}).call(this,m("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],m("timers").setImmediate,m("timers").clearImmediate,"/lib/transmission/JsonStompTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,_process:131,buffer:121,timers:152}],112:[function(m,e,E){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";E.__esModule=!0;m("../message.js");var f,d=m("../EventSupport.js"),p=(f=d)&&f.__esModule?f:{"default":f};var h=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.socket=e,this.log=t,this.events=new p["default"](this)}return n.prototype.send=function(e,t){this.socket.push({trackMessageLength:!0,data:JSON.stringify(e)})},n.prototype.onMessage=function(e){var t=null;try{t=JSON.parse(e)}catch(o){return void this.log.error(o)}this.events.fire("sequence",t.seq);for(var n=t.data.length,r=0;r<n;r++){var i=t.data[r];i.__id=i.requestId,this.events.fire("message",i)}},n.prototype.on=function(e,t){return this.events.on(e,t)},n}();E["default"]=h}).call(this,m("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],m("timers").setImmediate,m("timers").clearImmediate,"/lib/transmission/JsonTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../message.js":17,_process:131,buffer:121,timers:152}],113:[function(S,e,v){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";v.__esModule=!0;var f=T(S("../EventSupport.js")),d=T(S("../SMessage")),p=S("../qitch/decoder/QitchDecoder"),h=T(p),m=T(S("../qitch/encoder/QitchEncoder")),E=T(S("../UShortId.js")),_=S("../message.js"),g=T(S("../qitch/LocateCodeInjector")),b=S("../utils");function T(e){return e&&e.__esModule?e:{"default":e}}var y=function(){function r(e,t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.socket=e,!(t instanceof m["default"]))throw"Wrong encoder";this.encoder=t,this.log=n,this.events=new f["default"](this),this.decoder=new h["default"](r.prototype.DEFAULT_BUFFERSIZE),this.locateCodeInjector=new g["default"]}return r.prototype.send=function(e,t){var n=new d["default"];n.sequencenumber=e.sequenceNumber,n.timestamp=(new Date).getTime(),n.id=null!=t?t:E["default"].NULL,n.encoding=_.Encodings.NONE_CHAR,n.mimetype=_.MimeTypes.QITCH_CHAR,n.payload=e;var r={trackMessageLength:!1,data:this.encoder.encode(n,0)};this.socket.push(r)},r.prototype.onMessage=function(e){var t=void 0;t=e instanceof ArrayBuffer?e:(0,b.asciiStringToArrayBuffer)(e);var n=null;try{n=this.decoder.decode(new Int8Array(t))}catch(o){return void this.log.error(o)}if(null!=n)for(var r=0;r<n.length;r++)if(n[r]instanceof p.MessageBlock)for(var i=0;i<n[r].messages.length;i++)this._processMessage(n[r].messages[i]);else this._processMessage(n[r]);else this.log.debug("Couldn't decode message. Ignoring unsupported message")},r.prototype.on=function(e,t){return this.events.on(e,t)},r.prototype._processMessage=function(e){this.locateCodeInjector.injectLocateCode(e.decodedPayload),this.events.fire("sequence",e.sequencenumber),e.decodedPayload.__id=e.id,this.events.fire("message",e.decodedPayload)},r}();y.prototype.DEFAULT_BUFFERSIZE=4096,v["default"]=y}).call(this,S("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],S("timers").setImmediate,S("timers").clearImmediate,"/lib/transmission/QitchTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../SMessage":5,"../UShortId.js":9,"../message.js":17,"../qitch/LocateCodeInjector":23,"../qitch/decoder/QitchDecoder":46,"../qitch/encoder/QitchEncoder":76,"../utils":115,_process:131,buffer:121,timers:152}],114:[function(_,e,g){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";g.__esModule=!0;var f=_("../message.js"),d=m(_("../SMessage.js")),p=m(_("../UShortId.js")),h=m(_("../EventSupport.js"));_("../formatting.js");function m(e){return e&&e.__esModule?e:{"default":e}}var E=function(){function i(e,t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.socket=e,this.encoder=t,this.decoder=n,this.log=r,this.events=new h["default"](this)}return i.prototype.send=function(e,t){var n=new d["default"];n.sequencenumber=e.sequenceNumber,n.timestamp=(new Date).getTime(),n.id=null!=t?t:p["default"].NULL,n.encoding=f.Encodings.NONE_CHAR,n.mimetype=f.MimeTypes.JSON_CHAR,n.payload=JSON.stringify(e);var r={trackMessageLength:!0,data:this.encoder.encode(n)};this.socket.push(r)},i.prototype.onMessage=function(e){var t=this.decoder.decode(e);if(this.events.fire("sequence",t.sequencenumber),t.encoding===f.Encodings.NONE_CHAR)if(t.mimetype===f.MimeTypes.JSON_CHAR){var n=null;try{n=JSON.parse(t.payload)}catch(r){return void this.log.error(r)}n.__id=t.id,this.events.fire("message",n)}else this.log.debug("Unhandled mimetype: "+t.mimeType+" - "+t.payload);else this.log.debug("Unhandled encoding: "+t.encoding+" - "+t.payload)},i.prototype.on=function(e,t){return this.events.on(e,t)},i}();g["default"]=E}).call(this,_("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],_("timers").setImmediate,_("timers").clearImmediate,"/lib/transmission/SMessageTransmitter.js","/lib/transmission")},{"../EventSupport.js":2,"../SMessage.js":5,"../UShortId.js":9,"../formatting.js":13,"../message.js":17,_process:131,buffer:121,timers:152}],115:[function(e,t,d){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";d.__esModule=!0;d.forEachPartition=function(e,t,n){if(e)for(var r=0;r<e.length;r+=t){n(e.slice(r,r+t))}};var f=d.indexOf=function(e,t){for(var n=e.length,r=0;r<n;++r)if(t===e[r])return r;return-1};d.removeFromArray=function(e){for(var t,n,r=arguments.length<=1?0:arguments.length-1;0<r&&e.length;){var i;for(i=1+--r,t=arguments.length<=i?undefined:arguments[i];-1!==(n=f(e,t));)e.splice(n,1)}return e},d.asciiStringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/lib/utils.js","/lib")},{_process:131,buffer:121,timers:152}],116:[function(e,f,t){(function(e,t,n,r,i,o,s,a,u,l,c){f.exports=function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/node_modules/array-equal/index.js","/node_modules/array-equal")},{_process:131,buffer:121,timers:152}],117:[function(e,t,b){(function(e,t,n,r,i,o,s,a,u,l,c){"use strict";b.byteLength=function(e){var t=_(e),n=t[0],r=t[1];return 3*(n+r)/4-r},b.toByteArray=function(e){for(var t,n=_(e),r=n[0],i=n[1],o=new p((l=r,c=i,3*(l+c)/4-c)),s=0,a=0<i?r-4:r,u=0;u<a;u+=4)t=d[e.charCodeAt(u)]<<18|d[e.charCodeAt(u+1)]<<12|d[e.charCodeAt(u+2)]<<6|d[e.charCodeAt(u+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;var l,c;2===i&&(t=d[e.charCodeAt(u)]<<2|d[e.charCodeAt(u+1)]>>4,o[s++]=255&t);1===i&&(t=d[e.charCodeAt(u)]<<10|d[e.charCodeAt(u+1)]<<4|d[e.charCodeAt(u+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},b.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,s=n-r;o<s;o+=16383)i.push(g(e,o,s<o+16383?s:o+16383));1===r?(t=e[n-1],i.push(f[t>>2]+f[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(f[t>>10]+f[t>>4&63]+f[t<<2&63]+"="));return i.join("")};for(var f=[],d=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,E=h.length;m<E;++m)f[m]=h[m],d[h.charCodeAt(m)]=m;function _(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function g(e,t,n){for(var r,i,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(f[(i=r)>>18&63]+f[i>>12&63]+f[i>>6&63]+f[63&i]);return o.join("")}d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate,e("timers").clearImmediate,"/node_modules/base64-js/index.js","/node_modules/base64-js")},{_process:131,buffer:121,timers:152}],118:[function(e,f,t){(function(e,t,n,r,i,o,s,a,u,l,c){!function(t){"use strict";
|
|
48
48
|
/*
|
|
49
49
|
* bignumber.js v9.0.0
|
|
50
50
|
* A JavaScript library for arbitrary-precision arithmetic.
|