// Compiled by ClojureScript 1.10.520 {}
goog.provide('hoplon.core');
goog.require('cljs.core');
goog.require('goog.Uri');
goog.require('goog.object');
goog.require('clojure.set');
goog.require('javelin.core');
goog.require('cljs.reader');
goog.require('clojure.string');



cljs.core.enable_console_print_BANG_.call(null);
/**
 * Is the application running in a prerendering container (eg. PhantomJS via
 *   the prerender task)?
 */
hoplon.core.prerendering_QMARK_ = (new goog.Uri(window.location.href)).getParameterValue("prerendering");
/**
 * This is an internal implementation detail, exposed for the convenience of
 *   the hoplon.core/static macro. Experimental.
 */
hoplon.core.static_elements = cljs.core.reduce.call(null,(function (p1__30409_SHARP_,p2__30410_SHARP_){
return cljs.core.assoc.call(null,p1__30409_SHARP_,p2__30410_SHARP_.getAttribute("static-id"),p2__30410_SHARP_);
}),cljs.core.PersistentArrayMap.EMPTY,document.querySelector("[static-id]"));
/**
 * Public helper.
 *   Adds f as a watcher to ref and evaluates (f init @ref) once. The watcher
 *   f is a function of two arguments: the previous and next values. If init is
 *   not provided the default (nil) will be used.
 */
hoplon.core.do_watch = (function hoplon$core$do_watch(var_args){
var G__30412 = arguments.length;
switch (G__30412) {
case 2:
return hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$2 = (function (ref,f){
return hoplon.core.do_watch.call(null,ref,null,f);
});

hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$3 = (function (ref,init,f){
var k = cljs.core.gensym.call(null);
f.call(null,init,cljs.core.deref.call(null,ref));

cljs.core.add_watch.call(null,ref,k,((function (k){
return (function (_,___$1,old,new$){
return f.call(null,old,new$);
});})(k))
);

return k;
});

hoplon.core.do_watch.cljs$lang$maxFixedArity = 3;

/**
 * Public helper.
 *   Experimental.
 */
hoplon.core.bust_cache = (function hoplon$core$bust_cache(path){
var vec__30414 = cljs.core.reverse.call(null,clojure.string.split.call(null,path,/\//));
var seq__30415 = cljs.core.seq.call(null,vec__30414);
var first__30416 = cljs.core.first.call(null,seq__30415);
var seq__30415__$1 = cljs.core.next.call(null,seq__30415);
var f = first__30416;
var more = seq__30415__$1;
var vec__30417 = clojure.string.split.call(null,f,/\./,(2));
var f1 = cljs.core.nth.call(null,vec__30417,(0),null);
var f2 = cljs.core.nth.call(null,vec__30417,(1),null);
return clojure.string.join.call(null,"/",cljs.core.reverse.call(null,cljs.core.conj.call(null,more,clojure.string.join.call(null,".",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [[cljs.core.str.cljs$core$IFn$_invoke$arity$1(f1),".","f7e618ca92474f3cb9af852a0da6f3d1"].join(''),f2], null)))));
});
/**
 * Public helper.
 *   Class normalization for attribute providers.
 */
hoplon.core.normalize_class = (function hoplon$core$normalize_class(kvs){
var __GT_map = (function (p1__30420_SHARP_){
return cljs.core.zipmap.call(null,p1__30420_SHARP_,cljs.core.repeat.call(null,true));
});
if(cljs.core.map_QMARK_.call(null,kvs)){
return kvs;
} else {
return __GT_map.call(null,((typeof kvs === 'string')?kvs.split(/\s+/):cljs.core.seq.call(null,kvs)));
}
});
hoplon.core.child_vec = (function hoplon$core$child_vec(this$){
var x = this$.childNodes;
var l = x.length;
var i = (0);
var ret = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);
while(true){
var or__4131__auto__ = (function (){var and__4120__auto__ = cljs.core._EQ_.call(null,i,l);
if(and__4120__auto__){
return cljs.core.persistent_BANG_.call(null,ret);
} else {
return and__4120__auto__;
}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
var G__30421 = (i + (1));
var G__30422 = cljs.core.conj_BANG_.call(null,ret,x.item(i));
i = G__30421;
ret = G__30422;
continue;
}
break;
}
});
hoplon.core.vflatten = (function hoplon$core$vflatten(var_args){
var G__30424 = arguments.length;
switch (G__30424) {
case 1:
return hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$1 = (function (tree){
return cljs.core.persistent_BANG_.call(null,hoplon.core.vflatten.call(null,tree,cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY)));
});

hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$2 = (function (tree,ret){
var l = cljs.core.count.call(null,tree);
var i = (0);
while(true){
if(cljs.core._EQ_.call(null,i,l)){
return ret;
} else {
var x = cljs.core.nth.call(null,tree,i);
if((!(cljs.core.sequential_QMARK_.call(null,x)))){
cljs.core.conj_BANG_.call(null,ret,x);
} else {
hoplon.core.vflatten.call(null,x,ret);
}

var G__30426 = (i + (1));
i = G__30426;
continue;
}
break;
}
});

hoplon.core.vflatten.cljs$lang$maxFixedArity = 2;


/**
 * @interface
 */
hoplon.core.INode = function(){};

hoplon.core.node = (function hoplon$core$node(this$){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$INode$node$arity$1 == null)))))){
return this$.hoplon$core$INode$node$arity$1(this$);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core.node[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$);
} else {
var m__4431__auto__ = (hoplon.core.node["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"INode.node",this$);
}
}
}
});

goog.object.set(hoplon.core.INode,"string",true);

goog.object.set(hoplon.core.node,"string",(function (this$){
return hoplon.core.$text.call(null,this$);
}));
goog.object.set(hoplon.core.INode,"number",true);

goog.object.set(hoplon.core.node,"number",(function (this$){
return hoplon.core.$text.call(null,cljs.core.str.cljs$core$IFn$_invoke$arity$1(this$));
}));
hoplon.core.__GT_node = (function hoplon$core$__GT_node(x){
if((((!((x == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === x.hoplon$core$INode$))))?true:(((!x.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.INode,x):false)):cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.INode,x))){
return hoplon.core.node.call(null,x);
} else {
return x;
}
});
hoplon.core.removeChild = Element.prototype.removeChild;
hoplon.core.appendChild = Element.prototype.appendChild;
hoplon.core.insertBefore = Element.prototype.insertBefore;
hoplon.core.replaceChild = Element.prototype.replaceChild;
hoplon.core.setAttribute = Element.prototype.setAttribute;
hoplon.core.merge_kids = (function hoplon$core$merge_kids(this$,_,new$){
var new$__$1 = cljs.core.mapv.call(null,hoplon.core.__GT_node,cljs.core.reduce.call(null,(function (p1__30429_SHARP_,p2__30428_SHARP_){
if((p2__30428_SHARP_ == null)){
return p1__30429_SHARP_;
} else {
return cljs.core.conj.call(null,p1__30429_SHARP_,p2__30428_SHARP_);
}
}),cljs.core.PersistentVector.EMPTY,hoplon.core.vflatten.call(null,new$)));
var new_QMARK_ = cljs.core.set.call(null,new$__$1);
var G__30436 = new$__$1;
var vec__30438 = G__30436;
var seq__30439 = cljs.core.seq.call(null,vec__30438);
var first__30440 = cljs.core.first.call(null,seq__30439);
var seq__30439__$1 = cljs.core.next.call(null,seq__30439);
var x = first__30440;
var xs = seq__30439__$1;
var G__30437 = hoplon.core.child_vec.call(null,this$);
var vec__30441 = G__30437;
var seq__30442 = cljs.core.seq.call(null,vec__30441);
var first__30443 = cljs.core.first.call(null,seq__30442);
var seq__30442__$1 = cljs.core.next.call(null,seq__30442);
var k = first__30443;
var ks = seq__30442__$1;
var kids = vec__30441;
var G__30436__$1 = G__30436;
var G__30437__$1 = G__30437;
while(true){
var vec__30450 = G__30436__$1;
var seq__30451 = cljs.core.seq.call(null,vec__30450);
var first__30452 = cljs.core.first.call(null,seq__30451);
var seq__30451__$1 = cljs.core.next.call(null,seq__30451);
var x__$1 = first__30452;
var xs__$1 = seq__30451__$1;
var vec__30453 = G__30437__$1;
var seq__30454 = cljs.core.seq.call(null,vec__30453);
var first__30455 = cljs.core.first.call(null,seq__30454);
var seq__30454__$1 = cljs.core.next.call(null,seq__30454);
var k__$1 = first__30455;
var ks__$1 = seq__30454__$1;
var kids__$1 = vec__30453;
if(cljs.core.truth_((function (){var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return k__$1;
}
})())){
var G__30456 = xs__$1;
var G__30457 = ((cljs.core._EQ_.call(null,x__$1,k__$1))?ks__$1:((cljs.core.not.call(null,k__$1))?(function (){var ks__$2 = ks__$1;
hoplon.core.appendChild.call(this$,x__$1);

return ks__$2;
})():((cljs.core.not.call(null,x__$1))?(function (){var ks__$2 = ks__$1;
if(cljs.core.truth_(new_QMARK_.call(null,k__$1))){
} else {
hoplon.core.removeChild.call(this$,k__$1);
}

return ks__$2;
})():(function (){var kids__$2 = kids__$1;
hoplon.core.insertBefore.call(this$,x__$1,k__$1);

return kids__$2;
})()
)));
G__30436__$1 = G__30456;
G__30437__$1 = G__30457;
continue;
} else {
return null;
}
break;
}
});
hoplon.core.ensure_kids_BANG_ = (function hoplon$core$ensure_kids_BANG_(this$){
var this$__$1 = this$;
if(cljs.core.truth_(this$__$1.hoplonKids)){
} else {
var kids_30458 = cljs.core.atom.call(null,hoplon.core.child_vec.call(null,this$__$1));
this$__$1.hoplonKids = kids_30458;

hoplon.core.do_watch.call(null,kids_30458,cljs.core.partial.call(null,hoplon.core.merge_kids,this$__$1));
}

return this$__$1;
});
hoplon.core.remove_all_kids_BANG_ = (function hoplon$core$remove_all_kids_BANG_(this$){
this$.hoplonKids = null;

return hoplon.core.merge_kids.call(null,this$,null,null);
});
/**
 * Returns true if elem is a native element. Native elements' children
 *   are not managed by Hoplon.
 */
