@paperjsx/json-to-pptx-pro 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +69 -0
- package/dist-pro/accessibilityRemediation-JCCWTNLI.js +1 -0
- package/dist-pro/accessibilityValidator-PNPHJ7DT.js +1 -0
- package/dist-pro/chunk-4BFWRWGW.js +1 -0
- package/dist-pro/chunk-54L7UJFX.js +1 -0
- package/dist-pro/chunk-7MQHUWBC.js +1 -0
- package/dist-pro/chunk-7OH2BCHB.js +1 -0
- package/dist-pro/chunk-ATW2DQGN.js +1 -0
- package/dist-pro/chunk-AU5HXCGI.js +1 -0
- package/dist-pro/chunk-BRMIGHX5.js +1 -0
- package/dist-pro/chunk-CEEMFICV.js +2138 -0
- package/dist-pro/chunk-CT3ZL3KD.js +1 -0
- package/dist-pro/chunk-D33P4D2I.js +1 -0
- package/dist-pro/chunk-DIB2EOON.js +40 -0
- package/dist-pro/chunk-HGXLLLMM.js +1 -0
- package/dist-pro/chunk-HI4JFT7W.js +1 -0
- package/dist-pro/chunk-HKVBMVGH.js +2 -0
- package/dist-pro/chunk-IQQAF6DF.js +1 -0
- package/dist-pro/chunk-JBV3SHHJ.js +1 -0
- package/dist-pro/chunk-JKZFYDBI.js +1 -0
- package/dist-pro/chunk-KITDCLGP.js +1 -0
- package/dist-pro/chunk-N7MH4LUH.js +1 -0
- package/dist-pro/chunk-NBTN5HDS.js +16 -0
- package/dist-pro/chunk-OLTONCQC.js +1 -0
- package/dist-pro/chunk-QCSPOFAH.js +1 -0
- package/dist-pro/chunk-QLDFKBHR.js +1 -0
- package/dist-pro/chunk-RDC4FC4R.js +1 -0
- package/dist-pro/chunk-RS6UVNDG.js +1 -0
- package/dist-pro/chunk-RYAMBRNH.js +1 -0
- package/dist-pro/chunk-SUQ4PGPT.js +37 -0
- package/dist-pro/chunk-UXO6SOIA.js +3 -0
- package/dist-pro/chunk-UYCBIQVO.js +4 -0
- package/dist-pro/chunk-VGZBBSUY.js +1 -0
- package/dist-pro/chunk-VR7UEGNY.js +1 -0
- package/dist-pro/chunk-WOT6VMZA.js +1 -0
- package/dist-pro/chunk-XRJXR3CS.js +1 -0
- package/dist-pro/chunk-YFMEN6A3.js +4 -0
- package/dist-pro/constants-M7ZVYTHA.js +1 -0
- package/dist-pro/converter/pptx-to-pdf.js +76 -0
- package/dist-pro/engine/archiveAssembler.js +1 -0
- package/dist-pro/engine/previewGenerator.js +1 -0
- package/dist-pro/engine/templateMutator.js +1 -0
- package/dist-pro/index.js +1 -0
- package/dist-pro/layout/index.js +1 -0
- package/dist-pro/public/engine.js +1 -0
- package/dist-pro/public/interpreter.js +1 -0
- package/dist-pro/public/quality.js +1 -0
- package/dist-pro/public/renderer.js +1 -0
- package/dist-pro/public/validator.js +1 -0
- package/dist-pro/rasterizer-O3LV7S73.js +1 -0
- package/dist-pro/renderer/index.js +1 -0
- package/dist-pro/src-6P7ZCHQN.js +23 -0
- package/dist-pro/svg/exporter.js +1 -0
- package/dist-pro/types/core/src/compatibility/pptxCompatibility.d.ts +19 -0
- package/dist-pro/types/core/src/compatibility/pptxCompatibility.d.ts.map +1 -0
- package/dist-pro/types/core/src/compatibility/shared.d.ts +52 -0
- package/dist-pro/types/core/src/compatibility/shared.d.ts.map +1 -0
- package/dist-pro/types/core/src/contextStorage.d.ts +21 -0
- package/dist-pro/types/core/src/contextStorage.d.ts.map +1 -0
- package/dist-pro/types/core/src/converter/pptx-to-pdf.d.ts +11 -0
- package/dist-pro/types/core/src/converter/pptx-to-pdf.d.ts.map +1 -0
- package/dist-pro/types/core/src/deterministicMode.d.ts +13 -0
- package/dist-pro/types/core/src/deterministicMode.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/cycle.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/cycle.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/hierarchy.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/hierarchy.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/index.d.ts +14 -0
- package/dist-pro/types/core/src/diagrams/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/list.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/list.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/matrix.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/matrix.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/processFlow.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/processFlow.d.ts.map +1 -0
- package/dist-pro/types/core/src/diagrams/pyramid.d.ts +3 -0
- package/dist-pro/types/core/src/diagrams/pyramid.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/archiveAssembler.d.ts +34 -0
- package/dist-pro/types/core/src/engine/archiveAssembler.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/documentValidation.d.ts +3 -0
- package/dist-pro/types/core/src/engine/documentValidation.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/previewGenerator.d.ts +9 -0
- package/dist-pro/types/core/src/engine/previewGenerator.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/slideProcessor.d.ts +54 -0
- package/dist-pro/types/core/src/engine/slideProcessor.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/templateMutator.d.ts +13 -0
- package/dist-pro/types/core/src/engine/templateMutator.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine/templatePreflight.d.ts +5 -0
- package/dist-pro/types/core/src/engine/templatePreflight.d.ts.map +1 -0
- package/dist-pro/types/core/src/engine.d.ts +80 -0
- package/dist-pro/types/core/src/engine.d.ts.map +1 -0
- package/dist-pro/types/core/src/engineMode.d.ts +14 -0
- package/dist-pro/types/core/src/engineMode.d.ts.map +1 -0
- package/dist-pro/types/core/src/errors.d.ts +37 -0
- package/dist-pro/types/core/src/errors.d.ts.map +1 -0
- package/dist-pro/types/core/src/feature-gate.d.ts +18 -0
- package/dist-pro/types/core/src/feature-gate.d.ts.map +1 -0
- package/dist-pro/types/core/src/fetchRetry.d.ts +6 -0
- package/dist-pro/types/core/src/fetchRetry.d.ts.map +1 -0
- package/dist-pro/types/core/src/index-lite.d.ts +2 -0
- package/dist-pro/types/core/src/index-lite.d.ts.map +1 -0
- package/dist-pro/types/core/src/index.d.ts +69 -0
- package/dist-pro/types/core/src/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/interpreter/agentSchema.d.ts +145 -0
- package/dist-pro/types/core/src/interpreter/agentSchema.d.ts.map +1 -0
- package/dist-pro/types/core/src/interpreter/index.d.ts +7 -0
- package/dist-pro/types/core/src/interpreter/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/interpreter/interpreter.d.ts +17 -0
- package/dist-pro/types/core/src/interpreter/interpreter.d.ts.map +1 -0
- package/dist-pro/types/core/src/interpreter/slideSplitter.d.ts +22 -0
- package/dist-pro/types/core/src/interpreter/slideSplitter.d.ts.map +1 -0
- package/dist-pro/types/core/src/interpreter/templates.d.ts +12 -0
- package/dist-pro/types/core/src/interpreter/templates.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/build.d.ts +9 -0
- package/dist-pro/types/core/src/layout/build.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/extract.d.ts +27 -0
- package/dist-pro/types/core/src/layout/extract.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/ghostGrid.d.ts +10 -0
- package/dist-pro/types/core/src/layout/ghostGrid.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/index.d.ts +9 -0
- package/dist-pro/types/core/src/layout/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/measureBridge.d.ts +12 -0
- package/dist-pro/types/core/src/layout/measureBridge.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/traverse.d.ts +8 -0
- package/dist-pro/types/core/src/layout/traverse.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/visualOrder.d.ts +16 -0
- package/dist-pro/types/core/src/layout/visualOrder.d.ts.map +1 -0
- package/dist-pro/types/core/src/layout/yoga.d.ts +6 -0
- package/dist-pro/types/core/src/layout/yoga.d.ts.map +1 -0
- package/dist-pro/types/core/src/license.d.ts +17 -0
- package/dist-pro/types/core/src/license.d.ts.map +1 -0
- package/dist-pro/types/core/src/logger.d.ts +23 -0
- package/dist-pro/types/core/src/logger.d.ts.map +1 -0
- package/dist-pro/types/core/src/normalizer.d.ts +12 -0
- package/dist-pro/types/core/src/normalizer.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/animationBehaviors.d.ts +22 -0
- package/dist-pro/types/core/src/ooxml/animationBehaviors.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/animationEffects.d.ts +21 -0
- package/dist-pro/types/core/src/ooxml/animationEffects.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/animationTypes.d.ts +27 -0
- package/dist-pro/types/core/src/ooxml/animationTypes.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartCapabilities.d.ts +24 -0
- package/dist-pro/types/core/src/ooxml/chart/chartCapabilities.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartColorResolver.d.ts +12 -0
- package/dist-pro/types/core/src/ooxml/chart/chartColorResolver.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartExXml.d.ts +17 -0
- package/dist-pro/types/core/src/ooxml/chart/chartExXml.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartLayout.d.ts +39 -0
- package/dist-pro/types/core/src/ooxml/chart/chartLayout.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartRels.d.ts +16 -0
- package/dist-pro/types/core/src/ooxml/chart/chartRels.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXml.d.ts +9 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXml.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlAxes.d.ts +15 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlAxes.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlClassic.d.ts +10 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlClassic.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlDecor.d.ts +8 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlDecor.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlSeries.d.ts +11 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlSeries.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlShared.d.ts +9 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlShared.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlSpecial.d.ts +5 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlSpecial.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlXY.d.ts +4 -0
- package/dist-pro/types/core/src/ooxml/chart/chartXmlXY.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/excelEmitter.d.ts +9 -0
- package/dist-pro/types/core/src/ooxml/chart/excelEmitter.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/index.d.ts +51 -0
- package/dist-pro/types/core/src/ooxml/chart/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/pvceRenderer.d.ts +9 -0
- package/dist-pro/types/core/src/ooxml/chart/pvceRenderer.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/rasterizer.d.ts +30 -0
- package/dist-pro/types/core/src/ooxml/chart/rasterizer.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/chart/waterfallCompat.d.ts +3 -0
- package/dist-pro/types/core/src/ooxml/chart/waterfallCompat.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/colorXml.d.ts +11 -0
- package/dist-pro/types/core/src/ooxml/colorXml.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/comments.d.ts +24 -0
- package/dist-pro/types/core/src/ooxml/comments.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/constants.d.ts +25 -0
- package/dist-pro/types/core/src/ooxml/constants.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/contentTypes.d.ts +2 -0
- package/dist-pro/types/core/src/ooxml/contentTypes.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/customProps.d.ts +6 -0
- package/dist-pro/types/core/src/ooxml/customProps.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/deterministicIds.d.ts +2 -0
- package/dist-pro/types/core/src/ooxml/deterministicIds.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/docProps.d.ts +11 -0
- package/dist-pro/types/core/src/ooxml/docProps.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/autoFitPolicy.d.ts +17 -0
- package/dist-pro/types/core/src/ooxml/drawing/autoFitPolicy.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/chart.d.ts +23 -0
- package/dist-pro/types/core/src/ooxml/drawing/chart.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/connector.d.ts +3 -0
- package/dist-pro/types/core/src/ooxml/drawing/connector.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/geometry.d.ts +3 -0
- package/dist-pro/types/core/src/ooxml/drawing/geometry.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/image.d.ts +8 -0
- package/dist-pro/types/core/src/ooxml/drawing/image.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/math.d.ts +60 -0
- package/dist-pro/types/core/src/ooxml/drawing/math.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/orchestrator.d.ts +72 -0
- package/dist-pro/types/core/src/ooxml/drawing/orchestrator.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/shape.d.ts +8 -0
- package/dist-pro/types/core/src/ooxml/drawing/shape.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/table.d.ts +8 -0
- package/dist-pro/types/core/src/ooxml/drawing/table.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/text.d.ts +14 -0
- package/dist-pro/types/core/src/ooxml/drawing/text.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/textUtils.d.ts +56 -0
- package/dist-pro/types/core/src/ooxml/drawing/textUtils.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/webVideo.d.ts +12 -0
- package/dist-pro/types/core/src/ooxml/drawing/webVideo.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/drawing/xmlEscape.d.ts +7 -0
- package/dist-pro/types/core/src/ooxml/drawing/xmlEscape.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/fontEmbed.d.ts +30 -0
- package/dist-pro/types/core/src/ooxml/fontEmbed.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/handoutMaster.d.ts +10 -0
- package/dist-pro/types/core/src/ooxml/handoutMaster.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/media.d.ts +108 -0
- package/dist-pro/types/core/src/ooxml/media.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/packageParts.d.ts +15 -0
- package/dist-pro/types/core/src/ooxml/packageParts.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/presentation.d.ts +13 -0
- package/dist-pro/types/core/src/ooxml/presentation.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/presentationOrder.d.ts +5 -0
- package/dist-pro/types/core/src/ooxml/presentationOrder.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/rIdCalc.d.ts +46 -0
- package/dist-pro/types/core/src/ooxml/rIdCalc.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/relationships.d.ts +7 -0
- package/dist-pro/types/core/src/ooxml/relationships.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/slide.d.ts +32 -0
- package/dist-pro/types/core/src/ooxml/slide.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/slideRelationships.d.ts +51 -0
- package/dist-pro/types/core/src/ooxml/slideRelationships.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/theme.d.ts +4 -0
- package/dist-pro/types/core/src/ooxml/theme.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/timing.d.ts +7 -0
- package/dist-pro/types/core/src/ooxml/timing.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/transition.d.ts +3 -0
- package/dist-pro/types/core/src/ooxml/transition.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/urlGuard.d.ts +27 -0
- package/dist-pro/types/core/src/ooxml/urlGuard.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/webVideoDetect.d.ts +10 -0
- package/dist-pro/types/core/src/ooxml/webVideoDetect.d.ts.map +1 -0
- package/dist-pro/types/core/src/ooxml/zipper.d.ts +64 -0
- package/dist-pro/types/core/src/ooxml/zipper.d.ts.map +1 -0
- package/dist-pro/types/core/src/public/engine.d.ts +12 -0
- package/dist-pro/types/core/src/public/engine.d.ts.map +1 -0
- package/dist-pro/types/core/src/public/interpreter.d.ts +3 -0
- package/dist-pro/types/core/src/public/interpreter.d.ts.map +1 -0
- package/dist-pro/types/core/src/public/quality.d.ts +12 -0
- package/dist-pro/types/core/src/public/quality.d.ts.map +1 -0
- package/dist-pro/types/core/src/public/renderer.d.ts +3 -0
- package/dist-pro/types/core/src/public/renderer.d.ts.map +1 -0
- package/dist-pro/types/core/src/public/validator.d.ts +2 -0
- package/dist-pro/types/core/src/public/validator.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/accessibility-contract.d.ts +46 -0
- package/dist-pro/types/core/src/quality/accessibility-contract.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/accessibilityRemediation.d.ts +10 -0
- package/dist-pro/types/core/src/quality/accessibilityRemediation.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/accessibilityValidator.d.ts +32 -0
- package/dist-pro/types/core/src/quality/accessibilityValidator.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/chartInventory.d.ts +20 -0
- package/dist-pro/types/core/src/quality/chartInventory.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/corpus.d.ts +17 -0
- package/dist-pro/types/core/src/quality/corpus.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/document-diff.d.ts +5 -0
- package/dist-pro/types/core/src/quality/document-diff.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/packageDiff.d.ts +10 -0
- package/dist-pro/types/core/src/quality/packageDiff.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/public-quality-types.d.ts +11 -0
- package/dist-pro/types/core/src/quality/public-quality-types.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/repair.d.ts +23 -0
- package/dist-pro/types/core/src/quality/repair.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/report.d.ts +137 -0
- package/dist-pro/types/core/src/quality/report.d.ts.map +1 -0
- package/dist-pro/types/core/src/quality/structuralValidation.d.ts +3 -0
- package/dist-pro/types/core/src/quality/structuralValidation.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderContext.d.ts +45 -0
- package/dist-pro/types/core/src/renderContext.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasAsync.d.ts +6 -0
- package/dist-pro/types/core/src/renderer/canvasAsync.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasEffects.d.ts +10 -0
- package/dist-pro/types/core/src/renderer/canvasEffects.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasPlaceholders.d.ts +8 -0
- package/dist-pro/types/core/src/renderer/canvasPlaceholders.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasRenderer.d.ts +10 -0
- package/dist-pro/types/core/src/renderer/canvasRenderer.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasShapes.d.ts +4 -0
- package/dist-pro/types/core/src/renderer/canvasShapes.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasTable.d.ts +5 -0
- package/dist-pro/types/core/src/renderer/canvasTable.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/canvasText.d.ts +9 -0
- package/dist-pro/types/core/src/renderer/canvasText.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/colorResolver.d.ts +16 -0
- package/dist-pro/types/core/src/renderer/colorResolver.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/fontBridge.d.ts +28 -0
- package/dist-pro/types/core/src/renderer/fontBridge.d.ts.map +1 -0
- package/dist-pro/types/core/src/renderer/index.d.ts +43 -0
- package/dist-pro/types/core/src/renderer/index.d.ts.map +1 -0
- package/dist-pro/types/core/src/svg/exporter.d.ts +9 -0
- package/dist-pro/types/core/src/svg/exporter.d.ts.map +1 -0
- package/dist-pro/types/core/src/svg/shapePaths.d.ts +11 -0
- package/dist-pro/types/core/src/svg/shapePaths.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/layoutMapper.d.ts +17 -0
- package/dist-pro/types/core/src/template/layoutMapper.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/mutator.d.ts +45 -0
- package/dist-pro/types/core/src/template/mutator.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/parser.d.ts +75 -0
- package/dist-pro/types/core/src/template/parser.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/placeholderInjector.d.ts +11 -0
- package/dist-pro/types/core/src/template/placeholderInjector.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/themeResolver.d.ts +47 -0
- package/dist-pro/types/core/src/template/themeResolver.d.ts.map +1 -0
- package/dist-pro/types/core/src/template/xmlParser.d.ts +11 -0
- package/dist-pro/types/core/src/template/xmlParser.d.ts.map +1 -0
- package/dist-pro/types/core/src/types/ast.d.ts +1090 -0
- package/dist-pro/types/core/src/types/ast.d.ts.map +1 -0
- package/dist-pro/types/core/src/types/literals.d.ts +20 -0
- package/dist-pro/types/core/src/types/literals.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/autoFit.d.ts +32 -0
- package/dist-pro/types/core/src/typography/autoFit.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/autoFont.d.ts +3 -0
- package/dist-pro/types/core/src/typography/autoFont.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/bidi.d.ts +9 -0
- package/dist-pro/types/core/src/typography/bidi.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/fontCache.d.ts +30 -0
- package/dist-pro/types/core/src/typography/fontCache.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/fontFallback.d.ts +29 -0
- package/dist-pro/types/core/src/typography/fontFallback.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/fontPaths.d.ts +18 -0
- package/dist-pro/types/core/src/typography/fontPaths.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/harfbuzzLoader.d.ts +26 -0
- package/dist-pro/types/core/src/typography/harfbuzzLoader.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/knuthPlass.d.ts +36 -0
- package/dist-pro/types/core/src/typography/knuthPlass.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/metrics.d.ts +20 -0
- package/dist-pro/types/core/src/typography/metrics.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/richMetrics.d.ts +13 -0
- package/dist-pro/types/core/src/typography/richMetrics.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/segmentCache.d.ts +42 -0
- package/dist-pro/types/core/src/typography/segmentCache.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/shaper.d.ts +15 -0
- package/dist-pro/types/core/src/typography/shaper.d.ts.map +1 -0
- package/dist-pro/types/core/src/typography/tableAutoSize.d.ts +10 -0
- package/dist-pro/types/core/src/typography/tableAutoSize.d.ts.map +1 -0
- package/dist-pro/types/core/src/validator/schema.d.ts +3143 -0
- package/dist-pro/types/core/src/validator/schema.d.ts.map +1 -0
- package/dist-pro/types/core/src/zIndex.d.ts +20 -0
- package/dist-pro/types/core/src/zIndex.d.ts.map +1 -0
- package/dist-pro/types/document-diff/src/index.d.ts +50 -0
- package/dist-pro/types/document-diff/src/index.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/encryption/pdf-encrypt.d.ts +3 -0
- package/dist-pro/types/json-to-pdf/src/encryption/pdf-encrypt.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/encryption/permissions.d.ts +9 -0
- package/dist-pro/types/json-to-pdf/src/encryption/permissions.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/encryption/types.d.ts +24 -0
- package/dist-pro/types/json-to-pdf/src/encryption/types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/engine.d.ts +64 -0
- package/dist-pro/types/json-to-pdf/src/engine.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/font-embedding.d.ts +92 -0
- package/dist-pro/types/json-to-pdf/src/font-embedding.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/font-source.d.ts +12 -0
- package/dist-pro/types/json-to-pdf/src/font-source.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/harfbuzz.d.ts +14 -0
- package/dist-pro/types/json-to-pdf/src/harfbuzz.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/helvetica-widths.d.ts +13 -0
- package/dist-pro/types/json-to-pdf/src/helvetica-widths.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/image-embedding.d.ts +31 -0
- package/dist-pro/types/json-to-pdf/src/image-embedding.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/index.d.ts +36 -0
- package/dist-pro/types/json-to-pdf/src/index.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pdf-form-fill.d.ts +38 -0
- package/dist-pro/types/json-to-pdf/src/pdf-form-fill.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pdf-objects.d.ts +42 -0
- package/dist-pro/types/json-to-pdf/src/pdf-objects.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pdf-renderer.d.ts +216 -0
- package/dist-pro/types/json-to-pdf/src/pdf-renderer.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pdf-writer.d.ts +13 -0
- package/dist-pro/types/json-to-pdf/src/pdf-writer.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pdfa/srgb-icc-profile.d.ts +2 -0
- package/dist-pro/types/json-to-pdf/src/pdfa/srgb-icc-profile.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase10-quality.d.ts +3 -0
- package/dist-pro/types/json-to-pdf/src/phase10-quality.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase10-repair.d.ts +4 -0
- package/dist-pro/types/json-to-pdf/src/phase10-repair.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase10-signature.d.ts +17 -0
- package/dist-pro/types/json-to-pdf/src/phase10-signature.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase10-types.d.ts +106 -0
- package/dist-pro/types/json-to-pdf/src/phase10-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase10-validate.d.ts +28 -0
- package/dist-pro/types/json-to-pdf/src/phase10-validate.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase3-linebreak.d.ts +18 -0
- package/dist-pro/types/json-to-pdf/src/phase3-linebreak.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase3-render.d.ts +113 -0
- package/dist-pro/types/json-to-pdf/src/phase3-render.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase3-types.d.ts +115 -0
- package/dist-pro/types/json-to-pdf/src/phase3-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase4-types.d.ts +106 -0
- package/dist-pro/types/json-to-pdf/src/phase4-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase5-table-layout.d.ts +37 -0
- package/dist-pro/types/json-to-pdf/src/phase5-table-layout.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase5-types.d.ts +60 -0
- package/dist-pro/types/json-to-pdf/src/phase5-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase6-analyze.d.ts +51 -0
- package/dist-pro/types/json-to-pdf/src/phase6-analyze.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase6-types.d.ts +149 -0
- package/dist-pro/types/json-to-pdf/src/phase6-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase7-analyze.d.ts +16 -0
- package/dist-pro/types/json-to-pdf/src/phase7-analyze.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase7-types.d.ts +46 -0
- package/dist-pro/types/json-to-pdf/src/phase7-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase8-analyze.d.ts +4 -0
- package/dist-pro/types/json-to-pdf/src/phase8-analyze.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase8-types.d.ts +16 -0
- package/dist-pro/types/json-to-pdf/src/phase8-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase9-stream.d.ts +5 -0
- package/dist-pro/types/json-to-pdf/src/phase9-stream.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/phase9-types.d.ts +11 -0
- package/dist-pro/types/json-to-pdf/src/phase9-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/pro-guard.d.ts +5 -0
- package/dist-pro/types/json-to-pdf/src/pro-guard.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/public-quality-types.d.ts +44 -0
- package/dist-pro/types/json-to-pdf/src/public-quality-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/shared-quality.d.ts +4 -0
- package/dist-pro/types/json-to-pdf/src/shared-quality.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/svg.d.ts +4 -0
- package/dist-pro/types/json-to-pdf/src/svg.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/vendor-types.d.ts +37 -0
- package/dist-pro/types/json-to-pdf/src/vendor-types.d.ts.map +1 -0
- package/dist-pro/types/json-to-pdf/src/winansi-encoding.d.ts +26 -0
- package/dist-pro/types/json-to-pdf/src/winansi-encoding.d.ts.map +1 -0
- package/dist-pro/types/license/src/errors.d.ts +11 -0
- package/dist-pro/types/license/src/errors.d.ts.map +1 -0
- package/dist-pro/types/license/src/index.d.ts +5 -0
- package/dist-pro/types/license/src/index.d.ts.map +1 -0
- package/dist-pro/types/license/src/license.d.ts +16 -0
- package/dist-pro/types/license/src/license.d.ts.map +1 -0
- package/dist-pro/types/license/src/quality.d.ts +44 -0
- package/dist-pro/types/license/src/quality.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/accessibility.d.ts +102 -0
- package/dist-pro/types/pvce/src/charts/accessibility.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/collision-solver.d.ts +97 -0
- package/dist-pro/types/pvce/src/charts/collision-solver.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/color-pipeline.d.ts +149 -0
- package/dist-pro/types/pvce/src/charts/color-pipeline.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/compiler.d.ts +155 -0
- package/dist-pro/types/pvce/src/charts/compiler.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/determinism.d.ts +104 -0
- package/dist-pro/types/pvce/src/charts/determinism.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/glyph-oracle.d.ts +113 -0
- package/dist-pro/types/pvce/src/charts/glyph-oracle.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/index.d.ts +46 -0
- package/dist-pro/types/pvce/src/charts/index.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/path-optimizer.d.ts +106 -0
- package/dist-pro/types/pvce/src/charts/path-optimizer.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/svg-renderer.d.ts +96 -0
- package/dist-pro/types/pvce/src/charts/svg-renderer.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/charts/types.d.ts +459 -0
- package/dist-pro/types/pvce/src/charts/types.d.ts.map +1 -0
- package/dist-pro/types/pvce/src/index.d.ts +2 -0
- package/dist-pro/types/pvce/src/index.d.ts.map +1 -0
- package/package.json +100 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2026 Plainworks Inc. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software is proprietary and confidential. Unauthorized copying, distribution,
|
|
4
|
+
modification, or use of this software, via any medium, is strictly prohibited.
|
|
5
|
+
|
|
6
|
+
A valid PaperJSX Pro license key is required to use this software.
|
|
7
|
+
See https://paperjsx.com/pricing for licensing options.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# PaperJSX PPTX Pro
|
|
2
|
+
|
|
3
|
+
Generate production PowerPoint files from JSON and TypeScript with the paid PaperJSX PPTX engine.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @paperjsx/json-to-pptx-pro
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js `>=18` and a valid `PAPERJSX_LICENSE_KEY`.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createEngine } from "@paperjsx/json-to-pptx-pro";
|
|
17
|
+
import { writeFileSync } from "node:fs";
|
|
18
|
+
|
|
19
|
+
const pptx = createEngine({
|
|
20
|
+
licenseKey: process.env.PAPERJSX_LICENSE_KEY,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const buffer = await pptx.render({
|
|
24
|
+
type: "Document",
|
|
25
|
+
meta: { title: "Board Review" },
|
|
26
|
+
slides: [
|
|
27
|
+
{
|
|
28
|
+
type: "Slide",
|
|
29
|
+
style: { padding: 40 },
|
|
30
|
+
children: [
|
|
31
|
+
{
|
|
32
|
+
type: "Text",
|
|
33
|
+
content: "Board Review",
|
|
34
|
+
style: { fontSize: 30, fontWeight: "bold", color: "#0F172A" },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "Text",
|
|
38
|
+
content: "ARR is up 41% year over year.",
|
|
39
|
+
style: { marginTop: 12, fontSize: 18, color: "#334155" },
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
writeFileSync("board-review.pptx", buffer);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Included In Pro
|
|
50
|
+
|
|
51
|
+
- production/self-hosted commercial PPTX usage
|
|
52
|
+
- advanced typography and paid rendering features
|
|
53
|
+
- paid PPTX-to-PDF support with the conversion add-on
|
|
54
|
+
- public engine entrypoints such as `createEngine`, `PaperEngine`, validators, and quality helpers
|
|
55
|
+
|
|
56
|
+
## Package Choice
|
|
57
|
+
|
|
58
|
+
- `@paperjsx/json-to-pptx`: free MIT package
|
|
59
|
+
- `@paperjsx/json-to-pptx-pro`: paid PPTX package
|
|
60
|
+
|
|
61
|
+
## Links
|
|
62
|
+
|
|
63
|
+
- Docs: [paperjsx.com/docs](https://paperjsx.com/docs)
|
|
64
|
+
- Playground: [paperjsx.com/playground](https://paperjsx.com/playground)
|
|
65
|
+
- Pricing: [paperjsx.com/pricing](https://paperjsx.com/pricing)
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
Commercial license required. See the packaged `LICENSE` file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-XRJXR3CS.js";import"./chunk-WOT6VMZA.js";function g(i){return structuredClone(i)}function p(i,l,e=""){for(let t=0;t<i.length;t++){let a=i[t],r=e?`${e}.children[${t}]`:`children[${t}]`;l(a,r),"children"in a&&Array.isArray(a.children)&&p(a.children,l,r)}}function n(i,l,e,t){i.push({code:l,action:e,applied:!0,target:t})}function f(i){let l=d(i),e=g(i),t=[],a=e.accessible&&e.accessible!==!0?e.accessible:void 0;!e.meta?.title&&a?.title&&(e.meta={...e.meta,title:a.title},n(t,"document.title_missing","Propagated accessible.title to document metadata.","meta.title")),!e.meta?.language&&a?.language&&(e.meta={...e.meta,language:a.language},n(t,"document.language_missing","Propagated accessible.language to document metadata.","meta.language"));for(let c=0;c<e.slides.length;c++){let u=e.slides[c];p(u.children,(s,m)=>{if(s.type==="Image"||s.type==="Chart"){let o=s;o.decorative!==!0&&(!o.altText||o.altText.trim().length===0)&&(o.altText="Image",n(t,"image.alt_missing","Applied placeholder alt text to a non-decorative graphic.",`slides[${c}].${m}`))}s.type==="Table"&&!s.tableData?.style?.firstRow&&(s.tableData={...s.tableData,style:{...s.tableData?.style??{},firstRow:!0}},n(t,"table.header_missing","Marked the first row as a header row for the table.",`slides[${c}].${m}`))})}let r=d(e);return{document:e,reportBefore:l,reportAfter:r,fixesApplied:t}}export{f as remediateAccessibility};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-XRJXR3CS.js";import"./chunk-WOT6VMZA.js";export{a as validateAccessibility};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L,b as w}from"./chunk-YFMEN6A3.js";import{c as X,e as K,f as M,g as Y,h as O}from"./chunk-54L7UJFX.js";import{a as H,b as I,e as B,h as N,p as G,q as p,s as W}from"./chunk-UYCBIQVO.js";import{a as U,h as q}from"./chunk-QCSPOFAH.js";import{a as j}from"./chunk-CT3ZL3KD.js";import{d as z}from"./chunk-HGXLLLMM.js";import{a as _,c as V}from"./chunk-BRMIGHX5.js";import{a as c}from"./chunk-JKZFYDBI.js";function ne(t){throw new Error(`Unhandled PaperNode type: ${t.type}`)}function Q(t){switch(t.type){case"View":t.children?.forEach(Q);break;case"Text":break;case"Image":break;case"Table":break;case"Chart":break;case"Group":t.children.forEach(Q);break;case"Connector":break;case"Video":break;case"Audio":break;default:ne(t)}}var m=class{engineMode;licenseKey;logger;deterministicMode;fontCache;harfBuzz;knuthPlass;fontBridge;constructor(e){this.engineMode=e?.engineMode??"pro",this.licenseKey=e?.licenseKey,this.logger=e?.logger??new V,this.deterministicMode=e?.deterministicMode??z(),this.fontCache=e?.fontCache??new q,this.harfBuzz=e?.harfBuzz??new U,this.knuthPlass=e?.knuthPlass??new W,this.fontBridge=e?.fontBridge??new j}};function g(t,e){return _.run(t,e)}var k=class{queue=[];locked=!1;async acquire(e){if(e?.aborted)throw new c("Render cancelled before starting",{code:"RENDER_CANCELLED",phase:"validation"});if(!this.locked){this.locked=!0;return}return new Promise((r,n)=>{let o=()=>{let i=this.queue.indexOf(a);i!==-1&&this.queue.splice(i,1),n(new c("Render cancelled while queued",{code:"RENDER_CANCELLED",phase:"validation"}))},a=()=>{e?.removeEventListener("abort",o),r()};e?.addEventListener("abort",o,{once:!0}),this.queue.push(a)})}release(){if(this.queue.length>0){let e=this.queue.shift();try{e()}catch{this.locked=!1}}else this.locked=!1}},s=new k;function $(t,e){return{...e,template:t}}function D(t){if(!(t!=="desktop_async"&&t!=="desktop_blocking"))throw new c("Desktop validation requires an external PowerPoint oracle backend and is not available in the core engine runtime.",{code:"VALIDATION_BACKEND_UNAVAILABLE",phase:"validation"})}async function J(t,e,r){let n=new URL("./engine/previewGenerator.js",import.meta.url).href,{renderLayoutPreviews:o}=await import(n);return o(t,e,r)}async function oe(){return import(new URL("./engine/archiveAssembler.js",import.meta.url).href)}async function te(){return import(new URL("./layout/index.js",import.meta.url).href)}async function ae(){return import(new URL("./renderer/index.js",import.meta.url).href)}async function ie(){return import(new URL("./svg/exporter.js",import.meta.url).href)}async function le(){return import(new URL("./engine/templateMutator.js",import.meta.url).href)}async function se(){return import(new URL("./converter/pptx-to-pdf.js",import.meta.url).href)}async function Z(t,e){let r=H();G(e,r);let n=w(t),o=L(n),{DEFAULT_SLIDE_WIDTH_PX:a,DEFAULT_SLIDE_HEIGHT_PX:i}=await import("./constants-M7ZVYTHA.js"),l=o.slideSize?.width??a,d=o.slideSize?.height??i;if(!Number.isFinite(l)||l<=0||l>4e4)throw new c(`Invalid slide width: ${l} (must be between 1 and 40000 pixels)`,{code:"VALIDATION_FAILED",phase:"validation"});if(!Number.isFinite(d)||d<=0||d>4e4)throw new c(`Invalid slide height: ${d} (must be between 1 and 40000 pixels)`,{code:"VALIDATION_FAILED",phase:"validation"});let x=e?.slides??o.slides.map((h,v)=>v);if(x.length===0)return[];for(let h of x)if(h<0||h>=o.slides.length||!Number.isInteger(h))throw new c(`Invalid slide index: ${h} (document has ${o.slides.length} slides)`,{code:"INVALID_SLIDE_INDEX",phase:"rendering"});let S=l/d,P=r==="pro"?1920:N,R=e?.width??P,T=e?.height??Math.round(R/S),f=e?.scale??1,{runLayout:b}=await te(),{renderSlideToImage:C}=await ae(),u=o.theme?.colorScheme,A=[];for(let h of x){if(e?.signal?.aborted)throw new c("Render cancelled",{code:"RENDER_CANCELLED",phase:"rendering"});let v=o.slides[h],re=await b(v,l,d),F=await C(re,h,{width:R,height:T,scale:f,format:e?.format,quality:e?.quality,backgroundOverride:e?.background,themeColors:u});if(!F)throw new c("Slide-to-image rendering requires @napi-rs/canvas. Install it with: npm install @napi-rs/canvas",{code:"CANVAS_UNAVAILABLE",phase:"rendering"});A.push(F),e?.onProgress?.(h,o.slides.length)}return A}async function ee(t,e){let r=w(t),n=L(r),{DEFAULT_SLIDE_WIDTH_PX:o,DEFAULT_SLIDE_HEIGHT_PX:a}=await import("./constants-M7ZVYTHA.js"),i=n.slideSize?.width??o,l=n.slideSize?.height??a;if(!Number.isFinite(i)||i<=0||i>4e4)throw new c(`Invalid slide width: ${i} (must be between 1 and 40000 pixels)`,{code:"VALIDATION_FAILED",phase:"validation"});if(!Number.isFinite(l)||l<=0||l>4e4)throw new c(`Invalid slide height: ${l} (must be between 1 and 40000 pixels)`,{code:"VALIDATION_FAILED",phase:"validation"});let d=e?.slides??n.slides.map((u,A)=>A);if(d.length===0)return[];for(let u of d)if(u<0||u>=n.slides.length||!Number.isInteger(u))throw new c(`Invalid slide index: ${u} (document has ${n.slides.length} slides)`,{code:"INVALID_SLIDE_INDEX",phase:"rendering"});let x=i/l,S=e?.width??(e?.height!==void 0?Math.round(e.height*x):i),P=e?.height??(e?.width!==void 0?Math.round(e.width/x):l),R=e?.scale??1,T=n.theme?.colorScheme,{renderToSvgSlide:f}=await ie(),{runLayout:b}=await te(),C=[];for(let u of d){if(e?.signal?.aborted)throw new c("Render cancelled",{code:"RENDER_CANCELLED",phase:"rendering"});let A=n.slides[u],h=await b(A,i,l),v=await f(h,u,{width:S,height:P,scale:R,background:e?.background,themeColors:T});C.push(v),e?.onProgress?.(u,n.slides.length)}return C}async function E(t,e,r,n,o=!0){let a,i=[],l,d,x;if((!B||I())&&t.template)throw new c("Template support requires a PaperJSX Pro license. See https://paperjsx.com/pricing",{code:"FEATURE_REQUIRES_UPGRADE",phase:"template"});if(B&&t.template){let{renderTemplateInternal:f}=await le(),b=await f(t,n);a=b.buffer,l=b.layoutTrees,d=b.compatibilityReport,x=b.templateReport,e&&(i=await J(l,r,t.theme?.colorScheme))}else{let{buildArchive:f}=await oe(),{archive:b,layoutTrees:C,compatibilityReport:u}=await f(t,n);l=C,d=u,e?[a,i]=await Promise.all([b.generateBuffer(),J(l,r,t.theme?.colorScheme)]):a=await b.generateBuffer()}let S,P;if(n?.validationMode==="structural"||n?.repairMode==="structural")if(n?.repairMode==="structural"){let f=await O(a);a=f.buffer,S=f.finalValidation,P=f.repairSummary}else S=await M(a);let T=X(d,n,{structuralValidation:S,templateReport:x,repairSummary:P});return o&&K(T),{pptx:a,previews:i,layoutTrees:l,qualityReport:T}}var y={async preflight(t,e){p("PPTX preflight"),await s.acquire(e?.signal);try{D(e?.validationMode);let r=w(t),n=L(r);return(await E(n,!1,void 0,e,!1)).qualityReport}finally{s.release()}},async validate(t){return p("PPTX validation"),M(t)},async repair(t){return p("PPTX repair"),Y(t)},async validateAndRepair(t){return p("PPTX repair"),O(t)},async render(t,e){p("PPTX rendering"),await s.acquire(e?.signal);try{return D(e?.validationMode),(await E(t,!1,void 0,e)).pptx}finally{s.release()}},async renderStream(t,e){p("PPTX rendering"),await s.acquire(e?.signal);try{D(e?.validationMode);let r=await E(t,!1,void 0,e),{Readable:n}=await import("node:stream");return n.from(r.pptx)}finally{s.release()}},async renderWithQualityReport(t,e,r){p("PPTX rendering"),await s.acquire(r?.signal);try{return D(r?.validationMode),await E(t,!1,e,r)}finally{s.release()}},async renderWithPreviews(t,e,r){p("PPTX rendering"),await s.acquire(r?.signal);try{return D(r?.validationMode),await E(t,!0,e,r)}finally{s.release()}},async renderToImages(t,e){p("PPTX slide image rendering"),await s.acquire(e?.signal);try{return await Z(t,e)}finally{s.release()}},async renderToImage(t,e,r){p("PPTX slide image rendering"),await s.acquire(r?.signal);try{return(await Z(t,{...r,slides:[e]}))[0]}finally{s.release()}},async renderToSvgSlides(t,e){p("PPTX SVG rendering"),await s.acquire(e?.signal);try{return await ee(t,e)}finally{s.release()}},async renderToSvgSlide(t,e,r){p("PPTX SVG rendering"),await s.acquire(r?.signal);try{return(await ee(t,{...r,slides:[e]}))[0]}finally{s.release()}},async renderToPdf(t,e){p("PPTX to PDF conversion"),await s.acquire(e?.signal);try{let{renderDocumentToPdf:r}=await se();return await r(t,e)}finally{s.release()}},async populatePptxTemplate(t,e,r){return p("PPTX template rendering"),this.render($(t,e),r)},async populatePptxTemplateToPdf(t,e,r){return p("PPTX template to PDF conversion"),this.renderToPdf($(t,e),r)},async validateAccessibility(t){if(p("PPTX accessibility validation"),I())throw new c("Accessibility validation requires a PaperJSX Pro license. See https://paperjsx.com/pricing",{code:"FEATURE_REQUIRES_UPGRADE",phase:"validation"});let e=w(t),{validateAccessibility:r}=await import("./accessibilityValidator-PNPHJ7DT.js");return r(e)},async remediateAccessibility(t){if(p("PPTX accessibility remediation"),I())throw new c("Accessibility remediation requires a PaperJSX Pro license. See https://paperjsx.com/pricing",{code:"FEATURE_REQUIRES_UPGRADE",phase:"validation"});let e=w(t),{remediateAccessibility:r}=await import("./accessibilityRemediation-JCCWTNLI.js");return r(e)}};function Be(t){let e=t?.mode??"lite",r=t?.licenseKey??process.env.PAPERJSX_LICENSE_KEY;return B&&(p("PPTX rendering",r),e="pro"),{async render(n,o){let a=new m({engineMode:e,licenseKey:r});return g(a,()=>y.render(n,o))},async renderStream(n,o){let a=new m({engineMode:e,licenseKey:r});return g(a,()=>y.renderStream(n,o))},async renderToImages(n,o){let a=new m({engineMode:e,licenseKey:r});return g(a,()=>y.renderToImages(n,o))},async renderToImage(n,o,a){let i=new m({engineMode:e,licenseKey:r});return g(i,()=>y.renderToImage(n,o,a))},async renderToSvgSlides(n,o){let a=new m({engineMode:e,licenseKey:r});return g(a,()=>y.renderToSvgSlides(n,o))},async renderToSvgSlide(n,o,a){let i=new m({engineMode:e,licenseKey:r});return g(i,()=>y.renderToSvgSlide(n,o,a))},async renderToPdf(n,o){let a=new m({engineMode:e,licenseKey:r});return g(a,()=>y.renderToPdf(n,o))},async populatePptxTemplate(n,o,a){let i=new m({engineMode:e,licenseKey:r});return g(i,()=>y.populatePptxTemplate(n,o,a))},async populatePptxTemplateToPdf(n,o,a){let i=new m({engineMode:e,licenseKey:r});return g(i,()=>y.populatePptxTemplateToPdf(n,o,a))},async validateAccessibility(n){let o=new m({engineMode:e,licenseKey:r});return g(o,()=>y.validateAccessibility(n))},async remediateAccessibility(n){let o=new m({engineMode:e,licenseKey:r});return g(o,()=>y.remediateAccessibility(n))}}}export{Q as a,m as b,g as c,y as d,Be as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./chunk-D33P4D2I.js";import{a as I}from"./chunk-JKZFYDBI.js";function $(t){switch(t){case"OVERFLOW_BODY_TEXT":return"PPTX_OVERFLOW_BODY_TEXT";case"TABLE_TOO_DENSE":return"PPTX_TABLE_CELL_TEXT_OVERFLOW";case"CHART_LABEL_COLLISION":return"PPTX_CHART_LABEL_COLLISION";case"FONT_FALLBACK_USED":return"PPTX_FONT_FALLBACK_USED";case"NORMAUTOFIT_MISSING_FONTSCALE":return"PPTX_NORMAUTOFIT_MISSING_FONTSCALE";case"CHART_FORMAT_CODE_UNESCAPED":return"PPTX_CHART_FORMAT_CODE_UNESCAPED";case"SLIDE_ID_NOT_UNIQUE":return"PPTX_SLIDE_ID_NOT_UNIQUE";case"CUSTDATALIST_CONFLICT":return"PPTX_CUSTDATALIST_CONFLICT";case"ELEMENT_ORDER_VIOLATION":return"PPTX_ELEMENT_ORDER_VIOLATION";case"CHART_WORKBOOK_MISSING":return"PPTX_CHART_WORKBOOK_MISSING";case"RELATIONSHIP_TARGET_MISSING":return"SHARED_RELATIONSHIP_TARGET_MISSING";case"RID_NOT_UNIQUE":return"SHARED_RID_NOT_UNIQUE";case"CONTENT_TYPE_DUPLICATE":return"SHARED_CONTENT_TYPE_DUPLICATE";case"STRUCTURAL_VALIDATION_FAILED":return"PPTX_STRUCTURAL_VALIDATION_FAILED";case"ASSET_MISSING":return"SHARED_MEDIA_EMBED_MISSING";case"DESKTOP_VALIDATION_FAILED":return;case"BRAND_TOKEN_MISSING":case"BRAND_FONT_MISMATCH":case"BRAND_COLOR_MISMATCH":case"REQUIRED_LOGO_MISSING":case"UNSUPPORTED_LAYOUT_SELECTION":case"LAYOUT_SHOULD_SPLIT":return}}function w(t){let e,i="validation";if(t.id.startsWith("content-types."))e="CONTENT_TYPE_DUPLICATE";else if(/\.rid\./.test(t.id))e="RID_NOT_UNIQUE";else if(t.id.endsWith(".target")||/\.ref\./.test(t.id))e="RELATIONSHIP_TARGET_MISSING";else if(/^chart\.\d+\.workbook$/.test(t.id))e="CHART_WORKBOOK_MISSING",i="chart";else if(t.id.startsWith("presentation.slide-id."))e="SLIDE_ID_NOT_UNIQUE";else if(t.id.includes(".custdatalist"))e="CUSTDATALIST_CONFLICT";else if(t.id.startsWith("presentation.order."))e="ELEMENT_ORDER_VIOLATION";else if(t.id.includes(".normautofit."))e="NORMAUTOFIT_MISSING_FONTSCALE",i="typography";else if(t.id.includes(".format-code."))e="CHART_FORMAT_CODE_UNESCAPED",i="chart";else if(t.id.includes(".table-overflow."))e="TABLE_TOO_DENSE",i="layout";else if(t.id.startsWith("package.")||t.id==="slides.present"||/^slide\.\d+\.rels$/.test(t.id)||/^slide\.\d+\.content-type$/.test(t.id)||/^chart\.\d+\.rels$/.test(t.id)||/^chart\.\d+\.content-type$/.test(t.id))e="STRUCTURAL_VALIDATION_FAILED";else throw new I(`Unmapped PPTX structural validation check: ${t.id}`,{code:"VALIDATION_FAILED",phase:"validation"});let r=t.id.match(/^slide\.(\d+)\./),s=r?Number(r[1])-1:void 0;return{code:e,severity:t.severity,message:t.message,slideIndex:s,componentPath:s!==void 0?T(s):void 0,category:i,blocking:t.severity==="error",machineFixHint:e==="STRUCTURAL_VALIDATION_FAILED"?"Inspect the structural validation report before sending the file downstream.":void 0,recommendedAction:e==="TABLE_TOO_DENSE"?"Reduce table density or split the table across multiple slides.":e==="CHART_FORMAT_CODE_UNESCAPED"?"Escape XML-sensitive characters in chart number formats before release.":e==="NORMAUTOFIT_MISSING_FONTSCALE"?"Write an explicit fontScale on normAutofit nodes.":e==="RELATIONSHIP_TARGET_MISSING"?"Repair or remove the broken relationship target before release.":void 0}}function U(t){switch(t){case"remove_duplicate_content_types":return"SHARED_CONTENT_TYPE_DUPLICATE";case"remove_orphaned_relationships":return"SHARED_RELATIONSHIP_TARGET_MISSING";case"reorder_presentation_elements":return"PPTX_ELEMENT_ORDER_VIOLATION";case"add_normautofit_font_scale":return"PPTX_NORMAUTOFIT_MISSING_FONTSCALE";case"escape_chart_format_codes":return"PPTX_CHART_FORMAT_CODE_UNESCAPED";case"dedupe_slide_ids":return"PPTX_SLIDE_ID_NOT_UNIQUE";case"collapse_custdatalist":return"PPTX_CUSTDATALIST_CONFLICT";case"fill_missing_font_typefaces":return"PPTX_FONT_FALLBACK_USED";default:throw new I(`Unmapped PPTX repair action: ${t}`,{code:"VALIDATION_FAILED",phase:"validation"})}}var k={native_editable:0,native_anchored:1,alternate_content:2,visual_fallback:3};function L(t){switch(t){case"native_safe":return"native_editable";case"native_anchored":return"native_anchored";case"visual_fallback":return"visual_fallback"}}function B(t="editable_preferred"){switch(t){case"strict_editable":return"native_editable";case"editable_preferred":return"native_anchored";case"visual_safe":return"visual_fallback"}}function Q(t){let e=t?.outputMode??"editable_preferred";return{outputMode:e,validationMode:t?.validationMode??"none",maxFallbackLevel:t?.maxFallbackLevel??B(e),desktopValidationId:t?.desktopValidationId??"",repairMode:t?.repairMode??"none"}}function H(t){return{status:"not_run",checks:[{id:"structural.validation",passed:!1,severity:"info",message:t==="structural"?"Structural validation was requested but no rendered PPTX buffer was supplied.":"Structural validation was not requested."}],failureCount:0}}function E(t,e){return k[t]<=k[e]}function X(t){switch(t){case"native_safe":return"editable";case"native_anchored":return"editable_with_constraints";case"visual_fallback":return"visual_only"}}function G(t){let e=t.issues.find(i=>i.remediation)?.remediation;if(e)return e;if(t.fallbackReason)return t.fallbackReason;switch(t.compatibilityVerdict){case"native_safe":return;case"native_anchored":return"Keep editable output by simplifying fonts or text groups on this slide.";case"visual_fallback":return"Switch to visual_safe mode or simplify the slide until it stays inside the native editable contract."}}function j(t){let e=L(t.compatibilityVerdict);return e==="native_editable"?null:{level:e,reason:t.fallbackReason??t.issues.find(i=>i.fallbackLevel===e)?.message}}function P(t,e,i,r){return e.status==="failed"||i?.templateSupportLevel==="unsafe"||r?.status==="failed"||t.some(s=>s.compatibilityVerdict==="visual_fallback")||t.some(s=>s.issues.some(a=>a.severity==="error"))?"high":t.some(s=>s.compatibilityVerdict==="native_anchored")||t.some(s=>s.issues.some(a=>a.severity==="warning"))?"medium":"low"}function D(t,e){let i=100;for(let r of t)switch(r.compatibilityVerdict){case"native_safe":break;case"native_anchored":i-=12;break;case"visual_fallback":i-=35;break}return e?.status==="failed"&&(i=Math.min(i,20)),Math.max(0,Math.min(100,Math.round(i)))}function N(t,e,i,r,s){return i.status==="failed"||r?.templateSupportLevel==="unsafe"||s?.status==="failed"||t.some(n=>!E(L(n.compatibilityVerdict),e))?"rejected":t.some(n=>n.compatibilityVerdict==="visual_fallback")?"visual_fallback":t.some(n=>n.compatibilityVerdict==="native_anchored")?"editable_with_constraints":"native_editable"}function y(t,e){t.some(i=>i.code===e.code&&i.slideIndex===e.slideIndex&&i.componentPath===e.componentPath&&i.message===e.message)||t.push(e)}function T(t,e){return e?`slides[${t}].${e}`:`slides[${t}]`}function F(t,e,i,r,s){let a=t;return e==="medium"&&(a-=8),e==="high"&&(a-=20),a-=i*2,r==="rejected"?a=Math.min(a,35):r==="visual_fallback"&&(a=Math.min(a,60)),s?.status==="failed"&&(a=Math.min(a,20)),Math.max(0,Math.min(100,Math.round(a)))}function V(t,e,i,r){let s=[];for(let a of t){for(let n of a.issues){let o=n.message.toLowerCase();n.issueClass==="text_overflow_risk"&&(y(s,{code:"OVERFLOW_BODY_TEXT",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"layout",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Shorten the body copy or split the slide before the next render."}),y(s,{code:"LAYOUT_SHOULD_SPLIT",severity:a.compatibilityVerdict==="visual_fallback"?"warning":"info",message:`Slide ${a.slideIndex+1} is dense enough that splitting or trimming content is likely safer than another retry.`,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"layout",blocking:!1,machineFixHint:"Split the narrative into multiple slides or reduce paragraph density before the next render attempt.",recommendedAction:"Split the slide into two lighter narrative steps before the next render attempt."}),o.includes("table")&&y(s,{code:"TABLE_TOO_DENSE",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex,"table"),category:"layout",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Reduce row or column density, or move part of the table to another slide."})),n.issueClass==="font_substitution_risk"&&y(s,{code:"FONT_FALLBACK_USED",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"typography",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Replace unsupported fonts with approved brand fonts."}),n.issueClass==="chart_layout_risk"&&y(s,{code:"CHART_LABEL_COLLISION",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex,"chart"),category:"chart",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Simplify the chart or reduce label density before the next render."}),n.issueClass==="template_placeholder_risk"&&y(s,{code:"BRAND_TOKEN_MISSING",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"brand",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Recompile the brand pack or use a compatible layout."}),/asset|media|image|logo/.test(o)&&y(s,{code:"ASSET_MISSING",severity:n.severity,message:n.message,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"asset",blocking:n.severity==="error",machineFixHint:n.remediation,recommendedAction:n.remediation??"Upload the missing asset and retry the render."})}if(Object.keys(a.fontSubstitutions).length>0){let n=Object.entries(a.fontSubstitutions).map(([o,l])=>`${o} -> ${l}`).join(", ");y(s,{code:"FONT_FALLBACK_USED",severity:"warning",message:`Slide ${a.slideIndex+1} used fallback fonts: ${n}.`,slideIndex:a.slideIndex,componentPath:T(a.slideIndex),category:"typography",blocking:!1,machineFixHint:"Embed or replace unsupported fonts with the brand pack's approved set.",recommendedAction:"Replace fallback fonts with the approved brand font family before final render."})}}if((i?.missingPlaceholderCount??0)>0&&y(s,{code:"BRAND_TOKEN_MISSING",severity:i?.templateSupportLevel==="unsafe"?"error":"warning",message:`Template mapping missed ${i?.missingPlaceholderCount} required placeholder${i?.missingPlaceholderCount===1?"":"s"}.`,category:"brand",blocking:i?.templateSupportLevel==="unsafe",machineFixHint:"Recompile the brand pack or map the slide to a layout with matching placeholders.",recommendedAction:"Recompile the brand pack and confirm the target layout exposes the required placeholders."}),e.status==="failed")for(let a of e.checks.filter(n=>!n.passed))y(s,w(a));if(r?.status==="failed"){let a=r.checks.find(n=>!n.passed);y(s,{code:"DESKTOP_VALIDATION_FAILED",severity:"error",message:a?.message??"Rendered PPTX failed desktop validation.",category:"validation",blocking:!0,machineFixHint:"Review the validation artifacts and fix desktop-only compatibility regressions before release.",recommendedAction:"Review the desktop validation artifacts and fix the PowerPoint compatibility issue before release."})}return s}function be(t,e,i){let r=Q(e),s=i?.structuralValidation??H(r.validationMode),a=t.slides.map(p=>({slideIndex:p.slideIndex,compatibilityVerdict:p.compatibilityVerdict,issues:p.issues,fallbackApplied:j(p),editabilityVerdict:X(p.compatibilityVerdict),suggestedFix:G(p),fonts:p.fonts,fontSubstitutions:p.fontSubstitutions})),n=a.filter(p=>p.fallbackApplied!==null).length,o=P(t.slides,s,i?.templateReport,i?.desktopValidation),l=N(t.slides,r.maxFallbackLevel,s,i?.templateReport,i?.desktopValidation),u=D(t.slides,i?.desktopValidation),h=V(a,s,i?.templateReport,i?.desktopValidation),S=F(u,o,n,l,i?.desktopValidation),c=(i?.repairSummary?.actions??[]).map(p=>({strategy:p.id,finding:U(p.id),description:p.description,success:!0})),d=h.map(p=>{let m=$(p.code),_=m?c.filter(b=>b.finding===m):[];return{...p,sharedCode:m,autoFixed:_.length>0,repairDescription:_.map(b=>b.description).join(" ")||void 0}});return{verdict:l,requestedOutputMode:r.outputMode,validationMode:r.validationMode,maxFallbackLevel:r.maxFallbackLevel,documentVerdict:l,repairRisk:o,editabilityScore:u,deckScore:S,fallbackCount:n,findings:d,slideReports:a,desktopValidationId:r.desktopValidationId||void 0,structuralValidation:s,desktopValidation:i?.desktopValidation,templateReport:i?.templateReport,repairSummary:i?.repairSummary??{state:"not_requested",actions:[]},autoFixesApplied:d.filter(p=>p.autoFixed).length,repairLog:c,contractPassed:l!=="rejected"}}function Te(t,e,i){let r=i?.validationMode??t.validationMode,s=i?.desktopValidationId??t.desktopValidationId,a=P(t.slideReports,t.structuralValidation,t.templateReport,e),n=N(t.slideReports,t.maxFallbackLevel,t.structuralValidation,t.templateReport,e),o=D(t.slideReports,e),l=V(t.slideReports,t.structuralValidation,t.templateReport,e),u=F(o,a,t.fallbackCount,n,e);return{...t,validationMode:r,desktopValidationId:s,desktopValidation:e,repairRisk:a,documentVerdict:n,editabilityScore:o,deckScore:u,findings:l,contractPassed:n!=="rejected"}}function Ie(t){if(t.templateReport?.templateSupportLevel==="unsafe")throw new I("Template preflight marked this document as unsafe for reliable mutation.",{code:"COMPATIBILITY_CONTRACT_VIOLATION",phase:"template"});if(t.structuralValidation.status==="failed"){let i=t.structuralValidation.checks.find(r=>!r.passed);throw new I(i?.message??"Rendered PPTX failed structural validation.",{code:"STRUCTURAL_VALIDATION_FAILED",phase:"archive"})}if(t.desktopValidation?.status==="failed"){let i=t.desktopValidation.checks.find(r=>!r.passed);throw new I(i?.message??"Rendered PPTX failed PowerPoint desktop validation.",{code:"DESKTOP_VALIDATION_FAILED",phase:"validation"})}if(t.contractPassed)return;let e=t.slideReports.find(i=>i.fallbackApplied&&!E(i.fallbackApplied.level,t.maxFallbackLevel));throw e?new I(`Slide ${e.slideIndex+1} requires ${e.fallbackApplied?.level}, which exceeds the ${t.requestedOutputMode} contract.`,{code:"COMPATIBILITY_CONTRACT_VIOLATION",phase:"serialization",slideIndex:e.slideIndex}):new I("Render output violated the requested compatibility contract.",{code:"COMPATIBILITY_CONTRACT_VIOLATION",phase:"serialization"})}import K from"jszip";function f(t,e,i,r,s="error"){t.push({id:e,passed:i,message:r,severity:s})}function q(t){let e=new Set;for(let i of t.matchAll(/\br:(?:embed|id|link)="([^"]+)"/g))e.add(i[1]);return[...e]}function W(t,e,i){let r=new Set;for(let s of i.matchAll(/<Relationship\b[^>]*\bId="([^"]+)"/g)){let a=s[1],n=r.has(a);f(t,`${e}.rid.${a}`,!n,n?`Duplicate relationship Id "${a}" in ${e}.`:`Relationship Id "${a}" in ${e} is unique.`),r.add(a)}}function Y(t,e){let i=[...R],r=Array.from(e.matchAll(/<(p:[A-Za-z0-9]+)\b/g),a=>a[1]).filter(a=>i.includes(a)),s=-1;for(let a of r){let n=i.indexOf(a),o=n>=s;f(t,`presentation.order.${a}`,o,o?`Presentation child ${a} appears in schema order.`:`Presentation child ${a} appears out of OOXML schema order.`),s=Math.max(s,n)}}function z(t,e){let i=new Set;for(let r of e.matchAll(/<p:sldId\b[^>]*\bid="(\d+)"/g)){let s=r[1],a=i.has(s);f(t,`presentation.slide-id.${s}`,!a,a?`Duplicate slide id ${s} detected in ppt/presentation.xml.`:`Slide id ${s} in ppt/presentation.xml is unique.`),i.add(s)}}function Z(t,e,i){let r=0;for(let s of i.matchAll(/<a:normAutofit\b([^>]*)\/?>/g)){let a=s[1]??"",n=/\bfontScale="/.test(a);f(t,`slide.${e}.normautofit.${r}`,!0,n?`Slide ${e} normAutofit entry ${r+1} includes fontScale.`:`Slide ${e} normAutofit entry ${r+1} uses Office-default autofit.`,"info"),r+=1}}function J(t,e,i){let r=0;for(let s of i.matchAll(/<a:bodyPr\b[^>]*>[\s\S]*?<\/a:bodyPr>/g)){let a=s[0],n=/<a:normAutofit\b/.test(a),o=/<a:spAutoFit\b/.test(a),l=/<a:noAutofit\b/.test(a),h=[n,o,l].filter(Boolean).length<=1;f(t,`slide.${e}.autofit-policy.${r}`,h,h?`Slide ${e} bodyPr ${r+1} uses at most one autofit policy.`:`Slide ${e} bodyPr ${r+1} contains conflicting autofit policies.`),r+=1}}function ee(t,e,i){let r=0;for(let s of i.matchAll(/<a:tc\b[\s\S]*?<\/a:tc>/g)){let a=s[0],n=Array.from(a.matchAll(/<a:t>([\s\S]*?)<\/a:t>/g),l=>l[1]).join("");if(n.length===0){r+=1;continue}let o=n.length<=150;f(t,`slide.${e}.table-overflow.${r}`,o,o?`Slide ${e} table cell ${r+1} stays within the conservative text budget.`:`Slide ${e} table cell ${r+1} contains ${n.length} characters and is likely to overflow.`,o?"info":"warning"),r+=1}}function te(t,e,i){let s=Array.from(i.matchAll(/<p:custDataLst\b/g)).length<=1;f(t,`slide.${e}.custdatalist`,s,s?`Slide ${e} has at most one custDataLst block.`:`Slide ${e} contains multiple custDataLst blocks, which can confuse PowerPoint repair.`)}function ie(t,e,i){let r=0;for(let s of i.matchAll(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/g)){let a=s[1]??"",n=/&(?!amp;|lt;|gt;|quot;|apos;|#\d+;|#x[0-9a-f]+;)/i.test(a),o=/<(?!\/?c:formatCode\b)/.test(a),l=!n&&!o;f(t,`chart.${e}.format-code.${r}`,l,l?`Chart ${e} format code ${r+1} is XML-safe.`:`Chart ${e} format code ${r+1} contains unescaped XML-sensitive characters.`),r+=1}}function ae(t,e){if(e.startsWith("/"))return e.slice(1);let r=t.substring(0,t.lastIndexOf("/")+1).replace(/_rels\/$/,""),s=[];for(let a of`${r}${e}`.split("/"))a===".."?s.pop():a!=="."&&a!==""&&s.push(a);return s.join("/")}function ne(t,e){let i=new Set,r=new Set;for(let s of e.matchAll(/<Default\b[^>]*\bExtension="([^"]+)"/g)){let a=s[1].toLowerCase(),n=i.has(a);f(t,`content-types.default.${a}`,!n,n?`Duplicate Default content type extension "${a}" detected.`:`Default content type extension "${a}" is unique.`),i.add(a)}for(let s of e.matchAll(/<Override\b[^>]*\bPartName="([^"]+)"/g)){let a=s[1].toLowerCase(),n=r.has(a);f(t,`content-types.override.${a}`,!n,n?`Duplicate Override content type part "${a}" detected.`:`Override content type part "${a}" is unique.`),r.add(a)}}async function x(t){let e=[];try{let i=await K.loadAsync(t),r=i.file("[Content_Types].xml");f(e,"package.content-types",!!r,r?"Package includes [Content_Types].xml.":"Package is missing [Content_Types].xml.");let s=i.file("ppt/presentation.xml");f(e,"package.presentation",!!s,s?"Package includes ppt/presentation.xml.":"Package is missing ppt/presentation.xml.");let a=i.file("ppt/_rels/presentation.xml.rels");f(e,"package.presentation-rels",!!a,a?"Presentation relationships file is present.":"Presentation relationships file is missing.");let n=r?await r.async("string"):"";ne(e,n);let o=s?await s.async("string"):"";z(e,o),Y(e,o);let l=Object.keys(i.files).filter(c=>/^ppt\/slides\/slide\d+\.xml$/.test(c)).sort((c,d)=>{let p=parseInt(c.match(/slide(\d+)/)?.[1]??"0",10),m=parseInt(d.match(/slide(\d+)/)?.[1]??"0",10);return p-m});f(e,"slides.present",l.length>0,l.length>0?`Package contains ${l.length} slide part(s).`:"Package contains no slide parts.");for(let c of l){let d=c.match(/slide(\d+)/)?.[1]??"?",p=`ppt/slides/_rels/slide${d}.xml.rels`,m=i.file(p);f(e,`slide.${d}.rels`,!!m,m?`Slide ${d} relationships file is present.`:`Slide ${d} relationships file is missing.`),f(e,`slide.${d}.content-type`,n.includes(`/ppt/slides/slide${d}.xml`),n.includes(`/ppt/slides/slide${d}.xml`)?`Slide ${d} is declared in [Content_Types].xml.`:`Slide ${d} is missing from [Content_Types].xml.`);let _=await i.file(c)?.async("string")??"",b=await m?.async("string")??"";Z(e,d,_),J(e,d,_),ee(e,d,_),te(e,d,_);for(let g of q(_))f(e,`slide.${d}.ref.${g}`,b.includes(`Id="${g}"`),b.includes(`Id="${g}"`)?`Slide ${d} relationship ${g} resolves.`:`Slide ${d} references ${g}, but it is missing from the slide relationships file.`)}let u=Object.keys(i.files).filter(c=>c.endsWith(".rels")&&!i.files[c].dir).sort();for(let c of u){let d=await i.file(c)?.async("string")??"";W(e,c,d);for(let p of d.matchAll(/<Relationship\b[^>]*\bId="([^"]+)"[^>]*\bTarget="([^"]+)"([^>]*)\/?>/g)){let[,m,_,b]=p;if(/TargetMode="External"/.test(b))continue;let g=ae(c,_);f(e,`${c}.${m}.target`,!!i.file(g),i.file(g)?`Relationship ${m} in ${c} resolves to ${g}.`:`Relationship ${m} in ${c} points to missing target ${g}.`)}}let h=Object.keys(i.files).filter(c=>/^ppt\/charts\/chart\d+\.xml$/.test(c)).sort((c,d)=>{let p=parseInt(c.match(/chart(\d+)/)?.[1]??"0",10),m=parseInt(d.match(/chart(\d+)/)?.[1]??"0",10);return p-m});for(let c of h){let d=c.match(/chart(\d+)/)?.[1]??"?",p=`ppt/charts/_rels/chart${d}.xml.rels`,m=i.file(p);f(e,`chart.${d}.rels`,!!m,m?`Chart ${d} relationships file is present.`:`Chart ${d} relationships file is missing.`),f(e,`chart.${d}.content-type`,n.includes(`/ppt/charts/chart${d}.xml`),n.includes(`/ppt/charts/chart${d}.xml`)?`Chart ${d} is declared in [Content_Types].xml.`:`Chart ${d} is missing from [Content_Types].xml.`);let _=await m?.async("string")??"",b=await i.file(c)?.async("string")??"";ie(e,d,b);let g=_.match(/Target="(\.\.\/embeddings\/[^"]+)"/)?.[1];if(g){let v=`ppt/${g.replace("../","")}`;f(e,`chart.${d}.workbook`,!!i.file(v),i.file(v)?`Chart ${d} embedded workbook exists.`:`Chart ${d} embedded workbook is missing (${v}).`)}}let S=e.filter(c=>!c.passed&&c.severity==="error").length;return{status:S===0?"passed":"failed",checks:e,failureCount:S}}catch(i){return{status:"failed",checks:[{id:"package.load",passed:!1,severity:"error",message:`Failed to open PPTX package: ${i instanceof Error?i.message:String(i)}`}],failureCount:1}}}import re from"jszip";import{XMLBuilder as se,XMLParser as oe}from"fast-xml-parser";var C=new oe({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:"@_",allowBooleanAttributes:!0,parseAttributeValue:!1,trimValues:!1}),O=new se({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:"@_",suppressBooleanAttributes:!1,format:!0});function M(t,e){let i=[];function r(s){if(Array.isArray(s)){for(let a of s)if(!(!a||typeof a!="object"))for(let n of Object.keys(a))n===":@"||n==="#text"||(n===e&&i.push(a),r(a[n]))}}return r(t),i}function A(t){return Object.keys(t).find(e=>e!==":@"&&e!=="#text")}function le(t){let e=t.split("/"),i=e.lastIndexOf("_rels");return i>=0?e.slice(0,i).join("/"):e.slice(0,-1).join("/")}function de(t,e){if(e.startsWith("/"))return e.slice(1);let i=t?t.split("/"):[];for(let r of e.split("/"))r===".."?i.pop():r!=="."&&r!==""&&i.push(r);return i.join("/")}function ce(t){let e=new Set,i=256;return t.replace(/(<p:sldId\b[^>]*\bid=")(\d+)(")/g,(r,s,a,n)=>{let o=Number(a);if(Number.isFinite(o)&&(i=Math.max(i,o+1)),!e.has(a))return e.add(a),`${s}${a}${n}`;let l=String(i++);return e.add(l),`${s}${l}${n}`})}function ue(t){return t.replace(/<a:normAutofit\b(?![^>]*\bfontScale=)([^>]*)\/?>/g,(e,i)=>`<a:normAutofit${i} fontScale="100000"/>`)}function pe(t){return t.replace(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/g,(e,i)=>`<c:formatCode>${i.replace(/&(?!amp;|lt;|gt;|quot;|apos;|#\d+;|#x[0-9a-f]+;)/gi,"&").replace(/</g,"<").replace(/>/g,">")}</c:formatCode>`)}function fe(t){let e=!1;return t.replace(/<p:custDataLst\b[\s\S]*?<\/p:custDataLst>/g,i=>e?"":(e=!0,i))}function me(t){let e=C.parse(t),i=Array.isArray(e)?e.find(n=>n.Types):void 0;if(!i?.Types||!Array.isArray(i.Types))return t;let r=new Set,s=new Set,a=[];for(let n of i.Types){let o=A(n);if(o==="Default"){let l=n?.[":@"]?.["@_Extension"];if(l&&r.has(l.toLowerCase()))continue;l&&r.add(l.toLowerCase())}else if(o==="Override"){let l=n?.[":@"]?.["@_PartName"];if(l&&s.has(l.toLowerCase()))continue;l&&s.add(l.toLowerCase())}a.push(n)}return i.Types=a,O.build(e)}function he(t,e){let i=C.parse(t);for(let r of e){let s=M(i,r.tag);for(let a of s)a[":@"]||(a[":@"]={}),a[":@"][`@_${r.attr}`]||(a[":@"][`@_${r.attr}`]=r.value)}return O.build(i)}function ge(t,e,i){let r=C.parse(t),s=M(r,e);for(let a of s){let n=a[e];if(!Array.isArray(n))continue;let o=[],l=[];for(let u of n){let h=A(u);h&&i.includes(h)?o.push(u):l.push(u)}o.sort((u,h)=>{let S=A(u)??"",c=A(h)??"";return i.indexOf(S)-i.indexOf(c)}),a[e]=[...o,...l]}return O.build(r)}function _e(t,e,i){let r=C.parse(t),s=Array.isArray(r)?r.find(n=>n.Relationships):void 0;if(!s?.Relationships||!Array.isArray(s.Relationships))return t;let a=le(i);return s.Relationships=s.Relationships.filter(n=>{if(A(n)!=="Relationship"||n?.[":@"]?.["@_TargetMode"]==="External")return!0;let u=n?.[":@"]?.["@_Target"];return u?e.has(de(a,u)):!0}),O.build(r)}async function ye(t){let e=await re.loadAsync(t),i=[],r=new Set(Object.keys(e.files).filter(o=>!e.files[o].dir)),s=e.file("[Content_Types].xml");if(s){let o=await s.async("string"),l=me(o);l!==o&&(e.file("[Content_Types].xml",l),i.push({id:"remove_duplicate_content_types",description:"Removed duplicate Default and Override entries from [Content_Types].xml.",file:"[Content_Types].xml"}))}let a=[{tag:"a:latin",attr:"typeface",value:"Calibri"},{tag:"a:ea",attr:"typeface",value:""},{tag:"a:cs",attr:"typeface",value:""}];for(let o of r){if(!/^ppt\/slides\/slide\d+\.xml$/.test(o))continue;let l=await e.files[o].async("string"),u=he(l,a),h=ue(u),S=fe(h);S!==l&&(e.file(o,S),u!==l&&i.push({id:"fill_missing_font_typefaces",description:"Added missing typeface attributes required by PowerPoint font elements.",file:o}),h!==u&&i.push({id:"add_normautofit_font_scale",description:"Added explicit fontScale attributes to normAutofit nodes.",file:o}),S!==h&&i.push({id:"collapse_custdatalist",description:"Collapsed duplicate custDataLst blocks to a single surviving list.",file:o}))}let n=e.file("ppt/presentation.xml");if(n){let o=await n.async("string"),l=ge(o,"p:presentation",[...R]),u=ce(l);u!==o?(e.file("ppt/presentation.xml",u),l!==o&&i.push({id:"reorder_presentation_elements",description:"Reordered presentation children to match OOXML schema sequence.",file:"ppt/presentation.xml"}),u!==l&&i.push({id:"dedupe_slide_ids",description:"Reassigned duplicate slide ids in ppt/presentation.xml.",file:"ppt/presentation.xml"})):l!==o&&(e.file("ppt/presentation.xml",l),i.push({id:"reorder_presentation_elements",description:"Reordered presentation children to match OOXML schema sequence.",file:"ppt/presentation.xml"}))}for(let o of r){if(!/^ppt\/charts\/chart\d+\.xml$/.test(o))continue;let l=await e.files[o].async("string"),u=pe(l);u!==l&&(e.file(o,u),i.push({id:"escape_chart_format_codes",description:"Escaped XML-sensitive characters inside chart formatCode elements.",file:o}))}for(let o of r){if(!o.endsWith(".rels"))continue;let l=await e.files[o].async("string"),u=_e(l,r,o);u!==l&&(e.file(o,u),i.push({id:"remove_orphaned_relationships",description:"Removed relationships whose targets are missing from the package.",file:o}))}return{buffer:await e.generateAsync({type:"nodebuffer"}),actions:i}}async function Ee(t){let e=await x(t);if(e.status==="passed")return{buffer:t,initialValidation:e,finalValidation:e,repairSummary:{state:"not_needed",actions:[],initialFailureCount:0,finalFailureCount:0}};let i=await ye(t),r=await x(i.buffer),s=i.actions.length===0?"failed":r.status==="passed"?"repaired":"failed";return{buffer:i.buffer,initialValidation:e,finalValidation:r,repairSummary:{state:s,actions:i.actions,initialFailureCount:e.failureCount,finalFailureCount:r.failureCount}}}export{L as a,B as b,be as c,Te as d,Ie as e,x as f,ye as g,Ee as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as p}from"./chunk-QCSPOFAH.js";function y(r){return r>=12288&&r<=40959||r>=44032&&r<=55215||r>=4352&&r<=4607||r>=63744&&r<=64255||r>=65280&&r<=65519||r>=131072&&r<=195103?"ea":r>=1424&&r<=2303||r>=64336&&r<=65023||r>=65136&&r<=65279||r>=2304&&r<=2431||r>=2432&&r<=2559||r>=2560&&r<=2687||r>=2688&&r<=2815||r>=2816&&r<=2943||r>=2944&&r<=3071||r>=3072&&r<=3199||r>=3200&&r<=3327||r>=3328&&r<=3455||r>=3456&&r<=3583||r>=3584&&r<=3711||r>=3712&&r<=3839||r>=3840&&r<=4095||r>=4096&&r<=4255||r>=4256&&r<=4351||r>=4608&&r<=4991||r>=4992&&r<=5023||r>=5024&&r<=5119||r>=6016&&r<=6143||r>=6144&&r<=6319||r>=1328&&r<=1423||r>=4304&&r<=4351||r>=11520&&r<=11567||r>=43392&&r<=43487||r>=7040&&r<=7103||r>=7104&&r<=7167?"cs":"latin"}function B(r,t){let s=r.glyphForCodePoint(t);return s!=null&&s.id!==0}function E(r,t,s=[]){if(r.length===0)return[];let i=[t,...s],x=[],n=null;for(let e of r){let l=e.codePointAt(0),F=y(l),u=t;for(let f of i){let g=p(f);if(g&&B(g,l)){u=f;break}}n&&n.fontFamily===u&&n.script===F?n.text+=e:(n={text:e,fontFamily:u,script:F},x.push(n))}return x}import{createRequire as D}from"node:module";var A=D(import.meta.url),b=A("bidi-js"),h=b();function a(r){return(r&1)===1?"rtl":"ltr"}function S(r,t){let s=r.rtl??t?.rtl;if(s===!0)return"rtl";if(s===!1)return"ltr"}function v(r,t){if(r.length===0)return t??"ltr";let i=h.getEmbeddingLevels(r,t).paragraphs[0];return i?a(i.level):t??"ltr"}function c(r,t){if(r.length===0)return[];let s=h.getEmbeddingLevels(r,t),{levels:i}=s;if(i.length===0)return[{text:r,direction:t??"ltr"}];let x=[],n=0,e=a(i[0]??0);for(let l=1;l<r.length;l++){let F=a(i[l]??i[l-1]??0);F!==e&&(x.push({text:r.slice(n,l),direction:e}),n=l,e=F)}return x.push({text:r.slice(n),direction:e}),x.filter(l=>l.text.length>0)}function m(r,t){return t&&t!=="en-US"?t:r==="rtl"?"ar-SA":t??"en-US"}function U(r,t){if(r.rtl===!1)return{...r,rtl:!1,runs:r.runs.map(e=>({...e,style:{...e.style,lang:e.style?.lang??t?.lang??"en-US"}}))};let s=S(r,t),i=r.runs.map(e=>e.text).join(""),x=v(i,s),n=[];for(let e of r.runs){let l=c(e.text,x);if(l.length<=1){let F=l[0]?.direction??x;n.push({...e,style:{...e.style,lang:m(F,e.style?.lang??t?.lang)}});continue}for(let F of l)n.push({...e,text:F.text,style:{...e.style,lang:m(F.direction,e.style?.lang??t?.lang)}})}return{...r,rtl:r.rtl??t?.rtl??(x==="rtl"?!0:void 0),runs:x==="rtl"?n.reverse():n}}export{y as a,E as b,c,U as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-JKZFYDBI.js";var r=914400,s=1280,D=720,T=12192e3,n=6858e3,c=255,o=50*1024*1024,i=3e4,I=500*1024*1024,M=100*1024*1024;function p(e){let t=Math.ceil(e.length*3/4);if(t>o)throw new E(`Data URL exceeds maximum size limit (${(t/1024/1024).toFixed(1)} MB > ${o/1024/1024} MB)`,{code:"RESOURCE_LIMIT_EXCEEDED",phase:"media"})}export{r as a,s as b,D as c,T as d,n as e,c as f,o as g,i as h,I as i,M as j,p as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $}from"./chunk-VGZBBSUY.js";import{e as g}from"./chunk-BRMIGHX5.js";function S(t){return t.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")}function w(t){return S(t).replace(/[<>&'"]/g,e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return""";default:return e}})}function u(t){return w(t)}var O=new Set($);function b(t){return typeof t=="object"&&"scheme"in t?!0:O.has(t)}function x(t){let e=t.replace("#","").toUpperCase();return/^[0-9A-F]{6}$/.test(e)?e:/^[0-9A-F]{3}$/.test(e)?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:/^[0-9A-F]{8}$/.test(e)?e.slice(0,6):"000000"}function L(t){return b(t)?{type:"scheme",value:t}:{type:"srgb",value:x(t)}}function A(t,e){let i="";return t.tint!==void 0&&(i+=`<a:tint val="${Math.round(t.tint*1e3)}"/>`),t.shade!==void 0&&(i+=`<a:shade val="${Math.round(t.shade*1e3)}"/>`),t.comp&&(i+="<a:comp/>"),t.inv&&(i+="<a:inv/>"),t.gray&&(i+="<a:gray/>"),e!==void 0&&(i+=`<a:alpha val="${e}"/>`),t.hueMod!==void 0&&(i+=`<a:hueMod val="${Math.round(t.hueMod*1e3)}"/>`),t.hueOff!==void 0&&(i+=`<a:hueOff val="${Math.round(t.hueOff*6e4)}"/>`),t.satMod!==void 0&&(i+=`<a:satMod val="${Math.round(t.satMod*1e3)}"/>`),t.satOff!==void 0&&(i+=`<a:satOff val="${Math.round(t.satOff*1e3)}"/>`),t.lumMod!==void 0&&(i+=`<a:lumMod val="${Math.round(t.lumMod*1e3)}"/>`),t.lumOff!==void 0&&(i+=`<a:lumOff val="${Math.round(t.lumOff*1e3)}"/>`),i}function m(t,e){let i=e!==void 0&&e<1?Math.min(1e5,Math.max(0,Math.round(e*1e5))):void 0;if(typeof t=="object"&&"scheme"in t){let r=A(t,i),a=u(t.scheme);return r?`<a:schemeClr val="${a}">${r}</a:schemeClr>`:`<a:schemeClr val="${a}"/>`}if(b(t)){let r=u(t);return i!==void 0?`<a:schemeClr val="${r}"><a:alpha val="${i}"/></a:schemeClr>`:`<a:schemeClr val="${r}"/>`}let n=x(t);return i!==void 0?`<a:srgbClr val="${n}"><a:alpha val="${i}"/></a:srgbClr>`:`<a:srgbClr val="${n}"/>`}var p=9525,E=2147483647;function s(t){return Math.min(E,Math.max(0,Math.round(t*p)))}function W(t){return Math.round(t*p)}function B(t){let e=t.replace("#","").toUpperCase();return/^[0-9A-F]{3}$/.test(e)?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:/^[0-9A-F]{6}$/.test(e)?e:/^[0-9A-F]{8}$/.test(e)?e.slice(0,6):(g().warn(`[PaperJSX] toHex: invalid color "${t}", falling back to "000000"`),"000000")}function f(t){return m(t)}function h(t,e){return m(t,e)}function R(t){return Math.round(((t+270)%360+360)%360*6e4)}function C(t,e){let i=Math.round(Math.sqrt(t*t+e*e)*p),n=Math.atan2(e,t)*180/Math.PI;n<0&&(n+=360);let r=Math.round(n*6e4);return{dist:i,dir:r}}function _(t,e,i){if(!t)return"";let n=t.fill;if(n){if(n.type==="solid")return e!==void 0&&e<1?`<a:solidFill>${h(n.color,e)}</a:solidFill>`:`<a:solidFill>${f(n.color)}</a:solidFill>`;if(n.type==="pattern"){let a=`<a:pattFill prst="${u(n.pattern)}">`;return a+=`<a:fgClr>${f(n.foreground)}</a:fgClr>`,a+=`<a:bgClr>${f(n.background)}</a:bgClr>`,a+="</a:pattFill>",a}if(n.type==="image"){if(!i)return"";let a=`<a:blipFill><a:blip r:embed="${i}"/>`;return n.tile?a+='<a:tile tx="0" ty="0" sx="100000" sy="100000"/>':a+="<a:stretch><a:fillRect/></a:stretch>",a+="</a:blipFill>",a}let r="<a:gradFill>";r+="<a:gsLst>";for(let a of n.stops){let l=Math.min(1e5,Math.max(0,Math.round(a.position*1e3))),o=e!==void 0&&e<1?a.alpha!==void 0?a.alpha*e:e:a.alpha;r+=`<a:gs pos="${l}">${o!==void 0?h(a.color,o):f(a.color)}</a:gs>`}if(r+="</a:gsLst>",n.type==="linear"){let a=R(n.angle??180);r+=`<a:lin ang="${a}" scaled="1"/>`}else r+='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';return r+="</a:gradFill>",r}return t.backgroundColor?e!==void 0&&e<1?`<a:solidFill>${h(t.backgroundColor,e)}</a:solidFill>`:`<a:solidFill>${f(t.backgroundColor)}</a:solidFill>`:""}function j(t){if(!t)return"<a:ln><a:noFill/><a:round/></a:ln>";let e=t.borderWidth;if(e&&e>0){let i=s(e),n={flat:"flat",round:"rnd",square:"sq"},r=t.borderCap?` cap="${n[t.borderCap]||"flat"}"`:"",a={single:"sng",double:"dbl",thickThin:"thickThin",thinThick:"thinThick",triple:"tri"},l=t.borderCompound?` cmpd="${a[t.borderCompound]||"sng"}"`:"",o=`<a:ln w="${i}"${r}${l}>`;o+=`<a:solidFill>${f(t.borderColor||"#000000")}</a:solidFill>`;let d=t.borderStyle;return d&&d!=="solid"&&(o+=`<a:prstDash val="${{dashed:"dash",dotted:"dot",dotDash:"dashDot"}[d]||"solid"}"/>`),o+="<a:round/>",o+="</a:ln>",o}return"<a:ln><a:noFill/><a:round/></a:ln>"}function q(t){let e=t.camera,i=e.fov!==void 0?` fov="${Math.round(e.fov*6e4)}"`:"",n=t.lightRig,r="<a:scene3d>";return r+=`<a:camera prst="${u(e.preset)}"${i}/>`,r+=`<a:lightRig rig="${u(n.type)}" dir="${u(n.direction)}"/>`,r+="</a:scene3d>",r}function P(t){let e=[];t.material&&e.push(`prstMaterial="${u(t.material)}"`),t.extrudeHeight!==void 0&&e.push(`extrusionH="${s(t.extrudeHeight)}"`),t.contourWidth!==void 0&&e.push(`contourW="${s(t.contourWidth)}"`);let n=`<a:sp3d${e.length>0?" "+e.join(" "):""}>`;if(t.bevelTop){let r=s(t.bevelTop.width??6),a=s(t.bevelTop.height??6);n+=`<a:bevelT w="${r}" h="${a}" prst="${u(t.bevelTop.preset)}"/>`}if(t.bevelBottom){let r=s(t.bevelBottom.width??6),a=s(t.bevelBottom.height??6);n+=`<a:bevelB w="${r}" h="${a}" prst="${u(t.bevelBottom.preset)}"/>`}return t.extrudeColor&&(n+=`<a:extrusionClr>${f(t.extrudeColor)}</a:extrusionClr>`),t.contourColor&&(n+=`<a:contourClr>${f(t.contourColor)}</a:contourClr>`),n+="</a:sp3d>",n}function U(t){if(!t?.effects)return"";let{dropShadow:e,innerShadow:i,glow:n,reflection:r,softEdge:a}=t.effects;if(!e&&!i&&!n&&!r&&!a)return"";let l="<a:effectLst>";if(n){let o=s(n.radius);l+=`<a:glow rad="${o}">${h(n.color,n.opacity)}</a:glow>`}if(i){let{dist:o,dir:d}=C(i.offsetX,i.offsetY),c=s(i.blurRadius);l+=`<a:innerShdw blurRad="${c}" dist="${o}" dir="${d}">`,l+=h(i.color,i.opacity),l+="</a:innerShdw>"}if(e){let{dist:o,dir:d}=C(e.offsetX,e.offsetY),c=s(e.blurRadius);l+=`<a:outerShdw blurRad="${c}" dist="${o}" dir="${d}" algn="ctr" rotWithShape="0">`,l+=h(e.color,e.opacity),l+="</a:outerShdw>"}if(r){let o=r.blurRadius!==void 0?s(r.blurRadius):0,d=r.startOpacity!==void 0?Math.round(r.startOpacity*1e5):5e4,c=r.endOpacity!==void 0?Math.round(r.endOpacity*1e5):0,M=r.distance!==void 0?s(r.distance):0,v=r.direction!==void 0?Math.round(r.direction*6e4):54e5,F=r.size!==void 0?`-${Math.round(r.size*1e3)}`:"-100000";l+=`<a:reflection blurRad="${o}" stA="${d}" endA="${c}" dist="${M}" dir="${v}" sy="${F}" algn="bl" rotWithShape="0"/>`}return a&&(l+=`<a:softEdge rad="${s(a.radius)}"/>`),l+="</a:effectLst>",l}export{w as a,u as b,b as c,L as d,p as e,s as f,W as g,B as h,f as i,h as j,R as k,C as l,_ as m,j as n,q as o,P as p,U as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./chunk-JBV3SHHJ.js";import{c as $}from"./chunk-HGXLLLMM.js";import{e as l}from"./chunk-BRMIGHX5.js";import{h as E}from"./chunk-7OH2BCHB.js";import{a as d}from"./chunk-JKZFYDBI.js";var h=2,N=500;function F(e){return e===429||e===502||e===503||e===504}async function z(e,n){let t;for(let o=0;o<=h;o++){try{let i=n?.signal??AbortSignal.timeout(E),u=await fetch(e,{...n,signal:i});if(u.ok||!F(u.status)||o===h)return u;l().warn(`[fetch] Retryable HTTP ${u.status} for "${e}" (attempt ${o+1}/${h+1})`)}catch(i){if(t=i,t.name==="AbortError"||t.name==="TimeoutError"||o===h)throw t;l().warn(`[fetch] Network error for "${e}" (attempt ${o+1}/${h+1}): ${t.message}`)}let a=N*(o+1),r=$()?a:a*(.85+Math.random()*.3);await new Promise(i=>setTimeout(i,r))}let s=t??new Error(`[fetch] Failed after ${h+1} attempts: ${e}`);throw l().warn(`[fetch] All ${h+1} attempts exhausted for "${e}": ${s.message}`),s}import{resolve4 as S,resolve6 as x}from"node:dns/promises";var O=[e=>e.startsWith("10."),e=>{if(!e.startsWith("172."))return!1;let n=parseInt(e.split(".")[1],10);return n>=16&&n<=31},e=>e.startsWith("192.168."),e=>e.startsWith("169.254."),e=>e.startsWith("127."),e=>e==="0.0.0.0"];function P(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}function y(e){let n=P(e).toLowerCase();if(n==="::1"||n.startsWith("fe80:")||n.startsWith("fe80%"))return!0;if(n.startsWith("::ffff:")){let t=n.slice(7);if(t.includes(".")&&p(t)||C(t))return!0}return!1}function C(e){let n=e.split(":");if(n.length!==2)return!1;let t=parseInt(n[0],16),s=parseInt(n[1],16);if(isNaN(t)||isNaN(s))return!1;let o=`${t>>8&255}.${t&255}.${s>>8&255}.${s&255}`;return p(o)}function p(e){return O.some(n=>n(e))}function U(e){let n;try{n=new URL(e)}catch{throw new d(`Invalid URL: ${e}`,{code:"VALIDATION_FAILED",phase:"media"})}if(!["http:","https:"].includes(n.protocol))throw new d(`Blocked URL scheme "${n.protocol}" \u2014 only http: and https: are allowed`,{code:"VALIDATION_FAILED",phase:"media"});let s=n.hostname.toLowerCase();if(s==="localhost")throw new d("Blocked URL: requests to localhost are not allowed",{code:"VALIDATION_FAILED",phase:"media"});if(p(s))throw new d(`Blocked URL: hostname "${s}" resolves to a private IPv4 address`,{code:"VALIDATION_FAILED",phase:"media"});if(y(s))throw new d(`Blocked URL: hostname "${s}" resolves to a private/loopback IPv6 address`,{code:"VALIDATION_FAILED",phase:"media"})}function V(e){return!!(/^\d{1,3}(\.\d{1,3}){3}$/.test(e)||e.includes(":"))}function D(e){if(p(e))throw new d(`Blocked URL: hostname resolves to private IPv4 address ${e}`,{code:"VALIDATION_FAILED",phase:"media"});if(y(e))throw new d(`Blocked URL: hostname resolves to private/loopback IPv6 address ${e}`,{code:"VALIDATION_FAILED",phase:"media"})}async function Q(e){U(e);let t=new URL(e).hostname.toLowerCase();if(V(P(t)))return;let s=5e3,o=new d("DNS resolution timed out",{code:"VALIDATION_FAILED",phase:"media"}),a=r=>Promise.race([r,new Promise((i,u)=>setTimeout(()=>u(o),s))]);try{let r=await a(S(t));for(let i of r)D(i)}catch(r){if(r instanceof d)throw r}try{let r=await a(x(t));for(let i of r)D(i)}catch(r){if(r instanceof d)throw r}}function M(e,n,t){return Math.max(n,Math.min(t,e))}function W(e){let n=parseInt(e.slice(0,2),16),t=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16);return[n,t,s]}function k(e,n,t){e/=255,n/=255,t/=255;let s=Math.max(e,n,t),o=Math.min(e,n,t),a=(s+o)/2;if(s===o)return[0,0,a];let r=s-o,i=a>.5?r/(2-s-o):r/(s+o),u=0;return s===e?u=((n-t)/r+(n<t?6:0))/6:s===n?u=((t-e)/r+2)/6:u=((e-n)/r+4)/6,[u*360,i,a]}function B(e,n,t){if(e=(e%360+360)%360,n===0){let r=Math.round(t*255);return[r,r,r]}let s=(r,i,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<1/6?r+(i-r)*6*u:u<1/2?i:u<2/3?r+(i-r)*(2/3-u)*6:r),o=t<.5?t*(1+n):t+n-t*n,a=2*t-o;return[Math.round(s(a,o,e/360+1/3)*255),Math.round(s(a,o,e/360)*255),Math.round(s(a,o,e/360-1/3)*255)]}function H(e,n,t,s){let o=s/100;return[Math.round(e+(255-e)*o),Math.round(n+(255-n)*o),Math.round(t+(255-t)*o)]}function j(e,n,t,s){let o=s/100;return[Math.round(e*o),Math.round(n*o),Math.round(t*o)]}function _(e,n){let t=n?.[e];return t?t.replace(/^#/,""):R[e]}function te(e,n){if(e==null)return;if(typeof e=="string"){if(e.startsWith("#"))return e;if(/^[0-9A-Fa-f]{6}$/.test(e))return`#${e}`;let f=_(e,n);return f?`#${f}`:e}let t=e,s=_(t.scheme,n);if(!s)return"#000000";let o=f=>f!==void 0&&Number.isFinite(f)?f:void 0,[a,r,i]=W(s),u=o(t.tint),g=o(t.shade);u!==void 0&&([a,r,i]=H(a,r,i,u)),g!==void 0&&([a,r,i]=j(a,r,i,g));let b=o(t.lumMod),I=o(t.lumOff),w=o(t.satMod),v=o(t.satOff),A=o(t.hueMod),T=o(t.hueOff);if(b!==void 0||I!==void 0||w!==void 0||v!==void 0||A!==void 0||T!==void 0){let[f,c,m]=k(a,r,i);b!==void 0&&(m=m*(b/100)),I!==void 0&&(m=m+I/100),w!==void 0&&(c=c*(w/100)),v!==void 0&&(c=c+v/100),A!==void 0&&(f=f*(A/100)),T!==void 0&&(f=f+T/6e4),m=M(m,0,1),c=M(c,0,1),[a,r,i]=B(f,c,m)}if(t.comp&&(a=255-a,r=255-r,i=255-i),t.inv&&(a=255-a,r=255-r,i=255-i),t.gray){let f=Math.round(.299*a+.587*r+.114*i);a=f,r=f,i=f}let L=f=>M(Math.round(f),0,255).toString(16).padStart(2,"0");return`#${L(a)}${L(r)}${L(i)}`}export{z as a,U as b,Q as c,te as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AsyncLocalStorage as g}from"node:async_hooks";var s=new g;function n(){return s.getStore()}var t=class{_logger={warn(e){console.warn(e)}};setLogger(e){if(!e||typeof e.warn!="function")throw new Error("setLogger: logger must implement warn(message: string)");this._logger=e}getLogger(){return this._logger}},o=new t;function m(r){(n()?.logger??o).setLogger(r)}function d(){let e=n()?.logger;return e?e.getLogger():o.getLogger()}export{s as a,n as b,t as c,m as d,d as e};
|