// Compiled by ClojureScript 1.11.60 {:static-fns true, :optimize-constants true, :optimizations :advanced}
goog.provide('omgnata.core');
goog.require('cljs.core');
goog.require('cljs.core.constants');
goog.require('reagent.core');
goog.require('reagent.session');
goog.require('secretary.core');
goog.require('ajax.core');
goog.require('cljs.core.async');
goog.require('goog.net.cookies');
goog.require('goog.events');
goog.require('goog.history.EventType');
goog.require('goog.History');
cljs.core.enable_console_print_BANG_();
omgnata.core.href = document.location.href;
omgnata.core.server = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$url,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$2(omgnata.core.href.split("#"),(0)).split("?"),(0)).replace(":3449",":8000")),"server.php"].join(''),cljs.core.cst$kw$poller_DASH_time,(5)], null));
secretary.core.set_config_BANG_(cljs.core.cst$kw$prefix,"#");
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.poller_instance !== 'undefined')){
} else {
omgnata.core.poller_instance = reagent.core.atom.cljs$core$IFn$_invoke$arity$1((0));
}
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.todo_lists !== 'undefined')){
} else {
omgnata.core.todo_lists = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
}
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.todo_timestamps !== 'undefined')){
} else {
omgnata.core.todo_timestamps = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
}
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.last_timestamp !== 'undefined')){
} else {
omgnata.core.last_timestamp = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(((cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(omgnata.core.href.indexOf("?demo"),(-1)))?(0):null));
}
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.sorter !== 'undefined')){
} else {
omgnata.core.sorter = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
}
if((typeof omgnata !== 'undefined') && (typeof omgnata.core !== 'undefined') && (typeof omgnata.core.app_has_focus !== 'undefined')){
} else {
omgnata.core.app_has_focus = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(true);
}
omgnata.core.re_todo_finder = /[\ \t]*\*[\ \t]*\[(.*?)\]/;
omgnata.core.re_todo_parser = /[\ \t]*\*[\ \t]*\[(.*?)\][\ \t]*(.*?)[\n$]([\s\S]*)/;
omgnata.core.re_only_spaces = /^[\s\t]*$/;
omgnata.core.no_extension = (function omgnata$core$no_extension(s){
return s.replace(".txt","");
});
omgnata.core.get_focus = (function omgnata$core$get_focus(this$){
var node = reagent.core.dom_node(this$);
var pos = node.value.length;
node.focus();

return node.setSelectionRange(pos,pos);
});
/**
 * Swap two elements in a vector.
 */
omgnata.core.swap_elements = (function omgnata$core$swap_elements(v,i1,i2){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$variadic(v,i2,(v.cljs$core$IFn$_invoke$arity$1 ? v.cljs$core$IFn$_invoke$arity$1(i1) : v.call(null,i1)),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([i1,(v.cljs$core$IFn$_invoke$arity$1 ? v.cljs$core$IFn$_invoke$arity$1(i2) : v.call(null,i2))], 0));
});
omgnata.core.get_index_of = (function omgnata$core$get_index_of(v,k,vl){
return cljs.core.first(cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.nil_QMARK_,cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2((function (p1__10880_SHARP_,p2__10879_SHARP_){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((p2__10879_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p2__10879_SHARP_.cljs$core$IFn$_invoke$arity$1(k) : p2__10879_SHARP_.call(null,k)),vl)){
return p1__10880_SHARP_;
} else {
return null;
}
}),v)));
});
omgnata.core.insert_at = (function omgnata$core$insert_at(v,idx,values){
var vec__10881 = cljs.core.split_at(idx,v);
var before = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10881,(0),null);
var after = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10881,(1),null);
return cljs.core.vec(cljs.core.concat.cljs$core$IFn$_invoke$arity$variadic(before,values,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([after], 0)));
});
omgnata.core.csrftoken = (function omgnata$core$csrftoken(){
return goog.net.cookies.get("csrftoken");
});
/**
 * Find all the positions in a string s that a regular expression re matches.
 */
omgnata.core.re_pos = (function omgnata$core$re_pos(re,s){
var re__$1 = (new RegExp(re.source,"g"));
var res = cljs.core.PersistentArrayMap.EMPTY;
while(true){
var temp__4655__auto__ = re__$1.exec(s);
if(cljs.core.truth_(temp__4655__auto__)){
var m = temp__4655__auto__;
var G__10884 = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(res,m.index,cljs.core.first(m));
res = G__10884;
continue;
} else {
return res;
}
break;
}
});
/**
 * Split up some text by positions of TODO list markers: * [ ] 
 */
omgnata.core.split_on_todos = (function omgnata$core$split_on_todos(todo_text){
var slice_positions = cljs.core.sort.cljs$core$IFn$_invoke$arity$1(cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__10885_SHARP_){
return cljs.core.first(p1__10885_SHARP_);
}),omgnata.core.re_pos(omgnata.core.re_todo_finder,todo_text))),todo_text.length));
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(slice_positions),(0))){
return slice_positions;
} else {
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0)], null),slice_positions);
}
});
/**
 * Parse a chunk of text into a TODO list item: * [ ] My title... 
 */
omgnata.core.parse_todo_chunk = (function omgnata$core$parse_todo_chunk(todo_chunk,index){
var vec__10886 = (new RegExp(omgnata.core.re_todo_parser)).exec(todo_chunk);
var matched = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10886,(0),null);
var checked = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10886,(1),null);
var title = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10886,(2),null);
var details = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10886,(3),null);
if(cljs.core.truth_(matched)){
return new cljs.core.PersistentArrayMap(null, 6, [cljs.core.cst$kw$matched,true,cljs.core.cst$kw$checked,((new RegExp(omgnata.core.re_only_spaces)).exec(checked) == null),cljs.core.cst$kw$title,title,cljs.core.cst$kw$details,details,cljs.core.cst$kw$source,todo_chunk,cljs.core.cst$kw$index,index], null);
} else {
return new cljs.core.PersistentArrayMap(null, 3, [cljs.core.cst$kw$matched,false,cljs.core.cst$kw$source,todo_chunk,cljs.core.cst$kw$index,index], null);
}
});
/**
 * Turn a chunk of text into an array of TODO list state dictionaries.
 */
omgnata.core.extract_todos = (function omgnata$core$extract_todos(text){
if(cljs.core.truth_(text)){
var slice_positions = omgnata.core.split_on_todos(text);
var chunks = cljs.core.partition.cljs$core$IFn$_invoke$arity$3((2),(1),slice_positions);
var todo_items = cljs.core.vec(cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2((function (idx,t){
return omgnata.core.parse_todo_chunk(text.substr(cljs.core.first(t),(cljs.core.last(t) - cljs.core.first(t))),idx);
}),chunks));
return todo_items;
} else {
return null;
}
});
/**
 * Given a hash-map of {:filename text :filename-2 text-2}
 *   replace the text items with their parsed TODO list state dictionaries.
 */
omgnata.core.transform_text_todos = (function omgnata$core$transform_text_todos(todo_text_items){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p__10889){
var vec__10890 = p__10889;
var fname = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10890,(0),null);
var todo_text = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10890,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.no_extension(fname),omgnata.core.extract_todos(todo_text)], null);
}),todo_text_items));
});
/**
 * Take an array of TODO list state dictionaries and then them back into text blob.
 */
omgnata.core.reassemble_todos = (function omgnata$core$reassemble_todos(todo_items){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.str,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__10893_SHARP_){
if(cljs.core.truth_((function (){var G__10894 = cljs.core.cst$kw$matched;
return (p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10894) : p1__10893_SHARP_.call(null,G__10894));
})())){
return [" * [",(cljs.core.truth_((function (){var G__10898 = cljs.core.cst$kw$checked;
return (p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10898) : p1__10893_SHARP_.call(null,G__10898));
})())?"x":" "),"] ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__10899 = cljs.core.cst$kw$title;
return (p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10899) : p1__10893_SHARP_.call(null,G__10899));
})()),"\n",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__10900 = cljs.core.cst$kw$details;
return (p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10900) : p1__10893_SHARP_.call(null,G__10900));
})())].join('');
} else {
var txt = (function (){var G__10901 = cljs.core.cst$kw$source;
return (p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10893_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10901) : p1__10893_SHARP_.call(null,G__10901));
})();
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.type(txt)], 0));