hoplon.core.native_QMARK_ = (function hoplon$core$native_QMARK_(elem){
return (((elem instanceof Element)) && ((elem.hoplonKids == null)));
});
/**
 * Returns true if elem is a managed element. Managed elements have
 *   their children managed by Hoplon.
 */
hoplon.core.managed_QMARK_ = (function hoplon$core$managed_QMARK_(elem){
return (!(hoplon.core.native_QMARK_.call(null,elem)));
});
/**
 * Appends `child` to `parent` for the case of `parent` being a
 *   managed element.
 */
hoplon.core.managed_append_child = (function hoplon$core$managed_append_child(parent,child,kidfn){
var child__$1 = child;
hoplon.core.ensure_kids_BANG_.call(null,parent);

var kids_30461 = kidfn.call(null,parent);
var i_30462 = cljs.core.count.call(null,cljs.core.deref.call(null,kids_30461));
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,child__$1))){
hoplon.core.do_watch.call(null,child__$1,((function (kids_30461,i_30462,child__$1){
return (function (p1__30460_SHARP_,p2__30459_SHARP_){
return cljs.core.swap_BANG_.call(null,kids_30461,cljs.core.assoc,i_30462,p2__30459_SHARP_);
});})(kids_30461,i_30462,child__$1))
);
} else {
cljs.core.swap_BANG_.call(null,kids_30461,cljs.core.assoc,i_30462,child__$1);
}

return child__$1;
});
hoplon.core.set_appendChild_BANG_ = (function hoplon$core$set_appendChild_BANG_(this$,kidfn){
return this$.appendChild = (function (child){
var this$__$1 = this;
if(cljs.core.truth_(child.parentNode)){
child.parentNode.removeChild(child);
} else {
}

if(((hoplon.core.native_QMARK_.call(null,this$__$1)) && (cljs.core.not.call(null,javelin.core.cell_QMARK_.call(null,child))))){
return hoplon.core.appendChild.call(this$__$1,child);
} else {
if(cljs.core.truth_((function (){var and__4120__auto__ = hoplon.core.native_QMARK_.call(null,this$__$1);
if(and__4120__auto__){
return javelin.core.cell_QMARK_.call(null,child);
} else {
return and__4120__auto__;
}
})())){
return hoplon.core.managed_append_child.call(null,this$__$1,child,kidfn);
} else {
if(hoplon.core.managed_QMARK_.call(null,this$__$1)){
return hoplon.core.managed_append_child.call(null,this$__$1,child,kidfn);
} else {
throw cljs.core.ex_info.call(null,"Unexpected child type",new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"reason","reason",-2070751759),new cljs.core.Keyword("hoplon.core","unexpected-child-type","hoplon.core/unexpected-child-type",1756641127),new cljs.core.Keyword(null,"child","child",623967545),child,new cljs.core.Keyword(null,"native?","native?",-1916990868),hoplon.core.native_QMARK_.call(null,child),new cljs.core.Keyword(null,"managed?","managed?",-1222195407),hoplon.core.managed_QMARK_.call(null,child),new cljs.core.Keyword(null,"this","this",-611633625),this$__$1], null));

}
}
}
});
});
hoplon.core.set_removeChild_BANG_ = (function hoplon$core$set_removeChild_BANG_(this$,kidfn){
return this$.removeChild = (function (x){
var this$__$1 = this;
var x__$1 = x;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (x__$1,this$__$1){
return (function (p1__30463_SHARP_){
return cljs.core.into.call(null,cljs.core.PersistentVector.EMPTY,cljs.core.remove.call(null,cljs.core.partial.call(null,cljs.core._EQ_,x__$1),p1__30463_SHARP_));
});})(x__$1,this$__$1))
);

return x__$1;
});
});
hoplon.core.set_insertBefore_BANG_ = (function hoplon$core$set_insertBefore_BANG_(this$,kidfn){
return this$.insertBefore = (function (x,y){
var this$__$1 = this;
var x__$1 = x;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

if(cljs.core.not.call(null,y)){
cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),cljs.core.conj,x__$1);
} else {
if(cljs.core.not_EQ_.call(null,x__$1,y)){
cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (x__$1,this$__$1){
return (function (p1__30464_SHARP_){
return cljs.core.vec.call(null,cljs.core.mapcat.call(null,((function (x__$1,this$__$1){
return (function (z){
if(cljs.core._EQ_.call(null,z,y)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x__$1,z], null);
} else {
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [z], null);
}
});})(x__$1,this$__$1))
,p1__30464_SHARP_));
});})(x__$1,this$__$1))
);
} else {
}
}

return x__$1;
});
});
hoplon.core.set_replaceChild_BANG_ = (function hoplon$core$set_replaceChild_BANG_(this$,kidfn){
return this$.replaceChild = (function (x,y){
var this$__$1 = this;
var y__$1 = y;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (y__$1,this$__$1){
return (function (p1__30465_SHARP_){
return cljs.core.mapv.call(null,((function (y__$1,this$__$1){
return (function (z){
if(cljs.core._EQ_.call(null,z,y__$1)){
return x;
} else {
return z;
}
});})(y__$1,this$__$1))
,p1__30465_SHARP_);
});})(y__$1,this$__$1))
);

return y__$1;
});
});
hoplon.core.set_setAttribute_BANG_ = (function hoplon$core$set_setAttribute_BANG_(this$,attrfn){
return this$.setAttribute = (function (k,v){
var this$__$1 = this;
var _ = undefined;
var kk_30466 = cljs.core.keyword.call(null,k);
var attr_30467 = attrfn.call(null,this$__$1);
var has_QMARK__30468 = (function (){var and__4120__auto__ = attr_30467;
if(cljs.core.truth_(and__4120__auto__)){
return cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,attr_30467),kk_30466);
} else {
return and__4120__auto__;
}
})();
if(cljs.core.truth_(has_QMARK__30468)){
cljs.core.swap_BANG_.call(null,attr_30467,cljs.core.assoc,kk_30466,v);
} else {
hoplon.core.setAttribute.call(this$__$1,k,v);
}

return _;
});
});
hoplon.core.set_appendChild_BANG_.call(null,Element.prototype,(function (p1__30469_SHARP_){
return p1__30469_SHARP_.hoplonKids;
}));
hoplon.core.set_removeChild_BANG_.call(null,Element.prototype,(function (p1__30470_SHARP_){
return p1__30470_SHARP_.hoplonKids;
}));
hoplon.core.set_insertBefore_BANG_.call(null,Element.prototype,(function (p1__30471_SHARP_){
return p1__30471_SHARP_.hoplonKids;
}));
hoplon.core.set_replaceChild_BANG_.call(null,Element.prototype,(function (p1__30472_SHARP_){
return p1__30472_SHARP_.hoplonKids;
}));

/**
 * @interface
 */
hoplon.core.ICustomElement = function(){};

hoplon.core._set_attributes_BANG_ = (function hoplon$core$_set_attributes_BANG_(this$,kvs){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2 == null)))))){
return this$.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2(this$,kvs);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._set_attributes_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,kvs);
} else {
var m__4431__auto__ = (hoplon.core._set_attributes_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,kvs);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-set-attributes!",this$);
}
}
}
});

hoplon.core._set_styles_BANG_ = (function hoplon$core$_set_styles_BANG_(this$,kvs){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2 == null)))))){
return this$.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2(this$,kvs);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._set_styles_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,kvs);
} else {
var m__4431__auto__ = (hoplon.core._set_styles_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,kvs);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-set-styles!",this$);
}
}
}
});

hoplon.core._append_child_BANG_ = (function hoplon$core$_append_child_BANG_(this$,child){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_append_child_BANG_$arity$2 == null)))))){
return this$.hoplon$core$ICustomElement$_append_child_BANG_$arity$2(this$,child);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._append_child_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,child);
} else {
var m__4431__auto__ = (hoplon.core._append_child_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,child);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-append-child!",this$);
}
}
}
});

hoplon.core._remove_child_BANG_ = (function hoplon$core$_remove_child_BANG_(this$,child){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2 == null)))))){
return this$.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2(this$,child);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._remove_child_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,child);
} else {
var m__4431__auto__ = (hoplon.core._remove_child_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,child);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-remove-child!",this$);
}
}
}
});

hoplon.core._replace_child_BANG_ = (function hoplon$core$_replace_child_BANG_(this$,new$,existing){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3 == null)))))){
return this$.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3(this$,new$,existing);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._replace_child_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,new$,existing);
} else {
var m__4431__auto__ = (hoplon.core._replace_child_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,new$,existing);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-replace-child!",this$);
}
}
}
});

