ooxml-core 1.29.0 → 1.30.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 (308) hide show
  1. package/dist/{PptxHandler-CZG6ISCZ.cjs → PptxHandler-DHQPVTUI.cjs} +3 -3
  2. package/dist/PptxHandler-E4DDV3FQ.mjs +4 -0
  3. package/dist/{PptxHandler-QIHYALOV.mjs → PptxHandler-KKLAYUGQ.mjs} +2 -2
  4. package/dist/{PresentationBuilder-66EU3N3O.cjs → PresentationBuilder-JORMF5CP.cjs} +5 -5
  5. package/dist/{PresentationBuilder-5YM2L7DA.mjs → PresentationBuilder-Q2Z33LLM.mjs} +2 -2
  6. package/dist/{PresentationBuilder-UAINQZA2.mjs → PresentationBuilder-YYZYCKTZ.mjs} +2 -2
  7. package/dist/automation/index.cjs +4250 -3145
  8. package/dist/automation/index.mjs +4250 -3145
  9. package/dist/chart/box-distribution.d.ts +10 -0
  10. package/dist/chart/box-distribution.d.ts.map +1 -0
  11. package/dist/chart/data-table-layout.d.ts +8 -0
  12. package/dist/chart/data-table-layout.d.ts.map +1 -0
  13. package/dist/chart/date-axis.d.ts +3 -0
  14. package/dist/chart/date-axis.d.ts.map +1 -0
  15. package/dist/chart/date-format.d.ts +39 -0
  16. package/dist/chart/date-format.d.ts.map +1 -0
  17. package/dist/chart/edit/chartex-action.d.ts.map +1 -1
  18. package/dist/chart/edit/chartex-axis.d.ts.map +1 -1
  19. package/dist/chart/edit/chartex-structure.d.ts.map +1 -1
  20. package/dist/chart/edit/chartex.d.ts +3 -1
  21. package/dist/chart/edit/chartex.d.ts.map +1 -1
  22. package/dist/chart/edit/draft.d.ts.map +1 -1
  23. package/dist/chart/funnel-geometry.d.ts +15 -0
  24. package/dist/chart/funnel-geometry.d.ts.map +1 -0
  25. package/dist/chart/index.cjs +1392 -404
  26. package/dist/chart/index.d.ts +6 -0
  27. package/dist/chart/index.d.ts.map +1 -1
  28. package/dist/chart/index.mjs +1379 -405
  29. package/dist/chart/line-path.d.ts +30 -0
  30. package/dist/chart/line-path.d.ts.map +1 -0
  31. package/dist/chart/manual-layout.d.ts +15 -0
  32. package/dist/chart/manual-layout.d.ts.map +1 -1
  33. package/dist/chart/render/chart-svg-analysis.d.ts +2 -0
  34. package/dist/chart/render/chart-svg-analysis.d.ts.map +1 -1
  35. package/dist/chart/render/chart-svg-bars.d.ts.map +1 -1
  36. package/dist/chart/render/chart-svg-box.d.ts +5 -0
  37. package/dist/chart/render/chart-svg-box.d.ts.map +1 -0
  38. package/dist/chart/render/chart-svg-cartesian.d.ts +3 -1
  39. package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
  40. package/dist/chart/render/chart-svg-data-table.d.ts +11 -0
  41. package/dist/chart/render/chart-svg-data-table.d.ts.map +1 -0
  42. package/dist/chart/render/chart-svg-date-axis.d.ts +9 -0
  43. package/dist/chart/render/chart-svg-date-axis.d.ts.map +1 -0
  44. package/dist/chart/render/chart-svg-funnel.d.ts +4 -0
  45. package/dist/chart/render/chart-svg-funnel.d.ts.map +1 -0
  46. package/dist/chart/render/chart-svg-labels.d.ts +16 -16
  47. package/dist/chart/render/chart-svg-labels.d.ts.map +1 -1
  48. package/dist/chart/render/chart-svg-line.d.ts +5 -0
  49. package/dist/chart/render/chart-svg-line.d.ts.map +1 -0
  50. package/dist/chart/render/chart-svg-plot-layout.d.ts +6 -0
  51. package/dist/chart/render/chart-svg-plot-layout.d.ts.map +1 -0
  52. package/dist/chart/render/chart-svg-plots.d.ts +2 -1
  53. package/dist/chart/render/chart-svg-plots.d.ts.map +1 -1
  54. package/dist/chart/render/chart-svg-radial.d.ts.map +1 -1
  55. package/dist/chart/render/chart-svg-slice-labels.d.ts +18 -0
  56. package/dist/chart/render/chart-svg-slice-labels.d.ts.map +1 -0
  57. package/dist/chart/render/chart-svg-xy.d.ts +2 -1
  58. package/dist/chart/render/chart-svg-xy.d.ts.map +1 -1
  59. package/dist/chart/render/chart-svg.d.ts.map +1 -1
  60. package/dist/chart/render/chart-title-text.d.ts +3 -1
  61. package/dist/chart/render/chart-title-text.d.ts.map +1 -1
  62. package/dist/chart/render/chart-view-analysis.d.ts +2 -1
  63. package/dist/chart/render/chart-view-analysis.d.ts.map +1 -1
  64. package/dist/chart/render/chart-view-data-table.d.ts +13 -0
  65. package/dist/chart/render/chart-view-data-table.d.ts.map +1 -0
  66. package/dist/chart/render/chart-view-labels.d.ts +6 -1
  67. package/dist/chart/render/chart-view-labels.d.ts.map +1 -1
  68. package/dist/chart/render/chart-view-series.d.ts.map +1 -1
  69. package/dist/chart/render/chart-view.d.ts +13 -0
  70. package/dist/chart/render/chart-view.d.ts.map +1 -1
  71. package/dist/chart/render/render-space.d.ts.map +1 -1
  72. package/dist/chart/render/summary-ex-series.d.ts +5 -0
  73. package/dist/chart/render/summary-ex-series.d.ts.map +1 -0
  74. package/dist/chart/render/summary-from-chartex.d.ts.map +1 -1
  75. package/dist/chart/render/summary-from-space.d.ts +1 -1
  76. package/dist/chart/render/summary-from-space.d.ts.map +1 -1
  77. package/dist/chart/render/summary-labels.d.ts.map +1 -1
  78. package/dist/chart/render/summary.d.ts +14 -1
  79. package/dist/chart/render/summary.d.ts.map +1 -1
  80. package/dist/{chunk-6C4NLBLB.mjs → chunk-6FXOAMNL.mjs} +1 -1
  81. package/dist/{chunk-T7HBA3CW.cjs → chunk-7T3SJQA6.cjs} +11 -9
  82. package/dist/{chunk-XROY25LN.cjs → chunk-7XYVFUB3.cjs} +4 -0
  83. package/dist/{chunk-I2CGNAP2.cjs → chunk-B4LXDHBX.cjs} +1409 -1389
  84. package/dist/{chunk-GUNTIFGT.cjs → chunk-CZXM4ZJH.cjs} +158 -26
  85. package/dist/{chunk-RYOJHYA3.mjs → chunk-DJ3CDTMX.mjs} +157 -27
  86. package/dist/{chunk-BBK3UB7M.mjs → chunk-FFJBOR2Y.mjs} +4 -4
  87. package/dist/{chunk-DWEQWFQU.mjs → chunk-GJDFCP2T.mjs} +248 -228
  88. package/dist/{chunk-KBER3RAP.mjs → chunk-KWJYMAEF.mjs} +248 -228
  89. package/dist/{chunk-XCRDAVFN.mjs → chunk-MKDONWNO.mjs} +237 -95
  90. package/dist/{chunk-3UMDVJRN.mjs → chunk-NBMXEVHL.mjs} +4 -1
  91. package/dist/{chunk-TVJL7QIG.cjs → chunk-OGEL4Z4S.cjs} +8 -1
  92. package/dist/{chunk-HRU3KOE5.mjs → chunk-OORQCSVA.mjs} +5 -3
  93. package/dist/{chunk-7RJYOVQU.mjs → chunk-R7NS42KQ.mjs} +5 -2
  94. package/dist/{chunk-DXOBT2JE.mjs → chunk-UZWV2HAJ.mjs} +8 -2
  95. package/dist/{chunk-PDZ4GQLI.mjs → chunk-WZJ25K7P.mjs} +1 -1
  96. package/dist/{chunk-IETFPVLN.cjs → chunk-XTUX5RMG.cjs} +15 -12
  97. package/dist/diagram/drawing.d.ts.map +1 -1
  98. package/dist/diagram/index.cjs +1218 -592
  99. package/dist/diagram/index.mjs +1218 -592
  100. package/dist/diagram/load.d.ts.map +1 -1
  101. package/dist/diagram/relationships.d.ts +1 -0
  102. package/dist/diagram/relationships.d.ts.map +1 -1
  103. package/dist/diagram/types.d.ts +2 -0
  104. package/dist/diagram/types.d.ts.map +1 -1
  105. package/dist/docx/diagram.d.ts.map +1 -1
  106. package/dist/docx/drawing.d.ts.map +1 -1
  107. package/dist/docx/embedded.cjs +1850 -1138
  108. package/dist/docx/embedded.mjs +1850 -1138
  109. package/dist/docx/index.cjs +3312 -1713
  110. package/dist/docx/index.mjs +3312 -1713
  111. package/dist/docx/layout/adapter.d.ts.map +1 -1
  112. package/dist/docx/layout/fonts.d.ts +1 -1
  113. package/dist/docx/layout/fonts.d.ts.map +1 -1
  114. package/dist/docx/layout/index.cjs +1933 -518
  115. package/dist/docx/layout/index.mjs +1933 -518
  116. package/dist/docx/layout/script-fonts.d.ts +6 -0
  117. package/dist/docx/layout/script-fonts.d.ts.map +1 -0
  118. package/dist/docx/load/index.cjs +1853 -1141
  119. package/dist/docx/load/index.mjs +1853 -1141
  120. package/dist/docx/parse.d.ts.map +1 -1
  121. package/dist/docx/shape-model.d.ts +2 -0
  122. package/dist/docx/shape-model.d.ts.map +1 -1
  123. package/dist/docx/shape-parse.d.ts.map +1 -1
  124. package/dist/docx/shape-svg.d.ts.map +1 -1
  125. package/dist/docx/ui/index.cjs +1763 -593
  126. package/dist/docx/ui/index.mjs +1763 -593
  127. package/dist/docx/write-shape.d.ts.map +1 -1
  128. package/dist/drawingml/custom-geometry.d.ts +5 -0
  129. package/dist/drawingml/custom-geometry.d.ts.map +1 -0
  130. package/dist/drawingml/drawing-fill.d.ts.map +1 -1
  131. package/dist/drawingml/drawing-geometry.d.ts.map +1 -1
  132. package/dist/drawingml/image-content-type.d.ts +2 -0
  133. package/dist/drawingml/image-content-type.d.ts.map +1 -0
  134. package/dist/drawingml/index.cjs +1128 -179
  135. package/dist/drawingml/index.d.ts +9 -0
  136. package/dist/drawingml/index.d.ts.map +1 -1
  137. package/dist/drawingml/index.mjs +1110 -180
  138. package/dist/drawingml/path-data.d.ts +4 -0
  139. package/dist/drawingml/path-data.d.ts.map +1 -0
  140. package/dist/drawingml/picture-crop.d.ts +8 -0
  141. package/dist/drawingml/picture-crop.d.ts.map +1 -0
  142. package/dist/drawingml/picture-effects.d.ts +37 -0
  143. package/dist/drawingml/picture-effects.d.ts.map +1 -0
  144. package/dist/drawingml/picture-fill.d.ts +7 -0
  145. package/dist/drawingml/picture-fill.d.ts.map +1 -0
  146. package/dist/drawingml/read-3d-values.d.ts +8 -0
  147. package/dist/drawingml/read-3d-values.d.ts.map +1 -0
  148. package/dist/drawingml/read-text-3d.d.ts +8 -0
  149. package/dist/drawingml/read-text-3d.d.ts.map +1 -0
  150. package/dist/drawingml/read-text-body.d.ts.map +1 -1
  151. package/dist/drawingml/scene3d-coordinate.d.ts +45 -0
  152. package/dist/drawingml/scene3d-coordinate.d.ts.map +1 -0
  153. package/dist/drawingml/scene3d-presets.d.ts +12 -0
  154. package/dist/drawingml/scene3d-presets.d.ts.map +1 -0
  155. package/dist/drawingml/text-3d-model.d.ts +71 -0
  156. package/dist/drawingml/text-3d-model.d.ts.map +1 -0
  157. package/dist/drawingml/text-model.d.ts +3 -0
  158. package/dist/drawingml/text-model.d.ts.map +1 -1
  159. package/dist/drawingml/types.d.ts +3 -0
  160. package/dist/drawingml/types.d.ts.map +1 -1
  161. package/dist/drawingml/write-pattern-picture.d.ts.map +1 -1
  162. package/dist/drawingml/write-text-3d.d.ts +6 -0
  163. package/dist/drawingml/write-text-3d.d.ts.map +1 -0
  164. package/dist/drawingml/write-text-body.d.ts.map +1 -1
  165. package/dist/geometry/element-transform.d.ts +3 -0
  166. package/dist/geometry/element-transform.d.ts.map +1 -1
  167. package/dist/geometry/index.cjs +69 -4
  168. package/dist/geometry/index.d.ts +2 -0
  169. package/dist/geometry/index.d.ts.map +1 -1
  170. package/dist/geometry/index.mjs +66 -5
  171. package/dist/geometry/picture-crop.d.ts +21 -0
  172. package/dist/geometry/picture-crop.d.ts.map +1 -0
  173. package/dist/geometry/resize-aspect.d.ts +12 -0
  174. package/dist/geometry/resize-aspect.d.ts.map +1 -0
  175. package/dist/index.cjs +4201 -2058
  176. package/dist/index.mjs +4201 -2058
  177. package/dist/opc/index.cjs +9 -6
  178. package/dist/opc/index.mjs +9 -6
  179. package/dist/opc/safe-href.d.ts +10 -3
  180. package/dist/opc/safe-href.d.ts.map +1 -1
  181. package/dist/pptx/automation/index.cjs +634 -361
  182. package/dist/pptx/automation/index.d.ts +6 -6
  183. package/dist/pptx/automation/index.mjs +5 -5
  184. package/dist/pptx/chunks/{elements-CCEghtE_.d.ts → elements-mSCZ84Tc.d.ts} +4 -4
  185. package/dist/pptx/chunks/elements-mSCZ84Tc.d.ts.map +1 -0
  186. package/dist/pptx/chunks/{index-D90lhgiE.d.ts → index-BQDcu_0a.d.ts} +19 -111
  187. package/dist/pptx/chunks/index-BQDcu_0a.d.ts.map +1 -0
  188. package/dist/pptx/chunks/{index-CmnbpSCL.d.ts → index-CBV1oHN7.d.ts} +5 -5
  189. package/dist/pptx/chunks/{index-CmnbpSCL.d.ts.map → index-CBV1oHN7.d.ts.map} +1 -1
  190. package/dist/pptx/chunks/{index-DJIPX0Ge.d.ts → index-PdM5zpmu.d.ts} +5 -5
  191. package/dist/pptx/chunks/{index-DJIPX0Ge.d.ts.map → index-PdM5zpmu.d.ts.map} +1 -1
  192. package/dist/pptx/chunks/{smart-art-BLBSej3J.d.ts → smart-art-DLumQo90.d.ts} +135 -103
  193. package/dist/pptx/chunks/smart-art-DLumQo90.d.ts.map +1 -0
  194. package/dist/pptx/chunks/{text-D49FKllA.d.ts → text-P9xVnXXf.d.ts} +49 -60
  195. package/dist/pptx/chunks/text-P9xVnXXf.d.ts.map +1 -0
  196. package/dist/pptx/chunks/{text-operations-DZ1IgDJN.d.ts → text-operations-hyPODwIQ.d.ts} +4 -4
  197. package/dist/pptx/chunks/{text-operations-DZ1IgDJN.d.ts.map → text-operations-hyPODwIQ.d.ts.map} +1 -1
  198. package/dist/pptx/cli/index.cjs +630 -357
  199. package/dist/pptx/cli/index.d.ts +1 -1
  200. package/dist/pptx/cli/index.mjs +4 -4
  201. package/dist/pptx/converter/index.cjs +102 -67
  202. package/dist/pptx/converter/index.d.ts +1 -1
  203. package/dist/pptx/converter/index.mjs +2 -2
  204. package/dist/pptx/editor/render/collaboration-assets.cjs +15 -11
  205. package/dist/pptx/editor/render/collaboration-assets.d.ts +2 -2
  206. package/dist/pptx/editor/render/collaboration-assets.mjs +1 -1
  207. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +5 -5
  208. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +3 -3
  209. package/dist/pptx/editor/render/collaboration-reconcile.cjs +9 -9
  210. package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
  211. package/dist/pptx/editor/render/collaboration-reconcile.mjs +3 -3
  212. package/dist/pptx/editor/render/collaboration-sync.cjs +29 -25
  213. package/dist/pptx/editor/render/collaboration-sync.d.ts +7 -0
  214. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  215. package/dist/pptx/editor/render/collaboration-sync.mjs +2 -2
  216. package/dist/pptx/editor/render/find-replace.cjs +14 -14
  217. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  218. package/dist/pptx/editor/render/find-replace.mjs +1 -1
  219. package/dist/pptx/editor/render/font-family-update.d.ts +1 -1
  220. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +1 -1
  221. package/dist/pptx/editor/render/slide-operations.cjs +8 -8
  222. package/dist/pptx/editor/render/slide-operations.mjs +2 -2
  223. package/dist/pptx/editor/render/table-cell-edit.cjs +8 -4
  224. package/dist/pptx/editor/render/table-cell-edit.d.ts +5 -0
  225. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  226. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  227. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  228. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  229. package/dist/pptx/editor/render/table-data-grid-ops.cjs +2 -2
  230. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  231. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  232. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  233. package/dist/pptx/editor/render/text-content-style.d.ts +1 -1
  234. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  235. package/dist/pptx/editor/render/text-style-scope.d.ts +2 -2
  236. package/dist/pptx/editor/render/update-text-segment-style.d.ts +1 -1
  237. package/dist/pptx/index.cjs +696 -419
  238. package/dist/pptx/index.d.ts +8 -8
  239. package/dist/pptx/index.mjs +5 -5
  240. package/dist/pptx/node/index.d.ts +1 -1
  241. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  242. package/dist/teams/index.cjs +1816 -1049
  243. package/dist/teams/index.mjs +1816 -1049
  244. package/dist/text/font-style-name.d.ts +11 -0
  245. package/dist/text/font-style-name.d.ts.map +1 -0
  246. package/dist/text/font-substitution-map.d.ts +3 -0
  247. package/dist/text/font-substitution-map.d.ts.map +1 -0
  248. package/dist/text/font-substitution.d.ts +34 -0
  249. package/dist/text/font-substitution.d.ts.map +1 -0
  250. package/dist/text/index.cjs +460 -0
  251. package/dist/text/index.d.ts +3 -0
  252. package/dist/text/index.d.ts.map +1 -1
  253. package/dist/text/index.mjs +443 -1
  254. package/dist/text/metric-font-family.d.ts +7 -0
  255. package/dist/text/metric-font-family.d.ts.map +1 -0
  256. package/dist/text/panose.d.ts +55 -0
  257. package/dist/text/panose.d.ts.map +1 -0
  258. package/dist/text/script-fonts.d.ts +26 -0
  259. package/dist/text/script-fonts.d.ts.map +1 -0
  260. package/dist/visio/edit-geometry-admission.d.ts +1 -1
  261. package/dist/visio/edit-geometry-admission.d.ts.map +1 -1
  262. package/dist/visio/edit-group-resize.d.ts +26 -0
  263. package/dist/visio/edit-group-resize.d.ts.map +1 -0
  264. package/dist/visio/edit-recalculate-index.d.ts +2 -0
  265. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  266. package/dist/visio/edit-resize-anchor.d.ts.map +1 -1
  267. package/dist/visio/edit-resize-plan.d.ts +14 -0
  268. package/dist/visio/edit-resize-plan.d.ts.map +1 -0
  269. package/dist/visio/edit-scope.d.ts.map +1 -1
  270. package/dist/visio/index.cjs +1326 -389
  271. package/dist/visio/index.mjs +1326 -389
  272. package/dist/visio/ui/geometry-expectation.d.ts +17 -0
  273. package/dist/visio/ui/geometry-expectation.d.ts.map +1 -0
  274. package/dist/visio/ui/guides.d.ts +2 -0
  275. package/dist/visio/ui/guides.d.ts.map +1 -1
  276. package/dist/visio/ui/index.cjs +1582 -411
  277. package/dist/visio/ui/index.d.ts +2 -0
  278. package/dist/visio/ui/index.d.ts.map +1 -1
  279. package/dist/visio/ui/index.mjs +1579 -412
  280. package/dist/visio/ui/selection-resize.d.ts +19 -0
  281. package/dist/visio/ui/selection-resize.d.ts.map +1 -0
  282. package/dist/visio/ui/shape-move.d.ts +1 -1
  283. package/dist/visio/ui/shape-move.d.ts.map +1 -1
  284. package/dist/visio/ui/shape-resize.d.ts.map +1 -1
  285. package/dist/xlsx/edit/drawings.d.ts +5 -0
  286. package/dist/xlsx/edit/drawings.d.ts.map +1 -1
  287. package/dist/xlsx/edit/session.d.ts.map +1 -1
  288. package/dist/xlsx/edit/types.d.ts +4 -0
  289. package/dist/xlsx/edit/types.d.ts.map +1 -1
  290. package/dist/xlsx/index.cjs +3908 -2256
  291. package/dist/xlsx/index.mjs +3908 -2256
  292. package/dist/xlsx/layout/chart-view.d.ts.map +1 -1
  293. package/dist/xlsx/load/index.cjs +2003 -1239
  294. package/dist/xlsx/load/index.mjs +2003 -1239
  295. package/dist/xlsx/model.d.ts +4 -0
  296. package/dist/xlsx/model.d.ts.map +1 -1
  297. package/dist/xlsx/read/chart.d.ts.map +1 -1
  298. package/dist/xlsx/read/drawing.d.ts.map +1 -1
  299. package/dist/xlsx/read/smart-art.d.ts.map +1 -1
  300. package/dist/xlsx/ui/index.cjs +3880 -2228
  301. package/dist/xlsx/ui/index.mjs +3880 -2228
  302. package/dist/xlsx/write/drawing.d.ts.map +1 -1
  303. package/package.json +1 -1
  304. package/dist/PptxHandler-DSXSXMEG.mjs +0 -4
  305. package/dist/pptx/chunks/elements-CCEghtE_.d.ts.map +0 -1
  306. package/dist/pptx/chunks/index-D90lhgiE.d.ts.map +0 -1
  307. package/dist/pptx/chunks/smart-art-BLBSej3J.d.ts.map +0 -1
  308. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +0 -1
