goog.provide('shadow.dom');
shadow.dom.transition_supported_QMARK_ = true;

/**
 * @interface
 */
shadow.dom.IElement = function(){};

var shadow$dom$IElement$_to_dom$dyn_12823 = (function (this$){
var x__5350__auto__ = (((this$ == null))?null:this$);
var m__5351__auto__ = (shadow.dom._to_dom[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5351__auto__.call(null,this$));
} else {
var m__5349__auto__ = (shadow.dom._to_dom["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5349__auto__.call(null,this$));
} else {
throw cljs.core.missing_protocol("IElement.-to-dom",this$);
}
}
});
shadow.dom._to_dom = (function shadow$dom$_to_dom(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$IElement$_to_dom$arity$1 == null)))))){
return this$.shadow$dom$IElement$_to_dom$arity$1(this$);
} else {
return shadow$dom$IElement$_to_dom$dyn_12823(this$);
}
});


/**
 * @interface
 */
shadow.dom.SVGElement = function(){};

var shadow$dom$SVGElement$_to_svg$dyn_12825 = (function (this$){
var x__5350__auto__ = (((this$ == null))?null:this$);
var m__5351__auto__ = (shadow.dom._to_svg[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5351__auto__.call(null,this$));
} else {
var m__5349__auto__ = (shadow.dom._to_svg["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5349__auto__.call(null,this$));
} else {
throw cljs.core.missing_protocol("SVGElement.-to-svg",this$);
}
}
});
shadow.dom._to_svg = (function shadow$dom$_to_svg(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$SVGElement$_to_svg$arity$1 == null)))))){
return this$.shadow$dom$SVGElement$_to_svg$arity$1(this$);
} else {
return shadow$dom$SVGElement$_to_svg$dyn_12825(this$);
}
});

shadow.dom.lazy_native_coll_seq = (function shadow$dom$lazy_native_coll_seq(coll,idx){
if((idx < coll.length)){
return (new cljs.core.LazySeq(null,(function (){
return cljs.core.cons((coll[idx]),(function (){var G__11812 = coll;
var G__11813 = (idx + (1));
return (shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2 ? shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2(G__11812,G__11813) : shadow.dom.lazy_native_coll_seq.call(null,G__11812,G__11813));
})());
}),null,null));
} else {
return null;
}
});

/**
* @constructor
 * @implements {cljs.core.IIndexed}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IDeref}
 * @implements {shadow.dom.IElement}
*/
shadow.dom.NativeColl = (function (coll){
this.coll = coll;
this.cljs$lang$protocol_mask$partition0$ = 8421394;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(shadow.dom.NativeColl.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$2 = (function (this$,n){
var self__ = this;
var this$__$1 = this;
return (self__.coll[n]);
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$3 = (function (this$,n,not_found){
var self__ = this;
var this$__$1 = this;
var or__5002__auto__ = (self__.coll[n]);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return not_found;
}
}));

(shadow.dom.NativeColl.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll.length;
}));

(shadow.dom.NativeColl.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return shadow.dom.lazy_native_coll_seq(self__.coll,(0));
}));

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"coll","coll",-1006698606,null)], null);
}));

(shadow.dom.NativeColl.cljs$lang$type = true);

(shadow.dom.NativeColl.cljs$lang$ctorStr = "shadow.dom/NativeColl");

(shadow.dom.NativeColl.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"shadow.dom/NativeColl");
}));

/**
 * Positional factory function for shadow.dom/NativeColl.
 */
shadow.dom.__GT_NativeColl = (function shadow$dom$__GT_NativeColl(coll){
return (new shadow.dom.NativeColl(coll));
});

shadow.dom.native_coll = (function shadow$dom$native_coll(coll){
return (new shadow.dom.NativeColl(coll));
});
shadow.dom.dom_node = (function shadow$dom$dom_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$IElement$))))?true:false):false)){
return el.shadow$dom$IElement$_to_dom$arity$1(null);
} else {
if(typeof el === 'string'){
return document.createTextNode(el);
} else {
if(typeof el === 'number'){
return document.createTextNode(cljs.core.str.cljs$core$IFn$_invoke$arity$1(el));
} else {
return el;

}
}
}
}
});
shadow.dom.query_one = (function shadow$dom$query_one(var_args){
var G__11842 = arguments.length;
switch (G__11842) {
case 1:
return shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return document.querySelector(sel);
}));

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return shadow.dom.dom_node(root).querySelector(sel);
}));

(shadow.dom.query_one.cljs$lang$maxFixedArity = 2);

