@pie-qti/default-components 0.1.10 → 0.1.11

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 (180) hide show
  1. package/dist/chunks/__vite-browser-external-BjvdLQIS.js +9 -0
  2. package/dist/chunks/__vite-browser-external-BjvdLQIS.js.map +1 -0
  3. package/dist/chunks/chunk-Bayd9M4T.js +20 -0
  4. package/dist/chunks/{mathlive.min-Bvtiaxg4.js → mathlive.min-CAPebTxM.js} +245 -29
  5. package/dist/chunks/{mathlive.min-Bvtiaxg4.js.map → mathlive.min-CAPebTxM.js.map} +1 -1
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/plugins/associate/index.d.ts +0 -1
  10. package/dist/plugins/associate/index.js +1 -0
  11. package/dist/plugins/associate/index.js.map +1 -0
  12. package/dist/plugins/choice/index.d.ts +0 -1
  13. package/dist/plugins/choice/index.js +1 -0
  14. package/dist/plugins/choice/index.js.map +1 -0
  15. package/dist/plugins/custom/index.d.ts +0 -1
  16. package/dist/plugins/custom/index.js +1 -0
  17. package/dist/plugins/custom/index.js.map +1 -0
  18. package/dist/plugins/end-attempt/index.d.ts +0 -1
  19. package/dist/plugins/end-attempt/index.js +1 -0
  20. package/dist/plugins/end-attempt/index.js.map +1 -0
  21. package/dist/plugins/extended-text/index.d.ts +0 -1
  22. package/dist/plugins/extended-text/index.js +1 -0
  23. package/dist/plugins/extended-text/index.js.map +1 -0
  24. package/dist/plugins/gap-match/index.d.ts +0 -1
  25. package/dist/plugins/gap-match/index.js +1 -0
  26. package/dist/plugins/gap-match/index.js.map +1 -0
  27. package/dist/plugins/graphic-associate/index.d.ts +0 -1
  28. package/dist/plugins/graphic-associate/index.js +1 -0
  29. package/dist/plugins/graphic-associate/index.js.map +1 -0
  30. package/dist/plugins/graphic-gap-match/index.d.ts +0 -1
  31. package/dist/plugins/graphic-gap-match/index.js +1 -0
  32. package/dist/plugins/graphic-gap-match/index.js.map +1 -0
  33. package/dist/plugins/graphic-order/index.d.ts +0 -1
  34. package/dist/plugins/graphic-order/index.js +1 -0
  35. package/dist/plugins/graphic-order/index.js.map +1 -0
  36. package/dist/plugins/hotspot/index.d.ts +0 -1
  37. package/dist/plugins/hotspot/index.js +1 -0
  38. package/dist/plugins/hotspot/index.js.map +1 -0
  39. package/dist/plugins/hottext/index.d.ts +0 -1
  40. package/dist/plugins/hottext/index.js +1 -0
  41. package/dist/plugins/hottext/index.js.map +1 -0
  42. package/dist/plugins/match/index.d.ts +0 -1
  43. package/dist/plugins/match/index.js +1 -0
  44. package/dist/plugins/match/index.js.map +1 -0
  45. package/dist/plugins/media/index.d.ts +0 -1
  46. package/dist/plugins/media/index.js +1 -0
  47. package/dist/plugins/media/index.js.map +1 -0
  48. package/dist/plugins/order/index.d.ts +0 -1
  49. package/dist/plugins/order/index.js +1 -0
  50. package/dist/plugins/order/index.js.map +1 -0
  51. package/dist/plugins/position-object/index.d.ts +0 -1
  52. package/dist/plugins/position-object/index.js +1 -0
  53. package/dist/plugins/position-object/index.js.map +1 -0
  54. package/dist/plugins/public-types.d.ts +5 -0
  55. package/dist/plugins/public-types.js +2 -0
  56. package/dist/plugins/public-types.js.map +1 -0
  57. package/dist/plugins/select-point/index.d.ts +0 -1
  58. package/dist/plugins/select-point/index.js +1 -0
  59. package/dist/plugins/select-point/index.js.map +1 -0
  60. package/dist/plugins/slider/index.d.ts +0 -1
  61. package/dist/plugins/slider/index.js +1 -0
  62. package/dist/plugins/slider/index.js.map +1 -0
  63. package/dist/plugins.js +25917 -7690
  64. package/dist/plugins.js.map +1 -1
  65. package/dist/shared/actions/typesetAction.d.ts +0 -1
  66. package/dist/shared/actions/typesetAction.js +1 -0
  67. package/dist/shared/actions/typesetAction.js.map +1 -0
  68. package/dist/shared/extensions/MathLiveEditor.d.ts +0 -1
  69. package/dist/shared/extensions/MathLiveEditor.js +1 -0
  70. package/dist/shared/extensions/MathLiveEditor.js.map +1 -0
  71. package/dist/shared/index.d.ts +0 -1
  72. package/dist/shared/index.js +1 -0
  73. package/dist/shared/index.js.map +1 -0
  74. package/dist/shared/utils/eventHelpers.d.ts +0 -1
  75. package/dist/shared/utils/eventHelpers.js +1 -0
  76. package/dist/shared/utils/eventHelpers.js.map +1 -0
  77. package/dist/shared/utils/matchGroupUtils.d.ts +0 -1
  78. package/dist/shared/utils/matchGroupUtils.js +1 -0
  79. package/dist/shared/utils/matchGroupUtils.js.map +1 -0
  80. package/dist/shared/utils/pairHelpers.d.ts +0 -1
  81. package/dist/shared/utils/pairHelpers.js +1 -0
  82. package/dist/shared/utils/pairHelpers.js.map +1 -0
  83. package/dist/shared/utils/webComponentHelpers.d.ts +0 -1
  84. package/dist/shared/utils/webComponentHelpers.js +1 -0
  85. package/dist/shared/utils/webComponentHelpers.js.map +1 -0
  86. package/package.json +11 -33
  87. package/dist/index.d.ts.map +0 -1
  88. package/dist/plugins/associate/index.d.ts.map +0 -1
  89. package/dist/plugins/choice/index.d.ts.map +0 -1
  90. package/dist/plugins/custom/index.d.ts.map +0 -1
  91. package/dist/plugins/end-attempt/index.d.ts.map +0 -1
  92. package/dist/plugins/extended-text/index.d.ts.map +0 -1
  93. package/dist/plugins/gap-match/index.d.ts.map +0 -1
  94. package/dist/plugins/graphic-associate/index.d.ts.map +0 -1
  95. package/dist/plugins/graphic-gap-match/index.d.ts.map +0 -1
  96. package/dist/plugins/graphic-order/index.d.ts.map +0 -1
  97. package/dist/plugins/hotspot/index.d.ts.map +0 -1
  98. package/dist/plugins/hottext/index.d.ts.map +0 -1
  99. package/dist/plugins/index.d.ts +0 -31
  100. package/dist/plugins/index.d.ts.map +0 -1
  101. package/dist/plugins/index.js +0 -31
  102. package/dist/plugins/match/index.d.ts.map +0 -1
  103. package/dist/plugins/media/index.d.ts.map +0 -1
  104. package/dist/plugins/order/index.d.ts.map +0 -1
  105. package/dist/plugins/position-object/index.d.ts.map +0 -1
  106. package/dist/plugins/select-point/index.d.ts.map +0 -1
  107. package/dist/plugins/slider/index.d.ts.map +0 -1
  108. package/dist/shared/actions/typesetAction.d.ts.map +0 -1
  109. package/dist/shared/extensions/MathLiveEditor.d.ts.map +0 -1
  110. package/dist/shared/index.d.ts.map +0 -1
  111. package/dist/shared/utils/eventHelpers.d.ts.map +0 -1
  112. package/dist/shared/utils/matchGroupUtils.d.ts.map +0 -1
  113. package/dist/shared/utils/pairHelpers.d.ts.map +0 -1
  114. package/dist/shared/utils/touchDragHelper.d.ts +0 -2
  115. package/dist/shared/utils/touchDragHelper.d.ts.map +0 -1
  116. package/dist/shared/utils/touchDragHelper.js +0 -1
  117. package/dist/shared/utils/webComponentHelpers.d.ts.map +0 -1
  118. package/src/catalog/CatalogPopup.svelte +0 -163
  119. package/src/index.ts +0 -141
  120. package/src/plugins/associate/AssociateInteraction.svelte +0 -304
  121. package/src/plugins/associate/index.ts +0 -9
  122. package/src/plugins/choice/ChoiceInteraction.svelte +0 -355
  123. package/src/plugins/choice/index.ts +0 -9
  124. package/src/plugins/custom/CustomInteraction.svelte +0 -61
  125. package/src/plugins/custom/index.ts +0 -9
  126. package/src/plugins/drawing/DrawingInteraction.svelte +0 -99
  127. package/src/plugins/end-attempt/EndAttemptInteraction.svelte +0 -142
  128. package/src/plugins/end-attempt/index.ts +0 -9
  129. package/src/plugins/extended-text/ExtendedTextInteraction.svelte +0 -152
  130. package/src/plugins/extended-text/index.ts +0 -9
  131. package/src/plugins/gap-match/GapMatchInteraction.svelte +0 -556
  132. package/src/plugins/gap-match/index.ts +0 -9
  133. package/src/plugins/graphic-associate/GraphicAssociateInteraction.svelte +0 -503
  134. package/src/plugins/graphic-associate/index.ts +0 -9
  135. package/src/plugins/graphic-gap-match/GraphicGapMatchInteraction.svelte +0 -593
  136. package/src/plugins/graphic-gap-match/index.ts +0 -9
  137. package/src/plugins/graphic-order/GraphicOrderInteraction.svelte +0 -241
  138. package/src/plugins/graphic-order/index.ts +0 -9
  139. package/src/plugins/hotspot/HotspotInteraction.svelte +0 -287
  140. package/src/plugins/hotspot/index.ts +0 -9
  141. package/src/plugins/hottext/HottextInteraction.svelte +0 -325
  142. package/src/plugins/hottext/index.ts +0 -9
  143. package/src/plugins/index.ts +0 -32
  144. package/src/plugins/match/MatchInteraction.svelte +0 -82
  145. package/src/plugins/match/index.ts +0 -9
  146. package/src/plugins/media/MediaInteraction.svelte +0 -216
  147. package/src/plugins/media/index.ts +0 -9
  148. package/src/plugins/order/OrderInteraction.svelte +0 -280
  149. package/src/plugins/order/index.ts +0 -9
  150. package/src/plugins/position-object/PositionObjectInteraction.svelte +0 -903
  151. package/src/plugins/position-object/README.md +0 -130
  152. package/src/plugins/position-object/index.ts +0 -9
  153. package/src/plugins/select-point/SelectPointInteraction.svelte +0 -571
  154. package/src/plugins/select-point/index.ts +0 -9
  155. package/src/plugins/slider/SliderInteraction.svelte +0 -141
  156. package/src/plugins/slider/index.ts +0 -9
  157. package/src/plugins/upload/UploadInteraction.svelte +0 -59
  158. package/src/shared/actions/typesetAction.ts +0 -87
  159. package/src/shared/components/CustomInteractionFallback.svelte +0 -153
  160. package/src/shared/components/DragHandle.svelte +0 -44
  161. package/src/shared/components/DrawingCanvas.svelte +0 -259
  162. package/src/shared/components/FileUpload.svelte +0 -158
  163. package/src/shared/components/GraphicGapMatch.svelte +0 -318
  164. package/src/shared/components/GraphicGapMatchAdapter.svelte +0 -45
  165. package/src/shared/components/InlineInteractionRenderer.svelte +0 -141
  166. package/src/shared/components/MatchDragDrop.svelte +0 -481
  167. package/src/shared/components/MathContent.svelte +0 -18
  168. package/src/shared/components/ModalFeedbackDisplay.svelte +0 -91
  169. package/src/shared/components/RichTextEditor.svelte +0 -316
  170. package/src/shared/components/ShadowBaseStyles.svelte +0 -390
  171. package/src/shared/components/SortableList.svelte +0 -297
  172. package/src/shared/extensions/MathLiveEditor.ts +0 -299
  173. package/src/shared/index.ts +0 -15
  174. package/src/shared/styles/shared.css +0 -16
  175. package/src/shared/utils/eventHelpers.ts +0 -69
  176. package/src/shared/utils/matchGroupUtils.ts +0 -14
  177. package/src/shared/utils/pairHelpers.ts +0 -109
  178. package/src/shared/utils/webComponentHelpers.ts +0 -69
  179. package/src/svelte-shims.d.ts +0 -9
  180. /package/{src → dist}/shared/styles/qti-shared-vocabulary.css +0 -0
