import { geliosTelemetryFieldRegistryV3 } from "../v10/telemetry-field-registry.mjs";
import {
  GELIOS_PROVIDER_PACKAGE_ID,
  GELIOS_PROVIDER_PACKAGE_VERSION,
} from "./package.mjs";

const value = structuredClone(geliosTelemetryFieldRegistryV3);
value.providerPackage = {
  id: GELIOS_PROVIDER_PACKAGE_ID,
  version: GELIOS_PROVIDER_PACKAGE_VERSION,
};

export const geliosTelemetryFieldRegistryV4 = 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;
}
