import { geliosProviderPackageV8 } from "../v8/package.mjs";

export const GELIOS_PROVIDER_PACKAGE_ID = "gelios.provider.v9";
export const GELIOS_PROVIDER_PACKAGE_VERSION = "9.0.0";

const value = structuredClone(geliosProviderPackageV8);
value.id = GELIOS_PROVIDER_PACKAGE_ID;
value.version = GELIOS_PROVIDER_PACKAGE_VERSION;
value.manifest = {
  ...value.manifest,
  id: "gelios.provider.manifest.v9",
  version: GELIOS_PROVIDER_PACKAGE_VERSION,
};

export const geliosProviderPackageV9 = deepFreeze(value);

function deepFreeze(input) {
  if (!input || typeof input !== "object" || Object.isFrozen(input)) return input;
  Object.freeze(input);
  for (const child of Object.values(input)) deepFreeze(child);
  return input;
}
