import "./cljs_env.js";
goog.provide('shadow.cljs.devtools.client.browser');
shadow.cljs.devtools.client.browser.devtools_msg = (function shadow$cljs$devtools$client$browser$devtools_msg(var_args){
var args__4835__auto__ = [];
var len__4829__auto___54978 = arguments.length;
var i__4830__auto___54980 = (0);
while(true){
if((i__4830__auto___54980 < len__4829__auto___54978)){
args__4835__auto__.push((arguments[i__4830__auto___54980]));

var G__54981 = (i__4830__auto___54980 + (1));
i__4830__auto___54980 = G__54981;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((1) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((1)),(0),null)):null);
return shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4836__auto__);
});

(shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic = (function (msg,args){
if(shadow.cljs.devtools.client.env.log){
if(cljs.core.seq(shadow.cljs.devtools.client.env.log_style)){
return console.log.apply(console,cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(cljs.core.into.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [["%cshadow-cljs: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg)].join(''),shadow.cljs.devtools.client.env.log_style], null),args)));
} else {
return console.log.apply(console,cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(cljs.core.into.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["shadow-cljs: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg)].join('')], null),args)));
}
} else {
return null;
}
}));

(shadow.cljs.devtools.client.browser.devtools_msg.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(shadow.cljs.devtools.client.browser.devtools_msg.cljs$lang$applyTo = (function (seq54585){
var G__54586 = cljs.core.first(seq54585);
var seq54585__$1 = cljs.core.next(seq54585);
var self__4816__auto__ = this;
return self__4816__auto__.cljs$core$IFn$_invoke$arity$variadic(G__54586,seq54585__$1);
}));

shadow.cljs.devtools.client.browser.script_eval = (function shadow$cljs$devtools$client$browser$script_eval(code){
return goog.globalEval(code);
});
shadow.cljs.devtools.client.browser.do_js_load = (function shadow$cljs$devtools$client$browser$do_js_load(sources){
var seq__54587 = cljs.core.seq(sources);
var chunk__54588 = null;
var count__54589 = (0);
var i__54590 = (0);
while(true){
if((i__54590 < count__54589)){
var map__54595 = chunk__54588.cljs$core$IIndexed$_nth$arity$2(null,i__54590);
var map__54595__$1 = cljs.core.__destructure_map(map__54595);
var src = map__54595__$1;
var resource_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54595__$1,new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582));
var output_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54595__$1,new cljs.core.Keyword(null,"output-name","output-name",-1769107767));
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54595__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54595__$1,new cljs.core.Keyword(null,"js","js",1768080579));
$CLJS.SHADOW_ENV.setLoaded(output_name);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load JS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([resource_name], 0));

shadow.cljs.devtools.client.env.before_load_src(src);

try{shadow.cljs.devtools.client.browser.script_eval([cljs.core.str.cljs$core$IFn$_invoke$arity$1(js),"\n//# sourceURL=",cljs.core.str.cljs$core$IFn$_invoke$arity$1($CLJS.SHADOW_ENV.scriptBase),cljs.core.str.cljs$core$IFn$_invoke$arity$1(output_name)].join(''));
}catch (e54596){var e_54986 = e54596;
if(shadow.cljs.devtools.client.env.log){
console.error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name)].join(''),e_54986);
} else {
}

throw (new Error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name),": ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(e_54986.message)].join('')));
}

var G__54987 = seq__54587;
var G__54988 = chunk__54588;
var G__54989 = count__54589;
var G__54990 = (i__54590 + (1));
seq__54587 = G__54987;
chunk__54588 = G__54988;
count__54589 = G__54989;
i__54590 = G__54990;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__54587);
if(temp__5753__auto__){
var seq__54587__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__54587__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__54587__$1);
var G__54992 = cljs.core.chunk_rest(seq__54587__$1);
var G__54993 = c__4649__auto__;
var G__54994 = cljs.core.count(c__4649__auto__);
var G__54995 = (0);
seq__54587 = G__54992;
chunk__54588 = G__54993;
count__54589 = G__54994;
i__54590 = G__54995;
continue;
} else {
var map__54597 = cljs.core.first(seq__54587__$1);
var map__54597__$1 = cljs.core.__destructure_map(map__54597);
var src = map__54597__$1;
var resource_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54597__$1,new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582));
var output_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54597__$1,new cljs.core.Keyword(null,"output-name","output-name",-1769107767));
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54597__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54597__$1,new cljs.core.Keyword(null,"js","js",1768080579));
$CLJS.SHADOW_ENV.setLoaded(output_name);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load JS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([resource_name], 0));

shadow.cljs.devtools.client.env.before_load_src(src);

try{shadow.cljs.devtools.client.browser.script_eval([cljs.core.str.cljs$core$IFn$_invoke$arity$1(js),"\n//# sourceURL=",cljs.core.str.cljs$core$IFn$_invoke$arity$1($CLJS.SHADOW_ENV.scriptBase),cljs.core.str.cljs$core$IFn$_invoke$arity$1(output_name)].join(''));
}catch (e54598){var e_54998 = e54598;
if(shadow.cljs.devtools.client.env.log){
console.error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name)].join(''),e_54998);
} else {
}

throw (new Error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name),": ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(e_54998.message)].join('')));
}