@@ -0,0 +1,9 @@
1
+ import { t as e } from "./chunk-Bayd9M4T.js";
2
+ //#region __vite-browser-external
3
+ var t = /* @__PURE__ */ e(((e, t) => {
4
+ t.exports = {};
5
+ }));
6
+ //#endregion
7
+ export default t();
8
+
9
+ //# sourceMappingURL=__vite-browser-external-BjvdLQIS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__vite-browser-external-BjvdLQIS.js","names":[],"sources":["../../__vite-browser-external"],"sourcesContent":["module.exports = {}"],"mappings":";;;AAAA,GAAO,UAAU,EAAA"}
@@ -0,0 +1,20 @@
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (e && (t = e(e = 0)), t), s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, n) => {
3
+ let r = {};
4
+ for (var i in e) t(r, i, {
5
+ get: e[i],
6
+ enumerable: !0
7
+ });
8
+ return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ }, l = (e, i, o, s) => {
10
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
+ get: ((e) => i[e]).bind(null, d),
12
+ enumerable: !(s = n(i, d)) || s.enumerable
13
+ });
14
+ return e;
15
+ }, u = (n, r, a) => (a = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule ? t(a, "default", {
16
+ value: n,
17
+ enumerable: !0
18
+ }) : a, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e);
19
+ //#endregion
20
+ export { u as a, d as i, o as n, c as r, s as t };
@@ -36644,8 +36644,7 @@ var u_ = class {
36644
36644
  });