shadow.dom.query = (function shadow$dom$query(var_args){
var G__11850 = arguments.length;
switch (G__11850) {
case 1:
return shadow.dom.query.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.query.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return (new shadow.dom.NativeColl(document.querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(root).querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$lang$maxFixedArity = 2);

shadow.dom.by_id = (function shadow$dom$by_id(var_args){
var G__11859 = arguments.length;
switch (G__11859) {
case 2:
return shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.by_id.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

}
});

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2 = (function (id,el){
return shadow.dom.dom_node(el).getElementById(id);
}));

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$1 = (function (id){
return document.getElementById(id);
}));

(shadow.dom.by_id.cljs$lang$maxFixedArity = 2);

shadow.dom.build = shadow.dom.dom_node;
shadow.dom.ev_stop = (function shadow$dom$ev_stop(var_args){
var G__11868 = arguments.length;
switch (G__11868) {
case 1:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

break;
case 4:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

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

}
});

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1 = (function (e){
if(cljs.core.truth_(e.stopPropagation)){
e.stopPropagation();

e.preventDefault();
} else {
(e.cancelBubble = true);

(e.returnValue = false);
}

return e;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$2 = (function (e,el){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$4 = (function (e,el,scope,owner){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$lang$maxFixedArity = 4);

/**
 * check wether a parent node (or the document) contains the child
 */
shadow.dom.contains_QMARK_ = (function shadow$dom$contains_QMARK_(var_args){
var G__11887 = arguments.length;
switch (G__11887) {
case 1:
return shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1 = (function (el){
return goog.dom.contains(document,shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$2 = (function (parent,el){
return goog.dom.contains(shadow.dom.dom_node(parent),shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$lang$maxFixedArity = 2);

shadow.dom.add_class = (function shadow$dom$add_class(el,cls){
return goog.dom.classlist.add(shadow.dom.dom_node(el),cls);
});
shadow.dom.remove_class = (function shadow$dom$remove_class(el,cls){
return goog.dom.classlist.remove(shadow.dom.dom_node(el),cls);
});
shadow.dom.toggle_class = (function shadow$dom$toggle_class(var_args){
var G__11917 = arguments.length;
switch (G__11917) {
case 2:
return shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2 = (function (el,cls){
return goog.dom.classlist.toggle(shadow.dom.dom_node(el),cls);
}));

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$3 = (function (el,cls,v){
if(cljs.core.truth_(v)){
return shadow.dom.add_class(el,cls);
} else {
return shadow.dom.remove_class(el,cls);
}
}));

(shadow.dom.toggle_class.cljs$lang$maxFixedArity = 3);

shadow.dom.dom_listen = (cljs.core.truth_((function (){var or__5002__auto__ = (!((typeof document !== 'undefined')));
if(or__5002__auto__){
return or__5002__auto__;
} else {
return document.addEventListener;
}
})())?(function shadow$dom$dom_listen_good(el,ev,handler){
return el.addEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_ie(el,ev,handler){
try{return el.attachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),(function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
}));
}catch (e11926){if((e11926 instanceof Object)){
var e = e11926;
return console.log("didnt support attachEvent",el,e);
} else {
throw e11926;

}
}}));
shadow.dom.dom_listen_remove = (cljs.core.truth_((function (){var or__5002__auto__ = (!((typeof document !== 'undefined')));
if(or__5002__auto__){
return or__5002__auto__;
} else {
return document.removeEventListener;
}
})())?(function shadow$dom$dom_listen_remove_good(el,ev,handler){
return el.removeEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_remove_ie(el,ev,handler){
return el.detachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),handler);
}));
shadow.dom.on_query = (function shadow$dom$on_query(root_el,ev,selector,handler){
var seq__11933 = cljs.core.seq(shadow.dom.query.cljs$core$IFn$_invoke$arity$2(selector,root_el));
var chunk__11934 = null;
var count__11935 = (0);
var i__11936 = (0);
while(true){
if((i__11936 < count__11935)){
var el = chunk__11934.cljs$core$IIndexed$_nth$arity$2(null,i__11936);
var handler_12868__$1 = ((function (seq__11933,chunk__11934,count__11935,i__11936,el){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});})(seq__11933,chunk__11934,count__11935,i__11936,el))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_12868__$1);


var G__12872 = seq__11933;
var G__12873 = chunk__11934;
var G__12874 = count__11935;
var G__12875 = (i__11936 + (1));
seq__11933 = G__12872;
chunk__11934 = G__12873;
count__11935 = G__12874;
i__11936 = G__12875;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__11933);
if(temp__5804__auto__){
var seq__11933__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__11933__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__11933__$1);
var G__12876 = cljs.core.chunk_rest(seq__11933__$1);
var G__12877 = c__5525__auto__;
var G__12878 = cljs.core.count(c__5525__auto__);
var G__12879 = (0);
seq__11933 = G__12876;
chunk__11934 = G__12877;
count__11935 = G__12878;
i__11936 = G__12879;
continue;
} else {
var el = cljs.core.first(seq__11933__$1);
var handler_12881__$1 = ((function (seq__11933,chunk__11934,count__11935,i__11936,el,seq__11933__$1,temp__5804__auto__){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});})(seq__11933,chunk__11934,count__11935,i__11936,el,seq__11933__$1,temp__5804__auto__))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_12881__$1);


var G__12883 = cljs.core.next(seq__11933__$1);
var G__12884 = null;
var G__12885 = (0);
var G__12886 = (0);
seq__11933 = G__12883;
chunk__11934 = G__12884;
count__11935 = G__12885;
i__11936 = G__12886;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.on = (function shadow$dom$on(var_args){
var G__11980 = arguments.length;
switch (G__11980) {
case 3:
return shadow.dom.on.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
case 4:
return shadow.dom.on.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

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

}
});

(shadow.dom.on.cljs$core$IFn$_invoke$arity$3 = (function (el,ev,handler){
return shadow.dom.on.cljs$core$IFn$_invoke$arity$4(el,ev,handler,false);
}));

(shadow.dom.on.cljs$core$IFn$_invoke$arity$4 = (function (el,ev,handler,capture){
if(cljs.core.vector_QMARK_(ev)){
return shadow.dom.on_query(el,cljs.core.first(ev),cljs.core.second(ev),handler);
} else {
var handler__$1 = (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});
return shadow.dom.dom_listen(shadow.dom.dom_node(el),cljs.core.name(ev),handler__$1);
}
}));

(shadow.dom.on.cljs$lang$maxFixedArity = 4);

shadow.dom.remove_event_handler = (function shadow$dom$remove_event_handler(el,ev,handler){
return shadow.dom.dom_listen_remove(shadow.dom.dom_node(el),cljs.core.name(ev),handler);
});
shadow.dom.add_event_listeners = (function shadow$dom$add_event_listeners(el,events){
var seq__11998 = cljs.core.seq(events);
var chunk__11999 = null;
var count__12000 = (0);
var i__12001 = (0);
while(true){
if((i__12001 < count__12000)){
var vec__12023 = chunk__11999.cljs$core$IIndexed$_nth$arity$2(null,i__12001);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12023,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12023,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__12892 = seq__11998;
var G__12893 = chunk__11999;
var G__12894 = count__12000;
var G__12895 = (i__12001 + (1));
seq__11998 = G__12892;
chunk__11999 = G__12893;
count__12000 = G__12894;
i__12001 = G__12895;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__11998);
if(temp__5804__auto__){
var seq__11998__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__11998__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__11998__$1);
var G__12896 = cljs.core.chunk_rest(seq__11998__$1);
var G__12897 = c__5525__auto__;
var G__12898 = cljs.core.count(c__5525__auto__);
var G__12899 = (0);
seq__11998 = G__12896;
chunk__11999 = G__12897;
count__12000 = G__12898;
i__12001 = G__12899;
continue;
} else {
var vec__12031 = cljs.core.first(seq__11998__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12031,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12031,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__12900 = cljs.core.next(seq__11998__$1);
var G__12901 = null;
var G__12902 = (0);
var G__12903 = (0);
seq__11998 = G__12900;
chunk__11999 = G__12901;
count__12000 = G__12902;
i__12001 = G__12903;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_style = (function shadow$dom$set_style(el,styles){
var dom = shadow.dom.dom_node(el);
var seq__12049 = cljs.core.seq(styles);
var chunk__12050 = null;
var count__12051 = (0);
var i__12052 = (0);
while(true){
if((i__12052 < count__12051)){
var vec__12059 = chunk__12050.cljs$core$IIndexed$_nth$arity$2(null,i__12052);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12059,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12059,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__12907 = seq__12049;
var G__12908 = chunk__12050;
var G__12909 = count__12051;
var G__12910 = (i__12052 + (1));
seq__12049 = G__12907;
chunk__12050 = G__12908;
count__12051 = G__12909;
i__12052 = G__12910;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__12049);
if(temp__5804__auto__){
var seq__12049__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__12049__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__12049__$1);
var G__12912 = cljs.core.chunk_rest(seq__12049__$1);
var G__12913 = c__5525__auto__;
var G__12914 = cljs.core.count(c__5525__auto__);
var G__12915 = (0);
seq__12049 = G__12912;
chunk__12050 = G__12913;
count__12051 = G__12914;
i__12052 = G__12915;
continue;
} else {
var vec__12064 = cljs.core.first(seq__12049__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12064,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12064,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__12916 = cljs.core.next(seq__12049__$1);
var G__12917 = null;
var G__12918 = (0);
var G__12919 = (0);
seq__12049 = G__12916;
chunk__12050 = G__12917;
count__12051 = G__12918;
i__12052 = G__12919;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_attr_STAR_ = (function shadow$dom$set_attr_STAR_(el,key,value){
var G__12078_12921 = key;
var G__12078_12922__$1 = (((G__12078_12921 instanceof cljs.core.Keyword))?G__12078_12921.fqn:null);
switch (G__12078_12922__$1) {
case "id":
(el.id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "class":
(el.className = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "for":
(el.htmlFor = value);

break;
case "cellpadding":
el.setAttribute("cellPadding",value);

break;
case "cellspacing":
el.setAttribute("cellSpacing",value);

break;
case "colspan":
el.setAttribute("colSpan",value);

break;
case "frameborder":
el.setAttribute("frameBorder",value);

break;
case "height":
el.setAttribute("height",value);

break;
case "maxlength":
el.setAttribute("maxLength",value);

break;
case "role":
el.setAttribute("role",value);

break;
case "rowspan":
el.setAttribute("rowSpan",value);

break;
case "type":
el.setAttribute("type",value);

break;
case "usemap":
el.setAttribute("useMap",value);

break;
case "valign":
el.setAttribute("vAlign",value);

break;
case "width":
el.setAttribute("width",value);

break;
case "on":
shadow.dom.add_event_listeners(el,value);

break;
case "style":
if((value == null)){
} else {
if(typeof value === 'string'){
el.setAttribute("style",value);
} else {
if(cljs.core.map_QMARK_(value)){
shadow.dom.set_style(el,value);
} else {
goog.style.setStyle(el,value);

}
}
}

break;
default:
var ks_12931 = cljs.core.name(key);
if(cljs.core.truth_((function (){var or__5002__auto__ = goog.string.startsWith(ks_12931,"data-");
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return goog.string.startsWith(ks_12931,"aria-");
}
})())){
el.setAttribute(ks_12931,value);
} else {
(el[ks_12931] = value);
}

}

return el;
});
shadow.dom.set_attrs = (function shadow$dom$set_attrs(el,attrs){
return cljs.core.reduce_kv((function (el__$1,key,value){
shadow.dom.set_attr_STAR_(el__$1,key,value);

return el__$1;
}),shadow.dom.dom_node(el),attrs);
});
shadow.dom.set_attr = (function shadow$dom$set_attr(el,key,value){
return shadow.dom.set_attr_STAR_(shadow.dom.dom_node(el),key,value);
});
shadow.dom.has_class_QMARK_ = (function shadow$dom$has_class_QMARK_(el,cls){
return goog.dom.classlist.contains(shadow.dom.dom_node(el),cls);
});
shadow.dom.merge_class_string = (function shadow$dom$merge_class_string(current,extra_class){
if(cljs.core.seq(current)){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(current)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(extra_class)].join('');
} else {
return extra_class;
}
});
shadow.dom.parse_tag = (function shadow$dom$parse_tag(spec){
var spec__$1 = cljs.core.name(spec);
var fdot = spec__$1.indexOf(".");
var fhash = spec__$1.indexOf("#");
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)))){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1,null,null], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fdot),null,clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1))),null], null);
} else {
if((fhash > fdot)){
throw ["cant have id after class?",spec__$1].join('');
} else {
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1)),fdot),clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);

}
}
}
}
});
shadow.dom.create_dom_node = (function shadow$dom$create_dom_node(tag_def,p__12114){
var map__12115 = p__12114;
var map__12115__$1 = cljs.core.__destructure_map(map__12115);
var props = map__12115__$1;
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12115__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var tag_props = ({});
var vec__12121 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12121,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12121,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12121,(2),null);
if(cljs.core.truth_(tag_id)){
(tag_props["id"] = tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
(tag_props["class"] = shadow.dom.merge_class_string(class$,tag_classes));
} else {
}

var G__12128 = goog.dom.createDom(tag_name,tag_props);
shadow.dom.set_attrs(G__12128,cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(props,new cljs.core.Keyword(null,"class","class",-2030961996)));

return G__12128;
});
shadow.dom.append = (function shadow$dom$append(var_args){
var G__12140 = arguments.length;
switch (G__12140) {
case 1:
return shadow.dom.append.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.append.cljs$core$IFn$_invoke$arity$1 = (function (node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
document.body.appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$core$IFn$_invoke$arity$2 = (function (el,node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
shadow.dom.dom_node(el).appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$lang$maxFixedArity = 2);

shadow.dom.destructure_node = (function shadow$dom$destructure_node(create_fn,p__12165){
var vec__12168 = p__12165;
var seq__12169 = cljs.core.seq(vec__12168);
var first__12170 = cljs.core.first(seq__12169);
var seq__12169__$1 = cljs.core.next(seq__12169);
var nn = first__12170;
var first__12170__$1 = cljs.core.first(seq__12169__$1);
var seq__12169__$2 = cljs.core.next(seq__12169__$1);
var np = first__12170__$1;
var nc = seq__12169__$2;
var node = vec__12168;
if((nn instanceof cljs.core.Keyword)){
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("invalid dom node",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"node","node",581201198),node], null));
}

if((((np == null)) && ((nc == null)))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__12178 = nn;
var G__12179 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__12178,G__12179) : create_fn.call(null,G__12178,G__12179));
})(),cljs.core.List.EMPTY], null);
} else {
if(cljs.core.map_QMARK_(np)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(nn,np) : create_fn.call(null,nn,np)),nc], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__12182 = nn;
var G__12183 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__12182,G__12183) : create_fn.call(null,G__12182,G__12183));
})(),cljs.core.conj.cljs$core$IFn$_invoke$arity$2(nc,np)], null);

}
}
});
shadow.dom.make_dom_node = (function shadow$dom$make_dom_node(structure){
var vec__12198 = shadow.dom.destructure_node(shadow.dom.create_dom_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12198,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12198,(1),null);
var seq__12203_12979 = cljs.core.seq(node_children);
var chunk__12204_12980 = null;
var count__12205_12981 = (0);
var i__12206_12982 = (0);
while(true){
if((i__12206_12982 < count__12205_12981)){
var child_struct_12986 = chunk__12204_12980.cljs$core$IIndexed$_nth$arity$2(null,i__12206_12982);
var children_12988 = shadow.dom.dom_node(child_struct_12986);
if(cljs.core.seq_QMARK_(children_12988)){
var seq__12236_12989 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_12988));
var chunk__12238_12990 = null;
var count__12239_12991 = (0);
var i__12240_12992 = (0);
while(true){
if((i__12240_12992 < count__12239_12991)){
var child_12994 = chunk__12238_12990.cljs$core$IIndexed$_nth$arity$2(null,i__12240_12992);
if(cljs.core.truth_(child_12994)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_12994);


var G__12995 = seq__12236_12989;
var G__12996 = chunk__12238_12990;
var G__12997 = count__12239_12991;
var G__12998 = (i__12240_12992 + (1));
seq__12236_12989 = G__12995;
chunk__12238_12990 = G__12996;
count__12239_12991 = G__12997;
i__12240_12992 = G__12998;
continue;
} else {
var G__13000 = seq__12236_12989;
var G__13001 = chunk__12238_12990;
var G__13002 = count__12239_12991;
var G__13003 = (i__12240_12992 + (1));
seq__12236_12989 = G__13000;
chunk__12238_12990 = G__13001;
count__12239_12991 = G__13002;
i__12240_12992 = G__13003;
continue;
}
} else {
var temp__5804__auto___13004 = cljs.core.seq(seq__12236_12989);
if(temp__5804__auto___13004){
var seq__12236_13007__$1 = temp__5804__auto___13004;
if(cljs.core.chunked_seq_QMARK_(seq__12236_13007__$1)){
var c__5525__auto___13008 = cljs.core.chunk_first(seq__12236_13007__$1);
var G__13010 = cljs.core.chunk_rest(seq__12236_13007__$1);
var G__13011 = c__5525__auto___13008;
var G__13012 = cljs.core.count(c__5525__auto___13008);
var G__13013 = (0);
seq__12236_12989 = G__13010;
chunk__12238_12990 = G__13011;
count__12239_12991 = G__13012;
i__12240_12992 = G__13013;
continue;
} else {
var child_13014 = cljs.core.first(seq__12236_13007__$1);
if(cljs.core.truth_(child_13014)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_13014);


var G__13015 = cljs.core.next(seq__12236_13007__$1);
var G__13016 = null;
var G__13017 = (0);
var G__13018 = (0);
seq__12236_12989 = G__13015;
chunk__12238_12990 = G__13016;
count__12239_12991 = G__13017;
i__12240_12992 = G__13018;
continue;
} else {
var G__13019 = cljs.core.next(seq__12236_13007__$1);
var G__13020 = null;
var G__13021 = (0);
var G__13022 = (0);
seq__12236_12989 = G__13019;
chunk__12238_12990 = G__13020;
count__12239_12991 = G__13021;
i__12240_12992 = G__13022;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_12988);
}


var G__13026 = seq__12203_12979;
var G__13027 = chunk__12204_12980;
var G__13028 = count__12205_12981;
var G__13029 = (i__12206_12982 + (1));
seq__12203_12979 = G__13026;
chunk__12204_12980 = G__13027;
count__12205_12981 = G__13028;
i__12206_12982 = G__13029;
continue;
} else {
var temp__5804__auto___13030 = cljs.core.seq(seq__12203_12979);
if(temp__5804__auto___13030){
var seq__12203_13031__$1 = temp__5804__auto___13030;
if(cljs.core.chunked_seq_QMARK_(seq__12203_13031__$1)){
var c__5525__auto___13032 = cljs.core.chunk_first(seq__12203_13031__$1);
var G__13033 = cljs.core.chunk_rest(seq__12203_13031__$1);
var G__13034 = c__5525__auto___13032;
var G__13035 = cljs.core.count(c__5525__auto___13032);
var G__13036 = (0);
seq__12203_12979 = G__13033;
chunk__12204_12980 = G__13034;
count__12205_12981 = G__13035;
i__12206_12982 = G__13036;
continue;
} else {
var child_struct_13037 = cljs.core.first(seq__12203_13031__$1);
var children_13040 = shadow.dom.dom_node(child_struct_13037);
if(cljs.core.seq_QMARK_(children_13040)){
var seq__12271_13042 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_13040));
var chunk__12273_13043 = null;
var count__12274_13044 = (0);
var i__12275_13045 = (0);
while(true){
if((i__12275_13045 < count__12274_13044)){
var child_13049 = chunk__12273_13043.cljs$core$IIndexed$_nth$arity$2(null,i__12275_13045);
if(cljs.core.truth_(child_13049)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_13049);


var G__13050 = seq__12271_13042;
var G__13051 = chunk__12273_13043;
var G__13052 = count__12274_13044;
var G__13053 = (i__12275_13045 + (1));
seq__12271_13042 = G__13050;
chunk__12273_13043 = G__13051;
count__12274_13044 = G__13052;
i__12275_13045 = G__13053;
continue;
} else {
var G__13054 = seq__12271_13042;
var G__13055 = chunk__12273_13043;
var G__13056 = count__12274_13044;
var G__13057 = (i__12275_13045 + (1));
seq__12271_13042 = G__13054;
chunk__12273_13043 = G__13055;
count__12274_13044 = G__13056;
i__12275_13045 = G__13057;
continue;
}
} else {
var temp__5804__auto___13058__$1 = cljs.core.seq(seq__12271_13042);
if(temp__5804__auto___13058__$1){
var seq__12271_13061__$1 = temp__5804__auto___13058__$1;
if(cljs.core.chunked_seq_QMARK_(seq__12271_13061__$1)){
var c__5525__auto___13062 = cljs.core.chunk_first(seq__12271_13061__$1);
var G__13063 = cljs.core.chunk_rest(seq__12271_13061__$1);
var G__13064 = c__5525__auto___13062;
var G__13065 = cljs.core.count(c__5525__auto___13062);
var G__13066 = (0);
seq__12271_13042 = G__13063;
chunk__12273_13043 = G__13064;
count__12274_13044 = G__13065;
i__12275_13045 = G__13066;
continue;
} else {
var child_13067 = cljs.core.first(seq__12271_13061__$1);
if(cljs.core.truth_(child_13067)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_13067);


var G__13069 = cljs.core.next(seq__12271_13061__$1);
var G__13070 = null;
var G__13071 = (0);
var G__13072 = (0);
seq__12271_13042 = G__13069;
chunk__12273_13043 = G__13070;
count__12274_13044 = G__13071;
i__12275_13045 = G__13072;
continue;
} else {
var G__13074 = cljs.core.next(seq__12271_13061__$1);
var G__13075 = null;
var G__13076 = (0);
var G__13077 = (0);
seq__12271_13042 = G__13074;
chunk__12273_13043 = G__13075;
count__12274_13044 = G__13076;
i__12275_13045 = G__13077;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_13040);
}


var G__13080 = cljs.core.next(seq__12203_13031__$1);
var G__13081 = null;
var G__13082 = (0);
var G__13083 = (0);
seq__12203_12979 = G__13080;
chunk__12204_12980 = G__13081;
count__12205_12981 = G__13082;
i__12206_12982 = G__13083;
continue;
}
} else {
}
}
break;
}

return node;
});
(cljs.core.Keyword.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.Keyword.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$__$1], null));
}));

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_dom,this$__$1);
}));
if(cljs.core.truth_(((typeof HTMLElement) != 'undefined'))){
(HTMLElement.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(HTMLElement.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
if(cljs.core.truth_(((typeof DocumentFragment) != 'undefined'))){
(DocumentFragment.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(DocumentFragment.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
/**
 * clear node children
 */
shadow.dom.reset = (function shadow$dom$reset(node){
return goog.dom.removeChildren(shadow.dom.dom_node(node));
});
shadow.dom.remove = (function shadow$dom$remove(node){
if((((!((node == null))))?(((((node.cljs$lang$protocol_mask$partition0$ & (8388608))) || ((cljs.core.PROTOCOL_SENTINEL === node.cljs$core$ISeqable$))))?true:false):false)){
var seq__12299 = cljs.core.seq(node);
var chunk__12300 = null;
var count__12301 = (0);
var i__12302 = (0);
while(true){
if((i__12302 < count__12301)){
var n = chunk__12300.cljs$core$IIndexed$_nth$arity$2(null,i__12302);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null,n));


var G__13097 = seq__12299;
var G__13098 = chunk__12300;
var G__13099 = count__12301;
var G__13100 = (i__12302 + (1));
seq__12299 = G__13097;
chunk__12300 = G__13098;
count__12301 = G__13099;
i__12302 = G__13100;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__12299);
if(temp__5804__auto__){
var seq__12299__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__12299__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__12299__$1);
var G__13102 = cljs.core.chunk_rest(seq__12299__$1);
var G__13103 = c__5525__auto__;
var G__13104 = cljs.core.count(c__5525__auto__);
var G__13105 = (0);
seq__12299 = G__13102;
chunk__12300 = G__13103;
count__12301 = G__13104;
i__12302 = G__13105;
continue;
} else {
var n = cljs.core.first(seq__12299__$1);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null,n));


var G__13107 = cljs.core.next(seq__12299__$1);
var G__13108 = null;
var G__13109 = (0);
var G__13110 = (0);
seq__12299 = G__13107;
chunk__12300 = G__13108;
count__12301 = G__13109;
i__12302 = G__13110;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return goog.dom.removeNode(node);
}
});
shadow.dom.replace_node = (function shadow$dom$replace_node(old,new$){
return goog.dom.replaceNode(shadow.dom.dom_node(new$),shadow.dom.dom_node(old));
});
shadow.dom.text = (function shadow$dom$text(var_args){
var G__12319 = arguments.length;
switch (G__12319) {
case 2:
return shadow.dom.text.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.text.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

}
});

(shadow.dom.text.cljs$core$IFn$_invoke$arity$2 = (function (el,new_text){
return (shadow.dom.dom_node(el).innerText = new_text);
}));

(shadow.dom.text.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.dom_node(el).innerText;
}));

(shadow.dom.text.cljs$lang$maxFixedArity = 2);

shadow.dom.check = (function shadow$dom$check(var_args){
var G__12324 = arguments.length;
switch (G__12324) {
case 1:
return shadow.dom.check.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.check.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.check.cljs$core$IFn$_invoke$arity$2(el,true);
}));

(shadow.dom.check.cljs$core$IFn$_invoke$arity$2 = (function (el,checked){
return (shadow.dom.dom_node(el).checked = checked);
}));

(shadow.dom.check.cljs$lang$maxFixedArity = 2);

shadow.dom.checked_QMARK_ = (function shadow$dom$checked_QMARK_(el){
return shadow.dom.dom_node(el).checked;
});
shadow.dom.form_elements = (function shadow$dom$form_elements(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).elements));
});
shadow.dom.children = (function shadow$dom$children(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).children));
});
shadow.dom.child_nodes = (function shadow$dom$child_nodes(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).childNodes));
});
shadow.dom.attr = (function shadow$dom$attr(var_args){
var G__12336 = arguments.length;
switch (G__12336) {
case 2:
return shadow.dom.attr.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$2 = (function (el,key){
return shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
}));

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$3 = (function (el,key,default$){
var or__5002__auto__ = shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return default$;
}
}));

