ooxml-core 0.19.0 → 0.21.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.
- package/README.md +21 -43
- package/dist/automation/index.cjs +195 -193
- package/dist/automation/index.mjs +195 -193
- package/dist/chart/axis-nice.d.ts +97 -0
- package/dist/chart/axis-nice.d.ts.map +1 -0
- package/dist/chart/histogram-binning.d.ts +40 -0
- package/dist/chart/histogram-binning.d.ts.map +1 -0
- package/dist/chart/index.cjs +167 -0
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.mjs +162 -1
- package/dist/diagram/index.cjs +2 -1
- package/dist/diagram/index.mjs +2 -1
- package/dist/docx/attr-units.d.ts +11 -0
- package/dist/docx/attr-units.d.ts.map +1 -0
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/case-transform.d.ts +9 -0
- package/dist/docx/case-transform.d.ts.map +1 -0
- package/dist/docx/embedded.cjs +2 -1
- package/dist/docx/embedded.mjs +2 -1
- package/dist/docx/index.cjs +289 -3
- package/dist/docx/index.d.ts +5 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +269 -4
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/table-layout.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +2 -1
- package/dist/docx/load/index.mjs +2 -1
- package/dist/docx/page-setup-model.d.ts +29 -0
- package/dist/docx/page-setup-model.d.ts.map +1 -0
- package/dist/docx/page-size.d.ts +11 -0
- package/dist/docx/page-size.d.ts.map +1 -0
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/section-edit.d.ts +19 -0
- package/dist/docx/section-edit.d.ts.map +1 -0
- package/dist/docx/tab-stops.d.ts.map +1 -1
- package/dist/docx/ui/backstage-focus.d.ts +6 -0
- package/dist/docx/ui/backstage-focus.d.ts.map +1 -0
- package/dist/docx/ui/break-note-schema.d.ts +11 -0
- package/dist/docx/ui/break-note-schema.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-authority.d.ts +31 -0
- package/dist/docx/ui/collaboration-authority.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-identity.d.ts +8 -0
- package/dist/docx/ui/collaboration-identity.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-protocol.d.ts +25 -0
- package/dist/docx/ui/collaboration-protocol.d.ts.map +1 -0
- package/dist/docx/ui/collaboration.d.ts +30 -0
- package/dist/docx/ui/collaboration.d.ts.map +1 -0
- package/dist/docx/ui/defined.d.ts +3 -0
- package/dist/docx/ui/defined.d.ts.map +1 -0
- package/dist/docx/ui/dirty-state.d.ts +9 -0
- package/dist/docx/ui/dirty-state.d.ts.map +1 -0
- package/dist/docx/ui/field-guard.d.ts +21 -0
- package/dist/docx/ui/field-guard.d.ts.map +1 -0
- package/dist/docx/ui/header-footer-history.d.ts +15 -0
- package/dist/docx/ui/header-footer-history.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +2380 -0
- package/dist/docx/ui/index.d.ts +30 -0
- package/dist/docx/ui/index.d.ts.map +1 -0
- package/dist/docx/ui/index.mjs +2317 -0
- package/dist/docx/ui/inline-content-schema.d.ts +15 -0
- package/dist/docx/ui/inline-content-schema.d.ts.map +1 -0
- package/dist/docx/ui/ligature-style.d.ts +4 -0
- package/dist/docx/ui/ligature-style.d.ts.map +1 -0
- package/dist/docx/ui/node-numbering.d.ts +8 -0
- package/dist/docx/ui/node-numbering.d.ts.map +1 -0
- package/dist/docx/ui/review-schema.d.ts +90 -0
- package/dist/docx/ui/review-schema.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-action-ids.d.ts +26 -0
- package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-colors.d.ts +3 -0
- package/dist/docx/ui/ribbon-colors.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-legacy-labels.d.ts +6 -0
- package/dist/docx/ui/ribbon-legacy-labels.d.ts.map +1 -0
- package/dist/docx/ui/run-compare.d.ts +5 -0
- package/dist/docx/ui/run-compare.d.ts.map +1 -0
- package/dist/docx/ui/run-extra-mark.d.ts +17 -0
- package/dist/docx/ui/run-extra-mark.d.ts.map +1 -0
- package/dist/docx/ui/schema-marks.d.ts +273 -0
- package/dist/docx/ui/schema-marks.d.ts.map +1 -0
- package/dist/docx/ui/smartart-theme.d.ts +21 -0
- package/dist/docx/ui/smartart-theme.d.ts.map +1 -0
- package/dist/docx/ui/table-render.d.ts +24 -0
- package/dist/docx/ui/table-render.d.ts.map +1 -0
- package/dist/docx/ui/table-visuals.d.ts +3 -0
- package/dist/docx/ui/table-visuals.d.ts.map +1 -0
- package/dist/docx/ui/theme/css-vars.d.ts +6 -0
- package/dist/docx/ui/theme/css-vars.d.ts.map +1 -0
- package/dist/docx/ui/theme/defaults.d.ts +12 -0
- package/dist/docx/ui/theme/defaults.d.ts.map +1 -0
- package/dist/docx/ui/theme/element.d.ts +9 -0
- package/dist/docx/ui/theme/element.d.ts.map +1 -0
- package/dist/docx/ui/theme/index.d.ts +5 -0
- package/dist/docx/ui/theme/index.d.ts.map +1 -0
- package/dist/docx/ui/theme/types.d.ts +42 -0
- package/dist/docx/ui/theme/types.d.ts.map +1 -0
- package/dist/docx/ui/word-count.d.ts +3 -0
- package/dist/docx/ui/word-count.d.ts.map +1 -0
- package/dist/docx/ui/zoom-fit.d.ts +16 -0
- package/dist/docx/ui/zoom-fit.d.ts.map +1 -0
- package/dist/docx/validate-paragraph.d.ts.map +1 -1
- package/dist/index.cjs +169 -1
- package/dist/index.mjs +169 -1
- package/dist/math/index.cjs +2 -1
- package/dist/math/index.mjs +2 -1
- package/dist/opc/index.cjs +2 -1
- package/dist/opc/index.mjs +2 -1
- package/dist/pptx/automation/index.cjs +1572 -863
- package/dist/pptx/automation/index.d.ts +4 -3
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +1572 -863
- package/dist/pptx/chunks/color-ref-BM66NGFP.d.ts +42 -0
- package/dist/pptx/chunks/color-ref-BM66NGFP.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-D0yGoLyw.d.ts → index-CcQTCBnT.d.ts} +63 -479
- package/dist/pptx/chunks/index-CcQTCBnT.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BtBj3VG1.d.ts → index-DHoPgFcH.d.ts} +529 -11
- package/dist/pptx/chunks/index-DHoPgFcH.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-GuisjlbR.d.ts → text-operations-BzdehTeY.d.ts} +50 -51
- package/dist/pptx/chunks/text-operations-BzdehTeY.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +1204 -489
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +1204 -489
- package/dist/pptx/converter/index.cjs +8 -5
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +8 -5
- package/dist/pptx/index.cjs +1699 -989
- package/dist/pptx/index.d.ts +5 -4
- package/dist/pptx/index.mjs +1698 -990
- package/dist/pptx/ui/index.cjs +510 -0
- package/dist/pptx/ui/index.d.ts +80 -0
- package/dist/pptx/ui/index.d.ts.map +1 -0
- package/dist/pptx/ui/index.mjs +499 -0
- package/dist/visio/index.cjs +2 -1
- package/dist/visio/index.mjs +2 -1
- package/dist/visio/ui/contract.d.ts +33 -0
- package/dist/visio/ui/contract.d.ts.map +1 -0
- package/dist/visio/ui/demo-document.d.ts +4 -0
- package/dist/visio/ui/demo-document.d.ts.map +1 -0
- package/dist/visio/ui/diagnostics.d.ts +10 -0
- package/dist/visio/ui/diagnostics.d.ts.map +1 -0
- package/dist/visio/ui/document-history.d.ts +43 -0
- package/dist/visio/ui/document-history.d.ts.map +1 -0
- package/dist/visio/ui/document-text-search.d.ts +45 -0
- package/dist/visio/ui/document-text-search.d.ts.map +1 -0
- package/dist/visio/ui/edit-commands.d.ts +4 -0
- package/dist/visio/ui/edit-commands.d.ts.map +1 -0
- package/dist/visio/ui/edit-error.d.ts +5 -0
- package/dist/visio/ui/edit-error.d.ts.map +1 -0
- package/dist/visio/ui/foreign-vector-budget.d.ts +25 -0
- package/dist/visio/ui/foreign-vector-budget.d.ts.map +1 -0
- package/dist/visio/ui/index.cjs +1523 -0
- package/dist/visio/ui/index.d.ts +12 -0
- package/dist/visio/ui/index.d.ts.map +1 -0
- package/dist/visio/ui/index.mjs +1498 -0
- package/dist/visio/ui/scene-details.d.ts +8 -0
- package/dist/visio/ui/scene-details.d.ts.map +1 -0
- package/dist/visio/ui/scene-validation.d.ts +5 -0
- package/dist/visio/ui/scene-validation.d.ts.map +1 -0
- package/dist/visio/ui/snapshot-scene.d.ts +9 -0
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -0
- package/dist/xlsx/index.cjs +100 -98
- package/dist/xlsx/index.mjs +100 -98
- package/dist/xlsx/load/index.cjs +68 -66
- package/dist/xlsx/load/index.mjs +68 -66
- package/dist/xlsx/ui/backstage/templates.d.ts +16 -0
- package/dist/xlsx/ui/backstage/templates.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/alignment.d.ts +4 -0
- package/dist/xlsx/ui/commands/alignment.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/cells.d.ts +3 -0
- package/dist/xlsx/ui/commands/cells.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/cf-presets.d.ts +15 -0
- package/dist/xlsx/ui/commands/cf-presets.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/clipboard.d.ts +22 -0
- package/dist/xlsx/ui/commands/clipboard.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/contextual.d.ts +13 -0
- package/dist/xlsx/ui/commands/contextual.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/data.d.ts +3 -0
- package/dist/xlsx/ui/commands/data.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/editing.d.ts +13 -0
- package/dist/xlsx/ui/commands/editing.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/font.d.ts +21 -0
- package/dist/xlsx/ui/commands/font.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/formulas.d.ts +15 -0
- package/dist/xlsx/ui/commands/formulas.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/core-features.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/core-features.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/format-cells.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/format-cells.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts +4 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/messages.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/messages.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-home.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-home.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/rules.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/rules.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/tools.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/types.d.ts +5 -0
- package/dist/xlsx/ui/commands/i18n/types.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/icons.d.ts +4 -0
- package/dist/xlsx/ui/commands/icons.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/number.d.ts +11 -0
- package/dist/xlsx/ui/commands/number.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/page-layout.d.ts +10 -0
- package/dist/xlsx/ui/commands/page-layout.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/select-special.d.ts +12 -0
- package/dist/xlsx/ui/commands/select-special.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/sort-filter.d.ts +3 -0
- package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/style-presets.d.ts +21 -0
- package/dist/xlsx/ui/commands/style-presets.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/util.d.ts +59 -0
- package/dist/xlsx/ui/commands/util.d.ts.map +1 -0
- package/dist/xlsx/ui/commands.d.ts +36 -0
- package/dist/xlsx/ui/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/context-menu/items.d.ts +36 -0
- package/dist/xlsx/ui/context-menu/items.d.ts.map +1 -0
- package/dist/xlsx/ui/context.d.ts +65 -0
- package/dist/xlsx/ui/context.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/format-cells/number-categories.d.ts +28 -0
- package/dist/xlsx/ui/dialogs/format-cells/number-categories.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/format-cells/types.d.ts +40 -0
- package/dist/xlsx/ui/dialogs/format-cells/types.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/insert-chart-model.d.ts +9 -0
- package/dist/xlsx/ui/dialogs/insert-chart-model.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs.d.ts +9 -0
- package/dist/xlsx/ui/dialogs.d.ts.map +1 -0
- package/dist/xlsx/ui/dirty-state.d.ts +9 -0
- package/dist/xlsx/ui/dirty-state.d.ts.map +1 -0
- package/dist/xlsx/ui/formula-bar/name-resolve.d.ts +23 -0
- package/dist/xlsx/ui/formula-bar/name-resolve.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/cell-items.d.ts +42 -0
- package/dist/xlsx/ui/grid/cell-items.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/cell-paint.d.ts +26 -0
- package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/edit-bridge.d.ts +47 -0
- package/dist/xlsx/ui/grid/edit-bridge.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/geometry.d.ts +76 -0
- package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/icon-sets.d.ts +3 -0
- package/dist/xlsx/ui/grid/icon-sets.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/number-fit.d.ts +3 -0
- package/dist/xlsx/ui/grid/number-fit.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/selection-ops.d.ts +32 -0
- package/dist/xlsx/ui/grid/selection-ops.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/view-cache.d.ts +15 -0
- package/dist/xlsx/ui/grid/view-cache.d.ts.map +1 -0
- package/dist/xlsx/ui/index.cjs +28484 -0
- package/dist/xlsx/ui/index.d.ts +56 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -0
- package/dist/xlsx/ui/index.mjs +28290 -0
- package/dist/xlsx/ui/locales/de/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/merge.d.ts +7 -0
- package/dist/xlsx/ui/locales/merge.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/localization.d.ts +23 -0
- package/dist/xlsx/ui/localization.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/icon-paths.d.ts +9 -0
- package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/parts.d.ts +88 -0
- package/dist/xlsx/ui/ribbon/parts.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tab-api.d.ts +21 -0
- package/dist/xlsx/ui/ribbon/tab-api.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts +5 -0
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tabs/theme-palette.d.ts +8 -0
- package/dist/xlsx/ui/ribbon/tabs/theme-palette.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tell-me.d.ts +16 -0
- package/dist/xlsx/ui/ribbon/tell-me.d.ts.map +1 -0
- package/dist/xlsx/ui/selection.d.ts +34 -0
- package/dist/xlsx/ui/selection.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/css-vars.d.ts +6 -0
- package/dist/xlsx/ui/theme/css-vars.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/defaults.d.ts +6 -0
- package/dist/xlsx/ui/theme/defaults.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/element.d.ts +9 -0
- package/dist/xlsx/ui/theme/element.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/types.d.ts +54 -0
- package/dist/xlsx/ui/theme/types.d.ts.map +1 -0
- package/dist/xml/index.cjs +2 -1
- package/dist/xml/index.mjs +2 -1
- package/package.json +42 -4
- package/dist/pptx/chunks/index-BtBj3VG1.d.ts.map +0 -1
- package/dist/pptx/chunks/index-D0yGoLyw.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-GuisjlbR.d.ts.map +0 -1
|
@@ -1910,10 +1910,11 @@ var init_units = __esm({
|
|
|
1910
1910
|
});
|
|
1911
1911
|
|
|
1912
1912
|
// src/units/constants.ts
|
|
1913
|
-
var EMU_PER_PIXEL;
|
|
1913
|
+
var EMU_PER_PIXEL, EMU_PER_POINT;
|
|
1914
1914
|
var init_constants = __esm({
|
|
1915
1915
|
"src/units/constants.ts"() {
|
|
1916
1916
|
EMU_PER_PIXEL = 9525;
|
|
1917
|
+
EMU_PER_POINT = 12700;
|
|
1917
1918
|
}
|
|
1918
1919
|
});
|
|
1919
1920
|
|
|
@@ -2988,6 +2989,829 @@ var init_chart_gradient_input = __esm({
|
|
|
2988
2989
|
}
|
|
2989
2990
|
});
|
|
2990
2991
|
|
|
2992
|
+
// src/pptx/core/utils/chart-container-content-model.ts
|
|
2993
|
+
function chartTypeToContainerLocalName(chartType) {
|
|
2994
|
+
return TYPE_TO_CONTAINER[chartType];
|
|
2995
|
+
}
|
|
2996
|
+
function isKnownChartContainer(containerLocal) {
|
|
2997
|
+
return containerLocal in CHART_CONTAINER_CHILD_ORDER;
|
|
2998
|
+
}
|
|
2999
|
+
function chartContainerAllows(containerLocal, childLocal) {
|
|
3000
|
+
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
3001
|
+
return order !== void 0 && order.includes(childLocal);
|
|
3002
|
+
}
|
|
3003
|
+
var CHART_CONTAINER_CHILD_ORDER, REQUIRED_LEADING_CHILD, TYPE_TO_CONTAINER, AXIS_LOCAL_NAMES;
|
|
3004
|
+
var init_chart_container_content_model = __esm({
|
|
3005
|
+
"src/pptx/core/utils/chart-container-content-model.ts"() {
|
|
3006
|
+
CHART_CONTAINER_CHILD_ORDER = {
|
|
3007
|
+
areaChart: ["grouping", "varyColors", "ser", "dLbls", "dropLines", "axId", "extLst"],
|
|
3008
|
+
area3DChart: [
|
|
3009
|
+
"grouping",
|
|
3010
|
+
"varyColors",
|
|
3011
|
+
"ser",
|
|
3012
|
+
"dLbls",
|
|
3013
|
+
"dropLines",
|
|
3014
|
+
"gapDepth",
|
|
3015
|
+
"axId",
|
|
3016
|
+
"extLst"
|
|
3017
|
+
],
|
|
3018
|
+
barChart: [
|
|
3019
|
+
"barDir",
|
|
3020
|
+
"grouping",
|
|
3021
|
+
"varyColors",
|
|
3022
|
+
"ser",
|
|
3023
|
+
"dLbls",
|
|
3024
|
+
"gapWidth",
|
|
3025
|
+
"overlap",
|
|
3026
|
+
"serLines",
|
|
3027
|
+
"axId",
|
|
3028
|
+
"extLst"
|
|
3029
|
+
],
|
|
3030
|
+
bar3DChart: [
|
|
3031
|
+
"barDir",
|
|
3032
|
+
"grouping",
|
|
3033
|
+
"varyColors",
|
|
3034
|
+
"ser",
|
|
3035
|
+
"dLbls",
|
|
3036
|
+
"gapWidth",
|
|
3037
|
+
"gapDepth",
|
|
3038
|
+
"shape",
|
|
3039
|
+
"axId",
|
|
3040
|
+
"extLst"
|
|
3041
|
+
],
|
|
3042
|
+
bubbleChart: [
|
|
3043
|
+
"varyColors",
|
|
3044
|
+
"ser",
|
|
3045
|
+
"dLbls",
|
|
3046
|
+
"bubble3D",
|
|
3047
|
+
"bubbleScale",
|
|
3048
|
+
"showNegBubbles",
|
|
3049
|
+
"sizeRepresents",
|
|
3050
|
+
"axId",
|
|
3051
|
+
"extLst"
|
|
3052
|
+
],
|
|
3053
|
+
doughnutChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "holeSize", "extLst"],
|
|
3054
|
+
lineChart: [
|
|
3055
|
+
"grouping",
|
|
3056
|
+
"varyColors",
|
|
3057
|
+
"ser",
|
|
3058
|
+
"dLbls",
|
|
3059
|
+
"dropLines",
|
|
3060
|
+
"hiLowLines",
|
|
3061
|
+
"upDownBars",
|
|
3062
|
+
"marker",
|
|
3063
|
+
"smooth",
|
|
3064
|
+
"axId",
|
|
3065
|
+
"extLst"
|
|
3066
|
+
],
|
|
3067
|
+
line3DChart: [
|
|
3068
|
+
"grouping",
|
|
3069
|
+
"varyColors",
|
|
3070
|
+
"ser",
|
|
3071
|
+
"dLbls",
|
|
3072
|
+
"dropLines",
|
|
3073
|
+
"gapDepth",
|
|
3074
|
+
"axId",
|
|
3075
|
+
"extLst"
|
|
3076
|
+
],
|
|
3077
|
+
ofPieChart: [
|
|
3078
|
+
"ofPieType",
|
|
3079
|
+
"varyColors",
|
|
3080
|
+
"ser",
|
|
3081
|
+
"dLbls",
|
|
3082
|
+
"gapWidth",
|
|
3083
|
+
"splitType",
|
|
3084
|
+
"splitPos",
|
|
3085
|
+
"custSplit",
|
|
3086
|
+
"secondPieSize",
|
|
3087
|
+
"serLines",
|
|
3088
|
+
"extLst"
|
|
3089
|
+
],
|
|
3090
|
+
pieChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "extLst"],
|
|
3091
|
+
pie3DChart: ["varyColors", "ser", "dLbls", "extLst"],
|
|
3092
|
+
radarChart: ["radarStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
3093
|
+
scatterChart: ["scatterStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
3094
|
+
stockChart: ["ser", "dLbls", "dropLines", "hiLowLines", "upDownBars", "axId", "extLst"],
|
|
3095
|
+
surfaceChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"],
|
|
3096
|
+
surface3DChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"]
|
|
3097
|
+
};
|
|
3098
|
+
REQUIRED_LEADING_CHILD = {
|
|
3099
|
+
barChart: { local: "barDir", val: "col" },
|
|
3100
|
+
bar3DChart: { local: "barDir", val: "col" },
|
|
3101
|
+
lineChart: { local: "grouping", val: "standard" },
|
|
3102
|
+
line3DChart: { local: "grouping", val: "standard" },
|
|
3103
|
+
ofPieChart: { local: "ofPieType", val: "pie" },
|
|
3104
|
+
radarChart: { local: "radarStyle", val: "marker" },
|
|
3105
|
+
scatterChart: { local: "scatterStyle", val: "lineMarker" }
|
|
3106
|
+
};
|
|
3107
|
+
TYPE_TO_CONTAINER = {
|
|
3108
|
+
area: "areaChart",
|
|
3109
|
+
area3D: "area3DChart",
|
|
3110
|
+
bar: "barChart",
|
|
3111
|
+
bar3D: "bar3DChart",
|
|
3112
|
+
bubble: "bubbleChart",
|
|
3113
|
+
doughnut: "doughnutChart",
|
|
3114
|
+
line: "lineChart",
|
|
3115
|
+
line3D: "line3DChart",
|
|
3116
|
+
ofPie: "ofPieChart",
|
|
3117
|
+
pie: "pieChart",
|
|
3118
|
+
pie3D: "pie3DChart",
|
|
3119
|
+
radar: "radarChart",
|
|
3120
|
+
scatter: "scatterChart",
|
|
3121
|
+
stock: "stockChart",
|
|
3122
|
+
surface: "surfaceChart"
|
|
3123
|
+
};
|
|
3124
|
+
AXIS_LOCAL_NAMES = ["catAx", "valAx", "dateAx", "serAx"];
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
|
|
3128
|
+
// src/pptx/core/utils/chart-container-schema.ts
|
|
3129
|
+
function normalizeChartGroupingValue(containerLocal, value) {
|
|
3130
|
+
const isBar = containerLocal === "barChart" || containerLocal === "bar3DChart";
|
|
3131
|
+
return !isBar && value === "clustered" ? "standard" : value;
|
|
3132
|
+
}
|
|
3133
|
+
function normalizeGroupingNode(containerLocal, node) {
|
|
3134
|
+
const value = node["@_val"];
|
|
3135
|
+
if (value !== void 0) {
|
|
3136
|
+
node["@_val"] = normalizeChartGroupingValue(containerLocal, value);
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
function normalizeChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
3140
|
+
if (!isKnownChartContainer(containerLocal)) {
|
|
3141
|
+
return;
|
|
3142
|
+
}
|
|
3143
|
+
for (const key2 of Object.keys(container2)) {
|
|
3144
|
+
if (key2.startsWith("@_") || key2 === "#text") {
|
|
3145
|
+
continue;
|
|
3146
|
+
}
|
|
3147
|
+
const local = getLocalName2(key2);
|
|
3148
|
+
if (!chartContainerAllows(containerLocal, local)) {
|
|
3149
|
+
delete container2[key2];
|
|
3150
|
+
continue;
|
|
3151
|
+
}
|
|
3152
|
+
if (local === "grouping") {
|
|
3153
|
+
const node = container2[key2];
|
|
3154
|
+
if (node && typeof node === "object" && !Array.isArray(node)) {
|
|
3155
|
+
normalizeGroupingNode(containerLocal, node);
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
const required = REQUIRED_LEADING_CHILD[containerLocal];
|
|
3160
|
+
if (required) {
|
|
3161
|
+
const present = Object.keys(container2).some((k) => getLocalName2(k) === required.local);
|
|
3162
|
+
if (!present) {
|
|
3163
|
+
container2[`c:${required.local}`] = { "@_val": required.val };
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
function orderChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
3168
|
+
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
3169
|
+
if (!order) {
|
|
3170
|
+
return;
|
|
3171
|
+
}
|
|
3172
|
+
const keys = Object.keys(container2).filter((k) => !k.startsWith("@_") && k !== "#text");
|
|
3173
|
+
if (keys.some((k) => !order.includes(getLocalName2(k)))) {
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
const sorted = [...keys].sort(
|
|
3177
|
+
(a, b) => order.indexOf(getLocalName2(a)) - order.indexOf(getLocalName2(b))
|
|
3178
|
+
);
|
|
3179
|
+
if (sorted.every((k, i) => k === keys[i])) {
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
const saved = sorted.map((k) => [k, container2[k]]);
|
|
3183
|
+
for (const k of keys) {
|
|
3184
|
+
delete container2[k];
|
|
3185
|
+
}
|
|
3186
|
+
for (const [k, v] of saved) {
|
|
3187
|
+
container2[k] = v;
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
function renameXmlKeyInPlace(obj, oldKey, newKey) {
|
|
3191
|
+
if (oldKey === newKey || !(oldKey in obj)) {
|
|
3192
|
+
return;
|
|
3193
|
+
}
|
|
3194
|
+
const entries = Object.keys(obj).map((k) => [k === oldKey ? newKey : k, obj[k]]);
|
|
3195
|
+
for (const k of Object.keys(obj)) {
|
|
3196
|
+
delete obj[k];
|
|
3197
|
+
}
|
|
3198
|
+
for (const [k, v] of entries) {
|
|
3199
|
+
obj[k] = v;
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
function referencedAxisIds(plotArea, getLocalName2) {
|
|
3203
|
+
const ids = /* @__PURE__ */ new Set();
|
|
3204
|
+
for (const key2 of Object.keys(plotArea)) {
|
|
3205
|
+
if (!getLocalName2(key2).endsWith("Chart")) {
|
|
3206
|
+
continue;
|
|
3207
|
+
}
|
|
3208
|
+
for (const container2 of toArray(plotArea[key2])) {
|
|
3209
|
+
for (const childKey3 of Object.keys(container2)) {
|
|
3210
|
+
if (getLocalName2(childKey3) !== "axId") {
|
|
3211
|
+
continue;
|
|
3212
|
+
}
|
|
3213
|
+
for (const axId of toArray(container2[childKey3])) {
|
|
3214
|
+
const val = axId["@_val"];
|
|
3215
|
+
if (val !== void 0) {
|
|
3216
|
+
ids.add(String(val));
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
return ids;
|
|
3223
|
+
}
|
|
3224
|
+
function toArray(value) {
|
|
3225
|
+
if (Array.isArray(value)) {
|
|
3226
|
+
return value.filter((v) => typeof v === "object" && v !== null);
|
|
3227
|
+
}
|
|
3228
|
+
return typeof value === "object" && value !== null ? [value] : [];
|
|
3229
|
+
}
|
|
3230
|
+
function reconcileChartPlotAreaAxes(plotArea, getLocalName2) {
|
|
3231
|
+
const referenced = referencedAxisIds(plotArea, getLocalName2);
|
|
3232
|
+
let removed = 0;
|
|
3233
|
+
for (const key2 of Object.keys(plotArea)) {
|
|
3234
|
+
const local = getLocalName2(key2);
|
|
3235
|
+
if (!AXIS_LOCAL_NAMES.includes(local)) {
|
|
3236
|
+
continue;
|
|
3237
|
+
}
|
|
3238
|
+
const axes = toArray(plotArea[key2]);
|
|
3239
|
+
const kept = axes.filter((axis) => {
|
|
3240
|
+
const axIdKey = Object.keys(axis).find((k) => getLocalName2(k) === "axId");
|
|
3241
|
+
const val = axIdKey ? toArray(axis[axIdKey])[0]?.["@_val"] : void 0;
|
|
3242
|
+
return val !== void 0 && referenced.has(String(val));
|
|
3243
|
+
});
|
|
3244
|
+
removed += axes.length - kept.length;
|
|
3245
|
+
if (kept.length === 0) {
|
|
3246
|
+
delete plotArea[key2];
|
|
3247
|
+
} else if (kept.length !== axes.length) {
|
|
3248
|
+
plotArea[key2] = kept.length === 1 ? kept[0] : kept;
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
return removed;
|
|
3252
|
+
}
|
|
3253
|
+
var init_chart_container_schema = __esm({
|
|
3254
|
+
"src/pptx/core/utils/chart-container-schema.ts"() {
|
|
3255
|
+
init_chart_container_content_model();
|
|
3256
|
+
init_chart_container_content_model();
|
|
3257
|
+
}
|
|
3258
|
+
});
|
|
3259
|
+
|
|
3260
|
+
// src/pptx/core/utils/chart-group-options.ts
|
|
3261
|
+
function chartGroupOptionVal(spec, value) {
|
|
3262
|
+
return String(Math.min(spec.max, Math.max(spec.min, Math.round(value))));
|
|
3263
|
+
}
|
|
3264
|
+
function localNameOf2(key2) {
|
|
3265
|
+
return key2.replace(/^.*:/u, "");
|
|
3266
|
+
}
|
|
3267
|
+
function findKey3(obj, local, getLocalName2) {
|
|
3268
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
3269
|
+
}
|
|
3270
|
+
function modelValue(chartData, spec) {
|
|
3271
|
+
if (spec.element === "gapWidth" && chartData.chartType === "ofPie") {
|
|
3272
|
+
return chartData.ofPieOptions?.gapWidth ?? chartData.barGapWidth;
|
|
3273
|
+
}
|
|
3274
|
+
const value = chartData[spec.field];
|
|
3275
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
3276
|
+
}
|
|
3277
|
+
function applyGeneratedChartGroupOptions(container2, containerLocal, chartData) {
|
|
3278
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3279
|
+
if (!chartContainerAllows(containerLocal, spec.element)) {
|
|
3280
|
+
continue;
|
|
3281
|
+
}
|
|
3282
|
+
const value = modelValue(chartData, spec) ?? spec.generatedDefault;
|
|
3283
|
+
if (value !== void 0) {
|
|
3284
|
+
container2[`c:${spec.element}`] = { "@_val": chartGroupOptionVal(spec, value) };
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
orderChartContainerChildren(container2, containerLocal, localNameOf2);
|
|
3288
|
+
}
|
|
3289
|
+
function authoredValue(node) {
|
|
3290
|
+
if (!node || typeof node !== "object") {
|
|
3291
|
+
return void 0;
|
|
3292
|
+
}
|
|
3293
|
+
const raw = node["@_val"];
|
|
3294
|
+
const num4 = raw === void 0 || raw === null || raw === "" ? NaN : Number.parseFloat(String(raw));
|
|
3295
|
+
return Number.isFinite(num4) ? num4 : void 0;
|
|
3296
|
+
}
|
|
3297
|
+
function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
|
|
3298
|
+
let changed = false;
|
|
3299
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3300
|
+
if (!chartContainerAllows(containerLocal, spec.element)) {
|
|
3301
|
+
continue;
|
|
3302
|
+
}
|
|
3303
|
+
if (spec.element === "gapWidth" && containerLocal === "ofPieChart") {
|
|
3304
|
+
continue;
|
|
3305
|
+
}
|
|
3306
|
+
const key2 = findKey3(container2, spec.element, getLocalName2);
|
|
3307
|
+
const authored = key2 ? authoredValue(container2[key2]) : void 0;
|
|
3308
|
+
const value = chartData[spec.field];
|
|
3309
|
+
if (value === void 0) {
|
|
3310
|
+
if (key2 && authored !== void 0) {
|
|
3311
|
+
delete container2[key2];
|
|
3312
|
+
changed = true;
|
|
3313
|
+
}
|
|
3314
|
+
continue;
|
|
3315
|
+
}
|
|
3316
|
+
if (authored === value) {
|
|
3317
|
+
continue;
|
|
3318
|
+
}
|
|
3319
|
+
container2[key2 ?? `c:${spec.element}`] = { "@_val": chartGroupOptionVal(spec, value) };
|
|
3320
|
+
changed = true;
|
|
3321
|
+
}
|
|
3322
|
+
return changed;
|
|
3323
|
+
}
|
|
3324
|
+
var CHART_GROUP_OPTIONS;
|
|
3325
|
+
var init_chart_group_options = __esm({
|
|
3326
|
+
"src/pptx/core/utils/chart-group-options.ts"() {
|
|
3327
|
+
init_chart_container_content_model();
|
|
3328
|
+
init_chart_container_schema();
|
|
3329
|
+
CHART_GROUP_OPTIONS = [
|
|
3330
|
+
{
|
|
3331
|
+
element: "gapWidth",
|
|
3332
|
+
field: "barGapWidth",
|
|
3333
|
+
schemaType: "ST_GapAmount",
|
|
3334
|
+
min: 0,
|
|
3335
|
+
max: 500,
|
|
3336
|
+
generatedDefault: 150
|
|
3337
|
+
},
|
|
3338
|
+
{ element: "overlap", field: "barOverlap", schemaType: "ST_Overlap", min: -100, max: 100 },
|
|
3339
|
+
{
|
|
3340
|
+
element: "firstSliceAng",
|
|
3341
|
+
field: "firstSliceAngle",
|
|
3342
|
+
schemaType: "ST_FirstSliceAng",
|
|
3343
|
+
min: 0,
|
|
3344
|
+
max: 360
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
element: "holeSize",
|
|
3348
|
+
field: "doughnutHoleSize",
|
|
3349
|
+
schemaType: "ST_HoleSize",
|
|
3350
|
+
min: 1,
|
|
3351
|
+
max: 90,
|
|
3352
|
+
generatedDefault: 50
|
|
3353
|
+
}
|
|
3354
|
+
];
|
|
3355
|
+
}
|
|
3356
|
+
});
|
|
3357
|
+
|
|
3358
|
+
// src/pptx/core/builders/sdk/chart-layout-input.ts
|
|
3359
|
+
function allowedTypes(element) {
|
|
3360
|
+
return CLASSIC_TYPES.filter((type) => {
|
|
3361
|
+
const local = chartTypeToContainerLocalName(type);
|
|
3362
|
+
return local !== void 0 && chartContainerAllows(local, element);
|
|
3363
|
+
});
|
|
3364
|
+
}
|
|
3365
|
+
function drawnTypes(chartData) {
|
|
3366
|
+
if (chartData.chartType !== "combo") {
|
|
3367
|
+
return [chartData.chartType];
|
|
3368
|
+
}
|
|
3369
|
+
return chartData.series.map((s) => s.seriesChartType ?? chartData.chartType);
|
|
3370
|
+
}
|
|
3371
|
+
function validateValue(spec, name, value) {
|
|
3372
|
+
if (!Number.isInteger(value) || value < spec.min || value > spec.max) {
|
|
3373
|
+
throw new RangeError(
|
|
3374
|
+
`${name} must be an integer from ${spec.min} to ${spec.max} (${spec.schemaType}), got ${value}.`
|
|
3375
|
+
);
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
function applyChartGroupOptionsInput(chartData, input) {
|
|
3379
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3380
|
+
const name = INPUT_KEYS[spec.element];
|
|
3381
|
+
const value = input[name];
|
|
3382
|
+
if (value === void 0) {
|
|
3383
|
+
continue;
|
|
3384
|
+
}
|
|
3385
|
+
if (value === null) {
|
|
3386
|
+
delete chartData[spec.field];
|
|
3387
|
+
continue;
|
|
3388
|
+
}
|
|
3389
|
+
validateValue(spec, name, value);
|
|
3390
|
+
const types = drawnTypes(chartData);
|
|
3391
|
+
const allowed = allowedTypes(spec.element);
|
|
3392
|
+
if (!types.some((type) => allowed.includes(type))) {
|
|
3393
|
+
throw new Error(
|
|
3394
|
+
`${name} applies to ${allowed.join(", ")} charts; this chart is drawn as "${types.join('", "')}".`
|
|
3395
|
+
);
|
|
3396
|
+
}
|
|
3397
|
+
chartData[spec.field] = value;
|
|
3398
|
+
if (spec.element === "gapWidth" && chartData.ofPieOptions) {
|
|
3399
|
+
chartData.ofPieOptions.gapWidth = value;
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
function toPaint(value, name) {
|
|
3404
|
+
const trimmed = value.trim();
|
|
3405
|
+
if (trimmed === "none") {
|
|
3406
|
+
return "none";
|
|
3407
|
+
}
|
|
3408
|
+
if (!HEX_COLOR2.test(trimmed)) {
|
|
3409
|
+
throw new Error(`${name} must be a 6-digit hex colour or 'none', got "${value}".`);
|
|
3410
|
+
}
|
|
3411
|
+
return `#${trimmed.replace(/^#/u, "").toUpperCase()}`;
|
|
3412
|
+
}
|
|
3413
|
+
function applyChartAreaFormatInput(chartData, area, input) {
|
|
3414
|
+
const style = chartData.style ??= {};
|
|
3415
|
+
const fillKey = area === "chart" ? "chartAreaFill" : "plotAreaFill";
|
|
3416
|
+
const gradientKey = area === "chart" ? "chartAreaGradient" : "plotAreaGradient";
|
|
3417
|
+
const borderKey = area === "chart" ? "chartAreaBorder" : "plotAreaBorder";
|
|
3418
|
+
if (input === null) {
|
|
3419
|
+
delete style[fillKey];
|
|
3420
|
+
delete style[gradientKey];
|
|
3421
|
+
delete style[borderKey];
|
|
3422
|
+
if (area === "chart") {
|
|
3423
|
+
delete chartData.roundedCorners;
|
|
3424
|
+
}
|
|
3425
|
+
return;
|
|
3426
|
+
}
|
|
3427
|
+
if (input.roundedCorners !== void 0 && area !== "chart") {
|
|
3428
|
+
throw new Error("roundedCorners applies to the chart area only.");
|
|
3429
|
+
}
|
|
3430
|
+
if (input.fill !== void 0) {
|
|
3431
|
+
delete style[fillKey];
|
|
3432
|
+
delete style[gradientKey];
|
|
3433
|
+
if (typeof input.fill === "string") {
|
|
3434
|
+
style[fillKey] = toPaint(input.fill, "fill");
|
|
3435
|
+
} else if (input.fill !== null) {
|
|
3436
|
+
style[gradientKey] = toChartGradientFill(input.fill);
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
if (input.border !== void 0) {
|
|
3440
|
+
if (input.border === null) {
|
|
3441
|
+
delete style[borderKey];
|
|
3442
|
+
} else {
|
|
3443
|
+
style[borderKey] = toPaint(input.border, "border");
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
if (input.roundedCorners !== void 0) {
|
|
3447
|
+
if (input.roundedCorners === null) {
|
|
3448
|
+
delete chartData.roundedCorners;
|
|
3449
|
+
} else {
|
|
3450
|
+
chartData.roundedCorners = input.roundedCorners;
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
var INPUT_KEYS, CLASSIC_TYPES, HEX_COLOR2;
|
|
3455
|
+
var init_chart_layout_input = __esm({
|
|
3456
|
+
"src/pptx/core/builders/sdk/chart-layout-input.ts"() {
|
|
3457
|
+
init_chart_group_options();
|
|
3458
|
+
init_chart_container_content_model();
|
|
3459
|
+
init_chart_gradient_input();
|
|
3460
|
+
INPUT_KEYS = {
|
|
3461
|
+
gapWidth: "gapWidth",
|
|
3462
|
+
overlap: "overlap",
|
|
3463
|
+
firstSliceAng: "firstSliceAngle",
|
|
3464
|
+
holeSize: "holeSize"
|
|
3465
|
+
};
|
|
3466
|
+
CLASSIC_TYPES = [
|
|
3467
|
+
"bar",
|
|
3468
|
+
"bar3D",
|
|
3469
|
+
"line",
|
|
3470
|
+
"line3D",
|
|
3471
|
+
"pie",
|
|
3472
|
+
"pie3D",
|
|
3473
|
+
"ofPie",
|
|
3474
|
+
"doughnut",
|
|
3475
|
+
"area",
|
|
3476
|
+
"area3D",
|
|
3477
|
+
"scatter",
|
|
3478
|
+
"bubble",
|
|
3479
|
+
"radar",
|
|
3480
|
+
"stock",
|
|
3481
|
+
"surface"
|
|
3482
|
+
];
|
|
3483
|
+
HEX_COLOR2 = /^#?[0-9a-f]{6}$/iu;
|
|
3484
|
+
}
|
|
3485
|
+
});
|
|
3486
|
+
|
|
3487
|
+
// src/pptx/core/builders/sdk/chart-operations.ts
|
|
3488
|
+
function ensureChartData(element) {
|
|
3489
|
+
if (!element.chartData) {
|
|
3490
|
+
throw new Error(
|
|
3491
|
+
"Chart element has no chartData. Cannot perform chart operations on an uninitialised chart."
|
|
3492
|
+
);
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
function validateSeriesIndex(element, seriesIndex) {
|
|
3496
|
+
ensureChartData(element);
|
|
3497
|
+
if (seriesIndex < 0 || seriesIndex >= element.chartData.series.length) {
|
|
3498
|
+
throw new RangeError(
|
|
3499
|
+
`Series index ${seriesIndex} is out of range. Chart has ${element.chartData.series.length} series (indices 0\u2013${element.chartData.series.length - 1}).`
|
|
3500
|
+
);
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
function setChartType(element, newType) {
|
|
3504
|
+
ensureChartData(element);
|
|
3505
|
+
element.chartData.chartType = newType;
|
|
3506
|
+
}
|
|
3507
|
+
function addChartSeries(element, series) {
|
|
3508
|
+
ensureChartData(element);
|
|
3509
|
+
element.chartData.series.push({
|
|
3510
|
+
name: series.name,
|
|
3511
|
+
values: series.values,
|
|
3512
|
+
color: series.color
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
function removeChartSeries(element, seriesIndex) {
|
|
3516
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3517
|
+
element.chartData.series.splice(seriesIndex, 1);
|
|
3518
|
+
}
|
|
3519
|
+
function setChartCategories(element, categories) {
|
|
3520
|
+
ensureChartData(element);
|
|
3521
|
+
element.chartData.categories = categories;
|
|
3522
|
+
}
|
|
3523
|
+
function updateChartSeriesValues(element, seriesIndex, values) {
|
|
3524
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3525
|
+
element.chartData.series[seriesIndex].values = values;
|
|
3526
|
+
}
|
|
3527
|
+
function setChartTitle(element, title) {
|
|
3528
|
+
ensureChartData(element);
|
|
3529
|
+
element.chartData.title = title;
|
|
3530
|
+
}
|
|
3531
|
+
function setChartGrouping(element, grouping) {
|
|
3532
|
+
ensureChartData(element);
|
|
3533
|
+
element.chartData.grouping = grouping;
|
|
3534
|
+
}
|
|
3535
|
+
function setChartLegend(element, options) {
|
|
3536
|
+
ensureChartData(element);
|
|
3537
|
+
const style = element.chartData.style ??= {};
|
|
3538
|
+
if (options.show !== void 0) {
|
|
3539
|
+
style.hasLegend = options.show;
|
|
3540
|
+
}
|
|
3541
|
+
if (options.position !== void 0) {
|
|
3542
|
+
style.legendPosition = options.position;
|
|
3543
|
+
if (style.hasLegend === void 0) {
|
|
3544
|
+
style.hasLegend = true;
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
function setChartDataLabels(element, edit) {
|
|
3549
|
+
ensureChartData(element);
|
|
3550
|
+
const style = element.chartData.style ??= {};
|
|
3551
|
+
if (edit.show !== void 0) {
|
|
3552
|
+
style.hasDataLabels = edit.show;
|
|
3553
|
+
const labels = style.dataLabels;
|
|
3554
|
+
const anyContent = labels?.showValue === true || labels?.showCategory === true || labels?.showSeriesName === true || labels?.showPercent === true || labels?.showBubbleSize === true;
|
|
3555
|
+
if (edit.show && labels !== void 0 && !anyContent && edit.showValue === void 0) {
|
|
3556
|
+
labels.showValue = true;
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
const contentKeys = [
|
|
3560
|
+
"showValue",
|
|
3561
|
+
"showCategory",
|
|
3562
|
+
"showSeriesName",
|
|
3563
|
+
"showPercent",
|
|
3564
|
+
"showLegendKey"
|
|
3565
|
+
];
|
|
3566
|
+
const hasContentEdit = contentKeys.some((k) => edit[k] !== void 0) || edit.position !== void 0;
|
|
3567
|
+
if (hasContentEdit) {
|
|
3568
|
+
const opts = style.dataLabels ??= {};
|
|
3569
|
+
for (const k of contentKeys) {
|
|
3570
|
+
if (edit[k] !== void 0) {
|
|
3571
|
+
opts[k] = edit[k];
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
if (edit.position !== void 0) {
|
|
3575
|
+
opts.position = edit.position || void 0;
|
|
3576
|
+
}
|
|
3577
|
+
if (style.hasDataLabels === void 0) {
|
|
3578
|
+
style.hasDataLabels = true;
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
function setChartSeriesTrendline(element, seriesIndex, trendline) {
|
|
3583
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3584
|
+
element.chartData.series[seriesIndex].trendlines = trendline ? [trendline] : [];
|
|
3585
|
+
}
|
|
3586
|
+
function setChartSeriesErrorBars(element, seriesIndex, errBars) {
|
|
3587
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3588
|
+
element.chartData.series[seriesIndex].errBars = errBars ? [errBars] : [];
|
|
3589
|
+
}
|
|
3590
|
+
function setChartAxis(element, axisType, edit) {
|
|
3591
|
+
ensureChartData(element);
|
|
3592
|
+
const axes = element.chartData.axes ??= [];
|
|
3593
|
+
let axis = axes.find((a) => a.axisType === axisType);
|
|
3594
|
+
if (!axis) {
|
|
3595
|
+
axis = { axisType };
|
|
3596
|
+
axes.push(axis);
|
|
3597
|
+
}
|
|
3598
|
+
if (edit.min !== void 0) {
|
|
3599
|
+
axis.min = edit.min ?? void 0;
|
|
3600
|
+
}
|
|
3601
|
+
if (edit.max !== void 0) {
|
|
3602
|
+
axis.max = edit.max ?? void 0;
|
|
3603
|
+
}
|
|
3604
|
+
if (edit.majorUnit !== void 0) {
|
|
3605
|
+
axis.majorUnit = edit.majorUnit ?? void 0;
|
|
3606
|
+
}
|
|
3607
|
+
if (edit.minorUnit !== void 0) {
|
|
3608
|
+
axis.minorUnit = edit.minorUnit ?? void 0;
|
|
3609
|
+
}
|
|
3610
|
+
if (edit.orientation !== void 0) {
|
|
3611
|
+
axis.orientation = edit.orientation ?? void 0;
|
|
3612
|
+
}
|
|
3613
|
+
if (edit.numberFormat !== void 0) {
|
|
3614
|
+
axis.numFmt = edit.numberFormat ? { formatCode: edit.numberFormat, sourceLinked: false } : void 0;
|
|
3615
|
+
}
|
|
3616
|
+
if (edit.tickLabelPosition !== void 0) {
|
|
3617
|
+
axis.tickLblPos = edit.tickLabelPosition;
|
|
3618
|
+
}
|
|
3619
|
+
if (edit.title !== void 0) {
|
|
3620
|
+
axis.titleText = edit.title ?? "";
|
|
3621
|
+
}
|
|
3622
|
+
if (edit.majorGridlines !== void 0) {
|
|
3623
|
+
axis.majorGridlines = edit.majorGridlines;
|
|
3624
|
+
}
|
|
3625
|
+
if (edit.minorGridlines !== void 0) {
|
|
3626
|
+
axis.minorGridlines = edit.minorGridlines;
|
|
3627
|
+
}
|
|
3628
|
+
if (edit.displayUnits !== void 0) {
|
|
3629
|
+
axis.displayUnits = edit.displayUnits ?? void 0;
|
|
3630
|
+
}
|
|
3631
|
+
if (edit.displayUnitsValue !== void 0) {
|
|
3632
|
+
axis.displayUnitsValue = edit.displayUnitsValue ?? void 0;
|
|
3633
|
+
}
|
|
3634
|
+
if (edit.displayUnitsLabel !== void 0) {
|
|
3635
|
+
axis.displayUnitsLabel = edit.displayUnitsLabel;
|
|
3636
|
+
}
|
|
3637
|
+
if (edit.visible !== void 0) {
|
|
3638
|
+
axis.deleted = !edit.visible;
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
function setChartSeriesMarker(element, seriesIndex, marker) {
|
|
3642
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3643
|
+
const series = element.chartData.series[seriesIndex];
|
|
3644
|
+
if (marker === null) {
|
|
3645
|
+
series.marker = void 0;
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
const existing = series.marker;
|
|
3649
|
+
if ("symbol" in marker && "spPr" in marker) {
|
|
3650
|
+
series.marker = marker;
|
|
3651
|
+
return;
|
|
3652
|
+
}
|
|
3653
|
+
const patch = marker;
|
|
3654
|
+
const next = {
|
|
3655
|
+
symbol: patch.symbol ?? existing?.symbol ?? "circle",
|
|
3656
|
+
size: patch.size ?? existing?.size,
|
|
3657
|
+
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
3658
|
+
};
|
|
3659
|
+
if (patch.fillColor !== void 0) {
|
|
3660
|
+
next.spPr = { ...next.spPr ?? {}, fillColor: patch.fillColor };
|
|
3661
|
+
}
|
|
3662
|
+
series.marker = next;
|
|
3663
|
+
}
|
|
3664
|
+
function ensureDataPoint(series, pointIndex) {
|
|
3665
|
+
const points4 = series.dataPoints ??= [];
|
|
3666
|
+
let dp = points4.find((p) => p.idx === pointIndex);
|
|
3667
|
+
if (!dp) {
|
|
3668
|
+
dp = { idx: pointIndex };
|
|
3669
|
+
points4.push(dp);
|
|
3670
|
+
points4.sort((a, b) => a.idx - b.idx);
|
|
3671
|
+
}
|
|
3672
|
+
return dp;
|
|
3673
|
+
}
|
|
3674
|
+
function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion) {
|
|
3675
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3676
|
+
const series = element.chartData.series[seriesIndex];
|
|
3677
|
+
if (explosion === null) {
|
|
3678
|
+
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
3679
|
+
if (dp2) {
|
|
3680
|
+
dp2.explosion = void 0;
|
|
3681
|
+
removeEmptyDataPoint(series, pointIndex);
|
|
3682
|
+
}
|
|
3683
|
+
return;
|
|
3684
|
+
}
|
|
3685
|
+
const dp = ensureDataPoint(series, pointIndex);
|
|
3686
|
+
dp.explosion = explosion;
|
|
3687
|
+
}
|
|
3688
|
+
function setChartDataPointMarker(element, seriesIndex, pointIndex, marker) {
|
|
3689
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3690
|
+
const series = element.chartData.series[seriesIndex];
|
|
3691
|
+
if (marker === null) {
|
|
3692
|
+
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
3693
|
+
if (dp2) {
|
|
3694
|
+
dp2.marker = void 0;
|
|
3695
|
+
removeEmptyDataPoint(series, pointIndex);
|
|
3696
|
+
}
|
|
3697
|
+
return;
|
|
3698
|
+
}
|
|
3699
|
+
const dp = ensureDataPoint(series, pointIndex);
|
|
3700
|
+
const existing = dp.marker;
|
|
3701
|
+
const next = {
|
|
3702
|
+
symbol: marker.symbol ?? existing?.symbol ?? "circle",
|
|
3703
|
+
size: marker.size ?? existing?.size,
|
|
3704
|
+
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
3705
|
+
};
|
|
3706
|
+
if (marker.fillColor !== void 0) {
|
|
3707
|
+
next.spPr = { ...next.spPr ?? {}, fillColor: marker.fillColor };
|
|
3708
|
+
}
|
|
3709
|
+
dp.marker = next;
|
|
3710
|
+
}
|
|
3711
|
+
function applyLabelEdit(label, edit) {
|
|
3712
|
+
if (edit.showValue !== void 0) {
|
|
3713
|
+
label.showVal = edit.showValue;
|
|
3714
|
+
}
|
|
3715
|
+
if (edit.showCategory !== void 0) {
|
|
3716
|
+
label.showCatName = edit.showCategory;
|
|
3717
|
+
}
|
|
3718
|
+
if (edit.showSeriesName !== void 0) {
|
|
3719
|
+
label.showSerName = edit.showSeriesName;
|
|
3720
|
+
}
|
|
3721
|
+
if (edit.showPercent !== void 0) {
|
|
3722
|
+
label.showPercent = edit.showPercent;
|
|
3723
|
+
}
|
|
3724
|
+
if (edit.showLegendKey !== void 0) {
|
|
3725
|
+
label.showLegendKey = edit.showLegendKey;
|
|
3726
|
+
}
|
|
3727
|
+
if (edit.position !== void 0) {
|
|
3728
|
+
label.position = edit.position;
|
|
3729
|
+
}
|
|
3730
|
+
if (edit.text !== void 0) {
|
|
3731
|
+
label.text = edit.text === "" ? void 0 : edit.text;
|
|
3732
|
+
}
|
|
3733
|
+
if (edit.spPr !== void 0) {
|
|
3734
|
+
label.spPr = edit.spPr === null ? void 0 : { ...label.spPr ?? {}, ...edit.spPr };
|
|
3735
|
+
}
|
|
3736
|
+
if (edit.txPr !== void 0) {
|
|
3737
|
+
label.txPr = edit.txPr === null ? void 0 : { ...label.txPr ?? {}, ...edit.txPr };
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
|
|
3741
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3742
|
+
const series = element.chartData.series[seriesIndex];
|
|
3743
|
+
if (edit === null) {
|
|
3744
|
+
if (!series.dataLabels) {
|
|
3745
|
+
return;
|
|
3746
|
+
}
|
|
3747
|
+
series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
|
|
3748
|
+
if (series.dataLabels.length === 0) {
|
|
3749
|
+
series.dataLabels = void 0;
|
|
3750
|
+
}
|
|
3751
|
+
return;
|
|
3752
|
+
}
|
|
3753
|
+
const labels = series.dataLabels ??= [];
|
|
3754
|
+
let label = labels.find((l) => l.idx === pointIndex);
|
|
3755
|
+
if (!label) {
|
|
3756
|
+
label = { idx: pointIndex };
|
|
3757
|
+
labels.push(label);
|
|
3758
|
+
labels.sort((a, b) => a.idx - b.idx);
|
|
3759
|
+
}
|
|
3760
|
+
applyLabelEdit(label, edit);
|
|
3761
|
+
}
|
|
3762
|
+
function removeEmptyDataPoint(series, pointIndex) {
|
|
3763
|
+
if (!series.dataPoints) {
|
|
3764
|
+
return;
|
|
3765
|
+
}
|
|
3766
|
+
const dp = series.dataPoints.find((p) => p.idx === pointIndex);
|
|
3767
|
+
if (!dp) {
|
|
3768
|
+
return;
|
|
3769
|
+
}
|
|
3770
|
+
const empty = dp.spPr === void 0 && dp.gradientFill === void 0 && dp.explosion === void 0 && dp.invertIfNegative === void 0 && dp.bubble3D === void 0 && dp.marker === void 0;
|
|
3771
|
+
if (empty) {
|
|
3772
|
+
series.dataPoints = series.dataPoints.filter((p) => p.idx !== pointIndex);
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
var init_chart_operations = __esm({
|
|
3776
|
+
"src/pptx/core/builders/sdk/chart-operations.ts"() {
|
|
3777
|
+
}
|
|
3778
|
+
});
|
|
3779
|
+
|
|
3780
|
+
// src/pptx/core/builders/sdk/chart-layout-operations.ts
|
|
3781
|
+
function setChartGroupOptions(element, options) {
|
|
3782
|
+
ensureChartData(element);
|
|
3783
|
+
applyChartGroupOptionsInput(element.chartData, options);
|
|
3784
|
+
}
|
|
3785
|
+
function setChartAreaFormat(element, area, format) {
|
|
3786
|
+
ensureChartData(element);
|
|
3787
|
+
applyChartAreaFormatInput(element.chartData, area, format);
|
|
3788
|
+
}
|
|
3789
|
+
function applyChartInputLayout(element, input) {
|
|
3790
|
+
setChartGroupOptions(element, {
|
|
3791
|
+
...input.gapWidth !== void 0 ? { gapWidth: input.gapWidth } : {},
|
|
3792
|
+
...input.overlap !== void 0 ? { overlap: input.overlap } : {},
|
|
3793
|
+
...input.firstSliceAngle !== void 0 ? { firstSliceAngle: input.firstSliceAngle } : {},
|
|
3794
|
+
...input.holeSize !== void 0 ? { holeSize: input.holeSize } : {}
|
|
3795
|
+
});
|
|
3796
|
+
if (input.chartArea) {
|
|
3797
|
+
setChartAreaFormat(element, "chart", input.chartArea);
|
|
3798
|
+
}
|
|
3799
|
+
if (input.plotArea) {
|
|
3800
|
+
setChartAreaFormat(element, "plot", input.plotArea);
|
|
3801
|
+
}
|
|
3802
|
+
for (const [axisType, edit] of Object.entries(input.axes ?? {})) {
|
|
3803
|
+
if (edit) {
|
|
3804
|
+
setChartAxis(element, axisType, edit);
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
var init_chart_layout_operations = __esm({
|
|
3809
|
+
"src/pptx/core/builders/sdk/chart-layout-operations.ts"() {
|
|
3810
|
+
init_chart_layout_input();
|
|
3811
|
+
init_chart_operations();
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
|
|
2991
3815
|
// src/pptx/core/builders/sdk/ElementFactory.ts
|
|
2992
3816
|
function generateId(prefix) {
|
|
2993
3817
|
idCounter += 1;
|
|
@@ -3331,12 +4155,14 @@ function createChartElement(chartType, input, options) {
|
|
|
3331
4155
|
legendPosition: input.legendPosition
|
|
3332
4156
|
}
|
|
3333
4157
|
};
|
|
3334
|
-
|
|
4158
|
+
const element = {
|
|
3335
4159
|
type: "chart",
|
|
3336
4160
|
id: generateId("cht"),
|
|
3337
4161
|
...p,
|
|
3338
4162
|
chartData
|
|
3339
4163
|
};
|
|
4164
|
+
applyChartInputLayout(element, input);
|
|
4165
|
+
return element;
|
|
3340
4166
|
}
|
|
3341
4167
|
function createMediaElement(mediaType, source, options) {
|
|
3342
4168
|
const p = pos("media", options);
|
|
@@ -3402,6 +4228,7 @@ var init_ElementFactory = __esm({
|
|
|
3402
4228
|
init_table_style_defaults();
|
|
3403
4229
|
init_custom_geometry();
|
|
3404
4230
|
init_chart_gradient_input();
|
|
4231
|
+
init_chart_layout_operations();
|
|
3405
4232
|
idCounter = 0;
|
|
3406
4233
|
DEFAULTS = {
|
|
3407
4234
|
text: { x: 100, y: 100, width: 600, height: 50 },
|
|
@@ -14881,7 +15708,7 @@ function nsGet(obj, localName28) {
|
|
|
14881
15708
|
return obj[localName28];
|
|
14882
15709
|
}
|
|
14883
15710
|
for (const key2 of Object.keys(obj)) {
|
|
14884
|
-
if (
|
|
15711
|
+
if (localNameOf3(key2) === localName28 && !key2.startsWith("@_")) {
|
|
14885
15712
|
return obj[key2];
|
|
14886
15713
|
}
|
|
14887
15714
|
}
|
|
@@ -14893,13 +15720,13 @@ function nsAttr(obj, localName28) {
|
|
|
14893
15720
|
return direct;
|
|
14894
15721
|
}
|
|
14895
15722
|
for (const key2 of Object.keys(obj)) {
|
|
14896
|
-
if (key2.startsWith("@_") &&
|
|
15723
|
+
if (key2.startsWith("@_") && localNameOf3(key2.slice(2)) === localName28) {
|
|
14897
15724
|
return obj[key2];
|
|
14898
15725
|
}
|
|
14899
15726
|
}
|
|
14900
15727
|
return void 0;
|
|
14901
15728
|
}
|
|
14902
|
-
function
|
|
15729
|
+
function localNameOf3(key2) {
|
|
14903
15730
|
const colon = key2.indexOf(":");
|
|
14904
15731
|
return colon >= 0 ? key2.slice(colon + 1) : key2;
|
|
14905
15732
|
}
|
|
@@ -14919,7 +15746,7 @@ function collectByLocalName(node, localName28) {
|
|
|
14919
15746
|
if (key2.startsWith("@_") || key2 === "#text") {
|
|
14920
15747
|
continue;
|
|
14921
15748
|
}
|
|
14922
|
-
if (
|
|
15749
|
+
if (localNameOf3(key2) === localName28) {
|
|
14923
15750
|
for (const item of ensureArray(value)) {
|
|
14924
15751
|
found.push(item);
|
|
14925
15752
|
}
|
|
@@ -14975,7 +15802,7 @@ function resolveTiltMode(strokes) {
|
|
|
14975
15802
|
}
|
|
14976
15803
|
function buildInkMlContent(strokes, rawXml) {
|
|
14977
15804
|
const data = rawXml ? { ...rawXml } : {};
|
|
14978
|
-
const existingKey = Object.keys(data).find((key2) =>
|
|
15805
|
+
const existingKey = Object.keys(data).find((key2) => localNameOf4(key2) === "ink");
|
|
14979
15806
|
const existingRoot = existingKey ? data[existingKey] : void 0;
|
|
14980
15807
|
const root = existingRoot ? { ...existingRoot } : {};
|
|
14981
15808
|
root["@_xmlns:ink"] = INKML_NAMESPACE;
|
|
@@ -15020,13 +15847,13 @@ function deleteStaleInkChildren(root) {
|
|
|
15020
15847
|
if (key2.startsWith("ink:") || key2.startsWith("@_") || key2 === "#text") {
|
|
15021
15848
|
continue;
|
|
15022
15849
|
}
|
|
15023
|
-
const local =
|
|
15850
|
+
const local = localNameOf4(key2);
|
|
15024
15851
|
if (local === "trace" || local === "brush" || local === "traceGroup" || local === "definitions") {
|
|
15025
15852
|
delete root[key2];
|
|
15026
15853
|
}
|
|
15027
15854
|
}
|
|
15028
15855
|
}
|
|
15029
|
-
function
|
|
15856
|
+
function localNameOf4(key2) {
|
|
15030
15857
|
const colon = key2.indexOf(":");
|
|
15031
15858
|
return colon >= 0 ? key2.slice(colon + 1) : key2;
|
|
15032
15859
|
}
|
|
@@ -16500,7 +17327,7 @@ var init_xml_access = __esm({
|
|
|
16500
17327
|
});
|
|
16501
17328
|
|
|
16502
17329
|
// src/pptx/core/utils/chart-xlsx-sheet-cells.ts
|
|
16503
|
-
function
|
|
17330
|
+
function toArray2(value) {
|
|
16504
17331
|
if (Array.isArray(value)) {
|
|
16505
17332
|
return value;
|
|
16506
17333
|
}
|
|
@@ -16524,7 +17351,7 @@ function ensureCell(sheetData, ref) {
|
|
|
16524
17351
|
return void 0;
|
|
16525
17352
|
}
|
|
16526
17353
|
const rowNumber = address.row + 1;
|
|
16527
|
-
const rows =
|
|
17354
|
+
const rows = toArray2(sheetData["row"]);
|
|
16528
17355
|
let row = rows.find((r) => Number(r["@_r"]) === rowNumber);
|
|
16529
17356
|
if (!row) {
|
|
16530
17357
|
row = { "@_r": String(rowNumber), c: [] };
|
|
@@ -16536,7 +17363,7 @@ function ensureCell(sheetData, ref) {
|
|
|
16536
17363
|
}
|
|
16537
17364
|
sheetData["row"] = rows;
|
|
16538
17365
|
}
|
|
16539
|
-
const cells2 =
|
|
17366
|
+
const cells2 = toArray2(row["c"]);
|
|
16540
17367
|
let cell = cells2.find((c) => String(c["@_r"] ?? "") === ref);
|
|
16541
17368
|
if (!cell) {
|
|
16542
17369
|
cell = { "@_r": ref };
|
|
@@ -22905,7 +23732,7 @@ var init_smartart_layout_interpreter_choose_composite = __esm({
|
|
|
22905
23732
|
});
|
|
22906
23733
|
|
|
22907
23734
|
// src/pptx/core/utils/smartart-layout-interpreter-choose-algorithm.ts
|
|
22908
|
-
function branchAlg(raw, nodeCount, context,
|
|
23735
|
+
function branchAlg(raw, nodeCount, context, allowedTypes2 = CHOOSE_ALG_TYPES) {
|
|
22909
23736
|
if (!raw) {
|
|
22910
23737
|
return void 0;
|
|
22911
23738
|
}
|
|
@@ -22929,7 +23756,7 @@ function branchAlg(raw, nodeCount, context, allowedTypes = CHOOSE_ALG_TYPES) {
|
|
|
22929
23756
|
if (name === "alg") {
|
|
22930
23757
|
for (const candidate of Array.isArray(entry) ? entry : [entry]) {
|
|
22931
23758
|
const type = candidate && typeof candidate === "object" ? String(candidate["@_type"] ?? "") : "";
|
|
22932
|
-
if (
|
|
23759
|
+
if (allowedTypes2.has(type)) {
|
|
22933
23760
|
found = { type, raw: candidate };
|
|
22934
23761
|
return;
|
|
22935
23762
|
}
|
|
@@ -23010,7 +23837,7 @@ function chooseAlgorithm(node, nodeCount, context = {}) {
|
|
|
23010
23837
|
}
|
|
23011
23838
|
return void 0;
|
|
23012
23839
|
}
|
|
23013
|
-
function chooseAlgorithmOfType(node, nodeCount,
|
|
23840
|
+
function chooseAlgorithmOfType(node, nodeCount, allowedTypes2, context = {}) {
|
|
23014
23841
|
if (!node.choose || node.choose.length === 0) {
|
|
23015
23842
|
return void 0;
|
|
23016
23843
|
}
|
|
@@ -23019,7 +23846,7 @@ function chooseAlgorithmOfType(node, nodeCount, allowedTypes, context = {}) {
|
|
|
23019
23846
|
activeBranch(choose, nodeCount, context),
|
|
23020
23847
|
nodeCount,
|
|
23021
23848
|
context,
|
|
23022
|
-
|
|
23849
|
+
allowedTypes2
|
|
23023
23850
|
);
|
|
23024
23851
|
if (found) {
|
|
23025
23852
|
const parameters = parseBranchAlgParams(found.raw);
|
|
@@ -37432,7 +38259,7 @@ var init_smartart_node_style_apply = __esm({
|
|
|
37432
38259
|
});
|
|
37433
38260
|
|
|
37434
38261
|
// src/pptx/core/utils/smartart-pres-layout-vars.ts
|
|
37435
|
-
function
|
|
38262
|
+
function localNameOf5(key2) {
|
|
37436
38263
|
const idx = key2.indexOf(":");
|
|
37437
38264
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
37438
38265
|
}
|
|
@@ -37453,7 +38280,7 @@ function findVarsContainer(node) {
|
|
|
37453
38280
|
if (key2.startsWith("@_")) {
|
|
37454
38281
|
continue;
|
|
37455
38282
|
}
|
|
37456
|
-
if (CONTAINER_LOCAL_NAMES.has(
|
|
38283
|
+
if (CONTAINER_LOCAL_NAMES.has(localNameOf5(key2))) {
|
|
37457
38284
|
const container2 = Array.isArray(value) ? value[0] : value;
|
|
37458
38285
|
if (container2 && typeof container2 === "object") {
|
|
37459
38286
|
return container2;
|
|
@@ -37468,7 +38295,7 @@ function findVarsContainer(node) {
|
|
|
37468
38295
|
}
|
|
37469
38296
|
function presNameOf(pt) {
|
|
37470
38297
|
for (const [key2, value] of Object.entries(pt)) {
|
|
37471
|
-
if (key2.startsWith("@_") ||
|
|
38298
|
+
if (key2.startsWith("@_") || localNameOf5(key2) !== "prSet") {
|
|
37472
38299
|
continue;
|
|
37473
38300
|
}
|
|
37474
38301
|
const prSet = Array.isArray(value) ? value[0] : value;
|
|
@@ -37496,7 +38323,7 @@ function findNamedPresVars(node, presName) {
|
|
|
37496
38323
|
if (key2.startsWith("@_")) {
|
|
37497
38324
|
continue;
|
|
37498
38325
|
}
|
|
37499
|
-
if (
|
|
38326
|
+
if (localNameOf5(key2) === "pt") {
|
|
37500
38327
|
for (const pt of Array.isArray(value) ? value : [value]) {
|
|
37501
38328
|
if (pt && typeof pt === "object" && presNameOf(pt) === presName) {
|
|
37502
38329
|
const vars = findVarsContainer(pt);
|
|
@@ -37515,7 +38342,7 @@ function findNamedPresVars(node, presName) {
|
|
|
37515
38342
|
}
|
|
37516
38343
|
function varValue(container2, name) {
|
|
37517
38344
|
for (const [key2, value] of Object.entries(container2)) {
|
|
37518
|
-
if (key2.startsWith("@_") ||
|
|
38345
|
+
if (key2.startsWith("@_") || localNameOf5(key2) !== name) {
|
|
37519
38346
|
continue;
|
|
37520
38347
|
}
|
|
37521
38348
|
const node = Array.isArray(value) ? value[0] : value;
|
|
@@ -38360,7 +39187,7 @@ var init_smartart_effect_intensity = __esm({
|
|
|
38360
39187
|
});
|
|
38361
39188
|
|
|
38362
39189
|
// src/pptx/core/utils/smartart-color-lists.ts
|
|
38363
|
-
function
|
|
39190
|
+
function localNameOf6(key2) {
|
|
38364
39191
|
const idx = key2.indexOf(":");
|
|
38365
39192
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
38366
39193
|
}
|
|
@@ -38373,7 +39200,7 @@ function parseSmartArtColorListHexes(list2, deps) {
|
|
|
38373
39200
|
if (key2.startsWith("@_")) {
|
|
38374
39201
|
continue;
|
|
38375
39202
|
}
|
|
38376
|
-
const local =
|
|
39203
|
+
const local = localNameOf6(key2);
|
|
38377
39204
|
if (!COLOR_LOCAL_NAMES.has(local)) {
|
|
38378
39205
|
continue;
|
|
38379
39206
|
}
|
|
@@ -41069,7 +41896,7 @@ var init_chart_shape_props_writer = __esm({
|
|
|
41069
41896
|
});
|
|
41070
41897
|
|
|
41071
41898
|
// src/pptx/core/utils/chart-marker-serializer.ts
|
|
41072
|
-
function
|
|
41899
|
+
function findKey4(obj, local, getLocalName2) {
|
|
41073
41900
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
41074
41901
|
}
|
|
41075
41902
|
function insertOrdered(seriesNode, key2, value, getLocalName2) {
|
|
@@ -41103,7 +41930,7 @@ function buildChartMarkerXml(existing, marker, getLocalName2, resolveColor2) {
|
|
|
41103
41930
|
if (marker.size !== void 0) {
|
|
41104
41931
|
node["c:size"] = { "@_val": String(marker.size) };
|
|
41105
41932
|
}
|
|
41106
|
-
const existingSpPr = existing ? existing[
|
|
41933
|
+
const existingSpPr = existing ? existing[findKey4(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
41107
41934
|
const spPr = buildMarkerSpPr(existingSpPr, marker, getLocalName2, resolveColor2);
|
|
41108
41935
|
if (spPr) {
|
|
41109
41936
|
node["c:spPr"] = spPr;
|
|
@@ -41119,7 +41946,7 @@ function buildChartMarkerXml(existing, marker, getLocalName2, resolveColor2) {
|
|
|
41119
41946
|
return node;
|
|
41120
41947
|
}
|
|
41121
41948
|
function applySeriesMarkerToXml(seriesNode, marker, getLocalName2, resolveColor2) {
|
|
41122
|
-
const existingKey =
|
|
41949
|
+
const existingKey = findKey4(seriesNode, "marker", getLocalName2);
|
|
41123
41950
|
if (!marker) {
|
|
41124
41951
|
if (existingKey) {
|
|
41125
41952
|
delete seriesNode[existingKey];
|
|
@@ -41156,7 +41983,7 @@ var init_chart_marker_serializer = __esm({
|
|
|
41156
41983
|
});
|
|
41157
41984
|
|
|
41158
41985
|
// src/pptx/core/utils/chart-datapoint-serializer.ts
|
|
41159
|
-
function
|
|
41986
|
+
function findKey5(obj, local, getLocalName2) {
|
|
41160
41987
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
41161
41988
|
}
|
|
41162
41989
|
function ensureArray2(v) {
|
|
@@ -41195,7 +42022,7 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
41195
42022
|
if (dp.invertIfNegative !== void 0) {
|
|
41196
42023
|
node["c:invertIfNegative"] = { "@_val": dp.invertIfNegative ? "1" : "0" };
|
|
41197
42024
|
}
|
|
41198
|
-
const existingMarker = existing ? existing[
|
|
42025
|
+
const existingMarker = existing ? existing[findKey5(existing, "marker", getLocalName2) ?? ""] : void 0;
|
|
41199
42026
|
if (dp.marker) {
|
|
41200
42027
|
node["c:marker"] = buildChartMarkerXml(existingMarker, dp.marker, getLocalName2, resolveColor2);
|
|
41201
42028
|
} else if (existingMarker) {
|
|
@@ -41204,7 +42031,7 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
41204
42031
|
if (dp.bubble3D !== void 0) {
|
|
41205
42032
|
node["c:bubble3D"] = { "@_val": dp.bubble3D ? "1" : "0" };
|
|
41206
42033
|
} else if (existing) {
|
|
41207
|
-
const bubbleKey =
|
|
42034
|
+
const bubbleKey = findKey5(existing, "bubble3D", getLocalName2);
|
|
41208
42035
|
if (bubbleKey) {
|
|
41209
42036
|
node[bubbleKey] = existing[bubbleKey];
|
|
41210
42037
|
}
|
|
@@ -41212,12 +42039,12 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
41212
42039
|
if (dp.explosion !== void 0) {
|
|
41213
42040
|
node["c:explosion"] = { "@_val": String(dp.explosion) };
|
|
41214
42041
|
}
|
|
41215
|
-
const existingSpPr = existing ? existing[
|
|
42042
|
+
const existingSpPr = existing ? existing[findKey5(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
41216
42043
|
const spPr = buildDptSpPr(existingSpPr, dp, getLocalName2, resolveColor2, gradient);
|
|
41217
42044
|
if (spPr) {
|
|
41218
42045
|
node["c:spPr"] = spPr;
|
|
41219
42046
|
}
|
|
41220
|
-
const existingPictureOptions = existing ? existing[
|
|
42047
|
+
const existingPictureOptions = existing ? existing[findKey5(existing, "pictureOptions", getLocalName2) ?? ""] : void 0;
|
|
41221
42048
|
const pictureOptions = buildDptPictureOptions(existingPictureOptions, dp.picture);
|
|
41222
42049
|
if (pictureOptions) {
|
|
41223
42050
|
node["c:pictureOptions"] = pictureOptions;
|
|
@@ -41235,11 +42062,11 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
41235
42062
|
return node;
|
|
41236
42063
|
}
|
|
41237
42064
|
function applySeriesDataPointsToXml(seriesNode, dataPoints, getLocalName2, resolveColor2, gradient) {
|
|
41238
|
-
const existingKey =
|
|
42065
|
+
const existingKey = findKey5(seriesNode, "dPt", getLocalName2);
|
|
41239
42066
|
const existingNodes = existingKey ? ensureArray2(seriesNode[existingKey]) : [];
|
|
41240
42067
|
const byIdx = /* @__PURE__ */ new Map();
|
|
41241
42068
|
for (const node of existingNodes) {
|
|
41242
|
-
const idxNode = node[
|
|
42069
|
+
const idxNode = node[findKey5(node, "idx", getLocalName2) ?? ""];
|
|
41243
42070
|
const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
|
|
41244
42071
|
if (Number.isFinite(idx)) {
|
|
41245
42072
|
byIdx.set(idx, node);
|
|
@@ -41269,7 +42096,7 @@ function applySeriesDataPointsToXml(seriesNode, dataPoints, getLocalName2, resol
|
|
|
41269
42096
|
}
|
|
41270
42097
|
}
|
|
41271
42098
|
function applySeriesPictureOptionsToXml(seriesNode, picture, getLocalName2) {
|
|
41272
|
-
const existingKey =
|
|
42099
|
+
const existingKey = findKey5(seriesNode, "pictureOptions", getLocalName2);
|
|
41273
42100
|
const existing = existingKey ? seriesNode[existingKey] : void 0;
|
|
41274
42101
|
const built = buildDptPictureOptions(existing, picture);
|
|
41275
42102
|
if (existingKey) {
|
|
@@ -41410,7 +42237,7 @@ var init_chart_series_identity = __esm({
|
|
|
41410
42237
|
});
|
|
41411
42238
|
|
|
41412
42239
|
// src/pptx/core/utils/chart-series-detail-parser.ts
|
|
41413
|
-
function
|
|
42240
|
+
function localNameOf7(key2) {
|
|
41414
42241
|
return key2.replace(/^.*:/u, "");
|
|
41415
42242
|
}
|
|
41416
42243
|
function safeInt2(val) {
|
|
@@ -41548,7 +42375,7 @@ function parseSeriesDataPoints(seriesNode, xmlLookup, colorParser, parseGradient
|
|
|
41548
42375
|
if (bubble3D !== void 0) {
|
|
41549
42376
|
result.bubble3D = bubble3D;
|
|
41550
42377
|
}
|
|
41551
|
-
const uniqueId = parseChartUniqueId(node,
|
|
42378
|
+
const uniqueId = parseChartUniqueId(node, localNameOf7);
|
|
41552
42379
|
if (uniqueId !== void 0) {
|
|
41553
42380
|
result.uniqueId = uniqueId;
|
|
41554
42381
|
}
|
|
@@ -41632,7 +42459,7 @@ var init_chart_data_table_parser = __esm({
|
|
|
41632
42459
|
});
|
|
41633
42460
|
|
|
41634
42461
|
// src/pptx/core/utils/chart-data-label-field-table.ts
|
|
41635
|
-
function
|
|
42462
|
+
function localNameOf8(key2) {
|
|
41636
42463
|
const colonIndex = key2.lastIndexOf(":");
|
|
41637
42464
|
return colonIndex >= 0 ? key2.slice(colonIndex + 1) : key2;
|
|
41638
42465
|
}
|
|
@@ -41659,7 +42486,7 @@ function collectByLocalName2(node, target, out) {
|
|
|
41659
42486
|
const items = Array.isArray(child27) ? child27 : [child27];
|
|
41660
42487
|
for (const item of items) {
|
|
41661
42488
|
if (item && typeof item === "object") {
|
|
41662
|
-
if (
|
|
42489
|
+
if (localNameOf8(key2) === target) {
|
|
41663
42490
|
out.push(item);
|
|
41664
42491
|
}
|
|
41665
42492
|
collectByLocalName2(item, target, out);
|
|
@@ -41855,7 +42682,7 @@ function dataLabelsRangeUnchanged(dLbls, range, showDataLabelsRange, getLocalNam
|
|
|
41855
42682
|
}
|
|
41856
42683
|
return existingRange.formula === range.formula && existingRange.cache.length === range.cache.length && existingRange.cache.every((value, idx) => value === range.cache[idx]) && existingShow === (showDataLabelsRange !== false);
|
|
41857
42684
|
}
|
|
41858
|
-
function
|
|
42685
|
+
function findKey6(obj, local, getLocalName2) {
|
|
41859
42686
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
41860
42687
|
}
|
|
41861
42688
|
function asExtArray(value) {
|
|
@@ -41871,9 +42698,9 @@ function applyDataLabelsRangeToDLbls(dLbls, range, showDataLabelsRange, getLocal
|
|
|
41871
42698
|
if (dataLabelsRangeUnchanged(dLbls, range, showDataLabelsRange, getLocalName2)) {
|
|
41872
42699
|
return;
|
|
41873
42700
|
}
|
|
41874
|
-
const extLstKey =
|
|
42701
|
+
const extLstKey = findKey6(dLbls, "extLst", getLocalName2) ?? "c:extLst";
|
|
41875
42702
|
const extLst = { ...dLbls[extLstKey] ?? {} };
|
|
41876
|
-
const extKey =
|
|
42703
|
+
const extKey = findKey6(extLst, "ext", getLocalName2);
|
|
41877
42704
|
const exts = extKey ? asExtArray(extLst[extKey]) : [];
|
|
41878
42705
|
const otherExts = exts.filter((ext) => ext["@_uri"] !== CHART15_EXT_URI);
|
|
41879
42706
|
const ownExt = { ...exts.find((ext) => ext["@_uri"] === CHART15_EXT_URI) ?? {} };
|
|
@@ -41962,7 +42789,7 @@ function scalar3(parent, name, xmlLookup) {
|
|
|
41962
42789
|
const node = xmlLookup.getChildByLocalName(parent, name);
|
|
41963
42790
|
return node?.["#text"] === void 0 ? void 0 : String(node["#text"]);
|
|
41964
42791
|
}
|
|
41965
|
-
function
|
|
42792
|
+
function localNameOf9(key2) {
|
|
41966
42793
|
const colonIndex = key2.lastIndexOf(":");
|
|
41967
42794
|
return colonIndex >= 0 ? key2.slice(colonIndex + 1) : key2;
|
|
41968
42795
|
}
|
|
@@ -42030,7 +42857,7 @@ function parseSeriesDataLabels(seriesNode, xmlLookup, colorParser, resolveTypefa
|
|
|
42030
42857
|
if (numberFormat !== void 0) {
|
|
42031
42858
|
result.numberFormat = numberFormat;
|
|
42032
42859
|
}
|
|
42033
|
-
const layout = parseChartManualLayout(node,
|
|
42860
|
+
const layout = parseChartManualLayout(node, localNameOf9);
|
|
42034
42861
|
if (layout) {
|
|
42035
42862
|
result.layout = layout;
|
|
42036
42863
|
}
|
|
@@ -42133,7 +42960,7 @@ var init_chart_data_label_parser = __esm({
|
|
|
42133
42960
|
|
|
42134
42961
|
// src/pptx/core/utils/chart-axis-dispunits-serializer.ts
|
|
42135
42962
|
function setOrdered(node, name, value, order, localName28) {
|
|
42136
|
-
const existing =
|
|
42963
|
+
const existing = findKey7(node, name, localName28);
|
|
42137
42964
|
if (existing) {
|
|
42138
42965
|
node[existing] = value;
|
|
42139
42966
|
return;
|
|
@@ -42225,7 +43052,7 @@ function applyLabel(node, edit, localName28, resolveColor2) {
|
|
|
42225
43052
|
if (edit === void 0) {
|
|
42226
43053
|
return;
|
|
42227
43054
|
}
|
|
42228
|
-
const key2 =
|
|
43055
|
+
const key2 = findKey7(node, "dispUnitsLbl", localName28);
|
|
42229
43056
|
if (edit === null) {
|
|
42230
43057
|
if (key2) {
|
|
42231
43058
|
delete node[key2];
|
|
@@ -42247,7 +43074,7 @@ function applyLabel(node, edit, localName28, resolveColor2) {
|
|
|
42247
43074
|
);
|
|
42248
43075
|
}
|
|
42249
43076
|
if (labelEdit.spPr !== void 0) {
|
|
42250
|
-
const spPrKey =
|
|
43077
|
+
const spPrKey = findKey7(label, "spPr", localName28);
|
|
42251
43078
|
if (labelEdit.spPr === null) {
|
|
42252
43079
|
if (spPrKey) {
|
|
42253
43080
|
delete label[spPrKey];
|
|
@@ -42275,7 +43102,7 @@ function applyLabel(node, edit, localName28, resolveColor2) {
|
|
|
42275
43102
|
);
|
|
42276
43103
|
}
|
|
42277
43104
|
function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName28, resolveColor2) {
|
|
42278
|
-
const existingKey =
|
|
43105
|
+
const existingKey = findKey7(axisNode, "dispUnits", localName28);
|
|
42279
43106
|
if (!axis.displayUnits) {
|
|
42280
43107
|
if (existingKey) {
|
|
42281
43108
|
delete axisNode[existingKey];
|
|
@@ -42289,7 +43116,7 @@ function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName28, resolveCol
|
|
|
42289
43116
|
...existingKey ? axisNode[existingKey] : void 0
|
|
42290
43117
|
};
|
|
42291
43118
|
for (const choice of ["custUnit", "builtInUnit"]) {
|
|
42292
|
-
const key2 =
|
|
43119
|
+
const key2 = findKey7(node, choice, localName28);
|
|
42293
43120
|
if (key2) {
|
|
42294
43121
|
delete node[key2];
|
|
42295
43122
|
}
|
|
@@ -42318,7 +43145,7 @@ function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName28, resolveCol
|
|
|
42318
43145
|
applyLabel(node, axis.displayUnitsLabel, localName28, resolveColor2);
|
|
42319
43146
|
setOrdered(axisNode, "dispUnits", node, ["dispUnits", "extLst"], localName28);
|
|
42320
43147
|
}
|
|
42321
|
-
var BUILT_IN_UNITS,
|
|
43148
|
+
var BUILT_IN_UNITS, findKey7;
|
|
42322
43149
|
var init_chart_axis_dispunits_serializer = __esm({
|
|
42323
43150
|
"src/pptx/core/utils/chart-axis-dispunits-serializer.ts"() {
|
|
42324
43151
|
init_chart_color_choice();
|
|
@@ -42335,7 +43162,7 @@ var init_chart_axis_dispunits_serializer = __esm({
|
|
|
42335
43162
|
"billions",
|
|
42336
43163
|
"trillions"
|
|
42337
43164
|
]);
|
|
42338
|
-
|
|
43165
|
+
findKey7 = (node, name, localName28) => Object.keys(node).find((key2) => localName28(key2) === name);
|
|
42339
43166
|
}
|
|
42340
43167
|
});
|
|
42341
43168
|
|
|
@@ -42352,11 +43179,11 @@ var init_chart_percent_union_value = __esm({
|
|
|
42352
43179
|
});
|
|
42353
43180
|
|
|
42354
43181
|
// src/pptx/core/utils/chart-axis-label-formatting.ts
|
|
42355
|
-
function
|
|
43182
|
+
function findKey8(node, name, localName28) {
|
|
42356
43183
|
return Object.keys(node).find((key2) => localName28(key2) === name);
|
|
42357
43184
|
}
|
|
42358
43185
|
function child8(node, name, localName28) {
|
|
42359
|
-
const key2 =
|
|
43186
|
+
const key2 = findKey8(node, name, localName28);
|
|
42360
43187
|
const value = key2 ? node[key2] : void 0;
|
|
42361
43188
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
42362
43189
|
}
|
|
@@ -42430,7 +43257,7 @@ function parseChartAxisLabelFormatting(node, axisType, localName28) {
|
|
|
42430
43257
|
return Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0));
|
|
42431
43258
|
}
|
|
42432
43259
|
function upsertOrdered(node, name, value, localName28) {
|
|
42433
|
-
const key2 =
|
|
43260
|
+
const key2 = findKey8(node, name, localName28);
|
|
42434
43261
|
if (key2) {
|
|
42435
43262
|
node[key2] = { ...node[key2], ...value };
|
|
42436
43263
|
return;
|
|
@@ -42469,13 +43296,13 @@ function applyChartAxisLabelFormatting(node, formatting, localName28) {
|
|
|
42469
43296
|
if (!Number.isFinite(formatting.crossesAt)) {
|
|
42470
43297
|
throw new RangeError("crossesAt must be finite");
|
|
42471
43298
|
}
|
|
42472
|
-
const crossesKey =
|
|
43299
|
+
const crossesKey = findKey8(node, "crosses", localName28);
|
|
42473
43300
|
if (crossesKey) {
|
|
42474
43301
|
delete node[crossesKey];
|
|
42475
43302
|
}
|
|
42476
43303
|
upsertOrdered(node, "crossesAt", { "@_val": String(formatting.crossesAt) }, localName28);
|
|
42477
43304
|
} else if (formatting.crosses !== void 0) {
|
|
42478
|
-
const crossesAtKey =
|
|
43305
|
+
const crossesAtKey = findKey8(node, "crossesAt", localName28);
|
|
42479
43306
|
if (crossesAtKey) {
|
|
42480
43307
|
delete node[crossesAtKey];
|
|
42481
43308
|
}
|
|
@@ -42627,9 +43454,30 @@ function applyChartAxisScaling(scalingNode, axis, getLocalName2) {
|
|
|
42627
43454
|
if (axis.orientation !== void 0) {
|
|
42628
43455
|
upsertChartAxisChild(scalingNode, "orientation", axis.orientation, getLocalName2);
|
|
42629
43456
|
}
|
|
43457
|
+
orderScalingChildren(scalingNode, getLocalName2);
|
|
42630
43458
|
}
|
|
43459
|
+
function orderScalingChildren(scalingNode, getLocalName2) {
|
|
43460
|
+
const rank = (key2) => {
|
|
43461
|
+
const index = SCALING_ORDER.indexOf(getLocalName2(key2));
|
|
43462
|
+
return index === -1 ? SCALING_ORDER.length : index;
|
|
43463
|
+
};
|
|
43464
|
+
const keys = Object.keys(scalingNode).filter((key2) => !key2.startsWith("@_"));
|
|
43465
|
+
const sorted = [...keys].sort((a, b) => rank(a) - rank(b));
|
|
43466
|
+
if (sorted.every((key2, i) => key2 === keys[i])) {
|
|
43467
|
+
return;
|
|
43468
|
+
}
|
|
43469
|
+
const entries = sorted.map((key2) => [key2, scalingNode[key2]]);
|
|
43470
|
+
for (const key2 of keys) {
|
|
43471
|
+
delete scalingNode[key2];
|
|
43472
|
+
}
|
|
43473
|
+
for (const [key2, value] of entries) {
|
|
43474
|
+
scalingNode[key2] = value;
|
|
43475
|
+
}
|
|
43476
|
+
}
|
|
43477
|
+
var SCALING_ORDER;
|
|
42631
43478
|
var init_chart_axis_scaling = __esm({
|
|
42632
43479
|
"src/pptx/core/utils/chart-axis-scaling.ts"() {
|
|
43480
|
+
SCALING_ORDER = ["logBase", "orientation", "max", "min"];
|
|
42633
43481
|
}
|
|
42634
43482
|
});
|
|
42635
43483
|
|
|
@@ -42717,7 +43565,7 @@ var init_chart_date_axis = __esm({
|
|
|
42717
43565
|
});
|
|
42718
43566
|
|
|
42719
43567
|
// src/pptx/core/utils/chart-title-xml-ops.ts
|
|
42720
|
-
function
|
|
43568
|
+
function findKey9(node, localName28, getLocalName2) {
|
|
42721
43569
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName28);
|
|
42722
43570
|
}
|
|
42723
43571
|
function replaceEntries(parent, entries) {
|
|
@@ -42735,7 +43583,7 @@ function insertAt2(parent, index, key2, value) {
|
|
|
42735
43583
|
}
|
|
42736
43584
|
function setAutoTitleDeleted(chartRoot, deleted, getLocalName2) {
|
|
42737
43585
|
const value = { "@_val": deleted ? "1" : "0" };
|
|
42738
|
-
const existingKey =
|
|
43586
|
+
const existingKey = findKey9(chartRoot, "autoTitleDeleted", getLocalName2);
|
|
42739
43587
|
if (existingKey) {
|
|
42740
43588
|
chartRoot[existingKey] = value;
|
|
42741
43589
|
return;
|
|
@@ -46652,9 +47500,9 @@ function parseKinsoku(presentationXml3) {
|
|
|
46652
47500
|
if (!presentationXml3) {
|
|
46653
47501
|
return void 0;
|
|
46654
47502
|
}
|
|
46655
|
-
const rootKey =
|
|
47503
|
+
const rootKey = findKey10(presentationXml3, "presentation");
|
|
46656
47504
|
const root = rootKey ? presentationXml3[rootKey] : void 0;
|
|
46657
|
-
const key2 = root ?
|
|
47505
|
+
const key2 = root ? findKey10(root, "kinsoku") : void 0;
|
|
46658
47506
|
const node = key2 && root ? root[key2] : void 0;
|
|
46659
47507
|
if (!node) {
|
|
46660
47508
|
return void 0;
|
|
@@ -46673,7 +47521,7 @@ function parseKinsoku(presentationXml3) {
|
|
|
46673
47521
|
return result;
|
|
46674
47522
|
}
|
|
46675
47523
|
function setAttribute2(node, name, value) {
|
|
46676
|
-
const key2 =
|
|
47524
|
+
const key2 = findKey10(node, name);
|
|
46677
47525
|
if (value === null) {
|
|
46678
47526
|
if (key2) {
|
|
46679
47527
|
delete node[key2];
|
|
@@ -46702,7 +47550,7 @@ function insertKinsoku(root, key2, value) {
|
|
|
46702
47550
|
return result;
|
|
46703
47551
|
}
|
|
46704
47552
|
function applyKinsokuToXml(presentation, kinsoku) {
|
|
46705
|
-
const existingKey =
|
|
47553
|
+
const existingKey = findKey10(presentation, "kinsoku");
|
|
46706
47554
|
if (kinsoku === void 0) {
|
|
46707
47555
|
return presentation;
|
|
46708
47556
|
}
|
|
@@ -46729,7 +47577,7 @@ function applyKinsokuToXml(presentation, kinsoku) {
|
|
|
46729
47577
|
Object.assign(presentation, rebuilt);
|
|
46730
47578
|
return presentation;
|
|
46731
47579
|
}
|
|
46732
|
-
var BEFORE_KINSOKU, localName8,
|
|
47580
|
+
var BEFORE_KINSOKU, localName8, findKey10;
|
|
46733
47581
|
var init_kinsoku_parser = __esm({
|
|
46734
47582
|
"src/pptx/core/utils/kinsoku-parser.ts"() {
|
|
46735
47583
|
BEFORE_KINSOKU = /* @__PURE__ */ new Set([
|
|
@@ -46746,7 +47594,7 @@ var init_kinsoku_parser = __esm({
|
|
|
46746
47594
|
"custDataLst"
|
|
46747
47595
|
]);
|
|
46748
47596
|
localName8 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
46749
|
-
|
|
47597
|
+
findKey10 = (node, name) => Object.keys(node).find((key2) => localName8(key2) === name);
|
|
46750
47598
|
}
|
|
46751
47599
|
});
|
|
46752
47600
|
|
|
@@ -51895,11 +52743,11 @@ function localName12(key2) {
|
|
|
51895
52743
|
const idx = key2.indexOf(":");
|
|
51896
52744
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
51897
52745
|
}
|
|
51898
|
-
function
|
|
52746
|
+
function findKey11(obj, local) {
|
|
51899
52747
|
return Object.keys(obj).find((k) => localName12(k) === local);
|
|
51900
52748
|
}
|
|
51901
52749
|
function ensureChild(obj, local, prefixedFallback) {
|
|
51902
|
-
const key2 =
|
|
52750
|
+
const key2 = findKey11(obj, local) ?? prefixedFallback;
|
|
51903
52751
|
const existing = obj[key2];
|
|
51904
52752
|
if (existing && typeof existing === "object" && !Array.isArray(existing)) {
|
|
51905
52753
|
return existing;
|
|
@@ -51915,7 +52763,7 @@ function solidFill2(color2) {
|
|
|
51915
52763
|
return { "a:srgbClr": { "@_val": hexValue(color2) } };
|
|
51916
52764
|
}
|
|
51917
52765
|
function setSolidFill(parent, color2) {
|
|
51918
|
-
const key2 =
|
|
52766
|
+
const key2 = findKey11(parent, "solidFill") ?? "a:solidFill";
|
|
51919
52767
|
parent[key2] = solidFill2(color2);
|
|
51920
52768
|
}
|
|
51921
52769
|
function applyShapeStyle(pt, style) {
|
|
@@ -51932,7 +52780,7 @@ function applyShapeStyle(pt, style) {
|
|
|
51932
52780
|
}
|
|
51933
52781
|
}
|
|
51934
52782
|
function ensureFirstRunRPr(pt) {
|
|
51935
|
-
const tKey =
|
|
52783
|
+
const tKey = findKey11(pt, "t");
|
|
51936
52784
|
if (!tKey) {
|
|
51937
52785
|
return void 0;
|
|
51938
52786
|
}
|
|
@@ -51940,7 +52788,7 @@ function ensureFirstRunRPr(pt) {
|
|
|
51940
52788
|
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
51941
52789
|
return void 0;
|
|
51942
52790
|
}
|
|
51943
|
-
const pKey =
|
|
52791
|
+
const pKey = findKey11(body, "p");
|
|
51944
52792
|
if (!pKey) {
|
|
51945
52793
|
return void 0;
|
|
51946
52794
|
}
|
|
@@ -51949,7 +52797,7 @@ function ensureFirstRunRPr(pt) {
|
|
|
51949
52797
|
if (!firstP || typeof firstP !== "object") {
|
|
51950
52798
|
return void 0;
|
|
51951
52799
|
}
|
|
51952
|
-
const rKey =
|
|
52800
|
+
const rKey = findKey11(firstP, "r");
|
|
51953
52801
|
if (!rKey) {
|
|
51954
52802
|
return void 0;
|
|
51955
52803
|
}
|
|
@@ -52987,7 +53835,7 @@ var init_layout_display_name = __esm({
|
|
|
52987
53835
|
});
|
|
52988
53836
|
|
|
52989
53837
|
// src/pptx/core/utils/chart-bubble-options.ts
|
|
52990
|
-
function
|
|
53838
|
+
function findKey12(node, name, localName28) {
|
|
52991
53839
|
return Object.keys(node).find((key2) => localName28(key2) === name);
|
|
52992
53840
|
}
|
|
52993
53841
|
function boolValue2(node) {
|
|
@@ -53002,7 +53850,7 @@ function parseBubbleChartOptions(container2, localName28) {
|
|
|
53002
53850
|
return void 0;
|
|
53003
53851
|
}
|
|
53004
53852
|
const node = (name) => {
|
|
53005
|
-
const key2 =
|
|
53853
|
+
const key2 = findKey12(container2, name, localName28);
|
|
53006
53854
|
return key2 ? container2[key2] : void 0;
|
|
53007
53855
|
};
|
|
53008
53856
|
const options = {};
|
|
@@ -53031,7 +53879,7 @@ function parseBubbleChartOptions(container2, localName28) {
|
|
|
53031
53879
|
return Object.keys(options).length > 0 ? options : void 0;
|
|
53032
53880
|
}
|
|
53033
53881
|
function insertOrdered2(container2, name, value, localName28) {
|
|
53034
|
-
const existingKey =
|
|
53882
|
+
const existingKey = findKey12(container2, name, localName28);
|
|
53035
53883
|
if (existingKey) {
|
|
53036
53884
|
container2[existingKey] = { ...container2[existingKey], ...value };
|
|
53037
53885
|
return;
|
|
@@ -53161,7 +54009,7 @@ function parseChartUpDownBars(chartContainer, xmlLookup, colorParser) {
|
|
|
53161
54009
|
return result;
|
|
53162
54010
|
}
|
|
53163
54011
|
function setOrdered2(node, name, value, order, localName28) {
|
|
53164
|
-
const key2 =
|
|
54012
|
+
const key2 = findKey13(node, name, localName28);
|
|
53165
54013
|
if (key2) {
|
|
53166
54014
|
node[key2] = value;
|
|
53167
54015
|
return;
|
|
@@ -53184,7 +54032,7 @@ function applyChartUpDownBars(chartContainer, options, localName28, resolveColor
|
|
|
53184
54032
|
if (options === void 0) {
|
|
53185
54033
|
return;
|
|
53186
54034
|
}
|
|
53187
|
-
const key2 =
|
|
54035
|
+
const key2 = findKey13(chartContainer, "upDownBars", localName28);
|
|
53188
54036
|
if (options === null) {
|
|
53189
54037
|
if (key2) {
|
|
53190
54038
|
delete chartContainer[key2];
|
|
@@ -53206,11 +54054,11 @@ function applyChartUpDownBars(chartContainer, options, localName28, resolveColor
|
|
|
53206
54054
|
if (!style) {
|
|
53207
54055
|
continue;
|
|
53208
54056
|
}
|
|
53209
|
-
const existingBar =
|
|
54057
|
+
const existingBar = findKey13(node, name, localName28);
|
|
53210
54058
|
const bar = {
|
|
53211
54059
|
...existingBar ? node[existingBar] : void 0
|
|
53212
54060
|
};
|
|
53213
|
-
const spPrKey =
|
|
54061
|
+
const spPrKey = findKey13(bar, "spPr", localName28) ?? "c:spPr";
|
|
53214
54062
|
bar[spPrKey] = writeChartShapeProps(
|
|
53215
54063
|
bar[spPrKey],
|
|
53216
54064
|
style,
|
|
@@ -53221,7 +54069,7 @@ function applyChartUpDownBars(chartContainer, options, localName28, resolveColor
|
|
|
53221
54069
|
}
|
|
53222
54070
|
setOrdered2(chartContainer, "upDownBars", node, CONTAINER_ORDER, localName28);
|
|
53223
54071
|
}
|
|
53224
|
-
var CONTAINER_ORDER,
|
|
54072
|
+
var CONTAINER_ORDER, findKey13;
|
|
53225
54073
|
var init_chart_up_down_bars = __esm({
|
|
53226
54074
|
"src/pptx/core/utils/chart-up-down-bars.ts"() {
|
|
53227
54075
|
init_chart_percent_union_value();
|
|
@@ -53240,7 +54088,7 @@ var init_chart_up_down_bars = __esm({
|
|
|
53240
54088
|
"axId",
|
|
53241
54089
|
"extLst"
|
|
53242
54090
|
];
|
|
53243
|
-
|
|
54091
|
+
findKey13 = (node, name, localName28) => Object.keys(node).find((key2) => localName28(key2) === name);
|
|
53244
54092
|
}
|
|
53245
54093
|
});
|
|
53246
54094
|
|
|
@@ -60593,9 +61441,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
60593
61441
|
}
|
|
60594
61442
|
const widthEmu = parseInt(String(node["@_w"] || "0"), 10);
|
|
60595
61443
|
if (widthEmu > 0) {
|
|
60596
|
-
style[`${prefix}Width`] =
|
|
60597
|
-
widthEmu / context.emuPerPx
|
|
60598
|
-
);
|
|
61444
|
+
style[`${prefix}Width`] = widthEmu / context.emuPerPx;
|
|
60599
61445
|
hasStyle = true;
|
|
60600
61446
|
}
|
|
60601
61447
|
const color2 = context.parseColor(node["a:solidFill"]);
|
|
@@ -60625,7 +61471,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
60625
61471
|
hasStyle = true;
|
|
60626
61472
|
}
|
|
60627
61473
|
if (w > 0) {
|
|
60628
|
-
style.borderDiagDownWidth =
|
|
61474
|
+
style.borderDiagDownWidth = w / context.emuPerPx;
|
|
60629
61475
|
hasStyle = true;
|
|
60630
61476
|
}
|
|
60631
61477
|
}
|
|
@@ -60638,7 +61484,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
60638
61484
|
hasStyle = true;
|
|
60639
61485
|
}
|
|
60640
61486
|
if (w > 0) {
|
|
60641
|
-
style.borderDiagUpWidth =
|
|
61487
|
+
style.borderDiagUpWidth = w / context.emuPerPx;
|
|
60642
61488
|
hasStyle = true;
|
|
60643
61489
|
}
|
|
60644
61490
|
}
|
|
@@ -60656,7 +61502,7 @@ function applyCellMarginStyle(cellProperties, style, context) {
|
|
|
60656
61502
|
return void 0;
|
|
60657
61503
|
}
|
|
60658
61504
|
const w = parseInt(String(node["@_w"]), 10);
|
|
60659
|
-
return Number.isFinite(w) && w >= 0 ?
|
|
61505
|
+
return Number.isFinite(w) && w >= 0 ? w / context.emuPerPx : void 0;
|
|
60660
61506
|
};
|
|
60661
61507
|
const ml = parseMargin(tcMar["a:marL"]);
|
|
60662
61508
|
const mr = parseMargin(tcMar["a:marR"]);
|
|
@@ -60690,7 +61536,7 @@ function applyCellMarginStyle(cellProperties, style, context) {
|
|
|
60690
61536
|
if (style[key2] === void 0 && raw !== void 0 && raw !== null) {
|
|
60691
61537
|
const v = parseInt(String(raw), 10);
|
|
60692
61538
|
if (Number.isFinite(v) && v >= 0) {
|
|
60693
|
-
style[key2] =
|
|
61539
|
+
style[key2] = v / context.emuPerPx;
|
|
60694
61540
|
hasStyle = true;
|
|
60695
61541
|
}
|
|
60696
61542
|
}
|
|
@@ -60986,6 +61832,10 @@ function applyRunProperties(run, runProperties2, context) {
|
|
|
60986
61832
|
if (fontFamily) {
|
|
60987
61833
|
run.fontFamily = fontFamily;
|
|
60988
61834
|
}
|
|
61835
|
+
const baseline = parseInt(String(runProperties2["@_baseline"] ?? ""), 10);
|
|
61836
|
+
if (Number.isFinite(baseline) && baseline !== 0) {
|
|
61837
|
+
run.baseline = baseline;
|
|
61838
|
+
}
|
|
60989
61839
|
}
|
|
60990
61840
|
function extractTableCellTextRuns(tableCell, context) {
|
|
60991
61841
|
const paragraphs = context.ensureArray(
|
|
@@ -89244,7 +90094,7 @@ function parseEmbeddedFontList(presentationData) {
|
|
|
89244
90094
|
};
|
|
89245
90095
|
}
|
|
89246
90096
|
function applyAttribute(node, name, value) {
|
|
89247
|
-
const key2 =
|
|
90097
|
+
const key2 = findKey14(node, name);
|
|
89248
90098
|
if (value === null) {
|
|
89249
90099
|
if (key2) {
|
|
89250
90100
|
delete node[key2];
|
|
@@ -89292,7 +90142,7 @@ function serializeEntry(entry) {
|
|
|
89292
90142
|
}
|
|
89293
90143
|
for (const name of ENTRY_ORDER) {
|
|
89294
90144
|
const edit = edits.get(name);
|
|
89295
|
-
const key2 =
|
|
90145
|
+
const key2 = findKey14(source, name) ?? `p:${name}`;
|
|
89296
90146
|
if (edit !== null && edit !== void 0) {
|
|
89297
90147
|
result[key2] = edit;
|
|
89298
90148
|
} else if (!edits.has(name) && source[key2] !== void 0) {
|
|
@@ -89311,7 +90161,7 @@ function serializeEmbeddedFontList(list2) {
|
|
|
89311
90161
|
throw new Error("CT_EmbeddedFontList requires at least one embeddedFont");
|
|
89312
90162
|
}
|
|
89313
90163
|
const source = { ...list2.rawXml ?? {} };
|
|
89314
|
-
const key2 =
|
|
90164
|
+
const key2 = findKey14(source, "embeddedFont") ?? "p:embeddedFont";
|
|
89315
90165
|
source[key2] = list2.fonts.map(serializeEntry);
|
|
89316
90166
|
return source;
|
|
89317
90167
|
}
|
|
@@ -89321,7 +90171,7 @@ function setEmbeddedFontList(presentationData, list2) {
|
|
|
89321
90171
|
return;
|
|
89322
90172
|
}
|
|
89323
90173
|
const root = presentationData[rootKey];
|
|
89324
|
-
const existingKey =
|
|
90174
|
+
const existingKey = findKey14(root, "embeddedFontLst");
|
|
89325
90175
|
const result = {};
|
|
89326
90176
|
let inserted = false;
|
|
89327
90177
|
for (const [key2, value] of Object.entries(root)) {
|
|
@@ -89340,7 +90190,7 @@ function setEmbeddedFontList(presentationData, list2) {
|
|
|
89340
90190
|
}
|
|
89341
90191
|
presentationData[rootKey] = result;
|
|
89342
90192
|
}
|
|
89343
|
-
var ENTRY_ORDER, PRESENTATION_BEFORE, localName16,
|
|
90193
|
+
var ENTRY_ORDER, PRESENTATION_BEFORE, localName16, findKey14, child16, children11;
|
|
89344
90194
|
var init_embedded_font_list = __esm({
|
|
89345
90195
|
"src/pptx/core/utils/embedded-font-list.ts"() {
|
|
89346
90196
|
ENTRY_ORDER = ["font", "regular", "bold", "italic", "boldItalic"];
|
|
@@ -89354,13 +90204,13 @@ var init_embedded_font_list = __esm({
|
|
|
89354
90204
|
"smartTags"
|
|
89355
90205
|
]);
|
|
89356
90206
|
localName16 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
89357
|
-
|
|
90207
|
+
findKey14 = (node, name) => Object.keys(node).find((key2) => localName16(key2) === name);
|
|
89358
90208
|
child16 = (node, name) => {
|
|
89359
|
-
const key2 =
|
|
90209
|
+
const key2 = findKey14(node, name);
|
|
89360
90210
|
return key2 ? node[key2] : void 0;
|
|
89361
90211
|
};
|
|
89362
90212
|
children11 = (node, name) => {
|
|
89363
|
-
const key2 =
|
|
90213
|
+
const key2 = findKey14(node, name);
|
|
89364
90214
|
const value = key2 ? node[key2] : void 0;
|
|
89365
90215
|
return Array.isArray(value) ? value : value ? [value] : [];
|
|
89366
90216
|
};
|
|
@@ -89875,7 +90725,7 @@ function parseChartBandFmts(seriesContainer, xmlLookup, colorParser) {
|
|
|
89875
90725
|
return result.length > 0 ? result : void 0;
|
|
89876
90726
|
}
|
|
89877
90727
|
function setOrdered3(node, name, value, order, localName28) {
|
|
89878
|
-
const key2 =
|
|
90728
|
+
const key2 = findKey15(node, name, localName28);
|
|
89879
90729
|
if (key2) {
|
|
89880
90730
|
node[key2] = value;
|
|
89881
90731
|
return;
|
|
@@ -89898,7 +90748,7 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName28, resolveColor
|
|
|
89898
90748
|
if (bandFmts === void 0) {
|
|
89899
90749
|
return;
|
|
89900
90750
|
}
|
|
89901
|
-
const containerKey =
|
|
90751
|
+
const containerKey = findKey15(seriesContainer, "bandFmts", localName28);
|
|
89902
90752
|
if (bandFmts.length === 0) {
|
|
89903
90753
|
if (containerKey) {
|
|
89904
90754
|
delete seriesContainer[containerKey];
|
|
@@ -89906,11 +90756,11 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName28, resolveColor
|
|
|
89906
90756
|
return;
|
|
89907
90757
|
}
|
|
89908
90758
|
const bandFmtsNode = containerKey ? seriesContainer[containerKey] : void 0;
|
|
89909
|
-
const bandFmtKey = bandFmtsNode ?
|
|
90759
|
+
const bandFmtKey = bandFmtsNode ? findKey15(bandFmtsNode, "bandFmt", localName28) : void 0;
|
|
89910
90760
|
const existingRaw = bandFmtKey ? bandFmtsNode?.[bandFmtKey] : void 0;
|
|
89911
90761
|
const existingNodes = existingRaw ? Array.isArray(existingRaw) ? existingRaw : [existingRaw] : [];
|
|
89912
90762
|
const bandIndexOf = (node) => {
|
|
89913
|
-
const idxKey =
|
|
90763
|
+
const idxKey = findKey15(node, "idx", localName28);
|
|
89914
90764
|
return idxKey ? safeUnsignedInt2(node[idxKey]?.["@_val"]) : void 0;
|
|
89915
90765
|
};
|
|
89916
90766
|
const byIndex = new Map(existingNodes.map((node) => [bandIndexOf(node), node]));
|
|
@@ -89922,7 +90772,7 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName28, resolveColor
|
|
|
89922
90772
|
updated.push(node);
|
|
89923
90773
|
}
|
|
89924
90774
|
if (band.spPr) {
|
|
89925
|
-
const spPrKey =
|
|
90775
|
+
const spPrKey = findKey15(node, "spPr", localName28);
|
|
89926
90776
|
const spPr = writeChartShapeProps(
|
|
89927
90777
|
spPrKey ? node[spPrKey] : void 0,
|
|
89928
90778
|
band.spPr,
|
|
@@ -89940,12 +90790,12 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName28, resolveColor
|
|
|
89940
90790
|
localName28
|
|
89941
90791
|
);
|
|
89942
90792
|
}
|
|
89943
|
-
var
|
|
90793
|
+
var findKey15;
|
|
89944
90794
|
var init_chart_band_fmts = __esm({
|
|
89945
90795
|
"src/pptx/core/utils/chart-band-fmts.ts"() {
|
|
89946
90796
|
init_chart_series_detail_parser();
|
|
89947
90797
|
init_chart_shape_props_writer();
|
|
89948
|
-
|
|
90798
|
+
findKey15 = (node, name, localName28) => Object.keys(node).find((key2) => localName28(key2) === name);
|
|
89949
90799
|
}
|
|
89950
90800
|
});
|
|
89951
90801
|
|
|
@@ -89995,142 +90845,6 @@ var init_chart_blank_values = __esm({
|
|
|
89995
90845
|
}
|
|
89996
90846
|
});
|
|
89997
90847
|
|
|
89998
|
-
// src/pptx/core/utils/chart-container-content-model.ts
|
|
89999
|
-
function chartTypeToContainerLocalName(chartType) {
|
|
90000
|
-
return TYPE_TO_CONTAINER[chartType];
|
|
90001
|
-
}
|
|
90002
|
-
function isKnownChartContainer(containerLocal) {
|
|
90003
|
-
return containerLocal in CHART_CONTAINER_CHILD_ORDER;
|
|
90004
|
-
}
|
|
90005
|
-
function chartContainerAllows(containerLocal, childLocal) {
|
|
90006
|
-
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
90007
|
-
return order !== void 0 && order.includes(childLocal);
|
|
90008
|
-
}
|
|
90009
|
-
var CHART_CONTAINER_CHILD_ORDER, REQUIRED_LEADING_CHILD, TYPE_TO_CONTAINER, AXIS_LOCAL_NAMES;
|
|
90010
|
-
var init_chart_container_content_model = __esm({
|
|
90011
|
-
"src/pptx/core/utils/chart-container-content-model.ts"() {
|
|
90012
|
-
CHART_CONTAINER_CHILD_ORDER = {
|
|
90013
|
-
areaChart: ["grouping", "varyColors", "ser", "dLbls", "dropLines", "axId", "extLst"],
|
|
90014
|
-
area3DChart: [
|
|
90015
|
-
"grouping",
|
|
90016
|
-
"varyColors",
|
|
90017
|
-
"ser",
|
|
90018
|
-
"dLbls",
|
|
90019
|
-
"dropLines",
|
|
90020
|
-
"gapDepth",
|
|
90021
|
-
"axId",
|
|
90022
|
-
"extLst"
|
|
90023
|
-
],
|
|
90024
|
-
barChart: [
|
|
90025
|
-
"barDir",
|
|
90026
|
-
"grouping",
|
|
90027
|
-
"varyColors",
|
|
90028
|
-
"ser",
|
|
90029
|
-
"dLbls",
|
|
90030
|
-
"gapWidth",
|
|
90031
|
-
"overlap",
|
|
90032
|
-
"serLines",
|
|
90033
|
-
"axId",
|
|
90034
|
-
"extLst"
|
|
90035
|
-
],
|
|
90036
|
-
bar3DChart: [
|
|
90037
|
-
"barDir",
|
|
90038
|
-
"grouping",
|
|
90039
|
-
"varyColors",
|
|
90040
|
-
"ser",
|
|
90041
|
-
"dLbls",
|
|
90042
|
-
"gapWidth",
|
|
90043
|
-
"gapDepth",
|
|
90044
|
-
"shape",
|
|
90045
|
-
"axId",
|
|
90046
|
-
"extLst"
|
|
90047
|
-
],
|
|
90048
|
-
bubbleChart: [
|
|
90049
|
-
"varyColors",
|
|
90050
|
-
"ser",
|
|
90051
|
-
"dLbls",
|
|
90052
|
-
"bubble3D",
|
|
90053
|
-
"bubbleScale",
|
|
90054
|
-
"showNegBubbles",
|
|
90055
|
-
"sizeRepresents",
|
|
90056
|
-
"axId",
|
|
90057
|
-
"extLst"
|
|
90058
|
-
],
|
|
90059
|
-
doughnutChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "holeSize", "extLst"],
|
|
90060
|
-
lineChart: [
|
|
90061
|
-
"grouping",
|
|
90062
|
-
"varyColors",
|
|
90063
|
-
"ser",
|
|
90064
|
-
"dLbls",
|
|
90065
|
-
"dropLines",
|
|
90066
|
-
"hiLowLines",
|
|
90067
|
-
"upDownBars",
|
|
90068
|
-
"marker",
|
|
90069
|
-
"smooth",
|
|
90070
|
-
"axId",
|
|
90071
|
-
"extLst"
|
|
90072
|
-
],
|
|
90073
|
-
line3DChart: [
|
|
90074
|
-
"grouping",
|
|
90075
|
-
"varyColors",
|
|
90076
|
-
"ser",
|
|
90077
|
-
"dLbls",
|
|
90078
|
-
"dropLines",
|
|
90079
|
-
"gapDepth",
|
|
90080
|
-
"axId",
|
|
90081
|
-
"extLst"
|
|
90082
|
-
],
|
|
90083
|
-
ofPieChart: [
|
|
90084
|
-
"ofPieType",
|
|
90085
|
-
"varyColors",
|
|
90086
|
-
"ser",
|
|
90087
|
-
"dLbls",
|
|
90088
|
-
"gapWidth",
|
|
90089
|
-
"splitType",
|
|
90090
|
-
"splitPos",
|
|
90091
|
-
"custSplit",
|
|
90092
|
-
"secondPieSize",
|
|
90093
|
-
"serLines",
|
|
90094
|
-
"extLst"
|
|
90095
|
-
],
|
|
90096
|
-
pieChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "extLst"],
|
|
90097
|
-
pie3DChart: ["varyColors", "ser", "dLbls", "extLst"],
|
|
90098
|
-
radarChart: ["radarStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
90099
|
-
scatterChart: ["scatterStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
90100
|
-
stockChart: ["ser", "dLbls", "dropLines", "hiLowLines", "upDownBars", "axId", "extLst"],
|
|
90101
|
-
surfaceChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"],
|
|
90102
|
-
surface3DChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"]
|
|
90103
|
-
};
|
|
90104
|
-
REQUIRED_LEADING_CHILD = {
|
|
90105
|
-
barChart: { local: "barDir", val: "col" },
|
|
90106
|
-
bar3DChart: { local: "barDir", val: "col" },
|
|
90107
|
-
lineChart: { local: "grouping", val: "standard" },
|
|
90108
|
-
line3DChart: { local: "grouping", val: "standard" },
|
|
90109
|
-
ofPieChart: { local: "ofPieType", val: "pie" },
|
|
90110
|
-
radarChart: { local: "radarStyle", val: "marker" },
|
|
90111
|
-
scatterChart: { local: "scatterStyle", val: "lineMarker" }
|
|
90112
|
-
};
|
|
90113
|
-
TYPE_TO_CONTAINER = {
|
|
90114
|
-
area: "areaChart",
|
|
90115
|
-
area3D: "area3DChart",
|
|
90116
|
-
bar: "barChart",
|
|
90117
|
-
bar3D: "bar3DChart",
|
|
90118
|
-
bubble: "bubbleChart",
|
|
90119
|
-
doughnut: "doughnutChart",
|
|
90120
|
-
line: "lineChart",
|
|
90121
|
-
line3D: "line3DChart",
|
|
90122
|
-
ofPie: "ofPieChart",
|
|
90123
|
-
pie: "pieChart",
|
|
90124
|
-
pie3D: "pie3DChart",
|
|
90125
|
-
radar: "radarChart",
|
|
90126
|
-
scatter: "scatterChart",
|
|
90127
|
-
stock: "stockChart",
|
|
90128
|
-
surface: "surfaceChart"
|
|
90129
|
-
};
|
|
90130
|
-
AXIS_LOCAL_NAMES = ["catAx", "valAx", "dateAx", "serAx"];
|
|
90131
|
-
}
|
|
90132
|
-
});
|
|
90133
|
-
|
|
90134
90848
|
// src/pptx/core/utils/chart-container-type-map.ts
|
|
90135
90849
|
function chartContainerLocalNameToType(localName28) {
|
|
90136
90850
|
return CONTAINER_LOCAL_NAME_TO_TYPE[localName28];
|
|
@@ -90190,7 +90904,7 @@ var init_chart_date_categories = __esm({
|
|
|
90190
90904
|
});
|
|
90191
90905
|
|
|
90192
90906
|
// src/pptx/core/utils/chart-filtered-series.ts
|
|
90193
|
-
function
|
|
90907
|
+
function localNameOf10(key2) {
|
|
90194
90908
|
return key2.replace(/^.*:/u, "");
|
|
90195
90909
|
}
|
|
90196
90910
|
function scalarChild(parent, name, xmlLookup) {
|
|
@@ -90270,7 +90984,7 @@ function parseOneFilteredSeries(node, xmlLookup) {
|
|
|
90270
90984
|
if (values.length > 0) {
|
|
90271
90985
|
result.values = values;
|
|
90272
90986
|
}
|
|
90273
|
-
const uniqueId = parseChartUniqueId(node,
|
|
90987
|
+
const uniqueId = parseChartUniqueId(node, localNameOf10);
|
|
90274
90988
|
if (uniqueId) {
|
|
90275
90989
|
result.uniqueId = uniqueId;
|
|
90276
90990
|
}
|
|
@@ -90288,7 +91002,7 @@ function parseFilteredSeries(container2, xmlLookup) {
|
|
|
90288
91002
|
if (!ext) {
|
|
90289
91003
|
return void 0;
|
|
90290
91004
|
}
|
|
90291
|
-
const wrapperKey = Object.keys(ext).find((key2) => /^filtered.*series$/iu.test(
|
|
91005
|
+
const wrapperKey = Object.keys(ext).find((key2) => /^filtered.*series$/iu.test(localNameOf10(key2)));
|
|
90292
91006
|
if (!wrapperKey) {
|
|
90293
91007
|
return void 0;
|
|
90294
91008
|
}
|
|
@@ -94176,7 +94890,7 @@ function parsePrintProperties(node) {
|
|
|
94176
94890
|
};
|
|
94177
94891
|
}
|
|
94178
94892
|
function applyAttribute2(node, name, value) {
|
|
94179
|
-
const existingKey =
|
|
94893
|
+
const existingKey = findKey16(node, name);
|
|
94180
94894
|
if (value === null) {
|
|
94181
94895
|
if (existingKey) {
|
|
94182
94896
|
delete node[existingKey];
|
|
@@ -94211,14 +94925,14 @@ function serializePrintProperties(properties) {
|
|
|
94211
94925
|
result[key2] = value;
|
|
94212
94926
|
}
|
|
94213
94927
|
}
|
|
94214
|
-
const extKey =
|
|
94928
|
+
const extKey = findKey16(source, "extLst");
|
|
94215
94929
|
if (extKey) {
|
|
94216
94930
|
result[extKey] = source[extKey];
|
|
94217
94931
|
}
|
|
94218
94932
|
return result;
|
|
94219
94933
|
}
|
|
94220
94934
|
function findChildByLocalName2(parent, name) {
|
|
94221
|
-
const key2 =
|
|
94935
|
+
const key2 = findKey16(parent, name);
|
|
94222
94936
|
return key2 ? parent[key2] : void 0;
|
|
94223
94937
|
}
|
|
94224
94938
|
function setPresentationPropertiesChild(root, name, value) {
|
|
@@ -94257,7 +94971,7 @@ function slidesPerPageToPrintOutput(value) {
|
|
|
94257
94971
|
}
|
|
94258
94972
|
return `handouts${value}`;
|
|
94259
94973
|
}
|
|
94260
|
-
var PRINT_OUTPUTS, COLOR_MODES, ROOT_ORDER, localName20,
|
|
94974
|
+
var PRINT_OUTPUTS, COLOR_MODES, ROOT_ORDER, localName20, findKey16;
|
|
94261
94975
|
var init_pptx_print_properties = __esm({
|
|
94262
94976
|
"src/pptx/core/core/runtime/pptx-print-properties.ts"() {
|
|
94263
94977
|
PRINT_OUTPUTS = /* @__PURE__ */ new Set([
|
|
@@ -94274,7 +94988,7 @@ var init_pptx_print_properties = __esm({
|
|
|
94274
94988
|
COLOR_MODES = /* @__PURE__ */ new Set(["bw", "gray", "clr"]);
|
|
94275
94989
|
ROOT_ORDER = ["htmlPubPr", "webPr", "prnPr", "showPr", "clrMru", "extLst"];
|
|
94276
94990
|
localName20 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
94277
|
-
|
|
94991
|
+
findKey16 = (node, name) => Object.keys(node).find((key2) => localName20(key2) === name);
|
|
94278
94992
|
}
|
|
94279
94993
|
});
|
|
94280
94994
|
|
|
@@ -99765,7 +100479,7 @@ var init_chart_cx_generator = __esm({
|
|
|
99765
100479
|
});
|
|
99766
100480
|
|
|
99767
100481
|
// src/pptx/core/utils/chart-data-labels-serializer.ts
|
|
99768
|
-
function
|
|
100482
|
+
function findKey17(obj, local, getLocalName2) {
|
|
99769
100483
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
99770
100484
|
}
|
|
99771
100485
|
function boolVal(on) {
|
|
@@ -99839,7 +100553,7 @@ function applyChartDataLabelsToXml(plotArea, style, getLocalName2) {
|
|
|
99839
100553
|
if (!container2 || typeof container2 !== "object") {
|
|
99840
100554
|
continue;
|
|
99841
100555
|
}
|
|
99842
|
-
const existingKey =
|
|
100556
|
+
const existingKey = findKey17(container2, "dLbls", getLocalName2);
|
|
99843
100557
|
if (style.hasDataLabels === false) {
|
|
99844
100558
|
const existing2 = existingKey ? container2[existingKey] : void 0;
|
|
99845
100559
|
const off = ordered3(existing2, { "c:delete": { "@_val": "1" } }, getLocalName2);
|
|
@@ -99917,11 +100631,11 @@ var init_chart_data_labels_serializer = __esm({
|
|
|
99917
100631
|
});
|
|
99918
100632
|
|
|
99919
100633
|
// src/pptx/core/utils/chart-data-table.ts
|
|
99920
|
-
function
|
|
100634
|
+
function findKey18(node, name, localName28) {
|
|
99921
100635
|
return Object.keys(node).find((key2) => localName28(key2) === name);
|
|
99922
100636
|
}
|
|
99923
100637
|
function setOrdered4(node, name, value, order, localName28) {
|
|
99924
|
-
const existingKey =
|
|
100638
|
+
const existingKey = findKey18(node, name, localName28);
|
|
99925
100639
|
if (existingKey) {
|
|
99926
100640
|
node[existingKey] = value;
|
|
99927
100641
|
return;
|
|
@@ -99944,7 +100658,7 @@ function applyChartDataTable(plotArea, dataTable, localName28, resolveColor2) {
|
|
|
99944
100658
|
if (dataTable === void 0) {
|
|
99945
100659
|
return;
|
|
99946
100660
|
}
|
|
99947
|
-
const tableKey =
|
|
100661
|
+
const tableKey = findKey18(plotArea, "dTable", localName28);
|
|
99948
100662
|
if (dataTable === null) {
|
|
99949
100663
|
if (tableKey) {
|
|
99950
100664
|
delete plotArea[tableKey];
|
|
@@ -99961,7 +100675,7 @@ function applyChartDataTable(plotArea, dataTable, localName28, resolveColor2) {
|
|
|
99961
100675
|
}
|
|
99962
100676
|
}
|
|
99963
100677
|
if (dataTable.spPr) {
|
|
99964
|
-
const spPrKey =
|
|
100678
|
+
const spPrKey = findKey18(table, "spPr", localName28);
|
|
99965
100679
|
const spPr = writeChartShapeProps(
|
|
99966
100680
|
spPrKey ? table[spPrKey] : void 0,
|
|
99967
100681
|
dataTable.spPr,
|
|
@@ -99971,13 +100685,13 @@ function applyChartDataTable(plotArea, dataTable, localName28, resolveColor2) {
|
|
|
99971
100685
|
setOrdered4(table, "spPr", spPr, TABLE_ORDER, localName28);
|
|
99972
100686
|
}
|
|
99973
100687
|
if (dataTable.txPr) {
|
|
99974
|
-
const txPrKey =
|
|
100688
|
+
const txPrKey = findKey18(table, "txPr", localName28);
|
|
99975
100689
|
const authoredDefRPr = resolveTxPrDefRPr(txPrKey ? table[txPrKey] : void 0, {
|
|
99976
100690
|
getChildByLocalName: (parent, name) => {
|
|
99977
100691
|
if (!parent) {
|
|
99978
100692
|
return void 0;
|
|
99979
100693
|
}
|
|
99980
|
-
const key2 =
|
|
100694
|
+
const key2 = findKey18(parent, name, localName28);
|
|
99981
100695
|
return key2 ? parent[key2] : void 0;
|
|
99982
100696
|
}
|
|
99983
100697
|
});
|
|
@@ -100037,7 +100751,7 @@ var init_chart_data_table = __esm({
|
|
|
100037
100751
|
});
|
|
100038
100752
|
|
|
100039
100753
|
// src/pptx/core/utils/chart-errbars-serializer.ts
|
|
100040
|
-
function
|
|
100754
|
+
function findKey19(obj, local, getLocalName2) {
|
|
100041
100755
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
100042
100756
|
}
|
|
100043
100757
|
function ensureArray14(v) {
|
|
@@ -100080,7 +100794,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
100080
100794
|
if (e.noEndCap !== void 0) {
|
|
100081
100795
|
node["c:noEndCap"] = { "@_val": e.noEndCap ? "1" : "0" };
|
|
100082
100796
|
} else if (existing) {
|
|
100083
|
-
const noEndCapKey =
|
|
100797
|
+
const noEndCapKey = findKey19(existing, "noEndCap", getLocalName2);
|
|
100084
100798
|
if (noEndCapKey) {
|
|
100085
100799
|
node["c:noEndCap"] = existing[noEndCapKey];
|
|
100086
100800
|
}
|
|
@@ -100095,7 +100809,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
100095
100809
|
} else if (e.val !== void 0) {
|
|
100096
100810
|
node["c:val"] = { "@_val": String(e.val) };
|
|
100097
100811
|
}
|
|
100098
|
-
const spPrKey = existing ?
|
|
100812
|
+
const spPrKey = existing ? findKey19(existing, "spPr", getLocalName2) : void 0;
|
|
100099
100813
|
const existingSpPr = spPrKey ? existing?.[spPrKey] : void 0;
|
|
100100
100814
|
if (e.color || e.width !== void 0 || e.dashStyle) {
|
|
100101
100815
|
node["c:spPr"] = buildSpPr(existingSpPr, e, getLocalName2, resolveColor2);
|
|
@@ -100103,7 +100817,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
100103
100817
|
node["c:spPr"] = existingSpPr;
|
|
100104
100818
|
}
|
|
100105
100819
|
if (existing) {
|
|
100106
|
-
const extKey =
|
|
100820
|
+
const extKey = findKey19(existing, "extLst", getLocalName2);
|
|
100107
100821
|
if (extKey) {
|
|
100108
100822
|
node["c:extLst"] = existing[extKey];
|
|
100109
100823
|
}
|
|
@@ -100111,7 +100825,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
100111
100825
|
return node;
|
|
100112
100826
|
}
|
|
100113
100827
|
function applySeriesErrBarsToXml(seriesNode, errBars, getLocalName2, resolveColor2) {
|
|
100114
|
-
const existingKey =
|
|
100828
|
+
const existingKey = findKey19(seriesNode, "errBars", getLocalName2);
|
|
100115
100829
|
const existingNodes = existingKey ? ensureArray14(seriesNode[existingKey]) : [];
|
|
100116
100830
|
const built = errBars.map(
|
|
100117
100831
|
(e, i) => buildErrBars(existingNodes[i], e, getLocalName2, resolveColor2)
|
|
@@ -100145,7 +100859,7 @@ var init_chart_errbars_serializer = __esm({
|
|
|
100145
100859
|
});
|
|
100146
100860
|
|
|
100147
100861
|
// src/pptx/core/utils/chart-series-datalabel-build.ts
|
|
100148
|
-
function
|
|
100862
|
+
function findKey20(obj, local, getLocalName2) {
|
|
100149
100863
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
100150
100864
|
}
|
|
100151
100865
|
function boolVal2(on) {
|
|
@@ -100194,7 +100908,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
100194
100908
|
node["c:delete"] = { "@_val": "0" };
|
|
100195
100909
|
}
|
|
100196
100910
|
if (existing && label.layout === void 0) {
|
|
100197
|
-
const layoutKey =
|
|
100911
|
+
const layoutKey = findKey20(existing, "layout", getLocalName2);
|
|
100198
100912
|
if (layoutKey) {
|
|
100199
100913
|
node[layoutKey] = existing[layoutKey];
|
|
100200
100914
|
}
|
|
@@ -100213,7 +100927,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
100213
100927
|
}
|
|
100214
100928
|
};
|
|
100215
100929
|
} else if (existing) {
|
|
100216
|
-
const txKey =
|
|
100930
|
+
const txKey = findKey20(existing, "tx", getLocalName2);
|
|
100217
100931
|
if (txKey) {
|
|
100218
100932
|
node[txKey] = existing[txKey];
|
|
100219
100933
|
}
|
|
@@ -100229,7 +100943,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
100229
100943
|
if (local === "txPr" && label.txPr !== void 0) {
|
|
100230
100944
|
continue;
|
|
100231
100945
|
}
|
|
100232
|
-
const k =
|
|
100946
|
+
const k = findKey20(existing, local, getLocalName2);
|
|
100233
100947
|
if (k) {
|
|
100234
100948
|
node[k] = existing[k];
|
|
100235
100949
|
}
|
|
@@ -100241,15 +100955,15 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
100241
100955
|
}
|
|
100242
100956
|
if (label.spPr !== void 0) {
|
|
100243
100957
|
replaced.add("spPr");
|
|
100244
|
-
const existingSpPr = existing ? existing[
|
|
100958
|
+
const existingSpPr = existing ? existing[findKey20(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
100245
100959
|
node["c:spPr"] = writeChartShapeProps(existingSpPr, label.spPr, getLocalName2, resolveColor2);
|
|
100246
100960
|
}
|
|
100247
100961
|
if (label.txPr !== void 0) {
|
|
100248
100962
|
replaced.add("txPr");
|
|
100249
|
-
const existingTxPr = existing ? existing[
|
|
100250
|
-
const paragraph = existingTxPr ? existingTxPr[
|
|
100251
|
-
const pPr = paragraph ? paragraph[
|
|
100252
|
-
const authoredDefRPr = pPr ? pPr[
|
|
100963
|
+
const existingTxPr = existing ? existing[findKey20(existing, "txPr", getLocalName2) ?? ""] : void 0;
|
|
100964
|
+
const paragraph = existingTxPr ? existingTxPr[findKey20(existingTxPr, "p", getLocalName2) ?? ""] : void 0;
|
|
100965
|
+
const pPr = paragraph ? paragraph[findKey20(paragraph, "pPr", getLocalName2) ?? ""] : void 0;
|
|
100966
|
+
const authoredDefRPr = pPr ? pPr[findKey20(pPr, "defRPr", getLocalName2) ?? ""] : void 0;
|
|
100253
100967
|
const txPr = buildDefRPrTextProperties(label.txPr, authoredDefRPr, resolveColor2);
|
|
100254
100968
|
if (txPr) {
|
|
100255
100969
|
node["c:txPr"] = txPr;
|
|
@@ -100319,17 +101033,17 @@ var init_chart_series_datalabel_build = __esm({
|
|
|
100319
101033
|
|
|
100320
101034
|
// src/pptx/core/utils/chart-series-datalabel-serializer.ts
|
|
100321
101035
|
function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName2, resolveColor2) {
|
|
100322
|
-
const dLblsKey =
|
|
101036
|
+
const dLblsKey = findKey20(seriesNode, "dLbls", getLocalName2);
|
|
100323
101037
|
const labels = dataLabels ?? [];
|
|
100324
101038
|
const existingByIdx = /* @__PURE__ */ new Map();
|
|
100325
101039
|
let groupChildren = [];
|
|
100326
101040
|
if (dLblsKey) {
|
|
100327
101041
|
const dLbls = seriesNode[dLblsKey];
|
|
100328
|
-
const dLblKey =
|
|
101042
|
+
const dLblKey = findKey20(dLbls, "dLbl", getLocalName2);
|
|
100329
101043
|
if (dLblKey) {
|
|
100330
101044
|
const nodes = Array.isArray(dLbls[dLblKey]) ? dLbls[dLblKey] : [dLbls[dLblKey]];
|
|
100331
101045
|
for (const node of nodes) {
|
|
100332
|
-
const idxKey =
|
|
101046
|
+
const idxKey = findKey20(node, "idx", getLocalName2);
|
|
100333
101047
|
const idxNode = idxKey ? node[idxKey] : void 0;
|
|
100334
101048
|
const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
|
|
100335
101049
|
if (Number.isFinite(idx)) {
|
|
@@ -100418,7 +101132,7 @@ var init_chart_space_metadata = __esm({
|
|
|
100418
101132
|
});
|
|
100419
101133
|
|
|
100420
101134
|
// src/pptx/core/utils/chart-trendline-serializer.ts
|
|
100421
|
-
function
|
|
101135
|
+
function findKey21(obj, local, getLocalName2) {
|
|
100422
101136
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
100423
101137
|
}
|
|
100424
101138
|
function ensureArray15(v) {
|
|
@@ -100457,14 +101171,14 @@ function buildSpPr2(existing, t, getLocalName2, resolveColor2) {
|
|
|
100457
101171
|
function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
100458
101172
|
validateTrendline(t);
|
|
100459
101173
|
const node = {};
|
|
100460
|
-
const existingNameKey = existing ?
|
|
101174
|
+
const existingNameKey = existing ? findKey21(existing, "name", getLocalName2) : void 0;
|
|
100461
101175
|
if (t.name !== void 0) {
|
|
100462
101176
|
node["c:name"] = t.name;
|
|
100463
101177
|
} else if (existing && existingNameKey) {
|
|
100464
101178
|
node["c:name"] = existing[existingNameKey];
|
|
100465
101179
|
}
|
|
100466
101180
|
const spPr = buildSpPr2(
|
|
100467
|
-
existing ? existing[
|
|
101181
|
+
existing ? existing[findKey21(existing, "spPr", getLocalName2) ?? ""] : void 0,
|
|
100468
101182
|
t,
|
|
100469
101183
|
getLocalName2,
|
|
100470
101184
|
resolveColor2
|
|
@@ -100494,7 +101208,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
100494
101208
|
if (t.displayEq !== void 0) {
|
|
100495
101209
|
node["c:dispEq"] = { "@_val": t.displayEq ? "1" : "0" };
|
|
100496
101210
|
}
|
|
100497
|
-
const lblKey = existing ?
|
|
101211
|
+
const lblKey = existing ? findKey21(existing, "trendlineLbl", getLocalName2) : void 0;
|
|
100498
101212
|
if (t.label) {
|
|
100499
101213
|
node["c:trendlineLbl"] = buildTrendlineLabel(
|
|
100500
101214
|
lblKey ? existing?.[lblKey] : void 0,
|
|
@@ -100505,7 +101219,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
100505
101219
|
node["c:trendlineLbl"] = existing[lblKey];
|
|
100506
101220
|
}
|
|
100507
101221
|
if (existing) {
|
|
100508
|
-
const extKey =
|
|
101222
|
+
const extKey = findKey21(existing, "extLst", getLocalName2);
|
|
100509
101223
|
if (extKey) {
|
|
100510
101224
|
node["c:extLst"] = existing[extKey];
|
|
100511
101225
|
}
|
|
@@ -100513,7 +101227,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
100513
101227
|
return node;
|
|
100514
101228
|
}
|
|
100515
101229
|
function applySeriesTrendlinesToXml(seriesNode, trendlines, getLocalName2, resolveColor2) {
|
|
100516
|
-
const existingKey =
|
|
101230
|
+
const existingKey = findKey21(seriesNode, "trendline", getLocalName2);
|
|
100517
101231
|
const existingNodes = existingKey ? ensureArray15(seriesNode[existingKey]) : [];
|
|
100518
101232
|
const built = trendlines.map(
|
|
100519
101233
|
(t, i) => buildTrendline(existingNodes[i], t, getLocalName2, resolveColor2)
|
|
@@ -100556,11 +101270,292 @@ var init_chart_trendline_serializer = __esm({
|
|
|
100556
101270
|
}
|
|
100557
101271
|
});
|
|
100558
101272
|
|
|
101273
|
+
// src/pptx/core/utils/chart-area-format.ts
|
|
101274
|
+
function findKey22(obj, local, getLocalName2) {
|
|
101275
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
101276
|
+
}
|
|
101277
|
+
function asObject(value) {
|
|
101278
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
101279
|
+
}
|
|
101280
|
+
function parsePaint(node, getLocalName2, resolveColor2) {
|
|
101281
|
+
if (!node) {
|
|
101282
|
+
return void 0;
|
|
101283
|
+
}
|
|
101284
|
+
if (findKey22(node, "noFill", getLocalName2) !== void 0) {
|
|
101285
|
+
return "none";
|
|
101286
|
+
}
|
|
101287
|
+
const solid = asObject(node[findKey22(node, "solidFill", getLocalName2) ?? ""]);
|
|
101288
|
+
return solid ? resolveColor2(solid) : void 0;
|
|
101289
|
+
}
|
|
101290
|
+
function parseChartAreaFormat(owner, getLocalName2, resolveColor2, parseGradient) {
|
|
101291
|
+
const spPr = owner ? asObject(owner[findKey22(owner, "spPr", getLocalName2) ?? ""]) : void 0;
|
|
101292
|
+
if (!spPr) {
|
|
101293
|
+
return {};
|
|
101294
|
+
}
|
|
101295
|
+
const format = {};
|
|
101296
|
+
const fill = parsePaint(spPr, getLocalName2, resolveColor2);
|
|
101297
|
+
if (fill !== void 0) {
|
|
101298
|
+
format.fill = fill;
|
|
101299
|
+
}
|
|
101300
|
+
const gradient = parseGradient?.(spPr);
|
|
101301
|
+
if (gradient) {
|
|
101302
|
+
format.gradient = gradient;
|
|
101303
|
+
}
|
|
101304
|
+
const ln = asObject(spPr[findKey22(spPr, "ln", getLocalName2) ?? ""]);
|
|
101305
|
+
const border = parsePaint(ln, getLocalName2, resolveColor2);
|
|
101306
|
+
if (border !== void 0) {
|
|
101307
|
+
format.border = border;
|
|
101308
|
+
}
|
|
101309
|
+
return format;
|
|
101310
|
+
}
|
|
101311
|
+
function paintXml(paint) {
|
|
101312
|
+
return paint === "none" ? { "a:noFill": {} } : { "a:solidFill": { "a:srgbClr": { "@_val": chartColorHex(paint) } } };
|
|
101313
|
+
}
|
|
101314
|
+
function buildChartAreaSpPr(format) {
|
|
101315
|
+
const spPr = {};
|
|
101316
|
+
if (format.gradient) {
|
|
101317
|
+
spPr["a:gradFill"] = buildChartGradFillXml(format.gradient);
|
|
101318
|
+
} else if (format.fill !== void 0) {
|
|
101319
|
+
Object.assign(spPr, paintXml(format.fill));
|
|
101320
|
+
}
|
|
101321
|
+
if (format.border !== void 0) {
|
|
101322
|
+
spPr["a:ln"] = paintXml(format.border);
|
|
101323
|
+
}
|
|
101324
|
+
return Object.keys(spPr).length > 0 ? spPr : void 0;
|
|
101325
|
+
}
|
|
101326
|
+
function samePaint(a, b) {
|
|
101327
|
+
if (a === void 0 || b === void 0 || a === "none" || b === "none") {
|
|
101328
|
+
return a === b;
|
|
101329
|
+
}
|
|
101330
|
+
return colorsEqual(a, b);
|
|
101331
|
+
}
|
|
101332
|
+
function sameFill(model, authored) {
|
|
101333
|
+
if (model.gradient || authored.gradient) {
|
|
101334
|
+
return Boolean(
|
|
101335
|
+
model.gradient && authored.gradient && chartGradientsEqual(model.gradient, authored.gradient)
|
|
101336
|
+
);
|
|
101337
|
+
}
|
|
101338
|
+
return samePaint(model.fill, authored.fill);
|
|
101339
|
+
}
|
|
101340
|
+
function setPaint(node, entry, choices, after, getLocalName2) {
|
|
101341
|
+
const entries = Object.entries(node).filter(([key2]) => !choices.has(getLocalName2(key2)));
|
|
101342
|
+
if (entry) {
|
|
101343
|
+
const at2 = entries.findIndex(([key2]) => after.has(getLocalName2(key2)));
|
|
101344
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, entry);
|
|
101345
|
+
}
|
|
101346
|
+
for (const key2 of Object.keys(node)) {
|
|
101347
|
+
delete node[key2];
|
|
101348
|
+
}
|
|
101349
|
+
for (const [key2, value] of entries) {
|
|
101350
|
+
node[key2] = value;
|
|
101351
|
+
}
|
|
101352
|
+
}
|
|
101353
|
+
function paintEntry(paint, authored, getLocalName2, resolveColor2) {
|
|
101354
|
+
if (paint === void 0) {
|
|
101355
|
+
return void 0;
|
|
101356
|
+
}
|
|
101357
|
+
if (paint === "none") {
|
|
101358
|
+
return ["a:noFill", {}];
|
|
101359
|
+
}
|
|
101360
|
+
const solid = asObject(authored[findKey22(authored, "solidFill", getLocalName2) ?? ""]);
|
|
101361
|
+
return ["a:solidFill", chartColorChoiceValue(solid, paint, resolveColor2)];
|
|
101362
|
+
}
|
|
101363
|
+
function applyChartAreaFormatToXml(owner, format, getLocalName2, options) {
|
|
101364
|
+
const authored = parseChartAreaFormat(
|
|
101365
|
+
owner,
|
|
101366
|
+
getLocalName2,
|
|
101367
|
+
options.resolveColor,
|
|
101368
|
+
options.parseGradient
|
|
101369
|
+
);
|
|
101370
|
+
const fillChanged = !sameFill(format, authored);
|
|
101371
|
+
const borderChanged = !samePaint(format.border, authored.border);
|
|
101372
|
+
if (!fillChanged && !borderChanged) {
|
|
101373
|
+
return false;
|
|
101374
|
+
}
|
|
101375
|
+
let spPr = asObject(owner[findKey22(owner, "spPr", getLocalName2) ?? ""]);
|
|
101376
|
+
if (!spPr) {
|
|
101377
|
+
spPr = {};
|
|
101378
|
+
options.insertSpPr(owner, spPr);
|
|
101379
|
+
}
|
|
101380
|
+
if (fillChanged) {
|
|
101381
|
+
if (format.gradient) {
|
|
101382
|
+
applyChartGradientToSpPr(spPr, format.gradient, getLocalName2, options);
|
|
101383
|
+
} else {
|
|
101384
|
+
const entry = paintEntry(format.fill, spPr, getLocalName2, options.resolveColor);
|
|
101385
|
+
setPaint(spPr, entry, FILL_CHOICE2, /* @__PURE__ */ new Set(["ln", ...AFTER_LN]), getLocalName2);
|
|
101386
|
+
}
|
|
101387
|
+
}
|
|
101388
|
+
if (borderChanged) {
|
|
101389
|
+
const lnKey = findKey22(spPr, "ln", getLocalName2);
|
|
101390
|
+
const ln = asObject(lnKey ? spPr[lnKey] : void 0) ?? {};
|
|
101391
|
+
const entry = paintEntry(format.border, ln, getLocalName2, options.resolveColor);
|
|
101392
|
+
setPaint(
|
|
101393
|
+
ln,
|
|
101394
|
+
entry,
|
|
101395
|
+
LN_FILL_CHOICE,
|
|
101396
|
+
/* @__PURE__ */ new Set(["prstDash", "custDash", "round", "bevel", "miter", "headEnd", "tailEnd", "extLst"]),
|
|
101397
|
+
getLocalName2
|
|
101398
|
+
);
|
|
101399
|
+
if (Object.keys(ln).length === 0) {
|
|
101400
|
+
if (lnKey) {
|
|
101401
|
+
delete spPr[lnKey];
|
|
101402
|
+
}
|
|
101403
|
+
} else if (!lnKey) {
|
|
101404
|
+
setPaint(spPr, ["a:ln", ln], /* @__PURE__ */ new Set(), AFTER_LN, getLocalName2);
|
|
101405
|
+
}
|
|
101406
|
+
}
|
|
101407
|
+
if (Object.keys(spPr).length === 0) {
|
|
101408
|
+
const spPrKey = findKey22(owner, "spPr", getLocalName2);
|
|
101409
|
+
if (spPrKey) {
|
|
101410
|
+
delete owner[spPrKey];
|
|
101411
|
+
}
|
|
101412
|
+
}
|
|
101413
|
+
return true;
|
|
101414
|
+
}
|
|
101415
|
+
var FILL_CHOICE2, AFTER_LN, LN_FILL_CHOICE;
|
|
101416
|
+
var init_chart_area_format = __esm({
|
|
101417
|
+
"src/pptx/core/utils/chart-area-format.ts"() {
|
|
101418
|
+
init_chart_color_choice();
|
|
101419
|
+
init_chart_gradient_fill_writer();
|
|
101420
|
+
init_chart_gradient_fill_xml();
|
|
101421
|
+
init_color_xml_preservation();
|
|
101422
|
+
FILL_CHOICE2 = /* @__PURE__ */ new Set(["noFill", "solidFill", "gradFill", "blipFill", "pattFill", "grpFill"]);
|
|
101423
|
+
AFTER_LN = /* @__PURE__ */ new Set(["effectLst", "effectDag", "scene3d", "sp3d", "extLst"]);
|
|
101424
|
+
LN_FILL_CHOICE = /* @__PURE__ */ new Set(["noFill", "solidFill", "gradFill", "pattFill"]);
|
|
101425
|
+
}
|
|
101426
|
+
});
|
|
101427
|
+
|
|
101428
|
+
// src/pptx/core/utils/chart-space-format.ts
|
|
101429
|
+
function findKey23(obj, local, getLocalName2) {
|
|
101430
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
101431
|
+
}
|
|
101432
|
+
function insertBefore(node, key2, value, after, getLocalName2) {
|
|
101433
|
+
const entries = Object.entries(node);
|
|
101434
|
+
const at2 = entries.findIndex(
|
|
101435
|
+
([candidate]) => !candidate.startsWith("@_") && after.has(getLocalName2(candidate))
|
|
101436
|
+
);
|
|
101437
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, [key2, value]);
|
|
101438
|
+
for (const candidate of Object.keys(node)) {
|
|
101439
|
+
delete node[candidate];
|
|
101440
|
+
}
|
|
101441
|
+
for (const [candidate, child27] of entries) {
|
|
101442
|
+
node[candidate] = child27;
|
|
101443
|
+
}
|
|
101444
|
+
}
|
|
101445
|
+
function chartAreaFormatOf(chartData) {
|
|
101446
|
+
const style = chartData.style;
|
|
101447
|
+
return {
|
|
101448
|
+
...style?.chartAreaFill !== void 0 ? { fill: style.chartAreaFill } : {},
|
|
101449
|
+
...style?.chartAreaGradient ? { gradient: style.chartAreaGradient } : {},
|
|
101450
|
+
...style?.chartAreaBorder !== void 0 ? { border: style.chartAreaBorder } : {}
|
|
101451
|
+
};
|
|
101452
|
+
}
|
|
101453
|
+
function plotAreaFormatOf(chartData) {
|
|
101454
|
+
const style = chartData.style;
|
|
101455
|
+
return {
|
|
101456
|
+
...style?.plotAreaFill !== void 0 ? { fill: style.plotAreaFill } : {},
|
|
101457
|
+
...style?.plotAreaGradient ? { gradient: style.plotAreaGradient } : {},
|
|
101458
|
+
...style?.plotAreaBorder !== void 0 ? { border: style.plotAreaBorder } : {}
|
|
101459
|
+
};
|
|
101460
|
+
}
|
|
101461
|
+
function applyGeneratedChartSpaceFormat(tree, chartData) {
|
|
101462
|
+
const chartSpace = tree["c:chartSpace"];
|
|
101463
|
+
if (!chartSpace) {
|
|
101464
|
+
return;
|
|
101465
|
+
}
|
|
101466
|
+
const localName28 = (key2) => key2.replace(/^.*:/u, "");
|
|
101467
|
+
const plotArea = chartSpace["c:chart"]?.["c:plotArea"];
|
|
101468
|
+
const plotSpPr = buildChartAreaSpPr(plotAreaFormatOf(chartData));
|
|
101469
|
+
if (plotArea && plotSpPr) {
|
|
101470
|
+
insertBefore(plotArea, "c:spPr", plotSpPr, /* @__PURE__ */ new Set(["extLst"]), localName28);
|
|
101471
|
+
}
|
|
101472
|
+
const chartSpPr = buildChartAreaSpPr(chartAreaFormatOf(chartData));
|
|
101473
|
+
if (chartSpPr) {
|
|
101474
|
+
insertBefore(chartSpace, "c:spPr", chartSpPr, AFTER_CHART_SPACE_SP_PR, localName28);
|
|
101475
|
+
}
|
|
101476
|
+
if (chartData.roundedCorners !== void 0) {
|
|
101477
|
+
insertBefore(
|
|
101478
|
+
chartSpace,
|
|
101479
|
+
"c:roundedCorners",
|
|
101480
|
+
{ "@_val": chartData.roundedCorners ? "1" : "0" },
|
|
101481
|
+
AFTER_ROUNDED_CORNERS,
|
|
101482
|
+
localName28
|
|
101483
|
+
);
|
|
101484
|
+
}
|
|
101485
|
+
}
|
|
101486
|
+
function authoredBool(node) {
|
|
101487
|
+
if (node === void 0) {
|
|
101488
|
+
return void 0;
|
|
101489
|
+
}
|
|
101490
|
+
const val = node && typeof node === "object" ? node["@_val"] : void 0;
|
|
101491
|
+
if (val === void 0 || val === null || val === "") {
|
|
101492
|
+
return true;
|
|
101493
|
+
}
|
|
101494
|
+
return !(val === "0" || val === "false");
|
|
101495
|
+
}
|
|
101496
|
+
function applyChartSpaceFormatToXml(chartSpace, plotArea, chartData, getLocalName2, options) {
|
|
101497
|
+
let changed = false;
|
|
101498
|
+
const roundedKey = findKey23(chartSpace, "roundedCorners", getLocalName2);
|
|
101499
|
+
const authoredRounded = roundedKey ? authoredBool(chartSpace[roundedKey]) : void 0;
|
|
101500
|
+
if (chartData.roundedCorners === void 0) {
|
|
101501
|
+
if (roundedKey) {
|
|
101502
|
+
delete chartSpace[roundedKey];
|
|
101503
|
+
changed = true;
|
|
101504
|
+
}
|
|
101505
|
+
} else if (chartData.roundedCorners !== authoredRounded) {
|
|
101506
|
+
const node = { "@_val": chartData.roundedCorners ? "1" : "0" };
|
|
101507
|
+
if (roundedKey) {
|
|
101508
|
+
chartSpace[roundedKey] = node;
|
|
101509
|
+
} else {
|
|
101510
|
+
insertBefore(chartSpace, "c:roundedCorners", node, AFTER_ROUNDED_CORNERS, getLocalName2);
|
|
101511
|
+
}
|
|
101512
|
+
changed = true;
|
|
101513
|
+
}
|
|
101514
|
+
changed = applyChartAreaFormatToXml(chartSpace, chartAreaFormatOf(chartData), getLocalName2, {
|
|
101515
|
+
...options,
|
|
101516
|
+
insertSpPr: (owner, spPr) => insertBefore(owner, "c:spPr", spPr, AFTER_CHART_SPACE_SP_PR, getLocalName2)
|
|
101517
|
+
}) || changed;
|
|
101518
|
+
if (plotArea) {
|
|
101519
|
+
changed = applyChartAreaFormatToXml(plotArea, plotAreaFormatOf(chartData), getLocalName2, {
|
|
101520
|
+
...options,
|
|
101521
|
+
insertSpPr: (owner, spPr) => insertBefore(owner, "c:spPr", spPr, /* @__PURE__ */ new Set(["extLst"]), getLocalName2)
|
|
101522
|
+
}) || changed;
|
|
101523
|
+
}
|
|
101524
|
+
return changed;
|
|
101525
|
+
}
|
|
101526
|
+
var AFTER_ROUNDED_CORNERS, AFTER_CHART_SPACE_SP_PR;
|
|
101527
|
+
var init_chart_space_format = __esm({
|
|
101528
|
+
"src/pptx/core/utils/chart-space-format.ts"() {
|
|
101529
|
+
init_chart_area_format();
|
|
101530
|
+
AFTER_ROUNDED_CORNERS = /* @__PURE__ */ new Set([
|
|
101531
|
+
"AlternateContent",
|
|
101532
|
+
"style",
|
|
101533
|
+
"clrMapOvr",
|
|
101534
|
+
"pivotSource",
|
|
101535
|
+
"protection",
|
|
101536
|
+
"chart",
|
|
101537
|
+
"spPr",
|
|
101538
|
+
"txPr",
|
|
101539
|
+
"externalData",
|
|
101540
|
+
"printSettings",
|
|
101541
|
+
"userShapes",
|
|
101542
|
+
"extLst"
|
|
101543
|
+
]);
|
|
101544
|
+
AFTER_CHART_SPACE_SP_PR = /* @__PURE__ */ new Set([
|
|
101545
|
+
"txPr",
|
|
101546
|
+
"externalData",
|
|
101547
|
+
"printSettings",
|
|
101548
|
+
"userShapes",
|
|
101549
|
+
"extLst"
|
|
101550
|
+
]);
|
|
101551
|
+
}
|
|
101552
|
+
});
|
|
101553
|
+
|
|
100559
101554
|
// src/pptx/core/utils/chart-axis-gridlines-serializer.ts
|
|
100560
|
-
function
|
|
101555
|
+
function findKey24(obj, local, getLocalName2) {
|
|
100561
101556
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
100562
101557
|
}
|
|
100563
|
-
function
|
|
101558
|
+
function insertBefore2(axisNode, newKey, value, afterSet, getLocalName2) {
|
|
100564
101559
|
const keys = Object.keys(axisNode);
|
|
100565
101560
|
const beforeIdx = keys.findIndex((k) => afterSet.has(getLocalName2(k)));
|
|
100566
101561
|
const entries = keys.map((k) => [k, axisNode[k]]);
|
|
@@ -100577,7 +101572,7 @@ function applyOne(axisNode, local, key2, flag, afterSet, getLocalName2) {
|
|
|
100577
101572
|
if (flag === void 0) {
|
|
100578
101573
|
return;
|
|
100579
101574
|
}
|
|
100580
|
-
const existingKey =
|
|
101575
|
+
const existingKey = findKey24(axisNode, local, getLocalName2);
|
|
100581
101576
|
if (!flag) {
|
|
100582
101577
|
if (existingKey) {
|
|
100583
101578
|
delete axisNode[existingKey];
|
|
@@ -100585,7 +101580,7 @@ function applyOne(axisNode, local, key2, flag, afterSet, getLocalName2) {
|
|
|
100585
101580
|
return;
|
|
100586
101581
|
}
|
|
100587
101582
|
if (!existingKey) {
|
|
100588
|
-
|
|
101583
|
+
insertBefore2(axisNode, key2, {}, afterSet, getLocalName2);
|
|
100589
101584
|
}
|
|
100590
101585
|
}
|
|
100591
101586
|
function applyChartAxisGridlinesToXml(axisNode, opts, getLocalName2, resolveColor2) {
|
|
@@ -100625,14 +101620,14 @@ function hex(color2) {
|
|
|
100625
101620
|
}
|
|
100626
101621
|
function buildGridlineSpPr(existing, style, getLocalName2, resolveColor2) {
|
|
100627
101622
|
const spPr = existing ? { ...existing } : {};
|
|
100628
|
-
const lnKey =
|
|
101623
|
+
const lnKey = findKey24(spPr, "ln", getLocalName2) ?? "a:ln";
|
|
100629
101624
|
const ln = { ...spPr[lnKey] ?? {} };
|
|
100630
101625
|
if (style.strokeWidth !== void 0) {
|
|
100631
101626
|
ln["@_w"] = String(Math.round(style.strokeWidth * 12700));
|
|
100632
101627
|
}
|
|
100633
101628
|
if (style.strokeColor) {
|
|
100634
|
-
const fillKey =
|
|
100635
|
-
const noFillKey =
|
|
101629
|
+
const fillKey = findKey24(ln, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
101630
|
+
const noFillKey = findKey24(ln, "noFill", getLocalName2);
|
|
100636
101631
|
if (noFillKey) {
|
|
100637
101632
|
delete ln[noFillKey];
|
|
100638
101633
|
}
|
|
@@ -100644,7 +101639,7 @@ function buildGridlineSpPr(existing, style, getLocalName2, resolveColor2) {
|
|
|
100644
101639
|
);
|
|
100645
101640
|
}
|
|
100646
101641
|
if (style.strokeDashStyle) {
|
|
100647
|
-
const dashKey =
|
|
101642
|
+
const dashKey = findKey24(ln, "prstDash", getLocalName2) ?? "a:prstDash";
|
|
100648
101643
|
ln[dashKey] = { "@_val": style.strokeDashStyle };
|
|
100649
101644
|
}
|
|
100650
101645
|
spPr[lnKey] = ln;
|
|
@@ -100654,12 +101649,12 @@ function applyGridlineStyle(axisNode, local, style, getLocalName2, resolveColor2
|
|
|
100654
101649
|
if (!style) {
|
|
100655
101650
|
return;
|
|
100656
101651
|
}
|
|
100657
|
-
const gridKey =
|
|
101652
|
+
const gridKey = findKey24(axisNode, local, getLocalName2);
|
|
100658
101653
|
if (!gridKey) {
|
|
100659
101654
|
return;
|
|
100660
101655
|
}
|
|
100661
101656
|
const grid = { ...axisNode[gridKey] ?? {} };
|
|
100662
|
-
const spPrKey =
|
|
101657
|
+
const spPrKey = findKey24(grid, "spPr", getLocalName2) ?? "c:spPr";
|
|
100663
101658
|
grid[spPrKey] = buildGridlineSpPr(
|
|
100664
101659
|
grid[spPrKey],
|
|
100665
101660
|
style,
|
|
@@ -100699,7 +101694,7 @@ function buildGeneratedChartAxis(axId, crossId, pos2, formatting) {
|
|
|
100699
101694
|
const axis = {
|
|
100700
101695
|
"c:axId": { "@_val": String(axId) },
|
|
100701
101696
|
"c:scaling": { "c:orientation": { "@_val": "minMax" } },
|
|
100702
|
-
"c:delete": { "@_val": "0" },
|
|
101697
|
+
"c:delete": { "@_val": formatting?.deleted ? "1" : "0" },
|
|
100703
101698
|
"c:axPos": { "@_val": pos2 },
|
|
100704
101699
|
"c:crossAx": { "@_val": String(crossId) }
|
|
100705
101700
|
};
|
|
@@ -100858,7 +101853,7 @@ function buildSeries(family, s, index, categories, dateCategories) {
|
|
|
100858
101853
|
function axisFormatting(chartData, type, id, index = 0) {
|
|
100859
101854
|
return chartData.axes?.find((axis) => axis.axisId === id) ?? chartData.axes?.filter((axis) => axis.axisType === type)[index];
|
|
100860
101855
|
}
|
|
100861
|
-
function buildChartTypeContainer(chartData, family) {
|
|
101856
|
+
function buildChartTypeContainer(chartData, family, containerLocal) {
|
|
100862
101857
|
const container2 = {};
|
|
100863
101858
|
if (family === "bar") {
|
|
100864
101859
|
container2["c:barDir"] = { "@_val": chartData.barDirection === "bar" ? "bar" : "col" };
|
|
@@ -100892,9 +101887,6 @@ function buildChartTypeContainer(chartData, family) {
|
|
|
100892
101887
|
if (family === "line" && chartData.upDownBars !== void 0) {
|
|
100893
101888
|
applyChartUpDownBars(container2, chartData.upDownBars, (key2) => key2.replace(/^.*:/u, ""));
|
|
100894
101889
|
}
|
|
100895
|
-
if (family === "bar" || family === "ofPie") {
|
|
100896
|
-
container2["c:gapWidth"] = { "@_val": "150" };
|
|
100897
|
-
}
|
|
100898
101890
|
if (family === "bar" && chartData.chartType === "bar3D" && chartData.barShape) {
|
|
100899
101891
|
container2["c:shape"] = { "@_val": chartData.barShape };
|
|
100900
101892
|
}
|
|
@@ -100903,14 +101895,13 @@ function buildChartTypeContainer(chartData, family) {
|
|
|
100903
101895
|
}
|
|
100904
101896
|
if (family === "bar" || family === "line" || family === "area" || family === "radar" || family === "scatter" || family === "bubble" || family === "stock" || family === "surface") {
|
|
100905
101897
|
container2["c:axId"] = [{ "@_val": String(CAT_AX_ID) }, { "@_val": String(VAL_AX_ID) }];
|
|
100906
|
-
} else if (family === "doughnut") {
|
|
100907
|
-
container2["c:holeSize"] = { "@_val": "50" };
|
|
100908
101898
|
}
|
|
101899
|
+
applyGeneratedChartGroupOptions(container2, containerLocal, chartData);
|
|
100909
101900
|
return container2;
|
|
100910
101901
|
}
|
|
100911
101902
|
function buildPlotArea(chartData, tag, family) {
|
|
100912
101903
|
const plotArea = { "c:layout": {} };
|
|
100913
|
-
plotArea[tag] = buildChartTypeContainer(chartData, family);
|
|
101904
|
+
plotArea[tag] = buildChartTypeContainer(chartData, family, tag.replace(/^.*:/u, ""));
|
|
100914
101905
|
if (chartData.style) {
|
|
100915
101906
|
applyChartDataLabelsToXml(plotArea, chartData.style, (key2) => key2.replace(/^.*:/u, ""));
|
|
100916
101907
|
}
|
|
@@ -100987,6 +101978,7 @@ function buildChartSpaceXml(chartData) {
|
|
|
100987
101978
|
}
|
|
100988
101979
|
};
|
|
100989
101980
|
applyGeneratedChartSpaceMetadata(result, chartData);
|
|
101981
|
+
applyGeneratedChartSpaceFormat(result, chartData);
|
|
100990
101982
|
return result;
|
|
100991
101983
|
}
|
|
100992
101984
|
var NS_C2, NS_A2, NS_R2, CAT_AX_ID, VAL_AX_ID, SCATTER_LIKE;
|
|
@@ -101002,6 +101994,8 @@ var init_chart_xml_generator = __esm({
|
|
|
101002
101994
|
init_chart_series_datalabel_serializer();
|
|
101003
101995
|
init_chart_space_metadata();
|
|
101004
101996
|
init_chart_trendline_serializer();
|
|
101997
|
+
init_chart_group_options();
|
|
101998
|
+
init_chart_space_format();
|
|
101005
101999
|
init_chart_up_down_bars();
|
|
101006
102000
|
init_chart_xml_axis_generator();
|
|
101007
102001
|
init_chart_xml_container_map();
|
|
@@ -101349,14 +102343,14 @@ function isCustomXmlRelationship(value) {
|
|
|
101349
102343
|
return String(value ?? "").endsWith("/relationships/customXml");
|
|
101350
102344
|
}
|
|
101351
102345
|
function placeCustomerDataList(container2, list2, location) {
|
|
101352
|
-
const
|
|
102346
|
+
const insertBefore4 = location === "presentation" ? /* @__PURE__ */ new Set(["p:kinsoku", "p:defaultTextStyle", "p:modifyVerifier", "p:extLst"]) : /* @__PURE__ */ new Set(["p:controls", "p:extLst"]);
|
|
101353
102347
|
const rebuilt = {};
|
|
101354
102348
|
let inserted = false;
|
|
101355
102349
|
for (const [key2, value] of Object.entries(container2)) {
|
|
101356
102350
|
if (key2 === "p:custDataLst") {
|
|
101357
102351
|
continue;
|
|
101358
102352
|
}
|
|
101359
|
-
if (!inserted &&
|
|
102353
|
+
if (!inserted && insertBefore4.has(key2)) {
|
|
101360
102354
|
rebuilt["p:custDataLst"] = list2;
|
|
101361
102355
|
inserted = true;
|
|
101362
102356
|
}
|
|
@@ -101444,14 +102438,14 @@ function resolveTagsContainer(data) {
|
|
|
101444
102438
|
}
|
|
101445
102439
|
return void 0;
|
|
101446
102440
|
}
|
|
101447
|
-
function placeAtKey(container2, key2, value,
|
|
102441
|
+
function placeAtKey(container2, key2, value, insertBefore4) {
|
|
101448
102442
|
const rebuilt = {};
|
|
101449
102443
|
let inserted = false;
|
|
101450
102444
|
for (const [childKey3, childValue] of Object.entries(container2)) {
|
|
101451
102445
|
if (childKey3 === key2) {
|
|
101452
102446
|
continue;
|
|
101453
102447
|
}
|
|
101454
|
-
if (!inserted &&
|
|
102448
|
+
if (!inserted && insertBefore4.has(childKey3)) {
|
|
101455
102449
|
rebuilt[key2] = value;
|
|
101456
102450
|
inserted = true;
|
|
101457
102451
|
}
|
|
@@ -101475,10 +102469,10 @@ async function upsertTagsOwningElement(zip, codec, sourcePartPath, relationshipI
|
|
|
101475
102469
|
if (!resolved) {
|
|
101476
102470
|
return;
|
|
101477
102471
|
}
|
|
101478
|
-
const { container: container2, insertBefore:
|
|
102472
|
+
const { container: container2, insertBefore: insertBefore4 } = resolved;
|
|
101479
102473
|
const list2 = { ...container2["p:custDataLst"] ?? {} };
|
|
101480
102474
|
list2["p:tags"] = { "@_r:id": relationshipId2 };
|
|
101481
|
-
placeAtKey(container2, "p:custDataLst", list2,
|
|
102475
|
+
placeAtKey(container2, "p:custDataLst", list2, insertBefore4);
|
|
101482
102476
|
zip.file(sourcePartPath, codec.build(data));
|
|
101483
102477
|
}
|
|
101484
102478
|
async function removeTagsOwningElement(zip, codec, sourcePartPath) {
|
|
@@ -101746,6 +102740,49 @@ var init_tag_package = __esm({
|
|
|
101746
102740
|
}
|
|
101747
102741
|
});
|
|
101748
102742
|
|
|
102743
|
+
// src/pptx/core/utils/chart-axis-deleted.ts
|
|
102744
|
+
function authoredDeleted(node) {
|
|
102745
|
+
if (node === void 0) {
|
|
102746
|
+
return false;
|
|
102747
|
+
}
|
|
102748
|
+
const val = node && typeof node === "object" ? node["@_val"] : void 0;
|
|
102749
|
+
if (val === void 0 || val === null || val === "") {
|
|
102750
|
+
return true;
|
|
102751
|
+
}
|
|
102752
|
+
return !(val === "0" || val === "false");
|
|
102753
|
+
}
|
|
102754
|
+
function applyChartAxisDeletedToXml(axisNode, deleted, getLocalName2) {
|
|
102755
|
+
if (deleted === void 0) {
|
|
102756
|
+
return false;
|
|
102757
|
+
}
|
|
102758
|
+
const key2 = Object.keys(axisNode).find((candidate) => getLocalName2(candidate) === "delete");
|
|
102759
|
+
if (authoredDeleted(key2 ? axisNode[key2] : void 0) === deleted) {
|
|
102760
|
+
return false;
|
|
102761
|
+
}
|
|
102762
|
+
const node = { "@_val": deleted ? "1" : "0" };
|
|
102763
|
+
if (key2) {
|
|
102764
|
+
axisNode[key2] = node;
|
|
102765
|
+
return true;
|
|
102766
|
+
}
|
|
102767
|
+
const entries = Object.entries(axisNode);
|
|
102768
|
+
const at2 = entries.findIndex(([candidate]) => {
|
|
102769
|
+
const local = getLocalName2(candidate);
|
|
102770
|
+
return local !== "axId" && local !== "scaling" && !candidate.startsWith("@_");
|
|
102771
|
+
});
|
|
102772
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, ["c:delete", node]);
|
|
102773
|
+
for (const candidate of Object.keys(axisNode)) {
|
|
102774
|
+
delete axisNode[candidate];
|
|
102775
|
+
}
|
|
102776
|
+
for (const [candidate, value] of entries) {
|
|
102777
|
+
axisNode[candidate] = value;
|
|
102778
|
+
}
|
|
102779
|
+
return true;
|
|
102780
|
+
}
|
|
102781
|
+
var init_chart_axis_deleted = __esm({
|
|
102782
|
+
"src/pptx/core/utils/chart-axis-deleted.ts"() {
|
|
102783
|
+
}
|
|
102784
|
+
});
|
|
102785
|
+
|
|
101749
102786
|
// src/pptx/core/utils/chart-axis-title-serializer.ts
|
|
101750
102787
|
function firstTextRun(paragraph, getLocalName2) {
|
|
101751
102788
|
for (const [key2, value] of Object.entries(paragraph)) {
|
|
@@ -101753,7 +102790,7 @@ function firstTextRun(paragraph, getLocalName2) {
|
|
|
101753
102790
|
continue;
|
|
101754
102791
|
}
|
|
101755
102792
|
for (const run of Array.isArray(value) ? value : [value]) {
|
|
101756
|
-
if (run && typeof run === "object" && !Array.isArray(run) &&
|
|
102793
|
+
if (run && typeof run === "object" && !Array.isArray(run) && findKey9(run, "t", getLocalName2)) {
|
|
101757
102794
|
return [key2, run];
|
|
101758
102795
|
}
|
|
101759
102796
|
}
|
|
@@ -101761,7 +102798,7 @@ function firstTextRun(paragraph, getLocalName2) {
|
|
|
101761
102798
|
return void 0;
|
|
101762
102799
|
}
|
|
101763
102800
|
function setTitleText(title, text2, getLocalName2) {
|
|
101764
|
-
const txKey =
|
|
102801
|
+
const txKey = findKey9(title, "tx", getLocalName2) ?? "c:tx";
|
|
101765
102802
|
const tx = title[txKey];
|
|
101766
102803
|
const texts = [];
|
|
101767
102804
|
if (tx && typeof tx === "object") {
|
|
@@ -101770,7 +102807,7 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
101770
102807
|
if (texts.join("") === text2) {
|
|
101771
102808
|
return;
|
|
101772
102809
|
}
|
|
101773
|
-
const richKey = tx && typeof tx === "object" ?
|
|
102810
|
+
const richKey = tx && typeof tx === "object" ? findKey9(tx, "rich", getLocalName2) : void 0;
|
|
101774
102811
|
const rich = richKey ? tx[richKey] : void 0;
|
|
101775
102812
|
if (!rich || typeof rich !== "object" || Array.isArray(rich)) {
|
|
101776
102813
|
const textNode = buildTitle(text2)["c:tx"];
|
|
@@ -101781,7 +102818,7 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
101781
102818
|
}
|
|
101782
102819
|
return;
|
|
101783
102820
|
}
|
|
101784
|
-
const pKey =
|
|
102821
|
+
const pKey = findKey9(rich, "p", getLocalName2) ?? "a:p";
|
|
101785
102822
|
const value = rich[pKey];
|
|
101786
102823
|
const paragraphs = (Array.isArray(value) ? value : [value]).filter(
|
|
101787
102824
|
(entry) => Boolean(entry) && typeof entry === "object" && !Array.isArray(entry)
|
|
@@ -101790,9 +102827,9 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
101790
102827
|
const carrier = firstTextRun(paragraph, getLocalName2);
|
|
101791
102828
|
const original = carrier?.[1] ?? {};
|
|
101792
102829
|
const runKey = carrier ? carrier[0].replace(/[^:]+$/u, "r") : "a:r";
|
|
101793
|
-
const rPrKey =
|
|
102830
|
+
const rPrKey = findKey9(original, "rPr", getLocalName2);
|
|
101794
102831
|
const run = carrier && getLocalName2(carrier[0]) === "r" ? { ...original } : rPrKey ? { [rPrKey]: original[rPrKey] } : {};
|
|
101795
|
-
const textKey =
|
|
102832
|
+
const textKey = findKey9(original, "t", getLocalName2) ?? "a:t";
|
|
101796
102833
|
const oldText = original[textKey];
|
|
101797
102834
|
const attributes = oldText && typeof oldText === "object" && !Array.isArray(oldText) ? oldText : void 0;
|
|
101798
102835
|
run[textKey] = attributes ? { ...attributes, "#text": text2 } : text2;
|
|
@@ -101832,7 +102869,7 @@ function applyChartAxisTitleToXml(axisNode, titleText, getLocalName2) {
|
|
|
101832
102869
|
if (titleText === void 0) {
|
|
101833
102870
|
return;
|
|
101834
102871
|
}
|
|
101835
|
-
const titleKey =
|
|
102872
|
+
const titleKey = findKey9(axisNode, "title", getLocalName2);
|
|
101836
102873
|
if (titleText === "") {
|
|
101837
102874
|
if (titleKey) {
|
|
101838
102875
|
delete axisNode[titleKey];
|
|
@@ -101872,27 +102909,27 @@ function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveCo
|
|
|
101872
102909
|
if (!hasAny) {
|
|
101873
102910
|
return;
|
|
101874
102911
|
}
|
|
101875
|
-
const titleKey =
|
|
102912
|
+
const titleKey = findKey9(axisNode, "title", getLocalName2);
|
|
101876
102913
|
if (!titleKey) {
|
|
101877
102914
|
return;
|
|
101878
102915
|
}
|
|
101879
102916
|
const title = { ...axisNode[titleKey] ?? {} };
|
|
101880
|
-
const txPrKey =
|
|
102917
|
+
const txPrKey = findKey9(title, "txPr", getLocalName2) ?? "c:txPr";
|
|
101881
102918
|
const txPr = { ...title[txPrKey] ?? {} };
|
|
101882
|
-
if (!txPr[
|
|
102919
|
+
if (!txPr[findKey9(txPr, "bodyPr", getLocalName2) ?? "a:bodyPr"]) {
|
|
101883
102920
|
txPr["a:bodyPr"] = {};
|
|
101884
102921
|
}
|
|
101885
|
-
if (!txPr[
|
|
102922
|
+
if (!txPr[findKey9(txPr, "lstStyle", getLocalName2) ?? "a:lstStyle"]) {
|
|
101886
102923
|
txPr["a:lstStyle"] = {};
|
|
101887
102924
|
}
|
|
101888
|
-
const pKey =
|
|
102925
|
+
const pKey = findKey9(txPr, "p", getLocalName2) ?? "a:p";
|
|
101889
102926
|
const existingP = txPr[pKey];
|
|
101890
102927
|
const para = {
|
|
101891
102928
|
...(Array.isArray(existingP) ? existingP[0] : existingP) ?? {}
|
|
101892
102929
|
};
|
|
101893
|
-
const pPrKey =
|
|
102930
|
+
const pPrKey = findKey9(para, "pPr", getLocalName2) ?? "a:pPr";
|
|
101894
102931
|
const pPr = { ...para[pPrKey] ?? {} };
|
|
101895
|
-
const defRPrKey =
|
|
102932
|
+
const defRPrKey = findKey9(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
101896
102933
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
101897
102934
|
pPr[defRPrKey] = { ...existingDefRPr, ...buildDefRPr(style, existingDefRPr, resolveColor2) };
|
|
101898
102935
|
para[pPrKey] = pPr;
|
|
@@ -101984,140 +103021,8 @@ var init_chart_color_map_override = __esm({
|
|
|
101984
103021
|
}
|
|
101985
103022
|
});
|
|
101986
103023
|
|
|
101987
|
-
// src/pptx/core/utils/chart-container-schema.ts
|
|
101988
|
-
function normalizeChartGroupingValue(containerLocal, value) {
|
|
101989
|
-
const isBar = containerLocal === "barChart" || containerLocal === "bar3DChart";
|
|
101990
|
-
return !isBar && value === "clustered" ? "standard" : value;
|
|
101991
|
-
}
|
|
101992
|
-
function normalizeGroupingNode(containerLocal, node) {
|
|
101993
|
-
const value = node["@_val"];
|
|
101994
|
-
if (value !== void 0) {
|
|
101995
|
-
node["@_val"] = normalizeChartGroupingValue(containerLocal, value);
|
|
101996
|
-
}
|
|
101997
|
-
}
|
|
101998
|
-
function normalizeChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
101999
|
-
if (!isKnownChartContainer(containerLocal)) {
|
|
102000
|
-
return;
|
|
102001
|
-
}
|
|
102002
|
-
for (const key2 of Object.keys(container2)) {
|
|
102003
|
-
if (key2.startsWith("@_") || key2 === "#text") {
|
|
102004
|
-
continue;
|
|
102005
|
-
}
|
|
102006
|
-
const local = getLocalName2(key2);
|
|
102007
|
-
if (!chartContainerAllows(containerLocal, local)) {
|
|
102008
|
-
delete container2[key2];
|
|
102009
|
-
continue;
|
|
102010
|
-
}
|
|
102011
|
-
if (local === "grouping") {
|
|
102012
|
-
const node = container2[key2];
|
|
102013
|
-
if (node && typeof node === "object" && !Array.isArray(node)) {
|
|
102014
|
-
normalizeGroupingNode(containerLocal, node);
|
|
102015
|
-
}
|
|
102016
|
-
}
|
|
102017
|
-
}
|
|
102018
|
-
const required = REQUIRED_LEADING_CHILD[containerLocal];
|
|
102019
|
-
if (required) {
|
|
102020
|
-
const present = Object.keys(container2).some((k) => getLocalName2(k) === required.local);
|
|
102021
|
-
if (!present) {
|
|
102022
|
-
container2[`c:${required.local}`] = { "@_val": required.val };
|
|
102023
|
-
}
|
|
102024
|
-
}
|
|
102025
|
-
}
|
|
102026
|
-
function orderChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
102027
|
-
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
102028
|
-
if (!order) {
|
|
102029
|
-
return;
|
|
102030
|
-
}
|
|
102031
|
-
const keys = Object.keys(container2).filter((k) => !k.startsWith("@_") && k !== "#text");
|
|
102032
|
-
if (keys.some((k) => !order.includes(getLocalName2(k)))) {
|
|
102033
|
-
return;
|
|
102034
|
-
}
|
|
102035
|
-
const sorted = [...keys].sort(
|
|
102036
|
-
(a, b) => order.indexOf(getLocalName2(a)) - order.indexOf(getLocalName2(b))
|
|
102037
|
-
);
|
|
102038
|
-
if (sorted.every((k, i) => k === keys[i])) {
|
|
102039
|
-
return;
|
|
102040
|
-
}
|
|
102041
|
-
const saved = sorted.map((k) => [k, container2[k]]);
|
|
102042
|
-
for (const k of keys) {
|
|
102043
|
-
delete container2[k];
|
|
102044
|
-
}
|
|
102045
|
-
for (const [k, v] of saved) {
|
|
102046
|
-
container2[k] = v;
|
|
102047
|
-
}
|
|
102048
|
-
}
|
|
102049
|
-
function renameXmlKeyInPlace(obj, oldKey, newKey) {
|
|
102050
|
-
if (oldKey === newKey || !(oldKey in obj)) {
|
|
102051
|
-
return;
|
|
102052
|
-
}
|
|
102053
|
-
const entries = Object.keys(obj).map((k) => [k === oldKey ? newKey : k, obj[k]]);
|
|
102054
|
-
for (const k of Object.keys(obj)) {
|
|
102055
|
-
delete obj[k];
|
|
102056
|
-
}
|
|
102057
|
-
for (const [k, v] of entries) {
|
|
102058
|
-
obj[k] = v;
|
|
102059
|
-
}
|
|
102060
|
-
}
|
|
102061
|
-
function referencedAxisIds(plotArea, getLocalName2) {
|
|
102062
|
-
const ids = /* @__PURE__ */ new Set();
|
|
102063
|
-
for (const key2 of Object.keys(plotArea)) {
|
|
102064
|
-
if (!getLocalName2(key2).endsWith("Chart")) {
|
|
102065
|
-
continue;
|
|
102066
|
-
}
|
|
102067
|
-
for (const container2 of toArray2(plotArea[key2])) {
|
|
102068
|
-
for (const childKey3 of Object.keys(container2)) {
|
|
102069
|
-
if (getLocalName2(childKey3) !== "axId") {
|
|
102070
|
-
continue;
|
|
102071
|
-
}
|
|
102072
|
-
for (const axId of toArray2(container2[childKey3])) {
|
|
102073
|
-
const val = axId["@_val"];
|
|
102074
|
-
if (val !== void 0) {
|
|
102075
|
-
ids.add(String(val));
|
|
102076
|
-
}
|
|
102077
|
-
}
|
|
102078
|
-
}
|
|
102079
|
-
}
|
|
102080
|
-
}
|
|
102081
|
-
return ids;
|
|
102082
|
-
}
|
|
102083
|
-
function toArray2(value) {
|
|
102084
|
-
if (Array.isArray(value)) {
|
|
102085
|
-
return value.filter((v) => typeof v === "object" && v !== null);
|
|
102086
|
-
}
|
|
102087
|
-
return typeof value === "object" && value !== null ? [value] : [];
|
|
102088
|
-
}
|
|
102089
|
-
function reconcileChartPlotAreaAxes(plotArea, getLocalName2) {
|
|
102090
|
-
const referenced = referencedAxisIds(plotArea, getLocalName2);
|
|
102091
|
-
let removed = 0;
|
|
102092
|
-
for (const key2 of Object.keys(plotArea)) {
|
|
102093
|
-
const local = getLocalName2(key2);
|
|
102094
|
-
if (!AXIS_LOCAL_NAMES.includes(local)) {
|
|
102095
|
-
continue;
|
|
102096
|
-
}
|
|
102097
|
-
const axes = toArray2(plotArea[key2]);
|
|
102098
|
-
const kept = axes.filter((axis) => {
|
|
102099
|
-
const axIdKey = Object.keys(axis).find((k) => getLocalName2(k) === "axId");
|
|
102100
|
-
const val = axIdKey ? toArray2(axis[axIdKey])[0]?.["@_val"] : void 0;
|
|
102101
|
-
return val !== void 0 && referenced.has(String(val));
|
|
102102
|
-
});
|
|
102103
|
-
removed += axes.length - kept.length;
|
|
102104
|
-
if (kept.length === 0) {
|
|
102105
|
-
delete plotArea[key2];
|
|
102106
|
-
} else if (kept.length !== axes.length) {
|
|
102107
|
-
plotArea[key2] = kept.length === 1 ? kept[0] : kept;
|
|
102108
|
-
}
|
|
102109
|
-
}
|
|
102110
|
-
return removed;
|
|
102111
|
-
}
|
|
102112
|
-
var init_chart_container_schema = __esm({
|
|
102113
|
-
"src/pptx/core/utils/chart-container-schema.ts"() {
|
|
102114
|
-
init_chart_container_content_model();
|
|
102115
|
-
init_chart_container_content_model();
|
|
102116
|
-
}
|
|
102117
|
-
});
|
|
102118
|
-
|
|
102119
103024
|
// src/pptx/core/utils/chart-combo-serializer.ts
|
|
102120
|
-
function
|
|
103025
|
+
function findKey25(obj, local, getLocalName2) {
|
|
102121
103026
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
102122
103027
|
}
|
|
102123
103028
|
function nonSeriesEntries(container2, getLocalName2) {
|
|
@@ -102149,14 +103054,14 @@ function consolidateComboContainersInXml(plotArea, getLocalName2) {
|
|
|
102149
103054
|
if (!primary) {
|
|
102150
103055
|
return { primaryKey, containerChildren };
|
|
102151
103056
|
}
|
|
102152
|
-
const serKey =
|
|
103057
|
+
const serKey = findKey25(primary, "ser", getLocalName2) ?? "c:ser";
|
|
102153
103058
|
const allSeries = [];
|
|
102154
103059
|
for (const key2 of containerKeys) {
|
|
102155
103060
|
const container2 = plotArea[key2];
|
|
102156
103061
|
if (!container2) {
|
|
102157
103062
|
continue;
|
|
102158
103063
|
}
|
|
102159
|
-
const containerSerKey =
|
|
103064
|
+
const containerSerKey = findKey25(container2, "ser", getLocalName2);
|
|
102160
103065
|
if (containerSerKey) {
|
|
102161
103066
|
allSeries.push(...ensureArray18(container2[containerSerKey]));
|
|
102162
103067
|
}
|
|
@@ -102184,7 +103089,7 @@ function applyComboSeriesTypesToXml(plotArea, originalKey, series, chartLevelTyp
|
|
|
102184
103089
|
if (!original) {
|
|
102185
103090
|
return false;
|
|
102186
103091
|
}
|
|
102187
|
-
const serKey =
|
|
103092
|
+
const serKey = findKey25(original, "ser", getLocalName2) ?? "c:ser";
|
|
102188
103093
|
const serNodes = ensureArray18(original[serKey]);
|
|
102189
103094
|
if (serNodes.length !== series.length) {
|
|
102190
103095
|
return false;
|
|
@@ -102241,7 +103146,7 @@ function applyGroupAxisReferences(container2, series, axes, getLocalName2) {
|
|
|
102241
103146
|
if (valueAxisId === void 0 || categoryAxisId === void 0) {
|
|
102242
103147
|
return;
|
|
102243
103148
|
}
|
|
102244
|
-
const key2 =
|
|
103149
|
+
const key2 = findKey25(container2, "axId", getLocalName2) ?? "c:axId";
|
|
102245
103150
|
container2[key2] = [{ "@_val": String(categoryAxisId) }, { "@_val": String(valueAxisId) }];
|
|
102246
103151
|
}
|
|
102247
103152
|
var init_chart_combo_serializer = __esm({
|
|
@@ -102251,7 +103156,7 @@ var init_chart_combo_serializer = __esm({
|
|
|
102251
103156
|
});
|
|
102252
103157
|
|
|
102253
103158
|
// src/pptx/core/utils/chart-filtered-series-writer.ts
|
|
102254
|
-
function
|
|
103159
|
+
function findKey26(obj, local, getLocalName2) {
|
|
102255
103160
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
102256
103161
|
}
|
|
102257
103162
|
function points3(values) {
|
|
@@ -102309,9 +103214,9 @@ function filteredSeriesUnchanged(container2, filteredSeries, xmlLookup) {
|
|
|
102309
103214
|
});
|
|
102310
103215
|
}
|
|
102311
103216
|
function applyFilteredSeriesToXml(container2, filteredSeries, categories, containerLocalName, getLocalName2) {
|
|
102312
|
-
const extLstKey =
|
|
103217
|
+
const extLstKey = findKey26(container2, "extLst", getLocalName2) ?? "c:extLst";
|
|
102313
103218
|
const extLst = { ...container2[extLstKey] ?? {} };
|
|
102314
|
-
const extKey =
|
|
103219
|
+
const extKey = findKey26(extLst, "ext", getLocalName2);
|
|
102315
103220
|
const exts = extKey ? Array.isArray(extLst[extKey]) ? [...extLst[extKey]] : [extLst[extKey]] : [];
|
|
102316
103221
|
const otherExts = exts.filter((ext) => ext["@_uri"] !== CHART_FILTERED_SERIES_EXT_URI);
|
|
102317
103222
|
const ownExt = {
|
|
@@ -102525,11 +103430,11 @@ var init_chart_legend_serializer = __esm({
|
|
|
102525
103430
|
});
|
|
102526
103431
|
|
|
102527
103432
|
// src/pptx/core/utils/chart-line-style-serializer.ts
|
|
102528
|
-
function
|
|
103433
|
+
function findKey27(node, name, localName28) {
|
|
102529
103434
|
return Object.keys(node).find((key2) => localName28(key2) === name);
|
|
102530
103435
|
}
|
|
102531
103436
|
function setOrdered5(node, name, value, localName28) {
|
|
102532
|
-
const key2 =
|
|
103437
|
+
const key2 = findKey27(node, name, localName28);
|
|
102533
103438
|
if (key2) {
|
|
102534
103439
|
node[key2] = value;
|
|
102535
103440
|
return;
|
|
@@ -102554,7 +103459,7 @@ function applyChartLineStyle(chartContainer, elementName, style, localName28, re
|
|
|
102554
103459
|
if (style === void 0) {
|
|
102555
103460
|
return;
|
|
102556
103461
|
}
|
|
102557
|
-
const key2 =
|
|
103462
|
+
const key2 = findKey27(chartContainer, elementName, localName28);
|
|
102558
103463
|
if (style === null) {
|
|
102559
103464
|
if (key2) {
|
|
102560
103465
|
delete chartContainer[key2];
|
|
@@ -102565,7 +103470,7 @@ function applyChartLineStyle(chartContainer, elementName, style, localName28, re
|
|
|
102565
103470
|
const node = { ...existing };
|
|
102566
103471
|
const hasLineProps = style.color || style.width !== void 0 || style.dashStyle;
|
|
102567
103472
|
if (hasLineProps) {
|
|
102568
|
-
const spPrKey =
|
|
103473
|
+
const spPrKey = findKey27(node, "spPr", localName28) ?? "c:spPr";
|
|
102569
103474
|
node[spPrKey] = writeChartShapeProps(
|
|
102570
103475
|
node[spPrKey],
|
|
102571
103476
|
{ strokeColor: style.color, strokeWidth: style.width, strokeDashStyle: style.dashStyle },
|
|
@@ -102599,7 +103504,7 @@ var init_chart_line_style_serializer = __esm({
|
|
|
102599
103504
|
});
|
|
102600
103505
|
|
|
102601
103506
|
// src/pptx/core/utils/chart-series-color-serializer.ts
|
|
102602
|
-
function
|
|
103507
|
+
function findKey28(obj, local, getLocalName2) {
|
|
102603
103508
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
102604
103509
|
}
|
|
102605
103510
|
function insertBeforeLn(obj, key2, value, getLocalName2) {
|
|
@@ -102629,14 +103534,14 @@ function insertFirst(obj, key2, value) {
|
|
|
102629
103534
|
function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolveColor2) {
|
|
102630
103535
|
const normalizedHex = hex3.replace(/^#/u, "");
|
|
102631
103536
|
if (isLineFamily) {
|
|
102632
|
-
const lnKey =
|
|
103537
|
+
const lnKey = findKey28(spPr, "ln", getLocalName2) ?? "a:ln";
|
|
102633
103538
|
const ln = spPr[lnKey] ?? {};
|
|
102634
103539
|
const hadLn = Boolean(spPr[lnKey]);
|
|
102635
|
-
const noFillKey =
|
|
103540
|
+
const noFillKey = findKey28(ln, "noFill", getLocalName2);
|
|
102636
103541
|
if (noFillKey) {
|
|
102637
103542
|
delete ln[noFillKey];
|
|
102638
103543
|
}
|
|
102639
|
-
const lnFillKey =
|
|
103544
|
+
const lnFillKey = findKey28(ln, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
102640
103545
|
const authoredFill2 = ln[lnFillKey];
|
|
102641
103546
|
const fillNode2 = serializeColorChoice(
|
|
102642
103547
|
authoredFill2,
|
|
@@ -102653,7 +103558,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
102653
103558
|
}
|
|
102654
103559
|
return;
|
|
102655
103560
|
}
|
|
102656
|
-
const fillKey =
|
|
103561
|
+
const fillKey = findKey28(spPr, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
102657
103562
|
const authoredFill = spPr[fillKey];
|
|
102658
103563
|
const fillNode = serializeColorChoice(
|
|
102659
103564
|
authoredFill,
|
|
@@ -102661,7 +103566,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
102661
103566
|
normalizedHex
|
|
102662
103567
|
);
|
|
102663
103568
|
if (authoredFill) {
|
|
102664
|
-
const noFillKey =
|
|
103569
|
+
const noFillKey = findKey28(spPr, "noFill", getLocalName2);
|
|
102665
103570
|
if (noFillKey) {
|
|
102666
103571
|
delete spPr[noFillKey];
|
|
102667
103572
|
}
|
|
@@ -102676,7 +103581,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
102676
103581
|
}
|
|
102677
103582
|
}
|
|
102678
103583
|
function ensureSeriesSpPr(seriesNode, getLocalName2) {
|
|
102679
|
-
const existingKey =
|
|
103584
|
+
const existingKey = findKey28(seriesNode, "spPr", getLocalName2);
|
|
102680
103585
|
if (existingKey) {
|
|
102681
103586
|
return seriesNode[existingKey];
|
|
102682
103587
|
}
|
|
@@ -102696,7 +103601,7 @@ function applySeriesGradientToXml(seriesNode, gradient, getLocalName2, options =
|
|
|
102696
103601
|
if (options.lineDrawn) {
|
|
102697
103602
|
return false;
|
|
102698
103603
|
}
|
|
102699
|
-
const spPrKey =
|
|
103604
|
+
const spPrKey = findKey28(seriesNode, "spPr", getLocalName2);
|
|
102700
103605
|
if (!spPrKey && !gradient) {
|
|
102701
103606
|
return false;
|
|
102702
103607
|
}
|
|
@@ -102732,11 +103637,11 @@ var init_chart_series_color_serializer = __esm({
|
|
|
102732
103637
|
});
|
|
102733
103638
|
|
|
102734
103639
|
// src/pptx/core/utils/chart-subtype-serializer.ts
|
|
102735
|
-
function
|
|
103640
|
+
function findKey29(obj, local, getLocalName2) {
|
|
102736
103641
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
102737
103642
|
}
|
|
102738
103643
|
function upsertValChild(parent, localName28, value, getLocalName2) {
|
|
102739
|
-
const existingKey =
|
|
103644
|
+
const existingKey = findKey29(parent, localName28, getLocalName2);
|
|
102740
103645
|
if (value === void 0) {
|
|
102741
103646
|
if (existingKey) {
|
|
102742
103647
|
delete parent[existingKey];
|
|
@@ -102776,7 +103681,7 @@ function applySurfaceWireframeToXml(chartTypeContainer, containerLocalName, wire
|
|
|
102776
103681
|
orderChartContainerChildren(chartTypeContainer, containerLocalName, getLocalName2);
|
|
102777
103682
|
}
|
|
102778
103683
|
function applySeriesBar3DShapeToXml(seriesNode, shape, getLocalName2) {
|
|
102779
|
-
const existingKey =
|
|
103684
|
+
const existingKey = findKey29(seriesNode, "shape", getLocalName2);
|
|
102780
103685
|
if (shape === void 0) {
|
|
102781
103686
|
if (existingKey) {
|
|
102782
103687
|
delete seriesNode[existingKey];
|
|
@@ -102921,7 +103826,7 @@ var init_chart_title_run_alignment = __esm({
|
|
|
102921
103826
|
// src/pptx/core/utils/chart-title-serializer.ts
|
|
102922
103827
|
function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefix: "c" }) {
|
|
102923
103828
|
const { prefix } = options;
|
|
102924
|
-
const existingKey =
|
|
103829
|
+
const existingKey = findKey9(chartRoot, "title", getLocalName2);
|
|
102925
103830
|
const remove = model.hasTitle === false || model.title === "" && model.hasTitle !== true;
|
|
102926
103831
|
if (remove) {
|
|
102927
103832
|
if (existingKey) {
|
|
@@ -102959,14 +103864,14 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
|
|
|
102959
103864
|
insertAt2(chartRoot, 0, `${prefix}:title`, titleNode);
|
|
102960
103865
|
}
|
|
102961
103866
|
} else if (runs) {
|
|
102962
|
-
const txKey =
|
|
103867
|
+
const txKey = findKey9(titleNode, "tx", getLocalName2);
|
|
102963
103868
|
if (txKey) {
|
|
102964
103869
|
titleNode[txKey] = buildTitleTextFromRuns(prefix, runs);
|
|
102965
103870
|
} else {
|
|
102966
103871
|
insertAt2(titleNode, 0, `${prefix}:tx`, buildTitleTextFromRuns(prefix, runs));
|
|
102967
103872
|
}
|
|
102968
103873
|
} else if (model.title !== void 0 && !replaceFirstText(titleNode, model.title, getLocalName2)) {
|
|
102969
|
-
const txKey =
|
|
103874
|
+
const txKey = findKey9(titleNode, "tx", getLocalName2);
|
|
102970
103875
|
if (txKey) {
|
|
102971
103876
|
titleNode[txKey] = buildTitleText(prefix, model.title);
|
|
102972
103877
|
} else {
|
|
@@ -102987,7 +103892,7 @@ var init_chart_title_serializer = __esm({
|
|
|
102987
103892
|
});
|
|
102988
103893
|
|
|
102989
103894
|
// src/pptx/core/utils/chart-title-style-serializer.ts
|
|
102990
|
-
function
|
|
103895
|
+
function findKey30(node, localName28, getLocalName2) {
|
|
102991
103896
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName28);
|
|
102992
103897
|
}
|
|
102993
103898
|
function setChildOrdered(node, key2, existingKey, value, laterNames, getLocalName2) {
|
|
@@ -103030,9 +103935,9 @@ function asArray3(value) {
|
|
|
103030
103935
|
return value && typeof value === "object" ? [value] : [];
|
|
103031
103936
|
}
|
|
103032
103937
|
function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
103033
|
-
const txKey =
|
|
103938
|
+
const txKey = findKey30(title, "tx", getLocalName2);
|
|
103034
103939
|
const tx = txKey ? title[txKey] : void 0;
|
|
103035
|
-
const richKey = tx ?
|
|
103940
|
+
const richKey = tx ? findKey30(tx, "rich", getLocalName2) : void 0;
|
|
103036
103941
|
const rich = richKey && tx ? tx[richKey] : void 0;
|
|
103037
103942
|
if (!tx || !rich || !txKey || !richKey) {
|
|
103038
103943
|
return void 0;
|
|
@@ -103041,22 +103946,22 @@ function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
|
103041
103946
|
if (!hasFont) {
|
|
103042
103947
|
return txKey;
|
|
103043
103948
|
}
|
|
103044
|
-
const pKey =
|
|
103949
|
+
const pKey = findKey30(rich, "p", getLocalName2) ?? "a:p";
|
|
103045
103950
|
const paragraphs = asArray3(rich[pKey]).map((para) => {
|
|
103046
103951
|
const next = { ...para };
|
|
103047
|
-
const pPrKey =
|
|
103952
|
+
const pPrKey = findKey30(next, "pPr", getLocalName2) ?? "a:pPr";
|
|
103048
103953
|
const pPr = { ...next[pPrKey] ?? {} };
|
|
103049
|
-
const defRPrKey =
|
|
103954
|
+
const defRPrKey = findKey30(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
103050
103955
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
103051
103956
|
pPr[defRPrKey] = {
|
|
103052
103957
|
...existingDefRPr,
|
|
103053
103958
|
...buildTitleDefRPr(style, existingDefRPr, resolveColor2)
|
|
103054
103959
|
};
|
|
103055
103960
|
next[pPrKey] = pPr;
|
|
103056
|
-
const rKey =
|
|
103961
|
+
const rKey = findKey30(next, "r", getLocalName2);
|
|
103057
103962
|
if (rKey) {
|
|
103058
103963
|
const runs = asArray3(next[rKey]).map((run) => {
|
|
103059
|
-
const rPrKey =
|
|
103964
|
+
const rPrKey = findKey30(run, "rPr", getLocalName2) ?? "a:rPr";
|
|
103060
103965
|
const existingRPr = run[rPrKey] ?? {};
|
|
103061
103966
|
const nextRun = { ...run };
|
|
103062
103967
|
nextRun[rPrKey] = { ...existingRPr, ...buildTitleDefRPr(style, existingRPr, resolveColor2) };
|
|
@@ -103079,13 +103984,13 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
|
|
|
103079
103984
|
return;
|
|
103080
103985
|
}
|
|
103081
103986
|
const { prefix } = options;
|
|
103082
|
-
const titleKey =
|
|
103987
|
+
const titleKey = findKey30(chartRoot, "title", getLocalName2);
|
|
103083
103988
|
if (!titleKey) {
|
|
103084
103989
|
return;
|
|
103085
103990
|
}
|
|
103086
103991
|
const title = { ...chartRoot[titleKey] ?? {} };
|
|
103087
103992
|
if (style.spPr !== void 0) {
|
|
103088
|
-
const spPrKey =
|
|
103993
|
+
const spPrKey = findKey30(title, "spPr", getLocalName2);
|
|
103089
103994
|
if (style.spPr === null) {
|
|
103090
103995
|
if (spPrKey) {
|
|
103091
103996
|
delete title[spPrKey];
|
|
@@ -103102,23 +104007,23 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
|
|
|
103102
104007
|
}
|
|
103103
104008
|
const richKey = applyRichTitleFont(title, style, getLocalName2, resolveColor2);
|
|
103104
104009
|
if (hasFont && richKey === void 0) {
|
|
103105
|
-
const existingTxPrKey =
|
|
104010
|
+
const existingTxPrKey = findKey30(title, "txPr", getLocalName2);
|
|
103106
104011
|
const txPrKey = existingTxPrKey ?? `${prefix}:txPr`;
|
|
103107
104012
|
const txPr = { ...title[txPrKey] ?? {} };
|
|
103108
|
-
if (!txPr[
|
|
104013
|
+
if (!txPr[findKey30(txPr, "bodyPr", getLocalName2) ?? "a:bodyPr"]) {
|
|
103109
104014
|
txPr["a:bodyPr"] = {};
|
|
103110
104015
|
}
|
|
103111
|
-
if (!txPr[
|
|
104016
|
+
if (!txPr[findKey30(txPr, "lstStyle", getLocalName2) ?? "a:lstStyle"]) {
|
|
103112
104017
|
txPr["a:lstStyle"] = {};
|
|
103113
104018
|
}
|
|
103114
|
-
const pKey =
|
|
104019
|
+
const pKey = findKey30(txPr, "p", getLocalName2) ?? "a:p";
|
|
103115
104020
|
const existingP = txPr[pKey];
|
|
103116
104021
|
const para = {
|
|
103117
104022
|
...(Array.isArray(existingP) ? existingP[0] : existingP) ?? {}
|
|
103118
104023
|
};
|
|
103119
|
-
const pPrKey =
|
|
104024
|
+
const pPrKey = findKey30(para, "pPr", getLocalName2) ?? "a:pPr";
|
|
103120
104025
|
const pPr = { ...para[pPrKey] ?? {} };
|
|
103121
|
-
const defRPrKey =
|
|
104026
|
+
const defRPrKey = findKey30(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
103122
104027
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
103123
104028
|
pPr[defRPrKey] = {
|
|
103124
104029
|
...existingDefRPr,
|
|
@@ -103268,7 +104173,7 @@ var init_chart_xlsx_writer = __esm({
|
|
|
103268
104173
|
});
|
|
103269
104174
|
|
|
103270
104175
|
// src/pptx/core/core/runtime/chart-cx-update-data.ts
|
|
103271
|
-
function
|
|
104176
|
+
function findKey31(node, localName28, getLocalName2) {
|
|
103272
104177
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName28);
|
|
103273
104178
|
}
|
|
103274
104179
|
function asArray4(value) {
|
|
@@ -103283,8 +104188,8 @@ function dimensionType(node) {
|
|
|
103283
104188
|
return String(node["@_type"] ?? "");
|
|
103284
104189
|
}
|
|
103285
104190
|
function replaceLevels(target, source, getLocalName2) {
|
|
103286
|
-
const targetKey =
|
|
103287
|
-
const sourceKey =
|
|
104191
|
+
const targetKey = findKey31(target, "lvl", getLocalName2) ?? "cx:lvl";
|
|
104192
|
+
const sourceKey = findKey31(source, "lvl", getLocalName2);
|
|
103288
104193
|
const oldLevels = asArray4(target[targetKey]);
|
|
103289
104194
|
const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level2, index) => {
|
|
103290
104195
|
const old = oldLevels[index];
|
|
@@ -103303,8 +104208,8 @@ function replaceLevels(target, source, getLocalName2) {
|
|
|
103303
104208
|
}
|
|
103304
104209
|
function replaceChartExDataDimensions(target, fresh, getLocalName2) {
|
|
103305
104210
|
for (const kind of ["strDim", "numDim"]) {
|
|
103306
|
-
const targetKey =
|
|
103307
|
-
const freshKey =
|
|
104211
|
+
const targetKey = findKey31(target, kind, getLocalName2) ?? `cx:${kind}`;
|
|
104212
|
+
const freshKey = findKey31(fresh, kind, getLocalName2);
|
|
103308
104213
|
const existing = asArray4(target[targetKey]);
|
|
103309
104214
|
const incoming = asArray4(freshKey ? fresh[freshKey] : void 0);
|
|
103310
104215
|
for (const dimension of incoming) {
|
|
@@ -103333,14 +104238,14 @@ var init_chart_cx_update_data = __esm({
|
|
|
103333
104238
|
});
|
|
103334
104239
|
|
|
103335
104240
|
// src/pptx/core/core/runtime/chart-cx-update-series.ts
|
|
103336
|
-
function
|
|
104241
|
+
function findKey32(node, localName28, getLocalName2) {
|
|
103337
104242
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName28);
|
|
103338
104243
|
}
|
|
103339
104244
|
function child24(node, localName28, getLocalName2) {
|
|
103340
104245
|
if (!node) {
|
|
103341
104246
|
return void 0;
|
|
103342
104247
|
}
|
|
103343
|
-
const key2 =
|
|
104248
|
+
const key2 = findKey32(node, localName28, getLocalName2);
|
|
103344
104249
|
const value = key2 ? node[key2] : void 0;
|
|
103345
104250
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
103346
104251
|
}
|
|
@@ -103352,7 +104257,7 @@ function asArray5(value) {
|
|
|
103352
104257
|
(entry) => Boolean(entry) && typeof entry === "object"
|
|
103353
104258
|
);
|
|
103354
104259
|
}
|
|
103355
|
-
function
|
|
104260
|
+
function insertBefore3(parent, key2, value, before, getLocalName2) {
|
|
103356
104261
|
const entries = Object.keys(parent).map((k) => [k, parent[k]]);
|
|
103357
104262
|
let index = entries.findIndex(([k]) => !k.startsWith("@_") && before.includes(getLocalName2(k)));
|
|
103358
104263
|
if (index === -1) {
|
|
@@ -103370,15 +104275,15 @@ function applySeriesName(node, name, getLocalName2) {
|
|
|
103370
104275
|
const tx = child24(node, "tx", getLocalName2);
|
|
103371
104276
|
const txData = child24(tx, "txData", getLocalName2);
|
|
103372
104277
|
if (tx && txData) {
|
|
103373
|
-
const vKey =
|
|
104278
|
+
const vKey = findKey32(txData, "v", getLocalName2) ?? "cx:v";
|
|
103374
104279
|
txData[vKey] = name;
|
|
103375
104280
|
return;
|
|
103376
104281
|
}
|
|
103377
|
-
const txKey =
|
|
104282
|
+
const txKey = findKey32(node, "tx", getLocalName2);
|
|
103378
104283
|
if (txKey) {
|
|
103379
104284
|
delete node[txKey];
|
|
103380
104285
|
}
|
|
103381
|
-
|
|
104286
|
+
insertBefore3(node, "cx:tx", { "cx:txData": { "cx:v": name } }, AFTER_TX, getLocalName2);
|
|
103382
104287
|
}
|
|
103383
104288
|
function currentSeriesColor(node, getLocalName2) {
|
|
103384
104289
|
const srgb = child24(
|
|
@@ -103400,7 +104305,7 @@ function applySeriesColor(node, series, getLocalName2) {
|
|
|
103400
104305
|
}
|
|
103401
104306
|
const spPr = child24(node, "spPr", getLocalName2);
|
|
103402
104307
|
if (!spPr) {
|
|
103403
|
-
|
|
104308
|
+
insertBefore3(node, "cx:spPr", fill, AFTER_TX.slice(1), getLocalName2);
|
|
103404
104309
|
return;
|
|
103405
104310
|
}
|
|
103406
104311
|
for (const key2 of Object.keys(spPr)) {
|
|
@@ -103408,13 +104313,13 @@ function applySeriesColor(node, series, getLocalName2) {
|
|
|
103408
104313
|
delete spPr[key2];
|
|
103409
104314
|
}
|
|
103410
104315
|
}
|
|
103411
|
-
|
|
104316
|
+
insertBefore3(spPr, "a:solidFill", fill["a:solidFill"], AFTER_FILL2, getLocalName2);
|
|
103412
104317
|
}
|
|
103413
104318
|
function applySeriesDataLabels(node, hasDataLabels, getLocalName2) {
|
|
103414
104319
|
if (hasDataLabels === void 0) {
|
|
103415
104320
|
return;
|
|
103416
104321
|
}
|
|
103417
|
-
const key2 =
|
|
104322
|
+
const key2 = findKey32(node, "dataLabels", getLocalName2);
|
|
103418
104323
|
if (!hasDataLabels) {
|
|
103419
104324
|
if (key2) {
|
|
103420
104325
|
delete node[key2];
|
|
@@ -103422,7 +104327,7 @@ function applySeriesDataLabels(node, hasDataLabels, getLocalName2) {
|
|
|
103422
104327
|
return;
|
|
103423
104328
|
}
|
|
103424
104329
|
if (!key2) {
|
|
103425
|
-
|
|
104330
|
+
insertBefore3(
|
|
103426
104331
|
node,
|
|
103427
104332
|
"cx:dataLabels",
|
|
103428
104333
|
buildChartExDataLabels(),
|
|
@@ -103453,7 +104358,7 @@ function bindSeriesData(node, dataNodes, chartData, series, getLocalName2) {
|
|
|
103453
104358
|
);
|
|
103454
104359
|
return;
|
|
103455
104360
|
}
|
|
103456
|
-
const inlineKey =
|
|
104361
|
+
const inlineKey = findKey32(node, "data", getLocalName2);
|
|
103457
104362
|
if (inlineKey && !dataIdNode) {
|
|
103458
104363
|
const inline = node[inlineKey];
|
|
103459
104364
|
if (inline && typeof inline === "object" && !Array.isArray(inline)) {
|
|
@@ -103470,7 +104375,7 @@ function bindSeriesData(node, dataNodes, chartData, series, getLocalName2) {
|
|
|
103470
104375
|
if (dataIdNode) {
|
|
103471
104376
|
dataIdNode["@_val"] = String(id);
|
|
103472
104377
|
} else {
|
|
103473
|
-
|
|
104378
|
+
insertBefore3(
|
|
103474
104379
|
node,
|
|
103475
104380
|
"cx:dataId",
|
|
103476
104381
|
{ "@_val": String(id) },
|
|
@@ -103506,7 +104411,7 @@ function applyLegend(chartRoot, chartData, getLocalName2) {
|
|
|
103506
104411
|
if (!style || style.hasLegend === void 0) {
|
|
103507
104412
|
return;
|
|
103508
104413
|
}
|
|
103509
|
-
const key2 =
|
|
104414
|
+
const key2 = findKey32(chartRoot, "legend", getLocalName2);
|
|
103510
104415
|
if (!style.hasLegend) {
|
|
103511
104416
|
if (key2) {
|
|
103512
104417
|
delete chartRoot[key2];
|
|
@@ -103524,7 +104429,7 @@ function applyLegend(chartRoot, chartData, getLocalName2) {
|
|
|
103524
104429
|
delete chartRoot[key2];
|
|
103525
104430
|
}
|
|
103526
104431
|
const legend = buildChartExLegend(style.legendPosition);
|
|
103527
|
-
|
|
104432
|
+
insertBefore3(chartRoot, "cx:legend", legend, ["extLst"], getLocalName2);
|
|
103528
104433
|
}
|
|
103529
104434
|
function chartExLayoutChanged(chartSpace, chartData, getLocalName2) {
|
|
103530
104435
|
const region = child24(
|
|
@@ -103532,7 +104437,7 @@ function chartExLayoutChanged(chartSpace, chartData, getLocalName2) {
|
|
|
103532
104437
|
"plotAreaRegion",
|
|
103533
104438
|
getLocalName2
|
|
103534
104439
|
);
|
|
103535
|
-
const seriesKey = region ?
|
|
104440
|
+
const seriesKey = region ? findKey32(region, "series", getLocalName2) : void 0;
|
|
103536
104441
|
const first = region && seriesKey ? asArray5(region[seriesKey])[0] : void 0;
|
|
103537
104442
|
const existing = String(first?.["@_layoutId"] ?? "").toLowerCase();
|
|
103538
104443
|
const series = chartData.series[0];
|
|
@@ -103548,11 +104453,11 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
103548
104453
|
if (!chartRoot || !region) {
|
|
103549
104454
|
return false;
|
|
103550
104455
|
}
|
|
103551
|
-
const chartDataKey =
|
|
104456
|
+
const chartDataKey = findKey32(chartSpace, "chartData", getLocalName2);
|
|
103552
104457
|
const chartDataNode = (chartDataKey ? chartSpace[chartDataKey] : void 0) ?? {};
|
|
103553
|
-
const dataKey =
|
|
104458
|
+
const dataKey = findKey32(chartDataNode, "data", getLocalName2) ?? "cx:data";
|
|
103554
104459
|
const dataNodes = asArray5(chartDataNode[dataKey]);
|
|
103555
|
-
const seriesKey =
|
|
104460
|
+
const seriesKey = findKey32(region, "series", getLocalName2) ?? "cx:series";
|
|
103556
104461
|
const existing = asArray5(region[seriesKey]);
|
|
103557
104462
|
const updated = [];
|
|
103558
104463
|
chartData.series.forEach((series, index) => {
|
|
@@ -103581,7 +104486,7 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
103581
104486
|
region[seriesKey] = updated.length === 1 ? updated[0] : updated;
|
|
103582
104487
|
chartDataNode[dataKey] = survivingData.length === 1 ? survivingData[0] : survivingData;
|
|
103583
104488
|
if (!chartDataKey) {
|
|
103584
|
-
|
|
104489
|
+
insertBefore3(chartSpace, "cx:chartData", chartDataNode, ["chart"], getLocalName2);
|
|
103585
104490
|
}
|
|
103586
104491
|
applyChartTitleToXml(
|
|
103587
104492
|
chartRoot,
|
|
@@ -105945,7 +106850,7 @@ var init_master_color_map = __esm({
|
|
|
105945
106850
|
|
|
105946
106851
|
// src/pptx/core/services/native-animation-theme-colors.ts
|
|
105947
106852
|
function resolveToken2(value, resolveThemeColor) {
|
|
105948
|
-
if (!value ||
|
|
106853
|
+
if (!value || HEX_COLOR3.test(value)) {
|
|
105949
106854
|
return value;
|
|
105950
106855
|
}
|
|
105951
106856
|
return resolveThemeColor(value) ?? value;
|
|
@@ -105969,10 +106874,10 @@ function resolveNativeAnimationThemeColors(animations, resolveThemeColor) {
|
|
|
105969
106874
|
} : animation
|
|
105970
106875
|
);
|
|
105971
106876
|
}
|
|
105972
|
-
var
|
|
106877
|
+
var HEX_COLOR3;
|
|
105973
106878
|
var init_native_animation_theme_colors = __esm({
|
|
105974
106879
|
"src/pptx/core/services/native-animation-theme-colors.ts"() {
|
|
105975
|
-
|
|
106880
|
+
HEX_COLOR3 = /^#?[0-9a-f]{6}$/iu;
|
|
105976
106881
|
}
|
|
105977
106882
|
});
|
|
105978
106883
|
|
|
@@ -109701,6 +110606,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
109701
110606
|
var PptxHandlerRuntime10;
|
|
109702
110607
|
var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
109703
110608
|
"src/pptx/core/core/runtime/PptxHandlerRuntimePresentationProps.ts"() {
|
|
110609
|
+
init_chart_area_format();
|
|
109704
110610
|
init_chart_data_label_parser();
|
|
109705
110611
|
init_chart_data_labels_visibility();
|
|
109706
110612
|
init_chart_def_rpr_style();
|
|
@@ -109799,27 +110705,18 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
109799
110705
|
}
|
|
109800
110706
|
}
|
|
109801
110707
|
/**
|
|
109802
|
-
* Resolve the `c:spPr` fill of a chart container
|
|
109803
|
-
* `c:plotArea`) to a colour string, or the literal
|
|
109804
|
-
* `<a:noFill
|
|
109805
|
-
*
|
|
109806
|
-
*
|
|
109807
|
-
* `<a:noFill/>` parses to the empty STRING, so presence - not truthiness -
|
|
109808
|
-
* has to decide.
|
|
110708
|
+
* Resolve the `c:spPr` fill and border of a chart container
|
|
110709
|
+
* (`c:chartSpace` or `c:plotArea`) to a colour string, or the literal
|
|
110710
|
+
* `'none'` for `<a:noFill/>`; `undefined` when the container declares
|
|
110711
|
+
* nothing, which leaves the choice to the renderer. The save path reads it
|
|
110712
|
+
* back with the same function (`chart-area-format.ts`).
|
|
109809
110713
|
*/
|
|
109810
|
-
|
|
109811
|
-
|
|
109812
|
-
|
|
109813
|
-
|
|
109814
|
-
|
|
109815
|
-
const hasNoFill = Object.keys(shapeProperties).some(
|
|
109816
|
-
(key2) => this.compatibilityService.getXmlLocalName(key2) === "noFill"
|
|
110714
|
+
parseChartContainerFormat(container2) {
|
|
110715
|
+
return parseChartAreaFormat(
|
|
110716
|
+
container2,
|
|
110717
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2),
|
|
110718
|
+
(node) => this.parseColor(node)
|
|
109817
110719
|
);
|
|
109818
|
-
if (hasNoFill) {
|
|
109819
|
-
return "none";
|
|
109820
|
-
}
|
|
109821
|
-
const solidFill3 = this.xmlLookupService.getChildByLocalName(shapeProperties, "solidFill");
|
|
109822
|
-
return solidFill3 ? this.parseColor(solidFill3) : void 0;
|
|
109823
110720
|
}
|
|
109824
110721
|
/**
|
|
109825
110722
|
* Extract chart style metadata from chart XML.
|
|
@@ -109835,9 +110732,13 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
109835
110732
|
style.styleId = parseInt(String(styleNode["@_val"]));
|
|
109836
110733
|
hasStyle = true;
|
|
109837
110734
|
}
|
|
109838
|
-
const
|
|
109839
|
-
if (
|
|
109840
|
-
style.chartAreaFill =
|
|
110735
|
+
const chartArea = this.parseChartContainerFormat(chartSpace);
|
|
110736
|
+
if (chartArea.fill) {
|
|
110737
|
+
style.chartAreaFill = chartArea.fill;
|
|
110738
|
+
hasStyle = true;
|
|
110739
|
+
}
|
|
110740
|
+
if (chartArea.border) {
|
|
110741
|
+
style.chartAreaBorder = chartArea.border;
|
|
109841
110742
|
hasStyle = true;
|
|
109842
110743
|
}
|
|
109843
110744
|
const chartAreaGradient = parseChartGradientFill(
|
|
@@ -109905,9 +110806,13 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
109905
110806
|
if (plotAreaGradient) {
|
|
109906
110807
|
style.plotAreaGradient = plotAreaGradient;
|
|
109907
110808
|
}
|
|
109908
|
-
const
|
|
109909
|
-
if (
|
|
109910
|
-
style.plotAreaFill =
|
|
110809
|
+
const plotAreaFormat = this.parseChartContainerFormat(plotArea);
|
|
110810
|
+
if (plotAreaFormat.fill) {
|
|
110811
|
+
style.plotAreaFill = plotAreaFormat.fill;
|
|
110812
|
+
hasStyle = true;
|
|
110813
|
+
}
|
|
110814
|
+
if (plotAreaFormat.border) {
|
|
110815
|
+
style.plotAreaBorder = plotAreaFormat.border;
|
|
109911
110816
|
hasStyle = true;
|
|
109912
110817
|
}
|
|
109913
110818
|
const valAx = this.xmlLookupService.getChildByLocalName(plotArea, "valAx");
|
|
@@ -115168,7 +116073,10 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
115168
116073
|
init_chart_axis_dispunits_serializer();
|
|
115169
116074
|
init_chart_axis_gridlines_serializer();
|
|
115170
116075
|
init_chart_axis_label_formatting();
|
|
116076
|
+
init_chart_axis_deleted();
|
|
115171
116077
|
init_chart_axis_scaling();
|
|
116078
|
+
init_chart_group_options();
|
|
116079
|
+
init_chart_space_format();
|
|
115172
116080
|
init_chart_axis_title_serializer();
|
|
115173
116081
|
init_chart_band_fmts();
|
|
115174
116082
|
init_chart_bubble_options();
|
|
@@ -115422,6 +116330,15 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
115422
116330
|
} else if (groupingKey) {
|
|
115423
116331
|
delete chartTypeContainer[groupingKey];
|
|
115424
116332
|
}
|
|
116333
|
+
const singleContainer = (consolidation?.containerChildren.size ?? 1) <= 1;
|
|
116334
|
+
if (singleContainer && chartData.chartType !== "combo") {
|
|
116335
|
+
applyChartGroupOptionsToXml(
|
|
116336
|
+
chartTypeContainer,
|
|
116337
|
+
containerLocalName,
|
|
116338
|
+
chartData,
|
|
116339
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2)
|
|
116340
|
+
);
|
|
116341
|
+
}
|
|
115425
116342
|
const seriesNodes = this.xmlLookupService.getChildrenArrayByLocalName(
|
|
115426
116343
|
chartTypeContainer,
|
|
115427
116344
|
"ser"
|
|
@@ -115826,6 +116743,11 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
115826
116743
|
if (!matchingAxis) {
|
|
115827
116744
|
continue;
|
|
115828
116745
|
}
|
|
116746
|
+
applyChartAxisDeletedToXml(
|
|
116747
|
+
axisNode,
|
|
116748
|
+
matchingAxis.deleted,
|
|
116749
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2)
|
|
116750
|
+
);
|
|
115829
116751
|
const scalingNode = this.xmlLookupService.getChildByLocalName(axisNode, "scaling");
|
|
115830
116752
|
if (scalingNode) {
|
|
115831
116753
|
applyChartAxisScaling(
|
|
@@ -115901,6 +116823,18 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
115901
116823
|
}
|
|
115902
116824
|
}
|
|
115903
116825
|
}
|
|
116826
|
+
if (chartSpace) {
|
|
116827
|
+
applyChartSpaceFormatToXml(
|
|
116828
|
+
chartSpace,
|
|
116829
|
+
plotArea,
|
|
116830
|
+
chartData,
|
|
116831
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2),
|
|
116832
|
+
{
|
|
116833
|
+
...this.chartGradientWriteOptions(false),
|
|
116834
|
+
resolveColor: (node) => this.parseColor(node)
|
|
116835
|
+
}
|
|
116836
|
+
);
|
|
116837
|
+
}
|
|
115904
116838
|
for (const key2 of Object.keys(plotArea)) {
|
|
115905
116839
|
const local = this.compatibilityService.getXmlLocalName(key2);
|
|
115906
116840
|
if (!local.endsWith("Chart")) {
|
|
@@ -116334,7 +117268,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
116334
117268
|
});
|
|
116335
117269
|
|
|
116336
117270
|
// src/pptx/core/core/runtime/smartart-definition-builder.ts
|
|
116337
|
-
function
|
|
117271
|
+
function findKey33(node, name, localName28) {
|
|
116338
117272
|
return Object.keys(node).find((key2) => localName28(key2) === name);
|
|
116339
117273
|
}
|
|
116340
117274
|
function prefixFor(node) {
|
|
@@ -116353,7 +117287,7 @@ function setChildren(node, name, values, localName28) {
|
|
|
116353
117287
|
if (values === void 0) {
|
|
116354
117288
|
return false;
|
|
116355
117289
|
}
|
|
116356
|
-
const existing =
|
|
117290
|
+
const existing = findKey33(node, name, localName28);
|
|
116357
117291
|
if (values.length === 0) {
|
|
116358
117292
|
if (existing) {
|
|
116359
117293
|
delete node[existing];
|
|
@@ -116380,7 +117314,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName28) {
|
|
|
116380
117314
|
changed = setChildren(node, "title", textNodes(metadata.titles), localName28) || changed;
|
|
116381
117315
|
changed = setChildren(node, "desc", textNodes(metadata.descriptions), localName28) || changed;
|
|
116382
117316
|
if (metadata.categories !== void 0) {
|
|
116383
|
-
const key2 =
|
|
117317
|
+
const key2 = findKey33(node, "catLst", localName28);
|
|
116384
117318
|
if (metadata.categories.length === 0) {
|
|
116385
117319
|
if (key2) {
|
|
116386
117320
|
delete node[key2];
|
|
@@ -116404,7 +117338,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName28) {
|
|
|
116404
117338
|
return changed;
|
|
116405
117339
|
}
|
|
116406
117340
|
function ensureLabels(node, localName28) {
|
|
116407
|
-
const key2 =
|
|
117341
|
+
const key2 = findKey33(node, "styleLbl", localName28) ?? `${prefixFor(node)}styleLbl`;
|
|
116408
117342
|
return { key: key2, labels: objects(node[key2]) };
|
|
116409
117343
|
}
|
|
116410
117344
|
function applySmartArtQuickStyleLabels(node, labels, localName28) {
|
|
@@ -116419,7 +117353,7 @@ function applySmartArtQuickStyleLabels(node, labels, localName28) {
|
|
|
116419
117353
|
return true;
|
|
116420
117354
|
}
|
|
116421
117355
|
function applyColorList(label, name, metadata, localName28) {
|
|
116422
|
-
const key2 =
|
|
117356
|
+
const key2 = findKey33(label, name, localName28) ?? `${prefixFor(label)}${name}`;
|
|
116423
117357
|
const list2 = objects(label[key2])[0] ?? {};
|
|
116424
117358
|
if (metadata.method !== void 0) {
|
|
116425
117359
|
list2["@_meth"] = metadata.method;
|
|
@@ -116462,17 +117396,17 @@ var init_smartart_definition_builder = __esm({
|
|
|
116462
117396
|
});
|
|
116463
117397
|
|
|
116464
117398
|
// src/pptx/core/core/runtime/smartart-colors-builder.ts
|
|
116465
|
-
function
|
|
117399
|
+
function asObject2(value) {
|
|
116466
117400
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
116467
117401
|
}
|
|
116468
117402
|
function toArray4(value) {
|
|
116469
117403
|
if (Array.isArray(value)) {
|
|
116470
|
-
return value.filter((entry) => Boolean(
|
|
117404
|
+
return value.filter((entry) => Boolean(asObject2(entry)));
|
|
116471
117405
|
}
|
|
116472
|
-
const obj =
|
|
117406
|
+
const obj = asObject2(value);
|
|
116473
117407
|
return obj ? [obj] : [];
|
|
116474
117408
|
}
|
|
116475
|
-
function
|
|
117409
|
+
function findKey34(obj, name, getLocalName2) {
|
|
116476
117410
|
return Object.keys(obj).find((k) => getLocalName2(k) === name);
|
|
116477
117411
|
}
|
|
116478
117412
|
function hex2(value) {
|
|
@@ -116487,13 +117421,13 @@ function applyColorToList(list2, value, getLocalName2, resolveColor2) {
|
|
|
116487
117421
|
}
|
|
116488
117422
|
const existing = list2[colorKey];
|
|
116489
117423
|
if (resolveColor2) {
|
|
116490
|
-
const authored =
|
|
117424
|
+
const authored = asObject2(Array.isArray(existing) ? existing[0] : existing);
|
|
116491
117425
|
const authoredHex = authored ? resolveColor2({ [colorKey]: authored }) : void 0;
|
|
116492
117426
|
if (authoredHex && colorsEqual(authoredHex, value)) {
|
|
116493
117427
|
return;
|
|
116494
117428
|
}
|
|
116495
117429
|
}
|
|
116496
|
-
const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(
|
|
117430
|
+
const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(asObject2(entry))) : [];
|
|
116497
117431
|
if (colorKey !== "a:srgbClr") {
|
|
116498
117432
|
delete list2[colorKey];
|
|
116499
117433
|
}
|
|
@@ -116508,7 +117442,7 @@ function applyColorListValues(list2, values, getLocalName2, resolveColor2) {
|
|
|
116508
117442
|
const existing = Array.isArray(existingRaw) ? existingRaw : existingRaw ? [existingRaw] : [];
|
|
116509
117443
|
if (resolveColor2 && colorKey && existing.length === values.length) {
|
|
116510
117444
|
const unchanged2 = existing.every((entryRaw, index) => {
|
|
116511
|
-
const entry =
|
|
117445
|
+
const entry = asObject2(entryRaw);
|
|
116512
117446
|
const authoredHex = entry ? resolveColor2({ [colorKey]: entry }) : void 0;
|
|
116513
117447
|
return authoredHex !== void 0 && colorsEqual(authoredHex, values[index]);
|
|
116514
117448
|
});
|
|
@@ -116531,16 +117465,16 @@ function applyRoleColors(labels, roleColors, getLocalName2, resolveColor2) {
|
|
|
116531
117465
|
if (!role) {
|
|
116532
117466
|
continue;
|
|
116533
117467
|
}
|
|
116534
|
-
const fillKey =
|
|
117468
|
+
const fillKey = findKey34(label, "fillClrLst", getLocalName2);
|
|
116535
117469
|
if (fillKey) {
|
|
116536
|
-
const list2 =
|
|
117470
|
+
const list2 = asObject2(label[fillKey]);
|
|
116537
117471
|
if (list2 && applyColorListValues(list2, role.fill, getLocalName2, resolveColor2)) {
|
|
116538
117472
|
mutated = true;
|
|
116539
117473
|
}
|
|
116540
117474
|
}
|
|
116541
|
-
const lineKey =
|
|
117475
|
+
const lineKey = findKey34(label, "linClrLst", getLocalName2);
|
|
116542
117476
|
if (lineKey) {
|
|
116543
|
-
const list2 =
|
|
117477
|
+
const list2 = asObject2(label[lineKey]);
|
|
116544
117478
|
if (list2 && applyColorListValues(list2, role.line, getLocalName2, resolveColor2)) {
|
|
116545
117479
|
mutated = true;
|
|
116546
117480
|
}
|
|
@@ -116555,7 +117489,7 @@ function applySmartArtColorTransform(colorsDef, transform2, getLocalName2, resol
|
|
|
116555
117489
|
let mutated = false;
|
|
116556
117490
|
mutated = applySmartArtDefinitionMetadata(colorsDef, transform2, getLocalName2) || mutated;
|
|
116557
117491
|
mutated = applySmartArtColorStyleLabels(colorsDef, transform2.labels, getLocalName2) || mutated;
|
|
116558
|
-
const styleLblKey =
|
|
117492
|
+
const styleLblKey = findKey34(colorsDef, "styleLbl", getLocalName2);
|
|
116559
117493
|
if (!styleLblKey) {
|
|
116560
117494
|
return mutated;
|
|
116561
117495
|
}
|
|
@@ -116569,19 +117503,19 @@ function applySmartArtColorTransform(colorsDef, transform2, getLocalName2, resol
|
|
|
116569
117503
|
let fillIndex = 0;
|
|
116570
117504
|
let lineIndex = 0;
|
|
116571
117505
|
for (const label of labels) {
|
|
116572
|
-
const fillKey =
|
|
117506
|
+
const fillKey = findKey34(label, "fillClrLst", getLocalName2);
|
|
116573
117507
|
if (fillKey) {
|
|
116574
117508
|
const value = transform2.fillColors[fillIndex++];
|
|
116575
|
-
const list2 =
|
|
117509
|
+
const list2 = asObject2(label[fillKey]);
|
|
116576
117510
|
if (list2 && value) {
|
|
116577
117511
|
applyColorToList(list2, value, getLocalName2, resolveColor2);
|
|
116578
117512
|
mutated = true;
|
|
116579
117513
|
}
|
|
116580
117514
|
}
|
|
116581
|
-
const lineKey =
|
|
117515
|
+
const lineKey = findKey34(label, "linClrLst", getLocalName2);
|
|
116582
117516
|
if (lineKey) {
|
|
116583
117517
|
const value = transform2.lineColors[lineIndex++];
|
|
116584
|
-
const list2 =
|
|
117518
|
+
const list2 = asObject2(label[lineKey]);
|
|
116585
117519
|
if (list2 && value) {
|
|
116586
117520
|
applyColorToList(list2, value, getLocalName2, resolveColor2);
|
|
116587
117521
|
mutated = true;
|
|
@@ -116838,40 +117772,40 @@ var init_smartart_quick_style_builder = __esm({
|
|
|
116838
117772
|
});
|
|
116839
117773
|
|
|
116840
117774
|
// src/pptx/core/core/runtime/smartart-save-chrome.ts
|
|
116841
|
-
function
|
|
117775
|
+
function asObject3(value) {
|
|
116842
117776
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
116843
117777
|
}
|
|
116844
117778
|
function applySmartArtChrome(dataModel, chrome, getLocalName2) {
|
|
116845
117779
|
if (!chrome || !chrome.backgroundColor && !chrome.backgroundFillXml && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
|
|
116846
117780
|
return;
|
|
116847
117781
|
}
|
|
116848
|
-
const
|
|
117782
|
+
const findKey35 = (obj, name) => Object.keys(obj).find((k) => getLocalName2(k) === name);
|
|
116849
117783
|
if (chrome.backgroundFillXml) {
|
|
116850
|
-
const bgKey =
|
|
116851
|
-
const bg =
|
|
116852
|
-
const fillKey =
|
|
117784
|
+
const bgKey = findKey35(dataModel, "bg") ?? "dgm:bg";
|
|
117785
|
+
const bg = asObject3(dataModel[bgKey]);
|
|
117786
|
+
const fillKey = findKey35(bg, chrome.backgroundFillXml.localName) ?? `a:${chrome.backgroundFillXml.localName}`;
|
|
116853
117787
|
bg[fillKey] = chrome.backgroundFillXml.xml;
|
|
116854
117788
|
dataModel[bgKey] = bg;
|
|
116855
117789
|
} else if (chrome.backgroundColor) {
|
|
116856
117790
|
const hex3 = chrome.backgroundColor.replace("#", "");
|
|
116857
|
-
const bgKey =
|
|
116858
|
-
const bg =
|
|
116859
|
-
const fillKey =
|
|
117791
|
+
const bgKey = findKey35(dataModel, "bg") ?? "dgm:bg";
|
|
117792
|
+
const bg = asObject3(dataModel[bgKey]);
|
|
117793
|
+
const fillKey = findKey35(bg, "solidFill") ?? "a:solidFill";
|
|
116860
117794
|
bg[fillKey] = { "a:srgbClr": { "@_val": hex3 } };
|
|
116861
117795
|
dataModel[bgKey] = bg;
|
|
116862
117796
|
}
|
|
116863
117797
|
const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
|
|
116864
117798
|
if (chrome.outlineColor || hasOutlineWidth) {
|
|
116865
|
-
const wholeKey =
|
|
116866
|
-
const whole =
|
|
116867
|
-
const lnKey =
|
|
116868
|
-
const ln =
|
|
117799
|
+
const wholeKey = findKey35(dataModel, "whole") ?? "dgm:whole";
|
|
117800
|
+
const whole = asObject3(dataModel[wholeKey]);
|
|
117801
|
+
const lnKey = findKey35(whole, "ln") ?? "a:ln";
|
|
117802
|
+
const ln = asObject3(whole[lnKey]);
|
|
116869
117803
|
if (hasOutlineWidth) {
|
|
116870
117804
|
ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
|
|
116871
117805
|
}
|
|
116872
117806
|
if (chrome.outlineColor) {
|
|
116873
117807
|
const hex3 = chrome.outlineColor.replace("#", "");
|
|
116874
|
-
const fillKey =
|
|
117808
|
+
const fillKey = findKey35(ln, "solidFill") ?? "a:solidFill";
|
|
116875
117809
|
ln[fillKey] = { "a:srgbClr": { "@_val": hex3 } };
|
|
116876
117810
|
}
|
|
116877
117811
|
whole[lnKey] = ln;
|
|
@@ -135214,6 +136148,7 @@ var init_PptxHandlerRuntimeChartColorStyle = __esm({
|
|
|
135214
136148
|
var SCATTER_STYLES, PptxHandlerRuntime94;
|
|
135215
136149
|
var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
135216
136150
|
"src/pptx/core/core/runtime/PptxHandlerRuntimeChartParsing.ts"() {
|
|
136151
|
+
init_units2();
|
|
135217
136152
|
init_chart_advanced_parser();
|
|
135218
136153
|
init_chart_axis_parser();
|
|
135219
136154
|
init_chart_band_fmts();
|
|
@@ -135796,6 +136731,10 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
135796
136731
|
const lineNoFill = seriesLine ? Object.keys(seriesLine).some(
|
|
135797
136732
|
(key2) => this.compatibilityService.getXmlLocalName(key2) === "noFill"
|
|
135798
136733
|
) : false;
|
|
136734
|
+
const lineWidthEmu = Number(seriesLine?.["@_w"]);
|
|
136735
|
+
const lineWidth = Number.isFinite(lineWidthEmu) && lineWidthEmu > 0 ? lineWidthEmu / EMU_PER_POINT : void 0;
|
|
136736
|
+
const lineDashRaw = this.xmlLookupService.getChildByLocalName(seriesLine, "prstDash")?.["@_val"];
|
|
136737
|
+
const lineDashStyle = typeof lineDashRaw === "string" && lineDashRaw.length > 0 ? lineDashRaw : void 0;
|
|
135799
136738
|
const smoothNode = this.xmlLookupService.getChildByLocalName(seriesNode, "smooth");
|
|
135800
136739
|
const smooth = smoothNode ? !(smoothNode["@_val"] === "0" || smoothNode["@_val"] === "false") : void 0;
|
|
135801
136740
|
const invertNode = this.xmlLookupService.getChildByLocalName(seriesNode, "invertIfNegative");
|
|
@@ -135814,6 +136753,8 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
135814
136753
|
...bubbleSizes.length > 0 ? { bubbleSizes } : {},
|
|
135815
136754
|
...dataLabelOptions && Object.keys(dataLabelOptions).length > 0 ? { dataLabelOptions } : {},
|
|
135816
136755
|
...lineNoFill ? { lineNoFill } : {},
|
|
136756
|
+
...lineWidth !== void 0 ? { lineWidth } : {},
|
|
136757
|
+
...lineDashStyle ? { lineDashStyle } : {},
|
|
135817
136758
|
...seriesNumberFormat ? { numberFormat: seriesNumberFormat } : {},
|
|
135818
136759
|
color: seriesColor2,
|
|
135819
136760
|
...this.colorStyleCodec ? seriesGradientFill(seriesShapeProperties, this.xmlLookupService, this.colorStyleCodec) : {},
|
|
@@ -142244,293 +143185,11 @@ function applyTemplate(data, templateData) {
|
|
|
142244
143185
|
}
|
|
142245
143186
|
}
|
|
142246
143187
|
|
|
142247
|
-
// src/pptx/core/builders/sdk/
|
|
142248
|
-
|
|
142249
|
-
if (!element.chartData) {
|
|
142250
|
-
throw new Error(
|
|
142251
|
-
"Chart element has no chartData. Cannot perform chart operations on an uninitialised chart."
|
|
142252
|
-
);
|
|
142253
|
-
}
|
|
142254
|
-
}
|
|
142255
|
-
function validateSeriesIndex(element, seriesIndex) {
|
|
142256
|
-
ensureChartData(element);
|
|
142257
|
-
if (seriesIndex < 0 || seriesIndex >= element.chartData.series.length) {
|
|
142258
|
-
throw new RangeError(
|
|
142259
|
-
`Series index ${seriesIndex} is out of range. Chart has ${element.chartData.series.length} series (indices 0\u2013${element.chartData.series.length - 1}).`
|
|
142260
|
-
);
|
|
142261
|
-
}
|
|
142262
|
-
}
|
|
142263
|
-
function setChartType(element, newType) {
|
|
142264
|
-
ensureChartData(element);
|
|
142265
|
-
element.chartData.chartType = newType;
|
|
142266
|
-
}
|
|
142267
|
-
function addChartSeries(element, series) {
|
|
142268
|
-
ensureChartData(element);
|
|
142269
|
-
element.chartData.series.push({
|
|
142270
|
-
name: series.name,
|
|
142271
|
-
values: series.values,
|
|
142272
|
-
color: series.color
|
|
142273
|
-
});
|
|
142274
|
-
}
|
|
142275
|
-
function removeChartSeries(element, seriesIndex) {
|
|
142276
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142277
|
-
element.chartData.series.splice(seriesIndex, 1);
|
|
142278
|
-
}
|
|
142279
|
-
function setChartCategories(element, categories) {
|
|
142280
|
-
ensureChartData(element);
|
|
142281
|
-
element.chartData.categories = categories;
|
|
142282
|
-
}
|
|
142283
|
-
function updateChartSeriesValues(element, seriesIndex, values) {
|
|
142284
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142285
|
-
element.chartData.series[seriesIndex].values = values;
|
|
142286
|
-
}
|
|
142287
|
-
function setChartTitle(element, title) {
|
|
142288
|
-
ensureChartData(element);
|
|
142289
|
-
element.chartData.title = title;
|
|
142290
|
-
}
|
|
142291
|
-
function setChartGrouping(element, grouping) {
|
|
142292
|
-
ensureChartData(element);
|
|
142293
|
-
element.chartData.grouping = grouping;
|
|
142294
|
-
}
|
|
142295
|
-
function setChartLegend(element, options) {
|
|
142296
|
-
ensureChartData(element);
|
|
142297
|
-
const style = element.chartData.style ??= {};
|
|
142298
|
-
if (options.show !== void 0) {
|
|
142299
|
-
style.hasLegend = options.show;
|
|
142300
|
-
}
|
|
142301
|
-
if (options.position !== void 0) {
|
|
142302
|
-
style.legendPosition = options.position;
|
|
142303
|
-
if (style.hasLegend === void 0) {
|
|
142304
|
-
style.hasLegend = true;
|
|
142305
|
-
}
|
|
142306
|
-
}
|
|
142307
|
-
}
|
|
142308
|
-
function setChartDataLabels(element, edit) {
|
|
142309
|
-
ensureChartData(element);
|
|
142310
|
-
const style = element.chartData.style ??= {};
|
|
142311
|
-
if (edit.show !== void 0) {
|
|
142312
|
-
style.hasDataLabels = edit.show;
|
|
142313
|
-
const labels = style.dataLabels;
|
|
142314
|
-
const anyContent = labels?.showValue === true || labels?.showCategory === true || labels?.showSeriesName === true || labels?.showPercent === true || labels?.showBubbleSize === true;
|
|
142315
|
-
if (edit.show && labels !== void 0 && !anyContent && edit.showValue === void 0) {
|
|
142316
|
-
labels.showValue = true;
|
|
142317
|
-
}
|
|
142318
|
-
}
|
|
142319
|
-
const contentKeys = [
|
|
142320
|
-
"showValue",
|
|
142321
|
-
"showCategory",
|
|
142322
|
-
"showSeriesName",
|
|
142323
|
-
"showPercent",
|
|
142324
|
-
"showLegendKey"
|
|
142325
|
-
];
|
|
142326
|
-
const hasContentEdit = contentKeys.some((k) => edit[k] !== void 0) || edit.position !== void 0;
|
|
142327
|
-
if (hasContentEdit) {
|
|
142328
|
-
const opts = style.dataLabels ??= {};
|
|
142329
|
-
for (const k of contentKeys) {
|
|
142330
|
-
if (edit[k] !== void 0) {
|
|
142331
|
-
opts[k] = edit[k];
|
|
142332
|
-
}
|
|
142333
|
-
}
|
|
142334
|
-
if (edit.position !== void 0) {
|
|
142335
|
-
opts.position = edit.position || void 0;
|
|
142336
|
-
}
|
|
142337
|
-
if (style.hasDataLabels === void 0) {
|
|
142338
|
-
style.hasDataLabels = true;
|
|
142339
|
-
}
|
|
142340
|
-
}
|
|
142341
|
-
}
|
|
142342
|
-
function setChartSeriesTrendline(element, seriesIndex, trendline) {
|
|
142343
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142344
|
-
element.chartData.series[seriesIndex].trendlines = trendline ? [trendline] : [];
|
|
142345
|
-
}
|
|
142346
|
-
function setChartSeriesErrorBars(element, seriesIndex, errBars) {
|
|
142347
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142348
|
-
element.chartData.series[seriesIndex].errBars = errBars ? [errBars] : [];
|
|
142349
|
-
}
|
|
142350
|
-
function setChartAxis(element, axisType, edit) {
|
|
142351
|
-
ensureChartData(element);
|
|
142352
|
-
const axes = element.chartData.axes ??= [];
|
|
142353
|
-
let axis = axes.find((a) => a.axisType === axisType);
|
|
142354
|
-
if (!axis) {
|
|
142355
|
-
axis = { axisType };
|
|
142356
|
-
axes.push(axis);
|
|
142357
|
-
}
|
|
142358
|
-
if (edit.min !== void 0) {
|
|
142359
|
-
axis.min = edit.min ?? void 0;
|
|
142360
|
-
}
|
|
142361
|
-
if (edit.max !== void 0) {
|
|
142362
|
-
axis.max = edit.max ?? void 0;
|
|
142363
|
-
}
|
|
142364
|
-
if (edit.majorUnit !== void 0) {
|
|
142365
|
-
axis.majorUnit = edit.majorUnit ?? void 0;
|
|
142366
|
-
}
|
|
142367
|
-
if (edit.minorUnit !== void 0) {
|
|
142368
|
-
axis.minorUnit = edit.minorUnit ?? void 0;
|
|
142369
|
-
}
|
|
142370
|
-
if (edit.orientation !== void 0) {
|
|
142371
|
-
axis.orientation = edit.orientation ?? void 0;
|
|
142372
|
-
}
|
|
142373
|
-
if (edit.numberFormat !== void 0) {
|
|
142374
|
-
axis.numFmt = edit.numberFormat ? { formatCode: edit.numberFormat, sourceLinked: false } : void 0;
|
|
142375
|
-
}
|
|
142376
|
-
if (edit.tickLabelPosition !== void 0) {
|
|
142377
|
-
axis.tickLblPos = edit.tickLabelPosition;
|
|
142378
|
-
}
|
|
142379
|
-
if (edit.title !== void 0) {
|
|
142380
|
-
axis.titleText = edit.title ?? "";
|
|
142381
|
-
}
|
|
142382
|
-
if (edit.majorGridlines !== void 0) {
|
|
142383
|
-
axis.majorGridlines = edit.majorGridlines;
|
|
142384
|
-
}
|
|
142385
|
-
if (edit.minorGridlines !== void 0) {
|
|
142386
|
-
axis.minorGridlines = edit.minorGridlines;
|
|
142387
|
-
}
|
|
142388
|
-
if (edit.displayUnits !== void 0) {
|
|
142389
|
-
axis.displayUnits = edit.displayUnits ?? void 0;
|
|
142390
|
-
}
|
|
142391
|
-
if (edit.displayUnitsValue !== void 0) {
|
|
142392
|
-
axis.displayUnitsValue = edit.displayUnitsValue ?? void 0;
|
|
142393
|
-
}
|
|
142394
|
-
if (edit.displayUnitsLabel !== void 0) {
|
|
142395
|
-
axis.displayUnitsLabel = edit.displayUnitsLabel;
|
|
142396
|
-
}
|
|
142397
|
-
}
|
|
142398
|
-
function setChartSeriesMarker(element, seriesIndex, marker) {
|
|
142399
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142400
|
-
const series = element.chartData.series[seriesIndex];
|
|
142401
|
-
if (marker === null) {
|
|
142402
|
-
series.marker = void 0;
|
|
142403
|
-
return;
|
|
142404
|
-
}
|
|
142405
|
-
const existing = series.marker;
|
|
142406
|
-
if ("symbol" in marker && "spPr" in marker) {
|
|
142407
|
-
series.marker = marker;
|
|
142408
|
-
return;
|
|
142409
|
-
}
|
|
142410
|
-
const patch = marker;
|
|
142411
|
-
const next = {
|
|
142412
|
-
symbol: patch.symbol ?? existing?.symbol ?? "circle",
|
|
142413
|
-
size: patch.size ?? existing?.size,
|
|
142414
|
-
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
142415
|
-
};
|
|
142416
|
-
if (patch.fillColor !== void 0) {
|
|
142417
|
-
next.spPr = { ...next.spPr ?? {}, fillColor: patch.fillColor };
|
|
142418
|
-
}
|
|
142419
|
-
series.marker = next;
|
|
142420
|
-
}
|
|
142421
|
-
function ensureDataPoint(series, pointIndex) {
|
|
142422
|
-
const points4 = series.dataPoints ??= [];
|
|
142423
|
-
let dp = points4.find((p) => p.idx === pointIndex);
|
|
142424
|
-
if (!dp) {
|
|
142425
|
-
dp = { idx: pointIndex };
|
|
142426
|
-
points4.push(dp);
|
|
142427
|
-
points4.sort((a, b) => a.idx - b.idx);
|
|
142428
|
-
}
|
|
142429
|
-
return dp;
|
|
142430
|
-
}
|
|
142431
|
-
function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion) {
|
|
142432
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142433
|
-
const series = element.chartData.series[seriesIndex];
|
|
142434
|
-
if (explosion === null) {
|
|
142435
|
-
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
142436
|
-
if (dp2) {
|
|
142437
|
-
dp2.explosion = void 0;
|
|
142438
|
-
removeEmptyDataPoint(series, pointIndex);
|
|
142439
|
-
}
|
|
142440
|
-
return;
|
|
142441
|
-
}
|
|
142442
|
-
const dp = ensureDataPoint(series, pointIndex);
|
|
142443
|
-
dp.explosion = explosion;
|
|
142444
|
-
}
|
|
142445
|
-
function setChartDataPointMarker(element, seriesIndex, pointIndex, marker) {
|
|
142446
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142447
|
-
const series = element.chartData.series[seriesIndex];
|
|
142448
|
-
if (marker === null) {
|
|
142449
|
-
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
142450
|
-
if (dp2) {
|
|
142451
|
-
dp2.marker = void 0;
|
|
142452
|
-
removeEmptyDataPoint(series, pointIndex);
|
|
142453
|
-
}
|
|
142454
|
-
return;
|
|
142455
|
-
}
|
|
142456
|
-
const dp = ensureDataPoint(series, pointIndex);
|
|
142457
|
-
const existing = dp.marker;
|
|
142458
|
-
const next = {
|
|
142459
|
-
symbol: marker.symbol ?? existing?.symbol ?? "circle",
|
|
142460
|
-
size: marker.size ?? existing?.size,
|
|
142461
|
-
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
142462
|
-
};
|
|
142463
|
-
if (marker.fillColor !== void 0) {
|
|
142464
|
-
next.spPr = { ...next.spPr ?? {}, fillColor: marker.fillColor };
|
|
142465
|
-
}
|
|
142466
|
-
dp.marker = next;
|
|
142467
|
-
}
|
|
142468
|
-
function applyLabelEdit(label, edit) {
|
|
142469
|
-
if (edit.showValue !== void 0) {
|
|
142470
|
-
label.showVal = edit.showValue;
|
|
142471
|
-
}
|
|
142472
|
-
if (edit.showCategory !== void 0) {
|
|
142473
|
-
label.showCatName = edit.showCategory;
|
|
142474
|
-
}
|
|
142475
|
-
if (edit.showSeriesName !== void 0) {
|
|
142476
|
-
label.showSerName = edit.showSeriesName;
|
|
142477
|
-
}
|
|
142478
|
-
if (edit.showPercent !== void 0) {
|
|
142479
|
-
label.showPercent = edit.showPercent;
|
|
142480
|
-
}
|
|
142481
|
-
if (edit.showLegendKey !== void 0) {
|
|
142482
|
-
label.showLegendKey = edit.showLegendKey;
|
|
142483
|
-
}
|
|
142484
|
-
if (edit.position !== void 0) {
|
|
142485
|
-
label.position = edit.position;
|
|
142486
|
-
}
|
|
142487
|
-
if (edit.text !== void 0) {
|
|
142488
|
-
label.text = edit.text === "" ? void 0 : edit.text;
|
|
142489
|
-
}
|
|
142490
|
-
if (edit.spPr !== void 0) {
|
|
142491
|
-
label.spPr = edit.spPr === null ? void 0 : { ...label.spPr ?? {}, ...edit.spPr };
|
|
142492
|
-
}
|
|
142493
|
-
if (edit.txPr !== void 0) {
|
|
142494
|
-
label.txPr = edit.txPr === null ? void 0 : { ...label.txPr ?? {}, ...edit.txPr };
|
|
142495
|
-
}
|
|
142496
|
-
}
|
|
142497
|
-
function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
|
|
142498
|
-
validateSeriesIndex(element, seriesIndex);
|
|
142499
|
-
const series = element.chartData.series[seriesIndex];
|
|
142500
|
-
if (edit === null) {
|
|
142501
|
-
if (!series.dataLabels) {
|
|
142502
|
-
return;
|
|
142503
|
-
}
|
|
142504
|
-
series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
|
|
142505
|
-
if (series.dataLabels.length === 0) {
|
|
142506
|
-
series.dataLabels = void 0;
|
|
142507
|
-
}
|
|
142508
|
-
return;
|
|
142509
|
-
}
|
|
142510
|
-
const labels = series.dataLabels ??= [];
|
|
142511
|
-
let label = labels.find((l) => l.idx === pointIndex);
|
|
142512
|
-
if (!label) {
|
|
142513
|
-
label = { idx: pointIndex };
|
|
142514
|
-
labels.push(label);
|
|
142515
|
-
labels.sort((a, b) => a.idx - b.idx);
|
|
142516
|
-
}
|
|
142517
|
-
applyLabelEdit(label, edit);
|
|
142518
|
-
}
|
|
142519
|
-
function removeEmptyDataPoint(series, pointIndex) {
|
|
142520
|
-
if (!series.dataPoints) {
|
|
142521
|
-
return;
|
|
142522
|
-
}
|
|
142523
|
-
const dp = series.dataPoints.find((p) => p.idx === pointIndex);
|
|
142524
|
-
if (!dp) {
|
|
142525
|
-
return;
|
|
142526
|
-
}
|
|
142527
|
-
const empty = dp.spPr === void 0 && dp.gradientFill === void 0 && dp.explosion === void 0 && dp.invertIfNegative === void 0 && dp.bubble3D === void 0 && dp.marker === void 0;
|
|
142528
|
-
if (empty) {
|
|
142529
|
-
series.dataPoints = series.dataPoints.filter((p) => p.idx !== pointIndex);
|
|
142530
|
-
}
|
|
142531
|
-
}
|
|
143188
|
+
// src/pptx/core/builders/sdk/index.ts
|
|
143189
|
+
init_chart_operations();
|
|
142532
143190
|
|
|
142533
143191
|
// src/pptx/core/builders/sdk/chart-formatting-operations.ts
|
|
143192
|
+
init_chart_operations();
|
|
142534
143193
|
function setChartDataPointStyle(element, seriesIndex, pointIndex, style) {
|
|
142535
143194
|
validateSeriesIndex(element, seriesIndex);
|
|
142536
143195
|
const series = element.chartData.series[seriesIndex];
|
|
@@ -142813,6 +143472,53 @@ var ChartBuilder = class _ChartBuilder {
|
|
|
142813
143472
|
this._input.grouping = mode;
|
|
142814
143473
|
return this;
|
|
142815
143474
|
}
|
|
143475
|
+
// -- Spacing, geometry and areas (validated by build()) -----------------
|
|
143476
|
+
/** Gap between bar clusters, % of bar width (`c:gapWidth`, 0..500). Bar, bar3D, ofPie. */
|
|
143477
|
+
gapWidth(percent) {
|
|
143478
|
+
this._input.gapWidth = percent;
|
|
143479
|
+
return this;
|
|
143480
|
+
}
|
|
143481
|
+
/** Overlap of bars within a cluster, % (`c:overlap`, -100..100). 2-D bar only. */
|
|
143482
|
+
overlap(percent) {
|
|
143483
|
+
this._input.overlap = percent;
|
|
143484
|
+
return this;
|
|
143485
|
+
}
|
|
143486
|
+
/** Angle of the first slice, degrees clockwise from 12 o'clock (`c:firstSliceAng`, 0..360). */
|
|
143487
|
+
firstSliceAngle(degrees) {
|
|
143488
|
+
this._input.firstSliceAngle = degrees;
|
|
143489
|
+
return this;
|
|
143490
|
+
}
|
|
143491
|
+
/** Doughnut hole size, % of the diameter (`c:holeSize`, 1..90). */
|
|
143492
|
+
holeSize(percent) {
|
|
143493
|
+
this._input.holeSize = percent;
|
|
143494
|
+
return this;
|
|
143495
|
+
}
|
|
143496
|
+
/**
|
|
143497
|
+
* Chart-area fill, border and rounded corners.
|
|
143498
|
+
*
|
|
143499
|
+
* @example
|
|
143500
|
+
* ```ts
|
|
143501
|
+
* builder.chartArea({ fill: "none", border: "none", roundedCorners: false });
|
|
143502
|
+
* ```
|
|
143503
|
+
*/
|
|
143504
|
+
chartArea(format) {
|
|
143505
|
+
this._input.chartArea = format;
|
|
143506
|
+
return this;
|
|
143507
|
+
}
|
|
143508
|
+
/** Plot-area fill and border. */
|
|
143509
|
+
plotArea(format) {
|
|
143510
|
+
this._input.plotArea = format;
|
|
143511
|
+
return this;
|
|
143512
|
+
}
|
|
143513
|
+
/**
|
|
143514
|
+
* Edit an axis, e.g. `.axis("catAx", { visible: false })` to hide it.
|
|
143515
|
+
* Merges with earlier edits of the same axis.
|
|
143516
|
+
*/
|
|
143517
|
+
axis(axisType, edit) {
|
|
143518
|
+
const axes = this._input.axes ??= {};
|
|
143519
|
+
axes[axisType] = { ...axes[axisType], ...edit };
|
|
143520
|
+
return this;
|
|
143521
|
+
}
|
|
142816
143522
|
// -- Build --------------------------------------------------------------
|
|
142817
143523
|
/**
|
|
142818
143524
|
* Build the final {@link ChartPptxElement}.
|
|
@@ -143939,6 +144645,9 @@ function cssColorSafe(value) {
|
|
|
143939
144645
|
}
|
|
143940
144646
|
return void 0;
|
|
143941
144647
|
}
|
|
144648
|
+
function cssBorderPx(width) {
|
|
144649
|
+
return Math.max(1, Math.round(width));
|
|
144650
|
+
}
|
|
143942
144651
|
function cssFontFamilySafe(value) {
|
|
143943
144652
|
if (typeof value !== "string") {
|
|
143944
144653
|
return void 0;
|
|
@@ -144066,19 +144775,19 @@ ${htmlRows.join("\n")}
|
|
|
144066
144775
|
const edges = [];
|
|
144067
144776
|
const topColor = cssColorSafe(style.borderTopColor);
|
|
144068
144777
|
if (style.borderTopWidth && topColor) {
|
|
144069
|
-
edges.push(`border-top:${
|
|
144778
|
+
edges.push(`border-top:${cssBorderPx(style.borderTopWidth)}px solid ${topColor}`);
|
|
144070
144779
|
}
|
|
144071
144780
|
const bottomColor = cssColorSafe(style.borderBottomColor);
|
|
144072
144781
|
if (style.borderBottomWidth && bottomColor) {
|
|
144073
|
-
edges.push(`border-bottom:${
|
|
144782
|
+
edges.push(`border-bottom:${cssBorderPx(style.borderBottomWidth)}px solid ${bottomColor}`);
|
|
144074
144783
|
}
|
|
144075
144784
|
const leftColor = cssColorSafe(style.borderLeftColor);
|
|
144076
144785
|
if (style.borderLeftWidth && leftColor) {
|
|
144077
|
-
edges.push(`border-left:${
|
|
144786
|
+
edges.push(`border-left:${cssBorderPx(style.borderLeftWidth)}px solid ${leftColor}`);
|
|
144078
144787
|
}
|
|
144079
144788
|
const rightColor = cssColorSafe(style.borderRightColor);
|
|
144080
144789
|
if (style.borderRightWidth && rightColor) {
|
|
144081
|
-
edges.push(`border-right:${
|
|
144790
|
+
edges.push(`border-right:${cssBorderPx(style.borderRightWidth)}px solid ${rightColor}`);
|
|
144082
144791
|
}
|
|
144083
144792
|
const fallback = cssColorSafe(style.borderColor);
|
|
144084
144793
|
if (edges.length === 0 && fallback) {
|
|
@@ -144098,7 +144807,7 @@ ${htmlRows.join("\n")}
|
|
|
144098
144807
|
if (t === 0 && r === 0 && b === 0 && l === 0) {
|
|
144099
144808
|
return "";
|
|
144100
144809
|
}
|
|
144101
|
-
return `padding:${t}px ${r}px ${b}px ${l}px`;
|
|
144810
|
+
return `padding:${Math.round(t)}px ${Math.round(r)}px ${Math.round(b)}px ${Math.round(l)}px`;
|
|
144102
144811
|
}
|
|
144103
144812
|
/**
|
|
144104
144813
|
* Renders cell content as HTML spans preserving per-run styling
|