hyperbook 0.113.1 → 0.113.3

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 (55) hide show
  1. package/dist/asset-manifest.json +9 -9
  2. package/dist/assets/directive-bitflow/{EditorElement-zyz99U6n.js → EditorElement-BNwEKIvk.js} +258 -258
  3. package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-CAvHx5xm.js} +2 -2
  4. package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-7qanePQL.js} +1138 -1073
  5. package/dist/assets/directive-bitflow/{dom-uYx_3K1r.js → dom-B6NPWBb1.js} +1558 -1551
  6. package/dist/assets/directive-bitflow/editor.js +3 -3
  7. package/dist/assets/directive-bitflow/flow.js +4 -4
  8. package/dist/assets/directive-bitflow/{index-BseSaQlX.js → index-4JaKZ7WT.js} +2 -2
  9. package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-6CQr_atd.js} +120 -120
  10. package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-B9iG-a48.js} +9 -9
  11. package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-BFYoOtcY.js} +36 -36
  12. package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-BI6aFdIS.js} +21 -21
  13. package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-Bf078mfo.js} +69 -69
  14. package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-BinE5Wvd.js} +19 -19
  15. package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BoX5-jkC.js} +31 -31
  16. package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-BqRsXShM.js} +34 -34
  17. package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-BxihQ8Oo.js} +21 -21
  18. package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-C5YguHZU.js} +101 -101
  19. package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-C8zwSmE6.js} +27 -27
  20. package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-C9JSBTNc.js} +91 -91
  21. package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-CCMI6UK4.js} +75 -75
  22. package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-CGDt8H6s.js} +24 -24
  23. package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-Ca1v0pjV.js} +102 -92
  24. package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-CaYn3Gmh.js} +31 -31
  25. package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-CbQue0If.js} +67 -67
  26. package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CjH3h0OO.js} +79 -79
  27. package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-CkO3QfOS.js} +8 -8
  28. package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-Cz4i5rfe.js} +39 -39
  29. package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-D0NtgeiX.js} +85 -85
  30. package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-D1C_1SPY.js} +14 -14
  31. package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-D45u7EVR.js} +227 -194
  32. package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-D9Ox4YpM.js} +33 -33
  33. package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-DJ1w2Xcm.js} +46 -46
  34. package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-DUqW2fmV.js} +94 -94
  35. package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-Deedj9EF.js} +25 -25
  36. package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-Dg6nnY_v.js} +68 -68
  37. package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DgxEzomz.js} +2 -2
  38. package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-Dl0-ZAT5.js} +52 -52
  39. package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-Do6dmZyj.js} +42 -42
  40. package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-DqnGC-DU.js} +31 -31
  41. package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-DwXXeSwk.js} +73 -73
  42. package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-b6qwcTj9.js} +15 -15
  43. package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-d105UFQI.js} +58 -58
  44. package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-jijMWQB6.js} +8 -8
  45. package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-kxO5_U9Y.js} +24 -24
  46. package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-p5AOgOal.js} +35 -35
  47. package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-q2APknM6.js} +46 -46
  48. package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-zVkWgm5I.js} +70 -70
  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-mdyEMdsJ.js} +6 -6
  54. package/dist/index.js +1 -1
  55. package/package.json +2 -2
@@ -1,30 +1,30 @@
1
- import { L as Z, ak as he, P as N, a2 as E, ac as we, ad as ne, a9 as q, a4 as pe, j as i, a as x, a5 as ve, b as P, aj as O, aa as xe, s as ge } from "./dom-uYx_3K1r.js";
2
- import { v as ke, A as I, M as G, P as je, t as K, _ as Y, e as ye, E as Le, s as Ne, L as Te, R as Se } from "./bitLoaders-DIGwTcpd.js";
3
- const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
1
+ import { P as A, ak as he, Y as L, a2 as O, ac as we, ad as ne, a9 as q, a4 as pe, j as i, a as x, a5 as ve, b as P, aj as E, aa as xe, s as ge } from "./dom-B6NPWBb1.js";
2
+ import { e as ke, g as R, F as Y, M as je, r as G, i as K, P as ye, B as Ne, y as Le, U as Te, H as Se } from "./bitLoaders-7qanePQL.js";
3
+ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
4
4
  /** Stable across edits, so a placed marker and an answer keep pointing at
5
5
  * the same item even after the author reorders the list. */
6
- id: E().min(1),
6
+ id: O().min(1),
7
7
  /** What the chip and the marker show — plain text, e.g. "3/4" or "√2". Not
8
8
  * parsed: it is only ever displayed, never read back into arithmetic. */
