ooxml-core 1.8.4 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/dist/PptxHandler-5UURGJEV.mjs +2 -0
  2. package/dist/{PptxHandler-BL4B7CZO.mjs → PptxHandler-ADEFY476.mjs} +2 -2
  3. package/dist/PptxHandler-U5XB2HUE.cjs +11 -0
  4. package/dist/automation/index.cjs +7239 -4037
  5. package/dist/automation/index.mjs +7239 -4037
  6. package/dist/chunk-3N6XMMTT.cjs +87913 -0
  7. package/dist/{chunk-TTPZITQN.mjs → chunk-5NVJN4E6.mjs} +30 -2
  8. package/dist/{chunk-ZAP5WLEN.mjs → chunk-A6P7G3UK.mjs} +1 -1
  9. package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
  10. package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
  11. package/dist/{chunk-GAGSCAR3.mjs → chunk-CCHYFCPD.mjs} +1199 -348
  12. package/dist/chunk-R6KSBNKX.mjs +44133 -0
  13. package/dist/chunk-S6DOCMQC.cjs +44451 -0
  14. package/dist/{chunk-Z7IQR4S4.mjs → chunk-WUE5ZHU3.mjs} +269 -21
  15. package/dist/chunk-ZE53K7DH.mjs +87907 -0
  16. package/dist/{chunk-NIHPA63A.mjs → chunk-ZOUGMAZG.mjs} +54 -37
  17. package/dist/docx/block-parser.d.ts.map +1 -1
  18. package/dist/docx/cell-blocks.d.ts +4 -0
  19. package/dist/docx/cell-blocks.d.ts.map +1 -0
  20. package/dist/docx/document-paragraphs.d.ts.map +1 -1
  21. package/dist/docx/document-parts.d.ts +2 -0
  22. package/dist/docx/document-parts.d.ts.map +1 -1
  23. package/dist/docx/embedded.cjs +189 -20
  24. package/dist/docx/embedded.mjs +189 -20
  25. package/dist/docx/index.cjs +219 -24
  26. package/dist/docx/index.mjs +219 -24
  27. package/dist/docx/layout/adapt-table.d.ts +2 -2
  28. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  29. package/dist/docx/layout/adapter.d.ts.map +1 -1
  30. package/dist/docx/layout/flow-paragraph.d.ts +5 -0
  31. package/dist/docx/layout/flow-paragraph.d.ts.map +1 -1
  32. package/dist/docx/layout/flow-table.d.ts +2 -1
  33. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  34. package/dist/docx/layout/footnote-columns.d.ts +22 -0
  35. package/dist/docx/layout/footnote-columns.d.ts.map +1 -0
  36. package/dist/docx/layout/footnote-flow.d.ts +27 -0
  37. package/dist/docx/layout/footnote-flow.d.ts.map +1 -0
  38. package/dist/docx/layout/footnote-split.d.ts +7 -0
  39. package/dist/docx/layout/footnote-split.d.ts.map +1 -0
  40. package/dist/docx/layout/index.cjs +1528 -119
  41. package/dist/docx/layout/index.mjs +1528 -120
  42. package/dist/docx/layout/input.d.ts +17 -1
  43. package/dist/docx/layout/input.d.ts.map +1 -1
  44. package/dist/docx/layout/legacy-footnote-flow.d.ts +18 -0
  45. package/dist/docx/layout/legacy-footnote-flow.d.ts.map +1 -0
  46. package/dist/docx/layout/line-metrics.d.ts.map +1 -1
  47. package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
  48. package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
  49. package/dist/docx/layout/page-cursor.d.ts +15 -8
  50. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  51. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  52. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  53. package/dist/docx/layout/paragraph-tokens.d.ts +2 -0
  54. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  55. package/dist/docx/layout/reference-footnotes.d.ts +7 -0
  56. package/dist/docx/layout/reference-footnotes.d.ts.map +1 -0
  57. package/dist/docx/layout/result.d.ts +44 -0
  58. package/dist/docx/layout/result.d.ts.map +1 -1
  59. package/dist/docx/layout/section-flow.d.ts +2 -0
  60. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  61. package/dist/docx/layout/table-border-layout.d.ts +16 -0
  62. package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
  63. package/dist/docx/layout/table-cell-layout.d.ts +12 -0
  64. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -0
  65. package/dist/docx/layout/table-content.d.ts +4 -0
  66. package/dist/docx/layout/table-content.d.ts.map +1 -0
  67. package/dist/docx/layout/table-footnotes.d.ts +32 -0
  68. package/dist/docx/layout/table-footnotes.d.ts.map +1 -0
  69. package/dist/docx/layout/table-frames.d.ts +4 -0
  70. package/dist/docx/layout/table-frames.d.ts.map +1 -0
  71. package/dist/docx/layout/table-layout.d.ts +16 -5
  72. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  73. package/dist/docx/layout/table-note-completion.d.ts +5 -0
  74. package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
  75. package/dist/docx/layout/table-note-stories.d.ts +6 -0
  76. package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
  77. package/dist/docx/load/index.cjs +194 -25
  78. package/dist/docx/load/index.mjs +194 -25
  79. package/dist/docx/model-run.d.ts +2 -0
  80. package/dist/docx/model-run.d.ts.map +1 -1
  81. package/dist/docx/model.d.ts +7 -0
  82. package/dist/docx/model.d.ts.map +1 -1
  83. package/dist/docx/notes.d.ts +5 -0
  84. package/dist/docx/notes.d.ts.map +1 -1
  85. package/dist/docx/parse-table.d.ts.map +1 -1
  86. package/dist/docx/parse.d.ts.map +1 -1
  87. package/dist/docx/save.d.ts.map +1 -1
  88. package/dist/docx/section-model.d.ts +2 -0
  89. package/dist/docx/section-model.d.ts.map +1 -1
  90. package/dist/docx/sections.d.ts.map +1 -1
  91. package/dist/docx/settings.d.ts +2 -0
  92. package/dist/docx/settings.d.ts.map +1 -1
  93. package/dist/docx/table-model.d.ts +3 -1
  94. package/dist/docx/table-model.d.ts.map +1 -1
  95. package/dist/docx/ui/index.cjs +55 -0
  96. package/dist/docx/ui/index.d.ts +1 -0
  97. package/dist/docx/ui/index.d.ts.map +1 -1
  98. package/dist/docx/ui/index.mjs +55 -1
  99. package/dist/docx/ui/table-structure-guard.d.ts +4 -0
  100. package/dist/docx/ui/table-structure-guard.d.ts.map +1 -0
  101. package/dist/docx/write-footnote-columns.d.ts +3 -0
  102. package/dist/docx/write-footnote-columns.d.ts.map +1 -0
  103. package/dist/docx/write-notes.d.ts.map +1 -1
  104. package/dist/docx/write-run.d.ts.map +1 -1
  105. package/dist/docx/write-sections.d.ts.map +1 -1
  106. package/dist/index.cjs +8 -5
  107. package/dist/index.mjs +8 -5
  108. package/dist/opc/clone-part-graph.d.ts +4 -0
  109. package/dist/opc/clone-part-graph.d.ts.map +1 -1
  110. package/dist/opc/index.cjs +8 -5
  111. package/dist/opc/index.mjs +8 -5
  112. package/dist/pptx/automation/index.cjs +1156 -389
  113. package/dist/pptx/automation/index.d.ts +4 -4
  114. package/dist/pptx/automation/index.mjs +5 -5
  115. package/dist/pptx/chunks/{index-CKIUurnd.d.ts → index-Cuxtr76Y.d.ts} +29 -10
  116. package/dist/pptx/chunks/index-Cuxtr76Y.d.ts.map +1 -0
  117. package/dist/pptx/chunks/{index-Cn-GzYGp.d.ts → index-DUCGeZh7.d.ts} +94 -5
  118. package/dist/pptx/chunks/index-DUCGeZh7.d.ts.map +1 -0
  119. package/dist/pptx/chunks/{smart-art-Q2kZQtHh.d.ts → smart-art-D-sXa_Nb.d.ts} +11 -1
  120. package/dist/pptx/chunks/smart-art-D-sXa_Nb.d.ts.map +1 -0
  121. package/dist/pptx/chunks/{text-operations-BHfAm5K9.d.ts → text-operations-BqHmLaLA.d.ts} +54 -13
  122. package/dist/pptx/chunks/text-operations-BqHmLaLA.d.ts.map +1 -0
  123. package/dist/pptx/cli/index.cjs +1157 -395
  124. package/dist/pptx/cli/index.d.ts +1 -1
  125. package/dist/pptx/cli/index.mjs +4 -4
  126. package/dist/pptx/converter/index.cjs +54 -36
  127. package/dist/pptx/converter/index.d.ts +1 -1
  128. package/dist/pptx/converter/index.mjs +2 -2
  129. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
  130. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
  131. package/dist/pptx/editor/render/find-replace.cjs +416 -45
  132. package/dist/pptx/editor/render/find-replace.d.ts +35 -4
  133. package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
  134. package/dist/pptx/editor/render/find-replace.mjs +416 -46
  135. package/dist/pptx/editor/render/remap-text.cjs +2 -2
  136. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  137. package/dist/pptx/editor/render/remap-text.mjs +1 -1
  138. package/dist/pptx/editor/render/slide-operations.cjs +87 -0
  139. package/dist/pptx/editor/render/slide-operations.d.ts +17 -1
  140. package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
  141. package/dist/pptx/editor/render/slide-operations.mjs +83 -1
  142. package/dist/pptx/editor/render/slide-search.cjs +6 -10
  143. package/dist/pptx/editor/render/slide-search.d.ts +1 -1
  144. package/dist/pptx/editor/render/slide-search.mjs +6 -10
  145. package/dist/pptx/editor/render/template-editing.d.ts +1 -1
  146. package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
  147. package/dist/pptx/index.cjs +1651 -419
  148. package/dist/pptx/index.d.ts +5 -5
  149. package/dist/pptx/index.mjs +5 -5
  150. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  151. package/dist/teams/index.cjs +965 -34
  152. package/dist/teams/index.mjs +965 -34
  153. package/dist/visio/accessibility.d.ts +10 -0
  154. package/dist/visio/accessibility.d.ts.map +1 -0
  155. package/dist/visio/cell-formula.d.ts +2 -0
  156. package/dist/visio/cell-formula.d.ts.map +1 -1
  157. package/dist/visio/connector-curve-aligned.d.ts +5 -0
  158. package/dist/visio/connector-curve-aligned.d.ts.map +1 -0
  159. package/dist/visio/connector-curve-spans.d.ts +14 -0
  160. package/dist/visio/connector-curve-spans.d.ts.map +1 -0
  161. package/dist/visio/connector-jumps.d.ts +5 -0
  162. package/dist/visio/connector-jumps.d.ts.map +1 -0
  163. package/dist/visio/connector-route-walk.d.ts +2 -1
  164. package/dist/visio/connector-route-walk.d.ts.map +1 -1
  165. package/dist/visio/date-cache.d.ts +3 -0
  166. package/dist/visio/date-cache.d.ts.map +1 -0
  167. package/dist/visio/edit-alt-text-scope.d.ts +5 -0
  168. package/dist/visio/edit-alt-text-scope.d.ts.map +1 -0
  169. package/dist/visio/edit-alt-text.d.ts +3 -0
  170. package/dist/visio/edit-alt-text.d.ts.map +1 -0
  171. package/dist/visio/edit-commands.d.ts +7 -2
  172. package/dist/visio/edit-commands.d.ts.map +1 -1
  173. package/dist/visio/edit-formatting-commands.d.ts +5 -0
  174. package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
  175. package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
  176. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  177. package/dist/visio/edit-line-jump-cache.d.ts +4 -0
  178. package/dist/visio/edit-line-jump-cache.d.ts.map +1 -0
  179. package/dist/visio/edit-master-index.d.ts.map +1 -1
  180. package/dist/visio/edit-metadata-commands.d.ts +10 -2
  181. package/dist/visio/edit-metadata-commands.d.ts.map +1 -1
  182. package/dist/visio/edit-metadata.d.ts +3 -1
  183. package/dist/visio/edit-metadata.d.ts.map +1 -1
  184. package/dist/visio/edit-page-alt-text.d.ts +4 -0
  185. package/dist/visio/edit-page-alt-text.d.ts.map +1 -0
  186. package/dist/visio/edit-page-layout.d.ts.map +1 -1
  187. package/dist/visio/edit-page-rename.d.ts.map +1 -1
  188. package/dist/visio/edit-page-setup-commands.d.ts +7 -1
  189. package/dist/visio/edit-page-setup-commands.d.ts.map +1 -1
  190. package/dist/visio/edit-page-size.d.ts.map +1 -1
  191. package/dist/visio/edit-pages.d.ts.map +1 -1
  192. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  193. package/dist/visio/edit-scope.d.ts.map +1 -1
  194. package/dist/visio/edit-shape-create.d.ts.map +1 -1
  195. package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
  196. package/dist/visio/edit-style-admission.d.ts.map +1 -1
  197. package/dist/visio/edit-text-field.d.ts.map +1 -1
  198. package/dist/visio/edit-text.d.ts.map +1 -1
  199. package/dist/visio/edit.d.ts +1 -1
  200. package/dist/visio/edit.d.ts.map +1 -1
  201. package/dist/visio/index.cjs +1215 -248
  202. package/dist/visio/index.d.ts +2 -1
  203. package/dist/visio/index.d.ts.map +1 -1
  204. package/dist/visio/index.mjs +1215 -249
  205. package/dist/visio/line-jumps.d.ts +1 -5
  206. package/dist/visio/line-jumps.d.ts.map +1 -1
  207. package/dist/visio/model.d.ts +13 -0
  208. package/dist/visio/model.d.ts.map +1 -1
  209. package/dist/visio/page-layout.d.ts +11 -2
  210. package/dist/visio/page-layout.d.ts.map +1 -1
  211. package/dist/visio/parser.d.ts.map +1 -1
  212. package/dist/visio/shape-metadata.d.ts +6 -0
  213. package/dist/visio/shape-metadata.d.ts.map +1 -1
  214. package/dist/visio/shapes.d.ts.map +1 -1
  215. package/dist/visio/text-field-case.d.ts +2 -0
  216. package/dist/visio/text-field-case.d.ts.map +1 -0
  217. package/dist/visio/text-field-display.d.ts.map +1 -1
  218. package/dist/visio/text-field-fraction.d.ts +3 -0
  219. package/dist/visio/text-field-fraction.d.ts.map +1 -0
  220. package/dist/visio/text-field-numeric.d.ts +4 -0
  221. package/dist/visio/text-field-numeric.d.ts.map +1 -0
  222. package/dist/visio/text-field-system-date.d.ts +4 -0
  223. package/dist/visio/text-field-system-date.d.ts.map +1 -0
  224. package/dist/visio/text-fields.d.ts +1 -0
  225. package/dist/visio/text-fields.d.ts.map +1 -1
  226. package/dist/visio/ui/connector-preview.d.ts +1 -1
  227. package/dist/visio/ui/connector-preview.d.ts.map +1 -1
  228. package/dist/visio/ui/data-graphic-rules.d.ts +2 -0
  229. package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
  230. package/dist/visio/ui/data-graphics.d.ts +3 -2
  231. package/dist/visio/ui/data-graphics.d.ts.map +1 -1
  232. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  233. package/dist/visio/ui/index.cjs +19310 -18157
  234. package/dist/visio/ui/index.mjs +19310 -18158
  235. package/dist/visio/ui/scene-details.d.ts.map +1 -1
  236. package/dist/visio/ui/scene-validation.d.ts.map +1 -1
  237. package/dist/visio/ui/snapshot-scene.d.ts +2 -1
  238. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  239. package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
  240. package/dist/visio/xml-attribute-whitespace.d.ts +5 -0
  241. package/dist/visio/xml-attribute-whitespace.d.ts.map +1 -0
  242. package/dist/xlsx/edit/index.d.ts +1 -0
  243. package/dist/xlsx/edit/index.d.ts.map +1 -1
  244. package/dist/xlsx/edit/insert-guard.d.ts.map +1 -1
  245. package/dist/xlsx/edit/merge.d.ts.map +1 -1
  246. package/dist/xlsx/edit/page-breaks.d.ts +5 -0
  247. package/dist/xlsx/edit/page-breaks.d.ts.map +1 -0
  248. package/dist/xlsx/edit/pivots.d.ts +8 -0
  249. package/dist/xlsx/edit/pivots.d.ts.map +1 -0
  250. package/dist/xlsx/edit/print-titles.d.ts +7 -0
  251. package/dist/xlsx/edit/print-titles.d.ts.map +1 -0
  252. package/dist/xlsx/edit/session.d.ts.map +1 -1
  253. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  254. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
  255. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
  256. package/dist/xlsx/edit/sparkline-ranges.d.ts +11 -0
  257. package/dist/xlsx/edit/sparkline-ranges.d.ts.map +1 -0
  258. package/dist/xlsx/edit/sparkline-xml.d.ts +13 -0
  259. package/dist/xlsx/edit/sparkline-xml.d.ts.map +1 -0
  260. package/dist/xlsx/edit/sparklines.d.ts +16 -0
  261. package/dist/xlsx/edit/sparklines.d.ts.map +1 -0
  262. package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
  263. package/dist/xlsx/edit/tables.d.ts.map +1 -1
  264. package/dist/xlsx/edit/types.d.ts +22 -1
  265. package/dist/xlsx/edit/types.d.ts.map +1 -1
  266. package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
  267. package/dist/xlsx/index.cjs +3638 -1199
  268. package/dist/xlsx/index.d.ts +1 -0
  269. package/dist/xlsx/index.d.ts.map +1 -1
  270. package/dist/xlsx/index.mjs +3619 -1200
  271. package/dist/xlsx/layout/cell-view.d.ts +2 -0
  272. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  273. package/dist/xlsx/layout/header-footer.d.ts +58 -0
  274. package/dist/xlsx/layout/header-footer.d.ts.map +1 -0
  275. package/dist/xlsx/layout/index.d.ts +5 -0
  276. package/dist/xlsx/layout/index.d.ts.map +1 -1
  277. package/dist/xlsx/layout/print-breaks.d.ts +11 -0
  278. package/dist/xlsx/layout/print-breaks.d.ts.map +1 -0
  279. package/dist/xlsx/layout/print-layout.d.ts +34 -0
  280. package/dist/xlsx/layout/print-layout.d.ts.map +1 -0
  281. package/dist/xlsx/layout/print-merges.d.ts +18 -0
  282. package/dist/xlsx/layout/print-merges.d.ts.map +1 -0
  283. package/dist/xlsx/layout/print-repeat.d.ts +12 -0
  284. package/dist/xlsx/layout/print-repeat.d.ts.map +1 -0
  285. package/dist/xlsx/layout/print-titles.d.ts +20 -0
  286. package/dist/xlsx/layout/print-titles.d.ts.map +1 -0
  287. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -1
  288. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -1
  289. package/dist/xlsx/load/index.cjs +8165 -6945
  290. package/dist/xlsx/load/index.mjs +8165 -6945
  291. package/dist/xlsx/model-pivots.d.ts +67 -0
  292. package/dist/xlsx/model-pivots.d.ts.map +1 -0
  293. package/dist/xlsx/model.d.ts +5 -0
  294. package/dist/xlsx/model.d.ts.map +1 -1
  295. package/dist/xlsx/pivot/admission.d.ts +5 -0
  296. package/dist/xlsx/pivot/admission.d.ts.map +1 -0
  297. package/dist/xlsx/pivot/aggregate.d.ts +21 -0
  298. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -0
  299. package/dist/xlsx/pivot/cache-xml.d.ts +9 -0
  300. package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -0
  301. package/dist/xlsx/pivot/data.d.ts +12 -0
  302. package/dist/xlsx/pivot/data.d.ts.map +1 -0
  303. package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
  304. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
  305. package/dist/xlsx/pivot/hierarchy.d.ts +5 -0
  306. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -0
  307. package/dist/xlsx/pivot/index.d.ts +3 -0
  308. package/dist/xlsx/pivot/index.d.ts.map +1 -0
  309. package/dist/xlsx/pivot/measures.d.ts +13 -0
  310. package/dist/xlsx/pivot/measures.d.ts.map +1 -0
  311. package/dist/xlsx/pivot/read.d.ts +5 -0
  312. package/dist/xlsx/pivot/read.d.ts.map +1 -0
  313. package/dist/xlsx/pivot/table-xml.d.ts +5 -0
  314. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -0
  315. package/dist/xlsx/pivot/values-axis.d.ts +9 -0
  316. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
  317. package/dist/xlsx/pivot/write.d.ts +11 -0
  318. package/dist/xlsx/pivot/write.d.ts.map +1 -0
  319. package/dist/xlsx/read/load.d.ts.map +1 -1
  320. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  321. package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
  322. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  323. package/dist/xlsx/ui/commands/i18n/pivots.d.ts +3 -0
  324. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -0
  325. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts +3 -0
  326. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -0
  327. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts +3 -0
  328. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts.map +1 -0
  329. package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
  330. package/dist/xlsx/ui/commands/page-breaks.d.ts +3 -0
  331. package/dist/xlsx/ui/commands/page-breaks.d.ts.map +1 -0
  332. package/dist/xlsx/ui/index.cjs +2421 -288
  333. package/dist/xlsx/ui/index.d.ts +1 -0
  334. package/dist/xlsx/ui/index.d.ts.map +1 -1
  335. package/dist/xlsx/ui/index.mjs +2421 -289
  336. package/dist/xlsx/write/page-setup.d.ts.map +1 -1
  337. package/dist/xlsx/write/save.d.ts.map +1 -1
  338. package/dist/xlsx/write/sheet-parts.d.ts +1 -0
  339. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  340. package/dist/xlsx/write/workbook-part.d.ts +1 -1
  341. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  342. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  343. package/package.json +1 -1
  344. package/dist/pptx/chunks/index-CKIUurnd.d.ts.map +0 -1
  345. package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
  346. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
  347. package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +0 -1
@@ -29,19 +29,19 @@ var isCellError = (value2) => typeof value2 === "object" && value2 !== null && "
29
29
  var MAX_ROW = 1048575;
30
30
  var MAX_COL = 16383;
31
31
  function columnLabel(col) {
32
- let label2 = "";
32
+ let label3 = "";
33
33
  let n = col + 1;
34
34
  while (n > 0) {
35
35
  const rem = (n - 1) % 26;
36
- label2 = String.fromCharCode(65 + rem) + label2;
36
+ label3 = String.fromCharCode(65 + rem) + label3;
37
37
  n = Math.floor((n - 1) / 26);
38
38
  }
39
- return label2;
39
+ return label3;
40
40
  }
