import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  createI18nT
} from "./chunk-L6WHYOLB.js";
import "./chunk-HEANTKSX.js";
import {
  Option,
  createCommand,
  require_commander
} from "./chunk-4CMTZJ25.js";
import "./chunk-MDUBZZTI.js";
import "./chunk-RPTAJN5Y.js";
import "./chunk-QK47PIWK.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-SDLCFZRL.js";
import "./chunk-WGV2XQSB.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-site-old/src/index.ts
init_esm_shims();

// ../cli-site-old/src/commands/root-command.ts
init_esm_shims();

// ../cli-site-old/src/commands/dev.ts
init_esm_shims();

// ../../node_modules/commander/esm.mjs
init_esm_shims();
var import_index = __toESM(require_commander(), 1);
var {
  program,
  createCommand: createCommand2,
  createArgument,
  createOption,
  CommanderError,
  InvalidArgumentError,
  InvalidOptionArgumentError,
  // deprecated old name
  Command,
  Argument,
  Option: Option2,
  Help
} = import_index.default;

// ../cli-site-old/src/commands/dev.ts
var devCommand = (services, cliVersion) => {
  const t = createI18nT();
  return createCommand("dev").option("-s, --https", t("site_dev_command_def.option.https")).addOption(
    new Option2("--tunnel", t("site_dev_command_def.option.tunnel")).conflicts("https").hideHelp(true)
  ).description(t("site_dev_command_def.description")).action(async (options, command) => {
    const { runCommand } = await import("./run-command-JJRTUM36.js");
    const { dev } = await import("./dev-ALOSVHRX.js");
    await runCommand(
      command,
      services,
      cliVersion,
      (model) => dev(model, services, options)
    );
  });
};

// ../cli-site-old/src/commands/install.ts
init_esm_shims();
var installCommand = (services, cliVersion) => {
  const t = createI18nT();
  return createCommand("install").description(t("site_install_command_def.description")).argument("[package]", t("site_install_command_def.argument.package")).option("--yarn", t("site_install_command_def.option.yarn")).option("--npm", t("site_install_command_def.option.npm")).action(async (packageName, opts, command) => {
    const { runCommand } = await import("./run-command-JJRTUM36.js");
    const { install } = await import("./install-F7QQ4L2V.js");
    await runCommand(
      command,
      services,
      cliVersion,
      (model) => install(model, services, opts, packageName)
    );
  });
};

// ../cli-site-old/src/commands/preview.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
var previewCommand = (services, cliVersion) => {
  const t = createI18nT();
  return createCommand("preview").description(t("site_preview_command_def.description")).option("-f, --force", t("site_preview_command_def.option.force")).addOption(
    new Option(
      "--source <local|remote>",
      t("site_preview_command_def.option.source")
    ).choices(["local", "remote"])
  ).action(async (options, command) => {
    const { renderCommand } = await import("./render-command-S6KVN6AK.js");
    const { PreviewCommand } = await import("./PreviewCommand-MN6RVSMU.js");
    await renderCommand(
      command,
      services,
      cliVersion,
      /* @__PURE__ */ import_react.default.createElement(PreviewCommand, { ...options })
    );
  });
};

// ../cli-site-old/src/commands/publish.ts
init_esm_shims();
var publishCommand = (services, cliVersion) => {
  const t = createI18nT();
  return createCommand("publish").description(t("site_publish_command_def.description")).addOption(
    new Option(
      "--source <local|remote>",
      t("site_publish_command_def.option.source")
    ).choices(["local", "remote"])
  ).option(
    "-y, --approve-preview",
    t("site_publish_command_def.option.approve_preview")
  ).option("-f, --force", t("site_publish_command_def.option.force")).action(async (options, command) => {
    const { runCommand } = await import("./run-command-JJRTUM36.js");
    const { publish } = await import("./publish-KMSMJYG4.js");
    await runCommand(
      command,
      services,
      cliVersion,
      (model) => publish(model, services, options)
    );
  });
};

// ../cli-site-old/src/commands/sync-types.ts
init_esm_shims();
var syncTypesCommand = (services, cliVersion) => createCommand("sync-types").action(async (_, command) => {
  const { runCommand } = await import("./run-command-JJRTUM36.js");
  const { syncTypes } = await import("./sync-types-QT7HECLN.js");
  await runCommand(
    command,
    services,
    cliVersion,
    (model) => syncTypes(model, services)
  );
});

// ../cli-site-old/src/commands/uninstall.ts
init_esm_shims();
var uninstallCommand = (services, cliVersion) => {
  const t = createI18nT();
  return createCommand("uninstall").description(t("site_uninstall_command_def.description")).argument("<package>", t("site_uninstall_command_def.argument.package")).option("--yarn", t("site_uninstall_command_def.option.yarn")).option("--npm", t("site_uninstall_command_def.option.npm")).action(async (packageName, opts, command) => {
    const { runCommand } = await import("./run-command-JJRTUM36.js");
    const { uninstall } = await import("./uninstall-YZHU5X6G.js");
    await runCommand(
      command,
      services,
      cliVersion,
      (model) => uninstall(model, services, opts, packageName)
    );
  });
};

// ../cli-site-old/src/commands/root-command.ts
var getRootCommand = async function getRootCommand2(services, cliVersion) {
  return createCommand("site").addCommand(devCommand(services, cliVersion)).addCommand(installCommand(services, cliVersion)).addCommand(previewCommand(services, cliVersion)).addCommand(publishCommand(services, cliVersion)).addCommand(syncTypesCommand(services, cliVersion), { hidden: true }).addCommand(uninstallCommand(services, cliVersion));
};
export {
  getRootCommand
};
//# sourceMappingURL=src-SPV473W5.js.map