@burdenoff/microfe-crewfoundry 2026.1013.2 → 2026.1029.2

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 (198) hide show
  1. package/dist/crewfoundry/CrewFoundryRoot.d.ts.map +1 -1
  2. package/dist/crewfoundry/CrewFoundryRoot.js +160 -256
  3. package/dist/crewfoundry/CrewFoundryRoot.js.map +1 -1
  4. package/dist/crewfoundry/CrewFoundryRoutes.d.ts.map +1 -1
  5. package/dist/crewfoundry/CrewFoundryRoutes.js +152 -192
  6. package/dist/crewfoundry/CrewFoundryRoutes.js.map +1 -1
  7. package/dist/crewfoundry/components/InlineError.d.ts +5 -0
  8. package/dist/crewfoundry/components/InlineError.d.ts.map +1 -0
  9. package/dist/crewfoundry/components/InlineError.js +17 -0
  10. package/dist/crewfoundry/components/InlineError.js.map +1 -0
  11. package/dist/crewfoundry/components/marketplace/BookServiceModal.d.ts +14 -0
  12. package/dist/crewfoundry/components/marketplace/BookServiceModal.d.ts.map +1 -0
  13. package/dist/crewfoundry/components/marketplace/BookServiceModal.js +75 -0
  14. package/dist/crewfoundry/components/marketplace/BookServiceModal.js.map +1 -0
  15. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.d.ts +24 -0
  16. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.d.ts.map +1 -0
  17. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.js +47 -0
  18. package/dist/crewfoundry/components/marketplace/MarketplaceTabs.js.map +1 -0
  19. package/dist/crewfoundry/components/marketplace/ServiceListingModal.d.ts +12 -0
  20. package/dist/crewfoundry/components/marketplace/ServiceListingModal.d.ts.map +1 -0
  21. package/dist/crewfoundry/components/marketplace/ServiceListingModal.js +123 -0
  22. package/dist/crewfoundry/components/marketplace/ServiceListingModal.js.map +1 -0
  23. package/dist/crewfoundry/components/viz/CertificateCard.js +4 -118
  24. package/dist/crewfoundry/components/viz/PathSteps.js +3 -68
  25. package/dist/crewfoundry/components/viz/lib/geometry.js +5 -13
  26. package/dist/crewfoundry/components/viz/lib/geometry.js.map +1 -1
  27. package/dist/crewfoundry/lib/analytics.d.ts +1 -6
  28. package/dist/crewfoundry/lib/analytics.d.ts.map +1 -1
  29. package/dist/crewfoundry/lib/analytics.js +3 -18
  30. package/dist/crewfoundry/lib/analytics.js.map +1 -1
  31. package/dist/crewfoundry/lib/companyFinance.d.ts +3 -7
  32. package/dist/crewfoundry/lib/companyFinance.d.ts.map +1 -1
  33. package/dist/crewfoundry/lib/companyFinance.js +3 -8
  34. package/dist/crewfoundry/lib/companyFinance.js.map +1 -1
  35. package/dist/crewfoundry/lib/learning.d.ts +12 -0
  36. package/dist/crewfoundry/lib/learning.d.ts.map +1 -0
  37. package/dist/crewfoundry/lib/learning.js +26 -0
  38. package/dist/crewfoundry/lib/learning.js.map +1 -0
  39. package/dist/crewfoundry/lib/marketplace.d.ts +30 -0
  40. package/dist/crewfoundry/lib/marketplace.d.ts.map +1 -0
  41. package/dist/crewfoundry/lib/marketplace.js +91 -0
  42. package/dist/crewfoundry/lib/marketplace.js.map +1 -0
  43. package/dist/crewfoundry/lib/useEnsureLoaded.d.ts +7 -0
  44. package/dist/crewfoundry/lib/useEnsureLoaded.d.ts.map +1 -0
  45. package/dist/crewfoundry/lib/useEnsureLoaded.js +25 -0
  46. package/dist/crewfoundry/lib/useEnsureLoaded.js.map +1 -0
  47. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.d.ts.map +1 -1
  48. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js +12 -25
  49. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js.map +1 -1
  50. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.d.ts.map +1 -1
  51. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js +145 -157
  52. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js.map +1 -1
  53. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.d.ts.map +1 -1
  54. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js +14 -14
  55. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js.map +1 -1
  56. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.d.ts.map +1 -1
  57. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js +14 -14
  58. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js.map +1 -1
  59. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.d.ts.map +1 -1
  60. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.js +71 -33
  61. package/dist/crewfoundry/pages/HelpApiDocumentationPagePage.js.map +1 -1
  62. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.d.ts.map +1 -1
  63. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js +247 -173
  64. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js.map +1 -1
  65. package/dist/crewfoundry/pages/LearningCoursesPagePage.d.ts +12 -0
  66. package/dist/crewfoundry/pages/LearningCoursesPagePage.d.ts.map +1 -1
  67. package/dist/crewfoundry/pages/LearningCoursesPagePage.js +307 -293
  68. package/dist/crewfoundry/pages/LearningCoursesPagePage.js.map +1 -1
  69. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.d.ts +2 -0
  70. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.d.ts.map +1 -0
  71. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.js +223 -0
  72. package/dist/crewfoundry/pages/LearningEnrollmentsPagePage.js.map +1 -0
  73. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.d.ts +4 -0
  74. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.d.ts.map +1 -1
  75. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.js +115 -160
  76. package/dist/crewfoundry/pages/LearningLearningAnalyticsPagePage.js.map +1 -1
  77. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.d.ts.map +1 -1
  78. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.js +165 -75
  79. package/dist/crewfoundry/pages/MarketplaceBookingManagementPagePage.js.map +1 -1
  80. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.d.ts +7 -0
  81. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.d.ts.map +1 -0
  82. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.js +175 -0
  83. package/dist/crewfoundry/pages/MarketplaceEscrowPagePage.js.map +1 -0
  84. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.d.ts.map +1 -1
  85. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js +182 -223
  86. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js.map +1 -1
  87. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.d.ts.map +1 -1
  88. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js +168 -227
  89. package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js.map +1 -1
  90. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.d.ts.map +1 -1
  91. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js +127 -290
  92. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js.map +1 -1
  93. package/dist/crewfoundry/store/crewfoundryStore.d.ts +138 -78
  94. package/dist/crewfoundry/store/crewfoundryStore.d.ts.map +1 -1
  95. package/dist/crewfoundry/store/crewfoundryStore.js +338 -244
  96. package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
  97. package/dist/crewfoundry/utils/dateUtils.d.ts +5 -0
  98. package/dist/crewfoundry/utils/dateUtils.d.ts.map +1 -1
  99. package/dist/crewfoundry/utils/dateUtils.js +10 -1
  100. package/dist/crewfoundry/utils/dateUtils.js.map +1 -1
  101. package/dist/generated/global-types.d.ts +5145 -1627
  102. package/dist/generated/global-types.d.ts.map +1 -1
  103. package/dist/generated/wspace-types.d.ts +100373 -34602
  104. package/dist/generated/wspace-types.d.ts.map +1 -1
  105. package/dist/utils/pageContext.d.ts.map +1 -1
  106. package/dist/utils/pageContext.js +0 -1
  107. package/dist/utils/pageContext.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/crewfoundry/components/viz/CertificateCard.js.map +0 -1
  110. package/dist/crewfoundry/components/viz/PathSteps.js.map +0 -1
  111. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.d.ts +0 -2
  112. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.d.ts.map +0 -1
  113. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.js +0 -53
  114. package/dist/crewfoundry/pages/CommunicationsCallsPagePage.js.map +0 -1
  115. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.d.ts +0 -2
  116. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.d.ts.map +0 -1
  117. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js +0 -107
  118. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js.map +0 -1
  119. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.d.ts +0 -2
  120. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.d.ts.map +0 -1
  121. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.js +0 -62
  122. package/dist/crewfoundry/pages/CommunicationsVideoCallsPagePage.js.map +0 -1
  123. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.d.ts +0 -2
  124. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.d.ts.map +0 -1
  125. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js +0 -37
  126. package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js.map +0 -1
  127. package/dist/crewfoundry/pages/LearningCertificatesPagePage.d.ts +0 -2
  128. package/dist/crewfoundry/pages/LearningCertificatesPagePage.d.ts.map +0 -1
  129. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js +0 -111
  130. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js.map +0 -1
  131. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.d.ts +0 -2
  132. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.d.ts.map +0 -1
  133. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js +0 -309
  134. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js.map +0 -1
  135. package/dist/crewfoundry/pages/LearningLearningPagePage.d.ts +0 -2
  136. package/dist/crewfoundry/pages/LearningLearningPagePage.d.ts.map +0 -1
  137. package/dist/crewfoundry/pages/LearningLearningPagePage.js +0 -200
  138. package/dist/crewfoundry/pages/LearningLearningPagePage.js.map +0 -1
  139. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.d.ts +0 -2
  140. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.d.ts.map +0 -1
  141. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js +0 -190
  142. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js.map +0 -1
  143. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.d.ts +0 -2
  144. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.d.ts.map +0 -1
  145. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js +0 -230
  146. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js.map +0 -1
  147. package/dist/crewfoundry/pages/LearningMyLearningPagePage.d.ts +0 -2
  148. package/dist/crewfoundry/pages/LearningMyLearningPagePage.d.ts.map +0 -1
  149. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js +0 -293
  150. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js.map +0 -1
  151. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.d.ts +0 -2
  152. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.d.ts.map +0 -1
  153. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.js +0 -163
  154. package/dist/crewfoundry/pages/MarketplaceEarningsPagePage.js.map +0 -1
  155. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.d.ts +0 -2
  156. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.d.ts.map +0 -1
  157. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js +0 -365
  158. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js.map +0 -1
  159. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.d.ts +0 -2
  160. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.d.ts.map +0 -1
  161. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js +0 -224
  162. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js.map +0 -1
  163. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.d.ts +0 -2
  164. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.d.ts.map +0 -1
  165. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js +0 -180
  166. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js.map +0 -1
  167. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.d.ts +0 -2
  168. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.d.ts.map +0 -1
  169. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.js +0 -38
  170. package/dist/crewfoundry/pages/MarketplaceMessagingPagePage.js.map +0 -1
  171. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.d.ts +0 -2
  172. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.d.ts.map +0 -1
  173. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js +0 -204
  174. package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js.map +0 -1
  175. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.d.ts +0 -2
  176. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.d.ts.map +0 -1
  177. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.js +0 -55
  178. package/dist/crewfoundry/pages/PaymentsEscrowPagePage.js.map +0 -1
  179. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.d.ts +0 -2
  180. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.d.ts.map +0 -1
  181. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js +0 -335
  182. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js.map +0 -1
  183. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.d.ts +0 -2
  184. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.d.ts.map +0 -1
  185. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js +0 -160
  186. package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js.map +0 -1
  187. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.d.ts +0 -2
  188. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.d.ts.map +0 -1
  189. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.js +0 -80
  190. package/dist/crewfoundry/pages/PaymentsPaymentMethodsPagePage.js.map +0 -1
  191. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.d.ts +0 -2
  192. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.d.ts.map +0 -1
  193. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.js +0 -191
  194. package/dist/crewfoundry/pages/PaymentsSecurityPagePage.js.map +0 -1
  195. package/dist/crewfoundry/utils/courseProgress.d.ts +0 -33
  196. package/dist/crewfoundry/utils/courseProgress.d.ts.map +0 -1
  197. package/dist/crewfoundry/utils/courseProgress.js +0 -46
  198. package/dist/crewfoundry/utils/courseProgress.js.map +0 -1