41
- function columnIndex(label2) {
42
- if (!/^[A-Za-z]{1,3}$/.test(label2)) return -1;
41
+ function columnIndex(label3) {
42
+ if (!/^[A-Za-z]{1,3}$/.test(label3)) return -1;
43
43
  let n = 0;
44
- for (const ch of label2.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
44
+ for (const ch of label3.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
45
45
  return n - 1;
46
46
  }
47
47
  var formatAddress = (address2) => `${columnLabel(address2.col)}${address2.row + 1}`;
@@ -353,23 +353,23 @@ function compact(value2) {
353
353
  for (const [key, entry] of Object.entries(value2)) if (entry !== void 0) out[key] = entry;
354
354
  return out;
355
355
  }
356
- function patchStyle(base, patch) {
356
+ function patchStyle(base, patch2) {
357
357
  const next = {
358
- font: patch.font ? compact({ ...base.font, ...patch.font }) : base.font,
359
- fill: patch.fill ?? base.fill,
360
- border: patch.border ? compact({ ...base.border, ...patch.border }) : base.border,
361
- numFmt: patch.numFmt ?? base.numFmt
358
+ font: patch2.font ? compact({ ...base.font, ...patch2.font }) : base.font,
359
+ fill: patch2.fill ?? base.fill,
360
+ border: patch2.border ? compact({ ...base.border, ...patch2.border }) : base.border,
361
+ numFmt: patch2.numFmt ?? base.numFmt
362
362
  };
363
- const alignment = patch.alignment ? compact({ ...base.alignment, ...patch.alignment }) : base.alignment;
363
+ const alignment = patch2.alignment ? compact({ ...base.alignment, ...patch2.alignment }) : base.alignment;
364
364
  if (alignment && Object.keys(alignment).length) next.alignment = alignment;
365
- const protection = patch.protection ? compact({ ...base.protection, ...patch.protection }) : base.protection;
365
+ const protection = patch2.protection ? compact({ ...base.protection, ...patch2.protection }) : base.protection;
366
366
  if (protection && Object.keys(protection).length) next.protection = protection;
367
- const styleName = "cellStyleName" in patch ? patch.cellStyleName : base.cellStyleName;
367
+ const styleName = "cellStyleName" in patch2 ? patch2.cellStyleName : base.cellStyleName;
368
368
  if (styleName) next.cellStyleName = styleName;
369
369
  return next;
370
370
  }
371
- function applyStylePatch(workbook, styleId, patch) {
372
- return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch));
371
+ function applyStylePatch(workbook, styleId, patch2) {
372
+ return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch2));
373
373
  }
374
374
 
375
375
  // xlsx/cell-styles.ts
@@ -855,7 +855,7 @@ function compileFraction(tokens, slash) {
855
855
  while (isDigit(tokens[denEnd]) || tokens[denEnd]?.t === "num") denEnd++;
856
856
  const denTokens = tokens.slice(slash + 1, denEnd);
857
857
  const fixed2 = denTokens.some((t) => t.t === "num") && denTokens.every((t) => t.t === "num" || isDigit(t) && t.c === "0");
858
- const plan = {
858
+ const plan2 = {
859
859
  tokens: [],
860
860
  intDigits: [],
861
861
  numDigits: [],
@@ -863,31 +863,31 @@ function compileFraction(tokens, slash) {
863
863
  denWidth: denTokens.length
864
864
  };
865
865
  if (fixed2) {
866
- plan.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
866
+ plan2.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
867
867
  }
868
868
  tokens.forEach((tok, i2) => {
869
- if (i2 === slash) plan.tokens.push({ r: "slash" });
869
+ if (i2 === slash) plan2.tokens.push({ r: "slash" });
870
870
  else if (i2 > slash && i2 < denEnd) {
871
871
  if (fixed2) {
872
- if (i2 === slash + 1) plan.tokens.push({ r: "den", index: 0 });
872
+ if (i2 === slash + 1) plan2.tokens.push({ r: "den", index: 0 });
873
873
  } else if (isDigit(tok)) {
874
- plan.tokens.push({ r: "den", index: plan.denDigits.length });
875
- plan.denDigits.push(tok.c);
874
+ plan2.tokens.push({ r: "den", index: plan2.denDigits.length });
875
+ plan2.denDigits.push(tok.c);
876
876
  }
877
877
  } else if (isDigit(tok) && i2 >= numStart && i2 < slash) {
878
- plan.tokens.push({ r: "num", index: plan.numDigits.length });
879
- plan.numDigits.push(tok.c);
878
+ plan2.tokens.push({ r: "num", index: plan2.numDigits.length });
879
+ plan2.numDigits.push(tok.c);
880
880
  } else if (isDigit(tok) && i2 < numStart) {
881
- plan.tokens.push({ r: "int", index: plan.intDigits.length });
882
- plan.intDigits.push(tok.c);
883
- } else if (tok.t === "lit") plan.tokens.push({ r: "lit", v: tok.v });
884
- else if (tok.t === "num") plan.tokens.push({ r: "lit", v: tok.v });
885
- else if (tok.t === "digit") plan.tokens.push({ r: "lit", v: tok.c });
886
- else if (tok.t === "point") plan.tokens.push({ r: "lit", v: "." });
887
- else if (tok.t === "slash") plan.tokens.push({ r: "lit", v: "/" });
888
- else if (tok.t === "percent") plan.tokens.push({ r: "lit", v: "%" });
881
+ plan2.tokens.push({ r: "int", index: plan2.intDigits.length });
882
+ plan2.intDigits.push(tok.c);
883
+ } else if (tok.t === "lit") plan2.tokens.push({ r: "lit", v: tok.v });
884
+ else if (tok.t === "num") plan2.tokens.push({ r: "lit", v: tok.v });
885
+ else if (tok.t === "digit") plan2.tokens.push({ r: "lit", v: tok.c });
886
+ else if (tok.t === "point") plan2.tokens.push({ r: "lit", v: "." });
887
+ else if (tok.t === "slash") plan2.tokens.push({ r: "lit", v: "/" });
888
+ else if (tok.t === "percent") plan2.tokens.push({ r: "lit", v: "%" });
889
889
  });
890
- return plan;
890
+ return plan2;
891
891
  }
892
892
  function approximate(x, maxDen) {
893
893
  if (Number.isInteger(x)) return [x, 1];
@@ -922,29 +922,29 @@ function padRight(s, slots) {
922
922
  for (let i2 = s.length; i2 < slots.length; i2++) suffix += pad(slots[i2] ?? "#");
923
923
  return s + suffix;
924
924
  }
925
- function renderFraction(value2, plan) {
925
+ function renderFraction(value2, plan2) {
926
926
  const x = Math.abs(value2);
927
- const hasInt = plan.intDigits.length > 0;
927
+ const hasInt = plan2.intDigits.length > 0;
928
928
  let ip = hasInt ? Math.floor(x) : 0;
929
929
  const f6 = x - ip;
930
- const maxDen = 10 ** Math.max(1, plan.denDigits.length) - 1;
931
- let [n, d] = plan.fixedDenominator ? [Math.round(f6 * plan.fixedDenominator), plan.fixedDenominator] : approximate(f6, maxDen);
930
+ const maxDen = 10 ** Math.max(1, plan2.denDigits.length) - 1;
931
+ let [n, d] = plan2.fixedDenominator ? [Math.round(f6 * plan2.fixedDenominator), plan2.fixedDenominator] : approximate(f6, maxDen);
932
932
  if (hasInt && n >= d) {
933
933
  ip += 1;
934
934
  n = 0;
935
935
  }
936
936
  const zero = !hasInt && n === 0;
937
937
  const blank = hasInt && n === 0;
938
- const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan.intDigits) : "";
938
+ const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan2.intDigits) : "";
939
939
  const allHash = (slots) => slots.every((c) => c === "#");
940
- const numHash = allHash(plan.numDigits);
941
- const hideFraction = blank && numHash && (plan.fixedDenominator !== void 0 || allHash(plan.denDigits));
940
+ const numHash = allHash(plan2.numDigits);
941
+ const hideFraction = blank && numHash && (plan2.fixedDenominator !== void 0 || allHash(plan2.denDigits));
942
942
  const dropSeparator = hideFraction || hasInt && intText === "" && numHash;
943
- const lastInt = plan.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
944
- const firstNum = plan.tokens.findIndex((t) => t.r === "num");
943
+ const lastInt = plan2.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
944
+ const firstNum = plan2.tokens.findIndex((t) => t.r === "num");
945
945
  let text2 = "";
946
946
  let intDone = false;
947
- plan.tokens.forEach((tok, i2) => {
947
+ plan2.tokens.forEach((tok, i2) => {
948
948
  if (tok.r === "lit") {
949
949
  if (!(dropSeparator && i2 > lastInt && i2 < firstNum)) text2 += tok.v;
950
950
  } else if (tok.r === "int") {
@@ -953,12 +953,12 @@ function renderFraction(value2, plan) {
953
953
  } else if (hideFraction) ; else if (blank) {
954
954
  if (tok.r === "num") text2 += " ";
955
955
  else if (tok.r === "slash") text2 += " ";
956
- else text2 += " ".repeat(plan.fixedDenominator ? plan.denWidth : 1);
956
+ else text2 += " ".repeat(plan2.fixedDenominator ? plan2.denWidth : 1);
957
957
  } else if (tok.r === "num") {
958
- if (tok.index === 0) text2 += padLeft(String(n), plan.numDigits);
958
+ if (tok.index === 0) text2 += padLeft(String(n), plan2.numDigits);
959
959
  } else if (tok.r === "slash") text2 += "/";
960
- else if (plan.fixedDenominator) text2 += String(d);
961
- else if (tok.index === 0) text2 += padRight(String(d), plan.denDigits);
960
+ else if (plan2.fixedDenominator) text2 += String(d);
961
+ else if (tok.index === 0) text2 += padRight(String(d), plan2.denDigits);
962
962
  });
963
963
  return { text: text2, zero };
964
964
  }
@@ -1099,15 +1099,15 @@ function compileNumber(tokens) {
1099
1099
  out.splice(at < 0 ? 0 : at, 0, { r: "int", c: "#", index: 0 });
1100
1100
  intDigits.push("#");
1101
1101
  }
1102
- const plan = {
1102
+ const plan2 = {
1103
1103
  tokens: out,
1104
1104
  intDigits,
1105
1105
  fracDigits,
1106
1106
  grouping,
1107
1107
  shift: 2 * percent - 3 * scaleCommas
1108
1108
  };
1109
- if (exponent) plan.exponent = exponent;
1110
- return plan;
1109
+ if (exponent) plan2.exponent = exponent;
1110
+ return plan2;
1111
1111
  }
1112
1112
  var pad2 = (c) => c === "0" ? "0" : c === "?" ? " " : "";
1113
1113
  function placeIntegers(digits2, slots, grouping) {
@@ -1140,40 +1140,40 @@ function placeFraction(digits2, slots) {
1140
1140
  }
1141
1141
  return out;
1142
1142
  }
1143
- function scientific(v, plan) {
1143
+ function scientific(v, plan2) {
1144
1144
  if (isZero(v)) return { value: v, exp: 0 };
1145
- const n = plan.intDigits.length;
1146
- const engineering = n > 1 && plan.intDigits.some((c) => c !== "0");
1145
+ const n = plan2.intDigits.length;
1146
+ const engineering = n > 1 && plan2.intDigits.some((c) => c !== "0");
1147
1147
  const period = engineering ? n : 1;
1148
1148
  const e = v.point - 1;
1149
1149
  let exp2 = Math.floor(e / period) * period;
1150
- let m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1150
+ let m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1151
1151
  if (m.point > period) {
1152
1152
  exp2 += period;
1153
- m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1153
+ m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1154
1154
  }
1155
1155
  return { value: m, exp: exp2 };
1156
1156
  }
1157
- function renderNumber(value2, plan) {
1158
- const v = shift(toDigits(value2), plan.shift);
1157
+ function renderNumber(value2, plan2) {
1158
+ const v = shift(toDigits(value2), plan2.shift);
1159
1159
  let rounded;
1160
1160
  let exp2 = 0;
1161
- if (plan.exponent) {
1162
- const m = scientific(v, plan);
1161
+ if (plan2.exponent) {
1162
+ const m = scientific(v, plan2);
1163
1163
  rounded = m.value;
1164
1164
  exp2 = m.exp;
1165
- } else rounded = roundDecimals(v, plan.fracDigits.length);
1166
- const ints = plan.exponent && isZero(rounded) ? plan.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan.intDigits, plan.grouping);
1167
- const fracs = placeFraction(fractionPart(rounded, plan.fracDigits.length), plan.fracDigits);
1165
+ } else rounded = roundDecimals(v, plan2.fracDigits.length);
1166
+ const ints = plan2.exponent && isZero(rounded) ? plan2.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan2.intDigits, plan2.grouping);
1167
+ const fracs = placeFraction(fractionPart(rounded, plan2.fracDigits.length), plan2.fracDigits);
1168
1168
  let text2 = "";
1169
- for (const tok of plan.tokens) {
1169
+ for (const tok of plan2.tokens) {
1170
1170
  if (tok.r === "lit") text2 += tok.v;
1171
1171
  else if (tok.r === "int") text2 += ints[tok.index] ?? "";
1172
1172
  else if (tok.r === "frac") text2 += fracs[tok.index] ?? "";
1173
1173
  else if (tok.r === "point") text2 += ".";
1174
- else if (plan.exponent) {
1175
- const sign2 = exp2 < 0 ? "-" : plan.exponent.plus ? "+" : "";
1176
- text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan.exponent.digits, "0")}`;
1174
+ else if (plan2.exponent) {
1175
+ const sign2 = exp2 < 0 ? "-" : plan2.exponent.plus ? "+" : "";
1176
+ text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan2.exponent.digits, "0")}`;
1177
1177
  }
1178
1178
  }
1179
1179
  return { text: text2, zero: isZero(rounded) };
@@ -1866,9 +1866,9 @@ function parseFractionInput(text2) {
1866
1866
  const m = /^([-+]?)(\d+)\s+(\d+)\/(\d+)$/.exec(text2.trim());
1867
1867
  if (!m) return void 0;
1868
1868
  const den = Number(m[4]);
1869
- const num2 = Number(m[3]);
1870
- if (den === 0 || num2 >= den) return void 0;
1871
- const magnitude = Number(m[2]) + num2 / den;
1869
+ const num3 = Number(m[3]);
1870
+ if (den === 0 || num3 >= den) return void 0;
1871
+ const magnitude = Number(m[2]) + num3 / den;
1872
1872
  return {
1873
1873
  value: m[1] === "-" ? -magnitude : magnitude,
1874
1874
  numFmt: den < 10 ? "# ?/?" : "# ??/??"
@@ -11161,13 +11161,27 @@ var TEXT_REGEX_FUNCTIONS = [
11161
11161
  "REGEXEXTRACT",
11162
11162
  C35,
11163
11163
  "REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])",
11164
- "The first part of the text that matches the pattern.",
11164
+ "Extracts the first match (0), all matches (1), or the first match\u2019s capture groups (2).",
11165
11165
  2,
11166
11166
  4,
11167
11167
  (args) => {
11168
- if (optNum(args, 2, 0) !== 0) fail(ERR.VALUE);
11169
- const match2 = compile(str(args[1]), caseMode(args, 3), false).exec(str(args[0]));
11170
- return match2 ? match2[0] : fail(ERR.NA);
11168
+ const mode = optNum(args, 2, 0);
11169
+ if (mode !== 0 && mode !== 1 && mode !== 2) fail(ERR.VALUE);
11170
+ const regex = compile(str(args[1]), caseMode(args, 3), mode === 1);
11171
+ const text2 = str(args[0]);
11172
+ if (mode === 1) {
11173
+ const matches2 = [];
11174
+ for (const match3 of text2.matchAll(regex)) {
11175
+ checkArraySize(matches2.length + 1, 1);
11176
+ matches2.push(match3[0]);
11177
+ }
11178
+ return matches2.length ? new Matrix(matches2.map((match3) => [match3])) : fail(ERR.NA);
11179
+ }
11180
+ const match2 = regex.exec(text2);
11181
+ if (!match2) fail(ERR.NA);
11182
+ if (mode === 0) return match2[0];
11183
+ if (match2.length === 1) fail(ERR.VALUE);
11184
+ return new Matrix([match2.slice(1).map((group) => group ?? "")]);
11171
11185
  }
11172
11186
  ),
11173
11187
  spec(
@@ -11844,7 +11858,7 @@ function makeTemplate(formula, shape2) {
11844
11858
  }
11845
11859
  const { starts } = shape2;
11846
11860
  const slotted = starts.map(() => false);
11847
- const refs = /* @__PURE__ */ new Map();
11861
+ const refs2 = /* @__PURE__ */ new Map();
11848
11862
  let run = 0;
11849
11863
  for (const token of tokens) {
11850
11864
  const end = token.start + token.text.length;
@@ -11858,9 +11872,9 @@ function makeTemplate(formula, shape2) {
11858
11872
  const indexes2 = count2 === 1 ? [at] : [at, at + 1];
11859
11873
  if (indexes2.some((i2) => formula.charCodeAt(starts[i2]) === 48)) continue;
11860
11874
  for (const i2 of indexes2) slotted[i2] = true;
11861
- refs.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11875
+ refs2.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11862
11876
  }
11863
- return { formula, shape: shape2, ast, slotted, refs };
11877
+ return { formula, shape: shape2, ast, slotted, refs: refs2 };
11864
11878
  }
11865
11879
  function rowsFor(t, formula, shape2) {
11866
11880
  if (!sameShape(t.formula, t.shape, formula, shape2)) return void 0;
@@ -11884,11 +11898,11 @@ function rowsFor(t, formula, shape2) {
11884
11898
  return rows2;
11885
11899
  }
11886
11900
  function shiftSpec(spec2, slots, rows2) {
11887
- const startRow = rows2[slots.start];
11888
- const endRow = slots.end === void 0 ? startRow : rows2[slots.end];
11889
- if (startRow === spec2.start.row && endRow === spec2.end.row) return spec2;
11901
+ const startRow2 = rows2[slots.start];
11902
+ const endRow = slots.end === void 0 ? startRow2 : rows2[slots.end];
11903
+ if (startRow2 === spec2.start.row && endRow === spec2.end.row) return spec2;
11890
11904
  const { start: from, end: to } = spec2;
11891
- const start = { row: startRow, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11905
+ const start = { row: startRow2, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11892
11906
  if (slots.end === void 0) return { kind: spec2.kind, start, end: start };
11893
11907
  const end = { row: endRow, col: to.col, rowAbs: to.rowAbs, colAbs: to.colAbs };
11894
11908
  return { kind: spec2.kind, start, end };
@@ -13621,12 +13635,14 @@ function structuredToA1(formula, target2) {
13621
13635
 
13622
13636
  // xml/namespaces.ts
13623
13637
  var NS = {
13638
+ /** SpreadsheetML main. */
13639
+ x: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
13624
13640
  /** SpreadsheetML 2009 extensions (`x14:conditionalFormatting`, `x14:dataBar`). */
13625
13641
  x14: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"};
13626
13642
  function parseXml(xml, options = {}) {
13627
- const label2 = options.label ?? "OOXML";
13643
+ const label3 = options.label ?? "OOXML";
13628
13644
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
13629
- throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
13645
+ throw new Error(`${label3} XML with DTD or entity declarations is not supported`);
13630
13646
  let parseError = "";
13631
13647
  let parsed;
13632
13648
  try {
@@ -13637,12 +13653,12 @@ function parseXml(xml, options = {}) {
13637
13653
  }).parseFromString(xml, "application/xml");
13638
13654
  } catch (error) {
13639
13655
  throw new Error(
13640
- `Invalid ${label2} XML: ${error instanceof Error ? error.message : String(error)}`,
13656
+ `Invalid ${label3} XML: ${error instanceof Error ? error.message : String(error)}`,
13641
13657
  { cause: error }
13642
13658
  );
13643
13659
  }
13644
13660
  if (parseError || !parsed.documentElement)
13645
- throw new Error(`Invalid ${label2} XML: ${parseError || "missing root element"}`);
13661
+ throw new Error(`Invalid ${label3} XML: ${parseError || "missing root element"}`);
13646
13662
  return parsed;
13647
13663
  }
13648
13664
  var buildXml = (node) => new xmldom.XMLSerializer().serializeToString(node);
@@ -13718,6 +13734,649 @@ function descendants(root, local, ns) {
13718
13734
  return Array.from(root.getElementsByTagNameNS(ns, local));
13719
13735
  }
13720
13736
 
13737
+ // xlsx/edit/sparkline-ranges.ts
13738
+ function checkedSparklineRange(raw) {
13739
+ const range2 = normalizeRange(raw);
13740
+ for (const point of [range2.start, range2.end])
13741
+ if (!Number.isInteger(point.row) || !Number.isInteger(point.col) || point.row < 0 || point.col < 0 || point.row > MAX_ROW || point.col > MAX_COL)
13742
+ throw new RangeError("The reference is not valid.");
13743
+ return range2;
13744
+ }
13745
+ function sparklineDataRange(workbook, sheet, source) {
13746
+ let ast;
13747
+ try {
13748
+ ast = parseFormula(source.trim().replace(/^=/, ""));
13749
+ } catch {
13750
+ throw new Error("The reference is not valid.");
13751
+ }
13752
+ if (ast.type !== "ref" || !ast.ref || !["cell", "area"].includes(ast.ref.kind) || ast.prefix?.book || ast.prefix?.sheet2 || ast.spill)
13753
+ throw new Error("The reference is not valid.");
13754
+ const index2 = ast.prefix ? workbook.sheets.findIndex((ws) => ws.name.toLowerCase() === ast.prefix.sheet.toLowerCase()) : sheet;
13755
+ if (!workbook.sheets[index2]) throw new Error("The reference is not valid.");
13756
+ return { sheet: index2, range: checkedSparklineRange({ start: ast.ref.start, end: ast.ref.end }) };
13757
+ }
13758
+ function newSparklines(workbook, sheet, source, locations) {
13759
+ const data = sparklineDataRange(workbook, sheet, source);
13760
+ const dest = checkedSparklineRange(locations);
13761
+ const rows2 = dest.end.row - dest.start.row + 1;
13762
+ const cols = dest.end.col - dest.start.col + 1;
13763
+ const dr = data.range.end.row - data.range.start.row + 1;
13764
+ const dc = data.range.end.col - data.range.start.col + 1;
13765
+ if (rows2 > 1 && cols > 1 || rows2 === 1 && cols === 1 && dr > 1 && dc > 1 || rows2 > 1 && rows2 !== dr || cols > 1 && cols !== dc)
13766
+ throw new Error("The data range and location range do not match.");
13767
+ if (Math.max(rows2, cols) > 1e5) throw new Error("The sparkline location range is too large.");
13768
+ const prefix = `'${workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!`;
13769
+ const out = [];
13770
+ for (let i2 = 0; i2 < Math.max(rows2, cols); i2++) {
13771
+ const range2 = structuredClone(data.range);
13772
+ if (rows2 > 1) range2.start.row = range2.end.row = data.range.start.row + i2;
13773
+ if (cols > 1) range2.start.col = range2.end.col = data.range.start.col + i2;
13774
+ const host = {
13775
+ row: dest.start.row + (rows2 > 1 ? i2 : 0),
13776
+ col: dest.start.col + (cols > 1 ? i2 : 0)
13777
+ };
13778
+ out.push({ formula: prefix + formatRange(range2), host: { start: host, end: { ...host } } });
13779
+ }
13780
+ return out;
13781
+ }
13782
+
13783
+ // xlsx/pivot/data.ts
13784
+ var PIVOT_AGGREGATES = ["sum", "count", "average", "min", "max"];
13785
+ function pivotSourceData(workbook, sheet, source) {
13786
+ const data = sparklineDataRange(workbook, sheet, source);
13787
+ const ws = workbook.sheets[data.sheet];
13788
+ const { start, end } = data.range;
13789
+ if (end.row <= start.row || (end.row - start.row + 1) * (end.col - start.col + 1) > 1e6)
13790
+ throw new Error("A PivotTable source needs headers and data, with at most one million cells.");
13791
+ const fields = [];
13792
+ for (let col = start.col; col <= end.col; col++) {
13793
+ const value2 = getCell(ws, start.row, col)?.value;
13794
+ if (value2 === void 0 || value2 === null || isCellError(value2) || !String(value2).trim())
13795
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13796
+ fields.push(String(value2));
13797
+ }
13798
+ if (new Set(fields.map((name) => name.toLowerCase())).size !== fields.length)
13799
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13800
+ const records = [];
13801
+ for (let row2 = start.row + 1; row2 <= end.row; row2++) {
13802
+ const record = [];
13803
+ for (let col = start.col; col <= end.col; col++)
13804
+ record.push(getCell(ws, row2, col)?.value ?? null);
13805
+ records.push(record);
13806
+ }
13807
+ return { source: `${quoteSheetName(ws.name)}!${formatRange(data.range)}`, fields, records };
13808
+ }
13809
+ function pivotValueKey(value2) {
13810
+ return value2 === null || value2 === "" ? "blank" : isCellError(value2) ? `error:${value2.error}` : `${typeof value2}:${String(value2).toLowerCase()}`;
13811
+ }
13812
+ function pivotItems(pivot, field) {
13813
+ const index2 = pivot.fields.indexOf(field);
13814
+ const items = /* @__PURE__ */ new Map();
13815
+ for (const record of pivot.records) {
13816
+ const value2 = record[index2] ?? null;
13817
+ const key = pivotValueKey(value2);
13818
+ if (!items.has(key)) items.set(key, value2);
13819
+ }
13820
+ const rank3 = (value2) => value2 === null || value2 === "" ? 4 : isCellError(value2) ? 3 : typeof value2 === "boolean" ? 2 : typeof value2 === "string" ? 1 : 0;
13821
+ return [...items.values()].sort(
13822
+ (a, b) => rank3(a) - rank3(b) || (typeof a === "number" && typeof b === "number" ? a - b : String(pivotItemLabel(a)).localeCompare(String(pivotItemLabel(b)), "en", {
13823
+ sensitivity: "base",
13824
+ numeric: true
13825
+ }))
13826
+ );
13827
+ }
13828
+ function pivotItemLabel(value2) {
13829
+ if (value2 === null || value2 === "") return "(blank)";
13830
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
13831
+ return isCellError(value2) ? value2.error : value2;
13832
+ }
13833
+ function validatePivotFields(pivot) {
13834
+ const used = [
13835
+ pivot.rowField,
13836
+ ...pivot.secondRowField ? [pivot.secondRowField] : [],
13837
+ ...pivot.columnField ? [pivot.columnField] : [],
13838
+ pivot.valueField
13839
+ ];
13840
+ const extras = pivot.additionalValues ?? [];
13841
+ if (pivot.valuesAxis !== void 0 && !["columns", "rows"].includes(pivot.valuesAxis))
13842
+ throw new Error("Choose a valid Values axis.");
13843
+ if (pivot.valuesPosition !== void 0 && !["last", "between", "first"].includes(pivot.valuesPosition))
13844
+ throw new Error("Choose a valid Values position.");
13845
+ if ((pivot.valuesPosition === "between" || pivot.valuesPosition === "first") && (pivot.valuesAxis !== "rows" || !pivot.secondRowField))
13846
+ throw new Error("Values before or between fields require two row fields and Values on rows.");
13847
+ if (pivot.valuesAxis === "rows" && (!Array.isArray(extras) || !extras.length))
13848
+ throw new Error("Values on rows require multiple measures.");
13849
+ if (extras.length > 0 && pivot.sourceXml && parseXml(pivot.sourceXml).documentElement.getAttribute("dataCaption") !== "Values")
13850
+ throw new Error("This PivotTable uses unsupported Values header captions.");
13851
+ if (!Array.isArray(extras) || extras.length > 15 || extras.some(
13852
+ (measure2) => !measure2 || !pivot.fields.includes(measure2.field) || !PIVOT_AGGREGATES.includes(measure2.aggregate) || typeof measure2.caption !== "string" || !measure2.caption.trim() || measure2.caption.length > 255 || pivot.fields.some((field) => field.toLowerCase() === measure2.caption.toLowerCase())
13853
+ ) || new Set(
13854
+ [pivot.valueCaption, ...extras.map((measure2) => measure2.caption)].map(
13855
+ (caption) => caption?.toLowerCase()
13856
+ )
13857
+ ).size !== extras.length + 1)
13858
+ throw new Error("Choose PivotTable value fields with valid aggregates and unique captions.");
13859
+ if (pivot.layout !== void 0 && !["tabular", "compact", "outline"].includes(pivot.layout) || pivot.subtotalPosition !== void 0 && !["top", "bottom"].includes(pivot.subtotalPosition) || !PIVOT_AGGREGATES.includes(pivot.aggregate) || used.some((field) => !pivot.fields.includes(field)) || new Set([pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean)).size !== [pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean).length || pivot.subtotals !== void 0 && typeof pivot.subtotals !== "boolean" || pivot.repeatLabels !== void 0 && typeof pivot.repeatLabels !== "boolean")
13860
+ throw new Error("Choose valid PivotTable fields; row and column fields must differ.");
13861
+ }
13862
+ function pivotCaption(aggregate3, field) {
13863
+ return `${aggregate3[0].toUpperCase()}${aggregate3.slice(1)} of ${field}`;
13864
+ }
13865
+
13866
+ // xlsx/pivot/measures.ts
13867
+ var pivotMeasures = (pivot) => [
13868
+ { field: pivot.valueField, aggregate: pivot.aggregate, caption: pivot.valueCaption },
13869
+ ...pivot.additionalValues ?? []
13870
+ ];
13871
+ function normalizedPivotMeasures(values2) {
13872
+ if (!Array.isArray(values2) || values2.length > 15)
13873
+ throw new Error("Choose between one and sixteen PivotTable value fields.");
13874
+ return values2.map((value2) => {
13875
+ if (!value2 || typeof value2.field !== "string")
13876
+ throw new Error("Choose valid PivotTable value fields.");
13877
+ const aggregate3 = value2.aggregate ?? "sum";
13878
+ if (!PIVOT_AGGREGATES.includes(aggregate3))
13879
+ throw new Error("Choose a valid PivotTable aggregate.");
13880
+ return {
13881
+ field: value2.field,
13882
+ aggregate: aggregate3,
13883
+ caption: value2.caption ?? `${aggregate3[0].toUpperCase()}${aggregate3.slice(1)} of ${value2.field}`
13884
+ };
13885
+ });
13886
+ }
13887
+ function aggregate2(records, field, type) {
13888
+ if (!records.length) return null;
13889
+ const values2 = records.map((record) => record[field] ?? null);
13890
+ if (type === "count") return values2.filter((value2) => value2 !== null && value2 !== "").length;
13891
+ const error = values2.find(isCellError);
13892
+ if (error) return error;
13893
+ const numbers3 = values2.filter((value2) => typeof value2 === "number");
13894
+ if (!numbers3.length) return type === "average" ? { error: "#DIV/0!" } : 0;
13895
+ if (type === "min") return numbers3.reduce((a, b) => Math.min(a, b));
13896
+ if (type === "max") return numbers3.reduce((a, b) => Math.max(a, b));
13897
+ const sum2 = numbers3.reduce((total2, value2) => total2 + value2, 0);
13898
+ return type === "average" ? sum2 / numbers3.length : sum2;
13899
+ }
13900
+ var pivotMeasureNumber = (pivot, records, measure2) => aggregate2(records, pivot.fields.indexOf(measure2.field), measure2.aggregate);
13901
+ var pivotNumbers = (pivot, records) => pivotMeasures(pivot).map((measure2) => pivotMeasureNumber(pivot, records, measure2));
13902
+ function pivotHeaderDimensions(pivot, columnItems, rowLabels) {
13903
+ const measures = 1 + (pivot.additionalValues?.length ?? 0);
13904
+ if (pivot.valuesAxis === "rows")
13905
+ return {
13906
+ rows: pivot.columnField ? 2 : 1,
13907
+ width: rowLabels + (pivot.columnField ? columnItems + 1 : 1)
13908
+ };
13909
+ return {
13910
+ rows: pivot.columnField ? measures > 1 ? 3 : 2 : 1,
13911
+ width: rowLabels + (pivot.columnField ? measures === 1 ? Math.max(1, columnItems) + 1 : (columnItems + 1) * measures : measures)
13912
+ };
13913
+ }
13914
+ function pivotHeaders(pivot, columns, labels, label3) {
13915
+ const measures = pivotMeasures(pivot);
13916
+ if (pivot.valuesAxis === "rows") {
13917
+ const rowLabels = pivot.layout === "compact" ? ["Row Labels"] : pivot.valuesPosition === "first" ? ["Values", ...labels] : pivot.valuesPosition === "between" ? [labels[0], "Values", labels[1]] : [...labels, "Values"];
13918
+ return pivot.columnField ? [
13919
+ [
13920
+ ...rowLabels.map(() => null),
13921
+ pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
13922
+ ...columns.map(() => null)
13923
+ ],
13924
+ [...rowLabels, ...columns.map(label3), "Grand Total"]
13925
+ ] : [[...rowLabels, null]];
13926
+ }
13927
+ if (!pivot.columnField) return [[...labels, ...measures.map((measure2) => measure2.caption)]];
13928
+ if (measures.length === 1)
13929
+ return [
13930
+ [
13931
+ pivot.valueCaption,
13932
+ ...labels.slice(1).map(() => null),
13933
+ pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
13934
+ ...columns.slice(1).map(() => null),
13935
+ null
13936
+ ],
13937
+ [...labels, ...columns.map(label3), "Grand Total"]
13938
+ ];
13939
+ const { width } = pivotHeaderDimensions(pivot, columns.length, labels.length);
13940
+ const first2 = Array(width).fill(null);
13941
+ first2[labels.length] = pivot.layout === "compact" ? "Column Labels" : pivot.columnField;
13942
+ if (pivot.layout !== "compact") first2[labels.length + 1] = "Values";
13943
+ return [
13944
+ first2,
13945
+ [
13946
+ ...labels.map(() => null),
13947
+ ...columns.flatMap((column) => [label3(column), ...measures.slice(1).map(() => null)]),
13948
+ ...measures.map((measure2) => `Total ${measure2.caption}`)
13949
+ ],
13950
+ [
13951
+ ...labels,
13952
+ ...columns.flatMap(() => measures.map((measure2) => measure2.caption)),
13953
+ ...measures.map(() => null)
13954
+ ]
13955
+ ];
13956
+ }
13957
+
13958
+ // xlsx/pivot/hierarchy-first.ts
13959
+ function appendFirstPivotValues(pivot, context) {
13960
+ const {
13961
+ rowItems,
13962
+ secondRowItems,
13963
+ columnItems,
13964
+ children: children2,
13965
+ innerIndices,
13966
+ groups,
13967
+ details,
13968
+ buckets,
13969
+ width,
13970
+ rowLabels,
13971
+ top,
13972
+ bottom,
13973
+ append
13974
+ } = context;
13975
+ const compact3 = pivot.layout === "compact";
13976
+ const tabular = !pivot.layout || pivot.layout === "tabular";
13977
+ const blank = () => Array(width - rowLabels).fill(null);
13978
+ pivotMeasures(pivot).forEach((measure2, m) => {
13979
+ const numbers3 = (keys, records) => [
13980
+ ...columnItems.map(
13981
+ (column) => pivotMeasureNumber(
13982
+ pivot,
13983
+ buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [],
13984
+ measure2
13985
+ )
13986
+ ),
13987
+ pivotMeasureNumber(pivot, records, measure2)
13988
+ ];
13989
+ if (!tabular)
13990
+ append([measure2.caption, ...Array(rowLabels - 1).fill(null)], blank(), {
13991
+ indices: [m],
13992
+ measure: m
13993
+ });
13994
+ let first2 = true;
13995
+ rowItems.forEach((outer, outerIndex) => {
13996
+ const key = pivotValueKey(outer);
13997
+ const group = groups.get(key) ?? [];
13998
+ if (!tabular)
13999
+ append(
14000
+ compact3 ? [pivotItemLabel(outer)] : [null, pivotItemLabel(outer), null],
14001
+ top ? numbers3([key], group) : blank(),
14002
+ { indices: [m, outerIndex], measure: m },
14003
+ compact3 ? 1 : 0
14004
+ );
14005
+ const innerKeys = [...children2.get(key)].sort(
14006
+ (a, b) => innerIndices.get(a) - innerIndices.get(b)
14007
+ );
14008
+ innerKeys.forEach((innerKey, child) => {
14009
+ const innerIndex = innerIndices.get(innerKey);
14010
+ append(
14011
+ compact3 ? [pivotItemLabel(secondRowItems[innerIndex])] : [
14012
+ tabular && first2 ? measure2.caption : null,
14013
+ pivot.repeatLabels || tabular && child === 0 ? pivotItemLabel(outer) : null,
14014
+ pivotItemLabel(secondRowItems[innerIndex])
14015
+ ],
14016
+ numbers3([key, innerKey], details.get(JSON.stringify([key, innerKey]))),
14017
+ { indices: [m, outerIndex, innerIndex], measure: m },
14018
+ compact3 ? 2 : 0
14019
+ );
14020
+ first2 = false;
14021
+ });
14022
+ if (bottom)
14023
+ append(
14024
+ compact3 ? [`${String(pivotItemLabel(outer))} Total`] : [null, `${String(pivotItemLabel(outer))} Total`, null],
14025
+ numbers3([key], group),
14026
+ { indices: [m, outerIndex], measure: m, type: "default" },
14027
+ compact3 ? 1 : 0
14028
+ );
14029
+ });
14030
+ });
14031
+ }
14032
+
14033
+ // xlsx/pivot/hierarchy.ts
14034
+ var label2 = pivotItemLabel;
14035
+ function hierarchicalPivotGrid(pivot) {
14036
+ const rowItems = pivotItems(pivot, pivot.rowField);
14037
+ const secondRowItems = pivotItems(pivot, pivot.secondRowField);
14038
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
14039
+ const outerField = pivot.fields.indexOf(pivot.rowField);
14040
+ const innerField = pivot.fields.indexOf(pivot.secondRowField);
14041
+ const columnField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
14042
+ const layout2 = pivot.layout ?? "tabular";
14043
+ const compact3 = layout2 === "compact";
14044
+ const rowsAxis = pivot.valuesAxis === "rows";
14045
+ const firstValues = rowsAxis && pivot.valuesPosition === "first";
14046
+ const between = rowsAxis && pivot.valuesPosition === "between";
14047
+ const measures = pivotMeasures(pivot);
14048
+ const top = (!rowsAxis || firstValues) && layout2 !== "tabular" && pivot.subtotals !== false && (pivot.subtotalPosition ?? "top") === "top";
14049
+ const bottom = pivot.subtotals !== false && !top;
14050
+ const rowLabelColumns = compact3 ? 1 : rowsAxis ? 3 : 2;
14051
+ const groups = /* @__PURE__ */ new Map();
14052
+ const details = /* @__PURE__ */ new Map();
14053
+ const children2 = /* @__PURE__ */ new Map();
14054
+ const innerIndices = new Map(secondRowItems.map((item, index2) => [pivotValueKey(item), index2]));
14055
+ const buckets = /* @__PURE__ */ new Map();
14056
+ const collect = (map, key, record) => {
14057
+ const list = map.get(key);
14058
+ if (list) list.push(record);
14059
+ else map.set(key, [record]);
14060
+ };
14061
+ for (const record of pivot.records) {
14062
+ const outer = pivotValueKey(record[outerField] ?? null);
14063
+ const inner2 = pivotValueKey(record[innerField] ?? null);
14064
+ collect(groups, outer, record);
14065
+ collect(details, JSON.stringify([outer, inner2]), record);
14066
+ if (!children2.has(outer)) children2.set(outer, /* @__PURE__ */ new Set());
14067
+ children2.get(outer).add(inner2);
14068
+ if (pivot.columnField) {
14069
+ const column = pivotValueKey(record[columnField] ?? null);
14070
+ for (const key of [[], [outer], [outer, inner2]])
14071
+ collect(buckets, JSON.stringify([...key, column]), record);
14072
+ }
14073
+ }
14074
+ const dimensions = pivotHeaderDimensions(pivot, columnItems.length, rowLabelColumns);
14075
+ const rows2 = (details.size + rowItems.length * Number(bottom) + 1) * (rowsAxis ? measures.length : 1) + rowItems.length * Number(layout2 !== "tabular") * (firstValues ? measures.length : 1) + (firstValues ? measures.length : between ? rowItems.length * measures.length : details.size) * Number(rowsAxis && layout2 !== "tabular") + dimensions.rows;
14076
+ if (rows2 * dimensions.width > 1e6) throw new Error("The PivotTable result is too large.");
14077
+ const labels = compact3 ? ["Row Labels"] : [pivot.rowField, pivot.secondRowField];
14078
+ const values2 = pivotHeaders(pivot, columnItems, labels, label2);
14079
+ const firstDataRow = values2.length;
14080
+ const indents = values2.map(() => 0);
14081
+ const rowEntries = [];
14082
+ const append = (labels2, numbers4, entry, indent = 0) => {
14083
+ values2.push([...labels2, ...numbers4]);
14084
+ rowEntries.push(entry);
14085
+ indents.push(indent);
14086
+ };
14087
+ const bands = (keys, records) => [
14088
+ ...columnItems.map(
14089
+ (column) => pivotNumbers(pivot, buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [])
14090
+ ),
14091
+ pivotNumbers(pivot, records)
14092
+ ];
14093
+ const numbers3 = (keys, records) => bands(keys, records).flat();
14094
+ const appendMeasures = (labels2, keys, records, indices, type) => {
14095
+ const values3 = bands(keys, records);
14096
+ measures.forEach(
14097
+ (measure2, m) => append(
14098
+ type ? [
14099
+ `${type === "grand" ? "Total" : String(labels2[0])} ${measure2.caption}`,
14100
+ ...Array(rowLabelColumns - 1).fill(null)
14101
+ ] : compact3 ? [measure2.caption] : [
14102
+ ...labels2.map(
14103
+ (label3) => layout2 === "tabular" && m === 0 || pivot.repeatLabels ? label3 : null
14104
+ ),
14105
+ measure2.caption
14106
+ ],
14107
+ values3.map((band) => band[m] ?? null),
14108
+ { indices: type ? indices : [...indices, m], measure: m, ...type ? { type } : {} },
14109
+ compact3 && !type ? 2 : 0
14110
+ )
14111
+ );
14112
+ };
14113
+ if (firstValues)
14114
+ appendFirstPivotValues(pivot, {
14115
+ rowItems,
14116
+ secondRowItems,
14117
+ columnItems,
14118
+ children: children2,
14119
+ innerIndices,
14120
+ groups,
14121
+ details,
14122
+ buckets,
14123
+ width: dimensions.width,
14124
+ rowLabels: rowLabelColumns,
14125
+ top,
14126
+ bottom,
14127
+ append
14128
+ });
14129
+ else
14130
+ rowItems.forEach((outer, outerIndex) => {
14131
+ const key = pivotValueKey(outer);
14132
+ if (layout2 !== "tabular")
14133
+ append(
14134
+ [label2(outer), ...Array(rowLabelColumns - 1).fill(null)],
14135
+ top ? numbers3([key], groups.get(key) ?? []) : Array(dimensions.width - rowLabelColumns).fill(null),
14136
+ { indices: [outerIndex] }
14137
+ );
14138
+ let first2 = true;
14139
+ const innerKeys = [...children2.get(key)].sort(
14140
+ (a, b) => innerIndices.get(a) - innerIndices.get(b)
14141
+ );
14142
+ if (between)
14143
+ measures.forEach((measure2, m) => {
14144
+ if (layout2 !== "tabular")
14145
+ append(
14146
+ compact3 ? [measure2.caption] : [pivot.repeatLabels ? label2(outer) : null, measure2.caption, null],
14147
+ Array(dimensions.width - rowLabelColumns).fill(null),
14148
+ { indices: [outerIndex, m], measure: m },
14149
+ compact3 ? 1 : 0
14150
+ );
14151
+ innerKeys.forEach((innerKey, child) => {
14152
+ const innerIndex = innerIndices.get(innerKey);
14153
+ const keys = [key, innerKey];
14154
+ const records = details.get(JSON.stringify(keys));
14155
+ append(
14156
+ compact3 ? [label2(secondRowItems[innerIndex])] : [
14157
+ pivot.repeatLabels || layout2 === "tabular" && m === 0 && child === 0 ? label2(outer) : null,
14158
+ layout2 === "tabular" && child === 0 ? measure2.caption : null,
14159
+ label2(secondRowItems[innerIndex])
14160
+ ],
14161
+ [
14162
+ ...columnItems.map(
14163
+ (column) => pivotMeasureNumber(
14164
+ pivot,
14165
+ buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [],
14166
+ measure2
14167
+ )
14168
+ ),
14169
+ pivotMeasureNumber(pivot, records, measure2)
14170
+ ],
14171
+ { indices: [outerIndex, m, innerIndex], measure: m },
14172
+ compact3 ? 2 : 0
14173
+ );
14174
+ });
14175
+ });
14176
+ else
14177
+ innerKeys.forEach((innerKey) => {
14178
+ const innerIndex = innerIndices.get(innerKey);
14179
+ const inner2 = secondRowItems[innerIndex];
14180
+ const keys = [key, innerKey];
14181
+ const records = details.get(JSON.stringify(keys));
14182
+ if (!records) return;
14183
+ if (rowsAxis) {
14184
+ if (layout2 !== "tabular")
14185
+ append(
14186
+ compact3 ? [label2(inner2)] : [pivot.repeatLabels ? label2(outer) : null, label2(inner2), null],
14187
+ Array(dimensions.width - rowLabelColumns).fill(null),
14188
+ { indices: [outerIndex, innerIndex] },
14189
+ compact3 ? 1 : 0
14190
+ );
14191
+ appendMeasures(
14192
+ [pivot.repeatLabels || first2 ? label2(outer) : null, label2(inner2)],
14193
+ keys,
14194
+ records,
14195
+ [outerIndex, innerIndex]
14196
+ );
14197
+ first2 = false;
14198
+ return;
14199
+ }
14200
+ append(
14201
+ compact3 ? [label2(inner2)] : [
14202
+ pivot.repeatLabels || layout2 === "tabular" && first2 ? label2(outer) : null,
14203
+ label2(inner2)
14204
+ ],
14205
+ numbers3(keys, records),
14206
+ { indices: [outerIndex, innerIndex] },
14207
+ compact3 ? 1 : 0
14208
+ );
14209
+ first2 = false;
14210
+ });
14211
+ if (bottom) {
14212
+ if (rowsAxis) {
14213
+ appendMeasures([label2(outer)], [key], groups.get(key) ?? [], [outerIndex], "default");
14214
+ return;
14215
+ }
14216
+ const caption = String(label2(outer));
14217
+ append(
14218
+ [`${caption} Total`, ...compact3 ? [] : [null]],
14219
+ numbers3([key], groups.get(key) ?? []),
14220
+ { indices: [outerIndex], type: "default" }
14221
+ );
14222
+ }
14223
+ });
14224
+ if (rowsAxis) appendMeasures([], [], pivot.records, [0], "grand");
14225
+ else
14226
+ append(["Grand Total", ...compact3 ? [] : [null]], numbers3([], pivot.records), {
14227
+ indices: [0],
14228
+ type: "grand"
14229
+ });
14230
+ return {
14231
+ values: values2,
14232
+ rowItems,
14233
+ secondRowItems,
14234
+ columnItems,
14235
+ rowEntries,
14236
+ firstDataRow,
14237
+ rowLabelColumns,
14238
+ indents,
14239
+ ...rowsAxis ? { firstHeaderRow: 1 } : {}
14240
+ };
14241
+ }
14242
+
14243
+ // xlsx/pivot/aggregate.ts
14244
+ function pivotGrid(pivot) {
14245
+ validatePivotFields(pivot);
14246
+ if (pivot.secondRowField) return hierarchicalPivotGrid(pivot);
14247
+ const rowItems = pivotItems(pivot, pivot.rowField);
14248
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
14249
+ const rowsAxis = pivot.valuesAxis === "rows";
14250
+ const compact3 = pivot.layout === "compact";
14251
+ const headings = rowsAxis && pivot.layout !== void 0 && pivot.layout !== "tabular";
14252
+ const dimensions = pivotHeaderDimensions(pivot, columnItems.length, rowsAxis && !compact3 ? 2 : 1);
14253
+ const dataRows = (rowItems.length + 1) * (rowsAxis ? 1 + (pivot.additionalValues?.length ?? 0) : 1) + (headings ? rowItems.length : 0);
14254
+ if ((dataRows + dimensions.rows) * dimensions.width > 1e6)
14255
+ throw new Error("The PivotTable result is too large.");
14256
+ const label3 = pivotItemLabel;
14257
+ const values2 = pivotHeaders(
14258
+ pivot,
14259
+ columnItems,
14260
+ [pivot.layout === "compact" ? "Row Labels" : pivot.rowField],
14261
+ label3
14262
+ );
14263
+ const rowField = pivot.fields.indexOf(pivot.rowField);
14264
+ const colField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
14265
+ const groups = /* @__PURE__ */ new Map();
14266
+ const cells = /* @__PURE__ */ new Map();
14267
+ const columns = /* @__PURE__ */ new Map();
14268
+ const collect = (map, key, record) => {
14269
+ const found = map.get(key);
14270
+ if (found) found.push(record);
14271
+ else map.set(key, [record]);
14272
+ };
14273
+ for (const record of pivot.records) {
14274
+ const key = pivotValueKey(record[rowField] ?? null);
14275
+ collect(groups, key, record);
14276
+ if (pivot.columnField) {
14277
+ const col = pivotValueKey(record[colField] ?? null);
14278
+ collect(columns, col, record);
14279
+ collect(cells, JSON.stringify([key, col]), record);
14280
+ }
14281
+ }
14282
+ const firstDataRow = values2.length;
14283
+ if (rowsAxis) {
14284
+ const measures = pivotMeasures(pivot);
14285
+ const rowEntries = [];
14286
+ const indents = values2.map(() => 0);
14287
+ const append = (caption, bands, index2, grand = false) => {
14288
+ measures.forEach((measure2, m) => {
14289
+ values2.push([
14290
+ ...compact3 ? [grand ? `Total ${measure2.caption}` : measure2.caption] : [
14291
+ grand ? `Total ${measure2.caption}` : pivot.repeatLabels || !headings && m === 0 ? caption : null,
14292
+ grand ? null : measure2.caption
14293
+ ],
14294
+ ...bands.map((band) => band[m] ?? null)
14295
+ ]);
14296
+ indents.push(compact3 && !grand ? 1 : 0);
14297
+ rowEntries.push({
14298
+ indices: grand ? [0] : [index2, m],
14299
+ measure: m,
14300
+ ...grand ? { type: "grand" } : {}
14301
+ });
14302
+ });
14303
+ };
14304
+ rowItems.forEach((item, index2) => {
14305
+ const key = pivotValueKey(item);
14306
+ if (headings) {
14307
+ values2.push([label3(item), ...Array(dimensions.width - 1).fill(null)]);
14308
+ rowEntries.push({ indices: [index2] });
14309
+ indents.push(0);
14310
+ }
14311
+ append(
14312
+ label3(item),
14313
+ [
14314
+ ...columnItems.map(
14315
+ (col) => pivotNumbers(pivot, cells.get(JSON.stringify([key, pivotValueKey(col)])) ?? [])
14316
+ ),
14317
+ pivotNumbers(pivot, groups.get(key) ?? [])
14318
+ ],
14319
+ index2
14320
+ );
14321
+ });
14322
+ append(
14323
+ "Grand Total",
14324
+ [
14325
+ ...columnItems.map((col) => pivotNumbers(pivot, columns.get(pivotValueKey(col)) ?? [])),
14326
+ pivotNumbers(pivot, pivot.records)
14327
+ ],
14328
+ 0,
14329
+ true
14330
+ );
14331
+ return {
14332
+ values: values2,
14333
+ rowItems,
14334
+ columnItems,
14335
+ firstDataRow,
14336
+ rowLabelColumns: compact3 ? 1 : 2,
14337
+ indents,
14338
+ firstHeaderRow: 1,
14339
+ rowEntries
14340
+ };
14341
+ }
14342
+ for (const row2 of rowItems) {
14343
+ const records = groups.get(pivotValueKey(row2)) ?? [];
14344
+ values2.push([
14345
+ label3(row2),
14346
+ ...columnItems.flatMap(
14347
+ (col) => pivotNumbers(
14348
+ pivot,
14349
+ cells.get(JSON.stringify([pivotValueKey(row2), pivotValueKey(col)])) ?? []
14350
+ )
14351
+ ),
14352
+ ...pivotNumbers(pivot, records)
14353
+ ]);
14354
+ }
14355
+ values2.push([
14356
+ "Grand Total",
14357
+ ...columnItems.flatMap((col) => pivotNumbers(pivot, columns.get(pivotValueKey(col)) ?? [])),
14358
+ ...pivotNumbers(pivot, pivot.records)
14359
+ ]);
14360
+ return { values: values2, rowItems, columnItems, firstDataRow };
14361
+ }
14362
+
14363
+ // xlsx/write/xml-out.ts
14364
+ var CONTROL2 = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
14365
+ var INVALID_XML = new RegExp(`[${CONTROL2}]`, "g");
14366
+ var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
14367
+ var escapeAttr = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
14368
+ function attrs(values2) {
14369
+ let out = "";
14370
+ for (const [name, value2] of Object.entries(values2)) {
14371
+ if (value2 === void 0) continue;
14372
+ const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
14373
+ out += ` ${name}="${escapeAttr(text2)}"`;
14374
+ }
14375
+ return out;
14376
+ }
14377
+ var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
14378
+ var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
14379
+
13721
14380
  // xlsx/read/style-parts.ts
13722
14381
  function parseColor(element2, palette) {
13723
14382
  if (!element2) return void 0;
@@ -14333,6 +14992,17 @@ function shiftFormulaInBand(formula, formulaSheet, sheet, shift2, band) {
14333
14992
  return changed ? tokens.map((t) => t.text).join("") : formula;
14334
14993
  }
14335
14994
 
14995
+ // xlsx/write/style-xml.ts
14996
+ var argb = (rgb2) => (rgb2.length === 6 ? `FF${rgb2}` : rgb2).toUpperCase();
14997
+ function colorXml(color, name = "color") {
14998
+ if (!color) return "";
14999
+ if (color.rgb) return el(name, { rgb: argb(color.rgb), tint: color.tint });
15000
+ if (color.theme !== void 0) return el(name, { theme: color.theme, tint: color.tint });
15001
+ if (color.indexed !== void 0) return el(name, { indexed: color.indexed, tint: color.tint });
15002
+ if (color.auto) return el(name, { auto: true });
15003
+ return "";
15004
+ }
15005
+
14336
15006
  // xlsx/layout/sparkline-view.ts
14337
15007
  var DEFAULTS = {
14338
15008
  colorSeries: "#376092",
@@ -14380,6 +15050,7 @@ function positions(group, data, n) {
14380
15050
  return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
14381
15051
  }
14382
15052
  }
15053
+ if (group.dateAxis) return Array.from({ length: n }, () => null);
14383
15054
  return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
14384
15055
  }
14385
15056
  function pointFacts(values2) {
@@ -14446,7 +15117,8 @@ function sparklineView(group, data, scale2, theme2) {
14446
15117
  });
14447
15118
  if (segment.length) view.lines.push(segment);
14448
15119
  } else {
14449
- const slot = 1 / n;
15120
+ const dates = group.dateAxis && data.dates ? extent(data.dates) : void 0;
15121
+ const slot = dates ? 1 / Math.max(1, dates.max - dates.min + 1) : 1 / n;
14450
15122
  const w = slot * (1 - COLUMN_GAP);
14451
15123
  const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
14452
15124
  values2.forEach((v, i2) => {
@@ -14525,11 +15197,25 @@ function readSparklineValues(sheet, range2, displayHidden) {
14525
15197
  function groupData(workbook, sheet, group) {
14526
15198
  const dateRange = group.dateAxis && group.dateFormula;
14527
15199
  const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
14528
- const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, group.displayHidden) : void 0;
15200
+ const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, true) : void 0;
14529
15201
  return group.sparklines.map((line2) => {
14530
15202
  const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
15203
+ if (group.dateAxis) {
15204
+ if (!source || !dates || !dateValues) return { values: [], dates: [] };
15205
+ const raw = readSparklineValues(source.sheet, source.range, true);
15206
+ if (raw.length !== dateValues.length) return { values: [], dates: [] };
15207
+ const hidden = (ref, i2) => {
15208
+ const columns = ref.range.end.col - ref.range.start.col + 1;
15209
+ return rowHidden(ref.sheet, ref.range.start.row + Math.floor(i2 / columns)) || colHidden(ref.sheet, ref.range.start.col + i2 % columns);
15210
+ };
15211
+ const pairs = dateValues.flatMap(
15212
+ (date, i2) => date === null || !group.displayHidden && (hidden(source, i2) || hidden(dates, i2)) ? [] : [{ date, value: raw[i2] }]
15213
+ );
15214
+ pairs.sort((a, b) => a.date - b.date);
15215
+ return { values: pairs.map((pair) => pair.value), dates: pairs.map((pair) => pair.date) };
15216
+ }
14531
15217
  const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
14532
- return dateValues ? { values: values2, dates: dateValues } : { values: values2 };
15218
+ return { values: values2 };
14533
15219
  });
14534
15220
  }
14535
15221
  function sparklineViewAt(workbook, sheetIndex2, row2, col) {
@@ -14795,6 +15481,13 @@ function rewriteFormulas(workbook, rewrite, formulaCells) {
14795
15481
  }
14796
15482
  function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
14797
15483
  rewritePreservedFormulas(sheet, rewrite);
15484
+ for (const pivot of sheet.pivotTables ?? []) {
15485
+ const next = safe(rewrite, pivot.source, sheet.name);
15486
+ if (next !== pivot.source) {
15487
+ pivot.source = next;
15488
+ pivot.dirty = true;
15489
+ }
15490
+ }
14798
15491
  {
14799
15492
  const name = sheet.name;
14800
15493
  for (const table2 of sheet.tables)
@@ -15147,20 +15840,20 @@ function addRowIntersections(sheet, r, patcher) {
15147
15840
  }
15148
15841
 
15149
15842
  // xlsx/edit/format.ts
15150
- function stylePatcher(workbook, patch) {
15843
+ function stylePatcher(workbook, patch2) {
15151
15844
  const memo = /* @__PURE__ */ new Map();
15152
15845
  return (id) => {
15153
15846
  const key = id ?? 0;
15154
15847
  let next = memo.get(key);
15155
15848
  if (next === void 0) {
15156
- next = applyStylePatch(workbook, id, patch);
15849
+ next = applyStylePatch(workbook, id, patch2);
15157
15850
  memo.set(key, next);
15158
15851
  }
15159
15852
  return next;
15160
15853
  };
15161
15854
  }
15162
- function patchRange(workbook, sheet, range2, patch) {
15163
- patchRangeWith(sheet, range2, stylePatcher(workbook, patch));
15855
+ function patchRange(workbook, sheet, range2, patch2) {
15856
+ patchRangeWith(sheet, range2, stylePatcher(workbook, patch2));
15164
15857
  }
15165
15858
  function patchRangeWith(sheet, range2, patcher) {
15166
15859
  const r = normalizeRange(range2);
@@ -15205,11 +15898,11 @@ function formatScopes(index2, ranges) {
15205
15898
  const whole = ranges.some((r) => isWholeColumns(r) || isWholeRows(r));
15206
15899
  return whole ? [cells, { kind: "parts", sheet: index2, parts: ["columns", "rowInfo"] }] : [cells];
15207
15900
  }
15208
- function applyStyle(ctx, s, ranges, patch) {
15901
+ function applyStyle(ctx, s, ranges, patch2) {
15209
15902
  const sheet = sheetAt(ctx.workbook, s);
15210
15903
  const normalized = ranges.map(normalizeRange);
15211
15904
  if (!normalized.length) return;
15212
- const patcher = stylePatcher(ctx.workbook, patch);
15905
+ const patcher = stylePatcher(ctx.workbook, patch2);
15213
15906
  ctx.run(
15214
15907
  "Format cells",
15215
15908
  "format",
@@ -15260,13 +15953,13 @@ function linearTrend(values2) {
15260
15953
  const n = values2.length;
15261
15954
  const meanX = (n - 1) / 2;
15262
15955
  const meanY = values2.reduce((a, b) => a + b, 0) / n;
15263
- let num2 = 0;
15956
+ let num3 = 0;
15264
15957
  let den = 0;
15265
15958
  values2.forEach((y, x) => {
15266
- num2 += (x - meanX) * (y - meanY);
15959
+ num3 += (x - meanX) * (y - meanY);
15267
15960
  den += (x - meanX) ** 2;
15268
15961
  });
15269
- const slope = den ? num2 / den : 0;
15962
+ const slope = den ? num3 / den : 0;
15270
15963
  return (k) => Number((meanY + slope * (k - meanX)).toPrecision(15));
15271
15964
  }
15272
15965
  var isDigit5 = (ch) => ch !== void 0 && ch >= "0" && ch <= "9";
@@ -15869,6 +16562,17 @@ function setBorders(ctx, s, range2, preset, edge = { style: "thin" }) {
15869
16562
 
15870
16563
  // xlsx/edit/insert-guard.ts
15871
16564
  function assertInsertFits(sheet, shift2, band) {
16565
+ for (const pivot of sheet.pivotTables ?? []) {
16566
+ const start = pivot.location.start[shift2.axis];
16567
+ const end = pivot.location.end[shift2.axis];
16568
+ const other2 = shift2.axis === "row" ? "col" : "row";
16569
+ if (band && (band.hi < pivot.location.start[other2] || band.lo > pivot.location.end[other2]))
16570
+ continue;
16571
+ const partial = band && (band.lo > pivot.location.start[other2] || band.hi < pivot.location.end[other2]);
16572
+ const overlap = shift2.count > 0 ? shift2.at > start && shift2.at <= end : shift2.at <= end && shift2.at - shift2.count > start;
16573
+ if (overlap || partial && shift2.at <= end)
16574
+ throw new Error("Cannot move or remove part of a PivotTable. Delete the PivotTable first.");
16575
+ }
15872
16576
  if (shift2.count <= 0) return;
15873
16577
  const max = shift2.axis === "row" ? MAX_ROW : MAX_COL;
15874
16578
  if (shift2.at + shift2.count > max + 1)
@@ -15936,6 +16640,13 @@ function shiftSheetContent(sheet, shift2, band) {
15936
16640
  return range2 ? [{ ...c, address: range2.start }] : [];
15937
16641
  });
15938
16642
  sheet.tables = sheet.tables.flatMap((t) => shiftTable(sheet, t, shift2, moveRange));
16643
+ for (const pivot of sheet.pivotTables ?? []) {
16644
+ const location = moveRange(pivot.location);
16645
+ if (location) {
16646
+ pivot.location = location;
16647
+ pivot.dirty = true;
16648
+ }
16649
+ }
15939
16650
  for (const drawing of sheet.drawings) shiftAnchor(drawing.anchor, shift2, band);
15940
16651
  if (!band) shiftAxisFormats(sheet, shift2);
15941
16652
  if (sheet.autoFilter) {
@@ -16178,13 +16889,13 @@ function htmlHref(link) {
16178
16889
  const href = link?.target ? `${link.target}${link.location ? `#${link.location}` : ""}` : link?.location ? `#${link.location}` : void 0;
16179
16890
  return href && (href.startsWith("#") || hyperlinkPolicy(href).store) ? href : void 0;
16180
16891
  }
16181
- function hyperlinkFromHtmlAttributes(attrs, range2) {
16182
- const href = attrs?.get("href");
16892
+ function hyperlinkFromHtmlAttributes(attrs2, range2) {
16893
+ const href = attrs2?.get("href");
16183
16894
  if (!href || !href.startsWith("#") && !hyperlinkPolicy(href).store) return void 0;
16184
16895
  const link = { range: range2 };
16185
16896
  if (href.startsWith("#")) link.location = href.slice(1);
16186
16897
  else link.target = href;
16187
- const tooltip = attrs?.get("title");
16898
+ const tooltip = attrs2?.get("title");
16188
16899
  if (tooltip) link.tooltip = tooltip;
16189
16900
  return link;
16190
16901
  }
@@ -16281,21 +16992,21 @@ function toHtml(cells, theme2) {
16281
16992
  for (let c = 0; c < cells.cols; c++) {
16282
16993
  if (covered.has(`${r},${c}`)) continue;
16283
16994
  const cell = cells.data[r]?.[c] ?? null;
16284
- const attrs = [];
16995
+ const attrs2 = [];
16285
16996
  const span4 = spans2.get(`${r},${c}`);
16286
16997
  if (span4 && span4.end.row > span4.start.row)
16287
- attrs.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16998
+ attrs2.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16288
16999
  if (span4 && span4.end.col > span4.start.col)
16289
- attrs.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16290
- if (cell && typeof cell.value === "number") attrs.push(`x:num="${cell.value}"`);
17000
+ attrs2.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
17001
+ if (cell && typeof cell.value === "number") attrs2.push(`x:num="${cell.value}"`);
16291
17002
  const css = cssFor(cell?.style, theme2);
16292
- if (css) attrs.push(`style="${escapeHtml(css)}"`);
17003
+ if (css) attrs2.push(`style="${escapeHtml(css)}"`);
16293
17004
  let text2 = escapeHtml(cell?.text ?? "").replace(/\n/g, "<br>");
16294
17005
  const link = links.get(`${r},${c}`);
16295
17006
  const href = htmlHref(link);
16296
17007
  if (href)
16297
17008
  text2 = `<a href="${escapeHtml(href)}"${link?.tooltip ? ` title="${escapeHtml(link.tooltip)}"` : ""}>${text2}</a>`;
16298
- tds.push(`<td${attrs.length ? ` ${attrs.join(" ")}` : ""}>${text2}</td>`);
17009
+ tds.push(`<td${attrs2.length ? ` ${attrs2.join(" ")}` : ""}>${text2}</td>`);
16299
17010
  }
16300
17011
  rows2.push(`<tr>${tds.join("")}</tr>`);
16301
17012
  }
@@ -16355,12 +17066,12 @@ function decodeEntities(text2) {
16355
17066
  });
16356
17067
  }
16357
17068
  function parseAttributes(text2) {
16358
- const attrs = /* @__PURE__ */ new Map();
17069
+ const attrs2 = /* @__PURE__ */ new Map();
16359
17070
  for (const m of text2.matchAll(
16360
17071
  /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
16361
17072
  ))
16362
- attrs.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16363
- return attrs;
17073
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
17074
+ return attrs2;
16364
17075
  }
16365
17076
  function parseCss(text2) {
16366
17077
  const out = /* @__PURE__ */ new Map();
@@ -16386,7 +17097,7 @@ var V_ALIGN = {
16386
17097
  bottom: "bottom"
16387
17098
  };
16388
17099
  function stylePatchFromCss(css, inner2) {
16389
- const patch = {};
17100
+ const patch2 = {};
16390
17101
  const font = {};
16391
17102
  const weight = css.get("font-weight");
16392
17103
  if (weight && (weight === "bold" || Number(weight) >= 600) || /<(b|strong)\b/i.test(inner2))
@@ -16402,16 +17113,16 @@ function stylePatchFromCss(css, inner2) {
16402
17113
  if (size) font.size = Number(size[1]) * (size[2] === "px" ? 0.75 : 1);
16403
17114
  const family = css.get("font-family")?.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
16404
17115
  if (family) font.name = family;
16405
- if (Object.keys(font).length) patch.font = font;
17116
+ if (Object.keys(font).length) patch2.font = font;
16406
17117
  const background = css.get("background-color") ?? css.get("background");
16407
17118
  const fill = background && parseCssColor(background.split(/\s+/)[0] ?? "");
16408
- if (fill) patch.fill = { type: "pattern", pattern: "solid", fgColor: fill };
17119
+ if (fill) patch2.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16409
17120
  const h2 = H_ALIGN[css.get("text-align") ?? ""];
16410
17121
  const v = V_ALIGN[css.get("vertical-align") ?? ""];
16411
- if (h2 || v) patch.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
17122
+ if (h2 || v) patch2.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16412
17123
  const numFmt = css.get("mso-number-format");
16413
- if (numFmt) patch.numFmt = decodeNumberFormat(numFmt);
16414
- return patch;
17124
+ if (numFmt) patch2.numFmt = decodeNumberFormat(numFmt);
17125
+ return patch2;
16415
17126
  }
16416
17127
  function removeComments(text2) {
16417
17128
  let out = "";
@@ -16486,18 +17197,18 @@ function parseHtmlTable(html, base) {
16486
17197
  /<t([dh])\b([^>]*)>([\s\S]*?)(?:<\/t[dh]>|(?=<t[dh]\b)|$)/gi
16487
17198
  )) {
16488
17199
  while (taken.has(`${r},${c}`)) c++;
16489
- const attrs = parseAttributes(td[2] ?? "");
17200
+ const attrs2 = parseAttributes(td[2] ?? "");
16490
17201
  const inner2 = td[3] ?? "";
16491
17202
  const css = /* @__PURE__ */ new Map();
16492
- for (const name of (attrs.get("class") ?? "").split(/\s+/))
17203
+ for (const name of (attrs2.get("class") ?? "").split(/\s+/))
16493
17204
  for (const [k, v] of parseCss(classes.get(name) ?? "")) css.set(k, v);
16494
- for (const [k, v] of parseCss(attrs.get("style") ?? "")) css.set(k, v);
16495
- const patch = stylePatchFromCss(css, inner2);
16496
- if (td[1]?.toLowerCase() === "h") patch.font = { bold: true, ...patch.font };
17205
+ for (const [k, v] of parseCss(attrs2.get("style") ?? "")) css.set(k, v);
17206
+ const patch2 = stylePatchFromCss(css, inner2);
17207
+ if (td[1]?.toLowerCase() === "h") patch2.font = { bold: true, ...patch2.font };
16497
17208
  const text2 = cellText(inner2);
16498
- row2[c] = text2 === "" && !Object.keys(patch).length ? null : toCell(text2, attrs, patch, base);
16499
- const rowSpan = Math.max(1, Number(attrs.get("rowspan") ?? 1) || 1);
16500
- const colSpan = Math.max(1, Number(attrs.get("colspan") ?? 1) || 1);
17209
+ row2[c] = text2 === "" && !Object.keys(patch2).length ? null : toCell(text2, attrs2, patch2, base);
17210
+ const rowSpan = Math.max(1, Number(attrs2.get("rowspan") ?? 1) || 1);
17211
+ const colSpan = Math.max(1, Number(attrs2.get("colspan") ?? 1) || 1);
16501
17212
  const anchor = /<a\b([^>]*)>/i.exec(inner2);
16502
17213
  const linkAttrs = anchor ? parseAttributes(anchor[1] ?? "") : void 0;
16503
17214
  const link = hyperlinkFromHtmlAttributes(linkAttrs, {
@@ -16527,17 +17238,17 @@ function parseHtmlTable(html, base) {
16527
17238
  );
16528
17239
  return rows2 && cols ? { rows: rows2, cols, data, merges, hyperlinks } : void 0;
16529
17240
  }
16530
- function toCell(text2, attrs, patch, base) {
17241
+ function toCell(text2, attrs2, patch2, base) {
16531
17242
  let value2 = text2;
16532
- const num2 = attrs.get("x:num");
16533
- if (num2 !== void 0 && num2 !== "" && Number.isFinite(Number(num2))) value2 = Number(num2);
16534
- else if (attrs.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16535
- else if (patch.numFmt !== "@" && text2 !== "") {
17243
+ const num3 = attrs2.get("x:num");
17244
+ if (num3 !== void 0 && num3 !== "" && Number.isFinite(Number(num3))) value2 = Number(num3);
17245
+ else if (attrs2.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
17246
+ else if (patch2.numFmt !== "@" && text2 !== "") {
16536
17247
  const parsed = parseCellInput(text2);
16537
17248
  if (parsed.formula === void 0) value2 = parsed.value;
16538
- if (!patch.numFmt && parsed.numFmt && typeof value2 === "number") patch.numFmt = parsed.numFmt;
17249
+ if (!patch2.numFmt && parsed.numFmt && typeof value2 === "number") patch2.numFmt = parsed.numFmt;
16539
17250
  }
16540
- return { value: value2, text: text2, style: patchStyle(base, patch) };
17251
+ return { value: value2, text: text2, style: patchStyle(base, patch2) };
16541
17252
  }
16542
17253
 
16543
17254
  // xlsx/edit/clipboard-text.ts
@@ -18084,10 +18795,10 @@ var SessionCalculator = class {
18084
18795
 
18085
18796
  // xlsx/edit/doc-properties.ts
18086
18797
  var same2 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
18087
- function setDocumentProperties(ctx, patch) {
18798
+ function setDocumentProperties(ctx, patch2) {
18088
18799
  const prior = ctx.workbook.properties;
18089
18800
  const next = { ...prior };
18090
- for (const [key, value2] of Object.entries(patch)) {
18801
+ for (const [key, value2] of Object.entries(patch2)) {
18091
18802
  if (value2 === void 0) continue;
18092
18803
  if (value2 === null) delete next[key];
18093
18804
  else next[key] = structuredClone(value2);
@@ -18140,6 +18851,460 @@ function deleteDrawing(ctx, s, index2) {
18140
18851
  );
18141
18852
  }
18142
18853
 
18854
+ // xlsx/edit/sparkline-xml.ts
18855
+ var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
18856
+ var URI = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
18857
+ var COLORS2 = [
18858
+ "colorSeries",
18859
+ "colorNegative",
18860
+ "colorAxis",
18861
+ "colorMarkers",
18862
+ "colorFirst",
18863
+ "colorLast",
18864
+ "colorHigh",
18865
+ "colorLow"
18866
+ ];
18867
+ var SCALARS = [
18868
+ "type",
18869
+ "lineWeight",
18870
+ "markers",
18871
+ "high",
18872
+ "low",
18873
+ "first",
18874
+ "last",
18875
+ "negative",
18876
+ "displayEmptyCellsAs",
18877
+ "displayXAxis",
18878
+ "displayHidden",
18879
+ "rightToLeft",
18880
+ "minAxisType",
18881
+ "maxAxisType",
18882
+ "manualMin",
18883
+ "manualMax"
18884
+ ];
18885
+ function cleanSparklinePatch(patch2) {
18886
+ return Object.fromEntries(
18887
+ [...SCALARS, ...COLORS2].flatMap((key) => patch2[key] === void 0 ? [] : [[key, patch2[key]]])
18888
+ );
18889
+ }
18890
+ function patchSparklineNode(node, patch2) {
18891
+ for (const key of SCALARS) {
18892
+ const value2 = patch2[key];
18893
+ if (value2 === void 0) continue;
18894
+ node.setAttribute(key, typeof value2 === "boolean" ? value2 ? "1" : "0" : String(value2));
18895
+ }
18896
+ if (patch2.minAxisType && patch2.minAxisType !== "custom") node.removeAttribute("manualMin");
18897
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom") node.removeAttribute("manualMax");
18898
+ for (const key of COLORS2) {
18899
+ const color = patch2[key];
18900
+ if (!color) continue;
18901
+ const fresh = parseXml(
18902
+ `<x14:root xmlns:x14="${NS.x14}">${colorXml(color, `x14:${key}`)}</x14:root>`
18903
+ ).documentElement.firstChild;
18904
+ const replacement = node.ownerDocument.importNode(fresh, true);
18905
+ const old = first(node, key, NS.x14);
18906
+ if (old) node.replaceChild(replacement, old);
18907
+ else {
18908
+ const before = elements(node).find((child) => {
18909
+ const index2 = COLORS2.indexOf(child.localName);
18910
+ return index2 > COLORS2.indexOf(key) || child.localName === "f" || child.localName === "sparklines";
18911
+ });
18912
+ node.insertBefore(replacement, before ?? null);
18913
+ }
18914
+ }
18915
+ }
18916
+ function editSparklineXml(sheet, edit) {
18917
+ return (sheet.preserved.get("extLst") ?? []).map((xml) => {
18918
+ if (!xml.includes("sparklineGroup")) return xml;
18919
+ const doc = parseXml(xml);
18920
+ let changed = false;
18921
+ for (const node of Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup"))) {
18922
+ if (!edit(node, readSparklineGroup(node))) continue;
18923
+ changed = true;
18924
+ const lines = first(node, "sparklines", NS.x14);
18925
+ if (!lines || !children(lines, "sparkline", NS.x14).length) {
18926
+ const groups = node.parentNode;
18927
+ groups.removeChild(node);
18928
+ if (!children(groups, "sparklineGroup", NS.x14).length)
18929
+ groups.parentNode.removeChild(groups);
18930
+ }
18931
+ }
18932
+ return changed ? buildXml(doc.documentElement) : xml;
18933
+ });
18934
+ }
18935
+ function appendSparklineXml(sheet, groupXml) {
18936
+ const source = [...sheet.preserved.get("extLst") ?? []];
18937
+ const found = source.findIndex((xml) => xml.includes("sparklineGroups"));
18938
+ const index2 = found >= 0 ? found : 0;
18939
+ const doc = parseXml(source[index2] ?? `<extLst xmlns="${NS.x}"/>`);
18940
+ const root = doc.documentElement;
18941
+ let ext = children(root, "ext", NS.x).find(
18942
+ (node) => node.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
18943
+ );
18944
+ if (!ext) {
18945
+ ext = doc.createElementNS(NS.x, "ext");
18946
+ ext.setAttribute("uri", URI);
18947
+ ext.setAttribute("xmlns:x14", NS.x14);
18948
+ root.appendChild(ext);
18949
+ }
18950
+ ext.setAttribute("uri", URI);
18951
+ let groups = first(ext, "sparklineGroups", NS.x14);
18952
+ if (!groups) {
18953
+ groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
18954
+ groups.setAttribute("xmlns:xm", XM4);
18955
+ ext.appendChild(groups);
18956
+ }
18957
+ const fresh = doc.importNode(parseXml(groupXml).documentElement, true);
18958
+ const revision = "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2";
18959
+ if (Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup")).some(
18960
+ (node) => node.hasAttributeNS(revision, "uid")
18961
+ )) {
18962
+ fresh.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xr2", revision);
18963
+ fresh.setAttributeNS(revision, "xr2:uid", `{${globalThis.crypto.randomUUID().toUpperCase()}}`);
18964
+ }
18965
+ groups.appendChild(fresh);
18966
+ source[index2] = buildXml(root);
18967
+ return source;
18968
+ }
18969
+
18970
+ // xlsx/edit/sparklines.ts
18971
+ function selectedSparklineGroups(sheet, ranges) {
18972
+ return sheetSparklineGroups(sheet).filter(
18973
+ (group) => group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host)))
18974
+ );
18975
+ }
18976
+ function validateSettings(group) {
18977
+ for (const key of [
18978
+ "markers",
18979
+ "high",
18980
+ "low",
18981
+ "first",
18982
+ "last",
18983
+ "negative",
18984
+ "displayXAxis",
18985
+ "displayHidden",
18986
+ "rightToLeft"
18987
+ ])
18988
+ if (typeof group[key] !== "boolean") throw new Error("The sparkline settings are not valid.");
18989
+ if (!["line", "column", "stacked"].includes(group.type) || !["gap", "zero", "span"].includes(group.displayEmptyCellsAs) || !["individual", "group", "custom"].includes(group.minAxisType) || !["individual", "group", "custom"].includes(group.maxAxisType))
18990
+ throw new Error("The sparkline settings are not valid.");
18991
+ if (!Number.isFinite(group.lineWeight) || group.lineWeight < 0 || group.lineWeight > 1584)
18992
+ throw new Error("The sparkline settings are not valid.");
18993
+ if (group.minAxisType === "custom" && !Number.isFinite(group.manualMin) || group.maxAxisType === "custom" && !Number.isFinite(group.manualMax) || group.minAxisType === "custom" && group.maxAxisType === "custom" && group.manualMin > group.manualMax)
18994
+ throw new Error("The sparkline axis limits are not valid.");
18995
+ if (group.manualMin !== void 0 && group.minAxisType !== "custom" || group.manualMax !== void 0 && group.maxAxisType !== "custom")
18996
+ throw new Error("The sparkline axis limits are not valid.");
18997
+ for (const key of [
18998
+ "colorSeries",
18999
+ "colorNegative",
19000
+ "colorAxis",
19001
+ "colorMarkers",
19002
+ "colorFirst",
19003
+ "colorLast",
19004
+ "colorHigh",
19005
+ "colorLow"
19006
+ ]) {
19007
+ const color = group[key];
19008
+ if (color !== void 0 && (color === null || typeof color !== "object" || Array.isArray(color) || ![color.rgb, color.theme, color.indexed].some((value2) => value2 !== void 0)))
19009
+ throw new Error("The sparkline settings are not valid.");
19010
+ if (color && (color.auto || color.rgb !== void 0 && !/^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(color.rgb) || color.theme !== void 0 && (!Number.isInteger(color.theme) || color.theme < 0 || color.theme > 11) || color.indexed !== void 0 && (!Number.isInteger(color.indexed) || color.indexed < 0 || color.indexed > 65) || color.tint !== void 0 && (!Number.isFinite(color.tint) || color.tint < -1 || color.tint > 1)))
19011
+ throw new Error("The sparkline settings are not valid.");
19012
+ }
19013
+ }
19014
+ function validatePatch(group, patch2) {
19015
+ const next = { ...group, ...patch2 };
19016
+ if (patch2.minAxisType && patch2.minAxisType !== "custom" && patch2.manualMin === void 0)
19017
+ delete next.manualMin;
19018
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom" && patch2.manualMax === void 0)
19019
+ delete next.manualMax;
19020
+ validateSettings(next);
19021
+ }
19022
+ function save(ctx, s, next, label3, ranges) {
19023
+ const sheet = sheetAt(ctx.workbook, s);
19024
+ ctx.run(
19025
+ label3,
19026
+ "annotations",
19027
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19028
+ () => sheet.preserved.set("extLst", next),
19029
+ { sheet: s, ranges }
19030
+ );
19031
+ }
19032
+ function createSparklineGroup(ctx, s, source, locations, patch2 = {}) {
19033
+ patch2 = cleanSparklinePatch(patch2);
19034
+ locations = checkedSparklineRange(locations);
19035
+ const sheet = sheetAt(ctx.workbook, s);
19036
+ const lines = newSparklines(ctx.workbook, s, source, locations);
19037
+ if (selectedSparklineGroups(sheet, [locations]).length)
19038
+ throw new Error("The location range already contains sparklines.");
19039
+ if (sheet.merges.some((merge2) => lines.some((line2) => rangesIntersect(merge2, line2.host))))
19040
+ throw new Error("Sparklines cannot be created in merged cells.");
19041
+ const body2 = lines.map(
19042
+ (line2) => `<x14:sparkline>${el("xm:f", {}, escapeText(line2.formula))}${el("xm:sqref", {}, formatRange(line2.host))}</x14:sparkline>`
19043
+ ).join("");
19044
+ const colors = '<x14:colorSeries theme="4"/><x14:colorNegative rgb="FFD00000"/><x14:colorAxis rgb="FF000000"/>' + ["Markers", "First", "Last", "High", "Low"].map((name) => `<x14:color${name} rgb="FFD00000"/>`).join("");
19045
+ const doc = parseXml(
19046
+ `<x14:sparklineGroup xmlns:x14="${NS.x14}" xmlns:xm="${XM4}">${colors}<x14:sparklines>${body2}</x14:sparklines></x14:sparklineGroup>`
19047
+ );
19048
+ const node = doc.documentElement;
19049
+ validatePatch(readSparklineGroup(node), patch2);
19050
+ patchSparklineNode(node, { displayEmptyCellsAs: "gap", ...patch2 });
19051
+ validateSettings({ ...readSparklineGroup(node), ...patch2 });
19052
+ save(ctx, s, appendSparklineXml(sheet, buildXml(node)), "Create sparklines", [locations]);
19053
+ }
19054
+ function setSparklineGroups(ctx, s, ranges, patch2) {
19055
+ patch2 = cleanSparklinePatch(patch2);
19056
+ const sheet = sheetAt(ctx.workbook, s);
19057
+ ranges = ranges.map(checkedSparklineRange);
19058
+ const selected2 = selectedSparklineGroups(sheet, ranges);
19059
+ if (!selected2.length) return;
19060
+ for (const group of selected2) validatePatch(group, patch2);
19061
+ const next = editSparklineXml(sheet, (node, group) => {
19062
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
19063
+ return false;
19064
+ patchSparklineNode(node, patch2);
19065
+ return true;
19066
+ });
19067
+ save(ctx, s, next, "Format sparklines", ranges);
19068
+ }
19069
+ function setSparklineDateRange(ctx, s, ranges, source = "") {
19070
+ ranges = ranges.map(checkedSparklineRange);
19071
+ const sheet = sheetAt(ctx.workbook, s);
19072
+ const groups = selectedSparklineGroups(sheet, ranges);
19073
+ if (!groups.length) return;
19074
+ let formula;
19075
+ if (source.trim()) {
19076
+ const data = sparklineDataRange(ctx.workbook, s, source);
19077
+ const length = (range2) => {
19078
+ const rows2 = range2.end.row - range2.start.row + 1;
19079
+ const cols = range2.end.col - range2.start.col + 1;
19080
+ if (rows2 > 1 && cols > 1) throw new Error("The date range must be one row or column.");
19081
+ return Math.max(rows2, cols);
19082
+ };
19083
+ const count2 = length(data.range);
19084
+ if (count2 > 1e4) throw new Error("The sparkline date range is too large.");
19085
+ for (const group of groups)
19086
+ for (const line2 of group.sparklines) {
19087
+ const values2 = sparklineDataRange(ctx.workbook, s, line2.formula ?? "");
19088
+ if (length(values2.range) !== count2)
19089
+ throw new Error("The data range and date range do not match.");
19090
+ }
19091
+ formula = `'${ctx.workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!${formatRange(data.range)}`;
19092
+ }
19093
+ const next = editSparklineXml(sheet, (node, group) => {
19094
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
19095
+ return false;
19096
+ for (const old of children(node, "f", XM4)) node.removeChild(old);
19097
+ node.setAttribute("dateAxis", formula ? "1" : "0");
19098
+ if (formula) {
19099
+ const value2 = node.ownerDocument.createElementNS(XM4, "xm:f");
19100
+ value2.textContent = formula;
19101
+ node.insertBefore(value2, first(node, "sparklines", NS.x14) ?? null);
19102
+ }
19103
+ return true;
19104
+ });
19105
+ save(ctx, s, next, "Change sparkline date axis", ranges);
19106
+ }
19107
+ function deleteSparklines(ctx, s, ranges, wholeGroups = false) {
19108
+ ranges = ranges.map(checkedSparklineRange);
19109
+ const sheet = sheetAt(ctx.workbook, s);
19110
+ if (!selectedSparklineGroups(sheet, ranges).length) return;
19111
+ const next = editSparklineXml(sheet, (node, group) => {
19112
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
19113
+ return false;
19114
+ const lines = first(node, "sparklines", NS.x14);
19115
+ const nodes = children(lines, "sparkline", NS.x14);
19116
+ for (const line2 of nodes) {
19117
+ const host = parseRange(first(line2, "sqref", XM4)?.textContent ?? "");
19118
+ if (wholeGroups || host && ranges.some((range2) => rangesIntersect(range2, host)))
19119
+ line2.parentNode?.removeChild(line2);
19120
+ }
19121
+ return true;
19122
+ });
19123
+ save(ctx, s, next, "Clear sparklines", ranges);
19124
+ }
19125
+
19126
+ // xlsx/edit/pivots.ts
19127
+ function pivotAt(ctx, sheet, name) {
19128
+ const pivot = sheetAt(ctx.workbook, sheet).pivotTables?.find((entry) => entry.name === name);
19129
+ if (!pivot) throw new Error("The selected PivotTable is not available.");
19130
+ return pivot;
19131
+ }
19132
+ function uniqueName(ctx) {
19133
+ const used = reservedPivotNames(ctx.workbook);
19134
+ for (let i2 = 1; ; i2++) if (!used.has(`pivottable${i2}`)) return `PivotTable${i2}`;
19135
+ }
19136
+ function reservedPivotNames(workbook) {
19137
+ return new Set(
19138
+ workbook.sheets.flatMap((sheet) => [
19139
+ ...(sheet.pivotTables ?? []).map((pivot) => pivot.name),
19140
+ ...sheet.preserved.get("source:unsupportedPivotNames") ?? []
19141
+ ]).map((name) => name.toLowerCase())
19142
+ );
19143
+ }
19144
+ function checkName(ctx, name) {
19145
+ if (!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name) || name.length > 255 || parseAddress(name) || reservedPivotNames(ctx.workbook).has(name.toLowerCase()))
19146
+ throw new Error("A PivotTable name must be unique and cannot look like a cell reference.");
19147
+ }
19148
+ function plan(ctx, s, pivot, old) {
19149
+ const sheet = sheetAt(ctx.workbook, s);
19150
+ const grid6 = pivotGrid(pivot);
19151
+ const start = pivot.location.start;
19152
+ const location = {
19153
+ start,
19154
+ end: {
19155
+ row: start.row + grid6.values.length - 1,
19156
+ col: start.col + (grid6.values[0]?.length ?? 0) - 1
19157
+ }
19158
+ };
19159
+ if (![start.row, start.col].every(Number.isInteger) || start.row < 0 || start.col < 0 || location.end.row > MAX_ROW || location.end.col > MAX_COL)
19160
+ throw new Error("The PivotTable result does not fit on the worksheet.");
19161
+ const source = sparklineDataRange(ctx.workbook, s, pivot.source);
19162
+ if (source.sheet === s && rangesIntersect(source.range, location) || sheet.merges.some((range2) => rangesIntersect(range2, location)) || sheet.tables.some((table2) => rangesIntersect(table2.range, location)) || sheet.pivotTables?.some((other) => other !== old && rangesIntersect(other.location, location)))
19163
+ throw new Error("The PivotTable would overlap source data, another table or merged cells.");
19164
+ let occupied = false;
19165
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
19166
+ if ((!old || !rangeContains(old.location, { row: row2, col })) && (cell.value !== null || cell.formula !== void 0))
19167
+ occupied = true;
19168
+ });
19169
+ if (occupied) throw new Error("The PivotTable would overwrite existing cell content.");
19170
+ return { grid: grid6, location };
19171
+ }
19172
+ function write(ctx, s, pivot, old) {
19173
+ const sheet = sheetAt(ctx.workbook, s);
19174
+ const { grid: grid6, location } = plan(ctx, s, pivot, old);
19175
+ const ranges = [...old ? [old.location] : [], location];
19176
+ ctx.run(
19177
+ old ? "Refresh PivotTable" : "Create PivotTable",
19178
+ "annotations",
19179
+ [
19180
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
19181
+ { kind: "cells", sheet: s, ranges }
19182
+ ],
19183
+ () => {
19184
+ const compact3 = pivot.layout === "compact";
19185
+ const indents = new Map(
19186
+ [.../* @__PURE__ */ new Set([0, ...grid6.indents ?? []])].map(
19187
+ (indent) => [
19188
+ indent,
19189
+ stylePatcher(ctx.workbook, {
19190
+ alignment: { indent, ...compact3 || indent > 0 ? { horizontal: "left" } : {} }
19191
+ })
19192
+ ]
19193
+ )
19194
+ );
19195
+ const styles = /* @__PURE__ */ new Map();
19196
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
19197
+ if (cell.styleId !== void 0) styles.set(`${row2}:${col}`, cell.styleId);
19198
+ });
19199
+ if (old)
19200
+ forEachCellInRange(sheet, old.location, (cell, row2, col) => {
19201
+ if (cell.styleId !== void 0)
19202
+ putCell(sheet, row2, col, { value: null, styleId: cell.styleId });
19203
+ else deleteCell(sheet, row2, col);
19204
+ });
19205
+ const next = { ...pivot, location, dirty: true };
19206
+ const list = sheet.pivotTables ?? [];
19207
+ sheet.pivotTables = old ? list.map((entry) => entry === old ? next : entry) : [...list, next];
19208
+ grid6.values.forEach(
19209
+ (line2, row2) => line2.forEach((value2, col) => {
19210
+ const r = startRow(location, row2);
19211
+ const c = location.start.col + col;
19212
+ let styleId = styles.get(`${r}:${c}`);
19213
+ if (col < (grid6.rowLabelColumns ?? 1)) {
19214
+ const indent = col === 0 ? grid6.indents?.[row2] ?? 0 : 0;
19215
+ const alignment = styleAt(ctx.workbook, styleId).alignment;
19216
+ if ((alignment?.indent ?? 0) !== indent || compact3 && alignment?.horizontal !== "left")
19217
+ styleId = indents.get(indent)(styleId);
19218
+ }
19219
+ putCell(sheet, r, c, { value: value2, ...styleId !== void 0 ? { styleId } : {} });
19220
+ })
19221
+ );
19222
+ },
19223
+ { sheet: s, ranges }
19224
+ );
19225
+ }
19226
+ var startRow = (range2, offset2) => range2.start.row + offset2;
19227
+ function createPivotTable(ctx, s, destination, options) {
19228
+ const data = pivotSourceData(ctx.workbook, s, options.source);
19229
+ const name = options.name ?? uniqueName(ctx);
19230
+ checkName(ctx, name);
19231
+ const aggregate3 = options.aggregate ?? "sum";
19232
+ const pivot = {
19233
+ ...data,
19234
+ name,
19235
+ rowField: options.rowField,
19236
+ layout: options.layout ?? "tabular",
19237
+ subtotalPosition: options.subtotalPosition ?? (options.layout && options.layout !== "tabular" ? "top" : "bottom"),
19238
+ ...options.secondRowField ? { secondRowField: options.secondRowField } : {},
19239
+ ...options.subtotals !== void 0 ? { subtotals: options.subtotals } : {},
19240
+ ...options.repeatLabels !== void 0 ? { repeatLabels: options.repeatLabels } : {},
19241
+ valueField: options.valueField,
19242
+ aggregate: aggregate3,
19243
+ valueCaption: pivotCaption(aggregate3, options.valueField),
19244
+ ...options.valuesAxis !== void 0 ? { valuesAxis: options.valuesAxis } : {},
19245
+ ...options.valuesPosition !== void 0 ? { valuesPosition: options.valuesPosition } : {},
19246
+ ...options.additionalValues ? { additionalValues: normalizedPivotMeasures(options.additionalValues) } : {},
19247
+ location: { start: { ...destination }, end: { ...destination } },
19248
+ ...options.columnField ? { columnField: options.columnField } : {}
19249
+ };
19250
+ validatePivotFields(pivot);
19251
+ write(ctx, s, pivot);
19252
+ return name;
19253
+ }
19254
+ function refreshPivotTable(ctx, s, name, patch2 = {}) {
19255
+ const old = pivotAt(ctx, s, name);
19256
+ const aggregate3 = patch2.aggregate ?? old.aggregate;
19257
+ const valueField = patch2.valueField ?? old.valueField;
19258
+ const next = {
19259
+ ...old,
19260
+ ...pivotSourceData(ctx.workbook, s, old.source),
19261
+ rowField: patch2.rowField ?? old.rowField,
19262
+ valueField,
19263
+ aggregate: aggregate3,
19264
+ valueCaption: aggregate3 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate3, valueField)
19265
+ };
19266
+ if (patch2.columnField !== void 0) {
19267
+ if (patch2.columnField) next.columnField = patch2.columnField;
19268
+ else delete next.columnField;
19269
+ }
19270
+ if (patch2.secondRowField !== void 0) {
19271
+ if (patch2.secondRowField) next.secondRowField = patch2.secondRowField;
19272
+ else delete next.secondRowField;
19273
+ }
19274
+ if (patch2.subtotals !== void 0) next.subtotals = patch2.subtotals;
19275
+ if (patch2.repeatLabels !== void 0) next.repeatLabels = patch2.repeatLabels;
19276
+ if (patch2.layout !== void 0) next.layout = patch2.layout;
19277
+ if (patch2.subtotalPosition !== void 0) next.subtotalPosition = patch2.subtotalPosition;
19278
+ if (patch2.valuesAxis !== void 0) next.valuesAxis = patch2.valuesAxis;
19279
+ if (patch2.valuesPosition !== void 0) next.valuesPosition = patch2.valuesPosition;
19280
+ else if (patch2.valuesAxis === "columns" || patch2.secondRowField === "")
19281
+ delete next.valuesPosition;
19282
+ if (patch2.additionalValues !== void 0) {
19283
+ const measures = normalizedPivotMeasures(patch2.additionalValues);
19284
+ if (measures.length) next.additionalValues = measures;
19285
+ else delete next.additionalValues;
19286
+ }
19287
+ validatePivotFields(next);
19288
+ write(ctx, s, next, old);
19289
+ }
19290
+ function deletePivotTable(ctx, s, name) {
19291
+ const sheet = sheetAt(ctx.workbook, s);
19292
+ const pivot = pivotAt(ctx, s, name);
19293
+ ctx.run(
19294
+ "Delete PivotTable",
19295
+ "annotations",
19296
+ [
19297
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
19298
+ { kind: "cells", sheet: s, ranges: [pivot.location] }
19299
+ ],
19300
+ () => {
19301
+ sheet.pivotTables = sheet.pivotTables.filter((entry) => entry !== pivot);
19302
+ forEachCellInRange(sheet, pivot.location, (_cell, row2, col) => deleteCell(sheet, row2, col));
19303
+ },
19304
+ { sheet: s, ranges: [pivot.location] }
19305
+ );
19306
+ }
19307
+
18143
19308
  // xlsx/edit/cell-style.ts
18144
19309
  function ensureNamedStyle(workbook, name) {
18145
19310
  const lower2 = name.toLowerCase();
@@ -18247,19 +19412,19 @@ function addChart(ctx, s, chart) {
18247
19412
  { sheet: s }
18248
19413
  );
18249
19414
  }
18250
- function updateChart(ctx, s, index2, patch) {
18251
- assertBarClusterOptions(patch);
19415
+ function updateChart(ctx, s, index2, patch2) {
19416
+ assertBarClusterOptions(patch2);
18252
19417
  const sheet = sheetAt(ctx.workbook, s);
18253
19418
  const chart = sheet.drawings[index2];
18254
19419
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index2}`);
18255
- const formatting = patch.elementFills ? chartWithElementFills(chart, patch.elementFills).formatting : void 0;
19420
+ const formatting = patch2.elementFills ? chartWithElementFills(chart, patch2.elementFills).formatting : void 0;
18256
19421
  ctx.run(
18257
19422
  "Edit chart",
18258
19423
  "annotations",
18259
19424
  [{ kind: "sheet", sheet: s }],
18260
19425
  () => {
18261
19426
  const live = sheet.drawings[index2];
18262
- const changes = structuredClone(patch);
19427
+ const changes = structuredClone(patch2);
18263
19428
  delete changes.elementFills;
18264
19429
  if (formatting) live.formatting = formatting;
18265
19430
  changes.series?.forEach((series, i2) => {
@@ -18485,6 +19650,8 @@ function resizeTableIn(workbook, sheet, id, range2) {
18485
19650
  throw new Error("The table range is too small.");
18486
19651
  if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
18487
19652
  throw new Error("A table cannot overlap another table.");
19653
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
19654
+ throw new Error("A table cannot overlap a PivotTable.");
18488
19655
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
18489
19656
  throw new Error("A table cannot contain merged cells.");
18490
19657
  const oldEnd = table2.range.end.row;
@@ -18507,17 +19674,17 @@ var STYLE_KEYS = [
18507
19674
  "showFirstColumn",
18508
19675
  "showLastColumn"
18509
19676
  ];
18510
- function updateTable(ctx, s, ref, patch) {
19677
+ function updateTable(ctx, s, ref, patch2) {
18511
19678
  const { workbook } = ctx;
18512
19679
  const sheet = sheetAt(workbook, s);
18513
19680
  const current = sheet.tables[tableIndex(sheet, ref)];
18514
- const name = patch.name ?? patch.displayName;
19681
+ const name = patch2.name ?? patch2.displayName;
18515
19682
  const renaming = name !== void 0 && name !== current.name;
18516
19683
  if (renaming) {
18517
19684
  const problem = validateTableName(workbook, name, current);
18518
19685
  if (problem) throw new Error(problem);
18519
19686
  }
18520
- const wide = renaming || patch.headerRow !== void 0 || patch.totalsRow !== void 0;
19687
+ const wide = renaming || patch2.headerRow !== void 0 || patch2.totalsRow !== void 0;
18521
19688
  const scope = wide ? { kind: "workbook" } : { kind: "sheet", sheet: s };
18522
19689
  const id = current.id;
18523
19690
  ctx.run(
@@ -18528,25 +19695,25 @@ function updateTable(ctx, s, ref, patch) {
18528
19695
  const table2 = byId(sheet, id);
18529
19696
  if (renaming) renameTableIn(workbook, table2, name);
18530
19697
  for (const key of STYLE_KEYS) {
18531
- if (!(key in patch)) continue;
18532
- const value2 = patch[key];
19698
+ if (!(key in patch2)) continue;
19699
+ const value2 = patch2[key];
18533
19700
  if (value2 === void 0) delete table2[key];
18534
19701
  else table2[key] = value2;
18535
19702
  }
18536
- if (patch.columns) {
19703
+ if (patch2.columns) {
18537
19704
  const width = table2.range.end.col - table2.range.start.col + 1;
18538
- if (patch.columns.length !== width) throw new Error("Give one column per table column.");
19705
+ if (patch2.columns.length !== width) throw new Error("Give one column per table column.");
18539
19706
  const before = table2.columns;
18540
- table2.columns = structuredClone(patch.columns);
19707
+ table2.columns = structuredClone(patch2.columns);
18541
19708
  for (const [index2, column] of table2.columns.entries()) {
18542
19709
  const sourceId = before[index2]?.sourceId;
18543
19710
  if (column.sourceId === void 0 && sourceId !== void 0) column.sourceId = sourceId;
18544
19711
  }
18545
19712
  }
18546
- if (patch.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch.headerRow);
18547
- if (patch.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch.totalsRow);
18548
- else if (patch.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
18549
- if (patch.range) resizeTableIn(workbook, sheet, id, patch.range);
19713
+ if (patch2.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch2.headerRow);
19714
+ if (patch2.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch2.totalsRow);
19715
+ else if (patch2.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
19716
+ if (patch2.range) resizeTableIn(workbook, sheet, id, patch2.range);
18550
19717
  },
18551
19718
  { sheet: s, ranges: [current.range], structural: true }
18552
19719
  );
@@ -18728,28 +19895,28 @@ function compact2(value2) {
18728
19895
  if (value2[key] === void 0) delete value2[key];
18729
19896
  return value2;
18730
19897
  }
18731
- function setPageSetup(ctx, s, patch) {
19898
+ function setPageSetup(ctx, s, patch2) {
18732
19899
  const sheet = sheetAt(ctx.workbook, s);
18733
19900
  ctx.run(
18734
19901
  "Page setup",
18735
19902
  "view",
18736
19903
  [{ kind: "sheet", sheet: s }],
18737
19904
  () => {
18738
- const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch) });
19905
+ const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch2) });
18739
19906
  if (Object.keys(next).length) sheet.pageSetup = next;
18740
19907
  else Reflect.deleteProperty(sheet, "pageSetup");
18741
19908
  },
18742
19909
  { sheet: s }
18743
19910
  );
18744
19911
  }
18745
- function setPrintOptions(ctx, s, patch) {
19912
+ function setPrintOptions(ctx, s, patch2) {
18746
19913
  const sheet = sheetAt(ctx.workbook, s);
18747
19914
  ctx.run(
18748
19915
  "Print options",
18749
19916
  "view",
18750
19917
  [{ kind: "sheet", sheet: s }],
18751
19918
  () => {
18752
- const next = { ...sheet.printOptions, ...patch };
19919
+ const next = { ...sheet.printOptions, ...patch2 };
18753
19920
  for (const key of Object.keys(next))
18754
19921
  if (!next[key]) delete next[key];
18755
19922
  if (Object.keys(next).length) sheet.printOptions = next;
@@ -18760,6 +19927,203 @@ function setPrintOptions(ctx, s, patch) {
18760
19927
  );
18761
19928
  }
18762
19929
 
19930
+ // xlsx/edit/page-breaks.ts
19931
+ function patch(xml, before, present, axis) {
19932
+ const doc = parseXml(xml);
19933
+ const root = doc.documentElement;
19934
+ const breaks = children(root, "brk", NS.x);
19935
+ for (const node of breaks)
19936
+ if (!present && /^(1|true)$/.test(node.getAttribute("man") ?? "") && (before === void 0 || Number(node.getAttribute("id")) === before))
19937
+ root.removeChild(node);
19938
+ if (present && before !== void 0) {
19939
+ const existing = children(root, "brk", NS.x).find(
19940
+ (node2) => Number(node2.getAttribute("id")) === before
19941
+ );
19942
+ const node = existing ?? doc.createElementNS(NS.x, "brk");
19943
+ node.setAttribute("id", String(before));
19944
+ node.setAttribute("min", "0");
19945
+ node.setAttribute("max", String(axis === "row" ? MAX_COL : MAX_ROW));
19946
+ node.setAttribute("man", "1");
19947
+ if (!existing) root.appendChild(node);
19948
+ }
19949
+ const remaining = children(root, "brk", NS.x);
19950
+ if (remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length > 1026)
19951
+ throw new Error("A worksheet can have at most 1026 manual breaks on each axis.");
19952
+ if (!elements(root).length) return void 0;
19953
+ root.setAttribute("count", String(remaining.length));
19954
+ root.setAttribute(
19955
+ "manualBreakCount",
19956
+ String(remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length)
19957
+ );
19958
+ return buildXml(root);
19959
+ }
19960
+ function setPageBreak(ctx, s, axis, before, present = true) {
19961
+ if (typeof present !== "boolean" || !["row", "col"].includes(axis) || !Number.isInteger(before) || before <= 0 || before > (axis === "row" ? MAX_ROW : MAX_COL))
19962
+ throw new RangeError("Choose a row or column after the first to set a page break.");
19963
+ const sheet = sheetAt(ctx.workbook, s);
19964
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19965
+ const source = sheet.preserved.get(key) ?? [`<${key} xmlns="${NS.x}"/>`];
19966
+ const result2 = source.flatMap((xml, index2) => {
19967
+ const next = patch(xml, before, present && index2 === 0, axis);
19968
+ return next ? [next] : [];
19969
+ });
19970
+ ctx.run(
19971
+ present ? "Insert page break" : "Remove page break",
19972
+ "view",
19973
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19974
+ () => {
19975
+ if (result2.length) sheet.preserved.set(key, result2);
19976
+ else sheet.preserved.delete(key);
19977
+ },
19978
+ { sheet: s }
19979
+ );
19980
+ }
19981
+ function resetPageBreaks(ctx, s) {
19982
+ const sheet = sheetAt(ctx.workbook, s);
19983
+ const next = ["row", "col"].map((axis) => {
19984
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19985
+ return {
19986
+ key,
19987
+ xml: (sheet.preserved.get(key) ?? []).flatMap((xml) => {
19988
+ const result2 = patch(xml, void 0, false, axis);
19989
+ return result2 ? [result2] : [];
19990
+ })
19991
+ };
19992
+ });
19993
+ ctx.run(
19994
+ "Reset page breaks",
19995
+ "view",
19996
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19997
+ () => {
19998
+ for (const entry of next) {
19999
+ if (entry.xml.length) sheet.preserved.set(entry.key, entry.xml);
20000
+ else sheet.preserved.delete(entry.key);
20001
+ }
20002
+ },
20003
+ { sheet: s }
20004
+ );
20005
+ }
20006
+
20007
+ // xlsx/layout/print-titles.ts
20008
+ var PRINT_TITLES_NAME = "_xlnm.Print_Titles";
20009
+ function refs(ast) {
20010
+ return ast.type === "binary" && ast.op === "," ? [...refs(ast.left), ...refs(ast.right)] : [ast];
20011
+ }
20012
+ function printTitles(workbook, sheetIndex2) {
20013
+ const name = workbook.definedNames.find(
20014
+ (entry) => entry.name === PRINT_TITLES_NAME && entry.localSheet === sheetIndex2
20015
+ );
20016
+ if (!name) return {};
20017
+ try {
20018
+ const result2 = {};
20019
+ for (const node of refs(parseFormula(`(${name.formula})`))) {
20020
+ if (node.type !== "ref" || !node.ref || node.prefix?.book || node.prefix?.sheet2 || node.spill || node.prefix && node.prefix.sheet.toLowerCase() !== workbook.sheets[sheetIndex2]?.name.toLowerCase())
20021
+ throw new Error("Unsupported print title reference");
20022
+ const key = node.ref.kind === "rows" ? "rows" : node.ref.kind === "cols" ? "columns" : void 0;
20023
+ if (!key || result2[key]) throw new Error("Unsupported print title reference");
20024
+ const axis = key === "rows" ? "row" : "col";
20025
+ result2[key] = {
20026
+ start: Math.min(node.ref.start[axis], node.ref.end[axis]),
20027
+ end: Math.max(node.ref.start[axis], node.ref.end[axis])
20028
+ };
20029
+ }
20030
+ return result2;
20031
+ } catch {
20032
+ return { unsupported: true };
20033
+ }
20034
+ }
20035
+ function formatPrintTitleSpan(span4, axis) {
20036
+ return axis === "row" ? `$${span4.start + 1}:$${span4.end + 1}` : `$${columnLabel(span4.start)}:$${columnLabel(span4.end)}`;
20037
+ }
20038
+ function printTitlesFormula(sheet, titles) {
20039
+ return ["rows", "columns"].flatMap((key) => {
20040
+ const span4 = titles[key];
20041
+ if (!span4) return [];
20042
+ const max = key === "rows" ? MAX_ROW : MAX_COL;
20043
+ if (![span4.start, span4.end].every(Number.isInteger) || span4.start < 0 || span4.end < span4.start || span4.end > max)
20044
+ throw new Error("Print titles must be whole rows or whole columns.");
20045
+ return [
20046
+ `${quoteSheetName(sheet)}!${formatPrintTitleSpan(span4, key === "rows" ? "row" : "col")}`
20047
+ ];
20048
+ }).join(",");
20049
+ }
20050
+
20051
+ // xlsx/edit/view.ts
20052
+ function setFreeze(ctx, s, freeze) {
20053
+ const sheet = sheetAt(ctx.workbook, s);
20054
+ const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
20055
+ ctx.run(
20056
+ next ? "Freeze panes" : "Unfreeze panes",
20057
+ "view",
20058
+ [{ kind: "sheet", sheet: s }],
20059
+ () => {
20060
+ if (next) sheet.view.freeze = next;
20061
+ else delete sheet.view.freeze;
20062
+ },
20063
+ { sheet: s, structural: true }
20064
+ );
20065
+ }
20066
+ function setSheetView(ctx, s, patch2) {
20067
+ const sheet = sheetAt(ctx.workbook, s);
20068
+ ctx.run(
20069
+ "Sheet view",
20070
+ "view",
20071
+ [{ kind: "sheet", sheet: s }],
20072
+ () => {
20073
+ const view = { ...sheet.view, ...structuredClone(patch2) };
20074
+ for (const key of Object.keys(view))
20075
+ if (view[key] === void 0) delete view[key];
20076
+ if (patch2.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch2.zoom)));
20077
+ sheet.view = view;
20078
+ },
20079
+ { sheet: s, structural: patch2.zoom !== void 0 || "freeze" in patch2 }
20080
+ );
20081
+ }
20082
+ var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
20083
+ function validateDefinedName(name) {
20084
+ if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
20085
+ if (!NAME_PATTERN.test(name))
20086
+ return "A name must start with a letter, underscore or backslash and contain no spaces.";
20087
+ if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
20088
+ return "A name cannot look like a cell reference.";
20089
+ return void 0;
20090
+ }
20091
+ var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
20092
+ function setDefinedName(ctx, name) {
20093
+ const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
20094
+ if (problem) throw new Error(problem);
20095
+ if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
20096
+ const entry = structuredClone(name);
20097
+ entry.formula = entry.formula.replace(/^=/, "");
20098
+ ctx.run("Define name", "names", [{ kind: "meta" }], () => {
20099
+ const { definedNames } = ctx.workbook;
20100
+ const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
20101
+ if (index2 >= 0) definedNames[index2] = entry;
20102
+ else definedNames.push(entry);
20103
+ });
20104
+ }
20105
+ function deleteDefinedName(ctx, name, localSheet) {
20106
+ const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
20107
+ if (index2 < 0) return;
20108
+ ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
20109
+ ctx.workbook.definedNames.splice(index2, 1);
20110
+ });
20111
+ }
20112
+
20113
+ // xlsx/edit/print-titles.ts
20114
+ function setPrintTitles(ctx, sheet, patch2) {
20115
+ const ws = sheetAt(ctx.workbook, sheet);
20116
+ const existing = printTitles(ctx.workbook, sheet);
20117
+ if (existing.unsupported && !Object.hasOwn(patch2, "rows") && !Object.hasOwn(patch2, "columns"))
20118
+ return;
20119
+ if (existing.unsupported && (!Object.hasOwn(patch2, "rows") || !Object.hasOwn(patch2, "columns")))
20120
+ throw new Error("Replace both print title ranges to change unsupported titles.");
20121
+ const next = { ...existing, ...patch2 };
20122
+ const formula = printTitlesFormula(ws.name, next);
20123
+ if (formula) setDefinedName(ctx, { name: PRINT_TITLES_NAME, formula, localSheet: sheet });
20124
+ else deleteDefinedName(ctx, PRINT_TITLES_NAME, sheet);
20125
+ }
20126
+
18763
20127
  // digest/algorithm-names.ts
18764
20128
  var CANONICAL_BY_LOOKUP_KEY = {
18765
20129
  SHA1: "SHA-1",
@@ -20044,12 +21408,12 @@ function compress3(h2, data, offset2) {
20044
21408
  W3[i2 * 2 + 1] = lo;
20045
21409
  }
20046
21410
  let ah = h2[0], al = h2[1], bh = h2[2], bl = h2[3], ch = h2[4], cl = h2[5], dh = h2[6], dl = h2[7];
20047
- let eh = h2[8], el = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
21411
+ let eh = h2[8], el2 = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
20048
21412
  for (let i2 = 0; i2 < 80; i2++) {
20049
- const S1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23);
20050
- const S1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (eh >>> 9 | el << 23);
21413
+ const S1h = (eh >>> 14 | el2 << 18) ^ (eh >>> 18 | el2 << 14) ^ (el2 >>> 9 | eh << 23);
21414
+ const S1l = (el2 >>> 14 | eh << 18) ^ (el2 >>> 18 | eh << 14) ^ (eh >>> 9 | el2 << 23);
20051
21415
  const chh = eh & fh ^ ~eh & gh;
20052
- const chl = el & fl ^ ~el & gl;
21416
+ const chl = el2 & fl ^ ~el2 & gl;
20053
21417
  let t1l = (hl >>> 0) + (S1l >>> 0) + (chl >>> 0) + K4[i2 * 2 + 1] + W3[i2 * 2 + 1];
20054
21418
  const t1h = hh + S1h + chh + K4[i2 * 2] + W3[i2 * 2] + Math.floor(t1l / 4294967296);
20055
21419
  t1l >>>= 0;
@@ -20065,10 +21429,10 @@ function compress3(h2, data, offset2) {
20065
21429
  gh = fh;
20066
21430
  gl = fl;
20067
21431
  fh = eh;
20068
- fl = el;
21432
+ fl = el2;
20069
21433
  let nl = (dl >>> 0) + t1l;
20070
21434
  eh = dh + t1h + Math.floor(nl / 4294967296) >>> 0;
20071
- el = nl >>> 0;
21435
+ el2 = nl >>> 0;
20072
21436
  dh = ch;
20073
21437
  dl = cl;
20074
21438
  ch = bh;
@@ -20088,7 +21452,7 @@ function compress3(h2, data, offset2) {
20088
21452
  add2(2, bh, bl);
20089
21453
  add2(4, ch, cl);
20090
21454
  add2(6, dh, dl);
20091
- add2(8, eh, el);
21455
+ add2(8, eh, el2);
20092
21456
  add2(10, fh, fl);
20093
21457
  add2(12, gh, gl);
20094
21458
  add2(14, hh, hl);
@@ -20639,6 +22003,8 @@ function merge(ctx, s, range2, mode) {
20639
22003
  if (r.start.row === r.end.row && r.start.col === r.end.col) return;
20640
22004
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
20641
22005
  throw new Error("Cells inside a table cannot be merged.");
22006
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22007
+ throw new Error("Cells inside a PivotTable cannot be merged.");
20642
22008
  const targets = mergeTargets(r, mode);
20643
22009
  if (!targets.length) return;
20644
22010
  ctx.run(
@@ -20882,7 +22248,7 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
20882
22248
  indentPx: indentable ? (alignment.indent ?? 0) * (options.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
20883
22249
  rotation,
20884
22250
  isNumber: isNumber2,
20885
- overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !sheet.merges.some((m) => rangeContains(m, { row: row2, col })),
22251
+ overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !(options.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
20886
22252
  hasComment: sheet.comments.some((c) => c.address.row === row2 && c.address.col === col),
20887
22253
  hasHyperlink: false,
20888
22254
  validationList: sheet.dataValidations.some(
@@ -21247,6 +22613,12 @@ function deleteSheet(ctx, index2) {
21247
22613
  const sheet = sheetAt(workbook, index2);
21248
22614
  if (sheet.state === "visible" && visibleCount(workbook) <= 1)
21249
22615
  throw new Error("A workbook must contain at least one visible sheet.");
22616
+ if (workbook.sheets.some(
22617
+ (other) => other !== sheet && other.pivotTables?.some(
22618
+ (pivot) => deleteSheetInFormula(pivot.source, sheet.name, []) !== pivot.source
22619
+ )
22620
+ ))
22621
+ throw new Error("Delete dependent PivotTables before deleting their source worksheet.");
21250
22622
  ctx.run(
21251
22623
  "Delete sheet",
21252
22624
  "sheets",
@@ -21350,6 +22722,17 @@ function duplicateSheet(ctx, index2) {
21350
22722
  copy2.name = copyName(workbook, sheet.name);
21351
22723
  copy2.sheetId = nextSheetId(workbook);
21352
22724
  delete copy2.partName;
22725
+ const pivotNames = reservedPivotNames(workbook);
22726
+ for (const pivot of copy2.pivotTables ?? []) {
22727
+ let suffix = 2;
22728
+ while (pivotNames.has(`${pivot.name}_${suffix}`.toLowerCase())) suffix++;
22729
+ pivot.name = `${pivot.name}_${suffix}`;
22730
+ pivotNames.add(pivot.name.toLowerCase());
22731
+ delete pivot.partName;
22732
+ delete pivot.cacheId;
22733
+ delete pivot.sourceXml;
22734
+ pivot.dirty = true;
22735
+ }
21353
22736
  let nextTableId = Math.max(0, ...workbook.sheets.flatMap((s) => s.tables.map((t) => t.id))) + 1;
21354
22737
  const used = /* @__PURE__ */ new Set();
21355
22738
  const renames = [];
@@ -21426,6 +22809,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
21426
22809
  if (r.start.row === r.end.row && r.start.col === r.end.col) r = currentRegion(sheet, r.start);
21427
22810
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
21428
22811
  throw new Error("A table cannot overlap another table.");
22812
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22813
+ throw new Error("A table cannot overlap a PivotTable.");
21429
22814
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
21430
22815
  throw new Error("A table cannot contain merged cells.");
21431
22816
  return ctx.run(
@@ -21652,68 +23037,6 @@ function failure(dv) {
21652
23037
  return result2;
21653
23038
  }
21654
23039
 
21655
- // xlsx/edit/view.ts
21656
- function setFreeze(ctx, s, freeze) {
21657
- const sheet = sheetAt(ctx.workbook, s);
21658
- const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
21659
- ctx.run(
21660
- next ? "Freeze panes" : "Unfreeze panes",
21661
- "view",
21662
- [{ kind: "sheet", sheet: s }],
21663
- () => {
21664
- if (next) sheet.view.freeze = next;
21665
- else delete sheet.view.freeze;
21666
- },
21667
- { sheet: s, structural: true }
21668
- );
21669
- }
21670
- function setSheetView(ctx, s, patch) {
21671
- const sheet = sheetAt(ctx.workbook, s);
21672
- ctx.run(
21673
- "Sheet view",
21674
- "view",
21675
- [{ kind: "sheet", sheet: s }],
21676
- () => {
21677
- const view = { ...sheet.view, ...structuredClone(patch) };
21678
- for (const key of Object.keys(view))
21679
- if (view[key] === void 0) delete view[key];
21680
- if (patch.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch.zoom)));
21681
- sheet.view = view;
21682
- },
21683
- { sheet: s, structural: patch.zoom !== void 0 || "freeze" in patch }
21684
- );
21685
- }
21686
- var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
21687
- function validateDefinedName(name) {
21688
- if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
21689
- if (!NAME_PATTERN.test(name))
21690
- return "A name must start with a letter, underscore or backslash and contain no spaces.";
21691
- if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
21692
- return "A name cannot look like a cell reference.";
21693
- return void 0;
21694
- }
21695
- var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
21696
- function setDefinedName(ctx, name) {
21697
- const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
21698
- if (problem) throw new Error(problem);
21699
- if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
21700
- const entry = structuredClone(name);
21701
- entry.formula = entry.formula.replace(/^=/, "");
21702
- ctx.run("Define name", "names", [{ kind: "meta" }], () => {
21703
- const { definedNames } = ctx.workbook;
21704
- const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
21705
- if (index2 >= 0) definedNames[index2] = entry;
21706
- else definedNames.push(entry);
21707
- });
21708
- }
21709
- function deleteDefinedName(ctx, name, localSheet) {
21710
- const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
21711
- if (index2 < 0) return;
21712
- ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
21713
- ctx.workbook.definedNames.splice(index2, 1);
21714
- });
21715
- }
21716
-
21717
23040
  // xlsx/edit/session.ts
21718
23041
  function createEditSession(workbook, options = {}) {
21719
23042
  const calc = createCalcEngine(workbook);
@@ -21726,8 +23049,8 @@ function createEditSession(workbook, options = {}) {
21726
23049
  };
21727
23050
  const calculator = new SessionCalculator(workbook, calc, autoRecalc);
21728
23051
  const recalc = (step, mode = "apply") => calculator.afterStep(step, mode);
21729
- const begin = (label2, kind, info) => {
21730
- const step = { label: label2, entries: [], structural: info.structural ?? false };
23052
+ const begin = (label3, kind, info) => {
23053
+ const step = { label: label3, entries: [], structural: info.structural ?? false };
21731
23054
  if (info.calc) step.calc = info.calc;
21732
23055
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
21733
23056
  };
@@ -21751,9 +23074,18 @@ function createEditSession(workbook, options = {}) {
21751
23074
  }
21752
23075
  current.step.entries.length = from;
21753
23076
  };
21754
- const run = (label2, kind, scopes, fn, info = {}) => {
23077
+ const run = (label3, kind, scopes, fn, info = {}) => {
23078
+ if (kind === "cells") {
23079
+ for (const scope of scopes)
23080
+ if (scope.kind === "cells" && workbook.sheets[scope.sheet]?.pivotTables?.some(
23081
+ (pivot) => scope.ranges.some((range2) => rangesIntersect(range2, pivot.location))
23082
+ ))
23083
+ throw new Error(
23084
+ "A PivotTable result cannot be edited directly. Refresh or remove the PivotTable instead."
23085
+ );
23086
+ }
21755
23087
  const outer = !open;
21756
- const current = open ?? begin(label2, kind, info);
23088
+ const current = open ?? begin(label3, kind, info);
21757
23089
  if (!outer) {
21758
23090
  delete current.step.calc;
21759
23091
  if (info.structural) current.step.structural = true;
@@ -21819,7 +23151,7 @@ function createEditSession(workbook, options = {}) {
21819
23151
  setCellValue: (s, r, c, value2) => setCellValue(ctx, s, r, c, value2),
21820
23152
  setRangeValues: (s, at, rows2) => setRangeValues(ctx, s, at, rows2),
21821
23153
  clearRange: (s, range2, what) => clearRange(ctx, s, range2, what),
21822
- applyStyle: (s, ranges, patch) => applyStyle(ctx, s, ranges, patch),
23154
+ applyStyle: (s, ranges, patch2) => applyStyle(ctx, s, ranges, patch2),
21823
23155
  setBorders: (s, range2, preset, edge) => setBorders(ctx, s, range2, preset, edge),
21824
23156
  insertRows: (s, at, count2) => insertRows(ctx, s, at, count2),
21825
23157
  deleteRows: (s, at, count2) => deleteRows(ctx, s, at, count2),
@@ -21857,24 +23189,34 @@ function createEditSession(workbook, options = {}) {
21857
23189
  filterColumn: (s, col, vals) => filterColumn(ctx, s, col, vals),
21858
23190
  sortByColumn: (s, col, descending) => sortByColumn(ctx, s, col, descending ?? false),
21859
23191
  createTable: (s, range2, hasHeader, styleName) => createTable(ctx, s, range2, hasHeader, styleName),
21860
- setSheetView: (s, patch) => setSheetView(ctx, s, patch),
23192
+ setSheetView: (s, patch2) => setSheetView(ctx, s, patch2),
21861
23193
  setDefinedName: (name) => setDefinedName(ctx, name),
21862
23194
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
21863
23195
  setDrawingAnchor: (s, index2, anchor) => setDrawingAnchor(ctx, s, index2, anchor),
23196
+ createPivotTable: (s, destination, options2) => createPivotTable(ctx, s, destination, options2),
23197
+ refreshPivotTable: (s, name, patch2) => refreshPivotTable(ctx, s, name, patch2),
23198
+ deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
21864
23199
  deleteDrawing: (s, index2) => deleteDrawing(ctx, s, index2),
23200
+ createSparklineGroup: (s, source, locations, patch2) => createSparklineGroup(ctx, s, source, locations, patch2),
23201
+ setSparklineGroups: (s, ranges, patch2) => setSparklineGroups(ctx, s, ranges, patch2),
23202
+ setSparklineDateRange: (s, ranges, source) => setSparklineDateRange(ctx, s, ranges, source),
23203
+ deleteSparklines: (s, ranges, wholeGroups) => deleteSparklines(ctx, s, ranges, wholeGroups),
21865
23204
  addChart: (s, chart) => addChart(ctx, s, chart),
21866
- updateChart: (s, index2, patch) => updateChart(ctx, s, index2, patch),
23205
+ updateChart: (s, index2, patch2) => updateChart(ctx, s, index2, patch2),
21867
23206
  addImage: (s, bytes, type, anchor, name) => addImage(ctx, s, bytes, type, anchor, name),
21868
23207
  replaceConditionalFormat: (s, index2, cf) => replaceConditionalFormat(ctx, s, index2, cf),
21869
23208
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
21870
23209
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
21871
23210
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
21872
- updateTable: (s, table2, patch) => updateTable(ctx, s, table2, patch),
23211
+ updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
21873
23212
  resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
21874
23213
  convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
21875
23214
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
21876
- setPageSetup: (s, patch) => setPageSetup(ctx, s, patch),
21877
- setPrintOptions: (s, patch) => setPrintOptions(ctx, s, patch),
23215
+ setPageSetup: (s, patch2) => setPageSetup(ctx, s, patch2),
23216
+ setPageBreak: (s, axis, before, present) => setPageBreak(ctx, s, axis, before, present),
23217
+ resetPageBreaks: (s) => resetPageBreaks(ctx, s),
23218
+ setPrintTitles: (s, patch2) => setPrintTitles(ctx, s, patch2),
23219
+ setPrintOptions: (s, patch2) => setPrintOptions(ctx, s, patch2),
21878
23220
  setSheetProtection: (s, p, password) => setSheetProtection(ctx, s, p, password),
21879
23221
  setWorkbookProtection: (locked, password) => setWorkbookProtection(ctx, locked, password),
21880
23222
  groupRows: (s, from, to) => groupRows(ctx, s, from, to),
@@ -21884,7 +23226,7 @@ function createEditSession(workbook, options = {}) {
21884
23226
  setDefaultColumnWidth: (s, width) => setDefaultColumnWidth(ctx, s, width),
21885
23227
  removeDuplicates: (s, range2, cols, hasHeader) => removeDuplicates(ctx, s, range2, cols, hasHeader),
21886
23228
  setCalcMode: (mode) => setCalcMode(ctx, mode),
21887
- setDocumentProperties: (patch) => setDocumentProperties(ctx, patch),
23229
+ setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
21888
23230
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
21889
23231
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
21890
23232
  calculateNow(options2) {
@@ -21899,12 +23241,12 @@ function createEditSession(workbook, options = {}) {
21899
23241
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
21900
23242
  evaluate: (formula, at) => calc.evaluate(formula, at)
21901
23243
  }),
21902
- batch(label2, fn) {
23244
+ batch(label3, fn) {
21903
23245
  if (open) {
21904
23246
  fn();
21905
23247
  return;
21906
23248
  }
21907
- const current = begin(label2, "batch", {});
23249
+ const current = begin(label3, "batch", {});
21908
23250
  open = current;
21909
23251
  try {
21910
23252
  fn();
@@ -22859,21 +24201,21 @@ function stepFontSize(size, grow) {
22859
24201
  if (grow) return FONT_SIZES.find((s) => s > size) ?? Math.min(409, size + 10);
22860
24202
  return [...FONT_SIZES].reverse().find((s) => s < size) ?? Math.max(1, size - 1);
22861
24203
  }
22862
- var style = (ctx, patch) => {
22863
- withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch));
24204
+ var style = (ctx, patch2) => {
24205
+ withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch2));
22864
24206
  };
22865
24207
  function pickColor(arg) {
22866
24208
  if (arg && typeof arg === "object" && !arg.auto) return arg;
22867
24209
  return null;
22868
24210
  }
22869
- var toggle = (id, label2, glyph, shortcut, read, patch) => editing({
24211
+ var toggle = (id, label3, glyph, shortcut, read, patch2) => editing({
22870
24212
  id,
22871
- label: label2,
24213
+ label: label3,
22872
24214
  icon: icon(glyph),
22873
24215
  shortcut,
22874
24216
  lock: "formatCells",
22875
24217
  checked: read,
22876
- run: (ctx) => style(ctx, patch(!read(ctx)))
24218
+ run: (ctx) => style(ctx, patch2(!read(ctx)))
22877
24219
  });
22878
24220
  var BORDER_PRESETS = [
22879
24221
  ["bottom", "Bottom Border", "borderBottom"],
@@ -23053,10 +24395,10 @@ var mergedAtActive = (ctx) => {
23053
24395
  const t = target(ctx);
23054
24396
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
23055
24397
  };
23056
- function mergeCommand(id, label2, mode) {
24398
+ function mergeCommand(id, label3, mode) {
23057
24399
  return editing({
23058
24400
  id,
23059
- label: label2,
24401
+ label: label3,
23060
24402
  icon: icon("mergeCenter"),
23061
24403
  lock: "formatCells",
23062
24404
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -23071,30 +24413,30 @@ function mergeCommand(id, label2, mode) {
23071
24413
  }
23072
24414
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
23073
24415
  const ok = await ctx.dialogs.open("confirm", {
23074
- heading: label2,
24416
+ heading: label3,
23075
24417
  message: "Merging cells only keeps the upper-left value and discards other values."
23076
24418
  });
23077
24419
  if (ok !== true) return;
23078
24420
  if (ctx.session() !== t.session || ctx.readOnly()) return;
23079
24421
  }
23080
- t.session.batch(label2, () => {
24422
+ t.session.batch(label3, () => {
23081
24423
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
23082
24424
  });
23083
24425
  }
23084
24426
  });
23085
24427
  }
23086
24428
  function alignmentCommands() {
23087
- const valign = (id, label2, value2, glyph) => editing({
24429
+ const valign = (id, label3, value2, glyph) => editing({
23088
24430
  id,
23089
- label: label2,
24431
+ label: label3,
23090
24432
  icon: icon(glyph),
23091
24433
  lock: "formatCells",
23092
24434
  checked: (ctx) => vertical(ctx) === value2,
23093
24435
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
23094
24436
  });
23095
- const halign = (id, label2, value2, glyph) => editing({
24437
+ const halign = (id, label3, value2, glyph) => editing({
23096
24438
  id,
23097
- label: label2,
24439
+ label: label3,
23098
24440
  icon: icon(glyph),
23099
24441
  lock: "formatCells",
23100
24442
  checked: (ctx) => horizontal(ctx) === value2,
@@ -24478,6 +25820,24 @@ var MESSAGE_STRINGS = {
24478
25820
 
24479
25821
  // xlsx/ui/commands/i18n/navigation.ts
24480
25822
  var NAVIGATION_STRINGS = {
25823
+ "Sparklines (create, format and clear)": [
25824
+ "Graphiques sparkline (cr\xE9ation, mise en forme et suppression)",
25825
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
25826
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
25827
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u683C\u5F0F\u8BBE\u7F6E\u548C\u6E05\u9664\uFF09"
25828
+ ],
25829
+ "Worksheet-range PivotTables (one row field, optional column field and one value field)": [
25830
+ "Tableaux crois\xE9s dynamiques de plages (un champ de ligne, un champ de colonne facultatif et un champ de valeur)",
25831
+ "PivotTables aus Arbeitsblattbereichen (ein Zeilenfeld, optionales Spaltenfeld und ein Wertfeld)",
25832
+ "Tablas din\xE1micas de rangos (un campo de fila, columna opcional y un valor)",
25833
+ "\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\uFF08\u4E00\u4E2A\u884C\u5B57\u6BB5\u3001\u53EF\u9009\u5217\u5B57\u6BB5\u548C\u4E00\u4E2A\u503C\u5B57\u6BB5\uFF09"
25834
+ ],
25835
+ "Advanced PivotTable layouts, grouping and external data sources (preserved)": [
25836
+ "Dispositions avanc\xE9es, regroupements et sources externes de tableaux crois\xE9s dynamiques (conserv\xE9s)",
25837
+ "Erweiterte PivotTable-Layouts, Gruppierung und externe Datenquellen (erhalten)",
25838
+ "Dise\xF1os avanzados, agrupaci\xF3n y fuentes externas de tablas din\xE1micas (conservados)",
25839
+ "\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u5E03\u5C40\u3001\u5206\u7EC4\u548C\u5916\u90E8\u6570\u636E\u6E90\uFF08\u4FDD\u7559\uFF09"
25840
+ ],
24481
25841
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
24482
25842
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
24483
25843
  Close: ["Fermer", "Schlie\xDFen", "Cerrar", "\u5173\u95ED"],
@@ -26614,6 +27974,149 @@ var RIBBON_TAB_STRINGS = {
26614
27974
 
26615
27975
  // xlsx/ui/commands/i18n/tools.ts
26616
27976
  var TOOLS_STRINGS = {
27977
+ Bold: RIBBON_HOME_STRINGS.Bold,
27978
+ Italic: RIBBON_HOME_STRINGS.Italic,
27979
+ Underline: RIBBON_HOME_STRINGS.Underline,
27980
+ Strikethrough: RIBBON_HOME_STRINGS.Strikethrough,
27981
+ "Insert Formatting": [
27982
+ "Ins\xE9rer une mise en forme",
27983
+ "Formatierung einf\xFCgen",
27984
+ "Insertar formato",
27985
+ "\u63D2\u5165\u683C\u5F0F"
27986
+ ],
27987
+ 'Formatting: &B bold, &I italic, &U underline, &S strike, &18 font size, &KFF0000 RGB color, &"Arial,Regular" font.': [
27988
+ 'Format : &B gras, &I italique, &U soulign\xE9, &S barr\xE9, &18 taille, &KFF0000 couleur RVB, &"Arial,Regular" police.',
27989
+ 'Format: &B fett, &I kursiv, &U unterstrichen, &S durchgestrichen, &18 Schriftgr\xF6\xDFe, &KFF0000 RGB-Farbe, &"Arial,Regular" Schriftart.',
27990
+ 'Formato: &B negrita, &I cursiva, &U subrayado, &S tachado, &18 tama\xF1o, &KFF0000 color RGB, &"Arial,Regular" fuente.',
27991
+ '\u683C\u5F0F\uFF1A&B \u7C97\u4F53\u3001&I \u659C\u4F53\u3001&U \u4E0B\u5212\u7EBF\u3001&S \u5220\u9664\u7EBF\u3001&18 \u5B57\u53F7\u3001&KFF0000 RGB \u989C\u8272\u3001&"Arial,Regular" \u5B57\u4F53\u3002'
27992
+ ],
27993
+ "Date Range (optional):": [
27994
+ "Plage de dates (facultative) :",
27995
+ "Datumsbereich (optional):",
27996
+ "Rango de fechas (opcional):",
27997
+ "\u65E5\u671F\u8303\u56F4\uFF08\u53EF\u9009\uFF09\uFF1A"
27998
+ ],
27999
+ "Leave the date range empty for a general axis.": [
28000
+ "Laissez la plage de dates vide pour un axe g\xE9n\xE9ral.",
28001
+ "F\xFCr eine allgemeine Achse den Datumsbereich leer lassen.",
28002
+ "Deje vac\xEDo el rango de fechas para un eje general.",
28003
+ "\u5C06\u65E5\u671F\u8303\u56F4\u7559\u7A7A\u4EE5\u4F7F\u7528\u5E38\u89C4\u5750\u6807\u8F74\u3002"
28004
+ ],
28005
+ Time: ["Heure", "Zeit", "Hora", "\u65F6\u95F4"],
28006
+ "First Page Header:": [
28007
+ "En-t\xEAte de premi\xE8re page :",
28008
+ "Kopfzeile der ersten Seite:",
28009
+ "Encabezado de primera p\xE1gina:",
28010
+ "\u9996\u9875\u9875\u7709\uFF1A"
28011
+ ],
28012
+ "First Page Footer:": [
28013
+ "Pied de premi\xE8re page :",
28014
+ "Fu\xDFzeile der ersten Seite:",
28015
+ "Pie de primera p\xE1gina:",
28016
+ "\u9996\u9875\u9875\u811A\uFF1A"
28017
+ ],
28018
+ "Even Page Header:": [
28019
+ "En-t\xEAte des pages paires :",
28020
+ "Kopfzeile gerader Seiten:",
28021
+ "Encabezado de p\xE1ginas pares:",
28022
+ "\u5076\u6570\u9875\u9875\u7709\uFF1A"
28023
+ ],
28024
+ "Even Page Footer:": [
28025
+ "Pied des pages paires :",
28026
+ "Fu\xDFzeile gerader Seiten:",
28027
+ "Pie de p\xE1ginas pares:",
28028
+ "\u5076\u6570\u9875\u9875\u811A\uFF1A"
28029
+ ],
28030
+ "Different first page": [
28031
+ "Premi\xE8re page diff\xE9rente",
28032
+ "Erste Seite anders",
28033
+ "Primera p\xE1gina diferente",
28034
+ "\u9996\u9875\u4E0D\u540C"
28035
+ ],
28036
+ "Different odd and even pages": [
28037
+ "Pages paires et impaires diff\xE9rentes",
28038
+ "Gerade und ungerade Seiten unterschiedlich",
28039
+ "P\xE1ginas pares e impares diferentes",
28040
+ "\u5947\u5076\u9875\u4E0D\u540C"
28041
+ ],
28042
+ "Scale header and footer with document": [
28043
+ "Mettre l\u2019en-t\xEAte et le pied \xE0 l\u2019\xE9chelle du document",
28044
+ "Kopf- und Fu\xDFzeile mit Dokument skalieren",
28045
+ "Escalar encabezado y pie con el documento",
28046
+ "\u968F\u6587\u6863\u7F29\u653E\u9875\u7709\u548C\u9875\u811A"
28047
+ ],
28048
+ "Align header and footer with margins": [
28049
+ "Aligner l\u2019en-t\xEAte et le pied sur les marges",
28050
+ "Kopf- und Fu\xDFzeile an R\xE4ndern ausrichten",
28051
+ "Alinear encabezado y pie con los m\xE1rgenes",
28052
+ "\u5C06\u9875\u7709\u548C\u9875\u811A\u4E0E\u9875\u8FB9\u8DDD\u5BF9\u9F50"
28053
+ ],
28054
+ "Insert Field": ["Ins\xE9rer un champ", "Feld einf\xFCgen", "Insertar campo", "\u63D2\u5165\u5B57\u6BB5"],
28055
+ "Page Number": ["Num\xE9ro de page", "Seitenzahl", "N\xFAmero de p\xE1gina", "\u9875\u7801"],
28056
+ "Total Pages": ["Nombre de pages", "Gesamtseitenzahl", "Total de p\xE1ginas", "\u603B\u9875\u6570"],
28057
+ "Sheet Name": ["Nom de feuille", "Blattname", "Nombre de hoja", "\u5DE5\u4F5C\u8868\u540D\u79F0"],
28058
+ "File Name": ["Nom de fichier", "Dateiname", "Nombre de archivo", "\u6587\u4EF6\u540D"],
28059
+ "Rows to repeat at top": [
28060
+ "Lignes \xE0 r\xE9p\xE9ter en haut",
28061
+ "Wiederholungszeilen oben",
28062
+ "Filas a repetir arriba",
28063
+ "\u9876\u7AEF\u6807\u9898\u884C"
28064
+ ],
28065
+ "Columns to repeat at left": [
28066
+ "Colonnes \xE0 r\xE9p\xE9ter \xE0 gauche",
28067
+ "Wiederholungsspalten links",
28068
+ "Columnas a repetir a la izquierda",
28069
+ "\u5DE6\u7AEF\u6807\u9898\u5217"
28070
+ ],
28071
+ "Use first page number": [
28072
+ "Utiliser le premier num\xE9ro de page",
28073
+ "Erste Seitenzahl verwenden",
28074
+ "Usar primer n\xFAmero de p\xE1gina",
28075
+ "\u4F7F\u7528\u8D77\u59CB\u9875\u7801"
28076
+ ],
28077
+ "First page number": [
28078
+ "Premier num\xE9ro de page",
28079
+ "Erste Seitenzahl",
28080
+ "Primer n\xFAmero de p\xE1gina",
28081
+ "\u8D77\u59CB\u9875\u7801"
28082
+ ],
28083
+ "Enter a first page number between 0 and 32767.": [
28084
+ "Entrez un premier num\xE9ro entre 0 et 32767.",
28085
+ "Geben Sie eine erste Seitenzahl zwischen 0 und 32767 ein.",
28086
+ "Introduzca un primer n\xFAmero entre 0 y 32767.",
28087
+ "\u8BF7\u8F93\u5165 0 \u5230 32767 \u4E4B\u95F4\u7684\u8D77\u59CB\u9875\u7801\u3002"
28088
+ ],
28089
+ "Print titles must be whole rows or whole columns.": [
28090
+ "Les titres doivent \xEAtre des lignes ou colonnes enti\xE8res.",
28091
+ "Drucktitel m\xFCssen ganze Zeilen oder Spalten sein.",
28092
+ "Los t\xEDtulos deben ser filas o columnas completas.",
28093
+ "\u6253\u5370\u6807\u9898\u5FC5\u987B\u4E3A\u6574\u884C\u6216\u6574\u5217\u3002"
28094
+ ],
28095
+ "Existing print titles are unsupported. Changing a title range replaces them; leaving the fields unchanged preserves them.": [
28096
+ "Les titres existants ne sont pas pris en charge. Modifier une plage les remplace ; conserver les champs les pr\xE9serve.",
28097
+ "Vorhandene Drucktitel werden nicht unterst\xFCtzt. Eine Bereichs\xE4nderung ersetzt sie; unver\xE4nderte Felder bewahren sie.",
28098
+ "Los t\xEDtulos existentes no son compatibles. Cambiar un rango los reemplaza; dejar los campos sin cambios los conserva.",
28099
+ "\u4E0D\u652F\u6301\u73B0\u6709\u6253\u5370\u6807\u9898\u3002\u66F4\u6539\u6807\u9898\u533A\u57DF\u4F1A\u66FF\u6362\u5B83\u4EEC\uFF1B\u4FDD\u6301\u5B57\u6BB5\u4E0D\u53D8\u53EF\u4FDD\u7559\u5B83\u4EEC\u3002"
28100
+ ],
28101
+ "Use &L, &C and &R for sections. Fields: &P page, &N total pages, &A sheet, &F file, &D date, &T time. Use && for an ampersand. Unsupported formatting codes are preserved.": [
28102
+ "Utilisez &L, &C et &R pour les sections. Champs : &P page, &N total, &A feuille, &F fichier, &D date, &T heure. && affiche une esperluette. Les codes non pris en charge sont conserv\xE9s.",
28103
+ "Verwenden Sie &L, &C und &R f\xFCr Abschnitte. Felder: &P Seite, &N Gesamtseiten, &A Blatt, &F Datei, &D Datum, &T Zeit. && ergibt ein Und-Zeichen. Nicht unterst\xFCtzte Formatcodes bleiben erhalten.",
28104
+ "Use &L, &C y &R para secciones. Campos: &P p\xE1gina, &N total, &A hoja, &F archivo, &D fecha, &T hora. && muestra un ampersand. Se conservan los c\xF3digos no compatibles.",
28105
+ "\u4F7F\u7528 &L\u3001&C\u3001&R \u6307\u5B9A\u533A\u57DF\u3002\u5B57\u6BB5\uFF1A&P \u9875\u7801\u3001&N \u603B\u9875\u6570\u3001&A \u5DE5\u4F5C\u8868\u3001&F \u6587\u4EF6\u3001&D \u65E5\u671F\u3001&T \u65F6\u95F4\u3002&& \u8868\u793A &\u3002\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u683C\u5F0F\u4EE3\u7801\u3002"
28106
+ ],
28107
+ "Page order": ["Ordre des pages", "Seitenreihenfolge", "Orden de p\xE1ginas", "\u9875\u5E8F"],
28108
+ "Down, then over": [
28109
+ "Vers le bas, puis \xE0 droite",
28110
+ "Nach unten, dann nach rechts",
28111
+ "Hacia abajo, luego a la derecha",
28112
+ "\u5148\u5411\u4E0B\uFF0C\u518D\u5411\u53F3"
28113
+ ],
28114
+ "Over, then down": [
28115
+ "\xC0 droite, puis vers le bas",
28116
+ "Nach rechts, dann nach unten",
28117
+ "A la derecha, luego hacia abajo",
28118
+ "\u5148\u5411\u53F3\uFF0C\u518D\u5411\u4E0B"
28119
+ ],
26617
28120
  // Insert Chart
26618
28121
  "Insert Chart": ["Ins\xE9rer un graphique", "Diagramm einf\xFCgen", "Insertar gr\xE1fico", "\u63D2\u5165\u56FE\u8868"],
26619
28122
  "Change Chart Type": [
@@ -27082,6 +28585,595 @@ var TOOLS_STRINGS = {
27082
28585
  ]
27083
28586
  };
27084
28587
 
28588
+ // xlsx/ui/commands/i18n/sparklines.ts
28589
+ var SPARKLINE_STRINGS = {
28590
+ Mixed: ["Mixte", "Gemischt", "Mixto", "\u6DF7\u5408"],
28591
+ "Only changed settings are applied.": [
28592
+ "Seuls les param\xE8tres modifi\xE9s sont appliqu\xE9s.",
28593
+ "Nur ge\xE4nderte Einstellungen werden angewendet.",
28594
+ "Solo se aplica la configuraci\xF3n modificada.",
28595
+ "\u4EC5\u5E94\u7528\u5DF2\u66F4\u6539\u7684\u8BBE\u7F6E\u3002"
28596
+ ],
28597
+ "Colors vary between selected groups.": [
28598
+ "Les couleurs varient entre les groupes s\xE9lectionn\xE9s.",
28599
+ "Die Farben der ausgew\xE4hlten Gruppen unterscheiden sich.",
28600
+ "Los colores var\xEDan entre los grupos seleccionados.",
28601
+ "\u9009\u5B9A\u7EC4\u7684\u989C\u8272\u4E0D\u540C\u3002"
28602
+ ],
28603
+ Markers: ["Marqueurs", "Markierungen", "Marcadores", "\u6807\u8BB0"],
28604
+ Gaps: ["Espaces", "L\xFCcken", "Huecos", "\u95F4\u9699"],
28605
+ Zero: ["Z\xE9ro", "Null", "Cero", "\u96F6"],
28606
+ Axis: ["Axe", "Achse", "Eje", "\u5750\u6807\u8F74"],
28607
+ "Sparklines (create, format and clear)": [
28608
+ "Graphiques sparkline (cr\xE9er, mettre en forme et effacer)",
28609
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
28610
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
28611
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u8BBE\u7F6E\u683C\u5F0F\u548C\u6E05\u9664\uFF09"
28612
+ ],
28613
+ "Charts and sparklines support editing; pivot tables, macros and other unsupported parts are kept in the file but not shown.": [
28614
+ "Les graphiques et graphiques sparkline peuvent \xEAtre modifi\xE9s ; les tableaux crois\xE9s dynamiques, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s dans le fichier mais ne sont pas affich\xE9s.",
28615
+ "Diagramme und Sparklines k\xF6nnen bearbeitet werden; Pivot-Tabellen, Makros und andere nicht unterst\xFCtzte Teile bleiben in der Datei erhalten, werden aber nicht angezeigt.",
28616
+ "Los gr\xE1ficos y minigr\xE1ficos se pueden editar; las tablas din\xE1micas, macros y otras partes no compatibles se conservan en el archivo pero no se muestran.",
28617
+ "\u56FE\u8868\u548C\u8FF7\u4F60\u56FE\u652F\u6301\u7F16\u8F91\uFF1B\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u90E8\u5206\u4FDD\u5B58\u5728\u6587\u4EF6\u4E2D\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28618
+ ],
28619
+ Sparklines: ["Graphiques sparkline", "Sparklines", "Minigr\xE1ficos", "\u8FF7\u4F60\u56FE"],
28620
+ "Line Sparkline": [
28621
+ "Sparkline en courbe",
28622
+ "Linien-Sparkline",
28623
+ "Minigr\xE1fico de l\xEDnea",
28624
+ "\u6298\u7EBF\u8FF7\u4F60\u56FE"
28625
+ ],
28626
+ "Column Sparkline": [
28627
+ "Sparkline en colonnes",
28628
+ "S\xE4ulen-Sparkline",
28629
+ "Minigr\xE1fico de columna",
28630
+ "\u67F1\u5F62\u8FF7\u4F60\u56FE"
28631
+ ],
28632
+ "Win/Loss Sparkline": [
28633
+ "Sparkline gains/pertes",
28634
+ "Gewinn/Verlust-Sparkline",
28635
+ "Minigr\xE1fico de ganancias y p\xE9rdidas",
28636
+ "\u76C8\u4E8F\u8FF7\u4F60\u56FE"
28637
+ ],
28638
+ "Win/Loss": ["Gains/pertes", "Gewinn/Verlust", "Ganancias y p\xE9rdidas", "\u76C8\u4E8F"],
28639
+ "Create Sparklines": [
28640
+ "Cr\xE9er des graphiques sparkline",
28641
+ "Sparklines erstellen",
28642
+ "Crear minigr\xE1ficos",
28643
+ "\u521B\u5EFA\u8FF7\u4F60\u56FE"
28644
+ ],
28645
+ "Sparkline Settings": [
28646
+ "Param\xE8tres des graphiques sparkline",
28647
+ "Sparkline-Einstellungen",
28648
+ "Configuraci\xF3n de minigr\xE1ficos",
28649
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E"
28650
+ ],
28651
+ "Data Range:": ["Plage de donn\xE9es :", "Datenbereich:", "Rango de datos:", "\u6570\u636E\u8303\u56F4\uFF1A"],
28652
+ "Location Range:": [
28653
+ "Plage d\u2019emplacement :",
28654
+ "Positionsbereich:",
28655
+ "Rango de ubicaci\xF3n:",
28656
+ "\u4F4D\u7F6E\u8303\u56F4\uFF1A"
28657
+ ],
28658
+ "Sparkline Type:": [
28659
+ "Type de sparkline :",
28660
+ "Sparkline-Typ:",
28661
+ "Tipo de minigr\xE1fico:",
28662
+ "\u8FF7\u4F60\u56FE\u7C7B\u578B\uFF1A"
28663
+ ],
28664
+ "Line Weight:": ["\xC9paisseur du trait :", "Linienst\xE4rke:", "Grosor de l\xEDnea:", "\u7EBF\u6761\u7C97\u7EC6\uFF1A"],
28665
+ "Changes apply to the entire selected sparkline groups.": [
28666
+ "Les modifications s\u2019appliquent \xE0 tous les groupes de graphiques sparkline s\xE9lectionn\xE9s.",
28667
+ "\xC4nderungen gelten f\xFCr die gesamten ausgew\xE4hlten Sparkline-Gruppen.",
28668
+ "Los cambios se aplican a todos los grupos de minigr\xE1ficos seleccionados.",
28669
+ "\u66F4\u6539\u5E94\u7528\u4E8E\u6574\u4E2A\u9009\u5B9A\u7684\u8FF7\u4F60\u56FE\u7EC4\u3002"
28670
+ ],
28671
+ "High Point": ["Point haut", "H\xF6chstpunkt", "Punto alto", "\u9AD8\u70B9"],
28672
+ "Low Point": ["Point bas", "Tiefstpunkt", "Punto bajo", "\u4F4E\u70B9"],
28673
+ "First Point": ["Premier point", "Erster Punkt", "Primer punto", "\u9996\u70B9"],
28674
+ "Last Point": ["Dernier point", "Letzter Punkt", "\xDAltimo punto", "\u672B\u70B9"],
28675
+ "Negative Points": ["Points n\xE9gatifs", "Negative Punkte", "Puntos negativos", "\u8D1F\u503C\u70B9"],
28676
+ "Sparkline Color:": [
28677
+ "Couleur du sparkline :",
28678
+ "Sparkline-Farbe:",
28679
+ "Color del minigr\xE1fico:",
28680
+ "\u8FF7\u4F60\u56FE\u989C\u8272\uFF1A"
28681
+ ],
28682
+ "Negative Color:": [
28683
+ "Couleur n\xE9gative :",
28684
+ "Farbe f\xFCr negative Werte:",
28685
+ "Color negativo:",
28686
+ "\u8D1F\u503C\u989C\u8272\uFF1A"
28687
+ ],
28688
+ "Minimum Axis:": ["Axe minimum :", "Achsenminimum:", "Eje m\xEDnimo:", "\u6700\u5C0F\u5750\u6807\u8F74\uFF1A"],
28689
+ "Maximum Axis:": ["Axe maximum :", "Achsenmaximum:", "Eje m\xE1ximo:", "\u6700\u5927\u5750\u6807\u8F74\uFF1A"],
28690
+ "Minimum Value:": ["Valeur minimum :", "Mindestwert:", "Valor m\xEDnimo:", "\u6700\u5C0F\u503C\uFF1A"],
28691
+ "Maximum Value:": ["Valeur maximum :", "H\xF6chstwert:", "Valor m\xE1ximo:", "\u6700\u5927\u503C\uFF1A"],
28692
+ Individual: ["Individuel", "Individuell", "Individual", "\u5355\u72EC"],
28693
+ "Same for all sparklines": [
28694
+ "Identique pour tous les graphiques sparkline",
28695
+ "F\xFCr alle Sparklines gleich",
28696
+ "Igual para todos los minigr\xE1ficos",
28697
+ "\u6240\u6709\u8FF7\u4F60\u56FE\u76F8\u540C"
28698
+ ],
28699
+ "Empty Cells:": ["Cellules vides :", "Leere Zellen:", "Celdas vac\xEDas:", "\u7A7A\u5355\u5143\u683C\uFF1A"],
28700
+ "Connect data points": [
28701
+ "Relier les points de donn\xE9es",
28702
+ "Datenpunkte verbinden",
28703
+ "Conectar puntos de datos",
28704
+ "\u8FDE\u63A5\u6570\u636E\u70B9"
28705
+ ],
28706
+ "Show data in hidden rows and columns": [
28707
+ "Afficher les donn\xE9es des lignes et colonnes masqu\xE9es",
28708
+ "Daten in ausgeblendeten Zeilen und Spalten anzeigen",
28709
+ "Mostrar datos en filas y columnas ocultas",
28710
+ "\u663E\u793A\u9690\u85CF\u884C\u548C\u5217\u4E2D\u7684\u6570\u636E"
28711
+ ],
28712
+ "Show horizontal axis": [
28713
+ "Afficher l\u2019axe horizontal",
28714
+ "Horizontale Achse anzeigen",
28715
+ "Mostrar eje horizontal",
28716
+ "\u663E\u793A\u6C34\u5E73\u5750\u6807\u8F74"
28717
+ ],
28718
+ "Plot right to left": [
28719
+ "Tracer de droite \xE0 gauche",
28720
+ "Von rechts nach links zeichnen",
28721
+ "Trazar de derecha a izquierda",
28722
+ "\u4ECE\u53F3\u5411\u5DE6\u7ED8\u5236"
28723
+ ],
28724
+ "Clear Sparklines": [
28725
+ "Effacer les graphiques sparkline",
28726
+ "Sparklines l\xF6schen",
28727
+ "Borrar minigr\xE1ficos",
28728
+ "\u6E05\u9664\u8FF7\u4F60\u56FE"
28729
+ ],
28730
+ "Clear Selected Sparklines": [
28731
+ "Effacer les graphiques sparkline s\xE9lectionn\xE9s",
28732
+ "Ausgew\xE4hlte Sparklines l\xF6schen",
28733
+ "Borrar minigr\xE1ficos seleccionados",
28734
+ "\u6E05\u9664\u9009\u5B9A\u8FF7\u4F60\u56FE"
28735
+ ],
28736
+ "Clear Sparkline Groups": [
28737
+ "Effacer les groupes de graphiques sparkline",
28738
+ "Sparkline-Gruppen l\xF6schen",
28739
+ "Borrar grupos de minigr\xE1ficos",
28740
+ "\u6E05\u9664\u8FF7\u4F60\u56FE\u7EC4"
28741
+ ],
28742
+ "The data range and location range do not match.": [
28743
+ "La plage de donn\xE9es et la plage d\u2019emplacement ne correspondent pas.",
28744
+ "Datenbereich und Positionsbereich stimmen nicht \xFCberein.",
28745
+ "El rango de datos y el rango de ubicaci\xF3n no coinciden.",
28746
+ "\u6570\u636E\u8303\u56F4\u548C\u4F4D\u7F6E\u8303\u56F4\u4E0D\u5339\u914D\u3002"
28747
+ ],
28748
+ "The sparkline location range is too large.": [
28749
+ "La plage d\u2019emplacement des graphiques sparkline est trop grande.",
28750
+ "Der Sparkline-Positionsbereich ist zu gro\xDF.",
28751
+ "El rango de ubicaci\xF3n del minigr\xE1fico es demasiado grande.",
28752
+ "\u8FF7\u4F60\u56FE\u4F4D\u7F6E\u8303\u56F4\u8FC7\u5927\u3002"
28753
+ ],
28754
+ "The location range already contains sparklines.": [
28755
+ "La plage d\u2019emplacement contient d\xE9j\xE0 des graphiques sparkline.",
28756
+ "Der Positionsbereich enth\xE4lt bereits Sparklines.",
28757
+ "El rango de ubicaci\xF3n ya contiene minigr\xE1ficos.",
28758
+ "\u4F4D\u7F6E\u8303\u56F4\u5DF2\u5305\u542B\u8FF7\u4F60\u56FE\u3002"
28759
+ ],
28760
+ "Sparklines cannot be created in merged cells.": [
28761
+ "Impossible de cr\xE9er des graphiques sparkline dans des cellules fusionn\xE9es.",
28762
+ "Sparklines k\xF6nnen nicht in verbundenen Zellen erstellt werden.",
28763
+ "No se pueden crear minigr\xE1ficos en celdas combinadas.",
28764
+ "\u65E0\u6CD5\u5728\u5408\u5E76\u5355\u5143\u683C\u4E2D\u521B\u5EFA\u8FF7\u4F60\u56FE\u3002"
28765
+ ],
28766
+ "The sparkline settings are not valid.": [
28767
+ "Les param\xE8tres des graphiques sparkline ne sont pas valides.",
28768
+ "Die Sparkline-Einstellungen sind ung\xFCltig.",
28769
+ "La configuraci\xF3n del minigr\xE1fico no es v\xE1lida.",
28770
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E\u65E0\u6548\u3002"
28771
+ ],
28772
+ "The sparkline axis limits are not valid.": [
28773
+ "Les limites d\u2019axe des graphiques sparkline ne sont pas valides.",
28774
+ "Die Sparkline-Achsengrenzen sind ung\xFCltig.",
28775
+ "Los l\xEDmites del eje del minigr\xE1fico no son v\xE1lidos.",
28776
+ "\u8FF7\u4F60\u56FE\u5750\u6807\u8F74\u754C\u9650\u65E0\u6548\u3002"
28777
+ ]
28778
+ };
28779
+
28780
+ // xlsx/ui/commands/i18n/pivots.ts
28781
+ var PIVOT_STRINGS = {
28782
+ "Before row fields": [
28783
+ "Avant les champs de ligne",
28784
+ "Vor den Zeilenfeldern",
28785
+ "Antes de los campos de fila",
28786
+ "\u884C\u5B57\u6BB5\u4E4B\u524D"
28787
+ ],
28788
+ "Values are listed before the row fields.": [
28789
+ "Les valeurs sont affich\xE9es avant les champs de ligne.",
28790
+ "Werte werden vor den Zeilenfeldern aufgef\xFChrt.",
28791
+ "Los valores aparecen antes de los campos de fila.",
28792
+ "\u503C\u5217\u5728\u884C\u5B57\u6BB5\u4E4B\u524D\u3002"
28793
+ ],
28794
+ "Values Placement:": [
28795
+ "Position des valeurs :",
28796
+ "Anordnung der Werte:",
28797
+ "Posici\xF3n de los valores:",
28798
+ "\u503C\u4F4D\u7F6E\uFF1A"
28799
+ ],
28800
+ "After row fields": [
28801
+ "Apr\xE8s les champs de ligne",
28802
+ "Nach den Zeilenfeldern",
28803
+ "Despu\xE9s de los campos de fila",
28804
+ "\u884C\u5B57\u6BB5\u4E4B\u540E"
28805
+ ],
28806
+ "Between row fields": [
28807
+ "Entre les champs de ligne",
28808
+ "Zwischen den Zeilenfeldern",
28809
+ "Entre los campos de fila",
28810
+ "\u884C\u5B57\u6BB5\u4E4B\u95F4"
28811
+ ],
28812
+ "Values are listed between the row fields.": [
28813
+ "Les valeurs sont affich\xE9es entre les champs de ligne.",
28814
+ "Werte werden zwischen den Zeilenfeldern aufgef\xFChrt.",
28815
+ "Los valores aparecen entre los campos de fila.",
28816
+ "\u503C\u5217\u5728\u884C\u5B57\u6BB5\u4E4B\u95F4\u3002"
28817
+ ],
28818
+ "Values Axis:": ["Axe des valeurs :", "Werteachse:", "Eje de valores:", "\u503C\u8F74\uFF1A"],
28819
+ "Values on Columns": [
28820
+ "Valeurs en colonnes",
28821
+ "Werte in Spalten",
28822
+ "Valores en columnas",
28823
+ "\u503C\u663E\u793A\u5728\u5217\u4E0A"
28824
+ ],
28825
+ "Values on Rows": ["Valeurs en lignes", "Werte in Zeilen", "Valores en filas", "\u503C\u663E\u793A\u5728\u884C\u4E0A"],
28826
+ "Values are listed after the row fields.": [
28827
+ "Les valeurs sont affich\xE9es apr\xE8s les champs de ligne.",
28828
+ "Werte werden nach den Zeilenfeldern aufgef\xFChrt.",
28829
+ "Los valores aparecen despu\xE9s de los campos de fila.",
28830
+ "\u503C\u5217\u5728\u884C\u5B57\u6BB5\u4E4B\u540E\u3002"
28831
+ ],
28832
+ "Values on rows display subtotals below groups.": [
28833
+ "Les valeurs en lignes affichent les sous-totaux sous les groupes.",
28834
+ "Werte in Zeilen zeigen Teilergebnisse unter den Gruppen an.",
28835
+ "Los valores en filas muestran los subtotales debajo de los grupos.",
28836
+ "\u884C\u4E0A\u7684\u503C\u5C06\u5206\u7C7B\u6C47\u603B\u663E\u793A\u5728\u7EC4\u4E0B\u65B9\u3002"
28837
+ ],
28838
+ "Multiple value fields use Values on columns.": [
28839
+ "Plusieurs champs de valeur utilisent les valeurs en colonnes.",
28840
+ "Mehrere Wertfelder verwenden Werte in Spalten.",
28841
+ "Varios campos de valor usan Valores en columnas.",
28842
+ "\u591A\u4E2A\u503C\u5B57\u6BB5\u7684\u503C\u4F4D\u4E8E\u5217\u8F74\u4E0A\u3002"
28843
+ ],
28844
+ "Add Value Field": [
28845
+ "Ajouter un champ de valeur",
28846
+ "Wertfeld hinzuf\xFCgen",
28847
+ "A\xF1adir campo de valor",
28848
+ "\u6DFB\u52A0\u503C\u5B57\u6BB5"
28849
+ ],
28850
+ "Remove Value Field": [
28851
+ "Supprimer le champ de valeur",
28852
+ "Wertfeld entfernen",
28853
+ "Quitar campo de valor",
28854
+ "\u5220\u9664\u503C\u5B57\u6BB5"
28855
+ ],
28856
+ "Additional Value Field": [
28857
+ "Champ de valeur suppl\xE9mentaire",
28858
+ "Zus\xE4tzliches Wertfeld",
28859
+ "Campo de valor adicional",
28860
+ "\u9644\u52A0\u503C\u5B57\u6BB5"
28861
+ ],
28862
+ "Value Caption:": ["Libell\xE9 de valeur :", "Wertbeschriftung:", "T\xEDtulo del valor:", "\u503C\u6807\u9898\uFF1A"],
28863
+ "Multiple value fields use tabular layout with Values on columns.": [
28864
+ "Plusieurs champs de valeur utilisent la forme tabulaire avec les valeurs en colonnes.",
28865
+ "Mehrere Wertfelder verwenden das Tabellenformat mit Werten in Spalten.",
28866
+ "Varios campos de valor usan el formato tabular con Valores en columnas.",
28867
+ "\u591A\u4E2A\u503C\u5B57\u6BB5\u4F7F\u7528\u8868\u683C\u5E03\u5C40\uFF0C\u503C\u4F4D\u4E8E\u5217\u8F74\u4E0A\u3002"
28868
+ ],
28869
+ "Compact Form": ["Forme compacte", "Kompaktformat", "Formato compacto", "\u538B\u7F29\u5F62\u5F0F"],
28870
+ "Outline Form": ["Forme de plan", "Gliederungsformat", "Formato de esquema", "\u5927\u7EB2\u5F62\u5F0F"],
28871
+ "Tabular Form": ["Forme tabulaire", "Tabellenformat", "Formato tabular", "\u8868\u683C\u5F62\u5F0F"],
28872
+ "Report Layout:": [
28873
+ "Disposition du rapport :",
28874
+ "Berichtslayout:",
28875
+ "Dise\xF1o del informe:",
28876
+ "\u62A5\u8868\u5E03\u5C40\uFF1A"
28877
+ ],
28878
+ "Subtotal Position:": [
28879
+ "Position des sous-totaux :",
28880
+ "Position der Teilergebnisse:",
28881
+ "Posici\xF3n de subtotales:",
28882
+ "\u5206\u7C7B\u6C47\u603B\u4F4D\u7F6E\uFF1A"
28883
+ ],
28884
+ "Above each group": [
28885
+ "Au-dessus de chaque groupe",
28886
+ "\xDCber jeder Gruppe",
28887
+ "Encima de cada grupo",
28888
+ "\u6BCF\u7EC4\u4E0A\u65B9"
28889
+ ],
28890
+ "Below each group": [
28891
+ "Sous chaque groupe",
28892
+ "Unter jeder Gruppe",
28893
+ "Debajo de cada grupo",
28894
+ "\u6BCF\u7EC4\u4E0B\u65B9"
28895
+ ],
28896
+ "Show subtotals": [
28897
+ "Afficher les sous-totaux",
28898
+ "Teilergebnisse anzeigen",
28899
+ "Mostrar subtotales",
28900
+ "\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28901
+ ],
28902
+ "Tabular layout displays subtotals below groups.": [
28903
+ "La disposition tabulaire affiche les sous-totaux sous les groupes.",
28904
+ "Das tabellarische Layout zeigt Teilergebnisse unter den Gruppen.",
28905
+ "El dise\xF1o tabular muestra subtotales debajo de los grupos.",
28906
+ "\u8868\u683C\u5E03\u5C40\u5728\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B\u3002"
28907
+ ],
28908
+ "Second Row Field:": [
28909
+ "Deuxi\xE8me champ de ligne :",
28910
+ "Zweites Zeilenfeld:",
28911
+ "Segundo campo de fila:",
28912
+ "\u7B2C\u4E8C\u884C\u5B57\u6BB5\uFF1A"
28913
+ ],
28914
+ "Show subtotals below each group": [
28915
+ "Afficher les sous-totaux sous chaque groupe",
28916
+ "Teilergebnisse unter jeder Gruppe anzeigen",
28917
+ "Mostrar subtotales debajo de cada grupo",
28918
+ "\u5728\u6BCF\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28919
+ ],
28920
+ "Repeat row labels": [
28921
+ "R\xE9p\xE9ter les \xE9tiquettes de ligne",
28922
+ "Zeilenbeschriftungen wiederholen",
28923
+ "Repetir etiquetas de fila",
28924
+ "\u91CD\u590D\u884C\u6807\u7B7E"
28925
+ ],
28926
+ "Charts, sparklines and worksheet-range PivotTables support editing. Advanced PivotTables, macros and other unsupported parts are preserved.": [
28927
+ "Les graphiques, graphiques sparkline et tableaux crois\xE9s dynamiques de plages prennent en charge la modification. Les tableaux avanc\xE9s, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s.",
28928
+ "Diagramme, Sparklines und PivotTables aus Arbeitsblattbereichen k\xF6nnen bearbeitet werden. Erweiterte PivotTables, Makros und andere nicht unterst\xFCtzte Teile bleiben erhalten.",
28929
+ "Los gr\xE1ficos, minigr\xE1ficos y tablas din\xE1micas de rangos admiten edici\xF3n. Se conservan las tablas avanzadas, macros y otros elementos no compatibles.",
28930
+ "\u652F\u6301\u7F16\u8F91\u56FE\u8868\u3001\u8FF7\u4F60\u56FE\u548C\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\u3002\u4FDD\u7559\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u5185\u5BB9\u3002"
28931
+ ],
28932
+ PivotTable: ["Tableau crois\xE9 dynamique", "PivotTable", "Tabla din\xE1mica", "\u6570\u636E\u900F\u89C6\u8868"],
28933
+ "Create PivotTable": [
28934
+ "Cr\xE9er un tableau crois\xE9 dynamique",
28935
+ "PivotTable erstellen",
28936
+ "Crear tabla din\xE1mica",
28937
+ "\u521B\u5EFA\u6570\u636E\u900F\u89C6\u8868"
28938
+ ],
28939
+ "PivotTable Settings": [
28940
+ "Param\xE8tres du tableau crois\xE9 dynamique",
28941
+ "PivotTable-Einstellungen",
28942
+ "Configuraci\xF3n de tabla din\xE1mica",
28943
+ "\u6570\u636E\u900F\u89C6\u8868\u8BBE\u7F6E"
28944
+ ],
28945
+ "Refresh PivotTable": [
28946
+ "Actualiser le tableau crois\xE9 dynamique",
28947
+ "PivotTable aktualisieren",
28948
+ "Actualizar tabla din\xE1mica",
28949
+ "\u5237\u65B0\u6570\u636E\u900F\u89C6\u8868"
28950
+ ],
28951
+ "Delete PivotTable": [
28952
+ "Supprimer le tableau crois\xE9 dynamique",
28953
+ "PivotTable l\xF6schen",
28954
+ "Eliminar tabla din\xE1mica",
28955
+ "\u5220\u9664\u6570\u636E\u900F\u89C6\u8868"
28956
+ ],
28957
+ "Source Range:": ["Plage source :", "Quellbereich:", "Rango de origen:", "\u6E90\u533A\u57DF\uFF1A"],
28958
+ "Destination Cell:": [
28959
+ "Cellule de destination :",
28960
+ "Zielzelle:",
28961
+ "Celda de destino:",
28962
+ "\u76EE\u6807\u5355\u5143\u683C\uFF1A"
28963
+ ],
28964
+ "Row Field:": ["Champ de ligne :", "Zeilenfeld:", "Campo de fila:", "\u884C\u5B57\u6BB5\uFF1A"],
28965
+ "Column Field:": ["Champ de colonne :", "Spaltenfeld:", "Campo de columna:", "\u5217\u5B57\u6BB5\uFF1A"],
28966
+ "Value Field:": ["Champ de valeur :", "Wertfeld:", "Campo de valor:", "\u503C\u5B57\u6BB5\uFF1A"],
28967
+ "Summarize Values By:": [
28968
+ "Synth\xE9tiser les valeurs par :",
28969
+ "Werte zusammenfassen nach:",
28970
+ "Resumir valores por:",
28971
+ "\u503C\u6C47\u603B\u65B9\u5F0F\uFF1A"
28972
+ ],
28973
+ "(None)": ["(Aucun)", "(Keine)", "(Ninguno)", "\uFF08\u65E0\uFF09"]
28974
+ };
28975
+
28976
+ // xlsx/ui/commands/i18n/print-layout.ts
28977
+ var PRINT_LAYOUT_STRINGS = {
28978
+ "Unsupported header/footer codes are preserved but not rendered.": [
28979
+ "Les codes d\u2019en-t\xEAte et pied non pris en charge sont conserv\xE9s mais non rendus.",
28980
+ "Nicht unterst\xFCtzte Kopf- und Fu\xDFzeilencodes bleiben erhalten, werden aber nicht dargestellt.",
28981
+ "Se conservan los c\xF3digos no compatibles del encabezado y pie, pero no se muestran.",
28982
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u4EE3\u7801\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28983
+ ],
28984
+ "Browser printing includes page setup, manual breaks, leading print titles and header/footer fields. Drawings and unsupported formatting are preserved but not rendered.": [
28985
+ "L\u2019impression du navigateur inclut la mise en page, les sauts manuels, les titres en t\xEAte et les champs d\u2019en-t\xEAte et pied. Les dessins et formats non pris en charge sont conserv\xE9s mais non rendus.",
28986
+ "Der Browserdruck umfasst Seiteneinrichtung, manuelle Umbr\xFCche, f\xFChrende Drucktitel sowie Kopf- und Fu\xDFzeilenfelder. Zeichnungen und nicht unterst\xFCtzte Formatierung bleiben erhalten, werden aber nicht dargestellt.",
28987
+ "La impresi\xF3n del navegador incluye configuraci\xF3n de p\xE1gina, saltos manuales, t\xEDtulos iniciales y campos de encabezado y pie. Se conservan dibujos y formatos no compatibles, pero no se muestran.",
28988
+ "\u6D4F\u89C8\u5668\u6253\u5370\u5305\u542B\u9875\u9762\u8BBE\u7F6E\u3001\u624B\u52A8\u5206\u9875\u7B26\u3001\u8D77\u59CB\u6253\u5370\u6807\u9898\u548C\u9875\u7709\u9875\u811A\u5B57\u6BB5\u3002\u4FDD\u7559\u7ED8\u56FE\u548C\u4E0D\u652F\u6301\u7684\u683C\u5F0F\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28989
+ ],
28990
+ "Non-leading or unsupported print titles are preserved but not rendered.": [
28991
+ "Les titres non plac\xE9s en t\xEAte ou non pris en charge sont conserv\xE9s mais non rendus.",
28992
+ "Nicht f\xFChrende oder nicht unterst\xFCtzte Drucktitel bleiben erhalten, werden aber nicht dargestellt.",
28993
+ "Se conservan los t\xEDtulos no iniciales o no compatibles, pero no se muestran.",
28994
+ "\u4FDD\u7559\u975E\u8D77\u59CB\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28995
+ ],
28996
+ "Print title ranges are too large for preview.": [
28997
+ "Les plages de titres sont trop grandes pour l\u2019aper\xE7u.",
28998
+ "Die Drucktitelbereiche sind f\xFCr die Vorschau zu gro\xDF.",
28999
+ "Los rangos de t\xEDtulos son demasiado grandes para la vista previa.",
29000
+ "\u6253\u5370\u6807\u9898\u533A\u57DF\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\u3002"
29001
+ ],
29002
+ "Repeated titles leave no room for worksheet data.": [
29003
+ "Les titres r\xE9p\xE9t\xE9s ne laissent pas de place aux donn\xE9es.",
29004
+ "Wiederholte Titel lassen keinen Platz f\xFCr Arbeitsblattdaten.",
29005
+ "Los t\xEDtulos repetidos no dejan espacio para los datos.",
29006
+ "\u91CD\u590D\u6807\u9898\u672A\u7ED9\u5DE5\u4F5C\u8868\u6570\u636E\u7559\u51FA\u7A7A\u95F4\u3002"
29007
+ ],
29008
+ "Preview does not render drawings.": [
29009
+ "L\u2019aper\xE7u ne rend pas les dessins.",
29010
+ "Die Vorschau stellt Zeichnungen nicht dar.",
29011
+ "La vista previa no muestra dibujos.",
29012
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3002"
29013
+ ],
29014
+ "Unsupported header or footer formatting and image fields are preserved but not rendered.": [
29015
+ "Les formats et champs d\u2019image non pris en charge des en-t\xEAtes et pieds sont conserv\xE9s mais non rendus.",
29016
+ "Nicht unterst\xFCtzte Formatierungen und Bildfelder in Kopf- und Fu\xDFzeilen bleiben erhalten, werden aber nicht dargestellt.",
29017
+ "Se conservan los formatos y campos de imagen no compatibles del encabezado y pie, pero no se muestran.",
29018
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u683C\u5F0F\u53CA\u56FE\u50CF\u5B57\u6BB5\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
29019
+ ],
29020
+ "Merged print ranges are too large.": [
29021
+ "Les plages fusionn\xE9es \xE0 imprimer sont trop grandes.",
29022
+ "Die verbundenen Druckbereiche sind zu gro\xDF.",
29023
+ "Los rangos combinados de impresi\xF3n son demasiado grandes.",
29024
+ "\u5408\u5E76\u6253\u5370\u533A\u57DF\u8FC7\u5927\u3002"
29025
+ ],
29026
+ "Multiple or unsupported print areas are preserved; preview uses the worksheet used range.": [
29027
+ "Les zones d\u2019impression multiples ou non prises en charge sont conserv\xE9es ; l\u2019aper\xE7u utilise la plage utilis\xE9e de la feuille.",
29028
+ "Mehrere oder nicht unterst\xFCtzte Druckbereiche bleiben erhalten; die Vorschau verwendet den benutzten Arbeitsblattbereich.",
29029
+ "Se conservan las \xE1reas m\xFAltiples o no compatibles; la vista previa usa el rango utilizado de la hoja.",
29030
+ "\u4FDD\u7559\u591A\u4E2A\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u533A\u57DF\uFF1B\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5DF2\u7528\u533A\u57DF\u3002"
29031
+ ],
29032
+ "Previous Page": ["Page pr\xE9c\xE9dente", "Vorherige Seite", "P\xE1gina anterior", "\u4E0A\u4E00\u9875"],
29033
+ "Next Page": ["Page suivante", "N\xE4chste Seite", "P\xE1gina siguiente", "\u4E0B\u4E00\u9875"],
29034
+ "Actual Size": ["Taille r\xE9elle", "Tats\xE4chliche Gr\xF6\xDFe", "Tama\xF1o real", "\u5B9E\u9645\u5927\u5C0F"],
29035
+ "Fit Page": ["Ajuster \xE0 la page", "Seite einpassen", "Ajustar p\xE1gina", "\u9002\u5408\u9875\u9762"],
29036
+ "Page {page} of {count}": [
29037
+ "Page {page} sur {count}",
29038
+ "Seite {page} von {count}",
29039
+ "P\xE1gina {page} de {count}",
29040
+ "\u7B2C {page} \u9875\uFF0C\u5171 {count} \u9875"
29041
+ ],
29042
+ "Repeated print titles are preserved but not rendered in preview.": [
29043
+ "Les titres d\u2019impression r\xE9p\xE9t\xE9s sont conserv\xE9s mais non rendus dans l\u2019aper\xE7u.",
29044
+ "Wiederholte Drucktitel bleiben erhalten, werden aber in der Vorschau nicht dargestellt.",
29045
+ "Se conservan los t\xEDtulos repetidos, pero no se muestran en la vista previa.",
29046
+ "\u4FDD\u7559\u91CD\u590D\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u663E\u793A\u3002"
29047
+ ],
29048
+ "Merged cells crossing pages are rendered separately on each page.": [
29049
+ "Les cellules fusionn\xE9es sur plusieurs pages sont rendues s\xE9par\xE9ment sur chaque page.",
29050
+ "Seiten\xFCbergreifende verbundene Zellen werden auf jeder Seite getrennt dargestellt.",
29051
+ "Las celdas combinadas entre p\xE1ginas se muestran por separado en cada p\xE1gina.",
29052
+ "\u8DE8\u9875\u5408\u5E76\u5355\u5143\u683C\u5C06\u5728\u6BCF\u9875\u5206\u522B\u663E\u793A\u3002"
29053
+ ],
29054
+ "Browser printing uses paper size, margins, scaling and manual page breaks. Drawings, headers, footers and repeated titles are not rendered.": [
29055
+ "L\u2019impression du navigateur utilise le format du papier, les marges, l\u2019\xE9chelle et les sauts manuels. Les dessins, en-t\xEAtes, pieds de page et titres r\xE9p\xE9t\xE9s ne sont pas rendus.",
29056
+ "Der Browserdruck verwendet Papierformat, R\xE4nder, Skalierung und manuelle Seitenumbr\xFCche. Zeichnungen, Kopf- und Fu\xDFzeilen sowie wiederholte Titel werden nicht dargestellt.",
29057
+ "La impresi\xF3n del navegador usa tama\xF1o de papel, m\xE1rgenes, escala y saltos manuales. No muestra dibujos, encabezados, pies ni t\xEDtulos repetidos.",
29058
+ "\u6D4F\u89C8\u5668\u6253\u5370\u4F7F\u7528\u7EB8\u5F20\u5C3A\u5BF8\u3001\u8FB9\u8DDD\u3001\u7F29\u653E\u548C\u624B\u52A8\u5206\u9875\u7B26\u3002\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u3001\u9875\u811A\u6216\u91CD\u590D\u6807\u9898\u3002"
29059
+ ],
29060
+ "Print Preview": [
29061
+ "Aper\xE7u avant impression",
29062
+ "Druckvorschau",
29063
+ "Vista previa de impresi\xF3n",
29064
+ "\u6253\u5370\u9884\u89C8"
29065
+ ],
29066
+ Breaks: ["Sauts", "Umbr\xFCche", "Saltos", "\u5206\u9875\u7B26"],
29067
+ "Insert Row Page Break": [
29068
+ "Ins\xE9rer un saut de page de ligne",
29069
+ "Zeilen-Seitenumbruch einf\xFCgen",
29070
+ "Insertar salto de p\xE1gina de fila",
29071
+ "\u63D2\u5165\u884C\u5206\u9875\u7B26"
29072
+ ],
29073
+ "Insert Column Page Break": [
29074
+ "Ins\xE9rer un saut de page de colonne",
29075
+ "Spalten-Seitenumbruch einf\xFCgen",
29076
+ "Insertar salto de p\xE1gina de columna",
29077
+ "\u63D2\u5165\u5217\u5206\u9875\u7B26"
29078
+ ],
29079
+ "Remove Row Page Break": [
29080
+ "Supprimer le saut de page de ligne",
29081
+ "Zeilen-Seitenumbruch entfernen",
29082
+ "Quitar salto de p\xE1gina de fila",
29083
+ "\u5220\u9664\u884C\u5206\u9875\u7B26"
29084
+ ],
29085
+ "Remove Column Page Break": [
29086
+ "Supprimer le saut de page de colonne",
29087
+ "Spalten-Seitenumbruch entfernen",
29088
+ "Quitar salto de p\xE1gina de columna",
29089
+ "\u5220\u9664\u5217\u5206\u9875\u7B26"
29090
+ ],
29091
+ "Reset All Page Breaks": [
29092
+ "R\xE9initialiser tous les sauts de page",
29093
+ "Alle Seitenumbr\xFCche zur\xFCcksetzen",
29094
+ "Restablecer todos los saltos de p\xE1gina",
29095
+ "\u91CD\u7F6E\u6240\u6709\u5206\u9875\u7B26"
29096
+ ],
29097
+ "Pages: {count} | Scale: {scale}%": [
29098
+ "Pages : {count} | \xC9chelle : {scale}%",
29099
+ "Seiten: {count} | Skalierung: {scale}%",
29100
+ "P\xE1ginas: {count} | Escala: {scale}%",
29101
+ "\u9875\u6570\uFF1A{count} | \u7F29\u653E\uFF1A{scale}%"
29102
+ ],
29103
+ "Preview uses worksheet dimensions. Fonts and printer margins may change pagination in Excel.": [
29104
+ "L\u2019aper\xE7u utilise les dimensions de la feuille. Les polices et marges de l\u2019imprimante peuvent modifier la pagination dans Excel.",
29105
+ "Die Vorschau verwendet die Arbeitsblattma\xDFe. Schriftarten und Druckerr\xE4nder k\xF6nnen die Seitenaufteilung in Excel \xE4ndern.",
29106
+ "La vista previa usa las dimensiones de la hoja. Las fuentes y los m\xE1rgenes de impresora pueden cambiar la paginaci\xF3n en Excel.",
29107
+ "\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5C3A\u5BF8\u3002\u5B57\u4F53\u548C\u6253\u5370\u673A\u8FB9\u8DDD\u53EF\u80FD\u6539\u53D8 Excel \u4E2D\u7684\u5206\u9875\u3002"
29108
+ ],
29109
+ "Fit to pages ignores manual page breaks.": [
29110
+ "L\u2019ajustement aux pages ignore les sauts manuels.",
29111
+ "Beim Anpassen an Seiten werden manuelle Umbr\xFCche ignoriert.",
29112
+ "Ajustar a p\xE1ginas ignora los saltos manuales.",
29113
+ "\u8C03\u6574\u4E3A\u6307\u5B9A\u9875\u6570\u65F6\u5FFD\u7565\u624B\u52A8\u5206\u9875\u7B26\u3002"
29114
+ ],
29115
+ "Preview does not render drawings, headers or footers.": [
29116
+ "L\u2019aper\xE7u ne rend pas les dessins, en-t\xEAtes ou pieds de page.",
29117
+ "Die Vorschau stellt Zeichnungen, Kopf- und Fu\xDFzeilen nicht dar.",
29118
+ "La vista previa no muestra dibujos, encabezados ni pies de p\xE1gina.",
29119
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u6216\u9875\u811A\u3002"
29120
+ ],
29121
+ "Partial page breaks are preserved but not used in preview.": [
29122
+ "Les sauts de page partiels sont conserv\xE9s mais non utilis\xE9s dans l\u2019aper\xE7u.",
29123
+ "Teilweise Seitenumbr\xFCche bleiben erhalten, werden aber in der Vorschau nicht verwendet.",
29124
+ "Se conservan los saltos parciales, pero no se usan en la vista previa.",
29125
+ "\u4FDD\u7559\u5C40\u90E8\u5206\u9875\u7B26\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u4F7F\u7528\u3002"
29126
+ ],
29127
+ "This paper size is not supported in preview; Letter is used.": [
29128
+ "Ce format n\u2019est pas pris en charge dans l\u2019aper\xE7u ; Letter est utilis\xE9.",
29129
+ "Dieses Papierformat wird in der Vorschau nicht unterst\xFCtzt; Letter wird verwendet.",
29130
+ "Este tama\xF1o no se admite en la vista previa; se usa Carta.",
29131
+ "\u9884\u89C8\u4E0D\u652F\u6301\u6B64\u7EB8\u5F20\u5C3A\u5BF8\uFF0C\u4F7F\u7528 Letter\u3002"
29132
+ ],
29133
+ "The minimum scale prevents fitting the requested number of pages.": [
29134
+ "L\u2019\xE9chelle minimale emp\xEAche l\u2019ajustement au nombre de pages demand\xE9.",
29135
+ "Die minimale Skalierung verhindert die gew\xFCnschte Seitenanzahl.",
29136
+ "La escala m\xEDnima impide ajustar al n\xFAmero de p\xE1ginas solicitado.",
29137
+ "\u6700\u5C0F\u7F29\u653E\u6BD4\u4F8B\u65E0\u6CD5\u6EE1\u8DB3\u6307\u5B9A\u9875\u6570\u3002"
29138
+ ],
29139
+ "Rows or columns larger than a printed page are clipped.": [
29140
+ "Les lignes ou colonnes plus grandes qu\u2019une page sont rogn\xE9es.",
29141
+ "Zeilen oder Spalten, die gr\xF6\xDFer als eine Druckseite sind, werden abgeschnitten.",
29142
+ "Las filas o columnas mayores que una p\xE1gina se recortan.",
29143
+ "\u8D85\u8FC7\u6253\u5370\u9875\u9762\u5927\u5C0F\u7684\u884C\u6216\u5217\u5C06\u88AB\u88C1\u526A\u3002"
29144
+ ],
29145
+ "Margins do not fit the paper size.": [
29146
+ "Les marges ne correspondent pas au format du papier.",
29147
+ "Die R\xE4nder passen nicht zum Papierformat.",
29148
+ "Los m\xE1rgenes no caben en el tama\xF1o de papel.",
29149
+ "\u8FB9\u8DDD\u8D85\u51FA\u7EB8\u5F20\u5C3A\u5BF8\u3002"
29150
+ ],
29151
+ "Print preview supports at most one million cells.": [
29152
+ "L\u2019aper\xE7u prend en charge au maximum un million de cellules.",
29153
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens eine Million Zellen.",
29154
+ "La vista previa admite como m\xE1ximo un mill\xF3n de celdas.",
29155
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301\u4E00\u767E\u4E07\u4E2A\u5355\u5143\u683C\u3002"
29156
+ ],
29157
+ "Print preview supports at most 1000 pages.": [
29158
+ "L\u2019aper\xE7u prend en charge au maximum 1000 pages.",
29159
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens 1000 Seiten.",
29160
+ "La vista previa admite como m\xE1ximo 1000 p\xE1ginas.",
29161
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301 1000 \u9875\u3002"
29162
+ ],
29163
+ "Choose a row or column after the first to set a page break.": [
29164
+ "Choisissez une ligne ou colonne apr\xE8s la premi\xE8re pour d\xE9finir un saut de page.",
29165
+ "W\xE4hlen Sie eine Zeile oder Spalte nach der ersten f\xFCr einen Seitenumbruch.",
29166
+ "Elija una fila o columna despu\xE9s de la primera para establecer un salto.",
29167
+ "\u8BF7\u9009\u62E9\u7B2C\u4E00\u884C\u6216\u7B2C\u4E00\u5217\u4E4B\u540E\u7684\u4F4D\u7F6E\u8BBE\u7F6E\u5206\u9875\u7B26\u3002"
29168
+ ],
29169
+ "A worksheet can have at most 1026 manual breaks on each axis.": [
29170
+ "Une feuille peut contenir au maximum 1026 sauts manuels par axe.",
29171
+ "Ein Arbeitsblatt kann h\xF6chstens 1026 manuelle Umbr\xFCche pro Achse enthalten.",
29172
+ "Una hoja admite como m\xE1ximo 1026 saltos manuales por eje.",
29173
+ "\u5DE5\u4F5C\u8868\u6BCF\u4E2A\u65B9\u5411\u6700\u591A\u652F\u6301 1026 \u4E2A\u624B\u52A8\u5206\u9875\u7B26\u3002"
29174
+ ]
29175
+ };
29176
+
27085
29177
  // xlsx/ui/commands/i18n/types.ts
27086
29178
  var COLUMN = {
27087
29179
  fr: 0,
@@ -27107,7 +29199,10 @@ var COMMAND_TABLES = [
27107
29199
  FORMAT_CELLS_STRINGS,
27108
29200
  RULES_STRINGS,
27109
29201
  CORE_FEATURE_STRINGS,
27110
- CHART_SERIES_STRINGS
29202
+ CHART_SERIES_STRINGS,
29203
+ SPARKLINE_STRINGS,
29204
+ PIVOT_STRINGS,
29205
+ PRINT_LAYOUT_STRINGS
27111
29206
  ];
27112
29207
  var commandStrings = (locale) => flatten2(COMMAND_TABLES, locale);
27113
29208
 
@@ -29284,9 +31379,9 @@ function cellCommands() {
29284
31379
  ["format.hide-columns", "Hide Columns", "col", true],
29285
31380
  ["format.unhide-columns", "Unhide Columns", "col", false]
29286
31381
  ].map(
29287
- ([id, label2, axis, hidden]) => editing({
31382
+ ([id, label3, axis, hidden]) => editing({
29288
31383
  id,
29289
- label: label2,
31384
+ label: label3,
29290
31385
  icon: icon("hide"),
29291
31386
  lock: axis === "row" ? "formatRows" : "formatColumns",
29292
31387
  run: (ctx) => {
@@ -29325,47 +31420,47 @@ function cellCommands() {
29325
31420
  }
29326
31421
 
29327
31422
  // xlsx/ui/commands/cf-presets.ts
29328
- var argb = (hex2) => ({ rgb: `FF${hex2}` });
31423
+ var argb2 = (hex2) => ({ rgb: `FF${hex2}` });
29329
31424
  var HIGHLIGHT_STYLES = [
29330
31425
  [
29331
31426
  "lightRed",
29332
31427
  "Light Red Fill with Dark Red Text",
29333
31428
  {
29334
- font: { color: argb("9C0006") },
29335
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") }
31429
+ font: { color: argb2("9C0006") },
31430
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") }
29336
31431
  }
29337
31432
  ],
29338
31433
  [
29339
31434
  "yellow",
29340
31435
  "Yellow Fill with Dark Yellow Text",
29341
31436
  {
29342
- font: { color: argb("9C5700") },
29343
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFEB9C") }
31437
+ font: { color: argb2("9C5700") },
31438
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFEB9C") }
29344
31439
  }
29345
31440
  ],
29346
31441
  [
29347
31442
  "green",
29348
31443
  "Green Fill with Dark Green Text",
29349
31444
  {
29350
- font: { color: argb("006100") },
29351
- fill: { type: "pattern", pattern: "solid", bgColor: argb("C6EFCE") }
31445
+ font: { color: argb2("006100") },
31446
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("C6EFCE") }
29352
31447
  }
29353
31448
  ],
29354
31449
  [
29355
31450
  "lightRedFill",
29356
31451
  "Light Red Fill",
29357
- { fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") } }
31452
+ { fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") } }
29358
31453
  ],
29359
- ["redText", "Red Text", { font: { color: argb("9C0006") } }],
31454
+ ["redText", "Red Text", { font: { color: argb2("9C0006") } }],
29360
31455
  [
29361
31456
  "redBorder",
29362
31457
  "Red Border",
29363
31458
  {
29364
31459
  border: {
29365
- left: { style: "thin", color: argb("9C0006") },
29366
- right: { style: "thin", color: argb("9C0006") },
29367
- top: { style: "thin", color: argb("9C0006") },
29368
- bottom: { style: "thin", color: argb("9C0006") }
31460
+ left: { style: "thin", color: argb2("9C0006") },
31461
+ right: { style: "thin", color: argb2("9C0006") },
31462
+ top: { style: "thin", color: argb2("9C0006") },
31463
+ bottom: { style: "thin", color: argb2("9C0006") }
29369
31464
  }
29370
31465
  }
29371
31466
  ]
@@ -29422,13 +31517,13 @@ function dataBarRule(hex2) {
29422
31517
  type: "dataBar",
29423
31518
  min: { type: "min" },
29424
31519
  max: { type: "max" },
29425
- color: argb(hex2),
31520
+ color: argb2(hex2),
29426
31521
  priority: 1
29427
31522
  };
29428
31523
  }
29429
31524
  function colorScaleRule(colors) {
29430
31525
  const thresholds = colors.length === 3 ? [{ type: "min" }, { type: "percentile", value: "50" }, { type: "max" }] : [{ type: "min" }, { type: "max" }];
29431
- return { type: "colorScale", thresholds, colors: colors.map(argb), priority: 1 };
31526
+ return { type: "colorScale", thresholds, colors: colors.map(argb2), priority: 1 };
29432
31527
  }
29433
31528
  function iconSetRule(set) {
29434
31529
  return { type: "iconSet", iconSet: set, thresholds: iconThresholds(iconCount(set)), priority: 1 };
@@ -29598,10 +31693,10 @@ function activeChart(ctx) {
29598
31693
  const picked = t.ws.drawings[index2];
29599
31694
  return picked?.kind === "chart" ? { chart: picked, index: index2 } : void 0;
29600
31695
  }
29601
- function editChart(ctx, patch) {
31696
+ function editChart(ctx, patch2) {
29602
31697
  const t = target(ctx);
29603
31698
  const found = activeChart(ctx);
29604
- if (t && found) t.session.updateChart(t.sheet, found.index, patch(found.chart));
31699
+ if (t && found) t.session.updateChart(t.sheet, found.index, patch2(found.chart));
29605
31700
  }
29606
31701
  var TABLE_FLAGS = [
29607
31702
  ["showRowStripes", "table.banded-rows", "Banded Rows"],
@@ -29640,8 +31735,8 @@ function contextualCommands() {
29640
31735
  const t = target(ctx);
29641
31736
  const found = activeChart(ctx);
29642
31737
  if (!t || !found) return;
29643
- const patch = chartColorPalettePatch(found.chart, id);
29644
- if (patch) t.session.updateChart(t.sheet, found.index, patch);
31738
+ const patch2 = chartColorPalettePatch(found.chart, id);
31739
+ if (patch2) t.session.updateChart(t.sheet, found.index, patch2);
29645
31740
  }
29646
31741
  }),
29647
31742
  tableCmd({
@@ -29687,9 +31782,9 @@ function contextualCommands() {
29687
31782
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
29688
31783
  }),
29689
31784
  ...TABLE_FLAGS.map(
29690
- ([flag2, id, label2]) => tableCmd({
31785
+ ([flag2, id, label3]) => tableCmd({
29691
31786
  id,
29692
- label: label2,
31787
+ label: label3,
29693
31788
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
29694
31789
  run: (ctx) => {
29695
31790
  const t = target(ctx);
@@ -30072,9 +32167,9 @@ function fillDirection(ctx, dir) {
30072
32167
  function editingCommands() {
30073
32168
  return [
30074
32169
  ...AUTOSUM_FUNCTIONS.map(
30075
- ([fn, label2]) => editing({
32170
+ ([fn, label3]) => editing({
30076
32171
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
30077
- label: fn === "SUM" ? "AutoSum" : label2,
32172
+ label: fn === "SUM" ? "AutoSum" : label3,
30078
32173
  icon: icon("autoSum"),
30079
32174
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
30080
32175
  run: (ctx) => autoSum(ctx, fn)
@@ -30125,16 +32220,16 @@ function editingCommands() {
30125
32220
  ["comments", "Clear Comments and Notes"],
30126
32221
  ["hyperlinks", "Clear Hyperlinks"]
30127
32222
  ].map(
30128
- ([what, label2]) => editing({
32223
+ ([what, label3]) => editing({
30129
32224
  id: `home.clear-${what}`,
30130
- label: label2,
32225
+ label: label3,
30131
32226
  icon: icon("clear"),
30132
32227
  ...what === "formats" ? { lock: "formatCells" } : {},
30133
32228
  ...what === "contents" ? { shortcut: "Delete" } : {},
30134
32229
  run: (ctx) => {
30135
32230
  const t = target(ctx);
30136
32231
  if (!t) return;
30137
- t.session.batch(label2, () => {
32232
+ t.session.batch(label3, () => {
30138
32233
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
30139
32234
  });
30140
32235
  }
@@ -30175,9 +32270,9 @@ function editingCommands() {
30175
32270
  ["constants", "Constants"],
30176
32271
  ["validation", "Data Validation"]
30177
32272
  ].map(
30178
- ([kind, label2]) => viewing({
32273
+ ([kind, label3]) => viewing({
30179
32274
  id: `home.select-${kind}`,
30180
- label: label2,
32275
+ label: label3,
30181
32276
  icon: icon("findSelect"),
30182
32277
  run: (ctx) => {
30183
32278
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -30448,7 +32543,7 @@ function numberCommands() {
30448
32543
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
30449
32544
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
30450
32545
  ].map(
30451
- ([id, label2, format, shortcut]) => editing({ id, label: label2, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
32546
+ ([id, label3, format, shortcut]) => editing({ id, label: label3, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
30452
32547
  )
30453
32548
  ];
30454
32549
  }
@@ -30479,9 +32574,9 @@ var PAPER_SIZES = [
30479
32574
  [27, "Envelope DL"]
30480
32575
  ];
30481
32576
  var page = (ctx) => target(ctx)?.ws.pageSetup ?? {};
30482
- var setPage = (ctx, patch) => {
32577
+ var setPage = (ctx, patch2) => {
30483
32578
  const t = target(ctx);
30484
- if (t) t.session.setPageSetup(t.sheet, patch);
32579
+ if (t) t.session.setPageSetup(t.sheet, patch2);
30485
32580
  };
30486
32581
  function pageLayoutCommands() {
30487
32582
  return [
@@ -30614,6 +32709,43 @@ function pageLayoutCommands() {
30614
32709
  ];
30615
32710
  }
30616
32711
 
32712
+ // xlsx/ui/commands/page-breaks.ts
32713
+ function pageBreakCommands() {
32714
+ return [
32715
+ viewing({
32716
+ id: "page.preview",
32717
+ label: "Print Preview",
32718
+ icon: icon("pageSetup"),
32719
+ run: (ctx) => void ctx.dialogs.open("print-preview")
32720
+ }),
32721
+ ...["row", "col"].flatMap(
32722
+ (axis) => [true, false].map(
32723
+ (present) => editing({
32724
+ id: `page.break-${axis}-${present ? "insert" : "remove"}`,
32725
+ label: present ? axis === "row" ? "Insert Row Page Break" : "Insert Column Page Break" : axis === "row" ? "Remove Row Page Break" : "Remove Column Page Break",
32726
+ icon: icon("printArea"),
32727
+ lock: false,
32728
+ enabled: (ctx) => (target(ctx)?.active[axis] ?? 0) > 0,
32729
+ run: (ctx) => {
32730
+ const t = target(ctx);
32731
+ if (t) t.session.setPageBreak(t.sheet, axis, t.active[axis], present);
32732
+ }
32733
+ })
32734
+ )
32735
+ ),
32736
+ editing({
32737
+ id: "page.breaks-reset",
32738
+ label: "Reset All Page Breaks",
32739
+ icon: icon("printArea"),
32740
+ lock: false,
32741
+ run: (ctx) => {
32742
+ const t = target(ctx);
32743
+ if (t) t.session.resetPageBreaks(t.sheet);
32744
+ }
32745
+ })
32746
+ ];
32747
+ }
32748
+
30617
32749
  // xlsx/ui/commands/style-presets.ts
30618
32750
  var TABLE_STYLES = [
30619
32751
  ...Array.from({ length: 21 }, (_v, i2) => ({
@@ -30637,9 +32769,9 @@ function tableStyleColor(info, theme2) {
30637
32769
  if (slot === 0) return info.family === "Dark" ? "404040" : "808080";
30638
32770
  return theme2.colors[3 + slot] ?? "4472C4";
30639
32771
  }
30640
- var escapeAttr = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
32772
+ var escapeAttr2 = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
30641
32773
  function tableStylePreview(info, theme2) {
30642
- const c = `#${escapeAttr(tableStyleColor(info, theme2))}`;
32774
+ const c = `#${escapeAttr2(tableStyleColor(info, theme2))}`;
30643
32775
  const dark = info.family === "Dark";
30644
32776
  const header = info.family === "Light" ? "#ffffff" : c;
30645
32777
  const band = dark ? c : info.family === "Medium" ? `${c}55` : `${c}33`;
@@ -32312,13 +34444,13 @@ function searchCommands(ctx, query, isHidden) {
32312
34444
  const seen = /* @__PURE__ */ new Set();
32313
34445
  for (const command of ctx.commands.list()) {
32314
34446
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
32315
- const label2 = ctx.t(command.label).toLocaleLowerCase();
34447
+ const label3 = ctx.t(command.label).toLocaleLowerCase();
32316
34448
  const english = command.label.toLocaleLowerCase();
32317
- const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
34449
+ const haystack = `${label3} ${english} ${command.id.replace(/[.-]/g, " ")}`;
32318
34450
  if (!words2.every((word) => haystack.includes(word))) continue;
32319
- if (seen.has(label2)) continue;
32320
- seen.add(label2);
32321
- const score = label2.startsWith(words2[0]) ? 0 : label2.includes(words2[0]) ? 1 : 2;
34451
+ if (seen.has(label3)) continue;
34452
+ seen.add(label3);
34453
+ const score = label3.startsWith(words2[0]) ? 0 : label3.includes(words2[0]) ? 1 : 2;
32322
34454
  scored.push({ command, score });
32323
34455
  }
32324
34456
  return scored.sort(
@@ -32580,6 +34712,7 @@ exports.noteFunctionUse = noteFunctionUse;
32580
34712
  exports.numberCommands = numberCommands;
32581
34713
  exports.numberFormatOptions = numberFormatOptions;
32582
34714
  exports.onRibbonTabsChange = onRibbonTabsChange;
34715
+ exports.pageBreakCommands = pageBreakCommands;
32583
34716
  exports.pageLayoutCommands = pageLayoutCommands;
32584
34717
  exports.parseBorderArg = parseBorderArg;
32585
34718
  exports.parseSelectionRef = parseSelectionRef;