import{d as b,r as h,o as w,K as v,b as d,c as s,w as e,aA as n,u as t,bZ as u,f as o,eB as m,cB as k}from"./outputWidgets.0fb707c7.js";import{A,a as g}from"./Text.3ec0a64d.js";import{A as p}from"./index.a2e845fd.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[c]="ff75c4c1-c254-4ff7-a617-1c7f72ed1174",a._sentryDebugIdIdentifier="sentry-dbid-ff75c4c1-c254-4ff7-a617-1c7f72ed1174")}catch{}})();const I=b({__name:"Debugger",setup(a){async function c(){const l=await fetch("/_editor/api/debugger",{method:"GET"});if(!l.ok)throw new Error("Failed to check debugger connection");return await l.json()}async function i(){await fetch("/_editor/api/debugger/vscode-launch",{method:"POST"}),_()}const r=h({connected:!1,port:0,is_launch_json_configured:!1});async function _(){r.value=await c()}let f=null;return w(()=>{f=setInterval(_,1e3)}),v(()=>{f&&clearInterval(f)}),(l,y)=>r.value.connected?(d(),s(t(u),{key:0,disabled:""},{default:e(()=>[n("VSCode connected")]),_:1})):(d(),s(t(k),{key:1},{content:e(()=>[o(t(p),{direction:"vertical"},{default:e(()=>[o(t(A),null,{default:e(()=>[n(" Abstra allows you to connect to your VSCode debugger ")]),_:1}),o(t(g),null,{default:e(()=>[n(" You're not connected ")]),_:1}),r.value.is_launch_json_configured?(d(),s(t(p),{key:0,direction:"vertical"},{default:e(()=>[o(t(g),{style:{"font-size":"24px"},copyable:"",code:""},{default:e(()=>[n(m(r.value.port),1)]),_:1}),o(t(u),{href:"https://docs.abstra.io/debug/vscode",target:"_blank"},{default:e(()=>[n(" Learn how to connect to vscode ")]),_:1})]),_:1})):(d(),s(t(u),{key:1,onClick:i},{default:e(()=>[n("Configure launch.json")]),_:1}))]),_:1})]),default:e(()=>[o(t(u),null,{default:e(()=>[n("Connect to VSCode")]),_:1})]),_:1}))}});export{I as _};
//# sourceMappingURL=Debugger.vue_vue_type_script_setup_true_lang.0be10547.js.map