var G__55000 = cljs.core.next(seq__54587__$1);
var G__55001 = null;
var G__55002 = (0);
var G__55003 = (0);
seq__54587 = G__55000;
chunk__54588 = G__55001;
count__54589 = G__55002;
i__54590 = G__55003;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.do_js_reload = (function shadow$cljs$devtools$client$browser$do_js_reload(msg,sources,complete_fn,failure_fn){
return shadow.cljs.devtools.client.env.do_js_reload.cljs$core$IFn$_invoke$arity$4(cljs.core.assoc.cljs$core$IFn$_invoke$arity$variadic(msg,new cljs.core.Keyword(null,"log-missing-fn","log-missing-fn",732676765),(function (fn_sym){
return null;
}),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"log-call-async","log-call-async",183826192),(function (fn_sym){
return shadow.cljs.devtools.client.browser.devtools_msg(["call async ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fn_sym)].join(''));
}),new cljs.core.Keyword(null,"log-call","log-call",412404391),(function (fn_sym){
return shadow.cljs.devtools.client.browser.devtools_msg(["call ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fn_sym)].join(''));
})], 0)),(function (){
return shadow.cljs.devtools.client.browser.do_js_load(sources);
}),complete_fn,failure_fn);
});
/**
 * when (require '["some-str" :as x]) is done at the REPL we need to manually call the shadow.js.require for it
 * since the file only adds the shadow$provide. only need to do this for shadow-js.
 */
shadow.cljs.devtools.client.browser.do_js_requires = (function shadow$cljs$devtools$client$browser$do_js_requires(js_requires){
var seq__54600 = cljs.core.seq(js_requires);
var chunk__54601 = null;
var count__54602 = (0);
var i__54603 = (0);
while(true){
if((i__54603 < count__54602)){
var js_ns = chunk__54601.cljs$core$IIndexed$_nth$arity$2(null,i__54603);
var require_str_55007 = ["var ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns)," = shadow.js.require(\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns),"\");"].join('');
shadow.cljs.devtools.client.browser.script_eval(require_str_55007);


var G__55008 = seq__54600;
var G__55009 = chunk__54601;
var G__55010 = count__54602;
var G__55011 = (i__54603 + (1));
seq__54600 = G__55008;
chunk__54601 = G__55009;
count__54602 = G__55010;
i__54603 = G__55011;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__54600);
if(temp__5753__auto__){
var seq__54600__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__54600__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__54600__$1);
var G__55014 = cljs.core.chunk_rest(seq__54600__$1);
var G__55015 = c__4649__auto__;
var G__55016 = cljs.core.count(c__4649__auto__);
var G__55017 = (0);
seq__54600 = G__55014;
chunk__54601 = G__55015;
count__54602 = G__55016;
i__54603 = G__55017;
continue;
} else {
var js_ns = cljs.core.first(seq__54600__$1);
var require_str_55019 = ["var ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns)," = shadow.js.require(\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns),"\");"].join('');
shadow.cljs.devtools.client.browser.script_eval(require_str_55019);


var G__55020 = cljs.core.next(seq__54600__$1);
var G__55021 = null;
var G__55022 = (0);
var G__55023 = (0);
seq__54600 = G__55020;
chunk__54601 = G__55021;
count__54602 = G__55022;
i__54603 = G__55023;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.handle_build_complete = (function shadow$cljs$devtools$client$browser$handle_build_complete(runtime,p__54614){
var map__54615 = p__54614;
var map__54615__$1 = cljs.core.__destructure_map(map__54615);
var msg = map__54615__$1;
var info = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54615__$1,new cljs.core.Keyword(null,"info","info",-317069002));
var reload_info = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54615__$1,new cljs.core.Keyword(null,"reload-info","reload-info",1648088086));
var warnings = cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.distinct.cljs$core$IFn$_invoke$arity$1((function (){var iter__4622__auto__ = (function shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__54616(s__54617){
return (new cljs.core.LazySeq(null,(function (){
var s__54617__$1 = s__54617;
while(true){
var temp__5753__auto__ = cljs.core.seq(s__54617__$1);
if(temp__5753__auto__){
var xs__6308__auto__ = temp__5753__auto__;
var map__54624 = cljs.core.first(xs__6308__auto__);
var map__54624__$1 = cljs.core.__destructure_map(map__54624);
var src = map__54624__$1;
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54624__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var warnings = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54624__$1,new cljs.core.Keyword(null,"warnings","warnings",-735437651));
if(cljs.core.not(new cljs.core.Keyword(null,"from-jar","from-jar",1050932827).cljs$core$IFn$_invoke$arity$1(src))){
var iterys__4618__auto__ = ((function (s__54617__$1,map__54624,map__54624__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__54615,map__54615__$1,msg,info,reload_info){
return (function shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__54616_$_iter__54618(s__54619){
return (new cljs.core.LazySeq(null,((function (s__54617__$1,map__54624,map__54624__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__54615,map__54615__$1,msg,info,reload_info){
return (function (){
var s__54619__$1 = s__54619;
while(true){
var temp__5753__auto____$1 = cljs.core.seq(s__54619__$1);
if(temp__5753__auto____$1){
var s__54619__$2 = temp__5753__auto____$1;
if(cljs.core.chunked_seq_QMARK_(s__54619__$2)){
var c__4620__auto__ = cljs.core.chunk_first(s__54619__$2);
var size__4621__auto__ = cljs.core.count(c__4620__auto__);
var b__54621 = cljs.core.chunk_buffer(size__4621__auto__);
if((function (){var i__54620 = (0);
while(true){
if((i__54620 < size__4621__auto__)){
var warning = cljs.core._nth(c__4620__auto__,i__54620);
cljs.core.chunk_append(b__54621,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(warning,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100),resource_name));

var G__55027 = (i__54620 + (1));
i__54620 = G__55027;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons(cljs.core.chunk(b__54621),shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__54616_$_iter__54618(cljs.core.chunk_rest(s__54619__$2)));
} else {
return cljs.core.chunk_cons(cljs.core.chunk(b__54621),null);
}
} else {
var warning = cljs.core.first(s__54619__$2);
return cljs.core.cons(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(warning,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100),resource_name),shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__54616_$_iter__54618(cljs.core.rest(s__54619__$2)));
}
} else {
return null;
}
break;
}
});})(s__54617__$1,map__54624,map__54624__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__54615,map__54615__$1,msg,info,reload_info))
,null,null));
});})(s__54617__$1,map__54624,map__54624__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__54615,map__54615__$1,msg,info,reload_info))
;
var fs__4619__auto__ = cljs.core.seq(iterys__4618__auto__(warnings));
if(fs__4619__auto__){
return cljs.core.concat.cljs$core$IFn$_invoke$arity$2(fs__4619__auto__,shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__54616(cljs.core.rest(s__54617__$1)));
} else {
var G__55029 = cljs.core.rest(s__54617__$1);
s__54617__$1 = G__55029;
continue;
}
} else {
var G__55030 = cljs.core.rest(s__54617__$1);
s__54617__$1 = G__55030;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4622__auto__(new cljs.core.Keyword(null,"sources","sources",-321166424).cljs$core$IFn$_invoke$arity$1(info));
})()));
if(shadow.cljs.devtools.client.env.log){
var seq__54626_55032 = cljs.core.seq(warnings);
var chunk__54627_55033 = null;
var count__54628_55034 = (0);
var i__54629_55035 = (0);
while(true){
if((i__54629_55035 < count__54628_55034)){
var map__54636_55036 = chunk__54627_55033.cljs$core$IIndexed$_nth$arity$2(null,i__54629_55035);
var map__54636_55037__$1 = cljs.core.__destructure_map(map__54636_55036);
var w_55038 = map__54636_55037__$1;
var msg_55039__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54636_55037__$1,new cljs.core.Keyword(null,"msg","msg",-1386103444));
var line_55040 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54636_55037__$1,new cljs.core.Keyword(null,"line","line",212345235));
var column_55041 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54636_55037__$1,new cljs.core.Keyword(null,"column","column",2078222095));
var resource_name_55042 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54636_55037__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
console.warn(["BUILD-WARNING in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name_55042)," at [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_55040),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_55041),"]\n\t",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg_55039__$1)].join(''));


var G__55043 = seq__54626_55032;
var G__55044 = chunk__54627_55033;
var G__55045 = count__54628_55034;
var G__55046 = (i__54629_55035 + (1));
seq__54626_55032 = G__55043;
chunk__54627_55033 = G__55044;
count__54628_55034 = G__55045;
i__54629_55035 = G__55046;
continue;
} else {
var temp__5753__auto___55047 = cljs.core.seq(seq__54626_55032);
if(temp__5753__auto___55047){
var seq__54626_55048__$1 = temp__5753__auto___55047;
if(cljs.core.chunked_seq_QMARK_(seq__54626_55048__$1)){
var c__4649__auto___55049 = cljs.core.chunk_first(seq__54626_55048__$1);
var G__55050 = cljs.core.chunk_rest(seq__54626_55048__$1);
var G__55051 = c__4649__auto___55049;
var G__55052 = cljs.core.count(c__4649__auto___55049);
var G__55053 = (0);
seq__54626_55032 = G__55050;
chunk__54627_55033 = G__55051;
count__54628_55034 = G__55052;
i__54629_55035 = G__55053;
continue;
} else {
var map__54647_55054 = cljs.core.first(seq__54626_55048__$1);
var map__54647_55055__$1 = cljs.core.__destructure_map(map__54647_55054);
var w_55056 = map__54647_55055__$1;
var msg_55057__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54647_55055__$1,new cljs.core.Keyword(null,"msg","msg",-1386103444));
var line_55058 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54647_55055__$1,new cljs.core.Keyword(null,"line","line",212345235));
var column_55059 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54647_55055__$1,new cljs.core.Keyword(null,"column","column",2078222095));
var resource_name_55060 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54647_55055__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
console.warn(["BUILD-WARNING in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name_55060)," at [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_55058),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_55059),"]\n\t",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg_55057__$1)].join(''));


var G__55061 = cljs.core.next(seq__54626_55048__$1);
var G__55062 = null;
var G__55063 = (0);
var G__55064 = (0);
seq__54626_55032 = G__55061;
chunk__54627_55033 = G__55062;
count__54628_55034 = G__55063;
i__54629_55035 = G__55064;
continue;
}
} else {
}
}
break;
}
} else {
}

if((!(shadow.cljs.devtools.client.env.autoload))){
return shadow.cljs.devtools.client.hud.load_end_success();
} else {
if(((cljs.core.empty_QMARK_(warnings)) || (shadow.cljs.devtools.client.env.ignore_warnings))){
var sources_to_get = shadow.cljs.devtools.client.env.filter_reload_sources(info,reload_info);
if(cljs.core.not(cljs.core.seq(sources_to_get))){
return shadow.cljs.devtools.client.hud.load_end_success();
} else {
if(cljs.core.seq(cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(msg,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"reload-info","reload-info",1648088086),new cljs.core.Keyword(null,"after-load","after-load",-1278503285)], null)))){
} else {
shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("reloading code but no :after-load hooks are configured!",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["https://shadow-cljs.github.io/docs/UsersGuide.html#_lifecycle_hooks"], 0));
}

return shadow.cljs.devtools.client.shared.load_sources(runtime,sources_to_get,(function (p1__54609_SHARP_){
return shadow.cljs.devtools.client.browser.do_js_reload(msg,p1__54609_SHARP_,shadow.cljs.devtools.client.hud.load_end_success,shadow.cljs.devtools.client.hud.load_failure);
}));
}
} else {
return null;
}
}
});
shadow.cljs.devtools.client.browser.page_load_uri = (cljs.core.truth_(goog.global.document)?goog.Uri.parse(document.location.href):null);
shadow.cljs.devtools.client.browser.match_paths = (function shadow$cljs$devtools$client$browser$match_paths(old,new$){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("file",shadow.cljs.devtools.client.browser.page_load_uri.getScheme())){
var rel_new = cljs.core.subs.cljs$core$IFn$_invoke$arity$2(new$,(1));
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(old,rel_new)) || (clojure.string.starts_with_QMARK_(old,[rel_new,"?"].join(''))))){
return rel_new;
} else {
return null;
}
} else {
var node_uri = goog.Uri.parse(old);
var node_uri_resolved = shadow.cljs.devtools.client.browser.page_load_uri.resolve(node_uri);
var node_abs = node_uri_resolved.getPath();
var and__4221__auto__ = ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$1(shadow.cljs.devtools.client.browser.page_load_uri.hasSameDomainAs(node_uri))) || (cljs.core.not(node_uri.hasDomain())));
if(and__4221__auto__){
var and__4221__auto____$1 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(node_abs,new$);
if(and__4221__auto____$1){
return new$;
} else {
return and__4221__auto____$1;
}
} else {
return and__4221__auto__;
}
}
});
shadow.cljs.devtools.client.browser.handle_asset_update = (function shadow$cljs$devtools$client$browser$handle_asset_update(p__54656){
var map__54657 = p__54656;
var map__54657__$1 = cljs.core.__destructure_map(map__54657);
var msg = map__54657__$1;
var updates = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54657__$1,new cljs.core.Keyword(null,"updates","updates",2013983452));
var seq__54658 = cljs.core.seq(updates);
var chunk__54660 = null;
var count__54661 = (0);
var i__54662 = (0);
while(true){
if((i__54662 < count__54661)){
var path = chunk__54660.cljs$core$IIndexed$_nth$arity$2(null,i__54662);
if(clojure.string.ends_with_QMARK_(path,"css")){
var seq__54750_55070 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll("link[rel=\"stylesheet\"]")));
var chunk__54754_55071 = null;
var count__54755_55072 = (0);
var i__54756_55073 = (0);
while(true){
if((i__54756_55073 < count__54755_55072)){
var node_55075 = chunk__54754_55071.cljs$core$IIndexed$_nth$arity$2(null,i__54756_55073);
if(cljs.core.not(node_55075.shadow$old)){
var path_match_55076 = shadow.cljs.devtools.client.browser.match_paths(node_55075.getAttribute("href"),path);
if(cljs.core.truth_(path_match_55076)){
var new_link_55077 = (function (){var G__54788 = node_55075.cloneNode(true);
G__54788.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_55076),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__54788;
})();
(node_55075.shadow$old = true);

(new_link_55077.onload = ((function (seq__54750_55070,chunk__54754_55071,count__54755_55072,i__54756_55073,seq__54658,chunk__54660,count__54661,i__54662,new_link_55077,path_match_55076,node_55075,path,map__54657,map__54657__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_55075);
});})(seq__54750_55070,chunk__54754_55071,count__54755_55072,i__54756_55073,seq__54658,chunk__54660,count__54661,i__54662,new_link_55077,path_match_55076,node_55075,path,map__54657,map__54657__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_55076], 0));

goog.dom.insertSiblingAfter(new_link_55077,node_55075);


var G__55078 = seq__54750_55070;
var G__55079 = chunk__54754_55071;
var G__55080 = count__54755_55072;
var G__55081 = (i__54756_55073 + (1));
seq__54750_55070 = G__55078;
chunk__54754_55071 = G__55079;
count__54755_55072 = G__55080;
i__54756_55073 = G__55081;
continue;
} else {
var G__55082 = seq__54750_55070;
var G__55083 = chunk__54754_55071;
var G__55084 = count__54755_55072;
var G__55085 = (i__54756_55073 + (1));
seq__54750_55070 = G__55082;
chunk__54754_55071 = G__55083;
count__54755_55072 = G__55084;
i__54756_55073 = G__55085;
continue;
}
} else {
var G__55086 = seq__54750_55070;
var G__55087 = chunk__54754_55071;
var G__55088 = count__54755_55072;
var G__55089 = (i__54756_55073 + (1));
seq__54750_55070 = G__55086;
chunk__54754_55071 = G__55087;
count__54755_55072 = G__55088;
i__54756_55073 = G__55089;
continue;
}
} else {
var temp__5753__auto___55090 = cljs.core.seq(seq__54750_55070);
if(temp__5753__auto___55090){
var seq__54750_55091__$1 = temp__5753__auto___55090;
if(cljs.core.chunked_seq_QMARK_(seq__54750_55091__$1)){
var c__4649__auto___55092 = cljs.core.chunk_first(seq__54750_55091__$1);
var G__55093 = cljs.core.chunk_rest(seq__54750_55091__$1);
var G__55094 = c__4649__auto___55092;
var G__55095 = cljs.core.count(c__4649__auto___55092);
var G__55096 = (0);
seq__54750_55070 = G__55093;
chunk__54754_55071 = G__55094;
count__54755_55072 = G__55095;
i__54756_55073 = G__55096;
continue;
} else {
var node_55097 = cljs.core.first(seq__54750_55091__$1);
if(cljs.core.not(node_55097.shadow$old)){
var path_match_55098 = shadow.cljs.devtools.client.browser.match_paths(node_55097.getAttribute("href"),path);
if(cljs.core.truth_(path_match_55098)){
var new_link_55099 = (function (){var G__54795 = node_55097.cloneNode(true);
G__54795.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_55098),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__54795;
})();
(node_55097.shadow$old = true);

(new_link_55099.onload = ((function (seq__54750_55070,chunk__54754_55071,count__54755_55072,i__54756_55073,seq__54658,chunk__54660,count__54661,i__54662,new_link_55099,path_match_55098,node_55097,seq__54750_55091__$1,temp__5753__auto___55090,path,map__54657,map__54657__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_55097);
});})(seq__54750_55070,chunk__54754_55071,count__54755_55072,i__54756_55073,seq__54658,chunk__54660,count__54661,i__54662,new_link_55099,path_match_55098,node_55097,seq__54750_55091__$1,temp__5753__auto___55090,path,map__54657,map__54657__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_55098], 0));

goog.dom.insertSiblingAfter(new_link_55099,node_55097);


var G__55100 = cljs.core.next(seq__54750_55091__$1);
var G__55101 = null;
var G__55102 = (0);
var G__55103 = (0);
seq__54750_55070 = G__55100;
chunk__54754_55071 = G__55101;
count__54755_55072 = G__55102;
i__54756_55073 = G__55103;
continue;
} else {
var G__55108 = cljs.core.next(seq__54750_55091__$1);
var G__55109 = null;
var G__55110 = (0);
var G__55111 = (0);
seq__54750_55070 = G__55108;
chunk__54754_55071 = G__55109;
count__54755_55072 = G__55110;
i__54756_55073 = G__55111;
continue;
}
} else {
var G__55114 = cljs.core.next(seq__54750_55091__$1);
var G__55115 = null;
var G__55116 = (0);
var G__55117 = (0);
seq__54750_55070 = G__55114;
chunk__54754_55071 = G__55115;
count__54755_55072 = G__55116;
i__54756_55073 = G__55117;
continue;
}
}
} else {
}
}
break;
}