if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.type(txt),cljs.core.type(String()))){
return txt;
} else {
return console.log("Ignoring spurious TODO data:",cljs.core.clj__GT_js(txt));
}
}
}),todo_items));
});
omgnata.core.re_compute_indices = (function omgnata$core$re_compute_indices(todo_items,fname){
return cljs.core.update_in.cljs$core$IFn$_invoke$arity$3(todo_items,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname], null),(function (p1__10902_SHARP_){
return cljs.core.vec(cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2((function (idx,t){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(t,cljs.core.cst$kw$index,idx);
}),p1__10902_SHARP_));
}));
});
omgnata.core.remove_completed = (function omgnata$core$remove_completed(todo_items,fname){
return cljs.core.update_in.cljs$core$IFn$_invoke$arity$3(todo_items,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname], null),(function (p1__10903_SHARP_){
return cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.cst$kw$checked,p1__10903_SHARP_);
}));
});
omgnata.core.remove_item = (function omgnata$core$remove_item(todo_items,fname,todo){
return cljs.core.update_in.cljs$core$IFn$_invoke$arity$3(todo_items,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname], null),(function (todo_list){
return cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__10904_SHARP_){
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((function (){var G__10905 = cljs.core.cst$kw$index;
return (p1__10904_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__10904_SHARP_.cljs$core$IFn$_invoke$arity$1(G__10905) : p1__10904_SHARP_.call(null,G__10905));
})(),(function (){var G__10906 = cljs.core.cst$kw$index;
return (todo.cljs$core$IFn$_invoke$arity$1 ? todo.cljs$core$IFn$_invoke$arity$1(G__10906) : todo.call(null,G__10906));
})());
}),todo_list);
}));
});
omgnata.core.re_order_todo_list = (function omgnata$core$re_order_todo_list(todo_list,start_index,destination_index){
var todo_list_updated = todo_list;
var current_index = start_index;
while(true){
var diff = (destination_index - current_index);
var new_index = (current_index + (diff / Math.abs(diff)));
if((!(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(diff,(0))))){
var G__10907 = omgnata.core.swap_elements(todo_list_updated,current_index,new_index);
var G__10908 = new_index;
todo_list_updated = G__10907;
current_index = G__10908;
continue;
} else {
return todo_list_updated;
}
break;
}
});
/**
 * Ask the server for a list of text files.
 *   Server blocks if none since timestamp.
 *   Returns a dictionary of :filename to text mappings.
 */
omgnata.core.get_files = (function omgnata$core$get_files(timestamp){
var c = cljs.core.async.chan.cljs$core$IFn$_invoke$arity$0();
ajax.core.ajax_request(new cljs.core.PersistentArrayMap(null, 6, [cljs.core.cst$kw$uri,(function (){var G__10911 = cljs.core.cst$kw$url;
var fexpr__10910 = cljs.core.deref(omgnata.core.server);
return (fexpr__10910.cljs$core$IFn$_invoke$arity$1 ? fexpr__10910.cljs$core$IFn$_invoke$arity$1(G__10911) : fexpr__10910.call(null,G__10911));
})(),cljs.core.cst$kw$method,cljs.core.cst$kw$get,cljs.core.cst$kw$with_DASH_credentials,true,cljs.core.cst$kw$params,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$timestamp,(function (){var or__5045__auto__ = timestamp;
if(cljs.core.truth_(or__5045__auto__)){
return or__5045__auto__;
} else {
return (0);
}
})(),cljs.core.cst$kw$live_for,(function (){var G__10913 = cljs.core.cst$kw$poller_DASH_time;
var fexpr__10912 = cljs.core.deref(omgnata.core.server);
return (fexpr__10912.cljs$core$IFn$_invoke$arity$1 ? fexpr__10912.cljs$core$IFn$_invoke$arity$1(G__10913) : fexpr__10912.call(null,G__10913));
})()], null),cljs.core.cst$kw$response_DASH_format,ajax.core.json_response_format.cljs$core$IFn$_invoke$arity$0(),cljs.core.cst$kw$handler,(function (p1__10909_SHARP_){
return cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$2(c,p1__10909_SHARP_);
})], null));

return c;
});
/**
 * Ask the server to update a particular text file with text contents.
 */
omgnata.core.update_file = (function omgnata$core$update_file(fname,text){
return ajax.core.ajax_request(new cljs.core.PersistentArrayMap(null, 8, [cljs.core.cst$kw$uri,(function (){var G__10915 = cljs.core.cst$kw$url;
var fexpr__10914 = cljs.core.deref(omgnata.core.server);
return (fexpr__10914.cljs$core$IFn$_invoke$arity$1 ? fexpr__10914.cljs$core$IFn$_invoke$arity$1(G__10915) : fexpr__10914.call(null,G__10915));
})(),cljs.core.cst$kw$method,cljs.core.cst$kw$post,cljs.core.cst$kw$with_DASH_credentials,true,cljs.core.cst$kw$headers,new cljs.core.PersistentArrayMap(null, 1, ["X-CSRFToken",omgnata.core.csrftoken()], null),cljs.core.cst$kw$format,ajax.core.url_request_format(),cljs.core.cst$kw$params,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$filename,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(fname),".txt"].join(''),cljs.core.cst$kw$content,text], null),cljs.core.cst$kw$response_DASH_format,ajax.core.json_response_format.cljs$core$IFn$_invoke$arity$0(),cljs.core.cst$kw$handler,(function (p__10916){
var vec__10917 = p__10916;
var ok = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10917,(0),null);
var result = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10917,(1),null);
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["update-file result:",ok,cljs.core.clj__GT_js(result)], 0));

if(cljs.core.truth_((function (){var and__5043__auto__ = ok;
if(cljs.core.truth_(and__5043__auto__)){
return (!((result == null)));
} else {
return and__5043__auto__;
}
})())){
return cljs.core.reset_BANG_(omgnata.core.last_timestamp,result);
} else {
return null;
}
})], null));
});
/**
 * Ask the server to delete a single file.
 */
omgnata.core.delete_file = (function omgnata$core$delete_file(fname){
return ajax.core.ajax_request(new cljs.core.PersistentArrayMap(null, 8, [cljs.core.cst$kw$uri,(function (){var G__10921 = cljs.core.cst$kw$url;
var fexpr__10920 = cljs.core.deref(omgnata.core.server);
return (fexpr__10920.cljs$core$IFn$_invoke$arity$1 ? fexpr__10920.cljs$core$IFn$_invoke$arity$1(G__10921) : fexpr__10920.call(null,G__10921));
})(),cljs.core.cst$kw$method,cljs.core.cst$kw$post,cljs.core.cst$kw$with_DASH_credentials,true,cljs.core.cst$kw$headers,new cljs.core.PersistentArrayMap(null, 1, ["X-CSRFToken",omgnata.core.csrftoken()], null),cljs.core.cst$kw$format,ajax.core.url_request_format(),cljs.core.cst$kw$params,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$delete,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(fname),".txt"].join('')], null),cljs.core.cst$kw$response_DASH_format,ajax.core.json_response_format.cljs$core$IFn$_invoke$arity$0(),cljs.core.cst$kw$handler,(function (p__10922){
var vec__10923 = p__10922;
var ok = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10923,(0),null);
var result = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__10923,(1),null);
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["delete-file result:",ok,cljs.core.clj__GT_js(result)], 0));

if(cljs.core.truth_((function (){var and__5043__auto__ = ok;
if(cljs.core.truth_(and__5043__auto__)){
return (!((result == null)));
} else {
return and__5043__auto__;
}
})())){
return cljs.core.reset_BANG_(omgnata.core.last_timestamp,result);
} else {
return null;
}
})], null));
});
/**
 * Continuously poll the server updating the todos atom when the textfile data changes.
 */
