/* data.jsx — demo content for Van Haren Learning */

const LEARNER = {
  name: "Mara de Vries",
  role: "Service Delivery Lead",
  org: "Northwind Digital",
  initials: "MV",
  level: 7,
  levelName: "Practitioner",
  xp: 4820,
  xpToNext: 6000,
  streak: 12,
  rank: 3,
  joined: "Mar 2024",
};

/* courses — Van Haren best-practice frameworks (featured three on top) */
const COURSES = [
  { id: "bisl", title: "BiSL® Foundation", track: "Business Information Management", icon: "brain",
    color: "var(--vh-blue-500)", progress: 100, lessons: 12, done: 12, mins: 300, certified: true,
    cover: "Course cover — BiSL", gamified: true, featured: true,
    blurb: "Steer business information management from demand through to use." },
  { id: "bian", title: "BIAN Foundation", track: "Banking Architecture", icon: "layers",
    color: "var(--vh-teal)", progress: 0, lessons: 16, done: 0, mins: 420,
    cover: "Course cover — BIAN", gamified: false, featured: true,
    blurb: "A service-oriented reference architecture for the banking industry." },
  { id: "ipma", title: "IPMA-D® Certification", track: "Project Management", icon: "graduation",
    color: "var(--vh-orange)", progress: 20, lessons: 20, done: 4, mins: 520,
    cover: "Course cover — IPMA-D", gamified: false, featured: true,
    blurb: "Build the individual competences behind consistently successful projects." },
  { id: "itil", title: "ITIL® 4 Foundation", track: "Service Management", icon: "globe",
    color: "var(--vh-blue-500)", progress: 100, lessons: 14, done: 14, mins: 320, certified: true,
    cover: "Course cover — ITIL 4", gamified: true,
    blurb: "The operating model for modern, value-driven service management." },
  { id: "prince2", title: "PRINCE2® Agile Practitioner", track: "Project Management", icon: "target",
    color: "var(--vh-navy)", progress: 0, lessons: 18, done: 0, mins: 460,
    cover: "Course cover — PRINCE2 Agile", gamified: false,
    blurb: "Blend PRINCE2 governance with agile delivery at scale." },
  { id: "togaf", title: "TOGAF® Enterprise Architecture", track: "Architecture", icon: "layers",
    color: "var(--vh-teal)", progress: 0, lessons: 22, done: 0, mins: 540,
    cover: "Course cover — TOGAF", gamified: false,
    blurb: "Design, plan and govern enterprise architecture capability." },
  { id: "devops", title: "DevOps Foundation", track: "Ways of Working", icon: "rocket",
    color: "var(--vh-orange)", progress: 100, lessons: 12, done: 12, mins: 280,
    cover: "Course cover — DevOps", gamified: true, certified: true,
    blurb: "Culture, automation, lean, measurement and sharing." },
  { id: "scrum", title: "Scrum Master Essentials", track: "Agile", icon: "users",
    color: "var(--vh-blue-400)", progress: 0, lessons: 10, done: 0, mins: 240,
    cover: "Course cover — Scrum", gamified: false,
    blurb: "Facilitate, coach and protect a high-performing team." },
  { id: "siam", title: "SIAM™ Foundation", track: "Service Integration", icon: "link",
    color: "#7a5ad6", progress: 0, lessons: 13, done: 0, mins: 300,
    cover: "Course cover — SIAM", gamified: false,
    blurb: "Govern multiple suppliers as one integrated service." },
];

/* skills / competencies — EU e-CF aligned */
const SKILLS = [
  { id: "svc", name: "Service Management", short: "Service Mgmt", icon: "globe", level: 4, max: 5, color: "var(--vh-blue-500)", ecf: "e-CF C.2", pct: 82 },
  { id: "agile", name: "Agile Delivery", short: "Agile", icon: "rocket", level: 3, max: 5, color: "var(--vh-orange)", ecf: "e-CF B.1", pct: 64 },
  { id: "arch", name: "Enterprise Architecture", short: "Architecture", icon: "layers", level: 2, max: 5, color: "var(--vh-teal)", ecf: "e-CF A.5", pct: 38 },
  { id: "risk", name: "Risk & Governance", short: "Risk", icon: "shield", level: 4, max: 5, color: "var(--vh-navy)", ecf: "e-CF E.3", pct: 78 },
  { id: "lead", name: "Leadership", short: "Leadership", icon: "users", level: 3, max: 5, color: "#7a5ad6", ecf: "e-CF E.4", pct: 60 },
  { id: "info", name: "Information Management", short: "Info Mgmt", icon: "brain", level: 3, max: 5, color: "var(--vh-blue-400)", ecf: "e-CF D.10", pct: 56 },
];

/* map a competency to the course that best grows it (for recommendations) */
const SKILL_COURSE = { svc: "itil", agile: "scrum", arch: "bian", risk: "prince2", lead: "ipma", info: "bisl" };
function recommendNext() {
  const weakest = [...SKILLS].sort((a, b) => a.pct - b.pct)[0];
  const course = COURSES.find(c => c.id === SKILL_COURSE[weakest.id]) || COURSES[0];
  return { skill: weakest, course,
    reason: `Your ${weakest.name} sits at ${weakest.pct}% — the lowest in your profile. This course is the fastest way to raise it.` };
}

