import "./cljs_env.js";
goog.provide('clojure_eval.keymap');
var module$node_modules$$codemirror$commands$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$commands$dist$index_cjs", {});
/**
 * Updates keys of map when key has value
 */
clojure_eval.keymap.update_some = (function clojure_eval$keymap$update_some(m,updates){
return cljs.core.reduce_kv((function (m__$1,k,f){
var temp__5755__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(m__$1,k);
if((temp__5755__auto__ == null)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(m__$1,k);
} else {
var existing = temp__5755__auto__;
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(m__$1,k,(f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(existing) : f.call(null,existing)));
}
}),m,updates);
});
clojure_eval.keymap.serialize = (function clojure_eval$keymap$serialize(command){
return clojure_eval.keymap.update_some(command,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"run","run",-1821166653),clojure_eval.commands.reverse_index,new cljs.core.Keyword(null,"shift","shift",997140064),clojure_eval.commands.reverse_index], null));
});
clojure_eval.keymap.deserialize = (function clojure_eval$keymap$deserialize(command){
return clojure_eval.keymap.update_some(command,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"run","run",-1821166653),clojure_eval.commands.index,new cljs.core.Keyword(null,"shift","shift",997140064),clojure_eval.commands.index], null));
});
/**
 * Returns a grouped map of bindings for a list of CodeMirror keymap entries
 */
clojure_eval.keymap.group = (function clojure_eval$keymap$group(commands){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (out,p__68432){
var map__68433 = p__68432;
var map__68433__$1 = cljs.core.__destructure_map(map__68433);
var cmd = map__68433__$1;
var run = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__68433__$1,new cljs.core.Keyword(null,"run","run",-1821166653));
return cljs.core.update.cljs$core$IFn$_invoke$arity$4(out,run,cljs.core.fnil.cljs$core$IFn$_invoke$arity$2(cljs.core.conj,cljs.core.PersistentVector.EMPTY),cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cmd,new cljs.core.Keyword(null,"run","run",-1821166653)));
}),cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$2(clojure_eval.keymap.serialize,commands));
});
/**
 * Returns a list of CodeMirror keymap entries for a grouped map of bindings
 */
