alexsys-exam-renderer 0.1.0 → 0.1.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.
package/dist/index.js CHANGED
@@ -1,21 +1,22 @@
1
- import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
2
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
3
- import { DragDropProvider as s, useDraggable as c, useDroppable as l } from "@dnd-kit/react";
4
- import { CheckCircle2 as u, Eraser as d, Mic as f, PencilRuler as p, RotateCcw as m, Square as h, VolumeX as g, XCircle as _ } from "lucide-react";
5
- import { Arc as v, Circle as y, Group as b, Layer as x, Line as S, Rect as C, Stage as w, Text as T } from "react-konva";
6
- import { move as E } from "@dnd-kit/helpers";
7
- import { useSortable as D } from "@dnd-kit/react/sortable";
1
+ import { Fragment as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ import { DragDropProvider as c, useDraggable as l, useDroppable as u } from "@dnd-kit/react";
4
+ import { Apple as d, CheckCircle2 as f, Circle as p, Diamond as m, Eraser as h, Flower2 as g, Heart as _, Hexagon as v, Mic as y, PencilRuler as b, Pentagon as x, RectangleHorizontal as S, RotateCcw as ee, Square as C, Star as w, Sun as T, Triangle as E, VolumeX as D, XCircle as O } from "lucide-react";
5
+ import { Arc as k, Circle as A, Group as j, Layer as te, Line as M, Rect as N, Stage as ne, Text as P } from "react-konva";
6
+ import { move as F } from "@dnd-kit/helpers";
7
+ import { useSortable as I } from "@dnd-kit/react/sortable";
8
8
  //#region src/exam-session/examScoring.ts
9
- var O = 1e3, k = 500, A = 70;
10
- function j(e, t) {
11
- let n = e.sections.filter((e) => e.isScored !== !1).map((e) => M(e, t)), r = H(n, (e) => e.correctCount), i = H(n, (e) => e.incorrectCount), a = H(n, (e) => e.unansweredCount), o = i + a, s = H(n, (e) => e.totalUnits), c = U(H(n, (e) => e.maxScore)), l = U(H(n, (e) => e.score));
9
+ var re = 1e3, L = 600, R = 70;
10
+ function ie(e, t) {
11
+ let n = e.sections.filter((e) => e.isScored !== !1).map((e) => ae(e, t)), r = H(n, (e) => e.correctCount), i = H(n, (e) => e.incorrectCount), a = H(n, (e) => e.unansweredCount), o = i + a, s = H(n, (e) => e.totalUnits), c = Ce(H(n, (e) => e.maxScore)), l = Ce(H(n, (e) => e.score));
12
12
  return {
13
+ attentionWarningCount: 0,
13
14
  correctCount: r,
14
15
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
15
16
  incorrectCount: i,
16
17
  maxScore: c,
17
18
  notCorrectCount: o,
18
- percentage: c > 0 ? U(l / c * 100) : 0,
19
+ percentage: c > 0 ? Ce(l / c * 100) : 0,
19
20
  score: l,
20
21
  sections: n,
21
22
  subject: e.subject,
@@ -24,11 +25,11 @@ function j(e, t) {
24
25
  unansweredCount: a
25
26
  };
26
27
  }
27
- function M(e, t) {
28
- let n = e.questions.flatMap((e) => N(e, t)).map((t) => ({
28
+ function ae(e, t) {
29
+ let n = e.questions.flatMap((e) => oe(e, t)).map((t) => ({
29
30
  ...t,
30
31
  sectionId: e.id
31
- })), r = Number.parseFloat(e.points) || 0, i = V(n, "correct"), a = V(n, "incorrect"), o = V(n, "unanswered"), s = a + o, c = n.length > 0 ? r / n.length : 0;
32
+ })), r = Number.parseFloat(e.points) || 0, i = Se(n, "correct"), a = Se(n, "incorrect"), o = Se(n, "unanswered"), s = a + o, c = n.length > 0 ? r / n.length : 0;
32
33
  return {
33
34
  badge: e.badge,
34
35
  correctCount: i,
@@ -36,7 +37,7 @@ function M(e, t) {
36
37
  incorrectCount: a,
37
38
  maxScore: r,
38
39
  notCorrectCount: s,
39
- score: U(i * c),
40
+ score: Ce(i * c),
40
41
  title: e.title,
41
42
  tone: e.tone,
42
43
  totalUnits: n.length,
@@ -44,77 +45,93 @@ function M(e, t) {
44
45
  units: n
45
46
  };
46
47
  }
47
- function N(e, t) {
48
+ function oe(e, t) {
48
49
  switch (e.type) {
49
50
  case "inline-inputs":
50
51
  case "equation-inputs": return e.items.flatMap((n) => {
52
+ if (n.answers?.length) return n.answers.flatMap((r) => {
53
+ if (!r.correctAnswer) return [];
54
+ let i = `${e.id}:${n.id}:${r.id}`;
55
+ return [B(i, e.id, r.before, r.correctAnswer, t[i])];
56
+ });
51
57
  if (!n.correctAnswer) return [];
52
58
  let r = `${e.id}:${n.id}`;
53
- return [P(r, e.id, n.before, n.correctAnswer, t[r])];
59
+ return [B(r, e.id, n.before, n.correctAnswer, t[r])];
60
+ });
61
+ case "number-line": return [B(e.id, e.id, e.expression, e.correctAnswer, t[e.id])];
62
+ case "visual-choice": return se(e.id, e.id, e.grading.pairs, t[e.id]);
63
+ case "length-estimation": return ce(e, t);
64
+ case "shape-choice": return se(e.id, e.id, e.grading.pairs, t[e.id]);
65
+ case "drag-match": return se(e.id, e.id, e.grading?.pairs, t[e.id]);
66
+ case "drawing-grid": return [pe(e, t[e.id])];
67
+ case "table-response": return ue(e, t[e.id]);
68
+ case "text-input": return e.correctAnswer ? [B(e.id, e.id, e.prompt, e.correctAnswer, t[e.id])] : [];
69
+ case "word-problem": return e.parts.flatMap((n) => {
70
+ let r = `${e.id}:${n.id}`;
71
+ return n.type === "coin-table" ? de(e.id, n, t[r]) : n.correctAnswer ? [B(r, e.id, n.prompt, n.correctAnswer, t[r])] : [];
54
72
  });
55
- case "number-line": return [P(e.id, e.id, e.expression, e.correctAnswer, t[e.id])];
56
- case "visual-choice": return te(e.id, e.id, e.grading.pairs, t[e.id]);
57
- case "length-estimation": return ne(e, t);
58
- case "shape-choice": return te(e.id, e.id, e.grading.pairs, t[e.id]);
59
- case "drag-match": return te(e.id, e.id, e.grading?.pairs, t[e.id]);
60
- case "drawing-grid": return [L(e, t[e.id])];
61
- case "table-response": return I(e, t[e.id]);
62
- case "text-input": return e.correctAnswer ? [P(e.id, e.id, e.prompt, e.correctAnswer, t[e.id])] : [];
63
73
  case "sortable-answer": return [];
64
- case "label-placement": return re(e.id, e.grading?.targetsByLabelId, t[e.id]);
65
- case "audio-recording": return [ee(e, t[e.id])];
74
+ case "label-placement": return fe(e.id, e.grading?.targetsByLabelId, t[e.id]);
75
+ case "audio-recording": return [z(e, t[e.id])];
66
76
  }
67
77
  }
68
- function ee(e, t) {
69
- return t?.kind === "audio-recording" ? z(e.id, e.id, e.expectedAnswer, t.evaluation.isCorrect ? "correct" : "incorrect") : z(e.id, e.id, e.expectedAnswer, "unanswered");
78
+ function z(e, t) {
79
+ return t?.kind === "audio-recording" ? V(e.id, e.id, e.expectedAnswer, t.evaluation.isCorrect ? "correct" : "incorrect") : V(e.id, e.id, e.expectedAnswer, "unanswered");
70
80
  }
71
- function P(e, t, n, r, i) {
72
- return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? z(e, t, n, "unanswered") : z(e, t, n, i.recognizedValue && le(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || B(i.value) === "" ? z(e, t, n, "unanswered") : z(e, t, n, le(i.value, r) ? "correct" : "incorrect") : z(e, t, n, "incorrect");
81
+ function B(e, t, n, r, i) {
82
+ return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? V(e, t, n, "unanswered") : V(e, t, n, i.recognizedValue && be(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || xe(i.value) === "" ? V(e, t, n, "unanswered") : V(e, t, n, be(i.value, r) ? "correct" : "incorrect") : V(e, t, n, "incorrect");
73
83
  }
74
- function te(e, t, n, r) {
84
+ function se(e, t, n, r) {
75
85
  return n ? Object.entries(n).map(([n, i]) => {
76
86
  let a = r?.kind === "matches" ? r.pairs[n] : void 0, o = a ? a === i ? "correct" : "incorrect" : "unanswered";
77
- return z(`${e}:${n}`, t, n, o);
87
+ return V(`${e}:${n}`, t, n, o);
78
88
  }) : [];
79
89
  }
80
- function ne(e, t) {
90
+ function ce(e, t) {
81
91
  let n = e.items.map((n) => {
82
92
  let r = `${e.id}:squares:${n.id}`;
83
- return P(r, e.id, n.label, n.squareLength.toString(), t[r]);
93
+ return B(r, e.id, n.label, n.squareLength.toString(), t[r]);
84
94
  }), r = e.items.flatMap((n) => {
85
95
  if (!n.correctColorId) return [];
86
96
  let r = `${e.id}:color:${n.id}`;
87
- return [F(r, e.id, n.label, n.correctColorId, t[r])];
97
+ return [le(r, e.id, n.label, n.correctColorId, t[r])];
88
98
  });
89
99
  return n.concat(r);
90
100
  }
91
- function F(e, t, n, r, i) {
92
- return i?.kind !== "choice" || !i.choiceId ? z(e, t, n, "unanswered") : z(e, t, n, i.choiceId === r ? "correct" : "incorrect");
101
+ function le(e, t, n, r, i) {
102
+ return i?.kind !== "choice" || !i.choiceId ? V(e, t, n, "unanswered") : V(e, t, n, i.choiceId === r ? "correct" : "incorrect");
93
103
  }
94
- function I(e, t) {
104
+ function ue(e, t) {
95
105
  return e.columns.flatMap((n) => {
96
106
  if (typeof n.correctCount != "number") return [];
97
107
  let r = t?.kind === "coin-table" ? t.counts[n.id] : void 0, i = r === void 0 ? "unanswered" : r === n.correctCount ? "correct" : "incorrect";
98
- return z(`${e.id}:${n.id}`, e.id, n.title, i);
108
+ return V(`${e.id}:${n.id}`, e.id, n.title, i);
109
+ });
110
+ }
111
+ function de(e, t, n) {
112
+ return t.columns.flatMap((r) => {
113
+ if (typeof r.correctCount != "number") return [];
114
+ let i = n?.kind === "coin-table" ? n.counts[r.id] : void 0, a = i === void 0 ? "unanswered" : i === r.correctCount ? "correct" : "incorrect";
115
+ return V(`${e}:${t.id}:${r.id}`, e, r.title, a);
99
116
  });
100
117
  }
101
- function re(e, t, n) {
118
+ function fe(e, t, n) {
102
119
  return t ? Object.entries(t).map(([t, r]) => {
103
120
  let i = n?.kind === "placements" ? n.placements[t]?.targetId : void 0, a = i ? i === r ? "correct" : "incorrect" : "unanswered";
104
- return z(`${e}:${t}`, e, t, a);
121
+ return V(`${e}:${t}`, e, t, a);
105
122
  }) : [];
106
123
  }
107
- function L(e, t) {
124
+ function pe(e, t) {
108
125
  let n = e.grading.expectedSegments, r = t?.kind === "drawing" && ((t.elements?.length ?? 0) > 0 || (t.strokes?.length ?? 0) > 0);
109
- if (t?.kind !== "drawing" || !r) return z(e.id, e.id, e.prompt, "unanswered");
110
- let i = n.every((n) => ie(t, e, n));
111
- return z(e.id, e.id, e.prompt, i ? "correct" : "incorrect");
126
+ if (t?.kind !== "drawing" || !r) return V(e.id, e.id, e.prompt, "unanswered");
127
+ let i = n.every((n) => me(t, e, n));
128
+ return V(e.id, e.id, e.prompt, i ? "correct" : "incorrect");
112
129
  }
113
- function ie(e, t, n) {
114
- let r = R(t, n.from), i = R(t, n.to);
115
- return !r || !i ? !1 : ae(e).some((e) => oe(e, r, i));
130
+ function me(e, t, n) {
131
+ let r = ve(t, n.from), i = ve(t, n.to);
132
+ return !r || !i ? !1 : he(e).some((e) => ge(e, r, i));
116
133
  }
117
- function ae(e) {
134
+ function he(e) {
118
135
  let t = e.elements.flatMap((e) => e.type === "line" ? [{
119
136
  end: {
120
137
  x: e.points[2],
@@ -148,31 +165,31 @@ function ae(e) {
148
165
  }]) ?? [];
149
166
  return t.concat(n);
150
167
  }
151
- function oe(e, t, n) {
152
- let r = W(e.start, t) <= A && W(e.end, n) <= A, i = W(e.start, n) <= A && W(e.end, t) <= A;
153
- return !r && !i ? !1 : se(e.points, t, n, A);
168
+ function ge(e, t, n) {
169
+ let r = U(e.start, t) <= R && U(e.end, n) <= R, i = U(e.start, n) <= R && U(e.end, t) <= R;
170
+ return !r && !i ? !1 : _e(e.points, t, n, R);
154
171
  }
155
- function se(e, t, n, r) {
156
- for (let i = 0; i < e.length - 1; i += 4) if (ue({
172
+ function _e(e, t, n, r) {
173
+ for (let i = 0; i < e.length - 1; i += 4) if (we({
157
174
  x: e[i],
158
175
  y: e[i + 1]
159
176
  }, t, n) > r) return !1;
160
177
  return !0;
161
178
  }
162
- function R(e, t) {
179
+ function ve(e, t) {
163
180
  if ("pointId" in t) {
164
181
  let n = e.points.find((e) => e.id === t.pointId);
165
- return n ? ce(n.x, n.y) : null;
182
+ return n ? ye(n.x, n.y) : null;
166
183
  }
167
- return ce(t.percentX, t.percentY);
184
+ return ye(t.percentX, t.percentY);
168
185
  }
169
- function ce(e, t) {
186
+ function ye(e, t) {
170
187
  return {
171
- x: e / 100 * O,
172
- y: t / 100 * k
188
+ x: e / 100 * re,
189
+ y: t / 100 * L
173
190
  };
174
191
  }
175
- function z(e, t, n, r) {
192
+ function V(e, t, n, r) {
176
193
  return {
177
194
  id: e,
178
195
  label: n,
@@ -180,41 +197,41 @@ function z(e, t, n, r) {
180
197
  status: r
181
198
  };
182
199
  }
183
- function le(e, t) {
184
- let n = B(e), r = B(t), i = Number(n), a = Number(r);
200
+ function be(e, t) {
201
+ let n = xe(e), r = xe(t), i = Number(n), a = Number(r);
185
202
  return Number.isFinite(i) && Number.isFinite(a) ? i === a : n === r;
186
203
  }
187
- function B(e) {
204
+ function xe(e) {
188
205
  return e.trim().replace(/[٠-٩]/g, (e) => `${e.charCodeAt(0) - 1632}`).replace(/[۰-۹]/g, (e) => `${e.charCodeAt(0) - 1776}`);
189
206
  }
190
- function V(e, t) {
207
+ function Se(e, t) {
191
208
  return e.filter((e) => e.status === t).length;
192
209
  }
193
210
  function H(e, t) {
194
211
  return e.reduce((e, n) => e + t(n), 0);
195
212
  }
196
- function U(e) {
213
+ function Ce(e) {
197
214
  return Math.round(e * 100) / 100;
198
215
  }
199
- function W(e, t) {
216
+ function U(e, t) {
200
217
  return Math.hypot(e.x - t.x, e.y - t.y);
201
218
  }
202
- function ue(e, t, n) {
219
+ function we(e, t, n) {
203
220
  let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
204
- if (a === 0) return W(e, t);
221
+ if (a === 0) return U(e, t);
205
222
  let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
206
- return W(e, {
223
+ return U(e, {
207
224
  x: t.x + o * r,
208
225
  y: t.y + o * i
209
226
  });
210
227
  }
211
228
  //#endregion
212
229
  //#region src/exam-session/interactions/CoinTableResponse.tsx
213
- var de = 0, fe = 12;
214
- function pe({ columns: e, value: t, onChange: n }) {
230
+ var Te = 0, Ee = 12;
231
+ function De({ columns: e, value: t, onChange: n }) {
215
232
  let r = t?.counts ?? {};
216
233
  function i(e, t) {
217
- let i = e.maxCoins ?? fe, a = Math.max(de, Math.min(i, t));
234
+ let i = e.maxCoins ?? Ee, a = Math.max(Te, Math.min(i, t));
218
235
  n({
219
236
  kind: "coin-table",
220
237
  counts: {
@@ -223,52 +240,52 @@ function pe({ columns: e, value: t, onChange: n }) {
223
240
  }
224
241
  });
225
242
  }
226
- return /* @__PURE__ */ a("div", {
243
+ return /* @__PURE__ */ o("div", {
227
244
  className: "response-table",
228
245
  children: e.map((e) => {
229
- let t = r[e.id] ?? 0, n = e.maxCoins ?? fe;
230
- return /* @__PURE__ */ o("div", {
246
+ let t = r[e.id] ?? 0, n = e.maxCoins ?? Ee;
247
+ return /* @__PURE__ */ s("div", {
231
248
  className: "response-column",
232
249
  children: [
233
- /* @__PURE__ */ a("h4", { children: e.title }),
234
- /* @__PURE__ */ o("div", {
250
+ /* @__PURE__ */ o("h4", { children: e.title }),
251
+ /* @__PURE__ */ s("div", {
235
252
  className: "coin-table-area",
236
253
  "aria-label": e.answerLabel,
237
- children: [/* @__PURE__ */ a("div", {
254
+ children: [/* @__PURE__ */ o("div", {
238
255
  className: "coin-list",
239
256
  "aria-hidden": "true",
240
- children: Array.from({ length: t }, (t, n) => /* @__PURE__ */ a("span", {
257
+ children: Array.from({ length: t }, (t, n) => /* @__PURE__ */ o("span", {
241
258
  className: "coin-shape",
242
259
  children: "د"
243
260
  }, `${e.id}-coin-${n}`))
244
- }), /* @__PURE__ */ o("div", {
261
+ }), /* @__PURE__ */ s("div", {
245
262
  className: "coin-controls",
246
- children: [/* @__PURE__ */ a("button", {
263
+ children: [/* @__PURE__ */ o("button", {
247
264
  className: "coin-action",
248
265
  disabled: t >= n,
249
266
  onClick: () => i(e, t + 1),
250
267
  type: "button",
251
268
  children: "إِضافَةٌ"
252
- }), /* @__PURE__ */ a("button", {
269
+ }), /* @__PURE__ */ o("button", {
253
270
  className: "coin-action coin-action--secondary",
254
- disabled: t <= de,
271
+ disabled: t <= Te,
255
272
  onClick: () => i(e, t - 1),
256
273
  type: "button",
257
274
  children: "حَذْفٌ"
258
275
  })]
259
276
  })]
260
277
  }),
261
- /* @__PURE__ */ o("label", {
278
+ /* @__PURE__ */ s("label", {
262
279
  className: "coin-count-answer",
263
280
  children: [
264
- /* @__PURE__ */ a("span", { children: e.answerLabel }),
265
- /* @__PURE__ */ a("input", {
281
+ /* @__PURE__ */ o("span", { children: e.answerLabel }),
282
+ /* @__PURE__ */ o("input", {
266
283
  "aria-label": e.answerLabel,
267
284
  inputMode: "numeric",
268
285
  onChange: (t) => i(e, Number(t.target.value) || 0),
269
286
  value: t
270
287
  }),
271
- /* @__PURE__ */ a("span", { children: "دَراهِمُ" })
288
+ /* @__PURE__ */ o("span", { children: "دَراهِمُ" })
272
289
  ]
273
290
  })
274
291
  ]
@@ -277,10 +294,48 @@ function pe({ columns: e, value: t, onChange: n }) {
277
294
  });
278
295
  }
279
296
  //#endregion
297
+ //#region src/renderer/shapeCatalog.tsx
298
+ var Oe = {
299
+ circle: p,
300
+ diamond: m,
301
+ heart: _,
302
+ hexagon: v,
303
+ pentagon: x,
304
+ rectangle: S,
305
+ square: C,
306
+ star: w,
307
+ triangle: E
308
+ }, ke = {
309
+ circle: "Cercle",
310
+ diamond: "Losange",
311
+ heart: "Coeur",
312
+ hexagon: "Hexagone",
313
+ pentagon: "Pentagone",
314
+ rectangle: "Rectangle",
315
+ square: "Carre",
316
+ star: "Etoile",
317
+ triangle: "Triangle"
318
+ }, Ae = Object.keys(ke).map((e) => ({
319
+ label: ke[e],
320
+ value: e
321
+ }));
322
+ function je(e) {
323
+ return ke[e];
324
+ }
325
+ function Me({ shapeId: e, title: t }) {
326
+ let n = Oe[e];
327
+ return /* @__PURE__ */ o("span", {
328
+ "aria-label": t,
329
+ role: t ? "img" : void 0,
330
+ title: t,
331
+ children: /* @__PURE__ */ o(n, { "aria-hidden": t ? void 0 : !0 })
332
+ });
333
+ }
334
+ //#endregion
280
335
  //#region src/exam-session/interactions/DragMatch.tsx
281
- function me({ items: e, targets: t, value: n, onChange: r }) {
282
- let i = n?.pairs ?? {}, c = new Set(Object.values(i));
283
- return /* @__PURE__ */ a(s, {
336
+ function Ne({ items: e, targets: t, value: n, onChange: r }) {
337
+ let i = n?.pairs ?? {}, a = new Set(Object.values(i));
338
+ return /* @__PURE__ */ o(c, {
284
339
  onDragEnd: (e) => {
285
340
  if (e.canceled) return;
286
341
  let t = e.operation.source?.id?.toString(), n = e.operation.target?.id?.toString();
@@ -292,14 +347,14 @@ function me({ items: e, targets: t, value: n, onChange: r }) {
292
347
  }
293
348
  });
294
349
  },
295
- children: /* @__PURE__ */ o("div", {
350
+ children: /* @__PURE__ */ s("div", {
296
351
  className: "drag-match",
297
- children: [/* @__PURE__ */ a("div", {
352
+ children: [/* @__PURE__ */ o("div", {
298
353
  className: "drag-match__items",
299
- children: e.filter((e) => !c.has(e.id)).map((e) => /* @__PURE__ */ a(he, { item: e }, e.id))
300
- }), /* @__PURE__ */ a("div", {
354
+ children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Pe, { item: e }, e.id))
355
+ }), /* @__PURE__ */ o("div", {
301
356
  className: "drag-match__targets",
302
- children: t.map((t) => /* @__PURE__ */ a(ge, {
357
+ children: t.map((t) => /* @__PURE__ */ o(Fe, {
303
358
  assignedItem: e.find((e) => e.id === i[t.id]),
304
359
  target: t
305
360
  }, t.id))
@@ -307,78 +362,83 @@ function me({ items: e, targets: t, value: n, onChange: r }) {
307
362
  })
308
363
  });
309
364
  }
310
- function he({ item: e }) {
311
- let { ref: t, isDragging: n } = c({ id: e.id });
312
- return /* @__PURE__ */ a("button", {
365
+ function Pe({ item: e }) {
366
+ let { ref: t, isDragging: n } = l({ id: e.id });
367
+ return /* @__PURE__ */ o("button", {
313
368
  className: n ? "drag-pill drag-pill--dragging" : "drag-pill",
314
369
  ref: t,
315
370
  type: "button",
316
371
  children: e.label
317
372
  });
318
373
  }
319
- function ge({ assignedItem: e, target: t }) {
320
- let { ref: n, isDropTarget: r } = l({ id: t.id });
321
- return /* @__PURE__ */ o("div", {
374
+ function Fe({ assignedItem: e, target: t }) {
375
+ let { ref: n, isDropTarget: r } = u({ id: t.id });
376
+ return /* @__PURE__ */ s("div", {
322
377
  className: r ? "drop-slot drop-slot--active" : "drop-slot",
323
378
  ref: n,
324
- children: [/* @__PURE__ */ a("span", {
325
- className: "drop-slot__visual",
326
- children: t.label
327
- }), e ? /* @__PURE__ */ a(he, { item: e }) : /* @__PURE__ */ a("span", { children: "ضَعِ الإِجابَةَ هُنا" })]
379
+ children: [/* @__PURE__ */ o("span", {
380
+ className: t.shapeId ? "drop-slot__visual drop-slot__visual--shape" : "drop-slot__visual",
381
+ children: t.shapeId ? /* @__PURE__ */ o(Me, {
382
+ shapeId: t.shapeId,
383
+ title: t.label
384
+ }) : t.label
385
+ }), e ? /* @__PURE__ */ o(Pe, { item: e }) : /* @__PURE__ */ o("span", { children: "ضع الإجابة هنا" })]
328
386
  });
329
387
  }
330
388
  //#endregion
331
389
  //#region src/exam-session/interactions/HandwrittenNumberAnswer.tsx
332
- var G = 132, K = 88, _e = 650;
333
- function q({ ariaLabel: t, value: i, onChange: s, onClear: c, recognizer: l }) {
334
- let u = i?.strokes ?? [], f = u.length === 0, p = n(s), [m, h] = r(!1), [g, _] = r(!1), v = !!l?.isAvailable(), y = f || m ? "idle" : i?.recognizedValue === void 0 ? v ? g ? "unrecognized" : "recognizing" : "unavailable" : "recognized";
335
- e(() => {
336
- p.current = s;
337
- }, [s]), e(() => {
338
- if (f || m || !i || !l || i.recognizedValue !== void 0 || !v) return;
390
+ var Ie = 132, W = 88, Le = 650;
391
+ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
392
+ let u = l?.strokes ?? [], d = u.length === 0, f = r(n), [p, m] = i(!1), [g, _] = i(!1), v = !!c?.isAvailable(), y = c?.getStatus?.() ?? (v ? "ready" : "unavailable"), b = y === "preparing" || y === "error", x = y === "preparing" ? "preparing-model" : y === "error" ? "model-error" : d || p ? "idle" : l?.recognizedValue === void 0 ? !v || y === "unavailable" ? "unavailable" : g ? "unrecognized" : "recognizing" : "recognized";
393
+ t(() => {
394
+ f.current = n;
395
+ }, [n]), t(() => {
396
+ if (d || p || !l || !c || l.recognizedValue !== void 0 || !v || y !== "ready") return;
339
397
  let e = !1, t = window.setTimeout(() => {
340
- l.recognize(i).then((t) => {
398
+ c.recognize(l).then((t) => {
341
399
  if (!e) {
342
400
  if (t.recognizedValue === void 0) {
343
401
  _(!0);
344
402
  return;
345
403
  }
346
- p.current(t);
404
+ f.current(t);
347
405
  }
348
406
  }).catch(() => {
349
407
  e || _(!0);
350
408
  });
351
- }, _e);
409
+ }, Le);
352
410
  return () => {
353
411
  e = !0, window.clearTimeout(t);
354
412
  };
355
413
  }, [
356
- m,
357
- f,
414
+ p,
415
+ d,
416
+ y,
358
417
  v,
359
- l,
360
- i
418
+ c,
419
+ l
361
420
  ]);
362
- function b(e) {
363
- _(!1), s({
364
- canvasHeight: K,
365
- canvasWidth: G,
421
+ function S(e) {
422
+ _(!1), n({
423
+ canvasHeight: W,
424
+ canvasWidth: Ie,
366
425
  kind: "handwritten-number",
367
426
  strokes: e
368
427
  });
369
428
  }
370
- function E(e) {
429
+ function ee(e) {
430
+ if (b) return;
371
431
  let t = e.target.getStage()?.getPointerPosition();
372
- t && (e.evt.preventDefault(), h(!0), b([...u, {
432
+ t && (e.evt.preventDefault(), m(!0), S([...u, {
373
433
  id: `stroke-${Date.now()}-${Math.round(t.x)}-${Math.round(t.y)}`,
374
434
  points: [t.x, t.y],
375
435
  timestamps: [Date.now()]
376
436
  }]));
377
437
  }
378
- function D(e) {
379
- if (f || !e.evt.buttons && e.evt.pointerType === "mouse") return;
438
+ function C(e) {
439
+ if (b || d || !e.evt.buttons && e.evt.pointerType === "mouse") return;
380
440
  let t = e.target.getStage()?.getPointerPosition();
381
- t && (e.evt.preventDefault(), b(u.map((e, n) => n === u.length - 1 ? {
441
+ t && (e.evt.preventDefault(), S(u.map((e, n) => n === u.length - 1 ? {
382
442
  ...e,
383
443
  points: [
384
444
  ...e.points,
@@ -388,64 +448,66 @@ function q({ ariaLabel: t, value: i, onChange: s, onClear: c, recognizer: l }) {
388
448
  timestamps: [...e.timestamps ?? [], Date.now()]
389
449
  } : e)));
390
450
  }
391
- function O(e) {
392
- e.evt.preventDefault(), h(!1);
451
+ function w(e) {
452
+ b || (e.evt.preventDefault(), m(!1));
393
453
  }
394
- function k() {
395
- h(!1), b([]), c?.();
454
+ function T() {
455
+ m(!1), S([]), a?.();
396
456
  }
397
- return /* @__PURE__ */ o("div", {
457
+ return /* @__PURE__ */ s("div", {
458
+ "aria-disabled": b,
459
+ "aria-label": e,
398
460
  className: "handwritten-number-answer",
399
- "aria-label": t,
461
+ "data-model-state": y,
400
462
  children: [
401
- /* @__PURE__ */ o(w, {
463
+ /* @__PURE__ */ s(ne, {
402
464
  className: "handwritten-number-stage",
403
- height: K,
404
- onPointerCancel: O,
405
- onPointerDown: E,
406
- onPointerMove: D,
407
- onPointerUp: O,
465
+ height: W,
466
+ onPointerCancel: w,
467
+ onPointerDown: ee,
468
+ onPointerMove: C,
469
+ onPointerUp: w,
408
470
  role: "img",
409
- width: G,
410
- children: [/* @__PURE__ */ o(x, {
471
+ width: Ie,
472
+ children: [/* @__PURE__ */ s(te, {
411
473
  listening: !1,
412
474
  children: [
413
- /* @__PURE__ */ a(C, {
475
+ /* @__PURE__ */ o(N, {
414
476
  cornerRadius: 14,
415
477
  fill: "#fff",
416
- height: K,
478
+ height: W,
417
479
  stroke: "#cfe3d9",
418
480
  strokeWidth: 2,
419
- width: G,
481
+ width: Ie,
420
482
  x: 0,
421
483
  y: 0
422
484
  }),
423
- /* @__PURE__ */ a(S, {
485
+ /* @__PURE__ */ o(M, {
424
486
  dash: [6, 8],
425
487
  points: [
426
488
  16,
427
- K - 18,
428
- G - 16,
429
- K - 18
489
+ W - 18,
490
+ Ie - 16,
491
+ W - 18
430
492
  ],
431
493
  stroke: "#dbe9e2",
432
494
  strokeWidth: 2
433
495
  }),
434
- f ? /* @__PURE__ */ a(T, {
496
+ d ? /* @__PURE__ */ o(P, {
435
497
  align: "center",
436
498
  fill: "#9aaca3",
437
499
  fontFamily: "Arial, sans-serif",
438
500
  fontSize: 15,
439
501
  fontStyle: "bold",
440
- height: K,
502
+ height: W,
441
503
  text: "ارسم هنا",
442
504
  verticalAlign: "middle",
443
- width: G,
505
+ width: Ie,
444
506
  x: 0,
445
507
  y: 0
446
508
  }) : null
447
509
  ]
448
- }), /* @__PURE__ */ a(x, { children: u.map((e) => /* @__PURE__ */ a(S, {
510
+ }), /* @__PURE__ */ o(te, { children: u.map((e) => /* @__PURE__ */ o(M, {
449
511
  globalCompositeOperation: "source-over",
450
512
  lineCap: "round",
451
513
  lineJoin: "round",
@@ -455,50 +517,52 @@ function q({ ariaLabel: t, value: i, onChange: s, onClear: c, recognizer: l }) {
455
517
  tension: .28
456
518
  }, e.id)) })]
457
519
  }),
458
- /* @__PURE__ */ a("button", {
520
+ /* @__PURE__ */ o("button", {
459
521
  "aria-label": "مسح الجواب المرسوم",
460
522
  className: "handwritten-number-clear",
461
- disabled: f,
462
- onClick: k,
523
+ disabled: d || b,
524
+ onClick: T,
463
525
  type: "button",
464
- children: /* @__PURE__ */ a(d, { "aria-hidden": "true" })
526
+ children: /* @__PURE__ */ o(h, { "aria-hidden": "true" })
465
527
  }),
466
- y !== "idle" && y !== "unavailable" ? /* @__PURE__ */ a("span", {
528
+ x !== "idle" && x !== "unavailable" ? /* @__PURE__ */ o("span", {
467
529
  "aria-live": "polite",
468
530
  className: "handwritten-number-status",
469
- "data-state": y,
470
- children: ve(y, i?.recognizedValue)
531
+ "data-state": x,
532
+ children: Re(x, l?.recognizedValue)
471
533
  }) : null
472
534
  ]
473
535
  });
474
536
  }
475
- function ve(e, t) {
537
+ function Re(e, t) {
476
538
  switch (e) {
477
539
  case "recognizing": return "جارٍ التعرّف على الرقم…";
478
540
  case "recognized": return `تمّ التعرّف: ${t ?? ""}`;
479
541
  case "unrecognized": return "أَعِدْ كتابةَ الرقم بوضوح";
542
+ case "preparing-model": return "جارٍ تجهيز نموذج الأرقام…";
543
+ case "model-error": return "نموذج الأرقام غير جاهز";
480
544
  case "idle":
481
545
  case "unavailable": return "";
482
546
  }
483
547
  }
484
548
  //#endregion
485
549
  //#region src/exam-session/interactions/ColorPenPicker.tsx
486
- function ye({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onChange: i, selectedColorId: s }) {
487
- return /* @__PURE__ */ a("div", {
550
+ function ze({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onChange: i, selectedColorId: a }) {
551
+ return /* @__PURE__ */ o("div", {
488
552
  "aria-label": e,
489
553
  className: ["color-pen-picker", t].filter(Boolean).join(" "),
490
554
  role: "group",
491
- children: n.map((e) => /* @__PURE__ */ o("button", {
492
- "aria-pressed": s === e.id,
493
- className: s === e.id ? "color-pen-button color-pen-button--selected" : "color-pen-button",
555
+ children: n.map((e) => /* @__PURE__ */ s("button", {
556
+ "aria-pressed": a === e.id,
557
+ className: a === e.id ? "color-pen-button color-pen-button--selected" : "color-pen-button",
494
558
  disabled: r,
495
559
  onClick: () => i(e.id),
496
560
  style: { "--pen-color": e.value },
497
561
  type: "button",
498
- children: [/* @__PURE__ */ a("span", {
562
+ children: [/* @__PURE__ */ o("span", {
499
563
  className: "color-pen-button__indicator",
500
564
  "aria-hidden": "true"
501
- }), /* @__PURE__ */ a("span", {
565
+ }), /* @__PURE__ */ o("span", {
502
566
  className: "color-pen-button__label",
503
567
  children: e.label
504
568
  })]
@@ -507,7 +571,7 @@ function ye({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onCh
507
571
  }
508
572
  //#endregion
509
573
  //#region src/exam-session/interactions/geometryColors.ts
510
- var J = [
574
+ var K = [
511
575
  {
512
576
  id: "green",
513
577
  label: "أَخْضَرُ",
@@ -528,28 +592,28 @@ var J = [
528
592
  label: "أَسْوَدُ",
529
593
  value: "#17212b"
530
594
  }
531
- ], be = {
595
+ ], Be = {
532
596
  black: "#17212b",
533
597
  blue: "#256fd2",
534
598
  green: "#0b7f45",
535
599
  red: "#e34a58"
536
600
  };
537
- function xe(e, t) {
601
+ function Ve(e, t) {
538
602
  return t ? e.find((e) => e.id === t || e.value === t)?.id ?? e[0]?.id ?? "green" : e[0]?.id ?? "green";
539
603
  }
540
- function Se(e, t) {
541
- return e.find((e) => e.id === t)?.value ?? e[0]?.value ?? J[0].value;
604
+ function He(e, t) {
605
+ return e.find((e) => e.id === t)?.value ?? e[0]?.value ?? K[0].value;
542
606
  }
543
- function Ce(e) {
607
+ function Ue(e) {
544
608
  return e.map((e) => ({
545
609
  id: e.id,
546
610
  label: e.label,
547
- value: be[e.id] ?? J[0].value
611
+ value: Be[e.id] ?? K[0].value
548
612
  }));
549
613
  }
550
614
  //#endregion
551
615
  //#region src/exam-session/interactions/GeometryCanvas.tsx
552
- var we = 1e3, Te = 600, Y = 30, Ee = 240, De = 12, Oe = J[0].value, X = "#0a8f55", ke = [
616
+ var We = 1e3, Ge = 600, q = 30, Ke = 240, qe = 12, Je = K[0].value, J = "#0a8f55", Ye = [
553
617
  {
554
618
  id: "pen",
555
619
  icon: "✎",
@@ -580,44 +644,44 @@ var we = 1e3, Te = 600, Y = 30, Ee = 240, De = 12, Oe = J[0].value, X = "#0a8f55
580
644
  icon: "⌖",
581
645
  label: "بَرْكارٌ"
582
646
  }
583
- ], Ae = /* @__PURE__ */ new Set([
647
+ ], Xe = /* @__PURE__ */ new Set([
584
648
  "ruler",
585
649
  "protractor",
586
650
  "compass"
587
651
  ]);
588
- function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, className: s = "", colorOptions: c = J, defaultColor: l, disabled: u = !1, minStageWidth: d = Ee, onChange: f, points: p = [], showColorPalette: m = !0, value: h, variant: g = "question" }) {
589
- let _ = c.length > 0 ? c : J, [v, y] = r(null), [b, S] = r([]), [T, E] = r(() => xe(_, l ?? "black")), [D, O] = r(() => Be(h)), [k, A] = r(() => h?.guides ?? ze(i, t)), [j, M] = r(null), [N, ee] = r({
652
+ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, className: a = "", colorOptions: c = K, defaultColor: l, disabled: u = !1, minStageWidth: d = Ke, onChange: f, points: p = [], showColorPalette: m = !0, value: h, variant: g = "question" }) {
653
+ let _ = c.length > 0 ? c : K, [v, y] = i(null), [b, x] = i([]), [S, ee] = i(() => Ve(_, l ?? "black")), [C, w] = i(() => st(h)), [T, E] = i(() => h?.guides ?? ot(n, t)), [D, O] = i(null), [k, A] = i({
590
654
  height: t,
591
655
  scale: 1,
592
- width: i
593
- }), [P, te] = r({
656
+ width: n
657
+ }), [j, M] = i({
594
658
  canRedo: !1,
595
659
  canUndo: !1
596
- }), ne = n(null), F = n([Z(D)]), I = n(0), re = n(0), L = n(null);
597
- Me(ne, i, t, d, ee);
598
- let ie = He(p, i, t), ae = [
660
+ }), P = r(null), F = r([Y(C)]), I = r(0), re = r(0), L = r(null);
661
+ Qe(P, n, t, d, A);
662
+ let R = lt(p, n, t), ie = [
599
663
  "geometry-canvas",
600
664
  `geometry-canvas--${g}`,
601
- s
602
- ].filter(Boolean).join(" "), oe = _.some((e) => e.id === T) ? T : xe(_, "black"), se = Se(_, oe), R = Ge(v);
603
- function ce(e) {
604
- return Ae.has(e) ? !R && b.includes(e) : v === e || b.includes(e);
665
+ a
666
+ ].filter(Boolean).join(" "), ae = _.some((e) => e.id === S) ? S : Ve(_, "black"), oe = He(_, ae), z = ft(v);
667
+ function B(e) {
668
+ return Xe.has(e) ? !z && b.includes(e) : v === e || b.includes(e);
605
669
  }
606
- function z(e) {
607
- S((t) => t.includes(e) ? t.filter((t) => t !== e) : t.concat(e));
670
+ function se(e) {
671
+ x((t) => t.includes(e) ? t.filter((t) => t !== e) : t.concat(e));
608
672
  }
609
- function le(e) {
673
+ function ce(e) {
610
674
  if (e === "ruler" || e === "protractor") {
611
- if (R) {
612
- y(null), S((t) => t.includes(e) ? t : t.concat(e));
675
+ if (z) {
676
+ y(null), x((t) => t.includes(e) ? t : t.concat(e));
613
677
  return;
614
678
  }
615
- z(e);
679
+ se(e);
616
680
  return;
617
681
  }
618
682
  if (e === "compass") {
619
683
  let e = v !== "compass" || !b.includes("compass");
620
- y(e ? "compass" : null), S((t) => {
684
+ y(e ? "compass" : null), x((t) => {
621
685
  let n = t.filter((e) => e !== "compass");
622
686
  return e ? [...n, "compass"] : n;
623
687
  });
@@ -625,65 +689,65 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
625
689
  }
626
690
  y(e);
627
691
  }
628
- function B(e) {
692
+ function le(e) {
629
693
  return re.current += 1, `${e}-${Date.now()}-${re.current}`;
630
694
  }
631
- function V(e, t = k) {
695
+ function ue(e, t = T) {
632
696
  f({
633
- elements: Z(e),
697
+ elements: Y(e),
634
698
  guides: t,
635
699
  kind: "drawing",
636
- strokes: Ve(e)
700
+ strokes: ct(e)
637
701
  });
638
702
  }
639
- function H() {
640
- te({
703
+ function de() {
704
+ M({
641
705
  canRedo: I.current < F.current.length - 1,
642
706
  canUndo: I.current > 0
643
707
  });
644
708
  }
645
- function U(e, t = k) {
646
- let n = Z(e), r = F.current.slice(0, I.current + 1);
647
- r.push(n), F.current = r, I.current = r.length - 1, O(n), V(n, t), H();
709
+ function fe(e, t = T) {
710
+ let n = Y(e), r = F.current.slice(0, I.current + 1);
711
+ r.push(n), F.current = r, I.current = r.length - 1, w(n), ue(n, t), de();
648
712
  }
649
- function W(e) {
650
- A(e), V(D, e);
713
+ function pe(e) {
714
+ E(e), ue(C, e);
651
715
  }
652
- function ue() {
653
- if (!P.canUndo || u) return;
716
+ function me() {
717
+ if (!j.canUndo || u) return;
654
718
  --I.current;
655
- let e = Z(F.current[I.current]);
656
- O(e), V(e), H();
719
+ let e = Y(F.current[I.current]);
720
+ w(e), ue(e), de();
657
721
  }
658
- function de() {
659
- if (!P.canRedo || u) return;
722
+ function he() {
723
+ if (!j.canRedo || u) return;
660
724
  I.current += 1;
661
- let e = Z(F.current[I.current]);
662
- O(e), V(e), H();
725
+ let e = Y(F.current[I.current]);
726
+ w(e), ue(e), de();
663
727
  }
664
- function fe() {
665
- u || D.length === 0 || U([]);
728
+ function ge() {
729
+ u || C.length === 0 || fe([]);
666
730
  }
667
- function pe(e) {
668
- let n = e.target.getStage()?.getPointerPosition();
669
- return n ? {
670
- x: tt(n.x / N.scale, 0, i),
671
- y: tt(n.y / N.scale, 0, t)
731
+ function _e(e) {
732
+ let r = e.target.getStage()?.getPointerPosition();
733
+ return r ? {
734
+ x: St(r.x / k.scale, 0, n),
735
+ y: St(r.y / k.scale, 0, t)
672
736
  } : null;
673
737
  }
674
- function me(e) {
675
- if (u || !R && We(e.target)) return;
676
- let t = pe(e);
738
+ function ve(e) {
739
+ if (u || !z && dt(e.target)) return;
740
+ let t = _e(e);
677
741
  if (!t || !v) return;
678
742
  if (v === "eraser") {
679
- G(t);
743
+ be(t);
680
744
  return;
681
745
  }
682
- let n = Ue(t, ie);
746
+ let n = ut(t, R);
683
747
  if (v === "pen") {
684
- L.current = n, M({
685
- color: se,
686
- id: B("freehand"),
748
+ L.current = n, O({
749
+ color: oe,
750
+ id: le("freehand"),
687
751
  points: [n.x, n.y],
688
752
  strokeWidth: 4,
689
753
  type: "freehand"
@@ -691,9 +755,9 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
691
755
  return;
692
756
  }
693
757
  if (v === "line") {
694
- L.current = n, M({
695
- color: se,
696
- id: B("line"),
758
+ L.current = n, O({
759
+ color: oe,
760
+ id: le("line"),
697
761
  points: [
698
762
  n.x,
699
763
  n.y,
@@ -705,34 +769,34 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
705
769
  });
706
770
  return;
707
771
  }
708
- v === "compass" && (L.current = n, M({
772
+ v === "compass" && (L.current = n, O({
709
773
  center: n,
710
- color: se,
711
- id: B("circle"),
774
+ color: oe,
775
+ id: le("circle"),
712
776
  radius: 1,
713
777
  strokeWidth: 3,
714
778
  type: "circle"
715
779
  }));
716
780
  }
717
- function he(e) {
718
- let t = pe(e);
781
+ function ye(e) {
782
+ let t = _e(e);
719
783
  if (t) {
720
784
  if (v === "eraser" && !u) {
721
- G(t);
785
+ be(t);
722
786
  return;
723
787
  }
724
- if (!(!j || !L.current || u)) {
725
- if (j.type === "freehand") {
726
- M({
727
- ...j,
728
- points: j.points.concat([t.x, t.y])
788
+ if (!(!D || !L.current || u)) {
789
+ if (D.type === "freehand") {
790
+ O({
791
+ ...D,
792
+ points: D.points.concat([t.x, t.y])
729
793
  });
730
794
  return;
731
795
  }
732
- if (j.type === "line") {
733
- let e = Ue(t, ie);
734
- M({
735
- ...j,
796
+ if (D.type === "line") {
797
+ let e = ut(t, R);
798
+ O({
799
+ ...D,
736
800
  points: [
737
801
  L.current.x,
738
802
  L.current.y,
@@ -742,130 +806,130 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
742
806
  });
743
807
  return;
744
808
  }
745
- j.type === "circle" && M({
746
- ...j,
747
- radius: Q(j.center, t)
809
+ D.type === "circle" && O({
810
+ ...D,
811
+ radius: X(D.center, t)
748
812
  });
749
813
  }
750
814
  }
751
815
  }
752
- function ge() {
753
- if (!j || u) {
754
- L.current = null, M(null);
816
+ function V() {
817
+ if (!D || u) {
818
+ L.current = null, O(null);
755
819
  return;
756
820
  }
757
- let e = j;
758
- if (L.current = null, M(null), qe(e)) {
821
+ let e = D;
822
+ if (L.current = null, O(null), mt(e)) {
759
823
  if (e.type === "circle") {
760
824
  let t = {
761
- ...k,
825
+ ...T,
762
826
  compass: {
763
827
  center: e.center,
764
828
  radius: e.radius
765
829
  }
766
830
  };
767
- A(t), U(D.concat(e), t);
831
+ E(t), fe(C.concat(e), t);
768
832
  return;
769
833
  }
770
- U(D.concat(e));
834
+ fe(C.concat(e));
771
835
  }
772
836
  }
773
- function G(e) {
774
- if (D.length === 0) return;
775
- let t = Je(D, e);
776
- t < 0 || U(D.filter((e, n) => n !== t));
837
+ function be(e) {
838
+ if (C.length === 0) return;
839
+ let t = ht(C, e);
840
+ t < 0 || fe(C.filter((e, n) => n !== t));
777
841
  }
778
- return /* @__PURE__ */ o("div", {
779
- className: ae,
842
+ return /* @__PURE__ */ s("div", {
843
+ className: ie,
780
844
  "data-disabled": u ? "true" : "false",
781
845
  dir: "rtl",
782
846
  children: [
783
- /* @__PURE__ */ a("div", {
847
+ /* @__PURE__ */ o("div", {
784
848
  className: "geometry-toolbar",
785
849
  "aria-label": "أَدَواتُ الوَرَقَةِ المُسَوَّدَةِ",
786
- children: ke.map((e) => /* @__PURE__ */ o("button", {
787
- "aria-pressed": ce(e.id),
850
+ children: Ye.map((e) => /* @__PURE__ */ s("button", {
851
+ "aria-pressed": B(e.id),
788
852
  className: [
789
853
  "geometry-tool-button",
790
- ce(e.id) ? "geometry-tool-button--active" : "",
791
- Ae.has(e.id) ? "geometry-tool-button--guide" : ""
854
+ B(e.id) ? "geometry-tool-button--active" : "",
855
+ Xe.has(e.id) ? "geometry-tool-button--guide" : ""
792
856
  ].filter(Boolean).join(" "),
793
857
  disabled: u,
794
- onClick: () => le(e.id),
858
+ onClick: () => ce(e.id),
795
859
  type: "button",
796
- children: [/* @__PURE__ */ a("span", {
860
+ children: [/* @__PURE__ */ o("span", {
797
861
  "aria-hidden": "true",
798
862
  children: e.icon
799
- }), /* @__PURE__ */ a("span", { children: e.label })]
863
+ }), /* @__PURE__ */ o("span", { children: e.label })]
800
864
  }, e.id))
801
865
  }),
802
- m ? /* @__PURE__ */ a(ye, {
866
+ m ? /* @__PURE__ */ o(ze, {
803
867
  ariaLabel: "أَلْوانُ الأَقْلامِ",
804
868
  className: "geometry-color-picker",
805
869
  colors: _,
806
870
  disabled: u,
807
- onChange: E,
808
- selectedColorId: oe
871
+ onChange: ee,
872
+ selectedColorId: ae
809
873
  }) : null,
810
- /* @__PURE__ */ a("div", {
874
+ /* @__PURE__ */ o("div", {
811
875
  className: "geometry-stage-shell",
812
- ref: ne,
813
- children: /* @__PURE__ */ a(w, {
814
- height: N.height,
815
- onMouseDown: me,
816
- onMouseLeave: ge,
817
- onMouseMove: he,
818
- onMouseUp: ge,
819
- onTouchEnd: ge,
820
- onTouchMove: he,
821
- onTouchStart: me,
822
- width: N.width,
823
- children: /* @__PURE__ */ o(x, {
824
- scaleX: N.scale,
825
- scaleY: N.scale,
876
+ ref: P,
877
+ children: /* @__PURE__ */ o(ne, {
878
+ height: k.height,
879
+ onMouseDown: ve,
880
+ onMouseLeave: V,
881
+ onMouseMove: ye,
882
+ onMouseUp: V,
883
+ onTouchEnd: V,
884
+ onTouchMove: ye,
885
+ onTouchStart: ve,
886
+ width: k.width,
887
+ children: /* @__PURE__ */ s(te, {
888
+ scaleX: k.scale,
889
+ scaleY: k.scale,
826
890
  children: [
827
- /* @__PURE__ */ a(C, {
891
+ /* @__PURE__ */ o(N, {
828
892
  fill: "#fff",
829
893
  height: t,
830
894
  stroke: "#bad3c8",
831
895
  strokeWidth: 1,
832
- width: i
896
+ width: n
833
897
  }),
834
- /* @__PURE__ */ a(Ne, {
898
+ /* @__PURE__ */ o($e, {
835
899
  canvasHeight: t,
836
- canvasWidth: i
900
+ canvasWidth: n
837
901
  }),
838
- p.map((e, n) => /* @__PURE__ */ a(Pe, {
839
- label: n % 2 == 0 ? "1" : "2",
840
- x: e.x / 100 * i,
902
+ p.map((e, r) => e.hidden ? null : /* @__PURE__ */ o(et, {
903
+ label: tt(e, r),
904
+ x: e.x / 100 * n,
841
905
  y: e.y / 100 * t
842
906
  }, e.id)),
843
- D.map((e) => Re(e)),
844
- j ? Re(j, !0) : null,
845
- b.includes("ruler") ? /* @__PURE__ */ a(Fe, {
907
+ C.map((e) => at(e)),
908
+ D ? at(D, !0) : null,
909
+ b.includes("ruler") ? /* @__PURE__ */ o(nt, {
846
910
  disabled: u,
847
- guide: k.ruler,
848
- locked: R,
849
- onCommit: (e) => W({
850
- ...k,
911
+ guide: T.ruler,
912
+ locked: z,
913
+ onCommit: (e) => pe({
914
+ ...T,
851
915
  ruler: e
852
916
  })
853
- }) : null,
854
- b.includes("protractor") ? /* @__PURE__ */ a(Ie, {
917
+ }, `${T.ruler.x}:${T.ruler.y}:${T.ruler.length}:${T.ruler.rotation}`) : null,
918
+ b.includes("protractor") ? /* @__PURE__ */ o(rt, {
855
919
  disabled: u,
856
- guide: k.protractor,
857
- locked: R,
858
- onChange: (e) => W({
859
- ...k,
920
+ guide: T.protractor,
921
+ locked: z,
922
+ onChange: (e) => pe({
923
+ ...T,
860
924
  protractor: e
861
925
  })
862
926
  }) : null,
863
- b.includes("compass") ? /* @__PURE__ */ a(Le, {
927
+ b.includes("compass") ? /* @__PURE__ */ o(it, {
864
928
  disabled: u,
865
- guide: k.compass,
866
- locked: R,
867
- onChange: (e) => W({
868
- ...k,
929
+ guide: T.compass,
930
+ locked: z,
931
+ onChange: (e) => pe({
932
+ ...T,
869
933
  compass: e
870
934
  })
871
935
  }) : null
@@ -873,25 +937,25 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
873
937
  })
874
938
  })
875
939
  }),
876
- /* @__PURE__ */ o("div", {
940
+ /* @__PURE__ */ s("div", {
877
941
  className: "geometry-actions",
878
942
  children: [
879
- e ? /* @__PURE__ */ a("span", { children: e }) : null,
880
- /* @__PURE__ */ a("button", {
881
- disabled: !P.canUndo || u,
882
- onClick: ue,
943
+ e ? /* @__PURE__ */ o("span", { children: e }) : null,
944
+ /* @__PURE__ */ o("button", {
945
+ disabled: !j.canUndo || u,
946
+ onClick: me,
883
947
  type: "button",
884
948
  children: "تَراجُعٌ"
885
949
  }),
886
- /* @__PURE__ */ a("button", {
887
- disabled: !P.canRedo || u,
888
- onClick: de,
950
+ /* @__PURE__ */ o("button", {
951
+ disabled: !j.canRedo || u,
952
+ onClick: he,
889
953
  type: "button",
890
954
  children: "إِعادَةٌ"
891
955
  }),
892
- /* @__PURE__ */ a("button", {
893
- disabled: D.length === 0 || u,
894
- onClick: fe,
956
+ /* @__PURE__ */ o("button", {
957
+ disabled: C.length === 0 || u,
958
+ onClick: ge,
895
959
  type: "button",
896
960
  children: "مَسْحٌ"
897
961
  })
@@ -900,10 +964,10 @@ function je({ actionLabel: e, canvasHeight: t = Te, canvasWidth: i = we, classNa
900
964
  ]
901
965
  });
902
966
  }
903
- function Me(t, n, r, i, a) {
904
- e(() => {
905
- let e = t.current;
906
- if (!e) return;
967
+ function Qe(e, n, r, i, a) {
968
+ t(() => {
969
+ let t = e.current;
970
+ if (!t) return;
907
971
  let o = (e) => {
908
972
  let t = Math.min(n, Math.max(1, e > 0 ? e : i)), o = t / n;
909
973
  a({
@@ -912,75 +976,75 @@ function Me(t, n, r, i, a) {
912
976
  width: t
913
977
  });
914
978
  };
915
- o(e.clientWidth);
979
+ o(t.clientWidth);
916
980
  let s = new ResizeObserver((e) => {
917
981
  let t = e[0];
918
982
  t && o(t.contentRect.width);
919
983
  });
920
- return s.observe(e), () => s.disconnect();
984
+ return s.observe(t), () => s.disconnect();
921
985
  }, [
922
986
  r,
923
- t,
987
+ e,
924
988
  n,
925
989
  i,
926
990
  a
927
991
  ]);
928
992
  }
929
- function Ne({ canvasHeight: e, canvasWidth: t }) {
930
- let n = Math.floor(t / Y), r = Math.floor(e / Y);
931
- return /* @__PURE__ */ o(i, { children: [Array.from({ length: n + 1 }, (t, n) => /* @__PURE__ */ a(S, {
993
+ function $e({ canvasHeight: e, canvasWidth: t }) {
994
+ let n = Math.floor(t / q), r = Math.floor(e / q);
995
+ return /* @__PURE__ */ s(a, { children: [Array.from({ length: n + 1 }, (t, n) => /* @__PURE__ */ o(M, {
932
996
  points: [
933
- n * Y,
997
+ n * q,
934
998
  0,
935
- n * Y,
999
+ n * q,
936
1000
  e
937
1001
  ],
938
1002
  stroke: "#d2ded8",
939
1003
  strokeWidth: 1
940
- }, `vertical-${n}`)), Array.from({ length: r + 1 }, (e, n) => /* @__PURE__ */ a(S, {
1004
+ }, `vertical-${n}`)), Array.from({ length: r + 1 }, (e, n) => /* @__PURE__ */ o(M, {
941
1005
  points: [
942
1006
  0,
943
- n * Y,
1007
+ n * q,
944
1008
  t,
945
- n * Y
1009
+ n * q
946
1010
  ],
947
1011
  stroke: "#d2ded8",
948
1012
  strokeWidth: 1
949
1013
  }, `horizontal-${n}`))] });
950
1014
  }
951
- function Pe({ label: e, x: t, y: n }) {
952
- return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(y, {
1015
+ function et({ label: e, x: t, y: n }) {
1016
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(A, {
953
1017
  fill: "#e63542",
954
- radius: 9,
955
- shadowBlur: 8,
1018
+ radius: 4.75,
1019
+ shadowBlur: 5,
956
1020
  shadowColor: "rgba(230, 53, 66, 0.28)",
957
1021
  stroke: "#fff",
958
- strokeWidth: 3,
1022
+ strokeWidth: 1.7,
959
1023
  x: t,
960
1024
  y: n
961
- }), /* @__PURE__ */ a(T, {
1025
+ }), /* @__PURE__ */ o(P, {
962
1026
  fill: "#111",
963
- fontSize: 18,
1027
+ fontSize: 14,
964
1028
  fontStyle: "bold",
965
1029
  text: e,
966
- x: t + 11,
967
- y: n - 22
1030
+ x: t + 8,
1031
+ y: n - 18
968
1032
  })] });
969
1033
  }
970
- function Fe({ disabled: t, guide: s, locked: c, onCommit: l }) {
971
- let [u, d] = r(s), f = n(s);
972
- e(() => {
973
- f.current = s, d(s);
974
- }, [s]);
975
- let p = u.length / 2, m = p + 44, h = -p - 44, g = p + 8, _ = -p - 8, v = !t && !c;
976
- function x(e) {
977
- f.current = e, d(e);
1034
+ function tt(e, t) {
1035
+ let n = e.label?.trim();
1036
+ return n && n.length > 0 ? n : String(t + 1);
1037
+ }
1038
+ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1039
+ let [l, u] = i(t), d = r(t), f = l.length / 2, p = f + 44, m = -f - 44, h = f + 8, g = -f - 8, _ = !e && !n;
1040
+ function v(e) {
1041
+ d.current = e, u(e);
978
1042
  }
979
- function w(e) {
1043
+ function y(e) {
980
1044
  e.cancelBubble = !0;
981
- let t = Ke(e);
982
- t && (x({
983
- ...f.current,
1045
+ let t = pt(e);
1046
+ t && (v({
1047
+ ...d.current,
984
1048
  x: t.x,
985
1049
  y: t.y
986
1050
  }), e.currentTarget.position({
@@ -988,61 +1052,61 @@ function Fe({ disabled: t, guide: s, locked: c, onCommit: l }) {
988
1052
  y: 0
989
1053
  }));
990
1054
  }
991
- function T(e) {
1055
+ function b(e) {
992
1056
  e.cancelBubble = !0, e.currentTarget.position({
993
1057
  x: 0,
994
1058
  y: 0
995
- }), l(f.current);
1059
+ }), c(d.current);
996
1060
  }
997
- function E(e, t) {
1061
+ function x(e, t) {
998
1062
  e.cancelBubble = !0;
999
- let n = Ke(e);
1000
- n && (x($e(f.current, n, t)), e.currentTarget.position({
1063
+ let n = pt(e);
1064
+ n && (v(bt(d.current, n, t)), e.currentTarget.position({
1001
1065
  x: 0,
1002
1066
  y: 0
1003
1067
  }));
1004
1068
  }
1005
- function D() {
1069
+ function S() {
1006
1070
  let e = {
1007
- ...f.current,
1008
- rotation: nt(f.current.rotation + 90)
1071
+ ...d.current,
1072
+ rotation: Ct(d.current.rotation + 90)
1009
1073
  };
1010
- x(e), l(e);
1074
+ v(e), c(e);
1011
1075
  }
1012
- return /* @__PURE__ */ a(i, { children: /* @__PURE__ */ o(b, {
1013
- listening: v,
1076
+ return /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s(j, {
1077
+ listening: _,
1014
1078
  name: "geometry-guide",
1015
- onDblClick: D,
1016
- onDblTap: D,
1017
- rotation: u.rotation,
1018
- x: u.x,
1019
- y: u.y,
1079
+ onDblClick: S,
1080
+ onDblTap: S,
1081
+ rotation: l.rotation,
1082
+ x: l.x,
1083
+ y: l.y,
1020
1084
  children: [
1021
- /* @__PURE__ */ a(C, {
1085
+ /* @__PURE__ */ o(N, {
1022
1086
  cornerRadius: 7,
1023
1087
  fill: "rgba(14, 173, 100, 0.13)",
1024
1088
  height: 38,
1025
1089
  listening: !1,
1026
- offsetX: u.length / 2,
1090
+ offsetX: l.length / 2,
1027
1091
  offsetY: 38 / 2,
1028
- stroke: X,
1092
+ stroke: J,
1029
1093
  strokeWidth: 2,
1030
- width: u.length
1094
+ width: l.length
1031
1095
  }),
1032
- /* @__PURE__ */ a(S, {
1096
+ /* @__PURE__ */ o(M, {
1033
1097
  points: [
1034
- -u.length / 2 + 12,
1098
+ -l.length / 2 + 12,
1035
1099
  0,
1036
- u.length / 2 - 12,
1100
+ l.length / 2 - 12,
1037
1101
  0
1038
1102
  ],
1039
1103
  listening: !1,
1040
- stroke: X,
1104
+ stroke: J,
1041
1105
  strokeWidth: 2
1042
1106
  }),
1043
- Array.from({ length: Math.floor(u.length / 20) + 1 }, (e, t) => {
1044
- let n = -u.length / 2 + t * 20, r = t % 5 == 0;
1045
- return /* @__PURE__ */ a(S, {
1107
+ Array.from({ length: Math.floor(l.length / 20) + 1 }, (e, t) => {
1108
+ let n = -l.length / 2 + t * 20, r = t % 5 == 0;
1109
+ return /* @__PURE__ */ o(M, {
1046
1110
  listening: !1,
1047
1111
  points: [
1048
1112
  n,
@@ -1050,94 +1114,94 @@ function Fe({ disabled: t, guide: s, locked: c, onCommit: l }) {
1050
1114
  n,
1051
1115
  r ? 4 : 10
1052
1116
  ],
1053
- stroke: X,
1117
+ stroke: J,
1054
1118
  strokeWidth: r ? 1.5 : 1
1055
1119
  }, t);
1056
1120
  }),
1057
- /* @__PURE__ */ a(S, {
1121
+ /* @__PURE__ */ o(M, {
1058
1122
  dash: [7, 7],
1059
1123
  listening: !1,
1060
1124
  opacity: .72,
1061
1125
  points: [
1062
- g,
1126
+ h,
1063
1127
  0,
1064
- m,
1128
+ p,
1065
1129
  0
1066
1130
  ],
1067
- stroke: X,
1131
+ stroke: J,
1068
1132
  strokeWidth: 2
1069
1133
  }),
1070
- /* @__PURE__ */ a(S, {
1134
+ /* @__PURE__ */ o(M, {
1071
1135
  dash: [7, 7],
1072
1136
  listening: !1,
1073
1137
  opacity: .72,
1074
1138
  points: [
1075
- _,
1139
+ g,
1076
1140
  0,
1077
- h,
1141
+ m,
1078
1142
  0
1079
1143
  ],
1080
- stroke: X,
1144
+ stroke: J,
1081
1145
  strokeWidth: 2
1082
1146
  }),
1083
- /* @__PURE__ */ a(b, {
1084
- draggable: v,
1147
+ /* @__PURE__ */ o(j, {
1148
+ draggable: _,
1085
1149
  name: "geometry-guide",
1086
- onDblClick: D,
1087
- onDblTap: D,
1088
- onDragEnd: T,
1089
- onDragMove: (e) => E(e, "right"),
1090
- children: /* @__PURE__ */ a(C, {
1150
+ onDblClick: S,
1151
+ onDblTap: S,
1152
+ onDragEnd: b,
1153
+ onDragMove: (e) => x(e, "right"),
1154
+ children: /* @__PURE__ */ o(N, {
1091
1155
  fill: "rgba(255, 255, 255, 0.01)",
1092
1156
  height: 106,
1093
1157
  offsetY: 53,
1094
- width: m + 24,
1158
+ width: p + 24,
1095
1159
  x: 0
1096
1160
  })
1097
1161
  }),
1098
- /* @__PURE__ */ a(b, {
1099
- draggable: v,
1162
+ /* @__PURE__ */ o(j, {
1163
+ draggable: _,
1100
1164
  name: "geometry-guide",
1101
- onDblClick: D,
1102
- onDblTap: D,
1103
- onDragEnd: T,
1104
- onDragMove: (e) => E(e, "left"),
1105
- children: /* @__PURE__ */ a(C, {
1165
+ onDblClick: S,
1166
+ onDblTap: S,
1167
+ onDragEnd: b,
1168
+ onDragMove: (e) => x(e, "left"),
1169
+ children: /* @__PURE__ */ o(N, {
1106
1170
  fill: "rgba(255, 255, 255, 0.01)",
1107
1171
  height: 106,
1108
1172
  offsetY: 53,
1109
- width: Math.abs(h) + 24,
1110
- x: h - 24
1173
+ width: Math.abs(m) + 24,
1174
+ x: m - 24
1111
1175
  })
1112
1176
  }),
1113
- /* @__PURE__ */ a(y, {
1177
+ /* @__PURE__ */ o(A, {
1114
1178
  fill: "#f7fffb",
1115
1179
  listening: !1,
1116
1180
  radius: 16,
1117
1181
  shadowBlur: 10,
1118
1182
  shadowColor: "rgba(10, 143, 85, 0.35)",
1119
- stroke: X,
1183
+ stroke: J,
1120
1184
  strokeWidth: 4,
1121
- x: m,
1185
+ x: p,
1122
1186
  y: 0
1123
1187
  }),
1124
- /* @__PURE__ */ a(y, {
1188
+ /* @__PURE__ */ o(A, {
1125
1189
  fill: "#f7fffb",
1126
1190
  listening: !1,
1127
1191
  radius: 16,
1128
1192
  shadowBlur: 10,
1129
1193
  shadowColor: "rgba(10, 143, 85, 0.35)",
1130
- stroke: X,
1194
+ stroke: J,
1131
1195
  strokeWidth: 4,
1132
- x: h,
1196
+ x: m,
1133
1197
  y: 0
1134
1198
  }),
1135
- /* @__PURE__ */ o(b, {
1136
- draggable: v,
1199
+ /* @__PURE__ */ s(j, {
1200
+ draggable: _,
1137
1201
  name: "geometry-guide",
1138
- onDragEnd: T,
1139
- onDragMove: w,
1140
- children: [/* @__PURE__ */ a(C, {
1202
+ onDragEnd: b,
1203
+ onDragMove: y,
1204
+ children: [/* @__PURE__ */ o(N, {
1141
1205
  cornerRadius: 13,
1142
1206
  fill: "#ffffff",
1143
1207
  height: 26,
@@ -1145,14 +1209,14 @@ function Fe({ disabled: t, guide: s, locked: c, onCommit: l }) {
1145
1209
  offsetY: 13,
1146
1210
  shadowBlur: 8,
1147
1211
  shadowColor: "rgba(10, 143, 85, 0.2)",
1148
- stroke: X,
1212
+ stroke: J,
1149
1213
  strokeWidth: 2,
1150
1214
  width: 70
1151
1215
  }), [
1152
1216
  -14,
1153
1217
  0,
1154
1218
  14
1155
- ].map((e) => /* @__PURE__ */ a(S, {
1219
+ ].map((e) => /* @__PURE__ */ o(M, {
1156
1220
  lineCap: "round",
1157
1221
  points: [
1158
1222
  e,
@@ -1160,24 +1224,24 @@ function Fe({ disabled: t, guide: s, locked: c, onCommit: l }) {
1160
1224
  e,
1161
1225
  7
1162
1226
  ],
1163
- stroke: X,
1227
+ stroke: J,
1164
1228
  strokeWidth: 2
1165
1229
  }, e))]
1166
1230
  })
1167
1231
  ]
1168
1232
  }) });
1169
1233
  }
1170
- function Ie({ disabled: e, guide: t, locked: n, onChange: r }) {
1171
- let s = !e && !n, c = Ze({
1234
+ function rt({ disabled: e, guide: t, locked: n, onChange: r }) {
1235
+ let i = !e && !n, c = vt({
1172
1236
  x: 136,
1173
1237
  y: 0
1174
1238
  }, t.rotation, {
1175
1239
  x: t.x,
1176
1240
  y: t.y
1177
1241
  });
1178
- return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o(b, {
1179
- draggable: s,
1180
- listening: s,
1242
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(j, {
1243
+ draggable: i,
1244
+ listening: i,
1181
1245
  name: "geometry-guide",
1182
1246
  onDragMove: (e) => r({
1183
1247
  ...t,
@@ -1188,41 +1252,41 @@ function Ie({ disabled: e, guide: t, locked: n, onChange: r }) {
1188
1252
  x: t.x,
1189
1253
  y: t.y,
1190
1254
  children: [
1191
- /* @__PURE__ */ a(v, {
1255
+ /* @__PURE__ */ o(k, {
1192
1256
  angle: 180,
1193
1257
  fill: "rgba(14, 173, 100, 0.11)",
1194
1258
  innerRadius: 0,
1195
1259
  outerRadius: 110,
1196
1260
  rotation: 180,
1197
- stroke: X,
1261
+ stroke: J,
1198
1262
  strokeWidth: 2
1199
1263
  }),
1200
- /* @__PURE__ */ a(S, {
1264
+ /* @__PURE__ */ o(M, {
1201
1265
  points: [
1202
1266
  -110,
1203
1267
  0,
1204
1268
  110,
1205
1269
  0
1206
1270
  ],
1207
- stroke: X,
1271
+ stroke: J,
1208
1272
  strokeWidth: 2
1209
1273
  }),
1210
1274
  Array.from({ length: 19 }, (e, t) => {
1211
1275
  let n = t * 10, r = (180 - n) * Math.PI / 180, i = {
1212
1276
  x: Math.cos(r) * 110,
1213
1277
  y: -Math.sin(r) * 110
1214
- }, o = {
1278
+ }, a = {
1215
1279
  x: Math.cos(r) * (t % 3 == 0 ? 92 : 100),
1216
1280
  y: -Math.sin(r) * (t % 3 == 0 ? 92 : 100)
1217
1281
  };
1218
- return /* @__PURE__ */ a(S, {
1282
+ return /* @__PURE__ */ o(M, {
1219
1283
  points: [
1220
- o.x,
1221
- o.y,
1284
+ a.x,
1285
+ a.y,
1222
1286
  i.x,
1223
1287
  i.y
1224
1288
  ],
1225
- stroke: X,
1289
+ stroke: J,
1226
1290
  strokeWidth: t % 3 == 0 ? 1.4 : 1
1227
1291
  }, n);
1228
1292
  }),
@@ -1232,8 +1296,8 @@ function Ie({ disabled: e, guide: t, locked: n, onChange: r }) {
1232
1296
  180
1233
1297
  ].map((e) => {
1234
1298
  let t = (180 - e) * Math.PI / 180;
1235
- return /* @__PURE__ */ a(T, {
1236
- fill: X,
1299
+ return /* @__PURE__ */ o(P, {
1300
+ fill: J,
1237
1301
  fontSize: 12,
1238
1302
  fontStyle: "bold",
1239
1303
  text: `${e}`,
@@ -1242,10 +1306,10 @@ function Ie({ disabled: e, guide: t, locked: n, onChange: r }) {
1242
1306
  }, e);
1243
1307
  })
1244
1308
  ]
1245
- }), /* @__PURE__ */ a(y, {
1246
- draggable: s,
1309
+ }), /* @__PURE__ */ o(A, {
1310
+ draggable: i,
1247
1311
  fill: "#fff",
1248
- listening: s,
1312
+ listening: i,
1249
1313
  name: "geometry-guide",
1250
1314
  onDragMove: (e) => {
1251
1315
  let n = e.target.position();
@@ -1255,30 +1319,30 @@ function Ie({ disabled: e, guide: t, locked: n, onChange: r }) {
1255
1319
  });
1256
1320
  },
1257
1321
  radius: 10,
1258
- stroke: X,
1322
+ stroke: J,
1259
1323
  strokeWidth: 3,
1260
1324
  x: c.x,
1261
1325
  y: c.y
1262
1326
  })] });
1263
1327
  }
1264
- function Le({ disabled: e, guide: t, locked: n, onChange: r }) {
1265
- let s = !e && !n, c = {
1328
+ function it({ disabled: e, guide: t, locked: n, onChange: r }) {
1329
+ let i = !e && !n, c = {
1266
1330
  x: t.center.x + t.radius,
1267
1331
  y: t.center.y
1268
1332
  }, l = {
1269
1333
  x: t.center.x + t.radius / 2,
1270
1334
  y: t.center.y - Math.min(90, Math.max(34, t.radius * .68))
1271
1335
  };
1272
- return /* @__PURE__ */ o(i, { children: [
1273
- /* @__PURE__ */ a(y, {
1336
+ return /* @__PURE__ */ s(a, { children: [
1337
+ /* @__PURE__ */ o(A, {
1274
1338
  dash: [8, 8],
1275
1339
  radius: t.radius,
1276
- stroke: X,
1340
+ stroke: J,
1277
1341
  strokeWidth: 2,
1278
1342
  x: t.center.x,
1279
1343
  y: t.center.y
1280
1344
  }),
1281
- /* @__PURE__ */ a(S, {
1345
+ /* @__PURE__ */ o(M, {
1282
1346
  dash: [8, 8],
1283
1347
  points: [
1284
1348
  t.center.x,
@@ -1286,10 +1350,10 @@ function Le({ disabled: e, guide: t, locked: n, onChange: r }) {
1286
1350
  c.x,
1287
1351
  c.y
1288
1352
  ],
1289
- stroke: X,
1353
+ stroke: J,
1290
1354
  strokeWidth: 2
1291
1355
  }),
1292
- /* @__PURE__ */ a(S, {
1356
+ /* @__PURE__ */ o(M, {
1293
1357
  lineCap: "round",
1294
1358
  lineJoin: "round",
1295
1359
  points: [
@@ -1300,55 +1364,55 @@ function Le({ disabled: e, guide: t, locked: n, onChange: r }) {
1300
1364
  c.x,
1301
1365
  c.y
1302
1366
  ],
1303
- stroke: X,
1367
+ stroke: J,
1304
1368
  strokeWidth: 4
1305
1369
  }),
1306
- /* @__PURE__ */ a(y, {
1370
+ /* @__PURE__ */ o(A, {
1307
1371
  fill: "#fff",
1308
1372
  radius: 8,
1309
- stroke: X,
1373
+ stroke: J,
1310
1374
  strokeWidth: 3,
1311
1375
  x: l.x,
1312
1376
  y: l.y
1313
1377
  }),
1314
- /* @__PURE__ */ a(y, {
1315
- draggable: s,
1378
+ /* @__PURE__ */ o(A, {
1379
+ draggable: i,
1316
1380
  fill: "#fff",
1317
- listening: s,
1381
+ listening: i,
1318
1382
  name: "geometry-guide",
1319
1383
  onDragMove: (e) => r({
1320
1384
  ...t,
1321
1385
  center: e.target.position()
1322
1386
  }),
1323
1387
  radius: 11,
1324
- stroke: X,
1388
+ stroke: J,
1325
1389
  strokeWidth: 3,
1326
1390
  x: t.center.x,
1327
1391
  y: t.center.y
1328
1392
  }),
1329
- /* @__PURE__ */ a(y, {
1330
- draggable: s,
1393
+ /* @__PURE__ */ o(A, {
1394
+ draggable: i,
1331
1395
  fill: "#fff",
1332
- listening: s,
1396
+ listening: i,
1333
1397
  name: "geometry-guide",
1334
1398
  onDragMove: (e) => {
1335
1399
  let n = e.target.position();
1336
1400
  r({
1337
1401
  ...t,
1338
- radius: Math.max(14, Q(t.center, n))
1402
+ radius: Math.max(14, X(t.center, n))
1339
1403
  });
1340
1404
  },
1341
1405
  radius: 9,
1342
- stroke: X,
1406
+ stroke: J,
1343
1407
  strokeWidth: 3,
1344
1408
  x: c.x,
1345
1409
  y: c.y
1346
1410
  })
1347
1411
  ] });
1348
1412
  }
1349
- function Re(e, t = !1) {
1413
+ function at(e, t = !1) {
1350
1414
  let n = t ? .58 : 1;
1351
- return e.type === "freehand" ? /* @__PURE__ */ a(S, {
1415
+ return e.type === "freehand" ? /* @__PURE__ */ o(M, {
1352
1416
  lineCap: "round",
1353
1417
  lineJoin: "round",
1354
1418
  opacity: n,
@@ -1356,13 +1420,13 @@ function Re(e, t = !1) {
1356
1420
  stroke: e.color,
1357
1421
  strokeWidth: e.strokeWidth,
1358
1422
  tension: .45
1359
- }, e.id) : e.type === "line" ? /* @__PURE__ */ a(S, {
1423
+ }, e.id) : e.type === "line" ? /* @__PURE__ */ o(M, {
1360
1424
  lineCap: "round",
1361
1425
  opacity: n,
1362
1426
  points: e.points,
1363
1427
  stroke: e.color,
1364
1428
  strokeWidth: e.strokeWidth
1365
- }, e.id) : /* @__PURE__ */ a(y, {
1429
+ }, e.id) : /* @__PURE__ */ o(A, {
1366
1430
  opacity: n,
1367
1431
  radius: e.radius,
1368
1432
  stroke: e.color,
@@ -1371,7 +1435,7 @@ function Re(e, t = !1) {
1371
1435
  y: e.center.y
1372
1436
  }, e.id);
1373
1437
  }
1374
- function ze(e, t) {
1438
+ function ot(e, t) {
1375
1439
  return {
1376
1440
  compass: {
1377
1441
  center: {
@@ -1393,16 +1457,16 @@ function ze(e, t) {
1393
1457
  }
1394
1458
  };
1395
1459
  }
1396
- function Be(e) {
1397
- return e?.elements?.length ? Z(e.elements) : (e?.strokes ?? []).filter((e) => e.tool === "pen" && e.points.length >= 4).map((e) => ({
1398
- color: Oe,
1460
+ function st(e) {
1461
+ return e?.elements?.length ? Y(e.elements) : (e?.strokes ?? []).filter((e) => e.tool === "pen" && e.points.length >= 4).map((e) => ({
1462
+ color: Je,
1399
1463
  id: e.id,
1400
1464
  points: e.points.slice(),
1401
1465
  strokeWidth: 4,
1402
1466
  type: "freehand"
1403
1467
  }));
1404
1468
  }
1405
- function Ve(e) {
1469
+ function ct(e) {
1406
1470
  return e.flatMap((e) => e.type === "freehand" ? [{
1407
1471
  id: e.id,
1408
1472
  points: e.points.slice(),
@@ -1413,7 +1477,7 @@ function Ve(e) {
1413
1477
  tool: "pen"
1414
1478
  }] : []);
1415
1479
  }
1416
- function Z(e) {
1480
+ function Y(e) {
1417
1481
  return e.map((e) => e.type === "freehand" ? {
1418
1482
  ...e,
1419
1483
  points: e.points.slice()
@@ -1430,25 +1494,25 @@ function Z(e) {
1430
1494
  center: { ...e.center }
1431
1495
  });
1432
1496
  }
1433
- function He(e, t, n) {
1497
+ function lt(e, t, n) {
1434
1498
  let r = e.map((e) => ({
1435
1499
  x: e.x / 100 * t,
1436
1500
  y: e.y / 100 * n
1437
1501
  })), i = [];
1438
- for (let e = 0; e <= t; e += Y) for (let t = 0; t <= n; t += Y) i.push({
1502
+ for (let e = 0; e <= t; e += q) for (let t = 0; t <= n; t += q) i.push({
1439
1503
  x: e,
1440
1504
  y: t
1441
1505
  });
1442
1506
  return r.concat(i);
1443
1507
  }
1444
- function Ue(e, t) {
1445
- let n = e, r = De;
1508
+ function ut(e, t) {
1509
+ let n = e, r = qe;
1446
1510
  return t.forEach((t) => {
1447
- let i = Q(e, t);
1511
+ let i = X(e, t);
1448
1512
  i < r && (n = t, r = i);
1449
1513
  }), n;
1450
1514
  }
1451
- function We(e) {
1515
+ function dt(e) {
1452
1516
  let t = e;
1453
1517
  for (; t;) {
1454
1518
  if (t.name().split(" ").includes("geometry-guide")) return !0;
@@ -1456,10 +1520,10 @@ function We(e) {
1456
1520
  }
1457
1521
  return !1;
1458
1522
  }
1459
- function Ge(e) {
1523
+ function ft(e) {
1460
1524
  return e === "pen" || e === "line" || e === "eraser";
1461
1525
  }
1462
- function Ke(e) {
1526
+ function pt(e) {
1463
1527
  let t = e.target.getStage()?.getPointerPosition();
1464
1528
  if (!t) return null;
1465
1529
  let n = e.target.getLayer(), r = n?.scaleX() || 1, i = n?.scaleY() || r;
@@ -1468,16 +1532,16 @@ function Ke(e) {
1468
1532
  y: t.y / i
1469
1533
  };
1470
1534
  }
1471
- function qe(e) {
1472
- return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ? et(e.points) > 6 : e.radius > 6;
1535
+ function mt(e) {
1536
+ return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ? xt(e.points) > 6 : e.radius > 6;
1473
1537
  }
1474
- function Je(e, t) {
1475
- for (let n = e.length - 1; n >= 0; --n) if (Ye(e[n], t)) return n;
1538
+ function ht(e, t) {
1539
+ for (let n = e.length - 1; n >= 0; --n) if (gt(e[n], t)) return n;
1476
1540
  return -1;
1477
1541
  }
1478
- function Ye(e, t) {
1479
- if (e.type === "circle") return Math.abs(Q(e.center, t) - e.radius) <= 14;
1480
- for (let n = 0; n < e.points.length - 2; n += 2) if (Xe(t, {
1542
+ function gt(e, t) {
1543
+ if (e.type === "circle") return Math.abs(X(e.center, t) - e.radius) <= 14;
1544
+ for (let n = 0; n < e.points.length - 2; n += 2) if (_t(t, {
1481
1545
  x1: e.points[n],
1482
1546
  x2: e.points[n + 2],
1483
1547
  y1: e.points[n + 1],
@@ -1485,27 +1549,27 @@ function Ye(e, t) {
1485
1549
  }) <= 14) return !0;
1486
1550
  return !1;
1487
1551
  }
1488
- function Xe(e, t) {
1552
+ function _t(e, t) {
1489
1553
  let n = t.x2 - t.x1, r = t.y2 - t.y1, i = n * n + r * r;
1490
- if (i === 0) return Q(e, {
1554
+ if (i === 0) return X(e, {
1491
1555
  x: t.x1,
1492
1556
  y: t.y1
1493
1557
  });
1494
- let a = tt(((e.x - t.x1) * n + (e.y - t.y1) * r) / i, 0, 1);
1495
- return Q(e, {
1558
+ let a = St(((e.x - t.x1) * n + (e.y - t.y1) * r) / i, 0, 1);
1559
+ return X(e, {
1496
1560
  x: t.x1 + a * n,
1497
1561
  y: t.y1 + a * r
1498
1562
  });
1499
1563
  }
1500
- function Ze(e, t, n) {
1564
+ function vt(e, t, n) {
1501
1565
  let r = t * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
1502
1566
  return {
1503
1567
  x: n.x + e.x * i - e.y * a,
1504
1568
  y: n.y + e.x * a + e.y * i
1505
1569
  };
1506
1570
  }
1507
- function Qe(e, t) {
1508
- return Ze({
1571
+ function yt(e, t) {
1572
+ return vt({
1509
1573
  x: t === "left" ? -e.length / 2 : e.length / 2,
1510
1574
  y: 0
1511
1575
  }, e.rotation, {
@@ -1513,8 +1577,8 @@ function Qe(e, t) {
1513
1577
  y: e.y
1514
1578
  });
1515
1579
  }
1516
- function $e(e, t, n) {
1517
- let r = n === "right" ? "left" : "right", i = Qe(e, r), a = Math.atan2(t.y - i.y, t.x - i.x) * 180 / Math.PI, o = nt(n === "right" ? a : a + 180), s = o * Math.PI / 180, c = e.length / 2, l = r === "left" ? 1 : -1;
1580
+ function bt(e, t, n) {
1581
+ let r = n === "right" ? "left" : "right", i = yt(e, r), a = Math.atan2(t.y - i.y, t.x - i.x) * 180 / Math.PI, o = Ct(n === "right" ? a : a + 180), s = o * Math.PI / 180, c = e.length / 2, l = r === "left" ? 1 : -1;
1518
1582
  return {
1519
1583
  ...e,
1520
1584
  rotation: o,
@@ -1522,8 +1586,8 @@ function $e(e, t, n) {
1522
1586
  y: i.y + Math.sin(s) * c * l
1523
1587
  };
1524
1588
  }
1525
- function et(e) {
1526
- return Q({
1589
+ function xt(e) {
1590
+ return X({
1527
1591
  x: e[0],
1528
1592
  y: e[1]
1529
1593
  }, {
@@ -1531,31 +1595,30 @@ function et(e) {
1531
1595
  y: e[3]
1532
1596
  });
1533
1597
  }
1534
- function Q(e, t) {
1598
+ function X(e, t) {
1535
1599
  return Math.hypot(e.x - t.x, e.y - t.y);
1536
1600
  }
1537
- function tt(e, t, n) {
1601
+ function St(e, t, n) {
1538
1602
  return Math.min(Math.max(e, t), n);
1539
1603
  }
1540
- function nt(e) {
1604
+ function Ct(e) {
1541
1605
  return (e % 360 + 360) % 360;
1542
1606
  }
1543
1607
  //#endregion
1544
1608
  //#region src/exam-session/interactions/KonvaDrawingGrid.tsx
1545
- function rt({ actionLabel: e, points: t, value: n, onChange: r }) {
1546
- return /* @__PURE__ */ a(je, {
1547
- actionLabel: e,
1548
- onChange: r,
1549
- points: t,
1550
- value: n,
1609
+ function wt({ points: e, value: t, onChange: n }) {
1610
+ return /* @__PURE__ */ o(Ze, {
1611
+ onChange: n,
1612
+ points: e,
1613
+ value: t,
1551
1614
  variant: "question"
1552
1615
  });
1553
1616
  }
1554
1617
  //#endregion
1555
1618
  //#region src/exam-session/interactions/LabelPlacement.tsx
1556
- function it({ labels: e, targets: t, value: n, onChange: r }) {
1557
- let i = n?.placements ?? {}, c = new Set(Object.keys(i));
1558
- return /* @__PURE__ */ a(s, {
1619
+ function Tt({ labels: e, targets: t, value: n, onChange: r }) {
1620
+ let i = n?.placements ?? {}, a = new Set(Object.keys(i));
1621
+ return /* @__PURE__ */ o(c, {
1559
1622
  onDragEnd: (e) => {
1560
1623
  if (e.canceled) return;
1561
1624
  let n = e.operation.source?.id?.toString(), a = e.operation.target?.id?.toString(), o = t.find((e) => e.id === a);
@@ -1572,14 +1635,14 @@ function it({ labels: e, targets: t, value: n, onChange: r }) {
1572
1635
  }
1573
1636
  });
1574
1637
  },
1575
- children: /* @__PURE__ */ o("div", {
1638
+ children: /* @__PURE__ */ s("div", {
1576
1639
  className: "label-placement",
1577
- children: [/* @__PURE__ */ a("div", {
1640
+ children: [/* @__PURE__ */ o("div", {
1578
1641
  className: "label-placement__bank",
1579
- children: e.filter((e) => !c.has(e.id)).map((e) => /* @__PURE__ */ a(at, { label: e }, e.id))
1580
- }), /* @__PURE__ */ a("div", {
1642
+ children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Et, { label: e }, e.id))
1643
+ }), /* @__PURE__ */ o("div", {
1581
1644
  className: "label-placement__diagram",
1582
- children: t.map((t) => /* @__PURE__ */ a(ot, {
1645
+ children: t.map((t) => /* @__PURE__ */ o(Dt, {
1583
1646
  label: e.find((e) => i[e.id]?.targetId === t.id),
1584
1647
  target: t
1585
1648
  }, t.id))
@@ -1587,66 +1650,66 @@ function it({ labels: e, targets: t, value: n, onChange: r }) {
1587
1650
  })
1588
1651
  });
1589
1652
  }
1590
- function at({ label: e }) {
1591
- let { ref: t, isDragging: n } = c({ id: e.id });
1592
- return /* @__PURE__ */ a("button", {
1653
+ function Et({ label: e }) {
1654
+ let { ref: t, isDragging: n } = l({ id: e.id });
1655
+ return /* @__PURE__ */ o("button", {
1593
1656
  className: n ? "placement-label placement-label--dragging" : "placement-label",
1594
1657
  ref: t,
1595
1658
  type: "button",
1596
1659
  children: e.label
1597
1660
  });
1598
1661
  }
1599
- function ot({ label: e, target: t }) {
1600
- let { ref: n, isDropTarget: r } = l({ id: t.id });
1601
- return /* @__PURE__ */ o("div", {
1662
+ function Dt({ label: e, target: t }) {
1663
+ let { ref: n, isDropTarget: r } = u({ id: t.id });
1664
+ return /* @__PURE__ */ s("div", {
1602
1665
  className: r ? "placement-target placement-target--active" : "placement-target",
1603
1666
  ref: n,
1604
1667
  style: {
1605
1668
  left: `${t.x}%`,
1606
1669
  top: `${t.y}%`
1607
1670
  },
1608
- children: [/* @__PURE__ */ a("span", {
1671
+ children: [/* @__PURE__ */ o("span", {
1609
1672
  "aria-hidden": "true",
1610
1673
  children: t.label
1611
- }), e ? /* @__PURE__ */ a(at, { label: e }) : null]
1674
+ }), e ? /* @__PURE__ */ o(Et, { label: e }) : null]
1612
1675
  });
1613
1676
  }
1614
1677
  //#endregion
1615
1678
  //#region src/exam-session/interactions/NumberLineAnswer.tsx
1616
- function st({ answerId: e, expression: t, value: n, onChange: r, onClear: i, recognizer: s }) {
1617
- return /* @__PURE__ */ o("div", {
1679
+ function Ot({ answerId: e, expression: t, value: n, onChange: r, onClear: i, recognizer: a }) {
1680
+ return /* @__PURE__ */ s("div", {
1618
1681
  className: "number-line-layout",
1619
- children: [/* @__PURE__ */ a(ct, {}), /* @__PURE__ */ o("div", {
1682
+ children: [/* @__PURE__ */ o(kt, {}), /* @__PURE__ */ s("div", {
1620
1683
  className: "compact-answer",
1621
- children: [/* @__PURE__ */ a("span", { children: t }), /* @__PURE__ */ a(q, {
1684
+ children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(G, {
1622
1685
  ariaLabel: t,
1623
1686
  onChange: (t) => r(e, t),
1624
1687
  onClear: () => i(e),
1625
- recognizer: s,
1688
+ recognizer: a,
1626
1689
  value: n
1627
1690
  })]
1628
1691
  })]
1629
1692
  });
1630
1693
  }
1631
- function ct() {
1632
- return /* @__PURE__ */ o("svg", {
1694
+ function kt() {
1695
+ return /* @__PURE__ */ s("svg", {
1633
1696
  className: "number-line",
1634
1697
  viewBox: "0 0 520 86",
1635
1698
  role: "img",
1636
1699
  "aria-label": "مُسْتَقِيمٌ عَدَدِيٌّ مِنْ 0 إِلَى 10",
1637
- children: [/* @__PURE__ */ a("line", {
1700
+ children: [/* @__PURE__ */ o("line", {
1638
1701
  x1: "32",
1639
1702
  x2: "488",
1640
1703
  y1: "36",
1641
1704
  y2: "36"
1642
1705
  }), Array.from({ length: 11 }, (e, t) => {
1643
1706
  let n = 32 + t * 45.6;
1644
- return /* @__PURE__ */ o("g", { children: [/* @__PURE__ */ a("line", {
1707
+ return /* @__PURE__ */ s("g", { children: [/* @__PURE__ */ o("line", {
1645
1708
  x1: n,
1646
1709
  x2: n,
1647
1710
  y1: "28",
1648
1711
  y2: "44"
1649
- }), /* @__PURE__ */ a("text", {
1712
+ }), /* @__PURE__ */ o("text", {
1650
1713
  x: n,
1651
1714
  y: "66",
1652
1715
  children: t
@@ -1656,7 +1719,7 @@ function ct() {
1656
1719
  }
1657
1720
  //#endregion
1658
1721
  //#region src/voice/evaluateVoiceAiResult.ts
1659
- var lt = {
1722
+ var At = {
1660
1723
  audioConfig: {
1661
1724
  bitDepth: 16,
1662
1725
  channels: 1,
@@ -1666,18 +1729,18 @@ var lt = {
1666
1729
  lang: "fr",
1667
1730
  useModelAi: !0
1668
1731
  };
1669
- function ut(e, t, n) {
1670
- let r = mt([t, ...n.acceptedPronunciations ?? []]), i = r.map(dt), a = dt(e.transcript), o = i.map((e, t) => ({
1732
+ function jt(e, t, n) {
1733
+ let r = Ft([t, ...n.acceptedPronunciations ?? []]), i = r.map(Mt), a = Mt(e.transcript), o = i.map((e, t) => ({
1671
1734
  index: t,
1672
- similarity: pt(a, e)
1735
+ similarity: Pt(a, e)
1673
1736
  })).reduce((e, t) => t.similarity > e.similarity ? t : e, {
1674
1737
  index: -1,
1675
1738
  similarity: 0
1676
- }), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = ht(n.minimumSimilarity ?? ft(s), 0, 1), u = e.language === n.expectedLanguage, d = a.length > 0, f = d && u && o.similarity >= l, p = d ? u ? f ? "correct" : "incorrect" : "language-mismatch" : "no-speech";
1739
+ }), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = It(n.minimumSimilarity ?? Nt(s), 0, 1), u = e.language === n.expectedLanguage, d = a.length > 0, f = d && u && o.similarity >= l, p = d ? u ? f ? "correct" : "incorrect" : "language-mismatch" : "no-speech";
1677
1740
  return {
1678
1741
  acceptedPronunciations: r,
1679
1742
  confidence: e.confidence,
1680
- confidencePercent: Math.round(ht(e.confidence, 0, 1) * 100),
1743
+ confidencePercent: Math.round(It(e.confidence, 0, 1) * 100),
1681
1744
  detectedPronunciation: e.transcript,
1682
1745
  expectedLanguage: n.expectedLanguage,
1683
1746
  expectedText: t,
@@ -1696,13 +1759,13 @@ function ut(e, t, n) {
1696
1759
  timestamps: e.timestamps ?? []
1697
1760
  };
1698
1761
  }
1699
- function dt(e) {
1762
+ function Mt(e) {
1700
1763
  return e.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[\u064b-\u065f\u0670]/g, "").replace(/[|]+/g, " ").replace(/[^\p{Letter}\p{Number}\s]/gu, " ").replace(/\s+/g, " ").trim();
1701
1764
  }
1702
- function ft(e) {
1703
- return (e ? dt(e).length : 0) <= 4 ? 1 : .85;
1765
+ function Nt(e) {
1766
+ return (e ? Mt(e).length : 0) <= 4 ? 1 : .85;
1704
1767
  }
1705
- function pt(e, t) {
1768
+ function Pt(e, t) {
1706
1769
  let n = Array.from(e), r = Array.from(t), i = Math.max(n.length, r.length);
1707
1770
  if (i === 0) return 0;
1708
1771
  let a = Array.from({ length: r.length + 1 }, (e, t) => t);
@@ -1714,185 +1777,185 @@ function pt(e, t) {
1714
1777
  }
1715
1778
  a.splice(0, a.length, ...t);
1716
1779
  }
1717
- return ht(1 - a[r.length] / i, 0, 1);
1780
+ return It(1 - a[r.length] / i, 0, 1);
1718
1781
  }
1719
- function mt(e) {
1782
+ function Ft(e) {
1720
1783
  let t = /* @__PURE__ */ new Set();
1721
1784
  return e.filter((e) => {
1722
- let n = dt(e);
1785
+ let n = Mt(e);
1723
1786
  return !n || t.has(n) ? !1 : (t.add(n), !0);
1724
1787
  });
1725
1788
  }
1726
- function ht(e, t, n) {
1789
+ function It(e, t, n) {
1727
1790
  return Math.min(n, Math.max(t, e));
1728
1791
  }
1729
1792
  //#endregion
1730
1793
  //#region src/exam-session/interactions/PronunciationRecorder.tsx
1731
- function gt({ acceptedPronunciations: i, expectedText: s, imageAlt: c, imageSrc: l, instruction: u, language: d, minimumSimilarity: p, onChange: g, onReset: _, recorder: v, value: y }) {
1732
- let [b, x] = r("idle"), [S, C] = r(null), [w, T] = r(0), E = n(null), D = n(!1), O = t(() => y ? ut(y.result.modelAiResult, s, {
1733
- acceptedPronunciations: i,
1794
+ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc: l, instruction: u, language: d, minimumSimilarity: f, onChange: p, onReset: m, recorder: h, value: g }) {
1795
+ let [_, v] = i("idle"), [b, x] = i(null), [S, w] = i(0), T = r(null), E = r(!1), D = n(() => g ? jt(g.result.modelAiResult, a, {
1796
+ acceptedPronunciations: e,
1734
1797
  expectedLanguage: d,
1735
- minimumSimilarity: p
1798
+ minimumSimilarity: f
1736
1799
  }) : null, [
1737
- i,
1738
- s,
1800
+ e,
1801
+ a,
1739
1802
  d,
1740
- p,
1741
- y
1803
+ f,
1804
+ g
1742
1805
  ]);
1743
- e(() => {
1744
- if (b !== "recording") return;
1806
+ t(() => {
1807
+ if (_ !== "recording") return;
1745
1808
  let e = window.setInterval(() => {
1746
- let e = E.current;
1747
- e !== null && T(Date.now() - e);
1809
+ let e = T.current;
1810
+ e !== null && w(Date.now() - e);
1748
1811
  }, 200);
1749
1812
  return () => window.clearInterval(e);
1750
- }, [b]), e(() => () => {
1751
- D.current && v?.stopRecording().catch(() => void 0);
1752
- }, [v]);
1753
- async function k() {
1754
- if (b !== "recording") {
1755
- x("checking"), C(null), _();
1813
+ }, [_]), t(() => () => {
1814
+ E.current && h?.stopRecording().catch(() => void 0);
1815
+ }, [h]);
1816
+ async function O() {
1817
+ if (_ !== "recording") {
1818
+ v("checking"), x(null), m();
1756
1819
  try {
1757
- if (!v) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1820
+ if (!h) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1758
1821
  let e = {
1759
- ...lt,
1822
+ ...At,
1760
1823
  lang: d,
1761
1824
  maxDuration: 10
1762
1825
  };
1763
- if (!(await v.startRecording(e)).started) throw Error("تعذّر بدء التسجيل الصوتي.");
1764
- D.current = !0, E.current = Date.now(), T(0), x("recording");
1826
+ if (!(await h.startRecording(e)).started) throw Error("تعذّر بدء التسجيل الصوتي.");
1827
+ E.current = !0, T.current = Date.now(), w(0), v("recording");
1765
1828
  } catch (e) {
1766
- D.current = !1, E.current = null, C(bt(e)), x("error");
1829
+ E.current = !1, T.current = null, x(Vt(e)), v("error");
1767
1830
  }
1768
1831
  }
1769
1832
  }
1770
- async function A() {
1771
- if (b === "recording") {
1772
- x("processing"), C(null);
1833
+ async function k() {
1834
+ if (_ === "recording") {
1835
+ v("processing"), x(null);
1773
1836
  try {
1774
- if (!v) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1775
- let e = await v.stopRecording(), t = ut(e.modelAiResult, s, {
1776
- acceptedPronunciations: i,
1837
+ if (!h) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1838
+ let t = await h.stopRecording(), n = jt(t.modelAiResult, a, {
1839
+ acceptedPronunciations: e,
1777
1840
  expectedLanguage: d,
1778
- minimumSimilarity: p
1841
+ minimumSimilarity: f
1779
1842
  });
1780
- D.current = !1, E.current = null, T(e.duration), g({
1781
- evaluation: t,
1843
+ E.current = !1, T.current = null, w(t.duration), p({
1844
+ evaluation: n,
1782
1845
  kind: "audio-recording",
1783
- result: e
1784
- }), x("idle");
1846
+ result: t
1847
+ }), v("idle");
1785
1848
  } catch (e) {
1786
- D.current = !1, E.current = null, C(bt(e)), x("error");
1849
+ E.current = !1, T.current = null, x(Vt(e)), v("error");
1787
1850
  }
1788
1851
  }
1789
1852
  }
1790
- function j() {
1791
- C(null), T(0), x("idle"), _();
1853
+ function A() {
1854
+ x(null), w(0), v("idle"), m();
1792
1855
  }
1793
- let M = b === "checking" || b === "processing", N = b === "recording" ? w : y?.result.duration ?? w;
1794
- return /* @__PURE__ */ o("div", {
1856
+ let j = _ === "checking" || _ === "processing", te = _ === "recording" ? S : g?.result.duration ?? S;
1857
+ return /* @__PURE__ */ s("div", {
1795
1858
  className: "audio-debug-card",
1796
- "data-status": b,
1859
+ "data-status": _,
1797
1860
  children: [
1798
- /* @__PURE__ */ o("div", {
1861
+ /* @__PURE__ */ s("div", {
1799
1862
  className: "audio-pronunciation-target",
1800
- children: [/* @__PURE__ */ a("div", {
1863
+ children: [/* @__PURE__ */ o("div", {
1801
1864
  className: "audio-pronunciation-image-frame",
1802
- children: /* @__PURE__ */ a("img", {
1865
+ children: /* @__PURE__ */ o("img", {
1803
1866
  alt: c,
1804
1867
  src: l
1805
1868
  })
1806
- }), /* @__PURE__ */ o("div", {
1869
+ }), /* @__PURE__ */ s("div", {
1807
1870
  className: "audio-pronunciation-copy",
1808
1871
  children: [
1809
- /* @__PURE__ */ o("span", { children: [
1872
+ /* @__PURE__ */ s("span", { children: [
1810
1873
  "اُنْطِقِ الكَلِمَةَ بِـ",
1811
- yt(d),
1874
+ Bt(d),
1812
1875
  ":"
1813
1876
  ] }),
1814
- /* @__PURE__ */ a("strong", {
1877
+ /* @__PURE__ */ o("strong", {
1815
1878
  dir: d === "ar" ? "rtl" : "ltr",
1816
- children: s
1879
+ children: a
1817
1880
  }),
1818
- /* @__PURE__ */ a("p", { children: u })
1881
+ /* @__PURE__ */ o("p", { children: u })
1819
1882
  ]
1820
1883
  })]
1821
1884
  }),
1822
- /* @__PURE__ */ o("div", {
1885
+ /* @__PURE__ */ s("div", {
1823
1886
  className: "audio-debug-card__hero",
1824
1887
  "aria-live": "polite",
1825
- children: [/* @__PURE__ */ a("span", {
1888
+ children: [/* @__PURE__ */ o("span", {
1826
1889
  className: "audio-debug-card__icon",
1827
1890
  "aria-hidden": "true",
1828
- children: /* @__PURE__ */ a(f, {})
1829
- }), /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("strong", { children: xt(b, !!y) }), /* @__PURE__ */ a("span", { children: vt(N) })] })]
1891
+ children: /* @__PURE__ */ o(y, {})
1892
+ }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Ht(_, !!g) }), /* @__PURE__ */ o("span", { children: zt(te) })] })]
1830
1893
  }),
1831
- /* @__PURE__ */ o("div", {
1894
+ /* @__PURE__ */ s("div", {
1832
1895
  className: "audio-debug-actions",
1833
1896
  children: [
1834
- /* @__PURE__ */ o("button", {
1897
+ /* @__PURE__ */ s("button", {
1835
1898
  className: "audio-debug-button audio-debug-button--record",
1836
- disabled: b === "recording" || M,
1837
- onClick: k,
1899
+ disabled: _ === "recording" || j,
1900
+ onClick: O,
1838
1901
  type: "button",
1839
- children: [/* @__PURE__ */ a(f, { "aria-hidden": "true" }), /* @__PURE__ */ a("span", { children: y ? "سَجِّلْ مُحاوَلَةً جَدِيدَةً" : "اِبْدَأِ التَّسْجِيلَ" })]
1902
+ children: [/* @__PURE__ */ o(y, { "aria-hidden": "true" }), /* @__PURE__ */ o("span", { children: g ? "سَجِّلْ مُحاوَلَةً جَدِيدَةً" : "اِبْدَأِ التَّسْجِيلَ" })]
1840
1903
  }),
1841
- /* @__PURE__ */ o("button", {
1904
+ /* @__PURE__ */ s("button", {
1842
1905
  className: "audio-debug-button audio-debug-button--stop",
1843
- disabled: b !== "recording",
1844
- onClick: A,
1906
+ disabled: _ !== "recording",
1907
+ onClick: k,
1845
1908
  type: "button",
1846
- children: [/* @__PURE__ */ a(h, { "aria-hidden": "true" }), /* @__PURE__ */ a("span", { children: "أَنْهِ التَّسْجِيلَ" })]
1909
+ children: [/* @__PURE__ */ o(C, { "aria-hidden": "true" }), /* @__PURE__ */ o("span", { children: "أَنْهِ التَّسْجِيلَ" })]
1847
1910
  }),
1848
- /* @__PURE__ */ o("button", {
1911
+ /* @__PURE__ */ s("button", {
1849
1912
  className: "audio-debug-button audio-debug-button--reset",
1850
- disabled: b === "recording" || M || !y && !S,
1851
- onClick: j,
1913
+ disabled: _ === "recording" || j || !g && !b,
1914
+ onClick: A,
1852
1915
  type: "button",
1853
- children: [/* @__PURE__ */ a(m, { "aria-hidden": "true" }), /* @__PURE__ */ a("span", { children: "إِعادَةُ المُحاوَلَةِ" })]
1916
+ children: [/* @__PURE__ */ o(ee, { "aria-hidden": "true" }), /* @__PURE__ */ o("span", { children: "إِعادَةُ المُحاوَلَةِ" })]
1854
1917
  })
1855
1918
  ]
1856
1919
  }),
1857
- S ? /* @__PURE__ */ a("p", {
1920
+ b ? /* @__PURE__ */ o("p", {
1858
1921
  className: "audio-debug-message",
1859
1922
  role: "alert",
1860
- children: S
1923
+ children: b
1861
1924
  }) : null,
1862
- y && O ? /* @__PURE__ */ o("section", {
1925
+ g && D ? /* @__PURE__ */ s("section", {
1863
1926
  className: "audio-pronunciation-feedback",
1864
- "data-outcome": O.status,
1927
+ "data-outcome": D.status,
1865
1928
  "data-testid": "pronunciation-feedback",
1866
1929
  role: "status",
1867
- children: [/* @__PURE__ */ o("div", {
1930
+ children: [/* @__PURE__ */ s("div", {
1868
1931
  className: "audio-pronunciation-feedback__headline",
1869
- children: [/* @__PURE__ */ a(_t, { status: O.status }), /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("strong", { children: St(O.status) }), /* @__PURE__ */ a("span", { children: Ct(O.status, s) })] })]
1870
- }), /* @__PURE__ */ o("div", {
1932
+ children: [/* @__PURE__ */ o(Rt, { status: D.status }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Ut(D.status) }), /* @__PURE__ */ o("span", { children: Wt(D.status, a) })] })]
1933
+ }), /* @__PURE__ */ s("div", {
1871
1934
  className: "audio-debug-metadata",
1872
1935
  children: [
1873
- /* @__PURE__ */ a($, {
1936
+ /* @__PURE__ */ o(Z, {
1874
1937
  label: "ما تَعَرَّفَ عَلَيْهِ النَّمُوذَجُ",
1875
- value: O.detectedPronunciation || "—"
1938
+ value: D.detectedPronunciation || "—"
1876
1939
  }),
1877
- /* @__PURE__ */ a($, {
1940
+ /* @__PURE__ */ o(Z, {
1878
1941
  label: "نِسْبَةُ التَّطابُقِ",
1879
- value: `${O.similarityPercent}%`
1942
+ value: `${D.similarityPercent}%`
1880
1943
  }),
1881
- /* @__PURE__ */ a($, {
1944
+ /* @__PURE__ */ o(Z, {
1882
1945
  label: "ثِقَةُ النَّمُوذَجِ",
1883
- value: `${O.confidencePercent}%`
1946
+ value: `${D.confidencePercent}%`
1884
1947
  }),
1885
- /* @__PURE__ */ a($, {
1948
+ /* @__PURE__ */ o(Z, {
1886
1949
  label: "اللُّغَةُ",
1887
- value: O.language.toUpperCase()
1950
+ value: D.language.toUpperCase()
1888
1951
  }),
1889
- /* @__PURE__ */ a($, {
1952
+ /* @__PURE__ */ o(Z, {
1890
1953
  label: "زَمَنُ التَّحْلِيلِ",
1891
- value: `${O.latencyMs} ms`
1954
+ value: `${D.latencyMs} ms`
1892
1955
  }),
1893
- /* @__PURE__ */ a($, {
1956
+ /* @__PURE__ */ o(Z, {
1894
1957
  label: "عَدَدُ الرُّمُوزِ الصَّوْتِيَّةِ",
1895
- value: O.timestamps.length.toString()
1958
+ value: D.timestamps.length.toString()
1896
1959
  })
1897
1960
  ]
1898
1961
  })]
@@ -1900,54 +1963,54 @@ function gt({ acceptedPronunciations: i, expectedText: s, imageAlt: c, imageSrc:
1900
1963
  ]
1901
1964
  });
1902
1965
  }
1903
- function _t({ status: e }) {
1904
- return a(e === "correct" ? u : e === "no-speech" ? g : _, { "aria-hidden": "true" });
1966
+ function Rt({ status: e }) {
1967
+ return o(e === "correct" ? f : e === "no-speech" ? D : O, { "aria-hidden": "true" });
1905
1968
  }
1906
- function $({ label: e, value: t }) {
1907
- return /* @__PURE__ */ o("span", {
1969
+ function Z({ label: e, value: t }) {
1970
+ return /* @__PURE__ */ s("span", {
1908
1971
  className: "audio-debug-meta-card",
1909
- children: [/* @__PURE__ */ a("small", { children: e }), /* @__PURE__ */ a("strong", {
1972
+ children: [/* @__PURE__ */ o("small", { children: e }), /* @__PURE__ */ o("strong", {
1910
1973
  dir: "ltr",
1911
1974
  children: t
1912
1975
  })]
1913
1976
  });
1914
1977
  }
1915
- function vt(e) {
1978
+ function zt(e) {
1916
1979
  let t = Math.max(0, Math.round(e / 1e3)), n = Math.floor(t / 60), r = t % 60;
1917
1980
  return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
1918
1981
  }
1919
- function yt(e) {
1982
+ function Bt(e) {
1920
1983
  return e === "fr" ? "الفَرَنْسِيَّةِ" : "العَرَبِيَّةِ";
1921
1984
  }
1922
- function bt(e) {
1985
+ function Vt(e) {
1923
1986
  let t = e;
1924
1987
  return t.code === "MISSING_PERMISSION" ? "يَجِبُ السَّماحُ بِاسْتِعْمالِ المِيكْرُوفُونِ لِتَسْجِيلِ الإِجابَةِ." : t.code === "MODEL_VOCAB_MISMATCH" ? "مَلَفُّ نَمُوذَجِ اللُّغَةِ لا يُطابِقُ قامُوسَهُ. يُرْجى تَصْحِيحُ مَلَفِّ النَّمُوذَجِ." : t.message ? t.message : typeof e == "string" ? e : "حَدَثَ خَطَأٌ أَثْناءَ تَسْجِيلِ الإِجابَةِ الصَّوْتِيَّةِ.";
1925
1988
  }
1926
- function xt(e, t) {
1989
+ function Ht(e, t) {
1927
1990
  return e === "checking" ? "جارِي تَجْهِيزُ المِيكْرُوفُونِ" : e === "recording" ? "جارِي التَّسْجِيلُ... تَكَلَّمِ الآنَ" : e === "processing" ? "جارِي تَحْلِيلُ النُّطْقِ" : e === "error" ? "تَعَذَّرَ تَحْلِيلُ التَّسْجِيلِ" : t ? "اِكْتَمَلَ تَحْلِيلُ الإِجابَةِ" : "المِيكْرُوفُونُ جاهِزٌ";
1928
1991
  }
1929
- function St(e) {
1992
+ function Ut(e) {
1930
1993
  return e === "correct" ? "أَحْسَنْتَ! إِجابَةٌ صَحِيحَةٌ" : e === "no-speech" ? "لَمْ نَسْمَعْ كَلِمَةً واضِحَةً" : e === "language-mismatch" ? "اُسْتُعْمِلَ نَمُوذَجُ لُغَةٍ مُخْتَلِفَةٍ" : "حاوِلْ مَرَّةً أُخْرى";
1931
1994
  }
1932
- function Ct(e, t) {
1995
+ function Wt(e, t) {
1933
1996
  return e === "correct" ? `نَطَقْتَ «${t}» بِشَكْلٍ صَحِيحٍ.` : e === "no-speech" ? `قَرِّبْ فَمَكَ مِنَ المِيكْرُوفُونِ وَقُلْ «${t}».` : `اِسْتَمِعْ إِلى نُطْقِ «${t}» ثُمَّ أَعِدِ المُحاوَلَةَ.`;
1934
1997
  }
1935
1998
  //#endregion
1936
1999
  //#region src/exam-session/interactions/SortableAnswer.tsx
1937
- function wt({ answerId: e, items: t, value: n, onChange: r }) {
1938
- let i = new Map(t.map((e) => [e.id, e])), o = n?.itemIds.length === t.length ? n.itemIds.filter((e) => i.has(e)) : t.map((e) => e.id);
1939
- return /* @__PURE__ */ a(s, {
2000
+ function Gt({ answerId: e, items: t, value: n, onChange: r }) {
2001
+ let i = new Map(t.map((e) => [e.id, e])), a = n?.itemIds.length === t.length ? n.itemIds.filter((e) => i.has(e)) : t.map((e) => e.id);
2002
+ return /* @__PURE__ */ o(c, {
1940
2003
  onDragEnd: (e) => {
1941
2004
  e.canceled || r({
1942
2005
  kind: "order",
1943
- itemIds: E(o, e).map((e) => e.toString())
2006
+ itemIds: F(a, e).map((e) => e.toString())
1944
2007
  });
1945
2008
  },
1946
- children: /* @__PURE__ */ a("div", {
2009
+ children: /* @__PURE__ */ o("div", {
1947
2010
  className: "sortable-answer",
1948
- children: o.map((t, n) => {
2011
+ children: a.map((t, n) => {
1949
2012
  let r = i.get(t);
1950
- return r ? /* @__PURE__ */ a(Tt, {
2013
+ return r ? /* @__PURE__ */ o(Kt, {
1951
2014
  group: e,
1952
2015
  index: n,
1953
2016
  item: r
@@ -1956,18 +2019,18 @@ function wt({ answerId: e, items: t, value: n, onChange: r }) {
1956
2019
  })
1957
2020
  });
1958
2021
  }
1959
- function Tt({ group: e, index: t, item: n }) {
1960
- let { ref: r, isDragging: i, isDropTarget: o } = D({
2022
+ function Kt({ group: e, index: t, item: n }) {
2023
+ let { ref: r, isDragging: i, isDropTarget: a } = I({
1961
2024
  id: n.id,
1962
2025
  index: t,
1963
2026
  group: e,
1964
2027
  type: "sortable-answer"
1965
2028
  });
1966
- return /* @__PURE__ */ a("button", {
2029
+ return /* @__PURE__ */ o("button", {
1967
2030
  className: [
1968
2031
  "sortable-token",
1969
2032
  i ? "sortable-token--dragging" : "",
1970
- o ? "sortable-token--target" : ""
2033
+ a ? "sortable-token--target" : ""
1971
2034
  ].filter(Boolean).join(" "),
1972
2035
  ref: r,
1973
2036
  type: "button",
@@ -1976,8 +2039,8 @@ function Tt({ group: e, index: t, item: n }) {
1976
2039
  }
1977
2040
  //#endregion
1978
2041
  //#region src/exam-session/interactions/TextAnswer.tsx
1979
- function Et({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
1980
- return /* @__PURE__ */ a("input", {
2042
+ function qt({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
2043
+ return /* @__PURE__ */ o("input", {
1981
2044
  "aria-label": e,
1982
2045
  className: t,
1983
2046
  inputMode: n,
@@ -1989,35 +2052,186 @@ function Et({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onCha
1989
2052
  });
1990
2053
  }
1991
2054
  //#endregion
2055
+ //#region src/renderer/visualScene.tsx
2056
+ var Jt = {
2057
+ apple: d,
2058
+ circle: p,
2059
+ flower: g,
2060
+ heart: _,
2061
+ hexagon: v,
2062
+ square: C,
2063
+ star: w,
2064
+ sun: T,
2065
+ triangle: E
2066
+ }, Yt = {
2067
+ blue: "#4d89d9",
2068
+ gray: "#8c97a0",
2069
+ green: "#1f9d63",
2070
+ orange: "#f39b2b",
2071
+ purple: "#8a63d2",
2072
+ red: "#eb5b5b",
2073
+ yellow: "#f2c641"
2074
+ }, Xt = {
2075
+ "counter-rows": { rows: [{
2076
+ color: "yellow",
2077
+ count: 5,
2078
+ icon: "circle",
2079
+ id: "counter-top",
2080
+ state: "plain"
2081
+ }, {
2082
+ color: "yellow",
2083
+ count: 4,
2084
+ icon: "circle",
2085
+ id: "counter-bottom",
2086
+ state: "crossed"
2087
+ }] },
2088
+ "sun-stars": { rows: [{
2089
+ color: "yellow",
2090
+ count: 4,
2091
+ icon: "sun",
2092
+ id: "sun-row",
2093
+ state: "plain"
2094
+ }, {
2095
+ color: "gray",
2096
+ count: 2,
2097
+ icon: "star",
2098
+ id: "star-row",
2099
+ state: "plain"
2100
+ }] }
2101
+ }, Zt = [
2102
+ {
2103
+ label: "Cercle",
2104
+ value: "circle"
2105
+ },
2106
+ {
2107
+ label: "Etoile",
2108
+ value: "star"
2109
+ },
2110
+ {
2111
+ label: "Soleil",
2112
+ value: "sun"
2113
+ },
2114
+ {
2115
+ label: "Pomme",
2116
+ value: "apple"
2117
+ },
2118
+ {
2119
+ label: "Triangle",
2120
+ value: "triangle"
2121
+ },
2122
+ {
2123
+ label: "Carre",
2124
+ value: "square"
2125
+ },
2126
+ {
2127
+ label: "Coeur",
2128
+ value: "heart"
2129
+ },
2130
+ {
2131
+ label: "Fleur",
2132
+ value: "flower"
2133
+ },
2134
+ {
2135
+ label: "Hexagone",
2136
+ value: "hexagon"
2137
+ }
2138
+ ], Qt = [
2139
+ {
2140
+ label: "Jaune",
2141
+ value: "yellow"
2142
+ },
2143
+ {
2144
+ label: "Bleu",
2145
+ value: "blue"
2146
+ },
2147
+ {
2148
+ label: "Vert",
2149
+ value: "green"
2150
+ },
2151
+ {
2152
+ label: "Rouge",
2153
+ value: "red"
2154
+ },
2155
+ {
2156
+ label: "Orange",
2157
+ value: "orange"
2158
+ },
2159
+ {
2160
+ label: "Violet",
2161
+ value: "purple"
2162
+ },
2163
+ {
2164
+ label: "Gris",
2165
+ value: "gray"
2166
+ }
2167
+ ], $t = [{
2168
+ label: "Normal",
2169
+ value: "plain"
2170
+ }, {
2171
+ label: "Barre",
2172
+ value: "crossed"
2173
+ }];
2174
+ function en(e) {
2175
+ return { rows: Xt[e].rows.map((e) => ({ ...e })) };
2176
+ }
2177
+ function tn(e) {
2178
+ return Yt[e];
2179
+ }
2180
+ function nn({ scene: e }) {
2181
+ return /* @__PURE__ */ o("div", {
2182
+ className: "visual-panel visual-panel--custom",
2183
+ "aria-hidden": "true",
2184
+ children: /* @__PURE__ */ o("div", {
2185
+ className: "visual-scene",
2186
+ children: e.rows.map((e) => /* @__PURE__ */ o("div", {
2187
+ className: "visual-scene-row",
2188
+ children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ o(rn, {
2189
+ color: e.color,
2190
+ icon: e.icon,
2191
+ state: e.state
2192
+ }, `${e.id}-${n}`))
2193
+ }, e.id))
2194
+ })
2195
+ });
2196
+ }
2197
+ function rn({ color: e, icon: t, state: n }) {
2198
+ let r = Jt[t];
2199
+ return /* @__PURE__ */ o("span", {
2200
+ className: n === "crossed" ? "visual-scene-icon visual-scene-icon--crossed" : "visual-scene-icon",
2201
+ style: { color: tn(e) },
2202
+ children: /* @__PURE__ */ o(r, { "aria-hidden": "true" })
2203
+ });
2204
+ }
2205
+ //#endregion
1992
2206
  //#region src/renderer/QuestionRenderer.tsx
1993
- function Dt({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
1994
- return /* @__PURE__ */ o("article", {
2207
+ function an({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
2208
+ return /* @__PURE__ */ s("article", {
1995
2209
  className: `question-block question-block--${n.type}`,
1996
- children: [/* @__PURE__ */ a(kt, {
2210
+ children: [/* @__PURE__ */ o(sn, {
1997
2211
  number: n.number,
1998
2212
  prompt: n.prompt
1999
- }), At(n, r, i, t, e)]
2213
+ }), cn(n, r, i, t, e)]
2000
2214
  });
2001
2215
  }
2002
- function Ot({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
2003
- return /* @__PURE__ */ o("section", {
2216
+ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
2217
+ return /* @__PURE__ */ s("section", {
2004
2218
  className: `question-section question-section--${n.tone}`,
2005
- children: [/* @__PURE__ */ o("header", {
2219
+ children: [/* @__PURE__ */ s("header", {
2006
2220
  className: "section-heading",
2007
2221
  children: [
2008
- /* @__PURE__ */ o("span", {
2222
+ /* @__PURE__ */ s("span", {
2009
2223
  className: "section-points",
2010
- children: [/* @__PURE__ */ a("small", { children: "ن" }), n.points]
2224
+ children: [/* @__PURE__ */ o("small", { children: "ن" }), n.points]
2011
2225
  }),
2012
- /* @__PURE__ */ a("h3", { children: n.title }),
2013
- /* @__PURE__ */ a("span", {
2226
+ /* @__PURE__ */ o("h3", { children: n.title }),
2227
+ /* @__PURE__ */ o("span", {
2014
2228
  className: "section-badge",
2015
2229
  children: n.badge
2016
2230
  })
2017
2231
  ]
2018
- }), /* @__PURE__ */ a("div", {
2232
+ }), /* @__PURE__ */ o("div", {
2019
2233
  className: "section-body",
2020
- children: n.questions.map((n) => /* @__PURE__ */ a(Dt, {
2234
+ children: n.questions.map((n) => /* @__PURE__ */ o(an, {
2021
2235
  adapters: e,
2022
2236
  clearAnswer: t,
2023
2237
  getAnswer: r,
@@ -2027,87 +2241,73 @@ function Ot({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
2027
2241
  })]
2028
2242
  });
2029
2243
  }
2030
- function kt({ number: e, prompt: t }) {
2031
- return /* @__PURE__ */ o("div", {
2244
+ function sn({ number: e, prompt: t }) {
2245
+ return /* @__PURE__ */ s("div", {
2032
2246
  className: "question-prompt",
2033
- children: [e > 0 ? /* @__PURE__ */ a("span", { children: e }) : null, /* @__PURE__ */ a("strong", { children: t })]
2247
+ children: [e > 0 ? /* @__PURE__ */ o("span", { children: e }) : null, /* @__PURE__ */ o("strong", { children: t })]
2034
2248
  });
2035
2249
  }
2036
- function At(e, t, n, r, s) {
2250
+ function cn(e, t, n, r, i) {
2037
2251
  switch (e.type) {
2038
- case "inline-inputs": return /* @__PURE__ */ a("div", {
2252
+ case "inline-inputs": return /* @__PURE__ */ o("div", {
2039
2253
  className: "inline-equation-grid",
2040
- children: e.items.map((i) => {
2041
- let c = `${e.id}:${i.id}`;
2042
- return /* @__PURE__ */ o("div", {
2043
- className: "equation-card",
2044
- children: [
2045
- /* @__PURE__ */ a("span", { children: i.before }),
2046
- /* @__PURE__ */ a(q, {
2047
- ariaLabel: i.before,
2048
- onChange: (e) => n(c, e),
2049
- onClear: () => r(c),
2050
- recognizer: s?.handwritingRecognizer,
2051
- value: Mt(t(c))
2052
- }),
2053
- i.after ? /* @__PURE__ */ a("span", { children: i.after }) : null
2054
- ]
2055
- }, i.id);
2056
- })
2254
+ children: e.items.map((a) => ln({
2255
+ adapters: i,
2256
+ className: "equation-card",
2257
+ clearAnswer: r,
2258
+ getAnswer: t,
2259
+ item: a,
2260
+ questionId: e.id,
2261
+ updateAnswer: n
2262
+ }))
2057
2263
  });
2058
- case "visual-choice": return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(Ut, {
2264
+ case "visual-choice": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(xn, {
2059
2265
  choices: e.choices,
2060
2266
  onChange: (t) => n(e.id, t),
2061
- value: Pt(t(e.id)),
2267
+ scene: e.scene,
2268
+ value: fn(t(e.id)),
2062
2269
  visual: e.visual
2063
- }), e.inputLabel ? /* @__PURE__ */ o("div", {
2270
+ }), e.inputLabel ? /* @__PURE__ */ s("div", {
2064
2271
  className: "compact-answer",
2065
- children: [/* @__PURE__ */ a("span", { children: e.inputLabel }), /* @__PURE__ */ a(q, {
2272
+ children: [/* @__PURE__ */ o("span", { children: e.inputLabel }), /* @__PURE__ */ o(G, {
2066
2273
  ariaLabel: e.inputLabel,
2067
2274
  onChange: (t) => n(`${e.id}:input`, t),
2068
2275
  onClear: () => r(`${e.id}:input`),
2069
- recognizer: s?.handwritingRecognizer,
2070
- value: Mt(t(`${e.id}:input`))
2276
+ recognizer: i?.handwritingRecognizer,
2277
+ value: Q(t(`${e.id}:input`))
2071
2278
  })]
2072
2279
  }) : null] });
2073
- case "number-line": return /* @__PURE__ */ a(st, {
2280
+ case "number-line": return /* @__PURE__ */ o(Ot, {
2074
2281
  answerId: e.id,
2075
2282
  expression: e.expression,
2076
2283
  onClear: r,
2077
2284
  onChange: n,
2078
- recognizer: s?.handwritingRecognizer,
2079
- value: Mt(t(e.id))
2285
+ recognizer: i?.handwritingRecognizer,
2286
+ value: Q(t(e.id))
2080
2287
  });
2081
- case "equation-inputs": return /* @__PURE__ */ a("div", {
2288
+ case "equation-inputs": return /* @__PURE__ */ o("div", {
2082
2289
  className: "stacked-equations",
2083
- children: e.items.map((i) => {
2084
- let c = `${e.id}:${i.id}`;
2085
- return /* @__PURE__ */ o("div", {
2086
- className: "wide-equation-card",
2087
- children: [
2088
- /* @__PURE__ */ a("span", { children: i.before }),
2089
- /* @__PURE__ */ a(q, {
2090
- ariaLabel: `${e.prompt} ${i.before}`,
2091
- onChange: (e) => n(c, e),
2092
- onClear: () => r(c),
2093
- recognizer: s?.handwritingRecognizer,
2094
- value: Mt(t(c))
2095
- }),
2096
- i.after ? /* @__PURE__ */ a("span", { children: i.after }) : null
2097
- ]
2098
- }, i.id);
2099
- })
2290
+ children: e.items.map((a) => ln({
2291
+ adapters: i,
2292
+ ariaPrefix: e.prompt,
2293
+ className: "wide-equation-card",
2294
+ clearAnswer: r,
2295
+ getAnswer: t,
2296
+ item: a,
2297
+ questionId: e.id,
2298
+ updateAnswer: n
2299
+ }))
2100
2300
  });
2101
- case "length-estimation": return /* @__PURE__ */ a(Wt, {
2301
+ case "length-estimation": return /* @__PURE__ */ o(Sn, {
2102
2302
  answerId: e.id,
2103
2303
  choices: e.choices,
2104
2304
  getAnswer: t,
2105
2305
  items: e.items,
2106
2306
  updateAnswer: n
2107
2307
  });
2108
- case "shape-choice": return /* @__PURE__ */ o("div", {
2308
+ case "shape-choice": return /* @__PURE__ */ s("div", {
2109
2309
  className: "shape-choice-layout",
2110
- children: [/* @__PURE__ */ a(me, {
2310
+ children: [/* @__PURE__ */ o(Ne, {
2111
2311
  items: e.choices.map((e) => ({
2112
2312
  id: `${e.id}-label`,
2113
2313
  label: e.label
@@ -2115,62 +2315,79 @@ function At(e, t, n, r, s) {
2115
2315
  onChange: (t) => n(e.id, t),
2116
2316
  targets: e.choices.map((e) => ({
2117
2317
  id: `${e.id}-target`,
2118
- label: Bt(e.id)
2318
+ label: yn(e.id)
2119
2319
  })),
2120
- value: Pt(t(e.id))
2121
- }), /* @__PURE__ */ a("div", {
2320
+ value: fn(t(e.id))
2321
+ }), /* @__PURE__ */ o("div", {
2122
2322
  className: "shape-row",
2123
2323
  "aria-hidden": "true",
2124
- children: e.choices.map((e) => /* @__PURE__ */ a("span", { className: `shape-drawing shape-drawing--${e.id}` }, e.id))
2324
+ children: e.choices.map((e) => /* @__PURE__ */ o("span", { className: `shape-drawing shape-drawing--${e.id}` }, e.id))
2125
2325
  })]
2126
2326
  });
2127
- case "drawing-grid": return /* @__PURE__ */ a(rt, {
2128
- actionLabel: e.actionLabel,
2327
+ case "drawing-grid": return /* @__PURE__ */ o(wt, {
2129
2328
  onChange: (t) => n(e.id, t),
2130
2329
  points: e.points,
2131
- value: Lt(t(e.id))
2330
+ value: hn(t(e.id))
2132
2331
  });
2133
- case "table-response": return /* @__PURE__ */ a(pe, {
2332
+ case "table-response": return /* @__PURE__ */ o(De, {
2134
2333
  columns: e.columns,
2135
2334
  onChange: (t) => n(e.id, t),
2136
- value: Rt(t(e.id))
2335
+ value: gn(t(e.id))
2137
2336
  });
2138
- case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ a("p", {
2337
+ case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ o("p", {
2139
2338
  className: "problem-statement",
2140
2339
  children: e.before
2141
- }) : /* @__PURE__ */ o("div", {
2340
+ }) : /* @__PURE__ */ s("div", {
2142
2341
  className: "sentence-answer",
2143
2342
  children: [
2144
- e.before ? /* @__PURE__ */ a("span", { children: e.before }) : null,
2145
- /* @__PURE__ */ a(q, {
2343
+ e.before ? /* @__PURE__ */ o("span", { children: e.before }) : null,
2344
+ /* @__PURE__ */ o(G, {
2146
2345
  ariaLabel: e.prompt,
2147
2346
  onChange: (t) => n(e.id, t),
2148
2347
  onClear: () => r(e.id),
2149
- recognizer: s?.handwritingRecognizer,
2150
- value: Mt(t(e.id))
2348
+ recognizer: i?.handwritingRecognizer,
2349
+ value: Q(t(e.id))
2151
2350
  }),
2152
- e.after ? /* @__PURE__ */ a("span", { children: e.after }) : null
2351
+ e.after ? /* @__PURE__ */ o("span", { children: e.after }) : null
2153
2352
  ]
2154
2353
  });
2155
- case "drag-match": return /* @__PURE__ */ a(me, {
2354
+ case "word-problem": return /* @__PURE__ */ s("div", {
2355
+ className: "word-problem",
2356
+ children: [/* @__PURE__ */ o("p", {
2357
+ className: "problem-statement word-problem__situation",
2358
+ children: e.situation
2359
+ }), /* @__PURE__ */ o("div", {
2360
+ className: "word-problem__parts",
2361
+ children: e.parts.map((a, s) => /* @__PURE__ */ o(vn, {
2362
+ adapters: i,
2363
+ clearAnswer: r,
2364
+ getAnswer: t,
2365
+ part: a,
2366
+ parentQuestionId: e.id,
2367
+ partNumber: s + 1,
2368
+ updateAnswer: n
2369
+ }, a.id))
2370
+ })]
2371
+ });
2372
+ case "drag-match": return /* @__PURE__ */ o(Ne, {
2156
2373
  items: e.items,
2157
2374
  onChange: (t) => n(e.id, t),
2158
2375
  targets: e.targets,
2159
- value: Pt(t(e.id))
2376
+ value: fn(t(e.id))
2160
2377
  });
2161
- case "sortable-answer": return /* @__PURE__ */ a(wt, {
2378
+ case "sortable-answer": return /* @__PURE__ */ o(Gt, {
2162
2379
  answerId: e.id,
2163
2380
  items: e.items,
2164
2381
  onChange: (t) => n(e.id, t),
2165
- value: Ft(t(e.id))
2382
+ value: pn(t(e.id))
2166
2383
  });
2167
- case "label-placement": return /* @__PURE__ */ a(it, {
2384
+ case "label-placement": return /* @__PURE__ */ o(Tt, {
2168
2385
  labels: e.labels,
2169
2386
  onChange: (t) => n(e.id, t),
2170
2387
  targets: e.targets,
2171
- value: It(t(e.id))
2388
+ value: mn(t(e.id))
2172
2389
  });
2173
- case "audio-recording": return /* @__PURE__ */ a(gt, {
2390
+ case "audio-recording": return /* @__PURE__ */ o(Lt, {
2174
2391
  acceptedPronunciations: e.acceptedPronunciations,
2175
2392
  expectedText: e.expectedAnswer,
2176
2393
  imageAlt: e.imageAlt,
@@ -2180,137 +2397,166 @@ function At(e, t, n, r, s) {
2180
2397
  minimumSimilarity: e.minimumSimilarity,
2181
2398
  onChange: (t) => n(e.id, t),
2182
2399
  onReset: () => r(e.id),
2183
- recorder: s?.audioRecorder,
2184
- value: zt(t(e.id))
2400
+ recorder: i?.audioRecorder,
2401
+ value: _n(t(e.id))
2185
2402
  });
2186
2403
  }
2187
2404
  }
2188
- function jt(e) {
2405
+ function ln({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswer: a, item: c, questionId: l, updateAnswer: u }) {
2406
+ if (c.answers?.length) return /* @__PURE__ */ s("div", {
2407
+ className: r,
2408
+ children: [c.answers.map((r) => {
2409
+ let d = `${l}:${c.id}:${r.id}`, f = [n, r.before].filter(Boolean).join(" ");
2410
+ return /* @__PURE__ */ s(e, { children: [r.before ? /* @__PURE__ */ o("span", { children: r.before }) : null, /* @__PURE__ */ o(G, {
2411
+ ariaLabel: f,
2412
+ onChange: (e) => u(d, e),
2413
+ onClear: () => i(d),
2414
+ recognizer: t?.handwritingRecognizer,
2415
+ value: Q(a(d))
2416
+ })] }, r.id);
2417
+ }), c.after ? /* @__PURE__ */ o("span", { children: c.after }) : null]
2418
+ }, c.id);
2419
+ if (!c.correctAnswer) return /* @__PURE__ */ s("div", {
2420
+ className: r,
2421
+ children: [/* @__PURE__ */ o("span", { children: c.before }), c.after ? /* @__PURE__ */ o("span", { children: c.after }) : null]
2422
+ }, c.id);
2423
+ let d = `${l}:${c.id}`;
2424
+ return /* @__PURE__ */ s("div", {
2425
+ className: r,
2426
+ children: [
2427
+ /* @__PURE__ */ o("span", { children: c.before }),
2428
+ /* @__PURE__ */ o(G, {
2429
+ ariaLabel: [n, c.before].filter(Boolean).join(" "),
2430
+ onChange: (e) => u(d, e),
2431
+ onClear: () => i(d),
2432
+ recognizer: t?.handwritingRecognizer,
2433
+ value: Q(a(d))
2434
+ }),
2435
+ c.after ? /* @__PURE__ */ o("span", { children: c.after }) : null
2436
+ ]
2437
+ }, c.id);
2438
+ }
2439
+ function un(e) {
2189
2440
  return e?.kind === "text" ? e : void 0;
2190
2441
  }
2191
- function Mt(e) {
2442
+ function Q(e) {
2192
2443
  return e?.kind === "handwritten-number" ? e : void 0;
2193
2444
  }
2194
- function Nt(e) {
2445
+ function dn(e) {
2195
2446
  return e?.kind === "choice" ? e : void 0;
2196
2447
  }
2197
- function Pt(e) {
2448
+ function fn(e) {
2198
2449
  return e?.kind === "matches" ? e : void 0;
2199
2450
  }
2200
- function Ft(e) {
2451
+ function pn(e) {
2201
2452
  return e?.kind === "order" ? e : void 0;
2202
2453
  }
2203
- function It(e) {
2454
+ function mn(e) {
2204
2455
  return e?.kind === "placements" ? e : void 0;
2205
2456
  }
2206
- function Lt(e) {
2457
+ function hn(e) {
2207
2458
  return e?.kind === "drawing" ? e : void 0;
2208
2459
  }
2209
- function Rt(e) {
2460
+ function gn(e) {
2210
2461
  return e?.kind === "coin-table" ? e : void 0;
2211
2462
  }
2212
- function zt(e) {
2463
+ function _n(e) {
2213
2464
  return e?.kind === "audio-recording" ? e : void 0;
2214
2465
  }
2215
- function Bt(e) {
2216
- return e === "triangle" ? "△" : e === "square" ? "□" : e === "rectangle" ? "▭" : e;
2217
- }
2218
- function Vt({ variant: e }) {
2219
- return e === "counter-rows" ? /* @__PURE__ */ o("div", {
2220
- className: "visual-panel visual-panel--counters",
2221
- "aria-hidden": "true",
2222
- children: [/* @__PURE__ */ a("div", { children: Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ a("span", { className: "counter-dot" }, `top-${t}`)) }), /* @__PURE__ */ a("div", { children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ a("span", { className: "counter-dot counter-dot--crossed" }, `bottom-${t}`)) })]
2223
- }) : /* @__PURE__ */ o("div", {
2224
- className: "visual-panel visual-panel--suns",
2225
- "aria-hidden": "true",
2226
- children: [/* @__PURE__ */ a("div", { children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ a("span", {
2227
- className: "sun-icon",
2228
- children: "☀"
2229
- }, `sun-${t}`)) }), /* @__PURE__ */ a("div", { children: Array.from({ length: 2 }, (e, t) => /* @__PURE__ */ a("span", {
2230
- className: "star-outline",
2231
- children: "✩"
2232
- }, `star-${t}`)) })]
2466
+ function vn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, part: i, partNumber: a, updateAnswer: c }) {
2467
+ let l = `${r}:${i.id}`;
2468
+ return /* @__PURE__ */ s("section", {
2469
+ className: "word-problem-part",
2470
+ children: [/* @__PURE__ */ s("div", {
2471
+ className: "word-problem-part__prompt",
2472
+ children: [/* @__PURE__ */ o("span", { children: a }), /* @__PURE__ */ o("strong", { children: i.prompt })]
2473
+ }), i.type === "coin-table" ? /* @__PURE__ */ o(De, {
2474
+ columns: i.columns,
2475
+ onChange: (e) => c(l, e),
2476
+ value: gn(n(l))
2477
+ }) : /* @__PURE__ */ s("div", {
2478
+ className: "sentence-answer word-problem-part__sentence",
2479
+ children: [
2480
+ i.before ? /* @__PURE__ */ o("span", { children: i.before }) : null,
2481
+ /* @__PURE__ */ o(G, {
2482
+ ariaLabel: i.prompt,
2483
+ onChange: (e) => c(l, e),
2484
+ onClear: () => t(l),
2485
+ recognizer: e?.handwritingRecognizer,
2486
+ value: Q(n(l))
2487
+ }),
2488
+ i.after ? /* @__PURE__ */ o("span", { children: i.after }) : null
2489
+ ]
2490
+ })]
2233
2491
  });
2234
2492
  }
2235
- var Ht = "picture";
2236
- function Ut({ choices: t, onChange: i, value: s, visual: c }) {
2237
- let l = n(null), u = n(null), d = n({}), f = n(null), p = s?.pairs[Ht], [m, h] = r(null), [g, _] = r(null);
2238
- function v(e, t) {
2239
- let n = l.current;
2240
- if (!n) return null;
2241
- let r = n.getBoundingClientRect();
2493
+ function yn(e) {
2494
+ return e === "triangle" ? "△" : e === "square" ? "□" : e === "rectangle" ? "▭" : e;
2495
+ }
2496
+ var bn = "picture";
2497
+ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2498
+ let u = r(null), d = r(null), f = r(null), p = r({}), m = r(null), h = c?.pairs[bn], [g, _] = i(null), [v, y] = i(null);
2499
+ function b(e, t) {
2500
+ let n = d.current;
2501
+ if (n) {
2502
+ let r = n.createSVGPoint(), i = n.getScreenCTM();
2503
+ if (r.x = e, r.y = t, i) return r.matrixTransform(i.inverse());
2504
+ }
2505
+ let r = u.current;
2506
+ if (!r) return null;
2507
+ let i = r.getBoundingClientRect();
2242
2508
  return {
2243
- x: e - r.left,
2244
- y: t - r.top
2509
+ x: e - i.left,
2510
+ y: t - i.top
2245
2511
  };
2246
2512
  }
2247
- function y(e) {
2513
+ function x(e) {
2248
2514
  if (!e) return null;
2249
2515
  let t = e.getBoundingClientRect();
2250
- return v(t.left + t.width / 2, t.top + t.height / 2);
2516
+ return b(t.left + t.width / 2, t.top + t.height / 2);
2251
2517
  }
2252
- e(() => {
2518
+ t(() => {
2253
2519
  function e(e) {
2254
- let t = l.current;
2255
- if (!t || !e) return null;
2256
- let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
2257
- return {
2258
- x: r.left + r.width / 2 - n.left,
2259
- y: r.top + r.height / 2 - n.top
2260
- };
2520
+ if (!e) return null;
2521
+ let t = e.getBoundingClientRect();
2522
+ return b(t.left + t.width / 2, t.top + t.height / 2);
2261
2523
  }
2262
2524
  function t() {
2263
- if (!p) {
2264
- h(null);
2525
+ if (!h) {
2526
+ _(null);
2265
2527
  return;
2266
2528
  }
2267
- let t = e(d.current[p]), n = e(u.current);
2529
+ let t = e(p.current[h]), n = e(f.current);
2268
2530
  if (!t || !n) {
2269
- h(null);
2531
+ _(null);
2270
2532
  return;
2271
2533
  }
2272
- h({
2273
- x1: t.x,
2274
- x2: n.x,
2275
- y1: t.y,
2276
- y2: n.y
2534
+ _({
2535
+ x1: n.x,
2536
+ x2: t.x,
2537
+ y1: n.y,
2538
+ y2: t.y
2277
2539
  });
2278
2540
  }
2279
2541
  let n = window.setTimeout(t, 0), r = () => t();
2280
2542
  return window.addEventListener("resize", r), () => {
2281
2543
  window.clearTimeout(n), window.removeEventListener("resize", r);
2282
2544
  };
2283
- }, [p]);
2284
- function b(e, t) {
2285
- let n = y(t.currentTarget), r = v(t.clientX, t.clientY);
2286
- !n || !r || (t.preventDefault(), t.currentTarget.setPointerCapture(t.pointerId), f.current = {
2287
- choiceId: e,
2288
- origin: "answer",
2289
- pointerId: t.pointerId
2290
- }, _({
2291
- x1: n.x,
2292
- x2: r.x,
2293
- y1: n.y,
2294
- y2: r.y
2295
- }));
2296
- }
2297
- function x(e) {
2298
- let t = y(u.current), n = v(e.clientX, e.clientY);
2299
- !t || !n || (e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), f.current = {
2300
- origin: "target",
2301
- pointerId: e.pointerId
2302
- }, _({
2545
+ }, [h]);
2546
+ function S(e) {
2547
+ let t = x(f.current), n = b(e.clientX, e.clientY);
2548
+ !t || !n || (e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), m.current = { pointerId: e.pointerId }, y({
2303
2549
  x1: t.x,
2304
2550
  x2: n.x,
2305
2551
  y1: t.y,
2306
2552
  y2: n.y
2307
2553
  }));
2308
2554
  }
2309
- function S(e) {
2310
- let t = f.current;
2555
+ function ee(e) {
2556
+ let t = m.current;
2311
2557
  if (!t || t.pointerId !== e.pointerId) return;
2312
- let n = v(e.clientX, e.clientY), r = y(t.origin === "answer" && t.choiceId ? d.current[t.choiceId] : u.current);
2313
- !r || !n || _({
2558
+ let n = b(e.clientX, e.clientY), r = x(f.current);
2559
+ !r || !n || y({
2314
2560
  x1: r.x,
2315
2561
  x2: n.x,
2316
2562
  y1: r.y,
@@ -2318,80 +2564,72 @@ function Ut({ choices: t, onChange: i, value: s, visual: c }) {
2318
2564
  });
2319
2565
  }
2320
2566
  function C(e) {
2321
- let t = f.current;
2322
- if (!(!t || t.pointerId !== e.pointerId)) {
2323
- if (e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), t.origin === "answer" && t.choiceId && w(u.current, e.clientX, e.clientY) && i({
2324
- kind: "matches",
2325
- pairs: { [Ht]: t.choiceId }
2326
- }), t.origin === "target") {
2327
- let t = T(e.clientX, e.clientY);
2328
- t && i({
2329
- kind: "matches",
2330
- pairs: { [Ht]: t }
2331
- });
2332
- }
2333
- f.current = null, _(null);
2334
- }
2567
+ let t = m.current;
2568
+ if (!t || t.pointerId !== e.pointerId) return;
2569
+ e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId);
2570
+ let r = T(e.clientX, e.clientY);
2571
+ r && n({
2572
+ kind: "matches",
2573
+ pairs: { [bn]: r }
2574
+ }), m.current = null, y(null);
2335
2575
  }
2336
2576
  function w(e, t, n) {
2337
2577
  if (!e) return !1;
2338
2578
  let r = e.getBoundingClientRect(), i = r.left + r.width / 2, a = r.top + r.height / 2;
2339
- return Math.hypot(t - i, n - a) <= Math.max(r.width, r.height) * 1.5;
2579
+ return Math.hypot(t - i, n - a) <= Math.max(42, Math.max(r.width, r.height) * 2.4);
2340
2580
  }
2341
- function T(e, n) {
2342
- return t.find((t) => w(d.current[t.id], e, n))?.id;
2581
+ function T(t, n) {
2582
+ return e.find((e) => w(p.current[e.id], t, n))?.id;
2343
2583
  }
2344
- return /* @__PURE__ */ o("div", {
2584
+ return /* @__PURE__ */ s("div", {
2345
2585
  className: "visual-line-match",
2346
- ref: l,
2586
+ ref: u,
2347
2587
  children: [
2348
- /* @__PURE__ */ o("svg", {
2588
+ /* @__PURE__ */ s("svg", {
2349
2589
  className: "visual-line-match__lines",
2350
2590
  "aria-hidden": "true",
2351
- children: [m ? /* @__PURE__ */ a("line", {
2591
+ ref: d,
2592
+ children: [g ? /* @__PURE__ */ o("line", {
2352
2593
  className: "visual-line-match__line visual-line-match__line--settled",
2353
- x1: m.x1,
2354
- x2: m.x2,
2355
- y1: m.y1,
2356
- y2: m.y2
2357
- }) : null, g ? /* @__PURE__ */ a("line", {
2358
- className: "visual-line-match__line visual-line-match__line--draft",
2359
2594
  x1: g.x1,
2360
2595
  x2: g.x2,
2361
2596
  y1: g.y1,
2362
2597
  y2: g.y2
2598
+ }) : null, v ? /* @__PURE__ */ o("line", {
2599
+ className: "visual-line-match__line visual-line-match__line--draft",
2600
+ x1: v.x1,
2601
+ x2: v.x2,
2602
+ y1: v.y1,
2603
+ y2: v.y2
2363
2604
  }) : null]
2364
2605
  }),
2365
- /* @__PURE__ */ o("div", {
2606
+ /* @__PURE__ */ s("div", {
2366
2607
  className: "visual-match-picture",
2367
- children: [/* @__PURE__ */ a(Vt, { variant: c }), /* @__PURE__ */ a("button", {
2608
+ children: [/* @__PURE__ */ o(nn, { scene: a ?? en(l) }), /* @__PURE__ */ o("button", {
2368
2609
  "aria-label": "اربط الصورة بالإجابة",
2369
- className: p ? "visual-match-point visual-match-point--target visual-match-point--target-active" : "visual-match-point visual-match-point--target",
2610
+ className: h ? "visual-match-point visual-match-point--target visual-match-point--target-active" : "visual-match-point visual-match-point--target",
2370
2611
  onPointerCancel: C,
2371
- onPointerDown: x,
2372
- onPointerMove: S,
2612
+ onPointerDown: S,
2613
+ onPointerMove: ee,
2373
2614
  onPointerUp: C,
2374
- ref: u,
2615
+ ref: f,
2375
2616
  type: "button"
2376
2617
  })]
2377
2618
  }),
2378
- /* @__PURE__ */ a("div", {
2619
+ /* @__PURE__ */ o("div", {
2379
2620
  className: "visual-line-match__answers",
2380
- children: t.map((e) => /* @__PURE__ */ o("div", {
2381
- className: p === e.id ? "visual-match-answer visual-match-answer--matched" : "visual-match-answer",
2382
- children: [/* @__PURE__ */ a("span", {
2621
+ children: e.map((e) => /* @__PURE__ */ s("div", {
2622
+ className: h === e.id ? "visual-match-answer visual-match-answer--matched" : "visual-match-answer",
2623
+ children: [/* @__PURE__ */ o("span", {
2383
2624
  className: "answer-chip__label answer-chip__label--math",
2384
2625
  children: e.label
2385
- }), /* @__PURE__ */ a("button", {
2626
+ }), /* @__PURE__ */ o("button", {
2386
2627
  "aria-label": `اربط ${e.label} بالصورة`,
2387
2628
  className: "visual-match-point visual-match-point--answer",
2388
- onPointerCancel: C,
2389
- onPointerDown: (t) => b(e.id, t),
2390
- onPointerMove: S,
2391
- onPointerUp: C,
2392
2629
  ref: (t) => {
2393
- d.current[e.id] = t;
2630
+ p.current[e.id] = t;
2394
2631
  },
2632
+ tabIndex: -1,
2395
2633
  type: "button"
2396
2634
  })]
2397
2635
  }, e.id))
@@ -2399,8 +2637,8 @@ function Ut({ choices: t, onChange: i, value: s, visual: c }) {
2399
2637
  ]
2400
2638
  });
2401
2639
  }
2402
- function Wt({ answerId: e, choices: t, getAnswer: i, items: s, updateAnswer: c }) {
2403
- let l = Math.max(...s.map((e) => e.squareLength)) + 2, u = Ce(t), [d, f] = r(null), [p, m] = r(!1), [h, g] = r({}), _ = n(null);
2640
+ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }) {
2641
+ let l = Math.max(...a.map((e) => e.squareLength)) + 2, u = Ue(t), [d, f] = i(null), [p, m] = i(!1), [h, g] = i({}), _ = r(null);
2404
2642
  function v(e, t, n) {
2405
2643
  let r = d;
2406
2644
  r && g((i) => {
@@ -2437,27 +2675,27 @@ function Wt({ answerId: e, choices: t, getAnswer: i, items: s, updateAnswer: c }
2437
2675
  function x(e) {
2438
2676
  e?.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), _.current = null, m(!1);
2439
2677
  }
2440
- return /* @__PURE__ */ o("div", {
2678
+ return /* @__PURE__ */ s("div", {
2441
2679
  className: "length-estimation-task",
2442
2680
  "data-coloring": p ? "true" : "false",
2443
2681
  onPointerCancel: () => x(),
2444
2682
  onPointerUp: () => x(),
2445
- children: [/* @__PURE__ */ a(ye, {
2683
+ children: [/* @__PURE__ */ o(ze, {
2446
2684
  ariaLabel: "ألوان الأقلام",
2447
2685
  className: "length-color-picker",
2448
2686
  colors: u,
2449
2687
  onChange: f,
2450
2688
  selectedColorId: d
2451
- }), /* @__PURE__ */ a("div", {
2689
+ }), /* @__PURE__ */ o("div", {
2452
2690
  className: "length-card-row",
2453
- children: s.map((t) => {
2454
- let n = `${e}:squares:${t.id}`, r = `${e}:color:${t.id}`, s = Nt(i(r)), d = h[t.id], f = d?.colorId ?? s?.choiceId, p = d?.fill ?? +!!s?.choiceId, m = f ? Se(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
2455
- return /* @__PURE__ */ o("div", {
2691
+ children: a.map((t) => {
2692
+ let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a = dn(n(i)), d = h[t.id], f = d?.colorId ?? a?.choiceId, p = d?.fill ?? +!!a?.choiceId, m = f ? He(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
2693
+ return /* @__PURE__ */ s("div", {
2456
2694
  className: "length-card",
2457
- children: [/* @__PURE__ */ a("div", {
2695
+ children: [/* @__PURE__ */ o("div", {
2458
2696
  className: "square-measure-strip",
2459
2697
  style: { "--measure-squares": l },
2460
- children: /* @__PURE__ */ a("button", {
2698
+ children: /* @__PURE__ */ o("button", {
2461
2699
  "aria-label": `تلوين ${t.label}`,
2462
2700
  className: [
2463
2701
  "pencil-pencil",
@@ -2465,13 +2703,13 @@ function Wt({ answerId: e, choices: t, getAnswer: i, items: s, updateAnswer: c }
2465
2703
  p > 0 ? "pencil-pencil--colored" : ""
2466
2704
  ].filter(Boolean).join(" "),
2467
2705
  onKeyDown: (e) => {
2468
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v(t.id, r, .22));
2706
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v(t.id, i, .22));
2469
2707
  },
2470
2708
  onPointerDown: (e) => {
2471
- y(t.id, r, e);
2709
+ y(t.id, i, e);
2472
2710
  },
2473
2711
  onPointerMove: (e) => {
2474
- b(t.id, r, e);
2712
+ b(t.id, i, e);
2475
2713
  },
2476
2714
  onPointerUp: x,
2477
2715
  style: {
@@ -2482,17 +2720,17 @@ function Wt({ answerId: e, choices: t, getAnswer: i, items: s, updateAnswer: c }
2482
2720
  },
2483
2721
  type: "button"
2484
2722
  })
2485
- }), /* @__PURE__ */ o("label", {
2723
+ }), /* @__PURE__ */ s("label", {
2486
2724
  className: "length-value-row",
2487
2725
  children: [
2488
- /* @__PURE__ */ a("span", { children: t.label }),
2489
- /* @__PURE__ */ a(Et, {
2726
+ /* @__PURE__ */ o("span", { children: t.label }),
2727
+ /* @__PURE__ */ o(qt, {
2490
2728
  ariaLabel: `طول ${t.label} بالمربعات`,
2491
2729
  inputMode: "numeric",
2492
- onChange: (e) => c(n, e),
2493
- value: jt(i(n))
2730
+ onChange: (e) => c(r, e),
2731
+ value: un(n(r))
2494
2732
  }),
2495
- /* @__PURE__ */ a("span", { children: "مربعات" })
2733
+ /* @__PURE__ */ o("span", { children: "مربعات" })
2496
2734
  ]
2497
2735
  })]
2498
2736
  }, t.id);
@@ -2502,51 +2740,644 @@ function Wt({ answerId: e, choices: t, getAnswer: i, items: s, updateAnswer: c }
2502
2740
  }
2503
2741
  //#endregion
2504
2742
  //#region src/renderer/QuestionPreviewPanel.tsx
2505
- function Gt({ adapters: e, question: t }) {
2506
- let [n, i] = r({});
2507
- function o(e, t) {
2508
- i((n) => ({
2743
+ function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
2744
+ let [a, s] = i({}), c = t ?? a;
2745
+ function l(e) {
2746
+ if (t !== void 0) {
2747
+ n?.(e(t));
2748
+ return;
2749
+ }
2750
+ s(e);
2751
+ }
2752
+ function u(e, t) {
2753
+ l((n) => ({
2509
2754
  ...n,
2510
2755
  [e]: t
2511
2756
  }));
2512
2757
  }
2513
- function s(e) {
2514
- i((t) => {
2758
+ function d(e) {
2759
+ l((t) => {
2515
2760
  let n = { ...t };
2516
2761
  return delete n[e], n;
2517
2762
  });
2518
2763
  }
2519
- return /* @__PURE__ */ a("div", {
2764
+ return /* @__PURE__ */ o("div", {
2520
2765
  className: "exam-renderer-preview",
2521
- children: /* @__PURE__ */ a(Dt, {
2766
+ children: /* @__PURE__ */ o(an, {
2522
2767
  adapters: e,
2523
- clearAnswer: s,
2524
- getAnswer: (e) => n[e],
2525
- question: t,
2526
- updateAnswer: o
2768
+ clearAnswer: d,
2769
+ getAnswer: (e) => c[e],
2770
+ question: r,
2771
+ updateAnswer: u
2527
2772
  })
2528
2773
  });
2529
2774
  }
2530
2775
  //#endregion
2776
+ //#region src/renderer/PrintableExamDocument.tsx
2777
+ var wn = {
2778
+ ariaLabel: "معلومات المؤسسة",
2779
+ logoAlt: "شعار المملكة المغربية",
2780
+ logoSrc: "/logo/morocco-logo.png",
2781
+ title: "المملكة المغربية",
2782
+ lines: [
2783
+ "وزارة التربية الوطنية والتعليم الأولي والرياضة",
2784
+ "الأكاديمية الجهوية للتربية والتكوين لجهة طنجة تطوان الحسيمة",
2785
+ "المديرية الإقليمية"
2786
+ ]
2787
+ };
2788
+ function Tn({ exam: e, locale: t = "fr", variant: n }) {
2789
+ let r = qn(t), i = Mn(e);
2790
+ return /* @__PURE__ */ s("article", {
2791
+ className: `printable-exam printable-exam--${n}`,
2792
+ dir: Kn(t) ? "rtl" : "ltr",
2793
+ children: [/* @__PURE__ */ s("div", {
2794
+ className: "printable-exam__top",
2795
+ children: [/* @__PURE__ */ o(En, {}), /* @__PURE__ */ s("header", {
2796
+ className: "printable-exam__header",
2797
+ children: [/* @__PURE__ */ s("div", {
2798
+ className: "printable-exam__title-row",
2799
+ children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("span", {
2800
+ className: "printable-exam__eyebrow",
2801
+ children: e.subject
2802
+ }), /* @__PURE__ */ o("h1", { children: e.title })] }), /* @__PURE__ */ o(jn, {
2803
+ noteLabel: r.obtainedNote,
2804
+ totalPoints: i
2805
+ })]
2806
+ }), /* @__PURE__ */ s("div", {
2807
+ className: "printable-exam__meta",
2808
+ children: [
2809
+ /* @__PURE__ */ o(An, {
2810
+ label: r.duration,
2811
+ value: e.timer
2812
+ }),
2813
+ /* @__PURE__ */ o(An, {
2814
+ label: r.level,
2815
+ value: e.level
2816
+ }),
2817
+ /* @__PURE__ */ o(An, {
2818
+ label: Kn(t) ? "المادة" : r.subject ?? "Matiere",
2819
+ value: e.subject
2820
+ })
2821
+ ]
2822
+ })]
2823
+ })]
2824
+ }), /* @__PURE__ */ o("div", {
2825
+ className: "printable-exam__sections",
2826
+ children: e.sections.map((e) => /* @__PURE__ */ o(Dn, {
2827
+ locale: t,
2828
+ section: e,
2829
+ variant: n
2830
+ }, e.id))
2831
+ })]
2832
+ });
2833
+ }
2834
+ function En() {
2835
+ return /* @__PURE__ */ s("section", {
2836
+ "aria-label": wn.ariaLabel,
2837
+ className: "printable-institution-header",
2838
+ dir: "rtl",
2839
+ children: [
2840
+ /* @__PURE__ */ o("img", {
2841
+ alt: wn.logoAlt,
2842
+ className: "printable-institution-header__logo",
2843
+ src: wn.logoSrc
2844
+ }),
2845
+ /* @__PURE__ */ o("h1", { children: wn.title }),
2846
+ wn.lines.map((e) => /* @__PURE__ */ o("p", { children: e }, e))
2847
+ ]
2848
+ });
2849
+ }
2850
+ function Dn({ locale: e = "fr", section: t, variant: n }) {
2851
+ let r = qn(e);
2852
+ return /* @__PURE__ */ s("section", {
2853
+ className: `printable-section printable-section--${t.tone}`,
2854
+ "data-variant": n,
2855
+ children: [/* @__PURE__ */ s("header", {
2856
+ className: "printable-section__header",
2857
+ children: [
2858
+ /* @__PURE__ */ s("div", {
2859
+ className: "printable-section__score",
2860
+ children: [/* @__PURE__ */ o("span", {
2861
+ className: "printable-section__points",
2862
+ children: t.points
2863
+ }), /* @__PURE__ */ s("span", {
2864
+ className: "printable-section__obtained",
2865
+ children: [/* @__PURE__ */ o("small", { children: r.obtainedNote }), /* @__PURE__ */ s("strong", { children: [/* @__PURE__ */ o("i", { "aria-hidden": "true" }), /* @__PURE__ */ s("b", { children: ["/ ", t.points] })] })]
2866
+ })]
2867
+ }),
2868
+ /* @__PURE__ */ o("h2", { children: t.title }),
2869
+ /* @__PURE__ */ o("span", {
2870
+ className: "printable-section__badge",
2871
+ children: t.badge
2872
+ })
2873
+ ]
2874
+ }), /* @__PURE__ */ o("div", {
2875
+ className: "printable-section__body",
2876
+ children: t.questions.map((t) => /* @__PURE__ */ o(On, {
2877
+ locale: e,
2878
+ question: t,
2879
+ variant: n
2880
+ }, t.id))
2881
+ })]
2882
+ });
2883
+ }
2884
+ function On({ locale: e = "fr", question: t, variant: n }) {
2885
+ let r = qn(e);
2886
+ return /* @__PURE__ */ s("article", {
2887
+ className: `printable-question printable-question--${t.type}`,
2888
+ children: [/* @__PURE__ */ s("div", {
2889
+ className: "printable-question__prompt",
2890
+ children: [t.number > 0 ? /* @__PURE__ */ o("span", {
2891
+ className: "printable-question__number",
2892
+ children: t.number
2893
+ }) : null, /* @__PURE__ */ o("strong", { children: t.prompt })]
2894
+ }), kn(t, n, r, e)]
2895
+ });
2896
+ }
2897
+ function kn(e, t, n, r) {
2898
+ switch (e.type) {
2899
+ case "inline-inputs":
2900
+ case "equation-inputs": return /* @__PURE__ */ o("div", {
2901
+ className: "printable-equation-grid",
2902
+ children: e.items.map((e) => /* @__PURE__ */ o("div", {
2903
+ className: "printable-equation-card",
2904
+ children: /* @__PURE__ */ o(Wn, { item: e })
2905
+ }, e.id))
2906
+ });
2907
+ case "number-line": return /* @__PURE__ */ s("div", {
2908
+ className: "printable-number-line-layout",
2909
+ children: [/* @__PURE__ */ s("div", {
2910
+ className: "printable-number-line-expression",
2911
+ children: [/* @__PURE__ */ o("span", { children: e.expression }), /* @__PURE__ */ o(Gn, {})]
2912
+ }), /* @__PURE__ */ o(Vn, {})]
2913
+ });
2914
+ case "visual-choice": return /* @__PURE__ */ s("div", {
2915
+ className: "printable-visual-match",
2916
+ children: [/* @__PURE__ */ o(Pn, {
2917
+ choices: e.choices,
2918
+ scene: e.scene ?? en(e.visual)
2919
+ }), e.inputLabel ? /* @__PURE__ */ s("div", {
2920
+ className: "printable-inline-answer",
2921
+ children: [/* @__PURE__ */ o("span", { children: e.inputLabel }), /* @__PURE__ */ o($, {})]
2922
+ }) : null]
2923
+ });
2924
+ case "length-estimation": return /* @__PURE__ */ o("div", {
2925
+ className: "printable-length-task",
2926
+ children: /* @__PURE__ */ o("div", {
2927
+ className: "printable-length-list",
2928
+ children: e.items.map((e) => /* @__PURE__ */ o(Hn, {
2929
+ item: e,
2930
+ squareUnit: Kn(r) ? "مربعات" : "carres",
2931
+ variant: t
2932
+ }, e.id))
2933
+ })
2934
+ });
2935
+ case "shape-choice": return /* @__PURE__ */ s("div", {
2936
+ className: "printable-shape-match",
2937
+ children: [
2938
+ /* @__PURE__ */ o("div", {
2939
+ className: "printable-shape-bank",
2940
+ children: e.choices.map((e) => /* @__PURE__ */ o("div", {
2941
+ className: "printable-shape-card",
2942
+ children: /* @__PURE__ */ o(Me, { shapeId: e.id })
2943
+ }, e.id))
2944
+ }),
2945
+ /* @__PURE__ */ o("div", {
2946
+ className: "printable-shape-labels",
2947
+ children: e.choices.map((e, t) => /* @__PURE__ */ s("div", {
2948
+ className: "printable-choice-chip",
2949
+ children: [/* @__PURE__ */ s("span", { children: [t + 1, "."] }), /* @__PURE__ */ o("strong", { children: e.label })]
2950
+ }, e.id))
2951
+ }),
2952
+ /* @__PURE__ */ o(Nn, { label: n.dragArea })
2953
+ ]
2954
+ });
2955
+ case "drawing-grid": return /* @__PURE__ */ o("div", {
2956
+ className: "printable-drawing-block",
2957
+ children: /* @__PURE__ */ o(Bn, { points: e.points })
2958
+ });
2959
+ case "table-response": return /* @__PURE__ */ o("div", {
2960
+ className: "printable-table-response",
2961
+ children: e.columns.map((e) => /* @__PURE__ */ s("div", {
2962
+ className: "printable-table-column",
2963
+ children: [
2964
+ /* @__PURE__ */ o("strong", { children: e.title }),
2965
+ /* @__PURE__ */ o("div", { className: "printable-table-area" }),
2966
+ /* @__PURE__ */ s("div", {
2967
+ className: "printable-inline-answer",
2968
+ children: [/* @__PURE__ */ o("span", { children: e.answerLabel }), /* @__PURE__ */ o($, {})]
2969
+ })
2970
+ ]
2971
+ }, e.id))
2972
+ });
2973
+ case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ o("p", {
2974
+ className: "printable-statement",
2975
+ children: e.before
2976
+ }) : /* @__PURE__ */ s("div", {
2977
+ className: "printable-inline-answer printable-inline-answer--sentence",
2978
+ children: [
2979
+ e.before ? /* @__PURE__ */ o("span", { children: e.before }) : null,
2980
+ /* @__PURE__ */ o($, {}),
2981
+ e.after ? /* @__PURE__ */ o("span", { children: e.after }) : null
2982
+ ]
2983
+ });
2984
+ case "word-problem": return /* @__PURE__ */ s("div", {
2985
+ className: "printable-word-problem",
2986
+ children: [/* @__PURE__ */ o("p", {
2987
+ className: "printable-statement printable-word-problem__situation",
2988
+ children: e.situation
2989
+ }), /* @__PURE__ */ o("div", {
2990
+ className: "printable-word-problem__parts",
2991
+ children: e.parts.map((e, t) => /* @__PURE__ */ o(Un, {
2992
+ part: e,
2993
+ partNumber: t + 1
2994
+ }, e.id))
2995
+ })]
2996
+ });
2997
+ case "drag-match": return /* @__PURE__ */ o(In, {
2998
+ items: e.items,
2999
+ targets: e.targets
3000
+ });
3001
+ case "sortable-answer": return /* @__PURE__ */ s("div", {
3002
+ className: "printable-sortable",
3003
+ children: [/* @__PURE__ */ o("div", {
3004
+ className: "printable-sortable__bank",
3005
+ children: e.items.map((e) => /* @__PURE__ */ o("span", {
3006
+ className: "printable-choice-chip",
3007
+ children: /* @__PURE__ */ o("strong", { children: e.label })
3008
+ }, e.id))
3009
+ }), /* @__PURE__ */ s("div", {
3010
+ className: "printable-sortable__slots",
3011
+ children: [/* @__PURE__ */ o("strong", { children: n.sortOrder }), e.items.map((e, t) => /* @__PURE__ */ s("div", {
3012
+ className: "printable-sortable__slot",
3013
+ children: [/* @__PURE__ */ s("span", { children: [t + 1, "."] }), /* @__PURE__ */ o($, {})]
3014
+ }, e.id))]
3015
+ })]
3016
+ });
3017
+ case "label-placement": return /* @__PURE__ */ s("div", {
3018
+ className: "printable-label-placement",
3019
+ children: [
3020
+ /* @__PURE__ */ o(zn, { targets: e.targets }),
3021
+ /* @__PURE__ */ o("div", {
3022
+ className: "printable-placement-labels",
3023
+ children: e.labels.map((e) => /* @__PURE__ */ o("span", {
3024
+ className: "printable-choice-chip",
3025
+ children: /* @__PURE__ */ o("strong", { children: e.label })
3026
+ }, e.id))
3027
+ }),
3028
+ /* @__PURE__ */ o(Nn, { label: n.placeLabels })
3029
+ ]
3030
+ });
3031
+ case "audio-recording": return /* @__PURE__ */ s("div", {
3032
+ className: "printable-audio-card",
3033
+ children: [/* @__PURE__ */ o("div", {
3034
+ className: "printable-audio-card__image",
3035
+ children: /* @__PURE__ */ o("img", {
3036
+ alt: e.imageAlt,
3037
+ src: e.imageSrc
3038
+ })
3039
+ }), /* @__PURE__ */ s("div", {
3040
+ className: "printable-audio-card__copy",
3041
+ children: [
3042
+ /* @__PURE__ */ o("span", { children: n.oralAnswer }),
3043
+ /* @__PURE__ */ o("strong", {
3044
+ dir: e.language === "ar" ? "rtl" : "ltr",
3045
+ children: e.expectedAnswer
3046
+ }),
3047
+ /* @__PURE__ */ o("p", { children: e.instruction })
3048
+ ]
3049
+ })]
3050
+ });
3051
+ }
3052
+ }
3053
+ function An({ label: e, value: t }) {
3054
+ return /* @__PURE__ */ s("div", {
3055
+ className: "printable-meta-pill",
3056
+ children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o("strong", { children: t })]
3057
+ });
3058
+ }
3059
+ function jn({ noteLabel: e, totalPoints: t }) {
3060
+ return /* @__PURE__ */ s("div", {
3061
+ className: "printable-note-box",
3062
+ children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ s("strong", { children: [/* @__PURE__ */ o("i", { "aria-hidden": "true" }), /* @__PURE__ */ s("b", { children: ["/ ", t] })] })]
3063
+ });
3064
+ }
3065
+ function Mn(e) {
3066
+ let t = e.sections.filter((e) => e.isScored !== !1).map((e) => Number.parseFloat(e.points.replace(",", "."))).filter((e) => Number.isFinite(e));
3067
+ if (t.length === 0) return "";
3068
+ let n = t.reduce((e, t) => e + t, 0);
3069
+ return String(Number.isInteger(n) ? n : Number(n.toFixed(2)));
3070
+ }
3071
+ function Nn({ label: e }) {
3072
+ return /* @__PURE__ */ s("div", {
3073
+ className: "printable-hint-line",
3074
+ children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o($, {})]
3075
+ });
3076
+ }
3077
+ function Pn({ choices: e, scene: t }) {
3078
+ return /* @__PURE__ */ o("div", {
3079
+ className: "printable-visual-match__preview",
3080
+ children: /* @__PURE__ */ s("div", {
3081
+ className: "visual-line-match printable-visual-line-match",
3082
+ children: [/* @__PURE__ */ s("div", {
3083
+ className: "visual-match-picture printable-visual-match-picture",
3084
+ children: [/* @__PURE__ */ o(nn, { scene: t }), /* @__PURE__ */ o("span", {
3085
+ "aria-hidden": "true",
3086
+ className: "visual-match-point visual-match-point--target printable-match-point printable-match-point--target"
3087
+ })]
3088
+ }), /* @__PURE__ */ o("div", {
3089
+ className: "visual-line-match__answers printable-visual-line-match__answers",
3090
+ children: e.map((e) => /* @__PURE__ */ o(Fn, { choice: e }, e.id))
3091
+ })]
3092
+ })
3093
+ });
3094
+ }
3095
+ function Fn({ choice: e }) {
3096
+ return /* @__PURE__ */ s("div", {
3097
+ className: "visual-match-answer printable-visual-match-answer",
3098
+ children: [/* @__PURE__ */ o("span", {
3099
+ "aria-hidden": "true",
3100
+ className: "visual-match-point visual-match-point--answer printable-match-point printable-match-point--choice"
3101
+ }), /* @__PURE__ */ o("div", {
3102
+ className: "printable-choice-chip printable-choice-chip--visual",
3103
+ children: /* @__PURE__ */ o("strong", { children: e.label })
3104
+ })]
3105
+ });
3106
+ }
3107
+ function In({ items: e, targets: t }) {
3108
+ return /* @__PURE__ */ s("div", {
3109
+ className: "printable-drag-match-board",
3110
+ children: [
3111
+ /* @__PURE__ */ o("div", {
3112
+ className: "printable-drag-match-column printable-drag-match-column--targets",
3113
+ children: t.map((e, t) => /* @__PURE__ */ o(Ln, {
3114
+ index: t,
3115
+ target: e
3116
+ }, e.id))
3117
+ }),
3118
+ /* @__PURE__ */ o("div", {
3119
+ "aria-hidden": "true",
3120
+ className: "printable-drag-match-lane",
3121
+ children: Array.from({ length: Math.max(e.length, t.length) }).map((e, t) => /* @__PURE__ */ o("span", { className: "printable-drag-match-guide" }, t))
3122
+ }),
3123
+ /* @__PURE__ */ o("div", {
3124
+ className: "printable-drag-match-column printable-drag-match-column--answers",
3125
+ children: e.map((e, t) => /* @__PURE__ */ o(Rn, {
3126
+ index: t,
3127
+ item: e
3128
+ }, e.id))
3129
+ })
3130
+ ]
3131
+ });
3132
+ }
3133
+ function Ln({ index: e, target: t }) {
3134
+ return /* @__PURE__ */ s("div", {
3135
+ className: "printable-drag-match-card printable-drag-match-card--target",
3136
+ children: [
3137
+ /* @__PURE__ */ o("span", {
3138
+ className: "printable-drag-match-index",
3139
+ children: String.fromCharCode(65 + e)
3140
+ }),
3141
+ /* @__PURE__ */ o("div", {
3142
+ className: "printable-drag-match-content",
3143
+ children: t.shapeId ? /* @__PURE__ */ o(Me, { shapeId: t.shapeId }) : /* @__PURE__ */ o("strong", { children: t.label })
3144
+ }),
3145
+ /* @__PURE__ */ o("span", {
3146
+ "aria-hidden": "true",
3147
+ className: "printable-match-point printable-drag-match-dot printable-drag-match-dot--target"
3148
+ })
3149
+ ]
3150
+ });
3151
+ }
3152
+ function Rn({ index: e, item: t }) {
3153
+ return /* @__PURE__ */ s("div", {
3154
+ className: "printable-drag-match-card printable-drag-match-card--answer",
3155
+ children: [
3156
+ /* @__PURE__ */ o("span", {
3157
+ "aria-hidden": "true",
3158
+ className: "printable-match-point printable-drag-match-dot printable-drag-match-dot--answer"
3159
+ }),
3160
+ /* @__PURE__ */ o("div", {
3161
+ className: "printable-drag-match-content",
3162
+ children: /* @__PURE__ */ o("strong", { children: t.label })
3163
+ }),
3164
+ /* @__PURE__ */ o("span", {
3165
+ className: "printable-drag-match-index",
3166
+ children: e + 1
3167
+ })
3168
+ ]
3169
+ });
3170
+ }
3171
+ function zn({ targets: e }) {
3172
+ return /* @__PURE__ */ o("div", {
3173
+ className: "printable-placement-board",
3174
+ children: e.map((e, t) => /* @__PURE__ */ o("div", {
3175
+ className: "printable-placement-target",
3176
+ style: {
3177
+ left: `${e.x}%`,
3178
+ top: `${e.y}%`
3179
+ },
3180
+ children: /* @__PURE__ */ o("span", { children: e.label || String(t + 1) })
3181
+ }, e.id))
3182
+ });
3183
+ }
3184
+ function Bn({ points: e }) {
3185
+ return /* @__PURE__ */ s("svg", {
3186
+ className: "printable-drawing-grid",
3187
+ viewBox: "0 0 1000 420",
3188
+ children: [
3189
+ Array.from({ length: 34 }, (e, t) => /* @__PURE__ */ o("line", {
3190
+ className: "printable-drawing-grid__line",
3191
+ x1: t * 30,
3192
+ x2: t * 30,
3193
+ y1: "0",
3194
+ y2: 420
3195
+ }, `vx-${t}`)),
3196
+ Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ o("line", {
3197
+ className: "printable-drawing-grid__line",
3198
+ x1: "0",
3199
+ x2: "1000",
3200
+ y1: t * 30,
3201
+ y2: t * 30
3202
+ }, `hy-${t}`)),
3203
+ e.map((e, t) => e.hidden ? null : /* @__PURE__ */ s("g", {
3204
+ className: "printable-drawing-grid__point",
3205
+ transform: `translate(${e.x / 100 * 1e3} ${e.y / 100 * 420})`,
3206
+ children: [/* @__PURE__ */ o("circle", { r: "6" }), /* @__PURE__ */ o("text", {
3207
+ x: "12",
3208
+ y: "-10",
3209
+ children: e.label?.trim() || String(t + 1)
3210
+ })]
3211
+ }, e.id))
3212
+ ]
3213
+ });
3214
+ }
3215
+ function Vn() {
3216
+ return /* @__PURE__ */ s("svg", {
3217
+ className: "printable-number-line",
3218
+ viewBox: "0 0 420 90",
3219
+ children: [/* @__PURE__ */ o("line", {
3220
+ x1: "20",
3221
+ x2: "400",
3222
+ y1: "35",
3223
+ y2: "35"
3224
+ }), Array.from({ length: 11 }, (e, t) => /* @__PURE__ */ s("g", {
3225
+ transform: `translate(${20 + t * 38} 0)`,
3226
+ children: [/* @__PURE__ */ o("line", {
3227
+ x1: "0",
3228
+ x2: "0",
3229
+ y1: "24",
3230
+ y2: "46"
3231
+ }), /* @__PURE__ */ o("text", {
3232
+ x: "0",
3233
+ y: "70",
3234
+ children: t
3235
+ })]
3236
+ }, t))]
3237
+ });
3238
+ }
3239
+ function Hn({ item: e, squareUnit: t, variant: n }) {
3240
+ return /* @__PURE__ */ s("div", {
3241
+ className: "length-card printable-length-card",
3242
+ children: [/* @__PURE__ */ o("div", {
3243
+ className: "square-measure-strip printable-square-measure-strip",
3244
+ style: { "--measure-squares": e.squareLength + 2 },
3245
+ children: /* @__PURE__ */ s("span", {
3246
+ "aria-hidden": "true",
3247
+ className: "printable-length-pencil",
3248
+ "data-variant": n,
3249
+ style: {
3250
+ "--pencil-squares": e.squareLength,
3251
+ "--pencil-start-square": 1
3252
+ },
3253
+ children: [
3254
+ /* @__PURE__ */ o("span", {
3255
+ className: "printable-length-pencil__tip",
3256
+ children: /* @__PURE__ */ o("span", { className: "printable-length-pencil__lead" })
3257
+ }),
3258
+ /* @__PURE__ */ o("span", { className: "printable-length-pencil__body" }),
3259
+ /* @__PURE__ */ o("span", { className: "printable-length-pencil__ferrule" }),
3260
+ /* @__PURE__ */ o("span", { className: "printable-length-pencil__eraser" }),
3261
+ /* @__PURE__ */ o("span", { className: "printable-length-pencil__shine" })
3262
+ ]
3263
+ })
3264
+ }), /* @__PURE__ */ s("div", {
3265
+ className: "length-value-row printable-length-value-row",
3266
+ children: [
3267
+ /* @__PURE__ */ o("span", { children: e.label }),
3268
+ /* @__PURE__ */ o(Gn, {}),
3269
+ /* @__PURE__ */ o("span", { children: t })
3270
+ ]
3271
+ })]
3272
+ });
3273
+ }
3274
+ function Un({ part: e, partNumber: t }) {
3275
+ return /* @__PURE__ */ s("section", {
3276
+ className: "printable-word-problem__part",
3277
+ children: [/* @__PURE__ */ s("div", {
3278
+ className: "printable-word-problem__part-prompt",
3279
+ children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o("strong", { children: e.prompt })]
3280
+ }), e.type === "coin-table" ? /* @__PURE__ */ o("div", {
3281
+ className: "printable-table-response printable-word-problem__table",
3282
+ children: e.columns.map((e) => /* @__PURE__ */ s("div", {
3283
+ className: "printable-table-column",
3284
+ children: [
3285
+ /* @__PURE__ */ o("strong", { children: e.title }),
3286
+ /* @__PURE__ */ o("div", { className: "printable-table-area" }),
3287
+ /* @__PURE__ */ s("div", {
3288
+ className: "printable-inline-answer",
3289
+ children: [/* @__PURE__ */ o("span", { children: e.answerLabel }), /* @__PURE__ */ o($, {})]
3290
+ })
3291
+ ]
3292
+ }, e.id))
3293
+ }) : /* @__PURE__ */ s("div", {
3294
+ className: "printable-inline-answer printable-inline-answer--sentence",
3295
+ children: [
3296
+ e.before ? /* @__PURE__ */ o("span", { children: e.before }) : null,
3297
+ /* @__PURE__ */ o($, {}),
3298
+ e.after ? /* @__PURE__ */ o("span", { children: e.after }) : null
3299
+ ]
3300
+ })]
3301
+ });
3302
+ }
3303
+ function Wn({ item: t }) {
3304
+ return t.answers?.length ? /* @__PURE__ */ s(a, { children: [t.answers.map((t) => /* @__PURE__ */ s(e, { children: [t.before ? /* @__PURE__ */ o("span", { children: t.before }) : null, /* @__PURE__ */ o(Gn, {})] }, t.id)), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] }) : t.correctAnswer ? /* @__PURE__ */ s(a, { children: [
3305
+ /* @__PURE__ */ o("span", { children: t.before }),
3306
+ /* @__PURE__ */ o(Gn, {}),
3307
+ t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null
3308
+ ] }) : /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", { children: t.before }), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] });
3309
+ }
3310
+ function $() {
3311
+ return /* @__PURE__ */ o("span", {
3312
+ className: "printable-blank-line",
3313
+ "aria-hidden": "true"
3314
+ });
3315
+ }
3316
+ function Gn() {
3317
+ return /* @__PURE__ */ o("span", {
3318
+ className: "printable-blank-box",
3319
+ "aria-hidden": "true"
3320
+ });
3321
+ }
3322
+ function Kn(e) {
3323
+ return e.startsWith("ar");
3324
+ }
3325
+ function qn(e) {
3326
+ return Kn(e) ? {
3327
+ answerArea: "مساحة الجواب",
3328
+ countShort: "عدد",
3329
+ dragArea: "اربط أو اكتب الجواب",
3330
+ duration: "المدة",
3331
+ level: "المستوى",
3332
+ model: "النموذج",
3333
+ obtainedNote: "النقطة المحصل عليها",
3334
+ oralAnswer: "الإجابة الشفوية",
3335
+ phase: "المرحلة",
3336
+ placeLabels: "ضع التسميات في أماكنها",
3337
+ sortOrder: "رتب العناصر",
3338
+ totalPoints: "المجموع",
3339
+ traceArea: "مساحة الرسم",
3340
+ targets: "الأهداف",
3341
+ writeAnswer: "اكتب الجواب"
3342
+ } : {
3343
+ answerArea: "Zone de reponse",
3344
+ countShort: "Nb.",
3345
+ dragArea: "Relier ou ecrire la reponse",
3346
+ duration: "Duree",
3347
+ level: "Niveau",
3348
+ model: "Modele",
3349
+ obtainedNote: "Note obtenue",
3350
+ oralAnswer: "Reponse orale",
3351
+ phase: "Phase",
3352
+ placeLabels: "Placer les etiquettes",
3353
+ sortOrder: "Classer les elements",
3354
+ subject: "Matiere",
3355
+ totalPoints: "Total",
3356
+ traceArea: "Zone de trace",
3357
+ targets: "Cibles",
3358
+ writeAnswer: "Ecrire la reponse"
3359
+ };
3360
+ }
3361
+ //#endregion
2531
3362
  //#region src/exam-session/interactions/DraftSheet.tsx
2532
- function Kt({ disabled: e, onChange: t, value: n }) {
2533
- let [i, s] = r(!1);
2534
- return /* @__PURE__ */ a("aside", {
3363
+ function Jn({ disabled: e, onChange: t, value: n }) {
3364
+ let [r, a] = i(!1);
3365
+ return /* @__PURE__ */ o("aside", {
2535
3366
  className: "draft-sheet",
2536
3367
  "data-disabled": e ? "true" : "false",
2537
- "data-open": i ? "true" : "false",
3368
+ "data-open": r ? "true" : "false",
2538
3369
  dir: "rtl",
2539
- children: i ? /* @__PURE__ */ o("div", {
3370
+ children: r ? /* @__PURE__ */ s("div", {
2540
3371
  className: "draft-sheet__panel",
2541
3372
  "aria-label": "ورقة وساخ",
2542
- children: [/* @__PURE__ */ o("header", {
3373
+ children: [/* @__PURE__ */ s("header", {
2543
3374
  className: "draft-sheet__header",
2544
- children: [/* @__PURE__ */ a("strong", { children: "ورقة وساخ" }), /* @__PURE__ */ a("button", {
2545
- onClick: () => s(!1),
3375
+ children: [/* @__PURE__ */ o("strong", { children: "ورقة وساخ" }), /* @__PURE__ */ o("button", {
3376
+ onClick: () => a(!1),
2546
3377
  type: "button",
2547
3378
  children: "إِغْلاقٌ"
2548
3379
  })]
2549
- }), /* @__PURE__ */ a(je, {
3380
+ }), /* @__PURE__ */ o(Ze, {
2550
3381
  actionLabel: "مساحة ورقة وساخ",
2551
3382
  canvasHeight: 430,
2552
3383
  disabled: e,
@@ -2554,25 +3385,25 @@ function Kt({ disabled: e, onChange: t, value: n }) {
2554
3385
  value: n,
2555
3386
  variant: "draft"
2556
3387
  })]
2557
- }) : /* @__PURE__ */ o("button", {
3388
+ }) : /* @__PURE__ */ s("button", {
2558
3389
  className: "draft-sheet__toggle",
2559
3390
  disabled: e,
2560
- onClick: () => s(!0),
3391
+ onClick: () => a(!0),
2561
3392
  type: "button",
2562
- children: [/* @__PURE__ */ a(p, { "aria-hidden": "true" }), /* @__PURE__ */ a("span", { children: "ورقة وساخ" })]
3393
+ children: [/* @__PURE__ */ o(b, { "aria-hidden": "true" }), /* @__PURE__ */ o("span", { children: "ورقة وساخ" })]
2563
3394
  })
2564
3395
  });
2565
3396
  }
2566
3397
  //#endregion
2567
3398
  //#region src/exam-session/interactions/SingleChoice.tsx
2568
- function qt({ answerId: e, choices: t, value: n, onChange: r }) {
2569
- return /* @__PURE__ */ a("div", {
3399
+ function Yn({ answerId: e, choices: t, value: n, onChange: r }) {
3400
+ return /* @__PURE__ */ o("div", {
2570
3401
  className: "choice-group",
2571
3402
  role: "radiogroup",
2572
3403
  "aria-label": `اِخْتِياراتُ الإِجابَةِ ${e}`,
2573
3404
  children: t.map((e) => {
2574
3405
  let t = /[0-9+\-=]/.test(e.label);
2575
- return /* @__PURE__ */ a("button", {
3406
+ return /* @__PURE__ */ o("button", {
2576
3407
  "aria-checked": n?.choiceId === e.id,
2577
3408
  className: n?.choiceId === e.id ? "answer-chip answer-chip--selected" : "answer-chip",
2578
3409
  onClick: () => r({
@@ -2581,7 +3412,7 @@ function qt({ answerId: e, choices: t, value: n, onChange: r }) {
2581
3412
  }),
2582
3413
  role: "radio",
2583
3414
  type: "button",
2584
- children: /* @__PURE__ */ a("span", {
3415
+ children: /* @__PURE__ */ o("span", {
2585
3416
  className: t ? "answer-chip__label answer-chip__label--math" : "answer-chip__label",
2586
3417
  children: e.label
2587
3418
  })
@@ -2590,4 +3421,4 @@ function qt({ answerId: e, choices: t, value: n, onChange: r }) {
2590
3421
  });
2591
3422
  }
2592
3423
  //#endregion
2593
- export { pe as CoinTableResponse, ye as ColorPenPicker, J as DEFAULT_GEOMETRY_COLORS, lt as DEFAULT_NATIVE_VOICE_AI_CONFIG, Kt as DraftSheet, me as DragMatch, Ot as ExamSectionRenderer, je as GeometryCanvas, q as HandwrittenNumberAnswer, rt as KonvaDrawingGrid, it as LabelPlacement, st as NumberLineAnswer, gt as PronunciationRecorder, Gt as QuestionPreviewPanel, Dt as QuestionRenderer, qt as SingleChoice, wt as SortableAnswer, Et as TextAnswer, j as calculateExamResult, ut as evaluateVoiceAiResult, Se as getColorValue, xe as getDefaultColorId, Ce as mapChoicesToGeometryColors, dt as normalizeVoiceText };
3424
+ export { De as CoinTableResponse, ze as ColorPenPicker, K as DEFAULT_GEOMETRY_COLORS, At as DEFAULT_NATIVE_VOICE_AI_CONFIG, Jn as DraftSheet, Ne as DragMatch, on as ExamSectionRenderer, Ze as GeometryCanvas, G as HandwrittenNumberAnswer, wt as KonvaDrawingGrid, Tt as LabelPlacement, Ot as NumberLineAnswer, Tn as PrintableExamDocument, On as PrintableQuestionRenderer, Dn as PrintableSectionRenderer, Lt as PronunciationRecorder, Cn as QuestionPreviewPanel, an as QuestionRenderer, Me as ShapeGlyph, Yn as SingleChoice, Gt as SortableAnswer, qt as TextAnswer, nn as VisualSceneGraphic, ie as calculateExamResult, en as createVisualSceneFromVariant, jt as evaluateVoiceAiResult, Ae as examShapeOptions, He as getColorValue, Ve as getDefaultColorId, je as getExamShapeLabel, tn as getVisualSceneColorValue, Ue as mapChoicesToGeometryColors, Mt as normalizeVoiceText, Qt as visualSceneColorOptions, Zt as visualSceneIconOptions, $t as visualSceneStateOptions };