import "./cljs_env.js";
goog.provide('sci.impl.core_protocols');
if((typeof sci !== 'undefined') && (typeof sci.impl !== 'undefined') && (typeof sci.impl.core_protocols !== 'undefined') && (typeof sci.impl.core_protocols._deref !== 'undefined')){
} else {
sci.impl.core_protocols._deref = (function (){var method_table__4712__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4713__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4714__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4715__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4716__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),(function (){var fexpr__82480 = cljs.core.get_global_hierarchy;
return (fexpr__82480.cljs$core$IFn$_invoke$arity$0 ? fexpr__82480.cljs$core$IFn$_invoke$arity$0() : fexpr__82480.call(null));
})());
return (new cljs.core.MultiFn(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("sci.impl.core-protocols","-deref"),sci.impl.types.type_impl,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4716__auto__,method_table__4712__auto__,prefer_table__4713__auto__,method_cache__4714__auto__,cached_hierarchy__4715__auto__));
})();
}
sci.impl.core_protocols._deref.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword("sci.impl.protocols","reified","sci.impl.protocols/reified",-2019939396),(function (ref){
var methods$ = sci.impl.types.getMethods(ref);
var fexpr__82481 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-deref","-deref",-283116853,null));
return (fexpr__82481.cljs$core$IFn$_invoke$arity$1 ? fexpr__82481.cljs$core$IFn$_invoke$arity$1(ref) : fexpr__82481.call(null,ref));
}));
sci.impl.core_protocols.ideref_default = sci.impl.core_protocols._deref.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"default","default",-1987822328),(function (ref){
return cljs.core.deref(ref);
}));
sci.impl.core_protocols.deref_STAR_ = (function sci$impl$core_protocols$deref_STAR_(x){
return sci.impl.core_protocols._deref.cljs$core$IFn$_invoke$arity$1(x);
});
sci.impl.core_protocols.cljs_core_ns = sci.impl.vars.__GT_SciNamespace(new cljs.core.Symbol(null,"cljs.core","cljs.core",770546058,null),null);
sci.impl.core_protocols.deref_protocol = sci.impl.vars.new_var.cljs$core$IFn$_invoke$arity$3(new cljs.core.Symbol(null,"cljs.core.IDeref","cljs.core.IDeref",-783543206,null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"protocol","protocol",652470118),cljs.core.IDeref,new cljs.core.Keyword(null,"methods","methods",453930866),cljs.core.PersistentHashSet.createAsIfByAssoc([sci.impl.core_protocols._deref]),new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null));
if((typeof sci !== 'undefined') && (typeof sci.impl !== 'undefined') && (typeof sci.impl.core_protocols !== 'undefined') && (typeof sci.impl.core_protocols._swap_BANG_ !== 'undefined')){
} else {
sci.impl.core_protocols._swap_BANG_ = (function (){var method_table__4712__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4713__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4714__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4715__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4716__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),(function (){var fexpr__82515 = cljs.core.get_global_hierarchy;
return (fexpr__82515.cljs$core$IFn$_invoke$arity$0 ? fexpr__82515.cljs$core$IFn$_invoke$arity$0() : fexpr__82515.call(null));
})());
return (new cljs.core.MultiFn(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("sci.impl.core-protocols","-swap!"),sci.impl.types.type_impl,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4716__auto__,method_table__4712__auto__,prefer_table__4713__auto__,method_cache__4714__auto__,cached_hierarchy__4715__auto__));
})();
}
if((typeof sci !== 'undefined') && (typeof sci.impl !== 'undefined') && (typeof sci.impl.core_protocols !== 'undefined') && (typeof sci.impl.core_protocols._reset_BANG_ !== 'undefined')){
} else {
sci.impl.core_protocols._reset_BANG_ = (function (){var method_table__4712__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4713__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4714__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4715__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4716__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),(function (){var fexpr__82522 = cljs.core.get_global_hierarchy;
return (fexpr__82522.cljs$core$IFn$_invoke$arity$0 ? fexpr__82522.cljs$core$IFn$_invoke$arity$0() : fexpr__82522.call(null));
})());
return (new cljs.core.MultiFn(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("sci.impl.core-protocols","-reset!"),sci.impl.types.type_impl,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4716__auto__,method_table__4712__auto__,prefer_table__4713__auto__,method_cache__4714__auto__,cached_hierarchy__4715__auto__));
})();
}
sci.impl.core_protocols._swap_BANG_.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword("sci.impl.protocols","reified","sci.impl.protocols/reified",-2019939396),(function() {
var G__82645 = null;
var G__82645__2 = (function (ref,f){
var methods$ = sci.impl.types.getMethods(ref);
var fexpr__82526 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-swap!","-swap!",-535359318,null));
return (fexpr__82526.cljs$core$IFn$_invoke$arity$2 ? fexpr__82526.cljs$core$IFn$_invoke$arity$2(ref,f) : fexpr__82526.call(null,ref,f));
});
var G__82645__3 = (function (ref,f,a1){
var methods$ = sci.impl.types.getMethods(ref);
var fexpr__82551 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-swap!","-swap!",-535359318,null));
return (fexpr__82551.cljs$core$IFn$_invoke$arity$3 ? fexpr__82551.cljs$core$IFn$_invoke$arity$3(ref,f,a1) : fexpr__82551.call(null,ref,f,a1));
});
var G__82645__4 = (function (ref,f,a1,a2){
var methods$ = sci.impl.types.getMethods(ref);
var fexpr__82552 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-swap!","-swap!",-535359318,null));
return (fexpr__82552.cljs$core$IFn$_invoke$arity$4 ? fexpr__82552.cljs$core$IFn$_invoke$arity$4(ref,f,a1,a2) : fexpr__82552.call(null,ref,f,a1,a2));
});
var G__82645__5 = (function() { 
var G__82646__delegate = function (ref,f,a1,a2,args){
var methods$ = sci.impl.types.getMethods(ref);
return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-swap!","-swap!",-535359318,null)),ref,f,a1,a2,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([args], 0));
};
var G__82646 = function (ref,f,a1,a2,var_args){
var args = null;
if (arguments.length > 4) {
var G__82647__i = 0, G__82647__a = new Array(arguments.length -  4);
while (G__82647__i < G__82647__a.length) {G__82647__a[G__82647__i] = arguments[G__82647__i + 4]; ++G__82647__i;}
  args = new cljs.core.IndexedSeq(G__82647__a,0,null);
} 
return G__82646__delegate.call(this,ref,f,a1,a2,args);};
G__82646.cljs$lang$maxFixedArity = 4;
G__82646.cljs$lang$applyTo = (function (arglist__82648){
var ref = cljs.core.first(arglist__82648);
arglist__82648 = cljs.core.next(arglist__82648);
var f = cljs.core.first(arglist__82648);
arglist__82648 = cljs.core.next(arglist__82648);
var a1 = cljs.core.first(arglist__82648);
arglist__82648 = cljs.core.next(arglist__82648);
var a2 = cljs.core.first(arglist__82648);
var args = cljs.core.rest(arglist__82648);
return G__82646__delegate(ref,f,a1,a2,args);
});
G__82646.cljs$core$IFn$_invoke$arity$variadic = G__82646__delegate;
return G__82646;
})()
;
G__82645 = function(ref,f,a1,a2,var_args){
var args = var_args;
switch(arguments.length){
case 2:
return G__82645__2.call(this,ref,f);
case 3:
return G__82645__3.call(this,ref,f,a1);
case 4:
return G__82645__4.call(this,ref,f,a1,a2);
default:
var G__82649 = null;
if (arguments.length > 4) {
var G__82650__i = 0, G__82650__a = new Array(arguments.length -  4);
while (G__82650__i < G__82650__a.length) {G__82650__a[G__82650__i] = arguments[G__82650__i + 4]; ++G__82650__i;}
G__82649 = new cljs.core.IndexedSeq(G__82650__a,0,null);
}
return G__82645__5.cljs$core$IFn$_invoke$arity$variadic(ref,f,a1,a2, G__82649);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
G__82645.cljs$lang$maxFixedArity = 4;
G__82645.cljs$lang$applyTo = G__82645__5.cljs$lang$applyTo;
G__82645.cljs$core$IFn$_invoke$arity$2 = G__82645__2;
G__82645.cljs$core$IFn$_invoke$arity$3 = G__82645__3;
G__82645.cljs$core$IFn$_invoke$arity$4 = G__82645__4;
G__82645.cljs$core$IFn$_invoke$arity$variadic = G__82645__5.cljs$core$IFn$_invoke$arity$variadic;
return G__82645;
})()
);
sci.impl.core_protocols._reset_BANG_.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword("sci.impl.protocols","reified","sci.impl.protocols/reified",-2019939396),(function (ref,v){
var methods$ = sci.impl.types.getMethods(ref);
var fexpr__82553 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(methods$,new cljs.core.Symbol(null,"-reset!","-reset!",1965723739,null));
return (fexpr__82553.cljs$core$IFn$_invoke$arity$2 ? fexpr__82553.cljs$core$IFn$_invoke$arity$2(ref,v) : fexpr__82553.call(null,ref,v));
}));
sci.impl.core_protocols.iatom_defaults = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [sci.impl.core_protocols._swap_BANG_.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"default","default",-1987822328),(function() { 
var G__82681__delegate = function (ref,f,args){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$4(cljs.core.swap_BANG_,ref,f,args);
};
var G__82681 = function (ref,f,var_args){
var args = null;
if (arguments.length > 2) {
var G__82682__i = 0, G__82682__a = new Array(arguments.length -  2);
while (G__82682__i < G__82682__a.length) {G__82682__a[G__82682__i] = arguments[G__82682__i + 2]; ++G__82682__i;}
  args = new cljs.core.IndexedSeq(G__82682__a,0,null);
} 
return G__82681__delegate.call(this,ref,f,args);};
G__82681.cljs$lang$maxFixedArity = 2;
G__82681.cljs$lang$applyTo = (function (arglist__82683){
var ref = cljs.core.first(arglist__82683);
arglist__82683 = cljs.core.next(arglist__82683);
var f = cljs.core.first(arglist__82683);
var args = cljs.core.rest(arglist__82683);
return G__82681__delegate(ref,f,args);
});
G__82681.cljs$core$IFn$_invoke$arity$variadic = G__82681__delegate;
return G__82681;
})()
),sci.impl.core_protocols._reset_BANG_.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"default","default",-1987822328),(function (ref,v){
return cljs.core.reset_BANG_(ref,v);
}))], null);
sci.impl.core_protocols.swap_BANG__STAR_ = (function sci$impl$core_protocols$swap_BANG__STAR_(var_args){
var args__4835__auto__ = [];
var len__4829__auto___82684 = arguments.length;
var i__4830__auto___82685 = (0);
while(true){
if((i__4830__auto___82685 < len__4829__auto___82684)){
args__4835__auto__.push((arguments[i__4830__auto___82685]));

var G__82686 = (i__4830__auto___82685 + (1));
i__4830__auto___82685 = G__82686;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((2) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((2)),(0),null)):null);
return sci.impl.core_protocols.swap_BANG__STAR_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4836__auto__);
});

