hyperbook 0.113.0 → 0.113.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +18 -3
  2. package/dist/asset-manifest.json +9 -9
  3. package/dist/assets/directive-bitflow/{EditorElement-zyz99U6n.js → EditorElement-CE3Yr86b.js} +155 -155
  4. package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-eYGRtw6N.js} +1 -1
  5. package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-CxvZkGrY.js} +1138 -1073
  6. package/dist/assets/directive-bitflow/editor.js +3 -3
  7. package/dist/assets/directive-bitflow/flow.js +3 -3
  8. package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-88c3K20U.js} +31 -31
  9. package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-B61LKxr1.js} +45 -45
  10. package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BG0PL-Z6.js} +30 -30
  11. package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-BNdpL6Ss.js} +78 -78
  12. package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-BO-d4HVC.js} +48 -48
  13. package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-BZhNY0lo.js} +12 -12
  14. package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-BadyFTU5.js} +8 -8
  15. package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-BlT1EcFH.js} +34 -34
  16. package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-BuQ-K_tR.js} +7 -7
  17. package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-Bw0pL0hW.js} +28 -28
  18. package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-BwBVUdJ9.js} +94 -94
  19. package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-BydYlLy4.js} +73 -73
  20. package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-C7RJxxAx.js} +63 -63
  21. package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-CERSJ9uS.js} +70 -70
  22. package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-CLHtOGrW.js} +11 -11
  23. package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-CWe2GjBK.js} +14 -14
  24. package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CfKpkSVC.js} +72 -72
  25. package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-CjKhq7gY.js} +23 -23
  26. package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-Cm4w1Zyc.js} +38 -38
  27. package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-D0U3nepG.js} +52 -52
  28. package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-D4PdXMcj.js} +33 -33
  29. package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-D9LOuqr2.js} +99 -99
  30. package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-DIb3CXwC.js} +42 -42
  31. package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-DQP0cUsP.js} +70 -70
  32. package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-DUOrQfVe.js} +27 -27
  33. package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DW3cUBvZ.js} +1 -1
  34. package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-DYWo0PUv.js} +24 -24
  35. package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-D_QhyFcx.js} +101 -91
  36. package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-Dn5hHVuT.js} +226 -193
  37. package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-DruC5d43.js} +69 -69
  38. package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-EKIgFddO.js} +105 -105
  39. package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-HXNGIC7K.js} +70 -70
  40. package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-ISbOe239.js} +42 -42
  41. package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-IsMJtrUT.js} +31 -31
  42. package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-TUXuIR22.js} +6 -6
  43. package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-WbE9UOFa.js} +24 -24
  44. package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-d5ebPDeY.js} +13 -13
  45. package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-ledofrbo.js} +33 -33
  46. package/dist/assets/directive-bitflow/{index-BseSaQlX.js → index-oNmOArKu.js} +1 -1
  47. package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-rp4UTV85.js} +84 -84
  48. package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-xTX3CXJW.js} +23 -23
  49. package/dist/assets/directive-bitflow/index.js +6 -6
  50. package/dist/assets/directive-bitflow/katex-DSLAjWZH-CHGN3Pr6.js +11314 -0
  51. package/dist/assets/directive-bitflow/katex-Dv-tcU2S-Dv-tcU2S.js +4 -0
  52. package/dist/assets/directive-bitflow/report.js +1 -1
  53. package/dist/assets/directive-bitflow/{shareableReport-ArQU1XjG.js → shareableReport-vjEU4OvA.js} +2 -2
  54. package/dist/index.js +6351 -3340
  55. package/dist/schemas/hyperbook.schema.json +4 -4
  56. package/package.json +5 -5
@@ -1,12 +1,12 @@
1
1
  import { L as V, ak as Fe, P as M, a2 as E, a as L, j as t, a5 as Me, aj as $e, ac as Ee, ad as ve, a9 as De, a4 as ue, b as D, aa as Pe, s as Re } from "./dom-uYx_3K1r.js";
