(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31544,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},12283,e=>{"use strict";var t=e.i(90795),r=e.i(59369);let n=(0,r.createContext)(void 0);function a({children:e}){let[a,s]=(0,r.useState)(null),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,r.useMemo)(()=>(function(){let e=window.location.hostname,t=".local.spcf.app";if("local.spcf.app"===e)return"default";if(e.endsWith(t)){let r=e.slice(0,-t.length);if(r&&!r.includes("."))return r}return null})(),[]),m=(0,r.useMemo)(()=>u?"default"===u?"https://__drizzle_gateway.local.spcf.app":`https://__drizzle_gateway.${u}.local.spcf.app`:null,[u]);(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();s(t),c(!0),l(null)}catch(e){l(e instanceof Error?e.message:"Unknown error"),c(!1)}}e();let t=setInterval(e,2e3);return()=>clearInterval(t)},[]);let d=a?.resources.some(e=>"postgres"===e.type)??!1,h=a?.projectId??null,f=(0,r.useMemo)(()=>({state:a,error:o,connected:i,instanceKey:u,hasDatabases:d,drizzleGatewayUrl:m,projectId:h}),[a,o,i,u,d,m,h]);return(0,t.jsx)(n.Provider,{value:f,children:e})}function s(){let e=(0,r.useContext)(n);if(void 0===e)throw Error("useDevState must be used within a DevStateProvider");return e}e.s(["DevStateProvider",()=>a,"useDevState",()=>s],12283)},70932,e=>{"use strict";var t=e.i(59369),r=(e,t,r,n,a,s,o,l)=>{let i=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&s?a.map(e=>s[e]||e):a;r?(i.classList.remove(...n),i.classList.add(s&&s[t]?s[t]:t)):i.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=o&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},n=["light","dark"],a="(prefers-color-scheme: dark)",s="u"<typeof window,o=t.createContext(void 0),l={setTheme:e=>{},themes:[]},i=()=>{var e;return null!=(e=t.useContext(o))?e:l},c=e=>t.useContext(o)?t.createElement(t.Fragment,null,e.children):t.createElement(m,{...e}),u=["light","dark"],m=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:l=!0,storageKey:i="theme",themes:c=u,defaultTheme:m=s?"system":"light",attribute:y="data-theme",value:v,children:g,nonce:w,scriptProps:b})=>{let[S,T]=t.useState(()=>h(i,m)),[E,C]=t.useState(()=>"system"===S?p():S),k=v?Object.values(v):c,P=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=p());let a=v?v[t]:t,o=r?f(w):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...k),a&&i.classList.add(a)):e.startsWith("data-")&&(a?i.setAttribute(e,a):i.removeAttribute(e))};if(Array.isArray(y)?y.forEach(c):c(y),l){let e=n.includes(m)?m:null,r=n.includes(t)?t:e;i.style.colorScheme=r}null==o||o()},[w]),A=t.useCallback(e=>{let t="function"==typeof e?e(S):e;T(t);try{localStorage.setItem(i,t)}catch(e){}},[S]),_=t.useCallback(t=>{C(p(t)),"system"===S&&s&&!e&&P("system")},[S,e]);t.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),t.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?T(e.newValue):A(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[A]),t.useEffect(()=>{P(null!=e?e:S)},[e,S]);let L=t.useMemo(()=>({theme:S,setTheme:A,forcedTheme:e,resolvedTheme:"system"===S?E:S,themes:s?[...c,"system"]:c,systemTheme:s?E:void 0}),[S,A,e,E,s,c]);return t.createElement(o.Provider,{value:L},t.createElement(d,{forcedTheme:e,storageKey:i,attribute:y,enableSystem:s,enableColorScheme:l,defaultTheme:m,value:v,themes:c,nonce:w,scriptProps:b}),g)},d=t.memo(({forcedTheme:e,storageKey:n,attribute:a,enableSystem:s,enableColorScheme:o,defaultTheme:l,value:i,themes:c,nonce:u,scriptProps:m})=>{let d=JSON.stringify([a,n,l,e,c,i,s,o]).slice(1,-1);return t.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"u"<typeof window?u:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${d})`}})}),h=(e,t)=>{let r;if(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},p=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light");e.s(["ThemeProvider",()=>c,"useTheme",()=>i])}]);