import "./cljs_env.js";
goog.provide('cljs.repl');
cljs.repl.print_doc = (function cljs$repl$print_doc(p__53496){
var map__53497 = p__53496;
var map__53497__$1 = cljs.core.__destructure_map(map__53497);
var m = map__53497__$1;
var n = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53497__$1,new cljs.core.Keyword(null,"ns","ns",441598760));
var nm = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53497__$1,new cljs.core.Keyword(null,"name","name",1843675177));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["-------------------------"], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([(function (){var or__4223__auto__ = new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return [(function (){var temp__5753__auto__ = new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(temp__5753__auto__)){
var ns = temp__5753__auto__;
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(ns),"/"].join('');
} else {
return null;
}
})(),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('');
}
})()], 0));

if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Protocol"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m))){
var seq__53498_53705 = cljs.core.seq(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m));
var chunk__53499_53706 = null;
var count__53500_53707 = (0);
var i__53501_53708 = (0);
while(true){
if((i__53501_53708 < count__53500_53707)){
var f_53711 = chunk__53499_53706.cljs$core$IIndexed$_nth$arity$2(null,i__53501_53708);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_53711], 0));


var G__53712 = seq__53498_53705;
var G__53713 = chunk__53499_53706;
var G__53714 = count__53500_53707;
var G__53715 = (i__53501_53708 + (1));
seq__53498_53705 = G__53712;
chunk__53499_53706 = G__53713;
count__53500_53707 = G__53714;
i__53501_53708 = G__53715;
continue;
} else {
var temp__5753__auto___53718 = cljs.core.seq(seq__53498_53705);
if(temp__5753__auto___53718){
var seq__53498_53719__$1 = temp__5753__auto___53718;
if(cljs.core.chunked_seq_QMARK_(seq__53498_53719__$1)){
var c__4649__auto___53720 = cljs.core.chunk_first(seq__53498_53719__$1);
var G__53721 = cljs.core.chunk_rest(seq__53498_53719__$1);
var G__53722 = c__4649__auto___53720;
var G__53723 = cljs.core.count(c__4649__auto___53720);
var G__53724 = (0);
seq__53498_53705 = G__53721;
chunk__53499_53706 = G__53722;
count__53500_53707 = G__53723;
i__53501_53708 = G__53724;
continue;
} else {
var f_53725 = cljs.core.first(seq__53498_53719__$1);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_53725], 0));


var G__53726 = cljs.core.next(seq__53498_53719__$1);
var G__53727 = null;
var G__53728 = (0);
var G__53729 = (0);
seq__53498_53705 = G__53726;
chunk__53499_53706 = G__53727;
count__53500_53707 = G__53728;
i__53501_53708 = G__53729;
continue;
}
} else {
}
}
break;
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m))){
var arglists_53730 = new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_((function (){var or__4223__auto__ = new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m);
}
})())){
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([arglists_53730], 0));
} else {
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Symbol(null,"quote","quote",1377916282,null),cljs.core.first(arglists_53730)))?cljs.core.second(arglists_53730):arglists_53730)], 0));
}
} else {
}
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"special-form","special-form",-1326536374).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Special Form"], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));

if(cljs.core.contains_QMARK_(m,new cljs.core.Keyword(null,"url","url",276297046))){
if(cljs.core.truth_(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))){
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n  Please see http://clojure.org/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
} else {
return null;
}
} else {
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n  Please see http://clojure.org/special_forms#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Macro"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["REPL Special Function"], 0));
} else {
}

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));

if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
var seq__53504_53731 = cljs.core.seq(new cljs.core.Keyword(null,"methods","methods",453930866).cljs$core$IFn$_invoke$arity$1(m));
var chunk__53505_53732 = null;
var count__53506_53733 = (0);
var i__53507_53734 = (0);
while(true){
if((i__53507_53734 < count__53506_53733)){
var vec__53519_53735 = chunk__53505_53732.cljs$core$IIndexed$_nth$arity$2(null,i__53507_53734);
var name_53736 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53519_53735,(0),null);
var map__53522_53737 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53519_53735,(1),null);
var map__53522_53738__$1 = cljs.core.__destructure_map(map__53522_53737);
var doc_53739 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53522_53738__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_53740 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53522_53738__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_53736], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_53740], 0));

