// Compiled by ClojureScript 1.9.562 {}
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__29952_SHARP_,p2__29953_SHARP_){
return cljs.core.assoc.call(null,p1__29952_SHARP_,p2__29953_SHARP_.getAttribute("static-id"),p2__29953_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 args29954 = [];
var len__24559__auto___29957 = arguments.length;
var i__24560__auto___29958 = (0);
while(true){
if((i__24560__auto___29958 < len__24559__auto___29957)){
args29954.push((arguments[i__24560__auto___29958]));

var G__29959 = (i__24560__auto___29958 + (1));
i__24560__auto___29958 = G__29959;
continue;
} else {
}
break;
}

var G__29956 = args29954.length;
switch (G__29956) {
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([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29954.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__29967 = cljs.core.reverse.call(null,clojure.string.split.call(null,path,/\//));
var seq__29968 = cljs.core.seq.call(null,vec__29967);
var first__29969 = cljs.core.first.call(null,seq__29968);
var seq__29968__$1 = cljs.core.next.call(null,seq__29968);
var f = first__29969;
var more = seq__29968__$1;
var vec__29970 = clojure.string.split.call(null,f,/\./,(2));
var f1 = cljs.core.nth.call(null,vec__29970,(0),null);
var f2 = cljs.core.nth.call(null,vec__29970,(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),cljs.core.str.cljs$core$IFn$_invoke$arity$1("."),cljs.core.str.cljs$core$IFn$_invoke$arity$1("6689760ad98a4426bfd6517c22588425")].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__29973_SHARP_){
return cljs.core.zipmap.call(null,p1__29973_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__23338__auto__ = (function (){var and__23326__auto__ = cljs.core._EQ_.call(null,i,l);
if(and__23326__auto__){
return cljs.core.persistent_BANG_.call(null,ret);
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
var G__29974 = (i + (1));
var G__29975 = cljs.core.conj_BANG_.call(null,ret,x.item(i));
i = G__29974;
ret = G__29975;
continue;
}
break;
}
});
hoplon.core.vflatten = (function hoplon$core$vflatten(var_args){
var args29976 = [];
var len__24559__auto___29979 = arguments.length;
var i__24560__auto___29980 = (0);
while(true){
if((i__24560__auto___29980 < len__24559__auto___29979)){
args29976.push((arguments[i__24560__auto___29980]));

var G__29981 = (i__24560__auto___29980 + (1));
i__24560__auto___29980 = G__29981;
continue;
} else {
}
break;
}

var G__29978 = args29976.length;
switch (G__29978) {
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([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29976.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__29983 = (i + (1));
i = G__29983;
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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core.node[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$);
} else {
var m__24057__auto____$1 = (hoplon.core.node["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"INode.node",this$);
}
}
}
});

(hoplon.core.INode["string"] = true);

(hoplon.core.node["string"] = (function (this$){
return hoplon.core.$text.call(null,this$);
}));
(hoplon.core.INode["number"] = true);

(hoplon.core.node["number"] = (function (this$){
return hoplon.core.$text.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(this$)].join(''));
}));
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__29987_SHARP_,p2__29986_SHARP_){
if((p2__29986_SHARP_ == null)){
return p1__29987_SHARP_;
} else {
return cljs.core.conj.call(null,p1__29987_SHARP_,p2__29986_SHARP_);
}
}),cljs.core.PersistentVector.EMPTY,hoplon.core.vflatten.call(null,new$)));
var new_QMARK_ = cljs.core.set.call(null,new$__$1);
var G__30014 = new$__$1;
var vec__30016 = G__30014;
var seq__30017 = cljs.core.seq.call(null,vec__30016);
var first__30018 = cljs.core.first.call(null,seq__30017);
var seq__30017__$1 = cljs.core.next.call(null,seq__30017);
var x = first__30018;
var xs = seq__30017__$1;
var G__30015 = hoplon.core.child_vec.call(null,this$);
var vec__30019 = G__30015;
var seq__30020 = cljs.core.seq.call(null,vec__30019);
var first__30021 = cljs.core.first.call(null,seq__30020);
var seq__30020__$1 = cljs.core.next.call(null,seq__30020);
var k = first__30021;
var ks = seq__30020__$1;
var kids = vec__30019;
var G__30014__$1 = G__30014;
var G__30015__$1 = G__30015;
while(true){
var vec__30022 = G__30014__$1;
var seq__30023 = cljs.core.seq.call(null,vec__30022);
var first__30024 = cljs.core.first.call(null,seq__30023);
var seq__30023__$1 = cljs.core.next.call(null,seq__30023);
var x__$1 = first__30024;
var xs__$1 = seq__30023__$1;
var vec__30025 = G__30015__$1;
var seq__30026 = cljs.core.seq.call(null,vec__30025);
var first__30027 = cljs.core.first.call(null,seq__30026);
var seq__30026__$1 = cljs.core.next.call(null,seq__30026);
var k__$1 = first__30027;
var ks__$1 = seq__30026__$1;
var kids__$1 = vec__30025;
if(cljs.core.truth_((function (){var or__23338__auto__ = x__$1;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return k__$1;
}
})())){
var G__30028 = xs__$1;
var G__30029 = ((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__30014__$1 = G__30028;
G__30015__$1 = G__30029;
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_30030 = cljs.core.atom.call(null,hoplon.core.child_vec.call(null,this$__$1));
this$__$1.hoplonKids = kids_30030;

hoplon.core.do_watch.call(null,kids_30030,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 cljs.core.not.call(null,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_30033 = kidfn.call(null,parent);
var i_30034 = cljs.core.count.call(null,cljs.core.deref.call(null,kids_30033));
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,child__$1))){
hoplon.core.do_watch.call(null,child__$1,((function (kids_30033,i_30034,child__$1){
return (function (p1__30032_SHARP_,p2__30031_SHARP_){
return cljs.core.swap_BANG_.call(null,kids_30033,cljs.core.assoc,i_30034,p2__30031_SHARP_);
});})(kids_30033,i_30034,child__$1))
);
} else {
cljs.core.swap_BANG_.call(null,kids_30033,cljs.core.assoc,i_30034,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(cljs.core.truth_((function (){var and__23326__auto__ = hoplon.core.native_QMARK_.call(null,this$__$1);
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not.call(null,javelin.core.cell_QMARK_.call(null,child));
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.appendChild.call(this$__$1,child);
} else {
if(cljs.core.truth_((function (){var and__23326__auto__ = hoplon.core.native_QMARK_.call(null,this$__$1);
if(cljs.core.truth_(and__23326__auto__)){
return javelin.core.cell_QMARK_.call(null,child);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.managed_append_child.call(null,this$__$1,child,kidfn);
} else {
if(cljs.core.truth_(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__30035_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__30035_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__30036_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__30036_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__30037_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__30037_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_30038 = cljs.core.keyword.call(null,k);
var attr_30039 = attrfn.call(null,this$__$1);
var has_QMARK__30040 = (function (){var and__23326__auto__ = attr_30039;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,attr_30039),kk_30038);
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(has_QMARK__30040)){
cljs.core.swap_BANG_.call(null,attr_30039,cljs.core.assoc,kk_30038,v);
} else {
hoplon.core.setAttribute.call(this$__$1,k,v);
}

return _;
});
});
hoplon.core.set_appendChild_BANG_.call(null,Element.prototype,(function (p1__30041_SHARP_){
return p1__30041_SHARP_.hoplonKids;
}));
hoplon.core.set_removeChild_BANG_.call(null,Element.prototype,(function (p1__30042_SHARP_){
return p1__30042_SHARP_.hoplonKids;
}));
hoplon.core.set_insertBefore_BANG_.call(null,Element.prototype,(function (p1__30043_SHARP_){
return p1__30043_SHARP_.hoplonKids;
}));
hoplon.core.set_replaceChild_BANG_.call(null,Element.prototype,(function (p1__30044_SHARP_){
return p1__30044_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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._set_attributes_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,kvs);
} else {
var m__24057__auto____$1 = (hoplon.core._set_attributes_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._set_styles_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,kvs);
} else {
var m__24057__auto____$1 = (hoplon.core._set_styles_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._append_child_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,child);
} else {
var m__24057__auto____$1 = (hoplon.core._append_child_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._remove_child_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,child);
} else {
var m__24057__auto____$1 = (hoplon.core._remove_child_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._replace_child_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,new$,existing);
} else {
var m__24057__auto____$1 = (hoplon.core._replace_child_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._insert_before_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,new$,existing);
} else {
var m__24057__auto____$1 = (hoplon.core._insert_before_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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 args30045 = [];
var len__24559__auto___30052 = arguments.length;
var i__24560__auto___30053 = (0);
while(true){
if((i__24560__auto___30053 < len__24559__auto___30052)){
args30045.push((arguments[i__24560__auto___30053]));

var G__30054 = (i__24560__auto___30053 + (1));
i__24560__auto___30053 = G__30054;
continue;
} else {
}
break;
}

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

break;
default:
var argseq__24582__auto__ = (new cljs.core.IndexedSeq(args30045.slice((3)),(0),null));
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__24582__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));
});

hoplon.core.set_attributes_BANG_.cljs$lang$applyTo = (function (seq30046){
var G__30047 = cljs.core.first.call(null,seq30046);
var seq30046__$1 = cljs.core.next.call(null,seq30046);
var G__30048 = cljs.core.first.call(null,seq30046__$1);
var seq30046__$2 = cljs.core.next.call(null,seq30046__$1);
var G__30049 = cljs.core.first.call(null,seq30046__$2);
var seq30046__$3 = cljs.core.next.call(null,seq30046__$2);
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__30047,G__30048,G__30049,seq30046__$3);
});

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

hoplon.core.set_styles_BANG_ = (function hoplon$core$set_styles_BANG_(var_args){
var args30056 = [];
var len__24559__auto___30063 = arguments.length;
var i__24560__auto___30064 = (0);
while(true){
if((i__24560__auto___30064 < len__24559__auto___30063)){
args30056.push((arguments[i__24560__auto___30064]));

var G__30065 = (i__24560__auto___30064 + (1));
i__24560__auto___30064 = G__30065;
continue;
} else {
}
break;
}

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

break;
default:
var argseq__24582__auto__ = (new cljs.core.IndexedSeq(args30056.slice((3)),(0),null));
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__24582__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));
});

hoplon.core.set_styles_BANG_.cljs$lang$applyTo = (function (seq30057){
var G__30058 = cljs.core.first.call(null,seq30057);
var seq30057__$1 = cljs.core.next.call(null,seq30057);
var G__30059 = cljs.core.first.call(null,seq30057__$1);
var seq30057__$2 = cljs.core.next.call(null,seq30057__$1);
var G__30060 = cljs.core.first.call(null,seq30057__$2);
var seq30057__$3 = cljs.core.next.call(null,seq30057__$2);
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__30058,G__30059,G__30060,seq30057__$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__24056__auto__ = (((this$ == null))?null:this$);
var m__24057__auto__ = (hoplon.core._attr_BANG_[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,this$,elem,value);
} else {
var m__24057__auto____$1 = (hoplon.core._attr_BANG_["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.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__30070_SHARP_,p2__30069_SHARP_){
return hoplon.core.do_BANG_.call(null,elem,this$__$1,p2__30069_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__30071_SHARP_){
return p1__30071_SHARP_.head;
}):(function (p1__30072_SHARP_){
return p1__30072_SHARP_.documentElement.firstChild;
}));
hoplon.core.vector_QMARK__STAR_ = ((!(hoplon.core.is_ie8))?cljs.core.vector_QMARK_:(function (p1__30073_SHARP_){
try{return cljs.core.vector_QMARK_.call(null,p1__30073_SHARP_);
}catch (e30074){if((e30074 instanceof Error)){
var _ = e30074;
return null;
} else {
throw e30074;

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

}
}}));
/**
 * 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 args30077 = [];
var len__24559__auto___30081 = arguments.length;
var i__24560__auto___30082 = (0);
while(true){
if((i__24560__auto___30082 < len__24559__auto___30081)){
args30077.push((arguments[i__24560__auto___30082]));

var G__30083 = (i__24560__auto___30082 + (1));
i__24560__auto___30082 = G__30083;
continue;
} else {
}
break;
}

var G__30079 = args30077.length;
switch (G__30079) {
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([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30077.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 (e30080){if((e30080 instanceof Error)){
var _ = e30080;
return not_found;
} else {
throw e30080;

}
}});

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 args30085 = [];
var len__24559__auto___30088 = arguments.length;
var i__24560__auto___30089 = (0);
while(true){
if((i__24560__auto___30089 < len__24559__auto___30088)){
args30085.push((arguments[i__24560__auto___30089]));

var G__30090 = (i__24560__auto___30089 + (1));
i__24560__auto___30089 = G__30090;
continue;
} else {
}
break;
}

var G__30087 = args30085.length;
switch (G__30087) {
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([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args30085.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__5276__auto__ = goog.object.get(this$,"_hoplonWhenDom");
if(cljs.core.truth_(temp__5276__auto__)){
var v = temp__5276__auto__;
return v.push(f);
} else {
goog.object.set(this$,"_hoplonWhenDom",[f]);

return setTimeout(((function (temp__5276__auto__){
return (function (){
return ((function (temp__5276__auto__){
return (function hoplon$core$when_dom_$_doit(){
if(cljs.core.not.call(null,document.documentElement.contains(this$))){
return setTimeout(((function (temp__5276__auto__){
return (function (){
return hoplon$core$when_dom_$_doit.call(null);
});})(temp__5276__auto__))
,(20));
} else {
var seq__30104_30108 = cljs.core.seq.call(null,goog.object.get(this$,"_hoplonWhenDom"));
var chunk__30105_30109 = null;
var count__30106_30110 = (0);
var i__30107_30111 = (0);
while(true){
if((i__30107_30111 < count__30106_30110)){
var f_30112__$1 = cljs.core._nth.call(null,chunk__30105_30109,i__30107_30111);
f_30112__$1.call(null);

var G__30113 = seq__30104_30108;
var G__30114 = chunk__30105_30109;
var G__30115 = count__30106_30110;
var G__30116 = (i__30107_30111 + (1));
seq__30104_30108 = G__30113;
chunk__30105_30109 = G__30114;
count__30106_30110 = G__30115;
i__30107_30111 = G__30116;
continue;
} else {
var temp__5278__auto___30117 = cljs.core.seq.call(null,seq__30104_30108);
if(temp__5278__auto___30117){
var seq__30104_30118__$1 = temp__5278__auto___30117;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30104_30118__$1)){
var c__24249__auto___30119 = cljs.core.chunk_first.call(null,seq__30104_30118__$1);
var G__30120 = cljs.core.chunk_rest.call(null,seq__30104_30118__$1);
var G__30121 = c__24249__auto___30119;
var G__30122 = cljs.core.count.call(null,c__24249__auto___30119);
var G__30123 = (0);
seq__30104_30108 = G__30120;
chunk__30105_30109 = G__30121;
count__30106_30110 = G__30122;
i__30107_30111 = G__30123;
continue;
} else {
var f_30124__$1 = cljs.core.first.call(null,seq__30104_30118__$1);
f_30124__$1.call(null);

var G__30125 = cljs.core.next.call(null,seq__30104_30118__$1);
var G__30126 = null;
var G__30127 = (0);
var G__30128 = (0);
seq__30104_30108 = G__30125;
chunk__30105_30109 = G__30126;
count__30106_30110 = G__30127;
i__30107_30111 = G__30128;
continue;
}
} else {
}
}
break;
}

return goog.object.set(this$,"_hoplonWhenDom",null);
}
});})(temp__5276__auto__))
.call(null);
});})(temp__5276__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__30145 = args;
var vec__30146 = G__30145;
var seq__30147 = cljs.core.seq.call(null,vec__30146);
var first__30148 = cljs.core.first.call(null,seq__30147);
var seq__30147__$1 = cljs.core.next.call(null,seq__30147);
var arg = first__30148;
var args__$1 = seq__30147__$1;
var attr__$1 = attr;
var kids__$1 = kids;
var G__30145__$1 = G__30145;
while(true){
var attr__$2 = attr__$1;
var kids__$2 = kids__$1;
var vec__30149 = G__30145__$1;
var seq__30150 = cljs.core.seq.call(null,vec__30149);
var first__30151 = cljs.core.first.call(null,seq__30150);
var seq__30150__$1 = cljs.core.next.call(null,seq__30150);
var arg__$1 = first__30151;
var args__$2 = seq__30150__$1;
if(cljs.core.not.call(null,(function (){var or__23338__auto__ = arg__$1;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__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__30152 = cljs.core.reduce_kv.call(null,((function (attr__$1,kids__$1,G__30145__$1,attr__$2,kids__$2,vec__30149,seq__30150,first__30151,seq__30150__$1,arg__$1,args__$2,attr,kids,G__30145,vec__30146,seq__30147,first__30148,seq__30147__$1,arg,args__$1){
return (function (p1__30129_SHARP_,p2__30130_SHARP_,p3__30131_SHARP_){
return cljs.core.assoc_BANG_.call(null,p1__30129_SHARP_,p2__30130_SHARP_,p3__30131_SHARP_);
});})(attr__$1,kids__$1,G__30145__$1,attr__$2,kids__$2,vec__30149,seq__30150,first__30151,seq__30150__$1,arg__$1,args__$2,attr,kids,G__30145,vec__30146,seq__30147,first__30148,seq__30147__$1,arg,args__$1))
,attr__$2,arg__$1);
var G__30153 = kids__$2;
var G__30154 = args__$2;
attr__$1 = G__30152;
kids__$1 = G__30153;
G__30145__$1 = G__30154;
continue;
} else {
if(cljs.core.truth_(hoplon.core.attribute_QMARK_.call(null,arg__$1))){
var G__30155 = cljs.core.assoc_BANG_.call(null,attr__$2,arg__$1,cljs.core.first.call(null,args__$2));
var G__30156 = kids__$2;
var G__30157 = cljs.core.rest.call(null,args__$2);
attr__$1 = G__30155;
kids__$1 = G__30156;
G__30145__$1 = G__30157;
continue;
} else {
if(cljs.core.truth_(hoplon.core.seq_QMARK__STAR_.call(null,arg__$1))){
var G__30158 = attr__$2;
var G__30159 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30160 = args__$2;
attr__$1 = G__30158;
kids__$1 = G__30159;
G__30145__$1 = G__30160;
continue;
} else {
if(cljs.core.truth_(hoplon.core.vector_QMARK__STAR_.call(null,arg__$1))){
var G__30161 = attr__$2;
var G__30162 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30163 = args__$2;
attr__$1 = G__30161;
kids__$1 = G__30162;
G__30145__$1 = G__30163;
continue;
} else {
var G__30164 = attr__$2;
var G__30165 = cljs.core.conj_BANG_.call(null,kids__$2,arg__$1);
var G__30166 = args__$2;
attr__$1 = G__30164;
kids__$1 = G__30165;
G__30145__$1 = G__30166;
continue;

}
}
}
}
}
break;
}
});
hoplon.core.add_attributes_BANG_ = (function hoplon$core$add_attributes_BANG_(this$,attr){
return cljs.core.reduce_kv.call(null,(function (p1__30168_SHARP_,p2__30167_SHARP_,p3__30169_SHARP_){
hoplon.core._attr_BANG_.call(null,p2__30167_SHARP_,p1__30168_SHARP_,p3__30169_SHARP_);

return p1__30168_SHARP_;
}),this$,attr);
});
hoplon.core.add_children_BANG_ = (function hoplon$core$add_children_BANG_(this$,p__30170){
var vec__30178 = p__30170;
var seq__30179 = cljs.core.seq.call(null,vec__30178);
var first__30180 = cljs.core.first.call(null,seq__30179);
var seq__30179__$1 = cljs.core.next.call(null,seq__30179);
var child_cell = first__30180;
var _ = seq__30179__$1;
var kids = vec__30178;
var this$__$1 = this$;
var seq__30181_30185 = cljs.core.seq.call(null,hoplon.core.vflatten.call(null,kids));
var chunk__30182_30186 = null;
var count__30183_30187 = (0);
var i__30184_30188 = (0);
while(true){
if((i__30184_30188 < count__30183_30187)){
var x_30189 = cljs.core._nth.call(null,chunk__30182_30186,i__30184_30188);
var temp__5278__auto___30190 = hoplon.core.__GT_node.call(null,x_30189);
if(cljs.core.truth_(temp__5278__auto___30190)){
var x_30191__$1 = temp__5278__auto___30190;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30191__$1);
} else {
}

var G__30192 = seq__30181_30185;
var G__30193 = chunk__30182_30186;
var G__30194 = count__30183_30187;
var G__30195 = (i__30184_30188 + (1));
seq__30181_30185 = G__30192;
chunk__30182_30186 = G__30193;
count__30183_30187 = G__30194;
i__30184_30188 = G__30195;
continue;
} else {
var temp__5278__auto___30196 = cljs.core.seq.call(null,seq__30181_30185);
if(temp__5278__auto___30196){
var seq__30181_30197__$1 = temp__5278__auto___30196;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30181_30197__$1)){
var c__24249__auto___30198 = cljs.core.chunk_first.call(null,seq__30181_30197__$1);
var G__30199 = cljs.core.chunk_rest.call(null,seq__30181_30197__$1);
var G__30200 = c__24249__auto___30198;
var G__30201 = cljs.core.count.call(null,c__24249__auto___30198);
var G__30202 = (0);
seq__30181_30185 = G__30199;
chunk__30182_30186 = G__30200;
count__30183_30187 = G__30201;
i__30184_30188 = G__30202;
continue;
} else {
var x_30203 = cljs.core.first.call(null,seq__30181_30197__$1);
var temp__5278__auto___30204__$1 = hoplon.core.__GT_node.call(null,x_30203);
if(cljs.core.truth_(temp__5278__auto___30204__$1)){
var x_30205__$1 = temp__5278__auto___30204__$1;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30205__$1);
} else {
}

var G__30206 = cljs.core.next.call(null,seq__30181_30197__$1);
var G__30207 = null;
var G__30208 = (0);
var G__30209 = (0);
seq__30181_30185 = G__30206;
chunk__30182_30186 = G__30207;
count__30183_30187 = G__30208;
i__30184_30188 = G__30209;
continue;
}
} else {
}
}
break;
}

return this$__$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__30242__delegate = function (self__,args){
var self____$1 = this;
var this$ = self____$1;
var vec__30211 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30211,(0),null);
var kids = cljs.core.nth.call(null,vec__30211,(1),null);
var G__30214 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30214,attr);

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

return G__30214;
};
var G__30242 = function (self__,var_args){
var args = null;
if (arguments.length > 1) {
var G__30243__i = 0, G__30243__a = new Array(arguments.length -  1);
while (G__30243__i < G__30243__a.length) {G__30243__a[G__30243__i] = arguments[G__30243__i + 1]; ++G__30243__i;}
  args = new cljs.core.IndexedSeq(G__30243__a,0,null);
} 
return G__30242__delegate.call(this,self__,args);};
G__30242.cljs$lang$maxFixedArity = 1;
G__30242.cljs$lang$applyTo = (function (arglist__30244){
var self__ = cljs.core.first(arglist__30244);
var args = cljs.core.rest(arglist__30244);
return G__30242__delegate(self__,args);
});
G__30242.cljs$core$IFn$_invoke$arity$variadic = G__30242__delegate;
return G__30242;
})()
;

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

Element.prototype.cljs$core$IFn$_invoke$arity$2 = (function() { 
var G__30245__delegate = function (args){
var this$ = this;
var vec__30215 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30215,(0),null);
var kids = cljs.core.nth.call(null,vec__30215,(1),null);
var G__30218 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30218,attr);

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

return G__30218;
};
var G__30245 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30246__i = 0, G__30246__a = new Array(arguments.length -  0);
while (G__30246__i < G__30246__a.length) {G__30246__a[G__30246__i] = arguments[G__30246__i + 0]; ++G__30246__i;}
  args = new cljs.core.IndexedSeq(G__30246__a,0,null);
} 
return G__30245__delegate.call(this,args);};
G__30245.cljs$lang$maxFixedArity = 0;
G__30245.cljs$lang$applyTo = (function (arglist__30247){
var args = cljs.core.seq(arglist__30247);
return G__30245__delegate(args);
});
G__30245.cljs$core$IFn$_invoke$arity$variadic = G__30245__delegate;
return G__30245;
})()
;

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__30219 = cljs.core.seq.call(null,kvs);
var chunk__30221 = null;
var count__30222 = (0);
var i__30223 = (0);
while(true){
if((i__30223 < count__30222)){
var vec__30225 = cljs.core._nth.call(null,chunk__30221,i__30223);
var k = cljs.core.nth.call(null,vec__30225,(0),null);
var v = cljs.core.nth.call(null,vec__30225,(1),null);
var k_30248__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30248__$1);
} else {
e.setAttribute(k_30248__$1,((cljs.core._EQ_.call(null,true,v))?k_30248__$1:v));
}

var G__30249 = seq__30219;
var G__30250 = chunk__30221;
var G__30251 = count__30222;
var G__30252 = (i__30223 + (1));
seq__30219 = G__30249;
chunk__30221 = G__30250;
count__30222 = G__30251;
i__30223 = G__30252;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30219);
if(temp__5278__auto__){
var seq__30219__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30219__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30219__$1);
var G__30253 = cljs.core.chunk_rest.call(null,seq__30219__$1);
var G__30254 = c__24249__auto__;
var G__30255 = cljs.core.count.call(null,c__24249__auto__);
var G__30256 = (0);
seq__30219 = G__30253;
chunk__30221 = G__30254;
count__30222 = G__30255;
i__30223 = G__30256;
continue;
} else {
var vec__30228 = cljs.core.first.call(null,seq__30219__$1);
var k = cljs.core.nth.call(null,vec__30228,(0),null);
var v = cljs.core.nth.call(null,vec__30228,(1),null);
var k_30257__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30257__$1);
} else {
e.setAttribute(k_30257__$1,((cljs.core._EQ_.call(null,true,v))?k_30257__$1:v));
}

var G__30258 = cljs.core.next.call(null,seq__30219__$1);
var G__30259 = null;
var G__30260 = (0);
var G__30261 = (0);
seq__30219 = G__30258;
chunk__30221 = G__30259;
count__30222 = G__30260;
i__30223 = G__30261;
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__30231 = cljs.core.seq.call(null,kvs);
var chunk__30232 = null;
var count__30233 = (0);
var i__30234 = (0);
while(true){
if((i__30234 < count__30233)){
var vec__30235 = cljs.core._nth.call(null,chunk__30232,i__30234);
var k = cljs.core.nth.call(null,vec__30235,(0),null);
var v = cljs.core.nth.call(null,vec__30235,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)].join(''));

var G__30262 = seq__30231;
var G__30263 = chunk__30232;
var G__30264 = count__30233;
var G__30265 = (i__30234 + (1));
seq__30231 = G__30262;
chunk__30232 = G__30263;
count__30233 = G__30264;
i__30234 = G__30265;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30231);
if(temp__5278__auto__){
var seq__30231__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30231__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30231__$1);
var G__30266 = cljs.core.chunk_rest.call(null,seq__30231__$1);
var G__30267 = c__24249__auto__;
var G__30268 = cljs.core.count.call(null,c__24249__auto__);
var G__30269 = (0);
seq__30231 = G__30266;
chunk__30232 = G__30267;
count__30233 = G__30268;
i__30234 = G__30269;
continue;
} else {
var vec__30238 = cljs.core.first.call(null,seq__30231__$1);
var k = cljs.core.nth.call(null,vec__30238,(0),null);
var v = cljs.core.nth.call(null,vec__30238,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)].join(''));

var G__30270 = cljs.core.next.call(null,seq__30231__$1);
var G__30271 = null;
var G__30272 = (0);
var G__30273 = (0);
seq__30231 = G__30270;
chunk__30232 = G__30271;
count__30233 = G__30272;
i__30234 = G__30273;
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 (e30241){if((e30241 instanceof Error)){
var _ = e30241;
return null;
} else {
throw e30241;

}
}}
});

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__30280__delegate = function (args){
var vec__30277 = hoplon.core.parse_args.call(null,args);
var attrs = cljs.core.nth.call(null,vec__30277,(0),null);
var kids = cljs.core.nth.call(null,vec__30277,(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__30280 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30281__i = 0, G__30281__a = new Array(arguments.length -  0);
while (G__30281__i < G__30281__a.length) {G__30281__a[G__30281__i] = arguments[G__30281__i + 0]; ++G__30281__i;}
  args = new cljs.core.IndexedSeq(G__30281__a,0,null);
} 
return G__30280__delegate.call(this,args);};
G__30280.cljs$lang$maxFixedArity = 0;
G__30280.cljs$lang$applyTo = (function (arglist__30282){
var args = cljs.core.seq(arglist__30282);
return G__30280__delegate(args);
});
G__30280.cljs$core$IFn$_invoke$arity$variadic = G__30280__delegate;
return G__30280;
})()
;
});
hoplon.core.make_elem_ctor = (function hoplon$core$make_elem_ctor(tag){
var mkelem = (function() { 
var G__30286__delegate = function (rest__30283_SHARP_){
return cljs.core.apply.call(null,document.createElement(tag),rest__30283_SHARP_);
};
var G__30286 = function (var_args){
var rest__30283_SHARP_ = null;
if (arguments.length > 0) {
var G__30287__i = 0, G__30287__a = new Array(arguments.length -  0);
while (G__30287__i < G__30287__a.length) {G__30287__a[G__30287__i] = arguments[G__30287__i + 0]; ++G__30287__i;}
  rest__30283_SHARP_ = new cljs.core.IndexedSeq(G__30287__a,0,null);
} 
return G__30286__delegate.call(this,rest__30283_SHARP_);};
G__30286.cljs$lang$maxFixedArity = 0;
G__30286.cljs$lang$applyTo = (function (arglist__30288){
var rest__30283_SHARP_ = cljs.core.seq(arglist__30288);
return G__30286__delegate(rest__30283_SHARP_);
});
G__30286.cljs$core$IFn$_invoke$arity$variadic = G__30286__delegate;
return G__30286;
})()
;
if(!(hoplon.core.is_ie8)){
return mkelem;
} else {
return ((function (mkelem){
return (function() { 
var G__30289__delegate = function (args){
try{return cljs.core.apply.call(null,mkelem,args);
}catch (e30285){if((e30285 instanceof Error)){
var _ = e30285;
return cljs.core.apply.call(null,hoplon.core.make_elem_ctor.call(null,"div"),args);
} else {
throw e30285;

}
}};
var G__30289 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30290__i = 0, G__30290__a = new Array(arguments.length -  0);
while (G__30290__i < G__30290__a.length) {G__30290__a[G__30290__i] = arguments[G__30290__i + 0]; ++G__30290__i;}
  args = new cljs.core.IndexedSeq(G__30290__a,0,null);
} 
return G__30289__delegate.call(this,args);};
G__30289.cljs$lang$maxFixedArity = 0;
G__30289.cljs$lang$applyTo = (function (arglist__30291){
var args = cljs.core.seq(arglist__30291);
return G__30289__delegate(args);
});
G__30289.cljs$core$IFn$_invoke$arity$variadic = G__30289__delegate;
return G__30289;
})()
;
;})(mkelem))
}
});
hoplon.core.html = (function hoplon$core$html(var_args){
var args__24566__auto__ = [];
var len__24559__auto___30293 = arguments.length;
var i__24560__auto___30294 = (0);
while(true){
if((i__24560__auto___30294 < len__24559__auto___30293)){
args__24566__auto__.push((arguments[i__24560__auto___30294]));

var G__30295 = (i__24560__auto___30294 + (1));
i__24560__auto___30294 = G__30295;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((0) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((0)),(0),null)):null);
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(argseq__24567__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);

hoplon.core.html.cljs$lang$applyTo = (function (seq30292){
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30292));
});

/**
 * 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__30296_SHARP_){
return document.createTextNode(p1__30296_SHARP_);
});
hoplon.core.$comment = (function hoplon$core$$comment(p1__30297_SHARP_){
return document.createComment(p1__30297_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__30298_SHARP_){
var e = p1__30298_SHARP_.target;
if(cljs.core.truth_((function (){var or__23338__auto__ = e.getAttribute("action");
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return e.getAttribute("method");
}
})())){
return null;
} else {
return p1__30298_SHARP_.preventDefault();
}
}));
}));
if(typeof hoplon.core.do_BANG_ !== 'undefined'){
} else {
hoplon.core.do_BANG_ = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__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__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (elem,key,val){
var temp__5276__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5276__auto__)){
var n = temp__5276__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__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.core.on_BANG_ !== 'undefined'){
} else {
hoplon.core.on_BANG_ = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__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__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (elem,key,val){
var temp__5276__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5276__auto__)){
var n = temp__5276__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__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__30310,G__30311){
return G__30310.call(null,G__30311);
});})(on_deck))
).call(null,cljs.core.seq,items);
var ith_item = ((function (on_deck,items_seq){
return (function (p1__30299_SHARP_){
return javelin.core.formula.call(null,((function (on_deck,items_seq){
return (function (G__30313,G__30312,G__30314){
return G__30312.call(null,G__30313,G__30314);
});})(on_deck,items_seq))
).call(null,items_seq,hoplon.core.safe_nth,p1__30299_SHARP_);
});})(on_deck,items_seq))
;
var shift_BANG_ = ((function (on_deck,items_seq,ith_item){
return (function (p1__30300_SHARP_){
var x = cljs.core.first.call(null,cljs.core.deref.call(null,p1__30300_SHARP_));
cljs.core.swap_BANG_.call(null,p1__30300_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__30315 = cljs.core.seq.call(null,cljs.core.range.call(null,old,new$));
var chunk__30316 = null;
var count__30317 = (0);
var i__30318 = (0);
while(true){
if((i__30318 < count__30317)){
var i = cljs.core._nth.call(null,chunk__30316,i__30318);
var e_30319 = (function (){var or__23338__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30319);

var G__30320 = seq__30315;
var G__30321 = chunk__30316;
var G__30322 = count__30317;
var G__30323 = (i__30318 + (1));
seq__30315 = G__30320;
chunk__30316 = G__30321;
count__30317 = G__30322;
i__30318 = G__30323;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30315);
if(temp__5278__auto__){
var seq__30315__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30315__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30315__$1);
var G__30324 = cljs.core.chunk_rest.call(null,seq__30315__$1);
var G__30325 = c__24249__auto__;
var G__30326 = cljs.core.count.call(null,c__24249__auto__);
var G__30327 = (0);
seq__30315 = G__30324;
chunk__30316 = G__30325;
count__30317 = G__30326;
i__30318 = G__30327;
continue;
} else {
var i = cljs.core.first.call(null,seq__30315__$1);
var e_30328 = (function (){var or__23338__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30328);

var G__30329 = cljs.core.next.call(null,seq__30315__$1);
var G__30330 = null;
var G__30331 = (0);
var G__30332 = (0);
seq__30315 = G__30329;
chunk__30316 = G__30330;
count__30317 = G__30331;
i__30318 = G__30332;
continue;
}
} else {
return null;
}
}
break;
}
} else {
if((diff < (0))){
var n__24359__auto__ = (- diff);
var _ = (0);
while(true){
if((_ < n__24359__auto__)){
var e_30333 = 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_30333);

var G__30334 = (_ + (1));
_ = G__30334;
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__24566__auto__ = [];
var len__24559__auto___30343 = arguments.length;
var i__24560__auto___30344 = (0);
while(true){
if((i__24560__auto___30344 < len__24559__auto___30343)){
args__24566__auto__.push((arguments[i__24560__auto___30344]));

var G__30345 = (i__24560__auto___30344 + (1));
i__24560__auto___30344 = G__30345;
continue;
} else {
}
break;
}

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

hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic = (function (p__30336){
var vec__30337 = p__30336;
var default$ = cljs.core.nth.call(null,vec__30337,(0),null);
var c = javelin.core.cell.call(null,window.location.hash);
var _ = javelin.core.formula.call(null,((function (c,vec__30337,default$){
return (function (G__30340,G__30342,G__30341){
var or__23338__auto__ = (function (){var and__23326__auto__ = G__30340.call(null,G__30341);
if(cljs.core.truth_(and__23326__auto__)){
return G__30341;
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return G__30342;
}
});})(c,vec__30337,default$))
).call(null,cljs.core.seq,default$,c);
window.addEventListener("hashchange",((function (_,c,vec__30337,default$){
return (function (){
return cljs.core.reset_BANG_.call(null,c,window.location.hash);
});})(_,c,vec__30337,default$))
);

return _;
});

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

hoplon.core.route_cell.cljs$lang$applyTo = (function (seq30335){
return hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30335));
});

