ooxml-core 1.25.2 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +16 -0
  2. package/dist/{PptxHandler-AUK27AQD.mjs → PptxHandler-5QBRBXRX.mjs} +3 -3
  3. package/dist/{PptxHandler-QBGEZDCO.cjs → PptxHandler-CVYP5PAN.cjs} +3 -3
  4. package/dist/PptxHandler-TOAD6P7N.mjs +4 -0
  5. package/dist/{PresentationBuilder-RX7D75GZ.mjs → PresentationBuilder-EBVNYMLE.mjs} +2 -2
  6. package/dist/{PresentationBuilder-MEETJGEA.mjs → PresentationBuilder-M5UXW4AF.mjs} +3 -3
  7. package/dist/{PresentationBuilder-CI45KEHL.cjs → PresentationBuilder-RVQZCTIO.cjs} +5 -5
  8. package/dist/automation/index.cjs +273 -156
  9. package/dist/automation/index.mjs +273 -156
  10. package/dist/automation/xlsx-read.d.ts +2 -8
  11. package/dist/automation/xlsx-read.d.ts.map +1 -1
  12. package/dist/automation/xlsx.d.ts +2 -2
  13. package/dist/chart/index.cjs +89 -47
  14. package/dist/chart/index.mjs +89 -47
  15. package/dist/{chunk-6DHZZD5R.mjs → chunk-2XMK5SXU.mjs} +106 -48
  16. package/dist/{chunk-TX2QFS3J.mjs → chunk-4IIR2QEH.mjs} +608 -371
  17. package/dist/{chunk-635WPRNJ.mjs → chunk-DNYZX6YG.mjs} +19 -3
  18. package/dist/{chunk-VGDHSED6.mjs → chunk-EBJ724RB.mjs} +1 -1
  19. package/dist/{chunk-GMETZZ3V.cjs → chunk-EEHK52XB.cjs} +1677 -1440
  20. package/dist/{chunk-E2PYQQQV.mjs → chunk-JJ37PCNR.mjs} +89 -47
  21. package/dist/{chunk-5F7OB7PA.mjs → chunk-K6OFJ5GJ.mjs} +605 -368
  22. package/dist/{chunk-HVRFRYYS.mjs → chunk-KONCS53X.mjs} +5 -5
  23. package/dist/{chunk-S5TGOEQX.cjs → chunk-MU3XSASV.cjs} +106 -47
  24. package/dist/{chunk-E3PRAHL6.mjs → chunk-ZXPPM63Y.mjs} +1 -1
  25. package/dist/docx/embedded.cjs +89 -47
  26. package/dist/docx/embedded.mjs +89 -47
  27. package/dist/docx/index.cjs +89 -47
  28. package/dist/docx/index.mjs +89 -47
  29. package/dist/docx/load/index.cjs +89 -47
  30. package/dist/docx/load/index.mjs +89 -47
  31. package/dist/index.cjs +128 -53
  32. package/dist/index.mjs +128 -53
  33. package/dist/opc/index.cjs +90 -47
  34. package/dist/opc/index.mjs +90 -48
  35. package/dist/opc/zip-limits.d.ts +6 -0
  36. package/dist/opc/zip-limits.d.ts.map +1 -1
  37. package/dist/pptx/automation/index.cjs +766 -444
  38. package/dist/pptx/automation/index.d.ts +4 -4
  39. package/dist/pptx/automation/index.mjs +6 -6
  40. package/dist/pptx/chunks/{index-CgjEEpfK.d.ts → index-B94RKk84.d.ts} +276 -115
  41. package/dist/pptx/chunks/index-B94RKk84.d.ts.map +1 -0
  42. package/dist/pptx/chunks/{index-CX0RM1fF.d.ts → index-BOpULlxB.d.ts} +3 -3
  43. package/dist/pptx/chunks/{index-CX0RM1fF.d.ts.map → index-BOpULlxB.d.ts.map} +1 -1
  44. package/dist/pptx/chunks/{index-DCbp5fOs.d.ts → index-D3gKRIAi.d.ts} +12 -5
  45. package/dist/pptx/chunks/{index-DCbp5fOs.d.ts.map → index-D3gKRIAi.d.ts.map} +1 -1
  46. package/dist/pptx/chunks/{text-operations-CjalmJIi.d.ts → text-operations-CNfUj45U.d.ts} +16 -2
  47. package/dist/pptx/chunks/{text-operations-CjalmJIi.d.ts.map → text-operations-CNfUj45U.d.ts.map} +1 -1
  48. package/dist/pptx/cli/index.cjs +766 -444
  49. package/dist/pptx/cli/index.d.ts +1 -1
  50. package/dist/pptx/cli/index.mjs +5 -5
  51. package/dist/pptx/converter/index.d.ts +1 -1
  52. package/dist/pptx/converter/index.mjs +3 -3
  53. package/dist/pptx/editor/render/editor-history.cjs +21 -0
  54. package/dist/pptx/editor/render/editor-history.d.ts +9 -0
  55. package/dist/pptx/editor/render/editor-history.d.ts.map +1 -1
  56. package/dist/pptx/editor/render/editor-history.mjs +21 -0
  57. package/dist/pptx/editor/render/find-replace.cjs +14 -14
  58. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  59. package/dist/pptx/editor/render/find-replace.mjs +1 -1
  60. package/dist/pptx/editor/render/slide-operations.cjs +8 -8
  61. package/dist/pptx/editor/render/slide-operations.mjs +2 -2
  62. package/dist/pptx/index.cjs +765 -442
  63. package/dist/pptx/index.d.ts +5 -5
  64. package/dist/pptx/index.mjs +6 -6
  65. package/dist/pptx/node/index.d.ts +1 -1
  66. package/dist/pptx/signature-node/index.cjs +89 -47
  67. package/dist/pptx/signature-node/index.mjs +2 -2
  68. package/dist/visio/index.cjs +266 -150
  69. package/dist/visio/index.mjs +266 -150
  70. package/dist/visio/ui/index.cjs +266 -150
  71. package/dist/visio/ui/index.mjs +266 -150
  72. package/dist/xlsx/index.cjs +518 -153
  73. package/dist/xlsx/index.mjs +518 -154
  74. package/dist/xlsx/load/index.cjs +266 -150
  75. package/dist/xlsx/load/index.mjs +266 -150
  76. package/dist/xlsx/numfmt/view.d.ts +13 -0
  77. package/dist/xlsx/numfmt/view.d.ts.map +1 -0
  78. package/dist/xlsx/read/index.d.ts +1 -0
  79. package/dist/xlsx/read/index.d.ts.map +1 -1
  80. package/dist/xlsx/read/limits.d.ts +5 -0
  81. package/dist/xlsx/read/limits.d.ts.map +1 -1
  82. package/dist/xlsx/read/package.d.ts +6 -0
  83. package/dist/xlsx/read/package.d.ts.map +1 -1
  84. package/dist/xlsx/read/rows-stream.d.ts +12 -0
  85. package/dist/xlsx/read/rows-stream.d.ts.map +1 -0
  86. package/dist/xlsx/read/rows.d.ts +37 -0
  87. package/dist/xlsx/read/rows.d.ts.map +1 -0
  88. package/dist/xlsx/read/shared-strings.d.ts +6 -1
  89. package/dist/xlsx/read/shared-strings.d.ts.map +1 -1
  90. package/dist/xlsx/read/sheet-data-source.d.ts +30 -3
  91. package/dist/xlsx/read/sheet-data-source.d.ts.map +1 -1
  92. package/dist/xlsx/read/sheet-data.d.ts +13 -2
  93. package/dist/xlsx/read/sheet-data.d.ts.map +1 -1
  94. package/dist/xlsx/read/worksheet.d.ts.map +1 -1
  95. package/dist/xlsx/ui/index.cjs +266 -150
  96. package/dist/xlsx/ui/index.mjs +266 -150
  97. package/dist/xml/index.cjs +38 -6
  98. package/dist/xml/index.mjs +37 -7
  99. package/dist/xml/lite.d.ts +15 -0
  100. package/dist/xml/lite.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/dist/PptxHandler-5UO5DD5K.mjs +0 -4
  103. package/dist/pptx/chunks/index-CgjEEpfK.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, cloneXmlObject, parseParagraphSpacingPx, parseOoxmlPercent, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, orderedPathCommandEntries, ooxmlArcToSvg, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, openPptxZip, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, ensureXmlChild, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, customGeometryPathsToXml, ensureArrayValue, lookupPresetShape, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, restorePathListCommandOrder, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, mergeSmartArtPointXml, mergeSmartArtConnectionXml, applySmartArtLayoutDefinition, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, DEFAULT_ROW_HEIGHT_EMU, createDefaultXmlCell, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, tableCellTextBodyMatches, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, attr, openZip, readChartManualLayoutValues, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, detectStrictConformance, normalizeStrictXml, relayoutSmartArt, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, themeColorRefToSolidFillWithOpacity, FONT_ADVANCE_TABLES, DEFAULT_FONT_ADVANCE_TABLE, measureTextWidth, applyDrawingColorTransforms, applyThemeToData, detectFileFormat, parseOle2, EncryptedFileError, decryptPptx, encryptPptx, encodeXmlAttributeValue, encodeXmlTextValue, svgToCustomGeometryPaths, IncorrectPasswordError, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, supportsChartGradientFill, DEFAULT_CHART_GRADIENT_ANGLE, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, stripXmlOrderMarkers, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, deriveSlideTitles, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, cloneSlide, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, effectChild, mergeEffectNode, mergeAttributeEffectNode, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, estimateMediaDurationMs, parseVmlElements, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError, MAX_ZIP_ENTRY_COUNT, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, themeColorRefFromSchemeClr, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtLayoutDefinition, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, blendColorOntoWhite } from './chunk-6DHZZD5R.mjs';