omgnata.core.long_poller = (function omgnata$core$long_poller(todos,file_timestamps,instance_id){
var c__8878__auto__ = cljs.core.async.chan.cljs$core$IFn$_invoke$arity$1((1));
cljs.core.async.impl.dispatch.run((function (){
var f__8879__auto__ = (function (){var switch__8771__auto__ = (function (state_11061){
var state_val_11062 = (state_11061[(1)]);
if((state_val_11062 === (7))){
var inst_10938 = cljs.core.deref(omgnata.core.last_timestamp);
var inst_10939 = omgnata.core.get_files(inst_10938);
var state_11061__$1 = state_11061;
return cljs.core.async.impl.ioc_helpers.take_BANG_(state_11061__$1,(10),inst_10939);
} else {
if((state_val_11062 === (20))){
var inst_10969 = cljs.core.reset_BANG_(omgnata.core.last_timestamp,(0));
var state_11061__$1 = state_11061;
var statearr_11063_11149 = state_11061__$1;
(statearr_11063_11149[(2)] = inst_10969);

(statearr_11063_11149[(1)] = (22));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (27))){
var inst_10951 = (state_11061[(7)]);
var state_11061__$1 = state_11061;
var statearr_11064_11150 = state_11061__$1;
(statearr_11064_11150[(2)] = inst_10951);

(statearr_11064_11150[(1)] = (28));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (1))){
var inst_10926 = (1000);
var state_11061__$1 = (function (){var statearr_11065 = state_11061;
(statearr_11065[(8)] = inst_10926);

return statearr_11065;
})();
var statearr_11066_11151 = state_11061__$1;
(statearr_11066_11151[(2)] = null);

(statearr_11066_11151[(1)] = (2));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (24))){
var inst_10952 = (state_11061[(9)]);
var inst_11035 = cljs.core.clj__GT_js(inst_10952);
var inst_11036 = console.log("Long-poller ignoring old data:",inst_11035);
var state_11061__$1 = state_11061;
var statearr_11067_11152 = state_11061__$1;
(statearr_11067_11152[(2)] = inst_11036);

(statearr_11067_11152[(1)] = (25));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (39))){
var inst_10951 = (state_11061[(7)]);
var state_11061__$1 = state_11061;
var statearr_11068_11153 = state_11061__$1;
(statearr_11068_11153[(2)] = inst_10951);

(statearr_11068_11153[(1)] = (40));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (46))){
var inst_11033 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11069_11154 = state_11061__$1;
(statearr_11069_11154[(2)] = inst_11033);

(statearr_11069_11154[(1)] = (25));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (4))){
var inst_10931 = cljs.core.deref(omgnata.core.last_timestamp);
var inst_10932 = cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Long poller initiated:",instance_id,"timestamp:",inst_10931], 0));
var inst_10936 = cljs.core.deref(omgnata.core.app_has_focus);
var state_11061__$1 = (function (){var statearr_11070 = state_11061;
(statearr_11070[(10)] = inst_10932);

return statearr_11070;
})();
if(cljs.core.truth_(inst_10936)){
var statearr_11071_11155 = state_11061__$1;
(statearr_11071_11155[(1)] = (7));

} else {
var statearr_11072_11156 = state_11061__$1;
(statearr_11072_11156[(1)] = (8));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (15))){
var inst_10952 = (state_11061[(9)]);
var inst_10974 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("timestamp") : inst_10952.call(null,"timestamp"));
var inst_10975 = cljs.core.deref(omgnata.core.last_timestamp);
var inst_10976 = (inst_10974 >= inst_10975);
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_10976)){
var statearr_11073_11157 = state_11061__$1;
(statearr_11073_11157[(1)] = (23));

} else {
var statearr_11074_11158 = state_11061__$1;
(statearr_11074_11158[(1)] = (24));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (48))){
var inst_10926 = (state_11061[(8)]);
var inst_11043 = (inst_10926 * (2));
var inst_11044 = ((inst_11043 < (120000)) ? inst_11043 : (120000));
var state_11061__$1 = state_11061;
var statearr_11075_11159 = state_11061__$1;
(statearr_11075_11159[(2)] = inst_11044);

(statearr_11075_11159[(1)] = (49));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (50))){
var inst_11049 = (state_11061[(11)]);
var inst_11053 = (state_11061[(2)]);
var inst_10926 = inst_11049;
var state_11061__$1 = (function (){var statearr_11076 = state_11061;
(statearr_11076[(12)] = inst_11053);

(statearr_11076[(8)] = inst_10926);

return statearr_11076;
})();
var statearr_11077_11160 = state_11061__$1;
(statearr_11077_11160[(2)] = null);

(statearr_11077_11160[(1)] = (2));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (21))){
var state_11061__$1 = state_11061;
var statearr_11078_11161 = state_11061__$1;
(statearr_11078_11161[(2)] = null);

(statearr_11078_11161[(1)] = (22));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (31))){
var inst_11003 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11079_11162 = state_11061__$1;
(statearr_11079_11162[(2)] = inst_11003);

(statearr_11079_11162[(1)] = (28));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (32))){
var inst_10989 = (state_11061[(13)]);
var inst_10996 = cljs.core.count(inst_10989);
var inst_10997 = (inst_10996 > (0));
var state_11061__$1 = state_11061;
var statearr_11080_11163 = state_11061__$1;
(statearr_11080_11163[(2)] = inst_10997);

(statearr_11080_11163[(1)] = (34));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (40))){
var inst_11025 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_11025)){
var statearr_11081_11164 = state_11061__$1;
(statearr_11081_11164[(1)] = (44));

} else {
var statearr_11082_11165 = state_11061__$1;
(statearr_11082_11165[(1)] = (45));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (33))){
var inst_10989 = (state_11061[(13)]);
var state_11061__$1 = state_11061;
var statearr_11083_11166 = state_11061__$1;
(statearr_11083_11166[(2)] = inst_10989);

(statearr_11083_11166[(1)] = (34));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (13))){
var inst_11049 = (state_11061[(11)]);
var inst_11049__$1 = (state_11061[(2)]);
var inst_11050 = console.log("Long-poller timeout wait:",inst_11049__$1);
var inst_11051 = cljs.core.async.timeout(inst_11049__$1);
var state_11061__$1 = (function (){var statearr_11084 = state_11061;
(statearr_11084[(11)] = inst_11049__$1);

(statearr_11084[(14)] = inst_11050);

return statearr_11084;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_(state_11061__$1,(50),inst_11051);
} else {
if((state_val_11062 === (22))){
var inst_10972 = (state_11061[(2)]);
var state_11061__$1 = (function (){var statearr_11085 = state_11061;
(statearr_11085[(15)] = inst_10972);

return statearr_11085;
})();
var statearr_11086_11167 = state_11061__$1;
(statearr_11086_11167[(2)] = null);

(statearr_11086_11167[(1)] = (16));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (36))){
var state_11061__$1 = state_11061;
var statearr_11087_11168 = state_11061__$1;
(statearr_11087_11168[(2)] = null);

(statearr_11087_11168[(1)] = (37));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (41))){
var inst_10983 = (state_11061[(16)]);
var inst_11017 = cljs.core.deref(todos);
var inst_11018 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(inst_11017,inst_10983);
var inst_11019 = (!(inst_11018));
var state_11061__$1 = state_11061;
var statearr_11088_11169 = state_11061__$1;
(statearr_11088_11169[(2)] = inst_11019);

(statearr_11088_11169[(1)] = (43));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (43))){
var inst_11022 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11089_11170 = state_11061__$1;
(statearr_11089_11170[(2)] = inst_11022);

(statearr_11089_11170[(1)] = (40));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (29))){
var inst_10989 = (state_11061[(13)]);
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_10989)){
var statearr_11090_11171 = state_11061__$1;
(statearr_11090_11171[(1)] = (32));

} else {
var statearr_11091_11172 = state_11061__$1;
(statearr_11091_11172[(1)] = (33));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (44))){
var inst_10983 = (state_11061[(16)]);
var inst_10951 = (state_11061[(7)]);
var inst_10952 = (state_11061[(9)]);
var inst_11027 = cljs.core.deref(omgnata.core.last_timestamp);
var inst_11028 = cljs.core.clj__GT_js(inst_10952);
var inst_11029 = console.log("long-poller result:",inst_11027,inst_10951,inst_11028);
var inst_11030 = cljs.core.reset_BANG_(todos,inst_10983);
var state_11061__$1 = (function (){var statearr_11092 = state_11061;
(statearr_11092[(17)] = inst_11029);

return statearr_11092;
})();
var statearr_11093_11173 = state_11061__$1;
(statearr_11093_11173[(2)] = inst_11030);

(statearr_11093_11173[(1)] = (46));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (6))){
var inst_11057 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11094_11174 = state_11061__$1;
(statearr_11094_11174[(2)] = inst_11057);

(statearr_11094_11174[(1)] = (3));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (28))){
var inst_11006 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_11006)){
var statearr_11095_11175 = state_11061__$1;
(statearr_11095_11175[(1)] = (35));

} else {
var statearr_11096_11176 = state_11061__$1;
(statearr_11096_11176[(1)] = (36));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (25))){
var inst_11038 = (state_11061[(2)]);
var state_11061__$1 = (function (){var statearr_11097 = state_11061;
(statearr_11097[(18)] = inst_11038);

return statearr_11097;
})();
var statearr_11098_11177 = state_11061__$1;
(statearr_11098_11177[(2)] = (1000));

(statearr_11098_11177[(1)] = (16));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (34))){
var inst_11000 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11099_11178 = state_11061__$1;
(statearr_11099_11178[(2)] = inst_11000);

(statearr_11099_11178[(1)] = (31));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (17))){
var inst_10952 = (state_11061[(9)]);
var inst_10963 = (function (){var G__11100 = cljs.core.cst$kw$failure;
return (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1(G__11100) : inst_10952.call(null,G__11100));
})();
var inst_10964 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(inst_10963,cljs.core.cst$kw$parse);
var state_11061__$1 = state_11061;
var statearr_11101_11179 = state_11061__$1;
(statearr_11101_11179[(2)] = inst_10964);

(statearr_11101_11179[(1)] = (19));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (3))){
var inst_11059 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
return cljs.core.async.impl.ioc_helpers.return_chan(state_11061__$1,inst_11059);
} else {
if((state_val_11062 === (12))){
var state_11061__$1 = state_11061;
var statearr_11102_11180 = state_11061__$1;
(statearr_11102_11180[(2)] = (2000));

(statearr_11102_11180[(1)] = (13));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (2))){
var inst_10928 = cljs.core.deref(omgnata.core.poller_instance);
var inst_10929 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(instance_id,inst_10928);
var state_11061__$1 = state_11061;
if(inst_10929){
var statearr_11103_11181 = state_11061__$1;
(statearr_11103_11181[(1)] = (4));

} else {
var statearr_11104_11182 = state_11061__$1;
(statearr_11104_11182[(1)] = (5));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (23))){
var inst_10926 = (state_11061[(8)]);
var inst_10983 = (state_11061[(16)]);
var inst_10951 = (state_11061[(7)]);
var inst_10950 = (state_11061[(19)]);
var inst_10952 = (state_11061[(9)]);
var inst_10978 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("timestamp") : inst_10952.call(null,"timestamp"));
var inst_10979 = console.log("Long-poller new timestamp:",inst_10978);
var inst_10980 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("timestamp") : inst_10952.call(null,"timestamp"));
var inst_10981 = cljs.core.reset_BANG_(omgnata.core.last_timestamp,inst_10980);
var inst_10982 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("files") : inst_10952.call(null,"files"));
var inst_10983__$1 = omgnata.core.transform_text_todos(inst_10982);
var inst_10984 = cljs.core.PersistentHashMap.EMPTY;
var inst_10986 = (function (){var wait = inst_10926;
var vec__10933 = inst_10950;
var ok = inst_10951;
var result = inst_10952;
var transformed_todos = inst_10983__$1;
return (function (p__10985){
var vec__11105 = p__10985;
var fname = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11105,(0),null);
var timestamp = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11105,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.no_extension(fname),timestamp], null);
});
})();
var inst_10987 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("creation_timestamps") : inst_10952.call(null,"creation_timestamps"));
var inst_10988 = cljs.core.map.cljs$core$IFn$_invoke$arity$2(inst_10986,inst_10987);
var inst_10989 = cljs.core.into.cljs$core$IFn$_invoke$arity$2(inst_10984,inst_10988);
var state_11061__$1 = (function (){var statearr_11108 = state_11061;
(statearr_11108[(20)] = inst_10979);

(statearr_11108[(21)] = inst_10981);

(statearr_11108[(16)] = inst_10983__$1);

(statearr_11108[(13)] = inst_10989);

return statearr_11108;
})();
if(cljs.core.truth_(inst_10951)){
var statearr_11109_11183 = state_11061__$1;
(statearr_11109_11183[(1)] = (26));

} else {
var statearr_11110_11184 = state_11061__$1;
(statearr_11110_11184[(1)] = (27));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (47))){
var inst_11040 = (state_11061[(22)]);
var state_11061__$1 = state_11061;
var statearr_11111_11185 = state_11061__$1;
(statearr_11111_11185[(2)] = inst_11040);

(statearr_11111_11185[(1)] = (49));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (35))){
var inst_10989 = (state_11061[(13)]);
var inst_11008 = cljs.core.clj__GT_js(inst_10989);
var inst_11009 = console.log("Long-poller creation timestamps:",inst_11008);
var inst_11010 = cljs.core.reset_BANG_(file_timestamps,inst_10989);
var state_11061__$1 = (function (){var statearr_11112 = state_11061;
(statearr_11112[(23)] = inst_11009);

return statearr_11112;
})();
var statearr_11113_11186 = state_11061__$1;
(statearr_11113_11186[(2)] = inst_11010);

(statearr_11113_11186[(1)] = (37));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (19))){
var inst_10967 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_10967)){
var statearr_11114_11187 = state_11061__$1;
(statearr_11114_11187[(1)] = (20));

} else {
var statearr_11115_11188 = state_11061__$1;
(statearr_11115_11188[(1)] = (21));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (11))){
var inst_10952 = (state_11061[(9)]);
var inst_10957 = (function (){var G__11116 = cljs.core.cst$kw$failure;
return (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1(G__11116) : inst_10952.call(null,G__11116));
})();
var state_11061__$1 = state_11061;
if(cljs.core.truth_(inst_10957)){
var statearr_11117_11189 = state_11061__$1;
(statearr_11117_11189[(1)] = (14));

} else {
var statearr_11118_11190 = state_11061__$1;
(statearr_11118_11190[(1)] = (15));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (9))){
var inst_10950 = (state_11061[(19)]);
var inst_10952 = (state_11061[(9)]);
var inst_10950__$1 = (state_11061[(2)]);
var inst_10951 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(inst_10950__$1,(0),null);
var inst_10952__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(inst_10950__$1,(1),null);
var inst_10953 = cljs.core.clj__GT_js(inst_10952__$1);
var inst_10954 = console.log("Long-poller result:",inst_10953);
var inst_10955 = cljs.core.deref(omgnata.core.app_has_focus);
var state_11061__$1 = (function (){var statearr_11119 = state_11061;
(statearr_11119[(7)] = inst_10951);

(statearr_11119[(19)] = inst_10950__$1);

(statearr_11119[(24)] = inst_10954);

(statearr_11119[(9)] = inst_10952__$1);

return statearr_11119;
})();
if(cljs.core.truth_(inst_10955)){
var statearr_11120_11191 = state_11061__$1;
(statearr_11120_11191[(1)] = (11));

} else {
var statearr_11121_11192 = state_11061__$1;
(statearr_11121_11192[(1)] = (12));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (5))){
var state_11061__$1 = state_11061;
var statearr_11122_11193 = state_11061__$1;
(statearr_11122_11193[(2)] = null);

(statearr_11122_11193[(1)] = (6));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (14))){
var inst_10961 = (state_11061[(25)]);
var inst_10959 = console.log("Long-poller ignoring bad data.");
var inst_10960 = cljs.core.deref(omgnata.core.last_timestamp);
var inst_10961__$1 = (inst_10960 == null);
var state_11061__$1 = (function (){var statearr_11123 = state_11061;
(statearr_11123[(25)] = inst_10961__$1);

(statearr_11123[(26)] = inst_10959);

return statearr_11123;
})();
if(cljs.core.truth_(inst_10961__$1)){
var statearr_11124_11194 = state_11061__$1;
(statearr_11124_11194[(1)] = (17));

} else {
var statearr_11125_11195 = state_11061__$1;
(statearr_11125_11195[(1)] = (18));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (45))){
var state_11061__$1 = state_11061;
var statearr_11126_11196 = state_11061__$1;
(statearr_11126_11196[(2)] = null);

(statearr_11126_11196[(1)] = (46));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (26))){
var inst_10993 = (state_11061[(27)]);
var inst_10989 = (state_11061[(13)]);
var inst_10991 = cljs.core.deref(file_timestamps);
var inst_10992 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(inst_10991,inst_10989);
var inst_10993__$1 = (!(inst_10992));
var state_11061__$1 = (function (){var statearr_11127 = state_11061;
(statearr_11127[(27)] = inst_10993__$1);

return statearr_11127;
})();
if(inst_10993__$1){
var statearr_11128_11197 = state_11061__$1;
(statearr_11128_11197[(1)] = (29));

} else {
var statearr_11129_11198 = state_11061__$1;
(statearr_11129_11198[(1)] = (30));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (16))){
var inst_11040 = (state_11061[(22)]);
var inst_11040__$1 = (state_11061[(2)]);
var state_11061__$1 = (function (){var statearr_11130 = state_11061;
(statearr_11130[(22)] = inst_11040__$1);

return statearr_11130;
})();
if(cljs.core.truth_(inst_11040__$1)){
var statearr_11131_11199 = state_11061__$1;
(statearr_11131_11199[(1)] = (47));

} else {
var statearr_11132_11200 = state_11061__$1;
(statearr_11132_11200[(1)] = (48));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (38))){
var inst_11015 = (state_11061[(28)]);
var inst_10952 = (state_11061[(9)]);
var inst_11015__$1 = (inst_10952.cljs$core$IFn$_invoke$arity$1 ? inst_10952.cljs$core$IFn$_invoke$arity$1("files") : inst_10952.call(null,"files"));
var state_11061__$1 = (function (){var statearr_11133 = state_11061;
(statearr_11133[(28)] = inst_11015__$1);

return statearr_11133;
})();
if(cljs.core.truth_(inst_11015__$1)){
var statearr_11134_11201 = state_11061__$1;
(statearr_11134_11201[(1)] = (41));

} else {
var statearr_11135_11202 = state_11061__$1;
(statearr_11135_11202[(1)] = (42));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (30))){
var inst_10993 = (state_11061[(27)]);
var state_11061__$1 = state_11061;
var statearr_11136_11203 = state_11061__$1;
(statearr_11136_11203[(2)] = inst_10993);

(statearr_11136_11203[(1)] = (31));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (10))){
var inst_10941 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11137_11204 = state_11061__$1;
(statearr_11137_11204[(2)] = inst_10941);

(statearr_11137_11204[(1)] = (9));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (18))){
var inst_10961 = (state_11061[(25)]);
var state_11061__$1 = state_11061;
var statearr_11138_11205 = state_11061__$1;
(statearr_11138_11205[(2)] = inst_10961);

(statearr_11138_11205[(1)] = (19));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (42))){
var inst_11015 = (state_11061[(28)]);
var state_11061__$1 = state_11061;
var statearr_11139_11206 = state_11061__$1;
(statearr_11139_11206[(2)] = inst_11015);

(statearr_11139_11206[(1)] = (43));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (37))){
var inst_10951 = (state_11061[(7)]);
var inst_11013 = (state_11061[(2)]);
var state_11061__$1 = (function (){var statearr_11140 = state_11061;
(statearr_11140[(29)] = inst_11013);

return statearr_11140;
})();
if(cljs.core.truth_(inst_10951)){
var statearr_11141_11207 = state_11061__$1;
(statearr_11141_11207[(1)] = (38));

} else {
var statearr_11142_11208 = state_11061__$1;
(statearr_11142_11208[(1)] = (39));

}

return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (8))){
var inst_10943 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_10944 = [cljs.core.cst$kw$failure];
var inst_10945 = ["App lost focus. Skipping poll."];
var inst_10946 = cljs.core.PersistentHashMap.fromArrays(inst_10944,inst_10945);
var inst_10947 = [false,inst_10946];
var inst_10948 = (new cljs.core.PersistentVector(null,2,(5),inst_10943,inst_10947,null));
var state_11061__$1 = state_11061;
var statearr_11143_11209 = state_11061__$1;
(statearr_11143_11209[(2)] = inst_10948);

(statearr_11143_11209[(1)] = (9));


return cljs.core.cst$kw$recur;
} else {
if((state_val_11062 === (49))){
var inst_11046 = (state_11061[(2)]);
var state_11061__$1 = state_11061;
var statearr_11144_11210 = state_11061__$1;
(statearr_11144_11210[(2)] = inst_11046);

(statearr_11144_11210[(1)] = (13));


return cljs.core.cst$kw$recur;
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});
return (function() {
var omgnata$core$long_poller_$_state_machine__8772__auto__ = null;
var omgnata$core$long_poller_$_state_machine__8772__auto____0 = (function (){
var statearr_11145 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_11145[(0)] = omgnata$core$long_poller_$_state_machine__8772__auto__);

(statearr_11145[(1)] = (1));

return statearr_11145;
});
var omgnata$core$long_poller_$_state_machine__8772__auto____1 = (function (state_11061){
while(true){
var ret_value__8773__auto__ = (function (){try{while(true){
var result__8774__auto__ = switch__8771__auto__(state_11061);
if(cljs.core.keyword_identical_QMARK_(result__8774__auto__,cljs.core.cst$kw$recur)){
continue;
} else {
return result__8774__auto__;
}
break;
}
}catch (e11146){if((e11146 instanceof Object)){
var ex__8775__auto__ = e11146;
var statearr_11147_11211 = state_11061;
(statearr_11147_11211[(5)] = ex__8775__auto__);


cljs.core.async.impl.ioc_helpers.process_exception(state_11061);

return cljs.core.cst$kw$recur;
} else {
throw e11146;

}
}})();
if(cljs.core.keyword_identical_QMARK_(ret_value__8773__auto__,cljs.core.cst$kw$recur)){
var G__11212 = state_11061;
state_11061 = G__11212;
continue;
} else {
return ret_value__8773__auto__;
}
break;
}
});
omgnata$core$long_poller_$_state_machine__8772__auto__ = function(state_11061){
switch(arguments.length){
case 0:
return omgnata$core$long_poller_$_state_machine__8772__auto____0.call(this);
case 1:
return omgnata$core$long_poller_$_state_machine__8772__auto____1.call(this,state_11061);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
omgnata$core$long_poller_$_state_machine__8772__auto__.cljs$core$IFn$_invoke$arity$0 = omgnata$core$long_poller_$_state_machine__8772__auto____0;
omgnata$core$long_poller_$_state_machine__8772__auto__.cljs$core$IFn$_invoke$arity$1 = omgnata$core$long_poller_$_state_machine__8772__auto____1;
return omgnata$core$long_poller_$_state_machine__8772__auto__;
})()
})();
var state__8880__auto__ = (function (){var statearr_11148 = (f__8879__auto__.cljs$core$IFn$_invoke$arity$0 ? f__8879__auto__.cljs$core$IFn$_invoke$arity$0() : f__8879__auto__.call(null));
(statearr_11148[(6)] = c__8878__auto__);

return statearr_11148;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped(state__8880__auto__);
}));

