@syncfusion/ej2-office-common 35.1.37 → 35.1.42

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 (226) hide show
  1. package/dist/ej2-office-common.umd.min.js +2 -2
  2. package/dist/ej2-office-common.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-office-common.es2015.js +5421 -6017
  4. package/dist/es6/ej2-office-common.es2015.js.map +1 -1
  5. package/dist/es6/ej2-office-common.es5.js +6270 -7203
  6. package/dist/es6/ej2-office-common.es5.js.map +1 -1
  7. package/dist/global/ej2-office-common.min.js +2 -2
  8. package/dist/global/ej2-office-common.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/office-common.js +4 -0
  11. package/package.json +11 -7
  12. package/src/index.d.ts +3 -17
  13. package/src/index.js +3 -18
  14. package/src/office-common/features/index.d.ts +6 -0
  15. package/src/office-common/features/index.js +6 -0
  16. package/src/office-common/features/mathml/index.d.ts +25 -0
  17. package/src/office-common/features/mathml/index.js +22 -0
  18. package/src/office-common/features/mathml/latex/latex-generator.d.ts +8 -0
  19. package/src/office-common/features/mathml/latex/latex-generator.js +357 -0
  20. package/src/office-common/features/mathml/latex/latex-parser.d.ts +87 -0
  21. package/src/office-common/features/mathml/latex/latex-parser.js +1206 -0
  22. package/src/office-common/features/mathml/latex/latex-symbols.d.ts +13 -0
  23. package/src/office-common/features/mathml/latex/latex-symbols.js +681 -0
  24. package/src/office-common/features/mathml/math-settings.d.ts +54 -0
  25. package/src/office-common/features/mathml/math-settings.js +174 -0
  26. package/src/office-common/features/mathml/office-math/adapter.d.ts +59 -0
  27. package/src/office-common/features/mathml/office-math/adapter.js +6 -0
  28. package/src/office-common/features/mathml/office-math/basic.d.ts +91 -0
  29. package/src/office-common/features/mathml/office-math/basic.js +93 -0
  30. package/src/office-common/features/mathml/office-math/break.d.ts +30 -0
  31. package/src/office-common/features/mathml/office-math/break.js +75 -0
  32. package/src/office-common/features/mathml/office-math/collection.d.ts +104 -0
  33. package/src/office-common/features/mathml/office-math/collection.js +170 -0
  34. package/src/office-common/features/mathml/office-math/entity.d.ts +12 -0
  35. package/src/office-common/features/mathml/office-math/entity.js +3 -0
  36. package/src/office-common/features/mathml/office-math/enums.d.ts +97 -0
  37. package/src/office-common/features/mathml/office-math/enums.js +108 -0
  38. package/src/office-common/features/mathml/office-math/format.d.ts +28 -0
  39. package/src/office-common/features/mathml/office-math/format.js +90 -0
  40. package/src/office-common/features/mathml/office-math/function-base.d.ts +27 -0
  41. package/src/office-common/features/mathml/office-math/function-base.js +69 -0
  42. package/src/office-common/features/mathml/office-math/function-collection.d.ts +29 -0
  43. package/src/office-common/features/mathml/office-math/function-collection.js +76 -0
  44. package/src/office-common/features/mathml/office-math/functions-basic.d.ts +118 -0
  45. package/src/office-common/features/mathml/office-math/functions-basic.js +331 -0
  46. package/src/office-common/features/mathml/office-math/functions-multi.d.ts +156 -0
  47. package/src/office-common/features/mathml/office-math/functions-multi.js +407 -0
  48. package/src/office-common/features/mathml/office-math/index.d.ts +27 -0
  49. package/src/office-common/features/mathml/office-math/index.js +25 -0
  50. package/src/office-common/features/mathml/office-math/keys.d.ts +6 -0
  51. package/src/office-common/features/mathml/office-math/keys.js +20 -0
  52. package/src/office-common/features/mathml/office-math/math-clone.d.ts +20 -0
  53. package/src/office-common/features/mathml/office-math/math-clone.js +203 -0
  54. package/src/office-common/features/mathml/office-math/math-collection.d.ts +19 -0
  55. package/src/office-common/features/mathml/office-math/math-collection.js +41 -0
  56. package/src/office-common/features/mathml/office-math/math-equality.d.ts +21 -0
  57. package/src/office-common/features/mathml/office-math/math-equality.js +115 -0
  58. package/src/office-common/features/mathml/office-math/math-paragraph.d.ts +58 -0
  59. package/src/office-common/features/mathml/office-math/math-paragraph.js +126 -0
  60. package/src/office-common/features/mathml/office-math/math-traversal.d.ts +23 -0
  61. package/src/office-common/features/mathml/office-math/math-traversal.js +95 -0
  62. package/src/office-common/features/mathml/office-math/matrix-collections.d.ts +54 -0
  63. package/src/office-common/features/mathml/office-math/matrix-collections.js +113 -0
  64. package/src/office-common/features/mathml/office-math/matrix-column.d.ts +43 -0
  65. package/src/office-common/features/mathml/office-math/matrix-column.js +96 -0
  66. package/src/office-common/features/mathml/office-math/matrix-row.d.ts +38 -0
  67. package/src/office-common/features/mathml/office-math/matrix-row.js +71 -0
  68. package/src/office-common/features/mathml/office-math/matrix.d.ts +62 -0
  69. package/src/office-common/features/mathml/office-math/matrix.js +158 -0
  70. package/src/office-common/features/mathml/office-math/office-math.d.ts +55 -0
  71. package/src/office-common/features/mathml/office-math/office-math.js +116 -0
  72. package/src/office-common/features/mathml/office-math/owner-holder.d.ts +42 -0
  73. package/src/office-common/features/mathml/office-math/owner-holder.js +87 -0
  74. package/src/office-common/features/mathml/office-math/property-store.d.ts +66 -0
  75. package/src/office-common/features/mathml/office-math/property-store.js +99 -0
  76. package/src/office-common/features/mathml/office-math/run-element.d.ts +31 -0
  77. package/src/office-common/features/mathml/office-math/run-element.js +97 -0
  78. package/src/office-common/features/mathml/office-math/unknown-element.d.ts +37 -0
  79. package/src/office-common/features/mathml/office-math/unknown-element.js +62 -0
  80. package/src/office-common/features/mathml/office-math/xml-equal.d.ts +13 -0
  81. package/src/office-common/features/mathml/office-math/xml-equal.js +24 -0
  82. package/src/office-common/features/mathml/parse/office-math-parser.d.ts +24 -0
  83. package/src/office-common/features/mathml/parse/office-math-parser.js +396 -0
  84. package/src/office-common/features/mathml/parse/office-math-properties.d.ts +165 -0
  85. package/src/office-common/features/mathml/parse/office-math-properties.js +432 -0
  86. package/src/office-common/features/mathml/parse/parse-options.d.ts +22 -0
  87. package/src/office-common/features/mathml/parse/parse-options.js +3 -0
  88. package/src/office-common/features/mathml/serialize/office-math-properties-writer.d.ts +38 -0
  89. package/src/office-common/features/mathml/serialize/office-math-properties-writer.js +267 -0
  90. package/src/office-common/features/mathml/serialize/office-math-serializer.d.ts +23 -0
  91. package/src/office-common/features/mathml/serialize/office-math-serializer.js +306 -0
  92. package/src/office-common/features/mathml/serialize/omml-writer.d.ts +123 -0
  93. package/src/office-common/features/mathml/serialize/omml-writer.js +135 -0
  94. package/src/office-common/index.d.ts +10 -0
  95. package/src/office-common/index.js +10 -0
  96. package/.eslintrc.json +0 -263
  97. package/.prettierrc.json +0 -5
  98. package/api-extractor.json +0 -35
  99. package/core.js +0 -4
  100. package/encryption.js +0 -4
  101. package/features.js +0 -4
  102. package/global.json +0 -6
  103. package/nuget.config +0 -7
  104. package/src/all.d.ts +0 -41
  105. package/src/all.js +0 -38
  106. package/src/features/index.d.ts +0 -11
  107. package/src/features/index.js +0 -11
  108. package/src/features/mathml/index.d.ts +0 -30
  109. package/src/features/mathml/index.js +0 -22
  110. package/src/features/mathml/math-factory.d.ts +0 -26
  111. package/src/features/mathml/math-factory.js +0 -568
  112. package/src/features/mathml/model/controls.d.ts +0 -896
  113. package/src/features/mathml/model/controls.js +0 -1541
  114. package/src/features/mathml/model/math-element.d.ts +0 -173
  115. package/src/features/mathml/model/math-element.js +0 -315
  116. package/src/features/mathml/model/roots.d.ts +0 -82
  117. package/src/features/mathml/model/roots.js +0 -177
  118. package/src/features/mathml/parse/math-parser.d.ts +0 -43
  119. package/src/features/mathml/parse/math-parser.js +0 -636
  120. package/src/features/mathml/serialize/math-serializer.d.ts +0 -34
  121. package/src/features/mathml/serialize/math-serializer.js +0 -749
  122. package/tsconfig.build.json +0 -13
  123. package/tsconfig.harness.json +0 -32
  124. package/tslint.json +0 -111
  125. /package/src/{core → office-common/core}/index.d.ts +0 -0
  126. /package/src/{core → office-common/core}/index.js +0 -0
  127. /package/src/{core → office-common/core}/xml/index.d.ts +0 -0
  128. /package/src/{core → office-common/core}/xml/index.js +0 -0
  129. /package/src/{core → office-common/core}/xml/model.d.ts +0 -0
  130. /package/src/{core → office-common/core}/xml/model.js +0 -0
  131. /package/src/{encryption → office-common/encryption}/agile-constants.d.ts +0 -0
  132. /package/src/{encryption → office-common/encryption}/agile-constants.js +0 -0
  133. /package/src/{encryption → office-common/encryption}/agile-encryption-info.d.ts +0 -0
  134. /package/src/{encryption → office-common/encryption}/agile-encryption-info.js +0 -0
  135. /package/src/{encryption → office-common/encryption}/agile-password.d.ts +0 -0
  136. /package/src/{encryption → office-common/encryption}/agile-password.js +0 -0
  137. /package/src/{encryption → office-common/encryption}/cfb-reader.d.ts +0 -0
  138. /package/src/{encryption → office-common/encryption}/cfb-reader.js +0 -0
  139. /package/src/{encryption → office-common/encryption}/crypto-primitives.d.ts +0 -0
  140. /package/src/{encryption → office-common/encryption}/crypto-primitives.js +0 -0
  141. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.d.ts +0 -0
  142. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.js +0 -0
  143. /package/src/{encryption → office-common/encryption}/encryption-info-xml.d.ts +0 -0
  144. /package/src/{encryption → office-common/encryption}/encryption-info-xml.js +0 -0
  145. /package/src/{encryption → office-common/encryption}/errors.d.ts +0 -0
  146. /package/src/{encryption → office-common/encryption}/errors.js +0 -0
  147. /package/src/{encryption → office-common/encryption}/index.d.ts +0 -0
  148. /package/src/{encryption → office-common/encryption}/index.js +0 -0
  149. /package/src/{features → office-common/features}/diagrams/constants.d.ts +0 -0
  150. /package/src/{features → office-common/features}/diagrams/constants.js +0 -0
  151. /package/src/{features → office-common/features}/diagrams/diagram-data-model.d.ts +0 -0
  152. /package/src/{features → office-common/features}/diagrams/diagram-data-model.js +0 -0
  153. /package/src/{features → office-common/features}/diagrams/diagram-parsers.d.ts +0 -0
  154. /package/src/{features → office-common/features}/diagrams/diagram-parsers.js +0 -0
  155. /package/src/{features → office-common/features}/diagrams/diagram-serializers.d.ts +0 -0
  156. /package/src/{features → office-common/features}/diagrams/diagram-serializers.js +0 -0
  157. /package/src/{features → office-common/features}/diagrams/diagram-views.d.ts +0 -0
  158. /package/src/{features → office-common/features}/diagrams/diagram-views.js +0 -0
  159. /package/src/{features → office-common/features}/diagrams/element-tree.d.ts +0 -0
  160. /package/src/{features → office-common/features}/diagrams/element-tree.js +0 -0
  161. /package/src/{features → office-common/features}/diagrams/errors.d.ts +0 -0
  162. /package/src/{features → office-common/features}/diagrams/errors.js +0 -0
  163. /package/src/{features → office-common/features}/diagrams/index.d.ts +0 -0
  164. /package/src/{features → office-common/features}/diagrams/index.js +0 -0
  165. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.d.ts +0 -0
  166. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.js +0 -0
  167. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.d.ts +0 -0
  168. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.js +0 -0
  169. /package/src/{features → office-common/features}/ink/constants.d.ts +0 -0
  170. /package/src/{features → office-common/features}/ink/constants.js +0 -0
  171. /package/src/{features → office-common/features}/ink/index.d.ts +0 -0
  172. /package/src/{features → office-common/features}/ink/index.js +0 -0
  173. /package/src/{features → office-common/features}/ink/ink-effects.d.ts +0 -0
  174. /package/src/{features → office-common/features}/ink/ink-effects.js +0 -0
  175. /package/src/{features → office-common/features}/ink/ink-model.d.ts +0 -0
  176. /package/src/{features → office-common/features}/ink/ink-model.js +0 -0
  177. /package/src/{features → office-common/features}/ink/ink-parser.d.ts +0 -0
  178. /package/src/{features → office-common/features}/ink/ink-parser.js +0 -0
  179. /package/src/{features → office-common/features}/ink/ink-serializer.d.ts +0 -0
  180. /package/src/{features → office-common/features}/ink/ink-serializer.js +0 -0
  181. /package/src/{features → office-common/features}/ink/ink-units.d.ts +0 -0
  182. /package/src/{features → office-common/features}/ink/ink-units.js +0 -0
  183. /package/src/{features → office-common/features}/ink/ink-xml.d.ts +0 -0
  184. /package/src/{features → office-common/features}/ink/ink-xml.js +0 -0
  185. /package/src/{features → office-common/features}/ink/trace-codec.d.ts +0 -0
  186. /package/src/{features → office-common/features}/ink/trace-codec.js +0 -0
  187. /package/src/{features → office-common/features}/mathml/constants.d.ts +0 -0
  188. /package/src/{features → office-common/features}/mathml/constants.js +0 -0
  189. /package/src/{features → office-common/features}/mathml/errors.d.ts +0 -0
  190. /package/src/{features → office-common/features}/mathml/errors.js +0 -0
  191. /package/src/{features → office-common/features}/mathml/model/enums.d.ts +0 -0
  192. /package/src/{features → office-common/features}/mathml/model/enums.js +0 -0
  193. /package/src/{features → office-common/features}/mathml/openxml.d.ts +0 -0
  194. /package/src/{features → office-common/features}/mathml/openxml.js +0 -0
  195. /package/src/{features → office-common/features}/smart-art/diagram-xml.d.ts +0 -0
  196. /package/src/{features → office-common/features}/smart-art/diagram-xml.js +0 -0
  197. /package/src/{features → office-common/features}/smart-art/errors.d.ts +0 -0
  198. /package/src/{features → office-common/features}/smart-art/errors.js +0 -0
  199. /package/src/{features → office-common/features}/smart-art/index.d.ts +0 -0
  200. /package/src/{features → office-common/features}/smart-art/index.js +0 -0
  201. /package/src/{features → office-common/features}/smart-art/minimal-samples.d.ts +0 -0
  202. /package/src/{features → office-common/features}/smart-art/minimal-samples.js +0 -0
  203. /package/src/{features → office-common/features}/smart-art/mutators.d.ts +0 -0
  204. /package/src/{features → office-common/features}/smart-art/mutators.js +0 -0
  205. /package/src/{features → office-common/features}/smart-art/namespaces.d.ts +0 -0
  206. /package/src/{features → office-common/features}/smart-art/namespaces.js +0 -0
  207. /package/src/{features → office-common/features}/smart-art/package-graph.d.ts +0 -0
  208. /package/src/{features → office-common/features}/smart-art/package-graph.js +0 -0
  209. /package/src/{features → office-common/features}/smart-art/parse-colors.d.ts +0 -0
  210. /package/src/{features → office-common/features}/smart-art/parse-colors.js +0 -0
  211. /package/src/{features → office-common/features}/smart-art/parse-data.d.ts +0 -0
  212. /package/src/{features → office-common/features}/smart-art/parse-data.js +0 -0
  213. /package/src/{features → office-common/features}/smart-art/parse-layout.d.ts +0 -0
  214. /package/src/{features → office-common/features}/smart-art/parse-layout.js +0 -0
  215. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.d.ts +0 -0
  216. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.js +0 -0
  217. /package/src/{features → office-common/features}/smart-art/parse-style.d.ts +0 -0
  218. /package/src/{features → office-common/features}/smart-art/parse-style.js +0 -0
  219. /package/src/{features → office-common/features}/smart-art/point-text.d.ts +0 -0
  220. /package/src/{features → office-common/features}/smart-art/point-text.js +0 -0
  221. /package/src/{features → office-common/features}/smart-art/register.d.ts +0 -0
  222. /package/src/{features → office-common/features}/smart-art/register.js +0 -0
  223. /package/src/{features → office-common/features}/smart-art/serialize.d.ts +0 -0
  224. /package/src/{features → office-common/features}/smart-art/serialize.js +0 -0
  225. /package/src/{features → office-common/features}/smart-art/types.d.ts +0 -0
  226. /package/src/{features → office-common/features}/smart-art/types.js +0 -0
@@ -1,568 +0,0 @@
1
- /**
2
- * Deep clone and semantic equality for typed Math* DOM.
3
- *
4
- * Source: mathml-spec §4b / §10b; TASK-9010 §6 —
5
- * clone re-invokes constructors; preserved XML never travels with the clone
6
- * (UnknownMathElement keeps an internal content channel via constructor XML).
7
- * mathEqual compares shape, text, measures, enumerations (ignores listener).
8
- */
9
- var __assign = (this && this.__assign) || function () {
10
- __assign = Object.assign || function(t) {
11
- for (var s, i = 1, n = arguments.length; i < n; i++) {
12
- s = arguments[i];
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
14
- t[p] = s[p];
15
- }
16
- return t;
17
- };
18
- return __assign.apply(this, arguments);
19
- };
20
- var __read = (this && this.__read) || function (o, n) {
21
- var m = typeof Symbol === "function" && o[Symbol.iterator];
22
- if (!m) return o;
23
- var i = m.call(o), r, ar = [], e;
24
- try {
25
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
26
- }
27
- catch (error) { e = { error: error }; }
28
- finally {
29
- try {
30
- if (r && !r.done && (m = i["return"])) m.call(i);
31
- }
32
- finally { if (e) throw e.error; }
33
- }
34
- return ar;
35
- };
36
- var __spread = (this && this.__spread) || function () {
37
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
38
- return ar;
39
- };
40
- var __values = (this && this.__values) || function (o) {
41
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
42
- if (m) return m.call(o);
43
- return {
44
- next: function () {
45
- if (o && i >= o.length) o = void 0;
46
- return { value: o && o[i++], done: !o };
47
- }
48
- };
49
- };
50
- import { MathArgument, MathText, UnknownMathElement, } from './model/math-element';
51
- import { MathOMath, MathParagraph } from './model/roots';
52
- import { MathAccent, MathBar, MathBorderBox, MathBox, MathDelimiter, MathEquationArray, MathFraction, MathFunction, MathGroupCharacter, MathLimitLower, MathLimitUpper, MathMatrix, MathMatrixRow, MathNaryOperator, MathPhantom, MathPreSubSuperscript, MathRadical, MathRun, MathSubscript, MathSubSuperscript, MathSuperscript, } from './model/controls';
53
- /** Deep-clone an OpenXml element tree (immutable structural copy). */
54
- function cloneOpenXmlElement(el) {
55
- return { kind: 'element',
56
- namespaceUri: el.namespaceUri,
57
- localName: el.localName,
58
- prefix: el.prefix,
59
- attributes: el.attributes.map(function (a) { return ({
60
- namespaceUri: a.namespaceUri,
61
- localName: a.localName,
62
- prefix: a.prefix,
63
- value: a.value,
64
- }); }),
65
- namespaceDeclarations: el.namespaceDeclarations.map(function (n) { return ({
66
- prefix: n.prefix,
67
- namespaceUri: n.namespaceUri,
68
- }); }),
69
- children: el.children.map(cloneOpenXmlChild),
70
- };
71
- }
72
- function cloneOpenXmlChild(child) {
73
- if (child.kind === 'text') {
74
- var t = { kind: 'text', value: child.value };
75
- return t;
76
- }
77
- return cloneOpenXmlElement(child);
78
- }
79
- function cloneCtrlPr(ctrlPr) {
80
- return ctrlPr === undefined ? undefined : cloneOpenXmlElement(ctrlPr);
81
- }
82
- /** Clone property bags that may carry opaque ctrlPr OpenXml. */
83
- function cloneAccentProps(p) {
84
- return __assign({}, (p.chr !== undefined ? { chr: p.chr } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
85
- }
86
- function cloneBarProps(p) {
87
- return __assign({}, (p.pos !== undefined ? { pos: p.pos } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
88
- }
89
- function cloneBoxProps(p) {
90
- return __assign({}, (p.isOperatorEmulated !== undefined ? { isOperatorEmulated: p.isOperatorEmulated } : {}), (p.isNoBreak !== undefined ? { isNoBreak: p.isNoBreak } : {}), (p.isDifferential !== undefined ? { isDifferential: p.isDifferential } : {}), (p.isAligned !== undefined ? { isAligned: p.isAligned } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
91
- }
92
- function cloneBorderBoxProps(p) {
93
- return __assign({}, (p.isTopHidden !== undefined ? { isTopHidden: p.isTopHidden } : {}), (p.isBottomHidden !== undefined ? { isBottomHidden: p.isBottomHidden } : {}), (p.isLeftHidden !== undefined ? { isLeftHidden: p.isLeftHidden } : {}), (p.isRightHidden !== undefined ? { isRightHidden: p.isRightHidden } : {}), (p.hasHorizontalStrike !== undefined ? { hasHorizontalStrike: p.hasHorizontalStrike } : {}), (p.hasVerticalStrike !== undefined ? { hasVerticalStrike: p.hasVerticalStrike } : {}), (p.hasBottomLeftToTopRightStrike !== undefined
94
- ? { hasBottomLeftToTopRightStrike: p.hasBottomLeftToTopRightStrike }
95
- : {}), (p.hasTopLeftToBottomRightStrike !== undefined
96
- ? { hasTopLeftToBottomRightStrike: p.hasTopLeftToBottomRightStrike }
97
- : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
98
- }
99
- function cloneDelimiterProps(p) {
100
- return __assign({}, (p.begChr !== undefined ? { begChr: p.begChr } : {}), (p.sepChr !== undefined ? { sepChr: p.sepChr } : {}), (p.endChr !== undefined ? { endChr: p.endChr } : {}), (p.canGrow !== undefined ? { canGrow: p.canGrow } : {}), (p.shp !== undefined ? { shp: p.shp } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
101
- }
102
- function cloneEqArrProps(p) {
103
- return __assign({}, (p.baseJc !== undefined ? { baseJc: p.baseJc } : {}), (p.hasMaxDistance !== undefined ? { hasMaxDistance: p.hasMaxDistance } : {}), (p.hasObjectDistance !== undefined ? { hasObjectDistance: p.hasObjectDistance } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
104
- }
105
- function cloneFractionProps(p) {
106
- return __assign({}, (p.type !== undefined ? { type: p.type } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
107
- }
108
- function cloneFunctionProps(p) {
109
- return __assign({}, (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
110
- }
111
- function cloneGroupChrProps(p) {
112
- return __assign({}, (p.chr !== undefined ? { chr: p.chr } : {}), (p.pos !== undefined ? { pos: p.pos } : {}), (p.vertJc !== undefined ? { vertJc: p.vertJc } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
113
- }
114
- function cloneLimitProps(p) {
115
- return __assign({}, (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
116
- }
117
- function cloneMatrixProps(p) {
118
- return __assign({}, (p.baseJc !== undefined ? { baseJc: p.baseJc } : {}), (p.isPlaceholderHidden !== undefined ? { isPlaceholderHidden: p.isPlaceholderHidden } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
119
- }
120
- function cloneNaryProps(p) {
121
- return __assign({}, (p.chr !== undefined ? { chr: p.chr } : {}), (p.limLoc !== undefined ? { limLoc: p.limLoc } : {}), (p.canGrow !== undefined ? { canGrow: p.canGrow } : {}), (p.isSubscriptHidden !== undefined ? { isSubscriptHidden: p.isSubscriptHidden } : {}), (p.isSuperscriptHidden !== undefined ? { isSuperscriptHidden: p.isSuperscriptHidden } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
122
- }
123
- function clonePhantomProps(p) {
124
- return __assign({}, (p.isShown !== undefined ? { isShown: p.isShown } : {}), (p.isZeroWidth !== undefined ? { isZeroWidth: p.isZeroWidth } : {}), (p.isZeroAscender !== undefined ? { isZeroAscender: p.isZeroAscender } : {}), (p.isZeroDescender !== undefined ? { isZeroDescender: p.isZeroDescender } : {}), (p.isTransparent !== undefined ? { isTransparent: p.isTransparent } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
125
- }
126
- function cloneRadicalProps(p) {
127
- return __assign({}, (p.isDegreeHidden !== undefined ? { isDegreeHidden: p.isDegreeHidden } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
128
- }
129
- function cloneScriptProps(p) {
130
- return __assign({}, (p.isScriptAligned !== undefined ? { isScriptAligned: p.isScriptAligned } : {}), (p.ctrlPr !== undefined ? { ctrlPr: cloneCtrlPr(p.ctrlPr) } : {}));
131
- }
132
- function cloneRunProps(p) {
133
- return __assign({}, (p.isLiteral !== undefined ? { isLiteral: p.isLiteral } : {}), (p.isNormal !== undefined ? { isNormal: p.isNormal } : {}), (p.scr !== undefined ? { scr: p.scr } : {}), (p.sty !== undefined ? { sty: p.sty } : {}), (p.isAligned !== undefined ? { isAligned: p.isAligned } : {}), (p.brk !== undefined ? { brk: p.brk } : {}));
134
- }
135
- function cloneArgProps(p) {
136
- return __assign({}, (p.argSz !== undefined ? { argSz: p.argSz } : {}));
137
- }
138
- function cloneParaProps(p) {
139
- return __assign({}, (p.jc !== undefined ? { jc: p.jc } : {}));
140
- }
141
- /**
142
- * Deep-clone a math element via constructor re-invocation.
143
- * Preserved XML and preserve-only lock do **not** travel with the clone
144
- * (task §6 / spec §10b). UnknownMathElement reconstructs from a deep-cloned
145
- * OpenXml content channel.
146
- *
147
- * @private
148
- */
149
- export function cloneMathElement(node) {
150
- switch (node.type) {
151
- case 't': {
152
- var t = node;
153
- return new MathText(t.value, t.xmlSpace);
154
- }
155
- case 'arg': {
156
- var a = node;
157
- return new MathArgument(cloneArgProps(a.properties), a.item.map(cloneMathElement), cloneCtrlPr(a.ctrlPr));
158
- }
159
- case 'oMathPara': {
160
- var p = node;
161
- return new MathParagraph(cloneParaProps(p.properties), p.equations.map(function (eq) { return cloneMathElement(eq); }));
162
- }
163
- case 'oMath': {
164
- var o = node;
165
- return new MathOMath(o.children.map(cloneMathElement));
166
- }
167
- case 'unknown': {
168
- var u = node;
169
- // Internal content channel only — deep-clone OpenXml, no preserveOnly lock.
170
- var xml = u.preservedXml;
171
- if (xml === undefined) {
172
- // Fallback empty unknown shell (should not occur for parser-built nodes).
173
- return new UnknownMathElement(u.localName, { kind: 'element',
174
- namespaceUri: '',
175
- localName: u.localName,
176
- prefix: '',
177
- attributes: [],
178
- namespaceDeclarations: [],
179
- children: [],
180
- });
181
- }
182
- return new UnknownMathElement(u.localName, cloneOpenXmlElement(xml));
183
- }
184
- case 'r': {
185
- var r = node;
186
- return new MathRun(r.children.map(cloneMathElement), cloneRunProps(r.properties), r.wRPr === undefined ? undefined : cloneOpenXmlElement(r.wRPr), r.opaqueChildren.map(cloneOpenXmlElement));
187
- }
188
- case 'acc': {
189
- var n = node;
190
- return new MathAccent(cloneAccentProps(n.properties), cloneMathElement(n.base));
191
- }
192
- case 'bar': {
193
- var n = node;
194
- return new MathBar(cloneBarProps(n.properties), cloneMathElement(n.base));
195
- }
196
- case 'box': {
197
- var n = node;
198
- return new MathBox(cloneBoxProps(n.properties), cloneMathElement(n.base));
199
- }
200
- case 'borderBox': {
201
- var n = node;
202
- return new MathBorderBox(cloneBorderBoxProps(n.properties), cloneMathElement(n.base));
203
- }
204
- case 'd': {
205
- var n = node;
206
- return new MathDelimiter(cloneDelimiterProps(n.properties), n.elements.map(function (e) { return cloneMathElement(e); }));
207
- }
208
- case 'eqArr': {
209
- var n = node;
210
- return new MathEquationArray(cloneEqArrProps(n.properties), n.elements.map(function (e) { return cloneMathElement(e); }));
211
- }
212
- case 'f': {
213
- var n = node;
214
- return new MathFraction(cloneFractionProps(n.properties), cloneMathElement(n.numerator), cloneMathElement(n.denominator));
215
- }
216
- case 'func': {
217
- var n = node;
218
- return new MathFunction(cloneFunctionProps(n.properties), cloneMathElement(n.name), cloneMathElement(n.base));
219
- }
220
- case 'groupChr': {
221
- var n = node;
222
- return new MathGroupCharacter(cloneGroupChrProps(n.properties), cloneMathElement(n.base));
223
- }
224
- case 'limLow': {
225
- var n = node;
226
- return new MathLimitLower(cloneLimitProps(n.properties), cloneMathElement(n.base), cloneMathElement(n.lim));
227
- }
228
- case 'limUpp': {
229
- var n = node;
230
- return new MathLimitUpper(cloneLimitProps(n.properties), cloneMathElement(n.base), cloneMathElement(n.lim));
231
- }
232
- case 'm': {
233
- var n = node;
234
- return new MathMatrix(cloneMatrixProps(n.properties), n.rows.map(function (row) { return cloneMathElement(row); }));
235
- }
236
- case 'mr': {
237
- var n = node;
238
- return new MathMatrixRow(n.elements.map(function (e) { return cloneMathElement(e); }));
239
- }
240
- case 'nary': {
241
- var n = node;
242
- return new MathNaryOperator(cloneNaryProps(n.properties), cloneMathElement(n.subscript), cloneMathElement(n.superscript), cloneMathElement(n.base));
243
- }
244
- case 'phant': {
245
- var n = node;
246
- return new MathPhantom(clonePhantomProps(n.properties), cloneMathElement(n.base));
247
- }
248
- case 'rad': {
249
- var n = node;
250
- return new MathRadical(cloneRadicalProps(n.properties), cloneMathElement(n.deg), cloneMathElement(n.base));
251
- }
252
- case 'sPre': {
253
- var n = node;
254
- return new MathPreSubSuperscript(cloneScriptProps(n.properties), cloneMathElement(n.sub), cloneMathElement(n.sup), cloneMathElement(n.base));
255
- }
256
- case 'sSub': {
257
- var n = node;
258
- return new MathSubscript(cloneScriptProps(n.properties), cloneMathElement(n.base), cloneMathElement(n.subscript));
259
- }
260
- case 'sSubSup': {
261
- var n = node;
262
- return new MathSubSuperscript(cloneScriptProps(n.properties), cloneMathElement(n.base), cloneMathElement(n.subscript), cloneMathElement(n.superscript));
263
- }
264
- case 'sSup': {
265
- var n = node;
266
- return new MathSuperscript(cloneScriptProps(n.properties), cloneMathElement(n.base), cloneMathElement(n.superscript));
267
- }
268
- default: {
269
- // Exhaustiveness: every MathElementType handled above.
270
- var _exhaustive = node.type;
271
- void _exhaustive;
272
- throw new Error("cloneMathElement: unhandled kind");
273
- }
274
- }
275
- }
276
- function openXmlEqual(a, b) {
277
- if (a === undefined && b === undefined) {
278
- return true;
279
- }
280
- if (a === undefined || b === undefined) {
281
- return false;
282
- }
283
- if (a.namespaceUri !== b.namespaceUri ||
284
- a.localName !== b.localName ||
285
- a.prefix !== b.prefix ||
286
- a.attributes.length !== b.attributes.length ||
287
- a.namespaceDeclarations.length !== b.namespaceDeclarations.length ||
288
- a.children.length !== b.children.length) {
289
- return false;
290
- }
291
- for (var i = 0; i < a.attributes.length; i++) {
292
- var aa = a.attributes[i];
293
- var bb = b.attributes[i];
294
- if (aa.namespaceUri !== bb.namespaceUri ||
295
- aa.localName !== bb.localName ||
296
- aa.prefix !== bb.prefix ||
297
- aa.value !== bb.value) {
298
- return false;
299
- }
300
- }
301
- for (var i = 0; i < a.namespaceDeclarations.length; i++) {
302
- var aa = a.namespaceDeclarations[i];
303
- var bb = b.namespaceDeclarations[i];
304
- if (aa.prefix !== bb.prefix || aa.namespaceUri !== bb.namespaceUri) {
305
- return false;
306
- }
307
- }
308
- for (var i = 0; i < a.children.length; i++) {
309
- var ca = a.children[i];
310
- var cb = b.children[i];
311
- if (ca.kind !== cb.kind) {
312
- return false;
313
- }
314
- if (ca.kind === 'text' && cb.kind === 'text') {
315
- if (ca.value !== cb.value) {
316
- return false;
317
- }
318
- }
319
- else if (ca.kind === 'element' && cb.kind === 'element') {
320
- if (!openXmlEqual(ca, cb)) {
321
- return false;
322
- }
323
- }
324
- else {
325
- return false;
326
- }
327
- }
328
- return true;
329
- }
330
- function openXmlListEqual(a, b) {
331
- if (a.length !== b.length) {
332
- return false;
333
- }
334
- for (var i = 0; i < a.length; i++) {
335
- if (!openXmlEqual(a[i], b[i])) {
336
- return false;
337
- }
338
- }
339
- return true;
340
- }
341
- function propsEqual(a, b, ctrlPrKey) {
342
- if (ctrlPrKey === void 0) { ctrlPrKey = 'ctrlPr'; }
343
- var e_1, _a;
344
- var keys = new Set(__spread(Object.keys(a), Object.keys(b)));
345
- try {
346
- for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
347
- var key = keys_1_1.value;
348
- if (key === ctrlPrKey) {
349
- if (!openXmlEqual(a[key], b[key])) {
350
- return false;
351
- }
352
- continue;
353
- }
354
- if (a[key] !== b[key]) {
355
- return false;
356
- }
357
- }
358
- }
359
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
360
- finally {
361
- try {
362
- if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
363
- }
364
- finally { if (e_1) throw e_1.error; }
365
- }
366
- return true;
367
- }
368
- function elementsEqual(a, b) {
369
- if (a.length !== b.length) {
370
- return false;
371
- }
372
- for (var i = 0; i < a.length; i++) {
373
- if (!mathEqual(a[i], b[i])) {
374
- return false;
375
- }
376
- }
377
- return true;
378
- }
379
- /**
380
- * Semantic equality of two math trees (shape, text, measures, enumerations).
381
- * Ignores mutation listeners. Compares preserve-only flag so degraded nodes
382
- * do not silently equal clean typed peers.
383
- *
384
- * @private
385
- */
386
- export function mathEqual(a, b) {
387
- if (a.type !== b.type) {
388
- return false;
389
- }
390
- if (a.preserveOnly !== b.preserveOnly) {
391
- return false;
392
- }
393
- switch (a.type) {
394
- case 't': {
395
- var ta = a;
396
- var tb = b;
397
- return ta.value === tb.value && ta.xmlSpace === tb.xmlSpace;
398
- }
399
- case 'arg': {
400
- var aa = a;
401
- var bb = b;
402
- return (propsEqual(aa.properties, bb.properties) &&
403
- openXmlEqual(aa.ctrlPr, bb.ctrlPr) &&
404
- elementsEqual(aa.item, bb.item));
405
- }
406
- case 'oMathPara': {
407
- var pa = a;
408
- var pb = b;
409
- return (propsEqual(pa.properties, pb.properties) &&
410
- elementsEqual(pa.equations, pb.equations));
411
- }
412
- case 'oMath': {
413
- var oa = a;
414
- var ob = b;
415
- return elementsEqual(oa.children, ob.children);
416
- }
417
- case 'unknown': {
418
- var ua = a;
419
- var ub = b;
420
- return ua.localName === ub.localName && openXmlEqual(ua.preservedXml, ub.preservedXml);
421
- }
422
- case 'r': {
423
- var ra = a;
424
- var rb = b;
425
- return (propsEqual(ra.properties, rb.properties) &&
426
- openXmlEqual(ra.wRPr, rb.wRPr) &&
427
- elementsEqual(ra.children, rb.children) &&
428
- openXmlListEqual(ra.opaqueChildren, rb.opaqueChildren));
429
- }
430
- case 'acc': {
431
- var na = a;
432
- var nb = b;
433
- return (propsEqual(na.properties, nb.properties) &&
434
- mathEqual(na.base, nb.base));
435
- }
436
- case 'bar': {
437
- var na = a;
438
- var nb = b;
439
- return (propsEqual(na.properties, nb.properties) &&
440
- mathEqual(na.base, nb.base));
441
- }
442
- case 'box': {
443
- var na = a;
444
- var nb = b;
445
- return (propsEqual(na.properties, nb.properties) &&
446
- mathEqual(na.base, nb.base));
447
- }
448
- case 'borderBox': {
449
- var na = a;
450
- var nb = b;
451
- return (propsEqual(na.properties, nb.properties) &&
452
- mathEqual(na.base, nb.base));
453
- }
454
- case 'd': {
455
- var na = a;
456
- var nb = b;
457
- return (propsEqual(na.properties, nb.properties) &&
458
- elementsEqual(na.elements, nb.elements));
459
- }
460
- case 'eqArr': {
461
- var na = a;
462
- var nb = b;
463
- return (propsEqual(na.properties, nb.properties) &&
464
- elementsEqual(na.elements, nb.elements));
465
- }
466
- case 'f': {
467
- var na = a;
468
- var nb = b;
469
- return (propsEqual(na.properties, nb.properties) &&
470
- mathEqual(na.numerator, nb.numerator) &&
471
- mathEqual(na.denominator, nb.denominator));
472
- }
473
- case 'func': {
474
- var na = a;
475
- var nb = b;
476
- return (propsEqual(na.properties, nb.properties) &&
477
- mathEqual(na.name, nb.name) &&
478
- mathEqual(na.base, nb.base));
479
- }
480
- case 'groupChr': {
481
- var na = a;
482
- var nb = b;
483
- return (propsEqual(na.properties, nb.properties) &&
484
- mathEqual(na.base, nb.base));
485
- }
486
- case 'limLow': {
487
- var na = a;
488
- var nb = b;
489
- return (propsEqual(na.properties, nb.properties) &&
490
- mathEqual(na.base, nb.base) &&
491
- mathEqual(na.lim, nb.lim));
492
- }
493
- case 'limUpp': {
494
- var na = a;
495
- var nb = b;
496
- return (propsEqual(na.properties, nb.properties) &&
497
- mathEqual(na.base, nb.base) &&
498
- mathEqual(na.lim, nb.lim));
499
- }
500
- case 'm': {
501
- var na = a;
502
- var nb = b;
503
- return (propsEqual(na.properties, nb.properties) &&
504
- elementsEqual(na.rows, nb.rows));
505
- }
506
- case 'mr': {
507
- var na = a;
508
- var nb = b;
509
- return elementsEqual(na.elements, nb.elements);
510
- }
511
- case 'nary': {
512
- var na = a;
513
- var nb = b;
514
- return (propsEqual(na.properties, nb.properties) &&
515
- mathEqual(na.subscript, nb.subscript) &&
516
- mathEqual(na.superscript, nb.superscript) &&
517
- mathEqual(na.base, nb.base));
518
- }
519
- case 'phant': {
520
- var na = a;
521
- var nb = b;
522
- return (propsEqual(na.properties, nb.properties) &&
523
- mathEqual(na.base, nb.base));
524
- }
525
- case 'rad': {
526
- var na = a;
527
- var nb = b;
528
- return (propsEqual(na.properties, nb.properties) &&
529
- mathEqual(na.deg, nb.deg) &&
530
- mathEqual(na.base, nb.base));
531
- }
532
- case 'sPre': {
533
- var na = a;
534
- var nb = b;
535
- return (propsEqual(na.properties, nb.properties) &&
536
- mathEqual(na.sub, nb.sub) &&
537
- mathEqual(na.sup, nb.sup) &&
538
- mathEqual(na.base, nb.base));
539
- }
540
- case 'sSub': {
541
- var na = a;
542
- var nb = b;
543
- return (propsEqual(na.properties, nb.properties) &&
544
- mathEqual(na.base, nb.base) &&
545
- mathEqual(na.subscript, nb.subscript));
546
- }
547
- case 'sSubSup': {
548
- var na = a;
549
- var nb = b;
550
- return (propsEqual(na.properties, nb.properties) &&
551
- mathEqual(na.base, nb.base) &&
552
- mathEqual(na.subscript, nb.subscript) &&
553
- mathEqual(na.superscript, nb.superscript));
554
- }
555
- case 'sSup': {
556
- var na = a;
557
- var nb = b;
558
- return (propsEqual(na.properties, nb.properties) &&
559
- mathEqual(na.base, nb.base) &&
560
- mathEqual(na.superscript, nb.superscript));
561
- }
562
- default: {
563
- var _exhaustive = a.type;
564
- void _exhaustive;
565
- return false;
566
- }
567
- }
568
- }