hoplon.core._insert_before_BANG_ = (function hoplon$core$_insert_before_BANG_(this$,new$,existing){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3 == null)))))){
return this$.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3(this$,new$,existing);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._insert_before_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,new$,existing);
} else {
var m__4431__auto__ = (hoplon.core._insert_before_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,new$,existing);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-insert-before!",this$);
}
}
}
});

hoplon.core.set_attributes_BANG_ = (function hoplon$core$set_attributes_BANG_(var_args){
var G__30478 = arguments.length;
switch (G__30478) {
case 2:
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
var args_arr__4751__auto__ = [];
var len__4730__auto___30480 = arguments.length;
var i__4731__auto___30481 = (0);
while(true){
if((i__4731__auto___30481 < len__4730__auto___30480)){
args_arr__4751__auto__.push((arguments[i__4731__auto___30481]));

var G__30482 = (i__4731__auto___30481 + (1));
i__4731__auto___30481 = G__30482;
continue;
} else {
}
break;
}

var argseq__4752__auto__ = (new cljs.core.IndexedSeq(args_arr__4751__auto__.slice((3)),(0),null));
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__4752__auto__);

}
});

hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (this$,kvs){
return hoplon.core._set_attributes_BANG_.call(null,this$,kvs);
});

hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (this$,k,v,kvs){
return hoplon.core.set_attributes_BANG_.call(null,this$,cljs.core.apply.call(null,cljs.core.hash_map,k,v,kvs));
});

/** @this {Function} */
hoplon.core.set_attributes_BANG_.cljs$lang$applyTo = (function (seq30474){
var G__30475 = cljs.core.first.call(null,seq30474);
var seq30474__$1 = cljs.core.next.call(null,seq30474);
var G__30476 = cljs.core.first.call(null,seq30474__$1);
var seq30474__$2 = cljs.core.next.call(null,seq30474__$1);
var G__30477 = cljs.core.first.call(null,seq30474__$2);
var seq30474__$3 = cljs.core.next.call(null,seq30474__$2);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__30475,G__30476,G__30477,seq30474__$3);
});

hoplon.core.set_attributes_BANG_.cljs$lang$maxFixedArity = (3);

hoplon.core.set_styles_BANG_ = (function hoplon$core$set_styles_BANG_(var_args){
var G__30488 = arguments.length;
switch (G__30488) {
case 2:
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
var args_arr__4751__auto__ = [];
var len__4730__auto___30490 = arguments.length;
var i__4731__auto___30491 = (0);
while(true){
if((i__4731__auto___30491 < len__4730__auto___30490)){
args_arr__4751__auto__.push((arguments[i__4731__auto___30491]));

var G__30492 = (i__4731__auto___30491 + (1));
i__4731__auto___30491 = G__30492;
continue;
} else {
}
break;
}

var argseq__4752__auto__ = (new cljs.core.IndexedSeq(args_arr__4751__auto__.slice((3)),(0),null));
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__4752__auto__);

}
});

hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (this$,kvs){
return hoplon.core._set_styles_BANG_.call(null,this$,kvs);
});

hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (this$,k,v,kvs){
return hoplon.core.set_styles_BANG_.call(null,this$,cljs.core.apply.call(null,cljs.core.hash_map,k,v,kvs));
});

/** @this {Function} */
hoplon.core.set_styles_BANG_.cljs$lang$applyTo = (function (seq30484){
var G__30485 = cljs.core.first.call(null,seq30484);
var seq30484__$1 = cljs.core.next.call(null,seq30484);
var G__30486 = cljs.core.first.call(null,seq30484__$1);
var seq30484__$2 = cljs.core.next.call(null,seq30484__$1);
var G__30487 = cljs.core.first.call(null,seq30484__$2);
var seq30484__$3 = cljs.core.next.call(null,seq30484__$2);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__30485,G__30486,G__30487,seq30484__$3);
});

hoplon.core.set_styles_BANG_.cljs$lang$maxFixedArity = (3);

hoplon.core.append_child_BANG_ = (function hoplon$core$append_child_BANG_(this$,child){
return hoplon.core._append_child_BANG_.call(null,this$,child);
});
hoplon.core.remove_child_BANG_ = (function hoplon$core$remove_child_BANG_(this$,child){
return hoplon.core._remove_child_BANG_.call(null,this$,child);
});
hoplon.core.replace_child_BANG_ = (function hoplon$core$replace_child_BANG_(this$,new$,existing){
return hoplon.core._replace_child_BANG_.call(null,this$,new$,existing);
});
hoplon.core.insert_before_BANG_ = (function hoplon$core$insert_before_BANG_(this$,new$,existing){
return hoplon.core._insert_before_BANG_.call(null,this$,new$,existing);
});

/**
 * @interface
 */
hoplon.core.ICustomAttribute = function(){};

hoplon.core._attr_BANG_ = (function hoplon$core$_attr_BANG_(this$,elem,value){
if((((!((this$ == null)))) && ((!((this$.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3 == null)))))){
return this$.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3(this$,elem,value);
} else {
var x__4433__auto__ = (((this$ == null))?null:this$);
var m__4434__auto__ = (hoplon.core._attr_BANG_[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,this$,elem,value);
} else {
var m__4431__auto__ = (hoplon.core._attr_BANG_["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.call(null,this$,elem,value);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomAttribute.-attr!",this$);
}
}
}
});

hoplon.core.attribute_QMARK_ = (function hoplon$core$attribute_QMARK_(this$){
if((!((this$ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === this$.hoplon$core$ICustomAttribute$)))){
return true;
} else {
if((!this$.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.ICustomAttribute,this$);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.ICustomAttribute,this$);
}
});
cljs.core.Keyword.prototype.hoplon$core$ICustomAttribute$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.Keyword.prototype.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3 = (function (this$,elem,value){
var this$__$1 = this;
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,value))){
return hoplon.core.do_watch.call(null,value,((function (this$__$1){
return (function (p1__30495_SHARP_,p2__30494_SHARP_){
return hoplon.core.do_BANG_.call(null,elem,this$__$1,p2__30494_SHARP_);
});})(this$__$1))
);
} else {
if(cljs.core.fn_QMARK_.call(null,value)){
return hoplon.core.on_BANG_.call(null,elem,this$__$1,value);
} else {
return hoplon.core.do_BANG_.call(null,elem,this$__$1,value);

}
}
});
hoplon.core.is_ie8 = cljs.core.not.call(null,goog.object.get(window,"Node"));
hoplon.core._head_STAR_ = (((!(hoplon.core.is_ie8)))?(function (p1__30496_SHARP_){
return p1__30496_SHARP_.head;
}):(function (p1__30497_SHARP_){
return p1__30497_SHARP_.documentElement.firstChild;
}));
hoplon.core.vector_QMARK__STAR_ = (((!(hoplon.core.is_ie8)))?cljs.core.vector_QMARK_:(function (p1__30498_SHARP_){
try{return cljs.core.vector_QMARK_.call(null,p1__30498_SHARP_);
}catch (e30499){if((e30499 instanceof Error)){
var _ = e30499;
return null;
} else {
throw e30499;

}
}}));
hoplon.core.seq_QMARK__STAR_ = (((!(hoplon.core.is_ie8)))?cljs.core.seq_QMARK_:(function (p1__30500_SHARP_){
try{return cljs.core.seq_QMARK_.call(null,p1__30500_SHARP_);
}catch (e30501){if((e30501 instanceof Error)){
var _ = e30501;
return null;
} else {
throw e30501;

}
}}));
/**
 * Like cljs.core/nth but returns nil or not found if the index is outside the coll
 */
