Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kefir

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kefir - npm Package Compare versions

Comparing version 3.2.6 to 3.3.0

5

changelog.md

@@ -0,1 +1,6 @@

## 3.3.0 (16/07/2016)
- New method `.observe` [#151](https://github.com/rpominov/kefir/issues/151) [#221](https://github.com/rpominov/kefir/pull/211) [@mAAdhaTTah](https://github.com/mAAdhaTTah)
- Emitter methods renamed `emit → value`, `emitEvent → event` (old names will work as well for now)
## 3.2.6 (5/07/2016)

@@ -2,0 +7,0 @@

6

dist/kefir.min.js

@@ -1,6 +0,6 @@

/*! Kefir.js v3.2.6
/*! Kefir.js v3.3.0
* https://github.com/rpominov/kefir
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.Kefir=t.Kefir||{})}(this,function(t){"use strict";function n(t){var n=function(){};return n.prototype=t,new n}function i(t){var n=arguments.length,i=void 0,e=void 0;for(i=1;i<n;i++)for(e in arguments[i])t[e]=arguments[i][e];return t}function e(t,e){var r=arguments.length,u=void 0;for(t.prototype=n(e.prototype),t.prototype.constructor=t,u=2;u<r;u++)i(t.prototype,arguments[u]);return t}function r(t,n){var i=void 0,e=void 0,r=void 0,u=void 0;if(0===t.length)return n;if(0===n.length)return t;for(u=0,i=new Array(t.length+n.length),e=t.length,r=0;r<e;r++,u++)i[u]=t[r];for(e=n.length,r=0;r<e;r++,u++)i[u]=n[r];return i}function u(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(t[e]===n)return e;return-1}function s(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(n(t[e]))return e;return-1}function o(t){var n=t.length,i=new Array(n),e=void 0;for(e=0;e<n;e++)i[e]=t[e];return i}function a(t,n){var i=t.length,e=void 0,r=void 0,u=void 0;if(n>=0&&n<i){if(1===i)return[];for(e=new Array(i-1),r=0,u=0;r<i;r++)r!==n&&(e[u]=t[r],u++);return e}return t}function h(t,n){var i=t.length,e=new Array(i),r=void 0;for(r=0;r<i;r++)e[r]=n(t[r]);return e}function l(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)n(t[e])}function _(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)t[e]=n}function f(t,n){return u(t,n)!==-1}function c(t,n,i){var e=Math.min(i,t.length+1),r=t.length-e+1,u=new Array(e),s=void 0;for(s=r;s<e;s++)u[s-r]=t[s];return u[e-1]=n,u}function d(t,n,i){t===an?n(i):t===i.type&&(t===sn||t===on?n(i.value):n())}function v(){this._items=[],this._inLoop=0,this._removedItems=null}function m(){this._dispatcher=new v,this._active=!1,this._alive=!0,this._activating=!1,this._logHandlers=null}function p(){m.call(this)}function y(){m.call(this),this._currentEvent=null}function E(){return hn}function g(t){function n(t,n){var i=this;p.call(this),this._wait=t,this._intervalId=null,this._$onTick=function(){return i._onTick()},this._init(n)}return e(n,p,{_init:function(){},_free:function(){},_onTick:function(){},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)},_clear:function(){p.prototype._clear.call(this),this._$onTick=null,this._free()}},t),n}function b(t,n){return new ln(t,{x:n})}function w(t,n){return new _n(t,{x:n})}function A(t,n){return 0===n.length?E():new fn(t,{xs:n})}function V(t,n){return new cn(t,{fn:n})}function S(t){function n(n){return t._emitValue(n),t._active}function i(n){return t._emitError(n),t._active}function e(){return t._emitEnd(),t._active}function r(n){return t._emit(n.type,n.value),t._active}return{value:n,error:i,end:e,event:r,emit:n,emitEvent:r}}function T(t,n){return new dn(t,{fn:n})}function $(t){p.call(this),this._fn=t,this._unsubscribe=null}function C(t){return new $(t)}function k(t){var n=!1;return C(function(i){n||(t(function(t){i.emit(t),i.end()}),n=!0)}).setName("fromCallback")}function I(t){var n=!1;return C(function(i){n||(t(function(t,n){t?i.error(t):i.emit(n),i.end()}),n=!0)}).setName("fromNodeCallback")}function x(t,n){switch(n){case 0:return function(){return t()};case 1:return function(n){return t(n[0])};case 2:return function(n){return t(n[0],n[1])};case 3:return function(n){return t(n[0],n[1],n[2])};case 4:return function(n){return t(n[0],n[1],n[2],n[3])};default:return function(n){return t.apply(null,n)}}}function O(t,n,i){var e=i?i.length:0;if(null==n)switch(e){case 0:return t();case 1:return t(i[0]);case 2:return t(i[0],i[1]);case 3:return t(i[0],i[1],i[2]);case 4:return t(i[0],i[1],i[2],i[3]);default:return t.apply(null,i)}else switch(e){case 0:return t.call(n);default:return t.apply(n,i)}}function L(t,n,i){return C(function(e){var r=i?function(){e.emit(O(i,this,arguments))}:function(t){e.emit(t)};return t(r),function(){return n(r)}}).setName("fromSubUnsub")}function P(t,n,i){for(var e=void 0,r=void 0,u=0;u<vn.length;u++)if("function"==typeof t[vn[u][0]]&&"function"==typeof t[vn[u][1]]){e=vn[u][0],r=vn[u][1];break}if(void 0===e)throw new Error("target don't support any of addEventListener/removeEventListener, addListener/removeListener, on/off method pair");return L(function(i){return t[e](n,i)},function(i){return t[r](n,i)},i).setName("fromEvents")}function M(t){this._currentEvent={type:"value",value:t,current:!0}}function D(t){return new M(t)}function N(t){this._currentEvent={type:"error",value:t,current:!0}}function q(t){return new N(t)}function W(t,n){return function(i,e){var r=this;t.call(this),this._source=i,this._name=i._name+"."+n,this._init(e),this._$handleAny=function(t){return r._handleAny(t)}}}function B(t){return{_init:function(){},_free:function(){},_handleValue:function(t){this._emitValue(t)},_handleError:function(t){this._emitError(t)},_handleEnd:function(){this._emitEnd()},_handleAny:function(t){switch(t.type){case sn:return this._handleValue(t.value);case on:return this._handleError(t.value);case un:return this._handleEnd()}},_onActivation:function(){this._source.onAny(this._$handleAny)},_onDeactivation:function(){this._source.offAny(this._$handleAny)},_clear:function(){t.prototype._clear.call(this),this._source=null,this._$handleAny=null,this._free()}}}function H(t,n){var i=W(p,t);return e(i,p,B(p),n),i}function j(t,n){var i=W(y,t);return e(i,y,B(y),n),i}function U(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(null!==n&&"function"!=typeof n)throw new Error("You should call toProperty() with a function or no arguments.");return new mn(t,{fn:n})}function F(t){return new pn(t)}function Q(t){var n=!1,i=C(function(i){if(!n){var e=function(t){i.emit(t),i.end()},r=function(t){i.error(t),i.end()},u=t.then(e,r);u&&"function"==typeof u.done&&u.done(),n=!0}});return U(i,null).setName("fromPromise")}function Y(){if("function"==typeof Promise)return Promise;throw new Error("There isn't default Promise, use shim or parameter")}function z(t){var n=arguments.length<=1||void 0===arguments[1]?Y():arguments[1],i=null;return new n(function(n,e){t.onAny(function(t){t.type===un&&null!==i?((i.type===sn?n:e)(i.value),i=null):i=t})})}function K(t,n){return n={exports:{}},t(n,n.exports),n.exports}function G(t){var n=t[Vn]?t[Vn]():t;return C(function(t){var i=n.subscribe({error:function(n){t.error(n),t.end()},next:function(n){t.emit(n)},complete:function(){t.end()}});return i.unsubscribe?function(){i.unsubscribe()}:i}).setName("fromESObservable")}function J(t){this._observable=t.takeErrors(1)}function R(){return new J(this)}function X(t){var n=arguments.length<=1||void 0===arguments[1]?Cn:arguments[1];return new(t._ofSameType(Tn,$n))(t,{fn:n})}function Z(t){var n=arguments.length<=1||void 0===arguments[1]?On:arguments[1];return new(t._ofSameType(In,xn))(t,{fn:n})}function tt(t,n){return new(t._ofSameType(Pn,Mn))(t,{n:n})}function nt(t,n){return new(t._ofSameType(Nn,qn))(t,{n:n})}function it(t){var n=arguments.length<=1||void 0===arguments[1]?jn:arguments[1];return new(t._ofSameType(Bn,Hn))(t,{fn:n})}function et(t){return new(t._ofSameType(Fn,Qn))(t)}function rt(t,n){return new(t._ofSameType(zn,Kn))(t,{n:n})}function ut(t){var n=arguments.length<=1||void 0===arguments[1]?Xn:arguments[1];return new(t._ofSameType(Jn,Rn))(t,{fn:n})}function st(t){var n=arguments.length<=1||void 0===arguments[1]?ii:arguments[1];return new(t._ofSameType(ti,ni))(t,{fn:n})}function ot(t,n){return[t,n]}function at(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new(t._ofSameType(ri,ui))(t,{fn:n||ot,seed:i})}function ht(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new si(t,{fn:n,seed:i})}function lt(t){var n=arguments.length<=1||void 0===arguments[1]?hi:arguments[1];return new ai(t,{fn:n})}function _t(t,n){return new(t._ofSameType(fi,ci))(t,{wait:n})}function ft(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.leading,r=void 0===e||e,u=i.trailing,s=void 0===u||u;return new(t._ofSameType(mi,pi))(t,{wait:n,leading:r,trailing:s})}function ct(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.immediate,r=void 0!==e&&e;return new(t._ofSameType(Ei,gi))(t,{wait:n,immediate:r})}function dt(t){var n=arguments.length<=1||void 0===arguments[1]?Vi:arguments[1];return new(t._ofSameType(wi,Ai))(t,{fn:n})}function vt(t){var n=arguments.length<=1||void 0===arguments[1]?Ci:arguments[1];return new(t._ofSameType(Ti,$i))(t,{fn:n})}function mt(t){return new(t._ofSameType(Ii,xi))(t)}function pt(t){return new(t._ofSameType(Li,Pi))(t)}function yt(t){return new(t._ofSameType(Di,Ni))(t)}function Et(t,n){return new(t._ofSameType(Wi,Bi))(t,{fn:n})}function gt(t,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return new(t._ofSameType(ji,Ui))(t,{min:i,max:n})}function bt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Qi,Yi))(t,{fn:n||zi,flushOnEnd:r})}function wt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Gi,Ji))(t,{count:n,flushOnEnd:r})}function At(t,n,i){var e=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=e.flushOnEnd,u=void 0===r||r;return new(t._ofSameType(Xi,Zi))(t,{wait:n,count:i,flushOnEnd:u})}function Vt(t){return{"@@transducer/step":function(n,i){return t._emitValue(i),null},"@@transducer/result":function(){return t._emitEnd(),null}}}function St(t,n){return new(t._ofSameType(ne,ie))(t,{transducer:n})}function Tt(t,n){return new(t._ofSameType(re,ue))(t,{fn:n})}function $t(t){for(var n=void 0,i=0;i<t.length;i++)void 0!==t[i]&&(void 0===n||n.index<t[i].index)&&(n=t[i]);return n.error}function Ct(t,n,i){var e=this;p.call(this),this._activeCount=t.length,this._sources=r(t,n),this._combinator=i?x(i,this._sources.length):function(t){return t},this._aliveCount=0,this._latestValues=new Array(this._sources.length),this._latestErrors=new Array(this._sources.length),_(this._latestValues,rn),this._emitAfterActivation=!1,this._endAfterActivation=!1,this._latestErrorIndex=0,this._$handlers=[];for(var u=function(t){e._$handlers.push(function(n){return e._handleAny(t,n)})},s=0;s<this._sources.length;s++)u(s)}function kt(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments[2];return"function"==typeof n&&(i=n,n=[]),0===t.length?E():new Ct(t,n,i)}function It(t,n){var i=this;p.call(this),this._buffers=h(t,function(t){return se(t)?o(t):[]}),this._sources=h(t,function(t){return se(t)?E():t}),this._combinator=n?x(n,this._sources.length):function(t){return t},this._aliveCount=0,this._$handlers=[];for(var e=function(t){i._$handlers.push(function(n){return i._handleAny(t,n)})},r=0;r<this._sources.length;r++)e(r)}function xt(t,n){return 0===t.length?E():new It(t,n)}function Ot(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.queueLim,e=void 0===i?0:i,r=n.concurLim,u=void 0===r?-1:r,s=n.drop,o=void 0===s?"new":s;p.call(this),this._queueLim=e<0?-1:e,this._concurLim=u<0?-1:u,this._drop=o,this._queue=[],this._curSources=[],this._$handleSubAny=function(n){return t._handleSubAny(n)},this._$endHandlers=[],this._currentlyAdding=null,0===this._concurLim&&this._emitEnd()}function Lt(t){Ot.call(this),this._addAll(t),this._initialised=!0}function Pt(t){return 0===t.length?E():new Lt(t)}function Mt(t){var n=this;p.call(this),this._generator=t,this._source=null,this._inLoop=!1,this._iteration=0,this._$handleAny=function(t){return n._handleAny(t)}}function Dt(t){return new Mt(t)}function Nt(t){return Dt(function(n){return t.length>n&&t[n]}).setName("concat")}function qt(){Ot.call(this)}function Wt(t,n,i){var e=this;Ot.call(this,i),this._source=t,this._fn=n,this._mainEnded=!1,this._lastCurrent=null,this._$handleMain=function(t){return e._handleMain(t)}}function Bt(t,n){Wt.call(this,t,n)}function Ht(t,n){return function(i,e,r){var u=this;t.call(this),this._primary=i,this._secondary=e,this._name=i._name+"."+n,this._lastSecondary=rn,this._$handleSecondaryAny=function(t){return u._handleSecondaryAny(t)},this._$handlePrimaryAny=function(t){return u._handlePrimaryAny(t)},this._init(r)}}function jt(t){return{_init:function(){},_free:function(){},_handlePrimaryValue:function(t){this._emitValue(t)},_handlePrimaryError:function(t){this._emitError(t)},_handlePrimaryEnd:function(){this._emitEnd()},_handleSecondaryValue:function(t){this._lastSecondary=t},_handleSecondaryError:function(t){this._emitError(t)},_handleSecondaryEnd:function(){},_handlePrimaryAny:function(t){switch(t.type){case sn:return this._handlePrimaryValue(t.value);case on:return this._handlePrimaryError(t.value);case un:return this._handlePrimaryEnd(t.value)}},_handleSecondaryAny:function(t){switch(t.type){case sn:return this._handleSecondaryValue(t.value);case on:return this._handleSecondaryError(t.value);case un:this._handleSecondaryEnd(t.value),this._removeSecondary()}},_removeSecondary:function(){null!==this._secondary&&(this._secondary.offAny(this._$handleSecondaryAny),this._$handleSecondaryAny=null,this._secondary=null)},_onActivation:function(){null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny),this._active&&this._primary.onAny(this._$handlePrimaryAny)},_onDeactivation:function(){null!==this._secondary&&this._secondary.offAny(this._$handleSecondaryAny),this._primary.offAny(this._$handlePrimaryAny)},_clear:function(){t.prototype._clear.call(this),this._primary=null,this._secondary=null,this._lastSecondary=null,this._$handleSecondaryAny=null,this._$handlePrimaryAny=null,this._free()}}}function Ut(t,n){var i=Ht(p,t);return e(i,p,jt(p),n),i}function Ft(t,n){var i=Ht(y,t);return e(i,y,jt(y),n),i}function Qt(t,n){return new(t._ofSameType(he,le))(t,n)}function Yt(t,n,i){var e=i?function(t,n){return i(n,t)}:_e;return kt([n],[t],e).setName(t,"sampledBy")}function zt(t,n){return new(t._ofSameType(ce,de))(t,n)}function Kt(t,n){return new(t._ofSameType(me,pe))(t,n)}function Gt(t,n,i){return new(t._ofSameType(Ee,ge))(t,n,i)}function Jt(t,n,i){return new(t._ofSameType(we,Ae))(t,n,i)}function Rt(t,n){var i=Pt([X(t,Se),X(n,Ve)]);return i=st(i),i=U(i,Ve),i.setName(t,"awaiting")}function Xt(t){var n=arguments.length<=1||void 0===arguments[1]?ke:arguments[1];return new(t._ofSameType($e,Ce))(t,{fn:n})}function Zt(t){var n=arguments.length<=1||void 0===arguments[1]?Le:arguments[1];return new(t._ofSameType(xe,Oe))(t,{fn:n})}function tn(t){return new(t._ofSameType(Me,De))(t)}function nn(){qe=!1}function en(t){if(qe&&console&&"function"==typeof console.warn){var n="\nHere is an Error object for you containing the call stack:";console.warn(t,n,new Error)}}var rn=["<nothing>"],un="end",sn="value",on="error",an="any";i(v.prototype,{add:function(t,n){return this._items=r(this._items,[{type:t,fn:n}]),this._items.length},remove:function(t,n){var i=s(this._items,function(i){return i.type===t&&i.fn===n});return 0!==this._inLoop&&i!==-1&&(null===this._removedItems&&(this._removedItems=[]),this._removedItems.push(this._items[i])),this._items=a(this._items,i),this._items.length},dispatch:function(t){this._inLoop++;for(var n=0,i=this._items;n<i.length&&null!==this._items;n++)null!==this._removedItems&&f(this._removedItems,i[n])||d(i[n].type,i[n].fn,t);this._inLoop--,0===this._inLoop&&(this._removedItems=null)},cleanup:function(){this._items=null}}),i(m.prototype,{_name:"observable",_onActivation:function(){},_onDeactivation:function(){},_setActive:function(t){this._active!==t&&(this._active=t,t?(this._activating=!0,this._onActivation(),this._activating=!1):this._onDeactivation())},_clear:function(){this._setActive(!1),this._dispatcher.cleanup(),this._dispatcher=null,this._logHandlers=null},_emit:function(t,n){switch(t){case sn:return this._emitValue(n);case on:return this._emitError(n);case un:return this._emitEnd()}},_emitValue:function(t){this._alive&&this._dispatcher.dispatch({type:sn,value:t})},_emitError:function(t){this._alive&&this._dispatcher.dispatch({type:on,value:t})},_emitEnd:function(){this._alive&&(this._alive=!1,this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive?(this._dispatcher.add(t,n),this._setActive(!0)):d(t,n,{type:un}),this},_off:function(t,n){if(this._alive){var i=this._dispatcher.remove(t,n);0===i&&this._setActive(!1)}return this},onValue:function(t){return this._on(sn,t)},onError:function(t){return this._on(on,t)},onEnd:function(t){return this._on(un,t)},onAny:function(t){return this._on(an,t)},offValue:function(t){return this._off(sn,t)},offError:function(t){return this._off(on,t)},offEnd:function(t){return this._off(un,t)},offAny:function(t){return this._off(an,t)},_ofSameType:function(t,n){return t.prototype.getType()===this.getType()?t:n},setName:function(t,n){return this._name=n?t._name+"."+n:t,this},log:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0],n=void 0,i=function(i){var e="<"+i.type+(n?":current":"")+">";i.type===un?console.log(t,e):console.log(t,e,i.value)};return this._alive&&(this._logHandlers||(this._logHandlers=[]),this._logHandlers.push({name:t,handler:i})),n=!0,this.onAny(i),n=!1,this},offLog:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0];if(this._logHandlers){var n=s(this._logHandlers,function(n){return n.name===t});n!==-1&&(this.offAny(this._logHandlers[n].handler),this._logHandlers.splice(n,1))}return this}}),m.prototype.toString=function(){return"["+this._name+"]"},e(p,m,{_name:"stream",getType:function(){return"stream"}}),e(y,m,{_name:"property",_emitValue:function(t){this._alive&&(this._currentEvent={type:sn,value:t},this._activating||this._dispatcher.dispatch({type:sn,value:t}))},_emitError:function(t){this._alive&&(this._currentEvent={type:on,value:t},this._activating||this._dispatcher.dispatch({type:on,value:t}))},_emitEnd:function(){this._alive&&(this._alive=!1,this._activating||this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive&&(this._dispatcher.add(t,n),this._setActive(!0)),null!==this._currentEvent&&d(t,n,this._currentEvent),this._alive||d(t,n,{type:un}),this},getType:function(){return"property"}});var hn=new p;hn._emitEnd(),hn._name="never";var ln=g({_name:"later",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x),this._emitEnd()}}),_n=g({_name:"interval",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x)}}),fn=g({_name:"sequentially",_init:function(t){var n=t.xs;this._xs=o(n)},_free:function(){this._xs=null},_onTick:function(){1===this._xs.length?(this._emitValue(this._xs[0]),this._emitEnd()):this._emitValue(this._xs.shift())}}),cn=g({_name:"fromPoll",_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_onTick:function(){var t=this._fn;this._emitValue(t())}}),dn=g({_name:"withInterval",_init:function(t){var n=t.fn;this._fn=n,this._emitter=S(this)},_free:function(){this._fn=null,this._emitter=null},_onTick:function(){var t=this._fn;t(this._emitter)}});e($,p,{_name:"stream",_onActivation:function(){var t=this._fn,n=t(S(this));this._unsubscribe="function"==typeof n?n:null,this._active||this._callUnsubscribe()},_callUnsubscribe:function(){null!==this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},_onDeactivation:function(){this._callUnsubscribe()},_clear:function(){p.prototype._clear.call(this),this._fn=null}});var vn=[["addEventListener","removeEventListener"],["addListener","removeListener"],["on","off"]];e(M,y,{_name:"constant",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null}),e(N,y,{_name:"constantError",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null});var mn=j("toProperty",{_init:function(t){var n=t.fn;this._getInitialCurrent=n},_onActivation:function(){if(null!==this._getInitialCurrent){var t=this._getInitialCurrent;this._emitValue(t())}this._source.onAny(this._$handleAny)}}),pn=H("changes",{_handleValue:function(t){this._activating||this._emitValue(t)},_handleError:function(t){this._activating||this._emitError(t)}}),yn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},En=K(function(t,n){function i(t){var n,i=t.Symbol;return"function"==typeof i?i.observable?n=i.observable:(n=i("observable"),i.observable=n):n="@@observable",n}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i}),gn=En&&"object"==typeof En&&"default"in En?En["default"]:En,bn=K(function(t,n){function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var e=gn,r=i(e),u=void 0;"undefined"!=typeof yn?u=yn:"undefined"!=typeof window&&(u=window);var s=(0,r["default"])(u);n["default"]=s}),wn=bn&&"object"==typeof bn&&"default"in bn?bn["default"]:bn,An=K(function(t){t.exports=wn}),Vn=An&&"object"==typeof An&&"default"in An?An["default"]:An;i(J.prototype,{subscribe:function(t,n,i){var e=this,r="function"==typeof t?{next:t,error:n,complete:i}:t,u=function(t){t.type===sn&&r.next?r.next(t.value):t.type===on&&r.error?r.error(t.value):t.type===un&&r.complete&&r.complete(t.value)};this._observable.onAny(u);var s={unsubscribe:function(){s.closed=!0,e._observable.offAny(u)},closed:!1};return s}}),J.prototype[Vn]=function(){return this};var Sn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;this._emitValue(n(t))}},Tn=H("map",Sn),$n=j("map",Sn),Cn=function(t){return t},kn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)&&this._emitValue(t)}},In=H("filter",kn),xn=j("filter",kn),On=function(t){return t},Ln={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleValue:function(t){this._n--,this._emitValue(t),0===this._n&&this._emitEnd()}},Pn=H("take",Ln),Mn=j("take",Ln),Dn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleError:function(t){this._n--,this._emitError(t),0===this._n&&this._emitEnd()}},Nn=H("takeErrors",Dn),qn=j("takeErrors",Dn),Wn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)?this._emitValue(t):this._emitEnd()}},Bn=H("takeWhile",Wn),Hn=j("takeWhile",Wn),jn=function(t){return t},Un={_init:function(){this._lastValue=rn},_free:function(){this._lastValue=null},_handleValue:function(t){this._lastValue=t},_handleEnd:function(){this._lastValue!==rn&&this._emitValue(this._lastValue),this._emitEnd()}},Fn=H("last",Un),Qn=j("last",Un),Yn={_init:function(t){var n=t.n;this._n=Math.max(0,n)},_handleValue:function(t){0===this._n?this._emitValue(t):this._n--}},zn=H("skip",Yn),Kn=j("skip",Yn),Gn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;null===this._fn||n(t)||(this._fn=null),null===this._fn&&this._emitValue(t)}},Jn=H("skipWhile",Gn),Rn=j("skipWhile",Gn),Xn=function(t){return t},Zn={_init:function(t){var n=t.fn;this._fn=n,this._prev=rn},_free:function(){this._fn=null,this._prev=null},_handleValue:function(t){var n=this._fn;this._prev!==rn&&n(this._prev,t)||(this._prev=t,this._emitValue(t))}},ti=H("skipDuplicates",Zn),ni=j("skipDuplicates",Zn),ii=function(t,n){return t===n},ei={_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._prev=i},_free:function(){this._prev=null,this._fn=null},_handleValue:function(t){if(this._prev!==rn){var n=this._fn;this._emitValue(n(this._prev,t))}this._prev=t}},ri=H("diff",ei),ui=j("diff",ei),si=j("scan",{_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._seed=i,i!==rn&&this._emitValue(i)},_free:function(){this._fn=null,this._seed=null},_handleValue:function(t){var n=this._fn;null===this._currentEvent||this._currentEvent.type===on?this._emitValue(this._seed===rn?t:n(this._seed,t)):this._emitValue(n(this._currentEvent.value,t))}}),oi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){for(var n=this._fn,i=n(t),e=0;e<i.length;e++)this._emitValue(i[e])}},ai=H("flatten",oi),hi=function(t){return t},li={},_i={_init:function(t){var n=this,i=t.wait;this._wait=Math.max(0,i),this._buff=[],this._$shiftBuff=function(){var t=n._buff.shift();t===li?n._emitEnd():n._emitValue(t)}},_free:function(){this._buff=null,this._$shiftBuff=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._buff.push(t),setTimeout(this._$shiftBuff,this._wait))},_handleEnd:function(){this._activating?this._emitEnd():(this._buff.push(li),setTimeout(this._$shiftBuff,this._wait))}},fi=H("delay",_i),ci=j("delay",_i),di=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},vi={_init:function(t){var n=this,i=t.wait,e=t.leading,r=t.trailing;this._wait=Math.max(0,i),this._leading=e,this._trailing=r,this._trailingValue=null,this._timeoutId=null,this._endLater=!1,this._lastCallTime=0,this._$trailingCall=function(){return n._trailingCall()}},_free:function(){this._trailingValue=null,this._$trailingCall=null},_handleValue:function(t){if(this._activating)this._emitValue(t);else{var n=di();0!==this._lastCallTime||this._leading||(this._lastCallTime=n);var i=this._wait-(n-this._lastCallTime);i<=0?(this._cancelTrailing(),this._lastCallTime=n,this._emitValue(t)):this._trailing&&(this._cancelTrailing(),this._trailingValue=t,this._timeoutId=setTimeout(this._$trailingCall,i))}},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId?this._endLater=!0:this._emitEnd()},_cancelTrailing:function(){null!==this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null)},_trailingCall:function(){this._emitValue(this._trailingValue),this._timeoutId=null,this._trailingValue=null,this._lastCallTime=this._leading?di():0,this._endLater&&this._emitEnd()}},mi=H("throttle",vi),pi=j("throttle",vi),yi={_init:function(t){var n=this,i=t.wait,e=t.immediate;this._wait=Math.max(0,i),this._immediate=e,this._lastAttempt=0,this._timeoutId=null,this._laterValue=null,this._endLater=!1,this._$later=function(){return n._later()}},_free:function(){this._laterValue=null,this._$later=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._lastAttempt=di(),this._immediate&&!this._timeoutId&&this._emitValue(t),this._timeoutId||(this._timeoutId=setTimeout(this._$later,this._wait)),this._immediate||(this._laterValue=t))},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId&&!this._immediate?this._endLater=!0:this._emitEnd()},_later:function(){var t=di()-this._lastAttempt;t<this._wait&&t>=0?this._timeoutId=setTimeout(this._$later,this._wait-t):(this._timeoutId=null,this._immediate||(this._emitValue(this._laterValue),this._laterValue=null),this._endLater&&this._emitEnd())}},Ei=H("debounce",yi),gi=j("debounce",yi),bi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;this._emitError(n(t))}},wi=H("mapErrors",bi),Ai=j("mapErrors",bi),Vi=function(t){return t},Si={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;n(t)&&this._emitError(t)}},Ti=H("filterErrors",Si),$i=j("filterErrors",Si),Ci=function(t){return t},ki={_handleValue:function(){}},Ii=H("ignoreValues",ki),xi=j("ignoreValues",ki),Oi={_handleError:function(){}},Li=H("ignoreErrors",Oi),Pi=j("ignoreErrors",Oi),Mi={_handleEnd:function(){}},Di=H("ignoreEnd",Mi),Ni=j("ignoreEnd",Mi),qi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleEnd:function(){var t=this._fn;this._emitValue(t()),this._emitEnd()}},Wi=H("beforeEnd",qi),Bi=j("beforeEnd",qi),Hi={_init:function(t){var n=t.min,i=t.max;this._max=i,this._min=n,this._buff=[]},_free:function(){this._buff=null},_handleValue:function(t){this._buff=c(this._buff,t,this._max),this._buff.length>=this._min&&this._emitValue(this._buff)}},ji=H("slidingWindow",Hi),Ui=j("slidingWindow",Hi),Fi={_init:function(t){var n=t.fn,i=t.flushOnEnd;this._fn=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t);var n=this._fn;n(t)||this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Qi=H("bufferWhile",Fi),Yi=j("bufferWhile",Fi),zi=function(t){return t},Ki={_init:function(t){var n=t.count,i=t.flushOnEnd;this._count=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Gi=H("bufferWithCount",Ki),Ji=j("bufferWithCount",Ki),Ri={_init:function(t){var n=this,i=t.wait,e=t.count,r=t.flushOnEnd;this._wait=i,this._count=e,this._flushOnEnd=r,this._intervalId=null,this._$onTick=function(){return n._flush()},this._buff=[]},_free:function(){this._$onTick=null,this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&(clearInterval(this._intervalId),this._flush(),this._intervalId=setInterval(this._$onTick,this._wait))},_handleEnd:function(){this._flushOnEnd&&0!==this._buff.length&&this._flush(),this._emitEnd()},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait),this._source.onAny(this._$handleAny)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._source.offAny(this._$handleAny)}},Xi=H("bufferWithTimeOrCount",Ri),Zi=j("bufferWithTimeOrCount",Ri),te={_init:function(t){var n=t.transducer;this._xform=n(Vt(this))},_free:function(){this._xform=null},_handleValue:function(t){null!==this._xform["@@transducer/step"](null,t)&&this._xform["@@transducer/result"](null)},_handleEnd:function(){this._xform["@@transducer/result"](null)}},ne=H("transduce",te),ie=j("transduce",te),ee={_init:function(t){var n=t.fn;this._handler=n,this._emitter=S(this)},_free:function(){this._handler=null,this._emitter=null},_handleAny:function(t){this._handler(this._emitter,t)}},re=H("withHandler",ee),ue=j("withHandler",ee);e(Ct,p,{_name:"combine",_onActivation:function(){this._aliveCount=this._activeCount;for(var t=this._activeCount;t<this._sources.length;t++)this._sources[t].onAny(this._$handlers[t]);for(var n=0;n<this._activeCount;n++)this._sources[n].onAny(this._$handlers[n]);this._emitAfterActivation&&(this._emitAfterActivation=!1,this._emitIfFull()),this._endAfterActivation&&this._emitEnd()},_onDeactivation:function(){var t=this._sources.length,n=void 0;for(n=0;n<t;n++)this._sources[n].offAny(this._$handlers[n])},_emitIfFull:function(){for(var t=!0,n=!1,i=this._latestValues.length,e=new Array(i),r=new Array(i),u=0;u<i;u++)e[u]=this._latestValues[u],r[u]=this._latestErrors[u],e[u]===rn&&(t=!1),void 0!==r[u]&&(n=!0);if(t){var s=this._combinator;this._emitValue(s(e))}n&&this._emitError($t(r))},_handleAny:function(t,n){n.type===sn||n.type===on?(n.type===sn&&(this._latestValues[t]=n.value,this._latestErrors[t]=void 0),n.type===on&&(this._latestValues[t]=rn,this._latestErrors[t]={index:this._latestErrorIndex++,error:n.value}),t<this._activeCount&&(this._activating?this._emitAfterActivation=!0:this._emitIfFull())):t<this._activeCount&&(this._aliveCount--,0===this._aliveCount&&(this._activating?this._endAfterActivation=!0:this._emitEnd()))},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._latestValues=null,this._latestErrors=null,this._combinator=null,this._$handlers=null}});var se=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};e(It,p,{_name:"zip",_onActivation:function(){for(;this._isFull();)this._emit();
var t=this._sources.length;this._aliveCount=t;for(var n=0;n<t&&this._active;n++)this._sources[n].onAny(this._$handlers[n])},_onDeactivation:function(){for(var t=0;t<this._sources.length;t++)this._sources[t].offAny(this._$handlers[t])},_emit:function(){for(var t=new Array(this._buffers.length),n=0;n<this._buffers.length;n++)t[n]=this._buffers[n].shift();var i=this._combinator;this._emitValue(i(t))},_isFull:function(){for(var t=0;t<this._buffers.length;t++)if(0===this._buffers[t].length)return!1;return!0},_handleAny:function(t,n){n.type===sn&&(this._buffers[t].push(n.value),this._isFull()&&this._emit()),n.type===on&&this._emitError(n.value),n.type===un&&(this._aliveCount--,0===this._aliveCount&&this._emitEnd())},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._buffers=null,this._combinator=null,this._$handlers=null}});var oe=function(t){return t};e(Ot,p,{_name:"abstractPool",_add:function(t,n){n=n||oe,this._concurLim===-1||this._curSources.length<this._concurLim?this._addToCur(n(t)):this._queueLim===-1||this._queue.length<this._queueLim?this._addToQueue(n(t)):"old"===this._drop&&(this._removeOldest(),this._add(t,n))},_addAll:function(t){var n=this;l(t,function(t){return n._add(t)})},_remove:function(t){this._removeCur(t)===-1&&this._removeQueue(t)},_addToQueue:function(t){this._queue=r(this._queue,[t])},_addToCur:function(t){if(this._active){if(!t._alive)return void(t._currentEvent&&this._emit(t._currentEvent.type,t._currentEvent.value));this._currentlyAdding=t,t.onAny(this._$handleSubAny),this._currentlyAdding=null,t._alive&&(this._curSources=r(this._curSources,[t]),this._active&&this._subToEnd(t))}else this._curSources=r(this._curSources,[t])},_subToEnd:function(t){var n=this,i=function(){return n._removeCur(t)};this._$endHandlers.push({obs:t,handler:i}),t.onEnd(i)},_subscribe:function(t){t.onAny(this._$handleSubAny),this._active&&this._subToEnd(t)},_unsubscribe:function(t){t.offAny(this._$handleSubAny);var n=s(this._$endHandlers,function(n){return n.obs===t});n!==-1&&(t.offEnd(this._$endHandlers[n].handler),this._$endHandlers.splice(n,1))},_handleSubAny:function(t){t.type===sn?this._emitValue(t.value):t.type===on&&this._emitError(t.value)},_removeQueue:function(t){var n=u(this._queue,t);return this._queue=a(this._queue,n),n},_removeCur:function(t){this._active&&this._unsubscribe(t);var n=u(this._curSources,t);return this._curSources=a(this._curSources,n),n!==-1&&(0!==this._queue.length?this._pullQueue():0===this._curSources.length&&this._onEmpty()),n},_removeOldest:function(){this._removeCur(this._curSources[0])},_pullQueue:function(){0!==this._queue.length&&(this._queue=o(this._queue),this._addToCur(this._queue.shift()))},_onActivation:function(){for(var t=0,n=this._curSources;t<n.length&&this._active;t++)this._subscribe(n[t])},_onDeactivation:function(){for(var t=0,n=this._curSources;t<n.length;t++)this._unsubscribe(n[t]);null!==this._currentlyAdding&&this._unsubscribe(this._currentlyAdding)},_isEmpty:function(){return 0===this._curSources.length},_onEmpty:function(){},_clear:function(){p.prototype._clear.call(this),this._queue=null,this._curSources=null,this._$handleSubAny=null,this._$endHandlers=null}}),e(Lt,Ot,{_name:"merge",_onEmpty:function(){this._initialised&&this._emitEnd()}}),e(Mt,p,{_name:"repeat",_handleAny:function(t){t.type===un?(this._source=null,this._getSource()):this._emit(t.type,t.value)},_getSource:function(){if(!this._inLoop){this._inLoop=!0;for(var t=this._generator;null===this._source&&this._alive&&this._active;)this._source=t(this._iteration++),this._source?this._source.onAny(this._$handleAny):this._emitEnd();this._inLoop=!1}},_onActivation:function(){this._source?this._source.onAny(this._$handleAny):this._getSource()},_onDeactivation:function(){this._source&&this._source.offAny(this._$handleAny)},_clear:function(){p.prototype._clear.call(this),this._generator=null,this._source=null,this._$handleAny=null}}),e(qt,Ot,{_name:"pool",plug:function(t){return this._add(t),this},unplug:function(t){return this._remove(t),this}}),e(Wt,Ot,{_onActivation:function(){Ot.prototype._onActivation.call(this),this._active&&this._source.onAny(this._$handleMain)},_onDeactivation:function(){Ot.prototype._onDeactivation.call(this),this._source.offAny(this._$handleMain),this._hadNoEvSinceDeact=!0},_handleMain:function(t){if(t.type===sn){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===on&&this._emitError(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)},_onEmpty:function(){this._mainEnded&&this._emitEnd()},_clear:function(){Ot.prototype._clear.call(this),this._source=null,this._lastCurrent=null,this._$handleMain=null}}),e(Bt,Wt,{_handleMain:function(t){if(t.type===on){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===sn&&this._emitValue(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)}});var ae={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._lastSecondary&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary!==rn&&this._lastSecondary||this._emitEnd()}},he=Ut("filterBy",ae),le=Ft("filterBy",ae),_e=function(t,n){return n},fe={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary===rn&&this._emitEnd()}},ce=Ut("skipUntilBy",fe),de=Ft("skipUntilBy",fe),ve={_handleSecondaryValue:function(){this._emitEnd()}},me=Ut("takeUntilBy",ve),pe=Ft("takeUntilBy",ve),ye={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n;this._buff=[],this._flushOnEnd=i},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_onActivation:function(){this._primary.onAny(this._$handlePrimaryAny),this._alive&&null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny)},_handlePrimaryValue:function(t){this._buff.push(t)},_handleSecondaryValue:function(){this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._emitEnd()}},Ee=Ut("bufferBy",ye),ge=Ft("bufferBy",ye),be={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n,e=t.flushOnChange,r=void 0!==e&&e;this._buff=[],this._flushOnEnd=i,this._flushOnChange=r},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_handlePrimaryValue:function(t){this._buff.push(t),this._lastSecondary===rn||this._lastSecondary||this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._lastSecondary!==rn&&!this._lastSecondary||this._emitEnd()},_handleSecondaryValue:function(t){this._flushOnChange&&!t&&this._flush(),this._lastSecondary=t}},we=Ut("bufferWhileBy",be),Ae=Ft("bufferWhileBy",be),Ve=function(){return!1},Se=function(){return!0},Te={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn,i=n(t);i.convert?this._emitError(i.error):this._emitValue(t)}},$e=H("valuesToErrors",Te),Ce=j("valuesToErrors",Te),ke=function(t){return{convert:!0,error:t}},Ie={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn,i=n(t);i.convert?this._emitValue(i.value):this._emitError(t)}},xe=H("errorsToValues",Ie),Oe=j("errorsToValues",Ie),Le=function(t){return{convert:!0,value:t}},Pe={_handleError:function(t){this._emitError(t),this._emitEnd()}},Me=H("endOnError",Pe),De=j("endOnError",Pe);m.prototype.toProperty=function(t){return U(this,t)},m.prototype.changes=function(){return F(this)},m.prototype.toPromise=function(t){return z(this,t)},m.prototype.toESObservable=R,m.prototype[Vn]=R,m.prototype.map=function(t){return X(this,t)},m.prototype.filter=function(t){return Z(this,t)},m.prototype.take=function(t){return tt(this,t)},m.prototype.takeErrors=function(t){return nt(this,t)},m.prototype.takeWhile=function(t){return it(this,t)},m.prototype.last=function(){return et(this)},m.prototype.skip=function(t){return rt(this,t)},m.prototype.skipWhile=function(t){return ut(this,t)},m.prototype.skipDuplicates=function(t){return st(this,t)},m.prototype.diff=function(t,n){return at(this,t,n)},m.prototype.scan=function(t,n){return ht(this,t,n)},m.prototype.flatten=function(t){return lt(this,t)},m.prototype.delay=function(t){return _t(this,t)},m.prototype.throttle=function(t,n){return ft(this,t,n)},m.prototype.debounce=function(t,n){return ct(this,t,n)},m.prototype.mapErrors=function(t){return dt(this,t)},m.prototype.filterErrors=function(t){return vt(this,t)},m.prototype.ignoreValues=function(){return mt(this)},m.prototype.ignoreErrors=function(){return pt(this)},m.prototype.ignoreEnd=function(){return yt(this)},m.prototype.beforeEnd=function(t){return Et(this,t)},m.prototype.slidingWindow=function(t,n){return gt(this,t,n)},m.prototype.bufferWhile=function(t,n){return bt(this,t,n)},m.prototype.bufferWithCount=function(t,n){return wt(this,t,n)},m.prototype.bufferWithTimeOrCount=function(t,n,i){return At(this,t,n,i)},m.prototype.transduce=function(t){return St(this,t)},m.prototype.withHandler=function(t){return Tt(this,t)},m.prototype.combine=function(t,n){return kt([this,t],n)},m.prototype.zip=function(t,n){return xt([this,t],n)},m.prototype.merge=function(t){return Pt([this,t])},m.prototype.concat=function(t){return Nt([this,t])};var Ne=function(){return new qt};m.prototype.flatMap=function(t){return new Wt(this,t).setName(this,"flatMap")},m.prototype.flatMapLatest=function(t){return new Wt(this,t,{concurLim:1,drop:"old"}).setName(this,"flatMapLatest")},m.prototype.flatMapFirst=function(t){return new Wt(this,t,{concurLim:1}).setName(this,"flatMapFirst")},m.prototype.flatMapConcat=function(t){return new Wt(this,t,{queueLim:-1,concurLim:1}).setName(this,"flatMapConcat")},m.prototype.flatMapConcurLimit=function(t,n){return new Wt(this,t,{queueLim:-1,concurLim:n}).setName(this,"flatMapConcurLimit")},m.prototype.flatMapErrors=function(t){return new Bt(this,t).setName(this,"flatMapErrors")},m.prototype.filterBy=function(t){return Qt(this,t)},m.prototype.sampledBy=function(t,n){return Yt(this,t,n)},m.prototype.skipUntilBy=function(t){return zt(this,t)},m.prototype.takeUntilBy=function(t){return Kt(this,t)},m.prototype.bufferBy=function(t,n){return Gt(this,t,n)},m.prototype.bufferWhileBy=function(t,n){return Jt(this,t,n)};var qe=!0;m.prototype.awaiting=function(t){return en("You are using deprecated .awaiting() method, see https://github.com/rpominov/kefir/issues/145"),Rt(this,t)},m.prototype.valuesToErrors=function(t){return en("You are using deprecated .valuesToErrors() method, see https://github.com/rpominov/kefir/issues/149"),Xt(this,t)},m.prototype.errorsToValues=function(t){return en("You are using deprecated .errorsToValues() method, see https://github.com/rpominov/kefir/issues/149"),Zt(this,t)},m.prototype.endOnError=function(){return en("You are using deprecated .endOnError() method, see https://github.com/rpominov/kefir/issues/150"),tn(this)};var We={Observable:m,Stream:p,Property:y,never:E,later:b,interval:w,sequentially:A,fromPoll:V,withInterval:T,fromCallback:k,fromNodeCallback:I,fromEvents:P,stream:C,constant:D,constantError:q,fromPromise:Q,fromESObservable:G,combine:kt,zip:xt,merge:Pt,concat:Nt,Pool:qt,pool:Ne,repeat:Dt};We.Kefir=We,t.dissableDeprecationWarnings=nn,t.Kefir=We,t.Observable=m,t.Stream=p,t.Property=y,t.never=E,t.later=b,t.interval=w,t.sequentially=A,t.fromPoll=V,t.withInterval=T,t.fromCallback=k,t.fromNodeCallback=I,t.fromEvents=P,t.stream=C,t.constant=D,t.constantError=q,t.fromPromise=Q,t.fromESObservable=G,t.combine=kt,t.zip=xt,t.merge=Pt,t.concat=Nt,t.Pool=qt,t.pool=Ne,t.repeat=Dt,t["default"]=We,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.Kefir=t.Kefir||{})}(this,function(t){"use strict";function n(t){var n=function(){};return n.prototype=t,new n}function i(t){var n=arguments.length,i=void 0,e=void 0;for(i=1;i<n;i++)for(e in arguments[i])t[e]=arguments[i][e];return t}function e(t,e){var r=arguments.length,u=void 0;for(t.prototype=n(e.prototype),t.prototype.constructor=t,u=2;u<r;u++)i(t.prototype,arguments[u]);return t}function r(t,n){var i=void 0,e=void 0,r=void 0,u=void 0;if(0===t.length)return n;if(0===n.length)return t;for(u=0,i=new Array(t.length+n.length),e=t.length,r=0;r<e;r++,u++)i[u]=t[r];for(e=n.length,r=0;r<e;r++,u++)i[u]=n[r];return i}function u(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(t[e]===n)return e;return-1}function s(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(n(t[e]))return e;return-1}function o(t){var n=t.length,i=new Array(n),e=void 0;for(e=0;e<n;e++)i[e]=t[e];return i}function a(t,n){var i=t.length,e=void 0,r=void 0,u=void 0;if(n>=0&&n<i){if(1===i)return[];for(e=new Array(i-1),r=0,u=0;r<i;r++)r!==n&&(e[u]=t[r],u++);return e}return t}function h(t,n){var i=t.length,e=new Array(i),r=void 0;for(r=0;r<i;r++)e[r]=n(t[r]);return e}function l(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)n(t[e])}function _(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)t[e]=n}function f(t,n){return u(t,n)!==-1}function c(t,n,i){var e=Math.min(i,t.length+1),r=t.length-e+1,u=new Array(e),s=void 0;for(s=r;s<e;s++)u[s-r]=t[s];return u[e-1]=n,u}function d(t,n,i){t===an?n(i):t===i.type&&(t===sn||t===on?n(i.value):n())}function v(){this._items=[],this._inLoop=0,this._removedItems=null}function m(){this._dispatcher=new v,this._active=!1,this._alive=!0,this._activating=!1,this._logHandlers=null}function p(){m.call(this)}function y(){m.call(this),this._currentEvent=null}function E(){return hn}function g(t){function n(t,n){var i=this;p.call(this),this._wait=t,this._intervalId=null,this._$onTick=function(){return i._onTick()},this._init(n)}return e(n,p,{_init:function(){},_free:function(){},_onTick:function(){},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)},_clear:function(){p.prototype._clear.call(this),this._$onTick=null,this._free()}},t),n}function b(t,n){return new ln(t,{x:n})}function A(t,n){return new _n(t,{x:n})}function w(t,n){return 0===n.length?E():new fn(t,{xs:n})}function V(t,n){return new cn(t,{fn:n})}function S(t){function n(n){return t._emitValue(n),t._active}function i(n){return t._emitError(n),t._active}function e(){return t._emitEnd(),t._active}function r(n){return t._emit(n.type,n.value),t._active}return{value:n,error:i,end:e,event:r,emit:n,emitEvent:r}}function T(t,n){return new dn(t,{fn:n})}function $(t){p.call(this),this._fn=t,this._unsubscribe=null}function C(t){return new $(t)}function k(t){var n=!1;return C(function(i){n||(t(function(t){i.emit(t),i.end()}),n=!0)}).setName("fromCallback")}function I(t){var n=!1;return C(function(i){n||(t(function(t,n){t?i.error(t):i.emit(n),i.end()}),n=!0)}).setName("fromNodeCallback")}function O(t,n){switch(n){case 0:return function(){return t()};case 1:return function(n){return t(n[0])};case 2:return function(n){return t(n[0],n[1])};case 3:return function(n){return t(n[0],n[1],n[2])};case 4:return function(n){return t(n[0],n[1],n[2],n[3])};default:return function(n){return t.apply(null,n)}}}function x(t,n,i){var e=i?i.length:0;if(null==n)switch(e){case 0:return t();case 1:return t(i[0]);case 2:return t(i[0],i[1]);case 3:return t(i[0],i[1],i[2]);case 4:return t(i[0],i[1],i[2],i[3]);default:return t.apply(null,i)}else switch(e){case 0:return t.call(n);default:return t.apply(n,i)}}function L(t,n,i){return C(function(e){var r=i?function(){e.emit(x(i,this,arguments))}:function(t){e.emit(t)};return t(r),function(){return n(r)}}).setName("fromSubUnsub")}function P(t,n,i){for(var e=void 0,r=void 0,u=0;u<vn.length;u++)if("function"==typeof t[vn[u][0]]&&"function"==typeof t[vn[u][1]]){e=vn[u][0],r=vn[u][1];break}if(void 0===e)throw new Error("target don't support any of addEventListener/removeEventListener, addListener/removeListener, on/off method pair");return L(function(i){return t[e](n,i)},function(i){return t[r](n,i)},i).setName("fromEvents")}function M(t){this._currentEvent={type:"value",value:t,current:!0}}function D(t){return new M(t)}function N(t){this._currentEvent={type:"error",value:t,current:!0}}function q(t){return new N(t)}function W(t,n){return function(i,e){var r=this;t.call(this),this._source=i,this._name=i._name+"."+n,this._init(e),this._$handleAny=function(t){return r._handleAny(t)}}}function B(t){return{_init:function(){},_free:function(){},_handleValue:function(t){this._emitValue(t)},_handleError:function(t){this._emitError(t)},_handleEnd:function(){this._emitEnd()},_handleAny:function(t){switch(t.type){case sn:return this._handleValue(t.value);case on:return this._handleError(t.value);case un:return this._handleEnd()}},_onActivation:function(){this._source.onAny(this._$handleAny)},_onDeactivation:function(){this._source.offAny(this._$handleAny)},_clear:function(){t.prototype._clear.call(this),this._source=null,this._$handleAny=null,this._free()}}}function H(t,n){var i=W(p,t);return e(i,p,B(p),n),i}function j(t,n){var i=W(y,t);return e(i,y,B(y),n),i}function U(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(null!==n&&"function"!=typeof n)throw new Error("You should call toProperty() with a function or no arguments.");return new mn(t,{fn:n})}function F(t){return new pn(t)}function Q(t){var n=!1,i=C(function(i){if(!n){var e=function(t){i.emit(t),i.end()},r=function(t){i.error(t),i.end()},u=t.then(e,r);u&&"function"==typeof u.done&&u.done(),n=!0}});return U(i,null).setName("fromPromise")}function Y(){if("function"==typeof Promise)return Promise;throw new Error("There isn't default Promise, use shim or parameter")}function z(t){var n=arguments.length<=1||void 0===arguments[1]?Y():arguments[1],i=null;return new n(function(n,e){t.onAny(function(t){t.type===un&&null!==i?((i.type===sn?n:e)(i.value),i=null):i=t})})}function K(t,n){return n={exports:{}},t(n,n.exports),n.exports}function G(t){var n=t[Vn]?t[Vn]():t;return C(function(t){var i=n.subscribe({error:function(n){t.error(n),t.end()},next:function(n){t.emit(n)},complete:function(){t.end()}});return i.unsubscribe?function(){i.unsubscribe()}:i}).setName("fromESObservable")}function J(t){this._observable=t.takeErrors(1)}function R(){return new J(this)}function X(t){var n=arguments.length<=1||void 0===arguments[1]?Cn:arguments[1];return new(t._ofSameType(Tn,$n))(t,{fn:n})}function Z(t){var n=arguments.length<=1||void 0===arguments[1]?xn:arguments[1];return new(t._ofSameType(In,On))(t,{fn:n})}function tt(t,n){return new(t._ofSameType(Pn,Mn))(t,{n:n})}function nt(t,n){return new(t._ofSameType(Nn,qn))(t,{n:n})}function it(t){var n=arguments.length<=1||void 0===arguments[1]?jn:arguments[1];return new(t._ofSameType(Bn,Hn))(t,{fn:n})}function et(t){return new(t._ofSameType(Fn,Qn))(t)}function rt(t,n){return new(t._ofSameType(zn,Kn))(t,{n:n})}function ut(t){var n=arguments.length<=1||void 0===arguments[1]?Xn:arguments[1];return new(t._ofSameType(Jn,Rn))(t,{fn:n})}function st(t){var n=arguments.length<=1||void 0===arguments[1]?ii:arguments[1];return new(t._ofSameType(ti,ni))(t,{fn:n})}function ot(t,n){return[t,n]}function at(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new(t._ofSameType(ri,ui))(t,{fn:n||ot,seed:i})}function ht(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new si(t,{fn:n,seed:i})}function lt(t){var n=arguments.length<=1||void 0===arguments[1]?hi:arguments[1];return new ai(t,{fn:n})}function _t(t,n){return new(t._ofSameType(fi,ci))(t,{wait:n})}function ft(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.leading,r=void 0===e||e,u=i.trailing,s=void 0===u||u;return new(t._ofSameType(mi,pi))(t,{wait:n,leading:r,trailing:s})}function ct(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.immediate,r=void 0!==e&&e;return new(t._ofSameType(Ei,gi))(t,{wait:n,immediate:r})}function dt(t){var n=arguments.length<=1||void 0===arguments[1]?Vi:arguments[1];return new(t._ofSameType(Ai,wi))(t,{fn:n})}function vt(t){var n=arguments.length<=1||void 0===arguments[1]?Ci:arguments[1];return new(t._ofSameType(Ti,$i))(t,{fn:n})}function mt(t){return new(t._ofSameType(Ii,Oi))(t)}function pt(t){return new(t._ofSameType(Li,Pi))(t)}function yt(t){return new(t._ofSameType(Di,Ni))(t)}function Et(t,n){return new(t._ofSameType(Wi,Bi))(t,{fn:n})}function gt(t,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return new(t._ofSameType(ji,Ui))(t,{min:i,max:n})}function bt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Qi,Yi))(t,{fn:n||zi,flushOnEnd:r})}function At(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Gi,Ji))(t,{count:n,flushOnEnd:r})}function wt(t,n,i){var e=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=e.flushOnEnd,u=void 0===r||r;return new(t._ofSameType(Xi,Zi))(t,{wait:n,count:i,flushOnEnd:u})}function Vt(t){return{"@@transducer/step":function(n,i){return t._emitValue(i),null},"@@transducer/result":function(){return t._emitEnd(),null}}}function St(t,n){return new(t._ofSameType(ne,ie))(t,{transducer:n})}function Tt(t,n){return new(t._ofSameType(re,ue))(t,{fn:n})}function $t(t){for(var n=void 0,i=0;i<t.length;i++)void 0!==t[i]&&(void 0===n||n.index<t[i].index)&&(n=t[i]);return n.error}function Ct(t,n,i){var e=this;p.call(this),this._activeCount=t.length,this._sources=r(t,n),this._combinator=i?O(i,this._sources.length):function(t){return t},this._aliveCount=0,this._latestValues=new Array(this._sources.length),this._latestErrors=new Array(this._sources.length),_(this._latestValues,rn),this._emitAfterActivation=!1,this._endAfterActivation=!1,this._latestErrorIndex=0,this._$handlers=[];for(var u=function(t){e._$handlers.push(function(n){return e._handleAny(t,n)})},s=0;s<this._sources.length;s++)u(s)}function kt(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments[2];return"function"==typeof n&&(i=n,n=[]),0===t.length?E():new Ct(t,n,i)}function It(t,n){var i=this;p.call(this),this._buffers=h(t,function(t){return se(t)?o(t):[]}),this._sources=h(t,function(t){return se(t)?E():t}),this._combinator=n?O(n,this._sources.length):function(t){return t},this._aliveCount=0,this._$handlers=[];for(var e=function(t){i._$handlers.push(function(n){return i._handleAny(t,n)})},r=0;r<this._sources.length;r++)e(r)}function Ot(t,n){return 0===t.length?E():new It(t,n)}function xt(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.queueLim,e=void 0===i?0:i,r=n.concurLim,u=void 0===r?-1:r,s=n.drop,o=void 0===s?"new":s;p.call(this),this._queueLim=e<0?-1:e,this._concurLim=u<0?-1:u,this._drop=o,this._queue=[],this._curSources=[],this._$handleSubAny=function(n){return t._handleSubAny(n)},this._$endHandlers=[],this._currentlyAdding=null,0===this._concurLim&&this._emitEnd()}function Lt(t){xt.call(this),this._addAll(t),this._initialised=!0}function Pt(t){return 0===t.length?E():new Lt(t)}function Mt(t){var n=this;p.call(this),this._generator=t,this._source=null,this._inLoop=!1,this._iteration=0,this._$handleAny=function(t){return n._handleAny(t)}}function Dt(t){return new Mt(t)}function Nt(t){return Dt(function(n){return t.length>n&&t[n]}).setName("concat")}function qt(){xt.call(this)}function Wt(t,n,i){var e=this;xt.call(this,i),this._source=t,this._fn=n,this._mainEnded=!1,this._lastCurrent=null,this._$handleMain=function(t){return e._handleMain(t)}}function Bt(t,n){Wt.call(this,t,n)}function Ht(t,n){return function(i,e,r){var u=this;t.call(this),this._primary=i,this._secondary=e,this._name=i._name+"."+n,this._lastSecondary=rn,this._$handleSecondaryAny=function(t){return u._handleSecondaryAny(t)},this._$handlePrimaryAny=function(t){return u._handlePrimaryAny(t)},this._init(r)}}function jt(t){return{_init:function(){},_free:function(){},_handlePrimaryValue:function(t){this._emitValue(t)},_handlePrimaryError:function(t){this._emitError(t)},_handlePrimaryEnd:function(){this._emitEnd()},_handleSecondaryValue:function(t){this._lastSecondary=t},_handleSecondaryError:function(t){this._emitError(t)},_handleSecondaryEnd:function(){},_handlePrimaryAny:function(t){switch(t.type){case sn:return this._handlePrimaryValue(t.value);case on:return this._handlePrimaryError(t.value);case un:return this._handlePrimaryEnd(t.value)}},_handleSecondaryAny:function(t){switch(t.type){case sn:return this._handleSecondaryValue(t.value);case on:return this._handleSecondaryError(t.value);case un:this._handleSecondaryEnd(t.value),this._removeSecondary()}},_removeSecondary:function(){null!==this._secondary&&(this._secondary.offAny(this._$handleSecondaryAny),this._$handleSecondaryAny=null,this._secondary=null)},_onActivation:function(){null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny),this._active&&this._primary.onAny(this._$handlePrimaryAny)},_onDeactivation:function(){null!==this._secondary&&this._secondary.offAny(this._$handleSecondaryAny),this._primary.offAny(this._$handlePrimaryAny)},_clear:function(){t.prototype._clear.call(this),this._primary=null,this._secondary=null,this._lastSecondary=null,this._$handleSecondaryAny=null,this._$handlePrimaryAny=null,this._free()}}}function Ut(t,n){var i=Ht(p,t);return e(i,p,jt(p),n),i}function Ft(t,n){var i=Ht(y,t);return e(i,y,jt(y),n),i}function Qt(t,n){return new(t._ofSameType(he,le))(t,n)}function Yt(t,n,i){var e=i?function(t,n){return i(n,t)}:_e;return kt([n],[t],e).setName(t,"sampledBy")}function zt(t,n){return new(t._ofSameType(ce,de))(t,n)}function Kt(t,n){return new(t._ofSameType(me,pe))(t,n)}function Gt(t,n,i){return new(t._ofSameType(Ee,ge))(t,n,i)}function Jt(t,n,i){return new(t._ofSameType(Ae,we))(t,n,i)}function Rt(t,n){var i=Pt([X(t,Se),X(n,Ve)]);return i=st(i),i=U(i,Ve),i.setName(t,"awaiting")}function Xt(t){var n=arguments.length<=1||void 0===arguments[1]?ke:arguments[1];return new(t._ofSameType($e,Ce))(t,{fn:n})}function Zt(t){var n=arguments.length<=1||void 0===arguments[1]?Le:arguments[1];return new(t._ofSameType(Oe,xe))(t,{fn:n})}function tn(t){return new(t._ofSameType(Me,De))(t)}function nn(){qe=!1}function en(t){if(qe&&console&&"function"==typeof console.warn){var n="\nHere is an Error object for you containing the call stack:";console.warn(t,n,new Error)}}var rn=["<nothing>"],un="end",sn="value",on="error",an="any";i(v.prototype,{add:function(t,n){return this._items=r(this._items,[{type:t,fn:n}]),this._items.length},remove:function(t,n){var i=s(this._items,function(i){return i.type===t&&i.fn===n});return 0!==this._inLoop&&i!==-1&&(null===this._removedItems&&(this._removedItems=[]),this._removedItems.push(this._items[i])),this._items=a(this._items,i),this._items.length},dispatch:function(t){this._inLoop++;for(var n=0,i=this._items;n<i.length&&null!==this._items;n++)null!==this._removedItems&&f(this._removedItems,i[n])||d(i[n].type,i[n].fn,t);this._inLoop--,0===this._inLoop&&(this._removedItems=null)},cleanup:function(){this._items=null}}),i(m.prototype,{_name:"observable",_onActivation:function(){},_onDeactivation:function(){},_setActive:function(t){this._active!==t&&(this._active=t,t?(this._activating=!0,this._onActivation(),this._activating=!1):this._onDeactivation())},_clear:function(){this._setActive(!1),this._dispatcher.cleanup(),this._dispatcher=null,this._logHandlers=null},_emit:function(t,n){switch(t){case sn:return this._emitValue(n);case on:return this._emitError(n);case un:return this._emitEnd()}},_emitValue:function(t){this._alive&&this._dispatcher.dispatch({type:sn,value:t})},_emitError:function(t){this._alive&&this._dispatcher.dispatch({type:on,value:t})},_emitEnd:function(){this._alive&&(this._alive=!1,this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive?(this._dispatcher.add(t,n),this._setActive(!0)):d(t,n,{type:un}),this},_off:function(t,n){if(this._alive){var i=this._dispatcher.remove(t,n);0===i&&this._setActive(!1)}return this},onValue:function(t){return this._on(sn,t)},onError:function(t){return this._on(on,t)},onEnd:function(t){return this._on(un,t)},onAny:function(t){return this._on(an,t)},offValue:function(t){return this._off(sn,t)},offError:function(t){return this._off(on,t)},offEnd:function(t){return this._off(un,t)},offAny:function(t){return this._off(an,t)},observe:function(t,n,i){var e=this,r=!1,u=t&&"function"!=typeof t?t:{value:t,error:n,end:i},s=function(t){t.type===un&&(r=!0),t.type===sn&&u.value?u.value(t.value):t.type===on&&u.error?u.error(t.value):t.type===un&&u.end&&u.end(t.value)};return this.onAny(s),{unsubscribe:function(){r||(e.offAny(s),r=!0)},get closed(){return r}}},_ofSameType:function(t,n){return t.prototype.getType()===this.getType()?t:n},setName:function(t,n){return this._name=n?t._name+"."+n:t,this},log:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0],n=void 0,i=function(i){var e="<"+i.type+(n?":current":"")+">";i.type===un?console.log(t,e):console.log(t,e,i.value)};return this._alive&&(this._logHandlers||(this._logHandlers=[]),this._logHandlers.push({name:t,handler:i})),n=!0,this.onAny(i),n=!1,this},offLog:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0];if(this._logHandlers){var n=s(this._logHandlers,function(n){return n.name===t});n!==-1&&(this.offAny(this._logHandlers[n].handler),this._logHandlers.splice(n,1))}return this}}),m.prototype.toString=function(){return"["+this._name+"]"},e(p,m,{_name:"stream",getType:function(){return"stream"}}),e(y,m,{_name:"property",_emitValue:function(t){this._alive&&(this._currentEvent={type:sn,value:t},this._activating||this._dispatcher.dispatch({type:sn,value:t}))},_emitError:function(t){this._alive&&(this._currentEvent={type:on,value:t},this._activating||this._dispatcher.dispatch({type:on,value:t}))},_emitEnd:function(){this._alive&&(this._alive=!1,this._activating||this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive&&(this._dispatcher.add(t,n),this._setActive(!0)),null!==this._currentEvent&&d(t,n,this._currentEvent),this._alive||d(t,n,{type:un}),this},getType:function(){return"property"}});var hn=new p;hn._emitEnd(),hn._name="never";var ln=g({_name:"later",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x),this._emitEnd()}}),_n=g({_name:"interval",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x)}}),fn=g({_name:"sequentially",_init:function(t){var n=t.xs;this._xs=o(n)},_free:function(){this._xs=null},_onTick:function(){1===this._xs.length?(this._emitValue(this._xs[0]),this._emitEnd()):this._emitValue(this._xs.shift())}}),cn=g({_name:"fromPoll",_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_onTick:function(){var t=this._fn;this._emitValue(t())}}),dn=g({_name:"withInterval",_init:function(t){var n=t.fn;this._fn=n,this._emitter=S(this)},_free:function(){this._fn=null,this._emitter=null},_onTick:function(){var t=this._fn;t(this._emitter)}});e($,p,{_name:"stream",_onActivation:function(){var t=this._fn,n=t(S(this));this._unsubscribe="function"==typeof n?n:null,this._active||this._callUnsubscribe()},_callUnsubscribe:function(){null!==this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},_onDeactivation:function(){this._callUnsubscribe()},_clear:function(){p.prototype._clear.call(this),this._fn=null}});var vn=[["addEventListener","removeEventListener"],["addListener","removeListener"],["on","off"]];e(M,y,{_name:"constant",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null}),e(N,y,{_name:"constantError",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null});var mn=j("toProperty",{_init:function(t){var n=t.fn;this._getInitialCurrent=n},_onActivation:function(){if(null!==this._getInitialCurrent){var t=this._getInitialCurrent;this._emitValue(t())}this._source.onAny(this._$handleAny)}}),pn=H("changes",{_handleValue:function(t){this._activating||this._emitValue(t)},_handleError:function(t){this._activating||this._emitError(t)}}),yn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},En=K(function(t,n){function i(t){var n,i=t.Symbol;return"function"==typeof i?i.observable?n=i.observable:(n=i("observable"),i.observable=n):n="@@observable",n}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i}),gn=En&&"object"==typeof En&&"default"in En?En["default"]:En,bn=K(function(t,n){function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var e=gn,r=i(e),u=void 0;"undefined"!=typeof yn?u=yn:"undefined"!=typeof window&&(u=window);var s=(0,r["default"])(u);n["default"]=s}),An=bn&&"object"==typeof bn&&"default"in bn?bn["default"]:bn,wn=K(function(t){t.exports=An}),Vn=wn&&"object"==typeof wn&&"default"in wn?wn["default"]:wn;i(J.prototype,{subscribe:function(t,n,i){var e=this,r="function"==typeof t?{next:t,error:n,complete:i}:t,u=function(t){t.type===un&&(s=!0),t.type===sn&&r.next?r.next(t.value):t.type===on&&r.error?r.error(t.value):t.type===un&&r.complete&&r.complete(t.value)};this._observable.onAny(u);var s=!1,o={unsubscribe:function(){s=!0,e._observable.offAny(u)},get closed(){return s}};return o}}),J.prototype[Vn]=function(){return this};var Sn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;this._emitValue(n(t))}},Tn=H("map",Sn),$n=j("map",Sn),Cn=function(t){return t},kn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)&&this._emitValue(t)}},In=H("filter",kn),On=j("filter",kn),xn=function(t){return t},Ln={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleValue:function(t){this._n--,this._emitValue(t),0===this._n&&this._emitEnd()}},Pn=H("take",Ln),Mn=j("take",Ln),Dn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleError:function(t){this._n--,this._emitError(t),0===this._n&&this._emitEnd()}},Nn=H("takeErrors",Dn),qn=j("takeErrors",Dn),Wn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)?this._emitValue(t):this._emitEnd()}},Bn=H("takeWhile",Wn),Hn=j("takeWhile",Wn),jn=function(t){return t},Un={_init:function(){this._lastValue=rn},_free:function(){this._lastValue=null},_handleValue:function(t){this._lastValue=t},_handleEnd:function(){this._lastValue!==rn&&this._emitValue(this._lastValue),this._emitEnd()}},Fn=H("last",Un),Qn=j("last",Un),Yn={_init:function(t){var n=t.n;this._n=Math.max(0,n)},_handleValue:function(t){0===this._n?this._emitValue(t):this._n--}},zn=H("skip",Yn),Kn=j("skip",Yn),Gn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;null===this._fn||n(t)||(this._fn=null),null===this._fn&&this._emitValue(t)}},Jn=H("skipWhile",Gn),Rn=j("skipWhile",Gn),Xn=function(t){return t},Zn={_init:function(t){var n=t.fn;this._fn=n,this._prev=rn},_free:function(){this._fn=null,this._prev=null},_handleValue:function(t){var n=this._fn;this._prev!==rn&&n(this._prev,t)||(this._prev=t,this._emitValue(t))}},ti=H("skipDuplicates",Zn),ni=j("skipDuplicates",Zn),ii=function(t,n){return t===n},ei={_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._prev=i},_free:function(){this._prev=null,this._fn=null},_handleValue:function(t){if(this._prev!==rn){var n=this._fn;this._emitValue(n(this._prev,t))}this._prev=t}},ri=H("diff",ei),ui=j("diff",ei),si=j("scan",{_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._seed=i,i!==rn&&this._emitValue(i)},_free:function(){this._fn=null,this._seed=null},_handleValue:function(t){var n=this._fn;null===this._currentEvent||this._currentEvent.type===on?this._emitValue(this._seed===rn?t:n(this._seed,t)):this._emitValue(n(this._currentEvent.value,t))}}),oi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){for(var n=this._fn,i=n(t),e=0;e<i.length;e++)this._emitValue(i[e])}},ai=H("flatten",oi),hi=function(t){return t},li={},_i={_init:function(t){var n=this,i=t.wait;this._wait=Math.max(0,i),this._buff=[],this._$shiftBuff=function(){var t=n._buff.shift();t===li?n._emitEnd():n._emitValue(t)}},_free:function(){this._buff=null,this._$shiftBuff=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._buff.push(t),setTimeout(this._$shiftBuff,this._wait))},_handleEnd:function(){this._activating?this._emitEnd():(this._buff.push(li),setTimeout(this._$shiftBuff,this._wait))}},fi=H("delay",_i),ci=j("delay",_i),di=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},vi={_init:function(t){var n=this,i=t.wait,e=t.leading,r=t.trailing;this._wait=Math.max(0,i),this._leading=e,this._trailing=r,this._trailingValue=null,this._timeoutId=null,this._endLater=!1,this._lastCallTime=0,this._$trailingCall=function(){return n._trailingCall()}},_free:function(){this._trailingValue=null,this._$trailingCall=null},_handleValue:function(t){if(this._activating)this._emitValue(t);else{var n=di();0!==this._lastCallTime||this._leading||(this._lastCallTime=n);var i=this._wait-(n-this._lastCallTime);i<=0?(this._cancelTrailing(),this._lastCallTime=n,this._emitValue(t)):this._trailing&&(this._cancelTrailing(),this._trailingValue=t,this._timeoutId=setTimeout(this._$trailingCall,i))}},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId?this._endLater=!0:this._emitEnd()},_cancelTrailing:function(){null!==this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null)},_trailingCall:function(){this._emitValue(this._trailingValue),this._timeoutId=null,this._trailingValue=null,this._lastCallTime=this._leading?di():0,this._endLater&&this._emitEnd()}},mi=H("throttle",vi),pi=j("throttle",vi),yi={_init:function(t){var n=this,i=t.wait,e=t.immediate;this._wait=Math.max(0,i),this._immediate=e,this._lastAttempt=0,this._timeoutId=null,this._laterValue=null,this._endLater=!1,this._$later=function(){return n._later()}},_free:function(){this._laterValue=null,this._$later=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._lastAttempt=di(),this._immediate&&!this._timeoutId&&this._emitValue(t),this._timeoutId||(this._timeoutId=setTimeout(this._$later,this._wait)),this._immediate||(this._laterValue=t))},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId&&!this._immediate?this._endLater=!0:this._emitEnd()},_later:function(){var t=di()-this._lastAttempt;t<this._wait&&t>=0?this._timeoutId=setTimeout(this._$later,this._wait-t):(this._timeoutId=null,this._immediate||(this._emitValue(this._laterValue),this._laterValue=null),this._endLater&&this._emitEnd())}},Ei=H("debounce",yi),gi=j("debounce",yi),bi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;this._emitError(n(t))}},Ai=H("mapErrors",bi),wi=j("mapErrors",bi),Vi=function(t){return t},Si={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;n(t)&&this._emitError(t)}},Ti=H("filterErrors",Si),$i=j("filterErrors",Si),Ci=function(t){return t},ki={_handleValue:function(){}},Ii=H("ignoreValues",ki),Oi=j("ignoreValues",ki),xi={_handleError:function(){}},Li=H("ignoreErrors",xi),Pi=j("ignoreErrors",xi),Mi={_handleEnd:function(){}},Di=H("ignoreEnd",Mi),Ni=j("ignoreEnd",Mi),qi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleEnd:function(){var t=this._fn;this._emitValue(t()),this._emitEnd()}},Wi=H("beforeEnd",qi),Bi=j("beforeEnd",qi),Hi={_init:function(t){var n=t.min,i=t.max;this._max=i,this._min=n,this._buff=[]},_free:function(){this._buff=null},_handleValue:function(t){this._buff=c(this._buff,t,this._max),this._buff.length>=this._min&&this._emitValue(this._buff)}},ji=H("slidingWindow",Hi),Ui=j("slidingWindow",Hi),Fi={_init:function(t){var n=t.fn,i=t.flushOnEnd;this._fn=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t);var n=this._fn;n(t)||this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Qi=H("bufferWhile",Fi),Yi=j("bufferWhile",Fi),zi=function(t){return t},Ki={_init:function(t){var n=t.count,i=t.flushOnEnd;this._count=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Gi=H("bufferWithCount",Ki),Ji=j("bufferWithCount",Ki),Ri={_init:function(t){var n=this,i=t.wait,e=t.count,r=t.flushOnEnd;this._wait=i,this._count=e,this._flushOnEnd=r,this._intervalId=null,this._$onTick=function(){return n._flush()},this._buff=[]},_free:function(){this._$onTick=null,this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&(clearInterval(this._intervalId),this._flush(),this._intervalId=setInterval(this._$onTick,this._wait))},_handleEnd:function(){this._flushOnEnd&&0!==this._buff.length&&this._flush(),this._emitEnd()},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait),this._source.onAny(this._$handleAny)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._source.offAny(this._$handleAny)}},Xi=H("bufferWithTimeOrCount",Ri),Zi=j("bufferWithTimeOrCount",Ri),te={_init:function(t){var n=t.transducer;this._xform=n(Vt(this))},_free:function(){this._xform=null},_handleValue:function(t){null!==this._xform["@@transducer/step"](null,t)&&this._xform["@@transducer/result"](null)},_handleEnd:function(){this._xform["@@transducer/result"](null)}},ne=H("transduce",te),ie=j("transduce",te),ee={_init:function(t){var n=t.fn;this._handler=n,this._emitter=S(this)},_free:function(){this._handler=null,this._emitter=null},_handleAny:function(t){this._handler(this._emitter,t)}},re=H("withHandler",ee),ue=j("withHandler",ee);e(Ct,p,{_name:"combine",_onActivation:function(){this._aliveCount=this._activeCount;for(var t=this._activeCount;t<this._sources.length;t++)this._sources[t].onAny(this._$handlers[t]);for(var n=0;n<this._activeCount;n++)this._sources[n].onAny(this._$handlers[n]);this._emitAfterActivation&&(this._emitAfterActivation=!1,this._emitIfFull()),this._endAfterActivation&&this._emitEnd()},_onDeactivation:function(){var t=this._sources.length,n=void 0;for(n=0;n<t;n++)this._sources[n].offAny(this._$handlers[n])},_emitIfFull:function(){for(var t=!0,n=!1,i=this._latestValues.length,e=new Array(i),r=new Array(i),u=0;u<i;u++)e[u]=this._latestValues[u],r[u]=this._latestErrors[u],e[u]===rn&&(t=!1),void 0!==r[u]&&(n=!0);if(t){var s=this._combinator;this._emitValue(s(e))}n&&this._emitError($t(r))},_handleAny:function(t,n){n.type===sn||n.type===on?(n.type===sn&&(this._latestValues[t]=n.value,this._latestErrors[t]=void 0),n.type===on&&(this._latestValues[t]=rn,this._latestErrors[t]={index:this._latestErrorIndex++,error:n.value}),t<this._activeCount&&(this._activating?this._emitAfterActivation=!0:this._emitIfFull())):t<this._activeCount&&(this._aliveCount--,0===this._aliveCount&&(this._activating?this._endAfterActivation=!0:this._emitEnd()));
},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._latestValues=null,this._latestErrors=null,this._combinator=null,this._$handlers=null}});var se=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};e(It,p,{_name:"zip",_onActivation:function(){for(;this._isFull();)this._emit();var t=this._sources.length;this._aliveCount=t;for(var n=0;n<t&&this._active;n++)this._sources[n].onAny(this._$handlers[n])},_onDeactivation:function(){for(var t=0;t<this._sources.length;t++)this._sources[t].offAny(this._$handlers[t])},_emit:function(){for(var t=new Array(this._buffers.length),n=0;n<this._buffers.length;n++)t[n]=this._buffers[n].shift();var i=this._combinator;this._emitValue(i(t))},_isFull:function(){for(var t=0;t<this._buffers.length;t++)if(0===this._buffers[t].length)return!1;return!0},_handleAny:function(t,n){n.type===sn&&(this._buffers[t].push(n.value),this._isFull()&&this._emit()),n.type===on&&this._emitError(n.value),n.type===un&&(this._aliveCount--,0===this._aliveCount&&this._emitEnd())},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._buffers=null,this._combinator=null,this._$handlers=null}});var oe=function(t){return t};e(xt,p,{_name:"abstractPool",_add:function(t,n){n=n||oe,this._concurLim===-1||this._curSources.length<this._concurLim?this._addToCur(n(t)):this._queueLim===-1||this._queue.length<this._queueLim?this._addToQueue(n(t)):"old"===this._drop&&(this._removeOldest(),this._add(t,n))},_addAll:function(t){var n=this;l(t,function(t){return n._add(t)})},_remove:function(t){this._removeCur(t)===-1&&this._removeQueue(t)},_addToQueue:function(t){this._queue=r(this._queue,[t])},_addToCur:function(t){if(this._active){if(!t._alive)return void(t._currentEvent&&this._emit(t._currentEvent.type,t._currentEvent.value));this._currentlyAdding=t,t.onAny(this._$handleSubAny),this._currentlyAdding=null,t._alive&&(this._curSources=r(this._curSources,[t]),this._active&&this._subToEnd(t))}else this._curSources=r(this._curSources,[t])},_subToEnd:function(t){var n=this,i=function(){return n._removeCur(t)};this._$endHandlers.push({obs:t,handler:i}),t.onEnd(i)},_subscribe:function(t){t.onAny(this._$handleSubAny),this._active&&this._subToEnd(t)},_unsubscribe:function(t){t.offAny(this._$handleSubAny);var n=s(this._$endHandlers,function(n){return n.obs===t});n!==-1&&(t.offEnd(this._$endHandlers[n].handler),this._$endHandlers.splice(n,1))},_handleSubAny:function(t){t.type===sn?this._emitValue(t.value):t.type===on&&this._emitError(t.value)},_removeQueue:function(t){var n=u(this._queue,t);return this._queue=a(this._queue,n),n},_removeCur:function(t){this._active&&this._unsubscribe(t);var n=u(this._curSources,t);return this._curSources=a(this._curSources,n),n!==-1&&(0!==this._queue.length?this._pullQueue():0===this._curSources.length&&this._onEmpty()),n},_removeOldest:function(){this._removeCur(this._curSources[0])},_pullQueue:function(){0!==this._queue.length&&(this._queue=o(this._queue),this._addToCur(this._queue.shift()))},_onActivation:function(){for(var t=0,n=this._curSources;t<n.length&&this._active;t++)this._subscribe(n[t])},_onDeactivation:function(){for(var t=0,n=this._curSources;t<n.length;t++)this._unsubscribe(n[t]);null!==this._currentlyAdding&&this._unsubscribe(this._currentlyAdding)},_isEmpty:function(){return 0===this._curSources.length},_onEmpty:function(){},_clear:function(){p.prototype._clear.call(this),this._queue=null,this._curSources=null,this._$handleSubAny=null,this._$endHandlers=null}}),e(Lt,xt,{_name:"merge",_onEmpty:function(){this._initialised&&this._emitEnd()}}),e(Mt,p,{_name:"repeat",_handleAny:function(t){t.type===un?(this._source=null,this._getSource()):this._emit(t.type,t.value)},_getSource:function(){if(!this._inLoop){this._inLoop=!0;for(var t=this._generator;null===this._source&&this._alive&&this._active;)this._source=t(this._iteration++),this._source?this._source.onAny(this._$handleAny):this._emitEnd();this._inLoop=!1}},_onActivation:function(){this._source?this._source.onAny(this._$handleAny):this._getSource()},_onDeactivation:function(){this._source&&this._source.offAny(this._$handleAny)},_clear:function(){p.prototype._clear.call(this),this._generator=null,this._source=null,this._$handleAny=null}}),e(qt,xt,{_name:"pool",plug:function(t){return this._add(t),this},unplug:function(t){return this._remove(t),this}}),e(Wt,xt,{_onActivation:function(){xt.prototype._onActivation.call(this),this._active&&this._source.onAny(this._$handleMain)},_onDeactivation:function(){xt.prototype._onDeactivation.call(this),this._source.offAny(this._$handleMain),this._hadNoEvSinceDeact=!0},_handleMain:function(t){if(t.type===sn){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===on&&this._emitError(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)},_onEmpty:function(){this._mainEnded&&this._emitEnd()},_clear:function(){xt.prototype._clear.call(this),this._source=null,this._lastCurrent=null,this._$handleMain=null}}),e(Bt,Wt,{_handleMain:function(t){if(t.type===on){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===sn&&this._emitValue(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)}});var ae={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._lastSecondary&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary!==rn&&this._lastSecondary||this._emitEnd()}},he=Ut("filterBy",ae),le=Ft("filterBy",ae),_e=function(t,n){return n},fe={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary===rn&&this._emitEnd()}},ce=Ut("skipUntilBy",fe),de=Ft("skipUntilBy",fe),ve={_handleSecondaryValue:function(){this._emitEnd()}},me=Ut("takeUntilBy",ve),pe=Ft("takeUntilBy",ve),ye={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n;this._buff=[],this._flushOnEnd=i},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_onActivation:function(){this._primary.onAny(this._$handlePrimaryAny),this._alive&&null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny)},_handlePrimaryValue:function(t){this._buff.push(t)},_handleSecondaryValue:function(){this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._emitEnd()}},Ee=Ut("bufferBy",ye),ge=Ft("bufferBy",ye),be={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n,e=t.flushOnChange,r=void 0!==e&&e;this._buff=[],this._flushOnEnd=i,this._flushOnChange=r},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_handlePrimaryValue:function(t){this._buff.push(t),this._lastSecondary===rn||this._lastSecondary||this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._lastSecondary!==rn&&!this._lastSecondary||this._emitEnd()},_handleSecondaryValue:function(t){this._flushOnChange&&!t&&this._flush(),this._lastSecondary=t}},Ae=Ut("bufferWhileBy",be),we=Ft("bufferWhileBy",be),Ve=function(){return!1},Se=function(){return!0},Te={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn,i=n(t);i.convert?this._emitError(i.error):this._emitValue(t)}},$e=H("valuesToErrors",Te),Ce=j("valuesToErrors",Te),ke=function(t){return{convert:!0,error:t}},Ie={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn,i=n(t);i.convert?this._emitValue(i.value):this._emitError(t)}},Oe=H("errorsToValues",Ie),xe=j("errorsToValues",Ie),Le=function(t){return{convert:!0,value:t}},Pe={_handleError:function(t){this._emitError(t),this._emitEnd()}},Me=H("endOnError",Pe),De=j("endOnError",Pe);m.prototype.toProperty=function(t){return U(this,t)},m.prototype.changes=function(){return F(this)},m.prototype.toPromise=function(t){return z(this,t)},m.prototype.toESObservable=R,m.prototype[Vn]=R,m.prototype.map=function(t){return X(this,t)},m.prototype.filter=function(t){return Z(this,t)},m.prototype.take=function(t){return tt(this,t)},m.prototype.takeErrors=function(t){return nt(this,t)},m.prototype.takeWhile=function(t){return it(this,t)},m.prototype.last=function(){return et(this)},m.prototype.skip=function(t){return rt(this,t)},m.prototype.skipWhile=function(t){return ut(this,t)},m.prototype.skipDuplicates=function(t){return st(this,t)},m.prototype.diff=function(t,n){return at(this,t,n)},m.prototype.scan=function(t,n){return ht(this,t,n)},m.prototype.flatten=function(t){return lt(this,t)},m.prototype.delay=function(t){return _t(this,t)},m.prototype.throttle=function(t,n){return ft(this,t,n)},m.prototype.debounce=function(t,n){return ct(this,t,n)},m.prototype.mapErrors=function(t){return dt(this,t)},m.prototype.filterErrors=function(t){return vt(this,t)},m.prototype.ignoreValues=function(){return mt(this)},m.prototype.ignoreErrors=function(){return pt(this)},m.prototype.ignoreEnd=function(){return yt(this)},m.prototype.beforeEnd=function(t){return Et(this,t)},m.prototype.slidingWindow=function(t,n){return gt(this,t,n)},m.prototype.bufferWhile=function(t,n){return bt(this,t,n)},m.prototype.bufferWithCount=function(t,n){return At(this,t,n)},m.prototype.bufferWithTimeOrCount=function(t,n,i){return wt(this,t,n,i)},m.prototype.transduce=function(t){return St(this,t)},m.prototype.withHandler=function(t){return Tt(this,t)},m.prototype.combine=function(t,n){return kt([this,t],n)},m.prototype.zip=function(t,n){return Ot([this,t],n)},m.prototype.merge=function(t){return Pt([this,t])},m.prototype.concat=function(t){return Nt([this,t])};var Ne=function(){return new qt};m.prototype.flatMap=function(t){return new Wt(this,t).setName(this,"flatMap")},m.prototype.flatMapLatest=function(t){return new Wt(this,t,{concurLim:1,drop:"old"}).setName(this,"flatMapLatest")},m.prototype.flatMapFirst=function(t){return new Wt(this,t,{concurLim:1}).setName(this,"flatMapFirst")},m.prototype.flatMapConcat=function(t){return new Wt(this,t,{queueLim:-1,concurLim:1}).setName(this,"flatMapConcat")},m.prototype.flatMapConcurLimit=function(t,n){return new Wt(this,t,{queueLim:-1,concurLim:n}).setName(this,"flatMapConcurLimit")},m.prototype.flatMapErrors=function(t){return new Bt(this,t).setName(this,"flatMapErrors")},m.prototype.filterBy=function(t){return Qt(this,t)},m.prototype.sampledBy=function(t,n){return Yt(this,t,n)},m.prototype.skipUntilBy=function(t){return zt(this,t)},m.prototype.takeUntilBy=function(t){return Kt(this,t)},m.prototype.bufferBy=function(t,n){return Gt(this,t,n)},m.prototype.bufferWhileBy=function(t,n){return Jt(this,t,n)};var qe=!0;m.prototype.awaiting=function(t){return en("You are using deprecated .awaiting() method, see https://github.com/rpominov/kefir/issues/145"),Rt(this,t)},m.prototype.valuesToErrors=function(t){return en("You are using deprecated .valuesToErrors() method, see https://github.com/rpominov/kefir/issues/149"),Xt(this,t)},m.prototype.errorsToValues=function(t){return en("You are using deprecated .errorsToValues() method, see https://github.com/rpominov/kefir/issues/149"),Zt(this,t)},m.prototype.endOnError=function(){return en("You are using deprecated .endOnError() method, see https://github.com/rpominov/kefir/issues/150"),tn(this)};var We={Observable:m,Stream:p,Property:y,never:E,later:b,interval:A,sequentially:w,fromPoll:V,withInterval:T,fromCallback:k,fromNodeCallback:I,fromEvents:P,stream:C,constant:D,constantError:q,fromPromise:Q,fromESObservable:G,combine:kt,zip:Ot,merge:Pt,concat:Nt,Pool:qt,pool:Ne,repeat:Dt};We.Kefir=We,t.dissableDeprecationWarnings=nn,t.Kefir=We,t.Observable=m,t.Stream=p,t.Property=y,t.never=E,t.later=b,t.interval=A,t.sequentially=w,t.fromPoll=V,t.withInterval=T,t.fromCallback=k,t.fromNodeCallback=I,t.fromEvents=P,t.stream=C,t.constant=D,t.constantError=q,t.fromPromise=Q,t.fromESObservable=G,t.combine=kt,t.zip=Ot,t.merge=Pt,t.concat=Nt,t.Pool=qt,t.pool=Ne,t.repeat=Dt,t["default"]=We,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=kefir.min.js.map
{
"name": "kefir",
"version": "3.2.6",
"version": "3.3.0",
"description": "Reactive Programming library for JavaScript inspired by Bacon.js and RxJS with focus on high performance and low memory usage",
"main": "dist/kefir.js",
"scripts": {
"test": "eslint . && grunt rollup:dev && jasmine-node --coffee --matchall test/specs"
"test": "eslint . && grunt rollup:dev && jasmine-node --coffee --matchall test/specs",
"test-only": "grunt rollup:dev && jasmine-node --coffee --matchall test/specs"
},

@@ -37,2 +38,3 @@ "keywords": [

"babel-preset-es2015-loose-rollup": "7.0.0",
"babelify": "7.3.0",
"coffee-script": "1.10.0",

@@ -39,0 +41,0 @@ "coffeeify": "1.1.0",

@@ -23,3 +23,12 @@ export default function emitter(obs) {

return {value, error, end, event, emit: value, emitEvent: event};
return {
value,
error,
end,
event,
// legacy
emit: value,
emitEvent: event
};
}

@@ -17,2 +17,6 @@ import $$observable from 'symbol-observable';

const fn = event => {
if (event.type === END) {
closed = true;
}
if (event.type === VALUE && observer.next) {

@@ -28,8 +32,12 @@ observer.next(event.value);

this._observable.onAny(fn);
let closed = false
const subscription = {
unsubscribe: () => {
subscription.closed = true;
closed = true;
this._observable.offAny(fn);
},
closed: false
get closed() {
return closed
}
};

@@ -36,0 +44,0 @@ return subscription;

@@ -117,2 +117,38 @@ import {extend} from './utils/objects';

observe(observerOrOnValue, onError, onEnd) {
const _this = this;
let closed = false;
const observer = !observerOrOnValue || typeof observerOrOnValue === 'function'
? {value: observerOrOnValue, error: onError, end: onEnd}
: observerOrOnValue;
const handler = function(event) {
if (event.type === END) {
closed = true;
}
if (event.type === VALUE && observer.value) {
observer.value(event.value);
} else if (event.type === ERROR && observer.error) {
observer.error(event.value);
} else if (event.type === END && observer.end) {
observer.end(event.value);
}
};
this.onAny(handler);
return {
unsubscribe() {
if (!closed) {
_this.offAny(handler);
closed = true;
}
},
get closed() {
return closed;
}
};
},
// A and B must be subclasses of Stream and Property (order doesn't matter)

@@ -119,0 +155,0 @@ _ofSameType(A, B) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc