import{d as g,G as I,H as S,r as x,J as B,b as e,c as o,F as v,K as y,v as a,L as k,E as w,e as r,I as L,B as b,q as j,w as A,y as _,p as m,N as D,O as T,a as N}from"./registerWidgets.990552e9.js";import{d as O,s as W,w as E,a as F,b as R,c as K,m as P,e as V}from"./icons.d4e872e2.js";import{T as G}from"./Tooltip.9340b3bf.js";import{_ as H}from"./logo.084e5d7c.js";import{a as J}from"./asyncComputed.5a7faf96.js";import{W as M}from"./workspaces.741b6616.js";import{L as $}from"./login.29b4c1f1.js";import"./activeRecord.57c6bf02.js";const q={class:"sidebar"},z={class:"section-name"},U=["onClick"],Q={class:"item-name"},X={key:0,class:"tag soon"},Y={key:1,class:"tag beta"},Z={key:2,class:"tag cloud"},ee=g({__name:"Sidebar",setup(n){var p;const c=I(),d=S(),s=x((p=d.name)!=null?p:"forms"),u=B(()=>[{name:"Runtime",items:[{name:"Forms",icon:O,path:"forms"},{name:"Jobs",icon:W,path:"jobs",cloud:!0},{name:"Hooks",icon:E,path:"hooks"},{name:"Dashes",icon:F,path:"dashes",beta:!0}]},{name:"Resources",items:[{name:"Tables",icon:R,path:"tables",beta:!0}]},{name:"Settings",items:[{name:"Style",icon:K,path:"style"},{name:"Sidebar",icon:P,path:"sidebar"}]}]),f=l=>{l.unavailable||(c.push(l.path),s.value=l.path)};return(l,h)=>(e(),o("div",q,[(e(!0),o(v,null,y(_(u),i=>(e(),o("div",{key:i.name,class:"section"},[a("span",z,k(i.name),1),(e(!0),o(v,null,y(i.items,t=>(e(),o("div",{key:t.name,role:"button",class:w(["item",{active:s.value===t.path,disabled:t.unavailable||i.cloud}]),tabindex:"0",onClick:ve=>f(t)},[r(L,{class:w(["icon",{disabled:t.unavailable,active:s.value===t.path}]),path:t.icon,width:"20",height:"20"},null,8,["class","path"]),a("span",Q,k(t.name),1),t.unavailable?(e(),o("span",X,"SOON")):b("",!0),t.beta?(e(),o("span",Y,"BETA")):b("",!0),t.cloud?(e(),o("span",Z,"CLOUD")):b("",!0),t.warning?(e(),j(G,{key:3,class:"warning",text:t.warning,fixed:!0,top:18,left:18},{default:A(()=>[r(L,{path:_(V),fill:"#D35249",width:"20",height:"20"},null,8,["path"])]),_:2},1032,["text"])):b("",!0)],10,U))),128))]))),128))]))}});const oe=m(ee,[["__scopeId","data-v-320e9ff3"]]);const te={},C=n=>(D("data-v-ccfb70ef"),n=n(),T(),n),se={class:"logo"},ae=C(()=>a("img",{src:H,alt:"Abstra cloud logo"},null,-1)),ne=C(()=>a("span",null," Abstra ",-1)),ce=[ae,ne];function le(n,c){return e(),o("div",se,ce)}const re=m(te,[["render",le],["__scopeId","data-v-ccfb70ef"]]),ie={key:0,class:"login-block"},_e={key:1,class:"login-block"},de=["href"],ue={key:1,class:"button"},pe={key:2,class:"login-block"},he=g({__name:"LoginBlock",setup(n){const c=x(!1),{loading:d,result:s,refetch:u}=J(()=>$.get());async function f(){const h=prompt(`Login to our console at https://cloud.abstra.io and get an API Key to deploy your Projects.

Enter your API Key here:`);!h||(await $.create(h),u())}async function p(){!s.value||(await s.value.delete(),u())}async function l(){!s.value||(c.value=!0,confirm("Are you sure you want to deploy this project to Abstra Cloud?")&&(await M.deploy(),window.open(`https://cloud.abstra.io/projects/${s.value.projectId}/builds`,"_blank")),c.value=!1)}return(h,i)=>_(d)?(e(),o("div",ie,"loading...")):_(s)?(e(),o("div",_e,[a("a",{class:"button",href:`https://cloud.abstra.io/projects/${_(s).projectId}`,target:"_blank"},"Go to console ",8,de),c.value?(e(),o("button",ue,"Deploying...")):(e(),o("button",{key:0,class:"button",onClick:l},"Deploy")),a("button",{class:"button",onClick:p},"Logout")])):(e(),o("div",pe,[a("button",{class:"button",onClick:f},"Login to deploy")]))}});const be=m(he,[["__scopeId","data-v-d5de8b44"]]),me={class:"workspace"},fe=g({__name:"Workspace",setup(n){return(c,d)=>{const s=N("router-view");return e(),o(v,null,[a("nav",null,[r(re),r(be)]),a("div",me,[r(oe,{class:"sidebar"}),r(s)])],64)}}});const Ie=m(fe,[["__scopeId","data-v-91804c74"]]);export{Ie as default};
//# sourceMappingURL=Workspace.b2848ea9.js.map
