text: goog.provide('cljs.stacktrace');
  if((typeof cljs !== 'undefined') && (typeof cljs.stacktrace !== 'undefined') && (typeof cljs.stacktrace.parse_stacktrace !== 'undefined')){
  } else {
  /**
   * Parse a JavaScript stacktrace string into a canonical data form. The
   *   arguments:
   * 
   *   repl-env - the repl environment, an optional map with :host and :port keys
   *           if the stacktrace includes url, not file references
   *   st       - the original stacktrace string to parse
   *   err      - an error map. :ua-product key defines the type of stacktrace parser
   *           to use, for example :chrome
   *   opts     - additional options. :output-dir maybe given in this argument if
   *           :host and :port do not apply, for example, a file path
   * 
   *   The canonical stacktrace representation can easily be mapped to a
   *   ClojureScript one see mapped-stacktrace and mapped-stacktrace-str
   */
  cljs.stacktrace.parse_stacktrace = (function (){var method_table__4619__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
  var prefer_table__4620__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
  var method_cache__4621__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
  var cached_hierarchy__4622__auto__ = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(cljs.core.PersistentArrayMap.EMPTY);
  var hierarchy__4623__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),(function (){var fexpr__28613 = cljs.core.get_global_hierarchy;
  return (fexpr__28613.cljs$core$IFn$_invoke$arity$0 ? fexpr__28613.cljs$core$IFn$_invoke$arity$0() : fexpr__28613.call(null));
  })());
  return (new cljs.core.MultiFn(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("cljs.stacktrace","parse-stacktrace"),(function (repl_env,st,err,opts){
  return new cljs.core.Keyword(null,"ua-product","ua-product",938384227).cljs$core$IFn$_invoke$arity$1(err);
  }),new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4623__auto__,method_table__4619__auto__,prefer_table__4620__auto__,method_cache__4621__auto__,cached_hierarchy__4622__auto__));
  })();
  }
  cljs.stacktrace.parse_int = (function cljs$stacktrace$parse_int(s){
  return parseInt(s,(10));
  });
  cljs.stacktrace.starts_with_QMARK_ = (function cljs$stacktrace$starts_with_QMARK_(s0,s1){
  return goog.string.startsWith(s0,s1);
  });
  cljs.stacktrace.ends_with_QMARK_ = (function cljs$stacktrace$ends_with_QMARK_(s0,s1){
  return goog.string.endsWith(s0,s1);
  });
  cljs.stacktrace.string__GT_regex = (function cljs$stacktrace$string__GT_regex(s){
  return (new RegExp(s));
  });
  cljs.stacktrace.output_directory = (function cljs$stacktrace$output_directory(opts){
  var or__4126__auto__ = new cljs.core.Keyword(null,"output-dir","output-dir",-290956991).cljs$core$IFn$_invoke$arity$1(opts);
  if(cljs.core.truth_(or__4126__auto__)){
  return or__4126__auto__;
  } else {
  return "out";
  }
  });
  cljs.stacktrace.parse_stacktrace.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"default","default",-1987822328),(function (repl_env,st,err,opts){
  return st;
  }));
  cljs.stacktrace.parse_file_line_column = (function cljs$stacktrace$parse_file_line_column(flc){
  if(cljs.core.not(cljs.core.re_find(/:/,flc))){
  return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [flc,null,null], null);
  } else {
  var xs = clojure.string.split.cljs$core$IFn$_invoke$arity$2(flc,/:/);
  var vec__28658 = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (p__28670,p__28671){
  var vec__28675 = p__28670;
  var pre = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28675,(0),null);
  var post = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28675,(1),null);
  var vec__28679 = p__28671;
  var x = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28679,(0),null);
  var i = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28679,(1),null);
  if((i <= (2))){
  return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [pre,cljs.core.conj.cljs$core$IFn$_invoke$arity$2(post,x)], null);
  } else {
  return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.conj.cljs$core$IFn$_invoke$arity$2(pre,x),post], null);
  }
  }),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.PersistentVector.EMPTY,cljs.core.PersistentVector.EMPTY], null),cljs.core.map.cljs$core$IFn$_invoke$arity$3(cljs.core.vector,xs,cljs.core.range.cljs$core$IFn$_invoke$arity$3(cljs.core.count(xs),(0),(-1))));
  var pre = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28658,(0),null);
  var vec__28661 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28658,(1),null);
  var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28661,(0),null);
  var column = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28661,(1),null);
  var file = clojure.string.join.cljs$core$IFn$_invoke$arity$2(":",pre);
  return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__28690 = file;
  if(cljs.stacktrace.starts_with_QMARK_(file,"(")){
  return clojure.string.replace(G__28690,"(","");
  } else {
  return G__28690;
  }
  })(),cljs.stacktrace.parse_int((function (){var G__28692 = line;
  if(cljs.stacktrace.ends_with_QMARK_(line,")")){
  return clojure.string.replace(G__28692,")","");
  } else {
  return G__28692;
  }
  })()),cljs.stacktrace.parse_int((function (){var G__28693 = column;
  if(cljs.stacktrace.ends_with_QMARK_(column,")")){
  return clojure.string.replace(G__28693,")","");
  } else {
  return G__28693;
  }
  })())], null);
  }
  });
  /**
   * Given a browser file url convert it into a relative path that can be used
   * to locate the original source.
   */
  cljs.stacktrace.parse_file = (function cljs$stacktrace$parse_file(p__28700,file,p__28701){
  var map__28705 = p__28700;
  var map__28705__$1 = (((((!((map__28705 == null))))?(((((map__28705.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__28705.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__28705):map__28705);
  var repl_env = map__28705__$1;
  var host = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28705__$1,new cljs.core.Keyword(null,"host","host",-1558485167));
  var host_port = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28705__$1,new cljs.core.Keyword(null,"host-port","host-port",1956551772));
  var port = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28705__$1,new cljs.core.Keyword(null,"port","port",1534937262));
  var map__28706 = p__28701;
  var map__28706__$1 = (((((!((map__28706 == null))))?(((((map__28706.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__28706.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__28706):map__28706);
  var opts = map__28706__$1;
  var asset_path = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28706__$1,new cljs.core.Keyword(null,"asset-path","asset-path",1500889617));
  var urlpat = (cljs.core.truth_(host)?cljs.stacktrace.string__GT_regex(["http://",cljs.core.str.cljs$core$IFn$_invoke$arity$1(host),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4126__auto__ = host_port;
  if(cljs.core.truth_(or__4126__auto__)){
  return or__4126__auto__;
  } else {
  return port;
  }
  })()),"/"].join('')):"");
  var match = (cljs.core.truth_(host)?cljs.core.re_find(urlpat,file):cljs.core.contains_QMARK_(opts,new cljs.core.Keyword(null,"output-dir","output-dir",-290956991)));
  if(cljs.core.truth_(match)){
  return clojure.string.replace(clojure.string.replace(file,urlpat,""),cljs.stacktrace.string__GT_regex(["^",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4126__auto__ = (function (){var and__4115__auto__ = asset_path;
  if(cljs.core.truth_(and__4115__auto__)){
  return clojure.string.replace(asset_path,/^\//,"");
  } else {
  return and__4115__auto__;
  }
  })();
  if(cljs.core.truth_(or__4126__auto__)){
  return or__4126__auto__;
  } else {
  return cljs.stacktrace.output_directory(opts);
  }
  })()),"/"].join('')),"");
  } else {
  var temp__5733__auto__ = new cljs.core.Keyword(null,"asset-root","asset-root",1771735072).cljs$core$IFn$_invoke$arity$1(opts);
  if(cljs.core.truth_(temp__5733__auto__)){
  var asset_root = temp__5733__auto__;
  return clojure.string.replace(file,asset_root,"");
  } else {
  throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2(["Could not relativize URL ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"parse-stacktrace","parse-stacktrace",-38208461),new cljs.core.Keyword(null,"reason","reason",-2070751759),new cljs.core.Keyword(null,"relativize-url","relativize-url",621482324)], null));
  }
  }
  });
  cljs.stacktrace.chrome_st_el__GT_frame = (function cljs$stacktrace$chrome_st_el__GT_frame(repl_env,st_el,opts){
  var xs = clojure.string.split.cljs$core$IFn$_invoke$arity$2(clojure.string.replace(st_el,/\s+at\s+/,""),/\s+/);
  var vec__28731 = ((((1) === cljs.core.count(xs)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,cljs.core.first(xs)], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.first(xs),cljs.core.last(xs)], null));
  var function$ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28731,(0),null);
  var flc = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28731,(1),null);
  var vec__28734 = cljs.stacktrace.parse_file_line_column(flc);
  var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28734,(0),null);
  var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28734,(1),null);
  var column = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28734,(2),null);
  if(cljs.core.truth_((function (){var and__4115__auto__ = file;
  if(cljs.core.truth_(and__4115__auto__)){
  var and__4115__auto____$1 = function$;
  if(cljs.core.truth_(and__4115__auto____$1)){
  var and__4115__auto____$2 = line;
  if(cljs.core.truth_(and__4115__auto____$2)){
  return column;
  } else {
  return and__4115__auto____$2;
  }
  } else {
  return and__4115__auto____$1;
  }
  } else {
  return and__4115__auto__;
  }
  })())){
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),cljs.stacktrace.parse_file(repl_env,file,opts),new cljs.core.Keyword(null,"function","function",-2127255473),clojure.string.replace(function$,/Object\./,""),new cljs.core.Keyword(null,"line","line",212345235),line,new cljs.core.Keyword(null,"column","column",2078222095),column], null);
  } else {
  if(clojure.string.blank_QMARK_(function$)){
  return null;
  } else {
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),null,new cljs.core.Keyword(null,"function","function",-2127255473),clojure.string.replace(function$,/Object\./,""),new cljs.core.Keyword(null,"line","line",212345235),null,new cljs.core.Keyword(null,"column","column",2078222095),null], null);
  }
  }
  });
  cljs.stacktrace.parse_stacktrace.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"chrome","chrome",1718738387),(function (repl_env,st,err,opts){
  return cljs.core.vec(cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.nil_QMARK_,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__28746_SHARP_){
  return cljs.stacktrace.chrome_st_el__GT_frame(repl_env,p1__28746_SHARP_,opts);
  }),cljs.core.take_while.cljs$core$IFn$_invoke$arity$2((function (p1__28745_SHARP_){
  return (!(cljs.stacktrace.starts_with_QMARK_(p1__28745_SHARP_,"    at eval")));
  }),cljs.core.drop_while.cljs$core$IFn$_invoke$arity$2((function (p1__28744_SHARP_){
  return cljs.stacktrace.starts_with_QMARK_(p1__28744_SHARP_,"Error");
  }),clojure.string.split_lines(st))))));
  }));
  cljs.stacktrace.safari_st_el__GT_frame = (function cljs$stacktrace$safari_st_el__GT_frame(repl_env,st_el,opts){
  var vec__28766 = (cljs.core.truth_(cljs.core.re_find(/@/,st_el))?clojure.string.split.cljs$core$IFn$_invoke$arity$2(st_el,/@/):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,st_el], null));
  var function$ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28766,(0),null);
  var flc = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28766,(1),null);
  var vec__28769 = cljs.stacktrace.parse_file_line_column(flc);
  var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28769,(0),null);
  var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28769,(1),null);
  var column = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28769,(2),null);
  if(cljs.core.truth_((function (){var and__4115__auto__ = file;
  if(cljs.core.truth_(and__4115__auto__)){
  var and__4115__auto____$1 = function$;
  if(cljs.core.truth_(and__4115__auto____$1)){
  var and__4115__auto____$2 = line;
  if(cljs.core.truth_(and__4115__auto____$2)){
  return column;
  } else {
  return and__4115__auto____$2;
  }
  } else {
  return and__4115__auto____$1;
  }
  } else {
  return and__4115__auto__;
  }
  })())){
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),cljs.stacktrace.parse_file(repl_env,file,opts),new cljs.core.Keyword(null,"function","function",-2127255473),clojure.string.trim(function$),new cljs.core.Keyword(null,"line","line",212345235),line,new cljs.core.Keyword(null,"column","column",2078222095),column], null);
  } else {
  if(clojure.string.blank_QMARK_(function$)){
  return null;
  } else {
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),null,new cljs.core.Keyword(null,"function","function",-2127255473),clojure.string.trim(function$),new cljs.core.Keyword(null,"line","line",212345235),null,new cljs.core.Keyword(null,"column","column",2078222095),null], null);
  }
  }
  });
  cljs.stacktrace.parse_stacktrace.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"safari","safari",497115653),(function (repl_env,st,err,opts){
  return cljs.core.vec(cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.nil_QMARK_,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__28795_SHARP_){
  return cljs.stacktrace.safari_st_el__GT_frame(repl_env,p1__28795_SHARP_,opts);
  }),cljs.core.remove.cljs$core$IFn$_invoke$arity$2(clojure.string.blank_QMARK_,cljs.core.take_while.cljs$core$IFn$_invoke$arity$2((function (p1__28794_SHARP_){
  return (!(cljs.stacktrace.starts_with_QMARK_(p1__28794_SHARP_,"eval code")));
  }),cljs.core.drop_while.cljs$core$IFn$_invoke$arity$2((function (p1__28793_SHARP_){
  return cljs.stacktrace.starts_with_QMARK_(p1__28793_SHARP_,"Error");
  }),clojure.string.split_lines(st)))))));
  }));
  cljs.stacktrace.firefox_clean_function = (function cljs$stacktrace$firefox_clean_function(f){
  var f__$1 = f;
  var f__$2 = ((clojure.string.blank_QMARK_(f__$1))?null:((cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(f__$1.indexOf("</"),(-1)))?(function (){var idx = f__$1.indexOf("</");
  return f__$1.substring((idx + (2)));
  })():f__$1
  ));
  return clojure.string.replace(clojure.string.replace(f__$2,/</,""),(new RegExp("\\/")),"");
  });
  cljs.stacktrace.firefox_st_el__GT_frame = (function cljs$stacktrace$firefox_st_el__GT_frame(repl_env,st_el,opts){
  var vec__28810 = (cljs.core.truth_(cljs.core.re_find(/@/,st_el))?clojure.string.split.cljs$core$IFn$_invoke$arity$2(st_el,/@/):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,st_el], null));
  var function$ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28810,(0),null);
  var flc = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28810,(1),null);
  var vec__28813 = cljs.stacktrace.parse_file_line_column(flc);
  var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28813,(0),null);
  var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28813,(1),null);
  var column = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28813,(2),null);
  if(cljs.core.truth_((function (){var and__4115__auto__ = file;
  if(cljs.core.truth_(and__4115__auto__)){
  var and__4115__auto____$1 = function$;
  if(cljs.core.truth_(and__4115__auto____$1)){
  var and__4115__auto____$2 = line;
  if(cljs.core.truth_(and__4115__auto____$2)){
  return column;
  } else {
  return and__4115__auto____$2;
  }
  } else {
  return and__4115__auto____$1;
  }
  } else {
  return and__4115__auto__;
  }
  })())){
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),cljs.stacktrace.parse_file(repl_env,file,opts),new cljs.core.Keyword(null,"function","function",-2127255473),cljs.stacktrace.firefox_clean_function(function$),new cljs.core.Keyword(null,"line","line",212345235),line,new cljs.core.Keyword(null,"column","column",2078222095),column], null);
  } else {
  if(clojure.string.blank_QMARK_(function$)){
  return null;
  } else {
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),null,new cljs.core.Keyword(null,"function","function",-2127255473),cljs.stacktrace.firefox_clean_function(function$),new cljs.core.Keyword(null,"line","line",212345235),null,new cljs.core.Keyword(null,"column","column",2078222095),null], null);
  }
  }
  });
  cljs.stacktrace.parse_stacktrace.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"firefox","firefox",1283768880),(function (repl_env,st,err,opts){
  return cljs.core.vec(cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.nil_QMARK_,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__28834_SHARP_){
  return cljs.stacktrace.firefox_st_el__GT_frame(repl_env,p1__28834_SHARP_,opts);
  }),cljs.core.remove.cljs$core$IFn$_invoke$arity$2(clojure.string.blank_QMARK_,cljs.core.take_while.cljs$core$IFn$_invoke$arity$2((function (p1__28833_SHARP_){
  return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(p1__28833_SHARP_.indexOf("> eval"),(-1));
  }),cljs.core.drop_while.cljs$core$IFn$_invoke$arity$2((function (p1__28832_SHARP_){
  return cljs.stacktrace.starts_with_QMARK_(p1__28832_SHARP_,"Error");
  }),clojure.string.split_lines(st)))))));
  }));
  cljs.stacktrace.parse_stacktrace.cljs$core$IMultiFn$_add_method$arity$3(null,new cljs.core.Keyword(null,"nodejs","nodejs",321212524),(function (repl_env,st,err,p__28856){
  var map__28857 = p__28856;
  var map__28857__$1 = (((((!((map__28857 == null))))?(((((map__28857.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__28857.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__28857):map__28857);
  var opts = map__28857__$1;
  var output_dir = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28857__$1,new cljs.core.Keyword(null,"output-dir","output-dir",-290956991));
  var parse_source_loc_info = (function cljs$stacktrace$parse_source_loc_info(x){
  if(cljs.core.truth_((function (){var and__4115__auto__ = x;
  if(cljs.core.truth_(and__4115__auto__)){
  return (!(clojure.string.blank_QMARK_(x)));
  } else {
  return and__4115__auto__;
  }
  })())){
  return cljs.stacktrace.parse_int(x);
  } else {
  return null;
  }
  });
  var process_frame = (function cljs$stacktrace$process_frame(frame_str){
  if(((clojure.string.blank_QMARK_(frame_str)) || ((cljs.core.re_find(/^\s+at/,frame_str) == null)))){
  return null;
  } else {
  var frame_str__$1 = clojure.string.replace(frame_str,/\s+at\s+/,"");
  if(clojure.string.starts_with_QMARK_(frame_str__$1,"repl:")){
  return null;
  } else {
  var parts = clojure.string.split.cljs$core$IFn$_invoke$arity$2(frame_str__$1,/\s+/);
  var vec__28906 = ((((2) === cljs.core.count(parts)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.first(parts),cljs.core.subs.cljs$core$IFn$_invoke$arity$3(cljs.core.second(parts),(1),(cljs.core.count(cljs.core.second(parts)) - (1)))], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,cljs.core.first(parts)], null));
  var function$ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28906,(0),null);
  var file_AMPERSAND_line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28906,(1),null);
  var vec__28910 = clojure.string.split.cljs$core$IFn$_invoke$arity$2(file_AMPERSAND_line,/:/);
  var file_part = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28910,(0),null);
  var line_part = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28910,(1),null);
  var col_part = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28910,(2),null);
  return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",-1269645878),(cljs.core.truth_(function$)?(function (){var G__28920 = file_part;
  if(cljs.core.truth_(output_dir)){
  return clojure.string.replace(G__28920,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(output_dir),"/"].join(''),"");
  } else {
  return G__28920;
  }
  })():file_part),new cljs.core.Keyword(null,"function","function",-2127255473),function$,new cljs.core.Keyword(null,"line","line",212345235),parse_source_loc_info(line_part),new cljs.core.Keyword(null,"column","column",2078222095),parse_source_loc_info(col_part)], null);
  }
  }
  });
  return cljs.core.vec(cljs.core.remove.cljs$core$IFn$_invoke$arity$2(cljs.core.nil_QMARK_,cljs.core.map.cljs$core$IFn$_invoke$arity$2(process_frame,clojure.string.split.cljs$core$IFn$_invoke$arity$2(st,/\n/))));
  }));
  cljs.stacktrace.remove_ext = (function cljs$stacktrace$remove_ext(file){
  return clojure.string.replace(clojure.string.replace(clojure.string.replace(clojure.string.replace(file,/\.js$/,""),/\.cljs$/,""),/\.cljc$/,""),/\.clj$/,"");
  });
  /**
   * Given a cljs.source-map source map data structure map a generated line
   * and column back to the original line, column, and function called.
   */
  cljs.stacktrace.mapped_line_column_call = (function cljs$stacktrace$mapped_line_column_call(sms,file,line,column){
  var source_map = cljs.core.get.cljs$core$IFn$_invoke$arity$2(sms,cljs.core.symbol.cljs$core$IFn$_invoke$arity$1(clojure.string.replace(cljs.stacktrace.remove_ext(file),"/",".")));
  var get_best_column = (function cljs$stacktrace$mapped_line_column_call_$_get_best_column(columns,column__$1){
  return cljs.core.last((function (){var or__4126__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(columns,cljs.core.last(cljs.core.filter.cljs$core$IFn$_invoke$arity$2((function (p1__28930_SHARP_){
  return (p1__28930_SHARP_ <= (column__$1 - (1)));
  }),cljs.core.sort.cljs$core$IFn$_invoke$arity$1(cljs.core.keys(columns)))));
  if(cljs.core.truth_(or__4126__auto__)){
  return or__4126__auto__;
  } else {
  return cljs.core.second(cljs.core.first(columns));
  }
  })());
  });
  var adjust = (function cljs$stacktrace$mapped_line_column_call_$_adjust(mapped){
  return cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$3((function (p1__28932_SHARP_,p2__28933_SHARP_){
  return (p1__28932_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__28932_SHARP_.cljs$core$IFn$_invoke$arity$1(p2__28933_SHARP_) : p1__28932_SHARP_.call(null,p2__28933_SHARP_));
  }),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.inc,cljs.core.inc,cljs.core.identity], null),mapped));
  });
  var default$ = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [line,column,null], null);
  var temp__5733__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(source_map,(line - (1)));
  if(cljs.core.truth_(temp__5733__auto__)){
  var columns = temp__5733__auto__;
  return adjust(cljs.core.map.cljs$core$IFn$_invoke$arity$2(get_best_column(columns,column),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"line","line",212345235),new cljs.core.Keyword(null,"col","col",-1959363084),new cljs.core.Keyword(null,"name","name",1843675177)], null)));
  } else {
  return default$;
  }
  });
  /**
   * Given opts and a canonicalized JavaScript stacktrace frame, return the
   *   ClojureScript frame.
   */
  cljs.stacktrace.mapped_frame = (function cljs$stacktrace$mapped_frame(p__28968,sms,opts){
  var map__28971 = p__28968;
  var map__28971__$1 = (((((!((map__28971 == null))))?(((((map__28971.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__28971.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__28971):map__28971);
  var function$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28971__$1,new cljs.core.Keyword(null,"function","function",-2127255473));
  var file = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28971__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
  var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28971__$1,new cljs.core.Keyword(null,"line","line",212345235));
  var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__28971__$1,new cljs.core.Keyword(null,"column","column",2078222095));
  var no_source_file_QMARK_ = ((cljs.core.not(file))?true:cljs.stacktrace.starts_with_QMARK_(file,"<"));
  var vec__28978 = ((no_source_file_QMARK_)?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [line,column,null], null):cljs.stacktrace.mapped_line_column_call(sms,file,line,column));
  var line_SINGLEQUOTE_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28978,(0),null);
  var column_SINGLEQUOTE_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28978,(1),null);
  var call = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__28978,(2),null);
  var file_SINGLEQUOTE_ = ((no_source_file_QMARK_)?null:((cljs.stacktrace.ends_with_QMARK_(file,".js"))?[cljs.core.subs.cljs$core$IFn$_invoke$arity$3(file,(0),(cljs.core.count(file) - (3))),".cljs"].join(''):file));
  return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"function","function",-2127255473),function$,new cljs.core.Keyword(null,"call","call",-519999866),call,new cljs.core.Keyword(null,"file","file",-1269645878),((no_source_file_QMARK_)?["NO_SOURCE_FILE",(cljs.core.truth_(file)?[" ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file)].join(''):null)].join(''):file_SINGLEQUOTE_),new cljs.core.Keyword(null,"line","line",212345235),line_SINGLEQUOTE_,new cljs.core.Keyword(null,"column","column",2078222095),column_SINGLEQUOTE_], null);
  });
  /**
   * Given a vector representing the canonicalized JavaScript stacktrace
   * return the ClojureScript stacktrace. The canonical stacktrace must be
   * in the form:
   * 
   *  [{:file <string>
   *    :function <string>
   *    :line <integer>
   *    :column <integer>}*]
   * 
   * :file must be a URL path (without protocol) relative to :output-dir or a
   * identifier delimited by angle brackets. The returned mapped stacktrace will
   * also contain :url entries to the original sources if it can be determined
   * from the classpath.
   */
  cljs.stacktrace.mapped_stacktrace = (function cljs$stacktrace$mapped_stacktrace(var_args){
  var G__28991 = arguments.length;
  switch (G__28991) {
  case 2:
  return cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
  
  break;
  case 3:
  return cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
  
  break;
  default:
  throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
  
  }
  });
  
  (cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$2 = (function (stacktrace,sms){
  return cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$3(stacktrace,sms,null);
  }));
  
  (cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$3 = (function (stacktrace,sms,opts){
  var call__GT_function = (function cljs$stacktrace$call__GT_function(x){
  if(cljs.core.truth_(new cljs.core.Keyword(null,"call","call",-519999866).cljs$core$IFn$_invoke$arity$1(x))){
  return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"function","function",-2127255473)],[new cljs.core.Keyword(null,"call","call",-519999866).cljs$core$IFn$_invoke$arity$1(x)]);
  } else {
  return cljs.core.PersistentArrayMap.EMPTY;
  }
  });
  var call_merge = (function cljs$stacktrace$call_merge(function$,call){
  return cljs.core.merge_with.cljs$core$IFn$_invoke$arity$variadic((function (munged_fn_name,unmunged_call_name){
  if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(munged_fn_name,clojure.string.replace(cljs.core.munge(unmunged_call_name),".","$"))){
  return unmunged_call_name;
  } else {
  return munged_fn_name;
  }
  }),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([function$,call], 0));
  });
  var mapped_frames = cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.memoize((function (p1__28988_SHARP_){
  return cljs.stacktrace.mapped_frame(p1__28988_SHARP_,sms,opts);
  })),stacktrace);
  return cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$3(call_merge,cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__28989_SHARP_){
  return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__28989_SHARP_,new cljs.core.Keyword(null,"call","call",-519999866));
  }),mapped_frames),cljs.core.concat.cljs$core$IFn$_invoke$arity$2(cljs.core.rest(cljs.core.map.cljs$core$IFn$_invoke$arity$2(call__GT_function,mapped_frames)),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.PersistentArrayMap.EMPTY], null))));
  }));
  
  (cljs.stacktrace.mapped_stacktrace.cljs$lang$maxFixedArity = 3);
  
  /**
   * Given a vector representing the canonicalized JavaScript stacktrace and a map
   *   of library names to decoded source maps, print the ClojureScript stacktrace .
   *   See mapped-stacktrace.
   */
  cljs.stacktrace.mapped_stacktrace_str = (function cljs$stacktrace$mapped_stacktrace_str(var_args){
  var G__29004 = arguments.length;
  switch (G__29004) {
  case 2:
  return cljs.stacktrace.mapped_stacktrace_str.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
  
  break;
  case 3:
  return cljs.stacktrace.mapped_stacktrace_str.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
  
  break;
  default:
  throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
  
  }
  });
  
  (cljs.stacktrace.mapped_stacktrace_str.cljs$core$IFn$_invoke$arity$2 = (function (stacktrace,sms){
  return cljs.stacktrace.mapped_stacktrace_str.cljs$core$IFn$_invoke$arity$3(stacktrace,sms,null);
  }));
  
  (cljs.stacktrace.mapped_stacktrace_str.cljs$core$IFn$_invoke$arity$3 = (function (stacktrace,sms,opts){
  var sb__4667__auto__ = (new goog.string.StringBuffer());
  var _STAR_print_newline_STAR__orig_val__29005_29161 = cljs.core._STAR_print_newline_STAR_;
  var _STAR_print_fn_STAR__orig_val__29006_29162 = cljs.core._STAR_print_fn_STAR_;
  var _STAR_print_newline_STAR__temp_val__29007_29163 = true;
  var _STAR_print_fn_STAR__temp_val__29008_29164 = (function (x__4668__auto__){
  return sb__4667__auto__.append(x__4668__auto__);
  });
  (cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__29007_29163);
  
  (cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__29008_29164);
  
  try{var seq__29012_29166 = cljs.core.seq(cljs.stacktrace.mapped_stacktrace.cljs$core$IFn$_invoke$arity$3(stacktrace,sms,opts));
  var chunk__29013_29167 = null;
  var count__29014_29168 = (0);
  var i__29015_29169 = (0);
  while(true){
  if((i__29015_29169 < count__29014_29168)){
  var map__29025_29170 = chunk__29013_29167.cljs$core$IIndexed$_nth$arity$2(null,i__29015_29169);
  var map__29025_29171__$1 = (((((!((map__29025_29170 == null))))?(((((map__29025_29170.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__29025_29170.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__29025_29170):map__29025_29170);
  var function_29172 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29025_29171__$1,new cljs.core.Keyword(null,"function","function",-2127255473));
  var file_29173 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29025_29171__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
  var line_29174 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29025_29171__$1,new cljs.core.Keyword(null,"line","line",212345235));
  var column_29175 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29025_29171__$1,new cljs.core.Keyword(null,"column","column",2078222095));
  cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["\t",[(cljs.core.truth_(function_29172)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(function_29172)," "].join(''):null),"(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file_29173),(cljs.core.truth_(line_29174)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_29174)].join(''):null),(cljs.core.truth_(column_29175)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_29175)].join(''):null),")"].join('')], 0));
  
  
  var G__29183 = seq__29012_29166;
  var G__29184 = chunk__29013_29167;
  var G__29185 = count__29014_29168;
  var G__29186 = (i__29015_29169 + (1));
  seq__29012_29166 = G__29183;
  chunk__29013_29167 = G__29184;
  count__29014_29168 = G__29185;
  i__29015_29169 = G__29186;
  continue;
  } else {
  var temp__5735__auto___29187 = cljs.core.seq(seq__29012_29166);
  if(temp__5735__auto___29187){
  var seq__29012_29188__$1 = temp__5735__auto___29187;
  if(cljs.core.chunked_seq_QMARK_(seq__29012_29188__$1)){
  var c__4556__auto___29189 = cljs.core.chunk_first(seq__29012_29188__$1);
  var G__29190 = cljs.core.chunk_rest(seq__29012_29188__$1);
  var G__29191 = c__4556__auto___29189;
  var G__29192 = cljs.core.count(c__4556__auto___29189);
  var G__29193 = (0);
  seq__29012_29166 = G__29190;
  chunk__29013_29167 = G__29191;
  count__29014_29168 = G__29192;
  i__29015_29169 = G__29193;
  continue;
  } else {
  var map__29034_29194 = cljs.core.first(seq__29012_29188__$1);
  var map__29034_29195__$1 = (((((!((map__29034_29194 == null))))?(((((map__29034_29194.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__29034_29194.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__29034_29194):map__29034_29194);
  var function_29196 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29034_29195__$1,new cljs.core.Keyword(null,"function","function",-2127255473));
  var file_29197 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29034_29195__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
  var line_29198 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29034_29195__$1,new cljs.core.Keyword(null,"line","line",212345235));
  var column_29199 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__29034_29195__$1,new cljs.core.Keyword(null,"column","column",2078222095));
  cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["\t",[(cljs.core.truth_(function_29196)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(function_29196)," "].join(''):null),"(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(file_29197),(cljs.core.truth_(line_29198)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_29198)].join(''):null),(cljs.core.truth_(column_29199)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_29199)].join(''):null),")"].join('')], 0));
  
  
  var G__29202 = cljs.core.next(seq__29012_29188__$1);
  var G__29203 = null;
  var G__29204 = (0);
  var G__29205 = (0);
  seq__29012_29166 = G__29202;
  chunk__29013_29167 = G__29203;
  count__29014_29168 = G__29204;
  i__29015_29169 = G__29205;
  continue;
  }
  } else {
  }
  }
  break;
  }
  }finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__29006_29162);
  
  (cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__29005_29161);
  }
  return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4667__auto__);
  }));
  
  (cljs.stacktrace.mapped_stacktrace_str.cljs$lang$maxFixedArity = 3);
  
  
  //# sourceMappingURL=cljs.stacktrace.js.map
  