hoplon.core.safe_nth = (function hoplon$core$safe_nth(var_args){
var G__30503 = arguments.length;
switch (G__30503) {
case 2:
return hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$2 = (function (coll,index){
return hoplon.core.safe_nth.call(null,coll,index,null);
});

hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$3 = (function (coll,index,not_found){
try{return cljs.core.nth.call(null,coll,index,not_found);
}catch (e30504){if((e30504 instanceof Error)){
var _ = e30504;
return not_found;
} else {
throw e30504;

}
}});

hoplon.core.safe_nth.cljs$lang$maxFixedArity = 3;

/**
 * Executes a fuction after a delay, if no delay is passed, 0 is used as a default.
 */
hoplon.core.timeout = (function hoplon$core$timeout(var_args){
var G__30507 = arguments.length;
switch (G__30507) {
case 1:
return hoplon.core.timeout.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

hoplon.core.timeout.cljs$core$IFn$_invoke$arity$1 = (function (f){
return hoplon.core.timeout.call(null,f,(0));
});

hoplon.core.timeout.cljs$core$IFn$_invoke$arity$2 = (function (f,t){
return window.setTimeout(f,t);
});

hoplon.core.timeout.cljs$lang$maxFixedArity = 2;

hoplon.core.when_dom = (function hoplon$core$when_dom(this$,f){
if((!((this$ instanceof Element)))){
return setTimeout((function (){
return f.call(null);
}),(0));
} else {
var temp__5718__auto__ = goog.object.get(this$,"_hoplonWhenDom");
if(cljs.core.truth_(temp__5718__auto__)){
var v = temp__5718__auto__;
return v.push(f);
} else {
goog.object.set(this$,"_hoplonWhenDom",[f]);

return setTimeout(((function (temp__5718__auto__){
return (function (){
return ((function (temp__5718__auto__){
return (function hoplon$core$when_dom_$_doit(){
if(cljs.core.not.call(null,document.documentElement.contains(this$))){
return setTimeout(((function (temp__5718__auto__){
return (function (){
return hoplon$core$when_dom_$_doit.call(null);
});})(temp__5718__auto__))
,(20));
} else {
var seq__30509_30513 = cljs.core.seq.call(null,goog.object.get(this$,"_hoplonWhenDom"));
var chunk__30510_30514 = null;
var count__30511_30515 = (0);
var i__30512_30516 = (0);
while(true){
if((i__30512_30516 < count__30511_30515)){
var f_30517__$1 = cljs.core._nth.call(null,chunk__30510_30514,i__30512_30516);
f_30517__$1.call(null);


var G__30518 = seq__30509_30513;
var G__30519 = chunk__30510_30514;
var G__30520 = count__30511_30515;
var G__30521 = (i__30512_30516 + (1));
seq__30509_30513 = G__30518;
chunk__30510_30514 = G__30519;
count__30511_30515 = G__30520;
i__30512_30516 = G__30521;
continue;
} else {
var temp__5720__auto___30522 = cljs.core.seq.call(null,seq__30509_30513);
if(temp__5720__auto___30522){
var seq__30509_30523__$1 = temp__5720__auto___30522;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30509_30523__$1)){
var c__4550__auto___30524 = cljs.core.chunk_first.call(null,seq__30509_30523__$1);
var G__30525 = cljs.core.chunk_rest.call(null,seq__30509_30523__$1);
var G__30526 = c__4550__auto___30524;
var G__30527 = cljs.core.count.call(null,c__4550__auto___30524);
var G__30528 = (0);
seq__30509_30513 = G__30525;
chunk__30510_30514 = G__30526;
count__30511_30515 = G__30527;
i__30512_30516 = G__30528;
continue;
} else {
var f_30529__$1 = cljs.core.first.call(null,seq__30509_30523__$1);
f_30529__$1.call(null);


var G__30530 = cljs.core.next.call(null,seq__30509_30523__$1);
var G__30531 = null;
var G__30532 = (0);
var G__30533 = (0);
seq__30509_30513 = G__30530;
chunk__30510_30514 = G__30531;
count__30511_30515 = G__30532;
i__30512_30516 = G__30533;
continue;
}
} else {
}
}
break;
}

return goog.object.set(this$,"_hoplonWhenDom",null);
}
});})(temp__5718__auto__))
.call(null);
});})(temp__5718__auto__))
,(0));
}
}
});
hoplon.core.parse_args = (function hoplon$core$parse_args(args){
var attr = cljs.core.transient$.call(null,cljs.core.PersistentArrayMap.EMPTY);
var kids = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);
var G__30540 = args;
var vec__30541 = G__30540;
var seq__30542 = cljs.core.seq.call(null,vec__30541);
var first__30543 = cljs.core.first.call(null,seq__30542);
var seq__30542__$1 = cljs.core.next.call(null,seq__30542);
var arg = first__30543;
var args__$1 = seq__30542__$1;
var attr__$1 = attr;
var kids__$1 = kids;
var G__30540__$1 = G__30540;
while(true){
var attr__$2 = attr__$1;
var kids__$2 = kids__$1;
var vec__30547 = G__30540__$1;
var seq__30548 = cljs.core.seq.call(null,vec__30547);
var first__30549 = cljs.core.first.call(null,seq__30548);
var seq__30548__$1 = cljs.core.next.call(null,seq__30548);
var arg__$1 = first__30549;
var args__$2 = seq__30548__$1;
if(cljs.core.not.call(null,(function (){var or__4131__auto__ = arg__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return args__$2;
}
})())){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.persistent_BANG_.call(null,attr__$2),cljs.core.persistent_BANG_.call(null,kids__$2)], null);
} else {
if(cljs.core.map_QMARK_.call(null,arg__$1)){
var G__30550 = cljs.core.reduce_kv.call(null,((function (attr__$1,kids__$1,G__30540__$1,attr__$2,kids__$2,vec__30547,seq__30548,first__30549,seq__30548__$1,arg__$1,args__$2,attr,kids,G__30540,vec__30541,seq__30542,first__30543,seq__30542__$1,arg,args__$1){
return (function (p1__30534_SHARP_,p2__30535_SHARP_,p3__30536_SHARP_){
return cljs.core.assoc_BANG_.call(null,p1__30534_SHARP_,p2__30535_SHARP_,p3__30536_SHARP_);
});})(attr__$1,kids__$1,G__30540__$1,attr__$2,kids__$2,vec__30547,seq__30548,first__30549,seq__30548__$1,arg__$1,args__$2,attr,kids,G__30540,vec__30541,seq__30542,first__30543,seq__30542__$1,arg,args__$1))
,attr__$2,arg__$1);
var G__30551 = kids__$2;
var G__30552 = args__$2;
attr__$1 = G__30550;
kids__$1 = G__30551;
G__30540__$1 = G__30552;
continue;
} else {
if(hoplon.core.attribute_QMARK_.call(null,arg__$1)){
var G__30553 = cljs.core.assoc_BANG_.call(null,attr__$2,arg__$1,cljs.core.first.call(null,args__$2));
var G__30554 = kids__$2;
var G__30555 = cljs.core.rest.call(null,args__$2);
attr__$1 = G__30553;
kids__$1 = G__30554;
G__30540__$1 = G__30555;
continue;
} else {
if(cljs.core.truth_(hoplon.core.seq_QMARK__STAR_.call(null,arg__$1))){
var G__30556 = attr__$2;
var G__30557 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30558 = args__$2;
attr__$1 = G__30556;
kids__$1 = G__30557;
G__30540__$1 = G__30558;
continue;
} else {
if(cljs.core.truth_(hoplon.core.vector_QMARK__STAR_.call(null,arg__$1))){
var G__30559 = attr__$2;
var G__30560 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30561 = args__$2;
attr__$1 = G__30559;
kids__$1 = G__30560;
G__30540__$1 = G__30561;
continue;
} else {
var G__30562 = attr__$2;
var G__30563 = cljs.core.conj_BANG_.call(null,kids__$2,arg__$1);
var G__30564 = args__$2;
attr__$1 = G__30562;
kids__$1 = G__30563;
G__30540__$1 = G__30564;
continue;

}
}
}
}
}
break;
}
});
hoplon.core.add_attributes_BANG_ = (function hoplon$core$add_attributes_BANG_(this$,attr){
return cljs.core.reduce_kv.call(null,(function (p1__30566_SHARP_,p2__30565_SHARP_,p3__30567_SHARP_){
hoplon.core._attr_BANG_.call(null,p2__30565_SHARP_,p1__30566_SHARP_,p3__30567_SHARP_);

return p1__30566_SHARP_;
}),this$,attr);
});
hoplon.core.add_children_BANG_ = (function hoplon$core$add_children_BANG_(this$,p__30568){
var vec__30569 = p__30568;
var seq__30570 = cljs.core.seq.call(null,vec__30569);
var first__30571 = cljs.core.first.call(null,seq__30570);
var seq__30570__$1 = cljs.core.next.call(null,seq__30570);
var child_cell = first__30571;
var _ = seq__30570__$1;
var kids = vec__30569;
var this$__$1 = this$;
var seq__30572_30576 = cljs.core.seq.call(null,hoplon.core.vflatten.call(null,kids));
var chunk__30573_30577 = null;
var count__30574_30578 = (0);
var i__30575_30579 = (0);
while(true){
if((i__30575_30579 < count__30574_30578)){
var x_30580 = cljs.core._nth.call(null,chunk__30573_30577,i__30575_30579);
var temp__5720__auto___30581 = hoplon.core.__GT_node.call(null,x_30580);
if(cljs.core.truth_(temp__5720__auto___30581)){
var x_30582__$1 = temp__5720__auto___30581;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30582__$1);
} else {
}


var G__30583 = seq__30572_30576;
var G__30584 = chunk__30573_30577;
var G__30585 = count__30574_30578;
var G__30586 = (i__30575_30579 + (1));
seq__30572_30576 = G__30583;
chunk__30573_30577 = G__30584;
count__30574_30578 = G__30585;
i__30575_30579 = G__30586;
continue;
} else {
var temp__5720__auto___30587 = cljs.core.seq.call(null,seq__30572_30576);
if(temp__5720__auto___30587){
var seq__30572_30588__$1 = temp__5720__auto___30587;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30572_30588__$1)){
var c__4550__auto___30589 = cljs.core.chunk_first.call(null,seq__30572_30588__$1);
var G__30590 = cljs.core.chunk_rest.call(null,seq__30572_30588__$1);
var G__30591 = c__4550__auto___30589;
var G__30592 = cljs.core.count.call(null,c__4550__auto___30589);
var G__30593 = (0);
seq__30572_30576 = G__30590;
chunk__30573_30577 = G__30591;
count__30574_30578 = G__30592;
i__30575_30579 = G__30593;
continue;
} else {
var x_30594 = cljs.core.first.call(null,seq__30572_30588__$1);
var temp__5720__auto___30595__$1 = hoplon.core.__GT_node.call(null,x_30594);
if(cljs.core.truth_(temp__5720__auto___30595__$1)){
var x_30596__$1 = temp__5720__auto___30595__$1;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30596__$1);
} else {
}


var G__30597 = cljs.core.next.call(null,seq__30572_30588__$1);
var G__30598 = null;
var G__30599 = (0);
var G__30600 = (0);
seq__30572_30576 = G__30597;
chunk__30573_30577 = G__30598;
count__30574_30578 = G__30599;
i__30575_30579 = G__30600;
continue;
}
} else {
}
}
break;
}

