@loopstack/loopstack-studio 0.21.0-rc.0 → 0.21.0

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 (43) hide show
  1. package/dist/components/LoadingCentered.js +28 -0
  2. package/dist/components/data-table/DataList.js +102 -102
  3. package/dist/components/data-table/DataTable.js +3 -3
  4. package/dist/components/dynamic-form/fields/RadioField.js +3 -3
  5. package/dist/components/dynamic-form/fields/SliderField.js +13 -13
  6. package/dist/components/dynamic-form/fields/SwitchField.js +1 -1
  7. package/dist/components/dynamic-form/fields/TextareaField.js +4 -4
  8. package/dist/components/index.js +45 -0
  9. package/dist/components/messages/CompletionMessagePaper.js +110 -0
  10. package/dist/components/snackbars/ErrorSnackbar.js +1 -1
  11. package/dist/components/ui/DiscordLogo.js +31 -0
  12. package/dist/components/ui/GoogleLogo.js +44 -0
  13. package/dist/components/ui/accordion.js +64 -0
  14. package/dist/components/ui/alert-dialog.js +91 -82
  15. package/dist/components/ui/alert.js +50 -0
  16. package/dist/components/ui/avatar.js +42 -0
  17. package/dist/components/ui/badge.js +1 -1
  18. package/dist/components/ui/breadcrumb.js +76 -56
  19. package/dist/components/ui/card.js +79 -19
  20. package/dist/components/ui/dialog.js +89 -47
  21. package/dist/components/ui/drawer.js +122 -0
  22. package/dist/components/ui/dropdown-menu.js +190 -0
  23. package/dist/components/ui/popover.js +47 -0
  24. package/dist/components/ui/scroll-area.js +50 -0
  25. package/dist/components/ui/select.js +115 -82
  26. package/dist/components/ui/separator.js +20 -0
  27. package/dist/components/ui/sheet.js +87 -57
  28. package/dist/components/ui/sidebar.js +557 -0
  29. package/dist/components/ui/skeleton.js +16 -0
  30. package/dist/components/ui/table.js +85 -61
  31. package/dist/features/health/LocalHealthCheck.js +1 -1
  32. package/dist/features/workspaces/Workspaces.js +1 -1
  33. package/dist/features/workspaces/components/CreateWorkspace.js +4 -4
  34. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  35. package/dist/features/workspaces/components/PipelineForm.js +2 -2
  36. package/dist/hooks/useApi.js +1 -1
  37. package/dist/index.d.ts +751 -9
  38. package/dist/index.js +47 -1
  39. package/dist/loopstack-studio.css +1 -1
  40. package/dist/node_modules/katex/dist/katex.js +717 -861
  41. package/dist/node_modules/vaul/dist/index.js +912 -0
  42. package/dist/pages/WorkspacePage.js +1 -1
  43. package/package.json +16 -16
@@ -27,38 +27,19 @@ var SourceLocation = class e {
27
27
  }
28
28
  };
29
29
  ParseError.prototype.__proto__ = Error.prototype;
