APP.core.state = { videoUrl: null, videoFile: null, videoLoaded: false, useProcessedFeed: false, useDepthFeed: false, // Flag for depth view (Tab 2 video) useFrameDepthView: false, // Flag for first frame depth view (Tab 1) hasReasoned: false, firstFrameReady: false, // Flag for first frame radar display isReasoning: false, // Flag to prevent concurrent Reason executions hf: { // Will be properly initialized after CONFIG loads baseUrl: (window.API_CONFIG?.BACKEND_BASE || window.API_CONFIG?.BASE_URL || "").replace(/\/$/, "") || window.location.origin, detector: "auto", asyncJobId: null, // Current job ID from /detect/async asyncPollInterval: null, // Polling timer handle firstFrameUrl: null, // First frame preview URL firstFrameDetections: null, // First-frame detections from backend statusUrl: null, // Status polling URL videoUrl: null, // Final video URL asyncStatus: "idle", // "idle"|"processing"|"completed"|"failed" asyncProgress: null, // Progress data from status endpoint queries: [], // Mission objective used as query processedUrl: null, processedBlob: null, depthVideoUrl: null, // Depth video URL depthFirstFrameUrl: null, // First frame depth URL depthBlob: null, // Depth video blob depthFirstFrameBlob: null, // Depth first frame blob summary: null, busy: false, lastError: null, missionId: null, plan: null }, detector: { mode: "coco", kind: "object", loaded: false, model: null, loading: false, cocoBlocked: false, hfTrackingWarned: false }, tracker: { mode: "iou", tracks: [], nextId: 1, lastDetTime: 0, lastHFSync: 0, running: false, selectedTrackId: null, beamOn: false, lastFrameTime: 0, frameCount: 0 }, frame: { w: 1280, h: 720, bitmap: null }, detections: [], // from Tab 1 selectedId: null, intelBusy: false, ui: { cursorMode: "on", agentCursor: { x: 0.65, y: 0.28, vx: 0, vy: 0, visible: false, target: null, mode: "idle", t0: 0 } } };