@cj-tech-master/excelts 9.4.2 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/dist/browser/index.browser.d.ts +8 -5
  2. package/dist/browser/index.browser.js +19 -1
  3. package/dist/browser/index.d.ts +4 -2
  4. package/dist/browser/index.js +9 -1
  5. package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
  6. package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
  7. package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
  8. package/dist/browser/modules/excel/chart/chart-api.js +364 -0
  9. package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
  10. package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
  11. package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  12. package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
  13. package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  14. package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
  15. package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  16. package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
  17. package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
  18. package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
  19. package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
  20. package/dist/browser/modules/excel/chart/chart-images.js +363 -0
  21. package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
  22. package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
  23. package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
  24. package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
  25. package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
  26. package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
  27. package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
  28. package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
  29. package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
  30. package/dist/browser/modules/excel/chart/chart.js +1320 -0
  31. package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  32. package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
  33. package/dist/browser/modules/excel/chart/index.d.ts +54 -0
  34. package/dist/browser/modules/excel/chart/index.js +46 -0
  35. package/dist/browser/modules/excel/chart/install.d.ts +44 -0
  36. package/dist/browser/modules/excel/chart/install.js +91 -0
  37. package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
  38. package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
  39. package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
  40. package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
  41. package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
  42. package/dist/browser/modules/excel/chart/topojson.js +236 -0
  43. package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
  44. package/dist/browser/modules/excel/chart/types.js +8 -0
  45. package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
  46. package/dist/browser/modules/excel/chart-host-registry.js +90 -0
  47. package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
  48. package/dist/browser/modules/excel/chartsheet.js +196 -0
  49. package/dist/browser/modules/excel/defined-names.d.ts +35 -0
  50. package/dist/browser/modules/excel/defined-names.js +44 -4
  51. package/dist/browser/modules/excel/errors.d.ts +6 -0
  52. package/dist/browser/modules/excel/errors.js +9 -0
  53. package/dist/browser/modules/excel/form-control.d.ts +6 -0
  54. package/dist/browser/modules/excel/form-control.js +17 -0
  55. package/dist/browser/modules/excel/image.js +12 -2
  56. package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
  57. package/dist/browser/modules/excel/pivot-chart.js +53 -0
  58. package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
  59. package/dist/browser/modules/excel/pivot-table.js +35 -0
  60. package/dist/browser/modules/excel/range.js +5 -1
  61. package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
  62. package/dist/browser/modules/excel/sparkline/index.js +7 -0
  63. package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
  64. package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
  65. package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
  66. package/dist/browser/modules/excel/table.js +42 -6
  67. package/dist/browser/modules/excel/types.d.ts +72 -0
  68. package/dist/browser/modules/excel/utils/address.d.ts +18 -0
  69. package/dist/browser/modules/excel/utils/address.js +28 -0
  70. package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
  71. package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
  72. package/dist/browser/modules/excel/utils/guid.js +35 -0
  73. package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
  74. package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
  75. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  76. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  77. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  78. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  79. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  80. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  81. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  82. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  83. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  84. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  85. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  86. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  87. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  88. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  89. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  90. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  91. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  92. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  93. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  94. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  95. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  96. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  97. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  98. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  99. package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  100. package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
  101. package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  102. package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
  103. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  104. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  105. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  106. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  107. package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  108. package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
  109. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  110. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  111. package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
  112. package/dist/browser/modules/excel/workbook.browser.js +966 -31
  113. package/dist/browser/modules/excel/workbook.d.ts +43 -0
  114. package/dist/browser/modules/excel/workbook.js +48 -0
  115. package/dist/browser/modules/excel/worksheet.d.ts +157 -3
  116. package/dist/browser/modules/excel/worksheet.js +394 -35
  117. package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
  118. package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
  119. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  120. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  121. package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  122. package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  123. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  124. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  125. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  126. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  127. package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  128. package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  129. package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  130. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  131. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  132. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  133. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  134. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  135. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  136. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  137. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  138. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  139. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  140. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  141. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  142. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  143. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  144. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  145. package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  146. package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  147. package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  148. package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
  149. package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  150. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
  151. package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
  152. package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
  153. package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
  154. package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
  155. package/dist/browser/modules/pdf/excel-bridge.js +683 -12
  156. package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
  157. package/dist/browser/modules/pdf/font/font-manager.js +39 -0
  158. package/dist/browser/modules/pdf/index.d.ts +5 -2
  159. package/dist/browser/modules/pdf/index.js +3 -1
  160. package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
  161. package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
  162. package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
  163. package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
  164. package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
  165. package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
  166. package/dist/browser/modules/pdf/types.d.ts +227 -23
  167. package/dist/browser/modules/pdf/types.js +4 -0
  168. package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
  169. package/dist/browser/modules/pdf/word-bridge.js +304 -0
  170. package/dist/browser/modules/word/constants.d.ts +179 -0
  171. package/dist/browser/modules/word/constants.js +231 -0
  172. package/dist/browser/modules/word/content-types.d.ts +27 -0
  173. package/dist/browser/modules/word/content-types.js +53 -0
  174. package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
  175. package/dist/browser/modules/word/digital-signatures.js +134 -0
  176. package/dist/browser/modules/word/document.d.ts +728 -0
  177. package/dist/browser/modules/word/document.js +1795 -0
  178. package/dist/browser/modules/word/docx-packager.d.ts +14 -0
  179. package/dist/browser/modules/word/docx-packager.js +822 -0
  180. package/dist/browser/modules/word/docx-reader.d.ts +11 -0
  181. package/dist/browser/modules/word/docx-reader.js +4929 -0
  182. package/dist/browser/modules/word/encryption.d.ts +102 -0
  183. package/dist/browser/modules/word/encryption.js +274 -0
  184. package/dist/browser/modules/word/errors.d.ts +49 -0
  185. package/dist/browser/modules/word/errors.js +68 -0
  186. package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
  187. package/dist/browser/modules/word/font-obfuscation.js +83 -0
  188. package/dist/browser/modules/word/html-renderer.d.ts +38 -0
  189. package/dist/browser/modules/word/html-renderer.js +782 -0
  190. package/dist/browser/modules/word/index.base.d.ts +19 -0
  191. package/dist/browser/modules/word/index.base.js +51 -0
  192. package/dist/browser/modules/word/index.browser.d.ts +4 -0
  193. package/dist/browser/modules/word/index.browser.js +4 -0
  194. package/dist/browser/modules/word/index.d.ts +4 -0
  195. package/dist/browser/modules/word/index.js +4 -0
  196. package/dist/browser/modules/word/internal-utils.d.ts +23 -0
  197. package/dist/browser/modules/word/internal-utils.js +54 -0
  198. package/dist/browser/modules/word/relationships.d.ts +31 -0
  199. package/dist/browser/modules/word/relationships.js +56 -0
  200. package/dist/browser/modules/word/types.d.ts +2325 -0
  201. package/dist/browser/modules/word/types.js +10 -0
  202. package/dist/browser/modules/word/units.d.ts +49 -0
  203. package/dist/browser/modules/word/units.js +111 -0
  204. package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
  205. package/dist/browser/modules/word/writers/chart-writer.js +385 -0
  206. package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
  207. package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
  208. package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
  209. package/dist/browser/modules/word/writers/comment-writer.js +70 -0
  210. package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
  211. package/dist/browser/modules/word/writers/document-writer.js +461 -0
  212. package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
  213. package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
  214. package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
  215. package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
  216. package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
  217. package/dist/browser/modules/word/writers/image-writer.js +185 -0
  218. package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
  219. package/dist/browser/modules/word/writers/math-writer.js +428 -0
  220. package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
  221. package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
  222. package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
  223. package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
  224. package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
  225. package/dist/browser/modules/word/writers/parts-writer.js +660 -0
  226. package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
  227. package/dist/browser/modules/word/writers/run-writer.js +649 -0
  228. package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
  229. package/dist/browser/modules/word/writers/section-writer.js +238 -0
  230. package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
  231. package/dist/browser/modules/word/writers/styles-writer.js +242 -0
  232. package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
  233. package/dist/browser/modules/word/writers/table-writer.js +503 -0
  234. package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
  235. package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
  236. package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
  237. package/dist/browser/modules/word/writers/toc-writer.js +79 -0
  238. package/dist/browser/modules/xml/encode.d.ts +56 -7
  239. package/dist/browser/modules/xml/encode.js +157 -11
  240. package/dist/cjs/index.js +13 -2
  241. package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
  242. package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
  243. package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
  244. package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
  245. package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
  246. package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
  247. package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
  248. package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
  249. package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
  250. package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
  251. package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
  252. package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
  253. package/dist/cjs/modules/excel/chart/chart.js +1324 -0
  254. package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
  255. package/dist/cjs/modules/excel/chart/index.js +101 -0
  256. package/dist/cjs/modules/excel/chart/install.js +95 -0
  257. package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
  258. package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
  259. package/dist/cjs/modules/excel/chart/topojson.js +239 -0
  260. package/dist/cjs/modules/excel/chart/types.js +9 -0
  261. package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
  262. package/dist/cjs/modules/excel/chartsheet.js +199 -0
  263. package/dist/cjs/modules/excel/defined-names.js +44 -4
  264. package/dist/cjs/modules/excel/errors.js +11 -1
  265. package/dist/cjs/modules/excel/form-control.js +17 -0
  266. package/dist/cjs/modules/excel/image.js +12 -2
  267. package/dist/cjs/modules/excel/pivot-chart.js +56 -0
  268. package/dist/cjs/modules/excel/pivot-table.js +35 -0
  269. package/dist/cjs/modules/excel/range.js +5 -1
  270. package/dist/cjs/modules/excel/sparkline/index.js +23 -0
  271. package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
  272. package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
  273. package/dist/cjs/modules/excel/table.js +42 -6
  274. package/dist/cjs/modules/excel/utils/address.js +29 -0
  275. package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
  276. package/dist/cjs/modules/excel/utils/guid.js +38 -0
  277. package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
  278. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
  279. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
  280. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
  281. package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
  282. package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
  283. package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
  284. package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
  285. package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
  286. package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
  287. package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
  288. package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
  289. package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
  290. package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
  291. package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
  292. package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
  293. package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
  294. package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
  295. package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
  296. package/dist/cjs/modules/excel/workbook.browser.js +973 -38
  297. package/dist/cjs/modules/excel/workbook.js +48 -0
  298. package/dist/cjs/modules/excel/worksheet.js +393 -34
  299. package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
  300. package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  301. package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  302. package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  303. package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
  304. package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
  305. package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
  306. package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  307. package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  308. package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  309. package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
  310. package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  311. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  312. package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  313. package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
  314. package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  315. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
  316. package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  317. package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  318. package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
  319. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
  320. package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
  321. package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
  322. package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
  323. package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
  324. package/dist/cjs/modules/pdf/index.js +5 -1
  325. package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
  326. package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
  327. package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
  328. package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
  329. package/dist/cjs/modules/pdf/types.js +5 -0
  330. package/dist/cjs/modules/pdf/word-bridge.js +307 -0
  331. package/dist/cjs/modules/word/constants.js +234 -0
  332. package/dist/cjs/modules/word/content-types.js +57 -0
  333. package/dist/cjs/modules/word/digital-signatures.js +140 -0
  334. package/dist/cjs/modules/word/document.js +1909 -0
  335. package/dist/cjs/modules/word/docx-packager.js +825 -0
  336. package/dist/cjs/modules/word/docx-reader.js +4932 -0
  337. package/dist/cjs/modules/word/encryption.js +282 -0
  338. package/dist/cjs/modules/word/errors.js +88 -0
  339. package/dist/cjs/modules/word/font-obfuscation.js +88 -0
  340. package/dist/cjs/modules/word/html-renderer.js +785 -0
  341. package/dist/cjs/modules/word/index.base.js +199 -0
  342. package/dist/cjs/modules/word/index.browser.js +20 -0
  343. package/dist/cjs/modules/word/index.js +20 -0
  344. package/dist/cjs/modules/word/internal-utils.js +59 -0
  345. package/dist/cjs/modules/word/relationships.js +60 -0
  346. package/dist/cjs/modules/word/types.js +11 -0
  347. package/dist/cjs/modules/word/units.js +135 -0
  348. package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
  349. package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
  350. package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
  351. package/dist/cjs/modules/word/writers/document-writer.js +465 -0
  352. package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
  353. package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
  354. package/dist/cjs/modules/word/writers/image-writer.js +188 -0
  355. package/dist/cjs/modules/word/writers/math-writer.js +431 -0
  356. package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
  357. package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
  358. package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
  359. package/dist/cjs/modules/word/writers/run-writer.js +655 -0
  360. package/dist/cjs/modules/word/writers/section-writer.js +241 -0
  361. package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
  362. package/dist/cjs/modules/word/writers/table-writer.js +506 -0
  363. package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
  364. package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
  365. package/dist/cjs/modules/xml/encode.js +158 -11
  366. package/dist/esm/index.browser.js +20 -2
  367. package/dist/esm/index.js +9 -1
  368. package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
  369. package/dist/esm/modules/excel/chart/chart-api.js +364 -0
  370. package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
  371. package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
  372. package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
  373. package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
  374. package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
  375. package/dist/esm/modules/excel/chart/chart-images.js +363 -0
  376. package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
  377. package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
  378. package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
  379. package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
  380. package/dist/esm/modules/excel/chart/chart.js +1320 -0
  381. package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
  382. package/dist/esm/modules/excel/chart/index.js +46 -0
  383. package/dist/esm/modules/excel/chart/install.js +91 -0
  384. package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
  385. package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
  386. package/dist/esm/modules/excel/chart/topojson.js +236 -0
  387. package/dist/esm/modules/excel/chart/types.js +8 -0
  388. package/dist/esm/modules/excel/chart-host-registry.js +90 -0
  389. package/dist/esm/modules/excel/chartsheet.js +196 -0
  390. package/dist/esm/modules/excel/defined-names.js +44 -4
  391. package/dist/esm/modules/excel/errors.js +9 -0
  392. package/dist/esm/modules/excel/form-control.js +17 -0
  393. package/dist/esm/modules/excel/image.js +12 -2
  394. package/dist/esm/modules/excel/pivot-chart.js +53 -0
  395. package/dist/esm/modules/excel/pivot-table.js +35 -0
  396. package/dist/esm/modules/excel/range.js +5 -1
  397. package/dist/esm/modules/excel/sparkline/index.js +7 -0
  398. package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
  399. package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
  400. package/dist/esm/modules/excel/table.js +42 -6
  401. package/dist/esm/modules/excel/utils/address.js +28 -0
  402. package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
  403. package/dist/esm/modules/excel/utils/guid.js +35 -0
  404. package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
  405. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  406. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  407. package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  408. package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  409. package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  410. package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  411. package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  412. package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  413. package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  414. package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  415. package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  416. package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  417. package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
  418. package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
  419. package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  420. package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  421. package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
  422. package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  423. package/dist/esm/modules/excel/workbook.browser.js +969 -34
  424. package/dist/esm/modules/excel/workbook.js +48 -0
  425. package/dist/esm/modules/excel/worksheet.js +394 -35
  426. package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
  427. package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  428. package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  429. package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  430. package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  431. package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  432. package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  433. package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  434. package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  435. package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  436. package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  437. package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  438. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  439. package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  440. package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  441. package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  442. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  443. package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  444. package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  445. package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
  446. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
  447. package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
  448. package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
  449. package/dist/esm/modules/pdf/excel-bridge.js +683 -12
  450. package/dist/esm/modules/pdf/font/font-manager.js +39 -0
  451. package/dist/esm/modules/pdf/index.js +3 -1
  452. package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
  453. package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
  454. package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
  455. package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
  456. package/dist/esm/modules/pdf/types.js +4 -0
  457. package/dist/esm/modules/pdf/word-bridge.js +304 -0
  458. package/dist/esm/modules/word/constants.js +231 -0
  459. package/dist/esm/modules/word/content-types.js +53 -0
  460. package/dist/esm/modules/word/digital-signatures.js +134 -0
  461. package/dist/esm/modules/word/document.js +1795 -0
  462. package/dist/esm/modules/word/docx-packager.js +822 -0
  463. package/dist/esm/modules/word/docx-reader.js +4929 -0
  464. package/dist/esm/modules/word/encryption.js +274 -0
  465. package/dist/esm/modules/word/errors.js +68 -0
  466. package/dist/esm/modules/word/font-obfuscation.js +83 -0
  467. package/dist/esm/modules/word/html-renderer.js +782 -0
  468. package/dist/esm/modules/word/index.base.js +51 -0
  469. package/dist/esm/modules/word/index.browser.js +4 -0
  470. package/dist/esm/modules/word/index.js +4 -0
  471. package/dist/esm/modules/word/internal-utils.js +54 -0
  472. package/dist/esm/modules/word/relationships.js +56 -0
  473. package/dist/esm/modules/word/types.js +10 -0
  474. package/dist/esm/modules/word/units.js +111 -0
  475. package/dist/esm/modules/word/writers/chart-writer.js +385 -0
  476. package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
  477. package/dist/esm/modules/word/writers/comment-writer.js +70 -0
  478. package/dist/esm/modules/word/writers/document-writer.js +461 -0
  479. package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
  480. package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
  481. package/dist/esm/modules/word/writers/image-writer.js +185 -0
  482. package/dist/esm/modules/word/writers/math-writer.js +428 -0
  483. package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
  484. package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
  485. package/dist/esm/modules/word/writers/parts-writer.js +660 -0
  486. package/dist/esm/modules/word/writers/run-writer.js +649 -0
  487. package/dist/esm/modules/word/writers/section-writer.js +238 -0
  488. package/dist/esm/modules/word/writers/styles-writer.js +242 -0
  489. package/dist/esm/modules/word/writers/table-writer.js +503 -0
  490. package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
  491. package/dist/esm/modules/word/writers/toc-writer.js +79 -0
  492. package/dist/esm/modules/xml/encode.js +157 -11
  493. package/dist/iife/excelts.iife.js +11789 -687
  494. package/dist/iife/excelts.iife.js.map +1 -1
  495. package/dist/iife/excelts.iife.min.js +52 -44
  496. package/dist/types/index.browser.d.ts +8 -5
  497. package/dist/types/index.d.ts +4 -2
  498. package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
  499. package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
  500. package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
  501. package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  502. package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  503. package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  504. package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
  505. package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
  506. package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
  507. package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
  508. package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
  509. package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
  510. package/dist/types/modules/excel/chart/chart.d.ts +504 -0
  511. package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  512. package/dist/types/modules/excel/chart/index.d.ts +54 -0
  513. package/dist/types/modules/excel/chart/install.d.ts +44 -0
  514. package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
  515. package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
  516. package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
  517. package/dist/types/modules/excel/chart/types.d.ts +2559 -0
  518. package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
  519. package/dist/types/modules/excel/chartsheet.d.ts +102 -0
  520. package/dist/types/modules/excel/defined-names.d.ts +35 -0
  521. package/dist/types/modules/excel/errors.d.ts +6 -0
  522. package/dist/types/modules/excel/form-control.d.ts +6 -0
  523. package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
  524. package/dist/types/modules/excel/pivot-table.d.ts +55 -0
  525. package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
  526. package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
  527. package/dist/types/modules/excel/types.d.ts +72 -0
  528. package/dist/types/modules/excel/utils/address.d.ts +18 -0
  529. package/dist/types/modules/excel/utils/guid.d.ts +15 -0
  530. package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
  531. package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  532. package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  533. package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  534. package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  535. package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  536. package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  537. package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  538. package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  539. package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  540. package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  541. package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  542. package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  543. package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  544. package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  545. package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  546. package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  547. package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  548. package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  549. package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
  550. package/dist/types/modules/excel/workbook.d.ts +43 -0
  551. package/dist/types/modules/excel/worksheet.d.ts +157 -3
  552. package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
  553. package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  554. package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  555. package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  556. package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  557. package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  558. package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  559. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  560. package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  561. package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  562. package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  563. package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  564. package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  565. package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
  566. package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
  567. package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
  568. package/dist/types/modules/pdf/index.d.ts +5 -2
  569. package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
  570. package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
  571. package/dist/types/modules/pdf/types.d.ts +227 -23
  572. package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
  573. package/dist/types/modules/word/constants.d.ts +179 -0
  574. package/dist/types/modules/word/content-types.d.ts +27 -0
  575. package/dist/types/modules/word/digital-signatures.d.ts +87 -0
  576. package/dist/types/modules/word/document.d.ts +728 -0
  577. package/dist/types/modules/word/docx-packager.d.ts +14 -0
  578. package/dist/types/modules/word/docx-reader.d.ts +11 -0
  579. package/dist/types/modules/word/encryption.d.ts +102 -0
  580. package/dist/types/modules/word/errors.d.ts +49 -0
  581. package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
  582. package/dist/types/modules/word/html-renderer.d.ts +38 -0
  583. package/dist/types/modules/word/index.base.d.ts +19 -0
  584. package/dist/types/modules/word/index.browser.d.ts +4 -0
  585. package/dist/types/modules/word/index.d.ts +4 -0
  586. package/dist/types/modules/word/internal-utils.d.ts +23 -0
  587. package/dist/types/modules/word/relationships.d.ts +31 -0
  588. package/dist/types/modules/word/types.d.ts +2325 -0
  589. package/dist/types/modules/word/units.d.ts +49 -0
  590. package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
  591. package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
  592. package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
  593. package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
  594. package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
  595. package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
  596. package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
  597. package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
  598. package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
  599. package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
  600. package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
  601. package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
  602. package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
  603. package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
  604. package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
  605. package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
  606. package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
  607. package/dist/types/modules/xml/encode.d.ts +56 -7
  608. package/package.json +29 -11
  609. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
  610. package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
  611. package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
  612. package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
  613. package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
  614. package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
  615. package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
  616. package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
  617. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
  618. package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
