import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  zod_default
} from "./chunk-SDLCFZRL.js";
import {
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-test-overrides/src/index.ts
init_esm_shims();
import process from "node:process";
var testOverridesSchema = zod_default.object({
  biLoggerBaseUrl: zod_default.string().url().optional(),
  devEditorBaseUrl: zod_default.string().url().optional(),
  inkDebug: zod_default.boolean().optional(),
  retries: zod_default.number().optional(),
  minRetryTimeout: zod_default.number().optional(),
  pollInterval: zod_default.number().optional(),
  pollTimeout: zod_default.number().optional(),
  debounceQueueWait: zod_default.number().optional(),
  sentryDsn: zod_default.string().optional(),
  userBrowserTestEndpoint: zod_default.string().url().optional(),
  dataDir: zod_default.string().optional(),
  wixCliDependencyVersion: zod_default.string().optional(),
  wixCliAppDependencyVersion: zod_default.string().optional(),
  disableTTY: zod_default.boolean().optional(),
  loginWithDeviceCodeInterval: zod_default.number().optional(),
  registryUrl: zod_default.string().optional(),
  fsCacheDir: zod_default.string().optional(),
  localTunnel: zod_default.boolean().optional(),
  customElementsCreationDelay: zod_default.number().optional(),
  sdkAuthServerBaseUrl: zod_default.string().optional(),
  miniflareRequestsRewrites: zod_default.array(zod_default.object({ from: zod_default.string(), to: zod_default.string() })).optional(),
  panoramaReporterUrl: zod_default.string().optional(),
  isCI: zod_default.boolean().optional(),
  isPR: zod_default.boolean().optional(),
  ciName: zod_default.string().optional(),
  cliEnvName: zod_default.string().optional(),
  cliTrackingId: zod_default.string().optional()
});
var TEST_OVERRIDES_ENV_VAR = "WIX_CLI_TEST_OVERRIDES";
function getTestOverrides() {
  const rawOverrides = process.env[TEST_OVERRIDES_ENV_VAR];
  if (!rawOverrides) {
    return {};
  }
  return testOverridesSchema.parse(JSON.parse(rawOverrides));
}
function isTestEnv() {
  return !!process.env[TEST_OVERRIDES_ENV_VAR];
}
function setupTestEnv() {
  if (isTestEnv()) {
    process.stdout.columns = 300;
    process.stderr.columns = 300;
    process.stdin.isTTY = !getTestOverrides().disableTTY;
    process.stdin.setRawMode = () => process.stdin;
  }
}

export {
  getTestOverrides,
  setupTestEnv
};
//# sourceMappingURL=chunk-XZUGLEBK.js.map