(shadow.dom.attr.cljs$lang$maxFixedArity = 3);

shadow.dom.del_attr = (function shadow$dom$del_attr(el,key){
return shadow.dom.dom_node(el).removeAttribute(cljs.core.name(key));
});
shadow.dom.data = (function shadow$dom$data(el,key){
return shadow.dom.dom_node(el).getAttribute(["data-",cljs.core.name(key)].join(''));
});
shadow.dom.set_data = (function shadow$dom$set_data(el,key,value){
return shadow.dom.dom_node(el).setAttribute(["data-",cljs.core.name(key)].join(''),cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));
});
shadow.dom.set_html = (function shadow$dom$set_html(node,text){
return (shadow.dom.dom_node(node).innerHTML = text);
});
shadow.dom.get_html = (function shadow$dom$get_html(node){
return shadow.dom.dom_node(node).innerHTML;
});
shadow.dom.fragment = (function shadow$dom$fragment(var_args){
var args__5732__auto__ = [];
var len__5726__auto___13129 = arguments.length;
var i__5727__auto___13130 = (0);
while(true){
if((i__5727__auto___13130 < len__5726__auto___13129)){
args__5732__auto__.push((arguments[i__5727__auto___13130]));

var G__13131 = (i__5727__auto___13130 + (1));
i__5727__auto___13130 = G__13131;
continue;
} else {
}
break;
}

var argseq__5733__auto__ = ((((0) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((0)),(0),null)):null);
return shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic(argseq__5733__auto__);
});

(shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic = (function (nodes){
var fragment = document.createDocumentFragment();
var seq__12356_13133 = cljs.core.seq(nodes);
var chunk__12357_13134 = null;
var count__12358_13135 = (0);
var i__12359_13136 = (0);
while(true){
if((i__12359_13136 < count__12358_13135)){
var node_13139 = chunk__12357_13134.cljs$core$IIndexed$_nth$arity$2(null,i__12359_13136);
fragment.appendChild(shadow.dom._to_dom(node_13139));


var G__13141 = seq__12356_13133;
var G__13142 = chunk__12357_13134;
var G__13143 = count__12358_13135;
var G__13144 = (i__12359_13136 + (1));
seq__12356_13133 = G__13141;
chunk__12357_13134 = G__13142;
count__12358_13135 = G__13143;
i__12359_13136 = G__13144;
continue;
} else {
var temp__5804__auto___13145 = cljs.core.seq(seq__12356_13133);
if(temp__5804__auto___13145){
var seq__12356_13148__$1 = temp__5804__auto___13145;
if(cljs.core.chunked_seq_QMARK_(seq__12356_13148__$1)){
var c__5525__auto___13149 = cljs.core.chunk_first(seq__12356_13148__$1);
var G__13150 = cljs.core.chunk_rest(seq__12356_13148__$1);
var G__13151 = c__5525__auto___13149;
var G__13152 = cljs.core.count(c__5525__auto___13149);
var G__13153 = (0);
seq__12356_13133 = G__13150;
chunk__12357_13134 = G__13151;
count__12358_13135 = G__13152;
i__12359_13136 = G__13153;
continue;
} else {
var node_13154 = cljs.core.first(seq__12356_13148__$1);
fragment.appendChild(shadow.dom._to_dom(node_13154));


var G__13155 = cljs.core.next(seq__12356_13148__$1);
var G__13156 = null;
var G__13157 = (0);
var G__13158 = (0);
seq__12356_13133 = G__13155;
chunk__12357_13134 = G__13156;
count__12358_13135 = G__13157;
i__12359_13136 = G__13158;
continue;
}
} else {
}
}
break;
}

return (new shadow.dom.NativeColl(fragment));
}));

(shadow.dom.fragment.cljs$lang$maxFixedArity = (0));

/** @this {Function} */
(shadow.dom.fragment.cljs$lang$applyTo = (function (seq12350){
var self__5712__auto__ = this;
return self__5712__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq12350));
}));

/**
 * given a html string, eval all <script> tags and return the html without the scripts
 * don't do this for everything, only content you trust.
 */
