/**
 * PPT Generation Types
 *
 * All types for presentation generation - both external API types and internal pipeline types.
 * Used by the content planner, slide generator, and orchestrator.
 *
 * Architecture:
 * - PPTOutputOptions / PPTGenerationResult: External API types (GenerateOptions.output.ppt)
 * - SlideSchema / ContentPlan: Content planning pipeline types
 * - CompleteSlide / PPTGenerationContext: Generation context types
 * - PPTError: Error handling (follows VideoError pattern)
 */
import { ErrorCategory, ErrorSeverity } from "../constants/enums.js";
import { NeuroLinkError } from "../utils/errorHandling.js";
// ============================================================================
// ERROR TYPES (Following VideoError pattern from vertexVideoHandler.ts)
// ============================================================================
/**
 * PPT generation error codes
 * Following the VIDEO_ERROR_CODES pattern
 */
export const PPT_ERROR_CODES = {
    /** Content planning AI call failed */
    PLANNING_FAILED: "PPT_PLANNING_FAILED",
    /** AI returned invalid/unparseable response */
    INVALID_AI_RESPONSE: "PPT_INVALID_AI_RESPONSE",
    /** Image generation for slide failed */
    IMAGE_GENERATION_FAILED: "PPT_IMAGE_GENERATION_FAILED",
    /** PPTX file assembly failed */
    ASSEMBLY_FAILED: "PPT_ASSEMBLY_FAILED",
    /** File system write failed */
    FILE_WRITE_FAILED: "PPT_FILE_WRITE_FAILED",
    /** Invalid input options */
    INVALID_INPUT: "PPT_INVALID_INPUT",
    /** Generation timeout */
    TIMEOUT: "PPT_TIMEOUT",
};
/**
 * PPT generation error class
 * Extends NeuroLinkError for consistent error handling (follows VideoError pattern)
 */
export class PPTError extends NeuroLinkError {
    constructor(message, code, context, originalError) {
        super({
            code,
            message,
            category: ErrorCategory.EXECUTION,
            severity: ErrorSeverity.HIGH,
            retriable: false,
            context: {
                ...context,
                originalMessage: originalError?.message,
            },
            originalError,
        });
        this.name = "PPTError";
    }
}
// ============================================================================
// VALIDATION CONSTANTS
// ============================================================================
/** Minimum number of slides allowed */
export const MIN_SLIDES = 5;
/** Maximum number of slides allowed */
export const MAX_SLIDES = 50;
/** Slide dimensions in inches by aspect ratio */
export const SLIDE_DIMENSIONS = {
    "16:9": { width: 10, height: 5.625 },
    "4:3": { width: 10, height: 7.5 },
};
/**
 * Validate a hex color string (6 hex characters, no # prefix).
 */
export function isValidHexColor(color) {
    return /^[0-9A-Fa-f]{6}$/.test(color);
}
/**
 * Normalize a hex color by stripping leading # if present.
 */
export function normalizeHexColor(color) {
    return color.startsWith("#") ? color.slice(1) : color;
}
