@pie-element/element-player 0.1.5-next.20261007175429 → 0.1.5

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.
@@ -81,7 +81,7 @@ function g(e) {
81
81
  } }));
82
82
  }
83
83
  var _ = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", v = "pie-mathjax-version-conflict", y = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
84
- function b(e, t) {
84
+ function ee(e, t) {
85
85
  if (typeof window > "u") return;
86
86
  let n = globalThis;
87
87
  n[y] ??= {
@@ -98,14 +98,14 @@ function b(e, t) {
98
98
  docsUrl: _
99
99
  } }));
100
100
  }
101
- function ee() {
101
+ function te() {
102
102
  let e = window.MathJax?.version;
103
103
  return typeof e == "string" && e.startsWith("3.") ? e : void 0;
104
104
  }
105
- function x() {
105
+ function b() {
106
106
  return window.MathJax;
107
107
  }
108
- function te(t, { root: n, speechPath: r }) {
108
+ function ne(t, { root: n, speechPath: r }) {
109
109
  n && (t.loader = {
110
110
  ...t.loader,
111
111
  paths: {
@@ -121,81 +121,81 @@ function te(t, { root: n, speechPath: r }) {
121
121
  }
122
122
  });
123
123
  }
124
- function ne(e, t) {
124
+ function re(e, t) {
125
125
  let n = t.srcUrl || (t.root ? `${t.root}/mathjax@4.1.3/tex-mml-chtml.js` : void 0);
126
- return n ? (te(e, t), new Promise((t, r) => {
126
+ return n ? (ne(e, t), new Promise((t, r) => {
127
127
  window.MathJax = e;
128
128
  let i = document.createElement("script");
129
129
  i.src = n, i.async = !0, i.onload = () => t(!0), i.onerror = () => r(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(i);
130
130
  })) : (g("untypeset"), Promise.resolve(!1));
131
131
  }
132
- var re = globalThis, S = "PIE-MJX-CHTML-styles", ie = ["MJX-CHTML-styles", "MJX-SVG-styles"], ae = ee, C = "http://www.w3.org/1998/Math/MathML", oe = /^([a-z_][\w.-]*):math$/, se = /^[a-z][a-z0-9-]*$/;
133
- function ce(e) {
132
+ var ie = globalThis, x = "PIE-MJX-CHTML-styles", ae = ["MJX-CHTML-styles", "MJX-SVG-styles"], oe = te, se = "http://www.w3.org/1998/Math/MathML", ce = /^([a-z_][\w.-]*):math$/, le = /^[a-z][a-z0-9-]*$/;
133
+ function ue(e) {
134
134
  for (let t of e.querySelectorAll("*")) {
135
- let n = oe.exec(t.tagName.toLowerCase())?.[1];
136
- !n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(w(t, `${n}:`));
135
+ let n = ce.exec(t.tagName.toLowerCase())?.[1];
136
+ !n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(de(t, `${n}:`));
137
137
  }
138
138
  }
139
- function w(e, t) {
139
+ function de(e, t) {
140
140
  let n = e.tagName.toLowerCase().slice(t.length);
141
- if (!se.test(n)) return e;
142
- let r = e.ownerDocument.createElementNS(C, n);
141
+ if (!le.test(n)) return e;
142
+ let r = e.ownerDocument.createElementNS(se, n);
143
143
  for (let t of e.attributes) r.setAttribute(t.name, t.value);
144
144
  for (let n of [...e.childNodes]) {
145
145
  let e = n instanceof Element && n.tagName.toLowerCase().startsWith(t);
146
- r.appendChild(e ? w(n, t) : n);
146
+ r.appendChild(e ? de(n, t) : n);
147
147
  }
148
148
  return r;
149
149
  }
150
- var le = /* @__PURE__ */ new Set([
150
+ var fe = /* @__PURE__ */ new Set([
151
151
  "updiagonalstrike",
152
152
  "downdiagonalstrike",
153
153
  "verticalstrike",
154
154
  "horizontalstrike"
155
- ]), ue = {
155
+ ]), pe = {
156
156
  thin: "0.035em",
157
157
  medium: "0.07em",
158
158
  thick: "0.14em"
159
- }, T = {
159
+ }, me = {
160
160
  tight: "0em",
161
161
  medium: "0.1em",
162
162
  loose: "0.2em"
163
- }, E = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/, de = /^(#[0-9a-f]{3,8}|[a-z]+)$/i, fe = /^(\d+(\.\d*)?|\.\d+)$/, pe = /* @__PURE__ */ new Set([
163
+ }, he = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/, ge = /^(#[0-9a-f]{3,8}|[a-z]+)$/i, _e = /^(\d+(\.\d*)?|\.\d+)$/, ve = /* @__PURE__ */ new Set([
164
164
  "mn",
165
165
  "mo",
166
166
  "mi",
167
167
  "mtext"
168
- ]), me = /* @__PURE__ */ new Set([
168
+ ]), ye = /* @__PURE__ */ new Set([
169
169
  "stackalign",
170
170
  "charalign",
171
171
  "charspacing",
172
172
  "longdivstyle"
173
173
  ]);
174
- function D(e, t, n = [], r = {}) {
175
- let i = e.createElementNS(C, t);
174
+ function S(e, t, n = [], r = {}) {
175
+ let i = e.createElementNS(se, t);
176
176
  for (let [e, t] of Object.entries(r)) i.setAttribute(e, t);
177
177
  for (let e of n) e && i.appendChild(e);
178
178
  return i;
179
179
  }
180
- function O(e, t) {
181
- let n = D(e.document, "mo");
180
+ function C(e, t) {
181
+ let n = S(e.document, "mo");
182
182
  return n.textContent = t, n;
183
183
  }
184
- function k(e) {
185
- let t = D(e.document, "mn");
186
- return t.textContent = "0", D(e.document, "mphantom", [t]);
184
+ function be(e) {
185
+ let t = S(e.document, "mn");
186
+ return t.textContent = "0", S(e.document, "mphantom", [t]);
187
187
  }
188
- function A(e, t) {
188
+ function w(e, t) {
189
189
  return e.getAttribute(t)?.trim().toLowerCase() || void 0;
190
190
  }
191
- function j(e, t) {
191
+ function T(e, t) {
192
192
  let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
193
193
  return Number.isFinite(n) ? n : 0;
194
194
  }
195
- function M(e) {
195
+ function E(e) {
196
196
  return e.localName === "none" || e.localName === "mrow" && e.children.length === 0 && !e.textContent?.trim();
197
197
  }
198
- function N(e, t, n = e) {
198
+ function D(e, t, n = e) {
199
199
  switch (t) {
200
200
  case "left": return 0;
201
201
  case "center": return Math.floor(e / 2);
@@ -203,14 +203,14 @@ function N(e, t, n = e) {
203
203
  default: return n;
204
204
  }
205
205
  }
206
- function P(e, t, n) {
206
+ function O(e, t, n) {
207
207
  let r = [], i, a, o = (e, t) => {
208
208
  let s = (e) => t.reduceRight((e, t) => {
209
209
  let n = t.cloneNode(!1);
210
210
  return n.appendChild(e), n;
211
211
  }, e);
212
212
  if (e.localName === "mstyle") for (let n of [...e.children]) o(n, [...t, e]);
213
- else if (M(e)) r.push(null);
213
+ else if (E(e)) r.push(null);
214
214
  else if (e.localName === "mn" && e.children.length === 0) {
215
215
  let t = [...(e.textContent ?? "").trim()];
216
216
  for (let a of t) {
@@ -219,28 +219,28 @@ function P(e, t, n) {
219
219
  t.textContent = a, r.push(s(t));
220
220
  }
221
221
  t.length && (a ??= r.length);
222
- } else pe.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ??= r.length), r.push(s(e));
222
+ } else ve.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ??= r.length), r.push(s(e));
223
223
  };
224
224
  for (let t of e) o(t, []);
225
225
  return {
226
226
  kind: "digits",
227
227
  cells: r,
228
- anchor: N(r.length, n.stackAlign, i ?? a),
228
+ anchor: D(r.length, n.stackAlign, i ?? a),
229
229
  position: t
230
230
  };
231
231
  }
232
- function F(e) {
233
- return (e ?? "").toLowerCase().split(/\s+/).filter((e) => le.has(e));
232
+ function k(e) {
233
+ return (e ?? "").toLowerCase().split(/\s+/).filter((e) => fe.has(e));
234
234
  }
235
- function he(e, t) {
236
- let n = [...e.children].filter((e) => !M(e));
237
- return n.length <= 1 ? n[0] ?? null : D(t.document, "mrow", n);
235
+ function xe(e, t) {
236
+ let n = [...e.children].filter((e) => !E(e));
237
+ return n.length <= 1 ? n[0] ?? null : S(t.document, "mrow", n);
238
238
  }
239
- function ge(e, t, n) {
240
- let r = A(e, "location") ?? "n", i = F(e.getAttribute("crossout")), a = [...e.children].map((e) => M(e) ? null : e.localName === "mscarry" ? {
241
- content: he(e, n),
242
- location: A(e, "location") ?? r,
243
- crossout: e.hasAttribute("crossout") ? F(e.getAttribute("crossout")) : i
239
+ function Se(e, t, n) {
240
+ let r = w(e, "location") ?? "n", i = k(e.getAttribute("crossout")), a = [...e.children].map((e) => E(e) ? null : e.localName === "mscarry" ? {
241
+ content: xe(e, n),
242
+ location: w(e, "location") ?? r,
243
+ crossout: e.hasAttribute("crossout") ? k(e.getAttribute("crossout")) : i
244
244
  } : {
245
245
  content: e,
246
246
  location: r,
@@ -249,60 +249,60 @@ function ge(e, t, n) {
249
249
  return {
250
250
  kind: "carries",
251
251
  carries: a,
252
- anchor: N(a.length, n.stackAlign),
252
+ anchor: D(a.length, n.stackAlign),
253
253
  position: t,
254
- scale: fe.test(o) ? o : "0.6"
254
+ scale: _e.test(o) ? o : "0.6"
255
255
  };
256
256
  }
257
- function I(e) {
258
- let t = A(e, "mslinethickness") ?? "medium", n = ue[t] ?? (E.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
259
- return `${n} solid ${de.test(r) ? r : "currentColor"}`;
257
+ function A(e) {
258
+ let t = w(e, "mslinethickness") ?? "medium", n = pe[t] ?? (he.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
259
+ return `${n} solid ${ge.test(r) ? r : "currentColor"}`;
260
260
  }
261
- function _e(e, t, n) {
262
- let r = Math.max(0, j(e, "length"));
261
+ function Ce(e, t, n) {
262
+ let r = Math.max(0, T(e, "length"));
263
263
  return {
264
264
  kind: "line",
265
265
  length: r,
266
- anchor: N(r, n.stackAlign),
266
+ anchor: D(r, n.stackAlign),
267
267
  position: t,
268
- border: I(e)
268
+ border: A(e)
269
269
  };
270
270
  }
271
- function L(e, t, n, r, i) {
271
+ function j(e, t, n, r, i) {
272
272
  e.forEach((e, a) => {
273
- let o = t + a * n + j(e, "position");
273
+ let o = t + a * n + T(e, "position");
274
274
  switch (e.localName) {
275
275
  case "msgroup":
276
- L([...e.children], o, j(e, "shift"), r, i);
276
+ j([...e.children], o, T(e, "shift"), r, i);
277
277
  break;
278
278
  case "msline":
279
- i.push(_e(e, o, r));
279
+ i.push(Ce(e, o, r));
280
280
  break;
281
281
  case "mscarries":
282
- i.push(ge(e, o, r));
282
+ i.push(Se(e, o, r));
283
283
  break;
284
284
  case "msrow":
285
285
  case "mrow":
286
- i.push(P([...e.children], o, r));
286
+ i.push(O([...e.children], o, r));
287
287
  break;
288
- default: i.push(P([e], o, r));
288
+ default: i.push(O([e], o, r));
289
289
  }
290
290
  });
291
291
  }
292
- function R(e) {
292
+ function M(e) {
293
293
  return -e.anchor - e.position;
294
294
  }
295
- function z(e) {
295
+ function N(e) {
296
296
  return e.kind === "digits" ? e.cells.length : e.kind === "carries" ? e.carries.length : e.length;
297
297
  }
298
- function B(e) {
299
- return R(e) + z(e) - 1;
298
+ function P(e) {
299
+ return M(e) + N(e) - 1;
300
300
  }
301
- function ve(e, t, n, r) {
302
- let i = (e) => D(r.document, "mpadded", [t], {
301
+ function we(e, t, n, r) {
302
+ let i = (e) => S(r.document, "mpadded", [t], {
303
303
  width: "0",
304
304
  ...e ? { lspace: e } : {}
305
- }), a = (e, t) => D(r.document, e, t);
305
+ }), a = (e, t) => S(r.document, e, t);
306
306
  switch (n) {
307
307
  case "s": return a("munder", [e, i("-0.5width")]);
308
308
  case "ne": return a("msup", [e, i()]);
@@ -324,49 +324,49 @@ function ve(e, t, n, r) {
324
324
  default: return a("mover", [e, i("-0.5width")]);
325
325
  }
326
326
  }
327
- function ye(e, t, n) {
328
- let r = D(n.document, "menclose", [e], {
327
+ function Te(e, t, n) {
328
+ let r = S(n.document, "menclose", [e], {
329
329
  notation: t.join(" "),
330
330
  "data-padding": "0.1em",
331
331
  "data-thickness": "0.067em"
332
332
  }), i = t.some((e) => e.endsWith("diagonalstrike")) ? .167 : t.includes("horizontalstrike") ? .1 : 0;
333
- return i ? D(n.document, "mpadded", [r], {
333
+ return i ? S(n.document, "mpadded", [r], {
334
334
  lspace: `-${i}em`,
335
335
  width: `-${2 * i}em`
336
336
  }) : r;
337
337
  }
338
- function be(e, t, n, r, i) {
339
- let a = e && t.crossout.length ? ye(e, t.crossout, i) : e;
338
+ function Ee(e, t, n, r, i) {
339
+ let a = e && t.crossout.length ? Te(e, t.crossout, i) : e;
340
340
  if (!t.content) return a;
341
- let o = D(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
342
- return ve(a ?? k(i), o, n, i);
341
+ let o = S(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
342
+ return we(a ?? be(i), o, n, i);
343
343
  }
344
- function V(e, t) {
345
- return e.carries[t - R(e)] ?? null;
344
+ function F(e, t) {
345
+ return e.carries[t - M(e)] ?? null;
346
346
  }
347
- function xe(e, t, n, r) {
347
+ function De(e, t, n, r) {
348
348
  let i = e.content;
349
349
  n.forEach((e, a) => {
350
- let o = n.length - 1 - a, s = n[o], c = V(s, t), l = n.slice(0, o).some((e) => V(e, t));
350
+ let o = n.length - 1 - a, s = n[o], c = F(s, t), l = n.slice(0, o).some((e) => F(e, t));
351
351
  if (!c && !l) return;
352
352
  let u = c ?? {
353
- content: k(r),
353
+ content: be(r),
354
354
  location: "n",
355
355
  crossout: []
356
356
  }, d = a === 0 ? u.location : "n";
357
- i = be(i, u, d, s.scale, r);
357
+ i = Ee(i, u, d, s.scale, r);
358
358
  }), e.content = i;
359
359
  }
360
- function H(e, t) {
361
- let n = e.filter((e) => z(e) > 0), r = Math.min(0, ...n.map(R)), i = Math.max(r, ...n.map(B)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
360
+ function I(e, t) {
361
+ let n = e.filter((e) => N(e) > 0), r = Math.min(0, ...n.map(M)), i = Math.max(r, ...n.map(P)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
362
362
  content: null,
363
363
  borders: {}
364
- })), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + R(e) + n), u = [], d = [], f = (e) => {
364
+ })), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + M(e) + n), u = [], d = [], f = (e) => {
365
365
  let n = c();
366
366
  e.cells.forEach((t, r) => {
367
- n[a + R(e) + r].content = t;
367
+ n[a + M(e) + r].content = t;
368
368
  }), u.length && n.forEach((e, n) => {
369
- xe(e, n - a, u, t);
369
+ De(e, n - a, u, t);
370
370
  });
371
371
  for (let e of d) for (let t of l(e)) n[t].borders.top = e.border;
372
372
  u = [], d = [], s.set(e, o.length), o.push(n);
@@ -386,44 +386,44 @@ function H(e, t) {
386
386
  origin: a
387
387
  };
388
388
  }
389
- function U(e, { rows: t }, n) {
390
- let r = D(n.document, "mtable", t.map((e) => D(n.document, "mtr", e.map((e) => {
389
+ function L(e, { rows: t }, n) {
390
+ let r = S(n.document, "mtable", t.map((e) => S(n.document, "mtr", e.map((e) => {
391
391
  let t = Object.entries(e.borders).map(([e, t]) => `border-${e}:${t}`).join(";");
392
- return D(n.document, "mtd", [e.content], {
392
+ return S(n.document, "mtd", [e.content], {
393
393
  ...t ? { style: t } : {},
394
394
  ...e.align ? { columnalign: e.align } : {}
395
395
  });
396
396
  }))));
397
- for (let { name: t, value: n } of [...e.attributes]) me.has(t) || r.setAttribute(t, n);
398
- let i = A(e, "charspacing") ?? "medium", a = A(e, "charalign");
399
- return r.setAttribute("columnspacing", T[i] ?? (E.test(i) ? i : T.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
397
+ for (let { name: t, value: n } of [...e.attributes]) ye.has(t) || r.setAttribute(t, n);
398
+ let i = w(e, "charspacing") ?? "medium", a = w(e, "charalign");
399
+ return r.setAttribute("columnspacing", me[i] ?? (he.test(i) ? i : me.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
400
400
  }
401
- function W(e) {
401
+ function R(e) {
402
402
  return {
403
403
  document: e.ownerDocument,
404
- stackAlign: A(e, "stackalign") ?? "decimalpoint",
404
+ stackAlign: w(e, "stackalign") ?? "decimalpoint",
405
405
  decimalPoint: e.closest("[decimalpoint]")?.getAttribute("decimalpoint")?.trim().charAt(0) || "."
406
406
  };
407
407
  }
408
- function Se(e) {
409
- let t = W(e), n = [];
410
- return L([...e.children], 0, 0, t, n), U(e, H(n, t), t);
408
+ function Oe(e) {
409
+ let t = R(e), n = [];
410
+ return j([...e.children], 0, 0, t, n), L(e, I(n, t), t);
411
411
  }
412
- function G(e, t, n, r, i, a) {
412
+ function z(e, t, n, r, i, a) {
413
413
  for (let o = n; o <= r; o++) e[t][o].borders[i] = a;
414
414
  }
415
- function Ce(e, t) {
416
- let n = O(t, ")");
417
- return n.setAttribute("minsize", "1.2em"), [D(t.document, "mrow", [e, D(t.document, "mspace", [], { width: "0.2em" })]), D(t.document, "mpadded", [n], {
415
+ function ke(e, t) {
416
+ let n = C(t, ")");
417
+ return n.setAttribute("minsize", "1.2em"), [S(t.document, "mrow", [e, S(t.document, "mspace", [], { width: "0.2em" })]), S(t.document, "mpadded", [n], {
418
418
  voffset: "0.1em",
419
419
  lspace: "-0.15em",
420
420
  depth: "-0.2em",
421
421
  height: "-0.2em"
422
422
  })];
423
423
  }
424
- function we(e) {
425
- let t = W(e), [n, r, ...i] = [...e.children], a = n && !M(n) ? n : null, o = r && !M(r) ? r : null, s = A(e, "longdivstyle") ?? "lefttop", c = I(e), l = [];
426
- L(i, 0, 0, t, l);
424
+ function Ae(e) {
425
+ let t = R(e), [n, r, ...i] = [...e.children], a = n && !E(n) ? n : null, o = r && !E(r) ? r : null, s = w(e, "longdivstyle") ?? "lefttop", c = A(e), l = [];
426
+ j(i, 0, 0, t, l);
427
427
  let u = l.find((e) => e.kind === "digits");
428
428
  u || (u = {
429
429
  kind: "digits",
@@ -435,51 +435,51 @@ function we(e) {
435
435
  u.cells.unshift(...e), u.anchor += e.length;
436
436
  }, p = (...e) => {
437
437
  let n = e.flatMap((e) => e ? e.localName === "mrow" ? [...e.children] : [e] : []);
438
- u.cells.push(...P(n, 0, t).cells);
438
+ u.cells.push(...O(n, 0, t).cells);
439
439
  };
440
440
  switch (s) {
441
441
  case "left/\\right":
442
- f(a, O(t, "/")), p(O(t, "\\"), o);
442
+ f(a, C(t, "/")), p(C(t, "\\"), o);
443
443
  break;
444
444
  case "left)(right":
445
- f(a, O(t, ")")), p(O(t, "("), o);
445
+ f(a, C(t, ")")), p(C(t, "("), o);
446
446
  break;
447
447
  case ":right=right":
448
- p(O(t, ":"), a, O(t, "="), o);
448
+ p(C(t, ":"), a, C(t, "="), o);
449
449
  break;
450
450
  case "righttop":
451
451
  case "stackedleftlinetop":
452
452
  case "lefttop":
453
- o && L([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...Ce(a, t));
453
+ o && j([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...ke(a, t));
454
454
  break;
455
455
  }
456
- let m = H(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + R(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + B(e)));
456
+ let m = I(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + M(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + P(e)));
457
457
  switch (s) {
458
458
  case "left/\\right":
459
459
  case "left)(right":
460
460
  case ":right=right": break;
461
461
  case "righttop": {
462
462
  let e = h[g][_(u.cells.length - 1)];
463
- e.borders.left = c, e.borders.bottom = c, G(h, g, _(0), _(u.cells.length - 1), "top", c);
463
+ e.borders.left = c, e.borders.bottom = c, z(h, g, _(0), _(u.cells.length - 1), "top", c);
464
464
  break;
465
465
  }
466
466
  case "stackedleftlinetop": {
467
467
  let e = h[g][_(0)];
468
- e.borders.right = c, e.borders.bottom = c, G(h, g, _(1), v, "top", c);
468
+ e.borders.right = c, e.borders.bottom = c, z(h, g, _(1), v, "top", c);
469
469
  break;
470
470
  }
471
471
  case "stackedrightright":
472
472
  case "mediumstackedrightright":
473
473
  case "shortstackedrightright":
474
474
  case "stackedleftleft":
475
- Te(h, g, s, a, o, c, t);
475
+ je(h, g, s, a, o, c, t);
476
476
  break;
477
- default: G(h, g, _(1), v, "top", c);
477
+ default: z(h, g, _(1), v, "top", c);
478
478
  }
479
- return U(e, m, t);
479
+ return L(e, m, t);
480
480
  }
481
- function Te(e, t, n, r, i, a, o) {
482
- let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && D(o.document, "mpadded", [e], {
481
+ function je(e, t, n, r, i, a, o) {
482
+ let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && S(o.document, "mpadded", [e], {
483
483
  lspace: "0.2em",
484
484
  width: "+0.4em"
485
485
  });
@@ -498,134 +498,409 @@ function Te(e, t, n, r, i, a, o) {
498
498
  }) : o === t + 1 ? (u.content = l(i), n !== "shortstackedrightright" && (u.borders[c] = a)) : o > t + 1 && (n === "stackedrightright" || s) && (u.borders[c] = a), s ? e.unshift(u) : e.push(u);
499
499
  });
500
500
  }
501
- function Ee(e) {
502
- for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Se(t) : we(t));
501
+ function Me(e) {
502
+ for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Oe(t) : Ae(t));
503
503
  }
504
- var De = "PIE-MJX-explorer-styles", K = "var(--pie-text, black)", Oe = "var(--pie-background, #ffffff)", ke = "var(--pie-border-dark, #66686A)", q = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))", J = `color-mix(in srgb, ${q} 15%, transparent)`, Ae = `
504
+ var Ne = "PIE-MJX-explorer-styles", B = "var(--pie-text, black)", Pe = "var(--pie-background, #ffffff)", Fe = "var(--pie-border-dark, #66686A)", V = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))", H = `color-mix(in srgb, ${V} 15%, transparent)`, Ie = `
505
505
  :root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
506
- color: ${K} !important;
507
- fill: ${K} !important;
506
+ color: ${B} !important;
507
+ fill: ${B} !important;
508
508
  }
509
509
  :root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
510
- background-color: ${J} !important;
510
+ background-color: ${H} !important;
511
511
  }
512
512
  :root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
513
- fill: ${J} !important;
513
+ fill: ${H} !important;
514
514
  }
515
515
  :root mjx-container .mjx-selected {
516
- outline: 2px solid ${q} !important;
516
+ outline: 2px solid ${V} !important;
517
517
  }
518
518
  :root mjx-container [data-sre-highlight-2] {
519
- color: ${K} !important;
519
+ color: ${B} !important;
520
520
  background-color: transparent !important;
521
- fill: ${K} !important;
522
- outline: 2px dashed ${q} !important;
521
+ fill: ${B} !important;
522
+ outline: 2px dashed ${V} !important;
523
523
  }
524
524
  :root mjx-container rect[data-sre-highlight-2] {
525
525
  fill: transparent !important;
526
- stroke: ${q} !important;
526
+ stroke: ${V} !important;
527
527
  stroke-width: 2px !important;
528
528
  vector-effect: non-scaling-stroke;
529
529
  }
530
530
  :root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
531
- color: ${K} !important;
532
- background-color: ${Oe} !important;
533
- border-color: ${ke} !important;
531
+ color: ${B} !important;
532
+ background-color: ${Pe} !important;
533
+ border-color: ${Fe} !important;
534
534
  }
535
535
  :root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
536
- color: ${K} !important;
537
- background-color: ${J} !important;
536
+ color: ${B} !important;
537
+ background-color: ${H} !important;
538
538
  }
539
539
  `;
540
- function je(e = document) {
540
+ function Le(e = document) {
541
541
  if (e.getElementById("PIE-MJX-explorer-styles")) return;
542
542
  let t = e.createElement("style");
543
- t.id = De, t.textContent = Ae, e.head.appendChild(t);
543
+ t.id = Ne, t.textContent = Ie, e.head.appendChild(t);
544
+ }
545
+ var Re = /[⁡-⁤]/g, ze = {
546
+ "+": "positive",
547
+ "-": "negative",
548
+ "−": "negative",
549
+ "±": "plus or minus",
550
+ "∓": "minus or plus"
551
+ }, Be = {
552
+ "(": "open parenthesis",
553
+ "[": "open bracket",
554
+ "{": "open brace",
555
+ "⟨": "open angle bracket",
556
+ "⌊": "open floor",
557
+ "⌈": "open ceiling"
558
+ }, Ve = {
559
+ ")": "close parenthesis",
560
+ "]": "close bracket",
561
+ "}": "close brace",
562
+ "⟩": "close angle bracket",
563
+ "⌋": "close floor",
564
+ "⌉": "close ceiling"
565
+ }, U = {
566
+ "!": "factorial",
567
+ "%": "percent",
568
+ "°": "degrees",
569
+ "′": "prime",
570
+ "″": "double prime"
571
+ }, He = {
572
+ "+": "plus",
573
+ "-": "minus",
574
+ "−": "minus",
575
+ "±": "plus or minus",
576
+ "∓": "minus or plus",
577
+ "×": "times",
578
+ "⋅": "times",
579
+ "·": "times",
580
+ "*": "times",
581
+ "÷": "divided by",
582
+ "/": "divided by",
583
+ "=": "equals",
584
+ "≠": "does not equal",
585
+ "<": "is less than",
586
+ ">": "is greater than",
587
+ "≤": "is less than or equal to",
588
+ "≥": "is greater than or equal to",
589
+ "≈": "is approximately equal to",
590
+ "≡": "is equivalent to",
591
+ "∝": "is proportional to",
592
+ "∈": "is an element of",
593
+ "∉": "is not an element of",
594
+ "⊂": "is a subset of",
595
+ "⊆": "is a subset of or equal to",
596
+ "∪": "union",
597
+ "∩": "intersection",
598
+ "→": "right arrow",
599
+ "←": "left arrow",
600
+ "⇒": "implies",
601
+ "⇔": "if and only if",
602
+ "∑": "sum",
603
+ "∏": "product",
604
+ "∫": "integral",
605
+ "∞": "infinity",
606
+ "∠": "angle",
607
+ "⊥": "is perpendicular to",
608
+ "∥": "is parallel to",
609
+ "∴": "therefore",
610
+ ",": "comma",
611
+ ";": "semicolon",
612
+ ":": "colon",
613
+ "|": "vertical bar",
614
+ "‖": "double vertical bar",
615
+ ...Be,
616
+ ...Ve,
617
+ ...U
618
+ }, Ue = /* @__PURE__ */ new Set(["|", "‖"]), We = /* @__PURE__ */ new Set([
619
+ "∑",
620
+ "∏",
621
+ "∫",
622
+ "∪",
623
+ "∩"
624
+ ]), Ge = {
625
+ α: "alpha",
626
+ β: "beta",
627
+ γ: "gamma",
628
+ δ: "delta",
629
+ ε: "epsilon",
630
+ θ: "theta",
631
+ λ: "lambda",
632
+ μ: "mu",
633
+ π: "pi",
634
+ ρ: "rho",
635
+ σ: "sigma",
636
+ τ: "tau",
637
+ φ: "phi",
638
+ ω: "omega",
639
+ Δ: "capital delta",
640
+ Σ: "capital sigma",
641
+ Ω: "capital omega",
642
+ "∞": "infinity",
643
+ sin: "sine",
644
+ cos: "cosine",
645
+ tan: "tangent",
646
+ sec: "secant",
647
+ csc: "cosecant",
648
+ cot: "cotangent",
649
+ ln: "natural log",
650
+ lim: "limit"
651
+ }, Ke = {
652
+ "¯": "bar",
653
+ "‾": "bar",
654
+ "―": "bar",
655
+ "^": "hat",
656
+ ˆ: "hat",
657
+ "~": "tilde",
658
+ "˜": "tilde",
659
+ "→": "vector",
660
+ "⃗": "vector",
661
+ "˙": "dot"
662
+ }, W = (e) => (e.textContent ?? "").replace(Re, "").replace(/\s+/g, " ").trim(), G = (e) => e.replace(/\s+/g, " ").trim(), K = (e) => [...e.children];
663
+ function q(e) {
664
+ return !e || [
665
+ "mn",
666
+ "mi",
667
+ "mtext",
668
+ "mo"
669
+ ].includes(e.localName) ? !0 : ["mrow", "mstyle"].includes(e.localName) && e.children.length === 1 ? q(e.children[0]) : !1;
670
+ }
671
+ function qe(e) {
672
+ let t = e ? W(e) : "";
673
+ return /^\d{1,3}$/.test(t) ? Number(t) : void 0;
674
+ }
675
+ function Je(e) {
676
+ return `${e}${e % 100 >= 11 && e % 100 <= 13 ? "th" : {
677
+ 1: "st",
678
+ 2: "nd",
679
+ 3: "rd"
680
+ }[e % 10] ?? "th"}`;
681
+ }
682
+ function Ye(e) {
683
+ return Ge[e] ?? e;
684
+ }
685
+ function J(e) {
686
+ return He[e] ?? e;
687
+ }
688
+ function Y(e) {
689
+ let t = [], n = !1;
690
+ for (let r of e) {
691
+ if (r.localName !== "mo") {
692
+ t.push(X(r)), n = !0;
693
+ continue;
694
+ }
695
+ let e = W(r);
696
+ e && (!n && ze[e] ? t.push(ze[e]) : e in U ? t.push(U[e]) : (t.push(J(e)), n = e in Ve || Ue.has(e) && n));
697
+ }
698
+ return t.filter(Boolean).join(" ");
699
+ }
700
+ function Xe(e) {
701
+ let [t, ...n] = e, r = n[n.length - 1], i = (e) => e?.localName === "mo" && ["|", "‖"].includes(W(e)), a = n.slice(0, -1);
702
+ if (a.length && i(t) && i(r) && W(t) === W(r) && !a.some(i)) {
703
+ let e = G(Y(a));
704
+ return W(t) === "|" ? `absolute value of ${e} end absolute value` : `norm of ${e} end norm`;
705
+ }
706
+ return Y(e);
707
+ }
708
+ function Ze(e, t) {
709
+ let n = e ? X(e) : "", r = t ? X(t) : "";
710
+ return q(e) && q(t) ? `${n} over ${r}` : `the fraction with numerator ${n} and denominator ${r}`;
711
+ }
712
+ function Qe(e, t, n) {
713
+ return n ? `${t} of ${e}` : `${t} of ${e} end root`;
714
+ }
715
+ function $e(e, t) {
716
+ let n = t ? W(t) : "";
717
+ if (t && q(t)) {
718
+ if (n === "2") return `${e} squared`;
719
+ if (n === "3") return `${e} cubed`;
720
+ if (n in U) return `${e} ${U[n]}`;
721
+ }
722
+ let r = t ? X(t) : "";
723
+ return q(t) ? `${e} to the power of ${r}` : `${e} to the power of ${r} end power`;
724
+ }
725
+ function et(e, t) {
726
+ let n = t ? X(t) : "";
727
+ return q(t) ? `${e} sub ${n}` : `${e} sub ${n} end sub`;
728
+ }
729
+ function tt(e, t, n) {
730
+ let r = W(e);
731
+ if (r === "lim") return `limit as ${t ? X(t) : ""} of`;
732
+ if (!We.has(r)) return;
733
+ let i = t ? `from ${X(t)}` : "", a = n ? `to ${X(n)}` : "";
734
+ return `${J(r)} ${i} ${a} of`;
544
735
  }
545
- var Y = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
546
- function Me() {
736
+ function nt(e) {
737
+ let t = K(e).filter((e) => ["mtr", "mlabeledtr"].includes(e.localName)), n = t.map((e) => K(e).filter((e) => e.localName === "mtd")), r = Math.max(0, ...n.map((e) => e.length)), i = n.map((e, t) => `row ${t + 1}: ${e.map((e) => G(Y(K(e)))).join(", ")}`);
738
+ return `table with ${t.length} ${t.length === 1 ? "row" : "rows"} and ${r} ${r === 1 ? "column" : "columns"}. ${i.join(". ")}`;
739
+ }
740
+ function rt(e) {
741
+ let t = e.getAttribute("open") ?? "(", n = e.getAttribute("close") ?? ")", r = (e.getAttribute("separators") ?? ",").replace(/\s+/g, "").split(""), i = K(e).map((e, t, n) => t < n.length - 1 ? `${X(e)} ${J(r[Math.min(t, r.length - 1)] ?? ",")}` : X(e));
742
+ return [
743
+ J(t),
744
+ ...i,
745
+ J(n)
746
+ ].filter(Boolean).join(" ");
747
+ }
748
+ function X(e) {
749
+ let t = K(e);
750
+ switch (e.localName) {
751
+ case "mi": return Ye(W(e));
752
+ case "mn":
753
+ case "mtext":
754
+ case "ms": return W(e);
755
+ case "mo": return J(W(e));
756
+ case "mspace":
757
+ case "mphantom":
758
+ case "annotation":
759
+ case "annotation-xml": return "";
760
+ case "semantics": return t[0] ? X(t[0]) : "";
761
+ case "mfrac": return Ze(t[0], t[1]);
762
+ case "msqrt": return Qe(G(Y(t)), "square root", t.length === 1 && q(t[0]));
763
+ case "mroot": {
764
+ let e = qe(t[1]), n = e === 2 ? "square root" : e === 3 ? "cube root" : e ? `${Je(e)} root` : `root with index ${t[1] ? X(t[1]) : ""}`;
765
+ return Qe(t[0] ? X(t[0]) : "", n, q(t[0]));
766
+ }
767
+ case "msup": return $e(t[0] ? X(t[0]) : "", t[1]);
768
+ case "msub": return et(t[0] ? X(t[0]) : "", t[1]);
769
+ case "msubsup": return (t[0] ? tt(t[0], t[1], t[2]) : void 0) || $e(et(t[0] ? X(t[0]) : "", t[1]), t[2]);
770
+ case "munder":
771
+ case "mover":
772
+ case "munderover": {
773
+ let [n, r, i] = t, a = e.localName === "mover" ? void 0 : r, o = e.localName === "munder" ? void 0 : e.localName === "mover" ? r : i, s = n ? tt(n, a, o) : void 0;
774
+ if (s) return s;
775
+ let c = n ? X(n) : "", l = e.localName === "mover" && r ? Ke[W(r)] : void 0;
776
+ return l ? l === "vector" ? `vector ${c}` : `${c} ${l}` : [
777
+ c,
778
+ a ? `with ${X(a)} below` : "",
779
+ o ? `with ${X(o)} above` : ""
780
+ ].filter(Boolean).join(" ");
781
+ }
782
+ case "mfenced": return rt(e);
783
+ case "mtable": return nt(e);
784
+ case "mrow":
785
+ case "math": return Xe(t);
786
+ default: return t.length ? Y(t) : W(e);
787
+ }
788
+ }
789
+ function it(e) {
790
+ return G(X(e));
791
+ }
792
+ var at = [
793
+ "a[href]",
794
+ "button",
795
+ "label",
796
+ "summary",
797
+ ...[
798
+ "button",
799
+ "checkbox",
800
+ "combobox",
801
+ "link",
802
+ "menuitem",
803
+ "menuitemcheckbox",
804
+ "menuitemradio",
805
+ "option",
806
+ "radio",
807
+ "switch",
808
+ "tab",
809
+ "treeitem"
810
+ ].map((e) => `[role="${e}"]`)
811
+ ].join(", ");
812
+ function ot(e) {
813
+ if (e.hasAttribute("aria-label") || !e.closest(at)) return;
814
+ let t = e.querySelector("math"), n = t ? it(t) : "";
815
+ n && e.setAttribute("aria-label", n);
816
+ }
817
+ function st(e) {
818
+ for (let t of e.querySelectorAll("mjx-container")) ot(t);
819
+ }
820
+ var ct = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
821
+ function lt() {
547
822
  let e = globalThis;
548
- e[Y] || (e[Y] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t}`));
823
+ e[ct] || (e[ct] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t}`));
549
824
  }
550
- function Ne(e) {
825
+ function ut(e) {
551
826
  let t = e.webworker;
552
827
  if (!t || t.ready) return;
553
828
  e.options ??= {};
554
829
  let n = e.options;
555
- n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), Me();
830
+ n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), lt();
556
831
  }
557
- function Pe(e) {
832
+ function dt(e) {
558
833
  let t = e?.adaptor, n = t?.createWorker;
559
834
  !e || !t || !n || (t.createWorker = async (r, i) => {
560
835
  let a = await n.call(t, r, i);
561
- return a.addEventListener("error", () => Ne(e), { once: !0 }), a;
836
+ return a.addEventListener("error", () => ut(e), { once: !0 }), a;
562
837
  });
563
838
  }
564
839
  `${i}`;
565
- var Fe = {
840
+ var ft = {
566
841
  parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
567
842
  overarc: "\\overparen",
568
843
  napprox: "\\not\\approx",
569
844
  longdiv: "\\enclose{longdiv}",
570
845
  abs: ["\\left|#1\\right|", 1]
571
- }, Ie = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", Le = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, Re = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, ze = /\\embed\{newLine\}\[\]/g, Be = [
846
+ }, pt = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", mt = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, ht = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, gt = /\\embed\{newLine\}\[\]/g, _t = [
572
847
  ["$$", "$$"],
573
848
  ["$", "$"],
574
849
  ["\\[", "\\]"],
575
850
  ["\\(", "\\)"]
576
- ], X = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), Ve = "MJX-CHTML-styles", He = "PIE-MJX-SVG-styles", Z = "PIE-MathJax-Menu-Settings", Ue = { "mjx-container[overflow=\"linebreak\"][display]": {
851
+ ], vt = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), yt = "MJX-CHTML-styles", bt = "PIE-MJX-SVG-styles", Z = "PIE-MathJax-Menu-Settings", xt = { "mjx-container[overflow=\"linebreak\"][display]": {
577
852
  overflow: "auto clip",
578
853
  "min-width": "initial !important"
579
- } }, We = 200, Ge = 201;
854
+ } }, St = 200, Ct = 201, wt = 202;
580
855
  function Q(e) {
581
856
  let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
582
857
  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");
583
858
  }
584
- function Ke(e) {
585
- for (let [t, n] of Be) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
859
+ function Tt(e) {
860
+ for (let [t, n] of _t) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
586
861
  return e;
587
862
  }
588
- function qe(e) {
589
- return Ke(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
863
+ function Et(e) {
864
+ return Tt(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
590
865
  }
591
- var Je = "mathjax_ignore", Ye = "mathjax_process";
592
- function Xe(e, t) {
593
- let n = e.closest(`.${Je}, .${Ye}`);
594
- return n !== null && t.contains(n) && !n.classList.contains(Ye);
866
+ var Dt = "mathjax_ignore", Ot = "mathjax_process";
867
+ function kt(e, t) {
868
+ let n = e.closest(`.${Dt}, .${Ot}`);
869
+ return n !== null && t.contains(n) && !n.classList.contains(Ot);
595
870
  }
596
- function Ze(e) {
871
+ function At(e) {
597
872
  for (let t of e.querySelectorAll("[data-latex]")) {
598
- if (t.dataset.mathHandled || t.closest("mjx-container") || Xe(t, e)) continue;
873
+ if (t.dataset.mathHandled || t.closest("mjx-container") || kt(t, e)) continue;
599
874
  let n = t.textContent;
600
- n && (t.textContent = `\\(${qe(n)}\\)`.replace(ze, "\\newline "), t.dataset.mathHandled = "true");
875
+ n && (t.textContent = `\\(${Et(n)}\\)`.replace(gt, "\\newline "), t.dataset.mathHandled = "true");
601
876
  }
602
877
  }
603
- function Qe(e) {
878
+ function jt(e) {
604
879
  for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
605
880
  }
606
- function $e(e, t) {
881
+ function Mt(e, t) {
607
882
  for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
608
- return (t ? Re : Le).test(e.textContent ?? "");
883
+ return (t ? ht : mt).test(e.textContent ?? "");
609
884
  }
610
- function et(e) {
885
+ function Nt(e) {
611
886
  return new Promise((t, n) => {
612
887
  let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = d(e, import.meta.url), c = {
613
888
  loader: {
614
889
  load: i ? ["a11y/assistive-mml"] : [],
615
890
  failed: (e) => n(e),
616
891
  "output/svg": { ready: (e) => {
617
- let t = x();
618
- return tt(t) && $(t), e;
892
+ let t = b();
893
+ return $(t) && Pt(t), e;
619
894
  } }
620
895
  },
621
896
  startup: {
622
897
  typeset: !1,
623
898
  ready: () => {
624
- let e = x(), r = e?.startup, i = tt(e);
625
- i && ($(e), nt(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (rt(r?.document), r?.document?.addStyles?.(Ue), Pe(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
899
+ let e = b(), r = e?.startup, i = $(e);
900
+ i && (Pt(e), Ft(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (It(r?.document), Lt(r?.document), r?.document?.addStyles?.(xt), dt(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
626
901
  }
627
902
  },
628
- tex: { macros: { ...Fe } },
903
+ tex: { macros: { ...ft } },
629
904
  output: { displayOverflow: "linebreak" },
630
905
  options: {
631
906
  enableMenu: i,
@@ -637,9 +912,9 @@ function et(e) {
637
912
  a11y: { inTabOrder: !1 }
638
913
  }
639
914
  };
640
- r && c.tex && (console.warn(Ie), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
915
+ r && c.tex && (console.warn(pt), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
641
916
  let l = p(s.speechLocales);
642
- l && c.options && (c.options.sre = { locale: l }), ne(c, {
917
+ l && c.options && (c.options.sre = { locale: l }), re(c, {
643
918
  ...s,
644
919
  srcUrl: o
645
920
  }).then((e) => {
@@ -647,16 +922,16 @@ function et(e) {
647
922
  }, n);
648
923
  });
649
924
  }
650
- function tt(e) {
925
+ function $(e) {
651
926
  return !!e?.version?.startsWith("4.");
652
927
  }
653
- function $(e) {
928
+ function Pt(e) {
654
929
  let t = e?._?.output, n = t?.chtml_ts?.CHTML;
655
- n && (n.STYLESHEETID = S);
930
+ n && (n.STYLESHEETID = x);
656
931
  let r = t?.svg_ts?.SVG;
657
- r && (r.STYLESHEETID = He);
932
+ r && (r.STYLESHEETID = bt);
658
933
  }
659
- function nt(e, t) {
934
+ function Ft(e, t) {
660
935
  let n = e?._?.ui?.menu?.Menu?.Menu;
661
936
  if (n) {
662
937
  n.MENU_STORAGE = Z;
@@ -669,13 +944,13 @@ function nt(e, t) {
669
944
  } catch {}
670
945
  }
671
946
  }
672
- function rt(e) {
947
+ function It(e) {
673
948
  if (!e) return;
674
949
  let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
675
950
  let n = e.typesetRoot;
676
951
  !n || t.has(n) || (Q(n), t.add(n));
677
952
  };
678
- e.addRenderAction?.("pie-strip-latex", Ge, (e) => {
953
+ e.addRenderAction?.("pie-strip-latex", Ct, (e) => {
679
954
  for (let t of e.math ?? []) n(t);
680
955
  return !1;
681
956
  }, (e) => {
@@ -683,114 +958,97 @@ function rt(e) {
683
958
  return t && Q(t), !1;
684
959
  });
685
960
  let r = e.outputJax?.chtmlStyles;
686
- r?.id === Ve && (r.id = S), ot();
961
+ r?.id === yt && (r.id = x), Bt();
687
962
  }
688
- function it(e) {
689
- return e instanceof HTMLStyleElement && ie.includes(e.id);
963
+ function Lt(e) {
964
+ let t = (e) => {
965
+ e.typesetRoot && ot(e.typesetRoot);
966
+ };
967
+ e?.addRenderAction?.("pie-name-math", wt, (e) => {
968
+ for (let n of e.math ?? []) t(n);
969
+ return !1;
970
+ }, (e) => (t(e), !1));
690
971
  }
691
- function at(e) {
692
- b("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
972
+ function Rt(e) {
973
+ return e instanceof HTMLStyleElement && ae.includes(e.id);
693
974
  }
694
- function ot() {
695
- let e = document.head, t = [...e.children].find(it);
975
+ function zt(e) {
976
+ ee("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
977
+ }
978
+ function Bt() {
979
+ let e = document.head, t = [...e.children].find(Rt);
696
980
  if (t) {
697
- at(t);
981
+ zt(t);
698
982
  return;
699
983
  }
700
984
  let n = new MutationObserver((e) => {
701
985
  for (let t of e) {
702
- let e = [...t.addedNodes].find(it);
986
+ let e = [...t.addedNodes].find(Rt);
703
987
  if (e) {
704
- at(e), n.disconnect();
988
+ zt(e), n.disconnect();
705
989
  return;
706
990
  }
707
991
  }
708
992
  });
709
993
  n.observe(e, { childList: !0 });
710
994
  }
711
- function st(e) {
995
+ function Vt(e) {
712
996
  let t = e?.math;
713
997
  if (!t?.remove) return;
714
- let n = [...t].filter((e) => (e.state?.() ?? 0) >= We && e.typesetRoot?.isConnected === !1);
998
+ let n = [...t].filter((e) => (e.state?.() ?? 0) >= St && e.typesetRoot?.isConnected === !1);
715
999
  if (n.length !== 0) {
716
1000
  for (let e of [...n].reverse()) e.clear?.();
717
1001
  t.remove(...n);
718
1002
  }
719
1003
  }
720
- function ct(e) {
1004
+ function Ht(e) {
721
1005
  return new Promise((t, n) => {
722
1006
  let r = e.startup ?? {};
723
1007
  e.startup = r;
724
1008
  let i = r.ready;
725
1009
  r.ready = () => {
726
- let e = x()?.startup;
1010
+ let e = b()?.startup;
727
1011
  i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
728
1012
  };
729
1013
  });
730
1014
  }
731
- function lt(e) {
732
- let t = x();
733
- return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : ct(t) : et(e);
1015
+ function Ut(e) {
1016
+ let t = b();
1017
+ return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : Ht(t) : Nt(e);
734
1018
  }
735
- function ut(e) {
736
- return lt(e).then(() => {
737
- let e = x();
1019
+ function Wt(e) {
1020
+ return Ut(e).then(() => {
1021
+ let e = b();
738
1022
  e && typeof e.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
739
1023
  });
740
1024
  }
741
- function dt(e) {
742
- let t = re, n = t[X];
743
- return n || (n = ut(e), t[X] = n), n;
1025
+ function Gt(e) {
1026
+ let t = ie, n = t[vt];
1027
+ return n || (n = Wt(e), t[vt] = n), n;
744
1028
  }
745
- function ft(e = {}) {
1029
+ function Kt(e = {}) {
746
1030
  let t = e.useSingleDollar ?? !1;
747
1031
  return async (n) => {
748
1032
  if (typeof window > "u") return;
749
- let r = ae();
750
- r && b("mathjax-3-global", `window.MathJax is MathJax ${r}`), Ze(n), ce(n), Qe(n), Ee(n);
751
- let i = dt(e);
752
- if (!$e(n, t)) {
1033
+ let r = oe();
1034
+ r && ee("mathjax-3-global", `window.MathJax is MathJax ${r}`), At(n), ue(n), jt(n), Me(n);
1035
+ let i = Gt(e);
1036
+ if (!Mt(n, t)) {
753
1037
  i.catch(() => {});
754
1038
  return;
755
1039
  }
756
1040
  await i;
757
- let a = x();
1041
+ let a = b();
758
1042
  if (await a?.startup?.promise, typeof a?.typesetPromise == "function") {
759
- je(), st(a.startup?.document);
1043
+ Le(), Vt(a.startup?.document);
760
1044
  try {
761
1045
  await a.typesetPromise([n]);
762
1046
  } catch (e) {
763
1047
  throw a.typesetClear?.([n]), e;
764
1048
  }
765
- Q(n);
1049
+ Q(n), st(n);
766
1050
  }
767
1051
  };
768
1052
  }
769
- var pt = {
770
- "(": "open parenthesis",
771
- "[": "open bracket",
772
- "{": "open brace",
773
- "⟨": "open angle bracket",
774
- "⌊": "open floor",
775
- "⌈": "open ceiling"
776
- }, mt = {
777
- ")": "close parenthesis",
778
- "]": "close bracket",
779
- "}": "close brace",
780
- "⟩": "close angle bracket",
781
- "⌋": "close floor",
782
- "⌉": "close ceiling"
783
- }, ht = {
784
- "!": "factorial",
785
- "%": "percent",
786
- "°": "degrees",
787
- "′": "prime",
788
- "″": "double prime"
789
- };
790
- ({
791
- ...pt,
792
- ...mt,
793
- ...ht
794
- });
795
1053
  //#endregion
796
- export { ft as t };
1054
+ export { Kt as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./math-mathjax-C4aCHGPc.js";
1
+ import { t as e } from "./math-mathjax-BYcKE-jQ.js";
2
2
  //#region ../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/disclose-version.js
3
3
  typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
4
4
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/element-player",
3
- "version": "0.1.5-next.20261007175429",
3
+ "version": "0.1.5",
4
4
  "description": "Shared PIE element player web component",
5
5
  "type": "module",
6
6
  "unpkg": "./dist/pie-element-player.js",
@@ -26,7 +26,7 @@
26
26
  "dev": "vite"
27
27
  },
28
28
  "dependencies": {
29
- "@pie-element/shared-math-rendering-mathjax": "0.1.4-next.20261007175429"
29
+ "@pie-element/shared-math-rendering-mathjax": "0.1.4"
30
30
  },
31
31
  "license": "MIT",
32
32
  "publishConfig": {