@@ -1,359 +1,373 @@
1
1
  import { useCrewFoundryStore as e } from "../store/crewfoundryStore.js";
2
- import { formatEnumLabel as t } from "../utils/formatEnumLabel.js";
3
- import { chartPalette as n } from "../components/viz/lib/palette.js";
4
- import { RatingStars as r } from "../components/viz/RatingStars.js";
2
+ import { StatCard as t } from "../components/viz/StatCard.js";
3
+ import { SegmentedTabs as n } from "../components/viz/SegmentedTabs.js";
5
4
  import "../components/viz/index.js";
6
- import { FormModal as i, useFormModal as a } from "../components/forms/FormModal.js";
7
- import { readCourseProgress as o } from "../utils/courseProgress.js";
8
- import { useMemo as s, useState as c } from "react";
9
- import { BarChart3 as l, Briefcase as u, Code2 as d, GraduationCap as f, Megaphone as p, Palette as m, Play as h, Plus as g, Search as _, ShieldCheck as v, Users as y } from "lucide-react";
10
- import { useNavigate as b } from "react-router";
11
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
12
- import { Badge as C, Button as w, CardContent as T, CardHeader as E, GlassCard as D, GradientText as O, IllustratedEmptyState as k, Input as A, PagePurpose as j, Pagination as M } from "@burdenoff/fe-libs/ui";
13
- import { usePagination as N } from "@burdenoff/fe-libs/shared/hooks";
14
- import { useGlobalUi as P } from "@burdenoff/fe-libs/shared/providers/shell";
5
+ import { FormModal as ee, useFormModal as te } from "../components/forms/FormModal.js";
6
+ import { InlineError as ne } from "../components/InlineError.js";
7
+ import { formatDuration as re, isSafeContentUrl as r } from "../lib/learning.js";
8
+ import { useEnsureLoaded as ie } from "../lib/useEnsureLoaded.js";
9
+ import { useMemo as i, useState as a } from "react";
10
+ import { Archive as ae, ArchiveRestore as oe, Clock as se, ExternalLink as ce, MoreHorizontal as le, Pencil as ue, Plus as o, Search as de, Trash2 as fe, Users as pe } from "lucide-react";
11
+ import { useNavigate as me } from "react-router";
12
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
13
+ import { AlertDialog as l, AlertDialogAction as he, AlertDialogCancel as ge, AlertDialogContent as _e, AlertDialogDescription as ve, AlertDialogFooter as ye, AlertDialogHeader as be, AlertDialogTitle as xe, Badge as u, Button as d, CardContent as Se, CardHeader as Ce, CardTitle as we, DropdownMenu as Te, DropdownMenuContent as Ee, DropdownMenuItem as f, DropdownMenuSeparator as De, DropdownMenuTrigger as p, GlassCard as m, GradientText as h, IllustratedEmptyState as g, Input as _, PagePurpose as v, Pagination as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w, Spinner as T } from "@burdenoff/fe-libs/ui";
14
+ import { usePagination as E } from "@burdenoff/fe-libs/shared/hooks";
15
15
  //#region src/crewfoundry/pages/LearningCoursesPagePage.tsx
