@burdenoff/microfe-technospam 2026.1031.4 → 2026.1031.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/technospam/api/technospamApi.d.ts +56 -0
  2. package/dist/technospam/api/technospamApi.d.ts.map +1 -1
  3. package/dist/technospam/api/technospamApi.js +298 -231
  4. package/dist/technospam/api/technospamApi.js.map +1 -1
  5. package/dist/technospam/components/StatusBadge.d.ts.map +1 -1
  6. package/dist/technospam/components/StatusBadge.js +2 -0
  7. package/dist/technospam/components/StatusBadge.js.map +1 -1
  8. package/dist/technospam/components/admin/EnterpriseIntegrationsTab.d.ts +6 -0
  9. package/dist/technospam/components/admin/EnterpriseIntegrationsTab.d.ts.map +1 -0
  10. package/dist/technospam/components/admin/EnterpriseIntegrationsTab.js +256 -0
  11. package/dist/technospam/components/admin/EnterpriseIntegrationsTab.js.map +1 -0
  12. package/dist/technospam/lib/a11y.d.ts +11 -0
  13. package/dist/technospam/lib/a11y.d.ts.map +1 -0
  14. package/dist/technospam/lib/a11y.js +6 -0
  15. package/dist/technospam/lib/a11y.js.map +1 -0
  16. package/dist/technospam/lib/enterprise.d.ts +21 -0
  17. package/dist/technospam/lib/enterprise.d.ts.map +1 -0
  18. package/dist/technospam/lib/enterprise.js +36 -0
  19. package/dist/technospam/lib/enterprise.js.map +1 -0
  20. package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
  21. package/dist/technospam/pages/AdminAdminDashboardPagePage.js +206 -199
  22. package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
  23. package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
  24. package/dist/technospam/pages/ApplicationsProblemsPagePage.js +47 -45
  25. package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
  26. package/dist/technospam/pages/CoursesCoursesPagePage.d.ts.map +1 -1
  27. package/dist/technospam/pages/CoursesCoursesPagePage.js +74 -72
  28. package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
  29. package/dist/technospam/pages/HackathonsHackathonsPagePage.d.ts.map +1 -1
  30. package/dist/technospam/pages/HackathonsHackathonsPagePage.js +83 -81
  31. package/dist/technospam/pages/HackathonsHackathonsPagePage.js.map +1 -1
  32. package/dist/technospam/pages/MentorshipSessionsPagePage.d.ts.map +1 -1
  33. package/dist/technospam/pages/MentorshipSessionsPagePage.js +99 -97
  34. package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"technospamApi.js","names":[],"sources":["../../../src/technospam/api/technospamApi.ts"],"sourcesContent":["/**\n * TechnoSpam data layer — Apollo operations + typed hooks over the\n * wspace-technospam-svc subgraph (Tec* fields), reached through the host\n * shell's default workspace ApolloProvider (defaultGateway: \"workspace\").\n *\n * Every page consumes real backend data through these hooks. There is NO mock\n * data. List queries are cursor-paginated: page 1 omits `cursor` entirely\n * (passing cursor: null makes the Prisma cursor resolver 500), \"load more\"\n * passes the previous page's `pageInfo.cursor`.\n */\nimport { useState } from 'react';\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\nimport { userMessageFromError } from '../lib/errorMessage';\n\n/* ------------------------------------------------------------------ enums */\n\nexport type TecCourseLevel = 'BEGINNER' | 'INTERMEDIATE' | 'ADVANCED' | 'EXPERT';\nexport type TecCourseStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\nexport type TecLessonKind = 'VIDEO' | 'ARTICLE' | 'INTERACTIVE' | 'QUIZ' | 'PROJECT';\nexport type TecEnrollmentStatus = 'ENROLLED' | 'IN_PROGRESS' | 'COMPLETED' | 'DROPPED';\nexport type TecCertificateStatus = 'ISSUED' | 'REVOKED';\nexport type TecProblemDifficulty = 'EASY' | 'MEDIUM' | 'HARD';\nexport type TecProblemStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\nexport type TecInterviewFrequency = 'LOW' | 'MEDIUM' | 'HIGH';\nexport type TecSubmissionVerdict =\n | 'PENDING'\n | 'ACCEPTED'\n | 'WRONG_ANSWER'\n | 'TIME_LIMIT_EXCEEDED'\n | 'RUNTIME_ERROR'\n | 'COMPILE_ERROR';\nexport type TecMentorStatus = 'PENDING' | 'ACTIVE' | 'PAUSED' | 'INACTIVE';\nexport type TecSessionStatus = 'REQUESTED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'NO_SHOW';\nexport type TecHackathonStatus =\n 'DRAFT' | 'REGISTRATION_OPEN' | 'IN_PROGRESS' | 'JUDGING' | 'COMPLETED' | 'CANCELLED';\nexport type TecTeamSubmissionStatus = 'DRAFT' | 'SUBMITTED' | 'DISQUALIFIED' | 'WINNER';\n\n/* ------------------------------------------------------------------ types */\n\nexport interface TecCourse {\n id: string;\n slug: string;\n title: string;\n summary?: string | null;\n topic?: string | null;\n level: TecCourseLevel;\n status: TecCourseStatus;\n tags: string[];\n estimatedMinutes: number;\n instructorId?: string | null;\n /** BOFF-4416: true when this course requires a paid TechnoSpam plan. */\n isPremiumOnly: boolean;\n /**\n * BOFF-4416: computed for the calling workspace — true when this course\n * is `isPremiumOnly` and the workspace has no paid plan. When true, every\n * non-preview lesson's `content` is already null in the API response.\n */\n isLocked: boolean;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n lessons?: TecLesson[];\n enrollments?: TecEnrollment[];\n}\n\nexport interface TecLesson {\n id: string;\n courseId: string;\n title: string;\n kind: TecLessonKind;\n content?: string | null;\n position: number;\n estimatedMinutes: number;\n isPreview: boolean;\n /**\n * BOFF-4416: true when this lesson's `content` is gated behind a paid\n * TechnoSpam plan (never true for `isPreview` lessons). `content` is\n * already null in the API response whenever this is true.\n */\n isLocked: boolean;\n /** BOFF-4107 — INTERACTIVE lessons: language slug the workspace runs (e.g. \"python\"). */\n language?: string | null;\n /** INTERACTIVE lessons: code pre-filled in the editor (null when locked). */\n starterCode?: string | null;\n /** INTERACTIVE lessons: default stdin for a run (null when locked). */\n sampleInput?: string | null;\n /** INTERACTIVE lessons: output a correct program prints; a matching run completes the lesson. */\n expectedOutput?: string | null;\n /** QUIZ lessons: questions without the answer key (empty when locked). */\n quizQuestions?: TecQuizQuestion[];\n /** True when the signed-in learner has completed this lesson. */\n completedByMe?: boolean;\n /** Federated wspace-files-svc File (VIDEO lessons); null when locked. */\n file?: {\n id: string;\n name?: string | null;\n mimeType?: string | null;\n downloadUrl?: string | null;\n } | null;\n course?: TecCourse | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** BOFF-4107: a quiz question as a learner sees it (no answer key). */\nexport interface TecQuizQuestion {\n prompt: string;\n options: string[];\n}\n\n/** BOFF-4107: a quiz question with its answer key (lesson-author view). */\nexport interface TecQuizQuestionKey extends TecQuizQuestion {\n correctOption: number;\n explanation?: string | null;\n}\n\nexport type TecLessonRunStatus = 'COMPLETED' | 'WARMING' | 'UNAVAILABLE';\n\nexport interface TecLessonCodeRun {\n lessonId: string;\n status: TecLessonRunStatus;\n language: string;\n stdout: string;\n stderr: string;\n exitCode: number;\n durationMs: number;\n timedOut: boolean;\n memoryLimitExceeded: boolean;\n compileFailed: boolean;\n matchedExpected?: boolean | null;\n lessonCompleted: boolean;\n enrollment?: TecEnrollment | null;\n}\n\nexport interface TecQuizResult {\n lessonId: string;\n score: number;\n correctCount: number;\n totalCount: number;\n passed: boolean;\n passingScore: number;\n results: {\n index: number;\n correct: boolean;\n selectedOption?: number | null;\n correctOption: number;\n explanation?: string | null;\n }[];\n enrollment?: TecEnrollment | null;\n}\n\nexport interface TecEnrollment {\n id: string;\n courseId: string;\n learnerId: string;\n status: TecEnrollmentStatus;\n progressPct: number;\n lessonsCompleted: number;\n startedAt: string;\n lastActiveAt?: string | null;\n completedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n course?: TecCourse | null;\n /** BOFF-4107: first lesson not yet completed; null when every lesson is done. */\n nextLessonId?: string | null;\n}\n\nexport interface TecCertificate {\n id: string;\n courseId: string;\n learnerId: string;\n serial: string;\n score: number;\n status: TecCertificateStatus;\n issuedAt: string;\n revokedAt?: string | null;\n revokeReason?: string | null;\n createdAt: string;\n course?: TecCourse | null;\n}\n\nexport interface TecProblem {\n id: string;\n slug: string;\n title: string;\n statement?: string | null;\n topic?: string | null;\n difficulty: TecProblemDifficulty;\n status: TecProblemStatus;\n tags: string[];\n languages: string[];\n companies: string[];\n roles: string[];\n interviewFrequency?: TecInterviewFrequency | null;\n points: number;\n starterCode?: string | null;\n /** BOFF-4416: true when this problem requires a paid TechnoSpam plan. */\n isPremiumOnly: boolean;\n /**\n * BOFF-4416: computed for the calling workspace — true when this problem\n * is `isPremiumOnly` and the workspace has no paid plan. `statement` /\n * `starterCode` are already null and `publicTestCases` already empty in\n * the API response whenever this is true.\n */\n isLocked: boolean;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n submissions?: TecSubmission[];\n /** Worked-example fixtures the grader runs against; PUBLIC cases only. */\n publicTestCases?: TecProblemTestCase[];\n}\n\n/** Visibility of a problem test case. Mirrors TecTestCaseVisibility. */\nexport type TecTestCaseVisibility = 'PUBLIC' | 'HIDDEN';\n\n/** Per-test-case outcome of a graded submission. Mirrors TecTestCaseStatus. */\nexport type TecTestCaseStatus =\n 'PASSED' | 'WRONG_ANSWER' | 'RUNTIME_ERROR' | 'TIME_LIMIT_EXCEEDED' | 'COMPILE_ERROR' | 'SKIPPED';\n\n/**\n * A worked-example fixture shown on the problem page. Only PUBLIC cases are\n * ever returned to a learner, so `input`/`expectedOutput` are always present\n * in practice; they stay optional because the schema allows null for the\n * author-facing redacted shape.\n */\nexport interface TecProblemTestCase {\n id: string;\n problemId: string;\n name: string;\n ordering: number;\n visibility: TecTestCaseVisibility;\n timeLimitMs: number;\n input?: string | null;\n expectedOutput?: string | null;\n}\n\n/** Grading detail for one test case of a submission. */\nexport interface TecTestCaseResult {\n testCaseId: string;\n name: string;\n visibility: TecTestCaseVisibility;\n status: TecTestCaseStatus;\n passed: boolean;\n durationMs: number;\n input?: string | null;\n expectedOutput?: string | null;\n actualOutput?: string | null;\n}\n\nexport interface TecSubmission {\n id: string;\n problemId: string;\n learnerId: string;\n language: string;\n code: string;\n verdict: TecSubmissionVerdict;\n runtimeMs: number;\n pointsAwarded: number;\n passedCount: number;\n totalCount: number;\n stderr?: string | null;\n testResults: TecTestCaseResult[];\n judgedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n problem?: TecProblem | null;\n}\n\nexport interface TecMentor {\n id: string;\n userId: string;\n headline: string;\n role?: string | null;\n bio?: string | null;\n expertise: string[];\n hourlyRate: number;\n currency: string;\n status: TecMentorStatus;\n isAcceptingMentees: boolean;\n ratingAvg: number;\n sessionsCount: number;\n createdAt: string;\n updatedAt: string;\n sessions?: TecMentorSession[];\n}\n\nexport interface TecMentorSession {\n id: string;\n mentorId: string;\n menteeId: string;\n topic: string;\n agenda?: string | null;\n scheduledAt: string;\n durationMinutes: number;\n status: TecSessionStatus;\n meetingUrl?: string | null;\n /** Snapshotted from the mentor's rate at booking time (smallest currency unit). */\n costAmount: number;\n currency: string;\n platformFeeAmount: number;\n rating?: number | null;\n feedback?: string | null;\n completedAt?: string | null;\n cancelledAt?: string | null;\n createdAt: string;\n updatedAt: string;\n mentor?: TecMentor | null;\n}\n\n/** Read-only pricing preview for a not-yet-booked session (see tecCalculateSessionCost). */\nexport interface TecSessionCostEstimate {\n mentorId: string;\n durationMinutes: number;\n hourlyRate: number;\n currency: string;\n costAmount: number;\n platformFeeAmount: number;\n platformFeeBps: number;\n netAmount: number;\n}\n\n/** Calculation/ledger-only record of what a mentor is owed for a completed session (see tecMyPayouts). */\nexport type TecPayoutStatus = 'PENDING' | 'PAID';\n\nexport interface TecMentorPayout {\n id: string;\n mentorId: string;\n sessionId: string;\n grossAmount: number;\n platformFeeAmount: number;\n netAmount: number;\n currency: string;\n status: TecPayoutStatus;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface TecHackathon {\n id: string;\n slug: string;\n title: string;\n theme?: string | null;\n description?: string | null;\n status: TecHackathonStatus;\n startAt: string;\n endAt: string;\n submissionDeadline?: string | null;\n prizePool: number;\n currency: string;\n maxTeamSize: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n teams?: TecHackathonTeam[];\n}\n\nexport interface TecHackathonTeam {\n id: string;\n hackathonId: string;\n name: string;\n captainId: string;\n memberIds: string[];\n projectName?: string | null;\n projectUrl?: string | null;\n repoUrl?: string | null;\n pitch?: string | null;\n status: TecTeamSubmissionStatus;\n score: number;\n submittedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n hackathon?: TecHackathon | null;\n}\n\nexport interface TecPageInfo {\n cursor?: string | null;\n hasMore: boolean;\n}\n\nexport interface PaginationInput {\n limit?: number;\n cursor?: string | null;\n}\n\n/** Build a pagination arg that NEVER sends cursor:null (page-1 500 guard). */\nexport function pageArg(limit = 50, cursor?: string | null): { limit: number; cursor?: string } {\n return cursor ? { limit, cursor } : { limit };\n}\n\n/* -------------------------------------------------------------- fragments */\n\nconst COURSE_FIELDS = gql`\n fragment CourseFields on TecCourse {\n id\n slug\n title\n summary\n topic\n level\n status\n tags\n estimatedMinutes\n instructorId\n isPremiumOnly\n isLocked\n publishedAt\n createdAt\n updatedAt\n }\n`;\n\nconst LESSON_FIELDS = gql`\n fragment LessonFields on TecLesson {\n id\n courseId\n title\n kind\n content\n position\n estimatedMinutes\n isPreview\n isLocked\n language\n starterCode\n sampleInput\n expectedOutput\n quizQuestions {\n prompt\n options\n }\n completedByMe\n createdAt\n updatedAt\n }\n`;\n\nconst ENROLLMENT_FIELDS = gql`\n fragment EnrollmentFields on TecEnrollment {\n id\n courseId\n learnerId\n status\n progressPct\n lessonsCompleted\n startedAt\n lastActiveAt\n completedAt\n createdAt\n updatedAt\n }\n`;\n\nconst PROBLEM_FIELDS = gql`\n fragment ProblemFields on TecProblem {\n id\n slug\n title\n statement\n topic\n difficulty\n status\n tags\n languages\n companies\n roles\n interviewFrequency\n points\n starterCode\n isPremiumOnly\n isLocked\n publishedAt\n createdAt\n updatedAt\n }\n`;\n\nconst SUBMISSION_FIELDS = gql`\n fragment SubmissionFields on TecSubmission {\n id\n problemId\n learnerId\n language\n code\n verdict\n runtimeMs\n pointsAwarded\n passedCount\n totalCount\n stderr\n testResults {\n testCaseId\n name\n visibility\n status\n passed\n durationMs\n input\n expectedOutput\n actualOutput\n }\n judgedAt\n createdAt\n updatedAt\n }\n`;\n\nconst PROBLEM_TEST_CASE_FIELDS = gql`\n fragment ProblemTestCaseFields on TecProblemTestCase {\n id\n problemId\n name\n ordering\n visibility\n timeLimitMs\n input\n expectedOutput\n }\n`;\n\nconst MENTOR_FIELDS = gql`\n fragment MentorFields on TecMentor {\n id\n userId\n headline\n role\n bio\n expertise\n hourlyRate\n currency\n status\n isAcceptingMentees\n ratingAvg\n sessionsCount\n createdAt\n updatedAt\n }\n`;\n\nconst SESSION_FIELDS = gql`\n fragment SessionFields on TecMentorSession {\n id\n mentorId\n menteeId\n topic\n agenda\n scheduledAt\n durationMinutes\n status\n meetingUrl\n costAmount\n currency\n platformFeeAmount\n rating\n feedback\n completedAt\n cancelledAt\n createdAt\n updatedAt\n }\n`;\n\nconst HACKATHON_FIELDS = gql`\n fragment HackathonFields on TecHackathon {\n id\n slug\n title\n theme\n description\n status\n startAt\n endAt\n submissionDeadline\n prizePool\n currency\n maxTeamSize\n tags\n createdAt\n updatedAt\n }\n`;\n\nconst TEAM_FIELDS = gql`\n fragment TeamFields on TecHackathonTeam {\n id\n hackathonId\n name\n captainId\n memberIds\n projectName\n projectUrl\n repoUrl\n pitch\n status\n score\n submittedAt\n createdAt\n updatedAt\n }\n`;\n\nconst CERTIFICATE_FIELDS = gql`\n fragment CertificateFields on TecCertificate {\n id\n courseId\n learnerId\n serial\n score\n status\n issuedAt\n revokedAt\n revokeReason\n createdAt\n }\n`;\n\n/* --------------------------------------------------------------- queries */\n\nconst LIST_COURSES = gql`\n ${COURSE_FIELDS}\n query TecListCourses(\n $level: TecCourseLevel\n $status: TecCourseStatus\n $pagination: PaginationInput\n ) {\n tecListCourses(level: $level, status: $status, pagination: $pagination) {\n items {\n ...CourseFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_COURSE = gql`\n ${COURSE_FIELDS}\n ${LESSON_FIELDS}\n ${ENROLLMENT_FIELDS}\n query TecCourse($id: ID!) {\n tecCourse(id: $id) {\n ...CourseFields\n lessons {\n ...LessonFields\n }\n enrollments {\n ...EnrollmentFields\n }\n }\n }\n`;\n\nconst LIST_ENROLLMENTS = gql`\n ${ENROLLMENT_FIELDS}\n ${COURSE_FIELDS}\n query TecListEnrollments(\n $learnerId: ID\n $courseId: ID\n $pagination: PaginationInput\n $startDate: DateTime\n $endDate: DateTime\n ) {\n tecListEnrollments(\n learnerId: $learnerId\n courseId: $courseId\n pagination: $pagination\n startDate: $startDate\n endDate: $endDate\n ) {\n items {\n ...EnrollmentFields\n course {\n ...CourseFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_CERTIFICATES = gql`\n ${CERTIFICATE_FIELDS}\n ${COURSE_FIELDS}\n query TecListCertificates($learnerId: ID, $courseId: ID) {\n tecListCertificates(learnerId: $learnerId, courseId: $courseId) {\n ...CertificateFields\n course {\n ...CourseFields\n }\n }\n }\n`;\n\n/**\n * The calling learner's OWN certificates. Self-scoped (`@rbac(scopeType:\n * \"self\")`) — the resolver forces `learnerId = ctx.actor.id`, so no learnerId\n * variable is ever sent. Learner-facing surfaces must use this instead of\n * `tecListCertificates`, which is gated behind the cross-learner `list-all`\n * action that a plain workspace member does not hold.\n */\nconst MY_CERTIFICATES = gql`\n ${CERTIFICATE_FIELDS}\n ${COURSE_FIELDS}\n query TecMyCertificates($courseId: ID) {\n tecMyCertificates(courseId: $courseId) {\n ...CertificateFields\n course {\n ...CourseFields\n }\n }\n }\n`;\n\nconst LIST_PROBLEMS = gql`\n ${PROBLEM_FIELDS}\n query TecListProblems(\n $difficulty: TecProblemDifficulty\n $status: TecProblemStatus\n $topic: String\n $company: String\n $role: String\n $interviewFrequency: TecInterviewFrequency\n $pagination: PaginationInput\n ) {\n tecListProblems(\n difficulty: $difficulty\n status: $status\n topic: $topic\n company: $company\n role: $role\n interviewFrequency: $interviewFrequency\n pagination: $pagination\n ) {\n items {\n ...ProblemFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n ${SUBMISSION_FIELDS}\n ${PROBLEM_TEST_CASE_FIELDS}\n query TecProblem($id: ID!) {\n tecProblem(id: $id) {\n ...ProblemFields\n publicTestCases {\n ...ProblemTestCaseFields\n }\n submissions {\n ...SubmissionFields\n }\n }\n }\n`;\n\nconst REGRADE_SUBMISSION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecRegradeSubmission($id: ID!) {\n tecRegradeSubmission(id: $id) {\n ...SubmissionFields\n }\n }\n`;\n\nconst LIST_SUBMISSIONS = gql`\n ${SUBMISSION_FIELDS}\n ${PROBLEM_FIELDS}\n query TecListSubmissions(\n $learnerId: ID\n $problemId: ID\n $pagination: PaginationInput\n $startDate: DateTime\n $endDate: DateTime\n ) {\n tecListSubmissions(\n learnerId: $learnerId\n problemId: $problemId\n pagination: $pagination\n startDate: $startDate\n endDate: $endDate\n ) {\n items {\n ...SubmissionFields\n problem {\n ...ProblemFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_MENTORS = gql`\n ${MENTOR_FIELDS}\n query TecListMentors($status: TecMentorStatus, $pagination: PaginationInput) {\n tecListMentors(status: $status, pagination: $pagination) {\n items {\n ...MentorFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_MENTOR = gql`\n ${MENTOR_FIELDS}\n ${SESSION_FIELDS}\n query TecMentor($id: ID!) {\n tecMentor(id: $id) {\n ...MentorFields\n sessions {\n ...SessionFields\n }\n }\n }\n`;\n\nconst LIST_SESSIONS = gql`\n ${SESSION_FIELDS}\n ${MENTOR_FIELDS}\n query TecListSessions(\n $mentorId: ID\n $menteeId: ID\n $status: TecSessionStatus\n $pagination: PaginationInput\n ) {\n tecListSessions(\n mentorId: $mentorId\n menteeId: $menteeId\n status: $status\n pagination: $pagination\n ) {\n items {\n ...SessionFields\n mentor {\n ...MentorFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst CALCULATE_SESSION_COST = gql`\n query TecCalculateSessionCost($mentorId: ID!, $durationMinutes: Int) {\n tecCalculateSessionCost(mentorId: $mentorId, durationMinutes: $durationMinutes) {\n mentorId\n durationMinutes\n hourlyRate\n currency\n costAmount\n platformFeeAmount\n platformFeeBps\n netAmount\n }\n }\n`;\n\nconst PAYOUT_FIELDS = gql`\n fragment PayoutFields on TecMentorPayout {\n id\n mentorId\n sessionId\n grossAmount\n platformFeeAmount\n netAmount\n currency\n status\n createdAt\n updatedAt\n }\n`;\n\nconst MY_PAYOUTS = gql`\n ${PAYOUT_FIELDS}\n query TecMyPayouts($status: TecPayoutStatus, $pagination: PaginationInput) {\n tecMyPayouts(status: $status, pagination: $pagination) {\n items {\n ...PayoutFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_HACKATHONS = gql`\n ${HACKATHON_FIELDS}\n query TecListHackathons($status: TecHackathonStatus, $pagination: PaginationInput) {\n tecListHackathons(status: $status, pagination: $pagination) {\n items {\n ...HackathonFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n ${TEAM_FIELDS}\n query TecHackathon($id: ID!) {\n tecHackathon(id: $id) {\n ...HackathonFields\n teams {\n ...TeamFields\n }\n }\n }\n`;\n\nconst LIST_TEAMS = gql`\n ${TEAM_FIELDS}\n query TecListTeams($hackathonId: ID!, $pagination: PaginationInput) {\n tecListTeams(hackathonId: $hackathonId, pagination: $pagination) {\n items {\n ...TeamFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_LESSONS = gql`\n ${LESSON_FIELDS}\n query TecListLessons($courseId: ID!, $pagination: PaginationInput) {\n tecListLessons(courseId: $courseId, pagination: $pagination) {\n items {\n ...LessonFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\n/* ------------------------------------------------------- response typings */\n\ntype Conn<K extends string, T> = Record<K, { items: T[]; pageInfo: TecPageInfo }>;\n\n/* ---------------------------------------------------------- query hooks */\n\nexport const useCoursesQuery = (vars: {\n level?: TecCourseLevel;\n status?: TecCourseStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListCourses', TecCourse>>(LIST_COURSES, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useCourseQuery = (id: string) =>\n useQuery<{ tecCourse: TecCourse | null }>(GET_COURSE, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useEnrollmentsQuery = (vars: {\n learnerId?: string;\n courseId?: string;\n startDate?: string;\n endDate?: string;\n}) =>\n useQuery<Conn<'tecListEnrollments', TecEnrollment>>(LIST_ENROLLMENTS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\n/**\n * Cross-learner certificate read (instructor/admin). Requires the `list-all`\n * action — learner surfaces want `useMyCertificatesQuery` instead.\n */\nexport const useCertificatesQuery = (vars: { learnerId?: string; courseId?: string }) =>\n useQuery<{ tecListCertificates: TecCertificate[] }>(LIST_CERTIFICATES, {\n variables: vars,\n fetchPolicy: 'cache-and-network',\n });\n\n/** The signed-in learner's own certificates (self-scoped; no learnerId sent). */\nexport const useMyCertificatesQuery = (vars: { courseId?: string } = {}) =>\n useQuery<{ tecMyCertificates: TecCertificate[] }>(MY_CERTIFICATES, {\n variables: vars,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useProblemsQuery = (vars: {\n difficulty?: TecProblemDifficulty;\n status?: TecProblemStatus;\n topic?: string;\n company?: string;\n role?: string;\n interviewFrequency?: TecInterviewFrequency;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListProblems', TecProblem>>(LIST_PROBLEMS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useProblemQuery = (id: string) =>\n useQuery<{ tecProblem: TecProblem | null }>(GET_PROBLEM, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useSubmissionsQuery = (vars: {\n learnerId?: string;\n problemId?: string;\n startDate?: string;\n endDate?: string;\n}) =>\n useQuery<Conn<'tecListSubmissions', TecSubmission>>(LIST_SUBMISSIONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useMentorsQuery = (vars: {\n status?: TecMentorStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListMentors', TecMentor>>(LIST_MENTORS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useMentorQuery = (id: string) =>\n useQuery<{ tecMentor: TecMentor | null }>(GET_MENTOR, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useSessionsQuery = (vars: {\n mentorId?: string;\n menteeId?: string;\n status?: TecSessionStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListSessions', TecMentorSession>>(LIST_SESSIONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\n/**\n * Live pricing preview for a not-yet-booked session -- refetches whenever\n * mentorId/durationMinutes change (Apollo re-runs on variable change), so\n * the booking form always shows the cost that would actually be snapshotted\n * onto the session by tecBookSession. `skip` while mentorId is empty.\n */\nexport const useSessionCostEstimate = (mentorId: string, durationMinutes: number) =>\n useQuery<{ tecCalculateSessionCost: TecSessionCostEstimate }>(CALCULATE_SESSION_COST, {\n variables: { mentorId, durationMinutes },\n skip: !mentorId || !Number.isFinite(durationMinutes) || durationMinutes <= 0,\n fetchPolicy: 'cache-and-network',\n });\n\n/** The calling mentor's own payout ledger (calculation-only -- see BOFF-4433). */\nexport const useMyPayoutsQuery = (\n vars: { status?: TecPayoutStatus; pagination?: { limit: number; cursor?: string } } = {}\n) =>\n useQuery<Conn<'tecMyPayouts', TecMentorPayout>>(MY_PAYOUTS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useHackathonsQuery = (vars: {\n status?: TecHackathonStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListHackathons', TecHackathon>>(LIST_HACKATHONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useHackathonQuery = (id: string) =>\n useQuery<{ tecHackathon: TecHackathon | null }>(GET_HACKATHON, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useTeamsQuery = (\n hackathonId: string,\n pagination?: { limit: number; cursor?: string }\n) =>\n useQuery<Conn<'tecListTeams', TecHackathonTeam>>(LIST_TEAMS, {\n variables: { hackathonId, pagination: pagination ?? pageArg(50) },\n skip: !hackathonId,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useLessonsQuery = (\n courseId: string,\n pagination?: { limit: number; cursor?: string }\n) =>\n useQuery<Conn<'tecListLessons', TecLesson>>(LIST_LESSONS, {\n variables: { courseId, pagination: pagination ?? pageArg(50) },\n skip: !courseId,\n fetchPolicy: 'cache-and-network',\n });\n\n/* ------------------------------------------------------------ mutations */\n\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', userMessageFromError(error));\n};\n\nconst REFETCH = {\n courses: 'TecListCourses',\n enrollments: 'TecListEnrollments',\n problems: 'TecListProblems',\n submissions: 'TecListSubmissions',\n mentors: 'TecListMentors',\n sessions: 'TecListSessions',\n hackathons: 'TecListHackathons',\n} as const;\n\nconst ENROLL = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecEnroll($input: TecEnrollInput!) {\n tecEnroll(input: $input) {\n ...EnrollmentFields\n }\n }\n`;\n\nconst SUBMIT_SOLUTION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecSubmitSolution($input: TecSubmitSolutionInput!) {\n tecSubmitSolution(input: $input) {\n ...SubmissionFields\n }\n }\n`;\n\nconst BOOK_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecBookSession($input: TecBookSessionInput!) {\n tecBookSession(input: $input) {\n ...SessionFields\n }\n }\n`;\n\nconst CANCEL_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecCancelSession($id: ID!) {\n tecCancelSession(id: $id) {\n ...SessionFields\n }\n }\n`;\n\nconst BECOME_MENTOR = gql`\n ${MENTOR_FIELDS}\n mutation TecBecomeMentor($input: TecCreateMentorInput!) {\n tecBecomeMentor(input: $input) {\n ...MentorFields\n }\n }\n`;\n\nconst REGISTER_TEAM = gql`\n ${TEAM_FIELDS}\n mutation TecRegisterTeam($input: TecRegisterTeamInput!) {\n tecRegisterTeam(input: $input) {\n ...TeamFields\n }\n }\n`;\n\nconst SUBMIT_PROJECT = gql`\n ${TEAM_FIELDS}\n mutation TecSubmitProject($input: TecSubmitProjectInput!) {\n tecSubmitProject(input: $input) {\n ...TeamFields\n }\n }\n`;\n\n/* ------- admin / authoring mutations ------- */\n\nconst CREATE_COURSE = gql`\n ${COURSE_FIELDS}\n mutation TecCreateCourse($input: TecCreateCourseInput!) {\n tecCreateCourse(input: $input) {\n ...CourseFields\n }\n }\n`;\n\nconst PUBLISH_COURSE = gql`\n ${COURSE_FIELDS}\n mutation TecPublishCourse($id: ID!) {\n tecPublishCourse(id: $id) {\n ...CourseFields\n }\n }\n`;\n\nconst ARCHIVE_COURSE = gql`\n mutation TecArchiveCourse($id: ID!) {\n tecArchiveCourse(id: $id)\n }\n`;\n\nconst CREATE_LESSON = gql`\n ${LESSON_FIELDS}\n mutation TecCreateLesson($input: TecCreateLessonInput!) {\n tecCreateLesson(input: $input) {\n ...LessonFields\n }\n }\n`;\n\nconst UPDATE_LESSON = gql`\n ${LESSON_FIELDS}\n mutation TecUpdateLesson($id: ID!, $input: TecUpdateLessonInput!) {\n tecUpdateLesson(id: $id, input: $input) {\n ...LessonFields\n }\n }\n`;\n\nconst CREATE_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n mutation TecCreateProblem($input: TecCreateProblemInput!) {\n tecCreateProblem(input: $input) {\n ...ProblemFields\n }\n }\n`;\n\nconst PUBLISH_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n mutation TecPublishProblem($id: ID!) {\n tecPublishProblem(id: $id) {\n ...ProblemFields\n }\n }\n`;\n\nconst CREATE_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecCreateHackathon($input: TecCreateHackathonInput!) {\n tecCreateHackathon(input: $input) {\n ...HackathonFields\n }\n }\n`;\n\nconst OPEN_REGISTRATION = gql`\n ${HACKATHON_FIELDS}\n mutation TecOpenRegistration($id: ID!) {\n tecOpenRegistration(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst APPROVE_MENTOR = gql`\n ${MENTOR_FIELDS}\n mutation TecApproveMentor($id: ID!) {\n tecApproveMentor(id: $id) {\n ...MentorFields\n }\n }\n`;\n\nconst SCORE_TEAM = gql`\n ${TEAM_FIELDS}\n mutation TecScoreTeam($id: ID!, $score: Int!, $winner: Boolean) {\n tecScoreTeam(id: $id, score: $score, winner: $winner) {\n ...TeamFields\n }\n }\n`;\n\nconst CONFIRM_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecConfirmSession($id: ID!, $meetingUrl: String) {\n tecConfirmSession(id: $id, meetingUrl: $meetingUrl) {\n ...SessionFields\n }\n }\n`;\n\nconst COMPLETE_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecCompleteSession($id: ID!, $rating: Int, $feedback: String) {\n tecCompleteSession(id: $id, rating: $rating, feedback: $feedback) {\n ...SessionFields\n }\n }\n`;\n\nconst GRADE_SUBMISSION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecGradeSubmission($id: ID!, $verdict: TecSubmissionVerdict!, $runtimeMs: Int) {\n tecGradeSubmission(id: $id, verdict: $verdict, runtimeMs: $runtimeMs) {\n ...SubmissionFields\n }\n }\n`;\n\nconst ISSUE_CERTIFICATE = gql`\n ${CERTIFICATE_FIELDS}\n mutation TecIssueCertificate($courseId: ID!, $learnerId: ID!, $score: Int!) {\n tecIssueCertificate(courseId: $courseId, learnerId: $learnerId, score: $score) {\n ...CertificateFields\n }\n }\n`;\n\nconst REVOKE_CERTIFICATE = gql`\n ${CERTIFICATE_FIELDS}\n mutation TecRevokeCertificate($id: ID!, $reason: String) {\n tecRevokeCertificate(id: $id, reason: $reason) {\n ...CertificateFields\n }\n }\n`;\n\nconst START_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecStartHackathon($id: ID!) {\n tecStartHackathon(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst START_JUDGING = gql`\n ${HACKATHON_FIELDS}\n mutation TecStartJudging($id: ID!) {\n tecStartJudging(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst COMPLETE_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecCompleteHackathon($id: ID!) {\n tecCompleteHackathon(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\n/* ---------------------------------------------------------- mutation hooks */\n\nexport const useEnroll = () =>\n useMutation<{ tecEnroll: TecEnrollment }>(ENROLL, {\n onError: onMutationError,\n refetchQueries: [REFETCH.enrollments, REFETCH.courses],\n });\n\nexport const useSubmitSolution = () =>\n useMutation<{ tecSubmitSolution: TecSubmission }>(SUBMIT_SOLUTION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\n/**\n * Re-run the grader for a submission. Used by the problem page when a verdict\n * came back PENDING (grader unavailable at submit time) so a learner can retry\n * without resubmitting identical code.\n */\nexport const useRegradeSubmission = () =>\n useMutation<{ tecRegradeSubmission: TecSubmission }>(REGRADE_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\nexport const useBookSession = () =>\n useMutation<{ tecBookSession: TecMentorSession }>(BOOK_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions, REFETCH.mentors],\n });\n\nexport const useCancelSession = () =>\n useMutation<{ tecCancelSession: TecMentorSession }>(CANCEL_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useBecomeMentor = () =>\n useMutation<{ tecBecomeMentor: TecMentor }>(BECOME_MENTOR, {\n onError: onMutationError,\n refetchQueries: [REFETCH.mentors],\n });\n\nexport const useRegisterTeam = () =>\n useMutation<{ tecRegisterTeam: TecHackathonTeam }>(REGISTER_TEAM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useSubmitProject = () =>\n useMutation<{ tecSubmitProject: TecHackathonTeam }>(SUBMIT_PROJECT, {\n onError: onMutationError,\n });\n\nexport const useCreateCourse = () =>\n useMutation<{ tecCreateCourse: TecCourse }>(CREATE_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const usePublishCourse = () =>\n useMutation<{ tecPublishCourse: TecCourse }>(PUBLISH_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const useArchiveCourse = () =>\n useMutation<{ tecArchiveCourse: boolean }>(ARCHIVE_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const useCreateLesson = () =>\n useMutation<{ tecCreateLesson: TecLesson }>(CREATE_LESSON, { onError: onMutationError });\n\n/**\n * Edit an already-authored lesson (title/kind/content/minutes/preview/position).\n * Every field on TecUpdateLessonInput is optional — send only what changed.\n */\nexport const useUpdateLesson = () =>\n useMutation<{ tecUpdateLesson: TecLesson }>(UPDATE_LESSON, { onError: onMutationError });\n\nexport const useCreateProblem = () =>\n useMutation<{ tecCreateProblem: TecProblem }>(CREATE_PROBLEM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.problems],\n });\n\nexport const usePublishProblem = () =>\n useMutation<{ tecPublishProblem: TecProblem }>(PUBLISH_PROBLEM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.problems],\n });\n\nexport const useCreateHackathon = () =>\n useMutation<{ tecCreateHackathon: TecHackathon }>(CREATE_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useOpenRegistration = () =>\n useMutation<{ tecOpenRegistration: TecHackathon }>(OPEN_REGISTRATION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useApproveMentor = () =>\n useMutation<{ tecApproveMentor: TecMentor }>(APPROVE_MENTOR, {\n onError: onMutationError,\n refetchQueries: [REFETCH.mentors],\n });\n\nexport const useScoreTeam = () =>\n useMutation<{ tecScoreTeam: TecHackathonTeam }>(SCORE_TEAM, { onError: onMutationError });\n\nexport const useConfirmSession = () =>\n useMutation<{ tecConfirmSession: TecMentorSession }>(CONFIRM_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useCompleteSession = () =>\n useMutation<{ tecCompleteSession: TecMentorSession }>(COMPLETE_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useGradeSubmission = () =>\n useMutation<{ tecGradeSubmission: TecSubmission }>(GRADE_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\nexport const useIssueCertificate = () =>\n useMutation<{ tecIssueCertificate: TecCertificate }>(ISSUE_CERTIFICATE, {\n onError: onMutationError,\n });\n\nexport const useRevokeCertificate = () =>\n useMutation<{ tecRevokeCertificate: TecCertificate }>(REVOKE_CERTIFICATE, {\n onError: onMutationError,\n });\n\nexport const useStartHackathon = () =>\n useMutation<{ tecStartHackathon: TecHackathon }>(START_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useStartJudging = () =>\n useMutation<{ tecStartJudging: TecHackathon }>(START_JUDGING, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useCompleteHackathon = () =>\n useMutation<{ tecCompleteHackathon: TecHackathon }>(COMPLETE_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\n/* ============================================================ Study Planner\n * BOFF-4415 — deterministic, rule-based goal -> plan scheduler. NOT an LLM\n * feature; see the backend StudyPlanService honesty note. Every query/\n * mutation below is self-scoped (learnerId comes from the authenticated\n * actor server-side) so no learnerId variable is ever sent from the client.\n * ========================================================================= */\n\nexport type TecStudyPlanStatus = 'ACTIVE' | 'COMPLETED' | 'ARCHIVED';\nexport type TecStudyPlanStepKind = 'COURSE' | 'PROBLEM';\nexport type TecStudyPlanStepStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'SKIPPED';\n\nexport interface TecStudyPlanStep {\n id: string;\n order: number;\n kind: TecStudyPlanStepKind;\n targetId: string;\n title: string;\n scheduledWeek: number;\n status: TecStudyPlanStepStatus;\n rationale: string;\n estimatedMinutes: number;\n completedAt?: string | null;\n}\n\nexport interface TecStudyPlan {\n id: string;\n goal: string;\n topic?: string | null;\n timeframeWeeks: number;\n status: TecStudyPlanStatus;\n targetCompletionDate?: string | null;\n progressPct: number;\n totalSteps: number;\n completedSteps: number;\n createdAt: string;\n steps: TecStudyPlanStep[];\n}\n\nconst STUDY_PLAN_STEP_FIELDS = gql`\n fragment StudyPlanStepFields on TecStudyPlanStep {\n id\n order\n kind\n targetId\n title\n scheduledWeek\n status\n rationale\n estimatedMinutes\n completedAt\n }\n`;\n\nconst STUDY_PLAN_FIELDS = gql`\n ${STUDY_PLAN_STEP_FIELDS}\n fragment StudyPlanFields on TecStudyPlan {\n id\n goal\n topic\n timeframeWeeks\n status\n targetCompletionDate\n progressPct\n totalSteps\n completedSteps\n createdAt\n steps {\n ...StudyPlanStepFields\n }\n }\n`;\n\nconst LIST_MY_STUDY_PLANS = gql`\n ${STUDY_PLAN_FIELDS}\n query TecMyStudyPlans {\n tecMyStudyPlans {\n items {\n ...StudyPlanFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GENERATE_STUDY_PLAN = gql`\n ${STUDY_PLAN_FIELDS}\n mutation TecGenerateStudyPlan($input: TecGenerateStudyPlanInput!) {\n tecGenerateStudyPlan(input: $input) {\n ...StudyPlanFields\n }\n }\n`;\n\nconst UPDATE_STUDY_PLAN_STEP_STATUS = gql`\n ${STUDY_PLAN_STEP_FIELDS}\n mutation TecUpdateStudyPlanStepStatus($input: TecUpdateStudyPlanStepStatusInput!) {\n tecUpdateStudyPlanStepStatus(input: $input) {\n ...StudyPlanStepFields\n }\n }\n`;\n\nconst ARCHIVE_STUDY_PLAN = gql`\n mutation TecArchiveStudyPlan($id: ID!) {\n tecArchiveStudyPlan(id: $id)\n }\n`;\n\nexport const useMyStudyPlansQuery = () =>\n useQuery<{ tecMyStudyPlans: { items: TecStudyPlan[]; pageInfo: TecPageInfo } }>(\n LIST_MY_STUDY_PLANS,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\nexport const useGenerateStudyPlan = () =>\n useMutation<{ tecGenerateStudyPlan: TecStudyPlan }>(GENERATE_STUDY_PLAN, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\nexport const useUpdateStudyPlanStepStatus = () =>\n useMutation<{ tecUpdateStudyPlanStepStatus: TecStudyPlanStep }>(UPDATE_STUDY_PLAN_STEP_STATUS, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\nexport const useArchiveStudyPlan = () =>\n useMutation<{ tecArchiveStudyPlan: boolean }>(ARCHIVE_STUDY_PLAN, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\n/* ================================================================ Portfolio\n * BOFF-4432 — learner-curated showcase of real completed hackathon\n * projects, certificates, and courses. `tecPublicPortfolio` is a public,\n * unauthenticated field (@rbac public: true) reached through the same\n * gateway; there is no separate unauthenticated *page* wired up yet (see\n * ApplicationsPortfolioPagePage's deferred-scope note).\n * ========================================================================= */\n\nexport type TecPortfolioItemKind = 'HACKATHON_PROJECT' | 'CERTIFICATE' | 'COURSE_COMPLETION';\n\nexport interface TecPortfolioItem {\n id: string;\n kind: TecPortfolioItemKind;\n sourceId: string;\n title: string;\n description?: string | null;\n link?: string | null;\n completionDate: string;\n order: number;\n}\n\nexport interface TecPortfolio {\n id: string;\n isPublished: boolean;\n publicSlug?: string | null;\n publishedAt?: string | null;\n items: TecPortfolioItem[];\n}\n\nconst PORTFOLIO_ITEM_FIELDS = gql`\n fragment PortfolioItemFields on TecPortfolioItem {\n id\n kind\n sourceId\n title\n description\n link\n completionDate\n order\n }\n`;\n\nconst PORTFOLIO_FIELDS = gql`\n ${PORTFOLIO_ITEM_FIELDS}\n fragment PortfolioFields on TecPortfolio {\n id\n isPublished\n publicSlug\n publishedAt\n items {\n ...PortfolioItemFields\n }\n }\n`;\n\nconst GET_MY_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n query TecMyPortfolio {\n tecMyPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nconst ADD_PORTFOLIO_ITEM = gql`\n ${PORTFOLIO_ITEM_FIELDS}\n mutation TecAddPortfolioItem($input: TecAddPortfolioItemInput!) {\n tecAddPortfolioItem(input: $input) {\n ...PortfolioItemFields\n }\n }\n`;\n\nconst REORDER_PORTFOLIO_ITEMS = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecReorderPortfolioItems($input: TecReorderPortfolioItemsInput!) {\n tecReorderPortfolioItems(input: $input) {\n ...PortfolioFields\n }\n }\n`;\n\nconst REMOVE_PORTFOLIO_ITEM = gql`\n mutation TecRemovePortfolioItem($id: ID!) {\n tecRemovePortfolioItem(id: $id)\n }\n`;\n\nconst PUBLISH_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecPublishPortfolio {\n tecPublishPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nconst UNPUBLISH_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecUnpublishPortfolio {\n tecUnpublishPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nexport const useMyPortfolioQuery = () =>\n useQuery<{ tecMyPortfolio: TecPortfolio }>(GET_MY_PORTFOLIO, {\n fetchPolicy: 'cache-and-network',\n });\n\nconst REFETCH_PORTFOLIO = ['TecMyPortfolio'];\n\nexport const useAddPortfolioItem = () =>\n useMutation<{ tecAddPortfolioItem: TecPortfolioItem }>(ADD_PORTFOLIO_ITEM, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const useReorderPortfolioItems = () =>\n useMutation<{ tecReorderPortfolioItems: TecPortfolio }>(REORDER_PORTFOLIO_ITEMS, {\n onError: onMutationError,\n });\n\nexport const useRemovePortfolioItem = () =>\n useMutation<{ tecRemovePortfolioItem: boolean }>(REMOVE_PORTFOLIO_ITEM, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const usePublishPortfolio = () =>\n useMutation<{ tecPublishPortfolio: TecPortfolio }>(PUBLISH_PORTFOLIO, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const useUnpublishPortfolio = () =>\n useMutation<{ tecUnpublishPortfolio: TecPortfolio }>(UNPUBLISH_PORTFOLIO, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\n/* ------------------------------------------------ TechnoSage review (BOFF-3841) */\n\nexport type TecReviewSource = 'AI' | 'RULES';\n\n/**\n * TechnoSage's explanation of one of the caller's own graded submissions.\n * It explains the grader's verdict and never changes it. `source` says who\n * wrote it: a model (AI) or the grader output alone (RULES).\n */\nexport interface TecSubmissionReview {\n id: string;\n submissionId: string;\n problemId: string;\n verdict: TecSubmissionVerdict;\n summary: string;\n failureExplanation: string;\n conceptsToRevisit: string[];\n suggestedProblems: Array<Pick<TecProblem, 'id' | 'title' | 'difficulty' | 'topic'>>;\n source: TecReviewSource;\n model: string | null;\n createdAt: string;\n}\n\nconst SUBMISSION_REVIEW_FIELDS = gql`\n fragment SubmissionReviewFields on TecSubmissionReview {\n id\n submissionId\n problemId\n verdict\n summary\n failureExplanation\n conceptsToRevisit\n suggestedProblems {\n id\n title\n difficulty\n topic\n }\n source\n model\n createdAt\n }\n`;\n\nconst MY_SUBMISSION_REVIEW = gql`\n ${SUBMISSION_REVIEW_FIELDS}\n query TecMySubmissionReview($submissionId: ID!) {\n tecMySubmissionReview(submissionId: $submissionId) {\n ...SubmissionReviewFields\n }\n }\n`;\n\nconst REVIEW_SUBMISSION = gql`\n ${SUBMISSION_REVIEW_FIELDS}\n mutation TecReviewSubmission($submissionId: ID!) {\n tecReviewSubmission(submissionId: $submissionId) {\n ...SubmissionReviewFields\n }\n }\n`;\n\n/** The stored review of a submission, if the learner already asked for one. */\nexport const useMySubmissionReviewQuery = (submissionId: string | null) =>\n useQuery<{ tecMySubmissionReview: TecSubmissionReview | null }>(MY_SUBMISSION_REVIEW, {\n variables: { submissionId: submissionId ?? '' },\n skip: !submissionId,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useReviewSubmission = () =>\n useMutation<{ tecReviewSubmission: TecSubmissionReview }>(REVIEW_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: ['TecMySubmissionReview'],\n });\n\n/* ------------------------------------------------------- pagination helper */\n\nexport interface PageLimit {\n limit: number;\n more: () => void;\n}\n\n/**\n * Simple, robust \"load more\". The backend paginates with `take = limit + 1`\n * (offset is ignored; only `cursor` shifts the window), so a larger `limit`\n * simply fetches more rows from the top and `pageInfo.hasMore` reports whether\n * still more exist. Growing the limit avoids cursor-merge/fetchMore complexity\n * and never sends `cursor: null` (the page-1 500 guard). Pass `limit` into the\n * query's `pageArg` and render <LoadMore hasMore={...} onClick={more} />.\n */\nexport function usePageLimit(step = 24, initial = 24): PageLimit {\n const [limit, setLimit] = useState(initial);\n return { limit, more: () => setLimit((l) => l + step) };\n}\n\n/* ------------------------------------------------- lesson player (BOFF-4107) */\n\nconst GET_LESSON_PLAYER = gql`\n ${LESSON_FIELDS}\n ${COURSE_FIELDS}\n ${ENROLLMENT_FIELDS}\n query TecLessonPlayer($lessonId: ID!, $courseId: ID!) {\n tecLesson(id: $lessonId) {\n ...LessonFields\n file {\n id\n name\n mimeType\n downloadUrl\n }\n }\n tecCourse(id: $courseId) {\n ...CourseFields\n lessons {\n id\n courseId\n title\n kind\n position\n estimatedMinutes\n isPreview\n isLocked\n completedByMe\n }\n }\n tecMyEnrollments(courseId: $courseId, pagination: { limit: 1 }) {\n items {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\n/**\n * The signed-in learner's own enrollments with where \"Resume\" should land.\n * Self-scoped (`tecMyEnrollments`); used by My Learning and the dashboard to\n * deep-link straight into the next lesson.\n */\nconst MY_NEXT_LESSONS = gql`\n query TecMyNextLessons($pagination: PaginationInput) {\n tecMyEnrollments(pagination: $pagination) {\n items {\n id\n courseId\n nextLessonId\n }\n }\n }\n`;\n\nconst LESSON_QUIZ_KEY = gql`\n query TecLessonQuizKey($lessonId: ID!) {\n tecLessonQuizKey(lessonId: $lessonId) {\n prompt\n options\n correctOption\n explanation\n }\n }\n`;\n\nconst COMPLETE_LESSON = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecCompleteLesson($lessonId: ID!) {\n tecCompleteLesson(lessonId: $lessonId) {\n ...EnrollmentFields\n nextLessonId\n }\n }\n`;\n\nconst SUBMIT_LESSON_QUIZ = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecSubmitLessonQuiz($lessonId: ID!, $answers: [Int!]!) {\n tecSubmitLessonQuiz(lessonId: $lessonId, answers: $answers) {\n lessonId\n score\n correctCount\n totalCount\n passed\n passingScore\n results {\n index\n correct\n selectedOption\n correctOption\n explanation\n }\n enrollment {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\nconst RUN_LESSON_CODE = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecRunLessonCode($input: TecRunLessonCodeInput!) {\n tecRunLessonCode(input: $input) {\n lessonId\n status\n language\n stdout\n stderr\n exitCode\n durationMs\n timedOut\n memoryLimitExceeded\n compileFailed\n matchedExpected\n lessonCompleted\n enrollment {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\nexport interface LessonPlayerData {\n tecLesson: TecLesson | null;\n tecCourse: TecCourse | null;\n tecMyEnrollments: { items: TecEnrollment[] };\n}\n\nexport const useLessonPlayerQuery = (courseId: string, lessonId: string) =>\n useQuery<LessonPlayerData>(GET_LESSON_PLAYER, {\n variables: { courseId, lessonId },\n skip: !courseId || !lessonId,\n fetchPolicy: 'cache-and-network',\n });\n\n/** courseId → next lesson id for the signed-in learner's enrollments. */\nexport const useMyNextLessonsQuery = () =>\n useQuery<{\n tecMyEnrollments: { items: Pick<TecEnrollment, 'id' | 'courseId' | 'nextLessonId'>[] };\n }>(MY_NEXT_LESSONS, {\n variables: { pagination: pageArg(100) },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useLessonQuizKeyQuery = (lessonId: string, skip = false) =>\n useQuery<{ tecLessonQuizKey: TecQuizQuestionKey[] }>(LESSON_QUIZ_KEY, {\n variables: { lessonId },\n skip: skip || !lessonId,\n fetchPolicy: 'network-only',\n });\n\nconst LESSON_PROGRESS_REFETCH = [\n 'TecLessonPlayer',\n 'TecCourse',\n 'TecMyNextLessons',\n REFETCH.enrollments,\n];\n\nexport const useCompleteLesson = () =>\n useMutation<{ tecCompleteLesson: TecEnrollment }>(COMPLETE_LESSON, {\n onError: onMutationError,\n refetchQueries: LESSON_PROGRESS_REFETCH,\n });\n\nexport const useSubmitLessonQuiz = () =>\n useMutation<{ tecSubmitLessonQuiz: TecQuizResult }>(SUBMIT_LESSON_QUIZ, {\n onError: onMutationError,\n refetchQueries: LESSON_PROGRESS_REFETCH,\n });\n\n/**\n * Runs code for an INTERACTIVE lesson. No refetch here: the page refetches\n * only when a run actually completed the lesson, so polling a warming\n * sandbox does not reload the page each time.\n */\nexport const useRunLessonCode = () =>\n useMutation<{ tecRunLessonCode: TecLessonCodeRun }>(RUN_LESSON_CODE, {\n onError: onMutationError,\n });\n"],"mappings":";;;;;;AAsYA,SAAgB,EAAQ,IAAQ,IAAI,GAA4D;AAC9F,QAAO,IAAS;EAAE;EAAO;EAAQ,GAAG,EAAE,UAAO;;AAK/C,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;GAoBnB,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;GAyBnB,IAAoB,CAAG;;;;;;;;;;;;;;GAgBvB,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;GAwBpB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BvB,IAA2B,CAAG;;;;;;;;;;;GAa9B,IAAgB,CAAG;;;;;;;;;;;;;;;;;GAmBnB,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;GAuBpB,IAAmB,CAAG;;;;;;;;;;;;;;;;;;GAoBtB,IAAc,CAAG;;;;;;;;;;;;;;;;;GAmBjB,IAAqB,CAAG;;;;;;;;;;;;;GAiBxB,IAAe,CAAG;IACpB,EAAc;;;;;;;;;;;;;;;;GAkBZ,KAAa,CAAG;IAClB,EAAc;IACd,EAAc;IACd,EAAkB;;;;;;;;;;;;GAchB,KAAmB,CAAG;IACxB,EAAkB;IAClB,EAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BZ,KAAoB,CAAG;IACzB,EAAmB;IACnB,EAAc;;;;;;;;;GAkBZ,KAAkB,CAAG;IACvB,EAAmB;IACnB,EAAc;;;;;;;;;GAWZ,KAAgB,CAAG;IACrB,EAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8Bb,KAAc,CAAG;IACnB,EAAe;IACf,EAAkB;IAClB,EAAyB;;;;;;;;;;;;GAcvB,KAAq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mB;CAC5C,WAAW;EAAE;EAAU;EAAU;CACjC,MAAM,CAAC,KAAY,CAAC;CACpB,aAAa;CACd,CAAC,EAGS,WACX,EAEG,GAAiB;CAClB,WAAW,EAAE,YAAY,EAAQ,IAAI,EAAE;CACvC,aAAa;CACd,CAAC,EAES,MAAyB,GAAkB,IAAO,OAC7D,EAAqD,IAAiB;CACpE,WAAW,EAAE,aAAU;CACvB,MAAM,KAAQ,CAAC;CACf,aAAa;CACd,CAAC,EAEE,IAA0B;CAC9B;CACA;CACA;CACA,EAAQ;CACT,EAEY,WACX,EAAkD,IAAiB;CACjE,SAAS;CACT,gBAAgB;CACjB,CAAC,EAES,WACX,EAAoD,IAAoB;CACtE,SAAS;CACT,gBAAgB;CACjB,CAAC,EAOS,WACX,EAAoD,IAAiB,EACnE,SAAS,GACV,CAAC"}