clojure_eval.keymap.ungroup = (function clojure_eval$keymap$ungroup(commands){
return cljs.core.clj__GT_js(cljs.core.reduce_kv((function (out,k,bindings){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(out,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__68434_SHARP_){
return clojure_eval.keymap.deserialize(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(p1__68434_SHARP_,new cljs.core.Keyword(null,"run","run",-1821166653),k));
}),bindings));
}),cljs.core.PersistentVector.EMPTY,commands));
});
clojure_eval.keymap.builtin_keymap_STAR_ = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"selectAll","selectAll",869127842),new cljs.core.Keyword(null,"cursorLineBoundaryForward","cursorLineBoundaryForward",-1283359997),new cljs.core.Keyword(null,"deleteCharBackward","deleteCharBackward",-618312025),new cljs.core.Keyword(null,"cursorLineBoundaryBackward","cursorLineBoundaryBackward",1373049802),new cljs.core.Keyword(null,"deleteCharForward","deleteCharForward",823474956),new cljs.core.Keyword(null,"cursorGroupBackward","cursorGroupBackward",-1004717331),new cljs.core.Keyword(null,"cursorDocEnd","cursorDocEnd",-1298653903),new cljs.core.Keyword(null,"deleteGroupBackward","deleteGroupBackward",616768113),new cljs.core.Keyword(null,"deleteGroupForward","deleteGroupForward",596007091),new cljs.core.Keyword(null,"cursorPageDown","cursorPageDown",-1143253131),new cljs.core.Keyword(null,"cursorPageUp","cursorPageUp",-716828715),new cljs.core.Keyword(null,"cursorLineEnd","cursorLineEnd",-234219178),new cljs.core.Keyword(null,"cursorGroupForward","cursorGroupForward",1231480632),new cljs.core.Keyword(null,"undoSelection","undoSelection",628691449),new cljs.core.Keyword(null,"splitLine","splitLine",-1338533189),new cljs.core.Keyword(null,"transposeChars","transposeChars",1566260285),new cljs.core.Keyword(null,"cursorDocStart","cursorDocStart",2008312830)],[new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-a"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"End",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectLineBoundaryForward","selectLineBoundaryForward",904508598)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"Backspace"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-h"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"key","key",-1516042587),"Home",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectLineBoundaryBackward","selectLineBoundaryBackward",-1443564123),new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-a"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Cmd-ArrowLeft",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectLineBoundaryBackward","selectLineBoundaryBackward",-1443564123)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"Delete"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-d"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-b",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectGroupBackward","selectGroupBackward",1569543117)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Cmd-ArrowDown",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectDocEnd","selectDocEnd",496449813)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-End",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectDocEnd","selectDocEnd",496449813)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt->"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-Backspace",new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-Backspace"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-Alt-h"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-Delete",new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-Alt-Backspace"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-Delete"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-d"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-ArrowDown",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectPageDown","selectPageDown",226562613)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"PageDown",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectPageDown","selectPageDown",226562613)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-v"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-ArrowUp",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectPageUp","selectPageUp",152840428)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"PageUp",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectPageUp","selectPageUp",152840428)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-v"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Cmd-ArrowRight"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-e",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectLineEnd","selectLineEnd",-1578526086)], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-f",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectGroupForward","selectGroupForward",1344873433)], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-u",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-o"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Ctrl-t"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Cmd-ArrowUp",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectDocStart","selectDocStart",-217268371)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-Home",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"selectDocStart","selectDocStart",-217268371)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mac","mac",-1879391650),"Alt-<"], null)], null)]);
clojure_eval.keymap.paredit_keymap_STAR_ = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"indent","indent",-148200125),new cljs.core.Keyword(null,"nav-left","nav-left",845947876),new cljs.core.Keyword(null,"enter-and-indent","enter-and-indent",-1825406873),new cljs.core.Keyword(null,"selection-grow","selection-grow",1627169352),new cljs.core.Keyword(null,"kill","kill",-12335575),new cljs.core.Keyword(null,"slurp-forward","slurp-forward",-866284566),new cljs.core.Keyword(null,"barf-forward","barf-forward",1278612337),new cljs.core.Keyword(null,"barf-backward","barf-backward",434854195),new cljs.core.Keyword(null,"nav-right","nav-right",591041267),new cljs.core.Keyword(null,"slurp-backward","slurp-backward",-1615745159),new cljs.core.Keyword(null,"unwrap","unwrap",-1399175462),new cljs.core.Keyword(null,"selection-return","selection-return",267226206)],[new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Tab",new cljs.core.Keyword(null,"doc","doc",1913296891),"Indent document (or selection)"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"key","key",-1516042587),"Alt-ArrowLeft",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"nav-select-left","nav-select-left",-1033285138),new cljs.core.Keyword(null,"doc","doc",1913296891),"Move cursor one unit to the left (shift: selects this region)",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Enter",new cljs.core.Keyword(null,"doc","doc",1913296891),"Insert newline and indent"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"doc","doc",1913296891),"Grow selections",new cljs.core.Keyword(null,"key","key",-1516042587),"Alt-ArrowUp"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-1"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"key","key",-1516042587),"Ctrl-k",new cljs.core.Keyword(null,"doc","doc",1913296891),"Remove all forms from cursor to end of line",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"key","key",-1516042587),"Ctrl-ArrowRight",new cljs.core.Keyword(null,"doc","doc",1913296891),"Expand collection to include form to the right",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-Shift-k",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"key","key",-1516042587),"Ctrl-ArrowLeft",new cljs.core.Keyword(null,"doc","doc",1913296891),"Shrink collection forwards by one form",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-Shift-j",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"doc","doc",1913296891),"Shrink collection backwards by one form",new cljs.core.Keyword(null,"key","key",-1516042587),"Ctrl-Alt-ArrowRight"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"key","key",-1516042587),"Alt-ArrowRight",new cljs.core.Keyword(null,"shift","shift",997140064),new cljs.core.Keyword(null,"nav-select-right","nav-select-right",-455278613),new cljs.core.Keyword(null,"doc","doc",1913296891),"Move cursor one unit to the right (shift: selects this region)",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"doc","doc",1913296891),"Grow collection backwards by one form",new cljs.core.Keyword(null,"key","key",-1516042587),"Ctrl-Alt-ArrowLeft",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"key","key",-1516042587),"Alt-s",new cljs.core.Keyword(null,"doc","doc",1913296891),"Lift contents of collection into parent",new cljs.core.Keyword(null,"preventDefault","preventDefault",-1714933772),true], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"doc","doc",1913296891),"Shrink selections",new cljs.core.Keyword(null,"key","key",-1516042587),"Alt-ArrowDown"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key","key",-1516042587),"Mod-2"], null)], null)]);
clojure_eval.keymap.builtin = clojure_eval.keymap.ungroup(clojure_eval.keymap.builtin_keymap_STAR_);
clojure_eval.keymap.paredit = clojure_eval.keymap.ungroup(clojure_eval.keymap.paredit_keymap_STAR_);
clojure_eval.keymap.complete = clojure_eval.keymap.paredit.concat(clojure_eval.keymap.builtin);

//# sourceMappingURL=clojure_eval.keymap.js.map