9
- label: E().min(1),
9
+ label: O().min(1),
10
10
  /** The correct position, in the line's own units — never a fraction of the
11
11
  * line's length. The author types an expression in the form ("3/4",
12
12
  * "sqrt(2)"); this is always the evaluated number. */
13
- value: N(),
13
+ value: L(),
14
14
  /** Overrides `tolerance` for this one item — a harder root among easier
15
15
  * fractions, say. Absent means the line's own tolerance applies. */
16
- tolerance: N().min(0).optional()
17
- }), ze = Z({
18
- instruction: E().default(""),
16
+ tolerance: L().min(0).optional()
17
+ }), He = A({
18
+ instruction: O().default(""),
19
19
  /** The line's extent, in its own units. */
20
- min: N().default(-2),
21
- max: N().default(2),
20
+ min: L().default(-2),
21
+ max: L().default(2),
22
22
  /** Spacing of the labelled ticks. Always positive: a step of zero would
23
23
  * ask for infinitely many of them. */
24
- tickStep: N().positive().default(1),
24
+ tickStep: L().positive().default(1),
25
25
  /** Unlabelled ticks between two major ones. Capped at 10 — past that the
26
26
  * line reads as a smear of lines rather than a scale. */
27
- minorTicks: N().int().min(0).max(10).default(0),
27
+ minorTicks: L().int().min(0).max(10).default(0),
28
28
  labelTicks: q().default(!0),
29
29
  items: pe(Ce).default([]),
30
30
  /**
@@ -36,7 +36,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
36
36
  * `toleranceFor` in `evaluate.ts` falls back to the same formula for a
37
37
  * document that predates a field, or one written by hand.
38
38
  */
39
- tolerance: N().min(0).optional(),
39
+ tolerance: L().min(0).optional(),
40
40
  /** Where a placed marker actually lands. `"minor"` with no minor ticks
41
41
  * drawn is the same as `"major"` — there is nothing finer to snap to. */
42
42
  snap: Me.default("minor"),
@@ -77,24 +77,24 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
77
77
  message: `${o.value} is outside the line (${r} to ${c}).`
78
78
  });
79
79
  });