shadow.dom.eval_scripts = (function shadow$dom$eval_scripts(s){
var scripts = cljs.core.re_seq(/<script[^>]*?>(.+?)<\/script>/,s);
var seq__12366_13162 = cljs.core.seq(scripts);
var chunk__12367_13163 = null;
var count__12368_13164 = (0);
var i__12369_13165 = (0);
while(true){
if((i__12369_13165 < count__12368_13164)){
var vec__12386_13167 = chunk__12367_13163.cljs$core$IIndexed$_nth$arity$2(null,i__12369_13165);
var script_tag_13168 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12386_13167,(0),null);
var script_body_13169 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12386_13167,(1),null);
eval(script_body_13169);


var G__13171 = seq__12366_13162;
var G__13172 = chunk__12367_13163;
var G__13173 = count__12368_13164;
var G__13174 = (i__12369_13165 + (1));
seq__12366_13162 = G__13171;
chunk__12367_13163 = G__13172;
count__12368_13164 = G__13173;
i__12369_13165 = G__13174;
continue;
} else {
var temp__5804__auto___13175 = cljs.core.seq(seq__12366_13162);
if(temp__5804__auto___13175){
var seq__12366_13176__$1 = temp__5804__auto___13175;
if(cljs.core.chunked_seq_QMARK_(seq__12366_13176__$1)){
var c__5525__auto___13178 = cljs.core.chunk_first(seq__12366_13176__$1);
var G__13179 = cljs.core.chunk_rest(seq__12366_13176__$1);
var G__13180 = c__5525__auto___13178;
var G__13181 = cljs.core.count(c__5525__auto___13178);
var G__13182 = (0);
seq__12366_13162 = G__13179;
chunk__12367_13163 = G__13180;
count__12368_13164 = G__13181;
i__12369_13165 = G__13182;
continue;
} else {
var vec__12390_13183 = cljs.core.first(seq__12366_13176__$1);
var script_tag_13184 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12390_13183,(0),null);
var script_body_13185 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12390_13183,(1),null);
eval(script_body_13185);


var G__13190 = cljs.core.next(seq__12366_13176__$1);
var G__13191 = null;
var G__13192 = (0);
var G__13193 = (0);
seq__12366_13162 = G__13190;
chunk__12367_13163 = G__13191;
count__12368_13164 = G__13192;
i__12369_13165 = G__13193;
continue;
}
} else {
}
}
break;
}

return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (s__$1,p__12396){
var vec__12397 = p__12396;
var script_tag = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12397,(0),null);
var script_body = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12397,(1),null);
return clojure.string.replace(s__$1,script_tag,"");
}),s,scripts);
});
shadow.dom.str__GT_fragment = (function shadow$dom$str__GT_fragment(s){
var el = document.createElement("div");
(el.innerHTML = s);

return (new shadow.dom.NativeColl(goog.dom.childrenToNode_(document,el)));
});
shadow.dom.node_name = (function shadow$dom$node_name(el){
return shadow.dom.dom_node(el).nodeName;
});
shadow.dom.ancestor_by_class = (function shadow$dom$ancestor_by_class(el,cls){
return goog.dom.getAncestorByClass(shadow.dom.dom_node(el),cls);
});
shadow.dom.ancestor_by_tag = (function shadow$dom$ancestor_by_tag(var_args){
var G__12408 = arguments.length;
switch (G__12408) {
case 2:
return shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2 = (function (el,tag){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag));
}));

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$3 = (function (el,tag,cls){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag),cljs.core.name(cls));
}));

(shadow.dom.ancestor_by_tag.cljs$lang$maxFixedArity = 3);

shadow.dom.get_value = (function shadow$dom$get_value(dom){
return goog.dom.forms.getValue(shadow.dom.dom_node(dom));
});
shadow.dom.set_value = (function shadow$dom$set_value(dom,value){
return goog.dom.forms.setValue(shadow.dom.dom_node(dom),value);
});
shadow.dom.px = (function shadow$dom$px(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((value | (0))),"px"].join('');
});
shadow.dom.pct = (function shadow$dom$pct(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(value),"%"].join('');
});
shadow.dom.remove_style_STAR_ = (function shadow$dom$remove_style_STAR_(el,style){
return el.style.removeProperty(cljs.core.name(style));
});
shadow.dom.remove_style = (function shadow$dom$remove_style(el,style){
var el__$1 = shadow.dom.dom_node(el);
return shadow.dom.remove_style_STAR_(el__$1,style);
});
shadow.dom.remove_styles = (function shadow$dom$remove_styles(el,style_keys){
var el__$1 = shadow.dom.dom_node(el);
var seq__12424 = cljs.core.seq(style_keys);
var chunk__12425 = null;
var count__12426 = (0);
var i__12427 = (0);
while(true){
if((i__12427 < count__12426)){
var it = chunk__12425.cljs$core$IIndexed$_nth$arity$2(null,i__12427);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__13216 = seq__12424;
var G__13217 = chunk__12425;
var G__13218 = count__12426;
var G__13219 = (i__12427 + (1));
seq__12424 = G__13216;
chunk__12425 = G__13217;
count__12426 = G__13218;
i__12427 = G__13219;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__12424);
if(temp__5804__auto__){
var seq__12424__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__12424__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__12424__$1);
var G__13227 = cljs.core.chunk_rest(seq__12424__$1);
var G__13228 = c__5525__auto__;
var G__13229 = cljs.core.count(c__5525__auto__);
var G__13230 = (0);
seq__12424 = G__13227;
chunk__12425 = G__13228;
count__12426 = G__13229;
i__12427 = G__13230;
continue;
} else {
var it = cljs.core.first(seq__12424__$1);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__13232 = cljs.core.next(seq__12424__$1);
var G__13233 = null;
var G__13234 = (0);
var G__13235 = (0);
seq__12424 = G__13232;
chunk__12425 = G__13233;
count__12426 = G__13234;
i__12427 = G__13235;
continue;
}
} else {
return null;
}
}
break;
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Coordinate = (function (x,y,__meta,__extmap,__hash){
this.x = x;
this.y = y;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5300__auto__,k__5301__auto__){
var self__ = this;
var this__5300__auto____$1 = this;
return this__5300__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__5301__auto__,null);
}));

(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5302__auto__,k12441,else__5303__auto__){
var self__ = this;
var this__5302__auto____$1 = this;
var G__12457 = k12441;
var G__12457__$1 = (((G__12457 instanceof cljs.core.Keyword))?G__12457.fqn:null);
switch (G__12457__$1) {
case "x":
return self__.x;

break;
case "y":
return self__.y;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k12441,else__5303__auto__);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5320__auto__,f__5321__auto__,init__5322__auto__){
var self__ = this;
var this__5320__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5323__auto__,p__12459){
var vec__12460 = p__12459;
var k__5324__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12460,(0),null);
var v__5325__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12460,(1),null);
return (f__5321__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5321__auto__.cljs$core$IFn$_invoke$arity$3(ret__5323__auto__,k__5324__auto__,v__5325__auto__) : f__5321__auto__.call(null,ret__5323__auto__,k__5324__auto__,v__5325__auto__));
}),init__5322__auto__,this__5320__auto____$1);
}));

(shadow.dom.Coordinate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5315__auto__,writer__5316__auto__,opts__5317__auto__){
var self__ = this;
var this__5315__auto____$1 = this;
var pr_pair__5318__auto__ = (function (keyval__5319__auto__){
return cljs.core.pr_sequential_writer(writer__5316__auto__,cljs.core.pr_writer,""," ","",opts__5317__auto__,keyval__5319__auto__);
});
return cljs.core.pr_sequential_writer(writer__5316__auto__,pr_pair__5318__auto__,"#shadow.dom.Coordinate{",", ","}",opts__5317__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"x","x",2099068185),self__.x],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"y","y",-1757859776),self__.y],null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__12440){
var self__ = this;
var G__12440__$1 = this;
return (new cljs.core.RecordIter((0),G__12440__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5298__auto__){
var self__ = this;
var this__5298__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5295__auto__){
var self__ = this;
var this__5295__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5304__auto__){
var self__ = this;
var this__5304__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5296__auto__){
var self__ = this;
var this__5296__auto____$1 = this;
var h__5111__auto__ = self__.__hash;
if((!((h__5111__auto__ == null)))){
return h__5111__auto__;
} else {
var h__5111__auto____$1 = (function (coll__5297__auto__){
return (145542109 ^ cljs.core.hash_unordered_coll(coll__5297__auto__));
})(this__5296__auto____$1);
(self__.__hash = h__5111__auto____$1);

return h__5111__auto____$1;
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this12442,other12443){
var self__ = this;
var this12442__$1 = this;
return (((!((other12443 == null)))) && ((((this12442__$1.constructor === other12443.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12442__$1.x,other12443.x)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12442__$1.y,other12443.y)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12442__$1.__extmap,other12443.__extmap)))))))));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5310__auto__,k__5311__auto__){
var self__ = this;
var this__5310__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"y","y",-1757859776),null,new cljs.core.Keyword(null,"x","x",2099068185),null], null), null),k__5311__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5310__auto____$1),self__.__meta),k__5311__auto__);
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5311__auto__)),null));
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5307__auto__,k12441){
var self__ = this;
var this__5307__auto____$1 = this;
var G__12495 = k12441;
var G__12495__$1 = (((G__12495 instanceof cljs.core.Keyword))?G__12495.fqn:null);
switch (G__12495__$1) {
case "x":
case "y":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k12441);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5308__auto__,k__5309__auto__,G__12440){
var self__ = this;
var this__5308__auto____$1 = this;
var pred__12508 = cljs.core.keyword_identical_QMARK_;
var expr__12509 = k__5309__auto__;
if(cljs.core.truth_((pred__12508.cljs$core$IFn$_invoke$arity$2 ? pred__12508.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"x","x",2099068185),expr__12509) : pred__12508.call(null,new cljs.core.Keyword(null,"x","x",2099068185),expr__12509)))){
return (new shadow.dom.Coordinate(G__12440,self__.y,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__12508.cljs$core$IFn$_invoke$arity$2 ? pred__12508.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"y","y",-1757859776),expr__12509) : pred__12508.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),expr__12509)))){
return (new shadow.dom.Coordinate(self__.x,G__12440,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5309__auto__,G__12440),null));
}
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5313__auto__){
var self__ = this;
var this__5313__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"x","x",2099068185),self__.x,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"y","y",-1757859776),self__.y,null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5299__auto__,G__12440){
var self__ = this;
var this__5299__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,G__12440,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5305__auto__,entry__5306__auto__){
var self__ = this;
var this__5305__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5306__auto__)){
return this__5305__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__5306__auto__,(0)),cljs.core._nth(entry__5306__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5305__auto____$1,entry__5306__auto__);
}
}));

