js.documents 14.4.56 → 14.4.57

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 (163) hide show
  1. package/dist/codecs/read.cjs +2 -2
  2. package/dist/codecs/read.js +1 -1
  3. package/dist/composition-plan-CfvhXeOC.cjs +627 -0
  4. package/dist/composition-plan-DU9nPPN7.d.cts +102 -0
  5. package/dist/composition-plan-f0zaExUW.js +508 -0
  6. package/dist/composition-plan-l6QPO4FX.d.ts +102 -0
  7. package/dist/convert/composition-plan.cjs +7 -0
  8. package/dist/convert/composition-plan.d.cts +2 -0
  9. package/dist/convert/composition-plan.d.ts +2 -0
  10. package/dist/convert/composition-plan.js +2 -0
  11. package/dist/convert/composition-to-pdf.cjs +12 -12
  12. package/dist/convert/composition-to-pdf.d.cts +1 -1
  13. package/dist/convert/composition-to-pdf.d.ts +1 -1
  14. package/dist/convert/composition-to-pdf.js +2 -2
  15. package/dist/convert/composition.cjs +16 -511
  16. package/dist/convert/composition.d.cts +2 -85
  17. package/dist/convert/composition.d.ts +2 -85
  18. package/dist/convert/composition.js +2 -502
  19. package/dist/convert/convert.cjs +2 -2
  20. package/dist/convert/convert.js +1 -1
  21. package/dist/convert/from-package.cjs +3 -3
  22. package/dist/convert/from-package.js +2 -2
  23. package/dist/convert/from-pdf.cjs +18 -18
  24. package/dist/convert/from-pdf.js +2 -2
  25. package/dist/convert/local.cjs +3 -3
  26. package/dist/convert/local.js +1 -1
  27. package/dist/edit/odp/slide.cjs +4 -4
  28. package/dist/edit/odp/slide.d.cts +1 -1
  29. package/dist/edit/odp/slide.d.ts +1 -1
  30. package/dist/edit/odp/slide.js +1 -1
  31. package/dist/edit/odt/content.d.cts +1 -1
  32. package/dist/edit/odt/content.d.ts +1 -1
  33. package/dist/edit/odt/editor.cjs +4 -4
  34. package/dist/edit/odt/editor.d.cts +1 -1
  35. package/dist/edit/odt/editor.d.ts +1 -1
  36. package/dist/edit/odt/editor.js +1 -1
  37. package/dist/edit/odt/table-grid.cjs +23 -0
  38. package/dist/edit/odt/table-grid.d.cts +54 -0
  39. package/dist/edit/odt/table-grid.d.ts +54 -0
  40. package/dist/edit/odt/table-grid.js +2 -0
  41. package/dist/edit/odt/table.cjs +12 -653
  42. package/dist/edit/odt/table.d.cts +2 -2
  43. package/dist/edit/odt/table.d.ts +2 -2
  44. package/dist/edit/odt/table.js +2 -647
  45. package/dist/{evaluate-BbOsgdmN.d.cts → evaluate-BSEUxiUK.d.cts} +3 -1
  46. package/dist/evaluate-CEzsBx3w.cjs +564 -0
  47. package/dist/{evaluate-C7fmk69X.d.ts → evaluate-D8fG2ZeB.d.ts} +3 -1
  48. package/dist/evaluate-IK-3aMv5.js +445 -0
  49. package/dist/evaluate-columns-CyqKHkIW.d.cts +41 -0
  50. package/dist/evaluate-columns-cOo8fOfT.d.ts +41 -0
  51. package/dist/index.cjs +24 -24
  52. package/dist/index.d.cts +6 -5
  53. package/dist/index.d.ts +6 -5
  54. package/dist/index.js +8 -8
  55. package/dist/latex/lint.cjs +2 -2
  56. package/dist/latex/lint.js +1 -1
  57. package/dist/latex/lower-fold.cjs +6 -0
  58. package/dist/latex/lower-fold.d.cts +17 -0
  59. package/dist/latex/lower-fold.d.ts +17 -0
  60. package/dist/latex/lower-fold.js +2 -0
  61. package/dist/latex/lower.cjs +11 -617
  62. package/dist/latex/lower.d.cts +18 -1
  63. package/dist/latex/lower.d.ts +18 -1
  64. package/dist/latex/lower.js +2 -616
  65. package/dist/latex/symbols.d.cts +1 -15
  66. package/dist/latex/symbols.d.ts +1 -15
  67. package/dist/latex/temml.d.cts +1 -24
  68. package/dist/latex/temml.d.ts +1 -24
  69. package/dist/layout/engine.cjs +2 -2
  70. package/dist/layout/engine.js +1 -1
  71. package/dist/layout/reconstruct-lines.cjs +315 -0
  72. package/dist/layout/reconstruct-lines.d.cts +2 -0
  73. package/dist/layout/reconstruct-lines.d.ts +2 -0
  74. package/dist/layout/reconstruct-lines.js +297 -0
  75. package/dist/layout/reconstruct-presentations-prod.cjs +9 -0
  76. package/dist/layout/reconstruct-presentations-prod.d.cts +26 -0
  77. package/dist/layout/reconstruct-presentations-prod.d.ts +26 -0
  78. package/dist/layout/reconstruct-presentations-prod.js +2 -0
  79. package/dist/layout/reconstruct-tables.cjs +5 -0
  80. package/dist/layout/reconstruct-tables.d.cts +22 -0
  81. package/dist/layout/reconstruct-tables.d.ts +22 -0
  82. package/dist/layout/reconstruct-tables.js +2 -0
  83. package/dist/layout/reconstruct.cjs +11 -1545
  84. package/dist/layout/reconstruct.d.cts +2 -14
  85. package/dist/layout/reconstruct.d.ts +2 -14
  86. package/dist/layout/reconstruct.js +2 -1542
  87. package/dist/layout/shared.cjs +2 -2
  88. package/dist/layout/shared.js +1 -1
  89. package/dist/layout/sheets-render.cjs +19 -0
  90. package/dist/layout/sheets-render.d.cts +41 -0
  91. package/dist/layout/sheets-render.d.ts +41 -0
  92. package/dist/layout/sheets-render.js +2 -0
  93. package/dist/layout/sheets.cjs +10 -544
  94. package/dist/layout/sheets.d.cts +13 -2
  95. package/dist/layout/sheets.d.ts +13 -2
  96. package/dist/layout/sheets.js +2 -543
  97. package/dist/layout/slides.cjs +2 -2
  98. package/dist/layout/slides.js +1 -1
  99. package/dist/layout-DIJzJk4x.js +526 -0
  100. package/dist/layout-iuiyl_Fk.cjs +621 -0
  101. package/dist/layout-types-oSbHvZid.d.cts +13 -0
  102. package/dist/layout-types-oSbHvZid.d.ts +13 -0
  103. package/dist/lower-DCs3rWI7.js +618 -0
  104. package/dist/lower-DzOb13w4.cjs +701 -0
  105. package/dist/markdown/math.cjs +2 -2
  106. package/dist/markdown/math.js +1 -1
  107. package/dist/mathml/layout-stretch.cjs +16 -0
  108. package/dist/mathml/layout-stretch.d.cts +24 -0
  109. package/dist/mathml/layout-stretch.d.ts +24 -0
  110. package/dist/mathml/layout-stretch.js +2 -0
  111. package/dist/mathml/layout-types.d.cts +1 -12
  112. package/dist/mathml/layout-types.d.ts +1 -12
  113. package/dist/mathml/layout.cjs +3 -525
  114. package/dist/mathml/layout.d.cts +2 -2
  115. package/dist/mathml/layout.d.ts +2 -2
  116. package/dist/mathml/layout.js +1 -523
  117. package/dist/odb/formula/evaluate.d.cts +1 -1
  118. package/dist/odb/formula/evaluate.d.ts +1 -1
  119. package/dist/odb/report/render.d.cts +1 -1
  120. package/dist/odb/report/render.d.ts +1 -1
  121. package/dist/odb/report/source.cjs +2 -2
  122. package/dist/odb/report/source.d.cts +1 -1
  123. package/dist/odb/report/source.d.ts +1 -1
  124. package/dist/odb/report/source.js +1 -1
  125. package/dist/odb/sql/evaluate-columns.cjs +122 -0
  126. package/dist/odb/sql/evaluate-columns.d.cts +2 -0
  127. package/dist/odb/sql/evaluate-columns.d.ts +2 -0
  128. package/dist/odb/sql/evaluate-columns.js +114 -0
  129. package/dist/odb/sql/evaluate-predicates.cjs +16 -0
  130. package/dist/odb/sql/evaluate-predicates.d.cts +23 -0
  131. package/dist/odb/sql/evaluate-predicates.d.ts +23 -0
  132. package/dist/odb/sql/evaluate-predicates.js +2 -0
  133. package/dist/odb/sql/evaluate.cjs +7 -556
  134. package/dist/odb/sql/evaluate.d.cts +2 -2
  135. package/dist/odb/sql/evaluate.d.ts +2 -2
  136. package/dist/odb/sql/evaluate.js +2 -552
  137. package/dist/read-BSH--XB4.js +682 -0
  138. package/dist/read-CahCZMwG.cjs +759 -0
  139. package/dist/reconstruct-BKOCAedo.d.ts +29 -0
  140. package/dist/reconstruct-D4TEteZ6.d.cts +29 -0
  141. package/dist/reconstruct-lines-B7t66ICm.d.cts +33 -0
  142. package/dist/reconstruct-lines-B7t66ICm.d.ts +33 -0
  143. package/dist/reconstruct-presentations-prod-B5fkPiRZ.js +1256 -0
  144. package/dist/reconstruct-presentations-prod-X315aBmI.cjs +1375 -0
  145. package/dist/sheets-BQCpNXsE.cjs +700 -0
  146. package/dist/sheets-DWDvGN-g.js +545 -0
  147. package/dist/svg/read-geometry.cjs +10 -0
  148. package/dist/svg/read-geometry.d.cts +24 -0
  149. package/dist/svg/read-geometry.d.ts +24 -0
  150. package/dist/svg/read-geometry.js +2 -0
  151. package/dist/svg/read.cjs +6 -680
  152. package/dist/svg/read.d.cts +17 -2
  153. package/dist/svg/read.d.ts +17 -2
  154. package/dist/svg/read.js +2 -679
  155. package/dist/symbols-BlzXfLEe.d.cts +16 -0
  156. package/dist/symbols-CKm2r4D0.d.ts +16 -0
  157. package/dist/table-B5gSMY7w.js +649 -0
  158. package/dist/{table-DrE6jEWv.d.cts → table-BK_Ao-Y6.d.cts} +9 -1
  159. package/dist/{table-B5htMG3g.d.ts → table-CxY85YUj.d.ts} +9 -1
  160. package/dist/table-DqUIOSPV.cjs +840 -0
  161. package/dist/temml-1-I9N9DD.d.cts +25 -0
  162. package/dist/temml-1-I9N9DD.d.ts +25 -0
  163. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_model_formula = require("../model/formula.cjs");
