// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.langs.behaviors');
goog.require('cljs.core');
goog.require('lt.util.js');
goog.require('lt.objs.thread');
goog.require('lt.util.js');
goog.require('lt.util.dom');
goog.require('lt.objs.context');
goog.require('lt.objs.context');
goog.require('lt.util.dom');
goog.require('clojure.string');
goog.require('lt.objs.command');
goog.require('clojure.string');
goog.require('lt.objs.editor');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.objs.editor');
goog.require('lt.objs.command');
lt.objs.langs.behaviors.flat_parser = lt.objs.thread.thread_STAR_.call(null,(function tfun9952(){var orig__3398__auto__ = argsArray(arguments);var msg__3399__auto__ = orig__3398__auto__.shift();var args__3400__auto__ = orig__3398__auto__.map(cljs.reader.read_string);var raise = ((function (orig__3398__auto__,msg__3399__auto__,args__3400__auto__){
return (function (obj__3401__auto__,k__3402__auto__,v__3403__auto__){return _send(obj__3401__auto__,k__3402__auto__,cljs.core.pr_str.call(null,v__3403__auto__),"clj");
});})(orig__3398__auto__,msg__3399__auto__,args__3400__auto__))
;args__3400__auto__.unshift(msg__3399__auto__.obj);
return (function (obj_id,contents){var StringStream = require([cljs.core.str(ltpath),cljs.core.str("/core/node_modules/codemirror/addon/runmode/runmode.node.js")].join('')).StringStream;var parser = require([cljs.core.str(ltpath),cljs.core.str("/core/node_modules/lighttable/background/behaviorsParser.js")].join('')).parseFlat;var parsed = parser.call(null,(new StringStream(contents)));return _send(obj_id,new cljs.core.Keyword(null,"parsed","parsed",4313460611),parsed);
}).apply(null,args__3400__auto__);
}));
lt.objs.langs.behaviors.str__GT_ns_keyword = (function str__GT_ns_keyword(s){if(cljs.core.truth_(s))
{var s__$1 = ((cljs.core._EQ_.call(null,":",cljs.core.first.call(null,s)))?cljs.core.subs.call(null,s,1):s);var parts = clojure.string.split.call(null,s__$1,"/");if(cljs.core.seq.call(null,parts))
{return cljs.core.apply.call(null,cljs.core.keyword,parts);
} else
{return null;
}
} else
{return null;
}
});
lt.objs.langs.behaviors.__GT_index = (function __GT_index(this$){return lt.objs.editor.pos__GT_index.call(null,this$,lt.objs.editor.cursor.call(null,this$));
});
lt.objs.langs.behaviors.idx__GT_item = (function idx__GT_item(idx,items){return cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__9953_SHARP_){return (((new cljs.core.Keyword(null,"end","end",1014004813).cljs$core$IFn$_invoke$arity$1(cljs.core.second.call(null,p1__9953_SHARP_)) + 1) > idx)) && ((idx > (new cljs.core.Keyword(null,"start","start",1123661780).cljs$core$IFn$_invoke$arity$1(cljs.core.second.call(null,p1__9953_SHARP_)) - 1)));
}),cljs.core.map_indexed.call(null,cljs.core.vector,items)));
});
lt.objs.langs.behaviors.idx__GT_entry_info = (function idx__GT_entry_info(idx,entries){var vec__9957 = lt.objs.langs.behaviors.idx__GT_item.call(null,idx,entries);var ix = cljs.core.nth.call(null,vec__9957,0,null);var entry = cljs.core.nth.call(null,vec__9957,1,null);var vec__9958 = lt.objs.langs.behaviors.idx__GT_item.call(null,idx,new cljs.core.Keyword(null,"tokens","tokens",4440684812).cljs$core$IFn$_invoke$arity$1(entry));var tokenIx = cljs.core.nth.call(null,vec__9958,0,null);var token = cljs.core.nth.call(null,vec__9958,1,null);var vec__9959 = new cljs.core.Keyword(null,"tokens","tokens",4440684812).cljs$core$IFn$_invoke$arity$1(entry);var tag = cljs.core.nth.call(null,vec__9959,0,null);var behavior = cljs.core.nth.call(null,vec__9959,1,null);var args = cljs.core.nthnext.call(null,vec__9959,2);var tag__$1 = (cljs.core.truth_(tag)?lt.objs.langs.behaviors.str__GT_ns_keyword.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(tag)):null);var behavior__$1 = (cljs.core.truth_(behavior)?lt.objs.langs.behaviors.str__GT_ns_keyword.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(behavior)):null);var past_last_token = (idx > (new cljs.core.Keyword(null,"end","end",1014004813).cljs$core$IFn$_invoke$arity$1(cljs.core.last.call(null,new cljs.core.Keyword(null,"tokens","tokens",4440684812).cljs$core$IFn$_invoke$arity$1(entry))) + 1));var pos = (((cljs.core.not.call(null,tokenIx)) && (past_last_token))?cljs.core.count.call(null,new cljs.core.Keyword(null,"tokens","tokens",4440684812).cljs$core$IFn$_invoke$arity$1(entry)):((cljs.core.not.call(null,tokenIx))?(cljs.core.count.call(null,new cljs.core.Keyword(null,"tokens","tokens",4440684812).cljs$core$IFn$_invoke$arity$1(entry)) - 1):((new cljs.core.Keyword(null,"else","else",1017020587))?tokenIx:null)));var param_pos = (((pos > 1))?(pos - 2):null);return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"tag","tag",1014018828),tag__$1,new cljs.core.Keyword(null,"behavior","behavior",2524816836),behavior__$1,new cljs.core.Keyword(null,"param-pos","param-pos",2966692998),param_pos,new cljs.core.Keyword(null,"pos","pos",1014015430),pos], null);
});
lt.objs.langs.behaviors.user_behavior_completions = (function user_behavior_completions(token,_,___$1){if(cljs.core.truth_((function (){var and__3508__auto__ = token;if(cljs.core.truth_(and__3508__auto__))
{return cljs.core._EQ_.call(null,cljs.core.subs.call(null,token,0,1),":");
} else
{return and__3508__auto__;
}
})()))
{return cljs.core.map.call(null,(function (p1__9960_SHARP_){return {"completion": [cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__9960_SHARP_))].join(''), "text": [cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__9960_SHARP_))].join('')};
}),cljs.core.vals.call(null,cljs.core.deref.call(null,lt.object.behaviors)));
} else
{return cljs.core.map.call(null,(function (p1__9961_SHARP_){if(cljs.core.not.call(null,new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$1(p1__9961_SHARP_)))
{return {"completion": [cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__9961_SHARP_))].join(''), "text": [cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__9961_SHARP_))].join('')};
} else
{return {"completion": [cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__9961_SHARP_))].join(''), "text": new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$1(p1__9961_SHARP_)};
}
}),cljs.core.filter.call(null,(function (p1__9962_SHARP_){return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(p1__9962_SHARP_),new cljs.core.Keyword(null,"user","user",1017503549));
}),cljs.core.vals.call(null,cljs.core.deref.call(null,lt.object.behaviors))));
}
});
lt.objs.langs.behaviors.completions = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"tag","tag",1014018828),(function (){return cljs.core.map.call(null,(function (p1__9963_SHARP_){return {"completion": [cljs.core.str(p1__9963_SHARP_)].join(''), "text": [cljs.core.str(p1__9963_SHARP_)].join('')};
}),cljs.core.keys.call(null,cljs.core.deref.call(null,lt.object.tags)));
}),new cljs.core.Keyword(null,"behavior","behavior",2524816836),lt.objs.langs.behaviors.user_behavior_completions,new cljs.core.Keyword(null,"behavior-param","behavior-param",2920369348),(function (token,beh,param_pos){var params = new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(beh);var param = cljs.core.get.call(null,params,param_pos);if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(param),new cljs.core.Keyword(null,"list","list",1017226256)))
{if(cljs.core.fn_QMARK_.call(null,new cljs.core.Keyword(null,"items","items",1114430258).cljs$core$IFn$_invoke$arity$1(param)))
{return new cljs.core.Keyword(null,"items","items",1114430258).cljs$core$IFn$_invoke$arity$1(param).call(null);
} else
{return new cljs.core.Keyword(null,"items","items",1114430258).cljs$core$IFn$_invoke$arity$1(param);
}
} else
{return null;
}
})], null);
lt.objs.langs.behaviors.pos__GT_token_type = (function pos__GT_token_type(pos){var pred__9967 = cljs.core._EQ_;var expr__9968 = pos;if(cljs.core.truth_(pred__9967.call(null,0,expr__9968)))
{return new cljs.core.Keyword(null,"tag","tag",1014018828);
} else
{if(cljs.core.truth_(pred__9967.call(null,1,expr__9968)))
{return new cljs.core.Keyword(null,"behavior","behavior",2524816836);
} else
{return new cljs.core.Keyword(null,"behavior-param","behavior-param",2920369348);
}
}
});
lt.objs.langs.behaviors.__BEH__behavior_hints = (function __BEH__behavior_hints(this$,hints,token){var idx = lt.objs.langs.behaviors.__GT_index.call(null,this$);var map__9971 = lt.objs.langs.behaviors.idx__GT_entry_info.call(null,idx,new cljs.core.Keyword(null,"entries","entries",3717298178).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var map__9971__$1 = ((cljs.core.seq_QMARK_.call(null,map__9971))?cljs.core.apply.call(null,cljs.core.hash_map,map__9971):map__9971);var info = map__9971__$1;var pos = cljs.core.get.call(null,map__9971__$1,new cljs.core.Keyword(null,"pos","pos",1014015430));var param_pos = cljs.core.get.call(null,map__9971__$1,new cljs.core.Keyword(null,"param-pos","param-pos",2966692998));var behavior = cljs.core.get.call(null,map__9971__$1,new cljs.core.Keyword(null,"behavior","behavior",2524816836));var tag = cljs.core.get.call(null,map__9971__$1,new cljs.core.Keyword(null,"tag","tag",1014018828));var behavior_info = cljs.core.deref.call(null,lt.object.behaviors).call(null,behavior);var token_type = lt.objs.langs.behaviors.pos__GT_token_type.call(null,pos);var completions_set = lt.objs.langs.behaviors.completions.call(null,token_type);return completions_set.call(null,token,behavior_info,param_pos,token);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","behavior-hints","lt.objs.langs.behaviors/behavior-hints",2823940026),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__behavior_hints,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"hints+","hints+",4091697745),null], null), null),new cljs.core.Keyword(null,"exclusive","exclusive",2700522000),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.plugins.auto-complete","textual-hints","lt.plugins.auto-complete/textual-hints",1172342809)], null));
lt.objs.langs.behaviors.__BEH__show_info_on_move = (function __BEH__show_info_on_move(this$){var idx = lt.objs.langs.behaviors.__GT_index.call(null,this$);var map__9973 = lt.objs.langs.behaviors.idx__GT_entry_info.call(null,idx,new cljs.core.Keyword(null,"entries","entries",3717298178).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var map__9973__$1 = ((cljs.core.seq_QMARK_.call(null,map__9973))?cljs.core.apply.call(null,cljs.core.hash_map,map__9973):map__9973);var info = map__9973__$1;var param_pos = cljs.core.get.call(null,map__9973__$1,new cljs.core.Keyword(null,"param-pos","param-pos",2966692998));var behavior = cljs.core.get.call(null,map__9973__$1,new cljs.core.Keyword(null,"behavior","behavior",2524816836));var tag = cljs.core.get.call(null,map__9973__$1,new cljs.core.Keyword(null,"tag","tag",1014018828));var behavior_info = cljs.core.deref.call(null,lt.object.behaviors).call(null,behavior);if(cljs.core.truth_(new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$1(behavior_info)))
{return lt.object.raise.call(null,lt.objs.langs.behaviors.helper,new cljs.core.Keyword(null,"show!","show!",1123317814),this$,behavior_info,param_pos);
} else
{return lt.object.raise.call(null,lt.objs.langs.behaviors.helper,new cljs.core.Keyword(null,"clear!","clear!",3951036134));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","show-info-on-move","lt.objs.langs.behaviors/show-info-on-move",2847824345),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__show_info_on_move,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"move","move",1017261891),null], null), null),new cljs.core.Keyword(null,"debounce","debounce",1556599227),200);
lt.objs.langs.behaviors.__BEH__behavior_hint_pattern = (function __BEH__behavior_hint_pattern(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"hint-pattern","hint-pattern",2825267644),/[\w\-\>\:\*\$\?\<\!\+\.\"\\/]/], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","behavior-hint-pattern","lt.objs.langs.behaviors/behavior-hint-pattern",4504292902),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__behavior_hint_pattern,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"object.instant","object.instant",773332388),null], null), null));
lt.objs.langs.behaviors.__BEH__on_changed = (function __BEH__on_changed(this$){return lt.objs.langs.behaviors.flat_parser.call(null,this$,lt.objs.editor.__GT_val.call(null,this$));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","on-changed","lt.objs.langs.behaviors/on-changed",1403950855),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__on_changed,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"change","change",3947235106),null,new cljs.core.Keyword(null,"create","create",3956577390),null], null), null),new cljs.core.Keyword(null,"debounce","debounce",1556599227),100);
lt.objs.langs.behaviors.__BEH__parsed = (function __BEH__parsed(this$,results){lt.object.merge_BANG_.call(null,this$,cljs.core.js__GT_clj.call(null,results,new cljs.core.Keyword(null,"keywordize-keys","keywordize-keys",4191781672),true));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"move","move",1017261891));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","parsed","lt.objs.langs.behaviors/parsed",4692889658),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__parsed,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"parsed","parsed",4313460611),null], null), null));
lt.objs.langs.behaviors.inline = (function inline(this$,ed,opts){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.eval","inline-result","lt.objs.eval/inline-result",1807255869),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"ed","ed",1013907473),ed,new cljs.core.Keyword(null,"class","class",1108647146),"behavior-helper",new cljs.core.Keyword(null,"opts","opts",1017322386),opts,new cljs.core.Keyword(null,"result","result",4374444943),lt.object.__GT_content.call(null,this$),new cljs.core.Keyword(null,"above","above",1106515727),cljs.core.boolean$.call(null,(new cljs.core.Keyword(null,"prev-line","prev-line",4421028544).cljs$core$IFn$_invoke$arity$1(opts) < new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(opts))),new cljs.core.Keyword(null,"loc","loc",1014011570),opts,new cljs.core.Keyword(null,"line","line",1017226086),lt.objs.editor.line_handle.call(null,ed,new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(opts))], null));
});
lt.objs.langs.behaviors.__GT_helper = (function __GT_helper(beh){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2","h2",1013907516),new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$2(beh,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(beh))], null),(cljs.core.truth_(new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(beh))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),(function (){var iter__4231__auto__ = (function iter__9984(s__9985){return (new cljs.core.LazySeq(null,(function (){var s__9985__$1 = s__9985;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__9985__$1);if(temp__4092__auto__)
{var s__9985__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__9985__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__9985__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__9987 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__9986 = 0;while(true){
if((i__9986 < size__4230__auto__))
{var p = cljs.core._nth.call(null,c__4229__auto__,i__9986);cljs.core.chunk_append.call(null,b__9987,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.param","span.param",1131663451),new cljs.core.Keyword(null,"label","label",1116631654).cljs$core$IFn$_invoke$arity$1(p),(cljs.core.truth_(new cljs.core.Keyword(null,"example","example",3985900764).cljs$core$IFn$_invoke$arity$1(p))?cljs.core._conj.call(null,cljs.core._conj.call(null,cljs.core.List.EMPTY,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pre.example","pre.example",4358698129),new cljs.core.Keyword(null,"example","example",3985900764).cljs$core$IFn$_invoke$arity$1(p)], null))," =>"):null)], null));
{
var G__9994 = (i__9986 + 1);
i__9986 = G__9994;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__9987),iter__9984.call(null,cljs.core.chunk_rest.call(null,s__9985__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__9987),null);
}
} else
{var p = cljs.core.first.call(null,s__9985__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.param","span.param",1131663451),new cljs.core.Keyword(null,"label","label",1116631654).cljs$core$IFn$_invoke$arity$1(p),(cljs.core.truth_(new cljs.core.Keyword(null,"example","example",3985900764).cljs$core$IFn$_invoke$arity$1(p))?cljs.core._conj.call(null,cljs.core._conj.call(null,cljs.core.List.EMPTY,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pre.example","pre.example",4358698129),new cljs.core.Keyword(null,"example","example",3985900764).cljs$core$IFn$_invoke$arity$1(p)], null))," =>"):null)], null),iter__9984.call(null,cljs.core.rest.call(null,s__9985__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(beh));
})()], null):null)], null));var seq__9988_9995 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__9989_9996 = null;var count__9990_9997 = 0;var i__9991_9998 = 0;while(true){
if((i__9991_9998 < count__9990_9997))
{var vec__9992_9999 = cljs.core._nth.call(null,chunk__9989_9996,i__9991_9998);var ev__3326__auto___10000 = cljs.core.nth.call(null,vec__9992_9999,0,null);var func__3327__auto___10001 = cljs.core.nth.call(null,vec__9992_9999,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10000,func__3327__auto___10001);
{
var G__10002 = seq__9988_9995;
var G__10003 = chunk__9989_9996;
var G__10004 = count__9990_9997;
var G__10005 = (i__9991_9998 + 1);
seq__9988_9995 = G__10002;
chunk__9989_9996 = G__10003;
count__9990_9997 = G__10004;
i__9991_9998 = G__10005;
continue;
}
} else
{var temp__4092__auto___10006 = cljs.core.seq.call(null,seq__9988_9995);if(temp__4092__auto___10006)
{var seq__9988_10007__$1 = temp__4092__auto___10006;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9988_10007__$1))
{var c__4262__auto___10008 = cljs.core.chunk_first.call(null,seq__9988_10007__$1);{
var G__10009 = cljs.core.chunk_rest.call(null,seq__9988_10007__$1);
var G__10010 = c__4262__auto___10008;
var G__10011 = cljs.core.count.call(null,c__4262__auto___10008);
var G__10012 = 0;
seq__9988_9995 = G__10009;
chunk__9989_9996 = G__10010;
count__9990_9997 = G__10011;
i__9991_9998 = G__10012;
continue;
}
} else
{var vec__9993_10013 = cljs.core.first.call(null,seq__9988_10007__$1);var ev__3326__auto___10014 = cljs.core.nth.call(null,vec__9993_10013,0,null);var func__3327__auto___10015 = cljs.core.nth.call(null,vec__9993_10013,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10014,func__3327__auto___10015);
{
var G__10016 = cljs.core.next.call(null,seq__9988_10007__$1);
var G__10017 = null;
var G__10018 = 0;
var G__10019 = 0;
seq__9988_9995 = G__10016;
chunk__9989_9996 = G__10017;
count__9990_9997 = G__10018;
i__9991_9998 = G__10019;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.langs.behaviors.set_param = (function set_param(this$,idx){var lis = lt.util.dom.$$.call(null,"span.param",lt.object.__GT_content.call(null,this$));var seq__10024_10028 = cljs.core.seq.call(null,lis);var chunk__10025_10029 = null;var count__10026_10030 = 0;var i__10027_10031 = 0;while(true){
if((i__10027_10031 < count__10026_10030))
{var li_10032 = cljs.core._nth.call(null,chunk__10025_10029,i__10027_10031);lt.util.dom.remove_class.call(null,li_10032,new cljs.core.Keyword(null,"active","active",3885920888));
{
var G__10033 = seq__10024_10028;
var G__10034 = chunk__10025_10029;
var G__10035 = count__10026_10030;
var G__10036 = (i__10027_10031 + 1);
seq__10024_10028 = G__10033;
chunk__10025_10029 = G__10034;
count__10026_10030 = G__10035;
i__10027_10031 = G__10036;
continue;
}
} else
{var temp__4092__auto___10037 = cljs.core.seq.call(null,seq__10024_10028);if(temp__4092__auto___10037)
{var seq__10024_10038__$1 = temp__4092__auto___10037;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10024_10038__$1))
{var c__4262__auto___10039 = cljs.core.chunk_first.call(null,seq__10024_10038__$1);{
var G__10040 = cljs.core.chunk_rest.call(null,seq__10024_10038__$1);
var G__10041 = c__4262__auto___10039;
var G__10042 = cljs.core.count.call(null,c__4262__auto___10039);
var G__10043 = 0;
seq__10024_10028 = G__10040;
chunk__10025_10029 = G__10041;
count__10026_10030 = G__10042;
i__10027_10031 = G__10043;
continue;
}
} else
{var li_10044 = cljs.core.first.call(null,seq__10024_10038__$1);lt.util.dom.remove_class.call(null,li_10044,new cljs.core.Keyword(null,"active","active",3885920888));
{
var G__10045 = cljs.core.next.call(null,seq__10024_10038__$1);
var G__10046 = null;
var G__10047 = 0;
var G__10048 = 0;
seq__10024_10028 = G__10045;
chunk__10025_10029 = G__10046;
count__10026_10030 = G__10047;
i__10027_10031 = G__10048;
continue;
}
}
} else
{}
}
break;
}
if(cljs.core.truth_(idx))
{return lt.util.dom.add_class.call(null,(lis[idx]),new cljs.core.Keyword(null,"active","active",3885920888));
} else
{return null;
}
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","helper","lt.objs.langs.behaviors/helper",3930620895),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"editor.behaviors.helper","editor.behaviors.helper",3298048942),null], null), null));
lt.objs.langs.behaviors.__BEH__helper__DOT__clear_BANG_ = (function __BEH__helper__DOT__clear_BANG_(this$){if(cljs.core.truth_(new cljs.core.Keyword(null,"mark","mark",1017248319).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{if(cljs.core.truth_((function (){var and__3508__auto__ = new cljs.core.Keyword(null,"ed","ed",1013907473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));if(cljs.core.truth_(and__3508__auto__))
{return cljs.core.deref.call(null,new cljs.core.Keyword(null,"ed","ed",1013907473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
} else
{return and__3508__auto__;
}
})()))
{lt.objs.editor._line_class.call(null,new cljs.core.Keyword(null,"ed","ed",1013907473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"text","text",1017460895),"behavior-helper-line");
} else
{}
lt.object.raise.call(null,new cljs.core.Keyword(null,"mark","mark",1017248319).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"clear!","clear!",3951036134));
} else
{}
lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"content","content",1965434859),null], null));
return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mark","mark",1017248319),null,new cljs.core.Keyword(null,"behavior","behavior",2524816836),null,new cljs.core.Keyword(null,"line","line",1017226086),null,new cljs.core.Keyword(null,"ed","ed",1013907473),null], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","helper.clear!","lt.objs.langs.behaviors/helper.clear!",3552557557),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__helper__DOT__clear_BANG_,new cljs.core.Keyword(null,"desc","desc",1016984067),"Behaviors.helper: clear",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"clear!","clear!",3951036134),null], null), null));
lt.objs.langs.behaviors.__BEH__helper__DOT__show_BANG_ = (function __BEH__helper__DOT__show_BANG_(this$,ed,beh,param_idx){var loc = lt.objs.editor.__GT_cursor.call(null,ed);if((cljs.core.not_EQ_.call(null,beh,new cljs.core.Keyword(null,"behavior","behavior",2524816836).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))) || (cljs.core.not_EQ_.call(null,ed,new cljs.core.Keyword(null,"ed","ed",1013907473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))))
{if(cljs.core.truth_(new cljs.core.Keyword(null,"mark","mark",1017248319).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{lt.objs.editor._line_class.call(null,ed,new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"text","text",1017460895),"behavior-helper-line");
lt.object.raise.call(null,new cljs.core.Keyword(null,"mark","mark",1017248319).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"clear!","clear!",3951036134));
} else
{}
lt.objs.editor._PLUS_line_class.call(null,ed,new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(loc),new cljs.core.Keyword(null,"text","text",1017460895),"behavior-helper-line");
lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"content","content",1965434859),lt.objs.langs.behaviors.__GT_helper.call(null,beh)], null));
lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mark","mark",1017248319),lt.objs.langs.behaviors.inline.call(null,this$,ed,cljs.core.assoc.call(null,loc,new cljs.core.Keyword(null,"prev-line","prev-line",4421028544),new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))),new cljs.core.Keyword(null,"behavior","behavior",2524816836),beh,new cljs.core.Keyword(null,"line","line",1017226086),new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(loc),new cljs.core.Keyword(null,"ed","ed",1013907473),ed], null));
} else
{}
return lt.objs.langs.behaviors.set_param.call(null,this$,param_idx);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","helper.show!","lt.objs.langs.behaviors/helper.show!",4057136325),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.langs.behaviors.__BEH__helper__DOT__show_BANG_,new cljs.core.Keyword(null,"desc","desc",1016984067),"Behaviors.helper: show",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"show!","show!",1123317814),null], null), null));
lt.objs.langs.behaviors.helper = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.langs.behaviors","helper","lt.objs.langs.behaviors/helper",3930620895));
