// Compiled by ClojureScript 1.9.562 {}
goog.provide('cljs.core.async');
goog.require('cljs.core');
goog.require('cljs.core.async.impl.protocols');
goog.require('cljs.core.async.impl.channels');
goog.require('cljs.core.async.impl.buffers');
goog.require('cljs.core.async.impl.timers');
goog.require('cljs.core.async.impl.dispatch');
goog.require('cljs.core.async.impl.ioc_helpers');
cljs.core.async.fn_handler = (function cljs$core$async$fn_handler(var_args){
var args30972 = [];
var len__24559__auto___30978 = arguments.length;
var i__24560__auto___30979 = (0);
while(true){
if((i__24560__auto___30979 < len__24559__auto___30978)){
args30972.push((arguments[i__24560__auto___30979]));

var G__30980 = (i__24560__auto___30979 + (1));
i__24560__auto___30979 = G__30980;
continue;
} else {
}
break;
}

var G__30974 = args30972.length;
switch (G__30974) {
case 1:
return cljs.core.async.fn_handler.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.fn_handler.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30972.length)].join('')));

}
});

cljs.core.async.fn_handler.cljs$core$IFn$_invoke$arity$1 = (function (f){
return cljs.core.async.fn_handler.call(null,f,true);
});

cljs.core.async.fn_handler.cljs$core$IFn$_invoke$arity$2 = (function (f,blockable){
if(typeof cljs.core.async.t_cljs$core$async30975 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Handler}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async30975 = (function (f,blockable,meta30976){
this.f = f;
this.blockable = blockable;
this.meta30976 = meta30976;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_30977,meta30976__$1){
var self__ = this;
var _30977__$1 = this;
return (new cljs.core.async.t_cljs$core$async30975(self__.f,self__.blockable,meta30976__$1));
});

cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_30977){
var self__ = this;
var _30977__$1 = this;
return self__.meta30976;
});

cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});

cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.blockable;
});

cljs.core.async.t_cljs$core$async30975.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.f;
});

cljs.core.async.t_cljs$core$async30975.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"blockable","blockable",-28395259,null),new cljs.core.Symbol(null,"meta30976","meta30976",443275795,null)], null);
});

cljs.core.async.t_cljs$core$async30975.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async30975.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async30975";

cljs.core.async.t_cljs$core$async30975.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async30975");
});

cljs.core.async.__GT_t_cljs$core$async30975 = (function cljs$core$async$__GT_t_cljs$core$async30975(f__$1,blockable__$1,meta30976){
return (new cljs.core.async.t_cljs$core$async30975(f__$1,blockable__$1,meta30976));
});

}

return (new cljs.core.async.t_cljs$core$async30975(f,blockable,cljs.core.PersistentArrayMap.EMPTY));
});

cljs.core.async.fn_handler.cljs$lang$maxFixedArity = 2;

/**
 * Returns a fixed buffer of size n. When full, puts will block/park.
 */
cljs.core.async.buffer = (function cljs$core$async$buffer(n){
return cljs.core.async.impl.buffers.fixed_buffer.call(null,n);
});
/**
 * Returns a buffer of size n. When full, puts will complete but
 *   val will be dropped (no transfer).
 */
cljs.core.async.dropping_buffer = (function cljs$core$async$dropping_buffer(n){
return cljs.core.async.impl.buffers.dropping_buffer.call(null,n);
});
/**
 * Returns a buffer of size n. When full, puts will complete, and be
 *   buffered, but oldest elements in buffer will be dropped (not
 *   transferred).
 */
cljs.core.async.sliding_buffer = (function cljs$core$async$sliding_buffer(n){
return cljs.core.async.impl.buffers.sliding_buffer.call(null,n);
});
/**
 * Returns true if a channel created with buff will never block. That is to say,
 * puts into this buffer will never cause the buffer to be full. 
 */
cljs.core.async.unblocking_buffer_QMARK_ = (function cljs$core$async$unblocking_buffer_QMARK_(buff){
if(!((buff == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === buff.cljs$core$async$impl$protocols$UnblockingBuffer$))){
return true;
} else {
if((!buff.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,cljs.core.async.impl.protocols.UnblockingBuffer,buff);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,cljs.core.async.impl.protocols.UnblockingBuffer,buff);
}
});
/**
 * Creates a channel with an optional buffer, an optional transducer (like (map f),
 *   (filter p) etc or a composition thereof), and an optional exception handler.
 *   If buf-or-n is a number, will create and use a fixed buffer of that size. If a
 *   transducer is supplied a buffer must be specified. ex-handler must be a
 *   fn of one argument - if an exception occurs during transformation it will be called
 *   with the thrown value as an argument, and any non-nil return value will be placed
 *   in the channel.
 */
cljs.core.async.chan = (function cljs$core$async$chan(var_args){
var args30984 = [];
var len__24559__auto___30987 = arguments.length;
var i__24560__auto___30988 = (0);
while(true){
if((i__24560__auto___30988 < len__24559__auto___30987)){
args30984.push((arguments[i__24560__auto___30988]));

var G__30989 = (i__24560__auto___30988 + (1));
i__24560__auto___30988 = G__30989;
continue;
} else {
}
break;
}

var G__30986 = args30984.length;
switch (G__30986) {
case 0:
return cljs.core.async.chan.cljs$core$IFn$_invoke$arity$0();

break;
case 1:
return cljs.core.async.chan.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.chan.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30984.length)].join('')));

}
});

cljs.core.async.chan.cljs$core$IFn$_invoke$arity$0 = (function (){
return cljs.core.async.chan.call(null,null);
});

cljs.core.async.chan.cljs$core$IFn$_invoke$arity$1 = (function (buf_or_n){
return cljs.core.async.chan.call(null,buf_or_n,null,null);
});

cljs.core.async.chan.cljs$core$IFn$_invoke$arity$2 = (function (buf_or_n,xform){
return cljs.core.async.chan.call(null,buf_or_n,xform,null);
});

cljs.core.async.chan.cljs$core$IFn$_invoke$arity$3 = (function (buf_or_n,xform,ex_handler){
var buf_or_n__$1 = ((cljs.core._EQ_.call(null,buf_or_n,(0)))?null:buf_or_n);
if(cljs.core.truth_(xform)){
if(cljs.core.truth_(buf_or_n__$1)){
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Assert failed: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1("buffer must be supplied when transducer is"),cljs.core.str.cljs$core$IFn$_invoke$arity$1("\n"),cljs.core.str.cljs$core$IFn$_invoke$arity$1("buf-or-n")].join('')));
}
} else {
}

return cljs.core.async.impl.channels.chan.call(null,((typeof buf_or_n__$1 === 'number')?cljs.core.async.buffer.call(null,buf_or_n__$1):buf_or_n__$1),xform,ex_handler);
});

cljs.core.async.chan.cljs$lang$maxFixedArity = 3;

/**
 * Creates a promise channel with an optional transducer, and an optional
 *   exception-handler. A promise channel can take exactly one value that consumers
 *   will receive. Once full, puts complete but val is dropped (no transfer).
 *   Consumers will block until either a value is placed in the channel or the
 *   channel is closed. See chan for the semantics of xform and ex-handler.
 */
cljs.core.async.promise_chan = (function cljs$core$async$promise_chan(var_args){
var args30991 = [];
var len__24559__auto___30994 = arguments.length;
var i__24560__auto___30995 = (0);
while(true){
if((i__24560__auto___30995 < len__24559__auto___30994)){
args30991.push((arguments[i__24560__auto___30995]));

var G__30996 = (i__24560__auto___30995 + (1));
i__24560__auto___30995 = G__30996;
continue;
} else {
}
break;
}

var G__30993 = args30991.length;
switch (G__30993) {
case 0:
return cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$0();

break;
case 1:
return cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30991.length)].join('')));

}
});

cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$0 = (function (){
return cljs.core.async.promise_chan.call(null,null);
});

cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$1 = (function (xform){
return cljs.core.async.promise_chan.call(null,xform,null);
});

cljs.core.async.promise_chan.cljs$core$IFn$_invoke$arity$2 = (function (xform,ex_handler){
return cljs.core.async.chan.call(null,cljs.core.async.impl.buffers.promise_buffer.call(null),xform,ex_handler);
});

cljs.core.async.promise_chan.cljs$lang$maxFixedArity = 2;

/**
 * Returns a channel that will close after msecs
 */
cljs.core.async.timeout = (function cljs$core$async$timeout(msecs){
return cljs.core.async.impl.timers.timeout.call(null,msecs);
});
/**
 * takes a val from port. Must be called inside a (go ...) block. Will
 *   return nil if closed. Will park if nothing is available.
 *   Returns true unless port is already closed
 */
cljs.core.async._LT__BANG_ = (function cljs$core$async$_LT__BANG_(port){
throw (new Error("<! used not in (go ...) block"));
});
/**
 * Asynchronously takes a val from port, passing to fn1. Will pass nil
 * if closed. If on-caller? (default true) is true, and value is
 * immediately available, will call fn1 on calling thread.
 * Returns nil.
 */
cljs.core.async.take_BANG_ = (function cljs$core$async$take_BANG_(var_args){
var args30998 = [];
var len__24559__auto___31001 = arguments.length;
var i__24560__auto___31002 = (0);
while(true){
if((i__24560__auto___31002 < len__24559__auto___31001)){
args30998.push((arguments[i__24560__auto___31002]));

var G__31003 = (i__24560__auto___31002 + (1));
i__24560__auto___31002 = G__31003;
continue;
} else {
}
break;
}

var G__31000 = args30998.length;
switch (G__31000) {
case 2:
return cljs.core.async.take_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.take_BANG_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30998.length)].join('')));

}
});

cljs.core.async.take_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (port,fn1){
return cljs.core.async.take_BANG_.call(null,port,fn1,true);
});

cljs.core.async.take_BANG_.cljs$core$IFn$_invoke$arity$3 = (function (port,fn1,on_caller_QMARK_){
var ret = cljs.core.async.impl.protocols.take_BANG_.call(null,port,cljs.core.async.fn_handler.call(null,fn1));
if(cljs.core.truth_(ret)){
var val_31005 = cljs.core.deref.call(null,ret);
if(cljs.core.truth_(on_caller_QMARK_)){
fn1.call(null,val_31005);
} else {
cljs.core.async.impl.dispatch.run.call(null,((function (val_31005,ret){
return (function (){
return fn1.call(null,val_31005);
});})(val_31005,ret))
);
}
} else {
}

return null;
});

cljs.core.async.take_BANG_.cljs$lang$maxFixedArity = 3;

cljs.core.async.nop = (function cljs$core$async$nop(_){
return null;
});
cljs.core.async.fhnop = cljs.core.async.fn_handler.call(null,cljs.core.async.nop);
/**
 * puts a val into port. nil values are not allowed. Must be called
 *   inside a (go ...) block. Will park if no buffer space is available.
 *   Returns true unless port is already closed.
 */
cljs.core.async._GT__BANG_ = (function cljs$core$async$_GT__BANG_(port,val){
throw (new Error(">! used not in (go ...) block"));
});
/**
 * Asynchronously puts a val into port, calling fn0 (if supplied) when
 * complete. nil values are not allowed. Will throw if closed. If
 * on-caller? (default true) is true, and the put is immediately
 * accepted, will call fn0 on calling thread.  Returns nil.
 */
cljs.core.async.put_BANG_ = (function cljs$core$async$put_BANG_(var_args){
var args31006 = [];
var len__24559__auto___31009 = arguments.length;
var i__24560__auto___31010 = (0);
while(true){
if((i__24560__auto___31010 < len__24559__auto___31009)){
args31006.push((arguments[i__24560__auto___31010]));

var G__31011 = (i__24560__auto___31010 + (1));
i__24560__auto___31010 = G__31011;
continue;
} else {
}
break;
}

var G__31008 = args31006.length;
switch (G__31008) {
case 2:
return cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
case 4:
return cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31006.length)].join('')));

}
});

cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (port,val){
var temp__5276__auto__ = cljs.core.async.impl.protocols.put_BANG_.call(null,port,val,cljs.core.async.fhnop);
if(cljs.core.truth_(temp__5276__auto__)){
var ret = temp__5276__auto__;
return cljs.core.deref.call(null,ret);
} else {
return true;
}
});

cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$3 = (function (port,val,fn1){
return cljs.core.async.put_BANG_.call(null,port,val,fn1,true);
});

cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$4 = (function (port,val,fn1,on_caller_QMARK_){
var temp__5276__auto__ = cljs.core.async.impl.protocols.put_BANG_.call(null,port,val,cljs.core.async.fn_handler.call(null,fn1));
if(cljs.core.truth_(temp__5276__auto__)){
var retb = temp__5276__auto__;
var ret = cljs.core.deref.call(null,retb);
if(cljs.core.truth_(on_caller_QMARK_)){
fn1.call(null,ret);
} else {
cljs.core.async.impl.dispatch.run.call(null,((function (ret,retb,temp__5276__auto__){
return (function (){
return fn1.call(null,ret);
});})(ret,retb,temp__5276__auto__))
);
}

return ret;
} else {
return true;
}
});

cljs.core.async.put_BANG_.cljs$lang$maxFixedArity = 4;

cljs.core.async.close_BANG_ = (function cljs$core$async$close_BANG_(port){
return cljs.core.async.impl.protocols.close_BANG_.call(null,port);
});
cljs.core.async.random_array = (function cljs$core$async$random_array(n){
var a = (new Array(n));
var n__24359__auto___31013 = n;
var x_31014 = (0);
while(true){
if((x_31014 < n__24359__auto___31013)){
(a[x_31014] = (0));

var G__31015 = (x_31014 + (1));
x_31014 = G__31015;
continue;
} else {
}
break;
}

var i = (1);
while(true){
if(cljs.core._EQ_.call(null,i,n)){
return a;
} else {
var j = cljs.core.rand_int.call(null,i);
(a[i] = (a[j]));

(a[j] = i);

var G__31016 = (i + (1));
i = G__31016;
continue;
}
break;
}
});
cljs.core.async.alt_flag = (function cljs$core$async$alt_flag(){
var flag = cljs.core.atom.call(null,true);
if(typeof cljs.core.async.t_cljs$core$async31020 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Handler}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async31020 = (function (flag,meta31021){
this.flag = flag;
this.meta31021 = meta31021;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (flag){
return (function (_31022,meta31021__$1){
var self__ = this;
var _31022__$1 = this;
return (new cljs.core.async.t_cljs$core$async31020(self__.flag,meta31021__$1));
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (flag){
return (function (_31022){
var self__ = this;
var _31022__$1 = this;
return self__.meta31021;
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = ((function (flag){
return (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.deref.call(null,self__.flag);
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = ((function (flag){
return (function (_){
var self__ = this;
var ___$1 = this;
return true;
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = ((function (flag){
return (function (_){
var self__ = this;
var ___$1 = this;
cljs.core.reset_BANG_.call(null,self__.flag,null);

return true;
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.getBasis = ((function (flag){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"flag","flag",-1565787888,null),new cljs.core.Symbol(null,"meta31021","meta31021",2006425830,null)], null);
});})(flag))
;

cljs.core.async.t_cljs$core$async31020.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async31020.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async31020";

cljs.core.async.t_cljs$core$async31020.cljs$lang$ctorPrWriter = ((function (flag){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async31020");
});})(flag))
;

cljs.core.async.__GT_t_cljs$core$async31020 = ((function (flag){
return (function cljs$core$async$alt_flag_$___GT_t_cljs$core$async31020(flag__$1,meta31021){
return (new cljs.core.async.t_cljs$core$async31020(flag__$1,meta31021));
});})(flag))
;

}

return (new cljs.core.async.t_cljs$core$async31020(flag,cljs.core.PersistentArrayMap.EMPTY));
});
cljs.core.async.alt_handler = (function cljs$core$async$alt_handler(flag,cb){
if(typeof cljs.core.async.t_cljs$core$async31026 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Handler}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async31026 = (function (flag,cb,meta31027){
this.flag = flag;
this.cb = cb;
this.meta31027 = meta31027;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_31028,meta31027__$1){
var self__ = this;
var _31028__$1 = this;
return (new cljs.core.async.t_cljs$core$async31026(self__.flag,self__.cb,meta31027__$1));
});

cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_31028){
var self__ = this;
var _31028__$1 = this;
return self__.meta31027;
});

cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.active_QMARK_.call(null,self__.flag);
});

cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});

cljs.core.async.t_cljs$core$async31026.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
cljs.core.async.impl.protocols.commit.call(null,self__.flag);

return self__.cb;
});

cljs.core.async.t_cljs$core$async31026.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"flag","flag",-1565787888,null),new cljs.core.Symbol(null,"cb","cb",-2064487928,null),new cljs.core.Symbol(null,"meta31027","meta31027",-254542966,null)], null);
});

cljs.core.async.t_cljs$core$async31026.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async31026.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async31026";

cljs.core.async.t_cljs$core$async31026.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async31026");
});

cljs.core.async.__GT_t_cljs$core$async31026 = (function cljs$core$async$alt_handler_$___GT_t_cljs$core$async31026(flag__$1,cb__$1,meta31027){
return (new cljs.core.async.t_cljs$core$async31026(flag__$1,cb__$1,meta31027));
});

}

return (new cljs.core.async.t_cljs$core$async31026(flag,cb,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * returns derefable [val port] if immediate, nil if enqueued
 */
cljs.core.async.do_alts = (function cljs$core$async$do_alts(fret,ports,opts){
var flag = cljs.core.async.alt_flag.call(null);
var n = cljs.core.count.call(null,ports);
var idxs = cljs.core.async.random_array.call(null,n);
var priority = new cljs.core.Keyword(null,"priority","priority",1431093715).cljs$core$IFn$_invoke$arity$1(opts);
var ret = (function (){var i = (0);
while(true){
if((i < n)){
var idx = (cljs.core.truth_(priority)?i:(idxs[i]));
var port = cljs.core.nth.call(null,ports,idx);
var wport = ((cljs.core.vector_QMARK_.call(null,port))?port.call(null,(0)):null);
var vbox = (cljs.core.truth_(wport)?(function (){var val = port.call(null,(1));
return cljs.core.async.impl.protocols.put_BANG_.call(null,wport,val,cljs.core.async.alt_handler.call(null,flag,((function (i,val,idx,port,wport,flag,n,idxs,priority){
return (function (p1__31029_SHARP_){
return fret.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [p1__31029_SHARP_,wport], null));
});})(i,val,idx,port,wport,flag,n,idxs,priority))
));
})():cljs.core.async.impl.protocols.take_BANG_.call(null,port,cljs.core.async.alt_handler.call(null,flag,((function (i,idx,port,wport,flag,n,idxs,priority){
return (function (p1__31030_SHARP_){
return fret.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [p1__31030_SHARP_,port], null));
});})(i,idx,port,wport,flag,n,idxs,priority))
)));
if(cljs.core.truth_(vbox)){
return cljs.core.async.impl.channels.box.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.deref.call(null,vbox),(function (){var or__23338__auto__ = wport;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return port;
}
})()], null));
} else {
var G__31031 = (i + (1));
i = G__31031;
continue;
}
} else {
return null;
}
break;
}
})();
var or__23338__auto__ = ret;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
if(cljs.core.contains_QMARK_.call(null,opts,new cljs.core.Keyword(null,"default","default",-1987822328))){
var temp__5278__auto__ = (function (){var and__23326__auto__ = cljs.core.async.impl.protocols.active_QMARK_.call(null,flag);
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.async.impl.protocols.commit.call(null,flag);
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(temp__5278__auto__)){
var got = temp__5278__auto__;
return cljs.core.async.impl.channels.box.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"default","default",-1987822328).cljs$core$IFn$_invoke$arity$1(opts),new cljs.core.Keyword(null,"default","default",-1987822328)], null));
} else {
return null;
}
} else {
return null;
}
}
});
/**
 * Completes at most one of several channel operations. Must be called
 * inside a (go ...) block. ports is a vector of channel endpoints,
 * which can be either a channel to take from or a vector of
 *   [channel-to-put-to val-to-put], in any combination. Takes will be
 *   made as if by <!, and puts will be made as if by >!. Unless
 *   the :priority option is true, if more than one port operation is
 *   ready a non-deterministic choice will be made. If no operation is
 *   ready and a :default value is supplied, [default-val :default] will
 *   be returned, otherwise alts! will park until the first operation to
 *   become ready completes. Returns [val port] of the completed
 *   operation, where val is the value taken for takes, and a
 *   boolean (true unless already closed, as per put!) for puts.
 * 
 *   opts are passed as :key val ... Supported options:
 * 
 *   :default val - the value to use if none of the operations are immediately ready
 *   :priority true - (default nil) when true, the operations will be tried in order.
 * 
 *   Note: there is no guarantee that the port exps or val exprs will be
 *   used, nor in what order should they be, so they should not be
 *   depended upon for side effects.
 */
cljs.core.async.alts_BANG_ = (function cljs$core$async$alts_BANG_(var_args){
var args__24566__auto__ = [];
var len__24559__auto___31037 = arguments.length;
var i__24560__auto___31038 = (0);
while(true){
if((i__24560__auto___31038 < len__24559__auto___31037)){
args__24566__auto__.push((arguments[i__24560__auto___31038]));

var G__31039 = (i__24560__auto___31038 + (1));
i__24560__auto___31038 = G__31039;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return cljs.core.async.alts_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__auto__);
});

cljs.core.async.alts_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (ports,p__31034){
var map__31035 = p__31034;
var map__31035__$1 = ((((!((map__31035 == null)))?((((map__31035.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31035.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31035):map__31035);
var opts = map__31035__$1;
throw (new Error("alts! used not in (go ...) block"));
});

cljs.core.async.alts_BANG_.cljs$lang$maxFixedArity = (1);

cljs.core.async.alts_BANG_.cljs$lang$applyTo = (function (seq31032){
var G__31033 = cljs.core.first.call(null,seq31032);
var seq31032__$1 = cljs.core.next.call(null,seq31032);
return cljs.core.async.alts_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__31033,seq31032__$1);
});

/**
 * Puts a val into port if it's possible to do so immediately.
 *   nil values are not allowed. Never blocks. Returns true if offer succeeds.
 */
cljs.core.async.offer_BANG_ = (function cljs$core$async$offer_BANG_(port,val){
var ret = cljs.core.async.impl.protocols.put_BANG_.call(null,port,val,cljs.core.async.fn_handler.call(null,cljs.core.async.nop,false));
if(cljs.core.truth_(ret)){
return cljs.core.deref.call(null,ret);
} else {
return null;
}
});
/**
 * Takes a val from port if it's possible to do so immediately.
 *   Never blocks. Returns value if successful, nil otherwise.
 */
cljs.core.async.poll_BANG_ = (function cljs$core$async$poll_BANG_(port){
var ret = cljs.core.async.impl.protocols.take_BANG_.call(null,port,cljs.core.async.fn_handler.call(null,cljs.core.async.nop,false));
if(cljs.core.truth_(ret)){
return cljs.core.deref.call(null,ret);
} else {
return null;
}
});
/**
 * Takes elements from the from channel and supplies them to the to
 * channel. By default, the to channel will be closed when the from
 * channel closes, but can be determined by the close?  parameter. Will
 * stop consuming the from channel if the to channel closes
 */
cljs.core.async.pipe = (function cljs$core$async$pipe(var_args){
var args31040 = [];
var len__24559__auto___31090 = arguments.length;
var i__24560__auto___31091 = (0);
while(true){
if((i__24560__auto___31091 < len__24559__auto___31090)){
args31040.push((arguments[i__24560__auto___31091]));

var G__31092 = (i__24560__auto___31091 + (1));
i__24560__auto___31091 = G__31092;
continue;
} else {
}
break;
}

var G__31042 = args31040.length;
switch (G__31042) {
case 2:
return cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31040.length)].join('')));

}
});

cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$2 = (function (from,to){
return cljs.core.async.pipe.call(null,from,to,true);
});