return this$__$1;
});
hoplon.core.invoke_BANG_ = (function hoplon$core$invoke_BANG_(var_args){
var args__4736__auto__ = [];
var len__4730__auto___30607 = arguments.length;
var i__4731__auto___30608 = (0);
while(true){
if((i__4731__auto___30608 < len__4730__auto___30607)){
args__4736__auto__.push((arguments[i__4731__auto___30608]));

var G__30609 = (i__4731__auto___30608 + (1));
i__4731__auto___30608 = G__30609;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return hoplon.core.invoke_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

hoplon.core.invoke_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (this$,args){
var vec__30603 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30603,(0),null);
var kids = cljs.core.nth.call(null,vec__30603,(1),null);
var G__30606 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30606,attr);

hoplon.core.add_children_BANG_.call(null,G__30606,kids);

return G__30606;
});

hoplon.core.invoke_BANG_.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
hoplon.core.invoke_BANG_.cljs$lang$applyTo = (function (seq30601){
var G__30602 = cljs.core.first.call(null,seq30601);
var seq30601__$1 = cljs.core.next.call(null,seq30601);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__30602,seq30601__$1);
});

Element.prototype.cljs$core$IPrintWithWriter$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this$,writer,opts){
var this$__$1 = this;
return cljs.core.write_all.call(null,writer,"#<Element: ",this$__$1.tagName,">");
});

Element.prototype.cljs$core$IFn$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.call = (function() {
var G__30646 = null;
var G__30646__1 = (function (self__){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$);
});
var G__30646__2 = (function (self__,a){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a);
});
var G__30646__3 = (function (self__,a,b){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b);
});
var G__30646__4 = (function (self__,a,b,c){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c);
});
var G__30646__5 = (function (self__,a,b,c,d){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d);
});
var G__30646__6 = (function (self__,a,b,c,d,e){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e);
});
var G__30646__7 = (function (self__,a,b,c,d,e,f){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f);
});
var G__30646__8 = (function (self__,a,b,c,d,e,f,g){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g);
});
var G__30646__9 = (function (self__,a,b,c,d,e,f,g,h){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h);
});
var G__30646__10 = (function (self__,a,b,c,d,e,f,g,h,i){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i);
});
var G__30646__11 = (function (self__,a,b,c,d,e,f,g,h,i,j){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j);
});
var G__30646__12 = (function (self__,a,b,c,d,e,f,g,h,i,j,k){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k);
});
var G__30646__13 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l);
});
var G__30646__14 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m);
});
var G__30646__15 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n);
});
var G__30646__16 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o);
});
var G__30646__17 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
});
var G__30646__18 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q);
});
var G__30646__19 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r);
});
var G__30646__20 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s);
});
var G__30646__21 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t);
});
var G__30646__22 = (function (self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest){
var self____$1 = this;
var this$ = self____$1;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest);
});
G__30646 = function(self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest){
switch(arguments.length){
case 1:
return G__30646__1.call(this,self__);
case 2:
return G__30646__2.call(this,self__,a);
case 3:
return G__30646__3.call(this,self__,a,b);
case 4:
return G__30646__4.call(this,self__,a,b,c);
case 5:
return G__30646__5.call(this,self__,a,b,c,d);
case 6:
return G__30646__6.call(this,self__,a,b,c,d,e);
case 7:
return G__30646__7.call(this,self__,a,b,c,d,e,f);
case 8:
return G__30646__8.call(this,self__,a,b,c,d,e,f,g);
case 9:
return G__30646__9.call(this,self__,a,b,c,d,e,f,g,h);
case 10:
return G__30646__10.call(this,self__,a,b,c,d,e,f,g,h,i);
case 11:
return G__30646__11.call(this,self__,a,b,c,d,e,f,g,h,i,j);
case 12:
return G__30646__12.call(this,self__,a,b,c,d,e,f,g,h,i,j,k);
case 13:
return G__30646__13.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l);
case 14:
return G__30646__14.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m);
case 15:
return G__30646__15.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n);
case 16:
return G__30646__16.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o);
case 17:
return G__30646__17.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
case 18:
return G__30646__18.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q);
case 19:
return G__30646__19.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r);
case 20:
return G__30646__20.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s);
case 21:
return G__30646__21.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t);
case 22:
return G__30646__22.call(this,self__,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
G__30646.cljs$core$IFn$_invoke$arity$1 = G__30646__1;
G__30646.cljs$core$IFn$_invoke$arity$2 = G__30646__2;
G__30646.cljs$core$IFn$_invoke$arity$3 = G__30646__3;
G__30646.cljs$core$IFn$_invoke$arity$4 = G__30646__4;
G__30646.cljs$core$IFn$_invoke$arity$5 = G__30646__5;
G__30646.cljs$core$IFn$_invoke$arity$6 = G__30646__6;
G__30646.cljs$core$IFn$_invoke$arity$7 = G__30646__7;
G__30646.cljs$core$IFn$_invoke$arity$8 = G__30646__8;
G__30646.cljs$core$IFn$_invoke$arity$9 = G__30646__9;
G__30646.cljs$core$IFn$_invoke$arity$10 = G__30646__10;
G__30646.cljs$core$IFn$_invoke$arity$11 = G__30646__11;
G__30646.cljs$core$IFn$_invoke$arity$12 = G__30646__12;
G__30646.cljs$core$IFn$_invoke$arity$13 = G__30646__13;
G__30646.cljs$core$IFn$_invoke$arity$14 = G__30646__14;
G__30646.cljs$core$IFn$_invoke$arity$15 = G__30646__15;
G__30646.cljs$core$IFn$_invoke$arity$16 = G__30646__16;
G__30646.cljs$core$IFn$_invoke$arity$17 = G__30646__17;
G__30646.cljs$core$IFn$_invoke$arity$18 = G__30646__18;
G__30646.cljs$core$IFn$_invoke$arity$19 = G__30646__19;
G__30646.cljs$core$IFn$_invoke$arity$20 = G__30646__20;
G__30646.cljs$core$IFn$_invoke$arity$21 = G__30646__21;
G__30646.cljs$core$IFn$_invoke$arity$22 = G__30646__22;
return G__30646;
})()
;

Element.prototype.apply = (function (self__,args30610){
var self____$1 = this;
return self____$1.call.apply(self____$1,[self____$1].concat(cljs.core.aclone.call(null,args30610)));
});

Element.prototype.cljs$core$IFn$_invoke$arity$0 = (function (){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$);
});

Element.prototype.cljs$core$IFn$_invoke$arity$1 = (function (a){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a);
});

Element.prototype.cljs$core$IFn$_invoke$arity$2 = (function (a,b){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b);
});

Element.prototype.cljs$core$IFn$_invoke$arity$3 = (function (a,b,c){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c);
});

Element.prototype.cljs$core$IFn$_invoke$arity$4 = (function (a,b,c,d){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d);
});

Element.prototype.cljs$core$IFn$_invoke$arity$5 = (function (a,b,c,d,e){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e);
});

Element.prototype.cljs$core$IFn$_invoke$arity$6 = (function (a,b,c,d,e,f){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f);
});

Element.prototype.cljs$core$IFn$_invoke$arity$7 = (function (a,b,c,d,e,f,g){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g);
});

Element.prototype.cljs$core$IFn$_invoke$arity$8 = (function (a,b,c,d,e,f,g,h){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h);
});

Element.prototype.cljs$core$IFn$_invoke$arity$9 = (function (a,b,c,d,e,f,g,h,i){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i);
});

Element.prototype.cljs$core$IFn$_invoke$arity$10 = (function (a,b,c,d,e,f,g,h,i,j){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j);
});

Element.prototype.cljs$core$IFn$_invoke$arity$11 = (function (a,b,c,d,e,f,g,h,i,j,k){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k);
});

Element.prototype.cljs$core$IFn$_invoke$arity$12 = (function (a,b,c,d,e,f,g,h,i,j,k,l){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l);
});

Element.prototype.cljs$core$IFn$_invoke$arity$13 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m);
});

Element.prototype.cljs$core$IFn$_invoke$arity$14 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n);
});

Element.prototype.cljs$core$IFn$_invoke$arity$15 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o);
});

Element.prototype.cljs$core$IFn$_invoke$arity$16 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
});

Element.prototype.cljs$core$IFn$_invoke$arity$17 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q);
});

Element.prototype.cljs$core$IFn$_invoke$arity$18 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r);
});

Element.prototype.cljs$core$IFn$_invoke$arity$19 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s);
});

Element.prototype.cljs$core$IFn$_invoke$arity$20 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t);
});

Element.prototype.cljs$core$IFn$_invoke$arity$21 = (function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest){
var this$ = this;
return hoplon.core.invoke_BANG_.call(null,this$,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,rest);
});

