import { init_esm_shims, __name } from './6AHA7PAZ.js';
import { join } from 'path';
import * as z from 'zod';
import { getFullyQualifiedRepoRootPath } from '@layerzerolabs/common-node-utils';

// src/config.ts
init_esm_shims();
var registryConfigCache;
var getRegistryConfig = /* @__PURE__ */ __name(async () => {
  if (!registryConfigCache) {
    const envRegistry = process.env.VM_TOOLING_REGISTRY;
    const envImageDirectory = process.env.VM_TOOLING_IMAGE_DIRECTORY;
    if (envRegistry && envImageDirectory) {
      registryConfigCache = {
        registry: envRegistry,
        imageDirectory: envImageDirectory
      };
    } else {
      const workspaceRoot = await getFullyQualifiedRepoRootPath();
      const configPath = join(workspaceRoot, "configs", "vm-tooling", "values", "docker-image-repo.ts");
      const module = await import(configPath);
      registryConfigCache = module.default;
    }
  }
  return registryConfigCache;
}, "getRegistryConfig");
var volumeMappingBaseSchema = z.object({
  containerPath: z.string()
});
var hostVolumeMappingSchema = volumeMappingBaseSchema.extend({
  type: z.literal("host"),
  hostPath: z.string()
});
var isolateVolumeMappingSchema = volumeMappingBaseSchema.extend({
  type: z.literal("isolate"),
  name: z.string(),
  shared: z.optional(z.boolean()),
  locked: z.optional(z.boolean())
});
var volumeMappingSchema = z.union([
  hostVolumeMappingSchema,
  isolateVolumeMappingSchema
]);
var DockerRegistryMirror = /* @__PURE__ */ (function(DockerRegistryMirror2) {
  DockerRegistryMirror2["PUBLIC_GAR"] = "public-gar";
  return DockerRegistryMirror2;
})({});
var getImageDirectory = /* @__PURE__ */ __name(async () => (await getRegistryConfig()).imageDirectory, "getImageDirectory");
var getRegistry = /* @__PURE__ */ __name(async () => (await getRegistryConfig()).registry, "getRegistry");

export { DockerRegistryMirror, getImageDirectory, getRegistry, volumeMappingSchema };
//# sourceMappingURL=46I6PSJ7.js.map
//# sourceMappingURL=46I6PSJ7.js.map