import "./cljs_env.js";
goog.provide('nextjournal.clojure_mode.extensions.close_brackets');
var module$node_modules$w3c_keyname$index_cjs=shadow.js.require("module$node_modules$w3c_keyname$index_cjs", {});
var module$node_modules$$codemirror$view$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$view$dist$index_cjs", {});
var module$node_modules$$codemirror$state$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$state$dist$index_cjs", {});
var module$node_modules$$codemirror$text$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$text$dist$index_cjs", {});
nextjournal.clojure_mode.extensions.close_brackets.in_string_QMARK_ = (function nextjournal$clojure_mode$extensions$close_brackets$in_string_QMARK_(state,pos){
var G__58683 = nextjournal.clojure_mode.node.name(nextjournal.clojure_mode.node.tree.cljs$core$IFn$_invoke$arity$2(state,pos));
var fexpr__58682 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["StringContent",null,"String",null], null), null);
return (fexpr__58682.cljs$core$IFn$_invoke$arity$1 ? fexpr__58682.cljs$core$IFn$_invoke$arity$1(G__58683) : fexpr__58682.call(null,G__58683));
});
nextjournal.clojure_mode.extensions.close_brackets.escaped_QMARK_ = (function nextjournal$clojure_mode$extensions$close_brackets$escaped_QMARK_(state,pos){
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("\\",state.doc.slice((function (){var x__4306__auto__ = (0);
var y__4307__auto__ = (pos - (1));
return ((x__4306__auto__ > y__4307__auto__) ? x__4306__auto__ : y__4307__auto__);
})(),pos).toString());
});
nextjournal.clojure_mode.extensions.close_brackets.backspace_backoff = (function nextjournal$clojure_mode$extensions$close_brackets$backspace_backoff(state,from,to){
if(cljs.core.truth_((function (){var and__4221__auto__ = (function (){var G__58684 = nextjournal.clojure_mode.node.node_BAR_(state,(from - (1)));
if((G__58684 == null)){
return null;
} else {
return nextjournal.clojure_mode.util.guard(G__58684,nextjournal.clojure_mode.node.line_comment_QMARK_);
}
})();
if(cljs.core.truth_(and__4221__auto__)){
return (!(clojure.string.blank_QMARK_(nextjournal.clojure_mode.util.line_content_at(state,from))));
} else {
return and__4221__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(from - (1))], null);
} else {
return nextjournal.clojure_mode.util.deletion.cljs$core$IFn$_invoke$arity$2(from,to);
}
});
/**
 * - skips over closing brackets
 * - when deleting an opening bracket of an empty list, removes both brackets
 */
nextjournal.clojure_mode.extensions.close_brackets.handle_backspace = (function nextjournal$clojure_mode$extensions$close_brackets$handle_backspace(p__58685){
var map__58686 = p__58685;
var map__58686__$1 = (((((!((map__58686 == null))))?(((((map__58686.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58686.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58686):map__58686);
var state = map__58686__$1;
var doc = (function (){var obj58689 = map__58686__$1;
var k58690 = "doc";
if((function (){var obj58691 = obj58689;
return (((!((obj58691 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58690,obj58691)));
})()){
return (obj58689[k58690]);
} else {
return undefined;
}
})();
if(cljs.core.truth_((function (){var and__4221__auto__ = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((1),state.selection.ranges.length);
if(and__4221__auto__){
var range = (function (){var obj58696 = (function (){var obj58694 = (function (){var obj58692 = state;
var k58693 = "selection";
if((function (){var obj58698 = obj58692;
return (((!((obj58698 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58693,obj58698)));
})()){
return (obj58692[k58693]);
} else {
return undefined;
}
})();
var k58695 = "ranges";
if((function (){var obj58700 = obj58694;
return (((!((obj58700 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58695,obj58700)));
})()){
return (obj58694[k58695]);
} else {
return undefined;
}
})();
var k58697 = (0);
if((function (){var obj58701 = obj58696;
return (((!((obj58701 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58697,obj58701)));
})()){
return (obj58696[k58697]);
} else {
return undefined;
}
})();
var and__4221__auto____$1 = range.empty;
if(cljs.core.truth_(and__4221__auto____$1)){
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((0),range.from);
} else {
return and__4221__auto____$1;
}
} else {
return and__4221__auto__;
}
})())){
return null;
} else {
return nextjournal.clojure_mode.util.update_ranges.cljs$core$IFn$_invoke$arity$3(state,({"annotations": nextjournal.clojure_mode.util.user_event_annotation("delete")}),(function (p__58702){
var map__58703 = p__58702;
var map__58703__$1 = (((((!((map__58703 == null))))?(((((map__58703.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58703.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58703):map__58703);
var range = map__58703__$1;
var head = (function (){var obj58706 = map__58703__$1;
var k58707 = "head";
if((function (){var obj58708 = obj58706;
return (((!((obj58708 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58707,obj58708)));
})()){
return (obj58706[k58707]);
} else {
return undefined;
}
})();
var empty = (function (){var obj58709 = map__58703__$1;
var k58710 = "empty";
if((function (){var obj58711 = obj58709;
return (((!((obj58711 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58710,obj58711)));
})()){
return (obj58709[k58710]);
} else {
return undefined;
}
})();
var anchor = (function (){var obj58712 = map__58703__$1;
var k58713 = "anchor";
if((function (){var obj58714 = obj58712;
return (((!((obj58714 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58713,obj58714)));
})()){
return (obj58712[k58713]);
} else {
return undefined;
}
})();
var map__58715 = nextjournal.clojure_mode.util.from_to(head,anchor);
var map__58715__$1 = (((((!((map__58715 == null))))?(((((map__58715.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58715.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58715):map__58715);
var range__$1 = map__58715__$1;
var from = (function (){var obj58718 = map__58715__$1;
var k58719 = "from";
if((function (){var obj58721 = obj58718;
return (((!((obj58721 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58719,obj58721)));
})()){
return (obj58718[k58719]);
} else {
return undefined;
}
})();
var to = (function (){var obj58722 = map__58715__$1;
var k58723 = "to";
if((function (){var obj58724 = obj58722;
return (((!((obj58724 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58723,obj58724)));
})()){
return (obj58722[k58723]);
} else {
return undefined;
}
})();
var node_BAR_ = nextjournal.clojure_mode.node.tree.cljs$core$IFn$_invoke$arity$1(state).resolve(from,(-1));
var parent = node_BAR_.parent;
if(cljs.core.truth_((function (){var or__4223__auto__ = cljs.core.not(empty);
if(or__4223__auto__){
return or__4223__auto__;
} else {
var or__4223__auto____$1 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("StringContent",nextjournal.clojure_mode.node.name(nextjournal.clojure_mode.node.tree.cljs$core$IFn$_invoke$arity$3(state,from,(-1))));
if(or__4223__auto____$1){
return or__4223__auto____$1;
} else {
var and__4221__auto__ = parent;
if(cljs.core.truth_(and__4221__auto__)){
return (((!(nextjournal.clojure_mode.node.balanced_QMARK_(parent)))) && (nextjournal.clojure_mode.node.left_edge_QMARK_(node_BAR_)));
} else {
return and__4221__auto__;
}
}
}
})())){
return nextjournal.clojure_mode.util.deletion.cljs$core$IFn$_invoke$arity$2(from,to);
} else {
if(((nextjournal.clojure_mode.node.right_edge_QMARK_(node_BAR_)) && ((from === nextjournal.clojure_mode.node.end(parent))))){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(from - (1))], null);
} else {
if(((((nextjournal.clojure_mode.node.start_edge_QMARK_(node_BAR_)) || (nextjournal.clojure_mode.node.same_edge_QMARK_(node_BAR_)))) && ((nextjournal.clojure_mode.node.start(node_BAR_) === nextjournal.clojure_mode.node.start(parent))))){
if(nextjournal.clojure_mode.node.empty_QMARK_(nextjournal.clojure_mode.node.up(node_BAR_))){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),nextjournal.clojure_mode.node.start(parent),new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [nextjournal.clojure_mode.util.from_to(nextjournal.clojure_mode.node.start(parent),nextjournal.clojure_mode.node.end(parent))], null)], null);
} else {
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),from], null);
}
} else {
return nextjournal.clojure_mode.extensions.close_brackets.backspace_backoff(state,from,to);

}
}
}
}));
}
});
nextjournal.clojure_mode.extensions.close_brackets.coll_pairs = new cljs.core.PersistentArrayMap(null, 4, ["(",")","[","]","{","}","\"","\""], null);
nextjournal.clojure_mode.extensions.close_brackets.handle_open = (function nextjournal$clojure_mode$extensions$close_brackets$handle_open(state,open){
var close = (nextjournal.clojure_mode.extensions.close_brackets.coll_pairs.cljs$core$IFn$_invoke$arity$1 ? nextjournal.clojure_mode.extensions.close_brackets.coll_pairs.cljs$core$IFn$_invoke$arity$1(open) : nextjournal.clojure_mode.extensions.close_brackets.coll_pairs.call(null,open));
return nextjournal.clojure_mode.util.update_ranges.cljs$core$IFn$_invoke$arity$3(state,({"annotations": nextjournal.clojure_mode.util.user_event_annotation("input")}),(function (p__58727){
var map__58728 = p__58727;
var map__58728__$1 = (((((!((map__58728 == null))))?(((((map__58728.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58728.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58728):map__58728);
var from = (function (){var obj58730 = map__58728__$1;
var k58731 = "from";
if((function (){var obj58732 = obj58730;
return (((!((obj58732 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58731,obj58732)));
})()){
return (obj58730[k58731]);
} else {
return undefined;
}
})();
var to = (function (){var obj58733 = map__58728__$1;
var k58734 = "to";
if((function (){var obj58735 = obj58733;
return (((!((obj58735 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58734,obj58735)));
})()){
return (obj58733[k58734]);
} else {
return undefined;
}
})();
var head = (function (){var obj58736 = map__58728__$1;
var k58737 = "head";
if((function (){var obj58738 = obj58736;
return (((!((obj58738 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58737,obj58738)));
})()){
return (obj58736[k58737]);
} else {
return undefined;
}
})();
var anchor = (function (){var obj58739 = map__58728__$1;
var k58740 = "anchor";
if((function (){var obj58741 = obj58739;
return (((!((obj58741 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58740,obj58741)));
})()){
return (obj58739[k58740]);
} else {
return undefined;
}
})();
var empty = (function (){var obj58742 = map__58728__$1;
var k58743 = "empty";
if((function (){var obj58744 = obj58742;
return (((!((obj58744 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58743,obj58744)));
})()){
return (obj58742[k58743]);
} else {
return undefined;
}
})();
if(cljs.core.truth_(nextjournal.clojure_mode.extensions.close_brackets.in_string_QMARK_(state,from))){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(open,"\"")){
return nextjournal.clojure_mode.util.insertion.cljs$core$IFn$_invoke$arity$2(head,"\\\"");
} else {
return nextjournal.clojure_mode.util.insertion.cljs$core$IFn$_invoke$arity$3(from,to,open);
}
} else {
if(nextjournal.clojure_mode.extensions.close_brackets.escaped_QMARK_(state,from)){
return nextjournal.clojure_mode.util.insertion.cljs$core$IFn$_invoke$arity$3(from,to,open);
} else {
if(cljs.core.truth_(empty)){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"insert","insert",1286475395),[open,close].join(''),new cljs.core.Keyword(null,"from","from",1815293044),head], null),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(head + ((open).length))], null);
} else {
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"insert","insert",1286475395),open,new cljs.core.Keyword(null,"from","from",1815293044),from], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"insert","insert",1286475395),close,new cljs.core.Keyword(null,"from","from",1815293044),to], null)], null),new cljs.core.Keyword(null,"from-to","from-to",-640428401),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(anchor + ((open).length)),(head + ((open).length))], null)], null);
}

}
}
}));
});
nextjournal.clojure_mode.extensions.close_brackets.handle_close = (function nextjournal$clojure_mode$extensions$close_brackets$handle_close(state,key_name){
return nextjournal.clojure_mode.util.update_ranges.cljs$core$IFn$_invoke$arity$3(state,({"annotations": nextjournal.clojure_mode.util.user_event_annotation("input")}),(function (p__58745){
var map__58746 = p__58745;
var map__58746__$1 = (((((!((map__58746 == null))))?(((((map__58746.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58746.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58746):map__58746);
var range = map__58746__$1;
var empty = (function (){var obj58748 = map__58746__$1;
var k58749 = "empty";
if((function (){var obj58750 = obj58748;
return (((!((obj58750 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58749,obj58750)));
})()){
return (obj58748[k58749]);
} else {
return undefined;
}
})();
var head = (function (){var obj58751 = map__58746__$1;
var k58752 = "head";
if((function (){var obj58753 = obj58751;
return (((!((obj58753 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58752,obj58753)));
})()){
return (obj58751[k58752]);
} else {
return undefined;
}
})();
var from = (function (){var obj58754 = map__58746__$1;
var k58755 = "from";
if((function (){var obj58756 = obj58754;
return (((!((obj58756 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58755,obj58756)));
})()){
return (obj58754[k58755]);
} else {
return undefined;
}
})();
var to = (function (){var obj58757 = map__58746__$1;
var k58758 = "to";
if((function (){var obj58759 = obj58757;
return (((!((obj58759 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58758,obj58759)));
})()){
return (obj58757[k58758]);
} else {
return undefined;
}
})();
if(cljs.core.truth_((function (){var or__4223__auto__ = nextjournal.clojure_mode.extensions.close_brackets.in_string_QMARK_(state,from);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return nextjournal.clojure_mode.extensions.close_brackets.escaped_QMARK_(state,from);
}
})())){
return nextjournal.clojure_mode.util.insertion.cljs$core$IFn$_invoke$arity$3(from,to,key_name);
} else {
if(cljs.core.truth_(empty)){
var or__4223__auto__ = (function (){var unbalanced = (function (){var G__58760 = nextjournal.clojure_mode.node.tree.cljs$core$IFn$_invoke$arity$3(state,head,(-1));
var G__58760__$1 = (((G__58760 == null))?null:nextjournal.clojure_mode.node.ancestors(G__58760));
var G__58760__$2 = (((G__58760__$1 == null))?null:cljs.core.filter.cljs$core$IFn$_invoke$arity$2(cljs.core.every_pred.cljs$core$IFn$_invoke$arity$2(nextjournal.clojure_mode.node.coll_QMARK_,cljs.core.complement(nextjournal.clojure_mode.node.balanced_QMARK_)),G__58760__$1));
if((G__58760__$2 == null)){
return null;
} else {
return cljs.core.first(G__58760__$2);
}
})();
var closing = (function (){var G__58761 = unbalanced;
var G__58761__$1 = (((G__58761 == null))?null:nextjournal.clojure_mode.node.down(G__58761));
if((G__58761__$1 == null)){
return null;
} else {
return nextjournal.clojure_mode.node.closed_by(G__58761__$1);
}
})();
var pos = (function (){var G__58762 = unbalanced;
if((G__58762 == null)){
return null;
} else {
return nextjournal.clojure_mode.node.end(G__58762);
}
})();
if(cljs.core.truth_((function (){var and__4221__auto__ = closing;
if(cljs.core.truth_(and__4221__auto__)){
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(closing,key_name);
} else {
return and__4221__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),pos,new cljs.core.Keyword(null,"insert","insert",1286475395),closing], null),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(pos + (1))], null);
} else {
return null;
}
})();
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
var or__4223__auto____$1 = (function (){var temp__5753__auto__ = (function (){var temp__5753__auto__ = nextjournal.clojure_mode.node.terminal_cursor(nextjournal.clojure_mode.node.tree.cljs$core$IFn$_invoke$arity$1(state),head,(1));
if(cljs.core.truth_(temp__5753__auto__)){
var cursor = temp__5753__auto__;
while(true){
if(nextjournal.clojure_mode.node.right_edge_type_QMARK_(cursor.type)){
return nextjournal.clojure_mode.node.end(cursor);
} else {
if(cljs.core.truth_(cursor.next())){
continue;
} else {
return null;
}
}
break;
}
} else {
return null;
}
})();
if(cljs.core.truth_(temp__5753__auto__)){
var close_node_end = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),close_node_end], null);
} else {
return null;
}
})();
if(cljs.core.truth_(or__4223__auto____$1)){
return or__4223__auto____$1;
} else {
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),head], null);
}
}
} else {
return null;
}
}
}));
});
nextjournal.clojure_mode.extensions.close_brackets.handle_backspace_cmd = (function nextjournal$clojure_mode$extensions$close_brackets$handle_backspace_cmd(p__58763){
var map__58764 = p__58763;
var map__58764__$1 = (((((!((map__58764 == null))))?(((((map__58764.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58764.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58764):map__58764);
var view = map__58764__$1;
var state = (function (){var obj58766 = map__58764__$1;
var k58767 = "state";
if((function (){var obj58768 = obj58766;
return (((!((obj58768 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58767,obj58768)));
})()){
return (obj58766[k58767]);
} else {
return undefined;
}
})();
return nextjournal.clojure_mode.util.dispatch_some(view,nextjournal.clojure_mode.extensions.close_brackets.handle_backspace(state));
});
nextjournal.clojure_mode.extensions.close_brackets.handle_open_cmd = (function nextjournal$clojure_mode$extensions$close_brackets$handle_open_cmd(key_name){
return (function (p__58769){
var map__58770 = p__58769;
var map__58770__$1 = (((((!((map__58770 == null))))?(((((map__58770.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58770.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58770):map__58770);
var view = map__58770__$1;
var state = (function (){var obj58772 = map__58770__$1;
var k58773 = "state";
if((function (){var obj58774 = obj58772;
return (((!((obj58774 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58773,obj58774)));
})()){
return (obj58772[k58773]);
} else {
return undefined;
}
})();
return nextjournal.clojure_mode.util.dispatch_some(view,nextjournal.clojure_mode.extensions.close_brackets.handle_open(state,key_name));
});
});
nextjournal.clojure_mode.extensions.close_brackets.handle_close_cmd = (function nextjournal$clojure_mode$extensions$close_brackets$handle_close_cmd(key_name){
return (function (p__58775){
var map__58776 = p__58775;
var map__58776__$1 = (((((!((map__58776 == null))))?(((((map__58776.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__58776.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__58776):map__58776);
var view = map__58776__$1;
var state = (function (){var obj58778 = map__58776__$1;
var k58779 = "state";
if((function (){var obj58780 = obj58778;
return (((!((obj58780 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k58779,obj58780)));
})()){
return (obj58778[k58779]);
} else {
return undefined;
}
})();
return nextjournal.clojure_mode.util.dispatch_some(view,nextjournal.clojure_mode.extensions.close_brackets.handle_close(state,key_name));
});
});
nextjournal.clojure_mode.extensions.close_brackets.extension = (function nextjournal$clojure_mode$extensions$close_brackets$extension(){
return module$node_modules$$codemirror$view$dist$index_cjs.keymap.of([({}),({"key":"(","run":nextjournal.clojure_mode.extensions.close_brackets.handle_open_cmd("(")}),({"key":"[","run":nextjournal.clojure_mode.extensions.close_brackets.handle_open_cmd("[")}),({"key":"{","run":nextjournal.clojure_mode.extensions.close_brackets.handle_open_cmd("{")}),({"key":"\"","run":nextjournal.clojure_mode.extensions.close_brackets.handle_open_cmd("\"")}),({"key":")","run":nextjournal.clojure_mode.extensions.close_brackets.handle_close_cmd(")")}),({"key":"]","run":nextjournal.clojure_mode.extensions.close_brackets.handle_close_cmd("]")}),({"key":"}","run":nextjournal.clojure_mode.extensions.close_brackets.handle_close_cmd("}")})]);
});

//# sourceMappingURL=nextjournal.clojure_mode.extensions.close_brackets.js.map