36645
36645
  }
36646
36646
  announce(e, t, n = []) {
36647
- var r;
36648
- ((r = this.mathfield.host?.dispatchEvent(new CustomEvent("announce", {
36647
+ (this.mathfield.host?.dispatchEvent(new CustomEvent("announce", {
36649
36648
  detail: {
36650
36649
  command: e,
36651
36650
  previousPosition: t,
@@ -36654,7 +36653,7 @@ var u_ = class {
36654
36653
  cancelable: !0,
36655
36654
  bubbles: !0,
36656
36655
  composed: !0
36657
- }))) == null || r) && s_(this.mathfield, e, t, n);
36656
+ })) ?? !0) && s_(this.mathfield, e, t, n);
36658
36657
  }
36659
36658
  deferNotifications(e, t) {
36660
36659
  let n = this._selection, r = this._anchor, i = this._position, a = this.silenceNotifications;
@@ -37363,14 +37362,14 @@ var __ = `<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox=
37363
37362
  }, 60);
37364
37363
  }
37365
37364
  onBlur(t) {
37366
- var n, r, i, a;
37365
+ var n, r, i;
37367
37366
  if (!(this.focusBlurInProgress || this.blurred) && (this.focusBlurInProgress = !0, this.stopCoalescingUndo(), this.blurred = !0, e._globallyFocusedMathfield === this && (e._globallyFocusedMathfield = void 0), this.ariaLiveText.textContent = "", Id(this), this.model.getValue() !== this.valueOnFocus && ((n = this.host) == null || n.dispatchEvent(new Event("change", {
37368
37367
  bubbles: !0,
37369
37368
  composed: !0
37370
- }))), this.disconnectFromVirtualKeyboard(), ((r = t?.dispatchEvents) == null || r) && ((i = this.host) == null || i.dispatchEvent(new Event("blur", {
37369
+ }))), this.disconnectFromVirtualKeyboard(), (t?.dispatchEvents ?? !0) && ((r = this.host) == null || r.dispatchEvent(new Event("blur", {
37371
37370
  bubbles: !1,
37372
37371
  composed: !0
37373
- })), (a = this.host) == null || a.dispatchEvent(new UIEvent("focusout", {
37372
+ })), (i = this.host) == null || i.dispatchEvent(new UIEvent("focusout", {
37374
37373
  bubbles: !0,
37375
37374
  composed: !0
37376
37375
  }))), H(this), this.focusBlurInProgress = !1, ih(), j_.restoreFocusWhenDocumentFocused)) {
@@ -37520,7 +37519,7 @@ function b_(e, t, n) {
37520
37519
  if (c === null) return (r = s.speakHook) == null || r.call(s, o(t)), !1;
37521
37520
  (n.withHighlighting || s.speechEngine === "amazon") && (s.textToSpeechMarkup = globalThis.sre && s.textToSpeechRules === "sre" ? "ssml_step" : "ssml");
37522
37521
  let l = og(c);
37523
- return d() && n.withHighlighting ? (W_().readAloudMathfield = e, Xd(e, { forHighlighting: !0 }), s.readAloudHook && s.readAloudHook(e.field, l)) : s.speakHook && s.speakHook(l), !1;
37522
+ return d() && n.withHighlighting ? (tv().readAloudMathfield = e, Xd(e, { forHighlighting: !0 }), s.readAloudHook && s.readAloudHook(e.field, l)) : s.speakHook && s.speakHook(l), !1;
37524
37523
  }
37525
37524
  function x_(e) {
37526
37525
  if (!d()) return;
@@ -37587,22 +37586,22 @@ function w_(e, t) {
37587
37586
  TextType: "ssml",
37588
37587
  SpeechMarkTypes: ["ssml"]
37589
37588
  };
37590
- W_().readAloudElement = e, n.synthesizeSpeech(r, (e, i) => {
37589
+ tv().readAloudElement = e, n.synthesizeSpeech(r, (e, i) => {
37591
37590
  if (e) {
37592
37591
  console.trace(`MathLive 0.108.2: \`polly.synthesizeSpeech()\` error: ${e}`);
37593
37592
  return;
37594
37593
  }
37595
37594
  if (!(i != null && i.AudioStream)) return;
37596
37595
  let a = new TextDecoder("utf-8").decode(new Uint8Array(i.AudioStream));
37597
- W_().readAloudMarks = a.split("\n").map((e) => e ? JSON.parse(e) : {}), W_().readAloudTokens = [];
37598
- for (let e of W_().readAloudMarks) e.value && W_().readAloudTokens.push(e.value);
37599
- W_().readAloudCurrentMark = "", r.OutputFormat = "mp3", r.SpeechMarkTypes = [], n.synthesizeSpeech(r, (e, n) => {
37596
+ tv().readAloudMarks = a.split("\n").map((e) => e ? JSON.parse(e) : {}), tv().readAloudTokens = [];
37597
+ for (let e of tv().readAloudMarks) e.value && tv().readAloudTokens.push(e.value);
37598
+ tv().readAloudCurrentMark = "", r.OutputFormat = "mp3", r.SpeechMarkTypes = [], n.synthesizeSpeech(r, (e, n) => {
37600
37599
  if (e) {
37601
37600
  console.trace(`MathLive 0.108.2: \`polly.synthesizeSpeech("${t}") error:${e}`);
37602
37601
  return;
37603
37602
  }
37604
37603
  if (!(n != null && n.AudioStream)) return;
37605
- let r = new Uint8Array(n.AudioStream), i = new Blob([r.buffer], { type: "audio/mpeg" }), a = URL.createObjectURL(i), o = W_();
37604
+ let r = new Uint8Array(n.AudioStream), i = new Blob([r.buffer], { type: "audio/mpeg" }), a = URL.createObjectURL(i), o = tv();
37606
37605
  o.readAloudAudio ? o.readAloudAudio.pause() : (o.readAloudAudio = new Audio(), o.readAloudAudio.addEventListener("ended", () => {
37607
37606
  let e = o.readAloudMathfield;
37608
37607
  o.readAloudStatus = "ended", document.body.dispatchEvent(new Event("read-aloud-status-change", {
@@ -38548,27 +38547,226 @@ if (d() && !((M_ = window.customElements) != null && M_.get("math-field"))) {
38548
38547
  let e = window[Symbol.for("io.cortexjs.mathlive")];
38549
38548
  e.version = "0.108.2", globalThis.MathfieldElement = D_, (P_ = window.customElements) == null || P_.define("math-field", D_);
38550
38549
  }
38551
- function F_(e, t) {
38550
+ function F_(e, t, n) {
38551
+ let r = n, i = 0, a = e.length;
38552
+ for (; r < t.length;) {
38553
+ let n = t[r];
38554
+ if (i <= 0 && t.slice(r, r + a) === e) return r;
38555
+ n === "\\" ? r++ : n === "{" ? i++ : n === "}" && i--, r++;
38556
+ }
38557
+ return -1;
38558
+ }
38559
+ function I_(e, t, n, r, i = "latex") {
38560
+ let a = [];
38561
+ for (let o of e) if (o.type === "text") {
38562
+ let e = o.data, s = !0, c = 0, l;
38563
+ l = e.indexOf(t), l !== -1 && (c = l, c > 0 && a.push({
38564
+ type: "text",
38565
+ data: e.slice(0, c)
38566
+ }), s = !1);
38567
+ let u = !1;
38568
+ for (; !u;) {
38569
+ if (s) {
38570
+ if (l = e.indexOf(t, c), l === -1) {
38571
+ u = !0;
38572
+ break;
38573
+ }
38574
+ c !== l && a.push({
38575
+ type: "text",
38576
+ data: e.slice(c, l)
38577
+ }), c = l;
38578
+ } else {
38579
+ if (l = F_(n, e, c + t.length), l === -1) {
38580
+ u = !0;
38581
+ break;
38582
+ }
38583
+ let o = e.slice(c + t.length, l);
38584
+ i === "ascii-math" && ([, o] = pc(o, { format: "ascii-math" })), a.push({
38585
+ type: "math",
38586
+ data: o,
38587
+ mathstyle: r
38588
+ }), c = l + n.length;
38589
+ }
38590
+ s = !s;
38591
+ }
38592
+ c < e.length && a.push({
38593
+ type: "text",
38594
+ data: e.slice(c)
38595
+ });
38596
+ } else a.push(o);
38597
+ return a;
38598
+ }
38599
+ function L_(e, t) {
38600
+ var n, r, i, a;
38601
+ let o = [{
38602
+ type: "text",
38603
+ data: e
38604
+ }];
38605
+ return (n = t.TeX?.delimiters) != null && n.display && t.TeX.delimiters.display.forEach(([e, t]) => {
38606
+ o = I_(o, e, t, "displaystyle");
38607
+ }), (r = t.TeX?.delimiters) != null && r.inline && t.TeX.delimiters.inline.forEach(([e, t]) => {
38608
+ o = I_(o, e, t, "textstyle");
38609
+ }), (i = t.asciiMath?.delimiters) != null && i.inline && t.asciiMath.delimiters.inline.forEach(([e, t]) => {
38610
+ o = I_(o, e, t, "textstyle", "ascii-math");
38611
+ }), (a = t.asciiMath?.delimiters) != null && a.display && t.asciiMath.delimiters.display.forEach(([e, t]) => {
38612
+ o = I_(o, e, t, "displaystyle", "ascii-math");
38613
+ }), o;
38614
+ }
38615
+ function R_(e, t) {
38616
+ let n = document.createElement("span");
38617
+ n.setAttribute("translate", "no");
38618
+ try {
38619
+ let r = "<math xmlns='http://www.w3.org/1998/Math/MathML'>" + t.renderToMathML(e) + "</math>";
38620
+ n.innerHTML = globalThis.MathfieldElement.createHTML(r);
38621
+ } catch (t) {
38622
+ console.error(`MathLive 0.108.2: Could not convert "${e}"' to MathML with ${t}`), n.textContent = e;
38623
+ }
38624
+ return n.className = "ML__sr-only", n;
38625
+ }
38626
+ function z_(e, t, n) {
38627
+ try {
38628
+ let r = t.renderToMarkup(e, c(s({}, t), { defaultMode: n === "displaystyle" ? "math" : "inline-math" })), i = document.createElement("span");
38629
+ return i.dataset.latex = e, i.style.display = n === "displaystyle" ? "flex" : "inline-flex", i.setAttribute("aria-hidden", "true"), i.setAttribute("translate", "no"), i.innerHTML = globalThis.MathfieldElement.createHTML(r), i;
38630
+ } catch (t) {
38631
+ return console.error("Could not parse'" + e + "' with ", t), document.createTextNode(e);
38632
+ }
38633
+ }
38634
+ function B_(e, t, n) {
38635
+ let r = z_(e, n, t || "textstyle"), i = n.renderAccessibleContent ?? "";
38636
+ if (/\b(mathml|speakable-text)\b/i.test(i)) {
38637
+ let t = document.createElement("span");
38638
+ if (/\bmathml\b/i.test(i) && n.renderToMathML && t.append(R_(e, n)), /\bspeakable-text\b/i.test(i) && n.renderToSpeakableText) {
38639
+ let r = document.createElement("span");
38640
+ r.setAttribute("translate", "no");
38641
+ let i = n.renderToSpeakableText(e);
38642
+ r.innerHTML = globalThis.MathfieldElement.createHTML(i), r.className = "ML__sr-only", t.append(r);
38643
+ }
38644
+ return t.append(r), t;
38645
+ }
38646
+ return r;
38647
+ }
38648
+ function V_(e, t) {
38649
+ var n;
38650
+ if (/^\s*$/.test(e)) return null;
38651
+ if ((n = t.TeX) != null && n.processEnvironments && /^\s*\\begin/.test(e)) return [B_(e, "", t)];
38652
+ let r = L_(e, t);
38653
+ if (r.length === 1 && r[0].type === "text") return null;
38654
+ let i = [];
38655
+ for (let e of r) e.type === "text" ? i.push(e.data) : i.push(B_(e.data, e.mathstyle === "textstyle" ? "textstyle" : "displaystyle", t));
38656
+ return i;
38657
+ }
38658
+ function H_(e, t) {
38659
+ var n, r, i, a, o, s, c;
38660
+ if (e.childNodes.length === 1 && e.childNodes[0].nodeType === 3) {
38661
+ let r = e.childNodes[0].textContent ?? "";
38662
+ if ((n = t.TeX) != null && n.processEnvironments && /^\s*\\begin/.test(r)) {
38663
+ e.textContent = "", e.append(B_(r, "", t));
38664
+ return;
38665
+ }
38666
+ let i = L_(r, t);
38667
+ if (i.length === 1) {
38668
+ let n = i[0];
38669
+ if (n.type === "text") return;
38670
+ e.textContent = "", e.append(B_(n.data, n.mathstyle === "textstyle" ? "textstyle" : "displaystyle", t));
38671
+ return;
38672
+ }
38673
+ }
38674
+ let l = [...e.childNodes];
38675
+ for (let e of l) if (e.nodeType === 3) {
38676
+ let n = V_(e.textContent ?? "", t);
38677
+ n && e.replaceWith(...n);
38678
+ } else if (e.nodeType === 1) {
38679
+ let n = e.nodeName.toLowerCase();
38680
+ if (n === "script") {
38681
+ let n = e, a = n.type.toLowerCase();
38682
+ if (a === "module" || a === "javascript") continue;
38683
+ let o;
38684
+ if ((r = t.processScriptTypePattern) != null && r.test(a)) o = n.textContent ?? "";
38685
+ else if ((i = t.processMathJSONScriptTypePattern) != null && i.test(a)) try {
38686
+ o = t.serializeToLatex?.call(t, JSON.parse(n.textContent ?? ""));
38687
+ } catch (e) {
38688
+ console.error(e);
38689
+ }
38690
+ if (o) {
38691
+ let e = "textstyle";
38692
+ for (let t of a.split(";")) {
38693
+ let [n, r] = t.split("=");
38694
+ n.trim() === "mode" && (e = r.trim() === "display" ? "displaystyle" : "textstyle");
38695
+ }
38696
+ G_(n, o, e, t);
38697
+ }
38698
+ } else {
38699
+ let r = e;
38700
+ if ((a = t.texClassDisplayPattern) != null && a.test(r.className)) {
38701
+ G_(r, r.textContent ?? "", "displaystyle", t);
38702
+ continue;
38703
+ }
38704
+ if ((o = t.texClassInlinePattern) != null && o.test(r.className)) {
38705
+ G_(r, r.textContent ?? "", "textstyle", t);
38706
+ continue;
38707
+ }
38708
+ ((t.processClassPattern?.test(r.className) ?? !1) || !((s = t.skipTags?.includes(n)) != null && s || (c = t.ignoreClassPattern?.test(r.className)) != null && c)) && H_(r, t);
38709
+ }
38710
+ }
38711
+ }
38712
+ var U_ = {
38713
+ skipTags: [
38714
+ "math-field",
38715
+ "noscript",
38716
+ "style",
38717
+ "textarea",
38718
+ "pre",
38719
+ "code",
38720
+ "annotation",
38721
+ "annotation-xml"
38722
+ ],
38723
+ processScriptType: "math/tex",
38724
+ processMathJSONScriptType: "math/json",
38725
+ ignoreClass: "^(tex2jax_ignore|ML__latex)$",
38726
+ processClass: "tex2jax_process",
38727
+ renderAccessibleContent: "mathml",
38728
+ asciiMath: { delimiters: { inline: [["`", "`"]] } },
38729
+ TeX: {
38730
+ processEnvironments: !0,
38731
+ delimiters: {
38732
+ inline: [["\\(", "\\)"]],
38733
+ display: [["$$", "$$"], ["\\[", "\\]"]]
38734
+ }
38735
+ }
38736
+ };
38737
+ function W_(e, t) {
38738
+ var n, r;
38739
+ try {
38740
+ let i = s(s({}, U_), t);
38741
+ i.ignoreClassPattern = new RegExp(i.ignoreClass ?? ""), i.processClassPattern = new RegExp(i.processClass ?? ""), i.processScriptTypePattern = new RegExp(i.processScriptType ?? ""), i.processMathJSONScriptTypePattern = new RegExp(i.processMathJSONScriptType ?? ""), (n = i.TeX?.className) != null && n.display && (i.texClassDisplayPattern = new RegExp(i.TeX.className.display)), (r = i.TeX?.className) != null && r.inline && (i.texClassInlinePattern = new RegExp(i.TeX.className.inline)), Kd(), $c("core"), H_(e, i);
38742
+ } catch (t) {
38743
+ t instanceof Error ? console.error("renderMathInElement(): " + t.message) : console.error("renderMathInElement(): Could not render math for element", e);
38744
+ }
38745
+ }
38746
+ function G_(e, t, n, r) {
38747
+ e.parentNode.replaceChild(B_(t, n, r), e);
38748
+ }
38749
+ function K_(e, t) {
38552
38750
  let n = ep.singleton;
38553
38751
  return n ? (n.show(), yf(), n.currentLayer = t, n.render(), n.focus(), !0) : !1;
38554
38752
  }
38555
- function I_() {
38753
+ function q_() {
38556
38754
  let e = window.mathVirtualKeyboard;
38557
38755
  return e.visible ? e.hide({ animate: !0 }) : e.show({ animate: !0 }), !1;
38558
38756
  }
38559
38757
  rf({
38560
- switchKeyboardLayer: F_,
38561
- toggleVirtualKeyboard: I_,
38758
+ switchKeyboardLayer: K_,
38759
+ toggleVirtualKeyboard: q_,
38562
38760
  hideVirtualKeyboard: () => (window.mathVirtualKeyboard.hide({ animate: !0 }), !1),
38563
38761
  showVirtualKeyboard: () => (window.mathVirtualKeyboard.show({ animate: !0 }), !1)
38564
38762
  }, { target: "virtual-keyboard" });
38565
- var L_ = !1, R_ = null;
38566
- function z_() {
38567
- L_ || R_ || (R_ = Kd().then(() => {
38568
- L_ = !0;
38763
+ var J_ = !1, Y_ = null;
38764
+ function X_() {
38765
+ J_ || Y_ || (Y_ = Kd().then(() => {
38766
+ J_ = !0;
38569
38767
  }));
38570
38768
  }
38571
- var B_ = class extends HTMLElement {
38769
+ var Z_ = class extends HTMLElement {
38572
38770
  constructor() {
38573
38771
  if (super(), this._hasRendered = !1, this._shadowRoot = this.attachShadow({ mode: "open" }), "adoptedStyleSheets" in this._shadowRoot) this._shadowRoot.adoptedStyleSheets = [Zc("core")];
38574
38772
  else {
@@ -38588,7 +38786,7 @@ var B_ = class extends HTMLElement {
38588
38786
  ];
38589
38787
  }
38590
38788
  connectedCallback() {
38591
- z_(), "IntersectionObserver" in window && !this._hasRendered ? (this._observer = new IntersectionObserver((e) => {
38789
+ X_(), "IntersectionObserver" in window && !this._hasRendered ? (this._observer = new IntersectionObserver((e) => {
38592
38790
  var t;
38593
38791
  e[0].isIntersecting && !this._hasRendered && (this.render(), (t = this._observer) == null || t.disconnect());
38594
38792
  }, { rootMargin: "50px" }), this._observer.observe(this)) : this.render();
@@ -38708,14 +38906,14 @@ var B_ = class extends HTMLElement {
38708
38906
  _removeMathML() {
38709
38907
  this._mathMLContainer && (this._mathMLContainer.remove(), this._mathMLContainer = void 0);
38710
38908
  }
38711
- }, V_ = class extends B_ {
38909
+ }, Q_ = class extends Z_ {
38712
38910
  getDefaultMathstyle() {
38713
38911
  return "textstyle";
38714
38912
  }
38715
38913
  getDefaultDisplay() {
38716
38914
  return "inline-flex";
38717
38915
  }
38718
- }, H_ = class extends B_ {
38916
+ }, $_ = class extends Z_ {
38719
38917
  getDefaultMathstyle() {
38720
38918
  return "displaystyle";
38721
38919
  }
@@ -38723,15 +38921,33 @@ var B_ = class extends HTMLElement {
38723
38921
  return "flex";
38724
38922
  }
38725
38923
  };
38726
- function U_() {
38924
+ function ev() {
38727
38925
  var e, t, n, r;
38728
- typeof window < "u" && ((e = window.customElements) != null && e.get("math-span") || (t = window.customElements) == null || t.define("math-span", V_), (n = window.customElements) != null && n.get("math-div") || (r = window.customElements) == null || r.define("math-div", H_));
38926
+ typeof window < "u" && ((e = window.customElements) != null && e.get("math-span") || (t = window.customElements) == null || t.define("math-span", Q_), (n = window.customElements) != null && n.get("math-div") || (r = window.customElements) == null || r.define("math-div", $_));
38729
38927
  }
38730
- U_();
38731
- function W_() {
38928
+ ev();
38929
+ function tv() {
38732
38930
  var e;
38733
38931
  return globalThis[e = Symbol.for("io.cortexjs.mathlive")] ?? (globalThis[e] = {}), globalThis[Symbol.for("io.cortexjs.mathlive")];
38734
38932
  }
38933
+ function nv(e) {
38934
+ if (typeof e == "string") {
38935
+ let t = document.getElementById(e);
38936
+ if (t === null) throw Error(`The element with ID "${e}" could not be found.`);
38937
+ return t;
38938
+ }
38939
+ return e;
38940
+ }
38941
+ function rv(e, t) {
38942
+ if (document.readyState === "loading") {
38943
+ document.addEventListener("DOMContentLoaded", () => rv(e, t));
38944
+ return;
38945
+ }
38946
+ let n = nv(e);
38947
+ if (!n) return;
38948
+ let r = t ?? {};
38949
+ r.renderToMarkup ?? (r.renderToMarkup = Y), r.renderToMathML ?? (r.renderToMathML = fg), r.renderToSpeakableText ?? (r.renderToSpeakableText = pg), r.serializeToLatex ?? (r.serializeToLatex = hg), W_(n, r);
38950
+ }
38735
38951
  //#endregion
38736
38952
 
38737
- //# sourceMappingURL=mathlive.min-Bvtiaxg4.js.map
38953
+ //# sourceMappingURL=mathlive.min-CAPebTxM.js.map