import{d as y,r as h,o as w,K as v,b as s,c as d,w as e,aA as a,u as t,b$ as u,f as n,cK as b,eD as k,cG as m}from"./outputWidgets.562826ac.js";import{a as C,b as g}from"./Text.712cfc26.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[c]="77ce6780-5cae-4a77-b54b-3221bc41ea37",o._sentryDebugIdIdentifier="sentry-dbid-77ce6780-5cae-4a77-b54b-3221bc41ea37")}catch{}})();const I=y({__name:"Debugger",setup(o){async function c(){const i=await fetch("/_editor/api/debugger",{method:"GET"});if(!i.ok)throw new Error("Failed to check debugger connection");return await i.json()}async function f(){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 l=null;return w(()=>{l=setInterval(_,1e3)}),v(()=>{l&&clearInterval(l)}),(i,p)=>r.value.connected?(s(),d(t(u),{key:0,disabled:""},{default:e(()=>[a("VSCode connected")]),_:1})):(s(),d(t(m),{key:1},{content:e(()=>[n(t(b),{direction:"vertical"},{default:e(()=>[n(t(C),null,{default:e(()=>[a(" Abstra allows you to connect to your VSCode debugger ")]),_:1}),n(t(g),null,{default:e(()=>[a(" You're not connected ")]),_:1}),r.value.is_launch_json_configured?(s(),d(t(b),{key:0,direction:"vertical"},{default:e(()=>[n(t(g),{style:{"font-size":"24px"},copyable:"",code:""},{default:e(()=>[a(k(r.value.port),1)]),_:1}),n(t(u),{href:"https://docs.abstra.io/debug/vscode",target:"_blank"},{default:e(()=>[a(" Learn how to connect to vscode ")]),_:1})]),_:1})):(s(),d(t(u),{key:1,onClick:f},{default:e(()=>[a("Configure launch.json")]),_:1}))]),_:1})]),default:e(()=>[n(t(u),null,{default:e(()=>[a("Connect to VSCode")]),_:1})]),_:1}))}});export{I as _};
//# sourceMappingURL=Debugger.vue_vue_type_script_setup_true_lang.2a4a526e.js.map
