@office-open/docx 0.5.2 → 0.6.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as __toCommonJS, n as __exportAll, r as __reExport, t as __esmMin } from "./chunk-090QGkrx.mjs";
2
- import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, ContentTypeAttributes, EMPTY_OBJECT, EmptyElement, Formatter, HpsMeasureElement, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, NextAttributeComponent, NumberValueElement, OnOffElement, PrettifyType, RawPassthrough, Relationships, StringContainer, StringEnumValueElement, StringValueElement, TargetModeType, XmlAttributeComponent, XmlAttributeComponent as XmlAttributeComponent$1, XmlComponent, addSmartArtRelationships, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPrettifyType, convertToXmlComponent, createDefault, createOverride, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, numberValObj, onOffObj, parseArchive, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, stringEnumValObj, stringValObj, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, wrapEl } from "@office-open/core";
2
+ import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, ContentTypeAttributes, EMPTY_OBJECT, EmptyElement, Formatter, HpsMeasureElement, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, NextAttributeComponent, NumberValueElement, OnOffElement, PrettifyType, RawPassthrough, Relationships, StringContainer, StringEnumValueElement, StringValueElement, TargetModeType, XmlAttributeComponent, XmlAttributeComponent as XmlAttributeComponent$1, XmlComponent, addSmartArtRelationships, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPrettifyType, convertToXmlComponent, createDefault, createOverride, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, numberValObj, onOffObj, parseArchive, parseCorePropsElement, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, stringEnumValObj, stringValObj, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, wrapEl } from "@office-open/core";
3
3
  import { textToUint8Array, toUint8Array } from "undio";
4
4
  import { PresetGeometry, buildFill, createBlipFill, createCustomGeometry, createEffectDag, createEffectList, createOutline, createScene3D, createShape3D, createTransform2D, extractBlipFillMedia } from "@office-open/core/drawingml";
5
5
  import { ChartCollection, ChartSpace } from "@office-open/core/chart";
@@ -4722,155 +4722,6 @@ var init_group_chr = __esmMin((() => {
4722
4722
  init_math_group_chr_properties();
4723
4723
  }));
4724
4724
  //#endregion
4725
- //#region src/file/paragraph/math/math.ts
4726
- var Math$1;
4727
- var init_math$1 = __esmMin((() => {
4728
- init_xml_components();
4729
- Math$1 = class extends XmlComponent {
4730
- constructor(options) {
4731
- super("m:oMath");
4732
- for (const child of options.children) this.root.push(child);
4733
- }
4734
- };
4735
- }));
4736
- //#endregion
4737
- //#region src/file/paragraph/math/math-component.ts
4738
- var WORKAROUND4;
4739
- var init_math_component = __esmMin((() => {
4740
- WORKAROUND4 = "";
4741
- }));
4742
- //#endregion
4743
- //#region src/file/paragraph/math/math-para.ts
4744
- var createMathParagraphProperties, MathParagraph;
4745
- var init_math_para = __esmMin((() => {
4746
- init_xml_components();
4747
- init_math$1();
4748
- createMathParagraphProperties = (justification) => new BuilderElement({
4749
- children: [new BuilderElement({
4750
- attributes: { val: {
4751
- key: "m:val",
4752
- value: justification
4753
- } },
4754
- name: "m:jc"
4755
- })],
4756
- name: "m:oMathParaPr"
4757
- });
4758
- MathParagraph = class extends XmlComponent {
4759
- constructor(options) {
4760
- super("m:oMathPara");
4761
- if (options.justification) this.root.push(createMathParagraphProperties(options.justification));
4762
- for (const child of options.children) this.root.push(new Math$1(child));
4763
- }
4764
- };
4765
- }));
4766
- //#endregion
4767
- //#region src/file/paragraph/math/math-pr.ts
4768
- var createMathProperties;
4769
- var init_math_pr = __esmMin((() => {
4770
- init_xml_components();
4771
- createMathProperties = (options) => {
4772
- const children = [];
4773
- if (options.mathFont !== void 0) children.push(new BuilderElement({
4774
- attributes: { val: {
4775
- key: "m:val",
4776
- value: options.mathFont
4777
- } },
4778
- name: "m:mathFont"
4779
- }));
4780
- if (options.breakBin !== void 0) children.push(new BuilderElement({
4781
- attributes: { val: {
4782
- key: "m:val",
4783
- value: options.breakBin
4784
- } },
4785
- name: "m:brkBin"
4786
- }));
4787
- if (options.breakBinSub !== void 0) children.push(new BuilderElement({
4788
- attributes: { val: {
4789
- key: "m:val",
4790
- value: options.breakBinSub
4791
- } },
4792
- name: "m:brkBinSub"
4793
- }));
4794
- if (options.smallFrac !== void 0) children.push(new OnOffElement("m:smallFrac", options.smallFrac));
4795
- if (options.displayDefault !== void 0) children.push(new OnOffElement("m:dispDef", options.displayDefault));
4796
- if (options.leftMargin !== void 0) children.push(new BuilderElement({
4797
- attributes: { val: {
4798
- key: "m:val",
4799
- value: options.leftMargin.toString()
4800
- } },
4801
- name: "m:lMargin"
4802
- }));
4803
- if (options.rightMargin !== void 0) children.push(new BuilderElement({
4804
- attributes: { val: {
4805
- key: "m:val",
4806
- value: options.rightMargin.toString()
4807
- } },
4808
- name: "m:rMargin"
4809
- }));
4810
- if (options.defaultJustification !== void 0) children.push(new BuilderElement({
4811
- attributes: { val: {
4812
- key: "m:val",
4813
- value: options.defaultJustification
4814
- } },
4815
- name: "m:defJc"
4816
- }));
4817
- if (options.preSpacing !== void 0) children.push(new BuilderElement({
4818
- attributes: { val: {
4819
- key: "m:val",
4820
- value: options.preSpacing.toString()
4821
- } },
4822
- name: "m:preSp"
4823
- }));
4824
- if (options.postSpacing !== void 0) children.push(new BuilderElement({
4825
- attributes: { val: {
4826
- key: "m:val",
4827
- value: options.postSpacing.toString()
4828
- } },
4829
- name: "m:postSp"
4830
- }));
4831
- if (options.interSpacing !== void 0) children.push(new BuilderElement({
4832
- attributes: { val: {
4833
- key: "m:val",
4834
- value: options.interSpacing.toString()
4835
- } },
4836
- name: "m:interSp"
4837
- }));
4838
- if (options.intraSpacing !== void 0) children.push(new BuilderElement({
4839
- attributes: { val: {
4840
- key: "m:val",
4841
- value: options.intraSpacing.toString()
4842
- } },
4843
- name: "m:intraSp"
4844
- }));
4845
- if (options.wrapIndent !== void 0) children.push(new BuilderElement({
4846
- attributes: { val: {
4847
- key: "m:val",
4848
- value: options.wrapIndent.toString()
4849
- } },
4850
- name: "m:wrapIndent"
4851
- }));
4852
- if (options.wrapRight !== void 0) children.push(new OnOffElement("m:wrapRight", options.wrapRight));
4853
- if (options.integralLimitLocation !== void 0) children.push(new BuilderElement({
4854
- attributes: { val: {
4855
- key: "m:val",
4856
- value: options.integralLimitLocation
4857
- } },
4858
- name: "m:intLim"
4859
- }));
4860
- if (options.naryLimitLocation !== void 0) children.push(new BuilderElement({
4861
- attributes: { val: {
4862
- key: "m:val",
4863
- value: options.naryLimitLocation
4864
- } },
4865
- name: "m:naryLim"
4866
- }));
4867
- return new BuilderElement({
4868
- children,
4869
- name: "m:mathPr"
4870
- });
4871
- };
4872
- }));
4873
- //#endregion
4874
4725
  //#region src/file/paragraph/math/math-run-properties.ts
