// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.menu');
goog.require('cljs.core');
goog.require('lt.objs.app');
goog.require('lt.util.dom');
goog.require('lt.objs.platform');
goog.require('lt.util.dom');
goog.require('clojure.string');
goog.require('lt.objs.command');
goog.require('lt.objs.platform');
goog.require('lt.objs.app');
goog.require('clojure.string');
goog.require('lt.objs.keyboard');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.objs.command');
goog.require('lt.objs.keyboard');
lt.objs.menu.remote = require("remote");
lt.objs.menu.Menu = lt.objs.menu.remote.require("menu");
lt.objs.menu.MenuItem = lt.objs.menu.remote.require("menu-item");
lt.objs.menu.menu_item = (function menu_item(opts){var opts__$1 = ((cljs.core.not.call(null,new cljs.core.Keyword(null,"submenu","submenu",3441075985).cljs$core$IFn$_invoke$arity$1(opts)))?opts:cljs.core.assoc.call(null,opts,new cljs.core.Keyword(null,"submenu","submenu",3441075985),lt.objs.menu.submenu.call(null,new cljs.core.Keyword(null,"submenu","submenu",3441075985).cljs$core$IFn$_invoke$arity$1(opts))));var opts2 = (cljs.core.truth_(new cljs.core.Keyword(null,"click","click",1108654330).cljs$core$IFn$_invoke$arity$1(opts__$1))?cljs.core.assoc.call(null,opts__$1,new cljs.core.Keyword(null,"click","click",1108654330),((function (opts__$1){
return (function (){try{var temp__4092__auto__ = new cljs.core.Keyword(null,"click","click",1108654330).cljs$core$IFn$_invoke$arity$1(opts__$1);if(cljs.core.truth_(temp__4092__auto__))
{var func = temp__4092__auto__;return func.call(null);
} else
{return null;
}
}catch (e12430){var e = e12430;return lt.objs.console.error(e);
}});})(opts__$1))
):opts__$1);return (new lt.objs.menu.MenuItem(cljs.core.clj__GT_js.call(null,opts__$1)));
});
lt.objs.menu.submenu = (function submenu(items){var menu = (new lt.objs.menu.Menu());var seq__12437_12443 = cljs.core.seq.call(null,items);var chunk__12439_12444 = null;var count__12440_12445 = 0;var i__12441_12446 = 0;while(true){
if((i__12441_12446 < count__12440_12445))
{var i_12447 = cljs.core._nth.call(null,chunk__12439_12444,i__12441_12446);if(cljs.core.truth_(i_12447))
{menu.append(lt.objs.menu.menu_item.call(null,i_12447));
{
var G__12448 = seq__12437_12443;
var G__12449 = chunk__12439_12444;
var G__12450 = count__12440_12445;
var G__12451 = (i__12441_12446 + 1);
seq__12437_12443 = G__12448;
chunk__12439_12444 = G__12449;
count__12440_12445 = G__12450;
i__12441_12446 = G__12451;
continue;
}
} else
{{
var G__12452 = seq__12437_12443;
var G__12453 = chunk__12439_12444;
var G__12454 = count__12440_12445;
var G__12455 = (i__12441_12446 + 1);
seq__12437_12443 = G__12452;
chunk__12439_12444 = G__12453;
count__12440_12445 = G__12454;
i__12441_12446 = G__12455;
continue;
}
}
} else
{var temp__4092__auto___12456 = cljs.core.seq.call(null,seq__12437_12443);if(temp__4092__auto___12456)
{var seq__12437_12457__$1 = temp__4092__auto___12456;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12437_12457__$1))
{var c__4262__auto___12458 = cljs.core.chunk_first.call(null,seq__12437_12457__$1);{
var G__12459 = cljs.core.chunk_rest.call(null,seq__12437_12457__$1);
var G__12460 = c__4262__auto___12458;
var G__12461 = cljs.core.count.call(null,c__4262__auto___12458);
var G__12462 = 0;
seq__12437_12443 = G__12459;
chunk__12439_12444 = G__12460;
count__12440_12445 = G__12461;
i__12441_12446 = G__12462;
continue;
}
} else
{var i_12463 = cljs.core.first.call(null,seq__12437_12457__$1);if(cljs.core.truth_(i_12463))
{menu.append(lt.objs.menu.menu_item.call(null,i_12463));
{
var G__12464 = cljs.core.next.call(null,seq__12437_12457__$1);
var G__12465 = null;
var G__12466 = 0;
var G__12467 = 0;
seq__12437_12443 = G__12464;
chunk__12439_12444 = G__12465;
count__12440_12445 = G__12466;
i__12441_12446 = G__12467;
continue;
}
} else
{{
var G__12468 = cljs.core.next.call(null,seq__12437_12457__$1);
var G__12469 = null;
var G__12470 = 0;
var G__12471 = 0;
seq__12437_12443 = G__12468;
chunk__12439_12444 = G__12469;
count__12440_12445 = G__12470;
i__12441_12446 = G__12471;
continue;
}
}
}
} else
{}
}
break;
}
return menu;
});
lt.objs.menu.menu = (function menu(items){var menu_instance = (new lt.objs.menu.Menu());var seq__12476_12480 = cljs.core.seq.call(null,items);var chunk__12477_12481 = null;var count__12478_12482 = 0;var i__12479_12483 = 0;while(true){
if((i__12479_12483 < count__12478_12482))
{var i_12484 = cljs.core._nth.call(null,chunk__12477_12481,i__12479_12483);menu_instance.append(lt.objs.menu.menu_item.call(null,i_12484));
{
var G__12485 = seq__12476_12480;
var G__12486 = chunk__12477_12481;
var G__12487 = count__12478_12482;
var G__12488 = (i__12479_12483 + 1);
seq__12476_12480 = G__12485;
chunk__12477_12481 = G__12486;
count__12478_12482 = G__12487;
i__12479_12483 = G__12488;
continue;
}
} else
{var temp__4092__auto___12489 = cljs.core.seq.call(null,seq__12476_12480);if(temp__4092__auto___12489)
{var seq__12476_12490__$1 = temp__4092__auto___12489;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12476_12490__$1))
{var c__4262__auto___12491 = cljs.core.chunk_first.call(null,seq__12476_12490__$1);{
var G__12492 = cljs.core.chunk_rest.call(null,seq__12476_12490__$1);
var G__12493 = c__4262__auto___12491;
var G__12494 = cljs.core.count.call(null,c__4262__auto___12491);
var G__12495 = 0;
seq__12476_12480 = G__12492;
chunk__12477_12481 = G__12493;
count__12478_12482 = G__12494;
i__12479_12483 = G__12495;
continue;
}
} else
{var i_12496 = cljs.core.first.call(null,seq__12476_12490__$1);menu_instance.append(lt.objs.menu.menu_item.call(null,i_12496));
{
var G__12497 = cljs.core.next.call(null,seq__12476_12490__$1);
var G__12498 = null;
var G__12499 = 0;
var G__12500 = 0;
seq__12476_12480 = G__12497;
chunk__12477_12481 = G__12498;
count__12478_12482 = G__12499;
i__12479_12483 = G__12500;
continue;
}
}
} else
{}
}
break;
}
return menu_instance;
});
lt.objs.menu.show_menu = (function show_menu(m){return m.popup(lt.objs.menu.remote.getCurrentWindow());
});
lt.util.dom.on.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"body","body",1016933652)),new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){lt.util.dom.prevent.call(null,e);
lt.util.dom.stop_propagation.call(null,e);
return false;
}));
lt.objs.menu.set_menubar = (function set_menubar(items){var menubar = (new lt.objs.menu.Menu());var seq__12507_12513 = cljs.core.seq.call(null,items);var chunk__12509_12514 = null;var count__12510_12515 = 0;var i__12511_12516 = 0;while(true){
if((i__12511_12516 < count__12510_12515))
{var i_12517 = cljs.core._nth.call(null,chunk__12509_12514,i__12511_12516);if(cljs.core.truth_(i_12517))
{menubar.append(lt.objs.menu.menu_item.call(null,i_12517));
{
var G__12518 = seq__12507_12513;
var G__12519 = chunk__12509_12514;
var G__12520 = count__12510_12515;
var G__12521 = (i__12511_12516 + 1);
seq__12507_12513 = G__12518;
chunk__12509_12514 = G__12519;
count__12510_12515 = G__12520;
i__12511_12516 = G__12521;
continue;
}
} else
{{
var G__12522 = seq__12507_12513;
var G__12523 = chunk__12509_12514;
var G__12524 = count__12510_12515;
var G__12525 = (i__12511_12516 + 1);
seq__12507_12513 = G__12522;
chunk__12509_12514 = G__12523;
count__12510_12515 = G__12524;
i__12511_12516 = G__12525;
continue;
}
}
} else
{var temp__4092__auto___12526 = cljs.core.seq.call(null,seq__12507_12513);if(temp__4092__auto___12526)
{var seq__12507_12527__$1 = temp__4092__auto___12526;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12507_12527__$1))
{var c__4262__auto___12528 = cljs.core.chunk_first.call(null,seq__12507_12527__$1);{
var G__12529 = cljs.core.chunk_rest.call(null,seq__12507_12527__$1);
var G__12530 = c__4262__auto___12528;
var G__12531 = cljs.core.count.call(null,c__4262__auto___12528);
var G__12532 = 0;
seq__12507_12513 = G__12529;
chunk__12509_12514 = G__12530;
count__12510_12515 = G__12531;
i__12511_12516 = G__12532;
continue;
}
} else
{var i_12533 = cljs.core.first.call(null,seq__12507_12527__$1);if(cljs.core.truth_(i_12533))
{menubar.append(lt.objs.menu.menu_item.call(null,i_12533));
{
var G__12534 = cljs.core.next.call(null,seq__12507_12527__$1);
var G__12535 = null;
var G__12536 = 0;
var G__12537 = 0;
seq__12507_12513 = G__12534;
chunk__12509_12514 = G__12535;
count__12510_12515 = G__12536;
i__12511_12516 = G__12537;
continue;
}
} else
{{
var G__12538 = cljs.core.next.call(null,seq__12507_12527__$1);
var G__12539 = null;
var G__12540 = 0;
var G__12541 = 0;
seq__12507_12513 = G__12538;
chunk__12509_12514 = G__12539;
count__12510_12515 = G__12540;
i__12511_12516 = G__12541;
continue;
}
}
}
} else
{}
}
break;
}
return lt.objs.menu.Menu.setApplicationMenu.call(null,menubar);
});
lt.objs.menu.key_mappings = new cljs.core.PersistentArrayMap(null, 4, ["cmd","Command","shift","Shift","ctrl","Control","alt","Alt"], null);
lt.objs.menu.command__GT_menu_binding = (function command__GT_menu_binding(cmd){var ks = cljs.core.first.call(null,lt.objs.keyboard.cmd__GT_current_binding.call(null,cmd));var parts = clojure.string.split.call(null,ks," ");var parts__$1 = (function (){var iter__4231__auto__ = ((function (ks,parts){
return (function iter__12562(s__12563){return (new cljs.core.LazySeq(null,((function (ks,parts){
return (function (){var s__12563__$1 = s__12563;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__12563__$1);if(temp__4092__auto__)
{var s__12563__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__12563__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__12563__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__12565 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__12564 = 0;while(true){
if((i__12564 < size__4230__auto__))
{var part = cljs.core._nth.call(null,c__4229__auto__,i__12564);var ks__$1 = (function (){var iter__4231__auto__ = ((function (i__12564,part,c__4229__auto__,size__4230__auto__,b__12565,s__12563__$2,temp__4092__auto__,ks,parts){
return (function iter__12574(s__12575){return (new cljs.core.LazySeq(null,((function (i__12564,part,c__4229__auto__,size__4230__auto__,b__12565,s__12563__$2,temp__4092__auto__,ks,parts){
return (function (){var s__12575__$1 = s__12575;while(true){
var temp__4092__auto____$1 = cljs.core.seq.call(null,s__12575__$1);if(temp__4092__auto____$1)
{var s__12575__$2 = temp__4092__auto____$1;if(cljs.core.chunked_seq_QMARK_.call(null,s__12575__$2))
{var c__4229__auto____$1 = cljs.core.chunk_first.call(null,s__12575__$2);var size__4230__auto____$1 = cljs.core.count.call(null,c__4229__auto____$1);var b__12577 = cljs.core.chunk_buffer.call(null,size__4230__auto____$1);if((function (){var i__12576 = 0;while(true){
if((i__12576 < size__4230__auto____$1))
{var key = cljs.core._nth.call(null,c__4229__auto____$1,i__12576);cljs.core.chunk_append.call(null,b__12577,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})());
{
var G__12582 = (i__12576 + 1);
i__12576 = G__12582;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12577),iter__12574.call(null,cljs.core.chunk_rest.call(null,s__12575__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12577),null);
}
} else
{var key = cljs.core.first.call(null,s__12575__$2);return cljs.core.cons.call(null,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})(),iter__12574.call(null,cljs.core.rest.call(null,s__12575__$2)));
}
} else
{return null;
}
break;
}
});})(i__12564,part,c__4229__auto__,size__4230__auto__,b__12565,s__12563__$2,temp__4092__auto__,ks,parts))
,null,null));
});})(i__12564,part,c__4229__auto__,size__4230__auto__,b__12565,s__12563__$2,temp__4092__auto__,ks,parts))
;return iter__4231__auto__.call(null,clojure.string.split.call(null,part,"-"));
})();cljs.core.chunk_append.call(null,b__12565,clojure.string.join.call(null,"+",ks__$1));
{
var G__12583 = (i__12564 + 1);
i__12564 = G__12583;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12565),iter__12562.call(null,cljs.core.chunk_rest.call(null,s__12563__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12565),null);
}
} else
{var part = cljs.core.first.call(null,s__12563__$2);var ks__$1 = (function (){var iter__4231__auto__ = ((function (part,s__12563__$2,temp__4092__auto__,ks,parts){
return (function iter__12578(s__12579){return (new cljs.core.LazySeq(null,((function (part,s__12563__$2,temp__4092__auto__,ks,parts){
return (function (){var s__12579__$1 = s__12579;while(true){
var temp__4092__auto____$1 = cljs.core.seq.call(null,s__12579__$1);if(temp__4092__auto____$1)
{var s__12579__$2 = temp__4092__auto____$1;if(cljs.core.chunked_seq_QMARK_.call(null,s__12579__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__12579__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__12581 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__12580 = 0;while(true){
if((i__12580 < size__4230__auto__))
{var key = cljs.core._nth.call(null,c__4229__auto__,i__12580);cljs.core.chunk_append.call(null,b__12581,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})());
{
var G__12584 = (i__12580 + 1);
i__12580 = G__12584;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12581),iter__12578.call(null,cljs.core.chunk_rest.call(null,s__12579__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12581),null);
}
} else
{var key = cljs.core.first.call(null,s__12579__$2);return cljs.core.cons.call(null,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})(),iter__12578.call(null,cljs.core.rest.call(null,s__12579__$2)));
}
} else
{return null;
}
break;
}
});})(part,s__12563__$2,temp__4092__auto__,ks,parts))
,null,null));
});})(part,s__12563__$2,temp__4092__auto__,ks,parts))
;return iter__4231__auto__.call(null,clojure.string.split.call(null,part,"-"));
})();return cljs.core.cons.call(null,clojure.string.join.call(null,"+",ks__$1),iter__12562.call(null,cljs.core.rest.call(null,s__12563__$2)));
}
} else
{return null;
}
break;
}
});})(ks,parts))
,null,null));
});})(ks,parts))
;return iter__4231__auto__.call(null,parts);
})();if((cljs.core.seq.call(null,parts__$1)) && ((!(lt.objs.platform.mac_QMARK_.call(null))) || (cljs.core._EQ_.call(null,cljs.core.count.call(null,parts__$1),1))))
{return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),clojure.string.join.call(null," ",parts__$1)], null);
} else
{return null;
}
});
lt.objs.menu.cmd_item = (function() {
var cmd_item = null;
var cmd_item__2 = (function (label,cmd){return cmd_item.call(null,label,cmd,cljs.core.PersistentArrayMap.EMPTY);
});
var cmd_item__3 = (function (label,cmd,opts){return cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),label,new cljs.core.Keyword(null,"click","click",1108654330),(cljs.core.truth_(new cljs.core.Keyword(null,"role","role",1017410536).cljs$core$IFn$_invoke$arity$1(opts))?null:(function (){return lt.objs.command.exec_BANG_.call(null,cmd);
}))], null),opts,lt.objs.menu.command__GT_menu_binding.call(null,cmd));
});
cmd_item = function(label,cmd,opts){
switch(arguments.length){
case 2:
return cmd_item__2.call(this,label,cmd);
case 3:
return cmd_item__3.call(this,label,cmd,opts);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
cmd_item.cljs$core$IFn$_invoke$arity$2 = cmd_item__2;
cmd_item.cljs$core$IFn$_invoke$arity$3 = cmd_item__3;
return cmd_item;
})()
;
lt.objs.menu.unknown_menu = (function unknown_menu(){return lt.objs.menu.set_menubar.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Light Table",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+H",new cljs.core.Keyword(null,"role","role",1017410536),"hide"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Others",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Alt+H",new cljs.core.Keyword(null,"role","role",1017410536),"hideothers"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Q"], null))], null)], null):null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"undo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Z"], null)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"redo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Shift+Z"], null)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"cut",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+X"], null)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"copy",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+C"], null)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"paste",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+V"], null)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"selectall",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+A"], null))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Window",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Minimize",new cljs.core.Keyword(null,"window.minimize","window.minimize",2477637198),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"minimize",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+M"], null)),lt.objs.menu.cmd_item.call(null,"Close window",new cljs.core.Keyword(null,"window.close","window.close",3118917100),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"close",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+W"], null))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Help",new cljs.core.Keyword(null,"submenu","submenu",3441075985),cljs.core.PersistentVector.EMPTY], null)], null));
});
lt.objs.menu.main_menu = (function main_menu(){return lt.objs.menu.set_menubar.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Light Table",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+H",new cljs.core.Keyword(null,"role","role",1017410536),"hide"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Others",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Alt+H",new cljs.core.Keyword(null,"role","role",1017410536),"hideothers"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Q"], null))], null)], null):null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&File",new cljs.core.Keyword(null,"submenu","submenu",3441075985),cljs.core.into.call(null,new cljs.core.PersistentVector(null, 11, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"New file",new cljs.core.Keyword(null,"new-file","new-file",2344641787)),lt.objs.menu.cmd_item.call(null,"Open file",new cljs.core.Keyword(null,"open-file","open-file",2513650321)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Open folder",new cljs.core.Keyword(null,"click","click",1108654330),(function (){lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592),new cljs.core.Keyword(null,"force","force",1111522909));
return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.add-folder","workspace.add-folder",2772643205));
})], null),lt.objs.menu.cmd_item.call(null,"Open recent workspace",new cljs.core.Keyword(null,"workspace.show-recents","workspace.show-recents",1806500563),cljs.core.PersistentArrayMap.EMPTY),lt.objs.menu.cmd_item.call(null,"Save file",new cljs.core.Keyword(null,"save","save",1017427183)),lt.objs.menu.cmd_item.call(null,"Save file as..",new cljs.core.Keyword(null,"save-as","save-as",2886670836)),lt.objs.menu.cmd_item.call(null,"Close file",new cljs.core.Keyword(null,"tabs.close","tabs.close",4150844154)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Settings",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"User keymap",new cljs.core.Keyword(null,"keymap.modify-user","keymap.modify-user",625546911)),lt.objs.menu.cmd_item.call(null,"User behaviors",new cljs.core.Keyword(null,"behaviors.modify-user","behaviors.modify-user",4216959587)),lt.objs.menu.cmd_item.call(null,"User script",new cljs.core.Keyword(null,"user.modify-user","user.modify-user",581252813))], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"New window",new cljs.core.Keyword(null,"window.new","window.new",2875320852)),lt.objs.menu.cmd_item.call(null,"Close window",new cljs.core.Keyword(null,"window.close","window.close",3118917100))], null),((lt.objs.platform.mac_QMARK_.call(null))?null:new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Control+Q"], null))], null)))], null),((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"undo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Z"], null)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"redo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Shift+Z"], null)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"cut",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+X"], null)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"copy",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+C"], null)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"paste",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+V"], null)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"selectall",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+A"], null))], null)], null):new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883))], null)], null)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&View",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 10, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Workspace",new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592)),lt.objs.menu.cmd_item.call(null,"Connections",new cljs.core.Keyword(null,"show-connect","show-connect",2165693836)),lt.objs.menu.cmd_item.call(null,"Navigator",new cljs.core.Keyword(null,"navigate-workspace-transient","navigate-workspace-transient",615022696)),lt.objs.menu.cmd_item.call(null,"Commands",new cljs.core.Keyword(null,"show-commandbar-transient","show-commandbar-transient",3110127655)),lt.objs.menu.cmd_item.call(null,"Plugin Manager",new cljs.core.Keyword(null,"plugin-manager.show","plugin-manager.show",3752328298)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Language docs",new cljs.core.Keyword(null,"docs.search.show","docs.search.show",4500636610)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Console",new cljs.core.Keyword(null,"toggle-console","toggle-console",4454540112)),lt.objs.menu.cmd_item.call(null,"Developer Tools",new cljs.core.Keyword(null,"dev-inspector","dev-inspector",4263722673))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Window",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Minimize",new cljs.core.Keyword(null,"window.minimize","window.minimize",2477637198)),lt.objs.menu.cmd_item.call(null,"Maximize",new cljs.core.Keyword(null,"window.maximize","window.maximize",4253833852)),lt.objs.menu.cmd_item.call(null,"Fullscreen",new cljs.core.Keyword(null,"window.fullscreen","window.fullscreen",3710835691))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Help",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Documentation",new cljs.core.Keyword(null,"show-docs","show-docs",3358896765)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Report an Issue",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"add-browser-tab","add-browser-tab",3663273910),"https://github.com/LightTable/LightTable/issues?state=open");
})], null),((lt.objs.platform.mac_QMARK_.call(null))?null:lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)))], null)], null)], null));
});
lt.objs.menu.__BEH__create_menu = (function __BEH__create_menu(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{lt.objs.app.win.menu = null;
} else
{}
return lt.objs.menu.main_menu.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","create-menu","lt.objs.menu/create-menu",1707993513),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__create_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"init","init",1017141378),null], null), null));
lt.objs.menu.__BEH__recreate_menu = (function __BEH__recreate_menu(app){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.main_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","recreate-menu","lt.objs.menu/recreate-menu",912131484),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__recreate_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"app.keys.load","app.keys.load",3209213061),null], null), null),new cljs.core.Keyword(null,"debounce","debounce",1556599227),20);
lt.objs.menu.__BEH__set_menu = (function __BEH__set_menu(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.main_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","set-menu","lt.objs.menu/set-menu",4093310231),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__set_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"focus","focus",1111509066),null], null), null));
lt.objs.menu.__BEH__remove_menu_close = (function __BEH__remove_menu_close(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.unknown_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","remove-menu-close","lt.objs.menu/remove-menu-close",1602484750),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__remove_menu_close,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"blur","blur",1016931289),null,new cljs.core.Keyword(null,"closed","closed",3951351006),null], null), null));
lt.objs.menu.__BEH__menu_BANG_ = (function __BEH__menu_BANG_(this$,e){var items_12585 = cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"order","order",1119910592),cljs.core.filter.call(null,cljs.core.identity,lt.object.raise_reduce.call(null,this$,new cljs.core.Keyword(null,"menu+","menu+",1117686302),cljs.core.PersistentVector.EMPTY,e)));lt.objs.menu.show_menu.call(null,lt.objs.menu.menu.call(null,items_12585));
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","menu!","lt.objs.menu/menu!",2137957439),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__menu_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu!","menu!",1117686292),null], null), null));