80
- }), at = Z({
80
+ }), at = A({
81
81
  /** Item id → where the learner placed it, in the line's own units. */
82
- positions: he(E(), N()).default({})
83
- }), He = (e) => e.tolerance ?? e.tickStep / 4, Pe = (e, r) => r.tolerance ?? He(e), We = 1e-9, B = (e, r) => {
82
+ positions: he(O(), L()).default({})
83
+ }), ze = (e) => e.tolerance ?? e.tickStep / 4, Pe = (e, r) => r.tolerance ?? ze(e), We = 1e-9, F = (e, r) => {
84
84
  const c = {};
85
85
  for (const n of e.items) {
86
86
  const a = r?.positions?.[n.id];
87
87
  c[n.id] = a !== void 0 && Math.abs(a - n.value) <= Pe(e, n) + We ? "correct" : "wrong";
88
88
  }
89
89
  return c;
90
- }, Re = (e, r) => {
91
- const c = Object.values(B(e, r));
90
+ }, Ie = (e, r) => {
91
+ const c = Object.values(F(e, r));
92
92
  return {
93
93
  earned: c.filter((n) => n === "correct").length,
94
94
  possible: c.length
95
95
  };
96
- }, Ie = (e, r) => {
97
- const c = Object.values(B(e, r));
96
+ }, Re = (e, r) => {
97
+ const c = Object.values(F(e, r));
98
98
  return c.length > 0 && c.every((n) => n === "correct");
99
99
  }, $e = ({
100
100
  data: e,
@@ -102,12 +102,12 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
102
102
  }) => {
103
103
  if (e.evaluation.mode === "skip")
104
104
  return { state: "unknown", allowRetry: !1 };
105
- const c = Ie(e, r), n = Re(e, r), a = e.partialCredit && n.possible > 0 ? n : { earned: c ? 1 : 0, possible: 1 };
105
+ const c = Re(e, r), n = Ie(e, r), a = e.partialCredit && n.possible > 0 ? n : { earned: c ? 1 : 0, possible: 1 };
106
106
  return {
107
107
  state: c ? "correct" : "wrong",
108
108
  score: a,
109
109
  allowRetry: e.evaluation.enableRetry,
110
- detail: { items: B(e, r) }
110
+ detail: { items: F(e, r) }
111
111
  };
112
112
  }, V = {
113
113
  en: {
@@ -144,7 +144,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
144
144
  wrong: "falsch",
145
145
  correctValue: "Richtige Position: {value}"
146
146
  }
147
- }, Ee = ".bitflow-number-line{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-number-line-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-number-line-axis{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(3 * var(--bitflow-number-line-scale, 1));stroke-linecap:round}.bitflow-number-line-ticks-major line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-ticks-minor line{stroke:var(--bitflow-color-neutral-200);stroke-width:calc(1.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-tick-labels text{fill:var(--bitflow-color-text-muted);font-family:var(--bitflow-font-family);font-size:calc(23px * var(--bitflow-number-line-scale, 1));font-variant-numeric:tabular-nums;text-anchor:middle}.bitflow-number-line-catcher{cursor:crosshair}.bitflow-number-line-answer line{stroke:var(--bitflow-color-text-muted);stroke-width:3;stroke-dasharray:6 5}.bitflow-number-line-label text{fill:var(--bitflow-color-text);stroke:var(--bitflow-color-surface);stroke-width:5px;paint-order:stroke fill;font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-medium);text-anchor:middle}.bitflow-number-line-dot{fill:var(--bitflow-color-primary);stroke:var(--bitflow-color-on-primary);stroke-width:2}.bitflow-number-line-dot-active{stroke:var(--bitflow-color-neutral-900);stroke-width:3}.bitflow-number-line-dot-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-dot-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-verdict{font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-verdict-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-verdict-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-hit{fill:transparent;stroke:none;cursor:grab;touch-action:none}.bitflow-number-line-hit:focus-visible{outline:3px solid var(--bitflow-color-primary);outline-offset:2px}.bitflow-number-line-palette{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xxsmall)}.bitflow-number-line-chip{display:inline-flex;align-items:center;min-height:44px;padding:var(--bitflow-space-xxsmall) var(--bitflow-space-small);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-full);background:var(--bitflow-color-surface);cursor:pointer}.bitflow-number-line-chip:has(:checked){border-color:var(--bitflow-color-neutral-900);font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-chip:has(:focus-visible){box-shadow:var(--bitflow-shadow-outline)}.bitflow-number-line-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-row-label{flex:1 1 auto;font-variant-numeric:tabular-nums}.bitflow-number-line-badge{font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-badge-correct{color:var(--bitflow-color-correct)}.bitflow-number-line-badge-wrong{color:var(--bitflow-color-wrong)}.bitflow-number-line-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-editor-row>.bitflow-input{flex:1 1 8rem;width:auto;min-width:0}.bitflow-number-line-number{flex:0 1 var(--bitflow-number-line-number-width, 6rem);width:var(--bitflow-number-line-number-width, 6rem)}", Oe = {
147
+ }, Oe = ".bitflow-number-line{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-number-line-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-number-line-axis{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(3 * var(--bitflow-number-line-scale, 1));stroke-linecap:round}.bitflow-number-line-ticks-major line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-ticks-minor line{stroke:var(--bitflow-color-neutral-200);stroke-width:calc(1.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-tick-labels text{fill:var(--bitflow-color-text-muted);font-family:var(--bitflow-font-family);font-size:calc(23px * var(--bitflow-number-line-scale, 1));font-variant-numeric:tabular-nums;text-anchor:middle}.bitflow-number-line-catcher{cursor:crosshair}.bitflow-number-line-answer line{stroke:var(--bitflow-color-text-muted);stroke-width:3;stroke-dasharray:6 5}.bitflow-number-line-label text{fill:var(--bitflow-color-text);stroke:var(--bitflow-color-surface);stroke-width:5px;paint-order:stroke fill;font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-medium);text-anchor:middle}.bitflow-number-line-dot{fill:var(--bitflow-color-primary);stroke:var(--bitflow-color-on-primary);stroke-width:2}.bitflow-number-line-dot-active{stroke:var(--bitflow-color-neutral-900);stroke-width:3}.bitflow-number-line-dot-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-dot-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-verdict{font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-verdict-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-verdict-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-hit{fill:transparent;stroke:none;cursor:grab;touch-action:none}.bitflow-number-line-hit:focus-visible{outline:3px solid var(--bitflow-color-primary);outline-offset:2px}.bitflow-number-line-palette{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xxsmall)}.bitflow-number-line-chip{display:inline-flex;align-items:center;min-height:44px;padding:var(--bitflow-space-xxsmall) var(--bitflow-space-small);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-full);background:var(--bitflow-color-surface);cursor:pointer}.bitflow-number-line-chip:has(:checked){border-color:var(--bitflow-color-neutral-900);font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-chip:has(:focus-visible){box-shadow:var(--bitflow-shadow-outline)}.bitflow-number-line-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-row-label{flex:1 1 auto;font-variant-numeric:tabular-nums}.bitflow-number-line-badge{font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-badge-correct{color:var(--bitflow-color-correct)}.bitflow-number-line-badge-wrong{color:var(--bitflow-color-wrong)}.bitflow-number-line-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-editor-row>.bitflow-input{flex:1 1 8rem;width:auto;min-width:0}.bitflow-number-line-number{flex:0 1 var(--bitflow-number-line-number-width, 6rem);width:var(--bitflow-number-line-number-width, 6rem)}", Ee = {
148
148
  en: {
149
149
  instructionLabel: "Instruction",
150
150
  instructionHint: "Shown above the line. Markdown is allowed.",
@@ -213,15 +213,15 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
213
213
  partialCreditHint: "Ein Punkt je Wert statt einer für den ganzen Zahlenstrahl. Neun von zehn richtig platziert sind neun Zehntel der Wertung.",
214
214
  advanced: "Erweitert"
215
215
  }
216
- }, $ = 1e3, Ve = 220, S = { left: 48, right: 48 }, F = $ - S.left - S.right, y = 132, oe = (e) => e.max - e.min || 1, z = (e, r) => S.left + (r - e.min) / oe(e) * F, Ae = (e, r) => e.min + (r - S.left) / F * oe(e), _ = (e) => e.minorTicks > 0 ? e.tickStep / (e.minorTicks + 1) : e.tickStep, se = (e, r) => {
216
+ }, $ = 1e3, Ve = 220, S = { left: 48, right: 48 }, B = $ - S.left - S.right, y = 132, oe = (e) => e.max - e.min || 1, H = (e, r) => S.left + (r - e.min) / oe(e) * B, De = (e, r) => e.min + (r - S.left) / B * oe(e), U = (e) => e.minorTicks > 0 ? e.tickStep / (e.minorTicks + 1) : e.tickStep, se = (e, r) => {
217
217
  if (r !== "none")
218
- return r === "major" ? e.tickStep : _(e);
219
- }, De = (e) => se(e, e.snap) ?? _(e), W = (e) => Math.round(e * 1e9) / 1e9, J = (e, r) => {
218
+ return r === "major" ? e.tickStep : U(e);
219
+ }, Ze = (e) => se(e, e.snap) ?? U(e), W = (e) => Math.round(e * 1e9) / 1e9, J = (e, r) => {
220
220
  const c = Math.min(Math.max(r, e.min), e.max), n = se(e, e.snap);
221
221
  if (!n) return W(c);
222
222
  const a = e.min + Math.round((c - e.min) / n) * n;
223
223
  return W(Math.min(Math.max(a, e.min), e.max));
224
- }, Q = 400, Ze = (e) => {
224
+ }, Q = 400, Ae = (e) => {
225
225
  const { min: r, max: c, tickStep: n } = e;
226
226
  if (!(n > 0)) return { major: [r, c].filter(Number.isFinite), minor: [] };
227
227
  const a = n * 1e-6, o = [];
@@ -229,14 +229,14 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
229
229
  o.push(W(b));
230
230
  const u = [];
231
231
  if (e.minorTicks > 0) {
232
- const b = _(e);
232
+ const b = U(e);
233
233
  for (let d = r; d <= c + a && u.length < Q; d += b) {
234
234
  const k = W(d);
235
235
  o.some((j) => Math.abs(j - k) < a) || u.push(k);
236
236
  }
237
237
  }
238
238
  return { major: o, minor: u };
239
- }, T = (e) => String(W(e * 1e3) / 1e3), Be = (e, r) => {
239
+ }, T = (e) => String(W(e * 1e3) / 1e3), Fe = (e, r) => {
240
240
  const c = [...e].sort((o, u) => o.view - u.view), n = [], a = {};
241
241
  for (const o of c) {
242
242
  let u = 0;
@@ -244,14 +244,14 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
244
244
  n[u] = o.view, a[o.id] = u;
245
245
  }
246
246
  return a;
247
- }, ee = 9, Fe = 36, D = 14, te = 7, ie = 40, _e = 26, Xe = 22, Ue = 70, qe = 4, Ge = 560, Ke = 2.2, Ye = (e) => {
247
+ }, ee = 9, Be = 36, Z = 14, te = 7, ie = 40, Ue = 26, Xe = 22, _e = 70, qe = 4, Ye = 560, Ge = 2.2, Ke = (e) => {
248
248
  const [r, c] = x.useState(1);
249
249
  return x.useLayoutEffect(() => {
250
250
  const n = e.current;
251
251
  if (!n || typeof ResizeObserver > "u") return;
252
252
  const a = () => {
253
253
  const u = n.getBoundingClientRect().width;
254
- u && c(Math.min(Ke, Math.max(1, Ge / u)));
254
+ u && c(Math.min(Ge, Math.max(1, Ye / u)));
255
255
  };
256
256
  a();
257
257
  const o = new ResizeObserver(a);
@@ -265,14 +265,14 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
265
265
  readonly: a,
266
266
  onPlace: o
267
267
  }) => {
268
- const u = (t, s) => P(V, t, n, s), b = x.useRef(null), d = Ye(b), k = x.useId(), j = r?.positions ?? {}, [M, l] = x.useState(
268
+ const u = (t, s) => P(V, t, n, s), b = x.useRef(null), d = Ke(b), k = x.useId(), j = r?.positions ?? {}, [M, l] = x.useState(
269
269
  () => e.items.find((t) => j[t.id] === void 0)?.id ?? e.items[0]?.id
270
- ), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0), L = !!o && !a, A = Ze(e), X = (t) => {
270
+ ), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0), N = !!o && !a, D = Ae(e), X = (t) => {
271
271
  const s = b.current?.getBoundingClientRect();
272
272
  if (!s || s.width === 0) return;
273
273
  const m = (t - s.left) / s.width * $;
274
- return Ae(e, m);
275
- }, R = (t, s, m) => {
274
+ return De(e, m);
275
+ }, I = (t, s, m) => {
276
276
  if (!o) return;
277
277
  const v = J(e, s);
278
278
  if (o(t.id, v), p(u(m, { label: t.label, value: T(v) })), m === "placed") {
@@ -282,13 +282,13 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
282
282
  w && l(w.id);
283
283
  }
284
284
  }, me = (t) => {
285
- if (!L || !M) return;
285
+ if (!N || !M) return;
286
286
  const s = e.items.find((v) => v.id === M), m = X(t.clientX);
287
- !s || m === void 0 || R(s, m, j[s.id] === void 0 ? "placed" : "moved");
287
+ !s || m === void 0 || I(s, m, j[s.id] === void 0 ? "placed" : "moved");
288
288
  }, de = (t, s, m) => {
289
- !L || t.button !== 0 || (t.stopPropagation(), l(s.id), g.current = { itemId: s.id, startClientX: t.clientX, value: m, moved: !1 }, h());
289
+ !N || t.button !== 0 || (t.stopPropagation(), l(s.id), g.current = { itemId: s.id, startClientX: t.clientX, value: m, moved: !1 }, h());
290
290
  };
291
- Ne((t) => {
291
+ Le((t) => {
292
292
  const s = g.current;
293
293
  if (!s) return;
294
294
  const m = s.moved || Math.abs(t.clientX - s.startClientX) > qe, v = X(t.clientX), w = v === void 0 ? s.value : J(e, v);
@@ -297,22 +297,22 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
297
297
  const t = g.current;
298
298
  if (g.current = null, h(), !t || !t.moved) return;
299
299
  const s = e.items.find((m) => m.id === t.itemId);
300
- s && R(s, t.value, "moved");
300
+ s && I(s, t.value, "moved");
301
301
  });
302
302
  const be = (t, s, m) => {
303
- if (!L) return;
304
- const v = t.shiftKey ? e.tickStep : De(e);
303
+ if (!N) return;
304
+ const v = t.shiftKey ? e.tickStep : Ze(e);
305
305
  let w;
306
- t.key === "ArrowLeft" ? w = m - v : t.key === "ArrowRight" ? w = m + v : t.key === "Home" ? w = e.min : t.key === "End" && (w = e.max), w !== void 0 && (t.preventDefault(), R(s, w, "moved"));
307
- }, U = e.items.flatMap((t) => {
306
+ t.key === "ArrowLeft" ? w = m - v : t.key === "ArrowRight" ? w = m + v : t.key === "Home" ? w = e.min : t.key === "End" && (w = e.max), w !== void 0 && (t.preventDefault(), I(s, w, "moved"));
307
+ }, _ = e.items.flatMap((t) => {
308
308
  const s = g.current?.itemId === t.id ? g.current.value : j[t.id];
309
309
  return s === void 0 ? [] : [{ item: t, value: s }];
310
- }), fe = Be(
311
- U.map(({ item: t, value: s }) => ({ id: t.id, view: z(e, s) })),
312
- Ue
310
+ }), fe = Fe(
311
+ _.map(({ item: t, value: s }) => ({ id: t.id, view: H(e, s) })),
312
+ _e
313
313
  );
314
314
  return /* @__PURE__ */ i.jsxs("div", { className: "bitflow-number-line", children: [
315
- L && /* @__PURE__ */ i.jsx(
315
+ N && /* @__PURE__ */ i.jsx(
316
316
  "div",
317
317
  {
318
318
  className: "bitflow-number-line-palette",
@@ -330,7 +330,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
330
330
  checked: M === t.id,
331
331
  onChange: () => l(t.id),
332
332
  onKeyDown: (m) => {
333
- m.key !== "Enter" || s !== void 0 || (m.preventDefault(), R(t, (e.min + e.max) / 2, "placed"));
333
+ m.key !== "Enter" || s !== void 0 || (m.preventDefault(), I(t, (e.min + e.max) / 2, "placed"));
334
334
  }
335
335
  }
336
336
  ),
@@ -363,30 +363,30 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
363
363
  y2: y
364
364
  }
365
365
  ),
366
- /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-minor", children: A.minor.map((t) => {
367
- const s = z(e, t);
366
+ /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-minor", children: D.minor.map((t) => {
367
+ const s = H(e, t);
368
368
  return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - te, y2: y + te }, `minor-${t}`);
369
369
  }) }),
