/*
 * Copyright OpenSearch Contributors
 * SPDX-License-Identifier: Apache-2.0
 */

import { AnthropicIcon, OpenAiIcon, AwsBedrockIcon, AzureIcon, GoogleIcon, CohereIcon, MistralIcon, MetaIcon } from '../resources/providers';

/**
 * Maps OTel `gen_ai.system` values to provider SVG icon URLs.
 * Supports both dot-notation (e.g., `aws.bedrock`) and underscore-notation (e.g., `aws_bedrock`).
 */
export const PROVIDER_ICONS = {
  anthropic: AnthropicIcon,
  openai: OpenAiIcon,
  aws_bedrock: AwsBedrockIcon,
  'aws.bedrock': AwsBedrockIcon,
  az_ai_inference: AzureIcon,
  'az.ai.inference': AzureIcon,
  gcp_vertex_ai: GoogleIcon,
  'gcp.vertex_ai': GoogleIcon,
  cohere: CohereIcon,
  mistral: MistralIcon,
  meta: MetaIcon
};
export function getProviderIcon(provider) {
  var _PROVIDER_ICONS$provi;
  if (!provider) return undefined;
  return (_PROVIDER_ICONS$provi = PROVIDER_ICONS[provider]) !== null && _PROVIDER_ICONS$provi !== void 0 ? _PROVIDER_ICONS$provi : PROVIDER_ICONS[provider.replace(/[._]/g, '_')];
}