@burdenoff/microfe-technospam 2026.1014.1 → 2026.1030.1
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.
- package/dist/node_modules/recharts/es6/cartesian/Brush.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/XAxis.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/YAxis.js.map +1 -1
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/technospam/hooks/useFocusedRecordParam.d.ts +41 -0
- package/dist/technospam/hooks/useFocusedRecordParam.d.ts.map +1 -0
- package/dist/technospam/hooks/useFocusedRecordParam.js +41 -0
- package/dist/technospam/hooks/useFocusedRecordParam.js.map +1 -0
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +231 -181
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +92 -88
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesMyLearningPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesMyLearningPagePage.js +89 -79
- package/dist/technospam/pages/CoursesMyLearningPagePage.js.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js +155 -147
- package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.js +186 -167
- package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
- package/dist/technospam/utils/pageContext.d.ts +54 -5
- package/dist/technospam/utils/pageContext.d.ts.map +1 -1
- package/dist/technospam/utils/pageContext.js +99 -35
- package/dist/technospam/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,66 +1,77 @@
|
|
|
1
1
|
import { useTechnoSpam as e } from "../providers/TechnoSpamProvider.js";
|
|
2
2
|
import { useTechnoSpamAnalytics as t } from "../hooks/useTechnoSpamAnalytics.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
|
+
import { StatCard as i } from "../components/StatCard.js";
|
|
6
|
+
import { formatDateTime as a, humanizeEnum as o } from "../utils/format.js";
|
|
7
|
+
import { StatusBadge as s } from "../components/StatusBadge.js";
|
|
8
|
+
import { EmptyView as c, ErrorView as l, LoadingRows as ee } from "../components/StateViews.js";
|
|
9
|
+
import { TagStrip as te } from "../components/TagStrip.js";
|
|
10
|
+
import { PremiumBadge as ne, UpgradeGate as u } from "../components/UpgradeGate.js";
|
|
11
|
+
import { CodePanel as re, IoBlock as d, TestResultsPanel as ie } from "../components/SubmissionViews.js";
|
|
11
12
|
import "../components/index.js";
|
|
12
|
-
import { notify as
|
|
13
|
-
import { useProblemQuery as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
13
|
+
import { notify as f } from "../lib/toast.js";
|
|
14
|
+
import { useProblemQuery as ae, useRegradeSubmission as oe, useSubmissionsQuery as se, useSubmitSolution as ce } from "../api/technospamApi.js";
|
|
15
|
+
import { FOCUS_PARAMS as le } from "../utils/pageContext.js";
|
|
16
|
+
import { focusableCardProps as p, useFocusedRecordParam as ue } from "../hooks/useFocusedRecordParam.js";
|
|
17
|
+
import { useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
18
|
+
import { Clock as v, Code2 as y, FileText as b, FlaskConical as de, Layers as x, RefreshCw as S, Send as fe, Trophy as C } from "lucide-react";
|
|
19
|
+
import { useSearchParams as pe } from "react-router";
|
|
20
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
21
|
+
import { Badge as me, Button as E, GlassCard as D, Select as he, SelectContent as ge, SelectItem as _e, SelectTrigger as ve, SelectValue as ye, Skeleton as O, Textarea as be } from "@burdenoff/fe-libs/ui";
|
|
19
22
|
//#region src/technospam/pages/ApplicationsProblemDetailsPagePage.tsx
|
|
20
|
-
var
|
|
23
|
+
var k = [
|
|
21
24
|
"javascript",
|
|
22
25
|
"python",
|
|
23
26
|
"typescript"
|
|
24
|
-
];
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
className: "rounded-lg border border-transparent px-2 py-3 transition-colors hover:border-border-seam hover:bg-bg-sunken",
|
|
28
|
-
|
|
27
|
+
], xe = 3e3, Se = 3 * 6e4;
|
|
28
|
+
function Ce({ s: e, focused: t, onToggle: r }) {
|
|
29
|
+
return /* @__PURE__ */ T("div", {
|
|
30
|
+
className: n("cursor-pointer rounded-lg border border-transparent px-2 py-3 transition-colors hover:border-border-seam hover:bg-bg-sunken", t && "ring-2 ring-accent-primary"),
|
|
31
|
+
...p(t, r),
|
|
32
|
+
children: [/* @__PURE__ */ T("div", {
|
|
29
33
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1",
|
|
30
34
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
35
|
+
/* @__PURE__ */ w("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-pressed": t,
|
|
38
|
+
"aria-label": `Focus submission from ${a(e.createdAt)}`,
|
|
39
|
+
onClick: r,
|
|
40
|
+
className: "rounded-full",
|
|
41
|
+
children: /* @__PURE__ */ w(s, { status: e.verdict })
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ T("span", {
|
|
33
44
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-primary",
|
|
34
45
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ w(y, { size: 13 }),
|
|
36
47
|
" ",
|
|
37
|
-
|
|
48
|
+
o(e.language)
|
|
38
49
|
]
|
|
39
50
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ T("span", {
|
|
41
52
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
42
53
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ w(v, { size: 12 }),
|
|
44
55
|
" ",
|
|
45
56
|
e.runtimeMs,
|
|
46
57
|
" ms"
|
|
47
58
|
]
|
|
48
59
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ T("span", {
|
|
50
61
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
51
62
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ w(C, { size: 12 }),
|
|
53
64
|
" ",
|
|
54
65
|
e.pointsAwarded,
|
|
55
66
|
" pts"
|
|
56
67
|
]
|
|
57
68
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ w("span", {
|
|
59
70
|
className: "ml-auto text-xs text-text-muted",
|
|
60
|
-
children:
|
|
71
|
+
children: a(e.createdAt)
|
|
61
72
|
})
|
|
62
73
|
]
|
|
63
|
-
}), e.totalCount > 0 ? /* @__PURE__ */
|
|
74
|
+
}), e.totalCount > 0 ? /* @__PURE__ */ T("p", {
|
|
64
75
|
className: "mt-1 px-0.5 text-xs text-text-muted",
|
|
65
76
|
children: [
|
|
66
77
|
"Passed ",
|
|
@@ -72,267 +83,296 @@ function ge({ s: e }) {
|
|
|
72
83
|
}) : null]
|
|
73
84
|
});
|
|
74
85
|
}
|
|
75
|
-
function
|
|
76
|
-
let [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
workspaceId:
|
|
80
|
-
entityId:
|
|
86
|
+
function A() {
|
|
87
|
+
let [n] = pe(), a = n.get("id") ?? "", [p, A] = ue(le.submission), { currentUser: we, workspaceId: j } = e(), M = we?.id, { emit: N } = t(), { data: Te, loading: Ee, error: P, refetch: F } = ae(a);
|
|
88
|
+
m(() => {
|
|
89
|
+
a && N("technospam.problem.viewed", {
|
|
90
|
+
workspaceId: j,
|
|
91
|
+
entityId: a,
|
|
81
92
|
entityType: "TEC_PROBLEM"
|
|
82
93
|
});
|
|
83
94
|
}, [
|
|
95
|
+
a,
|
|
84
96
|
j,
|
|
85
|
-
N
|
|
86
|
-
F
|
|
97
|
+
N
|
|
87
98
|
]);
|
|
88
|
-
let { data:
|
|
89
|
-
...
|
|
90
|
-
problemId:
|
|
91
|
-
}), [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
let
|
|
96
|
-
if (!
|
|
97
|
-
if (!
|
|
98
|
-
|
|
99
|
+
let { data: I, loading: De, error: L, refetch: R } = se({
|
|
100
|
+
...M ? { learnerId: M } : {},
|
|
101
|
+
problemId: a
|
|
102
|
+
}), [Oe, { loading: z }] = ce(), [ke, { loading: B }] = oe(), V = Te?.tecProblem ?? null, H = h(() => V?.languages?.length ? V.languages : k, [V]), [U, W] = _(""), [G, K] = _(""), q = g(!1);
|
|
103
|
+
m(() => {
|
|
104
|
+
V && !q.current && (W(V.languages[0] ?? k[0]), K(V.starterCode ?? ""), q.current = !0);
|
|
105
|
+
}, [V]);
|
|
106
|
+
let J = h(() => [...I?.tecListSubmissions?.items ?? []].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()), [I]), Ae = async () => {
|
|
107
|
+
if (!a) return;
|
|
108
|
+
if (!U) {
|
|
109
|
+
f.error("Pick a language", "Choose a language before submitting.");
|
|
99
110
|
return;
|
|
100
111
|
}
|
|
101
|
-
if (!
|
|
102
|
-
|
|
112
|
+
if (!G.trim()) {
|
|
113
|
+
f.error("Add your solution", "Write some code before submitting.");
|
|
103
114
|
return;
|
|
104
115
|
}
|
|
105
|
-
|
|
106
|
-
workspaceId:
|
|
107
|
-
entityId:
|
|
116
|
+
N("technospam.problem.submit_clicked", {
|
|
117
|
+
workspaceId: j,
|
|
118
|
+
entityId: a,
|
|
108
119
|
entityType: "TEC_PROBLEM",
|
|
109
|
-
language:
|
|
120
|
+
language: U
|
|
110
121
|
});
|
|
111
|
-
let e = await
|
|
112
|
-
problemId:
|
|
113
|
-
language:
|
|
114
|
-
code:
|
|
122
|
+
let e = await Oe({ variables: { input: {
|
|
123
|
+
problemId: a,
|
|
124
|
+
language: U,
|
|
125
|
+
code: G
|
|
115
126
|
} } });
|
|
116
127
|
if (e.data?.tecSubmitSolution) {
|
|
117
|
-
|
|
118
|
-
workspaceId:
|
|
119
|
-
entityId:
|
|
128
|
+
N("technospam.problem.submitted", {
|
|
129
|
+
workspaceId: j,
|
|
130
|
+
entityId: a,
|
|
120
131
|
entityType: "TEC_PROBLEM",
|
|
121
132
|
submissionId: e.data.tecSubmitSolution.id
|
|
122
133
|
});
|
|
123
134
|
let t = e.data.tecSubmitSolution;
|
|
124
|
-
t.verdict === "PENDING" ?
|
|
135
|
+
t.verdict === "PENDING" ? f.info("Solution submitted", "Grading has started — your verdict will appear here in a moment.") : t.verdict === "ACCEPTED" ? f.success("Accepted", `Passed all ${t.totalCount} test cases.`) : f.error(o(t.verdict), `Passed ${t.passedCount} of ${t.totalCount} test cases.`), await Promise.all([F(), R()]);
|
|
136
|
+
}
|
|
137
|
+
}, je = async (e) => {
|
|
138
|
+
let t = (await ke({ variables: { id: e } })).data?.tecRegradeSubmission;
|
|
139
|
+
t && (t.verdict === "PENDING" ? f.error("Still pending", "The grader is not available yet. Please try again shortly.") : f.success("Grading complete", `Verdict: ${o(t.verdict)}.`), await Promise.all([F(), R()]));
|
|
140
|
+
}, Y = J.find((e) => (e.testResults?.length ?? 0) > 0) ?? null, X = J[0] ?? null, Z = X?.verdict === "PENDING" ? X.id : null, [Q, Me] = _(null), Ne = Z !== null && Q !== Z;
|
|
141
|
+
m(() => {
|
|
142
|
+
if (!Z || Q === Z) return;
|
|
143
|
+
let e = Date.now(), t = window.setInterval(() => {
|
|
144
|
+
if (Date.now() - e > Se) {
|
|
145
|
+
window.clearInterval(t), Me(Z);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
R();
|
|
149
|
+
}, xe);
|
|
150
|
+
return () => window.clearInterval(t);
|
|
151
|
+
}, [
|
|
152
|
+
Z,
|
|
153
|
+
Q,
|
|
154
|
+
R
|
|
155
|
+
]);
|
|
156
|
+
let $ = g(null);
|
|
157
|
+
return m(() => {
|
|
158
|
+
if (Z) {
|
|
159
|
+
$.current = Z;
|
|
160
|
+
return;
|
|
125
161
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
162
|
+
let e = $.current;
|
|
163
|
+
if (!e) return;
|
|
164
|
+
let t = J.find((t) => t.id === e);
|
|
165
|
+
!t || t.verdict === "PENDING" || ($.current = null, t.verdict === "ACCEPTED" ? f.success("Accepted", `Passed all ${t.totalCount} test cases.`) : f.error(o(t.verdict), `Passed ${t.passedCount} of ${t.totalCount} test cases.`), F());
|
|
166
|
+
}, [
|
|
167
|
+
Z,
|
|
168
|
+
J,
|
|
169
|
+
F
|
|
170
|
+
]), Ee && !V ? /* @__PURE__ */ T(r, {
|
|
131
171
|
title: "Problem",
|
|
132
172
|
backPath: "/applications/problems-page",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
134
|
-
}) :
|
|
173
|
+
children: [/* @__PURE__ */ w(O, { className: "mb-4 h-28 w-full rounded-xl" }), /* @__PURE__ */ w(O, { className: "h-72 w-full rounded-xl" })]
|
|
174
|
+
}) : P || !V ? /* @__PURE__ */ w(r, {
|
|
135
175
|
title: "Problem",
|
|
136
176
|
backPath: "/applications/problems-page",
|
|
137
|
-
children:
|
|
177
|
+
children: P ? /* @__PURE__ */ w(l, {
|
|
138
178
|
title: "Couldn't load problem",
|
|
139
|
-
error:
|
|
140
|
-
}) : /* @__PURE__ */
|
|
179
|
+
error: P
|
|
180
|
+
}) : /* @__PURE__ */ w(c, {
|
|
141
181
|
title: "Problem not found",
|
|
142
182
|
description: "This problem may have been unpublished."
|
|
143
183
|
})
|
|
144
|
-
}) : /* @__PURE__ */
|
|
184
|
+
}) : /* @__PURE__ */ T(r, {
|
|
145
185
|
hero: !0,
|
|
146
186
|
backPath: "/applications/problems-page",
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
187
|
+
title: V.title,
|
|
188
|
+
description: V.topic ?? void 0,
|
|
149
189
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ T("div", {
|
|
151
191
|
className: "mb-5 flex flex-wrap items-center gap-2",
|
|
152
192
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
status:
|
|
193
|
+
/* @__PURE__ */ w(s, {
|
|
194
|
+
status: V.difficulty,
|
|
155
195
|
kind: "level"
|
|
156
196
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
197
|
+
/* @__PURE__ */ w(s, { status: V.status }),
|
|
198
|
+
V.topic ? /* @__PURE__ */ T(me, {
|
|
159
199
|
variant: "outline",
|
|
160
200
|
className: "gap-1",
|
|
161
201
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ w(x, { size: 12 }),
|
|
163
203
|
" ",
|
|
164
|
-
|
|
204
|
+
V.topic
|
|
165
205
|
]
|
|
166
206
|
}) : null,
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */
|
|
207
|
+
V.isPremiumOnly ? /* @__PURE__ */ w(ne, { locked: V.isLocked }) : null,
|
|
208
|
+
/* @__PURE__ */ w(te, { tags: V.tags })
|
|
169
209
|
]
|
|
170
210
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ T("div", {
|
|
172
212
|
className: "mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
173
213
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ w(i, {
|
|
175
215
|
label: "Points",
|
|
176
|
-
value:
|
|
216
|
+
value: V.points,
|
|
177
217
|
icon: C,
|
|
178
218
|
tone: "amber"
|
|
179
219
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ w(i, {
|
|
181
221
|
label: "Languages",
|
|
182
|
-
value:
|
|
183
|
-
icon:
|
|
222
|
+
value: H.length,
|
|
223
|
+
icon: y,
|
|
184
224
|
tone: "blue"
|
|
185
225
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ w(i, {
|
|
187
227
|
label: "Difficulty",
|
|
188
|
-
value:
|
|
189
|
-
icon:
|
|
228
|
+
value: o(V.difficulty),
|
|
229
|
+
icon: x,
|
|
190
230
|
tone: "purple"
|
|
191
231
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ w(i, {
|
|
193
233
|
label: "My submissions",
|
|
194
|
-
value:
|
|
195
|
-
icon:
|
|
234
|
+
value: J.length,
|
|
235
|
+
icon: b,
|
|
196
236
|
tone: "teal"
|
|
197
237
|
})
|
|
198
238
|
]
|
|
199
239
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ T("div", {
|
|
201
241
|
className: "grid grid-cols-1 gap-5 lg:grid-cols-3",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ T("div", {
|
|
203
243
|
className: "space-y-5 lg:col-span-2",
|
|
204
244
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ T(D, {
|
|
206
246
|
className: "p-5",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
208
248
|
className: "mb-2 text-base font-semibold text-text-primary",
|
|
209
249
|
children: "Problem statement"
|
|
210
|
-
}),
|
|
250
|
+
}), V.isLocked ? /* @__PURE__ */ w(u, { description: "This problem's statement is part of a paid TechnoSpam plan. Ask a workspace admin to upgrade to unlock it." }) : V.statement ? /* @__PURE__ */ w("p", {
|
|
211
251
|
className: "whitespace-pre-wrap text-sm leading-relaxed text-text-secondary",
|
|
212
|
-
children:
|
|
213
|
-
}) : /* @__PURE__ */
|
|
252
|
+
children: V.statement
|
|
253
|
+
}) : /* @__PURE__ */ w("p", {
|
|
214
254
|
className: "py-4 text-center text-sm text-text-muted",
|
|
215
255
|
children: "The statement for this problem is being prepared."
|
|
216
256
|
})]
|
|
217
257
|
}),
|
|
218
|
-
|
|
258
|
+
V.isLocked ? /* @__PURE__ */ w(u, {
|
|
219
259
|
compact: !0,
|
|
220
260
|
description: "Starter code and sample test cases unlock with a paid TechnoSpam plan."
|
|
221
|
-
}) :
|
|
261
|
+
}) : V.starterCode ? /* @__PURE__ */ T(D, {
|
|
222
262
|
className: "p-5",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
224
264
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
225
265
|
children: "Starter code"
|
|
226
|
-
}), /* @__PURE__ */
|
|
227
|
-
label:
|
|
266
|
+
}), /* @__PURE__ */ w(re, {
|
|
267
|
+
label: o(H[0] ?? "code"),
|
|
228
268
|
bodyClassName: "max-h-72",
|
|
229
|
-
children:
|
|
269
|
+
children: V.starterCode
|
|
230
270
|
})]
|
|
231
271
|
}) : null,
|
|
232
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ T(D, {
|
|
233
273
|
className: "p-5",
|
|
234
274
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ T("div", {
|
|
236
276
|
className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
238
278
|
className: "text-base font-semibold text-text-primary",
|
|
239
279
|
children: "Submit a solution"
|
|
240
|
-
}), /* @__PURE__ */
|
|
280
|
+
}), /* @__PURE__ */ T("div", {
|
|
241
281
|
className: "flex items-center gap-2",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ w("span", {
|
|
243
283
|
className: "text-sm text-text-secondary",
|
|
244
284
|
children: "Language"
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
-
value:
|
|
247
|
-
onValueChange:
|
|
248
|
-
children: [/* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ T(he, {
|
|
286
|
+
value: U,
|
|
287
|
+
onValueChange: W,
|
|
288
|
+
children: [/* @__PURE__ */ w(ve, {
|
|
249
289
|
className: "w-full sm:w-48",
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
}), /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ w(ye, { placeholder: "Choose a language" })
|
|
291
|
+
}), /* @__PURE__ */ w(ge, { children: H.map((e) => /* @__PURE__ */ w(_e, {
|
|
252
292
|
value: e,
|
|
253
|
-
children:
|
|
293
|
+
children: o(e)
|
|
254
294
|
}, e)) })]
|
|
255
295
|
})]
|
|
256
296
|
})]
|
|
257
297
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ T("div", {
|
|
259
299
|
className: "overflow-hidden rounded-xl border border-border-strong bg-bg-sunken shadow-sm",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ T("div", {
|
|
261
301
|
className: "flex items-center justify-between gap-2 border-b border-border-seam bg-bg-canvas/40 px-4 py-2",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ T("div", {
|
|
263
303
|
className: "flex items-center gap-1.5",
|
|
264
304
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-error-border" }),
|
|
306
|
+
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-warning-border" }),
|
|
307
|
+
/* @__PURE__ */ w("span", { className: "h-2.5 w-2.5 rounded-full bg-status-success-border" })
|
|
268
308
|
]
|
|
269
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ T("span", {
|
|
270
310
|
className: "inline-flex items-center gap-1.5 font-mono text-xs text-text-muted",
|
|
271
311
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ w(y, { size: 13 }),
|
|
273
313
|
" ",
|
|
274
|
-
|
|
314
|
+
U ? o(U) : "solution"
|
|
275
315
|
]
|
|
276
316
|
})]
|
|
277
|
-
}), /* @__PURE__ */
|
|
278
|
-
value:
|
|
279
|
-
onChange: (e) =>
|
|
317
|
+
}), /* @__PURE__ */ w(be, {
|
|
318
|
+
value: G,
|
|
319
|
+
onChange: (e) => K(e.target.value),
|
|
280
320
|
placeholder: "Write your solution…",
|
|
281
321
|
className: "min-h-[280px] resize-y rounded-none border-0 bg-transparent font-mono text-xs leading-relaxed focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
282
322
|
spellCheck: !1
|
|
283
323
|
})]
|
|
284
324
|
}),
|
|
285
|
-
/* @__PURE__ */ E
|
|
325
|
+
/* @__PURE__ */ T(E, {
|
|
286
326
|
className: "mt-4 w-full",
|
|
287
|
-
onClick:
|
|
288
|
-
disabled:
|
|
327
|
+
onClick: Ae,
|
|
328
|
+
disabled: z || !G.trim(),
|
|
289
329
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ w(fe, { size: 16 }),
|
|
291
331
|
" ",
|
|
292
|
-
|
|
332
|
+
z ? "Running test cases…" : "Run & submit"
|
|
293
333
|
]
|
|
294
334
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ w("p", {
|
|
296
336
|
className: "mt-2 text-center text-xs text-text-muted",
|
|
297
337
|
children: "Your code runs against this problem's test cases in an isolated sandbox."
|
|
298
338
|
})
|
|
299
339
|
]
|
|
300
340
|
}),
|
|
301
|
-
|
|
341
|
+
V.publicTestCases?.length ? /* @__PURE__ */ T(D, {
|
|
302
342
|
className: "p-5",
|
|
303
343
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ T("h2", {
|
|
305
345
|
className: "mb-1 flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ w(de, { size: 16 }), " Sample test cases"]
|
|
307
347
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ w("p", {
|
|
309
349
|
className: "mb-3 text-sm text-text-secondary",
|
|
310
350
|
children: "Your solution reads each input from stdin and must print the expected output. Hidden test cases are also run when you submit."
|
|
311
351
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ w("div", {
|
|
313
353
|
className: "space-y-3",
|
|
314
|
-
children:
|
|
354
|
+
children: V.publicTestCases.map((e) => /* @__PURE__ */ T("div", {
|
|
315
355
|
className: "rounded-xl border border-border-seam p-3",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ T("div", {
|
|
317
357
|
className: "mb-2 flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ w("span", {
|
|
319
359
|
className: "text-sm font-medium text-text-primary",
|
|
320
360
|
children: e.name
|
|
321
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ T("span", {
|
|
322
362
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
323
363
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ w(v, { size: 12 }),
|
|
325
365
|
" ",
|
|
326
366
|
e.timeLimitMs,
|
|
327
367
|
" ms limit"
|
|
328
368
|
]
|
|
329
369
|
})]
|
|
330
|
-
}), /* @__PURE__ */
|
|
370
|
+
}), /* @__PURE__ */ T("div", {
|
|
331
371
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ w(d, {
|
|
333
373
|
label: "Input",
|
|
334
374
|
value: e.input
|
|
335
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ w(d, {
|
|
336
376
|
label: "Expected output",
|
|
337
377
|
value: e.expectedOutput
|
|
338
378
|
})]
|
|
@@ -341,56 +381,66 @@ function j() {
|
|
|
341
381
|
})
|
|
342
382
|
]
|
|
343
383
|
}) : null,
|
|
344
|
-
|
|
345
|
-
className: "p-5",
|
|
346
|
-
children: [/* @__PURE__ */ T("h2", {
|
|
347
|
-
className: "mb-3 text-base font-semibold text-text-primary",
|
|
348
|
-
children: "Latest run"
|
|
349
|
-
}), /* @__PURE__ */ T(te, { submission: Q })]
|
|
350
|
-
}) : $ && $.verdict === "PENDING" ? /* @__PURE__ */ E(O, {
|
|
384
|
+
Z ? /* @__PURE__ */ T(D, {
|
|
351
385
|
className: "p-5",
|
|
352
386
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ w("h2", {
|
|
354
388
|
className: "mb-2 text-base font-semibold text-text-primary",
|
|
355
389
|
children: "Latest run"
|
|
356
390
|
}),
|
|
357
|
-
/* @__PURE__ */ T("p", {
|
|
391
|
+
Ne ? /* @__PURE__ */ T("p", {
|
|
392
|
+
className: "mb-3 inline-flex items-center gap-2 text-sm text-text-secondary",
|
|
393
|
+
children: [/* @__PURE__ */ w(S, {
|
|
394
|
+
size: 14,
|
|
395
|
+
className: "animate-spin"
|
|
396
|
+
}), "Grading your submission — the grader is starting up. Your verdict will appear here automatically."]
|
|
397
|
+
}) : /* @__PURE__ */ w("p", {
|
|
358
398
|
className: "mb-3 text-sm text-text-secondary",
|
|
359
|
-
children: "Your most recent submission has not been graded yet — the grader was unavailable
|
|
399
|
+
children: "Your most recent submission has not been graded yet — the grader was unavailable. You can re-run it without resubmitting your code."
|
|
360
400
|
}),
|
|
361
|
-
/* @__PURE__ */ E
|
|
401
|
+
/* @__PURE__ */ T(E, {
|
|
362
402
|
variant: "outline",
|
|
363
|
-
onClick: () => void
|
|
364
|
-
disabled:
|
|
403
|
+
onClick: () => void je(Z),
|
|
404
|
+
disabled: B,
|
|
365
405
|
children: [
|
|
366
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ w(S, { size: 16 }),
|
|
367
407
|
" ",
|
|
368
|
-
|
|
408
|
+
B ? "Re-running…" : "Re-run grader"
|
|
369
409
|
]
|
|
370
410
|
})
|
|
371
411
|
]
|
|
412
|
+
}) : Y ? /* @__PURE__ */ T(D, {
|
|
413
|
+
className: "p-5",
|
|
414
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
415
|
+
className: "mb-3 text-base font-semibold text-text-primary",
|
|
416
|
+
children: "Latest run"
|
|
417
|
+
}), /* @__PURE__ */ w(ie, { submission: Y })]
|
|
372
418
|
}) : null
|
|
373
419
|
]
|
|
374
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ w("div", {
|
|
375
421
|
className: "lg:col-span-1",
|
|
376
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ T(D, {
|
|
377
423
|
className: "p-5",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
379
425
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
380
426
|
children: "My submissions"
|
|
381
|
-
}),
|
|
427
|
+
}), De && !J.length ? /* @__PURE__ */ w(ee, {
|
|
382
428
|
count: 3,
|
|
383
429
|
height: "h-12"
|
|
384
|
-
}) :
|
|
430
|
+
}) : L ? /* @__PURE__ */ w(l, {
|
|
385
431
|
title: "Couldn't load submissions",
|
|
386
|
-
error:
|
|
387
|
-
}) :
|
|
388
|
-
icon: /* @__PURE__ */
|
|
432
|
+
error: L
|
|
433
|
+
}) : J.length === 0 ? /* @__PURE__ */ w(c, {
|
|
434
|
+
icon: /* @__PURE__ */ w(b, { size: 24 }),
|
|
389
435
|
title: "No submissions yet",
|
|
390
436
|
description: "Submit a solution above to see your verdicts and points here."
|
|
391
|
-
}) : /* @__PURE__ */
|
|
437
|
+
}) : /* @__PURE__ */ w("div", {
|
|
392
438
|
className: "space-y-1",
|
|
393
|
-
children:
|
|
439
|
+
children: J.map((e) => /* @__PURE__ */ w(Ce, {
|
|
440
|
+
s: e,
|
|
441
|
+
focused: p === e.id,
|
|
442
|
+
onToggle: () => A(p === e.id ? null : e.id)
|
|
443
|
+
}, e.id))
|
|
394
444
|
})]
|
|
395
445
|
})
|
|
396
446
|
})]
|
|
@@ -399,6 +449,6 @@ function j() {
|
|
|
399
449
|
});
|
|
400
450
|
}
|
|
401
451
|
//#endregion
|
|
402
|
-
export {
|
|
452
|
+
export { A as ApplicationsProblemDetailsPagePage };
|
|
403
453
|
|
|
404
454
|
//# sourceMappingURL=ApplicationsProblemDetailsPagePage.js.map
|