(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},78317,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(94519),a=e.i(84220);function l(){let[e,l]=(0,r.useState)(null),[c,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{async function e(){try{let e=await fetch("/api/state");if(!e.ok)throw Error("Failed to fetch state");let t=await e.json();l(t),o(!0)}catch{o(!1)}}e();let t=setInterval(e,2e3);return()=>clearInterval(t)},[]);let d=e?.resources.some(e=>"postgres"===e.type)??!1;return(0,t.jsxs)(a.SidebarProvider,{children:[(0,t.jsx)(s.AppSidebar,{connected:c,currentPage:"databases",hasDatabases:d}),(0,t.jsx)(a.SidebarInset,{className:"flex flex-col h-screen border-l border-border",children:(0,t.jsx)("main",{className:"flex-1 overflow-hidden bg-gray-50",children:d?(0,t.jsx)("iframe",{src:"https://__drizzle_gateway.local.spcf.app",className:"w-full h-full border-0",style:{colorScheme:"light"},title:"Database Viewer"}):(0,t.jsx)("div",{className:"p-6",children:(0,t.jsxs)("div",{className:"p-6 rounded-lg bg-card border border-border text-center",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"No databases configured."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Add a postgres block to your specific.hcl to use the database viewer."})]})})})})]})}e.s(["default",()=>l])}]);