30
- var deflt = function(e, t) {
31
- return e === void 0 ? t : e;
32
- }, uppercase = /([A-Z])/g, hyphenate = function(e) {
33
- return e.replace(uppercase, "-$1").toLowerCase();
34
- }, ESCAPE_LOOKUP = {
30
+ var uppercase = /([A-Z])/g, hyphenate = (e) => e.replace(uppercase, "-$1").toLowerCase(), ESCAPE_LOOKUP = {
35
31
  "&": "&",
36
32
  ">": ">",
37
33
  "<": "&lt;",
38
34
  "\"": "&quot;",
39
35
  "'": "&#x27;"
40
- }, ESCAPE_REGEX = /[&><"']/g;
41
- function escape(e) {
42
- return String(e).replace(ESCAPE_REGEX, (e) => ESCAPE_LOOKUP[e]);
43
- }
44
- var getBaseElem = function e(t) {
45
- return t.type === "ordgroup" || t.type === "color" ? t.body.length === 1 ? e(t.body[0]) : t : t.type === "font" ? e(t.body) : t;
46
- }, isCharacterBox = function(e) {
47
- var t = getBaseElem(e);
48
- return t.type === "mathord" || t.type === "textord" || t.type === "atom";
49
- }, assert = function(e) {
50
- if (!e) throw Error("Expected non-null, but got " + String(e));
51
- return e;
52
- }, utils = {
53
- deflt,
54
- escape,
55
- hyphenate,
56
- getBaseElem,
57
- isCharacterBox,
58
- protocolFromUrl: function(e) {
59
- var t = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);
60
- return t ? t[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1]) ? null : t[1].toLowerCase() : "_relative";
61
- }
36
+ }, ESCAPE_REGEX = /[&><"']/g, escape = (e) => String(e).replace(ESCAPE_REGEX, (e) => ESCAPE_LOOKUP[e]), getBaseElem = (e) => e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? getBaseElem(e.body[0]) : e : e.type === "font" ? getBaseElem(e.body) : e, characterNodesTypes = new Set([
37
+ "mathord",
38
+ "textord",
39
+ "atom"
40
+ ]), isCharacterBox = (e) => characterNodesTypes.has(getBaseElem(e).type), protocolFromUrl = (e) => {
41
+ var t = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);
42
+ return t ? t[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1]) ? null : t[1].toLowerCase() : "_relative";
62
43
  }, SETTINGS_SCHEMA = {
63
44
  displayMode: {
64
45
  type: "boolean",
@@ -190,7 +171,7 @@ var Settings = class {
190
171
  }
191
172
  isTrusted(e) {
192
173
  if (e.url && !e.protocol) {
193
- var t = utils.protocolFromUrl(e.url);
174
+ var t = protocolFromUrl(e.url);
194
175
  if (t == null) return !1;
195
176
  e.protocol = t;
196
177
  }
@@ -15276,15 +15257,15 @@ var ptPerUnit = {
15276
15257
  return t;
15277
15258
  }, invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/, toMarkup = function(e) {
15278
15259
  var t = "<" + e;
15279
- this.classes.length && (t += " class=\"" + utils.escape(createClass(this.classes)) + "\"");
15260
+ this.classes.length && (t += " class=\"" + escape(createClass(this.classes)) + "\"");
15280
15261
  var r = "";
15281
- for (var a in this.style) this.style.hasOwnProperty(a) && (r += utils.hyphenate(a) + ":" + this.style[a] + ";");
15282
- for (var o in r && (t += " style=\"" + utils.escape(r) + "\""), this.attributes) if (this.attributes.hasOwnProperty(o)) {
15283
- if (invalidAttributeNameRegex.test(o)) throw new ParseError("Invalid attribute name '" + o + "'");
15284
- t += " " + o + "=\"" + utils.escape(this.attributes[o]) + "\"";
15262
+ for (var o in this.style) this.style.hasOwnProperty(o) && (r += hyphenate(o) + ":" + this.style[o] + ";");
15263
+ for (var s in r && (t += " style=\"" + escape(r) + "\""), this.attributes) if (this.attributes.hasOwnProperty(s)) {
15264
+ if (invalidAttributeNameRegex.test(s)) throw new ParseError("Invalid attribute name '" + s + "'");
15265
+ t += " " + s + "=\"" + escape(this.attributes[s]) + "\"";
15285
15266
  }
15286
15267
  t += ">";
15287
- for (var s = 0; s < this.children.length; s++) t += this.children[s].toMarkup();
15268
+ for (var l = 0; l < this.children.length; l++) t += this.children[l].toMarkup();
15288
15269
  return t += "</" + e + ">", t;
15289
15270
  }, Span = class {
15290
15271
  constructor(e, t, n, r) {
@@ -15331,9 +15312,9 @@ var ptPerUnit = {
15331
15312
  return e;
15332
15313
  }
15333
15314
  toMarkup() {
15334
- var e = "<img src=\"" + utils.escape(this.src) + "\"" + (" alt=\"" + utils.escape(this.alt) + "\""), t = "";
15335
- for (var n in this.style) this.style.hasOwnProperty(n) && (t += utils.hyphenate(n) + ":" + this.style[n] + ";");
15336
- return t && (e += " style=\"" + utils.escape(t) + "\""), e += "'/>", e;
15315
+ var e = "<img src=\"" + escape(this.src) + "\"" + (" alt=\"" + escape(this.alt) + "\""), t = "";
15316
+ for (var n in this.style) this.style.hasOwnProperty(n) && (t += hyphenate(n) + ":" + this.style[n] + ";");
15317
+ return t && (e += " style=\"" + escape(t) + "\""), e += "'/>", e;
15337
15318
  }
15338
15319
  }, iCombinations = {
15339
15320
  î: "ı̂",
@@ -15356,12 +15337,12 @@ var ptPerUnit = {
15356
15337
  }
15357
15338
  toMarkup() {
15358
15339
  var e = !1, t = "<span";
15359
- this.classes.length && (e = !0, t += " class=\"", t += utils.escape(createClass(this.classes)), t += "\"");
15340
+ this.classes.length && (e = !0, t += " class=\"", t += escape(createClass(this.classes)), t += "\"");
15360
15341
  var n = "";
15361
- for (var r in this.italic > 0 && (n += "margin-right:" + this.italic + "em;"), this.style) this.style.hasOwnProperty(r) && (n += utils.hyphenate(r) + ":" + this.style[r] + ";");
15362
- n && (e = !0, t += " style=\"" + utils.escape(n) + "\"");
15363
- var a = utils.escape(this.text);
15364
- return e ? (t += ">", t += a, t += "</span>", t) : a;
15342
+ for (var r in this.italic > 0 && (n += "margin-right:" + this.italic + "em;"), this.style) this.style.hasOwnProperty(r) && (n += hyphenate(r) + ":" + this.style[r] + ";");
15343
+ n && (e = !0, t += " style=\"" + escape(n) + "\"");
15344
+ var o = escape(this.text);
15345
+ return e ? (t += ">", t += o, t += "</span>", t) : o;
15365
15346
  }
15366
15347
  }, SvgNode = class {
15367
15348
  constructor(e, t) {
@@ -15375,7 +15356,7 @@ var ptPerUnit = {
15375
15356
  }
15376
15357
  toMarkup() {
15377
15358
  var e = "<svg xmlns=\"http://www.w3.org/2000/svg\"";
15378
- for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"" + utils.escape(this.attributes[t]) + "\"");
15359
+ for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"" + escape(this.attributes[t]) + "\"");
15379
15360
  e += ">";
15380
15361
  for (var n = 0; n < this.children.length; n++) e += this.children[n].toMarkup();
15381
15362
  return e += "</svg>", e;
@@ -15389,7 +15370,7 @@ var ptPerUnit = {
15389
15370
  return this.alternate ? e.setAttribute("d", this.alternate) : e.setAttribute("d", path[this.pathName]), e;
15390
15371
  }
15391
15372
  toMarkup() {
15392
- return this.alternate ? "<path d=\"" + utils.escape(this.alternate) + "\"/>" : "<path d=\"" + utils.escape(path[this.pathName]) + "\"/>";
15373
+ return this.alternate ? "<path d=\"" + escape(this.alternate) + "\"/>" : "<path d=\"" + escape(path[this.pathName]) + "\"/>";
15393
15374
  }
15394
15375
  }, LineNode = class {
15395
15376
  constructor(e) {
@@ -15402,7 +15383,7 @@ var ptPerUnit = {
15402
15383
  }
15403
15384
  toMarkup() {
15404
15385
  var e = "<line";
15405
- for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"" + utils.escape(this.attributes[t]) + "\"");
15386
+ for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"" + escape(this.attributes[t]) + "\"");
15406
15387
  return e += "/>", e;
15407
15388
  }
15408
15389
  };
@@ -15698,7 +15679,7 @@ var wideLatinLetterData = [
15698
15679
  return makeSymbol(a, _, r, t, o.concat(_, t.fontWeight, t.fontShape));
15699
15680
  } else throw Error("unexpected type: " + n + " in makeOrd");
15700
15681
  }, canCombine = (e, t) => {
15701
- if (createClass(e.classes) !== createClass(t.classes) || e.skew !== t.skew || e.maxFontSize !== t.maxFontSize) return !1;
15682
+ if (createClass(e.classes) !== createClass(t.classes) || e.skew !== t.skew || e.maxFontSize !== t.maxFontSize || e.italic !== 0 && e.hasClass("mathnormal")) return !1;
15702
15683
  if (e.classes.length === 1) {
15703
15684
  var n = e.classes[0];
15704
15685
  if (n === "mbin" || n === "mord") return !1;
@@ -15718,11 +15699,11 @@ var wideLatinLetterData = [
15718
15699
  o.height > t && (t = o.height), o.depth > n && (n = o.depth), o.maxFontSize > r && (r = o.maxFontSize);
15719
15700
  }
15720
15701
  e.height = t, e.depth = n, e.maxFontSize = r;
15721
- }, makeSpan$2 = function(e, t, n, r) {
15702
+ }, makeSpan = function(e, t, n, r) {
15722
15703
  var a = new Span(e, t, n, r);
15723
15704
  return sizeElementFromChildren(a), a;
15724
15705
  }, makeSvgSpan = (e, t, n, r) => new Span(e, t, n, r), makeLineSpan = function(e, t, n) {
15725
- var r = makeSpan$2([e], [], t);
15706
+ var r = makeSpan([e], [], t);
15726
15707
  return r.height = Math.max(n || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), r.style.borderBottomWidth = makeEm(r.height), r.maxFontSize = 1, r;
15727
15708
  }, makeAnchor = function(e, t, n, r) {
15728
15709
  var a = new Anchor(e, t, n, r);
@@ -15731,7 +15712,7 @@ var wideLatinLetterData = [
15731
15712
  var t = new DocumentFragment(e);
15732
15713
  return sizeElementFromChildren(t), t;
15733
15714
  }, wrapFragment = function(e, t) {
15734
- return e instanceof DocumentFragment ? makeSpan$2([], [e], t) : e;
15715
+ return e instanceof DocumentFragment ? makeSpan([], [e], t) : e;
15735
15716
  }, getVListChildrenAndDepth = function(e) {
15736
15717
  if (e.positionType === "individualShift") {
15737
15718
  for (var t = e.children, n = [t[0]], r = -t[0].shift - t[0].elem.depth, a = r, o = 1; o < t.length; o++) {
@@ -15774,28 +15755,28 @@ var wideLatinLetterData = [
15774
15755
  }
15775
15756
  }
15776
15757
  a += 2;
15777
- var l = makeSpan$2(["pstrut"], []);
15758
+ var l = makeSpan(["pstrut"], []);
15778
15759
  l.style.height = makeEm(a);
15779
15760
  for (var u = [], d = r, f = r, p = r, m = 0; m < n.length; m++) {
15780
15761
  var h = n[m];
15781
15762
  if (h.type === "kern") p += h.size;
15782
15763
  else {
15783
- var g = h.elem, _ = h.wrapperClasses || [], v = h.wrapperStyle || {}, y = makeSpan$2(_, [l, g], void 0, v);
15764
+ var g = h.elem, _ = h.wrapperClasses || [], v = h.wrapperStyle || {}, y = makeSpan(_, [l, g], void 0, v);
15784
15765
  y.style.top = makeEm(-a - p - g.depth), h.marginLeft && (y.style.marginLeft = h.marginLeft), h.marginRight && (y.style.marginRight = h.marginRight), u.push(y), p += g.height + g.depth;
15785
15766
  }
15786
15767
  d = Math.min(d, p), f = Math.max(f, p);
15787
15768
  }
15788
- var b = makeSpan$2(["vlist"], u);
15769
+ var b = makeSpan(["vlist"], u);
15789
15770
  b.style.height = makeEm(f);
15790
15771
  var x;
15791
15772
  if (d < 0) {
15792
- var C = makeSpan$2(["vlist"], [makeSpan$2([], [])]);
15793
- C.style.height = makeEm(-d), x = [makeSpan$2(["vlist-r"], [b, makeSpan$2(["vlist-s"], [new SymbolNode("​")])]), makeSpan$2(["vlist-r"], [C])];
15794
- } else x = [makeSpan$2(["vlist-r"], [b])];
15795
- var w = makeSpan$2(["vlist-t"], x);
15773
+ var C = makeSpan(["vlist"], [makeSpan([], [])]);
15774
+ C.style.height = makeEm(-d), x = [makeSpan(["vlist-r"], [b, makeSpan(["vlist-s"], [new SymbolNode("​")])]), makeSpan(["vlist-r"], [C])];
15775
+ } else x = [makeSpan(["vlist-r"], [b])];
15776
+ var w = makeSpan(["vlist-t"], x);
15796
15777
  return x.length === 2 && w.classes.push("vlist-t2"), w.height = f, w.depth = -d, w;
15797
15778
  }, makeGlue = (e, t) => {
15798
- var n = makeSpan$2(["mspace"], [], t), r = calculateSize(e, t);
15779
+ var n = makeSpan(["mspace"], [], t), r = calculateSize(e, t);
15799
15780
  return n.style.marginRight = makeEm(r), n;
15800
15781
  }, retrieveTextFontName = function(e, t, n) {
15801
15782
  var r = "";
@@ -15891,31 +15872,15 @@ var wideLatinLetterData = [
15891
15872
  1.98,
15892
15873
  .659
15893
15874
  ]
15894
- }, buildCommon = {
15895
- fontMap,
15896
- makeSymbol,
15897
- mathsym,
15898
- makeSpan: makeSpan$2,
15899
- makeSvgSpan,
15900
- makeLineSpan,
15901
- makeAnchor,
15902
- makeFragment,
15903
- wrapFragment,
15904
- makeVList,
15905
- makeOrd,
15906
- makeGlue,
15907
- staticSvg: function(e, t) {
15908
- var [n, r, a] = svgData[e], o = makeSvgSpan(["overlay"], [new SvgNode([new PathNode(n)], {
15909
- width: makeEm(r),
15910
- height: makeEm(a),
15911
- style: "width:" + makeEm(r),
15912
- viewBox: "0 0 " + 1e3 * r + " " + 1e3 * a,
15913
- preserveAspectRatio: "xMinYMin"
15914
- })], t);
15915
- return o.height = a, o.style.height = makeEm(a), o.style.width = makeEm(r), o;
15916
- },
15917
- svgData,
15918
- tryCombineChars
15875
+ }, staticSvg = function(e, t) {
15876
+ var [n, r, a] = svgData[e], o = makeSvgSpan(["overlay"], [new SvgNode([new PathNode(n)], {
15877
+ width: makeEm(r),
15878
+ height: makeEm(a),
15879
+ style: "width:" + makeEm(r),
15880
+ viewBox: "0 0 " + 1e3 * r + " " + 1e3 * a,
15881
+ preserveAspectRatio: "xMinYMin"
15882
+ })], t);
15883
+ return o.height = a, o.style.height = makeEm(a), o.style.width = makeEm(r), o;
15919
15884
  }, thinspace = {
15920
15885
  number: 3,
15921
15886
  unit: "mu"
@@ -16020,19 +15985,19 @@ var normalizeArgument = function(e) {
16020
15985
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
16021
15986
  }, ordargument = function(e) {
16022
15987
  return e.type === "ordgroup" ? e.body : [e];
16023
- }, makeSpan$1 = buildCommon.makeSpan, binLeftCanceller = [
15988
+ }, binLeftCanceller = new Set([
16024
15989
  "leftmost",
16025
15990
  "mbin",
16026
15991
  "mopen",
16027
15992
  "mrel",
16028
15993
  "mop",
16029
15994
  "mpunct"
16030
- ], binRightCanceller = [
15995
+ ]), binRightCanceller = new Set([
16031
15996
  "rightmost",
16032
15997
  "mrel",
16033
15998
  "mclose",
16034
15999
  "mpunct"
16035
- ], styleMap$1 = {
16000
+ ]), styleMap$1 = {
16036
16001
  display: Style$1.DISPLAY,
16037
16002
  text: Style$1.TEXT,
16038
16003
  script: Style$1.SCRIPT,
@@ -16055,19 +16020,19 @@ var normalizeArgument = function(e) {
16055
16020
  a.push(...c);
16056
16021
  } else a.push(s);
16057
16022
  }
16058
- if (buildCommon.tryCombineChars(a), !n) return a;
16023
+ if (tryCombineChars(a), !n) return a;
16059
16024
  var l = t;
16060
16025
  if (e.length === 1) {
16061
16026
  var u = e[0];
16062
16027
  u.type === "sizing" ? l = t.havingSize(u.size) : u.type === "styling" && (l = t.havingStyle(styleMap$1[u.style]));
16063
16028
  }
16064
- var d = makeSpan$1([r[0] || "leftmost"], [], t), f = makeSpan$1([r[1] || "rightmost"], [], t), p = n === "root";
16029
+ var d = makeSpan([r[0] || "leftmost"], [], t), f = makeSpan([r[1] || "rightmost"], [], t), p = n === "root";
16065
16030
  return traverseNonSpaceNodes(a, (e, t) => {
16066
16031
  var n = t.classes[0], r = e.classes[0];
16067
- n === "mbin" && binRightCanceller.includes(r) ? t.classes[0] = "mord" : r === "mbin" && binLeftCanceller.includes(n) && (e.classes[0] = "mord");
16032
+ n === "mbin" && binRightCanceller.has(r) ? t.classes[0] = "mord" : r === "mbin" && binLeftCanceller.has(n) && (e.classes[0] = "mord");
16068
16033
  }, { node: d }, f, p), traverseNonSpaceNodes(a, (e, t) => {
16069
16034
  var n = getTypeOfDomTree(t), r = getTypeOfDomTree(e), a = n && r ? e.hasClass("mtight") ? tightSpacings[n][r] : spacings[n][r] : null;
16070
- if (a) return buildCommon.makeGlue(a, l);
16035
+ if (a) return makeGlue(a, l);
16071
16036
  }, { node: d }, f, p), a;
16072
16037
  }, traverseNonSpaceNodes = function e(t, n, r, a, o) {
16073
16038
  a && t.push(a);
@@ -16082,7 +16047,7 @@ var normalizeArgument = function(e) {
16082
16047
  var d = n(c, r.node);
16083
16048
  d && (r.insertAfter ? r.insertAfter(d) : (t.unshift(d), s++));
16084
16049
  }
16085
- u ? r.node = c : o && c.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = ((e) => (n) => {
16050
+ u ? r.node = c : o && c.hasClass("newline") && (r.node = makeSpan(["leftmost"])), r.insertAfter = ((e) => (n) => {
16086
16051
  t.splice(e + 1, 0, n), s++;
16087
16052
  })(s);
16088
16053
  }
@@ -16103,13 +16068,13 @@ var normalizeArgument = function(e) {
16103
16068
  return e ? (t && (e = getOutermostNode(e, t)), DomEnum[e.classes[0]] || null) : null;
16104
16069
  }, makeNullDelimiter = function(e, t) {
16105
16070
  var n = ["nulldelimiter"].concat(e.baseSizingClasses());
16106
- return makeSpan$1(t.concat(n));
16071
+ return makeSpan(t.concat(n));
16107
16072
  }, buildGroup$1 = function(e, t, r) {
16108
- if (!e) return makeSpan$1();
16073
+ if (!e) return makeSpan();
16109
16074
  if (_htmlGroupBuilders[e.type]) {
16110
16075
  var a = _htmlGroupBuilders[e.type](e, t);
16111
16076
  if (r && t.size !== r.size) {
16112
- a = makeSpan$1(t.sizingClasses(r), [a], t);
16077
+ a = makeSpan(t.sizingClasses(r), [a], t);
16113
16078
  var o = t.sizeMultiplier / r.sizeMultiplier;
16114
16079
  a.height *= o, a.depth *= o;
16115
16080
  }
@@ -16117,7 +16082,7 @@ var normalizeArgument = function(e) {
16117
16082
  } else throw new ParseError("Got group of unknown type: '" + e.type + "'");
16118
16083
  };
16119
16084
  function buildHTMLUnbreakable(e, t) {
16120
- var n = makeSpan$1(["base"], e, t), r = makeSpan$1(["strut"]);
16085
+ var n = makeSpan(["base"], e, t), r = makeSpan(["strut"]);
16121
16086
  return r.style.height = makeEm(n.height + n.depth), n.depth && (r.style.verticalAlign = makeEm(-n.depth)), n.children.unshift(r), n;
16122
16087
  }
16123
16088
  function buildHTML(e, t) {
@@ -16132,7 +16097,7 @@ function buildHTML(e, t) {
16132
16097
  s.length > 0 && o.push(buildHTMLUnbreakable(s, t));
16133
16098
  var u;
16134
16099
  n ? (u = buildHTMLUnbreakable(buildExpression$1(n, t, !0)), u.classes = ["tag"], o.push(u)) : a && o.push(a);
16135
- var d = makeSpan$1(["katex-html"], o);
16100
+ var d = makeSpan(["katex-html"], o);
16136
16101
  if (d.setAttribute("aria-hidden", "true"), u) {
16137
16102
  var f = u.children[0];
16138
16103
  f.style.height = makeEm(d.height + d.depth), d.depth && (f.style.verticalAlign = makeEm(-d.depth));
@@ -16164,8 +16129,8 @@ var MathNode = class {
16164
16129
  }
16165
16130
  toMarkup() {
16166
16131
  var e = "<" + this.type;
16167
- for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"", e += utils.escape(this.attributes[t]), e += "\"");
16168
- this.classes.length > 0 && (e += " class =\"" + utils.escape(createClass(this.classes)) + "\""), e += ">";
16132
+ for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + "=\"", e += escape(this.attributes[t]), e += "\"");
16133
+ this.classes.length > 0 && (e += " class =\"" + escape(createClass(this.classes)) + "\""), e += ">";
16169
16134
  for (var n = 0; n < this.children.length; n++) e += this.children[n].toMarkup();
16170
16135
  return e += "</" + this.type + ">", e;
16171
16136
  }
@@ -16180,35 +16145,30 @@ var MathNode = class {
16180
16145
  return document.createTextNode(this.text);
16181
16146
  }
16182
16147
  toMarkup() {
16183
- return utils.escape(this.toText());
16148
+ return escape(this.toText());
16184
16149
  }
16185
16150
  toText() {
16186
16151
  return this.text;
16187
16152
  }
16188
- }, mathMLTree = {
16189
- MathNode,
16190
- TextNode,
16191
- SpaceNode: class {
16192
- constructor(e) {
16193
- this.width = void 0, this.character = void 0, this.width = e, e >= .05555 && e <= .05556 ? this.character = " " : e >= .1666 && e <= .1667 ? this.character = " " : e >= .2222 && e <= .2223 ? this.character = " " : e >= .2777 && e <= .2778 ? this.character = "  " : e >= -.05556 && e <= -.05555 ? this.character = " ⁣" : e >= -.1667 && e <= -.1666 ? this.character = " ⁣" : e >= -.2223 && e <= -.2222 ? this.character = " ⁣" : e >= -.2778 && e <= -.2777 ? this.character = " ⁣" : this.character = null;
16194
- }
16195
- toNode() {
16196
- if (this.character) return document.createTextNode(this.character);
16197
- var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
16198
- return e.setAttribute("width", makeEm(this.width)), e;
16199
- }
16200
- toMarkup() {
16201
- return this.character ? "<mtext>" + this.character + "</mtext>" : "<mspace width=\"" + makeEm(this.width) + "\"/>";
16202
- }
16203
- toText() {
16204
- return this.character ? this.character : " ";
16205
- }
16206
- },
16207
- newDocumentFragment
16208
- }, makeText = function(e, t, n) {
16209
- return symbols[t][e] && symbols[t][e].replace && e.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(e) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (e = symbols[t][e].replace), new mathMLTree.TextNode(e);
16153
+ }, SpaceNode = class {
16154
+ constructor(e) {
16155
+ this.width = void 0, this.character = void 0, this.width = e, e >= .05555 && e <= .05556 ? this.character = " " : e >= .1666 && e <= .1667 ? this.character = " " : e >= .2222 && e <= .2223 ? this.character = " " : e >= .2777 && e <= .2778 ? this.character = "  " : e >= -.05556 && e <= -.05555 ? this.character = " ⁣" : e >= -.1667 && e <= -.1666 ? this.character = " ⁣" : e >= -.2223 && e <= -.2222 ? this.character = " ⁣" : e >= -.2778 && e <= -.2777 ? this.character = " ⁣" : this.character = null;
16156
+ }
16157
+ toNode() {
16158
+ if (this.character) return document.createTextNode(this.character);
16159
+ var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
16160
+ return e.setAttribute("width", makeEm(this.width)), e;
16161
+ }
16162
+ toMarkup() {
16163
+ return this.character ? "<mtext>" + this.character + "</mtext>" : "<mspace width=\"" + makeEm(this.width) + "\"/>";
16164
+ }
16165
+ toText() {
16166
+ return this.character ? this.character : " ";
16167
+ }
16168
+ }, noVariantSymbols = new Set(["\\imath", "\\jmath"]), rowLikeTypes = new Set(["mrow", "mtable"]), makeText = function(e, t, n) {
16169
+ return symbols[t][e] && symbols[t][e].replace && e.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(e) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (e = symbols[t][e].replace), new TextNode(e);
16210
16170
  }, makeRow = function(e) {
16211
- return e.length === 1 ? e[0] : new mathMLTree.MathNode("mrow", e);
16171
+ return e.length === 1 ? e[0] : new MathNode("mrow", e);
16212
16172
  }, getVariant = function(e, t) {
16213
16173
  if (t.fontFamily === "texttt") return "monospace";
16214
16174
  if (t.fontFamily === "textsf") return t.fontShape === "textit" && t.fontWeight === "textbf" ? "sans-serif-bold-italic" : t.fontShape === "textit" ? "sans-serif-italic" : t.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
@@ -16228,10 +16188,10 @@ var MathNode = class {
16228
16188
  if (n === "mathsf") return "sans-serif";
16229
16189
  if (n === "mathtt") return "monospace";
16230
16190
  var a = e.text;
16231
- if (["\\imath", "\\jmath"].includes(a)) return null;
16191
+ if (noVariantSymbols.has(a)) return null;
16232
16192
  symbols[r][a] && symbols[r][a].replace && (a = symbols[r][a].replace);
16233
- var o = buildCommon.fontMap[n].fontName;
16234
- return getCharacterMetrics(a, o, r) ? buildCommon.fontMap[n].variant : null;
16193
+ var o = fontMap[n].fontName;
16194
+ return getCharacterMetrics(a, o, r) ? fontMap[n].variant : null;
16235
16195
  };
16236
16196
  function isNumberPunctuation(e) {
16237
16197
  if (!e) return !1;
@@ -16278,17 +16238,15 @@ var buildExpression = function(e, t, n) {
16278
16238
  }, buildExpressionRow = function(e, t, n) {
16279
16239
  return makeRow(buildExpression(e, t, n));
16280
16240
  }, buildGroup = function(e, t) {
16281
- if (!e) return new mathMLTree.MathNode("mrow");
16241
+ if (!e) return new MathNode("mrow");
16282
16242
  if (_mathmlGroupBuilders[e.type]) return _mathmlGroupBuilders[e.type](e, t);
16283
16243
  throw new ParseError("Got group of unknown type: '" + e.type + "'");
16284
16244
  };
16285
16245
  function buildMathML(e, t, n, r, a) {
16286
- var o = buildExpression(e, n), s = o.length === 1 && o[0] instanceof MathNode && ["mrow", "mtable"].includes(o[0].type) ? o[0] : new mathMLTree.MathNode("mrow", o), c = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(t)]);
16246
+ var o = buildExpression(e, n), s = o.length === 1 && o[0] instanceof MathNode && rowLikeTypes.has(o[0].type) ? o[0] : new MathNode("mrow", o), c = new MathNode("annotation", [new TextNode(t)]);
16287
16247
  c.setAttribute("encoding", "application/x-tex");
16288
- var l = new mathMLTree.MathNode("semantics", [s, c]), u = new mathMLTree.MathNode("math", [l]);
16289
- u.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && u.setAttribute("display", "block");
16290
- var d = a ? "katex" : "katex-mathml";
16291
- return buildCommon.makeSpan([d], [u]);
16248
+ var l = new MathNode("math", [new MathNode("semantics", [s, c])]);
16249
+ return l.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && l.setAttribute("display", "block"), makeSpan([a ? "katex" : "katex-mathml"], [l]);
16292
16250
  }
16293
16251
  var optionsFromSettings = function(e) {
16294
16252
  return new Options({
@@ -16299,23 +16257,14 @@ var optionsFromSettings = function(e) {
16299
16257
  }, displayWrap = function(e, t) {
16300
16258
  if (t.displayMode) {
16301
16259
  var n = ["katex-display"];
16302
- t.leqno && n.push("leqno"), t.fleqn && n.push("fleqn"), e = buildCommon.makeSpan(n, [e]);
16260
+ t.leqno && n.push("leqno"), t.fleqn && n.push("fleqn"), e = makeSpan(n, [e]);
16303
16261
  }
16304
16262
  return e;
16305
16263
  }, buildTree = function(e, t, n) {
16306
16264
  var r = optionsFromSettings(n), a;
16307
- if (n.output === "mathml") return buildMathML(e, t, r, n.displayMode, !0);
16308
- if (n.output === "html") {
16309
- var o = buildHTML(e, r);
16310
- a = buildCommon.makeSpan(["katex"], [o]);
16311
- } else {
16312
- var s = buildMathML(e, t, r, n.displayMode, !1), c = buildHTML(e, r);
16313
- a = buildCommon.makeSpan(["katex"], [s, c]);
16314
- }
16315
- return displayWrap(a, n);
16265
+ return n.output === "mathml" ? buildMathML(e, t, r, n.displayMode, !0) : (a = n.output === "html" ? makeSpan(["katex"], [buildHTML(e, r)]) : makeSpan(["katex"], [buildMathML(e, t, r, n.displayMode, !1), buildHTML(e, r)]), displayWrap(a, n));
16316
16266
  }, buildHTMLTree = function(e, t, n) {
16317
- var r = buildHTML(e, optionsFromSettings(n));
16318
- return displayWrap(buildCommon.makeSpan(["katex"], [r]), n);
16267
+ return displayWrap(makeSpan(["katex"], [buildHTML(e, optionsFromSettings(n))]), n);
16319
16268
  }, stretchyCodePoint = {
16320
16269
  widehat: "^",
16321
16270
  widecheck: "ˇ",
@@ -16359,8 +16308,8 @@ var optionsFromSettings = function(e) {
16359
16308
  "\\cdrightarrow": "→",
16360
16309
  "\\cdleftarrow": "←",
16361
16310
  "\\cdlongequal": "="
16362
- }, mathMLnode = function(e) {
16363
- var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[e.replace(/^\\/, "")])]);
16311
+ }, stretchyMathML = function(e) {
16312
+ var t = new MathNode("mo", [new TextNode(stretchyCodePoint[e.replace(/^\\/, "")])]);
16364
16313
  return t.setAttribute("stretchy", "true"), t;
16365
16314
  }, katexImagesData = {
16366
16315
  overrightarrow: [
@@ -16592,151 +16541,142 @@ var optionsFromSettings = function(e) {
16592
16541
  1.75,
16593
16542
  716
16594
16543
  ]
16595
- }, groupLength = function(e) {
16596
- return e.type === "ordgroup" ? e.body.length : 1;
16597
- }, stretchy = {
16598
- encloseSpan: function(e, t, n, r, a) {
16599
- var o, s = e.height + e.depth + n + r;
16600
- if (/fbox|color|angl/.test(t)) {
16601
- if (o = buildCommon.makeSpan(["stretchy", t], [], a), t === "fbox") {
16602
- var c = a.color && a.getColor();
16603
- c && (o.style.borderColor = c);
16544
+ }, wideAccentLabels = new Set([
16545
+ "widehat",
16546
+ "widecheck",
16547
+ "widetilde",
16548
+ "utilde"
16549
+ ]), stretchySvg = function(e, t) {
16550
+ function n() {
16551
+ var n = 4e5, r = e.label.slice(1);
16552
+ if (wideAccentLabels.has(r)) {
16553
+ var a = e, o = a.base.type === "ordgroup" ? a.base.body.length : 1, s, c, l;
16554
+ if (o > 5) r === "widehat" || r === "widecheck" ? (s = 420, n = 2364, l = .42, c = r + "4") : (s = 312, n = 2340, l = .34, c = "tilde4");
16555
+ else {
16556
+ var u = [
16557
+ 1,
16558
+ 1,
16559
+ 2,
16560
+ 2,
16561
+ 3,
16562
+ 3
16563
+ ][o];
16564
+ r === "widehat" || r === "widecheck" ? (n = [
16565
+ 0,
16566
+ 1062,
16567
+ 2364,
16568
+ 2364,
16569
+ 2364
16570
+ ][u], s = [
16571
+ 0,
16572
+ 239,
16573
+ 300,
16574
+ 360,
16575
+ 420
16576
+ ][u], l = [
16577
+ 0,
16578
+ .24,
16579
+ .3,
16580
+ .3,
16581
+ .36,
16582
+ .42
16583
+ ][u], c = r + u) : (n = [
16584
+ 0,
16585
+ 600,
16586
+ 1033,
16587
+ 2339,
16588
+ 2340
16589
+ ][u], s = [
16590
+ 0,
16591
+ 260,
16592
+ 286,
16593
+ 306,
16594
+ 312
16595
+ ][u], l = [
16596
+ 0,
16597
+ .26,
16598
+ .286,
16599
+ .3,
16600
+ .306,
16601
+ .34
16602
+ ][u], c = "tilde" + u);
16604
16603
  }
16605
- } else {
16606
- var l = [];
16607
- /^[bx]cancel$/.test(t) && l.push(new LineNode({
16608
- x1: "0",
16609
- y1: "0",
16610
- x2: "100%",
16611
- y2: "100%",
16612
- "stroke-width": "0.046em"
16613
- })), /^x?cancel$/.test(t) && l.push(new LineNode({
16614
- x1: "0",
16615
- y1: "100%",
16616
- x2: "100%",
16617
- y2: "0",
16618
- "stroke-width": "0.046em"
16619
- }));
16620
- var u = new SvgNode(l, {
16621
- width: "100%",
16622
- height: makeEm(s)
16623
- });
16624
- o = buildCommon.makeSvgSpan([], [u], a);
16625
- }
16626
- return o.height = s, o.style.height = makeEm(s), o;
16627
- },
16628
- mathMLnode,
16629
- svgSpan: function(e, t) {
16630
- function n() {
16631
- var n = 4e5, r = e.label.slice(1);
16632
- if ([
16633
- "widehat",
16634
- "widecheck",
16635
- "widetilde",
16636
- "utilde"
16637
- ].includes(r)) {
16638
- var a = groupLength(e.base), o, s, c;
16639
- if (a > 5) r === "widehat" || r === "widecheck" ? (o = 420, n = 2364, c = .42, s = r + "4") : (o = 312, n = 2340, c = .34, s = "tilde4");
16640
- else {
16641
- var l = [
16642
- 1,
16643
- 1,
16644
- 2,
16645
- 2,
16646
- 3,
16647
- 3
16648
- ][a];
16649
- r === "widehat" || r === "widecheck" ? (n = [
16650
- 0,
16651
- 1062,
16652
- 2364,
16653
- 2364,
16654
- 2364
16655
- ][l], o = [
16656
- 0,
16657
- 239,
16658
- 300,
16659
- 360,
16660
- 420
16661
- ][l], c = [
16662
- 0,
16663
- .24,
16664
- .3,
16665
- .3,
16666
- .36,
16667
- .42
16668
- ][l], s = r + l) : (n = [
16669
- 0,
16670
- 600,
16671
- 1033,
16672
- 2339,
16673
- 2340
16674
- ][l], o = [
16675
- 0,
16676
- 260,
16677
- 286,
16678
- 306,
16679
- 312
16680
- ][l], c = [
16681
- 0,
16682
- .26,
16683
- .286,
16684
- .3,
16685
- .306,
16686
- .34
16687
- ][l], s = "tilde" + l);
16688
- }
16689
- var u = new SvgNode([new PathNode(s)], {
16604
+ return {
16605
+ span: makeSvgSpan([], [new SvgNode([new PathNode(c)], {
16690
16606
  width: "100%",
16691
- height: makeEm(c),
16692
- viewBox: "0 0 " + n + " " + o,
16607
+ height: makeEm(l),
16608
+ viewBox: "0 0 " + n + " " + s,
16693
16609
  preserveAspectRatio: "none"
16694
- });
16695
- return {
16696
- span: buildCommon.makeSvgSpan([], [u], t),
16697
- minWidth: 0,
16698
- height: c
16699
- };
16700
- } else {
16701
- var d = [], f = katexImagesData[r], [p, m, h] = f, g = h / 1e3, _ = p.length, v, y;
16702
- if (_ === 1) {
16703
- var b = f[3];
16704
- v = ["hide-tail"], y = [b];
16705
- } else if (_ === 2) v = ["halfarrow-left", "halfarrow-right"], y = ["xMinYMin", "xMaxYMin"];
16706
- else if (_ === 3) v = [
16707
- "brace-left",
16708
- "brace-center",
16709
- "brace-right"
16710
- ], y = [
16711
- "xMinYMin",
16712
- "xMidYMin",
16713
- "xMaxYMin"
16714
- ];
16715
- else throw Error("Correct katexImagesData or update code here to support\n " + _ + " children.");
16716
- for (var x = 0; x < _; x++) {
16717
- var C = new SvgNode([new PathNode(p[x])], {
16718
- width: "400em",
16719
- height: makeEm(g),
16720
- viewBox: "0 0 " + n + " " + h,
16721
- preserveAspectRatio: y[x] + " slice"
16722
- }), w = buildCommon.makeSvgSpan([v[x]], [C], t);
16723
- if (_ === 1) return {
16724
- span: w,
16725
- minWidth: m,
16726
- height: g
16727
- };
16728
- w.style.height = makeEm(g), d.push(w);
16729
- }
16730
- return {
16731
- span: buildCommon.makeSpan(["stretchy"], d, t),
16610
+ })], t),
16611
+ minWidth: 0,
16612
+ height: l
16613
+ };
16614
+ } else {
16615
+ var d = [], f = katexImagesData[r], [p, m, h] = f, g = h / 1e3, _ = p.length, v, y;
16616
+ if (_ === 1) {
16617
+ var b = f[3];
16618
+ v = ["hide-tail"], y = [b];
16619
+ } else if (_ === 2) v = ["halfarrow-left", "halfarrow-right"], y = ["xMinYMin", "xMaxYMin"];
16620
+ else if (_ === 3) v = [
16621
+ "brace-left",
16622
+ "brace-center",
16623
+ "brace-right"
16624
+ ], y = [
16625
+ "xMinYMin",
16626
+ "xMidYMin",
16627
+ "xMaxYMin"
16628
+ ];
16629
+ else throw Error("Correct katexImagesData or update code here to support\n " + _ + " children.");
16630
+ for (var x = 0; x < _; x++) {
16631
+ var C = new SvgNode([new PathNode(p[x])], {
16632
+ width: "400em",
16633
+ height: makeEm(g),
16634
+ viewBox: "0 0 " + n + " " + h,
16635
+ preserveAspectRatio: y[x] + " slice"
16636
+ }), w = makeSvgSpan([v[x]], [C], t);
16637
+ if (_ === 1) return {
16638
+ span: w,
16732
16639
  minWidth: m,
16733
16640
  height: g
16734
16641
  };
16642
+ w.style.height = makeEm(g), d.push(w);
16735
16643
  }
16644
+ return {
16645
+ span: makeSpan(["stretchy"], d, t),
16646
+ minWidth: m,
16647
+ height: g
16648
+ };
16736
16649
  }
16737
- var { span: r, minWidth: a, height: o } = n();
16738
- return r.height = o, r.style.height = makeEm(o), a > 0 && (r.style.minWidth = makeEm(a)), r;
16739
16650
  }
16651
+ var { span: r, minWidth: a, height: o } = n();
16652
+ return r.height = o, r.style.height = makeEm(o), a > 0 && (r.style.minWidth = makeEm(a)), r;
16653
+ }, stretchyEnclose = function(e, t, n, r, a) {
16654
+ var o, s = e.height + e.depth + n + r;
16655
+ if (/fbox|color|angl/.test(t)) {
16656
+ if (o = makeSpan(["stretchy", t], [], a), t === "fbox") {
16657
+ var c = a.color && a.getColor();
16658
+ c && (o.style.borderColor = c);
16659
+ }
16660
+ } else {
16661
+ var l = [];
16662
+ /^[bx]cancel$/.test(t) && l.push(new LineNode({
16663
+ x1: "0",
16664
+ y1: "0",
16665
+ x2: "100%",
16666
+ y2: "100%",
16667
+ "stroke-width": "0.046em"
16668
+ })), /^x?cancel$/.test(t) && l.push(new LineNode({
16669
+ x1: "0",
16670
+ y1: "100%",
16671
+ x2: "100%",
16672
+ y2: "0",
16673
+ "stroke-width": "0.046em"
16674
+ })), o = makeSvgSpan([], [new SvgNode(l, {
16675
+ width: "100%",
16676
+ height: makeEm(s)
16677
+ })], a);
16678
+ }
16679
+ return o.height = s, o.style.height = makeEm(s), o;
16740
16680
  };
16741
16681
  function assertNodeType(e, t) {
16742
16682
  if (!e || e.type !== t) throw Error("Expected node of type " + t + ", but got " + (e ? "node of type " + e.type : String(e)));
@@ -16753,34 +16693,34 @@ function checkSymbolNodeType(e) {
16753
16693
  var htmlBuilder$a = (e, t) => {
16754
16694
  var n, r, a;
16755
16695
  e && e.type === "supsub" ? (r = assertNodeType(e.base, "accent"), n = r.base, e.base = n, a = assertSpan(buildGroup$1(e, t)), e.base = r) : (r = assertNodeType(e, "accent"), n = r.base);
16756
- var o = buildGroup$1(n, t.havingCrampedStyle()), s = r.isShifty && utils.isCharacterBox(n), c = 0;
16757
- s && (c = assertSymbolDomNode(buildGroup$1(utils.getBaseElem(n), t.havingCrampedStyle())).skew);
16758
- var l = r.label === "\\c", u = l ? o.height + o.depth : Math.min(o.height, t.fontMetrics().xHeight), d;
16759
- if (r.isStretchy) d = stretchy.svgSpan(r, t), d = buildCommon.makeVList({
16696
+ var o = buildGroup$1(n, t.havingCrampedStyle()), s = r.isShifty && isCharacterBox(n), c = 0;
16697
+ s && (c = assertSymbolDomNode(buildGroup$1(getBaseElem(n), t.havingCrampedStyle())).skew);
16698
+ var u = r.label === "\\c", f = u ? o.height + o.depth : Math.min(o.height, t.fontMetrics().xHeight), p;
16699
+ if (r.isStretchy) p = stretchySvg(r, t), p = makeVList({
16760
16700
  positionType: "firstBaseline",
16761
16701
  children: [{
16762
16702
  type: "elem",
16763
16703
  elem: o
16764
16704
  }, {
16765
16705
  type: "elem",
16766
- elem: d,
16706
+ elem: p,
16767
16707
  wrapperClasses: ["svg-align"],
16768
16708
  wrapperStyle: c > 0 ? {
16769
16709
  width: "calc(100% - " + makeEm(2 * c) + ")",
16770
16710
  marginLeft: makeEm(2 * c)
16771
16711
  } : void 0
16772
16712
  }]
16773
- }, t);
16713
+ });
16774
16714
  else {
16775
- var f, m;
16776
- r.label === "\\vec" ? (f = buildCommon.staticSvg("vec", t), m = buildCommon.svgData.vec[1]) : (f = buildCommon.makeOrd({
16715
+ var m, h;
16716
+ r.label === "\\vec" ? (m = staticSvg("vec", t), h = svgData.vec[1]) : (m = makeOrd({
16777
16717
  mode: r.mode,
16778
16718
  text: r.label
16779
- }, t, "textord"), f = assertSymbolDomNode(f), f.italic = 0, m = f.width, l && (u += f.depth)), d = buildCommon.makeSpan(["accent-body"], [f]);
16780
- var h = r.label === "\\textcircled";
16781
- h && (d.classes.push("accent-full"), u = o.height);
16782
- var g = c;
16783
- h || (g -= m / 2), d.style.left = makeEm(g), r.label === "\\textcircled" && (d.style.top = ".2em"), d = buildCommon.makeVList({
16719
+ }, t, "textord"), m = assertSymbolDomNode(m), m.italic = 0, h = m.width, u && (f += m.depth)), p = makeSpan(["accent-body"], [m]);
16720
+ var g = r.label === "\\textcircled";
16721
+ g && (p.classes.push("accent-full"), f = o.height);
16722
+ var _ = c;
16723
+ g || (_ -= h / 2), p.style.left = makeEm(_), r.label === "\\textcircled" && (p.style.top = ".2em"), p = makeVList({
16784
16724
  positionType: "firstBaseline",
16785
16725
  children: [
16786
16726
  {
@@ -16789,19 +16729,19 @@ var htmlBuilder$a = (e, t) => {
16789
16729
  },
16790
16730
  {
16791
16731
  type: "kern",
16792
- size: -u
16732
+ size: -f
16793
16733
  },
16794
16734
  {
16795
16735
  type: "elem",
16796
- elem: d
16736
+ elem: p
16797
16737
  }
16798
16738
  ]
16799
- }, t);
16739
+ });
16800
16740
  }
16801
- var _ = buildCommon.makeSpan(["mord", "accent"], [d], t);
16802
- return a ? (a.children[0] = _, a.height = Math.max(_.height, a.height), a.classes[0] = "mord", a) : _;
16741
+ var v = makeSpan(["mord", "accent"], [p], t);
16742
+ return a ? (a.children[0] = v, a.height = Math.max(v.height, a.height), a.classes[0] = "mord", a) : v;
16803
16743
  }, mathmlBuilder$9 = (e, t) => {
16804
- var n = e.isStretchy ? stretchy.mathMLnode(e.label) : new mathMLTree.MathNode("mo", [makeText(e.label, e.mode)]), r = new mathMLTree.MathNode("mover", [buildGroup(e.base, t), n]);
16744
+ var n = e.isStretchy ? stretchyMathML(e.label) : new MathNode("mo", [makeText(e.label, e.mode)]), r = new MathNode("mover", [buildGroup(e.base, t), n]);
16805
16745
  return r.setAttribute("accent", "true"), r;
16806
16746
  }, NON_STRETCHY_ACCENT_REGEX = new RegExp([
16807
16747
  "\\acute",
@@ -16913,7 +16853,8 @@ defineFunction({
16913
16853
  };
16914
16854
  },
16915
16855
  htmlBuilder: (e, t) => {
16916
- var n = buildGroup$1(e.base, t), r = stretchy.svgSpan(e, t), a = e.label === "\\utilde" ? .12 : 0, o = buildCommon.makeVList({
16856
+ var n = buildGroup$1(e.base, t), r = stretchySvg(e, t), a = e.label === "\\utilde" ? .12 : 0;
16857
+ return makeSpan(["mord", "accentunder"], [makeVList({
16917
16858
  positionType: "top",
16918
16859
  positionData: n.height,
16919
16860
  children: [
@@ -16931,16 +16872,15 @@ defineFunction({
16931
16872
  elem: n
16932
16873
  }
16933
16874
  ]
16934
- }, t);
16935
- return buildCommon.makeSpan(["mord", "accentunder"], [o], t);
16875
+ })], t);
16936
16876
  },
16937
16877
  mathmlBuilder: (e, t) => {
16938
- var n = stretchy.mathMLnode(e.label), r = new mathMLTree.MathNode("munder", [buildGroup(e.base, t), n]);
16878
+ var n = stretchyMathML(e.label), r = new MathNode("munder", [buildGroup(e.base, t), n]);
16939
16879
  return r.setAttribute("accentunder", "true"), r;
16940
16880
  }
16941
16881
  });
16942
16882
  var paddedNode = (e) => {
16943
- var t = new mathMLTree.MathNode("mpadded", e ? [e] : []);
16883
+ var t = new MathNode("mpadded", e ? [e] : []);
16944
16884
  return t.setAttribute("width", "+0.6em"), t.setAttribute("lspace", "0.3em"), t;
16945
16885
  };
16946
16886
  defineFunction({
@@ -16987,16 +16927,16 @@ defineFunction({
16987
16927
  };
16988
16928
  },
16989
16929
  htmlBuilder(e, t) {
16990
- var n = t.style, r = t.havingStyle(n.sup()), a = buildCommon.wrapFragment(buildGroup$1(e.body, r, t), t), o = e.label.slice(0, 2) === "\\x" ? "x" : "cd";
16930
+ var n = t.style, r = t.havingStyle(n.sup()), a = wrapFragment(buildGroup$1(e.body, r, t), t), o = e.label.slice(0, 2) === "\\x" ? "x" : "cd";
16991
16931
  a.classes.push(o + "-arrow-pad");
16992
16932
  var s;
16993
- e.below && (r = t.havingStyle(n.sub()), s = buildCommon.wrapFragment(buildGroup$1(e.below, r, t), t), s.classes.push(o + "-arrow-pad"));
16994
- var c = stretchy.svgSpan(e, t), l = -t.fontMetrics().axisHeight + .5 * c.height, u = -t.fontMetrics().axisHeight - .5 * c.height - .111;
16933
+ e.below && (r = t.havingStyle(n.sub()), s = wrapFragment(buildGroup$1(e.below, r, t), t), s.classes.push(o + "-arrow-pad"));
16934
+ var c = stretchySvg(e, t), l = -t.fontMetrics().axisHeight + .5 * c.height, u = -t.fontMetrics().axisHeight - .5 * c.height - .111;
16995
16935
  (a.depth > .25 || e.label === "\\xleftequilibrium") && (u -= a.depth);
16996
16936
  var d;
16997
16937
  if (s) {
16998
16938
  var f = -t.fontMetrics().axisHeight + s.height + .5 * c.height + .111;
16999
- d = buildCommon.makeVList({
16939
+ d = makeVList({
17000
16940
  positionType: "individualShift",
17001
16941
  children: [
17002
16942
  {
@@ -17015,8 +16955,8 @@ defineFunction({
17015
16955
  shift: f
17016
16956
  }
17017
16957
  ]
17018
- }, t);
17019
- } else d = buildCommon.makeVList({
16958
+ });
16959
+ } else d = makeVList({
17020
16960
  positionType: "individualShift",
17021
16961
  children: [{
17022
16962
  type: "elem",
@@ -17027,38 +16967,31 @@ defineFunction({
17027
16967
  elem: c,
17028
16968
  shift: l
17029
16969
  }]
17030
- }, t);
17031
- return d.children[0].children[0].children[1].classes.push("svg-align"), buildCommon.makeSpan(["mrel", "x-arrow"], [d], t);
16970
+ });
16971
+ return d.children[0].children[0].children[1].classes.push("svg-align"), makeSpan(["mrel", "x-arrow"], [d], t);
17032
16972
  },
17033
16973
  mathmlBuilder(e, t) {
17034
- var n = stretchy.mathMLnode(e.label);
16974
+ var n = stretchyMathML(e.label);
17035
16975
  n.setAttribute("minsize", e.label.charAt(0) === "x" ? "1.75em" : "3.0em");
17036
16976
  var r;
17037
16977
  if (e.body) {
17038
16978
  var a = paddedNode(buildGroup(e.body, t));
17039
- if (e.below) {
17040
- var o = paddedNode(buildGroup(e.below, t));
17041
- r = new mathMLTree.MathNode("munderover", [
17042
- n,
17043
- o,
17044
- a
17045
- ]);
17046
- } else r = new mathMLTree.MathNode("mover", [n, a]);
17047
- } else if (e.below) {
17048
- var s = paddedNode(buildGroup(e.below, t));
17049
- r = new mathMLTree.MathNode("munder", [n, s]);
17050
- } else r = paddedNode(), r = new mathMLTree.MathNode("mover", [n, r]);
16979
+ r = e.below ? new MathNode("munderover", [
16980
+ n,
16981
+ paddedNode(buildGroup(e.below, t)),
16982
+ a
16983
+ ]) : new MathNode("mover", [n, a]);
16984
+ } else e.below ? r = new MathNode("munder", [n, paddedNode(buildGroup(e.below, t))]) : (r = paddedNode(), r = new MathNode("mover", [n, r]));
17051
16985
  return r;
17052
16986
  }
17053
16987
  });
17054
- var makeSpan = buildCommon.makeSpan;
17055
16988
  function htmlBuilder$9(e, t) {
17056
16989
  var n = buildExpression$1(e.body, t, !0);
17057
16990
  return makeSpan([e.mclass], n, t);
17058
16991
  }
17059
16992
  function mathmlBuilder$8(e, t) {
17060
16993
  var n, r = buildExpression(e.body, t);
17061
- return e.mclass === "minner" ? n = new mathMLTree.MathNode("mpadded", r) : e.mclass === "mord" ? e.isCharacterBox ? (n = r[0], n.type = "mi") : n = new mathMLTree.MathNode("mi", r) : (e.isCharacterBox ? (n = r[0], n.type = "mo") : n = new mathMLTree.MathNode("mo", r), e.mclass === "mbin" ? (n.attributes.lspace = "0.22em", n.attributes.rspace = "0.22em") : e.mclass === "mpunct" ? (n.attributes.lspace = "0em", n.attributes.rspace = "0.17em") : e.mclass === "mopen" || e.mclass === "mclose" ? (n.attributes.lspace = "0em", n.attributes.rspace = "0em") : e.mclass === "minner" && (n.attributes.lspace = "0.0556em", n.attributes.width = "+0.1111em")), n;
16994
+ return e.mclass === "minner" ? n = new MathNode("mpadded", r) : e.mclass === "mord" ? e.isCharacterBox ? (n = r[0], n.type = "mi") : n = new MathNode("mi", r) : (e.isCharacterBox ? (n = r[0], n.type = "mo") : n = new MathNode("mo", r), e.mclass === "mbin" ? (n.attributes.lspace = "0.22em", n.attributes.rspace = "0.22em") : e.mclass === "mpunct" ? (n.attributes.lspace = "0em", n.attributes.rspace = "0.17em") : e.mclass === "mopen" || e.mclass === "mclose" ? (n.attributes.lspace = "0em", n.attributes.rspace = "0em") : e.mclass === "minner" && (n.attributes.lspace = "0.0556em", n.attributes.width = "+0.1111em")), n;
17062
16995
  }
17063
16996
  defineFunction({
17064
16997
  type: "mclass",
@@ -17082,7 +17015,7 @@ defineFunction({
17082
17015
  mode: n.mode,
17083
17016
  mclass: "m" + r.slice(5),
17084
17017
  body: ordargument(a),
17085
- isCharacterBox: utils.isCharacterBox(a)
17018
+ isCharacterBox: isCharacterBox(a)
17086
17019
  };
17087
17020
  },
17088
17021
  htmlBuilder: htmlBuilder$9,
@@ -17103,7 +17036,7 @@ defineFunction({
17103
17036
  mode: n.mode,
17104
17037
  mclass: binrelClass(t[0]),
17105
17038
  body: ordargument(t[1]),
17106
- isCharacterBox: utils.isCharacterBox(t[1])
17039
+ isCharacterBox: isCharacterBox(t[1])
17107
17040
  };
17108
17041
  }
17109
17042
  }), defineFunction({
@@ -17136,7 +17069,7 @@ defineFunction({
17136
17069
  mode: n.mode,
17137
17070
  mclass: s,
17138
17071
  body: [l],
17139
- isCharacterBox: utils.isCharacterBox(l)
17072
+ isCharacterBox: isCharacterBox(l)
17140
17073
  };
17141
17074
  },
17142
17075
  htmlBuilder: htmlBuilder$9,
@@ -17158,12 +17091,12 @@ defineFunction({
17158
17091
  };
17159
17092
  },
17160
17093
  htmlBuilder(e, t) {
17161
- var n = buildExpression$1(e.body, t, !0), r = buildCommon.makeSpan([e.mclass], n, t);
17094
+ var n = buildExpression$1(e.body, t, !0), r = makeSpan([e.mclass], n, t);
17162
17095
  return r.style.textShadow = "0.02em 0.01em 0.04px", r;
17163
17096
  },
17164
17097
  mathmlBuilder(e, t) {
17165
- var n = buildExpression(e.body, t), r = new mathMLTree.MathNode("mstyle", n);
17166
- return r.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), r;
17098
+ var n = new MathNode("mstyle", buildExpression(e.body, t));
17099
+ return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n;
17167
17100
  }
17168
17101
  });
17169
17102
  var cdArrowFunctionName = {
@@ -17239,7 +17172,7 @@ function parseCD(e) {
17239
17172
  type: "ordgroup",
17240
17173
  mode: "math",
17241
17174
  body: []
17242
- }, !("=|.".indexOf(d) > -1)) if ("<>AV".indexOf(d) > -1) for (var p = 0; p < 2; p++) {
17175
+ }, !"=|.".includes(d)) if ("<>AV".includes(d)) for (var p = 0; p < 2; p++) {
17243
17176
  for (var m = !0, h = u + 1; h < c.length; h++) {
17244
17177
  if (isLabelEnd(c[h], d)) {
17245
17178
  m = !1, u = h;
@@ -17292,12 +17225,12 @@ defineFunction({
17292
17225
  };
17293
17226
  },
17294
17227
  htmlBuilder(e, t) {
17295
- var n = t.havingStyle(t.style.sup()), r = buildCommon.wrapFragment(buildGroup$1(e.label, n, t), t);
17228
+ var n = t.havingStyle(t.style.sup()), r = wrapFragment(buildGroup$1(e.label, n, t), t);
17296
17229
  return r.classes.push("cd-label-" + e.side), r.style.bottom = makeEm(.8 - r.depth), r.height = 0, r.depth = 0, r;
17297
17230
  },
17298
17231
  mathmlBuilder(e, t) {
17299
- var n = new mathMLTree.MathNode("mrow", [buildGroup(e.label, t)]);
17300
- return n = new mathMLTree.MathNode("mpadded", [n]), n.setAttribute("width", "0"), e.side === "left" && n.setAttribute("lspace", "-1width"), n.setAttribute("voffset", "0.7em"), n = new mathMLTree.MathNode("mstyle", [n]), n.setAttribute("displaystyle", "false"), n.setAttribute("scriptlevel", "1"), n;
17232
+ var n = new MathNode("mrow", [buildGroup(e.label, t)]);
17233
+ return n = new MathNode("mpadded", [n]), n.setAttribute("width", "0"), e.side === "left" && n.setAttribute("lspace", "-1width"), n.setAttribute("voffset", "0.7em"), n = new MathNode("mstyle", [n]), n.setAttribute("displaystyle", "false"), n.setAttribute("scriptlevel", "1"), n;
17301
17234
  }
17302
17235
  }), defineFunction({
17303
17236
  type: "cdlabelparent",
@@ -17312,11 +17245,11 @@ defineFunction({
17312
17245
  };
17313
17246
  },
17314
17247
  htmlBuilder(e, t) {
17315
- var n = buildCommon.wrapFragment(buildGroup$1(e.fragment, t), t);
17248
+ var n = wrapFragment(buildGroup$1(e.fragment, t), t);
17316
17249
  return n.classes.push("cd-vert-arrow"), n;
17317
17250
  },
17318
17251
  mathmlBuilder(e, t) {
17319
- return new mathMLTree.MathNode("mrow", [buildGroup(e.fragment, t)]);
17252
+ return new MathNode("mrow", [buildGroup(e.fragment, t)]);
17320
17253
  }
17321
17254
  }), defineFunction({
17322
17255
  type: "textord",
@@ -17340,12 +17273,9 @@ defineFunction({
17340
17273
  };
17341
17274
  }
17342
17275
  });
17343
- var htmlBuilder$8 = (e, t) => {
17344
- var n = buildExpression$1(e.body, t.withColor(e.color), !1);
17345
- return buildCommon.makeFragment(n);
17346
- }, mathmlBuilder$7 = (e, t) => {
17347
- var n = buildExpression(e.body, t.withColor(e.color)), r = new mathMLTree.MathNode("mstyle", n);
17348
- return r.setAttribute("mathcolor", e.color), r;
17276
+ var htmlBuilder$8 = (e, t) => makeFragment(buildExpression$1(e.body, t.withColor(e.color), !1)), mathmlBuilder$7 = (e, t) => {
17277
+ var n = new MathNode("mstyle", buildExpression(e.body, t.withColor(e.color)));
17278
+ return n.setAttribute("mathcolor", e.color), n;
17349
17279
  };
17350
17280
  defineFunction({
17351
17281
  type: "color",
@@ -17405,11 +17335,11 @@ defineFunction({
17405
17335
  };
17406
17336
  },
17407
17337
  htmlBuilder(e, t) {
17408
- var n = buildCommon.makeSpan(["mspace"], [], t);
17338
+ var n = makeSpan(["mspace"], [], t);
17409
17339
  return e.newLine && (n.classes.push("newline"), e.size && (n.style.marginTop = makeEm(calculateSize(e.size, t)))), n;
17410
17340
  },
17411
17341
  mathmlBuilder(e, t) {
17412
- var n = new mathMLTree.MathNode("mspace");
17342
+ var n = new MathNode("mspace");
17413
17343
  return e.newLine && (n.setAttribute("linebreak", "newline"), e.size && n.setAttribute("height", makeEm(calculateSize(e.size, t)))), n;
17414
17344
  }
17415
17345
  });
@@ -17528,55 +17458,54 @@ var getMetrics = function(e, t, n) {
17528
17458
  if (!r) throw Error("Unsupported symbol " + e + " and font size " + t + ".");
17529
17459
  return r;
17530
17460
  }, styleWrap = function(e, t, n, r) {
17531
- var a = n.havingBaseStyle(t), o = buildCommon.makeSpan(r.concat(a.sizingClasses(n)), [e], n), s = a.sizeMultiplier / n.sizeMultiplier;
17461
+ var a = n.havingBaseStyle(t), o = makeSpan(r.concat(a.sizingClasses(n)), [e], n), s = a.sizeMultiplier / n.sizeMultiplier;
17532
17462
  return o.height *= s, o.depth *= s, o.maxFontSize = a.sizeMultiplier, o;
17533
17463
  }, centerSpan = function(e, t, n) {
17534
17464
  var r = t.havingBaseStyle(n), a = (1 - t.sizeMultiplier / r.sizeMultiplier) * t.fontMetrics().axisHeight;
17535
17465
  e.classes.push("delimcenter"), e.style.top = makeEm(a), e.height -= a, e.depth += a;
17536
17466
  }, makeSmallDelim = function(e, t, n, r, a, o) {
17537
- var s = styleWrap(buildCommon.makeSymbol(e, "Main-Regular", a, r), t, r, o);
17467
+ var s = styleWrap(makeSymbol(e, "Main-Regular", a, r), t, r, o);
17538
17468
  return n && centerSpan(s, r, t), s;
17539
17469
  }, mathrmSize = function(e, t, n, r) {
17540
- return buildCommon.makeSymbol(e, "Size" + t + "-Regular", n, r);
17470
+ return makeSymbol(e, "Size" + t + "-Regular", n, r);
17541
17471
  }, makeLargeDelim = function(e, t, n, r, a, o) {
17542
- var s = mathrmSize(e, t, a, r), c = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + t], [s], r), Style$1.TEXT, r, o);
17472
+ var s = mathrmSize(e, t, a, r), c = styleWrap(makeSpan(["delimsizing", "size" + t], [s], r), Style$1.TEXT, r, o);
17543
17473
  return n && centerSpan(c, r, Style$1.TEXT), c;
17544
17474
  }, makeGlyphSpan = function(e, t, n) {
17545
- var r = t === "Size1-Regular" ? "delim-size1" : "delim-size4";
17546
17475
  return {
17547
17476
  type: "elem",
17548
- elem: buildCommon.makeSpan(["delimsizinginner", r], [buildCommon.makeSpan([], [buildCommon.makeSymbol(e, t, n)])])
17477
+ elem: makeSpan(["delimsizinginner", t === "Size1-Regular" ? "delim-size1" : "delim-size4"], [makeSpan([], [makeSymbol(e, t, n)])])
17549
17478
  };
17550
17479
  }, makeInner = function(e, t, n) {
17551
- var r = fontMetricsData["Size4-Regular"][e.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][e.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][e.charCodeAt(0)][4], a = new SvgNode([new PathNode("inner", innerPath(e, Math.round(1e3 * t)))], {
17480
+ var r = fontMetricsData["Size4-Regular"][e.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][e.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][e.charCodeAt(0)][4], a = makeSvgSpan([], [new SvgNode([new PathNode("inner", innerPath(e, Math.round(1e3 * t)))], {
17552
17481
  width: makeEm(r),
17553
17482
  height: makeEm(t),
17554
17483
  style: "width:" + makeEm(r),
17555
17484
  viewBox: "0 0 " + 1e3 * r + " " + Math.round(1e3 * t),
17556
17485
  preserveAspectRatio: "xMinYMin"
17557
- }), o = buildCommon.makeSvgSpan([], [a], n);
17558
- return o.height = t, o.style.height = makeEm(t), o.style.width = makeEm(r), {
17486
+ })], n);
17487
+ return a.height = t, a.style.height = makeEm(t), a.style.width = makeEm(r), {
17559
17488
  type: "elem",
17560
- elem: o
17489
+ elem: a
17561
17490
  };
17562
17491
  }, lapInEms = .008, lap = {
17563
17492
  type: "kern",
17564
17493
  size: -1 * lapInEms
17565
- }, verts = [
17494
+ }, verts = new Set([
17566
17495
  "|",
17567
17496
  "\\lvert",
17568
17497
  "\\rvert",
17569
17498
  "\\vert"
17570
- ], doubleVerts = [
17499
+ ]), doubleVerts = new Set([
17571
17500
  "\\|",
17572
17501
  "\\lVert",
17573
17502
  "\\rVert",
17574
17503
  "\\Vert"
17575
- ], makeStackedDelim = function(e, t, n, r, a, o) {
17504
+ ]), makeStackedDelim = function(e, t, n, r, a, o) {
17576
17505
  var s, c, l, u, d = "", f = 0;
17577
17506
  s = l = u = e, c = null;
17578
17507
  var p = "Size1-Regular";
17579
- e === "\\uparrow" ? l = u = "⏐" : e === "\\Uparrow" ? l = u = "‖" : e === "\\downarrow" ? s = l = "⏐" : e === "\\Downarrow" ? s = l = "‖" : e === "\\updownarrow" ? (s = "\\uparrow", l = "⏐", u = "\\downarrow") : e === "\\Updownarrow" ? (s = "\\Uparrow", l = "‖", u = "\\Downarrow") : verts.includes(e) ? (l = "∣", d = "vert", f = 333) : doubleVerts.includes(e) ? (l = "∥", d = "doublevert", f = 556) : e === "[" || e === "\\lbrack" ? (s = "⎡", l = "⎢", u = "⎣", p = "Size4-Regular", d = "lbrack", f = 667) : e === "]" || e === "\\rbrack" ? (s = "⎤", l = "⎥", u = "⎦", p = "Size4-Regular", d = "rbrack", f = 667) : e === "\\lfloor" || e === "⌊" ? (l = s = "⎢", u = "⎣", p = "Size4-Regular", d = "lfloor", f = 667) : e === "\\lceil" || e === "⌈" ? (s = "⎡", l = u = "⎢", p = "Size4-Regular", d = "lceil", f = 667) : e === "\\rfloor" || e === "⌋" ? (l = s = "⎥", u = "⎦", p = "Size4-Regular", d = "rfloor", f = 667) : e === "\\rceil" || e === "⌉" ? (s = "⎤", l = u = "⎥", p = "Size4-Regular", d = "rceil", f = 667) : e === "(" || e === "\\lparen" ? (s = "⎛", l = "⎜", u = "⎝", p = "Size4-Regular", d = "lparen", f = 875) : e === ")" || e === "\\rparen" ? (s = "⎞", l = "⎟", u = "⎠", p = "Size4-Regular", d = "rparen", f = 875) : e === "\\{" || e === "\\lbrace" ? (s = "⎧", c = "⎨", u = "⎩", l = "⎪", p = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (s = "⎫", c = "⎬", u = "⎭", l = "⎪", p = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (s = "⎧", u = "⎩", l = "⎪", p = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (s = "⎫", u = "⎭", l = "⎪", p = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (s = "⎧", u = "⎭", l = "⎪", p = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (s = "⎫", u = "⎩", l = "⎪", p = "Size4-Regular");
17508
+ e === "\\uparrow" ? l = u = "⏐" : e === "\\Uparrow" ? l = u = "‖" : e === "\\downarrow" ? s = l = "⏐" : e === "\\Downarrow" ? s = l = "‖" : e === "\\updownarrow" ? (s = "\\uparrow", l = "⏐", u = "\\downarrow") : e === "\\Updownarrow" ? (s = "\\Uparrow", l = "‖", u = "\\Downarrow") : verts.has(e) ? (l = "∣", d = "vert", f = 333) : doubleVerts.has(e) ? (l = "∥", d = "doublevert", f = 556) : e === "[" || e === "\\lbrack" ? (s = "⎡", l = "⎢", u = "⎣", p = "Size4-Regular", d = "lbrack", f = 667) : e === "]" || e === "\\rbrack" ? (s = "⎤", l = "⎥", u = "⎦", p = "Size4-Regular", d = "rbrack", f = 667) : e === "\\lfloor" || e === "⌊" ? (l = s = "⎢", u = "⎣", p = "Size4-Regular", d = "lfloor", f = 667) : e === "\\lceil" || e === "⌈" ? (s = "⎡", l = u = "⎢", p = "Size4-Regular", d = "lceil", f = 667) : e === "\\rfloor" || e === "⌋" ? (l = s = "⎥", u = "⎦", p = "Size4-Regular", d = "rfloor", f = 667) : e === "\\rceil" || e === "⌉" ? (s = "⎤", l = u = "⎥", p = "Size4-Regular", d = "rceil", f = 667) : e === "(" || e === "\\lparen" ? (s = "⎛", l = "⎜", u = "⎝", p = "Size4-Regular", d = "lparen", f = 875) : e === ")" || e === "\\rparen" ? (s = "⎞", l = "⎟", u = "⎠", p = "Size4-Regular", d = "rparen", f = 875) : e === "\\{" || e === "\\lbrace" ? (s = "⎧", c = "⎨", u = "⎩", l = "⎪", p = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (s = "⎫", c = "⎬", u = "⎭", l = "⎪", p = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (s = "⎧", u = "⎩", l = "⎪", p = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (s = "⎫", u = "⎭", l = "⎪", p = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (s = "⎧", u = "⎭", l = "⎪", p = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (s = "⎫", u = "⎩", l = "⎪", p = "Size4-Regular");
17580
17509
  var m = getMetrics(s, p, a), h = m.height + m.depth, g = getMetrics(l, p, a), _ = g.height + g.depth, v = getMetrics(u, p, a), y = v.height + v.depth, b = 0, x = 1;
17581
17510
  if (c !== null) {
17582
17511
  var C = getMetrics(c, p, a);
@@ -17586,39 +17515,38 @@ var getMetrics = function(e, t, n) {
17586
17515
  n && (O *= r.sizeMultiplier);
17587
17516
  var k = E / 2 - O, A = [];
17588
17517
  if (d.length > 0) {
17589
- var j = E - h - y, M = Math.round(E * 1e3), N = tallDelim(d, Math.round(j * 1e3)), P = new PathNode(d, N), F = (f / 1e3).toFixed(3) + "em", I = (M / 1e3).toFixed(3) + "em", L = new SvgNode([P], {
17518
+ var j = E - h - y, M = Math.round(E * 1e3), N = tallDelim(d, Math.round(j * 1e3)), P = new PathNode(d, N), F = (f / 1e3).toFixed(3) + "em", I = (M / 1e3).toFixed(3) + "em", L = makeSvgSpan([], [new SvgNode([P], {
17590
17519
  width: F,
17591
17520
  height: I,
17592
17521
  viewBox: "0 0 " + f + " " + M
17593
- }), R = buildCommon.makeSvgSpan([], [L], r);
17594
- R.height = M / 1e3, R.style.width = F, R.style.height = I, A.push({
17522
+ })], r);
17523
+ L.height = M / 1e3, L.style.width = F, L.style.height = I, A.push({
17595
17524
  type: "elem",
17596
- elem: R
17525
+ elem: L
17597
17526
  });
17598
17527
  } else {
17599
17528
  if (A.push(makeGlyphSpan(u, p, a)), A.push(lap), c === null) {
17600
- var z = E - h - y + 2 * lapInEms;
17601
- A.push(makeInner(l, z, r));
17529
+ var R = E - h - y + 2 * lapInEms;
17530
+ A.push(makeInner(l, R, r));
17602
17531
  } else {
17603
- var B = (E - h - y - b) / 2 + 2 * lapInEms;
17604
- A.push(makeInner(l, B, r)), A.push(lap), A.push(makeGlyphSpan(c, p, a)), A.push(lap), A.push(makeInner(l, B, r));
17532
+ var z = (E - h - y - b) / 2 + 2 * lapInEms;
17533
+ A.push(makeInner(l, z, r)), A.push(lap), A.push(makeGlyphSpan(c, p, a)), A.push(lap), A.push(makeInner(l, z, r));
17605
17534
  }
17606
17535
  A.push(lap), A.push(makeGlyphSpan(s, p, a));
17607
17536
  }
17608
- var V = r.havingBaseStyle(Style$1.TEXT), H = buildCommon.makeVList({
17537
+ var B = r.havingBaseStyle(Style$1.TEXT);
17538
+ return styleWrap(makeSpan(["delimsizing", "mult"], [makeVList({
17609
17539
  positionType: "bottom",
17610
17540
  positionData: k,
17611
17541
  children: A
17612
- }, V);
17613
- return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [H], V), Style$1.TEXT, r, o);
17542
+ })], B), Style$1.TEXT, r, o);
17614
17543
  }, vbPad = 80, emPad = .08, sqrtSvg = function(e, t, n, r, a) {
17615
- var o = new SvgNode([new PathNode(e, sqrtPath(e, r, n))], {
17544
+ return makeSvgSpan(["hide-tail"], [new SvgNode([new PathNode(e, sqrtPath(e, r, n))], {
17616
17545
  width: "400em",
17617
17546
  height: makeEm(t),
17618
17547
  viewBox: "0 0 400000 " + n,
17619
17548
  preserveAspectRatio: "xMinYMin slice"
17620
- });
17621
- return buildCommon.makeSvgSpan(["hide-tail"], [o], a);
17549
+ })], a);
17622
17550
  }, makeSqrtImage = function(e, t) {
17623
17551
  var n = t.havingBaseSizing(), r = traverseSequence("\\surd", e * n.sizeMultiplier, stackLargeDelimiterSequence, n), a = n.sizeMultiplier, o = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), s, c = 0, l = 0, u = 0, d;
17624
17552
  return r.type === "small" ? (u = 1e3 + 1e3 * o + vbPad, e < 1 ? a = 1 : e < 1.4 && (a = .7), c = (1 + o + emPad) / a, l = (1 + o) / a, s = sqrtSvg("sqrtMain", c, u, o, t), s.style.minWidth = "0.853em", d = .833 / a) : r.type === "large" ? (u = (1e3 + vbPad) * sizeToMaxHeight[r.size], l = (sizeToMaxHeight[r.size] + o) / a, c = (sizeToMaxHeight[r.size] + o + emPad) / a, s = sqrtSvg("sqrtSize" + r.size, c, u, o, t), s.style.minWidth = "1.02em", d = 1 / a) : (c = e + o + emPad, l = e + o, u = Math.floor(1e3 * e + o) + vbPad, s = sqrtSvg("sqrtTall", c, u, o, t), s.style.minWidth = "0.742em", d = 1.056), s.height = l, s.style.height = makeEm(c), {
@@ -17626,7 +17554,7 @@ var getMetrics = function(e, t, n) {
17626
17554
  advanceWidth: d,
17627
17555
  ruleWidth: (t.fontMetrics().sqrtRuleThickness + o) * a
17628
17556
  };
17629
- }, stackLargeDelimiters = [
17557
+ }, stackLargeDelimiters = new Set([
17630
17558
  "(",
17631
17559
  "\\lparen",
17632
17560
  ")",
@@ -17648,7 +17576,7 @@ var getMetrics = function(e, t, n) {
17648
17576
  "⌈",
17649
17577
  "⌉",
17650
17578
  "\\surd"
17651
- ], stackAlwaysDelimiters = [
17579
+ ]), stackAlwaysDelimiters = new Set([
17652
17580
  "\\uparrow",
17653
17581
  "\\downarrow",
17654
17582
  "\\updownarrow",
@@ -17671,7 +17599,7 @@ var getMetrics = function(e, t, n) {
17671
17599
  "\\rmoustache",
17672
17600
  "⎰",
17673
17601
  "⎱"
17674
- ], stackNeverDelimiters = [
17602
+ ]), stackNeverDelimiters = new Set([
17675
17603
  "<",
17676
17604
  ">",
17677
17605
  "\\langle",
@@ -17680,15 +17608,15 @@ var getMetrics = function(e, t, n) {
17680
17608
  "\\backslash",
17681
17609
  "\\lt",
17682
17610
  "\\gt"
17683
- ], sizeToMaxHeight = [
17611
+ ]), sizeToMaxHeight = [
17684
17612
  0,
17685
17613
  1.2,
17686
17614
  1.8,
17687
17615
  2.4,
17688
17616
  3
17689
17617
  ], makeSizedDelim = function(e, t, r, a, o) {
17690
- if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), stackLargeDelimiters.includes(e) || stackNeverDelimiters.includes(e)) return makeLargeDelim(e, t, !1, r, a, o);
17691
- if (stackAlwaysDelimiters.includes(e)) return makeStackedDelim(e, sizeToMaxHeight[t], !1, r, a, o);
17618
+ if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), stackLargeDelimiters.has(e) || stackNeverDelimiters.has(e)) return makeLargeDelim(e, t, !1, r, a, o);
17619
+ if (stackAlwaysDelimiters.has(e)) return makeStackedDelim(e, sizeToMaxHeight[t], !1, r, a, o);
17692
17620
  throw new ParseError("Illegal delimiter: '" + e + "'");
17693
17621
  }, stackNeverDelimiterSequence = [
17694
17622
  {
@@ -17780,17 +17708,11 @@ var getMetrics = function(e, t, n) {
17780
17708
  return n[n.length - 1];
17781
17709
  }, makeCustomSizedDelim = function(e, t, n, r, a, o) {
17782
17710
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
17783
- var s = stackNeverDelimiters.includes(e) ? stackNeverDelimiterSequence : stackLargeDelimiters.includes(e) ? stackLargeDelimiterSequence : stackAlwaysDelimiterSequence, c = traverseSequence(e, t, s, r);
17711
+ var s = stackNeverDelimiters.has(e) ? stackNeverDelimiterSequence : stackLargeDelimiters.has(e) ? stackLargeDelimiterSequence : stackAlwaysDelimiterSequence, c = traverseSequence(e, t, s, r);
17784
17712
  return c.type === "small" ? makeSmallDelim(e, c.style, n, r, a, o) : c.type === "large" ? makeLargeDelim(e, c.size, n, r, a, o) : makeStackedDelim(e, t, n, r, a, o);
17785
- }, delimiter = {
17786
- sqrtImage: makeSqrtImage,
17787
- sizedDelim: makeSizedDelim,
17788
- sizeToMaxHeight,
17789
- customSizedDelim: makeCustomSizedDelim,
17790
- leftRightDelim: function(e, t, n, r, a, o) {
17791
- var s = r.fontMetrics().axisHeight * r.sizeMultiplier, c = 901, l = 5 / r.fontMetrics().ptPerEm, u = Math.max(t - s, n + s);
17792
- return makeCustomSizedDelim(e, Math.max(u / 500 * c, 2 * u - l), !0, r, a, o);
17793
- }
17713
+ }, makeLeftRightDelim = function(e, t, n, r, a, o) {
17714
+ var s = r.fontMetrics().axisHeight * r.sizeMultiplier, c = 901, l = 5 / r.fontMetrics().ptPerEm, u = Math.max(t - s, n + s);
17715
+ return makeCustomSizedDelim(e, Math.max(u / 500 * c, 2 * u - l), !0, r, a, o);
17794
17716
  }, delimiterSizes = {
17795
17717
  "\\bigl": {
17796
17718
  mclass: "mopen",
@@ -17856,10 +17778,10 @@ var getMetrics = function(e, t, n) {
17856
17778
  mclass: "mord",
17857
17779
  size: 4
17858
17780
  }
17859
- }, delimiters = /* @__PURE__ */ "(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.".split(",");
17781
+ }, delimiters = new Set(/* @__PURE__ */ "(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.".split(","));
17860
17782
  function checkDelimiter(e, t) {
17861
17783
  var r = checkSymbolNodeType(e);
17862
- if (r && delimiters.includes(r.text)) return r;
17784
+ if (r && delimiters.has(r.text)) return r;
17863
17785
  throw r ? new ParseError("Invalid delimiter '" + r.text + "' after '" + t.funcName + "'", e) : new ParseError("Invalid delimiter type '" + e.type + "'", e);
17864
17786
  }
17865
17787
  defineFunction({
@@ -17896,13 +17818,13 @@ defineFunction({
17896
17818
  delim: n.text
17897
17819
  };
17898
17820
  },
17899
- htmlBuilder: (e, t) => e.delim === "." ? buildCommon.makeSpan([e.mclass]) : delimiter.sizedDelim(e.delim, e.size, t, e.mode, [e.mclass]),
17821
+ htmlBuilder: (e, t) => e.delim === "." ? makeSpan([e.mclass]) : makeSizedDelim(e.delim, e.size, t, e.mode, [e.mclass]),
17900
17822
  mathmlBuilder: (e) => {
17901
17823
  var t = [];
17902
17824
  e.delim !== "." && t.push(makeText(e.delim, e.mode));
17903
- var n = new mathMLTree.MathNode("mo", t);
17825
+ var n = new MathNode("mo", t);
17904
17826
  e.mclass === "mopen" || e.mclass === "mclose" ? n.setAttribute("fence", "true") : n.setAttribute("fence", "false"), n.setAttribute("stretchy", "true");
17905
- var r = makeEm(delimiter.sizeToMaxHeight[e.size]);
17827
+ var r = makeEm(sizeToMaxHeight[e.size]);
17906
17828
  return n.setAttribute("minsize", r), n.setAttribute("maxsize", r), n;
17907
17829
  }
17908
17830
  });
@@ -17952,28 +17874,28 @@ defineFunction({
17952
17874
  assertParsed(e);
17953
17875
  for (var n = buildExpression$1(e.body, t, !0, ["mopen", "mclose"]), r = 0, a = 0, o = !1, s = 0; s < n.length; s++) n[s].isMiddle ? o = !0 : (r = Math.max(n[s].height, r), a = Math.max(n[s].depth, a));
17954
17876
  r *= t.sizeMultiplier, a *= t.sizeMultiplier;
17955
- var c = e.left === "." ? makeNullDelimiter(t, ["mopen"]) : delimiter.leftRightDelim(e.left, r, a, t, e.mode, ["mopen"]);
17877
+ var c = e.left === "." ? makeNullDelimiter(t, ["mopen"]) : makeLeftRightDelim(e.left, r, a, t, e.mode, ["mopen"]);
17956
17878
  if (n.unshift(c), o) for (var l = 1; l < n.length; l++) {
17957
17879
  var u = n[l].isMiddle;
17958
- u && (n[l] = delimiter.leftRightDelim(u.delim, r, a, u.options, e.mode, []));
17880
+ u && (n[l] = makeLeftRightDelim(u.delim, r, a, u.options, e.mode, []));
17959
17881
  }
17960
17882
  var d;
17961
17883
  if (e.right === ".") d = makeNullDelimiter(t, ["mclose"]);
17962
17884
  else {
17963
17885
  var f = e.rightColor ? t.withColor(e.rightColor) : t;
17964
- d = delimiter.leftRightDelim(e.right, r, a, f, e.mode, ["mclose"]);
17886
+ d = makeLeftRightDelim(e.right, r, a, f, e.mode, ["mclose"]);
17965
17887
  }
17966
- return n.push(d), buildCommon.makeSpan(["minner"], n, t);
17888
+ return n.push(d), makeSpan(["minner"], n, t);
17967
17889
  },
17968
17890
  mathmlBuilder: (e, t) => {
17969
17891
  assertParsed(e);
17970
17892
  var n = buildExpression(e.body, t);
17971
17893
  if (e.left !== ".") {
17972
- var r = new mathMLTree.MathNode("mo", [makeText(e.left, e.mode)]);
17894
+ var r = new MathNode("mo", [makeText(e.left, e.mode)]);
17973
17895
  r.setAttribute("fence", "true"), n.unshift(r);
17974
17896
  }
17975
17897
  if (e.right !== ".") {
17976
- var a = new mathMLTree.MathNode("mo", [makeText(e.right, e.mode)]);
17898
+ var a = new MathNode("mo", [makeText(e.right, e.mode)]);
17977
17899
  a.setAttribute("fence", "true"), e.rightColor && a.setAttribute("mathcolor", e.rightColor), n.push(a);
17978
17900
  }
17979
17901
  return makeRow(n);
@@ -17998,7 +17920,7 @@ defineFunction({
17998
17920
  var n;
17999
17921
  if (e.delim === ".") n = makeNullDelimiter(t, []);
18000
17922
  else {
18001
- n = delimiter.sizedDelim(e.delim, 1, t, e.mode, []);
17923
+ n = makeSizedDelim(e.delim, 1, t, e.mode, []);
18002
17924
  var r = {
18003
17925
  delim: e.delim,
18004
17926
  options: t
@@ -18008,13 +17930,13 @@ defineFunction({
18008
17930
  return n;
18009
17931
  },
18010
17932
  mathmlBuilder: (e, t) => {
18011
- var n = e.delim === "\\vert" || e.delim === "|" ? makeText("|", "text") : makeText(e.delim, e.mode), r = new mathMLTree.MathNode("mo", [n]);
18012
- return r.setAttribute("fence", "true"), r.setAttribute("lspace", "0.05em"), r.setAttribute("rspace", "0.05em"), r;
17933
+ var n = new MathNode("mo", [e.delim === "\\vert" || e.delim === "|" ? makeText("|", "text") : makeText(e.delim, e.mode)]);
17934
+ return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n;
18013
17935
  }
18014
17936
  });
18015
17937
  var htmlBuilder$7 = (e, t) => {
18016
- var n = buildCommon.wrapFragment(buildGroup$1(e.body, t), t), r = e.label.slice(1), a = t.sizeMultiplier, o, s = 0, c = utils.isCharacterBox(e.body);
18017
- if (r === "sout") o = buildCommon.makeSpan(["stretchy", "sout"]), o.height = t.fontMetrics().defaultRuleThickness / a, s = -.5 * t.fontMetrics().xHeight;
17938
+ var n = wrapFragment(buildGroup$1(e.body, t), t), r = e.label.slice(1), a = t.sizeMultiplier, o, s = 0, c = isCharacterBox(e.body);
17939
+ if (r === "sout") o = makeSpan(["stretchy", "sout"]), o.height = t.fontMetrics().defaultRuleThickness / a, s = -.5 * t.fontMetrics().xHeight;
18018
17940
  else if (r === "phase") {
18019
17941
  var l = calculateSize({
18020
17942
  number: .6,
@@ -18022,24 +17944,24 @@ var htmlBuilder$7 = (e, t) => {
18022
17944
  }, t), u = calculateSize({
18023
17945
  number: .35,
18024
17946
  unit: "ex"
18025
- }, t), d = t.havingBaseSizing();
18026
- a /= d.sizeMultiplier;
18027
- var f = n.height + n.depth + l + u;
18028
- n.style.paddingLeft = makeEm(f / 2 + l);
18029
- var m = Math.floor(1e3 * f * a), h = new SvgNode([new PathNode("phase", phasePath(m))], {
17947
+ }, t), f = t.havingBaseSizing();
17948
+ a /= f.sizeMultiplier;
17949
+ var p = n.height + n.depth + l + u;
17950
+ n.style.paddingLeft = makeEm(p / 2 + l);
17951
+ var m = Math.floor(1e3 * p * a);
17952
+ o = makeSvgSpan(["hide-tail"], [new SvgNode([new PathNode("phase", phasePath(m))], {
18030
17953
  width: "400em",
18031
17954
  height: makeEm(m / 1e3),
18032
17955
  viewBox: "0 0 400000 " + m,
18033
17956
  preserveAspectRatio: "xMinYMin slice"
18034
- });
18035
- o = buildCommon.makeSvgSpan(["hide-tail"], [h], t), o.style.height = makeEm(f), s = n.depth + l + u;
17957
+ })], t), o.style.height = makeEm(p), s = n.depth + l + u;
18036
17958
  } else {
18037
17959
  /cancel/.test(r) ? c || n.classes.push("cancel-pad") : r === "angl" ? n.classes.push("anglpad") : n.classes.push("boxpad");
18038
- var g = 0, _ = 0, v = 0;
18039
- /box/.test(r) ? (v = Math.max(t.fontMetrics().fboxrule, t.minRuleThickness), g = t.fontMetrics().fboxsep + (r === "colorbox" ? 0 : v), _ = g) : r === "angl" ? (v = Math.max(t.fontMetrics().defaultRuleThickness, t.minRuleThickness), g = 4 * v, _ = Math.max(0, .25 - n.depth)) : (g = c ? .2 : 0, _ = g), o = stretchy.encloseSpan(n, r, g, _, t), /fbox|boxed|fcolorbox/.test(r) ? (o.style.borderStyle = "solid", o.style.borderWidth = makeEm(v)) : r === "angl" && v !== .049 && (o.style.borderTopWidth = makeEm(v), o.style.borderRightWidth = makeEm(v)), s = n.depth + _, e.backgroundColor && (o.style.backgroundColor = e.backgroundColor, e.borderColor && (o.style.borderColor = e.borderColor));
17960
+ var h = 0, g = 0, _ = 0;
17961
+ /box/.test(r) ? (_ = Math.max(t.fontMetrics().fboxrule, t.minRuleThickness), h = t.fontMetrics().fboxsep + (r === "colorbox" ? 0 : _), g = h) : r === "angl" ? (_ = Math.max(t.fontMetrics().defaultRuleThickness, t.minRuleThickness), h = 4 * _, g = Math.max(0, .25 - n.depth)) : (h = c ? .2 : 0, g = h), o = stretchyEnclose(n, r, h, g, t), /fbox|boxed|fcolorbox/.test(r) ? (o.style.borderStyle = "solid", o.style.borderWidth = makeEm(_)) : r === "angl" && _ !== .049 && (o.style.borderTopWidth = makeEm(_), o.style.borderRightWidth = makeEm(_)), s = n.depth + g, e.backgroundColor && (o.style.backgroundColor = e.backgroundColor, e.borderColor && (o.style.borderColor = e.borderColor));
18040
17962
  }
18041
- var y;
18042
- if (e.backgroundColor) y = buildCommon.makeVList({
17963
+ var v;
17964
+ if (e.backgroundColor) v = makeVList({
18043
17965
  positionType: "individualShift",
18044
17966
  children: [{
18045
17967
  type: "elem",
@@ -18050,10 +17972,10 @@ var htmlBuilder$7 = (e, t) => {
18050
17972
  elem: n,
18051
17973
  shift: 0
18052
17974
  }]
18053
- }, t);
17975
+ });
18054
17976
  else {
18055
- var b = /cancel|phase/.test(r) ? ["svg-align"] : [];
18056
- y = buildCommon.makeVList({
17977
+ var y = /cancel|phase/.test(r) ? ["svg-align"] : [];
17978
+ v = makeVList({
18057
17979
  positionType: "individualShift",
18058
17980
  children: [{
18059
17981
  type: "elem",
@@ -18063,13 +17985,13 @@ var htmlBuilder$7 = (e, t) => {
18063
17985
  type: "elem",
18064
17986
  elem: o,
18065
17987
  shift: s,
18066
- wrapperClasses: b
17988
+ wrapperClasses: y
18067
17989
  }]
18068
- }, t);
17990
+ });
18069
17991
  }
18070
- return /cancel/.test(r) && (y.height = n.height, y.depth = n.depth), /cancel/.test(r) && !c ? buildCommon.makeSpan(["mord", "cancel-lap"], [y], t) : buildCommon.makeSpan(["mord"], [y], t);
17992
+ return /cancel/.test(r) && (v.height = n.height, v.depth = n.depth), /cancel/.test(r) && !c ? makeSpan(["mord", "cancel-lap"], [v], t) : makeSpan(["mord"], [v], t);
18071
17993
  }, mathmlBuilder$6 = (e, t) => {
18072
- var n = 0, r = new mathMLTree.MathNode(e.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(e.body, t)]);
17994
+ var n = 0, r = new MathNode(e.label.includes("colorbox") ? "mpadded" : "menclose", [buildGroup(e.body, t)]);
18073
17995
  switch (e.label) {
18074
17996
  case "\\cancel":
18075
17997
  r.setAttribute("notation", "updiagonalstrike");
@@ -18227,9 +18149,9 @@ function getHLines(e) {
18227
18149
  }
18228
18150
  var validateAmsEnvironmentContext = (e) => {
18229
18151
  if (!e.parser.settings.displayMode) throw new ParseError("{" + e.envName + "} can be used only in display mode.");
18230
- };
18152
+ }, gatherEnvironments = new Set(["gather", "gather*"]);
18231
18153
  function getAutoTag(e) {
18232
- if (e.indexOf("ed") === -1) return e.indexOf("*") === -1;
18154
+ if (!e.includes("ed")) return !e.includes("*");
18233
18155
  }
18234
18156
  function parseArray(e, r, a) {
18235
18157
  var { hskipBeforeAndAfter: o, addJot: s, cols: c, arraystretch: l, colSeparationType: u, autoTag: d, singleRow: f, emptySingleRow: p, maxNumCols: m, leqno: h } = r;
@@ -18293,107 +18215,107 @@ function dCellStyle(e) {
18293
18215
  return e.slice(0, 1) === "d" ? "display" : "text";
18294
18216
  }
18295
18217
  var htmlBuilder$6 = function(e, t) {
18296
- var r, a, o = e.body.length, s = e.hLinesBeforeRow, c = 0, l = Array(o), u = [], d = Math.max(t.fontMetrics().arrayRuleWidth, t.minRuleThickness), f = 1 / t.fontMetrics().ptPerEm, m = 5 * f;
18297
- e.colSeparationType && e.colSeparationType === "small" && (m = .2778 * (t.havingStyle(Style$1.SCRIPT).sizeMultiplier / t.sizeMultiplier));
18298
- var h = e.colSeparationType === "CD" ? calculateSize({
18218
+ var r, a, o = e.body.length, s = e.hLinesBeforeRow, c = 0, l = Array(o), u = [], d = Math.max(t.fontMetrics().arrayRuleWidth, t.minRuleThickness), f = 1 / t.fontMetrics().ptPerEm, p = 5 * f;
18219
+ e.colSeparationType && e.colSeparationType === "small" && (p = .2778 * (t.havingStyle(Style$1.SCRIPT).sizeMultiplier / t.sizeMultiplier));
18220
+ var m = e.colSeparationType === "CD" ? calculateSize({
18299
18221
  number: 3,
18300
18222
  unit: "ex"
18301
- }, t) : 12 * f, g = 3 * f, _ = e.arraystretch * h, v = .7 * _, y = .3 * _, b = 0;
18302
- function x(e) {
18303
- for (var t = 0; t < e.length; ++t) t > 0 && (b += .25), u.push({
18304
- pos: b,
18223
+ }, t) : 12 * f, h = 3 * f, g = e.arraystretch * m, _ = .7 * g, v = .3 * g, y = 0;
18224
+ function b(e) {
18225
+ for (var t = 0; t < e.length; ++t) t > 0 && (y += .25), u.push({
18226
+ pos: y,
18305
18227
  isDashed: e[t]
18306
18228
  });
18307
18229
  }
18308
- for (x(s[0]), r = 0; r < e.body.length; ++r) {
18309
- var C = e.body[r], w = v, E = y;
18310
- c < C.length && (c = C.length);
18311
- var O = Array(C.length);
18312
- for (a = 0; a < C.length; ++a) {
18313
- var k = buildGroup$1(C[a], t);
18314
- E < k.depth && (E = k.depth), w < k.height && (w = k.height), O[a] = k;
18230
+ for (b(s[0]), r = 0; r < e.body.length; ++r) {
18231
+ var x = e.body[r], C = _, w = v;
18232
+ c < x.length && (c = x.length);
18233
+ var E = Array(x.length);
18234
+ for (a = 0; a < x.length; ++a) {
18235
+ var O = buildGroup$1(x[a], t);
18236
+ w < O.depth && (w = O.depth), C < O.height && (C = O.height), E[a] = O;
18315
18237
  }
18316
- var A = e.rowGaps[r], j = 0;
18317
- A && (j = calculateSize(A, t), j > 0 && (j += y, E < j && (E = j), j = 0)), e.addJot && (E += g), O.height = w, O.depth = E, b += w, O.pos = b, b += E + j, l[r] = O, x(s[r + 1]);
18238
+ var k = e.rowGaps[r], A = 0;
18239
+ k && (A = calculateSize(k, t), A > 0 && (A += v, w < A && (w = A), A = 0)), e.addJot && (w += h), E.height = C, E.depth = w, y += C, E.pos = y, y += w + A, l[r] = E, b(s[r + 1]);
18318
18240
  }
18319
- var M = b / 2 + t.fontMetrics().axisHeight, N = e.cols || [], P = [], F, I, L = [];
18241
+ var j = y / 2 + t.fontMetrics().axisHeight, M = e.cols || [], N = [], P, F, I = [];
18320
18242
  if (e.tags && e.tags.some((e) => e)) for (r = 0; r < o; ++r) {
18321
- var R = l[r], z = R.pos - M, B = e.tags[r], V = void 0;
18322
- V = B === !0 ? buildCommon.makeSpan(["eqn-num"], [], t) : B === !1 ? buildCommon.makeSpan([], [], t) : buildCommon.makeSpan([], buildExpression$1(B, t, !0), t), V.depth = R.depth, V.height = R.height, L.push({
18243
+ var L = l[r], R = L.pos - j, z = e.tags[r], B = void 0;
18244
+ B = z === !0 ? makeSpan(["eqn-num"], [], t) : z === !1 ? makeSpan([], [], t) : makeSpan([], buildExpression$1(z, t, !0), t), B.depth = L.depth, B.height = L.height, I.push({
18323
18245
  type: "elem",
18324
- elem: V,
18325
- shift: z
18246
+ elem: B,
18247
+ shift: R
18326
18248
  });
18327
18249
  }
18328
- for (a = 0, I = 0; a < c || I < N.length; ++a, ++I) {
18329
- for (var H = N[I] || {}, U = !0; H.type === "separator";) {
18330
- if (U || (F = buildCommon.makeSpan(["arraycolsep"], []), F.style.width = makeEm(t.fontMetrics().doubleRuleSep), P.push(F)), H.separator === "|" || H.separator === ":") {
18331
- var na = H.separator === "|" ? "solid" : "dashed", W = buildCommon.makeSpan(["vertical-separator"], [], t);
18332
- W.style.height = makeEm(b), W.style.borderRightWidth = makeEm(d), W.style.borderRightStyle = na, W.style.margin = "0 " + makeEm(-d / 2);
18333
- var G = b - M;
18334
- G && (W.style.verticalAlign = makeEm(-G)), P.push(W);
18335
- } else throw new ParseError("Invalid separator type: " + H.separator);
18336
- I++, H = N[I] || {}, U = !1;
18250
+ for (a = 0, F = 0; a < c || F < M.length; ++a, ++F) {
18251
+ for (var V = M[F] || {}, H = !0; V.type === "separator";) {
18252
+ if (H || (P = makeSpan(["arraycolsep"], []), P.style.width = makeEm(t.fontMetrics().doubleRuleSep), N.push(P)), V.separator === "|" || V.separator === ":") {
18253
+ var U = V.separator === "|" ? "solid" : "dashed", W = makeSpan(["vertical-separator"], [], t);
18254
+ W.style.height = makeEm(y), W.style.borderRightWidth = makeEm(d), W.style.borderRightStyle = U, W.style.margin = "0 " + makeEm(-d / 2);
18255
+ var G = y - j;
18256
+ G && (W.style.verticalAlign = makeEm(-G)), N.push(W);
18257
+ } else throw new ParseError("Invalid separator type: " + V.separator);
18258
+ F++, V = M[F] || {}, H = !1;
18337
18259
  }
18338
18260
  if (!(a >= c)) {
18339
18261
  var K = void 0;
18340
- (a > 0 || e.hskipBeforeAndAfter) && (K = utils.deflt(H.pregap, m), K !== 0 && (F = buildCommon.makeSpan(["arraycolsep"], []), F.style.width = makeEm(K), P.push(F)));
18262
+ (a > 0 || e.hskipBeforeAndAfter) && (K = V.pregap ?? p, K !== 0 && (P = makeSpan(["arraycolsep"], []), P.style.width = makeEm(K), N.push(P)));
18341
18263
  var q = [];
18342
18264
  for (r = 0; r < o; ++r) {
18343
18265
  var J = l[r], Y = J[a];
18344
18266
  if (Y) {
18345
- var ra = J.pos - M;
18267
+ var aa = J.pos - j;
18346
18268
  Y.depth = J.depth, Y.height = J.height, q.push({
18347
18269
  type: "elem",
18348
18270
  elem: Y,
18349
- shift: ra
18271
+ shift: aa
18350
18272
  });
18351
18273
  }
18352
18274
  }
18353
- q = buildCommon.makeVList({
18275
+ q = makeVList({
18354
18276
  positionType: "individualShift",
18355
18277
  children: q
18356
- }, t), q = buildCommon.makeSpan(["col-align-" + (H.align || "c")], [q]), P.push(q), (a < c - 1 || e.hskipBeforeAndAfter) && (K = utils.deflt(H.postgap, m), K !== 0 && (F = buildCommon.makeSpan(["arraycolsep"], []), F.style.width = makeEm(K), P.push(F)));
18278
+ }), q = makeSpan(["col-align-" + (V.align || "c")], [q]), N.push(q), (a < c - 1 || e.hskipBeforeAndAfter) && (K = V.postgap ?? p, K !== 0 && (P = makeSpan(["arraycolsep"], []), P.style.width = makeEm(K), N.push(P)));
18357
18279
  }
18358
18280
  }
18359
- if (l = buildCommon.makeSpan(["mtable"], P), u.length > 0) {
18360
- for (var ia = buildCommon.makeLineSpan("hline", t, d), aa = buildCommon.makeLineSpan("hdashline", t, d), X = [{
18281
+ if (l = makeSpan(["mtable"], N), u.length > 0) {
18282
+ for (var oa = makeLineSpan("hline", t, d), sa = makeLineSpan("hdashline", t, d), X = [{
18361
18283
  type: "elem",
18362
18284
  elem: l,
18363
18285
  shift: 0
18364
18286
  }]; u.length > 0;) {
18365
- var Z = u.pop(), Q = Z.pos - M;
18287
+ var Z = u.pop(), Q = Z.pos - j;
18366
18288
  Z.isDashed ? X.push({
18367
18289
  type: "elem",
18368
- elem: aa,
18290
+ elem: sa,
18369
18291
  shift: Q
18370
18292
  }) : X.push({
18371
18293
  type: "elem",
18372
- elem: ia,
18294
+ elem: oa,
18373
18295
  shift: Q
18374
18296
  });
18375
18297
  }
18376
- l = buildCommon.makeVList({
18298
+ l = makeVList({
18377
18299
  positionType: "individualShift",
18378
18300
  children: X
18379
- }, t);
18301
+ });
18380
18302
  }
18381
- if (L.length === 0) return buildCommon.makeSpan(["mord"], [l], t);
18382
- var $ = buildCommon.makeVList({
18303
+ if (I.length === 0) return makeSpan(["mord"], [l], t);
18304
+ var $ = makeVList({
18383
18305
  positionType: "individualShift",
18384
- children: L
18385
- }, t);
18386
- return $ = buildCommon.makeSpan(["tag"], [$], t), buildCommon.makeFragment([l, $]);
18306
+ children: I
18307
+ });
18308
+ return $ = makeSpan(["tag"], [$], t), makeFragment([l, $]);
18387
18309
  }, alignMap = {
18388
18310
  c: "center ",
18389
18311
  l: "left ",
18390
18312
  r: "right "
18391
18313
  }, mathmlBuilder$5 = function(e, t) {
18392
- for (var n = [], r = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), a = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), o = 0; o < e.body.length; o++) {
18393
- for (var s = e.body[o], c = [], l = 0; l < s.length; l++) c.push(new mathMLTree.MathNode("mtd", [buildGroup(s[l], t)]));
18394
- e.tags && e.tags[o] && (c.unshift(r), c.push(r), e.leqno ? c.unshift(a) : c.push(a)), n.push(new mathMLTree.MathNode("mtr", c));
18314
+ for (var n = [], r = new MathNode("mtd", [], ["mtr-glue"]), a = new MathNode("mtd", [], ["mml-eqn-num"]), o = 0; o < e.body.length; o++) {
18315
+ for (var s = e.body[o], c = [], l = 0; l < s.length; l++) c.push(new MathNode("mtd", [buildGroup(s[l], t)]));
18316
+ e.tags && e.tags[o] && (c.unshift(r), c.push(r), e.leqno ? c.unshift(a) : c.push(a)), n.push(new MathNode("mtr", c));
18395
18317
  }
18396
- var u = new mathMLTree.MathNode("mtable", n), d = e.arraystretch === .5 ? .1 : .16 + e.arraystretch - 1 + (e.addJot ? .09 : 0);
18318
+ var u = new MathNode("mtable", n), d = e.arraystretch === .5 ? .1 : .16 + e.arraystretch - 1 + (e.addJot ? .09 : 0);
18397
18319
  u.setAttribute("rowspacing", makeEm(d));
18398
18320
  var f = "", p = "";
18399
18321
  if (e.cols && e.cols.length > 0) {
@@ -18409,10 +18331,10 @@ var htmlBuilder$6 = function(e, t) {
18409
18331
  var w = "", E = e.hLinesBeforeRow;
18410
18332
  f += E[0].length > 0 ? "left " : "", f += E[E.length - 1].length > 0 ? "right " : "";
18411
18333
  for (var O = 1; O < E.length - 1; O++) w += E[O].length === 0 ? "none " : E[O][0] ? "dashed " : "solid ";
18412
- return /[sd]/.test(w) && u.setAttribute("rowlines", w.trim()), f !== "" && (u = new mathMLTree.MathNode("menclose", [u]), u.setAttribute("notation", f.trim())), e.arraystretch && e.arraystretch < 1 && (u = new mathMLTree.MathNode("mstyle", [u]), u.setAttribute("scriptlevel", "1")), u;
18334
+ return /[sd]/.test(w) && u.setAttribute("rowlines", w.trim()), f !== "" && (u = new MathNode("menclose", [u]), u.setAttribute("notation", f.trim())), e.arraystretch && e.arraystretch < 1 && (u = new MathNode("mstyle", [u]), u.setAttribute("scriptlevel", "1")), u;
18413
18335
  }, alignedHandler = function(e, t) {
18414
- e.envName.indexOf("ed") === -1 && validateAmsEnvironmentContext(e);
18415
- var r = [], a = e.envName.indexOf("at") > -1 ? "alignat" : "align", o = e.envName === "split", s = parseArray(e.parser, {
18336
+ e.envName.includes("ed") || validateAmsEnvironmentContext(e);
18337
+ var r = [], a = e.envName.includes("at") ? "alignat" : "align", o = e.envName === "split", s = parseArray(e.parser, {
18416
18338
  cols: r,
18417
18339
  addJot: !0,
18418
18340
  autoTag: o ? void 0 : getAutoTag(e.envName),
@@ -18459,7 +18381,7 @@ defineEnvironment({
18459
18381
  handler(e, t) {
18460
18382
  var r = (checkSymbolNodeType(t[0]) ? [t[0]] : assertNodeType(t[0], "ordgroup").body).map(function(e) {
18461
18383
  var t = assertSymbolNodeType(e).text;
18462
- if ("lcr".indexOf(t) !== -1) return {
18384
+ if ("lcr".includes(t)) return {
18463
18385
  type: "align",
18464
18386
  align: t
18465
18387
  };
@@ -18516,7 +18438,7 @@ defineEnvironment({
18516
18438
  if (e.envName.charAt(e.envName.length - 1) === "*") {
18517
18439
  var o = e.parser;
18518
18440
  if (o.consumeSpaces(), o.fetch().text === "[") {
18519
- if (o.consume(), o.consumeSpaces(), r = o.fetch().text, "lcr".indexOf(r) === -1) throw new ParseError("Expected l or c or r", o.nextToken);
18441
+ if (o.consume(), o.consumeSpaces(), r = o.fetch().text, !"lcr".includes(r)) throw new ParseError("Expected l or c or r", o.nextToken);
18520
18442
  o.consume(), o.consumeSpaces(), o.expect("]"), o.consume(), a.cols = [{
18521
18443
  type: "align",
18522
18444
  align: r
@@ -18555,7 +18477,7 @@ defineEnvironment({
18555
18477
  handler(e, t) {
18556
18478
  var r = (checkSymbolNodeType(t[0]) ? [t[0]] : assertNodeType(t[0], "ordgroup").body).map(function(e) {
18557
18479
  var t = assertSymbolNodeType(e).text;
18558
- if ("lc".indexOf(t) !== -1) return {
18480
+ if ("lc".includes(t)) return {
18559
18481
  type: "align",
18560
18482
  align: t
18561
18483
  };
@@ -18600,8 +18522,8 @@ defineEnvironment({
18600
18522
  type: "leftright",
18601
18523
  mode: e.mode,
18602
18524
  body: [t],
18603
- left: e.envName.indexOf("r") > -1 ? "." : "\\{",
18604
- right: e.envName.indexOf("r") > -1 ? "\\}" : ".",
18525
+ left: e.envName.includes("r") ? "." : "\\{",
18526
+ right: e.envName.includes("r") ? "\\}" : ".",
18605
18527
  rightColor: void 0
18606
18528
  };
18607
18529
  },
@@ -18628,7 +18550,7 @@ defineEnvironment({
18628
18550
  ],
18629
18551
  props: { numArgs: 0 },
18630
18552
  handler(e) {
18631
- ["gather", "gather*"].includes(e.envName) && validateAmsEnvironmentContext(e);
18553
+ gatherEnvironments.has(e.envName) && validateAmsEnvironmentContext(e);
18632
18554
  var t = {
18633
18555
  cols: [{
18634
18556
  type: "align",
@@ -18775,7 +18697,7 @@ defineFunction({
18775
18697
  names: ["\\boldsymbol", "\\bm"],
18776
18698
  props: { numArgs: 1 },
18777
18699
  handler: (e, t) => {
18778
- var { parser: n } = e, r = t[0], a = utils.isCharacterBox(r);
18700
+ var { parser: n } = e, r = t[0];
18779
18701
  return {
18780
18702
  type: "mclass",
18781
18703
  mode: n.mode,
@@ -18786,7 +18708,7 @@ defineFunction({
18786
18708
  font: "boldsymbol",
18787
18709
  body: r
18788
18710
  }],
18789
- isCharacterBox: a
18711
+ isCharacterBox: isCharacterBox(r)
18790
18712
  };
18791
18713
  }
18792
18714
  }), defineFunction({
@@ -18819,26 +18741,23 @@ defineFunction({
18819
18741
  htmlBuilder: htmlBuilder$5,
18820
18742
  mathmlBuilder: mathmlBuilder$4
18821
18743
  });
18822
- var adjustStyle = (e, t) => {
18823
- var n = t;
18824
- return e === "display" ? n = n.id >= Style$1.SCRIPT.id ? n.text() : Style$1.DISPLAY : e === "text" && n.size === Style$1.DISPLAY.size ? n = Style$1.TEXT : e === "script" ? n = Style$1.SCRIPT : e === "scriptscript" && (n = Style$1.SCRIPTSCRIPT), n;
18825
- }, htmlBuilder$4 = (e, t) => {
18826
- var n = adjustStyle(e.size, t.style), r = n.fracNum(), a = n.fracDen(), o = t.havingStyle(r), s = buildGroup$1(e.numer, o, t);
18744
+ var htmlBuilder$4 = (e, t) => {
18745
+ var n = t.style, r = n.fracNum(), a = n.fracDen(), o = t.havingStyle(r), s = buildGroup$1(e.numer, o, t);
18827
18746
  if (e.continued) {
18828
18747
  var c = 8.5 / t.fontMetrics().ptPerEm, l = 3.5 / t.fontMetrics().ptPerEm;
18829
18748
  s.height = s.height < c ? c : s.height, s.depth = s.depth < l ? l : s.depth;
18830
18749
  }
18831
18750
  o = t.havingStyle(a);
18832
18751
  var u = buildGroup$1(e.denom, o, t), d, f, p;
18833
- e.hasBarLine ? (e.barSize ? (f = calculateSize(e.barSize, t), d = buildCommon.makeLineSpan("frac-line", t, f)) : d = buildCommon.makeLineSpan("frac-line", t), f = d.height, p = d.height) : (d = null, f = 0, p = t.fontMetrics().defaultRuleThickness);
18752
+ e.hasBarLine ? (e.barSize ? (f = calculateSize(e.barSize, t), d = makeLineSpan("frac-line", t, f)) : d = makeLineSpan("frac-line", t), f = d.height, p = d.height) : (d = null, f = 0, p = t.fontMetrics().defaultRuleThickness);
18834
18753
  var m, h, g;
18835
- n.size === Style$1.DISPLAY.size || e.size === "display" ? (m = t.fontMetrics().num1, h = f > 0 ? 3 * p : 7 * p, g = t.fontMetrics().denom1) : (f > 0 ? (m = t.fontMetrics().num2, h = p) : (m = t.fontMetrics().num3, h = 3 * p), g = t.fontMetrics().denom2);
18754
+ n.size === Style$1.DISPLAY.size ? (m = t.fontMetrics().num1, h = f > 0 ? 3 * p : 7 * p, g = t.fontMetrics().denom1) : (f > 0 ? (m = t.fontMetrics().num2, h = p) : (m = t.fontMetrics().num3, h = 3 * p), g = t.fontMetrics().denom2);
18836
18755
  var _;
18837
18756
  if (d) {
18838
18757
  var v = t.fontMetrics().axisHeight;
18839
18758
  m - s.depth - (v + .5 * f) < h && (m += h - (m - s.depth - (v + .5 * f))), v - .5 * f - (u.height - g) < h && (g += h - (v - .5 * f - (u.height - g)));
18840
18759
  var y = -(v - .5 * f);
18841
- _ = buildCommon.makeVList({
18760
+ _ = makeVList({
18842
18761
  positionType: "individualShift",
18843
18762
  children: [
18844
18763
  {
@@ -18857,10 +18776,10 @@ var adjustStyle = (e, t) => {
18857
18776
  shift: -m
18858
18777
  }
18859
18778
  ]
18860
- }, t);
18779
+ });
18861
18780
  } else {
18862
18781
  var b = m - s.depth - (u.height - g);
18863
- b < h && (m += .5 * (h - b), g += .5 * (h - b)), _ = buildCommon.makeVList({
18782
+ b < h && (m += .5 * (h - b), g += .5 * (h - b)), _ = makeVList({
18864
18783
  positionType: "individualShift",
18865
18784
  children: [{
18866
18785
  type: "elem",
@@ -18871,45 +18790,45 @@ var adjustStyle = (e, t) => {
18871
18790
  elem: s,
18872
18791
  shift: -m
18873
18792
  }]
18874
- }, t);
18793
+ });
18875
18794
  }
18876
18795
  o = t.havingStyle(n), _.height *= o.sizeMultiplier / t.sizeMultiplier, _.depth *= o.sizeMultiplier / t.sizeMultiplier;
18877
- var x = n.size === Style$1.DISPLAY.size ? t.fontMetrics().delim1 : n.size === Style$1.SCRIPTSCRIPT.size ? t.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : t.fontMetrics().delim2, C = e.leftDelim == null ? makeNullDelimiter(t, ["mopen"]) : delimiter.customSizedDelim(e.leftDelim, x, !0, t.havingStyle(n), e.mode, ["mopen"]), w = e.continued ? buildCommon.makeSpan([]) : e.rightDelim == null ? makeNullDelimiter(t, ["mclose"]) : delimiter.customSizedDelim(e.rightDelim, x, !0, t.havingStyle(n), e.mode, ["mclose"]);
18878
- return buildCommon.makeSpan(["mord"].concat(o.sizingClasses(t)), [
18796
+ var x = n.size === Style$1.DISPLAY.size ? t.fontMetrics().delim1 : n.size === Style$1.SCRIPTSCRIPT.size ? t.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : t.fontMetrics().delim2, C = e.leftDelim == null ? makeNullDelimiter(t, ["mopen"]) : makeCustomSizedDelim(e.leftDelim, x, !0, t.havingStyle(n), e.mode, ["mopen"]), w = e.continued ? makeSpan([]) : e.rightDelim == null ? makeNullDelimiter(t, ["mclose"]) : makeCustomSizedDelim(e.rightDelim, x, !0, t.havingStyle(n), e.mode, ["mclose"]);
18797
+ return makeSpan(["mord"].concat(o.sizingClasses(t)), [
18879
18798
  C,
18880
- buildCommon.makeSpan(["mfrac"], [_]),
18799
+ makeSpan(["mfrac"], [_]),
18881
18800
  w
18882
18801
  ], t);
18883
18802
  }, mathmlBuilder$3 = (e, t) => {
18884
- var n = new mathMLTree.MathNode("mfrac", [buildGroup(e.numer, t), buildGroup(e.denom, t)]);
18803
+ var n = new MathNode("mfrac", [buildGroup(e.numer, t), buildGroup(e.denom, t)]);
18885
18804
  if (!e.hasBarLine) n.setAttribute("linethickness", "0px");
18886
18805
  else if (e.barSize) {
18887
18806
  var r = calculateSize(e.barSize, t);
18888
18807
  n.setAttribute("linethickness", makeEm(r));
18889
18808
  }
18890
- var a = adjustStyle(e.size, t.style);
18891
- if (a.size !== t.style.size) {
18892
- n = new mathMLTree.MathNode("mstyle", [n]);
18893
- var o = a.size === Style$1.DISPLAY.size ? "true" : "false";
18894
- n.setAttribute("displaystyle", o), n.setAttribute("scriptlevel", "0");
18895
- }
18896
18809
  if (e.leftDelim != null || e.rightDelim != null) {
18897
- var s = [];
18810
+ var a = [];
18898
18811
  if (e.leftDelim != null) {
18899
- var c = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(e.leftDelim.replace("\\", ""))]);
18900
- c.setAttribute("fence", "true"), s.push(c);
18812
+ var o = new MathNode("mo", [new TextNode(e.leftDelim.replace("\\", ""))]);
18813
+ o.setAttribute("fence", "true"), a.push(o);
18901
18814
  }
18902
- if (s.push(n), e.rightDelim != null) {
18903
- var l = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(e.rightDelim.replace("\\", ""))]);
18904
- l.setAttribute("fence", "true"), s.push(l);
18815
+ if (a.push(n), e.rightDelim != null) {
18816
+ var s = new MathNode("mo", [new TextNode(e.rightDelim.replace("\\", ""))]);
18817
+ s.setAttribute("fence", "true"), a.push(s);
18905
18818
  }
18906
- return makeRow(s);
18819
+ return makeRow(a);
18907
18820
  }
18908
18821
  return n;
18909
- };
18822
+ }, wrapWithStyle = (e, t) => t ? {
18823
+ type: "styling",
18824
+ mode: e.mode,
18825
+ style: t,
18826
+ body: [e]
18827
+ } : e;
18910
18828
  defineFunction({
18911
18829
  type: "genfrac",
18912
18830
  names: [
18831
+ "\\cfrac",
18913
18832
  "\\dfrac",
18914
18833
  "\\frac",
18915
18834
  "\\tfrac",
@@ -18925,8 +18844,9 @@ defineFunction({
18925
18844
  allowedInArgument: !0
18926
18845
  },
18927
18846
  handler: (e, t) => {
18928
- var { parser: n, funcName: r } = e, a = t[0], o = t[1], s, c = null, l = null, u = "auto";
18847
+ var { parser: n, funcName: r } = e, a = t[0], o = t[1], s, c = null, l = null;
18929
18848
  switch (r) {
18849
+ case "\\cfrac":
18930
18850
  case "\\dfrac":
18931
18851
  case "\\frac":
18932
18852
  case "\\tfrac":
@@ -18948,50 +18868,21 @@ defineFunction({
18948
18868
  break;
18949
18869
  default: throw Error("Unrecognized genfrac command");
18950
18870
  }
18951
- switch (r) {
18952
- case "\\dfrac":
18953
- case "\\dbinom":
18954
- u = "display";
18955
- break;
18956
- case "\\tfrac":
18957
- case "\\tbinom":
18958
- u = "text";
18959
- break;
18960
- }
18961
- return {
18871
+ var u = r === "\\cfrac", d = null;
18872
+ return u || r.startsWith("\\d") ? d = "display" : r.startsWith("\\t") && (d = "text"), wrapWithStyle({
18962
18873
  type: "genfrac",
18963
18874
  mode: n.mode,
18964
- continued: !1,
18965
18875
  numer: a,
18966
18876
  denom: o,
18877
+ continued: u,
18967
18878
  hasBarLine: s,
18968
18879
  leftDelim: c,
18969
18880
  rightDelim: l,
18970
- size: u,
18971
18881
  barSize: null
18972
- };
18882
+ }, d);
18973
18883
  },
18974
18884
  htmlBuilder: htmlBuilder$4,
18975
18885
  mathmlBuilder: mathmlBuilder$3
18976
- }), defineFunction({
18977
- type: "genfrac",
18978
- names: ["\\cfrac"],
18979
- props: { numArgs: 2 },
18980
- handler: (e, t) => {
18981
- var { parser: n, funcName: r } = e, a = t[0], o = t[1];
18982
- return {
18983
- type: "genfrac",
18984
- mode: n.mode,
18985
- continued: !0,
18986
- numer: a,
18987
- denom: o,
18988
- hasBarLine: !0,
18989
- leftDelim: null,
18990
- rightDelim: null,
18991
- size: "display",
18992
- barSize: null
18993
- };
18994
- }
18995
18886
  }), defineFunction({
18996
18887
  type: "infix",
18997
18888
  names: [
@@ -19060,14 +18951,14 @@ defineFunction({
19060
18951
  handler(e, t) {
19061
18952
  var { parser: n } = e, r = t[4], a = t[5], o = normalizeArgument(t[0]), s = o.type === "atom" && o.family === "open" ? delimFromValue(o.text) : null, c = normalizeArgument(t[1]), l = c.type === "atom" && c.family === "close" ? delimFromValue(c.text) : null, u = assertNodeType(t[2], "size"), d, f = null;
19062
18953
  u.isBlank ? d = !0 : (f = u.value, d = f.number > 0);
19063
- var p = "auto", m = t[3];
18954
+ var p = null, m = t[3];
19064
18955
  if (m.type === "ordgroup") {
19065
18956
  if (m.body.length > 0) {
19066
18957
  var h = assertNodeType(m.body[0], "textord");
19067
18958
  p = stylArray[Number(h.text)];
19068
18959
  }
19069
18960
  } else m = assertNodeType(m, "textord"), p = stylArray[Number(m.text)];
19070
- return {
18961
+ return wrapWithStyle({
19071
18962
  type: "genfrac",
19072
18963
  mode: n.mode,
19073
18964
  numer: r,
@@ -19076,12 +18967,9 @@ defineFunction({
19076
18967
  hasBarLine: d,
19077
18968
  barSize: f,
19078
18969
  leftDelim: s,
19079
- rightDelim: l,
19080
- size: p
19081
- };
19082
- },
19083
- htmlBuilder: htmlBuilder$4,
19084
- mathmlBuilder: mathmlBuilder$3
18970
+ rightDelim: l
18971
+ }, p);
18972
+ }
19085
18973
  }), defineFunction({
19086
18974
  type: "infix",
19087
18975
  names: ["\\above"],
@@ -19112,7 +19000,9 @@ defineFunction({
19112
19000
  ]
19113
19001
  },
19114
19002
  handler: (e, t) => {
19115
- var { parser: n, funcName: r } = e, a = t[0], o = assert(assertNodeType(t[1], "infix").size), s = t[2], c = o.number > 0;
19003
+ var { parser: n, funcName: r } = e, a = t[0], o = assertNodeType(t[1], "infix").size;
19004
+ if (!o) throw Error("\\\\abovefrac expected size, but got " + String(o));
19005
+ var s = t[2], c = o.number > 0;
19116
19006
  return {
19117
19007
  type: "genfrac",
19118
19008
  mode: n.mode,
@@ -19122,18 +19012,15 @@ defineFunction({
19122
19012
  hasBarLine: c,
19123
19013
  barSize: o,
19124
19014
  leftDelim: null,
19125
- rightDelim: null,
19126
- size: "auto"
19015
+ rightDelim: null
19127
19016
  };
19128
- },
19129
- htmlBuilder: htmlBuilder$4,
19130
- mathmlBuilder: mathmlBuilder$3
19017
+ }
19131
19018
  });
19132
19019
  var htmlBuilder$3 = (e, t) => {
19133
19020
  var n = t.style, r, a;
19134
19021
  e.type === "supsub" ? (r = e.sup ? buildGroup$1(e.sup, t.havingStyle(n.sup()), t) : buildGroup$1(e.sub, t.havingStyle(n.sub()), t), a = assertNodeType(e.base, "horizBrace")) : a = assertNodeType(e, "horizBrace");
19135
- var o = buildGroup$1(a.base, t.havingBaseStyle(Style$1.DISPLAY)), s = stretchy.svgSpan(a, t), c;
19136
- if (a.isOver ? (c = buildCommon.makeVList({
19022
+ var o = buildGroup$1(a.base, t.havingBaseStyle(Style$1.DISPLAY)), s = stretchySvg(a, t), c;
19023
+ if (a.isOver ? (c = makeVList({
19137
19024
  positionType: "firstBaseline",
19138
19025
  children: [
19139
19026
  {
@@ -19149,7 +19036,7 @@ var htmlBuilder$3 = (e, t) => {
19149
19036
  elem: s
19150
19037
  }
19151
19038
  ]
19152
- }, t), c.children[0].children[0].children[1].classes.push("svg-align")) : (c = buildCommon.makeVList({
19039
+ }), c.children[0].children[0].children[1].classes.push("svg-align")) : (c = makeVList({
19153
19040
  positionType: "bottom",
19154
19041
  positionData: o.depth + .1 + s.height,
19155
19042
  children: [
@@ -19166,9 +19053,9 @@ var htmlBuilder$3 = (e, t) => {
19166
19053
  elem: o
19167
19054
  }
19168
19055
  ]
19169
- }, t), c.children[0].children[0].children[0].classes.push("svg-align")), r) {
19170
- var l = buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], t);
19171
- c = a.isOver ? buildCommon.makeVList({
19056
+ }), c.children[0].children[0].children[0].classes.push("svg-align")), r) {
19057
+ var l = makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], t);
19058
+ c = a.isOver ? makeVList({
19172
19059
  positionType: "firstBaseline",
19173
19060
  children: [
19174
19061
  {
@@ -19184,7 +19071,7 @@ var htmlBuilder$3 = (e, t) => {
19184
19071
  elem: r
19185
19072
  }
19186
19073
  ]
19187
- }, t) : buildCommon.makeVList({
19074
+ }) : makeVList({
19188
19075
  positionType: "bottom",
19189
19076
  positionData: l.depth + .2 + r.height + r.depth,
19190
19077
  children: [
@@ -19201,9 +19088,9 @@ var htmlBuilder$3 = (e, t) => {
19201
19088
  elem: l
19202
19089
  }
19203
19090
  ]
19204
- }, t);
19091
+ });
19205
19092
  }
19206
- return buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], t);
19093
+ return makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], t);
19207
19094
  };
19208
19095
  defineFunction({
19209
19096
  type: "horizBrace",
@@ -19221,8 +19108,8 @@ defineFunction({
19221
19108
  },
19222
19109
  htmlBuilder: htmlBuilder$3,
19223
19110
  mathmlBuilder: (e, t) => {
19224
- var n = stretchy.mathMLnode(e.label);
19225
- return new mathMLTree.MathNode(e.isOver ? "mover" : "munder", [buildGroup(e.base, t), n]);
19111
+ var n = stretchyMathML(e.label);
19112
+ return new MathNode(e.isOver ? "mover" : "munder", [buildGroup(e.base, t), n]);
19226
19113
  }
19227
19114
  }), defineFunction({
19228
19115
  type: "href",
@@ -19246,7 +19133,7 @@ defineFunction({
19246
19133
  },
19247
19134
  htmlBuilder: (e, t) => {
19248
19135
  var n = buildExpression$1(e.body, t, !1);
19249
- return buildCommon.makeAnchor(e.href, [], n, t);
19136
+ return makeAnchor(e.href, [], n, t);
19250
19137
  },
19251
19138
  mathmlBuilder: (e, t) => {
19252
19139
  var n = buildExpressionRow(e.body, t);
@@ -19305,11 +19192,10 @@ defineFunction({
19305
19192
  };
19306
19193
  },
19307
19194
  htmlBuilder(e, t) {
19308
- var n = buildExpression$1(e.body, t, !1);
19309
- return buildCommon.makeFragment(n);
19195
+ return makeFragment(buildExpression$1(e.body, t, !1));
19310
19196
  },
19311
19197
  mathmlBuilder(e, t) {
19312
- return new mathMLTree.MathNode("mrow", buildExpression(e.body, t));
19198
+ return new MathNode("mrow", buildExpression(e.body, t));
19313
19199
  }
19314
19200
  }), defineFunction({
19315
19201
  type: "html",
@@ -19371,7 +19257,7 @@ defineFunction({
19371
19257
  htmlBuilder: (e, t) => {
19372
19258
  var n = buildExpression$1(e.body, t, !1), r = ["enclosing"];
19373
19259
  e.attributes.class && r.push(...e.attributes.class.trim().split(/\s+/));
19374
- var a = buildCommon.makeSpan(r, n, t);
19260
+ var a = makeSpan(r, n, t);
19375
19261
  for (var o in e.attributes) o !== "class" && e.attributes.hasOwnProperty(o) && a.setAttribute(o, e.attributes[o]);
19376
19262
  return a;
19377
19263
  },
@@ -19381,6 +19267,7 @@ defineFunction({
19381
19267
  names: ["\\html@mathml"],
19382
19268
  props: {
19383
19269
  numArgs: 2,
19270
+ allowedInArgument: !0,
19384
19271
  allowedInText: !0
19385
19272
  },
19386
19273
  handler: (e, t) => {
@@ -19392,10 +19279,7 @@ defineFunction({
19392
19279
  mathml: ordargument(t[1])
19393
19280
  };
19394
19281
  },
19395
- htmlBuilder: (e, t) => {
19396
- var n = buildExpression$1(e.html, t, !1);
19397
- return buildCommon.makeFragment(n);
19398
- },
19282
+ htmlBuilder: (e, t) => makeFragment(buildExpression$1(e.html, t, !1)),
19399
19283
  mathmlBuilder: (e, t) => buildExpressionRow(e.mathml, t)
19400
19284
  });
19401
19285
  var sizeData = function(e) {
@@ -19478,7 +19362,7 @@ defineFunction({
19478
19362
  return s.height = n, s.depth = r, s;
19479
19363
  },
19480
19364
  mathmlBuilder: (e, t) => {
19481
- var n = new mathMLTree.MathNode("mglyph", []);
19365
+ var n = new MathNode("mglyph", []);
19482
19366
  n.setAttribute("alt", e.alt);
19483
19367
  var r = calculateSize(e.height, t), a = 0;
19484
19368
  if (e.totalheight.number > 0 && (a = calculateSize(e.totalheight, t) - r, n.setAttribute("valign", makeEm(-a))), n.setAttribute("height", makeEm(r + a)), e.width.number > 0) {
@@ -19514,11 +19398,10 @@ defineFunction({
19514
19398
  };
19515
19399
  },
19516
19400
  htmlBuilder(e, t) {
19517
- return buildCommon.makeGlue(e.dimension, t);
19401
+ return makeGlue(e.dimension, t);
19518
19402
  },
19519
19403
  mathmlBuilder(e, t) {
19520
- var n = calculateSize(e.dimension, t);
19521
- return new mathMLTree.SpaceNode(n);
19404
+ return new SpaceNode(calculateSize(e.dimension, t));
19522
19405
  }
19523
19406
  }), defineFunction({
19524
19407
  type: "lap",
@@ -19542,12 +19425,12 @@ defineFunction({
19542
19425
  },
19543
19426
  htmlBuilder: (e, t) => {
19544
19427
  var n;
19545
- e.alignment === "clap" ? (n = buildCommon.makeSpan([], [buildGroup$1(e.body, t)]), n = buildCommon.makeSpan(["inner"], [n], t)) : n = buildCommon.makeSpan(["inner"], [buildGroup$1(e.body, t)]);
19546
- var r = buildCommon.makeSpan(["fix"], []), a = buildCommon.makeSpan([e.alignment], [n, r], t), o = buildCommon.makeSpan(["strut"]);
19547
- return o.style.height = makeEm(a.height + a.depth), a.depth && (o.style.verticalAlign = makeEm(-a.depth)), a.children.unshift(o), a = buildCommon.makeSpan(["thinbox"], [a], t), buildCommon.makeSpan(["mord", "vbox"], [a], t);
19428
+ e.alignment === "clap" ? (n = makeSpan([], [buildGroup$1(e.body, t)]), n = makeSpan(["inner"], [n], t)) : n = makeSpan(["inner"], [buildGroup$1(e.body, t)]);
19429
+ var r = makeSpan(["fix"], []), a = makeSpan([e.alignment], [n, r], t), o = makeSpan(["strut"]);
19430
+ return o.style.height = makeEm(a.height + a.depth), a.depth && (o.style.verticalAlign = makeEm(-a.depth)), a.children.unshift(o), a = makeSpan(["thinbox"], [a], t), makeSpan(["mord", "vbox"], [a], t);
19548
19431
  },
19549
19432
  mathmlBuilder: (e, t) => {
19550
- var n = new mathMLTree.MathNode("mpadded", [buildGroup(e.body, t)]);
19433
+ var n = new MathNode("mpadded", [buildGroup(e.body, t)]);
19551
19434
  if (e.alignment !== "rlap") {
19552
19435
  var r = e.alignment === "llap" ? "-1" : "-0.5";
19553
19436
  n.setAttribute("lspace", r + "width");
@@ -19612,140 +19495,131 @@ defineFunction({
19612
19495
  scriptscript: ordargument(t[3])
19613
19496
  };
19614
19497
  },
19615
- htmlBuilder: (e, t) => {
19616
- var n = buildExpression$1(chooseMathStyle(e, t), t, !1);
19617
- return buildCommon.makeFragment(n);
19618
- },
19498
+ htmlBuilder: (e, t) => makeFragment(buildExpression$1(chooseMathStyle(e, t), t, !1)),
19619
19499
  mathmlBuilder: (e, t) => buildExpressionRow(chooseMathStyle(e, t), t)
19620
19500
  });
19621
19501
  var assembleSupSub = (e, t, n, r, a, o, s) => {
19622
- e = buildCommon.makeSpan([], [e]);
19623
- var c = n && utils.isCharacterBox(n), l, u;
19502
+ e = makeSpan([], [e]);
19503
+ var c = n && isCharacterBox(n), l, u;
19624
19504
  if (t) {
19625
- var d = buildGroup$1(t, r.havingStyle(a.sup()), r);
19505
+ var f = buildGroup$1(t, r.havingStyle(a.sup()), r);
19626
19506
  u = {
19627
- elem: d,
19628
- kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - d.depth)
19507
+ elem: f,
19508
+ kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - f.depth)
19629
19509
  };
19630
19510
  }
19631
19511
  if (n) {
19632
- var f = buildGroup$1(n, r.havingStyle(a.sub()), r);
19512
+ var p = buildGroup$1(n, r.havingStyle(a.sub()), r);
19633
19513
  l = {
19634
- elem: f,
19635
- kern: Math.max(r.fontMetrics().bigOpSpacing2, r.fontMetrics().bigOpSpacing4 - f.height)
19514
+ elem: p,
19515
+ kern: Math.max(r.fontMetrics().bigOpSpacing2, r.fontMetrics().bigOpSpacing4 - p.height)
19636
19516
  };
19637
19517
  }
19638
19518
  var m;
19639
- if (u && l) {
19640
- var h = r.fontMetrics().bigOpSpacing5 + l.elem.height + l.elem.depth + l.kern + e.depth + s;
19641
- m = buildCommon.makeVList({
19642
- positionType: "bottom",
19643
- positionData: h,
19644
- children: [
19645
- {
19646
- type: "kern",
19647
- size: r.fontMetrics().bigOpSpacing5
19648
- },
19649
- {
19650
- type: "elem",
19651
- elem: l.elem,
19652
- marginLeft: makeEm(-o)
19653
- },
19654
- {
19655
- type: "kern",
19656
- size: l.kern
19657
- },
19658
- {
19659
- type: "elem",
19660
- elem: e
19661
- },
19662
- {
19663
- type: "kern",
19664
- size: u.kern
19665
- },
19666
- {
19667
- type: "elem",
19668
- elem: u.elem,
19669
- marginLeft: makeEm(o)
19670
- },
19671
- {
19672
- type: "kern",
19673
- size: r.fontMetrics().bigOpSpacing5
19674
- }
19675
- ]
19676
- }, r);
19677
- } else if (l) {
19678
- var g = e.height - s;
19679
- m = buildCommon.makeVList({
19680
- positionType: "top",
19681
- positionData: g,
19682
- children: [
19683
- {
19684
- type: "kern",
19685
- size: r.fontMetrics().bigOpSpacing5
19686
- },
19687
- {
19688
- type: "elem",
19689
- elem: l.elem,
19690
- marginLeft: makeEm(-o)
19691
- },
19692
- {
19693
- type: "kern",
19694
- size: l.kern
19695
- },
19696
- {
19697
- type: "elem",
19698
- elem: e
19699
- }
19700
- ]
19701
- }, r);
19702
- } else if (u) {
19703
- var _ = e.depth + s;
19704
- m = buildCommon.makeVList({
19705
- positionType: "bottom",
19706
- positionData: _,
19707
- children: [
19708
- {
19709
- type: "elem",
19710
- elem: e
19711
- },
19712
- {
19713
- type: "kern",
19714
- size: u.kern
19715
- },
19716
- {
19717
- type: "elem",
19718
- elem: u.elem,
19719
- marginLeft: makeEm(o)
19720
- },
19721
- {
19722
- type: "kern",
19723
- size: r.fontMetrics().bigOpSpacing5
19724
- }
19725
- ]
19726
- }, r);
19727
- } else return e;
19728
- var v = [m];
19519
+ if (u && l) m = makeVList({
19520
+ positionType: "bottom",
19521
+ positionData: r.fontMetrics().bigOpSpacing5 + l.elem.height + l.elem.depth + l.kern + e.depth + s,
19522
+ children: [
19523
+ {
19524
+ type: "kern",
19525
+ size: r.fontMetrics().bigOpSpacing5
19526
+ },
19527
+ {
19528
+ type: "elem",
19529
+ elem: l.elem,
19530
+ marginLeft: makeEm(-o)
19531
+ },
19532
+ {
19533
+ type: "kern",
19534
+ size: l.kern
19535
+ },
19536
+ {
19537
+ type: "elem",
19538
+ elem: e
19539
+ },
19540
+ {
19541
+ type: "kern",
19542
+ size: u.kern
19543
+ },
19544
+ {
19545
+ type: "elem",
19546
+ elem: u.elem,
19547
+ marginLeft: makeEm(o)
19548
+ },
19549
+ {
19550
+ type: "kern",
19551
+ size: r.fontMetrics().bigOpSpacing5
19552
+ }
19553
+ ]
19554
+ });
19555
+ else if (l) m = makeVList({
19556
+ positionType: "top",
19557
+ positionData: e.height - s,
19558
+ children: [
19559
+ {
19560
+ type: "kern",
19561
+ size: r.fontMetrics().bigOpSpacing5
19562
+ },
19563
+ {
19564
+ type: "elem",
19565
+ elem: l.elem,
19566
+ marginLeft: makeEm(-o)
19567
+ },
19568
+ {
19569
+ type: "kern",
19570
+ size: l.kern
19571
+ },
19572
+ {
19573
+ type: "elem",
19574
+ elem: e
19575
+ }
19576
+ ]
19577
+ });
19578
+ else if (u) m = makeVList({
19579
+ positionType: "bottom",
19580
+ positionData: e.depth + s,
19581
+ children: [
19582
+ {
19583
+ type: "elem",
19584
+ elem: e
19585
+ },
19586
+ {
19587
+ type: "kern",
19588
+ size: u.kern
19589
+ },
19590
+ {
19591
+ type: "elem",
19592
+ elem: u.elem,
19593
+ marginLeft: makeEm(o)
19594
+ },
19595
+ {
19596
+ type: "kern",
19597
+ size: r.fontMetrics().bigOpSpacing5
19598
+ }
19599
+ ]
19600
+ });
19601
+ else return e;
19602
+ var h = [m];
19729
19603
  if (l && o !== 0 && !c) {
19730
- var y = buildCommon.makeSpan(["mspace"], [], r);
19731
- y.style.marginRight = makeEm(o), v.unshift(y);
19604
+ var g = makeSpan(["mspace"], [], r);
19605
+ g.style.marginRight = makeEm(o), h.unshift(g);
19732
19606
  }
19733
- return buildCommon.makeSpan(["mop", "op-limits"], v, r);
19734
- }, noSuccessor = ["\\smallint"], htmlBuilder$2 = (e, t) => {
19607
+ return makeSpan(["mop", "op-limits"], h, r);
19608
+ }, noSuccessor = new Set(["\\smallint"]), htmlBuilder$2 = (e, t) => {
19735
19609
  var n, r, a = !1, o;
19736
19610
  e.type === "supsub" ? (n = e.sup, r = e.sub, o = assertNodeType(e.base, "op"), a = !0) : o = assertNodeType(e, "op");
19737
19611
  var s = t.style, c = !1;
19738
- s.size === Style$1.DISPLAY.size && o.symbol && !noSuccessor.includes(o.name) && (c = !0);
19612
+ s.size === Style$1.DISPLAY.size && o.symbol && !noSuccessor.has(o.name) && (c = !0);
19739
19613
  var l;
19740
19614
  if (o.symbol) {
19741
19615
  var u = c ? "Size2-Regular" : "Size1-Regular", d = "";
19742
- if ((o.name === "\\oiint" || o.name === "\\oiiint") && (d = o.name.slice(1), o.name = d === "oiint" ? "\\iint" : "\\iiint"), l = buildCommon.makeSymbol(o.name, u, "math", t, [
19616
+ if ((o.name === "\\oiint" || o.name === "\\oiiint") && (d = o.name.slice(1), o.name = d === "oiint" ? "\\iint" : "\\iiint"), l = makeSymbol(o.name, u, "math", t, [
19743
19617
  "mop",
19744
19618
  "op-symbol",
19745
19619
  c ? "large-op" : "small-op"
19746
19620
  ]), d.length > 0) {
19747
- var f = l.italic, p = buildCommon.staticSvg(d + "Size" + (c ? "2" : "1"), t);
19748
- l = buildCommon.makeVList({
19621
+ var f = l.italic, p = staticSvg(d + "Size" + (c ? "2" : "1"), t);
19622
+ l = makeVList({
19749
19623
  positionType: "individualShift",
19750
19624
  children: [{
19751
19625
  type: "elem",
@@ -19756,20 +19630,20 @@ var assembleSupSub = (e, t, n, r, a, o, s) => {
19756
19630
  elem: p,
19757
19631
  shift: c ? .08 : 0
19758
19632
  }]
19759
- }, t), o.name = "\\" + d, l.classes.unshift("mop"), l.italic = f;
19633
+ }), o.name = "\\" + d, l.classes.unshift("mop"), l.italic = f;
19760
19634
  }
19761
19635
  } else if (o.body) {
19762
19636
  var m = buildExpression$1(o.body, t, !0);
19763
- m.length === 1 && m[0] instanceof SymbolNode ? (l = m[0], l.classes[0] = "mop") : l = buildCommon.makeSpan(["mop"], m, t);
19637
+ m.length === 1 && m[0] instanceof SymbolNode ? (l = m[0], l.classes[0] = "mop") : l = makeSpan(["mop"], m, t);
19764
19638
  } else {
19765
- for (var h = [], g = 1; g < o.name.length; g++) h.push(buildCommon.mathsym(o.name[g], o.mode, t));
19766
- l = buildCommon.makeSpan(["mop"], h, t);
19639
+ for (var h = [], g = 1; g < o.name.length; g++) h.push(mathsym(o.name[g], o.mode, t));
19640
+ l = makeSpan(["mop"], h, t);
19767
19641
  }
19768
19642
  var _ = 0, v = 0;
19769
19643
  return (l instanceof SymbolNode || o.name === "\\oiint" || o.name === "\\oiiint") && !o.suppressBaseShift && (_ = (l.height - l.depth) / 2 - t.fontMetrics().axisHeight, v = l.italic), a ? assembleSupSub(l, n, r, t, s, v, _) : (_ && (l.style.position = "relative", l.style.top = makeEm(_)), l);
19770
19644
  }, mathmlBuilder$1 = (e, t) => {
19771
19645
  var n;
19772
- if (e.symbol) n = new MathNode("mo", [makeText(e.name, e.mode)]), noSuccessor.includes(e.name) && n.setAttribute("largeop", "false");
19646
+ if (e.symbol) n = new MathNode("mo", [makeText(e.name, e.mode)]), noSuccessor.has(e.name) && n.setAttribute("largeop", "false");
19773
19647
  else if (e.body) n = new MathNode("mo", buildExpression(e.body, t));
19774
19648
  else {
19775
19649
  n = new MathNode("mi", [new TextNode(e.name.slice(1))]);
@@ -19930,8 +19804,8 @@ var htmlBuilder$1 = (e, t) => {
19930
19804
  var u = c[l];
19931
19805
  u instanceof SymbolNode && (u.text = u.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
19932
19806
  }
19933
- s = buildCommon.makeSpan(["mop"], c, t);
19934
- } else s = buildCommon.makeSpan(["mop"], [], t);
19807
+ s = makeSpan(["mop"], c, t);
19808
+ } else s = makeSpan(["mop"], [], t);
19935
19809
  return a ? assembleSupSub(s, n, r, t, t.style, 0, 0) : s;
19936
19810
  };
19937
19811
  defineFunction({
@@ -19953,7 +19827,7 @@ defineFunction({
19953
19827
  mathmlBuilder: (e, t) => {
19954
19828
  for (var n = buildExpression(e.body, t.withFont("mathrm")), r = !0, a = 0; a < n.length; a++) {
19955
19829
  var o = n[a];
19956
- if (!(o instanceof mathMLTree.SpaceNode)) if (o instanceof mathMLTree.MathNode) switch (o.type) {
19830
+ if (!(o instanceof SpaceNode)) if (o instanceof MathNode) switch (o.type) {
19957
19831
  case "mi":
19958
19832
  case "mn":
19959
19833
  case "ms":
@@ -19961,25 +19835,22 @@ defineFunction({
19961
19835
  case "mtext": break;
19962
19836
  case "mo":
19963
19837
  var s = o.children[0];
19964
- o.children.length === 1 && s instanceof mathMLTree.TextNode ? s.text = s.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : r = !1;
19838
+ o.children.length === 1 && s instanceof TextNode ? s.text = s.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : r = !1;
19965
19839
  break;
19966
19840
  default: r = !1;
19967
19841
  }
19968
19842
  else r = !1;
19969
19843
  }
19970
- if (r) {
19971
- var c = n.map((e) => e.toText()).join("");
19972
- n = [new mathMLTree.TextNode(c)];
19973
- }
19974
- var l = new mathMLTree.MathNode("mi", n);
19975
- l.setAttribute("mathvariant", "normal");
19976
- var u = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]);
19977
- return e.parentIsSupSub ? new mathMLTree.MathNode("mrow", [l, u]) : mathMLTree.newDocumentFragment([l, u]);
19844
+ r && (n = [new TextNode(n.map((e) => e.toText()).join(""))]);
19845
+ var c = new MathNode("mi", n);
19846
+ c.setAttribute("mathvariant", "normal");
19847
+ var l = new MathNode("mo", [makeText("⁡", "text")]);
19848
+ return e.parentIsSupSub ? new MathNode("mrow", [c, l]) : newDocumentFragment([c, l]);
19978
19849
  }
19979
19850
  }), defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"), defineFunctionBuilders({
19980
19851
  type: "ordgroup",
19981
19852
  htmlBuilder(e, t) {
19982
- return e.semisimple ? buildCommon.makeFragment(buildExpression$1(e.body, t, !1)) : buildCommon.makeSpan(["mord"], buildExpression$1(e.body, t, !0), t);
19853
+ return e.semisimple ? makeFragment(buildExpression$1(e.body, t, !1)) : makeSpan(["mord"], buildExpression$1(e.body, t, !0), t);
19983
19854
  },
19984
19855
  mathmlBuilder(e, t) {
19985
19856
  return buildExpressionRow(e.body, t, !0);
@@ -19997,7 +19868,8 @@ defineFunction({
19997
19868
  };
19998
19869
  },
19999
19870
  htmlBuilder(e, t) {
20000
- var n = buildGroup$1(e.body, t.havingCrampedStyle()), r = buildCommon.makeLineSpan("overline-line", t), a = t.fontMetrics().defaultRuleThickness, o = buildCommon.makeVList({
19871
+ var n = buildGroup$1(e.body, t.havingCrampedStyle()), r = makeLineSpan("overline-line", t), a = t.fontMetrics().defaultRuleThickness;
19872
+ return makeSpan(["mord", "overline"], [makeVList({
20001
19873
  positionType: "firstBaseline",
20002
19874
  children: [
20003
19875
  {
@@ -20017,13 +19889,12 @@ defineFunction({
20017
19889
  size: a
20018
19890
  }
20019
19891
  ]
20020
- }, t);
20021
- return buildCommon.makeSpan(["mord", "overline"], [o], t);
19892
+ })], t);
20022
19893
  },
20023
19894
  mathmlBuilder(e, t) {
20024
- var n = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
19895
+ var n = new MathNode("mo", [new TextNode("‾")]);
20025
19896
  n.setAttribute("stretchy", "true");
20026
- var r = new mathMLTree.MathNode("mover", [buildGroup(e.body, t), n]);
19897
+ var r = new MathNode("mover", [buildGroup(e.body, t), n]);
20027
19898
  return r.setAttribute("accent", "true"), r;
20028
19899
  }
20029
19900
  }), defineFunction({
@@ -20041,14 +19912,8 @@ defineFunction({
20041
19912
  body: ordargument(r)
20042
19913
  };
20043
19914
  },
20044
- htmlBuilder: (e, t) => {
20045
- var n = buildExpression$1(e.body, t.withPhantom(), !1);
20046
- return buildCommon.makeFragment(n);
20047
- },
20048
- mathmlBuilder: (e, t) => {
20049
- var n = buildExpression(e.body, t);
20050
- return new mathMLTree.MathNode("mphantom", n);
20051
- }
19915
+ htmlBuilder: (e, t) => makeFragment(buildExpression$1(e.body, t.withPhantom(), !1)),
19916
+ mathmlBuilder: (e, t) => new MathNode("mphantom", buildExpression(e.body, t))
20052
19917
  }), defineFunction({
20053
19918
  type: "hphantom",
20054
19919
  names: ["\\hphantom"],
@@ -20065,19 +19930,19 @@ defineFunction({
20065
19930
  };
20066
19931
  },
20067
19932
  htmlBuilder: (e, t) => {
20068
- var n = buildCommon.makeSpan([], [buildGroup$1(e.body, t.withPhantom())]);
19933
+ var n = makeSpan([], [buildGroup$1(e.body, t.withPhantom())]);
20069
19934
  if (n.height = 0, n.depth = 0, n.children) for (var r = 0; r < n.children.length; r++) n.children[r].height = 0, n.children[r].depth = 0;
20070
- return n = buildCommon.makeVList({
19935
+ return n = makeVList({
20071
19936
  positionType: "firstBaseline",
20072
19937
  children: [{
20073
19938
  type: "elem",
20074
19939
  elem: n
20075
19940
  }]
20076
- }, t), buildCommon.makeSpan(["mord"], [n], t);
19941
+ }), makeSpan(["mord"], [n], t);
20077
19942
  },
20078
19943
  mathmlBuilder: (e, t) => {
20079
- var n = buildExpression(ordargument(e.body), t), r = new mathMLTree.MathNode("mphantom", n), a = new mathMLTree.MathNode("mpadded", [r]);
20080
- return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
19944
+ var n = new MathNode("mpadded", [new MathNode("mphantom", buildExpression(ordargument(e.body), t))]);
19945
+ return n.setAttribute("height", "0px"), n.setAttribute("depth", "0px"), n;
20081
19946
  }
20082
19947
  }), defineFunction({
20083
19948
  type: "vphantom",
@@ -20094,13 +19959,10 @@ defineFunction({
20094
19959
  body: r
20095
19960
  };
20096
19961
  },
20097
- htmlBuilder: (e, t) => {
20098
- var n = buildCommon.makeSpan(["inner"], [buildGroup$1(e.body, t.withPhantom())]), r = buildCommon.makeSpan(["fix"], []);
20099
- return buildCommon.makeSpan(["mord", "rlap"], [n, r], t);
20100
- },
19962
+ htmlBuilder: (e, t) => makeSpan(["mord", "rlap"], [makeSpan(["inner"], [buildGroup$1(e.body, t.withPhantom())]), makeSpan(["fix"], [])], t),
20101
19963
  mathmlBuilder: (e, t) => {
20102
- var n = buildExpression(ordargument(e.body), t), r = new mathMLTree.MathNode("mphantom", n), a = new mathMLTree.MathNode("mpadded", [r]);
20103
- return a.setAttribute("width", "0px"), a;
19964
+ var n = new MathNode("mpadded", [new MathNode("mphantom", buildExpression(ordargument(e.body), t))]);
19965
+ return n.setAttribute("width", "0px"), n;
20104
19966
  }
20105
19967
  }), defineFunction({
20106
19968
  type: "raisebox",
@@ -20120,18 +19982,18 @@ defineFunction({
20120
19982
  };
20121
19983
  },
20122
19984
  htmlBuilder(e, t) {
20123
- var n = buildGroup$1(e.body, t), r = calculateSize(e.dy, t);
20124
- return buildCommon.makeVList({
19985
+ var n = buildGroup$1(e.body, t);
19986
+ return makeVList({
20125
19987
  positionType: "shift",
20126
- positionData: -r,
19988
+ positionData: -calculateSize(e.dy, t),
20127
19989
  children: [{
20128
19990
  type: "elem",
20129
19991
  elem: n
20130
19992
  }]
20131
- }, t);
19993
+ });
20132
19994
  },
20133
19995
  mathmlBuilder(e, t) {
20134
- var n = new mathMLTree.MathNode("mpadded", [buildGroup(e.body, t)]), r = e.dy.number + e.dy.unit;
19996
+ var n = new MathNode("mpadded", [buildGroup(e.body, t)]), r = e.dy.number + e.dy.unit;
20135
19997
  return n.setAttribute("voffset", r), n;
20136
19998
  }
20137
19999
  }), defineFunction({
@@ -20174,13 +20036,13 @@ defineFunction({
20174
20036
  };
20175
20037
  },
20176
20038
  htmlBuilder(e, t) {
20177
- var n = buildCommon.makeSpan(["mord", "rule"], [], t), r = calculateSize(e.width, t), a = calculateSize(e.height, t), o = e.shift ? calculateSize(e.shift, t) : 0;
20039
+ var n = makeSpan(["mord", "rule"], [], t), r = calculateSize(e.width, t), a = calculateSize(e.height, t), o = e.shift ? calculateSize(e.shift, t) : 0;
20178
20040
  return n.style.borderRightWidth = makeEm(r), n.style.borderTopWidth = makeEm(a), n.style.bottom = makeEm(o), n.width = r, n.height = a + o, n.depth = -o, n.maxFontSize = a * 1.125 * t.sizeMultiplier, n;
20179
20041
  },
20180
20042
  mathmlBuilder(e, t) {
20181
- var n = calculateSize(e.width, t), r = calculateSize(e.height, t), a = e.shift ? calculateSize(e.shift, t) : 0, o = t.color && t.getColor() || "black", s = new mathMLTree.MathNode("mspace");
20043
+ var n = calculateSize(e.width, t), r = calculateSize(e.height, t), a = e.shift ? calculateSize(e.shift, t) : 0, o = t.color && t.getColor() || "black", s = new MathNode("mspace");
20182
20044
  s.setAttribute("mathbackground", o), s.setAttribute("width", makeEm(n)), s.setAttribute("height", makeEm(r));
20183
- var c = new mathMLTree.MathNode("mpadded", [s]);
20045
+ var c = new MathNode("mpadded", [s]);
20184
20046
  return a >= 0 ? c.setAttribute("height", makeEm(a)) : (c.setAttribute("height", makeEm(a)), c.setAttribute("depth", makeEm(-a))), c.setAttribute("voffset", makeEm(a)), c;
20185
20047
  }
20186
20048
  });
@@ -20189,7 +20051,7 @@ function sizingGroup(e, t, n) {
20189
20051
  var s = r[o].classes.indexOf("sizing");
20190
20052
  s < 0 ? Array.prototype.push.apply(r[o].classes, t.sizingClasses(n)) : r[o].classes[s + 1] === "reset-size" + t.size && (r[o].classes[s + 1] = "reset-size" + n.size), r[o].height *= a, r[o].depth *= a;
20191
20053
  }
20192
- return buildCommon.makeFragment(r);
20054
+ return makeFragment(r);
20193
20055
  }
20194
20056
  var sizeFuncs = [
20195
20057
  "\\tiny",
@@ -20225,8 +20087,8 @@ defineFunction({
20225
20087
  return sizingGroup(e.body, n, t);
20226
20088
  },
20227
20089
  mathmlBuilder: (e, t) => {
20228
- var n = t.havingSize(e.size), r = buildExpression(e.body, n), a = new mathMLTree.MathNode("mstyle", r);
20229
- return a.setAttribute("mathsize", makeEm(n.sizeMultiplier)), a;
20090
+ var n = t.havingSize(e.size), r = new MathNode("mstyle", buildExpression(e.body, n));
20091
+ return r.setAttribute("mathsize", makeEm(n.sizeMultiplier)), r;
20230
20092
  }
20231
20093
  }), defineFunction({
20232
20094
  type: "smash",
@@ -20255,21 +20117,20 @@ defineFunction({
20255
20117
  };
20256
20118
  },
20257
20119
  htmlBuilder: (e, t) => {
20258
- var n = buildCommon.makeSpan([], [buildGroup$1(e.body, t)]);
20120
+ var n = makeSpan([], [buildGroup$1(e.body, t)]);
20259
20121
  if (!e.smashHeight && !e.smashDepth) return n;
20260
20122
  if (e.smashHeight && (n.height = 0, n.children)) for (var r = 0; r < n.children.length; r++) n.children[r].height = 0;
20261
20123
  if (e.smashDepth && (n.depth = 0, n.children)) for (var a = 0; a < n.children.length; a++) n.children[a].depth = 0;
20262
- var o = buildCommon.makeVList({
20124
+ return makeSpan(["mord"], [makeVList({
20263
20125
  positionType: "firstBaseline",
20264
20126
  children: [{
20265
20127
  type: "elem",
20266
20128
  elem: n
20267
20129
  }]
20268
- }, t);
20269
- return buildCommon.makeSpan(["mord"], [o], t);
20130
+ })], t);
20270
20131
  },
20271
20132
  mathmlBuilder: (e, t) => {
20272
- var n = new mathMLTree.MathNode("mpadded", [buildGroup(e.body, t)]);
20133
+ var n = new MathNode("mpadded", [buildGroup(e.body, t)]);
20273
20134
  return e.smashHeight && n.setAttribute("height", "0px"), e.smashDepth && n.setAttribute("depth", "0px"), n;
20274
20135
  }
20275
20136
  }), defineFunction({
@@ -20290,14 +20151,14 @@ defineFunction({
20290
20151
  },
20291
20152
  htmlBuilder(e, t) {
20292
20153
  var n = buildGroup$1(e.body, t.havingCrampedStyle());
20293
- n.height === 0 && (n.height = t.fontMetrics().xHeight), n = buildCommon.wrapFragment(n, t);
20154
+ n.height === 0 && (n.height = t.fontMetrics().xHeight), n = wrapFragment(n, t);
20294
20155
  var r = t.fontMetrics().defaultRuleThickness, a = r;
20295
20156
  t.style.id < Style$1.TEXT.id && (a = t.fontMetrics().xHeight);
20296
- var o = r + a / 4, s = n.height + n.depth + o + r, { span: c, ruleWidth: l, advanceWidth: u } = delimiter.sqrtImage(s, t), d = c.height - l;
20297
- d > n.height + n.depth + o && (o = (o + d - n.height - n.depth) / 2);
20298
- var f = c.height - n.height - o - l;
20299
- n.style.paddingLeft = makeEm(u);
20300
- var p = buildCommon.makeVList({
20157
+ var o = r + a / 4, { span: s, ruleWidth: c, advanceWidth: l } = makeSqrtImage(n.height + n.depth + o + r, t), u = s.height - c;
20158
+ u > n.height + n.depth + o && (o = (o + u - n.height - n.depth) / 2);
20159
+ var d = s.height - n.height - o - c;
20160
+ n.style.paddingLeft = makeEm(l);
20161
+ var f = makeVList({
20301
20162
  positionType: "firstBaseline",
20302
20163
  children: [
20303
20164
  {
@@ -20307,33 +20168,33 @@ defineFunction({
20307
20168
  },
20308
20169
  {
20309
20170
  type: "kern",
20310
- size: -(n.height + f)
20171
+ size: -(n.height + d)
20311
20172
  },
20312
20173
  {
20313
20174
  type: "elem",
20314
- elem: c
20175
+ elem: s
20315
20176
  },
20316
20177
  {
20317
20178
  type: "kern",
20318
- size: l
20179
+ size: c
20319
20180
  }
20320
20181
  ]
20321
- }, t);
20182
+ });
20322
20183
  if (e.index) {
20323
- var m = t.havingStyle(Style$1.SCRIPTSCRIPT), h = buildGroup$1(e.index, m, t), g = .6 * (p.height - p.depth), _ = buildCommon.makeVList({
20184
+ var p = t.havingStyle(Style$1.SCRIPTSCRIPT), m = buildGroup$1(e.index, p, t);
20185
+ return makeSpan(["mord", "sqrt"], [makeSpan(["root"], [makeVList({
20324
20186
  positionType: "shift",
20325
- positionData: -g,
20187
+ positionData: -(.6 * (f.height - f.depth)),
20326
20188
  children: [{
20327
20189
  type: "elem",
20328
- elem: h
20190
+ elem: m
20329
20191
  }]
20330
- }, t), v = buildCommon.makeSpan(["root"], [_]);
20331
- return buildCommon.makeSpan(["mord", "sqrt"], [v, p], t);
20332
- } else return buildCommon.makeSpan(["mord", "sqrt"], [p], t);
20192
+ })]), f], t);
20193
+ } else return makeSpan(["mord", "sqrt"], [f], t);
20333
20194
  },
20334
20195
  mathmlBuilder(e, t) {
20335
20196
  var { body: n, index: r } = e;
20336
- return r ? new mathMLTree.MathNode("mroot", [buildGroup(n, t), buildGroup(r, t)]) : new mathMLTree.MathNode("msqrt", [buildGroup(n, t)]);
20197
+ return r ? new MathNode("mroot", [buildGroup(n, t), buildGroup(r, t)]) : new MathNode("msqrt", [buildGroup(n, t)]);
20337
20198
  }
20338
20199
  });
20339
20200
  var styleMap = {
@@ -20369,32 +20230,32 @@ defineFunction({
20369
20230
  return sizingGroup(e.body, r, t);
20370
20231
  },
20371
20232
  mathmlBuilder(e, t) {
20372
- var n = styleMap[e.style], r = t.havingStyle(n), a = buildExpression(e.body, r), o = new mathMLTree.MathNode("mstyle", a), s = {
20233
+ var n = styleMap[e.style], r = t.havingStyle(n), a = new MathNode("mstyle", buildExpression(e.body, r)), o = {
20373
20234
  display: ["0", "true"],
20374
20235
  text: ["0", "false"],
20375
20236
  script: ["1", "false"],
20376
20237
  scriptscript: ["2", "false"]
20377
20238
  }[e.style];
20378
- return o.setAttribute("scriptlevel", s[0]), o.setAttribute("displaystyle", s[1]), o;
20239
+ return a.setAttribute("scriptlevel", o[0]), a.setAttribute("displaystyle", o[1]), a;
20379
20240
  }
20380
20241
  });
20381
20242
  var htmlBuilderDelegate = function(e, t) {
20382
20243
  var n = e.base;
20383
- return n ? n.type === "op" ? n.limits && (t.style.size === Style$1.DISPLAY.size || n.alwaysHandleSupSub) ? htmlBuilder$2 : null : n.type === "operatorname" ? n.alwaysHandleSupSub && (t.style.size === Style$1.DISPLAY.size || n.limits) ? htmlBuilder$1 : null : n.type === "accent" ? utils.isCharacterBox(n.base) ? htmlBuilder$a : null : n.type === "horizBrace" && !e.sub === n.isOver ? htmlBuilder$3 : null : null;
20244
+ return n ? n.type === "op" ? n.limits && (t.style.size === Style$1.DISPLAY.size || n.alwaysHandleSupSub) ? htmlBuilder$2 : null : n.type === "operatorname" ? n.alwaysHandleSupSub && (t.style.size === Style$1.DISPLAY.size || n.limits) ? htmlBuilder$1 : null : n.type === "accent" ? isCharacterBox(n.base) ? htmlBuilder$a : null : n.type === "horizBrace" && !e.sub === n.isOver ? htmlBuilder$3 : null : null;
20384
20245
  };
20385
20246
  defineFunctionBuilders({
20386
20247
  type: "supsub",
20387
20248
  htmlBuilder(e, t) {
20388
20249
  var n = htmlBuilderDelegate(e, t);
20389
20250
  if (n) return n(e, t);
20390
- var { base: r, sup: a, sub: o } = e, s = buildGroup$1(r, t), c, l, u = t.fontMetrics(), d = 0, f = 0, m = r && utils.isCharacterBox(r);
20251
+ var { base: r, sup: a, sub: o } = e, s = buildGroup$1(r, t), c, l, u = t.fontMetrics(), f = 0, p = 0, m = r && isCharacterBox(r);
20391
20252
  if (a) {
20392
20253
  var h = t.havingStyle(t.style.sup());
20393
- c = buildGroup$1(a, h, t), m || (d = s.height - h.fontMetrics().supDrop * h.sizeMultiplier / t.sizeMultiplier);
20254
+ c = buildGroup$1(a, h, t), m || (f = s.height - h.fontMetrics().supDrop * h.sizeMultiplier / t.sizeMultiplier);
20394
20255
  }
20395
20256
  if (o) {
20396
20257
  var g = t.havingStyle(t.style.sub());
20397
- l = buildGroup$1(o, g, t), m || (f = s.depth + g.fontMetrics().subDrop * g.sizeMultiplier / t.sizeMultiplier);
20258
+ l = buildGroup$1(o, g, t), m || (p = s.depth + g.fontMetrics().subDrop * g.sizeMultiplier / t.sizeMultiplier);
20398
20259
  }
20399
20260
  var _ = t.style === Style$1.DISPLAY ? u.sup1 : t.style.cramped ? u.sup3 : u.sup2, v = t.sizeMultiplier, y = makeEm(.5 / u.ptPerEm / v), b = null;
20400
20261
  if (l) {
@@ -20403,54 +20264,49 @@ defineFunctionBuilders({
20403
20264
  }
20404
20265
  var C;
20405
20266
  if (c && l) {
20406
- d = Math.max(d, _, c.depth + .25 * u.xHeight), f = Math.max(f, u.sub2);
20267
+ f = Math.max(f, _, c.depth + .25 * u.xHeight), p = Math.max(p, u.sub2);
20407
20268
  var w = 4 * u.defaultRuleThickness;
20408
- if (d - c.depth - (l.height - f) < w) {
20409
- f = w - (d - c.depth) + l.height;
20410
- var E = .8 * u.xHeight - (d - c.depth);
20411
- E > 0 && (d += E, f -= E);
20269
+ if (f - c.depth - (l.height - p) < w) {
20270
+ p = w - (f - c.depth) + l.height;
20271
+ var E = .8 * u.xHeight - (f - c.depth);
20272
+ E > 0 && (f += E, p -= E);
20412
20273
  }
20413
- var O = [{
20414
- type: "elem",
20415
- elem: l,
20416
- shift: f,
20417
- marginRight: y,
20418
- marginLeft: b
20419
- }, {
20420
- type: "elem",
20421
- elem: c,
20422
- shift: -d,
20423
- marginRight: y
20424
- }];
20425
- C = buildCommon.makeVList({
20274
+ C = makeVList({
20426
20275
  positionType: "individualShift",
20427
- children: O
20428
- }, t);
20429
- } else if (l) {
20430
- f = Math.max(f, u.sub1, l.height - .8 * u.xHeight);
20431
- var k = [{
20276
+ children: [{
20277
+ type: "elem",
20278
+ elem: l,
20279
+ shift: p,
20280
+ marginRight: y,
20281
+ marginLeft: b
20282
+ }, {
20283
+ type: "elem",
20284
+ elem: c,
20285
+ shift: -f,
20286
+ marginRight: y
20287
+ }]
20288
+ });
20289
+ } else if (l) p = Math.max(p, u.sub1, l.height - .8 * u.xHeight), C = makeVList({
20290
+ positionType: "shift",
20291
+ positionData: p,
20292
+ children: [{
20432
20293
  type: "elem",
20433
20294
  elem: l,
20434
20295
  marginLeft: b,
20435
20296
  marginRight: y
20436
- }];
20437
- C = buildCommon.makeVList({
20438
- positionType: "shift",
20439
- positionData: f,
20440
- children: k
20441
- }, t);
20442
- } else if (c) d = Math.max(d, _, c.depth + .25 * u.xHeight), C = buildCommon.makeVList({
20297
+ }]
20298
+ });
20299
+ else if (c) f = Math.max(f, _, c.depth + .25 * u.xHeight), C = makeVList({
20443
20300
  positionType: "shift",
20444
- positionData: -d,
20301
+ positionData: -f,
20445
20302
  children: [{
20446
20303
  type: "elem",
20447
20304
  elem: c,
20448
20305
  marginRight: y
20449
20306
  }]
20450
- }, t);
20307
+ });
20451
20308
  else throw Error("supsub must have either sup or sub.");
20452
- var A = getTypeOfDomTree(s, "right") || "mord";
20453
- return buildCommon.makeSpan([A], [s, buildCommon.makeSpan(["msupsub"], [C])], t);
20309
+ return makeSpan([getTypeOfDomTree(s, "right") || "mord"], [s, makeSpan(["msupsub"], [C])], t);
20454
20310
  },
20455
20311
  mathmlBuilder(e, t) {
20456
20312
  var n = !1, r, a;
@@ -20470,15 +20326,15 @@ defineFunctionBuilders({
20470
20326
  var u = e.base;
20471
20327
  s = u && u.type === "op" && u.limits && (t.style === Style$1.DISPLAY || u.alwaysHandleSupSub) || u && u.type === "operatorname" && u.alwaysHandleSupSub && (u.limits || t.style === Style$1.DISPLAY) ? "mover" : "msup";
20472
20328
  }
20473
- return new mathMLTree.MathNode(s, o);
20329
+ return new MathNode(s, o);
20474
20330
  }
20475
20331
  }), defineFunctionBuilders({
20476
20332
  type: "atom",
20477
20333
  htmlBuilder(e, t) {
20478
- return buildCommon.mathsym(e.text, e.mode, t, ["m" + e.family]);
20334
+ return mathsym(e.text, e.mode, t, ["m" + e.family]);
20479
20335
  },
20480
20336
  mathmlBuilder(e, t) {
20481
- var n = new mathMLTree.MathNode("mo", [makeText(e.text, e.mode)]);
20337
+ var n = new MathNode("mo", [makeText(e.text, e.mode)]);
20482
20338
  if (e.family === "bin") {
20483
20339
  var r = getVariant(e, t);
20484
20340
  r === "bold-italic" && n.setAttribute("mathvariant", r);
@@ -20494,19 +20350,19 @@ var defaultVariant = {
20494
20350
  defineFunctionBuilders({
20495
20351
  type: "mathord",
20496
20352
  htmlBuilder(e, t) {
20497
- return buildCommon.makeOrd(e, t, "mathord");
20353
+ return makeOrd(e, t, "mathord");
20498
20354
  },
20499
20355
  mathmlBuilder(e, t) {
20500
- var n = new mathMLTree.MathNode("mi", [makeText(e.text, e.mode, t)]), r = getVariant(e, t) || "italic";
20356
+ var n = new MathNode("mi", [makeText(e.text, e.mode, t)]), r = getVariant(e, t) || "italic";
20501
20357
  return r !== defaultVariant[n.type] && n.setAttribute("mathvariant", r), n;
20502
20358
  }
20503
20359
  }), defineFunctionBuilders({
20504
20360
  type: "textord",
20505
20361
  htmlBuilder(e, t) {
20506
- return buildCommon.makeOrd(e, t, "textord");
20362
+ return makeOrd(e, t, "textord");
20507
20363
  },
20508
20364
  mathmlBuilder(e, t) {
20509
- var n = makeText(e.text, e.mode, t), r = getVariant(e, t) || "normal", a = e.mode === "text" ? new mathMLTree.MathNode("mtext", [n]) : /[0-9]/.test(e.text) ? new mathMLTree.MathNode("mn", [n]) : e.text === "\\prime" ? new mathMLTree.MathNode("mo", [n]) : new mathMLTree.MathNode("mi", [n]);
20365
+ var n = makeText(e.text, e.mode, t), r = getVariant(e, t) || "normal", a = e.mode === "text" ? new MathNode("mtext", [n]) : /[0-9]/.test(e.text) ? new MathNode("mn", [n]) : e.text === "\\prime" ? new MathNode("mo", [n]) : new MathNode("mi", [n]);
20510
20366
  return r !== defaultVariant[a.type] && a.setAttribute("mathvariant", r), a;
20511
20367
  }
20512
20368
  });
@@ -20526,32 +20382,32 @@ defineFunctionBuilders({
20526
20382
  if (regularSpace.hasOwnProperty(e.text)) {
20527
20383
  var r = regularSpace[e.text].className || "";
20528
20384
  if (e.mode === "text") {
20529
- var a = buildCommon.makeOrd(e, t, "textord");
20385
+ var a = makeOrd(e, t, "textord");
20530
20386
  return a.classes.push(r), a;
20531
- } else return buildCommon.makeSpan(["mspace", r], [buildCommon.mathsym(e.text, e.mode, t)], t);
20532
- } else if (cssSpace.hasOwnProperty(e.text)) return buildCommon.makeSpan(["mspace", cssSpace[e.text]], [], t);
20387
+ } else return makeSpan(["mspace", r], [mathsym(e.text, e.mode, t)], t);
20388
+ } else if (cssSpace.hasOwnProperty(e.text)) return makeSpan(["mspace", cssSpace[e.text]], [], t);
20533
20389
  else throw new ParseError("Unknown type of space \"" + e.text + "\"");
20534
20390
  },
20535
20391
  mathmlBuilder(e, t) {
20536
20392
  var r;
20537
- if (regularSpace.hasOwnProperty(e.text)) r = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\xA0")]);
20538
- else if (cssSpace.hasOwnProperty(e.text)) return new mathMLTree.MathNode("mspace");
20393
+ if (regularSpace.hasOwnProperty(e.text)) r = new MathNode("mtext", [new TextNode("\xA0")]);
20394
+ else if (cssSpace.hasOwnProperty(e.text)) return new MathNode("mspace");
20539
20395
  else throw new ParseError("Unknown type of space \"" + e.text + "\"");
20540
20396
  return r;
20541
20397
  }
20542
20398
  });
20543
20399
  var pad = () => {
20544
- var e = new mathMLTree.MathNode("mtd", []);
20400
+ var e = new MathNode("mtd", []);
20545
20401
  return e.setAttribute("width", "50%"), e;
20546
20402
  };
20547
20403
  defineFunctionBuilders({
20548
20404
  type: "tag",
20549
20405
  mathmlBuilder(e, t) {
20550
- var n = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [
20406
+ var n = new MathNode("mtable", [new MathNode("mtr", [
20551
20407
  pad(),
20552
- new mathMLTree.MathNode("mtd", [buildExpressionRow(e.body, t)]),
20408
+ new MathNode("mtd", [buildExpressionRow(e.body, t)]),
20553
20409
  pad(),
20554
- new mathMLTree.MathNode("mtd", [buildExpressionRow(e.tag, t)])
20410
+ new MathNode("mtd", [buildExpressionRow(e.tag, t)])
20555
20411
  ])]);
20556
20412
  return n.setAttribute("width", "100%"), n;
20557
20413
  }
@@ -20607,8 +20463,8 @@ defineFunction({
20607
20463
  };
20608
20464
  },
20609
20465
  htmlBuilder(e, t) {
20610
- var n = optionsWithFont(e, t), r = buildExpression$1(e.body, n, !0);
20611
- return buildCommon.makeSpan(["mord", "text"], r, n);
20466
+ var n = optionsWithFont(e, t);
20467
+ return makeSpan(["mord", "text"], buildExpression$1(e.body, n, !0), n);
20612
20468
  },
20613
20469
  mathmlBuilder(e, t) {
20614
20470
  var n = optionsWithFont(e, t);
@@ -20630,7 +20486,8 @@ defineFunction({
20630
20486
  };
20631
20487
  },
20632
20488
  htmlBuilder(e, t) {
20633
- var n = buildGroup$1(e.body, t), r = buildCommon.makeLineSpan("underline-line", t), a = t.fontMetrics().defaultRuleThickness, o = buildCommon.makeVList({
20489
+ var n = buildGroup$1(e.body, t), r = makeLineSpan("underline-line", t), a = t.fontMetrics().defaultRuleThickness;
20490
+ return makeSpan(["mord", "underline"], [makeVList({
20634
20491
  positionType: "top",
20635
20492
  positionData: n.height,
20636
20493
  children: [
@@ -20651,13 +20508,12 @@ defineFunction({
20651
20508
  elem: n
20652
20509
  }
20653
20510
  ]
20654
- }, t);
20655
- return buildCommon.makeSpan(["mord", "underline"], [o], t);
20511
+ })], t);
20656
20512
  },
20657
20513
  mathmlBuilder(e, t) {
20658
- var n = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
20514
+ var n = new MathNode("mo", [new TextNode("‾")]);
20659
20515
  n.setAttribute("stretchy", "true");
20660
- var r = new mathMLTree.MathNode("munder", [buildGroup(e.body, t), n]);
20516
+ var r = new MathNode("munder", [buildGroup(e.body, t), n]);
20661
20517
  return r.setAttribute("accentunder", "true"), r;
20662
20518
  }
20663
20519
  }), defineFunction({
@@ -20677,18 +20533,18 @@ defineFunction({
20677
20533
  };
20678
20534
  },
20679
20535
  htmlBuilder(e, t) {
20680
- var n = buildGroup$1(e.body, t), r = t.fontMetrics().axisHeight, a = .5 * (n.height - r - (n.depth + r));
20681
- return buildCommon.makeVList({
20536
+ var n = buildGroup$1(e.body, t), r = t.fontMetrics().axisHeight;
20537
+ return makeVList({
20682
20538
  positionType: "shift",
20683
- positionData: a,
20539
+ positionData: .5 * (n.height - r - (n.depth + r)),
20684
20540
  children: [{
20685
20541
  type: "elem",
20686
20542
  elem: n
20687
20543
  }]
20688
- }, t);
20544
+ });
20689
20545
  },
20690
20546
  mathmlBuilder(e, t) {
20691
- return new mathMLTree.MathNode("mpadded", [buildGroup(e.body, t)], ["vcenter"]);
20547
+ return new MathNode("mpadded", [buildGroup(e.body, t)], ["vcenter"]);
20692
20548
  }
20693
20549
  }), defineFunction({
20694
20550
  type: "verb",
@@ -20703,13 +20559,13 @@ defineFunction({
20703
20559
  htmlBuilder(e, t) {
20704
20560
  for (var n = makeVerb(e), r = [], a = t.havingStyle(t.style.text()), o = 0; o < n.length; o++) {
20705
20561
  var s = n[o];
20706
- s === "~" && (s = "\\textasciitilde"), r.push(buildCommon.makeSymbol(s, "Typewriter-Regular", e.mode, a, ["mord", "texttt"]));
20562
+ s === "~" && (s = "\\textasciitilde"), r.push(makeSymbol(s, "Typewriter-Regular", e.mode, a, ["mord", "texttt"]));
20707
20563
  }
20708
- return buildCommon.makeSpan(["mord", "text"].concat(a.sizingClasses(t)), buildCommon.tryCombineChars(r), a);
20564
+ return makeSpan(["mord", "text"].concat(a.sizingClasses(t)), tryCombineChars(r), a);
20709
20565
  },
20710
20566
  mathmlBuilder(e, t) {
20711
- var n = new mathMLTree.TextNode(makeVerb(e)), r = new mathMLTree.MathNode("mtext", [n]);
20712
- return r.setAttribute("mathvariant", "monospace"), r;
20567
+ var n = new MathNode("mtext", [new TextNode(makeVerb(e))]);
20568
+ return n.setAttribute("mathvariant", "monospace"), n;
20713
20569
  }
20714
20570
  });
20715
20571
  var makeVerb = (e) => e.body.replace(/ /g, e.star ? "␣" : "\xA0"), functions = _functions, spaceRegexString = "[ \r\n ]", controlWordRegexString = "\\\\[a-zA-Z@]+", controlSymbolRegexString = "\\\\[^\ud800-\udfff]", controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*", controlSpaceRegexString = "\\\\(\n|[ \r ]+\n?)[ \r ]*", combiningDiacriticalMarkString = "[̀-ͯ]", combiningDiacriticalMarksEndRegex = /* @__PURE__ */ RegExp(combiningDiacriticalMarkString + "+$"), tokenRegexString = "(" + spaceRegexString + "+)|" + (controlSpaceRegexString + "|") + "([!-\\[\\]-‧‪-퟿豈-￿]" + (combiningDiacriticalMarkString + "*") + "|[\ud800-\udbff][\udc00-\udfff]" + (combiningDiacriticalMarkString + "*") + "|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + ("|" + controlWordWhitespaceRegexString) + ("|" + controlSymbolRegexString + ")"), Lexer = class {
@@ -20873,7 +20729,7 @@ defineMacro("\\newcommand", (e) => newcommand(e, !1, !0, !1)), defineMacro("\\re
20873
20729
  }), defineMacro("\\show", (e) => {
20874
20730
  var t = e.popToken(), n = t.text;
20875
20731
  return console.log(t, e.macros.get(n), functions[n], symbols.math[n], symbols.text[n]), "";
20876
- }), defineMacro("\\bgroup", "{"), defineMacro("\\egroup", "}"), defineMacro("~", "\\nobreakspace"), defineMacro("\\lq", "`"), defineMacro("\\rq", "'"), defineMacro("\\aa", "\\r a"), defineMacro("\\AA", "\\r A"), defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"), defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"), defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"), defineMacro("ℬ", "\\mathscr{B}"), defineMacro("ℰ", "\\mathscr{E}"), defineMacro("ℱ", "\\mathscr{F}"), defineMacro("ℋ", "\\mathscr{H}"), defineMacro("ℐ", "\\mathscr{I}"), defineMacro("ℒ", "\\mathscr{L}"), defineMacro("ℳ", "\\mathscr{M}"), defineMacro("ℛ", "\\mathscr{R}"), defineMacro("ℭ", "\\mathfrak{C}"), defineMacro("ℌ", "\\mathfrak{H}"), defineMacro("ℨ", "\\mathfrak{Z}"), defineMacro("\\Bbbk", "\\Bbb{k}"), defineMacro("·", "\\cdotp"), defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"), defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"), defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"), defineMacro("\\mathstrut", "\\vphantom{(}"), defineMacro("\\underbar", "\\underline{\\text{#1}}"), defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char\"338}"), defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"), defineMacro("\\ne", "\\neq"), defineMacro("≠", "\\neq"), defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"), defineMacro("∉", "\\notin"), defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"), defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"), defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"), defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"), defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"), defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"), defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"), defineMacro("⟂", "\\perp"), defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}"), defineMacro("∌", "\\notni"), defineMacro("⌜", "\\ulcorner"), defineMacro("⌝", "\\urcorner"), defineMacro("⌞", "\\llcorner"), defineMacro("⌟", "\\lrcorner"), defineMacro("©", "\\copyright"), defineMacro("®", "\\textregistered"), defineMacro("️", "\\textregistered"), defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}"), defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}"), defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}"), defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}"), defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}"), defineMacro("⋮", "\\vdots"), defineMacro("\\varGamma", "\\mathit{\\Gamma}"), defineMacro("\\varDelta", "\\mathit{\\Delta}"), defineMacro("\\varTheta", "\\mathit{\\Theta}"), defineMacro("\\varLambda", "\\mathit{\\Lambda}"), defineMacro("\\varXi", "\\mathit{\\Xi}"), defineMacro("\\varPi", "\\mathit{\\Pi}"), defineMacro("\\varSigma", "\\mathit{\\Sigma}"), defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"), defineMacro("\\varPhi", "\\mathit{\\Phi}"), defineMacro("\\varPsi", "\\mathit{\\Psi}"), defineMacro("\\varOmega", "\\mathit{\\Omega}"), defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"), defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"), defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"), defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"), defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"), defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"), defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"), defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
20732
+ }), defineMacro("\\bgroup", "{"), defineMacro("\\egroup", "}"), defineMacro("~", "\\nobreakspace"), defineMacro("\\lq", "`"), defineMacro("\\rq", "'"), defineMacro("\\aa", "\\r a"), defineMacro("\\AA", "\\r A"), defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"), defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"), defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"), defineMacro("ℬ", "\\mathscr{B}"), defineMacro("ℰ", "\\mathscr{E}"), defineMacro("ℱ", "\\mathscr{F}"), defineMacro("ℋ", "\\mathscr{H}"), defineMacro("ℐ", "\\mathscr{I}"), defineMacro("ℒ", "\\mathscr{L}"), defineMacro("ℳ", "\\mathscr{M}"), defineMacro("ℛ", "\\mathscr{R}"), defineMacro("ℭ", "\\mathfrak{C}"), defineMacro("ℌ", "\\mathfrak{H}"), defineMacro("ℨ", "\\mathfrak{Z}"), defineMacro("\\Bbbk", "\\Bbb{k}"), defineMacro("·", "\\cdotp"), defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"), defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"), defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"), defineMacro("\\mathstrut", "\\vphantom{(}"), defineMacro("\\underbar", "\\underline{\\text{#1}}"), defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char\"338}"), defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"), defineMacro("\\ne", "\\neq"), defineMacro("≠", "\\neq"), defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"), defineMacro("∉", "\\notin"), defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"), defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"), defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"), defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"), defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"), defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"), defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"), defineMacro("⟂", "\\perp"), defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}"), defineMacro("∌", "\\notni"), defineMacro("⌜", "\\ulcorner"), defineMacro("⌝", "\\urcorner"), defineMacro("⌞", "\\llcorner"), defineMacro("⌟", "\\lrcorner"), defineMacro("©", "\\copyright"), defineMacro("®", "\\textregistered"), defineMacro("️", "\\textregistered"), defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}"), defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}"), defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}"), defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}"), defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}"), defineMacro("⋮", "\\vdots"), defineMacro("\\varGamma", "\\mathit{\\Gamma}"), defineMacro("\\varDelta", "\\mathit{\\Delta}"), defineMacro("\\varTheta", "\\mathit{\\Theta}"), defineMacro("\\varLambda", "\\mathit{\\Lambda}"), defineMacro("\\varXi", "\\mathit{\\Xi}"), defineMacro("\\varPi", "\\mathit{\\Pi}"), defineMacro("\\varSigma", "\\mathit{\\Sigma}"), defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"), defineMacro("\\varPhi", "\\mathit{\\Phi}"), defineMacro("\\varPsi", "\\mathit{\\Psi}"), defineMacro("\\varOmega", "\\mathit{\\Omega}"), defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"), defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"), defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"), defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"), defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"), defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"), defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"), defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
20877
20733
  var dotsByToken = {
20878
20734
  ",": "\\dotsc",
20879
20735
  "\\not": "\\dotsb",
@@ -20922,10 +20778,10 @@ var dotsByToken = {
20922
20778
  "\\iiiint": "\\dotsi",
20923
20779
  "\\idotsint": "\\dotsi",
20924
20780
  "\\DOTSX": "\\dotsx"
20925
- };
20781
+ }, dotsbGroups = new Set(["bin", "rel"]);
20926
20782
  defineMacro("\\dots", function(e) {
20927
20783
  var t = "\\dotso", n = e.expandAfterFuture().text;
20928
- return n in dotsByToken ? t = dotsByToken[n] : (n.slice(0, 4) === "\\not" || n in symbols.math && ["bin", "rel"].includes(symbols.math[n].group)) && (t = "\\dotsb"), t;
20784
+ return n in dotsByToken ? t = dotsByToken[n] : (n.slice(0, 4) === "\\not" || n in symbols.math && dotsbGroups.has(symbols.math[n].group)) && (t = "\\dotsb"), t;
20929
20785
  });
20930
20786
  var spaceAfterDots = {
20931
20787
  ")": !0,
@@ -21124,7 +20980,7 @@ var implicitCommands = {
21124
20980
  var r = typeof t == "function" ? t(this) : t;
21125
20981
  if (typeof r == "string") {
21126
20982
  var a = 0;
21127
- if (r.indexOf("#") !== -1) for (var o = r.replace(/##/g, ""); o.indexOf("#" + (a + 1)) !== -1;) ++a;
20983
+ if (r.includes("#")) for (var o = r.replace(/##/g, ""); o.includes("#" + (a + 1));) ++a;
21128
20984
  for (var s = new Lexer(r, this.settings), c = [], l = s.lex(); l.text !== "EOF";) c.push(l), l = s.lex();
21129
20985
  return c.reverse(), {
21130
20986
  tokens: c,
@@ -21667,7 +21523,7 @@ var implicitCommands = {
21667
21523
  for (var n = [];;) {
21668
21524
  this.mode === "math" && this.consumeSpaces();
21669
21525
  var a = this.fetch();
21670
- if (r.endOfExpression.indexOf(a.text) !== -1 || t && a.text === t || e && functions[a.text] && functions[a.text].infix) break;
21526
+ if (r.endOfExpression.has(a.text) || t && a.text === t || e && functions[a.text] && functions[a.text].infix) break;
21671
21527
  var o = this.parseAtom(t);
21672
21528
  if (o) {
21673
21529
  if (o.type === "internal") continue;
@@ -21983,7 +21839,7 @@ var implicitCommands = {
21983
21839
  s && (r = r.substring(0, s.index), r === "i" ? r = "ı" : r === "j" && (r = "ȷ"));
21984
21840
  var c;
21985
21841
  if (symbols[this.mode][r]) {
21986
- this.settings.strict && this.mode === "math" && extraLatin.indexOf(r) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + r[0] + "\" used in math mode", t);
21842
+ this.settings.strict && this.mode === "math" && extraLatin.includes(r) && this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + r[0] + "\" used in math mode", t);
21987
21843
  var l = symbols[this.mode][r].group, u = SourceLocation.range(t), d;
21988
21844
  if (ATOMS.hasOwnProperty(l)) {
21989
21845
  var f = l;
@@ -22026,13 +21882,13 @@ var implicitCommands = {
22026
21882
  return c;
22027
21883
  }
22028
21884
  };
22029
- Parser.endOfExpression = [
21885
+ Parser.endOfExpression = new Set([
22030
21886
  "}",
22031
21887
  "\\endgroup",
22032
21888
  "\\end",
22033
21889
  "\\right",
22034
21890
  "&"
22035
- ];
21891
+ ]);
22036
21892
  var parseTree = function(e, r) {
22037
21893
  if (!(typeof e == "string" || e instanceof String)) throw TypeError("KaTeX can only parse string typed expression");
22038
21894
  var a = new Parser(e, r);
@@ -22062,7 +21918,7 @@ var renderToString = function(e, t) {
22062
21918
  return parseTree(e, new Settings(t));
22063
21919
  }, renderError = function(e, t, r) {
22064
21920
  if (r.throwOnError || !(e instanceof ParseError)) throw e;
22065
- var a = buildCommon.makeSpan(["katex-error"], [new SymbolNode(t)]);
21921
+ var a = makeSpan(["katex-error"], [new SymbolNode(t)]);
22066
21922
  return a.setAttribute("title", e.toString()), a.setAttribute("style", "color:" + r.errorColor), a;
22067
21923
  }, renderToDomTree = function(e, t) {
22068
21924
  var n = new Settings(t);
@@ -22072,7 +21928,7 @@ var renderToString = function(e, t) {
22072
21928
  return renderError(t, e, n);
22073
21929
  }
22074
21930
  }, katex = {
22075
- version: "0.16.28",
21931
+ version: "0.16.33",
22076
21932
  render,
22077
21933
  renderToString,
22078
21934
  ParseError,