{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-markus/src/client/reactive/components/basic/aexpr-graph/aexpr-debugging-utils.js"],"names":["navigateToTimeline","openLocationInBrowser","location","start","line","ch","column","end","lively","files","exists","file","then","openBrowser","undefined","notify","timelineCallback","existingTimelines","document","body","querySelectorAll","length","timeline","parentElement","focus","openComponentInWindow"],"mappings":";;;;;;;;;;;;;;wCAcsBA,mD;;;;;;;;;;;;;;2CAZNC,sD;;;;;;;;AAAT,eAASA,qBAAT,CAA+BC,QAA/B,EAAyC;AAC9C,cAAMC,QAAQ,EAAEC,MAAMF,SAASC,KAAT,CAAeC,IAAf,GAAsB,CAA9B,EAAiCC,IAAIH,SAASC,KAAT,CAAeG,MAApD,EAAd;AACA,cAAMC,MAAM,EAAEH,MAAMF,SAASK,GAAT,CAAaH,IAAb,GAAoB,CAA5B,EAA+BC,IAAIH,SAASK,GAAT,CAAaD,MAAhD,EAAZ;AACAE,eAAOC,KAAP,CAAaC,MAAb,CAAoBR,SAASS,IAA7B,EAAmCC,IAAnC,CAAwCF,UAAU;AAChD,cAAIA,MAAJ,EAAY;AACVF,mBAAOK,WAAP,CAAmBX,SAASS,IAA5B,EAAkC,IAAlC,EAAwC,EAAER,KAAF,EAASI,GAAT,EAAxC,EAAwD,KAAxD,EAA+DO,SAA/D,EAA0E,IAA1E;AACD,WAFD,MAEO;AACLN,mBAAOO,MAAP,CAAc,yBAAyBb,SAASS,IAAhD;AACD;AACF,SAND;AAOD;;;;AAEM,qBAAeX,kBAAf,CAAkCgB,gBAAlC,EAAoD;AACzD,cAAMC,oBAAoBC,SAASC,IAAT,CAAcC,gBAAd,CAA+B,gBAA/B,CAA1B;;AAEA,YAAIH,kBAAkBI,MAAlB,GAA2B,CAA/B,EAAkC;AAChC,gBAAMC,WAAWL,kBAAkB,CAAlB,CAAjB;AACAD,2BAAiBM,QAAjB;AACAA,mBAASC,aAAT,CAAuBC,KAAvB;AACAF,mBAASE,KAAT;AACA;AACD;;AAED,eAAOhB,OAAOiB,qBAAP,CAA6B,gBAA7B,EAA+Cb,IAA/C,CAAoDU,YAAY;AACrEN,2BAAiBM,QAAjB;AACD,SAFM,CAAP;AAGD","file":"aexpr-debugging-utils.js","sourcesContent":["\n\nexport function openLocationInBrowser(location) {\n  const start = { line: location.start.line - 1, ch: location.start.column };\n  const end = { line: location.end.line - 1, ch: location.end.column };\n  lively.files.exists(location.file).then(exists => {\n    if (exists) {\n      lively.openBrowser(location.file, true, { start, end }, false, undefined, true);\n    } else {\n      lively.notify(\"Unable to find file:\" + location.file);\n    }\n  });\n}\n\nexport async function navigateToTimeline(timelineCallback) {\n  const existingTimelines = document.body.querySelectorAll('aexpr-timeline');\n\n  if (existingTimelines.length > 0) {\n    const timeline = existingTimelines[0];\n    timelineCallback(timeline);\n    timeline.parentElement.focus();\n    timeline.focus();\n    return;\n  }\n\n  return lively.openComponentInWindow(\"aexpr-timeline\").then(timeline => {\n    timelineCallback(timeline);\n  });\n}"]}