return c__8878__auto__;
});
/**
 * When the user clicks a checkbox, update the state.
 */
omgnata.core.checkbox_handler = (function omgnata$core$checkbox_handler(todos,fname,todo){
return omgnata.core.update_file(fname,omgnata.core.reassemble_todos((function (){var fexpr__11215 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11213_SHARP_){
return omgnata.core.re_compute_indices(cljs.core.update_in.cljs$core$IFn$_invoke$arity$3(p1__11213_SHARP_,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname,(function (){var G__11216 = cljs.core.cst$kw$index;
return (todo.cljs$core$IFn$_invoke$arity$1 ? todo.cljs$core$IFn$_invoke$arity$1(G__11216) : todo.call(null,G__11216));
})(),cljs.core.cst$kw$checked], null),cljs.core.not),fname);
}));
return (fexpr__11215.cljs$core$IFn$_invoke$arity$1 ? fexpr__11215.cljs$core$IFn$_invoke$arity$1(fname) : fexpr__11215.call(null,fname));
})()));
});
omgnata.core.delete_item_handler = (function omgnata$core$delete_item_handler(todos,fname,todo){
return omgnata.core.update_file(fname,omgnata.core.reassemble_todos((function (){var fexpr__11218 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11217_SHARP_){
return omgnata.core.re_compute_indices(omgnata.core.remove_item(p1__11217_SHARP_,fname,todo),fname);
}));
return (fexpr__11218.cljs$core$IFn$_invoke$arity$1 ? fexpr__11218.cljs$core$IFn$_invoke$arity$1(fname) : fexpr__11218.call(null,fname));
})()));
});
omgnata.core.delete_completed_handler = (function omgnata$core$delete_completed_handler(todos,fname){
return omgnata.core.update_file(fname,omgnata.core.reassemble_todos((function (){var fexpr__11220 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11219_SHARP_){
return omgnata.core.re_compute_indices(omgnata.core.remove_completed(p1__11219_SHARP_,fname),fname);
}));
return (fexpr__11220.cljs$core$IFn$_invoke$arity$1 ? fexpr__11220.cljs$core$IFn$_invoke$arity$1(fname) : fexpr__11220.call(null,fname));
})()));
});
omgnata.core.update_item_handler = (function omgnata$core$update_item_handler(todos,fname,todo,item_title){
return omgnata.core.update_file(fname,omgnata.core.reassemble_todos((function (){var fexpr__11223 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11221_SHARP_){
return omgnata.core.re_compute_indices(cljs.core.assoc_in(p1__11221_SHARP_,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname,(function (){var G__11224 = cljs.core.cst$kw$index;
return (todo.cljs$core$IFn$_invoke$arity$1 ? todo.cljs$core$IFn$_invoke$arity$1(G__11224) : todo.call(null,G__11224));
})(),cljs.core.cst$kw$title], null),cljs.core.deref(item_title)),fname);
}));
return (fexpr__11223.cljs$core$IFn$_invoke$arity$1 ? fexpr__11223.cljs$core$IFn$_invoke$arity$1(fname) : fexpr__11223.call(null,fname));
})()));
});
omgnata.core.add_todo_item_handler = (function omgnata$core$add_todo_item_handler(todos,fname,new_item_title){
var todo_list_11227 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(todos),fname);
var first_matched_11228 = omgnata.core.get_index_of(todo_list_11227,cljs.core.cst$kw$matched,true);
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["first-matched",first_matched_11228], 0));