1
+ {"version":3,"file":"technospamApi.js","names":[],"sources":["../../../src/technospam/api/technospamApi.ts"],"sourcesContent":["/**\n * TechnoSpam data layer — Apollo operations + typed hooks over the\n * wspace-technospam-svc subgraph (Tec* fields), reached through the host\n * shell's default workspace ApolloProvider (defaultGateway: \"workspace\").\n *\n * Every page consumes real backend data through these hooks. There is NO mock\n * data. List queries are cursor-paginated: page 1 omits `cursor` entirely\n * (passing cursor: null makes the Prisma cursor resolver 500), \"load more\"\n * passes the previous page's `pageInfo.cursor`.\n */\nimport { useState } from 'react';\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\nimport { userMessageFromError } from '../lib/errorMessage';\n\n/* ------------------------------------------------------------------ enums */\n\nexport type TecCourseLevel = 'BEGINNER' | 'INTERMEDIATE' | 'ADVANCED' | 'EXPERT';\nexport type TecCourseStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\nexport type TecLessonKind = 'VIDEO' | 'ARTICLE' | 'INTERACTIVE' | 'QUIZ' | 'PROJECT';\nexport type TecEnrollmentStatus = 'ENROLLED' | 'IN_PROGRESS' | 'COMPLETED' | 'DROPPED';\nexport type TecCertificateStatus = 'ISSUED' | 'REVOKED';\nexport type TecProblemDifficulty = 'EASY' | 'MEDIUM' | 'HARD';\nexport type TecProblemStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\nexport type TecInterviewFrequency = 'LOW' | 'MEDIUM' | 'HIGH';\nexport type TecSubmissionVerdict =\n | 'PENDING'\n | 'ACCEPTED'\n | 'WRONG_ANSWER'\n | 'TIME_LIMIT_EXCEEDED'\n | 'RUNTIME_ERROR'\n | 'COMPILE_ERROR';\nexport type TecMentorStatus = 'PENDING' | 'ACTIVE' | 'PAUSED' | 'INACTIVE';\nexport type TecSessionStatus = 'REQUESTED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'NO_SHOW';\nexport type TecHackathonStatus =\n 'DRAFT' | 'REGISTRATION_OPEN' | 'IN_PROGRESS' | 'JUDGING' | 'COMPLETED' | 'CANCELLED';\nexport type TecTeamSubmissionStatus = 'DRAFT' | 'SUBMITTED' | 'DISQUALIFIED' | 'WINNER';\n\n/* ------------------------------------------------------------------ types */\n\nexport interface TecCourse {\n id: string;\n slug: string;\n title: string;\n summary?: string | null;\n topic?: string | null;\n level: TecCourseLevel;\n status: TecCourseStatus;\n tags: string[];\n estimatedMinutes: number;\n instructorId?: string | null;\n /** BOFF-4416: true when this course requires a paid TechnoSpam plan. */\n isPremiumOnly: boolean;\n /**\n * BOFF-4416: computed for the calling workspace — true when this course\n * is `isPremiumOnly` and the workspace has no paid plan. When true, every\n * non-preview lesson's `content` is already null in the API response.\n */\n isLocked: boolean;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n lessons?: TecLesson[];\n enrollments?: TecEnrollment[];\n}\n\nexport interface TecLesson {\n id: string;\n courseId: string;\n title: string;\n kind: TecLessonKind;\n content?: string | null;\n position: number;\n estimatedMinutes: number;\n isPreview: boolean;\n /**\n * BOFF-4416: true when this lesson's `content` is gated behind a paid\n * TechnoSpam plan (never true for `isPreview` lessons). `content` is\n * already null in the API response whenever this is true.\n */\n isLocked: boolean;\n /** BOFF-4107 — INTERACTIVE lessons: language slug the workspace runs (e.g. \"python\"). */\n language?: string | null;\n /** INTERACTIVE lessons: code pre-filled in the editor (null when locked). */\n starterCode?: string | null;\n /** INTERACTIVE lessons: default stdin for a run (null when locked). */\n sampleInput?: string | null;\n /** INTERACTIVE lessons: output a correct program prints; a matching run completes the lesson. */\n expectedOutput?: string | null;\n /** QUIZ lessons: questions without the answer key (empty when locked). */\n quizQuestions?: TecQuizQuestion[];\n /** True when the signed-in learner has completed this lesson. */\n completedByMe?: boolean;\n /** Federated wspace-files-svc File (VIDEO lessons); null when locked. */\n file?: {\n id: string;\n name?: string | null;\n mimeType?: string | null;\n downloadUrl?: string | null;\n } | null;\n course?: TecCourse | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** BOFF-4107: a quiz question as a learner sees it (no answer key). */\nexport interface TecQuizQuestion {\n prompt: string;\n options: string[];\n}\n\n/** BOFF-4107: a quiz question with its answer key (lesson-author view). */\nexport interface TecQuizQuestionKey extends TecQuizQuestion {\n correctOption: number;\n explanation?: string | null;\n}\n\nexport type TecLessonRunStatus = 'COMPLETED' | 'WARMING' | 'UNAVAILABLE';\n\nexport interface TecLessonCodeRun {\n lessonId: string;\n status: TecLessonRunStatus;\n language: string;\n stdout: string;\n stderr: string;\n exitCode: number;\n durationMs: number;\n timedOut: boolean;\n memoryLimitExceeded: boolean;\n compileFailed: boolean;\n matchedExpected?: boolean | null;\n lessonCompleted: boolean;\n enrollment?: TecEnrollment | null;\n}\n\nexport interface TecQuizResult {\n lessonId: string;\n score: number;\n correctCount: number;\n totalCount: number;\n passed: boolean;\n passingScore: number;\n results: {\n index: number;\n correct: boolean;\n selectedOption?: number | null;\n correctOption: number;\n explanation?: string | null;\n }[];\n enrollment?: TecEnrollment | null;\n}\n\nexport interface TecEnrollment {\n id: string;\n courseId: string;\n learnerId: string;\n status: TecEnrollmentStatus;\n progressPct: number;\n lessonsCompleted: number;\n startedAt: string;\n lastActiveAt?: string | null;\n completedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n course?: TecCourse | null;\n /** BOFF-4107: first lesson not yet completed; null when every lesson is done. */\n nextLessonId?: string | null;\n}\n\nexport interface TecCertificate {\n id: string;\n courseId: string;\n learnerId: string;\n serial: string;\n score: number;\n status: TecCertificateStatus;\n issuedAt: string;\n revokedAt?: string | null;\n revokeReason?: string | null;\n createdAt: string;\n course?: TecCourse | null;\n}\n\nexport interface TecProblem {\n id: string;\n slug: string;\n title: string;\n statement?: string | null;\n topic?: string | null;\n difficulty: TecProblemDifficulty;\n status: TecProblemStatus;\n tags: string[];\n languages: string[];\n companies: string[];\n roles: string[];\n interviewFrequency?: TecInterviewFrequency | null;\n points: number;\n starterCode?: string | null;\n /** BOFF-4416: true when this problem requires a paid TechnoSpam plan. */\n isPremiumOnly: boolean;\n /**\n * BOFF-4416: computed for the calling workspace — true when this problem\n * is `isPremiumOnly` and the workspace has no paid plan. `statement` /\n * `starterCode` are already null and `publicTestCases` already empty in\n * the API response whenever this is true.\n */\n isLocked: boolean;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n submissions?: TecSubmission[];\n /** Worked-example fixtures the grader runs against; PUBLIC cases only. */\n publicTestCases?: TecProblemTestCase[];\n}\n\n/** Visibility of a problem test case. Mirrors TecTestCaseVisibility. */\nexport type TecTestCaseVisibility = 'PUBLIC' | 'HIDDEN';\n\n/** Per-test-case outcome of a graded submission. Mirrors TecTestCaseStatus. */\nexport type TecTestCaseStatus =\n 'PASSED' | 'WRONG_ANSWER' | 'RUNTIME_ERROR' | 'TIME_LIMIT_EXCEEDED' | 'COMPILE_ERROR' | 'SKIPPED';\n\n/**\n * A worked-example fixture shown on the problem page. Only PUBLIC cases are\n * ever returned to a learner, so `input`/`expectedOutput` are always present\n * in practice; they stay optional because the schema allows null for the\n * author-facing redacted shape.\n */\nexport interface TecProblemTestCase {\n id: string;\n problemId: string;\n name: string;\n ordering: number;\n visibility: TecTestCaseVisibility;\n timeLimitMs: number;\n input?: string | null;\n expectedOutput?: string | null;\n}\n\n/** Grading detail for one test case of a submission. */\nexport interface TecTestCaseResult {\n testCaseId: string;\n name: string;\n visibility: TecTestCaseVisibility;\n status: TecTestCaseStatus;\n passed: boolean;\n durationMs: number;\n input?: string | null;\n expectedOutput?: string | null;\n actualOutput?: string | null;\n}\n\nexport interface TecSubmission {\n id: string;\n problemId: string;\n learnerId: string;\n language: string;\n code: string;\n verdict: TecSubmissionVerdict;\n runtimeMs: number;\n pointsAwarded: number;\n passedCount: number;\n totalCount: number;\n stderr?: string | null;\n testResults: TecTestCaseResult[];\n judgedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n problem?: TecProblem | null;\n}\n\nexport interface TecMentor {\n id: string;\n userId: string;\n headline: string;\n role?: string | null;\n bio?: string | null;\n expertise: string[];\n hourlyRate: number;\n currency: string;\n status: TecMentorStatus;\n isAcceptingMentees: boolean;\n ratingAvg: number;\n sessionsCount: number;\n createdAt: string;\n updatedAt: string;\n sessions?: TecMentorSession[];\n}\n\nexport interface TecMentorSession {\n id: string;\n mentorId: string;\n menteeId: string;\n topic: string;\n agenda?: string | null;\n scheduledAt: string;\n durationMinutes: number;\n status: TecSessionStatus;\n meetingUrl?: string | null;\n /** Snapshotted from the mentor's rate at booking time (smallest currency unit). */\n costAmount: number;\n currency: string;\n platformFeeAmount: number;\n rating?: number | null;\n feedback?: string | null;\n completedAt?: string | null;\n cancelledAt?: string | null;\n createdAt: string;\n updatedAt: string;\n mentor?: TecMentor | null;\n}\n\n/** Read-only pricing preview for a not-yet-booked session (see tecCalculateSessionCost). */\nexport interface TecSessionCostEstimate {\n mentorId: string;\n durationMinutes: number;\n hourlyRate: number;\n currency: string;\n costAmount: number;\n platformFeeAmount: number;\n platformFeeBps: number;\n netAmount: number;\n}\n\n/** Calculation/ledger-only record of what a mentor is owed for a completed session (see tecMyPayouts). */\nexport type TecPayoutStatus = 'PENDING' | 'PAID';\n\nexport interface TecMentorPayout {\n id: string;\n mentorId: string;\n sessionId: string;\n grossAmount: number;\n platformFeeAmount: number;\n netAmount: number;\n currency: string;\n status: TecPayoutStatus;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface TecHackathon {\n id: string;\n slug: string;\n title: string;\n theme?: string | null;\n description?: string | null;\n status: TecHackathonStatus;\n startAt: string;\n endAt: string;\n submissionDeadline?: string | null;\n prizePool: number;\n currency: string;\n maxTeamSize: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n teams?: TecHackathonTeam[];\n}\n\nexport interface TecHackathonTeam {\n id: string;\n hackathonId: string;\n name: string;\n captainId: string;\n memberIds: string[];\n projectName?: string | null;\n projectUrl?: string | null;\n repoUrl?: string | null;\n pitch?: string | null;\n status: TecTeamSubmissionStatus;\n score: number;\n submittedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n hackathon?: TecHackathon | null;\n}\n\nexport interface TecPageInfo {\n cursor?: string | null;\n hasMore: boolean;\n}\n\nexport interface PaginationInput {\n limit?: number;\n cursor?: string | null;\n}\n\n/** Build a pagination arg that NEVER sends cursor:null (page-1 500 guard). */\nexport function pageArg(limit = 50, cursor?: string | null): { limit: number; cursor?: string } {\n return cursor ? { limit, cursor } : { limit };\n}\n\n/* -------------------------------------------------------------- fragments */\n\nconst COURSE_FIELDS = gql`\n fragment CourseFields on TecCourse {\n id\n slug\n title\n summary\n topic\n level\n status\n tags\n estimatedMinutes\n instructorId\n isPremiumOnly\n isLocked\n publishedAt\n createdAt\n updatedAt\n }\n`;\n\nconst LESSON_FIELDS = gql`\n fragment LessonFields on TecLesson {\n id\n courseId\n title\n kind\n content\n position\n estimatedMinutes\n isPreview\n isLocked\n language\n starterCode\n sampleInput\n expectedOutput\n quizQuestions {\n prompt\n options\n }\n completedByMe\n createdAt\n updatedAt\n }\n`;\n\nconst ENROLLMENT_FIELDS = gql`\n fragment EnrollmentFields on TecEnrollment {\n id\n courseId\n learnerId\n status\n progressPct\n lessonsCompleted\n startedAt\n lastActiveAt\n completedAt\n createdAt\n updatedAt\n }\n`;\n\nconst PROBLEM_FIELDS = gql`\n fragment ProblemFields on TecProblem {\n id\n slug\n title\n statement\n topic\n difficulty\n status\n tags\n languages\n companies\n roles\n interviewFrequency\n points\n starterCode\n isPremiumOnly\n isLocked\n publishedAt\n createdAt\n updatedAt\n }\n`;\n\nconst SUBMISSION_FIELDS = gql`\n fragment SubmissionFields on TecSubmission {\n id\n problemId\n learnerId\n language\n code\n verdict\n runtimeMs\n pointsAwarded\n passedCount\n totalCount\n stderr\n testResults {\n testCaseId\n name\n visibility\n status\n passed\n durationMs\n input\n expectedOutput\n actualOutput\n }\n judgedAt\n createdAt\n updatedAt\n }\n`;\n\nconst PROBLEM_TEST_CASE_FIELDS = gql`\n fragment ProblemTestCaseFields on TecProblemTestCase {\n id\n problemId\n name\n ordering\n visibility\n timeLimitMs\n input\n expectedOutput\n }\n`;\n\nconst MENTOR_FIELDS = gql`\n fragment MentorFields on TecMentor {\n id\n userId\n headline\n role\n bio\n expertise\n hourlyRate\n currency\n status\n isAcceptingMentees\n ratingAvg\n sessionsCount\n createdAt\n updatedAt\n }\n`;\n\nconst SESSION_FIELDS = gql`\n fragment SessionFields on TecMentorSession {\n id\n mentorId\n menteeId\n topic\n agenda\n scheduledAt\n durationMinutes\n status\n meetingUrl\n costAmount\n currency\n platformFeeAmount\n rating\n feedback\n completedAt\n cancelledAt\n createdAt\n updatedAt\n }\n`;\n\nconst HACKATHON_FIELDS = gql`\n fragment HackathonFields on TecHackathon {\n id\n slug\n title\n theme\n description\n status\n startAt\n endAt\n submissionDeadline\n prizePool\n currency\n maxTeamSize\n tags\n createdAt\n updatedAt\n }\n`;\n\nconst TEAM_FIELDS = gql`\n fragment TeamFields on TecHackathonTeam {\n id\n hackathonId\n name\n captainId\n memberIds\n projectName\n projectUrl\n repoUrl\n pitch\n status\n score\n submittedAt\n createdAt\n updatedAt\n }\n`;\n\nconst CERTIFICATE_FIELDS = gql`\n fragment CertificateFields on TecCertificate {\n id\n courseId\n learnerId\n serial\n score\n status\n issuedAt\n revokedAt\n revokeReason\n createdAt\n }\n`;\n\n/* --------------------------------------------------------------- queries */\n\nconst LIST_COURSES = gql`\n ${COURSE_FIELDS}\n query TecListCourses(\n $level: TecCourseLevel\n $status: TecCourseStatus\n $pagination: PaginationInput\n ) {\n tecListCourses(level: $level, status: $status, pagination: $pagination) {\n items {\n ...CourseFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_COURSE = gql`\n ${COURSE_FIELDS}\n ${LESSON_FIELDS}\n ${ENROLLMENT_FIELDS}\n query TecCourse($id: ID!) {\n tecCourse(id: $id) {\n ...CourseFields\n lessons {\n ...LessonFields\n }\n enrollments {\n ...EnrollmentFields\n }\n }\n }\n`;\n\nconst LIST_ENROLLMENTS = gql`\n ${ENROLLMENT_FIELDS}\n ${COURSE_FIELDS}\n query TecListEnrollments(\n $learnerId: ID\n $courseId: ID\n $pagination: PaginationInput\n $startDate: DateTime\n $endDate: DateTime\n ) {\n tecListEnrollments(\n learnerId: $learnerId\n courseId: $courseId\n pagination: $pagination\n startDate: $startDate\n endDate: $endDate\n ) {\n items {\n ...EnrollmentFields\n course {\n ...CourseFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_CERTIFICATES = gql`\n ${CERTIFICATE_FIELDS}\n ${COURSE_FIELDS}\n query TecListCertificates($learnerId: ID, $courseId: ID) {\n tecListCertificates(learnerId: $learnerId, courseId: $courseId) {\n ...CertificateFields\n course {\n ...CourseFields\n }\n }\n }\n`;\n\n/**\n * The calling learner's OWN certificates. Self-scoped (`@rbac(scopeType:\n * \"self\")`) — the resolver forces `learnerId = ctx.actor.id`, so no learnerId\n * variable is ever sent. Learner-facing surfaces must use this instead of\n * `tecListCertificates`, which is gated behind the cross-learner `list-all`\n * action that a plain workspace member does not hold.\n */\nconst MY_CERTIFICATES = gql`\n ${CERTIFICATE_FIELDS}\n ${COURSE_FIELDS}\n query TecMyCertificates($courseId: ID) {\n tecMyCertificates(courseId: $courseId) {\n ...CertificateFields\n course {\n ...CourseFields\n }\n }\n }\n`;\n\nconst LIST_PROBLEMS = gql`\n ${PROBLEM_FIELDS}\n query TecListProblems(\n $difficulty: TecProblemDifficulty\n $status: TecProblemStatus\n $topic: String\n $company: String\n $role: String\n $interviewFrequency: TecInterviewFrequency\n $pagination: PaginationInput\n ) {\n tecListProblems(\n difficulty: $difficulty\n status: $status\n topic: $topic\n company: $company\n role: $role\n interviewFrequency: $interviewFrequency\n pagination: $pagination\n ) {\n items {\n ...ProblemFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n ${SUBMISSION_FIELDS}\n ${PROBLEM_TEST_CASE_FIELDS}\n query TecProblem($id: ID!) {\n tecProblem(id: $id) {\n ...ProblemFields\n publicTestCases {\n ...ProblemTestCaseFields\n }\n submissions {\n ...SubmissionFields\n }\n }\n }\n`;\n\nconst REGRADE_SUBMISSION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecRegradeSubmission($id: ID!) {\n tecRegradeSubmission(id: $id) {\n ...SubmissionFields\n }\n }\n`;\n\nconst LIST_SUBMISSIONS = gql`\n ${SUBMISSION_FIELDS}\n ${PROBLEM_FIELDS}\n query TecListSubmissions(\n $learnerId: ID\n $problemId: ID\n $pagination: PaginationInput\n $startDate: DateTime\n $endDate: DateTime\n ) {\n tecListSubmissions(\n learnerId: $learnerId\n problemId: $problemId\n pagination: $pagination\n startDate: $startDate\n endDate: $endDate\n ) {\n items {\n ...SubmissionFields\n problem {\n ...ProblemFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_MENTORS = gql`\n ${MENTOR_FIELDS}\n query TecListMentors($status: TecMentorStatus, $pagination: PaginationInput) {\n tecListMentors(status: $status, pagination: $pagination) {\n items {\n ...MentorFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_MENTOR = gql`\n ${MENTOR_FIELDS}\n ${SESSION_FIELDS}\n query TecMentor($id: ID!) {\n tecMentor(id: $id) {\n ...MentorFields\n sessions {\n ...SessionFields\n }\n }\n }\n`;\n\nconst LIST_SESSIONS = gql`\n ${SESSION_FIELDS}\n ${MENTOR_FIELDS}\n query TecListSessions(\n $mentorId: ID\n $menteeId: ID\n $status: TecSessionStatus\n $pagination: PaginationInput\n ) {\n tecListSessions(\n mentorId: $mentorId\n menteeId: $menteeId\n status: $status\n pagination: $pagination\n ) {\n items {\n ...SessionFields\n mentor {\n ...MentorFields\n }\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst CALCULATE_SESSION_COST = gql`\n query TecCalculateSessionCost($mentorId: ID!, $durationMinutes: Int) {\n tecCalculateSessionCost(mentorId: $mentorId, durationMinutes: $durationMinutes) {\n mentorId\n durationMinutes\n hourlyRate\n currency\n costAmount\n platformFeeAmount\n platformFeeBps\n netAmount\n }\n }\n`;\n\nconst PAYOUT_FIELDS = gql`\n fragment PayoutFields on TecMentorPayout {\n id\n mentorId\n sessionId\n grossAmount\n platformFeeAmount\n netAmount\n currency\n status\n createdAt\n updatedAt\n }\n`;\n\nconst MY_PAYOUTS = gql`\n ${PAYOUT_FIELDS}\n query TecMyPayouts($status: TecPayoutStatus, $pagination: PaginationInput) {\n tecMyPayouts(status: $status, pagination: $pagination) {\n items {\n ...PayoutFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_HACKATHONS = gql`\n ${HACKATHON_FIELDS}\n query TecListHackathons($status: TecHackathonStatus, $pagination: PaginationInput) {\n tecListHackathons(status: $status, pagination: $pagination) {\n items {\n ...HackathonFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GET_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n ${TEAM_FIELDS}\n query TecHackathon($id: ID!) {\n tecHackathon(id: $id) {\n ...HackathonFields\n teams {\n ...TeamFields\n }\n }\n }\n`;\n\nconst LIST_TEAMS = gql`\n ${TEAM_FIELDS}\n query TecListTeams($hackathonId: ID!, $pagination: PaginationInput) {\n tecListTeams(hackathonId: $hackathonId, pagination: $pagination) {\n items {\n ...TeamFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst LIST_LESSONS = gql`\n ${LESSON_FIELDS}\n query TecListLessons($courseId: ID!, $pagination: PaginationInput) {\n tecListLessons(courseId: $courseId, pagination: $pagination) {\n items {\n ...LessonFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\n/* ------------------------------------------------------- response typings */\n\ntype Conn<K extends string, T> = Record<K, { items: T[]; pageInfo: TecPageInfo }>;\n\n/* ---------------------------------------------------------- query hooks */\n\nexport const useCoursesQuery = (vars: {\n level?: TecCourseLevel;\n status?: TecCourseStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListCourses', TecCourse>>(LIST_COURSES, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useCourseQuery = (id: string) =>\n useQuery<{ tecCourse: TecCourse | null }>(GET_COURSE, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useEnrollmentsQuery = (vars: {\n learnerId?: string;\n courseId?: string;\n startDate?: string;\n endDate?: string;\n}) =>\n useQuery<Conn<'tecListEnrollments', TecEnrollment>>(LIST_ENROLLMENTS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\n/**\n * Cross-learner certificate read (instructor/admin). Requires the `list-all`\n * action — learner surfaces want `useMyCertificatesQuery` instead.\n */\nexport const useCertificatesQuery = (vars: { learnerId?: string; courseId?: string }) =>\n useQuery<{ tecListCertificates: TecCertificate[] }>(LIST_CERTIFICATES, {\n variables: vars,\n fetchPolicy: 'cache-and-network',\n });\n\n/** The signed-in learner's own certificates (self-scoped; no learnerId sent). */\nexport const useMyCertificatesQuery = (vars: { courseId?: string } = {}) =>\n useQuery<{ tecMyCertificates: TecCertificate[] }>(MY_CERTIFICATES, {\n variables: vars,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useProblemsQuery = (vars: {\n difficulty?: TecProblemDifficulty;\n status?: TecProblemStatus;\n topic?: string;\n company?: string;\n role?: string;\n interviewFrequency?: TecInterviewFrequency;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListProblems', TecProblem>>(LIST_PROBLEMS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useProblemQuery = (id: string) =>\n useQuery<{ tecProblem: TecProblem | null }>(GET_PROBLEM, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useSubmissionsQuery = (vars: {\n learnerId?: string;\n problemId?: string;\n startDate?: string;\n endDate?: string;\n}) =>\n useQuery<Conn<'tecListSubmissions', TecSubmission>>(LIST_SUBMISSIONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useMentorsQuery = (vars: {\n status?: TecMentorStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListMentors', TecMentor>>(LIST_MENTORS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useMentorQuery = (id: string) =>\n useQuery<{ tecMentor: TecMentor | null }>(GET_MENTOR, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useSessionsQuery = (vars: {\n mentorId?: string;\n menteeId?: string;\n status?: TecSessionStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListSessions', TecMentorSession>>(LIST_SESSIONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\n/**\n * Live pricing preview for a not-yet-booked session -- refetches whenever\n * mentorId/durationMinutes change (Apollo re-runs on variable change), so\n * the booking form always shows the cost that would actually be snapshotted\n * onto the session by tecBookSession. `skip` while mentorId is empty.\n */\nexport const useSessionCostEstimate = (mentorId: string, durationMinutes: number) =>\n useQuery<{ tecCalculateSessionCost: TecSessionCostEstimate }>(CALCULATE_SESSION_COST, {\n variables: { mentorId, durationMinutes },\n skip: !mentorId || !Number.isFinite(durationMinutes) || durationMinutes <= 0,\n fetchPolicy: 'cache-and-network',\n });\n\n/** The calling mentor's own payout ledger (calculation-only -- see BOFF-4433). */\nexport const useMyPayoutsQuery = (\n vars: { status?: TecPayoutStatus; pagination?: { limit: number; cursor?: string } } = {}\n) =>\n useQuery<Conn<'tecMyPayouts', TecMentorPayout>>(MY_PAYOUTS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useHackathonsQuery = (vars: {\n status?: TecHackathonStatus;\n pagination?: { limit: number; cursor?: string };\n}) =>\n useQuery<Conn<'tecListHackathons', TecHackathon>>(LIST_HACKATHONS, {\n variables: { pagination: pageArg(50), ...vars },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useHackathonQuery = (id: string) =>\n useQuery<{ tecHackathon: TecHackathon | null }>(GET_HACKATHON, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useTeamsQuery = (\n hackathonId: string,\n pagination?: { limit: number; cursor?: string }\n) =>\n useQuery<Conn<'tecListTeams', TecHackathonTeam>>(LIST_TEAMS, {\n variables: { hackathonId, pagination: pagination ?? pageArg(50) },\n skip: !hackathonId,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useLessonsQuery = (\n courseId: string,\n pagination?: { limit: number; cursor?: string }\n) =>\n useQuery<Conn<'tecListLessons', TecLesson>>(LIST_LESSONS, {\n variables: { courseId, pagination: pagination ?? pageArg(50) },\n skip: !courseId,\n fetchPolicy: 'cache-and-network',\n });\n\n/* ------------------------------------------------------------ mutations */\n\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', userMessageFromError(error));\n};\n\nconst REFETCH = {\n courses: 'TecListCourses',\n enrollments: 'TecListEnrollments',\n problems: 'TecListProblems',\n submissions: 'TecListSubmissions',\n mentors: 'TecListMentors',\n sessions: 'TecListSessions',\n hackathons: 'TecListHackathons',\n} as const;\n\nconst ENROLL = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecEnroll($input: TecEnrollInput!) {\n tecEnroll(input: $input) {\n ...EnrollmentFields\n }\n }\n`;\n\nconst SUBMIT_SOLUTION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecSubmitSolution($input: TecSubmitSolutionInput!) {\n tecSubmitSolution(input: $input) {\n ...SubmissionFields\n }\n }\n`;\n\nconst BOOK_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecBookSession($input: TecBookSessionInput!) {\n tecBookSession(input: $input) {\n ...SessionFields\n }\n }\n`;\n\nconst CANCEL_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecCancelSession($id: ID!) {\n tecCancelSession(id: $id) {\n ...SessionFields\n }\n }\n`;\n\nconst BECOME_MENTOR = gql`\n ${MENTOR_FIELDS}\n mutation TecBecomeMentor($input: TecCreateMentorInput!) {\n tecBecomeMentor(input: $input) {\n ...MentorFields\n }\n }\n`;\n\nconst REGISTER_TEAM = gql`\n ${TEAM_FIELDS}\n mutation TecRegisterTeam($input: TecRegisterTeamInput!) {\n tecRegisterTeam(input: $input) {\n ...TeamFields\n }\n }\n`;\n\nconst SUBMIT_PROJECT = gql`\n ${TEAM_FIELDS}\n mutation TecSubmitProject($input: TecSubmitProjectInput!) {\n tecSubmitProject(input: $input) {\n ...TeamFields\n }\n }\n`;\n\n/* ------- admin / authoring mutations ------- */\n\nconst CREATE_COURSE = gql`\n ${COURSE_FIELDS}\n mutation TecCreateCourse($input: TecCreateCourseInput!) {\n tecCreateCourse(input: $input) {\n ...CourseFields\n }\n }\n`;\n\nconst PUBLISH_COURSE = gql`\n ${COURSE_FIELDS}\n mutation TecPublishCourse($id: ID!) {\n tecPublishCourse(id: $id) {\n ...CourseFields\n }\n }\n`;\n\nconst ARCHIVE_COURSE = gql`\n mutation TecArchiveCourse($id: ID!) {\n tecArchiveCourse(id: $id)\n }\n`;\n\nconst CREATE_LESSON = gql`\n ${LESSON_FIELDS}\n mutation TecCreateLesson($input: TecCreateLessonInput!) {\n tecCreateLesson(input: $input) {\n ...LessonFields\n }\n }\n`;\n\nconst UPDATE_LESSON = gql`\n ${LESSON_FIELDS}\n mutation TecUpdateLesson($id: ID!, $input: TecUpdateLessonInput!) {\n tecUpdateLesson(id: $id, input: $input) {\n ...LessonFields\n }\n }\n`;\n\nconst CREATE_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n mutation TecCreateProblem($input: TecCreateProblemInput!) {\n tecCreateProblem(input: $input) {\n ...ProblemFields\n }\n }\n`;\n\nconst PUBLISH_PROBLEM = gql`\n ${PROBLEM_FIELDS}\n mutation TecPublishProblem($id: ID!) {\n tecPublishProblem(id: $id) {\n ...ProblemFields\n }\n }\n`;\n\nconst CREATE_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecCreateHackathon($input: TecCreateHackathonInput!) {\n tecCreateHackathon(input: $input) {\n ...HackathonFields\n }\n }\n`;\n\nconst OPEN_REGISTRATION = gql`\n ${HACKATHON_FIELDS}\n mutation TecOpenRegistration($id: ID!) {\n tecOpenRegistration(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst APPROVE_MENTOR = gql`\n ${MENTOR_FIELDS}\n mutation TecApproveMentor($id: ID!) {\n tecApproveMentor(id: $id) {\n ...MentorFields\n }\n }\n`;\n\nconst SCORE_TEAM = gql`\n ${TEAM_FIELDS}\n mutation TecScoreTeam($id: ID!, $score: Int!, $winner: Boolean) {\n tecScoreTeam(id: $id, score: $score, winner: $winner) {\n ...TeamFields\n }\n }\n`;\n\nconst CONFIRM_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecConfirmSession($id: ID!, $meetingUrl: String) {\n tecConfirmSession(id: $id, meetingUrl: $meetingUrl) {\n ...SessionFields\n }\n }\n`;\n\nconst COMPLETE_SESSION = gql`\n ${SESSION_FIELDS}\n mutation TecCompleteSession($id: ID!, $rating: Int, $feedback: String) {\n tecCompleteSession(id: $id, rating: $rating, feedback: $feedback) {\n ...SessionFields\n }\n }\n`;\n\nconst GRADE_SUBMISSION = gql`\n ${SUBMISSION_FIELDS}\n mutation TecGradeSubmission($id: ID!, $verdict: TecSubmissionVerdict!, $runtimeMs: Int) {\n tecGradeSubmission(id: $id, verdict: $verdict, runtimeMs: $runtimeMs) {\n ...SubmissionFields\n }\n }\n`;\n\nconst ISSUE_CERTIFICATE = gql`\n ${CERTIFICATE_FIELDS}\n mutation TecIssueCertificate($courseId: ID!, $learnerId: ID!, $score: Int!) {\n tecIssueCertificate(courseId: $courseId, learnerId: $learnerId, score: $score) {\n ...CertificateFields\n }\n }\n`;\n\nconst REVOKE_CERTIFICATE = gql`\n ${CERTIFICATE_FIELDS}\n mutation TecRevokeCertificate($id: ID!, $reason: String) {\n tecRevokeCertificate(id: $id, reason: $reason) {\n ...CertificateFields\n }\n }\n`;\n\nconst START_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecStartHackathon($id: ID!) {\n tecStartHackathon(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst START_JUDGING = gql`\n ${HACKATHON_FIELDS}\n mutation TecStartJudging($id: ID!) {\n tecStartJudging(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\nconst COMPLETE_HACKATHON = gql`\n ${HACKATHON_FIELDS}\n mutation TecCompleteHackathon($id: ID!) {\n tecCompleteHackathon(id: $id) {\n ...HackathonFields\n }\n }\n`;\n\n/* ---------------------------------------------------------- mutation hooks */\n\nexport const useEnroll = () =>\n useMutation<{ tecEnroll: TecEnrollment }>(ENROLL, {\n onError: onMutationError,\n refetchQueries: [REFETCH.enrollments, REFETCH.courses],\n });\n\nexport const useSubmitSolution = () =>\n useMutation<{ tecSubmitSolution: TecSubmission }>(SUBMIT_SOLUTION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\n/**\n * Re-run the grader for a submission. Used by the problem page when a verdict\n * came back PENDING (grader unavailable at submit time) so a learner can retry\n * without resubmitting identical code.\n */\nexport const useRegradeSubmission = () =>\n useMutation<{ tecRegradeSubmission: TecSubmission }>(REGRADE_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\nexport const useBookSession = () =>\n useMutation<{ tecBookSession: TecMentorSession }>(BOOK_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions, REFETCH.mentors],\n });\n\nexport const useCancelSession = () =>\n useMutation<{ tecCancelSession: TecMentorSession }>(CANCEL_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useBecomeMentor = () =>\n useMutation<{ tecBecomeMentor: TecMentor }>(BECOME_MENTOR, {\n onError: onMutationError,\n refetchQueries: [REFETCH.mentors],\n });\n\nexport const useRegisterTeam = () =>\n useMutation<{ tecRegisterTeam: TecHackathonTeam }>(REGISTER_TEAM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useSubmitProject = () =>\n useMutation<{ tecSubmitProject: TecHackathonTeam }>(SUBMIT_PROJECT, {\n onError: onMutationError,\n });\n\nexport const useCreateCourse = () =>\n useMutation<{ tecCreateCourse: TecCourse }>(CREATE_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const usePublishCourse = () =>\n useMutation<{ tecPublishCourse: TecCourse }>(PUBLISH_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const useArchiveCourse = () =>\n useMutation<{ tecArchiveCourse: boolean }>(ARCHIVE_COURSE, {\n onError: onMutationError,\n refetchQueries: [REFETCH.courses],\n });\n\nexport const useCreateLesson = () =>\n useMutation<{ tecCreateLesson: TecLesson }>(CREATE_LESSON, { onError: onMutationError });\n\n/**\n * Edit an already-authored lesson (title/kind/content/minutes/preview/position).\n * Every field on TecUpdateLessonInput is optional — send only what changed.\n */\nexport const useUpdateLesson = () =>\n useMutation<{ tecUpdateLesson: TecLesson }>(UPDATE_LESSON, { onError: onMutationError });\n\nexport const useCreateProblem = () =>\n useMutation<{ tecCreateProblem: TecProblem }>(CREATE_PROBLEM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.problems],\n });\n\nexport const usePublishProblem = () =>\n useMutation<{ tecPublishProblem: TecProblem }>(PUBLISH_PROBLEM, {\n onError: onMutationError,\n refetchQueries: [REFETCH.problems],\n });\n\nexport const useCreateHackathon = () =>\n useMutation<{ tecCreateHackathon: TecHackathon }>(CREATE_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useOpenRegistration = () =>\n useMutation<{ tecOpenRegistration: TecHackathon }>(OPEN_REGISTRATION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useApproveMentor = () =>\n useMutation<{ tecApproveMentor: TecMentor }>(APPROVE_MENTOR, {\n onError: onMutationError,\n refetchQueries: [REFETCH.mentors],\n });\n\nexport const useScoreTeam = () =>\n useMutation<{ tecScoreTeam: TecHackathonTeam }>(SCORE_TEAM, { onError: onMutationError });\n\nexport const useConfirmSession = () =>\n useMutation<{ tecConfirmSession: TecMentorSession }>(CONFIRM_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useCompleteSession = () =>\n useMutation<{ tecCompleteSession: TecMentorSession }>(COMPLETE_SESSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.sessions],\n });\n\nexport const useGradeSubmission = () =>\n useMutation<{ tecGradeSubmission: TecSubmission }>(GRADE_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: [REFETCH.submissions],\n });\n\nexport const useIssueCertificate = () =>\n useMutation<{ tecIssueCertificate: TecCertificate }>(ISSUE_CERTIFICATE, {\n onError: onMutationError,\n });\n\nexport const useRevokeCertificate = () =>\n useMutation<{ tecRevokeCertificate: TecCertificate }>(REVOKE_CERTIFICATE, {\n onError: onMutationError,\n });\n\nexport const useStartHackathon = () =>\n useMutation<{ tecStartHackathon: TecHackathon }>(START_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useStartJudging = () =>\n useMutation<{ tecStartJudging: TecHackathon }>(START_JUDGING, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\nexport const useCompleteHackathon = () =>\n useMutation<{ tecCompleteHackathon: TecHackathon }>(COMPLETE_HACKATHON, {\n onError: onMutationError,\n refetchQueries: [REFETCH.hackathons],\n });\n\n/* ============================================================ Study Planner\n * BOFF-4415 — deterministic, rule-based goal -> plan scheduler. NOT an LLM\n * feature; see the backend StudyPlanService honesty note. Every query/\n * mutation below is self-scoped (learnerId comes from the authenticated\n * actor server-side) so no learnerId variable is ever sent from the client.\n * ========================================================================= */\n\nexport type TecStudyPlanStatus = 'ACTIVE' | 'COMPLETED' | 'ARCHIVED';\nexport type TecStudyPlanStepKind = 'COURSE' | 'PROBLEM';\nexport type TecStudyPlanStepStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'SKIPPED';\n\nexport interface TecStudyPlanStep {\n id: string;\n order: number;\n kind: TecStudyPlanStepKind;\n targetId: string;\n title: string;\n scheduledWeek: number;\n status: TecStudyPlanStepStatus;\n rationale: string;\n estimatedMinutes: number;\n completedAt?: string | null;\n}\n\nexport interface TecStudyPlan {\n id: string;\n goal: string;\n topic?: string | null;\n timeframeWeeks: number;\n status: TecStudyPlanStatus;\n targetCompletionDate?: string | null;\n progressPct: number;\n totalSteps: number;\n completedSteps: number;\n createdAt: string;\n steps: TecStudyPlanStep[];\n}\n\nconst STUDY_PLAN_STEP_FIELDS = gql`\n fragment StudyPlanStepFields on TecStudyPlanStep {\n id\n order\n kind\n targetId\n title\n scheduledWeek\n status\n rationale\n estimatedMinutes\n completedAt\n }\n`;\n\nconst STUDY_PLAN_FIELDS = gql`\n ${STUDY_PLAN_STEP_FIELDS}\n fragment StudyPlanFields on TecStudyPlan {\n id\n goal\n topic\n timeframeWeeks\n status\n targetCompletionDate\n progressPct\n totalSteps\n completedSteps\n createdAt\n steps {\n ...StudyPlanStepFields\n }\n }\n`;\n\nconst LIST_MY_STUDY_PLANS = gql`\n ${STUDY_PLAN_FIELDS}\n query TecMyStudyPlans {\n tecMyStudyPlans {\n items {\n ...StudyPlanFields\n }\n pageInfo {\n cursor\n hasMore\n }\n }\n }\n`;\n\nconst GENERATE_STUDY_PLAN = gql`\n ${STUDY_PLAN_FIELDS}\n mutation TecGenerateStudyPlan($input: TecGenerateStudyPlanInput!) {\n tecGenerateStudyPlan(input: $input) {\n ...StudyPlanFields\n }\n }\n`;\n\nconst UPDATE_STUDY_PLAN_STEP_STATUS = gql`\n ${STUDY_PLAN_STEP_FIELDS}\n mutation TecUpdateStudyPlanStepStatus($input: TecUpdateStudyPlanStepStatusInput!) {\n tecUpdateStudyPlanStepStatus(input: $input) {\n ...StudyPlanStepFields\n }\n }\n`;\n\nconst ARCHIVE_STUDY_PLAN = gql`\n mutation TecArchiveStudyPlan($id: ID!) {\n tecArchiveStudyPlan(id: $id)\n }\n`;\n\nexport const useMyStudyPlansQuery = () =>\n useQuery<{ tecMyStudyPlans: { items: TecStudyPlan[]; pageInfo: TecPageInfo } }>(\n LIST_MY_STUDY_PLANS,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\nexport const useGenerateStudyPlan = () =>\n useMutation<{ tecGenerateStudyPlan: TecStudyPlan }>(GENERATE_STUDY_PLAN, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\nexport const useUpdateStudyPlanStepStatus = () =>\n useMutation<{ tecUpdateStudyPlanStepStatus: TecStudyPlanStep }>(UPDATE_STUDY_PLAN_STEP_STATUS, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\nexport const useArchiveStudyPlan = () =>\n useMutation<{ tecArchiveStudyPlan: boolean }>(ARCHIVE_STUDY_PLAN, {\n onError: onMutationError,\n refetchQueries: ['TecMyStudyPlans'],\n });\n\n/* ================================================================ Portfolio\n * BOFF-4432 — learner-curated showcase of real completed hackathon\n * projects, certificates, and courses. `tecPublicPortfolio` is a public,\n * unauthenticated field (@rbac public: true) reached through the same\n * gateway; there is no separate unauthenticated *page* wired up yet (see\n * ApplicationsPortfolioPagePage's deferred-scope note).\n * ========================================================================= */\n\nexport type TecPortfolioItemKind = 'HACKATHON_PROJECT' | 'CERTIFICATE' | 'COURSE_COMPLETION';\n\nexport interface TecPortfolioItem {\n id: string;\n kind: TecPortfolioItemKind;\n sourceId: string;\n title: string;\n description?: string | null;\n link?: string | null;\n completionDate: string;\n order: number;\n}\n\nexport interface TecPortfolio {\n id: string;\n isPublished: boolean;\n publicSlug?: string | null;\n publishedAt?: string | null;\n items: TecPortfolioItem[];\n}\n\nconst PORTFOLIO_ITEM_FIELDS = gql`\n fragment PortfolioItemFields on TecPortfolioItem {\n id\n kind\n sourceId\n title\n description\n link\n completionDate\n order\n }\n`;\n\nconst PORTFOLIO_FIELDS = gql`\n ${PORTFOLIO_ITEM_FIELDS}\n fragment PortfolioFields on TecPortfolio {\n id\n isPublished\n publicSlug\n publishedAt\n items {\n ...PortfolioItemFields\n }\n }\n`;\n\nconst GET_MY_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n query TecMyPortfolio {\n tecMyPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nconst ADD_PORTFOLIO_ITEM = gql`\n ${PORTFOLIO_ITEM_FIELDS}\n mutation TecAddPortfolioItem($input: TecAddPortfolioItemInput!) {\n tecAddPortfolioItem(input: $input) {\n ...PortfolioItemFields\n }\n }\n`;\n\nconst REORDER_PORTFOLIO_ITEMS = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecReorderPortfolioItems($input: TecReorderPortfolioItemsInput!) {\n tecReorderPortfolioItems(input: $input) {\n ...PortfolioFields\n }\n }\n`;\n\nconst REMOVE_PORTFOLIO_ITEM = gql`\n mutation TecRemovePortfolioItem($id: ID!) {\n tecRemovePortfolioItem(id: $id)\n }\n`;\n\nconst PUBLISH_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecPublishPortfolio {\n tecPublishPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nconst UNPUBLISH_PORTFOLIO = gql`\n ${PORTFOLIO_FIELDS}\n mutation TecUnpublishPortfolio {\n tecUnpublishPortfolio {\n ...PortfolioFields\n }\n }\n`;\n\nexport const useMyPortfolioQuery = () =>\n useQuery<{ tecMyPortfolio: TecPortfolio }>(GET_MY_PORTFOLIO, {\n fetchPolicy: 'cache-and-network',\n });\n\nconst REFETCH_PORTFOLIO = ['TecMyPortfolio'];\n\nexport const useAddPortfolioItem = () =>\n useMutation<{ tecAddPortfolioItem: TecPortfolioItem }>(ADD_PORTFOLIO_ITEM, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const useReorderPortfolioItems = () =>\n useMutation<{ tecReorderPortfolioItems: TecPortfolio }>(REORDER_PORTFOLIO_ITEMS, {\n onError: onMutationError,\n });\n\nexport const useRemovePortfolioItem = () =>\n useMutation<{ tecRemovePortfolioItem: boolean }>(REMOVE_PORTFOLIO_ITEM, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const usePublishPortfolio = () =>\n useMutation<{ tecPublishPortfolio: TecPortfolio }>(PUBLISH_PORTFOLIO, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\nexport const useUnpublishPortfolio = () =>\n useMutation<{ tecUnpublishPortfolio: TecPortfolio }>(UNPUBLISH_PORTFOLIO, {\n onError: onMutationError,\n refetchQueries: REFETCH_PORTFOLIO,\n });\n\n/* ------------------------------------------------ TechnoSage review (BOFF-3841) */\n\nexport type TecReviewSource = 'AI' | 'RULES';\n\n/**\n * TechnoSage's explanation of one of the caller's own graded submissions.\n * It explains the grader's verdict and never changes it. `source` says who\n * wrote it: a model (AI) or the grader output alone (RULES).\n */\nexport interface TecSubmissionReview {\n id: string;\n submissionId: string;\n problemId: string;\n verdict: TecSubmissionVerdict;\n summary: string;\n failureExplanation: string;\n conceptsToRevisit: string[];\n suggestedProblems: Array<Pick<TecProblem, 'id' | 'title' | 'difficulty' | 'topic'>>;\n source: TecReviewSource;\n model: string | null;\n createdAt: string;\n}\n\nconst SUBMISSION_REVIEW_FIELDS = gql`\n fragment SubmissionReviewFields on TecSubmissionReview {\n id\n submissionId\n problemId\n verdict\n summary\n failureExplanation\n conceptsToRevisit\n suggestedProblems {\n id\n title\n difficulty\n topic\n }\n source\n model\n createdAt\n }\n`;\n\nconst MY_SUBMISSION_REVIEW = gql`\n ${SUBMISSION_REVIEW_FIELDS}\n query TecMySubmissionReview($submissionId: ID!) {\n tecMySubmissionReview(submissionId: $submissionId) {\n ...SubmissionReviewFields\n }\n }\n`;\n\nconst REVIEW_SUBMISSION = gql`\n ${SUBMISSION_REVIEW_FIELDS}\n mutation TecReviewSubmission($submissionId: ID!) {\n tecReviewSubmission(submissionId: $submissionId) {\n ...SubmissionReviewFields\n }\n }\n`;\n\n/** The stored review of a submission, if the learner already asked for one. */\nexport const useMySubmissionReviewQuery = (submissionId: string | null) =>\n useQuery<{ tecMySubmissionReview: TecSubmissionReview | null }>(MY_SUBMISSION_REVIEW, {\n variables: { submissionId: submissionId ?? '' },\n skip: !submissionId,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useReviewSubmission = () =>\n useMutation<{ tecReviewSubmission: TecSubmissionReview }>(REVIEW_SUBMISSION, {\n onError: onMutationError,\n refetchQueries: ['TecMySubmissionReview'],\n });\n\n/* ------------------------------------------------------- pagination helper */\n\nexport interface PageLimit {\n limit: number;\n more: () => void;\n}\n\n/**\n * Simple, robust \"load more\". The backend paginates with `take = limit + 1`\n * (offset is ignored; only `cursor` shifts the window), so a larger `limit`\n * simply fetches more rows from the top and `pageInfo.hasMore` reports whether\n * still more exist. Growing the limit avoids cursor-merge/fetchMore complexity\n * and never sends `cursor: null` (the page-1 500 guard). Pass `limit` into the\n * query's `pageArg` and render <LoadMore hasMore={...} onClick={more} />.\n */\nexport function usePageLimit(step = 24, initial = 24): PageLimit {\n const [limit, setLimit] = useState(initial);\n return { limit, more: () => setLimit((l) => l + step) };\n}\n\n/* ------------------------------------------------- lesson player (BOFF-4107) */\n\nconst GET_LESSON_PLAYER = gql`\n ${LESSON_FIELDS}\n ${COURSE_FIELDS}\n ${ENROLLMENT_FIELDS}\n query TecLessonPlayer($lessonId: ID!, $courseId: ID!) {\n tecLesson(id: $lessonId) {\n ...LessonFields\n file {\n id\n name\n mimeType\n downloadUrl\n }\n }\n tecCourse(id: $courseId) {\n ...CourseFields\n lessons {\n id\n courseId\n title\n kind\n position\n estimatedMinutes\n isPreview\n isLocked\n completedByMe\n }\n }\n tecMyEnrollments(courseId: $courseId, pagination: { limit: 1 }) {\n items {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\n/**\n * The signed-in learner's own enrollments with where \"Resume\" should land.\n * Self-scoped (`tecMyEnrollments`); used by My Learning and the dashboard to\n * deep-link straight into the next lesson.\n */\nconst MY_NEXT_LESSONS = gql`\n query TecMyNextLessons($pagination: PaginationInput) {\n tecMyEnrollments(pagination: $pagination) {\n items {\n id\n courseId\n nextLessonId\n }\n }\n }\n`;\n\nconst LESSON_QUIZ_KEY = gql`\n query TecLessonQuizKey($lessonId: ID!) {\n tecLessonQuizKey(lessonId: $lessonId) {\n prompt\n options\n correctOption\n explanation\n }\n }\n`;\n\nconst COMPLETE_LESSON = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecCompleteLesson($lessonId: ID!) {\n tecCompleteLesson(lessonId: $lessonId) {\n ...EnrollmentFields\n nextLessonId\n }\n }\n`;\n\nconst SUBMIT_LESSON_QUIZ = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecSubmitLessonQuiz($lessonId: ID!, $answers: [Int!]!) {\n tecSubmitLessonQuiz(lessonId: $lessonId, answers: $answers) {\n lessonId\n score\n correctCount\n totalCount\n passed\n passingScore\n results {\n index\n correct\n selectedOption\n correctOption\n explanation\n }\n enrollment {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\nconst RUN_LESSON_CODE = gql`\n ${ENROLLMENT_FIELDS}\n mutation TecRunLessonCode($input: TecRunLessonCodeInput!) {\n tecRunLessonCode(input: $input) {\n lessonId\n status\n language\n stdout\n stderr\n exitCode\n durationMs\n timedOut\n memoryLimitExceeded\n compileFailed\n matchedExpected\n lessonCompleted\n enrollment {\n ...EnrollmentFields\n nextLessonId\n }\n }\n }\n`;\n\nexport interface LessonPlayerData {\n tecLesson: TecLesson | null;\n tecCourse: TecCourse | null;\n tecMyEnrollments: { items: TecEnrollment[] };\n}\n\nexport const useLessonPlayerQuery = (courseId: string, lessonId: string) =>\n useQuery<LessonPlayerData>(GET_LESSON_PLAYER, {\n variables: { courseId, lessonId },\n skip: !courseId || !lessonId,\n fetchPolicy: 'cache-and-network',\n });\n\n/** courseId → next lesson id for the signed-in learner's enrollments. */\nexport const useMyNextLessonsQuery = () =>\n useQuery<{\n tecMyEnrollments: { items: Pick<TecEnrollment, 'id' | 'courseId' | 'nextLessonId'>[] };\n }>(MY_NEXT_LESSONS, {\n variables: { pagination: pageArg(100) },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useLessonQuizKeyQuery = (lessonId: string, skip = false) =>\n useQuery<{ tecLessonQuizKey: TecQuizQuestionKey[] }>(LESSON_QUIZ_KEY, {\n variables: { lessonId },\n skip: skip || !lessonId,\n fetchPolicy: 'network-only',\n });\n\nconst LESSON_PROGRESS_REFETCH = [\n 'TecLessonPlayer',\n 'TecCourse',\n 'TecMyNextLessons',\n REFETCH.enrollments,\n];\n\nexport const useCompleteLesson = () =>\n useMutation<{ tecCompleteLesson: TecEnrollment }>(COMPLETE_LESSON, {\n onError: onMutationError,\n refetchQueries: LESSON_PROGRESS_REFETCH,\n });\n\nexport const useSubmitLessonQuiz = () =>\n useMutation<{ tecSubmitLessonQuiz: TecQuizResult }>(SUBMIT_LESSON_QUIZ, {\n onError: onMutationError,\n refetchQueries: LESSON_PROGRESS_REFETCH,\n });\n\n/**\n * Runs code for an INTERACTIVE lesson. No refetch here: the page refetches\n * only when a run actually completed the lesson, so polling a warming\n * sandbox does not reload the page each time.\n */\nexport const useRunLessonCode = () =>\n useMutation<{ tecRunLessonCode: TecLessonCodeRun }>(RUN_LESSON_CODE, {\n onError: onMutationError,\n });\n\n/* ----------------------------------------- enterprise connectors (BOFF-4430) */\n\nexport type TecCertificateVerificationStatus = 'VALID' | 'REVOKED' | 'NOT_FOUND';\n\nexport interface TecCertificateVerification {\n serial: string;\n status: TecCertificateVerificationStatus;\n valid: boolean;\n issuer: string;\n courseTitle?: string | null;\n courseLevel?: string | null;\n score?: number | null;\n issuedAt?: string | null;\n revokedAt?: string | null;\n verifiedAt: string;\n}\n\n/** One xAPI 1.0.3 statement as exported by the service (LRS-ready JSON). */\nexport type TecXapiStatement = Record<string, unknown> & { id: string; timestamp: string };\n\nexport interface TecXapiStatementPage {\n statements: TecXapiStatement[];\n count: number;\n hasMore: boolean;\n nextSince?: string | null;\n version: string;\n}\n\n/** Most serials one batch verification accepts (mirrors the service cap). */\nexport const MAX_VERIFY_BATCH = 25;\n\nconst VERIFY_CERTIFICATES = gql`\n query TecVerifyCertificates($serials: [String!]!) {\n tecVerifyCertificates(serials: $serials) {\n serial\n status\n valid\n issuer\n courseTitle\n courseLevel\n score\n issuedAt\n revokedAt\n verifiedAt\n }\n }\n`;\n\nconst EXPORT_XAPI_STATEMENTS = gql`\n query TecExportXapiStatements($courseId: ID, $since: DateTime, $until: DateTime, $limit: Int) {\n tecExportXapiStatements(courseId: $courseId, since: $since, until: $until, limit: $limit) {\n statements\n count\n hasMore\n nextSince\n version\n }\n }\n`;\n\n/**\n * Certificate verification — the same public query ATS partners call. Run on\n * demand (skip until serials are submitted) and always against the network,\n * so a revocation shows up immediately.\n */\nexport const useVerifyCertificatesQuery = (serials: string[]) =>\n useQuery<{ tecVerifyCertificates: TecCertificateVerification[] }>(VERIFY_CERTIFICATES, {\n variables: { serials },\n skip: serials.length === 0,\n fetchPolicy: 'network-only',\n });\n\nexport interface XapiExportVars {\n courseId?: string;\n since?: string;\n until?: string;\n limit?: number;\n}\n\n/**\n * xAPI export (admin; `list-all` on technospam-enrollment). Returns an\n * imperative runner that follows `nextSince` until the window is exhausted\n * or `maxStatements` is reached, de-duplicating by statement id (pages\n * overlap on one timestamp by design).\n */\nexport function useXapiExport() {\n const [running, setRunning] = useState(false);\n const [error, setError] = useState<ErrorLike | null>(null);\n const [loadPage] = useLazyQuery<{ tecExportXapiStatements: TecXapiStatementPage }>(\n EXPORT_XAPI_STATEMENTS,\n { fetchPolicy: 'network-only' }\n );\n\n const run = async (vars: XapiExportVars, maxStatements = 5000) => {\n setRunning(true);\n setError(null);\n const seen = new Map<string, TecXapiStatement>();\n let since = vars.since;\n let truncated = false;\n try {\n for (;;) {\n const res = await loadPage({ variables: { ...vars, since, limit: vars.limit ?? 500 } });\n if (res.error) throw res.error;\n const page = res.data?.tecExportXapiStatements;\n if (!page) break;\n for (const statement of page.statements) seen.set(statement.id, statement);\n if (!page.hasMore || !page.nextSince) break;\n if (seen.size >= maxStatements) {\n truncated = true;\n break;\n }\n since = page.nextSince;\n }\n return { statements: [...seen.values()], truncated };\n } catch (err) {\n setError(err as ErrorLike);\n notify.error('Export failed', userMessageFromError(err));\n return null;\n } finally {\n setRunning(false);\n }\n };\n\n return { run, running, error };\n}\n"],"mappings":";;;;;;AAsYA,SAAgB,EAAQ,IAAQ,IAAI,GAA4D;AAC9F,QAAO,IAAS;EAAE;EAAO;EAAQ,GAAG,EAAE,UAAO;;AAK/C,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;GAoBnB,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;GAyBnB,IAAoB,CA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.d.ts","sourceRoot":"","sources":["../../../src/technospam/components/StatusBadge.tsx"],"names":[],"mappings":"AA8DA,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,IAAe,GAChB,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC3B,sCAQA"}
1
+ {"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/technospam/components/StatusBadge.tsx"],"names":[],"mappings":"AAiEA,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,IAAe,GAChB,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC3B,sCAQA"}
@@ -18,6 +18,8 @@ var r = {
18
18
  DROPPED: "warning",
19
19
  ISSUED: "success",
20
20
  REVOKED: "danger",
21
+ VALID: "success",
22
+ NOT_FOUND: "warning",
21
23
  PENDING: "neutral",
22
24
  ACCEPTED: "success",
23
25
  WRONG_ANSWER: "danger",
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/technospam/components/StatusBadge.tsx"],"sourcesContent":["import { Badge } from '@burdenoff/fe-libs/ui';\nimport { humanizeEnum } from '../utils/format';\n\ntype Tone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\nconst TONE_CLASS: Record<Tone, string> = {\n neutral: 'bg-bg-sunken text-text-secondary border-border-seam',\n info: 'bg-accent-primary/6 text-accent-primary border-accent-primary/30',\n success: 'bg-status-success-bg-subtle text-status-success-text border-status-success-border',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text border-status-warning-border',\n danger: 'bg-status-error-bg-subtle text-status-error-text border-status-error-border',\n};\n\n/** Maps any Tec* status enum to a semantic tone. Unknown values fall back to neutral. */\nconst STATUS_TONE: Record<string, Tone> = {\n // course / problem\n DRAFT: 'neutral',\n PUBLISHED: 'success',\n ARCHIVED: 'warning',\n // enrollment\n ENROLLED: 'info',\n IN_PROGRESS: 'info',\n COMPLETED: 'success',\n DROPPED: 'warning',\n // certificate\n ISSUED: 'success',\n REVOKED: 'danger',\n // submission verdict\n PENDING: 'neutral',\n ACCEPTED: 'success',\n WRONG_ANSWER: 'danger',\n TIME_LIMIT_EXCEEDED: 'warning',\n RUNTIME_ERROR: 'danger',\n COMPILE_ERROR: 'danger',\n // mentor\n ACTIVE: 'success',\n PAUSED: 'warning',\n INACTIVE: 'neutral',\n // session\n REQUESTED: 'info',\n CONFIRMED: 'success',\n CANCELLED: 'danger',\n NO_SHOW: 'danger',\n // hackathon\n REGISTRATION_OPEN: 'success',\n JUDGING: 'info',\n // team\n SUBMITTED: 'success',\n DISQUALIFIED: 'danger',\n WINNER: 'success',\n};\n\nconst DIFFICULTY_TONE: Record<string, Tone> = {\n EASY: 'success',\n MEDIUM: 'warning',\n HARD: 'danger',\n BEGINNER: 'success',\n INTERMEDIATE: 'info',\n ADVANCED: 'warning',\n EXPERT: 'danger',\n};\n\nexport function StatusBadge({\n status,\n kind = 'status',\n}: {\n status?: string | null;\n kind?: 'status' | 'level';\n}) {\n if (!status) return null;\n const tone = (kind === 'level' ? DIFFICULTY_TONE[status] : STATUS_TONE[status]) ?? 'neutral';\n return (\n <Badge variant=\"outline\" className={TONE_CLASS[tone]}>\n {humanizeEnum(status)}\n </Badge>\n );\n}\n"],"mappings":";;;;AAKA,IAAM,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAGK,IAAoC;CAExC,OAAO;CACP,WAAW;CACX,UAAU;CAEV,UAAU;CACV,aAAa;CACb,WAAW;CACX,SAAS;CAET,QAAQ;CACR,SAAS;CAET,SAAS;CACT,UAAU;CACV,cAAc;CACd,qBAAqB;CACrB,eAAe;CACf,eAAe;CAEf,QAAQ;CACR,QAAQ;CACR,UAAU;CAEV,WAAW;CACX,WAAW;CACX,WAAW;CACX,SAAS;CAET,mBAAmB;CACnB,SAAS;CAET,WAAW;CACX,cAAc;CACd,QAAQ;CACT,EAEK,IAAwC;CAC5C,MAAM;CACN,QAAQ;CACR,MAAM;CACN,UAAU;CACV,cAAc;CACd,UAAU;CACV,QAAQ;CACT;AAED,SAAgB,EAAY,EAC1B,WACA,UAAO,YAIN;AAGD,QAFK,IAGH,kBAAC,GAAD;EAAO,SAAQ;EAAU,WAAW,GAFxB,MAAS,UAAU,EAAgB,KAAU,EAAY,OAAY;YAG9E,EAAa,EAAO;EACf,CAAA,GALU"}
1
+ {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/technospam/components/StatusBadge.tsx"],"sourcesContent":["import { Badge } from '@burdenoff/fe-libs/ui';\nimport { humanizeEnum } from '../utils/format';\n\ntype Tone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\nconst TONE_CLASS: Record<Tone, string> = {\n neutral: 'bg-bg-sunken text-text-secondary border-border-seam',\n info: 'bg-accent-primary/6 text-accent-primary border-accent-primary/30',\n success: 'bg-status-success-bg-subtle text-status-success-text border-status-success-border',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text border-status-warning-border',\n danger: 'bg-status-error-bg-subtle text-status-error-text border-status-error-border',\n};\n\n/** Maps any Tec* status enum to a semantic tone. Unknown values fall back to neutral. */\nconst STATUS_TONE: Record<string, Tone> = {\n // course / problem\n DRAFT: 'neutral',\n PUBLISHED: 'success',\n ARCHIVED: 'warning',\n // enrollment\n ENROLLED: 'info',\n IN_PROGRESS: 'info',\n COMPLETED: 'success',\n DROPPED: 'warning',\n // certificate\n ISSUED: 'success',\n REVOKED: 'danger',\n // certificate verification (BOFF-4430)\n VALID: 'success',\n NOT_FOUND: 'warning',\n // submission verdict\n PENDING: 'neutral',\n ACCEPTED: 'success',\n WRONG_ANSWER: 'danger',\n TIME_LIMIT_EXCEEDED: 'warning',\n RUNTIME_ERROR: 'danger',\n COMPILE_ERROR: 'danger',\n // mentor\n ACTIVE: 'success',\n PAUSED: 'warning',\n INACTIVE: 'neutral',\n // session\n REQUESTED: 'info',\n CONFIRMED: 'success',\n CANCELLED: 'danger',\n NO_SHOW: 'danger',\n // hackathon\n REGISTRATION_OPEN: 'success',\n JUDGING: 'info',\n // team\n SUBMITTED: 'success',\n DISQUALIFIED: 'danger',\n WINNER: 'success',\n};\n\nconst DIFFICULTY_TONE: Record<string, Tone> = {\n EASY: 'success',\n MEDIUM: 'warning',\n HARD: 'danger',\n BEGINNER: 'success',\n INTERMEDIATE: 'info',\n ADVANCED: 'warning',\n EXPERT: 'danger',\n};\n\nexport function StatusBadge({\n status,\n kind = 'status',\n}: {\n status?: string | null;\n kind?: 'status' | 'level';\n}) {\n if (!status) return null;\n const tone = (kind === 'level' ? DIFFICULTY_TONE[status] : STATUS_TONE[status]) ?? 'neutral';\n return (\n <Badge variant=\"outline\" className={TONE_CLASS[tone]}>\n {humanizeEnum(status)}\n </Badge>\n );\n}\n"],"mappings":";;;;AAKA,IAAM,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACT,EAGK,IAAoC;CAExC,OAAO;CACP,WAAW;CACX,UAAU;CAEV,UAAU;CACV,aAAa;CACb,WAAW;CACX,SAAS;CAET,QAAQ;CACR,SAAS;CAET,OAAO;CACP,WAAW;CAEX,SAAS;CACT,UAAU;CACV,cAAc;CACd,qBAAqB;CACrB,eAAe;CACf,eAAe;CAEf,QAAQ;CACR,QAAQ;CACR,UAAU;CAEV,WAAW;CACX,WAAW;CACX,WAAW;CACX,SAAS;CAET,mBAAmB;CACnB,SAAS;CAET,WAAW;CACX,cAAc;CACd,QAAQ;CACT,EAEK,IAAwC;CAC5C,MAAM;CACN,QAAQ;CACR,MAAM;CACN,UAAU;CACV,cAAc;CACd,UAAU;CACV,QAAQ;CACT;AAED,SAAgB,EAAY,EAC1B,WACA,UAAO,YAIN;AAGD,QAFK,IAGH,kBAAC,GAAD;EAAO,SAAQ;EAAU,WAAW,GAFxB,MAAS,UAAU,EAAgB,KAAU,EAAY,OAAY;YAG9E,EAAa,EAAO;EACf,CAAA,GALU"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Enterprise connectors (BOFF-4430): ATS certificate verification, xAPI
3
+ * export for LMS / LRS / HRIS, and a pointer to platform SSO/SCIM.
4
+ */
5
+ export declare function EnterpriseIntegrationsTab(): import("react").JSX.Element;
6
+ //# sourceMappingURL=EnterpriseIntegrationsTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnterpriseIntegrationsTab.d.ts","sourceRoot":"","sources":["../../../../src/technospam/components/admin/EnterpriseIntegrationsTab.tsx"],"names":[],"mappings":"AAmRA;;;GAGG;AACH,wBAAgB,yBAAyB,gCAQxC"}
@@ -0,0 +1,256 @@
1
+ import { formatDate as e } from "../../utils/format.js";
2
+ import { StatusBadge as t } from "../StatusBadge.js";
3
+ import { ErrorView as n } from "../StateViews.js";
4
+ import { notify as r } from "../../lib/toast.js";
5
+ import { useCoursesQuery as i, useVerifyCertificatesQuery as a, useXapiExport as o } from "../../api/technospamApi.js";
6
+ import { atsVerificationSnippet as s, dayStartIso as c, nextDayStartIso as l, parseSerials as u, xapiExportFileName as d } from "../../lib/enterprise.js";
7
+ import { useState as f } from "react";
8
+ import { BadgeCheck as p, Download as m, FileJson as h, KeyRound as g, Loader2 as _, Search as v } from "lucide-react";
9
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ import { Button as x, GlassCard as S, Input as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
11
+ //#region src/technospam/components/admin/EnterpriseIntegrationsTab.tsx
12
+ var A = "https://graphqlworkspaces.burdenoff.com/workspaces/graphql", j = "__all__";
13
+ function M({ icon: e, title: t, description: n }) {
14
+ return /* @__PURE__ */ b("div", {
15
+ className: "mb-4 flex items-start gap-3",
16
+ children: [/* @__PURE__ */ y("span", {
17
+ className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-accent-primary/10 text-accent-primary",
18
+ children: /* @__PURE__ */ y(e, { size: 18 })
19
+ }), /* @__PURE__ */ b("div", {
20
+ className: "min-w-0",
21
+ children: [/* @__PURE__ */ y("h2", {
22
+ className: "text-base font-semibold text-text-primary",
23
+ children: t
24
+ }), /* @__PURE__ */ y("p", {
25
+ className: "mt-0.5 text-sm text-text-secondary",
26
+ children: n
27
+ })]
28
+ })]
29
+ });
30
+ }
31
+ function N() {
32
+ let [r, i] = f(""), [o, c] = f([]), { data: l, loading: d, error: m } = a(o), h = u(r), g = h.length > 25, C = l?.tecVerifyCertificates ?? [];
33
+ return /* @__PURE__ */ b(S, {
34
+ className: "p-5",
35
+ "data-testid": "tec-enterprise-verify",
36
+ children: [
37
+ /* @__PURE__ */ y(M, {
38
+ icon: p,
39
+ title: "Certificate verification for ATS partners",
40
+ description: "Recruiters and applicant-tracking systems confirm a candidate's TechnoSpam certificate by its serial. The check is public and returns only the course, score, dates and status — never the learner's identity."
41
+ }),
42
+ /* @__PURE__ */ b("label", {
43
+ htmlFor: "tec-verify-serials",
44
+ className: "mb-1 block text-xs font-medium text-text-muted",
45
+ children: [
46
+ "Certificate serials (one per line, up to ",
47
+ 25,
48
+ ")"
49
+ ]
50
+ }),
51
+ /* @__PURE__ */ y(k, {
52
+ id: "tec-verify-serials",
53
+ value: r,
54
+ onChange: (e) => i(e.target.value),
55
+ placeholder: "TEC-MH1ABC2D-1A2B3C4D",
56
+ rows: 3,
57
+ className: "font-mono text-sm"
58
+ }),
59
+ /* @__PURE__ */ b("div", {
60
+ className: "mt-3 flex flex-wrap items-center gap-3",
61
+ children: [/* @__PURE__ */ b(x, {
62
+ size: "sm",
63
+ onClick: () => c(h),
64
+ disabled: h.length === 0 || g || d,
65
+ children: [d ? /* @__PURE__ */ y(_, {
66
+ size: 15,
67
+ className: "animate-spin"
68
+ }) : /* @__PURE__ */ y(v, { size: 15 }), "Verify"]
69
+ }), /* @__PURE__ */ y("span", {
70
+ className: "text-xs text-text-muted",
71
+ children: g ? `Too many serials: ${h.length} of at most 25.` : `${h.length} serial${h.length === 1 ? "" : "s"}`
72
+ })]
73
+ }),
74
+ m ? /* @__PURE__ */ y("div", {
75
+ className: "mt-4",
76
+ children: /* @__PURE__ */ y(n, {
77
+ title: "Couldn't verify",
78
+ error: m
79
+ })
80
+ }) : C.length > 0 ? /* @__PURE__ */ y("ul", {
81
+ className: "mt-4 space-y-2",
82
+ "aria-label": "Verification results",
83
+ children: C.map((n) => /* @__PURE__ */ b("li", {
84
+ className: "flex flex-col gap-1 rounded-lg border border-border-seam bg-bg-sunken p-3 sm:flex-row sm:items-center sm:justify-between",
85
+ children: [/* @__PURE__ */ b("div", {
86
+ className: "min-w-0",
87
+ children: [/* @__PURE__ */ y("div", {
88
+ className: "truncate font-mono text-sm text-text-primary",
89
+ children: n.serial
90
+ }), /* @__PURE__ */ y("div", {
91
+ className: "mt-0.5 text-xs text-text-muted",
92
+ children: n.status === "NOT_FOUND" ? "No TechnoSpam certificate has this serial." : `${n.courseTitle ?? "Course"} · score ${n.score ?? 0} · issued ${e(n.issuedAt)}${n.revokedAt ? ` · revoked ${e(n.revokedAt)}` : ""}`
93
+ })]
94
+ }), /* @__PURE__ */ y(t, { status: n.status })]
95
+ }, n.serial))
96
+ }) : null,
97
+ /* @__PURE__ */ b("details", {
98
+ className: "mt-5 rounded-lg border border-border-seam p-3",
99
+ children: [
100
+ /* @__PURE__ */ y("summary", {
101
+ className: "cursor-pointer text-sm font-medium text-text-primary",
102
+ children: "Integration details for ATS partners"
103
+ }),
104
+ /* @__PURE__ */ b("p", {
105
+ className: "mt-2 text-sm text-text-secondary",
106
+ children: [
107
+ "No API key is needed. Batch checks use ",
108
+ /* @__PURE__ */ y("code", { children: "tecVerifyCertificates(serials: [...])" }),
109
+ " ",
110
+ "with up to ",
111
+ 25,
112
+ " serials per request."
113
+ ]
114
+ }),
115
+ /* @__PURE__ */ y("pre", {
116
+ className: "mt-2 overflow-x-auto rounded-md bg-bg-sunken p-3 text-xs text-text-secondary",
117
+ children: s(A)
118
+ })
119
+ ]
120
+ })
121
+ ]
122
+ });
123
+ }
124
+ function P(e, t) {
125
+ let n = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), r = URL.createObjectURL(n), i = document.createElement("a");
126
+ i.href = r, i.download = e, document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(r);
127
+ }
128
+ function F() {
129
+ let { data: e } = i({}), t = e?.tecListCourses?.items ?? [], [a, s] = f(j), [u, p] = f(""), [g, v] = f(""), [k, A] = f(null), { run: N, running: F, error: I } = o();
130
+ return /* @__PURE__ */ b(S, {
131
+ className: "p-5",
132
+ "data-testid": "tec-enterprise-xapi",
133
+ children: [
134
+ /* @__PURE__ */ y(M, {
135
+ icon: h,
136
+ title: "xAPI learning-record export (LMS / LRS / HRIS)",
137
+ description: "Download learner activity as standard xAPI 1.0.3 statements — enrollments, lesson and course completions, certificates and revocations — ready to POST to any Learning Record Store. Statement ids are stable, so re-importing the same range is safe."
138
+ }),
139
+ /* @__PURE__ */ b("div", {
140
+ className: "flex flex-wrap items-end gap-3",
141
+ children: [
142
+ /* @__PURE__ */ b("div", {
143
+ className: "min-w-48",
144
+ children: [/* @__PURE__ */ y("label", {
145
+ className: "mb-1 block text-xs font-medium text-text-muted",
146
+ htmlFor: "tec-xapi-course",
147
+ children: "Course"
148
+ }), /* @__PURE__ */ b(w, {
149
+ value: a,
150
+ onValueChange: s,
151
+ children: [/* @__PURE__ */ y(D, {
152
+ id: "tec-xapi-course",
153
+ className: "w-56",
154
+ children: /* @__PURE__ */ y(O, { placeholder: "All courses" })
155
+ }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
156
+ value: j,
157
+ children: "All courses"
158
+ }), t.map((e) => /* @__PURE__ */ y(E, {
159
+ value: e.id,
160
+ children: e.title
161
+ }, e.id))] })]
162
+ })]
163
+ }),
164
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
165
+ className: "mb-1 block text-xs font-medium text-text-muted",
166
+ htmlFor: "tec-xapi-from",
167
+ children: "From"
168
+ }), /* @__PURE__ */ y(C, {
169
+ id: "tec-xapi-from",
170
+ type: "date",
171
+ value: u,
172
+ max: g || void 0,
173
+ onChange: (e) => p(e.target.value),
174
+ className: "w-40"
175
+ })] }),
176
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
177
+ className: "mb-1 block text-xs font-medium text-text-muted",
178
+ htmlFor: "tec-xapi-to",
179
+ children: "To"
180
+ }), /* @__PURE__ */ y(C, {
181
+ id: "tec-xapi-to",
182
+ type: "date",
183
+ value: g,
184
+ min: u || void 0,
185
+ onChange: (e) => v(e.target.value),
186
+ className: "w-40"
187
+ })] }),
188
+ /* @__PURE__ */ b(x, {
189
+ size: "sm",
190
+ onClick: async () => {
191
+ let e = t.find((e) => e.id === a), n = await N({
192
+ courseId: e?.id,
193
+ since: c(u),
194
+ until: l(g)
195
+ });
196
+ if (n) {
197
+ if (A(n.statements.length), n.statements.length === 0) {
198
+ r.info("Nothing to export", "No learner activity in this range.");
199
+ return;
200
+ }
201
+ P(d(/* @__PURE__ */ new Date(), e?.slug), n.statements), r.success("xAPI export downloaded", `${n.statements.length} statement${n.statements.length === 1 ? "" : "s"}${n.truncated ? " (first 5,000 — narrow the date range for the rest)" : ""}.`);
202
+ }
203
+ },
204
+ disabled: F,
205
+ children: [F ? /* @__PURE__ */ y(_, {
206
+ size: 15,
207
+ className: "animate-spin"
208
+ }) : /* @__PURE__ */ y(m, { size: 15 }), "Export statements"]
209
+ })
210
+ ]
211
+ }),
212
+ k !== null && !I ? /* @__PURE__ */ b("p", {
213
+ className: "mt-3 text-xs text-text-muted",
214
+ role: "status",
215
+ children: [
216
+ "Last export: ",
217
+ k,
218
+ " statement",
219
+ k === 1 ? "" : "s",
220
+ "."
221
+ ]
222
+ }) : null,
223
+ I ? /* @__PURE__ */ y("div", {
224
+ className: "mt-4",
225
+ children: /* @__PURE__ */ y(n, {
226
+ title: "Couldn't export learning records",
227
+ error: I
228
+ })
229
+ }) : null
230
+ ]
231
+ });
232
+ }
233
+ function I() {
234
+ return /* @__PURE__ */ y(S, {
235
+ className: "p-5",
236
+ children: /* @__PURE__ */ y(M, {
237
+ icon: g,
238
+ title: "Single sign-on and user provisioning",
239
+ description: "SAML single sign-on and SCIM 2.0 user provisioning come from the Burdenoff platform identity service that TechnoSpam signs in with, so learners provisioned by your identity provider or HRIS arrive with the same account id used in certificates and xAPI statements."
240
+ })
241
+ });
242
+ }
243
+ function L() {
244
+ return /* @__PURE__ */ b("div", {
245
+ className: "space-y-4",
246
+ children: [
247
+ /* @__PURE__ */ y(N, {}),
248
+ /* @__PURE__ */ y(F, {}),
249
+ /* @__PURE__ */ y(I, {})
250
+ ]
251
+ });
252
+ }
253
+ //#endregion
254
+ export { L as EnterpriseIntegrationsTab };
255
+
256
+ //# sourceMappingURL=EnterpriseIntegrationsTab.js.map