export type StrategyCanvasInteractionMode = 'pan' | 'select';

const STORAGE_KEY = 'gc_se_canvas_interaction';

export function loadCanvasInteractionMode(): StrategyCanvasInteractionMode {
  try {
    const raw = localStorage.getItem(STORAGE_KEY);
    return raw === 'pan' ? 'pan' : 'select';
  } catch {
    return 'select';
  }
}

export function saveCanvasInteractionMode(mode: StrategyCanvasInteractionMode): void {
  try {
    localStorage.setItem(STORAGE_KEY, mode);
  } catch {
    /* ignore */
  }
}