Element.prototype.hoplon$core$ICustomElement$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2 = (function (this$,kvs){
var this$__$1 = this;
var e = this$__$1;
var seq__30611 = cljs.core.seq.call(null,kvs);
var chunk__30613 = null;
var count__30614 = (0);
var i__30615 = (0);
while(true){
if((i__30615 < count__30614)){
var vec__30623 = cljs.core._nth.call(null,chunk__30613,i__30615);
var k = cljs.core.nth.call(null,vec__30623,(0),null);
var v = cljs.core.nth.call(null,vec__30623,(1),null);
var k_30647__$1 = cljs.core.name.call(null,k);
if(cljs.core._EQ_.call(null,false,v)){
e.removeAttribute(k_30647__$1);
} else {
e.setAttribute(k_30647__$1,((cljs.core._EQ_.call(null,true,v))?k_30647__$1:v));
}


var G__30648 = seq__30611;
var G__30649 = chunk__30613;
var G__30650 = count__30614;
var G__30651 = (i__30615 + (1));
seq__30611 = G__30648;
chunk__30613 = G__30649;
count__30614 = G__30650;
i__30615 = G__30651;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__30611);
if(temp__5720__auto__){
var seq__30611__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30611__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__30611__$1);
var G__30652 = cljs.core.chunk_rest.call(null,seq__30611__$1);
var G__30653 = c__4550__auto__;
var G__30654 = cljs.core.count.call(null,c__4550__auto__);
var G__30655 = (0);
seq__30611 = G__30652;
chunk__30613 = G__30653;
count__30614 = G__30654;
i__30615 = G__30655;
continue;
} else {
var vec__30626 = cljs.core.first.call(null,seq__30611__$1);
var k = cljs.core.nth.call(null,vec__30626,(0),null);
var v = cljs.core.nth.call(null,vec__30626,(1),null);
var k_30656__$1 = cljs.core.name.call(null,k);
if(cljs.core._EQ_.call(null,false,v)){
e.removeAttribute(k_30656__$1);
} else {
e.setAttribute(k_30656__$1,((cljs.core._EQ_.call(null,true,v))?k_30656__$1:v));
}


var G__30657 = cljs.core.next.call(null,seq__30611__$1);
var G__30658 = null;
var G__30659 = (0);
var G__30660 = (0);
seq__30611 = G__30657;
chunk__30613 = G__30658;
count__30614 = G__30659;
i__30615 = G__30660;
continue;
}
} else {
return null;
}
}
break;
}
});

Element.prototype.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2 = (function (this$,kvs){
var this$__$1 = this;
var e = this$__$1;
var seq__30629 = cljs.core.seq.call(null,kvs);
var chunk__30630 = null;
var count__30631 = (0);
var i__30632 = (0);
while(true){
if((i__30632 < count__30631)){
var vec__30639 = cljs.core._nth.call(null,chunk__30630,i__30632);
var k = cljs.core.nth.call(null,vec__30639,(0),null);
var v = cljs.core.nth.call(null,vec__30639,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),cljs.core.str.cljs$core$IFn$_invoke$arity$1(v));


var G__30661 = seq__30629;
var G__30662 = chunk__30630;
var G__30663 = count__30631;
var G__30664 = (i__30632 + (1));
seq__30629 = G__30661;
chunk__30630 = G__30662;
count__30631 = G__30663;
i__30632 = G__30664;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__30629);
if(temp__5720__auto__){
var seq__30629__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30629__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__30629__$1);
var G__30665 = cljs.core.chunk_rest.call(null,seq__30629__$1);
var G__30666 = c__4550__auto__;
var G__30667 = cljs.core.count.call(null,c__4550__auto__);
var G__30668 = (0);
seq__30629 = G__30665;
chunk__30630 = G__30666;
count__30631 = G__30667;
i__30632 = G__30668;
continue;
} else {
var vec__30642 = cljs.core.first.call(null,seq__30629__$1);
var k = cljs.core.nth.call(null,vec__30642,(0),null);
var v = cljs.core.nth.call(null,vec__30642,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),cljs.core.str.cljs$core$IFn$_invoke$arity$1(v));


var G__30669 = cljs.core.next.call(null,seq__30629__$1);
var G__30670 = null;
var G__30671 = (0);
var G__30672 = (0);
seq__30629 = G__30669;
chunk__30630 = G__30670;
count__30631 = G__30671;
i__30632 = G__30672;
continue;
}
} else {
return null;
}
}
break;
}
});

Element.prototype.hoplon$core$ICustomElement$_append_child_BANG_$arity$2 = (function (this$,child){
var this$__$1 = this;
if((!(hoplon.core.is_ie8))){
return this$__$1.appendChild(child);
} else {
try{return this$__$1.appendChild(child);
}catch (e30645){if((e30645 instanceof Error)){
var _ = e30645;
return null;
} else {
throw e30645;

}
}}
});

Element.prototype.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2 = (function (this$,child){
var this$__$1 = this;
return this$__$1.removeChild(child);
});

Element.prototype.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3 = (function (this$,new$,existing){
var this$__$1 = this;
return this$__$1.replaceChild(new$,existing);
});

