// 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 args30469 = [];
var len__24369__auto___30475 = arguments.length;
var i__24370__auto___30476 = (0);
while(true){
if((i__24370__auto___30476 < len__24369__auto___30475)){
args30469.push((arguments[i__24370__auto___30476]));

var G__30477 = (i__24370__auto___30476 + (1));
i__24370__auto___30476 = G__30477;
continue;
} else {
}
break;
}

var G__30471 = args30469.length;
switch (G__30471) {
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(args30469.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$async30472 !== 'undefined'){
} else {

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

cljs.core.async.t_cljs$core$async30472.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_30474){
var self__ = this;
var _30474__$1 = this;
return self__.meta30473;
});

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

cljs.core.async.t_cljs$core$async30472.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$async30472.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$async30472.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$async30472.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,"meta30473","meta30473",994583241,null)], null);
});

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

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

cljs.core.async.t_cljs$core$async30472.cljs$lang$ctorPrWriter = (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async30472");
});

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

}

return (new cljs.core.async.t_cljs$core$async30472(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 args30481 = [];
var len__24369__auto___30484 = arguments.length;
var i__24370__auto___30485 = (0);
while(true){
if((i__24370__auto___30485 < len__24369__auto___30484)){
args30481.push((arguments[i__24370__auto___30485]));

var G__30486 = (i__24370__auto___30485 + (1));
i__24370__auto___30485 = G__30486;
continue;
} else {
}
break;
}

var G__30483 = args30481.length;
switch (G__30483) {
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(args30481.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 args30488 = [];
var len__24369__auto___30491 = arguments.length;
var i__24370__auto___30492 = (0);
while(true){
if((i__24370__auto___30492 < len__24369__auto___30491)){
args30488.push((arguments[i__24370__auto___30492]));

var G__30493 = (i__24370__auto___30492 + (1));
i__24370__auto___30492 = G__30493;
continue;
} else {
}
break;
}

var G__30490 = args30488.length;
switch (G__30490) {
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(args30488.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 args30495 = [];
var len__24369__auto___30498 = arguments.length;
var i__24370__auto___30499 = (0);
while(true){
if((i__24370__auto___30499 < len__24369__auto___30498)){
args30495.push((arguments[i__24370__auto___30499]));

var G__30500 = (i__24370__auto___30499 + (1));
i__24370__auto___30499 = G__30500;
continue;
} else {
}
break;
}

var G__30497 = args30495.length;
switch (G__30497) {
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(args30495.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_30502 = cljs.core.deref.call(null,ret);
if(cljs.core.truth_(on_caller_QMARK_)){
fn1.call(null,val_30502);
} else {
cljs.core.async.impl.dispatch.run.call(null,((function (val_30502,ret){
return (function (){
return fn1.call(null,val_30502);
});})(val_30502,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 args30503 = [];
var len__24369__auto___30506 = arguments.length;
var i__24370__auto___30507 = (0);
while(true){
if((i__24370__auto___30507 < len__24369__auto___30506)){
args30503.push((arguments[i__24370__auto___30507]));

var G__30508 = (i__24370__auto___30507 + (1));
i__24370__auto___30507 = G__30508;
continue;
} else {
}
break;
}

var G__30505 = args30503.length;
switch (G__30505) {
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(args30503.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__24169__auto___30510 = n;
var x_30511 = (0);
while(true){
if((x_30511 < n__24169__auto___30510)){
(a[x_30511] = (0));

var G__30512 = (x_30511 + (1));
x_30511 = G__30512;
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__30513 = (i + (1));
i = G__30513;
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$async30517 !== 'undefined'){
} else {

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

cljs.core.async.t_cljs$core$async30517.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (flag){
return (function (_30519){
var self__ = this;
var _30519__$1 = this;
return self__.meta30518;
});})(flag))
;

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

cljs.core.async.t_cljs$core$async30517.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$async30517.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$async30517.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$async30517.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,"meta30518","meta30518",-1034570945,null)], null);
});})(flag))
;

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

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

cljs.core.async.t_cljs$core$async30517.cljs$lang$ctorPrWriter = ((function (flag){
return (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async30517");
});})(flag))
;

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

}

return (new cljs.core.async.t_cljs$core$async30517(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$async30523 !== 'undefined'){
} else {

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

cljs.core.async.t_cljs$core$async30523.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_30525){
var self__ = this;
var _30525__$1 = this;
return self__.meta30524;
});

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

cljs.core.async.t_cljs$core$async30523.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$async30523.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$async30523.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$async30523.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,"meta30524","meta30524",-1832883340,null)], null);
});

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

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

cljs.core.async.t_cljs$core$async30523.cljs$lang$ctorPrWriter = (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async30523");
});

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

}