omgnata.core.update_file(fname,omgnata.core.reassemble_todos((function (){var fexpr__11226 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11225_SHARP_){
return omgnata.core.re_compute_indices(cljs.core.assoc_in(p1__11225_SHARP_,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [fname], null),omgnata.core.insert_at(todo_list_11227,((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(omgnata.core.get_index_of(todo_list_11227,cljs.core.cst$kw$matched,false),(0)))?(1):(0)),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [cljs.core.cst$kw$title,cljs.core.deref(new_item_title),cljs.core.cst$kw$checked,false,cljs.core.cst$kw$matched,true], null)], null))),fname);
}));
return (fexpr__11226.cljs$core$IFn$_invoke$arity$1 ? fexpr__11226.cljs$core$IFn$_invoke$arity$1(fname) : fexpr__11226.call(null,fname));
})()));

return cljs.core.reset_BANG_(new_item_title,"");
});
omgnata.core.finished_sorting_handler = (function omgnata$core$finished_sorting_handler(todos,filename,ev){
if(cljs.core.truth_((function (){var and__5043__auto__ = (ev["oldIndex"]);
if(cljs.core.truth_(and__5043__auto__)){
return (ev["newIndex"]);
} else {
return and__5043__auto__;
}
})())){
var old_idx_11231 = (ev["oldIndex"]);
var new_idx_11232 = (ev["newIndex"]);
var el_11233 = ev.item;
var data_index_11234 = (el_11233.getAttribute("data-index") | (0));
var todo_list_11235 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(todos),filename);
var start_index_11236 = omgnata.core.get_index_of(todo_list_11235,cljs.core.cst$kw$index,data_index_11234);
var difference_11237 = (new_idx_11232 - old_idx_11231);
var destination_index_11238 = (start_index_11236 + difference_11237);
omgnata.core.update_file(filename,omgnata.core.reassemble_todos((function (){var fexpr__11230 = cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(todos,(function (p1__11229_SHARP_){
return omgnata.core.re_compute_indices(cljs.core.assoc_in(p1__11229_SHARP_,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [filename], null),omgnata.core.re_order_todo_list(todo_list_11235,start_index_11236,destination_index_11238)),filename);
}));
return (fexpr__11230.cljs$core$IFn$_invoke$arity$1 ? fexpr__11230.cljs$core$IFn$_invoke$arity$1(filename) : fexpr__11230.call(null,filename));
})()));

return true;
} else {
return null;
}
});
omgnata.core.apply_sortable = (function omgnata$core$apply_sortable(todos,filename,this$){
console.log("Sortable wrapping.");

if(cljs.core.truth_(cljs.core.deref(omgnata.core.sorter))){
(cljs.core.deref(omgnata.core.sorter)["destroy"]).call(cljs.core.deref(omgnata.core.sorter));
} else {
}

return cljs.core.reset_BANG_(omgnata.core.sorter,Sortable.create(reagent.core.dom_node(this$),({"handle": ".handle", "animation": (150), "onEnd": cljs.core.partial.cljs$core$IFn$_invoke$arity$3(omgnata.core.finished_sorting_handler,todos,filename)})));
});
omgnata.core.add_todo_list_handler = (function omgnata$core$add_todo_list_handler(todos,new_item,add_mode){
omgnata.core.update_file(cljs.core.deref(new_item),cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(todos,cljs.core.assoc,cljs.core.deref(new_item),cljs.core.PersistentVector.EMPTY));

cljs.core.reset_BANG_(new_item,"");

return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(add_mode,cljs.core.not);
});
omgnata.core.delete_todo_list_handler = (function omgnata$core$delete_todo_list_handler(todos,fname,_add_mode,ev){
if(cljs.core.truth_(confirm(["Really delete ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fname)," list?"].join('')))){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(todos,cljs.core.dissoc,fname);

omgnata.core.delete_file(fname);
} else {
}

return ev.preventDefault();
});
omgnata.core.switch_to_todo = (function omgnata$core$switch_to_todo(fname,ev){
ev.preventDefault();

secretary.core.dispatch_BANG_(["/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fname)].join(''));

return history.pushState(null,null,["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fname)].join(''));
});
omgnata.core.go_home = (function omgnata$core$go_home(ev){
ev.preventDefault();

secretary.core.dispatch_BANG_("/");

return history.pushState(null,null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(window.location.pathname),cljs.core.str.cljs$core$IFn$_invoke$arity$1(window.location.search)].join(''));
});
omgnata.core.with_focus_wrapper = (function omgnata$core$with_focus_wrapper(){
return cljs.core.with_meta(cljs.core.identity,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$component_DASH_did_DASH_mount,(function (this$){
return omgnata.core.get_focus(this$);
})], null));
});
omgnata.core.component_item_edit = (function omgnata$core$component_item_edit(item_title,edit_mode,item_done_fn){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.with_focus_wrapper(),(function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$textarea$edit_DASH_item_DASH_text,new cljs.core.PersistentArrayMap(null, 5, [cljs.core.cst$kw$value,cljs.core.deref(item_title),cljs.core.cst$kw$placeholder,"Item...",cljs.core.cst$kw$on_DASH_change,(function (p1__11239_SHARP_){
return cljs.core.reset_BANG_(item_title,p1__11239_SHARP_.target.value);
}),cljs.core.cst$kw$on_DASH_key_DASH_down,(function (ev){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(ev.which,(13))){
(item_done_fn.cljs$core$IFn$_invoke$arity$1 ? item_done_fn.cljs$core$IFn$_invoke$arity$1(ev) : item_done_fn.call(null,ev));

return ev.preventDefault();
} else {
return null;
}
}),cljs.core.cst$kw$on_DASH_blur,(function (){
return setTimeout((function (){
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(edit_mode,cljs.core.not);
}),(100));
})], null)], null);
})], null);
});
omgnata.core.component_item_add = (function omgnata$core$component_item_add(item_title,_edit_mode,item_done_fn){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta((function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$textarea$add_DASH_item_DASH_text,new cljs.core.PersistentArrayMap(null, 5, [cljs.core.cst$kw$auto_DASH_focus,true,cljs.core.cst$kw$value,cljs.core.deref(item_title),cljs.core.cst$kw$placeholder,"Item...",cljs.core.cst$kw$on_DASH_change,(function (p1__11240_SHARP_){
return cljs.core.reset_BANG_(item_title,p1__11240_SHARP_.target.value);
}),cljs.core.cst$kw$on_DASH_key_DASH_down,(function (ev){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(ev.which,(13))){
(item_done_fn.cljs$core$IFn$_invoke$arity$1 ? item_done_fn.cljs$core$IFn$_invoke$arity$1(ev) : item_done_fn.call(null,ev));

return ev.preventDefault();
} else {
return null;
}
})], null)], null);
}),new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$component_DASH_did_DASH_update,(function (this$){
var node = reagent.core.dom_node(this$);
var content_length = node.value.length;
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((0),content_length)){
return omgnata.core.get_focus(this$);
} else {
return null;
}
})], null))], null);
});
omgnata.core.component_todo_item = (function omgnata$core$component_todo_item(todos,filename,todo){
var edit_mode = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
var item_title = reagent.core.atom.cljs$core$IFn$_invoke$arity$1((function (){var G__11241 = cljs.core.cst$kw$title;
return (todo.cljs$core$IFn$_invoke$arity$1 ? todo.cljs$core$IFn$_invoke$arity$1(G__11241) : todo.call(null,G__11241));
})());
var item_update_fn = cljs.core.partial.cljs$core$IFn$_invoke$arity$variadic(omgnata.core.update_item_handler,todos,filename,todo,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([item_title], 0));
return (function (idx,todo__$1,parent_add_mode){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li$todo_DASH_line,new cljs.core.PersistentArrayMap(null, 3, [cljs.core.cst$kw$key,(function (){var G__11242 = cljs.core.cst$kw$index;
return (todo__$1.cljs$core$IFn$_invoke$arity$1 ? todo__$1.cljs$core$IFn$_invoke$arity$1(G__11242) : todo__$1.call(null,G__11242));
})(),cljs.core.cst$kw$data_DASH_index,(function (){var G__11243 = cljs.core.cst$kw$index;
return (todo__$1.cljs$core$IFn$_invoke$arity$1 ? todo__$1.cljs$core$IFn$_invoke$arity$1(G__11243) : todo__$1.call(null,G__11243));
})(),cljs.core.cst$kw$class,["oddeven-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.mod(idx,(2)))].join('')], null),(cljs.core.truth_(cljs.core.deref(edit_mode))?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$edit_DASH_mode,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.component_item_edit,item_title,edit_mode,item_update_fn], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i$btn$update_DASH_item_DASH_done,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,item_update_fn,cljs.core.cst$kw$class,"fa fa-check-circle"], null)], null)], null):new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span,cljs.core.PersistentArrayMap.EMPTY,(cljs.core.truth_(cljs.core.deref(parent_add_mode))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i$btn$delete_DASH_item,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,cljs.core.partial.cljs$core$IFn$_invoke$arity$4(omgnata.core.delete_item_handler,todos,filename,todo__$1),cljs.core.cst$kw$class,"fa fa-minus-circle"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$btn$handle$fa_DASH_stack,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-circle fa-stack-2x"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-bars fa-stack-1x fa-inverse"], null)], null)], null)], null):null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i$checkbox$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,cljs.core.partial.cljs$core$IFn$_invoke$arity$4(omgnata.core.checkbox_handler,todos,filename,todo__$1),cljs.core.cst$kw$class,(cljs.core.truth_((function (){var G__11244 = cljs.core.cst$kw$checked;
return (todo__$1.cljs$core$IFn$_invoke$arity$1 ? todo__$1.cljs$core$IFn$_invoke$arity$1(G__11244) : todo__$1.call(null,G__11244));
})())?"fa fa-check-circle":"fa fa-circle")], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$todo_DASH_text,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$on_DASH_double_DASH_click,(function (){
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(edit_mode,cljs.core.not);
})], null),(function (){var G__11245 = cljs.core.cst$kw$title;
return (todo__$1.cljs$core$IFn$_invoke$arity$1 ? todo__$1.cljs$core$IFn$_invoke$arity$1(G__11245) : todo__$1.call(null,G__11245));
})()], null)], null))], null);
});
});
omgnata.core.component_list_of_todos = (function omgnata$core$component_list_of_todos(todos,filename,add_mode){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta((function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$ul,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$key,filename], null),cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2((function (idx,todo){
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.partial.cljs$core$IFn$_invoke$arity$4(omgnata.core.component_todo_item,todos,filename,todo),idx,todo,add_mode], null),new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$key,(function (){var G__11246 = cljs.core.cst$kw$index;
return (todo.cljs$core$IFn$_invoke$arity$1 ? todo.cljs$core$IFn$_invoke$arity$1(G__11246) : todo.call(null,G__11246));
})()], null));
}),cljs.core.filter.cljs$core$IFn$_invoke$arity$2(cljs.core.cst$kw$matched,(function (){var fexpr__11247 = cljs.core.deref(todos);
return (fexpr__11247.cljs$core$IFn$_invoke$arity$1 ? fexpr__11247.cljs$core$IFn$_invoke$arity$1(filename) : fexpr__11247.call(null,filename));
})())))], null);
}),new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$component_DASH_did_DASH_mount,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(omgnata.core.apply_sortable,todos,filename),cljs.core.cst$kw$component_DASH_did_DASH_update,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(omgnata.core.apply_sortable,todos,filename)], null))], null);
});
omgnata.core.todo_page = (function omgnata$core$todo_page(todos,filename){
var add_mode = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
var new_item_title = reagent.core.atom.cljs$core$IFn$_invoke$arity$1("");
var item_done_fn = cljs.core.partial.cljs$core$IFn$_invoke$arity$variadic(omgnata.core.add_todo_item_handler,todos,filename,new_item_title,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([add_mode], 0));
return (function (){
if((cljs.core.deref(omgnata.core.last_timestamp) == null)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div_SHARP_loader,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div], null)], null);
} else {
return new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$todo_DASH_page,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i_SHARP_back$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,omgnata.core.go_home,cljs.core.cst$kw$class,"fa fa-chevron-circle-left"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$h3$list_DASH_title,filename], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span_SHARP_add_DASH_item$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,(function (){
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(add_mode,cljs.core.not);
}),cljs.core.cst$kw$class,"fa fa-stack"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-2x fa-circle"], null)], null),(cljs.core.truth_(cljs.core.deref(add_mode))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-1x fa-times fa-inverse"], null)], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-1x fa-pencil fa-inverse"], null)], null))], null),(cljs.core.truth_((function (){var and__5043__auto__ = cljs.core.deref(add_mode);
if(cljs.core.truth_(and__5043__auto__)){
return (cljs.core.count(cljs.core.filter.cljs$core$IFn$_invoke$arity$2(cljs.core.cst$kw$checked,(function (){var fexpr__11248 = cljs.core.deref(todos);
return (fexpr__11248.cljs$core$IFn$_invoke$arity$1 ? fexpr__11248.cljs$core$IFn$_invoke$arity$1(filename) : fexpr__11248.call(null,filename));
})())) > (0));
} else {
return and__5043__auto__;
}
})())?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i_SHARP_clear_DASH_completed$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(omgnata.core.delete_completed_handler,todos,filename),cljs.core.cst$kw$class,"fa fa-minus-circle"], null)], null):null),(cljs.core.truth_(cljs.core.deref(add_mode))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div_SHARP_add_DASH_item_DASH_container,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.component_item_add,new_item_title,add_mode,item_done_fn], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i_SHARP_add_DASH_item_DASH_done$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,item_done_fn,cljs.core.cst$kw$class,"fa fa-check-circle"], null)], null)], null):null),((((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.count((function (){var fexpr__11249 = cljs.core.deref(todos);
return (fexpr__11249.cljs$core$IFn$_invoke$arity$1 ? fexpr__11249.cljs$core$IFn$_invoke$arity$1(filename) : fexpr__11249.call(null,filename));
})()),(0))) && (cljs.core.not(cljs.core.deref(add_mode)))))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$message,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p,"Use the pencil icon to add a list item."], null)], null):null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.component_list_of_todos,todos,filename,add_mode], null),((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(omgnata.core.last_timestamp),(0)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p$warn,"No server connected."], null):null)], null);
}
});
});
omgnata.core.lists_page = (function omgnata$core$lists_page(todos,timestamps){
var add_mode = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
var new_item = reagent.core.atom.cljs$core$IFn$_invoke$arity$1("");
var update_fn = cljs.core.partial.cljs$core$IFn$_invoke$arity$4(omgnata.core.add_todo_list_handler,todos,new_item,add_mode);
return (function (){
if((cljs.core.deref(omgnata.core.last_timestamp) == null)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div_SHARP_loader,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div], null)], null);
} else {
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div_SHARP_list_DASH_edit_DASH_container,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span_SHARP_add_DASH_list$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,(function (){
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(add_mode,cljs.core.not);
}),cljs.core.cst$kw$class,"fa fa-stack"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-2x fa-circle"], null)], null),(cljs.core.truth_(cljs.core.deref(add_mode))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-1x fa-times fa-inverse"], null)], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$class,"fa fa-stack-1x fa-pencil fa-inverse"], null)], null))], null),(cljs.core.truth_(cljs.core.deref(add_mode))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div_SHARP_add_DASH_item_DASH_container,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$input,new cljs.core.PersistentArrayMap(null, 5, [cljs.core.cst$kw$auto_DASH_focus,true,cljs.core.cst$kw$on_DASH_change,(function (p1__11250_SHARP_){
return cljs.core.reset_BANG_(new_item,p1__11250_SHARP_.target.value);
}),cljs.core.cst$kw$on_DASH_key_DASH_down,(function (p1__11251_SHARP_){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(p1__11251_SHARP_.which,(13))){
return (update_fn.cljs$core$IFn$_invoke$arity$1 ? update_fn.cljs$core$IFn$_invoke$arity$1(p1__11251_SHARP_) : update_fn.call(null,p1__11251_SHARP_));
} else {
return null;
}
}),cljs.core.cst$kw$value,cljs.core.deref(new_item),cljs.core.cst$kw$placeholder,"List name..."], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i_SHARP_add_DASH_item_DASH_done$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,update_fn,cljs.core.cst$kw$class,"fa fa-check-circle"], null)], null)], null):null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$ul,cljs.core.PersistentArrayMap.EMPTY,(((cljs.core.count(cljs.core.deref(todos)) > (0)))?cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2((function (idx,p__11255){
var vec__11256 = p__11255;
var filename = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11256,(0),null);
var todo_list = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11256,(1),null);
var fname = omgnata.core.no_extension(filename);
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li$todo_DASH_link,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$key,filename,cljs.core.cst$kw$class,["oddeven-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.mod(idx,(2)))].join('')], null),(cljs.core.truth_(cljs.core.deref(add_mode))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i$delete_DASH_list$btn,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$on_DASH_click,cljs.core.partial.cljs$core$IFn$_invoke$arity$4(omgnata.core.delete_todo_list_handler,todos,filename,add_mode),cljs.core.cst$kw$class,"fa fa-minus-circle"], null)], null):null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$unchecked_DASH_count,cljs.core.count(cljs.core.filter.cljs$core$IFn$_invoke$arity$2((function (p1__11252_SHARP_){
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((function (){var G__11259 = cljs.core.cst$kw$checked;
return (p1__11252_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__11252_SHARP_.cljs$core$IFn$_invoke$arity$1(G__11259) : p1__11252_SHARP_.call(null,G__11259));
})(),false);
}),todo_list))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$on_DASH_click,cljs.core.partial.cljs$core$IFn$_invoke$arity$2(omgnata.core.switch_to_todo,fname)], null),fname], null)], null);
}),cljs.core.sort.cljs$core$IFn$_invoke$arity$2((function (p1__11254_SHARP_,p2__11253_SHARP_){
return cljs.core.compare((function (){var or__5045__auto__ = (function (){var G__11261 = cljs.core.first(p2__11253_SHARP_);
var fexpr__11260 = cljs.core.deref(timestamps);
return (fexpr__11260.cljs$core$IFn$_invoke$arity$1 ? fexpr__11260.cljs$core$IFn$_invoke$arity$1(G__11261) : fexpr__11260.call(null,G__11261));
})();
if(cljs.core.truth_(or__5045__auto__)){
return or__5045__auto__;
} else {
return Number.MAX_VALUE;
}
})(),(function (){var or__5045__auto__ = (function (){var G__11263 = cljs.core.first(p1__11254_SHARP_);
var fexpr__11262 = cljs.core.deref(timestamps);
return (fexpr__11262.cljs$core$IFn$_invoke$arity$1 ? fexpr__11262.cljs$core$IFn$_invoke$arity$1(G__11263) : fexpr__11262.call(null,G__11263));
})();
if(cljs.core.truth_(or__5045__auto__)){
return or__5045__auto__;
} else {
return Number.MAX_VALUE;
}
})());
}),cljs.core.deref(todos)))):((cljs.core.not(cljs.core.deref(add_mode)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li$message,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p,"You don't have any TODO lists yet."], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p,"You can create lists like 'Shopping' or 'Work' using the pencil icon."], null)], null):null))], null),((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(omgnata.core.last_timestamp),(0)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p$warn,"No server connected."], null):null)], null);
}
});
});
omgnata.core.current_page = (function omgnata$core$current_page(){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [reagent.session.get(cljs.core.cst$kw$current_DASH_page)], null)], null);
});
var action__10739__auto___11268 = (function (params__10740__auto__){
if(cljs.core.map_QMARK_(params__10740__auto__)){
var map__11264 = params__10740__auto__;
var map__11264__$1 = cljs.core.__destructure_map(map__11264);
return reagent.session.put_BANG_(cljs.core.cst$kw$current_DASH_page,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(new cljs.core.Var(function(){return omgnata.core.lists_page;},cljs.core.cst$sym$omgnata$core_SLASH_lists_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$omgnata$core,cljs.core.cst$sym$lists_DASH_page,"/home/chrism/dev/todoMini/src/cljs/omgnata/core.cljs",17,1,421,421,cljs.core.list(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$sym$todos,cljs.core.cst$sym$timestamps], null)),null,(cljs.core.truth_(omgnata.core.lists_page)?omgnata.core.lists_page.cljs$lang$test:null)])),omgnata.core.todo_lists,omgnata.core.todo_timestamps));
} else {
if(cljs.core.vector_QMARK_(params__10740__auto__)){
var vec__11265 = params__10740__auto__;
return reagent.session.put_BANG_(cljs.core.cst$kw$current_DASH_page,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(new cljs.core.Var(function(){return omgnata.core.lists_page;},cljs.core.cst$sym$omgnata$core_SLASH_lists_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$omgnata$core,cljs.core.cst$sym$lists_DASH_page,"/home/chrism/dev/todoMini/src/cljs/omgnata/core.cljs",17,1,421,421,cljs.core.list(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$sym$todos,cljs.core.cst$sym$timestamps], null)),null,(cljs.core.truth_(omgnata.core.lists_page)?omgnata.core.lists_page.cljs$lang$test:null)])),omgnata.core.todo_lists,omgnata.core.todo_timestamps));
} else {
return null;
}
}
});
secretary.core.add_route_BANG_("/",action__10739__auto___11268);

