/**
 * Generate a class diagram for types/interfaces structure.
 */
export function generateClassDiagram(spec) {
    const lines = [
        'classDiagram',
        `  class ${sanitizeId(spec.slug)} {`,
        `    +String id`,
        `    +String status`,
        `    +process()`,
        `    +validate()`,
        `  }`,
        `  class Service {`,
        `    +handle(input)`,
        `    +getResult()`,
        `  }`,
        `  class Repository {`,
        `    +save(entity)`,
        `    +findById(id)`,
        `  }`,
        `  ${sanitizeId(spec.slug)} --> Service`,
        `  Service --> Repository`,
    ];
    return {
        type: 'class',
        title: `Class Diagram — ${spec.title}`,
        format: 'mermaid',
        content: lines.join('\n'),
        description: 'Class structure diagram. Customize classes to match your domain types.',
    };
}
/**
 * Generate a Gantt chart for implementation timeline.
 */
export function generateGanttDiagram(spec) {
    const devDays = Math.max(1, Math.ceil(spec.estimation.devHours / 8));
    const reviewDays = Math.max(1, Math.ceil(spec.estimation.reviewHours / 8));
    const lines = [
        'gantt',
        `  title ${spec.title}`,
        `  dateFormat YYYY-MM-DD`,
        `  section Development`,
        `    Implementation :dev, 2024-01-01, ${String(devDays)}d`,
        `    Unit Tests     :test, after dev, ${String(Math.max(1, Math.ceil(devDays / 2)))}d`,
        `  section Review`,
        `    Code Review    :review, after test, ${String(reviewDays)}d`,
        `    QA Validation  :qa, after review, 1d`,
    ];
    return {
        type: 'gantt',
        title: `Timeline — ${spec.title}`,
        format: 'mermaid',
        content: lines.join('\n'),
        description: `Implementation timeline: ~${String(devDays)} dev days + ${String(reviewDays)} review days.`,
    };
}
/**
 * Generate a pie chart for effort distribution (dev vs review hours).
 */
export function generatePieDiagram(spec) {
    const lines = [
        `pie title Effort Distribution — ${spec.title}`,
        `  "Development" : ${String(spec.estimation.devHours)}`,
        `  "Review" : ${String(spec.estimation.reviewHours)}`,
    ];
    return {
        type: 'pie',
        title: `Effort Distribution — ${spec.title}`,
        format: 'mermaid',
        content: lines.join('\n'),
        description: `Dev: ${String(spec.estimation.devHours)}h, Review: ${String(spec.estimation.reviewHours)}h.`,
    };
}
function sanitizeId(slug) {
    return slug.replace(/[^a-zA-Z0-9]/g, '_').replace(/^_+|_+$/g, '') || 'Entity';
}
//# sourceMappingURL=mermaid-extended.js.map