/* certificates for the passport */
const CERTS = [
  { id: "c1", title: "BiSL® Foundation", issuer: "Van Haren Certify", date: "19 Sep 2025", credential: "VH-BISL-2025-31042", level: "EQF 4", color: "var(--vh-blue-500)", icon: "brain" },
  { id: "c2", title: "ITIL® 4 Foundation", issuer: "PeopleCert · via Van Haren", date: "28 Mar 2026", credential: "PC-ITIL4-2026-88291", level: "EQF 4", color: "var(--vh-blue-500)", icon: "globe" },
  { id: "c3", title: "DevOps Foundation", issuer: "Van Haren Certify", date: "12 May 2026", credential: "VH-DOF-2026-44821", level: "EQF 4", color: "var(--vh-orange)", icon: "rocket" },
];

/* achievements / badges */
const BADGES = [
  { id: "b1", name: "First Steps", icon: "rocket", color: "var(--vh-blue-500)", got: true, desc: "Completed your first lesson" },
  { id: "b2", name: "On Fire", icon: "flame", color: "var(--vh-orange)", got: true, desc: "12-day learning streak" },
  { id: "b3", name: "Quiz Ace", icon: "target", color: "var(--vh-teal)", got: true, desc: "100% on three quizzes" },
  { id: "b4", name: "Bookworm", icon: "book", color: "var(--vh-navy)", got: true, desc: "Finished a full reader title" },
  { id: "b5", name: "Top 3", icon: "trophy", color: "#7a5ad6", got: true, desc: "Reached the podium" },
  { id: "b6", name: "Architect", icon: "layers", color: "var(--vh-blue-400)", got: false, desc: "Master Enterprise Architecture" },
  { id: "b7", name: "Mentor", icon: "users", color: "var(--vh-teal)", got: false, desc: "Help 5 peers in discussions" },
  { id: "b8", name: "Perfectionist", icon: "star", color: "var(--vh-orange)", got: false, desc: "Finish a course with full marks" },
];

/* leaderboard */
const LEADERBOARD = [
  { rank: 1, name: "Jonas Bakker", initials: "JB", xp: 6240, you: false, trend: "up" },
  { rank: 2, name: "Aisha Karim", initials: "AK", xp: 5510, you: false, trend: "up" },
  { rank: 3, name: "Mara de Vries", initials: "MV", xp: 4820, you: true, trend: "up" },
  { rank: 4, name: "Tom Janssen", initials: "TJ", xp: 4310, you: false, trend: "down" },
  { rank: 5, name: "Lena Fischer", initials: "LF", xp: 3980, you: false, trend: "same" },
  { rank: 6, name: "Diego Alvarez", initials: "DA", xp: 3640, you: false, trend: "up" },
];

/* books in the reader library */
const BOOKS = [
  { id: "ipma-prep", title: "IPMA Individual Certification — Preparation Guide", author: "Van Haren Publishing", track: "IPMA-D® Certification",
    color: "var(--vh-blue-500)", pages: 196, read: 0, mins: 0, cover: "Book cover — IPMA Preparation Guide" },
  { id: "itil-pg", title: "ITIL® 4 — A Pocket Guide", author: "Van Haren Publishing", track: "Service Management",
    color: "var(--vh-blue-500)", pages: 196, read: 58, mins: 12, cover: "Book cover — ITIL 4 Pocket Guide" },
  { id: "p2a", title: "PRINCE2® Agile — Practitioner Companion", author: "Van Haren Publishing", track: "Project Management",
    color: "var(--vh-navy)", pages: 264, read: 0, mins: 0, cover: "Book cover — PRINCE2 Agile" },
  { id: "devops-hb", title: "The Team Guide to DevOps", author: "Van Haren Publishing", track: "Ways of Working",
    color: "var(--vh-orange)", pages: 212, read: 100, mins: 0, cover: "Book cover — DevOps", done: true },
  { id: "togaf-pg", title: "TOGAF® Standard — Pocket Guide", author: "Van Haren Publishing", track: "Architecture",
    color: "var(--vh-teal)", pages: 154, read: 22, mins: 9, cover: "Book cover — TOGAF Pocket Guide" },
];