var G__55118 = seq__54658;
var G__55119 = chunk__54660;
var G__55120 = count__54661;
var G__55121 = (i__54662 + (1));
seq__54658 = G__55118;
chunk__54660 = G__55119;
count__54661 = G__55120;
i__54662 = G__55121;
continue;
} else {
var G__55122 = seq__54658;
var G__55123 = chunk__54660;
var G__55124 = count__54661;
var G__55125 = (i__54662 + (1));
seq__54658 = G__55122;
chunk__54660 = G__55123;
count__54661 = G__55124;
i__54662 = G__55125;
continue;
}
} else {
var temp__5753__auto__ = cljs.core.seq(seq__54658);
if(temp__5753__auto__){
var seq__54658__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__54658__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__54658__$1);
var G__55127 = cljs.core.chunk_rest(seq__54658__$1);
var G__55128 = c__4649__auto__;
var G__55129 = cljs.core.count(c__4649__auto__);
var G__55130 = (0);
seq__54658 = G__55127;
chunk__54660 = G__55128;
count__54661 = G__55129;
i__54662 = G__55130;
continue;
} else {
var path = cljs.core.first(seq__54658__$1);
if(clojure.string.ends_with_QMARK_(path,"css")){
var seq__54800_55131 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll("link[rel=\"stylesheet\"]")));
var chunk__54804_55132 = null;
var count__54805_55133 = (0);
var i__54806_55134 = (0);
while(true){
if((i__54806_55134 < count__54805_55133)){
var node_55136 = chunk__54804_55132.cljs$core$IIndexed$_nth$arity$2(null,i__54806_55134);
if(cljs.core.not(node_55136.shadow$old)){
var path_match_55137 = shadow.cljs.devtools.client.browser.match_paths(node_55136.getAttribute("href"),path);
if(cljs.core.truth_(path_match_55137)){
var new_link_55138 = (function (){var G__54842 = node_55136.cloneNode(true);
G__54842.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_55137),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__54842;
})();
(node_55136.shadow$old = true);

(new_link_55138.onload = ((function (seq__54800_55131,chunk__54804_55132,count__54805_55133,i__54806_55134,seq__54658,chunk__54660,count__54661,i__54662,new_link_55138,path_match_55137,node_55136,path,seq__54658__$1,temp__5753__auto__,map__54657,map__54657__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_55136);
});})(seq__54800_55131,chunk__54804_55132,count__54805_55133,i__54806_55134,seq__54658,chunk__54660,count__54661,i__54662,new_link_55138,path_match_55137,node_55136,path,seq__54658__$1,temp__5753__auto__,map__54657,map__54657__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_55137], 0));