Element.prototype.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3 = (function (this$,new$,existing){
var this$__$1 = this;
return this$__$1.insertBefore(new$,existing);
});
hoplon.core.make_singleton_ctor = (function hoplon$core$make_singleton_ctor(elem){
return (function() { 
var G__30676__delegate = function (args){
var vec__30673 = hoplon.core.parse_args.call(null,args);
var attrs = cljs.core.nth.call(null,vec__30673,(0),null);
var kids = cljs.core.nth.call(null,vec__30673,(1),null);
hoplon.core.add_attributes_BANG_.call(null,elem,attrs);

if(cljs.core.not.call(null,new cljs.core.Keyword(null,"static","static",1214358571).cljs$core$IFn$_invoke$arity$1(attrs))){
hoplon.core.remove_all_kids_BANG_.call(null,elem);

return hoplon.core.add_children_BANG_.call(null,elem,kids);
} else {
return null;
}
};
var G__30676 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30677__i = 0, G__30677__a = new Array(arguments.length -  0);
while (G__30677__i < G__30677__a.length) {G__30677__a[G__30677__i] = arguments[G__30677__i + 0]; ++G__30677__i;}
  args = new cljs.core.IndexedSeq(G__30677__a,0,null);
} 
return G__30676__delegate.call(this,args);};
G__30676.cljs$lang$maxFixedArity = 0;
G__30676.cljs$lang$applyTo = (function (arglist__30678){
var args = cljs.core.seq(arglist__30678);
return G__30676__delegate(args);
});
G__30676.cljs$core$IFn$_invoke$arity$variadic = G__30676__delegate;
return G__30676;
})()
;
});
hoplon.core.make_elem_ctor = (function hoplon$core$make_elem_ctor(tag){
var mkelem = (function() { 
var G__30681__delegate = function (rest__30679_SHARP_){
return cljs.core.apply.call(null,document.createElement(tag),rest__30679_SHARP_);
};
var G__30681 = function (var_args){
var rest__30679_SHARP_ = null;
if (arguments.length > 0) {
var G__30682__i = 0, G__30682__a = new Array(arguments.length -  0);
while (G__30682__i < G__30682__a.length) {G__30682__a[G__30682__i] = arguments[G__30682__i + 0]; ++G__30682__i;}
  rest__30679_SHARP_ = new cljs.core.IndexedSeq(G__30682__a,0,null);
} 
return G__30681__delegate.call(this,rest__30679_SHARP_);};
G__30681.cljs$lang$maxFixedArity = 0;
G__30681.cljs$lang$applyTo = (function (arglist__30683){
var rest__30679_SHARP_ = cljs.core.seq(arglist__30683);
return G__30681__delegate(rest__30679_SHARP_);
});
G__30681.cljs$core$IFn$_invoke$arity$variadic = G__30681__delegate;
return G__30681;
})()
;
if((!(hoplon.core.is_ie8))){
return mkelem;
} else {
return ((function (mkelem){
return (function() { 
var G__30684__delegate = function (args){
try{return cljs.core.apply.call(null,mkelem,args);
}catch (e30680){if((e30680 instanceof Error)){
var _ = e30680;
return cljs.core.apply.call(null,hoplon.core.make_elem_ctor.call(null,"div"),args);
} else {
throw e30680;

}
}};
var G__30684 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30685__i = 0, G__30685__a = new Array(arguments.length -  0);
while (G__30685__i < G__30685__a.length) {G__30685__a[G__30685__i] = arguments[G__30685__i + 0]; ++G__30685__i;}
  args = new cljs.core.IndexedSeq(G__30685__a,0,null);
} 
return G__30684__delegate.call(this,args);};
G__30684.cljs$lang$maxFixedArity = 0;
G__30684.cljs$lang$applyTo = (function (arglist__30686){
var args = cljs.core.seq(arglist__30686);
return G__30684__delegate(args);
});
G__30684.cljs$core$IFn$_invoke$arity$variadic = G__30684__delegate;
return G__30684;
})()
;
;})(mkelem))
}
});
hoplon.core.html = (function hoplon$core$html(var_args){
var args__4736__auto__ = [];
var len__4730__auto___30688 = arguments.length;
var i__4731__auto___30689 = (0);
while(true){
if((i__4731__auto___30689 < len__4730__auto___30688)){
args__4736__auto__.push((arguments[i__4731__auto___30689]));

var G__30690 = (i__4731__auto___30689 + (1));
i__4731__auto___30689 = G__30690;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic = (function (args){

return hoplon.core.add_attributes_BANG_.call(null,document.documentElement,cljs.core.nth.call(null,hoplon.core.parse_args.call(null,args),(0)));
});

hoplon.core.html.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
hoplon.core.html.cljs$lang$applyTo = (function (seq30687){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30687));
});

/**
 * Updates the document's `head` element in place.
 */
hoplon.core.head = hoplon.core.make_singleton_ctor.call(null,hoplon.core._head_STAR_.call(null,document));
/**
 * Updates the document's `body` element in place.
 */
hoplon.core.body = hoplon.core.make_singleton_ctor.call(null,document.body);
hoplon.core.a = hoplon.core.make_elem_ctor.call(null,"a");
hoplon.core.abbr = hoplon.core.make_elem_ctor.call(null,"abbr");
hoplon.core.address = hoplon.core.make_elem_ctor.call(null,"address");
hoplon.core.area = hoplon.core.make_elem_ctor.call(null,"area");
hoplon.core.article = hoplon.core.make_elem_ctor.call(null,"article");
hoplon.core.aside = hoplon.core.make_elem_ctor.call(null,"aside");
hoplon.core.audio = hoplon.core.make_elem_ctor.call(null,"audio");
hoplon.core.b = hoplon.core.make_elem_ctor.call(null,"b");
hoplon.core.base = hoplon.core.make_elem_ctor.call(null,"base");
hoplon.core.bdi = hoplon.core.make_elem_ctor.call(null,"bdi");
hoplon.core.bdo = hoplon.core.make_elem_ctor.call(null,"bdo");
hoplon.core.blockquote = hoplon.core.make_elem_ctor.call(null,"blockquote");
hoplon.core.br = hoplon.core.make_elem_ctor.call(null,"br");
hoplon.core.button = hoplon.core.make_elem_ctor.call(null,"button");
hoplon.core.canvas = hoplon.core.make_elem_ctor.call(null,"canvas");
hoplon.core.caption = hoplon.core.make_elem_ctor.call(null,"caption");
hoplon.core.cite = hoplon.core.make_elem_ctor.call(null,"cite");
hoplon.core.code = hoplon.core.make_elem_ctor.call(null,"code");
hoplon.core.col = hoplon.core.make_elem_ctor.call(null,"col");
hoplon.core.colgroup = hoplon.core.make_elem_ctor.call(null,"colgroup");
hoplon.core.data = hoplon.core.make_elem_ctor.call(null,"data");
hoplon.core.datalist = hoplon.core.make_elem_ctor.call(null,"datalist");
hoplon.core.dd = hoplon.core.make_elem_ctor.call(null,"dd");
hoplon.core.del = hoplon.core.make_elem_ctor.call(null,"del");
hoplon.core.details = hoplon.core.make_elem_ctor.call(null,"details");
hoplon.core.dfn = hoplon.core.make_elem_ctor.call(null,"dfn");
hoplon.core.dialog = hoplon.core.make_elem_ctor.call(null,"dialog");
hoplon.core.div = hoplon.core.make_elem_ctor.call(null,"div");
hoplon.core.dl = hoplon.core.make_elem_ctor.call(null,"dl");
hoplon.core.dt = hoplon.core.make_elem_ctor.call(null,"dt");
hoplon.core.em = hoplon.core.make_elem_ctor.call(null,"em");
hoplon.core.embed = hoplon.core.make_elem_ctor.call(null,"embed");
hoplon.core.fieldset = hoplon.core.make_elem_ctor.call(null,"fieldset");
hoplon.core.figcaption = hoplon.core.make_elem_ctor.call(null,"figcaption");
hoplon.core.figure = hoplon.core.make_elem_ctor.call(null,"figure");
hoplon.core.footer = hoplon.core.make_elem_ctor.call(null,"footer");
hoplon.core.form = hoplon.core.make_elem_ctor.call(null,"form");
hoplon.core.h1 = hoplon.core.make_elem_ctor.call(null,"h1");
hoplon.core.h2 = hoplon.core.make_elem_ctor.call(null,"h2");
hoplon.core.h3 = hoplon.core.make_elem_ctor.call(null,"h3");
hoplon.core.h4 = hoplon.core.make_elem_ctor.call(null,"h4");
hoplon.core.h5 = hoplon.core.make_elem_ctor.call(null,"h5");
hoplon.core.h6 = hoplon.core.make_elem_ctor.call(null,"h6");
hoplon.core.header = hoplon.core.make_elem_ctor.call(null,"header");
hoplon.core.hgroup = hoplon.core.make_elem_ctor.call(null,"hgroup");
hoplon.core.hr = hoplon.core.make_elem_ctor.call(null,"hr");
hoplon.core.i = hoplon.core.make_elem_ctor.call(null,"i");
hoplon.core.iframe = hoplon.core.make_elem_ctor.call(null,"iframe");
hoplon.core.img = hoplon.core.make_elem_ctor.call(null,"img");
hoplon.core.input = hoplon.core.make_elem_ctor.call(null,"input");
hoplon.core.ins = hoplon.core.make_elem_ctor.call(null,"ins");
hoplon.core.kbd = hoplon.core.make_elem_ctor.call(null,"kbd");
hoplon.core.keygen = hoplon.core.make_elem_ctor.call(null,"keygen");
hoplon.core.label = hoplon.core.make_elem_ctor.call(null,"label");
hoplon.core.legend = hoplon.core.make_elem_ctor.call(null,"legend");
hoplon.core.li = hoplon.core.make_elem_ctor.call(null,"li");
hoplon.core.link = hoplon.core.make_elem_ctor.call(null,"link");
hoplon.core.main = hoplon.core.make_elem_ctor.call(null,"main");
hoplon.core.html_map = hoplon.core.make_elem_ctor.call(null,"map");
hoplon.core.mark = hoplon.core.make_elem_ctor.call(null,"mark");
hoplon.core.menu = hoplon.core.make_elem_ctor.call(null,"menu");
hoplon.core.menuitem = hoplon.core.make_elem_ctor.call(null,"menuitem");
hoplon.core.html_meta = hoplon.core.make_elem_ctor.call(null,"meta");
hoplon.core.meter = hoplon.core.make_elem_ctor.call(null,"meter");
hoplon.core.multicol = hoplon.core.make_elem_ctor.call(null,"multicol");
hoplon.core.nav = hoplon.core.make_elem_ctor.call(null,"nav");
hoplon.core.noframes = hoplon.core.make_elem_ctor.call(null,"noframes");
hoplon.core.noscript = hoplon.core.make_elem_ctor.call(null,"noscript");
hoplon.core.html_object = hoplon.core.make_elem_ctor.call(null,"object");
hoplon.core.ol = hoplon.core.make_elem_ctor.call(null,"ol");
hoplon.core.optgroup = hoplon.core.make_elem_ctor.call(null,"optgroup");
hoplon.core.option = hoplon.core.make_elem_ctor.call(null,"option");
hoplon.core.output = hoplon.core.make_elem_ctor.call(null,"output");
hoplon.core.p = hoplon.core.make_elem_ctor.call(null,"p");
hoplon.core.param = hoplon.core.make_elem_ctor.call(null,"param");
hoplon.core.picture = hoplon.core.make_elem_ctor.call(null,"picture");
hoplon.core.pre = hoplon.core.make_elem_ctor.call(null,"pre");
hoplon.core.progress = hoplon.core.make_elem_ctor.call(null,"progress");
hoplon.core.q = hoplon.core.make_elem_ctor.call(null,"q");
hoplon.core.rp = hoplon.core.make_elem_ctor.call(null,"rp");
hoplon.core.rt = hoplon.core.make_elem_ctor.call(null,"rt");
hoplon.core.rtc = hoplon.core.make_elem_ctor.call(null,"rtc");
hoplon.core.ruby = hoplon.core.make_elem_ctor.call(null,"ruby");
hoplon.core.s = hoplon.core.make_elem_ctor.call(null,"s");
hoplon.core.samp = hoplon.core.make_elem_ctor.call(null,"samp");
hoplon.core.script = hoplon.core.make_elem_ctor.call(null,"script");
hoplon.core.section = hoplon.core.make_elem_ctor.call(null,"section");
hoplon.core.select = hoplon.core.make_elem_ctor.call(null,"select");
hoplon.core.shadow = hoplon.core.make_elem_ctor.call(null,"shadow");
hoplon.core.small = hoplon.core.make_elem_ctor.call(null,"small");
hoplon.core.source = hoplon.core.make_elem_ctor.call(null,"source");
hoplon.core.span = hoplon.core.make_elem_ctor.call(null,"span");
hoplon.core.strong = hoplon.core.make_elem_ctor.call(null,"strong");
hoplon.core.style = hoplon.core.make_elem_ctor.call(null,"style");
hoplon.core.sub = hoplon.core.make_elem_ctor.call(null,"sub");
hoplon.core.summary = hoplon.core.make_elem_ctor.call(null,"summary");
hoplon.core.sup = hoplon.core.make_elem_ctor.call(null,"sup");
hoplon.core.table = hoplon.core.make_elem_ctor.call(null,"table");
hoplon.core.tbody = hoplon.core.make_elem_ctor.call(null,"tbody");
hoplon.core.td = hoplon.core.make_elem_ctor.call(null,"td");
hoplon.core.template = hoplon.core.make_elem_ctor.call(null,"template");
hoplon.core.textarea = hoplon.core.make_elem_ctor.call(null,"textarea");
hoplon.core.tfoot = hoplon.core.make_elem_ctor.call(null,"tfoot");
hoplon.core.th = hoplon.core.make_elem_ctor.call(null,"th");
hoplon.core.thead = hoplon.core.make_elem_ctor.call(null,"thead");
hoplon.core.html_time = hoplon.core.make_elem_ctor.call(null,"time");
hoplon.core.title = hoplon.core.make_elem_ctor.call(null,"title");
hoplon.core.tr = hoplon.core.make_elem_ctor.call(null,"tr");
hoplon.core.track = hoplon.core.make_elem_ctor.call(null,"track");
hoplon.core.u = hoplon.core.make_elem_ctor.call(null,"u");
hoplon.core.ul = hoplon.core.make_elem_ctor.call(null,"ul");
hoplon.core.html_var = hoplon.core.make_elem_ctor.call(null,"var");
hoplon.core.video = hoplon.core.make_elem_ctor.call(null,"video");
hoplon.core.wbr = hoplon.core.make_elem_ctor.call(null,"wbr");
hoplon.core.spliced = cljs.core.vector;
hoplon.core.$text = (function hoplon$core$$text(p1__30691_SHARP_){
return document.createTextNode(p1__30691_SHARP_);
});
hoplon.core.$comment = (function hoplon$core$$comment(p1__30692_SHARP_){
return document.createComment(p1__30692_SHARP_);
});
hoplon.core._LT__BANG___ = hoplon.core.$comment;
hoplon.core.___GT_ = new cljs.core.Keyword("hoplon.core","-->","hoplon.core/-->",1031510657);
hoplon.core.add_initfn_BANG_ = (function hoplon$core$add_initfn_BANG_(f){
return window.addEventListener("load",(function (){
return setTimeout((function (){
return f.call(null);
}),(0));
}));
});
hoplon.core.page_load = (function hoplon$core$page_load(){
return document.dispatchEvent("page-load");
});
hoplon.core.on_page_load = (function hoplon$core$on_page_load(f){
return document.addEventListener("page-load",f);
});
hoplon.core.add_initfn_BANG_.call(null,(function (){
return document.body.addEventListener("submit",(function (p1__30693_SHARP_){
var e = p1__30693_SHARP_.target;
if(cljs.core.truth_((function (){var or__4131__auto__ = e.getAttribute("action");
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return e.getAttribute("method");
}
})())){
return null;
} else {
return p1__30693_SHARP_.preventDefault();
}
}));
}));
if((typeof hoplon !== 'undefined') && (typeof hoplon.core !== 'undefined') && (typeof hoplon.core.do_BANG_ !== 'undefined')){
} else {
hoplon.core.do_BANG_ = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"default","default",-1987822328),new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365)], null),new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"hoplon.core","do!"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (elem,key,val){
var temp__5718__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5718__auto__)){
var n = temp__5718__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),(function (elem,key,val){
return hoplon.core.do_BANG_.call(null,elem,new cljs.core.Keyword(null,"attr","attr",-604132353),cljs.core.PersistentArrayMap.createAsIfByAssoc([key,val]));
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("css","*","css/*",-1295355419),(function (elem,key,val){
return hoplon.core.set_styles_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("html","*","html/*",-1283138243),(function (elem,key,val){
return hoplon.core.set_attributes_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("svg","*","svg/*",-1295405562),(function (elem,key,val){
return hoplon.core.set_attributes_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"attr","attr",-604132353),(function (elem,_,kvs){
return hoplon.core.set_attributes_BANG_.call(null,elem,kvs);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"css","css",1135045163),(function (elem,_,kvs){
return hoplon.core.set_styles_BANG_.call(null,elem,kvs);
}));
if((typeof hoplon !== 'undefined') && (typeof hoplon.core !== 'undefined') && (typeof hoplon.core.on_BANG_ !== 'undefined')){
} else {
hoplon.core.on_BANG_ = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"default","default",-1987822328),new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365)], null),new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"hoplon.core","on!"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (elem,key,val){
var temp__5718__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5718__auto__)){
var n = temp__5718__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),(function (elem,event,callback){
return hoplon.core.when_dom.call(null,elem,(function (){
return elem.addEventListener(cljs.core.name.call(null,event),callback);
}));
}));
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("html","*","html/*",-1283138243),(function (elem,event,callback){
return hoplon.core.when_dom.call(null,elem,(function (){
return elem.addEventListener(cljs.core.name.call(null,event),callback);
}));
}));
/**
 * Given a cell items containing a seqable collection, constructs a cell that
 *   works like a fill vector. The template tpl is a function of one argument: the
 *   formula cell containing the ith item in items. The tpl function is called
 *   once (and only once) for each index in items. When the items collection
 *   shrinks the DOM element created by the template is not destroyed--it is only
 *   removed from the DOM and cached. When the items collection grows again those
 *   cached elements will be reinserted into the DOM at their original index.
 */
hoplon.core.loop_tpl_STAR_ = (function hoplon$core$loop_tpl_STAR_(items,tpl){
var on_deck = cljs.core.atom.call(null,cljs.core.List.EMPTY);
var items_seq = javelin.core.formula.call(null,((function (on_deck){
return (function (G__30696,G__30697){
return G__30696.call(null,G__30697);
});})(on_deck))
).call(null,cljs.core.seq,items);
var ith_item = ((function (on_deck,items_seq){
return (function (p1__30694_SHARP_){
return javelin.core.formula.call(null,((function (on_deck,items_seq){
return (function (G__30699,G__30700,G__30698){
return G__30698.call(null,G__30699,G__30700);
});})(on_deck,items_seq))
).call(null,items_seq,p1__30694_SHARP_,hoplon.core.safe_nth);
});})(on_deck,items_seq))
;
var shift_BANG_ = ((function (on_deck,items_seq,ith_item){
return (function (p1__30695_SHARP_){
var x = cljs.core.first.call(null,cljs.core.deref.call(null,p1__30695_SHARP_));
cljs.core.swap_BANG_.call(null,p1__30695_SHARP_,cljs.core.rest);

return x;
});})(on_deck,items_seq,ith_item))
;
var current = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
hoplon.core.do_watch.call(null,items_seq,((function (current,on_deck,items_seq,ith_item,shift_BANG_){
return (function (old_items,new_items){
var old = cljs.core.count.call(null,old_items);
var new$ = cljs.core.count.call(null,new_items);
var diff = (new$ - old);
if((diff > (0))){
var seq__30701 = cljs.core.seq.call(null,cljs.core.range.call(null,old,new$));
var chunk__30702 = null;
var count__30703 = (0);
var i__30704 = (0);
while(true){
if((i__30704 < count__30703)){
var i = cljs.core._nth.call(null,chunk__30702,i__30704);
var e_30705 = (function (){var or__4131__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30705);


var G__30706 = seq__30701;
var G__30707 = chunk__30702;
var G__30708 = count__30703;
var G__30709 = (i__30704 + (1));
seq__30701 = G__30706;
chunk__30702 = G__30707;
count__30703 = G__30708;
i__30704 = G__30709;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__30701);
if(temp__5720__auto__){
var seq__30701__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30701__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__30701__$1);
var G__30710 = cljs.core.chunk_rest.call(null,seq__30701__$1);
var G__30711 = c__4550__auto__;
var G__30712 = cljs.core.count.call(null,c__4550__auto__);
var G__30713 = (0);
seq__30701 = G__30710;
chunk__30702 = G__30711;
count__30703 = G__30712;
i__30704 = G__30713;
continue;
} else {
var i = cljs.core.first.call(null,seq__30701__$1);
var e_30714 = (function (){var or__4131__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30714);


var G__30715 = cljs.core.next.call(null,seq__30701__$1);
var G__30716 = null;
var G__30717 = (0);
var G__30718 = (0);
seq__30701 = G__30715;
chunk__30702 = G__30716;
count__30703 = G__30717;
i__30704 = G__30718;
continue;
}
} else {
return null;
}
}
break;
}
} else {
if((diff < (0))){
var n__4607__auto__ = (- diff);
var _ = (0);
while(true){
if((_ < n__4607__auto__)){
var e_30719 = cljs.core.peek.call(null,cljs.core.deref.call(null,current));
cljs.core.swap_BANG_.call(null,current,cljs.core.pop);

cljs.core.swap_BANG_.call(null,on_deck,cljs.core.conj,e_30719);

var G__30720 = (_ + (1));
_ = G__30720;
continue;
} else {
return null;
}
break;
}
} else {
return null;
}
}
});})(current,on_deck,items_seq,ith_item,shift_BANG_))
);

return current;
});
/**
 * Defines a cell whose value is the URI fragment.
 */