1
+ import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, cloneXmlObject, parseParagraphSpacingPx, parseOoxmlPercent, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, orderedPathCommandEntries, ooxmlArcToSvg, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, openPptxZip, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, ensureXmlChild, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, customGeometryPathsToXml, ensureArrayValue, lookupPresetShape, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, restorePathListCommandOrder, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, mergeSmartArtPointXml, mergeSmartArtConnectionXml, applySmartArtLayoutDefinition, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, DEFAULT_ROW_HEIGHT_EMU, createDefaultXmlCell, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, tableCellTextBodyMatches, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, attr, openZip, readChartManualLayoutValues, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, detectStrictConformance, normalizeStrictXml, relayoutSmartArt, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, themeColorRefToSolidFillWithOpacity, FONT_ADVANCE_TABLES, DEFAULT_FONT_ADVANCE_TABLE, measureTextWidth, applyDrawingColorTransforms, applyThemeToData, detectFileFormat, parseOle2, EncryptedFileError, decryptPptx, encryptPptx, encodeXmlAttributeValue, encodeXmlTextValue, svgToCustomGeometryPaths, IncorrectPasswordError, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, supportsChartGradientFill, DEFAULT_CHART_GRADIENT_ANGLE, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, stripXmlOrderMarkers, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, deriveSlideTitles, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, cloneSlide, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, effectChild, mergeEffectNode, mergeAttributeEffectNode, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, estimateMediaDurationMs, parseVmlElements, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, formatSchemeKey, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError, MAX_ZIP_ENTRY_COUNT, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, themeColorRefFromSchemeClr, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtLayoutDefinition, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, blendColorOntoWhite } from './chunk-2XMK5SXU.mjs';
2
2
  import { hasShapeProperties, hasTextProperties } from './chunk-GXHKNSZX.mjs';
3
3
  import { EMU_PER_PX, EMU_PER_PIXEL, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, OOXML_PERCENT_UNITS, EMU_PER_POINT } from './chunk-CA7KCNL3.mjs';
4
4
  import JSZip from 'jszip';
@@ -35860,6 +35860,36 @@ function applyClrMapOverrideToLayoutRoot(root, override) {
35860
35860
  root["p:clrMapOvr"] = { "a:overrideClrMapping": attrs3 };
35861
35861
  }
35862
35862
 
35863
+ // pptx/core/core/runtime/held-format-schemes.ts
35864
+ var HeldFormatSchemes = class {
35865
+ elements = /* @__PURE__ */ new Map();
35866
+ partsByDeckScheme = /* @__PURE__ */ new Map();
35867
+ /** Keep `element`, which `scheme` was parsed from. */
35868
+ hold(scheme, element) {
35869
+ this.elements.set(formatSchemeKey(scheme), structuredClone(element));
35870
+ }
35871
+ /** The element `scheme` was parsed from, if one was held. */
35872
+ element(scheme) {
35873
+ return this.elements.get(formatSchemeKey(scheme));
35874
+ }
35875
+ /** What each part in `parts` held while the deck's scheme was `deckScheme`. */
35876
+ holdParts(deckScheme, parts) {
35877
+ if (parts.size > 0) {
35878
+ this.partsByDeckScheme.set(partsKey(deckScheme, [...parts.keys()]), new Map(parts));
35879
+ }
35880
+ }
35881
+ /**
35882
+ * The element each of `themePaths` held the last time the deck's scheme was `deckScheme` over
35883
+ * exactly those parts, if known.
35884
+ */
35885
+ parts(deckScheme, themePaths) {
35886
+ return this.partsByDeckScheme.get(partsKey(deckScheme, themePaths));
35887
+ }
35888
+ };
35889
+ function partsKey(deckScheme, themePaths) {
35890
+ return JSON.stringify([formatSchemeKey(deckScheme), [...new Set(themePaths)].sort()]);
35891
+ }
35892
+
35863
35893
  // pptx/core/builders/fluent/PptxXmlBuilder.ts
35864
35894
  var PptxXmlBuilder = class _PptxXmlBuilder {
35865
35895
  /** The presentation data being mutated. */
@@ -60222,6 +60252,11 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
60222
60252
  const upSegments = Array.from({ length: fromParts.length }).fill("..");
60223
60253
  return [...upSegments, ...toParts].join("/");
60224
60254
  }
60255
+ /**
60256
+ * Point a slide master's theme relationship at `themePath`.
60257
+ *
60258
+ * @returns whether the master had a theme relationship to rewrite
60259
+ */
60225
60260
  async setMasterThemeRelationship(masterPath, themePath) {
60226
60261
  const relsPath2 = masterPath.replace(
60227
60262
  /ppt\/slideMasters\/(slideMaster\d+)\.xml/,
@@ -60229,7 +60264,7 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
60229
60264
  );
60230
60265
  const relsFile = this.zip.file(relsPath2);
60231
60266
  if (!relsFile) {
60232
- return;
60267
+ return false;
60233
60268
  }
60234
60269
  const relsXml = await relsFile.async("string");
60235
60270
  const relsData = this.parser.parse(relsXml);
@@ -60237,28 +60272,13 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
60237
60272
  const relationships2 = this.ensureArray(relRoot["Relationship"]);
60238
60273
  const themeRel = relationships2.find((rel) => String(rel["@_Type"] || "").includes("/theme"));
60239
60274
  if (!themeRel) {
60240
- return;
60275
+ return false;
60241
60276
  }
60242
60277
  themeRel["@_Target"] = this.buildRelativeTargetPath(masterPath, themePath);
60243
60278
  relRoot["Relationship"] = relationships2;
60244
60279
  relsData["Relationships"] = relRoot;
60245
60280
  this.zip.file(relsPath2, this.builder.build(relsData));
60246
- }
60247
- async setPresentationTheme(themePath, applyToAllMasters = true) {
60248
- const normalizedThemePath = themePath.trim().replace(/\\/g, "/");
60249
- if (!normalizedThemePath.startsWith("ppt/theme/")) {
60250
- return;
60251
- }
60252
- const masterFiles = this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);
60253
- if (!masterFiles || masterFiles.length === 0) {
60254
- return;
60255
- }
60256
- const targetMasters = applyToAllMasters ? masterFiles : [masterFiles[0]];
60257
- await Promise.all(
60258
- targetMasters.map(async (masterFile) => {
60259
- await this.setMasterThemeRelationship(masterFile.name, normalizedThemePath);
60260
- })
60261
- );
60281
+ return true;
60262
60282
  }
60263
60283
  /** The text of a package part, or `undefined` when the package has no such part. */
60264
60284
  async readPartText(path3) {
@@ -60572,8 +60592,6 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
60572
60592
  this.masterXmlMap.set(path3, data);
60573
60593
  }
60574
60594
  const masterCSldName = (xmlAttr(sldMaster["p:cSld"], "name") ?? "").trim();
60575
- const bg = sldMaster["p:cSld"]?.["p:bg"];
60576
- const backgroundColor = this.parseBackgroundColor(bg);
60577
60595
  const spTree = sldMaster["p:cSld"]?.["p:spTree"];
60578
60596
  const placeholders = this.extractPlaceholderList(spTree);
60579
60597
  let preserve;
@@ -60627,7 +60645,6 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
60627
60645
  results.push({
60628
60646
  path: path3,
60629
60647
  name: masterCSldName.length > 0 ? masterCSldName : void 0,
60630
- backgroundColor,
60631
60648
  themePath,
60632
60649
  layoutPaths: layoutPaths.length > 0 ? layoutPaths : void 0,
60633
60650
  layouts: layouts.length > 0 ? layouts : void 0,
@@ -60765,11 +60782,6 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
60765
60782
  layout.clrMapOverride = overrideMap;
60766
60783
  }
60767
60784
  }
60768
- const bg = xmlPath(sldLayout, "p:cSld", "p:bg");
60769
- const bgColor = this.parseBackgroundColor(bg);
60770
- if (bgColor) {
60771
- layout.backgroundColor = bgColor;
60772
- }
60773
60785
  const spTree = xmlPath(sldLayout, "p:cSld", "p:spTree");
60774
60786
  const placeholders = this.extractPlaceholderList(spTree);
60775
60787
  if (placeholders.length > 0) {
@@ -75167,7 +75179,23 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
75167
75179
  }
75168
75180
  return this.isStrictOoxml ? "strict" : "transitional";
75169
75181
  }
