@pie-element/categorize 13.1.2-next.5 → 13.1.2-next.6

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 (45) hide show
  1. package/dist/author/defaults.d.ts +0 -1
  2. package/dist/author/defaults.js +2 -4
  3. package/dist/author/design/buttons.js +3 -3
  4. package/dist/author/design/categories/alternateResponses.js +2 -2
  5. package/dist/author/design/categories/category.js +2 -2
  6. package/dist/author/design/categories/choice-preview.js +1 -1
  7. package/dist/author/design/categories/droppable-placeholder.js +1 -1
  8. package/dist/author/design/categories/index.js +3 -3
  9. package/dist/author/design/choices/choice.js +2 -2
  10. package/dist/author/design/choices/config.js +1 -1
  11. package/dist/author/design/choices/index.js +3 -3
  12. package/dist/author/design/header.js +1 -1
  13. package/dist/author/design/index.js +78 -68
  14. package/dist/author/design/input-header.js +1 -1
  15. package/dist/author/index.d.ts +0 -1
  16. package/dist/author/index.js +2 -2
  17. package/dist/author/main.js +2 -2
  18. package/dist/author/utils.js +1 -1
  19. package/dist/browser/alert-dialog-BtccZZm9.js +11509 -0
  20. package/dist/browser/alert-dialog-BtccZZm9.js.map +1 -0
  21. package/dist/browser/author/index.js +41841 -834
  22. package/dist/browser/author/index.js.map +1 -1
  23. package/dist/browser/controller/index.js +196 -123
  24. package/dist/browser/controller/index.js.map +1 -1
  25. package/dist/browser/delivery/index.js +294 -293
  26. package/dist/browser/delivery/index.js.map +1 -1
  27. package/dist/browser/{dist-DnGF41FP.js → dist-C11U2GIc.js} +301 -388
  28. package/dist/browser/dist-C11U2GIc.js.map +1 -0
  29. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  30. package/dist/controller/defaults.d.ts +0 -1
  31. package/dist/controller/defaults.js +2 -4
  32. package/dist/controller/index.d.ts +1 -0
  33. package/dist/controller/index.js +92 -79
  34. package/dist/delivery/categorize/categories.js +3 -3
  35. package/dist/delivery/categorize/category.js +1 -1
  36. package/dist/delivery/categorize/choice.js +1 -1
  37. package/dist/delivery/categorize/choices.js +1 -1
  38. package/dist/delivery/categorize/grid-content.js +1 -1
  39. package/dist/delivery/categorize/index.js +3 -3
  40. package/dist/delivery/index.js +2 -2
  41. package/dist/index.iife.js +33 -33
  42. package/package.json +14 -9
  43. package/dist/browser/dist-7UsF60Ks.js +0 -55705
  44. package/dist/browser/dist-7UsF60Ks.js.map +0 -1
  45. package/dist/browser/dist-DnGF41FP.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { getCompleteResponseDetails as e, isAlternateDuplicated as t, isCorrectResponseDuplicated as n } from "./utils.js";
2
- import r from "./defaults.js";
3
- import { buildState as i, score as a } from "@pie-lib/categorize";
4
- import o from "@pie-lib/translator";
5
- import { isEmpty as s } from "@pie-element/shared-lodash";
6
- import { getFeedbackForCorrectness as c } from "@pie-element/shared-feedback";
7
- import { getShuffledChoices as l, lockChoices as u, partialScoring as d } from "@pie-element/shared-controller-utils";
1
+ import e from "./defaults.js";
2
+ import { getCompleteResponseDetails as t, isAlternateDuplicated as n, isCorrectResponseDuplicated as r, multiplePlacements as i } from "./utils.js";
3
+ import { buildState as a, score as o } from "@pie-lib/categorize";
4
+ import s from "@pie-lib/translator";
5
+ import { isEmpty as c } from "@pie-element/shared-lodash";
6
+ import { getFeedbackForCorrectness as l } from "@pie-element/shared-feedback";
7
+ import { getShuffledChoices as u, lockChoices as d, partialScoring as f } from "@pie-element/shared-controller-utils";
8
8
  //#region src/controller/index.ts