@@ -0,0 +1,756 @@
1
+ "use strict";
2
+ /**
3
+ * Sparkline (mini chart) data model and utilities.
4
+ *
5
+ * Sparklines are cell-sized charts stored in the worksheet extLst under
6
+ * `x14:sparklineGroups`. Each group contains:
7
+ * - display options (type, line weight, markers, axis settings, colors)
8
+ * - one or more sparklines, each pairing a data reference with an anchor cell.
9
+ *
10
+ * Reference: ECMA-376 §18.18.92 + Office Open XML extension `x14` namespace.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.buildSparklineGroup = buildSparklineGroup;
14
+ exports.renderSparklineGroups = renderSparklineGroups;
15
+ exports.parseSparklineGroups = parseSparklineGroups;
16
+ exports.renderSparklineSvg = renderSparklineSvg;
17
+ const encode_1 = require("../../xml/encode.js");
18
+ /**
19
+ * Build a SparklineGroup from simplified options.
20
+ */
21
+ function buildSparklineGroup(opts) {
22
+ const group = {
23
+ type: opts.type,
24
+ sparklines: opts.sparklines
25
+ };
26
+ if (opts.lineWeight !== undefined) {
27
+ group.lineWeight = opts.lineWeight;
28
+ }
29
+ if (opts.markers !== undefined) {
30
+ group.markers = opts.markers;
31
+ }
32
+ if (opts.high !== undefined) {
33
+ group.high = opts.high;
34
+ }
35
+ if (opts.low !== undefined) {
36
+ group.low = opts.low;
37
+ }
38
+ if (opts.first !== undefined) {
39
+ group.first = opts.first;
40
+ }
41
+ if (opts.last !== undefined) {
42
+ group.last = opts.last;
43
+ }
44
+ if (opts.negative !== undefined) {
45
+ group.negative = opts.negative;
46
+ }
47
+ if (opts.lineColor) {
48
+ group.colorSeries = hexToSparklineColor(opts.lineColor);
49
+ }
50
+ if (opts.negativeColor) {
51
+ group.colorNegative = hexToSparklineColor(opts.negativeColor);
52
+ }
53
+ if (opts.axisColor) {
54
+ group.colorAxis = hexToSparklineColor(opts.axisColor);
55
+ }
56
+ if (opts.markerColor) {
57
+ group.colorMarkers = hexToSparklineColor(opts.markerColor);
58
+ }
59
+ if (opts.highColor) {
60
+ group.colorHigh = hexToSparklineColor(opts.highColor);
61
+ }
62
+ if (opts.lowColor) {
63
+ group.colorLow = hexToSparklineColor(opts.lowColor);
64
+ }
65
+ if (opts.firstColor) {
66
+ group.colorFirst = hexToSparklineColor(opts.firstColor);
67
+ }
68
+ if (opts.lastColor) {
69
+ group.colorLast = hexToSparklineColor(opts.lastColor);
70
+ }
71
+ if (opts.minAxisType) {
72
+ group.minAxisType = opts.minAxisType;
73
+ }
74
+ if (opts.maxAxisType) {
75
+ group.maxAxisType = opts.maxAxisType;
76
+ }
77
+ if (opts.manualMin !== undefined) {
78
+ group.manualMin = opts.manualMin;
79
+ }
80
+ if (opts.manualMax !== undefined) {
81
+ group.manualMax = opts.manualMax;
82
+ }
83
+ if (opts.displayXAxis !== undefined) {
84
+ group.displayXAxis = opts.displayXAxis;
85
+ }
86
+ if (opts.rightToLeft !== undefined) {
87
+ group.rightToLeft = opts.rightToLeft;
88
+ }
89
+ if (opts.displayEmptyCellsAs) {
90
+ group.displayEmptyCellsAs = opts.displayEmptyCellsAs;
91
+ }
92
+ if (opts.dateAxis) {
93
+ group.dateAxis = opts.dateAxis;
94
+ }
95
+ return group;
96
+ }
97
+ function hexToSparklineColor(hex) {
98
+ return { rgb: hex.replace(/^#/, "").toUpperCase() };
99
+ }
100
+ // ============================================================================
101
+ // XML rendering
102
+ // ============================================================================
103
+ /**
104
+ * Render all sparkline groups on a worksheet to an x14:sparklineGroups
105
+ * XML fragment. Returns a string (empty if no groups).
106
+ */
107
+ function renderSparklineGroups(groups) {
108
+ if (!groups || groups.length === 0) {
109
+ return "";
110
+ }
111
+ const parts = [];
112
+ parts.push('<x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">');
113
+ for (const g of groups) {
114
+ parts.push(renderSparklineGroup(g));
115
+ }
116
+ parts.push("</x14:sparklineGroups>");
117
+ return parts.join("");
118
+ }
119
+ function renderSparklineGroup(g) {
120
+ const attrs = [];
121
+ if (g.type !== undefined && g.type !== "line") {
122
+ attrs.push(`type="${g.type}"`);
123
+ }
124
+ if (g.lineWeight !== undefined) {
125
+ attrs.push(`lineWeight="${g.lineWeight}"`);
126
+ }
127
+ if (g.displayEmptyCellsAs) {
128
+ attrs.push(`displayEmptyCellsAs="${g.displayEmptyCellsAs}"`);
129
+ }
130
+ if (g.markers) {
131
+ attrs.push('markers="1"');
132
+ }
133
+ if (g.high) {
134
+ attrs.push('high="1"');
135
+ }
136
+ if (g.low) {
137
+ attrs.push('low="1"');
138
+ }
139
+ if (g.first) {
140
+ attrs.push('first="1"');
141
+ }
142
+ if (g.last) {
143
+ attrs.push('last="1"');
144
+ }
145
+ if (g.negative) {
146
+ attrs.push('negative="1"');
147
+ }
148
+ if (g.displayXAxis) {
149
+ attrs.push('displayXAxis="1"');
150
+ }
151
+ if (g.displayHidden) {
152
+ attrs.push('displayHidden="1"');
153
+ }
154
+ if (g.minAxisType && g.minAxisType !== "individual") {
155
+ attrs.push(`minAxisType="${g.minAxisType}"`);
156
+ }
157
+ if (g.maxAxisType && g.maxAxisType !== "individual") {
158
+ attrs.push(`maxAxisType="${g.maxAxisType}"`);
159
+ }
160
+ if (g.manualMin !== undefined) {
161
+ attrs.push(`manualMin="${g.manualMin}"`);
162
+ }
163
+ if (g.manualMax !== undefined) {
164
+ attrs.push(`manualMax="${g.manualMax}"`);
165
+ }
166
+ if (g.rightToLeft) {
167
+ attrs.push('rightToLeft="1"');
168
+ }
169
+ const parts = [];
170
+ parts.push(`<x14:sparklineGroup${attrs.length > 0 ? ` ${attrs.join(" ")}` : ""}>`);
171
+ // Colors (emit only those set, in OOXML order)
172
+ if (g.colorSeries) {
173
+ parts.push(`<x14:colorSeries ${sparklineColorAttrs(g.colorSeries)}/>`);
174
+ }
175
+ if (g.colorNegative) {
176
+ parts.push(`<x14:colorNegative ${sparklineColorAttrs(g.colorNegative)}/>`);
177
+ }
178
+ if (g.colorAxis) {
179
+ parts.push(`<x14:colorAxis ${sparklineColorAttrs(g.colorAxis)}/>`);
180
+ }
181
+ if (g.colorMarkers) {
182
+ parts.push(`<x14:colorMarkers ${sparklineColorAttrs(g.colorMarkers)}/>`);
183
+ }
184
+ if (g.colorFirst) {
185
+ parts.push(`<x14:colorFirst ${sparklineColorAttrs(g.colorFirst)}/>`);
186
+ }
187
+ if (g.colorLast) {
188
+ parts.push(`<x14:colorLast ${sparklineColorAttrs(g.colorLast)}/>`);
189
+ }
190
+ if (g.colorHigh) {
191
+ parts.push(`<x14:colorHigh ${sparklineColorAttrs(g.colorHigh)}/>`);
192
+ }
193
+ if (g.colorLow) {
194
+ parts.push(`<x14:colorLow ${sparklineColorAttrs(g.colorLow)}/>`);
195
+ }
196
+ if (g.dateAxis) {
197
+ parts.push(`<xm:f>${escapeXml(g.dateAxis)}</xm:f>`);
198
+ }
199
+ // Sparklines
200
+ parts.push("<x14:sparklines>");
201
+ for (const s of g.sparklines) {
202
+ parts.push("<x14:sparkline>");
203
+ parts.push(`<xm:f>${escapeXml(s.dataRef)}</xm:f>`);
204
+ parts.push(`<xm:sqref>${escapeXml(s.cellRef)}</xm:sqref>`);
205
+ parts.push("</x14:sparkline>");
206
+ }
207
+ parts.push("</x14:sparklines>");
208
+ parts.push("</x14:sparklineGroup>");
209
+ return parts.join("");
210
+ }
211
+ function sparklineColorAttrs(c) {
212
+ const parts = [];
213
+ if (c.rgb) {
214
+ parts.push(`rgb="${c.rgb}"`);
215
+ }
216
+ if (c.theme !== undefined) {
217
+ parts.push(`theme="${c.theme}"`);
218
+ }
219
+ if (c.tint !== undefined) {
220
+ parts.push(`tint="${c.tint}"`);
221
+ }
222
+ if (c.auto) {
223
+ parts.push('auto="1"');
224
+ }
225
+ return parts.join(" ");
226
+ }
227
+ function escapeXml(s) {
228
+ // Use the canonical encoder: strips XML 1.0 control characters /
229
+ // lone surrogates and escapes the five reserved entities. The
230
+ // previous manual chain missed `"` / `'` (ok for text, but we
231
+ // share the helper with attribute-less contexts where lone
232
+ // surrogates or bg-copied control codes would corrupt the part).
233
+ return (0, encode_1.xmlEncode)(s);
234
+ }
235
+ // ============================================================================
236
+ // XML parsing (best-effort from raw XML fragment)
237
+ // ============================================================================
238
+ /**
239
+ * Parse an x14:sparklineGroups XML fragment into structured groups.
240
+ * Best-effort regex-based parser — sufficient for round-trip via rebuild.
241
+ */
242
+ function parseSparklineGroups(xml) {
243
+ const groups = [];
244
+ // Match both the open/close and self-closing forms of
245
+ // `<x14:sparklineGroup ...>`. Excel legitimately emits the
246
+ // self-closing variant (`<x14:sparklineGroup .../>`) when the
247
+ // group has no child elements — e.g. a group whose sole sparkline
248
+ // was deleted but the parent was preserved for styling, or an
249
+ // empty group created programmatically. Requiring an explicit
250
+ // closing tag silently dropped those groups on load, losing the
251
+ // entry on the next write.
252
+ const groupRe = /<x14:sparklineGroup\b([^>]*?)(?:\/>|>([\s\S]*?)<\/x14:sparklineGroup>)/g;
253
+ let m;
254
+ while ((m = groupRe.exec(xml)) !== null) {
255
+ const g = parseGroupBlock(m[1] ?? "", m[2] ?? "");
256
+ groups.push(g);
257
+ }
258
+ return groups;
259
+ }
260
+ // Pre-compiled regexes for sparkline color tag parsing
261
+ const COLOR_TAG_RES = new Map([
262
+ ["colorSeries", /<x14:colorSeries\b([^/]*)\/>/],
263
+ ["colorNegative", /<x14:colorNegative\b([^/]*)\/>/],
264
+ ["colorAxis", /<x14:colorAxis\b([^/]*)\/>/],
265
+ ["colorMarkers", /<x14:colorMarkers\b([^/]*)\/>/],
266
+ ["colorFirst", /<x14:colorFirst\b([^/]*)\/>/],
267
+ ["colorLast", /<x14:colorLast\b([^/]*)\/>/],
268
+ ["colorHigh", /<x14:colorHigh\b([^/]*)\/>/],
269
+ ["colorLow", /<x14:colorLow\b([^/]*)\/>/]
270
+ ]);
271
+ function parseGroupBlock(attrXml, inner) {
272
+ const g = { sparklines: [] };
273
+ const attrRe = /(\w+)="([^"]*)"/g;
274
+ let m;
275
+ while ((m = attrRe.exec(attrXml)) !== null) {
276
+ const [, name, val] = m;
277
+ switch (name) {
278
+ case "type":
279
+ g.type = val;
280
+ break;
281
+ case "lineWeight":
282
+ g.lineWeight = parseFloat(val);
283
+ break;
284
+ case "displayEmptyCellsAs":
285
+ g.displayEmptyCellsAs = val;
286
+ break;
287
+ case "markers":
288
+ g.markers = val === "1";
289
+ break;
290
+ case "high":
291
+ g.high = val === "1";
292
+ break;
293
+ case "low":
294
+ g.low = val === "1";
295
+ break;
296
+ case "first":
297
+ g.first = val === "1";
298
+ break;
299
+ case "last":
300
+ g.last = val === "1";
301
+ break;
302
+ case "negative":
303
+ g.negative = val === "1";
304
+ break;
305
+ case "displayXAxis":
306
+ g.displayXAxis = val === "1";
307
+ break;
308
+ case "displayHidden":
309
+ g.displayHidden = val === "1";
310
+ break;
311
+ case "minAxisType":
312
+ g.minAxisType = val;
313
+ break;
314
+ case "maxAxisType":
315
+ g.maxAxisType = val;
316
+ break;
317
+ case "manualMin":
318
+ g.manualMin = parseFloat(val);
319
+ break;
320
+ case "manualMax":
321
+ g.manualMax = parseFloat(val);
322
+ break;
323
+ case "rightToLeft":
324
+ g.rightToLeft = val === "1";
325
+ break;
326
+ }
327
+ }
328
+ // Parse colors
329
+ const colorTags = [
330
+ "colorSeries",
331
+ "colorNegative",
332
+ "colorAxis",
333
+ "colorMarkers",
334
+ "colorFirst",
335
+ "colorLast",
336
+ "colorHigh",
337
+ "colorLow"
338
+ ];
339
+ for (const tag of colorTags) {
340
+ const re = COLOR_TAG_RES.get(tag);
341
+ const cm = re.exec(inner);
342
+ if (cm) {
343
+ g[tag] = parseColorAttrs(cm[1]);
344
+ }
345
+ }
346
+ // Parse sparklines
347
+ const sparkRe = /<x14:sparkline>\s*<xm:f>([\s\S]*?)<\/xm:f>\s*<xm:sqref>([\s\S]*?)<\/xm:sqref>\s*<\/x14:sparkline>/g;
348
+ let sm;
349
+ while ((sm = sparkRe.exec(inner)) !== null) {
350
+ g.sparklines.push({
351
+ dataRef: decodeXml(sm[1]),
352
+ cellRef: decodeXml(sm[2])
353
+ });
354
+ }
355
+ return g;
356
+ }
357
+ function parseColorAttrs(attrXml) {
358
+ const c = {};
359
+ const attrRe = /(\w+)="([^"]*)"/g;
360
+ let m;
361
+ while ((m = attrRe.exec(attrXml)) !== null) {
362
+ const [, name, val] = m;
363
+ switch (name) {
364
+ case "rgb":
365
+ c.rgb = val;
366
+ break;
367
+ case "theme":
368
+ c.theme = parseInt(val, 10);
369
+ break;
370
+ case "tint":
371
+ c.tint = parseFloat(val);
372
+ break;
373
+ case "auto":
374
+ c.auto = val === "1";
375
+ break;
376
+ }
377
+ }
378
+ return c;
379
+ }
380
+ function decodeXml(s) {
381
+ return s.replace(/&(?:amp|lt|gt|quot|apos);/g, m => {
382
+ switch (m) {
383
+ case "&amp;":
384
+ return "&";
385
+ case "&lt;":
386
+ return "<";
387
+ case "&gt;":
388
+ return ">";
389
+ case "&quot;":
390
+ return '"';
391
+ case "&apos;":
392
+ return "'";
393
+ default:
394
+ return m;
395
+ }
396
+ });
397
+ }
398
+ /**
399
+ * Render a sparkline group to a single SVG string given explicit data
400
+ * values for each sparkline in the group. This is a preview-grade
401
+ * renderer suitable for PDF/PNG embedding — Excel ultimately renders
402
+ * sparklines natively from the formula references.
403
+ *
404
+ * Why take `values: number[][]` rather than walk the workbook: the
405
+ * caller already has a worksheet in scope when it wants a preview,
406
+ * and decoupling the renderer from the worksheet keeps this module
407
+ * free of upstream dependencies. When no per-sparkline data is
408
+ * supplied the SVG is rendered empty (just the background) so the
409
+ * function never throws.
410
+ *
411
+ * Respects the group's `type` (`line` / `column` / `stacked`),
412
+ * `displayXAxis`, `minAxisType` / `maxAxisType` / `manualMin` /
413
+ * `manualMax`, markers (`markers`, `first`, `last`, `high`, `low`,
414
+ * `negative`), `rightToLeft`, and all structural colours
415
+ * (`colorSeries`, `colorNegative`, `colorAxis`, `colorMarkers`,
416
+ * `colorHigh`, `colorLow`, `colorFirst`, `colorLast`).
417
+ *
418
+ * The individual sparkline's `cellRef` is not consulted — the caller
419
+ * controls layout at a higher level and this function returns a
420
+ * standalone SVG per sparkline when passed a group with a single
421
+ * member, or a grid-stacked SVG when given multiple members.
422
+ */
423
+ function renderSparklineSvg(group, values, options = {}) {
424
+ const width = Math.max(1, options.width ?? 120);
425
+ const height = Math.max(1, options.height ?? 30);
426
+ const padding = Math.max(0, options.padding ?? 2);
427
+ const rowCount = Math.max(group.sparklines.length, values.length, 1);
428
+ const rowHeight = height / rowCount;
429
+ const lineColor = resolveSparklineColor(group.colorSeries) ?? "#376091";
430
+ const negativeColor = resolveSparklineColor(group.colorNegative) ?? "#D00000";
431
+ const axisColor = resolveSparklineColor(group.colorAxis) ?? "#000000";
432
+ const markerColor = resolveSparklineColor(group.colorMarkers) ?? lineColor;
433
+ const highColor = resolveSparklineColor(group.colorHigh) ?? markerColor;
434
+ const lowColor = resolveSparklineColor(group.colorLow) ?? markerColor;
435
+ const firstColor = resolveSparklineColor(group.colorFirst) ?? markerColor;
436
+ const lastColor = resolveSparklineColor(group.colorLast) ?? markerColor;
437
+ const parts = [];
438
+ parts.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">`);
439
+ if (options.background) {
440
+ parts.push(`<rect x="0" y="0" width="${width}" height="${height}" fill="${escapeAttr(options.background)}"/>`);
441
+ }
442
+ // Per-group axis range: group means all sparklines share min/max;
443
+ // individual means each uses its own; custom uses manualMin/Max.
444
+ const groupMin = minOrNaN(values);
445
+ const groupMax = maxOrNaN(values);
446
+ for (let row = 0; row < rowCount; row++) {
447
+ const data = values[row] ?? [];
448
+ if (data.length === 0) {
449
+ continue;
450
+ }
451
+ const { min, max } = axisRangeFor(group, data, groupMin, groupMax);
452
+ const rowTop = rowHeight * row;
453
+ const innerX = padding;
454
+ const innerY = rowTop + padding;
455
+ const innerW = width - padding * 2;
456
+ const innerH = rowHeight - padding * 2;
457
+ if (innerW <= 0 || innerH <= 0) {
458
+ continue;
459
+ }
460
+ const span = max === min ? 1 : max - min;
461
+ const rtl = group.rightToLeft === true;
462
+ const xAt = (i, n) => {
463
+ const t = n <= 1 ? 0 : i / (n - 1);
464
+ const shifted = rtl ? 1 - t : t;
465
+ return innerX + shifted * innerW;
466
+ };
467
+ const yAt = (v) => {
468
+ if (!Number.isFinite(v)) {
469
+ return innerY + innerH;
470
+ }
471
+ const t = (v - min) / span;
472
+ return innerY + innerH - t * innerH;
473
+ };
474
+ if (group.type === "column" || group.type === "stacked") {
475
+ // Bar / win-loss sparkline. Stacked (a.k.a. win/loss) collapses
476
+ // magnitude so positives are full-height up, negatives full-height
477
+ // down, zeros disappear.
478
+ const n = data.length;
479
+ const barW = Math.max(1, (innerW / Math.max(n, 1)) * 0.8);
480
+ // Identify the value indices of the first / last / high / low
481
+ // bars up front so the loop below can swap colours in O(1).
482
+ // Excel honours `colorFirst / colorLast / colorHigh / colorLow`
483
+ // on column sparklines by RECOLORING the corresponding bar(s),
484
+ // not by overlaying a circle as line sparklines do. Previously
485
+ // the column / stacked branch ignored these flags entirely —
486
+ // any authored styling silently reverted to the plain palette.
487
+ let firstIdx = -1;
488
+ let lastIdx = -1;
489
+ let highIdx = -1;
490
+ let lowIdx = -1;
491
+ let highVal = -Infinity;
492
+ let lowVal = Infinity;
493
+ for (let i = 0; i < n; i++) {
494
+ const v = data[i];
495
+ if (!Number.isFinite(v)) {
496
+ continue;
497
+ }
498
+ if (firstIdx === -1) {
499
+ firstIdx = i;
500
+ }
501
+ lastIdx = i;
502
+ if (v > highVal) {
503
+ highVal = v;
504
+ highIdx = i;
505
+ }
506
+ if (v < lowVal) {
507
+ lowVal = v;
508
+ lowIdx = i;
509
+ }
510
+ }
511
+ for (let i = 0; i < n; i++) {
512
+ const v = data[i];
513
+ if (!Number.isFinite(v) || v === 0) {
514
+ continue;
515
+ }
516
+ const centre = xAt(i, n);
517
+ const x = centre - barW / 2;
518
+ // Negative bars pick up `colorNegative` only when the author
519
+ // opted in (`group.negative === true`). The previous
520
+ // `!== false` predicate inverted the default — `undefined`
521
+ // satisfies `!== false`, so every negative bar on a default-
522
+ // styled sparkline was painted red, diverging from Excel's
523
+ // own rendering on the same file.
524
+ let color = v < 0 && group.negative === true ? negativeColor : lineColor;
525
+ // Special-marker colour overrides run in Excel's precedence
526
+ // order: negative first, then high/low, then first/last
527
+ // (later wins when the same bar qualifies multiple times —
528
+ // matches Excel's observable behaviour on the same data).
529
+ if (group.high && i === highIdx) {
530
+ color = highColor;
531
+ }
532
+ if (group.low && i === lowIdx) {
533
+ color = lowColor;
534
+ }
535
+ if (group.first && i === firstIdx) {
536
+ color = firstColor;
537
+ }
538
+ if (group.last && i === lastIdx) {
539
+ color = lastColor;
540
+ }
541
+ let y;
542
+ let h;
543
+ if (group.type === "stacked") {
544
+ const half = innerH / 2;
545
+ if (v >= 0) {
546
+ y = innerY + half - half;
547
+ h = half;
548
+ }
549
+ else {
550
+ y = innerY + half;
551
+ h = half;
552
+ }
553
+ }
554
+ else {
555
+ const base = min <= 0 && max >= 0 ? yAt(0) : innerY + innerH;
556
+ const top = yAt(v);
557
+ y = Math.min(base, top);
558
+ h = Math.abs(base - top);
559
+ }
560
+ parts.push(`<rect x="${x}" y="${y}" width="${barW}" height="${Math.max(h, 1)}" fill="${color}"/>`);
561
+ }
562
+ }
563
+ else {
564
+ // Line sparkline.
565
+ const pointsFinite = [];
566
+ for (let i = 0; i < data.length; i++) {
567
+ const v = data[i];
568
+ if (Number.isFinite(v)) {
569
+ pointsFinite.push({ x: xAt(i, data.length), y: yAt(v), v });
570
+ }
571
+ }
572
+ if (pointsFinite.length >= 2) {
573
+ const d = pointsFinite.map((p, i) => `${i === 0 ? "M" : "L"}${p.x} ${p.y}`).join(" ");
574
+ parts.push(`<path d="${d}" fill="none" stroke="${lineColor}" stroke-width="${group.lineWeight ? group.lineWeight * 0.75 : 1}"/>`);
575
+ }
576
+ if (group.markers) {
577
+ for (const p of pointsFinite) {
578
+ parts.push(`<circle cx="${p.x}" cy="${p.y}" r="1.5" fill="${markerColor}"/>`);
579
+ }
580
+ }
581
+ // Special markers override the regular marker above.
582
+ if (pointsFinite.length > 0) {
583
+ if (group.first) {
584
+ const p = pointsFinite[0];
585
+ parts.push(`<circle cx="${p.x}" cy="${p.y}" r="1.8" fill="${firstColor}"/>`);
586
+ }
587
+ if (group.last) {
588
+ const p = pointsFinite[pointsFinite.length - 1];
589
+ parts.push(`<circle cx="${p.x}" cy="${p.y}" r="1.8" fill="${lastColor}"/>`);
590
+ }
591
+ if (group.high) {
592
+ const hi = pointsFinite.reduce((acc, p) => (p.v > acc.v ? p : acc), pointsFinite[0]);
593
+ parts.push(`<circle cx="${hi.x}" cy="${hi.y}" r="1.8" fill="${highColor}"/>`);
594
+ }
595
+ if (group.low) {
596
+ const lo = pointsFinite.reduce((acc, p) => (p.v < acc.v ? p : acc), pointsFinite[0]);
597
+ parts.push(`<circle cx="${lo.x}" cy="${lo.y}" r="1.8" fill="${lowColor}"/>`);
598
+ }
599
+ if (group.negative) {
600
+ for (const p of pointsFinite) {
601
+ if (p.v < 0) {
602
+ parts.push(`<circle cx="${p.x}" cy="${p.y}" r="1.8" fill="${negativeColor}"/>`);
603
+ }
604
+ }
605
+ }
606
+ }
607
+ }
608
+ if (group.displayXAxis) {
609
+ // Win/loss (`stacked`) sparklines always paint positives from
610
+ // the midpoint up and negatives from the midpoint down,
611
+ // regardless of magnitude — so the zero rule must sit at the
612
+ // geometric midpoint, not wherever `yAt(0)` lands on the
613
+ // min/max-scaled axis. The old `yAt(0)` was only correct when
614
+ // the data happened to be symmetric around zero; any asymmetry
615
+ // left the axis line visibly detached from where the bars met.
616
+ // Line / column sparklines render from actual min/max so their
617
+ // rule stays at `yAt(0)`, but only when zero is in range.
618
+ let axisY;
619
+ if (group.type === "stacked") {
620
+ axisY = innerY + innerH / 2;
621
+ }
622
+ else if (min <= 0 && max >= 0) {
623
+ axisY = yAt(0);
624
+ }
625
+ if (axisY !== undefined) {
626
+ parts.push(`<line x1="${innerX}" y1="${axisY}" x2="${innerX + innerW}" y2="${axisY}" stroke="${axisColor}" stroke-width="0.5"/>`);
627
+ }
628
+ }
629
+ }
630
+ parts.push(`</svg>`);
631
+ return parts.join("");
632
+ }
633
+ function axisRangeFor(group, row, groupMin, groupMax) {
634
+ let min;
635
+ let max;
636
+ // Track whether each bound came from the caller's explicit `custom`
637
+ // setting. A manual bound must never be padded away by the
638
+ // zero-span fallback below — a user who deliberately set
639
+ // `manualMin === manualMax` (e.g. to highlight deviation from a
640
+ // fixed reference value) would otherwise see their bound silently
641
+ // widened by ±1.
642
+ let minIsManual = false;
643
+ let maxIsManual = false;
644
+ if (group.minAxisType === "group") {
645
+ min = groupMin;
646
+ }
647
+ else if (group.minAxisType === "custom" && group.manualMin !== undefined) {
648
+ min = group.manualMin;
649
+ minIsManual = true;
650
+ }
651
+ else {
652
+ min = finiteMin(row);
653
+ }
654
+ if (group.maxAxisType === "group") {
655
+ max = groupMax;
656
+ }
657
+ else if (group.maxAxisType === "custom" && group.manualMax !== undefined) {
658
+ max = group.manualMax;
659
+ maxIsManual = true;
660
+ }
661
+ else {
662
+ max = finiteMax(row);
663
+ }
664
+ if (!Number.isFinite(min) || !Number.isFinite(max)) {
665
+ return { min: 0, max: 1 };
666
+ }
667
+ if (min === max) {
668
+ // Flat line — pad so the point renders in the middle. Only apply
669
+ // the pad when neither bound was manually authored; otherwise the
670
+ // user's explicit choice wins and the sparkline renders as a
671
+ // single point at mid-height (which is what the bound requested).
672
+ if (minIsManual || maxIsManual) {
673
+ return { min, max };
674
+ }
675
+ return { min: min - 1, max: max + 1 };
676
+ }
677
+ return { min, max };
678
+ }
679
+ function finiteMin(row) {
680
+ let r = Infinity;
681
+ for (const v of row) {
682
+ if (Number.isFinite(v) && v < r) {
683
+ r = v;
684
+ }
685
+ }
686
+ return r;
687
+ }
688
+ function finiteMax(row) {
689
+ let r = -Infinity;
690
+ for (const v of row) {
691
+ if (Number.isFinite(v) && v > r) {
692
+ r = v;
693
+ }
694
+ }
695
+ return r;
696
+ }
697
+ function minOrNaN(rows) {
698
+ let r = Infinity;
699
+ for (const row of rows) {
700
+ const m = finiteMin(row);
701
+ if (m < r) {
702
+ r = m;
703
+ }
704
+ }
705
+ return Number.isFinite(r) ? r : NaN;
706
+ }
707
+ function maxOrNaN(rows) {
708
+ let r = -Infinity;
709
+ for (const row of rows) {
710
+ const m = finiteMax(row);
711
+ if (m > r) {
712
+ r = m;
713
+ }
714
+ }
715
+ return Number.isFinite(r) ? r : NaN;
716
+ }
717
+ function resolveSparklineColor(color) {
718
+ if (!color) {
719
+ return undefined;
720
+ }
721
+ if (color.rgb) {
722
+ // Excel sparkline RGB hex is ARGB (8 chars) or RGB (6 chars); we
723
+ // normalise to a 6-char hex for SVG consumption, discarding alpha.
724
+ const hex = color.rgb.length === 8 ? color.rgb.slice(2) : color.rgb;
725
+ return `#${hex}`;
726
+ }
727
+ // Theme colours require the workbook theme to resolve precisely; for
728
+ // preview purposes fall back to a stable palette that roughly tracks
729
+ // Office defaults. Callers who need pixel-perfect theme resolution
730
+ // can supply a structured `rgb` instead.
731
+ if (color.theme !== undefined) {
732
+ const palette = [
733
+ "#000000",
734
+ "#FFFFFF",
735
+ "#1F497D",
736
+ "#EEECE1",
737
+ "#4F81BD",
738
+ "#C0504D",
739
+ "#9BBB59",
740
+ "#8064A2",
741
+ "#4BACC6",
742
+ "#F79646",
743
+ "#0000FF",
744
+ "#800080"
745
+ ];
746
+ return palette[color.theme] ?? "#000000";
747
+ }
748
+ return undefined;
749
+ }
750
+ function escapeAttr(s) {
751
+ // Attribute values additionally require `\t \n \r` → numeric refs
752
+ // so XML attribute-value normalisation doesn't collapse them to
753
+ // literal spaces (losing e.g. a manual cell-reference break in a
754
+ // sparkline group's `manualMin` / `manualMax` display label).
755
+ return (0, encode_1.xmlEncodeAttr)(s);
756
+ }