ooxml-core 1.1.0 → 1.2.1

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 (870) hide show
  1. package/README.md +18 -18
  2. package/dist/{PptxHandler-75LOVF7I.mjs → PptxHandler-VQQS4VS6.mjs} +3 -3
  3. package/dist/automation/index.cjs +7567 -4401
  4. package/dist/automation/index.mjs +7567 -4401
  5. package/dist/chart/bar-cluster-geometry.d.ts +6 -0
  6. package/dist/chart/bar-cluster-geometry.d.ts.map +1 -1
  7. package/dist/chart/color-palettes.d.ts +2 -2
  8. package/dist/chart/color-palettes.d.ts.map +1 -1
  9. package/dist/chart/data-cache.d.ts +6 -0
  10. package/dist/chart/data-cache.d.ts.map +1 -0
  11. package/dist/chart/gradient-coincident-stops.d.ts +17 -0
  12. package/dist/chart/gradient-coincident-stops.d.ts.map +1 -0
  13. package/dist/chart/gradient-definition.d.ts +3 -3
  14. package/dist/chart/gradient-definition.d.ts.map +1 -1
  15. package/dist/chart/index.cjs +3069 -140
  16. package/dist/chart/index.d.ts +7 -0
  17. package/dist/chart/index.d.ts.map +1 -1
  18. package/dist/chart/index.mjs +3048 -141
  19. package/dist/chart/model-chrome.d.ts +39 -0
  20. package/dist/chart/model-chrome.d.ts.map +1 -0
  21. package/dist/chart/model-series.d.ts +189 -0
  22. package/dist/chart/model-series.d.ts.map +1 -0
  23. package/dist/chart/model.d.ts +202 -0
  24. package/dist/chart/model.d.ts.map +1 -0
  25. package/dist/chart/parse-chrome.d.ts +16 -0
  26. package/dist/chart/parse-chrome.d.ts.map +1 -0
  27. package/dist/chart/parse-plot.d.ts +11 -0
  28. package/dist/chart/parse-plot.d.ts.map +1 -0
  29. package/dist/chart/parse-series.d.ts +8 -0
  30. package/dist/chart/parse-series.d.ts.map +1 -0
  31. package/dist/chart/parse-space.d.ts +8 -0
  32. package/dist/chart/parse-space.d.ts.map +1 -0
  33. package/dist/chart/parse-text.d.ts +12 -0
  34. package/dist/chart/parse-text.d.ts.map +1 -0
  35. package/dist/chart/parse-util.d.ts +42 -0
  36. package/dist/chart/parse-util.d.ts.map +1 -0
  37. package/dist/{xlsx/layout → chart/render}/chart-appearance.d.ts +4 -4
  38. package/dist/chart/render/chart-appearance.d.ts.map +1 -0
  39. package/dist/chart/render/chart-colors.d.ts +9 -0
  40. package/dist/chart/render/chart-colors.d.ts.map +1 -0
  41. package/dist/chart/render/chart-scale.d.ts.map +1 -0
  42. package/dist/chart/render/chart-spacing.d.ts +6 -0
  43. package/dist/chart/render/chart-spacing.d.ts.map +1 -0
  44. package/dist/{xlsx/layout → chart/render}/chart-svg-appearance.d.ts +1 -1
  45. package/dist/chart/render/chart-svg-appearance.d.ts.map +1 -0
  46. package/dist/chart/render/chart-svg-bars.d.ts.map +1 -0
  47. package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -0
  48. package/dist/chart/render/chart-svg-legend.d.ts.map +1 -0
  49. package/dist/chart/render/chart-svg-radial.d.ts.map +1 -0
  50. package/dist/chart/render/chart-svg-text-metrics.d.ts.map +1 -0
  51. package/dist/chart/render/chart-svg-title-text.d.ts.map +1 -0
  52. package/dist/chart/render/chart-svg-util.d.ts.map +1 -0
  53. package/dist/chart/render/chart-svg.d.ts.map +1 -0
  54. package/dist/chart/render/chart-title-text.d.ts +14 -0
  55. package/dist/chart/render/chart-title-text.d.ts.map +1 -0
  56. package/dist/chart/render/chart-value-axis.d.ts +6 -0
  57. package/dist/chart/render/chart-value-axis.d.ts.map +1 -0
  58. package/dist/chart/render/chart-view.d.ts +71 -0
  59. package/dist/chart/render/chart-view.d.ts.map +1 -0
  60. package/dist/chart/render/index.d.ts +9 -0
  61. package/dist/chart/render/index.d.ts.map +1 -0
  62. package/dist/chart/render/render-space.d.ts +34 -0
  63. package/dist/chart/render/render-space.d.ts.map +1 -0
  64. package/dist/chart/render/summary-from-space.d.ts +15 -0
  65. package/dist/chart/render/summary-from-space.d.ts.map +1 -0
  66. package/dist/chart/render/summary.d.ts +51 -0
  67. package/dist/chart/render/summary.d.ts.map +1 -0
  68. package/dist/chart/render/theme-palette.d.ts +8 -0
  69. package/dist/chart/render/theme-palette.d.ts.map +1 -0
  70. package/dist/chart/style-definition.d.ts +7 -7
  71. package/dist/chart/style-definition.d.ts.map +1 -1
  72. package/dist/chart/write-axes.d.ts +5 -0
  73. package/dist/chart/write-axes.d.ts.map +1 -0
  74. package/dist/chart/write-chrome.d.ts +9 -0
  75. package/dist/chart/write-chrome.d.ts.map +1 -0
  76. package/dist/chart/write-plot.d.ts +7 -0
  77. package/dist/chart/write-plot.d.ts.map +1 -0
  78. package/dist/chart/write-series.d.ts +7 -0
  79. package/dist/chart/write-series.d.ts.map +1 -0
  80. package/dist/chart/write-shape.d.ts +21 -0
  81. package/dist/chart/write-shape.d.ts.map +1 -0
  82. package/dist/chart/write-space.d.ts +15 -0
  83. package/dist/chart/write-space.d.ts.map +1 -0
  84. package/dist/chart/write-text-body.d.ts +6 -0
  85. package/dist/chart/write-text-body.d.ts.map +1 -0
  86. package/dist/chart/write-text.d.ts +15 -0
  87. package/dist/chart/write-text.d.ts.map +1 -0
  88. package/dist/chart/write-util.d.ts +24 -0
  89. package/dist/chart/write-util.d.ts.map +1 -0
  90. package/dist/chart/xml-fragment.d.ts +13 -0
  91. package/dist/chart/xml-fragment.d.ts.map +1 -0
  92. package/dist/{chunk-HUBK4EOT.mjs → chunk-3IT6ZD7K.mjs} +2 -0
  93. package/dist/{chunk-TS3E27NK.mjs → chunk-3UMDVJRN.mjs} +12 -1
  94. package/dist/{chunk-P22OKTRK.mjs → chunk-54S5A5PZ.mjs} +208 -159
  95. package/dist/{chunk-OMGH6IKY.mjs → chunk-5U27IVB7.mjs} +42 -5
  96. package/dist/{chunk-RFX7AJDZ.mjs → chunk-5VLNF4OX.mjs} +2 -2
  97. package/dist/{chunk-OJI3N5AY.cjs → chunk-FRUB573B.cjs} +2 -0
  98. package/dist/{chunk-75LA7H3F.mjs → chunk-V2BIGIH4.mjs} +27504 -27464
  99. package/dist/{chunk-Q27H4HFS.mjs → chunk-XBNSBDNT.mjs} +1 -1
  100. package/dist/{chunk-2C72N64G.cjs → chunk-XROY25LN.cjs} +12 -0
  101. package/dist/{chunk-LA7D6ZYQ.mjs → chunk-XSFHGZFH.mjs} +3579 -2083
  102. package/dist/collab/index.cjs +1 -0
  103. package/dist/collab/index.mjs +1 -0
  104. package/dist/collab/transport-provider.d.ts.map +1 -1
  105. package/dist/color/hex-rgb.d.ts +5 -0
  106. package/dist/color/hex-rgb.d.ts.map +1 -0
  107. package/dist/color/index.cjs +12 -0
  108. package/dist/color/index.d.ts +1 -0
  109. package/dist/color/index.d.ts.map +1 -1
  110. package/dist/color/index.mjs +11 -1
  111. package/dist/diagram/engine/alg-composite.d.ts +18 -0
  112. package/dist/diagram/engine/alg-composite.d.ts.map +1 -0
  113. package/dist/diagram/engine/alg-connector.d.ts +17 -0
  114. package/dist/diagram/engine/alg-connector.d.ts.map +1 -0
  115. package/dist/diagram/engine/alg-cycle.d.ts +28 -0
  116. package/dist/diagram/engine/alg-cycle.d.ts.map +1 -0
  117. package/dist/diagram/engine/alg-hier.d.ts +33 -0
  118. package/dist/diagram/engine/alg-hier.d.ts.map +1 -0
  119. package/dist/diagram/engine/alg-linear.d.ts +24 -0
  120. package/dist/diagram/engine/alg-linear.d.ts.map +1 -0
  121. package/dist/diagram/engine/alg-pyra.d.ts +117 -0
  122. package/dist/diagram/engine/alg-pyra.d.ts.map +1 -0
  123. package/dist/diagram/engine/alg-snake.d.ts +21 -0
  124. package/dist/diagram/engine/alg-snake.d.ts.map +1 -0
  125. package/dist/diagram/engine/axis.d.ts +24 -0
  126. package/dist/diagram/engine/axis.d.ts.map +1 -0
  127. package/dist/diagram/engine/conditions.d.ts +12 -0
  128. package/dist/diagram/engine/conditions.d.ts.map +1 -0
  129. package/dist/diagram/engine/connector-shape.d.ts +25 -0
  130. package/dist/diagram/engine/connector-shape.d.ts.map +1 -0
  131. package/dist/diagram/engine/connector-size.d.ts +30 -0
  132. package/dist/diagram/engine/connector-size.d.ts.map +1 -0
  133. package/dist/diagram/engine/constraint-eval.d.ts +37 -0
  134. package/dist/diagram/engine/constraint-eval.d.ts.map +1 -0
  135. package/dist/diagram/engine/constraint-fill-idiom.d.ts +61 -0
  136. package/dist/diagram/engine/constraint-fill-idiom.d.ts.map +1 -0
  137. package/dist/diagram/engine/constraint-units.d.ts +35 -0
  138. package/dist/diagram/engine/constraint-units.d.ts.map +1 -0
  139. package/dist/diagram/engine/data-points.d.ts +48 -0
  140. package/dist/diagram/engine/data-points.d.ts.map +1 -0
  141. package/dist/diagram/engine/engine-context.d.ts +21 -0
  142. package/dist/diagram/engine/engine-context.d.ts.map +1 -0
  143. package/dist/diagram/engine/engine-first-allowlist.d.ts +31 -0
  144. package/dist/diagram/engine/engine-first-allowlist.d.ts.map +1 -0
  145. package/dist/diagram/engine/engine-fonts.d.ts +26 -0
  146. package/dist/diagram/engine/engine-fonts.d.ts.map +1 -0
  147. package/dist/diagram/engine/engine-node.d.ts +72 -0
  148. package/dist/diagram/engine/engine-node.d.ts.map +1 -0
  149. package/dist/diagram/engine/engine-to-result.d.ts +43 -0
  150. package/dist/diagram/engine/engine-to-result.d.ts.map +1 -0
  151. package/dist/diagram/engine/engine.d.ts +18 -0
  152. package/dist/diagram/engine/engine.d.ts.map +1 -0
  153. package/dist/diagram/engine/font-groups.d.ts +33 -0
  154. package/dist/diagram/engine/font-groups.d.ts.map +1 -0
  155. package/dist/diagram/engine/font-length.d.ts +26 -0
  156. package/dist/diagram/engine/font-length.d.ts.map +1 -0
  157. package/dist/diagram/engine/font-search.d.ts +38 -0
  158. package/dist/diagram/engine/font-search.d.ts.map +1 -0
  159. package/dist/diagram/engine/hier-assistants.d.ts +47 -0
  160. package/dist/diagram/engine/hier-assistants.d.ts.map +1 -0
  161. package/dist/diagram/engine/hier-hang.d.ts +28 -0
  162. package/dist/diagram/engine/hier-hang.d.ts.map +1 -0
  163. package/dist/diagram/engine/hier-measure.d.ts +33 -0
  164. package/dist/diagram/engine/hier-measure.d.ts.map +1 -0
  165. package/dist/diagram/engine/hier-node-size.d.ts +23 -0
  166. package/dist/diagram/engine/hier-node-size.d.ts.map +1 -0
  167. package/dist/diagram/engine/hier-shape.d.ts +31 -0
  168. package/dist/diagram/engine/hier-shape.d.ts.map +1 -0
  169. package/dist/diagram/engine/index.d.ts +6 -0
  170. package/dist/diagram/engine/index.d.ts.map +1 -0
  171. package/dist/diagram/engine/layout-def-parse.d.ts +13 -0
  172. package/dist/diagram/engine/layout-def-parse.d.ts.map +1 -0
  173. package/dist/diagram/engine/layout-def-types.d.ts +118 -0
  174. package/dist/diagram/engine/layout-def-types.d.ts.map +1 -0
  175. package/dist/diagram/engine/layout-driver.d.ts +41 -0
  176. package/dist/diagram/engine/layout-driver.d.ts.map +1 -0
  177. package/dist/diagram/engine/layout-font.d.ts +27 -0
  178. package/dist/diagram/engine/layout-font.d.ts.map +1 -0
  179. package/dist/diagram/engine/move-with-merge.d.ts +49 -0
  180. package/dist/diagram/engine/move-with-merge.d.ts.map +1 -0
  181. package/dist/diagram/engine/node-text.d.ts +20 -0
  182. package/dist/diagram/engine/node-text.d.ts.map +1 -0
  183. package/dist/diagram/engine/ordered-xml.d.ts +30 -0
  184. package/dist/diagram/engine/ordered-xml.d.ts.map +1 -0
  185. package/dist/diagram/engine/preferred-size.d.ts +28 -0
  186. package/dist/diagram/engine/preferred-size.d.ts.map +1 -0
  187. package/dist/diagram/engine/pres-tree.d.ts +58 -0
  188. package/dist/diagram/engine/pres-tree.d.ts.map +1 -0
  189. package/dist/diagram/engine/registry.d.ts +7 -0
  190. package/dist/diagram/engine/registry.d.ts.map +1 -0
  191. package/dist/diagram/engine/render-filter.d.ts +43 -0
  192. package/dist/diagram/engine/render-filter.d.ts.map +1 -0
  193. package/dist/diagram/engine/shape-adjust.d.ts +16 -0
  194. package/dist/diagram/engine/shape-adjust.d.ts.map +1 -0
  195. package/dist/diagram/engine/shape-transform.d.ts +14 -0
  196. package/dist/diagram/engine/shape-transform.d.ts.map +1 -0
  197. package/dist/diagram/engine/snake-rule-fit.d.ts +34 -0
  198. package/dist/diagram/engine/snake-rule-fit.d.ts.map +1 -0
  199. package/dist/diagram/engine/style-label.d.ts +24 -0
  200. package/dist/diagram/engine/style-label.d.ts.map +1 -0
  201. package/dist/diagram/engine/text-fit.d.ts +61 -0
  202. package/dist/diagram/engine/text-fit.d.ts.map +1 -0
  203. package/dist/diagram/engine/text-grow.d.ts +33 -0
  204. package/dist/diagram/engine/text-grow.d.ts.map +1 -0
  205. package/dist/diagram/engine/text-measure.d.ts +77 -0
  206. package/dist/diagram/engine/text-measure.d.ts.map +1 -0
  207. package/dist/diagram/hierarchy/index.d.ts +5 -0
  208. package/dist/diagram/hierarchy/index.d.ts.map +1 -0
  209. package/dist/diagram/hierarchy/smartart-hierarchy-axis-pitch.d.ts +65 -0
  210. package/dist/diagram/hierarchy/smartart-hierarchy-axis-pitch.d.ts.map +1 -0
  211. package/dist/diagram/hierarchy/smartart-hierarchy-axis-swap-orientation.d.ts +68 -0
  212. package/dist/diagram/hierarchy/smartart-hierarchy-axis-swap-orientation.d.ts.map +1 -0
  213. package/dist/diagram/hierarchy/smartart-hierarchy-branch-mode.d.ts +54 -0
  214. package/dist/diagram/hierarchy/smartart-hierarchy-branch-mode.d.ts.map +1 -0
  215. package/dist/diagram/hierarchy/smartart-hierarchy-cascade.d.ts +58 -0
  216. package/dist/diagram/hierarchy/smartart-hierarchy-cascade.d.ts.map +1 -0
  217. package/dist/diagram/hierarchy/smartart-hierarchy-centered-fan-axis.d.ts +63 -0
  218. package/dist/diagram/hierarchy/smartart-hierarchy-centered-fan-axis.d.ts.map +1 -0
  219. package/dist/diagram/hierarchy/smartart-hierarchy-child-order.d.ts +41 -0
  220. package/dist/diagram/hierarchy/smartart-hierarchy-child-order.d.ts.map +1 -0
  221. package/dist/diagram/hierarchy/smartart-hierarchy-composite-child.d.ts +129 -0
  222. package/dist/diagram/hierarchy/smartart-hierarchy-composite-child.d.ts.map +1 -0
  223. package/dist/diagram/hierarchy/smartart-hierarchy-constraint-lookup.d.ts +76 -0
  224. package/dist/diagram/hierarchy/smartart-hierarchy-constraint-lookup.d.ts.map +1 -0
  225. package/dist/diagram/hierarchy/smartart-hierarchy-corner-plan.d.ts +49 -0
  226. package/dist/diagram/hierarchy/smartart-hierarchy-corner-plan.d.ts.map +1 -0
  227. package/dist/diagram/hierarchy/smartart-hierarchy-dispatch-lindir.d.ts +58 -0
  228. package/dist/diagram/hierarchy/smartart-hierarchy-dispatch-lindir.d.ts.map +1 -0
  229. package/dist/diagram/hierarchy/smartart-hierarchy-fan-aware-width.d.ts +48 -0
  230. package/dist/diagram/hierarchy/smartart-hierarchy-fan-aware-width.d.ts.map +1 -0
  231. package/dist/diagram/hierarchy/smartart-hierarchy-fan.d.ts +97 -0
  232. package/dist/diagram/hierarchy/smartart-hierarchy-fan.d.ts.map +1 -0
  233. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang-geometry.d.ts +42 -0
  234. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang-geometry.d.ts.map +1 -0
  235. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang.d.ts +74 -0
  236. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang.d.ts.map +1 -0
  237. package/dist/diagram/hierarchy/smartart-hierarchy-fit-item-box.d.ts +111 -0
  238. package/dist/diagram/hierarchy/smartart-hierarchy-fit-item-box.d.ts.map +1 -0
  239. package/dist/diagram/hierarchy/smartart-hierarchy-fold-depth.d.ts +44 -0
  240. package/dist/diagram/hierarchy/smartart-hierarchy-fold-depth.d.ts.map +1 -0
  241. package/dist/diagram/hierarchy/smartart-hierarchy-generation-gap.d.ts +60 -0
  242. package/dist/diagram/hierarchy/smartart-hierarchy-generation-gap.d.ts.map +1 -0
  243. package/dist/diagram/hierarchy/smartart-hierarchy-generation-templates.d.ts +106 -0
  244. package/dist/diagram/hierarchy/smartart-hierarchy-generation-templates.d.ts.map +1 -0
  245. package/dist/diagram/hierarchy/smartart-hierarchy-hang-depth.d.ts +133 -0
  246. package/dist/diagram/hierarchy/smartart-hierarchy-hang-depth.d.ts.map +1 -0
  247. package/dist/diagram/hierarchy/smartart-hierarchy-hang-dispatch.d.ts +28 -0
  248. package/dist/diagram/hierarchy/smartart-hierarchy-hang-dispatch.d.ts.map +1 -0
  249. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-arrange.d.ts +28 -0
  250. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-arrange.d.ts.map +1 -0
  251. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-box.d.ts +86 -0
  252. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-box.d.ts.map +1 -0
  253. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-fold.d.ts +36 -0
  254. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-fold.d.ts.map +1 -0
  255. package/dist/diagram/hierarchy/smartart-hierarchy-hanging.d.ts +118 -0
  256. package/dist/diagram/hierarchy/smartart-hierarchy-hanging.d.ts.map +1 -0
  257. package/dist/diagram/hierarchy/smartart-hierarchy-item-template.d.ts +64 -0
  258. package/dist/diagram/hierarchy/smartart-hierarchy-item-template.d.ts.map +1 -0
  259. package/dist/diagram/hierarchy/smartart-hierarchy-orgchart-tree.d.ts +53 -0
  260. package/dist/diagram/hierarchy/smartart-hierarchy-orgchart-tree.d.ts.map +1 -0
  261. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-resolve.d.ts +36 -0
  262. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-resolve.d.ts.map +1 -0
  263. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-types.d.ts +81 -0
  264. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-types.d.ts.map +1 -0
  265. package/dist/diagram/hierarchy/smartart-hierarchy-orientation.d.ts +78 -0
  266. package/dist/diagram/hierarchy/smartart-hierarchy-orientation.d.ts.map +1 -0
  267. package/dist/diagram/hierarchy/smartart-hierarchy-pitch.d.ts +140 -0
  268. package/dist/diagram/hierarchy/smartart-hierarchy-pitch.d.ts.map +1 -0
  269. package/dist/diagram/hierarchy/smartart-hierarchy-shared.d.ts +131 -0
  270. package/dist/diagram/hierarchy/smartart-hierarchy-shared.d.ts.map +1 -0
  271. package/dist/diagram/hierarchy/smartart-hierarchy-standard-options.d.ts +91 -0
  272. package/dist/diagram/hierarchy/smartart-hierarchy-standard-options.d.ts.map +1 -0
  273. package/dist/diagram/hierarchy/smartart-hierarchy-standard-rows.d.ts +21 -0
  274. package/dist/diagram/hierarchy/smartart-hierarchy-standard-rows.d.ts.map +1 -0
  275. package/dist/diagram/hierarchy/smartart-hierarchy-standard.d.ts +36 -0
  276. package/dist/diagram/hierarchy/smartart-hierarchy-standard.d.ts.map +1 -0
  277. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-placer.d.ts +20 -0
  278. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-placer.d.ts.map +1 -0
  279. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-transpose.d.ts +50 -0
  280. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-transpose.d.ts.map +1 -0
  281. package/dist/diagram/hierarchy/smartart-hierarchy-transpose.d.ts +23 -0
  282. package/dist/diagram/hierarchy/smartart-hierarchy-transpose.d.ts.map +1 -0
  283. package/dist/diagram/hierarchy/smartart-hierarchy-transposed-orientation.d.ts +22 -0
  284. package/dist/diagram/hierarchy/smartart-hierarchy-transposed-orientation.d.ts.map +1 -0
  285. package/dist/diagram/hierarchy/smartart-hierarchy-wrapped-groups.d.ts +93 -0
  286. package/dist/diagram/hierarchy/smartart-hierarchy-wrapped-groups.d.ts.map +1 -0
  287. package/dist/diagram/hierarchy/smartart-layout-interpreter-hierarchy.d.ts +49 -0
  288. package/dist/diagram/hierarchy/smartart-layout-interpreter-hierarchy.d.ts.map +1 -0
  289. package/dist/diagram/index.cjs +22537 -80
  290. package/dist/diagram/index.d.ts +4 -0
  291. package/dist/diagram/index.d.ts.map +1 -1
  292. package/dist/diagram/index.mjs +22453 -81
  293. package/dist/diagram/layout/index.d.ts +38 -0
  294. package/dist/diagram/layout/index.d.ts.map +1 -0
  295. package/dist/diagram/layout/smartart-choose-xml.d.ts +32 -0
  296. package/dist/diagram/layout/smartart-choose-xml.d.ts.map +1 -0
  297. package/dist/diagram/layout/smartart-constraint-branch-index.d.ts +49 -0
  298. package/dist/diagram/layout/smartart-constraint-branch-index.d.ts.map +1 -0
  299. package/dist/diagram/layout/smartart-constraint-declared-by.d.ts +64 -0
  300. package/dist/diagram/layout/smartart-constraint-declared-by.d.ts.map +1 -0
  301. package/dist/diagram/layout/smartart-constraint-ratio-fallback.d.ts +18 -0
  302. package/dist/diagram/layout/smartart-constraint-ratio-fallback.d.ts.map +1 -0
  303. package/dist/diagram/layout/smartart-constraint-resolve.d.ts +24 -0
  304. package/dist/diagram/layout/smartart-constraint-resolve.d.ts.map +1 -0
  305. package/dist/diagram/layout/smartart-constraint-rules.d.ts +26 -0
  306. package/dist/diagram/layout/smartart-constraint-rules.d.ts.map +1 -0
  307. package/dist/diagram/layout/smartart-constraint-sibling-roles.d.ts +100 -0
  308. package/dist/diagram/layout/smartart-constraint-sibling-roles.d.ts.map +1 -0
  309. package/dist/diagram/layout/smartart-constraint-solver.d.ts +133 -0
  310. package/dist/diagram/layout/smartart-constraint-solver.d.ts.map +1 -0
  311. package/dist/diagram/layout/smartart-constraint-values.d.ts +5 -0
  312. package/dist/diagram/layout/smartart-constraint-values.d.ts.map +1 -0
  313. package/dist/diagram/layout/smartart-font-table.d.ts +14 -0
  314. package/dist/diagram/layout/smartart-font-table.d.ts.map +1 -0
  315. package/dist/diagram/layout/smartart-interpreter-fold-text.d.ts +75 -0
  316. package/dist/diagram/layout/smartart-interpreter-fold-text.d.ts.map +1 -0
  317. package/dist/diagram/layout/smartart-layout-control-flow.d.ts +25 -0
  318. package/dist/diagram/layout/smartart-layout-control-flow.d.ts.map +1 -0
  319. package/dist/diagram/layout/smartart-layout-interpreter-arranged-selection.d.ts +56 -0
  320. package/dist/diagram/layout/smartart-layout-interpreter-arranged-selection.d.ts.map +1 -0
  321. package/dist/diagram/layout/smartart-layout-interpreter-arrangement-kind.d.ts +37 -0
  322. package/dist/diagram/layout/smartart-layout-interpreter-arrangement-kind.d.ts.map +1 -0
  323. package/dist/diagram/layout/smartart-layout-interpreter-aux.d.ts +66 -0
  324. package/dist/diagram/layout/smartart-layout-interpreter-aux.d.ts.map +1 -0
  325. package/dist/diagram/layout/smartart-layout-interpreter-axis-count.d.ts +128 -0
  326. package/dist/diagram/layout/smartart-layout-interpreter-axis-count.d.ts.map +1 -0
  327. package/dist/diagram/layout/smartart-layout-interpreter-axis-depth.d.ts +73 -0
  328. package/dist/diagram/layout/smartart-layout-interpreter-axis-depth.d.ts.map +1 -0
  329. package/dist/diagram/layout/smartart-layout-interpreter-axis-hop.d.ts +48 -0
  330. package/dist/diagram/layout/smartart-layout-interpreter-axis-hop.d.ts.map +1 -0
  331. package/dist/diagram/layout/smartart-layout-interpreter-axis-range.d.ts +19 -0
  332. package/dist/diagram/layout/smartart-layout-interpreter-axis-range.d.ts.map +1 -0
  333. package/dist/diagram/layout/smartart-layout-interpreter-choose-algorithm.d.ts +60 -0
  334. package/dist/diagram/layout/smartart-layout-interpreter-choose-algorithm.d.ts.map +1 -0
  335. package/dist/diagram/layout/smartart-layout-interpreter-choose-branch.d.ts +36 -0
  336. package/dist/diagram/layout/smartart-layout-interpreter-choose-branch.d.ts.map +1 -0
  337. package/dist/diagram/layout/smartart-layout-interpreter-choose-composite.d.ts +42 -0
  338. package/dist/diagram/layout/smartart-layout-interpreter-choose-composite.d.ts.map +1 -0
  339. package/dist/diagram/layout/smartart-layout-interpreter-choose-depth.d.ts +102 -0
  340. package/dist/diagram/layout/smartart-layout-interpreter-choose-depth.d.ts.map +1 -0
  341. package/dist/diagram/layout/smartart-layout-interpreter-choose-resolve.d.ts +32 -0
  342. package/dist/diagram/layout/smartart-layout-interpreter-choose-resolve.d.ts.map +1 -0
  343. package/dist/diagram/layout/smartart-layout-interpreter-composite-alternative.d.ts +33 -0
  344. package/dist/diagram/layout/smartart-layout-interpreter-composite-alternative.d.ts.map +1 -0
  345. package/dist/diagram/layout/smartart-layout-interpreter-composite-anchor.d.ts +95 -0
  346. package/dist/diagram/layout/smartart-layout-interpreter-composite-anchor.d.ts.map +1 -0
  347. package/dist/diagram/layout/smartart-layout-interpreter-composite-aspect.d.ts +84 -0
  348. package/dist/diagram/layout/smartart-layout-interpreter-composite-aspect.d.ts.map +1 -0
  349. package/dist/diagram/layout/smartart-layout-interpreter-composite-candidates.d.ts +60 -0
  350. package/dist/diagram/layout/smartart-layout-interpreter-composite-candidates.d.ts.map +1 -0
  351. package/dist/diagram/layout/smartart-layout-interpreter-composite-children.d.ts +86 -0
  352. package/dist/diagram/layout/smartart-layout-interpreter-composite-children.d.ts.map +1 -0
  353. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose-groups.d.ts +44 -0
  354. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose-groups.d.ts.map +1 -0
  355. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose.d.ts +109 -0
  356. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose.d.ts.map +1 -0
  357. package/dist/diagram/layout/smartart-layout-interpreter-composite-detect.d.ts +182 -0
  358. package/dist/diagram/layout/smartart-layout-interpreter-composite-detect.d.ts.map +1 -0
  359. package/dist/diagram/layout/smartart-layout-interpreter-composite-fontfit.d.ts +60 -0
  360. package/dist/diagram/layout/smartart-layout-interpreter-composite-fontfit.d.ts.map +1 -0
  361. package/dist/diagram/layout/smartart-layout-interpreter-composite-foreach.d.ts +36 -0
  362. package/dist/diagram/layout/smartart-layout-interpreter-composite-foreach.d.ts.map +1 -0
  363. package/dist/diagram/layout/smartart-layout-interpreter-composite-group-slots.d.ts +92 -0
  364. package/dist/diagram/layout/smartart-layout-interpreter-composite-group-slots.d.ts.map +1 -0
  365. package/dist/diagram/layout/smartart-layout-interpreter-composite-iteration.d.ts +45 -0
  366. package/dist/diagram/layout/smartart-layout-interpreter-composite-iteration.d.ts.map +1 -0
  367. package/dist/diagram/layout/smartart-layout-interpreter-composite-nested-cycle.d.ts +57 -0
  368. package/dist/diagram/layout/smartart-layout-interpreter-composite-nested-cycle.d.ts.map +1 -0
  369. package/dist/diagram/layout/smartart-layout-interpreter-composite-order-fallback.d.ts +24 -0
  370. package/dist/diagram/layout/smartart-layout-interpreter-composite-order-fallback.d.ts.map +1 -0
  371. package/dist/diagram/layout/smartart-layout-interpreter-composite-order.d.ts +41 -0
  372. package/dist/diagram/layout/smartart-layout-interpreter-composite-order.d.ts.map +1 -0
  373. package/dist/diagram/layout/smartart-layout-interpreter-composite-pairs.d.ts +34 -0
  374. package/dist/diagram/layout/smartart-layout-interpreter-composite-pairs.d.ts.map +1 -0
  375. package/dist/diagram/layout/smartart-layout-interpreter-composite-render.d.ts +29 -0
  376. package/dist/diagram/layout/smartart-layout-interpreter-composite-render.d.ts.map +1 -0
  377. package/dist/diagram/layout/smartart-layout-interpreter-composite-ring.d.ts +40 -0
  378. package/dist/diagram/layout/smartart-layout-interpreter-composite-ring.d.ts.map +1 -0
  379. package/dist/diagram/layout/smartart-layout-interpreter-composite-slot-dim.d.ts +22 -0
  380. package/dist/diagram/layout/smartart-layout-interpreter-composite-slot-dim.d.ts.map +1 -0
  381. package/dist/diagram/layout/smartart-layout-interpreter-composite-slots.d.ts +69 -0
  382. package/dist/diagram/layout/smartart-layout-interpreter-composite-slots.d.ts.map +1 -0
  383. package/dist/diagram/layout/smartart-layout-interpreter-composite.d.ts +56 -0
  384. package/dist/diagram/layout/smartart-layout-interpreter-composite.d.ts.map +1 -0
  385. package/dist/diagram/layout/smartart-layout-interpreter-conn-path.d.ts +42 -0
  386. package/dist/diagram/layout/smartart-layout-interpreter-conn-path.d.ts.map +1 -0
  387. package/dist/diagram/layout/smartart-layout-interpreter-connector-order.d.ts +23 -0
  388. package/dist/diagram/layout/smartart-layout-interpreter-connector-order.d.ts.map +1 -0
  389. package/dist/diagram/layout/smartart-layout-interpreter-constraints.d.ts +28 -0
  390. package/dist/diagram/layout/smartart-layout-interpreter-constraints.d.ts.map +1 -0
  391. package/dist/diagram/layout/smartart-layout-interpreter-custom.d.ts +31 -0
  392. package/dist/diagram/layout/smartart-layout-interpreter-custom.d.ts.map +1 -0
  393. package/dist/diagram/layout/smartart-layout-interpreter-cycle-boxes.d.ts +36 -0
  394. package/dist/diagram/layout/smartart-layout-interpreter-cycle-boxes.d.ts.map +1 -0
  395. package/dist/diagram/layout/smartart-layout-interpreter-cycle-connectors.d.ts +21 -0
  396. package/dist/diagram/layout/smartart-layout-interpreter-cycle-connectors.d.ts.map +1 -0
  397. package/dist/diagram/layout/smartart-layout-interpreter-cycle-constraints.d.ts +116 -0
  398. package/dist/diagram/layout/smartart-layout-interpreter-cycle-constraints.d.ts.map +1 -0
  399. package/dist/diagram/layout/smartart-layout-interpreter-cycle-extension.d.ts +110 -0
  400. package/dist/diagram/layout/smartart-layout-interpreter-cycle-extension.d.ts.map +1 -0
  401. package/dist/diagram/layout/smartart-layout-interpreter-cycle-fontfit.d.ts +50 -0
  402. package/dist/diagram/layout/smartart-layout-interpreter-cycle-fontfit.d.ts.map +1 -0
  403. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-detect.d.ts +66 -0
  404. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-detect.d.ts.map +1 -0
  405. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio-usersize.d.ts +81 -0
  406. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio-usersize.d.ts.map +1 -0
  407. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio.d.ts +109 -0
  408. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio.d.ts.map +1 -0
  409. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-aspect.d.ts +121 -0
  410. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-aspect.d.ts.map +1 -0
  411. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-node.d.ts +57 -0
  412. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-node.d.ts.map +1 -0
  413. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-bulge.d.ts +34 -0
  414. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-bulge.d.ts.map +1 -0
  415. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-item.d.ts +39 -0
  416. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-item.d.ts.map +1 -0
  417. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-nested-hub.d.ts +22 -0
  418. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-nested-hub.d.ts.map +1 -0
  419. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-offset.d.ts +43 -0
  420. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-offset.d.ts.map +1 -0
  421. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring.d.ts +76 -0
  422. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring.d.ts.map +1 -0
  423. package/dist/diagram/layout/smartart-layout-interpreter-cycle-sibtrans.d.ts +40 -0
  424. package/dist/diagram/layout/smartart-layout-interpreter-cycle-sibtrans.d.ts.map +1 -0
  425. package/dist/diagram/layout/smartart-layout-interpreter-cycle.d.ts +69 -0
  426. package/dist/diagram/layout/smartart-layout-interpreter-cycle.d.ts.map +1 -0
  427. package/dist/diagram/layout/smartart-layout-interpreter-dispatch.d.ts +18 -0
  428. package/dist/diagram/layout/smartart-layout-interpreter-dispatch.d.ts.map +1 -0
  429. package/dist/diagram/layout/smartart-layout-interpreter-flow-direction.d.ts +29 -0
  430. package/dist/diagram/layout/smartart-layout-interpreter-flow-direction.d.ts.map +1 -0
  431. package/dist/diagram/layout/smartart-layout-interpreter-flow.d.ts +49 -0
  432. package/dist/diagram/layout/smartart-layout-interpreter-flow.d.ts.map +1 -0
  433. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-descendant.d.ts +60 -0
  434. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-descendant.d.ts.map +1 -0
  435. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-fontfit.d.ts +45 -0
  436. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-fontfit.d.ts.map +1 -0
  437. package/dist/diagram/layout/smartart-layout-interpreter-hub-detect.d.ts +26 -0
  438. package/dist/diagram/layout/smartart-layout-interpreter-hub-detect.d.ts.map +1 -0
  439. package/dist/diagram/layout/smartart-layout-interpreter-hub.d.ts +62 -0
  440. package/dist/diagram/layout/smartart-layout-interpreter-hub.d.ts.map +1 -0
  441. package/dist/diagram/layout/smartart-layout-interpreter-item-role-compound.d.ts +36 -0
  442. package/dist/diagram/layout/smartart-layout-interpreter-item-role-compound.d.ts.map +1 -0
  443. package/dist/diagram/layout/smartart-layout-interpreter-item-role-orientation.d.ts +80 -0
  444. package/dist/diagram/layout/smartart-layout-interpreter-item-role-orientation.d.ts.map +1 -0
  445. package/dist/diagram/layout/smartart-layout-interpreter-item-role-shared.d.ts +102 -0
  446. package/dist/diagram/layout/smartart-layout-interpreter-item-role-shared.d.ts.map +1 -0
  447. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-columns.d.ts +23 -0
  448. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-columns.d.ts.map +1 -0
  449. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-fields.d.ts +77 -0
  450. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-fields.d.ts.map +1 -0
  451. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-rect.d.ts +20 -0
  452. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-rect.d.ts.map +1 -0
  453. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack.d.ts +53 -0
  454. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack.d.ts.map +1 -0
  455. package/dist/diagram/layout/smartart-layout-interpreter-item-role-transition.d.ts +50 -0
  456. package/dist/diagram/layout/smartart-layout-interpreter-item-role-transition.d.ts.map +1 -0
  457. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-recursive.d.ts +87 -0
  458. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-recursive.d.ts.map +1 -0
  459. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-unwrap.d.ts +57 -0
  460. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-unwrap.d.ts.map +1 -0
  461. package/dist/diagram/layout/smartart-layout-interpreter-item-roles.d.ts +109 -0
  462. package/dist/diagram/layout/smartart-layout-interpreter-item-roles.d.ts.map +1 -0
  463. package/dist/diagram/layout/smartart-layout-interpreter-linear-content-size.d.ts +42 -0
  464. package/dist/diagram/layout/smartart-layout-interpreter-linear-content-size.d.ts.map +1 -0
  465. package/dist/diagram/layout/smartart-layout-interpreter-linear-item-aspect.d.ts +94 -0
  466. package/dist/diagram/layout/smartart-layout-interpreter-linear-item-aspect.d.ts.map +1 -0
  467. package/dist/diagram/layout/smartart-layout-interpreter-linear-main-axis.d.ts +17 -0
  468. package/dist/diagram/layout/smartart-layout-interpreter-linear-main-axis.d.ts.map +1 -0
  469. package/dist/diagram/layout/smartart-layout-interpreter-linear-shared.d.ts +21 -0
  470. package/dist/diagram/layout/smartart-layout-interpreter-linear-shared.d.ts.map +1 -0
  471. package/dist/diagram/layout/smartart-layout-interpreter-linear-table.d.ts +76 -0
  472. package/dist/diagram/layout/smartart-layout-interpreter-linear-table.d.ts.map +1 -0
  473. package/dist/diagram/layout/smartart-layout-interpreter-linear.d.ts +20 -0
  474. package/dist/diagram/layout/smartart-layout-interpreter-linear.d.ts.map +1 -0
  475. package/dist/diagram/layout/smartart-layout-interpreter-model.d.ts +77 -0
  476. package/dist/diagram/layout/smartart-layout-interpreter-model.d.ts.map +1 -0
  477. package/dist/diagram/layout/smartart-layout-interpreter-named-rules.d.ts +93 -0
  478. package/dist/diagram/layout/smartart-layout-interpreter-named-rules.d.ts.map +1 -0
  479. package/dist/diagram/layout/smartart-layout-interpreter-position-family.d.ts +58 -0
  480. package/dist/diagram/layout/smartart-layout-interpreter-position-family.d.ts.map +1 -0
  481. package/dist/diagram/layout/smartart-layout-interpreter-preset-node.d.ts +61 -0
  482. package/dist/diagram/layout/smartart-layout-interpreter-preset-node.d.ts.map +1 -0
  483. package/dist/diagram/layout/smartart-layout-interpreter-presof-choose.d.ts +29 -0
  484. package/dist/diagram/layout/smartart-layout-interpreter-presof-choose.d.ts.map +1 -0
  485. package/dist/diagram/layout/smartart-layout-interpreter-pyramid-bands.d.ts +41 -0
  486. package/dist/diagram/layout/smartart-layout-interpreter-pyramid-bands.d.ts.map +1 -0
  487. package/dist/diagram/layout/smartart-layout-interpreter-pyramid.d.ts +100 -0
  488. package/dist/diagram/layout/smartart-layout-interpreter-pyramid.d.ts.map +1 -0
  489. package/dist/diagram/layout/smartart-layout-interpreter-render.d.ts +86 -0
  490. package/dist/diagram/layout/smartart-layout-interpreter-render.d.ts.map +1 -0
  491. package/dist/diagram/layout/smartart-layout-interpreter-snake.d.ts +18 -0
  492. package/dist/diagram/layout/smartart-layout-interpreter-snake.d.ts.map +1 -0
  493. package/dist/diagram/layout/smartart-layout-interpreter-tree-location.d.ts +28 -0
  494. package/dist/diagram/layout/smartart-layout-interpreter-tree-location.d.ts.map +1 -0
  495. package/dist/diagram/layout/smartart-layout-interpreter-when-numeric.d.ts +15 -0
  496. package/dist/diagram/layout/smartart-layout-interpreter-when-numeric.d.ts.map +1 -0
  497. package/dist/diagram/layout/smartart-layout-interpreter-when-var.d.ts +12 -0
  498. package/dist/diagram/layout/smartart-layout-interpreter-when-var.d.ts.map +1 -0
  499. package/dist/diagram/layout/smartart-layout-interpreter-when.d.ts +69 -0
  500. package/dist/diagram/layout/smartart-layout-interpreter-when.d.ts.map +1 -0
  501. package/dist/diagram/layout/smartart-layout-interpreter.d.ts +80 -0
  502. package/dist/diagram/layout/smartart-layout-interpreter.d.ts.map +1 -0
  503. package/dist/diagram/layout/smartart-layout-item-font-role.d.ts +80 -0
  504. package/dist/diagram/layout/smartart-layout-item-font-role.d.ts.map +1 -0
  505. package/dist/diagram/layout/smartart-layout-item-font-size.d.ts +129 -0
  506. package/dist/diagram/layout/smartart-layout-item-font-size.d.ts.map +1 -0
  507. package/dist/diagram/layout/smartart-layout-item-font-tier-fit.d.ts +70 -0
  508. package/dist/diagram/layout/smartart-layout-item-font-tier-fit.d.ts.map +1 -0
  509. package/dist/diagram/layout/smartart-layout-item-font-tier.d.ts +139 -0
  510. package/dist/diagram/layout/smartart-layout-item-font-tier.d.ts.map +1 -0
  511. package/dist/diagram/layout/smartart-layout-item-tx-anchor.d.ts +105 -0
  512. package/dist/diagram/layout/smartart-layout-item-tx-anchor.d.ts.map +1 -0
  513. package/dist/diagram/layout/smartart-layout-shape-polygon.d.ts +17 -0
  514. package/dist/diagram/layout/smartart-layout-shape-polygon.d.ts.map +1 -0
  515. package/dist/diagram/layout/smartart-layout-shape-preset.d.ts +127 -0
  516. package/dist/diagram/layout/smartart-layout-shape-preset.d.ts.map +1 -0
  517. package/dist/diagram/layout/smartart-layout-snake-grid.d.ts +43 -0
  518. package/dist/diagram/layout/smartart-layout-snake-grid.d.ts.map +1 -0
  519. package/dist/diagram/layout/smartart-layout-style-helpers.d.ts +84 -0
  520. package/dist/diagram/layout/smartart-layout-style-helpers.d.ts.map +1 -0
  521. package/dist/diagram/layout/smartart-layout-types.d.ts +253 -0
  522. package/dist/diagram/layout/smartart-layout-types.d.ts.map +1 -0
  523. package/dist/diagram/layout/smartart-line-pitch.d.ts +29 -0
  524. package/dist/diagram/layout/smartart-line-pitch.d.ts.map +1 -0
  525. package/dist/diagram/layout/smartart-node-role-colors.d.ts +30 -0
  526. package/dist/diagram/layout/smartart-node-role-colors.d.ts.map +1 -0
  527. package/dist/diagram/layout/smartart-node-tree-axis.d.ts +91 -0
  528. package/dist/diagram/layout/smartart-node-tree-axis.d.ts.map +1 -0
  529. package/dist/diagram/layout/smartart-text-wrap-fit.d.ts +84 -0
  530. package/dist/diagram/layout/smartart-text-wrap-fit.d.ts.map +1 -0
  531. package/dist/diagram/layout/smartart-tree.d.ts +33 -0
  532. package/dist/diagram/layout/smartart-tree.d.ts.map +1 -0
  533. package/dist/diagram/model/constraint-rules.d.ts +31 -0
  534. package/dist/diagram/model/constraint-rules.d.ts.map +1 -0
  535. package/dist/diagram/model/data.d.ts +109 -0
  536. package/dist/diagram/model/data.d.ts.map +1 -0
  537. package/dist/diagram/model/index.d.ts +7 -0
  538. package/dist/diagram/model/index.d.ts.map +1 -0
  539. package/dist/diagram/model/layout-definition.d.ts +276 -0
  540. package/dist/diagram/model/layout-definition.d.ts.map +1 -0
  541. package/dist/diagram/model/layout-primitives.d.ts +82 -0
  542. package/dist/diagram/model/layout-primitives.d.ts.map +1 -0
  543. package/dist/diagram/model/node.d.ts +194 -0
  544. package/dist/diagram/model/node.d.ts.map +1 -0
  545. package/dist/diagram/model/style-definition.d.ts +131 -0
  546. package/dist/diagram/model/style-definition.d.ts.map +1 -0
  547. package/dist/docx/chart-paint.d.ts +14 -0
  548. package/dist/docx/chart-paint.d.ts.map +1 -0
  549. package/dist/docx/chart.d.ts +43 -0
  550. package/dist/docx/chart.d.ts.map +1 -0
  551. package/dist/docx/drawing.d.ts.map +1 -1
  552. package/dist/docx/embedded.cjs +1393 -326
  553. package/dist/docx/embedded.mjs +1393 -326
  554. package/dist/docx/index.cjs +4044 -683
  555. package/dist/docx/index.d.ts +2 -0
  556. package/dist/docx/index.d.ts.map +1 -1
  557. package/dist/docx/index.mjs +4040 -684
  558. package/dist/docx/inline-model.d.ts +3 -0
  559. package/dist/docx/inline-model.d.ts.map +1 -1
  560. package/dist/docx/layout/adapter.d.ts.map +1 -1
  561. package/dist/docx/layout/index.cjs +2674 -88
  562. package/dist/docx/layout/index.mjs +2675 -89
  563. package/dist/docx/layout/input.d.ts +5 -0
  564. package/dist/docx/layout/input.d.ts.map +1 -1
  565. package/dist/docx/load/index.cjs +1616 -549
  566. package/dist/docx/load/index.mjs +1616 -549
  567. package/dist/docx/parse.d.ts.map +1 -1
  568. package/dist/docx/ui/chart-spec.d.ts +10 -0
  569. package/dist/docx/ui/chart-spec.d.ts.map +1 -0
  570. package/dist/docx/ui/index.cjs +2602 -186
  571. package/dist/docx/ui/index.d.ts +1 -0
  572. package/dist/docx/ui/index.d.ts.map +1 -1
  573. package/dist/docx/ui/index.mjs +2601 -188
  574. package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
  575. package/dist/docx/ui/run-adapter.d.ts.map +1 -1
  576. package/dist/drawingml/write-line.d.ts +7 -0
  577. package/dist/drawingml/write-line.d.ts.map +1 -0
  578. package/dist/geometry/ooxml-arc.d.ts +31 -0
  579. package/dist/geometry/ooxml-arc.d.ts.map +1 -0
  580. package/dist/geometry/preset-shape-evaluator.d.ts +73 -0
  581. package/dist/geometry/preset-shape-evaluator.d.ts.map +1 -0
  582. package/dist/index.cjs +34839 -18368
  583. package/dist/index.mjs +34835 -18368
  584. package/dist/opc/embedded-packages.d.ts +11 -0
  585. package/dist/opc/embedded-packages.d.ts.map +1 -0
  586. package/dist/opc/index.cjs +365 -70
  587. package/dist/opc/index.d.ts +1 -0
  588. package/dist/opc/index.d.ts.map +1 -1
  589. package/dist/opc/index.mjs +353 -71
  590. package/dist/opc/properties/app.d.ts +9 -3
  591. package/dist/opc/properties/app.d.ts.map +1 -1
  592. package/dist/opc/properties/core.d.ts +5 -1
  593. package/dist/opc/properties/core.d.ts.map +1 -1
  594. package/dist/opc/properties/custom.d.ts +19 -0
  595. package/dist/opc/properties/custom.d.ts.map +1 -1
  596. package/dist/opc/properties/index.d.ts +6 -3
  597. package/dist/opc/properties/index.d.ts.map +1 -1
  598. package/dist/opc/properties/patch.d.ts +38 -0
  599. package/dist/opc/properties/patch.d.ts.map +1 -0
  600. package/dist/opc/properties/title-groups.d.ts +30 -0
  601. package/dist/opc/properties/title-groups.d.ts.map +1 -0
  602. package/dist/opc/properties/types.d.ts +15 -0
  603. package/dist/opc/properties/types.d.ts.map +1 -1
  604. package/dist/pptx/automation/index.cjs +9049 -7167
  605. package/dist/pptx/automation/index.d.ts +4 -4
  606. package/dist/pptx/automation/index.mjs +6 -6
  607. package/dist/pptx/chunks/{index-BYkdcS8J.d.ts → index-EZJZ7USt.d.ts} +907 -962
  608. package/dist/pptx/chunks/index-EZJZ7USt.d.ts.map +1 -0
  609. package/dist/pptx/chunks/{index-BHqL5KXH.d.ts → index-JNv7AJx5.d.ts} +163 -210
  610. package/dist/pptx/chunks/index-JNv7AJx5.d.ts.map +1 -0
  611. package/dist/pptx/chunks/{smart-art-CO2jmJFf.d.ts → smart-art-Q2kZQtHh.d.ts} +436 -374
  612. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +1 -0
  613. package/dist/pptx/chunks/{text-operations-DEJ7alZR.d.ts → text-operations-DtCxXrMh.d.ts} +55 -4
  614. package/dist/pptx/chunks/text-operations-DtCxXrMh.d.ts.map +1 -0
  615. package/dist/pptx/cli/index.cjs +8728 -6846
  616. package/dist/pptx/cli/index.d.ts +1 -1
  617. package/dist/pptx/cli/index.mjs +5 -5
  618. package/dist/pptx/converter/index.cjs +7124 -7136
  619. package/dist/pptx/converter/index.d.ts +1 -1
  620. package/dist/pptx/converter/index.mjs +3 -3
  621. package/dist/pptx/editor/render/table-cell-edit.cjs +7 -3
  622. package/dist/pptx/editor/render/table-cell-edit.d.ts +16 -1
  623. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  624. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  625. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  626. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  627. package/dist/pptx/editor/render/table-data-grid-ops.cjs +7 -7
  628. package/dist/pptx/editor/render/table-data-grid-ops.mjs +2 -2
  629. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  630. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  631. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  632. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  633. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  634. package/dist/pptx/index.cjs +9300 -7249
  635. package/dist/pptx/index.d.ts +5 -5
  636. package/dist/pptx/index.mjs +6 -6
  637. package/dist/pptx/smartart-layouts/index.cjs +135 -106
  638. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  639. package/dist/pptx/smartart-layouts/index.mjs +1 -1
  640. package/dist/teams/content.d.ts.map +1 -1
  641. package/dist/teams/index.cjs +3931 -2077
  642. package/dist/teams/index.d.ts +1 -0
  643. package/dist/teams/index.d.ts.map +1 -1
  644. package/dist/teams/index.mjs +3930 -2077
  645. package/dist/teams/server-file-storage.d.ts +11 -0
  646. package/dist/teams/server-file-storage.d.ts.map +1 -0
  647. package/dist/teams/store.d.ts +2 -0
  648. package/dist/teams/store.d.ts.map +1 -1
  649. package/dist/teams/stored-file.d.ts.map +1 -1
  650. package/dist/{xlsx/layout/font-family.d.ts → text/css-font-family.d.ts} +1 -1
  651. package/dist/text/css-font-family.d.ts.map +1 -0
  652. package/dist/text/font-metrics/font-advance-widths-aptos-display.generated.d.ts +10 -0
  653. package/dist/text/font-metrics/font-advance-widths-aptos-display.generated.d.ts.map +1 -0
  654. package/dist/text/font-metrics/font-advance-widths-aptos.generated.d.ts +10 -0
  655. package/dist/text/font-metrics/font-advance-widths-aptos.generated.d.ts.map +1 -0
  656. package/dist/text/font-metrics/font-advance-widths-arial.generated.d.ts +10 -0
  657. package/dist/text/font-metrics/font-advance-widths-arial.generated.d.ts.map +1 -0
  658. package/dist/text/font-metrics/font-advance-widths-calibri-light.generated.d.ts +10 -0
  659. package/dist/text/font-metrics/font-advance-widths-calibri-light.generated.d.ts.map +1 -0
  660. package/dist/text/font-metrics/font-advance-widths-calibri.generated.d.ts +10 -0
  661. package/dist/text/font-metrics/font-advance-widths-calibri.generated.d.ts.map +1 -0
  662. package/dist/text/font-metrics/font-advance-widths-segoe-ui.generated.d.ts +10 -0
  663. package/dist/text/font-metrics/font-advance-widths-segoe-ui.generated.d.ts.map +1 -0
  664. package/dist/text/font-metrics/font-advance-widths-times-new-roman.generated.d.ts +10 -0
  665. package/dist/text/font-metrics/font-advance-widths-times-new-roman.generated.d.ts.map +1 -0
  666. package/dist/text/font-metrics/font-advance-widths.generated.d.ts +48 -0
  667. package/dist/text/font-metrics/font-advance-widths.generated.d.ts.map +1 -0
  668. package/dist/text/font-metrics/font-kerning.d.ts +19 -0
  669. package/dist/text/font-metrics/font-kerning.d.ts.map +1 -0
  670. package/dist/visio/index.cjs +645 -119
  671. package/dist/visio/index.mjs +645 -119
  672. package/dist/visio/theme-color.d.ts +13 -3
  673. package/dist/visio/theme-color.d.ts.map +1 -1
  674. package/dist/visio/theme-resolve.d.ts +2 -1
  675. package/dist/visio/theme-resolve.d.ts.map +1 -1
  676. package/dist/visio/theme.d.ts +5 -2
  677. package/dist/visio/theme.d.ts.map +1 -1
  678. package/dist/xlsx/collab/adapter.d.ts +18 -0
  679. package/dist/xlsx/collab/adapter.d.ts.map +1 -0
  680. package/dist/xlsx/collab/apply.d.ts +8 -0
  681. package/dist/xlsx/collab/apply.d.ts.map +1 -0
  682. package/dist/xlsx/collab/bind.d.ts +34 -0
  683. package/dist/xlsx/collab/bind.d.ts.map +1 -0
  684. package/dist/xlsx/collab/codec.d.ts +35 -0
  685. package/dist/xlsx/collab/codec.d.ts.map +1 -0
  686. package/dist/xlsx/collab/dirty.d.ts +23 -0
  687. package/dist/xlsx/collab/dirty.d.ts.map +1 -0
  688. package/dist/xlsx/collab/index.cjs +1245 -0
  689. package/dist/xlsx/collab/index.d.ts +10 -0
  690. package/dist/xlsx/collab/index.d.ts.map +1 -0
  691. package/dist/xlsx/collab/index.mjs +1207 -0
  692. package/dist/xlsx/collab/lines.d.ts +22 -0
  693. package/dist/xlsx/collab/lines.d.ts.map +1 -0
  694. package/dist/xlsx/collab/names.d.ts +16 -0
  695. package/dist/xlsx/collab/names.d.ts.map +1 -0
  696. package/dist/xlsx/collab/presence.d.ts +31 -0
  697. package/dist/xlsx/collab/presence.d.ts.map +1 -0
  698. package/dist/xlsx/collab/schema.d.ts +30 -0
  699. package/dist/xlsx/collab/schema.d.ts.map +1 -0
  700. package/dist/xlsx/collab/sheets.d.ts +34 -0
  701. package/dist/xlsx/collab/sheets.d.ts.map +1 -0
  702. package/dist/xlsx/collab/styles.d.ts +26 -0
  703. package/dist/xlsx/collab/styles.d.ts.map +1 -0
  704. package/dist/xlsx/collab/write.d.ts +14 -0
  705. package/dist/xlsx/collab/write.d.ts.map +1 -0
  706. package/dist/xlsx/edit/chart-colors.d.ts +2 -2
  707. package/dist/xlsx/edit/chart-colors.d.ts.map +1 -1
  708. package/dist/xlsx/edit/chart-element-fill.d.ts +3 -3
  709. package/dist/xlsx/edit/chart-element-fill.d.ts.map +1 -1
  710. package/dist/xlsx/edit/chart-series-fill.d.ts +2 -2
  711. package/dist/xlsx/edit/chart-series-fill.d.ts.map +1 -1
  712. package/dist/xlsx/edit/chart-series-gradient.d.ts +3 -3
  713. package/dist/xlsx/edit/chart-series-gradient.d.ts.map +1 -1
  714. package/dist/xlsx/edit/chart-series-target.d.ts +15 -0
  715. package/dist/xlsx/edit/chart-series-target.d.ts.map +1 -0
  716. package/dist/xlsx/edit/chart-series-transparency.d.ts +2 -2
  717. package/dist/xlsx/edit/chart-series-transparency.d.ts.map +1 -1
  718. package/dist/xlsx/edit/context.d.ts +3 -1
  719. package/dist/xlsx/edit/context.d.ts.map +1 -1
  720. package/dist/xlsx/edit/external.d.ts +28 -0
  721. package/dist/xlsx/edit/external.d.ts.map +1 -0
  722. package/dist/xlsx/edit/history.d.ts +18 -0
  723. package/dist/xlsx/edit/history.d.ts.map +1 -1
  724. package/dist/xlsx/edit/index.d.ts +1 -0
  725. package/dist/xlsx/edit/index.d.ts.map +1 -1
  726. package/dist/xlsx/edit/session-calc.d.ts +32 -3
  727. package/dist/xlsx/edit/session-calc.d.ts.map +1 -1
  728. package/dist/xlsx/edit/session.d.ts.map +1 -1
  729. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  730. package/dist/xlsx/edit/types.d.ts +37 -4
  731. package/dist/xlsx/edit/types.d.ts.map +1 -1
  732. package/dist/xlsx/formula/engine-core.d.ts.map +1 -1
  733. package/dist/xlsx/formula/engine-host.d.ts +6 -2
  734. package/dist/xlsx/formula/engine-host.d.ts.map +1 -1
  735. package/dist/xlsx/formula/engine-prepare.d.ts +33 -0
  736. package/dist/xlsx/formula/engine-prepare.d.ts.map +1 -0
  737. package/dist/xlsx/formula/engine-structure.d.ts +40 -0
  738. package/dist/xlsx/formula/engine-structure.d.ts.map +1 -0
  739. package/dist/xlsx/formula/engine-types.d.ts +26 -0
  740. package/dist/xlsx/formula/engine-types.d.ts.map +1 -1
  741. package/dist/xlsx/formula/engine.d.ts.map +1 -1
  742. package/dist/xlsx/formula/formula-shape.d.ts +28 -0
  743. package/dist/xlsx/formula/formula-shape.d.ts.map +1 -0
  744. package/dist/xlsx/formula/graph-index.d.ts +3 -1
  745. package/dist/xlsx/formula/graph-index.d.ts.map +1 -1
  746. package/dist/xlsx/formula/graph.d.ts +5 -0
  747. package/dist/xlsx/formula/graph.d.ts.map +1 -1
  748. package/dist/xlsx/formula/lexemes.d.ts +6 -0
  749. package/dist/xlsx/formula/lexemes.d.ts.map +1 -1
  750. package/dist/xlsx/formula/parse-cache.d.ts +9 -0
  751. package/dist/xlsx/formula/parse-cache.d.ts.map +1 -0
  752. package/dist/xlsx/formula/parser.d.ts +3 -0
  753. package/dist/xlsx/formula/parser.d.ts.map +1 -1
  754. package/dist/xlsx/formula/ref-text.d.ts +14 -0
  755. package/dist/xlsx/formula/ref-text.d.ts.map +1 -0
  756. package/dist/xlsx/formula/references.d.ts.map +1 -1
  757. package/dist/xlsx/formula/shift-formula.d.ts +19 -0
  758. package/dist/xlsx/formula/shift-formula.d.ts.map +1 -0
  759. package/dist/xlsx/formula/shift-graph.d.ts +42 -0
  760. package/dist/xlsx/formula/shift-graph.d.ts.map +1 -0
  761. package/dist/xlsx/formula/tokenizer.d.ts.map +1 -1
  762. package/dist/xlsx/formula/transform.d.ts +2 -23
  763. package/dist/xlsx/formula/transform.d.ts.map +1 -1
  764. package/dist/xlsx/index.cjs +5620 -2680
  765. package/dist/xlsx/index.mjs +5609 -2681
  766. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  767. package/dist/xlsx/layout/chart-view.d.ts +3 -54
  768. package/dist/xlsx/layout/chart-view.d.ts.map +1 -1
  769. package/dist/xlsx/layout/colors.d.ts +1 -4
  770. package/dist/xlsx/layout/colors.d.ts.map +1 -1
  771. package/dist/xlsx/layout/index.d.ts +8 -5
  772. package/dist/xlsx/layout/index.d.ts.map +1 -1
  773. package/dist/xlsx/layout/remote-selections.d.ts +40 -0
  774. package/dist/xlsx/layout/remote-selections.d.ts.map +1 -0
  775. package/dist/xlsx/layout/sheet-queries.d.ts +7 -0
  776. package/dist/xlsx/layout/sheet-queries.d.ts.map +1 -1
  777. package/dist/xlsx/layout/sparkline-data.d.ts +19 -0
  778. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -0
  779. package/dist/xlsx/layout/sparkline-view.d.ts +52 -0
  780. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -0
  781. package/dist/xlsx/layout/tint.d.ts +3 -12
  782. package/dist/xlsx/layout/tint.d.ts.map +1 -1
  783. package/dist/xlsx/layout/types.d.ts +3 -0
  784. package/dist/xlsx/layout/types.d.ts.map +1 -1
  785. package/dist/xlsx/load/index.cjs +3124 -1312
  786. package/dist/xlsx/load/index.mjs +3124 -1312
  787. package/dist/xlsx/model-sparklines.d.ts +52 -0
  788. package/dist/xlsx/model-sparklines.d.ts.map +1 -0
  789. package/dist/xlsx/model.d.ts +10 -47
  790. package/dist/xlsx/model.d.ts.map +1 -1
  791. package/dist/xlsx/read/chart.d.ts +1 -4
  792. package/dist/xlsx/read/chart.d.ts.map +1 -1
  793. package/dist/xlsx/read/index.d.ts +1 -0
  794. package/dist/xlsx/read/index.d.ts.map +1 -1
  795. package/dist/xlsx/read/sheet-data-source.d.ts +10 -0
  796. package/dist/xlsx/read/sheet-data-source.d.ts.map +1 -0
  797. package/dist/xlsx/read/sparklines.d.ts +12 -0
  798. package/dist/xlsx/read/sparklines.d.ts.map +1 -0
  799. package/dist/xlsx/read/worksheet.d.ts.map +1 -1
  800. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  801. package/dist/xlsx/ui/context.d.ts +15 -1
  802. package/dist/xlsx/ui/context.d.ts.map +1 -1
  803. package/dist/xlsx/ui/grid/cell-items.d.ts.map +1 -1
  804. package/dist/xlsx/ui/grid/cell-paint.d.ts +1 -1
  805. package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
  806. package/dist/xlsx/ui/grid/view-cache.d.ts.map +1 -1
  807. package/dist/xlsx/ui/index.cjs +2165 -866
  808. package/dist/xlsx/ui/index.mjs +2165 -867
  809. package/dist/xlsx/ui/locales/de/collab.d.ts +2 -0
  810. package/dist/xlsx/ui/locales/de/collab.d.ts.map +1 -0
  811. package/dist/xlsx/ui/locales/de/index.d.ts.map +1 -1
  812. package/dist/xlsx/ui/locales/en/collab.d.ts +2 -0
  813. package/dist/xlsx/ui/locales/en/collab.d.ts.map +1 -0
  814. package/dist/xlsx/ui/locales/en/index.d.ts.map +1 -1
  815. package/dist/xlsx/ui/locales/es/collab.d.ts +2 -0
  816. package/dist/xlsx/ui/locales/es/collab.d.ts.map +1 -0
  817. package/dist/xlsx/ui/locales/es/index.d.ts.map +1 -1
  818. package/dist/xlsx/ui/locales/fr/collab.d.ts +2 -0
  819. package/dist/xlsx/ui/locales/fr/collab.d.ts.map +1 -0
  820. package/dist/xlsx/ui/locales/fr/index.d.ts.map +1 -1
  821. package/dist/xlsx/ui/locales/zh-CN/collab.d.ts +2 -0
  822. package/dist/xlsx/ui/locales/zh-CN/collab.d.ts.map +1 -0
  823. package/dist/xlsx/ui/locales/zh-CN/index.d.ts.map +1 -1
  824. package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -1
  825. package/dist/xlsx/write/chart-colors.d.ts +3 -0
  826. package/dist/xlsx/write/chart-colors.d.ts.map +1 -1
  827. package/dist/xlsx/write/chart-space.d.ts +5 -0
  828. package/dist/xlsx/write/chart-space.d.ts.map +1 -0
  829. package/dist/xlsx/write/chart-title.d.ts +4 -1
  830. package/dist/xlsx/write/chart-title.d.ts.map +1 -1
  831. package/dist/xlsx/write/chart.d.ts +4 -1
  832. package/dist/xlsx/write/chart.d.ts.map +1 -1
  833. package/dist/xml/index.cjs +162 -0
  834. package/dist/xml/index.d.ts +1 -0
  835. package/dist/xml/index.d.ts.map +1 -1
  836. package/dist/xml/index.mjs +161 -1
  837. package/dist/xml/lite.d.ts +30 -0
  838. package/dist/xml/lite.d.ts.map +1 -0
  839. package/package.json +6 -1
  840. package/dist/pptx/chunks/index-BHqL5KXH.d.ts.map +0 -1
  841. package/dist/pptx/chunks/index-BYkdcS8J.d.ts.map +0 -1
  842. package/dist/pptx/chunks/smart-art-CO2jmJFf.d.ts.map +0 -1
  843. package/dist/pptx/chunks/text-operations-DEJ7alZR.d.ts.map +0 -1
  844. package/dist/xlsx/layout/chart-appearance.d.ts.map +0 -1
  845. package/dist/xlsx/layout/chart-colors.d.ts +0 -9
  846. package/dist/xlsx/layout/chart-colors.d.ts.map +0 -1
  847. package/dist/xlsx/layout/chart-scale.d.ts.map +0 -1
  848. package/dist/xlsx/layout/chart-spacing.d.ts +0 -6
  849. package/dist/xlsx/layout/chart-spacing.d.ts.map +0 -1
  850. package/dist/xlsx/layout/chart-svg-appearance.d.ts.map +0 -1
  851. package/dist/xlsx/layout/chart-svg-bars.d.ts.map +0 -1
  852. package/dist/xlsx/layout/chart-svg-cartesian.d.ts.map +0 -1
  853. package/dist/xlsx/layout/chart-svg-legend.d.ts.map +0 -1
  854. package/dist/xlsx/layout/chart-svg-radial.d.ts.map +0 -1
  855. package/dist/xlsx/layout/chart-svg-text-metrics.d.ts.map +0 -1
  856. package/dist/xlsx/layout/chart-svg-title-text.d.ts.map +0 -1
  857. package/dist/xlsx/layout/chart-svg-util.d.ts.map +0 -1
  858. package/dist/xlsx/layout/chart-svg.d.ts.map +0 -1
  859. package/dist/xlsx/layout/chart-title-text.d.ts +0 -14
  860. package/dist/xlsx/layout/chart-title-text.d.ts.map +0 -1
  861. package/dist/xlsx/layout/font-family.d.ts.map +0 -1
  862. /package/dist/{xlsx/layout → chart/render}/chart-scale.d.ts +0 -0
  863. /package/dist/{xlsx/layout → chart/render}/chart-svg-bars.d.ts +0 -0
  864. /package/dist/{xlsx/layout → chart/render}/chart-svg-cartesian.d.ts +0 -0
  865. /package/dist/{xlsx/layout → chart/render}/chart-svg-legend.d.ts +0 -0
  866. /package/dist/{xlsx/layout → chart/render}/chart-svg-radial.d.ts +0 -0
  867. /package/dist/{xlsx/layout → chart/render}/chart-svg-text-metrics.d.ts +0 -0
  868. /package/dist/{xlsx/layout → chart/render}/chart-svg-title-text.d.ts +0 -0
  869. /package/dist/{xlsx/layout → chart/render}/chart-svg-util.d.ts +0 -0
  870. /package/dist/{xlsx/layout → chart/render}/chart-svg.d.ts +0 -0