3
3
  const require_latex_symbols = require("../latex/symbols.cjs");
4
- const require_latex_lower = require("../latex/lower.cjs");
4
+ const require_lower = require("../lower-DzOb13w4.cjs");
5
5
  //#region src/markdown/math.ts
6
6
  const MATH_INLINE_FONT_MARKER = "Cambria Math";
7
7
  const STAND_IN_FRAME = {
@@ -37,7 +37,7 @@ function lowerMarkdownMath(document, options) {
37
37
  const minted = /* @__PURE__ */ new Map();
38
38
  const lowerOne = (latex, source) => {
39
39
  if (latex.trim() === "") return;
40
- const result = require_latex_lower.latexToFormula(latex, {
40
+ const result = require_lower.latexToFormula(latex, {
41
41
  symbolEntries: [...known.values()],
42
42
  source
43
43
  });
@@ -1,6 +1,6 @@
1
1
  import { buildFormulaBlock } from "../model/formula.js";
2
2
  import { extractSymbolDefinitionsFromProse } from "../latex/symbols.js";
3
- import { latexToFormula } from "../latex/lower.js";
3
+ import { s as latexToFormula } from "../lower-DCs3rWI7.js";
4
4
  //#region src/markdown/math.ts
5
5
  const MATH_INLINE_FONT_MARKER = "Cambria Math";
6
6
  const STAND_IN_FRAME = {
@@ -0,0 +1,16 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_layout = require("../layout-iuiyl_Fk.cjs");
3
+ exports.horizontallyStretchedBox = require_layout.horizontallyStretchedBox;
4
+ exports.isMovableLimitsOperator = require_layout.isMovableLimitsOperator;
5
+ exports.isStretchyOperator = require_layout.isStretchyOperator;
6
+ exports.layoutRowChildren = require_layout.layoutRowChildren;
7
+ exports.layoutScripts = require_layout.layoutScripts;
8
+ exports.layoutSemantics = require_layout.layoutSemantics;
9
+ exports.layoutUnderOver = require_layout.layoutUnderOver;
10
+ exports.layoutUnderOverChild = require_layout.layoutUnderOverChild;
11
+ exports.mstyleContext = require_layout.mstyleContext;
12
+ exports.singleCodePoint = require_layout.singleCodePoint;
13
+ exports.stretchHorizontalOperator = require_layout.stretchHorizontalOperator;
14
+ exports.stretchOperator = require_layout.stretchOperator;
15
+ exports.stretchRowOperators = require_layout.stretchRowOperators;
16
+ exports.stretchedBox = require_layout.stretchedBox;
@@ -0,0 +1,24 @@
1
+ import { n as MathMlElement } from "../nodes-jrlUmrNs.cjs";
2
+ import { LayoutContext } from "./layout.cjs";
3
+ import { MathBox, MathStretchResult } from "document-schema.js";
4
+ //#region src/mathml/layout-stretch.d.ts
5
+ declare function isStretchyOperator(element: MathMlElement): boolean;
6
+ declare function singleCodePoint(text: string): number | undefined;
7
+ declare function stretchedBox(result: MathStretchResult, text: string, ctx: LayoutContext): MathBox;
8
+ declare function stretchOperator(element: MathMlElement, targetSizePt: number, ctx: LayoutContext): MathBox | undefined;
9
+ declare function horizontallyStretchedBox(result: MathStretchResult, text: string, ctx: LayoutContext): MathBox;
10
+ declare function stretchHorizontalOperator(element: MathMlElement, targetWidthPt: number, ctx: LayoutContext): MathBox | undefined;
11
+ declare function layoutUnderOverChild(childElement: MathMlElement, targetWidthPt: number, scriptCtx: LayoutContext): MathBox;
12
+ declare function stretchRowOperators(children: readonly MathMlElement[], boxes: readonly MathBox[], ctx: LayoutContext): readonly MathBox[];
13
+ declare function layoutRowChildren(children: readonly MathMlElement[], ctx: LayoutContext): MathBox;
14
+ declare function layoutSemantics(element: MathMlElement, ctx: LayoutContext): MathBox;
15
+ declare function mstyleContext(element: MathMlElement, ctx: LayoutContext): LayoutContext;
16
+ declare function layoutScripts(base: MathBox, subscript: MathBox | undefined, superscript: MathBox | undefined, ctx: LayoutContext): MathBox;
17
+ interface AccentAttachment {
18
+ readonly overXPt?: number;
19
+ readonly underXPt?: number;
20
+ }
21
+ declare function layoutUnderOver(base: MathBox, under: MathBox | undefined, over: MathBox | undefined, ctx: LayoutContext, accentAttachment?: AccentAttachment): MathBox;
22
+ declare function isMovableLimitsOperator(element: MathMlElement): boolean;
23
+ //#endregion
24
+ export { AccentAttachment, horizontallyStretchedBox, isMovableLimitsOperator, isStretchyOperator, layoutRowChildren, layoutScripts, layoutSemantics, layoutUnderOver, layoutUnderOverChild, mstyleContext, singleCodePoint, stretchHorizontalOperator, stretchOperator, stretchRowOperators, stretchedBox };
@@ -0,0 +1,24 @@
1
+ import { n as MathMlElement } from "../nodes-jrlUmrNs.js";
2
+ import { LayoutContext } from "./layout.js";
3
+ import { MathBox, MathStretchResult } from "document-schema.js";
4
+ //#region src/mathml/layout-stretch.d.ts
5
+ declare function isStretchyOperator(element: MathMlElement): boolean;
6
+ declare function singleCodePoint(text: string): number | undefined;
7
+ declare function stretchedBox(result: MathStretchResult, text: string, ctx: LayoutContext): MathBox;
8
+ declare function stretchOperator(element: MathMlElement, targetSizePt: number, ctx: LayoutContext): MathBox | undefined;
9
+ declare function horizontallyStretchedBox(result: MathStretchResult, text: string, ctx: LayoutContext): MathBox;
10
+ declare function stretchHorizontalOperator(element: MathMlElement, targetWidthPt: number, ctx: LayoutContext): MathBox | undefined;
11
+ declare function layoutUnderOverChild(childElement: MathMlElement, targetWidthPt: number, scriptCtx: LayoutContext): MathBox;
12
+ declare function stretchRowOperators(children: readonly MathMlElement[], boxes: readonly MathBox[], ctx: LayoutContext): readonly MathBox[];
13
+ declare function layoutRowChildren(children: readonly MathMlElement[], ctx: LayoutContext): MathBox;
14
+ declare function layoutSemantics(element: MathMlElement, ctx: LayoutContext): MathBox;
15
+ declare function mstyleContext(element: MathMlElement, ctx: LayoutContext): LayoutContext;
16
+ declare function layoutScripts(base: MathBox, subscript: MathBox | undefined, superscript: MathBox | undefined, ctx: LayoutContext): MathBox;
17
+ interface AccentAttachment {
18
+ readonly overXPt?: number;
19
+ readonly underXPt?: number;
20
+ }
21
+ declare function layoutUnderOver(base: MathBox, under: MathBox | undefined, over: MathBox | undefined, ctx: LayoutContext, accentAttachment?: AccentAttachment): MathBox;
22
+ declare function isMovableLimitsOperator(element: MathMlElement): boolean;
23
+ //#endregion
24
+ export { AccentAttachment, horizontallyStretchedBox, isMovableLimitsOperator, isStretchyOperator, layoutRowChildren, layoutScripts, layoutSemantics, layoutUnderOver, layoutUnderOverChild, mstyleContext, singleCodePoint, stretchHorizontalOperator, stretchOperator, stretchRowOperators, stretchedBox };
@@ -0,0 +1,2 @@
1
+ import { a as isStretchyOperator, c as layoutSemantics, d as mstyleContext, f as singleCodePoint, g as stretchedBox, h as stretchRowOperators, i as isMovableLimitsOperator, l as layoutUnderOver, m as stretchOperator, o as layoutRowChildren, p as stretchHorizontalOperator, r as horizontallyStretchedBox, s as layoutScripts, u as layoutUnderOverChild } from "../layout-DIJzJk4x.js";
2
+ export { horizontallyStretchedBox, isMovableLimitsOperator, isStretchyOperator, layoutRowChildren, layoutScripts, layoutSemantics, layoutUnderOver, layoutUnderOverChild, mstyleContext, singleCodePoint, stretchHorizontalOperator, stretchOperator, stretchRowOperators, stretchedBox };
@@ -1,13 +1,2 @@
1
- import { MathBox } from "document-schema.js";
2
- //#region src/mathml/layout-types.d.ts
3
- type MathDiagnosticKind = "unsupported-element" | "missing-glyph";
4
- interface MathDiagnostic {
5
- readonly kind: MathDiagnosticKind;
6
- readonly detail: string;
7
- }
8
- interface MathLayoutResult {
9
- readonly box: MathBox;
10
- readonly diagnostics: readonly MathDiagnostic[];
11
- }
12
- //#endregion
1
+ import { n as MathDiagnosticKind, r as MathLayoutResult, t as MathDiagnostic } from "../layout-types-oSbHvZid.cjs";
13
2
  export { MathDiagnostic, MathDiagnosticKind, MathLayoutResult };
@@ -1,13 +1,2 @@
1
- import { MathBox } from "document-schema.js";
2
- //#region src/mathml/layout-types.d.ts
3
- type MathDiagnosticKind = "unsupported-element" | "missing-glyph";
4
- interface MathDiagnostic {
5
- readonly kind: MathDiagnosticKind;
6
- readonly detail: string;
7
- }
8
- interface MathLayoutResult {
9
- readonly box: MathBox;
10
- readonly diagnostics: readonly MathDiagnostic[];
11
- }
12
- //#endregion
1
+ import { n as MathDiagnosticKind, r as MathLayoutResult, t as MathDiagnostic } from "../layout-types-oSbHvZid.js";
13
2
  export { MathDiagnostic, MathDiagnosticKind, MathLayoutResult };
@@ -1,526 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mathml_length = require("./length.cjs");
3
- const require_mathml_nodes = require("./nodes.cjs");
4
- const require_mathml_operators = require("./operators.cjs");
5
- const require_mathml_variant = require("./variant.cjs");
6
- const require_mathml_compose = require("./compose.cjs");
7
- const require_mathml_radical = require("./radical.cjs");
8
- //#region src/mathml/layout.ts
9
- const HEX_RADIX = 16;
10
- const UNICODE_HEX_DIGITS = 4;
11
- const PERCENT_SCALE = 100;
12
- const RADICAL_SIGN = 8730;
13
- const TABLE_COLUMN_GAP_EM = .8;
14
- const TABLE_ROW_GAP_EM = .5;
15
- function rootContext(options, diagnostics) {
16
- return {
17
- metrics: options.metrics,
18
- sizePt: options.sizePt,
19
- color: options.color,
20
- inheritedVariant: void 0,
21
- displayStyle: true,
22
- cramped: false,
23
- firstScriptLevel: true,
24
- diagnostics
25
- };
26
- }
27
- function scriptContext(ctx, cramped) {
28
- const scale = ctx.firstScriptLevel ? ctx.metrics.scriptPercentScaleDown : ctx.metrics.scriptScriptPercentScaleDown;
29
- return {
30
- ...ctx,
31
- sizePt: ctx.sizePt * scale,
32
- displayStyle: false,
33
- cramped,
34
- firstScriptLevel: false
35
- };
36
- }
37
- function unsupported(ctx, element) {
38
- ctx.diagnostics.push({
39
- kind: "unsupported-element",
40
- detail: require_mathml_nodes.elementLocalName(element)
41
- });
42
- return layoutToken(require_mathml_nodes.textContent(element), "normal", ctx);
43
- }
44
- function layoutToken(rawText, variant, ctx) {
45
- const styled = require_mathml_variant.applyMathVariant(rawText, variant);
46
- const nominalAscentPt = ctx.metrics.ascentPerEm * ctx.sizePt;
47
- const nominalDescentPt = ctx.metrics.descentPerEm * ctx.sizePt;
48
- let widthPt = 0;
49
- let ascentPt = 0;
50
- let descentPt = 0;
51
- let text = "";
52
- for (const ch of styled) {
53
- const codePoint = ch.codePointAt(0);
54
- if (codePoint === void 0) continue;
55
- const glyph = ctx.metrics.glyph(codePoint, ctx.sizePt);
56
- if (glyph === void 0) {
57
- ctx.diagnostics.push({
58
- kind: "missing-glyph",
59
- detail: `U+${codePoint.toString(HEX_RADIX).toUpperCase().padStart(UNICODE_HEX_DIGITS, "0")}`
60
- });
61
- continue;
62
- }
63
- text += ch;
64
- widthPt += glyph.advanceWidthPt;
65
- ascentPt = Math.max(ascentPt, glyph.inkAscentPt ?? nominalAscentPt);
66
- descentPt = Math.max(descentPt, glyph.inkDescentPt ?? nominalDescentPt);
67
- }
68
- if (text.length === 0) return require_mathml_compose.EMPTY_BOX;
69
- const items = [{
70
- kind: "glyphs",
71
- xPt: 0,
72
- yPt: ascentPt,
73
- text,
74
- sizePt: ctx.sizePt,
75
- color: ctx.color
76
- }];
77
- return {
78
- widthPt,
79
- ascentPt,
80
- descentPt,
81
- heightPt: ascentPt + descentPt,
82
- items
83
- };
84
- }
85
- function tokenVariant(element, intrinsicDefault, ctx) {
86
- const attr = require_mathml_nodes.attrValue(element, "mathvariant");
87
- if (attr !== void 0 && require_mathml_variant.isMathVariant(attr)) return attr;
88
- return ctx.inheritedVariant ?? intrinsicDefault;
89
- }
90
- function miIntrinsicDefault(content) {
91
- return [...content].length === 1 ? "italic" : "normal";
92
- }
93
- function isStretchyOperator(element) {
94
- if (require_mathml_nodes.elementLocalName(element) !== "mo") return false;
95
- if (require_mathml_nodes.attrValue(element, "stretchy") === "false") return false;
96
- return require_mathml_operators.operatorProperties(require_mathml_nodes.textContent(element).trim()).stretchy;
97
- }
98
- function singleCodePoint(text) {
99
- const codePoints = [...text];
100
- return codePoints.length === 1 ? codePoints[0]?.codePointAt(0) : void 0;
101
- }
102
- function stretchedBox(result, text, ctx) {
103
- const axisPt = ctx.metrics.axisHeightPt;
104
- const inkHeightPt = result.inkAscentPt + result.inkDescentPt;
105
- const originAboveBaselinePt = axisPt - (result.inkAscentPt - result.inkDescentPt) / 2;
106
- const ascentPt = axisPt + inkHeightPt / 2;
107
- const descentPt = inkHeightPt / 2 - axisPt;
108
- const items = [{
109
- kind: "assembled-glyphs",
110
- placements: result.placements.map((placement) => ({
111
- glyphId: placement.glyphId,
112
- xPt: 0,
113
- yPt: ascentPt - originAboveBaselinePt - placement.offsetPt
114
- })),
115
- text,
116
- sizePt: ctx.sizePt,
117
- color: ctx.color
118
- }];
119
- return {
120
- widthPt: result.advanceWidthPt,
121
- ascentPt,
122
- descentPt,
123
- heightPt: ascentPt + descentPt,
124
- items
125
- };
126
- }
127
- function stretchOperator(element, targetSizePt, ctx) {
128
- const text = require_mathml_nodes.textContent(element).trim();
129
- const codePoint = singleCodePoint(text);
130
- if (codePoint === void 0) return;
131
- const result = ctx.metrics.stretch(codePoint, "vertical", targetSizePt, ctx.sizePt);
132
- if (result === void 0 || result.kind === "base") return;
133
- return stretchedBox(result, text, ctx);
134
- }
135
- function horizontallyStretchedBox(result, text, ctx) {
136
- const ascentPt = result.inkAscentPt;
137
- const descentPt = result.inkDescentPt;
138
- const items = [{
139
- kind: "assembled-glyphs",
140
- placements: result.placements.map((placement) => ({
141
- glyphId: placement.glyphId,
142
- xPt: placement.offsetPt,
143
- yPt: ascentPt
144
- })),
145
- text,
146
- sizePt: ctx.sizePt,
147
- color: ctx.color
148
- }];
149
- return {
150
- widthPt: result.sizePt,
151
- ascentPt,
152
- descentPt,
153
- heightPt: ascentPt + descentPt,
154
- items
155
- };
156
- }
157
- function stretchHorizontalOperator(element, targetWidthPt, ctx) {
158
- const text = require_mathml_nodes.textContent(element).trim();
159
- const codePoint = singleCodePoint(text);
160
- if (codePoint === void 0) return;
161
- const result = ctx.metrics.stretch(codePoint, "horizontal", targetWidthPt, ctx.sizePt);
162
- if (result === void 0 || result.kind === "base") return;
163
- return horizontallyStretchedBox(result, text, ctx);
164
- }
165
- function layoutUnderOverChild(childElement, targetWidthPt, scriptCtx) {
166
- if (isStretchyOperator(childElement)) {
167
- const stretched = stretchHorizontalOperator(childElement, targetWidthPt, scriptCtx);
168
- if (stretched !== void 0) return stretched;
169
- }
170
- return layoutNode(childElement, scriptCtx);
171
- }
172
- function stretchRowOperators(children, boxes, ctx) {
173
- const stretchy = children.map(isStretchyOperator);
174
- const others = boxes.filter((_, index) => stretchy[index] !== true);
175
- if (others.length === 0) return boxes;
176
- const axisPt = ctx.metrics.axisHeightPt;
177
- const maxAscentPt = others.reduce((max, box) => Math.max(max, box.ascentPt), 0);
178
- const maxDescentPt = others.reduce((max, box) => Math.max(max, box.descentPt), 0);
179
- const targetSizePt = 2 * Math.max(maxAscentPt - axisPt, maxDescentPt + axisPt);
180
- return boxes.map((box, index) => {
181
- if (stretchy[index] !== true) return box;
182
- const element = children[index];
183
- return (element === void 0 ? void 0 : stretchOperator(element, targetSizePt, ctx)) ?? box;
184
- });
185
- }
186
- function layoutRowChildren(children, ctx) {
187
- const boxes = stretchRowOperators(children, children.map((child) => layoutNode(child, ctx)), ctx);
188
- const gapsPt = [];
189
- let carriedRspaceEm = 0;
190
- for (const [index, child] of children.entries()) {
191
- const properties = require_mathml_nodes.elementLocalName(child) === "mo" ? require_mathml_operators.operatorProperties(require_mathml_nodes.textContent(child).trim()) : void 0;
192
- const gapEm = index === 0 ? 0 : carriedRspaceEm + (properties?.lspaceEm ?? 0);
193
- gapsPt.push(gapEm * ctx.sizePt);
194
- carriedRspaceEm = properties?.rspaceEm ?? 0;
195
- }
196
- return require_mathml_compose.concatBoxesHorizontally(boxes, gapsPt);
197
- }
198
- function layoutSemantics(element, ctx) {
199
- const content = require_mathml_nodes.elementChildren(element).find((child) => {
200
- const name = require_mathml_nodes.elementLocalName(child);
201
- return name !== "annotation" && name !== "annotation-xml";
202
- });
203
- return content === void 0 ? require_mathml_compose.EMPTY_BOX : layoutNode(content, ctx);
204
- }
205
- function mstyleContext(element, ctx) {
206
- let next = ctx;
207
- const displayAttr = require_mathml_nodes.attrValue(element, "displaystyle");
208
- if (displayAttr === "true" || displayAttr === "false") next = {
209
- ...next,
210
- displayStyle: displayAttr === "true"
211
- };
212
- const variantAttr = require_mathml_nodes.attrValue(element, "mathvariant");
213
- if (variantAttr !== void 0 && require_mathml_variant.isMathVariant(variantAttr)) next = {
214
- ...next,
215
- inheritedVariant: variantAttr
216
- };
217
- return next;
218
- }
219
- function layoutScripts(base, subscript, superscript, ctx) {
220
- const metrics = ctx.metrics;
221
- const initialSupShiftUpPt = Math.max(ctx.cramped ? metrics.superscriptShiftUpCrampedPt : metrics.superscriptShiftUpPt, base.ascentPt - metrics.superscriptBaselineDropMaxPt);
222
- const initialSubShiftDownPt = Math.max(metrics.subscriptShiftDownPt, base.descentPt + metrics.subscriptBaselineDropMinPt);
223
- let correctionPt = 0;
224
- if (superscript !== void 0 && subscript !== void 0) {
225
- const gapPt = initialSupShiftUpPt - superscript.descentPt + (initialSubShiftDownPt - subscript.ascentPt);
226
- correctionPt = Math.max(0, metrics.subSuperscriptGapMinPt - gapPt) / 2;
227
- }
228
- const supShiftUpPt = initialSupShiftUpPt + correctionPt;
229
- const subShiftDownPt = initialSubShiftDownPt + correctionPt;
230
- const ascentPt = Math.max(base.ascentPt, superscript === void 0 ? 0 : supShiftUpPt + superscript.ascentPt);
231
- const descentPt = Math.max(base.descentPt, subscript === void 0 ? 0 : subShiftDownPt + subscript.descentPt);
232
- const scriptWidthPt = Math.max(superscript?.widthPt ?? 0, subscript?.widthPt ?? 0);
233
- const widthPt = base.widthPt + (scriptWidthPt > 0 ? scriptWidthPt + metrics.spaceAfterScriptPt : 0);
234
- const items = [...require_mathml_compose.placeChild(base, 0, 0, ascentPt)];
235
- if (superscript !== void 0) items.push(...require_mathml_compose.placeChild(superscript, base.widthPt, -supShiftUpPt, ascentPt));
236
- if (subscript !== void 0) items.push(...require_mathml_compose.placeChild(subscript, base.widthPt, subShiftDownPt, ascentPt));
237
- return {
238
- widthPt,
239
- ascentPt,
240
- descentPt,
241
- heightPt: ascentPt + descentPt,
242
- items
243
- };
244
- }
245
- function layoutUnderOver(base, under, over, ctx, accentAttachment = {}) {
246
- const gapPt = ctx.metrics.stackGapMinPt;
247
- const overHeightPt = over === void 0 ? 0 : gapPt + over.heightPt;
248
- const underHeightPt = under === void 0 ? 0 : gapPt + under.heightPt;
249
- const ascentPt = base.ascentPt + overHeightPt;
250
- const descentPt = base.descentPt + underHeightPt;
251
- const widthPt = Math.max(base.widthPt, under?.widthPt ?? 0, over?.widthPt ?? 0);
252
- const baseXPt = (widthPt - base.widthPt) / 2;
253
- const items = [...require_mathml_compose.placeChild(base, baseXPt, 0, ascentPt)];
254
- if (over !== void 0) {
255
- const overXPt = accentAttachment.overXPt === void 0 ? (widthPt - over.widthPt) / 2 : baseXPt + accentAttachment.overXPt - over.widthPt / 2;
256
- items.push(...require_mathml_compose.placeChild(over, overXPt, -(base.ascentPt + gapPt + over.descentPt), ascentPt));
257
- }
258
- if (under !== void 0) {
259
- const underXPt = accentAttachment.underXPt === void 0 ? (widthPt - under.widthPt) / 2 : baseXPt + accentAttachment.underXPt - under.widthPt / 2;
260
- items.push(...require_mathml_compose.placeChild(under, underXPt, base.descentPt + gapPt + under.ascentPt, ascentPt));
261
- }
262
- return {
263
- widthPt,
264
- ascentPt,
265
- descentPt,
266
- heightPt: ascentPt + descentPt,
267
- items
268
- };
269
- }
270
- function isMovableLimitsOperator(element) {
271
- return require_mathml_nodes.elementLocalName(element) === "mo" && require_mathml_operators.operatorProperties(require_mathml_nodes.textContent(element).trim()).movablelimits;
272
- }
273
- function resolveTopAccentXPt(baseElement, ctx) {
274
- const name = require_mathml_nodes.elementLocalName(baseElement);
275
- let rawText;
276
- let intrinsicDefault;
277
- if (name === "mi") {
278
- rawText = require_mathml_nodes.textContent(baseElement);
279
- intrinsicDefault = miIntrinsicDefault(rawText);
280
- } else if (name === "mn" || name === "mtext") {
281
- rawText = require_mathml_nodes.textContent(baseElement);
282
- intrinsicDefault = "normal";
283
- } else if (name === "mo") {
284
- rawText = require_mathml_nodes.textContent(baseElement).trim();
285
- intrinsicDefault = "normal";
286
- } else return;
287
- const codePoint = singleCodePoint(require_mathml_variant.applyMathVariant(rawText, tokenVariant(baseElement, intrinsicDefault, ctx)));
288
- if (codePoint === void 0) return;
289
- return ctx.metrics.glyph(codePoint, ctx.sizePt)?.topAccentXPt;
290
- }
291
- function layoutUnderOverElement(element, kind, ctx) {
292
- const children = require_mathml_nodes.elementChildren(element);
293
- const baseElement = children[0];
294
- if (baseElement === void 0) return require_mathml_compose.EMPTY_BOX;
295
- if (!ctx.displayStyle && isMovableLimitsOperator(baseElement)) {
296
- const base = layoutNode(baseElement, ctx);
297
- const scriptCtx = scriptContext(ctx, ctx.cramped);
298
- if (kind === "mover") return layoutScripts(base, void 0, children[1] === void 0 ? void 0 : layoutNode(children[1], scriptCtx), ctx);
299
- return layoutScripts(base, children[1] === void 0 ? void 0 : layoutNode(children[1], scriptCtx), children[2] === void 0 ? void 0 : layoutNode(children[2], scriptCtx), ctx);
300
- }
301
- const base = layoutNode(baseElement, ctx);
302
- const scriptCtx = scriptContext(ctx, false);
303
- const isAccent = require_mathml_nodes.attrValue(element, "accent") === "true";
304
- const isAccentUnder = require_mathml_nodes.attrValue(element, "accentunder") === "true";
305
- const accentAttachment = {
306
- overXPt: isAccent ? resolveTopAccentXPt(baseElement, ctx) : void 0,
307
- underXPt: isAccentUnder ? resolveTopAccentXPt(baseElement, ctx) : void 0
308
- };
309
- if (kind === "mover") return layoutUnderOver(base, void 0, children[1] === void 0 ? void 0 : layoutUnderOverChild(children[1], base.widthPt, scriptCtx), ctx, accentAttachment);
310
- return layoutUnderOver(base, children[1] === void 0 ? void 0 : layoutUnderOverChild(children[1], base.widthPt, scriptCtx), children[2] === void 0 ? void 0 : layoutUnderOverChild(children[2], base.widthPt, scriptCtx), ctx, accentAttachment);
311
- }
312
- function layoutFraction(element, ctx) {
313
- const children = require_mathml_nodes.elementChildren(element);
314
- const numeratorElement = children[0];
315
- const denominatorElement = children[1];
316
- if (numeratorElement === void 0) return require_mathml_compose.EMPTY_BOX;
317
- if (denominatorElement === void 0) return require_mathml_compose.EMPTY_BOX;
318
- const fracCtx = {
319
- ...ctx,
320
- displayStyle: false,
321
- cramped: false
322
- };
323
- const numerator = layoutNode(numeratorElement, fracCtx);
324
- const denominator = layoutNode(denominatorElement, {
325
- ...fracCtx,
326
- cramped: true
327
- });
328
- const metrics = ctx.metrics;
329
- const lineThicknessAttr = require_mathml_nodes.attrValue(element, "linethickness");
330
- const ruleThicknessPt = (lineThicknessAttr === void 0 ? void 0 : require_mathml_length.parseMathLength(lineThicknessAttr, ctx.sizePt)) ?? metrics.fractionRuleThicknessPt;
331
- const axisPt = metrics.axisHeightPt;
332
- const numShiftUpPt = Math.max(ctx.displayStyle ? metrics.fractionNumeratorDisplayShiftUpPt : metrics.fractionNumeratorShiftUpPt, axisPt + ruleThicknessPt / 2 + metrics.fractionNumeratorGapMinPt + numerator.descentPt);
333
- const denShiftDownPt = Math.max(ctx.displayStyle ? metrics.fractionDenominatorDisplayShiftDownPt : metrics.fractionDenominatorShiftDownPt, ruleThicknessPt / 2 + metrics.fractionDenominatorGapMinPt + denominator.ascentPt - axisPt);
334
- const widthPt = Math.max(numerator.widthPt, denominator.widthPt);
335
- const ascentPt = numShiftUpPt + numerator.ascentPt;
336
- const descentPt = denShiftDownPt + denominator.descentPt;
337
- const items = [
338
- ...require_mathml_compose.placeChild(numerator, (widthPt - numerator.widthPt) / 2, -numShiftUpPt, ascentPt),
339
- ...require_mathml_compose.placeChild(denominator, (widthPt - denominator.widthPt) / 2, denShiftDownPt, ascentPt),
340
- {
341
- kind: "rule",
342
- xPt: 0,
343
- yPt: ascentPt - axisPt - ruleThicknessPt / 2,
344
- widthPt,
345
- heightPt: ruleThicknessPt,
346
- color: ctx.color
347
- }
348
- ];
349
- return {
350
- widthPt,
351
- ascentPt,
352
- descentPt,
353
- heightPt: ascentPt + descentPt,
354
- items
355
- };
356
- }
357
- function layoutRadical(element, kind, ctx) {
358
- const children = require_mathml_nodes.elementChildren(element);
359
- if (kind === "msqrt") return wrapRadical(layoutRowChildren(children, {
360
- ...ctx,
361
- cramped: true
362
- }), void 0, ctx);
363
- const radicandElement = children[0];
364
- const indexElement = children[1];
365
- if (radicandElement === void 0) return require_mathml_compose.EMPTY_BOX;
366
- return wrapRadical(layoutNode(radicandElement, {
367
- ...ctx,
368
- cramped: true
369
- }), indexElement === void 0 ? void 0 : layoutNode(indexElement, scriptContext(scriptContext(ctx, false), false)), ctx);
370
- }
371
- function wrapRadical(radicand, index, ctx) {
372
- const metrics = ctx.metrics;
373
- const ruleThicknessPt = metrics.radicalRuleThicknessPt;
374
- const gapPt = metrics.radicalVerticalGapPt;
375
- const signHeightPt = metrics.radicalExtraAscenderPt + ruleThicknessPt + gapPt + radicand.heightPt;
376
- const degreeWidthPt = index === void 0 ? 0 : metrics.radicalKernBeforeDegreePt + index.widthPt + metrics.radicalKernAfterDegreePt;
377
- const signOriginXPt = Math.max(0, degreeWidthPt);
378
- const ascentPt = metrics.radicalExtraAscenderPt + ruleThicknessPt + gapPt + radicand.ascentPt;
379
- const descentPt = radicand.descentPt;
380
- const items = [];
381
- const stretched = ctx.metrics.stretch(RADICAL_SIGN, "vertical", signHeightPt - metrics.radicalExtraAscenderPt, ctx.sizePt);
382
- let signWidthPt;
383
- if (stretched !== void 0) {
384
- const placements = stretched.placements.map((placement) => ({
385
- glyphId: placement.glyphId,
386
- xPt: signOriginXPt,
387
- yPt: metrics.radicalExtraAscenderPt + stretched.inkAscentPt - placement.offsetPt
388
- }));
389
- items.push({
390
- kind: "assembled-glyphs",
391
- placements,
392
- text: "√",
393
- sizePt: ctx.sizePt,
394
- color: ctx.color
395
- });
396
- items.push({
397
- kind: "rule",
398
- xPt: signOriginXPt,
399
- yPt: metrics.radicalExtraAscenderPt,
400
- widthPt: stretched.advanceWidthPt + radicand.widthPt,
401
- heightPt: ruleThicknessPt,
402
- color: ctx.color
403
- });
404
- signWidthPt = stretched.advanceWidthPt;
405
- } else {
406
- const sign = require_mathml_radical.buildRadicalSign(signOriginXPt, 0, signHeightPt, radicand.widthPt, ruleThicknessPt, ctx.color);
407
- items.push(sign.hook, sign.vinculum);
408
- signWidthPt = sign.widthPt;
409
- }
410
- items.push(...require_mathml_compose.placeChild(radicand, signOriginXPt + signWidthPt, 0, ascentPt));
411
- if (index !== void 0) {
412
- const raisePt = (ascentPt + descentPt) * metrics.radicalDegreeBottomRaisePercent / PERCENT_SCALE;
413
- const degreeBaselineFromTopPt = ascentPt + descentPt - raisePt - index.descentPt;
414
- items.push(...require_mathml_compose.shiftItems(index.items, metrics.radicalKernBeforeDegreePt, degreeBaselineFromTopPt - index.ascentPt));
415
- }
416
- return {
417
- widthPt: signOriginXPt + signWidthPt + radicand.widthPt,
418
- ascentPt,
419
- descentPt,
420
- heightPt: ascentPt + descentPt,
421
- items
422
- };
423
- }
424
- function layoutTable(element, ctx) {
425
- const rows = require_mathml_nodes.elementChildren(element).filter((child) => require_mathml_nodes.elementLocalName(child) === "mtr");
426
- const columnAlignAttr = require_mathml_nodes.attrValue(element, "columnalign");
427
- const columnAligns = columnAlignAttr === void 0 ? [] : columnAlignAttr.match(/\S+/g) ?? [];
428
- const rowCells = rows.map((row) => require_mathml_nodes.elementChildren(row).filter((child) => require_mathml_nodes.elementLocalName(child) === "mtd").map((cell) => layoutRowChildren(require_mathml_nodes.elementChildren(cell), ctx)));
429
- const columnCount = rowCells.reduce((max, row) => Math.max(max, row.length), 0);
430
- if (columnCount === 0) return require_mathml_compose.EMPTY_BOX;
431
- const columnWidthsPt = Array.from({ length: columnCount }, (_, column) => rowCells.reduce((max, row) => Math.max(max, row[column]?.widthPt ?? 0), 0));
432
- const columnGapPt = TABLE_COLUMN_GAP_EM * ctx.sizePt;
433
- const rowGapPt = TABLE_ROW_GAP_EM * ctx.sizePt;
434
- const items = [];
435
- let cursorYTopPt = 0;
436
- rowCells.forEach((row, rowIndex) => {
437
- const rowAscentPt = row.reduce((max, cell) => Math.max(max, cell.ascentPt), 0);
438
- const rowDescentPt = row.reduce((max, cell) => Math.max(max, cell.descentPt), 0);
439
- let cursorXPt = 0;
440
- row.forEach((cell, columnIndex) => {
441
- const columnWidthPt = columnWidthsPt[columnIndex] ?? cell.widthPt;
442
- const align = columnAligns[columnIndex] ?? columnAligns[columnAligns.length - 1];
443
- const extraPt = columnWidthPt - cell.widthPt;
444
- const dxPt = align === "left" ? 0 : align === "right" ? extraPt : extraPt / 2;
445
- items.push(...require_mathml_compose.placeChild(cell, cursorXPt + dxPt, 0, cursorYTopPt + rowAscentPt));
446
- cursorXPt += columnWidthPt + columnGapPt;
447
- });
448
- cursorYTopPt += rowAscentPt + rowDescentPt + (rowIndex < rowCells.length - 1 ? rowGapPt : 0);
449
- });
450
- const widthPt = columnWidthsPt.reduce((sum, w) => sum + w, 0) + columnGapPt * Math.max(0, columnCount - 1);
451
- let descentPt = cursorYTopPt - (cursorYTopPt / 2 + ctx.metrics.axisHeightPt);
452
- if (descentPt < 0) descentPt = 0;
453
- return {
454
- widthPt,
455
- ascentPt: cursorYTopPt - descentPt,
456
- descentPt,
457
- heightPt: cursorYTopPt,
458
- items
459
- };
460
- }
461
- function layoutSpace(element, ctx) {
462
- const widthAttr = require_mathml_nodes.attrValue(element, "width");
463
- const heightAttr = require_mathml_nodes.attrValue(element, "height");
464
- const depthAttr = require_mathml_nodes.attrValue(element, "depth");
465
- const widthPt = Math.max(0, (widthAttr === void 0 ? void 0 : require_mathml_length.parseMathLength(widthAttr, ctx.sizePt)) ?? 0);
466
- const ascentPt = Math.max(0, (heightAttr === void 0 ? void 0 : require_mathml_length.parseMathLength(heightAttr, ctx.sizePt)) ?? 0);
467
- const descentPt = Math.max(0, (depthAttr === void 0 ? void 0 : require_mathml_length.parseMathLength(depthAttr, ctx.sizePt)) ?? 0);
468
- return {
469
- widthPt,
470
- ascentPt,
471
- descentPt,
472
- heightPt: ascentPt + descentPt,
473
- items: []
474
- };
475
- }
476
- function layoutNode(node, ctx) {
477
- if (!require_mathml_nodes.isMathMlElement(node)) return require_mathml_compose.EMPTY_BOX;
478
- switch (require_mathml_nodes.elementLocalName(node)) {
479
- case "mrow": return layoutRowChildren(require_mathml_nodes.elementChildren(node), ctx);
480
- case "semantics": return layoutSemantics(node, ctx);
481
- case "mstyle": return layoutRowChildren(require_mathml_nodes.elementChildren(node), mstyleContext(node, ctx));
482
- case "mi": {
483
- const text = require_mathml_nodes.textContent(node);
484
- return layoutToken(text, tokenVariant(node, miIntrinsicDefault(text), ctx), ctx);
485
- }
486
- case "mn": return layoutToken(require_mathml_nodes.textContent(node), tokenVariant(node, "normal", ctx), ctx);
487
- case "mo": return layoutToken(require_mathml_nodes.textContent(node).trim(), tokenVariant(node, "normal", ctx), ctx);
488
- case "mtext": return layoutToken(require_mathml_nodes.textContent(node), tokenVariant(node, "normal", ctx), ctx);
489
- case "mspace": return layoutSpace(node, ctx);
490
- case "msub": {
491
- const children = require_mathml_nodes.elementChildren(node);
492
- return layoutScripts(children[0] === void 0 ? require_mathml_compose.EMPTY_BOX : layoutNode(children[0], ctx), children[1] === void 0 ? void 0 : layoutNode(children[1], scriptContext(ctx, ctx.cramped)), void 0, ctx);
493
- }
494
- case "msup": {
495
- const children = require_mathml_nodes.elementChildren(node);
496
- return layoutScripts(children[0] === void 0 ? require_mathml_compose.EMPTY_BOX : layoutNode(children[0], ctx), void 0, children[1] === void 0 ? void 0 : layoutNode(children[1], scriptContext(ctx, ctx.cramped)), ctx);
497
- }
498
- case "msubsup": {
499
- const children = require_mathml_nodes.elementChildren(node);
500
- const base = children[0] === void 0 ? require_mathml_compose.EMPTY_BOX : layoutNode(children[0], ctx);
501
- const scriptCtx = scriptContext(ctx, ctx.cramped);
502
- return layoutScripts(base, children[1] === void 0 ? void 0 : layoutNode(children[1], scriptCtx), children[2] === void 0 ? void 0 : layoutNode(children[2], scriptCtx), ctx);
503
- }
504
- case "munder": return layoutUnderOverElement(node, "munder", ctx);
505
- case "mover": return layoutUnderOverElement(node, "mover", ctx);
506
- case "munderover": return layoutUnderOverElement(node, "munderover", ctx);
507
- case "mfrac": return layoutFraction(node, ctx);
508
- case "msqrt": return layoutRadical(node, "msqrt", ctx);
509
- case "mroot": return layoutRadical(node, "mroot", ctx);
510
- case "mtable": return layoutTable(node, ctx);
511
- case "mtr":
512
- case "mtd": return layoutRowChildren(require_mathml_nodes.elementChildren(node), ctx);
513
- default: return unsupported(ctx, node);
514
- }
515
- }
516
- function layoutFormula(mathml, options) {
517
- const diagnostics = [];
518
- const ctx = rootContext(options, diagnostics);
519
- return {
520
- box: layoutRowChildren(mathml.filter(require_mathml_nodes.isMathMlElement), ctx),
521
- diagnostics
522
- };
523
- }
524
- //#endregion
525
- exports.layoutFormula = layoutFormula;
526
- exports.layoutNode = layoutNode;
2
+ const require_layout = require("../layout-iuiyl_Fk.cjs");
3
+ exports.layoutFormula = require_layout.layoutFormula;
4
+ exports.layoutNode = require_layout.layoutNode;