hoplon.core.route_cell = (function hoplon$core$route_cell(var_args){
var args__4736__auto__ = [];
var len__4730__auto___30729 = arguments.length;
var i__4731__auto___30730 = (0);
while(true){
if((i__4731__auto___30730 < len__4730__auto___30729)){
args__4736__auto__.push((arguments[i__4731__auto___30730]));

var G__30731 = (i__4731__auto___30730 + (1));
i__4731__auto___30730 = G__30731;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic = (function (p__30722){
var vec__30723 = p__30722;
var default$ = cljs.core.nth.call(null,vec__30723,(0),null);
var c = javelin.core.cell.call(null,window.location.hash);
var _ = javelin.core.formula.call(null,((function (c,vec__30723,default$){
return (function (G__30726,G__30728,G__30727){
var or__4131__auto__ = (function (){var and__4120__auto__ = G__30726.call(null,G__30727);
if(cljs.core.truth_(and__4120__auto__)){
return G__30727;
} else {
return and__4120__auto__;
}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return G__30728;
}
});})(c,vec__30723,default$))
).call(null,cljs.core.seq,default$,c);
window.addEventListener("hashchange",((function (_,c,vec__30723,default$){
return (function (){
return cljs.core.reset_BANG_.call(null,c,window.location.hash);
});})(_,c,vec__30723,default$))
);

return _;
});

hoplon.core.route_cell.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
hoplon.core.route_cell.cljs$lang$applyTo = (function (seq30721){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30721));
});