/* reader content — original placeholder prose (not from any book) */
const READER_CHAPTERS = [
  { n: 1, title: "What is a service?",
    paras: [
      "A service is a means of enabling value co-creation by facilitating outcomes that customers want to achieve, without the customer having to manage specific costs and risks. The word “co-creation” matters: value is never delivered to a customer in a sealed box. It emerges from the interaction between what a provider offers and what a customer does with it.",
      "Consider a streaming platform. The provider supplies the catalogue, the apps, and the infrastructure; the customer supplies the time, the attention, and the device. Neither side creates the value alone. When we design services we are really designing the conditions under which that shared value can reliably appear.",
      "This reframing has a practical edge. It pushes teams to ask not “did we ship the feature?” but “did the outcome the customer wanted actually occur, and at an acceptable level of cost and risk?” Those are different questions, and the gap between them is where most service failures live.",
    ] },
  { n: 2, title: "Outcomes over outputs",
    paras: [
      "An output is a deliverable produced by performing an activity — a report, a provisioned server, a closed ticket. An outcome is the result a stakeholder actually wanted — a decision made with confidence, an application that stays available, a problem that stops recurring. Outputs are easy to count; outcomes are what people remember.",
      "Mature service organisations learn to hold both in view. They measure outputs because they are operationally useful, but they never mistake a busy output dashboard for a healthy service. The discipline is to keep tracing every output back to the outcome it is meant to enable, and to prune the ones that enable nothing.",
    ] },
];

/* educator persona */
const EDUCATOR = {
  name: "Daan Visser",
  role: "Course Author & Trainer",
  org: "Van Haren Academy",
  initials: "DV",
  courses: 9,
  learners: 248,
  gamified: 6,
};

/* learner roster for the educator's reports */
const ROSTER = [
  { id: "r1", name: "Jonas Bakker", initials: "JB", course: "ITIL® 4 Foundation", progress: 96, score: 92, xp: 6240, active: "2h ago", status: "ahead" },
  { id: "r2", name: "Aisha Karim", initials: "AK", course: "BiSL® Foundation", progress: 88, score: 89, xp: 5510, active: "today", status: "on-track" },
  { id: "r3", name: "Mara de Vries", initials: "MV", course: "ITIL® 4 Foundation", progress: 72, score: 84, xp: 4820, active: "1h ago", status: "on-track" },
  { id: "r4", name: "Tom Janssen", initials: "TJ", course: "PRINCE2® Agile", progress: 41, score: 71, xp: 4310, active: "3d ago", status: "at-risk" },
  { id: "r5", name: "Lena Fischer", initials: "LF", course: "BIAN Foundation", progress: 64, score: 80, xp: 3980, active: "yesterday", status: "on-track" },
  { id: "r6", name: "Diego Alvarez", initials: "DA", course: "IPMA-D® Certification", progress: 28, score: 66, xp: 3640, active: "5d ago", status: "at-risk" },
  { id: "r7", name: "Sofia Rossi", initials: "SR", course: "DevOps Foundation", progress: 100, score: 95, xp: 6010, active: "today", status: "ahead" },
  { id: "r8", name: "Mehmet Yilmaz", initials: "MY", course: "BiSL® Foundation", progress: 53, score: 78, xp: 3120, active: "today", status: "on-track" },
];

/* report KPIs + weekly engagement series */
const REPORT = {
  activeLearners: 248,
  completionRate: 73,
  avgScore: 84,
  badgesIssued: 1290,
  weekly: [42, 58, 51, 67, 74, 63, 88], // active learners per day
  byCourse: [
    { name: "ITIL® 4", pct: 81, color: "var(--vh-blue-500)" },
    { name: "BiSL®", pct: 64, color: "var(--vh-blue-400)" },
    { name: "BIAN", pct: 52, color: "var(--vh-teal)" },
    { name: "IPMA-D®", pct: 47, color: "var(--vh-orange)" },
    { name: "DevOps", pct: 90, color: "#7a5ad6" },
  ],
};

/* quiz bank used by the playable gamified course */
const QUIZ_BANK = [
  { slide: 3, q: "In service management, value is best described as…",
    options: ["Delivered by the provider to the customer", "Co-created through provider–customer interaction", "The total cost of the service", "Only realised once a project closes"],
    answer: 1, why: "Value is co-created — it emerges from how the customer uses what the provider offers." },
  { slide: 5, q: "Which is an outcome rather than an output?",
    options: ["A provisioned server", "A closed ticket", "A problem that stops recurring", "A published report"],
    answer: 2, why: "Outcomes are results stakeholders wanted; outputs are the deliverables that enable them." },
  { slide: 8, q: "The four dimensions of service management include all EXCEPT…",
    options: ["Organisations & people", "Information & technology", "Marketing & sales", "Partners & suppliers"],
    answer: 2, why: "The four dimensions are organisations & people, information & technology, partners & suppliers, and value streams & processes." },
  { slide: 11, q: "A guiding principle of ITIL 4 is to…",
    options: ["Optimise everything at once", "Start from scratch each time", "Progress iteratively with feedback", "Avoid measuring progress"],
    answer: 2, why: "“Progress iteratively with feedback” keeps work manageable and responsive to change." },
  { slide: 14, q: "Continual improvement should be owned by…",
    options: ["Only senior leadership", "Only the improvement team", "Everyone in the organisation", "External auditors"],
    answer: 2, why: "Continual improvement is everyone's responsibility, embedded in every practice." },
];

Object.assign(window, { LEARNER, EDUCATOR, COURSES, SKILLS, SKILL_COURSE, recommendNext, CERTS, BADGES, LEADERBOARD, BOOKS, READER_CHAPTERS, ROSTER, REPORT, QUIZ_BANK });
