webstomp-obs
Version:
Stomp over websocket using observable
1 lines • 56.4 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("webstompobs",[],e):"object"==typeof exports?exports.webstompobs=e():t.webstompobs=e()}(global,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r.w={},r(r.s=87)}([function(t,e,r){"use strict";var n=r(5),i=r(85),o=r(20),s=r(83),c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=i.toSubscriber(t,e,r);if(n?n.call(o,this.source):o.add(this.source||!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var r=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,n){var i;i=r.subscribe(function(e){if(i)try{t(e)}catch(t){n(t),i.unsubscribe()}else t(e)},n,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[o.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:s.pipeFromArray(t)(this)},t.prototype.toPromise=function(t){var e=this;if(t||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?t=n.root.Rx.config.Promise:n.root.Promise&&(t=n.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}();e.Observable=c},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(25),o=r(2),s=r(21),c=r(9),u=function(t){function e(r,n,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!r){this.destination=s.empty;break}if("object"==typeof r){r instanceof e?(this.syncErrorThrowable=r.syncErrorThrowable,this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new a(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new a(this,r,n,i)}}return n(e,t),e.prototype[c.rxSubscriber]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(o.Subscription);e.Subscriber=u;var a=function(t){function e(e,r,n,o){var c;t.call(this),this._parentSubscriber=e;var u=this;i.isFunction(r)?c=r:r&&(c=r.next,n=r.error,o=r.complete,r!==s.empty&&(u=Object.create(r),i.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=c,this._error=n,this._complete=o}return n(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},function(t,e,r){"use strict";var n=r(24),i=r(23),o=r(25),s=r(22),c=r(10),u=r(84),a=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var r=this._parent,a=this._parents,l=this._unsubscribe,f=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var p=-1,b=a?a.length:0;r;)r.remove(this),r=++p<b&&a[p]||null;if(o.isFunction(l)&&s.tryCatch(l).call(this)===c.errorObject&&(e=!0,t=t||(c.errorObject.e instanceof u.UnsubscriptionError?h(c.errorObject.e.errors):[c.errorObject.e])),n.isArray(f))for(p=-1,b=f.length;++p<b;){var d=f[p];if(i.isObject(d)&&s.tryCatch(d.unsubscribe).call(d)===c.errorObject){e=!0,t=t||[];var v=c.errorObject.e;v instanceof u.UnsubscriptionError?t=t.concat(h(v.errors)):t.push(v)}}if(e)throw new u.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.prototype._addParent=function(t){var e=this._parent,r=this._parents;e&&e!==t?r?-1===r.indexOf(t)&&r.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function h(t){return t.reduce(function(t,e){return t.concat(e instanceof u.UnsubscriptionError?e.errors:e)},[])}e.Subscription=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6);function i(t){var e=String.fromCharCode.apply(String,t).replace(/(.)/g,function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r});return decodeURIComponent(e)}e.BYTES={LF:"\n",NULL:"\0"},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.unicodeStringToTypedArray=function(t){var e=encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x"+e)}),r=Array.prototype.map.call(e,function(t){return t.charCodeAt(0)});return new Uint8Array(r)},e.typedArrayToUnicodeString=i,e.sizeOfUTF8=function(t){return t?encodeURIComponent(t).match(/%..|./g).length:0},e.parseData=function(t,e,r){if(t instanceof ArrayBuffer&&(t=i(new Uint8Array(t))),t!==r)return s.debug("<<< "+t),n.default.unmarshall(e+t);s.debug("<<< PONG")};var o=function(){var t=this;this.hasDebug=!1,this.setDebug=function(e){t.hasDebug=e},this.debug=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];t.hasDebug&&console.log.apply(console,[e].concat(r))}};e.Log=o;var s=new o;e.logger=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(0),o=r(1),s=r(2),c=r(19),u=r(18),a=r(9),h=function(t){function e(e){t.call(this,e),this.destination=e}return n(e,t),e}(o.Subscriber);e.SubjectSubscriber=h;var l=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return n(e,t),e.prototype[a.rxSubscriber]=function(){return new h(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new c.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new c.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(t.complete(),s.Subscription.EMPTY):(this.observers.push(t),new u.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new i.Observable;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(i.Observable);e.Subject=l;var f=function(t){function e(e,r){t.call(this),this.destination=e,this.source=r}return n(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.Subscription.EMPTY},e}(l);e.AnonymousSubject=f},function(t,e,r){"use strict";var n="undefined"!=typeof window&&window,i="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,o="undefined"!=typeof global&&global,s=n||o||i;e.root=s,function(){if(!s)throw new Error("RxJS could not find any global context (window, self, global)")}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=function(){function t(t,e,r){void 0===e&&(e={}),void 0===r&&(r="");var i=this;this.toString=function(){var t=[i.command],e=!1===i.headers["content-length"];return e&&delete i.headers["content-length"],Object.keys(i.headers).forEach(function(e){var r=i.headers[e];t.push(e+":"+r)}),i.body&&!e&&t.push("content-length:"+n.sizeOfUTF8(i.body)),t.push(n.BYTES.LF+i.body),t.join(n.BYTES.LF)},this.command=t,this.headers=e,this.body=r}return t.unmarshallSingle=function(e){for(var r=e.search(new RegExp(n.BYTES.LF+n.BYTES.LF)),i=e.substring(0,r).split(n.BYTES.LF),o=i.shift(),s={},c="",u=r+2,a=0,h=i.reverse();a<h.length;a++){var l=h[a],f=l.indexOf(":");s[n.trim(l.substring(0,f))]=n.trim(l.substring(f+1))}if(s["content-length"]){var p=parseInt(s["content-length"],10);c=(""+e).substring(u,u+p)}else for(var b=null,d=u;d<e.length&&(b=e.charAt(d))!==n.BYTES.NULL;d++)c+=b;return new t(o,s,c)},t.unmarshall=function(e){var r=e.split(new RegExp(n.BYTES.NULL+n.BYTES.LF+"*")),i=r.slice(0,-1),o=r.slice(-1)[0],s={frames:i.map(function(e){return t.unmarshallSingle(e)}),partial:""};return o===n.BYTES.LF||-1!==o.search(RegExp(n.BYTES.NULL+n.BYTES.LF+"*$"))?s.frames.push(t.unmarshallSingle(o)):s.partial=o,s},t.marshall=function(e,r,i){return new t(e,r,i).toString()+n.BYTES.NULL},t}();e.default=i},function(t,e,r){"use strict";var n=r(5),i=r(52),o=r(51),s=r(23),c=r(0),u=r(50),a=r(49),h=r(20);e.subscribeToResult=function(t,e,r,l){var f=new a.InnerSubscriber(t,r,l);if(f.closed)return null;if(e instanceof c.Observable)return e._isScalar?(f.next(e.value),f.complete(),null):(f.syncErrorThrowable=!0,e.subscribe(f));if(i.isArrayLike(e)){for(var p=0,b=e.length;p<b&&!f.closed;p++)f.next(e[p]);f.closed||f.complete()}else{if(o.isPromise(e))return e.then(function(t){f.closed||(f.next(t),f.complete())},function(t){return f.error(t)}).then(null,function(t){n.root.setTimeout(function(){throw t})}),f;if(e&&"function"==typeof e[u.iterator])for(var d=e[u.iterator]();;){var v=d.next();if(v.done){f.complete();break}if(f.next(v.value),f.closed)break}else if(e&&"function"==typeof e[h.observable]){var y=e[h.observable]();if("function"==typeof y.subscribe)return y.subscribe(new a.InnerSubscriber(t,r,l));f.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var _="You provided "+(s.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";f.error(new TypeError(_))}}return null}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(r(1).Subscriber);e.OuterSubscriber=i},function(t,e,r){"use strict";var n=r(5).root.Symbol;e.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",e.$$rxSubscriber=e.rxSubscriber},function(t,e,r){"use strict";e.errorObject={e:{}}},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(3),o=r(6),s=r(12);e.default=function(){var t=s.default();return n({},t,{hearbeatMsg:function(){return i.BYTES.LF},nack:function(t,e,r){return o.default.marshall("NACK",n({},r,{"message-id":t,subscription:e}))},disconnect:function(t){return void 0===t&&(t={}),o.default.marshall("DISCONNECT",t)}})}},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(6);e.default=function(){var t=0;return{getMessageId:function(t){return t.headers["message-id"]},getSubscription:function(t){return t.headers.subscription},connect:function(t){return i.default.marshall("CONNECT",t)},disconnect:function(t){return void 0===t&&(t={}),i.default.marshall("DISCONNECT")},send:function(t,e){return void 0===t&&(t={}),void 0===e&&(e=""),i.default.marshall("SEND",t,e)},begin:function(e){return void 0===e&&(e="tx-"+t++),i.default.marshall("BEGIN",{transaction:e})},commit:function(t){return i.default.marshall("COMMIT",{transaction:t})},abort:function(t){return i.default.marshall("ABORT",{transaction:t})},ack:function(t,e,r){return i.default.marshall("ACK",n({},r,{"message-id":t,subscription:e}))},subscribe:function(t){return i.default.marshall("SUBSCRIBE",t)},unSubscribe:function(t){return i.default.marshall("UNSUBSCRIBE",t)}}}},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),o=r(11),s=r(27);e.VERSIONS={V1_0:"1.0",V1_1:"1.1",V1_2:"1.2",supportedVersions:function(){return"1.2,1.1,1.0"},supportedProtocols:function(){return["v10.stomp","v11.stomp","v12.stomp"]}},e.default=function(t){var r;switch(void 0===t&&(t=e.VERSIONS.V1_0),t){case e.VERSIONS.V1_2:r=s.default();break;case e.VERSIONS.V1_1:r=o.default();break;case e.VERSIONS.V1_0:r=i.default();break;default:throw"Unsupported version : "+t+" ! Versions supported are : "+e.VERSIONS.supportedVersions()}return n({},r,{connect:function(t){return r.connect(n({},t,{"accept-version":e.VERSIONS.supportedVersions()}))}})}},function(t,e,r){"use strict";var n=r(0),i=r(59);n.Observable.prototype.multicast=i.multicast},function(t,e,r){"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(){t.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(r(76).Scheduler);e.AsyncScheduler=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(5),o=function(t){function e(e,r){t.call(this,e,r),this.scheduler=e,this.work=r,this.pending=!1}return n(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t,this.pending=!0;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),i.root.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;i.root.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(r(78).Action);e.AsyncAction=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(e,r){t.call(this),this.subject=e,this.subscriber=r,this.closed=!1}return n(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(2).Subscription);e.SubjectSubscription=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ObjectUnsubscribedError=i},function(t,e,r){"use strict";var n=r(5);function i(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}e.getSymbolObservable=i,e.observable=i(n.root),e.$$observable=e.observable},function(t,e,r){"use strict";e.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},function(t,e,r){"use strict";var n,i=r(10);function o(){try{return n.apply(this,arguments)}catch(t){return i.errorObject.e=t,i.errorObject}}e.tryCatch=function(t){return n=t,o}},function(t,e,r){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){"use strict";e.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},function(t,e,r){"use strict";e.isFunction=function(t){return"function"==typeof t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=function(t){void 0===t&&(t={outgoing:1e4,incoming:1e4});var e=this;this.startHeartbeat=function(t,r,n){if(e.stopHeartbeat(),0!==e.heartbeatSettings.outgoing&&0!==r){var i=Math.min(e.heartbeatSettings.outgoing,r);e._startPinger(i,n.sendPing)}0!==e.heartbeatSettings.incoming&&0!==t&&(i=Math.min(e.heartbeatSettings.incoming,t),e._startPonger(i,n.close))},this.stopHeartbeat=function(){clearInterval(e.pinger),clearInterval(e.ponger)},this.activityFromServer=function(){e.lastServerActivity=Date.now()},this._startPinger=function(t,r){n.logger.debug("send PING every "+t+"ms"),e.pinger=setInterval(function(){r(),n.logger.debug(">>> PING")},t)},this._startPonger=function(t,r){n.logger.debug("check PONG every "+t+"ms"),e.lastServerActivity=Date.now(),e.ponger=setInterval(function(){var i=Date.now()-e.lastServerActivity;i>2*t&&(n.logger.debug("did not receive server activity for the last "+i+"ms"),r())},t)},this.heartbeatSettings=t||{outgoing:0,incoming:0}};e.default=i},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),o=r(11);e.default=function(){var t=o.default();return n({},t,{ack:function(t,e,r){return i.default.marshall("ACK",n({},r,{id:t,subscription:e}))},nack:function(t,e,r){return i.default.marshall("NACK",n({},r,{id:t,subscription:e}))},getMessageId:function(e){return e.headers.ack||t.getMessageId(e)}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(4),o=r(3),s=function(t,e){var r=this;this.initConnection=function(t){return n.Observable.create(function(t){if(r.ws)throw"Error, the connection has already been created !";if(r.ws=r.createWS(),!r.ws)throw"Error, createWsConnection function returned null !";r.ws.binaryType="arraybuffer";var e,n=new i.Subject,s=new i.Subject,c=new i.Subject;return o.logger.debug("Opening Web Socket..."),r.ws.onopen=function(){o.logger.debug("Web Socket Opened..."),e=c.subscribe(r._send),t.next({messageReceived:n.asObservable(),messageSender:c})},r.ws.onmessage=function(t){n.next(t)},r.ws.onclose=function(e){o.logger.debug("Whoops! Lost connection to "+r.ws.url+":",e),r.ws=null,t.error(e)},function(){n.complete(),s.complete(),e&&e.unsubscribe(),r.disconnect()}})},this.disconnect=function(t){void 0===t&&(t={}),r.ws&&(r.ws.onclose=null,r.ws.close(),r.ws=null)},this._send=function(t){r.ws?(o.logger.debug(">>> "+t),r._wsSend(r.ws,t)):o.logger.debug("Error, this.ws is null ! Possibly initConnection has not been called or not subscribed !")},this._wsSend=function(t,e){for(r.isBinary&&(e=o.unicodeStringToTypedArray(e)),o.logger.debug(">>> length "+e.length);;){if(!(e.length>r.maxWebSocketFrameSize))return t.send(e);t.send(e.slice(0,r.maxWebSocketFrameSize)),e=e.slice(r.maxWebSocketFrameSize),o.logger.debug("remaining = "+e.length)}};var s=e.binary,c=void 0!==s&&s;this.createWS=t,this.isBinary=!!c,this.maxWebSocketFrameSize=16384};e.default=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1);e.filter=function(t,e){return function(r){return r.lift(new o(t,e))}};var o=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,r,n){t.call(this,e),this.predicate=r,this.thisArg=n,this.count=0}return n(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.Subscriber)},function(t,e,r){"use strict";var n=r(29);e.filter=function(t,e){return n.filter(t,e)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(30);n.Observable.prototype.filter=i.filter},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(8),o=r(7);e.switchMap=function(t,e){return function(r){return r.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.resultSelector))},t}(),c=function(t){function e(e,r,n){t.call(this,e),this.project=r,this.resultSelector=n,this.index=0}return n(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=this.innerSubscription;n&&n.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,t,e,r))},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,r,n,i){this.resultSelector?this._tryNotifyNext(t,e,r,n):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,r,n){var i;try{i=this.resultSelector(t,e,r,n)}catch(t){return void this.destination.error(t)}this.destination.next(i)},e}(i.OuterSubscriber)},function(t,e,r){"use strict";var n=r(32);e.switchMap=function(t,e){return n.switchMap(t,e)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(33);n.Observable.prototype.switchMap=i.switchMap},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=r(4);r(34),r(31);var s=r(3),c=r(28),u=r(13),a=r(26);e.default=function(t,e){var r=new c.default(t,e),h=new a.default(e.heartbeat);return{initConnection:function(t){var e,c=n({},t);return t["heart-beat"]||(c["heart-beat"]=function(t){return[t.heartbeatSettings.outgoing,t.heartbeatSettings.incoming].join(",")}(h)),r.initConnection(c).switchMap(function(t){var r=0,n="",a="",l=u.default();return i.Observable.create(function(i){var f=new o.Subject,p=new o.Subject,b=new o.Subject,d=function(e,n){void 0===n&&(n={});var i=n.id||"sub-"+r++,o={destination:e,ack:n.ack,id:i};return t.messageSender.next(l.subscribe(o)),f.finally(function(){return e={id:i},t.messageSender.next(l.unSubscribe(e));var e}).filter(function(t){return t.headers.subscription===i})},v=t.messageReceived.subscribe(function(e){h.activityFromServer();var r=function(t){var e=s.parseData(t.data,n,l.hearbeatMsg&&l.hearbeatMsg());if(e)return n=e.partial,e.frames}(e);r&&r.forEach(function(e){switch(e.command){case"CONNECTED":a=e.headers.version,l=u.default(a),s.logger.debug("connected to server "+e.headers.server);var r=l.hearbeatMsg();if(r){var n=(e.headers["heart-beat"]||"0,0").split(",").map(function(t){return parseInt(t,10)}),o=n[0],c=n[1];h.startHeartbeat(o,c,{sendPing:function(){return t.messageSender.next(r)},close:function(t){return i.error(t)}})}i.next({subscribeTo:d,messageReceipted:p.asObservable(),errorReceived:b.asObservable(),messageSender:t.messageSender,protocol:l});break;case"MESSAGE":var v=l.getSubscription(e),y=l.getMessageId(e);e.ack=function(){return t.messageSender.next(l.ack(y,v))},l.nack&&(e.nack=function(){return t.messageSender.next(l.nack(y,v))}),f.next(e);break;case"RECEIPT":p.next(e);break;case"ERROR":b.next(e);break;default:s.logger.debug("Unhandled frame: "+e)}})});return t.messageSender.next(l.connect(c)),e=function(){h.stopHeartbeat(),t.messageSender.next(l.disconnect({receipt:""+r++}))},function(){v&&v.unsubscribe(),f.complete(),p.complete(),b.complete()}})}).finally(function(){e&&e()})}}}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1),o=r(2);e.finalize=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.callback))},t}(),c=function(t){function e(e,r){t.call(this,e),this.add(new o.Subscription(r))}return n(e,t),e}(i.Subscriber)},function(t,e,r){"use strict";var n=r(36);e._finally=function(t){return n.finalize(t)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(37);n.Observable.prototype.finally=i._finally,n.Observable.prototype._finally=i._finally},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(4);r(14),r(38);var o=function(t){var e=this;this.send=function(t,r,i){void 0===r&&(r=""),void 0===i&&(i={destination:t});var o=n({},i,{destination:t});e.connection.messageSender.next(e.connection.protocol.send(o,r))},this.begin=function(t){e.connection.messageSender.next(e.connection.protocol.begin(t))},this.commit=function(t){e.connection.messageSender.next(e.connection.protocol.commit(t))},this.abort=function(t){e.connection.messageSender.next(e.connection.protocol.abort(t))},this.ack=function(t,r,n){e.connection.messageSender.next(e.connection.protocol.ack(t,r,n))},this.nack=function(t,r,n){if(!e.connection.protocol.nack)throw"Nack unsupported operation";e.connection.messageSender.next(e.connection.protocol.nack(t,r,n))},this.receipt=function(){if(!e.broadcastReceipterObservable){var t=e.connection.messageReceipted.finally(function(){return e.broadcastReceipterObserver?e.broadcastReceipterObserver=null:null}).multicast(function(){return new i.Subject});t.connect(),e.broadcastReceipterObservable=t.refCount()}return e.broadcastReceipterObservable},this.connectionError=function(){if(!e.broadcastConnectionErrorObservable){var t=e.connection.errorReceived.finally(function(){return e.broadcastConnectionErrorObserver?e.broadcastConnectionErrorObserver=null:null}).multicast(function(){return new i.Subject});t.connect(),e.broadcastConnectionErrorObservable=t.refCount()}return e.broadcastConnectionErrorObservable},this.error=function(){if(!e.broadcastErrorObservable){var t=e.connection.errorReceived.finally(function(){return e.broadcastErrorObserver?e.broadcastErrorObserver=null:null}).multicast(function(){return new i.Subject});t.connect(),e.broadcastErrorObservable=t.refCount()}return e.broadcastErrorObservable},this.subscribe=function(t,r){return void 0===r&&(r={}),e.connection.subscribeTo(t,r)},this.subscribeBroadcast=function(t,r){if(void 0===r&&(r={}),!e.broadcastSubscribers[t]){var n=e.subscribe(t,r).finally(function(){return e.broadcastSubscribers[t]?delete e.broadcastSubscribers[t]:null}).multicast(function(){return new i.Subject});n.connect(),e.broadcastSubscribers[t]=n.refCount()}return e.broadcastSubscribers[t]},this.connection=t,this.broadcastSubscribers={}};e.ConnectedClient=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(8),o=r(7);e.catchError=function(t){return function(e){var r=new s(t),n=e.lift(r);return r.caught=n}};var s=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.selector,this.caught))},t}(),c=function(t){function e(e,r,n){t.call(this,e),this.selector=r,this.caught=n}return n(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle(),this.add(o.subscribeToResult(this,r))}},e}(i.OuterSubscriber)},function(t,e,r){"use strict";var n=r(40);e._catch=function(t){return n.catchError(t)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(41);n.Observable.prototype.catch=i._catch,n.Observable.prototype._catch=i._catch},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1);e.tap=function(t,e,r){return function(n){return n.lift(new o(t,e,r))}};var o=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.nextOrObserver,this.error,this.complete))},t}(),s=function(t){function e(e,r,n,o){t.call(this,e);var s=new i.Subscriber(r,n,o);s.syncErrorThrowable=!0,this.add(s),this.safeSubscriber=s}return n(e,t),e.prototype._next=function(t){var e=this.safeSubscriber;e.next(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.next(t)},e.prototype._error=function(t){var e=this.safeSubscriber;e.error(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.error(t)},e.prototype._complete=function(){var t=this.safeSubscriber;t.complete(),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.complete()},e}(i.Subscriber)},function(t,e,r){"use strict";var n=r(43);e._do=function(t,e,r){return n.tap(t,e,r)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(44);n.Observable.prototype.do=i._do,n.Observable.prototype._do=i._do},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1);e.scan=function(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new o(t,e,r))}};var o=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.accumulator,this.seed,this.hasSeed))},t}(),s=function(t){function e(e,r,n,i){t.call(this,e),this.accumulator=r,this._seed=n,this.hasSeed=i,this.index=0}return n(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(i.Subscriber)},function(t,e,r){"use strict";var n=r(46);e.scan=function(t,e){return arguments.length>=2?n.scan(t,e)(this):n.scan(t)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(47);n.Observable.prototype.scan=i.scan},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(e,r,n){t.call(this),this.parent=e,this.outerValue=r,this.outerIndex=n,this.index=0}return n(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(r(1).Subscriber);e.InnerSubscriber=i},function(t,e,r){"use strict";var n=r(5);function i(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var r=t.Set;if(r&&"function"==typeof(new r)["@@iterator"])return"@@iterator";var n=t.Map;if(n)for(var i=Object.getOwnPropertyNames(n.prototype),o=0;o<i.length;++o){var s=i[o];if("entries"!==s&&"size"!==s&&n.prototype[s]===n.prototype.entries)return s}return"@@iterator"}e.symbolIteratorPonyfill=i,e.iterator=i(n.root),e.$$iterator=e.iterator},function(t,e,r){"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},function(t,e,r){"use strict";e.isArrayLike=function(t){return t&&"number"==typeof t.length}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(4),o=r(22),s=r(10),c=r(8),u=r(7);e.retryWhen=function(t){return function(e){return e.lift(new a(t,e))}};var a=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.notifier,this.source))},t}(),h=function(t){function e(e,r,n){t.call(this,e),this.notifier=r,this.source=n}return n(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.errors,n=this.retries,c=this.retriesSubscription;if(n)this.errors=null,this.retriesSubscription=null;else{if(r=new i.Subject,(n=o.tryCatch(this.notifier)(r))===s.errorObject)return t.prototype.error.call(this,s.errorObject.e);c=u.subscribeToResult(this,n)}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=c,r.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,r,n,i){var o=this.errors,s=this.retries,c=this.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=o,this.retries=s,this.retriesSubscription=c,this.source.subscribe(this)},e}(c.OuterSubscriber)},function(t,e,r){"use strict";var n=r(53);e.retryWhen=function(t){return n.retryWhen(t)(this)}},function(t,e,r){"use strict";var n=r(0),i=r(54);n.Observable.prototype.retryWhen=i.retryWhen},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1);e.refCount=function(){return function(t){return t.lift(new o(t))}};var o=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new s(t,r),i=e.subscribe(n);return n.closed||(n.connection=r.connect()),i},t}(),s=function(t){function e(e,r){t.call(this,e),this.connectable=r}return n(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(i.Subscriber)},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(4),o=r(0),s=r(1),c=r(2),u=r(56),a=function(t){function e(e,r){t.call(this),this.source=e,this.subjectFactory=r,this._refCount=0,this._isComplete=!1}return n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new c.Subscription).add(this.source.subscribe(new l(this.getSubject(),this))),t.closed?(this._connection=null,t=c.Subscription.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return u.refCount()(this)},e}(o.Observable);e.ConnectableObservable=a;var h=a.prototype;e.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:h._subscribe},_isComplete:{value:h._isComplete,writable:!0},getSubject:{value:h.getSubject},connect:{value:h.connect},refCount:{value:h.refCount}};var l=function(t){function e(e,r){t.call(this,e),this.connectable=r}return n(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.SubjectSubscriber);!function(t){function e(e,r){t.call(this,e),this.connectable=r}n(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null}}(s.Subscriber)},function(t,e,r){"use strict";var n=r(57);e.multicast=function(t,e){return function(r){var o;if(o="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new i(o,e));var s=Object.create(r,n.connectableObservableDescriptor);return s.source=r,s.subjectFactory=o,s}};var i=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(t);return i.add(e.subscribe(n)),i},t}();e.MulticastOperator=i},function(t,e,r){"use strict";var n=r(58);e.multicast=function(t,e){return n.multicast(t,e)(this)}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(e,r){t.call(this),this.error=e,this.scheduler=r}return n(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.error;t.subscriber.error(e)},e.prototype._subscribe=function(t){var r=this.error,n=this.scheduler;if(t.syncErrorThrowable=!0,n)return n.schedule(e.dispatch,0,{error:r,subscriber:t});t.error(r)},e}(r(0).Observable);e.ErrorObservable=i},function(t,e,r){"use strict";var n=r(60);e._throw=n.ErrorObservable.create},function(t,e,r){"use strict";var n=r(0),i=r(61);n.Observable.throw=i._throw},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(e){t.call(this),this.scheduler=e}return n(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(r(0).Observable);e.EmptyObservable=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(e,r){t.call(this),this.value=e,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return n(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.done,r=t.value,n=t.subscriber;e?n.complete():(n.next(r),n.closed||(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.value,n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{done:!1,value:r,subscriber:t});t.next(r),t.closed||t.complete()},e}(r(0).Observable);e.ScalarObservable=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(0),o=r(64),s=r(63),c=r(15),u=function(t){function e(e,r){t.call(this),this.array=e,this.scheduler=r,r||1!==e.length||(this._isScalar=!0,this.value=e[0])}return n(e,t),e.create=function(t,r){return new e(t,r)},e.of=function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];var n=t[t.length-1];c.isScheduler(n)?t.pop():n=null;var i=t.length;return i>1?new e(t,n):1===i?new o.ScalarObservable(t[0],n):new s.EmptyObservable(n)},e.dispatch=function(t){var e=t.array,r=t.index,n=t.count,i=t.subscriber;r>=n?i.complete():(i.next(e[r]),i.closed||(t.index=r+1,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.array,n=r.length,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{array:r,index:0,count:n,subscriber:t});for(var o=0;o<n&&!t.closed;o++)t.next(r[o]);t.complete()},e}(i.Observable);e.ArrayObservable=u},function(t,e,r){"use strict";var n=r(65);e.of=n.ArrayObservable.of},function(t,e,r){"use strict";var n=r(0),i=r(66);n.Observable.of=i.of},function(t,e,r){"use strict";e.isDate=function(t){return t instanceof Date&&!isNaN(+t)}},function(t,e,r){"use strict";var n=r(17),i=r(16);e.async=new i.AsyncScheduler(n.AsyncAction)},function(t,e,r){"use strict";var n=r(24);e.isNumeric=function(t){return!n.isArray(t)&&t-parseFloat(t)+1>=0}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(70),o=r(0),s=r(69),c=r(15),u=r(68),a=function(t){function e(e,r,n){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,i.isNumeric(r)?this.period=Number(r)<1?1:Number(r):c.isScheduler(r)&&(n=r),c.isScheduler(n)||(n=s.async),this.scheduler=n,this.dueTime=u.isDate(e)?+e-this.scheduler.now():e}return n(e,t),e.create=function(t,r,n){return void 0===t&&(t=0),new e(t,r,n)},e.dispatch=function(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}},e.prototype._subscribe=function(t){var r=this.period,n=this.dueTime;return this.scheduler.schedule(e.dispatch,n,{index:0,period:r,subscriber:t})},e}(o.Observable);e.TimerObservable=a},function(t,e,r){"use strict";var n=r(71);e.timer=n.TimerObservable.create},function(t,e,r){"use strict";var n=r(0),i=r(72);n.Observable.timer=i.timer},function(t,e,r){"use strict";var n=r(0),i=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return n.Observable.of(this.value);case"E":return n.Observable.throw(this.error);case"C":return n.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=r(1),o=r(74);e.observeOn=function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new s(t,e))}};var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.scheduler,this.delay))},t}();e.ObserveOnOperator=s;var c=function(t){function e(e,r,n){void 0===n&&(n=0),t.call(this,e),this.scheduler=r,this.delay=n}return n(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(e.dispatch,this.delay,new u(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(o.Notification.cre