goog.dom.insertSiblingAfter(new_link_55138,node_55136);


var G__55140 = seq__54800_55131;
var G__55142 = chunk__54804_55132;
var G__55143 = count__54805_55133;
var G__55144 = (i__54806_55134 + (1));
seq__54800_55131 = G__55140;
chunk__54804_55132 = G__55142;
count__54805_55133 = G__55143;
i__54806_55134 = G__55144;
continue;
} else {
var G__55146 = seq__54800_55131;
var G__55147 = chunk__54804_55132;
var G__55148 = count__54805_55133;
var G__55149 = (i__54806_55134 + (1));
seq__54800_55131 = G__55146;
chunk__54804_55132 = G__55147;
count__54805_55133 = G__55148;
i__54806_55134 = G__55149;
continue;
}
} else {
var G__55151 = seq__54800_55131;
var G__55152 = chunk__54804_55132;
var G__55153 = count__54805_55133;
var G__55154 = (i__54806_55134 + (1));
seq__54800_55131 = G__55151;
chunk__54804_55132 = G__55152;
count__54805_55133 = G__55153;
i__54806_55134 = G__55154;
continue;
}
} else {
var temp__5753__auto___55155__$1 = cljs.core.seq(seq__54800_55131);
if(temp__5753__auto___55155__$1){
var seq__54800_55156__$1 = temp__5753__auto___55155__$1;
if(cljs.core.chunked_seq_QMARK_(seq__54800_55156__$1)){
var c__4649__auto___55159 = cljs.core.chunk_first(seq__54800_55156__$1);
var G__55160 = cljs.core.chunk_rest(seq__54800_55156__$1);
var G__55161 = c__4649__auto___55159;
var G__55162 = cljs.core.count(c__4649__auto___55159);
var G__55163 = (0);
seq__54800_55131 = G__55160;
chunk__54804_55132 = G__55161;
count__54805_55133 = G__55162;
i__54806_55134 = G__55163;
continue;
} else {
var node_55164 = cljs.core.first(seq__54800_55156__$1);
if(cljs.core.not(node_55164.shadow$old)){
var path_match_55166 = shadow.cljs.devtools.client.browser.match_paths(node_55164.getAttribute("href"),path);
if(cljs.core.truth_(path_match_55166)){
var new_link_55168 = (function (){var G__54848 = node_55164.cloneNode(true);
G__54848.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_55166),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__54848;
})();
(node_55164.shadow$old = true);

(new_link_55168.onload = ((function (seq__54800_55131,chunk__54804_55132,count__54805_55133,i__54806_55134,seq__54658,chunk__54660,count__54661,i__54662,new_link_55168,path_match_55166,node_55164,seq__54800_55156__$1,temp__5753__auto___55155__$1,path,seq__54658__$1,temp__5753__auto__,map__54657,map__54657__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_55164);
});})(seq__54800_55131,chunk__54804_55132,count__54805_55133,i__54806_55134,seq__54658,chunk__54660,count__54661,i__54662,new_link_55168,path_match_55166,node_55164,seq__54800_55156__$1,temp__5753__auto___55155__$1,path,seq__54658__$1,temp__5753__auto__,map__54657,map__54657__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_55166], 0));

goog.dom.insertSiblingAfter(new_link_55168,node_55164);


var G__55171 = cljs.core.next(seq__54800_55156__$1);
var G__55172 = null;
var G__55173 = (0);
var G__55174 = (0);
seq__54800_55131 = G__55171;
chunk__54804_55132 = G__55172;
count__54805_55133 = G__55173;
i__54806_55134 = G__55174;
continue;
} else {
var G__55176 = cljs.core.next(seq__54800_55156__$1);
var G__55177 = null;
var G__55178 = (0);
var G__55179 = (0);
seq__54800_55131 = G__55176;
chunk__54804_55132 = G__55177;
count__54805_55133 = G__55178;
i__54806_55134 = G__55179;
continue;
}
} else {
var G__55180 = cljs.core.next(seq__54800_55156__$1);
var G__55181 = null;
var G__55182 = (0);
var G__55183 = (0);
seq__54800_55131 = G__55180;
chunk__54804_55132 = G__55181;
count__54805_55133 = G__55182;
i__54806_55134 = G__55183;
continue;
}
}
} else {
}
}
break;
}


