// 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__29950_SHARP_,p2__29951_SHARP_){
return cljs.core.assoc.call(null,p1__29950_SHARP_,p2__29951_SHARP_.getAttribute("static-id"),p2__29951_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 args29952 = [];
var len__24559__auto___29955 = arguments.length;
var i__24560__auto___29956 = (0);
while(true){
if((i__24560__auto___29956 < len__24559__auto___29955)){
args29952.push((arguments[i__24560__auto___29956]));

var G__29957 = (i__24560__auto___29956 + (1));
i__24560__auto___29956 = G__29957;
continue;
} else {
}
break;
}

var G__29954 = args29952.length;
switch (G__29954) {
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(args29952.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__29965 = cljs.core.reverse.call(null,clojure.string.split.call(null,path,/\//));
var seq__29966 = cljs.core.seq.call(null,vec__29965);
var first__29967 = cljs.core.first.call(null,seq__29966);
var seq__29966__$1 = cljs.core.next.call(null,seq__29966);
var f = first__29967;
var more = seq__29966__$1;
var vec__29968 = clojure.string.split.call(null,f,/\./,(2));
var f1 = cljs.core.nth.call(null,vec__29968,(0),null);
var f2 = cljs.core.nth.call(null,vec__29968,(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("b61c20cb89d8457cb77b7fe373665d2c")].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__29971_SHARP_){
return cljs.core.zipmap.call(null,p1__29971_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__29972 = (i + (1));
var G__29973 = cljs.core.conj_BANG_.call(null,ret,x.item(i));
i = G__29972;
ret = G__29973;
continue;
}
break;
}
});
hoplon.core.vflatten = (function hoplon$core$vflatten(var_args){
var args29974 = [];
var len__24559__auto___29977 = arguments.length;
var i__24560__auto___29978 = (0);
while(true){
if((i__24560__auto___29978 < len__24559__auto___29977)){
args29974.push((arguments[i__24560__auto___29978]));

var G__29979 = (i__24560__auto___29978 + (1));
i__24560__auto___29978 = G__29979;
continue;
} else {
}
break;
}

var G__29976 = args29974.length;
switch (G__29976) {
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(args29974.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__29981 = (i + (1));
i = G__29981;
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__29985_SHARP_,p2__29984_SHARP_){
if((p2__29984_SHARP_ == null)){
return p1__29985_SHARP_;
} else {
return cljs.core.conj.call(null,p1__29985_SHARP_,p2__29984_SHARP_);
}
}),cljs.core.PersistentVector.EMPTY,hoplon.core.vflatten.call(null,new$)));
var new_QMARK_ = cljs.core.set.call(null,new$__$1);
var G__30012 = new$__$1;
var vec__30014 = G__30012;
var seq__30015 = cljs.core.seq.call(null,vec__30014);
var first__30016 = cljs.core.first.call(null,seq__30015);
var seq__30015__$1 = cljs.core.next.call(null,seq__30015);
var x = first__30016;
var xs = seq__30015__$1;
var G__30013 = hoplon.core.child_vec.call(null,this$);
var vec__30017 = G__30013;
var seq__30018 = cljs.core.seq.call(null,vec__30017);
var first__30019 = cljs.core.first.call(null,seq__30018);
var seq__30018__$1 = cljs.core.next.call(null,seq__30018);
var k = first__30019;
var ks = seq__30018__$1;
var kids = vec__30017;
var G__30012__$1 = G__30012;
var G__30013__$1 = G__30013;
while(true){
var vec__30020 = G__30012__$1;
var seq__30021 = cljs.core.seq.call(null,vec__30020);
var first__30022 = cljs.core.first.call(null,seq__30021);
var seq__30021__$1 = cljs.core.next.call(null,seq__30021);
var x__$1 = first__30022;
var xs__$1 = seq__30021__$1;
var vec__30023 = G__30013__$1;
var seq__30024 = cljs.core.seq.call(null,vec__30023);
var first__30025 = cljs.core.first.call(null,seq__30024);
var seq__30024__$1 = cljs.core.next.call(null,seq__30024);
var k__$1 = first__30025;
var ks__$1 = seq__30024__$1;
var kids__$1 = vec__30023;
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__30026 = xs__$1;
var G__30027 = ((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__30012__$1 = G__30026;
G__30013__$1 = G__30027;
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_30028 = cljs.core.atom.call(null,hoplon.core.child_vec.call(null,this$__$1));
this$__$1.hoplonKids = kids_30028;

hoplon.core.do_watch.call(null,kids_30028,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_30031 = kidfn.call(null,parent);
var i_30032 = cljs.core.count.call(null,cljs.core.deref.call(null,kids_30031));
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,child__$1))){
hoplon.core.do_watch.call(null,child__$1,((function (kids_30031,i_30032,child__$1){
return (function (p1__30030_SHARP_,p2__30029_SHARP_){
return cljs.core.swap_BANG_.call(null,kids_30031,cljs.core.assoc,i_30032,p2__30029_SHARP_);
});})(kids_30031,i_30032,child__$1))
);
} else {
cljs.core.swap_BANG_.call(null,kids_30031,cljs.core.assoc,i_30032,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__30033_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__30033_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__30034_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__30034_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__30035_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__30035_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_30036 = cljs.core.keyword.call(null,k);
var attr_30037 = attrfn.call(null,this$__$1);
var has_QMARK__30038 = (function (){var and__23326__auto__ = attr_30037;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,attr_30037),kk_30036);
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(has_QMARK__30038)){
cljs.core.swap_BANG_.call(null,attr_30037,cljs.core.assoc,kk_30036,v);
} else {
hoplon.core.setAttribute.call(this$__$1,k,v);
}

return _;
});
});
hoplon.core.set_appendChild_BANG_.call(null,Element.prototype,(function (p1__30039_SHARP_){
return p1__30039_SHARP_.hoplonKids;
}));
hoplon.core.set_removeChild_BANG_.call(null,Element.prototype,(function (p1__30040_SHARP_){
return p1__30040_SHARP_.hoplonKids;
}));
hoplon.core.set_insertBefore_BANG_.call(null,Element.prototype,(function (p1__30041_SHARP_){
return p1__30041_SHARP_.hoplonKids;
}));
hoplon.core.set_replaceChild_BANG_.call(null,Element.prototype,(function (p1__30042_SHARP_){
return p1__30042_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 args30043 = [];
var len__24559__auto___30050 = arguments.length;
var i__24560__auto___30051 = (0);
while(true){
if((i__24560__auto___30051 < len__24559__auto___30050)){
args30043.push((arguments[i__24560__auto___30051]));

var G__30052 = (i__24560__auto___30051 + (1));
i__24560__auto___30051 = G__30052;
continue;
} else {
}
break;
}

var G__30049 = args30043.length;
switch (G__30049) {
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(args30043.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 (seq30044){
var G__30045 = cljs.core.first.call(null,seq30044);
var seq30044__$1 = cljs.core.next.call(null,seq30044);
var G__30046 = cljs.core.first.call(null,seq30044__$1);
var seq30044__$2 = cljs.core.next.call(null,seq30044__$1);
var G__30047 = cljs.core.first.call(null,seq30044__$2);
var seq30044__$3 = cljs.core.next.call(null,seq30044__$2);
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__30045,G__30046,G__30047,seq30044__$3);
});

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

hoplon.core.set_styles_BANG_ = (function hoplon$core$set_styles_BANG_(var_args){
var args30054 = [];
var len__24559__auto___30061 = arguments.length;
var i__24560__auto___30062 = (0);
while(true){
if((i__24560__auto___30062 < len__24559__auto___30061)){
args30054.push((arguments[i__24560__auto___30062]));

var G__30063 = (i__24560__auto___30062 + (1));
i__24560__auto___30062 = G__30063;
continue;
} else {
}
break;
}

var G__30060 = args30054.length;
switch (G__30060) {
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(args30054.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 (seq30055){
var G__30056 = cljs.core.first.call(null,seq30055);
var seq30055__$1 = cljs.core.next.call(null,seq30055);
var G__30057 = cljs.core.first.call(null,seq30055__$1);
var seq30055__$2 = cljs.core.next.call(null,seq30055__$1);
var G__30058 = cljs.core.first.call(null,seq30055__$2);
var seq30055__$3 = cljs.core.next.call(null,seq30055__$2);
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__30056,G__30057,G__30058,seq30055__$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__30068_SHARP_,p2__30067_SHARP_){
return hoplon.core.do_BANG_.call(null,elem,this$__$1,p2__30067_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__30069_SHARP_){
return p1__30069_SHARP_.head;
}):(function (p1__30070_SHARP_){
return p1__30070_SHARP_.documentElement.firstChild;
}));
hoplon.core.vector_QMARK__STAR_ = ((!(hoplon.core.is_ie8))?cljs.core.vector_QMARK_:(function (p1__30071_SHARP_){
try{return cljs.core.vector_QMARK_.call(null,p1__30071_SHARP_);
}catch (e30072){if((e30072 instanceof Error)){
var _ = e30072;
return null;
} else {
throw e30072;

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

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

var G__30081 = (i__24560__auto___30080 + (1));
i__24560__auto___30080 = G__30081;
continue;
} else {
}
break;
}

var G__30077 = args30075.length;
switch (G__30077) {
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(args30075.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 (e30078){if((e30078 instanceof Error)){
var _ = e30078;
return not_found;
} else {
throw e30078;

}
}});

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

var G__30088 = (i__24560__auto___30087 + (1));
i__24560__auto___30087 = G__30088;
continue;
} else {
}
break;
}

var G__30085 = args30083.length;
switch (G__30085) {
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(args30083.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__30102_30106 = cljs.core.seq.call(null,goog.object.get(this$,"_hoplonWhenDom"));
var chunk__30103_30107 = null;
var count__30104_30108 = (0);
var i__30105_30109 = (0);
while(true){
if((i__30105_30109 < count__30104_30108)){
var f_30110__$1 = cljs.core._nth.call(null,chunk__30103_30107,i__30105_30109);
f_30110__$1.call(null);

var G__30111 = seq__30102_30106;
var G__30112 = chunk__30103_30107;
var G__30113 = count__30104_30108;
var G__30114 = (i__30105_30109 + (1));
seq__30102_30106 = G__30111;
chunk__30103_30107 = G__30112;
count__30104_30108 = G__30113;
i__30105_30109 = G__30114;
continue;
} else {
var temp__5278__auto___30115 = cljs.core.seq.call(null,seq__30102_30106);
if(temp__5278__auto___30115){
var seq__30102_30116__$1 = temp__5278__auto___30115;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30102_30116__$1)){
var c__24249__auto___30117 = cljs.core.chunk_first.call(null,seq__30102_30116__$1);
var G__30118 = cljs.core.chunk_rest.call(null,seq__30102_30116__$1);
var G__30119 = c__24249__auto___30117;
var G__30120 = cljs.core.count.call(null,c__24249__auto___30117);
var G__30121 = (0);
seq__30102_30106 = G__30118;
chunk__30103_30107 = G__30119;
count__30104_30108 = G__30120;
i__30105_30109 = G__30121;
continue;
} else {
var f_30122__$1 = cljs.core.first.call(null,seq__30102_30116__$1);
f_30122__$1.call(null);

var G__30123 = cljs.core.next.call(null,seq__30102_30116__$1);
var G__30124 = null;
var G__30125 = (0);
var G__30126 = (0);
seq__30102_30106 = G__30123;
chunk__30103_30107 = G__30124;
count__30104_30108 = G__30125;
i__30105_30109 = G__30126;
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__30143 = args;
var vec__30144 = G__30143;
var seq__30145 = cljs.core.seq.call(null,vec__30144);
var first__30146 = cljs.core.first.call(null,seq__30145);
var seq__30145__$1 = cljs.core.next.call(null,seq__30145);
var arg = first__30146;
var args__$1 = seq__30145__$1;
var attr__$1 = attr;
var kids__$1 = kids;
var G__30143__$1 = G__30143;
while(true){
var attr__$2 = attr__$1;
var kids__$2 = kids__$1;
var vec__30147 = G__30143__$1;
var seq__30148 = cljs.core.seq.call(null,vec__30147);
var first__30149 = cljs.core.first.call(null,seq__30148);
var seq__30148__$1 = cljs.core.next.call(null,seq__30148);
var arg__$1 = first__30149;
var args__$2 = seq__30148__$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__30150 = cljs.core.reduce_kv.call(null,((function (attr__$1,kids__$1,G__30143__$1,attr__$2,kids__$2,vec__30147,seq__30148,first__30149,seq__30148__$1,arg__$1,args__$2,attr,kids,G__30143,vec__30144,seq__30145,first__30146,seq__30145__$1,arg,args__$1){
return (function (p1__30127_SHARP_,p2__30128_SHARP_,p3__30129_SHARP_){
return cljs.core.assoc_BANG_.call(null,p1__30127_SHARP_,p2__30128_SHARP_,p3__30129_SHARP_);
});})(attr__$1,kids__$1,G__30143__$1,attr__$2,kids__$2,vec__30147,seq__30148,first__30149,seq__30148__$1,arg__$1,args__$2,attr,kids,G__30143,vec__30144,seq__30145,first__30146,seq__30145__$1,arg,args__$1))
,attr__$2,arg__$1);
var G__30151 = kids__$2;
var G__30152 = args__$2;
attr__$1 = G__30150;
kids__$1 = G__30151;
G__30143__$1 = G__30152;
continue;
} else {
if(cljs.core.truth_(hoplon.core.attribute_QMARK_.call(null,arg__$1))){
var G__30153 = cljs.core.assoc_BANG_.call(null,attr__$2,arg__$1,cljs.core.first.call(null,args__$2));
var G__30154 = kids__$2;
var G__30155 = cljs.core.rest.call(null,args__$2);
attr__$1 = G__30153;
kids__$1 = G__30154;
G__30143__$1 = G__30155;
continue;
} else {
if(cljs.core.truth_(hoplon.core.seq_QMARK__STAR_.call(null,arg__$1))){
var G__30156 = attr__$2;
var G__30157 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30158 = args__$2;
attr__$1 = G__30156;
kids__$1 = G__30157;
G__30143__$1 = G__30158;
continue;
} else {
if(cljs.core.truth_(hoplon.core.vector_QMARK__STAR_.call(null,arg__$1))){
var G__30159 = attr__$2;
var G__30160 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__30161 = args__$2;
attr__$1 = G__30159;
kids__$1 = G__30160;
G__30143__$1 = G__30161;
continue;
} else {
var G__30162 = attr__$2;
var G__30163 = cljs.core.conj_BANG_.call(null,kids__$2,arg__$1);
var G__30164 = args__$2;
attr__$1 = G__30162;
kids__$1 = G__30163;
G__30143__$1 = G__30164;
continue;

}
}
}
}
}
break;
}
});
hoplon.core.add_attributes_BANG_ = (function hoplon$core$add_attributes_BANG_(this$,attr){
return cljs.core.reduce_kv.call(null,(function (p1__30166_SHARP_,p2__30165_SHARP_,p3__30167_SHARP_){
hoplon.core._attr_BANG_.call(null,p2__30165_SHARP_,p1__30166_SHARP_,p3__30167_SHARP_);

return p1__30166_SHARP_;
}),this$,attr);
});
hoplon.core.add_children_BANG_ = (function hoplon$core$add_children_BANG_(this$,p__30168){
var vec__30176 = p__30168;
var seq__30177 = cljs.core.seq.call(null,vec__30176);
var first__30178 = cljs.core.first.call(null,seq__30177);
var seq__30177__$1 = cljs.core.next.call(null,seq__30177);
var child_cell = first__30178;
var _ = seq__30177__$1;
var kids = vec__30176;
var this$__$1 = this$;
var seq__30179_30183 = cljs.core.seq.call(null,hoplon.core.vflatten.call(null,kids));
var chunk__30180_30184 = null;
var count__30181_30185 = (0);
var i__30182_30186 = (0);
while(true){
if((i__30182_30186 < count__30181_30185)){
var x_30187 = cljs.core._nth.call(null,chunk__30180_30184,i__30182_30186);
var temp__5278__auto___30188 = hoplon.core.__GT_node.call(null,x_30187);
if(cljs.core.truth_(temp__5278__auto___30188)){
var x_30189__$1 = temp__5278__auto___30188;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30189__$1);
} else {
}

var G__30190 = seq__30179_30183;
var G__30191 = chunk__30180_30184;
var G__30192 = count__30181_30185;
var G__30193 = (i__30182_30186 + (1));
seq__30179_30183 = G__30190;
chunk__30180_30184 = G__30191;
count__30181_30185 = G__30192;
i__30182_30186 = G__30193;
continue;
} else {
var temp__5278__auto___30194 = cljs.core.seq.call(null,seq__30179_30183);
if(temp__5278__auto___30194){
var seq__30179_30195__$1 = temp__5278__auto___30194;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30179_30195__$1)){
var c__24249__auto___30196 = cljs.core.chunk_first.call(null,seq__30179_30195__$1);
var G__30197 = cljs.core.chunk_rest.call(null,seq__30179_30195__$1);
var G__30198 = c__24249__auto___30196;
var G__30199 = cljs.core.count.call(null,c__24249__auto___30196);
var G__30200 = (0);
seq__30179_30183 = G__30197;
chunk__30180_30184 = G__30198;
count__30181_30185 = G__30199;
i__30182_30186 = G__30200;
continue;
} else {
var x_30201 = cljs.core.first.call(null,seq__30179_30195__$1);
var temp__5278__auto___30202__$1 = hoplon.core.__GT_node.call(null,x_30201);
if(cljs.core.truth_(temp__5278__auto___30202__$1)){
var x_30203__$1 = temp__5278__auto___30202__$1;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30203__$1);
} else {
}

var G__30204 = cljs.core.next.call(null,seq__30179_30195__$1);
var G__30205 = null;
var G__30206 = (0);
var G__30207 = (0);
seq__30179_30183 = G__30204;
chunk__30180_30184 = G__30205;
count__30181_30185 = G__30206;
i__30182_30186 = G__30207;
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__30240__delegate = function (self__,args){
var self____$1 = this;
var this$ = self____$1;
var vec__30209 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30209,(0),null);
var kids = cljs.core.nth.call(null,vec__30209,(1),null);
var G__30212 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30212,attr);

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

return G__30212;
};
var G__30240 = function (self__,var_args){
var args = null;
if (arguments.length > 1) {
var G__30241__i = 0, G__30241__a = new Array(arguments.length -  1);
while (G__30241__i < G__30241__a.length) {G__30241__a[G__30241__i] = arguments[G__30241__i + 1]; ++G__30241__i;}
  args = new cljs.core.IndexedSeq(G__30241__a,0,null);
} 
return G__30240__delegate.call(this,self__,args);};
G__30240.cljs$lang$maxFixedArity = 1;
G__30240.cljs$lang$applyTo = (function (arglist__30242){
var self__ = cljs.core.first(arglist__30242);
var args = cljs.core.rest(arglist__30242);
return G__30240__delegate(self__,args);
});
G__30240.cljs$core$IFn$_invoke$arity$variadic = G__30240__delegate;
return G__30240;
})()
;

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

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

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

return G__30216;
};
var G__30243 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30244__i = 0, G__30244__a = new Array(arguments.length -  0);
while (G__30244__i < G__30244__a.length) {G__30244__a[G__30244__i] = arguments[G__30244__i + 0]; ++G__30244__i;}
  args = new cljs.core.IndexedSeq(G__30244__a,0,null);
} 
return G__30243__delegate.call(this,args);};
G__30243.cljs$lang$maxFixedArity = 0;
G__30243.cljs$lang$applyTo = (function (arglist__30245){
var args = cljs.core.seq(arglist__30245);
return G__30243__delegate(args);
});
G__30243.cljs$core$IFn$_invoke$arity$variadic = G__30243__delegate;
return G__30243;
})()
;

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__30217 = cljs.core.seq.call(null,kvs);
var chunk__30219 = null;
var count__30220 = (0);
var i__30221 = (0);
while(true){
if((i__30221 < count__30220)){
var vec__30223 = cljs.core._nth.call(null,chunk__30219,i__30221);
var k = cljs.core.nth.call(null,vec__30223,(0),null);
var v = cljs.core.nth.call(null,vec__30223,(1),null);
var k_30246__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30246__$1);
} else {
e.setAttribute(k_30246__$1,((cljs.core._EQ_.call(null,true,v))?k_30246__$1:v));
}

var G__30247 = seq__30217;
var G__30248 = chunk__30219;
var G__30249 = count__30220;
var G__30250 = (i__30221 + (1));
seq__30217 = G__30247;
chunk__30219 = G__30248;
count__30220 = G__30249;
i__30221 = G__30250;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30217);
if(temp__5278__auto__){
var seq__30217__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30217__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30217__$1);
var G__30251 = cljs.core.chunk_rest.call(null,seq__30217__$1);
var G__30252 = c__24249__auto__;
var G__30253 = cljs.core.count.call(null,c__24249__auto__);
var G__30254 = (0);
seq__30217 = G__30251;
chunk__30219 = G__30252;
count__30220 = G__30253;
i__30221 = G__30254;
continue;
} else {
var vec__30226 = cljs.core.first.call(null,seq__30217__$1);
var k = cljs.core.nth.call(null,vec__30226,(0),null);
var v = cljs.core.nth.call(null,vec__30226,(1),null);
var k_30255__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30255__$1);
} else {
e.setAttribute(k_30255__$1,((cljs.core._EQ_.call(null,true,v))?k_30255__$1:v));
}