9
- var { translator: f } = o, p = (e, t) => {
9
+ var { translator: p } = s, m = (e, t) => {
10
10
  let { placements: n, score: r } = t.reduce((e, { choices: t = [] }) => ({
11
11
  placements: e.placements + t.length,
12
12
  score: e.score + t.filter((e) => e.correct).length
@@ -15,74 +15,87 @@ var { translator: f } = o, p = (e, t) => {
15
15
  score: 0
16
16
  }), { maxScore: i } = e.reduce((e, { choices: t }) => ({ maxScore: e.maxScore + t.length }), { maxScore: 0 }), a = (r - (n > i ? n - i : 0)) / i;
17
17
  return a < 0 ? 0 : parseFloat(a.toFixed(2));
18
- }, m = (e) => e.map((e) => e.alternateResponses).filter((e) => e), h = (e, t, n) => {
18
+ }, h = (e) => e.map((e) => e.alternateResponses).filter((e) => e), g = (e, t, n) => {
19
19
  if (!t || Object.keys(t).length === 0) return 0;
20
- let { categories: r, choices: a } = e || {}, { correctResponse: o } = e || {}, { answers: s } = t || {};
20
+ let { categories: r, choices: i } = e || {}, { correctResponse: o } = e || {}, { answers: s } = t || {};
21
21
  s ||= [], o ||= [];
22
- let { categories: c, correct: l } = i(r, a, s, o), u = m(o);
23
- return d.enabled(e, n) && !u.length ? p(o, c) : +!!l;
24
- }, g = (e, t, n) => new Promise((r) => {
22
+ let { categories: c, correct: l } = a(r, i, s, o), u = h(o);
23
+ return f.enabled(e, n) && !u.length ? m(o, c) : +!!l;
24
+ }, _ = (e, t, n) => new Promise((r) => {
25
25
  if (n.mode === "evaluate") {
26
- let i = h(e, t, n);
26
+ let i = g(e, t, n);
27
27
  r(i === 1 ? "correct" : i === 0 ? "incorrect" : "partially-correct");
28
28
  } else r(void 0);
29
- }), _ = (e = {}) => new Promise((t) => {
30
- t({
31
- ...r,
32
- ...e
29
+ }), v = (t = {}) => new Promise((n) => {
30
+ n({
31
+ ...e,
32
+ ...t
33
33
  });
34
- }), v = (e) => ({
35
- ...r,
36
- ...e
37
- }), y = async (t, n, r, i) => {
38
- let a = v(t), o = await g(a, n, r), { mode: s, role: d } = r || {}, { categories: p, categoriesPerRow: h, choicesLabel: _, choicesPosition: y, correctResponse: b, feedback: x, feedbackEnabled: S, promptEnabled: C, prompt: w, rowLabels: T, rationaleEnabled: E, rationale: D, teacherInstructionsEnabled: O, teacherInstructions: k, language: A, maxChoicesPerCategory: j, extraCSSRules: M, minRowHeight: N, fontSizeFactor: P, autoplayAudioEnabled: F, completeAudioEnabled: I, customAudioButton: L } = a, { choices: R, note: z } = a, B, V = u(a, n, r), H = b.map((e) => {
34
+ }), y = (t) => ({
35
+ ...e,
36
+ ...t
37
+ }), b = async (e, n, r, a) => {
38
+ let o = y(e), s = await _(o, n, r), { mode: c, role: f } = r || {}, { categories: m, categoriesPerRow: g, choicesLabel: v, choicesPosition: b, correctResponse: x, feedback: S, feedbackEnabled: C, promptEnabled: w, prompt: T, rowLabels: E, rationaleEnabled: D, rationale: O, teacherInstructionsEnabled: k, teacherInstructions: A, language: j, maxChoicesPerCategory: M, extraCSSRules: N, minRowHeight: P, fontSizeFactor: F, autoplayAudioEnabled: I, completeAudioEnabled: L, customAudioButton: R } = o, { choices: z, note: B } = o, V, H = d(o, n, r), U = x.map((e) => {
39
39
  let t = (e.choices || []).filter((e) => e !== "null");
40
40
  return {
41
41
  ...e,
42
42
  choices: t
43
43
  };
44
44
  });
45
- s === "evaluate" && S && (B = await c(o, x)), V || (R = await l(R, n, i, "id")), z ||= f.t("common:commonCorrectAnswerWithAlternates", { lng: A });
46
- let U = m(H), { responseAreasToBeFilled: W, possibleResponses: G, hasUnplacedChoices: K } = e(H, a.allowAlternateEnabled ? U : [], a.choices), q = {
47
- categories: p || [],
48
- categoriesPerRow: h || 2,
49
- maxChoicesPerCategory: j,
50
- correctness: o,
51
- choices: R || [],
52
- choicesLabel: _ || "",
53
- choicesPosition: y,
54
- disabled: s !== "gather",
55
- feedback: B,
56
- lockChoiceOrder: V,
57
- prompt: C ? w : null,
58
- rowLabels: T,
59
- note: z,
45
+ c === "evaluate" && C && (V = await l(s, S)), H || (z = await u(z, n, a, "id"));
46
+ let W = (() => {
47
+ if (e.allowMultiplePlacementsEnabled != null) return e.allowMultiplePlacementsEnabled;
48
+ let t = (x || []).flatMap((e) => e.choices || []);
49
+ return t.length === new Set(t).size ? i.disabled : i.enabled;
50
+ })();
51
+ z = (z || []).map((e) => {
52
+ let t;
53
+ return t = W === i.enabled ? 0 : W === i.disabled ? 1 : e.categoryCount || 0, {
54
+ ...e,
55
+ categoryCount: t
56
+ };
57
+ }), B ||= p.t("common:commonCorrectAnswerWithAlternates", { lng: j });
58
+ let G = h(U), { responseAreasToBeFilled: K, possibleResponses: q, hasUnplacedChoices: J } = t(U, o.allowAlternateEnabled ? G : [], o.choices), Y = {
59
+ categories: m || [],
60
+ categoriesPerRow: g || 2,
61
+ maxChoicesPerCategory: M,
62
+ correctness: s,
63
+ choices: z || [],
64
+ choicesLabel: v || "",
65
+ choicesPosition: b,
66
+ disabled: c !== "gather",
67
+ feedback: V,
68
+ lockChoiceOrder: H,
69
+ prompt: w ? T : null,
70
+ rowLabels: E,
71
+ note: B,
60
72
  env: r,
61
- showNote: U && U.length > 0,
62
- correctResponse: s === "evaluate" ? H : void 0,
63
- language: A,
64
- extraCSSRules: M,
65
- fontSizeFactor: P,
66
- minRowHeight: N,
67
- autoplayAudioEnabled: F,
68
- completeAudioEnabled: I,
69
- customAudioButton: L,
70
- possibleResponses: G,
71
- responseAreasToBeFilled: W,
72
- hasUnplacedChoices: K
73
+ showNote: G && G.length > 0,
74
+ correctResponse: c === "evaluate" ? U : void 0,
75
+ language: j,
76
+ extraCSSRules: N,
77
+ fontSizeFactor: F,
78
+ minRowHeight: P,
79
+ autoplayAudioEnabled: I,
80
+ completeAudioEnabled: L,
81
+ customAudioButton: R,
82
+ possibleResponses: q,
83
+ responseAreasToBeFilled: K,
84
+ hasUnplacedChoices: J,
85
+ ...e.allowMultiplePlacementsEnabled == null && { allowMultiplePlacementsEnabled: W }
73
86
  };
74
- return d === "instructor" && (s === "view" || s === "evaluate") ? (q.rationale = E ? D : null, q.teacherInstructions = O ? k : null) : (q.rationale = null, q.teacherInstructions = null), q;
75
- }, b = (e, t, n) => {
76
- let r = [], { answers: a } = t || {}, { categories: o, choices: s, correctResponse: c } = e || {}, l = a.reduce((e, t) => e + (t.choices?.length || 0), 0), u = m(c).length > 0, f = d.enabled(e, n), p = (l > 0 ? i(o, s, a, c) : null)?.categories || [];
77
- if (l > 0 ? (r.push(`Student placed ${l} choice(s) into categories.`), (o || []).forEach((e, t) => {
78
- let n = e.id, i = p.find((e) => e.id === n), a = i && i.choices || [], o = (c || []).find((e) => e.category === n), s = o && o.choices || [];
79
- if (s.length > 0) if (a.length === 0) r.push(`Category ${n}: student left empty (should contain ${s.length} choice(s)).`);
87
+ return f === "instructor" && (c === "view" || c === "evaluate") ? (Y.rationale = D ? O : null, Y.teacherInstructions = k ? A : null) : (Y.rationale = null, Y.teacherInstructions = null), Y;
88
+ }, x = (e, t, n) => {
89
+ let r = [], { answers: i } = t || {}, { categories: o, choices: s, correctResponse: c } = e || {}, l = i.reduce((e, t) => e + (t.choices?.length || 0), 0), u = h(c).length > 0, d = f.enabled(e, n), p = (l > 0 ? a(o, s, i, c) : null)?.categories || [];
90
+ if (l > 0 ? (r.push(`Student placed ${l} choice(s) into categories.`), (o || []).forEach((e) => {
91
+ let t = e.id, n = p.find((e) => e.id === t), i = n && n.choices || [], a = (c || []).find((e) => e.category === t), o = a && a.choices || [];
92
+ if (o.length > 0) if (i.length === 0) r.push(`Category ${t}: student left empty (should contain ${o.length} choice(s)).`);
80
93
  else {
81
- let e = a.filter((e) => e.correct).length, t = a.length - e;
82
- e > 0 && t === 0 ? r.push(`Category ${n}: student placed ${e} correct choice(s).`) : e === 0 && t > 0 ? r.push(`Category ${n}: student placed ${t} incorrect choice(s).`) : r.push(`Category ${n}: student placed ${e} correct and ${t} incorrect choice(s).`);
94
+ let e = i.filter((e) => e.correct).length, n = i.length - e;
95
+ e > 0 && n === 0 ? r.push(`Category ${t}: student placed ${e} correct choice(s).`) : e === 0 && n > 0 ? r.push(`Category ${t}: student placed ${n} incorrect choice(s).`) : r.push(`Category ${t}: student placed ${e} correct and ${n} incorrect choice(s).`);
83
96
  }
84
97
  })) : r.push("Student did not place any choices into categories."), u && r.push("Alternate response combinations are accepted for this question."), u) r.push("Score calculated using all-or-nothing scoring (alternate responses disable partial scoring)."), r.push("Student must get all categories completely correct to receive full credit.");
85
- else if (f) {
98
+ else if (d) {
86
99
  if (r.push("Score calculated using partial scoring."), r.push("Student receives credit for each correct placement, with deductions for incorrect placements beyond required amount."), l > 0) {
87
100
  let e = p.reduce((e, t) => e + (t.choices || []).filter((e) => e.correct).length, 0), t = l - e, n = (c || []).reduce((e, t) => e + (t.choices || []).length, 0);
88
101
  if (r.push(`Partial scoring calculation: ${e} correct placements, ${t} incorrect placements.`), l > n) {
@@ -91,23 +104,23 @@ var { translator: f } = o, p = (e, t) => {
91
104
  }
92
105
  }
93
106
  } else r.push("Score calculated using all-or-nothing scoring."), r.push("Student must get all categories completely correct to receive full credit.");
94
- let g = h(e, t, n);
95
- return r.push(`Final score: ${g}.`), r;
96
- }, x = (e, t, n) => n.mode === "evaluate" ? new Promise((r) => {
97
- if (!t || s(t)) r({
107
+ let m = g(e, t, n);
108
+ return r.push(`Final score: ${m}.`), r;
109
+ }, S = (e, t, n) => n.mode === "evaluate" ? new Promise((r) => {
110
+ if (!t || c(t)) r({
98
111
  score: 0,
99
112
  empty: !0,
100
113
  traceLog: ["Student did not place any choices into categories. Score is 0."]
101
114
  });
102
115
  else {
103
- let i = b(e, t, n);
116
+ let i = x(e, t, n);
104
117
  r({
105
- score: h(e, t, n),
118
+ score: g(e, t, n),
106
119
  empty: !1,
107
120
  traceLog: i
108
121
  });
109
122
  }
110
- }) : Promise.reject(/* @__PURE__ */ Error("Can not call outcome when mode is not evaluate")), S = (e, t) => new Promise((n) => {
123
+ }) : Promise.reject(/* @__PURE__ */ Error("Can not call outcome when mode is not evaluate")), C = (e, t) => new Promise((n) => {
111
124
  let { mode: r, role: i } = t || {};
112
125
  if (r !== "evaluate" && i === "instructor") {
113
126
  let { correctResponse: t } = e;
@@ -116,23 +129,23 @@ var { translator: f } = o, p = (e, t) => {
116
129
  id: 1
117
130
  });
118
131
  } else return n(null);
119
- }), C = (e) => (e || "").replaceAll(/<[^>]*>/g, ""), w = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), T = (e = {}, r = {}) => {
120
- let { categories: i, choices: a, correctResponse: o, maxAnswerChoices: c } = e, { minChoices: l = 1, minCategories: u = 1, maxCategories: d = 12, maxLengthPerChoice: f = 300, maxLengthPerCategory: p = 150 } = r, m = [...a || []].reverse(), h = {}, g = {}, _ = {};
132
+ }), w = (e) => (e || "").replaceAll(/<[^>]*>/g, ""), T = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), E = (e = {}, t = {}) => {
133
+ let { categories: i, choices: a, correctResponse: o, maxAnswerChoices: s } = e, { minChoices: l = 1, minCategories: u = 1, maxCategories: d = 12, maxLengthPerChoice: f = 300, maxLengthPerCategory: p = 150 } = t, m = [...a || []].reverse(), h = {}, g = {}, _ = {};
121
134
  [
122
135
  "teacherInstructions",
123
136
  "prompt",
124
137
  "rationale"
125
- ].forEach((t) => {
126
- r[t]?.required && !w(e[t]) && (h[t] = "This field is required.");
138
+ ].forEach((n) => {
139
+ t[n]?.required && !T(e[n]) && (h[n] = "This field is required.");
127
140
  }), (i || []).forEach((e) => {
128
141
  let { id: t, label: n } = e;
129
- C(n).length > p && (_[t] = `Category labels should be no more than ${p} characters long.`);
142
+ w(n).length > p && (_[t] = `Category labels should be no more than ${p} characters long.`);
130
143
  }), (m || []).forEach((e, t) => {
131
144
  let { id: n, content: r } = e;
132
- C(r).length > f && (g[n] = `Tokens should be no more than ${f} characters long.`), w(r) ? m.slice(t + 1).some((e) => e.content === r) && (g[n] = "Tokens content should be unique.") : g[n] = "Tokens should not be empty.";
145
+ w(r).length > f && (g[n] = `Tokens should be no more than ${f} characters long.`), T(r) ? m.slice(t + 1).some((e) => e.content === r) && (g[n] = "Tokens content should be unique.") : g[n] = "Tokens should not be empty.";
133
146
  });
134
147
  let v = (i || []).length, y = (a || []).length;
135
- if (v > d ? h.categoriesError = `No more than ${d} categories should be defined.` : v < u && (h.categoriesError = `There should be at least ${u} category defined.`), y < l ? h.choicesError = `There should be at least ${l} choices defined.` : y > c && (h.choicesError = `No more than ${c} choices should be defined.`), y && v) {
148
+ if (v > d ? h.categoriesError = `No more than ${d} categories should be defined.` : v < u && (h.categoriesError = `There should be at least ${u} category defined.`), y < l ? h.choicesError = `There should be at least ${l} choices defined.` : y > s && (h.choicesError = `No more than ${s} choices should be defined.`), y && v) {
136
149
  let e = !1;
137
150
  (o || []).forEach((t) => {
138
151
  let { choices: n = [], alternateResponses: r = [] } = t;
@@ -140,16 +153,16 @@ var { translator: f } = o, p = (e, t) => {
140
153
  (t || []).length && (e = !0);
141
154
  });
142
155
  });
143
- let r = -1, i = "";
156
+ let t = -1, i = "";
144
157
  (o || []).forEach((e) => {
145
158
  let { choices: a = [], alternateResponses: o = [], category: s } = e;
146
- r === -1 && (r = n(a, o), r === -1 && (r = t(o)), i = s);
147
- }), r > -1 && (h.duplicateAlternate = {
148
- index: r,
159
+ t === -1 && (t = r(a, o), t === -1 && (t = n(o)), i = s);
160
+ }), t > -1 && (h.duplicateAlternate = {
161
+ index: t,
149
162
  category: i
150
163
  }), e || (h.associationError = "At least one token should be assigned to at least one category.");
151
164
  }
152
- return s(g) || (h.choicesErrors = g), s(_) || (h.categoriesErrors = _), h;
165
+ return c(g) || (h.choicesErrors = g), c(_) || (h.categoriesErrors = _), h;
153
166
  };
154
167
  //#endregion
155
- export { S as createCorrectResponseSession, _ as createDefaultModel, g as getCorrectness, b as getLogTrace, p as getPartialScore, h as getTotalScore, y as model, v as normalize, x as outcome, a as score, T as validate };
168
+ export { C as createCorrectResponseSession, v as createDefaultModel, _ as getCorrectness, x as getLogTrace, m as getPartialScore, g as getTotalScore, b as model, y as normalize, S as outcome, o as score, E as validate };
@@ -1,5 +1,5 @@
1
- import e from "./grid-content.js";
2
- import t, { CategoryType as n } from "./category.js";
1
+ import { GridContent as e } from "./grid-content.js";
2
+ import { Category as t, CategoryType as n } from "./category.js";
3
3
  import r from "react";
4
4
  import { color as i } from "@pie-lib/render-ui";
5
5
  import a from "prop-types";
@@ -63,4 +63,4 @@ var l = class extends r.Component {
63
63
  flexDirection: "column"
64
64
  });
65
65
  //#endregion
66
- export { l as default };
66
+ export { l as Categories, l as default, n as CategoryType };
@@ -45,4 +45,4 @@ var o = {
45
45
  flex: 2
46
46
  }));
47
47
  //#endregion
48
- export { o as CategoryType, s as default };
48
+ export { s as Category, s as default, o as CategoryType };
@@ -91,4 +91,4 @@ h.propTypes = {
91
91
  };
92
92
  var g = o.withUid(h);
93
93
  //#endregion
94
- export { u as ChoiceType, g as default };
94
+ export { u as ChoiceType, m as Layout, g as default };
@@ -48,4 +48,4 @@ var c = a("div")({
48
48
  }
49
49
  };
50
50
  //#endregion
51
- export { u as default };
51
+ export { t as ChoiceType, u as Choices, u as default };
@@ -36,4 +36,4 @@ var i = class extends e.Component {
36
36
  gridAutoRows: "1fr"
37
37
  }));
38
38
  //#endregion
39
- export { i as default };
39
+ export { i as GridContent, i as default };
@@ -1,6 +1,6 @@
1
1
  import e from "./choice.js";
2
- import t from "./choices.js";
3
- import n from "./categories.js";
2
+ import { Choices as t } from "./choices.js";
3
+ import { Categories as n } from "./categories.js";
4
4
  import r from "react";
5
5
  import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
6
6
  import * as a from "@pie-lib/render-ui";
@@ -257,4 +257,4 @@ var k = O(l, "UiLayout") || O(F.UiLayout, "UiLayout"), A = O(c, "PreviewPrompt")
257
257
  flexDirection: "column"
258
258
  })), W = h(j)(({ theme: e }) => ({ paddingBottom: e.spacing(2) }));
259
259
  //#endregion
260
- export { B as default };
260
+ export { z as Categorize, B as default };
@@ -55,7 +55,7 @@ var u = l(a, "EnableAudioAutoplayImage") || l(p.EnableAudioAutoplayImage, "Enabl
55
55
  isComplete() {
56
56
  let { autoplayAudioEnabled: e, choices: t, completeAudioEnabled: n, hasUnplacedChoices: r, possibleResponses: i, responseAreasToBeFilled: a } = this._model || {}, o = this;
57
57
  if (e && n && !this.audioComplete && o) {
58
- let e = o.querySelector("audio"), t = e && e.closest("#preview-prompt");
58
+ let e = o.querySelector("audio"), t = e && e.closest(".preview-prompt");
59
59
  if (e && t) return !1;
60
60
  }
61
61
  if (!this._session || !this._session.answers) return !1;
@@ -104,7 +104,7 @@ var u = l(a, "EnableAudioAutoplayImage") || l(p.EnableAudioAutoplayImage, "Enabl
104
104
  e.forEach((e) => {
105
105
  if (e.type === "childList") {
106
106
  if (this._audioInitialized) return;
107
- let e = this.querySelector("audio"), n = e && e.closest("#preview-prompt");
107
+ let e = this.querySelector("audio"), n = e && e.closest(".preview-prompt");
108
108
  if (!this._model || !this._model.autoplayAudioEnabled || e && !n || !e) return;
109
109
  let r = this._createAudioInfoToast(), i = this.querySelector("#main-container"), a = () => {
110
110
  this.querySelector("#play-audio-info") && (e.play(), i.removeChild(r)), document.removeEventListener("click", a);