if(cljs.core.truth_(doc_53739)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_53739], 0));
} else {
}


var G__53741 = seq__53504_53731;
var G__53742 = chunk__53505_53732;
var G__53743 = count__53506_53733;
var G__53744 = (i__53507_53734 + (1));
seq__53504_53731 = G__53741;
chunk__53505_53732 = G__53742;
count__53506_53733 = G__53743;
i__53507_53734 = G__53744;
continue;
} else {
var temp__5753__auto___53745 = cljs.core.seq(seq__53504_53731);
if(temp__5753__auto___53745){
var seq__53504_53746__$1 = temp__5753__auto___53745;
if(cljs.core.chunked_seq_QMARK_(seq__53504_53746__$1)){
var c__4649__auto___53747 = cljs.core.chunk_first(seq__53504_53746__$1);
var G__53748 = cljs.core.chunk_rest(seq__53504_53746__$1);
var G__53749 = c__4649__auto___53747;
var G__53750 = cljs.core.count(c__4649__auto___53747);
var G__53751 = (0);
seq__53504_53731 = G__53748;
chunk__53505_53732 = G__53749;
count__53506_53733 = G__53750;
i__53507_53734 = G__53751;
continue;
} else {
var vec__53525_53752 = cljs.core.first(seq__53504_53746__$1);
var name_53753 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53525_53752,(0),null);
var map__53528_53754 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53525_53752,(1),null);
var map__53528_53755__$1 = cljs.core.__destructure_map(map__53528_53754);
var doc_53756 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53528_53755__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_53757 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53528_53755__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_53753], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_53757], 0));

if(cljs.core.truth_(doc_53756)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_53756], 0));
} else {
}


var G__53758 = cljs.core.next(seq__53504_53746__$1);
var G__53759 = null;
var G__53760 = (0);
var G__53761 = (0);
seq__53504_53731 = G__53758;
chunk__53505_53732 = G__53759;
count__53506_53733 = G__53760;
i__53507_53734 = G__53761;
continue;
}
} else {
}
}
break;
}
} else {
}

if(cljs.core.truth_(n)){
var temp__5753__auto__ = cljs.spec.alpha.get_spec(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2(cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.ns_name(n)),cljs.core.name(nm)));
if(cljs.core.truth_(temp__5753__auto__)){
var fnspec = temp__5753__auto__;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));

var seq__53529 = cljs.core.seq(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Keyword(null,"fn","fn",-1175266204)], null));
var chunk__53530 = null;
var count__53531 = (0);
var i__53532 = (0);
while(true){
if((i__53532 < count__53531)){
var role = chunk__53530.cljs$core$IIndexed$_nth$arity$2(null,i__53532);
var temp__5753__auto___53762__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5753__auto___53762__$1)){
var spec_53763 = temp__5753__auto___53762__$1;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_53763)], 0));
} else {
}


var G__53764 = seq__53529;
var G__53765 = chunk__53530;
var G__53766 = count__53531;
var G__53767 = (i__53532 + (1));
seq__53529 = G__53764;
chunk__53530 = G__53765;
count__53531 = G__53766;
i__53532 = G__53767;
continue;
} else {
var temp__5753__auto____$1 = cljs.core.seq(seq__53529);
if(temp__5753__auto____$1){
var seq__53529__$1 = temp__5753__auto____$1;
if(cljs.core.chunked_seq_QMARK_(seq__53529__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__53529__$1);
var G__53768 = cljs.core.chunk_rest(seq__53529__$1);
var G__53769 = c__4649__auto__;
var G__53770 = cljs.core.count(c__4649__auto__);
var G__53771 = (0);
seq__53529 = G__53768;
chunk__53530 = G__53769;
count__53531 = G__53770;
i__53532 = G__53771;
continue;
} else {
var role = cljs.core.first(seq__53529__$1);
var temp__5753__auto___53772__$2 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5753__auto___53772__$2)){
var spec_53773 = temp__5753__auto___53772__$2;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_53773)], 0));
} else {
}


