Socket
Socket
Sign inDemoInstall

baconjs

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baconjs - npm Package Compare versions

Comparing version 0.7.40 to 0.7.41

2

dist/Bacon.min.js

@@ -1,2 +0,2 @@

(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib=[].slice,jb={}.hasOwnProperty,kb=function(a,b){function c(){this.constructor=a}for(var d in b)jb.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},lb=function(a,b){return function(){return a.apply(b,arguments)}};a={toString:function(){return"Bacon"}},a.version="0.7.40",l=("undefined"!=typeof global&&null!==global?global:this).Error,a.fromBinder=function(b,c){return null==c&&(c=gb.id),new k(B(a,"fromBinder",b,c),function(d){var e,f,g;return g=!1,e=function(){return"undefined"!=typeof f&&null!==f?(g||f(),g=!0):void 0},f=b(function(){var b,g,h,i,k,l;for(b=1<=arguments.length?ib.call(arguments,0):[],i=c.apply(this,b),J(i)&&gb.last(i)instanceof j||(i=[i]),h=a.more,k=0,l=i.length;l>k;k++)if(g=i[k],h=d(g=_(g)),h===a.noMore||g.isEnd())return null!=f?e():a.scheduler.setTimeout(e,0),h;return h}),e})},a.$={},a.$.asEventStream=function(b,c,d){var e;return L(c)&&(e=[c,void 0],d=e[0],c=e[1]),eb(this.selector||this,"asEventStream",b,a.fromBinder(function(a){return function(d){return a.on(b,c,d),function(){return a.off(b,c,d)}}}(this),d))},null!=(hb="undefined"!=typeof jQuery&&null!==jQuery?jQuery:"undefined"!=typeof Zepto&&null!==Zepto?Zepto:void 0)&&(hb.fn.asEventStream=a.$.asEventStream),a.fromEventTarget=function(b,c,d){var e,f,g,h,i,j,k,l;return e=null!=(g=null!=(h=null!=(i=b.addEventListener)?i:b.addListener)?h:b.bind)?g:b.on,f=null!=(j=null!=(k=null!=(l=b.removeEventListener)?l:b.removeListener)?k:b.unbind)?j:b.off,eb(a,"fromEventTarget",b,c,a.fromBinder(function(a){return e.call(b,c,a),function(){return f.call(b,c,a)}},d))},a.fromPromise=function(b,c){return eb(a,"fromPromise",b,a.fromBinder(function(a){return b.then(a,function(b){return a(new i(b))}),function(){return c&&"function"==typeof b.abort?b.abort():void 0}},function(a){return[a,C()]}))},a.noMore=["<no-more>"],a.more=["<more>"],a.later=function(b,c){return eb(a,"later",b,c,a.fromPoll(b,function(){return[c,C()]}))},a.sequentially=function(b,c){var d;return d=0,eb(a,"sequentially",b,c,a.fromPoll(b,function(){var a;return a=c[d++],d<c.length?a:d===c.length?[a,C()]:C()}))},a.repeatedly=function(b,c){var d;return d=0,eb(a,"repeatedly",b,c,a.fromPoll(b,function(){return c[d++%c.length]}))},a.spy=function(a){return Z.push(a)},Z=[],Y=function(a){var b,c,d;if(Z.length&&!Y.running)try{for(Y.running=!0,c=0,d=Z.length;d>c;c++)(b=Z[c])(a)}finally{delete Y.running}return void 0},fb=function(a){return function(){var b,c,d,e;return d=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],"object"==typeof d&&b.length&&(c=d,e=b[0],d=function(){return c[e].apply(c,arguments)},b=b.slice(1)),a.apply(null,[d].concat(ib.call(b)))}},O=function(b,c){return fb(function(){var d,e,f;return e=arguments[0],d=2<=arguments.length?ib.call(arguments,1):[],f=W(c,[function(a,b){return e.apply(null,ib.call(a).concat([b]))}]),eb.apply(null,[a,b,e].concat(ib.call(d),[a.combineAsArray(d).flatMap(f)]))})},a.fromCallback=O("fromCallback",function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],a.fromBinder(function(a){return P(c,b)(a),V},function(a){return[a,C()]})}),a.fromNodeCallback=O("fromNodeCallback",function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],a.fromBinder(function(a){return P(c,b)(a),V},function(a,b){return a?[new i(a),C()]:[b,C()]})}),a.fromPoll=function(b,c){return eb(a,"fromPoll",b,c,a.fromBinder(function(c){var d;return d=a.scheduler.setInterval(c,b),function(){return a.scheduler.clearInterval(d)}},c))},a.interval=function(b,c){return null==c&&(c={}),eb(a,"interval",b,c,a.fromPoll(b,function(){return U(c)}))},a.constant=function(b){return new q(B(a,"constant",b),function(a){return a(I(b)),a(C()),V})},a.never=function(){return new k(B(a,"never"),function(a){return a(C()),V})},a.once=function(b){return new k(B(a,"once",b),function(a){return a(_(b)),a(C()),V})},a.fromArray=function(b){var c;return b.length?(c=0,new k(B(a,"fromArray",b),function(d){var e,f,g;return g=!1,f=a.more,e=function(){var h;return f===a.noMore||g||(h=b[c++],f=d(_(h)),f===a.noMore)?void 0:c===b.length?d(C()):u.afterTransaction(e)},e(),function(){return g=!0}})):eb(a,"fromArray",b,a.never())},a.mergeAll=function(){var b;return b=1<=arguments.length?ib.call(arguments,0):[],J(b[0])&&(b=b[0]),b.length?new k(B.apply(null,[a,"mergeAll"].concat(ib.call(b))),function(c){var d,e,f;return d=0,f=function(e){return function(f){return e.dispatcher.subscribe(function(e){var g;return e.isEnd()?(d++,d===b.length?c(C()):a.more):(g=c(e),g===a.noMore&&f(),g)})}},e=gb.map(f,b),x.apply(null,e)}):a.never()},a.zipAsArray=function(){var b;return b=1<=arguments.length?ib.call(arguments,0):[],J(b[0])&&(b=b[0]),eb.apply(null,[a,"zipAsArray"].concat(ib.call(b),[a.zipWith(b,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]})]))},a.zipWith=function(){var b,c,d;return b=arguments[0],c=2<=arguments.length?ib.call(arguments,1):[],L(b)||(d=[b,c[0]],c=d[0],b=d[1]),c=gb.map(function(a){return a.toEventStream()},c),eb.apply(null,[a,"zipWith",b].concat(ib.call(c),[a.when(c,b)]))},a.groupSimultaneous=function(){var c,d,e;return e=1<=arguments.length?ib.call(arguments,0):[],1===e.length&&J(e[0])&&(e=e[0]),d=function(){var a,d,f;for(f=[],a=0,d=e.length;d>a;a++)c=e[a],f.push(new b(c));return f}(),eb.apply(null,[a,"groupSimultaneous"].concat(ib.call(e),[a.when(d,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]})]))},a.combineAsArray=function(){var b,c,d,e,f,g,h;for(f=1<=arguments.length?ib.call(arguments,0):[],1===f.length&&J(f[0])&&(f=f[0]),b=g=0,h=f.length;h>g;b=++g)e=f[b],M(e)||(f[b]=a.constant(e));return f.length?(d=function(){var a,b,d;for(d=[],a=0,b=f.length;b>a;a++)c=f[a],d.push(new t(c,!0));return d}(),eb.apply(null,[a,"combineAsArray"].concat(ib.call(f),[a.when(d,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]}).toProperty()]))):a.constant([])},a.onValues=function(){var b,c,d;return c=2<=arguments.length?ib.call(arguments,0,d=arguments.length-1):(d=0,[]),b=arguments[d++],a.combineAsArray(c).onValues(b)},a.combineWith=function(){var b,c;return b=arguments[0],c=2<=arguments.length?ib.call(arguments,1):[],eb.apply(null,[a,"combineWith",b].concat(ib.call(c),[a.combineAsArray(c).map(function(a){return b.apply(null,a)})]))},a.combineTemplate=function(b){var c,d,e,f,g,h,i,j,k,l;return i=[],l=[],h=function(a){return a[a.length-1]},k=function(a,b,c){return h(a)[b]=c},c=function(a,b){return function(c,d){return k(c,a,d[b])}},g=function(a,b){return function(c){return k(c,a,b)}},j=function(a){return J(a)?[]:{}},e=function(a,b){var d,e;return M(b)?(l.push(b),i.push(c(a,l.length-1))):b!==Object(b)||"function"==typeof b||b instanceof RegExp||b instanceof Date?i.push(g(a,b)):(e=function(a){return function(c){var d;return d=j(b),k(c,a,d),c.push(d)}},d=function(a){return a.pop()},i.push(e(a)),f(b),i.push(d))},f=function(a){return gb.each(a,e)},f(b),d=function(a){var c,d,e,f,g;for(e=j(b),c=[e],f=0,g=i.length;g>f;f++)(d=i[f])(c,a);return e},eb(a,"combineTemplate",b,a.combineAsArray(l).map(d))},a.retry=function(b){var c,d,e,f,g,h;if(!L(b.source))throw new l("'source' option has to be a function");return h=b.source,f=b.retries||0,e=b.maxRetries||f,c=b.delay||function(){return 0},d=b.isRetryable||function(){return!0},g=function(b){var g,i;return i={source:h,retries:f-1,maxRetries:e,delay:c,isRetryable:d},g=function(){return a.retry(i)},a.later(c(b)).filter(!1).concat(a.once().flatMap(g))},eb(a,"retry",b,h().flatMapError(function(b){return d(b)&&f>0?g({error:b,retriesDone:e-f}):a.once(new i(b))}))},D=0,j=function(){function a(){this.id=++D}return a.prototype.isEvent=function(){return!0},a.prototype.isEnd=function(){return!1},a.prototype.isInitial=function(){return!1},a.prototype.isNext=function(){return!1},a.prototype.isError=function(){return!1},a.prototype.hasValue=function(){return!1},a.prototype.filter=function(){return!0},a.prototype.inspect=function(){return this.toString()},a.prototype.log=function(){return this.toString()},a}(),n=function(a){function b(a,c){b.__super__.constructor.call(this),!c&&L(a)||a instanceof b?(this.valueF=a,this.valueInternal=void 0):(this.valueF=void 0,this.valueInternal=a)}return kb(b,a),b.prototype.isNext=function(){return!0},b.prototype.hasValue=function(){return!0},b.prototype.value=function(){return this.valueF instanceof b?(this.valueInternal=this.valueF.value(),this.valueF=void 0):this.valueF&&(this.valueInternal=this.valueF(),this.valueF=void 0),this.valueInternal},b.prototype.fmap=function(a){var b,c;return this.valueInternal?(c=this.valueInternal,this.apply(function(){return a(c)})):(b=this,this.apply(function(){return a(b.value())}))},b.prototype.apply=function(a){return new b(a)},b.prototype.filter=function(a){return a(this.value())},b.prototype.toString=function(){return gb.toString(this.value())},b.prototype.log=function(){return this.value()},b}(j),m=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.isInitial=function(){return!0},b.prototype.isNext=function(){return!1},b.prototype.apply=function(a){return new b(a)},b.prototype.toNext=function(){return new n(this)},b}(n),h=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.isEnd=function(){return!0},b.prototype.fmap=function(){return this},b.prototype.apply=function(){return this},b.prototype.toString=function(){return"<end>"},b}(j),i=function(a){function b(a){this.error=a}return kb(b,a),b.prototype.isError=function(){return!0},b.prototype.fmap=function(){return this},b.prototype.apply=function(){return this},b.prototype.toString=function(){return"<error> "+gb.toString(this.error)},b}(j),H=0,p=function(){function b(a){this.id=++H,eb(a,this),this.initialDesc=this.desc}return b.prototype.subscribe=function(a){return u.wrappedSubscribe(this,a)},b.prototype.subscribeInternal=function(a){return this.dispatcher.subscribe(a)},b.prototype.onValue=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.hasValue()?a(b.value()):void 0})},b.prototype.onValues=function(a){return this.onValue(function(b){return a.apply(null,b)})},b.prototype.onError=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.isError()?a(b.error):void 0})},b.prototype.onEnd=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.isEnd()?a():void 0})},b.prototype.errors=function(){return eb(this,"errors",this.filter(function(){return!1}))},b.prototype.filter=function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],A(this,c,b,function(b){return eb(this,"filter",b,this.withHandler(function(c){return c.filter(b)?this.push(c):a.more}))})},b.prototype.takeWhile=function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],A(this,c,b,function(b){return eb(this,"takeWhile",b,this.withHandler(function(c){return c.filter(b)?this.push(c):(this.push(C()),a.noMore)}))})},b.prototype.endOnError=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],null==b&&(b=!0),A(this,b,a,function(a){return eb(this,"endOnError",this.withHandler(function(b){return b.isError()&&a(b.error)?(this.push(b),this.push(C())):this.push(b)}))})},b.prototype.take=function(b){return 0>=b?a.never():eb(this,"take",b,this.withHandler(function(c){return c.hasValue()?(b--,b>0?this.push(c):(0===b&&this.push(c),this.push(C()),a.noMore)):this.push(c)}))},b.prototype.map=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],b instanceof q?b.sampledBy(this,G):A(this,b,a,function(a){return eb(this,"map",a,this.withHandler(function(b){return this.push(b.fmap(a))}))})},b.prototype.mapError=function(){var a;return a=Q(arguments),eb(this,"mapError",a,this.withHandler(function(b){return this.push(b.isError()?U(a(b.error)):b)}))},b.prototype.mapEnd=function(){var b;return b=Q(arguments),eb(this,"mapEnd",b,this.withHandler(function(c){return c.isEnd()?(this.push(U(b(c))),this.push(C()),a.noMore):this.push(c)}))},b.prototype.doAction=function(){var a;return a=Q(arguments),eb(this,"doAction",a,this.withHandler(function(b){return b.hasValue()&&a(b.value()),this.push(b)}))},b.prototype.skip=function(b){return eb(this,"skip",b,this.withHandler(function(c){return c.hasValue()&&b>0?(b--,a.more):this.push(c)}))},b.prototype.skipDuplicates=function(a){return null==a&&(a=function(a,b){return a===b}),eb(this,"skipDuplicates",this.withStateMachine(o,function(b,c){return c.hasValue()?c.isInitial()||b===o||!a(b.get(),c.value())?[new s(c.value()),[c]]:[b,[]]:[b,[c]]}))},b.prototype.skipErrors=function(){return eb(this,"skipErrors",this.withHandler(function(b){return b.isError()?a.more:this.push(b)}))},b.prototype.withStateMachine=function(b,c){var d;return d=b,eb(this,"withStateMachine",b,c,this.withHandler(function(b){var e,f,g,h,i,j,k;for(e=c(d,b),f=e[0],h=e[1],d=f,i=a.more,j=0,k=h.length;k>j;j++)if(g=h[j],i=this.push(g),i===a.noMore)return i;return i}))},b.prototype.scan=function(b,c){var d,e,f;return c=$(c),d=cb(b),f=function(b){return function(f){var g,h,i,j;return g=!1,j=V,h=a.more,i=function(){return g?void 0:d.forEach(function(b){return g=!0,h=f(new m(function(){return b})),h===a.noMore?(j(),j=V):void 0})},j=b.dispatcher.subscribe(function(b){var e,j;return b.hasValue()?g&&b.isInitial()?a.more:(b.isInitial()||i(),g=!0,j=d.getOrElse(void 0),e=c(j,b.value()),d=new s(e),f(b.apply(function(){return e}))):(b.isEnd()&&(h=i()),h!==a.noMore?f(b):void 0)}),u.whenDoneWith(e,i),j}}(this),e=new q(B(this,"scan",b,c),f)},b.prototype.fold=function(a,b){return eb(this,"fold",a,b,this.scan(a,b).sampledBy(this.filter(!1).mapEnd().toProperty()))},b.prototype.zip=function(b,c){return null==c&&(c=Array),eb(this,"zip",b,a.zipWith([this,b],c))},b.prototype.diff=function(a,b){return b=$(b),eb(this,"diff",a,b,this.scan([a],function(a,c){return[c,b(a[0],c)]}).filter(function(a){return 2===a.length}).map(function(a){return a[1]}))},b.prototype.flatMap=function(){return F(this,T(arguments))},b.prototype.flatMapFirst=function(){return F(this,T(arguments),!0)},b.prototype.flatMapWithConcurrencyLimit=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],eb.apply(null,[this,"flatMapWithConcurrencyLimit",b].concat(ib.call(a),[F(this,T(a),!1,b)]))},b.prototype.flatMapLatest=function(){var a,b;return a=T(arguments),b=this.toEventStream(),eb(this,"flatMapLatest",a,b.flatMap(function(c){return S(a(c)).takeUntil(b)}))},b.prototype.flatMapError=function(b){return eb(this,"flatMapError",b,this.mapError(function(a){return new i(a)}).flatMap(function(c){return c instanceof i?b(c.error):a.once(c)}))},b.prototype.flatMapConcat=function(){return eb.apply(null,[this,"flatMapConcat"].concat(ib.call(arguments),[this.flatMapWithConcurrencyLimit.apply(this,[1].concat(ib.call(arguments)))]))},b.prototype.bufferingThrottle=function(b){return eb(this,"bufferingThrottle",b,this.flatMapConcat(function(c){return a.once(c).concat(a.later(b).filter(!1))}))},b.prototype.not=function(){return eb(this,"not",this.map(function(a){return!a}))},b.prototype.log=function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[],this.subscribe(function(b){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log.apply(console,ib.call(a).concat([b.log()])):void 0}),this},b.prototype.slidingWindow=function(a,b){return null==b&&(b=0),eb(this,"slidingWindow",a,b,this.scan([],function(b,c){return b.concat([c]).slice(-a)}).filter(function(a){return a.length>=b}))},b.prototype.combine=function(b,c){var d;return d=$(c),eb(this,"combine",b,c,a.combineAsArray(this,b).map(function(a){return d(a[0],a[1])}))},b.prototype.decode=function(b){return eb(this,"decode",b,this.combine(a.combineTemplate(b),function(a,b){return b[a]}))},b.prototype.awaiting=function(b){return eb(this,"awaiting",b,a.groupSimultaneous(this,b).map(function(a){var b,c;return b=a[0],c=a[1],0===c.length}).toProperty(!1).skipDuplicates())},b.prototype.name=function(a){return this._name=a,this},b.prototype.withDescription=function(){return B.apply(null,arguments).apply(this)},b.prototype.toString=function(){return this._name?this._name:this.desc.toString()},b.prototype.internalDeps=function(){return this.initialDesc.deps()},b}(),p.prototype.reduce=p.prototype.fold,p.prototype.assign=p.prototype.onValue,p.prototype.inspect=p.prototype.toString,F=function(b,c,e,f){var g,h,i;return i=[b],g=[],h=new k(B(b,"flatMap"+(e?"First":""),c),function(h){var i,j,k,l,n;return k=new d,l=[],n=function(b){var d;return d=S(c(b.value())),g.push(d),k.add(function(b,c){return d.dispatcher.subscribe(function(e){var f;return e.isEnd()?(gb.remove(d,g),j(),i(c),a.noMore):(e instanceof m&&(e=e.toNext()),f=h(e),f===a.noMore&&b(),f)})})},j=function(){var a;return a=l.shift(),a?n(a):void 0},i=function(a){return a(),k.empty()?h(C()):void 0},k.add(function(c,d){return b.dispatcher.subscribe(function(b){return b.isEnd()?i(d):b.isError()?h(b):e&&k.count()>1?a.more:k.unsubscribed?a.noMore:f&&k.count()>f?l.push(b):n(b)})}),k.unsubscribe}),h.internalDeps=function(){return g.length?i.concat(g):i},h},k=function(b){function c(a,b,d){L(a)&&(d=b,b=a,a=[]),c.__super__.constructor.call(this,a),this.dispatcher=new g(b,d),Y(this)}return kb(c,b),c.prototype.delay=function(b){return eb(this,"delay",b,this.flatMap(function(c){return a.later(b,c)}))},c.prototype.debounce=function(b){return eb(this,"debounce",b,this.flatMapLatest(function(c){return a.later(b,c)}))},c.prototype.debounceImmediate=function(b){return eb(this,"debounceImmediate",b,this.flatMapFirst(function(c){return a.once(c).concat(a.later(b).filter(!1))}))},c.prototype.throttle=function(a){return eb(this,"throttle",a,this.bufferWithTime(a).map(function(a){return a[a.length-1]}))},c.prototype.bufferWithTime=function(a){return eb(this,"bufferWithTime",a,this.bufferWithTimeOrCount(a,Number.MAX_VALUE))},c.prototype.bufferWithCount=function(a){return eb(this,"bufferWithCount",a,this.bufferWithTimeOrCount(void 0,a))},c.prototype.bufferWithTimeOrCount=function(a,b){var c;return c=function(c){return c.values.length===b?c.flush():void 0!==a?c.schedule():void 0},eb(this,"bufferWithTimeOrCount",a,b,this.buffer(a,c,c))},c.prototype.buffer=function(b,c,d){var e,f,g;return null==c&&(c=V),null==d&&(d=V),e={scheduled:!1,end:void 0,values:[],flush:function(){var b;if(this.scheduled=!1,this.values.length>0){if(b=this.push(U(this.values)),this.values=[],null!=this.end)return this.push(this.end);if(b!==a.noMore)return d(this)}else if(null!=this.end)return this.push(this.end)},schedule:function(){return this.scheduled?void 0:(this.scheduled=!0,b(function(a){return function(){return a.flush()}}(this)))}},g=a.more,L(b)||(f=b,b=function(b){return a.scheduler.setTimeout(b,f)}),eb(this,"buffer",this.withHandler(function(a){return e.push=function(a){return function(b){return a.push(b)}}(this),a.isError()?g=this.push(a):a.isEnd()?(e.end=a,e.scheduled||e.flush()):(e.values.push(a.value()),c(e)),g}))},c.prototype.merge=function(b){var c;return c=this,eb(c,"merge",b,a.mergeAll(this,b))},c.prototype.toProperty=function(b){var c,d;return d=0===arguments.length?o:cb(function(){return b}),c=this.dispatcher,new q(B(this,"toProperty",b),function(b){var e,f,g,h;return e=!1,h=V,f=a.more,g=function(){return e?void 0:d.forEach(function(c){return e=!0,f=b(new m(c)),f===a.noMore?(h(),h=V):void 0})},h=c.subscribe(function(c){return c.hasValue()?e&&c.isInitial()?a.more:(c.isInitial()||g(),e=!0,d=new s(c),b(c)):(c.isEnd()&&(f=g()),f!==a.noMore?b(c):void 0)}),g(),h})},c.prototype.toEventStream=function(){return this},c.prototype.sampledBy=function(a,b){return eb(this,"sampledBy",a,b,this.toProperty().sampledBy(a,b))},c.prototype.concat=function(a){var b;return b=this,new c(B(b,"concat",a),function(c){var d,e;return e=V,d=b.dispatcher.subscribe(function(b){return b.isEnd()?e=a.dispatcher.subscribe(c):c(b)}),function(){return d(),e()}})},c.prototype.takeUntil=function(b){var c;return c={},eb(this,"takeUntil",b,a.groupSimultaneous(this.mapEnd(c),b.skipErrors()).withHandler(function(d){var e,f,g,h,i,j;if(d.hasValue()){if(j=d.value(),e=j[0],b=j[1],b.length)return this.push(C());for(f=a.more,h=0,i=e.length;i>h;h++)g=e[h],f=this.push(g===c?C():U(g));return f}return this.push(d)}))},c.prototype.skipUntil=function(a){var b;return b=a.take(1).map(!0).toProperty(!1),eb(this,"skipUntil",a,this.filter(b))},c.prototype.skipWhile=function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],d=!1,A(this,c,b,function(b){return eb(this,"skipWhile",b,this.withHandler(function(c){return!d&&c.hasValue()&&b(c.value())?a.more:(c.hasValue()&&(d=!0),this.push(c))}))})},c.prototype.holdWhen=function(b){var c,d,e;return e=b.startWith(!1),d=e.filter(function(a){return!a}),c=e.filter(gb.id),eb(this,"holdWhen",b,this.filter(!1).merge(e.flatMapConcat(function(b){return function(e){return e?b.scan([],function(a,b){return a.concat(b)}).sampledBy(d).take(1).flatMap(a.fromArray):b.takeUntil(c)}}(this))))},c.prototype.startWith=function(b){return eb(this,"startWith",b,a.once(b).concat(this))},c.prototype.withHandler=function(a){return new c(B(this,"withHandler",a),this.dispatcher.subscribe,a)},c}(p),q=function(b){function c(a,b,d){L(a)&&(d=b,b=a,a=[]),c.__super__.constructor.call(this,a),this.dispatcher=new r(this,b,d),Y(this)}return kb(c,b),c.prototype.sampledBy=function(b,d){var e,f,g,h,i;return null!=d?d=$(d):(e=!0,d=function(a){return a.value()}),i=new t(this,!1,e),g=new t(b,!0,e),h=a.when([i,g],d),f=b instanceof c?h.toProperty():h,eb(this,"sampledBy",b,d,f)},c.prototype.sample=function(b){return eb(this,"sample",b,this.sampledBy(a.interval(b,{})))},c.prototype.changes=function(){return new k(B(this,"changes"),function(a){return function(b){return a.dispatcher.subscribe(function(a){return a.isInitial()?void 0:b(a)})}}(this))},c.prototype.withHandler=function(a){return new c(B(this,"withHandler",a),this.dispatcher.subscribe,a)},c.prototype.toProperty=function(){return this},c.prototype.toEventStream=function(){return new k(B(this,"toEventStream"),function(a){return function(b){return a.dispatcher.subscribe(function(a){return a.isInitial()&&(a=a.toNext()),b(a)})}}(this))},c.prototype.and=function(a){return eb(this,"and",a,this.combine(a,function(a,b){return a&&b}))},c.prototype.or=function(a){return eb(this,"or",a,this.combine(a,function(a,b){return a||b}))},c.prototype.delay=function(a){return this.delayChanges("delay",a,function(b){return b.delay(a)})},c.prototype.debounce=function(a){return this.delayChanges("debounce",a,function(b){return b.debounce(a)})},c.prototype.throttle=function(a){return this.delayChanges("throttle",a,function(b){return b.throttle(a)})},c.prototype.delayChanges=function(){var a,b,c;return a=2<=arguments.length?ib.call(arguments,0,c=arguments.length-1):(c=0,[]),b=arguments[c++],eb.apply(null,[this].concat(ib.call(a),[v(this,b(this.changes()))]))},c.prototype.takeUntil=function(a){var b;return b=this.changes().takeUntil(a),eb(this,"takeUntil",a,v(this,b))},c.prototype.startWith=function(a){return eb(this,"startWith",a,this.scan(a,function(a,b){return b}))},c.prototype.bufferingThrottle=function(){var a;return(a=c.__super__.bufferingThrottle.apply(this,arguments)).bufferingThrottle.apply(a,arguments).toProperty()},c}(p),A=function(a,b,c,d){var e;return b instanceof q?(e=b.sampledBy(a,function(a,b){return[a,b]}),d.call(e,function(a){var b,c;return b=a[0],c=a[1],b}).map(function(a){var b,c;return b=a[0],c=a[1]})):(b=P(b,c),d.call(a,b))},v=function(b,c){var d;return d=new k(B(b,"justInitValue"),function(c){var e,f;return f=void 0,e=b.dispatcher.subscribe(function(b){return b.isEnd()||(f=b),a.noMore}),u.whenDoneWith(d,function(){return null!=f&&c(f),c(C())}),e}),d.concat(c).toProperty()},g=function(){function b(a,b){this._subscribe=a,this._handleEvent=b,this.subscribe=lb(this.subscribe,this),this.handleEvent=lb(this.handleEvent,this),this.subscriptions=[],this.queue=[],this.pushing=!1,this.ended=!1,this.prevError=void 0,this.unsubSrc=void 0}return b.prototype.hasSubscribers=function(){return this.subscriptions.length>0},b.prototype.removeSub=function(a){return this.subscriptions=gb.without(a,this.subscriptions)},b.prototype.push=function(a){return a.isEnd()&&(this.ended=!0),u.inTransaction(a,this,this.pushIt,[a])},b.prototype.pushToSubscriptions=function(b){var c,d,e,f,g,h;try{for(f=this.subscriptions,g=0,h=f.length;h>g;g++)e=f[g],d=e.sink(b),(d===a.noMore||b.isEnd())&&this.removeSub(e);return!0}catch(i){throw c=i,this.pushing=!1,this.queue=[],c}},b.prototype.pushIt=function(b){if(this.pushing)return this.queue.push(b),a.more;if(b!==this.prevError){for(b.isError()&&(this.prevError=b),this.pushing=!0,this.pushToSubscriptions(b),this.pushing=!1;this.queue.length;)b=this.queue.shift(),this.push(b);return this.hasSubscribers()?a.more:(this.unsubscribeFromSource(),a.noMore)}},b.prototype.handleEvent=function(a){return this._handleEvent?this._handleEvent(a):this.push(a)},b.prototype.unsubscribeFromSource=function(){return this.unsubSrc&&this.unsubSrc(),this.unsubSrc=void 0},b.prototype.subscribe=function(a){var b;return this.ended?(a(C()),V):(b={sink:a},this.subscriptions.push(b),1===this.subscriptions.length&&(this.unsubSrc=this._subscribe(this.handleEvent)),function(a){return function(){return a.removeSub(b),a.hasSubscribers()?void 0:a.unsubscribeFromSource()}}(this))},b}(),r=function(b){function c(a,b,d){this.property=a,this.subscribe=lb(this.subscribe,this),c.__super__.constructor.call(this,b,d),this.current=o,this.currentValueRootId=void 0,this.propertyEnded=!1}return kb(c,b),c.prototype.push=function(a){return a.isEnd()&&(this.propertyEnded=!0),a.hasValue()&&(this.current=new s(a),this.currentValueRootId=u.currentEventId()),c.__super__.push.call(this,a)},c.prototype.maybeSubSource=function(b,c){return c===a.noMore?V:this.propertyEnded?(b(C()),V):g.prototype.subscribe.call(this,b)},c.prototype.subscribe=function(b){var c,d,e,f;return d=!1,e=a.more,this.current.isDefined&&(this.hasSubscribers()||this.propertyEnded)?(c=u.currentEventId(),f=this.currentValueRootId,!this.propertyEnded&&f&&c&&c!==f?(u.whenDoneWith(this.property,function(a){return function(){return a.currentValueRootId===f?b(I(a.current.get().value())):void 0}}(this)),this.maybeSubSource(b,e)):(u.inTransaction(void 0,this,function(){return e=b(I(this.current.get().value()))},[]),this.maybeSubSource(b,e))):this.maybeSubSource(b,e)},c}(g),c=function(b){function c(){this.guardedSink=lb(this.guardedSink,this),this.subscribeAll=lb(this.subscribeAll,this),this.unsubAll=lb(this.unsubAll,this),this.sink=void 0,this.subscriptions=[],this.ended=!1,c.__super__.constructor.call(this,B(a,"Bus"),this.subscribeAll)}return kb(c,b),c.prototype.unsubAll=function(){var a,b,c,d;for(d=this.subscriptions,b=0,c=d.length;c>b;b++)a=d[b],"function"==typeof a.unsub&&a.unsub();return void 0},c.prototype.subscribeAll=function(a){var b,c,d,e;for(this.sink=a,e=w(this.subscriptions),c=0,d=e.length;d>c;c++)b=e[c],this.subscribeInput(b);return this.unsubAll},c.prototype.guardedSink=function(b){return function(c){return function(d){return d.isEnd()?(c.unsubscribeInput(b),a.noMore):c.sink(d)}}(this)},c.prototype.subscribeInput=function(a){return a.unsub=a.input.dispatcher.subscribe(this.guardedSink(a.input))},c.prototype.unsubscribeInput=function(a){var b,c,d,e,f;for(f=this.subscriptions,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c.input===a)return"function"==typeof c.unsub&&c.unsub(),void this.subscriptions.splice(b,1)},c.prototype.plug=function(a){var b;if(!this.ended)return b={input:a},this.subscriptions.push(b),null!=this.sink&&this.subscribeInput(b),function(b){return function(){return b.unsubscribeInput(a)}}(this)},c.prototype.end=function(){return this.ended=!0,this.unsubAll(),"function"==typeof this.sink?this.sink(C()):void 0},c.prototype.push=function(a){return"function"==typeof this.sink?this.sink(U(a)):void 0},c.prototype.error=function(a){return"function"==typeof this.sink?this.sink(new i(a)):void 0},c}(k),t=function(){function a(a,b,c){this.obs=a,this.sync=b,this.lazy=null!=c?c:!1,this.queue=[]}return a.prototype.subscribe=function(a){return this.obs.dispatcher.subscribe(a)},a.prototype.toString=function(){return this.obs.toString()},a.prototype.markEnded=function(){return this.ended=!0},a.prototype.consume=function(){return this.lazy?{value:gb.always(this.queue[0])}:this.queue[0]},a.prototype.push=function(a){return this.queue=[a]},a.prototype.mayHave=function(){return!0},a.prototype.hasAtLeast=function(){return this.queue.length},a.prototype.flatten=!0,a}(),e=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.consume=function(){return this.queue.shift()},b.prototype.push=function(a){return this.queue.push(a)},b.prototype.mayHave=function(a){return!this.ended||this.queue.length>=a},b.prototype.hasAtLeast=function(a){return this.queue.length>=a},b.prototype.flatten=!1,b}(t),b=function(a){function b(a){b.__super__.constructor.call(this,a,!0)}return kb(b,a),b.prototype.consume=function(){var a;return a=this.queue,this.queue=[],{value:function(){return a}}},b.prototype.push=function(a){return this.queue.push(a.value())},b.prototype.hasAtLeast=function(){return!0},b}(t),t.isTrigger=function(a){return a instanceof t?a.sync:a instanceof k},t.fromObservable=function(a){return a instanceof t?a:a instanceof q?new t(a,!1):new e(a,!0)},B=function(){var a,b,c;return b=arguments[0],c=arguments[1],a=3<=arguments.length?ib.call(arguments,2):[],(b||c)instanceof f?b||c:new f(b,c,a)},E=function(a){return J(a)?gb.flatMap(E,a):M(a)?[a]:a instanceof t?[a.obs]:[]},f=function(){function a(a,b,c){this.context=a,this.method=b,this.args=c,this.cached=void 0}return a.prototype.deps=function(){return this.cached||(this.cached=E([this.context].concat(this.args)))},a.prototype.apply=function(a){return a.desc=this,a},a.prototype.toString=function(){return gb.toString(this.context)+"."+gb.toString(this.method)+"("+gb.map(gb.toString,this.args)+")"},a}(),eb=function(){var a,b,c;return a=2<=arguments.length?ib.call(arguments,0,c=arguments.length-1):(c=0,[]),b=arguments[c++],B.apply(null,a).apply(b)},a.when=function(){var b,c,d,e,f,g,h,i,j,l,m,n,o,p,q,r,s,v,w,A;if(0===arguments.length)return a.never();for(f=arguments.length,q="when: expecting arguments in the form (Observable+,function)+",o=[],j=[],c=0,l=[];f>c;){for(l[c]=arguments[c],l[c+1]=arguments[c+1],i=gb.toArray(arguments[c]),b=y(arguments[c+1]),h={f:b,ixs:[]},p=!1,r=0,v=i.length;v>r;r++){for(n=i[r],d=gb.indexOf(o,n),p||(p=t.isTrigger(n)),0>d&&(o.push(n),d=o.length-1),A=h.ixs,s=0,w=A.length;w>s;s++)e=A[s],e.index===d&&e.count++;h.ixs.push({index:d,count:1})}i.length>0&&j.push(h),c+=2}return o.length?(o=gb.map(t.fromObservable,o),g=gb.any(o,function(a){return a.flatten})&&z(gb.map(function(a){return a.obs},o)),m=new k(B.apply(null,[a,"when"].concat(ib.call(l))),function(b){var d,e,f,h,i,k,l;return l=[],f=!1,h=function(a){var b,d,e;for(e=a.ixs,b=0,d=e.length;d>b;b++)if(c=e[b],!o[c.index].hasAtLeast(c.count))return!1;return!0},e=function(a){return!a.sync||a.ended},d=function(a){var b,d,e;for(e=a.ixs,b=0,d=e.length;d>b;b++)if(c=e[b],!o[c.index].mayHave(c.count))return!0},i=function(a){return!a.source.flatten},k=function(k){return function(n){var p,q,r;return q=function(){return u.whenDoneWith(m,p)},r=function(){var d,e,f,g,k,m;if(!(l.length>0))return a.more;for(f=a.more,g=l.pop(),k=0,m=j.length;m>k;k++)if(e=j[k],h(e))return d=function(){var a,b,d,f;for(d=e.ixs,f=[],a=0,b=d.length;b>a;a++)c=d[a],f.push(o[c.index].consume());return f}(),f=b(g.e.apply(function(){var a,b;return b=function(){var b,c,e;for(e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.value());return e}(),e.f.apply(e,b)})),l.length&&(l=gb.filter(i,l)),f===a.noMore?f:r()},p=function(){var c;return c=r(),f&&(f=!1,(gb.all(o,e)||gb.all(j,d))&&(c=a.noMore,b(C()))),c===a.noMore&&n(),c
(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib=[].slice,jb={}.hasOwnProperty,kb=function(a,b){function c(){this.constructor=a}for(var d in b)jb.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},lb=function(a,b){return function(){return a.apply(b,arguments)}};a={toString:function(){return"Bacon"}},a.version="0.7.41",l=("undefined"!=typeof global&&null!==global?global:this).Error,a.fromBinder=function(b,c){return null==c&&(c=gb.id),new k(B(a,"fromBinder",b,c),function(d){var e,f,g;return g=!1,e=function(){return"undefined"!=typeof f&&null!==f?(g||f(),g=!0):void 0},f=b(function(){var b,g,h,i,k,l;for(b=1<=arguments.length?ib.call(arguments,0):[],i=c.apply(this,b),J(i)&&gb.last(i)instanceof j||(i=[i]),h=a.more,k=0,l=i.length;l>k;k++)if(g=i[k],h=d(g=_(g)),h===a.noMore||g.isEnd())return null!=f?e():a.scheduler.setTimeout(e,0),h;return h}),e})},a.$={},a.$.asEventStream=function(b,c,d){var e;return L(c)&&(e=[c,void 0],d=e[0],c=e[1]),eb(this.selector||this,"asEventStream",b,a.fromBinder(function(a){return function(d){return a.on(b,c,d),function(){return a.off(b,c,d)}}}(this),d))},null!=(hb="undefined"!=typeof jQuery&&null!==jQuery?jQuery:"undefined"!=typeof Zepto&&null!==Zepto?Zepto:void 0)&&(hb.fn.asEventStream=a.$.asEventStream),a.fromEventTarget=function(b,c,d){var e,f,g,h,i,j,k,l;return e=null!=(g=null!=(h=null!=(i=b.addEventListener)?i:b.addListener)?h:b.bind)?g:b.on,f=null!=(j=null!=(k=null!=(l=b.removeEventListener)?l:b.removeListener)?k:b.unbind)?j:b.off,eb(a,"fromEventTarget",b,c,a.fromBinder(function(a){return e.call(b,c,a),function(){return f.call(b,c,a)}},d))},a.fromPromise=function(b,c){return eb(a,"fromPromise",b,a.fromBinder(function(a){return b.then(a,function(b){return a(new i(b))}),function(){return c&&"function"==typeof b.abort?b.abort():void 0}},function(a){return[a,C()]}))},a.noMore=["<no-more>"],a.more=["<more>"],a.later=function(b,c){return eb(a,"later",b,c,a.fromPoll(b,function(){return[c,C()]}))},a.sequentially=function(b,c){var d;return d=0,eb(a,"sequentially",b,c,a.fromPoll(b,function(){var a;return a=c[d++],d<c.length?a:d===c.length?[a,C()]:C()}))},a.repeatedly=function(b,c){var d;return d=0,eb(a,"repeatedly",b,c,a.fromPoll(b,function(){return c[d++%c.length]}))},a.spy=function(a){return Z.push(a)},Z=[],Y=function(a){var b,c,d;if(Z.length&&!Y.running)try{for(Y.running=!0,c=0,d=Z.length;d>c;c++)(b=Z[c])(a)}finally{delete Y.running}return void 0},fb=function(a){return function(){var b,c,d,e;return d=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],"object"==typeof d&&b.length&&(c=d,e=b[0],d=function(){return c[e].apply(c,arguments)},b=b.slice(1)),a.apply(null,[d].concat(ib.call(b)))}},O=function(b,c){return fb(function(){var d,e,f;return e=arguments[0],d=2<=arguments.length?ib.call(arguments,1):[],f=W(c,[function(a,b){return e.apply(null,ib.call(a).concat([b]))}]),eb.apply(null,[a,b,e].concat(ib.call(d),[a.combineAsArray(d).flatMap(f)]))})},a.fromCallback=O("fromCallback",function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],a.fromBinder(function(a){return P(c,b)(a),V},function(a){return[a,C()]})}),a.fromNodeCallback=O("fromNodeCallback",function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],a.fromBinder(function(a){return P(c,b)(a),V},function(a,b){return a?[new i(a),C()]:[b,C()]})}),a.fromPoll=function(b,c){return eb(a,"fromPoll",b,c,a.fromBinder(function(c){var d;return d=a.scheduler.setInterval(c,b),function(){return a.scheduler.clearInterval(d)}},c))},a.interval=function(b,c){return null==c&&(c={}),eb(a,"interval",b,c,a.fromPoll(b,function(){return U(c)}))},a.constant=function(b){return new q(B(a,"constant",b),function(a){return a(I(b)),a(C()),V})},a.never=function(){return new k(B(a,"never"),function(a){return a(C()),V})},a.once=function(b){return new k(B(a,"once",b),function(a){return a(_(b)),a(C()),V})},a.fromArray=function(b){var c;return b.length?(c=0,new k(B(a,"fromArray",b),function(d){var e,f,g;return g=!1,f=a.more,e=function(){var h;return f===a.noMore||g||(h=b[c++],f=d(_(h)),f===a.noMore)?void 0:c===b.length?d(C()):u.afterTransaction(e)},e(),function(){return g=!0}})):eb(a,"fromArray",b,a.never())},a.mergeAll=function(){var b;return b=1<=arguments.length?ib.call(arguments,0):[],J(b[0])&&(b=b[0]),b.length?new k(B.apply(null,[a,"mergeAll"].concat(ib.call(b))),function(c){var d,e,f;return d=0,f=function(e){return function(f){return e.dispatcher.subscribe(function(e){var g;return e.isEnd()?(d++,d===b.length?c(C()):a.more):(g=c(e),g===a.noMore&&f(),g)})}},e=gb.map(f,b),x.apply(null,e)}):a.never()},a.zipAsArray=function(){var b;return b=1<=arguments.length?ib.call(arguments,0):[],J(b[0])&&(b=b[0]),eb.apply(null,[a,"zipAsArray"].concat(ib.call(b),[a.zipWith(b,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]})]))},a.zipWith=function(){var b,c,d;return b=arguments[0],c=2<=arguments.length?ib.call(arguments,1):[],L(b)||(d=[b,c[0]],c=d[0],b=d[1]),c=gb.map(function(a){return a.toEventStream()},c),eb.apply(null,[a,"zipWith",b].concat(ib.call(c),[a.when(c,b)]))},a.groupSimultaneous=function(){var c,d,e;return e=1<=arguments.length?ib.call(arguments,0):[],1===e.length&&J(e[0])&&(e=e[0]),d=function(){var a,d,f;for(f=[],a=0,d=e.length;d>a;a++)c=e[a],f.push(new b(c));return f}(),eb.apply(null,[a,"groupSimultaneous"].concat(ib.call(e),[a.when(d,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]})]))},a.combineAsArray=function(){var b,c,d,e,f,g,h;for(f=1<=arguments.length?ib.call(arguments,0):[],1===f.length&&J(f[0])&&(f=f[0]),b=g=0,h=f.length;h>g;b=++g)e=f[b],M(e)||(f[b]=a.constant(e));return f.length?(d=function(){var a,b,d;for(d=[],a=0,b=f.length;b>a;a++)c=f[a],d.push(new t(c,!0));return d}(),eb.apply(null,[a,"combineAsArray"].concat(ib.call(f),[a.when(d,function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[]}).toProperty()]))):a.constant([])},a.onValues=function(){var b,c,d;return c=2<=arguments.length?ib.call(arguments,0,d=arguments.length-1):(d=0,[]),b=arguments[d++],a.combineAsArray(c).onValues(b)},a.combineWith=function(){var b,c;return b=arguments[0],c=2<=arguments.length?ib.call(arguments,1):[],eb.apply(null,[a,"combineWith",b].concat(ib.call(c),[a.combineAsArray(c).map(function(a){return b.apply(null,a)})]))},a.combineTemplate=function(b){var c,d,e,f,g,h,i,j,k,l;return i=[],l=[],h=function(a){return a[a.length-1]},k=function(a,b,c){return h(a)[b]=c},c=function(a,b){return function(c,d){return k(c,a,d[b])}},g=function(a,b){return function(c){return k(c,a,b)}},j=function(a){return J(a)?[]:{}},e=function(a,b){var d,e;return M(b)?(l.push(b),i.push(c(a,l.length-1))):b!==Object(b)||"function"==typeof b||b instanceof RegExp||b instanceof Date?i.push(g(a,b)):(e=function(a){return function(c){var d;return d=j(b),k(c,a,d),c.push(d)}},d=function(a){return a.pop()},i.push(e(a)),f(b),i.push(d))},f=function(a){return gb.each(a,e)},f(b),d=function(a){var c,d,e,f,g;for(e=j(b),c=[e],f=0,g=i.length;g>f;f++)(d=i[f])(c,a);return e},eb(a,"combineTemplate",b,a.combineAsArray(l).map(d))},a.retry=function(b){var c,d,e,f,g,h;if(!L(b.source))throw new l("'source' option has to be a function");return h=b.source,f=b.retries||0,e=b.maxRetries||f,c=b.delay||function(){return 0},d=b.isRetryable||function(){return!0},g=function(b){var g,i;return i={source:h,retries:f-1,maxRetries:e,delay:c,isRetryable:d},g=function(){return a.retry(i)},a.later(c(b)).filter(!1).concat(a.once().flatMap(g))},eb(a,"retry",b,h().flatMapError(function(b){return d(b)&&f>0?g({error:b,retriesDone:e-f}):a.once(new i(b))}))},D=0,j=function(){function a(){this.id=++D}return a.prototype.isEvent=function(){return!0},a.prototype.isEnd=function(){return!1},a.prototype.isInitial=function(){return!1},a.prototype.isNext=function(){return!1},a.prototype.isError=function(){return!1},a.prototype.hasValue=function(){return!1},a.prototype.filter=function(){return!0},a.prototype.inspect=function(){return this.toString()},a.prototype.log=function(){return this.toString()},a}(),n=function(a){function b(a,c){b.__super__.constructor.call(this),!c&&L(a)||a instanceof b?(this.valueF=a,this.valueInternal=void 0):(this.valueF=void 0,this.valueInternal=a)}return kb(b,a),b.prototype.isNext=function(){return!0},b.prototype.hasValue=function(){return!0},b.prototype.value=function(){return this.valueF instanceof b?(this.valueInternal=this.valueF.value(),this.valueF=void 0):this.valueF&&(this.valueInternal=this.valueF(),this.valueF=void 0),this.valueInternal},b.prototype.fmap=function(a){var b,c;return this.valueInternal?(c=this.valueInternal,this.apply(function(){return a(c)})):(b=this,this.apply(function(){return a(b.value())}))},b.prototype.apply=function(a){return new b(a)},b.prototype.filter=function(a){return a(this.value())},b.prototype.toString=function(){return gb.toString(this.value())},b.prototype.log=function(){return this.value()},b}(j),m=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.isInitial=function(){return!0},b.prototype.isNext=function(){return!1},b.prototype.apply=function(a){return new b(a)},b.prototype.toNext=function(){return new n(this)},b}(n),h=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.isEnd=function(){return!0},b.prototype.fmap=function(){return this},b.prototype.apply=function(){return this},b.prototype.toString=function(){return"<end>"},b}(j),i=function(a){function b(a){this.error=a}return kb(b,a),b.prototype.isError=function(){return!0},b.prototype.fmap=function(){return this},b.prototype.apply=function(){return this},b.prototype.toString=function(){return"<error> "+gb.toString(this.error)},b}(j),H=0,p=function(){function b(a){this.id=++H,eb(a,this),this.initialDesc=this.desc}return b.prototype.subscribe=function(a){return u.wrappedSubscribe(this,a)},b.prototype.subscribeInternal=function(a){return this.dispatcher.subscribe(a)},b.prototype.onValue=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.hasValue()?a(b.value()):void 0})},b.prototype.onValues=function(a){return this.onValue(function(b){return a.apply(null,b)})},b.prototype.onError=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.isError()?a(b.error):void 0})},b.prototype.onEnd=function(){var a;return a=Q(arguments),this.subscribe(function(b){return b.isEnd()?a():void 0})},b.prototype.errors=function(){return eb(this,"errors",this.filter(function(){return!1}))},b.prototype.filter=function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],A(this,c,b,function(b){return eb(this,"filter",b,this.withHandler(function(c){return c.filter(b)?this.push(c):a.more}))})},b.prototype.takeWhile=function(){var b,c;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],A(this,c,b,function(b){return eb(this,"takeWhile",b,this.withHandler(function(c){return c.filter(b)?this.push(c):(this.push(C()),a.noMore)}))})},b.prototype.endOnError=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],null==b&&(b=!0),A(this,b,a,function(a){return eb(this,"endOnError",this.withHandler(function(b){return b.isError()&&a(b.error)?(this.push(b),this.push(C())):this.push(b)}))})},b.prototype.take=function(b){return 0>=b?a.never():eb(this,"take",b,this.withHandler(function(c){return c.hasValue()?(b--,b>0?this.push(c):(0===b&&this.push(c),this.push(C()),a.noMore)):this.push(c)}))},b.prototype.map=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],b instanceof q?b.sampledBy(this,G):A(this,b,a,function(a){return eb(this,"map",a,this.withHandler(function(b){return this.push(b.fmap(a))}))})},b.prototype.mapError=function(){var a;return a=Q(arguments),eb(this,"mapError",a,this.withHandler(function(b){return this.push(b.isError()?U(a(b.error)):b)}))},b.prototype.mapEnd=function(){var b;return b=Q(arguments),eb(this,"mapEnd",b,this.withHandler(function(c){return c.isEnd()?(this.push(U(b(c))),this.push(C()),a.noMore):this.push(c)}))},b.prototype.doAction=function(){var a;return a=Q(arguments),eb(this,"doAction",a,this.withHandler(function(b){return b.hasValue()&&a(b.value()),this.push(b)}))},b.prototype.skip=function(b){return eb(this,"skip",b,this.withHandler(function(c){return c.hasValue()&&b>0?(b--,a.more):this.push(c)}))},b.prototype.skipDuplicates=function(a){return null==a&&(a=function(a,b){return a===b}),eb(this,"skipDuplicates",this.withStateMachine(o,function(b,c){return c.hasValue()?c.isInitial()||b===o||!a(b.get(),c.value())?[new s(c.value()),[c]]:[b,[]]:[b,[c]]}))},b.prototype.skipErrors=function(){return eb(this,"skipErrors",this.withHandler(function(b){return b.isError()?a.more:this.push(b)}))},b.prototype.withStateMachine=function(b,c){var d;return d=b,eb(this,"withStateMachine",b,c,this.withHandler(function(b){var e,f,g,h,i,j,k;for(e=c(d,b),f=e[0],h=e[1],d=f,i=a.more,j=0,k=h.length;k>j;j++)if(g=h[j],i=this.push(g),i===a.noMore)return i;return i}))},b.prototype.scan=function(b,c){var d,e,f;return c=$(c),d=cb(b),f=function(b){return function(f){var g,h,i,j;return g=!1,j=V,h=a.more,i=function(){return g?void 0:d.forEach(function(b){return g=!0,h=f(new m(function(){return b})),h===a.noMore?(j(),j=V):void 0})},j=b.dispatcher.subscribe(function(b){var e,j;return b.hasValue()?g&&b.isInitial()?a.more:(b.isInitial()||i(),g=!0,j=d.getOrElse(void 0),e=c(j,b.value()),d=new s(e),f(b.apply(function(){return e}))):(b.isEnd()&&(h=i()),h!==a.noMore?f(b):void 0)}),u.whenDoneWith(e,i),j}}(this),e=new q(B(this,"scan",b,c),f)},b.prototype.fold=function(a,b){return eb(this,"fold",a,b,this.scan(a,b).sampledBy(this.filter(!1).mapEnd().toProperty()))},b.prototype.zip=function(b,c){return null==c&&(c=Array),eb(this,"zip",b,a.zipWith([this,b],c))},b.prototype.diff=function(a,b){return b=$(b),eb(this,"diff",a,b,this.scan([a],function(a,c){return[c,b(a[0],c)]}).filter(function(a){return 2===a.length}).map(function(a){return a[1]}))},b.prototype.flatMap=function(){return F(this,T(arguments))},b.prototype.flatMapFirst=function(){return F(this,T(arguments),!0)},b.prototype.flatMapWithConcurrencyLimit=function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],eb.apply(null,[this,"flatMapWithConcurrencyLimit",b].concat(ib.call(a),[F(this,T(a),!1,b)]))},b.prototype.flatMapLatest=function(){var a,b;return a=T(arguments),b=this.toEventStream(),eb(this,"flatMapLatest",a,b.flatMap(function(c){return S(a(c)).takeUntil(b)}))},b.prototype.flatMapError=function(b){return eb(this,"flatMapError",b,this.mapError(function(a){return new i(a)}).flatMap(function(c){return c instanceof i?b(c.error):a.once(c)}))},b.prototype.flatMapConcat=function(){return eb.apply(null,[this,"flatMapConcat"].concat(ib.call(arguments),[this.flatMapWithConcurrencyLimit.apply(this,[1].concat(ib.call(arguments)))]))},b.prototype.bufferingThrottle=function(b){return eb(this,"bufferingThrottle",b,this.flatMapConcat(function(c){return a.once(c).concat(a.later(b).filter(!1))}))},b.prototype.not=function(){return eb(this,"not",this.map(function(a){return!a}))},b.prototype.log=function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[],this.subscribe(function(b){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log.apply(console,ib.call(a).concat([b.log()])):void 0}),this},b.prototype.slidingWindow=function(a,b){return null==b&&(b=0),eb(this,"slidingWindow",a,b,this.scan([],function(b,c){return b.concat([c]).slice(-a)}).filter(function(a){return a.length>=b}))},b.prototype.combine=function(b,c){var d;return d=$(c),eb(this,"combine",b,c,a.combineAsArray(this,b).map(function(a){return d(a[0],a[1])}))},b.prototype.decode=function(b){return eb(this,"decode",b,this.combine(a.combineTemplate(b),function(a,b){return b[a]}))},b.prototype.awaiting=function(b){return eb(this,"awaiting",b,a.groupSimultaneous(this,b).map(function(a){var b,c;return b=a[0],c=a[1],0===c.length}).toProperty(!1).skipDuplicates())},b.prototype.name=function(a){return this._name=a,this},b.prototype.withDescription=function(){return B.apply(null,arguments).apply(this)},b.prototype.toString=function(){return this._name?this._name:this.desc.toString()},b.prototype.internalDeps=function(){return this.initialDesc.deps()},b}(),p.prototype.reduce=p.prototype.fold,p.prototype.assign=p.prototype.onValue,p.prototype.inspect=p.prototype.toString,F=function(b,c,e,f){var g,h,i;return i=[b],g=[],h=new k(B(b,"flatMap"+(e?"First":""),c),function(h){var i,j,k,l,n;return k=new d,l=[],n=function(b){var d;return d=S(c(b.value())),g.push(d),k.add(function(b,c){return d.dispatcher.subscribe(function(e){var f;return e.isEnd()?(gb.remove(d,g),j(),i(c),a.noMore):(e instanceof m&&(e=e.toNext()),f=h(e),f===a.noMore&&b(),f)})})},j=function(){var a;return a=l.shift(),a?n(a):void 0},i=function(a){return a(),k.empty()?h(C()):void 0},k.add(function(c,d){return b.dispatcher.subscribe(function(b){return b.isEnd()?i(d):b.isError()?h(b):e&&k.count()>1?a.more:k.unsubscribed?a.noMore:f&&k.count()>f?l.push(b):n(b)})}),k.unsubscribe}),h.internalDeps=function(){return g.length?i.concat(g):i},h},k=function(b){function c(a,b,d){L(a)&&(d=b,b=a,a=[]),c.__super__.constructor.call(this,a),this.dispatcher=new g(b,d),Y(this)}return kb(c,b),c.prototype.delay=function(b){return eb(this,"delay",b,this.flatMap(function(c){return a.later(b,c)}))},c.prototype.debounce=function(b){return eb(this,"debounce",b,this.flatMapLatest(function(c){return a.later(b,c)}))},c.prototype.debounceImmediate=function(b){return eb(this,"debounceImmediate",b,this.flatMapFirst(function(c){return a.once(c).concat(a.later(b).filter(!1))}))},c.prototype.throttle=function(a){return eb(this,"throttle",a,this.bufferWithTime(a).map(function(a){return a[a.length-1]}))},c.prototype.bufferWithTime=function(a){return eb(this,"bufferWithTime",a,this.bufferWithTimeOrCount(a,Number.MAX_VALUE))},c.prototype.bufferWithCount=function(a){return eb(this,"bufferWithCount",a,this.bufferWithTimeOrCount(void 0,a))},c.prototype.bufferWithTimeOrCount=function(a,b){var c;return c=function(c){return c.values.length===b?c.flush():void 0!==a?c.schedule():void 0},eb(this,"bufferWithTimeOrCount",a,b,this.buffer(a,c,c))},c.prototype.buffer=function(b,c,d){var e,f,g;return null==c&&(c=V),null==d&&(d=V),e={scheduled:!1,end:void 0,values:[],flush:function(){var b;if(this.scheduled=!1,this.values.length>0){if(b=this.push(U(this.values)),this.values=[],null!=this.end)return this.push(this.end);if(b!==a.noMore)return d(this)}else if(null!=this.end)return this.push(this.end)},schedule:function(){return this.scheduled?void 0:(this.scheduled=!0,b(function(a){return function(){return a.flush()}}(this)))}},g=a.more,L(b)||(f=b,b=function(b){return a.scheduler.setTimeout(b,f)}),eb(this,"buffer",this.withHandler(function(a){return e.push=function(a){return function(b){return a.push(b)}}(this),a.isError()?g=this.push(a):a.isEnd()?(e.end=a,e.scheduled||e.flush()):(e.values.push(a.value()),c(e)),g}))},c.prototype.merge=function(b){var c;return c=this,eb(c,"merge",b,a.mergeAll(this,b))},c.prototype.toProperty=function(b){var c,d;return d=0===arguments.length?o:cb(function(){return b}),c=this.dispatcher,new q(B(this,"toProperty",b),function(b){var e,f,g,h;return e=!1,h=V,f=a.more,g=function(){return e?void 0:d.forEach(function(c){return e=!0,f=b(new m(c)),f===a.noMore?(h(),h=V):void 0})},h=c.subscribe(function(c){return c.hasValue()?e&&c.isInitial()?a.more:(c.isInitial()||g(),e=!0,d=new s(c),b(c)):(c.isEnd()&&(f=g()),f!==a.noMore?b(c):void 0)}),g(),h})},c.prototype.toEventStream=function(){return this},c.prototype.sampledBy=function(a,b){return eb(this,"sampledBy",a,b,this.toProperty().sampledBy(a,b))},c.prototype.concat=function(a){var b;return b=this,new c(B(b,"concat",a),function(c){var d,e;return e=V,d=b.dispatcher.subscribe(function(b){return b.isEnd()?e=a.dispatcher.subscribe(c):c(b)}),function(){return d(),e()}})},c.prototype.takeUntil=function(b){var c;return c={},eb(this,"takeUntil",b,a.groupSimultaneous(this.mapEnd(c),b.skipErrors()).withHandler(function(d){var e,f,g,h,i,j;if(d.hasValue()){if(j=d.value(),e=j[0],b=j[1],b.length)return this.push(C());for(f=a.more,h=0,i=e.length;i>h;h++)g=e[h],f=this.push(g===c?C():U(g));return f}return this.push(d)}))},c.prototype.skipUntil=function(a){var b;return b=a.take(1).map(!0).toProperty(!1),eb(this,"skipUntil",a,this.filter(b))},c.prototype.skipWhile=function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?ib.call(arguments,1):[],d=!1,A(this,c,b,function(b){return eb(this,"skipWhile",b,this.withHandler(function(c){return!d&&c.hasValue()&&b(c.value())?a.more:(c.hasValue()&&(d=!0),this.push(c))}))})},c.prototype.holdWhen=function(b){var c,d,e;return e=b.startWith(!1),d=e.filter(function(a){return!a}),c=e.filter(gb.id),eb(this,"holdWhen",b,this.filter(!1).merge(e.flatMapConcat(function(b){return function(e){return e?b.scan([],function(a,b){return a.concat(b)}).sampledBy(d).take(1).flatMap(a.fromArray):b.takeUntil(c)}}(this))))},c.prototype.startWith=function(b){return eb(this,"startWith",b,a.once(b).concat(this))},c.prototype.withHandler=function(a){return new c(B(this,"withHandler",a),this.dispatcher.subscribe,a)},c}(p),q=function(b){function c(a,b,d){L(a)&&(d=b,b=a,a=[]),c.__super__.constructor.call(this,a),this.dispatcher=new r(this,b,d),Y(this)}return kb(c,b),c.prototype.sampledBy=function(b,d){var e,f,g,h,i;return null!=d?d=$(d):(e=!0,d=function(a){return a.value()}),i=new t(this,!1,e),g=new t(b,!0,e),h=a.when([i,g],d),f=b instanceof c?h.toProperty():h,eb(this,"sampledBy",b,d,f)},c.prototype.sample=function(b){return eb(this,"sample",b,this.sampledBy(a.interval(b,{})))},c.prototype.changes=function(){return new k(B(this,"changes"),function(a){return function(b){return a.dispatcher.subscribe(function(a){return a.isInitial()?void 0:b(a)})}}(this))},c.prototype.withHandler=function(a){return new c(B(this,"withHandler",a),this.dispatcher.subscribe,a)},c.prototype.toProperty=function(){return this},c.prototype.toEventStream=function(){return new k(B(this,"toEventStream"),function(a){return function(b){return a.dispatcher.subscribe(function(a){return a.isInitial()&&(a=a.toNext()),b(a)})}}(this))},c.prototype.and=function(a){return eb(this,"and",a,this.combine(a,function(a,b){return a&&b}))},c.prototype.or=function(a){return eb(this,"or",a,this.combine(a,function(a,b){return a||b}))},c.prototype.delay=function(a){return this.delayChanges("delay",a,function(b){return b.delay(a)})},c.prototype.debounce=function(a){return this.delayChanges("debounce",a,function(b){return b.debounce(a)})},c.prototype.throttle=function(a){return this.delayChanges("throttle",a,function(b){return b.throttle(a)})},c.prototype.delayChanges=function(){var a,b,c;return a=2<=arguments.length?ib.call(arguments,0,c=arguments.length-1):(c=0,[]),b=arguments[c++],eb.apply(null,[this].concat(ib.call(a),[v(this,b(this.changes()))]))},c.prototype.takeUntil=function(a){var b;return b=this.changes().takeUntil(a),eb(this,"takeUntil",a,v(this,b))},c.prototype.startWith=function(a){return eb(this,"startWith",a,this.scan(a,function(a,b){return b}))},c.prototype.bufferingThrottle=function(){var a;return(a=c.__super__.bufferingThrottle.apply(this,arguments)).bufferingThrottle.apply(a,arguments).toProperty()},c}(p),A=function(a,b,c,d){var e;return b instanceof q?(e=b.sampledBy(a,function(a,b){return[a,b]}),d.call(e,function(a){var b,c;return b=a[0],c=a[1],b}).map(function(a){var b,c;return b=a[0],c=a[1]})):(b=P(b,c),d.call(a,b))},v=function(b,c){var d;return d=new k(B(b,"justInitValue"),function(c){var e,f;return f=void 0,e=b.dispatcher.subscribe(function(b){return b.isEnd()||(f=b),a.noMore}),u.whenDoneWith(d,function(){return null!=f&&c(f),c(C())}),e}),d.concat(c).toProperty()},g=function(){function b(a,b){this._subscribe=a,this._handleEvent=b,this.subscribe=lb(this.subscribe,this),this.handleEvent=lb(this.handleEvent,this),this.subscriptions=[],this.queue=[],this.pushing=!1,this.ended=!1,this.prevError=void 0,this.unsubSrc=void 0}return b.prototype.hasSubscribers=function(){return this.subscriptions.length>0},b.prototype.removeSub=function(a){return this.subscriptions=gb.without(a,this.subscriptions)},b.prototype.push=function(a){return a.isEnd()&&(this.ended=!0),u.inTransaction(a,this,this.pushIt,[a])},b.prototype.pushToSubscriptions=function(b){var c,d,e,f,g,h;try{for(f=this.subscriptions,g=0,h=f.length;h>g;g++)e=f[g],d=e.sink(b),(d===a.noMore||b.isEnd())&&this.removeSub(e);return!0}catch(i){throw c=i,this.pushing=!1,this.queue=[],c}},b.prototype.pushIt=function(b){if(this.pushing)return this.queue.push(b),a.more;if(b!==this.prevError){for(b.isError()&&(this.prevError=b),this.pushing=!0,this.pushToSubscriptions(b),this.pushing=!1;this.queue.length;)b=this.queue.shift(),this.push(b);return this.hasSubscribers()?a.more:(this.unsubscribeFromSource(),a.noMore)}},b.prototype.handleEvent=function(a){return this._handleEvent?this._handleEvent(a):this.push(a)},b.prototype.unsubscribeFromSource=function(){return this.unsubSrc&&this.unsubSrc(),this.unsubSrc=void 0},b.prototype.subscribe=function(a){var b;return this.ended?(a(C()),V):(b={sink:a},this.subscriptions.push(b),1===this.subscriptions.length&&(this.unsubSrc=this._subscribe(this.handleEvent)),function(a){return function(){return a.removeSub(b),a.hasSubscribers()?void 0:a.unsubscribeFromSource()}}(this))},b}(),r=function(b){function c(a,b,d){this.property=a,this.subscribe=lb(this.subscribe,this),c.__super__.constructor.call(this,b,d),this.current=o,this.currentValueRootId=void 0,this.propertyEnded=!1}return kb(c,b),c.prototype.push=function(a){return a.isEnd()&&(this.propertyEnded=!0),a.hasValue()&&(this.current=new s(a),this.currentValueRootId=u.currentEventId()),c.__super__.push.call(this,a)},c.prototype.maybeSubSource=function(b,c){return c===a.noMore?V:this.propertyEnded?(b(C()),V):g.prototype.subscribe.call(this,b)},c.prototype.subscribe=function(b){var c,d,e,f;return d=!1,e=a.more,this.current.isDefined&&(this.hasSubscribers()||this.propertyEnded)?(c=u.currentEventId(),f=this.currentValueRootId,!this.propertyEnded&&f&&c&&c!==f?(u.whenDoneWith(this.property,function(a){return function(){return a.currentValueRootId===f?b(I(a.current.get().value())):void 0}}(this)),this.maybeSubSource(b,e)):(u.inTransaction(void 0,this,function(){return e=b(I(this.current.get().value()))},[]),this.maybeSubSource(b,e))):this.maybeSubSource(b,e)},c}(g),c=function(b){function c(){this.guardedSink=lb(this.guardedSink,this),this.subscribeAll=lb(this.subscribeAll,this),this.unsubAll=lb(this.unsubAll,this),this.sink=void 0,this.subscriptions=[],this.ended=!1,c.__super__.constructor.call(this,B(a,"Bus"),this.subscribeAll)}return kb(c,b),c.prototype.unsubAll=function(){var a,b,c,d;for(d=this.subscriptions,b=0,c=d.length;c>b;b++)a=d[b],"function"==typeof a.unsub&&a.unsub();return void 0},c.prototype.subscribeAll=function(a){var b,c,d,e;for(this.sink=a,e=w(this.subscriptions),c=0,d=e.length;d>c;c++)b=e[c],this.subscribeInput(b);return this.unsubAll},c.prototype.guardedSink=function(b){return function(c){return function(d){return d.isEnd()?(c.unsubscribeInput(b),a.noMore):c.sink(d)}}(this)},c.prototype.subscribeInput=function(a){return a.unsub=a.input.dispatcher.subscribe(this.guardedSink(a.input))},c.prototype.unsubscribeInput=function(a){var b,c,d,e,f;for(f=this.subscriptions,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c.input===a)return"function"==typeof c.unsub&&c.unsub(),void this.subscriptions.splice(b,1)},c.prototype.plug=function(a){var b;if(!this.ended)return b={input:a},this.subscriptions.push(b),null!=this.sink&&this.subscribeInput(b),function(b){return function(){return b.unsubscribeInput(a)}}(this)},c.prototype.end=function(){return this.ended=!0,this.unsubAll(),"function"==typeof this.sink?this.sink(C()):void 0},c.prototype.push=function(a){return"function"==typeof this.sink?this.sink(U(a)):void 0},c.prototype.error=function(a){return"function"==typeof this.sink?this.sink(new i(a)):void 0},c}(k),t=function(){function a(a,b,c){this.obs=a,this.sync=b,this.lazy=null!=c?c:!1,this.queue=[]}return a.prototype.subscribe=function(a){return this.obs.dispatcher.subscribe(a)},a.prototype.toString=function(){return this.obs.toString()},a.prototype.markEnded=function(){return this.ended=!0},a.prototype.consume=function(){return this.lazy?{value:gb.always(this.queue[0])}:this.queue[0]},a.prototype.push=function(a){return this.queue=[a]},a.prototype.mayHave=function(){return!0},a.prototype.hasAtLeast=function(){return this.queue.length},a.prototype.flatten=!0,a}(),e=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return kb(b,a),b.prototype.consume=function(){return this.queue.shift()},b.prototype.push=function(a){return this.queue.push(a)},b.prototype.mayHave=function(a){return!this.ended||this.queue.length>=a},b.prototype.hasAtLeast=function(a){return this.queue.length>=a},b.prototype.flatten=!1,b}(t),b=function(a){function b(a){b.__super__.constructor.call(this,a,!0)}return kb(b,a),b.prototype.consume=function(){var a;return a=this.queue,this.queue=[],{value:function(){return a}}},b.prototype.push=function(a){return this.queue.push(a.value())},b.prototype.hasAtLeast=function(){return!0},b}(t),t.isTrigger=function(a){return a instanceof t?a.sync:a instanceof k},t.fromObservable=function(a){return a instanceof t?a:a instanceof q?new t(a,!1):new e(a,!0)},B=function(){var a,b,c;return b=arguments[0],c=arguments[1],a=3<=arguments.length?ib.call(arguments,2):[],(b||c)instanceof f?b||c:new f(b,c,a)},E=function(a){return J(a)?gb.flatMap(E,a):M(a)?[a]:a instanceof t?[a.obs]:[]},f=function(){function a(a,b,c){this.context=a,this.method=b,this.args=c,this.cached=void 0}return a.prototype.deps=function(){return this.cached||(this.cached=E([this.context].concat(this.args)))},a.prototype.apply=function(a){return a.desc=this,a},a.prototype.toString=function(){return gb.toString(this.context)+"."+gb.toString(this.method)+"("+gb.map(gb.toString,this.args)+")"},a}(),eb=function(){var a,b,c;return a=2<=arguments.length?ib.call(arguments,0,c=arguments.length-1):(c=0,[]),b=arguments[c++],B.apply(null,a).apply(b)},a.when=function(){var b,c,d,e,f,g,h,i,j,l,m,n,o,p,q,r,s,v,w,A;if(0===arguments.length)return a.never();for(f=arguments.length,q="when: expecting arguments in the form (Observable+,function)+",o=[],j=[],c=0,l=[];f>c;){for(l[c]=arguments[c],l[c+1]=arguments[c+1],i=gb.toArray(arguments[c]),b=y(arguments[c+1]),h={f:b,ixs:[]},p=!1,r=0,v=i.length;v>r;r++){for(n=i[r],d=gb.indexOf(o,n),p||(p=t.isTrigger(n)),0>d&&(o.push(n),d=o.length-1),A=h.ixs,s=0,w=A.length;w>s;s++)e=A[s],e.index===d&&e.count++;h.ixs.push({index:d,count:1})}i.length>0&&j.push(h),c+=2}return o.length?(o=gb.map(t.fromObservable,o),g=gb.any(o,function(a){return a.flatten})&&z(gb.map(function(a){return a.obs},o)),m=new k(B.apply(null,[a,"when"].concat(ib.call(l))),function(b){var d,e,f,h,i,k,l;return l=[],f=!1,h=function(a){var b,d,e;for(e=a.ixs,b=0,d=e.length;d>b;b++)if(c=e[b],!o[c.index].hasAtLeast(c.count))return!1;return!0},e=function(a){return!a.sync||a.ended},d=function(a){var b,d,e;for(e=a.ixs,b=0,d=e.length;d>b;b++)if(c=e[b],!o[c.index].mayHave(c.count))return!0},i=function(a){return!a.source.flatten},k=function(k){return function(n){var p,q,r;return q=function(){return u.whenDoneWith(m,p)},r=function(){var d,e,f,g,k,m;if(!(l.length>0))return a.more;for(f=a.more,g=l.pop(),k=0,m=j.length;m>k;k++)if(e=j[k],h(e))return d=function(){var a,b,d,f;for(d=e.ixs,f=[],a=0,b=d.length;b>a;a++)c=d[a],f.push(o[c.index].consume());return f}(),f=b(g.e.apply(function(){var a,b;return b=function(){var b,c,e;for(e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.value());return e}(),e.f.apply(e,b)})),l.length&&(l=gb.filter(i,l)),f===a.noMore?f:r()},p=function(){var c;return c=r(),f&&(f=!1,(gb.all(o,e)||gb.all(j,d))&&(c=a.noMore,b(C()))),c===a.noMore&&n(),c
},k.subscribe(function(c){var d;return c.isEnd()?(f=!0,k.markEnded(),q()):c.isError()?d=b(c):(k.push(c),k.sync&&(l.push({source:k,e:c}),g||u.hasWaiters()?q():p())),d===a.noMore&&n(),d||a.more})}},x.apply(null,function(){var a,b,c;for(c=[],a=0,b=o.length;b>a;a++)n=o[a],c.push(k(n));return c}())})):a.never()},z=function(a,b){var c;return null==b&&(b=[]),c=function(a){var d;return gb.contains(b,a)?!0:(d=a.internalDeps(),d.length?(b.push(a),gb.any(d,c)):(b.push(a),!1))},gb.any(a,c)},a.update=function(){var b,c,d,e;for(c=arguments[0],e=2<=arguments.length?ib.call(arguments,1):[],d=function(a){return function(){var b;return b=1<=arguments.length?ib.call(arguments,0):[],function(c){return a.apply(null,[c].concat(b))}}},b=e.length-1;b>0;)e[b]instanceof Function||(e[b]=function(a){return function(){return a}}(e[b])),e[b]=d(e[b]),b-=2;return eb.apply(null,[a,"update",c].concat(ib.call(e),[a.when.apply(a,e).scan(c,function(a,b){return b(a)})]))},x=function(){var a;return a=1<=arguments.length?ib.call(arguments,0):[],new d(a).unsubscribe},d=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this.unsubscribe=lb(this.unsubscribe,this),this.unsubscribed=!1,this.subscriptions=[],this.starting=[],c=0,d=a.length;d>c;c++)b=a[c],this.add(b)}return a.prototype.add=function(a){var b,c,d;if(!this.unsubscribed)return b=!1,c=V,this.starting.push(a),d=function(d){return function(){return d.unsubscribed?void 0:(b=!0,d.remove(c),gb.remove(a,d.starting))}}(this),c=a(this.unsubscribe,d),this.unsubscribed||b||this.subscriptions.push(c),gb.remove(a,this.starting),c},a.prototype.remove=function(a){return this.unsubscribed?void 0:void 0!==gb.remove(a,this.subscriptions)?a():void 0},a.prototype.unsubscribe=function(){var a,b,c,d;if(!this.unsubscribed){for(this.unsubscribed=!0,d=this.subscriptions,b=0,c=d.length;c>b;b++)(a=d[b])();return this.subscriptions=[],this.starting=[]}},a.prototype.count=function(){return this.unsubscribed?0:this.subscriptions.length+this.starting.length},a.prototype.empty=function(){return 0===this.count()},a}(),a.CompositeUnsubscribe=d,s=function(){function a(a){this.value=a}return a.prototype.getOrElse=function(){return this.value},a.prototype.get=function(){return this.value},a.prototype.filter=function(b){return b(this.value)?new a(this.value):o},a.prototype.map=function(b){return new a(b(this.value))},a.prototype.forEach=function(a){return a(this.value)},a.prototype.isDefined=!0,a.prototype.toArray=function(){return[this.value]},a.prototype.inspect=function(){return"Some("+this.value+")"},a.prototype.toString=function(){return this.inspect()},a}(),o={getOrElse:function(a){return a},filter:function(){return o},map:function(){return o},forEach:function(){},isDefined:!1,toArray:function(){return[]},inspect:function(){return"None"},toString:function(){return this.inspect()}},u=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o;return k=void 0,l=[],m={},c=[],d=0,b=function(a){return k?c.push(a):a()},n=function(a,b){var c;return k?(c=m[a.id],null==c?(c=m[a.id]=[b],l.push(a)):c.push(b)):b()},f=function(){for(;l.length>0;)h(0);return void 0},h=function(a){var b,c,d,e,f,h;for(c=l[a],d=c.id,e=m[d],l.splice(a,1),delete m[d],g(c),f=0,h=e.length;h>f;f++)(b=e[f])();return void 0},g=function(a){var b,c,d,e,f;for(c=a.internalDeps(),e=0,f=c.length;f>e;e++)b=c[e],g(b),m[b.id]&&(d=gb.indexOf(l,b),h(d));return void 0},j=function(a,b,e,g){var h,i;if(k)return e.apply(b,g);k=a;try{i=e.apply(b,g),f()}finally{for(k=void 0;d<c.length;)h=c[d],d++,h();d=0,c=[]}return i},e=function(){return k?k.id:void 0},o=function(c,d){var e,f,g;return g=!1,e=function(){},f=function(){return g=!0,e()},e=c.dispatcher.subscribe(function(c){return b(function(){var b;return g||(b=d(c),b!==a.noMore)?void 0:f()})}),f},i=function(){return l.length>0},{whenDoneWith:n,hasWaiters:i,inTransaction:j,currentEventId:e,wrappedSubscribe:o,afterTransaction:b}}(),a.EventStream=k,a.Property=q,a.Observable=p,a.Bus=c,a.Initial=m,a.Next=n,a.End=h,a.Error=i,V=function(){},N=function(a,b){return b},G=function(a){return a},I=function(a){return new m(a,!0)},U=function(a){return new n(a,!0)},C=function(){return new h},_=function(a){return a instanceof j?a:U(a)},w=function(a){return a.slice(0)},L=function(a){return"function"==typeof a},J=function(a){return a instanceof Array},M=function(a){return a instanceof p},W=function(a,b){return function(){var c;return c=1<=arguments.length?ib.call(arguments,0):[],a.apply(null,b.concat(c))}},T=function(a){return 1===a.length&&M(a[0])?gb.always(a[0]):Q(a)},Q=function(a){return a=Array.prototype.slice.call(a),R.apply(null,a)},R=fb(function(){var a,b;return b=arguments[0],a=2<=arguments.length?ib.call(arguments,1):[],L(b)?a.length?W(b,a):b:K(b)?ab(b,a):gb.always(b)}),P=function(a,b){return R.apply(null,[a].concat(ib.call(b)))},y=function(a){return L(a)?a:gb.always(a)},S=function(b){return M(b)?b:a.once(b)},K=function(a){return"string"==typeof a&&a.length>1&&"."===a.charAt(0)},a.isFieldKey=K,ab=function(a,b){var c,d;return d=a.slice(1).split("."),c=gb.map(db(b),d),function(b){var d,e;for(d=0,e=c.length;e>d;d++)a=c[d],b=a(b);return b}},db=function(a){return function(b){return function(c){var d;return null==c?void 0:(d=c[b],L(d)?d.apply(c,a):d)}}},bb=function(a){return a.slice(1)},$=function(a){var b;return L(a)?a:K(a)?(b=bb(a),function(a,c){return a[b](c)}):void 0},cb=function(a){return a instanceof s||a===o?a:new s(a)},gb={indexOf:Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){var c,d,e,f;for(c=e=0,f=a.length;f>e;c=++e)if(d=a[c],b===d)return c;return-1},indexWhere:function(a,b){var c,d,e,f;for(c=e=0,f=a.length;f>e;c=++e)if(d=a[c],b(d))return c;return-1},head:function(a){return a[0]},always:function(a){return function(){return a}},negate:function(a){return function(b){return!a(b)}},empty:function(a){return 0===a.length},tail:function(a){return a.slice(1,a.length)},filter:function(a,b){var c,d,e,f;for(c=[],e=0,f=b.length;f>e;e++)d=b[e],a(d)&&c.push(d);return c},map:function(a,b){var c,d,e,f;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(a(c));return f},each:function(a,b){var c,d;for(c in a)d=a[c],b(c,d);return void 0},toArray:function(a){return J(a)?a:[a]},contains:function(a,b){return-1!==gb.indexOf(a,b)},id:function(a){return a},last:function(a){return a[a.length-1]},all:function(a,b){var c,d,e;for(null==b&&(b=gb.id),d=0,e=a.length;e>d;d++)if(c=a[d],!b(c))return!1;return!0},any:function(a,b){var c,d,e;for(null==b&&(b=gb.id),d=0,e=a.length;e>d;d++)if(c=a[d],b(c))return!0;return!1},without:function(a,b){return gb.filter(function(b){return b!==a},b)},remove:function(a,b){var c;return c=gb.indexOf(b,a),c>=0?b.splice(c,1):void 0},fold:function(a,b,c){var d,e,f;for(e=0,f=a.length;f>e;e++)d=a[e],b=c(b,d);return b},flatMap:function(a,b){return gb.fold(b,[],function(b,c){return b.concat(a(c))})},cached:function(a){var b;return b=o,function(){return b===o&&(b=a(),a=void 0),b}},toString:function(a){var b,c,d,e;try{return X++,null==a?"undefined":L(a)?"function":J(a)?X>5?"[..]":"["+gb.map(gb.toString,a).toString()+"]":null!=(null!=a?a.toString:void 0)&&a.toString!==Object.prototype.toString?a.toString():"object"==typeof a?X>5?"{..}":(c=function(){var c;c=[];for(d in a)jb.call(a,d)&&(e=function(){try{return a[d]}catch(c){return b=c}}(),c.push(gb.toString(d)+":"+gb.toString(e)));return c}(),"{"+c+"}"):a}finally{X--}}},X=0,a._=gb,a.scheduler={setTimeout:function(a,b){return setTimeout(a,b)},setInterval:function(a,b){return setInterval(a,b)},clearInterval:function(a){return clearInterval(a)},now:function(){return(new Date).getTime()}},"undefined"!=typeof define&&null!==define&&null!=define.amd?(define([],function(){return a}),this.Bacon=a):"undefined"!=typeof module&&null!==module&&null!=module.exports?(module.exports=a,a.Bacon=a):this.Bacon=a}).call(this);
{
"name": "baconjs",
"description": "A small functional reactive programming lib for JavaScript.",
"version": "0.7.40",
"version": "0.7.41",
"keywords": [

@@ -6,0 +6,0 @@ "bacon.js",

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

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