16
- var F = [
16
+ var D = [
17
17
  {
18
18
  name: "title",
19
- label: "Course Title",
19
+ label: "Course title",
20
20
  type: "text",
21
21
  required: !0,
22
22
  colSpan: 2
23
23
  },
24
24
  {
25
- name: "category",
26
- label: "Category",
27
- type: "text",
28
- required: !0
29
- },
30
- {
31
- name: "instructor",
32
- label: "Instructor",
33
- type: "text",
25
+ name: "description",
26
+ label: "Description",
27
+ type: "textarea",
34
28
  required: !0
35
29
  },
36
30
  {
37
- name: "duration",
38
- label: "Duration",
31
+ name: "contentUrl",
32
+ label: "Content link",
39
33
  type: "text",
40
34
  required: !0,
41
- placeholder: "e.g. 6 weeks"
35
+ colSpan: 2,
36
+ placeholder: "https://… (internal doc, LMS or video)"
42
37
  },
43
38
  {
44
- name: "modules",
45
- label: "Modules",
39
+ name: "durationMinutes",
40
+ label: "Duration (minutes)",
46
41
  type: "number",
47
- required: !0,
48
- placeholder: "e.g. 8"
42
+ min: 0,
43
+ placeholder: "e.g. 45"
49
44
  },
50
45
  {
51
- name: "level",
52
- label: "Level",
53
- type: "select",
54
- required: !0,
55
- options: [
56
- {
57
- label: "Beginner",
58
- value: "beginner"
59
- },
60
- {
61
- label: "Intermediate",
62
- value: "intermediate"
63
- },
64
- {
65
- label: "Advanced",
66
- value: "advanced"
67
- }
68
- ]
46
+ name: "isActive",
47
+ label: "Active (open for enrollment)",
48
+ type: "switch"
69
49
  },
70
50
  {
71
- name: "status",
72
- label: "Status",
73
- type: "select",
74
- required: !0,
75
- options: [
76
- {
77
- label: "Active",
78
- value: "active"
79
- },
80
- {
81
- label: "Draft",
82
- value: "draft"
83
- },
84
- {
85
- label: "Archived",
86
- value: "archived"
87
- }
88
- ]
51
+ name: "requiredForRoles",
52
+ label: "Required for roles",
53
+ type: "tags",
54
+ placeholder: "Type a role and press Enter"
55
+ }
56
+ ], O = (e) => ({
57
+ title: e.title,
58
+ description: e.description,
59
+ contentUrl: e.contentUrl,
60
+ durationMinutes: e.durationMinutes ?? "",
61
+ isActive: e.isActive,
62
+ requiredForRoles: e.requiredForRoles
63
+ }), k = (e) => {
64
+ let t = String(e.contentUrl ?? "").trim();
65
+ if (!r(t)) throw Error("Content link must be a full http(s) URL, e.g. https://example.com/course");
66
+ let n = Number(e.durationMinutes);
67
+ return {
68
+ title: String(e.title ?? "").trim(),
69
+ description: String(e.description ?? "").trim(),
70
+ contentUrl: t,
71
+ durationMinutes: e.durationMinutes === "" || !Number.isFinite(n) ? null : Math.round(n),
72
+ isActive: !!e.isActive,
73
+ requiredForRoles: Array.isArray(e.requiredForRoles) ? e.requiredForRoles : []
74
+ };
75
+ }, A = [
76
+ {
77
+ id: "courses",
78
+ label: "Courses",
79
+ path: "../learning/courses-page"
89
80
  },
90
81
  {
91
- name: "description",
92
- label: "Description",
93
- type: "textarea",
94
- required: !0,
95
- colSpan: 2
82
+ id: "enrollments",
83
+ label: "Enrollments",
84
+ path: "../learning/enrollments-page"
96
85
  },
97
86
  {
98
- name: "skills",
99
- label: "Skills",
100
- type: "tags",
101
- placeholder: "Add a skill and press Enter",
102
- colSpan: 2
87
+ id: "completion",
88
+ label: "Completion",
89
+ path: "../learning/learning-analytics-page"
103
90
  }
104
91
  ];
105
- function I(e) {
106
- let t = n(8), r = 0;
107
- for (let t = 0; t < e.length; t += 1) r = r * 31 + e.charCodeAt(t) >>> 0;
108
- return t[r % t.length];
109
- }
110
- function L(e) {
111
- let t = e.toLowerCase();
112
- return t.includes("engineer") || t.includes("develop") || t.includes("program") || t.includes("tech") ? d : t.includes("design") || t.includes("ux") || t.includes("ui") ? m : t.includes("lead") || t.includes("manage") || t.includes("people") || t.includes("hr") ? y : t.includes("compliance") || t.includes("security") || t.includes("legal") ? v : t.includes("data") || t.includes("analyt") ? l : t.includes("market") || t.includes("sales") ? p : t.includes("business") || t.includes("finance") || t.includes("operations") ? u : f;
113
- }
114
- function R(e) {
115
- return e === "beginner" ? "secondary" : e === "intermediate" ? "default" : "destructive";
116
- }
117
- function z() {
118
- let { courses: n, addCourse: l, enrollCourse: u } = e(), { showToast: d } = P(), f = b(), [p, m] = c(""), [v, z] = c("all"), [B, V] = c(null), H = a(), { page: U, pageSize: W, offset: G, setPage: K } = N({ initialPageSize: 12 }), q = s(() => {
119
- let e = /* @__PURE__ */ new Map();
120
- for (let t of n) {
121
- let n = t.category.trim() || "Uncategorized";
122
- e.set(n, (e.get(n) ?? 0) + 1);
123
- }
124
- return [...e.entries()].sort((e, t) => t[1] - e[1]);
125
- }, [n]), J = n.filter((e) => {
126
- let t = v === "all" || (e.category.trim() || "Uncategorized") === v, n = `${e.title} ${e.category} ${e.instructor} ${e.skills.join(" ")}`.toLowerCase().includes(p.toLowerCase());
92
+ function j() {
93
+ let { trainingCourses: r, enrollments: j, trainingCompletion: M, learningLoaded: N, fetchLearning: Oe, createTrainingCourse: P, updateTrainingCourse: F, removeTrainingCourse: ke } = e(), I = ie(N, Oe), L = me(), R = te(), [Ae, z] = a(), [je, B] = a(null), [V, Me] = a(""), [H, Ne] = a("active"), [U, W] = a(null), { page: Pe, pageSize: G, offset: K, setPage: q } = E({ initialPageSize: 12 }), Fe = i(() => new Map(M.map((e) => [e.courseId, e])), [M]), J = V.trim().toLowerCase(), Y = r.filter((e) => {
94
+ let t = J === "" || `${e.title} ${e.description} ${e.requiredForRoles.join(" ")}`.toLowerCase().includes(J), n = H === "all" || (H === "active" ? e.isActive : !e.isActive);
127
95
  return t && n;
128
- }), Y = J.slice(G, G + W), X = (e) => f(`../learning/course-details-page?id=${encodeURIComponent(e)}`), Z = (e) => f(`../learning/course-learning-page?id=${encodeURIComponent(e)}`), Q = async (e) => {
129
- V(e.id);
96
+ }), Ie = Y.slice(K, K + G), X = r.filter((e) => e.isActive).length, Z = j.filter((e) => e.status === "completed").length, Le = j.length === 0 ? 0 : Math.round(Z / j.length * 100), Re = async (e) => {
97
+ z(void 0);
130
98
  try {
131
- await u(e.id), d(`Enrolled in ${e.title}`, "success"), Z(e.id);
99
+ let t = k(e);
100
+ R.context ? await F(R.context.id, t) : await P(t);
132
101
  } catch (e) {
133
- d(e instanceof Error ? e.message : "Unable to enroll in course", "error");
134
- } finally {
135
- V(null);
102
+ throw z(e instanceof Error ? e.message : "Unable to save course"), e;
136
103
  }
137
- };
138
- return /* @__PURE__ */ S("div", {
104
+ }, Q = async (e) => {
105
+ B(null);
106
+ try {
107
+ await e();
108
+ } catch (e) {
109
+ B(e instanceof Error ? e.message : "Something went wrong");
110
+ }
111
+ }, $ = (e) => L(`../learning/course-details-page?id=${encodeURIComponent(e.id)}`);
112
+ return /* @__PURE__ */ c("div", {
139
113
  className: "space-y-6 p-6",
140
114
  children: [
141
- /* @__PURE__ */ S("div", {
142
- className: "flex flex-wrap items-start justify-between gap-3",
143
- children: [/* @__PURE__ */ S("div", { children: [
144
- /* @__PURE__ */ x("h1", {
115
+ /* @__PURE__ */ c("div", {
116
+ className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
117
+ children: [/* @__PURE__ */ c("div", { children: [
118
+ /* @__PURE__ */ s("h1", {
145
119
  className: "text-2xl font-semibold",
146
- children: /* @__PURE__ */ x(O, { children: "Course Catalog" })
120
+ children: /* @__PURE__ */ s(h, { children: "Training Courses" })
147
121
  }),
148
- /* @__PURE__ */ S("p", {
122
+ /* @__PURE__ */ c("p", {
149
123
  className: "text-sm text-text-secondary",
150
124
  children: [
151
- n.length,
125
+ r.length,
152
126
  " courses · ",
153
- q.length,
154
- " categories"
127
+ X,
128
+ " open for enrollment"
155
129
  ]
156
130
  }),
157
- /* @__PURE__ */ x(j, {
131
+ /* @__PURE__ */ s(v, {
158
132
  className: "mt-1",
159
- children: "Browse the course catalog — find training to grow your team's skills and enroll in the programs that fit your goals."
133
+ children: "Curate the training your people need — link each course to where its content lives, mark which roles must take it, then enroll employees and track their completion."
160
134
  })
161
- ] }), /* @__PURE__ */ S(w, {
162
- onClick: () => H.openModal(),
163
- children: [/* @__PURE__ */ x(g, { className: "mr-1 h-4 w-4" }), "Create Course"]
135
+ ] }), /* @__PURE__ */ c(d, {
136
+ size: "sm",
137
+ onClick: () => {
138
+ z(void 0), R.openModal();
139
+ },
140
+ children: [/* @__PURE__ */ s(o, { className: "mr-1 h-4 w-4" }), "Create Course"]
164
141
  })]
165
142
  }),
166
- /* @__PURE__ */ S("div", {
167
- className: "flex flex-col gap-3",
168
- children: [/* @__PURE__ */ S("div", {
169
- className: "relative max-w-md",
170
- children: [/* @__PURE__ */ x(_, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ x(A, {
171
- placeholder: "Search courses, skills, or instructors...",
143
+ /* @__PURE__ */ s(n, {
144
+ "aria-label": "Learning sections",
145
+ variant: "underline",
146
+ value: "courses",
147
+ onChange: (e) => {
148
+ let t = A.find((t) => t.id === e);
149
+ t && e !== "courses" && L(t.path);
150
+ },
151
+ tabs: A.map(({ id: e, label: t }) => ({
152
+ id: e,
153
+ label: t
154
+ }))
155
+ }),
156
+ /* @__PURE__ */ s(ne, { message: I ?? je }),
157
+ /* @__PURE__ */ c("div", {
158
+ className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
159
+ children: [
160
+ /* @__PURE__ */ s(t, {
161
+ label: "Active Courses",
162
+ value: X
163
+ }),
164
+ /* @__PURE__ */ s(t, {
165
+ label: "Enrollments",
166
+ value: j.length
167
+ }),
168
+ /* @__PURE__ */ s(t, {
169
+ label: "Completed",
170
+ value: Z
171
+ }),
172
+ /* @__PURE__ */ s(t, {
173
+ label: "Completion Rate",
174
+ value: `${Le}%`
175
+ })
176
+ ]
177
+ }),
178
+ /* @__PURE__ */ c("div", {
179
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center",
180
+ children: [/* @__PURE__ */ c("div", {
181
+ className: "relative flex-1",
182
+ children: [/* @__PURE__ */ s(de, { className: "absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ s(_, {
183
+ placeholder: "Search courses or roles...",
172
184
  className: "pl-9",
173
- value: p,
185
+ value: V,
174
186
  onChange: (e) => {
175
- m(e.target.value), K(1);
187
+ Me(e.target.value), q(1);
176
188
  }
177
189
  })]
178
- }), /* @__PURE__ */ S("div", {
179
- className: "flex flex-wrap gap-2",
180
- children: [/* @__PURE__ */ x("button", {
181
- type: "button",
182
- onClick: () => {
183
- z("all"), K(1);
184
- },
185
- className: `rounded-full border px-3 py-1 text-xs font-medium transition-colors ${v === "all" ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:text-text-primary"}`,
186
- children: "All"
187
- }), q.map(([e, t]) => /* @__PURE__ */ S("button", {
188
- type: "button",
189
- onClick: () => {
190
- z(e), K(1);
191
- },
192
- className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors ${v === e ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:text-text-primary"}`,
193
- children: [e, /* @__PURE__ */ x("span", {
194
- className: "tabular-nums opacity-70",
195
- children: t
196
- })]
197
- }, e))]
190
+ }), /* @__PURE__ */ c(b, {
191
+ value: H,
192
+ onValueChange: (e) => {
193
+ Ne(e), q(1);
194
+ },
195
+ children: [/* @__PURE__ */ s(C, {
196
+ className: "w-full sm:w-44",
197
+ "aria-label": "Filter by status",
198
+ children: /* @__PURE__ */ s(w, {})
199
+ }), /* @__PURE__ */ c(x, { children: [
200
+ /* @__PURE__ */ s(S, {
201
+ value: "active",
202
+ children: "Active"
203
+ }),
204
+ /* @__PURE__ */ s(S, {
205
+ value: "inactive",
206
+ children: "Archived"
207
+ }),
208
+ /* @__PURE__ */ s(S, {
209
+ value: "all",
210
+ children: "All courses"
211
+ })
212
+ ] })]
198
213
  })]
199
214
  }),
200
- /* @__PURE__ */ x("div", {
215
+ !N && !I ? /* @__PURE__ */ s("div", {
216
+ className: "flex min-h-[240px] items-center justify-center",
217
+ children: /* @__PURE__ */ s(T, { size: "lg" })
218
+ }) : r.length === 0 ? /* @__PURE__ */ s(g, {
219
+ illustration: "empty-data",
220
+ title: "No courses yet",
221
+ description: "Create a course and link it to its content to start enrolling employees.",
222
+ action: /* @__PURE__ */ c(d, {
223
+ size: "sm",
224
+ onClick: () => R.openModal(),
225
+ children: [/* @__PURE__ */ s(o, { className: "mr-1 h-4 w-4" }), "Create Course"]
226
+ })
227
+ }) : Y.length === 0 ? /* @__PURE__ */ s(g, {
228
+ illustration: "empty-search",
229
+ title: "No courses match",
230
+ description: "Try a different search term or status filter."
231
+ }) : /* @__PURE__ */ s("div", {
201
232
  className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3",
202
- children: J.length === 0 ? /* @__PURE__ */ x("div", {
203
- className: "col-span-full",
204
- children: /* @__PURE__ */ x(k, {
205
- illustration: "empty-search",
206
- title: "No courses found",
207
- description: "Try a different search term or category to find training."
208
- })
209
- }) : Y.map((e) => {
210
- let n = I(e.category), i = L(e.category), a = o(e.id), s = Math.max(e.modules, 1), c = a.completed.length > 0 ? Math.min(100, Math.round(a.completed.length / s * 100)) : 0, l = c > 0;
211
- return /* @__PURE__ */ S(D, {
212
- treatment: "plain",
213
- className: "group flex flex-col overflow-hidden transition-shadow hover:shadow-md",
214
- children: [
215
- /* @__PURE__ */ S("button", {
233
+ children: Ie.map((e) => {
234
+ let t = Fe.get(e.id);
235
+ return /* @__PURE__ */ c(m, {
236
+ treatment: "glass",
237
+ className: "flex flex-col",
238
+ children: [/* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ c("div", {
239
+ className: "flex items-start justify-between gap-2",
240
+ children: [/* @__PURE__ */ s("button", {
216
241
  type: "button",
217
- "aria-label": `View ${e.title}`,
218
- onClick: () => X(e.id),
219
- className: "relative flex h-24 w-full items-center justify-between px-5 text-left outline-none focus-visible:shadow-[var(--shadow-focus)]",
220
- style: { background: `linear-gradient(135deg, color-mix(in srgb, ${n} 28%, var(--color-bg-surface)), color-mix(in srgb, ${n} 8%, var(--color-bg-surface)))` },
221
- children: [/* @__PURE__ */ x("span", {
222
- className: "flex h-11 w-11 items-center justify-center rounded-xl bg-bg-surface/70 shadow-elevation-1",
223
- style: { color: n },
224
- children: /* @__PURE__ */ x(i, { className: "h-6 w-6" })
225
- }), /* @__PURE__ */ x(C, {
226
- variant: R(e.level),
242
+ onClick: () => $(e),
243
+ className: "min-w-0 text-left",
244
+ children: /* @__PURE__ */ s(we, {
245
+ className: "line-clamp-2 text-base hover:underline",
246
+ children: e.title
247
+ })
248
+ }), /* @__PURE__ */ c("div", {
249
+ className: "flex items-center gap-1",
250
+ children: [/* @__PURE__ */ s(u, {
251
+ variant: e.isActive ? "default" : "secondary",
227
252
  className: "text-[10px]",
228
- children: t(e.level)
229
- })]
230
- }),
231
- /* @__PURE__ */ S(E, {
232
- className: "pb-2",
233
- children: [
234
- /* @__PURE__ */ x(C, {
235
- variant: "outline",
236
- className: "w-fit text-[10px]",
237
- children: e.category
238
- }),
239
- /* @__PURE__ */ x("button", {
240
- type: "button",
241
- onClick: () => X(e.id),
242
- className: "mt-2 text-left text-base font-semibold outline-none hover:text-action-primary-bg focus-visible:text-action-primary-bg",
243
- children: e.title
244
- }),
245
- /* @__PURE__ */ S("p", {
246
- className: "text-xs text-text-secondary",
247
- children: [
248
- e.instructor,
249
- " · ",
250
- e.duration,
251
- " · ",
252
- e.modules,
253
- " modules"
254
- ]
253
+ children: e.isActive ? "Active" : "Archived"
254
+ }), /* @__PURE__ */ c(Te, { children: [/* @__PURE__ */ s(p, {
255
+ asChild: !0,
256
+ children: /* @__PURE__ */ s(d, {
257
+ variant: "ghost",
258
+ size: "icon",
259
+ className: "h-8 w-8",
260
+ "aria-label": `More actions for ${e.title}`,
261
+ children: /* @__PURE__ */ s(le, { className: "h-4 w-4" })
255
262
  })
256
- ]
257
- }),
258
- /* @__PURE__ */ S(T, {
259
- className: "flex flex-1 flex-col gap-3",
260
- children: [
261
- /* @__PURE__ */ x("p", {
262
- className: "line-clamp-2 text-sm text-text-secondary",
263
- children: e.description
264
- }),
265
- e.skills.length > 0 && /* @__PURE__ */ x("div", {
266
- className: "flex flex-wrap gap-1",
267
- children: e.skills.slice(0, 3).map((e) => /* @__PURE__ */ x(C, {
268
- variant: "outline",
269
- className: "text-[9px]",
270
- children: e
271
- }, e))
272
- }),
273
- /* @__PURE__ */ S("div", {
274
- className: "mt-auto space-y-3",
275
- children: [
276
- /* @__PURE__ */ S("div", {
277
- className: "flex items-center justify-between text-xs text-text-secondary",
278
- children: [/* @__PURE__ */ x(r, {
279
- value: e.rating,
280
- size: 13,
281
- showValue: !0
282
- }), /* @__PURE__ */ S("span", {
283
- className: "flex items-center gap-1",
284
- children: [
285
- /* @__PURE__ */ x(y, { className: "h-3 w-3" }),
286
- e.enrolled,
287
- " enrolled"
288
- ]
289
- })]
290
- }),
291
- l && /* @__PURE__ */ S("div", {
292
- className: "space-y-1",
293
- children: [/* @__PURE__ */ x("div", {
294
- className: "flex justify-between text-[11px] font-medium",
295
- children: /* @__PURE__ */ S("span", {
296
- className: "text-text-secondary",
297
- children: [c, "% complete"]
298
- })
299
- }), /* @__PURE__ */ x("div", {
300
- className: "h-1.5 overflow-hidden rounded-full bg-bg-sunken",
301
- children: /* @__PURE__ */ x("div", {
302
- className: "h-full rounded-full bg-action-primary-bg",
303
- style: { width: `${c}%` }
304
- })
305
- })]
306
- }),
307
- /* @__PURE__ */ S(w, {
308
- className: "w-full",
309
- variant: l ? "outline" : "default",
310
- disabled: B === e.id,
311
- onClick: () => l ? Z(e.id) : void Q(e),
312
- children: [/* @__PURE__ */ x(h, { className: "mr-1 h-4 w-4" }), B === e.id ? "Enrolling…" : l ? "Continue" : "Enroll"]
313
- })
314
- ]
315
- })
316
- ]
317
- })
318
- ]
263
+ }), /* @__PURE__ */ c(Ee, {
264
+ align: "end",
265
+ children: [
266
+ /* @__PURE__ */ c(f, {
267
+ onSelect: () => {
268
+ z(void 0), R.openModal(e);
269
+ },
270
+ children: [/* @__PURE__ */ s(ue, { className: "mr-2 h-4 w-4" }), "Edit"]
271
+ }),
272
+ /* @__PURE__ */ c(f, {
273
+ onSelect: () => void Q(() => F(e.id, { isActive: !e.isActive })),
274
+ children: [e.isActive ? /* @__PURE__ */ s(ae, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ s(oe, { className: "mr-2 h-4 w-4" }), e.isActive ? "Archive" : "Reactivate"]
275
+ }),
276
+ /* @__PURE__ */ s(De, {}),
277
+ /* @__PURE__ */ c(f, {
278
+ className: "text-status-error-text",
279
+ onSelect: () => W(e),
280
+ children: [/* @__PURE__ */ s(fe, { className: "mr-2 h-4 w-4" }), "Delete"]
281
+ })
282
+ ]
283
+ })] })]
284
+ })]
285
+ }) }), /* @__PURE__ */ c(Se, {
286
+ className: "flex flex-1 flex-col gap-3",
287
+ children: [
288
+ /* @__PURE__ */ s("p", {
289
+ className: "line-clamp-3 text-sm text-text-secondary",
290
+ children: e.description
291
+ }),
292
+ e.requiredForRoles.length > 0 && /* @__PURE__ */ s("div", {
293
+ className: "flex flex-wrap gap-1",
294
+ children: e.requiredForRoles.map((e) => /* @__PURE__ */ s(u, {
295
+ variant: "outline",
296
+ className: "text-[10px]",
297
+ children: e
298
+ }, e))
299
+ }),
300
+ /* @__PURE__ */ c("div", {
301
+ className: "mt-auto flex items-center justify-between border-t border-border-default pt-3 text-xs text-text-secondary",
302
+ children: [/* @__PURE__ */ c("span", {
303
+ className: "flex items-center gap-1",
304
+ children: [/* @__PURE__ */ s(se, { className: "h-3.5 w-3.5" }), re(e.durationMinutes)]
305
+ }), /* @__PURE__ */ c("span", {
306
+ className: "flex items-center gap-1",
307
+ children: [/* @__PURE__ */ s(pe, { className: "h-3.5 w-3.5" }), t ? `${t.completedCount}/${t.totalEnrolled} completed` : "No enrollments"]
308
+ })]
309
+ }),
310
+ /* @__PURE__ */ c("div", {
311
+ className: "flex gap-2",
312
+ children: [/* @__PURE__ */ s(d, {
313
+ size: "sm",
314
+ variant: "outline",
315
+ className: "flex-1",
316
+ onClick: () => $(e),
317
+ children: "Manage"
318
+ }), /* @__PURE__ */ s(d, {
319
+ size: "sm",
320
+ variant: "ghost",
321
+ asChild: !0,
322
+ children: /* @__PURE__ */ c("a", {
323
+ href: e.contentUrl,
324
+ target: "_blank",
325
+ rel: "noopener noreferrer",
326
+ children: [/* @__PURE__ */ s(ce, { className: "mr-1 h-3.5 w-3.5" }), "Open"]
327
+ })
328
+ })]
329
+ })
330
+ ]
331
+ })]
319
332
  }, e.id);
320
333
  })
321
334
  }),
322
- J.length > W && /* @__PURE__ */ x(M, {
323
- page: U,
324
- pageSize: W,
325
- totalItems: J.length,
326
- onPageChange: K
335
+ Y.length > G && /* @__PURE__ */ s(y, {
336
+ page: Pe,
337
+ pageSize: G,
338
+ totalItems: Y.length,
339
+ onPageChange: q
340
+ }),
341
+ /* @__PURE__ */ s(ee, {
342
+ open: R.open,
343
+ onOpenChange: R.onOpenChange,
344
+ title: R.context ? "Edit course" : "Create course",
345
+ description: "Courses link to content hosted elsewhere; CrewFoundry tracks who is enrolled and who has completed them.",
346
+ fields: D,
347
+ initialValues: R.context ? O(R.context) : { isActive: !0 },
348
+ submitLabel: R.context ? "Save changes" : "Create course",
349
+ errorMessage: Ae,
350
+ onValidationError: z,
351
+ onSubmit: Re
327
352
  }),
328
- /* @__PURE__ */ x(i, {
329
- open: H.open,
330
- onOpenChange: H.onOpenChange,
331
- title: "Create Course",
332
- description: "Add a new course to the catalog.",
333
- fields: F,
334
- submitLabel: "Create Course",
335
- onSubmit: async (e) => {
336
- await l({
337
- id: `course-${Date.now()}`,
338
- title: String(e.title ?? ""),
339
- category: String(e.category ?? ""),
340
- instructor: String(e.instructor ?? ""),
341
- duration: String(e.duration ?? ""),
342
- level: String(e.level ?? "beginner"),
343
- enrolled: 0,
344
- completed: 0,
345
- rating: 0,
346
- status: String(e.status ?? "draft"),
347
- description: String(e.description ?? ""),
348
- modules: typeof e.modules == "number" ? e.modules : Number(e.modules) || 0,
349
- skills: Array.isArray(e.skills) ? e.skills : []
350
- });
351
- }
353
+ /* @__PURE__ */ s(l, {
354
+ open: U !== null,
355
+ onOpenChange: (e) => {
356
+ e || W(null);
357
+ },
358
+ children: /* @__PURE__ */ c(_e, { children: [/* @__PURE__ */ c(be, { children: [/* @__PURE__ */ s(xe, { children: "Delete course?" }), /* @__PURE__ */ s(ve, { children: U ? `“${U.title}” is removed from the catalog. Existing enrollment records are kept for your history. To keep the course but stop new enrollments, archive it instead.` : "" })] }), /* @__PURE__ */ c(ye, { children: [/* @__PURE__ */ s(ge, { children: "Cancel" }), /* @__PURE__ */ s(he, {
359
+ onClick: (e) => {
360
+ e.preventDefault();
361
+ let t = U;
362
+ W(null), t && Q(() => ke(t.id));
363
+ },
364
+ children: "Delete"
365
+ })] })] })
352
366
  })
353
367
  ]
354
368
  });
355
369
  }
356
370
  //#endregion
357
- export { z as LearningCoursesPagePage };
371
+ export { D as COURSE_FIELDS, A as LEARNING_TABS, j as LearningCoursesPagePage, O as courseToValues, k as valuesToCourseInput };
358
372
 
359
373
  //# sourceMappingURL=LearningCoursesPagePage.js.map