var G__53774 = cljs.core.next(seq__53529__$1);
var G__53775 = null;
var G__53776 = (0);
var G__53777 = (0);
seq__53529 = G__53774;
chunk__53530 = G__53775;
count__53531 = G__53776;
i__53532 = G__53777;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return null;
}
} else {
return null;
}
}
});
/**
 * Constructs a data representation for a Error with keys:
 *  :cause - root cause message
 *  :phase - error phase
 *  :via - cause chain, with cause keys:
 *           :type - exception class symbol
 *           :message - exception message
 *           :data - ex-data
 *           :at - top stack element
 *  :trace - root cause stack elements
 */
cljs.repl.Error__GT_map = (function cljs$repl$Error__GT_map(o){
var base = (function (t){
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),(((t instanceof cljs.core.ExceptionInfo))?new cljs.core.Symbol("cljs.core","ExceptionInfo","cljs.core/ExceptionInfo",701839050,null):(((t instanceof Error))?cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("js",t.name):null
))], null),(function (){var temp__5753__auto__ = cljs.core.ex_message(t);
if(cljs.core.truth_(temp__5753__auto__)){
var msg = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"message","message",-406056002),msg], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = cljs.core.ex_data(t);
if(cljs.core.truth_(temp__5753__auto__)){
var ed = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),ed], null);
} else {
return null;
}
})()], 0));
});
var via = (function (){var via = cljs.core.PersistentVector.EMPTY;
var t = o;
while(true){
if(cljs.core.truth_(t)){
var G__53778 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(via,t);
var G__53779 = cljs.core.ex_cause(t);
via = G__53778;
t = G__53779;
continue;
} else {
return via;
}
break;
}
})();
var root = cljs.core.peek(via);
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"via","via",-1904457336),cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(base,via)),new cljs.core.Keyword(null,"trace","trace",-1082747415),null], null),(function (){var temp__5753__auto__ = cljs.core.ex_message(root);
if(cljs.core.truth_(temp__5753__auto__)){
var root_msg = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cause","cause",231901252),root_msg], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = cljs.core.ex_data(root);
if(cljs.core.truth_(temp__5753__auto__)){
var data = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),data], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data(o));
if(cljs.core.truth_(temp__5753__auto__)){
var phase = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"phase","phase",575722892),phase], null);
} else {
return null;
}
})()], 0));
});
/**
 * Returns an analysis of the phase, error, cause, and location of an error that occurred
 *   based on Throwable data, as returned by Throwable->map. All attributes other than phase
 *   are optional:
 *  :clojure.error/phase - keyword phase indicator, one of:
 *    :read-source :compile-syntax-check :compilation :macro-syntax-check :macroexpansion
 *    :execution :read-eval-result :print-eval-result
 *  :clojure.error/source - file name (no path)
 *  :clojure.error/line - integer line number
 *  :clojure.error/column - integer column number
 *  :clojure.error/symbol - symbol being expanded/compiled/invoked
 *  :clojure.error/class - cause exception class symbol
 *  :clojure.error/cause - cause exception message
 *  :clojure.error/spec - explain-data for spec error
 */
