import { r as classifyLocalInstall, w as composePs, n as buildComposeOptions, N as deriveLaunchStatus, T as detectRuntime, O as deriveLocalStackState } from './src-CidJbygh.js';
import { g as getState } from './state-fxN45gBp.js';
import { b as listRemoteStatuses } from './endpoints-UdQGgKsR.js';
import { d as detectMigration } from './migration-status-a9KsTKSo.js';
import './chunk-CLZ62Ad-.js';
import 'node:module';
import './provider-constants-DPrj3yBX.js';
import './dist-DOFcG0Zp.js';
import 'node:fs';
import 'node:path';
import 'buffer';
import 'fs';
import 'path';
import 'node:child_process';
import 'node:url';
import 'node:crypto';
import 'events';
import 'node:events';
import 'node:stream';
import 'node:string_decoder';
import 'assert';
import 'zlib';
import 'node:assert';
import 'node:fs/promises';
import 'node:os';

//#region src/routes/splash/+page.server.ts
function parseComposePsServices(stdout) {
	return stdout.split("\n").map((line) => line.trim()).filter(Boolean).flatMap((line) => {
		try {
			const parsed = JSON.parse(line);
			return [{
				service: String(parsed.Service ?? parsed.Name ?? ""),
				state: String(parsed.State ?? ""),
				health: String(parsed.Health ?? "")
			}];
		} catch {
			return [];
		}
	});
}
async function load() {
	const state = getState();
	const installState = classifyLocalInstall(state.stackDir);
	const composeResult = await composePs(buildComposeOptions(state));
	return {
		launchStatus: deriveLaunchStatus({
			local: {
				state: deriveLocalStackState(installState, composeResult.ok ? parseComposePsServices(composeResult.stdout) : []),
				runtime: installState === "not_installed" ? await detectRuntime() : void 0,
				detail: { installState }
			},
			remotes: await listRemoteStatuses()
		}),
		migration: detectMigration(state.homeDir)
	};
}

var _page_server_ts = /*#__PURE__*/Object.freeze({
	__proto__: null,
	load: load
});

const index = 10;
let component_cache;
const component = async () => component_cache ??= (await import('./_page.svelte-D98QHSOI.js')).default;
const server_id = "src/routes/splash/+page.server.ts";
const imports = ["_app/immutable/nodes/10.BzTAm6YU.js","_app/immutable/chunks/BBI__kVO.js","_app/immutable/chunks/xihTtKlq.js"];
const stylesheets = ["_app/immutable/assets/10.C4zN9dGC.css"];
const fonts = [];

export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
//# sourceMappingURL=10-sMfnW6s_.js.map