75182
+ /** The save running now, or the last one: see {@link save}. */
75183
+ saveQueue = Promise.resolve();
75184
+ /**
75185
+ * Saves run one at a time. A save rewrites `this.zip` in place across many awaits and moves
75186
+ * per-part baselines (slide fingerprints, chart data, pending chart updates) while it runs, so
75187
+ * a second save that starts mid-way (a viewer's autosave snapshot firing during the user's own
75188
+ * save) read half-written state: it skipped the slide as unchanged and wrote the chart part's
75189
+ * original XML back over the edit, in both outputs. Each save now waits for the one before it;
75190
+ * one that fails does not hold up the next.
75191
+ */
75170
75192
  async save(slides, options) {
75193
+ const run2 = this.saveQueue.then(() => this.saveNow(slides, options));
75194
+ this.saveQueue = run2.catch(() => void 0);
75195
+ return run2;
75196
+ }
75197
+ /** One save, with the package to itself; callers go through {@link save}. */
75198
+ async saveNow(slides, options) {
75171
75199
  validateSlideGeometry(slides);
75172
75200
  const templates = [
75173
75201
  ...options?.slideMasters ?? [],
@@ -75185,7 +75213,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
75185
75213
  return this.saveAsLegacyPpt(
75186
75214
  slides,
75187
75215
  options,
75188
- () => this.save(slides, {
75216
+ () => this.saveNow(slides, {
75189
75217
  ...options,
75190
75218
  pptPassword: void 0,
75191
75219
  outputFormat: "pptx",
@@ -79986,6 +80014,25 @@ var PptxHandlerRuntime73 = class extends PptxHandlerRuntime72 {
79986
80014
  }
79987
80015
  return void 0;
79988
80016
  }
80017
+ /**
80018
+ * The colour a slide master or layout paints from its own `p:bg`, resolved exactly as a
80019
+ * slide's background is: through the active master's colour map and format scheme, with
80020
+ * `clrMapOverride` (a layout's `p:clrMapOvr`, or `null`) taking precedence. The caller makes
80021
+ * the part's master active first; a master's `bgRef` on `bg1` means `dk1` under a dark
80022
+ * `p:clrMap`, which no other state can tell.
80023
+ */
80024
+ extractTemplateBackgroundColor(partXml, rootTag, clrMapOverride) {
80025
+ if (!partXml) {
80026
+ return void 0;
80027
+ }
80028
+ const previousOverride = this.currentSlideClrMapOverride;
80029
+ this.currentSlideClrMapOverride = clrMapOverride;
80030
+ try {
80031
+ return this.extractBackgroundColor(partXml, rootTag);
80032
+ } finally {
80033
+ this.currentSlideClrMapOverride = previousOverride;
80034
+ }
80035
+ }
79989
80036
  /**
79990
80037
  * Composite a resolved background colour with its `a:alpha` (or
79991
80038
  * `a:alphaMod`/`a:alphaOff`) opacity onto opaque white.
@@ -80543,6 +80590,31 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
80543
80590
  const masterFormatScheme = this.masterThemeFormatSchemes.get(masterPath);
80544
80591
  this.themeFormatScheme = masterFormatScheme ?? this.globalThemeFormatSchemeSnapshot;
80545
80592
  }
80593
+ /**
80594
+ * Run `work` with one master's theme state active and no slide colour-map override, then
80595
+ * put back whatever state was active before, so a part parsed on request (a layout preview)
80596
+ * resolves through its own master without disturbing the caller's.
80597
+ */
80598
+ async withMasterThemeState(masterPath, work) {
80599
+ const saved = {
80600
+ colors: this.themeColorMap,
80601
+ fonts: this.themeFontMap,
80602
+ format: this.themeFormatScheme,
80603
+ clrMap: this.currentMasterClrMap,
80604
+ slideClrMap: this.currentSlideClrMapOverride
80605
+ };
80606
+ this.applyMasterThemeState(masterPath);
80607
+ this.currentSlideClrMapOverride = null;
80608
+ try {
80609
+ return await work();
80610
+ } finally {
80611
+ this.themeColorMap = saved.colors;
80612
+ this.themeFontMap = saved.fonts;
80613
+ this.themeFormatScheme = saved.format;
80614
+ this.currentMasterClrMap = saved.clrMap;
80615
+ this.currentSlideClrMapOverride = saved.slideClrMap;
80616
+ }
80617
+ }
80546
80618
  /**
80547
80619
  * Extract the `p:bg/@showAnimation` flag from a slide's XML.
80548
80620
  * Returns `true` when the background should animate, `false` when
@@ -81421,18 +81493,33 @@ var PptxHandlerRuntime78 = class extends PptxHandlerRuntime77 {
81421
81493
  this.rememberUnparsedMasterNodes(partPath, spTree, part.elements);
81422
81494
  }
81423
81495
  /**
81424
- * Populate `elements` on every slide master and on each of its layouts.
81496
+ * Resolve the background of every slide master and of each of its layouts,
81497
+ * and populate their `elements`.
81425
81498
  *
81426
- * Scheme colours on a master's own shapes must resolve through that
81427
- * master's colour map and theme, so the active master state is switched
81428
- * per part and reset to the deck-wide snapshot afterwards.
81499
+ * Scheme colours on a master, its own `p:bgRef` included, must resolve
81500
+ * through that master's colour map and theme, so the active master state is
81501
+ * switched per part and reset to the deck-wide snapshot afterwards.
81429
81502
  */
81430
81503
  async enrichSlideMasterElements(masters) {
81431
81504
  for (const master of masters) {
81432
81505
  try {
81433
81506
  this.applyMasterThemeState(master.path);
81507
+ master.backgroundColor = this.extractTemplateBackgroundColor(
81508
+ this.masterXmlMap.get(master.path),
81509
+ "p:sldMaster",
81510
+ null
81511
+ );
81434
81512
  await this.enrichMasterPartElements(master, "p:sldMaster");
81435
81513
  for (const layout of master.layouts ?? []) {
81514
+ const layoutXml3 = this.layoutXmlMap.get(layout.path);
81515
+ const backgroundColor = this.extractTemplateBackgroundColor(
81516
+ layoutXml3,
81517
+ "p:sldLayout",
81518
+ layoutXml3 ? this.parseLayoutClrMapOverride(layoutXml3) : null
81519
+ );
81520
+ if (backgroundColor) {
81521
+ layout.backgroundColor = backgroundColor;
81522
+ }
81436
81523
  await this.enrichMasterPartElements(layout, "p:sldLayout");
81437
81524
  }
81438
81525
  } catch (e) {
@@ -81686,20 +81773,23 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
81686
81773
  this.layoutCache.delete(layoutPath);
81687
81774
  this.eagerDecodeImages = true;
81688
81775
  }
81689
- let elements2;
81776
+ const masterPath = this.resolveMasterPathForLayout(layoutPath);
81777
+ let parsed;
81690
81778
  try {
81691
- elements2 = await this.getLayoutElementsByPath(layoutPath);
81779
+ parsed = await this.withMasterThemeState(masterPath, async () => ({
81780
+ elements: await this.getLayoutElementsByPath(layoutPath),
81781
+ background: this.resolveLayoutPreviewBackground(layoutXml3, masterPath)
81782
+ }));
81692
81783
  } finally {
81693
81784
  this.eagerDecodeImages = previousEagerDecode;
81694
81785
  }
81695
81786
  const cSld = xmlPath(layoutXml3, "p:sldLayout", "p:cSld");
81696
- const background = this.resolveLayoutPreviewBackground(layoutPath, cSld);
81697
81787
  const preview = {
81698
81788
  path: layoutPath,
81699
81789
  width: this.rawSlideWidthEmu / EMU_PER_PX,
81700
81790
  height: this.rawSlideHeightEmu / EMU_PER_PX,
81701
- ...background,
81702
- elements: elements2,
81791
+ ...parsed.background,
81792
+ elements: parsed.elements,
81703
81793
  placeholders: this.extractPlaceholderList(xmlChild(cSld, "p:spTree"))
81704
81794
  };
81705
81795
  this.layoutPreviewCache.set(layoutPath, preview);
@@ -81735,19 +81825,18 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
81735
81825
  }
81736
81826
  /**
81737
81827
  * Resolve the background a layout thumbnail should paint, falling back to
81738
- * the layout's master when the layout itself declares none.
81828
+ * the layout's master when the layout itself declares none. Runs with the
81829
+ * master active; the layout's own colour map override applies to an
81830
+ * inherited background too, as a slide's does.
81739
81831
  */
81740
- resolveLayoutPreviewBackground(layoutPath, cSld) {
81741
- const ownBackground = this.parseBackgroundColor(xmlChild(cSld, "p:bg"));
81742
- if (ownBackground) {
81743
- return { backgroundColor: ownBackground };
81744
- }
81745
- const masterPath = this.resolveMasterPathForLayout(layoutPath);
81746
- const masterXml = masterPath ? this.masterXmlMap.get(masterPath) : void 0;
81747
- const masterBackground = this.parseBackgroundColor(
81748
- xmlChild(xmlPath(masterXml, "p:sldMaster", "p:cSld"), "p:bg")
81832
+ resolveLayoutPreviewBackground(layoutXml3, masterPath) {
81833
+ const clrMapOverride = this.parseLayoutClrMapOverride(layoutXml3);
81834
+ const backgroundColor = this.extractTemplateBackgroundColor(layoutXml3, "p:sldLayout", clrMapOverride) ?? this.extractTemplateBackgroundColor(
81835
+ masterPath ? this.masterXmlMap.get(masterPath) : void 0,
81836
+ "p:sldMaster",
81837
+ clrMapOverride
81749
81838
  );
81750
- return masterBackground ? { backgroundColor: masterBackground } : {};
81839
+ return backgroundColor ? { backgroundColor } : {};
81751
81840
  }
81752
81841
  };
81753
81842
 
@@ -82533,11 +82622,275 @@ var PptxHandlerRuntime83 = class extends PptxHandlerRuntime82 {
82533
82622
  }
82534
82623
  };
82535
82624
 
82625
+ // pptx/core/core/runtime/theme-scheme-edit.ts
82626
+ var THEME_COLOR_SCHEME_KEYS = [
82627
+ "dk1",
82628
+ "lt1",
82629
+ "dk2",
82630
+ "lt2",
82631
+ "accent1",
82632
+ "accent2",
82633
+ "accent3",
82634
+ "accent4",
82635
+ "accent5",
82636
+ "accent6",
82637
+ "hlink",
82638
+ "folHlink"
82639
+ ];
82640
+ var DEFAULT_CLR_MAP_ALIASES = {
82641
+ tx1: "dk1",
82642
+ bg1: "lt1",
82643
+ tx2: "dk2",
82644
+ bg2: "lt2"
82645
+ };
82646
+ function normalizeHex2(hex3) {
82647
+ return hex3.replace(/^#/, "").toUpperCase();
82648
+ }
82649
+ function buildSrgbClrNode(hex3) {
82650
+ return { "a:srgbClr": { "@_val": normalizeHex2(hex3) } };
82651
+ }
82652
+ function themeElementsOf(data) {
82653
+ const root = data["a:theme"];
82654
+ return root?.["a:themeElements"];
82655
+ }
82656
+ function applyColorSchemeToThemeXml(data, colorScheme) {
82657
+ const themeElements = themeElementsOf(data);
82658
+ if (!themeElements) {
82659
+ return false;
82660
+ }
82661
+ const clrScheme = themeElements["a:clrScheme"] ?? {};
82662
+ for (const key2 of THEME_COLOR_SCHEME_KEYS) {
82663
+ clrScheme[`a:${key2}`] = buildSrgbClrNode(colorScheme[key2]);
82664
+ }
82665
+ themeElements["a:clrScheme"] = clrScheme;
82666
+ return true;
82667
+ }
82668
+ function applyLatinTypeface(group, latin) {
82669
+ const font = group ?? {};
82670
+ font["a:latin"] = { "@_typeface": latin };
82671
+ if (!font["a:ea"]) {
82672
+ font["a:ea"] = { "@_typeface": "" };
82673
+ }
82674
+ if (!font["a:cs"]) {
82675
+ font["a:cs"] = { "@_typeface": "" };
82676
+ }
82677
+ return font;
82678
+ }
82679
+ function applyFontSchemeToThemeXml(data, fontScheme) {
82680
+ const themeElements = themeElementsOf(data);
82681
+ if (!themeElements) {
82682
+ return false;
82683
+ }
82684
+ const fntScheme = themeElements["a:fontScheme"] ?? {};
82685
+ if (fontScheme.majorFont?.latin) {
82686
+ fntScheme["a:majorFont"] = applyLatinTypeface(
82687
+ fntScheme["a:majorFont"],
82688
+ fontScheme.majorFont.latin
82689
+ );
82690
+ }
82691
+ if (fontScheme.minorFont?.latin) {
82692
+ fntScheme["a:minorFont"] = applyLatinTypeface(
82693
+ fntScheme["a:minorFont"],
82694
+ fontScheme.minorFont.latin
82695
+ );
82696
+ }
82697
+ themeElements["a:fontScheme"] = fntScheme;
82698
+ return true;
82699
+ }
82700
+ function applyColorSchemeToMap(map, colorScheme, clrMap) {
82701
+ for (const key2 of THEME_COLOR_SCHEME_KEYS) {
82702
+ map[key2] = normalizeHex2(colorScheme[key2]);
82703
+ }
82704
+ for (const [alias, defaultTarget] of Object.entries(DEFAULT_CLR_MAP_ALIASES)) {
82705
+ const target = clrMap?.[alias] ?? defaultTarget;
82706
+ const resolved = map[target];
82707
+ if (resolved !== void 0) {
82708
+ map[alias] = resolved;
82709
+ }
82710
+ }
82711
+ }
82712
+ function applyFontSchemeToMap(map, fontScheme) {
82713
+ if (fontScheme.majorFont?.latin) {
82714
+ map["mj-lt"] = fontScheme.majorFont.latin;
82715
+ map["mj-ea"] = fontScheme.majorFont.latin;
82716
+ map["mj-cs"] = fontScheme.majorFont.latin;
82717
+ }
82718
+ if (fontScheme.minorFont?.latin) {
82719
+ map["mn-lt"] = fontScheme.minorFont.latin;
82720
+ map["mn-ea"] = fontScheme.minorFont.latin;
82721
+ map["mn-cs"] = fontScheme.minorFont.latin;
82722
+ }
82723
+ }
82724
+
82725
+ // pptx/core/core/runtime/theme-part-model.ts
82726
+ function colorSchemeFromMap(colorMap) {
82727
+ const scheme = {};
82728
+ for (const key2 of THEME_COLOR_SCHEME_KEYS) {
82729
+ scheme[key2] = colorMap[key2] || "";
82730
+ }
82731
+ return scheme;
82732
+ }
82733
+ function fontGroup(fontMap, prefix, byScript) {
82734
+ const latin = fontMap[`${prefix}-lt`];
82735
+ const eastAsia = fontMap[`${prefix}-ea`];
82736
+ const complexScript = fontMap[`${prefix}-cs`];
82737
+ return {
82738
+ ...latin ? { latin } : {},
82739
+ ...eastAsia ? { eastAsia } : {},
82740
+ ...complexScript ? { complexScript } : {},
82741
+ ...Object.keys(byScript).length > 0 ? { byScript: { ...byScript } } : {}
82742
+ };
82743
+ }
82744
+ function fontSchemeFromMap(fontMap, majorByScript, minorByScript) {
82745
+ return {
82746
+ majorFont: fontGroup(fontMap, "mj", majorByScript),
82747
+ minorFont: fontGroup(fontMap, "mn", minorByScript)
82748
+ };
82749
+ }
82750
+
82751
+ // pptx/core/core/runtime/PptxHandlerRuntimeThemePartModel.ts
82752
+ var FONT_SLOTS = [
82753
+ ["mj", "a:majorFont"],
82754
+ ["mn", "a:minorFont"]
82755
+ ];
82756
+ var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82757
+ /** Parse one theme part's XML. Side-effect free. */
82758
+ parseThemePartXml(themeXml3) {
82759
+ const themeData = this.parser.parse(themeXml3);
82760
+ const themeRoot = themeData["a:theme"];
82761
+ const themeElements = themeRoot?.["a:themeElements"];
82762
+ const colorScheme = themeElements?.["a:clrScheme"];
82763
+ const fontScheme = themeElements?.["a:fontScheme"];
82764
+ const fmtScheme = themeElements?.["a:fmtScheme"];
82765
+ const text = (value) => String(value || "").trim() || void 0;
82766
+ const colorMap = { ...this.getDefaultSchemeColorMap() };
82767
+ for (const key2 of THEME_COLOR_SCHEME_KEYS) {
82768
+ const parsed = this.parseColorChoice(colorScheme?.[`a:${key2}`]);
82769
+ if (parsed) {
82770
+ colorMap[key2] = parsed;
82771
+ }
82772
+ }
82773
+ const fontMap = {};
82774
+ const typeface = (node) => this.normalizeTypefaceToken(String(node?.["@_typeface"] || ""));
82775
+ for (const [prefix, tag] of FONT_SLOTS) {
82776
+ const group = fontScheme?.[tag];
82777
+ const latin = typeface(group?.["a:latin"]);
82778
+ if (latin) {
82779
+ fontMap[`${prefix}-lt`] = latin;
82780
+ fontMap[`${prefix}-ea`] = latin;
82781
+ fontMap[`${prefix}-cs`] = latin;
82782
+ }
82783
+ const eastAsia = typeface(group?.["a:ea"]);
82784
+ if (eastAsia) {
82785
+ fontMap[`${prefix}-ea`] = eastAsia;
82786
+ }
82787
+ const complexScript = typeface(group?.["a:cs"]);
82788
+ if (complexScript) {
82789
+ fontMap[`${prefix}-cs`] = complexScript;
82790
+ }
82791
+ }
82792
+ const objectDefaultsNode = themeRoot?.["a:objectDefaults"];
82793
+ const objectDefaults = objectDefaultsNode && {
82794
+ spDef: objectDefaultsNode["a:spDef"],
82795
+ lnDef: objectDefaultsNode["a:lnDef"],
82796
+ txDef: objectDefaultsNode["a:txDef"]
82797
+ };
82798
+ const hasObjectDefaults = objectDefaults !== void 0 && (objectDefaults.spDef !== void 0 || objectDefaults.lnDef !== void 0 || objectDefaults.txDef !== void 0);
82799
+ return {
82800
+ name: text(themeRoot?.["@_name"]),
82801
+ colorSchemeName: text(colorScheme?.["@_name"]),
82802
+ fontSchemeName: text(fontScheme?.["@_name"]),
82803
+ colorMap,
82804
+ fontMap,
82805
+ // Per-script fonts (`<a:font script="Hans|Hant|Arab|...">`): M4.
82806
+ majorFontScripts: this.collectFontScriptOverrides(
82807
+ fontScheme?.["a:majorFont"]
82808
+ ),
82809
+ minorFontScripts: this.collectFontScriptOverrides(
82810
+ fontScheme?.["a:minorFont"]
82811
+ ),
82812
+ // objectDefaults: M5.
82813
+ objectDefaults: hasObjectDefaults ? objectDefaults : void 0,
82814
+ extraClrSchemeLst: themeRoot?.["a:extraClrSchemeLst"],
82815
+ custClrLst: themeRoot?.["a:custClrLst"],
82816
+ extLst: themeRoot?.["a:extLst"],
82817
+ formatScheme: fmtScheme ? this.parseFormatScheme(fmtScheme) : void 0
82818
+ };
82819
+ }
82820
+ /**
82821
+ * Record a parsed part under its path: its original XML (byte-stable passthrough on save,
82822
+ * C-H3), its names, per-script fonts and the raw subtrees the save re-emits.
82823
+ */
82824
+ cacheThemePartModel(themePath, themeXml3, model) {
82825
+ this.originalThemeXmlByPath.set(themePath, themeXml3);
82826
+ const keyed = [
82827
+ [this.masterThemeNames, model.name],
82828
+ [this.masterThemeColorSchemeNames, model.colorSchemeName],
82829
+ [this.masterThemeFontSchemeNames, model.fontSchemeName],
82830
+ [this.masterThemeObjectDefaults, model.objectDefaults],
82831
+ [this.masterThemeExtraClrSchemeLst, model.extraClrSchemeLst],
82832
+ [this.masterThemeCustClrLst, model.custClrLst],
82833
+ [this.masterThemeExtLst, model.extLst]
82834
+ ];
82835
+ for (const [map, value] of keyed) {
82836
+ if (value !== void 0) {
82837
+ map.set(themePath, value);
82838
+ }
82839
+ }
82840
+ if (Object.keys(model.majorFontScripts).length > 0) {
82841
+ this.masterThemeMajorFontScripts.set(themePath, model.majorFontScripts);
82842
+ }
82843
+ if (Object.keys(model.minorFontScripts).length > 0) {
82844
+ this.masterThemeMinorFontScripts.set(themePath, model.minorFontScripts);
82845
+ }
82846
+ }
82847
+ /**
82848
+ * Parse `<a:font script="..." typeface="..."/>` children of a major or minor font node into a
82849
+ * `script -> typeface` dictionary. fast-xml-parser collapses repeated tags into arrays, so the
82850
+ * array form is walked regardless of how many siblings are present. Phase 4 Stream A / M4.
82851
+ */
82852
+ collectFontScriptOverrides(fontNode) {
82853
+ const overrides = {};
82854
+ if (!fontNode) {
82855
+ return overrides;
82856
+ }
82857
+ const fontEntries = this.ensureArray(fontNode["a:font"]);
82858
+ for (const entry2 of fontEntries) {
82859
+ const script = String(entry2?.["@_script"] || "").trim();
82860
+ const typeface = this.normalizeTypefaceToken(String(entry2?.["@_typeface"] || ""));
82861
+ if (script && typeface) {
82862
+ overrides[script] = typeface;
82863
+ }
82864
+ }
82865
+ return overrides;
82866
+ }
82867
+ /**
82868
+ * The colour, font and format schemes and name of one theme part in the package, as the part holds
82869
+ * them now (a scheme edit already written to it included). Reads only: the loaded theme, the
82870
+ * masters and what a save writes are unchanged. `undefined` when the package has no such part.
82871
+ */
82872
+ async getThemePartSchemes(themePath) {
82873
+ const path3 = themePath.trim().replace(/\\/g, "/");
82874
+ const themeXml3 = await this.zip.file(path3)?.async("string");
82875
+ if (themeXml3 === void 0) {
82876
+ return void 0;
82877
+ }
82878
+ const model = this.parseThemePartXml(themeXml3);
82879
+ return {
82880
+ path: path3,
82881
+ ...model.name ? { name: model.name } : {},
82882
+ colorScheme: colorSchemeFromMap(model.colorMap),
82883
+ fontScheme: fontSchemeFromMap(model.fontMap, model.majorFontScripts, model.minorFontScripts),
82884
+ ...model.formatScheme ? { formatScheme: model.formatScheme } : {}
82885
+ };
82886
+ }
82887
+ };
82888
+
82536
82889
  // pptx/core/core/runtime/PptxHandlerRuntimeThemeLoading.ts
82537
82890
  function isPresentationThemePartPath(path3) {
82538
82891
  return /^ppt\/theme\/(?!themeOverride)[^/]+\.xml$/iu.test(path3);
82539
82892
  }
82540
- var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82893
+ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
82541
82894
  async resolvePrimaryThemePath() {
82542
82895
  const masterFiles = this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);
82543
82896
  if (!masterFiles || masterFiles.length === 0) {
@@ -82613,42 +82966,12 @@ var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82613
82966
  if (!hasColors && !hasFonts) {
82614
82967
  return void 0;
82615
82968
  }
82616
- let colorScheme;
82617
- if (hasColors) {
82618
- colorScheme = {
82619
- dk1: this.themeColorMap["dk1"] || "",
82620
- lt1: this.themeColorMap["lt1"] || "",
82621
- dk2: this.themeColorMap["dk2"] || "",
82622
- lt2: this.themeColorMap["lt2"] || "",
82623
- accent1: this.themeColorMap["accent1"] || "",
82624
- accent2: this.themeColorMap["accent2"] || "",
82625
- accent3: this.themeColorMap["accent3"] || "",
82626
- accent4: this.themeColorMap["accent4"] || "",
82627
- accent5: this.themeColorMap["accent5"] || "",
82628
- accent6: this.themeColorMap["accent6"] || "",
82629
- hlink: this.themeColorMap["hlink"] || "",
82630
- folHlink: this.themeColorMap["folHlink"] || ""
82631
- };
82632
- }
82633
- let fontScheme;
82634
- if (hasFonts) {
82635
- const majorByScript = this.aggregateFontScriptOverrides(this.masterThemeMajorFontScripts);
82636
- const minorByScript = this.aggregateFontScriptOverrides(this.masterThemeMinorFontScripts);
82637
- fontScheme = {
82638
- majorFont: {
82639
- latin: this.themeFontMap["mj-lt"],
82640
- eastAsia: this.themeFontMap["mj-ea"],
82641
- complexScript: this.themeFontMap["mj-cs"],
82642
- ...Object.keys(majorByScript).length > 0 ? { byScript: majorByScript } : {}
82643
- },
82644
- minorFont: {
82645
- latin: this.themeFontMap["mn-lt"],
82646
- eastAsia: this.themeFontMap["mn-ea"],
82647
- complexScript: this.themeFontMap["mn-cs"],
82648
- ...Object.keys(minorByScript).length > 0 ? { byScript: minorByScript } : {}
82649
- }
82650
- };
82651
- }
82969
+ const colorScheme = hasColors ? colorSchemeFromMap(this.themeColorMap) : void 0;
82970
+ const fontScheme = hasFonts ? fontSchemeFromMap(
82971
+ this.themeFontMap,
82972
+ this.aggregateFontScriptOverrides(this.masterThemeMajorFontScripts),
82973
+ this.aggregateFontScriptOverrides(this.masterThemeMinorFontScripts)
82974
+ ) : void 0;
82652
82975
  return {
82653
82976
  colorScheme,
82654
82977
  fontScheme,
@@ -82725,134 +83048,10 @@ var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82725
83048
  return null;
82726
83049
  }
82727
83050
  const themeXml3 = await themeFile.async("string");
82728
- this.originalThemeXmlByPath.set(themePath, themeXml3);
82729
- const themeData = this.parser.parse(themeXml3);
82730
- const themeRoot = themeData["a:theme"];
82731
- const themeElements = themeRoot?.["a:themeElements"];
82732
- const colorScheme = themeElements?.["a:clrScheme"];
82733
- const fontScheme = themeElements?.["a:fontScheme"];
82734
- const fmtScheme = themeElements?.["a:fmtScheme"];
82735
- const themeName = String(themeRoot?.["@_name"] || "").trim();
82736
- if (themeName) {
82737
- this.masterThemeNames.set(themePath, themeName);
82738
- }
82739
- const colorSchemeName = String(colorScheme?.["@_name"] || "").trim();
82740
- if (colorSchemeName) {
82741
- this.masterThemeColorSchemeNames.set(themePath, colorSchemeName);
82742
- }
82743
- const fontSchemeName = String(fontScheme?.["@_name"] || "").trim();
82744
- if (fontSchemeName) {
82745
- this.masterThemeFontSchemeNames.set(themePath, fontSchemeName);
82746
- }
82747
- const defaultMap = this.getDefaultSchemeColorMap();
82748
- const colorMap = { ...defaultMap };
82749
- if (colorScheme) {
82750
- const schemeKeys = [
82751
- "dk1",
82752
- "lt1",
82753
- "dk2",
82754
- "lt2",
82755
- "accent1",
82756
- "accent2",
82757
- "accent3",
82758
- "accent4",
82759
- "accent5",
82760
- "accent6",
82761
- "hlink",
82762
- "folHlink"
82763
- ];
82764
- for (const key2 of schemeKeys) {
82765
- const colorNode = colorScheme[`a:${key2}`];
82766
- const parsed = this.parseColorChoice(colorNode);
82767
- if (parsed) {
82768
- colorMap[key2] = parsed;
82769
- }
82770
- }
82771
- }
82772
- const majorFontNode = fontScheme?.["a:majorFont"];
82773
- const minorFontNode = fontScheme?.["a:minorFont"];
82774
- const majorLatin = majorFontNode?.["a:latin"];
82775
- const minorLatin = minorFontNode?.["a:latin"];
82776
- const majorFont = this.normalizeTypefaceToken(String(majorLatin?.["@_typeface"] || ""));
82777
- const minorFont = this.normalizeTypefaceToken(String(minorLatin?.["@_typeface"] || ""));
82778
- const fontMap = {};
82779
- if (majorFont) {
82780
- fontMap["mj-lt"] = majorFont;
82781
- fontMap["mj-ea"] = majorFont;
82782
- fontMap["mj-cs"] = majorFont;
82783
- }
82784
- if (minorFont) {
82785
- fontMap["mn-lt"] = minorFont;
82786
- fontMap["mn-ea"] = minorFont;
82787
- fontMap["mn-cs"] = minorFont;
82788
- }
82789
- const majorEa = this.normalizeTypefaceToken(
82790
- String(majorFontNode?.["a:ea"]?.["@_typeface"] || "")
82791
- );
82792
- if (majorEa) {
82793
- fontMap["mj-ea"] = majorEa;
82794
- }
82795
- const majorCs = this.normalizeTypefaceToken(
82796
- String(majorFontNode?.["a:cs"]?.["@_typeface"] || "")
82797
- );
82798
- if (majorCs) {
82799
- fontMap["mj-cs"] = majorCs;
82800
- }
82801
- const minorEa = this.normalizeTypefaceToken(
82802
- String(minorFontNode?.["a:ea"]?.["@_typeface"] || "")
82803
- );
82804
- if (minorEa) {
82805
- fontMap["mn-ea"] = minorEa;
82806
- }
82807
- const minorCs = this.normalizeTypefaceToken(
82808
- String(minorFontNode?.["a:cs"]?.["@_typeface"] || "")
82809
- );
82810
- if (minorCs) {
82811
- fontMap["mn-cs"] = minorCs;
82812
- }
82813
- const majorScripts = this.collectFontScriptOverrides(majorFontNode);
82814
- if (Object.keys(majorScripts).length > 0) {
82815
- this.masterThemeMajorFontScripts.set(themePath, majorScripts);
82816
- }
82817
- const minorScripts = this.collectFontScriptOverrides(minorFontNode);
82818
- if (Object.keys(minorScripts).length > 0) {
82819
- this.masterThemeMinorFontScripts.set(themePath, minorScripts);
82820
- }
82821
- const objectDefaultsNode = themeRoot?.["a:objectDefaults"];
82822
- if (objectDefaultsNode) {
82823
- const od = {
82824
- spDef: objectDefaultsNode["a:spDef"],
82825
- lnDef: objectDefaultsNode["a:lnDef"],
82826
- txDef: objectDefaultsNode["a:txDef"]
82827
- };
82828
- if (od.spDef !== void 0 || od.lnDef !== void 0 || od.txDef !== void 0) {
82829
- this.masterThemeObjectDefaults.set(themePath, od);
82830
- }
82831
- }
82832
- const extraClrSchemeLst = themeRoot?.["a:extraClrSchemeLst"];
82833
- if (extraClrSchemeLst !== void 0) {
82834
- this.masterThemeExtraClrSchemeLst.set(themePath, extraClrSchemeLst);
82835
- }
82836
- const custClrLst = themeRoot?.["a:custClrLst"];
82837
- if (custClrLst !== void 0) {
82838
- this.masterThemeCustClrLst.set(themePath, custClrLst);
82839
- }
82840
- const themeExtLst = themeRoot?.["a:extLst"];
82841
- if (themeExtLst !== void 0) {
82842
- this.masterThemeExtLst.set(themePath, themeExtLst);
82843
- }
82844
- const formatScheme = fmtScheme ? this.parseFormatScheme(fmtScheme) : void 0;
82845
- return { colorMap, fontMap, formatScheme };
83051
+ const model = this.parseThemePartXml(themeXml3);
83052
+ this.cacheThemePartModel(themePath, themeXml3, model);
83053
+ return { colorMap: model.colorMap, fontMap: model.fontMap, formatScheme: model.formatScheme };
82846
83054
  }
82847
- /**
82848
- * Parse `<a:font script="…" typeface="…"/>` children of a major or
82849
- * minor font node into a `script -> typeface` dictionary.
82850
- *
82851
- * fast-xml-parser collapses repeated tags into arrays, so iterate
82852
- * over the array form regardless of how many siblings are present.
82853
- *
82854
- * Phase 4 Stream A / M4.
82855
- */
82856
83055
  /**
82857
83056
  * Flatten a per-theme-path script-override map (`themePath -> {script ->
82858
83057
  * typeface}`) into a single `{script -> typeface}` lookup for
@@ -82870,21 +83069,6 @@ var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82870
83069
  }
82871
83070
  return aggregate;
82872
83071
  }
82873
- collectFontScriptOverrides(fontNode) {
82874
- const overrides = {};
82875
- if (!fontNode) {
82876
- return overrides;
82877
- }
82878
- const fontEntries = this.ensureArray(fontNode["a:font"]);
82879
- for (const entry2 of fontEntries) {
82880
- const script = String(entry2?.["@_script"] || "").trim();
82881
- const typeface = this.normalizeTypefaceToken(String(entry2?.["@_typeface"] || ""));
82882
- if (script && typeface) {
82883
- overrides[script] = typeface;
82884
- }
82885
- }
82886
- return overrides;
82887
- }
82888
83072
  /**
82889
83073
  * Resolve the theme file path referenced by a given master's `.rels`.
82890
83074
  * Returns `undefined` when the master has no theme relationship.
@@ -82968,109 +83152,9 @@ var PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
82968
83152
  }
82969
83153
  };
82970
83154
 
82971
- // pptx/core/core/runtime/theme-scheme-edit.ts
82972
- var THEME_COLOR_SCHEME_KEYS = [
82973
- "dk1",
82974
- "lt1",
82975
- "dk2",
82976
- "lt2",
82977
- "accent1",
82978
- "accent2",
82979
- "accent3",
82980
- "accent4",
82981
- "accent5",
82982
- "accent6",
82983
- "hlink",
82984
- "folHlink"
82985
- ];
82986
- var DEFAULT_CLR_MAP_ALIASES = {
82987
- tx1: "dk1",
82988
- bg1: "lt1",
82989
- tx2: "dk2",
82990
- bg2: "lt2"
82991
- };
82992
- function normalizeHex2(hex3) {
82993
- return hex3.replace(/^#/, "").toUpperCase();
82994
- }
82995
- function buildSrgbClrNode(hex3) {
82996
- return { "a:srgbClr": { "@_val": normalizeHex2(hex3) } };
82997
- }
82998
- function themeElementsOf(data) {
82999
- const root = data["a:theme"];
83000
- return root?.["a:themeElements"];
83001
- }
83002
- function applyColorSchemeToThemeXml(data, colorScheme) {
83003
- const themeElements = themeElementsOf(data);
83004
- if (!themeElements) {
83005
- return false;
83006
- }
83007
- const clrScheme = themeElements["a:clrScheme"] ?? {};
83008
- for (const key2 of THEME_COLOR_SCHEME_KEYS) {
83009
- clrScheme[`a:${key2}`] = buildSrgbClrNode(colorScheme[key2]);
83010
- }
83011
- themeElements["a:clrScheme"] = clrScheme;
83012
- return true;
83013
- }
83014
- function applyLatinTypeface(group, latin) {
83015
- const font = group ?? {};
83016
- font["a:latin"] = { "@_typeface": latin };
83017
- if (!font["a:ea"]) {
83018
- font["a:ea"] = { "@_typeface": "" };
83019
- }
83020
- if (!font["a:cs"]) {
83021
- font["a:cs"] = { "@_typeface": "" };
83022
- }
83023
- return font;
83024
- }
83025
- function applyFontSchemeToThemeXml(data, fontScheme) {
83026
- const themeElements = themeElementsOf(data);
83027
- if (!themeElements) {
83028
- return false;
83029
- }
83030
- const fntScheme = themeElements["a:fontScheme"] ?? {};
83031
- if (fontScheme.majorFont?.latin) {
83032
- fntScheme["a:majorFont"] = applyLatinTypeface(
83033
- fntScheme["a:majorFont"],
83034
- fontScheme.majorFont.latin
83035
- );
83036
- }
83037
- if (fontScheme.minorFont?.latin) {
83038
- fntScheme["a:minorFont"] = applyLatinTypeface(
83039
- fntScheme["a:minorFont"],
83040
- fontScheme.minorFont.latin
83041
- );
83042
- }
83043
- themeElements["a:fontScheme"] = fntScheme;
83044
- return true;
83045
- }
83046
- function applyColorSchemeToMap(map, colorScheme, clrMap) {
83047
- for (const key2 of THEME_COLOR_SCHEME_KEYS) {
83048
- map[key2] = normalizeHex2(colorScheme[key2]);
83049
- }
83050
- for (const [alias, defaultTarget] of Object.entries(DEFAULT_CLR_MAP_ALIASES)) {
83051
- const target = clrMap?.[alias] ?? defaultTarget;
83052
- const resolved = map[target];
83053
- if (resolved !== void 0) {
83054
- map[alias] = resolved;
83055
- }
83056
- }
83057
- }
83058
- function applyFontSchemeToMap(map, fontScheme) {
83059
- if (fontScheme.majorFont?.latin) {
83060
- map["mj-lt"] = fontScheme.majorFont.latin;
83061
- map["mj-ea"] = fontScheme.majorFont.latin;
83062
- map["mj-cs"] = fontScheme.majorFont.latin;
83063
- }
83064
- if (fontScheme.minorFont?.latin) {
83065
- map["mn-lt"] = fontScheme.minorFont.latin;
83066
- map["mn-ea"] = fontScheme.minorFont.latin;
83067
- map["mn-cs"] = fontScheme.minorFont.latin;
83068
- }
83069
- }
83070
-
83071
83155
  // pptx/core/core/runtime/PptxHandlerRuntimeThemeProcessing.ts
83072
83156
  var THEME_PART_PATTERN = /^ppt\/theme\/theme\d+\.xml$/;
83073
- var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
83157
+ var PptxHandlerRuntime86 = class extends PptxHandlerRuntime85 {
83074
83158
  /**
83075
83159
  * The theme parts an edit should touch, primary theme first.
83076
83160
  *
@@ -83111,8 +83195,9 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
83111
83195
  return this.parser.parse(xml);
83112
83196
  }
83113
83197
  /**
83114
- * Parse, edit, and write back every target theme part. Parts the edit
83115
- * cannot apply to (no `a:themeElements`) are left untouched.
83198
+ * Parse, edit, and write back every target theme part (`edit` gets the
83199
+ * part's path too). Parts the edit cannot apply to (no `a:themeElements`)
83200
+ * are left untouched.
83116
83201
  *
83117
83202
  * @returns the paths that were rewritten
83118
83203
  */
@@ -83120,7 +83205,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
83120
83205
  const written = [];
83121
83206
  for (const path3 of await this.resolveThemeEditTargets(themePaths)) {
83122
83207
  const data = await this.readThemePart(path3);
83123
- if (!data || !edit(data)) {
83208
+ if (!data || !edit(data, path3)) {
83124
83209
  continue;
83125
83210
  }
83126
83211
  this.zip.file(path3, this.builder.build(data));
@@ -83222,8 +83307,77 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
83222
83307
  }
83223
83308
  };
83224
83309
 
83310
+ // pptx/core/core/runtime/PptxHandlerRuntimeThemeSwitching.ts
83311
+ var SLIDE_MASTER_PART = /^ppt\/slideMasters\/slideMaster\d+\.xml$/;
83312
+ function themePartPath(themePath) {
83313
+ const path3 = themePath.trim().replace(/\\/g, "/");
83314
+ return path3.startsWith("ppt/theme/") ? path3 : void 0;
83315
+ }
83316
+ var PptxHandlerRuntime87 = class extends PptxHandlerRuntime86 {
83317
+ /**
83318
+ * Point the first slide master, or every one, at a theme part already in the package. Does
83319
+ * nothing when the package has no such part.
83320
+ */
83321
+ async setPresentationTheme(themePath, applyToAllMasters = true) {
83322
+ const path3 = themePartPath(themePath);
83323
+ if (!path3 || !this.zip.file(path3)) {
83324
+ return;
83325
+ }
83326
+ const masters = this.zip.file(SLIDE_MASTER_PART);
83327
+ for (const master of applyToAllMasters ? masters : masters.slice(0, 1)) {
83328
+ await this.retargetMasterTheme(master.name, path3);
83329
+ }
83330
+ }
83331
+ /**
83332
+ * Point one slide master at a theme part already in the package (Undo of a theme switch puts
83333
+ * each master back on its own part). Does nothing when the package has no such master or part.
83334
+ */
83335
+ async setSlideMasterTheme(masterPath, themePath) {
83336
+ const path3 = themePartPath(themePath);
83337
+ if (!path3 || !this.zip.file(path3) || !SLIDE_MASTER_PART.test(masterPath)) {
83338
+ return;
83339
+ }
83340
+ if (this.zip.file(masterPath)) {
83341
+ await this.retargetMasterTheme(masterPath, path3);
83342
+ }
83343
+ }
83344
+ async retargetMasterTheme(masterPath, themePath) {
83345
+ if (await this.setMasterThemeRelationship(masterPath, themePath)) {
83346
+ await this.adoptMasterTheme(masterPath, themePath);
83347
+ }
83348
+ }
83349
+ /** Point the runtime's theme state for `masterPath` at the part it now uses. */
83350
+ async adoptMasterTheme(masterPath, themePath) {
83351
+ const themeXml3 = await this.zip.file(themePath)?.async("string");
83352
+ if (themeXml3 === void 0) {
83353
+ return;
83354
+ }
83355
+ const model = this.parseThemePartXml(themeXml3);
83356
+ if (!this.originalThemeXmlByPath.has(themePath)) {
83357
+ this.cacheThemePartModel(themePath, themeXml3, model);
83358
+ }
83359
+ this.masterThemePaths.set(masterPath, themePath);
83360
+ this.masterThemeColorMaps.set(masterPath, { ...model.colorMap });
83361
+ this.masterThemeFontMaps.set(masterPath, { ...model.fontMap });
83362
+ if (model.formatScheme) {
83363
+ this.masterThemeFormatSchemes.set(masterPath, model.formatScheme);
83364
+ } else {
83365
+ this.masterThemeFormatSchemes.delete(masterPath);
83366
+ }
83367
+ if (this.zip.file(SLIDE_MASTER_PART)[0]?.name !== masterPath) {
83368
+ return;
83369
+ }
83370
+ this.themeColorMap = { ...model.colorMap };
83371
+ this.themeFontMap = { ...model.fontMap };
83372
+ this.themeFormatScheme = model.formatScheme;
83373
+ this.globalThemeColorMapSnapshot = { ...model.colorMap };
83374
+ this.globalThemeFontMapSnapshot = { ...model.fontMap };
83375
+ this.globalThemeFormatSchemeSnapshot = model.formatScheme;
83376
+ }
83377
+ };
83378
+
83225
83379
  // pptx/core/core/runtime/PptxHandlerRuntimeComments.ts
83226
- var PptxHandlerRuntime86 = class _PptxHandlerRuntime extends PptxHandlerRuntime85 {
83380
+ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime87 {
83227
83381
  /**
83228
83382
  * Parse modern threaded comments (PowerPoint 2019+ / Office 365).
83229
83383
  * Modern comments use `p188:cmLst`/`p15:cmLst` roots within
@@ -83450,7 +83604,7 @@ var PptxHandlerRuntime86 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
83450
83604
  };
83451
83605
 
83452
83606
  // pptx/core/core/runtime/PptxHandlerRuntimeSmartArtXmlUtils.ts
83453
- var PptxHandlerRuntime87 = class extends PptxHandlerRuntime86 {
83607
+ var PptxHandlerRuntime89 = class extends PptxHandlerRuntime88 {
83454
83608
  async readXmlPartByRelationshipId(slidePath, relationshipId) {
83455
83609
  const normalizedRelationshipId = String(relationshipId || "").trim();
83456
83610
  if (normalizedRelationshipId.length === 0) {
@@ -84019,7 +84173,7 @@ function resolveSmartArtTextStyles(paragraphs, resolve) {
84019
84173
  }
84020
84174
 
84021
84175
  // pptx/core/core/runtime/PptxHandlerRuntimeSmartArtParsing.ts
84022
- var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime87 {
84176
+ var PptxHandlerRuntime90 = class _PptxHandlerRuntime extends PptxHandlerRuntime89 {
84023
84177
  reportIncompleteSmartArtRelationships(graphicFrame, relationshipIds, slidePath) {
84024
84178
  const missing = [
84025
84179
  ["dm", relationshipIds?.dataRelId],
@@ -84398,7 +84552,7 @@ function resolveSmartArtLayoutCategory(uniqueId, categories) {
84398
84552
  }
84399
84553
 
84400
84554
  // pptx/core/core/runtime/PptxHandlerRuntimeSmartArt.ts
84401
- var PptxHandlerRuntime89 = class _PptxHandlerRuntime extends PptxHandlerRuntime88 {
84555
+ var PptxHandlerRuntime91 = class _PptxHandlerRuntime extends PptxHandlerRuntime90 {
84402
84556
  async getSmartArtDataForGraphicFrame(slidePath, graphicFrame) {
84403
84557
  const graphicData = this.xmlLookupService.getChildByLocalName(
84404
84558
  this.xmlLookupService.getChildByLocalName(graphicFrame, "graphic"),
@@ -84572,7 +84726,7 @@ var PptxHandlerRuntime89 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
84572
84726
  };
84573
84727
 
84574
84728
  // pptx/core/core/runtime/PptxHandlerRuntimeChartDetection.ts
84575
- var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
84729
+ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
84576
84730
  detectChartType(plotArea) {
84577
84731
  if (!plotArea) {
84578
84732
  return "unknown";
@@ -84782,7 +84936,7 @@ function parseNumberVal(node) {
84782
84936
  const num2 = Number.parseFloat(String(raw2));
84783
84937
  return Number.isFinite(num2) ? num2 : void 0;
84784
84938
  }
84785
- var PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
84939
+ var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
84786
84940
  /**
84787
84941
  * Parse `c:plotVisOnly` from the chart root element.
84788
84942
  *
@@ -85041,7 +85195,7 @@ var PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
85041
85195
 
85042
85196
  // pptx/core/core/runtime/PptxHandlerRuntimeChartExternalData.ts
85043
85197
  var CHART_USER_SHAPES_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes";
85044
- var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
85198
+ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
85045
85199
  /**
85046
85200
  * Parse `c:externalData` from the chart's `c:chartSpace` and resolve
85047
85201
  * the external relationship target from the chart part's .rels file.
@@ -85201,7 +85355,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
85201
85355
  };
85202
85356
 
85203
85357
  // pptx/core/core/runtime/PptxHandlerRuntimeChartColorStyle.ts
85204
- var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
85358
+ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
85205
85359
  /**
85206
85360
  * Parse the Office 2013+ chart-style part (`ppt/charts/style#.xml`)
85207
85361
  * referenced from the chart's relationships, sibling to
@@ -85360,7 +85514,7 @@ var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
85360
85514
  };
85361
85515
 
85362
85516
  // pptx/core/core/runtime/PptxHandlerRuntimeChartExParsing.ts
85363
- var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
85517
+ var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
85364
85518
  /**
85365
85519
  * The facts of a chart part that live outside the plot (or in other parts): the external data
85366
85520
  * reference and the embedded workbook's rows, pivot source and formats, the colour-style and
@@ -85478,7 +85632,7 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
85478
85632
  };
85479
85633
 
85480
85634
  // pptx/core/core/runtime/PptxHandlerRuntimeChartParsing.ts
85481
- var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
85635
+ var PptxHandlerRuntime97 = class extends PptxHandlerRuntime96 {
85482
85636
  /**
85483
85637
  * Parse chart data from a graphic frame element on a slide.
85484
85638
  *
@@ -85762,7 +85916,7 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
85762
85916
  // pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
85763
85917
  var XSD_INT_MIN = -2147483648;
85764
85918
  var XSD_INT_MAX = 2147483647;
85765
- var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
85919
+ var PptxHandlerRuntime98 = class extends PptxHandlerRuntime97 {
85766
85920
  parseEditorAnimations(slideXml3) {
85767
85921
  return this.editorAnimationService.parseEditorAnimations(slideXml3);
85768
85922
  }
@@ -85963,7 +86117,7 @@ var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
85963
86117
  };
85964
86118
 
85965
86119
  // pptx/core/core/runtime/PptxHandlerRuntimeEmbeddedFonts.ts
85966
- var PptxHandlerRuntime97 = class extends PptxHandlerRuntime96 {
86120
+ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
85967
86121
  async getEmbeddedFonts(fontList) {
85968
86122
  if (!fontList || fontList.fonts.length === 0) {
85969
86123
  return [];
@@ -86166,7 +86320,7 @@ var PptxHandlerRuntime97 = class extends PptxHandlerRuntime96 {
86166
86320
 
86167
86321
  // pptx/core/core/runtime/PptxHandlerRuntimeLoadSession.ts
86168
86322
  var MAX_OLE_EMBEDDING_BYTES = 25 * 1024 * 1024;
86169
- var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime97 {
86323
+ var PptxHandlerRuntime100 = class _PptxHandlerRuntime extends PptxHandlerRuntime99 {
86170
86324
  isZipContainer(data) {
86171
86325
  const bytes = new Uint8Array(data);
86172
86326
  if (bytes.byteLength < 4) {
@@ -86532,7 +86686,7 @@ var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
86532
86686
  };
86533
86687
 
86534
86688
  // pptx/core/core/runtime/PptxHandlerRuntimeLoadPipeline.ts
86535
- var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
86689
+ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
86536
86690
  async buildLoadData(presentationState, slidesWithWarnings, slideMasters) {
86537
86691
  const headerFooter = this.extractHeaderFooter();
86538
86692
  const presentationProperties = await this.parsePresentationProperties();
@@ -87030,7 +87184,7 @@ function refIndex(node) {
87030
87184
  const idx = Number.parseInt(String(node["@_idx"] ?? ""), 10);
87031
87185
  return Number.isFinite(idx) ? idx : void 0;
87032
87186
  }
87033
- var PptxHandlerRuntime100 = class extends PptxHandlerRuntime99 {
87187
+ var PptxHandlerRuntime102 = class extends PptxHandlerRuntime101 {
87034
87188
  /**
87035
87189
  * Resolve a `<p:style>` node (`a:lnRef`, `a:fillRef`, `a:effectRef`,
87036
87190
  * `a:fontRef`) against the current theme's format scheme, with the same
@@ -87093,8 +87247,10 @@ function withKeys(style, from, keys) {
87093
87247
  function refNode(idx, colorXml2) {
87094
87248
  return { "@_idx": String(idx), ...colorXml2 ?? {} };
87095
87249
  }
87096
- var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
87250
+ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
87097
87251
  effectSchemeCache = /* @__PURE__ */ new Map();
87252
+ /** Every `a:fmtScheme` written into a theme part or over one ({@link restoreThemeFormatScheme}). */
87253
+ heldFormatSchemes = new HeldFormatSchemes();
87098
87254
  /**
87099
87255
  * Resolve a `<p:style>` node as the base class does, against built-in effect scheme
87100
87256
  * `effectSchemeId` instead of the deck's own (the Effects gallery draws each tile this way).
@@ -87147,32 +87303,79 @@ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
87147
87303
  */
87148
87304
  async applyThemeFormatSchemeXml(fmtSchemeXml) {
87149
87305
  const parsed = this.parseEffectScheme({ fmtSchemeXml });
87150
- if (!parsed) {
87151
- return void 0;
87306
+ return parsed ? this.writeFormatScheme(() => parsed.node) : void 0;
87307
+ }
87308
+ /**
87309
+ * Put back a format scheme the deck held before (Undo and Redo of an Effects pick), as the parts
87310
+ * held it: each theme part a master references gets back what it held the last time the deck's
87311
+ * scheme was `scheme` over those same parts, so a part with a scheme of its own gets its own back
87312
+ * (with no such time, `scheme`'s own element goes into every one). With `themePaths`, `scheme`'s
87313
+ * own element goes into those parts only.
87314
+ *
87315
+ * @returns the deck's format scheme now, or `undefined` (nothing written) for a scheme no part
87316
+ * held while this handler wrote into it
87317
+ */
87318
+ async restoreThemeFormatScheme(scheme, themePaths) {
87319
+ const parts = themePaths ? void 0 : this.heldFormatSchemes.parts(scheme, await this.resolveThemeEditTargets());
87320
+ if (parts) {
87321
+ return this.writeFormatScheme((path3) => parts.get(path3));
87152
87322
  }
87153
- const written = await this.rewriteThemeParts(void 0, (data) => {
87323
+ const element = this.heldFormatSchemes.element(scheme);
87324
+ return element ? this.writeFormatScheme(() => element, themePaths) : void 0;
87325
+ }
87326
+ /**
87327
+ * Write `elementFor(part)` into every theme part a master references (or only `themePaths`),
87328
+ * skipping a part it gives none, holding what each part held and now holds, and refresh the
87329
+ * in-memory format schemes of the masters on those parts and, when the deck's part is among
87330
+ * them, the deck's.
87331
+ */
87332
+ async writeFormatScheme(elementFor, themePaths) {
87333
+ const deckBefore = this.getThemeFormatScheme();
87334
+ const replaced = /* @__PURE__ */ new Map();
87335
+ const schemes = /* @__PURE__ */ new Map();
87336
+ const written = await this.rewriteThemeParts(themePaths, (data, path3) => {
87337
+ const element = elementFor(path3);
87154
87338
  const elements2 = data["a:theme"]?.["a:themeElements"];
87155
- if (!elements2) {
87339
+ if (!element || !elements2) {
87156
87340
  return false;
87157
87341
  }
87158
- elements2["a:fmtScheme"] = structuredClone(parsed.node);
87342
+ const previous = elements2["a:fmtScheme"];
87343
+ if (previous) {
87344
+ this.heldFormatSchemes.hold(this.parseFormatScheme(previous), previous);
87345
+ replaced.set(path3, structuredClone(previous));
87346
+ }
87347
+ const scheme = this.parseFormatScheme(element);
87348
+ this.heldFormatSchemes.hold(scheme, element);
87349
+ elements2["a:fmtScheme"] = structuredClone(element);
87350
+ schemes.set(path3, scheme);
87159
87351
  return true;
87160
87352
  });
87161
87353
  if (written.length === 0) {
87162
87354
  return void 0;
87163
87355
  }
87356
+ if (deckBefore) {
87357
+ this.heldFormatSchemes.holdParts(deckBefore, replaced);
87358
+ }
87164
87359
  for (const path3 of written) {
87165
87360
  const xml = await this.zip.file(path3)?.async("string");
87166
87361
  if (xml !== void 0) {
87167
87362
  this.originalThemeXmlByPath.set(path3, xml);
87168
87363
  }
87364
+ for (const masterPath of this.mastersUsingThemes([path3])) {
87365
+ this.masterThemeFormatSchemes.set(masterPath, schemes.get(path3));
87366
+ }
87169
87367
  }
87170
- for (const masterPath of this.mastersUsingThemes(written)) {
87171
- this.masterThemeFormatSchemes.set(masterPath, parsed.scheme);
87368
+ const primary = await this.resolvePrimaryThemePath();
87369
+ const deck = primary === void 0 ? void 0 : schemes.get(primary);
87370
+ if (deck) {
87371
+ this.globalThemeFormatSchemeSnapshot = deck;
87372
+ this.themeFormatScheme = deck;
87373
+ this.heldFormatSchemes.holdParts(
87374
+ deck,
87375
+ new Map(written.map((path3) => [path3, elementFor(path3)]))
87376
+ );
87172
87377
  }
87173
- this.globalThemeFormatSchemeSnapshot = parsed.scheme;
87174
- this.themeFormatScheme = parsed.scheme;
87175
- return parsed.scheme;
87378
+ return this.getThemeFormatScheme();
87176
87379
  }
87177
87380
  /** The real theme variants the loaded package carries, or none. */
87178
87381
  getThemeVariants() {
@@ -87296,7 +87499,7 @@ function schemeFromColorMap(map) {
87296
87499
  folHlink: pick("folHlink")
87297
87500
  };
87298
87501
  }
87299
- var PptxHandlerRuntime102 = class extends PptxHandlerRuntime101 {
87502
+ var PptxHandlerRuntime104 = class extends PptxHandlerRuntime103 {
87300
87503
  resolveBackgroundStyle(preset) {
87301
87504
  const xml = {
87302
87505
  "p:sld": { "p:cSld": { "p:bg": backgroundRefNode(preset.idx, preset.scheme) } }
@@ -87545,7 +87748,7 @@ function applyPlaceholderFrame(shape, inherited, options, emuPerPx, materializeF
87545
87748
  }
87546
87749
 
87547
87750
  // pptx/core/core/runtime/PptxHandlerRuntimeSdkPlaceholders.ts
87548
- var PptxHandlerRuntime103 = class _PptxHandlerRuntime extends PptxHandlerRuntime102 {
87751
+ var PptxHandlerRuntime105 = class _PptxHandlerRuntime extends PptxHandlerRuntime104 {
87549
87752
  createPlaceholderElement(layoutPath, input, type, options) {
87550
87753
  if (input.type !== "text") throw new Error("Placeholder input must be text");
87551
87754
  const layout = this.layoutXmlMap.get(layoutPath);
@@ -87599,7 +87802,7 @@ var PptxHandlerRuntime103 = class _PptxHandlerRuntime extends PptxHandlerRuntime
87599
87802
  };
87600
87803
 
87601
87804
  // pptx/core/core/runtime/PptxHandlerRuntimeImplementation.ts
87602
- var PptxHandlerRuntime104 = class _PptxHandlerRuntime extends PptxHandlerRuntime103 {
87805
+ var PptxHandlerRuntime106 = class _PptxHandlerRuntime extends PptxHandlerRuntime105 {
87603
87806
  constructor(dependencyFactory = new PptxRuntimeDependencyFactory()) {
87604
87807
  super();
87605
87808
  this.dependencyFactory = dependencyFactory;
@@ -87737,11 +87940,11 @@ var PptxHandlerRuntime104 = class _PptxHandlerRuntime extends PptxHandlerRuntime
87737
87940
  };
87738
87941
 
87739
87942
  // pptx/core/core/PptxHandlerRuntime.ts
87740
- var PptxHandlerRuntime105 = class extends PptxHandlerRuntime104 {
87943
+ var PptxHandlerRuntime107 = class extends PptxHandlerRuntime106 {
87741
87944
  };
87742
87945
 
87743
87946
  // pptx/core/core/PptxHandlerRuntimeFactory.ts
87744
- var createDefaultPptxHandlerRuntime = () => new PptxHandlerRuntime105();
87947
+ var createDefaultPptxHandlerRuntime = () => new PptxHandlerRuntime107();
87745
87948
 
87746
87949
  // pptx/core/ppt/current-user.ts
87747
87950
  var EncryptedPptError = class extends Error {
@@ -90632,10 +90835,32 @@ var PptxHandlerCore = class {
90632
90835
  async setPresentationTheme(themePath, applyToAllMasters = true) {
90633
90836
  await this.runtime.setPresentationTheme(themePath, applyToAllMasters);
90634
90837
  }
90838
+ /**
90839
+ * Point one slide master at a theme part already in the package; scheme edits and saves follow
90840
+ * it. Does nothing when the package has no such master or part.
90841
+ *
90842
+ * @param masterPath - The master's part path (e.g. `ppt/slideMasters/slideMaster2.xml`).
90843
+ * @param themePath - The theme part's path (e.g. `ppt/theme/theme1.xml`).
90844
+ */
90845
+ async setSlideMasterTheme(masterPath, themePath) {
90846
+ await this.runtime.setSlideMasterTheme(masterPath, themePath);
90847
+ }
90848
+ /**
90849
+ * Read one theme part's colour, font and format schemes and its name without changing the
90850
+ * loaded theme, for example to show what switching to it would apply.
90851
+ *
90852
+ * @param themePath - The theme part's path (e.g. `ppt/theme/theme2.xml`).
90853
+ * @returns The part's schemes, or `undefined` when the package has no such part.
90854
+ */
90855
+ async getThemePartSchemes(themePath) {
90856
+ return this.runtime.getThemePartSchemes(themePath);
90857
+ }
90635
90858
  /**
90636
90859
  * Modify the theme’s colour scheme (accent colours, background, text, etc.).
90637
90860
  *
90638
90861
  * @param colorScheme - A {@link PptxThemeColorScheme} with hex colour values.
90862
+ * @param themePaths - Only these theme parts (e.g. `ppt/theme/theme2.xml`); every part a slide
90863
+ * master uses when omitted.
90639
90864
  *
90640
90865
  * @example
90641
90866
  * ```ts
@@ -90648,13 +90873,15 @@ var PptxHandlerCore = class {
90648
90873
  * // => void — colour scheme updated in the in-memory theme XML
90649
90874
  * ```
90650
90875
  */
90651
- async updateThemeColorScheme(colorScheme) {
90652
- await this.runtime.updateThemeColorScheme(colorScheme);
90876
+ async updateThemeColorScheme(colorScheme, themePaths) {
90877
+ await this.runtime.updateThemeColorScheme(colorScheme, themePaths);
90653
90878
  }
90654
90879
  /**
90655
90880
  * Update the theme’s font scheme (heading + body typefaces).
90656
90881
  *
90657
90882
  * @param fontScheme - A {@link PptxThemeFontScheme} with font family names.
90883
+ * @param themePaths - Only these theme parts (e.g. `ppt/theme/theme2.xml`); every part a slide
90884
+ * master uses when omitted.
90658
90885
  *
90659
90886
  * @example
90660
90887
  * ```ts
@@ -90665,16 +90892,18 @@ var PptxHandlerCore = class {
90665
90892
  * // => void — font scheme updated in the in-memory theme XML
90666
90893
  * ```
90667
90894
  */
90668
- async updateThemeFontScheme(fontScheme) {
90669
- await this.runtime.updateThemeFontScheme(fontScheme);
90895
+ async updateThemeFontScheme(fontScheme, themePaths) {
90896
+ await this.runtime.updateThemeFontScheme(fontScheme, themePaths);
90670
90897
  }
90671
90898
  /**
90672
90899
  * Rename the presentation theme.
90673
90900
  *
90674
90901
  * @param name - New display name for the theme.
90902
+ * @param themePaths - Only these theme parts (e.g. `ppt/theme/theme2.xml`); every part a slide
90903
+ * master uses when omitted.
90675
90904
  */
90676
- async updateThemeName(name) {
90677
- await this.runtime.updateThemeName(name);
90905
+ async updateThemeName(name, themePaths) {
90906
+ await this.runtime.updateThemeName(name, themePaths);
90678
90907
  }
90679
90908
  /**
90680
90909
  * Resolve a `<p:style>` block (`a:lnRef` / `a:fillRef` / `a:effectRef` /
@@ -90697,6 +90926,14 @@ var PptxHandlerCore = class {
90697
90926
  async applyThemeFormatSchemeXml(fmtSchemeXml) {
90698
90927
  return this.runtime.applyThemeFormatSchemeXml(fmtSchemeXml);
90699
90928
  }
90929
+ /**
90930
+ * Put a format scheme a theme part held before back into the theme parts (or only `themePaths`),
90931
+ * as the part held it: Undo and Redo of an Effects pick. Only a scheme this handler wrote into a
90932
+ * part or over one can come back; for any other it writes nothing and returns `undefined`.
90933
+ */
90934
+ async restoreThemeFormatScheme(scheme, themePaths) {
90935
+ return this.runtime.restoreThemeFormatScheme(scheme, themePaths);
90936
+ }
90700
90937
  /** The real theme variants the loaded package carries (`themeVariants/` parts), or none. */
90701
90938
  getThemeVariants() {
90702
90939
  return this.runtime.getThemeVariants();