import{d as g,G as B,H as D,r as x,J as j,b as e,c as o,F as v,K as y,v as n,L as k,E as w,e as l,I as $,B as m,q as A,w as T,y as _,p as b,N as I,O as C,a as N}from"./registerWidgets.04dc761e.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.4672f205.js";import{_ as H}from"./logo.084e5d7c.js";import{a as J}from"./asyncComputed.e0f43af3.js";import{W as M}from"./workspaces.741b6616.js";import{L}from"./login.29b4c1f1.js";import{D as q}from"./DocsButton.5c9fcb4f.js";import"./activeRecord.57c6bf02.js";const z={class:"sidebar"},U={class:"section-name"},Q=["onClick"],X={class:"item-name"},Y={key:0,class:"tag soon"},Z={key:1,class:"tag beta"},ee={key:2,class:"tag cloud"},oe=g({__name:"Sidebar",setup(a){var p;const c=B(),d=D(),s=x((p=d.name)!=null?p:"forms"),u=j(()=>[{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=r=>{r.unavailable||(c.push(r.path),s.value=r.path)};return(r,h)=>(e(),o("div",z,[(e(!0),o(v,null,y(_(u),i=>(e(),o("div",{key:i.name,class:"section"},[n("span",U,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:ke=>f(t)},[l($,{class:w(["icon",{disabled:t.unavailable,active:s.value===t.path}]),path:t.icon,width:"20",height:"20"},null,8,["class","path"]),n("span",X,k(t.name),1),t.unavailable?(e(),o("span",Y,"SOON")):m("",!0),t.beta?(e(),o("span",Z,"BETA")):m("",!0),t.cloud?(e(),o("span",ee,"CLOUD")):m("",!0),t.warning?(e(),A(G,{key:3,class:"warning",text:t.warning,fixed:!0,top:18,left:18},{default:T(()=>[l($,{path:_(V),fill:"#D35249",width:"20",height:"20"},null,8,["path"])]),_:2},1032,["text"])):m("",!0)],10,Q))),128))]))),128))]))}});const te=b(oe,[["__scopeId","data-v-320e9ff3"]]);const se={},S=a=>(I("data-v-ccfb70ef"),a=a(),C(),a),ae={class:"logo"},ne=S(()=>n("img",{src:H,alt:"Abstra cloud logo"},null,-1)),ce=S(()=>n("span",null," Abstra ",-1)),le=[ne,ce];function re(a,c){return e(),o("div",ae,le)}const ie=b(se,[["render",re],["__scopeId","data-v-ccfb70ef"]]),_e={key:0,class:"login-block"},de={key:1,class:"login-block"},ue=["href"],pe={key:1,class:"button"},he={key:2,class:"login-block"},me=g({__name:"LoginBlock",setup(a){const c=x(!1),{loading:d,result:s,refetch:u}=J(()=>L.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 L.create(h),u())}async function p(){!s.value||(await s.value.delete(),u())}async function r(){!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",_e,"loading...")):_(s)?(e(),o("div",de,[n("a",{class:"button",href:`https://cloud.abstra.io/projects/${_(s).projectId}`,target:"_blank"},"Go to console ",8,ue),c.value?(e(),o("button",pe,"Deploying...")):(e(),o("button",{key:0,class:"button",onClick:r},"Deploy")),n("button",{class:"button",onClick:p},"Logout")])):(e(),o("div",he,[n("button",{class:"button",onClick:f},"Login to deploy")]))}});const be=b(me,[["__scopeId","data-v-d5de8b44"]]),fe=a=>(I("data-v-77e07499"),a=a(),C(),a),ve=fe(()=>n("div",{class:"grow"},null,-1)),ge={class:"workspace"},ye=g({__name:"Workspace",setup(a){return(c,d)=>{const s=N("router-view");return e(),o(v,null,[n("nav",null,[l(ie),ve,l(q),l(be)]),n("div",ge,[l(te,{class:"sidebar"}),l(s)])],64)}}});const je=b(ye,[["__scopeId","data-v-77e07499"]]);export{je as default};
//# sourceMappingURL=Workspace.c200f5ca.js.map
