// WebRTCManager for Web platform (stub implementation)
import type {
  ICEServer,
  ConnectionState,
  WebRTCManagerEvent,
} from './WebRTCManager';

type EventHandler = (event: WebRTCManagerEvent) => void;

class WebRTCManagerWeb {
  private eventHandlers: Set<EventHandler> = new Set();
  private disposed = false;

  async initialize(iceServers: ICEServer[] = []): Promise<void> {
    console.log('[WebRTC] WebRTC not supported on web platform');
  }

  async createLocalStream(voiceOnly = true): Promise<MediaStream | null> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  async startCall(isInitiator: boolean): Promise<RTCSessionDescriptionInit | null> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  async createOffer(): Promise<RTCSessionDescriptionInit | null> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  async createAnswer(): Promise<RTCSessionDescriptionInit | null> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  async createAnswerFromOffer(offer: RTCSessionDescriptionInit): Promise<RTCSessionDescriptionInit | null> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  async setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
  }

  async addIceCandidate(candidate: RTCIceCandidateInit): Promise<void> {
    console.warn('[WebRTC] WebRTC not supported on web platform');
  }

  setMuted(muted: boolean): void {
    console.warn('[WebRTC] WebRTC not supported on web platform');
  }

  isMuted(): boolean {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return false;
  }

  getRemoteStream(): MediaStream | null {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  getLocalStream(): MediaStream | null {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  getPeerConnection(): RTCPeerConnection | null {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return null;
  }

  onEvent(handler: EventHandler): () => void {
    console.warn('[WebRTC] WebRTC not supported on web platform');
    return () => {
      this.eventHandlers.delete(handler);
    };
  }

  dispose(): void {
    this.disposed = true;
    this.eventHandlers.clear();
    console.log('[WebRTC] WebRTC disposed on web platform');
  }
}

export const webrtcManager = new WebRTCManagerWeb();