import type {
  ChronicleAccessibilityEvent,
  ChronicleAccessibilitySnapshot,
} from '../use-chronicle'

export const chronicleAccessibilitySnapshotFixtures: ChronicleAccessibilitySnapshot[] = [
  {
    id: 'snapshot-ready',
    sourceId: 'accessibility-macos',
    snapshotId: 'screen-snapshot-42',
    capturedAt: '2026-07-23T11:42:00.000Z',
    capturedAtUnix: 1_753_272_120,
    status: 'ready',
    provider: 'macOS AX',
    appBundleId: 'com.microsoft.VSCode',
    windowTitle: 'chronicle-settings.tsx - Cradle',
    elementCount: 138,
    text: 'Chronicle settings, recent activity, memories, knowledge cards, privacy rules, and advanced diagnostics.',
    tree: [
      { role: 'AXWindow', label: 'chronicle-settings.tsx - Cradle', depth: 0, path: 'window' },
      { role: 'AXGroup', label: 'Advanced diagnostics', depth: 1, path: 'window/advanced' },
      { role: 'AXButton', label: 'Generate preview', depth: 2, path: 'window/advanced/generate' },
      { role: 'AXButton', label: 'Apply merge', depth: 2, path: 'window/advanced/apply' },
      { role: 'AXStaticText', label: 'Not shown because the preview is limited', depth: 3, path: 'window/advanced/extra' },
    ],
    metadata: {
      artifactPath: '/Users/demo/Library/Application Support/Cradle/chronicle/accessibility/snapshot-ready.json',
    },
  },
  {
    id: 'snapshot-denied',
    sourceId: 'accessibility-macos',
    snapshotId: null,
    capturedAt: '2026-07-23T11:30:00.000Z',
    capturedAtUnix: 1_753_271_400,
    status: 'permission-denied',
    provider: 'macOS AX',
    appBundleId: 'com.apple.Safari',
    windowTitle: 'Project brief',
    elementCount: 0,
    text: null,
    tree: [],
    metadata: {},
  },
  {
    id: 'snapshot-error',
    sourceId: 'accessibility-macos',
    snapshotId: 'screen-snapshot-40',
    capturedAt: '2026-07-23T11:18:00.000Z',
    capturedAtUnix: 1_753_270_680,
    status: 'error',
    provider: 'macOS AX',
    appBundleId: null,
    windowTitle: null,
    elementCount: 0,
    text: 'The application stopped responding before the accessibility tree was captured.',
    tree: [
      null,
      { role: 'AXWindow', label: 'Unresponsive application', depth: 0 },
    ],
    metadata: {},
  },
]

export const chronicleAccessibilityEventFixtures: ChronicleAccessibilityEvent[] = [
  {
    id: 'event-focused-window',
    sourceId: 'ax-event-stream',
    snapshotId: 'screen-snapshot-42',
    accessibilitySnapshotId: 'snapshot-ready',
    capturedAt: '2026-07-23T11:42:03.000Z',
    capturedAtUnix: 1_753_272_123,
    provider: 'macOS AX',
    appBundleId: 'com.microsoft.VSCode',
    pid: 4312,
    notification: 'AXFocusedWindowChanged',
    droppedBefore: 0,
    metadata: {},
  },
  {
    id: 'event-resized',
    sourceId: 'ax-event-stream',
    snapshotId: 'screen-snapshot-43',
    accessibilitySnapshotId: null,
    capturedAt: '2026-07-23T11:43:12.000Z',
    capturedAtUnix: 1_753_272_192,
    provider: 'macOS AX',
    appBundleId: 'com.microsoft.VSCode',
    pid: 4312,
    notification: 'AXWindowResized',
    droppedBefore: 3,
    metadata: {},
  },
  {
    id: 'event-custom',
    sourceId: 'ax-event-stream-secondary',
    snapshotId: null,
    accessibilitySnapshotId: null,
    capturedAt: '2026-07-23T11:44:30.000Z',
    capturedAtUnix: 1_753_272_270,
    provider: 'macOS AX',
    appBundleId: null,
    pid: null,
    notification: 'AXTitleChanged',
    droppedBefore: 0,
    metadata: {},
  },
]