(shadow.dom.Coordinate.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"x","x",-555367584,null),new cljs.core.Symbol(null,"y","y",-117328249,null)], null);
}));

(shadow.dom.Coordinate.cljs$lang$type = true);

(shadow.dom.Coordinate.cljs$lang$ctorPrSeq = (function (this__5346__auto__){
return (new cljs.core.List(null,"shadow.dom/Coordinate",null,(1),null));
}));

(shadow.dom.Coordinate.cljs$lang$ctorPrWriter = (function (this__5346__auto__,writer__5347__auto__){
return cljs.core._write(writer__5347__auto__,"shadow.dom/Coordinate");
}));

/**
 * Positional factory function for shadow.dom/Coordinate.
 */
shadow.dom.__GT_Coordinate = (function shadow$dom$__GT_Coordinate(x,y){
return (new shadow.dom.Coordinate(x,y,null,null,null));
});

/**
 * Factory function for shadow.dom/Coordinate, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Coordinate = (function shadow$dom$map__GT_Coordinate(G__12451){
var extmap__5342__auto__ = (function (){var G__12520 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__12451,new cljs.core.Keyword(null,"x","x",2099068185),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"y","y",-1757859776)], 0));
if(cljs.core.record_QMARK_(G__12451)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__12520);
} else {
return G__12520;
}
})();
return (new shadow.dom.Coordinate(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__12451),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__12451),null,cljs.core.not_empty(extmap__5342__auto__),null));
});

shadow.dom.get_position = (function shadow$dom$get_position(el){
var pos = goog.style.getPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_client_position = (function shadow$dom$get_client_position(el){
var pos = goog.style.getClientPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_page_offset = (function shadow$dom$get_page_offset(el){
var pos = goog.style.getPageOffset(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Size = (function (w,h,__meta,__extmap,__hash){
this.w = w;
this.h = h;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5300__auto__,k__5301__auto__){
var self__ = this;
var this__5300__auto____$1 = this;
return this__5300__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__5301__auto__,null);
}));

(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5302__auto__,k12528,else__5303__auto__){
var self__ = this;
var this__5302__auto____$1 = this;
var G__12540 = k12528;
var G__12540__$1 = (((G__12540 instanceof cljs.core.Keyword))?G__12540.fqn:null);
switch (G__12540__$1) {
case "w":
return self__.w;

break;
case "h":
return self__.h;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k12528,else__5303__auto__);

}
}));

(shadow.dom.Size.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5320__auto__,f__5321__auto__,init__5322__auto__){
var self__ = this;
var this__5320__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5323__auto__,p__12544){
var vec__12545 = p__12544;
var k__5324__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12545,(0),null);
var v__5325__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12545,(1),null);
return (f__5321__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5321__auto__.cljs$core$IFn$_invoke$arity$3(ret__5323__auto__,k__5324__auto__,v__5325__auto__) : f__5321__auto__.call(null,ret__5323__auto__,k__5324__auto__,v__5325__auto__));
}),init__5322__auto__,this__5320__auto____$1);
}));

(shadow.dom.Size.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5315__auto__,writer__5316__auto__,opts__5317__auto__){
var self__ = this;
var this__5315__auto____$1 = this;
var pr_pair__5318__auto__ = (function (keyval__5319__auto__){
return cljs.core.pr_sequential_writer(writer__5316__auto__,cljs.core.pr_writer,""," ","",opts__5317__auto__,keyval__5319__auto__);
});
return cljs.core.pr_sequential_writer(writer__5316__auto__,pr_pair__5318__auto__,"#shadow.dom.Size{",", ","}",opts__5317__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"w","w",354169001),self__.w],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"h","h",1109658740),self__.h],null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__12527){
var self__ = this;
var G__12527__$1 = this;
return (new cljs.core.RecordIter((0),G__12527__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"w","w",354169001),new cljs.core.Keyword(null,"h","h",1109658740)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Size.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5298__auto__){
var self__ = this;
var this__5298__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Size.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5295__auto__){
var self__ = this;
var this__5295__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5304__auto__){
var self__ = this;
var this__5304__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5296__auto__){
var self__ = this;
var this__5296__auto____$1 = this;
var h__5111__auto__ = self__.__hash;
if((!((h__5111__auto__ == null)))){
return h__5111__auto__;
} else {
var h__5111__auto____$1 = (function (coll__5297__auto__){
return (-1228019642 ^ cljs.core.hash_unordered_coll(coll__5297__auto__));
})(this__5296__auto____$1);
(self__.__hash = h__5111__auto____$1);

return h__5111__auto____$1;
}
}));

(shadow.dom.Size.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this12529,other12530){
var self__ = this;
var this12529__$1 = this;
return (((!((other12530 == null)))) && ((((this12529__$1.constructor === other12530.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12529__$1.w,other12530.w)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12529__$1.h,other12530.h)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this12529__$1.__extmap,other12530.__extmap)))))))));
}));

(shadow.dom.Size.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5310__auto__,k__5311__auto__){
var self__ = this;
var this__5310__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),null,new cljs.core.Keyword(null,"h","h",1109658740),null], null), null),k__5311__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5310__auto____$1),self__.__meta),k__5311__auto__);
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5311__auto__)),null));
}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5307__auto__,k12528){
var self__ = this;
var this__5307__auto____$1 = this;
var G__12563 = k12528;
var G__12563__$1 = (((G__12563 instanceof cljs.core.Keyword))?G__12563.fqn:null);
switch (G__12563__$1) {
case "w":
case "h":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k12528);

}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5308__auto__,k__5309__auto__,G__12527){
var self__ = this;
var this__5308__auto____$1 = this;
var pred__12564 = cljs.core.keyword_identical_QMARK_;
var expr__12565 = k__5309__auto__;
if(cljs.core.truth_((pred__12564.cljs$core$IFn$_invoke$arity$2 ? pred__12564.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"w","w",354169001),expr__12565) : pred__12564.call(null,new cljs.core.Keyword(null,"w","w",354169001),expr__12565)))){
return (new shadow.dom.Size(G__12527,self__.h,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__12564.cljs$core$IFn$_invoke$arity$2 ? pred__12564.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"h","h",1109658740),expr__12565) : pred__12564.call(null,new cljs.core.Keyword(null,"h","h",1109658740),expr__12565)))){
return (new shadow.dom.Size(self__.w,G__12527,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5309__auto__,G__12527),null));
}
}
}));

(shadow.dom.Size.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5313__auto__){
var self__ = this;
var this__5313__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"w","w",354169001),self__.w,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"h","h",1109658740),self__.h,null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5299__auto__,G__12527){
var self__ = this;
var this__5299__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,G__12527,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5305__auto__,entry__5306__auto__){
var self__ = this;
var this__5305__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5306__auto__)){
return this__5305__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__5306__auto__,(0)),cljs.core._nth(entry__5306__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5305__auto____$1,entry__5306__auto__);
}
}));

(shadow.dom.Size.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"w","w",1994700528,null),new cljs.core.Symbol(null,"h","h",-1544777029,null)], null);
}));

(shadow.dom.Size.cljs$lang$type = true);

(shadow.dom.Size.cljs$lang$ctorPrSeq = (function (this__5346__auto__){
return (new cljs.core.List(null,"shadow.dom/Size",null,(1),null));
}));

(shadow.dom.Size.cljs$lang$ctorPrWriter = (function (this__5346__auto__,writer__5347__auto__){
return cljs.core._write(writer__5347__auto__,"shadow.dom/Size");
}));

/**
 * Positional factory function for shadow.dom/Size.
 */
shadow.dom.__GT_Size = (function shadow$dom$__GT_Size(w,h){
return (new shadow.dom.Size(w,h,null,null,null));
});

