@pie-element/simple-cloze 0.1.10-next.20261016234357 → 0.1.10

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 (33) hide show
  1. package/dist/browser/author/index.js +2 -2
  2. package/dist/browser/controller/index.js +1 -1
  3. package/dist/browser/{controller-D4LMu0Qk.js → controller-DKaHN4QB.js} +2 -2
  4. package/dist/browser/{controller-D4LMu0Qk.js.map → controller-DKaHN4QB.js.map} +1 -1
  5. package/dist/browser/delivery/index.js +2 -2
  6. package/dist/browser/editor-runtime/author/index.js +2 -2
  7. package/dist/browser/editor-runtime/controller/index.js +1 -1
  8. package/dist/browser/editor-runtime/{controller-D4LMu0Qk.js → controller-DKaHN4QB.js} +2 -2
  9. package/dist/browser/editor-runtime/{controller-D4LMu0Qk.js.map → controller-DKaHN4QB.js.map} +1 -1
  10. package/dist/browser/editor-runtime/delivery/index.js +2 -2
  11. package/dist/browser/editor-runtime/{i18n-DT9CzQ-W.js → i18n-_NhFjJ90.js} +54 -54
  12. package/dist/browser/editor-runtime/i18n-_NhFjJ90.js.map +1 -0
  13. package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-C2Z-zfZO.js → mathjax-DqXi3q4c-BeXFIX6Q.js} +3 -3
  14. package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-C2Z-zfZO.js.map → mathjax-DqXi3q4c-BeXFIX6Q.js.map} +1 -1
  15. package/dist/browser/editor-runtime/print/index.js +2 -2
  16. package/dist/browser/{i18n-DT9CzQ-W.js → i18n-_NhFjJ90.js} +54 -54
  17. package/dist/browser/i18n-_NhFjJ90.js.map +1 -0
  18. package/dist/browser/{mathjax-CptWnMbQ-C2Z-zfZO.js → mathjax-DqXi3q4c-BeXFIX6Q.js} +3 -3
  19. package/dist/browser/{mathjax-CptWnMbQ-C2Z-zfZO.js.map → mathjax-DqXi3q4c-BeXFIX6Q.js.map} +1 -1
  20. package/dist/browser/print/index.js +2 -2
  21. package/dist/delivery/index.js +332 -332
  22. package/dist/delivery/index.js.map +1 -1
  23. package/dist/index.iife.js +1 -1
  24. package/dist/print/index.js +332 -332
  25. package/dist/print/index.js.map +1 -1
  26. package/dist/schemas/configuration.schema.json +1 -1
  27. package/dist/schemas/model.schema.json +1 -1
  28. package/dist/schemas/session.schema.json +1 -1
  29. package/module/print.js +31 -31
  30. package/module/print.js.map +1 -1
  31. package/package.json +5 -5
  32. package/dist/browser/editor-runtime/i18n-DT9CzQ-W.js.map +0 -1
  33. package/dist/browser/i18n-DT9CzQ-W.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as ee, m as te, n as w, o as ne, p as re, r as ie, s as ae, t as oe, u as T, v as se, w as ce, x as E, y as D, z as le } from "../client-e4ZTphpa.js";
2
- import { n as ue, u as de } from "../controller-D4LMu0Qk.js";
2
+ import { n as ue, u as de } from "../controller-DKaHN4QB.js";
3
3
  //#region ../../shared/configure-events/dist/index.js