@@ -1260,8 +1260,8 @@ function parseXml(xml, options2 = {}) {
1260
1260
  let parsed;
1261
1261
  try {
1262
1262
  parsed = new DOMParser({
1263
- onError: (level2, message) => {
1264
- if (level2 !== "warning") parseError = message;
1263
+ onError: (level3, message) => {
1264
+ if (level3 !== "warning") parseError = message;
1265
1265
  }
1266
1266
  }).parseFromString(xml, "application/xml");
1267
1267
  } catch (error) {
@@ -1379,15 +1379,15 @@ function* liteChildElements(xml, namespaces) {
1379
1379
  function* topLevelNodes(xml, namespaces) {
1380
1380
  const source = hasLineEnds(xml) ? xml.replace(/\r[\n\u0085]/g, "\n").replace(/[\r\u0085\u2028\u2029]/g, "\n") : xml;
1381
1381
  const root2 = new LiteElement("", "", null);
1382
- const level2 = root2.childNodes;
1382
+ const level3 = root2.childNodes;
1383
1383
  const stack = [root2];
1384
1384
  let top = root2;
1385
1385
  const n = source.length;
1386
1386
  let pos = 0;
1387
1387
  while (pos < n) {
1388
- if (level2.length && stack.length === 1) {
1389
- yield* level2;
1390
- level2.length = 0;
1388
+ if (level3.length && stack.length === 1) {
1389
+ yield* level3;
1390
+ level3.length = 0;
1391
1391
  }
1392
1392
  const lt = source.indexOf("<", pos);
1393
1393
  const end = lt < 0 ? n : lt;
@@ -1423,7 +1423,7 @@ function* topLevelNodes(xml, namespaces) {
1423
1423
  pos = parsed.end;
1424
1424
  }
1425
1425
  if (stack.length !== 1) return false;
1426
- yield* level2;
1426
+ yield* level3;
1427
1427
  return true;
1428
1428
  }
1429
1429
  var DECLARATIONS = /<!DOCTYPE|<!ENTITY/i;
@@ -1487,14 +1487,14 @@ function startTag(source, from, namespaces) {
1487
1487
  while (q < n && isSpace(source.charCodeAt(q))) q++;
1488
1488
  const quote = source[q];
1489
1489
  if (quote !== '"' && quote !== "'") return void 0;
1490
- const close4 = source.indexOf(quote, q + 1);
1491
- if (close4 < 0) return void 0;
1492
- const raw2 = source.slice(q + 1, close4);
1490
+ const close3 = source.indexOf(quote, q + 1);
1491
+ if (close3 < 0) return void 0;
1492
+ const raw2 = source.slice(q + 1, close3);
1493
1493
  if (raw2.includes("<") || element2.hasAttribute(name3)) return void 0;
1494
1494
  const value3 = decode(/[\t\n\r]/.test(raw2) ? raw2.replace(/[\t\n\r]/g, " ") : raw2);
1495
1495
  if (value3 === void 0) return void 0;
1496
1496
  element2.attrs.push(name3, value3);
1497
- i = close4 + 1;
1497
+ i = close3 + 1;
1498
1498
  const after = source.charCodeAt(i);
1499
1499
  if (i < n && !isSpace(after) && after !== 62 && after !== 47) return void 0;
1500
1500
  }
@@ -4888,7 +4888,11 @@ function indexCells(roots2, options2) {
4888
4888
  const unsafe2 = inherited || nested || node3.hasAttribute("Master") || node3.hasAttribute("MasterShape") || attribute2(node3, "Type") === "Group" || !isLocalForeignFrameShape(node3) && (attribute2(node3, "Type") !== void 0 && attribute2(node3, "Type") !== "Shape" || children2(node3, "ForeignData").length > 0 || children2(node3, "Rel").length > 0) || connected.has(shapeId2) && !options2.glueShapes?.has(node3) || !options2.lineEditShapes?.has(node3) && children2(node3, "Cell").some(
4889
4889
  (cell) => /^(BeginX|BeginY|EndX|EndY)$/i.test(attribute2(cell, "N") ?? "") || attribute2(cell, "N")?.toLowerCase() === "oned" && (attribute2(cell, "V") !== "0" || !!executableCellFormula(attribute2(cell, "F")) || attribute2(cell, "F") === "Inh")
4890
4890
  ) || children2(node3, "Shapes").length > 0 || ["1", "true"].includes(attribute2(node3, "Del") ?? "");
4891
- sheets.push({ node: node3, shapeId: shapeId2, unsafe: unsafe2 });
4891
+ sheets.push({
4892
+ node: node3,
4893
+ shapeId: shapeId2,
4894
+ unsafe: options2.groupResizeShapes?.has(node3) ? false : unsafe2
4895
+ });
4892
4896
  visit(node3, unsafe2, true);
4893
4897
  }
4894
4898
  };
@@ -5182,12 +5186,12 @@ function admitted(root2, shapeId2, masterMovePins = /* @__PURE__ */ new Set(), m
5182
5186
  const containers = children2(root2, "Shapes");
5183
5187
  if (containers.length !== 1)
5184
5188
  fail("UNSUPPORTED_GEOMETRY_EDIT", "One local Shapes container is required.");
5185
- const candidates = children2(containers[0], "Shape").filter(
5189
+ const candidates2 = children2(containers[0], "Shape").filter(
5186
5190
  (node3) => attribute2(node3, "ID") === shapeId2
5187
5191
  );
5188
- if (candidates.length !== 1)
5192
+ if (candidates2.length !== 1)
5189
5193
  fail("EDIT_TARGET_NOT_FOUND", "A unique top-level local shape is required.");
5190
- const shape = candidates[0];
5194
+ const shape = candidates2[0];
5191
5195
  if ((shape.hasAttribute("Master") || shape.hasAttribute("MasterShape")) && !["PinX", "PinY"].every((name3) => {
5192
5196
  const cell = cells(shape).get(name3);
5193
5197
  return cell && masterMovePins.has(cell);
@@ -5309,7 +5313,7 @@ function protectedShape(shape, document, masterMovePins = /* @__PURE__ */ new Se
5309
5313
  }
5310
5314
  return local.has("LockRotate") ? numeric(local.get("LockRotate"), 0) !== 0 : inheritedRotationLocked;
5311
5315
  }
5312
- function resizeGeometry(shape, roots2, edit, check, lineEditShapes = /* @__PURE__ */ new Set(), glueShapes = /* @__PURE__ */ new Set()) {
5316
+ function resizeGeometry(shape, roots2, edit, check, lineEditShapes = /* @__PURE__ */ new Set(), glueShapes = /* @__PURE__ */ new Set(), groupResizeShapes = /* @__PURE__ */ new Set()) {
5313
5317
  const sections2 = children2(shape, "Section").filter((node3) => attribute2(node3, "N") === "Geometry");
5314
5318
  let depends;
5315
5319
  if (!sections2.length)
@@ -5351,7 +5355,12 @@ function resizeGeometry(shape, roots2, edit, check, lineEditShapes = /* @__PURE_
5351
5355
  const analysis = analyzeVisioFormula(formula2);
5352
5356
  if (!analysis.references.length && numeric(node3) === 0) continue;
5353
5357
  const cell = `Geometry${Number(attribute2(section3, "IX") ?? "0") + 1}.${attribute2(node3, "N")}${attribute2(row2, "IX")}`;
5354
- depends ??= createVisioDependencyQuery(roots2, { check, lineEditShapes, glueShapes });
5358
+ depends ??= createVisioDependencyQuery(roots2, {
5359
+ check,
5360
+ lineEditShapes,
5361
+ glueShapes,
5362
+ groupResizeShapes
5363
+ });
5355
5364
  if (!depends(
5356
5365
  { pageId: edit.pageId, shapeId: edit.shapeId, cell },
5357
5366
  ["Width", "Height"].map((cell2) => ({
@@ -5990,8 +5999,8 @@ function valid(key2, value3) {
5990
5999
  fail("INVALID_EDIT", `Invalid page layout value for ${key2}.`);
5991
6000
  return number5;
5992
6001
  }
5993
- const integer5 = Number.isSafeInteger(number5);
5994
- const ok = key2 === "lineJumpDirectionX" || key2 === "lineJumpDirectionY" ? integer5 && number5 >= 0 && number5 <= 2 : key2 === "lineJumpCode" ? integer5 && number5 >= 0 && number5 <= 5 : key2 === "lineJumpStyle" ? integer5 && number5 >= 0 && number5 <= 9 : key2.startsWith("gridDensity") ? VISIO_GRID_DENSITIES.includes(number5) : key2.startsWith("rulerDensity") ? VISIO_RULER_DENSITIES.includes(number5) : key2.startsWith("gridSpacing") ? number5 >= 0 && number5 <= 1e4 : Math.abs(number5) <= 1e6;
6002
+ const integer6 = Number.isSafeInteger(number5);
6003
+ const ok = key2 === "lineJumpDirectionX" || key2 === "lineJumpDirectionY" ? integer6 && number5 >= 0 && number5 <= 2 : key2 === "lineJumpCode" ? integer6 && number5 >= 0 && number5 <= 5 : key2 === "lineJumpStyle" ? integer6 && number5 >= 0 && number5 <= 9 : key2.startsWith("gridDensity") ? VISIO_GRID_DENSITIES.includes(number5) : key2.startsWith("rulerDensity") ? VISIO_RULER_DENSITIES.includes(number5) : key2.startsWith("gridSpacing") ? number5 >= 0 && number5 <= 1e4 : Math.abs(number5) <= 1e6;
5995
6004
  if (!ok) fail("INVALID_EDIT", `Invalid page layout value for ${key2}.`);
5996
6005
  return number5;
5997
6006
  }
@@ -9971,7 +9980,7 @@ function pathCommands(value3, limits, budget) {
9971
9980
  const whitespace = () => {
9972
9981
  while (position < data.length && WSP.test(data[position])) position++;
9973
9982
  };
9974
- function operand(separator, flag) {
9983
+ function operand2(separator, flag) {
9975
9984
  whitespace();
9976
9985
  if (separator && data[position] === ",") {
9977
9986
  position++;
@@ -10001,7 +10010,7 @@ function pathCommands(value3, limits, budget) {
10001
10010
  if (budget.commands >= limits.maxPathCommands) limit("Path command limit exceeded.");
10002
10011
  const values = [];
10003
10012
  for (let i = 0; i < arity; i++)
10004
- values.push(operand(i > 0 || !explicit, command2 === "A" && (i === 3 || i === 4)));
10013
+ values.push(operand2(i > 0 || !explicit, command2 === "A" && (i === 3 || i === 4)));
10005
10014
  const px = (i) => values[i] + (relative ? x : 0);
10006
10015
  const py = (i) => values[i] + (relative ? y : 0);
10007
10016
  let output;
@@ -11455,6 +11464,141 @@ function resolveDrawingColor(color2, theme2, options2) {
11455
11464
  };
11456
11465
  }
11457
11466
 
11467
+ // drawingml/picture-crop.ts
11468
+ var SIDES = { l: "cropLeft", t: "cropTop", r: "cropRight", b: "cropBottom" };
11469
+ function parsePictureCrop(blipFill) {
11470
+ const rect = first(blipFill, "srcRect", NS.a);
11471
+ if (!rect) return void 0;
11472
+ const result2 = {};
11473
+ for (const [attr2, key2] of Object.entries(SIDES)) {
11474
+ const raw2 = rect.getAttribute(attr2);
11475
+ if (raw2 === null || !raw2.trim()) continue;
11476
+ const percent = raw2.endsWith("%");
11477
+ const value3 = Number(percent ? raw2.slice(0, -1) : raw2) / (percent ? 100 : 1e5);
11478
+ if (Number.isFinite(value3)) result2[key2] = value3;
11479
+ }
11480
+ return result2;
11481
+ }
11482
+ function applyPictureCrop(blipFill, crop) {
11483
+ let rect = first(blipFill, "srcRect", NS.a);
11484
+ if (!rect && crop && Object.values(crop).some((value3) => value3 !== void 0)) {
11485
+ rect = blipFill.ownerDocument.createElementNS(NS.a, "a:srcRect");
11486
+ const blip = first(blipFill, "blip", NS.a);
11487
+ blipFill.insertBefore(rect, blip?.nextSibling ?? blipFill.firstChild);
11488
+ }
11489
+ if (!rect) return;
11490
+ for (const [attr2, key2] of Object.entries(SIDES)) {
11491
+ const value3 = crop?.[key2];
11492
+ if (value3 === void 0) rect.removeAttribute(attr2);
11493
+ else {
11494
+ if (!Number.isFinite(value3)) throw new RangeError("Picture crop must be finite");
11495
+ rect.setAttribute(attr2, String(Math.round(value3 * 1e5)));
11496
+ }
11497
+ }
11498
+ }
11499
+
11500
+ // drawingml/picture-effects.ts
11501
+ function picturePercentage(value3) {
11502
+ const text7 = String(value3 ?? "").trim();
11503
+ if (!text7) return void 0;
11504
+ const percent = text7.endsWith("%");
11505
+ const n = Number(percent ? text7.slice(0, -1) : text7) / (percent ? 100 : 1e5);
11506
+ return Number.isFinite(n) ? n : void 0;
11507
+ }
11508
+ function readPictureEffect(name3, attribute4) {
11509
+ if (name3 === "grayscl") return { kind: "grayscale" };
11510
+ if (name3 === "lum") {
11511
+ const brightness = picturePercentage(attribute4("bright"));
11512
+ const contrast = picturePercentage(attribute4("contrast"));
11513
+ for (const [name4, value3] of [
11514
+ ["bright", brightness],
11515
+ ["contrast", contrast]
11516
+ ]) {
11517
+ const raw2 = attribute4(name4);
11518
+ if (raw2 !== void 0 && raw2 !== null && (value3 === void 0 || Math.abs(value3) > 1))
11519
+ return void 0;
11520
+ }
11521
+ return {
11522
+ kind: "luminance",
11523
+ ...brightness !== void 0 ? { brightness } : {},
11524
+ ...contrast !== void 0 ? { contrast } : {}
11525
+ };
11526
+ }
11527
+ if (name3 === "alphaModFix") {
11528
+ const raw2 = attribute4("amt");
11529
+ const amount = raw2 === void 0 || raw2 === null ? 1 : picturePercentage(raw2);
11530
+ if (amount !== void 0 && amount >= 0) return { kind: "alphaModFix", amount };
11531
+ }
11532
+ return void 0;
11533
+ }
11534
+ function parsePictureEffects(blip) {
11535
+ if (!blip) return [];
11536
+ return elements(blip).map((node3) => ({
11537
+ ...(node3.namespaceURI === NS.a ? readPictureEffect(node3.localName, (name3) => node3.getAttribute(name3)) : void 0) ?? { kind: "unsupported", name: node3.localName },
11538
+ sourceXml: buildXml(node3)
11539
+ }));
11540
+ }
11541
+ function applyPictureEffects(blip, effects) {
11542
+ if (JSON.stringify(parsePictureEffects(blip)) === JSON.stringify(effects)) return;
11543
+ const nodes = effects.map((effect) => {
11544
+ const name3 = effect.kind === "grayscale" ? "grayscl" : effect.kind === "luminance" ? "lum" : effect.kind === "unsupported" ? effect.name : effect.kind;
11545
+ const source = effect.sourceXml ? parseXml(effect.sourceXml).documentElement : void 0;
11546
+ if (effect.kind === "unsupported" && !source)
11547
+ throw new Error("An unsupported picture effect needs source XML");
11548
+ const node3 = source ? blip.ownerDocument.importNode(source, true) : blip.ownerDocument.createElementNS(NS.a, `a:${name3}`);
11549
+ if (effect.kind !== "unsupported" && (node3.namespaceURI !== NS.a || node3.localName !== name3))
11550
+ throw new Error("Picture effect source does not match its kind");
11551
+ const set = (name4, value3) => {
11552
+ const original = picturePercentage(node3.getAttribute(name4));
11553
+ if (value3 === void 0) node3.removeAttribute(name4);
11554
+ else if (value3 !== original) {
11555
+ if (!Number.isFinite(value3)) throw new RangeError("Picture effect must be finite");
11556
+ node3.setAttribute(name4, String(Math.round(value3 * 1e5)));
11557
+ }
11558
+ };
11559
+ if (effect.kind === "luminance") {
11560
+ if ([effect.brightness, effect.contrast].some(
11561
+ (value3) => value3 !== void 0 && (!Number.isFinite(value3) || Math.abs(value3) > 1)
11562
+ ))
11563
+ throw new RangeError("Picture luminance must be between -1 and 1");
11564
+ set("bright", effect.brightness);
11565
+ set("contrast", effect.contrast);
11566
+ }
11567
+ if (effect.kind === "alphaModFix") {
11568
+ if (effect.amount < 0) throw new RangeError("Picture alpha must be nonnegative");
11569
+ set("amt", effect.amount);
11570
+ }
11571
+ return node3;
11572
+ });
11573
+ for (const node3 of elements(blip)) blip.removeChild(node3);
11574
+ for (const node3 of nodes) blip.appendChild(node3);
11575
+ }
11576
+
11577
+ // drawingml/picture-fill.ts
11578
+ function parseDrawingPictureFill(fill) {
11579
+ const blip = first(fill, "blip", NS.a);
11580
+ const relId = blip?.getAttributeNS(NS.r, "embed") || blip?.getAttribute("r:embed") || void 0;
11581
+ const linkRelId = blip?.getAttributeNS(NS.r, "link") || void 0;
11582
+ const crop = parsePictureCrop(fill);
11583
+ const effects = parsePictureEffects(blip);
11584
+ const tile = first(fill, "tile", NS.a);
11585
+ const rect = first(first(fill, "stretch", NS.a), "fillRect", NS.a);
11586
+ const unsupported4 = [
11587
+ ...tile ? ["tile"] : [],
11588
+ ...rect && ["l", "t", "r", "b"].some((key2) => Number(rect.getAttribute(key2) ?? 0) !== 0) ? ["fillRect"] : [],
11589
+ ...fill.getAttribute("rotWithShape") === "0" || fill.getAttribute("rotWithShape") === "false" ? ["rotWithShape"] : []
11590
+ ];
11591
+ return {
11592
+ kind: "picture",
11593
+ sourceXml: buildXml(fill),
11594
+ ...relId ? { relId } : {},
11595
+ ...linkRelId ? { linkRelId } : {},
11596
+ ...crop ? { crop } : {},
11597
+ ...effects.length ? { effects } : {},
11598
+ ...unsupported4.length ? { unsupportedPicture: unsupported4 } : {}
11599
+ };
11600
+ }
11601
+
11458
11602
  // drawingml/drawing-fill.ts
11459
11603
  var FILL_ELEMENTS = /* @__PURE__ */ new Set([
11460
11604
  "noFill",
@@ -11464,13 +11608,13 @@ var FILL_ELEMENTS = /* @__PURE__ */ new Set([
11464
11608
  "blipFill",
11465
11609
  "grpFill"
11466
11610
  ]);
11467
- function fillElementOf(properties2) {
11468
- return properties2 ? elements(properties2).find(
11611
+ function fillElementOf(properties) {
11612
+ return properties ? elements(properties).find(
11469
11613
  (element2) => FILL_ELEMENTS.has(element2.localName) && (!element2.namespaceURI || element2.namespaceURI === NS.a)
11470
11614
  ) : void 0;
11471
11615
  }
11472
- function parseDrawingFill(properties2) {
11473
- const fill = fillElementOf(properties2);
11616
+ function parseDrawingFill(properties) {
11617
+ const fill = fillElementOf(properties);
11474
11618
  if (!fill) return void 0;
11475
11619
  switch (fill.localName) {
11476
11620
  case "noFill":
@@ -11525,17 +11669,8 @@ function parseDrawingFill(properties2) {
11525
11669
  ...background2 ? { background: background2 } : {}
11526
11670
  };
11527
11671
  }
11528
- case "blipFill": {
11529
- const blip = first(fill, "blip", NS.a);
11530
- const relId = blip?.getAttributeNS(NS.r, "embed") || blip?.getAttribute("r:embed") || void 0;
11531
- const linkRelId = blip?.getAttributeNS(NS.r, "link") || void 0;
11532
- return {
11533
- kind: "picture",
11534
- sourceXml: buildXml(fill),
11535
- ...relId ? { relId } : {},
11536
- ...linkRelId ? { linkRelId } : {}
11537
- };
11538
- }
11672
+ case "blipFill":
11673
+ return parseDrawingPictureFill(fill);
11539
11674
  default:
11540
11675
  return { kind: "unsupported", element: fill.localName };
11541
11676
  }
@@ -11722,6 +11857,10 @@ function drawingPatternPictureXml(fill) {
11722
11857
  else if (blip.getAttributeNS(NS.r, attribute4) !== value3)
11723
11858
  blip.setAttributeNS(NS.r, `r:${attribute4}`, value3);
11724
11859
  }
11860
+ if (fill.crop !== void 0 && JSON.stringify(before?.kind === "picture" ? before.crop : void 0) !== JSON.stringify(fill.crop))
11861
+ applyPictureCrop(root2, fill.crop);
11862
+ if (fill.effects !== void 0 && JSON.stringify(before?.kind === "picture" ? before.effects ?? [] : []) !== JSON.stringify(fill.effects ?? []))
11863
+ applyPictureEffects(blip, fill.effects ?? []);
11725
11864
  if (!fill.sourceXml) {
11726
11865
  const stretch = doc.createElementNS(NS.a, "a:stretch");
11727
11866
  stretch.appendChild(doc.createElementNS(NS.a, "a:fillRect"));
@@ -11732,26 +11871,26 @@ function drawingPatternPictureXml(fill) {
11732
11871
  }
11733
11872
 
11734
11873
  // drawingml/write-fill.ts
11735
- function setDrawingFillXml(properties2, xml) {
11736
- const doc = properties2.ownerDocument;
11874
+ function setDrawingFillXml(properties, xml) {
11875
+ const doc = properties.ownerDocument;
11737
11876
  const wrapper = parseXml(`<w xmlns:a="${NS.a}">${xml}</w>`);
11738
11877
  const fill = elements(wrapper.documentElement)[0];
11739
11878
  const names = ["solidFill", "gradFill", "pattFill", "blipFill", "grpFill", "noFill"];
11740
11879
  if (elements(wrapper.documentElement).length !== 1 || !fill || fill.namespaceURI !== NS.a || !names.includes(fill.localName))
11741
11880
  throw new Error("Invalid DrawingML fill XML");
11742
- const existing = elements(properties2).filter(
11881
+ const existing = elements(properties).filter(
11743
11882
  (node3) => node3.namespaceURI === NS.a && names.includes(node3.localName)
11744
11883
  );
11745
11884
  const next = doc.importNode(fill, true);
11746
- if (existing[0]) properties2.replaceChild(next, existing[0]);
11885
+ if (existing[0]) properties.replaceChild(next, existing[0]);
11747
11886
  else
11748
- properties2.insertBefore(
11887
+ properties.insertBefore(
11749
11888
  next,
11750
- elements(properties2).find(
11889
+ elements(properties).find(
11751
11890
  (node3) => node3.namespaceURI === NS.a && ["ln", "effectLst", "effectDag", "scene3d", "sp3d", "extLst"].includes(node3.localName)
11752
11891
  ) ?? null
11753
11892
  );
11754
- for (const extra of existing.slice(1)) properties2.removeChild(extra);
11893
+ for (const extra of existing.slice(1)) properties.removeChild(extra);
11755
11894
  }
11756
11895
  function drawingFillXml(fill) {
11757
11896
  if (fill.kind === "none") return "<a:noFill/>";
@@ -14643,18 +14782,18 @@ function pivotColumnEntries(pivot) {
14643
14782
  const root2 = { children: /* @__PURE__ */ new Map() };
14644
14783
  for (const record2 of pivot.records) {
14645
14784
  let current = root2;
14646
- indices.forEach((field3, level2) => {
14785
+ indices.forEach((field3, level3) => {
14647
14786
  const value3 = record2[field3] ?? null;
14648
14787
  const key2 = pivotValueKey(value3);
14649
14788
  let child3 = current.children.get(key2);
14650
14789
  if (!child3) {
14651
- child3 = { index: order[level2].get(key2), value: value3, children: /* @__PURE__ */ new Map() };
14790
+ child3 = { index: order[level3].get(key2), value: value3, children: /* @__PURE__ */ new Map() };
14652
14791
  current.children.set(key2, child3);
14653
14792
  }
14654
14793
  current = child3;
14655
14794
  });
14656
14795
  }
14657
- const visit = (node3, level2, path3, values, keys) => {
14796
+ const visit = (node3, level3, path3, values, keys) => {
14658
14797
  for (const child3 of [...node3.children.entries()].sort((a2, b) => a2[1].index - b[1].index)) {
14659
14798
  const here = {
14660
14799
  path: [...path3, child3[1].index],
@@ -14666,10 +14805,10 @@ function pivotColumnEntries(pivot) {
14666
14805
  key: columnKey(here.keys, here.keys.length),
14667
14806
  values: here.values
14668
14807
  };
14669
- if (level2 === names.length - 1) entries.push({ kind: "leaf", ...entry3 });
14808
+ if (level3 === names.length - 1) entries.push({ kind: "leaf", ...entry3 });
14670
14809
  else {
14671
- visit(child3[1], level2 + 1, here.path, here.values, here.keys);
14672
- const own = functions[level2];
14810
+ visit(child3[1], level3 + 1, here.path, here.values, here.keys);
14811
+ const own = functions[level3];
14673
14812
  if (own === "auto") entries.push({ kind: "subtotal", ...entry3 });
14674
14813
  else for (const fn of own) entries.push({ kind: "subtotal", ...entry3, fn });
14675
14814
  }
@@ -14715,9 +14854,9 @@ function pivotColumnHeaders(pivot, columns, rowLabels, valuesOnRows = false) {
14715
14854
  columns.entries.forEach((entry3, j) => {
14716
14855
  const at2 = labelColumns + j * count;
14717
14856
  if (entry3.kind === "leaf") {
14718
- entry3.path.forEach((_index, level2) => {
14719
- const continued = entry3.path.slice(0, level2 + 1).every((p, i) => p === previous[i]);
14720
- if (!continued) grid[1 + level2][at2] = labelOf(columns.names[level2], entry3.values[level2]);
14857
+ entry3.path.forEach((_index, level3) => {
14858
+ const continued = entry3.path.slice(0, level3 + 1).every((p, i) => p === previous[i]);
14859
+ if (!continued) grid[1 + level3][at2] = labelOf(columns.names[level3], entry3.values[level3]);
14721
14860
  });
14722
14861
  previous = entry3.path;
14723
14862
  if (count > 1) measures2.forEach((measure2, m) => grid[rows - 1][at2 + m] = measure2.caption);
@@ -14748,7 +14887,7 @@ function nestedPivotGrid(pivot) {
14748
14887
  const valuesAt = pivotValuesIndex(pivot);
14749
14888
  const onRows = valuesAt >= 0;
14750
14889
  const levels = depth + (onRows ? 1 : 0);
14751
- const fieldOf = (level2) => !onRows || level2 < valuesAt ? level2 : level2 === valuesAt ? -1 : level2 - 1;
14890
+ const fieldOf = (level3) => !onRows || level3 < valuesAt ? level3 : level3 === valuesAt ? -1 : level3 - 1;
14752
14891
  const axisItems = names.map((name3) => pivotItems(pivot, name3));
14753
14892
  const itemIndices = axisItems.map(
14754
14893
  (items) => new Map(items.map((item2, index2) => [pivotValueKey(item2), index2]))
@@ -14808,13 +14947,13 @@ function nestedPivotGrid(pivot) {
14808
14947
  (one) => fn ? aggregateValues(records2, pivot.fields.indexOf(one.field), fn) : pivotMeasureNumber(pivot, records2, one)
14809
14948
  );
14810
14949
  });
14811
- const labelCells = (path3, shown, level2, text7) => {
14950
+ const labelCells = (path3, shown, level3, text7) => {
14812
14951
  if (compact) return [text7];
14813
14952
  const row2 = Array(levels).fill(null);
14814
14953
  path3.labels.forEach((value3, at2) => {
14815
14954
  if (shown[at2]) row2[at2] = value3;
14816
14955
  });
14817
- row2[level2] = text7;
14956
+ row2[level3] = text7;
14818
14957
  return row2;
14819
14958
  };
14820
14959
  const push = (indent, build2) => {
@@ -14833,11 +14972,11 @@ function nestedPivotGrid(pivot) {
14833
14972
  ...measure2 !== void 0 ? { measure: measure2 } : {},
14834
14973
  ...type ? { type } : {}
14835
14974
  });
14836
- const walk = (level2, group2, measure2, path3) => {
14837
- const field3 = fieldOf(level2);
14838
- const last = level2 === levels - 1;
14975
+ const walk = (level3, group2, measure2, path3) => {
14976
+ const field3 = fieldOf(level3);
14977
+ const last = level3 === levels - 1;
14839
14978
  const repeated = Array.from(
14840
- { length: level2 },
14979
+ { length: level3 },
14841
14980
  (_v, k) => !!pivot.repeatLabels && fieldOf(k) >= 0
14842
14981
  );
14843
14982
  const leafShown = (firsts) => repeated.map((repeat, k) => repeat || tabular && firsts.slice(k + 1).every(Boolean));
@@ -14849,23 +14988,23 @@ function nestedPivotGrid(pivot) {
14849
14988
  firsts: [...path3.firsts, m === 0]
14850
14989
  };
14851
14990
  if (last)
14852
- return push(level2, () => [
14853
- labelCells(path3, leafShown(here.firsts), level2, one.caption),
14991
+ return push(level3, () => [
14992
+ labelCells(path3, leafShown(here.firsts), level3, one.caption),
14854
14993
  cells4(group2, void 0, m),
14855
14994
  entryOf(here.indices, m)
14856
14995
  ]);
14857
14996
  if (!tabular)
14858
- push(level2, () => [
14859
- labelCells(path3, repeated, level2, one.caption),
14997
+ push(level3, () => [
14998
+ labelCells(path3, repeated, level3, one.caption),
14860
14999
  blanks(),
14861
15000
  entryOf(here.indices, m)
14862
15001
  ]);
14863
- walk(level2 + 1, group2, m, here);
15002
+ walk(level3 + 1, group2, m, here);
14864
15003
  });
14865
15004
  return;
14866
15005
  }
14867
15006
  const own = functions[field3];
14868
- const valuesAbove = !onRows || valuesAt < level2;
15007
+ const valuesAbove = !onRows || valuesAt < level3;
14869
15008
  const showsValue = above && own === "auto" && valuesAbove;
14870
15009
  const children3 = [...group2.children.values()].sort((a2, b) => a2.index - b.index);
14871
15010
  children3.forEach((child3, position) => {
@@ -14876,22 +15015,22 @@ function nestedPivotGrid(pivot) {
14876
15015
  };
14877
15016
  const text7 = labelOf(names[field3], child3.value);
14878
15017
  if (last)
14879
- return push(level2, () => [
14880
- labelCells(path3, leafShown(here.firsts), level2, text7),
15018
+ return push(level3, () => [
15019
+ labelCells(path3, leafShown(here.firsts), level3, text7),
14881
15020
  cells4(child3, void 0, measure2),
14882
15021
  entryOf(here.indices, measure2)
14883
15022
  ]);
14884
15023
  if (!tabular)
14885
- push(level2, () => [
14886
- labelCells(path3, repeated, level2, text7),
15024
+ push(level3, () => [
15025
+ labelCells(path3, repeated, level3, text7),
14887
15026
  showsValue ? cells4(child3, void 0, measure2) : blanks(),
14888
15027
  entryOf(here.indices, measure2)
14889
15028
  ]);
14890
- walk(level2 + 1, child3, measure2, here);
15029
+ walk(level3 + 1, child3, measure2, here);
14891
15030
  if (field3 === depth - 1) return;
14892
15031
  const caption = String(text7);
14893
- const subtotal = (title, fn, one) => push(level2, () => [
14894
- labelCells(path3, repeated, level2, title),
15032
+ const subtotal = (title, fn, one) => push(level3, () => [
15033
+ labelCells(path3, repeated, level3, title),
14895
15034
  cells4(child3, fn, one),
14896
15035
  entryOf(here.indices, one, fn ?? "default")
14897
15036
  ]);
@@ -15996,8 +16135,8 @@ function parseSlicer(node3, sheet, partName) {
15996
16135
  if (start !== void 0) slicer.startItem = start;
15997
16136
  const locked = boolAttr(node3, "lockedPosition");
15998
16137
  if (locked !== void 0) slicer.lockedPosition = locked;
15999
- const level2 = numAttr(node3, "level");
16000
- if (level2 !== void 0) slicer.level = level2;
16138
+ const level3 = numAttr(node3, "level");
16139
+ if (level3 !== void 0) slicer.level = level3;
16001
16140
  if (extLst) slicer.extLstXml = selfContainedXml(extLst);
16002
16141
  return slicer;
16003
16142
  }
@@ -17324,10 +17463,10 @@ function blankComments(xml) {
17324
17463
  const at2 = match.index;
17325
17464
  const section3 = SECTIONS.find(([open2]) => xml.startsWith(open2, at2));
17326
17465
  if (!section3) return void 0;
17327
- const [open, close4] = section3;
17328
- const end = xml.indexOf(close4, at2 + open.length);
17466
+ const [open, close3] = section3;
17467
+ const end = xml.indexOf(close3, at2 + open.length);
17329
17468
  if (end < 0) return void 0;
17330
- const after = end + close4.length;
17469
+ const after = end + close3.length;
17331
17470
  if (open !== "<?") {
17332
17471
  pieces.push(xml.slice(copied, at2), " ".repeat(after - at2));
17333
17472
  copied = after;
@@ -17345,9 +17484,9 @@ function rootChildren(xml) {
17345
17484
  const namespaces = rootNamespaces(plain4);
17346
17485
  const root2 = ROOT.exec(plain4.slice(0, 8192));
17347
17486
  if (!namespaces || !root2 || (root2[2] ?? "").trimEnd().endsWith("/")) return void 0;
17348
- const close4 = plain4.lastIndexOf(`</${root2[1] ?? ""}`);
17349
- if (close4 < root2[0].length || !/^<\/[^\s>]+\s*>\s*$/.test(plain4.slice(close4))) return void 0;
17350
- const content2 = xml.slice(root2[0].length, close4);
17487
+ const close3 = plain4.lastIndexOf(`</${root2[1] ?? ""}`);
17488
+ if (close3 < root2[0].length || !/^<\/[^\s>]+\s*>\s*$/.test(plain4.slice(close3))) return void 0;
17489
+ const content2 = xml.slice(root2[0].length, close3);
17351
17490
  return { [Symbol.iterator]: () => liteChildElements(content2, namespaces) };
17352
17491
  }
17353
17492
  function findSheetData(plain4) {
@@ -17368,11 +17507,11 @@ function splitSheetData(xml) {
17368
17507
  const start = plain4 === void 0 ? void 0 : findSheetData(plain4);
17369
17508
  if (plain4 === void 0 || !start) return void 0;
17370
17509
  const { namespaces, tagName: tagName2, contentStart } = start;
17371
- const close4 = plain4.indexOf(`</${tagName2}`, contentStart);
17372
- if (close4 < 0 || OPEN.test(plain4.slice(contentStart - 1))) return void 0;
17373
- const data = xml.slice(contentStart, close4);
17510
+ const close3 = plain4.indexOf(`</${tagName2}`, contentStart);
17511
+ if (close3 < 0 || OPEN.test(plain4.slice(contentStart - 1))) return void 0;
17512
+ const data = xml.slice(contentStart, close3);
17374
17513
  return {
17375
- xml: xml.slice(0, contentStart) + xml.slice(close4),
17514
+ xml: xml.slice(0, contentStart) + xml.slice(close3),
17376
17515
  rows: { [Symbol.iterator]: () => liteChildElements(data, namespaces) }
17377
17516
  };
17378
17517
  }
@@ -17703,14 +17842,14 @@ function fromStoredSyntax(formula2) {
17703
17842
  if (name3 !== "ANCHORARRAY" && name3 !== "SINGLE") continue;
17704
17843
  const open = nextIndex(list2, i + 1);
17705
17844
  const arg = nextIndex(list2, open + 1);
17706
- const close4 = nextIndex(list2, arg + 1);
17845
+ const close3 = nextIndex(list2, arg + 1);
17707
17846
  const target2 = list2[arg];
17708
- if (list2[open]?.kind !== "open" || list2[close4]?.kind !== "close" || !target2) continue;
17847
+ if (list2[open]?.kind !== "open" || list2[close3]?.kind !== "close" || !target2) continue;
17709
17848
  const single2 = target2.kind === "ref" || target2.kind === "name" || target2.kind === "structured";
17710
17849
  if (name3 === "ANCHORARRAY" && !(target2.kind === "ref" && target2.ref?.kind === "cell")) continue;
17711
17850
  if (name3 === "SINGLE" && !single2) continue;
17712
17851
  const text7 = name3 === "ANCHORARRAY" ? `${target2.text}#` : `@${target2.text}`;
17713
- for (let k = i; k <= close4; k++) list2[k].text = "";
17852
+ for (let k = i; k <= close3; k++) list2[k].text = "";
17714
17853
  token.text = text7;
17715
17854
  changed = true;
17716
17855
  }
@@ -17856,6 +17995,142 @@ function parseDocProps(core, app, custom) {
17856
17995
  };
17857
17996
  }
17858
17997
 
17998
+ // geometry/guide-formula-eval.ts
17999
+ var ANGLE_SCALE = 6e4;
18000
+ function angleToRadians(ooxmlAngle) {
18001
+ return ooxmlAngle / ANGLE_SCALE * (Math.PI / 180);
18002
+ }
18003
+ function parseFormula(fmla) {
18004
+ const parts = fmla.trim().split(/\s+/);
18005
+ const op = parts[0] ?? "";
18006
+ const args = parts.slice(1);
18007
+ return { op, args };
18008
+ }
18009
+ function resolveOperand(token, variables) {
18010
+ const num = Number(token);
18011
+ if (Number.isFinite(num)) {
18012
+ return num;
18013
+ }
18014
+ const value3 = variables.get(token);
18015
+ if (value3 !== void 0) {
18016
+ return value3;
18017
+ }
18018
+ return 0;
18019
+ }
18020
+ function evaluateFormula(parsed, vars) {
18021
+ const r = (idx) => resolveOperand(parsed.args[idx] ?? "0", vars);
18022
+ switch (parsed.op) {
18023
+ // val x — literal value
18024
+ case "val":
18025
+ return r(0);
18026
+ // abs x — absolute value
18027
+ case "abs":
18028
+ return Math.abs(r(0));
18029
+ // sqrt x — square root
18030
+ case "sqrt":
18031
+ return Math.sqrt(Math.max(r(0), 0));
18032
+ // +- x y z — x + y - z
18033
+ case "+-":
18034
+ return r(0) + r(1) - r(2);
18035
+ // */ x y z — (x * y) / z
18036
+ case "*/": {
18037
+ const z = r(2);
18038
+ if (z === 0) {
18039
+ return 0;
18040
+ }
18041
+ return r(0) * r(1) / z;
18042
+ }
18043
+ // +/ x y z — (x + y) / z
18044
+ case "+/": {
18045
+ const z = r(2);
18046
+ if (z === 0) {
18047
+ return 0;
18048
+ }
18049
+ return (r(0) + r(1)) / z;
18050
+ }
18051
+ // ?: x y z — if x > 0 then y else z
18052
+ case "?:":
18053
+ case "if":
18054
+ return r(0) > 0 ? r(1) : r(2);
18055
+ // min x y — minimum
18056
+ case "min":
18057
+ return Math.min(r(0), r(1));
18058
+ // max x y — maximum
18059
+ case "max":
18060
+ return Math.max(r(0), r(1));
18061
+ // mod x y z — sqrt(x² + y² + z²)
18062
+ case "mod": {
18063
+ const a2 = r(0);
18064
+ const b = r(1);
18065
+ const c2 = r(2);
18066
+ return Math.sqrt(a2 * a2 + b * b + c2 * c2);
18067
+ }
18068
+ // pin x y z — clamp y between x and z
18069
+ case "pin": {
18070
+ const lo = r(0);
18071
+ const val = r(1);
18072
+ const hi = r(2);
18073
+ return Math.max(lo, Math.min(val, hi));
18074
+ }
18075
+ // sin x y — x * sin(y) where y is in OOXML angle units
18076
+ case "sin": {
18077
+ const sinVal = Math.sin(angleToRadians(r(1)));
18078
+ if (!Number.isFinite(sinVal)) {
18079
+ return 0;
18080
+ }
18081
+ return r(0) * sinVal;
18082
+ }
18083
+ // cos x y — x * cos(y) where y is in OOXML angle units
18084
+ case "cos": {
18085
+ const cosVal = Math.cos(angleToRadians(r(1)));
18086
+ if (!Number.isFinite(cosVal)) {
18087
+ return 0;
18088
+ }
18089
+ return r(0) * cosVal;
18090
+ }
18091
+ // tan x y — x * tan(y) where y is in OOXML angle units
18092
+ case "tan": {
18093
+ const angle = angleToRadians(r(1));
18094
+ const tanVal = Math.tan(angle);
18095
+ if (!Number.isFinite(tanVal)) {
18096
+ return 0;
18097
+ }
18098
+ return r(0) * tanVal;
18099
+ }
18100
+ // atan x — atan(x) result in OOXML angle units
18101
+ // x is a ratio scaled by the shape coordinate space
18102
+ case "atan": {
18103
+ const radians = Math.atan(r(0));
18104
+ return radians * 180 * ANGLE_SCALE / Math.PI;
18105
+ }
18106
+ // at2 x y -> arctan(y / x), i.e. Math.atan2(y, x), result in OOXML angle
18107
+ // units. ECMA-376 / ISO-IEC-29500-1 section 20.1.9.6 defines the operand
18108
+ // order as (x, y) with the ARGUMENTS REVERSED relative to Math.atan2, so
18109
+ // the first operand is the horizontal component and the second is the
18110
+ // vertical one. This matches the companion `cat2`/`sat2` operators below,
18111
+ // which take (x, y, z) and compute atan2(z, y).
18112
+ case "at2":
18113
+ case "atan2": {
18114
+ const radians = Math.atan2(r(1), r(0));
18115
+ return radians * 180 * ANGLE_SCALE / Math.PI;
18116
+ }
18117
+ // cat2 x y z — x * cos(atan2(z, y))
18118
+ // Computes the cosine-component of a vector scaled by x
18119
+ case "cat2": {
18120
+ const angle = Math.atan2(r(2), r(1));
18121
+ return r(0) * Math.cos(angle);
18122
+ }
18123
+ // sat2 x y z — x * sin(atan2(z, y))
18124
+ // Computes the sine-component of a vector scaled by x
18125
+ case "sat2": {
18126
+ const angle = Math.atan2(r(2), r(1));
18127
+ return r(0) * Math.sin(angle);
18128
+ }
18129
+ default:
18130
+ return Number(parsed.op) || 0;
18131
+ }
18132
+ }
18133
+
17859
18134
  // geometry/indexed.ts
17860
18135
  function at(items, index2) {
17861
18136
  const value3 = items[index2];
@@ -17865,6 +18140,251 @@ function at(items, index2) {
17865
18140
  return value3;
17866
18141
  }
17867
18142
 
18143
+ // geometry/guide-formula-api.ts
18144
+ function createBuiltinVariables(ctx) {
18145
+ const { w, h } = ctx;
18146
+ const vars = /* @__PURE__ */ new Map();
18147
+ vars.set("w", w);
18148
+ vars.set("h", h);
18149
+ vars.set("l", 0);
18150
+ vars.set("t", 0);
18151
+ vars.set("r", w);
18152
+ vars.set("b", h);
18153
+ vars.set("hc", w / 2);
18154
+ vars.set("vc", h / 2);
18155
+ const widthDivisors = [2, 3, 4, 5, 6, 8, 10, 12, 16, 32];
18156
+ for (const d of widthDivisors) {
18157
+ vars.set(`wd${d}`, w / d);
18158
+ }
18159
+ const heightDivisors = [2, 3, 4, 5, 6, 8, 10, 12, 16, 32];
18160
+ for (const d of heightDivisors) {
18161
+ vars.set(`hd${d}`, h / d);
18162
+ }
18163
+ const ss = Math.min(w, h);
18164
+ const ls = Math.max(w, h);
18165
+ vars.set("ss", ss);
18166
+ vars.set("ls", ls);
18167
+ const ssDivisors = [2, 4, 6, 8, 16, 32];
18168
+ for (const d of ssDivisors) {
18169
+ vars.set(`ssd${d}`, ss / d);
18170
+ }
18171
+ vars.set("cd2", 180 * ANGLE_SCALE);
18172
+ vars.set("cd4", 90 * ANGLE_SCALE);
18173
+ vars.set("cd8", 45 * ANGLE_SCALE);
18174
+ vars.set("3cd4", 270 * ANGLE_SCALE);
18175
+ vars.set("3cd8", 135 * ANGLE_SCALE);
18176
+ vars.set("5cd8", 225 * ANGLE_SCALE);
18177
+ vars.set("7cd8", 315 * ANGLE_SCALE);
18178
+ return vars;
18179
+ }
18180
+
18181
+ // drawingml/scene3d-presets.ts
18182
+ var CAMERA_PRESETS = /* @__PURE__ */ new Set([
18183
+ "legacyObliqueTopLeft",
18184
+ "legacyObliqueTop",
18185
+ "legacyObliqueTopRight",
18186
+ "legacyObliqueLeft",
18187
+ "legacyObliqueFront",
18188
+ "legacyObliqueRight",
18189
+ "legacyObliqueBottomLeft",
18190
+ "legacyObliqueBottom",
18191
+ "legacyObliqueBottomRight",
18192
+ "legacyPerspectiveTopLeft",
18193
+ "legacyPerspectiveTop",
18194
+ "legacyPerspectiveTopRight",
18195
+ "legacyPerspectiveLeft",
18196
+ "legacyPerspectiveFront",
18197
+ "legacyPerspectiveRight",
18198
+ "legacyPerspectiveBottomLeft",
18199
+ "legacyPerspectiveBottom",
18200
+ "legacyPerspectiveBottomRight",
18201
+ "orthographicFront",
18202
+ "isometricTopUp",
18203
+ "isometricTopDown",
18204
+ "isometricBottomUp",
18205
+ "isometricBottomDown",
18206
+ "isometricLeftUp",
18207
+ "isometricLeftDown",
18208
+ "isometricRightUp",
18209
+ "isometricRightDown",
18210
+ "isometricOffAxis1Left",
18211
+ "isometricOffAxis1Right",
18212
+ "isometricOffAxis1Top",
18213
+ "isometricOffAxis2Left",
18214
+ "isometricOffAxis2Right",
18215
+ "isometricOffAxis2Top",
18216
+ "isometricOffAxis3Left",
18217
+ "isometricOffAxis3Right",
18218
+ "isometricOffAxis3Bottom",
18219
+ "isometricOffAxis4Left",
18220
+ "isometricOffAxis4Right",
18221
+ "isometricOffAxis4Bottom",
18222
+ "obliqueTopLeft",
18223
+ "obliqueTop",
18224
+ "obliqueTopRight",
18225
+ "obliqueLeft",
18226
+ "obliqueRight",
18227
+ "obliqueBottomLeft",
18228
+ "obliqueBottom",
18229
+ "obliqueBottomRight",
18230
+ "perspectiveFront",
18231
+ "perspectiveLeft",
18232
+ "perspectiveRight",
18233
+ "perspectiveAbove",
18234
+ "perspectiveBelow",
18235
+ "perspectiveAboveLeftFacing",
18236
+ "perspectiveAboveRightFacing",
18237
+ "perspectiveContrastingLeftFacing",
18238
+ "perspectiveContrastingRightFacing",
18239
+ "perspectiveHeroicLeftFacing",
18240
+ "perspectiveHeroicRightFacing",
18241
+ "perspectiveHeroicExtremeLeftFacing",
18242
+ "perspectiveHeroicExtremeRightFacing",
18243
+ "perspectiveRelaxed",
18244
+ "perspectiveRelaxedModerately"
18245
+ ]);
18246
+ var LIGHT_RIGS = /* @__PURE__ */ new Set([
18247
+ "legacyFlat1",
18248
+ "legacyFlat2",
18249
+ "legacyFlat3",
18250
+ "legacyFlat4",
18251
+ "legacyNormal1",
18252
+ "legacyNormal2",
18253
+ "legacyNormal3",
18254
+ "legacyNormal4",
18255
+ "legacyHarsh1",
18256
+ "legacyHarsh2",
18257
+ "legacyHarsh3",
18258
+ "legacyHarsh4",
18259
+ "threePt",
18260
+ "balanced",
18261
+ "soft",
18262
+ "harsh",
18263
+ "flood",
18264
+ "contrasting",
18265
+ "morning",
18266
+ "sunrise",
18267
+ "sunset",
18268
+ "chilly",
18269
+ "freezing",
18270
+ "flat",
18271
+ "twoPt",
18272
+ "glow",
18273
+ "brightRoom"
18274
+ ]);
18275
+ var LIGHT_DIRECTIONS = /* @__PURE__ */ new Set(["tl", "t", "tr", "l", "r", "bl", "b", "br"]);
18276
+
18277
+ // drawingml/read-3d-values.ts
18278
+ var integer3 = (value3) => {
18279
+ if (value3 === void 0 || value3 === null || String(value3).trim() === "") return void 0;
18280
+ const n = Number(value3);
18281
+ return Number.isSafeInteger(n) ? n : void 0;
18282
+ };
18283
+ function readScene3DValues(node3, read) {
18284
+ const out = {};
18285
+ const camera = read.child(node3, "camera");
18286
+ const light = read.child(node3, "lightRig");
18287
+ for (const [key2, source, attribute4, choices] of [
18288
+ ["cameraPreset", camera, "prst", CAMERA_PRESETS],
18289
+ ["lightRigType", light, "rig", LIGHT_RIGS],
18290
+ ["lightRigDirection", light, "dir", LIGHT_DIRECTIONS]
18291
+ ]) {
18292
+ const token = String(read.attribute(source, attribute4) ?? "").trim();
18293
+ if (choices.has(token)) out[key2] = token;
18294
+ }
18295
+ const fov = integer3(read.attribute(camera, "fov"));
18296
+ if (fov !== void 0 && fov >= 0 && fov <= 108e5) out.cameraFieldOfView = fov;
18297
+ const zoom = picturePercentage(read.attribute(camera, "zoom"));
18298
+ if (zoom !== void 0 && zoom > 0) out.cameraZoom = zoom;
18299
+ for (const [prefix2, source] of [
18300
+ ["camera", camera],
18301
+ ["lightRig", light]
18302
+ ]) {
18303
+ const rot = read.child(source, "rot");
18304
+ for (const [axis, key2] of [
18305
+ ["lat", "RotX"],
18306
+ ["lon", "RotY"],
18307
+ ["rev", "RotZ"]
18308
+ ]) {
18309
+ const value3 = integer3(read.attribute(rot, axis));
18310
+ if (value3 !== void 0 && value3 >= 0 && value3 < 216e5) out[`${prefix2}${key2}`] = value3;
18311
+ }
18312
+ }
18313
+ const backdrop = read.child(node3, "backdrop");
18314
+ if (backdrop !== void 0) {
18315
+ out.hasBackdrop = true;
18316
+ for (const [name3, prefix2, attr2] of [
18317
+ ["anchor", "backdropAnchor", ""],
18318
+ ["norm", "backdropNormal", "d"],
18319
+ ["up", "backdropUp", "d"]
18320
+ ]) {
18321
+ const point2 = read.child(backdrop, name3);
18322
+ for (const [axis, suffix] of [
18323
+ ["x", "X"],
18324
+ ["y", "Y"],
18325
+ ["z", "Z"]
18326
+ ]) {
18327
+ const value3 = integer3(read.attribute(point2, `${attr2}${axis}`));
18328
+ if (value3 !== void 0) out[`${prefix2}${suffix}`] = value3;
18329
+ }
18330
+ }
18331
+ }
18332
+ return out;
18333
+ }
18334
+ function readText3DValues(node3, read) {
18335
+ const out = {};
18336
+ for (const [key2, attribute4] of [
18337
+ ["extrusionHeight", "extrusionH"],
18338
+ ["contourWidth", "contourW"],
18339
+ ["z", "z"]
18340
+ ]) {
18341
+ const value3 = integer3(read.attribute(node3, attribute4));
18342
+ if (value3 !== void 0) out[key2] = value3;
18343
+ }
18344
+ const material = String(read.attribute(node3, "prstMaterial") ?? "").trim();
18345
+ if (material) out.presetMaterial = material;
18346
+ for (const [name3, prefix2] of [
18347
+ ["bevelT", "bevelTop"],
18348
+ ["bevelB", "bevelBottom"]
18349
+ ]) {
18350
+ const bevel = read.child(node3, name3);
18351
+ if (!bevel) continue;
18352
+ out[`${prefix2}Type`] = String(read.attribute(bevel, "prst") || "circle").trim();
18353
+ for (const [attribute4, suffix] of [
18354
+ ["w", "Width"],
18355
+ ["h", "Height"]
18356
+ ]) {
18357
+ const value3 = integer3(read.attribute(bevel, attribute4));
18358
+ if (value3 !== void 0) out[`${prefix2}${suffix}`] = value3;
18359
+ }
18360
+ }
18361
+ return out;
18362
+ }
18363
+
18364
+ // drawingml/read-text-3d.ts
18365
+ var DOM_3D_READER = {
18366
+ attribute: (node3, name3) => node3?.getAttribute(name3),
18367
+ child: (node3, name3) => first(node3, name3, NS.a)
18368
+ };
18369
+ function parseDrawingTextScene3D(node3) {
18370
+ return { ...readScene3DValues(node3, DOM_3D_READER), sourceXml: buildXml(node3) };
18371
+ }
18372
+ function parseDrawingTextShape3D(node3) {
18373
+ const extrusionColor = parseDrawingColorIn(first(node3, "extrusionClr", NS.a));
18374
+ const contourColor = parseDrawingColorIn(first(node3, "contourClr", NS.a));
18375
+ return {
18376
+ ...readText3DValues(node3, DOM_3D_READER),
18377
+ sourceXml: buildXml(node3),
18378
+ ...extrusionColor ? { extrusionColor } : {},
18379
+ ...contourColor ? { contourColor } : {}
18380
+ };
18381
+ }
18382
+ function parseDrawingFlatText3D(node3) {
18383
+ const raw2 = node3.getAttribute("z");
18384
+ const z = raw2 === null || !raw2.trim() ? NaN : Number(raw2);
18385
+ return { sourceXml: buildXml(node3), ...Number.isSafeInteger(z) ? { z } : {} };
18386
+ }
18387
+
17868
18388
  // drawingml/read-run-properties.ts
17869
18389
  function outerXml2(element2) {
17870
18390
  return buildXml(element2);
@@ -18026,8 +18546,8 @@ var BOOLEAN_ATTRIBUTES2 = [
18026
18546
  ["hangingPunctuation", "hangingPunct"]
18027
18547
  ];
18028
18548
  function readAttributes2(element2, out) {
18029
- const level2 = integerAttribute(element2, "lvl");
18030
- if (level2 !== void 0) out.level = Math.min(Math.max(level2, 0), 8);
18549
+ const level3 = integerAttribute(element2, "lvl");
18550
+ if (level3 !== void 0) out.level = Math.min(Math.max(level3, 0), 8);
18031
18551
  const align = stringAttribute(element2, "algn");
18032
18552
  if (align) out.align = align;
18033
18553
  for (const [key2, name3] of EMU_ATTRIBUTES) {
@@ -18186,7 +18706,13 @@ function parseDrawingBodyProperties(element2) {
18186
18706
  ...read("fontScale") !== void 0 && fontScale !== void 0 ? { fontScale } : {},
18187
18707
  ...read("lnSpcReduction") !== void 0 && reduction !== void 0 ? { lineSpacingReduction: reduction } : {}
18188
18708
  };
18189
- } else extra.push(outerXml2(child3));
18709
+ } else if (name3 === "scene3d" && children(element2, "scene3d", NS.a).length === 1)
18710
+ out.scene3d = parseDrawingTextScene3D(child3);
18711
+ else if (name3 === "sp3d" && children(element2, "sp3d", NS.a).length === 1 && !first(element2, "flatTx", NS.a))
18712
+ out.shape3d = parseDrawingTextShape3D(child3);
18713
+ else if (name3 === "flatTx" && children(element2, "flatTx", NS.a).length === 1 && !first(element2, "sp3d", NS.a))
18714
+ out.flatText3d = parseDrawingFlatText3D(child3);
18715
+ else extra.push(outerXml2(child3));
18190
18716
  }
18191
18717
  if (extra.length) out.extraXml = extra;
18192
18718
  return out;
@@ -18196,8 +18722,8 @@ function parseDrawingListStyle(element2) {
18196
18722
  const style2 = { levels: [] };
18197
18723
  const extra = [];
18198
18724
  for (const child3 of elements(element2)) {
18199
- const level2 = isDrawingElement(child3) ? /^lvl([1-9])pPr$/u.exec(child3.localName) : null;
18200
- if (level2) style2.levels[Number(level2[1]) - 1] = parseDrawingParagraphProperties(child3);
18725
+ const level3 = isDrawingElement(child3) ? /^lvl([1-9])pPr$/u.exec(child3.localName) : null;
18726
+ if (level3) style2.levels[Number(level3[1]) - 1] = parseDrawingParagraphProperties(child3);
18201
18727
  else if (isDrawingElement(child3) && child3.localName === "defPPr")
18202
18728
  style2.default = parseDrawingParagraphProperties(child3) ?? {};
18203
18729
  else extra.push(outerXml2(child3));
@@ -18213,15 +18739,15 @@ function readItem(child3) {
18213
18739
  const name3 = isDrawingElement(child3) ? child3.localName : "";
18214
18740
  if (name3 === "pPr" || name3 === "endParaRPr") return void 0;
18215
18741
  if (name3 === "r") {
18216
- const properties2 = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18217
- return { kind: "run", text: textOf(child3), ...properties2 ? { properties: properties2 } : {} };
18742
+ const properties = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18743
+ return { kind: "run", text: textOf(child3), ...properties ? { properties } : {} };
18218
18744
  }
18219
18745
  if (name3 === "br") {
18220
- const properties2 = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18221
- return { kind: "break", ...properties2 ? { properties: properties2 } : {} };
18746
+ const properties = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18747
+ return { kind: "break", ...properties ? { properties } : {} };
18222
18748
  }
18223
18749
  if (name3 === "fld") {
18224
- const properties2 = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18750
+ const properties = parseDrawingRunProperties(first(child3, "rPr", NS.a));
18225
18751
  const paragraphProperties = parseDrawingParagraphProperties(first(child3, "pPr", NS.a));
18226
18752
  const type = child3.getAttribute("type");
18227
18753
  return {
@@ -18229,7 +18755,7 @@ function readItem(child3) {
18229
18755
  id: child3.getAttribute("id") ?? "",
18230
18756
  ...type ? { type } : {},
18231
18757
  text: textOf(child3),
18232
- ...properties2 ? { properties: properties2 } : {},
18758
+ ...properties ? { properties } : {},
18233
18759
  ...paragraphProperties ? { paragraphProperties } : {}
18234
18760
  };
18235
18761
  }
@@ -18241,10 +18767,10 @@ function parseDrawingParagraph(element2) {
18241
18767
  const item2 = readItem(child3);
18242
18768
  if (item2) items.push(item2);
18243
18769
  }
18244
- const properties2 = parseDrawingParagraphProperties(first(element2, "pPr", NS.a));
18770
+ const properties = parseDrawingParagraphProperties(first(element2, "pPr", NS.a));
18245
18771
  const endProperties = parseDrawingRunProperties(first(element2, "endParaRPr", NS.a));
18246
18772
  return {
18247
- ...properties2 ? { properties: properties2 } : {},
18773
+ ...properties ? { properties } : {},
18248
18774
  items,
18249
18775
  ...endProperties ? { endProperties } : {}
18250
18776
  };
@@ -18650,9 +19176,9 @@ function parsePoint(element2) {
18650
19176
  text: paragraphs.join("\n"),
18651
19177
  ...textParagraphs2 ? { textParagraphs: textParagraphs2 } : {}
18652
19178
  };
18653
- const properties2 = first(element2, "spPr", NS.dgm);
18654
- const fill = parseDrawingFill(properties2);
18655
- const line2 = parseDrawingLine(first(properties2, "ln", NS.a));
19179
+ const properties = first(element2, "spPr", NS.dgm);
19180
+ const fill = parseDrawingFill(properties);
19181
+ const line2 = parseDrawingLine(first(properties, "ln", NS.a));
18656
19182
  if (fill) point2.fill = fill;
18657
19183
  if (line2) point2.line = line2;
18658
19184
  const optional = [
@@ -18928,19 +19454,19 @@ function parseSpacing(parent) {
18928
19454
  }
18929
19455
  return void 0;
18930
19456
  }
18931
- function parseProperties(properties2) {
19457
+ function parseProperties(properties) {
18932
19458
  const parsed = {};
18933
- const size3 = Number.parseInt(properties2?.getAttribute("sz") ?? "", 10);
19459
+ const size3 = Number.parseInt(properties?.getAttribute("sz") ?? "", 10);
18934
19460
  if (Number.isFinite(size3)) parsed.sizePt = size3 / 100;
18935
- const bold = booleanAttribute(properties2, "b");
19461
+ const bold = booleanAttribute(properties, "b");
18936
19462
  if (bold !== void 0) parsed.bold = bold;
18937
- const italic = booleanAttribute(properties2, "i");
19463
+ const italic = booleanAttribute(properties, "i");
18938
19464
  if (italic !== void 0) parsed.italic = italic;
18939
- const underline = properties2?.getAttribute("u");
19465
+ const underline = properties?.getAttribute("u");
18940
19466
  if (underline) parsed.underline = underline !== "none";
18941
- const color2 = parseDrawingColorIn(first(properties2, "solidFill", NS.a));
19467
+ const color2 = parseDrawingColorIn(first(properties, "solidFill", NS.a));
18942
19468
  if (color2) parsed.color = color2;
18943
- const typeface2 = first(properties2, "latin", NS.a)?.getAttribute("typeface");
19469
+ const typeface2 = first(properties, "latin", NS.a)?.getAttribute("typeface");
18944
19470
  if (typeface2) parsed.typeface = typeface2;
18945
19471
  return parsed;
18946
19472
  }
@@ -18955,12 +19481,12 @@ function parseParagraph(paragraph2) {
18955
19481
  for (const child3 of elements(paragraph2))
18956
19482
  if (child3.namespaceURI === NS.a && ["r", "fld", "br"].includes(child3.localName))
18957
19483
  runs.push(parseRun(child3));
18958
- const properties2 = first(paragraph2, "pPr", NS.a);
18959
- const align = properties2?.getAttribute("algn");
18960
- const defaults = parseProperties(first(properties2, "defRPr", NS.a));
18961
- const lineSpacing = parseSpacing(first(properties2, "lnSpc", NS.a));
18962
- const spaceBefore = parseSpacing(first(properties2, "spcBef", NS.a));
18963
- const spaceAfter = parseSpacing(first(properties2, "spcAft", NS.a));
19484
+ const properties = first(paragraph2, "pPr", NS.a);
19485
+ const align = properties?.getAttribute("algn");
19486
+ const defaults = parseProperties(first(properties, "defRPr", NS.a));
19487
+ const lineSpacing = parseSpacing(first(properties, "lnSpc", NS.a));
19488
+ const spaceBefore = parseSpacing(first(properties, "spcBef", NS.a));
19489
+ const spaceAfter = parseSpacing(first(properties, "spcAft", NS.a));
18964
19490
  return {
18965
19491
  ...align ? { align } : {},
18966
19492
  ...Object.keys(defaults).length ? { defaultProperties: defaults } : {},
@@ -18972,13 +19498,13 @@ function parseParagraph(paragraph2) {
18972
19498
  }
18973
19499
  function parseDrawingTextBody(body) {
18974
19500
  if (!body) return void 0;
18975
- const properties2 = first(body, "bodyPr", NS.a);
19501
+ const properties = first(body, "bodyPr", NS.a);
18976
19502
  const paragraphs = children(body, "p", NS.a).map(parseParagraph);
18977
19503
  const result2 = {
18978
19504
  paragraphs,
18979
19505
  text: paragraphs.map((paragraph2) => paragraph2.runs.map((run2) => run2.text).join("")).join("\n")
18980
19506
  };
18981
- const anchor = properties2?.getAttribute("anchor");
19507
+ const anchor = properties?.getAttribute("anchor");
18982
19508
  if (anchor) result2.anchor = anchor;
18983
19509
  const insets = {};
18984
19510
  for (const [key2, attribute4] of [
@@ -18987,13 +19513,115 @@ function parseDrawingTextBody(body) {
18987
19513
  ["right", "rIns"],
18988
19514
  ["bottom", "bIns"]
18989
19515
  ]) {
18990
- const value3 = Number.parseInt(properties2?.getAttribute(attribute4) ?? "", 10);
19516
+ const value3 = Number.parseInt(properties?.getAttribute(attribute4) ?? "", 10);
18991
19517
  if (Number.isFinite(value3)) insets[key2] = value3;
18992
19518
  }
18993
19519
  if (Object.keys(insets).length > 0) result2.insetsEmu = insets;
18994
19520
  return result2;
18995
19521
  }
18996
19522
 
19523
+ // drawingml/custom-geometry.ts
19524
+ var ARITY3 = {
19525
+ val: 1,
19526
+ abs: 1,
19527
+ sqrt: 1,
19528
+ "+-": 3,
19529
+ "*/": 3,
19530
+ "+/": 3,
19531
+ "?:": 3,
19532
+ at2: 2,
19533
+ cat2: 3,
19534
+ cos: 2,
19535
+ max: 2,
19536
+ min: 2,
19537
+ mod: 3,
19538
+ pin: 3,
19539
+ sat2: 3,
19540
+ sin: 2,
19541
+ tan: 2
19542
+ };
19543
+ function operand(value3, vars) {
19544
+ if (value3 === null || !value3.trim()) return NaN;
19545
+ const literal2 = Number(value3);
19546
+ return Number.isFinite(literal2) ? literal2 : vars.get(value3) ?? NaN;
19547
+ }
19548
+ function parseCustomGeometry(custom, width, height) {
19549
+ const pathList = first(custom, "pathLst", NS.a);
19550
+ if (!pathList) return void 0;
19551
+ const pathNodes = children(pathList, "path", NS.a);
19552
+ const contextWidth = width;
19553
+ const contextHeight = height;
19554
+ const vars = createBuiltinVariables({ w: contextWidth, h: contextHeight });
19555
+ for (const list2 of ["avLst", "gdLst"]) {
19556
+ const parent = first(custom, list2, NS.a);
19557
+ if (!parent) continue;
19558
+ for (const guide of children(parent, "gd", NS.a)) {
19559
+ const name3 = guide.getAttribute("name");
19560
+ const formula2 = parseFormula(guide.getAttribute("fmla") ?? "");
19561
+ if (!name3 || ARITY3[formula2.op] !== formula2.args.length || formula2.args.some((arg) => !Number.isFinite(operand(arg, vars))))
19562
+ return void 0;
19563
+ const result2 = evaluateFormula(formula2, vars);
19564
+ if (!Number.isFinite(result2)) return void 0;
19565
+ vars.set(name3, result2);
19566
+ }
19567
+ }
19568
+ const paths = [];
19569
+ for (const path3 of pathNodes) {
19570
+ const commands = [];
19571
+ const value3 = (node3, name3) => operand(node3.getAttribute(name3), vars);
19572
+ for (const node3 of elements(path3)) {
19573
+ if (node3.namespaceURI !== NS.a) return void 0;
19574
+ const points2 = children(node3, "pt", NS.a).map((point2) => ({
19575
+ x: value3(point2, "x"),
19576
+ y: value3(point2, "y")
19577
+ }));
19578
+ if (points2.some((point2) => !Number.isFinite(point2.x) || !Number.isFinite(point2.y)))
19579
+ return void 0;
19580
+ const [p0, p1, p2] = points2;
19581
+ switch (node3.localName) {
19582
+ case "moveTo":
19583
+ case "lnTo":
19584
+ if (points2.length !== 1 || !p0) return void 0;
19585
+ commands.push({ op: node3.localName === "moveTo" ? "M" : "L", ...p0 });
19586
+ break;
19587
+ case "quadBezTo":
19588
+ if (points2.length !== 2 || !p0 || !p1) return void 0;
19589
+ commands.push({ op: "Q", x1: p0.x, y1: p0.y, ...p1 });
19590
+ break;
19591
+ case "cubicBezTo":
19592
+ if (points2.length !== 3 || !p0 || !p1 || !p2) return void 0;
19593
+ commands.push({ op: "C", x1: p0.x, y1: p0.y, x2: p1.x, y2: p1.y, ...p2 });
19594
+ break;
19595
+ case "arcTo": {
19596
+ const wR = value3(node3, "wR");
19597
+ const hR = value3(node3, "hR");
19598
+ const start = value3(node3, "stAng");
19599
+ const swing = value3(node3, "swAng");
19600
+ if (![wR, hR, start, swing].every(Number.isFinite)) return void 0;
19601
+ commands.push({ op: "A", wR, hR, startAngle: start / 6e4, swingAngle: swing / 6e4 });
19602
+ break;
19603
+ }
19604
+ case "close":
19605
+ commands.push({ op: "Z" });
19606
+ break;
19607
+ default:
19608
+ return void 0;
19609
+ }
19610
+ }
19611
+ const pathWidth = path3.hasAttribute("w") ? Number(path3.getAttribute("w")) : contextWidth;
19612
+ const pathHeight = path3.hasAttribute("h") ? Number(path3.getAttribute("h")) : contextHeight;
19613
+ if (![pathWidth, pathHeight].every((n) => Number.isFinite(n) && n > 0)) return void 0;
19614
+ paths.push({
19615
+ commands,
19616
+ width: pathWidth,
19617
+ height: pathHeight,
19618
+ ...path3.getAttribute("fill") ? { fill: path3.getAttribute("fill") } : {},
19619
+ ...["0", "false"].includes(path3.getAttribute("stroke") ?? "") ? { stroke: false } : {}
19620
+ });
19621
+ }
19622
+ return paths.length ? paths : void 0;
19623
+ }
19624
+
18997
19625
  // drawingml/drawing-geometry.ts
18998
19626
  var int = (element2, name3) => Number.parseInt(element2?.getAttribute(name3) ?? "", 10);
18999
19627
  function parseFrame(container) {
@@ -19018,74 +19646,13 @@ function parseTransform(xfrm) {
19018
19646
  ...booleanAttribute(xfrm, "flipV") ? { flipVertical: true } : {}
19019
19647
  };
19020
19648
  }
19021
- function parsePathCommands(path3) {
19022
- const commands = [];
19023
- const point2 = (element2) => {
19024
- const x = int(element2, "x");
19025
- const y = int(element2, "y");
19026
- return Number.isFinite(x) && Number.isFinite(y) ? { x, y } : void 0;
19027
- };
19028
- for (const element2 of Array.from(path3.childNodes)) {
19029
- if (element2.nodeType !== 1) continue;
19030
- const node3 = element2;
19031
- const points2 = children(node3, "pt", NS.a).map(point2);
19032
- if (points2.some((entry3) => entry3 === void 0)) return void 0;
19033
- const [p0, p1, p2] = points2;
19034
- switch (node3.localName) {
19035
- case "moveTo":
19036
- case "lnTo":
19037
- if (!p0) return void 0;
19038
- commands.push({ op: node3.localName === "moveTo" ? "M" : "L", ...p0 });
19039
- break;
19040
- case "cubicBezTo":
19041
- if (!p0 || !p1 || !p2) return void 0;
19042
- commands.push({ op: "C", x1: p0.x, y1: p0.y, x2: p1.x, y2: p1.y, x: p2.x, y: p2.y });
19043
- break;
19044
- case "quadBezTo":
19045
- if (!p0 || !p1) return void 0;
19046
- commands.push({ op: "Q", x1: p0.x, y1: p0.y, x: p1.x, y: p1.y });
19047
- break;
19048
- case "arcTo": {
19049
- const wR = int(node3, "wR");
19050
- const hR = int(node3, "hR");
19051
- const startAngle = int(node3, "stAng");
19052
- const swingAngle = int(node3, "swAng");
19053
- if (![wR, hR, startAngle, swingAngle].every(Number.isFinite)) return void 0;
19054
- commands.push({
19055
- op: "A",
19056
- wR,
19057
- hR,
19058
- startAngle: startAngle / 6e4,
19059
- swingAngle: swingAngle / 6e4
19060
- });
19061
- break;
19062
- }
19063
- case "close":
19064
- commands.push({ op: "Z" });
19065
- break;
19066
- }
19067
- }
19068
- return commands;
19069
- }
19070
19649
  function parseDrawingGeometry(spPr) {
19071
19650
  const preset = first(spPr, "prstGeom", NS.a);
19072
19651
  const custom = first(spPr, "custGeom", NS.a);
19073
19652
  if (custom) {
19074
- const paths = [];
19075
- for (const path3 of children(first(custom, "pathLst", NS.a) ?? custom, "path", NS.a)) {
19076
- const commands = parsePathCommands(path3);
19077
- if (!commands) return { geometry: "custom", issue: "CUSTOM_GEOMETRY_GUIDES_UNSUPPORTED" };
19078
- const width = int(path3, "w");
19079
- const height = int(path3, "h");
19080
- paths.push({
19081
- commands,
19082
- ...Number.isFinite(width) ? { width } : {},
19083
- ...Number.isFinite(height) ? { height } : {},
19084
- ...path3.getAttribute("fill") ? { fill: path3.getAttribute("fill") } : {},
19085
- ...path3.getAttribute("stroke") === "0" || path3.getAttribute("stroke") === "false" ? { stroke: false } : {}
19086
- });
19087
- }
19088
- return { geometry: "custom", paths };
19653
+ const frame = parseFrame(first(spPr, "xfrm", NS.a));
19654
+ const paths = parseCustomGeometry(custom, frame?.width ?? 21600, frame?.height ?? 21600);
19655
+ return paths ? { geometry: "custom", paths } : { geometry: "custom", issue: "CUSTOM_GEOMETRY_UNSUPPORTED" };
19089
19656
  }
19090
19657
  const geometry = preset?.getAttribute("prst") || "rect";
19091
19658
  const adjustments = {};
@@ -19157,7 +19724,8 @@ function parseShape(sp, index2, group2, issues) {
19157
19724
  if (transform2.flipVertical) shape.flipVertical = true;
19158
19725
  if (adjustments) shape.adjustments = adjustments;
19159
19726
  if (paths) shape.paths = paths;
19160
- const fill = parseDrawingFill(spPr);
19727
+ const picture = first(sp, "blipFill", NS.dsp);
19728
+ const fill = picture ? parseDrawingPictureFill(picture) : parseDrawingFill(spPr);
19161
19729
  if (fill) shape.fill = fill;
19162
19730
  const line2 = parseDrawingLine(first(spPr, "ln", NS.a));
19163
19731
  if (line2) shape.line = line2;
@@ -19186,15 +19754,15 @@ function parseDiagramDrawing(source, part) {
19186
19754
  for (const child3 of Array.from(container.childNodes)) {
19187
19755
  if (child3.nodeType !== 1) continue;
19188
19756
  const element2 = child3;
19189
- if (element2.localName === "sp") {
19757
+ if (element2.localName === "sp" || element2.localName === "pic") {
19190
19758
  const shape = parseShape(element2, counter++, group2, issues);
19191
19759
  if (shape) shapes.push(shape);
19760
+ else if (element2.localName === "pic")
19761
+ issues.push({
19762
+ code: "DIAGRAM_DRAWING_PICTURE_UNREADABLE",
19763
+ message: "A cached picture has no usable frame; its source is retained in the drawing part."
19764
+ });
19192
19765
  } else if (element2.localName === "grpSp") visit(element2, groupTransform(element2, group2));
19193
- else if (element2.localName === "pic")
19194
- issues.push({
19195
- code: "DIAGRAM_DRAWING_PICTURE_SKIPPED",
19196
- message: "A dsp:pic in the cached drawing is not modelled; the part still holds it."
19197
- });
19198
19766
  }
19199
19767
  };
19200
19768
  if (tree) visit(tree, IDENTITY2);
@@ -19289,7 +19857,29 @@ async function loadDiagram(hostPart, relationshipIds, host) {
19289
19857
  );
19290
19858
  return parseDiagramDrawing(xml, part);
19291
19859
  });
19292
- if (drawing2) issues.push(...drawing2.issues);
19860
+ if (drawing2) {
19861
+ try {
19862
+ const entries = await host.readRelationshipEntries(
19863
+ diagramRelationshipsPart(drawingResolution.path)
19864
+ );
19865
+ const pictures = (entries ?? []).filter(
19866
+ (entry3) => entry3.type.endsWith("/image") && entry3.mode !== "External" && !/^[a-z][a-z0-9+.-]*:/i.test(entry3.target)
19867
+ );
19868
+ if (pictures.length)
19869
+ drawing2.pictureParts = Object.fromEntries(
19870
+ pictures.map((entry3) => [
19871
+ entry3.id,
19872
+ host.resolvePath(drawingResolution.path, entry3.target)
19873
+ ])
19874
+ );
19875
+ } catch {
19876
+ issues.push({
19877
+ code: "DIAGRAM_PICTURE_RELATIONSHIPS_UNREADABLE",
19878
+ message: "Picture relationships in the cached drawing could not be read."
19879
+ });
19880
+ }
19881
+ issues.push(...drawing2.issues);
19882
+ }
19293
19883
  } else if (data)
19294
19884
  issues.push({
19295
19885
  code: "DIAGRAM_DRAWING_ABSENT",
@@ -19364,10 +19954,11 @@ async function resolveOne(object, info, source) {
19364
19954
  const xml = source.text(relsPart);
19365
19955
  if (!xml) return void 0;
19366
19956
  try {
19367
- return [...parseRelationships(xml).values()].map(({ id: id3, type, target: target2 }) => ({
19957
+ return [...parseRelationships(xml).values()].map(({ id: id3, type, target: target2, mode }) => ({
19368
19958
  id: id3,
19369
19959
  type,
19370
- target: target2
19960
+ target: target2,
19961
+ ...mode ? { mode } : {}
19371
19962
  }));
19372
19963
  } catch {
19373
19964
  return void 0;
@@ -19817,7 +20408,7 @@ function readConditionalExtensions(sheet) {
19817
20408
  }
19818
20409
 
19819
20410
  // chart/read-appearance.ts
19820
- function readChartAppearance(text7, properties2) {
20411
+ function readChartAppearance(text7, properties) {
19821
20412
  const out = {};
19822
20413
  const size3 = Number(text7?.getAttribute("sz") ?? NaN);
19823
20414
  if (Number.isFinite(size3) && size3 > 0) out.fontSize = size3 / 100;
@@ -19834,8 +20425,8 @@ function readChartAppearance(text7, properties2) {
19834
20425
  if (typeface2) out.typeface = typeface2;
19835
20426
  const color2 = parseDrawingColorIn(first(text7, "solidFill", NS.a));
19836
20427
  if (color2) out.textColor = color2;
19837
- const fill = parseDrawingFill(properties2);
19838
- const line2 = parseDrawingLine(first(properties2, "ln", NS.a));
20428
+ const fill = parseDrawingFill(properties);
20429
+ const line2 = parseDrawingLine(first(properties, "ln", NS.a));
19839
20430
  if (fill) out.fill = fill;
19840
20431
  if (line2) out.line = line2;
19841
20432
  const effects = first(text7, "effectLst", NS.a);
@@ -19847,11 +20438,11 @@ function readChartAppearance(text7, properties2) {
19847
20438
  function chartDataLabelNode(root2) {
19848
20439
  const plot = first(first(root2, "chart", NS.c), "plotArea", NS.c);
19849
20440
  const groups = plot ? elements(plot).filter((node3) => node3.localName.endsWith("Chart")) : [];
19850
- const candidates = groups.flatMap((group2) => [
20441
+ const candidates2 = groups.flatMap((group2) => [
19851
20442
  ...children(group2, "ser", NS.c).map((ser) => first(ser, "dLbls", NS.c)),
19852
20443
  first(group2, "dLbls", NS.c)
19853
20444
  ]);
19854
- return candidates.find(
20445
+ return candidates2.find(
19855
20446
  (node3) => node3 !== void 0 && (first(node3, "txPr", NS.c) !== void 0 || elements(node3).some(
19856
20447
  (child3) => child3.localName.startsWith("show") && child3.getAttribute("val") === "1"
19857
20448
  ))
@@ -21042,8 +21633,8 @@ function parseChartSpace(source) {
21042
21633
  }
21043
21634
 
21044
21635
  // chart/write-text-body.ts
21045
- function runProperties(local, properties2) {
21046
- const p = properties2 ?? {};
21636
+ function runProperties(local, properties) {
21637
+ const p = properties ?? {};
21047
21638
  const attributes = [
21048
21639
  p.sizePt === void 0 ? "" : ` sz="${Math.round(p.sizePt * 100)}"`,
21049
21640
  p.bold === void 0 ? "" : ` b="${p.bold ? 1 : 0}"`,
@@ -21059,16 +21650,16 @@ function spacing(local, value3) {
21059
21650
  return `<a:${local}>${inner}</a:${local}>`;
21060
21651
  }
21061
21652
  function run(value3) {
21062
- const { text: text7, ...properties2 } = value3;
21063
- const hasProperties = Object.keys(properties2).length > 0;
21653
+ const { text: text7, ...properties } = value3;
21654
+ const hasProperties = Object.keys(properties).length > 0;
21064
21655
  if (text7 === "\n")
21065
- return hasProperties ? `<a:br>${runProperties("rPr", properties2)}</a:br>` : "<a:br/>";
21066
- return `<a:r>${hasProperties ? runProperties("rPr", properties2) : ""}<a:t>${escapeText2(text7)}</a:t></a:r>`;
21656
+ return hasProperties ? `<a:br>${runProperties("rPr", properties)}</a:br>` : "<a:br/>";
21657
+ return `<a:r>${hasProperties ? runProperties("rPr", properties) : ""}<a:t>${escapeText2(text7)}</a:t></a:r>`;
21067
21658
  }
21068
21659
  function paragraph(value3) {
21069
21660
  const align = value3.align ? ` algn="${escapeAttribute(value3.align)}"` : "";
21070
- const properties2 = spacing("lnSpc", value3.lineSpacing) + spacing("spcBef", value3.spaceBefore) + spacing("spcAft", value3.spaceAfter) + runProperties("defRPr", value3.defaultProperties);
21071
- return `<a:p><a:pPr${align}>${properties2}</a:pPr>${value3.runs.map(run).join("")}</a:p>`;
21661
+ const properties = spacing("lnSpc", value3.lineSpacing) + spacing("spcBef", value3.spaceBefore) + spacing("spcAft", value3.spaceAfter) + runProperties("defRPr", value3.defaultProperties);
21662
+ return `<a:p><a:pPr${align}>${properties}</a:pPr>${value3.runs.map(run).join("")}</a:p>`;
21072
21663
  }
21073
21664
  function writeTextBody(body) {
21074
21665
  const insets = body.insetsEmu ?? {};
@@ -21205,7 +21796,7 @@ function dataSourceInner(source) {
21205
21796
  case "multiLvlStrRef": {
21206
21797
  const levels = source.levels ? elementXml(
21207
21798
  "multiLvlStrCache",
21208
- valXml("ptCount", source.levelPointCount) + source.levels.map((level2) => elementXml("lvl", cachePoints(level2))).join("")
21799
+ valXml("ptCount", source.levelPointCount) + source.levels.map((level3) => elementXml("lvl", cachePoints(level3))).join("")
21209
21800
  ) : "";
21210
21801
  return `<c:multiLvlStrRef>${formula2}${levels}</c:multiLvlStrRef>`;
21211
21802
  }
@@ -21597,13 +22188,13 @@ function parsePattern(code) {
21597
22188
  continue;
21598
22189
  }
21599
22190
  if (ch === "[") {
21600
- const close4 = code.indexOf("]", i);
21601
- const token = code.slice(i + 1, close4 === -1 ? code.length : close4);
22191
+ const close3 = code.indexOf("]", i);
22192
+ const token = code.slice(i + 1, close3 === -1 ? code.length : close3);
21602
22193
  const named2 = NAMED_FORMAT_COLORS[token.trim().toLowerCase()];
21603
22194
  if (named2 && color2 === void 0) {
21604
22195
  color2 = named2;
21605
22196
  }
21606
- i = close4 === -1 ? code.length : close4;
22197
+ i = close3 === -1 ? code.length : close3;
21607
22198
  continue;
21608
22199
  }
21609
22200
  chars.push({ ch, literal: false });
@@ -21833,6 +22424,9 @@ function composeDataLabelText(input) {
21833
22424
  // chart/render/summary-labels.ts
21834
22425
  function level(options2, custom) {
21835
22426
  const out = {};
22427
+ if (options2.layout) out.layout = options2.layout;
22428
+ if (options2.showLeaderLines !== void 0) out.showLeaderLines = options2.showLeaderLines;
22429
+ if (options2.leaderLines?.spPr?.line) out.leaderLine = options2.leaderLines.spPr.line;
21836
22430
  if (options2.deleted !== void 0) out.deleted = options2.deleted;
21837
22431
  if (options2.showValue !== void 0) out.showValue = options2.showValue;
21838
22432
  if (options2.showCategoryName !== void 0) out.showCategory = options2.showCategoryName;
@@ -21882,7 +22476,7 @@ var GROUP_TYPES = {
21882
22476
  surface: "surface"
21883
22477
  };
21884
22478
  var GROUPINGS = /* @__PURE__ */ new Set(["clustered", "stacked", "percentStacked", "standard"]);
21885
- function chartSummarySeries(source, chartType, groupLabels) {
22479
+ function chartSummarySeries(source, chartType, groupLabels, groupSmooth) {
21886
22480
  const categories = source.categories ?? source.xValues;
21887
22481
  const values = source.values ?? source.yValues;
21888
22482
  const numeric4 = (v) => typeof v === "number" ? v : v === "" ? null : Number.isFinite(Number(v)) ? Number(v) : null;
@@ -21890,6 +22484,9 @@ function chartSummarySeries(source, chartType, groupLabels) {
21890
22484
  categories: chartSourceValues(categories),
21891
22485
  values: chartSourceValues(values).map(numeric4)
21892
22486
  };
22487
+ const smooth = source.smooth ?? groupSmooth;
22488
+ if (smooth !== void 0) out.smooth = smooth;
22489
+ if (source.spPr?.line) out.line = source.spPr.line;
21893
22490
  if (values?.cache?.formatCode !== void 0) out.numberFormat = values.cache.formatCode;
21894
22491
  if (source.bubbleSizes) {
21895
22492
  out.bubbleSizes = chartSourceValues(source.bubbleSizes).map(numeric4);
@@ -21910,12 +22507,12 @@ function chartSummarySeries(source, chartType, groupLabels) {
21910
22507
  const points2 = {};
21911
22508
  const pointFills = {};
21912
22509
  for (const point2 of source.dataPoints) {
21913
- const properties2 = point2.spPr ?? point2.marker?.spPr;
22510
+ const properties = point2.spPr ?? point2.marker?.spPr;
21914
22511
  if (point2.index === void 0) continue;
21915
- const pointColor = solidColor(properties2?.fill);
22512
+ const pointColor = solidColor(properties?.fill);
21916
22513
  if (pointColor) points2[point2.index] = pointColor;
21917
- if (properties2?.fill && properties2.fill.kind !== "solid")
21918
- pointFills[point2.index] = properties2.fill;
22514
+ if (properties?.fill && properties.fill.kind !== "solid")
22515
+ pointFills[point2.index] = properties.fill;
21919
22516
  }
21920
22517
  if (Object.keys(points2).length) out.pointColors = points2;
21921
22518
  if (Object.keys(pointFills).length) out.pointFills = pointFills;
@@ -21949,7 +22546,12 @@ function extraGroups(chartSpace, firstType) {
21949
22546
  const entry3 = {
21950
22547
  chartType: type,
21951
22548
  series: group2.series.map((source, index2) => ({
21952
- ...chartSummarySeries(source, type, group2.dataLabels),
22549
+ ...chartSummarySeries(
22550
+ source,
22551
+ type,
22552
+ group2.dataLabels,
22553
+ group2.smooth ?? (group2.scatterStyle ? ["smooth", "smoothMarker"].includes(group2.scatterStyle) : void 0)
22554
+ ),
21953
22555
  ...summaryMarkers(source, group2, index2)
21954
22556
  })),
21955
22557
  secondary: valueAxisId(chartSpace, group2.axisIds) !== primary
@@ -21970,8 +22572,14 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
21970
22572
  let chartType = group2 ? GROUP_TYPES[group2.kind] : "column";
21971
22573
  if (chartType === "bar" && group2?.barDirection !== "bar") chartType = "column";
21972
22574
  const series = (group2?.series ?? []).map((source, index2) => ({
21973
- ...chartSummarySeries(source, chartType, group2?.dataLabels),
21974
- ...group2 ? summaryMarkers(source, group2, index2) : {}
22575
+ ...chartSummarySeries(
22576
+ source,
22577
+ chartType,
22578
+ group2?.dataLabels,
22579
+ group2?.smooth ?? (group2?.scatterStyle ? ["smooth", "smoothMarker"].includes(group2.scatterStyle) : void 0)
22580
+ ),
22581
+ ...group2 ? summaryMarkers(source, group2, index2) : {},
22582
+ ...group2?.kind === "scatter" ? { showLine: !["marker", "none"].includes(group2.scatterStyle ?? "marker") } : {}
21975
22583
  }));
21976
22584
  const summary = {
21977
22585
  chartType,
@@ -21980,6 +22588,9 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
21980
22588
  axes: chartSpace.plotArea.axes,
21981
22589
  axisIds: group2?.axisIds ?? []
21982
22590
  };
22591
+ if (chartSpace.plotArea.dataTable) summary.dataTable = chartSpace.plotArea.dataTable;
22592
+ if (chartSpace.date1904 !== void 0) summary.date1904 = chartSpace.date1904;
22593
+ if (chartSpace.plotArea.layout) summary.plotLayout = chartSpace.plotArea.layout;
21983
22594
  const combined = extraGroups(chartSpace, chartType);
21984
22595
  if (combined.length) summary.extraGroups = combined;
21985
22596
  if (chartType === "stock" && group2) summary.stock = stockStyle(group2);
@@ -22059,6 +22670,9 @@ function chartObjectFromSpace(space3, frame, root2) {
22059
22670
  showLegend: summary.showLegend
22060
22671
  };
22061
22672
  if (frame.partName !== void 0) object.partName = frame.partName;
22673
+ if (summary.dataTable) object.dataTable = summary.dataTable;
22674
+ if (summary.date1904 !== void 0) object.date1904 = summary.date1904;
22675
+ if (summary.plotLayout) object.plotLayout = summary.plotLayout;
22062
22676
  if (summary.axes) object.axes = summary.axes;
22063
22677
  if (summary.axisIds) object.axisIds = summary.axisIds;
22064
22678
  if (summary.grouping) object.grouping = summary.grouping;
@@ -22208,7 +22822,7 @@ function parseDimension(context, element2) {
22208
22822
  return assignDefined(
22209
22823
  {
22210
22824
  kind: element2.localName,
22211
- levels: cxChildren(element2, "lvl").map((level2) => parseLevel(context, level2))
22825
+ levels: cxChildren(element2, "lvl").map((level3) => parseLevel(context, level3))
22212
22826
  },
22213
22827
  {
22214
22828
  type: attribute3(element2, "type"),
@@ -22619,6 +23233,41 @@ function parseChartExSpace(source) {
22619
23233
  return { chartExSpace, issues: context.issues };
22620
23234
  }
22621
23235
 
23236
+ // chart/render/summary-ex-series.ts
23237
+ var level2 = (source) => ({
23238
+ ...source.visibility?.value === void 0 ? {} : { showValue: source.visibility.value },
23239
+ ...source.visibility?.categoryName === void 0 ? {} : { showCategory: source.visibility.categoryName },
23240
+ ...source.visibility?.seriesName === void 0 ? {} : { showSeriesName: source.visibility.seriesName },
23241
+ ...source.position ? { position: source.position } : {},
23242
+ ...source.numberFormat?.formatCode ? { numberFormat: source.numberFormat.formatCode } : {},
23243
+ ...source.separator === void 0 ? {} : { separator: source.separator }
23244
+ });
23245
+ function chartExSeriesPaint(source, series, defaultValues = false) {
23246
+ const fill = source.spPr?.fill;
23247
+ if (fill) series.fill = fill;
23248
+ const points2 = {};
23249
+ const fills = {};
23250
+ for (const point2 of source.dataPoints) {
23251
+ if (point2.index === void 0) continue;
23252
+ const fill2 = point2.spPr?.fill;
23253
+ if (fill2?.kind === "solid") points2[point2.index] = fill2.color;
23254
+ else if (fill2) fills[point2.index] = fill2;
23255
+ }
23256
+ if (Object.keys(points2).length) series.pointColors = points2;
23257
+ if (Object.keys(fills).length) series.pointFills = fills;
23258
+ const labels = source.dataLabels;
23259
+ if (!labels && !defaultValues) return;
23260
+ const overrides = {};
23261
+ for (const label2 of labels?.labels ?? [])
23262
+ if (label2.index !== void 0) overrides[label2.index] = level2(label2);
23263
+ for (const index2 of labels?.hidden ?? [])
23264
+ overrides[index2] = { ...overrides[index2], deleted: true };
23265
+ series.dataLabels = {
23266
+ series: { showValue: defaultValues, ...labels ? level2(labels) : {} },
23267
+ points: overrides
23268
+ };
23269
+ }
23270
+
22622
23271
  // chart/render/summary-from-chartex.ts
22623
23272
  function seriesData(space3, series) {
22624
23273
  if (series.data) return series.data;
@@ -22626,17 +23275,17 @@ function seriesData(space3, series) {
22626
23275
  return series.dataId === void 0 ? shared[0] : shared.find((data) => data.id === series.dataId);
22627
23276
  }
22628
23277
  var findDimension = (data, kind, type) => data?.dimensions.find((d) => d.kind === kind && (d.type ?? "") === type);
22629
- function levelPoints(level2) {
23278
+ function levelPoints(level3) {
22630
23279
  const points2 = [];
22631
- for (const point2 of level2.points) points2[point2.index ?? points2.length] = point2.value.trim();
22632
- for (let i = 0; i < Math.max(level2.pointCount ?? 0, points2.length); i++) points2[i] ??= "";
23280
+ for (const point2 of level3.points) points2[point2.index ?? points2.length] = point2.value.trim();
23281
+ for (let i = 0; i < Math.max(level3.pointCount ?? 0, points2.length); i++) points2[i] ??= "";
22633
23282
  return points2;
22634
23283
  }
22635
23284
  function dimension(data, kind, type) {
22636
23285
  const element2 = findDimension(data, kind, type);
22637
23286
  if (!element2) return void 0;
22638
- const level2 = element2.levels[0];
22639
- const out = { points: level2 ? levelPoints(level2) : [] };
23287
+ const level3 = element2.levels[0];
23288
+ const out = { points: level3 ? levelPoints(level3) : [] };
22640
23289
  const formula2 = element2.formula?.formula.trim();
22641
23290
  if (formula2) out.formula = formula2;
22642
23291
  return out;
@@ -22700,13 +23349,8 @@ function chartExFormatting() {
22700
23349
  }
22701
23350
  };
22702
23351
  }
22703
- function chartExSummaryFromModel(space3) {
22704
- const all = space3.plotArea.series;
22705
- const primary = all.find((s) => s.layoutId !== "paretoLine") ?? all[0];
22706
- const layoutId = primary?.layoutId ?? "";
22707
- const chartType = layoutId === "waterfall" ? "waterfall" : layoutId === "clusteredColumn" ? "histogram" : layoutId === "treemap" || layoutId === "sunburst" ? layoutId : void 0;
22708
- if (!primary || !chartType) return { layoutId };
22709
- const data = seriesData(space3, primary);
23352
+ function summarySeries(space3, source, chartType) {
23353
+ const data = seriesData(space3, source);
22710
23354
  const categories = dimension(data, "strDim", "cat");
22711
23355
  const values = dimension(
22712
23356
  data,
@@ -22718,17 +23362,63 @@ function chartExSummaryFromModel(space3) {
22718
23362
  values: (values?.points ?? []).map(
22719
23363
  (p) => p !== "" && Number.isFinite(Number(p)) ? Number(p) : null
22720
23364
  ),
22721
- ...seriesFill(primary)
23365
+ ...seriesFill(source)
22722
23366
  };
22723
- const name3 = primary.tx?.value?.trim();
23367
+ if (chartType === "funnel" || chartType === "boxWhisker") {
23368
+ chartExSeriesPaint(source, series, chartType === "funnel" && source.dataLabels !== void 0);
23369
+ if (source.hidden !== void 0) series.hidden = source.hidden;
23370
+ }
23371
+ if (chartType === "boxWhisker") series.boxWhisker = source.layoutProperties ?? {};
23372
+ const name3 = source.tx?.value?.trim();
22724
23373
  if (name3) series.name = name3;
22725
- const nameRef = primary.tx?.formula?.formula.trim();
23374
+ const nameRef = source.tx?.formula?.formula.trim();
22726
23375
  if (nameRef) series.nameRef = nameRef;
22727
23376
  if (categories?.formula) series.categoriesRef = categories.formula;
22728
23377
  if (values?.formula) series.valuesRef = values.formula;
23378
+ return series;
23379
+ }
23380
+ function chartExSummaryFromModel(space3) {
23381
+ const all = space3.plotArea.series;
23382
+ const primary = all.find((s) => s.layoutId !== "paretoLine") ?? all[0];
23383
+ const layoutId = primary?.layoutId ?? "";
23384
+ const chartType = layoutId === "waterfall" ? "waterfall" : layoutId === "clusteredColumn" ? "histogram" : layoutId === "treemap" || layoutId === "sunburst" || layoutId === "funnel" || layoutId === "boxWhisker" ? layoutId : void 0;
23385
+ if (!primary || !chartType) return { layoutId };
23386
+ const series = summarySeries(space3, primary, chartType);
22729
23387
  const layout = primary.layoutProperties;
22730
23388
  const legend = space3.legend;
22731
- const summary = { chartType, series: [series], showLegend: legend !== void 0 };
23389
+ const summary = {
23390
+ chartType,
23391
+ series: chartType === "boxWhisker" ? all.filter((s) => s.layoutId === "boxWhisker").map((source) => summarySeries(space3, source, chartType)) : [series],
23392
+ showLegend: legend !== void 0
23393
+ };
23394
+ if (chartType === "boxWhisker") {
23395
+ summary.axes = space3.plotArea.axes.flatMap((axis) => {
23396
+ const scaling = axis.scaling;
23397
+ if (!scaling) return [];
23398
+ const value3 = scaling.kind === "val";
23399
+ return [
23400
+ {
23401
+ kind: value3 ? "val" : "cat",
23402
+ ...axis.id === void 0 ? {} : { id: axis.id },
23403
+ position: value3 ? "l" : "b",
23404
+ deleted: axis.hidden ?? false,
23405
+ scaling: {
23406
+ ...value3 && typeof scaling.min === "number" ? { min: scaling.min } : {},
23407
+ ...value3 && typeof scaling.max === "number" ? { max: scaling.max } : {}
23408
+ },
23409
+ majorGridlines: !!axis.majorGridlines,
23410
+ minorGridlines: !!axis.minorGridlines,
23411
+ ...axis.majorGridlines?.spPr ? { majorGridlinesSpPr: axis.majorGridlines.spPr } : {},
23412
+ ...axis.minorGridlines?.spPr ? { minorGridlinesSpPr: axis.minorGridlines.spPr } : {},
23413
+ ...value3 && typeof scaling.majorUnit === "number" ? { majorUnit: scaling.majorUnit } : {},
23414
+ ...value3 && typeof scaling.minorUnit === "number" ? { minorUnit: scaling.minorUnit } : {},
23415
+ ...axis.spPr ? { spPr: axis.spPr } : {},
23416
+ ...axis.numberFormat ? { numberFormat: axis.numberFormat } : {},
23417
+ ...axis.tickLabels ? {} : { tickLabelPosition: "none" }
23418
+ }
23419
+ ];
23420
+ });
23421
+ }
22732
23422
  summary.formatting = chartExFormatting();
22733
23423
  const title = titleOf(space3);
22734
23424
  if (title) summary.title = title;
@@ -22743,11 +23433,11 @@ function chartExSummaryFromModel(space3) {
22743
23433
  } else if (chartType === "treemap" || chartType === "sunburst") {
22744
23434
  const parentLayout = layout?.parentLabelLayout;
22745
23435
  summary.hierarchy = {
22746
- levels: categoryLevels(data),
23436
+ levels: categoryLevels(seriesData(space3, primary)),
22747
23437
  dataLabels: primary.dataLabels !== void 0,
22748
23438
  ...parentLayout === "none" || parentLayout === "banner" || parentLayout === "overlapping" ? { parentLabelLayout: parentLayout } : {}
22749
23439
  };
22750
- } else summary.histogram = histogramOptions(primary);
23440
+ } else if (chartType === "histogram") summary.histogram = histogramOptions(primary);
22751
23441
  return { layoutId, summary };
22752
23442
  }
22753
23443
 
@@ -22955,7 +23645,8 @@ function parseDrawing(source, partName, warn) {
22955
23645
  const cNvPr = nonVisual(content2);
22956
23646
  const name3 = att(cNvPr, "name");
22957
23647
  if (content2.localName === "pic") {
22958
- const blip = first(xdr(content2, "blipFill"), "blip", NS.a);
23648
+ const blipFill = xdr(content2, "blipFill");
23649
+ const blip = first(blipFill, "blip", NS.a);
22959
23650
  const rel = rels.get(relAttr(blip, "embed") ?? "");
22960
23651
  const target2 = rel ? source.target(partName, rel) : void 0;
22961
23652
  if (!target2 || !source.has(target2)) {
@@ -22965,6 +23656,9 @@ function parseDrawing(source, partName, warn) {
22965
23656
  const image = {
22966
23657
  kind: "image",
22967
23658
  anchor,
23659
+ sourceXml: selfContainedXml(anchorEl),
23660
+ ...parsePictureCrop(blipFill) ? { crop: parsePictureCrop(blipFill) } : {},
23661
+ ...parsePictureEffects(blip).length ? { effects: parsePictureEffects(blip) } : {},
22968
23662
  partName: target2,
22969
23663
  contentType: source.contentType(target2) ?? "application/octet-stream"
22970
23664
  };
@@ -23595,7 +24289,7 @@ async function loadXlsx(input, options2 = {}) {
23595
24289
  const corePart = source.targetOfType("", RELATIONSHIP_TYPES.coreProperties);
23596
24290
  const appPart = source.targetOfType("", RELATIONSHIP_TYPES.extendedProperties);
23597
24291
  const customPart = source.targetOfType("", RELATIONSHIP_TYPES.customProperties);
23598
- const properties2 = readProperties(
24292
+ const properties = readProperties(
23599
24293
  corePart ? source.text(corePart) : void 0,
23600
24294
  appPart ? source.text(appPart) : void 0,
23601
24295
  customPart ? source.text(customPart) : void 0,
@@ -23609,7 +24303,7 @@ async function loadXlsx(input, options2 = {}) {
23609
24303
  theme: parseTheme2(themePart ? source.text(themePart) : void 0),
23610
24304
  activeSheet: Math.min(Math.max(0, book.activeTab), Math.max(0, sheets.length - 1)),
23611
24305
  date1904: book.date1904,
23612
- properties: properties2,
24306
+ properties,
23613
24307
  source: { parts },
23614
24308
  format: MACRO_TYPES.has(contentType2) ? "xlsm" : "xlsx",
23615
24309
  warnings
@@ -23939,10 +24633,10 @@ var STOCK_DEFAULT_WICK_COLOR = "#334155";
23939
24633
 
23940
24634
  // chart/hierarchy.ts
23941
24635
  function normalizeLevels(levels, pointCount) {
23942
- return levels.map((level2) => {
24636
+ return levels.map((level3) => {
23943
24637
  let previous = "";
23944
24638
  return Array.from({ length: pointCount }, (_, index2) => {
23945
- const label2 = level2[index2]?.trim() ?? "";
24639
+ const label2 = level3[index2]?.trim() ?? "";
23946
24640
  if (label2) previous = label2;
23947
24641
  return label2 || previous;
23948
24642
  });
@@ -24128,9 +24822,6 @@ function resolveChartGradient(fill, resolve) {
24128
24822
  };
24129
24823
  }
24130
24824
 
24131
- // chart/render/chart-svg-util.ts
24132
- var TEXT_COLOR = "#595959";
24133
-
24134
24825
  // chart/render/chart-colors.ts
24135
24826
  function chartColorScheme(theme2) {
24136
24827
  const slots = Object.fromEntries(
@@ -24237,6 +24928,9 @@ function chartAppearance(chart, theme2) {
24237
24928
  return out;
24238
24929
  }
24239
24930
 
24931
+ // chart/render/chart-svg-util.ts
24932
+ var TEXT_COLOR = "#595959";
24933
+
24240
24934
  // chart/render/chart-scale.ts
24241
24935
  var clean2 = (n) => Number(n.toPrecision(12));
24242
24936
  function* units2(raw2) {
@@ -24416,10 +25110,10 @@ function applyChartAxes(model, chart, color2) {
24416
25110
  if (!chart.axes?.length) return;
24417
25111
  const axes = chart.axes;
24418
25112
  const linked = axes.filter((axis) => axis.id !== void 0 && chart.axisIds?.includes(axis.id));
24419
- const candidates = linked.length ? linked : axes;
25113
+ const candidates2 = linked.length ? linked : axes;
24420
25114
  const xy = model.type === "scatter" || model.type === "bubble";
24421
- const value3 = candidates.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates.find((axis) => axis.kind === "val");
24422
- const category = candidates.find(
25115
+ const value3 = candidates2.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates2.find((axis) => axis.kind === "val");
25116
+ const category = candidates2.find(
24423
25117
  (axis) => xy ? axis.kind === "val" && axis !== value3 : axis.kind === "cat" || axis.kind === "date"
24424
25118
  );
24425
25119
  const secondary = axes.find((axis) => axis.kind === "val" && axis !== value3 && axis !== category);
@@ -24490,6 +25184,50 @@ function applyChartAxes(model, chart, color2) {
24490
25184
  model.axes = out;
24491
25185
  }
24492
25186
 
25187
+ // chart/render/chart-title-text.ts
25188
+ function chartRunStyle(run2) {
25189
+ return {
25190
+ ...run2.sizePt === void 0 ? {} : { fontSize: run2.sizePt },
25191
+ ...run2.bold === void 0 ? {} : { bold: run2.bold },
25192
+ ...run2.italic === void 0 ? {} : { italic: run2.italic },
25193
+ ...run2.underline === void 0 ? {} : { underline: run2.underline },
25194
+ ...run2.typeface === void 0 ? {} : { typeface: run2.typeface },
25195
+ ...run2.color === void 0 ? {} : { textColor: run2.color }
25196
+ };
25197
+ }
25198
+ function chartTitleText(chart, theme2) {
25199
+ const formatting = chart.formatting;
25200
+ const entry3 = formatting?.entries.title;
25201
+ const body = entry3?.textBody;
25202
+ if (!formatting || !body || body.text !== chart.title) return void 0;
25203
+ 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)
25204
+ return void 0;
25205
+ return {
25206
+ paragraphs: body.paragraphs.map((paragraph2) => ({
25207
+ ...paragraph2.align ? { align: paragraph2.align } : {},
25208
+ ...paragraph2.lineSpacing ? { lineSpacing: paragraph2.lineSpacing } : {},
25209
+ ...paragraph2.spaceBefore ? { spaceBefore: paragraph2.spaceBefore } : {},
25210
+ ...paragraph2.spaceAfter ? { spaceAfter: paragraph2.spaceAfter } : {},
25211
+ runs: paragraph2.runs.map((run2) => {
25212
+ const direct = {
25213
+ sourceXml: "",
25214
+ ...entry3.textBodyStyle,
25215
+ ...chartRunStyle(paragraph2.defaultProperties ?? {}),
25216
+ ...chartRunStyle(run2)
25217
+ };
25218
+ const appearance = chartAppearance(
25219
+ {
25220
+ ...chart,
25221
+ formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
25222
+ },
25223
+ theme2
25224
+ )?.title ?? {};
25225
+ return { text: run2.text, appearance };
25226
+ })
25227
+ }))
25228
+ };
25229
+ }
25230
+
24493
25231
  // chart/render/chart-view-analysis.ts
24494
25232
  function strokeOf(line2, fallback, resolve) {
24495
25233
  if (line2?.fill?.kind === "none") return void 0;
@@ -24517,6 +25255,40 @@ function analysisView(source, seriesColor, resolve) {
24517
25255
  };
24518
25256
  }
24519
25257
 
25258
+ // chart/render/chart-view-data-table.ts
25259
+ function chartDataTableView(chart, theme2, color2) {
25260
+ const source = chart.dataTable;
25261
+ if (!source) return void 0;
25262
+ const props = source.txPr?.paragraphs[0];
25263
+ const direct = {
25264
+ sourceXml: "",
25265
+ ...chartRunStyle(props?.defaultProperties ?? {}),
25266
+ ...chartRunStyle(props?.runs[0] ?? {})
25267
+ };
25268
+ const formatting = chart.formatting;
25269
+ const appearance = chartAppearance(
25270
+ {
25271
+ ...chart,
25272
+ formatting: {
25273
+ ...formatting,
25274
+ sourceXml: formatting?.sourceXml ?? "",
25275
+ entries: { ...formatting?.entries, categoryAxis: direct }
25276
+ }
25277
+ },
25278
+ theme2
25279
+ );
25280
+ const fill = source.spPr?.fill;
25281
+ return {
25282
+ source,
25283
+ stroke: strokeOf(source.spPr?.line, { color: "#D9D9D9", width: 1 }, color2) ?? {
25284
+ color: "none",
25285
+ width: 0
25286
+ },
25287
+ ...fill?.kind === "solid" && color2(fill.color) ? { fill: color2(fill.color) } : {},
25288
+ ...appearance?.categoryAxis ? { text: appearance.categoryAxis } : {}
25289
+ };
25290
+ }
25291
+
24520
25292
  // chart/render/chart-view-series.ts
24521
25293
  var isRefError = (value3) => typeof value3 === "object" && value3 !== null && "error" in value3;
24522
25294
  function toText(value3) {
@@ -24558,7 +25330,8 @@ function seriesContext(chart, theme2, options2) {
24558
25330
  function seriesView(ctx, s, index2, total, categoriesOf) {
24559
25331
  const { theme: theme2, scheme, palette, evaluateRef: evaluateRef2 } = ctx;
24560
25332
  const values = resolveRef(s.valuesRef, evaluateRef2)?.map(toNumber) ?? s.values.map(toNumber);
24561
- categoriesOf(resolveRef(s.categoriesRef, evaluateRef2) ?? s.categories);
25333
+ const categoryValues = resolveRef(s.categoriesRef, evaluateRef2) ?? s.categories;
25334
+ categoriesOf(categoryValues);
24562
25335
  const paletteColor = palette && chartPaletteSeriesColor(palette, index2, total, scheme);
24563
25336
  const color2 = s.fill?.kind === "none" ? "none" : ctx.drawingColor(s.fill?.kind === "solid" ? s.fill.color : s.drawingColor) ?? ctx.seriesColor?.(s, index2) ?? paletteColor ?? autoSeriesColor(theme2, index2);
24564
25337
  const view = {
@@ -24567,6 +25340,19 @@ function seriesView(ctx, s, index2, total, categoriesOf) {
24567
25340
  color: color2,
24568
25341
  sourceIndex: index2
24569
25342
  };
25343
+ if (s.hidden !== void 0) view.hidden = s.hidden;
25344
+ if (s.boxWhisker) {
25345
+ view.boxWhisker = s.boxWhisker;
25346
+ view.boxCategories = categoryValues.map(toText);
25347
+ }
25348
+ if (s.numberFormat !== void 0) view.numberFormat = s.numberFormat;
25349
+ if (s.showLine !== void 0) view.showLine = s.showLine;
25350
+ if (s.smooth !== void 0) view.smooth = s.smooth;
25351
+ if (s.line)
25352
+ view.stroke = strokeOf(s.line, { color: color2, width: 2.25 }, ctx.drawingColor) ?? {
25353
+ color: "none",
25354
+ width: 0
25355
+ };
24570
25356
  const shadow = resolveDrawingShadowXml(s.effectsXml, { scheme: (name3) => scheme[name3] });
24571
25357
  if (shadow) view.shadow = shadow;
24572
25358
  const resolvedGradient = ctx.gradient(s.fill);
@@ -24706,52 +25492,8 @@ function valueAxis(model) {
24706
25492
  return { ...niceScale(min, max), percent: false };
24707
25493
  }
24708
25494
 
24709
- // chart/render/chart-title-text.ts
24710
- function properties(run2) {
24711
- return {
24712
- ...run2.sizePt === void 0 ? {} : { fontSize: run2.sizePt },
24713
- ...run2.bold === void 0 ? {} : { bold: run2.bold },
24714
- ...run2.italic === void 0 ? {} : { italic: run2.italic },
24715
- ...run2.underline === void 0 ? {} : { underline: run2.underline },
24716
- ...run2.typeface === void 0 ? {} : { typeface: run2.typeface },
24717
- ...run2.color === void 0 ? {} : { textColor: run2.color }
24718
- };
24719
- }
24720
- function chartTitleText(chart, theme2) {
24721
- const formatting = chart.formatting;
24722
- const entry3 = formatting?.entries.title;
24723
- const body = entry3?.textBody;
24724
- if (!formatting || !body || body.text !== chart.title) return void 0;
24725
- 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)
24726
- return void 0;
24727
- return {
24728
- paragraphs: body.paragraphs.map((paragraph2) => ({
24729
- ...paragraph2.align ? { align: paragraph2.align } : {},
24730
- ...paragraph2.lineSpacing ? { lineSpacing: paragraph2.lineSpacing } : {},
24731
- ...paragraph2.spaceBefore ? { spaceBefore: paragraph2.spaceBefore } : {},
24732
- ...paragraph2.spaceAfter ? { spaceAfter: paragraph2.spaceAfter } : {},
24733
- runs: paragraph2.runs.map((run2) => {
24734
- const direct = {
24735
- sourceXml: "",
24736
- ...entry3.textBodyStyle,
24737
- ...properties(paragraph2.defaultProperties ?? {}),
24738
- ...properties(run2)
24739
- };
24740
- const appearance = chartAppearance(
24741
- {
24742
- ...chart,
24743
- formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
24744
- },
24745
- theme2
24746
- )?.title ?? {};
24747
- return { text: run2.text, appearance };
24748
- })
24749
- }))
24750
- };
24751
- }
24752
-
24753
25495
  // chart/render/chart-view-labels.ts
24754
- function labelsOf(source, view, categories, numberFormat3) {
25496
+ function labelsOf(source, view, categories, numberFormat3, resolveColor2) {
24755
25497
  const { chart, series, points: points2 } = source;
24756
25498
  if ((series?.deleted ?? chart?.deleted) === true) return void 0;
24757
25499
  const percentBase = view.values.reduce(
@@ -24787,19 +25529,35 @@ function labelsOf(source, view, categories, numberFormat3) {
24787
25529
  });
24788
25530
  }
24789
25531
  if (!built) return;
25532
+ const layout = point2?.layout;
25533
+ const showLeaderLines = series?.showLeaderLines ?? chart?.showLeaderLines;
25534
+ const leaderLine = strokeOf(
25535
+ series?.leaderLine ?? chart?.leaderLine,
25536
+ { color: "#94a3b8", width: 0.75 },
25537
+ resolveColor2
25538
+ ) ?? { color: "none", width: 0 };
24790
25539
  any = true;
24791
25540
  out[i] = {
24792
25541
  text: built.text,
25542
+ ...layout ? { layout } : {},
25543
+ ...showLeaderLines !== void 0 ? { showLeaderLines } : {},
25544
+ ...leaderLine ? { leaderLine } : {},
24793
25545
  ...position ? { position } : {},
24794
25546
  ...built.color ? { color: built.color } : {}
24795
25547
  };
24796
25548
  });
24797
25549
  return any ? out : void 0;
24798
25550
  }
24799
- function applyDataLabels(model, sources, extra) {
25551
+ function applyDataLabels(model, sources, extra, resolveColor2) {
24800
25552
  const apply5 = (source, view) => {
24801
25553
  if (!source?.dataLabels) return;
24802
- const labels = labelsOf(source.dataLabels, view, model.categories, source.numberFormat);
25554
+ const labels = labelsOf(
25555
+ source.dataLabels,
25556
+ view,
25557
+ model.categories,
25558
+ source.numberFormat,
25559
+ resolveColor2
25560
+ );
24803
25561
  if (labels) view.labels = labels;
24804
25562
  };
24805
25563
  model.series.forEach((view, i) => apply5(sources[i], view));
@@ -24904,7 +25662,9 @@ var SUPPORTED = /* @__PURE__ */ new Set([
24904
25662
  "bubble",
24905
25663
  "stock",
24906
25664
  "treemap",
24907
- "sunburst"
25665
+ "sunburst",
25666
+ "funnel",
25667
+ "boxWhisker"
24908
25668
  ]);
24909
25669
  function chartSummaryView(chart, theme2, options2 = {}) {
24910
25670
  const type = chart.chartType;
@@ -24962,10 +25722,17 @@ function chartSummaryView(chart, theme2, options2 = {}) {
24962
25722
  showLegend: chart.showLegend,
24963
25723
  legendPosition: chart.legendPosition ?? "r",
24964
25724
  categories,
24965
- series,
25725
+ series: type === "boxWhisker" ? series.filter((s) => !s.hidden) : series,
24966
25726
  horizontal: type === "bar",
24967
25727
  supported: SUPPORTED.has(type)
24968
25728
  };
25729
+ const table2 = chartDataTableView(chart, theme2, ctx.drawingColor);
25730
+ if (table2) model.dataTable = table2;
25731
+ if (chart.date1904 !== void 0) model.date1904 = chart.date1904;
25732
+ if (chart.axes?.some((a2) => a2.kind === "date")) model.dateCategories = firstCats.map(toNumber);
25733
+ if (chart.plotLayout) model.plotLayout = chart.plotLayout;
25734
+ if (type === "boxWhisker")
25735
+ model.categories = [...new Set(model.series.flatMap((s) => s.boxCategories ?? []))];
24969
25736
  if (chart.title) model.title = chart.title;
24970
25737
  const titleFormatting = chart.formatting?.entries.title;
24971
25738
  if (titleFormatting?.layout) model.titleLayout = titleFormatting.layout;
@@ -24987,6 +25754,11 @@ function chartSummaryView(chart, theme2, options2 = {}) {
24987
25754
  const range2 = extentOf(xs);
24988
25755
  model.xAxis = xs.length ? niceScale(range2.min, range2.max) : niceScale(0, 1);
24989
25756
  }
25757
+ if (type === "funnel" || type === "boxWhisker")
25758
+ series.forEach((s, i) => {
25759
+ const points2 = chart.series[i]?.pointColors;
25760
+ if (points2) s.pointColors = s.values.map((_, j) => drawingColor2(points2[j]) ?? s.color);
25761
+ });
24990
25762
  if (type === "stock") model.stock = stockView(chart.stock, ctx);
24991
25763
  if (type === "bubble") bubbleView(chart, model, ctx.evaluateRef);
24992
25764
  if (type === "treemap" || type === "sunburst") hierarchyView(chart, model, ctx.evaluateRef);
@@ -24995,7 +25767,7 @@ function chartSummaryView(chart, theme2, options2 = {}) {
24995
25767
  chartExtraView(chart, model, ctx, total, collect);
24996
25768
  if (type === "waterfall") waterfallView(chart, model, ctx);
24997
25769
  else if (!byPoint) model.valueAxis = valueAxis(model);
24998
- applyDataLabels(model, chart.series, extra);
25770
+ applyDataLabels(model, chart.series, extra, ctx.drawingColor);
24999
25771
  chartExtraAxes(model);
25000
25772
  applyChartAxes(model, chart, ctx.drawingColor);
25001
25773
  return model;
@@ -25059,10 +25831,14 @@ function withHierarchyRanges(workbook, chart) {
25059
25831
  }
25060
25832
  function chartView(workbook, sheetIndex, chart, evaluateRef2) {
25061
25833
  const theme2 = workbook.theme;
25062
- return chartSummaryView(withHierarchyRanges(workbook, chart), theme2, {
25063
- evaluateRef: evaluateRef2,
25064
- seriesColor: (series) => resolveColor(series.color, theme2)
25065
- });
25834
+ return chartSummaryView(
25835
+ { ...withHierarchyRanges(workbook, chart), date1904: chart.date1904 ?? workbook.date1904 },
25836
+ theme2,
25837
+ {
25838
+ evaluateRef: evaluateRef2,
25839
+ seriesColor: (series) => resolveColor(series.color, theme2)
25840
+ }
25841
+ );
25066
25842
  }
25067
25843
 
25068
25844
  // xlsx/ui/dialogs/insert-chart-model.ts
@@ -25689,7 +26465,7 @@ function extension(node3, name3) {
25689
26465
  (ext) => themeChildren(ext, name3, THEME_NS)
25690
26466
  )[0];
25691
26467
  }
25692
- function integer3(value3) {
26468
+ function integer4(value3) {
25693
26469
  if (!value3 || !/^\d{1,6}$/.test(value3)) return void 0;
25694
26470
  return Number(value3);
25695
26471
  }
@@ -25715,7 +26491,7 @@ function drawingPaint(node3, colors, placeholder3, depth = 0) {
25715
26491
  if (!color2 || color2.transforms.length > 32) return void 0;
25716
26492
  const transforms = color2.transforms.filter((transform2) => transform2.name !== "hueMod");
25717
26493
  if (transforms.some(
25718
- (transform2) => !SUPPORTED_TRANSFORMS.has(transform2.name) || (integer3(transform2.value) ?? 100001) > 1e5
26494
+ (transform2) => !SUPPORTED_TRANSFORMS.has(transform2.name) || (integer4(transform2.value) ?? 100001) > 1e5
25719
26495
  ))
25720
26496
  return void 0;
25721
26497
  let rgb6;
@@ -25747,7 +26523,7 @@ function drawingColor(node3, colors, placeholder3) {
25747
26523
  }
25748
26524
 
25749
26525
  // visio/theme-resolve.ts
25750
- var cellNumber = (cells4, name3) => integer3(cells4?.get(name3)?.value);
26526
+ var cellNumber = (cells4, name3) => integer4(cells4?.get(name3)?.value);
25751
26527
  function rootThemeSelected(cells4, resources) {
25752
26528
  const local = cellNumber(cells4, "ColorSchemeIndex");
25753
26529
  return local === 0 || local === 65534 && cellNumber(resources.pageCells, "ColorSchemeIndex") === 0;
@@ -25805,7 +26581,7 @@ function themeFormat(cells4, category, resources) {
25805
26581
  if (matrix4 !== void 0 && matrix4 >= 100 && matrix4 <= 103) {
25806
26582
  const variant = inheritedIndex(cells4, resources.pageCells, "VariationStyleIndex", 0);
25807
26583
  const style2 = variant === void 0 ? void 0 : effect.variationStyles[variant]?.[matrix4 - 100];
25808
- matrix4 = integer3(
26584
+ matrix4 = integer4(
25809
26585
  style2?.getAttribute(`${category === "Effects" ? "effect" : category.toLowerCase()}Idx`)
25810
26586
  );
25811
26587
  }
@@ -25899,7 +26675,7 @@ function themeLinearGradient(sheet, resources, width, height, report) {
25899
26675
  return reject();
25900
26676
  const stops = [];
25901
26677
  for (const node3 of nodes) {
25902
- const position = integer3(node3.getAttribute("pos"));
26678
+ const position = integer4(node3.getAttribute("pos"));
25903
26679
  const paint2 = drawingPaint(colorChoice(node3), context.colors, context.base);
25904
26680
  if (position === void 0 || position > 1e5 || !paint2 || position / 1e5 < (stops.at(-1)?.offset ?? 0))
25905
26681
  return reject();
@@ -28111,12 +28887,12 @@ function shapeLayers(sheet, layers2, report, budget = createLayerBudget()) {
28111
28887
 
28112
28888
  // visio/page-theme.ts
28113
28889
  function visioPageTheme(themes, pageCells) {
28114
- const id3 = integer3(pageCells.get("ColorSchemeIndex")?.value);
28890
+ const id3 = integer4(pageCells.get("ColorSchemeIndex")?.value);
28115
28891
  if (!themes || id3 === void 0 || id3 === 0 || id3 >= 65534) return void 0;
28116
28892
  const matches2 = themes.filter((theme3) => theme3.colorId === id3);
28117
28893
  if (matches2.length !== 1) return void 0;
28118
28894
  const theme2 = matches2[0];
28119
- const variant = Math.min(3, integer3(pageCells.get("VariationColorIndex")?.value) ?? 0);
28895
+ const variant = Math.min(3, integer4(pageCells.get("VariationColorIndex")?.value) ?? 0);
28120
28896
  const accents = [1, 2, 3, 4, 5, 6].map(
28121
28897
  (index2) => drawingColor(theme2.colors.get(`accent${index2}`), theme2.colors) ?? "#808080"
28122
28898
  );
@@ -28373,7 +29149,7 @@ var VISIO_SCHEME_SLOTS = [
28373
29149
  "accent5",
28374
29150
  "accent6"
28375
29151
  ];
28376
- var componentId = (node3) => integer3(themeChild(node3, "schemeID", THEME_NS)?.getAttribute("schemeEnum"));
29152
+ var componentId = (node3) => integer4(themeChild(node3, "schemeID", THEME_NS)?.getAttribute("schemeEnum"));
28377
29153
  async function loadVisioThemes(pkg, source, report) {
28378
29154
  const result2 = [];
28379
29155
  for (const rel of (await pkg.relationships(source)).values()) {
@@ -28414,7 +29190,7 @@ async function loadVisioThemes(pkg, source, report) {
28414
29190
  const name3 = root2.getAttribute("name");
28415
29191
  result2.push({
28416
29192
  ...name3 ? { name: name3.slice(0, 256) } : {},
28417
- colorId: integer3(extension(palette, "schemeID")?.getAttribute("schemeEnum")),
29193
+ colorId: integer4(extension(palette, "schemeID")?.getAttribute("schemeEnum")),
28418
29194
  effectId: componentId(extension(base2, "fmtSchemeEx")),
28419
29195
  connectorId: componentId(extension(base2, "fmtConnectorSchemeEx")),
28420
29196
  colors,
@@ -28803,8 +29579,8 @@ function rootThemeSheet(sheet, resources, report) {
28803
29579
  const root2 = resources.rootSheet;
28804
29580
  if (!root2) return sheet;
28805
29581
  const colorRoot = rootThemeSelected(sheet.cells, resources);
28806
- const lineRoot = colorRoot || integer3(sheet.cells.get("QuickStyleLineMatrix")?.value) === 0;
28807
- const fillRoot = colorRoot || integer3(sheet.cells.get("QuickStyleFillMatrix")?.value) === 0;
29582
+ const lineRoot = colorRoot || integer4(sheet.cells.get("QuickStyleLineMatrix")?.value) === 0;
29583
+ const fillRoot = colorRoot || integer4(sheet.cells.get("QuickStyleFillMatrix")?.value) === 0;
28808
29584
  let cells4 = sheet.cells;
28809
29585
  if (colorRoot)
28810
29586
  cells4 = replaceThemed(cells4, root2.cells, ["LineColor", "FillForegnd", "FillBkgnd"], report);
@@ -29650,13 +30426,13 @@ async function parseVsdx(input, options2 = {}) {
29650
30426
  const cache2 = options2.documentCache;
29651
30427
  const cached5 = cacheMatches(cache2?.entry, pkg, options2) ? cache2.entry : void 0;
29652
30428
  const stopRecording = cache2 && !cached5 ? pkg.record() : void 0;
29653
- let level2;
30429
+ let level3;
29654
30430
  if (cached5) {
29655
- level2 = cached5.level;
29656
- for (const args of level2.reports) report(...args);
29657
- } else level2 = await readDocumentLevel(pkg, documentPart2, options2, checkTime, report);
29658
- const { documentRoot, styles, readPrintSettings, masters, masterRecords } = level2;
29659
- const resources = { ...level2.resources };
30431
+ level3 = cached5.level;
30432
+ for (const args of level3.reports) report(...args);
30433
+ } else level3 = await readDocumentLevel(pkg, documentPart2, options2, checkTime, report);
30434
+ const { documentRoot, styles, readPrintSettings, masters, masterRecords } = level3;
30435
+ const resources = { ...level3.resources };
29660
30436
  delete resources.pageCells;
29661
30437
  delete resources.fieldContext;
29662
30438
  let geometryCount = 0, textCount = 0, expansionCount = 0, textRuns = 0, paragraphCount = 0;
@@ -29735,7 +30511,7 @@ async function parseVsdx(input, options2 = {}) {
29735
30511
  options: optionsKey(options2),
29736
30512
  converter: options2.metafileConverter,
29737
30513
  reads: stopRecording(),
29738
- level: { ...level2, resources: { ...resources } },
30514
+ level: { ...level3, resources: { ...resources } },
29739
30515
  listed: {
29740
30516
  documentMasters,
29741
30517
  counters: {
@@ -30800,7 +31576,7 @@ function visioThemeColorFormula(ref) {
30800
31576
  const base2 = slot2 ? `THEMEVAL("${slot2[1]}")` : `RGB(${[1, 3, 5].map((index2) => parseInt(ref.base.slice(index2, index2 + 2), 16)).join(",")})`;
30801
31577
  return `THEMEGUARD(${ref.tint ? `MSOTINT(${base2},${ref.tint})` : base2})`;
30802
31578
  }
30803
- var integer4 = (node3) => {
31579
+ var integer5 = (node3) => {
30804
31580
  const value3 = node3?.kind === "unary" && node3.operator === "-" && node3.operand.kind === "number" ? -node3.operand.value : node3?.kind === "number" ? node3.value : void 0;
30805
31581
  return value3 !== void 0 && Number.isInteger(value3) ? value3 : void 0;
30806
31582
  };
@@ -30811,7 +31587,7 @@ function base(node3) {
30811
31587
  return SLOTS.find(([, native]) => native.toLowerCase() === name3)?.[0];
30812
31588
  }
30813
31589
  if (node3.name !== "RGB" || node3.args.length !== 3) return void 0;
30814
- const channels = node3.args.map(integer4);
31590
+ const channels = node3.args.map(integer5);
30815
31591
  if (channels.some((value3) => value3 === void 0 || value3 < 0 || value3 > 255)) return void 0;
30816
31592
  return `#${channels.map((value3) => value3.toString(16).padStart(2, "0")).join("")}`;
30817
31593
  }
@@ -30827,7 +31603,7 @@ function parseVisioThemeColorFormula(source) {
30827
31603
  const inner = ast.args[0];
30828
31604
  if (inner.kind === "call" && inner.name === "MSOTINT" && inner.args.length === 2) {
30829
31605
  const from2 = base(inner.args[0]);
30830
- const tint = integer4(inner.args[1]);
31606
+ const tint = integer5(inner.args[1]);
30831
31607
  return from2 && tint !== void 0 && tint !== 0 && Math.abs(tint) <= 100 ? { base: from2, tint } : void 0;
30832
31608
  }
30833
31609
  const from = base(inner);
@@ -32777,10 +33553,10 @@ function writeInstanceCell(sheet, cell, value3, options2 = {}) {
32777
33553
  async function instanceTarget(root2, shapeId2, template, code = "UNSUPPORTED_INSTANCE_EDIT") {
32778
33554
  const containers = children2(root2, "Shapes");
32779
33555
  if (containers.length !== 1) return void 0;
32780
- const candidates = children2(containers[0], "Shape").filter(
33556
+ const candidates2 = children2(containers[0], "Shape").filter(
32781
33557
  (shape) => attribute2(shape, "ID") === shapeId2
32782
33558
  );
32783
- const instance = candidates.length === 1 ? candidates[0] : void 0;
33559
+ const instance = candidates2.length === 1 ? candidates2[0] : void 0;
32784
33560
  const masterId = instance && attribute2(instance, "Master");
32785
33561
  if (!instance || masterId === void 0) return void 0;
32786
33562
  try {
@@ -32912,8 +33688,8 @@ async function groupScope(instance, template, code = "UNSUPPORTED_INSTANCE_EDIT"
32912
33688
  }
32913
33689
  async function instanceScope(root2, shapeId2, template, code = "UNSUPPORTED_INSTANCE_EDIT") {
32914
33690
  const containers = children2(root2, "Shapes");
32915
- const candidates = containers.length === 1 ? children2(containers[0], "Shape").filter((shape) => attribute2(shape, "ID") === shapeId2) : [];
32916
- const instance = candidates.length === 1 ? candidates[0] : void 0;
33691
+ const candidates2 = containers.length === 1 ? children2(containers[0], "Shape").filter((shape) => attribute2(shape, "ID") === shapeId2) : [];
33692
+ const instance = candidates2.length === 1 ? candidates2[0] : void 0;
32917
33693
  if (!instance || !instance.hasAttribute("Master")) return void 0;
32918
33694
  if (isGroupInstance(instance)) return groupScope(instance, template, code);
32919
33695
  const target2 = await instanceTarget(root2, shapeId2, template, code);
@@ -35758,12 +36534,12 @@ function assertUngluedTree(root2, ids, message) {
35758
36534
  function proveLocalGroupRotation(root2, edit, check) {
35759
36535
  const groups = /* @__PURE__ */ new Set(), angleCells = /* @__PURE__ */ new Set();
35760
36536
  if (edit.type !== "rotate-shape" && edit.type !== "move-shape") return { groups, angleCells };
35761
- const candidates = children2(children2(root2, "Shapes")[0], "Shape").filter(
36537
+ const candidates2 = children2(children2(root2, "Shapes")[0], "Shape").filter(
35762
36538
  (node3) => attribute2(node3, "ID") === edit.shapeId
35763
36539
  );
35764
- if (candidates.length !== 1 || attribute2(candidates[0], "Type") !== "Group")
36540
+ if (candidates2.length !== 1 || attribute2(candidates2[0], "Type") !== "Group")
35765
36541
  return { groups, angleCells };
35766
- const group2 = candidates[0];
36542
+ const group2 = candidates2[0];
35767
36543
  assertUngluedTree(
35768
36544
  root2,
35769
36545
  proveLocalShapeTree(group2, check),
@@ -36234,13 +37010,13 @@ async function pageContext(pkg, pageId2) {
36234
37010
  const page = pages.find((node3) => attribute2(node3, "ID") === pageId2);
36235
37011
  const foreground = pages.filter((node3) => !yes(attribute2(node3, "Background")));
36236
37012
  const number5 = page ? foreground.indexOf(page) + 1 : 0;
36237
- const properties2 = await readVisioFieldProperties(pkg);
36238
- for (const key2 of STRING_PROPERTIES) properties2[key2] ??= "";
37013
+ const properties = await readVisioFieldProperties(pkg);
37014
+ for (const key2 of STRING_PROPERTIES) properties[key2] ??= "";
36239
37015
  return {
36240
37016
  pageName: attribute2(page, "Name") ?? attribute2(page, "NameU") ?? `Page ${pageId2}`,
36241
37017
  ...number5 ? { pageNumber: number5 } : {},
36242
37018
  pageCount: foreground.length,
36243
- properties: properties2,
37019
+ properties,
36244
37020
  now: visioWallClock(/* @__PURE__ */ new Date())
36245
37021
  };
36246
37022
  }
@@ -36412,9 +37188,39 @@ async function insertVisioTextField(pkg, pagePaths, roots2, document, edit, chec
36412
37188
  return true;
36413
37189
  }
36414
37190
 
36415
- // visio/edit-resize-anchor.ts
36416
- var close3 = (a2, b) => Math.abs(a2 - b) <= 1e-10 * Math.max(1, Math.abs(a2), Math.abs(b));
36417
- function closure(graph, changed, check) {
37191
+ // visio/edit-resize-plan.ts
37192
+ var resizeClose = (a2, b) => Math.abs(a2 - b) <= 1e-10 * Math.max(1, Math.abs(a2), Math.abs(b));
37193
+ function assertCanonicalResizeCells(shape) {
37194
+ const canonical2 = [
37195
+ "Width",
37196
+ "Height",
37197
+ "PinX",
37198
+ "PinY",
37199
+ "LocPinX",
37200
+ "LocPinY",
37201
+ "Angle",
37202
+ "FlipX",
37203
+ "FlipY",
37204
+ "LockMoveX",
37205
+ "LockMoveY",
37206
+ "LockWidth",
37207
+ "LockHeight",
37208
+ "LockAspect",
37209
+ "LockDelete",
37210
+ "ResizeMode"
37211
+ ];
37212
+ for (const cell of children2(shape, "Cell")) {
37213
+ const name3 = attribute2(cell, "N") ?? "";
37214
+ if (canonical2.some(
37215
+ (expected) => expected.toLowerCase() === name3.toLowerCase() && expected !== name3
37216
+ ))
37217
+ fail(
37218
+ "EDIT_AMBIGUOUS_CELL",
37219
+ "Noncanonical transform and protection cell names are unsupported."
37220
+ );
37221
+ }
37222
+ }
37223
+ function resizeClosure(graph, changed, check) {
36418
37224
  const reverse = /* @__PURE__ */ new Map();
36419
37225
  for (const [id3, item2] of graph) {
36420
37226
  check();
@@ -36437,40 +37243,128 @@ function closure(graph, changed, check) {
36437
37243
  }
36438
37244
  return affected;
36439
37245
  }
37246
+
37247
+ // visio/edit-group-resize.ts
37248
+ function localGroupResize(root2, id3, document, check) {
37249
+ const candidates2 = children2(children2(root2, "Shapes")[0], "Shape").filter(
37250
+ (shape) => attribute2(shape, "ID") === id3
37251
+ );
37252
+ if (candidates2.length !== 1 || attribute2(candidates2[0], "Type") !== "Group") return void 0;
37253
+ const group2 = candidates2[0];
37254
+ const members3 = children2(children2(group2, "Shapes")[0], "Shape");
37255
+ if ([group2, ...members3].some(
37256
+ (shape) => shape.hasAttribute("Master") || shape.hasAttribute("MasterShape")
37257
+ ) || !members3.length || members3.length > 500 || members3.some(
37258
+ (shape) => attribute2(shape, "Type") !== "Shape" || children2(shape, "Shapes").length
37259
+ ))
37260
+ fail("UNSUPPORTED_GEOMETRY_EDIT", "Group resizing requires a flat local group of 2D shapes.");
37261
+ const ids = proveLocalShapeTree(group2, check);
37262
+ assertUngluedTree(root2, ids, "Group resizing cannot update glued members or group connections.");
37263
+ const shapes = /* @__PURE__ */ new Set([group2, ...members3]);
37264
+ for (const shape of shapes) {
37265
+ check();
37266
+ assertCanonicalResizeCells(shape);
37267
+ protectedShape(shape, document);
37268
+ assertUnlayeredShape(shape, document);
37269
+ if (shape !== group2 && Math.abs(Math.sin(numeric(cells(shape).get("Angle"), 0))) > 1e-10)
37270
+ fail("UNSUPPORTED_GEOMETRY_EDIT", "Group resizing requires axis-aligned local members.");
37271
+ for (const node3 of Array.from(shape.childNodes).filter(
37272
+ (node4) => node4.nodeType === 1 && node4.localName !== "Shapes"
37273
+ )) {
37274
+ for (const cell of [node3, ...Array.from(node3.getElementsByTagName("*"))]) {
37275
+ const formula2 = executableCellFormula(attribute2(cell, "F"));
37276
+ if (formula2 && analyzeVisioFormula(formula2).unsupportedFunctions.length)
37277
+ fail(
37278
+ "EDIT_UNSUPPORTED_FORMULA",
37279
+ "Group resize cannot refresh unsupported or text-measured formulas."
37280
+ );
37281
+ }
37282
+ }
37283
+ }
37284
+ return { group: group2, members: members3, shapes, groups: /* @__PURE__ */ new Set([group2]) };
37285
+ }
37286
+ function planGroupResize(scope2, roots2, edit, source, check) {
37287
+ const writes = [];
37288
+ const expected = /* @__PURE__ */ new Map();
37289
+ const read = (shape, name3, fallback) => {
37290
+ const local = cells(shape);
37291
+ return local.has(name3) || ["LocPinX", "LocPinY"].includes(name3) ? source(key({ pageId: edit.pageId, shapeId: attribute2(shape, "ID"), cell: name3 })).value : numeric(local.get(name3), fallback);
37292
+ };
37293
+ const mode = (shape, fallback) => {
37294
+ const cell = cells(shape).get("ResizeMode");
37295
+ if (!cell) return fallback;
37296
+ const formula2 = executableCellFormula(attribute2(cell, "F"));
37297
+ if (attribute2(cell, "F") === "Inh" || formula2 && analyzeVisioFormula(formula2).references.length || visioFormulaCachedValue("0", attribute2(cell, "U")).unit !== "scalar")
37298
+ fail("UNSUPPORTED_GEOMETRY_EDIT", "Group resize needs a constant local ResizeMode.");
37299
+ const value3 = read(shape, "ResizeMode");
37300
+ if (![0, 1, 2].includes(value3))
37301
+ fail("UNSUPPORTED_GEOMETRY_EDIT", "Unsupported group ResizeMode.");
37302
+ return value3 || fallback;
37303
+ };
37304
+ const width = read(scope2.group, "Width"), height = read(scope2.group, "Height");
37305
+ const sx = edit.width / width, sy = edit.height / height, groupMode = mode(scope2.group, 2);
37306
+ for (const shape of scope2.members) {
37307
+ check();
37308
+ const id3 = attribute2(shape, "ID"), local = cells(shape), scaling = mode(shape, groupMode) === 2;
37309
+ const childW = read(shape, "Width"), childH = read(shape, "Height");
37310
+ const sizeX = scaling ? sx : 1, sizeY = scaling ? sy : 1;
37311
+ if (numeric(local.get("LockAspect"), 0) !== 0 && !resizeClose(sizeX, sizeY))
37312
+ fail("EDIT_PROTECTED_CELL", "A group member LockAspect prevents resizing.");
37313
+ if (scaling && (!resizeClose(sx, 1) || !resizeClose(sy, 1)))
37314
+ resizeGeometry(
37315
+ shape,
37316
+ roots2,
37317
+ { ...edit, shapeId: id3 },
37318
+ check,
37319
+ /* @__PURE__ */ new Set(),
37320
+ /* @__PURE__ */ new Set(),
37321
+ scope2.shapes
37322
+ );
37323
+ for (const [name3, factor, formula2, lock] of [
37324
+ ["PinX", sx, `Sheet.${edit.shapeId}!Width*${read(shape, "PinX") / width}`, "LockMoveX"],
37325
+ ["PinY", sy, `Sheet.${edit.shapeId}!Height*${read(shape, "PinY") / height}`, "LockMoveY"],
37326
+ ["Width", sizeX, `Sheet.${edit.shapeId}!Width*${childW / width}`, "LockWidth"],
37327
+ ["Height", sizeY, `Sheet.${edit.shapeId}!Height*${childH / height}`, "LockHeight"],
37328
+ ["LocPinX", sizeX, `Width*${read(shape, "LocPinX") / childW}`, ""],
37329
+ ["LocPinY", sizeY, `Height*${read(shape, "LocPinY") / childH}`, ""]
37330
+ ]) {
37331
+ const old = read(shape, name3), value3 = old * factor;
37332
+ if (!Number.isFinite(value3) || Math.abs(value3) > 1e6 || ["Width", "Height"].includes(name3) && value3 <= 0)
37333
+ fail("UNSUPPORTED_GEOMETRY_EDIT", "Resized group member exceeds coordinate limits.");
37334
+ expected.set(key({ pageId: edit.pageId, shapeId: id3, cell: name3 }), value3);
37335
+ if (resizeClose(value3, old)) continue;
37336
+ if (lock && numeric(local.get(lock), 0) !== 0)
37337
+ fail("EDIT_PROTECTED_CELL", `A group member ${lock} prevents resizing.`);
37338
+ const node3 = local.get(name3);
37339
+ const existing = executableCellFormula(attribute2(node3, "F"));
37340
+ if (guardedCell(node3) || existing && analyzeVisioFormula(existing).references.length)
37341
+ continue;
37342
+ editableCell(
37343
+ node3,
37344
+ (reference2) => source(
37345
+ key({ pageId: edit.pageId, shapeId: reference2.shapeId ?? id3, cell: reference2.cell })
37346
+ )
37347
+ );
37348
+ writes.push({ shape, name: name3, value: value3, formula: formula2 });
37349
+ }
37350
+ for (const name3 of ["Angle", "FlipX", "FlipY"])
37351
+ expected.set(key({ pageId: edit.pageId, shapeId: id3, cell: name3 }), read(shape, name3, 0));
37352
+ }
37353
+ return { writes, expected };
37354
+ }
37355
+
37356
+ // visio/edit-resize-anchor.ts
36440
37357
  function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /* @__PURE__ */ new Set()) {
36441
37358
  check();
36442
37359
  const root2 = roots2.get(edit.pageId);
36443
37360
  if (!root2) fail("EDIT_TARGET_NOT_FOUND", "Page does not exist.");
36444
- const shape = admitted(root2, edit.shapeId);
37361
+ const group2 = localGroupResize(root2, edit.shapeId, document, check);
37362
+ const shape = admitted(root2, edit.shapeId, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Map(), void 0, group2?.groups);
36445
37363
  const local = cells(shape);
36446
- const canonical2 = [
36447
- "Width",
36448
- "Height",
36449
- "PinX",
36450
- "PinY",
36451
- "LocPinX",
36452
- "LocPinY",
36453
- "Angle",
36454
- "FlipX",
36455
- "FlipY",
36456
- "LockMoveX",
36457
- "LockMoveY",
36458
- "LockWidth",
36459
- "LockHeight",
36460
- "LockAspect",
36461
- "LockDelete"
36462
- ];
36463
- for (const name3 of local.keys())
36464
- if (canonical2.some(
36465
- (expected) => expected.toLowerCase() === name3.toLowerCase() && expected !== name3
36466
- ))
36467
- fail(
36468
- "EDIT_AMBIGUOUS_CELL",
36469
- "Noncanonical transform and protection cell names are unsupported."
36470
- );
37364
+ assertCanonicalResizeCells(shape);
36471
37365
  if (!edit.anchor || isLineSheet(cells(shape)) || edit.height <= 0)
36472
37366
  fail("UNSUPPORTED_GEOMETRY_EDIT", "Anchored resizing requires an ordinary local 2D shape.");
36473
- if (Array.from(shape.getElementsByTagName("*")).some(
37367
+ if (!group2 && Array.from(shape.getElementsByTagName("*")).some(
36474
37368
  (node3) => node3.localName === "Shape" && [VISIO_NS, VISIO_LEGACY_NS].includes(node3.namespaceURI ?? "")
36475
37369
  ))
36476
37370
  fail("UNSUPPORTED_GEOMETRY_EDIT", "Nested shape identities cannot be resized as a local leaf.");
@@ -36480,7 +37374,11 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36480
37374
  for (const connection of children2(container, "Connect"))
36481
37375
  if (!glueShapes.has(shape) && ["FromSheet", "ToSheet"].some((name3) => attribute2(connection, name3) === edit.shapeId))
36482
37376
  fail("UNSUPPORTED_GEOMETRY_EDIT", "Glued shapes require routing outside this subset.");
36483
- const graph = indexCells(roots2, { check, glueShapes });
37377
+ const graph = indexCells(roots2, {
37378
+ check,
37379
+ glueShapes,
37380
+ ...group2 ? { groupResizeShapes: group2.shapes } : {}
37381
+ });
36484
37382
  const id3 = (cell) => key({ pageId: edit.pageId, shapeId: edit.shapeId, cell });
36485
37383
  const source = createVisioCellEvaluator(graph, { check, glueShapes }, true);
36486
37384
  const read = (name3, fallback) => graph.has(id3(name3)) ? source(id3(name3)).value : numeric(local.get(name3), fallback);
@@ -36496,8 +37394,9 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36496
37394
  if (![0, 1].includes(flipX) || ![0, 1].includes(flipY))
36497
37395
  fail("EDIT_FORMULA_UNIT", "Flip cells must be scalar booleans.");
36498
37396
  if (width === edit.width && height === edit.height) return [];
36499
- resizeGeometry(shape, roots2, edit, check);
36500
- if (numeric(local.get("LockAspect"), 0) !== 0 && !close3(edit.width / width, edit.height / height))
37397
+ if (!group2 || children2(shape, "Section").some((section3) => attribute2(section3, "N") === "Geometry"))
37398
+ resizeGeometry(shape, roots2, edit, check, /* @__PURE__ */ new Set(), glueShapes, group2?.shapes);
37399
+ if (numeric(local.get("LockAspect"), 0) !== 0 && !resizeClose(edit.width / width, edit.height / height))
36501
37400
  fail("EDIT_PROTECTED_CELL", "LockAspect prevents changing the aspect ratio.");
36502
37401
  const geometry = visioAnchoredResizeGeometry(
36503
37402
  {
@@ -36539,19 +37438,21 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36539
37438
  writes.push({ name: name3, value: value3 });
36540
37439
  }
36541
37440
  const changedDimensions = writes.map((write2) => id3(write2.name));
36542
- const dimensionClosure = closure(graph, changedDimensions, check);
37441
+ const dimensionClosure = resizeClosure(graph, changedDimensions, check);
36543
37442
  for (const [name3, value3, old] of [
36544
37443
  ["PinX", geometry.pinX, pinX],
36545
37444
  ["PinY", geometry.pinY, pinY]
36546
37445
  ])
36547
- if (!local.has(name3) || !close3(value3, old) || dimensionClosure.has(id3(name3)) && !guardedCell(local.get(name3))) {
36548
- if (!close3(value3, old)) unlocked(name3 === "PinX" ? "LockMoveX" : "LockMoveY");
37446
+ if (!local.has(name3) || !resizeClose(value3, old) || dimensionClosure.has(id3(name3)) && !guardedCell(local.get(name3))) {
37447
+ if (!resizeClose(value3, old)) unlocked(name3 === "PinX" ? "LockMoveX" : "LockMoveY");
36549
37448
  writable(name3);
36550
- writes.push({ name: name3, value: close3(value3, old) ? old : value3 });
37449
+ writes.push({ name: name3, value: resizeClose(value3, old) ? old : value3 });
36551
37450
  }
36552
37451
  const projected = new Map(graph);
37452
+ const writeId = (write2) => key({ pageId: edit.pageId, shapeId: attribute2(write2.shape ?? shape, "ID"), cell: write2.name });
36553
37453
  const install = (write2) => {
36554
- const original = local.get(write2.name);
37454
+ const owner = write2.shape ?? shape, ownerId2 = attribute2(owner, "ID");
37455
+ const original = cells(owner).get(write2.name);
36555
37456
  const node3 = original ? original.cloneNode(true) : shape.ownerDocument.createElementNS(shape.namespaceURI, "Cell");
36556
37457
  node3.setAttribute("N", write2.name);
36557
37458
  node3.setAttribute("V", String(write2.value));
@@ -36559,7 +37460,7 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36559
37460
  else node3.removeAttribute("F");
36560
37461
  const cell = {
36561
37462
  pageId: edit.pageId,
36562
- shapeId: edit.shapeId,
37463
+ shapeId: ownerId2,
36563
37464
  cell: write2.name,
36564
37465
  node: node3,
36565
37466
  unsafe: false,
@@ -36568,9 +37469,11 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36568
37469
  };
36569
37470
  if (write2.formula) {
36570
37471
  cell.formula = parseVisioFormula(write2.formula);
36571
- cell.dependencies = [id3(write2.name === "LocPinX" ? "Width" : "Height")];
37472
+ cell.dependencies = analyzeVisioFormula(cell.formula).references.map(
37473
+ (reference2) => key({ pageId: edit.pageId, shapeId: reference2.shapeId ?? ownerId2, cell: reference2.cell })
37474
+ );
36572
37475
  }
36573
- projected.set(id3(write2.name), cell);
37476
+ projected.set(writeId(write2), cell);
36574
37477
  };
36575
37478
  for (const write2 of writes) install(write2);
36576
37479
  const guardedPins = [];
@@ -36590,16 +37493,17 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36590
37493
  }
36591
37494
  const projectedPins = createVisioCellEvaluator(projected, { check });
36592
37495
  for (const pin of guardedPins)
36593
- if (!close3(projectedPins(id3(pin.name)).value, pin.value))
37496
+ if (!resizeClose(projectedPins(id3(pin.name)).value, pin.value))
36594
37497
  fail(
36595
37498
  "EDIT_PROTECTED_CELL",
36596
37499
  "Guarded local pin does not scale proportionally with the requested dimension."
36597
37500
  );
36598
- const affected = closure(
36599
- projected,
36600
- writes.map((write2) => id3(write2.name)),
36601
- check
36602
- );
37501
+ const members3 = group2 && planGroupResize(group2, roots2, edit, source, check);
37502
+ for (const write2 of members3?.writes ?? []) {
37503
+ writes.push(write2);
37504
+ install(write2);
37505
+ }
37506
+ const affected = resizeClosure(projected, writes.map(writeId), check);
36603
37507
  for (const name3 of ["Angle", "FlipX", "FlipY"])
36604
37508
  if (affected.has(id3(name3)))
36605
37509
  fail(
@@ -36625,17 +37529,23 @@ function resizeVisioShapeAtAnchor(roots2, document, edit, check, glueShapes = /*
36625
37529
  ["LocPinX", geometry.locPinX],
36626
37530
  ["LocPinY", geometry.locPinY]
36627
37531
  ])
36628
- if (!close3(projected.has(id3(name3)) ? evaluate(id3(name3)).value : read(name3), expected))
37532
+ if (!resizeClose(projected.has(id3(name3)) ? evaluate(id3(name3)).value : read(name3), expected))
36629
37533
  fail(
36630
37534
  "EDIT_UNSUPPORTED_DEPENDENCY",
36631
37535
  "Dependent formulas would violate the requested anchor or dimensions."
36632
37536
  );
37537
+ for (const [cellId, expected] of members3?.expected ?? [])
37538
+ if (!resizeClose(projected.has(cellId) ? evaluate(cellId).value : 0, expected))
37539
+ fail(
37540
+ "EDIT_UNSUPPORTED_DEPENDENCY",
37541
+ "Dependent formulas would violate a resized group member pose."
37542
+ );
36633
37543
  check();
36634
- for (const write2 of writes) setCell(shape, write2.name, write2.value, write2.formula);
37544
+ for (const write2 of writes) setCell(write2.shape ?? shape, write2.name, write2.value, write2.formula);
36635
37545
  const dirty = /* @__PURE__ */ new Set([edit.pageId]);
36636
37546
  for (const [cellId, value3] of values) {
36637
37547
  const item2 = graph.get(cellId);
36638
- if (!item2?.node || !item2.formula || writes.some((write2) => id3(write2.name) === cellId)) continue;
37548
+ if (!item2?.node || !item2.formula || writes.some((write2) => writeId(write2) === cellId)) continue;
36639
37549
  if (attribute2(item2.node, "V") !== String(value3)) {
36640
37550
  item2.node.setAttribute("V", String(value3));
36641
37551
  dirty.add(item2.pageId);
@@ -37463,6 +38373,23 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
37463
38373
  cell
37464
38374
  }))
37465
38375
  );
38376
+ const groupResizeShapes = /* @__PURE__ */ new Set();
38377
+ const groupResizePages = /* @__PURE__ */ new Set();
38378
+ for (const command2 of commands) {
38379
+ if (command2.type !== "resize-shape" || !command2.anchor) continue;
38380
+ const group2 = children2(children2(roots2.get(command2.pageId), "Shapes")[0], "Shape").find(
38381
+ (shape) => attribute2(shape, "ID") === command2.shapeId && attribute2(shape, "Type") === "Group" && !shape.hasAttribute("Master")
38382
+ );
38383
+ if (!group2) continue;
38384
+ groupResizePages.add(command2.pageId);
38385
+ groupResizeShapes.add(group2);
38386
+ for (const member2 of Array.from(group2.getElementsByTagNameNS(group2.namespaceURI, "Shape"))) {
38387
+ check();
38388
+ groupResizeShapes.add(member2);
38389
+ for (const cell of ["PinX", "PinY", "Width", "Height", "LocPinX", "LocPinY"])
38390
+ changed.push({ pageId: command2.pageId, shapeId: attribute2(member2, "ID"), cell });
38391
+ }
38392
+ }
37466
38393
  const deleting = commands.filter((command2) => command2.type === "delete-shape");
37467
38394
  let query;
37468
38395
  const hasMasterInstances = [...roots2.values()].some(
@@ -37475,7 +38402,7 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
37475
38402
  const key2 = JSON.stringify([pageId2, shapeId2, cell.toLowerCase()]);
37476
38403
  let result2 = dependencyCache.get(key2);
37477
38404
  if (result2 === void 0) {
37478
- query ??= createVisioDependencyQuery(roots2, { check });
38405
+ query ??= createVisioDependencyQuery(roots2, { check, groupResizeShapes });
37479
38406
  result2 = query({ pageId: pageId2, shapeId: shapeId2, cell }, changed);
37480
38407
  dependencyCache.set(key2, result2);
37481
38408
  }
@@ -37531,6 +38458,11 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
37531
38458
  const item2 = pending2.pop(), node3 = item2.node;
37532
38459
  const pageId2 = admitted2(node3) && node3.localName === "Page" && root2.localName === "Pages" ? attribute2(node3, "ID") : item2.pageId;
37533
38460
  const style2 = item2.style || admitted2(node3) && node3.localName === "StyleSheets";
38461
+ if (pageId2 && groupResizePages.has(pageId2) && node3.localName === "Cell" && attribute2(node3, "N")?.toLowerCase() === "resizemode" && node3.parentNode?.nodeName.endsWith("PageSheet") && (node3.hasAttribute("E") || visioFormulaCachedValue("0", attribute2(node3, "U")).unit !== "scalar" || executableCellFormula(attribute2(node3, "F")) || attribute2(node3, "F") === "Inh" || !["0", "2"].includes(attribute2(node3, "V") ?? "")))
38462
+ fail(
38463
+ "UNSUPPORTED_GEOMETRY_EDIT",
38464
+ "Nondefault page-level ResizeMode is not supported for group resizing."
38465
+ );
37534
38466
  if (admitted2(node3) && !style2) {
37535
38467
  inspectFormula(node3, path3, pageId2);
37536
38468
  if (deleting.some(
@@ -38966,12 +39898,12 @@ function targetShape(root2, shapeId2) {
38966
39898
  const containers = children2(root2, "Shapes");
38967
39899
  if (containers.length !== 1)
38968
39900
  fail("UNSUPPORTED_FORMAT_EDIT", "One local Shapes container is required.");
38969
- const candidates = children2(containers[0], "Shape").filter(
39901
+ const candidates2 = children2(containers[0], "Shape").filter(
38970
39902
  (shape2) => attribute2(shape2, "ID") === shapeId2
38971
39903
  );
38972
- if (candidates.length !== 1)
39904
+ if (candidates2.length !== 1)
38973
39905
  fail("EDIT_TARGET_NOT_FOUND", "A unique top-level local shape is required.");
38974
- const shape = candidates[0];
39906
+ const shape = candidates2[0];
38975
39907
  if (shape.hasAttribute("Master") || shape.hasAttribute("MasterShape") || shape.hasAttribute("Del") || children2(shape, "Shapes").length || children2(shape, "ForeignData").length || children2(shape, "Rel").length || !["Shape", void 0].includes(attribute2(shape, "Type")))
38976
39908
  fail(
38977
39909
  "UNSUPPORTED_FORMAT_EDIT",
@@ -40516,10 +41448,10 @@ function groupVisioShapes(root2, document, edit, check, instances = NONE) {
40516
41448
  }
40517
41449
  function ungroupVisioShape(root2, document, edit, check, instances = NONE) {
40518
41450
  check();
40519
- const candidates = topLevel(root2).filter((shape) => attribute2(shape, "ID") === edit.shapeId);
40520
- if (candidates.length !== 1 || attribute2(candidates[0], "Type") !== "Group")
41451
+ const candidates2 = topLevel(root2).filter((shape) => attribute2(shape, "ID") === edit.shapeId);
41452
+ if (candidates2.length !== 1 || attribute2(candidates2[0], "Type") !== "Group")
40521
41453
  fail("EDIT_TARGET_NOT_FOUND", "A unique top-level local group is required.");
40522
- const group2 = candidates[0];
41454
+ const group2 = candidates2[0];
40523
41455
  const members3 = children2(children2(group2, "Shapes")[0], "Shape");
40524
41456
  if (!members3.length) fail("UNSUPPORTED_GROUP_EDIT", "The group has no member shapes.");
40525
41457
  const subtree = proveLocalShapeTree(group2, check);
@@ -42196,6 +43128,11 @@ async function editVsdxTransaction(input, edits, options2, clock = {
42196
43128
  dirty.set(pages.get(pageId2), roots2.get(pageId2));
42197
43129
  duplicateChanged = true;
42198
43130
  } else if (command2.type !== "insert-picture" && !isVisioChartObjectEdit(command2) && command2.type !== "set-page-theme" && command2.type !== "create-subprocess" && !isVisioCommentEdit(command2) && !isVisioDataEdit(command2) && command2.type !== "assign-layers" && command2.type !== "set-layer-properties" && !isVisioMasterDrop(command2)) {
43131
+ if (command2.type === "resize-shape" && command2.anchor) {
43132
+ const target2 = topShape(root2, command2.shapeId);
43133
+ if (attribute2(target2, "Type") === "Group" && !target2?.hasAttribute("Master"))
43134
+ await assertGeometryPackageScope(pkg, new Set(pages.values()), [command2], check, roots2);
43135
+ }
42199
43136
  const changedPages = instanceCommands.has(command2) && isInstanceGeometryEdit(roots2, command2) ? await applyInstanceGeometryEdit(roots2, command2, masterTemplate(pkg), check) : applyGeometryEdit(roots2, document, command2, check, masterMovePins);
42200
43137
  for (const pageId2 of changedPages) dirty.set(pages.get(pageId2), roots2.get(pageId2));
42201
43138
  if (changedPages.length && ["move-shape", "resize-shape", "rotate-shape", "flip-shape"].includes(command2.type))
@@ -43639,9 +44576,9 @@ function visioNextShapeId(page) {
43639
44576
 
43640
44577
  // visio/ui/formatting.ts
43641
44578
  function visioLocalFormattingShape(page, shapeId2) {
43642
- const candidates = page.shapes.filter((shape2) => shape2.id === shapeId2);
43643
- if (candidates.length !== 1) return void 0;
43644
- const shape = candidates[0];
44579
+ const candidates2 = page.shapes.filter((shape2) => shape2.id === shapeId2);
44580
+ if (candidates2.length !== 1) return void 0;
44581
+ const shape = candidates2[0];
43645
44582
  if (shape.hidden || shape.masterId || shape.layerIds?.length || shape.children.length || !["shape", "connector"].includes(shape.kind) || shape.image || shape.foreignVector)
43646
44583
  return void 0;
43647
44584
  return shape;
@@ -43656,8 +44593,8 @@ function holdsForeign(shape) {
43656
44593
  return pending2.length > 0;
43657
44594
  }
43658
44595
  function visioStencilInstanceShape(page, shapeId2) {
43659
- const candidates = page.shapes.filter((shape2) => shape2.id === shapeId2);
43660
- const shape = candidates.length === 1 ? candidates[0] : void 0;
44596
+ const candidates2 = page.shapes.filter((shape2) => shape2.id === shapeId2);
44597
+ const shape = candidates2.length === 1 ? candidates2[0] : void 0;
43661
44598
  if (!shape?.masterId || shape.hidden || (shape.kind === "group" ? !shape.children.length : shape.kind !== "shape") || shape.kind === "shape" && shape.children.length > 0 || holdsForeign(shape) || shape.layerIds?.some(
43662
44599
  (layer) => page.layers?.find((entry3) => entry3.id === layer)?.locked !== false
43663
44600
  ))
@@ -43681,8 +44618,8 @@ function visioFormatTargetShape(page, shapeId2) {
43681
44618
  return visioStyleFormattingShape(page, shapeId2) ?? visioStencilSubShape(page, shapeId2);
43682
44619
  }
43683
44620
  function visioStencilShape(page, shapeId2) {
43684
- const candidates = page.shapes.filter((shape2) => shape2.id === shapeId2);
43685
- const shape = candidates.length === 1 ? candidates[0] : void 0;
44621
+ const candidates2 = page.shapes.filter((shape2) => shape2.id === shapeId2);
44622
+ const shape = candidates2.length === 1 ? candidates2[0] : void 0;
43686
44623
  if (!shape?.masterId || shape.hidden || !["shape", "group"].includes(shape.kind) || shape.image || shape.foreignVector || shape.layerIds?.some(
43687
44624
  (layer) => page.layers?.find((entry3) => entry3.id === layer)?.locked !== false
43688
44625
  ))
@@ -44138,7 +45075,7 @@ function snapshotSelection(model, pageIndex, input, visible) {
44138
45075
  if (length > VISIO_VISIBILITY_LIMITS.maxShapes)
44139
45076
  throw new Error("Selection exceeds the supported shape count.");
44140
45077
  const page = model?.pages[pageIndex];
44141
- const candidates = /* @__PURE__ */ new Map();
45078
+ const candidates2 = /* @__PURE__ */ new Map();
44142
45079
  for (let index2 = 0; index2 < length; index2++) {
44143
45080
  const item2 = input[index2];
44144
45081
  const id3 = item2?.id, name3 = item2?.name, pageId2 = item2?.pageId;
@@ -44146,7 +45083,7 @@ function snapshotSelection(model, pageIndex, input, visible) {
44146
45083
  throw new Error("Selection requires shape IDs, names and optional page IDs.");
44147
45084
  const copied = Object.freeze({ id: id3, name: name3, ...pageId2 === void 0 ? {} : { pageId: pageId2 } });
44148
45085
  const key2 = selectionKey(copied, page?.id ?? "");
44149
- if (!candidates.has(key2)) candidates.set(key2, copied);
45086
+ if (!candidates2.has(key2)) candidates2.set(key2, copied);
44150
45087
  }
44151
45088
  if (!model || !page || !length) return EMPTY_SELECTION;
44152
45089
  const accepted = /* @__PURE__ */ new Map();
@@ -44156,14 +45093,14 @@ function snapshotSelection(model, pageIndex, input, visible) {
44156
45093
  while (pending2.length) {
44157
45094
  const { shape, ancestors } = pending2.pop();
44158
45095
  const key2 = selectionKey({ id: shape.id, pageId: source.id }, page.id);
44159
- if (candidates.has(key2) && hasVisibleShapeContent(shape, visible, content2))
45096
+ if (candidates2.has(key2) && hasVisibleShapeContent(shape, visible, content2))
44160
45097
  accepted.set(key2, ancestors);
44161
45098
  for (const child3 of shape.children)
44162
45099
  pending2.push({ shape: child3, ancestors: [...ancestors, key2] });
44163
45100
  }
44164
45101
  }
44165
45102
  const result2 = [];
44166
- for (const [key2, item2] of candidates) {
45103
+ for (const [key2, item2] of candidates2) {
44167
45104
  const ancestors = accepted.get(key2);
44168
45105
  if (!ancestors || ancestors.some((ancestor) => accepted.has(ancestor))) continue;
44169
45106
  result2.push(item2);
@@ -44363,8 +45300,10 @@ function visioMovementShape(page, id3) {
44363
45300
  return void 0;
44364
45301
  return shape;
44365
45302
  }
44366
- function visioPageDragDelta(start, end) {
44367
- return { x: end.x - start.x, y: start.y - end.y };
45303
+ function visioPageDragDelta(start, end, constrain = false) {
45304
+ const x = end.x - start.x, y = start.y - end.y;
45305
+ if (!constrain || !Number.isFinite(x) || !Number.isFinite(y)) return { x, y };
45306
+ return Math.abs(x) >= Math.abs(y) ? { x, y: 0 } : { x: 0, y };
44368
45307
  }
44369
45308
  function visioMovePreviewTransform(shape, delta) {
44370
45309
  if (![delta.x, delta.y, ...shape.transform].every(Number.isFinite)) return void 0;
@@ -44812,6 +45751,19 @@ function visioAutoConnectPlan(page, shapeId2, direction, target2, route = "right
44812
45751
  }
44813
45752
 
44814
45753
  // visio/ui/shape-resize.ts
45754
+ function resizableLocalGroup(page, shape) {
45755
+ if (shape.kind !== "group" || shape.masterId || !shape.children.length || shape.children.length > 500)
45756
+ return false;
45757
+ const ids = /* @__PURE__ */ new Set([shape.id]);
45758
+ for (const member2 of shape.children) {
45759
+ if (ids.has(member2.id) || member2.kind !== "shape" || member2.masterId || member2.children.length || member2.layerIds?.length || member2.image || member2.foreignVector || !member2.rotation || Math.abs(member2.transform[1]) > 1e-10 || Math.abs(member2.transform[2]) > 1e-10 || !visioResizeFrame(member2, member2, { x: 0, y: 0 }))
45760
+ return false;
45761
+ ids.add(member2.id);
45762
+ }
45763
+ return !page.connectors.some(
45764
+ (connection) => ids.has(connection.fromShapeId) || ids.has(connection.toShapeId)
45765
+ );
45766
+ }
44815
45767
  var VISIO_RESIZE_HANDLES = [
44816
45768
  { id: "sw", x: 0, y: 0 },
44817
45769
  { id: "s", x: 0.5, y: 0 },
@@ -44824,7 +45776,7 @@ var VISIO_RESIZE_HANDLES = [
44824
45776
  ];
44825
45777
  function visioResizeShape(page, id3) {
44826
45778
  const shape = visioMovementShape(page, id3);
44827
- return shape && (!shape.children.length || !!shape.masterId) && (!shape.layerIds?.length || !!shape.masterId) && visioResizeFrame(shape, { width: shape.width, height: shape.height }, { x: 0, y: 0 }) ? shape : void 0;
45779
+ return shape && (!shape.children.length || !!shape.masterId || resizableLocalGroup(page, shape)) && (!shape.layerIds?.length || !!shape.masterId) && visioResizeFrame(shape, { width: shape.width, height: shape.height }, { x: 0, y: 0 }) ? shape : void 0;
44828
45780
  }
44829
45781
  function visioResizeFrame(shape, size3, anchor) {
44830
45782
  if (!shape.rotation) return void 0;
@@ -44870,6 +45822,218 @@ function visioResizeDrag(page, id3, handle, start, end) {
44870
45822
  }
44871
45823
  }
44872
45824
 
45825
+ // geometry/element-transform.ts
45826
+ var DEFAULT_INTERACTION_MIN_SIZE = 12;
45827
+ var DEG_TO_RAD = Math.PI / 180;
45828
+ function rotationOf(box5) {
45829
+ return box5.rotation ?? 0;
45830
+ }
45831
+ function rotateDelta(dx, dy, rotationDeg) {
45832
+ if (!rotationDeg) {
45833
+ return { x: dx, y: dy };
45834
+ }
45835
+ const rad = -rotationDeg * DEG_TO_RAD;
45836
+ const cos = Math.cos(rad);
45837
+ const sin = Math.sin(rad);
45838
+ return {
45839
+ x: dx * cos - dy * sin,
45840
+ y: dx * sin + dy * cos
45841
+ };
45842
+ }
45843
+ function applyResize(box5, handle, dxScreen, dyScreen, zoom, opts = {}) {
45844
+ const scale = zoom;
45845
+ const minSize = opts.minSize ?? DEFAULT_INTERACTION_MIN_SIZE;
45846
+ const minWidth = opts.minWidth ?? minSize;
45847
+ const minHeight = opts.minHeight ?? minSize;
45848
+ const rotation = rotationOf(box5);
45849
+ const local = rotateDelta(dxScreen / scale, dyScreen / scale, rotation);
45850
+ const dx = local.x;
45851
+ const dy = local.y;
45852
+ let newX = box5.x;
45853
+ let newY = box5.y;
45854
+ let newW = box5.width;
45855
+ let newH = box5.height;
45856
+ const affectsLeft = handle === "nw" || handle === "w" || handle === "sw";
45857
+ const affectsRight = handle === "ne" || handle === "e" || handle === "se";
45858
+ const affectsTop = handle === "nw" || handle === "n" || handle === "ne";
45859
+ const affectsBottom = handle === "sw" || handle === "s" || handle === "se";
45860
+ if (affectsRight) {
45861
+ newW = Math.max(minWidth, box5.width + dx);
45862
+ } else if (affectsLeft) {
45863
+ newW = Math.max(minWidth, box5.width - dx);
45864
+ newX = box5.x + (box5.width - newW);
45865
+ }
45866
+ if (affectsBottom) {
45867
+ newH = Math.max(minHeight, box5.height + dy);
45868
+ } else if (affectsTop) {
45869
+ newH = Math.max(minHeight, box5.height - dy);
45870
+ newY = box5.y + (box5.height - newH);
45871
+ }
45872
+ return { x: newX, y: newY, width: newW, height: newH, rotation };
45873
+ }
45874
+
45875
+ // visio/ui/selection-resize.ts
45876
+ function candidates(page, ids) {
45877
+ if (!ids.length || ids.length > 500 || new Set(ids).size !== ids.length) return void 0;
45878
+ const shapes = [];
45879
+ for (const id3 of ids) {
45880
+ const shape = visioResizeShape(page, id3);
45881
+ if (!shape) return void 0;
45882
+ if (ids.length > 1) {
45883
+ const [a2, b, c2, d] = shape.transform;
45884
+ if (shape.children.length || shape.masterId || shape.kind !== "shape" || Math.abs(b) > 1e-10 || Math.abs(c2) > 1e-10 || Math.abs(Math.abs(a2) - 1) > 1e-10 || Math.abs(Math.abs(d) - 1) > 1e-10 || page.connectors.some((edge) => edge.fromShapeId === id3 || edge.toShapeId === id3))
45885
+ return void 0;
45886
+ }
45887
+ shapes.push(shape);
45888
+ }
45889
+ return shapes;
45890
+ }
45891
+ function selectionFrame(shapes) {
45892
+ const first2 = shapes[0];
45893
+ if (shapes.length === 1) return visioResizeFrame(first2, first2, { x: 0, y: 0 });
45894
+ let left = Infinity, bottom = Infinity, right2 = -Infinity, top = -Infinity;
45895
+ for (const shape of shapes) {
45896
+ const [a2, , , d, x, y] = shape.transform;
45897
+ left = Math.min(left, x, x + a2 * shape.width);
45898
+ right2 = Math.max(right2, x, x + a2 * shape.width);
45899
+ bottom = Math.min(bottom, y, y + d * shape.height);
45900
+ top = Math.max(top, y, y + d * shape.height);
45901
+ }
45902
+ const width = right2 - left, height = top - bottom;
45903
+ return width > 0 && height > 0 && [left, bottom, width, height].every(Number.isFinite) ? {
45904
+ width,
45905
+ height,
45906
+ transform: [1, 0, 0, 1, left, bottom],
45907
+ pinX: left + width / 2,
45908
+ pinY: bottom + height / 2
45909
+ } : void 0;
45910
+ }
45911
+ function visioResizeSelectionFrame(page, ids) {
45912
+ const shapes = candidates(page, ids);
45913
+ return shapes && selectionFrame(shapes);
45914
+ }
45915
+ function visioResizeSelectionDrag(page, ids, handle, start, end) {
45916
+ const shapes = candidates(page, ids);
45917
+ if (!shapes || !VISIO_RESIZE_HANDLES.some((item2) => item2.id === handle)) return void 0;
45918
+ if (shapes.length === 1) {
45919
+ const result2 = visioResizeDrag(page, ids[0], handle, start, end);
45920
+ return result2 && {
45921
+ frame: result2.frame,
45922
+ commands: [result2.command],
45923
+ members: [{ id: ids[0], frame: result2.frame }]
45924
+ };
45925
+ }
45926
+ const original = selectionFrame(shapes);
45927
+ if (!original || ![start.x, start.y, end.x, end.y].every(Number.isFinite)) return void 0;
45928
+ const [, , , , left, bottom] = original.transform;
45929
+ const box5 = applyResize(
45930
+ { x: left, y: -bottom - original.height, width: original.width, height: original.height },
45931
+ handle,
45932
+ end.x - start.x,
45933
+ end.y - start.y,
45934
+ 1,
45935
+ {
45936
+ minWidth: original.width * Math.max(...shapes.map((shape) => Math.min(1 / 16, shape.width) / shape.width)),
45937
+ minHeight: original.height * Math.max(...shapes.map((shape) => Math.min(1 / 16, shape.height) / shape.height))
45938
+ }
45939
+ );
45940
+ const sx = box5.width / original.width, sy = box5.height / original.height;
45941
+ const nextBottom = -box5.y - box5.height;
45942
+ const frame = {
45943
+ width: box5.width,
45944
+ height: box5.height,
45945
+ transform: [1, 0, 0, 1, box5.x, nextBottom],
45946
+ pinX: box5.x + box5.width / 2,
45947
+ pinY: nextBottom + box5.height / 2
45948
+ };
45949
+ if (![...frame.transform, frame.width, frame.height, frame.pinX, frame.pinY].every(Number.isFinite))
45950
+ return void 0;
45951
+ const commands = [];
45952
+ const members3 = [];
45953
+ try {
45954
+ for (const shape of shapes) {
45955
+ const width = shape.width * sx, height = shape.height * sy;
45956
+ const x = box5.x + (shape.rotation.pinX - left) * sx;
45957
+ const y = nextBottom + (shape.rotation.pinY - bottom) * sy;
45958
+ const resized = visioResizeFrame(shape, { width, height }, { x: 0, y: 0 });
45959
+ if (!resized) return void 0;
45960
+ members3.push({
45961
+ id: shape.id,
45962
+ frame: {
45963
+ ...resized,
45964
+ pinX: x,
45965
+ pinY: y,
45966
+ transform: [
45967
+ resized.transform[0],
45968
+ resized.transform[1],
45969
+ resized.transform[2],
45970
+ resized.transform[3],
45971
+ resized.transform[4] + x - resized.pinX,
45972
+ resized.transform[5] + y - resized.pinY
45973
+ ]
45974
+ }
45975
+ });
45976
+ if (Math.abs(width - shape.width) > 1e-10 || Math.abs(height - shape.height) > 1e-10) {
45977
+ const command2 = visioPageEditToDrawing(page, {
45978
+ type: "resize-shape",
45979
+ pageId: page.id,
45980
+ shapeId: shape.id,
45981
+ width,
45982
+ height,
45983
+ anchor: { x: 0, y: 0 }
45984
+ });
45985
+ if (command2.type !== "resize-shape" || command2.width > 1e6 || command2.height > 1e6)
45986
+ return void 0;
45987
+ commands.push(command2);
45988
+ }
45989
+ if (Math.abs(x - resized.pinX) > 1e-10 || Math.abs(y - resized.pinY) > 1e-10) {
45990
+ const command2 = visioPageEditToDrawing(page, {
45991
+ type: "move-shape",
45992
+ pageId: page.id,
45993
+ shapeId: shape.id,
45994
+ x,
45995
+ y
45996
+ });
45997
+ if (command2.type !== "move-shape" || ![command2.x, command2.y].every(Number.isFinite))
45998
+ return void 0;
45999
+ commands.push(command2);
46000
+ }
46001
+ }
46002
+ } catch {
46003
+ return void 0;
46004
+ }
46005
+ return { frame, commands, members: members3 };
46006
+ }
46007
+
46008
+ // visio/ui/geometry-expectation.ts
46009
+ function snapshotVisioGeometryExpectation(expected) {
46010
+ if (!expected.members.length || expected.members.length > 500 || new Set(expected.members.map((member2) => member2.id)).size !== expected.members.length)
46011
+ throw new Error("Invalid selection geometry expectation.");
46012
+ return {
46013
+ pageId: expected.pageId,
46014
+ members: expected.members.map(({ id: id3, frame }) => {
46015
+ if (frame.transform.length !== 6 || ![frame.width, frame.height, frame.pinX, frame.pinY, ...frame.transform].every(
46016
+ Number.isFinite
46017
+ ) || frame.width <= 0 || frame.height <= 0)
46018
+ throw new Error("Invalid selection geometry expectation.");
46019
+ return { id: id3, frame: { ...frame, transform: [...frame.transform] } };
46020
+ })
46021
+ };
46022
+ }
46023
+ function assertVisioGeometryExpectation(document, expected) {
46024
+ const pages = document.pages.filter((page2) => page2.id === expected.pageId);
46025
+ const page = pages.length === 1 ? pages[0] : void 0;
46026
+ const close3 = (actual, wanted) => Number.isFinite(actual) && Math.abs(actual - wanted) <= 1e-8 * Math.max(1, Math.abs(wanted));
46027
+ for (const { id: id3, frame } of expected.members) {
46028
+ const shapes = page?.shapes.filter((shape2) => shape2.id === id3);
46029
+ const shape = shapes?.length === 1 ? shapes[0] : void 0;
46030
+ if (!shape?.rotation || !close3(shape.width, frame.width) || !close3(shape.height, frame.height) || !close3(shape.rotation.pinX, frame.pinX) || !close3(shape.rotation.pinY, frame.pinY) || shape.transform.some((value3, index2) => !close3(value3, frame.transform[index2])))
46031
+ throw new Error(
46032
+ "Dependent formulas changed the requested selection geometry. The resize was not applied."
46033
+ );
46034
+ }
46035
+ }
46036
+
44873
46037
  // visio/ui/draw-path-plan.ts
44874
46038
  var isVisioPathTool = (tool) => tool === "freeform" || tool === "pencil" || tool === "arc";
44875
46039
  var VISIO_PATH_CLOSE_DISTANCE = 0.125;
@@ -45624,8 +46788,8 @@ var VISIO_RULER_DENSITY_CHOICES = Object.freeze([
45624
46788
  function step2(density, spacing2, zoom) {
45625
46789
  const base2 = density === 2 ? 1 : density === 4 ? 0.5 : 0.25;
45626
46790
  if (density === 0 && spacing2 > 0) return spacing2;
45627
- const level2 = Math.max(-6, Math.min(6, Math.floor(Math.log2(zoom > 0 ? zoom : 1) + 1e-9)));
45628
- let value3 = base2 / 2 ** level2;
46791
+ const level3 = Math.max(-6, Math.min(6, Math.floor(Math.log2(zoom > 0 ? zoom : 1) + 1e-9)));
46792
+ let value3 = base2 / 2 ** level3;
45629
46793
  if (spacing2 > 0) {
45630
46794
  while (value3 < spacing2 - 1e-9) value3 *= 2;
45631
46795
  }
@@ -46601,8 +47765,8 @@ function layers(ids, forward, shortest) {
46601
47765
  }
46602
47766
  const result2 = [];
46603
47767
  for (const id3 of ids) {
46604
- const level2 = rank.get(id3) ?? 0;
46605
- (result2[level2] ??= []).push(id3);
47768
+ const level3 = rank.get(id3) ?? 0;
47769
+ (result2[level3] ??= []).push(id3);
46606
47770
  }
46607
47771
  return result2.filter((layer) => layer.length);
46608
47772
  }
@@ -47224,8 +48388,11 @@ function visioSnapMoveDelta(page, ids, delta, options2) {
47224
48388
  if (grid.x && !axes.has("x")) snapped.x = gridEdge(snapped.x, box5.width, grid.x, grid.originX);
47225
48389
  if (grid.y && !axes.has("y")) snapped.y = gridEdge(snapped.y, box5.height, grid.y, -grid.originY);
47226
48390
  return {
47227
- delta: { x: delta.x + snapped.x - box5.x, y: delta.y - (snapped.y - box5.y) },
47228
- lines: snapped.guides
48391
+ delta: {
48392
+ x: options2.axis === "y" ? delta.x : delta.x + snapped.x - box5.x,
48393
+ y: options2.axis === "x" ? delta.y : delta.y - (snapped.y - box5.y)
48394
+ },
48395
+ lines: snapped.guides.filter((line2) => !options2.axis || line2.axis === options2.axis)
47229
48396
  };
47230
48397
  }
47231
48398
  function gridEdge(start, size3, grid, origin = 0) {
@@ -47794,4 +48961,4 @@ async function createSampleVsdx() {
47794
48961
  return (await editVsdx(pages.bytes, PAGES.flatMap(shapeEdits))).bytes;
47795
48962
  }
47796
48963
 
47797
- export { DocumentHistory, EDIT_HISTORY_LIMITS, EMPTY_EDIT_STATE, EMPTY_SELECTION, EMPTY_TEXT_SEARCH, FOREIGN_VECTOR_SCENE_LIMITS, ForeignVectorBudget, MAX_INPUT_BYTES, TEXT_SEARCH_LIMITS, VISIO_AUTO_CONNECT_DIRECTIONS, VISIO_AUTO_CONNECT_GAP, VISIO_AUTO_CONNECT_REACH, VISIO_BULLET_STYLES, VISIO_CAPABILITY_BACKSTAGE_PAGES, VISIO_CAPABILITY_COMMANDS, VISIO_CAPABILITY_IDS, VISIO_CHART_OBJECT_SIZE, VISIO_DATA_GRAPHIC_FILL_ROW, VISIO_DATA_GRAPHIC_ICONS, VISIO_DATA_GRAPHIC_ROW, VISIO_DIAGRAM_RULE_SETS, VISIO_FIELD_CATEGORIES, VISIO_FORMAT_PAINTER_LIMITS, VISIO_GRID_DENSITY_CHOICES, IDENTITY_AFFINE as VISIO_IDENTITY_TRANSFORM, VISIO_INITIAL_PRESENCE, VISIO_LAYOUT_LABELS, VISIO_LAYOUT_STYLES, VISIO_PAGE_SIZE_PRESETS, VISIO_PAPER_SIZES, VISIO_PASTE_TEXT_LIMIT, VISIO_PATH_CLOSE_DISTANCE, VISIO_PATH_TOLERANCE, VISIO_PICTURE_DPI, VISIO_PRESENCE_MAX_COORDINATE, VISIO_PRESENCE_MAX_ID, VISIO_PRESENCE_MAX_SELECTION, VISIO_RESIZE_HANDLES, VISIO_RULER_DENSITY_CHOICES, VISIO_SELECT_TYPES, VISIO_SELECT_TYPE_LABELS, VISIO_SUBPROCESS_SHAPE, VISIO_TEXT_BLOCK_HANDLES, VISIO_TEXT_LANGUAGES, VISIO_TEXT_REPLACE_LIMITS, VisioTextDraftError, assertShapeDetails, assertViewableDocument, checkVisioDiagram, clampHistoryEntries, compatibilityNotes, compatibilityText, composeAffine as composeVisioTransform, copySnapshotScene, createSampleVsdx, demoDocument, editErrorMessage, eventKeys, excelSerialToIso, hasVisibleShapeContent, indexDocumentText, inspectForeignVectorResource, isEditCancellation, isVisioPathTool, normalizeVisioHyperlinkAddress, propertyKeys, sameSelection, sanitizeVisioPresence, searchDocumentText, selectionKey, snapshotEdits, snapshotSelection, textSearchStatus, validateSearchQuery, visioAddConnectionPointCommand, visioArrangeCommands, visioAutoAlignCommands, visioAutoConnectArrows, visioAutoConnectNeighbor, visioAutoConnectPlacement, visioAutoConnectPlan, visioAutoConnectShape, visioAutoConnectSidePoint, visioBoxCreationCommand, visioCalloutCommand, visioChangeCaseCommand, visioChangeCaseShape, visioChangeMasterCommand, visioChangeMasterTargets, visioChangeShapeCommand, visioChangeShapeRefusal, visioChartObjectInsertCommand, visioClipboardShape, visioColorRules, visioConnectableShape, visioConnectorCreationCommand, visioConnectorEdges, visioConnectorEndHandles, visioConnectorMovePreviews, visioConnectorPreviewPath, visioConnectorRouteOf, visioContainerCommand, visioCopyableShape, visioDataGraphicEdits, visioDataGraphicFields, visioDataGraphicMarker, visioDataGraphicParts, visioDataTable, visioDrawBounds, visioDrawIsLargeEnough, visioDrawPlan, visioDrawingPoint, visioDuplicateCommand, visioFileMasterDropCommand, visioFillPatternTransform, visioFitToDrawingEdits, visioFollowTarget, visioFontFamilies, visioFormatPainterEdits, visioFormatPainterSnapshot, visioFormatTargetShape, visioFormattingShape, visioGlowKey, visioGlueableShape, visioGradientInstances, visioGridSteps, visioGroupCommand, visioGuideCreateCommand, visioGuideMoveCommand, visioKeepAutoSize, visioLayerAssignCommand, visioLayerAssignCommands, visioLayerAssignState, visioLegendEdits, visioLineCreationCommand, visioLineDashLengths, visioLocalFormattingShape, visioLocalRotationShape, visioMarqueeBox, visioMarqueeSelection, visioMasterDropCommand, visioMasterDropRefusal, visioMasterDropSize, visioMasterPreviewBox, visioMatchingPaperSize, visioMovableGroup, visioMoveCommands, visioMovePreviewTransform, visioMoveTargets, visioMovementShape, visioNearestConnectionPoint, visioNewLayerNames, visioNewPageId, visioNextShapeId, visioNudgeCommands, visioOrderingShape, visioOrientationEdits, visioPageBreaks, visioPageConnectionPoints, visioPageDecorationState, visioPageDragDelta, visioPageEditToDrawing, visioPageGuides, visioPageInsertCommand, visioPageMasters, visioPageOrientationCommand, visioPageSizeCommand, visioPageSizePresetCommand, visioPageSizePresetEdits, visioPageSizeState, visioPaperSize, visioParseRange, visioPasteCommand, visioPasteTextCommand, visioPasteTextValue, visioPathDrawPlan, visioPathPreview, visioPictureInsertCommand, visioPrintTile, visioQuarterTurnCommand, visioReLayoutCommands, visioReflectionKey, visioRemoveDataGraphicEdits, visioRenderedGradientStopCount, visioRenderedGradientStops, visioResizeDrag, visioResizeFrame, visioResizeShape, visioRotationPreviewTransform, visioRotationShape, visioRulerDensityFactor, visioRulerGridEdits, visioRulerGridValues, visioSceneToLocal, visioSelectByType, visioSelectionIsOnPage, visioShadowPreset, visioShapeDataNumber, visioShapeDataRow, visioShapeDataText, visioShapeEffectValues, visioShapeFormattingState, visioShapeFrame, visioShapeLocalPoint, visioShapePageBox, visioShapeReport, visioShapeReportCsv, visioShapeReportTable, visioShapeReportText, visioShapeSelectType, visioShapeSnapBox, visioSizePositionCommand, visioSizePositionState, visioSnapMoveDelta, visioStencilDropCommand, visioStencilInstanceShape, visioStencilShape, visioStencilSubShape, visioStraightLineHandles, visioStrokeGradient, visioStyleFormattingShape, visioSubprocessCommand, visioSvgStrokeStyle, visioTextAppendEdit, visioTextBlockDrag, visioTextBlockEdit, visioTextBlockFrame, visioTextBlockMatrix, visioTextBlockShape, visioTextDialogPatch, visioTextDialogValues, visioTextDraftEdit, visioTextFontStepCommand, visioTextFormattingState, visioTextIndentCommand, visioTextOccurrenceSelection, visioTextReplaceCommands, visioTextReplaceFindNext, visioTextReplaceOccurrences, visioTextReplacePlan, visioTextShape, visioTextSource, visioUngroupCommand, visioWithCalloutLeaders, visioWithContainerMembers, visioWithDataGraphics, visioWorkbookGrid };
48964
+ export { DocumentHistory, EDIT_HISTORY_LIMITS, EMPTY_EDIT_STATE, EMPTY_SELECTION, EMPTY_TEXT_SEARCH, FOREIGN_VECTOR_SCENE_LIMITS, ForeignVectorBudget, MAX_INPUT_BYTES, TEXT_SEARCH_LIMITS, VISIO_AUTO_CONNECT_DIRECTIONS, VISIO_AUTO_CONNECT_GAP, VISIO_AUTO_CONNECT_REACH, VISIO_BULLET_STYLES, VISIO_CAPABILITY_BACKSTAGE_PAGES, VISIO_CAPABILITY_COMMANDS, VISIO_CAPABILITY_IDS, VISIO_CHART_OBJECT_SIZE, VISIO_DATA_GRAPHIC_FILL_ROW, VISIO_DATA_GRAPHIC_ICONS, VISIO_DATA_GRAPHIC_ROW, VISIO_DIAGRAM_RULE_SETS, VISIO_FIELD_CATEGORIES, VISIO_FORMAT_PAINTER_LIMITS, VISIO_GRID_DENSITY_CHOICES, IDENTITY_AFFINE as VISIO_IDENTITY_TRANSFORM, VISIO_INITIAL_PRESENCE, VISIO_LAYOUT_LABELS, VISIO_LAYOUT_STYLES, VISIO_PAGE_SIZE_PRESETS, VISIO_PAPER_SIZES, VISIO_PASTE_TEXT_LIMIT, VISIO_PATH_CLOSE_DISTANCE, VISIO_PATH_TOLERANCE, VISIO_PICTURE_DPI, VISIO_PRESENCE_MAX_COORDINATE, VISIO_PRESENCE_MAX_ID, VISIO_PRESENCE_MAX_SELECTION, VISIO_RESIZE_HANDLES, VISIO_RULER_DENSITY_CHOICES, VISIO_SELECT_TYPES, VISIO_SELECT_TYPE_LABELS, VISIO_SUBPROCESS_SHAPE, VISIO_TEXT_BLOCK_HANDLES, VISIO_TEXT_LANGUAGES, VISIO_TEXT_REPLACE_LIMITS, VisioTextDraftError, assertShapeDetails, assertViewableDocument, assertVisioGeometryExpectation, checkVisioDiagram, clampHistoryEntries, compatibilityNotes, compatibilityText, composeAffine as composeVisioTransform, copySnapshotScene, createSampleVsdx, demoDocument, editErrorMessage, eventKeys, excelSerialToIso, hasVisibleShapeContent, indexDocumentText, inspectForeignVectorResource, isEditCancellation, isVisioPathTool, normalizeVisioHyperlinkAddress, propertyKeys, sameSelection, sanitizeVisioPresence, searchDocumentText, selectionKey, snapshotEdits, snapshotSelection, snapshotVisioGeometryExpectation, textSearchStatus, validateSearchQuery, visioAddConnectionPointCommand, visioArrangeCommands, visioAutoAlignCommands, visioAutoConnectArrows, visioAutoConnectNeighbor, visioAutoConnectPlacement, visioAutoConnectPlan, visioAutoConnectShape, visioAutoConnectSidePoint, visioBoxCreationCommand, visioCalloutCommand, visioChangeCaseCommand, visioChangeCaseShape, visioChangeMasterCommand, visioChangeMasterTargets, visioChangeShapeCommand, visioChangeShapeRefusal, visioChartObjectInsertCommand, visioClipboardShape, visioColorRules, visioConnectableShape, visioConnectorCreationCommand, visioConnectorEdges, visioConnectorEndHandles, visioConnectorMovePreviews, visioConnectorPreviewPath, visioConnectorRouteOf, visioContainerCommand, visioCopyableShape, visioDataGraphicEdits, visioDataGraphicFields, visioDataGraphicMarker, visioDataGraphicParts, visioDataTable, visioDrawBounds, visioDrawIsLargeEnough, visioDrawPlan, visioDrawingPoint, visioDuplicateCommand, visioFileMasterDropCommand, visioFillPatternTransform, visioFitToDrawingEdits, visioFollowTarget, visioFontFamilies, visioFormatPainterEdits, visioFormatPainterSnapshot, visioFormatTargetShape, visioFormattingShape, visioGlowKey, visioGlueableShape, visioGradientInstances, visioGridSteps, visioGroupCommand, visioGuideCreateCommand, visioGuideMoveCommand, visioKeepAutoSize, visioLayerAssignCommand, visioLayerAssignCommands, visioLayerAssignState, visioLegendEdits, visioLineCreationCommand, visioLineDashLengths, visioLocalFormattingShape, visioLocalRotationShape, visioMarqueeBox, visioMarqueeSelection, visioMasterDropCommand, visioMasterDropRefusal, visioMasterDropSize, visioMasterPreviewBox, visioMatchingPaperSize, visioMovableGroup, visioMoveCommands, visioMovePreviewTransform, visioMoveTargets, visioMovementShape, visioNearestConnectionPoint, visioNewLayerNames, visioNewPageId, visioNextShapeId, visioNudgeCommands, visioOrderingShape, visioOrientationEdits, visioPageBreaks, visioPageConnectionPoints, visioPageDecorationState, visioPageDragDelta, visioPageEditToDrawing, visioPageGuides, visioPageInsertCommand, visioPageMasters, visioPageOrientationCommand, visioPageSizeCommand, visioPageSizePresetCommand, visioPageSizePresetEdits, visioPageSizeState, visioPaperSize, visioParseRange, visioPasteCommand, visioPasteTextCommand, visioPasteTextValue, visioPathDrawPlan, visioPathPreview, visioPictureInsertCommand, visioPrintTile, visioQuarterTurnCommand, visioReLayoutCommands, visioReflectionKey, visioRemoveDataGraphicEdits, visioRenderedGradientStopCount, visioRenderedGradientStops, visioResizeDrag, visioResizeFrame, visioResizeSelectionDrag, visioResizeSelectionFrame, visioResizeShape, visioRotationPreviewTransform, visioRotationShape, visioRulerDensityFactor, visioRulerGridEdits, visioRulerGridValues, visioSceneToLocal, visioSelectByType, visioSelectionIsOnPage, visioShadowPreset, visioShapeDataNumber, visioShapeDataRow, visioShapeDataText, visioShapeEffectValues, visioShapeFormattingState, visioShapeFrame, visioShapeLocalPoint, visioShapePageBox, visioShapeReport, visioShapeReportCsv, visioShapeReportTable, visioShapeReportText, visioShapeSelectType, visioShapeSnapBox, visioSizePositionCommand, visioSizePositionState, visioSnapMoveDelta, visioStencilDropCommand, visioStencilInstanceShape, visioStencilShape, visioStencilSubShape, visioStraightLineHandles, visioStrokeGradient, visioStyleFormattingShape, visioSubprocessCommand, visioSvgStrokeStyle, visioTextAppendEdit, visioTextBlockDrag, visioTextBlockEdit, visioTextBlockFrame, visioTextBlockMatrix, visioTextBlockShape, visioTextDialogPatch, visioTextDialogValues, visioTextDraftEdit, visioTextFontStepCommand, visioTextFormattingState, visioTextIndentCommand, visioTextOccurrenceSelection, visioTextReplaceCommands, visioTextReplaceFindNext, visioTextReplaceOccurrences, visioTextReplacePlan, visioTextShape, visioTextSource, visioUngroupCommand, visioWithCalloutLeaders, visioWithContainerMembers, visioWithDataGraphics, visioWorkbookGrid };