var G__55185 = cljs.core.next(seq__54658__$1);
var G__55186 = null;
var G__55187 = (0);
var G__55188 = (0);
seq__54658 = G__55185;
chunk__54660 = G__55186;
count__54661 = G__55187;
i__54662 = G__55188;
continue;
} else {
var G__55189 = cljs.core.next(seq__54658__$1);
var G__55190 = null;
var G__55191 = (0);
var G__55192 = (0);
seq__54658 = G__55189;
chunk__54660 = G__55190;
count__54661 = G__55191;
i__54662 = G__55192;
continue;
}
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.global_eval = (function shadow$cljs$devtools$client$browser$global_eval(js){
if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2("undefined",typeof(module))){
return eval(js);
} else {
return (0,eval)(js);;
}
});
shadow.cljs.devtools.client.browser.repl_init = (function shadow$cljs$devtools$client$browser$repl_init(runtime,p__54877){
var map__54878 = p__54877;
var map__54878__$1 = cljs.core.__destructure_map(map__54878);
var repl_state = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54878__$1,new cljs.core.Keyword(null,"repl-state","repl-state",-1733780387));
return shadow.cljs.devtools.client.shared.load_sources(runtime,cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2(shadow.cljs.devtools.client.env.src_is_loaded_QMARK_,new cljs.core.Keyword(null,"repl-sources","repl-sources",723867535).cljs$core$IFn$_invoke$arity$1(repl_state))),(function (sources){
shadow.cljs.devtools.client.browser.do_js_load(sources);

return shadow.cljs.devtools.client.browser.devtools_msg("ready!");
}));
});
shadow.cljs.devtools.client.browser.runtime_info = (((typeof SHADOW_CONFIG !== 'undefined'))?shadow.json.to_clj.cljs$core$IFn$_invoke$arity$1(SHADOW_CONFIG):null);
shadow.cljs.devtools.client.browser.client_info = cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([shadow.cljs.devtools.client.browser.runtime_info,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"host","host",-1558485167),(cljs.core.truth_(goog.global.document)?new cljs.core.Keyword(null,"browser","browser",828191719):new cljs.core.Keyword(null,"browser-worker","browser-worker",1638998282)),new cljs.core.Keyword(null,"user-agent","user-agent",1220426212),[(cljs.core.truth_(goog.userAgent.OPERA)?"Opera":(cljs.core.truth_(goog.userAgent.product.CHROME)?"Chrome":(cljs.core.truth_(goog.userAgent.IE)?"MSIE":(cljs.core.truth_(goog.userAgent.EDGE)?"Edge":(cljs.core.truth_(goog.userAgent.GECKO)?"Firefox":(cljs.core.truth_(goog.userAgent.SAFARI)?"Safari":(cljs.core.truth_(goog.userAgent.WEBKIT)?"Webkit":null)))))))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.userAgent.VERSION)," [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.userAgent.PLATFORM),"]"].join(''),new cljs.core.Keyword(null,"dom","dom",-1236537922),(!((goog.global.document == null)))], null)], 0));
if((typeof shadow !== 'undefined') && (typeof shadow.cljs !== 'undefined') && (typeof shadow.cljs.devtools !== 'undefined') && (typeof shadow.cljs.devtools.client !== 'undefined') && (typeof shadow.cljs.devtools.client.browser !== 'undefined') && (typeof shadow.cljs.devtools.client.browser.ws_was_welcome_ref !== 'undefined')){
} else {
shadow.cljs.devtools.client.browser.ws_was_welcome_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(false);
}
if(((shadow.cljs.devtools.client.env.enabled) && ((shadow.cljs.devtools.client.env.worker_client_id > (0))))){
(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$remote$runtime$api$IEvalJS$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$remote$runtime$api$IEvalJS$_js_eval$arity$2 = (function (this$,code){
var this$__$1 = this;
return shadow.cljs.devtools.client.browser.global_eval(code);
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_invoke$arity$2 = (function (this$,p__54890){
var map__54891 = p__54890;
var map__54891__$1 = cljs.core.__destructure_map(map__54891);
var _ = map__54891__$1;
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54891__$1,new cljs.core.Keyword(null,"js","js",1768080579));
var this$__$1 = this;
return shadow.cljs.devtools.client.browser.global_eval(js);
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_repl_init$arity$4 = (function (runtime,p__54895,done,error){
var map__54896 = p__54895;
var map__54896__$1 = cljs.core.__destructure_map(map__54896);
var repl_sources = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54896__$1,new cljs.core.Keyword(null,"repl-sources","repl-sources",723867535));
var runtime__$1 = this;
return shadow.cljs.devtools.client.shared.load_sources(runtime__$1,cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2(shadow.cljs.devtools.client.env.src_is_loaded_QMARK_,repl_sources)),(function (sources){
shadow.cljs.devtools.client.browser.do_js_load(sources);

return (done.cljs$core$IFn$_invoke$arity$0 ? done.cljs$core$IFn$_invoke$arity$0() : done.call(null));
}));
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_repl_require$arity$4 = (function (runtime,p__54902,done,error){
var map__54903 = p__54902;
var map__54903__$1 = cljs.core.__destructure_map(map__54903);
var msg = map__54903__$1;
var sources = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54903__$1,new cljs.core.Keyword(null,"sources","sources",-321166424));
var reload_namespaces = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54903__$1,new cljs.core.Keyword(null,"reload-namespaces","reload-namespaces",250210134));
var js_requires = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54903__$1,new cljs.core.Keyword(null,"js-requires","js-requires",-1311472051));
var runtime__$1 = this;
var sources_to_load = cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p__54904){
var map__54905 = p__54904;
var map__54905__$1 = cljs.core.__destructure_map(map__54905);
var src = map__54905__$1;
var provides = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54905__$1,new cljs.core.Keyword(null,"provides","provides",-1634397992));
var and__4221__auto__ = shadow.cljs.devtools.client.env.src_is_loaded_QMARK_(src);
if(cljs.core.truth_(and__4221__auto__)){
return cljs.core.not(cljs.core.some(reload_namespaces,provides));
} else {
return and__4221__auto__;
}
}),sources));
if(cljs.core.not(cljs.core.seq(sources_to_load))){
var G__54908 = cljs.core.PersistentVector.EMPTY;
return (done.cljs$core$IFn$_invoke$arity$1 ? done.cljs$core$IFn$_invoke$arity$1(G__54908) : done.call(null,G__54908));
} else {
return shadow.remote.runtime.shared.call.cljs$core$IFn$_invoke$arity$3(runtime__$1,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"op","op",-1882987955),new cljs.core.Keyword(null,"cljs-load-sources","cljs-load-sources",-1458295962),new cljs.core.Keyword(null,"to","to",192099007),shadow.cljs.devtools.client.env.worker_client_id,new cljs.core.Keyword(null,"sources","sources",-321166424),cljs.core.into.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentVector.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582)),sources_to_load)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cljs-sources","cljs-sources",31121610),(function (p__54912){
var map__54913 = p__54912;
var map__54913__$1 = cljs.core.__destructure_map(map__54913);
var msg__$1 = map__54913__$1;
var sources__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54913__$1,new cljs.core.Keyword(null,"sources","sources",-321166424));
try{shadow.cljs.devtools.client.browser.do_js_load(sources__$1);

if(cljs.core.seq(js_requires)){
shadow.cljs.devtools.client.browser.do_js_requires(js_requires);
} else {
}

return (done.cljs$core$IFn$_invoke$arity$1 ? done.cljs$core$IFn$_invoke$arity$1(sources_to_load) : done.call(null,sources_to_load));
}catch (e54916){var ex = e54916;
return (error.cljs$core$IFn$_invoke$arity$1 ? error.cljs$core$IFn$_invoke$arity$1(ex) : error.call(null,ex));
}})], null));
}
}));