370
- /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-major", children: A.major.map((t) => {
371
- const s = z(e, t);
372
- return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - D, y2: y + D }, `major-${t}`);
370
+ /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-major", children: D.major.map((t) => {
371
+ const s = H(e, t);
372
+ return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - Z, y2: y + Z }, `major-${t}`);
373
373
  }) }),
374
- e.labelTicks && /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-tick-labels", children: A.major.map((t) => /* @__PURE__ */ i.jsx(
374
+ e.labelTicks && /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-tick-labels", children: D.major.map((t) => /* @__PURE__ */ i.jsx(
375
375
  "text",
376
376
  {
377
- x: z(e, t),
378
- y: y + D + 10 + 20 * d,
377
+ x: H(e, t),
378
+ y: y + Z + 10 + 20 * d,
379
379
  textAnchor: "middle",
380
380
  children: T(t)
381
381
  },
382
382
  `label-${t}`
383
383
  )) }),
384
- L && /* @__PURE__ */ i.jsx(
384
+ N && /* @__PURE__ */ i.jsx(
385
385
  "rect",
386
386
  {
387
387
  x: S.left,
388
388
  y: y - ie,
389
- width: F,
389
+ width: B,
390
390
  height: ie * 2,
391
391
  fill: "transparent",
392
392
  className: "bitflow-number-line-catcher",
@@ -397,7 +397,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
397
397
  "g",
398
398
  {
399
399
  className: "bitflow-number-line-answer",
400
- transform: `translate(${z(e, t.value)} ${y}) scale(${d})`,
400
+ transform: `translate(${H(e, t.value)} ${y}) scale(${d})`,
401
401
  children: [
402
402
  /* @__PURE__ */ i.jsx("title", { children: u("correctValue", { value: T(t.value) }) }),
403
403
  /* @__PURE__ */ i.jsx("line", { x1: 0, y1: -18, x2: 0, y2: 18 })
@@ -405,8 +405,8 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
405
405
  },
406
406
  `answer-${t.id}`
407
407
  )),
408
- U.map(({ item: t, value: s }) => {
409
- const m = c?.[t.id], v = z(e, s), w = fe[t.id] ?? 0, C = ["bitflow-number-line-dot"];
408
+ _.map(({ item: t, value: s }) => {
409
+ const m = c?.[t.id], v = H(e, s), w = fe[t.id] ?? 0, C = ["bitflow-number-line-dot"];
410
410
  return M === t.id && C.push("bitflow-number-line-dot-active"), m && C.push(`bitflow-number-line-dot-${m}`), /* @__PURE__ */ i.jsxs(
411
411
  "g",
412
412
  {
@@ -417,7 +417,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
417
417
  "g",
418
418
  {
419
419
  className: "bitflow-number-line-label",
420
- transform: `translate(0 ${-(_e + w * Xe)})`,
420
+ transform: `translate(0 ${-(Ue + w * Xe)})`,
421
421
  children: /* @__PURE__ */ i.jsx("text", { children: t.label })
422
422
  }
423
423
  ),
@@ -431,10 +431,10 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
431
431
  children: m === "correct" ? "✓" : "✗"
432
432
  }
433
433
  ),
434
- L && /* @__PURE__ */ i.jsx(
434
+ N && /* @__PURE__ */ i.jsx(
435
435
  "circle",
436
436
  {
437
- r: Fe,
437
+ r: Be,
438
438
  className: "bitflow-number-line-hit",
439
439
  role: "slider",
440
440
  tabIndex: 0,
@@ -443,10 +443,10 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
443
443
  "aria-valuemax": e.max,
444
444
  "aria-valuenow": s,
445
445
  "aria-valuetext": T(s),
446
- onPointerDown: (H) => de(H, t, s),
447
- onKeyDown: (H) => be(H, t, s),
448
- onClick: (H) => {
449
- H.stopPropagation(), l(t.id);
446
+ onPointerDown: (z) => de(z, t, s),
447
+ onKeyDown: (z) => be(z, t, s),
448
+ onClick: (z) => {
449
+ z.stopPropagation(), l(t.id);
450
450
  }
451
451
  }
452
452
  )
@@ -512,7 +512,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
512
512
  }) => {
513
513
  const [n, a] = x.useState(() => String(e));
514
514
  return x.useEffect(() => {
515
- const o = O(n);
515
+ const o = E(n);
516
516
  (!o.ok || Math.abs(o.value - e) > 1e-9) && a(String(e));
517
517
  }, [e]), /* @__PURE__ */ i.jsx(
518
518
  "input",
@@ -524,7 +524,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
524
524
  value: n,
525
525
  onChange: (o) => {
526
526
  a(o.target.value);
527
- const u = O(o.target.value);
527
+ const u = E(o.target.value);
528
528
  u.ok && r(u.value);
529
529
  }
530
530
  }
@@ -537,7 +537,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
537
537
  const [n, a] = x.useState(() => e === void 0 ? "" : String(e));
538
538
  return x.useEffect(() => {
539
539
  if (e === void 0) return;
540
- const o = O(n);
540
+ const o = E(n);
541
541
  (!o.ok || Math.abs(o.value - e) > 1e-9) && a(String(e));
542
542
  }, [e]), /* @__PURE__ */ i.jsx(
543
543
  "input",
@@ -553,7 +553,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
553
553
  r(void 0);
554
554
  return;
555
555
  }
556
- const b = O(u);
556
+ const b = E(u);
557
557
  b.ok && r(b.value);
558
558
  }
559
559
  }
@@ -564,7 +564,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
564
564
  if (!r.includes(n)) return n;
565
565
  }
566
566
  }, et = ({ data: e, locale: r, onChange: c, errors: n }) => {
567
- const a = (l, f) => P(Oe, l, r, f), o = (l) => c({ ...e, ...l }), u = (l, f) => o({
567
+ const a = (l, f) => P(Ee, l, r, f), o = (l) => c({ ...e, ...l }), u = (l, f) => o({
568
568
  items: e.items.map((p) => p.id === l ? { ...p, ...f } : p)
569
569
  }), b = () => o({
570
570
  items: [
@@ -575,10 +575,10 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
575
575
  value: (e.min + e.max) / 2
576
576
  }
577
577
  ]
578
- }), d = (l, f, p, g, h) => /* @__PURE__ */ i.jsx(K, { label: l, error: g, hint: h, children: (L) => /* @__PURE__ */ i.jsx(
578
+ }), d = (l, f, p, g, h) => /* @__PURE__ */ i.jsx(G, { label: l, error: g, hint: h, children: (N) => /* @__PURE__ */ i.jsx(
579
579
  ae,
580
580
  {
581
- ...L,
581
+ ...N,
582
582
  className: "bitflow-input bitflow-number-line-number",
583
583
  value: f,
584
584
  onChange: p
@@ -606,12 +606,12 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
606
606
  ),
607
607
  /* @__PURE__ */ i.jsxs("div", { className: "bitflow-row", children: [
608
608
  d(a("minLabel"), e.min, (l) => o({ min: l })),
609
- d(a("maxLabel"), e.max, (l) => o({ max: l }), I(n, "max")),
609
+ d(a("maxLabel"), e.max, (l) => o({ max: l }), R(n, "max")),
610
610
  d(
611
611
  a("tickStepLabel"),
612
612
  e.tickStep,
613
613
  (l) => o({ tickStep: l }),
614
- I(n, "tickStep"),
614
+ R(n, "tickStep"),
615
615
  a("tickStepHint")
616
616
  ),
617
617
  d(
@@ -623,7 +623,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
623
623
  )
624
624
  ] }),
625
625
  /* @__PURE__ */ i.jsx(
626
- G,
626
+ Y,
627
627
  {
628
628
  label: a("labelTicksLabel"),
629
629
  hint: a("labelTicksHint"),
@@ -640,7 +640,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
640
640
  onChange: (l) => o({ snap: l })
641
641
  }
642
642
  ),
643
- /* @__PURE__ */ i.jsx(K, { label: a("toleranceLabel"), hint: a("toleranceHint"), children: (l) => /* @__PURE__ */ i.jsx(
643
+ /* @__PURE__ */ i.jsx(G, { label: a("toleranceLabel"), hint: a("toleranceHint"), children: (l) => /* @__PURE__ */ i.jsx(
644
644
  le,
645
645
  {
646
646
  ...l,
@@ -657,7 +657,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
657
657
  /* @__PURE__ */ i.jsxs("fieldset", { className: "bitflow-field", children: [
658
658
  /* @__PURE__ */ i.jsx("legend", { className: "bitflow-label", children: a("itemsLabel") }),
659
659
  /* @__PURE__ */ i.jsx("span", { className: "bitflow-hint", children: a("itemsHint") }),
660
- Y(n, "items") && /* @__PURE__ */ i.jsx("span", { className: "bitflow-field-error", role: "alert", children: Y(n, "items") }),
660
+ K(n, "items") && /* @__PURE__ */ i.jsx("span", { className: "bitflow-field-error", role: "alert", children: K(n, "items") }),
661
661
  M.map((l) => /* @__PURE__ */ i.jsx("span", { className: "bitflow-field-error", role: "alert", children: l }, l)),
662
662
  e.items.length === 0 && /* @__PURE__ */ i.jsx("p", { className: "bitflow-text-muted", children: a("noItems") }),
663
663
  e.items.map((l, f) => {
@@ -671,7 +671,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
671
671
  value: l.label,
672
672
  placeholder: a("itemLabelPlaceholder"),
673
673
  "aria-label": a("itemLabelOf", { position: p }),
674
- "aria-invalid": I(n, `items.${f}.label`) ? !0 : void 0,
674
+ "aria-invalid": R(n, `items.${f}.label`) ? !0 : void 0,
675
675
  onChange: (h) => u(l.id, { label: h.target.value })
676
676
  }
677
677
  ),
@@ -681,7 +681,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
681
681
  className: "bitflow-input bitflow-number-line-number",
682
682
  value: l.value,
683
683
  "aria-label": a("itemValueOf", { position: p }),
684
- "aria-invalid": I(n, `items.${f}.value`) ? !0 : void 0,
684
+ "aria-invalid": R(n, `items.${f}.value`) ? !0 : void 0,
685
685
  onChange: (h) => u(l.id, { value: h })
686
686
  }
687
687
  ),
@@ -712,7 +712,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
712
712
  ] }),
713
713
  /* @__PURE__ */ i.jsxs(ye, { summary: a("advanced"), children: [
714
714
  /* @__PURE__ */ i.jsx(
715
- G,
715
+ Y,
716
716
  {
717
717
  label: a("partialCreditLabel"),
718
718
  hint: a("partialCreditHint"),
@@ -721,7 +721,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
721
721
  }
722
722
  ),
723
723
  /* @__PURE__ */ i.jsx(
724
- Le,
724
+ Ne,
725
725
  {
726
726
  evaluation: e.evaluation,
727
727
  locale: r,
@@ -734,7 +734,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
734
734
  xe({
735
735
  type: ue,
736
736
  kind: "task",
737
- schema: ze,
737
+ schema: He,
738
738
  evaluate: $e,
739
739
  Task: Je,
740
740
  Form: et,
@@ -761,37 +761,37 @@ xe({
761
761
  })
762
762
  });
763
763
  Se(ue);
764
- ge("bitflow-styles-task-number-line", Ee);
764
+ ge("bitflow-styles-task-number-line", Oe);
765
765
  export {
766
766
  at as AnswerSchema,
767
- ze as DataSchema,
767
+ He as DataSchema,
768
768
  et as Form,
769
769
  Ce as ItemSchema,
770
770
  y as LINE_Y,
771
771
  S as MARGIN,
772
772
  ce as NumberLineView,
773
- F as PLOT_WIDTH,
773
+ B as PLOT_WIDTH,
774
774
  re as SNAP_MODES,
775
775
  Me as SnapModeSchema,
776
776
  ue as TYPE,
777
777
  Je as Task,
778
778
  Ve as VIEW_HEIGHT,
779
779
  $ as VIEW_WIDTH,
780
- Ie as allCorrect,
780
+ Re as allCorrect,
781
781
  $e as evaluate,
782
- Oe as formMessages,
782
+ Ee as formMessages,
783
783
  T as formatValue,
784
- B as itemStates,
785
- De as keyboardStepFor,
786
- He as lineTolerance,
784
+ F as itemStates,
785
+ Ze as keyboardStepFor,
786
+ ze as lineTolerance,
787
787
  V as messages,
788
- _ as minorStepFor,
789
- Re as scoreOf,
788
+ U as minorStepFor,
789
+ Ie as scoreOf,
790
790
  se as snapStepFor,
791
791
  J as snapValue,
792
- Be as stackLabels,
793
- Ze as ticksFor,
792
+ Fe as stackLabels,
793
+ Ae as ticksFor,
794
794
  Pe as toleranceFor,
795
- z as valueToView,
796
- Ae as viewToValue
795
+ H as valueToView,
796
+ De as viewToValue
797
797
  };