var action__10739__auto___11273 = (function (params__10740__auto__){
if(cljs.core.map_QMARK_(params__10740__auto__)){
var map__11269 = params__10740__auto__;
var map__11269__$1 = cljs.core.__destructure_map(map__11269);
var fname = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__11269__$1,cljs.core.cst$kw$fname);
return reagent.session.put_BANG_(cljs.core.cst$kw$current_DASH_page,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(new cljs.core.Var(function(){return omgnata.core.todo_page;},cljs.core.cst$sym$omgnata$core_SLASH_todo_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$omgnata$core,cljs.core.cst$sym$todo_DASH_page,"/home/chrism/dev/todoMini/src/cljs/omgnata/core.cljs",16,1,396,396,cljs.core.list(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$sym$todos,cljs.core.cst$sym$filename], null)),null,(cljs.core.truth_(omgnata.core.todo_page)?omgnata.core.todo_page.cljs$lang$test:null)])),omgnata.core.todo_lists,fname));
} else {
if(cljs.core.vector_QMARK_(params__10740__auto__)){
var vec__11270 = params__10740__auto__;
var fname = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11270,(0),null);
return reagent.session.put_BANG_(cljs.core.cst$kw$current_DASH_page,cljs.core.partial.cljs$core$IFn$_invoke$arity$3(new cljs.core.Var(function(){return omgnata.core.todo_page;},cljs.core.cst$sym$omgnata$core_SLASH_todo_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$omgnata$core,cljs.core.cst$sym$todo_DASH_page,"/home/chrism/dev/todoMini/src/cljs/omgnata/core.cljs",16,1,396,396,cljs.core.list(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$sym$todos,cljs.core.cst$sym$filename], null)),null,(cljs.core.truth_(omgnata.core.todo_page)?omgnata.core.todo_page.cljs$lang$test:null)])),omgnata.core.todo_lists,fname));
} else {
return null;
}
}
});
secretary.core.add_route_BANG_("/:fname",action__10739__auto___11273);

