"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkI4SIJOYBcjs = require('./chunk-I4SIJOYB.cjs');


var _chunkWSHWZNKFcjs = require('./chunk-WSHWZNKF.cjs');



var _chunkSCFUDB74cjs = require('./chunk-SCFUDB74.cjs');

// src/utilities/get-default-config.ts
_chunkSCFUDB74cjs.init_cjs_shims.call(void 0, );
var _config = require('@storm-software/config');
var _fs = require('fs');
var _promises = require('fs/promises');
var _path = require('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__ */ _chunkSCFUDB74cjs.__name.call(void 0, async (root) => {
  let license = _config.STORM_DEFAULT_LICENSE;
  let homepage = _config.STORM_DEFAULT_HOMEPAGE;
  let name = void 0;
  let namespace = void 0;
  let repository = void 0;
  const workspaceRoot = _chunkI4SIJOYBcjs.findWorkspaceRoot.call(void 0, root);
  if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
    const file = await _promises.readFile.call(void 0, _chunkWSHWZNKFcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
    if (file) {
      const packageJson = JSON.parse(file);
      if (packageJson.name) {
        name = packageJson.name;
      }
      if (packageJson.namespace) {
        namespace = packageJson.namespace;
      }
      if (packageJson.repository) {
        if (typeof packageJson.repository === "string") {
          repository = packageJson.repository;
        } else 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 || _config.STORM_DEFAULT_HOMEPAGE}/docs`,
    licensing: `${homepage || _config.STORM_DEFAULT_HOMEPAGE}/license`
  };
}, "getDefaultConfig");




exports.DEFAULT_COLOR_CONFIG = DEFAULT_COLOR_CONFIG; exports.getDefaultConfig = getDefaultConfig;