shadow.cljs.devtools.client.shared.add_plugin_BANG_(new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282),cljs.core.PersistentHashSet.EMPTY,(function (p__54920){
var map__54922 = p__54920;
var map__54922__$1 = cljs.core.__destructure_map(map__54922);
var env = map__54922__$1;
var runtime = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54922__$1,new cljs.core.Keyword(null,"runtime","runtime",-1331573996));
var svc = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"runtime","runtime",-1331573996),runtime], null);
shadow.remote.runtime.api.add_extension(runtime,new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"on-welcome","on-welcome",1895317125),(function (){
cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,true);

shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

shadow.cljs.devtools.client.env.patch_goog_BANG_();

return shadow.cljs.devtools.client.browser.devtools_msg(["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"client-id","client-id",-464622140).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(new cljs.core.Keyword(null,"state-ref","state-ref",2127874952).cljs$core$IFn$_invoke$arity$1(runtime))))," ready!"].join(''));
}),new cljs.core.Keyword(null,"on-disconnect","on-disconnect",-809021814),(function (e){
if(cljs.core.truth_(cljs.core.deref(shadow.cljs.devtools.client.browser.ws_was_welcome_ref))){
shadow.cljs.devtools.client.hud.connection_error("The Websocket connection was closed!");

return cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,false);
} else {
return null;
}
}),new cljs.core.Keyword(null,"on-reconnect","on-reconnect",1239988702),(function (e){
return shadow.cljs.devtools.client.hud.connection_error("Reconnecting ...");
}),new cljs.core.Keyword(null,"ops","ops",1237330063),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"access-denied","access-denied",959449406),(function (msg){
cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,false);

return shadow.cljs.devtools.client.hud.connection_error(["Stale Output! Your loaded JS was not produced by the running shadow-cljs instance."," Is the watch for this build running?"].join(''));
}),new cljs.core.Keyword(null,"cljs-runtime-init","cljs-runtime-init",1305890232),(function (msg){
return shadow.cljs.devtools.client.browser.repl_init(runtime,msg);
}),new cljs.core.Keyword(null,"cljs-asset-update","cljs-asset-update",1224093028),(function (p__54962){
var map__54963 = p__54962;
var map__54963__$1 = cljs.core.__destructure_map(map__54963);
var msg = map__54963__$1;
var updates = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54963__$1,new cljs.core.Keyword(null,"updates","updates",2013983452));
return shadow.cljs.devtools.client.browser.handle_asset_update(msg);
}),new cljs.core.Keyword(null,"cljs-build-configure","cljs-build-configure",-2089891268),(function (msg){
return null;
}),new cljs.core.Keyword(null,"cljs-build-start","cljs-build-start",-725781241),(function (msg){
shadow.cljs.devtools.client.hud.hud_hide();

shadow.cljs.devtools.client.hud.load_start();

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-start","build-start",-959649480)));
}),new cljs.core.Keyword(null,"cljs-build-complete","cljs-build-complete",273626153),(function (msg){
var msg__$1 = shadow.cljs.devtools.client.env.add_warnings_to_info(msg);
shadow.cljs.devtools.client.hud.hud_warnings(msg__$1);

shadow.cljs.devtools.client.browser.handle_build_complete(runtime,msg__$1);

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg__$1,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-complete","build-complete",-501868472)));
}),new cljs.core.Keyword(null,"cljs-build-failure","cljs-build-failure",1718154990),(function (msg){
shadow.cljs.devtools.client.hud.load_end();

shadow.cljs.devtools.client.hud.hud_error(msg);

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-failure","build-failure",-2107487466)));
}),new cljs.core.Keyword("shadow.cljs.devtools.client.env","worker-notify","shadow.cljs.devtools.client.env/worker-notify",-1456820670),(function (p__54972){
var map__54973 = p__54972;
var map__54973__$1 = cljs.core.__destructure_map(map__54973);
var event_op = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54973__$1,new cljs.core.Keyword(null,"event-op","event-op",200358057));
var client_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54973__$1,new cljs.core.Keyword(null,"client-id","client-id",-464622140));
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"client-disconnect","client-disconnect",640227957),event_op)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(client_id,shadow.cljs.devtools.client.env.worker_client_id)))){
shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

return shadow.cljs.devtools.client.hud.connection_error("The watch for this build was stopped!");
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"client-connect","client-connect",-1113973888),event_op)){
shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

return shadow.cljs.devtools.client.hud.connection_error("The watch for this build was restarted. Reload required!");
} else {
return null;
}
}
})], null)], null));

return svc;
}),(function (p__54974){
var map__54975 = p__54974;
var map__54975__$1 = cljs.core.__destructure_map(map__54975);
var svc = map__54975__$1;
var runtime = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54975__$1,new cljs.core.Keyword(null,"runtime","runtime",-1331573996));
return shadow.remote.runtime.api.del_extension(runtime,new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282));
}));

shadow.cljs.devtools.client.shared.init_runtime_BANG_(shadow.cljs.devtools.client.browser.client_info,shadow.cljs.devtools.client.websocket.start,shadow.cljs.devtools.client.websocket.send,shadow.cljs.devtools.client.websocket.stop);
} else {
}

//# sourceMappingURL=shadow.cljs.devtools.client.browser.js.map