cljs.core.async.pipe.cljs$core$IFn$_invoke$arity$3 = (function (from,to,close_QMARK_){
var c__30913__auto___31094 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___31094){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___31094){
return (function (state_31066){
var state_val_31067 = (state_31066[(1)]);
if((state_val_31067 === (7))){
var inst_31062 = (state_31066[(2)]);
var state_31066__$1 = state_31066;
var statearr_31068_31095 = state_31066__$1;
(statearr_31068_31095[(2)] = inst_31062);

(statearr_31068_31095[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (1))){
var state_31066__$1 = state_31066;
var statearr_31069_31096 = state_31066__$1;
(statearr_31069_31096[(2)] = null);

(statearr_31069_31096[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (4))){
var inst_31045 = (state_31066[(7)]);
var inst_31045__$1 = (state_31066[(2)]);
var inst_31046 = (inst_31045__$1 == null);
var state_31066__$1 = (function (){var statearr_31070 = state_31066;
(statearr_31070[(7)] = inst_31045__$1);

return statearr_31070;
})();
if(cljs.core.truth_(inst_31046)){
var statearr_31071_31097 = state_31066__$1;
(statearr_31071_31097[(1)] = (5));

} else {
var statearr_31072_31098 = state_31066__$1;
(statearr_31072_31098[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (13))){
var state_31066__$1 = state_31066;
var statearr_31073_31099 = state_31066__$1;
(statearr_31073_31099[(2)] = null);

(statearr_31073_31099[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (6))){
var inst_31045 = (state_31066[(7)]);
var state_31066__$1 = state_31066;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31066__$1,(11),to,inst_31045);
} else {
if((state_val_31067 === (3))){
var inst_31064 = (state_31066[(2)]);
var state_31066__$1 = state_31066;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31066__$1,inst_31064);
} else {
if((state_val_31067 === (12))){
var state_31066__$1 = state_31066;
var statearr_31074_31100 = state_31066__$1;
(statearr_31074_31100[(2)] = null);

(statearr_31074_31100[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (2))){
var state_31066__$1 = state_31066;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31066__$1,(4),from);
} else {
if((state_val_31067 === (11))){
var inst_31055 = (state_31066[(2)]);
var state_31066__$1 = state_31066;
if(cljs.core.truth_(inst_31055)){
var statearr_31075_31101 = state_31066__$1;
(statearr_31075_31101[(1)] = (12));

} else {
var statearr_31076_31102 = state_31066__$1;
(statearr_31076_31102[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (9))){
var state_31066__$1 = state_31066;
var statearr_31077_31103 = state_31066__$1;
(statearr_31077_31103[(2)] = null);

(statearr_31077_31103[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (5))){
var state_31066__$1 = state_31066;
if(cljs.core.truth_(close_QMARK_)){
var statearr_31078_31104 = state_31066__$1;
(statearr_31078_31104[(1)] = (8));

} else {
var statearr_31079_31105 = state_31066__$1;
(statearr_31079_31105[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (14))){
var inst_31060 = (state_31066[(2)]);
var state_31066__$1 = state_31066;
var statearr_31080_31106 = state_31066__$1;
(statearr_31080_31106[(2)] = inst_31060);

(statearr_31080_31106[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (10))){
var inst_31052 = (state_31066[(2)]);
var state_31066__$1 = state_31066;
var statearr_31081_31107 = state_31066__$1;
(statearr_31081_31107[(2)] = inst_31052);

(statearr_31081_31107[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31067 === (8))){
var inst_31049 = cljs.core.async.close_BANG_.call(null,to);
var state_31066__$1 = state_31066;
var statearr_31082_31108 = state_31066__$1;
(statearr_31082_31108[(2)] = inst_31049);

(statearr_31082_31108[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___31094))
;
return ((function (switch__30799__auto__,c__30913__auto___31094){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_31086 = [null,null,null,null,null,null,null,null];
(statearr_31086[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_31086[(1)] = (1));

return statearr_31086;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_31066){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31066);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31087){if((e31087 instanceof Object)){
var ex__30803__auto__ = e31087;
var statearr_31088_31109 = state_31066;
(statearr_31088_31109[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31066);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31087;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31110 = state_31066;
state_31066 = G__31110;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_31066){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_31066);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___31094))
})();
var state__30915__auto__ = (function (){var statearr_31089 = f__30914__auto__.call(null);
(statearr_31089[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31094);

return statearr_31089;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___31094))
);


return to;
});

cljs.core.async.pipe.cljs$lang$maxFixedArity = 3;

cljs.core.async.pipeline_STAR_ = (function cljs$core$async$pipeline_STAR_(n,to,xf,from,close_QMARK_,ex_handler,type){
if((n > (0))){
} else {
throw (new Error("Assert failed: (pos? n)"));
}

var jobs = cljs.core.async.chan.call(null,n);
var results = cljs.core.async.chan.call(null,n);
var process = ((function (jobs,results){
return (function (p__31298){
var vec__31299 = p__31298;
var v = cljs.core.nth.call(null,vec__31299,(0),null);
var p = cljs.core.nth.call(null,vec__31299,(1),null);
var job = vec__31299;
if((job == null)){
cljs.core.async.close_BANG_.call(null,results);

return null;
} else {
var res = cljs.core.async.chan.call(null,(1),xf,ex_handler);
var c__30913__auto___31485 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results){
return (function (state_31306){
var state_val_31307 = (state_31306[(1)]);
if((state_val_31307 === (1))){
var state_31306__$1 = state_31306;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31306__$1,(2),res,v);
} else {
if((state_val_31307 === (2))){
var inst_31303 = (state_31306[(2)]);
var inst_31304 = cljs.core.async.close_BANG_.call(null,res);
var state_31306__$1 = (function (){var statearr_31308 = state_31306;
(statearr_31308[(7)] = inst_31303);

return statearr_31308;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31306__$1,inst_31304);
} else {
return null;
}
}
});})(c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results))
;
return ((function (switch__30799__auto__,c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_31312 = [null,null,null,null,null,null,null,null];
(statearr_31312[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__);

(statearr_31312[(1)] = (1));

return statearr_31312;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1 = (function (state_31306){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31306);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31313){if((e31313 instanceof Object)){
var ex__30803__auto__ = e31313;
var statearr_31314_31486 = state_31306;
(statearr_31314_31486[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31306);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31313;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31487 = state_31306;
state_31306 = G__31487;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = function(state_31306){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1.call(this,state_31306);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results))
})();
var state__30915__auto__ = (function (){var statearr_31315 = f__30914__auto__.call(null);
(statearr_31315[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31485);

return statearr_31315;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___31485,res,vec__31299,v,p,job,jobs,results))
);


cljs.core.async.put_BANG_.call(null,p,res);

return true;
}
});})(jobs,results))
;
var async = ((function (jobs,results,process){
return (function (p__31316){
var vec__31317 = p__31316;
var v = cljs.core.nth.call(null,vec__31317,(0),null);
var p = cljs.core.nth.call(null,vec__31317,(1),null);
var job = vec__31317;
if((job == null)){
cljs.core.async.close_BANG_.call(null,results);

return null;
} else {
var res = cljs.core.async.chan.call(null,(1));
xf.call(null,v,res);

cljs.core.async.put_BANG_.call(null,p,res);

return true;
}
});})(jobs,results,process))
;
var n__24359__auto___31488 = n;
var __31489 = (0);
while(true){
if((__31489 < n__24359__auto___31488)){
var G__31320_31490 = type;
var G__31320_31491__$1 = (((G__31320_31490 instanceof cljs.core.Keyword))?G__31320_31490.fqn:null);
switch (G__31320_31491__$1) {
case "compute":
var c__30913__auto___31493 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (__31489,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (__31489,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function (state_31333){
var state_val_31334 = (state_31333[(1)]);
if((state_val_31334 === (1))){
var state_31333__$1 = state_31333;
var statearr_31335_31494 = state_31333__$1;
(statearr_31335_31494[(2)] = null);

(statearr_31335_31494[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31334 === (2))){
var state_31333__$1 = state_31333;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31333__$1,(4),jobs);
} else {
if((state_val_31334 === (3))){
var inst_31331 = (state_31333[(2)]);
var state_31333__$1 = state_31333;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31333__$1,inst_31331);
} else {
if((state_val_31334 === (4))){
var inst_31323 = (state_31333[(2)]);
var inst_31324 = process.call(null,inst_31323);
var state_31333__$1 = state_31333;
if(cljs.core.truth_(inst_31324)){
var statearr_31336_31495 = state_31333__$1;
(statearr_31336_31495[(1)] = (5));

} else {
var statearr_31337_31496 = state_31333__$1;
(statearr_31337_31496[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31334 === (5))){
var state_31333__$1 = state_31333;
var statearr_31338_31497 = state_31333__$1;
(statearr_31338_31497[(2)] = null);

(statearr_31338_31497[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31334 === (6))){
var state_31333__$1 = state_31333;
var statearr_31339_31498 = state_31333__$1;
(statearr_31339_31498[(2)] = null);

(statearr_31339_31498[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31334 === (7))){
var inst_31329 = (state_31333[(2)]);
var state_31333__$1 = state_31333;
var statearr_31340_31499 = state_31333__$1;
(statearr_31340_31499[(2)] = inst_31329);

(statearr_31340_31499[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(__31489,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
;
return ((function (__31489,switch__30799__auto__,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_31344 = [null,null,null,null,null,null,null];
(statearr_31344[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__);

(statearr_31344[(1)] = (1));

return statearr_31344;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1 = (function (state_31333){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31333);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31345){if((e31345 instanceof Object)){
var ex__30803__auto__ = e31345;
var statearr_31346_31500 = state_31333;
(statearr_31346_31500[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31333);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31345;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31501 = state_31333;
state_31333 = G__31501;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = function(state_31333){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1.call(this,state_31333);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__;
})()
;})(__31489,switch__30799__auto__,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
})();
var state__30915__auto__ = (function (){var statearr_31347 = f__30914__auto__.call(null);
(statearr_31347[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31493);

return statearr_31347;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(__31489,c__30913__auto___31493,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
);


break;
case "async":
var c__30913__auto___31502 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (__31489,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (__31489,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function (state_31360){
var state_val_31361 = (state_31360[(1)]);
if((state_val_31361 === (1))){
var state_31360__$1 = state_31360;
var statearr_31362_31503 = state_31360__$1;
(statearr_31362_31503[(2)] = null);

(statearr_31362_31503[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31361 === (2))){
var state_31360__$1 = state_31360;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31360__$1,(4),jobs);
} else {
if((state_val_31361 === (3))){
var inst_31358 = (state_31360[(2)]);
var state_31360__$1 = state_31360;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31360__$1,inst_31358);
} else {
if((state_val_31361 === (4))){
var inst_31350 = (state_31360[(2)]);
var inst_31351 = async.call(null,inst_31350);
var state_31360__$1 = state_31360;
if(cljs.core.truth_(inst_31351)){
var statearr_31363_31504 = state_31360__$1;
(statearr_31363_31504[(1)] = (5));

} else {
var statearr_31364_31505 = state_31360__$1;
(statearr_31364_31505[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31361 === (5))){
var state_31360__$1 = state_31360;
var statearr_31365_31506 = state_31360__$1;
(statearr_31365_31506[(2)] = null);

(statearr_31365_31506[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31361 === (6))){
var state_31360__$1 = state_31360;
var statearr_31366_31507 = state_31360__$1;
(statearr_31366_31507[(2)] = null);

(statearr_31366_31507[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31361 === (7))){
var inst_31356 = (state_31360[(2)]);
var state_31360__$1 = state_31360;
var statearr_31367_31508 = state_31360__$1;
(statearr_31367_31508[(2)] = inst_31356);

(statearr_31367_31508[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(__31489,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
;
return ((function (__31489,switch__30799__auto__,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_31371 = [null,null,null,null,null,null,null];
(statearr_31371[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__);

(statearr_31371[(1)] = (1));

return statearr_31371;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1 = (function (state_31360){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31360);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31372){if((e31372 instanceof Object)){
var ex__30803__auto__ = e31372;
var statearr_31373_31509 = state_31360;
(statearr_31373_31509[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31360);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31372;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31510 = state_31360;
state_31360 = G__31510;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = function(state_31360){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1.call(this,state_31360);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__;
})()
;})(__31489,switch__30799__auto__,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
})();
var state__30915__auto__ = (function (){var statearr_31374 = f__30914__auto__.call(null);
(statearr_31374[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31502);

return statearr_31374;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(__31489,c__30913__auto___31502,G__31320_31490,G__31320_31491__$1,n__24359__auto___31488,jobs,results,process,async))
);


break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__31320_31491__$1)].join('')));

}

var G__31511 = (__31489 + (1));
__31489 = G__31511;
continue;
} else {
}
break;
}

var c__30913__auto___31512 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___31512,jobs,results,process,async){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___31512,jobs,results,process,async){
return (function (state_31396){
var state_val_31397 = (state_31396[(1)]);
if((state_val_31397 === (1))){
var state_31396__$1 = state_31396;
var statearr_31398_31513 = state_31396__$1;
(statearr_31398_31513[(2)] = null);

(statearr_31398_31513[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31397 === (2))){
var state_31396__$1 = state_31396;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31396__$1,(4),from);
} else {
if((state_val_31397 === (3))){
var inst_31394 = (state_31396[(2)]);
var state_31396__$1 = state_31396;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31396__$1,inst_31394);
} else {
if((state_val_31397 === (4))){
var inst_31377 = (state_31396[(7)]);
var inst_31377__$1 = (state_31396[(2)]);
var inst_31378 = (inst_31377__$1 == null);
var state_31396__$1 = (function (){var statearr_31399 = state_31396;
(statearr_31399[(7)] = inst_31377__$1);

return statearr_31399;
})();
if(cljs.core.truth_(inst_31378)){
var statearr_31400_31514 = state_31396__$1;
(statearr_31400_31514[(1)] = (5));

} else {
var statearr_31401_31515 = state_31396__$1;
(statearr_31401_31515[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31397 === (5))){
var inst_31380 = cljs.core.async.close_BANG_.call(null,jobs);
var state_31396__$1 = state_31396;
var statearr_31402_31516 = state_31396__$1;
(statearr_31402_31516[(2)] = inst_31380);

(statearr_31402_31516[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31397 === (6))){
var inst_31382 = (state_31396[(8)]);
var inst_31377 = (state_31396[(7)]);
var inst_31382__$1 = cljs.core.async.chan.call(null,(1));
var inst_31383 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_31384 = [inst_31377,inst_31382__$1];
var inst_31385 = (new cljs.core.PersistentVector(null,2,(5),inst_31383,inst_31384,null));
var state_31396__$1 = (function (){var statearr_31403 = state_31396;
(statearr_31403[(8)] = inst_31382__$1);

return statearr_31403;
})();
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31396__$1,(8),jobs,inst_31385);
} else {
if((state_val_31397 === (7))){
var inst_31392 = (state_31396[(2)]);
var state_31396__$1 = state_31396;
var statearr_31404_31517 = state_31396__$1;
(statearr_31404_31517[(2)] = inst_31392);

(statearr_31404_31517[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31397 === (8))){
var inst_31382 = (state_31396[(8)]);
var inst_31387 = (state_31396[(2)]);
var state_31396__$1 = (function (){var statearr_31405 = state_31396;
(statearr_31405[(9)] = inst_31387);

return statearr_31405;
})();
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31396__$1,(9),results,inst_31382);
} else {
if((state_val_31397 === (9))){
var inst_31389 = (state_31396[(2)]);
var state_31396__$1 = (function (){var statearr_31406 = state_31396;
(statearr_31406[(10)] = inst_31389);

return statearr_31406;
})();
var statearr_31407_31518 = state_31396__$1;
(statearr_31407_31518[(2)] = null);

(statearr_31407_31518[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___31512,jobs,results,process,async))
;
return ((function (switch__30799__auto__,c__30913__auto___31512,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_31411 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_31411[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__);

(statearr_31411[(1)] = (1));

return statearr_31411;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1 = (function (state_31396){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31396);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31412){if((e31412 instanceof Object)){
var ex__30803__auto__ = e31412;
var statearr_31413_31519 = state_31396;
(statearr_31413_31519[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31396);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31412;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31520 = state_31396;
state_31396 = G__31520;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = function(state_31396){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1.call(this,state_31396);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___31512,jobs,results,process,async))
})();
var state__30915__auto__ = (function (){var statearr_31414 = f__30914__auto__.call(null);
(statearr_31414[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31512);

return statearr_31414;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___31512,jobs,results,process,async))
);


var c__30913__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto__,jobs,results,process,async){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto__,jobs,results,process,async){
return (function (state_31452){
var state_val_31453 = (state_31452[(1)]);
if((state_val_31453 === (7))){
var inst_31448 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
var statearr_31454_31521 = state_31452__$1;
(statearr_31454_31521[(2)] = inst_31448);

(statearr_31454_31521[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (20))){
var state_31452__$1 = state_31452;
var statearr_31455_31522 = state_31452__$1;
(statearr_31455_31522[(2)] = null);

(statearr_31455_31522[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (1))){
var state_31452__$1 = state_31452;
var statearr_31456_31523 = state_31452__$1;
(statearr_31456_31523[(2)] = null);

(statearr_31456_31523[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (4))){
var inst_31417 = (state_31452[(7)]);
var inst_31417__$1 = (state_31452[(2)]);
var inst_31418 = (inst_31417__$1 == null);
var state_31452__$1 = (function (){var statearr_31457 = state_31452;
(statearr_31457[(7)] = inst_31417__$1);

return statearr_31457;
})();
if(cljs.core.truth_(inst_31418)){
var statearr_31458_31524 = state_31452__$1;
(statearr_31458_31524[(1)] = (5));

} else {
var statearr_31459_31525 = state_31452__$1;
(statearr_31459_31525[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (15))){
var inst_31430 = (state_31452[(8)]);
var state_31452__$1 = state_31452;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31452__$1,(18),to,inst_31430);
} else {
if((state_val_31453 === (21))){
var inst_31443 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
var statearr_31460_31526 = state_31452__$1;
(statearr_31460_31526[(2)] = inst_31443);

(statearr_31460_31526[(1)] = (13));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (13))){
var inst_31445 = (state_31452[(2)]);
var state_31452__$1 = (function (){var statearr_31461 = state_31452;
(statearr_31461[(9)] = inst_31445);

return statearr_31461;
})();
var statearr_31462_31527 = state_31452__$1;
(statearr_31462_31527[(2)] = null);

(statearr_31462_31527[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (6))){
var inst_31417 = (state_31452[(7)]);
var state_31452__$1 = state_31452;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31452__$1,(11),inst_31417);
} else {
if((state_val_31453 === (17))){
var inst_31438 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
if(cljs.core.truth_(inst_31438)){
var statearr_31463_31528 = state_31452__$1;
(statearr_31463_31528[(1)] = (19));

} else {
var statearr_31464_31529 = state_31452__$1;
(statearr_31464_31529[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (3))){
var inst_31450 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31452__$1,inst_31450);
} else {
if((state_val_31453 === (12))){
var inst_31427 = (state_31452[(10)]);
var state_31452__$1 = state_31452;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31452__$1,(14),inst_31427);
} else {
if((state_val_31453 === (2))){
var state_31452__$1 = state_31452;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31452__$1,(4),results);
} else {
if((state_val_31453 === (19))){
var state_31452__$1 = state_31452;
var statearr_31465_31530 = state_31452__$1;
(statearr_31465_31530[(2)] = null);

(statearr_31465_31530[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (11))){
var inst_31427 = (state_31452[(2)]);
var state_31452__$1 = (function (){var statearr_31466 = state_31452;
(statearr_31466[(10)] = inst_31427);

return statearr_31466;
})();
var statearr_31467_31531 = state_31452__$1;
(statearr_31467_31531[(2)] = null);

(statearr_31467_31531[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (9))){
var state_31452__$1 = state_31452;
var statearr_31468_31532 = state_31452__$1;
(statearr_31468_31532[(2)] = null);

(statearr_31468_31532[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (5))){
var state_31452__$1 = state_31452;
if(cljs.core.truth_(close_QMARK_)){
var statearr_31469_31533 = state_31452__$1;
(statearr_31469_31533[(1)] = (8));

} else {
var statearr_31470_31534 = state_31452__$1;
(statearr_31470_31534[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (14))){
var inst_31432 = (state_31452[(11)]);
var inst_31430 = (state_31452[(8)]);
var inst_31430__$1 = (state_31452[(2)]);
var inst_31431 = (inst_31430__$1 == null);
var inst_31432__$1 = cljs.core.not.call(null,inst_31431);
var state_31452__$1 = (function (){var statearr_31471 = state_31452;
(statearr_31471[(11)] = inst_31432__$1);

(statearr_31471[(8)] = inst_31430__$1);

return statearr_31471;
})();
if(inst_31432__$1){
var statearr_31472_31535 = state_31452__$1;
(statearr_31472_31535[(1)] = (15));

} else {
var statearr_31473_31536 = state_31452__$1;
(statearr_31473_31536[(1)] = (16));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (16))){
var inst_31432 = (state_31452[(11)]);
var state_31452__$1 = state_31452;
var statearr_31474_31537 = state_31452__$1;
(statearr_31474_31537[(2)] = inst_31432);

(statearr_31474_31537[(1)] = (17));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (10))){
var inst_31424 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
var statearr_31475_31538 = state_31452__$1;
(statearr_31475_31538[(2)] = inst_31424);

(statearr_31475_31538[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (18))){
var inst_31435 = (state_31452[(2)]);
var state_31452__$1 = state_31452;
var statearr_31476_31539 = state_31452__$1;
(statearr_31476_31539[(2)] = inst_31435);

(statearr_31476_31539[(1)] = (17));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31453 === (8))){
var inst_31421 = cljs.core.async.close_BANG_.call(null,to);
var state_31452__$1 = state_31452;
var statearr_31477_31540 = state_31452__$1;
(statearr_31477_31540[(2)] = inst_31421);

(statearr_31477_31540[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto__,jobs,results,process,async))
;
return ((function (switch__30799__auto__,c__30913__auto__,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_31481 = [null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_31481[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__);

(statearr_31481[(1)] = (1));

return statearr_31481;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1 = (function (state_31452){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31452);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31482){if((e31482 instanceof Object)){
var ex__30803__auto__ = e31482;
var statearr_31483_31541 = state_31452;
(statearr_31483_31541[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31452);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31482;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31542 = state_31452;
state_31452 = G__31542;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__ = function(state_31452){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1.call(this,state_31452);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto__,jobs,results,process,async))
})();
var state__30915__auto__ = (function (){var statearr_31484 = f__30914__auto__.call(null);
(statearr_31484[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto__);

return statearr_31484;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto__,jobs,results,process,async))
);

return c__30913__auto__;
});
/**
 * Takes elements from the from channel and supplies them to the to
 *   channel, subject to the async function af, with parallelism n. af
 *   must be a function of two arguments, the first an input value and
 *   the second a channel on which to place the result(s). af must close!
 *   the channel before returning.  The presumption is that af will
 *   return immediately, having launched some asynchronous operation
 *   whose completion/callback will manipulate the result channel. Outputs
 *   will be returned in order relative to  the inputs. By default, the to
 *   channel will be closed when the from channel closes, but can be
 *   determined by the close?  parameter. Will stop consuming the from
 *   channel if the to channel closes.
 */
cljs.core.async.pipeline_async = (function cljs$core$async$pipeline_async(var_args){
var args31543 = [];
var len__24559__auto___31546 = arguments.length;
var i__24560__auto___31547 = (0);
while(true){
if((i__24560__auto___31547 < len__24559__auto___31546)){
args31543.push((arguments[i__24560__auto___31547]));

var G__31548 = (i__24560__auto___31547 + (1));
i__24560__auto___31547 = G__31548;
continue;
} else {
}
break;
}

var G__31545 = args31543.length;
switch (G__31545) {
case 4:
return cljs.core.async.pipeline_async.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

break;
case 5:
return cljs.core.async.pipeline_async.cljs$core$IFn$_invoke$arity$5((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]),(arguments[(4)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31543.length)].join('')));

}
});

cljs.core.async.pipeline_async.cljs$core$IFn$_invoke$arity$4 = (function (n,to,af,from){
return cljs.core.async.pipeline_async.call(null,n,to,af,from,true);
});

cljs.core.async.pipeline_async.cljs$core$IFn$_invoke$arity$5 = (function (n,to,af,from,close_QMARK_){
return cljs.core.async.pipeline_STAR_.call(null,n,to,af,from,close_QMARK_,null,new cljs.core.Keyword(null,"async","async",1050769601));
});

cljs.core.async.pipeline_async.cljs$lang$maxFixedArity = 5;

/**
 * Takes elements from the from channel and supplies them to the to
 *   channel, subject to the transducer xf, with parallelism n. Because
 *   it is parallel, the transducer will be applied independently to each
 *   element, not across elements, and may produce zero or more outputs
 *   per input.  Outputs will be returned in order relative to the
 *   inputs. By default, the to channel will be closed when the from
 *   channel closes, but can be determined by the close?  parameter. Will
 *   stop consuming the from channel if the to channel closes.
 * 
 *   Note this is supplied for API compatibility with the Clojure version.
 *   Values of N > 1 will not result in actual concurrency in a
 *   single-threaded runtime.
 */
cljs.core.async.pipeline = (function cljs$core$async$pipeline(var_args){
var args31550 = [];
var len__24559__auto___31553 = arguments.length;
var i__24560__auto___31554 = (0);
while(true){
if((i__24560__auto___31554 < len__24559__auto___31553)){
args31550.push((arguments[i__24560__auto___31554]));

var G__31555 = (i__24560__auto___31554 + (1));
i__24560__auto___31554 = G__31555;
continue;
} else {
}
break;
}

var G__31552 = args31550.length;
switch (G__31552) {
case 4:
return cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

break;
case 5:
return cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$5((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]),(arguments[(4)]));

break;
case 6:
return cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$6((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]),(arguments[(4)]),(arguments[(5)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31550.length)].join('')));

}
});

cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$4 = (function (n,to,xf,from){
return cljs.core.async.pipeline.call(null,n,to,xf,from,true);
});

cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$5 = (function (n,to,xf,from,close_QMARK_){
return cljs.core.async.pipeline.call(null,n,to,xf,from,close_QMARK_,null);
});

cljs.core.async.pipeline.cljs$core$IFn$_invoke$arity$6 = (function (n,to,xf,from,close_QMARK_,ex_handler){
return cljs.core.async.pipeline_STAR_.call(null,n,to,xf,from,close_QMARK_,ex_handler,new cljs.core.Keyword(null,"compute","compute",1555393130));
});

cljs.core.async.pipeline.cljs$lang$maxFixedArity = 6;

/**
 * Takes a predicate and a source channel and returns a vector of two
 *   channels, the first of which will contain the values for which the
 *   predicate returned true, the second those for which it returned
 *   false.
 * 
 *   The out channels will be unbuffered by default, or two buf-or-ns can
 *   be supplied. The channels will close after the source channel has
 *   closed.
 */
cljs.core.async.split = (function cljs$core$async$split(var_args){
var args31557 = [];
var len__24559__auto___31610 = arguments.length;
var i__24560__auto___31611 = (0);
while(true){
if((i__24560__auto___31611 < len__24559__auto___31610)){
args31557.push((arguments[i__24560__auto___31611]));

var G__31612 = (i__24560__auto___31611 + (1));
i__24560__auto___31611 = G__31612;
continue;
} else {
}
break;
}

var G__31559 = args31557.length;
switch (G__31559) {
case 2:
return cljs.core.async.split.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 4:
return cljs.core.async.split.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31557.length)].join('')));

}
});

cljs.core.async.split.cljs$core$IFn$_invoke$arity$2 = (function (p,ch){
return cljs.core.async.split.call(null,p,ch,null,null);
});

cljs.core.async.split.cljs$core$IFn$_invoke$arity$4 = (function (p,ch,t_buf_or_n,f_buf_or_n){
var tc = cljs.core.async.chan.call(null,t_buf_or_n);
var fc = cljs.core.async.chan.call(null,f_buf_or_n);
var c__30913__auto___31614 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___31614,tc,fc){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___31614,tc,fc){
return (function (state_31585){
var state_val_31586 = (state_31585[(1)]);
if((state_val_31586 === (7))){
var inst_31581 = (state_31585[(2)]);
var state_31585__$1 = state_31585;
var statearr_31587_31615 = state_31585__$1;
(statearr_31587_31615[(2)] = inst_31581);

(statearr_31587_31615[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (1))){
var state_31585__$1 = state_31585;
var statearr_31588_31616 = state_31585__$1;
(statearr_31588_31616[(2)] = null);

(statearr_31588_31616[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (4))){
var inst_31562 = (state_31585[(7)]);
var inst_31562__$1 = (state_31585[(2)]);
var inst_31563 = (inst_31562__$1 == null);
var state_31585__$1 = (function (){var statearr_31589 = state_31585;
(statearr_31589[(7)] = inst_31562__$1);

return statearr_31589;
})();
if(cljs.core.truth_(inst_31563)){
var statearr_31590_31617 = state_31585__$1;
(statearr_31590_31617[(1)] = (5));

} else {
var statearr_31591_31618 = state_31585__$1;
(statearr_31591_31618[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (13))){
var state_31585__$1 = state_31585;
var statearr_31592_31619 = state_31585__$1;
(statearr_31592_31619[(2)] = null);

(statearr_31592_31619[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (6))){
var inst_31562 = (state_31585[(7)]);
var inst_31568 = p.call(null,inst_31562);
var state_31585__$1 = state_31585;
if(cljs.core.truth_(inst_31568)){
var statearr_31593_31620 = state_31585__$1;
(statearr_31593_31620[(1)] = (9));

} else {
var statearr_31594_31621 = state_31585__$1;
(statearr_31594_31621[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (3))){
var inst_31583 = (state_31585[(2)]);
var state_31585__$1 = state_31585;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31585__$1,inst_31583);
} else {
if((state_val_31586 === (12))){
var state_31585__$1 = state_31585;
var statearr_31595_31622 = state_31585__$1;
(statearr_31595_31622[(2)] = null);

(statearr_31595_31622[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (2))){
var state_31585__$1 = state_31585;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31585__$1,(4),ch);
} else {
if((state_val_31586 === (11))){
var inst_31562 = (state_31585[(7)]);
var inst_31572 = (state_31585[(2)]);
var state_31585__$1 = state_31585;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31585__$1,(8),inst_31572,inst_31562);
} else {
if((state_val_31586 === (9))){
var state_31585__$1 = state_31585;
var statearr_31596_31623 = state_31585__$1;
(statearr_31596_31623[(2)] = tc);

(statearr_31596_31623[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (5))){
var inst_31565 = cljs.core.async.close_BANG_.call(null,tc);
var inst_31566 = cljs.core.async.close_BANG_.call(null,fc);
var state_31585__$1 = (function (){var statearr_31597 = state_31585;
(statearr_31597[(8)] = inst_31565);

return statearr_31597;
})();
var statearr_31598_31624 = state_31585__$1;
(statearr_31598_31624[(2)] = inst_31566);

(statearr_31598_31624[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (14))){
var inst_31579 = (state_31585[(2)]);
var state_31585__$1 = state_31585;
var statearr_31599_31625 = state_31585__$1;
(statearr_31599_31625[(2)] = inst_31579);

(statearr_31599_31625[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (10))){
var state_31585__$1 = state_31585;
var statearr_31600_31626 = state_31585__$1;
(statearr_31600_31626[(2)] = fc);

(statearr_31600_31626[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31586 === (8))){
var inst_31574 = (state_31585[(2)]);
var state_31585__$1 = state_31585;
if(cljs.core.truth_(inst_31574)){
var statearr_31601_31627 = state_31585__$1;
(statearr_31601_31627[(1)] = (12));

} else {
var statearr_31602_31628 = state_31585__$1;
(statearr_31602_31628[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___31614,tc,fc))
;
return ((function (switch__30799__auto__,c__30913__auto___31614,tc,fc){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_31606 = [null,null,null,null,null,null,null,null,null];
(statearr_31606[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_31606[(1)] = (1));

return statearr_31606;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_31585){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31585);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31607){if((e31607 instanceof Object)){
var ex__30803__auto__ = e31607;
var statearr_31608_31629 = state_31585;
(statearr_31608_31629[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31585);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31607;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31630 = state_31585;
state_31585 = G__31630;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_31585){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_31585);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___31614,tc,fc))
})();
var state__30915__auto__ = (function (){var statearr_31609 = f__30914__auto__.call(null);
(statearr_31609[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___31614);

return statearr_31609;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___31614,tc,fc))
);


return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [tc,fc], null);
});

cljs.core.async.split.cljs$lang$maxFixedArity = 4;

/**
 * f should be a function of 2 arguments. Returns a channel containing
 *   the single result of applying f to init and the first item from the
 *   channel, then applying f to that result and the 2nd item, etc. If
 *   the channel closes without yielding items, returns init and f is not
 *   called. ch must close before reduce produces a result.
 */
cljs.core.async.reduce = (function cljs$core$async$reduce(f,init,ch){
var c__30913__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto__){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto__){
return (function (state_31694){
var state_val_31695 = (state_31694[(1)]);
if((state_val_31695 === (7))){
var inst_31690 = (state_31694[(2)]);
var state_31694__$1 = state_31694;
var statearr_31696_31717 = state_31694__$1;
(statearr_31696_31717[(2)] = inst_31690);

(statearr_31696_31717[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (1))){
var inst_31674 = init;
var state_31694__$1 = (function (){var statearr_31697 = state_31694;
(statearr_31697[(7)] = inst_31674);

return statearr_31697;
})();
var statearr_31698_31718 = state_31694__$1;
(statearr_31698_31718[(2)] = null);

(statearr_31698_31718[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (4))){
var inst_31677 = (state_31694[(8)]);
var inst_31677__$1 = (state_31694[(2)]);
var inst_31678 = (inst_31677__$1 == null);
var state_31694__$1 = (function (){var statearr_31699 = state_31694;
(statearr_31699[(8)] = inst_31677__$1);

return statearr_31699;
})();
if(cljs.core.truth_(inst_31678)){
var statearr_31700_31719 = state_31694__$1;
(statearr_31700_31719[(1)] = (5));

} else {
var statearr_31701_31720 = state_31694__$1;
(statearr_31701_31720[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (6))){
var inst_31674 = (state_31694[(7)]);
var inst_31681 = (state_31694[(9)]);
var inst_31677 = (state_31694[(8)]);
var inst_31681__$1 = f.call(null,inst_31674,inst_31677);
var inst_31682 = cljs.core.reduced_QMARK_.call(null,inst_31681__$1);
var state_31694__$1 = (function (){var statearr_31702 = state_31694;
(statearr_31702[(9)] = inst_31681__$1);

return statearr_31702;
})();
if(inst_31682){
var statearr_31703_31721 = state_31694__$1;
(statearr_31703_31721[(1)] = (8));

} else {
var statearr_31704_31722 = state_31694__$1;
(statearr_31704_31722[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (3))){
var inst_31692 = (state_31694[(2)]);
var state_31694__$1 = state_31694;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31694__$1,inst_31692);
} else {
if((state_val_31695 === (2))){
var state_31694__$1 = state_31694;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31694__$1,(4),ch);
} else {
if((state_val_31695 === (9))){
var inst_31681 = (state_31694[(9)]);
var inst_31674 = inst_31681;
var state_31694__$1 = (function (){var statearr_31705 = state_31694;
(statearr_31705[(7)] = inst_31674);

return statearr_31705;
})();
var statearr_31706_31723 = state_31694__$1;
(statearr_31706_31723[(2)] = null);

(statearr_31706_31723[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (5))){
var inst_31674 = (state_31694[(7)]);
var state_31694__$1 = state_31694;
var statearr_31707_31724 = state_31694__$1;
(statearr_31707_31724[(2)] = inst_31674);

(statearr_31707_31724[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (10))){
var inst_31688 = (state_31694[(2)]);
var state_31694__$1 = state_31694;
var statearr_31708_31725 = state_31694__$1;
(statearr_31708_31725[(2)] = inst_31688);

(statearr_31708_31725[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31695 === (8))){
var inst_31681 = (state_31694[(9)]);
var inst_31684 = cljs.core.deref.call(null,inst_31681);
var state_31694__$1 = state_31694;
var statearr_31709_31726 = state_31694__$1;
(statearr_31709_31726[(2)] = inst_31684);

(statearr_31709_31726[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto__))
;
return ((function (switch__30799__auto__,c__30913__auto__){
return (function() {
var cljs$core$async$reduce_$_state_machine__30800__auto__ = null;
var cljs$core$async$reduce_$_state_machine__30800__auto____0 = (function (){
var statearr_31713 = [null,null,null,null,null,null,null,null,null,null];
(statearr_31713[(0)] = cljs$core$async$reduce_$_state_machine__30800__auto__);

(statearr_31713[(1)] = (1));

return statearr_31713;
});
var cljs$core$async$reduce_$_state_machine__30800__auto____1 = (function (state_31694){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31694);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31714){if((e31714 instanceof Object)){
var ex__30803__auto__ = e31714;
var statearr_31715_31727 = state_31694;
(statearr_31715_31727[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31694);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31714;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31728 = state_31694;
state_31694 = G__31728;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$reduce_$_state_machine__30800__auto__ = function(state_31694){
switch(arguments.length){
case 0:
return cljs$core$async$reduce_$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$reduce_$_state_machine__30800__auto____1.call(this,state_31694);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$reduce_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$reduce_$_state_machine__30800__auto____0;
cljs$core$async$reduce_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$reduce_$_state_machine__30800__auto____1;
return cljs$core$async$reduce_$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto__))
})();
var state__30915__auto__ = (function (){var statearr_31716 = f__30914__auto__.call(null);
(statearr_31716[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto__);

return statearr_31716;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto__))
);

return c__30913__auto__;
});
/**
 * async/reduces a channel with a transformation (xform f).
 *   Returns a channel containing the result.  ch must close before
 *   transduce produces a result.
 */
cljs.core.async.transduce = (function cljs$core$async$transduce(xform,f,init,ch){
var f__$1 = xform.call(null,f);
var c__30913__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto__,f__$1){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto__,f__$1){
return (function (state_31748){
var state_val_31749 = (state_31748[(1)]);
if((state_val_31749 === (1))){
var inst_31743 = cljs.core.async.reduce.call(null,f__$1,init,ch);
var state_31748__$1 = state_31748;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31748__$1,(2),inst_31743);
} else {
if((state_val_31749 === (2))){
var inst_31745 = (state_31748[(2)]);
var inst_31746 = f__$1.call(null,inst_31745);
var state_31748__$1 = state_31748;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31748__$1,inst_31746);
} else {
return null;
}
}
});})(c__30913__auto__,f__$1))
;
return ((function (switch__30799__auto__,c__30913__auto__,f__$1){
return (function() {
var cljs$core$async$transduce_$_state_machine__30800__auto__ = null;
var cljs$core$async$transduce_$_state_machine__30800__auto____0 = (function (){
var statearr_31753 = [null,null,null,null,null,null,null];
(statearr_31753[(0)] = cljs$core$async$transduce_$_state_machine__30800__auto__);

(statearr_31753[(1)] = (1));

return statearr_31753;
});
var cljs$core$async$transduce_$_state_machine__30800__auto____1 = (function (state_31748){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31748);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31754){if((e31754 instanceof Object)){
var ex__30803__auto__ = e31754;
var statearr_31755_31757 = state_31748;
(statearr_31755_31757[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31748);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31754;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31758 = state_31748;
state_31748 = G__31758;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$transduce_$_state_machine__30800__auto__ = function(state_31748){
switch(arguments.length){
case 0:
return cljs$core$async$transduce_$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$transduce_$_state_machine__30800__auto____1.call(this,state_31748);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$transduce_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$transduce_$_state_machine__30800__auto____0;
cljs$core$async$transduce_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$transduce_$_state_machine__30800__auto____1;
return cljs$core$async$transduce_$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto__,f__$1))
})();
var state__30915__auto__ = (function (){var statearr_31756 = f__30914__auto__.call(null);
(statearr_31756[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto__);

return statearr_31756;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto__,f__$1))
);

return c__30913__auto__;
});
/**
 * Puts the contents of coll into the supplied channel.
 * 
 *   By default the channel will be closed after the items are copied,
 *   but can be determined by the close? parameter.
 * 
 *   Returns a channel which will close after the items are copied.
 */
cljs.core.async.onto_chan = (function cljs$core$async$onto_chan(var_args){
var args31759 = [];
var len__24559__auto___31811 = arguments.length;
var i__24560__auto___31812 = (0);
while(true){
if((i__24560__auto___31812 < len__24559__auto___31811)){
args31759.push((arguments[i__24560__auto___31812]));

var G__31813 = (i__24560__auto___31812 + (1));
i__24560__auto___31812 = G__31813;
continue;
} else {
}
break;
}

var G__31761 = args31759.length;
switch (G__31761) {
case 2:
return cljs.core.async.onto_chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.onto_chan.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args31759.length)].join('')));

}
});

cljs.core.async.onto_chan.cljs$core$IFn$_invoke$arity$2 = (function (ch,coll){
return cljs.core.async.onto_chan.call(null,ch,coll,true);
});

cljs.core.async.onto_chan.cljs$core$IFn$_invoke$arity$3 = (function (ch,coll,close_QMARK_){
var c__30913__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto__){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto__){
return (function (state_31786){
var state_val_31787 = (state_31786[(1)]);
if((state_val_31787 === (7))){
var inst_31768 = (state_31786[(2)]);
var state_31786__$1 = state_31786;
var statearr_31788_31815 = state_31786__$1;
(statearr_31788_31815[(2)] = inst_31768);

(statearr_31788_31815[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (1))){
var inst_31762 = cljs.core.seq.call(null,coll);
var inst_31763 = inst_31762;
var state_31786__$1 = (function (){var statearr_31789 = state_31786;
(statearr_31789[(7)] = inst_31763);

return statearr_31789;
})();
var statearr_31790_31816 = state_31786__$1;
(statearr_31790_31816[(2)] = null);

(statearr_31790_31816[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (4))){
var inst_31763 = (state_31786[(7)]);
var inst_31766 = cljs.core.first.call(null,inst_31763);
var state_31786__$1 = state_31786;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31786__$1,(7),ch,inst_31766);
} else {
if((state_val_31787 === (13))){
var inst_31780 = (state_31786[(2)]);
var state_31786__$1 = state_31786;
var statearr_31791_31817 = state_31786__$1;
(statearr_31791_31817[(2)] = inst_31780);

(statearr_31791_31817[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (6))){
var inst_31771 = (state_31786[(2)]);
var state_31786__$1 = state_31786;
if(cljs.core.truth_(inst_31771)){
var statearr_31792_31818 = state_31786__$1;
(statearr_31792_31818[(1)] = (8));

} else {
var statearr_31793_31819 = state_31786__$1;
(statearr_31793_31819[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (3))){
var inst_31784 = (state_31786[(2)]);
var state_31786__$1 = state_31786;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31786__$1,inst_31784);
} else {
if((state_val_31787 === (12))){
var state_31786__$1 = state_31786;
var statearr_31794_31820 = state_31786__$1;
(statearr_31794_31820[(2)] = null);

(statearr_31794_31820[(1)] = (13));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (2))){
var inst_31763 = (state_31786[(7)]);
var state_31786__$1 = state_31786;
if(cljs.core.truth_(inst_31763)){
var statearr_31795_31821 = state_31786__$1;
(statearr_31795_31821[(1)] = (4));

} else {
var statearr_31796_31822 = state_31786__$1;
(statearr_31796_31822[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (11))){
var inst_31777 = cljs.core.async.close_BANG_.call(null,ch);
var state_31786__$1 = state_31786;
var statearr_31797_31823 = state_31786__$1;
(statearr_31797_31823[(2)] = inst_31777);

(statearr_31797_31823[(1)] = (13));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (9))){
var state_31786__$1 = state_31786;
if(cljs.core.truth_(close_QMARK_)){
var statearr_31798_31824 = state_31786__$1;
(statearr_31798_31824[(1)] = (11));

} else {
var statearr_31799_31825 = state_31786__$1;
(statearr_31799_31825[(1)] = (12));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (5))){
var inst_31763 = (state_31786[(7)]);
var state_31786__$1 = state_31786;
var statearr_31800_31826 = state_31786__$1;
(statearr_31800_31826[(2)] = inst_31763);

(statearr_31800_31826[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (10))){
var inst_31782 = (state_31786[(2)]);
var state_31786__$1 = state_31786;
var statearr_31801_31827 = state_31786__$1;
(statearr_31801_31827[(2)] = inst_31782);

(statearr_31801_31827[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31787 === (8))){
var inst_31763 = (state_31786[(7)]);
var inst_31773 = cljs.core.next.call(null,inst_31763);
var inst_31763__$1 = inst_31773;
var state_31786__$1 = (function (){var statearr_31802 = state_31786;
(statearr_31802[(7)] = inst_31763__$1);

return statearr_31802;
})();
var statearr_31803_31828 = state_31786__$1;
(statearr_31803_31828[(2)] = null);

(statearr_31803_31828[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto__))
;
return ((function (switch__30799__auto__,c__30913__auto__){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_31807 = [null,null,null,null,null,null,null,null];
(statearr_31807[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_31807[(1)] = (1));

return statearr_31807;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_31786){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_31786);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e31808){if((e31808 instanceof Object)){
var ex__30803__auto__ = e31808;
var statearr_31809_31829 = state_31786;
(statearr_31809_31829[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_31786);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e31808;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31830 = state_31786;
state_31786 = G__31830;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_31786){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_31786);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto__))
})();
var state__30915__auto__ = (function (){var statearr_31810 = f__30914__auto__.call(null);
(statearr_31810[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto__);

return statearr_31810;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto__))
);

return c__30913__auto__;
});

cljs.core.async.onto_chan.cljs$lang$maxFixedArity = 3;

/**
 * Creates and returns a channel which contains the contents of coll,
 *   closing when exhausted.
 */
cljs.core.async.to_chan = (function cljs$core$async$to_chan(coll){
var ch = cljs.core.async.chan.call(null,cljs.core.bounded_count.call(null,(100),coll));
cljs.core.async.onto_chan.call(null,ch,coll);

return ch;
});

/**
 * @interface
 */
cljs.core.async.Mux = function(){};

cljs.core.async.muxch_STAR_ = (function cljs$core$async$muxch_STAR_(_){
if((!((_ == null))) && (!((_.cljs$core$async$Mux$muxch_STAR_$arity$1 == null)))){
return _.cljs$core$async$Mux$muxch_STAR_$arity$1(_);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (cljs.core.async.muxch_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_);
} else {
var m__24057__auto____$1 = (cljs.core.async.muxch_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_);
} else {
throw cljs.core.missing_protocol.call(null,"Mux.muxch*",_);
}
}
}
});


/**
 * @interface
 */
cljs.core.async.Mult = function(){};

cljs.core.async.tap_STAR_ = (function cljs$core$async$tap_STAR_(m,ch,close_QMARK_){
if((!((m == null))) && (!((m.cljs$core$async$Mult$tap_STAR_$arity$3 == null)))){
return m.cljs$core$async$Mult$tap_STAR_$arity$3(m,ch,close_QMARK_);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.tap_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,ch,close_QMARK_);
} else {
var m__24057__auto____$1 = (cljs.core.async.tap_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,ch,close_QMARK_);
} else {
throw cljs.core.missing_protocol.call(null,"Mult.tap*",m);
}
}
}
});

cljs.core.async.untap_STAR_ = (function cljs$core$async$untap_STAR_(m,ch){
if((!((m == null))) && (!((m.cljs$core$async$Mult$untap_STAR_$arity$2 == null)))){
return m.cljs$core$async$Mult$untap_STAR_$arity$2(m,ch);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.untap_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,ch);
} else {
var m__24057__auto____$1 = (cljs.core.async.untap_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,ch);
} else {
throw cljs.core.missing_protocol.call(null,"Mult.untap*",m);
}
}
}
});

cljs.core.async.untap_all_STAR_ = (function cljs$core$async$untap_all_STAR_(m){
if((!((m == null))) && (!((m.cljs$core$async$Mult$untap_all_STAR_$arity$1 == null)))){
return m.cljs$core$async$Mult$untap_all_STAR_$arity$1(m);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.untap_all_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m);
} else {
var m__24057__auto____$1 = (cljs.core.async.untap_all_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m);
} else {
throw cljs.core.missing_protocol.call(null,"Mult.untap-all*",m);
}
}
}
});

/**
 * Creates and returns a mult(iple) of the supplied channel. Channels
 *   containing copies of the channel can be created with 'tap', and
 *   detached with 'untap'.
 * 
 *   Each item is distributed to all taps in parallel and synchronously,
 *   i.e. each tap must accept before the next item is distributed. Use
 *   buffering/windowing to prevent slow taps from holding up the mult.
 * 
 *   Items received when there are no taps get dropped.
 * 
 *   If a tap puts to a closed channel, it will be removed from the mult.
 */
cljs.core.async.mult = (function cljs$core$async$mult(ch){
var cs = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var m = (function (){
if(typeof cljs.core.async.t_cljs$core$async32056 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.Mult}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.async.Mux}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async32056 = (function (ch,cs,meta32057){
this.ch = ch;
this.cs = cs;
this.meta32057 = meta32057;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (cs){
return (function (_32058,meta32057__$1){
var self__ = this;
var _32058__$1 = this;
return (new cljs.core.async.t_cljs$core$async32056(self__.ch,self__.cs,meta32057__$1));
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (cs){
return (function (_32058){
var self__ = this;
var _32058__$1 = this;
return self__.meta32057;
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mux$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mux$muxch_STAR_$arity$1 = ((function (cs){
return (function (_){
var self__ = this;
var ___$1 = this;
return self__.ch;
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mult$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mult$tap_STAR_$arity$3 = ((function (cs){
return (function (_,ch__$1,close_QMARK_){
var self__ = this;
var ___$1 = this;
cljs.core.swap_BANG_.call(null,self__.cs,cljs.core.assoc,ch__$1,close_QMARK_);

return null;
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mult$untap_STAR_$arity$2 = ((function (cs){
return (function (_,ch__$1){
var self__ = this;
var ___$1 = this;
cljs.core.swap_BANG_.call(null,self__.cs,cljs.core.dissoc,ch__$1);

return null;
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.prototype.cljs$core$async$Mult$untap_all_STAR_$arity$1 = ((function (cs){
return (function (_){
var self__ = this;
var ___$1 = this;
cljs.core.reset_BANG_.call(null,self__.cs,cljs.core.PersistentArrayMap.EMPTY);

return null;
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.getBasis = ((function (cs){
return (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"cs","cs",-117024463,null),new cljs.core.Symbol(null,"meta32057","meta32057",-721504562,null)], null);
});})(cs))
;

cljs.core.async.t_cljs$core$async32056.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async32056.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async32056";

cljs.core.async.t_cljs$core$async32056.cljs$lang$ctorPrWriter = ((function (cs){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async32056");
});})(cs))
;

cljs.core.async.__GT_t_cljs$core$async32056 = ((function (cs){
return (function cljs$core$async$mult_$___GT_t_cljs$core$async32056(ch__$1,cs__$1,meta32057){
return (new cljs.core.async.t_cljs$core$async32056(ch__$1,cs__$1,meta32057));
});})(cs))
;

}

return (new cljs.core.async.t_cljs$core$async32056(ch,cs,cljs.core.PersistentArrayMap.EMPTY));
})()
;
var dchan = cljs.core.async.chan.call(null,(1));
var dctr = cljs.core.atom.call(null,null);
var done = ((function (cs,m,dchan,dctr){
return (function (_){
if((cljs.core.swap_BANG_.call(null,dctr,cljs.core.dec) === (0))){
return cljs.core.async.put_BANG_.call(null,dchan,true);
} else {
return null;
}
});})(cs,m,dchan,dctr))
;
var c__30913__auto___32281 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___32281,cs,m,dchan,dctr,done){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___32281,cs,m,dchan,dctr,done){
return (function (state_32193){
var state_val_32194 = (state_32193[(1)]);
if((state_val_32194 === (7))){
var inst_32189 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32195_32282 = state_32193__$1;
(statearr_32195_32282[(2)] = inst_32189);

(statearr_32195_32282[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (20))){
var inst_32092 = (state_32193[(7)]);
var inst_32104 = cljs.core.first.call(null,inst_32092);
var inst_32105 = cljs.core.nth.call(null,inst_32104,(0),null);
var inst_32106 = cljs.core.nth.call(null,inst_32104,(1),null);
var state_32193__$1 = (function (){var statearr_32196 = state_32193;
(statearr_32196[(8)] = inst_32105);

return statearr_32196;
})();
if(cljs.core.truth_(inst_32106)){
var statearr_32197_32283 = state_32193__$1;
(statearr_32197_32283[(1)] = (22));

} else {
var statearr_32198_32284 = state_32193__$1;
(statearr_32198_32284[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (27))){
var inst_32134 = (state_32193[(9)]);
var inst_32136 = (state_32193[(10)]);
var inst_32061 = (state_32193[(11)]);
var inst_32141 = (state_32193[(12)]);
var inst_32141__$1 = cljs.core._nth.call(null,inst_32134,inst_32136);
var inst_32142 = cljs.core.async.put_BANG_.call(null,inst_32141__$1,inst_32061,done);
var state_32193__$1 = (function (){var statearr_32199 = state_32193;
(statearr_32199[(12)] = inst_32141__$1);

return statearr_32199;
})();
if(cljs.core.truth_(inst_32142)){
var statearr_32200_32285 = state_32193__$1;
(statearr_32200_32285[(1)] = (30));

} else {
var statearr_32201_32286 = state_32193__$1;
(statearr_32201_32286[(1)] = (31));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (1))){
var state_32193__$1 = state_32193;
var statearr_32202_32287 = state_32193__$1;
(statearr_32202_32287[(2)] = null);

(statearr_32202_32287[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (24))){
var inst_32092 = (state_32193[(7)]);
var inst_32111 = (state_32193[(2)]);
var inst_32112 = cljs.core.next.call(null,inst_32092);
var inst_32070 = inst_32112;
var inst_32071 = null;
var inst_32072 = (0);
var inst_32073 = (0);
var state_32193__$1 = (function (){var statearr_32203 = state_32193;
(statearr_32203[(13)] = inst_32070);

(statearr_32203[(14)] = inst_32072);

(statearr_32203[(15)] = inst_32071);

(statearr_32203[(16)] = inst_32073);

(statearr_32203[(17)] = inst_32111);

return statearr_32203;
})();
var statearr_32204_32288 = state_32193__$1;
(statearr_32204_32288[(2)] = null);

(statearr_32204_32288[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (39))){
var state_32193__$1 = state_32193;
var statearr_32208_32289 = state_32193__$1;
(statearr_32208_32289[(2)] = null);

(statearr_32208_32289[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (4))){
var inst_32061 = (state_32193[(11)]);
var inst_32061__$1 = (state_32193[(2)]);
var inst_32062 = (inst_32061__$1 == null);
var state_32193__$1 = (function (){var statearr_32209 = state_32193;
(statearr_32209[(11)] = inst_32061__$1);

return statearr_32209;
})();
if(cljs.core.truth_(inst_32062)){
var statearr_32210_32290 = state_32193__$1;
(statearr_32210_32290[(1)] = (5));

} else {
var statearr_32211_32291 = state_32193__$1;
(statearr_32211_32291[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (15))){
var inst_32070 = (state_32193[(13)]);
var inst_32072 = (state_32193[(14)]);
var inst_32071 = (state_32193[(15)]);
var inst_32073 = (state_32193[(16)]);
var inst_32088 = (state_32193[(2)]);
var inst_32089 = (inst_32073 + (1));
var tmp32205 = inst_32070;
var tmp32206 = inst_32072;
var tmp32207 = inst_32071;
var inst_32070__$1 = tmp32205;
var inst_32071__$1 = tmp32207;
var inst_32072__$1 = tmp32206;
var inst_32073__$1 = inst_32089;
var state_32193__$1 = (function (){var statearr_32212 = state_32193;
(statearr_32212[(13)] = inst_32070__$1);

(statearr_32212[(14)] = inst_32072__$1);

(statearr_32212[(15)] = inst_32071__$1);

(statearr_32212[(18)] = inst_32088);

(statearr_32212[(16)] = inst_32073__$1);

return statearr_32212;
})();
var statearr_32213_32292 = state_32193__$1;
(statearr_32213_32292[(2)] = null);

(statearr_32213_32292[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (21))){
var inst_32115 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32217_32293 = state_32193__$1;
(statearr_32217_32293[(2)] = inst_32115);

(statearr_32217_32293[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (31))){
var inst_32141 = (state_32193[(12)]);
var inst_32145 = done.call(null,null);
var inst_32146 = cljs.core.async.untap_STAR_.call(null,m,inst_32141);
var state_32193__$1 = (function (){var statearr_32218 = state_32193;
(statearr_32218[(19)] = inst_32145);

return statearr_32218;
})();
var statearr_32219_32294 = state_32193__$1;
(statearr_32219_32294[(2)] = inst_32146);

(statearr_32219_32294[(1)] = (32));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (32))){
var inst_32134 = (state_32193[(9)]);
var inst_32135 = (state_32193[(20)]);
var inst_32136 = (state_32193[(10)]);
var inst_32133 = (state_32193[(21)]);
var inst_32148 = (state_32193[(2)]);
var inst_32149 = (inst_32136 + (1));
var tmp32214 = inst_32134;
var tmp32215 = inst_32135;
var tmp32216 = inst_32133;
var inst_32133__$1 = tmp32216;
var inst_32134__$1 = tmp32214;
var inst_32135__$1 = tmp32215;
var inst_32136__$1 = inst_32149;
var state_32193__$1 = (function (){var statearr_32220 = state_32193;
(statearr_32220[(9)] = inst_32134__$1);

(statearr_32220[(20)] = inst_32135__$1);

(statearr_32220[(10)] = inst_32136__$1);

(statearr_32220[(22)] = inst_32148);

(statearr_32220[(21)] = inst_32133__$1);

return statearr_32220;
})();
var statearr_32221_32295 = state_32193__$1;
(statearr_32221_32295[(2)] = null);

(statearr_32221_32295[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (40))){
var inst_32161 = (state_32193[(23)]);
var inst_32165 = done.call(null,null);
var inst_32166 = cljs.core.async.untap_STAR_.call(null,m,inst_32161);
var state_32193__$1 = (function (){var statearr_32222 = state_32193;
(statearr_32222[(24)] = inst_32165);

return statearr_32222;
})();
var statearr_32223_32296 = state_32193__$1;
(statearr_32223_32296[(2)] = inst_32166);

(statearr_32223_32296[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (33))){
var inst_32152 = (state_32193[(25)]);
var inst_32154 = cljs.core.chunked_seq_QMARK_.call(null,inst_32152);
var state_32193__$1 = state_32193;
if(inst_32154){
var statearr_32224_32297 = state_32193__$1;
(statearr_32224_32297[(1)] = (36));

} else {
var statearr_32225_32298 = state_32193__$1;
(statearr_32225_32298[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (13))){
var inst_32082 = (state_32193[(26)]);
var inst_32085 = cljs.core.async.close_BANG_.call(null,inst_32082);
var state_32193__$1 = state_32193;
var statearr_32226_32299 = state_32193__$1;
(statearr_32226_32299[(2)] = inst_32085);

(statearr_32226_32299[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (22))){
var inst_32105 = (state_32193[(8)]);
var inst_32108 = cljs.core.async.close_BANG_.call(null,inst_32105);
var state_32193__$1 = state_32193;
var statearr_32227_32300 = state_32193__$1;
(statearr_32227_32300[(2)] = inst_32108);

(statearr_32227_32300[(1)] = (24));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (36))){
var inst_32152 = (state_32193[(25)]);
var inst_32156 = cljs.core.chunk_first.call(null,inst_32152);
var inst_32157 = cljs.core.chunk_rest.call(null,inst_32152);
var inst_32158 = cljs.core.count.call(null,inst_32156);
var inst_32133 = inst_32157;
var inst_32134 = inst_32156;
var inst_32135 = inst_32158;
var inst_32136 = (0);
var state_32193__$1 = (function (){var statearr_32228 = state_32193;
(statearr_32228[(9)] = inst_32134);

(statearr_32228[(20)] = inst_32135);

(statearr_32228[(10)] = inst_32136);

(statearr_32228[(21)] = inst_32133);

return statearr_32228;
})();
var statearr_32229_32301 = state_32193__$1;
(statearr_32229_32301[(2)] = null);

(statearr_32229_32301[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (41))){
var inst_32152 = (state_32193[(25)]);
var inst_32168 = (state_32193[(2)]);
var inst_32169 = cljs.core.next.call(null,inst_32152);
var inst_32133 = inst_32169;
var inst_32134 = null;
var inst_32135 = (0);
var inst_32136 = (0);
var state_32193__$1 = (function (){var statearr_32230 = state_32193;
(statearr_32230[(9)] = inst_32134);

(statearr_32230[(20)] = inst_32135);

(statearr_32230[(10)] = inst_32136);

(statearr_32230[(27)] = inst_32168);

(statearr_32230[(21)] = inst_32133);

return statearr_32230;
})();
var statearr_32231_32302 = state_32193__$1;
(statearr_32231_32302[(2)] = null);

(statearr_32231_32302[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (43))){
var state_32193__$1 = state_32193;
var statearr_32232_32303 = state_32193__$1;
(statearr_32232_32303[(2)] = null);

(statearr_32232_32303[(1)] = (44));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (29))){
var inst_32177 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32233_32304 = state_32193__$1;
(statearr_32233_32304[(2)] = inst_32177);

(statearr_32233_32304[(1)] = (26));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (44))){
var inst_32186 = (state_32193[(2)]);
var state_32193__$1 = (function (){var statearr_32234 = state_32193;
(statearr_32234[(28)] = inst_32186);

return statearr_32234;
})();
var statearr_32235_32305 = state_32193__$1;
(statearr_32235_32305[(2)] = null);

(statearr_32235_32305[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (6))){
var inst_32125 = (state_32193[(29)]);
var inst_32124 = cljs.core.deref.call(null,cs);
var inst_32125__$1 = cljs.core.keys.call(null,inst_32124);
var inst_32126 = cljs.core.count.call(null,inst_32125__$1);
var inst_32127 = cljs.core.reset_BANG_.call(null,dctr,inst_32126);
var inst_32132 = cljs.core.seq.call(null,inst_32125__$1);
var inst_32133 = inst_32132;
var inst_32134 = null;
var inst_32135 = (0);
var inst_32136 = (0);
var state_32193__$1 = (function (){var statearr_32236 = state_32193;
(statearr_32236[(9)] = inst_32134);

(statearr_32236[(30)] = inst_32127);

(statearr_32236[(20)] = inst_32135);

(statearr_32236[(10)] = inst_32136);

(statearr_32236[(21)] = inst_32133);

(statearr_32236[(29)] = inst_32125__$1);

return statearr_32236;
})();
var statearr_32237_32306 = state_32193__$1;
(statearr_32237_32306[(2)] = null);

(statearr_32237_32306[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (28))){
var inst_32152 = (state_32193[(25)]);
var inst_32133 = (state_32193[(21)]);
var inst_32152__$1 = cljs.core.seq.call(null,inst_32133);
var state_32193__$1 = (function (){var statearr_32238 = state_32193;
(statearr_32238[(25)] = inst_32152__$1);

return statearr_32238;
})();
if(inst_32152__$1){
var statearr_32239_32307 = state_32193__$1;
(statearr_32239_32307[(1)] = (33));

} else {
var statearr_32240_32308 = state_32193__$1;
(statearr_32240_32308[(1)] = (34));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (25))){
var inst_32135 = (state_32193[(20)]);
var inst_32136 = (state_32193[(10)]);
var inst_32138 = (inst_32136 < inst_32135);
var inst_32139 = inst_32138;
var state_32193__$1 = state_32193;
if(cljs.core.truth_(inst_32139)){
var statearr_32241_32309 = state_32193__$1;
(statearr_32241_32309[(1)] = (27));

} else {
var statearr_32242_32310 = state_32193__$1;
(statearr_32242_32310[(1)] = (28));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (34))){
var state_32193__$1 = state_32193;
var statearr_32243_32311 = state_32193__$1;
(statearr_32243_32311[(2)] = null);

(statearr_32243_32311[(1)] = (35));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (17))){
var state_32193__$1 = state_32193;
var statearr_32244_32312 = state_32193__$1;
(statearr_32244_32312[(2)] = null);

(statearr_32244_32312[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (3))){
var inst_32191 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32193__$1,inst_32191);
} else {
if((state_val_32194 === (12))){
var inst_32120 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32245_32313 = state_32193__$1;
(statearr_32245_32313[(2)] = inst_32120);

(statearr_32245_32313[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (2))){
var state_32193__$1 = state_32193;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32193__$1,(4),ch);
} else {
if((state_val_32194 === (23))){
var state_32193__$1 = state_32193;
var statearr_32246_32314 = state_32193__$1;
(statearr_32246_32314[(2)] = null);

(statearr_32246_32314[(1)] = (24));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (35))){
var inst_32175 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32247_32315 = state_32193__$1;
(statearr_32247_32315[(2)] = inst_32175);

(statearr_32247_32315[(1)] = (29));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (19))){
var inst_32092 = (state_32193[(7)]);
var inst_32096 = cljs.core.chunk_first.call(null,inst_32092);
var inst_32097 = cljs.core.chunk_rest.call(null,inst_32092);
var inst_32098 = cljs.core.count.call(null,inst_32096);
var inst_32070 = inst_32097;
var inst_32071 = inst_32096;
var inst_32072 = inst_32098;
var inst_32073 = (0);
var state_32193__$1 = (function (){var statearr_32248 = state_32193;
(statearr_32248[(13)] = inst_32070);

(statearr_32248[(14)] = inst_32072);

(statearr_32248[(15)] = inst_32071);

(statearr_32248[(16)] = inst_32073);

return statearr_32248;
})();
var statearr_32249_32316 = state_32193__$1;
(statearr_32249_32316[(2)] = null);

(statearr_32249_32316[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (11))){
var inst_32070 = (state_32193[(13)]);
var inst_32092 = (state_32193[(7)]);
var inst_32092__$1 = cljs.core.seq.call(null,inst_32070);
var state_32193__$1 = (function (){var statearr_32250 = state_32193;
(statearr_32250[(7)] = inst_32092__$1);

return statearr_32250;
})();
if(inst_32092__$1){
var statearr_32251_32317 = state_32193__$1;
(statearr_32251_32317[(1)] = (16));

} else {
var statearr_32252_32318 = state_32193__$1;
(statearr_32252_32318[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (9))){
var inst_32122 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32253_32319 = state_32193__$1;
(statearr_32253_32319[(2)] = inst_32122);

(statearr_32253_32319[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (5))){
var inst_32068 = cljs.core.deref.call(null,cs);
var inst_32069 = cljs.core.seq.call(null,inst_32068);
var inst_32070 = inst_32069;
var inst_32071 = null;
var inst_32072 = (0);
var inst_32073 = (0);
var state_32193__$1 = (function (){var statearr_32254 = state_32193;
(statearr_32254[(13)] = inst_32070);

(statearr_32254[(14)] = inst_32072);

(statearr_32254[(15)] = inst_32071);

(statearr_32254[(16)] = inst_32073);

return statearr_32254;
})();
var statearr_32255_32320 = state_32193__$1;
(statearr_32255_32320[(2)] = null);

(statearr_32255_32320[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (14))){
var state_32193__$1 = state_32193;
var statearr_32256_32321 = state_32193__$1;
(statearr_32256_32321[(2)] = null);

(statearr_32256_32321[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (45))){
var inst_32183 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32257_32322 = state_32193__$1;
(statearr_32257_32322[(2)] = inst_32183);

(statearr_32257_32322[(1)] = (44));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (26))){
var inst_32125 = (state_32193[(29)]);
var inst_32179 = (state_32193[(2)]);
var inst_32180 = cljs.core.seq.call(null,inst_32125);
var state_32193__$1 = (function (){var statearr_32258 = state_32193;
(statearr_32258[(31)] = inst_32179);

return statearr_32258;
})();
if(inst_32180){
var statearr_32259_32323 = state_32193__$1;
(statearr_32259_32323[(1)] = (42));

} else {
var statearr_32260_32324 = state_32193__$1;
(statearr_32260_32324[(1)] = (43));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (16))){
var inst_32092 = (state_32193[(7)]);
var inst_32094 = cljs.core.chunked_seq_QMARK_.call(null,inst_32092);
var state_32193__$1 = state_32193;
if(inst_32094){
var statearr_32261_32325 = state_32193__$1;
(statearr_32261_32325[(1)] = (19));

} else {
var statearr_32262_32326 = state_32193__$1;
(statearr_32262_32326[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (38))){
var inst_32172 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32263_32327 = state_32193__$1;
(statearr_32263_32327[(2)] = inst_32172);

(statearr_32263_32327[(1)] = (35));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (30))){
var state_32193__$1 = state_32193;
var statearr_32264_32328 = state_32193__$1;
(statearr_32264_32328[(2)] = null);

(statearr_32264_32328[(1)] = (32));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (10))){
var inst_32071 = (state_32193[(15)]);
var inst_32073 = (state_32193[(16)]);
var inst_32081 = cljs.core._nth.call(null,inst_32071,inst_32073);
var inst_32082 = cljs.core.nth.call(null,inst_32081,(0),null);
var inst_32083 = cljs.core.nth.call(null,inst_32081,(1),null);
var state_32193__$1 = (function (){var statearr_32265 = state_32193;
(statearr_32265[(26)] = inst_32082);

return statearr_32265;
})();
if(cljs.core.truth_(inst_32083)){
var statearr_32266_32329 = state_32193__$1;
(statearr_32266_32329[(1)] = (13));

} else {
var statearr_32267_32330 = state_32193__$1;
(statearr_32267_32330[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (18))){
var inst_32118 = (state_32193[(2)]);
var state_32193__$1 = state_32193;
var statearr_32268_32331 = state_32193__$1;
(statearr_32268_32331[(2)] = inst_32118);

(statearr_32268_32331[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (42))){
var state_32193__$1 = state_32193;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32193__$1,(45),dchan);
} else {
if((state_val_32194 === (37))){
var inst_32152 = (state_32193[(25)]);
var inst_32161 = (state_32193[(23)]);
var inst_32061 = (state_32193[(11)]);
var inst_32161__$1 = cljs.core.first.call(null,inst_32152);
var inst_32162 = cljs.core.async.put_BANG_.call(null,inst_32161__$1,inst_32061,done);
var state_32193__$1 = (function (){var statearr_32269 = state_32193;
(statearr_32269[(23)] = inst_32161__$1);

return statearr_32269;
})();
if(cljs.core.truth_(inst_32162)){
var statearr_32270_32332 = state_32193__$1;
(statearr_32270_32332[(1)] = (39));

} else {
var statearr_32271_32333 = state_32193__$1;
(statearr_32271_32333[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32194 === (8))){
var inst_32072 = (state_32193[(14)]);
var inst_32073 = (state_32193[(16)]);
var inst_32075 = (inst_32073 < inst_32072);
var inst_32076 = inst_32075;
var state_32193__$1 = state_32193;
if(cljs.core.truth_(inst_32076)){
var statearr_32272_32334 = state_32193__$1;
(statearr_32272_32334[(1)] = (10));

} else {
var statearr_32273_32335 = state_32193__$1;
(statearr_32273_32335[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___32281,cs,m,dchan,dctr,done))
;
return ((function (switch__30799__auto__,c__30913__auto___32281,cs,m,dchan,dctr,done){
return (function() {
var cljs$core$async$mult_$_state_machine__30800__auto__ = null;
var cljs$core$async$mult_$_state_machine__30800__auto____0 = (function (){
var statearr_32277 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32277[(0)] = cljs$core$async$mult_$_state_machine__30800__auto__);

(statearr_32277[(1)] = (1));

return statearr_32277;
});
var cljs$core$async$mult_$_state_machine__30800__auto____1 = (function (state_32193){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_32193);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e32278){if((e32278 instanceof Object)){
var ex__30803__auto__ = e32278;
var statearr_32279_32336 = state_32193;
(statearr_32279_32336[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32193);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e32278;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32337 = state_32193;
state_32193 = G__32337;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$mult_$_state_machine__30800__auto__ = function(state_32193){
switch(arguments.length){
case 0:
return cljs$core$async$mult_$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$mult_$_state_machine__30800__auto____1.call(this,state_32193);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mult_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mult_$_state_machine__30800__auto____0;
cljs$core$async$mult_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mult_$_state_machine__30800__auto____1;
return cljs$core$async$mult_$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___32281,cs,m,dchan,dctr,done))
})();
var state__30915__auto__ = (function (){var statearr_32280 = f__30914__auto__.call(null);
(statearr_32280[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___32281);

return statearr_32280;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___32281,cs,m,dchan,dctr,done))
);


return m;
});
/**
 * Copies the mult source onto the supplied channel.
 * 
 *   By default the channel will be closed when the source closes,
 *   but can be determined by the close? parameter.
 */
cljs.core.async.tap = (function cljs$core$async$tap(var_args){
var args32338 = [];
var len__24559__auto___32341 = arguments.length;
var i__24560__auto___32342 = (0);
while(true){
if((i__24560__auto___32342 < len__24559__auto___32341)){
args32338.push((arguments[i__24560__auto___32342]));

var G__32343 = (i__24560__auto___32342 + (1));
i__24560__auto___32342 = G__32343;
continue;
} else {
}
break;
}

var G__32340 = args32338.length;
switch (G__32340) {
case 2:
return cljs.core.async.tap.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.tap.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32338.length)].join('')));

}
});

cljs.core.async.tap.cljs$core$IFn$_invoke$arity$2 = (function (mult,ch){
return cljs.core.async.tap.call(null,mult,ch,true);
});

cljs.core.async.tap.cljs$core$IFn$_invoke$arity$3 = (function (mult,ch,close_QMARK_){
cljs.core.async.tap_STAR_.call(null,mult,ch,close_QMARK_);

return ch;
});

cljs.core.async.tap.cljs$lang$maxFixedArity = 3;

/**
 * Disconnects a target channel from a mult
 */
cljs.core.async.untap = (function cljs$core$async$untap(mult,ch){
return cljs.core.async.untap_STAR_.call(null,mult,ch);
});
/**
 * Disconnects all target channels from a mult
 */
cljs.core.async.untap_all = (function cljs$core$async$untap_all(mult){
return cljs.core.async.untap_all_STAR_.call(null,mult);
});

/**
 * @interface
 */
cljs.core.async.Mix = function(){};

cljs.core.async.admix_STAR_ = (function cljs$core$async$admix_STAR_(m,ch){
if((!((m == null))) && (!((m.cljs$core$async$Mix$admix_STAR_$arity$2 == null)))){
return m.cljs$core$async$Mix$admix_STAR_$arity$2(m,ch);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.admix_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,ch);
} else {
var m__24057__auto____$1 = (cljs.core.async.admix_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,ch);
} else {
throw cljs.core.missing_protocol.call(null,"Mix.admix*",m);
}
}
}
});

cljs.core.async.unmix_STAR_ = (function cljs$core$async$unmix_STAR_(m,ch){
if((!((m == null))) && (!((m.cljs$core$async$Mix$unmix_STAR_$arity$2 == null)))){
return m.cljs$core$async$Mix$unmix_STAR_$arity$2(m,ch);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.unmix_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,ch);
} else {
var m__24057__auto____$1 = (cljs.core.async.unmix_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,ch);
} else {
throw cljs.core.missing_protocol.call(null,"Mix.unmix*",m);
}
}
}
});

cljs.core.async.unmix_all_STAR_ = (function cljs$core$async$unmix_all_STAR_(m){
if((!((m == null))) && (!((m.cljs$core$async$Mix$unmix_all_STAR_$arity$1 == null)))){
return m.cljs$core$async$Mix$unmix_all_STAR_$arity$1(m);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.unmix_all_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m);
} else {
var m__24057__auto____$1 = (cljs.core.async.unmix_all_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m);
} else {
throw cljs.core.missing_protocol.call(null,"Mix.unmix-all*",m);
}
}
}
});

cljs.core.async.toggle_STAR_ = (function cljs$core$async$toggle_STAR_(m,state_map){
if((!((m == null))) && (!((m.cljs$core$async$Mix$toggle_STAR_$arity$2 == null)))){
return m.cljs$core$async$Mix$toggle_STAR_$arity$2(m,state_map);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.toggle_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,state_map);
} else {
var m__24057__auto____$1 = (cljs.core.async.toggle_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,state_map);
} else {
throw cljs.core.missing_protocol.call(null,"Mix.toggle*",m);
}
}
}
});

cljs.core.async.solo_mode_STAR_ = (function cljs$core$async$solo_mode_STAR_(m,mode){
if((!((m == null))) && (!((m.cljs$core$async$Mix$solo_mode_STAR_$arity$2 == null)))){
return m.cljs$core$async$Mix$solo_mode_STAR_$arity$2(m,mode);
} else {
var x__24056__auto__ = (((m == null))?null:m);
var m__24057__auto__ = (cljs.core.async.solo_mode_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,m,mode);
} else {
var m__24057__auto____$1 = (cljs.core.async.solo_mode_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,m,mode);
} else {
throw cljs.core.missing_protocol.call(null,"Mix.solo-mode*",m);
}
}
}
});

cljs.core.async.ioc_alts_BANG_ = (function cljs$core$async$ioc_alts_BANG_(var_args){
var args__24566__auto__ = [];
var len__24559__auto___32355 = arguments.length;
var i__24560__auto___32356 = (0);
while(true){
if((i__24560__auto___32356 < len__24559__auto___32355)){
args__24566__auto__.push((arguments[i__24560__auto___32356]));

var G__32357 = (i__24560__auto___32356 + (1));
i__24560__auto___32356 = G__32357;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((3) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((3)),(0),null)):null);
return cljs.core.async.ioc_alts_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__24567__auto__);
});

cljs.core.async.ioc_alts_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (state,cont_block,ports,p__32349){
var map__32350 = p__32349;
var map__32350__$1 = ((((!((map__32350 == null)))?((((map__32350.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32350.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32350):map__32350);
var opts = map__32350__$1;
var statearr_32352_32358 = state;
(statearr_32352_32358[cljs.core.async.impl.ioc_helpers.STATE_IDX] = cont_block);


var temp__5278__auto__ = cljs.core.async.do_alts.call(null,((function (map__32350,map__32350__$1,opts){
return (function (val){
var statearr_32353_32359 = state;
(statearr_32353_32359[cljs.core.async.impl.ioc_helpers.VALUE_IDX] = val);


return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state);
});})(map__32350,map__32350__$1,opts))
,ports,opts);
if(cljs.core.truth_(temp__5278__auto__)){
var cb = temp__5278__auto__;
var statearr_32354_32360 = state;
(statearr_32354_32360[cljs.core.async.impl.ioc_helpers.VALUE_IDX] = cljs.core.deref.call(null,cb));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
});

cljs.core.async.ioc_alts_BANG_.cljs$lang$maxFixedArity = (3);

cljs.core.async.ioc_alts_BANG_.cljs$lang$applyTo = (function (seq32345){
var G__32346 = cljs.core.first.call(null,seq32345);
var seq32345__$1 = cljs.core.next.call(null,seq32345);
var G__32347 = cljs.core.first.call(null,seq32345__$1);
var seq32345__$2 = cljs.core.next.call(null,seq32345__$1);
var G__32348 = cljs.core.first.call(null,seq32345__$2);
var seq32345__$3 = cljs.core.next.call(null,seq32345__$2);
return cljs.core.async.ioc_alts_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__32346,G__32347,G__32348,seq32345__$3);
});

/**
 * Creates and returns a mix of one or more input channels which will
 *   be put on the supplied out channel. Input sources can be added to
 *   the mix with 'admix', and removed with 'unmix'. A mix supports
 *   soloing, muting and pausing multiple inputs atomically using
 *   'toggle', and can solo using either muting or pausing as determined
 *   by 'solo-mode'.
 * 
 *   Each channel can have zero or more boolean modes set via 'toggle':
 * 
 *   :solo - when true, only this (ond other soloed) channel(s) will appear
 *        in the mix output channel. :mute and :pause states of soloed
 *        channels are ignored. If solo-mode is :mute, non-soloed
 *        channels are muted, if :pause, non-soloed channels are
 *        paused.
 * 
 *   :mute - muted channels will have their contents consumed but not included in the mix
 *   :pause - paused channels will not have their contents consumed (and thus also not included in the mix)
 */
cljs.core.async.mix = (function cljs$core$async$mix(out){
var cs = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var solo_modes = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"pause","pause",-2095325672),null,new cljs.core.Keyword(null,"mute","mute",1151223646),null], null), null);
var attrs = cljs.core.conj.call(null,solo_modes,new cljs.core.Keyword(null,"solo","solo",-316350075));
var solo_mode = cljs.core.atom.call(null,new cljs.core.Keyword(null,"mute","mute",1151223646));
var change = cljs.core.async.chan.call(null);
var changed = ((function (cs,solo_modes,attrs,solo_mode,change){
return (function (){
return cljs.core.async.put_BANG_.call(null,change,true);
});})(cs,solo_modes,attrs,solo_mode,change))
;
var pick = ((function (cs,solo_modes,attrs,solo_mode,change,changed){
return (function (attr,chs){
return cljs.core.reduce_kv.call(null,((function (cs,solo_modes,attrs,solo_mode,change,changed){
return (function (ret,c,v){
if(cljs.core.truth_(attr.call(null,v))){
return cljs.core.conj.call(null,ret,c);
} else {
return ret;
}
});})(cs,solo_modes,attrs,solo_mode,change,changed))
,cljs.core.PersistentHashSet.EMPTY,chs);
});})(cs,solo_modes,attrs,solo_mode,change,changed))
;
var calc_state = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick){
return (function (){
var chs = cljs.core.deref.call(null,cs);
var mode = cljs.core.deref.call(null,solo_mode);
var solos = pick.call(null,new cljs.core.Keyword(null,"solo","solo",-316350075),chs);
var pauses = pick.call(null,new cljs.core.Keyword(null,"pause","pause",-2095325672),chs);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"solos","solos",1441458643),solos,new cljs.core.Keyword(null,"mutes","mutes",1068806309),pick.call(null,new cljs.core.Keyword(null,"mute","mute",1151223646),chs),new cljs.core.Keyword(null,"reads","reads",-1215067361),cljs.core.conj.call(null,(((cljs.core._EQ_.call(null,mode,new cljs.core.Keyword(null,"pause","pause",-2095325672))) && (!(cljs.core.empty_QMARK_.call(null,solos))))?cljs.core.vec.call(null,solos):cljs.core.vec.call(null,cljs.core.remove.call(null,pauses,cljs.core.keys.call(null,chs)))),change)], null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick))
;
var m = (function (){
if(typeof cljs.core.async.t_cljs$core$async32528 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.async.Mix}
 * @implements {cljs.core.async.Mux}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async32528 = (function (out,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,meta32529){
this.out = out;
this.cs = cs;
this.solo_modes = solo_modes;
this.attrs = attrs;
this.solo_mode = solo_mode;
this.change = change;
this.changed = changed;
this.pick = pick;
this.calc_state = calc_state;
this.meta32529 = meta32529;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_32530,meta32529__$1){
var self__ = this;
var _32530__$1 = this;
return (new cljs.core.async.t_cljs$core$async32528(self__.out,self__.cs,self__.solo_modes,self__.attrs,self__.solo_mode,self__.change,self__.changed,self__.pick,self__.calc_state,meta32529__$1));
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_32530){
var self__ = this;
var _32530__$1 = this;
return self__.meta32529;
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mux$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mux$muxch_STAR_$arity$1 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_){
var self__ = this;
var ___$1 = this;
return self__.out;
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$admix_STAR_$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_,ch){
var self__ = this;
var ___$1 = this;
cljs.core.swap_BANG_.call(null,self__.cs,cljs.core.assoc,ch,cljs.core.PersistentArrayMap.EMPTY);

return self__.changed.call(null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$unmix_STAR_$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_,ch){
var self__ = this;
var ___$1 = this;
cljs.core.swap_BANG_.call(null,self__.cs,cljs.core.dissoc,ch);

return self__.changed.call(null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$unmix_all_STAR_$arity$1 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_){
var self__ = this;
var ___$1 = this;
cljs.core.reset_BANG_.call(null,self__.cs,cljs.core.PersistentArrayMap.EMPTY);

return self__.changed.call(null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$toggle_STAR_$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_,state_map){
var self__ = this;
var ___$1 = this;
cljs.core.swap_BANG_.call(null,self__.cs,cljs.core.partial.call(null,cljs.core.merge_with,cljs.core.merge),state_map);

return self__.changed.call(null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.prototype.cljs$core$async$Mix$solo_mode_STAR_$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_,mode){
var self__ = this;
var ___$1 = this;
if(cljs.core.truth_(self__.solo_modes.call(null,mode))){
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Assert failed: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1([cljs.core.str.cljs$core$IFn$_invoke$arity$1("mode must be one of: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.solo_modes)].join('')),cljs.core.str.cljs$core$IFn$_invoke$arity$1("\n"),cljs.core.str.cljs$core$IFn$_invoke$arity$1("(solo-modes mode)")].join('')));
}

cljs.core.reset_BANG_.call(null,self__.solo_mode,mode);

return self__.changed.call(null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.getBasis = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (){
return new cljs.core.PersistentVector(null, 10, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"out","out",729986010,null),new cljs.core.Symbol(null,"cs","cs",-117024463,null),new cljs.core.Symbol(null,"solo-modes","solo-modes",882180540,null),new cljs.core.Symbol(null,"attrs","attrs",-450137186,null),new cljs.core.Symbol(null,"solo-mode","solo-mode",2031788074,null),new cljs.core.Symbol(null,"change","change",477485025,null),new cljs.core.Symbol(null,"changed","changed",-2083710852,null),new cljs.core.Symbol(null,"pick","pick",1300068175,null),new cljs.core.Symbol(null,"calc-state","calc-state",-349968968,null),new cljs.core.Symbol(null,"meta32529","meta32529",1105625752,null)], null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32528.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async32528.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async32528";

cljs.core.async.t_cljs$core$async32528.cljs$lang$ctorPrWriter = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async32528");
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.__GT_t_cljs$core$async32528 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function cljs$core$async$mix_$___GT_t_cljs$core$async32528(out__$1,cs__$1,solo_modes__$1,attrs__$1,solo_mode__$1,change__$1,changed__$1,pick__$1,calc_state__$1,meta32529){
return (new cljs.core.async.t_cljs$core$async32528(out__$1,cs__$1,solo_modes__$1,attrs__$1,solo_mode__$1,change__$1,changed__$1,pick__$1,calc_state__$1,meta32529));
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

}

return (new cljs.core.async.t_cljs$core$async32528(out,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,cljs.core.PersistentArrayMap.EMPTY));
})()
;
var c__30913__auto___32695 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function (state_32632){
var state_val_32633 = (state_32632[(1)]);
if((state_val_32633 === (7))){
var inst_32547 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
var statearr_32634_32696 = state_32632__$1;
(statearr_32634_32696[(2)] = inst_32547);

(statearr_32634_32696[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (20))){
var inst_32559 = (state_32632[(7)]);
var state_32632__$1 = state_32632;
var statearr_32635_32697 = state_32632__$1;
(statearr_32635_32697[(2)] = inst_32559);

(statearr_32635_32697[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (27))){
var state_32632__$1 = state_32632;
var statearr_32636_32698 = state_32632__$1;
(statearr_32636_32698[(2)] = null);

(statearr_32636_32698[(1)] = (28));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (1))){
var inst_32534 = (state_32632[(8)]);
var inst_32534__$1 = calc_state.call(null);
var inst_32536 = (inst_32534__$1 == null);
var inst_32537 = cljs.core.not.call(null,inst_32536);
var state_32632__$1 = (function (){var statearr_32637 = state_32632;
(statearr_32637[(8)] = inst_32534__$1);

return statearr_32637;
})();
if(inst_32537){
var statearr_32638_32699 = state_32632__$1;
(statearr_32638_32699[(1)] = (2));

} else {
var statearr_32639_32700 = state_32632__$1;
(statearr_32639_32700[(1)] = (3));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (24))){
var inst_32583 = (state_32632[(9)]);
var inst_32592 = (state_32632[(10)]);
var inst_32606 = (state_32632[(11)]);
var inst_32606__$1 = inst_32583.call(null,inst_32592);
var state_32632__$1 = (function (){var statearr_32640 = state_32632;
(statearr_32640[(11)] = inst_32606__$1);

return statearr_32640;
})();
if(cljs.core.truth_(inst_32606__$1)){
var statearr_32641_32701 = state_32632__$1;
(statearr_32641_32701[(1)] = (29));

} else {
var statearr_32642_32702 = state_32632__$1;
(statearr_32642_32702[(1)] = (30));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (4))){
var inst_32550 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32550)){
var statearr_32643_32703 = state_32632__$1;
(statearr_32643_32703[(1)] = (8));

} else {
var statearr_32644_32704 = state_32632__$1;
(statearr_32644_32704[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (15))){
var inst_32577 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32577)){
var statearr_32645_32705 = state_32632__$1;
(statearr_32645_32705[(1)] = (19));

} else {
var statearr_32646_32706 = state_32632__$1;
(statearr_32646_32706[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (21))){
var inst_32582 = (state_32632[(12)]);
var inst_32582__$1 = (state_32632[(2)]);
var inst_32583 = cljs.core.get.call(null,inst_32582__$1,new cljs.core.Keyword(null,"solos","solos",1441458643));
var inst_32584 = cljs.core.get.call(null,inst_32582__$1,new cljs.core.Keyword(null,"mutes","mutes",1068806309));
var inst_32585 = cljs.core.get.call(null,inst_32582__$1,new cljs.core.Keyword(null,"reads","reads",-1215067361));
var state_32632__$1 = (function (){var statearr_32647 = state_32632;
(statearr_32647[(13)] = inst_32584);

(statearr_32647[(9)] = inst_32583);

(statearr_32647[(12)] = inst_32582__$1);

return statearr_32647;
})();
return cljs.core.async.ioc_alts_BANG_.call(null,state_32632__$1,(22),inst_32585);
} else {
if((state_val_32633 === (31))){
var inst_32614 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32614)){
var statearr_32648_32707 = state_32632__$1;
(statearr_32648_32707[(1)] = (32));

} else {
var statearr_32649_32708 = state_32632__$1;
(statearr_32649_32708[(1)] = (33));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (32))){
var inst_32591 = (state_32632[(14)]);
var state_32632__$1 = state_32632;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32632__$1,(35),out,inst_32591);
} else {
if((state_val_32633 === (33))){
var inst_32582 = (state_32632[(12)]);
var inst_32559 = inst_32582;
var state_32632__$1 = (function (){var statearr_32650 = state_32632;
(statearr_32650[(7)] = inst_32559);

return statearr_32650;
})();
var statearr_32651_32709 = state_32632__$1;
(statearr_32651_32709[(2)] = null);

(statearr_32651_32709[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (13))){
var inst_32559 = (state_32632[(7)]);
var inst_32566 = inst_32559.cljs$lang$protocol_mask$partition0$;
var inst_32567 = (inst_32566 & (64));
var inst_32568 = inst_32559.cljs$core$ISeq$;
var inst_32569 = (cljs.core.PROTOCOL_SENTINEL === inst_32568);
var inst_32570 = (inst_32567) || (inst_32569);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32570)){
var statearr_32652_32710 = state_32632__$1;
(statearr_32652_32710[(1)] = (16));

} else {
var statearr_32653_32711 = state_32632__$1;
(statearr_32653_32711[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (22))){
var inst_32592 = (state_32632[(10)]);
var inst_32591 = (state_32632[(14)]);
var inst_32590 = (state_32632[(2)]);
var inst_32591__$1 = cljs.core.nth.call(null,inst_32590,(0),null);
var inst_32592__$1 = cljs.core.nth.call(null,inst_32590,(1),null);
var inst_32593 = (inst_32591__$1 == null);
var inst_32594 = cljs.core._EQ_.call(null,inst_32592__$1,change);
var inst_32595 = (inst_32593) || (inst_32594);
var state_32632__$1 = (function (){var statearr_32654 = state_32632;
(statearr_32654[(10)] = inst_32592__$1);

(statearr_32654[(14)] = inst_32591__$1);

return statearr_32654;
})();
if(cljs.core.truth_(inst_32595)){
var statearr_32655_32712 = state_32632__$1;
(statearr_32655_32712[(1)] = (23));

} else {
var statearr_32656_32713 = state_32632__$1;
(statearr_32656_32713[(1)] = (24));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (36))){
var inst_32582 = (state_32632[(12)]);
var inst_32559 = inst_32582;
var state_32632__$1 = (function (){var statearr_32657 = state_32632;
(statearr_32657[(7)] = inst_32559);

return statearr_32657;
})();
var statearr_32658_32714 = state_32632__$1;
(statearr_32658_32714[(2)] = null);

(statearr_32658_32714[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (29))){
var inst_32606 = (state_32632[(11)]);
var state_32632__$1 = state_32632;
var statearr_32659_32715 = state_32632__$1;
(statearr_32659_32715[(2)] = inst_32606);

(statearr_32659_32715[(1)] = (31));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (6))){
var state_32632__$1 = state_32632;
var statearr_32660_32716 = state_32632__$1;
(statearr_32660_32716[(2)] = false);

(statearr_32660_32716[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (28))){
var inst_32602 = (state_32632[(2)]);
var inst_32603 = calc_state.call(null);
var inst_32559 = inst_32603;
var state_32632__$1 = (function (){var statearr_32661 = state_32632;
(statearr_32661[(15)] = inst_32602);

(statearr_32661[(7)] = inst_32559);

return statearr_32661;
})();
var statearr_32662_32717 = state_32632__$1;
(statearr_32662_32717[(2)] = null);

(statearr_32662_32717[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (25))){
var inst_32628 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
var statearr_32663_32718 = state_32632__$1;
(statearr_32663_32718[(2)] = inst_32628);

(statearr_32663_32718[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (34))){
var inst_32626 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
var statearr_32664_32719 = state_32632__$1;
(statearr_32664_32719[(2)] = inst_32626);

(statearr_32664_32719[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (17))){
var state_32632__$1 = state_32632;
var statearr_32665_32720 = state_32632__$1;
(statearr_32665_32720[(2)] = false);

(statearr_32665_32720[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (3))){
var state_32632__$1 = state_32632;
var statearr_32666_32721 = state_32632__$1;
(statearr_32666_32721[(2)] = false);

(statearr_32666_32721[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (12))){
var inst_32630 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32632__$1,inst_32630);
} else {
if((state_val_32633 === (2))){
var inst_32534 = (state_32632[(8)]);
var inst_32539 = inst_32534.cljs$lang$protocol_mask$partition0$;
var inst_32540 = (inst_32539 & (64));
var inst_32541 = inst_32534.cljs$core$ISeq$;
var inst_32542 = (cljs.core.PROTOCOL_SENTINEL === inst_32541);
var inst_32543 = (inst_32540) || (inst_32542);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32543)){
var statearr_32667_32722 = state_32632__$1;
(statearr_32667_32722[(1)] = (5));

} else {
var statearr_32668_32723 = state_32632__$1;
(statearr_32668_32723[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (23))){
var inst_32591 = (state_32632[(14)]);
var inst_32597 = (inst_32591 == null);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32597)){
var statearr_32669_32724 = state_32632__$1;
(statearr_32669_32724[(1)] = (26));

} else {
var statearr_32670_32725 = state_32632__$1;
(statearr_32670_32725[(1)] = (27));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (35))){
var inst_32617 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
if(cljs.core.truth_(inst_32617)){
var statearr_32671_32726 = state_32632__$1;
(statearr_32671_32726[(1)] = (36));

} else {
var statearr_32672_32727 = state_32632__$1;
(statearr_32672_32727[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (19))){
var inst_32559 = (state_32632[(7)]);
var inst_32579 = cljs.core.apply.call(null,cljs.core.hash_map,inst_32559);
var state_32632__$1 = state_32632;
var statearr_32673_32728 = state_32632__$1;
(statearr_32673_32728[(2)] = inst_32579);

(statearr_32673_32728[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (11))){
var inst_32559 = (state_32632[(7)]);
var inst_32563 = (inst_32559 == null);
var inst_32564 = cljs.core.not.call(null,inst_32563);
var state_32632__$1 = state_32632;
if(inst_32564){
var statearr_32674_32729 = state_32632__$1;
(statearr_32674_32729[(1)] = (13));

} else {
var statearr_32675_32730 = state_32632__$1;
(statearr_32675_32730[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (9))){
var inst_32534 = (state_32632[(8)]);
var state_32632__$1 = state_32632;
var statearr_32676_32731 = state_32632__$1;
(statearr_32676_32731[(2)] = inst_32534);

(statearr_32676_32731[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (5))){
var state_32632__$1 = state_32632;
var statearr_32677_32732 = state_32632__$1;
(statearr_32677_32732[(2)] = true);

(statearr_32677_32732[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (14))){
var state_32632__$1 = state_32632;
var statearr_32678_32733 = state_32632__$1;
(statearr_32678_32733[(2)] = false);

(statearr_32678_32733[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (26))){
var inst_32592 = (state_32632[(10)]);
var inst_32599 = cljs.core.swap_BANG_.call(null,cs,cljs.core.dissoc,inst_32592);
var state_32632__$1 = state_32632;
var statearr_32679_32734 = state_32632__$1;
(statearr_32679_32734[(2)] = inst_32599);

(statearr_32679_32734[(1)] = (28));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (16))){
var state_32632__$1 = state_32632;
var statearr_32680_32735 = state_32632__$1;
(statearr_32680_32735[(2)] = true);

(statearr_32680_32735[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (38))){
var inst_32622 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
var statearr_32681_32736 = state_32632__$1;
(statearr_32681_32736[(2)] = inst_32622);

(statearr_32681_32736[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (30))){
var inst_32584 = (state_32632[(13)]);
var inst_32583 = (state_32632[(9)]);
var inst_32592 = (state_32632[(10)]);
var inst_32609 = cljs.core.empty_QMARK_.call(null,inst_32583);
var inst_32610 = inst_32584.call(null,inst_32592);
var inst_32611 = cljs.core.not.call(null,inst_32610);
var inst_32612 = (inst_32609) && (inst_32611);
var state_32632__$1 = state_32632;
var statearr_32682_32737 = state_32632__$1;
(statearr_32682_32737[(2)] = inst_32612);

(statearr_32682_32737[(1)] = (31));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (10))){
var inst_32534 = (state_32632[(8)]);
var inst_32555 = (state_32632[(2)]);
var inst_32556 = cljs.core.get.call(null,inst_32555,new cljs.core.Keyword(null,"solos","solos",1441458643));
var inst_32557 = cljs.core.get.call(null,inst_32555,new cljs.core.Keyword(null,"mutes","mutes",1068806309));
var inst_32558 = cljs.core.get.call(null,inst_32555,new cljs.core.Keyword(null,"reads","reads",-1215067361));
var inst_32559 = inst_32534;
var state_32632__$1 = (function (){var statearr_32683 = state_32632;
(statearr_32683[(16)] = inst_32557);

(statearr_32683[(7)] = inst_32559);

(statearr_32683[(17)] = inst_32556);

(statearr_32683[(18)] = inst_32558);

return statearr_32683;
})();
var statearr_32684_32738 = state_32632__$1;
(statearr_32684_32738[(2)] = null);

(statearr_32684_32738[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (18))){
var inst_32574 = (state_32632[(2)]);
var state_32632__$1 = state_32632;
var statearr_32685_32739 = state_32632__$1;
(statearr_32685_32739[(2)] = inst_32574);

(statearr_32685_32739[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (37))){
var state_32632__$1 = state_32632;
var statearr_32686_32740 = state_32632__$1;
(statearr_32686_32740[(2)] = null);

(statearr_32686_32740[(1)] = (38));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32633 === (8))){
var inst_32534 = (state_32632[(8)]);
var inst_32552 = cljs.core.apply.call(null,cljs.core.hash_map,inst_32534);
var state_32632__$1 = state_32632;
var statearr_32687_32741 = state_32632__$1;
(statearr_32687_32741[(2)] = inst_32552);

(statearr_32687_32741[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m))
;
return ((function (switch__30799__auto__,c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function() {
var cljs$core$async$mix_$_state_machine__30800__auto__ = null;
var cljs$core$async$mix_$_state_machine__30800__auto____0 = (function (){
var statearr_32691 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32691[(0)] = cljs$core$async$mix_$_state_machine__30800__auto__);

(statearr_32691[(1)] = (1));

return statearr_32691;
});
var cljs$core$async$mix_$_state_machine__30800__auto____1 = (function (state_32632){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_32632);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e32692){if((e32692 instanceof Object)){
var ex__30803__auto__ = e32692;
var statearr_32693_32742 = state_32632;
(statearr_32693_32742[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32632);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e32692;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32743 = state_32632;
state_32632 = G__32743;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$mix_$_state_machine__30800__auto__ = function(state_32632){
switch(arguments.length){
case 0:
return cljs$core$async$mix_$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$mix_$_state_machine__30800__auto____1.call(this,state_32632);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mix_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mix_$_state_machine__30800__auto____0;
cljs$core$async$mix_$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mix_$_state_machine__30800__auto____1;
return cljs$core$async$mix_$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m))
})();
var state__30915__auto__ = (function (){var statearr_32694 = f__30914__auto__.call(null);
(statearr_32694[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___32695);

return statearr_32694;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___32695,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m))
);


return m;
});
/**
 * Adds ch as an input to the mix
 */
cljs.core.async.admix = (function cljs$core$async$admix(mix,ch){
return cljs.core.async.admix_STAR_.call(null,mix,ch);
});
/**
 * Removes ch as an input to the mix
 */
cljs.core.async.unmix = (function cljs$core$async$unmix(mix,ch){
return cljs.core.async.unmix_STAR_.call(null,mix,ch);
});
/**
 * removes all inputs from the mix
 */
cljs.core.async.unmix_all = (function cljs$core$async$unmix_all(mix){
return cljs.core.async.unmix_all_STAR_.call(null,mix);
});
/**
 * Atomically sets the state(s) of one or more channels in a mix. The
 *   state map is a map of channels -> channel-state-map. A
 *   channel-state-map is a map of attrs -> boolean, where attr is one or
 *   more of :mute, :pause or :solo. Any states supplied are merged with
 *   the current state.
 * 
 *   Note that channels can be added to a mix via toggle, which can be
 *   used to add channels in a particular (e.g. paused) state.
 */
cljs.core.async.toggle = (function cljs$core$async$toggle(mix,state_map){
return cljs.core.async.toggle_STAR_.call(null,mix,state_map);
});
/**
 * Sets the solo mode of the mix. mode must be one of :mute or :pause
 */
cljs.core.async.solo_mode = (function cljs$core$async$solo_mode(mix,mode){
return cljs.core.async.solo_mode_STAR_.call(null,mix,mode);
});

/**
 * @interface
 */
cljs.core.async.Pub = function(){};

cljs.core.async.sub_STAR_ = (function cljs$core$async$sub_STAR_(p,v,ch,close_QMARK_){
if((!((p == null))) && (!((p.cljs$core$async$Pub$sub_STAR_$arity$4 == null)))){
return p.cljs$core$async$Pub$sub_STAR_$arity$4(p,v,ch,close_QMARK_);
} else {
var x__24056__auto__ = (((p == null))?null:p);
var m__24057__auto__ = (cljs.core.async.sub_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,p,v,ch,close_QMARK_);
} else {
var m__24057__auto____$1 = (cljs.core.async.sub_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,p,v,ch,close_QMARK_);
} else {
throw cljs.core.missing_protocol.call(null,"Pub.sub*",p);
}
}
}
});

cljs.core.async.unsub_STAR_ = (function cljs$core$async$unsub_STAR_(p,v,ch){
if((!((p == null))) && (!((p.cljs$core$async$Pub$unsub_STAR_$arity$3 == null)))){
return p.cljs$core$async$Pub$unsub_STAR_$arity$3(p,v,ch);
} else {
var x__24056__auto__ = (((p == null))?null:p);
var m__24057__auto__ = (cljs.core.async.unsub_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,p,v,ch);
} else {
var m__24057__auto____$1 = (cljs.core.async.unsub_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,p,v,ch);
} else {
throw cljs.core.missing_protocol.call(null,"Pub.unsub*",p);
}
}
}
});

cljs.core.async.unsub_all_STAR_ = (function cljs$core$async$unsub_all_STAR_(var_args){
var args32744 = [];
var len__24559__auto___32747 = arguments.length;
var i__24560__auto___32748 = (0);
while(true){
if((i__24560__auto___32748 < len__24559__auto___32747)){
args32744.push((arguments[i__24560__auto___32748]));

var G__32749 = (i__24560__auto___32748 + (1));
i__24560__auto___32748 = G__32749;
continue;
} else {
}
break;
}

var G__32746 = args32744.length;
switch (G__32746) {
case 1:
return cljs.core.async.unsub_all_STAR_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.unsub_all_STAR_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32744.length)].join('')));

}
});

cljs.core.async.unsub_all_STAR_.cljs$core$IFn$_invoke$arity$1 = (function (p){
if((!((p == null))) && (!((p.cljs$core$async$Pub$unsub_all_STAR_$arity$1 == null)))){
return p.cljs$core$async$Pub$unsub_all_STAR_$arity$1(p);
} else {
var x__24056__auto__ = (((p == null))?null:p);
var m__24057__auto__ = (cljs.core.async.unsub_all_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,p);
} else {
var m__24057__auto____$1 = (cljs.core.async.unsub_all_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,p);
} else {
throw cljs.core.missing_protocol.call(null,"Pub.unsub-all*",p);
}
}
}
});

cljs.core.async.unsub_all_STAR_.cljs$core$IFn$_invoke$arity$2 = (function (p,v){
if((!((p == null))) && (!((p.cljs$core$async$Pub$unsub_all_STAR_$arity$2 == null)))){
return p.cljs$core$async$Pub$unsub_all_STAR_$arity$2(p,v);
} else {
var x__24056__auto__ = (((p == null))?null:p);
var m__24057__auto__ = (cljs.core.async.unsub_all_STAR_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,p,v);
} else {
var m__24057__auto____$1 = (cljs.core.async.unsub_all_STAR_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,p,v);
} else {
throw cljs.core.missing_protocol.call(null,"Pub.unsub-all*",p);
}
}
}
});

cljs.core.async.unsub_all_STAR_.cljs$lang$maxFixedArity = 2;


/**
 * Creates and returns a pub(lication) of the supplied channel,
 *   partitioned into topics by the topic-fn. topic-fn will be applied to
 *   each value on the channel and the result will determine the 'topic'
 *   on which that value will be put. Channels can be subscribed to
 *   receive copies of topics using 'sub', and unsubscribed using
 *   'unsub'. Each topic will be handled by an internal mult on a
 *   dedicated channel. By default these internal channels are
 *   unbuffered, but a buf-fn can be supplied which, given a topic,
 *   creates a buffer with desired properties.
 * 
 *   Each item is distributed to all subs in parallel and synchronously,
 *   i.e. each sub must accept before the next item is distributed. Use
 *   buffering/windowing to prevent slow subs from holding up the pub.
 * 
 *   Items received when there are no matching subs get dropped.
 * 
 *   Note that if buf-fns are used then each topic is handled
 *   asynchronously, i.e. if a channel is subscribed to more than one
 *   topic it should not expect them to be interleaved identically with
 *   the source.
 */
cljs.core.async.pub = (function cljs$core$async$pub(var_args){
var args32752 = [];
var len__24559__auto___32877 = arguments.length;
var i__24560__auto___32878 = (0);
while(true){
if((i__24560__auto___32878 < len__24559__auto___32877)){
args32752.push((arguments[i__24560__auto___32878]));

var G__32879 = (i__24560__auto___32878 + (1));
i__24560__auto___32878 = G__32879;
continue;
} else {
}
break;
}

var G__32754 = args32752.length;
switch (G__32754) {
case 2:
return cljs.core.async.pub.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.pub.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32752.length)].join('')));

}
});

cljs.core.async.pub.cljs$core$IFn$_invoke$arity$2 = (function (ch,topic_fn){
return cljs.core.async.pub.call(null,ch,topic_fn,cljs.core.constantly.call(null,null));
});

cljs.core.async.pub.cljs$core$IFn$_invoke$arity$3 = (function (ch,topic_fn,buf_fn){
var mults = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var ensure_mult = ((function (mults){
return (function (topic){
var or__23338__auto__ = cljs.core.get.call(null,cljs.core.deref.call(null,mults),topic);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.get.call(null,cljs.core.swap_BANG_.call(null,mults,((function (or__23338__auto__,mults){
return (function (p1__32751_SHARP_){
if(cljs.core.truth_(p1__32751_SHARP_.call(null,topic))){
return p1__32751_SHARP_;
} else {
return cljs.core.assoc.call(null,p1__32751_SHARP_,topic,cljs.core.async.mult.call(null,cljs.core.async.chan.call(null,buf_fn.call(null,topic))));
}
});})(or__23338__auto__,mults))
),topic);
}
});})(mults))
;
var p = (function (){
if(typeof cljs.core.async.t_cljs$core$async32755 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.Pub}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.async.Mux}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async32755 = (function (ch,topic_fn,buf_fn,mults,ensure_mult,meta32756){
this.ch = ch;
this.topic_fn = topic_fn;
this.buf_fn = buf_fn;
this.mults = mults;
this.ensure_mult = ensure_mult;
this.meta32756 = meta32756;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (mults,ensure_mult){
return (function (_32757,meta32756__$1){
var self__ = this;
var _32757__$1 = this;
return (new cljs.core.async.t_cljs$core$async32755(self__.ch,self__.topic_fn,self__.buf_fn,self__.mults,self__.ensure_mult,meta32756__$1));
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (mults,ensure_mult){
return (function (_32757){
var self__ = this;
var _32757__$1 = this;
return self__.meta32756;
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Mux$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Mux$muxch_STAR_$arity$1 = ((function (mults,ensure_mult){
return (function (_){
var self__ = this;
var ___$1 = this;
return self__.ch;
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Pub$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Pub$sub_STAR_$arity$4 = ((function (mults,ensure_mult){
return (function (p,topic,ch__$1,close_QMARK_){
var self__ = this;
var p__$1 = this;
var m = self__.ensure_mult.call(null,topic);
return cljs.core.async.tap.call(null,m,ch__$1,close_QMARK_);
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Pub$unsub_STAR_$arity$3 = ((function (mults,ensure_mult){
return (function (p,topic,ch__$1){
var self__ = this;
var p__$1 = this;
var temp__5278__auto__ = cljs.core.get.call(null,cljs.core.deref.call(null,self__.mults),topic);
if(cljs.core.truth_(temp__5278__auto__)){
var m = temp__5278__auto__;
return cljs.core.async.untap.call(null,m,ch__$1);
} else {
return null;
}
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Pub$unsub_all_STAR_$arity$1 = ((function (mults,ensure_mult){
return (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.reset_BANG_.call(null,self__.mults,cljs.core.PersistentArrayMap.EMPTY);
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.prototype.cljs$core$async$Pub$unsub_all_STAR_$arity$2 = ((function (mults,ensure_mult){
return (function (_,topic){
var self__ = this;
var ___$1 = this;
return cljs.core.swap_BANG_.call(null,self__.mults,cljs.core.dissoc,topic);
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.getBasis = ((function (mults,ensure_mult){
return (function (){
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"topic-fn","topic-fn",-862449736,null),new cljs.core.Symbol(null,"buf-fn","buf-fn",-1200281591,null),new cljs.core.Symbol(null,"mults","mults",-461114485,null),new cljs.core.Symbol(null,"ensure-mult","ensure-mult",1796584816,null),new cljs.core.Symbol(null,"meta32756","meta32756",-80050246,null)], null);
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32755.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async32755.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async32755";

cljs.core.async.t_cljs$core$async32755.cljs$lang$ctorPrWriter = ((function (mults,ensure_mult){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async32755");
});})(mults,ensure_mult))
;

cljs.core.async.__GT_t_cljs$core$async32755 = ((function (mults,ensure_mult){
return (function cljs$core$async$__GT_t_cljs$core$async32755(ch__$1,topic_fn__$1,buf_fn__$1,mults__$1,ensure_mult__$1,meta32756){
return (new cljs.core.async.t_cljs$core$async32755(ch__$1,topic_fn__$1,buf_fn__$1,mults__$1,ensure_mult__$1,meta32756));
});})(mults,ensure_mult))
;

}

return (new cljs.core.async.t_cljs$core$async32755(ch,topic_fn,buf_fn,mults,ensure_mult,cljs.core.PersistentArrayMap.EMPTY));
})()
;
var c__30913__auto___32881 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___32881,mults,ensure_mult,p){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___32881,mults,ensure_mult,p){
return (function (state_32829){
var state_val_32830 = (state_32829[(1)]);
if((state_val_32830 === (7))){
var inst_32825 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32831_32882 = state_32829__$1;
(statearr_32831_32882[(2)] = inst_32825);

(statearr_32831_32882[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (20))){
var state_32829__$1 = state_32829;
var statearr_32832_32883 = state_32829__$1;
(statearr_32832_32883[(2)] = null);

(statearr_32832_32883[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (1))){
var state_32829__$1 = state_32829;
var statearr_32833_32884 = state_32829__$1;
(statearr_32833_32884[(2)] = null);

(statearr_32833_32884[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (24))){
var inst_32808 = (state_32829[(7)]);
var inst_32817 = cljs.core.swap_BANG_.call(null,mults,cljs.core.dissoc,inst_32808);
var state_32829__$1 = state_32829;
var statearr_32834_32885 = state_32829__$1;
(statearr_32834_32885[(2)] = inst_32817);

(statearr_32834_32885[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (4))){
var inst_32760 = (state_32829[(8)]);
var inst_32760__$1 = (state_32829[(2)]);
var inst_32761 = (inst_32760__$1 == null);
var state_32829__$1 = (function (){var statearr_32835 = state_32829;
(statearr_32835[(8)] = inst_32760__$1);

return statearr_32835;
})();
if(cljs.core.truth_(inst_32761)){
var statearr_32836_32886 = state_32829__$1;
(statearr_32836_32886[(1)] = (5));

} else {
var statearr_32837_32887 = state_32829__$1;
(statearr_32837_32887[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (15))){
var inst_32802 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32838_32888 = state_32829__$1;
(statearr_32838_32888[(2)] = inst_32802);

(statearr_32838_32888[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (21))){
var inst_32822 = (state_32829[(2)]);
var state_32829__$1 = (function (){var statearr_32839 = state_32829;
(statearr_32839[(9)] = inst_32822);

return statearr_32839;
})();
var statearr_32840_32889 = state_32829__$1;
(statearr_32840_32889[(2)] = null);

(statearr_32840_32889[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (13))){
var inst_32784 = (state_32829[(10)]);
var inst_32786 = cljs.core.chunked_seq_QMARK_.call(null,inst_32784);
var state_32829__$1 = state_32829;
if(inst_32786){
var statearr_32841_32890 = state_32829__$1;
(statearr_32841_32890[(1)] = (16));

} else {
var statearr_32842_32891 = state_32829__$1;
(statearr_32842_32891[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (22))){
var inst_32814 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
if(cljs.core.truth_(inst_32814)){
var statearr_32843_32892 = state_32829__$1;
(statearr_32843_32892[(1)] = (23));

} else {
var statearr_32844_32893 = state_32829__$1;
(statearr_32844_32893[(1)] = (24));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (6))){
var inst_32760 = (state_32829[(8)]);
var inst_32810 = (state_32829[(11)]);
var inst_32808 = (state_32829[(7)]);
var inst_32808__$1 = topic_fn.call(null,inst_32760);
var inst_32809 = cljs.core.deref.call(null,mults);
var inst_32810__$1 = cljs.core.get.call(null,inst_32809,inst_32808__$1);
var state_32829__$1 = (function (){var statearr_32845 = state_32829;
(statearr_32845[(11)] = inst_32810__$1);

(statearr_32845[(7)] = inst_32808__$1);

return statearr_32845;
})();
if(cljs.core.truth_(inst_32810__$1)){
var statearr_32846_32894 = state_32829__$1;
(statearr_32846_32894[(1)] = (19));

} else {
var statearr_32847_32895 = state_32829__$1;
(statearr_32847_32895[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (25))){
var inst_32819 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32848_32896 = state_32829__$1;
(statearr_32848_32896[(2)] = inst_32819);

(statearr_32848_32896[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (17))){
var inst_32784 = (state_32829[(10)]);
var inst_32793 = cljs.core.first.call(null,inst_32784);
var inst_32794 = cljs.core.async.muxch_STAR_.call(null,inst_32793);
var inst_32795 = cljs.core.async.close_BANG_.call(null,inst_32794);
var inst_32796 = cljs.core.next.call(null,inst_32784);
var inst_32770 = inst_32796;
var inst_32771 = null;
var inst_32772 = (0);
var inst_32773 = (0);
var state_32829__$1 = (function (){var statearr_32849 = state_32829;
(statearr_32849[(12)] = inst_32771);

(statearr_32849[(13)] = inst_32770);

(statearr_32849[(14)] = inst_32773);

(statearr_32849[(15)] = inst_32795);

(statearr_32849[(16)] = inst_32772);

return statearr_32849;
})();
var statearr_32850_32897 = state_32829__$1;
(statearr_32850_32897[(2)] = null);

(statearr_32850_32897[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (3))){
var inst_32827 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32829__$1,inst_32827);
} else {
if((state_val_32830 === (12))){
var inst_32804 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32851_32898 = state_32829__$1;
(statearr_32851_32898[(2)] = inst_32804);

(statearr_32851_32898[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (2))){
var state_32829__$1 = state_32829;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32829__$1,(4),ch);
} else {
if((state_val_32830 === (23))){
var state_32829__$1 = state_32829;
var statearr_32852_32899 = state_32829__$1;
(statearr_32852_32899[(2)] = null);

(statearr_32852_32899[(1)] = (25));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (19))){
var inst_32760 = (state_32829[(8)]);
var inst_32810 = (state_32829[(11)]);
var inst_32812 = cljs.core.async.muxch_STAR_.call(null,inst_32810);
var state_32829__$1 = state_32829;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32829__$1,(22),inst_32812,inst_32760);
} else {
if((state_val_32830 === (11))){
var inst_32770 = (state_32829[(13)]);
var inst_32784 = (state_32829[(10)]);
var inst_32784__$1 = cljs.core.seq.call(null,inst_32770);
var state_32829__$1 = (function (){var statearr_32853 = state_32829;
(statearr_32853[(10)] = inst_32784__$1);

return statearr_32853;
})();
if(inst_32784__$1){
var statearr_32854_32900 = state_32829__$1;
(statearr_32854_32900[(1)] = (13));

} else {
var statearr_32855_32901 = state_32829__$1;
(statearr_32855_32901[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (9))){
var inst_32806 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32856_32902 = state_32829__$1;
(statearr_32856_32902[(2)] = inst_32806);

(statearr_32856_32902[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (5))){
var inst_32767 = cljs.core.deref.call(null,mults);
var inst_32768 = cljs.core.vals.call(null,inst_32767);
var inst_32769 = cljs.core.seq.call(null,inst_32768);
var inst_32770 = inst_32769;
var inst_32771 = null;
var inst_32772 = (0);
var inst_32773 = (0);
var state_32829__$1 = (function (){var statearr_32857 = state_32829;
(statearr_32857[(12)] = inst_32771);

(statearr_32857[(13)] = inst_32770);

(statearr_32857[(14)] = inst_32773);

(statearr_32857[(16)] = inst_32772);

return statearr_32857;
})();
var statearr_32858_32903 = state_32829__$1;
(statearr_32858_32903[(2)] = null);

(statearr_32858_32903[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (14))){
var state_32829__$1 = state_32829;
var statearr_32862_32904 = state_32829__$1;
(statearr_32862_32904[(2)] = null);

(statearr_32862_32904[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (16))){
var inst_32784 = (state_32829[(10)]);
var inst_32788 = cljs.core.chunk_first.call(null,inst_32784);
var inst_32789 = cljs.core.chunk_rest.call(null,inst_32784);
var inst_32790 = cljs.core.count.call(null,inst_32788);
var inst_32770 = inst_32789;
var inst_32771 = inst_32788;
var inst_32772 = inst_32790;
var inst_32773 = (0);
var state_32829__$1 = (function (){var statearr_32863 = state_32829;
(statearr_32863[(12)] = inst_32771);

(statearr_32863[(13)] = inst_32770);

(statearr_32863[(14)] = inst_32773);

(statearr_32863[(16)] = inst_32772);

return statearr_32863;
})();
var statearr_32864_32905 = state_32829__$1;
(statearr_32864_32905[(2)] = null);

(statearr_32864_32905[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (10))){
var inst_32771 = (state_32829[(12)]);
var inst_32770 = (state_32829[(13)]);
var inst_32773 = (state_32829[(14)]);
var inst_32772 = (state_32829[(16)]);
var inst_32778 = cljs.core._nth.call(null,inst_32771,inst_32773);
var inst_32779 = cljs.core.async.muxch_STAR_.call(null,inst_32778);
var inst_32780 = cljs.core.async.close_BANG_.call(null,inst_32779);
var inst_32781 = (inst_32773 + (1));
var tmp32859 = inst_32771;
var tmp32860 = inst_32770;
var tmp32861 = inst_32772;
var inst_32770__$1 = tmp32860;
var inst_32771__$1 = tmp32859;
var inst_32772__$1 = tmp32861;
var inst_32773__$1 = inst_32781;
var state_32829__$1 = (function (){var statearr_32865 = state_32829;
(statearr_32865[(12)] = inst_32771__$1);

(statearr_32865[(17)] = inst_32780);

(statearr_32865[(13)] = inst_32770__$1);

(statearr_32865[(14)] = inst_32773__$1);

(statearr_32865[(16)] = inst_32772__$1);

return statearr_32865;
})();
var statearr_32866_32906 = state_32829__$1;
(statearr_32866_32906[(2)] = null);

(statearr_32866_32906[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (18))){
var inst_32799 = (state_32829[(2)]);
var state_32829__$1 = state_32829;
var statearr_32867_32907 = state_32829__$1;
(statearr_32867_32907[(2)] = inst_32799);

(statearr_32867_32907[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32830 === (8))){
var inst_32773 = (state_32829[(14)]);
var inst_32772 = (state_32829[(16)]);
var inst_32775 = (inst_32773 < inst_32772);
var inst_32776 = inst_32775;
var state_32829__$1 = state_32829;
if(cljs.core.truth_(inst_32776)){
var statearr_32868_32908 = state_32829__$1;
(statearr_32868_32908[(1)] = (10));

} else {
var statearr_32869_32909 = state_32829__$1;
(statearr_32869_32909[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___32881,mults,ensure_mult,p))
;
return ((function (switch__30799__auto__,c__30913__auto___32881,mults,ensure_mult,p){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_32873 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32873[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_32873[(1)] = (1));

return statearr_32873;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_32829){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_32829);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e32874){if((e32874 instanceof Object)){
var ex__30803__auto__ = e32874;
var statearr_32875_32910 = state_32829;
(statearr_32875_32910[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32829);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e32874;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32911 = state_32829;
state_32829 = G__32911;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_32829){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_32829);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___32881,mults,ensure_mult,p))
})();
var state__30915__auto__ = (function (){var statearr_32876 = f__30914__auto__.call(null);
(statearr_32876[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___32881);

return statearr_32876;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___32881,mults,ensure_mult,p))
);


return p;
});

cljs.core.async.pub.cljs$lang$maxFixedArity = 3;

/**
 * Subscribes a channel to a topic of a pub.
 * 
 *   By default the channel will be closed when the source closes,
 *   but can be determined by the close? parameter.
 */
cljs.core.async.sub = (function cljs$core$async$sub(var_args){
var args32912 = [];
var len__24559__auto___32915 = arguments.length;
var i__24560__auto___32916 = (0);
while(true){
if((i__24560__auto___32916 < len__24559__auto___32915)){
args32912.push((arguments[i__24560__auto___32916]));

var G__32917 = (i__24560__auto___32916 + (1));
i__24560__auto___32916 = G__32917;
continue;
} else {
}
break;
}

var G__32914 = args32912.length;
switch (G__32914) {
case 3:
return cljs.core.async.sub.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
case 4:
return cljs.core.async.sub.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32912.length)].join('')));

}
});

cljs.core.async.sub.cljs$core$IFn$_invoke$arity$3 = (function (p,topic,ch){
return cljs.core.async.sub.call(null,p,topic,ch,true);
});

cljs.core.async.sub.cljs$core$IFn$_invoke$arity$4 = (function (p,topic,ch,close_QMARK_){
return cljs.core.async.sub_STAR_.call(null,p,topic,ch,close_QMARK_);
});

cljs.core.async.sub.cljs$lang$maxFixedArity = 4;

/**
 * Unsubscribes a channel from a topic of a pub
 */
cljs.core.async.unsub = (function cljs$core$async$unsub(p,topic,ch){
return cljs.core.async.unsub_STAR_.call(null,p,topic,ch);
});
/**
 * Unsubscribes all channels from a pub, or a topic of a pub
 */
cljs.core.async.unsub_all = (function cljs$core$async$unsub_all(var_args){
var args32919 = [];
var len__24559__auto___32922 = arguments.length;
var i__24560__auto___32923 = (0);
while(true){
if((i__24560__auto___32923 < len__24559__auto___32922)){
args32919.push((arguments[i__24560__auto___32923]));

var G__32924 = (i__24560__auto___32923 + (1));
i__24560__auto___32923 = G__32924;
continue;
} else {
}
break;
}

var G__32921 = args32919.length;
switch (G__32921) {
case 1:
return cljs.core.async.unsub_all.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.unsub_all.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32919.length)].join('')));

}
});

cljs.core.async.unsub_all.cljs$core$IFn$_invoke$arity$1 = (function (p){
return cljs.core.async.unsub_all_STAR_.call(null,p);
});

cljs.core.async.unsub_all.cljs$core$IFn$_invoke$arity$2 = (function (p,topic){
return cljs.core.async.unsub_all_STAR_.call(null,p,topic);
});

cljs.core.async.unsub_all.cljs$lang$maxFixedArity = 2;

/**
 * Takes a function and a collection of source channels, and returns a
 *   channel which contains the values produced by applying f to the set
 *   of first items taken from each source channel, followed by applying
 *   f to the set of second items from each channel, until any one of the
 *   channels is closed, at which point the output channel will be
 *   closed. The returned channel will be unbuffered by default, or a
 *   buf-or-n can be supplied
 */
cljs.core.async.map = (function cljs$core$async$map(var_args){
var args32926 = [];
var len__24559__auto___32997 = arguments.length;
var i__24560__auto___32998 = (0);
while(true){
if((i__24560__auto___32998 < len__24559__auto___32997)){
args32926.push((arguments[i__24560__auto___32998]));

var G__32999 = (i__24560__auto___32998 + (1));
i__24560__auto___32998 = G__32999;
continue;
} else {
}
break;
}

var G__32928 = args32926.length;
switch (G__32928) {
case 2:
return cljs.core.async.map.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.map.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args32926.length)].join('')));

}
});

cljs.core.async.map.cljs$core$IFn$_invoke$arity$2 = (function (f,chs){
return cljs.core.async.map.call(null,f,chs,null);
});

cljs.core.async.map.cljs$core$IFn$_invoke$arity$3 = (function (f,chs,buf_or_n){
var chs__$1 = cljs.core.vec.call(null,chs);
var out = cljs.core.async.chan.call(null,buf_or_n);
var cnt = cljs.core.count.call(null,chs__$1);
var rets = cljs.core.object_array.call(null,cnt);
var dchan = cljs.core.async.chan.call(null,(1));
var dctr = cljs.core.atom.call(null,null);
var done = cljs.core.mapv.call(null,((function (chs__$1,out,cnt,rets,dchan,dctr){
return (function (i){
return ((function (chs__$1,out,cnt,rets,dchan,dctr){
return (function (ret){
(rets[i] = ret);

if((cljs.core.swap_BANG_.call(null,dctr,cljs.core.dec) === (0))){
return cljs.core.async.put_BANG_.call(null,dchan,rets.slice((0)));
} else {
return null;
}
});
;})(chs__$1,out,cnt,rets,dchan,dctr))
});})(chs__$1,out,cnt,rets,dchan,dctr))
,cljs.core.range.call(null,cnt));
var c__30913__auto___33001 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function (state_32967){
var state_val_32968 = (state_32967[(1)]);
if((state_val_32968 === (7))){
var state_32967__$1 = state_32967;
var statearr_32969_33002 = state_32967__$1;
(statearr_32969_33002[(2)] = null);

(statearr_32969_33002[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (1))){
var state_32967__$1 = state_32967;
var statearr_32970_33003 = state_32967__$1;
(statearr_32970_33003[(2)] = null);

(statearr_32970_33003[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (4))){
var inst_32931 = (state_32967[(7)]);
var inst_32933 = (inst_32931 < cnt);
var state_32967__$1 = state_32967;
if(cljs.core.truth_(inst_32933)){
var statearr_32971_33004 = state_32967__$1;
(statearr_32971_33004[(1)] = (6));

} else {
var statearr_32972_33005 = state_32967__$1;
(statearr_32972_33005[(1)] = (7));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (15))){
var inst_32963 = (state_32967[(2)]);
var state_32967__$1 = state_32967;
var statearr_32973_33006 = state_32967__$1;
(statearr_32973_33006[(2)] = inst_32963);

(statearr_32973_33006[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (13))){
var inst_32956 = cljs.core.async.close_BANG_.call(null,out);
var state_32967__$1 = state_32967;
var statearr_32974_33007 = state_32967__$1;
(statearr_32974_33007[(2)] = inst_32956);

(statearr_32974_33007[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (6))){
var state_32967__$1 = state_32967;
var statearr_32975_33008 = state_32967__$1;
(statearr_32975_33008[(2)] = null);

(statearr_32975_33008[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (3))){
var inst_32965 = (state_32967[(2)]);
var state_32967__$1 = state_32967;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32967__$1,inst_32965);
} else {
if((state_val_32968 === (12))){
var inst_32953 = (state_32967[(8)]);
var inst_32953__$1 = (state_32967[(2)]);
var inst_32954 = cljs.core.some.call(null,cljs.core.nil_QMARK_,inst_32953__$1);
var state_32967__$1 = (function (){var statearr_32976 = state_32967;
(statearr_32976[(8)] = inst_32953__$1);

return statearr_32976;
})();
if(cljs.core.truth_(inst_32954)){
var statearr_32977_33009 = state_32967__$1;
(statearr_32977_33009[(1)] = (13));

} else {
var statearr_32978_33010 = state_32967__$1;
(statearr_32978_33010[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (2))){
var inst_32930 = cljs.core.reset_BANG_.call(null,dctr,cnt);
var inst_32931 = (0);
var state_32967__$1 = (function (){var statearr_32979 = state_32967;
(statearr_32979[(9)] = inst_32930);

(statearr_32979[(7)] = inst_32931);

return statearr_32979;
})();
var statearr_32980_33011 = state_32967__$1;
(statearr_32980_33011[(2)] = null);

(statearr_32980_33011[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (11))){
var inst_32931 = (state_32967[(7)]);
var _ = cljs.core.async.impl.ioc_helpers.add_exception_frame.call(null,state_32967,(10),Object,null,(9));
var inst_32940 = chs__$1.call(null,inst_32931);
var inst_32941 = done.call(null,inst_32931);
var inst_32942 = cljs.core.async.take_BANG_.call(null,inst_32940,inst_32941);
var state_32967__$1 = state_32967;
var statearr_32981_33012 = state_32967__$1;
(statearr_32981_33012[(2)] = inst_32942);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32967__$1);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (9))){
var inst_32931 = (state_32967[(7)]);
var inst_32944 = (state_32967[(2)]);
var inst_32945 = (inst_32931 + (1));
var inst_32931__$1 = inst_32945;
var state_32967__$1 = (function (){var statearr_32982 = state_32967;
(statearr_32982[(7)] = inst_32931__$1);

(statearr_32982[(10)] = inst_32944);

return statearr_32982;
})();
var statearr_32983_33013 = state_32967__$1;
(statearr_32983_33013[(2)] = null);

(statearr_32983_33013[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (5))){
var inst_32951 = (state_32967[(2)]);
var state_32967__$1 = (function (){var statearr_32984 = state_32967;
(statearr_32984[(11)] = inst_32951);

return statearr_32984;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32967__$1,(12),dchan);
} else {
if((state_val_32968 === (14))){
var inst_32953 = (state_32967[(8)]);
var inst_32958 = cljs.core.apply.call(null,f,inst_32953);
var state_32967__$1 = state_32967;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32967__$1,(16),out,inst_32958);
} else {
if((state_val_32968 === (16))){
var inst_32960 = (state_32967[(2)]);
var state_32967__$1 = (function (){var statearr_32985 = state_32967;
(statearr_32985[(12)] = inst_32960);

return statearr_32985;
})();
var statearr_32986_33014 = state_32967__$1;
(statearr_32986_33014[(2)] = null);

(statearr_32986_33014[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (10))){
var inst_32935 = (state_32967[(2)]);
var inst_32936 = cljs.core.swap_BANG_.call(null,dctr,cljs.core.dec);
var state_32967__$1 = (function (){var statearr_32987 = state_32967;
(statearr_32987[(13)] = inst_32935);

return statearr_32987;
})();
var statearr_32988_33015 = state_32967__$1;
(statearr_32988_33015[(2)] = inst_32936);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32967__$1);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32968 === (8))){
var inst_32949 = (state_32967[(2)]);
var state_32967__$1 = state_32967;
var statearr_32989_33016 = state_32967__$1;
(statearr_32989_33016[(2)] = inst_32949);

(statearr_32989_33016[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done))
;
return ((function (switch__30799__auto__,c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_32993 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32993[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_32993[(1)] = (1));

return statearr_32993;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_32967){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_32967);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e32994){if((e32994 instanceof Object)){
var ex__30803__auto__ = e32994;
var statearr_32995_33017 = state_32967;
(statearr_32995_33017[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_32967);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e32994;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33018 = state_32967;
state_32967 = G__33018;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_32967){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_32967);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done))
})();
var state__30915__auto__ = (function (){var statearr_32996 = f__30914__auto__.call(null);
(statearr_32996[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33001);

return statearr_32996;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33001,chs__$1,out,cnt,rets,dchan,dctr,done))
);


return out;
});

cljs.core.async.map.cljs$lang$maxFixedArity = 3;

/**
 * Takes a collection of source channels and returns a channel which
 *   contains all values taken from them. The returned channel will be
 *   unbuffered by default, or a buf-or-n can be supplied. The channel
 *   will close after all the source channels have closed.
 */
cljs.core.async.merge = (function cljs$core$async$merge(var_args){
var args33020 = [];
var len__24559__auto___33078 = arguments.length;
var i__24560__auto___33079 = (0);
while(true){
if((i__24560__auto___33079 < len__24559__auto___33078)){
args33020.push((arguments[i__24560__auto___33079]));

var G__33080 = (i__24560__auto___33079 + (1));
i__24560__auto___33079 = G__33080;
continue;
} else {
}
break;
}

var G__33022 = args33020.length;
switch (G__33022) {
case 1:
return cljs.core.async.merge.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.merge.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33020.length)].join('')));

}
});

cljs.core.async.merge.cljs$core$IFn$_invoke$arity$1 = (function (chs){
return cljs.core.async.merge.call(null,chs,null);
});

cljs.core.async.merge.cljs$core$IFn$_invoke$arity$2 = (function (chs,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33082 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33082,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33082,out){
return (function (state_33054){
var state_val_33055 = (state_33054[(1)]);
if((state_val_33055 === (7))){
var inst_33033 = (state_33054[(7)]);
var inst_33034 = (state_33054[(8)]);
var inst_33033__$1 = (state_33054[(2)]);
var inst_33034__$1 = cljs.core.nth.call(null,inst_33033__$1,(0),null);
var inst_33035 = cljs.core.nth.call(null,inst_33033__$1,(1),null);
var inst_33036 = (inst_33034__$1 == null);
var state_33054__$1 = (function (){var statearr_33056 = state_33054;
(statearr_33056[(9)] = inst_33035);

(statearr_33056[(7)] = inst_33033__$1);

(statearr_33056[(8)] = inst_33034__$1);

return statearr_33056;
})();
if(cljs.core.truth_(inst_33036)){
var statearr_33057_33083 = state_33054__$1;
(statearr_33057_33083[(1)] = (8));

} else {
var statearr_33058_33084 = state_33054__$1;
(statearr_33058_33084[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (1))){
var inst_33023 = cljs.core.vec.call(null,chs);
var inst_33024 = inst_33023;
var state_33054__$1 = (function (){var statearr_33059 = state_33054;
(statearr_33059[(10)] = inst_33024);

return statearr_33059;
})();
var statearr_33060_33085 = state_33054__$1;
(statearr_33060_33085[(2)] = null);

(statearr_33060_33085[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (4))){
var inst_33024 = (state_33054[(10)]);
var state_33054__$1 = state_33054;
return cljs.core.async.ioc_alts_BANG_.call(null,state_33054__$1,(7),inst_33024);
} else {
if((state_val_33055 === (6))){
var inst_33050 = (state_33054[(2)]);
var state_33054__$1 = state_33054;
var statearr_33061_33086 = state_33054__$1;
(statearr_33061_33086[(2)] = inst_33050);

(statearr_33061_33086[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (3))){
var inst_33052 = (state_33054[(2)]);
var state_33054__$1 = state_33054;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33054__$1,inst_33052);
} else {
if((state_val_33055 === (2))){
var inst_33024 = (state_33054[(10)]);
var inst_33026 = cljs.core.count.call(null,inst_33024);
var inst_33027 = (inst_33026 > (0));
var state_33054__$1 = state_33054;
if(cljs.core.truth_(inst_33027)){
var statearr_33063_33087 = state_33054__$1;
(statearr_33063_33087[(1)] = (4));

} else {
var statearr_33064_33088 = state_33054__$1;
(statearr_33064_33088[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (11))){
var inst_33024 = (state_33054[(10)]);
var inst_33043 = (state_33054[(2)]);
var tmp33062 = inst_33024;
var inst_33024__$1 = tmp33062;
var state_33054__$1 = (function (){var statearr_33065 = state_33054;
(statearr_33065[(10)] = inst_33024__$1);

(statearr_33065[(11)] = inst_33043);

return statearr_33065;
})();
var statearr_33066_33089 = state_33054__$1;
(statearr_33066_33089[(2)] = null);

(statearr_33066_33089[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (9))){
var inst_33034 = (state_33054[(8)]);
var state_33054__$1 = state_33054;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33054__$1,(11),out,inst_33034);
} else {
if((state_val_33055 === (5))){
var inst_33048 = cljs.core.async.close_BANG_.call(null,out);
var state_33054__$1 = state_33054;
var statearr_33067_33090 = state_33054__$1;
(statearr_33067_33090[(2)] = inst_33048);

(statearr_33067_33090[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (10))){
var inst_33046 = (state_33054[(2)]);
var state_33054__$1 = state_33054;
var statearr_33068_33091 = state_33054__$1;
(statearr_33068_33091[(2)] = inst_33046);

(statearr_33068_33091[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33055 === (8))){
var inst_33035 = (state_33054[(9)]);
var inst_33033 = (state_33054[(7)]);
var inst_33024 = (state_33054[(10)]);
var inst_33034 = (state_33054[(8)]);
var inst_33038 = (function (){var cs = inst_33024;
var vec__33029 = inst_33033;
var v = inst_33034;
var c = inst_33035;
return ((function (cs,vec__33029,v,c,inst_33035,inst_33033,inst_33024,inst_33034,state_val_33055,c__30913__auto___33082,out){
return (function (p1__33019_SHARP_){
return cljs.core.not_EQ_.call(null,c,p1__33019_SHARP_);
});
;})(cs,vec__33029,v,c,inst_33035,inst_33033,inst_33024,inst_33034,state_val_33055,c__30913__auto___33082,out))
})();
var inst_33039 = cljs.core.filterv.call(null,inst_33038,inst_33024);
var inst_33024__$1 = inst_33039;
var state_33054__$1 = (function (){var statearr_33069 = state_33054;
(statearr_33069[(10)] = inst_33024__$1);

return statearr_33069;
})();
var statearr_33070_33092 = state_33054__$1;
(statearr_33070_33092[(2)] = null);

(statearr_33070_33092[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33082,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33082,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33074 = [null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33074[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33074[(1)] = (1));

return statearr_33074;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33054){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33054);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33075){if((e33075 instanceof Object)){
var ex__30803__auto__ = e33075;
var statearr_33076_33093 = state_33054;
(statearr_33076_33093[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33054);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33075;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33094 = state_33054;
state_33054 = G__33094;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33054){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33054);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33082,out))
})();
var state__30915__auto__ = (function (){var statearr_33077 = f__30914__auto__.call(null);
(statearr_33077[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33082);

return statearr_33077;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33082,out))
);


return out;
});

cljs.core.async.merge.cljs$lang$maxFixedArity = 2;

/**
 * Returns a channel containing the single (collection) result of the
 *   items taken from the channel conjoined to the supplied
 *   collection. ch must close before into produces a result.
 */
cljs.core.async.into = (function cljs$core$async$into(coll,ch){
return cljs.core.async.reduce.call(null,cljs.core.conj,coll,ch);
});
/**
 * Returns a channel that will return, at most, n items from ch. After n items
 * have been returned, or ch has been closed, the return chanel will close.
 * 
 *   The output channel is unbuffered by default, unless buf-or-n is given.
 */
cljs.core.async.take = (function cljs$core$async$take(var_args){
var args33095 = [];
var len__24559__auto___33144 = arguments.length;
var i__24560__auto___33145 = (0);
while(true){
if((i__24560__auto___33145 < len__24559__auto___33144)){
args33095.push((arguments[i__24560__auto___33145]));

var G__33146 = (i__24560__auto___33145 + (1));
i__24560__auto___33145 = G__33146;
continue;
} else {
}
break;
}

var G__33097 = args33095.length;
switch (G__33097) {
case 2:
return cljs.core.async.take.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.take.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33095.length)].join('')));

}
});

cljs.core.async.take.cljs$core$IFn$_invoke$arity$2 = (function (n,ch){
return cljs.core.async.take.call(null,n,ch,null);
});

cljs.core.async.take.cljs$core$IFn$_invoke$arity$3 = (function (n,ch,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33148 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33148,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33148,out){
return (function (state_33121){
var state_val_33122 = (state_33121[(1)]);
if((state_val_33122 === (7))){
var inst_33103 = (state_33121[(7)]);
var inst_33103__$1 = (state_33121[(2)]);
var inst_33104 = (inst_33103__$1 == null);
var inst_33105 = cljs.core.not.call(null,inst_33104);
var state_33121__$1 = (function (){var statearr_33123 = state_33121;
(statearr_33123[(7)] = inst_33103__$1);

return statearr_33123;
})();
if(inst_33105){
var statearr_33124_33149 = state_33121__$1;
(statearr_33124_33149[(1)] = (8));

} else {
var statearr_33125_33150 = state_33121__$1;
(statearr_33125_33150[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (1))){
var inst_33098 = (0);
var state_33121__$1 = (function (){var statearr_33126 = state_33121;
(statearr_33126[(8)] = inst_33098);

return statearr_33126;
})();
var statearr_33127_33151 = state_33121__$1;
(statearr_33127_33151[(2)] = null);

(statearr_33127_33151[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (4))){
var state_33121__$1 = state_33121;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33121__$1,(7),ch);
} else {
if((state_val_33122 === (6))){
var inst_33116 = (state_33121[(2)]);
var state_33121__$1 = state_33121;
var statearr_33128_33152 = state_33121__$1;
(statearr_33128_33152[(2)] = inst_33116);

(statearr_33128_33152[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (3))){
var inst_33118 = (state_33121[(2)]);
var inst_33119 = cljs.core.async.close_BANG_.call(null,out);
var state_33121__$1 = (function (){var statearr_33129 = state_33121;
(statearr_33129[(9)] = inst_33118);

return statearr_33129;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33121__$1,inst_33119);
} else {
if((state_val_33122 === (2))){
var inst_33098 = (state_33121[(8)]);
var inst_33100 = (inst_33098 < n);
var state_33121__$1 = state_33121;
if(cljs.core.truth_(inst_33100)){
var statearr_33130_33153 = state_33121__$1;
(statearr_33130_33153[(1)] = (4));

} else {
var statearr_33131_33154 = state_33121__$1;
(statearr_33131_33154[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (11))){
var inst_33098 = (state_33121[(8)]);
var inst_33108 = (state_33121[(2)]);
var inst_33109 = (inst_33098 + (1));
var inst_33098__$1 = inst_33109;
var state_33121__$1 = (function (){var statearr_33132 = state_33121;
(statearr_33132[(10)] = inst_33108);

(statearr_33132[(8)] = inst_33098__$1);

return statearr_33132;
})();
var statearr_33133_33155 = state_33121__$1;
(statearr_33133_33155[(2)] = null);

(statearr_33133_33155[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (9))){
var state_33121__$1 = state_33121;
var statearr_33134_33156 = state_33121__$1;
(statearr_33134_33156[(2)] = null);

(statearr_33134_33156[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (5))){
var state_33121__$1 = state_33121;
var statearr_33135_33157 = state_33121__$1;
(statearr_33135_33157[(2)] = null);

(statearr_33135_33157[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (10))){
var inst_33113 = (state_33121[(2)]);
var state_33121__$1 = state_33121;
var statearr_33136_33158 = state_33121__$1;
(statearr_33136_33158[(2)] = inst_33113);

(statearr_33136_33158[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33122 === (8))){
var inst_33103 = (state_33121[(7)]);
var state_33121__$1 = state_33121;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33121__$1,(11),out,inst_33103);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33148,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33148,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33140 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_33140[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33140[(1)] = (1));

return statearr_33140;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33121){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33121);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33141){if((e33141 instanceof Object)){
var ex__30803__auto__ = e33141;
var statearr_33142_33159 = state_33121;
(statearr_33142_33159[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33121);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33141;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33160 = state_33121;
state_33121 = G__33160;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33121){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33121);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33148,out))
})();
var state__30915__auto__ = (function (){var statearr_33143 = f__30914__auto__.call(null);
(statearr_33143[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33148);

return statearr_33143;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33148,out))
);


return out;
});

cljs.core.async.take.cljs$lang$maxFixedArity = 3;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.map_LT_ = (function cljs$core$async$map_LT_(f,ch){
if(typeof cljs.core.async.t_cljs$core$async33168 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Channel}
 * @implements {cljs.core.async.impl.protocols.WritePort}
 * @implements {cljs.core.async.impl.protocols.ReadPort}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async33168 = (function (f,ch,meta33169){
this.f = f;
this.ch = ch;
this.meta33169 = meta33169;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_33170,meta33169__$1){
var self__ = this;
var _33170__$1 = this;
return (new cljs.core.async.t_cljs$core$async33168(self__.f,self__.ch,meta33169__$1));
});

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_33170){
var self__ = this;
var _33170__$1 = this;
return self__.meta33169;
});

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.close_BANG_.call(null,self__.ch);
});

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.closed_QMARK_.call(null,self__.ch);
});

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 = (function (_,fn1){
var self__ = this;
var ___$1 = this;
var ret = cljs.core.async.impl.protocols.take_BANG_.call(null,self__.ch,(function (){
if(typeof cljs.core.async.t_cljs$core$async33171 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Handler}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async33171 = (function (f,ch,meta33169,_,fn1,meta33172){
this.f = f;
this.ch = ch;
this.meta33169 = meta33169;
this._ = _;
this.fn1 = fn1;
this.meta33172 = meta33172;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (___$1){
return (function (_33173,meta33172__$1){
var self__ = this;
var _33173__$1 = this;
return (new cljs.core.async.t_cljs$core$async33171(self__.f,self__.ch,self__.meta33169,self__._,self__.fn1,meta33172__$1));
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (___$1){
return (function (_33173){
var self__ = this;
var _33173__$1 = this;
return self__.meta33172;
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = ((function (___$1){
return (function (___$1){
var self__ = this;
var ___$2 = this;
return cljs.core.async.impl.protocols.active_QMARK_.call(null,self__.fn1);
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = ((function (___$1){
return (function (___$1){
var self__ = this;
var ___$2 = this;
return true;
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = ((function (___$1){
return (function (___$1){
var self__ = this;
var ___$2 = this;
var f1 = cljs.core.async.impl.protocols.commit.call(null,self__.fn1);
return ((function (f1,___$2,___$1){
return (function (p1__33161_SHARP_){
return f1.call(null,(((p1__33161_SHARP_ == null))?null:self__.f.call(null,p1__33161_SHARP_)));
});
;})(f1,___$2,___$1))
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.getBasis = ((function (___$1){
return (function (){
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"meta33169","meta33169",-589843472,null),cljs.core.with_meta(new cljs.core.Symbol(null,"_","_",-1201019570,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol("cljs.core.async","t_cljs$core$async33168","cljs.core.async/t_cljs$core$async33168",-961009616,null)], null)),new cljs.core.Symbol(null,"fn1","fn1",895834444,null),new cljs.core.Symbol(null,"meta33172","meta33172",776028568,null)], null);
});})(___$1))
;

cljs.core.async.t_cljs$core$async33171.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async33171.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async33171";

cljs.core.async.t_cljs$core$async33171.cljs$lang$ctorPrWriter = ((function (___$1){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async33171");
});})(___$1))
;

cljs.core.async.__GT_t_cljs$core$async33171 = ((function (___$1){
return (function cljs$core$async$map_LT__$___GT_t_cljs$core$async33171(f__$1,ch__$1,meta33169__$1,___$2,fn1__$1,meta33172){
return (new cljs.core.async.t_cljs$core$async33171(f__$1,ch__$1,meta33169__$1,___$2,fn1__$1,meta33172));
});})(___$1))
;

}

return (new cljs.core.async.t_cljs$core$async33171(self__.f,self__.ch,self__.meta33169,___$1,fn1,cljs.core.PersistentArrayMap.EMPTY));
})()
);
if(cljs.core.truth_((function (){var and__23326__auto__ = ret;
if(cljs.core.truth_(and__23326__auto__)){
return !((cljs.core.deref.call(null,ret) == null));
} else {
return and__23326__auto__;
}
})())){
return cljs.core.async.impl.channels.box.call(null,self__.f.call(null,cljs.core.deref.call(null,ret)));
} else {
return ret;
}
});

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33168.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 = (function (_,val,fn1){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.put_BANG_.call(null,self__.ch,val,fn1);
});

cljs.core.async.t_cljs$core$async33168.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"meta33169","meta33169",-589843472,null)], null);
});

cljs.core.async.t_cljs$core$async33168.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async33168.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async33168";

cljs.core.async.t_cljs$core$async33168.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async33168");
});

cljs.core.async.__GT_t_cljs$core$async33168 = (function cljs$core$async$map_LT__$___GT_t_cljs$core$async33168(f__$1,ch__$1,meta33169){
return (new cljs.core.async.t_cljs$core$async33168(f__$1,ch__$1,meta33169));
});

}

return (new cljs.core.async.t_cljs$core$async33168(f,ch,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.map_GT_ = (function cljs$core$async$map_GT_(f,ch){
if(typeof cljs.core.async.t_cljs$core$async33177 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Channel}
 * @implements {cljs.core.async.impl.protocols.WritePort}
 * @implements {cljs.core.async.impl.protocols.ReadPort}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async33177 = (function (f,ch,meta33178){
this.f = f;
this.ch = ch;
this.meta33178 = meta33178;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_33179,meta33178__$1){
var self__ = this;
var _33179__$1 = this;
return (new cljs.core.async.t_cljs$core$async33177(self__.f,self__.ch,meta33178__$1));
});

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_33179){
var self__ = this;
var _33179__$1 = this;
return self__.meta33178;
});

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.close_BANG_.call(null,self__.ch);
});

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 = (function (_,fn1){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.take_BANG_.call(null,self__.ch,fn1);
});

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33177.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 = (function (_,val,fn1){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.put_BANG_.call(null,self__.ch,self__.f.call(null,val),fn1);
});

cljs.core.async.t_cljs$core$async33177.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"meta33178","meta33178",-963844702,null)], null);
});

cljs.core.async.t_cljs$core$async33177.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async33177.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async33177";

cljs.core.async.t_cljs$core$async33177.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async33177");
});

cljs.core.async.__GT_t_cljs$core$async33177 = (function cljs$core$async$map_GT__$___GT_t_cljs$core$async33177(f__$1,ch__$1,meta33178){
return (new cljs.core.async.t_cljs$core$async33177(f__$1,ch__$1,meta33178));
});

}

return (new cljs.core.async.t_cljs$core$async33177(f,ch,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.filter_GT_ = (function cljs$core$async$filter_GT_(p,ch){
if(typeof cljs.core.async.t_cljs$core$async33183 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Channel}
 * @implements {cljs.core.async.impl.protocols.WritePort}
 * @implements {cljs.core.async.impl.protocols.ReadPort}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async33183 = (function (p,ch,meta33184){
this.p = p;
this.ch = ch;
this.meta33184 = meta33184;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_33185,meta33184__$1){
var self__ = this;
var _33185__$1 = this;
return (new cljs.core.async.t_cljs$core$async33183(self__.p,self__.ch,meta33184__$1));
});

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_33185){
var self__ = this;
var _33185__$1 = this;
return self__.meta33184;
});

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.close_BANG_.call(null,self__.ch);
});

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.closed_QMARK_.call(null,self__.ch);
});

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 = (function (_,fn1){
var self__ = this;
var ___$1 = this;
return cljs.core.async.impl.protocols.take_BANG_.call(null,self__.ch,fn1);
});

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async33183.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 = (function (_,val,fn1){
var self__ = this;
var ___$1 = this;
if(cljs.core.truth_(self__.p.call(null,val))){
return cljs.core.async.impl.protocols.put_BANG_.call(null,self__.ch,val,fn1);
} else {
return cljs.core.async.impl.channels.box.call(null,cljs.core.not.call(null,cljs.core.async.impl.protocols.closed_QMARK_.call(null,self__.ch)));
}
});

cljs.core.async.t_cljs$core$async33183.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p","p",1791580836,null),new cljs.core.Symbol(null,"ch","ch",1085813622,null),new cljs.core.Symbol(null,"meta33184","meta33184",-476384697,null)], null);
});

cljs.core.async.t_cljs$core$async33183.cljs$lang$type = true;

cljs.core.async.t_cljs$core$async33183.cljs$lang$ctorStr = "cljs.core.async/t_cljs$core$async33183";

cljs.core.async.t_cljs$core$async33183.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"cljs.core.async/t_cljs$core$async33183");
});

cljs.core.async.__GT_t_cljs$core$async33183 = (function cljs$core$async$filter_GT__$___GT_t_cljs$core$async33183(p__$1,ch__$1,meta33184){
return (new cljs.core.async.t_cljs$core$async33183(p__$1,ch__$1,meta33184));
});

}

return (new cljs.core.async.t_cljs$core$async33183(p,ch,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.remove_GT_ = (function cljs$core$async$remove_GT_(p,ch){
return cljs.core.async.filter_GT_.call(null,cljs.core.complement.call(null,p),ch);
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.filter_LT_ = (function cljs$core$async$filter_LT_(var_args){
var args33186 = [];
var len__24559__auto___33230 = arguments.length;
var i__24560__auto___33231 = (0);
while(true){
if((i__24560__auto___33231 < len__24559__auto___33230)){
args33186.push((arguments[i__24560__auto___33231]));

var G__33232 = (i__24560__auto___33231 + (1));
i__24560__auto___33231 = G__33232;
continue;
} else {
}
break;
}

var G__33188 = args33186.length;
switch (G__33188) {
case 2:
return cljs.core.async.filter_LT_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.filter_LT_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33186.length)].join('')));

}
});

cljs.core.async.filter_LT_.cljs$core$IFn$_invoke$arity$2 = (function (p,ch){
return cljs.core.async.filter_LT_.call(null,p,ch,null);
});

cljs.core.async.filter_LT_.cljs$core$IFn$_invoke$arity$3 = (function (p,ch,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33234 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33234,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33234,out){
return (function (state_33209){
var state_val_33210 = (state_33209[(1)]);
if((state_val_33210 === (7))){
var inst_33205 = (state_33209[(2)]);
var state_33209__$1 = state_33209;
var statearr_33211_33235 = state_33209__$1;
(statearr_33211_33235[(2)] = inst_33205);

(statearr_33211_33235[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (1))){
var state_33209__$1 = state_33209;
var statearr_33212_33236 = state_33209__$1;
(statearr_33212_33236[(2)] = null);

(statearr_33212_33236[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (4))){
var inst_33191 = (state_33209[(7)]);
var inst_33191__$1 = (state_33209[(2)]);
var inst_33192 = (inst_33191__$1 == null);
var state_33209__$1 = (function (){var statearr_33213 = state_33209;
(statearr_33213[(7)] = inst_33191__$1);

return statearr_33213;
})();
if(cljs.core.truth_(inst_33192)){
var statearr_33214_33237 = state_33209__$1;
(statearr_33214_33237[(1)] = (5));

} else {
var statearr_33215_33238 = state_33209__$1;
(statearr_33215_33238[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (6))){
var inst_33191 = (state_33209[(7)]);
var inst_33196 = p.call(null,inst_33191);
var state_33209__$1 = state_33209;
if(cljs.core.truth_(inst_33196)){
var statearr_33216_33239 = state_33209__$1;
(statearr_33216_33239[(1)] = (8));

} else {
var statearr_33217_33240 = state_33209__$1;
(statearr_33217_33240[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (3))){
var inst_33207 = (state_33209[(2)]);
var state_33209__$1 = state_33209;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33209__$1,inst_33207);
} else {
if((state_val_33210 === (2))){
var state_33209__$1 = state_33209;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33209__$1,(4),ch);
} else {
if((state_val_33210 === (11))){
var inst_33199 = (state_33209[(2)]);
var state_33209__$1 = state_33209;
var statearr_33218_33241 = state_33209__$1;
(statearr_33218_33241[(2)] = inst_33199);

(statearr_33218_33241[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (9))){
var state_33209__$1 = state_33209;
var statearr_33219_33242 = state_33209__$1;
(statearr_33219_33242[(2)] = null);

(statearr_33219_33242[(1)] = (10));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (5))){
var inst_33194 = cljs.core.async.close_BANG_.call(null,out);
var state_33209__$1 = state_33209;
var statearr_33220_33243 = state_33209__$1;
(statearr_33220_33243[(2)] = inst_33194);

(statearr_33220_33243[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (10))){
var inst_33202 = (state_33209[(2)]);
var state_33209__$1 = (function (){var statearr_33221 = state_33209;
(statearr_33221[(8)] = inst_33202);

return statearr_33221;
})();
var statearr_33222_33244 = state_33209__$1;
(statearr_33222_33244[(2)] = null);

(statearr_33222_33244[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33210 === (8))){
var inst_33191 = (state_33209[(7)]);
var state_33209__$1 = state_33209;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33209__$1,(11),out,inst_33191);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33234,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33234,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33226 = [null,null,null,null,null,null,null,null,null];
(statearr_33226[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33226[(1)] = (1));

return statearr_33226;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33209){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33209);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33227){if((e33227 instanceof Object)){
var ex__30803__auto__ = e33227;
var statearr_33228_33245 = state_33209;
(statearr_33228_33245[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33209);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33227;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33246 = state_33209;
state_33209 = G__33246;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33209){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33209);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33234,out))
})();
var state__30915__auto__ = (function (){var statearr_33229 = f__30914__auto__.call(null);
(statearr_33229[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33234);

return statearr_33229;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33234,out))
);


return out;
});

cljs.core.async.filter_LT_.cljs$lang$maxFixedArity = 3;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.remove_LT_ = (function cljs$core$async$remove_LT_(var_args){
var args33247 = [];
var len__24559__auto___33250 = arguments.length;
var i__24560__auto___33251 = (0);
while(true){
if((i__24560__auto___33251 < len__24559__auto___33250)){
args33247.push((arguments[i__24560__auto___33251]));

var G__33252 = (i__24560__auto___33251 + (1));
i__24560__auto___33251 = G__33252;
continue;
} else {
}
break;
}

var G__33249 = args33247.length;
switch (G__33249) {
case 2:
return cljs.core.async.remove_LT_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.remove_LT_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33247.length)].join('')));

}
});

cljs.core.async.remove_LT_.cljs$core$IFn$_invoke$arity$2 = (function (p,ch){
return cljs.core.async.remove_LT_.call(null,p,ch,null);
});

cljs.core.async.remove_LT_.cljs$core$IFn$_invoke$arity$3 = (function (p,ch,buf_or_n){
return cljs.core.async.filter_LT_.call(null,cljs.core.complement.call(null,p),ch,buf_or_n);
});

cljs.core.async.remove_LT_.cljs$lang$maxFixedArity = 3;

cljs.core.async.mapcat_STAR_ = (function cljs$core$async$mapcat_STAR_(f,in$,out){
var c__30913__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto__){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto__){
return (function (state_33419){
var state_val_33420 = (state_33419[(1)]);
if((state_val_33420 === (7))){
var inst_33415 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
var statearr_33421_33462 = state_33419__$1;
(statearr_33421_33462[(2)] = inst_33415);

(statearr_33421_33462[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (20))){
var inst_33385 = (state_33419[(7)]);
var inst_33396 = (state_33419[(2)]);
var inst_33397 = cljs.core.next.call(null,inst_33385);
var inst_33371 = inst_33397;
var inst_33372 = null;
var inst_33373 = (0);
var inst_33374 = (0);
var state_33419__$1 = (function (){var statearr_33422 = state_33419;
(statearr_33422[(8)] = inst_33396);

(statearr_33422[(9)] = inst_33371);

(statearr_33422[(10)] = inst_33372);

(statearr_33422[(11)] = inst_33373);

(statearr_33422[(12)] = inst_33374);

return statearr_33422;
})();
var statearr_33423_33463 = state_33419__$1;
(statearr_33423_33463[(2)] = null);

(statearr_33423_33463[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (1))){
var state_33419__$1 = state_33419;
var statearr_33424_33464 = state_33419__$1;
(statearr_33424_33464[(2)] = null);

(statearr_33424_33464[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (4))){
var inst_33360 = (state_33419[(13)]);
var inst_33360__$1 = (state_33419[(2)]);
var inst_33361 = (inst_33360__$1 == null);
var state_33419__$1 = (function (){var statearr_33425 = state_33419;
(statearr_33425[(13)] = inst_33360__$1);

return statearr_33425;
})();
if(cljs.core.truth_(inst_33361)){
var statearr_33426_33465 = state_33419__$1;
(statearr_33426_33465[(1)] = (5));

} else {
var statearr_33427_33466 = state_33419__$1;
(statearr_33427_33466[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (15))){
var state_33419__$1 = state_33419;
var statearr_33431_33467 = state_33419__$1;
(statearr_33431_33467[(2)] = null);

(statearr_33431_33467[(1)] = (16));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (21))){
var state_33419__$1 = state_33419;
var statearr_33432_33468 = state_33419__$1;
(statearr_33432_33468[(2)] = null);

(statearr_33432_33468[(1)] = (23));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (13))){
var inst_33371 = (state_33419[(9)]);
var inst_33372 = (state_33419[(10)]);
var inst_33373 = (state_33419[(11)]);
var inst_33374 = (state_33419[(12)]);
var inst_33381 = (state_33419[(2)]);
var inst_33382 = (inst_33374 + (1));
var tmp33428 = inst_33371;
var tmp33429 = inst_33372;
var tmp33430 = inst_33373;
var inst_33371__$1 = tmp33428;
var inst_33372__$1 = tmp33429;
var inst_33373__$1 = tmp33430;
var inst_33374__$1 = inst_33382;
var state_33419__$1 = (function (){var statearr_33433 = state_33419;
(statearr_33433[(9)] = inst_33371__$1);

(statearr_33433[(10)] = inst_33372__$1);

(statearr_33433[(11)] = inst_33373__$1);

(statearr_33433[(12)] = inst_33374__$1);

(statearr_33433[(14)] = inst_33381);

return statearr_33433;
})();
var statearr_33434_33469 = state_33419__$1;
(statearr_33434_33469[(2)] = null);

(statearr_33434_33469[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (22))){
var state_33419__$1 = state_33419;
var statearr_33435_33470 = state_33419__$1;
(statearr_33435_33470[(2)] = null);

(statearr_33435_33470[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (6))){
var inst_33360 = (state_33419[(13)]);
var inst_33369 = f.call(null,inst_33360);
var inst_33370 = cljs.core.seq.call(null,inst_33369);
var inst_33371 = inst_33370;
var inst_33372 = null;
var inst_33373 = (0);
var inst_33374 = (0);
var state_33419__$1 = (function (){var statearr_33436 = state_33419;
(statearr_33436[(9)] = inst_33371);

(statearr_33436[(10)] = inst_33372);

(statearr_33436[(11)] = inst_33373);

(statearr_33436[(12)] = inst_33374);

return statearr_33436;
})();
var statearr_33437_33471 = state_33419__$1;
(statearr_33437_33471[(2)] = null);

(statearr_33437_33471[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (17))){
var inst_33385 = (state_33419[(7)]);
var inst_33389 = cljs.core.chunk_first.call(null,inst_33385);
var inst_33390 = cljs.core.chunk_rest.call(null,inst_33385);
var inst_33391 = cljs.core.count.call(null,inst_33389);
var inst_33371 = inst_33390;
var inst_33372 = inst_33389;
var inst_33373 = inst_33391;
var inst_33374 = (0);
var state_33419__$1 = (function (){var statearr_33438 = state_33419;
(statearr_33438[(9)] = inst_33371);

(statearr_33438[(10)] = inst_33372);

(statearr_33438[(11)] = inst_33373);

(statearr_33438[(12)] = inst_33374);

return statearr_33438;
})();
var statearr_33439_33472 = state_33419__$1;
(statearr_33439_33472[(2)] = null);

(statearr_33439_33472[(1)] = (8));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (3))){
var inst_33417 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33419__$1,inst_33417);
} else {
if((state_val_33420 === (12))){
var inst_33405 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
var statearr_33440_33473 = state_33419__$1;
(statearr_33440_33473[(2)] = inst_33405);

(statearr_33440_33473[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (2))){
var state_33419__$1 = state_33419;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33419__$1,(4),in$);
} else {
if((state_val_33420 === (23))){
var inst_33413 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
var statearr_33441_33474 = state_33419__$1;
(statearr_33441_33474[(2)] = inst_33413);

(statearr_33441_33474[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (19))){
var inst_33400 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
var statearr_33442_33475 = state_33419__$1;
(statearr_33442_33475[(2)] = inst_33400);

(statearr_33442_33475[(1)] = (16));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (11))){
var inst_33371 = (state_33419[(9)]);
var inst_33385 = (state_33419[(7)]);
var inst_33385__$1 = cljs.core.seq.call(null,inst_33371);
var state_33419__$1 = (function (){var statearr_33443 = state_33419;
(statearr_33443[(7)] = inst_33385__$1);

return statearr_33443;
})();
if(inst_33385__$1){
var statearr_33444_33476 = state_33419__$1;
(statearr_33444_33476[(1)] = (14));

} else {
var statearr_33445_33477 = state_33419__$1;
(statearr_33445_33477[(1)] = (15));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (9))){
var inst_33407 = (state_33419[(2)]);
var inst_33408 = cljs.core.async.impl.protocols.closed_QMARK_.call(null,out);
var state_33419__$1 = (function (){var statearr_33446 = state_33419;
(statearr_33446[(15)] = inst_33407);

return statearr_33446;
})();
if(cljs.core.truth_(inst_33408)){
var statearr_33447_33478 = state_33419__$1;
(statearr_33447_33478[(1)] = (21));

} else {
var statearr_33448_33479 = state_33419__$1;
(statearr_33448_33479[(1)] = (22));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (5))){
var inst_33363 = cljs.core.async.close_BANG_.call(null,out);
var state_33419__$1 = state_33419;
var statearr_33449_33480 = state_33419__$1;
(statearr_33449_33480[(2)] = inst_33363);

(statearr_33449_33480[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (14))){
var inst_33385 = (state_33419[(7)]);
var inst_33387 = cljs.core.chunked_seq_QMARK_.call(null,inst_33385);
var state_33419__$1 = state_33419;
if(inst_33387){
var statearr_33450_33481 = state_33419__$1;
(statearr_33450_33481[(1)] = (17));

} else {
var statearr_33451_33482 = state_33419__$1;
(statearr_33451_33482[(1)] = (18));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (16))){
var inst_33403 = (state_33419[(2)]);
var state_33419__$1 = state_33419;
var statearr_33452_33483 = state_33419__$1;
(statearr_33452_33483[(2)] = inst_33403);

(statearr_33452_33483[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33420 === (10))){
var inst_33372 = (state_33419[(10)]);
var inst_33374 = (state_33419[(12)]);
var inst_33379 = cljs.core._nth.call(null,inst_33372,inst_33374);
var state_33419__$1 = state_33419;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33419__$1,(13),out,inst_33379);
} else {
if((state_val_33420 === (18))){
var inst_33385 = (state_33419[(7)]);
var inst_33394 = cljs.core.first.call(null,inst_33385);
var state_33419__$1 = state_33419;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33419__$1,(20),out,inst_33394);
} else {
if((state_val_33420 === (8))){
var inst_33373 = (state_33419[(11)]);
var inst_33374 = (state_33419[(12)]);
var inst_33376 = (inst_33374 < inst_33373);
var inst_33377 = inst_33376;
var state_33419__$1 = state_33419;
if(cljs.core.truth_(inst_33377)){
var statearr_33453_33484 = state_33419__$1;
(statearr_33453_33484[(1)] = (10));

} else {
var statearr_33454_33485 = state_33419__$1;
(statearr_33454_33485[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto__))
;
return ((function (switch__30799__auto__,c__30913__auto__){
return (function() {
var cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__ = null;
var cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____0 = (function (){
var statearr_33458 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33458[(0)] = cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__);

(statearr_33458[(1)] = (1));

return statearr_33458;
});
var cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____1 = (function (state_33419){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33419);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33459){if((e33459 instanceof Object)){
var ex__30803__auto__ = e33459;
var statearr_33460_33486 = state_33419;
(statearr_33460_33486[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33419);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33459;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33487 = state_33419;
state_33419 = G__33487;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__ = function(state_33419){
switch(arguments.length){
case 0:
return cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____1.call(this,state_33419);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____0;
cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mapcat_STAR__$_state_machine__30800__auto____1;
return cljs$core$async$mapcat_STAR__$_state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto__))
})();
var state__30915__auto__ = (function (){var statearr_33461 = f__30914__auto__.call(null);
(statearr_33461[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto__);

return statearr_33461;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto__))
);

return c__30913__auto__;
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.mapcat_LT_ = (function cljs$core$async$mapcat_LT_(var_args){
var args33488 = [];
var len__24559__auto___33491 = arguments.length;
var i__24560__auto___33492 = (0);
while(true){
if((i__24560__auto___33492 < len__24559__auto___33491)){
args33488.push((arguments[i__24560__auto___33492]));

var G__33493 = (i__24560__auto___33492 + (1));
i__24560__auto___33492 = G__33493;
continue;
} else {
}
break;
}

var G__33490 = args33488.length;
switch (G__33490) {
case 2:
return cljs.core.async.mapcat_LT_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.mapcat_LT_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33488.length)].join('')));

}
});

cljs.core.async.mapcat_LT_.cljs$core$IFn$_invoke$arity$2 = (function (f,in$){
return cljs.core.async.mapcat_LT_.call(null,f,in$,null);
});

cljs.core.async.mapcat_LT_.cljs$core$IFn$_invoke$arity$3 = (function (f,in$,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
cljs.core.async.mapcat_STAR_.call(null,f,in$,out);

return out;
});

cljs.core.async.mapcat_LT_.cljs$lang$maxFixedArity = 3;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.mapcat_GT_ = (function cljs$core$async$mapcat_GT_(var_args){
var args33495 = [];
var len__24559__auto___33498 = arguments.length;
var i__24560__auto___33499 = (0);
while(true){
if((i__24560__auto___33499 < len__24559__auto___33498)){
args33495.push((arguments[i__24560__auto___33499]));

var G__33500 = (i__24560__auto___33499 + (1));
i__24560__auto___33499 = G__33500;
continue;
} else {
}
break;
}

var G__33497 = args33495.length;
switch (G__33497) {
case 2:
return cljs.core.async.mapcat_GT_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.mapcat_GT_.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33495.length)].join('')));

}
});

cljs.core.async.mapcat_GT_.cljs$core$IFn$_invoke$arity$2 = (function (f,out){
return cljs.core.async.mapcat_GT_.call(null,f,out,null);
});

cljs.core.async.mapcat_GT_.cljs$core$IFn$_invoke$arity$3 = (function (f,out,buf_or_n){
var in$ = cljs.core.async.chan.call(null,buf_or_n);
cljs.core.async.mapcat_STAR_.call(null,f,in$,out);

return in$;
});

cljs.core.async.mapcat_GT_.cljs$lang$maxFixedArity = 3;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.unique = (function cljs$core$async$unique(var_args){
var args33502 = [];
var len__24559__auto___33553 = arguments.length;
var i__24560__auto___33554 = (0);
while(true){
if((i__24560__auto___33554 < len__24559__auto___33553)){
args33502.push((arguments[i__24560__auto___33554]));

var G__33555 = (i__24560__auto___33554 + (1));
i__24560__auto___33554 = G__33555;
continue;
} else {
}
break;
}

var G__33504 = args33502.length;
switch (G__33504) {
case 1:
return cljs.core.async.unique.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return cljs.core.async.unique.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33502.length)].join('')));

}
});

cljs.core.async.unique.cljs$core$IFn$_invoke$arity$1 = (function (ch){
return cljs.core.async.unique.call(null,ch,null);
});

cljs.core.async.unique.cljs$core$IFn$_invoke$arity$2 = (function (ch,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33557 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33557,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33557,out){
return (function (state_33528){
var state_val_33529 = (state_33528[(1)]);
if((state_val_33529 === (7))){
var inst_33523 = (state_33528[(2)]);
var state_33528__$1 = state_33528;
var statearr_33530_33558 = state_33528__$1;
(statearr_33530_33558[(2)] = inst_33523);

(statearr_33530_33558[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (1))){
var inst_33505 = null;
var state_33528__$1 = (function (){var statearr_33531 = state_33528;
(statearr_33531[(7)] = inst_33505);

return statearr_33531;
})();
var statearr_33532_33559 = state_33528__$1;
(statearr_33532_33559[(2)] = null);

(statearr_33532_33559[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (4))){
var inst_33508 = (state_33528[(8)]);
var inst_33508__$1 = (state_33528[(2)]);
var inst_33509 = (inst_33508__$1 == null);
var inst_33510 = cljs.core.not.call(null,inst_33509);
var state_33528__$1 = (function (){var statearr_33533 = state_33528;
(statearr_33533[(8)] = inst_33508__$1);

return statearr_33533;
})();
if(inst_33510){
var statearr_33534_33560 = state_33528__$1;
(statearr_33534_33560[(1)] = (5));

} else {
var statearr_33535_33561 = state_33528__$1;
(statearr_33535_33561[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (6))){
var state_33528__$1 = state_33528;
var statearr_33536_33562 = state_33528__$1;
(statearr_33536_33562[(2)] = null);

(statearr_33536_33562[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (3))){
var inst_33525 = (state_33528[(2)]);
var inst_33526 = cljs.core.async.close_BANG_.call(null,out);
var state_33528__$1 = (function (){var statearr_33537 = state_33528;
(statearr_33537[(9)] = inst_33525);

return statearr_33537;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33528__$1,inst_33526);
} else {
if((state_val_33529 === (2))){
var state_33528__$1 = state_33528;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33528__$1,(4),ch);
} else {
if((state_val_33529 === (11))){
var inst_33508 = (state_33528[(8)]);
var inst_33517 = (state_33528[(2)]);
var inst_33505 = inst_33508;
var state_33528__$1 = (function (){var statearr_33538 = state_33528;
(statearr_33538[(10)] = inst_33517);

(statearr_33538[(7)] = inst_33505);

return statearr_33538;
})();
var statearr_33539_33563 = state_33528__$1;
(statearr_33539_33563[(2)] = null);

(statearr_33539_33563[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (9))){
var inst_33508 = (state_33528[(8)]);
var state_33528__$1 = state_33528;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33528__$1,(11),out,inst_33508);
} else {
if((state_val_33529 === (5))){
var inst_33508 = (state_33528[(8)]);
var inst_33505 = (state_33528[(7)]);
var inst_33512 = cljs.core._EQ_.call(null,inst_33508,inst_33505);
var state_33528__$1 = state_33528;
if(inst_33512){
var statearr_33541_33564 = state_33528__$1;
(statearr_33541_33564[(1)] = (8));

} else {
var statearr_33542_33565 = state_33528__$1;
(statearr_33542_33565[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (10))){
var inst_33520 = (state_33528[(2)]);
var state_33528__$1 = state_33528;
var statearr_33543_33566 = state_33528__$1;
(statearr_33543_33566[(2)] = inst_33520);

(statearr_33543_33566[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33529 === (8))){
var inst_33505 = (state_33528[(7)]);
var tmp33540 = inst_33505;
var inst_33505__$1 = tmp33540;
var state_33528__$1 = (function (){var statearr_33544 = state_33528;
(statearr_33544[(7)] = inst_33505__$1);

return statearr_33544;
})();
var statearr_33545_33567 = state_33528__$1;
(statearr_33545_33567[(2)] = null);

(statearr_33545_33567[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33557,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33557,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33549 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_33549[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33549[(1)] = (1));

return statearr_33549;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33528){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33528);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33550){if((e33550 instanceof Object)){
var ex__30803__auto__ = e33550;
var statearr_33551_33568 = state_33528;
(statearr_33551_33568[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33528);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33550;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33569 = state_33528;
state_33528 = G__33569;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33528){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33528);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33557,out))
})();
var state__30915__auto__ = (function (){var statearr_33552 = f__30914__auto__.call(null);
(statearr_33552[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33557);

return statearr_33552;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33557,out))
);


return out;
});

cljs.core.async.unique.cljs$lang$maxFixedArity = 2;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.partition = (function cljs$core$async$partition(var_args){
var args33570 = [];
var len__24559__auto___33640 = arguments.length;
var i__24560__auto___33641 = (0);
while(true){
if((i__24560__auto___33641 < len__24559__auto___33640)){
args33570.push((arguments[i__24560__auto___33641]));

var G__33642 = (i__24560__auto___33641 + (1));
i__24560__auto___33641 = G__33642;
continue;
} else {
}
break;
}

var G__33572 = args33570.length;
switch (G__33572) {
case 2:
return cljs.core.async.partition.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.partition.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33570.length)].join('')));

}
});

cljs.core.async.partition.cljs$core$IFn$_invoke$arity$2 = (function (n,ch){
return cljs.core.async.partition.call(null,n,ch,null);
});

cljs.core.async.partition.cljs$core$IFn$_invoke$arity$3 = (function (n,ch,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33644 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33644,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33644,out){
return (function (state_33610){
var state_val_33611 = (state_33610[(1)]);
if((state_val_33611 === (7))){
var inst_33606 = (state_33610[(2)]);
var state_33610__$1 = state_33610;
var statearr_33612_33645 = state_33610__$1;
(statearr_33612_33645[(2)] = inst_33606);

(statearr_33612_33645[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (1))){
var inst_33573 = (new Array(n));
var inst_33574 = inst_33573;
var inst_33575 = (0);
var state_33610__$1 = (function (){var statearr_33613 = state_33610;
(statearr_33613[(7)] = inst_33574);

(statearr_33613[(8)] = inst_33575);

return statearr_33613;
})();
var statearr_33614_33646 = state_33610__$1;
(statearr_33614_33646[(2)] = null);

(statearr_33614_33646[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (4))){
var inst_33578 = (state_33610[(9)]);
var inst_33578__$1 = (state_33610[(2)]);
var inst_33579 = (inst_33578__$1 == null);
var inst_33580 = cljs.core.not.call(null,inst_33579);
var state_33610__$1 = (function (){var statearr_33615 = state_33610;
(statearr_33615[(9)] = inst_33578__$1);

return statearr_33615;
})();
if(inst_33580){
var statearr_33616_33647 = state_33610__$1;
(statearr_33616_33647[(1)] = (5));

} else {
var statearr_33617_33648 = state_33610__$1;
(statearr_33617_33648[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (15))){
var inst_33600 = (state_33610[(2)]);
var state_33610__$1 = state_33610;
var statearr_33618_33649 = state_33610__$1;
(statearr_33618_33649[(2)] = inst_33600);

(statearr_33618_33649[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (13))){
var state_33610__$1 = state_33610;
var statearr_33619_33650 = state_33610__$1;
(statearr_33619_33650[(2)] = null);

(statearr_33619_33650[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (6))){
var inst_33575 = (state_33610[(8)]);
var inst_33596 = (inst_33575 > (0));
var state_33610__$1 = state_33610;
if(cljs.core.truth_(inst_33596)){
var statearr_33620_33651 = state_33610__$1;
(statearr_33620_33651[(1)] = (12));

} else {
var statearr_33621_33652 = state_33610__$1;
(statearr_33621_33652[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (3))){
var inst_33608 = (state_33610[(2)]);
var state_33610__$1 = state_33610;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33610__$1,inst_33608);
} else {
if((state_val_33611 === (12))){
var inst_33574 = (state_33610[(7)]);
var inst_33598 = cljs.core.vec.call(null,inst_33574);
var state_33610__$1 = state_33610;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33610__$1,(15),out,inst_33598);
} else {
if((state_val_33611 === (2))){
var state_33610__$1 = state_33610;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33610__$1,(4),ch);
} else {
if((state_val_33611 === (11))){
var inst_33590 = (state_33610[(2)]);
var inst_33591 = (new Array(n));
var inst_33574 = inst_33591;
var inst_33575 = (0);
var state_33610__$1 = (function (){var statearr_33622 = state_33610;
(statearr_33622[(7)] = inst_33574);

(statearr_33622[(8)] = inst_33575);

(statearr_33622[(10)] = inst_33590);

return statearr_33622;
})();
var statearr_33623_33653 = state_33610__$1;
(statearr_33623_33653[(2)] = null);

(statearr_33623_33653[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (9))){
var inst_33574 = (state_33610[(7)]);
var inst_33588 = cljs.core.vec.call(null,inst_33574);
var state_33610__$1 = state_33610;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33610__$1,(11),out,inst_33588);
} else {
if((state_val_33611 === (5))){
var inst_33583 = (state_33610[(11)]);
var inst_33578 = (state_33610[(9)]);
var inst_33574 = (state_33610[(7)]);
var inst_33575 = (state_33610[(8)]);
var inst_33582 = (inst_33574[inst_33575] = inst_33578);
var inst_33583__$1 = (inst_33575 + (1));
var inst_33584 = (inst_33583__$1 < n);
var state_33610__$1 = (function (){var statearr_33624 = state_33610;
(statearr_33624[(11)] = inst_33583__$1);

(statearr_33624[(12)] = inst_33582);

return statearr_33624;
})();
if(cljs.core.truth_(inst_33584)){
var statearr_33625_33654 = state_33610__$1;
(statearr_33625_33654[(1)] = (8));

} else {
var statearr_33626_33655 = state_33610__$1;
(statearr_33626_33655[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (14))){
var inst_33603 = (state_33610[(2)]);
var inst_33604 = cljs.core.async.close_BANG_.call(null,out);
var state_33610__$1 = (function (){var statearr_33628 = state_33610;
(statearr_33628[(13)] = inst_33603);

return statearr_33628;
})();
var statearr_33629_33656 = state_33610__$1;
(statearr_33629_33656[(2)] = inst_33604);

(statearr_33629_33656[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (10))){
var inst_33594 = (state_33610[(2)]);
var state_33610__$1 = state_33610;
var statearr_33630_33657 = state_33610__$1;
(statearr_33630_33657[(2)] = inst_33594);

(statearr_33630_33657[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33611 === (8))){
var inst_33583 = (state_33610[(11)]);
var inst_33574 = (state_33610[(7)]);
var tmp33627 = inst_33574;
var inst_33574__$1 = tmp33627;
var inst_33575 = inst_33583;
var state_33610__$1 = (function (){var statearr_33631 = state_33610;
(statearr_33631[(7)] = inst_33574__$1);

(statearr_33631[(8)] = inst_33575);

return statearr_33631;
})();
var statearr_33632_33658 = state_33610__$1;
(statearr_33632_33658[(2)] = null);

(statearr_33632_33658[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33644,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33644,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33636 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33636[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33636[(1)] = (1));

return statearr_33636;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33610){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33610);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33637){if((e33637 instanceof Object)){
var ex__30803__auto__ = e33637;
var statearr_33638_33659 = state_33610;
(statearr_33638_33659[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33610);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33637;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33660 = state_33610;
state_33610 = G__33660;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33610){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33610);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33644,out))
})();
var state__30915__auto__ = (function (){var statearr_33639 = f__30914__auto__.call(null);
(statearr_33639[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33644);

return statearr_33639;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33644,out))
);


return out;
});

cljs.core.async.partition.cljs$lang$maxFixedArity = 3;

/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.partition_by = (function cljs$core$async$partition_by(var_args){
var args33661 = [];
var len__24559__auto___33735 = arguments.length;
var i__24560__auto___33736 = (0);
while(true){
if((i__24560__auto___33736 < len__24559__auto___33735)){
args33661.push((arguments[i__24560__auto___33736]));

var G__33737 = (i__24560__auto___33736 + (1));
i__24560__auto___33736 = G__33737;
continue;
} else {
}
break;
}

var G__33663 = args33661.length;
switch (G__33663) {
case 2:
return cljs.core.async.partition_by.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return cljs.core.async.partition_by.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args33661.length)].join('')));

}
});

cljs.core.async.partition_by.cljs$core$IFn$_invoke$arity$2 = (function (f,ch){
return cljs.core.async.partition_by.call(null,f,ch,null);
});

cljs.core.async.partition_by.cljs$core$IFn$_invoke$arity$3 = (function (f,ch,buf_or_n){
var out = cljs.core.async.chan.call(null,buf_or_n);
var c__30913__auto___33739 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30913__auto___33739,out){
return (function (){
var f__30914__auto__ = (function (){var switch__30799__auto__ = ((function (c__30913__auto___33739,out){
return (function (state_33705){
var state_val_33706 = (state_33705[(1)]);
if((state_val_33706 === (7))){
var inst_33701 = (state_33705[(2)]);
var state_33705__$1 = state_33705;
var statearr_33707_33740 = state_33705__$1;
(statearr_33707_33740[(2)] = inst_33701);

(statearr_33707_33740[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (1))){
var inst_33664 = [];
var inst_33665 = inst_33664;
var inst_33666 = new cljs.core.Keyword("cljs.core.async","nothing","cljs.core.async/nothing",-69252123);
var state_33705__$1 = (function (){var statearr_33708 = state_33705;
(statearr_33708[(7)] = inst_33665);

(statearr_33708[(8)] = inst_33666);

return statearr_33708;
})();
var statearr_33709_33741 = state_33705__$1;
(statearr_33709_33741[(2)] = null);

(statearr_33709_33741[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (4))){
var inst_33669 = (state_33705[(9)]);
var inst_33669__$1 = (state_33705[(2)]);
var inst_33670 = (inst_33669__$1 == null);
var inst_33671 = cljs.core.not.call(null,inst_33670);
var state_33705__$1 = (function (){var statearr_33710 = state_33705;
(statearr_33710[(9)] = inst_33669__$1);

return statearr_33710;
})();
if(inst_33671){
var statearr_33711_33742 = state_33705__$1;
(statearr_33711_33742[(1)] = (5));

} else {
var statearr_33712_33743 = state_33705__$1;
(statearr_33712_33743[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (15))){
var inst_33695 = (state_33705[(2)]);
var state_33705__$1 = state_33705;
var statearr_33713_33744 = state_33705__$1;
(statearr_33713_33744[(2)] = inst_33695);

(statearr_33713_33744[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (13))){
var state_33705__$1 = state_33705;
var statearr_33714_33745 = state_33705__$1;
(statearr_33714_33745[(2)] = null);

(statearr_33714_33745[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (6))){
var inst_33665 = (state_33705[(7)]);
var inst_33690 = inst_33665.length;
var inst_33691 = (inst_33690 > (0));
var state_33705__$1 = state_33705;
if(cljs.core.truth_(inst_33691)){
var statearr_33715_33746 = state_33705__$1;
(statearr_33715_33746[(1)] = (12));

} else {
var statearr_33716_33747 = state_33705__$1;
(statearr_33716_33747[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (3))){
var inst_33703 = (state_33705[(2)]);
var state_33705__$1 = state_33705;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33705__$1,inst_33703);
} else {
if((state_val_33706 === (12))){
var inst_33665 = (state_33705[(7)]);
var inst_33693 = cljs.core.vec.call(null,inst_33665);
var state_33705__$1 = state_33705;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33705__$1,(15),out,inst_33693);
} else {
if((state_val_33706 === (2))){
var state_33705__$1 = state_33705;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33705__$1,(4),ch);
} else {
if((state_val_33706 === (11))){
var inst_33669 = (state_33705[(9)]);
var inst_33673 = (state_33705[(10)]);
var inst_33683 = (state_33705[(2)]);
var inst_33684 = [];
var inst_33685 = inst_33684.push(inst_33669);
var inst_33665 = inst_33684;
var inst_33666 = inst_33673;
var state_33705__$1 = (function (){var statearr_33717 = state_33705;
(statearr_33717[(7)] = inst_33665);

(statearr_33717[(8)] = inst_33666);

(statearr_33717[(11)] = inst_33685);

(statearr_33717[(12)] = inst_33683);

return statearr_33717;
})();
var statearr_33718_33748 = state_33705__$1;
(statearr_33718_33748[(2)] = null);

(statearr_33718_33748[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (9))){
var inst_33665 = (state_33705[(7)]);
var inst_33681 = cljs.core.vec.call(null,inst_33665);
var state_33705__$1 = state_33705;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33705__$1,(11),out,inst_33681);
} else {
if((state_val_33706 === (5))){
var inst_33669 = (state_33705[(9)]);
var inst_33666 = (state_33705[(8)]);
var inst_33673 = (state_33705[(10)]);
var inst_33673__$1 = f.call(null,inst_33669);
var inst_33674 = cljs.core._EQ_.call(null,inst_33673__$1,inst_33666);
var inst_33675 = cljs.core.keyword_identical_QMARK_.call(null,inst_33666,new cljs.core.Keyword("cljs.core.async","nothing","cljs.core.async/nothing",-69252123));
var inst_33676 = (inst_33674) || (inst_33675);
var state_33705__$1 = (function (){var statearr_33719 = state_33705;
(statearr_33719[(10)] = inst_33673__$1);

return statearr_33719;
})();
if(cljs.core.truth_(inst_33676)){
var statearr_33720_33749 = state_33705__$1;
(statearr_33720_33749[(1)] = (8));

} else {
var statearr_33721_33750 = state_33705__$1;
(statearr_33721_33750[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (14))){
var inst_33698 = (state_33705[(2)]);
var inst_33699 = cljs.core.async.close_BANG_.call(null,out);
var state_33705__$1 = (function (){var statearr_33723 = state_33705;
(statearr_33723[(13)] = inst_33698);

return statearr_33723;
})();
var statearr_33724_33751 = state_33705__$1;
(statearr_33724_33751[(2)] = inst_33699);

(statearr_33724_33751[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (10))){
var inst_33688 = (state_33705[(2)]);
var state_33705__$1 = state_33705;
var statearr_33725_33752 = state_33705__$1;
(statearr_33725_33752[(2)] = inst_33688);

(statearr_33725_33752[(1)] = (7));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33706 === (8))){
var inst_33665 = (state_33705[(7)]);
var inst_33669 = (state_33705[(9)]);
var inst_33673 = (state_33705[(10)]);
var inst_33678 = inst_33665.push(inst_33669);
var tmp33722 = inst_33665;
var inst_33665__$1 = tmp33722;
var inst_33666 = inst_33673;
var state_33705__$1 = (function (){var statearr_33726 = state_33705;
(statearr_33726[(7)] = inst_33665__$1);

(statearr_33726[(8)] = inst_33666);

(statearr_33726[(14)] = inst_33678);

return statearr_33726;
})();
var statearr_33727_33753 = state_33705__$1;
(statearr_33727_33753[(2)] = null);

(statearr_33727_33753[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30913__auto___33739,out))
;
return ((function (switch__30799__auto__,c__30913__auto___33739,out){
return (function() {
var cljs$core$async$state_machine__30800__auto__ = null;
var cljs$core$async$state_machine__30800__auto____0 = (function (){
var statearr_33731 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33731[(0)] = cljs$core$async$state_machine__30800__auto__);

(statearr_33731[(1)] = (1));

return statearr_33731;
});
var cljs$core$async$state_machine__30800__auto____1 = (function (state_33705){
while(true){
var ret_value__30801__auto__ = (function (){try{while(true){
var result__30802__auto__ = switch__30799__auto__.call(null,state_33705);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30802__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30802__auto__;
}
break;
}
}catch (e33732){if((e33732 instanceof Object)){
var ex__30803__auto__ = e33732;
var statearr_33733_33754 = state_33705;
(statearr_33733_33754[(5)] = ex__30803__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_33705);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e33732;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30801__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33755 = state_33705;
state_33705 = G__33755;
continue;
} else {
return ret_value__30801__auto__;
}
break;
}
});
cljs$core$async$state_machine__30800__auto__ = function(state_33705){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30800__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30800__auto____1.call(this,state_33705);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30800__auto____0;
cljs$core$async$state_machine__30800__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30800__auto____1;
return cljs$core$async$state_machine__30800__auto__;
})()
;})(switch__30799__auto__,c__30913__auto___33739,out))
})();
var state__30915__auto__ = (function (){var statearr_33734 = f__30914__auto__.call(null);
(statearr_33734[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30913__auto___33739);

return statearr_33734;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30915__auto__);
});})(c__30913__auto___33739,out))
);


return out;
});

cljs.core.async.partition_by.cljs$lang$maxFixedArity = 3;