cljs.repl.ex_triage = (function cljs$repl$ex_triage(datafied_throwable){
var map__53557 = datafied_throwable;
var map__53557__$1 = cljs.core.__destructure_map(map__53557);
var via = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53557__$1,new cljs.core.Keyword(null,"via","via",-1904457336));
var trace = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53557__$1,new cljs.core.Keyword(null,"trace","trace",-1082747415));
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__53557__$1,new cljs.core.Keyword(null,"phase","phase",575722892),new cljs.core.Keyword(null,"execution","execution",253283524));
var map__53558 = cljs.core.last(via);
var map__53558__$1 = cljs.core.__destructure_map(map__53558);
var type = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53558__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var message = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53558__$1,new cljs.core.Keyword(null,"message","message",-406056002));
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53558__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var map__53559 = data;
var map__53559__$1 = cljs.core.__destructure_map(map__53559);
var problems = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53559__$1,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814));
var fn = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53559__$1,new cljs.core.Keyword("cljs.spec.alpha","fn","cljs.spec.alpha/fn",408600443));
var caller = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53559__$1,new cljs.core.Keyword("cljs.spec.test.alpha","caller","cljs.spec.test.alpha/caller",-398302390));
var map__53560 = new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.first(via));
var map__53560__$1 = cljs.core.__destructure_map(map__53560);
var top_data = map__53560__$1;
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53560__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3((function (){var G__53568 = phase;
var G__53568__$1 = (((G__53568 instanceof cljs.core.Keyword))?G__53568.fqn:null);
switch (G__53568__$1) {
case "read-source":
var map__53575 = data;
var map__53575__$1 = cljs.core.__destructure_map(map__53575);
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53575__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53575__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var G__53584 = cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.second(via)),top_data], 0));
var G__53584__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53584,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__53584);
var G__53584__$2 = (cljs.core.truth_((function (){var fexpr__53589 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__53589.cljs$core$IFn$_invoke$arity$1 ? fexpr__53589.cljs$core$IFn$_invoke$arity$1(source) : fexpr__53589.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__53584__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__53584__$1);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53584__$2,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__53584__$2;
}

break;
case "compile-syntax-check":
case "compilation":
case "macro-syntax-check":
case "macroexpansion":
var G__53601 = top_data;
var G__53601__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53601,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__53601);
var G__53601__$2 = (cljs.core.truth_((function (){var fexpr__53611 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__53611.cljs$core$IFn$_invoke$arity$1 ? fexpr__53611.cljs$core$IFn$_invoke$arity$1(source) : fexpr__53611.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__53601__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__53601__$1);
var G__53601__$3 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53601__$2,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__53601__$2);
var G__53601__$4 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53601__$3,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__53601__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53601__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__53601__$4;
}

break;
case "read-eval-result":
case "print-eval-result":
var vec__53616 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53616,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53616,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53616,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53616,(3),null);
var G__53622 = top_data;
var G__53622__$1 = (cljs.core.truth_(line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53622,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),line):G__53622);
var G__53622__$2 = (cljs.core.truth_(file)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53622__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file):G__53622__$1);
var G__53622__$3 = (cljs.core.truth_((function (){var and__4221__auto__ = source__$1;
if(cljs.core.truth_(and__4221__auto__)){
return method;
} else {
return and__4221__auto__;
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53622__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null))):G__53622__$2);
var G__53622__$4 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53622__$3,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__53622__$3);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53622__$4,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__53622__$4;
}

break;
case "execution":
var vec__53645 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53645,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53645,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53645,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__53645,(3),null);
var file__$1 = cljs.core.first(cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__53539_SHARP_){
var or__4223__auto__ = (p1__53539_SHARP_ == null);
if(or__4223__auto__){
return or__4223__auto__;
} else {
var fexpr__53648 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__53648.cljs$core$IFn$_invoke$arity$1 ? fexpr__53648.cljs$core$IFn$_invoke$arity$1(p1__53539_SHARP_) : fexpr__53648.call(null,p1__53539_SHARP_));
}
}),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(caller),file], null)));
var err_line = (function (){var or__4223__auto__ = new cljs.core.Keyword(null,"line","line",212345235).cljs$core$IFn$_invoke$arity$1(caller);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return line;
}
})();
var G__53653 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type], null);
var G__53653__$1 = (cljs.core.truth_(err_line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53653,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),err_line):G__53653);
var G__53653__$2 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53653__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__53653__$1);
var G__53653__$3 = (cljs.core.truth_((function (){var or__4223__auto__ = fn;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
var and__4221__auto__ = source__$1;
if(cljs.core.truth_(and__4221__auto__)){
return method;
} else {
return and__4221__auto__;
}
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53653__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(function (){var or__4223__auto__ = fn;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return (new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null));
}
})()):G__53653__$2);
var G__53653__$4 = (cljs.core.truth_(file__$1)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53653__$3,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file__$1):G__53653__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__53653__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__53653__$4;
}

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

}
})(),new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358),phase);
});
/**
 * Returns a string from exception data, as produced by ex-triage.
 *   The first line summarizes the exception phase and location.
 *   The subsequent lines describe the cause.
 */