2
- import { v as We, y as ke, A as z, t as G, e as Oe, P as Ve, M as Ke, E as Ie, s as Ge, L as Ze, R as qe } from "./bitLoaders-DIGwTcpd.js";
3
- const B = (e, o) => {
2
+ import { e as We, C as ke, g as z, r as B, P as Oe, M as Ve, F as Ke, B as Ie, y as Be, U as Ge, H as Ze } from "./bitLoaders-CxvZkGrY.js";
3
+ const q = (e, o) => {
4
4
  const l = $e(e, { variables: { x: o } });
5
5
  return l.ok ? l.rest !== "" ? { ok: !1, error: "trailing" } : { ok: !0, value: l.value } : { ok: !1, error: l.error };
6
6
  }, ee = (e) => (o) => {
7
- const l = B(e, o);
7
+ const l = q(e, o);
8
8
  return l.ok ? l.value : NaN;
9
- }, Be = {
9
+ }, qe = {
10
10
  empty: "Enter a function of x, like “0.5x^2 - 2”.",
11
11
  tooLong: "That is too long to be a function of x.",
12
12
  syntax: "That is not arithmetic the task can work out. It accepts + − × ÷ ^, sqrt, sin, cos, exp, ln, abs, pi, e, and x.",
@@ -19,20 +19,20 @@ const B = (e, o) => {
19
19
  expressionNotAllowed: "Enter a valid function of x.",
20
20
  notFinite: "That is not a finite number at every handle — check for something like dividing by zero or the square root of a negative number.",
21
21
  trailing: "There is text left over after the function — check for a stray character."
22
- }, fe = (e) => Be[e], H = (e) => String(e), Ye = 1e-9, ne = (e, o) => {
22
+ }, fe = (e) => qe[e], H = (e) => String(e), Ue = 1e-9, ne = (e, o) => {
23
23
  const l = ee(e.target), r = {};
24
24
  for (const a of e.handles) {
25
25
  const i = o?.values?.[H(a)];
26
- r[H(a)] = i !== void 0 && Number.isFinite(i) && Math.abs(i - l(a)) <= e.tolerance + Ye ? "correct" : "wrong";
26
+ r[H(a)] = i !== void 0 && Number.isFinite(i) && Math.abs(i - l(a)) <= e.tolerance + Ue ? "correct" : "wrong";
27
27
  }
28
28
  return r;
29
- }, _e = (e, o) => {
29
+ }, Ye = (e, o) => {
30
30
  const l = Object.values(ne(e, o));
31
31
  return {
32
32
  earned: l.filter((r) => r === "correct").length,
33
33
  possible: l.length
34
34
  };
35
- }, Ue = (e, o) => {
35
+ }, _e = (e, o) => {
36
36
  const l = Object.values(ne(e, o));
37
37
  return l.length > 0 && l.every((r) => r === "correct");
38
38
  }, Je = ({
@@ -41,14 +41,14 @@ const B = (e, o) => {
41
41
  }) => {
42
42
  if (e.evaluation.mode === "skip")
43
43
  return { state: "unknown", allowRetry: !1 };
44
- const l = Ue(e, o), r = _e(e, o), a = e.partialCredit && r.possible > 0 ? r : { earned: l ? 1 : 0, possible: 1 };
44
+ const l = _e(e, o), r = Ye(e, o), a = e.partialCredit && r.possible > 0 ? r : { earned: l ? 1 : 0, possible: 1 };
45
45
  return {
46
46
  state: l ? "correct" : "wrong",
47
47
  score: a,
48
48
  allowRetry: e.evaluation.enableRetry,
49
49
  detail: { handles: ne(e, o) }
50
50
  };
51
- }, ye = 1e3, q = 640, h = { top: 24, right: 24, bottom: 100, left: 128 }, T = ye - h.left - h.right, j = q - h.top - h.bottom, K = (e) => e.max - e.min || 1, A = (e, o) => h.left + (o - e.min) / K(e) * T, C = (e, o) => h.top + j - (o - e.min) / K(e) * j, xt = (e, o) => e.min + (o - h.left) / T * K(e), Xe = (e, o) => e.min + (h.top + j - o) / j * K(e), $ = (e) => Math.round(e * 1e9) / 1e9, de = (e) => {
51
+ }, ye = 1e3, Z = 640, h = { top: 24, right: 24, bottom: 100, left: 128 }, A = ye - h.left - h.right, j = Z - h.top - h.bottom, K = (e) => e.max - e.min || 1, C = (e, o) => h.left + (o - e.min) / K(e) * A, T = (e, o) => h.top + j - (o - e.min) / K(e) * j, xt = (e, o) => e.min + (o - h.left) / A * K(e), Xe = (e, o) => e.min + (h.top + j - o) / j * K(e), $ = (e) => Math.round(e * 1e9) / 1e9, de = (e) => {
52
52
  const o = e.step > 0 ? e.step : K(e), l = Math.max(0, Math.round((e.max - e.min) / o));
53
53
  return Array.from({ length: l + 1 }, (r, a) => $(e.min + a * o));
54
54
  }, he = (e, o, l) => {
@@ -176,7 +176,7 @@ const B = (e, o) => {
176
176
  }), i.mode !== "auto") return;
177
177
  let b = !1, g = !1;
178
178
  for (const d of l) {
179
- const u = B(r, d);
179
+ const u = q(r, d);
180
180
  if (!u.ok) {
181
181
  b || (b = !0, e.issues.push({
182
182
  code: "custom",
@@ -195,7 +195,7 @@ const B = (e, o) => {
195
195
  }
196
196
  a.forEach((d, u) => {
197
197
  for (const x of l) {
198
- const y = B(d.expression, x);
198
+ const y = q(d.expression, x);
199
199
  if (!y.ok) {
200
200
  e.issues.push({
201
201
  code: "custom",
@@ -345,34 +345,34 @@ const B = (e, o) => {
345
345
  onSet: i,
346
346
  revealTarget: b
347
347
  }) => {
348
- const g = (n, f) => D(O, n, r, f), d = L.useRef(null), u = ct(d), x = L.useRef(null), [, y] = L.useReducer((n) => n + 1, 0), [S, s] = L.useState(""), c = !!i && !a, k = o?.values ?? {}, m = e.axes.x, p = e.axes.y, oe = de(m), le = de(p), Y = b ?? !!l, _ = (n) => {
348
+ const g = (n, f) => D(O, n, r, f), d = L.useRef(null), u = ct(d), x = L.useRef(null), [, y] = L.useReducer((n) => n + 1, 0), [S, s] = L.useState(""), c = !!i && !a, k = o?.values ?? {}, m = e.axes.x, p = e.axes.y, oe = de(m), le = de(p), U = b ?? !!l, Y = (n) => {
349
349
  const f = d.current?.getBoundingClientRect();
350
350
  if (!f || f.height === 0) return null;
351
- const w = (n - f.top) / f.height * q;
351
+ const w = (n - f.top) / f.height * Z;
352
352
  return Xe(p, w);
353
- }, U = (n, f) => {
353
+ }, _ = (n, f) => {
354
354
  i && (i(n, f), s(
355
355
  g("handleSet", { x: N(n), y: N(f) })
356
356
  ));
357
- }, Ae = (n, f) => {
357
+ }, Ce = (n, f) => {
358
358
  if (!c || n.button !== 0) return;
359
- const w = _(n.clientY);
359
+ const w = Y(n.clientY);
360
360
  w !== null && (x.current = { x: f, value: W(p, w, e.snap) }, y());
361
361
  };
362
- Ge((n) => {
362
+ Be((n) => {
363
363
  const f = x.current;
364
364
  if (!f) return;
365
- const w = _(n.clientY);
365
+ const w = Y(n.clientY);
366
366
  w !== null && (x.current = { x: f.x, value: W(p, w, e.snap) }, y());
367
367
  }, () => {
368
368
  const n = x.current;
369
- n && (x.current = null, y(), U(n.x, n.value));
369
+ n && (x.current = null, y(), _(n.x, n.value));
370
370
  });
371
- const Ce = (n, f) => {
371
+ const Te = (n, f) => {
372
372
  if (!c) return;
373
- const w = _(n.clientY);
374
- w !== null && U(f, W(p, w, e.snap));
375
- }, Te = (n, f, w) => {
373
+ const w = Y(n.clientY);
374
+ w !== null && _(f, W(p, w, e.snap));
375
+ }, Ae = (n, f, w) => {
376
376
  if (!c) return;
377
377
  let v;
378
378
  switch (n.key) {
@@ -397,37 +397,37 @@ const B = (e, o) => {
397
397
  default:
398
398
  return;
399
399
  }
400
- n.preventDefault(), U(f, W(p, v, e.snap));
400
+ n.preventDefault(), _(f, W(p, v, e.snap));
401
401
  }, ie = (() => {
402
402
  const n = [...e.handles].sort((v, J) => v - J);
403
403
  let f = m.max - m.min;
404
404
  for (let v = 1; v < n.length; v++)
405
405
  f = Math.min(f, n[v] - n[v - 1]);
406
- const w = f / (m.max - m.min || 1) * T;
406
+ const w = f / (m.max - m.min || 1) * A;
407
407
  return Math.min(70, Math.max(10, w / 2));
408
408
  })(), se = [...e.handles].sort((n, f) => n - f).map((n) => ({ x: n, value: x.current?.x === n ? x.current.value : k[H(n)] })).filter((n) => n.value !== void 0), re = e.shown.filter((n) => n.expression.trim() !== "").map((n, f) => ({
409
409
  ...n,
410
410
  color: ge[f % ge.length],
411
411
  segments: we(ee(n.expression), m, p)
412
- })), ze = Y ? we(ee(e.target), m, p) : [], ce = (n) => n.map((f) => `${A(m, f.x)},${C(p, f.y)}`).join(" ");
412
+ })), ze = U ? we(ee(e.target), m, p) : [], ce = (n) => n.map((f) => `${C(m, f.x)},${T(p, f.y)}`).join(" ");
413
413
  return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-function-plot", children: [
414
414
  /* @__PURE__ */ t.jsxs(
415
415
  "svg",
416
416
  {
417
417
  ref: d,
418
418
  className: "bitflow-function-plot-diagram",
419
- viewBox: `0 0 ${ye} ${q}`,
419
+ viewBox: `0 0 ${ye} ${Z}`,
420
420
  role: "group",
421
421
  "aria-label": g("diagramLabel"),
422
422
  style: { "--bitflow-function-plot-scale": u },
423
423
  children: [
424
- /* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("clipPath", { id: "function-plot-clip", children: /* @__PURE__ */ t.jsx("rect", { x: h.left, y: h.top, width: T, height: j }) }) }),
424
+ /* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("clipPath", { id: "function-plot-clip", children: /* @__PURE__ */ t.jsx("rect", { x: h.left, y: h.top, width: A, height: j }) }) }),
425
425
  /* @__PURE__ */ t.jsxs("g", { className: "bitflow-function-plot-grid", children: [
426
426
  oe.map((n) => /* @__PURE__ */ t.jsx(
427
427
  "line",
428
428
  {
429
- x1: A(m, n),
430
- x2: A(m, n),
429
+ x1: C(m, n),
430
+ x2: C(m, n),
431
431
  y1: h.top,
432
432
  y2: h.top + j
433
433
  },
@@ -436,10 +436,10 @@ const B = (e, o) => {
436
436
  le.map((n) => /* @__PURE__ */ t.jsx(
437
437
  "line",
438
438
  {
439
- y1: C(p, n),
440
- y2: C(p, n),
439
+ y1: T(p, n),
440
+ y2: T(p, n),
441
441
  x1: h.left,
442
- x2: h.left + T
442
+ x2: h.left + A
443
443
  },
444
444
  `y${n}`
445
445
  ))
@@ -449,7 +449,7 @@ const B = (e, o) => {
449
449
  "line",
450
450
  {
451
451
  x1: h.left,
452
- x2: h.left + T,
452
+ x2: h.left + A,
453
453
  y1: h.top + j,
454
454
  y2: h.top + j
455
455
  }
@@ -467,8 +467,8 @@ const B = (e, o) => {
467
467
  "line",
468
468
  {
469
469
  className: "bitflow-function-plot-zero",
470
- x1: A(m, 0),
471
- x2: A(m, 0),
470
+ x1: C(m, 0),
471
+ x2: C(m, 0),
472
472
  y1: h.top,
473
473
  y2: h.top + j
474
474
  }
@@ -478,9 +478,9 @@ const B = (e, o) => {
478
478
  {
479
479
  className: "bitflow-function-plot-zero",
480
480
  x1: h.left,
481
- x2: h.left + T,
482
- y1: C(p, 0),
483
- y2: C(p, 0)
481
+ x2: h.left + A,
482
+ y1: T(p, 0),
483
+ y2: T(p, 0)
484
484
  }
485
485
  )
486
486
  ] }),
@@ -488,7 +488,7 @@ const B = (e, o) => {
488
488
  he(oe, m.step, 11).map((n) => /* @__PURE__ */ t.jsx(
489
489
  "text",
490
490
  {
491
- x: A(m, n),
491
+ x: C(m, n),
492
492
  y: h.top + j + 8 + 22 * u,
493
493
  textAnchor: "middle",
494
494
  children: N(n)
@@ -499,7 +499,7 @@ const B = (e, o) => {
499
499
  "text",
500
500
  {
501
501
  x: h.left - 10,
502
- y: C(p, n),
502
+ y: T(p, n),
503
503
  textAnchor: "end",
504
504
  dominantBaseline: "middle",
505
505
  children: N(n)
@@ -511,8 +511,8 @@ const B = (e, o) => {
511
511
  "text",
512
512
  {
513
513
  className: "bitflow-function-plot-axis-label",
514
- x: h.left + T / 2,
515
- y: q - 10,
514
+ x: h.left + A / 2,
515
+ y: Z - 10,
516
516
  textAnchor: "middle",
517
517
  children: m.label
518
518
  }
@@ -555,11 +555,11 @@ const B = (e, o) => {
555
555
  "polyline",
556
556
  {
557
557
  className: "bitflow-function-plot-sketch",
558
- points: se.map((n) => `${A(m, n.x)},${C(p, n.value)}`).join(" ")
558
+ points: se.map((n) => `${C(m, n.x)},${T(p, n.value)}`).join(" ")
559
559
  }
560
560
  ),
561
561
  e.handles.map((n) => {
562
- const f = H(n), w = x.current?.x === n, v = k[f], J = w || v !== void 0, P = w ? x.current.value : v ?? je(p), F = l?.[f], I = A(m, n), He = C(p, P), X = ["bitflow-function-plot-knob"];
562
+ const f = H(n), w = x.current?.x === n, v = k[f], J = w || v !== void 0, P = w ? x.current.value : v ?? je(p), F = l?.[f], I = C(m, n), He = T(p, P), X = ["bitflow-function-plot-knob"];
563
563
  return F ? X.push(`bitflow-function-plot-knob-${F}`) : J && X.push("bitflow-function-plot-knob-set"), /* @__PURE__ */ t.jsxs("g", { children: [
564
564
  /* @__PURE__ */ t.jsx(
565
565
  "line",
@@ -579,7 +579,7 @@ const B = (e, o) => {
579
579
  width: ie * 2,
580
580
  y: h.top,
581
581
  height: j,
582
- onClick: (R) => Ce(R, n)
582
+ onClick: (R) => Te(R, n)
583
583
  }
584
584
  ),
585
585
  /* @__PURE__ */ t.jsxs(
@@ -595,8 +595,8 @@ const B = (e, o) => {
595
595
  "aria-valuemax": c ? p.max : void 0,
596
596
  "aria-valuenow": c ? P : void 0,
597
597
  "aria-valuetext": c ? F ? g("knobValueStateText", { x: N(n), y: N(P), state: g(F) }) : g("knobValueText", { x: N(n), y: N(P) }) : void 0,
598
- onPointerDown: (R) => Ae(R, n),
599
- onKeyDown: (R) => Te(R, n, P),
598
+ onPointerDown: (R) => Ce(R, n),
599
+ onKeyDown: (R) => Ae(R, n, P),
600
600
  children: [
601
601
  c && /* @__PURE__ */ t.jsx("circle", { className: "bitflow-function-plot-knob-hit", r: it }),
602
602
  /* @__PURE__ */ t.jsx("circle", { className: "bitflow-function-plot-knob-ring", r: Q + 6 }),
@@ -610,7 +610,7 @@ const B = (e, o) => {
610
610
  ]
611
611
  }
612
612
  ),
613
- (e.shown.length > 0 || Y) && /* @__PURE__ */ t.jsxs("ul", { className: "bitflow-function-plot-legend", children: [
613
+ (e.shown.length > 0 || U) && /* @__PURE__ */ t.jsxs("ul", { className: "bitflow-function-plot-legend", children: [
614
614
  re.map((n, f) => /* @__PURE__ */ t.jsxs("li", { children: [
615
615
  /* @__PURE__ */ t.jsx(
616
616
  "span",
@@ -622,7 +622,7 @@ const B = (e, o) => {
622
622
  ),
623
623
  n.label || g("unnamedCurve", { number: f + 1 })
624
624
  ] }, f)),
625
- Y && /* @__PURE__ */ t.jsxs("li", { children: [
625
+ U && /* @__PURE__ */ t.jsxs("li", { children: [
626
626
  /* @__PURE__ */ t.jsx(
627
627
  "span",
628
628
  {
@@ -694,7 +694,7 @@ const B = (e, o) => {
694
694
  }) => {
695
695
  const b = (d, u) => D(O, d, a, u), g = l?.detail?.handles;
696
696
  return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack", children: [
697
- /* @__PURE__ */ t.jsx(Ze, { markdown: e.instruction }),
697
+ /* @__PURE__ */ t.jsx(Ge, { markdown: e.instruction }),
698
698
  /* @__PURE__ */ t.jsx("p", { className: "bitflow-hint", children: b(r ? "howToReadonly" : "howTo") }),
699
699
  /* @__PURE__ */ t.jsx(
700
700
  Le,
@@ -737,7 +737,7 @@ const B = (e, o) => {
737
737
  }) => {
738
738
  const a = (s, c) => D(lt, s, o, c), i = (s) => l({ ...e, ...s }), [b, g] = L.useState(5), d = (s, c) => i({ axes: { ...e.axes, [s]: { ...e.axes[s], ...c } } }), u = (s, c) => i({
739
739
  shown: e.shown.map((k, m) => m === s ? { ...k, ...c } : k)
740
- }), x = (s, c, k, m) => /* @__PURE__ */ t.jsx(G, { label: s, error: m, children: (p) => /* @__PURE__ */ t.jsx(
740
+ }), x = (s, c, k, m) => /* @__PURE__ */ t.jsx(B, { label: s, error: m, children: (p) => /* @__PURE__ */ t.jsx(
741
741
  te,
742
742
  {
743
743
  ...p,
@@ -748,7 +748,7 @@ const B = (e, o) => {
748
748
  ) }), y = (s) => /* @__PURE__ */ t.jsxs("fieldset", { className: "bitflow-field", children: [
749
749
  /* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: a(s === "x" ? "xAxisLegend" : "yAxisLegend") }),
750
750
  /* @__PURE__ */ t.jsxs("div", { className: "bitflow-row", children: [
751
- /* @__PURE__ */ t.jsx(G, { label: a("axisLabelField"), children: (c) => /* @__PURE__ */ t.jsx(
751
+ /* @__PURE__ */ t.jsx(B, { label: a("axisLabelField"), children: (c) => /* @__PURE__ */ t.jsx(
752
752
  "input",
753
753
  {
754
754
  ...c,
@@ -775,7 +775,7 @@ const B = (e, o) => {
775
775
  ] }), S = {
776
776
  values: Object.fromEntries(
777
777
  e.handles.flatMap((s) => {
778
- const c = B(e.target, s);
778
+ const c = q(e.target, s);
779
779
  return c.ok ? [[H(s), c.value]] : [];
780
780
  })
781
781
  )
@@ -807,7 +807,7 @@ const B = (e, o) => {
807
807
  /* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: a("shownLabel") }),
808
808
  /* @__PURE__ */ t.jsx("span", { className: "bitflow-hint", children: a("shownHint") }),
809
809
  e.shown.length === 0 && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text-muted", children: a("noShown") }),
810
- e.shown.map((s, c) => /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack-small", children: [
810
+ e.shown.map((s, c) => /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack-small bitflow-stack", children: [
811
811
  /* @__PURE__ */ t.jsxs("div", { className: "bitflow-function-plot-editor-row", children: [
812
812
  /* @__PURE__ */ t.jsx(
813
813
  "input",
@@ -866,7 +866,7 @@ const B = (e, o) => {
866
866
  }
867
867
  ),
868
868
  /* @__PURE__ */ t.jsxs("div", { className: "bitflow-row", children: [
869
- /* @__PURE__ */ t.jsx(G, { label: a("spreadCountLabel"), children: (s) => /* @__PURE__ */ t.jsx(
869
+ /* @__PURE__ */ t.jsx(B, { label: a("spreadCountLabel"), children: (s) => /* @__PURE__ */ t.jsx(
870
870
  "input",
871
871
  {
872
872
  ...s,
@@ -899,7 +899,7 @@ const B = (e, o) => {
899
899
  /* @__PURE__ */ t.jsx(Le, { data: e, answer: S, locale: o, revealTarget: !0 })
900
900
  ] }),
901
901
  /* @__PURE__ */ t.jsxs(Oe, { summary: a("advanced"), children: [
902
- /* @__PURE__ */ t.jsx(G, { label: a("toleranceLabel"), hint: a("toleranceHint"), children: (s) => /* @__PURE__ */ t.jsx(
902
+ /* @__PURE__ */ t.jsx(B, { label: a("toleranceLabel"), hint: a("toleranceHint"), children: (s) => /* @__PURE__ */ t.jsx(
903
903
  te,
904
904
  {
905
905
  ...s,
@@ -937,7 +937,7 @@ const B = (e, o) => {
937
937
  )
938
938
  ] })
939
939
  ] });
940
- }, Se = "task-function-plot", Z = { label: "", min: -5, max: 5, step: 1 };
940
+ }, Se = "task-function-plot", G = { label: "", min: -5, max: 5, step: 1 };
941
941
  Pe({
942
942
  type: Se,
943
943
  kind: "task",
@@ -951,17 +951,17 @@ Pe({
951
951
  }),
952
952
  defaultData: () => ({
953
953
  instruction: "",
954
- axes: { x: { ...Z }, y: { ...Z } },
954
+ axes: { x: { ...G }, y: { ...G } },
955
955
  target: "0",
956
956
  shown: [],
957
- handles: ae(Z, 5),
958
- tolerance: Z.step / 2,
957
+ handles: ae(G, 5),
958
+ tolerance: G.step / 2,
959
959
  snap: "half",
960
960
  partialCredit: !0,
961
961
  evaluation: ve()
962
962
  })
963
963
  });
964
- qe(Se);
964
+ Ze(Se);
965
965
  Re("bitflow-styles-task-function-plot", ot);
966
966
  export {
967
967
  mt as AnswerSchema,
@@ -971,21 +971,21 @@ export {
971
971
  ht as Form,
972
972
  h as MARGIN,
973
973
  j as PLOT_HEIGHT,
974
- T as PLOT_WIDTH,
974
+ A as PLOT_WIDTH,
975
975
  Le as PlotView,
976
976
  Ne as SNAPS,
977
977
  tt as ShownCurveSchema,
978
978
  et as SnapSchema,
979
979
  Se as TYPE,
980
980
  ft as Task,
981
- q as VIEW_HEIGHT,
981
+ Z as VIEW_HEIGHT,
982
982
  ye as VIEW_WIDTH,
983
- Ue as allCorrect,
983
+ _e as allCorrect,
984
984
  je as defaultHandleValue,
985
985
  ae as defaultHandles,
986
986
  fe as describeFormulaError,
987
987
  Je as evaluate,
988
- B as evaluateFormulaAt,
988
+ q as evaluateFormulaAt,
989
989
  lt as formMessages,
990
990
  N as formatTick,
991
991
  ee as formulaFn,
@@ -996,11 +996,11 @@ export {
996
996
  O as messages,
997
997
  $ as round9,
998
998
  we as sampleCurve,
999
- _e as scoreOf,
999
+ Ye as scoreOf,
1000
1000
  W as snapValue,
1001
1001
  de as ticksFor,
1002
1002
  xt as xFromView,
1003
- A as xToView,
1003
+ C as xToView,
1004
1004
  Xe as yFromView,
1005
- C as yToView
1005
+ T as yToView
1006
1006
  };
@@ -1,6 +1,6 @@
1
- import { L, a2 as f, ac as E, ad as H, a9 as P, a4 as A, P as v, j as t, a as z, a5 as O, b as x, s as R, aa as T } from "./dom-uYx_3K1r.js";
2
- import { v as k, A as p, P as F, _ as j, e as Z, y as D, M as K, E as B, L as N, t as U, R as $ } from "./bitLoaders-DIGwTcpd.js";
3
- const C = ["person", "keywords"], I = O(C), q = L({
1
+ import { L, a2 as f, ac as P, ad as H, a9 as z, a4 as C, P as v, j as t, a as O, a5 as E, b as x, s as F, aa as R } from "./dom-uYx_3K1r.js";
2
+ import { e as k, g as p, M as T, i as j, P as Z, C as B, F as D, B as K, U as N, r as U, H as I } from "./bitLoaders-CxvZkGrY.js";
3
+ const A = ["person", "keywords"], $ = E(A), q = L({
4
4
  /** Stable across edits, so an outcome keeps pointing at the same line. */
5
5
  id: f().min(1),
6
6
  /** What a reader is looking for: "explains why the list must be sorted". */
@@ -9,10 +9,10 @@ const C = ["person", "keywords"], I = O(C), q = L({
9
9
  * The words that stand in for the idea, under `keywords`. Any one of them
10
10
  * counts — they are spellings of one thing, not a list of requirements.
11
11
  */
12
- keywords: A(f()).default([]),
12
+ keywords: C(f()).default([]),
13
13
  /** What meeting this line is worth. */
14
14
  points: v().min(0).default(1)
15
- }), _ = L({
15
+ }), V = L({
16
16
  instruction: f().default(""),
17
17
  /**
18
18
  * A prompt inside the empty box. Not a label — the question above is the
@@ -20,7 +20,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
20
20
  * for the learner.
21
21
  */
22
22
  placeholder: f().default(""),
23
- marking: I.default("person"),
23
+ marking: $.default("person"),
24
24
  /**
25
25
  * A floor on the length, in characters, or 0 for none. Held as a nudge
26
26
  * rather than a gate: it is shown as a count and never blocks submitting,
@@ -34,15 +34,15 @@ const C = ["person", "keywords"], I = O(C), q = L({
34
34
  * afterwards.
35
35
  */
36
36
  maximumLength: v().int().min(0).default(0),
37
- criteria: A(q).default([]),
37
+ criteria: C(q).default([]),
38
38
  /**
39
39
  * Shown once the answer is in, under `person`: the answer to compare
40
40
  * against while the learner waits to be read. Optional, because handing
41
41
  * out a model answer is not always what an author wants.
42
42
  */
43
43
  modelAnswer: f().default(""),
44
- caseSensitive: P().default(!1),
45
- evaluation: E.default(H)
44
+ caseSensitive: z().default(!1),
45
+ evaluation: P.default(H)
46
46
  }).check((e) => {
47
47
  const { criteria: c, minimumLength: m, maximumLength: o, marking: n, evaluation: a } = e.value, r = c.map((l) => l.id);
48
48
  new Set(r).size !== r.length && e.issues.push({
@@ -76,7 +76,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
76
76
  }), ae = L({
77
77
  /** What the learner wrote, whole and unaltered. */
78
78
  text: f().default("")
79
- }), W = (e) => e.trim().length, V = (e, c, m) => {
79
+ }), W = (e) => e.trim().length, G = (e, c, m) => {
80
80
  const o = (a) => m ? a : a.toLowerCase(), n = new Set(
81
81
  o(e).split(/[^\p{L}\p{N}_'’]+/u).filter(Boolean)
82
82
  );
@@ -84,16 +84,16 @@ const C = ["person", "keywords"], I = O(C), q = L({
84
84
  const r = a.split(/[^\p{L}\p{N}_'’]+/u).filter(Boolean);
85
85
  return r.length === 0 ? !1 : r.length > 1 ? o(e).includes(a) : n.has(r[0]);
86
86
  });
87
- }, G = (e, c) => e.criteria.map((m) => ({
87
+ }, Y = (e, c) => e.criteria.map((m) => ({
88
88
  criterionId: m.id,
89
89
  label: m.label,
90
90
  points: m.points,
91
- met: e.marking === "keywords" ? V(c, m, e.caseSensitive) : void 0
92
- })), Y = ({
91
+ met: e.marking === "keywords" ? G(c, m, e.caseSensitive) : void 0
92
+ })), _ = ({
93
93
  data: e,
94
94
  answer: c
95
95
  }) => {
96
- const m = c?.text ?? "", o = G(e, m), n = { criteria: o, length: W(m) };
96
+ const m = c?.text ?? "", o = Y(e, m), n = { criteria: o, length: W(m) };
97
97
  if (e.evaluation.mode === "skip")
98
98
  return { state: "unknown", allowRetry: !1, detail: n };
99
99
  if (e.marking === "person")
@@ -234,7 +234,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
234
234
  locale: n,
235
235
  onAnswerChange: a
236
236
  }) => {
237
- const r = (h, w) => x(y, h, n, w), l = z.useId(), u = `${l}-count`, b = c?.text ?? "", i = W(b), s = m?.detail?.criteria, d = e.maximumLength ? r("countRemaining", { count: i, maximum: e.maximumLength }) : e.minimumLength ? r("countTowards", { count: i, minimum: e.minimumLength }) : r("countUnlimited", { count: i });
237
+ const r = (h, w) => x(y, h, n, w), l = O.useId(), u = `${l}-count`, b = c?.text ?? "", i = W(b), s = m?.detail?.criteria, d = e.maximumLength ? r("countRemaining", { count: i, maximum: e.maximumLength }) : e.minimumLength ? r("countTowards", { count: i, minimum: e.minimumLength }) : r("countUnlimited", { count: i });
238
238
  return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack", children: [
239
239
  /* @__PURE__ */ t.jsx(N, { markdown: e.instruction }),
240
240
  /* @__PURE__ */ t.jsx("p", { className: "bitflow-text-muted", children: e.marking === "person" ? r("goingToReader") : r("goingToKeywords") }),
@@ -338,12 +338,12 @@ const C = ["person", "keywords"], I = O(C), q = L({
338
338
  }
339
339
  ),
340
340
  /* @__PURE__ */ t.jsx(
341
- F,
341
+ T,
342
342
  {
343
343
  label: n("markingLabel"),
344
344
  hint: e.marking === "person" ? n("markingPersonHint") : n("markingKeywordsHint"),
345
345
  value: e.marking,
346
- options: C.map((i) => ({
346
+ options: A.map((i) => ({
347
347
  value: i,
348
348
  label: n(i === "person" ? "markingPerson" : "markingKeywords")
349
349
  })),
@@ -474,7 +474,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
474
474
  ),
475
475
  /* @__PURE__ */ t.jsxs(Z, { summary: n("advanced"), children: [
476
476
  /* @__PURE__ */ t.jsx(
477
- D,
477
+ B,
478
478
  {
479
479
  label: n("placeholderLabel"),
480
480
  hint: n("placeholderHint"),
@@ -491,7 +491,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
491
491
  ] })
492
492
  ] }),
493
493
  e.marking === "keywords" && /* @__PURE__ */ t.jsx(
494
- K,
494
+ D,
495
495
  {
496
496
  label: n("caseSensitiveLabel"),
497
497
  hint: n("caseSensitiveHint"),
@@ -500,7 +500,7 @@ const C = ["person", "keywords"], I = O(C), q = L({
500
500
  }
501
501
  ),
502
502
  /* @__PURE__ */ t.jsx(
503
- B,
503
+ K,
504
504
  {
505
505
  evaluation: e.evaluation,
506
506
  locale: c,
@@ -510,13 +510,13 @@ const C = ["person", "keywords"], I = O(C), q = L({
510
510
  ] })
511
511
  ] });
512
512
  };
513
- R("bitflow-styles-task-free-text", J);
513
+ F("bitflow-styles-task-free-text", J);
514
514
  const M = "task-free-text";
515
- T({
515
+ R({
516
516
  type: M,
517
517
  kind: "task",
518
- schema: _,
519
- evaluate: Y,
518
+ schema: V,
519
+ evaluate: _,
520
520
  Task: X,
521
521
  Form: ie,
522
522
  info: (e) => ({
@@ -535,14 +535,14 @@ T({
535
535
  evaluation: H()
536
536
  })
537
537
  });
538
- $(M);
538
+ I(M);
539
539
  export {
540
540
  ae as AnswerSchema,
541
- _ as DataSchema,
541
+ V as DataSchema,
542
542
  ie as Form,
543
543
  M as TYPE,
544
544
  X as Task,
545
- Y as evaluate,
545
+ _ as evaluate,
546
546
  Q as formMessages,
547
547
  y as messages
548
548
  };
@@ -1,5 +1,5 @@
1
1
  import { L as i, a2 as m, j as t, b as a, s as l, aa as k } from "./dom-uYx_3K1r.js";
2
- import { v as w, L as c, R as p } from "./bitLoaders-DIGwTcpd.js";
2
+ import { e as w, U as c, H as p } from "./bitLoaders-CxvZkGrY.js";
3
3
  const b = "", e = {
4
4
  en: {
5
5
  name: "Text",