@@ -1,9 +1,11 @@
1
- import { XMLSerializer, DOMParser } from '@xmldom/xmldom';
1
+ import { DOMParser, XMLSerializer } from '@xmldom/xmldom';
2
2
 
3
3
  // xml/namespaces.ts
4
4
  var NS = {
5
5
  /** WordprocessingML main. */
6
- w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"};
6
+ w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
7
+ /** DrawingML main. */
8
+ a: "http://schemas.openxmlformats.org/drawingml/2006/main"};
7
9
  function parseXml(xml, options = {}) {
8
10
  const label = options.label ?? "OOXML";
9
11
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
@@ -101,6 +103,10 @@ var eighthPoints = (value) => integer("eighthPoints", value);
101
103
  var roundSignedTwips = (value) => integer("twips", roundAway("twips", value));
102
104
  var twipsToPixels = (value) => value / 15;
103
105
 
106
+ // units/constants.ts
107
+ var EMU_PER_PIXEL = 9525;
108
+ var EMU_PER_POINT = 12700;
109
+
104
110
  // docx/simple-types.ts
105
111
  function parseOnOff(value) {
106
112
  switch (value) {
@@ -142,8 +148,8 @@ function universalMeasureToTwips(value) {
142
148
  }
143
149
  function parseSignedTwips(value) {
144
150
  if (value === null || value === void 0) return void 0;
145
- const text = value.trim();
146
- const parsed = SAFE_INTEGER.test(text) ? parseInteger(text) : universalMeasureToTwips(text);
151
+ const text2 = value.trim();
152
+ const parsed = SAFE_INTEGER.test(text2) ? parseInteger(text2) : universalMeasureToTwips(text2);
147
153
  return parsed === void 0 ? void 0 : signedTwips(parsed);
148
154
  }
149
155
  function parseTwips(value) {
@@ -152,26 +158,26 @@ function parseTwips(value) {
152
158
  }
153
159
  function parseHalfPoints(value) {
154
160
  if (value === null || value === void 0) return void 0;
155
- const text = value.trim();
156
- if (/^\d+$/.test(text)) {
157
- const parsed = parseInteger(text);
161
+ const text2 = value.trim();
162
+ if (/^\d+$/.test(text2)) {
163
+ const parsed = parseInteger(text2);
158
164
  return parsed === void 0 ? void 0 : halfPoints(parsed);
159
165
  }
160
- const asTwips = UNIVERSAL_MEASURE.test(text) ? universalMeasureToTwips(text) : void 0;
166
+ const asTwips = UNIVERSAL_MEASURE.test(text2) ? universalMeasureToTwips(text2) : void 0;
161
167
  return asTwips !== void 0 && asTwips >= 0 ? halfPoints(Math.round(asTwips / 10)) : void 0;
162
168
  }
163
169
  function parseSignedHalfPoints(value) {
164
170
  if (value === null || value === void 0) return void 0;
165
- const text = value.trim();
166
- const integer2 = parseInteger(text);
171
+ const text2 = value.trim();
172
+ const integer2 = parseInteger(text2);
167
173
  if (integer2 !== void 0) return halfPoints(integer2);
168
- const twips2 = universalMeasureToTwips(text);
174
+ const twips2 = universalMeasureToTwips(text2);
169
175
  return twips2 === void 0 ? void 0 : halfPoints(Math.sign(twips2) * Math.round(Math.abs(twips2) / 10));
170
176
  }
171
177
  function parseTextScale(value) {
172
- const text = value?.trim();
173
- if (text?.endsWith("%") && !/^\d+%$/.test(text)) return void 0;
174
- const parsed = parseUnsignedInteger(text?.endsWith("%") ? text.slice(0, -1) : text);
178
+ const text2 = value?.trim();
179
+ if (text2?.endsWith("%") && !/^\d+%$/.test(text2)) return void 0;
180
+ const parsed = parseUnsignedInteger(text2?.endsWith("%") ? text2.slice(0, -1) : text2);
175
181
  return parsed !== void 0 && parsed <= 600 ? parsed : void 0;
176
182
  }
177
183
  function parseEighthPoints(value) {
@@ -330,16 +336,16 @@ function parseRunProperties(props) {
330
336
  const color = first2(props, "color");
331
337
  const hex = parseRgbColor(getW(color, "val"));
332
338
  if (hex) result.color = hex;
333
- const themeColor = enumValue(isStThemeColor, getW(color, "themeColor"));
334
- if (themeColor) {
335
- result.colorTheme = { token: themeColor };
339
+ const themeColor2 = enumValue(isStThemeColor, getW(color, "themeColor"));
340
+ if (themeColor2) {
341
+ result.colorTheme = { token: themeColor2 };
336
342
  const tint = parseTintShade(getW(color, "themeTint"));
337
343
  const shade = parseTintShade(getW(color, "themeShade"));
338
344
  if (tint !== void 0) result.colorTheme.tint = tint;
339
345
  if (shade !== void 0) result.colorTheme.shade = shade;
340
346
  }
341
- const spacing = parseSignedTwips(getW(first2(props, "spacing"), "val"));
342
- if (spacing !== void 0) result.characterSpacingTwips = spacing;
347
+ const spacing2 = parseSignedTwips(getW(first2(props, "spacing"), "val"));
348
+ if (spacing2 !== void 0) result.characterSpacingTwips = spacing2;
343
349
  const scaleElement = first2(props, "w");
344
350
  const scale = scaleElement ? parseTextScale(getW(scaleElement, "val") ?? "100") : void 0;
345
351
  if (scale !== void 0) result.textScalePercent = scale;
@@ -367,13 +373,13 @@ function borderSide(element) {
367
373
  const style = enumValue(isStBorder, getW(element, "val"));
368
374
  const size = parseEighthPoints(getW(element, "sz"));
369
375
  const color = parseRgbColor(getW(element, "color"));
370
- const themeColor = enumValue(isStThemeColor, getW(element, "themeColor"));
371
- if (!style && size === void 0 && !color && !themeColor) return void 0;
376
+ const themeColor2 = enumValue(isStThemeColor, getW(element, "themeColor"));
377
+ if (!style && size === void 0 && !color && !themeColor2) return void 0;
372
378
  const side = {};
373
379
  if (style) side.style = style;
374
380
  if (size !== void 0) side.sizeEighthPoints = size;
375
381
  if (color) side.color = color;
376
- if (themeColor) side.themeColor = themeColor;
382
+ if (themeColor2) side.themeColor = themeColor2;
377
383
  return side;
378
384
  }
379
385
  function parseShadingFill(shd) {
@@ -691,9 +697,119 @@ function resolveRunFormatting(run, context = {}) {
691
697
  function clampUnitInterval(value) {
692
698
  return Math.min(1, Math.max(0, value));
693
699
  }
700
+ function hexToRgbChannels(color) {
701
+ const normalized = color.replace("#", "");
702
+ if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {
703
+ return null;
704
+ }
705
+ return {
706
+ r: Number.parseInt(normalized.slice(0, 2), 16),
707
+ g: Number.parseInt(normalized.slice(2, 4), 16),
708
+ b: Number.parseInt(normalized.slice(4, 6), 16)
709
+ };
710
+ }
711
+ function percentDivisorFor(text2) {
712
+ return text2.endsWith("%") ? 100 : 1e5;
713
+ }
714
+ function parseOoxmlPercent(value) {
715
+ const text2 = String(value ?? "").trim();
716
+ const divisor = percentDivisorFor(text2);
717
+ const magnitude = Number.parseFloat(divisor === 100 ? text2.slice(0, -1) : text2);
718
+ if (!Number.isFinite(magnitude)) {
719
+ return void 0;
720
+ }
721
+ return magnitude / divisor;
722
+ }
723
+ function parseDrawingPercent(value) {
724
+ const parsed = parseOoxmlPercent(value);
725
+ return parsed === void 0 ? void 0 : clampUnitInterval(parsed);
726
+ }
727
+ function scrgbLinearToSrgb8(linear) {
728
+ const l = Math.min(1, Math.max(0, linear));
729
+ const companded = l <= 31308e-7 ? 12.92 * l : 1.055 * l ** (1 / 2.4) - 0.055;
730
+ return Math.min(255, Math.max(0, Math.round(companded * 255)));
731
+ }
694
732
  function toHex(value) {
695
733
  return Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
696
734
  }
735
+ function rgbToHsl(r, g, b) {
736
+ const rN = r / 255;
737
+ const gN = g / 255;
738
+ const bN = b / 255;
739
+ const cMax = Math.max(rN, gN, bN);
740
+ const cMin = Math.min(rN, gN, bN);
741
+ const delta = cMax - cMin;
742
+ const l = (cMax + cMin) / 2;
743
+ let s = 0;
744
+ if (delta !== 0) {
745
+ s = delta / (1 - Math.abs(2 * l - 1));
746
+ }
747
+ let h = 0;
748
+ if (delta !== 0) {
749
+ if (cMax === rN) {
750
+ h = 60 * ((gN - bN) / delta % 6);
751
+ } else if (cMax === gN) {
752
+ h = 60 * ((bN - rN) / delta + 2);
753
+ } else {
754
+ h = 60 * ((rN - gN) / delta + 4);
755
+ }
756
+ }
757
+ if (h < 0) {
758
+ h += 360;
759
+ }
760
+ return { h, s: clampUnitInterval(s), l: clampUnitInterval(l) };
761
+ }
762
+ function hslToRgb(h, s, l, roundChannel = Math.round, options) {
763
+ const sC = options?.clampSaturation === false ? s : clampUnitInterval(s);
764
+ const lC = clampUnitInterval(l);
765
+ const hN = (h % 360 + 360) % 360;
766
+ const c = (1 - Math.abs(2 * lC - 1)) * sC;
767
+ const x = c * (1 - Math.abs(hN / 60 % 2 - 1));
768
+ const m = lC - c / 2;
769
+ let rP = 0;
770
+ let gP = 0;
771
+ let bP = 0;
772
+ if (hN < 60) {
773
+ rP = c;
774
+ gP = x;
775
+ bP = 0;
776
+ } else if (hN < 120) {
777
+ rP = x;
778
+ gP = c;
779
+ bP = 0;
780
+ } else if (hN < 180) {
781
+ rP = 0;
782
+ gP = c;
783
+ bP = x;
784
+ } else if (hN < 240) {
785
+ rP = 0;
786
+ gP = x;
787
+ bP = c;
788
+ } else if (hN < 300) {
789
+ rP = x;
790
+ gP = 0;
791
+ bP = c;
792
+ } else {
793
+ rP = c;
794
+ gP = 0;
795
+ bP = x;
796
+ }
797
+ return {
798
+ r: roundChannel((rP + m) * 255),
799
+ g: roundChannel((gP + m) * 255),
800
+ b: roundChannel((bP + m) * 255)
801
+ };
802
+ }
803
+ function parseDrawingFraction(value) {
804
+ return parseOoxmlPercent(value);
805
+ }
806
+ function parseDrawingHueDegrees(value) {
807
+ const parsed = Number.parseFloat(String(value ?? "").trim());
808
+ if (!Number.isFinite(parsed)) {
809
+ return void 0;
810
+ }
811
+ return parsed / 6e4;
812
+ }
697
813
 
698
814
  // color/color-linear.ts
699
815
  function srgb255ToLinear(channel) {
@@ -705,6 +821,508 @@ function linearToSrgb255(linear) {
705
821
  return 255 * (c <= 31308e-7 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055);
706
822
  }
707
823
 
824
+ // color/native-gradient-curve.ts
825
+ var OFFICE_SIGMA_FACTORS = [
826
+ 0,
827
+ 59,
828
+ 120,
829
+ 182,
830
+ 247,
831
+ 314,
832
+ 383,
833
+ 454,
834
+ 527,
835
+ 602,
836
+ 680,
837
+ 759,
838
+ 841,
839
+ 926,
840
+ 1013,
841
+ 1102,
842
+ 1194,
843
+ 1288,
844
+ 1385,
845
+ 1485,
846
+ 1587,
847
+ 1692,
848
+ 1800,
849
+ 1911,
850
+ 2024,
851
+ 2141,
852
+ 2260,
853
+ 2383,
854
+ 2508,
855
+ 2637,
856
+ 2769,
857
+ 2904,
858
+ 3042,
859
+ 3183,
860
+ 3328,
861
+ 3477,
862
+ 3628,
863
+ 3783,
864
+ 3942,
865
+ 4104,
866
+ 4270,
867
+ 4439,
868
+ 4612,
869
+ 4789,
870
+ 4969,
871
+ 5153,
872
+ 5341,
873
+ 5533,
874
+ 5728,
875
+ 5928,
876
+ 6131,
877
+ 6338,
878
+ 6549,
879
+ 6764,
880
+ 6983,
881
+ 7206,
882
+ 7434,
883
+ 7665,
884
+ 7900,
885
+ 8139,
886
+ 8382,
887
+ 8630,
888
+ 8881,
889
+ 9136,
890
+ 9396,
891
+ 9660,
892
+ 9927,
893
+ 10199,
894
+ 10475,
895
+ 10755,
896
+ 11039,
897
+ 11327,
898
+ 11619,
899
+ 11916,
900
+ 12216,
901
+ 12520,
902
+ 12828,
903
+ 13140,
904
+ 13456,
905
+ 13776,
906
+ 14099,
907
+ 14427,
908
+ 14758,
909
+ 15093,
910
+ 15431,
911
+ 15774,
912
+ 16119,
913
+ 16469,
914
+ 16822,
915
+ 17178,
916
+ 17538,
917
+ 17901,
918
+ 18267,
919
+ 18637,
920
+ 19009,
921
+ 19385,
922
+ 19764,
923
+ 20146,
924
+ 20530,
925
+ 20918,
926
+ 21308,
927
+ 21701,
928
+ 22096,
929
+ 22494,
930
+ 22894,
931
+ 23297,
932
+ 23702,
933
+ 24109,
934
+ 24518,
935
+ 24929,
936
+ 25342,
937
+ 25756,
938
+ 26173,
939
+ 26591,
940
+ 27010,
941
+ 27431,
942
+ 27853,
943
+ 28276,
944
+ 28701,
945
+ 29126,
946
+ 29552,
947
+ 29979,
948
+ 30407,
949
+ 30836,
950
+ 31264,
951
+ 31694,
952
+ 32123,
953
+ 32553,
954
+ 32983,
955
+ 33413,
956
+ 33842,
957
+ 34272,
958
+ 34700,
959
+ 35129,
960
+ 35557,
961
+ 35984,
962
+ 36410,
963
+ 36835,
964
+ 37260,
965
+ 37683,
966
+ 38105,
967
+ 38526,
968
+ 38945,
969
+ 39363,
970
+ 39780,
971
+ 40194,
972
+ 40607,
973
+ 41018,
974
+ 41427,
975
+ 41834,
976
+ 42239,
977
+ 42642,
978
+ 43042,
979
+ 43440,
980
+ 43835,
981
+ 44228,
982
+ 44618,
983
+ 45006,
984
+ 45390,
985
+ 45772,
986
+ 46151,
987
+ 46527,
988
+ 46899,
989
+ 47269,
990
+ 47635,
991
+ 47998,
992
+ 48358,
993
+ 48714,
994
+ 49067,
995
+ 49417,
996
+ 49762,
997
+ 50105,
998
+ 50443,
999
+ 50778,
1000
+ 51109,
1001
+ 51437,
1002
+ 51760,
1003
+ 52080,
1004
+ 52396,
1005
+ 52708,
1006
+ 53016,
1007
+ 53320,
1008
+ 53620,
1009
+ 53917,
1010
+ 54209,
1011
+ 54497,
1012
+ 54781,
1013
+ 55061,
1014
+ 55337,
1015
+ 55609,
1016
+ 55876,
1017
+ 56140,
1018
+ 56400,
1019
+ 56655,
1020
+ 56906,
1021
+ 57154,
1022
+ 57397,
1023
+ 57636,
1024
+ 57871,
1025
+ 58102,
1026
+ 58330,
1027
+ 58553,
1028
+ 58772,
1029
+ 58987,
1030
+ 59198,
1031
+ 59405,
1032
+ 59608,
1033
+ 59808,
1034
+ 60003,
1035
+ 60195,
1036
+ 60383,
1037
+ 60567,
1038
+ 60747,
1039
+ 60924,
1040
+ 61097,
1041
+ 61266,
1042
+ 61432,
1043
+ 61594,
1044
+ 61753,
1045
+ 61908,
1046
+ 62059,
1047
+ 62208,
1048
+ 62353,
1049
+ 62494,
1050
+ 62632,
1051
+ 62767,
1052
+ 62899,
1053
+ 63028,
1054
+ 63153,
1055
+ 63276,
1056
+ 63395,
1057
+ 63512,
1058
+ 63625,
1059
+ 63736,
1060
+ 63844,
1061
+ 63949,
1062
+ 64051,
1063
+ 64151,
1064
+ 64248,
1065
+ 64342,
1066
+ 64434,
1067
+ 64523,
1068
+ 64610,
1069
+ 64695,
1070
+ 64777,
1071
+ 64856,
1072
+ 64934,
1073
+ 65009,
1074
+ 65082,
1075
+ 65153,
1076
+ 65222,
1077
+ 65289,
1078
+ 65354,
1079
+ 65416,
1080
+ 65477,
1081
+ 65536
1082
+ ];
1083
+
1084
+ // color/sigma-gradient-stops.ts
1085
+ function sigmaGradientStops(stops) {
1086
+ if (stops.length !== 2 || stops[0]?.offset !== 0 || stops[1]?.offset !== 1) return void 0;
1087
+ if (stops.some((stop) => (stop.opacity ?? 1) !== 1)) return void 0;
1088
+ const front = hexToRgbChannels(stops[0].color);
1089
+ const back = hexToRgbChannels(stops[1].color);
1090
+ if (!front || !back) return void 0;
1091
+ return OFFICE_SIGMA_FACTORS.map((value, index) => {
1092
+ const factor = value / 65536;
1093
+ const mix = (a, b) => toHex(255 * ((a / 255) ** 2.2 * (1 - factor) + (b / 255) ** 2.2 * factor) ** (1 / 2.2));
1094
+ return {
1095
+ offset: Math.fround(index / 255),
1096
+ color: `#${mix(front.r, back.r)}${mix(front.g, back.g)}${mix(front.b, back.b)}`,
1097
+ opacity: 1
1098
+ };
1099
+ });
1100
+ }
1101
+
1102
+ // color/hex-rgb.ts
1103
+ function parseArgbHex(hex) {
1104
+ const clean2 = hex.replace(/^#/, "");
1105
+ const rgb = clean2.length === 8 ? clean2.slice(2) : clean2;
1106
+ if (!/^[0-9a-fA-F]{6}$/.test(rgb)) return void 0;
1107
+ return [0, 2, 4].map((i) => parseInt(rgb.slice(i, i + 2), 16));
1108
+ }
1109
+
1110
+ // drawingml/ordered-color-transforms.ts
1111
+ function orderedColorTransforms(channels, transforms) {
1112
+ let { r, g, b } = channels;
1113
+ let alpha = 1;
1114
+ const wrap = (value) => (value % 360 + 360) % 360;
1115
+ for (const transform of transforms) {
1116
+ const { name, value } = transform;
1117
+ const fraction = parseDrawingFraction(value);
1118
+ if (name === "alpha" && fraction !== void 0) alpha = clampUnitInterval(fraction);
1119
+ else if (name === "alphaMod" && fraction !== void 0)
1120
+ alpha = clampUnitInterval(alpha * fraction);
1121
+ else if (name === "alphaOff" && fraction !== void 0)
1122
+ alpha = clampUnitInterval(alpha + fraction);
1123
+ else if (name === "inv") [r, g, b] = [255 - r, 255 - g, 255 - b];
1124
+ else if (name === "gray") r = g = b = 0.299 * r + 0.587 * g + 0.114 * b;
1125
+ else if ((name === "shade" || name === "tint") && fraction !== void 0) {
1126
+ const mix = (channel) => linearToSrgb255(
1127
+ name === "shade" ? srgb255ToLinear(channel) * fraction : 1 - (1 - srgb255ToLinear(channel)) * fraction
1128
+ );
1129
+ [r, g, b] = [mix(r), mix(g), mix(b)];
1130
+ } else {
1131
+ const hsl = rgbToHsl(r, g, b);
1132
+ if (name === "comp") hsl.h = wrap(hsl.h + 180);
1133
+ else if (name === "hue") {
1134
+ const hue = parseDrawingHueDegrees(value);
1135
+ if (hue !== void 0) hsl.h = wrap(hue);
1136
+ } else if (name === "hueOff") {
1137
+ const hue = parseDrawingHueDegrees(value);
1138
+ if (hue !== void 0) hsl.h = wrap(hsl.h + hue);
1139
+ } else if (name === "hueMod" && fraction !== void 0) hsl.h = wrap(hsl.h * fraction);
1140
+ else if (name === "sat" && fraction !== void 0) hsl.s = clampUnitInterval(fraction);
1141
+ else if (name === "satMod" && fraction !== void 0) hsl.s *= fraction;
1142
+ else if (name === "satOff" && fraction !== void 0)
1143
+ hsl.s = clampUnitInterval(hsl.s + fraction);
1144
+ else if (name === "lum" && fraction !== void 0) hsl.l = clampUnitInterval(fraction);
1145
+ else if (name === "lumMod" && fraction !== void 0)
1146
+ hsl.l = clampUnitInterval(hsl.l * fraction);
1147
+ else if (name === "lumOff" && fraction !== void 0)
1148
+ hsl.l = clampUnitInterval(hsl.l + fraction);
1149
+ else continue;
1150
+ ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, (channel) => channel, {
1151
+ clampSaturation: false
1152
+ }));
1153
+ }
1154
+ }
1155
+ return { r, g, b, alpha };
1156
+ }
1157
+
1158
+ // drawingml/drawing-color.ts
1159
+ var COLOR_ELEMENTS = {
1160
+ srgbClr: "srgb",
1161
+ schemeClr: "scheme",
1162
+ sysClr: "system",
1163
+ prstClr: "preset",
1164
+ scrgbClr: "scrgb",
1165
+ hslClr: "hsl"
1166
+ };
1167
+ function colorValue(kind, element) {
1168
+ const attribute = (name) => element.getAttribute(name) ?? "";
1169
+ if (kind === "scrgb") return `${attribute("r")},${attribute("g")},${attribute("b")}`;
1170
+ if (kind === "hsl") return `${attribute("hue")},${attribute("sat")},${attribute("lum")}`;
1171
+ return attribute("val");
1172
+ }
1173
+ function parseDrawingColorIn(container) {
1174
+ if (!container) return void 0;
1175
+ for (const element of elements(container)) {
1176
+ const kind = COLOR_ELEMENTS[element.localName];
1177
+ if (!kind || element.namespaceURI && element.namespaceURI !== NS.a) continue;
1178
+ return parseDrawingColor(element);
1179
+ }
1180
+ return void 0;
1181
+ }
1182
+ function parseDrawingColor(element) {
1183
+ const kind = COLOR_ELEMENTS[element.localName];
1184
+ if (!kind) return void 0;
1185
+ const color = {
1186
+ kind,
1187
+ value: colorValue(kind, element),
1188
+ transforms: elements(element).map((child) => ({
1189
+ name: child.localName,
1190
+ value: child.getAttribute("val") ?? ""
1191
+ }))
1192
+ };
1193
+ const fallback = kind === "system" ? element.getAttribute("lastClr") : null;
1194
+ if (fallback) color.fallback = fallback;
1195
+ return color;
1196
+ }
1197
+ var PRESET_COLORS = {
1198
+ black: "#000000",
1199
+ white: "#FFFFFF",
1200
+ red: "#FF0000",
1201
+ green: "#008000",
1202
+ blue: "#0000FF",
1203
+ yellow: "#FFFF00",
1204
+ gray: "#808080",
1205
+ grey: "#808080"
1206
+ };
1207
+ function baseHex(color, theme) {
1208
+ switch (color.kind) {
1209
+ case "srgb":
1210
+ return /^[0-9a-f]{6}$/i.test(color.value) ? `#${color.value.toUpperCase()}` : void 0;
1211
+ case "scheme":
1212
+ return theme?.scheme(color.value);
1213
+ case "system":
1214
+ return color.fallback && /^[0-9a-f]{6}$/i.test(color.fallback) ? `#${color.fallback.toUpperCase()}` : void 0;
1215
+ case "preset":
1216
+ return PRESET_COLORS[color.value];
1217
+ case "scrgb": {
1218
+ const [r, g, b] = color.value.split(",").map((part) => parseDrawingFraction(part));
1219
+ if (r === void 0 || g === void 0 || b === void 0) return void 0;
1220
+ return `#${toHex(scrgbLinearToSrgb8(r))}${toHex(scrgbLinearToSrgb8(g))}${toHex(scrgbLinearToSrgb8(b))}`;
1221
+ }
1222
+ case "hsl": {
1223
+ const [h, s, l] = color.value.split(",");
1224
+ const hue = parseDrawingHueDegrees(h);
1225
+ const sat = parseDrawingFraction(s);
1226
+ const lum = parseDrawingFraction(l);
1227
+ if (hue === void 0 || sat === void 0 || lum === void 0) return void 0;
1228
+ const { r, g, b } = hslToRgb(hue, sat, lum);
1229
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1230
+ }
1231
+ }
1232
+ }
1233
+ var APPLIED = /* @__PURE__ */ new Set([
1234
+ "alpha",
1235
+ "alphaMod",
1236
+ "alphaOff",
1237
+ "comp",
1238
+ "inv",
1239
+ "gray",
1240
+ "shade",
1241
+ "tint",
1242
+ "hue",
1243
+ "hueMod",
1244
+ "hueOff",
1245
+ "sat",
1246
+ "satMod",
1247
+ "satOff",
1248
+ "lum",
1249
+ "lumMod",
1250
+ "lumOff"
1251
+ ]);
1252
+ function resolveDrawingColor(color, theme, options) {
1253
+ const base = baseHex(color, theme);
1254
+ const rgb = base ? hexToRgbChannels(base) : null;
1255
+ if (!rgb) return void 0;
1256
+ if (options?.transformOrder === "document") {
1257
+ const value = orderedColorTransforms(rgb, color.transforms);
1258
+ const round = options.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
1259
+ return {
1260
+ hex: `#${toHex(round(value.r))}${toHex(round(value.g))}${toHex(round(value.b))}`,
1261
+ alpha: value.alpha,
1262
+ unapplied: [...new Set(color.transforms.map((transform) => transform.name))].filter(
1263
+ (name) => !APPLIED.has(name)
1264
+ )
1265
+ };
1266
+ }
1267
+ let { r, g, b } = rgb;
1268
+ const find = (name) => color.transforms.find((entry) => entry.name === name)?.value;
1269
+ const has = (name) => color.transforms.some((entry) => entry.name === name);
1270
+ if (has("comp")) {
1271
+ const hsl = rgbToHsl(r, g, b);
1272
+ ({ r, g, b } = hslToRgb((hsl.h + 180) % 360, hsl.s, hsl.l));
1273
+ }
1274
+ if (has("inv")) [r, g, b] = [255 - r, 255 - g, 255 - b];
1275
+ if (has("gray")) r = g = b = Math.round(0.299 * r + 0.587 * g + 0.114 * b);
1276
+ const shade = parseDrawingPercent(find("shade"));
1277
+ if (shade !== void 0) {
1278
+ r = linearToSrgb255(srgb255ToLinear(r) * shade);
1279
+ g = linearToSrgb255(srgb255ToLinear(g) * shade);
1280
+ b = linearToSrgb255(srgb255ToLinear(b) * shade);
1281
+ }
1282
+ const tint = parseDrawingPercent(find("tint"));
1283
+ if (tint !== void 0) {
1284
+ r = linearToSrgb255(1 - (1 - srgb255ToLinear(r)) * tint);
1285
+ g = linearToSrgb255(1 - (1 - srgb255ToLinear(g)) * tint);
1286
+ b = linearToSrgb255(1 - (1 - srgb255ToLinear(b)) * tint);
1287
+ }
1288
+ if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(has)) {
1289
+ const hsl = rgbToHsl(r, g, b);
1290
+ const wrap = (degrees) => (degrees % 360 + 360) % 360;
1291
+ const hueAbs = parseDrawingHueDegrees(find("hue"));
1292
+ if (hueAbs !== void 0) hsl.h = wrap(hueAbs);
1293
+ const hueMod = parseDrawingFraction(find("hueMod"));
1294
+ if (hueMod !== void 0) hsl.h = wrap(hsl.h * hueMod);
1295
+ const hueOff = parseDrawingHueDegrees(find("hueOff"));
1296
+ if (hueOff !== void 0) hsl.h = wrap(hsl.h + hueOff);
1297
+ const satAbs = parseDrawingFraction(find("sat"));
1298
+ if (satAbs !== void 0) hsl.s = clampUnitInterval(satAbs);
1299
+ const satMod = parseDrawingFraction(find("satMod"));
1300
+ if (satMod !== void 0) hsl.s = clampUnitInterval(hsl.s * satMod);
1301
+ const satOff = parseDrawingFraction(find("satOff"));
1302
+ if (satOff !== void 0) hsl.s = clampUnitInterval(hsl.s + satOff);
1303
+ const lumAbs = parseDrawingFraction(find("lum"));
1304
+ if (lumAbs !== void 0) hsl.l = clampUnitInterval(lumAbs);
1305
+ const lumMod = parseDrawingFraction(find("lumMod"));
1306
+ if (lumMod !== void 0) hsl.l = clampUnitInterval(hsl.l * lumMod);
1307
+ const lumOff = parseDrawingFraction(find("lumOff"));
1308
+ if (lumOff !== void 0) hsl.l = clampUnitInterval(hsl.l + lumOff);
1309
+ const round = options?.hslRounding === "halfDown" ? (value) => Math.ceil(value - 0.5) : Math.round;
1310
+ ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, round));
1311
+ }
1312
+ let alpha = parseDrawingPercent(find("alpha")) ?? 1;
1313
+ const alphaMod = parseDrawingFraction(find("alphaMod"));
1314
+ if (alphaMod !== void 0) alpha = clampUnitInterval(alpha * alphaMod);
1315
+ const alphaOff = parseDrawingFraction(find("alphaOff"));
1316
+ if (alphaOff !== void 0) alpha = clampUnitInterval(alpha + alphaOff);
1317
+ return {
1318
+ hex: `#${toHex(r)}${toHex(g)}${toHex(b)}`,
1319
+ alpha,
1320
+ unapplied: [...new Set(color.transforms.map((entry) => entry.name))].filter(
1321
+ (name) => !APPLIED.has(name)
1322
+ )
1323
+ };
1324
+ }
1325
+
708
1326
  // drawingml/theme-model.ts
709
1327
  var DEFAULT_THEME_COLOR_MAP = {
710
1328
  bg1: "lt1",
@@ -713,6 +1331,13 @@ var DEFAULT_THEME_COLOR_MAP = {
713
1331
  tx2: "dk2"
714
1332
  };
715
1333
 
1334
+ // drawingml/theme-color.ts
1335
+ function themeSlotHex(color) {
1336
+ if (!color) return void 0;
1337
+ const value = color.kind === "srgb" ? color.value : color.kind === "system" ? color.fallback : void 0;
1338
+ return value ? value.toUpperCase() : void 0;
1339
+ }
1340
+
716
1341
  // docx/theme-color.ts
717
1342
  function isThemeColorToken(value) {
718
1343
  return isStThemeColor(value);
@@ -776,6 +1401,11 @@ function resolveThemeColorReference(ref, theme) {
776
1401
  return hex;
777
1402
  }
778
1403
 
1404
+ // opc/signature/xml-utils.ts
1405
+ function escapeXmlAttr(value) {
1406
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
1407
+ }
1408
+
779
1409
  // docx/expect-defined.ts
780
1410
  function expectDefined(value, context) {
781
1411
  if (value === void 0 || value === null) {
@@ -933,10 +1563,10 @@ function hasUnexpectedAttributes(element, allowed, allowDateUtc = false) {
933
1563
  }
934
1564
  return false;
935
1565
  }
936
- function runPropertiesHaveUnknownContent(properties) {
937
- if (!properties) return false;
938
- if (hasUnexpectedAttributes(properties, [])) return true;
939
- for (const node of Array.from(properties.childNodes)) {
1566
+ function runPropertiesHaveUnknownContent(properties2) {
1567
+ if (!properties2) return false;
1568
+ if (hasUnexpectedAttributes(properties2, [])) return true;
1569
+ for (const node of Array.from(properties2.childNodes)) {
940
1570
  if (node.nodeType !== 1) {
941
1571
  if (node.nodeType === 3 && node.textContent?.trim()) return true;
942
1572
  continue;
@@ -1001,6 +1631,1930 @@ function definedProps(source) {
1001
1631
  return Object.fromEntries(Object.entries(source).filter(([, value]) => value !== void 0));
1002
1632
  }
1003
1633
 
1634
+ // drawingml/drawing-color-css.ts
1635
+ function drawingColorCss(value) {
1636
+ if (!value || value.alpha === 1) return value?.hex;
1637
+ const channels = [1, 3, 5].map(
1638
+ (offset) => Number.parseInt(value.hex.slice(offset, offset + 2), 16)
1639
+ );
1640
+ return `rgba(${channels.join(",")},${value.alpha})`;
1641
+ }
1642
+
1643
+ // drawingml/drawing-shadow.ts
1644
+ function resolveDrawingShadow(effects, theme) {
1645
+ const node = first(effects, "outerShdw", NS.a);
1646
+ if (!node) return void 0;
1647
+ const value = (key, fallback) => Number(node.getAttribute(key) ?? fallback);
1648
+ if (value("sx", 1e5) !== 1e5 || value("sy", 1e5) !== 1e5 || value("kx", 0) !== 0 || value("ky", 0) !== 0)
1649
+ return void 0;
1650
+ const color = parseDrawingColorIn(node);
1651
+ const resolved = color && resolveDrawingColor(color, theme, { transformOrder: "document" });
1652
+ const blur = value("blurRad", 0) / EMU_PER_PIXEL;
1653
+ const distance = value("dist", 0) / EMU_PER_PIXEL;
1654
+ const angle = value("dir", 0) / 6e4 * Math.PI / 180;
1655
+ if (!resolved || ![blur, distance, angle].every(Number.isFinite) || blur < 0 || distance < 0)
1656
+ return void 0;
1657
+ return {
1658
+ color: resolved.hex,
1659
+ opacity: resolved.alpha,
1660
+ blur,
1661
+ dx: Math.cos(angle) * distance,
1662
+ dy: Math.sin(angle) * distance
1663
+ };
1664
+ }
1665
+ function resolveDrawingShadowXml(xml, theme) {
1666
+ return xml ? resolveDrawingShadow(parseXml(xml).documentElement, theme) : void 0;
1667
+ }
1668
+ function svgDropShadowElement(s, format) {
1669
+ const num = format.number;
1670
+ return `<feDropShadow dx="${num(s.dx)}" dy="${num(s.dy)}" stdDeviation="${num(s.blur / 2)}" flood-color="${format.color(s.color, "#000000")}" flood-opacity="${num(s.opacity)}" result="shadow"/>`;
1671
+ }
1672
+ function hexToRgb2(color) {
1673
+ const parsed = hexToRgbChannels(color);
1674
+ if (parsed) return parsed;
1675
+ const hex = color.replace("#", "");
1676
+ return {
1677
+ r: Number.parseInt(hex.slice(0, 2), 16) || 0,
1678
+ g: Number.parseInt(hex.slice(2, 4), 16) || 0,
1679
+ b: Number.parseInt(hex.slice(4, 6), 16) || 0
1680
+ };
1681
+ }
1682
+ function toHexChannel(value) {
1683
+ return toHex(value).toLowerCase();
1684
+ }
1685
+ function lerpStops(a, b, t) {
1686
+ const ca = hexToRgb2(a.color);
1687
+ const cb = hexToRgb2(b.color);
1688
+ const oa = a.opacity ?? 1;
1689
+ const ob = b.opacity ?? 1;
1690
+ return {
1691
+ color: `#${toHexChannel(ca.r + (cb.r - ca.r) * t)}${toHexChannel(ca.g + (cb.g - ca.g) * t)}${toHexChannel(ca.b + (cb.b - ca.b) * t)}`,
1692
+ opacity: oa + (ob - oa) * t
1693
+ };
1694
+ }
1695
+ function colorAt(stops, position) {
1696
+ const first3 = stops[0];
1697
+ const last = stops[stops.length - 1];
1698
+ if (position <= first3.position) {
1699
+ return { color: first3.color, opacity: first3.opacity ?? 1 };
1700
+ }
1701
+ if (position >= last.position) {
1702
+ return { color: last.color, opacity: last.opacity ?? 1 };
1703
+ }
1704
+ for (let i = 0; i < stops.length - 1; i += 1) {
1705
+ const from = stops[i];
1706
+ const to = stops[i + 1];
1707
+ if (position >= from.position && position <= to.position) {
1708
+ const span = to.position - from.position;
1709
+ const t = span > 0 ? (position - from.position) / span : 0;
1710
+ return lerpStops(from, to, t);
1711
+ }
1712
+ }
1713
+ return { color: last.color, opacity: last.opacity ?? 1 };
1714
+ }
1715
+ function resolveInnerRect(fillToRect, focalPoint) {
1716
+ let centerX = 50;
1717
+ let centerY = 50;
1718
+ let width = 0;
1719
+ let height = 0;
1720
+ if (fillToRect) {
1721
+ const { l, t, r, b } = fillToRect;
1722
+ centerX = (l + (1 - r)) / 2 * 100;
1723
+ centerY = (t + (1 - b)) / 2 * 100;
1724
+ width = Math.max(0, Math.min(1, 1 - l - r)) * 100;
1725
+ height = Math.max(0, Math.min(1, 1 - t - b)) * 100;
1726
+ }
1727
+ return {
1728
+ left: centerX - width / 2,
1729
+ top: centerY - height / 2,
1730
+ right: centerX + width / 2,
1731
+ bottom: centerY + height / 2
1732
+ };
1733
+ }
1734
+ function lerpEdge(inner, outer, t) {
1735
+ return inner + (outer - inner) * t;
1736
+ }
1737
+ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
1738
+ if (stops.length === 0) {
1739
+ return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
1740
+ }
1741
+ const sorted = [...stops].sort((a, b) => a.position - b.position);
1742
+ const inner = resolveInnerRect(fillToRect);
1743
+ const rects = [];
1744
+ const alphaRects = [];
1745
+ const masked = sorted.some((stop) => (stop.opacity ?? 1) < 1);
1746
+ const bands = options?.bands;
1747
+ if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
1748
+ for (let i = bands; i >= 0; i -= 1) {
1749
+ const t = i / bands;
1750
+ const { color, opacity } = colorAt(sorted, t * 100);
1751
+ const left = lerpEdge(inner.left, 0, t);
1752
+ const top = lerpEdge(inner.top, 0, t);
1753
+ const right = lerpEdge(inner.right, 100, t);
1754
+ const bottom = lerpEdge(inner.bottom, 100, t);
1755
+ const opacityAttr = !masked && opacity < 1 ? ` fill-opacity="${Math.max(0, opacity).toFixed(3)}"` : "";
1756
+ rects.push(
1757
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="${color}"${opacityAttr}/>`
1758
+ );
1759
+ if (masked) {
1760
+ const channel = toHexChannel(opacity * 255);
1761
+ alphaRects.push(
1762
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="#${channel}${channel}${channel}"/>`
1763
+ );
1764
+ }
1765
+ }
1766
+ const paint = masked ? `<defs><mask id="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" mask-type="luminance" color-interpolation="sRGB">${alphaRects.join("")}</mask></defs><g mask="url(#alpha)">${rects.join("")}</g>` : rects.join("");
1767
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${paint}</svg>`;
1768
+ }
1769
+
1770
+ // chart/color-palettes.ts
1771
+ var COLORFUL_VARIATIONS = [
1772
+ {},
1773
+ { lumMod: 6e4 },
1774
+ { lumMod: 8e4, lumOff: 2e4 },
1775
+ { lumMod: 8e4 },
1776
+ { lumMod: 6e4, lumOff: 4e4 },
1777
+ { lumMod: 5e4 },
1778
+ { lumMod: 7e4, lumOff: 3e4 },
1779
+ { lumMod: 7e4 },
1780
+ { lumMod: 5e4, lumOff: 5e4 }
1781
+ ];
1782
+ var GRAY_VARIATIONS = [
1783
+ { tint: 88500 },
1784
+ { tint: 55e3 },
1785
+ { tint: 75e3 },
1786
+ { tint: 98500 },
1787
+ { tint: 3e4 },
1788
+ { tint: 6e4 },
1789
+ { tint: 8e4 }
1790
+ ];
1791
+ var ACCENTS = ["accent1", "accent2", "accent3", "accent4", "accent5", "accent6"];
1792
+ function colorful(id, index, base) {
1793
+ return { id, group: "colorful", index, meth: "cycle", base, variations: COLORFUL_VARIATIONS };
1794
+ }
1795
+ function mono(id, index, accent, meth) {
1796
+ return { id, group: "monochromatic", index, meth, base: [accent], variations: [] };
1797
+ }
1798
+ var CHART_COLOR_PALETTES = [
1799
+ colorful(10, 1, ACCENTS),
1800
+ colorful(11, 2, ["accent1", "accent3", "accent5"]),
1801
+ colorful(12, 3, ["accent2", "accent4", "accent6"]),
1802
+ colorful(13, 4, ["accent6", "accent5", "accent4"]),
1803
+ ...ACCENTS.map((accent, i) => mono(14 + i, 1 + i, accent, "withinLinear")),
1804
+ {
1805
+ id: 20,
1806
+ group: "monochromatic",
1807
+ index: 7,
1808
+ meth: "cycle",
1809
+ base: ["dk1"],
1810
+ variations: GRAY_VARIATIONS
1811
+ },
1812
+ ...ACCENTS.map((accent, i) => mono(21 + i, 8 + i, accent, "withinLinearReversed"))
1813
+ ];
1814
+ function findChartColorPalette(id) {
1815
+ return CHART_COLOR_PALETTES.find((palette) => palette.id === id);
1816
+ }
1817
+ function withinLinearTransform(i, n2) {
1818
+ if (n2 <= 1) {
1819
+ return {};
1820
+ }
1821
+ const step = 140 / (n2 + 1);
1822
+ const centre = (n2 - 1) / 2;
1823
+ const value = 100 - step * Math.abs(i - centre);
1824
+ if (i < centre) {
1825
+ return { shade: Math.floor(value + 1e-9) * 1e3 };
1826
+ }
1827
+ if (i > centre) {
1828
+ return { tint: Math.ceil(value - 1e-9) * 1e3 };
1829
+ }
1830
+ return {};
1831
+ }
1832
+ function chartPaletteSeriesColorChoice(palette, i, n2) {
1833
+ let base;
1834
+ let transform;
1835
+ if (palette.meth === "cycle") {
1836
+ base = palette.base[i % palette.base.length];
1837
+ const round = Math.floor(i / palette.base.length);
1838
+ transform = (palette.variations.length ? palette.variations[round % palette.variations.length] : {}) ?? {};
1839
+ } else {
1840
+ const index = palette.meth === "withinLinearReversed" ? n2 - 1 - i : i;
1841
+ base = palette.base[0];
1842
+ transform = withinLinearTransform(index, n2);
1843
+ }
1844
+ if (!base) throw new RangeError("A chart palette must have a base color");
1845
+ return {
1846
+ kind: "scheme",
1847
+ value: base,
1848
+ transforms: Object.entries(transform).map(([name, value]) => ({ name, value: String(value) }))
1849
+ };
1850
+ }
1851
+ function chartPaletteSeriesColor(palette, i, n2, scheme) {
1852
+ const choice = chartPaletteSeriesColorChoice(palette, i, n2);
1853
+ return (resolveDrawingColor(choice, { scheme: (name) => scheme[name] })?.hex ?? scheme[choice.value]).toUpperCase();
1854
+ }
1855
+
1856
+ // chart/style-definition.ts
1857
+ var CHART_STYLE_PARTS = [
1858
+ "title",
1859
+ "axisTitle",
1860
+ "categoryAxis",
1861
+ "valueAxis",
1862
+ "legend",
1863
+ "dataLabel",
1864
+ "dataPoint",
1865
+ "dataPointLine",
1866
+ "gridlineMajor",
1867
+ "gridlineMinor",
1868
+ "chartArea",
1869
+ "plotArea"
1870
+ ];
1871
+ function resolveChartStyleDefinition(style, resolve) {
1872
+ const out = {};
1873
+ const fillColor = (fill) => fill?.kind === "none" ? "none" : fill?.kind === "solid" ? resolve(fill.color) : void 0;
1874
+ for (const name of CHART_STYLE_PARTS) {
1875
+ const source = style.entries[name];
1876
+ if (!source) continue;
1877
+ const entry = {};
1878
+ for (const key of ["fontSize", "bold", "italic", "underline"]) {
1879
+ const value = source[key];
1880
+ if (value !== void 0) Object.assign(entry, { [key]: value });
1881
+ }
1882
+ const line2 = fillColor(source.line?.fill) ?? (source.lineRef?.color && resolve(source.lineRef.color));
1883
+ const fill = fillColor(source.fill) ?? (source.fillRef?.color && resolve(source.fillRef.color));
1884
+ const color = (source.textColor && resolve(source.textColor)) ?? (source.fontRef?.color && resolve(source.fontRef.color));
1885
+ if (color !== void 0) entry.color = color;
1886
+ if (line2 !== void 0) entry.lineColor = line2;
1887
+ if (fill !== void 0) entry.fillColor = fill;
1888
+ if (source.line?.widthEmu !== void 0 && source.line.widthEmu > 0)
1889
+ entry.lineWidth = source.line.widthEmu / 12700;
1890
+ if (Object.keys(entry).length) out[name] = entry;
1891
+ }
1892
+ return Object.keys(out).length ? out : void 0;
1893
+ }
1894
+ function effectiveBuiltInChartStyle(formatting) {
1895
+ return formatting?.builtInStyle ?? (formatting?.sourceXml ? void 0 : 102);
1896
+ }
1897
+ function builtInChartTextStyle(id) {
1898
+ if (id === void 0 || !Number.isInteger(id) || !(id >= 1 && id <= 48 || id >= 101 && id <= 148))
1899
+ return {};
1900
+ const legacy = id > 100 ? id - 100 : id;
1901
+ const common = {
1902
+ sourceXml: "",
1903
+ fontSize: 10,
1904
+ bold: false,
1905
+ italic: false,
1906
+ fontRef: {
1907
+ index: "minor",
1908
+ color: { kind: "scheme", value: legacy >= 41 ? "lt1" : "tx1", transforms: [] }
1909
+ }
1910
+ };
1911
+ return {
1912
+ title: { ...common, fontSize: id > 100 ? 18 : 10, bold: true },
1913
+ categoryAxis: { ...common },
1914
+ valueAxis: { ...common },
1915
+ legend: { ...common }
1916
+ };
1917
+ }
1918
+
1919
+ // chart/manual-layout.ts
1920
+ function hasManualLayoutFields(layout) {
1921
+ return layout != null && (layout.x !== void 0 || layout.y !== void 0 || layout.width !== void 0 || layout.height !== void 0);
1922
+ }
1923
+ function resolveManualLayoutRect(layout, frame, auto) {
1924
+ if (!hasManualLayoutFields(layout)) return void 0;
1925
+ const x = layout.x === void 0 ? auto.x : layout.xMode === "edge" ? layout.x * frame.width : auto.x + layout.x * frame.width;
1926
+ const y = layout.y === void 0 ? auto.y : layout.yMode === "edge" ? layout.y * frame.height : auto.y + layout.y * frame.height;
1927
+ const width = layout.width === void 0 ? auto.width : layout.widthMode === "edge" ? layout.width * frame.width - x : layout.width * frame.width;
1928
+ const height = layout.height === void 0 ? auto.height : layout.heightMode === "edge" ? layout.height * frame.height - y : layout.height * frame.height;
1929
+ return { x, y, width: Math.max(width, 1), height: Math.max(height, 1) };
1930
+ }
1931
+
1932
+ // chart/gradient-stop-edit.ts
1933
+ function sortGradientStops(stops) {
1934
+ return stops.slice().sort((a, b) => a.position - b.position);
1935
+ }
1936
+
1937
+ // chart/gradient-coincident-stops.ts
1938
+ var NATIVE_COINCIDENT_STOP_RAMP = 1 / 256;
1939
+ function spreadCoincidentStops(stops) {
1940
+ const out = [];
1941
+ for (const [index, stop] of stops.entries()) {
1942
+ const source = stops[index - 1];
1943
+ const previous = out.at(-1);
1944
+ const next = stops[index + 1];
1945
+ if (!source || !previous || stop.offset !== source.offset || stop.color === source.color && (stop.opacity ?? 1) === (source.opacity ?? 1)) {
1946
+ out.push(stop);
1947
+ continue;
1948
+ }
1949
+ const limit = Math.min(1, next ? next.offset : 1);
1950
+ out.push({
1951
+ ...stop,
1952
+ offset: Math.max(stop.offset, Math.min(previous.offset + NATIVE_COINCIDENT_STOP_RAMP, limit))
1953
+ });
1954
+ }
1955
+ return out;
1956
+ }
1957
+
1958
+ // chart/gradient-definition.ts
1959
+ function resolveChartGradient(fill, resolve) {
1960
+ const focus = fill.fillToRect;
1961
+ const stops = fill.stops.flatMap((stop) => {
1962
+ const color = resolve(stop.color);
1963
+ return color ? [{ position: stop.position, color: color.hex, opacity: color.alpha }] : [];
1964
+ });
1965
+ return {
1966
+ type: fill.path ? "radial" : "linear",
1967
+ stops,
1968
+ ...fill.angle === void 0 ? {} : { angle: fill.angle },
1969
+ ...fill.scaled === void 0 ? {} : { scaled: fill.scaled },
1970
+ ...fill.path === void 0 ? {} : { path: fill.path },
1971
+ ...focus === void 0 ? {} : { fillToRect: { ...focus } },
1972
+ // Native opaque endpoint-pair linear, rect, circle and rectangular-shape profiles.
1973
+ ...(!fill.path && fill.scaled === true || ["rect", "circle", "shape"].includes(fill.path ?? "")) && fill.stops.length === 2 && stops.length === 2 && stops.every((stop) => stop.opacity === 1) && stops.some((stop) => stop.position === 0) && stops.some((stop) => stop.position === 100) ? { interpolation: "sigma-gamma22" } : {},
1974
+ ...focus ? { focalPoint: { x: (1 + focus.l - focus.r) / 2, y: (1 + focus.t - focus.b) / 2 } } : {}
1975
+ };
1976
+ }
1977
+ function buildChartGradientDef(id, fill, bounds) {
1978
+ const sourceStops = sortGradientStops(fill.stops).map((stop) => ({
1979
+ offset: Math.min(Math.max(stop.position / 100, 0), 1),
1980
+ color: stop.color,
1981
+ ...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
1982
+ }));
1983
+ const stops = fill.interpolation === "sigma-gamma22" ? sigmaGradientStops(sourceStops) ?? sourceStops : sourceStops;
1984
+ if (fill.type === "radial" && (fill.path === "rect" || fill.path === "shape" && bounds?.shape === "rect")) {
1985
+ const markup = buildRectPathGradientSvg(
1986
+ stops.map((stop) => ({
1987
+ position: stop.offset * 100,
1988
+ color: stop.color,
1989
+ ...stop.opacity === void 0 ? {} : { opacity: stop.opacity }
1990
+ })),
1991
+ void 0,
1992
+ fill.fillToRect,
1993
+ { bands: 1024}
1994
+ );
1995
+ return {
1996
+ kind: "rectPath",
1997
+ id,
1998
+ href: `data:image/svg+xml,${encodeURIComponent(markup)}`,
1999
+ stops
2000
+ };
2001
+ }
2002
+ if (fill.type === "radial") {
2003
+ const cx = fill.focalPoint?.x ?? 0.5;
2004
+ const cy = fill.focalPoint?.y ?? 0.5;
2005
+ const aspect = fill.path === "circle" && bounds && Number.isFinite(bounds.width) && Number.isFinite(bounds.height) && bounds.width > 0 && bounds.height > 0 ? bounds.height / bounds.width : 1;
2006
+ return {
2007
+ kind: "radialGradient",
2008
+ id,
2009
+ cx,
2010
+ cy,
2011
+ r: Math.max(
2012
+ ...[0, 1].flatMap((x) => [0, 1].map((y) => Math.hypot(x - cx, (y - cy) * aspect)))
2013
+ ),
2014
+ ...aspect === 1 ? {} : { gradientTransform: `matrix(1 0 0 ${1 / aspect} 0 ${cy * (1 - 1 / aspect)})` },
2015
+ stops
2016
+ };
2017
+ }
2018
+ const rad = (fill.angle ?? 0) * Math.PI / 180;
2019
+ const span = fill.scaled ? Math.abs(Math.cos(rad)) + Math.abs(Math.sin(rad)) : 1;
2020
+ const dx = Math.cos(rad) * span / 2;
2021
+ const dy = Math.sin(rad) * span / 2;
2022
+ const round = (value) => Math.round(value * 1e4) / 1e4;
2023
+ return {
2024
+ kind: "linearGradient",
2025
+ id,
2026
+ x1: round(0.5 - dx),
2027
+ y1: round(0.5 - dy),
2028
+ x2: round(0.5 + dx),
2029
+ y2: round(0.5 + dy),
2030
+ stops: spreadCoincidentStops(stops)
2031
+ };
2032
+ }
2033
+
2034
+ // chart/gradient-markup.ts
2035
+ function chartGradientMarkup(def) {
2036
+ if (def.kind === "rectPath")
2037
+ return `<pattern id="${escapeXmlAttr(def.id)}" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox" width="1" height="1"><image href="${escapeXmlAttr(def.href)}" width="1" height="1" preserveAspectRatio="none"/></pattern>`;
2038
+ const geometry = def.kind === "linearGradient" ? `x1="${def.x1}" y1="${def.y1}" x2="${def.x2}" y2="${def.y2}"` : `cx="${def.cx}" cy="${def.cy}" r="${def.r}"`;
2039
+ const stops = def.stops.map(
2040
+ (stop) => `<stop offset="${stop.offset}" stop-color="${escapeXmlAttr(stop.color)}" stop-opacity="${stop.opacity ?? 1}"/>`
2041
+ ).join("");
2042
+ const transform = def.kind === "radialGradient" && def.gradientTransform ? ` gradientTransform="${escapeXmlAttr(def.gradientTransform)}"` : "";
2043
+ return `<${def.kind} id="${escapeXmlAttr(def.id)}" ${geometry}${transform}>${stops}</${def.kind}>`;
2044
+ }
2045
+
2046
+ // chart/bar-cluster-geometry.ts
2047
+ var DEFAULT_BAR_GAP_WIDTH = 150;
2048
+ function clusteredBarGeometry(barGroupWidth, seriesCount, chartData) {
2049
+ const overlap = chartData.barOverlap ?? 0;
2050
+ const overlapSpan = 1 + (seriesCount - 1) * (1 - overlap / 100);
2051
+ const gapWidth = chartData.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH;
2052
+ const singleBarWidth = barGroupWidth / (overlapSpan + Math.max(gapWidth, 0) / 100);
2053
+ const step = singleBarWidth * (1 - overlap / 100);
2054
+ return { singleBarWidth, step, clusterWidth: singleBarWidth + step * (seriesCount - 1) };
2055
+ }
2056
+
2057
+ // chart/data-cache.ts
2058
+ function chartCacheValues(cache) {
2059
+ if (!cache) return [];
2060
+ const numeric = cache.type === "number";
2061
+ const out = [];
2062
+ for (const point of cache.points) {
2063
+ const text2 = point.value;
2064
+ out[point.index ?? out.length] = numeric && text2.trim() !== "" && Number.isFinite(Number(text2)) ? Number(text2) : text2;
2065
+ }
2066
+ const size = Math.max(cache.pointCount ?? 0, out.length);
2067
+ for (let index = 0; index < size; index++) if (out[index] === void 0) out[index] = "";
2068
+ return out;
2069
+ }
2070
+ var chartSourceValues = (source) => chartCacheValues(source?.cache ?? source?.levels?.[0]);
2071
+
2072
+ // chart/render/summary-from-space.ts
2073
+ var solidColor = (fill) => fill?.kind === "solid" ? fill.color : void 0;
2074
+ var isSolidFill = (fill) => fill?.kind === "solid" || fill?.kind === "unsupported" && fill.element === "solidFill";
2075
+ var GROUP_TYPES = {
2076
+ bar: "bar",
2077
+ line: "line",
2078
+ area: "area",
2079
+ pie: "pie",
2080
+ ofPie: "pie",
2081
+ doughnut: "doughnut",
2082
+ scatter: "scatter",
2083
+ radar: "radar",
2084
+ bubble: "bubble",
2085
+ stock: "stock",
2086
+ surface: "surface"
2087
+ };
2088
+ var GROUPINGS = /* @__PURE__ */ new Set(["clustered", "stacked", "percentStacked", "standard"]);
2089
+ function chartSummarySeries(source, chartType) {
2090
+ const categories = source.categories ?? source.xValues;
2091
+ const values = source.values ?? source.yValues;
2092
+ const out = {
2093
+ categories: chartSourceValues(categories),
2094
+ values: chartSourceValues(values).map(
2095
+ (v) => typeof v === "number" ? v : v === "" ? null : Number.isFinite(Number(v)) ? Number(v) : null
2096
+ )
2097
+ };
2098
+ if (source.tx?.text !== void 0) out.name = source.tx.text;
2099
+ const nameRef = source.tx?.reference?.formula;
2100
+ if (nameRef) out.nameRef = nameRef;
2101
+ if (categories?.formula) out.categoriesRef = categories.formula;
2102
+ if (values?.formula) out.valuesRef = values.formula;
2103
+ if (source.spPr?.effectsXml) out.effectsXml = source.spPr.effectsXml;
2104
+ const primary = ["line", "scatter", "radar"].includes(chartType) ? source.spPr?.line?.fill : source.spPr?.fill;
2105
+ const fill = chartType === "scatter" && !isSolidFill(primary) ? source.marker?.spPr?.fill : primary;
2106
+ const drawingColor = solidColor(fill);
2107
+ if (drawingColor) out.drawingColor = drawingColor;
2108
+ if (fill && fill.kind !== "solid" && !(chartType === "scatter" && fill.kind === "none"))
2109
+ out.fill = fill;
2110
+ const points = {};
2111
+ const pointFills = {};
2112
+ for (const point of source.dataPoints) {
2113
+ const properties2 = point.spPr ?? point.marker?.spPr;
2114
+ if (point.index === void 0) continue;
2115
+ const pointColor = solidColor(properties2?.fill);
2116
+ if (pointColor) points[point.index] = pointColor;
2117
+ if (properties2?.fill && properties2.fill.kind !== "solid")
2118
+ pointFills[point.index] = properties2.fill;
2119
+ }
2120
+ if (Object.keys(points).length) out.pointColors = points;
2121
+ if (Object.keys(pointFills).length) out.pointFills = pointFills;
2122
+ return out;
2123
+ }
2124
+ function chartSummaryFromSpace(chartSpace, extras = {}) {
2125
+ const group = chartSpace.plotArea.groups[0];
2126
+ let chartType = group ? GROUP_TYPES[group.kind] : "column";
2127
+ if (chartType === "bar" && group?.barDirection !== "bar") chartType = "column";
2128
+ const series = (group?.series ?? []).map((source) => chartSummarySeries(source, chartType));
2129
+ const summary = {
2130
+ chartType,
2131
+ series,
2132
+ showLegend: chartSpace.legend !== void 0
2133
+ };
2134
+ const grouping = group?.grouping;
2135
+ if (grouping && GROUPINGS.has(grouping))
2136
+ summary.grouping = grouping;
2137
+ if (chartType === "bar" || chartType === "column") {
2138
+ for (const [value, field, fallback, min, max] of [
2139
+ [group?.gapWidth, "barGapWidth", 150, 0, 500],
2140
+ [group?.overlap, "barOverlap", 0, -100, 100]
2141
+ ]) {
2142
+ const resolved = value ?? fallback;
2143
+ if (Number.isInteger(resolved) && resolved >= min && resolved <= max)
2144
+ summary[field] = resolved;
2145
+ }
2146
+ }
2147
+ if (chartSpace.title && chartSpace.autoTitleDeleted !== true) {
2148
+ const title = chartSpace.title.text;
2149
+ if (title !== void 0) summary.title = title;
2150
+ else if (series.length === 1 && series[0]?.name) summary.title = series[0].name;
2151
+ }
2152
+ const legendPos = chartSpace.legend?.position;
2153
+ if (legendPos && ["r", "l", "t", "b", "tr"].includes(legendPos))
2154
+ summary.legendPosition = legendPos;
2155
+ if (extras.formatting) summary.formatting = extras.formatting;
2156
+ if (extras.colorPalette !== void 0) summary.colorPalette = extras.colorPalette;
2157
+ if (extras.styleDefinition) summary.styleDefinition = extras.styleDefinition;
2158
+ return summary;
2159
+ }
2160
+
2161
+ // chart/render/chart-scale.ts
2162
+ var clean = (n2) => Number(n2.toPrecision(12));
2163
+ function* units(raw) {
2164
+ let exp = Math.floor(Math.log10(raw)) - 1;
2165
+ for (; ; ) {
2166
+ const base = 10 ** exp;
2167
+ for (const m of [1, 2, 5]) yield clean(m * base);
2168
+ exp++;
2169
+ }
2170
+ }
2171
+ function niceScale(dataMin, dataMax, options = {}) {
2172
+ const maxIntervals = Math.max(1, options.maxIntervals ?? 10);
2173
+ let lo = Number.isFinite(dataMin) ? dataMin : 0;
2174
+ let hi = Number.isFinite(dataMax) ? dataMax : 0;
2175
+ if (lo > hi) [lo, hi] = [hi, lo];
2176
+ if (lo === hi) {
2177
+ if (lo === 0) hi = 1;
2178
+ else if (options.noZero) {
2179
+ const pad = Math.abs(lo) * 0.1 || 1;
2180
+ lo -= pad;
2181
+ hi += pad;
2182
+ } else if (lo > 0) lo = 0;
2183
+ else hi = 0;
2184
+ }
2185
+ let fixedLo = false;
2186
+ let fixedHi = false;
2187
+ if (!options.noZero) {
2188
+ if (lo >= 0 && hi - lo >= hi / 6) {
2189
+ lo = 0;
2190
+ fixedLo = true;
2191
+ } else if (hi <= 0 && hi - lo >= -lo / 6) {
2192
+ hi = 0;
2193
+ fixedHi = true;
2194
+ }
2195
+ }
2196
+ const range = hi - lo;
2197
+ const top = fixedHi ? hi : hi + range * 0.05;
2198
+ const bottom = fixedLo ? lo : lo - range * 0.05;
2199
+ for (const unit of units(range / maxIntervals)) {
2200
+ const min = fixedLo ? lo : Math.floor(clean(bottom / unit)) * unit;
2201
+ const max = fixedHi ? hi : Math.ceil(clean(top / unit)) * unit;
2202
+ const intervals = Math.round((max - min) / unit);
2203
+ if (intervals <= maxIntervals && intervals > 0) {
2204
+ const ticks = [];
2205
+ for (let i = 0; i <= intervals; i++) ticks.push(clean(min + i * unit));
2206
+ return { min: clean(min), max: clean(max), majorUnit: unit, ticks };
2207
+ }
2208
+ }
2209
+ return { min: lo, max: hi, majorUnit: range, ticks: [lo, hi] };
2210
+ }
2211
+ var PERCENT_SCALE = {
2212
+ min: 0,
2213
+ max: 1,
2214
+ majorUnit: 0.1,
2215
+ ticks: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
2216
+ };
2217
+ function formatAxisValue(value, percent = false) {
2218
+ if (percent) return `${clean(value * 100)}%`;
2219
+ const v = clean(value);
2220
+ if (Math.abs(v) >= 1e15 || v !== 0 && Math.abs(v) < 1e-6)
2221
+ return v.toExponential(2).replace("e+", "E+").replace("e-", "E-");
2222
+ const [int = "0", frac] = String(Math.abs(v)).split(".");
2223
+ const grouped = int.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2224
+ return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
2225
+ }
2226
+
2227
+ // chart/render/chart-svg-util.ts
2228
+ var TEXT_COLOR = "#595959";
2229
+ var GRID_COLOR = "#D9D9D9";
2230
+ var AXIS_COLOR = "#BFBFBF";
2231
+ var FONT_SIZE = 10;
2232
+ function esc(text2) {
2233
+ return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2234
+ }
2235
+ var n = (value) => String(Math.round(value * 100) / 100);
2236
+ var textWidth = (text2, size = FONT_SIZE) => text2.length * size * 0.55;
2237
+ function text(x, y, content, attrs = {}) {
2238
+ const parts = [`x="${n(x)}"`, `y="${n(y)}"`];
2239
+ parts.push(`font-size="${attrs.size ?? FONT_SIZE}"`);
2240
+ parts.push(`fill="${esc(attrs.fill ?? TEXT_COLOR)}"`);
2241
+ if (attrs.anchor && attrs.anchor !== "start") parts.push(`text-anchor="${attrs.anchor}"`);
2242
+ if (attrs.weight) parts.push(`font-weight="${attrs.weight}"`);
2243
+ if (attrs.baseline) parts.push(`dominant-baseline="${attrs.baseline}"`);
2244
+ if (attrs.family) parts.push(`font-family="${esc(attrs.family)}"`);
2245
+ if (attrs.filter) parts.push(`filter="${esc(attrs.filter)}"`);
2246
+ if (attrs.italic !== void 0) parts.push(`font-style="${attrs.italic ? "italic" : "normal"}"`);
2247
+ if (attrs.underline !== void 0)
2248
+ parts.push(`text-decoration="${attrs.underline ? "underline" : "none"}"`);
2249
+ return `<text ${parts.join(" ")}>${esc(content)}</text>`;
2250
+ }
2251
+ var line = (x1, y1, x2, y2, stroke, width = 1) => `<line x1="${n(x1)}" y1="${n(y1)}" x2="${n(x2)}" y2="${n(y2)}" stroke="${stroke}" stroke-width="${width}"/>`;
2252
+ var rect = (x, y, w, h, fill, filter) => `<rect x="${n(x)}" y="${n(y)}" width="${n(Math.max(0, w))}" height="${n(Math.max(0, h))}" fill="${fill}"${filter ? ` filter="${esc(filter)}"` : ""}/>`;
2253
+ function fit(content, maxWidth, size = FONT_SIZE) {
2254
+ if (textWidth(content, size) <= maxWidth) return content;
2255
+ const chars = Math.max(1, Math.floor(maxWidth / (size * 0.55)) - 1);
2256
+ return `${content.slice(0, chars)}\u2026`;
2257
+ }
2258
+
2259
+ // chart/render/theme-palette.ts
2260
+ var THEME_SLOTS = [
2261
+ "lt1",
2262
+ "dk1",
2263
+ "lt2",
2264
+ "dk2",
2265
+ "accent1",
2266
+ "accent2",
2267
+ "accent3",
2268
+ "accent4",
2269
+ "accent5",
2270
+ "accent6",
2271
+ "hlink",
2272
+ "folHlink"
2273
+ ];
2274
+ var DEFAULT_THEME_COLORS = [
2275
+ "FFFFFF",
2276
+ "000000",
2277
+ "E7E6E6",
2278
+ "44546A",
2279
+ "4472C4",
2280
+ "ED7D31",
2281
+ "A5A5A5",
2282
+ "FFC000",
2283
+ "5B9BD5",
2284
+ "70AD47",
2285
+ "0563C1",
2286
+ "954F72"
2287
+ ];
2288
+ function themeColor(theme, index) {
2289
+ const hex = theme.colors[index] ?? DEFAULT_THEME_COLORS[index];
2290
+ return hex && parseArgbHex(hex) ? hex.replace(/^#/, "") : void 0;
2291
+ }
2292
+
2293
+ // chart/render/chart-colors.ts
2294
+ function chartColorScheme(theme) {
2295
+ const slots = Object.fromEntries(
2296
+ THEME_SLOTS.map((slot, index) => [slot, `#${themeColor(theme, index) ?? "000000"}`])
2297
+ );
2298
+ return {
2299
+ ...slots,
2300
+ bg1: slots.lt1,
2301
+ tx1: slots.dk1,
2302
+ bg2: slots.lt2,
2303
+ tx2: slots.dk2
2304
+ };
2305
+ }
2306
+ function autoSeriesColor(theme, index) {
2307
+ const i = Math.max(0, Math.floor(index));
2308
+ return chartPaletteSeriesColor(findChartColorPalette(10), i, i + 1, chartColorScheme(theme));
2309
+ }
2310
+
2311
+ // chart/render/chart-value-axis.ts
2312
+ function valueAxis(model) {
2313
+ const stackable = model.type === "bar" || model.type === "column" || model.type === "line" || model.type === "area";
2314
+ if (stackable && model.grouping === "percentStacked")
2315
+ return { ...PERCENT_SCALE, ticks: [...PERCENT_SCALE.ticks], percent: true };
2316
+ let min = Infinity;
2317
+ let max = -Infinity;
2318
+ if (stackable && model.grouping === "stacked") {
2319
+ for (let i = 0; i < model.categories.length; i++) {
2320
+ let pos = 0;
2321
+ let neg = 0;
2322
+ for (const s of model.series) {
2323
+ const v = s.values[i] ?? 0;
2324
+ if (v >= 0) pos += v;
2325
+ else neg += v;
2326
+ }
2327
+ min = Math.min(min, neg);
2328
+ max = Math.max(max, pos);
2329
+ }
2330
+ } else {
2331
+ for (const s of model.series)
2332
+ for (const v of s.values)
2333
+ if (v !== null) {
2334
+ min = Math.min(min, v);
2335
+ max = Math.max(max, v);
2336
+ }
2337
+ }
2338
+ if (min === Infinity) {
2339
+ min = 0;
2340
+ max = 1;
2341
+ }
2342
+ return { ...niceScale(min, max), percent: false };
2343
+ }
2344
+ function categoryTotals(model) {
2345
+ return model.categories.map(
2346
+ (_, i) => model.series.reduce((sum, s) => sum + Math.abs(s.values[i] ?? 0), 0)
2347
+ );
2348
+ }
2349
+
2350
+ // chart/text-inheritance.ts
2351
+ var TEXT_KEYS = [
2352
+ "fontSize",
2353
+ "bold",
2354
+ "italic",
2355
+ "underline",
2356
+ "typeface",
2357
+ "textColor",
2358
+ "fontRef"
2359
+ ];
2360
+ var TEXT_PARTS = [
2361
+ "title",
2362
+ "axisTitle",
2363
+ "categoryAxis",
2364
+ "valueAxis",
2365
+ "legend",
2366
+ "dataLabel"
2367
+ ];
2368
+ function inheritChartText(part, entry, builtIn, root) {
2369
+ if (!root || !TEXT_PARTS.includes(part)) return entry;
2370
+ const out = { ...entry };
2371
+ for (const key of TEXT_KEYS) {
2372
+ delete out[key];
2373
+ const value = root[key] ?? builtIn?.[key];
2374
+ if (value !== void 0) Object.assign(out, { [key]: value });
2375
+ }
2376
+ if (part === "title" && root.fontSize !== void 0) out.fontSize = root.fontSize * 1.2;
2377
+ if (root.textEffectsXml !== void 0) out.textEffectsXml = root.textEffectsXml;
2378
+ return out;
2379
+ }
2380
+
2381
+ // chart/render/chart-appearance.ts
2382
+ var chartPointsToPixels = (points) => points * EMU_PER_POINT / EMU_PER_PIXEL;
2383
+ function typeface(entry, theme) {
2384
+ const name = entry.typeface;
2385
+ if (name?.startsWith("+mj-")) return theme.majorFont;
2386
+ if (name?.startsWith("+mn-")) return theme.minorFont;
2387
+ return name ?? (entry.fontRef?.index === "major" ? theme.majorFont : entry.fontRef?.index === "minor" ? theme.minorFont : void 0);
2388
+ }
2389
+ function chartAppearance(chart, theme) {
2390
+ const defaults = builtInChartTextStyle(effectiveBuiltInChartStyle(chart.formatting));
2391
+ const entries = {};
2392
+ for (const part of CHART_STYLE_PARTS) {
2393
+ const base = chart.styleDefinition?.entries[part];
2394
+ const direct = chart.formatting?.entries[part];
2395
+ if (!defaults[part] && !base && !direct) continue;
2396
+ const entry = {
2397
+ ...inheritChartText(
2398
+ part,
2399
+ { ...defaults[part], ...base, sourceXml: base?.sourceXml ?? "" },
2400
+ defaults[part],
2401
+ chart.formatting?.textDefaults
2402
+ ),
2403
+ ...direct,
2404
+ sourceXml: direct?.sourceXml ?? base?.sourceXml ?? ""
2405
+ };
2406
+ if (base?.line || direct?.line) entry.line = { ...base?.line, ...direct?.line };
2407
+ entries[part] = entry;
2408
+ }
2409
+ const scheme = chartColorScheme(theme);
2410
+ const resolve = (color) => resolveDrawingColor(
2411
+ color,
2412
+ { scheme: (name) => scheme[name] },
2413
+ { hslRounding: "halfDown", transformOrder: "document" }
2414
+ );
2415
+ const out = resolveChartStyleDefinition(
2416
+ { entries},
2417
+ (color) => drawingColorCss(resolve(color))
2418
+ ) ?? {};
2419
+ for (const part of CHART_STYLE_PARTS) {
2420
+ const entry = entries[part];
2421
+ if (!entry) continue;
2422
+ const family = typeface(entry, theme);
2423
+ const shadow = resolveDrawingShadowXml(entry.textEffectsXml, {
2424
+ scheme: (name) => scheme[name]
2425
+ });
2426
+ if (shadow) (out[part] ??= {}).textShadow = shadow;
2427
+ if (family) (out[part] ??= {}).typeface = family;
2428
+ if (entry.axisVisible !== void 0) (out[part] ??= {}).axisVisible = entry.axisVisible;
2429
+ if (entry.labelsVisible !== void 0) (out[part] ??= {}).labelsVisible = entry.labelsVisible;
2430
+ if (entry.line?.widthEmu === 0) (out[part] ??= {}).lineWidth = 0;
2431
+ if (entry.fill?.kind === "gradient") {
2432
+ (out[part] ??= {}).gradient = resolveChartGradient(entry.fill, resolve);
2433
+ }
2434
+ }
2435
+ return out;
2436
+ }
2437
+
2438
+ // chart/render/chart-title-text.ts
2439
+ function properties(run) {
2440
+ return {
2441
+ ...run.sizePt === void 0 ? {} : { fontSize: run.sizePt },
2442
+ ...run.bold === void 0 ? {} : { bold: run.bold },
2443
+ ...run.italic === void 0 ? {} : { italic: run.italic },
2444
+ ...run.underline === void 0 ? {} : { underline: run.underline },
2445
+ ...run.typeface === void 0 ? {} : { typeface: run.typeface },
2446
+ ...run.color === void 0 ? {} : { textColor: run.color }
2447
+ };
2448
+ }
2449
+ function chartTitleText(chart, theme) {
2450
+ const formatting = chart.formatting;
2451
+ const entry = formatting?.entries.title;
2452
+ const body = entry?.textBody;
2453
+ if (!formatting || !body || body.text !== chart.title) return void 0;
2454
+ if (body.paragraphs.length === 1 && body.paragraphs[0].runs.length <= 1 && !body.text.includes("\n") && !body.paragraphs[0].lineSpacing && !body.paragraphs[0].spaceBefore && !body.paragraphs[0].spaceAfter)
2455
+ return void 0;
2456
+ return {
2457
+ paragraphs: body.paragraphs.map((paragraph) => ({
2458
+ ...paragraph.align ? { align: paragraph.align } : {},
2459
+ ...paragraph.lineSpacing ? { lineSpacing: paragraph.lineSpacing } : {},
2460
+ ...paragraph.spaceBefore ? { spaceBefore: paragraph.spaceBefore } : {},
2461
+ ...paragraph.spaceAfter ? { spaceAfter: paragraph.spaceAfter } : {},
2462
+ runs: paragraph.runs.map((run) => {
2463
+ const direct = {
2464
+ sourceXml: "",
2465
+ ...entry.textBodyStyle,
2466
+ ...properties(paragraph.defaultProperties ?? {}),
2467
+ ...properties(run)
2468
+ };
2469
+ const appearance = chartAppearance(
2470
+ {
2471
+ ...chart,
2472
+ formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
2473
+ },
2474
+ theme
2475
+ )?.title ?? {};
2476
+ return { text: run.text, appearance };
2477
+ })
2478
+ }))
2479
+ };
2480
+ }
2481
+
2482
+ // chart/render/chart-view.ts
2483
+ var isRefError = (value) => typeof value === "object" && value !== null && "error" in value;
2484
+ var SUPPORTED = /* @__PURE__ */ new Set([
2485
+ "bar",
2486
+ "column",
2487
+ "line",
2488
+ "area",
2489
+ "pie",
2490
+ "doughnut",
2491
+ "scatter",
2492
+ "radar"
2493
+ ]);
2494
+ function toText(value) {
2495
+ if (value === null) return "";
2496
+ if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
2497
+ if (isRefError(value)) return value.error;
2498
+ return String(value);
2499
+ }
2500
+ var toNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
2501
+ function resolveRef(ref, evaluateRef) {
2502
+ if (!ref) return void 0;
2503
+ try {
2504
+ const values = evaluateRef(ref);
2505
+ return values.length ? values : void 0;
2506
+ } catch {
2507
+ return void 0;
2508
+ }
2509
+ }
2510
+ function seriesName(series, index, evaluateRef) {
2511
+ const fromRef = resolveRef(series.nameRef, evaluateRef)?.map(toText).filter((t) => t !== "").join(" ");
2512
+ return fromRef || series.name || `Series${index + 1}`;
2513
+ }
2514
+ function chartSummaryView(chart, theme, options = {}) {
2515
+ const evaluateRef = options.evaluateRef ?? (() => []);
2516
+ const type = chart.chartType;
2517
+ const radial = type === "pie" || type === "doughnut";
2518
+ const palette = chart.colorPalette === void 0 ? void 0 : findChartColorPalette(chart.colorPalette);
2519
+ const scheme = chartColorScheme(theme);
2520
+ const drawingColor = (color) => color && drawingColorCss(
2521
+ resolveDrawingColor(
2522
+ color,
2523
+ {
2524
+ scheme: (name) => scheme[name]
2525
+ },
2526
+ { transformOrder: "document" }
2527
+ )
2528
+ );
2529
+ const gradient = (fill) => fill?.kind === "gradient" ? resolveChartGradient(
2530
+ fill,
2531
+ (color) => resolveDrawingColor(
2532
+ color,
2533
+ {
2534
+ scheme: (name) => scheme[name]
2535
+ },
2536
+ { transformOrder: "document" }
2537
+ )
2538
+ ) : void 0;
2539
+ const grouping = chart.grouping ?? (type === "bar" || type === "column" ? "clustered" : "standard");
2540
+ let categories = [];
2541
+ const rawCategories = [];
2542
+ const series = chart.series.map((s, i) => {
2543
+ const values = resolveRef(s.valuesRef, evaluateRef)?.map(toNumber) ?? s.values.map(toNumber);
2544
+ const cats = resolveRef(s.categoriesRef, evaluateRef) ?? s.categories;
2545
+ rawCategories.push(cats);
2546
+ const paletteColor = palette && chartPaletteSeriesColor(palette, i, chart.series.length, scheme);
2547
+ const color = s.fill?.kind === "none" ? "none" : drawingColor(s.fill?.kind === "solid" ? s.fill.color : s.drawingColor) ?? options.seriesColor?.(s, i) ?? paletteColor ?? autoSeriesColor(theme, i);
2548
+ const view = { name: seriesName(s, i, evaluateRef), values, color };
2549
+ const shadow = resolveDrawingShadowXml(s.effectsXml, {
2550
+ scheme: (name) => scheme[name]
2551
+ });
2552
+ if (shadow) view.shadow = shadow;
2553
+ const resolvedGradient = gradient(s.fill);
2554
+ if (resolvedGradient) view.gradient = resolvedGradient;
2555
+ const points = Object.fromEntries(
2556
+ Object.entries(s.pointFills ?? {}).flatMap(([key, fill]) => {
2557
+ const value = gradient(fill);
2558
+ return value ? [[key, value]] : [];
2559
+ })
2560
+ );
2561
+ if (Object.keys(points).length) view.pointGradients = points;
2562
+ return view;
2563
+ });
2564
+ const longest = Math.max(0, ...series.map((s) => s.values.length));
2565
+ const firstCats = rawCategories.find((c) => c.length > 0) ?? [];
2566
+ categories = Array.from(
2567
+ { length: Math.max(longest, firstCats.length) },
2568
+ (_, i) => firstCats[i] !== void 0 ? toText(firstCats[i] ?? null) : String(i + 1)
2569
+ );
2570
+ if (radial) {
2571
+ series.forEach((s, seriesIndex) => {
2572
+ s.pointColors = s.values.map((_, i) => {
2573
+ const explicit = drawingColor(chart.series[seriesIndex]?.pointColors?.[i]);
2574
+ return explicit ?? (palette ? chartPaletteSeriesColor(palette, i, s.values.length, scheme) : autoSeriesColor(theme, i));
2575
+ });
2576
+ });
2577
+ } else
2578
+ series.forEach((s, seriesIndex) => {
2579
+ const points = chart.series[seriesIndex]?.pointColors;
2580
+ if (points) s.pointColors = s.values.map((_, i) => drawingColor(points[i]) ?? s.color);
2581
+ });
2582
+ series.forEach((s, index) => {
2583
+ const source = chart.series[index];
2584
+ if (s.gradient && !radial && s.pointColors) {
2585
+ for (let i = 0; i < s.pointColors.length; i++)
2586
+ if (!source.pointColors?.[i]) delete s.pointColors[i];
2587
+ }
2588
+ for (const [key, fill] of Object.entries(source.pointFills ?? {})) {
2589
+ if (fill.kind === "none") (s.pointColors ??= [])[Number(key)] = "none";
2590
+ else if (fill.kind === "solid") {
2591
+ const paint = drawingColor(fill.color);
2592
+ if (paint) (s.pointColors ??= [])[Number(key)] = paint;
2593
+ }
2594
+ }
2595
+ });
2596
+ const model = {
2597
+ ...chart.barGapWidth === void 0 ? {} : { barGapWidth: chart.barGapWidth },
2598
+ ...chart.barOverlap === void 0 ? {} : { barOverlap: chart.barOverlap },
2599
+ type,
2600
+ grouping,
2601
+ showLegend: chart.showLegend,
2602
+ legendPosition: chart.legendPosition ?? "r",
2603
+ categories,
2604
+ series,
2605
+ horizontal: type === "bar",
2606
+ supported: SUPPORTED.has(type)
2607
+ };
2608
+ if (chart.title) model.title = chart.title;
2609
+ const titleFormatting = chart.formatting?.entries.title;
2610
+ if (titleFormatting?.layout) model.titleLayout = titleFormatting.layout;
2611
+ if (titleFormatting?.overlay !== void 0) model.titleOverlay = titleFormatting.overlay;
2612
+ const legendFormatting = chart.formatting?.entries.legend;
2613
+ if (legendFormatting?.layout) model.legendLayout = legendFormatting.layout;
2614
+ if (legendFormatting?.overlay !== void 0) model.legendOverlay = legendFormatting.overlay;
2615
+ const titleText = chartTitleText(chart, theme);
2616
+ if (titleText) model.titleText = titleText;
2617
+ const appearance = chartAppearance(chart, theme);
2618
+ if (appearance) model.appearance = appearance;
2619
+ if (type === "scatter") {
2620
+ series.forEach((s, i) => {
2621
+ const cats = rawCategories[i] ?? [];
2622
+ const numeric = cats.length > 0 && cats.every((c) => typeof c === "number");
2623
+ s.xValues = s.values.map((_, k) => numeric ? toNumber(cats[k] ?? null) : k + 1);
2624
+ });
2625
+ const xs = series.flatMap((s) => s.xValues ?? []).filter((x) => x !== null);
2626
+ model.xAxis = xs.length ? niceScale(Math.min(...xs), Math.max(...xs)) : niceScale(0, 1);
2627
+ }
2628
+ if (!radial) model.valueAxis = valueAxis(model);
2629
+ return model;
2630
+ }
2631
+
2632
+ // text/css-font-family.ts
2633
+ var FALLBACKS = {
2634
+ calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
2635
+ "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
2636
+ cambria: '"Cambria", "Caladea", Georgia, serif',
2637
+ arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
2638
+ "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
2639
+ "courier new": '"Courier New", "Liberation Mono", monospace',
2640
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
2641
+ };
2642
+ function cssFontFamily(name) {
2643
+ const known = FALLBACKS[name.toLowerCase()];
2644
+ if (known) return known;
2645
+ const quoted = `"${name.replace(/["\\]/g, "")}"`;
2646
+ return `${quoted}, "Calibri", "Carlito", "Segoe UI", sans-serif`;
2647
+ }
2648
+
2649
+ // chart/render/chart-svg-appearance.ts
2650
+ var nextPaintId = 0;
2651
+ function chartGradientPaint(model, width = 1024, height = 768) {
2652
+ const prefix = `xlsx-chart-${++nextPaintId}`;
2653
+ const appearance = { ...model.appearance };
2654
+ const defs = [];
2655
+ const shadowPaint = (shadow, suffix) => {
2656
+ const id = `${prefix}-${suffix}`;
2657
+ const pad = Math.max(4, shadow.blur * 3 + Math.abs(shadow.dx) + Math.abs(shadow.dy));
2658
+ defs.push(
2659
+ `<filter id="${id}" filterUnits="userSpaceOnUse" x="${n(-pad)}" y="${n(-pad)}" width="${n(width + pad * 2)}" height="${n(height + pad * 2)}" color-interpolation-filters="sRGB">${svgDropShadowElement(shadow, { number: n, color: (value) => esc(value) })}</filter>`
2660
+ );
2661
+ return `url(#${id})`;
2662
+ };
2663
+ for (const [part, entry] of Object.entries(appearance)) {
2664
+ if (entry?.textShadow)
2665
+ appearance[part] = {
2666
+ ...entry,
2667
+ textShadowFilter: shadowPaint(entry.textShadow, `${part}-text-shadow`)
2668
+ };
2669
+ }
2670
+ const paint = (gradient, suffix, bounds) => {
2671
+ const def = buildChartGradientDef(`${prefix}-${suffix}`, gradient, bounds);
2672
+ defs.push(chartGradientMarkup(def));
2673
+ return `url(#${def.id})`;
2674
+ };
2675
+ for (const part of ["chartArea", "plotArea"]) {
2676
+ const entry = appearance[part];
2677
+ if (!entry?.gradient) continue;
2678
+ if (part === "plotArea" && ["circle", "shape"].includes(entry.gradient.path ?? "")) continue;
2679
+ appearance[part] = {
2680
+ ...entry,
2681
+ fillColor: paint(entry.gradient, part, { width, height, shape: "rect" })
2682
+ };
2683
+ }
2684
+ const series = model.series.map((source, index) => {
2685
+ const view = { ...source };
2686
+ if (source.shadow) view.shadowFilter = shadowPaint(source.shadow, `s${index}-shadow`);
2687
+ const bounds = model.type === "bar" || model.type === "column" ? { width: 1, height: 1, shape: "rect" } : void 0;
2688
+ if (source.gradient) view.color = paint(source.gradient, `s${index}`, bounds);
2689
+ if (source.pointGradients) {
2690
+ view.pointColors = [...source.pointColors ?? []];
2691
+ for (const [key, gradient] of Object.entries(source.pointGradients))
2692
+ view.pointColors[Number(key)] = paint(gradient, `s${index}-p${key}`, bounds);
2693
+ }
2694
+ return view;
2695
+ });
2696
+ return defs.length ? { model: { ...model, appearance, series }, defs: `<defs>${defs.join("")}</defs>` } : { model, defs: "" };
2697
+ }
2698
+ function chartTextAttributes(model, part, fallbackSize = FONT_SIZE) {
2699
+ const entry = model.appearance?.[part];
2700
+ return {
2701
+ size: entry?.fontSize === void 0 ? fallbackSize : chartPointsToPixels(entry.fontSize),
2702
+ ...entry?.color === void 0 ? {} : { fill: entry.color },
2703
+ ...entry?.bold === void 0 ? {} : { weight: entry.bold ? "bold" : "normal" },
2704
+ ...entry?.italic === void 0 ? {} : { italic: entry.italic },
2705
+ ...entry?.underline === void 0 ? {} : { underline: entry.underline },
2706
+ ...entry?.typeface === void 0 ? {} : { family: cssFontFamily(entry.typeface) },
2707
+ ...entry?.textShadowFilter === void 0 ? {} : { filter: entry.textShadowFilter }
2708
+ };
2709
+ }
2710
+ function chartStroke(model, part) {
2711
+ const entry = model.appearance?.[part];
2712
+ return {
2713
+ color: entry?.axisVisible === false ? "none" : entry?.lineColor ?? (part === "gridlineMajor" ? GRID_COLOR : AXIS_COLOR),
2714
+ width: entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth)
2715
+ };
2716
+ }
2717
+ function chartAreaRect(model, part, area) {
2718
+ if (area.w <= 0 || area.h <= 0) return "";
2719
+ const entry = model.appearance?.[part];
2720
+ let fill = entry?.fillColor ?? (part === "chartArea" ? "#FFFFFF" : "none");
2721
+ let defs = "";
2722
+ if (part !== "chartArea" && entry?.gradient && (part !== "plotArea" || ["circle", "shape"].includes(entry.gradient.path ?? ""))) {
2723
+ const def = buildChartGradientDef(`xlsx-chart-${++nextPaintId}-${part}`, entry.gradient, {
2724
+ width: area.w,
2725
+ height: area.h,
2726
+ shape: "rect"
2727
+ });
2728
+ defs = `<defs>${chartGradientMarkup(def)}</defs>`;
2729
+ fill = `url(#${def.id})`;
2730
+ }
2731
+ const stroke = entry?.lineColor ?? "none";
2732
+ if (fill === "none" && stroke === "none") return "";
2733
+ const width = entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth);
2734
+ return `${defs}<rect x="${n(area.x)}" y="${n(area.y)}" width="${n(area.w)}" height="${n(area.h)}" fill="${esc(fill)}" stroke="${esc(stroke)}" stroke-width="${n(width)}" data-chart-part="${part}"/>`;
2735
+ }
2736
+
2737
+ // chart/render/chart-spacing.ts
2738
+ function chartBarSpacing(chart) {
2739
+ const stacked = chart.grouping === "stacked" || chart.grouping === "percentStacked";
2740
+ return {
2741
+ barGapWidth: chart.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH,
2742
+ barOverlap: chart.barOverlap ?? (stacked ? 100 : 0)
2743
+ };
2744
+ }
2745
+
2746
+ // chart/render/chart-svg-bars.ts
2747
+ function bars(model, frame, out, values) {
2748
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
2749
+ const count = Math.max(1, model.series.length);
2750
+ const geometry = clusteredBarGeometry(frame.bandSize, count, chartBarSpacing(model));
2751
+ const barSize = geometry.singleBarWidth;
2752
+ const base = frame.value(0);
2753
+ const pos = new Array(model.categories.length).fill(0);
2754
+ const neg = new Array(model.categories.length).fill(0);
2755
+ model.series.forEach((s, si) => {
2756
+ values[si]?.forEach((v, i) => {
2757
+ if (v === null || i >= model.categories.length) return;
2758
+ let from = 0;
2759
+ let to = v;
2760
+ if (stacked) {
2761
+ const acc = v >= 0 ? pos : neg;
2762
+ from = acc[i] ?? 0;
2763
+ to = from + v;
2764
+ acc[i] = to;
2765
+ }
2766
+ const a = stacked ? frame.value(from) : base;
2767
+ const b = frame.value(to);
2768
+ const offset = model.horizontal ? geometry.clusterWidth / 2 - barSize - si * geometry.step : -geometry.clusterWidth / 2 + si * geometry.step;
2769
+ const center = frame.band(i);
2770
+ const width = model.horizontal ? Math.abs(b - a) : barSize;
2771
+ const height = model.horizontal ? barSize : Math.abs(b - a);
2772
+ let color = s.pointColors?.[i] ?? s.color;
2773
+ const gradient = s.pointGradients?.[i] ?? (s.pointColors?.[i] === void 0 ? s.gradient : void 0);
2774
+ if (gradient && (gradient.path === "circle" || gradient.path === "shape")) {
2775
+ const baseId = color.match(/^url\(#(.+)\)$/)?.[1];
2776
+ if (baseId) {
2777
+ const id = baseId.replace(/(-s\d+(?:-p\d+)?)$/, `-mark${i}$1`);
2778
+ const def = buildChartGradientDef(id, gradient, {
2779
+ width: Number(n(width)),
2780
+ height: Number(n(height)),
2781
+ shape: "rect"
2782
+ });
2783
+ out.push(`<defs>${chartGradientMarkup(def)}</defs>`);
2784
+ color = `url(#${id})`;
2785
+ }
2786
+ }
2787
+ out.push(`<g data-chart-series="${si}" data-chart-point="${i}">`);
2788
+ if (model.horizontal)
2789
+ out.push(
2790
+ rect(Math.min(a, b), center + offset, Math.abs(b - a), barSize, color, s.shadowFilter)
2791
+ );
2792
+ else
2793
+ out.push(
2794
+ rect(center + offset, Math.min(a, b), barSize, Math.abs(b - a), color, s.shadowFilter)
2795
+ );
2796
+ out.push("</g>");
2797
+ });
2798
+ });
2799
+ }
2800
+
2801
+ // chart/render/chart-svg-cartesian.ts
2802
+ function axes(model, area, out) {
2803
+ const scale = model.valueAxis;
2804
+ if (!scale) return void 0;
2805
+ const labels = scale.ticks.map((t) => formatAxisValue(t, scale.percent));
2806
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
2807
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
2808
+ const valueSize = valueAttrs.size ?? 10;
2809
+ const categorySize = categoryAttrs.size ?? 10;
2810
+ const grid = chartStroke(model, "gridlineMajor");
2811
+ const axis = chartStroke(model, "categoryAxis");
2812
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
2813
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
2814
+ const labelW = valueLabels ? Math.max(...labels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
2815
+ const horizontal = model.horizontal;
2816
+ const cats = Math.max(1, model.categories.length);
2817
+ const catW = Math.min(
2818
+ area.w * 0.3,
2819
+ Math.max(...model.categories.map((c) => textWidth(c, categorySize)), 8) + 6
2820
+ );
2821
+ const plot = horizontal ? {
2822
+ x: area.x + catW,
2823
+ y: area.y,
2824
+ w: Math.max(1, area.w - catW - 4),
2825
+ h: Math.max(1, area.h - Math.max(16, valueSize * 1.5))
2826
+ } : {
2827
+ x: area.x + labelW,
2828
+ y: area.y + 4,
2829
+ w: Math.max(1, area.w - labelW - 4),
2830
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
2831
+ };
2832
+ const span = scale.max - scale.min || 1;
2833
+ const value = horizontal ? (v) => plot.x + (v - scale.min) / span * plot.w : (v) => plot.y + plot.h - (v - scale.min) / span * plot.h;
2834
+ const bandSize = (horizontal ? plot.h : plot.w) / cats;
2835
+ const band = horizontal ? (i) => plot.y + plot.h - bandSize * (i + 0.5) : (i) => plot.x + bandSize * (i + 0.5);
2836
+ out.push(chartAreaRect(model, "plotArea", plot));
2837
+ scale.ticks.forEach((t, i) => {
2838
+ const p = value(t);
2839
+ const label = labels[i] ?? "";
2840
+ if (horizontal) {
2841
+ out.push(line(p, plot.y, p, plot.y + plot.h, grid.color, grid.width));
2842
+ if (valueLabels)
2843
+ out.push(
2844
+ text(p, plot.y + plot.h + valueSize + 2, label, { anchor: "middle", ...valueAttrs })
2845
+ );
2846
+ } else {
2847
+ out.push(line(plot.x, p, plot.x + plot.w, p, grid.color, grid.width));
2848
+ if (valueLabels)
2849
+ out.push(text(plot.x - 4, p + valueSize * 0.3, label, { anchor: "end", ...valueAttrs }));
2850
+ }
2851
+ });
2852
+ const zero = value(Math.min(Math.max(0, scale.min), scale.max));
2853
+ if (horizontal) out.push(line(zero, plot.y, zero, plot.y + plot.h, axis.color, axis.width));
2854
+ else out.push(line(plot.x, zero, plot.x + plot.w, zero, axis.color, axis.width));
2855
+ const step = Math.max(
2856
+ 1,
2857
+ Math.ceil(cats / Math.max(1, Math.floor((horizontal ? plot.h : plot.w) / 14)))
2858
+ );
2859
+ model.categories.forEach((c, i) => {
2860
+ if (!categoryLabels || i % step !== 0) return;
2861
+ const p = band(i);
2862
+ if (horizontal)
2863
+ out.push(
2864
+ text(plot.x - 4, p + categorySize * 0.3, fit(c, catW - 6, categorySize), {
2865
+ anchor: "end",
2866
+ ...categoryAttrs
2867
+ })
2868
+ );
2869
+ else
2870
+ out.push(
2871
+ text(p, plot.y + plot.h + categorySize + 3, fit(c, bandSize * step, categorySize), {
2872
+ anchor: "middle",
2873
+ ...categoryAttrs
2874
+ })
2875
+ );
2876
+ });
2877
+ return { plot, value, band, bandSize };
2878
+ }
2879
+ function plotted(model) {
2880
+ if (model.grouping !== "percentStacked") return model.series.map((s) => s.values);
2881
+ const totals = categoryTotals(model);
2882
+ return model.series.map(
2883
+ (s) => s.values.map((v, i) => v === null ? null : v / (totals[i] || 1))
2884
+ );
2885
+ }
2886
+ function linesAndAreas(model, frame, out) {
2887
+ const values = plotted(model);
2888
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
2889
+ const acc = new Array(model.categories.length).fill(0);
2890
+ const area = model.type === "area";
2891
+ const layers = [];
2892
+ model.series.forEach((s, si) => {
2893
+ const points = [];
2894
+ const lower = [];
2895
+ model.categories.forEach((_, i) => {
2896
+ const v = values[si]?.[i] ?? null;
2897
+ if (v === null && !area) {
2898
+ points.push([NaN, NaN]);
2899
+ return;
2900
+ }
2901
+ const below = stacked ? acc[i] ?? 0 : 0;
2902
+ const top = below + (v ?? 0);
2903
+ if (stacked) acc[i] = top;
2904
+ points.push([frame.band(i), frame.value(top)]);
2905
+ lower.push([frame.band(i), frame.value(below)]);
2906
+ });
2907
+ layers.push({
2908
+ points,
2909
+ lower,
2910
+ color: s.color,
2911
+ filter: s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""
2912
+ });
2913
+ });
2914
+ for (const { points, lower, color, filter } of area ? [...layers].reverse() : layers) {
2915
+ if (area) {
2916
+ const poly = [...points, ...[...lower].reverse()].map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
2917
+ out.push(`<polygon points="${poly}" fill="${color}" fill-opacity="0.85"${filter}/>`);
2918
+ continue;
2919
+ }
2920
+ let segment = [];
2921
+ const flush = () => {
2922
+ if (segment.length > 1)
2923
+ out.push(
2924
+ `<polyline points="${segment.join(" ")}" fill="none" stroke="${color}" stroke-width="2.25" stroke-linejoin="round"${filter}/>`
2925
+ );
2926
+ segment = [];
2927
+ };
2928
+ for (const [x, y] of points) {
2929
+ if (Number.isNaN(x)) flush();
2930
+ else segment.push(`${n(x)},${n(y)}`);
2931
+ }
2932
+ flush();
2933
+ for (const [x, y] of points)
2934
+ if (!Number.isNaN(x))
2935
+ out.push(`<circle cx="${n(x)}" cy="${n(y)}" r="2.5" fill="${color}"${filter}/>`);
2936
+ }
2937
+ }
2938
+ function scatter(model, area, out) {
2939
+ const ys = model.valueAxis;
2940
+ const xs = model.xAxis;
2941
+ if (!ys || !xs) return;
2942
+ const yLabels = ys.ticks.map((t) => formatAxisValue(t));
2943
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
2944
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
2945
+ const valueSize = valueAttrs.size ?? 10;
2946
+ const categorySize = categoryAttrs.size ?? 10;
2947
+ const grid = chartStroke(model, "gridlineMajor");
2948
+ const xAxis = chartStroke(model, "categoryAxis");
2949
+ const yAxis = chartStroke(model, "valueAxis");
2950
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
2951
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
2952
+ const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
2953
+ const plot = {
2954
+ x: area.x + labelW,
2955
+ y: area.y + 4,
2956
+ w: Math.max(1, area.w - labelW - 8),
2957
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
2958
+ };
2959
+ const px = (v, s) => plot.x + (v - s.min) / (s.max - s.min || 1) * plot.w;
2960
+ const py = (v, s) => plot.y + plot.h - (v - s.min) / (s.max - s.min || 1) * plot.h;
2961
+ out.push(chartAreaRect(model, "plotArea", plot));
2962
+ ys.ticks.forEach((t, i) => {
2963
+ out.push(line(plot.x, py(t, ys), plot.x + plot.w, py(t, ys), grid.color, grid.width));
2964
+ if (valueLabels)
2965
+ out.push(
2966
+ text(plot.x - 4, py(t, ys) + valueSize * 0.3, yLabels[i] ?? "", {
2967
+ anchor: "end",
2968
+ ...valueAttrs
2969
+ })
2970
+ );
2971
+ });
2972
+ for (const t of xs.ticks) {
2973
+ out.push(
2974
+ line(px(t, xs), plot.y + plot.h, px(t, xs), plot.y + plot.h + 3, xAxis.color, xAxis.width)
2975
+ );
2976
+ if (categoryLabels)
2977
+ out.push(
2978
+ text(px(t, xs), plot.y + plot.h + categorySize + 3, formatAxisValue(t), {
2979
+ anchor: "middle",
2980
+ ...categoryAttrs
2981
+ })
2982
+ );
2983
+ }
2984
+ out.push(
2985
+ line(plot.x, plot.y + plot.h, plot.x + plot.w, plot.y + plot.h, xAxis.color, xAxis.width)
2986
+ );
2987
+ out.push(line(plot.x, plot.y, plot.x, plot.y + plot.h, yAxis.color, yAxis.width));
2988
+ for (const s of model.series)
2989
+ s.values.forEach((v, i) => {
2990
+ const x = s.xValues?.[i] ?? null;
2991
+ if (v === null || x === null) return;
2992
+ out.push(
2993
+ `<circle cx="${n(px(x, xs))}" cy="${n(py(v, ys))}" r="3" fill="${s.pointColors?.[i] ?? s.color}"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
2994
+ );
2995
+ });
2996
+ }
2997
+ function cartesianSvg(model, area) {
2998
+ const out = [];
2999
+ if (model.type === "scatter") {
3000
+ scatter(model, area, out);
3001
+ return out.join("");
3002
+ }
3003
+ const frame = axes(model, area, out);
3004
+ if (!frame) return "";
3005
+ if (model.type === "bar" || model.type === "column") bars(model, frame, out, plotted(model));
3006
+ else linesAndAreas(model, frame, out);
3007
+ return out.join("");
3008
+ }
3009
+
3010
+ // chart/render/chart-svg-radial.ts
3011
+ var polar = (cx, cy, r, angle) => [
3012
+ cx + r * Math.sin(angle),
3013
+ cy - r * Math.cos(angle)
3014
+ ];
3015
+ function slicePath(cx, cy, r, inner, a0, a1) {
3016
+ const sweep = a1 - a0;
3017
+ if (sweep >= Math.PI * 2 - 1e-9) {
3018
+ const mid = a0 + Math.PI;
3019
+ return slicePath(cx, cy, r, inner, a0, mid) + slicePath(cx, cy, r, inner, mid, a1);
3020
+ }
3021
+ const large = sweep > Math.PI ? 1 : 0;
3022
+ const [x0, y0] = polar(cx, cy, r, a0);
3023
+ const [x1, y1] = polar(cx, cy, r, a1);
3024
+ if (inner <= 0)
3025
+ return `M${n(cx)},${n(cy)} L${n(x0)},${n(y0)} A${n(r)},${n(r)} 0 ${large} 1 ${n(x1)},${n(y1)} Z`;
3026
+ const [ix1, iy1] = polar(cx, cy, inner, a1);
3027
+ const [ix0, iy0] = polar(cx, cy, inner, a0);
3028
+ return `M${n(x0)},${n(y0)} A${n(r)},${n(r)} 0 ${large} 1 ${n(x1)},${n(y1)} L${n(ix1)},${n(iy1)} A${n(inner)},${n(inner)} 0 ${large} 0 ${n(ix0)},${n(iy0)} Z`;
3029
+ }
3030
+ function pieSvg(model, area) {
3031
+ const out = [chartAreaRect(model, "plotArea", area)];
3032
+ const cx = area.x + area.w / 2;
3033
+ const cy = area.y + area.h / 2;
3034
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - 4);
3035
+ const rings = model.type === "doughnut" ? model.series : model.series.slice(0, 1);
3036
+ const hole = model.type === "doughnut" ? radius * 0.5 : 0;
3037
+ const ringSize = (radius - hole) / Math.max(1, rings.length);
3038
+ rings.forEach((s, ri) => {
3039
+ const outer = radius - ri * ringSize;
3040
+ const inner = model.type === "doughnut" ? outer - ringSize : 0;
3041
+ const total = s.values.reduce((sum, v) => sum + (v !== null && v > 0 ? v : 0), 0);
3042
+ if (total <= 0) return;
3043
+ let angle = 0;
3044
+ s.values.forEach((v, i) => {
3045
+ if (v === null || v <= 0) return;
3046
+ const sweep = v / total * Math.PI * 2;
3047
+ const color = s.pointColors?.[i] ?? s.color;
3048
+ out.push(
3049
+ `<path d="${slicePath(cx, cy, outer, inner, angle, angle + sweep)}" fill="${color}" stroke="#FFFFFF" stroke-width="1"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
3050
+ );
3051
+ angle += sweep;
3052
+ });
3053
+ });
3054
+ return out.join("");
3055
+ }
3056
+ function radarSvg(model, area) {
3057
+ const out = [chartAreaRect(model, "plotArea", area)];
3058
+ const scale = model.valueAxis;
3059
+ const count = model.categories.length;
3060
+ if (!scale || count < 1) return "";
3061
+ const valueAttrs = chartTextAttributes(model, "valueAxis", 9);
3062
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
3063
+ const valueSize = valueAttrs.size ?? 9;
3064
+ const categorySize = categoryAttrs.size ?? 10;
3065
+ const grid = chartStroke(model, "gridlineMajor");
3066
+ const axis = chartStroke(model, "categoryAxis");
3067
+ const cx = area.x + area.w / 2;
3068
+ const cy = area.y + area.h / 2 + 4;
3069
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - Math.max(18, categorySize * 1.8));
3070
+ const angle = (i) => i / count * Math.PI * 2;
3071
+ const r = (v) => (v - scale.min) / (scale.max - scale.min || 1) * radius;
3072
+ const labelEvery = Math.max(
3073
+ 1,
3074
+ Math.ceil(12 / Math.max(1, radius / Math.max(1, scale.ticks.length - 1)))
3075
+ );
3076
+ for (const [k, t] of scale.ticks.entries()) {
3077
+ const ring = Array.from({ length: count }, (_, i) => polar(cx, cy, r(t), angle(i))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
3078
+ out.push(
3079
+ `<polygon points="${ring}" fill="none" stroke="${grid.color}" stroke-width="${n(grid.width)}"/>`
3080
+ );
3081
+ if (model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
3082
+ out.push(
3083
+ text(cx + 3, cy - r(t) + valueSize * 0.3, formatAxisValue(t, scale.percent), valueAttrs)
3084
+ );
3085
+ }
3086
+ model.categories.forEach((c, i) => {
3087
+ const [x, y] = polar(cx, cy, radius, angle(i));
3088
+ out.push(line(cx, cy, x, y, axis.color, axis.width));
3089
+ const [lx, ly] = polar(cx, cy, radius + 10, angle(i));
3090
+ const anchor = Math.abs(lx - cx) < 2 ? "middle" : lx > cx ? "start" : "end";
3091
+ if (model.appearance?.categoryAxis?.labelsVisible !== false)
3092
+ out.push(
3093
+ text(lx, ly + categorySize * 0.3, fit(c, area.w / 4, categorySize), {
3094
+ anchor,
3095
+ ...categoryAttrs
3096
+ })
3097
+ );
3098
+ });
3099
+ for (const s of model.series) {
3100
+ const points = s.values.slice(0, count).map((v, i) => polar(cx, cy, r(v ?? scale.min), angle(i))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
3101
+ out.push(
3102
+ `<polygon points="${points}" fill="none" stroke="${s.color}" stroke-width="2"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
3103
+ );
3104
+ }
3105
+ return out.join("");
3106
+ }
3107
+
3108
+ // chart/render/chart-svg-text-metrics.ts
3109
+ var CHART_FONT_FAMILY = "Calibri, Carlito, Arial, sans-serif";
3110
+ function cssFont(attrs) {
3111
+ return `${attrs.italic ? "italic" : "normal"} ${attrs.weight ?? "normal"} ${attrs.size ?? 10}px ${attrs.family ?? CHART_FONT_FAMILY}`;
3112
+ }
3113
+ function chartFontMetrics(attrs, options) {
3114
+ const metrics = options.measureFont?.(cssFont(attrs));
3115
+ return metrics && Number.isFinite(metrics.ascent) && Number.isFinite(metrics.descent) && metrics.ascent >= 0 && metrics.descent >= 0 && metrics.ascent + metrics.descent > 0 ? metrics : void 0;
3116
+ }
3117
+ function chartTextWidth(content, attrs, options) {
3118
+ const width = options.measureText?.(content, cssFont(attrs));
3119
+ return width !== void 0 && Number.isFinite(width) && width >= 0 ? width : textWidth(content, attrs.size);
3120
+ }
3121
+ function fitChartText(content, maxWidth, attrs, options) {
3122
+ if (!options.measureText) return fit(content, maxWidth, attrs.size);
3123
+ if (chartTextWidth(content, attrs, options) <= maxWidth) return content;
3124
+ const points = [...content];
3125
+ let low = 0;
3126
+ let high = points.length;
3127
+ while (low < high) {
3128
+ const mid = Math.ceil((low + high) / 2);
3129
+ if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs, options) <= maxWidth) low = mid;
3130
+ else high = mid - 1;
3131
+ }
3132
+ return `${points.slice(0, low).join("")}\u2026`;
3133
+ }
3134
+
3135
+ // chart/render/chart-svg-legend.ts
3136
+ function chartLegendSvg(model, area, frame, options) {
3137
+ const automatic = [];
3138
+ const bounds = {};
3139
+ const reserved = automaticLegend(model, area, automatic, options, bounds);
3140
+ const plot = model.legendOverlay ? area : reserved;
3141
+ const box = bounds.box;
3142
+ if (!box) return { plot, markup: "", foreground: false };
3143
+ const manual = resolveManualLayoutRect(model.legendLayout, frame, {
3144
+ x: box.x,
3145
+ y: box.y,
3146
+ width: box.w,
3147
+ height: box.h
3148
+ });
3149
+ if (!manual) return { plot, markup: automatic.join(""), foreground: !!model.legendOverlay };
3150
+ const entries = legendEntries(model);
3151
+ const attrs = chartTextAttributes(model, "legend");
3152
+ const size = attrs.size ?? 10;
3153
+ const font = chartFontMetrics(attrs, options);
3154
+ const keySize = size / 2;
3155
+ const keyGap = size / 4;
3156
+ const widths = entries.map(
3157
+ (entry) => chartTextWidth(entry.label, attrs, options) + keySize + keyGap
3158
+ );
3159
+ const horizontal = manual.width > manual.height && widths.reduce((sum, width) => sum + width, 0) + size <= manual.width;
3160
+ const rowWidth = horizontal ? manual.width / entries.length : manual.width;
3161
+ const rowHeight = horizontal ? manual.height : manual.height / entries.length;
3162
+ const horizontalGap = Math.max(
3163
+ 0,
3164
+ (manual.width - widths.reduce((sum, width) => sum + width, 0)) / (entries.length + 1)
3165
+ );
3166
+ let horizontalX = manual.x + horizontalGap;
3167
+ const markup = [
3168
+ chartAreaRect(model, "legend", { x: manual.x, y: manual.y, w: manual.width, h: manual.height })
3169
+ ];
3170
+ const baselineOffset = font ? (font.ascent - font.descent) / 2 : size * 0.35;
3171
+ entries.forEach((entry, i) => {
3172
+ const available = horizontal ? chartTextWidth(entry.label, attrs, options) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
3173
+ const label = fitChartText(entry.label, available, attrs, options);
3174
+ const contentWidth = Math.min(
3175
+ horizontal ? widths[i] ?? 0 : Math.max(...widths),
3176
+ rowWidth - size / 2
3177
+ );
3178
+ const x = horizontal ? horizontalX : manual.x + Math.max(size / 4, (rowWidth - contentWidth) / 2);
3179
+ const centerY = manual.y + (horizontal ? 0 : i * rowHeight) + rowHeight / 2;
3180
+ markup.push(rect(x, centerY - keySize / 2, keySize, keySize, entry.color));
3181
+ markup.push(text(x + keySize + keyGap, centerY + baselineOffset, label, attrs));
3182
+ if (horizontal) horizontalX += (widths[i] ?? 0) + horizontalGap;
3183
+ });
3184
+ return {
3185
+ plot,
3186
+ markup: `<g data-chart-legend-layout="true">${markup.join("")}</g>`,
3187
+ foreground: true
3188
+ };
3189
+ }
3190
+ function legendEntries(model) {
3191
+ if (model.type === "pie" || model.type === "doughnut") {
3192
+ const first3 = model.series[0];
3193
+ return model.categories.map((label, i) => ({
3194
+ label,
3195
+ color: first3?.pointColors?.[i] ?? first3?.color ?? "#4472C4"
3196
+ }));
3197
+ }
3198
+ return model.series.map((s) => ({ label: s.name, color: s.color }));
3199
+ }
3200
+ function automaticLegend(model, area, out, options, bounds) {
3201
+ const entries = legendEntries(model);
3202
+ if (!model.showLegend || entries.length === 0) return area;
3203
+ const pos = model.legendPosition;
3204
+ const attrs = chartTextAttributes(model, "legend");
3205
+ const size = attrs.size ?? 10;
3206
+ const rowH = Math.max(16, size * 1.4);
3207
+ if (pos === "t" || pos === "b") {
3208
+ const widths = entries.map(
3209
+ (e) => Math.min(chartTextWidth(e.label, attrs, options) + 20, area.w / 2)
3210
+ );
3211
+ const total = widths.reduce((a, b) => a + b, 0);
3212
+ let x2 = area.x + Math.max(0, (area.w - total) / 2);
3213
+ const y = pos === "t" ? area.y + 4 : area.y + area.h - rowH + 4;
3214
+ bounds.box = { x: x2 - 4, y: y - 4, w: Math.min(total, area.w) + 8, h: rowH + 4 };
3215
+ out.push(
3216
+ chartAreaRect(model, "legend", {
3217
+ x: x2 - 4,
3218
+ y: y - 4,
3219
+ w: Math.min(total, area.w) + 8,
3220
+ h: rowH + 4
3221
+ })
3222
+ );
3223
+ entries.forEach((e, i) => {
3224
+ const w = widths[i] ?? 0;
3225
+ out.push(rect(x2, y, 8, 8, e.color));
3226
+ out.push(text(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs, options), attrs));
3227
+ x2 += w;
3228
+ });
3229
+ return pos === "t" ? { x: area.x, y: area.y + rowH + 4, w: area.w, h: area.h - rowH - 4 } : { x: area.x, y: area.y, w: area.w, h: area.h - rowH - 4 };
3230
+ }
3231
+ const width = Math.min(
3232
+ area.w * 0.35,
3233
+ Math.max(...entries.map((e) => chartTextWidth(e.label, attrs, options))) + 22
3234
+ );
3235
+ const height = entries.length * rowH;
3236
+ const x = pos === "l" ? area.x + 4 : area.x + area.w - width;
3237
+ const y0 = pos === "tr" ? area.y + 4 : area.y + Math.max(0, (area.h - height) / 2);
3238
+ bounds.box = { x: x - 4, y: y0, w: width + 4, h: Math.min(height, area.y + area.h - y0) };
3239
+ out.push(
3240
+ chartAreaRect(model, "legend", {
3241
+ x: x - 4,
3242
+ y: y0,
3243
+ w: width + 4,
3244
+ h: Math.min(height, area.y + area.h - y0)
3245
+ })
3246
+ );
3247
+ entries.forEach((e, i) => {
3248
+ const y = y0 + i * rowH;
3249
+ if (y + rowH > area.y + area.h + 2) return;
3250
+ out.push(rect(x, y + 3, 8, 8, e.color));
3251
+ out.push(text(x + 12, y + 11, fitChartText(e.label, width - 16, attrs, options), attrs));
3252
+ });
3253
+ return pos === "l" ? { x: area.x + width + 8, y: area.y, w: area.w - width - 8, h: area.h } : { x: area.x, y: area.y, w: area.w - width - 8, h: area.h };
3254
+ }
3255
+
3256
+ // text/wrap-styled-runs.ts
3257
+ var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3258
+ function wrapStyledRuns(runs, maxWidth, measure, options = {}) {
3259
+ const groups = [];
3260
+ for (const [source, run] of runs.entries()) {
3261
+ for (const token of run.text.split(/(\r\n|[\r\n]|[ \t]+)/u).filter(Boolean)) {
3262
+ const kind = /^[\r\n]+$/u.test(token) ? "break" : /^[ \t]+$/u.test(token) ? "space" : "word";
3263
+ let group = groups.at(-1);
3264
+ if (!group || group.kind !== kind || kind === "break") {
3265
+ group = { kind, pieces: [] };
3266
+ groups.push(group);
3267
+ }
3268
+ if (kind !== "break") group.pieces.push({ run, source, text: token });
3269
+ }
3270
+ }
3271
+ const merged = (left, right) => {
3272
+ const result2 = left.map((piece) => ({ ...piece }));
3273
+ for (const piece of right) {
3274
+ const last = result2.at(-1);
3275
+ if (last?.source === piece.source) last.text += piece.text;
3276
+ else result2.push({ ...piece });
3277
+ }
3278
+ return result2;
3279
+ };
3280
+ const width = (pieces) => pieces.reduce((sum, piece) => {
3281
+ const advance = measure(piece.text, piece.run);
3282
+ return sum + (Number.isFinite(advance) && advance >= 0 ? advance : 0);
3283
+ }, 0);
3284
+ const result = [];
3285
+ let line2 = [];
3286
+ let spaces = [];
3287
+ const flush = () => {
3288
+ result.push(line2.map((piece) => ({ ...piece.run, text: piece.text })));
3289
+ line2 = [];
3290
+ spaces = [];
3291
+ };
3292
+ for (const group of groups) {
3293
+ if (group.kind === "break") {
3294
+ flush();
3295
+ continue;
3296
+ }
3297
+ if (group.kind === "space") {
3298
+ spaces = group.pieces;
3299
+ continue;
3300
+ }
3301
+ const separator = line2.length ? spaces : [];
3302
+ const wordWidth = width(group.pieces);
3303
+ if (line2.length && width(merged(line2, [...separator, ...group.pieces])) > maxWidth) flush();
3304
+ else line2 = merged(line2, separator);
3305
+ spaces = [];
3306
+ if (options.breakWords && wordWidth > maxWidth) {
3307
+ for (const piece of group.pieces) {
3308
+ for (const { segment } of graphemes.segment(piece.text)) {
3309
+ const next = { ...piece, text: segment };
3310
+ if (line2.length && width(merged(line2, [next])) > maxWidth) flush();
3311
+ line2 = merged(line2, [next]);
3312
+ }
3313
+ }
3314
+ } else line2 = merged(line2, group.pieces);
3315
+ }
3316
+ flush();
3317
+ return result;
3318
+ }
3319
+
3320
+ // chart/render/chart-svg-title-text.ts
3321
+ function spacing(value, naturalHeight, fallback) {
3322
+ return value ? value.unit === "points" ? chartPointsToPixels(value.value) : naturalHeight * value.value : fallback;
3323
+ }
3324
+ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
3325
+ if (!model.title) return void 0;
3326
+ const base = chartTextAttributes(model, "title", 14);
3327
+ const capacity = Math.max(1, width * 0.8 - 8);
3328
+ if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options) <= capacity)
3329
+ return void 0;
3330
+ const paragraphs = model.titleText?.paragraphs ?? [
3331
+ {
3332
+ runs: [{ text: model.title, appearance: model.appearance?.title ?? {} }]
3333
+ }
3334
+ ];
3335
+ const hardLines = [];
3336
+ for (const paragraph of paragraphs) {
3337
+ let line2 = {
3338
+ ...paragraph,
3339
+ runs: []
3340
+ };
3341
+ hardLines.push(line2);
3342
+ for (const run of paragraph.runs) {
3343
+ const pieces = run.text.split("\n");
3344
+ for (const [index, piece] of pieces.entries()) {
3345
+ if (index) {
3346
+ line2 = { ...paragraph, runs: [] };
3347
+ hardLines.push(line2);
3348
+ }
3349
+ if (piece) line2.runs.push({ ...run, text: piece });
3350
+ }
3351
+ }
3352
+ }
3353
+ const lines = hardLines.flatMap((line2) => {
3354
+ const wrapped = wrapStyledRuns(
3355
+ line2.runs,
3356
+ capacity,
3357
+ (content, run) => chartTextWidth(
3358
+ content,
3359
+ chartTextAttributes(
3360
+ { ...model, appearance: { title: run.appearance } },
3361
+ "title",
3362
+ base.size
3363
+ ),
3364
+ options
3365
+ ),
3366
+ { breakWords: true }
3367
+ );
3368
+ const { spaceBefore, spaceAfter, ...properties2 } = line2;
3369
+ return wrapped.map((runs, index) => ({
3370
+ ...properties2,
3371
+ runs,
3372
+ ...index === 0 && spaceBefore ? { spaceBefore } : {},
3373
+ ...index === wrapped.length - 1 && spaceAfter ? { spaceAfter } : {}
3374
+ }));
3375
+ });
3376
+ const metrics = lines.map((line2) => {
3377
+ const runs = line2.runs.map((run) => ({
3378
+ ...run,
3379
+ attrs: chartTextAttributes(
3380
+ { ...model, appearance: { title: run.appearance } },
3381
+ "title",
3382
+ base.size
3383
+ )
3384
+ }));
3385
+ return {
3386
+ ...line2,
3387
+ runs,
3388
+ width: runs.reduce((sum, run) => sum + chartTextWidth(run.text, run.attrs, options), 0),
3389
+ size: runs.length ? Math.max(...runs.map((run) => run.attrs.size ?? 14)) : base.size ?? 14,
3390
+ fontMetrics: (runs.length ? runs.map((run) => run.attrs) : [base]).map(
3391
+ (attrs) => chartFontMetrics(attrs, options)
3392
+ )
3393
+ };
3394
+ });
3395
+ const measured = metrics.every((line2) => line2.fontMetrics.every((font) => font !== void 0));
3396
+ const vertical = metrics.map((line2) => {
3397
+ const ascent = measured ? Math.max(...line2.fontMetrics.map((font) => font.ascent)) : line2.size;
3398
+ const descent = measured ? Math.max(...line2.fontMetrics.map((font) => font.descent)) : line2.size * 0.4 + 4;
3399
+ const natural = ascent + descent;
3400
+ const height2 = spacing(line2.lineSpacing, natural, natural);
3401
+ const leading = (height2 - natural) / 2;
3402
+ return {
3403
+ ascent: ascent + leading,
3404
+ descent: descent + leading,
3405
+ height: height2,
3406
+ before: spacing(line2.spaceBefore, natural, 0),
3407
+ after: spacing(line2.spaceAfter, natural, 0),
3408
+ leading
3409
+ };
3410
+ });
3411
+ const boxWidth = Math.min(width - 16, Math.max(0, ...metrics.map((line2) => line2.width)) + 8);
3412
+ const height = vertical.reduce(
3413
+ (sum, line2) => sum + line2.height + line2.before + line2.after,
3414
+ measured ? 4 : 0
3415
+ );
3416
+ let baseline = 8 + (metrics[0]?.size ?? base.size ?? 14) + (vertical[0]?.before ?? 0) + (vertical[0]?.leading ?? 0);
3417
+ const spans = [];
3418
+ for (const [index, line2] of metrics.entries()) {
3419
+ if (index)
3420
+ baseline += vertical[index - 1].descent + vertical[index - 1].after + vertical[index].before + vertical[index].ascent;
3421
+ let x = line2.align === "l" ? (width - boxWidth) / 2 + 4 : line2.align === "r" ? (width + boxWidth) / 2 - 4 - line2.width : (width - line2.width) / 2;
3422
+ for (const run of line2.runs) {
3423
+ spans.push(
3424
+ text(x, baseline, run.text, {
3425
+ ...run.attrs,
3426
+ anchor: "start"
3427
+ }).replace("<text ", '<tspan data-chart-title-run="true" ').replace("</text>", "</tspan>")
3428
+ );
3429
+ x += chartTextWidth(run.text, run.attrs, options);
3430
+ }
3431
+ }
3432
+ const parent = text(0, 0, "", { ...base, underline: false }).replace(
3433
+ "</text>",
3434
+ `${spans.join("")}</text>`
3435
+ );
3436
+ const markup = chartAreaRect(model, "title", {
3437
+ x: (width - boxWidth) / 2,
3438
+ y: 4,
3439
+ w: Math.max(0, boxWidth),
3440
+ h: height
3441
+ }) + parent;
3442
+ const automatic = { x: (width - boxWidth) / 2, y: 4, width: boxWidth, height };
3443
+ const manual = resolveManualLayoutRect(
3444
+ model.titleLayout,
3445
+ { width, height: frameHeight },
3446
+ automatic
3447
+ );
3448
+ return {
3449
+ markup: manual ? `<g data-chart-title-layout="true" transform="translate(${n(manual.x - automatic.x)} ${n(manual.y - automatic.y)})">${markup}</g>` : markup,
3450
+ height: Math.max(24, height)
3451
+ };
3452
+ }
3453
+
3454
+ // chart/render/chart-svg.ts
3455
+ function renderChartSvg(model, width, height, options = {}) {
3456
+ const paint = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
3457
+ model = paint.model;
3458
+ const w = Math.max(1, width);
3459
+ const h = Math.max(1, height);
3460
+ const out = [];
3461
+ let foregroundTitle = "";
3462
+ out.push(
3463
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${n(w)}" height="${n(h)}" viewBox="0 0 ${n(w)} ${n(h)}" font-family="${esc(CHART_FONT_FAMILY)}" role="img">`
3464
+ );
3465
+ if (model.title) out.push(`<title>${esc(model.title)}</title>`);
3466
+ if (paint.defs) out.push(paint.defs);
3467
+ out.push(chartAreaRect(model, "chartArea", { x: 0, y: 0, w, h }));
3468
+ let area = { x: 8, y: 8, w: w - 16, h: h - 16 };
3469
+ const richTitle = chartRichTitleSvg(model, w, options, h);
3470
+ if (richTitle) {
3471
+ if (model.titleLayout || model.titleOverlay) foregroundTitle = richTitle.markup;
3472
+ else out.push(richTitle.markup);
3473
+ if (!model.titleOverlay)
3474
+ area = { ...area, y: area.y + richTitle.height, h: area.h - richTitle.height };
3475
+ } else if (model.title) {
3476
+ const attrs = chartTextAttributes(model, "title", 14);
3477
+ const size = attrs.size ?? 14;
3478
+ const label = fitChartText(model.title, w - 16, attrs, options);
3479
+ const titleWidth = Math.min(w - 16, chartTextWidth(label, attrs, options) + 8);
3480
+ const font = chartFontMetrics(attrs, options);
3481
+ const titleHeight = Math.max(24, font ? font.ascent + font.descent + 4 : size * 1.4 + 4);
3482
+ out.push(
3483
+ chartAreaRect(model, "title", {
3484
+ x: (w - titleWidth) / 2,
3485
+ y: 4,
3486
+ w: Math.max(0, titleWidth),
3487
+ h: font ? font.ascent + font.descent + 4 : size * 1.4 + 4
3488
+ })
3489
+ );
3490
+ out.push(
3491
+ text(w / 2, 8 + size, label, {
3492
+ anchor: "middle",
3493
+ fill: "#404040",
3494
+ ...attrs
3495
+ })
3496
+ );
3497
+ if (!model.titleOverlay)
3498
+ area = { x: area.x, y: area.y + titleHeight, w: area.w, h: area.h - titleHeight };
3499
+ }
3500
+ if (!model.supported) {
3501
+ out.push(
3502
+ text(w / 2, area.y + area.h / 2, `${model.type} charts are not drawn`, { anchor: "middle" })
3503
+ );
3504
+ if (foregroundTitle) out.push(foregroundTitle);
3505
+ out.push("</svg>");
3506
+ return out.join("");
3507
+ }
3508
+ const legend = chartLegendSvg(model, area, { width: w, height: h }, options);
3509
+ area = legend.plot;
3510
+ if (!legend.foreground) out.push(legend.markup);
3511
+ if (area.w > 4 && area.h > 4) {
3512
+ if (model.type === "pie" || model.type === "doughnut") out.push(pieSvg(model, area));
3513
+ else if (model.type === "radar") out.push(radarSvg(model, area));
3514
+ else out.push(cartesianSvg(model, area));
3515
+ }
3516
+ if (legend.foreground) out.push(legend.markup);
3517
+ if (foregroundTitle) out.push(foregroundTitle);
3518
+ out.push("</svg>");
3519
+ return out.join("");
3520
+ }
3521
+
3522
+ // chart/render/render-space.ts
3523
+ var DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
3524
+ "bar",
3525
+ "column",
3526
+ "line",
3527
+ "area",
3528
+ "pie",
3529
+ "doughnut",
3530
+ "scatter",
3531
+ "radar"
3532
+ ]);
3533
+ function chartThemePalette(theme, fonts = {}) {
3534
+ return {
3535
+ colors: THEME_SLOTS.map(
3536
+ (slot, index) => themeSlotHex(theme?.colors[slot]) ?? DEFAULT_THEME_COLORS[index] ?? "000000"
3537
+ ),
3538
+ majorFont: fonts.major ?? "Calibri Light",
3539
+ minorFont: fonts.minor ?? "Calibri"
3540
+ };
3541
+ }
3542
+ function chartSpaceKind(space) {
3543
+ if (!space.plotArea.groups.length) return { drawn: false };
3544
+ const type = chartSummaryFromSpace(space).chartType;
3545
+ return { type, drawn: DRAWN_CHART_TYPES.has(type) };
3546
+ }
3547
+ function renderChartSpaceSvg(space, options) {
3548
+ const { width, height, theme, fonts, formatting, colorPalette, styleDefinition, ...svg } = options;
3549
+ const summary = chartSummaryFromSpace(space, {
3550
+ ...formatting ? { formatting } : {},
3551
+ ...colorPalette !== void 0 ? { colorPalette } : {},
3552
+ ...styleDefinition ? { styleDefinition } : {}
3553
+ });
3554
+ const view = chartSummaryView(summary, chartThemePalette(theme, fonts));
3555
+ return renderChartSvg(view, width, height, svg);
3556
+ }
3557
+
1004
3558
  // docx/restore-run-format.ts
1005
3559
  function parseRunPropertiesSnapshot(xml) {
1006
3560
  return parsePropertiesSnapshot(xml, "rPr");
@@ -1064,18 +3618,18 @@ function parseDirectParagraphProperties(props) {
1064
3618
  if (shading) paragraph.shadingFill = shading;
1065
3619
  const tabStops = parseTabStops(first2(props, "tabs"));
1066
3620
  if (tabStops.length) paragraph.tabStops = tabStops;
1067
- const spacing = first2(props, "spacing");
1068
- const before = twipValue(getW(spacing, "before"));
1069
- const after = twipValue(getW(spacing, "after"));
1070
- const line = signedTwipValue(getW(spacing, "line"));
3621
+ const spacing2 = first2(props, "spacing");
3622
+ const before = twipValue(getW(spacing2, "before"));
3623
+ const after = twipValue(getW(spacing2, "after"));
3624
+ const line2 = signedTwipValue(getW(spacing2, "line"));
1071
3625
  if (before !== void 0) paragraph.spacingBeforeTwips = before;
1072
3626
  if (after !== void 0) paragraph.spacingAfterTwips = after;
1073
- if (line !== void 0) {
1074
- paragraph.lineSpacingTwips = line;
3627
+ if (line2 !== void 0) {
3628
+ paragraph.lineSpacingTwips = line2;
1075
3629
  }
1076
- const rule = getW(spacing, "lineRule");
3630
+ const rule = getW(spacing2, "lineRule");
1077
3631
  if (rule === "auto" || rule === "exact" || rule === "atLeast") paragraph.lineSpacingRule = rule;
1078
- else if (line !== void 0) paragraph.lineSpacingRule = "auto";
3632
+ else if (line2 !== void 0) paragraph.lineSpacingRule = "auto";
1079
3633
  const indent = first2(props, "ind");
1080
3634
  const indentLeft = signedTwipValue(getW(indent, "left"));
1081
3635
  const indentRight = signedTwipValue(getW(indent, "right"));
@@ -1109,9 +3663,9 @@ function resolveNumberingLevel(catalog, numId, level) {
1109
3663
  let base = override?.lvl ?? abstract;
1110
3664
  if (!base) return void 0;
1111
3665
  if (override?.lvl) {
1112
- const { lvlRestart: _ignored, ...properties } = base;
3666
+ const { lvlRestart: _ignored, ...properties2 } = base;
1113
3667
  base = {
1114
- ...properties,
3668
+ ...properties2,
1115
3669
  ...abstract?.lvlRestart !== void 0 ? { lvlRestart: abstract.lvlRestart } : {}
1116
3670
  };
1117
3671
  }
@@ -1247,8 +3801,39 @@ function numberNotesInOrder(blocks, kind) {
1247
3801
  return order;
1248
3802
  }
1249
3803
 
3804
+ // docx/chart-paint.ts
3805
+ function themeCatalogColorScheme(theme) {
3806
+ const colors = {};
3807
+ for (const [slot, value] of Object.entries(theme?.colors ?? {}))
3808
+ if (value) colors[slot] = { kind: "srgb", value: value.replace(/^#/, ""), transforms: [] };
3809
+ return { colors };
3810
+ }
3811
+ function docxChartPaint(chart, widthPx, heightPx, theme) {
3812
+ const space = chart?.chartSpace;
3813
+ if (!space) return { label: "Chart" };
3814
+ const kind = chartSpaceKind(space);
3815
+ if (!kind.drawn) return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
3816
+ try {
3817
+ const fonts = {
3818
+ ...theme?.fonts.major.latin ? { major: theme.fonts.major.latin } : {},
3819
+ ...theme?.fonts.minor.latin ? { minor: theme.fonts.minor.latin } : {}
3820
+ };
3821
+ const svg = renderChartSpaceSvg(space, {
3822
+ width: Math.max(1, Math.round(widthPx)),
3823
+ height: Math.max(1, Math.round(heightPx)),
3824
+ theme: themeCatalogColorScheme(theme),
3825
+ fonts,
3826
+ ...chart.formatting ? { formatting: chart.formatting } : {},
3827
+ ...chart.colorPalette !== void 0 ? { colorPalette: chart.colorPalette } : {}
3828
+ });
3829
+ return { svg, label: chart.title ? `Chart: ${chart.title}` : "Chart" };
3830
+ } catch {
3831
+ return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
3832
+ }
3833
+ }
3834
+
1250
3835
  // docx/numbering-text.ts
1251
- function romanNumeral(n) {
3836
+ function romanNumeral(n2) {
1252
3837
  const values = [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
1253
3838
  const numerals = [
1254
3839
  "M",
@@ -1265,7 +3850,7 @@ function romanNumeral(n) {
1265
3850
  "IV",
1266
3851
  "I"
1267
3852
  ];
1268
- let remaining = Math.max(1, Math.min(Math.trunc(n), 3999));
3853
+ let remaining = Math.max(1, Math.min(Math.trunc(n2), 3999));
1269
3854
  let result = "";
1270
3855
  for (const [i, value] of values.entries()) {
1271
3856
  while (remaining >= value) {
@@ -1276,13 +3861,13 @@ function romanNumeral(n) {
1276
3861
  return result;
1277
3862
  }
1278
3863
  var LATIN_LOWER = Array.from("abcdefghijklmnopqrstuvwxyz");
1279
- function letterLabel(n) {
1280
- const index = Math.max(0, Math.trunc(n) - 1);
3864
+ function letterLabel(n2) {
3865
+ const index = Math.max(0, Math.trunc(n2) - 1);
1281
3866
  const letter = LATIN_LOWER[index % LATIN_LOWER.length] ?? "a";
1282
3867
  return letter.repeat(Math.floor(index / LATIN_LOWER.length) + 1);
1283
3868
  }
1284
- var ORDINAL_SUFFIX = (n) => {
1285
- const abs = Math.abs(Math.trunc(n));
3869
+ var ORDINAL_SUFFIX = (n2) => {
3870
+ const abs = Math.abs(Math.trunc(n2));
1286
3871
  if (abs % 100 >= 11 && abs % 100 <= 13) return "th";
1287
3872
  switch (abs % 10) {
1288
3873
  case 1:
@@ -1295,8 +3880,8 @@ var ORDINAL_SUFFIX = (n) => {
1295
3880
  return "th";
1296
3881
  }
1297
3882
  };
1298
- function ordinalNumeral(n) {
1299
- return `${Math.trunc(n)}${ORDINAL_SUFFIX(n)}`;
3883
+ function ordinalNumeral(n2) {
3884
+ return `${Math.trunc(n2)}${ORDINAL_SUFFIX(n2)}`;
1300
3885
  }
1301
3886
  var ONES = [
1302
3887
  "",
@@ -1321,8 +3906,8 @@ var ONES = [
1321
3906
  "nineteen"
1322
3907
  ];
1323
3908
  var TENS = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"];
1324
- function cardinalWords(n) {
1325
- const value = Math.trunc(n);
3909
+ function cardinalWords(n2) {
3910
+ const value = Math.trunc(n2);
1326
3911
  if (value < 0 || value > 999999) return String(value);
1327
3912
  if (value === 0) return "zero";
1328
3913
  const chunk = (v) => {
@@ -1354,8 +3939,8 @@ var ORDINAL_WORDS = {
1354
3939
  nine: "ninth",
1355
3940
  twelve: "twelfth"
1356
3941
  };
1357
- function ordinalWords(n) {
1358
- const value = Math.trunc(n);
3942
+ function ordinalWords(n2) {
3943
+ const value = Math.trunc(n2);
1359
3944
  if (value < 0 || value > 999999) return ordinalNumeral(value);
1360
3945
  const words = cardinalWords(value);
1361
3946
  const splitAt = Math.max(words.lastIndexOf(" "), words.lastIndexOf("-"));
@@ -1495,11 +4080,11 @@ function computeListLabels(model) {
1495
4080
  if (!def) continue;
1496
4081
  if (def.numFmt === "none") continue;
1497
4082
  counters.advance(numId, level, def, catalog);
1498
- const text = def.numFmt === "bullet" ? def.lvlText : substituteLvlText(def.lvlText, numId, level, catalog, counters, Boolean(def.isLgl));
4083
+ const text2 = def.numFmt === "bullet" ? def.lvlText : substituteLvlText(def.lvlText, numId, level, catalog, counters, Boolean(def.isLgl));
1499
4084
  labels.set(paragraph.id, {
1500
4085
  numId,
1501
4086
  level,
1502
- text,
4087
+ text: text2,
1503
4088
  suffix: def.suffix ?? "tab",
1504
4089
  ...definedProps({
1505
4090
  alignment: def.lvlJc,
@@ -1524,8 +4109,8 @@ var SYMBOL_BULLETS = {
1524
4109
  "\uF0E0": "\u27A9",
1525
4110
  "\uF0B2": "\u25CB"
1526
4111
  };
1527
- function displayListLabel(text) {
1528
- return text.replace(/[-]/g, (char) => SYMBOL_BULLETS[char] ?? "\u2022");
4112
+ function displayListLabel(text2) {
4113
+ return text2.replace(/[-]/g, (char) => SYMBOL_BULLETS[char] ?? "\u2022");
1529
4114
  }
1530
4115
 
1531
4116
  // docx/restore-paragraph-format.ts
@@ -1563,20 +4148,20 @@ function restoreParagraphFormatting(paragraph) {
1563
4148
  throw new Error(
1564
4149
  "Cannot reject a paragraph formatting revision without its prior properties snapshot."
1565
4150
  );
1566
- const properties = parsePropertiesSnapshot(xml, "pPr");
4151
+ const properties2 = parsePropertiesSnapshot(xml, "pPr");
1567
4152
  if (paragraph.sourceParagraphPropertiesXml) {
1568
4153
  const current = parsePropertiesSnapshot(paragraph.sourceParagraphPropertiesXml, "pPr");
1569
4154
  for (const name of ["rPr", "sectPr"]) {
1570
4155
  const element = first2(current, name);
1571
- if (element && !first2(properties, name))
1572
- properties.appendChild(properties.ownerDocument.importNode(element, true));
4156
+ if (element && !first2(properties2, name))
4157
+ properties2.appendChild(properties2.ownerDocument.importNode(element, true));
1573
4158
  }
1574
- orderParagraphProperties(properties);
4159
+ orderParagraphProperties(properties2);
1575
4160
  }
1576
- const previous = parseDirectParagraphProperties(properties);
4161
+ const previous = parseDirectParagraphProperties(properties2);
1577
4162
  for (const key of PARAGRAPH_FORMAT_KEYS) delete paragraph[key];
1578
4163
  Object.assign(paragraph, previous);
1579
- paragraph.restoredParagraphPropertiesXml = buildXml(properties);
4164
+ paragraph.restoredParagraphPropertiesXml = buildXml(properties2);
1580
4165
  if (paragraph.sourceParagraphPropertiesXml)
1581
4166
  paragraph.sourceParagraphPropertiesXml = paragraph.restoredParagraphPropertiesXml;
1582
4167
  delete paragraph.formatRevision;
@@ -1742,9 +4327,9 @@ function createFakeMeasurer(options = {}) {
1742
4327
  const charWidthFactor = options.charWidthFactor ?? 0.6;
1743
4328
  const lineHeightFactor = options.lineHeightFactor ?? 1.15;
1744
4329
  return {
1745
- widthOf(text, font) {
4330
+ widthOf(text2, font) {
1746
4331
  let width = 0;
1747
- for (const ch of text) {
4332
+ for (const ch of text2) {
1748
4333
  if (ch === " " || ch === "\n") continue;
1749
4334
  width += font.sizePx * charWidthFactor * (font.bold ? 1.08 : 1) * (ch === " " ? 0.6 : 1);
1750
4335
  }
@@ -1767,7 +4352,7 @@ function isEastAsianChar(ch) {
1767
4352
  const cp = ch.codePointAt(0) ?? 0;
1768
4353
  return cp >= 4352 && cp <= 4607 || cp >= 11904 && cp <= 40959 || cp >= 43360 && cp <= 43391 || cp >= 44032 && cp <= 55295 || cp >= 63744 && cp <= 64255 || cp >= 65072 && cp <= 65103 || cp >= 65280 && cp <= 65519 || cp >= 131072 && cp <= 262143;
1769
4354
  }
1770
- function tokenizeRun(text, runIndex) {
4355
+ function tokenizeRun(text2, runIndex) {
1771
4356
  const tokens = [];
1772
4357
  let word = "";
1773
4358
  let wordStart = 0;
@@ -1775,7 +4360,7 @@ function tokenizeRun(text, runIndex) {
1775
4360
  if (word) tokens.push({ kind: "word", text: word, runIndex, sourceStart: wordStart });
1776
4361
  word = "";
1777
4362
  };
1778
- const chars = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(text)].map(
4363
+ const chars = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(text2)].map(
1779
4364
  (part) => part.segment
1780
4365
  );
1781
4366
  let offset = 0;
@@ -1898,11 +4483,11 @@ function fontOf(run) {
1898
4483
  }
1899
4484
  };
1900
4485
  }
1901
- var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1902
- function runTextWidth(text, run, measurer) {
4486
+ var graphemes2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
4487
+ function runTextWidth(text2, run, measurer) {
1903
4488
  return Math.max(
1904
4489
  0,
1905
- measurer.widthOf(text, fontOf(run)) * (run.textScalePercent ?? 100) / 100 + [...graphemes.segment(text)].length * (run.characterSpacingPx ?? 0)
4490
+ measurer.widthOf(text2, fontOf(run)) * (run.textScalePercent ?? 100) / 100 + [...graphemes2.segment(text2)].length * (run.characterSpacingPx ?? 0)
1906
4491
  );
1907
4492
  }
1908
4493
  function resolveIndents(paragraph) {
@@ -1980,9 +4565,9 @@ function buildFragments(tokensOnLine, paragraph) {
1980
4565
  let x = 0;
1981
4566
  for (const { token, widthPx, leader, xOffsetPx, advancePx } of tokensOnLine) {
1982
4567
  const run = paragraph.runs[token.runIndex];
1983
- const text = token.kind === "word" || token.kind === "space" ? token.text : "";
4568
+ const text2 = token.kind === "word" || token.kind === "space" ? token.text : "";
1984
4569
  fragments.push({
1985
- text,
4570
+ text: text2,
1986
4571
  xPx: x + (xOffsetPx ?? 0),
1987
4572
  widthPx,
1988
4573
  runIndex: token.runIndex,
@@ -2194,11 +4779,11 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
2194
4779
  }
2195
4780
  flushLine(lines.length === 0, void 0);
2196
4781
  const lastIndex = lines.length - 1;
2197
- for (const [index, line] of lines.entries()) {
4782
+ for (const [index, line2] of lines.entries()) {
2198
4783
  lines[index] = {
2199
- ...line,
4784
+ ...line2,
2200
4785
  fragments: alignFragments(
2201
- line.fragments,
4786
+ line2.fragments,
2202
4787
  availableWidth(index),
2203
4788
  index === lastIndex,
2204
4789
  effectiveAlign
@@ -2210,10 +4795,10 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
2210
4795
  const insetTopPx = extent("top");
2211
4796
  const insetBottomPx = extent("bottom");
2212
4797
  let y = insetTopPx;
2213
- for (const line of lines) {
2214
- y += line.gapBeforePx ?? 0;
2215
- line.yPx = y;
2216
- y += line.heightPx;
4798
+ for (const line2 of lines) {
4799
+ y += line2.gapBeforePx ?? 0;
4800
+ line2.yPx = y;
4801
+ y += line2.heightPx;
2217
4802
  }
2218
4803
  const frame = borders || paragraph.shading ? {
2219
4804
  leftPx: leftPx - extent("left"),
@@ -2266,7 +4851,7 @@ function stackParagraphs(paragraphs, widthPx, measurer, note, topPx = 0, startTo
2266
4851
  );
2267
4852
  y += layout.spacingBeforePx;
2268
4853
  const top = y;
2269
- const lines = layout.lines.map((line) => ({ ...line, yPx: line.yPx + top }));
4854
+ const lines = layout.lines.map((line2) => ({ ...line2, yPx: line2.yPx + top }));
2270
4855
  boxes.push({
2271
4856
  kind: "paragraph",
2272
4857
  blockId: paragraph.id,
@@ -2334,7 +4919,7 @@ function splitCellAtHeight(boxes, cutHeightPx) {
2334
4919
  continue;
2335
4920
  }
2336
4921
  const beforeLines = box.lines.filter(
2337
- (line) => box.yPx + line.yPx + line.heightPx <= cutHeightPx
4922
+ (line2) => box.yPx + line2.yPx + line2.heightPx <= cutHeightPx
2338
4923
  );
2339
4924
  const afterLines = box.lines.slice(beforeLines.length);
2340
4925
  if (beforeLines.length) {
@@ -2349,7 +4934,7 @@ function splitCellAtHeight(boxes, cutHeightPx) {
2349
4934
  ...box,
2350
4935
  yPx: 0,
2351
4936
  heightPx: afterLines.at(-1).yPx + afterLines.at(-1).heightPx - shift,
2352
- lines: afterLines.map((line) => ({ ...line, yPx: line.yPx - shift }))
4937
+ lines: afterLines.map((line2) => ({ ...line2, yPx: line2.yPx - shift }))
2353
4938
  });
2354
4939
  } else {
2355
4940
  afterOrigin = box.yPx + box.heightPx;
@@ -2598,9 +5183,9 @@ function placeParagraph(cursor, placement, note) {
2598
5183
  let end = lineCursor;
2599
5184
  let forced;
2600
5185
  for (let i = lineCursor; i < layout.lines.length; i++) {
2601
- const line = expectDefined(layout.lines[i], "paragraph line index");
2602
- const gap = i === lineCursor && !firstSegment ? 0 : line.gapBeforePx ?? 0;
2603
- const height = line.heightPx + gap;
5186
+ const line2 = expectDefined(layout.lines[i], "paragraph line index");
5187
+ const gap = i === lineCursor && !firstSegment ? 0 : line2.gapBeforePx ?? 0;
5188
+ const height = line2.heightPx + gap;
2604
5189
  if (cumulative + height > budget && (end > lineCursor || !cursor.atColumnTop)) break;
2605
5190
  cumulative += height;
2606
5191
  end = i + 1;
@@ -2628,7 +5213,7 @@ function placeParagraph(cursor, placement, note) {
2628
5213
  }
2629
5214
  const first3 = expectDefined(layout.lines[lineCursor], "first line of paragraph segment");
2630
5215
  const origin = first3.yPx - (firstSegment ? (first3.gapBeforePx ?? 0) + layout.insetTopPx : 0);
2631
- const segmentLines = layout.lines.slice(lineCursor, lineCursor + placedCount).map((line) => ({ ...line, yPx: line.yPx - origin }));
5216
+ const segmentLines = layout.lines.slice(lineCursor, lineCursor + placedCount).map((line2) => ({ ...line2, yPx: line2.yPx - origin }));
2632
5217
  const isFinal = lineCursor + placedCount >= layout.lines.length;
2633
5218
  const lastLine = segmentLines.at(-1);
2634
5219
  const isLastSegment = lineCursor + placedCount >= layout.lines.length;
@@ -3221,9 +5806,9 @@ function paragraphBox(formatting, theme) {
3221
5806
  let betweenBorder;
3222
5807
  for (const side of ["top", "bottom", "left", "right", "between"]) {
3223
5808
  const source = formatting.borders?.[side];
3224
- const line = border(source, theme);
3225
- if (!line) continue;
3226
- const resolved = { ...line, spacePx: pointsToPx(source?.spacePoints ?? 0) };
5809
+ const line2 = border(source, theme);
5810
+ if (!line2) continue;
5811
+ const resolved = { ...line2, spacePx: pointsToPx(source?.spacePoints ?? 0) };
3227
5812
  if (side === "between") betweenBorder = resolved;
3228
5813
  else borders[side] = resolved;
3229
5814
  }
@@ -3246,8 +5831,8 @@ function groupParagraphBorders(blocks, between) {
3246
5831
  const borders = { ...block.borders };
3247
5832
  if (sameAsNext) delete borders.bottom;
3248
5833
  if (sameAsPrevious) {
3249
- const line = between.get(block);
3250
- if (line) borders.top = line;
5834
+ const line2 = between.get(block);
5835
+ if (line2) borders.top = line2;
3251
5836
  else delete borders.top;
3252
5837
  }
3253
5838
  block.borders = borders;
@@ -3362,7 +5947,7 @@ function adaptDocumentModel(model, note = () => {
3362
5947
  if (run.equation) reportOnce(EQUATION_NOTE);
3363
5948
  const name = run.field ? fieldName(run.field.instr) : "";
3364
5949
  const noteText = run.noteReference ? noteLabel(run.noteReference.kind, run.noteReference.id) : run.noteMark ? markLabel ?? "" : void 0;
3365
- const text = noteText ?? (run.field && !isFieldLocked(run) && (name === "DATE" || name === "TIME") ? dateFieldResult(name, run.field.instr, now) : run.equation ? "[Equation]" : run.text);
5950
+ const text2 = noteText ?? (run.field && !isFieldLocked(run) && (name === "DATE" || name === "TIME") ? dateFieldResult(name, run.field.instr, now) : run.equation ? "[Equation]" : run.text);
3366
5951
  const script = formatting.verticalAlign === "superscript" || noteText !== void 0 && formatting.verticalAlign === void 0 ? "super" : formatting.verticalAlign === "subscript" ? "sub" : void 0;
3367
5952
  const image = run.image;
3368
5953
  if (image?.unsupported === "Text box") reportOnce(TEXT_BOX_NOTE);
@@ -3370,11 +5955,12 @@ function adaptDocumentModel(model, note = () => {
3370
5955
  partName: image.partName,
3371
5956
  contentType: image.contentType,
3372
5957
  widthPx: image.widthPx,
3373
- heightPx: image.heightPx
5958
+ heightPx: image.heightPx,
5959
+ ...image.chart ? { chart: docxChartPaint(image.chart, image.widthPx, image.heightPx, theme) } : {}
3374
5960
  } : void 0;
3375
5961
  return {
3376
5962
  // Hidden text (`w:vanish`) takes no space when printed, as in Word by default.
3377
- text: image || formatting.vanish ? "" : formatting.caps ? text.toUpperCase() : text,
5963
+ text: image || formatting.vanish ? "" : formatting.caps ? text2.toUpperCase() : text2,
3378
5964
  ...object ? { object } : {},
3379
5965
  ...definedProps({
3380
5966
  bold: formatting.bold,