cljs.repl.ex_str = (function cljs$repl$ex_str(p__53658){
var map__53659 = p__53658;
var map__53659__$1 = cljs.core.__destructure_map(map__53659);
var triage_data = map__53659__$1;
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358));
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var symbol = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994));
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890));
var cause = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__53659__$1,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595));
var loc = [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4223__auto__ = source;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return "<cljs repl>";
}
})()),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4223__auto__ = line;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return (1);
}
})()),(cljs.core.truth_(column)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join(''):"")].join('');
var class_name = cljs.core.name((function (){var or__4223__auto__ = class$;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return "";
}
})());
var simple_class = class_name;
var cause_type = ((cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["RuntimeException",null,"Exception",null], null), null),simple_class))?"":[" (",simple_class,")"].join(''));
var format = goog.string.format;
var G__53661 = phase;
var G__53661__$1 = (((G__53661 instanceof cljs.core.Keyword))?G__53661.fqn:null);
switch (G__53661__$1) {
case "read-source":
return (format.cljs$core$IFn$_invoke$arity$3 ? format.cljs$core$IFn$_invoke$arity$3("Syntax error reading source at (%s).\n%s\n",loc,cause) : format.call(null,"Syntax error reading source at (%s).\n%s\n",loc,cause));

break;
case "macro-syntax-check":
var G__53663 = "Syntax error macroexpanding %sat (%s).\n%s";
var G__53664 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__53665 = loc;
var G__53666 = (cljs.core.truth_(spec)?(function (){var sb__4760__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__53667_53784 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__53668_53785 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__53669_53786 = true;
var _STAR_print_fn_STAR__temp_val__53670_53787 = (function (x__4761__auto__){
return sb__4760__auto__.append(x__4761__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__53669_53786);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__53670_53787);

try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__53656_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__53656_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__53668_53785);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__53667_53784);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4760__auto__);
})():(format.cljs$core$IFn$_invoke$arity$2 ? format.cljs$core$IFn$_invoke$arity$2("%s\n",cause) : format.call(null,"%s\n",cause)));
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__53663,G__53664,G__53665,G__53666) : format.call(null,G__53663,G__53664,G__53665,G__53666));

break;
case "macroexpansion":
var G__53672 = "Unexpected error%s macroexpanding %sat (%s).\n%s\n";
var G__53673 = cause_type;
var G__53674 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__53675 = loc;
var G__53676 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__53672,G__53673,G__53674,G__53675,G__53676) : format.call(null,G__53672,G__53673,G__53674,G__53675,G__53676));

break;
case "compile-syntax-check":
var G__53678 = "Syntax error%s compiling %sat (%s).\n%s\n";
var G__53679 = cause_type;
var G__53680 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__53681 = loc;
var G__53682 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__53678,G__53679,G__53680,G__53681,G__53682) : format.call(null,G__53678,G__53679,G__53680,G__53681,G__53682));

break;
case "compilation":
var G__53683 = "Unexpected error%s compiling %sat (%s).\n%s\n";
var G__53684 = cause_type;
var G__53685 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__53686 = loc;
var G__53687 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__53683,G__53684,G__53685,G__53686,G__53687) : format.call(null,G__53683,G__53684,G__53685,G__53686,G__53687));

break;
case "read-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null,"Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));

break;
case "print-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null,"Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));

break;
case "execution":
if(cljs.core.truth_(spec)){
var G__53688 = "Execution error - invalid arguments to %s at (%s).\n%s";
var G__53689 = symbol;
var G__53690 = loc;
var G__53691 = (function (){var sb__4760__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__53692_53788 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__53693_53789 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__53694_53790 = true;
var _STAR_print_fn_STAR__temp_val__53695_53791 = (function (x__4761__auto__){
return sb__4760__auto__.append(x__4761__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__53694_53790);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__53695_53791);

try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__53657_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__53657_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__53693_53789);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__53692_53788);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4760__auto__);
})();
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__53688,G__53689,G__53690,G__53691) : format.call(null,G__53688,G__53689,G__53690,G__53691));
} else {
var G__53696 = "Execution error%s at %s(%s).\n%s\n";
var G__53697 = cause_type;
var G__53698 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__53699 = loc;
var G__53700 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__53696,G__53697,G__53698,G__53699,G__53700) : format.call(null,G__53696,G__53697,G__53698,G__53699,G__53700));
}

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

}
});
cljs.repl.error__GT_str = (function cljs$repl$error__GT_str(error){
return cljs.repl.ex_str(cljs.repl.ex_triage(cljs.repl.Error__GT_map(error)));
});

//# sourceMappingURL=cljs.repl.js.map