(sci.impl.core_protocols.swap_BANG__STAR_.cljs$core$IFn$_invoke$arity$variadic = (function (ref,f,args){
if(cljs.core.truth_(args)){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$4(sci.impl.core_protocols._swap_BANG_,ref,f,args);
} else {
return sci.impl.core_protocols._swap_BANG_.cljs$core$IFn$_invoke$arity$2(ref,f);
}
}));

(sci.impl.core_protocols.swap_BANG__STAR_.cljs$lang$maxFixedArity = (2));

/** @this {Function} */
(sci.impl.core_protocols.swap_BANG__STAR_.cljs$lang$applyTo = (function (seq82582){
var G__82583 = cljs.core.first(seq82582);
var seq82582__$1 = cljs.core.next(seq82582);
var G__82584 = cljs.core.first(seq82582__$1);
var seq82582__$2 = cljs.core.next(seq82582__$1);
var self__4816__auto__ = this;
return self__4816__auto__.cljs$core$IFn$_invoke$arity$variadic(G__82583,G__82584,seq82582__$2);
}));

sci.impl.core_protocols.reset_BANG__STAR_ = (function sci$impl$core_protocols$reset_BANG__STAR_(ref,v){
return sci.impl.core_protocols._reset_BANG_.cljs$core$IFn$_invoke$arity$2(ref,v);
});
sci.impl.core_protocols.swap_protocol = sci.impl.vars.new_var.cljs$core$IFn$_invoke$arity$3(new cljs.core.Symbol(null,"cljs.core.ISwap","cljs.core.ISwap",2045511362,null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"protocol","protocol",652470118),cljs.core.ISwap,new cljs.core.Keyword(null,"methods","methods",453930866),cljs.core.PersistentHashSet.createAsIfByAssoc([sci.impl.core_protocols._swap_BANG_]),new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null));
sci.impl.core_protocols.reset_protocol = sci.impl.vars.new_var.cljs$core$IFn$_invoke$arity$3(new cljs.core.Symbol(null,"cljs.core.IReset","cljs.core.IReset",348905844,null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"protocol","protocol",652470118),cljs.core.IReset,new cljs.core.Keyword(null,"methods","methods",453930866),cljs.core.PersistentHashSet.createAsIfByAssoc([sci.impl.core_protocols._reset_BANG_]),new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ns","ns",441598760),sci.impl.core_protocols.cljs_core_ns], null));
sci.impl.core_protocols.defaults = cljs.core.set(cljs.core.conj.cljs$core$IFn$_invoke$arity$2(sci.impl.core_protocols.iatom_defaults,sci.impl.core_protocols.ideref_default));

//# sourceMappingURL=sci.impl.core_protocols.js.map