4
4
  var fe = class e extends CustomEvent {
5
5
  static {
@@ -17610,7 +17610,7 @@ E(["input"]), oe(IS, {
17610
17610
  //#region src/author/index.ts
17611
17611
  var LS = IS.element, RS = Object.freeze({
17612
17612
  name: "@pie-element/simple-cloze",
17613
- version: "0.1.10-next.20261016234357"
17613
+ version: "0.1.10"
17614
17614
  });
17615
17615
  //#endregion
17616
17616
  export { LS as default, RS as piePackage };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../controller-D4LMu0Qk.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../controller-DKaHN4QB.js";
2
2
  export { c as createCorrectResponseSession, i as createDefaultModel, o as getCorrectness, n as getPartialScore, e as model, a as normalizeSession, s as outcome, t as piePackage, r as validate };
@@ -64,9 +64,9 @@ var t = {
64
64
  return t?.prompt?.required && !r(e?.prompt) && (i.prompt = "This field is required."), n(e?.correctAnswer) || (i.correctAnswer = "No correct answer defined."), i;
65
65
  }, p = Object.freeze({
66
66
  name: "@pie-element/simple-cloze",
67
- version: "0.1.10-next.20261016234357"
67
+ version: "0.1.10"
68
68
  });
69
69
  //#endregion
70
70
  export { u as a, p as c, a as i, f as l, c as n, l as o, i as r, s, d as t, t as u };
71
71
 
72
- //# sourceMappingURL=controller-D4LMu0Qk.js.map
72
+ //# sourceMappingURL=controller-DKaHN4QB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller-D4LMu0Qk.js","names":[],"sources":["../../src/controller/defaults.ts","../../src/controller/index.ts"],"sourcesContent":["import type { SimpleClozeConfiguration, SimpleClozeModel } from '../types.js';\n\nexport default {\n model: {\n prompt: '<p>Enter your answer:</p>',\n promptEnabled: true,\n correctAnswer: '',\n teacherInstructionsEnabled: true,\n },\n configuration: {\n prompt: {\n label: 'Prompt',\n settings: true,\n },\n teacherInstructions: {\n label: 'Teacher Instructions',\n settings: true,\n },\n settingsPanelDisabled: false,\n },\n} satisfies {\n model: Omit<SimpleClozeModel, 'id' | 'element'>;\n configuration: SimpleClozeConfiguration;\n};\n","import defaults from './defaults.js';\nimport { toPlainText } from './plain-text.js';\nimport type { SimpleClozeConfiguration, SimpleClozeModel, SimpleClozeSession } from '../types.js';\n\nexport type SimpleClozeEnv = {\n mode?: string;\n role?: string;\n [key: string]: unknown;\n};\n\nexport type SimpleClozeCorrectness = 'correct' | 'incorrect' | 'unanswered';\n\nexport type SimpleClozeOutcome = {\n score: number;\n empty: boolean;\n traceLog: string[];\n};\n\n/**\n * Both sides compare as plain text, case-insensitively: an answer key authored\n * as HTML matches the text a learner types.\n */\nconst comparable = (value: unknown): string => toPlainText(value).toLowerCase();\n\n// Strips tags except img, iframe and source (media counts as content), as\n// multiple-choice's `getContent` does.\nconst hasContent = (html: unknown): boolean =>\n typeof html === 'string' &&\n html\n .replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0;\n\n/**\n * A response with no text is unanswered; an answer key with no text matches\n * nothing, so a blank key never scores.\n */\nexport const getCorrectness = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): SimpleClozeCorrectness => {\n const response = comparable(session?.value);\n if (!response) {\n return 'unanswered';\n }\n\n const key = comparable(question?.correctAnswer);\n if (key && response === key) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n/** Single response, all-or-nothing: 1 when it matches the answer key, else 0. */\nexport const getPartialScore = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): number => (getCorrectness(question, session) === 'correct' ? 1 : 0);\n\nconst getTraceLog = (\n question: Partial<SimpleClozeModel> | null | undefined,\n correctness: SimpleClozeCorrectness,\n score: number\n): string[] => {\n const traceLog = [\n 'Response is compared with the answer key as plain text, ignoring case and extra spaces.',\n ];\n if (!comparable(question?.correctAnswer)) {\n traceLog.push('No correct answer is defined, so no response can score.');\n } else {\n traceLog.push(\n correctness === 'correct'\n ? 'Response matches the answer key.'\n : 'Response does not match the answer key.'\n );\n }\n traceLog.push(`Final score: ${score}.`);\n return traceLog;\n};\n\nexport const outcome = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n _env: SimpleClozeEnv = {}\n): Promise<SimpleClozeOutcome> =>\n new Promise((resolve) => {\n const correctness = getCorrectness(question, session);\n\n if (correctness === 'unanswered') {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['Student did not enter a response. Score is 0.'],\n });\n return;\n }\n\n const score = correctness === 'correct' ? 1 : 0;\n resolve({ score, empty: false, traceLog: getTraceLog(question, correctness, score) });\n });\n\nexport const createDefaultModel = (\n model: Partial<SimpleClozeModel> = {}\n): Partial<SimpleClozeModel> => ({\n ...defaults.model,\n ...model,\n});\n\nexport const normalizeSession = (s: SimpleClozeSession | null | undefined): SimpleClozeSession => ({\n ...s,\n});\n\nexport const model = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<Record<string, unknown>> => {\n return new Promise((resolve) => {\n const safeSession = session || {};\n const safeEnv = env || {};\n const normalizedQuestion = createDefaultModel(question || {});\n\n const out: Record<string, unknown> = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n disabled: safeEnv.mode !== 'gather',\n mode: safeEnv.mode,\n role: safeEnv.role,\n language: normalizedQuestion.language,\n };\n\n if (safeEnv.mode === 'evaluate') {\n out.correctness = getCorrectness(normalizedQuestion, safeSession);\n // The key is shown in the text input, so it goes out as plain text.\n out.correctAnswer = toPlainText(normalizedQuestion.correctAnswer);\n }\n\n if (safeEnv.role === 'instructor' && (safeEnv.mode === 'view' || safeEnv.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (\n question: Partial<SimpleClozeModel> | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<SimpleClozeSession | null> => {\n return new Promise((resolve) => {\n if (env?.mode !== 'evaluate' && env?.role === 'instructor') {\n // The player sets `id` and `element` on the entry from the item config.\n resolve({ id: '1', value: toPlainText(question?.correctAnswer) });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (\n model: Partial<SimpleClozeModel> = {},\n config: SimpleClozeConfiguration = {}\n): Record<string, string> => {\n const errors: Record<string, string> = {};\n\n if (config?.prompt?.required && !hasContent(model?.prompt)) {\n errors.prompt = 'This field is required.';\n }\n\n if (!comparable(model?.correctAnswer)) {\n errors.correctAnswer = 'No correct answer defined.';\n }\n\n return errors;\n};\n"],"mappings":";;AAEA,IAAA,IAAe;CACb,OAAO;EACL,QAAQ;EACR,eAAe;EACf,eAAe;EACf,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AC1B,IAAU,KAAO,CAAC,GAClB,IAAqB,EAAmB,KAAY,CAAC,CAAC,GAEtD,IAA+B;EACnC,QAAQ,EAAmB,gBAAgB,EAAmB,SAAS;EACvE,UAAU,EAAQ,SAAS;EAC3B,MAAM,EAAQ;EACd,MAAM,EAAQ;EACd,UAAU,EAAmB;CAC/B;CAgBA,AAdI,EAAQ,SAAS,eACnB,EAAI,cAAc,EAAe,GAAoB,CAAW,GAEhE,EAAI,gBAAgB,EAAY,EAAmB,aAAa,IAG9D,EAAQ,SAAS,iBAAiB,EAAQ,SAAS,UAAU,EAAQ,SAAS,cAChF,EAAI,sBAAsB,EAAmB,6BACzC,EAAmB,sBACnB,OAEJ,EAAI,sBAAsB,MAG5B,EAAQ,CAAG;AACb,CAAC,GAGU,KACX,GACA,MAEO,IAAI,SAAS,MAAY;CAC9B,AAAI,GAAK,SAAS,cAAc,GAAK,SAAS,eAE5C,EAAQ;EAAE,IAAI;EAAK,OAAO,EAAY,GAAU,aAAa;CAAE,CAAC,IAEhE,EAAQ,IAAI;AAEhB,CAAC,GAGU,KACX,IAAmC,CAAC,GACpC,IAAmC,CAAC,MACT;CAC3B,IAAM,IAAiC,CAAC;CAUxC,OARI,GAAQ,QAAQ,YAAY,CAAC,EAAW,GAAO,MAAM,MACvD,EAAO,SAAS,4BAGb,EAAW,GAAO,aAAa,MAClC,EAAO,gBAAgB,+BAGlB;AACT"}
1
+ {"version":3,"file":"controller-DKaHN4QB.js","names":[],"sources":["../../src/controller/defaults.ts","../../src/controller/index.ts"],"sourcesContent":["import type { SimpleClozeConfiguration, SimpleClozeModel } from '../types.js';\n\nexport default {\n model: {\n prompt: '<p>Enter your answer:</p>',\n promptEnabled: true,\n correctAnswer: '',\n teacherInstructionsEnabled: true,\n },\n configuration: {\n prompt: {\n label: 'Prompt',\n settings: true,\n },\n teacherInstructions: {\n label: 'Teacher Instructions',\n settings: true,\n },\n settingsPanelDisabled: false,\n },\n} satisfies {\n model: Omit<SimpleClozeModel, 'id' | 'element'>;\n configuration: SimpleClozeConfiguration;\n};\n","import defaults from './defaults.js';\nimport { toPlainText } from './plain-text.js';\nimport type { SimpleClozeConfiguration, SimpleClozeModel, SimpleClozeSession } from '../types.js';\n\nexport type SimpleClozeEnv = {\n mode?: string;\n role?: string;\n [key: string]: unknown;\n};\n\nexport type SimpleClozeCorrectness = 'correct' | 'incorrect' | 'unanswered';\n\nexport type SimpleClozeOutcome = {\n score: number;\n empty: boolean;\n traceLog: string[];\n};\n\n/**\n * Both sides compare as plain text, case-insensitively: an answer key authored\n * as HTML matches the text a learner types.\n */\nconst comparable = (value: unknown): string => toPlainText(value).toLowerCase();\n\n// Strips tags except img, iframe and source (media counts as content), as\n// multiple-choice's `getContent` does.\nconst hasContent = (html: unknown): boolean =>\n typeof html === 'string' &&\n html\n .replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0;\n\n/**\n * A response with no text is unanswered; an answer key with no text matches\n * nothing, so a blank key never scores.\n */\nexport const getCorrectness = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): SimpleClozeCorrectness => {\n const response = comparable(session?.value);\n if (!response) {\n return 'unanswered';\n }\n\n const key = comparable(question?.correctAnswer);\n if (key && response === key) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n/** Single response, all-or-nothing: 1 when it matches the answer key, else 0. */\nexport const getPartialScore = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): number => (getCorrectness(question, session) === 'correct' ? 1 : 0);\n\nconst getTraceLog = (\n question: Partial<SimpleClozeModel> | null | undefined,\n correctness: SimpleClozeCorrectness,\n score: number\n): string[] => {\n const traceLog = [\n 'Response is compared with the answer key as plain text, ignoring case and extra spaces.',\n ];\n if (!comparable(question?.correctAnswer)) {\n traceLog.push('No correct answer is defined, so no response can score.');\n } else {\n traceLog.push(\n correctness === 'correct'\n ? 'Response matches the answer key.'\n : 'Response does not match the answer key.'\n );\n }\n traceLog.push(`Final score: ${score}.`);\n return traceLog;\n};\n\nexport const outcome = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n _env: SimpleClozeEnv = {}\n): Promise<SimpleClozeOutcome> =>\n new Promise((resolve) => {\n const correctness = getCorrectness(question, session);\n\n if (correctness === 'unanswered') {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['Student did not enter a response. Score is 0.'],\n });\n return;\n }\n\n const score = correctness === 'correct' ? 1 : 0;\n resolve({ score, empty: false, traceLog: getTraceLog(question, correctness, score) });\n });\n\nexport const createDefaultModel = (\n model: Partial<SimpleClozeModel> = {}\n): Partial<SimpleClozeModel> => ({\n ...defaults.model,\n ...model,\n});\n\nexport const normalizeSession = (s: SimpleClozeSession | null | undefined): SimpleClozeSession => ({\n ...s,\n});\n\nexport const model = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<Record<string, unknown>> => {\n return new Promise((resolve) => {\n const safeSession = session || {};\n const safeEnv = env || {};\n const normalizedQuestion = createDefaultModel(question || {});\n\n const out: Record<string, unknown> = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n disabled: safeEnv.mode !== 'gather',\n mode: safeEnv.mode,\n role: safeEnv.role,\n language: normalizedQuestion.language,\n };\n\n if (safeEnv.mode === 'evaluate') {\n out.correctness = getCorrectness(normalizedQuestion, safeSession);\n // The key is shown in the text input, so it goes out as plain text.\n out.correctAnswer = toPlainText(normalizedQuestion.correctAnswer);\n }\n\n if (safeEnv.role === 'instructor' && (safeEnv.mode === 'view' || safeEnv.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (\n question: Partial<SimpleClozeModel> | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<SimpleClozeSession | null> => {\n return new Promise((resolve) => {\n if (env?.mode !== 'evaluate' && env?.role === 'instructor') {\n // The player sets `id` and `element` on the entry from the item config.\n resolve({ id: '1', value: toPlainText(question?.correctAnswer) });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (\n model: Partial<SimpleClozeModel> = {},\n config: SimpleClozeConfiguration = {}\n): Record<string, string> => {\n const errors: Record<string, string> = {};\n\n if (config?.prompt?.required && !hasContent(model?.prompt)) {\n errors.prompt = 'This field is required.';\n }\n\n if (!comparable(model?.correctAnswer)) {\n errors.correctAnswer = 'No correct answer defined.';\n }\n\n return errors;\n};\n"],"mappings":";;AAEA,IAAA,IAAe;CACb,OAAO;EACL,QAAQ;EACR,eAAe;EACf,eAAe;EACf,4BAA4B;CAC9B;CACA,eAAe;EACb,QAAQ;GACN,OAAO;GACP,UAAU;EACZ;EACA,qBAAqB;GACnB,OAAO;GACP,UAAU;EACZ;EACA,uBAAuB;CACzB;AACF,GCEM,KAAc,MAA2B,EAAY,CAAK,CAAC,CAAC,YAAY,GAIxE,KAAc,MAClB,OAAO,KAAS,YAChB,EACG,QAAQ,sCAAsC,EAAE,CAAC,CACjD,QAAQ,YAAY,GAAG,CAAC,CACxB,KAAK,CAAC,CAAC,SAAS,GAMR,KACX,GACA,MAC2B;CAC3B,IAAM,IAAW,EAAW,GAAS,KAAK;CAC1C,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAM,EAAW,GAAU,aAAa;CAK9C,OAJI,KAAO,MAAa,IACf,YAGF;AACT,GAGa,KACX,GACA,MACY,IAAe,GAAU,CAAO,MAAM,YAE9C,KACJ,GACA,GACA,MACa;CACb,IAAM,IAAW,CACf,yFACF;CAWA,OAVK,EAAW,GAAU,aAAa,IAGrC,EAAS,KACP,MAAgB,YACZ,qCACA,yCACN,IANA,EAAS,KAAK,yDAAyD,GAQzE,EAAS,KAAK,gBAAgB,EAAM,EAAE,GAC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,IAAiC,CAAC;CAUxC,OARI,GAAQ,QAAQ,YAAY,CAAC,EAAW,GAAO,MAAM,MACvD,EAAO,SAAS,4BAGb,EAAW,GAAO,aAAa,MAClC,EAAO,gBAAgB,+BAGlB;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { C as e, E as t, F as n, I as r, M as i, N as a, O as o, P as s, R as c, S as l, T as u, _ as d, a as f, b as p, c as m, f as h, g, j as _, k as v, l as ee, n as y, r as b, t as x, u as S, w as C, x as w, y as T } from "../client-e4ZTphpa.js";
2
- import { l as E, n as D, r as O, t as k } from "../i18n-DT9CzQ-W.js";
2
+ import { l as E, n as D, r as O, t as k } from "../i18n-_NhFjJ90.js";
3
3
  //#region src/delivery/TeacherInstructions.svelte
4
4
  var A = T("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), j = {
5
5
  hash: "svelte-1jhejbv",
@@ -238,7 +238,7 @@ function R(e, t) {
238
238
  //#region src/delivery/index.ts
239
239
  var z = R(N, { isComplete: (e, t) => typeof t?.value == "string" && t.value.trim().length > 0 }), B = Object.freeze({
240
240
  name: "@pie-element/simple-cloze",
241
- version: "0.1.10-next.20261016234357"
241
+ version: "0.1.10"
242
242
  });
243
243
  //#endregion
244
244
  export { z as default, B as piePackage };
@@ -1,5 +1,5 @@
1
1
  import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I, z as L } from "../client-e4ZTphpa.js";
2
- import { n as R, u as ee } from "../controller-D4LMu0Qk.js";
2
+ import { n as R, u as ee } from "../controller-DKaHN4QB.js";
3
3
  import { Editor as te, Extension as ne } from "@tiptap/core";
4
4
  import { Plugin as re, PluginKey as ie, TextSelection as ae } from "@tiptap/pm/state";
5
5
  import { Table as oe, TableView as se } from "@tiptap/extension-table";
@@ -993,7 +993,7 @@ F(["input"]), j(At, {
993
993
  //#region src/author/index.ts
994
994
  var jt = At.element, Mt = Object.freeze({
995
995
  name: "@pie-element/simple-cloze",
996
- version: "0.1.10-next.20261016234357"
996
+ version: "0.1.10"
997
997
  });
998
998
  //#endregion
999
999
  export { jt as default, Mt as piePackage };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../controller-D4LMu0Qk.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../controller-DKaHN4QB.js";
2
2
  export { c as createCorrectResponseSession, i as createDefaultModel, o as getCorrectness, n as getPartialScore, e as model, a as normalizeSession, s as outcome, t as piePackage, r as validate };
@@ -64,9 +64,9 @@ var t = {
64
64
  return t?.prompt?.required && !r(e?.prompt) && (i.prompt = "This field is required."), n(e?.correctAnswer) || (i.correctAnswer = "No correct answer defined."), i;
65
65
  }, p = Object.freeze({
66
66
  name: "@pie-element/simple-cloze",
67
- version: "0.1.10-next.20261016234357"
67
+ version: "0.1.10"
68
68
  });
69
69
  //#endregion
70
70
  export { u as a, p as c, a as i, f as l, c as n, l as o, i as r, s, d as t, t as u };
71
71
 
72
- //# sourceMappingURL=controller-D4LMu0Qk.js.map
72
+ //# sourceMappingURL=controller-DKaHN4QB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller-D4LMu0Qk.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["import type { SimpleClozeConfiguration, SimpleClozeModel } from '../types.js';\n\nexport default {\n model: {\n prompt: '<p>Enter your answer:</p>',\n promptEnabled: true,\n correctAnswer: '',\n teacherInstructionsEnabled: true,\n },\n configuration: {\n prompt: {\n label: 'Prompt',\n settings: true,\n },\n teacherInstructions: {\n label: 'Teacher Instructions',\n settings: true,\n },\n settingsPanelDisabled: false,\n },\n} satisfies {\n model: Omit<SimpleClozeModel, 'id' | 'element'>;\n configuration: SimpleClozeConfiguration;\n};\n","import defaults from './defaults.js';\nimport { toPlainText } from './plain-text.js';\nimport type { SimpleClozeConfiguration, SimpleClozeModel, SimpleClozeSession } from '../types.js';\n\nexport type SimpleClozeEnv = {\n mode?: string;\n role?: string;\n [key: string]: unknown;\n};\n\nexport type SimpleClozeCorrectness = 'correct' | 'incorrect' | 'unanswered';\n\nexport type SimpleClozeOutcome = {\n score: number;\n empty: boolean;\n traceLog: string[];\n};\n\n/**\n * Both sides compare as plain text, case-insensitively: an answer key authored\n * as HTML matches the text a learner types.\n */\nconst comparable = (value: unknown): string => toPlainText(value).toLowerCase();\n\n// Strips tags except img, iframe and source (media counts as content), as\n// multiple-choice's `getContent` does.\nconst hasContent = (html: unknown): boolean =>\n typeof html === 'string' &&\n html\n .replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0;\n\n/**\n * A response with no text is unanswered; an answer key with no text matches\n * nothing, so a blank key never scores.\n */\nexport const getCorrectness = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): SimpleClozeCorrectness => {\n const response = comparable(session?.value);\n if (!response) {\n return 'unanswered';\n }\n\n const key = comparable(question?.correctAnswer);\n if (key && response === key) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n/** Single response, all-or-nothing: 1 when it matches the answer key, else 0. */\nexport const getPartialScore = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): number => (getCorrectness(question, session) === 'correct' ? 1 : 0);\n\nconst getTraceLog = (\n question: Partial<SimpleClozeModel> | null | undefined,\n correctness: SimpleClozeCorrectness,\n score: number\n): string[] => {\n const traceLog = [\n 'Response is compared with the answer key as plain text, ignoring case and extra spaces.',\n ];\n if (!comparable(question?.correctAnswer)) {\n traceLog.push('No correct answer is defined, so no response can score.');\n } else {\n traceLog.push(\n correctness === 'correct'\n ? 'Response matches the answer key.'\n : 'Response does not match the answer key.'\n );\n }\n traceLog.push(`Final score: ${score}.`);\n return traceLog;\n};\n\nexport const outcome = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n _env: SimpleClozeEnv = {}\n): Promise<SimpleClozeOutcome> =>\n new Promise((resolve) => {\n const correctness = getCorrectness(question, session);\n\n if (correctness === 'unanswered') {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['Student did not enter a response. Score is 0.'],\n });\n return;\n }\n\n const score = correctness === 'correct' ? 1 : 0;\n resolve({ score, empty: false, traceLog: getTraceLog(question, correctness, score) });\n });\n\nexport const createDefaultModel = (\n model: Partial<SimpleClozeModel> = {}\n): Partial<SimpleClozeModel> => ({\n ...defaults.model,\n ...model,\n});\n\nexport const normalizeSession = (s: SimpleClozeSession | null | undefined): SimpleClozeSession => ({\n ...s,\n});\n\nexport const model = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<Record<string, unknown>> => {\n return new Promise((resolve) => {\n const safeSession = session || {};\n const safeEnv = env || {};\n const normalizedQuestion = createDefaultModel(question || {});\n\n const out: Record<string, unknown> = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n disabled: safeEnv.mode !== 'gather',\n mode: safeEnv.mode,\n role: safeEnv.role,\n language: normalizedQuestion.language,\n };\n\n if (safeEnv.mode === 'evaluate') {\n out.correctness = getCorrectness(normalizedQuestion, safeSession);\n // The key is shown in the text input, so it goes out as plain text.\n out.correctAnswer = toPlainText(normalizedQuestion.correctAnswer);\n }\n\n if (safeEnv.role === 'instructor' && (safeEnv.mode === 'view' || safeEnv.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (\n question: Partial<SimpleClozeModel> | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<SimpleClozeSession | null> => {\n return new Promise((resolve) => {\n if (env?.mode !== 'evaluate' && env?.role === 'instructor') {\n // The player sets `id` and `element` on the entry from the item config.\n resolve({ id: '1', value: toPlainText(question?.correctAnswer) });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (\n model: Partial<SimpleClozeModel> = {},\n config: SimpleClozeConfiguration = {}\n): Record<string, string> => {\n const errors: Record<string, string> = {};\n\n if (config?.prompt?.required && !hasContent(model?.prompt)) {\n errors.prompt = 'This field is required.';\n }\n\n if (!comparable(model?.correctAnswer)) {\n errors.correctAnswer = 'No correct answer defined.';\n }\n\n return errors;\n};\n"],"mappings":";;AAEA,IAAA,IAAe;CACb,OAAO;EACL,QAAQ;EACR,eAAe;EACf,eAAe;EACf,4BAA4B;CAC9B;CACA,eAAe;EACb,QAAQ;GACN,OAAO;GACP,UAAU;EACZ;EACA,qBAAqB;GACnB,OAAO;GACP,UAAU;EACZ;EACA,uBAAuB;CACzB;AACF,GCEM,KAAc,MAA2B,EAAY,CAAK,CAAC,CAAC,YAAY,GAIxE,KAAc,MAClB,OAAO,KAAS,YAChB,EACG,QAAQ,sCAAsC,EAAE,CAAC,CACjD,QAAQ,YAAY,GAAG,CAAC,CACxB,KAAK,CAAC,CAAC,SAAS,GAMR,KACX,GACA,MAC2B;CAC3B,IAAM,IAAW,EAAW,GAAS,KAAK;CAC1C,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAM,EAAW,GAAU,aAAa;CAK9C,OAJI,KAAO,MAAa,IACf,YAGF;AACT,GAGa,KACX,GACA,MACY,IAAe,GAAU,CAAO,MAAM,YAE9C,KACJ,GACA,GACA,MACa;CACb,IAAM,IAAW,CACf,yFACF;CAWA,OAVK,EAAW,GAAU,aAAa,IAGrC,EAAS,KACP,MAAgB,YACZ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,IAAI;AAEhB,CAAC,GAGU,KACX,IAAmC,CAAC,GACpC,IAAmC,CAAC,MACT;CAC3B,IAAM,IAAiC,CAAC;CAUxC,OARI,GAAQ,QAAQ,YAAY,CAAC,EAAW,GAAO,MAAM,MACvD,EAAO,SAAS,4BAGb,EAAW,GAAO,aAAa,MAClC,EAAO,gBAAgB,+BAGlB;AACT"}
1
+ {"version":3,"file":"controller-DKaHN4QB.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["import type { SimpleClozeConfiguration, SimpleClozeModel } from '../types.js';\n\nexport default {\n model: {\n prompt: '<p>Enter your answer:</p>',\n promptEnabled: true,\n correctAnswer: '',\n teacherInstructionsEnabled: true,\n },\n configuration: {\n prompt: {\n label: 'Prompt',\n settings: true,\n },\n teacherInstructions: {\n label: 'Teacher Instructions',\n settings: true,\n },\n settingsPanelDisabled: false,\n },\n} satisfies {\n model: Omit<SimpleClozeModel, 'id' | 'element'>;\n configuration: SimpleClozeConfiguration;\n};\n","import defaults from './defaults.js';\nimport { toPlainText } from './plain-text.js';\nimport type { SimpleClozeConfiguration, SimpleClozeModel, SimpleClozeSession } from '../types.js';\n\nexport type SimpleClozeEnv = {\n mode?: string;\n role?: string;\n [key: string]: unknown;\n};\n\nexport type SimpleClozeCorrectness = 'correct' | 'incorrect' | 'unanswered';\n\nexport type SimpleClozeOutcome = {\n score: number;\n empty: boolean;\n traceLog: string[];\n};\n\n/**\n * Both sides compare as plain text, case-insensitively: an answer key authored\n * as HTML matches the text a learner types.\n */\nconst comparable = (value: unknown): string => toPlainText(value).toLowerCase();\n\n// Strips tags except img, iframe and source (media counts as content), as\n// multiple-choice's `getContent` does.\nconst hasContent = (html: unknown): boolean =>\n typeof html === 'string' &&\n html\n .replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0;\n\n/**\n * A response with no text is unanswered; an answer key with no text matches\n * nothing, so a blank key never scores.\n */\nexport const getCorrectness = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): SimpleClozeCorrectness => {\n const response = comparable(session?.value);\n if (!response) {\n return 'unanswered';\n }\n\n const key = comparable(question?.correctAnswer);\n if (key && response === key) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n/** Single response, all-or-nothing: 1 when it matches the answer key, else 0. */\nexport const getPartialScore = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined\n): number => (getCorrectness(question, session) === 'correct' ? 1 : 0);\n\nconst getTraceLog = (\n question: Partial<SimpleClozeModel> | null | undefined,\n correctness: SimpleClozeCorrectness,\n score: number\n): string[] => {\n const traceLog = [\n 'Response is compared with the answer key as plain text, ignoring case and extra spaces.',\n ];\n if (!comparable(question?.correctAnswer)) {\n traceLog.push('No correct answer is defined, so no response can score.');\n } else {\n traceLog.push(\n correctness === 'correct'\n ? 'Response matches the answer key.'\n : 'Response does not match the answer key.'\n );\n }\n traceLog.push(`Final score: ${score}.`);\n return traceLog;\n};\n\nexport const outcome = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n _env: SimpleClozeEnv = {}\n): Promise<SimpleClozeOutcome> =>\n new Promise((resolve) => {\n const correctness = getCorrectness(question, session);\n\n if (correctness === 'unanswered') {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['Student did not enter a response. Score is 0.'],\n });\n return;\n }\n\n const score = correctness === 'correct' ? 1 : 0;\n resolve({ score, empty: false, traceLog: getTraceLog(question, correctness, score) });\n });\n\nexport const createDefaultModel = (\n model: Partial<SimpleClozeModel> = {}\n): Partial<SimpleClozeModel> => ({\n ...defaults.model,\n ...model,\n});\n\nexport const normalizeSession = (s: SimpleClozeSession | null | undefined): SimpleClozeSession => ({\n ...s,\n});\n\nexport const model = (\n question: Partial<SimpleClozeModel> | null | undefined,\n session: SimpleClozeSession | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<Record<string, unknown>> => {\n return new Promise((resolve) => {\n const safeSession = session || {};\n const safeEnv = env || {};\n const normalizedQuestion = createDefaultModel(question || {});\n\n const out: Record<string, unknown> = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n disabled: safeEnv.mode !== 'gather',\n mode: safeEnv.mode,\n role: safeEnv.role,\n language: normalizedQuestion.language,\n };\n\n if (safeEnv.mode === 'evaluate') {\n out.correctness = getCorrectness(normalizedQuestion, safeSession);\n // The key is shown in the text input, so it goes out as plain text.\n out.correctAnswer = toPlainText(normalizedQuestion.correctAnswer);\n }\n\n if (safeEnv.role === 'instructor' && (safeEnv.mode === 'view' || safeEnv.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (\n question: Partial<SimpleClozeModel> | null | undefined,\n env: SimpleClozeEnv | null | undefined\n): Promise<SimpleClozeSession | null> => {\n return new Promise((resolve) => {\n if (env?.mode !== 'evaluate' && env?.role === 'instructor') {\n // The player sets `id` and `element` on the entry from the item config.\n resolve({ id: '1', value: toPlainText(question?.correctAnswer) });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (\n model: Partial<SimpleClozeModel> = {},\n config: SimpleClozeConfiguration = {}\n): Record<string, string> => {\n const errors: Record<string, string> = {};\n\n if (config?.prompt?.required && !hasContent(model?.prompt)) {\n errors.prompt = 'This field is required.';\n }\n\n if (!comparable(model?.correctAnswer)) {\n errors.correctAnswer = 'No correct answer defined.';\n }\n\n return errors;\n};\n"],"mappings":";;AAEA,IAAA,IAAe;CACb,OAAO;EACL,QAAQ;EACR,eAAe;EACf,eAAe;EACf,4BAA4B;CAC9B;CACA,eAAe;EACb,QAAQ;GACN,OAAO;GACP,UAAU;EACZ;EACA,qBAAqB;GACnB,OAAO;GACP,UAAU;EACZ;EACA,uBAAuB;CACzB;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AU,EAAQ,SAAS;EAC3B,MAAM,EAAQ;EACd,MAAM,EAAQ;EACd,UAAU,EAAmB;CAC/B;CAgBA,AAdI,EAAQ,SAAS,eACnB,EAAI,cAAc,EAAe,GAAoB,CAAW,GAEhE,EAAI,gBAAgB,EAAY,EAAmB,aAAa,IAG9D,EAAQ,SAAS,iBAAiB,EAAQ,SAAS,UAAU,EAAQ,SAAS,cAChF,EAAI,sBAAsB,EAAmB,6BACzC,EAAmB,sBACnB,OAEJ,EAAI,sBAAsB,MAG5B,EAAQ,CAAG;AACb,CAAC,GAGU,KACX,GACA,MAEO,IAAI,SAAS,MAAY;CAC9B,AAAI,GAAK,SAAS,cAAc,GAAK,SAAS,eAE5C,EAAQ;EAAE,IAAI;EAAK,OAAO,EAAY,GAAU,aAAa;CAAE,CAAC,IAEhE,EAAQ,IAAI;AAEhB,CAAC,GAGU,KACX,IAAmC,CAAC,GACpC,IAAmC,CAAC,MACT;CAC3B,IAAM,IAAiC,CAAC;CAUxC,OARI,GAAQ,QAAQ,YAAY,CAAC,EAAW,GAAO,MAAM,MACvD,EAAO,SAAS,4BAGb,EAAW,GAAO,aAAa,MAClC,EAAO,gBAAgB,+BAGlB;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { C as e, E as t, F as n, I as r, M as i, N as a, O as o, P as s, R as c, S as l, T as u, _ as d, a as f, b as p, c as m, f as h, g, j as _, k as v, l as ee, n as y, r as b, t as x, u as S, w as C, x as w, y as T } from "../client-e4ZTphpa.js";
2
- import { l as E, n as D, r as O, t as k } from "../i18n-DT9CzQ-W.js";
2
+ import { l as E, n as D, r as O, t as k } from "../i18n-_NhFjJ90.js";
3
3
  //#region src/delivery/TeacherInstructions.svelte
4
4
  var A = T("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), j = {
5
5
  hash: "svelte-1jhejbv",
@@ -238,7 +238,7 @@ function R(e, t) {
238
238
  //#region src/delivery/index.ts
239
239
  var z = R(N, { isComplete: (e, t) => typeof t?.value == "string" && t.value.trim().length > 0 }), B = Object.freeze({
240
240
  name: "@pie-element/simple-cloze",
241
- version: "0.1.10-next.20261016234357"
241
+ version: "0.1.10"
242
242
  });
243
243
  //#endregion
244
244
  export { z as default, B as piePackage };
@@ -1326,7 +1326,7 @@ var sn;
1326
1326
  function cn() {
1327
1327
  return sn;
1328
1328
  }
1329
- var ln = import("./mathjax-CptWnMbQ-C2Z-zfZO.js");
1329
+ var ln = import("./mathjax-DqXi3q4c-BeXFIX6Q.js");
1330
1330
  ln.catch(() => {});
1331
1331
  async function un(e, t) {
1332
1332
  let { createMathJax: n } = await ln;
@@ -2025,25 +2025,7 @@ function Rr(e) {
2025
2025
  function zr(e) {
2026
2026
  for (let t of e.querySelectorAll("mjx-container")) Rr(t);
2027
2027
  }
2028
- var Br = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", Vr = "pie-mathjax-version-conflict", Hr = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
2029
- function Ur(e, t) {
2030
- if (typeof window > "u") return;
2031
- let n = globalThis;
2032
- n[Hr] ??= {
2033
- logged: !1,
2034
- conditions: []
2035
- };
2036
- let r = n[Hr];
2037
- if (r.conditions.includes(e)) return;
2038
- r.conditions.push(e);
2039
- let i = `[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${Br}`;
2040
- r.logged || (r.logged = !0, console.error(i)), window.dispatchEvent(new CustomEvent(Vr, { detail: {
2041
- condition: e,
2042
- message: i,
2043
- docsUrl: Br
2044
- } }));
2045
- }
2046
- var Wr = {
2028
+ var Br = {
2047
2029
  parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
2048
2030
  overarc: "\\overparen",
2049
2031
  napprox: "\\not\\approx",
@@ -2051,36 +2033,54 @@ var Wr = {
2051
2033
  abs: ["\\left|#1\\right|", 1],
2052
2034
  perpendicular: "\\perp",
2053
2035
  divide: "\\div"
2054
- }, Gr = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", Kr = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, qr = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, Jr = /\\embed\{newLine\}\[\]/g, Yr = [
2036
+ }, Vr = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, Hr = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, Ur = /\\embed\{newLine\}\[\]/g, Wr = [
2055
2037
  ["$$", "$$"],
2056
2038
  ["$", "$"],
2057
2039
  ["\\[", "\\]"],
2058
2040
  ["\\(", "\\)"]
2059
- ], Xr = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), Zr = "MJX-CHTML-styles", Qr = "PIE-MJX-SVG-styles", $r = "PIE-MathJax-Menu-Settings", ei = { "mjx-container[overflow=\"linebreak\"][display]": {
2041
+ ];
2042
+ function Gr(e) {
2043
+ for (let [t, n] of Wr) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
2044
+ return e;
2045
+ }
2046
+ function Kr(e) {
2047
+ return `\\(${Gr(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e)}\\)`.replace(Ur, "\\newline ");
2048
+ }
2049
+ var qr = "mathjax_ignore", Jr = "mathjax_process", Yr = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", Xr = "pie-mathjax-version-conflict", Zr = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
2050
+ function Qr(e, t) {
2051
+ if (typeof window > "u") return;
2052
+ let n = globalThis;
2053
+ n[Zr] ??= {
2054
+ logged: !1,
2055
+ conditions: []
2056
+ };
2057
+ let r = n[Zr];
2058
+ if (r.conditions.includes(e)) return;
2059
+ r.conditions.push(e);
2060
+ let i = `[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${Yr}`;
2061
+ r.logged || (r.logged = !0, console.error(i)), window.dispatchEvent(new CustomEvent(Xr, { detail: {
2062
+ condition: e,
2063
+ message: i,
2064
+ docsUrl: Yr
2065
+ } }));
2066
+ }
2067
+ var $r = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", ei = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), ti = "MJX-CHTML-styles", ni = "PIE-MJX-SVG-styles", ri = "PIE-MathJax-Menu-Settings", ii = { "mjx-container[overflow=\"linebreak\"][display]": {
2060
2068
  overflow: "auto clip",
2061
2069
  "min-width": "initial !important"
2062
- } }, ti = 200, ni = 201, ri = 202;
2063
- function ii(e) {
2070
+ } }, ai = 200, oi = 201, si = 202;
2071
+ function ci(e) {
2064
2072
  let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
2065
2073
  for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
2066
2074
  }
2067
- function ai(e) {
2068
- for (let [t, n] of Yr) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
2069
- return e;
2070
- }
2071
- function oi(e) {
2072
- return ai(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
2073
- }
2074
- var si = "mathjax_ignore", ci = "mathjax_process";
2075
2075
  function li(e, t) {
2076
- let n = e.closest(`.${si}, .${ci}`);
2077
- return n !== null && t.contains(n) && !n.classList.contains(ci);
2076
+ let n = e.closest(`.${qr}, .${Jr}`);
2077
+ return n !== null && t.contains(n) && !n.classList.contains("mathjax_process");
2078
2078
  }
2079
2079
  function ui(e) {
2080
2080
  for (let t of e.querySelectorAll("[data-latex]")) {
2081
2081
  if (t.dataset.mathHandled || t.closest("mjx-container") || li(t, e)) continue;
2082
2082
  let n = t.textContent;
2083
- n && (t.textContent = `\\(${oi(n)}\\)`.replace(Jr, "\\newline "), t.dataset.mathHandled = "true");
2083
+ n && (t.textContent = Kr(n), t.dataset.mathHandled = "true");
2084
2084
  }
2085
2085
  }
2086
2086
  function di(e) {
@@ -2088,7 +2088,7 @@ function di(e) {
2088
2088
  }
2089
2089
  function fi(e, t) {
2090
2090
  for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
2091
- return (t ? qr : Kr).test(e.textContent ?? "");
2091
+ return (t ? Hr : Vr).test(e.textContent ?? "");
2092
2092
  }
2093
2093
  function pi(e) {
2094
2094
  return new Promise((t, n) => {
@@ -2105,10 +2105,10 @@ function pi(e) {
2105
2105
  typeset: !1,
2106
2106
  ready: () => {
2107
2107
  let e = cn(), r = e?.startup, i = mi(e);
2108
- i && (hi(e), gi(e, s.speechLocales), Yt(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (_i(r?.document), vi(r?.document), r?.document?.addStyles?.(ei), rn(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
2108
+ i && (hi(e), gi(e, s.speechLocales), Yt(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (_i(r?.document), vi(r?.document), r?.document?.addStyles?.(ii), rn(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
2109
2109
  }
2110
2110
  },
2111
- tex: { macros: { ...Wr } },
2111
+ tex: { macros: { ...Br } },
2112
2112
  output: { displayOverflow: "linebreak" },
2113
2113
  options: {
2114
2114
  enableMenu: i,
@@ -2120,7 +2120,7 @@ function pi(e) {
2120
2120
  a11y: { inTabOrder: c }
2121
2121
  }
2122
2122
  };
2123
- r && l.tex && (console.warn(Gr), l.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], l.tex.processEscapes = !0), a || (l.chtml = { fontURL: "" });
2123
+ r && l.tex && (console.warn($r), l.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], l.tex.processEscapes = !0), a || (l.chtml = { fontURL: "" });
2124
2124
  let u = Xt(s.speechLocales);
2125
2125
  u && l.options && (l.options.sre = { locale: u }), un(l, {
2126
2126
  ...s,
@@ -2137,18 +2137,18 @@ function hi(e) {
2137
2137
  let t = e?._?.output, n = t?.chtml_ts?.CHTML;
2138
2138
  n && (n.STYLESHEETID = hn);
2139
2139
  let r = t?.svg_ts?.SVG;
2140
- r && (r.STYLESHEETID = Qr);
2140
+ r && (r.STYLESHEETID = ni);
2141
2141
  }
2142
2142
  function gi(e, t) {
2143
2143
  let n = e?._?.ui?.menu?.Menu?.Menu;
2144
2144
  if (n) {
2145
- n.MENU_STORAGE = $r;
2145
+ n.MENU_STORAGE = ri;
2146
2146
  try {
2147
- let e = localStorage.getItem($r);
2147
+ let e = localStorage.getItem(ri);
2148
2148
  if (!e) return;
2149
2149
  let { assistiveMml: n, locale: r, ...i } = JSON.parse(e), a = r === void 0 || !t || t.has(r);
2150
2150
  if (n === void 0 && a) return;
2151
- a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem($r, JSON.stringify(i)) : localStorage.removeItem($r);
2151
+ a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(ri, JSON.stringify(i)) : localStorage.removeItem(ri);
2152
2152
  } catch {}
2153
2153
  }
2154
2154
  }
@@ -2156,23 +2156,23 @@ function _i(e) {
2156
2156
  if (!e) return;
2157
2157
  let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
2158
2158
  let n = e.typesetRoot;
2159
- !n || t.has(n) || (ii(n), t.add(n));
2159
+ !n || t.has(n) || (ci(n), t.add(n));
2160
2160
  };
2161
- e.addRenderAction?.("pie-strip-latex", ni, (e) => {
2161
+ e.addRenderAction?.("pie-strip-latex", oi, (e) => {
2162
2162
  for (let t of e.math ?? []) n(t);
2163
2163
  return !1;
2164
2164
  }, (e) => {
2165
2165
  let t = e.typesetRoot;
2166
- return t && ii(t), !1;
2166
+ return t && ci(t), !1;
2167
2167
  });
2168
2168
  let r = e.outputJax?.chtmlStyles;
2169
- r?.id === Zr && (r.id = hn), xi();
2169
+ r?.id === ti && (r.id = hn), xi();
2170
2170
  }
2171
2171
  function vi(e) {
2172
2172
  let t = (e) => {
2173
2173
  e.typesetRoot && Rr(e.typesetRoot);
2174
2174
  };
2175
- e?.addRenderAction?.("pie-name-math", ri, (e) => {
2175
+ e?.addRenderAction?.("pie-name-math", si, (e) => {
2176
2176
  for (let n of e.math ?? []) t(n);
2177
2177
  return !1;
2178
2178
  }, (e) => (t(e), !1));
@@ -2181,7 +2181,7 @@ function yi(e) {
2181
2181
  return e instanceof HTMLStyleElement && gn.includes(e.id);
2182
2182
  }
2183
2183
  function bi(e) {
2184
- Ur("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
2184
+ Qr("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
2185
2185
  }
2186
2186
  function xi() {
2187
2187
  let e = document.head, t = [...e.children].find(yi);
@@ -2203,7 +2203,7 @@ function xi() {
2203
2203
  function Si(e) {
2204
2204
  let t = e?.math;
2205
2205
  if (!t?.remove) return;
2206
- let n = [...t].filter((e) => (e.state?.() ?? 0) >= ti && e.typesetRoot?.isConnected === !1);
2206
+ let n = [...t].filter((e) => (e.state?.() ?? 0) >= ai && e.typesetRoot?.isConnected === !1);
2207
2207
  if (n.length !== 0) {
2208
2208
  for (let e of [...n].reverse()) e.clear?.();
2209
2209
  t.remove(...n);
@@ -2231,8 +2231,8 @@ function Ti(e) {
2231
2231
  });
2232
2232
  }
2233
2233
  function Ei(e) {
2234
- let t = dn, n = t[Xr];
2235
- return n || (n = Ti(e), t[Xr] = n), n;
2234
+ let t = dn, n = t[ei];
2235
+ return n || (n = Ti(e), t[ei] = n), n;
2236
2236
  }
2237
2237
  function Di(e = {}) {
2238
2238
  let t = e.useSingleDollar ?? !1;
@@ -2253,7 +2253,7 @@ function Di(e = {}) {
2253
2253
  } catch (e) {
2254
2254
  throw i.typesetClear?.([n]), e;
2255
2255
  }
2256
- ii(n), zr(n);
2256
+ ci(n), zr(n);
2257
2257
  }
2258
2258
  };
2259
2259
  }
@@ -4128,4 +4128,4 @@ function Ua(e, t) {
4128
4128
  //#endregion
4129
4129
  export { U as a, H as c, on as i, Ft as l, Ua as n, $t as o, Bi as r, It as s, Ha as t };
4130
4130
 
4131
- //# sourceMappingURL=i18n-DT9CzQ-W.js.map
4131
+ //# sourceMappingURL=i18n-_NhFjJ90.js.map