import {
  findWorkspaceRoot
} from "./chunk-BDW32BZK.js";
import {
  STORM_DEFAULT_HOMEPAGE,
  STORM_DEFAULT_LICENSE
} from "./chunk-2CJNMJST.js";
import {
  __name,
  init_esm_shims
} from "./chunk-BFNZYC5O.js";

// src/utilities/get-default-config.ts
init_esm_shims();
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
var DEFAULT_COLOR_CONFIG = {
  "light": {
    "background": "#fafafa",
    "foreground": "#1d1e22",
    "brand": "#1fb2a6",
    "alternate": "#db2777",
    "help": "#5C4EE5",
    "success": "#087f5b",
    "info": "#0550ae",
    "warning": "#e3b341",
    "danger": "#D8314A",
    "positive": "#22c55e",
    "negative": "#dc2626"
  },
  "dark": {
    "background": "#1d1e22",
    "foreground": "#cbd5e1",
    "brand": "#2dd4bf",
    "alternate": "#db2777",
    "help": "#818cf8",
    "success": "#10b981",
    "info": "#58a6ff",
    "warning": "#f3d371",
    "danger": "#D8314A",
    "positive": "#22c55e",
    "negative": "#dc2626"
  }
};
var getDefaultConfig = /* @__PURE__ */ __name((root) => {
  let license = STORM_DEFAULT_LICENSE;
  let homepage = STORM_DEFAULT_HOMEPAGE;
  let name;
  let namespace;
  let repository;
  const workspaceRoot = findWorkspaceRoot(root);
  if (existsSync(join(workspaceRoot, "package.json"))) {
    const file = readFileSync(join(workspaceRoot, "package.json"), {
      encoding: "utf8"
    });
    if (file) {
      const packageJson = JSON.parse(file);
      if (packageJson.name) {
        name = packageJson.name;
      }
      if (packageJson.namespace) {
        namespace = packageJson.namespace;
      }
      if (packageJson.repository?.url) {
        repository = packageJson.repository?.url;
      }
      if (packageJson.license) {
        license = packageJson.license;
      }
      if (packageJson.homepage) {
        homepage = packageJson.homepage;
      }
    }
  }
  return {
    workspaceRoot,
    name,
    namespace,
    repository,
    license,
    homepage,
    docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
    licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
  };
}, "getDefaultConfig");

export {
  DEFAULT_COLOR_CONFIG,
  getDefaultConfig
};