var G__30256 = cljs.core.next.call(null,seq__30217__$1);
var G__30257 = null;
var G__30258 = (0);
var G__30259 = (0);
seq__30217 = G__30256;
chunk__30219 = G__30257;
count__30220 = G__30258;
i__30221 = G__30259;
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__30229 = cljs.core.seq.call(null,kvs);
var chunk__30230 = null;
var count__30231 = (0);
var i__30232 = (0);
while(true){
if((i__30232 < count__30231)){
var vec__30233 = cljs.core._nth.call(null,chunk__30230,i__30232);
var k = cljs.core.nth.call(null,vec__30233,(0),null);
var v = cljs.core.nth.call(null,vec__30233,(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__30260 = seq__30229;
var G__30261 = chunk__30230;
var G__30262 = count__30231;
var G__30263 = (i__30232 + (1));
seq__30229 = G__30260;
chunk__30230 = G__30261;
count__30231 = G__30262;
i__30232 = G__30263;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30229);
if(temp__5278__auto__){
var seq__30229__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30229__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30229__$1);
var G__30264 = cljs.core.chunk_rest.call(null,seq__30229__$1);
var G__30265 = c__24249__auto__;
var G__30266 = cljs.core.count.call(null,c__24249__auto__);
var G__30267 = (0);
seq__30229 = G__30264;
chunk__30230 = G__30265;
count__30231 = G__30266;
i__30232 = G__30267;
continue;
} else {
var vec__30236 = cljs.core.first.call(null,seq__30229__$1);
var k = cljs.core.nth.call(null,vec__30236,(0),null);
var v = cljs.core.nth.call(null,vec__30236,(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__30268 = cljs.core.next.call(null,seq__30229__$1);
var G__30269 = null;
var G__30270 = (0);
var G__30271 = (0);
seq__30229 = G__30268;
chunk__30230 = G__30269;
count__30231 = G__30270;
i__30232 = G__30271;
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 (e30239){if((e30239 instanceof Error)){
var _ = e30239;
return null;
} else {
throw e30239;

}
}}
});

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__30278__delegate = function (args){
var vec__30275 = hoplon.core.parse_args.call(null,args);
var attrs = cljs.core.nth.call(null,vec__30275,(0),null);
var kids = cljs.core.nth.call(null,vec__30275,(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__30278 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30279__i = 0, G__30279__a = new Array(arguments.length -  0);
while (G__30279__i < G__30279__a.length) {G__30279__a[G__30279__i] = arguments[G__30279__i + 0]; ++G__30279__i;}
  args = new cljs.core.IndexedSeq(G__30279__a,0,null);
} 
return G__30278__delegate.call(this,args);};
G__30278.cljs$lang$maxFixedArity = 0;
G__30278.cljs$lang$applyTo = (function (arglist__30280){
var args = cljs.core.seq(arglist__30280);
return G__30278__delegate(args);
});
G__30278.cljs$core$IFn$_invoke$arity$variadic = G__30278__delegate;
return G__30278;
})()
;
});
hoplon.core.make_elem_ctor = (function hoplon$core$make_elem_ctor(tag){
var mkelem = (function() { 
var G__30284__delegate = function (rest__30281_SHARP_){
return cljs.core.apply.call(null,document.createElement(tag),rest__30281_SHARP_);
};
var G__30284 = function (var_args){
var rest__30281_SHARP_ = null;
if (arguments.length > 0) {
var G__30285__i = 0, G__30285__a = new Array(arguments.length -  0);
while (G__30285__i < G__30285__a.length) {G__30285__a[G__30285__i] = arguments[G__30285__i + 0]; ++G__30285__i;}
  rest__30281_SHARP_ = new cljs.core.IndexedSeq(G__30285__a,0,null);
} 
return G__30284__delegate.call(this,rest__30281_SHARP_);};
G__30284.cljs$lang$maxFixedArity = 0;
G__30284.cljs$lang$applyTo = (function (arglist__30286){
var rest__30281_SHARP_ = cljs.core.seq(arglist__30286);
return G__30284__delegate(rest__30281_SHARP_);
});
G__30284.cljs$core$IFn$_invoke$arity$variadic = G__30284__delegate;
return G__30284;
})()
;
if(!(hoplon.core.is_ie8)){
return mkelem;
} else {
return ((function (mkelem){
return (function() { 
var G__30287__delegate = function (args){
try{return cljs.core.apply.call(null,mkelem,args);
}catch (e30283){if((e30283 instanceof Error)){
var _ = e30283;
return cljs.core.apply.call(null,hoplon.core.make_elem_ctor.call(null,"div"),args);
} else {
throw e30283;

}
}};
var G__30287 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30288__i = 0, G__30288__a = new Array(arguments.length -  0);
while (G__30288__i < G__30288__a.length) {G__30288__a[G__30288__i] = arguments[G__30288__i + 0]; ++G__30288__i;}
  args = new cljs.core.IndexedSeq(G__30288__a,0,null);
} 
return G__30287__delegate.call(this,args);};
G__30287.cljs$lang$maxFixedArity = 0;
G__30287.cljs$lang$applyTo = (function (arglist__30289){
var args = cljs.core.seq(arglist__30289);
return G__30287__delegate(args);
});
G__30287.cljs$core$IFn$_invoke$arity$variadic = G__30287__delegate;
return G__30287;
})()
;
;})(mkelem))
}
});
hoplon.core.html = (function hoplon$core$html(var_args){
var args__24566__auto__ = [];
var len__24559__auto___30291 = arguments.length;
var i__24560__auto___30292 = (0);
while(true){
if((i__24560__auto___30292 < len__24559__auto___30291)){
args__24566__auto__.push((arguments[i__24560__auto___30292]));

var G__30293 = (i__24560__auto___30292 + (1));
i__24560__auto___30292 = G__30293;
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 (seq30290){
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30290));
});

/**
 * 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__30294_SHARP_){
return document.createTextNode(p1__30294_SHARP_);
});
hoplon.core.$comment = (function hoplon$core$$comment(p1__30295_SHARP_){
return document.createComment(p1__30295_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__30296_SHARP_){
var e = p1__30296_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__30296_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__30308,G__30309){
return G__30308.call(null,G__30309);
});})(on_deck))
).call(null,cljs.core.seq,items);
var ith_item = ((function (on_deck,items_seq){
return (function (p1__30297_SHARP_){
return javelin.core.formula.call(null,((function (on_deck,items_seq){
return (function (G__30311,G__30312,G__30310){
return G__30310.call(null,G__30311,G__30312);
});})(on_deck,items_seq))
).call(null,items_seq,p1__30297_SHARP_,hoplon.core.safe_nth);
});})(on_deck,items_seq))
;
var shift_BANG_ = ((function (on_deck,items_seq,ith_item){
return (function (p1__30298_SHARP_){
var x = cljs.core.first.call(null,cljs.core.deref.call(null,p1__30298_SHARP_));
cljs.core.swap_BANG_.call(null,p1__30298_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__30313 = cljs.core.seq.call(null,cljs.core.range.call(null,old,new$));
var chunk__30314 = null;
var count__30315 = (0);
var i__30316 = (0);
while(true){
if((i__30316 < count__30315)){
var i = cljs.core._nth.call(null,chunk__30314,i__30316);
var e_30317 = (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_30317);

var G__30318 = seq__30313;
var G__30319 = chunk__30314;
var G__30320 = count__30315;
var G__30321 = (i__30316 + (1));
seq__30313 = G__30318;
chunk__30314 = G__30319;
count__30315 = G__30320;
i__30316 = G__30321;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30313);
if(temp__5278__auto__){
var seq__30313__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30313__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__30313__$1);
var G__30322 = cljs.core.chunk_rest.call(null,seq__30313__$1);
var G__30323 = c__24249__auto__;
var G__30324 = cljs.core.count.call(null,c__24249__auto__);
var G__30325 = (0);
seq__30313 = G__30322;
chunk__30314 = G__30323;
count__30315 = G__30324;
i__30316 = G__30325;
continue;
} else {
var i = cljs.core.first.call(null,seq__30313__$1);
var e_30326 = (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_30326);

var G__30327 = cljs.core.next.call(null,seq__30313__$1);
var G__30328 = null;
var G__30329 = (0);
var G__30330 = (0);
seq__30313 = G__30327;
chunk__30314 = G__30328;
count__30315 = G__30329;
i__30316 = G__30330;
continue;
}
} else {
return null;
}
}
break;
}
} else {
if((diff < (0))){
var n__24359__auto__ = (- diff);
var _ = (0);
while(true){
if((_ < n__24359__auto__)){
var e_30331 = 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_30331);

var G__30332 = (_ + (1));
_ = G__30332;
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___30341 = arguments.length;
var i__24560__auto___30342 = (0);
while(true){
if((i__24560__auto___30342 < len__24559__auto___30341)){
args__24566__auto__.push((arguments[i__24560__auto___30342]));

var G__30343 = (i__24560__auto___30342 + (1));
i__24560__auto___30342 = G__30343;
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__30334){
var vec__30335 = p__30334;
var default$ = cljs.core.nth.call(null,vec__30335,(0),null);
var c = javelin.core.cell.call(null,window.location.hash);
var _ = javelin.core.formula.call(null,((function (c,vec__30335,default$){
return (function (G__30338,G__30340,G__30339){
var or__23338__auto__ = (function (){var and__23326__auto__ = G__30338.call(null,G__30339);
if(cljs.core.truth_(and__23326__auto__)){
return G__30339;
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return G__30340;
}
});})(c,vec__30335,default$))
).call(null,cljs.core.seq,default$,c);
window.addEventListener("hashchange",((function (_,c,vec__30335,default$){
return (function (){
return cljs.core.reset_BANG_.call(null,c,window.location.hash);
});})(_,c,vec__30335,default$))
);

return _;
});

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

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