/**
 * Factory function for shadow.dom/Size, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Size = (function shadow$dom$map__GT_Size(G__12532){
var extmap__5342__auto__ = (function (){var G__12571 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__12532,new cljs.core.Keyword(null,"w","w",354169001),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"h","h",1109658740)], 0));
if(cljs.core.record_QMARK_(G__12532)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__12571);
} else {
return G__12571;
}
})();
return (new shadow.dom.Size(new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__12532),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__12532),null,cljs.core.not_empty(extmap__5342__auto__),null));
});

shadow.dom.size__GT_clj = (function shadow$dom$size__GT_clj(size){
return (new shadow.dom.Size(size.width,size.height,null,null,null));
});
shadow.dom.get_size = (function shadow$dom$get_size(el){
return shadow.dom.size__GT_clj(goog.style.getSize(shadow.dom.dom_node(el)));
});
shadow.dom.get_height = (function shadow$dom$get_height(el){
return shadow.dom.get_size(el).h;
});
shadow.dom.get_viewport_size = (function shadow$dom$get_viewport_size(){
return shadow.dom.size__GT_clj(goog.dom.getViewportSize());
});
shadow.dom.first_child = (function shadow$dom$first_child(el){
return (shadow.dom.dom_node(el).children[(0)]);
});
shadow.dom.select_option_values = (function shadow$dom$select_option_values(el){
var native$ = shadow.dom.dom_node(el);
var opts = (native$["options"]);
var a__5590__auto__ = opts;
var l__5591__auto__ = a__5590__auto__.length;
var i = (0);
var ret = cljs.core.PersistentVector.EMPTY;
while(true){
if((i < l__5591__auto__)){
var G__13337 = (i + (1));
var G__13338 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(ret,(opts[i]["value"]));
i = G__13337;
ret = G__13338;
continue;
} else {
return ret;
}
break;
}
});
shadow.dom.build_url = (function shadow$dom$build_url(path,query_params){
if(cljs.core.empty_QMARK_(query_params)){
return path;
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(path),"?",clojure.string.join.cljs$core$IFn$_invoke$arity$2("&",cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p__12599){
var vec__12600 = p__12599;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12600,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12600,(1),null);
return [cljs.core.name(k),"=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(encodeURIComponent(cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)))].join('');
}),query_params))].join('');
}
});
shadow.dom.redirect = (function shadow$dom$redirect(var_args){
var G__12612 = arguments.length;
switch (G__12612) {
case 1:
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1 = (function (path){
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2(path,cljs.core.PersistentArrayMap.EMPTY);
}));

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2 = (function (path,query_params){
return (document["location"]["href"] = shadow.dom.build_url(path,query_params));
}));

(shadow.dom.redirect.cljs$lang$maxFixedArity = 2);

shadow.dom.reload_BANG_ = (function shadow$dom$reload_BANG_(){
return (document.location.href = document.location.href);
});
shadow.dom.tag_name = (function shadow$dom$tag_name(el){
var dom = shadow.dom.dom_node(el);
return dom.tagName;
});
shadow.dom.insert_after = (function shadow$dom$insert_after(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingAfter(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_before = (function shadow$dom$insert_before(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingBefore(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_first = (function shadow$dom$insert_first(ref,new$){
var temp__5802__auto__ = shadow.dom.dom_node(ref).firstChild;
if(cljs.core.truth_(temp__5802__auto__)){
var child = temp__5802__auto__;
return shadow.dom.insert_before(child,new$);
} else {
return shadow.dom.append.cljs$core$IFn$_invoke$arity$2(ref,new$);
}
});
shadow.dom.index_of = (function shadow$dom$index_of(el){
var el__$1 = shadow.dom.dom_node(el);
var i = (0);
while(true){
var ps = el__$1.previousSibling;
if((ps == null)){
return i;
} else {
var G__13344 = ps;
var G__13345 = (i + (1));
el__$1 = G__13344;
i = G__13345;
continue;
}
break;
}
});
shadow.dom.get_parent = (function shadow$dom$get_parent(el){
return goog.dom.getParentElement(shadow.dom.dom_node(el));
});
shadow.dom.parents = (function shadow$dom$parents(el){
var parent = shadow.dom.get_parent(el);
if(cljs.core.truth_(parent)){
return cljs.core.cons(parent,(new cljs.core.LazySeq(null,(function (){
return (shadow.dom.parents.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.parents.cljs$core$IFn$_invoke$arity$1(parent) : shadow.dom.parents.call(null,parent));
}),null,null)));
} else {
return null;
}
});
shadow.dom.matches = (function shadow$dom$matches(el,sel){
return shadow.dom.dom_node(el).matches(sel);
});
shadow.dom.get_next_sibling = (function shadow$dom$get_next_sibling(el){
return goog.dom.getNextElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.get_previous_sibling = (function shadow$dom$get_previous_sibling(el){
return goog.dom.getPreviousElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.xmlns = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, ["svg","http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"], null));
shadow.dom.create_svg_node = (function shadow$dom$create_svg_node(tag_def,props){
var vec__12650 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12650,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12650,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12650,(2),null);
var el = document.createElementNS("http://www.w3.org/2000/svg",tag_name);
if(cljs.core.truth_(tag_id)){
el.setAttribute("id",tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
el.setAttribute("class",shadow.dom.merge_class_string(new cljs.core.Keyword(null,"class","class",-2030961996).cljs$core$IFn$_invoke$arity$1(props),tag_classes));
} else {
}

var seq__12654_13354 = cljs.core.seq(props);
var chunk__12655_13355 = null;
var count__12656_13356 = (0);
var i__12657_13357 = (0);
while(true){
if((i__12657_13357 < count__12656_13356)){
var vec__12678_13358 = chunk__12655_13355.cljs$core$IIndexed$_nth$arity$2(null,i__12657_13357);
var k_13359 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12678_13358,(0),null);
var v_13360 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12678_13358,(1),null);
el.setAttributeNS((function (){var temp__5804__auto__ = cljs.core.namespace(k_13359);
if(cljs.core.truth_(temp__5804__auto__)){
var ns = temp__5804__auto__;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_13359),v_13360);


var G__13362 = seq__12654_13354;
var G__13363 = chunk__12655_13355;
var G__13364 = count__12656_13356;
var G__13365 = (i__12657_13357 + (1));
seq__12654_13354 = G__13362;
chunk__12655_13355 = G__13363;
count__12656_13356 = G__13364;
i__12657_13357 = G__13365;
continue;
} else {
var temp__5804__auto___13366 = cljs.core.seq(seq__12654_13354);
if(temp__5804__auto___13366){
var seq__12654_13368__$1 = temp__5804__auto___13366;
if(cljs.core.chunked_seq_QMARK_(seq__12654_13368__$1)){
var c__5525__auto___13369 = cljs.core.chunk_first(seq__12654_13368__$1);
var G__13370 = cljs.core.chunk_rest(seq__12654_13368__$1);
var G__13371 = c__5525__auto___13369;
var G__13372 = cljs.core.count(c__5525__auto___13369);
var G__13373 = (0);
seq__12654_13354 = G__13370;
chunk__12655_13355 = G__13371;
count__12656_13356 = G__13372;
i__12657_13357 = G__13373;
continue;
} else {
var vec__12684_13374 = cljs.core.first(seq__12654_13368__$1);
var k_13375 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12684_13374,(0),null);
var v_13376 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12684_13374,(1),null);
el.setAttributeNS((function (){var temp__5804__auto____$1 = cljs.core.namespace(k_13375);
if(cljs.core.truth_(temp__5804__auto____$1)){
var ns = temp__5804__auto____$1;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_13375),v_13376);


var G__13383 = cljs.core.next(seq__12654_13368__$1);
var G__13384 = null;
var G__13385 = (0);
var G__13386 = (0);
seq__12654_13354 = G__13383;
chunk__12655_13355 = G__13384;
count__12656_13356 = G__13385;
i__12657_13357 = G__13386;
continue;
}
} else {
}
}
break;
}

return el;
});
shadow.dom.svg_node = (function shadow$dom$svg_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$SVGElement$))))?true:false):false)){
return el.shadow$dom$SVGElement$_to_svg$arity$1(null);
} else {
return el;

}
}
});
shadow.dom.make_svg_node = (function shadow$dom$make_svg_node(structure){
var vec__12702 = shadow.dom.destructure_node(shadow.dom.create_svg_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12702,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__12702,(1),null);
var seq__12705_13390 = cljs.core.seq(node_children);
var chunk__12707_13391 = null;
var count__12708_13392 = (0);
var i__12709_13393 = (0);
while(true){
if((i__12709_13393 < count__12708_13392)){
var child_struct_13394 = chunk__12707_13391.cljs$core$IIndexed$_nth$arity$2(null,i__12709_13393);
if((!((child_struct_13394 == null)))){
if(typeof child_struct_13394 === 'string'){
var text_13395 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_13395),child_struct_13394].join(''));
} else {
var children_13396 = shadow.dom.svg_node(child_struct_13394);
if(cljs.core.seq_QMARK_(children_13396)){
var seq__12750_13397 = cljs.core.seq(children_13396);
var chunk__12752_13398 = null;
var count__12753_13399 = (0);
var i__12754_13400 = (0);
while(true){
if((i__12754_13400 < count__12753_13399)){
var child_13401 = chunk__12752_13398.cljs$core$IIndexed$_nth$arity$2(null,i__12754_13400);
if(cljs.core.truth_(child_13401)){
node.appendChild(child_13401);


var G__13403 = seq__12750_13397;
var G__13404 = chunk__12752_13398;
var G__13405 = count__12753_13399;
var G__13406 = (i__12754_13400 + (1));
seq__12750_13397 = G__13403;
chunk__12752_13398 = G__13404;
count__12753_13399 = G__13405;
i__12754_13400 = G__13406;
continue;
} else {
var G__13407 = seq__12750_13397;
var G__13408 = chunk__12752_13398;
var G__13409 = count__12753_13399;
var G__13410 = (i__12754_13400 + (1));
seq__12750_13397 = G__13407;
chunk__12752_13398 = G__13408;
count__12753_13399 = G__13409;
i__12754_13400 = G__13410;
continue;
}
} else {
var temp__5804__auto___13411 = cljs.core.seq(seq__12750_13397);
if(temp__5804__auto___13411){
var seq__12750_13414__$1 = temp__5804__auto___13411;
if(cljs.core.chunked_seq_QMARK_(seq__12750_13414__$1)){
var c__5525__auto___13415 = cljs.core.chunk_first(seq__12750_13414__$1);
var G__13417 = cljs.core.chunk_rest(seq__12750_13414__$1);
var G__13418 = c__5525__auto___13415;
var G__13419 = cljs.core.count(c__5525__auto___13415);
var G__13420 = (0);
seq__12750_13397 = G__13417;
chunk__12752_13398 = G__13418;
count__12753_13399 = G__13419;
i__12754_13400 = G__13420;
continue;
} else {
var child_13421 = cljs.core.first(seq__12750_13414__$1);
if(cljs.core.truth_(child_13421)){
node.appendChild(child_13421);


var G__13422 = cljs.core.next(seq__12750_13414__$1);
var G__13423 = null;
var G__13424 = (0);
var G__13425 = (0);
seq__12750_13397 = G__13422;
chunk__12752_13398 = G__13423;
count__12753_13399 = G__13424;
i__12754_13400 = G__13425;
continue;
} else {
var G__13427 = cljs.core.next(seq__12750_13414__$1);
var G__13428 = null;
var G__13429 = (0);
var G__13430 = (0);
seq__12750_13397 = G__13427;
chunk__12752_13398 = G__13428;
count__12753_13399 = G__13429;
i__12754_13400 = G__13430;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_13396);
}
}


var G__13432 = seq__12705_13390;
var G__13433 = chunk__12707_13391;
var G__13434 = count__12708_13392;
var G__13435 = (i__12709_13393 + (1));
seq__12705_13390 = G__13432;
chunk__12707_13391 = G__13433;
count__12708_13392 = G__13434;
i__12709_13393 = G__13435;
continue;
} else {
var G__13439 = seq__12705_13390;
var G__13440 = chunk__12707_13391;
var G__13441 = count__12708_13392;
var G__13443 = (i__12709_13393 + (1));
seq__12705_13390 = G__13439;
chunk__12707_13391 = G__13440;
count__12708_13392 = G__13441;
i__12709_13393 = G__13443;
continue;
}
} else {
var temp__5804__auto___13447 = cljs.core.seq(seq__12705_13390);
if(temp__5804__auto___13447){
var seq__12705_13448__$1 = temp__5804__auto___13447;
if(cljs.core.chunked_seq_QMARK_(seq__12705_13448__$1)){
var c__5525__auto___13451 = cljs.core.chunk_first(seq__12705_13448__$1);
var G__13453 = cljs.core.chunk_rest(seq__12705_13448__$1);
var G__13454 = c__5525__auto___13451;
var G__13455 = cljs.core.count(c__5525__auto___13451);
var G__13456 = (0);
seq__12705_13390 = G__13453;
chunk__12707_13391 = G__13454;
count__12708_13392 = G__13455;
i__12709_13393 = G__13456;
continue;
} else {
var child_struct_13457 = cljs.core.first(seq__12705_13448__$1);
if((!((child_struct_13457 == null)))){
if(typeof child_struct_13457 === 'string'){
var text_13458 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_13458),child_struct_13457].join(''));
} else {
var children_13460 = shadow.dom.svg_node(child_struct_13457);
if(cljs.core.seq_QMARK_(children_13460)){
var seq__12768_13461 = cljs.core.seq(children_13460);
var chunk__12770_13462 = null;
var count__12771_13463 = (0);
var i__12772_13464 = (0);
while(true){
if((i__12772_13464 < count__12771_13463)){
var child_13466 = chunk__12770_13462.cljs$core$IIndexed$_nth$arity$2(null,i__12772_13464);
if(cljs.core.truth_(child_13466)){
node.appendChild(child_13466);


var G__13467 = seq__12768_13461;
var G__13468 = chunk__12770_13462;
var G__13469 = count__12771_13463;
var G__13470 = (i__12772_13464 + (1));
seq__12768_13461 = G__13467;
chunk__12770_13462 = G__13468;
count__12771_13463 = G__13469;
i__12772_13464 = G__13470;
continue;
} else {
var G__13471 = seq__12768_13461;
var G__13472 = chunk__12770_13462;
var G__13473 = count__12771_13463;
var G__13474 = (i__12772_13464 + (1));
seq__12768_13461 = G__13471;
chunk__12770_13462 = G__13472;
count__12771_13463 = G__13473;
i__12772_13464 = G__13474;
continue;
}
} else {
var temp__5804__auto___13477__$1 = cljs.core.seq(seq__12768_13461);
if(temp__5804__auto___13477__$1){
var seq__12768_13479__$1 = temp__5804__auto___13477__$1;
if(cljs.core.chunked_seq_QMARK_(seq__12768_13479__$1)){
var c__5525__auto___13480 = cljs.core.chunk_first(seq__12768_13479__$1);
var G__13487 = cljs.core.chunk_rest(seq__12768_13479__$1);
var G__13488 = c__5525__auto___13480;
var G__13489 = cljs.core.count(c__5525__auto___13480);
var G__13490 = (0);
seq__12768_13461 = G__13487;
chunk__12770_13462 = G__13488;
count__12771_13463 = G__13489;
i__12772_13464 = G__13490;
continue;
} else {
var child_13491 = cljs.core.first(seq__12768_13479__$1);
if(cljs.core.truth_(child_13491)){
node.appendChild(child_13491);


var G__13492 = cljs.core.next(seq__12768_13479__$1);
var G__13493 = null;
var G__13494 = (0);
var G__13495 = (0);
seq__12768_13461 = G__13492;
chunk__12770_13462 = G__13493;
count__12771_13463 = G__13494;
i__12772_13464 = G__13495;
continue;
} else {
var G__13498 = cljs.core.next(seq__12768_13479__$1);
var G__13499 = null;
var G__13500 = (0);
var G__13501 = (0);
seq__12768_13461 = G__13498;
chunk__12770_13462 = G__13499;
count__12771_13463 = G__13500;
i__12772_13464 = G__13501;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_13460);
}
}


var G__13502 = cljs.core.next(seq__12705_13448__$1);
var G__13503 = null;
var G__13504 = (0);
var G__13505 = (0);
seq__12705_13390 = G__13502;
chunk__12707_13391 = G__13503;
count__12708_13392 = G__13504;
i__12709_13393 = G__13505;
continue;
} else {
var G__13507 = cljs.core.next(seq__12705_13448__$1);
var G__13508 = null;
var G__13509 = (0);
var G__13510 = (0);
seq__12705_13390 = G__13507;
chunk__12707_13391 = G__13508;
count__12708_13392 = G__13509;
i__12709_13393 = G__13510;
continue;
}
}
} else {
}
}
break;
}

return node;
});
(shadow.dom.SVGElement["string"] = true);

(shadow.dom._to_svg["string"] = (function (this$){
if((this$ instanceof cljs.core.Keyword)){
return shadow.dom.make_svg_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$], null));
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("strings cannot be in svgs",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"this","this",-611633625),this$], null));
}
}));

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_svg_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_svg,this$__$1);
}));

(shadow.dom.SVGElement["null"] = true);

(shadow.dom._to_svg["null"] = (function (_){
return null;
}));
shadow.dom.svg = (function shadow$dom$svg(var_args){
var args__5732__auto__ = [];
var len__5726__auto___13518 = arguments.length;
var i__5727__auto___13519 = (0);
while(true){
if((i__5727__auto___13519 < len__5726__auto___13518)){
args__5732__auto__.push((arguments[i__5727__auto___13519]));

var G__13526 = (i__5727__auto___13519 + (1));
i__5727__auto___13519 = G__13526;
continue;
} else {
}
break;
}

var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});

(shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic = (function (attrs,children){
return shadow.dom._to_svg(cljs.core.vec(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"svg","svg",856789142),attrs], null),children)));
}));

(shadow.dom.svg.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(shadow.dom.svg.cljs$lang$applyTo = (function (seq12784){
var G__12785 = cljs.core.first(seq12784);
var seq12784__$1 = cljs.core.next(seq12784);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__12785,seq12784__$1);
}));


//# sourceMappingURL=shadow.dom.js.map
