import type { AnalyticsAdapter, AnalyticsProps } from "../types.js";
import { emitEvent } from "../sink.js";

export class VariocubeAdapter implements AnalyticsAdapter {
  readonly name = "variocube" as const;

  async load(): Promise<void> {
    // Stub: real Variocube script loads in Phase 2A
  }

  track(event: string, props: AnalyticsProps = {}): void {
    emitEvent({ kind: "track", name: event, props, provider: this.name, ts: new Date().toISOString() });
  }

  page(url: string, props: AnalyticsProps = {}): void {
    emitEvent({ kind: "page", name: url, props, provider: this.name, ts: new Date().toISOString() });
  }
}