omgnata.core.hook_browser_navigation_BANG_ = (function omgnata$core$hook_browser_navigation_BANG_(){
var h = (new goog.History());
goog.events.listen(h,goog.history.EventType.NAVIGATE,(function (p1__11274_SHARP_){
return secretary.core.dispatch_BANG_(p1__11274_SHARP_.token);
}));

var G__11275 = h;
G__11275.setEnabled(true);

return G__11275;
});
omgnata.core.hook_focus_watcher_BANG_ = (function omgnata$core$hook_focus_watcher_BANG_(f){
window.addEventListener("blur",(function (){
return cljs.core.reset_BANG_(f,false);
}),false);

return window.addEventListener("focus",(function (){
return cljs.core.reset_BANG_(f,true);
}),false);
});
omgnata.core.long_poller(omgnata.core.todo_lists,omgnata.core.todo_timestamps,cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(omgnata.core.poller_instance,cljs.core.inc));
React.initializeTouchEvents(true);
omgnata.core.mount_root = (function omgnata$core$mount_root(){
return reagent.core.render.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [omgnata.core.current_page], null),document.getElementById("app"));
});
omgnata.core.init_BANG_ = (function omgnata$core$init_BANG_(var_args){
var args__5775__auto__ = [];
var len__5769__auto___11281 = arguments.length;
var i__5770__auto___11282 = (0);
while(true){
if((i__5770__auto___11282 < len__5769__auto___11281)){
args__5775__auto__.push((arguments[i__5770__auto___11282]));

var G__11283 = (i__5770__auto___11282 + (1));
i__5770__auto___11282 = G__11283;
continue;
} else {
}
break;
}

var argseq__5776__auto__ = ((((0) < args__5775__auto__.length))?(new cljs.core.IndexedSeq(args__5775__auto__.slice((0)),(0),null)):null);
return omgnata.core.init_BANG_.cljs$core$IFn$_invoke$arity$variadic(argseq__5776__auto__);
});

(omgnata.core.init_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (p__11277){
var vec__11278 = p__11277;
var prod = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__11278,(0),null);
if(cljs.core.truth_(prod)){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$variadic(omgnata.core.server,cljs.core.assoc,cljs.core.cst$kw$url,"server.php",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.cst$kw$poller_DASH_time,(30)], 0));
} else {
console.log("dev mode");
}

omgnata.core.hook_browser_navigation_BANG_();

omgnata.core.hook_focus_watcher_BANG_(omgnata.core.app_has_focus);

return omgnata.core.mount_root();
}));

(omgnata.core.init_BANG_.cljs$lang$maxFixedArity = (0));

/** @this {Function} */
(omgnata.core.init_BANG_.cljs$lang$applyTo = (function (seq11276){
var self__5755__auto__ = this;
return self__5755__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq11276));
}));

