Comparing version 4.0.10 to 4.0.11
@@ -9,3 +9,3 @@ import { callbagT as $$callbagT } from '../shims/Js.shim'; | ||
export declare type callbagT<a> = $$callbagT<a>; | ||
export declare const fromCallbag: <a>(_1: callbagT<a>) => Wonka_types_sourceT<a>; | ||
export declare const toCallbag: <a>(_1: Wonka_types_sourceT<a>) => callbagT<a>; | ||
export declare const fromCallbag: <a>(callbag: callbagT<a>) => Wonka_types_sourceT<a>; | ||
export declare const toCallbag: <a>(source: Wonka_types_sourceT<a>) => callbagT<a>; |
@@ -8,3 +8,3 @@ import { observableObserverT as $$observableObserverT } from '../shims/Js.shim'; | ||
export declare type observableT<a> = $$observableT<a>; | ||
export declare const fromObservable: <a>(_1: observableT<a>) => Wonka_types_sourceT<a>; | ||
export declare const toObservable: <a>(_1: Wonka_types_sourceT<a>) => observableT<a>; | ||
export declare const fromObservable: <a>(input: observableT<a>) => Wonka_types_sourceT<a>; | ||
export declare const toObservable: <a>(source: Wonka_types_sourceT<a>) => observableT<a>; |
@@ -11,8 +11,8 @@ import { callbagT as Wonka_callbag_callbagT } from './Wonka_callbag.gen'; | ||
export declare const toCallbag: <T1>(_1: Wonka_types_sourceT<T1>) => Wonka_callbag_callbagT<T1>; | ||
export declare const debounce: <a>(_1: ((_1: a) => number)) => Wonka_types_operatorT<a, a>; | ||
export declare const delay: <a>(_1: number) => Wonka_types_operatorT<a, a>; | ||
export declare const throttle: <a>(_1: ((_1: a) => number)) => Wonka_types_operatorT<a, a>; | ||
export declare const toPromise: <a>(_1: Wonka_types_sourceT<a>) => Promise<a>; | ||
export declare const interval: (_1: number) => Wonka_types_sourceT<number>; | ||
export declare const fromDomEvent: (_1: Dom_element, _2: string) => Wonka_types_sourceT<Dom_event>; | ||
export declare const fromPromise: <a>(_1: Promise<a>) => Wonka_types_sourceT<a>; | ||
export declare const debounce: <a>(f: ((_1: a) => number)) => Wonka_types_operatorT<a, a>; | ||
export declare const delay: <a>(wait: number) => Wonka_types_operatorT<a, a>; | ||
export declare const throttle: <a>(f: ((_1: a) => number)) => Wonka_types_operatorT<a, a>; | ||
export declare const toPromise: <a>(source: Wonka_types_sourceT<a>) => Promise<a>; | ||
export declare const interval: (p: number) => Wonka_types_sourceT<number>; | ||
export declare const fromDomEvent: (element: Dom_element, event: string) => Wonka_types_sourceT<Dom_event>; | ||
export declare const fromPromise: <a>(promise: Promise<a>) => Wonka_types_sourceT<a>; |
import { operatorT as Wonka_types_operatorT } from './Wonka_types.gen'; | ||
import { sourceT as Wonka_types_sourceT } from './Wonka_types.gen'; | ||
export declare const buffer: <a, b>(_1: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b[]>; | ||
export declare const combine: <a, b>(_1: Wonka_types_sourceT<a>, _2: Wonka_types_sourceT<b>) => Wonka_types_sourceT<[a, b]>; | ||
export declare const concatMap: <a, b>(_1: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const concatAll: <a>(_1: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const concat: <a>(_1: Wonka_types_sourceT<a>[]) => Wonka_types_sourceT<a>; | ||
export declare const filter: <a>(_1: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const map: <a, b>(_1: ((_1: a) => b)) => Wonka_types_operatorT<a, b>; | ||
export declare const mergeMap: <a, b>(_1: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const merge: <a>(_1: Wonka_types_sourceT<a>[]) => Wonka_types_sourceT<a>; | ||
export declare const mergeAll: <a>(_1: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const buffer: <a, b>(notifier: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b[]>; | ||
export declare const combine: <a, b>(sourceA: Wonka_types_sourceT<a>, sourceB: Wonka_types_sourceT<b>) => Wonka_types_sourceT<[a, b]>; | ||
export declare const concatMap: <a, b>(f: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const concatAll: <a>(source: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const concat: <a>(sources: Wonka_types_sourceT<a>[]) => Wonka_types_sourceT<a>; | ||
export declare const filter: <a>(f: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const map: <a, b>(f: ((_1: a) => b)) => Wonka_types_operatorT<a, b>; | ||
export declare const mergeMap: <a, b>(f: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const merge: <a>(sources: Wonka_types_sourceT<a>[]) => Wonka_types_sourceT<a>; | ||
export declare const mergeAll: <a>(source: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const flatten: <T1>(_1: Wonka_types_sourceT<Wonka_types_sourceT<T1>>) => Wonka_types_sourceT<T1>; | ||
export declare const onEnd: <a>(_1: (() => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const onPush: <a>(_1: ((_1: a) => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const onEnd: <a>(f: (() => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const onPush: <a>(f: ((_1: a) => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const tap: <T1>(_1: ((_1: T1) => void)) => Wonka_types_operatorT<T1, T1>; | ||
export declare const onStart: <a>(_1: (() => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const sample: <a, b>(_1: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const scan: <a, acc>(_1: ((_1: acc, _2: a) => acc), _2: acc) => Wonka_types_operatorT<a, acc>; | ||
export declare const share: <a>(_1: Wonka_types_sourceT<a>) => Wonka_types_sourceT<a>; | ||
export declare const skip: <a>(_1: number) => Wonka_types_operatorT<a, a>; | ||
export declare const skipUntil: <a, b>(_1: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const skipWhile: <a>(_1: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const switchMap: <a, b>(_1: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const switchAll: <a>(_1: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const take: <a>(_1: number) => Wonka_types_operatorT<a, a>; | ||
export declare const takeLast: <a>(_1: number) => Wonka_types_operatorT<a, a>; | ||
export declare const takeUntil: <a, b>(_1: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const takeWhile: <a>(_1: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const onStart: <a>(f: (() => void)) => Wonka_types_operatorT<a, a>; | ||
export declare const sample: <a, b>(notifier: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const scan: <a, acc>(f: ((_1: acc, _2: a) => acc), seed: acc) => Wonka_types_operatorT<a, acc>; | ||
export declare const share: <a>(source: Wonka_types_sourceT<a>) => Wonka_types_sourceT<a>; | ||
export declare const skip: <a>(wait: number) => Wonka_types_operatorT<a, a>; | ||
export declare const skipUntil: <a, b>(notifier: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const skipWhile: <a>(f: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const switchMap: <a, b>(f: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
export declare const switchAll: <a>(source: Wonka_types_sourceT<Wonka_types_sourceT<a>>) => Wonka_types_sourceT<a>; | ||
export declare const take: <a>(max: number) => Wonka_types_operatorT<a, a>; | ||
export declare const takeLast: <a>(max: number) => Wonka_types_operatorT<a, a>; | ||
export declare const takeUntil: <a, b>(notifier: Wonka_types_sourceT<a>) => Wonka_types_operatorT<b, b>; | ||
export declare const takeWhile: <a>(f: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; |
@@ -5,5 +5,5 @@ import { sourceT as Wonka_types_sourceT } from './Wonka_types.gen'; | ||
export declare type forEachConsumerT<a> = (_1: Wonka_types_sourceT<a>) => void; | ||
export declare const subscribe: <a>(_1: ((_1: a) => void)) => subscribeConsumerT<a>; | ||
export declare const forEach: <a>(_1: ((_1: a) => void)) => forEachConsumerT<a>; | ||
export declare const publish: <a>(_1: Wonka_types_sourceT<a>) => Wonka_types_subscriptionT; | ||
export declare const toArray: <a>(_1: Wonka_types_sourceT<a>) => a[]; | ||
export declare const subscribe: <a>(f: ((_1: a) => void)) => subscribeConsumerT<a>; | ||
export declare const forEach: <a>(f: ((_1: a) => void)) => forEachConsumerT<a>; | ||
export declare const publish: <a>(source: Wonka_types_sourceT<a>) => Wonka_types_subscriptionT; | ||
export declare const toArray: <a>(source: Wonka_types_sourceT<a>) => a[]; |
@@ -7,8 +7,8 @@ import { list } from '../src/shims/ReasonPervasives.shim'; | ||
import { teardownT as Wonka_types_teardownT } from './Wonka_types.gen'; | ||
export declare const fromArray: <a>(_1: a[]) => Wonka_types_sourceT<a>; | ||
export declare const fromList: <a>(_1: list<a>) => Wonka_types_sourceT<a>; | ||
export declare const fromValue: <a>(_1: a) => Wonka_types_sourceT<a>; | ||
export declare const make: <a>(_1: ((_1: Wonka_types_observerT<a>) => Wonka_types_teardownT)) => Wonka_types_sourceT<a>; | ||
export declare const makeSubject: <a>(_1: void) => Wonka_types_subjectT<a>; | ||
export declare const empty: <a>(_1: Wonka_types_sinkT<a>) => void; | ||
export declare const never: <a>(_1: Wonka_types_sinkT<a>) => void; | ||
export declare const fromArray: <a>(arr: a[]) => Wonka_types_sourceT<a>; | ||
export declare const fromList: <a>(ls: list<a>) => Wonka_types_sourceT<a>; | ||
export declare const fromValue: <a>(x: a) => Wonka_types_sourceT<a>; | ||
export declare const make: <a>(f: ((_1: Wonka_types_observerT<a>) => Wonka_types_teardownT)) => Wonka_types_sourceT<a>; | ||
export declare const makeSubject: <a>() => Wonka_types_subjectT<a>; | ||
export declare const empty: <a>(sink: Wonka_types_sinkT<a>) => void; | ||
export declare const never: <a>(sink: Wonka_types_sinkT<a>) => void; |
@@ -10,7 +10,7 @@ import { signalT as $$signalT } from './shims/Js.shim'; | ||
export declare type subscriptionT = { | ||
readonly unsubscribe: (_1: void) => void; | ||
readonly unsubscribe: () => void; | ||
}; | ||
export declare type observerT<a> = { | ||
readonly next: (_1: a) => void; | ||
readonly complete: (_1: void) => void; | ||
readonly complete: () => void; | ||
}; | ||
@@ -20,3 +20,3 @@ export declare type subjectT<a> = { | ||
readonly next: (_1: a) => void; | ||
readonly complete: (_1: void) => void; | ||
readonly complete: () => void; | ||
}; |
1140
dist/wonka.js
@@ -8,60 +8,24 @@ "use strict"; | ||
var undefinedHeader = []; | ||
function talkbackPlaceholder(a) {} | ||
function some(a) { | ||
if (void 0 === a) { | ||
return (a = [ undefinedHeader, 0 ]).tag = 256, a; | ||
} | ||
null !== a && a[0] === undefinedHeader && ((a = [ undefinedHeader, a[1] + 1 | 0 ]).tag = 256); | ||
return a; | ||
} | ||
function valFromOption(a) { | ||
if (null !== a && a[0] === undefinedHeader) { | ||
if (0 !== (a = a[1])) { | ||
return [ undefinedHeader, a - 1 | 0 ]; | ||
} | ||
} else { | ||
return a; | ||
} | ||
} | ||
function talkbackPlaceholder(a) { | ||
return 0; | ||
} | ||
function makeTrampoline(a, b) { | ||
let c = !1, e = !1, d = !1; | ||
return a(__(0, [ function(f) { | ||
if (f) { | ||
c = !0; | ||
} else if (e) { | ||
d = !0; | ||
} else { | ||
for (e = d = !0; d && !c; ) { | ||
void 0 !== (f = b()) ? (d = !1, a(__(1, [ valFromOption(f) ]))) : (c = !0, a(0)); | ||
} | ||
e = !1; | ||
} | ||
return 0; | ||
} ])); | ||
} | ||
function fromArray(a) { | ||
return function(b) { | ||
var c = a.length; | ||
let e = 0; | ||
return makeTrampoline(b, (function() { | ||
if (e < c) { | ||
var d = a[e]; | ||
e = e + 1 | 0; | ||
return some(d); | ||
let e = !1, d = !1, f = !1, g = 0; | ||
return b(__(0, [ function(h) { | ||
if (h) { | ||
e = !0; | ||
} else if (d) { | ||
f = !0; | ||
} else { | ||
for (d = f = !0; f && !e; ) { | ||
g < c ? (h = a[g], g = g + 1 | 0, f = !1, b(__(1, [ h ]))) : (e = !0, b(0)); | ||
} | ||
d = !1; | ||
} | ||
})); | ||
} ])); | ||
}; | ||
} | ||
function _ref() { | ||
return 0; | ||
} | ||
function _ref() {} | ||
@@ -75,3 +39,7 @@ function _ref4(a) { | ||
return a(__(0, [ function(c) { | ||
return c ? (b = !0, 0) : b ? 0 : a(0); | ||
if (c) { | ||
b = !0; | ||
} else if (!b) { | ||
return a(0); | ||
} | ||
} ])); | ||
@@ -82,9 +50,15 @@ } | ||
return function(b) { | ||
let c = a; | ||
return makeTrampoline(b, (function() { | ||
var a = c; | ||
let c = !1, e = !1, d = !1, f = a; | ||
return b(__(0, [ function(a) { | ||
if (a) { | ||
return c = a[1], some(a[0]); | ||
c = !0; | ||
} else if (e) { | ||
d = !0; | ||
} else { | ||
for (e = d = !0; d && !c; ) { | ||
(a = f) ? (f = a[1], d = !1, b(__(1, [ a[0] ]))) : (c = !0, b(0)); | ||
} | ||
e = !1; | ||
} | ||
})); | ||
} ])); | ||
}; | ||
@@ -96,10 +70,6 @@ }, fromValue$1 = function fromValue(a) { | ||
if (e) { | ||
return c = !0, 0; | ||
c = !0; | ||
} else if (!c) { | ||
return c = !0, b(__(1, [ a ])), b(0); | ||
} | ||
if (c) { | ||
return 0; | ||
} | ||
c = !0; | ||
b(__(1, [ a ])); | ||
return b(0); | ||
} ])); | ||
@@ -111,15 +81,17 @@ }; | ||
c = a({ | ||
next: function(a) { | ||
return e ? 0 : b(__(1, [ a ])); | ||
next: function(d) { | ||
if (!e) { | ||
return b(__(1, [ d ])); | ||
} | ||
}, | ||
complete: function(a) { | ||
if (e) { | ||
return 0; | ||
complete: function(d) { | ||
if (!e) { | ||
return e = !0, b(0); | ||
} | ||
e = !0; | ||
return b(0); | ||
} | ||
}); | ||
return b(__(0, [ function(a) { | ||
return a && !e ? (e = !0, c()) : 0; | ||
return b(__(0, [ function(d) { | ||
if (d && !e) { | ||
return e = !0, c(); | ||
} | ||
} ])); | ||
@@ -131,20 +103,17 @@ }; | ||
source: function(a) { | ||
function c(c) { | ||
return c !== a; | ||
function d(d) { | ||
return d !== a; | ||
} | ||
b = b.concat(a); | ||
return a(__(0, [ function(a) { | ||
a && (b = b.filter(c)); | ||
return 0; | ||
a && (b = b.filter(d)); | ||
} ])); | ||
}, | ||
next: function(a) { | ||
c || b.forEach((function d(c) { | ||
return c(__(1, [ a ])); | ||
c || b.forEach((function d(d) { | ||
return d(__(1, [ a ])); | ||
})); | ||
return 0; | ||
}, | ||
complete: function(a) { | ||
c || (c = !0, b.forEach(_ref4)); | ||
return 0; | ||
} | ||
@@ -156,162 +125,36 @@ }; | ||
function caml_array_sub(a, b, c) { | ||
for (var e = Array(c), d = 0; d < c; ) { | ||
e[d] = a[b], d = d + 1 | 0, b = b + 1 | 0; | ||
var undefinedHeader = []; | ||
function some(a) { | ||
if (void 0 === a) { | ||
return (a = [ undefinedHeader, 0 ]).tag = 256, a; | ||
} | ||
return e; | ||
if (null === a || a[0] !== undefinedHeader) { | ||
return a; | ||
} | ||
(a = [ undefinedHeader, a[1] + 1 | 0 ]).tag = 256; | ||
return a; | ||
} | ||
function app(a, b) { | ||
for (;;) { | ||
var c = b; | ||
var e = 0 === (b = a.length) ? 1 : b; | ||
if (0 === (b = e - c.length | 0)) { | ||
return a.apply(null, c); | ||
} | ||
if (0 > b) { | ||
b = caml_array_sub(c, e, 0 | -b), a = a.apply(null, caml_array_sub(c, 0, e)); | ||
} else { | ||
return function(a, c) { | ||
return function(d) { | ||
return app(a, c.concat([ d ])); | ||
}; | ||
}(a, c); | ||
} | ||
function valFromOption(a) { | ||
if (null === a || a[0] !== undefinedHeader) { | ||
return a; | ||
} | ||
if (0 !== (a = a[1])) { | ||
return [ undefinedHeader, a - 1 | 0 ]; | ||
} | ||
} | ||
function _1(a, b) { | ||
var c = a.length; | ||
return 1 === c ? a(b) : function curry_1(a, b, c) { | ||
switch (c) { | ||
case 1: | ||
return a(b); | ||
case 2: | ||
return function(c) { | ||
return a(b, c); | ||
}; | ||
case 3: | ||
return function(c, d) { | ||
return a(b, c, d); | ||
}; | ||
case 4: | ||
return function(c, d, f) { | ||
return a(b, c, d, f); | ||
}; | ||
case 5: | ||
return function(c, d, f, g) { | ||
return a(b, c, d, f, g); | ||
}; | ||
case 6: | ||
return function(c, d, f, g, h) { | ||
return a(b, c, d, f, g, h); | ||
}; | ||
case 7: | ||
return function(c, d, f, g, h, k) { | ||
return a(b, c, d, f, g, h, k); | ||
}; | ||
default: | ||
return app(a, [ b ]); | ||
} | ||
}(a, b, c); | ||
} | ||
function _2(a, b, c) { | ||
var e = a.length; | ||
return 2 === e ? a(b, c) : function curry_2(a, b, c, e) { | ||
switch (e) { | ||
case 1: | ||
return app(a(b), [ c ]); | ||
case 2: | ||
return a(b, c); | ||
case 3: | ||
return function(d) { | ||
return a(b, c, d); | ||
}; | ||
case 4: | ||
return function(d, e) { | ||
return a(b, c, d, e); | ||
}; | ||
case 5: | ||
return function(d, e, g) { | ||
return a(b, c, d, e, g); | ||
}; | ||
case 6: | ||
return function(d, e, g, h) { | ||
return a(b, c, d, e, g, h); | ||
}; | ||
case 7: | ||
return function(d, e, g, h, k) { | ||
return a(b, c, d, e, g, h, k); | ||
}; | ||
default: | ||
return app(a, [ b, c ]); | ||
} | ||
}(a, b, c, e); | ||
} | ||
function _3(a, b, c, e) { | ||
var d = a.length; | ||
return 3 === d ? a(b, c, e) : function curry_3(a, b, c, e, d) { | ||
switch (d) { | ||
case 1: | ||
return app(a(b), [ c, e ]); | ||
case 2: | ||
return app(a(b, c), [ e ]); | ||
case 3: | ||
return a(b, c, e); | ||
case 4: | ||
return function(d) { | ||
return a(b, c, e, d); | ||
}; | ||
case 5: | ||
return function(d, g) { | ||
return a(b, c, e, d, g); | ||
}; | ||
case 6: | ||
return function(d, g, h) { | ||
return a(b, c, e, d, g, h); | ||
}; | ||
case 7: | ||
return function(d, g, h, k) { | ||
return a(b, c, e, d, g, h, k); | ||
}; | ||
default: | ||
return app(a, [ b, c, e ]); | ||
} | ||
}(a, b, c, e, d); | ||
} | ||
function combine(a, b) { | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = talkbackPlaceholder, f = void 0, g = void 0, h = !1, k = 0, l = !1; | ||
_1(a, (function(a) { | ||
a((function(a) { | ||
var b = g; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
return k = k + 1 | 0, 0; | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return 0; | ||
return; | ||
} | ||
@@ -322,25 +165,24 @@ l = !0; | ||
if (a.tag) { | ||
a = a[0]; | ||
if (void 0 !== b) { | ||
if (l) { | ||
return 0; | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return f = some(a), h = !1, c(__(1, [ [ a, valFromOption(b) ] ])); | ||
} | ||
f = some(a); | ||
} else if (f = some(a), h) { | ||
h = !1; | ||
return c(__(1, [ [ a, valFromOption(b) ] ])); | ||
} else { | ||
return d(0); | ||
} | ||
f = some(a); | ||
return h ? (h = !1, 0) : d(0); | ||
} else { | ||
e = a[0]; | ||
} | ||
e = a[0]; | ||
return 0; | ||
})); | ||
_1(b, (function(a) { | ||
b((function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
return k = k + 1 | 0, 0; | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return 0; | ||
return; | ||
} | ||
@@ -351,30 +193,24 @@ l = !0; | ||
if (a.tag) { | ||
a = a[0]; | ||
if (void 0 !== b) { | ||
if (l) { | ||
return 0; | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return g = some(a), h = !1, c(__(1, [ [ valFromOption(b), a ] ])); | ||
} | ||
g = some(a); | ||
} else if (g = some(a), h) { | ||
h = !1; | ||
return c(__(1, [ [ valFromOption(b), a ] ])); | ||
} else { | ||
return e(0); | ||
} | ||
g = some(a); | ||
return h ? (h = !1, 0) : e(0); | ||
} else { | ||
d = a[0]; | ||
} | ||
d = a[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (l) { | ||
return 0; | ||
if (!l) { | ||
if (a) { | ||
return l = !0, e(1), d(1); | ||
} | ||
if (!h) { | ||
return h = !0, e(a), d(a); | ||
} | ||
} | ||
if (a) { | ||
return l = !0, e(1), d(1); | ||
} | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
e(a); | ||
return d(a); | ||
} ])); | ||
@@ -389,24 +225,29 @@ }; | ||
if ("number" == typeof b) { | ||
if (!k) { | ||
return; | ||
} | ||
k = !1; | ||
if (void 0 !== (b = d.shift())) { | ||
return n(a(valFromOption(b))); | ||
} | ||
if (m) { | ||
return c(0); | ||
} | ||
if (g) { | ||
return; | ||
} | ||
g = !0; | ||
return f(0); | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
k = !1; | ||
if (void 0 !== (b = d.shift())) { | ||
return n(a(valFromOption(b))); | ||
if (c(b), l) { | ||
l = !1; | ||
} else { | ||
return h(0); | ||
} | ||
if (m) { | ||
return c(0); | ||
} | ||
if (g) { | ||
return 0; | ||
} | ||
g = !0; | ||
return f(0); | ||
} | ||
return 0; | ||
} else { | ||
return h = b = b[0], l = !1, b(0); | ||
} | ||
if (b.tag) { | ||
return k ? (c(b), l ? (l = !1, 0) : h(0)) : 0; | ||
} | ||
h = b = b[0]; | ||
l = !1; | ||
return b(0); | ||
} | ||
@@ -416,24 +257,20 @@ let d = [], f = talkbackPlaceholder, g = !1, h = talkbackPlaceholder, k = !1, l = !1, m = !1; | ||
k = !0; | ||
return _1(a, e); | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
}; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (m) { | ||
return 0; | ||
} | ||
m = !0; | ||
return !k && function isEmpty(a) { | ||
if (!m && (m = !0, !k && function isEmpty(a) { | ||
return 0 === a.length; | ||
}(d) ? c(0) : 0; | ||
} | ||
if (b.tag) { | ||
if (m) { | ||
return 0; | ||
}(d))) { | ||
return c(0); | ||
} | ||
b = b[0]; | ||
g = !1; | ||
return k ? (d.push(b), 0) : n(a(b)); | ||
} else if (!b.tag) { | ||
f = b[0]; | ||
} else if (!m) { | ||
if (b = b[0], g = !1, k) { | ||
d.push(b); | ||
} else { | ||
return n(a(b)); | ||
} | ||
} | ||
f = b[0]; | ||
return 0; | ||
})); | ||
@@ -448,3 +285,2 @@ return c(__(0, [ function(a) { | ||
} | ||
return 0; | ||
} ])); | ||
@@ -455,11 +291,11 @@ }; | ||
function _ref3(a) { | ||
function _ref19(a) { | ||
return a; | ||
} | ||
function _ref4$1(a) { | ||
function _ref20(a) { | ||
return a; | ||
} | ||
function _ref7(a) { | ||
function _ref23(a) { | ||
return a(0); | ||
@@ -472,21 +308,13 @@ } | ||
let e = talkbackPlaceholder, d = !1, f = [], g = !1; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (g) { | ||
return 0; | ||
if (!g && (g = !0, 0 === f.length)) { | ||
return c(0); | ||
} | ||
g = !0; | ||
return 0 === f.length ? c(0) : 0; | ||
} | ||
if (b.tag) { | ||
if (g) { | ||
return 0; | ||
} | ||
d = !1; | ||
!function(a) { | ||
} else if (b.tag) { | ||
if (!g && (d = !1, function(a) { | ||
function b(a) { | ||
return a !== h; | ||
return a !== k; | ||
} | ||
let h = talkbackPlaceholder; | ||
_1(a, (function(a) { | ||
var h = function(a) { | ||
if ("number" == typeof a) { | ||
@@ -503,26 +331,23 @@ if (0 !== f.length) { | ||
} | ||
return 0; | ||
} else if (a.tag) { | ||
if (0 !== f.length) { | ||
return c(__(1, [ a[0] ])), k(0); | ||
} | ||
} else { | ||
return k = a = a[0], f = f.concat(a), a(0); | ||
} | ||
if (a.tag) { | ||
return 0 !== f.length ? (c(__(1, [ a[0] ])), h(0)) : 0; | ||
} | ||
h = a = a[0]; | ||
f = f.concat(a); | ||
return a(0); | ||
})); | ||
}(a(b[0])); | ||
if (d) { | ||
return 0; | ||
}; | ||
let k = talkbackPlaceholder; | ||
1 === a.length ? a(h) : a.bind(null, h); | ||
}(a(b[0])), !d)) { | ||
return d = !0, e(0); | ||
} | ||
d = !0; | ||
return e(0); | ||
} else { | ||
e = b[0]; | ||
} | ||
e = b[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
a ? (g || (g = !0, e(a)), f.forEach((function c(c) { | ||
return c(a); | ||
})), f = []) : (d || g ? d = !1 : (d = !0, e(0)), f.forEach(_ref7)); | ||
return 0; | ||
a ? (g || (g = !0, e(a)), f.forEach((function b(b) { | ||
return b(a); | ||
})), f = []) : (d || g ? d = !1 : (d = !0, e(0)), f.forEach(_ref23)); | ||
} ])); | ||
@@ -533,7 +358,7 @@ }; | ||
function _ref8(a) { | ||
function _ref24(a) { | ||
return a; | ||
} | ||
function _ref9(a) { | ||
function _ref25(a) { | ||
return a; | ||
@@ -543,3 +368,3 @@ } | ||
function mergeAll(a) { | ||
return mergeMap(_ref9)(a); | ||
return mergeMap(_ref25)(a); | ||
} | ||
@@ -550,14 +375,13 @@ | ||
return function(c) { | ||
let e = !1; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (e) { | ||
return 0; | ||
if (d) { | ||
return; | ||
} | ||
e = !0; | ||
d = !0; | ||
return c(b); | ||
} | ||
if (b.tag) { | ||
if (e) { | ||
return 0; | ||
if (d) { | ||
return; | ||
} | ||
@@ -567,11 +391,11 @@ a(b[0]); | ||
} | ||
var d = b[0]; | ||
var g = b[0]; | ||
return c(__(0, [ function(a) { | ||
if (e) { | ||
return 0; | ||
if (!d) { | ||
return a && (d = !0), g(a); | ||
} | ||
a && (e = !0); | ||
return d(a); | ||
} ])); | ||
})); | ||
}; | ||
let d = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -584,7 +408,8 @@ }; | ||
return function(e) { | ||
let d = b; | ||
return _1(c, (function(c) { | ||
"number" == typeof c ? c = 0 : c.tag ? (d = a(d, c[0]), c = __(1, [ d ])) : c = __(0, [ c[0] ]); | ||
return e(c); | ||
})); | ||
var d = function(b) { | ||
"number" == typeof b ? b = 0 : b.tag ? (f = a(f, b[0]), b = __(1, [ f ])) : b = __(0, [ b[0] ]); | ||
return e(b); | ||
}; | ||
let f = b; | ||
return 1 === c.length ? c(d) : c.bind(null, d); | ||
}; | ||
@@ -594,3 +419,3 @@ }; | ||
function _ref12(a) { | ||
function _ref26(a) { | ||
return a(0); | ||
@@ -610,3 +435,3 @@ } | ||
if (f) { | ||
return 0; | ||
return; | ||
} | ||
@@ -617,3 +442,8 @@ f = !0; | ||
if (a.tag) { | ||
return c(a), k ? (k = !1, 0) : g(0); | ||
c(a); | ||
if (k) { | ||
k = !1; | ||
return; | ||
} | ||
return g(0); | ||
} | ||
@@ -624,25 +454,17 @@ g = a = a[0]; | ||
} | ||
return 0; | ||
} | ||
let d = talkbackPlaceholder, f = !1, g = talkbackPlaceholder, h = !1, k = !1, l = !1; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (l) { | ||
return 0; | ||
if (!l && (l = !0, !h)) { | ||
return c(0); | ||
} | ||
l = !0; | ||
return h ? 0 : c(0); | ||
} | ||
if (b.tag) { | ||
if (l) { | ||
return 0; | ||
} else if (b.tag) { | ||
if (!l) { | ||
return h && (g(1), g = talkbackPlaceholder), f ? f = !1 : (f = !0, d(0)), b = a(b[0]), | ||
h = !0, 1 === b.length ? b(e) : b.bind(null, e); | ||
} | ||
h && (g(1), g = talkbackPlaceholder); | ||
f ? f = !1 : (f = !0, d(0)); | ||
b = a(b[0]); | ||
h = !0; | ||
return _1(b, e); | ||
} else { | ||
d = b[0]; | ||
} | ||
d = b[0]; | ||
return 0; | ||
})); | ||
@@ -657,3 +479,2 @@ return c(__(0, [ function(a) { | ||
} | ||
return 0; | ||
} ])); | ||
@@ -664,3 +485,3 @@ }; | ||
function _ref18(a) { | ||
function _ref31(a) { | ||
return a; | ||
@@ -672,13 +493,8 @@ } | ||
return function(c) { | ||
function e() { | ||
return f.shift(); | ||
} | ||
let d = talkbackPlaceholder; | ||
var f = []; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
return makeTrampoline(c, e); | ||
return fromArray(d)(c); | ||
} | ||
if (b.tag) { | ||
return f.length >= a && 0 < a && f.shift(), f.push(b[0]), d(0); | ||
return d.length >= a && 0 < a && d.shift(), d.push(b[0]), f(0); | ||
} | ||
@@ -689,5 +505,7 @@ b = b[0]; | ||
} | ||
d = b; | ||
f = b; | ||
return b(0); | ||
})); | ||
}; | ||
let d = [], f = talkbackPlaceholder; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -703,3 +521,3 @@ }; | ||
if (k) { | ||
return 0; | ||
return; | ||
} | ||
@@ -711,18 +529,13 @@ k = !0; | ||
} | ||
if (a.tag) { | ||
if (k || 0 >= d.length) { | ||
return 0; | ||
} | ||
a = d; | ||
d = []; | ||
return c(__(1, [ a ])); | ||
if (!a.tag) { | ||
g = a[0]; | ||
} else if (!(k || 0 >= d.length)) { | ||
return a = d, d = [], c(__(1, [ a ])); | ||
} | ||
g = a[0]; | ||
return 0; | ||
} | ||
let d = [], f = talkbackPlaceholder, g = talkbackPlaceholder, h = !1, k = !1; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (k) { | ||
return 0; | ||
return; | ||
} | ||
@@ -736,7 +549,8 @@ k = !0; | ||
if (k) { | ||
return 0; | ||
return; | ||
} | ||
d.push(b[0]); | ||
if (h) { | ||
return h = !1, 0; | ||
h = !1; | ||
return; | ||
} | ||
@@ -748,17 +562,13 @@ h = !0; | ||
f = b[0]; | ||
return _1(a, e); | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (k) { | ||
return 0; | ||
if (!k) { | ||
if (a) { | ||
return k = !0, f(1), g(1); | ||
} | ||
if (!h) { | ||
return h = !0, f(0), g(0); | ||
} | ||
} | ||
if (a) { | ||
return k = !0, f(1), g(1); | ||
} | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
f(0); | ||
return g(0); | ||
} ])); | ||
@@ -768,19 +578,20 @@ }; | ||
}, concatMap$1 = concatMap, concatAll$1 = function concatAll(a) { | ||
return concatMap(_ref3)(a); | ||
return concatMap(_ref19)(a); | ||
}, concat$1 = function concat(a) { | ||
return concatMap(_ref4$1)(fromArray(a)); | ||
return concatMap(_ref20)(fromArray(a)); | ||
}, filter$1 = function filter(a) { | ||
return function(b) { | ||
return function(c) { | ||
let e = talkbackPlaceholder; | ||
return _1(b, (function(d) { | ||
if ("number" == typeof d) { | ||
return c(d); | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
return c(b); | ||
} | ||
if (d.tag) { | ||
return a(d[0]) ? c(d) : e(0); | ||
if (b.tag) { | ||
return a(b[0]) ? c(b) : d(0); | ||
} | ||
e = d[0]; | ||
return c(d); | ||
})); | ||
d = b[0]; | ||
return c(b); | ||
}; | ||
let d = talkbackPlaceholder; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -791,20 +602,20 @@ }; | ||
return function(c) { | ||
return _1(b, (function(b) { | ||
b = "number" == typeof b ? 0 : b.tag ? __(1, [ a(b[0]) ]) : __(0, [ b[0] ]); | ||
return c(b); | ||
})); | ||
var e = function(d) { | ||
d = "number" == typeof d ? 0 : d.tag ? __(1, [ a(d[0]) ]) : __(0, [ d[0] ]); | ||
return c(d); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
}; | ||
}, mergeMap$1 = mergeMap, merge$1 = function merge(a) { | ||
return mergeMap(_ref8)(fromArray(a)); | ||
return mergeMap(_ref24)(fromArray(a)); | ||
}, mergeAll$1 = mergeAll, flatten$1 = mergeAll, onEnd$1 = function onEnd(a) { | ||
return function(b) { | ||
return function(c) { | ||
let e = !1; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (e) { | ||
return 0; | ||
if (d) { | ||
return; | ||
} | ||
e = !0; | ||
d = !0; | ||
c(b); | ||
@@ -814,9 +625,13 @@ return a(); | ||
if (b.tag) { | ||
return e ? 0 : c(b); | ||
return d ? void 0 : c(b); | ||
} | ||
var d = b[0]; | ||
return c(__(0, [ function(c) { | ||
return e ? 0 : c ? (e = !0, d(c), a()) : d(c); | ||
var g = b[0]; | ||
return c(__(0, [ function(b) { | ||
if (!d) { | ||
return b ? (d = !0, g(b), a()) : g(b); | ||
} | ||
} ])); | ||
})); | ||
}; | ||
let d = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -827,3 +642,3 @@ }; | ||
return function(c) { | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b || b.tag) { | ||
@@ -834,3 +649,4 @@ return c(b); | ||
return a(); | ||
})); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -842,6 +658,6 @@ }; | ||
let e = talkbackPlaceholder, d = talkbackPlaceholder, f = void 0, g = !1, h = !1; | ||
_1(b, (function(a) { | ||
b((function(a) { | ||
if ("number" == typeof a) { | ||
if (h) { | ||
return 0; | ||
return; | ||
} | ||
@@ -853,46 +669,34 @@ h = !0; | ||
if (a.tag) { | ||
f = some(a[0]); | ||
if (g) { | ||
return g = !1, 0; | ||
if (f = some(a[0]), g) { | ||
g = !1; | ||
} else { | ||
return g = !0, d(0), e(0); | ||
} | ||
g = !0; | ||
d(0); | ||
return e(0); | ||
} else { | ||
e = a[0]; | ||
} | ||
e = a[0]; | ||
return 0; | ||
})); | ||
_1(a, (function(a) { | ||
a((function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
if (h) { | ||
return 0; | ||
if (!h) { | ||
return h = !0, e(1), c(0); | ||
} | ||
h = !0; | ||
e(1); | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (void 0 === b || h) { | ||
return 0; | ||
} else if (a.tag) { | ||
if (void 0 !== b && !h) { | ||
return f = void 0, c(__(1, [ valFromOption(b) ])); | ||
} | ||
f = void 0; | ||
return c(__(1, [ valFromOption(b) ])); | ||
} else { | ||
d = a[0]; | ||
} | ||
d = a[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (h) { | ||
return 0; | ||
if (!h) { | ||
if (a) { | ||
return h = !0, e(1), d(1); | ||
} | ||
if (!g) { | ||
return g = !0, e(0), d(0); | ||
} | ||
} | ||
if (a) { | ||
return h = !0, e(1), d(1); | ||
} | ||
if (g) { | ||
return 0; | ||
} | ||
g = !0; | ||
e(0); | ||
return d(0); | ||
} ])); | ||
@@ -903,6 +707,5 @@ }; | ||
function b(a) { | ||
"number" == typeof a ? (c.forEach(_ref12), c = []) : a.tag ? (d = !1, c.forEach((function b(c) { | ||
return c(a); | ||
"number" == typeof a ? (c.forEach(_ref26), c = []) : a.tag ? (d = !1, c.forEach((function(b) { | ||
return b(a); | ||
}))) : e = a[0]; | ||
return 0; | ||
} | ||
@@ -915,12 +718,11 @@ let c = [], e = talkbackPlaceholder, d = !1; | ||
c = c.concat(f); | ||
1 === c.length && _1(a, b); | ||
1 === c.length && a(b); | ||
return f(__(0, [ function(a) { | ||
if (a) { | ||
return c = c.filter(g), 0 === c.length ? e(1) : 0; | ||
if (c = c.filter(g), 0 === c.length) { | ||
return e(1); | ||
} | ||
} else if (!d) { | ||
return d = !0, e(a); | ||
} | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
return e(a); | ||
} ])); | ||
@@ -931,4 +733,3 @@ }; | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = a; | ||
return _1(b, (function(a) { | ||
var e = function(a) { | ||
if ("number" == typeof a) { | ||
@@ -938,7 +739,9 @@ return c(a); | ||
if (a.tag) { | ||
return 0 < d ? (d = d - 1 | 0, e(0)) : c(a); | ||
return 0 < f ? (f = f - 1 | 0, d(0)) : c(a); | ||
} | ||
e = a[0]; | ||
d = a[0]; | ||
return c(a); | ||
})); | ||
}; | ||
let d = talkbackPlaceholder, f = a; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -951,12 +754,15 @@ }; | ||
if ("number" == typeof a) { | ||
return g ? (k = !0, d(1)) : 0; | ||
if (g) { | ||
return k = !0, d(1); | ||
} | ||
} else { | ||
if (a.tag) { | ||
return g = !1, f(1); | ||
} | ||
f = a = a[0]; | ||
return a(0); | ||
} | ||
if (a.tag) { | ||
return g = !1, f(1); | ||
} | ||
f = a = a[0]; | ||
return a(0); | ||
} | ||
let d = talkbackPlaceholder, f = talkbackPlaceholder, g = !0, h = !1, k = !1; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
@@ -968,3 +774,4 @@ return g && f(1), k = !0, c(0); | ||
if (h) { | ||
return h = !1, 0; | ||
h = !1; | ||
return; | ||
} | ||
@@ -979,17 +786,14 @@ h = !0; | ||
d = b[0]; | ||
return _1(a, e); | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (k) { | ||
return 0; | ||
if (!k) { | ||
if (a) { | ||
if (k = !0, d(1), g) { | ||
return f(1); | ||
} | ||
} else if (!h) { | ||
return h = !0, g && f(0), d(0); | ||
} | ||
} | ||
if (a) { | ||
return k = !0, d(1), g ? f(1) : 0; | ||
} | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
g && f(0); | ||
return d(0); | ||
} ])); | ||
@@ -1001,4 +805,3 @@ }; | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = !0; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
@@ -1008,17 +811,19 @@ return c(b); | ||
if (b.tag) { | ||
if (d) { | ||
if (f) { | ||
if (a(b[0])) { | ||
return e(0); | ||
return d(0); | ||
} | ||
d = !1; | ||
f = !1; | ||
} | ||
return c(b); | ||
} | ||
e = b[0]; | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
}; | ||
let d = talkbackPlaceholder, f = !0; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
}; | ||
}, switchMap$1 = switchMap, switchAll$1 = function switchAll(a) { | ||
return switchMap(_ref18)(a); | ||
return switchMap(_ref31)(a); | ||
}, take$1 = function take(a) { | ||
@@ -1028,6 +833,6 @@ return function(b) { | ||
let e = !1, d = 0, f = talkbackPlaceholder; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (e) { | ||
return 0; | ||
return; | ||
} | ||
@@ -1038,13 +843,22 @@ e = !0; | ||
if (b.tag) { | ||
return d < a && !e && (d = d + 1 | 0, c(b), !e && d >= a) ? (e = !0, c(0), f(1)) : 0; | ||
if (d < a && !e && (d = d + 1 | 0, c(b), !e && d >= a)) { | ||
return e = !0, c(0), f(1); | ||
} | ||
} else { | ||
b = b[0]; | ||
if (0 >= a) { | ||
return e = !0, c(0), b(1); | ||
} | ||
f = b; | ||
} | ||
b = b[0]; | ||
if (0 >= a) { | ||
return e = !0, c(0), b(1); | ||
} | ||
f = b; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(b) { | ||
return e ? 0 : b ? (e = !0, f(1)) : d < a ? f(0) : 0; | ||
if (!e) { | ||
if (b) { | ||
return e = !0, f(1); | ||
} | ||
if (d < a) { | ||
return f(0); | ||
} | ||
} | ||
} ])); | ||
@@ -1057,16 +871,15 @@ }; | ||
function e(a) { | ||
if ("number" == typeof a) { | ||
return 0; | ||
if ("number" != typeof a) { | ||
if (a.tag) { | ||
return d = !0, f(1), c(0); | ||
} | ||
g = a = a[0]; | ||
return a(0); | ||
} | ||
if (a.tag) { | ||
return d = !0, f(1), c(0); | ||
} | ||
g = a = a[0]; | ||
return a(0); | ||
} | ||
let d = !1, f = talkbackPlaceholder, g = talkbackPlaceholder; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return 0; | ||
return; | ||
} | ||
@@ -1078,9 +891,11 @@ d = !0; | ||
if (b.tag) { | ||
return d ? 0 : c(b); | ||
return d ? void 0 : c(b); | ||
} | ||
f = b[0]; | ||
return _1(a, e); | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
})); | ||
return c(__(0, [ function(a) { | ||
return d ? 0 : a ? (d = !0, f(1), g(1)) : f(0); | ||
if (!d) { | ||
return a ? (d = !0, f(1), g(1)) : f(0); | ||
} | ||
} ])); | ||
@@ -1092,14 +907,13 @@ }; | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = !1; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return 0; | ||
if (f) { | ||
return; | ||
} | ||
d = !0; | ||
f = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (d) { | ||
return 0; | ||
if (f) { | ||
return; | ||
} | ||
@@ -1109,9 +923,11 @@ if (a(b[0])) { | ||
} | ||
d = !0; | ||
f = !0; | ||
c(0); | ||
return e(1); | ||
return d(1); | ||
} | ||
e = b[0]; | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
}; | ||
let d = talkbackPlaceholder, f = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -1124,23 +940,22 @@ }; | ||
let c = talkbackPlaceholder, e = !1; | ||
_1(b, (function(b) { | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
return e = !0, 0; | ||
} | ||
if (b.tag) { | ||
if (e) { | ||
return 0; | ||
e = !0; | ||
} else { | ||
if (b.tag) { | ||
if (e) { | ||
return; | ||
} | ||
a(b[0]); | ||
return c(0); | ||
} | ||
a(b[0]); | ||
return c(0); | ||
c = b = b[0]; | ||
return b(0); | ||
} | ||
c = b = b[0]; | ||
return b(0); | ||
})); | ||
return { | ||
unsubscribe: function(a) { | ||
if (e) { | ||
return 0; | ||
if (!e) { | ||
return e = !0, c(1); | ||
} | ||
e = !0; | ||
return c(1); | ||
} | ||
@@ -1151,5 +966,3 @@ }; | ||
function _ref$1(a) { | ||
return 0; | ||
} | ||
function _ref$1(a) {} | ||
@@ -1159,3 +972,2 @@ var subscribe$1 = subscribe, forEach$1 = function forEach(a) { | ||
subscribe(a)(b); | ||
return 0; | ||
}; | ||
@@ -1166,11 +978,12 @@ }, publish$1 = function publish(a) { | ||
let b = [], c = talkbackPlaceholder, e = !1; | ||
_1(a, (function(a) { | ||
a((function(a) { | ||
if ("number" == typeof a) { | ||
return e = !0, 0; | ||
e = !0; | ||
} else { | ||
if (a.tag) { | ||
return b.push(a[0]), c(0); | ||
} | ||
c = a = a[0]; | ||
return a(0); | ||
} | ||
if (a.tag) { | ||
return b.push(a[0]), c(0); | ||
} | ||
c = a = a[0]; | ||
return a(0); | ||
})); | ||
@@ -1183,11 +996,9 @@ e || c(1); | ||
function _ref$2(a) { | ||
return 0; | ||
} | ||
function _ref$2(a) {} | ||
function _ref5(a, b, c) { | ||
function _ref7(a, b, c) { | ||
a.addEventListener(b, c); | ||
} | ||
function _ref6(a, b, c) { | ||
function _ref8(a, b, c) { | ||
a.removeEventListener(b, c); | ||
@@ -1198,9 +1009,11 @@ } | ||
return function(c) { | ||
var e = _ref5, d = _ref6, f = function(a) { | ||
var e = _ref7, d = _ref8, f = function(a) { | ||
return c(__(1, [ a ])); | ||
}; | ||
c(__(0, [ function(c) { | ||
return c ? _3(d, a, b, f) : 0; | ||
if (c) { | ||
return d(a, b, f); | ||
} | ||
} ])); | ||
return _3(e, a, b, f); | ||
return e(a, b, f); | ||
}; | ||
@@ -1222,3 +1035,5 @@ } | ||
return a(__(0, [ function(a) { | ||
return a ? c.unsubscribe() : 0; | ||
if (a) { | ||
return c.unsubscribe(); | ||
} | ||
} ])); | ||
@@ -1230,3 +1045,3 @@ }; | ||
let c = talkbackPlaceholder, d = !1; | ||
_1(a, (function(a) { | ||
a((function(a) { | ||
if ("number" == typeof a) { | ||
@@ -1237,3 +1052,3 @@ return d = !0, b.complete(); | ||
if (d) { | ||
return 0; | ||
return; | ||
} | ||
@@ -1248,7 +1063,5 @@ b.next(a[0]); | ||
unsubscribe: function() { | ||
if (d) { | ||
return 0; | ||
if (!d) { | ||
return d = !0, c(1); | ||
} | ||
d = !0; | ||
return c(1); | ||
} | ||
@@ -1264,11 +1077,11 @@ }; | ||
return function(b) { | ||
return _2(a, 0, (function(a, e) { | ||
var c = function(a, c) { | ||
switch (a) { | ||
case 0: | ||
return b(__(0, [ function c(a) { | ||
return a ? e(2) : e(1); | ||
return b(__(0, [ function d(a) { | ||
return a ? c(2) : c(1); | ||
} ])); | ||
case 1: | ||
return b(__(1, [ e ])); | ||
return b(__(1, [ c ])); | ||
@@ -1278,19 +1091,17 @@ case 2: | ||
} | ||
})); | ||
}; | ||
return 2 === a.length ? a(0, c) : a.bind(null, 0, c); | ||
}; | ||
}, toCallbag$2 = function toCallbag(a) { | ||
return function(b, c) { | ||
return 0 === b ? _1(a, (function e(a) { | ||
function e(a) { | ||
if ("number" == typeof a) { | ||
return _2(c, 2, 0); | ||
return 2 === c.length ? c(2, void 0) : c.bind(null, 2, void 0); | ||
} | ||
if (a.tag) { | ||
return _2(c, 1, a[0]); | ||
return a = a[0], 2 === c.length ? c(1, a) : c.bind(null, 1, a); | ||
} | ||
var b = a[0]; | ||
return _2(c, 0, (function(a) { | ||
a = function(a) { | ||
switch (a) { | ||
case 0: | ||
return 0; | ||
case 1: | ||
@@ -1302,4 +1113,8 @@ return b(0); | ||
} | ||
})); | ||
})) : 0; | ||
}; | ||
return 2 === c.length ? c(0, a) : c.bind(null, 0, a); | ||
} | ||
if (0 === b) { | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
} | ||
}; | ||
@@ -1309,27 +1124,36 @@ }, debounce$1 = function debounce(a) { | ||
return function(c) { | ||
let e = void 0, d = !1, f = !1; | ||
var g = function(a) { | ||
void 0 !== (a = e) && (e = void 0, clearTimeout(valFromOption(a))); | ||
return 0; | ||
}; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (f) { | ||
return 0; | ||
if (g) { | ||
return; | ||
} | ||
f = !0; | ||
return void 0 !== e ? (d = !0, 0) : c(0); | ||
g = !0; | ||
if (void 0 !== d) { | ||
f = !0; | ||
return; | ||
} | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
return f || (g(), e = some(setTimeout((function h(a) { | ||
e = void 0; | ||
g || (h(), d = some(setTimeout((function e(a) { | ||
d = void 0; | ||
c(b); | ||
return d ? c(0) : 0; | ||
}), a(b[0])))), 0; | ||
if (f) { | ||
return c(0); | ||
} | ||
}), a(b[0])))); | ||
} else { | ||
var k = b[0]; | ||
return c(__(0, [ function(a) { | ||
if (!g) { | ||
return a ? (g = !0, f = !1, h(), k(1)) : k(0); | ||
} | ||
} ])); | ||
} | ||
var l = b[0]; | ||
return c(__(0, [ function(a) { | ||
return f ? 0 : a ? (f = !0, d = !1, g(), l(1)) : l(0); | ||
} ])); | ||
})); | ||
}; | ||
let d = void 0, f = !1, g = !1; | ||
var h = function(a) { | ||
void 0 !== (a = d) && (d = void 0, clearTimeout(valFromOption(a))); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -1340,13 +1164,15 @@ }; | ||
return function(c) { | ||
let e = 0; | ||
return _1(b, (function(b) { | ||
var e = function(b) { | ||
if ("number" != typeof b && !b.tag) { | ||
return c(b); | ||
} | ||
e = e + 1 | 0; | ||
d = d + 1 | 0; | ||
setTimeout((function(a) { | ||
return 0 !== e ? (e = e - 1 | 0, c(b)) : 0; | ||
if (0 !== d) { | ||
return d = d - 1 | 0, c(b); | ||
} | ||
}), a); | ||
return 0; | ||
})); | ||
}; | ||
let d = 0; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
}; | ||
@@ -1358,29 +1184,28 @@ }; | ||
function e(a) { | ||
f = void 0; | ||
d = !1; | ||
return 0; | ||
g = void 0; | ||
f = !1; | ||
} | ||
let d = !1, f = void 0; | ||
var g = function(a) { | ||
void 0 !== (a = f) && clearTimeout(valFromOption(a)); | ||
return 0; | ||
}; | ||
return _1(b, (function(b) { | ||
var d = function(b) { | ||
if ("number" == typeof b) { | ||
return g(), c(0); | ||
return h(), c(0); | ||
} | ||
if (b.tag) { | ||
if (d) { | ||
return 0; | ||
if (f) { | ||
return; | ||
} | ||
d = !0; | ||
g(); | ||
f = some(setTimeout(e, a(b[0]))); | ||
f = !0; | ||
h(); | ||
g = some(setTimeout(e, a(b[0]))); | ||
return c(b); | ||
} | ||
var h = b[0]; | ||
var d = b[0]; | ||
return c(__(0, [ function(a) { | ||
return a ? (g(), h(1)) : h(a); | ||
return a ? (h(), d(1)) : d(a); | ||
} ])); | ||
})); | ||
}; | ||
let f = !1, g = void 0; | ||
var h = function(a) { | ||
void 0 !== (a = g) && clearTimeout(valFromOption(a)); | ||
}; | ||
return 1 === b.length ? b(d) : b.bind(null, d); | ||
}; | ||
@@ -1390,5 +1215,8 @@ }; | ||
return new Promise((function(b, c) { | ||
return _1(takeLast(1)(a), (function(a) { | ||
return "number" == typeof a ? 0 : a.tag ? b(a[0]) : a[0](0); | ||
})); | ||
c = function(a) { | ||
if ("number" != typeof a) { | ||
return a.tag ? b(a[0]) : a[0](0); | ||
} | ||
}; | ||
return 1 === takeLast(1)(a).length ? takeLast(1)(a)(c) : takeLast(1)(a).bind(null, c); | ||
})); | ||
@@ -1405,3 +1233,2 @@ }, interval$1 = function interval(a) { | ||
a && clearInterval(e); | ||
return 0; | ||
} ])); | ||
@@ -1414,7 +1241,6 @@ }; | ||
c || (b(__(1, [ a ])), b(0)); | ||
return Promise.resolve(0); | ||
return Promise.resolve(void 0); | ||
})); | ||
return b(__(0, [ function(a) { | ||
a && (c = !0); | ||
return 0; | ||
} ])); | ||
@@ -1427,3 +1253,3 @@ }; | ||
exports.combine = function(a, b) { | ||
return _2(combine, a, b); | ||
return 2 === combine.length ? combine(a, b) : combine.bind(null, a, b); | ||
}; | ||
@@ -1454,3 +1280,3 @@ | ||
exports.fromDomEvent = function(a, b) { | ||
return _2(fromDomEvent, a, b); | ||
return 2 === fromDomEvent.length ? fromDomEvent(a, b) : fromDomEvent.bind(null, a, b); | ||
}; | ||
@@ -1500,3 +1326,3 @@ | ||
exports.scan = function(a, b) { | ||
return _2(scan, a, b); | ||
return 2 === scan.length ? scan(a, b) : scan.bind(null, a, b); | ||
}; | ||
@@ -1503,0 +1329,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function n(n,t){return t.tag=n,t}var t=[];function r(n){return void 0===n?((n=[t,0]).tag=256,n):(null!==n&&n[0]===t&&((n=[t,n[1]+1|0]).tag=256),n)}function u(n){return null===n||n[0]!==t?n:0!==(n=n[1])?[t,n-1|0]:void 0}function e(n){return 0}function o(t,r){let e=!1,o=!1,f=!1;return t(n(0,[function(i){if(i)e=!0;else if(o)f=!0;else{for(o=f=!0;f&&!e;)void 0!==(i=r())?(f=!1,t(n(1,[u(i)]))):(e=!0,t(0));o=!1}return 0}]))}function f(n){return function(t){var u=n.length;let e=0;return o(t,(function(){if(e<u){var t=n[e];return e=e+1|0,r(t)}}))}}function i(){return 0}function c(n){return n(0)}function a(t){let r=!1;return t(n(0,[function(n){return n?(r=!0,0):r?0:t(0)}]))}var s=f,l=a;function p(n,t,r){for(var u=Array(r),e=0;e<r;)u[e]=n[t],e=e+1|0,t=t+1|0;return u}function b(n,t){for(;;){var r=t,u=0===(t=n.length)?1:t;if(0==(t=u-r.length|0))return n.apply(null,r);if(!(0>t))return function(n,t){return function(r){return b(n,t.concat([r]))}}(n,r);t=p(r,u,0|-t),n=n.apply(null,p(r,0,u))}}function m(n,t){var r=n.length;return 1===r?n(t):function(n,t,r){switch(r){case 1:return n(t);case 2:return function(r){return n(t,r)};case 3:return function(r,u){return n(t,r,u)};case 4:return function(r,u,e){return n(t,r,u,e)};case 5:return function(r,u,e,o){return n(t,r,u,e,o)};case 6:return function(r,u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(r,u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t])}}(n,t,r)}function v(n,t,r){var u=n.length;return 2===u?n(t,r):function(n,t,r,u){switch(u){case 1:return b(n(t),[r]);case 2:return n(t,r);case 3:return function(u){return n(t,r,u)};case 4:return function(u,e){return n(t,r,u,e)};case 5:return function(u,e,o){return n(t,r,u,e,o)};case 6:return function(u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t,r])}}(n,t,r,u)}function g(n,t,r,u){var e=n.length;return 3===e?n(t,r,u):function(n,t,r,u,e){switch(e){case 1:return b(n(t),[r,u]);case 2:return b(n(t,r),[u]);case 3:return n(t,r,u);case 4:return function(e){return n(t,r,u,e)};case 5:return function(e,o){return n(t,r,u,e,o)};case 6:return function(e,o,f){return n(t,r,u,e,o,f)};case 7:return function(e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t,r,u])}}(n,t,r,u,e)}function x(t,o){return function(f){let i=e,c=e,a=void 0,s=void 0,l=!1,p=0,b=!1;return m(t,(function(t){var e=s;return"number"==typeof t?1>p?(p=p+1|0,0):b?0:(b=!0,f(0)):t.tag?(t=t[0],void 0!==e?b?0:(a=r(t),l=!1,f(n(1,[[t,u(e)]]))):(a=r(t),l?(l=!1,0):c(0))):(i=t[0],0)})),m(o,(function(t){var e=a;return"number"==typeof t?1>p?(p=p+1|0,0):b?0:(b=!0,f(0)):t.tag?(t=t[0],void 0!==e?b?0:(s=r(t),l=!1,f(n(1,[[u(e),t]]))):(s=r(t),l?(l=!1,0):i(0))):(c=t[0],0)})),f(n(0,[function(n){return b?0:n?(b=!0,i(1),c(1)):l?0:(l=!0,i(n),c(n))}]))}}function y(t){return function(r){return function(o){function f(n){return"number"==typeof n?l?(l=!1,void 0!==(n=i.shift())?v(t(u(n))):b?o(0):a?0:(a=!0,c(0))):0:n.tag?l?(o(n),p?(p=!1,0):s(0)):0:(s=n=n[0],p=!1,n(0))}let i=[],c=e,a=!1,s=e,l=!1,p=!1,b=!1;var v=function(n){return l=!0,m(n,f)};return m(r,(function(n){return"number"==typeof n?b?0:(b=!0,!l&&function(n){return 0===n.length}(i)?o(0):0):n.tag?b?0:(n=n[0],a=!1,l?(i.push(n),0):v(t(n))):(c=n[0],0)})),o(n(0,[function(n){if(n){if(b||(b=!0,c(1)),l)return l=!1,s(1)}else if(b||a||(a=!0,c(0)),l&&!p)return p=!0,s(0);return 0}]))}}}function h(n){return n}function d(n){return n}function E(n){return n(0)}function k(t){return function(r){return function(u){let o=e,f=!1,i=[],c=!1;return m(r,(function(r){return"number"==typeof r?c?0:(c=!0,0===i.length?u(0):0):r.tag?c?0:(f=!1,function(t){function r(n){return n!==a}let a=e;m(t,(function(t){if("number"==typeof t){if(0!==i.length){if(i=i.filter(r),t=0===i.length,c&&t)return u(0);if(!f&&t)return f=!0,o(0)}return 0}return t.tag?0!==i.length?(u(n(1,[t[0]])),a(0)):0:(a=t=t[0],i=i.concat(t),t(0))}))}(t(r[0])),f?0:(f=!0,o(0))):(o=r[0],0)})),u(n(0,[function(n){return n?(c||(c=!0,o(n)),i.forEach((function(t){return t(n)})),i=[]):(f||c?f=!1:(f=!0,o(0)),i.forEach(E)),0}]))}}}function w(n){return n}function A(n){return n}function S(n){return k(A)(n)}function P(t){return function(r){return function(u){let e=!1;return m(r,(function(r){if("number"==typeof r)return e?0:(e=!0,u(r));if(r.tag)return e?0:(t(r[0]),u(r));var o=r[0];return u(n(0,[function(n){return e?0:(n&&(e=!0),o(n))}]))}))}}}function T(t,r){return function(u){return function(e){let o=r;return m(u,(function(r){return"number"==typeof r?r=0:r.tag?(o=t(o,r[0]),r=n(1,[o])):r=n(0,[r[0]]),e(r)}))}}}function L(n){return n(0)}function M(t){return function(r){return function(u){function o(n){return a?"number"==typeof n?(a=!1,l?u(n):i?0:(i=!0,f(0))):n.tag?(u(n),s?(s=!1,0):c(0)):(c=n=n[0],s=!1,n(0)):0}let f=e,i=!1,c=e,a=!1,s=!1,l=!1;return m(r,(function(n){return"number"==typeof n?l?0:(l=!0,a?0:u(0)):n.tag?l?0:(a&&(c(1),c=e),i?i=!1:(i=!0,f(0)),n=t(n[0]),a=!0,m(n,o)):(f=n[0],0)})),u(n(0,[function(n){if(n){if(l||(l=!0,f(1)),a)return a=!1,c(1)}else if(l||i||(i=!0,f(0)),a&&!s)return s=!0,c(0);return 0}]))}}}function C(n){return n}function I(n){return function(t){return function(r){function u(){return i.shift()}let f=e;var i=[];return m(t,(function(t){return"number"==typeof t?o(r,u):t.tag?(i.length>=n&&0<n&&i.shift(),i.push(t[0]),f(0)):(t=t[0],0>=n?(t(1),a(r)):(f=t,t(0)))}))}}}var O=y,U=k,W=S,j=S,D=P,V=P,q=M,z=I;function B(n){return function(t){let r=e,u=!1;return m(t,(function(t){return"number"==typeof t?(u=!0,0):t.tag?u?0:(n(t[0]),r(0)):(r=t=t[0],t(0))})),{unsubscribe:function(n){return u?0:(u=!0,r(1))}}}}function F(n){return 0}var G=B,H="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function J(n){return 0}function K(n,t,r){n.addEventListener(t,r)}function N(n,t,r){n.removeEventListener(t,r)}function Q(t,r){return function(u){var e=K,o=N,f=function(t){return u(n(1,[t]))};return u(n(0,[function(n){return n?g(o,t,r,f):0}])),g(e,t,r,f)}}exports.buffer=function(t){return function(r){return function(u){function o(t){return"number"==typeof t?s?0:(s=!0,i(1),0<f.length&&u(n(1,[f])),u(0)):t.tag?s||0>=f.length?0:(t=f,f=[],u(n(1,[t]))):(c=t[0],0)}let f=[],i=e,c=e,a=!1,s=!1;return m(r,(function(r){return"number"==typeof r?s?0:(s=!0,c(1),0<f.length&&u(n(1,[f])),u(0)):r.tag?s?0:(f.push(r[0]),a?(a=!1,0):(a=!0,i(0),c(0))):(i=r[0],m(t,o))})),u(n(0,[function(n){return s?0:n?(s=!0,i(1),c(1)):a?0:(a=!0,i(0),c(0))}]))}}},exports.combine=function(n,t){return v(x,n,t)},exports.concat=function(n){return y(d)(f(n))},exports.concatAll=function(n){return y(h)(n)},exports.concatMap=O,exports.debounce=function(t){return function(e){return function(o){let f=void 0,i=!1,c=!1;var a=function(n){return void 0!==(n=f)&&(f=void 0,clearTimeout(u(n))),0};return m(e,(function(u){if("number"==typeof u)return c?0:(c=!0,void 0!==f?(i=!0,0):o(0));if(u.tag)return c||(a(),f=r(setTimeout((function(n){return f=void 0,o(u),i?o(0):0}),t(u[0])))),0;var e=u[0];return o(n(0,[function(n){return c?0:n?(c=!0,i=!1,a(),e(1)):e(0)}]))}))}}},exports.delay=function(n){return function(t){return function(r){let u=0;return m(t,(function(t){return"number"==typeof t||t.tag?(u=u+1|0,setTimeout((function(n){return 0!==u?(u=u-1|0,r(t)):0}),n),0):r(t)}))}}},exports.empty=l,exports.filter=function(n){return function(t){return function(r){let u=e;return m(t,(function(t){return"number"==typeof t?r(t):t.tag?n(t[0])?r(t):u(0):(u=t[0],r(t))}))}}},exports.flatten=j,exports.forEach=function(n){return function(t){return B(n)(t),0}},exports.fromArray=s,exports.fromCallbag=function(t){return function(r){return v(t,0,(function(t,u){switch(t){case 0:return r(n(0,[function(n){return u(n?2:1)}]));case 1:return r(n(1,[u]));case 2:return r(0)}}))}},exports.fromDomEvent=function(n,t){return v(Q,n,t)},exports.fromList=function(n){return function(t){let u=n;return o(t,(function(){var n=u;if(n)return u=n[1],r(n[0])}))}},exports.fromObservable=function(t){var r=void 0!==t[H]?t[H]():t;return function(t){var u=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:J});return t(n(0,[function(n){return n?u.unsubscribe():0}]))}},exports.fromPromise=function(t){return function(r){let u=!1;return t.then((function(t){return u||(r(n(1,[t])),r(0)),Promise.resolve(0)})),r(n(0,[function(n){return n&&(u=!0),0}]))}},exports.fromValue=function(t){return function(r){let u=!1;return r(n(0,[function(e){return e?(u=!0,0):u?0:(u=!0,r(n(1,[t])),r(0))}]))}},exports.interval=function(t){return function(r){let u=0;var e=setInterval((function(t){return t=u,u=u+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){return n&&clearInterval(e),0}]))}},exports.make=function(t){return function(r){let u=i,e=!1;return u=t({next:function(t){return e?0:r(n(1,[t]))},complete:function(n){return e?0:(e=!0,r(0))}}),r(n(0,[function(n){return n&&!e?(e=!0,u()):0}]))}},exports.makeSubject=function(t){let r=[],u=!1;return{source:function(t){function u(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){return n&&(r=r.filter(u)),0}]))},next:function(t){return u||r.forEach((function(r){return r(n(1,[t]))})),0},complete:function(n){return u||(u=!0,r.forEach(c)),0}}},exports.map=function(t){return function(r){return function(u){return m(r,(function(r){return r="number"==typeof r?0:r.tag?n(1,[t(r[0])]):n(0,[r[0]]),u(r)}))}}},exports.merge=function(n){return k(w)(f(n))},exports.mergeAll=W,exports.mergeMap=U,exports.never=function(t){return t(n(0,[e]))},exports.onEnd=function(t){return function(r){return function(u){let e=!1;return m(r,(function(r){if("number"==typeof r)return e?0:(e=!0,u(r),t());if(r.tag)return e?0:u(r);var o=r[0];return u(n(0,[function(n){return e?0:n?(e=!0,o(n),t()):o(n)}]))}))}}},exports.onPush=D,exports.onStart=function(n){return function(t){return function(r){return m(t,(function(t){return"number"==typeof t||t.tag?r(t):(r(t),n())}))}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],r=1,u=arguments.length;r<u;r++)t=n[r](t);return t},exports.publish=function(n){return B(F)(n)},exports.sample=function(t){return function(o){return function(f){let i=e,c=e,a=void 0,s=!1,l=!1;return m(o,(function(n){return"number"==typeof n?l?0:(l=!0,c(1),f(0)):n.tag?(a=r(n[0]),s?(s=!1,0):(s=!0,c(0),i(0))):(i=n[0],0)})),m(t,(function(t){var r=a;return"number"==typeof t?l?0:(l=!0,i(1),f(0)):t.tag?void 0===r||l?0:(a=void 0,f(n(1,[u(r)]))):(c=t[0],0)})),f(n(0,[function(n){return l?0:n?(l=!0,i(1),c(1)):s?0:(s=!0,i(0),c(0))}]))}}},exports.scan=function(n,t){return v(T,n,t)},exports.share=function(t){function r(n){return"number"==typeof n?(u.forEach(L),u=[]):n.tag?(f=!1,u.forEach((function(t){return t(n)}))):o=n[0],0}let u=[],o=e,f=!1;return function(e){function i(n){return n!==e}return u=u.concat(e),1===u.length&&m(t,r),e(n(0,[function(n){return n?(u=u.filter(i),0===u.length?o(1):0):f?0:(f=!0,o(n))}]))}},exports.skip=function(n){return function(t){return function(r){let u=e,o=n;return m(t,(function(n){return"number"==typeof n?r(n):n.tag?0<o?(o=o-1|0,u(0)):r(n):(u=n[0],r(n))}))}}},exports.skipUntil=function(t){return function(r){return function(u){function o(n){return"number"==typeof n?c?(s=!0,f(1)):0:n.tag?(c=!1,i(1)):(i=n=n[0],n(0))}let f=e,i=e,c=!0,a=!1,s=!1;return m(r,(function(n){return"number"==typeof n?(c&&i(1),s=!0,u(0)):n.tag?c||s?a?(a=!1,0):(a=!0,f(0),i(0)):(a=!1,u(n)):(f=n[0],m(t,o))})),u(n(0,[function(n){return s?0:n?(s=!0,f(1),c?i(1):0):a?0:(a=!0,c&&i(0),f(0))}]))}}},exports.skipWhile=function(n){return function(t){return function(r){let u=e,o=!0;return m(t,(function(t){if("number"==typeof t)return r(t);if(t.tag){if(o){if(n(t[0]))return u(0);o=!1}return r(t)}return u=t[0],r(t)}))}}},exports.subscribe=G,exports.switchAll=function(n){return M(C)(n)},exports.switchMap=q,exports.take=function(t){return function(r){return function(u){let o=!1,f=0,i=e;return m(r,(function(n){return"number"==typeof n?o?0:(o=!0,u(0)):n.tag?f<t&&!o&&(f=f+1|0,u(n),!o&&f>=t)?(o=!0,u(0),i(1)):0:(n=n[0],0>=t?(o=!0,u(0),n(1)):(i=n,0))})),u(n(0,[function(n){return o?0:n?(o=!0,i(1)):f<t?i(0):0}]))}}},exports.takeLast=z,exports.takeUntil=function(t){return function(r){return function(u){function o(n){return"number"==typeof n?0:n.tag?(f=!0,i(1),u(0)):(c=n=n[0],n(0))}let f=!1,i=e,c=e;return m(r,(function(n){return"number"==typeof n?f?0:(f=!0,c(1),u(0)):n.tag?f?0:u(n):(i=n[0],m(t,o))})),u(n(0,[function(n){return f?0:n?(f=!0,i(1),c(1)):i(0)}]))}}},exports.takeWhile=function(n){return function(t){return function(r){let u=e,o=!1;return m(t,(function(t){return"number"==typeof t?o?0:(o=!0,r(0)):t.tag?o?0:n(t[0])?r(t):(o=!0,r(0),u(1)):(u=t[0],r(t))}))}}},exports.tap=V,exports.throttle=function(t){return function(e){return function(o){function f(n){return c=void 0,i=!1,0}let i=!1,c=void 0;var a=function(n){return void 0!==(n=c)&&clearTimeout(u(n)),0};return m(e,(function(u){if("number"==typeof u)return a(),o(0);if(u.tag)return i?0:(i=!0,a(),c=r(setTimeout(f,t(u[0]))),o(u));var e=u[0];return o(n(0,[function(n){return n?(a(),e(1)):e(n)}]))}))}}},exports.toArray=function(n){let t=[],r=e,u=!1;return m(n,(function(n){return"number"==typeof n?(u=!0,0):n.tag?(t.push(n[0]),r(0)):(r=n=n[0],n(0))})),u||r(1),t},exports.toCallbag=function(n){return function(t,r){return 0===t?m(n,(function(n){if("number"==typeof n)return v(r,2,0);if(n.tag)return v(r,1,n[0]);var t=n[0];return v(r,0,(function(n){switch(n){case 0:return 0;case 1:return t(0);case 2:return t(1)}}))})):0}},exports.toObservable=function(n){var t={subscribe:function(t){let r=e,u=!1;return m(n,(function(n){return"number"==typeof n?(u=!0,t.complete()):n.tag?u?0:(t.next(n[0]),r(0)):(r=n=n[0],n(0))})),{unsubscribe:function(){return u?0:(u=!0,r(1))}}}};return t[H]=function(n){return t},t},exports.toPromise=function(n){return new Promise((function(t,r){return m(I(1)(n),(function(n){return"number"==typeof n?0:n.tag?t(n[0]):n[0](0)}))}))}; | ||
"use strict";function n(n,t){return t.tag=n,t}function t(n){}function r(t){return function(r){var e=t.length;let u=!1,i=!1,f=!1,o=0;return r(n(0,[function(c){if(c)u=!0;else if(i)f=!0;else{for(i=f=!0;f&&!u;)o<e?(c=t[o],o=o+1|0,f=!1,r(n(1,[c]))):(u=!0,r(0));i=!1}}]))}}function e(){}function u(n){return n(0)}function i(t){let r=!1;return t(n(0,[function(n){if(n)r=!0;else if(!r)return t(0)}]))}var f=r,o=i,c=[];function l(n){return void 0===n?((n=[c,0]).tag=256,n):(null===n||n[0]!==c||((n=[c,n[1]+1|0]).tag=256),n)}function s(n){return null===n||n[0]!==c?n:0!==(n=n[1])?[c,n-1|0]:void 0}function a(r,e){return function(u){let i=t,f=t,o=void 0,c=void 0,a=!1,p=0,b=!1;return r((function(t){var r=c;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return o=l(t),a=!1,u(n(1,[[t,s(r)]]))}else{if(o=l(t),!a)return f(0);a=!1}else i=t[0]})),e((function(t){var r=o;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return c=l(t),a=!1,u(n(1,[[s(r),t]]))}else{if(c=l(t),!a)return i(0);a=!1}else f=t[0]})),u(n(0,[function(n){if(!b){if(n)return b=!0,i(1),f(1);if(!a)return a=!0,i(n),f(n)}}]))}}function p(r){return function(e){return function(u){function i(n){if("number"==typeof n){if(!a)return;if(a=!1,void 0!==(n=f.shift()))return g(r(s(n)));if(b)return u(0);if(c)return;return c=!0,o(0)}if(!n.tag)return l=n=n[0],p=!1,n(0);if(a){if(u(n),!p)return l(0);p=!1}}let f=[],o=t,c=!1,l=t,a=!1,p=!1,b=!1;var g=function(n){return a=!0,1===n.length?n(i):n.bind(null,i)};return e((function(n){if("number"==typeof n){if(!b&&(b=!0,!a&&function(n){return 0===n.length}(f)))return u(0)}else if(n.tag){if(!b){if(n=n[0],c=!1,!a)return g(r(n));f.push(n)}}else o=n[0]})),u(n(0,[function(n){if(n){if(b||(b=!0,o(1)),a)return a=!1,l(1)}else if(b||c||(c=!0,o(0)),a&&!p)return p=!0,l(0)}]))}}}function b(n){return n}function g(n){return n}function v(n){return n(0)}function m(r){return function(e){return function(u){let i=t,f=!1,o=[],c=!1;return e((function(e){if("number"==typeof e){if(!c&&(c=!0,0===o.length))return u(0)}else if(e.tag){if(!c&&(f=!1,function(r){function e(n){return n!==s}var l=function(t){if("number"==typeof t){if(0!==o.length){if(o=o.filter(e),t=0===o.length,c&&t)return u(0);if(!f&&t)return f=!0,i(0)}}else{if(!t.tag)return s=t=t[0],o=o.concat(t),t(0);if(0!==o.length)return u(n(1,[t[0]])),s(0)}};let s=t;1===r.length?r(l):r.bind(null,l)}(r(e[0])),!f))return f=!0,i(0)}else i=e[0]})),u(n(0,[function(n){n?(c||(c=!0,i(n)),o.forEach((function(t){return t(n)})),o=[]):(f||c?f=!1:(f=!0,i(0)),o.forEach(v))}]))}}}function h(n){return n}function d(n){return n}function x(n){return m(d)(n)}function y(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(i)return;return i=!0,e(r)}if(r.tag){if(i)return;return t(r[0]),e(r)}var u=r[0];return e(n(0,[function(n){if(!i)return n&&(i=!0),u(n)}]))};let i=!1;return 1===r.length?r(u):r.bind(null,u)}}}function E(t,r){return function(e){return function(u){var i=function(r){return"number"==typeof r?r=0:r.tag?(f=t(f,r[0]),r=n(1,[f])):r=n(0,[r[0]]),u(r)};let f=r;return 1===e.length?e(i):e.bind(null,i)}}}function k(n){return n(0)}function S(r){return function(e){return function(u){function i(n){if(l){if("number"==typeof n){if(l=!1,a)return u(n);if(o)return;return o=!0,f(0)}return n.tag?(u(n),s?void(s=!1):c(0)):(c=n=n[0],s=!1,n(0))}}let f=t,o=!1,c=t,l=!1,s=!1,a=!1;return e((function(n){if("number"==typeof n){if(!a&&(a=!0,!l))return u(0)}else if(n.tag){if(!a)return l&&(c(1),c=t),o?o=!1:(o=!0,f(0)),n=r(n[0]),l=!0,1===n.length?n(i):n.bind(null,i)}else f=n[0]})),u(n(0,[function(n){if(n){if(a||(a=!0,f(1)),l)return l=!1,c(1)}else if(a||o||(o=!0,f(0)),l&&!s)return s=!0,c(0)}]))}}}function w(n){return n}function A(n){return function(e){return function(u){var f=function(t){return"number"==typeof t?r(o)(u):t.tag?(o.length>=n&&0<n&&o.shift(),o.push(t[0]),c(0)):(t=t[0],0>=n?(t(1),i(u)):(c=t,t(0)))};let o=[],c=t;return 1===e.length?e(f):e.bind(null,f)}}}var P=p,T=m,L=x,M=x,C=y,I=y,O=S,U=A;function W(n){return function(r){let e=t,u=!1;return r((function(t){if("number"!=typeof t){if(t.tag){if(u)return;return n(t[0]),e(0)}return e=t=t[0],t(0)}u=!0})),{unsubscribe:function(n){if(!u)return u=!0,e(1)}}}}function j(n){}var D=W,V="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function q(n){}function z(n,t,r){n.addEventListener(t,r)}function B(n,t,r){n.removeEventListener(t,r)}function F(t,r){return function(e){var u=z,i=B,f=function(t){return e(n(1,[t]))};return e(n(0,[function(n){if(n)return i(t,r,f)}])),u(t,r,f)}}exports.buffer=function(r){return function(e){return function(u){function i(t){if("number"==typeof t){if(s)return;return s=!0,o(1),0<f.length&&u(n(1,[f])),u(0)}if(t.tag){if(!(s||0>=f.length))return t=f,f=[],u(n(1,[t]))}else c=t[0]}let f=[],o=t,c=t,l=!1,s=!1;return e((function(t){if("number"==typeof t){if(s)return;return s=!0,c(1),0<f.length&&u(n(1,[f])),u(0)}if(t.tag){if(s)return;return f.push(t[0]),l?void(l=!1):(l=!0,o(0),c(0))}return o=t[0],1===r.length?r(i):r.bind(null,i)})),u(n(0,[function(n){if(!s){if(n)return s=!0,o(1),c(1);if(!l)return l=!0,o(0),c(0)}}]))}}},exports.combine=function(n,t){return 2===a.length?a(n,t):a.bind(null,n,t)},exports.concat=function(n){return p(g)(r(n))},exports.concatAll=function(n){return p(b)(n)},exports.concatMap=P,exports.debounce=function(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(o)return;return o=!0,void 0!==i?void(f=!0):e(0)}if(!r.tag){var u=r[0];return e(n(0,[function(n){if(!o)return n?(o=!0,f=!1,c(),u(1)):u(0)}]))}o||(c(),i=l(setTimeout((function(n){if(i=void 0,e(r),f)return e(0)}),t(r[0]))))};let i=void 0,f=!1,o=!1;var c=function(n){void 0!==(n=i)&&(i=void 0,clearTimeout(s(n)))};return 1===r.length?r(u):r.bind(null,u)}}},exports.delay=function(n){return function(t){return function(r){var e=function(t){if("number"!=typeof t&&!t.tag)return r(t);u=u+1|0,setTimeout((function(n){if(0!==u)return u=u-1|0,r(t)}),n)};let u=0;return 1===t.length?t(e):t.bind(null,e)}}},exports.empty=o,exports.filter=function(n){return function(r){return function(e){var u=function(t){return"number"==typeof t?e(t):t.tag?n(t[0])?e(t):i(0):(i=t[0],e(t))};let i=t;return 1===r.length?r(u):r.bind(null,u)}}},exports.flatten=M,exports.forEach=function(n){return function(t){W(n)(t)}},exports.fromArray=f,exports.fromCallbag=function(t){return function(r){var e=function(t,e){switch(t){case 0:return r(n(0,[function(n){return e(n?2:1)}]));case 1:return r(n(1,[e]));case 2:return r(0)}};return 2===t.length?t(0,e):t.bind(null,0,e)}},exports.fromDomEvent=function(n,t){return 2===F.length?F(n,t):F.bind(null,n,t)},exports.fromList=function(t){return function(r){let e=!1,u=!1,i=!1,f=t;return r(n(0,[function(t){if(t)e=!0;else if(u)i=!0;else{for(u=i=!0;i&&!e;)(t=f)?(f=t[1],i=!1,r(n(1,[t[0]]))):(e=!0,r(0));u=!1}}]))}},exports.fromObservable=function(t){var r=void 0!==t[V]?t[V]():t;return function(t){var e=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:q});return t(n(0,[function(n){if(n)return e.unsubscribe()}]))}},exports.fromPromise=function(t){return function(r){let e=!1;return t.then((function(t){return e||(r(n(1,[t])),r(0)),Promise.resolve(void 0)})),r(n(0,[function(n){n&&(e=!0)}]))}},exports.fromValue=function(t){return function(r){let e=!1;return r(n(0,[function(u){if(u)e=!0;else if(!e)return e=!0,r(n(1,[t])),r(0)}]))}},exports.interval=function(t){return function(r){let e=0;var u=setInterval((function(t){return t=e,e=e+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){n&&clearInterval(u)}]))}},exports.make=function(t){return function(r){let u=e,i=!1;return u=t({next:function(t){if(!i)return r(n(1,[t]))},complete:function(n){if(!i)return i=!0,r(0)}}),r(n(0,[function(n){if(n&&!i)return i=!0,u()}]))}},exports.makeSubject=function(t){let r=[],e=!1;return{source:function(t){function e(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){n&&(r=r.filter(e))}]))},next:function(t){e||r.forEach((function(r){return r(n(1,[t]))}))},complete:function(n){e||(e=!0,r.forEach(u))}}},exports.map=function(t){return function(r){return function(e){var u=function(r){return r="number"==typeof r?0:r.tag?n(1,[t(r[0])]):n(0,[r[0]]),e(r)};return 1===r.length?r(u):r.bind(null,u)}}},exports.merge=function(n){return m(h)(r(n))},exports.mergeAll=L,exports.mergeMap=T,exports.never=function(r){return r(n(0,[t]))},exports.onEnd=function(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(i)return;return i=!0,e(r),t()}if(r.tag)return i?void 0:e(r);var u=r[0];return e(n(0,[function(n){if(!i)return n?(i=!0,u(n),t()):u(n)}]))};let i=!1;return 1===r.length?r(u):r.bind(null,u)}}},exports.onPush=C,exports.onStart=function(n){return function(t){return function(r){var e=function(t){return"number"==typeof t||t.tag?r(t):(r(t),n())};return 1===t.length?t(e):t.bind(null,e)}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],r=1,e=arguments.length;r<e;r++)t=n[r](t);return t},exports.publish=function(n){return W(j)(n)},exports.sample=function(r){return function(e){return function(u){let i=t,f=t,o=void 0,c=!1,a=!1;return e((function(n){if("number"==typeof n){if(a)return;return a=!0,f(1),u(0)}if(n.tag){if(o=l(n[0]),!c)return c=!0,f(0),i(0);c=!1}else i=n[0]})),r((function(t){var r=o;if("number"==typeof t){if(!a)return a=!0,i(1),u(0)}else if(t.tag){if(void 0!==r&&!a)return o=void 0,u(n(1,[s(r)]))}else f=t[0]})),u(n(0,[function(n){if(!a){if(n)return a=!0,i(1),f(1);if(!c)return c=!0,i(0),f(0)}}]))}}},exports.scan=function(n,t){return 2===E.length?E(n,t):E.bind(null,n,t)},exports.share=function(r){function e(n){"number"==typeof n?(u.forEach(k),u=[]):n.tag?(f=!1,u.forEach((function(t){return t(n)}))):i=n[0]}let u=[],i=t,f=!1;return function(t){function o(n){return n!==t}return u=u.concat(t),1===u.length&&r(e),t(n(0,[function(n){if(n){if(u=u.filter(o),0===u.length)return i(1)}else if(!f)return f=!0,i(n)}]))}},exports.skip=function(n){return function(r){return function(e){var u=function(n){return"number"==typeof n?e(n):n.tag?0<f?(f=f-1|0,i(0)):e(n):(i=n[0],e(n))};let i=t,f=n;return 1===r.length?r(u):r.bind(null,u)}}},exports.skipUntil=function(r){return function(e){return function(u){function i(n){return"number"!=typeof n?n.tag?(c=!1,o(1)):(o=n=n[0],n(0)):c?(s=!0,f(1)):void 0}let f=t,o=t,c=!0,l=!1,s=!1;return e((function(n){return"number"==typeof n?(c&&o(1),s=!0,u(0)):n.tag?c||s?l?void(l=!1):(l=!0,f(0),o(0)):(l=!1,u(n)):(f=n[0],1===r.length?r(i):r.bind(null,i))})),u(n(0,[function(n){if(!s)if(n){if(s=!0,f(1),c)return o(1)}else if(!l)return l=!0,c&&o(0),f(0)}]))}}},exports.skipWhile=function(n){return function(r){return function(e){var u=function(t){if("number"==typeof t)return e(t);if(t.tag){if(f){if(n(t[0]))return i(0);f=!1}return e(t)}return i=t[0],e(t)};let i=t,f=!0;return 1===r.length?r(u):r.bind(null,u)}}},exports.subscribe=D,exports.switchAll=function(n){return S(w)(n)},exports.switchMap=O,exports.take=function(r){return function(e){return function(u){let i=!1,f=0,o=t;return e((function(n){if("number"==typeof n){if(i)return;return i=!0,u(0)}if(n.tag){if(f<r&&!i&&(f=f+1|0,u(n),!i&&f>=r))return i=!0,u(0),o(1)}else{if(n=n[0],0>=r)return i=!0,u(0),n(1);o=n}})),u(n(0,[function(n){if(!i){if(n)return i=!0,o(1);if(f<r)return o(0)}}]))}}},exports.takeLast=U,exports.takeUntil=function(r){return function(e){return function(u){function i(n){if("number"!=typeof n)return n.tag?(f=!0,o(1),u(0)):(c=n=n[0],n(0))}let f=!1,o=t,c=t;return e((function(n){if("number"==typeof n){if(f)return;return f=!0,c(1),u(0)}return n.tag?f?void 0:u(n):(o=n[0],1===r.length?r(i):r.bind(null,i))})),u(n(0,[function(n){if(!f)return n?(f=!0,o(1),c(1)):o(0)}]))}}},exports.takeWhile=function(n){return function(r){return function(e){var u=function(t){if("number"==typeof t){if(f)return;return f=!0,e(0)}if(t.tag){if(f)return;return n(t[0])?e(t):(f=!0,e(0),i(1))}return i=t[0],e(t)};let i=t,f=!1;return 1===r.length?r(u):r.bind(null,u)}}},exports.tap=I,exports.throttle=function(t){return function(r){return function(e){function u(n){o=void 0,f=!1}var i=function(r){if("number"==typeof r)return c(),e(0);if(r.tag){if(f)return;return f=!0,c(),o=l(setTimeout(u,t(r[0]))),e(r)}var i=r[0];return e(n(0,[function(n){return n?(c(),i(1)):i(n)}]))};let f=!1,o=void 0;var c=function(n){void 0!==(n=o)&&clearTimeout(s(n))};return 1===r.length?r(i):r.bind(null,i)}}},exports.toArray=function(n){let r=[],e=t,u=!1;return n((function(n){if("number"!=typeof n)return n.tag?(r.push(n[0]),e(0)):(e=n=n[0],n(0));u=!0})),u||e(1),r},exports.toCallbag=function(n){return function(t,r){function e(n){if("number"==typeof n)return 2===r.length?r(2,void 0):r.bind(null,2,void 0);if(n.tag)return n=n[0],2===r.length?r(1,n):r.bind(null,1,n);var t=n[0];return n=function(n){switch(n){case 1:return t(0);case 2:return t(1)}},2===r.length?r(0,n):r.bind(null,0,n)}if(0===t)return 1===n.length?n(e):n.bind(null,e)}},exports.toObservable=function(n){var r={subscribe:function(r){let e=t,u=!1;return n((function(n){if("number"==typeof n)return u=!0,r.complete();if(n.tag){if(u)return;return r.next(n[0]),e(0)}return e=n=n[0],n(0)})),{unsubscribe:function(){if(!u)return u=!0,e(1)}}}};return r[V]=function(n){return r},r},exports.toPromise=function(n){return new Promise((function(t,r){return r=function(n){if("number"!=typeof n)return n.tag?t(n[0]):n[0](0)},1===A(1)(n).length?A(1)(n)(r):A(1)(n).bind(null,r)}))}; |
{ | ||
"name": "wonka", | ||
"description": "A fast push & pull stream library for Reason/OCaml, Flow, and TypeScript", | ||
"version": "4.0.10", | ||
"version": "4.0.11", | ||
"author": "Phil Pluckthun <phil@kitten.sh>", | ||
@@ -68,20 +68,20 @@ "source": "./src/Wonka.ts", | ||
"devDependencies": { | ||
"@ampproject/rollup-plugin-closure-compiler": "^0.18.1", | ||
"@babel/core": "^7.7.7", | ||
"@babel/plugin-syntax-typescript": "^7.7.4", | ||
"@babel/plugin-transform-modules-commonjs": "^7.7.5", | ||
"@babel/preset-env": "^7.7.7", | ||
"@glennsl/bs-jest": "^0.4.9", | ||
"@rollup/plugin-buble": "^0.21.0", | ||
"@rollup/plugin-commonjs": "^11.0.1", | ||
"@rollup/plugin-node-resolve": "^6.1.0", | ||
"@types/jest": "^24.0.25", | ||
"@ampproject/rollup-plugin-closure-compiler": "^0.25.2", | ||
"@babel/core": "^7.9.6", | ||
"@babel/plugin-syntax-typescript": "^7.8.3", | ||
"@babel/plugin-transform-modules-commonjs": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@glennsl/bs-jest": "^0.5.1", | ||
"@rollup/plugin-buble": "^0.21.3", | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"@types/jest": "^25.2.1", | ||
"@types/zen-observable": "^0.8.0", | ||
"babel-plugin-closure-elimination": "^1.3.0", | ||
"bs-platform": "7.0.2-dev.1", | ||
"babel-plugin-closure-elimination": "^1.3.1", | ||
"bs-platform": "^7.3.1", | ||
"callbag-from-iter": "^1.2.0", | ||
"callbag-iterate": "^1.0.0", | ||
"callbag-take": "^1.4.0", | ||
"coveralls": "^3.0.9", | ||
"flow-bin": "^0.115.0", | ||
"callbag-take": "^1.5.0", | ||
"coveralls": "^3.1.0", | ||
"flow-bin": "^0.123.0", | ||
"flowgen": "^1.10.0", | ||
@@ -91,17 +91,17 @@ "gatsby": "^2.18.17", | ||
"gatsby-theme-docs-system": "^0.2.2", | ||
"gentype": "^3.9.1", | ||
"globby": "^10.0.1", | ||
"husky": "^3.1.0", | ||
"lint-staged": "^9.5.0", | ||
"gentype": "^3.21.0", | ||
"globby": "^11.0.0", | ||
"husky": "^4.2.5", | ||
"lint-staged": "^10.2.1", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^1.19.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.28.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-terser": "^5.1.3", | ||
"rollup-plugin-typescript2": "^0.25.3", | ||
"ts-jest": "^24.2.0", | ||
"typescript": "^3.7.4", | ||
"prettier": "^2.0.5", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.7.6", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-typescript2": "^0.27.0", | ||
"ts-jest": "^25.4.0", | ||
"typescript": "^3.8.3", | ||
"zen-observable": "^0.8.15" | ||
@@ -111,8 +111,6 @@ }, | ||
"*.{d.ts,js}": [ | ||
"prettier --write", | ||
"git add" | ||
"prettier --write" | ||
], | ||
"*.{re,rei}": [ | ||
"bsrefmt --in-place", | ||
"git add" | ||
"bsrefmt --in-place" | ||
] | ||
@@ -119,0 +117,0 @@ }, |
import * as Block from "bs-platform/lib/es6/block.js"; | ||
import * as Caml_option from "bs-platform/lib/es6/caml_option.js"; | ||
function talkbackPlaceholder(param) { | ||
return /* () */0; | ||
} | ||
function makeTrampoline(sink, f) { | ||
var state = { | ||
ended: false, | ||
looping: false, | ||
pull: false | ||
}; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
var match = state.looping; | ||
if (signal) { | ||
state.ended = true; | ||
return /* () */0; | ||
} else if (match) { | ||
state.pull = true; | ||
return /* () */0; | ||
} else { | ||
state.pull = true; | ||
state.looping = true; | ||
while(state.pull && !state.ended) { | ||
var match$1 = f(); | ||
if (match$1 !== undefined) { | ||
state.pull = false; | ||
sink(/* Push */Block.__(1, [Caml_option.valFromOption(match$1)])); | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
} | ||
}; | ||
state.looping = false; | ||
return /* () */0; | ||
} | ||
})])); | ||
} | ||
export { | ||
talkbackPlaceholder , | ||
makeTrampoline , | ||
} | ||
/* No side effect */ |
@@ -22,3 +22,3 @@ | ||
q1.length = 0; | ||
return /* () */0; | ||
} | ||
@@ -25,0 +25,0 @@ |
var $$Array = /* alias */0; | ||
var $$Array; | ||
var MutableStack = /* alias */0; | ||
var MutableStack; | ||
var MutableQueue = /* alias */0; | ||
var MutableQueue; | ||
@@ -10,0 +10,0 @@ export { |
@@ -26,3 +26,3 @@ | ||
prim[prim$1] = prim$2; | ||
return /* () */0; | ||
} | ||
@@ -54,8 +54,8 @@ | ||
return false; | ||
} else if (Curry._2(f, arr[i], i)) { | ||
} | ||
if (Curry._2(f, arr[i], i)) { | ||
return true; | ||
} else { | ||
_i = i + 1 | 0; | ||
continue ; | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -71,8 +71,8 @@ } | ||
return true; | ||
} else if (Curry._2(f, arr[i], i)) { | ||
_i = i + 1 | 0; | ||
continue ; | ||
} else { | ||
} | ||
if (!Curry._2(f, arr[i], i)) { | ||
return false; | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -88,11 +88,9 @@ } | ||
return ; | ||
} else { | ||
var x = arr[i]; | ||
if (Curry._2(f, x, i)) { | ||
return Caml_option.some(x); | ||
} else { | ||
_i = i + 1 | 0; | ||
continue ; | ||
} | ||
} | ||
var x = arr[i]; | ||
if (Curry._2(f, x, i)) { | ||
return Caml_option.some(x); | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -108,8 +106,8 @@ } | ||
return -1; | ||
} else if (Curry._1(f, arr[i])) { | ||
} | ||
if (Curry._1(f, arr[i])) { | ||
return i; | ||
} else { | ||
_i = i + 1 | 0; | ||
continue ; | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -125,8 +123,8 @@ } | ||
return -1; | ||
} else if (x === arr[i]) { | ||
} | ||
if (x === arr[i]) { | ||
return i; | ||
} else { | ||
_i = i - 1 | 0; | ||
continue ; | ||
} | ||
_i = i - 1 | 0; | ||
continue ; | ||
}; | ||
@@ -146,11 +144,10 @@ } | ||
return $$Array.sub(res, 0, j.contents + 1 | 0); | ||
} else { | ||
var x = arr[i]; | ||
if (Curry._2(f, x, i)) { | ||
j.contents = j.contents + 1 | 0; | ||
arr[j.contents] = x; | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
} | ||
var x = arr[i]; | ||
if (Curry._2(f, x, i)) { | ||
j.contents = j.contents + 1 | 0; | ||
arr[j.contents] = x; | ||
} | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -168,12 +165,11 @@ } | ||
return res; | ||
} else if (i >= pos && i <= pos2) { | ||
} | ||
if (i >= pos && i <= pos2) { | ||
_i = i + 1 | 0; | ||
continue ; | ||
} else { | ||
var match = i > pos2; | ||
var j = match ? i - count | 0 : i; | ||
arr[j] = arr[i]; | ||
_i = i + 1 | 0; | ||
continue ; | ||
} | ||
var j = i > pos2 ? i - count | 0 : i; | ||
arr[j] = arr[i]; | ||
_i = i + 1 | 0; | ||
continue ; | ||
}; | ||
@@ -180,0 +176,0 @@ } |
var $$Array = /* alias */0; | ||
var $$Array; | ||
var MutableStack = /* alias */0; | ||
var MutableStack; | ||
var MutableQueue = /* alias */0; | ||
var MutableQueue; | ||
@@ -10,0 +10,0 @@ export { |
@@ -35,24 +35,23 @@ | ||
if (typeof signal === "number") { | ||
return Curry._2(data, /* CALLBAG_END */2, /* () */0); | ||
} else if (signal.tag) { | ||
return Curry._2(data, /* CALLBAG_END */2, undefined); | ||
} | ||
if (signal.tag) { | ||
return Curry._2(data, /* CALLBAG_DATA */1, signal[0]); | ||
} else { | ||
var talkbackFn = signal[0]; | ||
var wrappedTalkbackFn = function (talkback) { | ||
switch (talkback) { | ||
case /* CALLBAG_START */0 : | ||
return /* () */0; | ||
case /* CALLBAG_DATA */1 : | ||
return talkbackFn(/* Pull */0); | ||
case /* CALLBAG_END */2 : | ||
return talkbackFn(/* Close */1); | ||
} | ||
}; | ||
return Curry._2(data, /* CALLBAG_START */0, wrappedTalkbackFn); | ||
} | ||
var talkbackFn = signal[0]; | ||
var wrappedTalkbackFn = function (talkback) { | ||
switch (talkback) { | ||
case /* CALLBAG_START */0 : | ||
return ; | ||
case /* CALLBAG_DATA */1 : | ||
return talkbackFn(/* Pull */0); | ||
case /* CALLBAG_END */2 : | ||
return talkbackFn(/* Close */1); | ||
} | ||
}; | ||
return Curry._2(data, /* CALLBAG_START */0, wrappedTalkbackFn); | ||
})); | ||
} else { | ||
return 0; | ||
} | ||
}); | ||
@@ -59,0 +58,0 @@ } |
@@ -7,7 +7,5 @@ | ||
var observableSymbol = ( | ||
typeof Symbol === 'function' | ||
var observableSymbol = (typeof Symbol === 'function' | ||
? Symbol.observable || (Symbol.observable = Symbol('observable')) | ||
: '@@observable' | ||
); | ||
: '@@observable'); | ||
@@ -26,3 +24,3 @@ function fromObservable(input) { | ||
error: (function (param) { | ||
return /* () */0; | ||
}) | ||
@@ -34,5 +32,4 @@ }; | ||
return subscription.unsubscribe(); | ||
} else { | ||
return /* () */0; | ||
} | ||
})])); | ||
@@ -53,23 +50,22 @@ }); | ||
return observer.complete(); | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
observer.next(signal[0]); | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
} | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
})); | ||
return { | ||
unsubscribe: (function () { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
return state.talkback(/* Close */1); | ||
} | ||
}) | ||
@@ -76,0 +72,0 @@ }; |
@@ -19,10 +19,9 @@ | ||
var $$clearTimeout$1 = function (param) { | ||
var match = state.id; | ||
if (match !== undefined) { | ||
var timeoutId = state.id; | ||
if (timeoutId !== undefined) { | ||
state.id = undefined; | ||
clearTimeout(Caml_option.valFromOption(match)); | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
clearTimeout(Caml_option.valFromOption(timeoutId)); | ||
return ; | ||
} | ||
}; | ||
@@ -32,18 +31,16 @@ return Curry._1(source, (function (signal) { | ||
if (state.ended) { | ||
return /* () */0; | ||
return ; | ||
} | ||
state.ended = true; | ||
var match = state.id; | ||
if (match !== undefined) { | ||
state.deferredEnded = true; | ||
return ; | ||
} else { | ||
state.ended = true; | ||
var match = state.id; | ||
if (match !== undefined) { | ||
state.deferredEnded = true; | ||
return /* () */0; | ||
} else { | ||
return sink(/* End */0); | ||
} | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
$$clearTimeout$1(/* () */0); | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
$$clearTimeout$1(undefined); | ||
state.id = Caml_option.some(setTimeout((function (param) { | ||
@@ -54,17 +51,17 @@ state.id = undefined; | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
}), f(signal[0]))); | ||
return /* () */0; | ||
return ; | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
} | ||
var tb = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.deferredEnded = false; | ||
$$clearTimeout$1(/* () */0); | ||
$$clearTimeout$1(undefined); | ||
return tb(/* Close */1); | ||
@@ -74,4 +71,5 @@ } else { | ||
} | ||
})])); | ||
} | ||
} | ||
})])); | ||
})); | ||
@@ -97,7 +95,6 @@ }); | ||
return sink(signal); | ||
} else { | ||
return 0; | ||
} | ||
}), wait); | ||
return /* () */0; | ||
})); | ||
@@ -118,38 +115,37 @@ }); | ||
var $$clearTimeout$1 = function (param) { | ||
var match = id.contents; | ||
if (match !== undefined) { | ||
clearTimeout(Caml_option.valFromOption(match)); | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
var timeoutId = id.contents; | ||
if (timeoutId !== undefined) { | ||
clearTimeout(Caml_option.valFromOption(timeoutId)); | ||
return ; | ||
} | ||
}; | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
$$clearTimeout$1(/* () */0); | ||
$$clearTimeout$1(undefined); | ||
return sink(/* End */0); | ||
} else if (signal.tag) { | ||
if (skip.contents) { | ||
return /* () */0; | ||
} else { | ||
} | ||
if (signal.tag) { | ||
if (!skip.contents) { | ||
skip.contents = true; | ||
$$clearTimeout$1(/* () */0); | ||
$$clearTimeout$1(undefined); | ||
id.contents = Caml_option.some(setTimeout((function (param) { | ||
id.contents = undefined; | ||
skip.contents = false; | ||
return /* () */0; | ||
}), f(signal[0]))); | ||
return sink(signal); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
$$clearTimeout$1(/* () */0); | ||
return tb(/* Close */1); | ||
} else { | ||
return tb(signal); | ||
} | ||
})])); | ||
} | ||
var tb = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
$$clearTimeout$1(undefined); | ||
return tb(/* Close */1); | ||
} else { | ||
return tb(signal); | ||
} | ||
})])); | ||
})); | ||
@@ -164,3 +160,3 @@ }); | ||
if (typeof signal === "number") { | ||
return /* () */0; | ||
return ; | ||
} else if (signal.tag) { | ||
@@ -188,6 +184,5 @@ return resolve(signal[0]); | ||
clearInterval(id); | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
})])); | ||
@@ -199,12 +194,8 @@ }); | ||
return (function (sink) { | ||
var addEventListener = ( | ||
function (element, event, handler) { | ||
var addEventListener = (function (element, event, handler) { | ||
element.addEventListener(event, handler); | ||
} | ||
); | ||
var removeEventListener = ( | ||
function (element, event, handler) { | ||
}); | ||
var removeEventListener = (function (element, event, handler) { | ||
element.removeEventListener(event, handler); | ||
} | ||
); | ||
}); | ||
var handler = function ($$event) { | ||
@@ -215,8 +206,7 @@ return sink(/* Push */Block.__(1, [$$event])); | ||
if (signal) { | ||
return Curry._3(removeEventListener, element, $$event, handler); | ||
} else { | ||
return /* () */0; | ||
return removeEventListener(element, $$event, handler); | ||
} | ||
})])); | ||
return Curry._3(addEventListener, element, $$event, handler); | ||
return addEventListener(element, $$event, handler); | ||
}); | ||
@@ -235,3 +225,3 @@ } | ||
} | ||
return Promise.resolve(/* () */0); | ||
return Promise.resolve(undefined); | ||
})); | ||
@@ -241,6 +231,5 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
ended.contents = true; | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
})])); | ||
@@ -247,0 +236,0 @@ }); |
@@ -22,5 +22,3 @@ | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
@@ -32,11 +30,12 @@ state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
state.buffer.push(signal[0]); | ||
if (state.pulled) { | ||
state.pulled = false; | ||
return /* () */0; | ||
return ; | ||
} else { | ||
@@ -47,46 +46,50 @@ state.pulled = true; | ||
} | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
return sink(/* End */0); | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended || state.buffer.length <= 0) { | ||
return /* () */0; | ||
} else { | ||
var buffer = state.buffer; | ||
state.buffer = new Array(); | ||
return sink(/* Push */Block.__(1, [buffer])); | ||
} | ||
return sink(/* End */0); | ||
} else { | ||
state.notifierTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
})); | ||
} | ||
} | ||
if (!signal.tag) { | ||
state.notifierTalkback = signal[0]; | ||
return ; | ||
} | ||
if (state.ended) { | ||
return ; | ||
} | ||
if (state.buffer.length <= 0) { | ||
return ; | ||
} | ||
var buffer = state.buffer; | ||
state.buffer = new Array(); | ||
return sink(/* Push */Block.__(1, [buffer])); | ||
})); | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (!state.pulled) { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
})])); | ||
@@ -113,34 +116,34 @@ }); | ||
state.endCounter = state.endCounter + 1 | 0; | ||
return /* () */0; | ||
} else if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
return ; | ||
} else if (!state.ended) { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
var a = signal[0]; | ||
if (match !== undefined) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.lastValA = Caml_option.some(a); | ||
state.gotSignal = false; | ||
return sink(/* Push */Block.__(1, [/* tuple */[ | ||
a, | ||
Caml_option.valFromOption(match) | ||
]])); | ||
} | ||
} | ||
if (!signal.tag) { | ||
state.talkbackA = signal[0]; | ||
return ; | ||
} | ||
var a = signal[0]; | ||
if (match !== undefined) { | ||
if (!state.ended) { | ||
state.lastValA = Caml_option.some(a); | ||
state.gotSignal = false; | ||
return sink(/* Push */Block.__(1, [/* tuple */[ | ||
a, | ||
Caml_option.valFromOption(match) | ||
]])); | ||
} else { | ||
state.lastValA = Caml_option.some(a); | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return /* () */0; | ||
} else { | ||
return state.talkbackB(/* Pull */0); | ||
} | ||
return ; | ||
} | ||
} else { | ||
state.talkbackA = signal[0]; | ||
return /* () */0; | ||
state.lastValA = Caml_option.some(a); | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return ; | ||
} else { | ||
return state.talkbackB(/* Pull */0); | ||
} | ||
} | ||
@@ -153,50 +156,51 @@ })); | ||
state.endCounter = state.endCounter + 1 | 0; | ||
return /* () */0; | ||
} else if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
return ; | ||
} else if (!state.ended) { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
var b = signal[0]; | ||
if (match !== undefined) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.lastValB = Caml_option.some(b); | ||
state.gotSignal = false; | ||
return sink(/* Push */Block.__(1, [/* tuple */[ | ||
Caml_option.valFromOption(match), | ||
b | ||
]])); | ||
} | ||
} | ||
if (!signal.tag) { | ||
state.talkbackB = signal[0]; | ||
return ; | ||
} | ||
var b = signal[0]; | ||
if (match !== undefined) { | ||
if (!state.ended) { | ||
state.lastValB = Caml_option.some(b); | ||
state.gotSignal = false; | ||
return sink(/* Push */Block.__(1, [/* tuple */[ | ||
Caml_option.valFromOption(match), | ||
b | ||
]])); | ||
} else { | ||
state.lastValB = Caml_option.some(b); | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return /* () */0; | ||
} else { | ||
return state.talkbackA(/* Pull */0); | ||
} | ||
return ; | ||
} | ||
} else { | ||
state.talkbackB = signal[0]; | ||
return /* () */0; | ||
state.lastValB = Caml_option.some(b); | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return ; | ||
} else { | ||
return state.talkbackA(/* Pull */0); | ||
} | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.talkbackA(/* Close */1); | ||
return state.talkbackB(/* Close */1); | ||
} else if (state.gotSignal) { | ||
return /* () */0; | ||
} else { | ||
state.gotSignal = true; | ||
state.talkbackA(signal); | ||
return state.talkbackB(signal); | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.talkbackA(/* Close */1); | ||
return state.talkbackB(/* Close */1); | ||
} else if (!state.gotSignal) { | ||
state.gotSignal = true; | ||
state.talkbackA(signal); | ||
return state.talkbackB(signal); | ||
} else { | ||
return ; | ||
} | ||
} | ||
})])); | ||
@@ -222,19 +226,19 @@ }); | ||
if (typeof signal === "number") { | ||
if (state.innerActive) { | ||
state.innerActive = false; | ||
var match = state.inputQueue.shift(); | ||
if (match !== undefined) { | ||
return applyInnerSource(f(Caml_option.valFromOption(match))); | ||
} else if (state.ended) { | ||
return sink(/* End */0); | ||
} else if (state.outerPulled) { | ||
return /* () */0; | ||
} else { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} | ||
if (!state.innerActive) { | ||
return ; | ||
} | ||
state.innerActive = false; | ||
var input = state.inputQueue.shift(); | ||
if (input !== undefined) { | ||
return applyInnerSource(f(Caml_option.valFromOption(input))); | ||
} else if (state.ended) { | ||
return sink(/* End */0); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (state.innerActive) { | ||
@@ -244,3 +248,3 @@ sink(signal); | ||
state.innerPulled = false; | ||
return /* () */0; | ||
return ; | ||
} else { | ||
@@ -250,10 +254,9 @@ return state.innerTalkback(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
} | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
})); | ||
@@ -263,5 +266,3 @@ }; | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
@@ -271,22 +272,23 @@ if (!state.innerActive && MutableQueue_js.isEmpty(state.inputQueue)) { | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
var x = signal[0]; | ||
state.outerPulled = false; | ||
if (state.innerActive) { | ||
state.inputQueue.push(x); | ||
return /* () */0; | ||
} else { | ||
return applyInnerSource(f(x)); | ||
} | ||
return ; | ||
} | ||
} else { | ||
} | ||
if (!signal.tag) { | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
if (state.ended) { | ||
return ; | ||
} | ||
var x = signal[0]; | ||
state.outerPulled = false; | ||
if (state.innerActive) { | ||
state.inputQueue.push(x); | ||
return ; | ||
} else { | ||
return applyInnerSource(f(x)); | ||
} | ||
})); | ||
@@ -303,3 +305,3 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
@@ -315,3 +317,3 @@ } else { | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
@@ -345,3 +347,4 @@ } | ||
return sink(signal); | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (f(signal[0])) { | ||
@@ -352,6 +355,5 @@ return sink(signal); | ||
} | ||
} else { | ||
talkback.contents = signal[0]; | ||
return sink(signal); | ||
} | ||
talkback.contents = signal[0]; | ||
return sink(signal); | ||
})); | ||
@@ -391,19 +393,19 @@ }); | ||
if (typeof signal === "number") { | ||
if (state.innerTalkbacks.length !== 0) { | ||
state.innerTalkbacks = state.innerTalkbacks.filter((function (x) { | ||
return x !== talkback.contents; | ||
})); | ||
var exhausted = state.innerTalkbacks.length === 0; | ||
if (state.ended && exhausted) { | ||
return sink(/* End */0); | ||
} else if (!state.outerPulled && exhausted) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return 0; | ||
} | ||
if (state.innerTalkbacks.length === 0) { | ||
return ; | ||
} | ||
state.innerTalkbacks = state.innerTalkbacks.filter((function (x) { | ||
return x !== talkback.contents; | ||
})); | ||
var exhausted = state.innerTalkbacks.length === 0; | ||
if (state.ended && exhausted) { | ||
return sink(/* End */0); | ||
} else if (!state.outerPulled && exhausted) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (state.innerTalkbacks.length !== 0) { | ||
@@ -413,10 +415,9 @@ sink(/* Push */Block.__(1, [signal[0]])); | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
talkback.contents = tb; | ||
state.innerTalkbacks = state.innerTalkbacks.concat(tb); | ||
return tb(/* Pull */0); | ||
} | ||
var tb = signal[0]; | ||
talkback.contents = tb; | ||
state.innerTalkbacks = state.innerTalkbacks.concat(tb); | ||
return tb(/* Pull */0); | ||
})); | ||
@@ -426,5 +427,3 @@ }; | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
@@ -434,21 +433,23 @@ if (state.innerTalkbacks.length === 0) { | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.outerPulled = false; | ||
applyInnerSource(f(signal[0])); | ||
if (state.outerPulled) { | ||
return 0; | ||
} else { | ||
if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
@@ -466,3 +467,3 @@ })); | ||
state.innerTalkbacks = new Array(); | ||
return /* () */0; | ||
return ; | ||
} else { | ||
@@ -478,3 +479,3 @@ if (!state.outerPulled && !state.ended) { | ||
})); | ||
return /* () */0; | ||
return ; | ||
} | ||
@@ -506,21 +507,21 @@ })])); | ||
if (typeof signal === "number") { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
if (!ended.contents) { | ||
ended.contents = true; | ||
sink(signal); | ||
return f(); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} | ||
if (signal.tag) { | ||
if (!ended.contents) { | ||
return sink(signal); | ||
} else { | ||
return sink(signal); | ||
return ; | ||
} | ||
} else { | ||
var talkback = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (ended.contents) { | ||
return 0; | ||
} else if (signal) { | ||
} | ||
var talkback = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (!ended.contents) { | ||
if (signal) { | ||
ended.contents = true; | ||
@@ -532,4 +533,5 @@ talkback(signal); | ||
} | ||
})])); | ||
} | ||
} | ||
})])); | ||
})); | ||
@@ -548,21 +550,21 @@ }); | ||
if (typeof signal === "number") { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
if (!ended.contents) { | ||
ended.contents = true; | ||
return sink(signal); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
} | ||
if (signal.tag) { | ||
if (!ended.contents) { | ||
f(signal[0]); | ||
return sink(signal); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
var talkback = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (ended.contents) { | ||
return 0; | ||
} else if (signal) { | ||
} | ||
var talkback = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (!ended.contents) { | ||
if (signal) { | ||
ended.contents = true; | ||
@@ -573,4 +575,5 @@ return talkback(signal); | ||
} | ||
})])); | ||
} | ||
} | ||
})])); | ||
})); | ||
@@ -585,8 +588,10 @@ }); | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number" || signal.tag) { | ||
if (typeof signal === "number") { | ||
return sink(signal); | ||
} else { | ||
sink(signal); | ||
return f(); | ||
} | ||
if (signal.tag) { | ||
return sink(signal); | ||
} | ||
sink(signal); | ||
return f(); | ||
})); | ||
@@ -609,23 +614,23 @@ }); | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
state.value = Caml_option.some(signal[0]); | ||
if (state.pulled) { | ||
state.pulled = false; | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
state.notifierTalkback(/* Pull */0); | ||
return state.sourceTalkback(/* Pull */0); | ||
return ; | ||
} | ||
} else { | ||
} | ||
if (!signal.tag) { | ||
state.sourceTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
state.value = Caml_option.some(signal[0]); | ||
if (state.pulled) { | ||
state.pulled = false; | ||
return ; | ||
} else { | ||
state.pulled = true; | ||
state.notifierTalkback(/* Pull */0); | ||
return state.sourceTalkback(/* Pull */0); | ||
} | ||
})); | ||
@@ -635,8 +640,8 @@ Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
@@ -648,23 +653,24 @@ } else if (signal.tag) { | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} else { | ||
state.notifierTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (!state.pulled) { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
})])); | ||
@@ -712,13 +718,13 @@ }); | ||
state.sinks = new Array(); | ||
return /* () */0; | ||
} else if (signal.tag) { | ||
state.gotSignal = false; | ||
state.sinks.forEach((function (sink) { | ||
return sink(signal); | ||
})); | ||
return /* () */0; | ||
} else { | ||
return ; | ||
} | ||
if (!signal.tag) { | ||
state.talkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
state.gotSignal = false; | ||
state.sinks.forEach((function (sink) { | ||
return sink(signal); | ||
})); | ||
})); | ||
@@ -734,9 +740,9 @@ } | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
} else if (state.gotSignal) { | ||
return /* () */0; | ||
} else { | ||
} else if (!state.gotSignal) { | ||
state.gotSignal = true; | ||
return state.talkback(signal); | ||
} else { | ||
return ; | ||
} | ||
@@ -757,3 +763,4 @@ })])); | ||
return sink(signal); | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (state.rest > 0) { | ||
@@ -765,6 +772,5 @@ state.rest = state.rest - 1 | 0; | ||
} | ||
} else { | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
} | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
})); | ||
@@ -792,3 +798,4 @@ }); | ||
return sink(/* End */0); | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (!state.skip && !state.ended) { | ||
@@ -799,3 +806,3 @@ state.pulled = false; | ||
state.pulled = false; | ||
return /* () */0; | ||
return ; | ||
} else { | ||
@@ -806,43 +813,43 @@ state.pulled = true; | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.skip) { | ||
state.ended = true; | ||
return state.sourceTalkback(/* Close */1); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else if (signal.tag) { | ||
state.skip = false; | ||
return state.notifierTalkback(/* Close */1); | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.skip) { | ||
state.ended = true; | ||
return state.sourceTalkback(/* Close */1); | ||
} else { | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
return ; | ||
} | ||
})); | ||
} | ||
} | ||
if (signal.tag) { | ||
state.skip = false; | ||
return state.notifierTalkback(/* Close */1); | ||
} | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
})); | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.skip) { | ||
return state.notifierTalkback(/* Close */1); | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.skip) { | ||
return state.notifierTalkback(/* Close */1); | ||
} else { | ||
return ; | ||
} | ||
} else if (!state.pulled) { | ||
state.pulled = true; | ||
if (state.skip) { | ||
state.notifierTalkback(/* Pull */0); | ||
} | ||
return state.sourceTalkback(/* Pull */0); | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
if (state.skip) { | ||
state.notifierTalkback(/* Pull */0); | ||
} | ||
return state.sourceTalkback(/* Pull */0); | ||
} | ||
})])); | ||
@@ -863,3 +870,4 @@ }); | ||
return sink(signal); | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (state.skip) { | ||
@@ -875,6 +883,5 @@ if (f(signal[0])) { | ||
} | ||
} else { | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
} | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
})); | ||
@@ -898,16 +905,14 @@ }); | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
if (state.innerActive) { | ||
return 0; | ||
if (!state.innerActive) { | ||
return sink(/* End */0); | ||
} else { | ||
return sink(/* End */0); | ||
return ; | ||
} | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
if (state.innerActive) { | ||
@@ -926,35 +931,36 @@ state.innerTalkback(/* Close */1); | ||
return Curry._1(innerSource, (function (signal) { | ||
if (state.innerActive) { | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
if (state.ended) { | ||
return sink(signal); | ||
} else if (state.outerPulled) { | ||
return 0; | ||
} else { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} | ||
} else if (signal.tag) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return /* () */0; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
if (!state.innerActive) { | ||
return ; | ||
} | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
if (state.ended) { | ||
return sink(signal); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
return ; | ||
} | ||
} | ||
if (signal.tag) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
return ; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
return 0; | ||
} | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
})); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
return ; | ||
} | ||
@@ -972,3 +978,3 @@ })); | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
@@ -984,3 +990,3 @@ } else { | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
@@ -1009,9 +1015,10 @@ } | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
} | ||
if (signal.tag) { | ||
if (state.taken < max && !state.ended) { | ||
@@ -1025,30 +1032,30 @@ state.taken = state.taken + 1 | 0; | ||
} else { | ||
return 0; | ||
return ; | ||
} | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
} | ||
var tb = signal[0]; | ||
if (max <= 0) { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return tb(/* Close */1); | ||
} else { | ||
var tb = signal[0]; | ||
if (max <= 0) { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return tb(/* Close */1); | ||
} else { | ||
state.talkback = tb; | ||
return /* () */0; | ||
} | ||
state.talkback = tb; | ||
return ; | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
return state.talkback(/* Close */1); | ||
} else if (state.taken < max) { | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
return state.talkback(/* Close */1); | ||
} else if (state.taken < max) { | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
})])); | ||
@@ -1062,27 +1069,25 @@ }); | ||
return (function (sink) { | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
var state = { | ||
queue: new Array(), | ||
talkback: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
var queue = new Array(); | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
return Wonka_helpers.makeTrampoline(sink, (function () { | ||
return queue.shift(); | ||
})); | ||
} else if (signal.tag) { | ||
var size = queue.length; | ||
return Wonka_sources.fromArray(state.queue)(sink); | ||
} | ||
if (signal.tag) { | ||
var size = state.queue.length; | ||
if (size >= max && max > 0) { | ||
queue.shift(); | ||
state.queue.shift(); | ||
} | ||
queue.push(signal[0]); | ||
return talkback.contents(/* Pull */0); | ||
state.queue.push(signal[0]); | ||
return state.talkback(/* Pull */0); | ||
} | ||
var talkback = signal[0]; | ||
if (max <= 0) { | ||
talkback(/* Close */1); | ||
return Wonka_sources.empty(sink); | ||
} else { | ||
var tb = signal[0]; | ||
if (max <= 0) { | ||
tb(/* Close */1); | ||
return Wonka_sources.empty(sink); | ||
} else { | ||
talkback.contents = tb; | ||
return tb(/* Pull */0); | ||
} | ||
state.talkback = talkback; | ||
return talkback(/* Pull */0); | ||
} | ||
@@ -1104,42 +1109,43 @@ })); | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
return sink(signal); | ||
} else { | ||
return sink(signal); | ||
return ; | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
return /* () */0; | ||
} else if (signal.tag) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} else { | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
} | ||
})); | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
return ; | ||
} | ||
if (signal.tag) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
})); | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else { | ||
return state.sourceTalkback(/* Pull */0); | ||
if (!state.ended) { | ||
if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else { | ||
return state.sourceTalkback(/* Pull */0); | ||
} | ||
} | ||
})])); | ||
@@ -1159,22 +1165,24 @@ }); | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else if (f(signal[0])) { | ||
return sink(signal); | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
if (f(signal[0])) { | ||
return sink(signal); | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return state.talkback(/* Close */1); | ||
} | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return state.talkback(/* Close */1); | ||
return ; | ||
} | ||
} else { | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
} | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
})); | ||
@@ -1181,0 +1189,0 @@ }); |
@@ -15,24 +15,23 @@ | ||
state.ended = true; | ||
return /* () */0; | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
return ; | ||
} | ||
if (signal.tag) { | ||
if (!state.ended) { | ||
f(signal[0]); | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
} | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
})); | ||
return { | ||
unsubscribe: (function (param) { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
return state.talkback(/* Close */1); | ||
} | ||
}) | ||
@@ -46,3 +45,3 @@ }; | ||
subscribe(f)(source); | ||
return /* () */0; | ||
}); | ||
@@ -53,3 +52,3 @@ } | ||
return subscribe((function (param) { | ||
return /* () */0; | ||
}))(source); | ||
@@ -68,11 +67,11 @@ } | ||
state.ended = true; | ||
return /* () */0; | ||
} else if (signal.tag) { | ||
return ; | ||
} | ||
if (signal.tag) { | ||
state.values.push(signal[0]); | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
} | ||
var x = signal[0]; | ||
state.talkback = x; | ||
return x(/* Pull */0); | ||
})); | ||
@@ -79,0 +78,0 @@ if (!state.ended) { |
import * as Block from "bs-platform/lib/es6/block.js"; | ||
import * as Caml_option from "bs-platform/lib/es6/caml_option.js"; | ||
import * as Wonka_helpers from "./helpers/Wonka_helpers.bs.js"; | ||
@@ -10,13 +9,34 @@ | ||
var size = arr.length; | ||
var index = { | ||
contents: 0 | ||
var state = { | ||
ended: false, | ||
looping: false, | ||
pulled: false, | ||
current: 0 | ||
}; | ||
return Wonka_helpers.makeTrampoline(sink, (function () { | ||
if (index.contents < size) { | ||
var x = arr[index.contents]; | ||
index.contents = index.contents + 1 | 0; | ||
return Caml_option.some(x); | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
var match = state.looping; | ||
if (signal) { | ||
state.ended = true; | ||
return ; | ||
} | ||
if (match) { | ||
state.pulled = true; | ||
return ; | ||
} | ||
state.pulled = true; | ||
state.looping = true; | ||
while(state.pulled && !state.ended) { | ||
if (state.current < size) { | ||
var x = arr[state.current]; | ||
state.current = state.current + 1 | 0; | ||
state.pulled = false; | ||
sink(/* Push */Block.__(1, [x])); | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
} | ||
}; | ||
state.looping = false; | ||
})])); | ||
}); | ||
@@ -27,13 +47,34 @@ } | ||
return (function (sink) { | ||
var value = { | ||
contents: ls | ||
var state = { | ||
ended: false, | ||
looping: false, | ||
pulled: false, | ||
current: ls | ||
}; | ||
return Wonka_helpers.makeTrampoline(sink, (function () { | ||
var match = value.contents; | ||
if (match) { | ||
value.contents = match[1]; | ||
return Caml_option.some(match[0]); | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
var match = state.looping; | ||
if (signal) { | ||
state.ended = true; | ||
return ; | ||
} | ||
if (match) { | ||
state.pulled = true; | ||
return ; | ||
} | ||
state.pulled = true; | ||
state.looping = true; | ||
while(state.pulled && !state.ended) { | ||
var match$1 = state.current; | ||
if (match$1) { | ||
state.current = match$1[1]; | ||
state.pulled = false; | ||
sink(/* Push */Block.__(1, [match$1[0]])); | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
} | ||
}; | ||
state.looping = false; | ||
})])); | ||
}); | ||
@@ -50,9 +91,9 @@ } | ||
ended.contents = true; | ||
return /* () */0; | ||
} else if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
return ; | ||
} else if (!ended.contents) { | ||
ended.contents = true; | ||
sink(/* Push */Block.__(1, [x])); | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
@@ -67,3 +108,3 @@ })])); | ||
teardown: (function () { | ||
return /* () */0; | ||
}), | ||
@@ -74,15 +115,13 @@ ended: false | ||
next: (function (value) { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
return sink(/* Push */Block.__(1, [value])); | ||
} | ||
}), | ||
complete: (function (param) { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} | ||
}) | ||
@@ -94,5 +133,4 @@ }); | ||
return state.teardown(); | ||
} else { | ||
return /* () */0; | ||
} | ||
})])); | ||
@@ -114,22 +152,18 @@ }); | ||
})); | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
return ; | ||
} | ||
})])); | ||
}; | ||
var next = function (value) { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
state.sinks.forEach((function (sink) { | ||
return sink(/* Push */Block.__(1, [value])); | ||
})); | ||
return /* () */0; | ||
return ; | ||
} | ||
}; | ||
var complete = function (param) { | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
if (!state.ended) { | ||
state.ended = true; | ||
@@ -139,4 +173,5 @@ state.sinks.forEach((function (sink) { | ||
})); | ||
return /* () */0; | ||
return ; | ||
} | ||
}; | ||
@@ -157,7 +192,7 @@ return { | ||
ended.contents = true; | ||
return /* () */0; | ||
} else if (ended.contents) { | ||
return /* () */0; | ||
return ; | ||
} else if (!ended.contents) { | ||
return sink(/* End */0); | ||
} else { | ||
return sink(/* End */0); | ||
return ; | ||
} | ||
@@ -164,0 +199,0 @@ })])); |
@@ -8,3 +8,3 @@ | ||
var Types = /* alias */0; | ||
var Types; | ||
@@ -11,0 +11,0 @@ var fromArray = Wonka_sources.fromArray; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
413040
7709