4875
4726
  var createMathRunProperties;
4876
4727
  var init_math_run_properties = __esmMin((() => {
@@ -5012,12 +4863,6 @@ var init_math_matrix = __esmMin((() => {
5012
4863
  };
5013
4864
  }));
5014
4865
  //#endregion
5015
- //#region src/file/paragraph/math/matrix/index.ts
5016
- var init_matrix = __esmMin((() => {
5017
- init_math_matrix();
5018
- init_math_matrix_properties();
5019
- }));
5020
- //#endregion
5021
4866
  //#region src/file/paragraph/math/phant/math-phant-properties.ts
5022
4867
  var createMathPhantProperties;
5023
4868
  var init_math_phant_properties = __esmMin((() => {
@@ -5051,12 +4896,6 @@ var init_math_phant = __esmMin((() => {
5051
4896
  };
5052
4897
  }));
5053
4898
  //#endregion
5054
- //#region src/file/paragraph/math/phant/index.ts
5055
- var init_phant = __esmMin((() => {
5056
- init_math_phant();
5057
- init_math_phant_properties();
5058
- }));
5059
- //#endregion
5060
4899
  //#region src/file/paragraph/math/radical/math-degree.ts
5061
4900
  var MathDegree;
5062
4901
  var init_math_degree = __esmMin((() => {
@@ -5114,13 +4953,6 @@ var init_math_radical = __esmMin((() => {
5114
4953
  };
5115
4954
  }));
5116
4955
  //#endregion
5117
- //#region src/file/paragraph/math/radical/index.ts
5118
- var init_radical = __esmMin((() => {
5119
- init_math_degree();
5120
- init_math_radical();
5121
- init_math_radical_properties();
5122
- }));
5123
- //#endregion
5124
4956
  //#region src/file/paragraph/math/script/super-script/math-super-script-function-properties.ts
5125
4957
  var createMathSuperScriptProperties;
5126
4958
  var init_math_super_script_function_properties = __esmMin((() => {
@@ -5258,6 +5090,583 @@ var init_script = __esmMin((() => {
5258
5090
  init_pre_sub_super_script();
5259
5091
  }));
5260
5092
  //#endregion
5093
+ //#region src/file/paragraph/math/math-coerce.ts
5094
+ /** Coerce an array of MathJson values to MathComponent instances. */
5095
+ function coerceArray(items) {
5096
+ if (!items) return [];
5097
+ return items.map((v) => coerceMathJson(v));
5098
+ }
5099
+ /** Coerce bracket shorthand to children array. */
5100
+ function bracketChildren(v) {
5101
+ if (Array.isArray(v)) return coerceArray(v);
5102
+ return coerceArray(v.children);
5103
+ }
5104
+ /**
5105
+ * Coerce a MathJson value to an XmlComponent instance.
5106
+ *
5107
+ * Handles string → MathRun, class instances pass-through, and recursive
5108
+ * conversion of all discriminated JSON object types.
5109
+ */
5110
+ function coerceMathJson(value) {
5111
+ if (typeof value === "string") return new MathRun(value);
5112
+ if (value instanceof XmlComponent) return value;
5113
+ if ("subSuperScript" in value) {
5114
+ const opts = value.subSuperScript;
5115
+ return new MathSubSuperScript({
5116
+ children: coerceArray(opts.children),
5117
+ subScript: coerceArray(opts.subScript),
5118
+ superScript: coerceArray(opts.superScript)
5119
+ });
5120
+ }
5121
+ if ("superScript" in value) {
5122
+ const opts = value.superScript;
5123
+ return new MathSuperScript({
5124
+ children: coerceArray(opts.children),
5125
+ superScript: coerceArray(opts.superScript)
5126
+ });
5127
+ }
5128
+ if ("subScript" in value) {
5129
+ const opts = value.subScript;
5130
+ return new MathSubScript({
5131
+ children: coerceArray(opts.children),
5132
+ subScript: coerceArray(opts.subScript)
5133
+ });
5134
+ }
5135
+ if ("fraction" in value) {
5136
+ const opts = value.fraction;
5137
+ return new MathFraction({
5138
+ numerator: coerceArray(opts.numerator),
5139
+ denominator: coerceArray(opts.denominator),
5140
+ ...opts.fractionType ? { fractionType: opts.fractionType } : {}
5141
+ });
5142
+ }
5143
+ if ("radical" in value) {
5144
+ const opts = value.radical;
5145
+ return new MathRadical({
5146
+ children: coerceArray(opts.children),
5147
+ ...opts.degree ? { degree: coerceArray(opts.degree) } : {}
5148
+ });
5149
+ }
5150
+ if ("sum" in value) {
5151
+ const opts = value.sum;
5152
+ return new MathSum({
5153
+ children: coerceArray(opts.children),
5154
+ ...opts.subScript ? { subScript: coerceArray(opts.subScript) } : {},
5155
+ ...opts.superScript ? { superScript: coerceArray(opts.superScript) } : {}
5156
+ });
5157
+ }
5158
+ if ("integral" in value) {
5159
+ const opts = value.integral;
5160
+ return new MathIntegral({
5161
+ children: coerceArray(opts.children),
5162
+ ...opts.subScript ? { subScript: coerceArray(opts.subScript) } : {},
5163
+ ...opts.superScript ? { superScript: coerceArray(opts.superScript) } : {}
5164
+ });
5165
+ }
5166
+ if ("limitLower" in value) {
5167
+ const opts = value.limitLower;
5168
+ return new MathLimitLower({
5169
+ children: coerceArray(opts.children),
5170
+ limit: coerceArray(opts.limit),
5171
+ ...opts.properties ? { properties: opts.properties } : {}
5172
+ });
5173
+ }
5174
+ if ("limitUpper" in value) {
5175
+ const opts = value.limitUpper;
5176
+ return new MathLimitUpper({
5177
+ children: coerceArray(opts.children),
5178
+ limit: coerceArray(opts.limit),
5179
+ ...opts.properties ? { properties: opts.properties } : {}
5180
+ });
5181
+ }
5182
+ if ("function" in value) {
5183
+ const opts = value.function;
5184
+ return new MathFunction({
5185
+ children: coerceArray(opts.children),
5186
+ name: coerceArray(opts.name),
5187
+ ...opts.properties ? { properties: opts.properties } : {}
5188
+ });
5189
+ }
5190
+ if ("matrix" in value) {
5191
+ const opts = value.matrix;
5192
+ return new MathMatrix({
5193
+ rows: opts.rows.map((row) => coerceArray(row)),
5194
+ ...opts.properties ? { properties: opts.properties } : {}
5195
+ });
5196
+ }
5197
+ if ("roundBrackets" in value) return new MathRoundBrackets({ children: bracketChildren(value.roundBrackets) });
5198
+ if ("curlyBrackets" in value) return new MathCurlyBrackets({ children: bracketChildren(value.curlyBrackets) });
5199
+ if ("angledBrackets" in value) return new MathAngledBrackets({ children: bracketChildren(value.angledBrackets) });
5200
+ if ("squareBrackets" in value) return new MathSquareBrackets({ children: bracketChildren(value.squareBrackets) });
5201
+ if ("borderBox" in value) {
5202
+ const opts = value.borderBox;
5203
+ return new MathBorderBox({
5204
+ children: coerceArray(opts.children),
5205
+ ...opts.properties ? { properties: opts.properties } : {}
5206
+ });
5207
+ }
5208
+ if ("box" in value) {
5209
+ const opts = value.box;
5210
+ return new MathBox({
5211
+ children: coerceArray(opts.children),
5212
+ ...opts.properties ? { properties: opts.properties } : {}
5213
+ });
5214
+ }
5215
+ if ("groupChr" in value) {
5216
+ const opts = value.groupChr;
5217
+ return new MathGroupChr({
5218
+ children: coerceArray(opts.children),
5219
+ ...opts.properties ? { properties: opts.properties } : {}
5220
+ });
5221
+ }
5222
+ if ("phant" in value) {
5223
+ const opts = value.phant;
5224
+ return new MathPhant({
5225
+ children: coerceArray(opts.children),
5226
+ ...opts.properties ? { properties: opts.properties } : {}
5227
+ });
5228
+ }
5229
+ if ("eqArr" in value) {
5230
+ const opts = value.eqArr;
5231
+ return new MathEqArr({
5232
+ rows: opts.rows.map((row) => coerceArray(row)),
5233
+ ...opts.properties ? { properties: opts.properties } : {}
5234
+ });
5235
+ }
5236
+ if ("accent" in value) {
5237
+ const opts = value.accent;
5238
+ return createMathAccent({
5239
+ children: coerceArray(opts.children),
5240
+ ...opts.accentCharacter ? { accentCharacter: opts.accentCharacter } : {}
5241
+ });
5242
+ }
5243
+ if ("bar" in value) {
5244
+ const opts = value.bar;
5245
+ return createMathBar({
5246
+ children: coerceArray(opts.children),
5247
+ type: opts.type
5248
+ });
5249
+ }
5250
+ return new MathRun({
5251
+ text: value.text,
5252
+ properties: value.properties
5253
+ });
5254
+ }
5255
+ var init_math_coerce = __esmMin((() => {
5256
+ init_xml_components();
5257
+ init_math_accent();
5258
+ init_math_bar();
5259
+ init_math_border_box();
5260
+ init_math_box();
5261
+ init_brackets();
5262
+ init_math_eq_arr();
5263
+ init_math_fraction();
5264
+ init_math_function();
5265
+ init_math_group_chr();
5266
+ init_math_run();
5267
+ init_math_matrix();
5268
+ init_n_ary();
5269
+ init_math_phant();
5270
+ init_math_radical();
5271
+ init_script();
5272
+ }));
5273
+ //#endregion
5274
+ //#region src/file/paragraph/math/math.ts
5275
+ var Math$1;
5276
+ var init_math$1 = __esmMin((() => {
5277
+ init_xml_components();
5278
+ Math$1 = class extends XmlComponent {
5279
+ constructor(options) {
5280
+ super("m:oMath");
5281
+ for (const child of options.children) this.root.push(child);
5282
+ }
5283
+ };
5284
+ }));
5285
+ //#endregion
5286
+ //#region src/file/paragraph/math/math-parse.ts
5287
+ /**
5288
+ * OMML XML parser for math components.
5289
+ *
5290
+ * Parses m:oMath Element trees into MathJson format for round-trip support.
5291
+ *
5292
+ * @module
5293
+ */
5294
+ /**
5295
+ * Parse all math children from an m:oMath (or similar container) element.
5296
+ *
5297
+ * Iterates over child elements and dispatches to specific parsers based on
5298
+ * element name. Unknown elements are returned as-is for passthrough.
5299
+ */
5300
+ function parseMathChildren(el) {
5301
+ const result = [];
5302
+ for (const child of el.elements ?? []) {
5303
+ const parsed = parseMathElement(child);
5304
+ if (parsed !== void 0) result.push(parsed);
5305
+ }
5306
+ return result;
5307
+ }
5308
+ /**
5309
+ * Parse a single math element into its MathJson representation.
5310
+ *
5311
+ * Returns `undefined` for property elements (m:*Pr) that are not standalone content.
5312
+ */
5313
+ function parseMathElement(el) {
5314
+ switch (el.name) {
5315
+ case "m:r": return parseMathRun(el);
5316
+ case "m:f": return parseMathFraction(el);
5317
+ case "m:rad": return parseMathRadical(el);
5318
+ case "m:sSup": return parseMathSuperScript(el);
5319
+ case "m:sSub": return parseMathSubScript(el);
5320
+ case "m:sSubSup": return parseMathSubSuperScript(el);
5321
+ case "m:nary": return parseMathNAry(el);
5322
+ case "m:func": return parseMathFunction(el);
5323
+ case "m:d": return parseMathDelimiter(el);
5324
+ case "m:m": return parseMathMatrix(el);
5325
+ case "m:acc": return parseMathAccent(el);
5326
+ case "m:bar": return parseMathBar(el);
5327
+ case "m:borderBox": return { borderBox: { children: parseMathArg(el, "m:e") } };
5328
+ case "m:box": return { box: { children: parseMathArg(el, "m:e") } };
5329
+ case "m:groupChr": return { groupChr: { children: parseMathArg(el, "m:e") } };
5330
+ case "m:phant": return { phant: { children: parseMathArg(el, "m:e") } };
5331
+ case "m:eqArr": return parseMathEqArr(el);
5332
+ case "m:limLow": return parseMathLimitLower(el);
5333
+ case "m:limUpp": return parseMathLimitUpper(el);
5334
+ case "m:rPr":
5335
+ case "m:fPr":
5336
+ case "m:radPr":
5337
+ case "m:sSupPr":
5338
+ case "m:sSubPr":
5339
+ case "m:sSubSupPr":
5340
+ case "m:naryPr":
5341
+ case "m:funcPr":
5342
+ case "m:dPr":
5343
+ case "m:mPr":
5344
+ case "m:accPr":
5345
+ case "m:barPr":
5346
+ case "m:borderBoxPr":
5347
+ case "m:boxPr":
5348
+ case "m:groupChrPr":
5349
+ case "m:phantPr":
5350
+ case "m:eqArrPr":
5351
+ case "m:limLowPr":
5352
+ case "m:limUppPr":
5353
+ case "m:ctrlPr": return;
5354
+ default: return;
5355
+ }
5356
+ }
5357
+ /** Parse m:r → string or { text } */
5358
+ function parseMathRun(el) {
5359
+ const text = textOf(findChild(el, "m:t"));
5360
+ if (text) return text;
5361
+ return text;
5362
+ }
5363
+ /** Parse m:f → { fraction: { numerator, denominator } } */
5364
+ function parseMathFraction(el) {
5365
+ return { fraction: {
5366
+ numerator: parseMathArg(el, "m:num"),
5367
+ denominator: parseMathArg(el, "m:den")
5368
+ } };
5369
+ }
5370
+ /** Parse m:rad → { radical: { children, degree? } } */
5371
+ function parseMathRadical(el) {
5372
+ const degree = parseMathArg(el, "m:deg");
5373
+ return { radical: {
5374
+ children: parseMathArg(el, "m:e"),
5375
+ ...degree.length > 0 ? { degree } : {}
5376
+ } };
5377
+ }
5378
+ /** Parse m:sSup → { superScript: { children, superScript } } */
5379
+ function parseMathSuperScript(el) {
5380
+ return { superScript: {
5381
+ children: parseMathArg(el, "m:e"),
5382
+ superScript: parseMathArg(el, "m:sup")
5383
+ } };
5384
+ }
5385
+ /** Parse m:sSub → { subScript: { children, subScript } } */
5386
+ function parseMathSubScript(el) {
5387
+ return { subScript: {
5388
+ children: parseMathArg(el, "m:e"),
5389
+ subScript: parseMathArg(el, "m:sub")
5390
+ } };
5391
+ }
5392
+ /** Parse m:sSubSup → { subSuperScript: { children, subScript, superScript } } */
5393
+ function parseMathSubSuperScript(el) {
5394
+ return { subSuperScript: {
5395
+ children: parseMathArg(el, "m:e"),
5396
+ subScript: parseMathArg(el, "m:sub"),
5397
+ superScript: parseMathArg(el, "m:sup")
5398
+ } };
5399
+ }
5400
+ /**
5401
+ * Parse m:nary → { sum: ... } | { integral: ... }
5402
+ *
5403
+ * Distinguishes between sum and integral based on m:naryPr/m:chr/@m:val:
5404
+ * - "∑" → sum
5405
+ * - "∫" or empty → integral
5406
+ */
5407
+ function parseMathNAry(el) {
5408
+ const naryPr = findChild(el, "m:naryPr");
5409
+ const chrEl = naryPr ? findChild(naryPr, "m:chr") : void 0;
5410
+ const chrVal = chrEl ? attr(chrEl, "m:val") : void 0;
5411
+ const baseChildren = parseMathArg(el, "m:e");
5412
+ const sub = parseMathArg(el, "m:sub");
5413
+ const sup = parseMathArg(el, "m:sup");
5414
+ const common = {
5415
+ children: baseChildren,
5416
+ ...sub.length > 0 ? { subScript: sub } : {},
5417
+ ...sup.length > 0 ? { superScript: sup } : {}
5418
+ };
5419
+ if (chrVal === "∑") return { sum: common };
5420
+ return { integral: common };
5421
+ }
5422
+ /** Parse m:func → { function: { name, children } } */
5423
+ function parseMathFunction(el) {
5424
+ return { function: {
5425
+ name: parseMathArg(el, "m:fName"),
5426
+ children: parseMathArg(el, "m:e")
5427
+ } };
5428
+ }
5429
+ /**
5430
+ * Parse m:d → { roundBrackets | squareBrackets | curlyBrackets | angledBrackets }
5431
+ *
5432
+ * Determines bracket type from m:dPr/m:begChr/@m:val:
5433
+ * - "(" → roundBrackets
5434
+ * - "[" → squareBrackets
5435
+ * - "{" → curlyBrackets
5436
+ * - default → roundBrackets (parentheses are the default delimiter)
5437
+ */
5438
+ function parseMathDelimiter(el) {
5439
+ const dPr = findChild(el, "m:dPr");
5440
+ const begChrEl = dPr ? findChild(dPr, "m:begChr") : void 0;
5441
+ const begChr = begChrEl ? attr(begChrEl, "m:val") : "(";
5442
+ const mathChildren = parseMathArg(el, "m:e");
5443
+ switch (begChr) {
5444
+ case "[": return { squareBrackets: mathChildren };
5445
+ case "{": return { curlyBrackets: mathChildren };
5446
+ case "<":
5447
+ case "⟨": return { angledBrackets: mathChildren };
5448
+ default: return { roundBrackets: mathChildren };
5449
+ }
5450
+ }
5451
+ /** Parse m:m → { matrix: { rows } } */
5452
+ function parseMathMatrix(el) {
5453
+ const rows = [];
5454
+ for (const mr of children(el, "m:mr")) rows.push(parseMathArg(mr, "m:e"));
5455
+ return { matrix: { rows } };
5456
+ }
5457
+ /**
5458
+ * Parse m:acc → { accent: { children, accentCharacter? } }
5459
+ *
5460
+ * Reads accent character from m:accPr/m:chr/@m:val.
5461
+ */
5462
+ function parseMathAccent(el) {
5463
+ const accPr = findChild(el, "m:accPr");
5464
+ const chrEl = accPr ? findChild(accPr, "m:chr") : void 0;
5465
+ const accentChar = chrEl ? attr(chrEl, "m:val") : void 0;
5466
+ return { accent: {
5467
+ children: parseMathArg(el, "m:e"),
5468
+ ...accentChar ? { accentCharacter: accentChar } : {}
5469
+ } };
5470
+ }
5471
+ /** Parse m:bar → { bar: { children, type } } */
5472
+ function parseMathBar(el) {
5473
+ const barPr = findChild(el, "m:barPr");
5474
+ const posEl = barPr ? findChild(barPr, "m:pos") : void 0;
5475
+ const pos = posEl ? attr(posEl, "m:val") : "top";
5476
+ return { bar: {
5477
+ children: parseMathArg(el, "m:e"),
5478
+ type: pos ?? "top"
5479
+ } };
5480
+ }
5481
+ /** Parse m:eqArr → { eqArr: { rows } } */
5482
+ function parseMathEqArr(el) {
5483
+ const rows = [];
5484
+ for (const e of children(el, "m:e")) rows.push(parseMathChildren(e));
5485
+ return { eqArr: { rows } };
5486
+ }
5487
+ /** Parse m:limLow → { limitLower: { children, limit } } */
5488
+ function parseMathLimitLower(el) {
5489
+ return { limitLower: {
5490
+ children: parseMathArg(el, "m:e"),
5491
+ limit: parseMathArg(el, "m:lim")
5492
+ } };
5493
+ }
5494
+ /** Parse m:limUpp → { limitUpper: { children, limit } } */
5495
+ function parseMathLimitUpper(el) {
5496
+ return { limitUpper: {
5497
+ children: parseMathArg(el, "m:e"),
5498
+ limit: parseMathArg(el, "m:lim")
5499
+ } };
5500
+ }
5501
+ /**
5502
+ * Parse a container element's math children.
5503
+ *
5504
+ * Used for m:e, m:num, m:den, m:sub, m:sup, m:lim, m:fName, m:deg
5505
+ * — all of which are CT_OMathArg containers that hold math child elements.
5506
+ */
5507
+ function parseMathArg(parent, childName) {
5508
+ const container = findChild(parent, childName);
5509
+ if (!container) return [];
5510
+ return parseMathChildren(container);
5511
+ }
5512
+ var init_math_parse = __esmMin((() => {}));
5513
+ //#endregion
5514
+ //#region src/file/paragraph/math/math-component.ts
5515
+ var WORKAROUND4;
5516
+ var init_math_component = __esmMin((() => {
5517
+ WORKAROUND4 = "";
5518
+ }));
5519
+ //#endregion
5520
+ //#region src/file/paragraph/math/math-para.ts
5521
+ var createMathParagraphProperties, MathParagraph;
5522
+ var init_math_para = __esmMin((() => {
5523
+ init_xml_components();
5524
+ init_math$1();
5525
+ createMathParagraphProperties = (justification) => new BuilderElement({
5526
+ children: [new BuilderElement({
5527
+ attributes: { val: {
5528
+ key: "m:val",
5529
+ value: justification
5530
+ } },
5531
+ name: "m:jc"
5532
+ })],
5533
+ name: "m:oMathParaPr"
5534
+ });
5535
+ MathParagraph = class extends XmlComponent {
5536
+ constructor(options) {
5537
+ super("m:oMathPara");
5538
+ if (options.justification) this.root.push(createMathParagraphProperties(options.justification));
5539
+ for (const child of options.children) this.root.push(new Math$1(child));
5540
+ }
5541
+ };
5542
+ }));
5543
+ //#endregion
5544
+ //#region src/file/paragraph/math/math-pr.ts
5545
+ var createMathProperties;
5546
+ var init_math_pr = __esmMin((() => {
5547
+ init_xml_components();
5548
+ createMathProperties = (options) => {
5549
+ const children = [];
5550
+ if (options.mathFont !== void 0) children.push(new BuilderElement({
5551
+ attributes: { val: {
5552
+ key: "m:val",
5553
+ value: options.mathFont
5554
+ } },
5555
+ name: "m:mathFont"
5556
+ }));
5557
+ if (options.breakBin !== void 0) children.push(new BuilderElement({
5558
+ attributes: { val: {
5559
+ key: "m:val",
5560
+ value: options.breakBin
5561
+ } },
5562
+ name: "m:brkBin"
5563
+ }));
5564
+ if (options.breakBinSub !== void 0) children.push(new BuilderElement({
5565
+ attributes: { val: {
5566
+ key: "m:val",
5567
+ value: options.breakBinSub
5568
+ } },
5569
+ name: "m:brkBinSub"
5570
+ }));
5571
+ if (options.smallFrac !== void 0) children.push(new OnOffElement("m:smallFrac", options.smallFrac));
5572
+ if (options.displayDefault !== void 0) children.push(new OnOffElement("m:dispDef", options.displayDefault));
5573
+ if (options.leftMargin !== void 0) children.push(new BuilderElement({
5574
+ attributes: { val: {
5575
+ key: "m:val",
5576
+ value: options.leftMargin.toString()
5577
+ } },
5578
+ name: "m:lMargin"
5579
+ }));
5580
+ if (options.rightMargin !== void 0) children.push(new BuilderElement({
5581
+ attributes: { val: {
5582
+ key: "m:val",
5583
+ value: options.rightMargin.toString()
5584
+ } },
5585
+ name: "m:rMargin"
5586
+ }));
5587
+ if (options.defaultJustification !== void 0) children.push(new BuilderElement({
5588
+ attributes: { val: {
5589
+ key: "m:val",
5590
+ value: options.defaultJustification
5591
+ } },
5592
+ name: "m:defJc"
5593
+ }));
5594
+ if (options.preSpacing !== void 0) children.push(new BuilderElement({
5595
+ attributes: { val: {
5596
+ key: "m:val",
5597
+ value: options.preSpacing.toString()
5598
+ } },
5599
+ name: "m:preSp"
5600
+ }));
5601
+ if (options.postSpacing !== void 0) children.push(new BuilderElement({
5602
+ attributes: { val: {
5603
+ key: "m:val",
5604
+ value: options.postSpacing.toString()
5605
+ } },
5606
+ name: "m:postSp"
5607
+ }));
5608
+ if (options.interSpacing !== void 0) children.push(new BuilderElement({
5609
+ attributes: { val: {
5610
+ key: "m:val",
5611
+ value: options.interSpacing.toString()
5612
+ } },
5613
+ name: "m:interSp"
5614
+ }));
5615
+ if (options.intraSpacing !== void 0) children.push(new BuilderElement({
5616
+ attributes: { val: {
5617
+ key: "m:val",
5618
+ value: options.intraSpacing.toString()
5619
+ } },
5620
+ name: "m:intraSp"
5621
+ }));
5622
+ if (options.wrapIndent !== void 0) children.push(new BuilderElement({
5623
+ attributes: { val: {
5624
+ key: "m:val",
5625
+ value: options.wrapIndent.toString()
5626
+ } },
5627
+ name: "m:wrapIndent"
5628
+ }));
5629
+ if (options.wrapRight !== void 0) children.push(new OnOffElement("m:wrapRight", options.wrapRight));
5630
+ if (options.integralLimitLocation !== void 0) children.push(new BuilderElement({
5631
+ attributes: { val: {
5632
+ key: "m:val",
5633
+ value: options.integralLimitLocation
5634
+ } },
5635
+ name: "m:intLim"
5636
+ }));
5637
+ if (options.naryLimitLocation !== void 0) children.push(new BuilderElement({
5638
+ attributes: { val: {
5639
+ key: "m:val",
5640
+ value: options.naryLimitLocation
5641
+ } },
5642
+ name: "m:naryLim"
5643
+ }));
5644
+ return new BuilderElement({
5645
+ children,
5646
+ name: "m:mathPr"
5647
+ });
5648
+ };
5649
+ }));
5650
+ //#endregion
5651
+ //#region src/file/paragraph/math/matrix/index.ts
5652
+ var init_matrix = __esmMin((() => {
5653
+ init_math_matrix();
5654
+ init_math_matrix_properties();
5655
+ }));
5656
+ //#endregion
5657
+ //#region src/file/paragraph/math/phant/index.ts
5658
+ var init_phant = __esmMin((() => {
5659
+ init_math_phant();
5660
+ init_math_phant_properties();
5661
+ }));
5662
+ //#endregion
5663
+ //#region src/file/paragraph/math/radical/index.ts
5664
+ var init_radical = __esmMin((() => {
5665
+ init_math_degree();
5666
+ init_math_radical();
5667
+ init_math_radical_properties();
5668
+ }));
5669
+ //#endregion
5261
5670
  //#region src/file/paragraph/math/index.ts
5262
5671
  var init_math = __esmMin((() => {
5263
5672
  init_accent();
@@ -5269,7 +5678,9 @@ var init_math = __esmMin((() => {
5269
5678
  init_fraction();
5270
5679
  init_function();
5271
5680
  init_group_chr();
5681
+ init_math_coerce();
5272
5682
  init_math$1();
5683
+ init_math_parse();
5273
5684
  init_math_component();
5274
5685
  init_math_control_properties();
5275
5686
  init_math_para();
@@ -6015,7 +6426,7 @@ var init_paragraph$1 = __esmMin((() => {
6015
6426
  init_break();
6016
6427
  init_links();
6017
6428
  init_math();
6018
- init_math_run();
6429
+ init_math_coerce();
6019
6430
  init_reference_run$1();
6020
6431
  init_reference_run();
6021
6432
  init_properties();
@@ -6097,12 +6508,7 @@ var init_paragraph$1 = __esmMin((() => {
6097
6508
  }
6098
6509
  continue;
6099
6510
  } else if ("math" in rawChild && typeof rawChild === "object" && rawChild !== null && typeof rawChild.math === "object" && rawChild.math !== null) {
6100
- const coercedChildren = rawChild.math.children?.map((c) => {
6101
- if (c instanceof BaseXmlComponent) return c;
6102
- if (typeof c === "string") return new MathRun(c);
6103
- if (typeof c === "object" && c !== null) return new MathRun(c);
6104
- return c;
6105
- });
6511
+ const coercedChildren = rawChild.math.children?.map(coerceMathJson);
6106
6512
  child = new Math$1(coercedChildren ? { children: coercedChildren } : { children: [] });
6107
6513
  } else if ("symbolRun" in rawChild) child = new SymbolRun(rawChild.symbolRun);
6108
6514
  else if ("footnoteReference" in rawChild) child = new FootnoteReferenceRun(rawChild.footnoteReference);
@@ -14303,6 +14709,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
14303
14709
  buildDocumentAttributes: () => buildDocumentAttributes,
14304
14710
  buildRunProperties: () => buildRunProperties,
14305
14711
  chartAttr: () => chartAttr,
14712
+ coerceMathJson: () => coerceMathJson,
14306
14713
  coerceSectionChild: () => coerceSectionChild,
14307
14714
  convertToXmlComponent: () => convertToXmlComponent,
14308
14715
  createAlignment: () => createAlignment,
@@ -14381,6 +14788,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
14381
14788
  getColorXml: () => getColorXml,
14382
14789
  getLayoutXml: () => getLayoutXml,
14383
14790
  getStyleXml: () => getStyleXml,
14791
+ parseMathChildren: () => parseMathChildren,
14384
14792
  sectionMarginDefaults: () => sectionMarginDefaults,
14385
14793
  sectionPageSizeDefaults: () => sectionPageSizeDefaults,
14386
14794
  wrapEl: () => wrapEl
@@ -17781,7 +18189,7 @@ var Compiler = class {
17781
18189
  data: (() => {
17782
18190
  let xmlData = documentMediaDatas.length > 0 ? replaceImagePlaceholders(documentXmlData, documentMediaDatas, documentRelationshipCount, "rId") : documentXmlData;
17783
18191
  if (hasPlaceholders(xmlData)) {
17784
- xmlData = replaceChartPlaceholders(xmlData, file.Charts.Array.map((c) => c.key), documentRelationshipCount, "rId");
18192
+ xmlData = replaceChartPlaceholders(xmlData, file.Charts.Array.map((c) => c.key), documentRelationshipCount + documentMediaDatas.length, "rId");
17785
18193
  const smartArtDataOffset = documentRelationshipCount + documentMediaDatas.length + file.Charts.Array.length;
17786
18194
  xmlData = replaceSmartArtPlaceholders(xmlData, file.SmartArts.Array.map((s) => s.key), smartArtDataOffset, "rId");
17787
18195
  }
@@ -19168,7 +19576,7 @@ function imageTypeFromPath(path) {
19168
19576
  }
19169
19577
  }
19170
19578
  /**
19171
- * Parse a w:drawing element and return an IRunOptions with image data.
19579
+ * Parse a w:drawing element and return image data wrapped in { image: ... }.
19172
19580
  */
19173
19581
  function parseImageRun(el, ctx) {
19174
19582
  const inline = findDeep(el, "wp:inline")[0];
@@ -19237,7 +19645,7 @@ function parseImageRun(el, ctx) {
19237
19645
  if (attrBool(anchor, "behindDoc")) floating.behindDocument = true;
19238
19646
  if (Object.keys(floating).length > 0) imageOpts.floating = floating;
19239
19647
  }
19240
- return imageOpts;
19648
+ return { image: imageOpts };
19241
19649
  }
19242
19650
  function getDrawingExtent(el) {
19243
19651
  const inline = findDeep(el, "wp:inline")[0];
@@ -19746,6 +20154,7 @@ function parsedRunToOptions(parsed) {
19746
20154
  * @module
19747
20155
  */
19748
20156
  init_style();
20157
+ init_math_parse();
19749
20158
  const HEADING_MAP = {
19750
20159
  Heading1: HeadingLevel.HEADING_1,
19751
20160
  Heading2: HeadingLevel.HEADING_2,
@@ -19973,6 +20382,11 @@ function parseParagraph(el, ctx) {
19973
20382
  if (id !== void 0) childList.push({ commentReference: id });
19974
20383
  break;
19975
20384
  }
20385
+ case "m:oMath": {
20386
+ const mathChildren = parseMathChildren(child);
20387
+ childList.push({ math: { children: mathChildren } });
20388
+ break;
20389
+ }
19976
20390
  default:
19977
20391
  if (child.name && child.elements && child.elements.length > 0) childList.push(new RawPassthrough(child));
19978
20392
  break;
@@ -20829,6 +21243,114 @@ function parseSectionChildrenElements(elements, ctx) {
20829
21243
  return elements.map((el) => parseSectionChild(el, ctx));
20830
21244
  }
20831
21245
  //#endregion
21246
+ //#region src/parse/custom-properties.ts
21247
+ /**
21248
+ * Parse docProps/custom.xml into custom property entries.
21249
+ *
21250
+ * XML format:
21251
+ * ```xml
21252
+ * <property name="..." fmtid="..." pid="2">
21253
+ * <vt:lpwstr>value</vt:lpwstr>
21254
+ * </property>
21255
+ * ```
21256
+ */
21257
+ function parseCustomProperties(el) {
21258
+ if (!el) return [];
21259
+ const result = [];
21260
+ for (const child of el.elements ?? []) {
21261
+ if (child.name !== "property") continue;
21262
+ const name = attr(child, "name");
21263
+ if (!name) continue;
21264
+ const valueEl = child.elements?.find((e) => e.name?.startsWith("vt:"));
21265
+ const value = valueEl ? textOf(valueEl) ?? "" : "";
21266
+ result.push({
21267
+ name,
21268
+ value
21269
+ });
21270
+ }
21271
+ return result;
21272
+ }
21273
+ //#endregion
21274
+ //#region src/parse/settings.ts
21275
+ /**
21276
+ * Parse word/settings.xml Element into IPropertiesOptions fields.
21277
+ */
21278
+ function parseSettings(el) {
21279
+ if (!el) return {};
21280
+ const opts = {};
21281
+ if (findChild(el, "w:evenAndOddHeaders")) opts.evenAndOddHeaderAndFooters = true;
21282
+ const viewEl = findChild(el, "w:view");
21283
+ if (viewEl) {
21284
+ const val = attr(viewEl, "w:val");
21285
+ if (val) opts.view = val;
21286
+ }
21287
+ const zoomEl = findChild(el, "w:zoom");
21288
+ if (zoomEl) {
21289
+ const zoom = {};
21290
+ const percent = attr(zoomEl, "w:percent");
21291
+ if (percent) zoom.percent = parseInt(percent, 10);
21292
+ const val = attr(zoomEl, "w:val");
21293
+ if (val) zoom.val = val;
21294
+ if (Object.keys(zoom).length > 0) opts.zoom = zoom;
21295
+ }
21296
+ const tabStopEl = findChild(el, "w:defaultTabStop");
21297
+ if (tabStopEl) {
21298
+ const val = attr(tabStopEl, "w:val");
21299
+ if (val) opts.defaultTabStop = parseInt(val, 10);
21300
+ }
21301
+ if (findChild(el, "w:trackRevisions")) {
21302
+ const features = opts.features ?? {};
21303
+ features.trackRevisions = true;
21304
+ opts.features = features;
21305
+ }
21306
+ if (findChild(el, "w:updateFields")) {
21307
+ const features = opts.features ?? {};
21308
+ features.updateFields = true;
21309
+ opts.features = features;
21310
+ }
21311
+ const compatEl = findChild(el, "w:compat");
21312
+ if (compatEl) {
21313
+ for (const child of compatEl.elements ?? []) if (child.name === "w:compatSetting") {
21314
+ if (attr(child, "w:name") === "compatibilityMode") {
21315
+ const val = attr(child, "w:val");
21316
+ if (val) opts.compatabilityModeVersion = parseInt(val, 10);
21317
+ }
21318
+ }
21319
+ }
21320
+ const docVarsEl = findChild(el, "w:docVars");
21321
+ if (docVarsEl) {
21322
+ const vars = [];
21323
+ for (const child of docVarsEl.elements ?? []) if (child.name === "w:docVar") {
21324
+ const name = attr(child, "w:name");
21325
+ const val = attr(child, "w:val");
21326
+ if (name && val) vars.push({
21327
+ name,
21328
+ val
21329
+ });
21330
+ }
21331
+ if (vars.length > 0) opts.docVars = vars;
21332
+ }
21333
+ const bgEl = findChild(el, "w:background");
21334
+ if (bgEl) {
21335
+ const bg = {};
21336
+ const color = attr(bgEl, "w:color");
21337
+ if (color) bg.color = color;
21338
+ const themeColor = attr(bgEl, "w:themeColor");
21339
+ if (themeColor) bg.themeColor = themeColor;
21340
+ if (Object.keys(bg).length > 0) opts.background = bg;
21341
+ }
21342
+ const cscEl = findChild(el, "w:characterSpacingControl");
21343
+ if (cscEl) {
21344
+ const val = attr(cscEl, "w:val");
21345
+ if (val) opts.characterSpacingControl = val;
21346
+ }
21347
+ if (findChild(el, "w:displayBackgroundShape")) opts.displayBackgroundShape = true;
21348
+ if (findChild(el, "w:embedTrueTypeFonts")) opts.embedTrueTypeFonts = true;
21349
+ if (findChild(el, "w:embedSystemFonts")) opts.embedSystemFonts = true;
21350
+ if (findChild(el, "w:saveSubsetFonts")) opts.saveSubsetFonts = true;
21351
+ return opts;
21352
+ }
21353
+ //#endregion
20832
21354
  //#region src/parse/styles.ts
20833
21355
  /**
20834
21356
  * Style cache builder for DOCX parsing.
@@ -20929,19 +21451,41 @@ function parseRootRels(doc) {
20929
21451
  };
20930
21452
  }
20931
21453
  /**
20932
- * Parse a .docx file and convert it into ISectionOptions[].
21454
+ * Parse a .docx file and convert it into IPropertiesOptions.
20933
21455
  *
20934
21456
  * This is the main public API for parsing DOCX files.
20935
- * The returned options can be passed directly to `new Document({ sections })`
21457
+ * The returned options can be passed directly to `new Document(parsed)`
20936
21458
  * to recreate the document.
20937
21459
  *
20938
21460
  * @param data - Raw bytes of a .docx file
20939
- * @returns Array of section options
21461
+ * @returns Document options including sections and metadata
20940
21462
  */
20941
21463
  function parseDocument(data) {
20942
21464
  const docx = parseDocx(data);
20943
21465
  const ctx = new ParseContext(docx, buildStyleCache(docx), buildNumberingCache(docx));
20944
- return parseBody(docx.body, ctx);
21466
+ const opts = { sections: parseBody(docx.body, ctx) };
21467
+ if (docx.coreProps) {
21468
+ const corePropsEl = docx.doc.get(docx.coreProps);
21469
+ if (corePropsEl) {
21470
+ const cp = parseCorePropsElement(corePropsEl);
21471
+ if (cp.title) opts.title = cp.title;
21472
+ if (cp.subject) opts.subject = cp.subject;
21473
+ if (cp.creator) opts.creator = cp.creator;
21474
+ if (cp.keywords) opts.keywords = cp.keywords;
21475
+ if (cp.description) opts.description = cp.description;
21476
+ if (cp.lastModifiedBy) opts.lastModifiedBy = cp.lastModifiedBy;
21477
+ if (cp.revision) opts.revision = parseInt(cp.revision, 10);
21478
+ }
21479
+ }
21480
+ if (docx.settings) Object.assign(opts, parseSettings(docx.settings));
21481
+ if (docx.customProps) {
21482
+ const customPropsEl = docx.doc.get(docx.customProps);
21483
+ if (customPropsEl) {
21484
+ const cpEntries = parseCustomProperties(customPropsEl);
21485
+ if (cpEntries.length > 0) opts.customProperties = cpEntries;
21486
+ }
21487
+ }
21488
+ return opts;
20945
21489
  }
20946
21490
  function parseDocx(data) {
20947
21491
  const doc = parseArchive(data);
@@ -21246,6 +21790,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
21246
21790
  buildDocumentAttributes: () => buildDocumentAttributes,
21247
21791
  buildRunProperties: () => buildRunProperties,
21248
21792
  chartAttr: () => chartAttr,
21793
+ coerceMathJson: () => coerceMathJson,
21249
21794
  coerceSectionChild: () => coerceSectionChild,
21250
21795
  concreteNumUniqueNumericIdGen: () => concreteNumUniqueNumericIdGen,
21251
21796
  convertInchesToTwip: () => convertInchesToTwip,
@@ -21332,6 +21877,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
21332
21877
  parseArchive: () => parseArchive,
21333
21878
  parseDocument: () => parseDocument,
21334
21879
  parseDocx: () => parseDocx,
21880
+ parseMathChildren: () => parseMathChildren,
21335
21881
  patchDetector: () => patchDetector,
21336
21882
  patchDocument: () => patchDocument,
21337
21883
  sectionMarginDefaults: () => sectionMarginDefaults,
@@ -21344,6 +21890,6 @@ var src_exports = /* @__PURE__ */ __exportAll({
21344
21890
  __reExport(src_exports, file_exports);
21345
21891
  __reExport(src_exports, util_exports);
21346
21892
  //#endregion
21347
- export { AbstractNumbering, AlignmentType, AltChunk, AltChunkCollection, AnnotationReference, Attributes, BaseXmlComponent, Bdo, Bibliography, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, COLOR_CATEGORIES, CarriageReturn, CellMerge, CellMergeAttributes, CharacterSet, ChartCollection, ChartRun, ChartSpace, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, DEFAULT_DRAWING_XML, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, Dir, File as Document, File, DocumentAttributeNamespaces, DocumentBackground, DocumentBackgroundAttributes, DocumentDefaults, DocumentGridType, Drawing, DropCapType, EMPTY_OBJECT, EditGroupType, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, EndnoteReferenceRunAttributes, Endnotes, ExternalHyperlink, FootNoteReferenceRunAttributes, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FormFieldTextType, FractionType, FrameAnchorType, FrameWrap, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HpsMeasureElement, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LAYOUT_CATEGORIES, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathBorderBox, MathBox, MathCurlyBrackets, MathDegree, MathDenominator, MathEqArr, MathFraction, MathFunction, MathFunctionName, MathGroupChr, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathMatrix, MathNumerator, MathParagraph, MathPhant, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, MoveFromRangeEnd, MoveFromRangeStart, MoveToRangeEnd, MoveToRangeStart, MovedFromTextRun, MovedToTextRun, NextAttributeComponent, NoBreakHyphen, NumberFormat, NumberProperties, NumberValueElement, NumberedItemReference, NumberedItemReferenceFormat, Numbering, OnOffElement, OverlapType, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PermEnd, PermStart, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, PrettifyType, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, STYLE_CATEGORIES, SdtDateMappingType, SdtLock, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SmartArtCollection, SmartArtRun, SoftHyphen, SpaceType, StringContainer, StringEnumValueElement, StringValueElement, StructuredDocumentTagBlock, StructuredDocumentTagCell, StructuredDocumentTagContent, StructuredDocumentTagProperties, StructuredDocumentTagRow, StructuredDocumentTagRun, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SubDoc, SubDocCollection, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TablePropertyExceptions, TableRow, TableRowProperties, TableRowPropertiesChange, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextRun, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, Textbox, TextboxTightWrapType, ThematicBreak, UnderlineType, VerticalAlign, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WORKAROUND4, WidthType, WpgGroupRun, WpsShapeRun, XmlAttributeComponent, XmlComponent, YearLong, YearShort, abstractNumUniqueNumericIdGen, bookmarkUniqueNumericIdGen, buildDocumentAttributes, buildRunProperties, chartAttr, coerceSectionChild, concreteNumUniqueNumericIdGen, convertInchesToTwip, convertMillimetersToTwip, convertToXmlComponent, createAlignment, createBodyProperties, createBorderElement, createBreak, createCnfStyle, createColumns, createDataModel, createDivId, createDocumentGrid, createDotEmphasisMark, createEmphasisMark, createFormFieldData, createFrameProperties, createHeaderFooterReference, createHorizontalPosition, createIndent, createLineNumberType, createMathAccent, createMathAccentCharacter, createMathAccentProperties, createMathBar, createMathBarProperties, createMathBase, createMathBorderBoxProperties, createMathBoxProperties, createMathControlProperties, createMathEqArrProperties, createMathFractionProperties, createMathFunctionProperties, createMathGroupChrProperties, createMathLimitLocation, createMathLimitLowProperties, createMathLimitUpperProperties, createMathMatrixProperties, createMathNAryProperties, createMathPhantProperties, createMathPreSubSuperScriptProperties, createMathProperties, createMathRunProperties, createMathSubScriptElement, createMathSubScriptProperties, createMathSubSuperScriptProperties, createMathSuperScriptElement, createMathSuperScriptProperties, createOutlineLevel, createPageMargin, createPageNumberType, createPageSize, createParagraphStyle, createRuby, createRunFonts, createSectionType, createShading, createSimplePos, createSpacing, createStringElement, createTabStop, createTabStopItem, createTableFloatProperties, createTableLayout, createTableLook, createTableOverlap, createTableRowHeight, createTableWidthElement, createTransformation, createUnderline, createVerticalAlign, createVerticalPosition, createWrapNone, createWrapSquare, createWrapThrough, createWrapTight, createWrapTopAndBottom, docPropertiesUniqueNumericIdGen, getColorXml, getLayoutXml, getStyleXml, hashedId, parseArchive, parseDocument, parseDocx, patchDetector, patchDocument, sectionMarginDefaults, sectionPageSizeDefaults, uniqueId, uniqueNumericIdCreator, uniqueUuid, wrapEl };
21893
+ export { AbstractNumbering, AlignmentType, AltChunk, AltChunkCollection, AnnotationReference, Attributes, BaseXmlComponent, Bdo, Bibliography, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, COLOR_CATEGORIES, CarriageReturn, CellMerge, CellMergeAttributes, CharacterSet, ChartCollection, ChartRun, ChartSpace, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, DEFAULT_DRAWING_XML, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, Dir, File as Document, File, DocumentAttributeNamespaces, DocumentBackground, DocumentBackgroundAttributes, DocumentDefaults, DocumentGridType, Drawing, DropCapType, EMPTY_OBJECT, EditGroupType, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, EndnoteReferenceRunAttributes, Endnotes, ExternalHyperlink, FootNoteReferenceRunAttributes, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FormFieldTextType, FractionType, FrameAnchorType, FrameWrap, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HpsMeasureElement, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LAYOUT_CATEGORIES, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathBorderBox, MathBox, MathCurlyBrackets, MathDegree, MathDenominator, MathEqArr, MathFraction, MathFunction, MathFunctionName, MathGroupChr, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathMatrix, MathNumerator, MathParagraph, MathPhant, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, MoveFromRangeEnd, MoveFromRangeStart, MoveToRangeEnd, MoveToRangeStart, MovedFromTextRun, MovedToTextRun, NextAttributeComponent, NoBreakHyphen, NumberFormat, NumberProperties, NumberValueElement, NumberedItemReference, NumberedItemReferenceFormat, Numbering, OnOffElement, OverlapType, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PermEnd, PermStart, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, PrettifyType, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, STYLE_CATEGORIES, SdtDateMappingType, SdtLock, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SmartArtCollection, SmartArtRun, SoftHyphen, SpaceType, StringContainer, StringEnumValueElement, StringValueElement, StructuredDocumentTagBlock, StructuredDocumentTagCell, StructuredDocumentTagContent, StructuredDocumentTagProperties, StructuredDocumentTagRow, StructuredDocumentTagRun, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SubDoc, SubDocCollection, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TablePropertyExceptions, TableRow, TableRowProperties, TableRowPropertiesChange, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextRun, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, Textbox, TextboxTightWrapType, ThematicBreak, UnderlineType, VerticalAlign, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WORKAROUND4, WidthType, WpgGroupRun, WpsShapeRun, XmlAttributeComponent, XmlComponent, YearLong, YearShort, abstractNumUniqueNumericIdGen, bookmarkUniqueNumericIdGen, buildDocumentAttributes, buildRunProperties, chartAttr, coerceMathJson, coerceSectionChild, concreteNumUniqueNumericIdGen, convertInchesToTwip, convertMillimetersToTwip, convertToXmlComponent, createAlignment, createBodyProperties, createBorderElement, createBreak, createCnfStyle, createColumns, createDataModel, createDivId, createDocumentGrid, createDotEmphasisMark, createEmphasisMark, createFormFieldData, createFrameProperties, createHeaderFooterReference, createHorizontalPosition, createIndent, createLineNumberType, createMathAccent, createMathAccentCharacter, createMathAccentProperties, createMathBar, createMathBarProperties, createMathBase, createMathBorderBoxProperties, createMathBoxProperties, createMathControlProperties, createMathEqArrProperties, createMathFractionProperties, createMathFunctionProperties, createMathGroupChrProperties, createMathLimitLocation, createMathLimitLowProperties, createMathLimitUpperProperties, createMathMatrixProperties, createMathNAryProperties, createMathPhantProperties, createMathPreSubSuperScriptProperties, createMathProperties, createMathRunProperties, createMathSubScriptElement, createMathSubScriptProperties, createMathSubSuperScriptProperties, createMathSuperScriptElement, createMathSuperScriptProperties, createOutlineLevel, createPageMargin, createPageNumberType, createPageSize, createParagraphStyle, createRuby, createRunFonts, createSectionType, createShading, createSimplePos, createSpacing, createStringElement, createTabStop, createTabStopItem, createTableFloatProperties, createTableLayout, createTableLook, createTableOverlap, createTableRowHeight, createTableWidthElement, createTransformation, createUnderline, createVerticalAlign, createVerticalPosition, createWrapNone, createWrapSquare, createWrapThrough, createWrapTight, createWrapTopAndBottom, docPropertiesUniqueNumericIdGen, getColorXml, getLayoutXml, getStyleXml, hashedId, parseArchive, parseDocument, parseDocx, parseMathChildren, patchDetector, patchDocument, sectionMarginDefaults, sectionPageSizeDefaults, uniqueId, uniqueNumericIdCreator, uniqueUuid, wrapEl };
21348
21894
 
21349
21895
  //# sourceMappingURL=index.mjs.map