return (new cljs.core.async.t_cljs$core$async30523(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__30526_SHARP_){
return fret.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [p1__30526_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__30527_SHARP_){
return fret.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [p1__30527_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__23148__auto__ = wport;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return port;
}
})()], null));
} else {
var G__30528 = (i + (1));
i = G__30528;
continue;
}
} else {
return null;
}
break;
}
})();
var or__23148__auto__ = ret;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__23136__auto__ = cljs.core.async.impl.protocols.active_QMARK_.call(null,flag);
if(cljs.core.truth_(and__23136__auto__)){
return cljs.core.async.impl.protocols.commit.call(null,flag);
} else {
return and__23136__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__24376__auto__ = [];
var len__24369__auto___30534 = arguments.length;
var i__24370__auto___30535 = (0);
while(true){
if((i__24370__auto___30535 < len__24369__auto___30534)){
args__24376__auto__.push((arguments[i__24370__auto___30535]));

var G__30536 = (i__24370__auto___30535 + (1));
i__24370__auto___30535 = G__30536;
continue;
} else {
}
break;
}

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

cljs.core.async.alts_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (ports,p__30531){
var map__30532 = p__30531;
var map__30532__$1 = ((((!((map__30532 == null)))?((((map__30532.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__30532.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__30532):map__30532);
var opts = map__30532__$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 (seq30529){
var G__30530 = cljs.core.first.call(null,seq30529);
var seq30529__$1 = cljs.core.next.call(null,seq30529);
return cljs.core.async.alts_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__30530,seq30529__$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 args30537 = [];
var len__24369__auto___30587 = arguments.length;
var i__24370__auto___30588 = (0);
while(true){
if((i__24370__auto___30588 < len__24369__auto___30587)){
args30537.push((arguments[i__24370__auto___30588]));

var G__30589 = (i__24370__auto___30588 + (1));
i__24370__auto___30588 = G__30589;
continue;
} else {
}
break;
}

var G__30539 = args30537.length;
switch (G__30539) {
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(args30537.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__30410__auto___30591 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___30591){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___30591){
return (function (state_30563){
var state_val_30564 = (state_30563[(1)]);
if((state_val_30564 === (7))){
var inst_30559 = (state_30563[(2)]);
var state_30563__$1 = state_30563;
var statearr_30565_30592 = state_30563__$1;
(statearr_30565_30592[(2)] = inst_30559);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (1))){
var state_30563__$1 = state_30563;
var statearr_30566_30593 = state_30563__$1;
(statearr_30566_30593[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (4))){
var inst_30542 = (state_30563[(7)]);
var inst_30542__$1 = (state_30563[(2)]);
var inst_30543 = (inst_30542__$1 == null);
var state_30563__$1 = (function (){var statearr_30567 = state_30563;
(statearr_30567[(7)] = inst_30542__$1);

return statearr_30567;
})();
if(cljs.core.truth_(inst_30543)){
var statearr_30568_30594 = state_30563__$1;
(statearr_30568_30594[(1)] = (5));

} else {
var statearr_30569_30595 = state_30563__$1;
(statearr_30569_30595[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (13))){
var state_30563__$1 = state_30563;
var statearr_30570_30596 = state_30563__$1;
(statearr_30570_30596[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (6))){
var inst_30542 = (state_30563[(7)]);
var state_30563__$1 = state_30563;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_30563__$1,(11),to,inst_30542);
} else {
if((state_val_30564 === (3))){
var inst_30561 = (state_30563[(2)]);
var state_30563__$1 = state_30563;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30563__$1,inst_30561);
} else {
if((state_val_30564 === (12))){
var state_30563__$1 = state_30563;
var statearr_30571_30597 = state_30563__$1;
(statearr_30571_30597[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (2))){
var state_30563__$1 = state_30563;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30563__$1,(4),from);
} else {
if((state_val_30564 === (11))){
var inst_30552 = (state_30563[(2)]);
var state_30563__$1 = state_30563;
if(cljs.core.truth_(inst_30552)){
var statearr_30572_30598 = state_30563__$1;
(statearr_30572_30598[(1)] = (12));

} else {
var statearr_30573_30599 = state_30563__$1;
(statearr_30573_30599[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (9))){
var state_30563__$1 = state_30563;
var statearr_30574_30600 = state_30563__$1;
(statearr_30574_30600[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (5))){
var state_30563__$1 = state_30563;
if(cljs.core.truth_(close_QMARK_)){
var statearr_30575_30601 = state_30563__$1;
(statearr_30575_30601[(1)] = (8));

} else {
var statearr_30576_30602 = state_30563__$1;
(statearr_30576_30602[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (14))){
var inst_30557 = (state_30563[(2)]);
var state_30563__$1 = state_30563;
var statearr_30577_30603 = state_30563__$1;
(statearr_30577_30603[(2)] = inst_30557);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (10))){
var inst_30549 = (state_30563[(2)]);
var state_30563__$1 = state_30563;
var statearr_30578_30604 = state_30563__$1;
(statearr_30578_30604[(2)] = inst_30549);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30564 === (8))){
var inst_30546 = cljs.core.async.close_BANG_.call(null,to);
var state_30563__$1 = state_30563;
var statearr_30579_30605 = state_30563__$1;
(statearr_30579_30605[(2)] = inst_30546);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___30591))
;
return ((function (switch__30296__auto__,c__30410__auto___30591){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_30583 = [null,null,null,null,null,null,null,null];
(statearr_30583[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_30583[(1)] = (1));

return statearr_30583;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_30563){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30563);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30584){if((e30584 instanceof Object)){
var ex__30300__auto__ = e30584;
var statearr_30585_30606 = state_30563;
(statearr_30585_30606[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__30607 = state_30563;
state_30563 = G__30607;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_30563){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_30563);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___30591))
})();
var state__30412__auto__ = (function (){var statearr_30586 = f__30411__auto__.call(null);
(statearr_30586[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___30591);

return statearr_30586;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___30591))
);


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__30795){
var vec__30796 = p__30795;
var v = cljs.core.nth.call(null,vec__30796,(0),null);
var p = cljs.core.nth.call(null,vec__30796,(1),null);
var job = vec__30796;
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__30410__auto___30982 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___30982,res,vec__30796,v,p,job,jobs,results){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___30982,res,vec__30796,v,p,job,jobs,results){
return (function (state_30803){
var state_val_30804 = (state_30803[(1)]);
if((state_val_30804 === (1))){
var state_30803__$1 = state_30803;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_30803__$1,(2),res,v);
} else {
if((state_val_30804 === (2))){
var inst_30800 = (state_30803[(2)]);
var inst_30801 = cljs.core.async.close_BANG_.call(null,res);
var state_30803__$1 = (function (){var statearr_30805 = state_30803;
(statearr_30805[(7)] = inst_30800);

return statearr_30805;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30803__$1,inst_30801);
} else {
return null;
}
}
});})(c__30410__auto___30982,res,vec__30796,v,p,job,jobs,results))
;
return ((function (switch__30296__auto__,c__30410__auto___30982,res,vec__30796,v,p,job,jobs,results){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_30809 = [null,null,null,null,null,null,null,null];
(statearr_30809[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__);

(statearr_30809[(1)] = (1));

return statearr_30809;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1 = (function (state_30803){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30803);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30810){if((e30810 instanceof Object)){
var ex__30300__auto__ = e30810;
var statearr_30811_30983 = state_30803;
(statearr_30811_30983[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__30984 = state_30803;
state_30803 = G__30984;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = function(state_30803){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1.call(this,state_30803);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___30982,res,vec__30796,v,p,job,jobs,results))
})();
var state__30412__auto__ = (function (){var statearr_30812 = f__30411__auto__.call(null);
(statearr_30812[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___30982);

return statearr_30812;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___30982,res,vec__30796,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__30813){
var vec__30814 = p__30813;
var v = cljs.core.nth.call(null,vec__30814,(0),null);
var p = cljs.core.nth.call(null,vec__30814,(1),null);
var job = vec__30814;
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__24169__auto___30985 = n;
var __30986 = (0);
while(true){
if((__30986 < n__24169__auto___30985)){
var G__30817_30987 = type;
var G__30817_30988__$1 = (((G__30817_30987 instanceof cljs.core.Keyword))?G__30817_30987.fqn:null);
switch (G__30817_30988__$1) {
case "compute":
var c__30410__auto___30990 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (__30986,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (__30986,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function (state_30830){
var state_val_30831 = (state_30830[(1)]);
if((state_val_30831 === (1))){
var state_30830__$1 = state_30830;
var statearr_30832_30991 = state_30830__$1;
(statearr_30832_30991[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30831 === (2))){
var state_30830__$1 = state_30830;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30830__$1,(4),jobs);
} else {
if((state_val_30831 === (3))){
var inst_30828 = (state_30830[(2)]);
var state_30830__$1 = state_30830;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30830__$1,inst_30828);
} else {
if((state_val_30831 === (4))){
var inst_30820 = (state_30830[(2)]);
var inst_30821 = process.call(null,inst_30820);
var state_30830__$1 = state_30830;
if(cljs.core.truth_(inst_30821)){
var statearr_30833_30992 = state_30830__$1;
(statearr_30833_30992[(1)] = (5));

} else {
var statearr_30834_30993 = state_30830__$1;
(statearr_30834_30993[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30831 === (5))){
var state_30830__$1 = state_30830;
var statearr_30835_30994 = state_30830__$1;
(statearr_30835_30994[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30831 === (6))){
var state_30830__$1 = state_30830;
var statearr_30836_30995 = state_30830__$1;
(statearr_30836_30995[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30831 === (7))){
var inst_30826 = (state_30830[(2)]);
var state_30830__$1 = state_30830;
var statearr_30837_30996 = state_30830__$1;
(statearr_30837_30996[(2)] = inst_30826);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(__30986,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async))
;
return ((function (__30986,switch__30296__auto__,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_30841 = [null,null,null,null,null,null,null];
(statearr_30841[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__);

(statearr_30841[(1)] = (1));

return statearr_30841;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1 = (function (state_30830){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30830);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30842){if((e30842 instanceof Object)){
var ex__30300__auto__ = e30842;
var statearr_30843_30997 = state_30830;
(statearr_30843_30997[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__30998 = state_30830;
state_30830 = G__30998;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = function(state_30830){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1.call(this,state_30830);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__;
})()
;})(__30986,switch__30296__auto__,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async))
})();
var state__30412__auto__ = (function (){var statearr_30844 = f__30411__auto__.call(null);
(statearr_30844[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___30990);

return statearr_30844;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(__30986,c__30410__auto___30990,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async))
);


break;
case "async":
var c__30410__auto___30999 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (__30986,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (__30986,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function (state_30857){
var state_val_30858 = (state_30857[(1)]);
if((state_val_30858 === (1))){
var state_30857__$1 = state_30857;
var statearr_30859_31000 = state_30857__$1;
(statearr_30859_31000[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30858 === (2))){
var state_30857__$1 = state_30857;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30857__$1,(4),jobs);
} else {
if((state_val_30858 === (3))){
var inst_30855 = (state_30857[(2)]);
var state_30857__$1 = state_30857;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30857__$1,inst_30855);
} else {
if((state_val_30858 === (4))){
var inst_30847 = (state_30857[(2)]);
var inst_30848 = async.call(null,inst_30847);
var state_30857__$1 = state_30857;
if(cljs.core.truth_(inst_30848)){
var statearr_30860_31001 = state_30857__$1;
(statearr_30860_31001[(1)] = (5));

} else {
var statearr_30861_31002 = state_30857__$1;
(statearr_30861_31002[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30858 === (5))){
var state_30857__$1 = state_30857;
var statearr_30862_31003 = state_30857__$1;
(statearr_30862_31003[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30858 === (6))){
var state_30857__$1 = state_30857;
var statearr_30863_31004 = state_30857__$1;
(statearr_30863_31004[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30858 === (7))){
var inst_30853 = (state_30857[(2)]);
var state_30857__$1 = state_30857;
var statearr_30864_31005 = state_30857__$1;
(statearr_30864_31005[(2)] = inst_30853);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(__30986,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async))
;
return ((function (__30986,switch__30296__auto__,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_30868 = [null,null,null,null,null,null,null];
(statearr_30868[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__);

(statearr_30868[(1)] = (1));

return statearr_30868;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1 = (function (state_30857){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30857);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30869){if((e30869 instanceof Object)){
var ex__30300__auto__ = e30869;
var statearr_30870_31006 = state_30857;
(statearr_30870_31006[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31007 = state_30857;
state_30857 = G__31007;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = function(state_30857){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1.call(this,state_30857);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__;
})()
;})(__30986,switch__30296__auto__,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,jobs,results,process,async))
})();
var state__30412__auto__ = (function (){var statearr_30871 = f__30411__auto__.call(null);
(statearr_30871[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___30999);

return statearr_30871;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(__30986,c__30410__auto___30999,G__30817_30987,G__30817_30988__$1,n__24169__auto___30985,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__30817_30988__$1)].join('')));

}

var G__31008 = (__30986 + (1));
__30986 = G__31008;
continue;
} else {
}
break;
}

var c__30410__auto___31009 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___31009,jobs,results,process,async){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___31009,jobs,results,process,async){
return (function (state_30893){
var state_val_30894 = (state_30893[(1)]);
if((state_val_30894 === (1))){
var state_30893__$1 = state_30893;
var statearr_30895_31010 = state_30893__$1;
(statearr_30895_31010[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30894 === (2))){
var state_30893__$1 = state_30893;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30893__$1,(4),from);
} else {
if((state_val_30894 === (3))){
var inst_30891 = (state_30893[(2)]);
var state_30893__$1 = state_30893;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30893__$1,inst_30891);
} else {
if((state_val_30894 === (4))){
var inst_30874 = (state_30893[(7)]);
var inst_30874__$1 = (state_30893[(2)]);
var inst_30875 = (inst_30874__$1 == null);
var state_30893__$1 = (function (){var statearr_30896 = state_30893;
(statearr_30896[(7)] = inst_30874__$1);

return statearr_30896;
})();
if(cljs.core.truth_(inst_30875)){
var statearr_30897_31011 = state_30893__$1;
(statearr_30897_31011[(1)] = (5));

} else {
var statearr_30898_31012 = state_30893__$1;
(statearr_30898_31012[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30894 === (5))){
var inst_30877 = cljs.core.async.close_BANG_.call(null,jobs);
var state_30893__$1 = state_30893;
var statearr_30899_31013 = state_30893__$1;
(statearr_30899_31013[(2)] = inst_30877);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30894 === (6))){
var inst_30879 = (state_30893[(8)]);
var inst_30874 = (state_30893[(7)]);
var inst_30879__$1 = cljs.core.async.chan.call(null,(1));
var inst_30880 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_30881 = [inst_30874,inst_30879__$1];
var inst_30882 = (new cljs.core.PersistentVector(null,2,(5),inst_30880,inst_30881,null));
var state_30893__$1 = (function (){var statearr_30900 = state_30893;
(statearr_30900[(8)] = inst_30879__$1);

return statearr_30900;
})();
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_30893__$1,(8),jobs,inst_30882);
} else {
if((state_val_30894 === (7))){
var inst_30889 = (state_30893[(2)]);
var state_30893__$1 = state_30893;
var statearr_30901_31014 = state_30893__$1;
(statearr_30901_31014[(2)] = inst_30889);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30894 === (8))){
var inst_30879 = (state_30893[(8)]);
var inst_30884 = (state_30893[(2)]);
var state_30893__$1 = (function (){var statearr_30902 = state_30893;
(statearr_30902[(9)] = inst_30884);

return statearr_30902;
})();
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_30893__$1,(9),results,inst_30879);
} else {
if((state_val_30894 === (9))){
var inst_30886 = (state_30893[(2)]);
var state_30893__$1 = (function (){var statearr_30903 = state_30893;
(statearr_30903[(10)] = inst_30886);

return statearr_30903;
})();
var statearr_30904_31015 = state_30893__$1;
(statearr_30904_31015[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___31009,jobs,results,process,async))
;
return ((function (switch__30296__auto__,c__30410__auto___31009,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_30908 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_30908[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__);

(statearr_30908[(1)] = (1));

return statearr_30908;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1 = (function (state_30893){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30893);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30909){if((e30909 instanceof Object)){
var ex__30300__auto__ = e30909;
var statearr_30910_31016 = state_30893;
(statearr_30910_31016[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31017 = state_30893;
state_30893 = G__31017;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = function(state_30893){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1.call(this,state_30893);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___31009,jobs,results,process,async))
})();
var state__30412__auto__ = (function (){var statearr_30911 = f__30411__auto__.call(null);
(statearr_30911[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___31009);

return statearr_30911;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___31009,jobs,results,process,async))
);


var c__30410__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto__,jobs,results,process,async){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto__,jobs,results,process,async){
return (function (state_30949){
var state_val_30950 = (state_30949[(1)]);
if((state_val_30950 === (7))){
var inst_30945 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
var statearr_30951_31018 = state_30949__$1;
(statearr_30951_31018[(2)] = inst_30945);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (20))){
var state_30949__$1 = state_30949;
var statearr_30952_31019 = state_30949__$1;
(statearr_30952_31019[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (1))){
var state_30949__$1 = state_30949;
var statearr_30953_31020 = state_30949__$1;
(statearr_30953_31020[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (4))){
var inst_30914 = (state_30949[(7)]);
var inst_30914__$1 = (state_30949[(2)]);
var inst_30915 = (inst_30914__$1 == null);
var state_30949__$1 = (function (){var statearr_30954 = state_30949;
(statearr_30954[(7)] = inst_30914__$1);

return statearr_30954;
})();
if(cljs.core.truth_(inst_30915)){
var statearr_30955_31021 = state_30949__$1;
(statearr_30955_31021[(1)] = (5));

} else {
var statearr_30956_31022 = state_30949__$1;
(statearr_30956_31022[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (15))){
var inst_30927 = (state_30949[(8)]);
var state_30949__$1 = state_30949;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_30949__$1,(18),to,inst_30927);
} else {
if((state_val_30950 === (21))){
var inst_30940 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
var statearr_30957_31023 = state_30949__$1;
(statearr_30957_31023[(2)] = inst_30940);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (13))){
var inst_30942 = (state_30949[(2)]);
var state_30949__$1 = (function (){var statearr_30958 = state_30949;
(statearr_30958[(9)] = inst_30942);

return statearr_30958;
})();
var statearr_30959_31024 = state_30949__$1;
(statearr_30959_31024[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (6))){
var inst_30914 = (state_30949[(7)]);
var state_30949__$1 = state_30949;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30949__$1,(11),inst_30914);
} else {
if((state_val_30950 === (17))){
var inst_30935 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
if(cljs.core.truth_(inst_30935)){
var statearr_30960_31025 = state_30949__$1;
(statearr_30960_31025[(1)] = (19));

} else {
var statearr_30961_31026 = state_30949__$1;
(statearr_30961_31026[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (3))){
var inst_30947 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_30949__$1,inst_30947);
} else {
if((state_val_30950 === (12))){
var inst_30924 = (state_30949[(10)]);
var state_30949__$1 = state_30949;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30949__$1,(14),inst_30924);
} else {
if((state_val_30950 === (2))){
var state_30949__$1 = state_30949;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_30949__$1,(4),results);
} else {
if((state_val_30950 === (19))){
var state_30949__$1 = state_30949;
var statearr_30962_31027 = state_30949__$1;
(statearr_30962_31027[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (11))){
var inst_30924 = (state_30949[(2)]);
var state_30949__$1 = (function (){var statearr_30963 = state_30949;
(statearr_30963[(10)] = inst_30924);

return statearr_30963;
})();
var statearr_30964_31028 = state_30949__$1;
(statearr_30964_31028[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (9))){
var state_30949__$1 = state_30949;
var statearr_30965_31029 = state_30949__$1;
(statearr_30965_31029[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (5))){
var state_30949__$1 = state_30949;
if(cljs.core.truth_(close_QMARK_)){
var statearr_30966_31030 = state_30949__$1;
(statearr_30966_31030[(1)] = (8));

} else {
var statearr_30967_31031 = state_30949__$1;
(statearr_30967_31031[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (14))){
var inst_30929 = (state_30949[(11)]);
var inst_30927 = (state_30949[(8)]);
var inst_30927__$1 = (state_30949[(2)]);
var inst_30928 = (inst_30927__$1 == null);
var inst_30929__$1 = cljs.core.not.call(null,inst_30928);
var state_30949__$1 = (function (){var statearr_30968 = state_30949;
(statearr_30968[(11)] = inst_30929__$1);

(statearr_30968[(8)] = inst_30927__$1);

return statearr_30968;
})();
if(inst_30929__$1){
var statearr_30969_31032 = state_30949__$1;
(statearr_30969_31032[(1)] = (15));

} else {
var statearr_30970_31033 = state_30949__$1;
(statearr_30970_31033[(1)] = (16));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (16))){
var inst_30929 = (state_30949[(11)]);
var state_30949__$1 = state_30949;
var statearr_30971_31034 = state_30949__$1;
(statearr_30971_31034[(2)] = inst_30929);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (10))){
var inst_30921 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
var statearr_30972_31035 = state_30949__$1;
(statearr_30972_31035[(2)] = inst_30921);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (18))){
var inst_30932 = (state_30949[(2)]);
var state_30949__$1 = state_30949;
var statearr_30973_31036 = state_30949__$1;
(statearr_30973_31036[(2)] = inst_30932);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_30950 === (8))){
var inst_30918 = cljs.core.async.close_BANG_.call(null,to);
var state_30949__$1 = state_30949;
var statearr_30974_31037 = state_30949__$1;
(statearr_30974_31037[(2)] = inst_30918);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto__,jobs,results,process,async))
;
return ((function (switch__30296__auto__,c__30410__auto__,jobs,results,process,async){
return (function() {
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_30978 = [null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_30978[(0)] = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__);

(statearr_30978[(1)] = (1));

return statearr_30978;
});
var cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1 = (function (state_30949){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_30949);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e30979){if((e30979 instanceof Object)){
var ex__30300__auto__ = e30979;
var statearr_30980_31038 = state_30949;
(statearr_30980_31038[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31039 = state_30949;
state_30949 = G__31039;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__ = function(state_30949){
switch(arguments.length){
case 0:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1.call(this,state_30949);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____0;
cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$pipeline_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$pipeline_STAR__$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto__,jobs,results,process,async))
})();
var state__30412__auto__ = (function (){var statearr_30981 = f__30411__auto__.call(null);
(statearr_30981[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto__);

return statearr_30981;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto__,jobs,results,process,async))
);

return c__30410__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 args31040 = [];
var len__24369__auto___31043 = arguments.length;
var i__24370__auto___31044 = (0);
while(true){
if((i__24370__auto___31044 < len__24369__auto___31043)){
args31040.push((arguments[i__24370__auto___31044]));

var G__31045 = (i__24370__auto___31044 + (1));
i__24370__auto___31044 = G__31045;
continue;
} else {
}
break;
}

var G__31042 = args31040.length;
switch (G__31042) {
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(args31040.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 args31047 = [];
var len__24369__auto___31050 = arguments.length;
var i__24370__auto___31051 = (0);
while(true){
if((i__24370__auto___31051 < len__24369__auto___31050)){
args31047.push((arguments[i__24370__auto___31051]));

var G__31052 = (i__24370__auto___31051 + (1));
i__24370__auto___31051 = G__31052;
continue;
} else {
}
break;
}

var G__31049 = args31047.length;
switch (G__31049) {
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(args31047.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 args31054 = [];
var len__24369__auto___31107 = arguments.length;
var i__24370__auto___31108 = (0);
while(true){
if((i__24370__auto___31108 < len__24369__auto___31107)){
args31054.push((arguments[i__24370__auto___31108]));

var G__31109 = (i__24370__auto___31108 + (1));
i__24370__auto___31108 = G__31109;
continue;
} else {
}
break;
}

var G__31056 = args31054.length;
switch (G__31056) {
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(args31054.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__30410__auto___31111 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___31111,tc,fc){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___31111,tc,fc){
return (function (state_31082){
var state_val_31083 = (state_31082[(1)]);
if((state_val_31083 === (7))){
var inst_31078 = (state_31082[(2)]);
var state_31082__$1 = state_31082;
var statearr_31084_31112 = state_31082__$1;
(statearr_31084_31112[(2)] = inst_31078);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (1))){
var state_31082__$1 = state_31082;
var statearr_31085_31113 = state_31082__$1;
(statearr_31085_31113[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (4))){
var inst_31059 = (state_31082[(7)]);
var inst_31059__$1 = (state_31082[(2)]);
var inst_31060 = (inst_31059__$1 == null);
var state_31082__$1 = (function (){var statearr_31086 = state_31082;
(statearr_31086[(7)] = inst_31059__$1);

return statearr_31086;
})();
if(cljs.core.truth_(inst_31060)){
var statearr_31087_31114 = state_31082__$1;
(statearr_31087_31114[(1)] = (5));

} else {
var statearr_31088_31115 = state_31082__$1;
(statearr_31088_31115[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (13))){
var state_31082__$1 = state_31082;
var statearr_31089_31116 = state_31082__$1;
(statearr_31089_31116[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (6))){
var inst_31059 = (state_31082[(7)]);
var inst_31065 = p.call(null,inst_31059);
var state_31082__$1 = state_31082;
if(cljs.core.truth_(inst_31065)){
var statearr_31090_31117 = state_31082__$1;
(statearr_31090_31117[(1)] = (9));

} else {
var statearr_31091_31118 = state_31082__$1;
(statearr_31091_31118[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (3))){
var inst_31080 = (state_31082[(2)]);
var state_31082__$1 = state_31082;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31082__$1,inst_31080);
} else {
if((state_val_31083 === (12))){
var state_31082__$1 = state_31082;
var statearr_31092_31119 = state_31082__$1;
(statearr_31092_31119[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (2))){
var state_31082__$1 = state_31082;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31082__$1,(4),ch);
} else {
if((state_val_31083 === (11))){
var inst_31059 = (state_31082[(7)]);
var inst_31069 = (state_31082[(2)]);
var state_31082__$1 = state_31082;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31082__$1,(8),inst_31069,inst_31059);
} else {
if((state_val_31083 === (9))){
var state_31082__$1 = state_31082;
var statearr_31093_31120 = state_31082__$1;
(statearr_31093_31120[(2)] = tc);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (5))){
var inst_31062 = cljs.core.async.close_BANG_.call(null,tc);
var inst_31063 = cljs.core.async.close_BANG_.call(null,fc);
var state_31082__$1 = (function (){var statearr_31094 = state_31082;
(statearr_31094[(8)] = inst_31062);

return statearr_31094;
})();
var statearr_31095_31121 = state_31082__$1;
(statearr_31095_31121[(2)] = inst_31063);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (14))){
var inst_31076 = (state_31082[(2)]);
var state_31082__$1 = state_31082;
var statearr_31096_31122 = state_31082__$1;
(statearr_31096_31122[(2)] = inst_31076);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (10))){
var state_31082__$1 = state_31082;
var statearr_31097_31123 = state_31082__$1;
(statearr_31097_31123[(2)] = fc);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31083 === (8))){
var inst_31071 = (state_31082[(2)]);
var state_31082__$1 = state_31082;
if(cljs.core.truth_(inst_31071)){
var statearr_31098_31124 = state_31082__$1;
(statearr_31098_31124[(1)] = (12));

} else {
var statearr_31099_31125 = state_31082__$1;
(statearr_31099_31125[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___31111,tc,fc))
;
return ((function (switch__30296__auto__,c__30410__auto___31111,tc,fc){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_31103 = [null,null,null,null,null,null,null,null,null];
(statearr_31103[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_31103[(1)] = (1));

return statearr_31103;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_31082){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_31082);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e31104){if((e31104 instanceof Object)){
var ex__30300__auto__ = e31104;
var statearr_31105_31126 = state_31082;
(statearr_31105_31126[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31127 = state_31082;
state_31082 = G__31127;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_31082){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_31082);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___31111,tc,fc))
})();
var state__30412__auto__ = (function (){var statearr_31106 = f__30411__auto__.call(null);
(statearr_31106[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___31111);

return statearr_31106;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___31111,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__30410__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto__){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto__){
return (function (state_31191){
var state_val_31192 = (state_31191[(1)]);
if((state_val_31192 === (7))){
var inst_31187 = (state_31191[(2)]);
var state_31191__$1 = state_31191;
var statearr_31193_31214 = state_31191__$1;
(statearr_31193_31214[(2)] = inst_31187);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (1))){
var inst_31171 = init;
var state_31191__$1 = (function (){var statearr_31194 = state_31191;
(statearr_31194[(7)] = inst_31171);

return statearr_31194;
})();
var statearr_31195_31215 = state_31191__$1;
(statearr_31195_31215[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (4))){
var inst_31174 = (state_31191[(8)]);
var inst_31174__$1 = (state_31191[(2)]);
var inst_31175 = (inst_31174__$1 == null);
var state_31191__$1 = (function (){var statearr_31196 = state_31191;
(statearr_31196[(8)] = inst_31174__$1);

return statearr_31196;
})();
if(cljs.core.truth_(inst_31175)){
var statearr_31197_31216 = state_31191__$1;
(statearr_31197_31216[(1)] = (5));

} else {
var statearr_31198_31217 = state_31191__$1;
(statearr_31198_31217[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (6))){
var inst_31171 = (state_31191[(7)]);
var inst_31174 = (state_31191[(8)]);
var inst_31178 = (state_31191[(9)]);
var inst_31178__$1 = f.call(null,inst_31171,inst_31174);
var inst_31179 = cljs.core.reduced_QMARK_.call(null,inst_31178__$1);
var state_31191__$1 = (function (){var statearr_31199 = state_31191;
(statearr_31199[(9)] = inst_31178__$1);

return statearr_31199;
})();
if(inst_31179){
var statearr_31200_31218 = state_31191__$1;
(statearr_31200_31218[(1)] = (8));

} else {
var statearr_31201_31219 = state_31191__$1;
(statearr_31201_31219[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (3))){
var inst_31189 = (state_31191[(2)]);
var state_31191__$1 = state_31191;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31191__$1,inst_31189);
} else {
if((state_val_31192 === (2))){
var state_31191__$1 = state_31191;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31191__$1,(4),ch);
} else {
if((state_val_31192 === (9))){
var inst_31178 = (state_31191[(9)]);
var inst_31171 = inst_31178;
var state_31191__$1 = (function (){var statearr_31202 = state_31191;
(statearr_31202[(7)] = inst_31171);

return statearr_31202;
})();
var statearr_31203_31220 = state_31191__$1;
(statearr_31203_31220[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (5))){
var inst_31171 = (state_31191[(7)]);
var state_31191__$1 = state_31191;
var statearr_31204_31221 = state_31191__$1;
(statearr_31204_31221[(2)] = inst_31171);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (10))){
var inst_31185 = (state_31191[(2)]);
var state_31191__$1 = state_31191;
var statearr_31205_31222 = state_31191__$1;
(statearr_31205_31222[(2)] = inst_31185);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31192 === (8))){
var inst_31178 = (state_31191[(9)]);
var inst_31181 = cljs.core.deref.call(null,inst_31178);
var state_31191__$1 = state_31191;
var statearr_31206_31223 = state_31191__$1;
(statearr_31206_31223[(2)] = inst_31181);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto__))
;
return ((function (switch__30296__auto__,c__30410__auto__){
return (function() {
var cljs$core$async$reduce_$_state_machine__30297__auto__ = null;
var cljs$core$async$reduce_$_state_machine__30297__auto____0 = (function (){
var statearr_31210 = [null,null,null,null,null,null,null,null,null,null];
(statearr_31210[(0)] = cljs$core$async$reduce_$_state_machine__30297__auto__);

(statearr_31210[(1)] = (1));

return statearr_31210;
});
var cljs$core$async$reduce_$_state_machine__30297__auto____1 = (function (state_31191){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_31191);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e31211){if((e31211 instanceof Object)){
var ex__30300__auto__ = e31211;
var statearr_31212_31224 = state_31191;
(statearr_31212_31224[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31225 = state_31191;
state_31191 = G__31225;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$reduce_$_state_machine__30297__auto__ = function(state_31191){
switch(arguments.length){
case 0:
return cljs$core$async$reduce_$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$reduce_$_state_machine__30297__auto____1.call(this,state_31191);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$reduce_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$reduce_$_state_machine__30297__auto____0;
cljs$core$async$reduce_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$reduce_$_state_machine__30297__auto____1;
return cljs$core$async$reduce_$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto__))
})();
var state__30412__auto__ = (function (){var statearr_31213 = f__30411__auto__.call(null);
(statearr_31213[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto__);

return statearr_31213;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto__))
);

return c__30410__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__30410__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto__,f__$1){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto__,f__$1){
return (function (state_31245){
var state_val_31246 = (state_31245[(1)]);
if((state_val_31246 === (1))){
var inst_31240 = cljs.core.async.reduce.call(null,f__$1,init,ch);
var state_31245__$1 = state_31245;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31245__$1,(2),inst_31240);
} else {
if((state_val_31246 === (2))){
var inst_31242 = (state_31245[(2)]);
var inst_31243 = f__$1.call(null,inst_31242);
var state_31245__$1 = state_31245;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31245__$1,inst_31243);
} else {
return null;
}
}
});})(c__30410__auto__,f__$1))
;
return ((function (switch__30296__auto__,c__30410__auto__,f__$1){
return (function() {
var cljs$core$async$transduce_$_state_machine__30297__auto__ = null;
var cljs$core$async$transduce_$_state_machine__30297__auto____0 = (function (){
var statearr_31250 = [null,null,null,null,null,null,null];
(statearr_31250[(0)] = cljs$core$async$transduce_$_state_machine__30297__auto__);

(statearr_31250[(1)] = (1));

return statearr_31250;
});
var cljs$core$async$transduce_$_state_machine__30297__auto____1 = (function (state_31245){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_31245);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e31251){if((e31251 instanceof Object)){
var ex__30300__auto__ = e31251;
var statearr_31252_31254 = state_31245;
(statearr_31252_31254[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31255 = state_31245;
state_31245 = G__31255;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$transduce_$_state_machine__30297__auto__ = function(state_31245){
switch(arguments.length){
case 0:
return cljs$core$async$transduce_$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$transduce_$_state_machine__30297__auto____1.call(this,state_31245);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$transduce_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$transduce_$_state_machine__30297__auto____0;
cljs$core$async$transduce_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$transduce_$_state_machine__30297__auto____1;
return cljs$core$async$transduce_$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto__,f__$1))
})();
var state__30412__auto__ = (function (){var statearr_31253 = f__30411__auto__.call(null);
(statearr_31253[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto__);

return statearr_31253;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto__,f__$1))
);

return c__30410__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 args31256 = [];
var len__24369__auto___31308 = arguments.length;
var i__24370__auto___31309 = (0);
while(true){
if((i__24370__auto___31309 < len__24369__auto___31308)){
args31256.push((arguments[i__24370__auto___31309]));

var G__31310 = (i__24370__auto___31309 + (1));
i__24370__auto___31309 = G__31310;
continue;
} else {
}
break;
}

var G__31258 = args31256.length;
switch (G__31258) {
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(args31256.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__30410__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto__){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto__){
return (function (state_31283){
var state_val_31284 = (state_31283[(1)]);
if((state_val_31284 === (7))){
var inst_31265 = (state_31283[(2)]);
var state_31283__$1 = state_31283;
var statearr_31285_31312 = state_31283__$1;
(statearr_31285_31312[(2)] = inst_31265);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (1))){
var inst_31259 = cljs.core.seq.call(null,coll);
var inst_31260 = inst_31259;
var state_31283__$1 = (function (){var statearr_31286 = state_31283;
(statearr_31286[(7)] = inst_31260);

return statearr_31286;
})();
var statearr_31287_31313 = state_31283__$1;
(statearr_31287_31313[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (4))){
var inst_31260 = (state_31283[(7)]);
var inst_31263 = cljs.core.first.call(null,inst_31260);
var state_31283__$1 = state_31283;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_31283__$1,(7),ch,inst_31263);
} else {
if((state_val_31284 === (13))){
var inst_31277 = (state_31283[(2)]);
var state_31283__$1 = state_31283;
var statearr_31288_31314 = state_31283__$1;
(statearr_31288_31314[(2)] = inst_31277);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (6))){
var inst_31268 = (state_31283[(2)]);
var state_31283__$1 = state_31283;
if(cljs.core.truth_(inst_31268)){
var statearr_31289_31315 = state_31283__$1;
(statearr_31289_31315[(1)] = (8));

} else {
var statearr_31290_31316 = state_31283__$1;
(statearr_31290_31316[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (3))){
var inst_31281 = (state_31283[(2)]);
var state_31283__$1 = state_31283;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31283__$1,inst_31281);
} else {
if((state_val_31284 === (12))){
var state_31283__$1 = state_31283;
var statearr_31291_31317 = state_31283__$1;
(statearr_31291_31317[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (2))){
var inst_31260 = (state_31283[(7)]);
var state_31283__$1 = state_31283;
if(cljs.core.truth_(inst_31260)){
var statearr_31292_31318 = state_31283__$1;
(statearr_31292_31318[(1)] = (4));

} else {
var statearr_31293_31319 = state_31283__$1;
(statearr_31293_31319[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (11))){
var inst_31274 = cljs.core.async.close_BANG_.call(null,ch);
var state_31283__$1 = state_31283;
var statearr_31294_31320 = state_31283__$1;
(statearr_31294_31320[(2)] = inst_31274);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (9))){
var state_31283__$1 = state_31283;
if(cljs.core.truth_(close_QMARK_)){
var statearr_31295_31321 = state_31283__$1;
(statearr_31295_31321[(1)] = (11));

} else {
var statearr_31296_31322 = state_31283__$1;
(statearr_31296_31322[(1)] = (12));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (5))){
var inst_31260 = (state_31283[(7)]);
var state_31283__$1 = state_31283;
var statearr_31297_31323 = state_31283__$1;
(statearr_31297_31323[(2)] = inst_31260);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (10))){
var inst_31279 = (state_31283[(2)]);
var state_31283__$1 = state_31283;
var statearr_31298_31324 = state_31283__$1;
(statearr_31298_31324[(2)] = inst_31279);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31284 === (8))){
var inst_31260 = (state_31283[(7)]);
var inst_31270 = cljs.core.next.call(null,inst_31260);
var inst_31260__$1 = inst_31270;
var state_31283__$1 = (function (){var statearr_31299 = state_31283;
(statearr_31299[(7)] = inst_31260__$1);

return statearr_31299;
})();
var statearr_31300_31325 = state_31283__$1;
(statearr_31300_31325[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto__))
;
return ((function (switch__30296__auto__,c__30410__auto__){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_31304 = [null,null,null,null,null,null,null,null];
(statearr_31304[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_31304[(1)] = (1));

return statearr_31304;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_31283){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_31283);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e31305){if((e31305 instanceof Object)){
var ex__30300__auto__ = e31305;
var statearr_31306_31326 = state_31283;
(statearr_31306_31326[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31327 = state_31283;
state_31283 = G__31327;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_31283){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_31283);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto__))
})();
var state__30412__auto__ = (function (){var statearr_31307 = f__30411__auto__.call(null);
(statearr_31307[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto__);

return statearr_31307;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto__))
);

return c__30410__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (cljs.core.async.muxch_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_);
} else {
var m__23867__auto____$1 = (cljs.core.async.muxch_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.tap_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,ch,close_QMARK_);
} else {
var m__23867__auto____$1 = (cljs.core.async.tap_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.untap_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,ch);
} else {
var m__23867__auto____$1 = (cljs.core.async.untap_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.untap_all_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m);
} else {
var m__23867__auto____$1 = (cljs.core.async.untap_all_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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$async31553 !== '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$async31553 = (function (ch,cs,meta31554){
this.ch = ch;
this.cs = cs;
this.meta31554 = meta31554;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async31553.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (cs){
return (function (_31555,meta31554__$1){
var self__ = this;
var _31555__$1 = this;
return (new cljs.core.async.t_cljs$core$async31553(self__.ch,self__.cs,meta31554__$1));
});})(cs))
;

cljs.core.async.t_cljs$core$async31553.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (cs){
return (function (_31555){
var self__ = this;
var _31555__$1 = this;
return self__.meta31554;
});})(cs))
;

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

cljs.core.async.t_cljs$core$async31553.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$async31553.prototype.cljs$core$async$Mult$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async31553.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$async31553.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$async31553.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$async31553.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,"meta31554","meta31554",-1328428057,null)], null);
});})(cs))
;

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

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

cljs.core.async.t_cljs$core$async31553.cljs$lang$ctorPrWriter = ((function (cs){
return (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async31553");
});})(cs))
;

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

}

return (new cljs.core.async.t_cljs$core$async31553(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__30410__auto___31778 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___31778,cs,m,dchan,dctr,done){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___31778,cs,m,dchan,dctr,done){
return (function (state_31690){
var state_val_31691 = (state_31690[(1)]);
if((state_val_31691 === (7))){
var inst_31686 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31692_31779 = state_31690__$1;
(statearr_31692_31779[(2)] = inst_31686);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (20))){
var inst_31589 = (state_31690[(7)]);
var inst_31601 = cljs.core.first.call(null,inst_31589);
var inst_31602 = cljs.core.nth.call(null,inst_31601,(0),null);
var inst_31603 = cljs.core.nth.call(null,inst_31601,(1),null);
var state_31690__$1 = (function (){var statearr_31693 = state_31690;
(statearr_31693[(8)] = inst_31602);

return statearr_31693;
})();
if(cljs.core.truth_(inst_31603)){
var statearr_31694_31780 = state_31690__$1;
(statearr_31694_31780[(1)] = (22));

} else {
var statearr_31695_31781 = state_31690__$1;
(statearr_31695_31781[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (27))){
var inst_31631 = (state_31690[(9)]);
var inst_31638 = (state_31690[(10)]);
var inst_31633 = (state_31690[(11)]);
var inst_31558 = (state_31690[(12)]);
var inst_31638__$1 = cljs.core._nth.call(null,inst_31631,inst_31633);
var inst_31639 = cljs.core.async.put_BANG_.call(null,inst_31638__$1,inst_31558,done);
var state_31690__$1 = (function (){var statearr_31696 = state_31690;
(statearr_31696[(10)] = inst_31638__$1);

return statearr_31696;
})();
if(cljs.core.truth_(inst_31639)){
var statearr_31697_31782 = state_31690__$1;
(statearr_31697_31782[(1)] = (30));

} else {
var statearr_31698_31783 = state_31690__$1;
(statearr_31698_31783[(1)] = (31));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (1))){
var state_31690__$1 = state_31690;
var statearr_31699_31784 = state_31690__$1;
(statearr_31699_31784[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (24))){
var inst_31589 = (state_31690[(7)]);
var inst_31608 = (state_31690[(2)]);
var inst_31609 = cljs.core.next.call(null,inst_31589);
var inst_31567 = inst_31609;
var inst_31568 = null;
var inst_31569 = (0);
var inst_31570 = (0);
var state_31690__$1 = (function (){var statearr_31700 = state_31690;
(statearr_31700[(13)] = inst_31567);

(statearr_31700[(14)] = inst_31570);

(statearr_31700[(15)] = inst_31569);

(statearr_31700[(16)] = inst_31568);

(statearr_31700[(17)] = inst_31608);

return statearr_31700;
})();
var statearr_31701_31785 = state_31690__$1;
(statearr_31701_31785[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (39))){
var state_31690__$1 = state_31690;
var statearr_31705_31786 = state_31690__$1;
(statearr_31705_31786[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (4))){
var inst_31558 = (state_31690[(12)]);
var inst_31558__$1 = (state_31690[(2)]);
var inst_31559 = (inst_31558__$1 == null);
var state_31690__$1 = (function (){var statearr_31706 = state_31690;
(statearr_31706[(12)] = inst_31558__$1);

return statearr_31706;
})();
if(cljs.core.truth_(inst_31559)){
var statearr_31707_31787 = state_31690__$1;
(statearr_31707_31787[(1)] = (5));

} else {
var statearr_31708_31788 = state_31690__$1;
(statearr_31708_31788[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (15))){
var inst_31567 = (state_31690[(13)]);
var inst_31570 = (state_31690[(14)]);
var inst_31569 = (state_31690[(15)]);
var inst_31568 = (state_31690[(16)]);
var inst_31585 = (state_31690[(2)]);
var inst_31586 = (inst_31570 + (1));
var tmp31702 = inst_31567;
var tmp31703 = inst_31569;
var tmp31704 = inst_31568;
var inst_31567__$1 = tmp31702;
var inst_31568__$1 = tmp31704;
var inst_31569__$1 = tmp31703;
var inst_31570__$1 = inst_31586;
var state_31690__$1 = (function (){var statearr_31709 = state_31690;
(statearr_31709[(13)] = inst_31567__$1);

(statearr_31709[(14)] = inst_31570__$1);

(statearr_31709[(15)] = inst_31569__$1);

(statearr_31709[(16)] = inst_31568__$1);

(statearr_31709[(18)] = inst_31585);

return statearr_31709;
})();
var statearr_31710_31789 = state_31690__$1;
(statearr_31710_31789[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (21))){
var inst_31612 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31714_31790 = state_31690__$1;
(statearr_31714_31790[(2)] = inst_31612);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (31))){
var inst_31638 = (state_31690[(10)]);
var inst_31642 = done.call(null,null);
var inst_31643 = cljs.core.async.untap_STAR_.call(null,m,inst_31638);
var state_31690__$1 = (function (){var statearr_31715 = state_31690;
(statearr_31715[(19)] = inst_31642);

return statearr_31715;
})();
var statearr_31716_31791 = state_31690__$1;
(statearr_31716_31791[(2)] = inst_31643);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (32))){
var inst_31632 = (state_31690[(20)]);
var inst_31631 = (state_31690[(9)]);
var inst_31633 = (state_31690[(11)]);
var inst_31630 = (state_31690[(21)]);
var inst_31645 = (state_31690[(2)]);
var inst_31646 = (inst_31633 + (1));
var tmp31711 = inst_31632;
var tmp31712 = inst_31631;
var tmp31713 = inst_31630;
var inst_31630__$1 = tmp31713;
var inst_31631__$1 = tmp31712;
var inst_31632__$1 = tmp31711;
var inst_31633__$1 = inst_31646;
var state_31690__$1 = (function (){var statearr_31717 = state_31690;
(statearr_31717[(20)] = inst_31632__$1);

(statearr_31717[(22)] = inst_31645);

(statearr_31717[(9)] = inst_31631__$1);

(statearr_31717[(11)] = inst_31633__$1);

(statearr_31717[(21)] = inst_31630__$1);

return statearr_31717;
})();
var statearr_31718_31792 = state_31690__$1;
(statearr_31718_31792[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (40))){
var inst_31658 = (state_31690[(23)]);
var inst_31662 = done.call(null,null);
var inst_31663 = cljs.core.async.untap_STAR_.call(null,m,inst_31658);
var state_31690__$1 = (function (){var statearr_31719 = state_31690;
(statearr_31719[(24)] = inst_31662);

return statearr_31719;
})();
var statearr_31720_31793 = state_31690__$1;
(statearr_31720_31793[(2)] = inst_31663);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (33))){
var inst_31649 = (state_31690[(25)]);
var inst_31651 = cljs.core.chunked_seq_QMARK_.call(null,inst_31649);
var state_31690__$1 = state_31690;
if(inst_31651){
var statearr_31721_31794 = state_31690__$1;
(statearr_31721_31794[(1)] = (36));

} else {
var statearr_31722_31795 = state_31690__$1;
(statearr_31722_31795[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (13))){
var inst_31579 = (state_31690[(26)]);
var inst_31582 = cljs.core.async.close_BANG_.call(null,inst_31579);
var state_31690__$1 = state_31690;
var statearr_31723_31796 = state_31690__$1;
(statearr_31723_31796[(2)] = inst_31582);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (22))){
var inst_31602 = (state_31690[(8)]);
var inst_31605 = cljs.core.async.close_BANG_.call(null,inst_31602);
var state_31690__$1 = state_31690;
var statearr_31724_31797 = state_31690__$1;
(statearr_31724_31797[(2)] = inst_31605);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (36))){
var inst_31649 = (state_31690[(25)]);
var inst_31653 = cljs.core.chunk_first.call(null,inst_31649);
var inst_31654 = cljs.core.chunk_rest.call(null,inst_31649);
var inst_31655 = cljs.core.count.call(null,inst_31653);
var inst_31630 = inst_31654;
var inst_31631 = inst_31653;
var inst_31632 = inst_31655;
var inst_31633 = (0);
var state_31690__$1 = (function (){var statearr_31725 = state_31690;
(statearr_31725[(20)] = inst_31632);

(statearr_31725[(9)] = inst_31631);

(statearr_31725[(11)] = inst_31633);

(statearr_31725[(21)] = inst_31630);

return statearr_31725;
})();
var statearr_31726_31798 = state_31690__$1;
(statearr_31726_31798[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (41))){
var inst_31649 = (state_31690[(25)]);
var inst_31665 = (state_31690[(2)]);
var inst_31666 = cljs.core.next.call(null,inst_31649);
var inst_31630 = inst_31666;
var inst_31631 = null;
var inst_31632 = (0);
var inst_31633 = (0);
var state_31690__$1 = (function (){var statearr_31727 = state_31690;
(statearr_31727[(20)] = inst_31632);

(statearr_31727[(9)] = inst_31631);

(statearr_31727[(27)] = inst_31665);

(statearr_31727[(11)] = inst_31633);

(statearr_31727[(21)] = inst_31630);

return statearr_31727;
})();
var statearr_31728_31799 = state_31690__$1;
(statearr_31728_31799[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (43))){
var state_31690__$1 = state_31690;
var statearr_31729_31800 = state_31690__$1;
(statearr_31729_31800[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (29))){
var inst_31674 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31730_31801 = state_31690__$1;
(statearr_31730_31801[(2)] = inst_31674);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (44))){
var inst_31683 = (state_31690[(2)]);
var state_31690__$1 = (function (){var statearr_31731 = state_31690;
(statearr_31731[(28)] = inst_31683);

return statearr_31731;
})();
var statearr_31732_31802 = state_31690__$1;
(statearr_31732_31802[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (6))){
var inst_31622 = (state_31690[(29)]);
var inst_31621 = cljs.core.deref.call(null,cs);
var inst_31622__$1 = cljs.core.keys.call(null,inst_31621);
var inst_31623 = cljs.core.count.call(null,inst_31622__$1);
var inst_31624 = cljs.core.reset_BANG_.call(null,dctr,inst_31623);
var inst_31629 = cljs.core.seq.call(null,inst_31622__$1);
var inst_31630 = inst_31629;
var inst_31631 = null;
var inst_31632 = (0);
var inst_31633 = (0);
var state_31690__$1 = (function (){var statearr_31733 = state_31690;
(statearr_31733[(20)] = inst_31632);

(statearr_31733[(9)] = inst_31631);

(statearr_31733[(29)] = inst_31622__$1);

(statearr_31733[(30)] = inst_31624);

(statearr_31733[(11)] = inst_31633);

(statearr_31733[(21)] = inst_31630);

return statearr_31733;
})();
var statearr_31734_31803 = state_31690__$1;
(statearr_31734_31803[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (28))){
var inst_31649 = (state_31690[(25)]);
var inst_31630 = (state_31690[(21)]);
var inst_31649__$1 = cljs.core.seq.call(null,inst_31630);
var state_31690__$1 = (function (){var statearr_31735 = state_31690;
(statearr_31735[(25)] = inst_31649__$1);

return statearr_31735;
})();
if(inst_31649__$1){
var statearr_31736_31804 = state_31690__$1;
(statearr_31736_31804[(1)] = (33));

} else {
var statearr_31737_31805 = state_31690__$1;
(statearr_31737_31805[(1)] = (34));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (25))){
var inst_31632 = (state_31690[(20)]);
var inst_31633 = (state_31690[(11)]);
var inst_31635 = (inst_31633 < inst_31632);
var inst_31636 = inst_31635;
var state_31690__$1 = state_31690;
if(cljs.core.truth_(inst_31636)){
var statearr_31738_31806 = state_31690__$1;
(statearr_31738_31806[(1)] = (27));

} else {
var statearr_31739_31807 = state_31690__$1;
(statearr_31739_31807[(1)] = (28));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (34))){
var state_31690__$1 = state_31690;
var statearr_31740_31808 = state_31690__$1;
(statearr_31740_31808[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (17))){
var state_31690__$1 = state_31690;
var statearr_31741_31809 = state_31690__$1;
(statearr_31741_31809[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (3))){
var inst_31688 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_31690__$1,inst_31688);
} else {
if((state_val_31691 === (12))){
var inst_31617 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31742_31810 = state_31690__$1;
(statearr_31742_31810[(2)] = inst_31617);

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


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

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (35))){
var inst_31672 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31744_31812 = state_31690__$1;
(statearr_31744_31812[(2)] = inst_31672);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (19))){
var inst_31589 = (state_31690[(7)]);
var inst_31593 = cljs.core.chunk_first.call(null,inst_31589);
var inst_31594 = cljs.core.chunk_rest.call(null,inst_31589);
var inst_31595 = cljs.core.count.call(null,inst_31593);
var inst_31567 = inst_31594;
var inst_31568 = inst_31593;
var inst_31569 = inst_31595;
var inst_31570 = (0);
var state_31690__$1 = (function (){var statearr_31745 = state_31690;
(statearr_31745[(13)] = inst_31567);

(statearr_31745[(14)] = inst_31570);

(statearr_31745[(15)] = inst_31569);

(statearr_31745[(16)] = inst_31568);

return statearr_31745;
})();
var statearr_31746_31813 = state_31690__$1;
(statearr_31746_31813[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (11))){
var inst_31567 = (state_31690[(13)]);
var inst_31589 = (state_31690[(7)]);
var inst_31589__$1 = cljs.core.seq.call(null,inst_31567);
var state_31690__$1 = (function (){var statearr_31747 = state_31690;
(statearr_31747[(7)] = inst_31589__$1);

return statearr_31747;
})();
if(inst_31589__$1){
var statearr_31748_31814 = state_31690__$1;
(statearr_31748_31814[(1)] = (16));

} else {
var statearr_31749_31815 = state_31690__$1;
(statearr_31749_31815[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (9))){
var inst_31619 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31750_31816 = state_31690__$1;
(statearr_31750_31816[(2)] = inst_31619);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (5))){
var inst_31565 = cljs.core.deref.call(null,cs);
var inst_31566 = cljs.core.seq.call(null,inst_31565);
var inst_31567 = inst_31566;
var inst_31568 = null;
var inst_31569 = (0);
var inst_31570 = (0);
var state_31690__$1 = (function (){var statearr_31751 = state_31690;
(statearr_31751[(13)] = inst_31567);

(statearr_31751[(14)] = inst_31570);

(statearr_31751[(15)] = inst_31569);

(statearr_31751[(16)] = inst_31568);

return statearr_31751;
})();
var statearr_31752_31817 = state_31690__$1;
(statearr_31752_31817[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (14))){
var state_31690__$1 = state_31690;
var statearr_31753_31818 = state_31690__$1;
(statearr_31753_31818[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (45))){
var inst_31680 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31754_31819 = state_31690__$1;
(statearr_31754_31819[(2)] = inst_31680);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (26))){
var inst_31622 = (state_31690[(29)]);
var inst_31676 = (state_31690[(2)]);
var inst_31677 = cljs.core.seq.call(null,inst_31622);
var state_31690__$1 = (function (){var statearr_31755 = state_31690;
(statearr_31755[(31)] = inst_31676);

return statearr_31755;
})();
if(inst_31677){
var statearr_31756_31820 = state_31690__$1;
(statearr_31756_31820[(1)] = (42));

} else {
var statearr_31757_31821 = state_31690__$1;
(statearr_31757_31821[(1)] = (43));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (16))){
var inst_31589 = (state_31690[(7)]);
var inst_31591 = cljs.core.chunked_seq_QMARK_.call(null,inst_31589);
var state_31690__$1 = state_31690;
if(inst_31591){
var statearr_31758_31822 = state_31690__$1;
(statearr_31758_31822[(1)] = (19));

} else {
var statearr_31759_31823 = state_31690__$1;
(statearr_31759_31823[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (38))){
var inst_31669 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31760_31824 = state_31690__$1;
(statearr_31760_31824[(2)] = inst_31669);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (30))){
var state_31690__$1 = state_31690;
var statearr_31761_31825 = state_31690__$1;
(statearr_31761_31825[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (10))){
var inst_31570 = (state_31690[(14)]);
var inst_31568 = (state_31690[(16)]);
var inst_31578 = cljs.core._nth.call(null,inst_31568,inst_31570);
var inst_31579 = cljs.core.nth.call(null,inst_31578,(0),null);
var inst_31580 = cljs.core.nth.call(null,inst_31578,(1),null);
var state_31690__$1 = (function (){var statearr_31762 = state_31690;
(statearr_31762[(26)] = inst_31579);

return statearr_31762;
})();
if(cljs.core.truth_(inst_31580)){
var statearr_31763_31826 = state_31690__$1;
(statearr_31763_31826[(1)] = (13));

} else {
var statearr_31764_31827 = state_31690__$1;
(statearr_31764_31827[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (18))){
var inst_31615 = (state_31690[(2)]);
var state_31690__$1 = state_31690;
var statearr_31765_31828 = state_31690__$1;
(statearr_31765_31828[(2)] = inst_31615);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (42))){
var state_31690__$1 = state_31690;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_31690__$1,(45),dchan);
} else {
if((state_val_31691 === (37))){
var inst_31649 = (state_31690[(25)]);
var inst_31658 = (state_31690[(23)]);
var inst_31558 = (state_31690[(12)]);
var inst_31658__$1 = cljs.core.first.call(null,inst_31649);
var inst_31659 = cljs.core.async.put_BANG_.call(null,inst_31658__$1,inst_31558,done);
var state_31690__$1 = (function (){var statearr_31766 = state_31690;
(statearr_31766[(23)] = inst_31658__$1);

return statearr_31766;
})();
if(cljs.core.truth_(inst_31659)){
var statearr_31767_31829 = state_31690__$1;
(statearr_31767_31829[(1)] = (39));

} else {
var statearr_31768_31830 = state_31690__$1;
(statearr_31768_31830[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_31691 === (8))){
var inst_31570 = (state_31690[(14)]);
var inst_31569 = (state_31690[(15)]);
var inst_31572 = (inst_31570 < inst_31569);
var inst_31573 = inst_31572;
var state_31690__$1 = state_31690;
if(cljs.core.truth_(inst_31573)){
var statearr_31769_31831 = state_31690__$1;
(statearr_31769_31831[(1)] = (10));

} else {
var statearr_31770_31832 = state_31690__$1;
(statearr_31770_31832[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___31778,cs,m,dchan,dctr,done))
;
return ((function (switch__30296__auto__,c__30410__auto___31778,cs,m,dchan,dctr,done){
return (function() {
var cljs$core$async$mult_$_state_machine__30297__auto__ = null;
var cljs$core$async$mult_$_state_machine__30297__auto____0 = (function (){
var statearr_31774 = [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_31774[(0)] = cljs$core$async$mult_$_state_machine__30297__auto__);

(statearr_31774[(1)] = (1));

return statearr_31774;
});
var cljs$core$async$mult_$_state_machine__30297__auto____1 = (function (state_31690){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_31690);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e31775){if((e31775 instanceof Object)){
var ex__30300__auto__ = e31775;
var statearr_31776_31833 = state_31690;
(statearr_31776_31833[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__31834 = state_31690;
state_31690 = G__31834;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$mult_$_state_machine__30297__auto__ = function(state_31690){
switch(arguments.length){
case 0:
return cljs$core$async$mult_$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$mult_$_state_machine__30297__auto____1.call(this,state_31690);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mult_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mult_$_state_machine__30297__auto____0;
cljs$core$async$mult_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mult_$_state_machine__30297__auto____1;
return cljs$core$async$mult_$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___31778,cs,m,dchan,dctr,done))
})();
var state__30412__auto__ = (function (){var statearr_31777 = f__30411__auto__.call(null);
(statearr_31777[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___31778);

return statearr_31777;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___31778,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 args31835 = [];
var len__24369__auto___31838 = arguments.length;
var i__24370__auto___31839 = (0);
while(true){
if((i__24370__auto___31839 < len__24369__auto___31838)){
args31835.push((arguments[i__24370__auto___31839]));

var G__31840 = (i__24370__auto___31839 + (1));
i__24370__auto___31839 = G__31840;
continue;
} else {
}
break;
}

var G__31837 = args31835.length;
switch (G__31837) {
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(args31835.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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.admix_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,ch);
} else {
var m__23867__auto____$1 = (cljs.core.async.admix_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.unmix_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,ch);
} else {
var m__23867__auto____$1 = (cljs.core.async.unmix_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.unmix_all_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m);
} else {
var m__23867__auto____$1 = (cljs.core.async.unmix_all_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.toggle_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,state_map);
} else {
var m__23867__auto____$1 = (cljs.core.async.toggle_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((m == null))?null:m);
var m__23867__auto__ = (cljs.core.async.solo_mode_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,m,mode);
} else {
var m__23867__auto____$1 = (cljs.core.async.solo_mode_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__24376__auto__ = [];
var len__24369__auto___31852 = arguments.length;
var i__24370__auto___31853 = (0);
while(true){
if((i__24370__auto___31853 < len__24369__auto___31852)){
args__24376__auto__.push((arguments[i__24370__auto___31853]));

var G__31854 = (i__24370__auto___31853 + (1));
i__24370__auto___31853 = G__31854;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((3) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__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__24377__auto__);
});

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


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


return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state);
});})(map__31847,map__31847__$1,opts))
,ports,opts);
if(cljs.core.truth_(temp__5278__auto__)){
var cb = temp__5278__auto__;
var statearr_31851_31857 = state;
(statearr_31851_31857[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 (seq31842){
var G__31843 = cljs.core.first.call(null,seq31842);
var seq31842__$1 = cljs.core.next.call(null,seq31842);
var G__31844 = cljs.core.first.call(null,seq31842__$1);
var seq31842__$2 = cljs.core.next.call(null,seq31842__$1);
var G__31845 = cljs.core.first.call(null,seq31842__$2);
var seq31842__$3 = cljs.core.next.call(null,seq31842__$2);
return cljs.core.async.ioc_alts_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__31843,G__31844,G__31845,seq31842__$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$async32025 !== '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$async32025 = (function (out,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,meta32026){
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.meta32026 = meta32026;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32025.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_32027,meta32026__$1){
var self__ = this;
var _32027__$1 = this;
return (new cljs.core.async.t_cljs$core$async32025(self__.out,self__.cs,self__.solo_modes,self__.attrs,self__.solo_mode,self__.change,self__.changed,self__.pick,self__.calc_state,meta32026__$1));
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

cljs.core.async.t_cljs$core$async32025.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (_32027){
var self__ = this;
var _32027__$1 = this;
return self__.meta32026;
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

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

cljs.core.async.t_cljs$core$async32025.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$async32025.prototype.cljs$core$async$Mix$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32025.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$async32025.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$async32025.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$async32025.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$async32025.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$async32025.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,"meta32026","meta32026",-473170116,null)], null);
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

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

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

cljs.core.async.t_cljs$core$async32025.cljs$lang$ctorPrWriter = ((function (cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state){
return (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32025");
});})(cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state))
;

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

}

return (new cljs.core.async.t_cljs$core$async32025(out,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,cljs.core.PersistentArrayMap.EMPTY));
})()
;
var c__30410__auto___32192 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32192,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32192,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function (state_32129){
var state_val_32130 = (state_32129[(1)]);
if((state_val_32130 === (7))){
var inst_32044 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
var statearr_32131_32193 = state_32129__$1;
(statearr_32131_32193[(2)] = inst_32044);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (20))){
var inst_32056 = (state_32129[(7)]);
var state_32129__$1 = state_32129;
var statearr_32132_32194 = state_32129__$1;
(statearr_32132_32194[(2)] = inst_32056);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (27))){
var state_32129__$1 = state_32129;
var statearr_32133_32195 = state_32129__$1;
(statearr_32133_32195[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (1))){
var inst_32031 = (state_32129[(8)]);
var inst_32031__$1 = calc_state.call(null);
var inst_32033 = (inst_32031__$1 == null);
var inst_32034 = cljs.core.not.call(null,inst_32033);
var state_32129__$1 = (function (){var statearr_32134 = state_32129;
(statearr_32134[(8)] = inst_32031__$1);

return statearr_32134;
})();
if(inst_32034){
var statearr_32135_32196 = state_32129__$1;
(statearr_32135_32196[(1)] = (2));

} else {
var statearr_32136_32197 = state_32129__$1;
(statearr_32136_32197[(1)] = (3));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (24))){
var inst_32089 = (state_32129[(9)]);
var inst_32080 = (state_32129[(10)]);
var inst_32103 = (state_32129[(11)]);
var inst_32103__$1 = inst_32080.call(null,inst_32089);
var state_32129__$1 = (function (){var statearr_32137 = state_32129;
(statearr_32137[(11)] = inst_32103__$1);

return statearr_32137;
})();
if(cljs.core.truth_(inst_32103__$1)){
var statearr_32138_32198 = state_32129__$1;
(statearr_32138_32198[(1)] = (29));

} else {
var statearr_32139_32199 = state_32129__$1;
(statearr_32139_32199[(1)] = (30));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (4))){
var inst_32047 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32047)){
var statearr_32140_32200 = state_32129__$1;
(statearr_32140_32200[(1)] = (8));

} else {
var statearr_32141_32201 = state_32129__$1;
(statearr_32141_32201[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (15))){
var inst_32074 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32074)){
var statearr_32142_32202 = state_32129__$1;
(statearr_32142_32202[(1)] = (19));

} else {
var statearr_32143_32203 = state_32129__$1;
(statearr_32143_32203[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (21))){
var inst_32079 = (state_32129[(12)]);
var inst_32079__$1 = (state_32129[(2)]);
var inst_32080 = cljs.core.get.call(null,inst_32079__$1,new cljs.core.Keyword(null,"solos","solos",1441458643));
var inst_32081 = cljs.core.get.call(null,inst_32079__$1,new cljs.core.Keyword(null,"mutes","mutes",1068806309));
var inst_32082 = cljs.core.get.call(null,inst_32079__$1,new cljs.core.Keyword(null,"reads","reads",-1215067361));
var state_32129__$1 = (function (){var statearr_32144 = state_32129;
(statearr_32144[(13)] = inst_32081);

(statearr_32144[(12)] = inst_32079__$1);

(statearr_32144[(10)] = inst_32080);

return statearr_32144;
})();
return cljs.core.async.ioc_alts_BANG_.call(null,state_32129__$1,(22),inst_32082);
} else {
if((state_val_32130 === (31))){
var inst_32111 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32111)){
var statearr_32145_32204 = state_32129__$1;
(statearr_32145_32204[(1)] = (32));

} else {
var statearr_32146_32205 = state_32129__$1;
(statearr_32146_32205[(1)] = (33));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (32))){
var inst_32088 = (state_32129[(14)]);
var state_32129__$1 = state_32129;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32129__$1,(35),out,inst_32088);
} else {
if((state_val_32130 === (33))){
var inst_32079 = (state_32129[(12)]);
var inst_32056 = inst_32079;
var state_32129__$1 = (function (){var statearr_32147 = state_32129;
(statearr_32147[(7)] = inst_32056);

return statearr_32147;
})();
var statearr_32148_32206 = state_32129__$1;
(statearr_32148_32206[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (13))){
var inst_32056 = (state_32129[(7)]);
var inst_32063 = inst_32056.cljs$lang$protocol_mask$partition0$;
var inst_32064 = (inst_32063 & (64));
var inst_32065 = inst_32056.cljs$core$ISeq$;
var inst_32066 = (cljs.core.PROTOCOL_SENTINEL === inst_32065);
var inst_32067 = (inst_32064) || (inst_32066);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32067)){
var statearr_32149_32207 = state_32129__$1;
(statearr_32149_32207[(1)] = (16));

} else {
var statearr_32150_32208 = state_32129__$1;
(statearr_32150_32208[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (22))){
var inst_32089 = (state_32129[(9)]);
var inst_32088 = (state_32129[(14)]);
var inst_32087 = (state_32129[(2)]);
var inst_32088__$1 = cljs.core.nth.call(null,inst_32087,(0),null);
var inst_32089__$1 = cljs.core.nth.call(null,inst_32087,(1),null);
var inst_32090 = (inst_32088__$1 == null);
var inst_32091 = cljs.core._EQ_.call(null,inst_32089__$1,change);
var inst_32092 = (inst_32090) || (inst_32091);
var state_32129__$1 = (function (){var statearr_32151 = state_32129;
(statearr_32151[(9)] = inst_32089__$1);

(statearr_32151[(14)] = inst_32088__$1);

return statearr_32151;
})();
if(cljs.core.truth_(inst_32092)){
var statearr_32152_32209 = state_32129__$1;
(statearr_32152_32209[(1)] = (23));

} else {
var statearr_32153_32210 = state_32129__$1;
(statearr_32153_32210[(1)] = (24));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (36))){
var inst_32079 = (state_32129[(12)]);
var inst_32056 = inst_32079;
var state_32129__$1 = (function (){var statearr_32154 = state_32129;
(statearr_32154[(7)] = inst_32056);

return statearr_32154;
})();
var statearr_32155_32211 = state_32129__$1;
(statearr_32155_32211[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (29))){
var inst_32103 = (state_32129[(11)]);
var state_32129__$1 = state_32129;
var statearr_32156_32212 = state_32129__$1;
(statearr_32156_32212[(2)] = inst_32103);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (6))){
var state_32129__$1 = state_32129;
var statearr_32157_32213 = state_32129__$1;
(statearr_32157_32213[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (28))){
var inst_32099 = (state_32129[(2)]);
var inst_32100 = calc_state.call(null);
var inst_32056 = inst_32100;
var state_32129__$1 = (function (){var statearr_32158 = state_32129;
(statearr_32158[(7)] = inst_32056);

(statearr_32158[(15)] = inst_32099);

return statearr_32158;
})();
var statearr_32159_32214 = state_32129__$1;
(statearr_32159_32214[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (25))){
var inst_32125 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
var statearr_32160_32215 = state_32129__$1;
(statearr_32160_32215[(2)] = inst_32125);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (34))){
var inst_32123 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
var statearr_32161_32216 = state_32129__$1;
(statearr_32161_32216[(2)] = inst_32123);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (17))){
var state_32129__$1 = state_32129;
var statearr_32162_32217 = state_32129__$1;
(statearr_32162_32217[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (3))){
var state_32129__$1 = state_32129;
var statearr_32163_32218 = state_32129__$1;
(statearr_32163_32218[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (12))){
var inst_32127 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32129__$1,inst_32127);
} else {
if((state_val_32130 === (2))){
var inst_32031 = (state_32129[(8)]);
var inst_32036 = inst_32031.cljs$lang$protocol_mask$partition0$;
var inst_32037 = (inst_32036 & (64));
var inst_32038 = inst_32031.cljs$core$ISeq$;
var inst_32039 = (cljs.core.PROTOCOL_SENTINEL === inst_32038);
var inst_32040 = (inst_32037) || (inst_32039);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32040)){
var statearr_32164_32219 = state_32129__$1;
(statearr_32164_32219[(1)] = (5));

} else {
var statearr_32165_32220 = state_32129__$1;
(statearr_32165_32220[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (23))){
var inst_32088 = (state_32129[(14)]);
var inst_32094 = (inst_32088 == null);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32094)){
var statearr_32166_32221 = state_32129__$1;
(statearr_32166_32221[(1)] = (26));

} else {
var statearr_32167_32222 = state_32129__$1;
(statearr_32167_32222[(1)] = (27));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (35))){
var inst_32114 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
if(cljs.core.truth_(inst_32114)){
var statearr_32168_32223 = state_32129__$1;
(statearr_32168_32223[(1)] = (36));

} else {
var statearr_32169_32224 = state_32129__$1;
(statearr_32169_32224[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (19))){
var inst_32056 = (state_32129[(7)]);
var inst_32076 = cljs.core.apply.call(null,cljs.core.hash_map,inst_32056);
var state_32129__$1 = state_32129;
var statearr_32170_32225 = state_32129__$1;
(statearr_32170_32225[(2)] = inst_32076);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (11))){
var inst_32056 = (state_32129[(7)]);
var inst_32060 = (inst_32056 == null);
var inst_32061 = cljs.core.not.call(null,inst_32060);
var state_32129__$1 = state_32129;
if(inst_32061){
var statearr_32171_32226 = state_32129__$1;
(statearr_32171_32226[(1)] = (13));

} else {
var statearr_32172_32227 = state_32129__$1;
(statearr_32172_32227[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (9))){
var inst_32031 = (state_32129[(8)]);
var state_32129__$1 = state_32129;
var statearr_32173_32228 = state_32129__$1;
(statearr_32173_32228[(2)] = inst_32031);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (5))){
var state_32129__$1 = state_32129;
var statearr_32174_32229 = state_32129__$1;
(statearr_32174_32229[(2)] = true);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (14))){
var state_32129__$1 = state_32129;
var statearr_32175_32230 = state_32129__$1;
(statearr_32175_32230[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (26))){
var inst_32089 = (state_32129[(9)]);
var inst_32096 = cljs.core.swap_BANG_.call(null,cs,cljs.core.dissoc,inst_32089);
var state_32129__$1 = state_32129;
var statearr_32176_32231 = state_32129__$1;
(statearr_32176_32231[(2)] = inst_32096);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (16))){
var state_32129__$1 = state_32129;
var statearr_32177_32232 = state_32129__$1;
(statearr_32177_32232[(2)] = true);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (38))){
var inst_32119 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
var statearr_32178_32233 = state_32129__$1;
(statearr_32178_32233[(2)] = inst_32119);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (30))){
var inst_32081 = (state_32129[(13)]);
var inst_32089 = (state_32129[(9)]);
var inst_32080 = (state_32129[(10)]);
var inst_32106 = cljs.core.empty_QMARK_.call(null,inst_32080);
var inst_32107 = inst_32081.call(null,inst_32089);
var inst_32108 = cljs.core.not.call(null,inst_32107);
var inst_32109 = (inst_32106) && (inst_32108);
var state_32129__$1 = state_32129;
var statearr_32179_32234 = state_32129__$1;
(statearr_32179_32234[(2)] = inst_32109);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (10))){
var inst_32031 = (state_32129[(8)]);
var inst_32052 = (state_32129[(2)]);
var inst_32053 = cljs.core.get.call(null,inst_32052,new cljs.core.Keyword(null,"solos","solos",1441458643));
var inst_32054 = cljs.core.get.call(null,inst_32052,new cljs.core.Keyword(null,"mutes","mutes",1068806309));
var inst_32055 = cljs.core.get.call(null,inst_32052,new cljs.core.Keyword(null,"reads","reads",-1215067361));
var inst_32056 = inst_32031;
var state_32129__$1 = (function (){var statearr_32180 = state_32129;
(statearr_32180[(7)] = inst_32056);

(statearr_32180[(16)] = inst_32054);

(statearr_32180[(17)] = inst_32055);

(statearr_32180[(18)] = inst_32053);

return statearr_32180;
})();
var statearr_32181_32235 = state_32129__$1;
(statearr_32181_32235[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (18))){
var inst_32071 = (state_32129[(2)]);
var state_32129__$1 = state_32129;
var statearr_32182_32236 = state_32129__$1;
(statearr_32182_32236[(2)] = inst_32071);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (37))){
var state_32129__$1 = state_32129;
var statearr_32183_32237 = state_32129__$1;
(statearr_32183_32237[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32130 === (8))){
var inst_32031 = (state_32129[(8)]);
var inst_32049 = cljs.core.apply.call(null,cljs.core.hash_map,inst_32031);
var state_32129__$1 = state_32129;
var statearr_32184_32238 = state_32129__$1;
(statearr_32184_32238[(2)] = inst_32049);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32192,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m))
;
return ((function (switch__30296__auto__,c__30410__auto___32192,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m){
return (function() {
var cljs$core$async$mix_$_state_machine__30297__auto__ = null;
var cljs$core$async$mix_$_state_machine__30297__auto____0 = (function (){
var statearr_32188 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32188[(0)] = cljs$core$async$mix_$_state_machine__30297__auto__);

(statearr_32188[(1)] = (1));

return statearr_32188;
});
var cljs$core$async$mix_$_state_machine__30297__auto____1 = (function (state_32129){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32129);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32189){if((e32189 instanceof Object)){
var ex__30300__auto__ = e32189;
var statearr_32190_32239 = state_32129;
(statearr_32190_32239[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32240 = state_32129;
state_32129 = G__32240;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$mix_$_state_machine__30297__auto__ = function(state_32129){
switch(arguments.length){
case 0:
return cljs$core$async$mix_$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$mix_$_state_machine__30297__auto____1.call(this,state_32129);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mix_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mix_$_state_machine__30297__auto____0;
cljs$core$async$mix_$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mix_$_state_machine__30297__auto____1;
return cljs$core$async$mix_$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32192,cs,solo_modes,attrs,solo_mode,change,changed,pick,calc_state,m))
})();
var state__30412__auto__ = (function (){var statearr_32191 = f__30411__auto__.call(null);
(statearr_32191[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32192);

return statearr_32191;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32192,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__23866__auto__ = (((p == null))?null:p);
var m__23867__auto__ = (cljs.core.async.sub_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,p,v,ch,close_QMARK_);
} else {
var m__23867__auto____$1 = (cljs.core.async.sub_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((p == null))?null:p);
var m__23867__auto__ = (cljs.core.async.unsub_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,p,v,ch);
} else {
var m__23867__auto____$1 = (cljs.core.async.unsub_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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 args32241 = [];
var len__24369__auto___32244 = arguments.length;
var i__24370__auto___32245 = (0);
while(true){
if((i__24370__auto___32245 < len__24369__auto___32244)){
args32241.push((arguments[i__24370__auto___32245]));

var G__32246 = (i__24370__auto___32245 + (1));
i__24370__auto___32245 = G__32246;
continue;
} else {
}
break;
}

var G__32243 = args32241.length;
switch (G__32243) {
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(args32241.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__23866__auto__ = (((p == null))?null:p);
var m__23867__auto__ = (cljs.core.async.unsub_all_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,p);
} else {
var m__23867__auto____$1 = (cljs.core.async.unsub_all_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((p == null))?null:p);
var m__23867__auto__ = (cljs.core.async.unsub_all_STAR_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,p,v);
} else {
var m__23867__auto____$1 = (cljs.core.async.unsub_all_STAR_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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 args32249 = [];
var len__24369__auto___32374 = arguments.length;
var i__24370__auto___32375 = (0);
while(true){
if((i__24370__auto___32375 < len__24369__auto___32374)){
args32249.push((arguments[i__24370__auto___32375]));

var G__32376 = (i__24370__auto___32375 + (1));
i__24370__auto___32375 = G__32376;
continue;
} else {
}
break;
}

var G__32251 = args32249.length;
switch (G__32251) {
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(args32249.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__23148__auto__ = cljs.core.get.call(null,cljs.core.deref.call(null,mults),topic);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.get.call(null,cljs.core.swap_BANG_.call(null,mults,((function (or__23148__auto__,mults){
return (function (p1__32248_SHARP_){
if(cljs.core.truth_(p1__32248_SHARP_.call(null,topic))){
return p1__32248_SHARP_;
} else {
return cljs.core.assoc.call(null,p1__32248_SHARP_,topic,cljs.core.async.mult.call(null,cljs.core.async.chan.call(null,buf_fn.call(null,topic))));
}
});})(or__23148__auto__,mults))
),topic);
}
});})(mults))
;
var p = (function (){
if(typeof cljs.core.async.t_cljs$core$async32252 !== '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$async32252 = (function (ch,topic_fn,buf_fn,mults,ensure_mult,meta32253){
this.ch = ch;
this.topic_fn = topic_fn;
this.buf_fn = buf_fn;
this.mults = mults;
this.ensure_mult = ensure_mult;
this.meta32253 = meta32253;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32252.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (mults,ensure_mult){
return (function (_32254,meta32253__$1){
var self__ = this;
var _32254__$1 = this;
return (new cljs.core.async.t_cljs$core$async32252(self__.ch,self__.topic_fn,self__.buf_fn,self__.mults,self__.ensure_mult,meta32253__$1));
});})(mults,ensure_mult))
;

cljs.core.async.t_cljs$core$async32252.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (mults,ensure_mult){
return (function (_32254){
var self__ = this;
var _32254__$1 = this;
return self__.meta32253;
});})(mults,ensure_mult))
;

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

cljs.core.async.t_cljs$core$async32252.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$async32252.prototype.cljs$core$async$Pub$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32252.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$async32252.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$async32252.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$async32252.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$async32252.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,"meta32253","meta32253",-48257420,null)], null);
});})(mults,ensure_mult))
;

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

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

cljs.core.async.t_cljs$core$async32252.cljs$lang$ctorPrWriter = ((function (mults,ensure_mult){
return (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32252");
});})(mults,ensure_mult))
;

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

}

return (new cljs.core.async.t_cljs$core$async32252(ch,topic_fn,buf_fn,mults,ensure_mult,cljs.core.PersistentArrayMap.EMPTY));
})()
;
var c__30410__auto___32378 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32378,mults,ensure_mult,p){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32378,mults,ensure_mult,p){
return (function (state_32326){
var state_val_32327 = (state_32326[(1)]);
if((state_val_32327 === (7))){
var inst_32322 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32328_32379 = state_32326__$1;
(statearr_32328_32379[(2)] = inst_32322);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (20))){
var state_32326__$1 = state_32326;
var statearr_32329_32380 = state_32326__$1;
(statearr_32329_32380[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (1))){
var state_32326__$1 = state_32326;
var statearr_32330_32381 = state_32326__$1;
(statearr_32330_32381[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (24))){
var inst_32305 = (state_32326[(7)]);
var inst_32314 = cljs.core.swap_BANG_.call(null,mults,cljs.core.dissoc,inst_32305);
var state_32326__$1 = state_32326;
var statearr_32331_32382 = state_32326__$1;
(statearr_32331_32382[(2)] = inst_32314);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (4))){
var inst_32257 = (state_32326[(8)]);
var inst_32257__$1 = (state_32326[(2)]);
var inst_32258 = (inst_32257__$1 == null);
var state_32326__$1 = (function (){var statearr_32332 = state_32326;
(statearr_32332[(8)] = inst_32257__$1);

return statearr_32332;
})();
if(cljs.core.truth_(inst_32258)){
var statearr_32333_32383 = state_32326__$1;
(statearr_32333_32383[(1)] = (5));

} else {
var statearr_32334_32384 = state_32326__$1;
(statearr_32334_32384[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (15))){
var inst_32299 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32335_32385 = state_32326__$1;
(statearr_32335_32385[(2)] = inst_32299);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (21))){
var inst_32319 = (state_32326[(2)]);
var state_32326__$1 = (function (){var statearr_32336 = state_32326;
(statearr_32336[(9)] = inst_32319);

return statearr_32336;
})();
var statearr_32337_32386 = state_32326__$1;
(statearr_32337_32386[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (13))){
var inst_32281 = (state_32326[(10)]);
var inst_32283 = cljs.core.chunked_seq_QMARK_.call(null,inst_32281);
var state_32326__$1 = state_32326;
if(inst_32283){
var statearr_32338_32387 = state_32326__$1;
(statearr_32338_32387[(1)] = (16));

} else {
var statearr_32339_32388 = state_32326__$1;
(statearr_32339_32388[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (22))){
var inst_32311 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
if(cljs.core.truth_(inst_32311)){
var statearr_32340_32389 = state_32326__$1;
(statearr_32340_32389[(1)] = (23));

} else {
var statearr_32341_32390 = state_32326__$1;
(statearr_32341_32390[(1)] = (24));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (6))){
var inst_32307 = (state_32326[(11)]);
var inst_32305 = (state_32326[(7)]);
var inst_32257 = (state_32326[(8)]);
var inst_32305__$1 = topic_fn.call(null,inst_32257);
var inst_32306 = cljs.core.deref.call(null,mults);
var inst_32307__$1 = cljs.core.get.call(null,inst_32306,inst_32305__$1);
var state_32326__$1 = (function (){var statearr_32342 = state_32326;
(statearr_32342[(11)] = inst_32307__$1);

(statearr_32342[(7)] = inst_32305__$1);

return statearr_32342;
})();
if(cljs.core.truth_(inst_32307__$1)){
var statearr_32343_32391 = state_32326__$1;
(statearr_32343_32391[(1)] = (19));

} else {
var statearr_32344_32392 = state_32326__$1;
(statearr_32344_32392[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (25))){
var inst_32316 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32345_32393 = state_32326__$1;
(statearr_32345_32393[(2)] = inst_32316);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (17))){
var inst_32281 = (state_32326[(10)]);
var inst_32290 = cljs.core.first.call(null,inst_32281);
var inst_32291 = cljs.core.async.muxch_STAR_.call(null,inst_32290);
var inst_32292 = cljs.core.async.close_BANG_.call(null,inst_32291);
var inst_32293 = cljs.core.next.call(null,inst_32281);
var inst_32267 = inst_32293;
var inst_32268 = null;
var inst_32269 = (0);
var inst_32270 = (0);
var state_32326__$1 = (function (){var statearr_32346 = state_32326;
(statearr_32346[(12)] = inst_32269);

(statearr_32346[(13)] = inst_32270);

(statearr_32346[(14)] = inst_32267);

(statearr_32346[(15)] = inst_32292);

(statearr_32346[(16)] = inst_32268);

return statearr_32346;
})();
var statearr_32347_32394 = state_32326__$1;
(statearr_32347_32394[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (3))){
var inst_32324 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32326__$1,inst_32324);
} else {
if((state_val_32327 === (12))){
var inst_32301 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32348_32395 = state_32326__$1;
(statearr_32348_32395[(2)] = inst_32301);

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


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

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (19))){
var inst_32307 = (state_32326[(11)]);
var inst_32257 = (state_32326[(8)]);
var inst_32309 = cljs.core.async.muxch_STAR_.call(null,inst_32307);
var state_32326__$1 = state_32326;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32326__$1,(22),inst_32309,inst_32257);
} else {
if((state_val_32327 === (11))){
var inst_32281 = (state_32326[(10)]);
var inst_32267 = (state_32326[(14)]);
var inst_32281__$1 = cljs.core.seq.call(null,inst_32267);
var state_32326__$1 = (function (){var statearr_32350 = state_32326;
(statearr_32350[(10)] = inst_32281__$1);

return statearr_32350;
})();
if(inst_32281__$1){
var statearr_32351_32397 = state_32326__$1;
(statearr_32351_32397[(1)] = (13));

} else {
var statearr_32352_32398 = state_32326__$1;
(statearr_32352_32398[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (9))){
var inst_32303 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32353_32399 = state_32326__$1;
(statearr_32353_32399[(2)] = inst_32303);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (5))){
var inst_32264 = cljs.core.deref.call(null,mults);
var inst_32265 = cljs.core.vals.call(null,inst_32264);
var inst_32266 = cljs.core.seq.call(null,inst_32265);
var inst_32267 = inst_32266;
var inst_32268 = null;
var inst_32269 = (0);
var inst_32270 = (0);
var state_32326__$1 = (function (){var statearr_32354 = state_32326;
(statearr_32354[(12)] = inst_32269);

(statearr_32354[(13)] = inst_32270);

(statearr_32354[(14)] = inst_32267);

(statearr_32354[(16)] = inst_32268);

return statearr_32354;
})();
var statearr_32355_32400 = state_32326__$1;
(statearr_32355_32400[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (14))){
var state_32326__$1 = state_32326;
var statearr_32359_32401 = state_32326__$1;
(statearr_32359_32401[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (16))){
var inst_32281 = (state_32326[(10)]);
var inst_32285 = cljs.core.chunk_first.call(null,inst_32281);
var inst_32286 = cljs.core.chunk_rest.call(null,inst_32281);
var inst_32287 = cljs.core.count.call(null,inst_32285);
var inst_32267 = inst_32286;
var inst_32268 = inst_32285;
var inst_32269 = inst_32287;
var inst_32270 = (0);
var state_32326__$1 = (function (){var statearr_32360 = state_32326;
(statearr_32360[(12)] = inst_32269);

(statearr_32360[(13)] = inst_32270);

(statearr_32360[(14)] = inst_32267);

(statearr_32360[(16)] = inst_32268);

return statearr_32360;
})();
var statearr_32361_32402 = state_32326__$1;
(statearr_32361_32402[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (10))){
var inst_32269 = (state_32326[(12)]);
var inst_32270 = (state_32326[(13)]);
var inst_32267 = (state_32326[(14)]);
var inst_32268 = (state_32326[(16)]);
var inst_32275 = cljs.core._nth.call(null,inst_32268,inst_32270);
var inst_32276 = cljs.core.async.muxch_STAR_.call(null,inst_32275);
var inst_32277 = cljs.core.async.close_BANG_.call(null,inst_32276);
var inst_32278 = (inst_32270 + (1));
var tmp32356 = inst_32269;
var tmp32357 = inst_32267;
var tmp32358 = inst_32268;
var inst_32267__$1 = tmp32357;
var inst_32268__$1 = tmp32358;
var inst_32269__$1 = tmp32356;
var inst_32270__$1 = inst_32278;
var state_32326__$1 = (function (){var statearr_32362 = state_32326;
(statearr_32362[(17)] = inst_32277);

(statearr_32362[(12)] = inst_32269__$1);

(statearr_32362[(13)] = inst_32270__$1);

(statearr_32362[(14)] = inst_32267__$1);

(statearr_32362[(16)] = inst_32268__$1);

return statearr_32362;
})();
var statearr_32363_32403 = state_32326__$1;
(statearr_32363_32403[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (18))){
var inst_32296 = (state_32326[(2)]);
var state_32326__$1 = state_32326;
var statearr_32364_32404 = state_32326__$1;
(statearr_32364_32404[(2)] = inst_32296);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32327 === (8))){
var inst_32269 = (state_32326[(12)]);
var inst_32270 = (state_32326[(13)]);
var inst_32272 = (inst_32270 < inst_32269);
var inst_32273 = inst_32272;
var state_32326__$1 = state_32326;
if(cljs.core.truth_(inst_32273)){
var statearr_32365_32405 = state_32326__$1;
(statearr_32365_32405[(1)] = (10));

} else {
var statearr_32366_32406 = state_32326__$1;
(statearr_32366_32406[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32378,mults,ensure_mult,p))
;
return ((function (switch__30296__auto__,c__30410__auto___32378,mults,ensure_mult,p){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_32370 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32370[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_32370[(1)] = (1));

return statearr_32370;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_32326){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32326);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32371){if((e32371 instanceof Object)){
var ex__30300__auto__ = e32371;
var statearr_32372_32407 = state_32326;
(statearr_32372_32407[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32408 = state_32326;
state_32326 = G__32408;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_32326){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_32326);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32378,mults,ensure_mult,p))
})();
var state__30412__auto__ = (function (){var statearr_32373 = f__30411__auto__.call(null);
(statearr_32373[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32378);

return statearr_32373;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32378,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 args32409 = [];
var len__24369__auto___32412 = arguments.length;
var i__24370__auto___32413 = (0);
while(true){
if((i__24370__auto___32413 < len__24369__auto___32412)){
args32409.push((arguments[i__24370__auto___32413]));

var G__32414 = (i__24370__auto___32413 + (1));
i__24370__auto___32413 = G__32414;
continue;
} else {
}
break;
}

var G__32411 = args32409.length;
switch (G__32411) {
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(args32409.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 args32416 = [];
var len__24369__auto___32419 = arguments.length;
var i__24370__auto___32420 = (0);
while(true){
if((i__24370__auto___32420 < len__24369__auto___32419)){
args32416.push((arguments[i__24370__auto___32420]));

var G__32421 = (i__24370__auto___32420 + (1));
i__24370__auto___32420 = G__32421;
continue;
} else {
}
break;
}

var G__32418 = args32416.length;
switch (G__32418) {
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(args32416.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 args32423 = [];
var len__24369__auto___32494 = arguments.length;
var i__24370__auto___32495 = (0);
while(true){
if((i__24370__auto___32495 < len__24369__auto___32494)){
args32423.push((arguments[i__24370__auto___32495]));

var G__32496 = (i__24370__auto___32495 + (1));
i__24370__auto___32495 = G__32496;
continue;
} else {
}
break;
}

var G__32425 = args32423.length;
switch (G__32425) {
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(args32423.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__30410__auto___32498 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32498,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32498,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function (state_32464){
var state_val_32465 = (state_32464[(1)]);
if((state_val_32465 === (7))){
var state_32464__$1 = state_32464;
var statearr_32466_32499 = state_32464__$1;
(statearr_32466_32499[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (1))){
var state_32464__$1 = state_32464;
var statearr_32467_32500 = state_32464__$1;
(statearr_32467_32500[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (4))){
var inst_32428 = (state_32464[(7)]);
var inst_32430 = (inst_32428 < cnt);
var state_32464__$1 = state_32464;
if(cljs.core.truth_(inst_32430)){
var statearr_32468_32501 = state_32464__$1;
(statearr_32468_32501[(1)] = (6));

} else {
var statearr_32469_32502 = state_32464__$1;
(statearr_32469_32502[(1)] = (7));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (15))){
var inst_32460 = (state_32464[(2)]);
var state_32464__$1 = state_32464;
var statearr_32470_32503 = state_32464__$1;
(statearr_32470_32503[(2)] = inst_32460);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (13))){
var inst_32453 = cljs.core.async.close_BANG_.call(null,out);
var state_32464__$1 = state_32464;
var statearr_32471_32504 = state_32464__$1;
(statearr_32471_32504[(2)] = inst_32453);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (6))){
var state_32464__$1 = state_32464;
var statearr_32472_32505 = state_32464__$1;
(statearr_32472_32505[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (3))){
var inst_32462 = (state_32464[(2)]);
var state_32464__$1 = state_32464;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32464__$1,inst_32462);
} else {
if((state_val_32465 === (12))){
var inst_32450 = (state_32464[(8)]);
var inst_32450__$1 = (state_32464[(2)]);
var inst_32451 = cljs.core.some.call(null,cljs.core.nil_QMARK_,inst_32450__$1);
var state_32464__$1 = (function (){var statearr_32473 = state_32464;
(statearr_32473[(8)] = inst_32450__$1);

return statearr_32473;
})();
if(cljs.core.truth_(inst_32451)){
var statearr_32474_32506 = state_32464__$1;
(statearr_32474_32506[(1)] = (13));

} else {
var statearr_32475_32507 = state_32464__$1;
(statearr_32475_32507[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (2))){
var inst_32427 = cljs.core.reset_BANG_.call(null,dctr,cnt);
var inst_32428 = (0);
var state_32464__$1 = (function (){var statearr_32476 = state_32464;
(statearr_32476[(7)] = inst_32428);

(statearr_32476[(9)] = inst_32427);

return statearr_32476;
})();
var statearr_32477_32508 = state_32464__$1;
(statearr_32477_32508[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (11))){
var inst_32428 = (state_32464[(7)]);
var _ = cljs.core.async.impl.ioc_helpers.add_exception_frame.call(null,state_32464,(10),Object,null,(9));
var inst_32437 = chs__$1.call(null,inst_32428);
var inst_32438 = done.call(null,inst_32428);
var inst_32439 = cljs.core.async.take_BANG_.call(null,inst_32437,inst_32438);
var state_32464__$1 = state_32464;
var statearr_32478_32509 = state_32464__$1;
(statearr_32478_32509[(2)] = inst_32439);


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

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (9))){
var inst_32428 = (state_32464[(7)]);
var inst_32441 = (state_32464[(2)]);
var inst_32442 = (inst_32428 + (1));
var inst_32428__$1 = inst_32442;
var state_32464__$1 = (function (){var statearr_32479 = state_32464;
(statearr_32479[(10)] = inst_32441);

(statearr_32479[(7)] = inst_32428__$1);

return statearr_32479;
})();
var statearr_32480_32510 = state_32464__$1;
(statearr_32480_32510[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (5))){
var inst_32448 = (state_32464[(2)]);
var state_32464__$1 = (function (){var statearr_32481 = state_32464;
(statearr_32481[(11)] = inst_32448);

return statearr_32481;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32464__$1,(12),dchan);
} else {
if((state_val_32465 === (14))){
var inst_32450 = (state_32464[(8)]);
var inst_32455 = cljs.core.apply.call(null,f,inst_32450);
var state_32464__$1 = state_32464;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32464__$1,(16),out,inst_32455);
} else {
if((state_val_32465 === (16))){
var inst_32457 = (state_32464[(2)]);
var state_32464__$1 = (function (){var statearr_32482 = state_32464;
(statearr_32482[(12)] = inst_32457);

return statearr_32482;
})();
var statearr_32483_32511 = state_32464__$1;
(statearr_32483_32511[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (10))){
var inst_32432 = (state_32464[(2)]);
var inst_32433 = cljs.core.swap_BANG_.call(null,dctr,cljs.core.dec);
var state_32464__$1 = (function (){var statearr_32484 = state_32464;
(statearr_32484[(13)] = inst_32432);

return statearr_32484;
})();
var statearr_32485_32512 = state_32464__$1;
(statearr_32485_32512[(2)] = inst_32433);


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

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32465 === (8))){
var inst_32446 = (state_32464[(2)]);
var state_32464__$1 = state_32464;
var statearr_32486_32513 = state_32464__$1;
(statearr_32486_32513[(2)] = inst_32446);

(statearr_32486_32513[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32498,chs__$1,out,cnt,rets,dchan,dctr,done))
;
return ((function (switch__30296__auto__,c__30410__auto___32498,chs__$1,out,cnt,rets,dchan,dctr,done){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_32490 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32490[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_32490[(1)] = (1));

return statearr_32490;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_32464){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32464);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32491){if((e32491 instanceof Object)){
var ex__30300__auto__ = e32491;
var statearr_32492_32514 = state_32464;
(statearr_32492_32514[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32515 = state_32464;
state_32464 = G__32515;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_32464){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_32464);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32498,chs__$1,out,cnt,rets,dchan,dctr,done))
})();
var state__30412__auto__ = (function (){var statearr_32493 = f__30411__auto__.call(null);
(statearr_32493[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32498);

return statearr_32493;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32498,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 args32517 = [];
var len__24369__auto___32575 = arguments.length;
var i__24370__auto___32576 = (0);
while(true){
if((i__24370__auto___32576 < len__24369__auto___32575)){
args32517.push((arguments[i__24370__auto___32576]));

var G__32577 = (i__24370__auto___32576 + (1));
i__24370__auto___32576 = G__32577;
continue;
} else {
}
break;
}

var G__32519 = args32517.length;
switch (G__32519) {
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(args32517.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__30410__auto___32579 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32579,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32579,out){
return (function (state_32551){
var state_val_32552 = (state_32551[(1)]);
if((state_val_32552 === (7))){
var inst_32530 = (state_32551[(7)]);
var inst_32531 = (state_32551[(8)]);
var inst_32530__$1 = (state_32551[(2)]);
var inst_32531__$1 = cljs.core.nth.call(null,inst_32530__$1,(0),null);
var inst_32532 = cljs.core.nth.call(null,inst_32530__$1,(1),null);
var inst_32533 = (inst_32531__$1 == null);
var state_32551__$1 = (function (){var statearr_32553 = state_32551;
(statearr_32553[(9)] = inst_32532);

(statearr_32553[(7)] = inst_32530__$1);

(statearr_32553[(8)] = inst_32531__$1);

return statearr_32553;
})();
if(cljs.core.truth_(inst_32533)){
var statearr_32554_32580 = state_32551__$1;
(statearr_32554_32580[(1)] = (8));

} else {
var statearr_32555_32581 = state_32551__$1;
(statearr_32555_32581[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (1))){
var inst_32520 = cljs.core.vec.call(null,chs);
var inst_32521 = inst_32520;
var state_32551__$1 = (function (){var statearr_32556 = state_32551;
(statearr_32556[(10)] = inst_32521);

return statearr_32556;
})();
var statearr_32557_32582 = state_32551__$1;
(statearr_32557_32582[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (4))){
var inst_32521 = (state_32551[(10)]);
var state_32551__$1 = state_32551;
return cljs.core.async.ioc_alts_BANG_.call(null,state_32551__$1,(7),inst_32521);
} else {
if((state_val_32552 === (6))){
var inst_32547 = (state_32551[(2)]);
var state_32551__$1 = state_32551;
var statearr_32558_32583 = state_32551__$1;
(statearr_32558_32583[(2)] = inst_32547);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (3))){
var inst_32549 = (state_32551[(2)]);
var state_32551__$1 = state_32551;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32551__$1,inst_32549);
} else {
if((state_val_32552 === (2))){
var inst_32521 = (state_32551[(10)]);
var inst_32523 = cljs.core.count.call(null,inst_32521);
var inst_32524 = (inst_32523 > (0));
var state_32551__$1 = state_32551;
if(cljs.core.truth_(inst_32524)){
var statearr_32560_32584 = state_32551__$1;
(statearr_32560_32584[(1)] = (4));

} else {
var statearr_32561_32585 = state_32551__$1;
(statearr_32561_32585[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (11))){
var inst_32521 = (state_32551[(10)]);
var inst_32540 = (state_32551[(2)]);
var tmp32559 = inst_32521;
var inst_32521__$1 = tmp32559;
var state_32551__$1 = (function (){var statearr_32562 = state_32551;
(statearr_32562[(11)] = inst_32540);

(statearr_32562[(10)] = inst_32521__$1);

return statearr_32562;
})();
var statearr_32563_32586 = state_32551__$1;
(statearr_32563_32586[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (9))){
var inst_32531 = (state_32551[(8)]);
var state_32551__$1 = state_32551;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32551__$1,(11),out,inst_32531);
} else {
if((state_val_32552 === (5))){
var inst_32545 = cljs.core.async.close_BANG_.call(null,out);
var state_32551__$1 = state_32551;
var statearr_32564_32587 = state_32551__$1;
(statearr_32564_32587[(2)] = inst_32545);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (10))){
var inst_32543 = (state_32551[(2)]);
var state_32551__$1 = state_32551;
var statearr_32565_32588 = state_32551__$1;
(statearr_32565_32588[(2)] = inst_32543);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32552 === (8))){
var inst_32521 = (state_32551[(10)]);
var inst_32532 = (state_32551[(9)]);
var inst_32530 = (state_32551[(7)]);
var inst_32531 = (state_32551[(8)]);
var inst_32535 = (function (){var cs = inst_32521;
var vec__32526 = inst_32530;
var v = inst_32531;
var c = inst_32532;
return ((function (cs,vec__32526,v,c,inst_32521,inst_32532,inst_32530,inst_32531,state_val_32552,c__30410__auto___32579,out){
return (function (p1__32516_SHARP_){
return cljs.core.not_EQ_.call(null,c,p1__32516_SHARP_);
});
;})(cs,vec__32526,v,c,inst_32521,inst_32532,inst_32530,inst_32531,state_val_32552,c__30410__auto___32579,out))
})();
var inst_32536 = cljs.core.filterv.call(null,inst_32535,inst_32521);
var inst_32521__$1 = inst_32536;
var state_32551__$1 = (function (){var statearr_32566 = state_32551;
(statearr_32566[(10)] = inst_32521__$1);

return statearr_32566;
})();
var statearr_32567_32589 = state_32551__$1;
(statearr_32567_32589[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32579,out))
;
return ((function (switch__30296__auto__,c__30410__auto___32579,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_32571 = [null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32571[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_32571[(1)] = (1));

return statearr_32571;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_32551){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32551);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32572){if((e32572 instanceof Object)){
var ex__30300__auto__ = e32572;
var statearr_32573_32590 = state_32551;
(statearr_32573_32590[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32591 = state_32551;
state_32551 = G__32591;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_32551){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_32551);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32579,out))
})();
var state__30412__auto__ = (function (){var statearr_32574 = f__30411__auto__.call(null);
(statearr_32574[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32579);

return statearr_32574;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32579,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 args32592 = [];
var len__24369__auto___32641 = arguments.length;
var i__24370__auto___32642 = (0);
while(true){
if((i__24370__auto___32642 < len__24369__auto___32641)){
args32592.push((arguments[i__24370__auto___32642]));

var G__32643 = (i__24370__auto___32642 + (1));
i__24370__auto___32642 = G__32643;
continue;
} else {
}
break;
}

var G__32594 = args32592.length;
switch (G__32594) {
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(args32592.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__30410__auto___32645 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32645,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32645,out){
return (function (state_32618){
var state_val_32619 = (state_32618[(1)]);
if((state_val_32619 === (7))){
var inst_32600 = (state_32618[(7)]);
var inst_32600__$1 = (state_32618[(2)]);
var inst_32601 = (inst_32600__$1 == null);
var inst_32602 = cljs.core.not.call(null,inst_32601);
var state_32618__$1 = (function (){var statearr_32620 = state_32618;
(statearr_32620[(7)] = inst_32600__$1);

return statearr_32620;
})();
if(inst_32602){
var statearr_32621_32646 = state_32618__$1;
(statearr_32621_32646[(1)] = (8));

} else {
var statearr_32622_32647 = state_32618__$1;
(statearr_32622_32647[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (1))){
var inst_32595 = (0);
var state_32618__$1 = (function (){var statearr_32623 = state_32618;
(statearr_32623[(8)] = inst_32595);

return statearr_32623;
})();
var statearr_32624_32648 = state_32618__$1;
(statearr_32624_32648[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (4))){
var state_32618__$1 = state_32618;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32618__$1,(7),ch);
} else {
if((state_val_32619 === (6))){
var inst_32613 = (state_32618[(2)]);
var state_32618__$1 = state_32618;
var statearr_32625_32649 = state_32618__$1;
(statearr_32625_32649[(2)] = inst_32613);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (3))){
var inst_32615 = (state_32618[(2)]);
var inst_32616 = cljs.core.async.close_BANG_.call(null,out);
var state_32618__$1 = (function (){var statearr_32626 = state_32618;
(statearr_32626[(9)] = inst_32615);

return statearr_32626;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32618__$1,inst_32616);
} else {
if((state_val_32619 === (2))){
var inst_32595 = (state_32618[(8)]);
var inst_32597 = (inst_32595 < n);
var state_32618__$1 = state_32618;
if(cljs.core.truth_(inst_32597)){
var statearr_32627_32650 = state_32618__$1;
(statearr_32627_32650[(1)] = (4));

} else {
var statearr_32628_32651 = state_32618__$1;
(statearr_32628_32651[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (11))){
var inst_32595 = (state_32618[(8)]);
var inst_32605 = (state_32618[(2)]);
var inst_32606 = (inst_32595 + (1));
var inst_32595__$1 = inst_32606;
var state_32618__$1 = (function (){var statearr_32629 = state_32618;
(statearr_32629[(8)] = inst_32595__$1);

(statearr_32629[(10)] = inst_32605);

return statearr_32629;
})();
var statearr_32630_32652 = state_32618__$1;
(statearr_32630_32652[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (9))){
var state_32618__$1 = state_32618;
var statearr_32631_32653 = state_32618__$1;
(statearr_32631_32653[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (5))){
var state_32618__$1 = state_32618;
var statearr_32632_32654 = state_32618__$1;
(statearr_32632_32654[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (10))){
var inst_32610 = (state_32618[(2)]);
var state_32618__$1 = state_32618;
var statearr_32633_32655 = state_32618__$1;
(statearr_32633_32655[(2)] = inst_32610);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32619 === (8))){
var inst_32600 = (state_32618[(7)]);
var state_32618__$1 = state_32618;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32618__$1,(11),out,inst_32600);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32645,out))
;
return ((function (switch__30296__auto__,c__30410__auto___32645,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_32637 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_32637[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_32637[(1)] = (1));

return statearr_32637;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_32618){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32618);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32638){if((e32638 instanceof Object)){
var ex__30300__auto__ = e32638;
var statearr_32639_32656 = state_32618;
(statearr_32639_32656[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32657 = state_32618;
state_32618 = G__32657;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_32618){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_32618);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32645,out))
})();
var state__30412__auto__ = (function (){var statearr_32640 = f__30411__auto__.call(null);
(statearr_32640[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32645);

return statearr_32640;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32645,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$async32665 !== '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$async32665 = (function (f,ch,meta32666){
this.f = f;
this.ch = ch;
this.meta32666 = meta32666;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32665.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_32667,meta32666__$1){
var self__ = this;
var _32667__$1 = this;
return (new cljs.core.async.t_cljs$core$async32665(self__.f,self__.ch,meta32666__$1));
});

cljs.core.async.t_cljs$core$async32665.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_32667){
var self__ = this;
var _32667__$1 = this;
return self__.meta32666;
});

cljs.core.async.t_cljs$core$async32665.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32665.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$async32665.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$async32665.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32665.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$async32668 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {cljs.core.async.impl.protocols.Handler}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
cljs.core.async.t_cljs$core$async32668 = (function (f,ch,meta32666,_,fn1,meta32669){
this.f = f;
this.ch = ch;
this.meta32666 = meta32666;
this._ = _;
this.fn1 = fn1;
this.meta32669 = meta32669;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32668.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (___$1){
return (function (_32670,meta32669__$1){
var self__ = this;
var _32670__$1 = this;
return (new cljs.core.async.t_cljs$core$async32668(self__.f,self__.ch,self__.meta32666,self__._,self__.fn1,meta32669__$1));
});})(___$1))
;

cljs.core.async.t_cljs$core$async32668.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (___$1){
return (function (_32670){
var self__ = this;
var _32670__$1 = this;
return self__.meta32669;
});})(___$1))
;

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

cljs.core.async.t_cljs$core$async32668.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$async32668.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$async32668.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__32658_SHARP_){
return f1.call(null,(((p1__32658_SHARP_ == null))?null:self__.f.call(null,p1__32658_SHARP_)));
});
;})(f1,___$2,___$1))
});})(___$1))
;

cljs.core.async.t_cljs$core$async32668.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,"meta32666","meta32666",1377074124,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$async32665","cljs.core.async/t_cljs$core$async32665",1585159772,null)], null)),new cljs.core.Symbol(null,"fn1","fn1",895834444,null),new cljs.core.Symbol(null,"meta32669","meta32669",-1093481104,null)], null);
});})(___$1))
;

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

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

cljs.core.async.t_cljs$core$async32668.cljs$lang$ctorPrWriter = ((function (___$1){
return (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32668");
});})(___$1))
;

cljs.core.async.__GT_t_cljs$core$async32668 = ((function (___$1){
return (function cljs$core$async$map_LT__$___GT_t_cljs$core$async32668(f__$1,ch__$1,meta32666__$1,___$2,fn1__$1,meta32669){
return (new cljs.core.async.t_cljs$core$async32668(f__$1,ch__$1,meta32666__$1,___$2,fn1__$1,meta32669));
});})(___$1))
;

}

return (new cljs.core.async.t_cljs$core$async32668(self__.f,self__.ch,self__.meta32666,___$1,fn1,cljs.core.PersistentArrayMap.EMPTY));
})()
);
if(cljs.core.truth_((function (){var and__23136__auto__ = ret;
if(cljs.core.truth_(and__23136__auto__)){
return !((cljs.core.deref.call(null,ret) == null));
} else {
return and__23136__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$async32665.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32665.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$async32665.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,"meta32666","meta32666",1377074124,null)], null);
});

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

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

cljs.core.async.t_cljs$core$async32665.cljs$lang$ctorPrWriter = (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32665");
});

cljs.core.async.__GT_t_cljs$core$async32665 = (function cljs$core$async$map_LT__$___GT_t_cljs$core$async32665(f__$1,ch__$1,meta32666){
return (new cljs.core.async.t_cljs$core$async32665(f__$1,ch__$1,meta32666));
});

}

return (new cljs.core.async.t_cljs$core$async32665(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$async32674 !== '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$async32674 = (function (f,ch,meta32675){
this.f = f;
this.ch = ch;
this.meta32675 = meta32675;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32674.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_32676,meta32675__$1){
var self__ = this;
var _32676__$1 = this;
return (new cljs.core.async.t_cljs$core$async32674(self__.f,self__.ch,meta32675__$1));
});

cljs.core.async.t_cljs$core$async32674.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_32676){
var self__ = this;
var _32676__$1 = this;
return self__.meta32675;
});

cljs.core.async.t_cljs$core$async32674.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32674.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$async32674.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32674.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$async32674.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32674.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$async32674.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,"meta32675","meta32675",1528629600,null)], null);
});

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

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

cljs.core.async.t_cljs$core$async32674.cljs$lang$ctorPrWriter = (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32674");
});

cljs.core.async.__GT_t_cljs$core$async32674 = (function cljs$core$async$map_GT__$___GT_t_cljs$core$async32674(f__$1,ch__$1,meta32675){
return (new cljs.core.async.t_cljs$core$async32674(f__$1,ch__$1,meta32675));
});

}

return (new cljs.core.async.t_cljs$core$async32674(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$async32680 !== '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$async32680 = (function (p,ch,meta32681){
this.p = p;
this.ch = ch;
this.meta32681 = meta32681;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
cljs.core.async.t_cljs$core$async32680.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_32682,meta32681__$1){
var self__ = this;
var _32682__$1 = this;
return (new cljs.core.async.t_cljs$core$async32680(self__.p,self__.ch,meta32681__$1));
});

cljs.core.async.t_cljs$core$async32680.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_32682){
var self__ = this;
var _32682__$1 = this;
return self__.meta32681;
});

cljs.core.async.t_cljs$core$async32680.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32680.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$async32680.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$async32680.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32680.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$async32680.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.async.t_cljs$core$async32680.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$async32680.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,"meta32681","meta32681",-249755155,null)], null);
});

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

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

cljs.core.async.t_cljs$core$async32680.cljs$lang$ctorPrWriter = (function (this__23805__auto__,writer__23806__auto__,opt__23807__auto__){
return cljs.core._write.call(null,writer__23806__auto__,"cljs.core.async/t_cljs$core$async32680");
});

cljs.core.async.__GT_t_cljs$core$async32680 = (function cljs$core$async$filter_GT__$___GT_t_cljs$core$async32680(p__$1,ch__$1,meta32681){
return (new cljs.core.async.t_cljs$core$async32680(p__$1,ch__$1,meta32681));
});

}

return (new cljs.core.async.t_cljs$core$async32680(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 args32683 = [];
var len__24369__auto___32727 = arguments.length;
var i__24370__auto___32728 = (0);
while(true){
if((i__24370__auto___32728 < len__24369__auto___32727)){
args32683.push((arguments[i__24370__auto___32728]));

var G__32729 = (i__24370__auto___32728 + (1));
i__24370__auto___32728 = G__32729;
continue;
} else {
}
break;
}

var G__32685 = args32683.length;
switch (G__32685) {
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(args32683.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__30410__auto___32731 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___32731,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___32731,out){
return (function (state_32706){
var state_val_32707 = (state_32706[(1)]);
if((state_val_32707 === (7))){
var inst_32702 = (state_32706[(2)]);
var state_32706__$1 = state_32706;
var statearr_32708_32732 = state_32706__$1;
(statearr_32708_32732[(2)] = inst_32702);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (1))){
var state_32706__$1 = state_32706;
var statearr_32709_32733 = state_32706__$1;
(statearr_32709_32733[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (4))){
var inst_32688 = (state_32706[(7)]);
var inst_32688__$1 = (state_32706[(2)]);
var inst_32689 = (inst_32688__$1 == null);
var state_32706__$1 = (function (){var statearr_32710 = state_32706;
(statearr_32710[(7)] = inst_32688__$1);

return statearr_32710;
})();
if(cljs.core.truth_(inst_32689)){
var statearr_32711_32734 = state_32706__$1;
(statearr_32711_32734[(1)] = (5));

} else {
var statearr_32712_32735 = state_32706__$1;
(statearr_32712_32735[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (6))){
var inst_32688 = (state_32706[(7)]);
var inst_32693 = p.call(null,inst_32688);
var state_32706__$1 = state_32706;
if(cljs.core.truth_(inst_32693)){
var statearr_32713_32736 = state_32706__$1;
(statearr_32713_32736[(1)] = (8));

} else {
var statearr_32714_32737 = state_32706__$1;
(statearr_32714_32737[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (3))){
var inst_32704 = (state_32706[(2)]);
var state_32706__$1 = state_32706;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32706__$1,inst_32704);
} else {
if((state_val_32707 === (2))){
var state_32706__$1 = state_32706;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32706__$1,(4),ch);
} else {
if((state_val_32707 === (11))){
var inst_32696 = (state_32706[(2)]);
var state_32706__$1 = state_32706;
var statearr_32715_32738 = state_32706__$1;
(statearr_32715_32738[(2)] = inst_32696);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (9))){
var state_32706__$1 = state_32706;
var statearr_32716_32739 = state_32706__$1;
(statearr_32716_32739[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (5))){
var inst_32691 = cljs.core.async.close_BANG_.call(null,out);
var state_32706__$1 = state_32706;
var statearr_32717_32740 = state_32706__$1;
(statearr_32717_32740[(2)] = inst_32691);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (10))){
var inst_32699 = (state_32706[(2)]);
var state_32706__$1 = (function (){var statearr_32718 = state_32706;
(statearr_32718[(8)] = inst_32699);

return statearr_32718;
})();
var statearr_32719_32741 = state_32706__$1;
(statearr_32719_32741[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32707 === (8))){
var inst_32688 = (state_32706[(7)]);
var state_32706__$1 = state_32706;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32706__$1,(11),out,inst_32688);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___32731,out))
;
return ((function (switch__30296__auto__,c__30410__auto___32731,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_32723 = [null,null,null,null,null,null,null,null,null];
(statearr_32723[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_32723[(1)] = (1));

return statearr_32723;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_32706){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32706);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32724){if((e32724 instanceof Object)){
var ex__30300__auto__ = e32724;
var statearr_32725_32742 = state_32706;
(statearr_32725_32742[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32743 = state_32706;
state_32706 = G__32743;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_32706){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_32706);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___32731,out))
})();
var state__30412__auto__ = (function (){var statearr_32726 = f__30411__auto__.call(null);
(statearr_32726[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___32731);

return statearr_32726;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___32731,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 args32744 = [];
var len__24369__auto___32747 = arguments.length;
var i__24370__auto___32748 = (0);
while(true){
if((i__24370__auto___32748 < len__24369__auto___32747)){
args32744.push((arguments[i__24370__auto___32748]));

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

var G__32746 = args32744.length;
switch (G__32746) {
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(args32744.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__30410__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto__){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto__){
return (function (state_32916){
var state_val_32917 = (state_32916[(1)]);
if((state_val_32917 === (7))){
var inst_32912 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
var statearr_32918_32959 = state_32916__$1;
(statearr_32918_32959[(2)] = inst_32912);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (20))){
var inst_32882 = (state_32916[(7)]);
var inst_32893 = (state_32916[(2)]);
var inst_32894 = cljs.core.next.call(null,inst_32882);
var inst_32868 = inst_32894;
var inst_32869 = null;
var inst_32870 = (0);
var inst_32871 = (0);
var state_32916__$1 = (function (){var statearr_32919 = state_32916;
(statearr_32919[(8)] = inst_32893);

(statearr_32919[(9)] = inst_32868);

(statearr_32919[(10)] = inst_32870);

(statearr_32919[(11)] = inst_32871);

(statearr_32919[(12)] = inst_32869);

return statearr_32919;
})();
var statearr_32920_32960 = state_32916__$1;
(statearr_32920_32960[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (1))){
var state_32916__$1 = state_32916;
var statearr_32921_32961 = state_32916__$1;
(statearr_32921_32961[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (4))){
var inst_32857 = (state_32916[(13)]);
var inst_32857__$1 = (state_32916[(2)]);
var inst_32858 = (inst_32857__$1 == null);
var state_32916__$1 = (function (){var statearr_32922 = state_32916;
(statearr_32922[(13)] = inst_32857__$1);

return statearr_32922;
})();
if(cljs.core.truth_(inst_32858)){
var statearr_32923_32962 = state_32916__$1;
(statearr_32923_32962[(1)] = (5));

} else {
var statearr_32924_32963 = state_32916__$1;
(statearr_32924_32963[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (15))){
var state_32916__$1 = state_32916;
var statearr_32928_32964 = state_32916__$1;
(statearr_32928_32964[(2)] = null);

(statearr_32928_32964[(1)] = (16));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (21))){
var state_32916__$1 = state_32916;
var statearr_32929_32965 = state_32916__$1;
(statearr_32929_32965[(2)] = null);

(statearr_32929_32965[(1)] = (23));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (13))){
var inst_32868 = (state_32916[(9)]);
var inst_32870 = (state_32916[(10)]);
var inst_32871 = (state_32916[(11)]);
var inst_32869 = (state_32916[(12)]);
var inst_32878 = (state_32916[(2)]);
var inst_32879 = (inst_32871 + (1));
var tmp32925 = inst_32868;
var tmp32926 = inst_32870;
var tmp32927 = inst_32869;
var inst_32868__$1 = tmp32925;
var inst_32869__$1 = tmp32927;
var inst_32870__$1 = tmp32926;
var inst_32871__$1 = inst_32879;
var state_32916__$1 = (function (){var statearr_32930 = state_32916;
(statearr_32930[(14)] = inst_32878);

(statearr_32930[(9)] = inst_32868__$1);

(statearr_32930[(10)] = inst_32870__$1);

(statearr_32930[(11)] = inst_32871__$1);

(statearr_32930[(12)] = inst_32869__$1);

return statearr_32930;
})();
var statearr_32931_32966 = state_32916__$1;
(statearr_32931_32966[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (22))){
var state_32916__$1 = state_32916;
var statearr_32932_32967 = state_32916__$1;
(statearr_32932_32967[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (6))){
var inst_32857 = (state_32916[(13)]);
var inst_32866 = f.call(null,inst_32857);
var inst_32867 = cljs.core.seq.call(null,inst_32866);
var inst_32868 = inst_32867;
var inst_32869 = null;
var inst_32870 = (0);
var inst_32871 = (0);
var state_32916__$1 = (function (){var statearr_32933 = state_32916;
(statearr_32933[(9)] = inst_32868);

(statearr_32933[(10)] = inst_32870);

(statearr_32933[(11)] = inst_32871);

(statearr_32933[(12)] = inst_32869);

return statearr_32933;
})();
var statearr_32934_32968 = state_32916__$1;
(statearr_32934_32968[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (17))){
var inst_32882 = (state_32916[(7)]);
var inst_32886 = cljs.core.chunk_first.call(null,inst_32882);
var inst_32887 = cljs.core.chunk_rest.call(null,inst_32882);
var inst_32888 = cljs.core.count.call(null,inst_32886);
var inst_32868 = inst_32887;
var inst_32869 = inst_32886;
var inst_32870 = inst_32888;
var inst_32871 = (0);
var state_32916__$1 = (function (){var statearr_32935 = state_32916;
(statearr_32935[(9)] = inst_32868);

(statearr_32935[(10)] = inst_32870);

(statearr_32935[(11)] = inst_32871);

(statearr_32935[(12)] = inst_32869);

return statearr_32935;
})();
var statearr_32936_32969 = state_32916__$1;
(statearr_32936_32969[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (3))){
var inst_32914 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_32916__$1,inst_32914);
} else {
if((state_val_32917 === (12))){
var inst_32902 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
var statearr_32937_32970 = state_32916__$1;
(statearr_32937_32970[(2)] = inst_32902);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (2))){
var state_32916__$1 = state_32916;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_32916__$1,(4),in$);
} else {
if((state_val_32917 === (23))){
var inst_32910 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
var statearr_32938_32971 = state_32916__$1;
(statearr_32938_32971[(2)] = inst_32910);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (19))){
var inst_32897 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
var statearr_32939_32972 = state_32916__$1;
(statearr_32939_32972[(2)] = inst_32897);

(statearr_32939_32972[(1)] = (16));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (11))){
var inst_32882 = (state_32916[(7)]);
var inst_32868 = (state_32916[(9)]);
var inst_32882__$1 = cljs.core.seq.call(null,inst_32868);
var state_32916__$1 = (function (){var statearr_32940 = state_32916;
(statearr_32940[(7)] = inst_32882__$1);

return statearr_32940;
})();
if(inst_32882__$1){
var statearr_32941_32973 = state_32916__$1;
(statearr_32941_32973[(1)] = (14));

} else {
var statearr_32942_32974 = state_32916__$1;
(statearr_32942_32974[(1)] = (15));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (9))){
var inst_32904 = (state_32916[(2)]);
var inst_32905 = cljs.core.async.impl.protocols.closed_QMARK_.call(null,out);
var state_32916__$1 = (function (){var statearr_32943 = state_32916;
(statearr_32943[(15)] = inst_32904);

return statearr_32943;
})();
if(cljs.core.truth_(inst_32905)){
var statearr_32944_32975 = state_32916__$1;
(statearr_32944_32975[(1)] = (21));

} else {
var statearr_32945_32976 = state_32916__$1;
(statearr_32945_32976[(1)] = (22));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (5))){
var inst_32860 = cljs.core.async.close_BANG_.call(null,out);
var state_32916__$1 = state_32916;
var statearr_32946_32977 = state_32916__$1;
(statearr_32946_32977[(2)] = inst_32860);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (14))){
var inst_32882 = (state_32916[(7)]);
var inst_32884 = cljs.core.chunked_seq_QMARK_.call(null,inst_32882);
var state_32916__$1 = state_32916;
if(inst_32884){
var statearr_32947_32978 = state_32916__$1;
(statearr_32947_32978[(1)] = (17));

} else {
var statearr_32948_32979 = state_32916__$1;
(statearr_32948_32979[(1)] = (18));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (16))){
var inst_32900 = (state_32916[(2)]);
var state_32916__$1 = state_32916;
var statearr_32949_32980 = state_32916__$1;
(statearr_32949_32980[(2)] = inst_32900);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_32917 === (10))){
var inst_32871 = (state_32916[(11)]);
var inst_32869 = (state_32916[(12)]);
var inst_32876 = cljs.core._nth.call(null,inst_32869,inst_32871);
var state_32916__$1 = state_32916;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32916__$1,(13),out,inst_32876);
} else {
if((state_val_32917 === (18))){
var inst_32882 = (state_32916[(7)]);
var inst_32891 = cljs.core.first.call(null,inst_32882);
var state_32916__$1 = state_32916;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_32916__$1,(20),out,inst_32891);
} else {
if((state_val_32917 === (8))){
var inst_32870 = (state_32916[(10)]);
var inst_32871 = (state_32916[(11)]);
var inst_32873 = (inst_32871 < inst_32870);
var inst_32874 = inst_32873;
var state_32916__$1 = state_32916;
if(cljs.core.truth_(inst_32874)){
var statearr_32950_32981 = state_32916__$1;
(statearr_32950_32981[(1)] = (10));

} else {
var statearr_32951_32982 = state_32916__$1;
(statearr_32951_32982[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto__))
;
return ((function (switch__30296__auto__,c__30410__auto__){
return (function() {
var cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__ = null;
var cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____0 = (function (){
var statearr_32955 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_32955[(0)] = cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__);

(statearr_32955[(1)] = (1));

return statearr_32955;
});
var cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____1 = (function (state_32916){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_32916);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e32956){if((e32956 instanceof Object)){
var ex__30300__auto__ = e32956;
var statearr_32957_32983 = state_32916;
(statearr_32957_32983[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__32984 = state_32916;
state_32916 = G__32984;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__ = function(state_32916){
switch(arguments.length){
case 0:
return cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____1.call(this,state_32916);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____0;
cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$mapcat_STAR__$_state_machine__30297__auto____1;
return cljs$core$async$mapcat_STAR__$_state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto__))
})();
var state__30412__auto__ = (function (){var statearr_32958 = f__30411__auto__.call(null);
(statearr_32958[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto__);

return statearr_32958;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto__))
);

return c__30410__auto__;
});
/**
 * Deprecated - this function will be removed. Use transducer instead
 */
cljs.core.async.mapcat_LT_ = (function cljs$core$async$mapcat_LT_(var_args){
var args32985 = [];
var len__24369__auto___32988 = arguments.length;
var i__24370__auto___32989 = (0);
while(true){
if((i__24370__auto___32989 < len__24369__auto___32988)){
args32985.push((arguments[i__24370__auto___32989]));

var G__32990 = (i__24370__auto___32989 + (1));
i__24370__auto___32989 = G__32990;
continue;
} else {
}
break;
}

var G__32987 = args32985.length;
switch (G__32987) {
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(args32985.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 args32992 = [];
var len__24369__auto___32995 = arguments.length;
var i__24370__auto___32996 = (0);
while(true){
if((i__24370__auto___32996 < len__24369__auto___32995)){
args32992.push((arguments[i__24370__auto___32996]));

var G__32997 = (i__24370__auto___32996 + (1));
i__24370__auto___32996 = G__32997;
continue;
} else {
}
break;
}

var G__32994 = args32992.length;
switch (G__32994) {
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(args32992.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 args32999 = [];
var len__24369__auto___33050 = arguments.length;
var i__24370__auto___33051 = (0);
while(true){
if((i__24370__auto___33051 < len__24369__auto___33050)){
args32999.push((arguments[i__24370__auto___33051]));

var G__33052 = (i__24370__auto___33051 + (1));
i__24370__auto___33051 = G__33052;
continue;
} else {
}
break;
}

var G__33001 = args32999.length;
switch (G__33001) {
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(args32999.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__30410__auto___33054 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___33054,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___33054,out){
return (function (state_33025){
var state_val_33026 = (state_33025[(1)]);
if((state_val_33026 === (7))){
var inst_33020 = (state_33025[(2)]);
var state_33025__$1 = state_33025;
var statearr_33027_33055 = state_33025__$1;
(statearr_33027_33055[(2)] = inst_33020);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (1))){
var inst_33002 = null;
var state_33025__$1 = (function (){var statearr_33028 = state_33025;
(statearr_33028[(7)] = inst_33002);

return statearr_33028;
})();
var statearr_33029_33056 = state_33025__$1;
(statearr_33029_33056[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (4))){
var inst_33005 = (state_33025[(8)]);
var inst_33005__$1 = (state_33025[(2)]);
var inst_33006 = (inst_33005__$1 == null);
var inst_33007 = cljs.core.not.call(null,inst_33006);
var state_33025__$1 = (function (){var statearr_33030 = state_33025;
(statearr_33030[(8)] = inst_33005__$1);

return statearr_33030;
})();
if(inst_33007){
var statearr_33031_33057 = state_33025__$1;
(statearr_33031_33057[(1)] = (5));

} else {
var statearr_33032_33058 = state_33025__$1;
(statearr_33032_33058[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (6))){
var state_33025__$1 = state_33025;
var statearr_33033_33059 = state_33025__$1;
(statearr_33033_33059[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (3))){
var inst_33022 = (state_33025[(2)]);
var inst_33023 = cljs.core.async.close_BANG_.call(null,out);
var state_33025__$1 = (function (){var statearr_33034 = state_33025;
(statearr_33034[(9)] = inst_33022);

return statearr_33034;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33025__$1,inst_33023);
} else {
if((state_val_33026 === (2))){
var state_33025__$1 = state_33025;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33025__$1,(4),ch);
} else {
if((state_val_33026 === (11))){
var inst_33005 = (state_33025[(8)]);
var inst_33014 = (state_33025[(2)]);
var inst_33002 = inst_33005;
var state_33025__$1 = (function (){var statearr_33035 = state_33025;
(statearr_33035[(10)] = inst_33014);

(statearr_33035[(7)] = inst_33002);

return statearr_33035;
})();
var statearr_33036_33060 = state_33025__$1;
(statearr_33036_33060[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (9))){
var inst_33005 = (state_33025[(8)]);
var state_33025__$1 = state_33025;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33025__$1,(11),out,inst_33005);
} else {
if((state_val_33026 === (5))){
var inst_33002 = (state_33025[(7)]);
var inst_33005 = (state_33025[(8)]);
var inst_33009 = cljs.core._EQ_.call(null,inst_33005,inst_33002);
var state_33025__$1 = state_33025;
if(inst_33009){
var statearr_33038_33061 = state_33025__$1;
(statearr_33038_33061[(1)] = (8));

} else {
var statearr_33039_33062 = state_33025__$1;
(statearr_33039_33062[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (10))){
var inst_33017 = (state_33025[(2)]);
var state_33025__$1 = state_33025;
var statearr_33040_33063 = state_33025__$1;
(statearr_33040_33063[(2)] = inst_33017);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33026 === (8))){
var inst_33002 = (state_33025[(7)]);
var tmp33037 = inst_33002;
var inst_33002__$1 = tmp33037;
var state_33025__$1 = (function (){var statearr_33041 = state_33025;
(statearr_33041[(7)] = inst_33002__$1);

return statearr_33041;
})();
var statearr_33042_33064 = state_33025__$1;
(statearr_33042_33064[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___33054,out))
;
return ((function (switch__30296__auto__,c__30410__auto___33054,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_33046 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_33046[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_33046[(1)] = (1));

return statearr_33046;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_33025){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_33025);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e33047){if((e33047 instanceof Object)){
var ex__30300__auto__ = e33047;
var statearr_33048_33065 = state_33025;
(statearr_33048_33065[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33066 = state_33025;
state_33025 = G__33066;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_33025){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_33025);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___33054,out))
})();
var state__30412__auto__ = (function (){var statearr_33049 = f__30411__auto__.call(null);
(statearr_33049[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___33054);

return statearr_33049;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___33054,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 args33067 = [];
var len__24369__auto___33137 = arguments.length;
var i__24370__auto___33138 = (0);
while(true){
if((i__24370__auto___33138 < len__24369__auto___33137)){
args33067.push((arguments[i__24370__auto___33138]));

var G__33139 = (i__24370__auto___33138 + (1));
i__24370__auto___33138 = G__33139;
continue;
} else {
}
break;
}

var G__33069 = args33067.length;
switch (G__33069) {
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(args33067.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__30410__auto___33141 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___33141,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___33141,out){
return (function (state_33107){
var state_val_33108 = (state_33107[(1)]);
if((state_val_33108 === (7))){
var inst_33103 = (state_33107[(2)]);
var state_33107__$1 = state_33107;
var statearr_33109_33142 = state_33107__$1;
(statearr_33109_33142[(2)] = inst_33103);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (1))){
var inst_33070 = (new Array(n));
var inst_33071 = inst_33070;
var inst_33072 = (0);
var state_33107__$1 = (function (){var statearr_33110 = state_33107;
(statearr_33110[(7)] = inst_33071);

(statearr_33110[(8)] = inst_33072);

return statearr_33110;
})();
var statearr_33111_33143 = state_33107__$1;
(statearr_33111_33143[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (4))){
var inst_33075 = (state_33107[(9)]);
var inst_33075__$1 = (state_33107[(2)]);
var inst_33076 = (inst_33075__$1 == null);
var inst_33077 = cljs.core.not.call(null,inst_33076);
var state_33107__$1 = (function (){var statearr_33112 = state_33107;
(statearr_33112[(9)] = inst_33075__$1);

return statearr_33112;
})();
if(inst_33077){
var statearr_33113_33144 = state_33107__$1;
(statearr_33113_33144[(1)] = (5));

} else {
var statearr_33114_33145 = state_33107__$1;
(statearr_33114_33145[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (15))){
var inst_33097 = (state_33107[(2)]);
var state_33107__$1 = state_33107;
var statearr_33115_33146 = state_33107__$1;
(statearr_33115_33146[(2)] = inst_33097);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (13))){
var state_33107__$1 = state_33107;
var statearr_33116_33147 = state_33107__$1;
(statearr_33116_33147[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (6))){
var inst_33072 = (state_33107[(8)]);
var inst_33093 = (inst_33072 > (0));
var state_33107__$1 = state_33107;
if(cljs.core.truth_(inst_33093)){
var statearr_33117_33148 = state_33107__$1;
(statearr_33117_33148[(1)] = (12));

} else {
var statearr_33118_33149 = state_33107__$1;
(statearr_33118_33149[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (3))){
var inst_33105 = (state_33107[(2)]);
var state_33107__$1 = state_33107;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33107__$1,inst_33105);
} else {
if((state_val_33108 === (12))){
var inst_33071 = (state_33107[(7)]);
var inst_33095 = cljs.core.vec.call(null,inst_33071);
var state_33107__$1 = state_33107;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33107__$1,(15),out,inst_33095);
} else {
if((state_val_33108 === (2))){
var state_33107__$1 = state_33107;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33107__$1,(4),ch);
} else {
if((state_val_33108 === (11))){
var inst_33087 = (state_33107[(2)]);
var inst_33088 = (new Array(n));
var inst_33071 = inst_33088;
var inst_33072 = (0);
var state_33107__$1 = (function (){var statearr_33119 = state_33107;
(statearr_33119[(7)] = inst_33071);

(statearr_33119[(10)] = inst_33087);

(statearr_33119[(8)] = inst_33072);

return statearr_33119;
})();
var statearr_33120_33150 = state_33107__$1;
(statearr_33120_33150[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (9))){
var inst_33071 = (state_33107[(7)]);
var inst_33085 = cljs.core.vec.call(null,inst_33071);
var state_33107__$1 = state_33107;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33107__$1,(11),out,inst_33085);
} else {
if((state_val_33108 === (5))){
var inst_33071 = (state_33107[(7)]);
var inst_33075 = (state_33107[(9)]);
var inst_33072 = (state_33107[(8)]);
var inst_33080 = (state_33107[(11)]);
var inst_33079 = (inst_33071[inst_33072] = inst_33075);
var inst_33080__$1 = (inst_33072 + (1));
var inst_33081 = (inst_33080__$1 < n);
var state_33107__$1 = (function (){var statearr_33121 = state_33107;
(statearr_33121[(11)] = inst_33080__$1);

(statearr_33121[(12)] = inst_33079);

return statearr_33121;
})();
if(cljs.core.truth_(inst_33081)){
var statearr_33122_33151 = state_33107__$1;
(statearr_33122_33151[(1)] = (8));

} else {
var statearr_33123_33152 = state_33107__$1;
(statearr_33123_33152[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (14))){
var inst_33100 = (state_33107[(2)]);
var inst_33101 = cljs.core.async.close_BANG_.call(null,out);
var state_33107__$1 = (function (){var statearr_33125 = state_33107;
(statearr_33125[(13)] = inst_33100);

return statearr_33125;
})();
var statearr_33126_33153 = state_33107__$1;
(statearr_33126_33153[(2)] = inst_33101);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (10))){
var inst_33091 = (state_33107[(2)]);
var state_33107__$1 = state_33107;
var statearr_33127_33154 = state_33107__$1;
(statearr_33127_33154[(2)] = inst_33091);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33108 === (8))){
var inst_33071 = (state_33107[(7)]);
var inst_33080 = (state_33107[(11)]);
var tmp33124 = inst_33071;
var inst_33071__$1 = tmp33124;
var inst_33072 = inst_33080;
var state_33107__$1 = (function (){var statearr_33128 = state_33107;
(statearr_33128[(7)] = inst_33071__$1);

(statearr_33128[(8)] = inst_33072);

return statearr_33128;
})();
var statearr_33129_33155 = state_33107__$1;
(statearr_33129_33155[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___33141,out))
;
return ((function (switch__30296__auto__,c__30410__auto___33141,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_33133 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33133[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_33133[(1)] = (1));

return statearr_33133;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_33107){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_33107);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e33134){if((e33134 instanceof Object)){
var ex__30300__auto__ = e33134;
var statearr_33135_33156 = state_33107;
(statearr_33135_33156[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33157 = state_33107;
state_33107 = G__33157;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_33107){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_33107);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___33141,out))
})();
var state__30412__auto__ = (function (){var statearr_33136 = f__30411__auto__.call(null);
(statearr_33136[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___33141);

return statearr_33136;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___33141,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 args33158 = [];
var len__24369__auto___33232 = arguments.length;
var i__24370__auto___33233 = (0);
while(true){
if((i__24370__auto___33233 < len__24369__auto___33232)){
args33158.push((arguments[i__24370__auto___33233]));

var G__33234 = (i__24370__auto___33233 + (1));
i__24370__auto___33233 = G__33234;
continue;
} else {
}
break;
}

var G__33160 = args33158.length;
switch (G__33160) {
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(args33158.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__30410__auto___33236 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__30410__auto___33236,out){
return (function (){
var f__30411__auto__ = (function (){var switch__30296__auto__ = ((function (c__30410__auto___33236,out){
return (function (state_33202){
var state_val_33203 = (state_33202[(1)]);
if((state_val_33203 === (7))){
var inst_33198 = (state_33202[(2)]);
var state_33202__$1 = state_33202;
var statearr_33204_33237 = state_33202__$1;
(statearr_33204_33237[(2)] = inst_33198);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (1))){
var inst_33161 = [];
var inst_33162 = inst_33161;
var inst_33163 = new cljs.core.Keyword("cljs.core.async","nothing","cljs.core.async/nothing",-69252123);
var state_33202__$1 = (function (){var statearr_33205 = state_33202;
(statearr_33205[(7)] = inst_33163);

(statearr_33205[(8)] = inst_33162);

return statearr_33205;
})();
var statearr_33206_33238 = state_33202__$1;
(statearr_33206_33238[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (4))){
var inst_33166 = (state_33202[(9)]);
var inst_33166__$1 = (state_33202[(2)]);
var inst_33167 = (inst_33166__$1 == null);
var inst_33168 = cljs.core.not.call(null,inst_33167);
var state_33202__$1 = (function (){var statearr_33207 = state_33202;
(statearr_33207[(9)] = inst_33166__$1);

return statearr_33207;
})();
if(inst_33168){
var statearr_33208_33239 = state_33202__$1;
(statearr_33208_33239[(1)] = (5));

} else {
var statearr_33209_33240 = state_33202__$1;
(statearr_33209_33240[(1)] = (6));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (15))){
var inst_33192 = (state_33202[(2)]);
var state_33202__$1 = state_33202;
var statearr_33210_33241 = state_33202__$1;
(statearr_33210_33241[(2)] = inst_33192);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (13))){
var state_33202__$1 = state_33202;
var statearr_33211_33242 = state_33202__$1;
(statearr_33211_33242[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (6))){
var inst_33162 = (state_33202[(8)]);
var inst_33187 = inst_33162.length;
var inst_33188 = (inst_33187 > (0));
var state_33202__$1 = state_33202;
if(cljs.core.truth_(inst_33188)){
var statearr_33212_33243 = state_33202__$1;
(statearr_33212_33243[(1)] = (12));

} else {
var statearr_33213_33244 = state_33202__$1;
(statearr_33213_33244[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (3))){
var inst_33200 = (state_33202[(2)]);
var state_33202__$1 = state_33202;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_33202__$1,inst_33200);
} else {
if((state_val_33203 === (12))){
var inst_33162 = (state_33202[(8)]);
var inst_33190 = cljs.core.vec.call(null,inst_33162);
var state_33202__$1 = state_33202;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33202__$1,(15),out,inst_33190);
} else {
if((state_val_33203 === (2))){
var state_33202__$1 = state_33202;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_33202__$1,(4),ch);
} else {
if((state_val_33203 === (11))){
var inst_33170 = (state_33202[(10)]);
var inst_33166 = (state_33202[(9)]);
var inst_33180 = (state_33202[(2)]);
var inst_33181 = [];
var inst_33182 = inst_33181.push(inst_33166);
var inst_33162 = inst_33181;
var inst_33163 = inst_33170;
var state_33202__$1 = (function (){var statearr_33214 = state_33202;
(statearr_33214[(11)] = inst_33182);

(statearr_33214[(7)] = inst_33163);

(statearr_33214[(12)] = inst_33180);

(statearr_33214[(8)] = inst_33162);

return statearr_33214;
})();
var statearr_33215_33245 = state_33202__$1;
(statearr_33215_33245[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (9))){
var inst_33162 = (state_33202[(8)]);
var inst_33178 = cljs.core.vec.call(null,inst_33162);
var state_33202__$1 = state_33202;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_33202__$1,(11),out,inst_33178);
} else {
if((state_val_33203 === (5))){
var inst_33170 = (state_33202[(10)]);
var inst_33163 = (state_33202[(7)]);
var inst_33166 = (state_33202[(9)]);
var inst_33170__$1 = f.call(null,inst_33166);
var inst_33171 = cljs.core._EQ_.call(null,inst_33170__$1,inst_33163);
var inst_33172 = cljs.core.keyword_identical_QMARK_.call(null,inst_33163,new cljs.core.Keyword("cljs.core.async","nothing","cljs.core.async/nothing",-69252123));
var inst_33173 = (inst_33171) || (inst_33172);
var state_33202__$1 = (function (){var statearr_33216 = state_33202;
(statearr_33216[(10)] = inst_33170__$1);

return statearr_33216;
})();
if(cljs.core.truth_(inst_33173)){
var statearr_33217_33246 = state_33202__$1;
(statearr_33217_33246[(1)] = (8));

} else {
var statearr_33218_33247 = state_33202__$1;
(statearr_33218_33247[(1)] = (9));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (14))){
var inst_33195 = (state_33202[(2)]);
var inst_33196 = cljs.core.async.close_BANG_.call(null,out);
var state_33202__$1 = (function (){var statearr_33220 = state_33202;
(statearr_33220[(13)] = inst_33195);

return statearr_33220;
})();
var statearr_33221_33248 = state_33202__$1;
(statearr_33221_33248[(2)] = inst_33196);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (10))){
var inst_33185 = (state_33202[(2)]);
var state_33202__$1 = state_33202;
var statearr_33222_33249 = state_33202__$1;
(statearr_33222_33249[(2)] = inst_33185);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_33203 === (8))){
var inst_33170 = (state_33202[(10)]);
var inst_33166 = (state_33202[(9)]);
var inst_33162 = (state_33202[(8)]);
var inst_33175 = inst_33162.push(inst_33166);
var tmp33219 = inst_33162;
var inst_33162__$1 = tmp33219;
var inst_33163 = inst_33170;
var state_33202__$1 = (function (){var statearr_33223 = state_33202;
(statearr_33223[(14)] = inst_33175);

(statearr_33223[(7)] = inst_33163);

(statearr_33223[(8)] = inst_33162__$1);

return statearr_33223;
})();
var statearr_33224_33250 = state_33202__$1;
(statearr_33224_33250[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__30410__auto___33236,out))
;
return ((function (switch__30296__auto__,c__30410__auto___33236,out){
return (function() {
var cljs$core$async$state_machine__30297__auto__ = null;
var cljs$core$async$state_machine__30297__auto____0 = (function (){
var statearr_33228 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_33228[(0)] = cljs$core$async$state_machine__30297__auto__);

(statearr_33228[(1)] = (1));

return statearr_33228;
});
var cljs$core$async$state_machine__30297__auto____1 = (function (state_33202){
while(true){
var ret_value__30298__auto__ = (function (){try{while(true){
var result__30299__auto__ = switch__30296__auto__.call(null,state_33202);
if(cljs.core.keyword_identical_QMARK_.call(null,result__30299__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__30299__auto__;
}
break;
}
}catch (e33229){if((e33229 instanceof Object)){
var ex__30300__auto__ = e33229;
var statearr_33230_33251 = state_33202;
(statearr_33230_33251[(5)] = ex__30300__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__30298__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__33252 = state_33202;
state_33202 = G__33252;
continue;
} else {
return ret_value__30298__auto__;
}
break;
}
});
cljs$core$async$state_machine__30297__auto__ = function(state_33202){
switch(arguments.length){
case 0:
return cljs$core$async$state_machine__30297__auto____0.call(this);
case 1:
return cljs$core$async$state_machine__30297__auto____1.call(this,state_33202);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$0 = cljs$core$async$state_machine__30297__auto____0;
cljs$core$async$state_machine__30297__auto__.cljs$core$IFn$_invoke$arity$1 = cljs$core$async$state_machine__30297__auto____1;
return cljs$core$async$state_machine__30297__auto__;
})()
;})(switch__30296__auto__,c__30410__auto___33236,out))
})();
var state__30412__auto__ = (function (){var statearr_33231 = f__30411__auto__.call(null);
(statearr_33231[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__30410__auto___33236);

return statearr_33231;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__30412__auto__);
});})(c__30410__auto___33236,out))
);


return out;
});

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

