ooxml-core 1.19.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -1
- package/dist/{PptxHandler-6TNIQ7S5.cjs → PptxHandler-DNSXWTQV.cjs} +3 -3
- package/dist/{PptxHandler-2V4PQL6O.mjs → PptxHandler-FSKKPZZC.mjs} +3 -3
- package/dist/PptxHandler-H7MEWJJJ.mjs +4 -0
- package/dist/{PresentationBuilder-G7MPEGXJ.mjs → PresentationBuilder-7TSENZTX.mjs} +2 -2
- package/dist/{PresentationBuilder-RM52LCVN.cjs → PresentationBuilder-A5NI35VN.cjs} +5 -5
- package/dist/{PresentationBuilder-HQ6C7L4V.mjs → PresentationBuilder-RIJWQSEU.mjs} +3 -3
- package/dist/automation/docx-forms.d.ts +26 -0
- package/dist/automation/docx-forms.d.ts.map +1 -0
- package/dist/automation/index.cjs +6280 -2506
- package/dist/automation/index.d.ts +1 -0
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.mjs +6277 -2507
- package/dist/automation/xlsx-read.d.ts +56 -0
- package/dist/automation/xlsx-read.d.ts.map +1 -0
- package/dist/automation/xlsx.d.ts +105 -4
- package/dist/automation/xlsx.d.ts.map +1 -1
- package/dist/chart/axis-range.d.ts.map +1 -1
- package/dist/chart/bubble-radius.d.ts +0 -5
- package/dist/chart/bubble-radius.d.ts.map +1 -1
- package/dist/chart/extent.d.ts +9 -0
- package/dist/chart/extent.d.ts.map +1 -0
- package/dist/chart/histogram-binning.d.ts.map +1 -1
- package/dist/chart/index.cjs +56 -18
- package/dist/chart/index.mjs +56 -18
- package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-legend.d.ts.map +1 -1
- package/dist/chart/render/chart-view-ex.d.ts.map +1 -1
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/trendline-fit.d.ts.map +1 -1
- package/dist/{chunk-NYTR4UZ5.cjs → chunk-4LZIUJI3.cjs} +52 -12
- package/dist/{chunk-SLNQNVQM.mjs → chunk-4QPOJCJG.mjs} +45 -8
- package/dist/{chunk-XTSHZGSM.mjs → chunk-6IIMI5RS.mjs} +52 -12
- package/dist/{chunk-TJPUAUWL.mjs → chunk-BA7Z6ATM.mjs} +9 -195
- package/dist/{chunk-JUABSM7C.mjs → chunk-DLFMCZZT.mjs} +1 -1
- package/dist/{chunk-M4XLF4R7.mjs → chunk-GBKBR4CX.mjs} +20 -8
- package/dist/{chunk-R5FIHHGB.cjs → chunk-HL3FBJ6X.cjs} +1648 -1205
- package/dist/{chunk-ZJ2OKIJN.mjs → chunk-LF5E5ZOH.mjs} +642 -199
- package/dist/{chunk-4FTUAD2B.mjs → chunk-Q5PKBQXH.mjs} +766 -202
- package/dist/{chunk-M6GDBVQ7.mjs → chunk-VQF6HQEE.mjs} +1 -1
- package/dist/collab/embedding.d.ts +103 -0
- package/dist/collab/embedding.d.ts.map +1 -0
- package/dist/collab/index.cjs +450 -342
- package/dist/collab/index.d.ts +1 -0
- package/dist/collab/index.d.ts.map +1 -1
- package/dist/collab/index.mjs +443 -343
- package/dist/color/theme-palette.d.ts +5 -1
- package/dist/color/theme-palette.d.ts.map +1 -1
- package/dist/crypto/index.cjs +27 -2
- package/dist/crypto/index.mjs +27 -2
- package/dist/diagram/index.cjs +31 -3
- package/dist/diagram/index.mjs +31 -3
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/cell-blocks.d.ts +7 -1
- package/dist/docx/cell-blocks.d.ts.map +1 -1
- package/dist/docx/content-control-edit.d.ts +14 -0
- package/dist/docx/content-control-edit.d.ts.map +1 -1
- package/dist/docx/content-control-model.d.ts +8 -0
- package/dist/docx/content-control-model.d.ts.map +1 -1
- package/dist/docx/content-control-values.d.ts +20 -0
- package/dist/docx/content-control-values.d.ts.map +1 -0
- package/dist/docx/content-control.d.ts +7 -1
- package/dist/docx/content-control.d.ts.map +1 -1
- package/dist/docx/element-order.d.ts +10 -5
- package/dist/docx/element-order.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +3861 -1379
- package/dist/docx/embedded.mjs +3861 -1379
- package/dist/docx/field-instruction.d.ts +22 -0
- package/dist/docx/field-instruction.d.ts.map +1 -0
- package/dist/docx/form-field-model.d.ts +48 -0
- package/dist/docx/form-field-model.d.ts.map +1 -0
- package/dist/docx/form-fields.d.ts +31 -0
- package/dist/docx/form-fields.d.ts.map +1 -0
- package/dist/docx/form-fill-fields.d.ts +61 -0
- package/dist/docx/form-fill-fields.d.ts.map +1 -0
- package/dist/docx/form-fill-labels.d.ts +8 -0
- package/dist/docx/form-fill-labels.d.ts.map +1 -0
- package/dist/docx/form-fill-sites.d.ts +59 -0
- package/dist/docx/form-fill-sites.d.ts.map +1 -0
- package/dist/docx/form-fill-values.d.ts +28 -0
- package/dist/docx/form-fill-values.d.ts.map +1 -0
- package/dist/docx/form-fill-write.d.ts +26 -0
- package/dist/docx/form-fill-write.d.ts.map +1 -0
- package/dist/docx/glossary.d.ts +15 -0
- package/dist/docx/glossary.d.ts.map +1 -0
- package/dist/docx/index.cjs +5929 -3153
- package/dist/docx/index.d.ts +7 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +5913 -3154
- package/dist/docx/inline-annotations.d.ts +21 -0
- package/dist/docx/inline-annotations.d.ts.map +1 -0
- package/dist/docx/inline-container-markers.d.ts +14 -0
- package/dist/docx/inline-container-markers.d.ts.map +1 -0
- package/dist/docx/inline-containers.d.ts +54 -0
- package/dist/docx/inline-containers.d.ts.map +1 -0
- package/dist/docx/inline-form-field-bookmarks.d.ts +15 -0
- package/dist/docx/inline-form-field-bookmarks.d.ts.map +1 -0
- package/dist/docx/inline-marker-positions.d.ts +15 -0
- package/dist/docx/inline-marker-positions.d.ts.map +1 -0
- package/dist/docx/inline-markers.d.ts +63 -0
- package/dist/docx/inline-markers.d.ts.map +1 -0
- package/dist/docx/inline-slots.d.ts +24 -0
- package/dist/docx/inline-slots.d.ts.map +1 -0
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +1176 -563
- package/dist/docx/layout/index.d.ts +2 -1
- package/dist/docx/layout/index.d.ts.map +1 -1
- package/dist/docx/layout/index.mjs +1175 -564
- package/dist/docx/layout/input.d.ts +5 -1
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/page-style-refs.d.ts +21 -0
- package/dist/docx/layout/page-style-refs.d.ts.map +1 -0
- package/dist/docx/layout/paragraph-fragments.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +1 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/layout/tab-stops.d.ts +8 -1
- package/dist/docx/layout/tab-stops.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +3969 -1487
- package/dist/docx/load/index.mjs +3969 -1487
- package/dist/docx/model-run.d.ts +24 -2
- package/dist/docx/model-run.d.ts.map +1 -1
- package/dist/docx/model.d.ts +5 -0
- package/dist/docx/model.d.ts.map +1 -1
- package/dist/docx/numbering-format.d.ts.map +1 -1
- package/dist/docx/parse-warnings.d.ts.map +1 -1
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/run-segmentation.d.ts +11 -0
- package/dist/docx/run-segmentation.d.ts.map +1 -0
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/section-model.d.ts +5 -0
- package/dist/docx/section-model.d.ts.map +1 -1
- package/dist/docx/sections.d.ts +4 -2
- package/dist/docx/sections.d.ts.map +1 -1
- package/dist/docx/settings.d.ts +9 -0
- package/dist/docx/settings.d.ts.map +1 -1
- package/dist/docx/special-characters.d.ts +34 -0
- package/dist/docx/special-characters.d.ts.map +1 -0
- package/dist/docx/style-ref-fields.d.ts +40 -0
- package/dist/docx/style-ref-fields.d.ts.map +1 -0
- package/dist/docx/style-ref.d.ts +85 -0
- package/dist/docx/style-ref.d.ts.map +1 -0
- package/dist/docx/table-model.d.ts +2 -2
- package/dist/docx/table-model.d.ts.map +1 -1
- package/dist/docx/ui/break-note-schema.d.ts.map +1 -1
- package/dist/docx/ui/content-control-commands.d.ts +20 -8
- package/dist/docx/ui/content-control-commands.d.ts.map +1 -1
- package/dist/docx/ui/content-control-guard.d.ts +4 -1
- package/dist/docx/ui/content-control-guard.d.ts.map +1 -1
- package/dist/docx/ui/content-control-paste.d.ts +23 -0
- package/dist/docx/ui/content-control-paste.d.ts.map +1 -0
- package/dist/docx/ui/content-control-rows.d.ts +15 -0
- package/dist/docx/ui/content-control-rows.d.ts.map +1 -0
- package/dist/docx/ui/content-control-sources.d.ts +12 -0
- package/dist/docx/ui/content-control-sources.d.ts.map +1 -0
- package/dist/docx/ui/content-control-spans.d.ts +29 -6
- package/dist/docx/ui/content-control-spans.d.ts.map +1 -1
- package/dist/docx/ui/content-control-temporary.d.ts +10 -0
- package/dist/docx/ui/content-control-temporary.d.ts.map +1 -0
- package/dist/docx/ui/form-field-commands.d.ts +41 -0
- package/dist/docx/ui/form-field-commands.d.ts.map +1 -0
- package/dist/docx/ui/form-field-guard.d.ts +24 -0
- package/dist/docx/ui/form-field-guard.d.ts.map +1 -0
- package/dist/docx/ui/form-text-blank.d.ts +18 -0
- package/dist/docx/ui/form-text-blank.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +9276 -7132
- package/dist/docx/ui/index.d.ts +5 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +9259 -7137
- package/dist/docx/ui/positional-tab-input.d.ts +7 -0
- package/dist/docx/ui/positional-tab-input.d.ts.map +1 -0
- package/dist/docx/ui/run-compare.d.ts.map +1 -1
- package/dist/docx/ui/run-extra-mark.d.ts +1 -1
- package/dist/docx/ui/run-extra-mark.d.ts.map +1 -1
- package/dist/docx/ui/schema-marks.d.ts +1 -1
- package/dist/docx/ui/schema-marks.d.ts.map +1 -1
- package/dist/docx/ui/symbol-font.d.ts +4 -0
- package/dist/docx/ui/symbol-font.d.ts.map +1 -0
- package/dist/docx/ui/yjs-collaboration.d.ts +12 -1
- package/dist/docx/ui/yjs-collaboration.d.ts.map +1 -1
- package/dist/docx/write-block-placement.d.ts +7 -0
- package/dist/docx/write-block-placement.d.ts.map +1 -1
- package/dist/docx/write-content-control.d.ts +6 -0
- package/dist/docx/write-content-control.d.ts.map +1 -1
- package/dist/docx/write-header-footer.d.ts +6 -2
- package/dist/docx/write-header-footer.d.ts.map +1 -1
- package/dist/docx/write-inline.d.ts +12 -16
- package/dist/docx/write-inline.d.ts.map +1 -1
- package/dist/docx/write-paragraph.d.ts.map +1 -1
- package/dist/docx/write-revisions.d.ts.map +1 -1
- package/dist/docx/write-run.d.ts.map +1 -1
- package/dist/docx/write-section-properties.d.ts +5 -0
- package/dist/docx/write-section-properties.d.ts.map +1 -0
- package/dist/docx/write-sections.d.ts.map +1 -1
- package/dist/docx/write-table-controls.d.ts +15 -0
- package/dist/docx/write-table-controls.d.ts.map +1 -0
- package/dist/docx/write-table-properties.d.ts.map +1 -1
- package/dist/docx/write-table.d.ts.map +1 -1
- package/dist/docx/write.d.ts.map +1 -1
- package/dist/docx/xml.d.ts +6 -0
- package/dist/docx/xml.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +31 -3
- package/dist/drawingml/index.mjs +31 -3
- package/dist/index.cjs +102 -26
- package/dist/index.mjs +102 -26
- package/dist/math/index.cjs +27 -2
- package/dist/math/index.mjs +27 -2
- package/dist/opc/index.cjs +51 -11
- package/dist/opc/index.mjs +51 -11
- package/dist/opc/zip-folders.d.ts +11 -0
- package/dist/opc/zip-folders.d.ts.map +1 -0
- package/dist/opc/zip-limits.d.ts +9 -0
- package/dist/opc/zip-limits.d.ts.map +1 -1
- package/dist/pptx/automation/index.cjs +995 -462
- package/dist/pptx/automation/index.d.ts +2 -2
- package/dist/pptx/automation/index.mjs +6 -6
- package/dist/pptx/chunks/{index-Bqm-jFG-.d.ts → index-CPhsd7Df.d.ts} +7580 -7507
- package/dist/pptx/chunks/index-CPhsd7Df.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-B9x557hr.d.ts → index-Q5mM8kIR.d.ts} +2 -2
- package/dist/pptx/chunks/{index-B9x557hr.d.ts.map → index-Q5mM8kIR.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +770 -238
- package/dist/pptx/cli/index.mjs +5 -5
- package/dist/pptx/converter/index.cjs +12 -3
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +3 -3
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/index.cjs +1099 -628
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/signature-node/index.cjs +20 -8
- package/dist/pptx/signature-node/index.mjs +2 -2
- package/dist/teams/index.cjs +105 -70
- package/dist/teams/index.mjs +105 -70
- package/dist/text/text-diff.d.ts +15 -0
- package/dist/text/text-diff.d.ts.map +1 -0
- package/dist/visio/index.cjs +220 -46
- package/dist/visio/index.mjs +220 -46
- package/dist/visio/ui/contract.d.ts +8 -2
- package/dist/visio/ui/contract.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +227 -50
- package/dist/visio/ui/index.mjs +227 -50
- package/dist/xlsx/collab/index.cjs +8 -3
- package/dist/xlsx/collab/index.mjs +8 -3
- package/dist/xlsx/compare/cells.d.ts +22 -0
- package/dist/xlsx/compare/cells.d.ts.map +1 -0
- package/dist/xlsx/compare/compare.d.ts +12 -0
- package/dist/xlsx/compare/compare.d.ts.map +1 -0
- package/dist/xlsx/compare/conditional.d.ts +7 -0
- package/dist/xlsx/compare/conditional.d.ts.map +1 -0
- package/dist/xlsx/compare/format-key.d.ts +34 -0
- package/dist/xlsx/compare/format-key.d.ts.map +1 -0
- package/dist/xlsx/compare/group.d.ts +8 -0
- package/dist/xlsx/compare/group.d.ts.map +1 -0
- package/dist/xlsx/compare/index.d.ts +5 -0
- package/dist/xlsx/compare/index.d.ts.map +1 -0
- package/dist/xlsx/compare/rich-text.d.ts +7 -0
- package/dist/xlsx/compare/rich-text.d.ts.map +1 -0
- package/dist/xlsx/compare/sheets.d.ts +22 -0
- package/dist/xlsx/compare/sheets.d.ts.map +1 -0
- package/dist/xlsx/compare/structure.d.ts +11 -0
- package/dist/xlsx/compare/structure.d.ts.map +1 -0
- package/dist/xlsx/compare/text.d.ts +8 -0
- package/dist/xlsx/compare/text.d.ts.map +1 -0
- package/dist/xlsx/compare/types.d.ts +173 -0
- package/dist/xlsx/compare/types.d.ts.map +1 -0
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-html.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-text.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard.d.ts.map +1 -1
- package/dist/xlsx/edit/clone-cell.d.ts +9 -0
- package/dist/xlsx/edit/clone-cell.d.ts.map +1 -0
- package/dist/xlsx/edit/dimensions.d.ts.map +1 -1
- package/dist/xlsx/edit/history-rows.d.ts +7 -0
- package/dist/xlsx/edit/history-rows.d.ts.map +1 -0
- package/dist/xlsx/edit/history.d.ts +19 -4
- package/dist/xlsx/edit/history.d.ts.map +1 -1
- package/dist/xlsx/edit/outline.d.ts.map +1 -1
- package/dist/xlsx/edit/row-autofit.d.ts.map +1 -1
- package/dist/xlsx/edit/timelines.d.ts.map +1 -1
- package/dist/xlsx/formula/change-areas.d.ts +9 -0
- package/dist/xlsx/formula/change-areas.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-prepare.d.ts +8 -0
- package/dist/xlsx/formula/engine-prepare.d.ts.map +1 -1
- package/dist/xlsx/formula/engine.d.ts.map +1 -1
- package/dist/xlsx/formula/spill.d.ts +5 -1
- package/dist/xlsx/formula/spill.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +2551 -1208
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +2544 -1209
- package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
- package/dist/xlsx/layout/navigate.d.ts.map +1 -1
- package/dist/xlsx/layout/style-view.d.ts +5 -0
- package/dist/xlsx/layout/style-view.d.ts.map +1 -1
- package/dist/xlsx/load/csv-dates.d.ts +22 -0
- package/dist/xlsx/load/csv-dates.d.ts.map +1 -0
- package/dist/xlsx/load/csv-import.d.ts +64 -0
- package/dist/xlsx/load/csv-import.d.ts.map +1 -0
- package/dist/xlsx/load/csv-separators.d.ts +13 -0
- package/dist/xlsx/load/csv-separators.d.ts.map +1 -0
- package/dist/xlsx/load/csv-traits.d.ts +20 -0
- package/dist/xlsx/load/csv-traits.d.ts.map +1 -0
- package/dist/xlsx/load/csv.d.ts +8 -4
- package/dist/xlsx/load/csv.d.ts.map +1 -1
- package/dist/xlsx/load/detect.d.ts +13 -0
- package/dist/xlsx/load/detect.d.ts.map +1 -1
- package/dist/xlsx/load/errors.d.ts +1 -0
- package/dist/xlsx/load/errors.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +598 -98
- package/dist/xlsx/load/index.d.ts +3 -1
- package/dist/xlsx/load/index.d.ts.map +1 -1
- package/dist/xlsx/load/index.mjs +597 -99
- package/dist/xlsx/numfmt/format.d.ts +8 -0
- package/dist/xlsx/numfmt/format.d.ts.map +1 -1
- package/dist/xlsx/numfmt/input-date.d.ts +2 -0
- package/dist/xlsx/numfmt/input-date.d.ts.map +1 -1
- package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -1
- package/dist/xlsx/pivot/groups.d.ts.map +1 -1
- package/dist/xlsx/read/index.d.ts +2 -1
- package/dist/xlsx/read/index.d.ts.map +1 -1
- package/dist/xlsx/read/limits.d.ts +50 -0
- package/dist/xlsx/read/limits.d.ts.map +1 -0
- package/dist/xlsx/read/load.d.ts +11 -1
- package/dist/xlsx/read/load.d.ts.map +1 -1
- package/dist/xlsx/read/package.d.ts +5 -23
- package/dist/xlsx/read/package.d.ts.map +1 -1
- package/dist/xlsx/read/shared-strings.d.ts +2 -2
- package/dist/xlsx/read/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-data-source.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts +2 -0
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/stable-key.d.ts +3 -0
- package/dist/xlsx/stable-key.d.ts.map +1 -0
- package/dist/xlsx/styles.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +795 -388
- package/dist/xlsx/ui/index.d.ts +1 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +795 -389
- package/dist/xlsx/ui/selection-format.d.ts +13 -0
- package/dist/xlsx/ui/selection-format.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xml/index.cjs +57 -3
- package/dist/xml/index.mjs +57 -4
- package/dist/xml/lite.d.ts.map +1 -1
- package/dist/xml/xml.d.ts +11 -1
- package/dist/xml/xml.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/PptxHandler-HSPKEP5E.mjs +0 -4
- package/dist/pptx/chunks/index-Bqm-jFG-.d.ts.map +0 -1
package/dist/visio/index.cjs
CHANGED
|
@@ -80,6 +80,19 @@ var DEFAULT_XML_LIMITS = {
|
|
|
80
80
|
maxDepth: 512,
|
|
81
81
|
maxNodes: 5e6
|
|
82
82
|
};
|
|
83
|
+
var XmlLimitError = class extends Error {
|
|
84
|
+
code = "xml-limit";
|
|
85
|
+
/** The limit that was exceeded. */
|
|
86
|
+
limit;
|
|
87
|
+
/** Its value: the largest depth or element count allowed. */
|
|
88
|
+
maximum;
|
|
89
|
+
constructor(message, limit3, maximum) {
|
|
90
|
+
super(message);
|
|
91
|
+
this.name = "XmlLimitError";
|
|
92
|
+
this.limit = limit3;
|
|
93
|
+
this.maximum = maximum;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
83
96
|
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
84
97
|
var MARKUP_SKIPS = [
|
|
85
98
|
["<!--", "-->"],
|
|
@@ -113,11 +126,22 @@ function checkXmlLimits(xml, label, limits = {}) {
|
|
|
113
126
|
continue;
|
|
114
127
|
}
|
|
115
128
|
nodes++;
|
|
116
|
-
if (nodes > maxNodes)
|
|
129
|
+
if (nodes > maxNodes)
|
|
130
|
+
throw new XmlLimitError(
|
|
131
|
+
`${label} XML exceeds the limit of ${maxNodes} elements`,
|
|
132
|
+
"maxNodes",
|
|
133
|
+
maxNodes
|
|
134
|
+
);
|
|
117
135
|
if (!selfClosing && ++depth > maxDepth)
|
|
118
|
-
throw new
|
|
136
|
+
throw new XmlLimitError(
|
|
137
|
+
`${label} XML exceeds the nesting depth limit of ${maxDepth}`,
|
|
138
|
+
"maxDepth",
|
|
139
|
+
maxDepth
|
|
140
|
+
);
|
|
119
141
|
}
|
|
120
142
|
}
|
|
143
|
+
var CRLF_DECLARATION = /^<\?xml[^>]*\?>\r\n/;
|
|
144
|
+
var crlfDeclarations = /* @__PURE__ */ new WeakSet();
|
|
121
145
|
function parseXml(xml, options2 = {}) {
|
|
122
146
|
const label = options2.label ?? "OOXML";
|
|
123
147
|
if (/<!DOCTYPE|<!ENTITY/i.test(xml))
|
|
@@ -139,9 +163,13 @@ function parseXml(xml, options2 = {}) {
|
|
|
139
163
|
}
|
|
140
164
|
if (parseError || !parsed.documentElement)
|
|
141
165
|
throw new Error(`Invalid ${label} XML: ${parseError || "missing root element"}`);
|
|
166
|
+
if (CRLF_DECLARATION.test(xml)) crlfDeclarations.add(parsed);
|
|
142
167
|
return parsed;
|
|
143
168
|
}
|
|
144
|
-
var buildXml = (node3) =>
|
|
169
|
+
var buildXml = (node3) => {
|
|
170
|
+
const xml = new xmldom.XMLSerializer().serializeToString(node3);
|
|
171
|
+
return crlfDeclarations.has(node3) ? xml.replace(/^(<\?xml[^>]*\?>)\n/, "$1\r\n") : xml;
|
|
172
|
+
};
|
|
145
173
|
var isElement = (node3) => node3.nodeType === 1;
|
|
146
174
|
var elements = (parent) => Array.from(parent.childNodes).filter(isElement);
|
|
147
175
|
function named(element2, local, ns, lenient = true) {
|
|
@@ -240,6 +268,12 @@ function parseLiteFragment(xml, container, namespaces) {
|
|
|
240
268
|
}
|
|
241
269
|
if (lt < 0) break;
|
|
242
270
|
const next = source.charCodeAt(lt + 1);
|
|
271
|
+
if (next === 33) {
|
|
272
|
+
const after = skipCommentOrCdata(source, lt, top);
|
|
273
|
+
if (after < 0) return void 0;
|
|
274
|
+
pos = after;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
243
277
|
if (next === 47) {
|
|
244
278
|
const gt = source.indexOf(">", lt);
|
|
245
279
|
if (gt < 0 || stack.length < 2 || source.slice(lt + 2, gt).trimEnd() !== top.tagName)
|
|
@@ -260,6 +294,25 @@ function parseLiteFragment(xml, container, namespaces) {
|
|
|
260
294
|
}
|
|
261
295
|
return stack.length === 1 ? root2 : void 0;
|
|
262
296
|
}
|
|
297
|
+
var DECLARATIONS = /<!DOCTYPE|<!ENTITY/i;
|
|
298
|
+
function skipCommentOrCdata(source, lt, parent) {
|
|
299
|
+
if (source.startsWith("<!--", lt)) {
|
|
300
|
+
const end = source.indexOf("-->", lt + 4);
|
|
301
|
+
if (end < 0) return -1;
|
|
302
|
+
const body = source.slice(lt + 4, end);
|
|
303
|
+
if (body.includes("--") || body.endsWith("-") || DECLARATIONS.test(body)) return -1;
|
|
304
|
+
return end + 3;
|
|
305
|
+
}
|
|
306
|
+
if (source.startsWith("<![CDATA[", lt)) {
|
|
307
|
+
const end = source.indexOf("]]>", lt + 9);
|
|
308
|
+
if (end < 0) return -1;
|
|
309
|
+
const text6 = source.slice(lt + 9, end);
|
|
310
|
+
if (DECLARATIONS.test(text6)) return -1;
|
|
311
|
+
parent.childNodes.push(text6);
|
|
312
|
+
return end + 3;
|
|
313
|
+
}
|
|
314
|
+
return -1;
|
|
315
|
+
}
|
|
263
316
|
function startTag(source, from, namespaces) {
|
|
264
317
|
const n = source.length;
|
|
265
318
|
let i = from;
|
|
@@ -7665,9 +7718,9 @@ function createWorksheet(name3, sheetId5) {
|
|
|
7665
7718
|
};
|
|
7666
7719
|
}
|
|
7667
7720
|
|
|
7668
|
-
// xlsx/
|
|
7669
|
-
function
|
|
7670
|
-
return JSON.stringify(sortKeys(
|
|
7721
|
+
// xlsx/stable-key.ts
|
|
7722
|
+
function stableKey(value3) {
|
|
7723
|
+
return JSON.stringify(sortKeys(value3));
|
|
7671
7724
|
}
|
|
7672
7725
|
function sortKeys(value3) {
|
|
7673
7726
|
if (Array.isArray(value3)) return value3.map(sortKeys);
|
|
@@ -7681,6 +7734,11 @@ function sortKeys(value3) {
|
|
|
7681
7734
|
}
|
|
7682
7735
|
return value3;
|
|
7683
7736
|
}
|
|
7737
|
+
|
|
7738
|
+
// xlsx/styles.ts
|
|
7739
|
+
function styleKey(style2) {
|
|
7740
|
+
return stableKey(style2);
|
|
7741
|
+
}
|
|
7684
7742
|
function styleAt(workbook, styleId) {
|
|
7685
7743
|
const style2 = workbook.styles[styleId ?? 0] ?? workbook.styles[0];
|
|
7686
7744
|
if (!style2) throw new Error("Workbook has no default cell style");
|
|
@@ -10287,10 +10345,13 @@ var DEFAULT_ZIP_LIMITS = {
|
|
|
10287
10345
|
var ZipLimitError = class extends Error {
|
|
10288
10346
|
code = "ZIP_BOMB";
|
|
10289
10347
|
limit;
|
|
10348
|
+
/** The check that failed (absent when the error was built without one). */
|
|
10349
|
+
kind;
|
|
10290
10350
|
constructor(message, details) {
|
|
10291
10351
|
super(message);
|
|
10292
10352
|
this.name = "ZipLimitError";
|
|
10293
10353
|
this.limit = details.limit;
|
|
10354
|
+
this.kind = details.kind;
|
|
10294
10355
|
}
|
|
10295
10356
|
};
|
|
10296
10357
|
var mib = (bytes) => Math.round(bytes / 1048576);
|
|
@@ -10313,7 +10374,7 @@ function resolveLimits(limits) {
|
|
|
10313
10374
|
maxEntryBytes: limits.maxEntryBytes ?? DEFAULT_ZIP_LIMITS.maxEntryBytes,
|
|
10314
10375
|
maxTotalBytes: limits.maxTotalBytes ?? DEFAULT_ZIP_LIMITS.maxTotalBytes,
|
|
10315
10376
|
label: limits.label ?? "ZIP",
|
|
10316
|
-
fail: (message, limit3) => create2 ? create2(message, { limit: limit3 }) : new ZipLimitError(message, { limit: limit3 })
|
|
10377
|
+
fail: (message, limit3, kind) => create2 ? create2(message, { limit: limit3, kind }) : new ZipLimitError(message, { limit: limit3, kind })
|
|
10317
10378
|
};
|
|
10318
10379
|
}
|
|
10319
10380
|
function inflateEntryGuarded(entry3, alreadyRead, limits) {
|
|
@@ -10336,13 +10397,18 @@ function inflateEntryGuarded(entry3, alreadyRead, limits) {
|
|
|
10336
10397
|
size3 += chunk.byteLength;
|
|
10337
10398
|
if (size3 > declared || size3 > r.maxEntryBytes)
|
|
10338
10399
|
return abort(
|
|
10339
|
-
r.fail(
|
|
10400
|
+
r.fail(
|
|
10401
|
+
`${r.label} part ${entry3.name} inflates past its declared size`,
|
|
10402
|
+
r.maxEntryBytes,
|
|
10403
|
+
size3 > declared ? "declaredSize" : "maxEntryBytes"
|
|
10404
|
+
)
|
|
10340
10405
|
);
|
|
10341
10406
|
if (alreadyRead + size3 > r.maxTotalBytes)
|
|
10342
10407
|
return abort(
|
|
10343
10408
|
r.fail(
|
|
10344
10409
|
`${r.label} package exceeds the ${mib(r.maxTotalBytes)} MiB uncompressed content limit`,
|
|
10345
|
-
r.maxTotalBytes
|
|
10410
|
+
r.maxTotalBytes,
|
|
10411
|
+
"maxTotalBytes"
|
|
10346
10412
|
)
|
|
10347
10413
|
);
|
|
10348
10414
|
chunks.push(chunk);
|
|
@@ -10375,26 +10441,29 @@ function guardZip(zip, limits = {}) {
|
|
|
10375
10441
|
if (entries.length > r.maxEntries)
|
|
10376
10442
|
throw r.fail(
|
|
10377
10443
|
`${r.label} package exceeds the ${r.maxEntries.toLocaleString("en-US")} part limit`,
|
|
10378
|
-
r.maxEntries
|
|
10444
|
+
r.maxEntries,
|
|
10445
|
+
"maxEntries"
|
|
10379
10446
|
);
|
|
10380
10447
|
let declared = 0;
|
|
10381
10448
|
for (const entry3 of entries) {
|
|
10382
10449
|
const original = entry3.unsafeOriginalName;
|
|
10383
10450
|
if (!isSafePartName(entry3.name) || original !== void 0 && !isSafePartName(original))
|
|
10384
|
-
throw r.fail(`${r.label} package has an unsafe part name`, r.maxEntries);
|
|
10451
|
+
throw r.fail(`${r.label} package has an unsafe part name`, r.maxEntries, "partName");
|
|
10385
10452
|
if (entry3.dir) continue;
|
|
10386
10453
|
const size3 = declaredEntrySize(entry3);
|
|
10387
10454
|
if (size3 > r.maxEntryBytes)
|
|
10388
10455
|
throw r.fail(
|
|
10389
10456
|
`${r.label} part ${entry3.name} exceeds the uncompressed part size limit`,
|
|
10390
|
-
r.maxEntryBytes
|
|
10457
|
+
r.maxEntryBytes,
|
|
10458
|
+
"maxEntryBytes"
|
|
10391
10459
|
);
|
|
10392
10460
|
declared += size3;
|
|
10393
10461
|
}
|
|
10394
10462
|
if (declared > r.maxTotalBytes)
|
|
10395
10463
|
throw r.fail(
|
|
10396
10464
|
`${r.label} package exceeds the ${mib(r.maxTotalBytes)} MiB uncompressed content limit`,
|
|
10397
|
-
r.maxTotalBytes
|
|
10465
|
+
r.maxTotalBytes,
|
|
10466
|
+
"maxTotalBytes"
|
|
10398
10467
|
);
|
|
10399
10468
|
const produced = /* @__PURE__ */ new Map();
|
|
10400
10469
|
let total = 0;
|
|
@@ -12263,10 +12332,69 @@ function mergeComments(legacy, threaded) {
|
|
|
12263
12332
|
(a2, b) => a2.address.row - b.address.row || a2.address.col - b.address.col
|
|
12264
12333
|
);
|
|
12265
12334
|
}
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
var
|
|
12269
|
-
|
|
12335
|
+
|
|
12336
|
+
// xlsx/read/limits.ts
|
|
12337
|
+
var DEFAULT_XLSX_LOAD_LIMITS = {
|
|
12338
|
+
maxInputBytes: 50 * 1024 * 1024,
|
|
12339
|
+
maxParts: 1e4,
|
|
12340
|
+
maxPartBytes: 200 * 1024 * 1024,
|
|
12341
|
+
maxTotalBytes: 300 * 1024 * 1024,
|
|
12342
|
+
maxXmlElements: 5e6
|
|
12343
|
+
};
|
|
12344
|
+
var WorkbookTooLargeError = class extends Error {
|
|
12345
|
+
code = "workbook-too-large";
|
|
12346
|
+
/** The limit that was exceeded, as named in {@link XlsxLoadLimits}. */
|
|
12347
|
+
limit;
|
|
12348
|
+
/** The value of that limit when the load failed. */
|
|
12349
|
+
maximum;
|
|
12350
|
+
constructor(message, limit3, maximum, options2) {
|
|
12351
|
+
super(message, options2);
|
|
12352
|
+
this.name = "WorkbookTooLargeError";
|
|
12353
|
+
this.limit = limit3;
|
|
12354
|
+
this.maximum = maximum;
|
|
12355
|
+
}
|
|
12356
|
+
};
|
|
12357
|
+
function resolveLoadLimits(limits = {}) {
|
|
12358
|
+
const resolved = { ...DEFAULT_XLSX_LOAD_LIMITS };
|
|
12359
|
+
for (const name3 of Object.keys(resolved)) {
|
|
12360
|
+
const value3 = limits[name3];
|
|
12361
|
+
if (value3 === void 0) continue;
|
|
12362
|
+
if (!Number.isFinite(value3) || value3 <= 0)
|
|
12363
|
+
throw new RangeError(`limits.${name3} must be a positive finite number`);
|
|
12364
|
+
resolved[name3] = value3;
|
|
12365
|
+
}
|
|
12366
|
+
return resolved;
|
|
12367
|
+
}
|
|
12368
|
+
var ZIP_LIMIT_NAMES = {
|
|
12369
|
+
maxInputBytes: "maxInputBytes",
|
|
12370
|
+
maxEntries: "maxParts",
|
|
12371
|
+
maxEntryBytes: "maxPartBytes",
|
|
12372
|
+
maxTotalBytes: "maxTotalBytes"
|
|
12373
|
+
};
|
|
12374
|
+
function zipLimitsFor(limits) {
|
|
12375
|
+
return {
|
|
12376
|
+
maxInputBytes: limits.maxInputBytes,
|
|
12377
|
+
maxEntries: limits.maxParts,
|
|
12378
|
+
maxEntryBytes: limits.maxPartBytes,
|
|
12379
|
+
maxTotalBytes: limits.maxTotalBytes,
|
|
12380
|
+
label: "XLSX",
|
|
12381
|
+
createError: (message, { limit: limit3, kind }) => {
|
|
12382
|
+
const name3 = ZIP_LIMIT_NAMES[kind];
|
|
12383
|
+
return name3 ? new WorkbookTooLargeError(message, name3, limit3) : new ZipLimitError(message, { limit: limit3, kind });
|
|
12384
|
+
}
|
|
12385
|
+
};
|
|
12386
|
+
}
|
|
12387
|
+
function parseDataXml(xml, label, maxXmlElements = DEFAULT_XLSX_LOAD_LIMITS.maxXmlElements) {
|
|
12388
|
+
try {
|
|
12389
|
+
return parseXml(xml, { label, limits: { maxNodes: maxXmlElements } });
|
|
12390
|
+
} catch (error) {
|
|
12391
|
+
if (error instanceof XmlLimitError && error.limit === "maxNodes")
|
|
12392
|
+
throw new WorkbookTooLargeError(error.message, "maxXmlElements", error.maximum, {
|
|
12393
|
+
cause: error
|
|
12394
|
+
});
|
|
12395
|
+
throw error;
|
|
12396
|
+
}
|
|
12397
|
+
}
|
|
12270
12398
|
var CONTENT_TYPES = {
|
|
12271
12399
|
workbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
|
|
12272
12400
|
workbookMacro: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
|
|
@@ -12337,16 +12465,15 @@ var SourceIndex = class {
|
|
|
12337
12465
|
};
|
|
12338
12466
|
var mib2 = (bytes) => Math.round(bytes / 1048576);
|
|
12339
12467
|
async function readZipParts(input, limits = {}) {
|
|
12340
|
-
const
|
|
12341
|
-
const
|
|
12342
|
-
maxEntries: limits.maxParts ?? MAX_PARTS,
|
|
12343
|
-
maxEntryBytes: limits.maxPartBytes ?? MAX_PART_BYTES,
|
|
12344
|
-
maxTotalBytes: limits.maxTotalBytes ?? MAX_UNCOMPRESSED_BYTES,
|
|
12345
|
-
label: "XLSX"
|
|
12346
|
-
};
|
|
12468
|
+
const resolved = resolveLoadLimits(limits);
|
|
12469
|
+
const maxInput = resolved.maxInputBytes;
|
|
12347
12470
|
const bytes = input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
12348
12471
|
if (bytes.byteLength > maxInput)
|
|
12349
|
-
throw new
|
|
12472
|
+
throw new WorkbookTooLargeError(
|
|
12473
|
+
`XLSX package exceeds the ${mib2(maxInput)} MiB compressed input limit`,
|
|
12474
|
+
"maxInputBytes",
|
|
12475
|
+
maxInput
|
|
12476
|
+
);
|
|
12350
12477
|
let loaded;
|
|
12351
12478
|
try {
|
|
12352
12479
|
loaded = await JSZip__default.default.loadAsync(bytes);
|
|
@@ -12356,7 +12483,7 @@ async function readZipParts(input, limits = {}) {
|
|
|
12356
12483
|
{ cause: error }
|
|
12357
12484
|
);
|
|
12358
12485
|
}
|
|
12359
|
-
const zip = guardZip(loaded,
|
|
12486
|
+
const zip = guardZip(loaded, zipLimitsFor(resolved));
|
|
12360
12487
|
const parts = /* @__PURE__ */ new Map();
|
|
12361
12488
|
for (const entry3 of Object.values(zip.files)) {
|
|
12362
12489
|
if (entry3.dir) continue;
|
|
@@ -12563,9 +12690,9 @@ function parseRichString(element2, palette) {
|
|
|
12563
12690
|
const text6 = parsed.map((run) => run.text).join("");
|
|
12564
12691
|
return { text: text6, runs: parsed };
|
|
12565
12692
|
}
|
|
12566
|
-
function parseSharedStrings(xml, palette) {
|
|
12693
|
+
function parseSharedStrings(xml, palette, maxXmlElements) {
|
|
12567
12694
|
if (!xml) return [];
|
|
12568
|
-
const root2 =
|
|
12695
|
+
const root2 = parseDataXml(xml, "XLSX shared strings", maxXmlElements).documentElement;
|
|
12569
12696
|
return xChildren(root2, "si").map((si) => parseRichString(si, palette));
|
|
12570
12697
|
}
|
|
12571
12698
|
|
|
@@ -17156,21 +17283,50 @@ function rootNamespaces(xml) {
|
|
|
17156
17283
|
for (const match of (root2[2] ?? "").matchAll(DECLARATION2)) out[match[1] ?? ""] = match[3] ?? "";
|
|
17157
17284
|
return out;
|
|
17158
17285
|
}
|
|
17286
|
+
var SPECIAL = /<[!?]/g;
|
|
17287
|
+
var SECTIONS = [
|
|
17288
|
+
["<!--", "-->"],
|
|
17289
|
+
["<![CDATA[", "]]>"],
|
|
17290
|
+
["<?", "?>"]
|
|
17291
|
+
];
|
|
17292
|
+
function blankComments(xml) {
|
|
17293
|
+
if (!xml.includes("<!--") && !xml.includes("<![CDATA[")) return xml;
|
|
17294
|
+
const pieces = [];
|
|
17295
|
+
let copied = 0;
|
|
17296
|
+
SPECIAL.lastIndex = 0;
|
|
17297
|
+
for (let match = SPECIAL.exec(xml); match; match = SPECIAL.exec(xml)) {
|
|
17298
|
+
const at2 = match.index;
|
|
17299
|
+
const section3 = SECTIONS.find(([open2]) => xml.startsWith(open2, at2));
|
|
17300
|
+
if (!section3) return void 0;
|
|
17301
|
+
const [open, close4] = section3;
|
|
17302
|
+
const end = xml.indexOf(close4, at2 + open.length);
|
|
17303
|
+
if (end < 0) return void 0;
|
|
17304
|
+
const after = end + close4.length;
|
|
17305
|
+
if (open !== "<?") {
|
|
17306
|
+
pieces.push(xml.slice(copied, at2), " ".repeat(after - at2));
|
|
17307
|
+
copied = after;
|
|
17308
|
+
}
|
|
17309
|
+
SPECIAL.lastIndex = after;
|
|
17310
|
+
}
|
|
17311
|
+
pieces.push(xml.slice(copied));
|
|
17312
|
+
return pieces.join("");
|
|
17313
|
+
}
|
|
17159
17314
|
function splitSheetData(xml) {
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
const
|
|
17315
|
+
const plain4 = blankComments(xml);
|
|
17316
|
+
if (plain4 === void 0) return void 0;
|
|
17317
|
+
const namespaces = rootNamespaces(plain4);
|
|
17318
|
+
const open = OPEN.exec(plain4);
|
|
17163
17319
|
if (!namespaces || !open) return void 0;
|
|
17164
17320
|
const prefix2 = (open[1] ?? "").slice(0, -1);
|
|
17165
17321
|
const ns = namespaces[prefix2];
|
|
17166
17322
|
if (prefix2 && ns === void 0) return void 0;
|
|
17167
17323
|
const tagName2 = `${open[1] ?? ""}sheetData`;
|
|
17168
|
-
const openEnd =
|
|
17324
|
+
const openEnd = plain4.indexOf(">", open.index);
|
|
17169
17325
|
if (openEnd < 0) return void 0;
|
|
17170
|
-
const attributes =
|
|
17326
|
+
const attributes = plain4.slice(open.index + tagName2.length + 1, openEnd);
|
|
17171
17327
|
if (attributes.trimEnd().endsWith("/") || attributes.includes("xmlns")) return void 0;
|
|
17172
|
-
const close4 =
|
|
17173
|
-
if (close4 < 0 || OPEN.test(
|
|
17328
|
+
const close4 = plain4.indexOf(`</${tagName2}`, openEnd);
|
|
17329
|
+
if (close4 < 0 || OPEN.test(plain4.slice(openEnd))) return void 0;
|
|
17174
17330
|
const container = new LiteElement(tagName2, "sheetData", ns || null);
|
|
17175
17331
|
const data = parseLiteFragment(xml.slice(openEnd + 1, close4), container, namespaces);
|
|
17176
17332
|
if (!data) return void 0;
|
|
@@ -17370,7 +17526,11 @@ function parseWorksheet(ctx, partName, name3, sheetId5) {
|
|
|
17370
17526
|
return sheet;
|
|
17371
17527
|
}
|
|
17372
17528
|
const split = splitSheetData(xml);
|
|
17373
|
-
const root2 =
|
|
17529
|
+
const root2 = parseDataXml(
|
|
17530
|
+
split?.xml ?? xml,
|
|
17531
|
+
"XLSX worksheet",
|
|
17532
|
+
ctx.maxXmlElements
|
|
17533
|
+
).documentElement;
|
|
17374
17534
|
const byName = /* @__PURE__ */ new Map();
|
|
17375
17535
|
const cfBlocks = [];
|
|
17376
17536
|
for (const node3 of elements(root2)) {
|
|
@@ -17444,8 +17604,9 @@ function liftPrintAreas(workbook) {
|
|
|
17444
17604
|
return false;
|
|
17445
17605
|
});
|
|
17446
17606
|
}
|
|
17447
|
-
async function loadXlsx(input) {
|
|
17448
|
-
const
|
|
17607
|
+
async function loadXlsx(input, options2 = {}) {
|
|
17608
|
+
const limits = resolveLoadLimits(options2.limits);
|
|
17609
|
+
const parts = await readZipParts(input, limits);
|
|
17449
17610
|
const source = new SourceIndex(parts);
|
|
17450
17611
|
const workbookPart = source.workbookPart();
|
|
17451
17612
|
if (!workbookPart) throw new Error("XLSX package has no workbook part (xl/workbook.xml)");
|
|
@@ -17466,7 +17627,8 @@ async function loadXlsx(input) {
|
|
|
17466
17627
|
source,
|
|
17467
17628
|
sharedStrings: parseSharedStrings(
|
|
17468
17629
|
stringsPart ? source.text(stringsPart) : void 0,
|
|
17469
|
-
styles.palette
|
|
17630
|
+
styles.palette,
|
|
17631
|
+
limits.maxXmlElements
|
|
17470
17632
|
),
|
|
17471
17633
|
xfMap: styles.xfMap,
|
|
17472
17634
|
date1904: book.date1904,
|
|
@@ -17474,7 +17636,8 @@ async function loadXlsx(input) {
|
|
|
17474
17636
|
dxfs: styles.dxfs,
|
|
17475
17637
|
persons: parsePersons(personsPart ? source.text(personsPart) : void 0),
|
|
17476
17638
|
dynamicCells: parseDynamicArrayMetadata(metadataPart ? source.text(metadataPart) : void 0),
|
|
17477
|
-
warn
|
|
17639
|
+
warn,
|
|
17640
|
+
maxXmlElements: limits.maxXmlElements
|
|
17478
17641
|
};
|
|
17479
17642
|
const rels = source.rels(workbookPart);
|
|
17480
17643
|
const sheets = book.sheets.map((entry3) => {
|
|
@@ -17957,14 +18120,24 @@ function formatAxisValue(value3, percent = false) {
|
|
|
17957
18120
|
return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
|
|
17958
18121
|
}
|
|
17959
18122
|
|
|
18123
|
+
// chart/extent.ts
|
|
18124
|
+
function extentOf(values) {
|
|
18125
|
+
let min = Infinity;
|
|
18126
|
+
let max = -Infinity;
|
|
18127
|
+
for (const value3 of values) {
|
|
18128
|
+
min = Math.min(min, value3);
|
|
18129
|
+
max = Math.max(max, value3);
|
|
18130
|
+
}
|
|
18131
|
+
return { min, max };
|
|
18132
|
+
}
|
|
18133
|
+
|
|
17960
18134
|
// chart/axis-range.ts
|
|
17961
18135
|
function computeLogValueRange(series, logBase) {
|
|
17962
18136
|
const allValues = series.flatMap((item) => item.values).filter((value3) => value3 !== null && Number.isFinite(value3) && value3 > 0);
|
|
17963
18137
|
if (allValues.length === 0) {
|
|
17964
18138
|
return { min: 1, max: logBase, span: 1, logScale: true, logBase };
|
|
17965
18139
|
}
|
|
17966
|
-
const dataMin =
|
|
17967
|
-
const dataMax = Math.max(...allValues);
|
|
18140
|
+
const { min: dataMin, max: dataMax } = extentOf(allValues);
|
|
17968
18141
|
const logMin = Math.floor(Math.log(dataMin) / Math.log(logBase));
|
|
17969
18142
|
const logMax = Math.ceil(Math.log(dataMax) / Math.log(logBase));
|
|
17970
18143
|
const min = logBase ** logMin;
|
|
@@ -18692,8 +18865,7 @@ function computeHistogramBins(values, options2, format5 = String) {
|
|
|
18692
18865
|
});
|
|
18693
18866
|
}
|
|
18694
18867
|
if (regular.length > 0) {
|
|
18695
|
-
const min =
|
|
18696
|
-
const max = Math.max(...regular.map((item) => item.value));
|
|
18868
|
+
const { min, max } = extentOf(regular.map((item) => item.value));
|
|
18697
18869
|
const requestedSize = options2.binSize && options2.binSize > 0 ? options2.binSize : void 0;
|
|
18698
18870
|
const requestedCount = options2.binCount && options2.binCount > 0 ? options2.binCount : void 0;
|
|
18699
18871
|
const start = requestedSize ? Math.floor(min / requestedSize) * requestedSize : min;
|
|
@@ -18821,8 +18993,9 @@ function waterfallView(chart, model2, ctx) {
|
|
|
18821
18993
|
colors: { increase: role(0), decrease: role(1), total: role(2) }
|
|
18822
18994
|
};
|
|
18823
18995
|
const ends = steps.flatMap((step2) => [step2.startValue, step2.endValue]);
|
|
18996
|
+
const range2 = extentOf(ends);
|
|
18824
18997
|
model2.valueAxis = {
|
|
18825
|
-
...ends.length ? niceScale(
|
|
18998
|
+
...ends.length ? niceScale(range2.min, range2.max) : niceScale(0, 1),
|
|
18826
18999
|
percent: false
|
|
18827
19000
|
};
|
|
18828
19001
|
const labels = model2.categories;
|
|
@@ -18938,7 +19111,8 @@ function chartSummaryView(chart, theme2, options2 = {}) {
|
|
|
18938
19111
|
s.xValues = s.values.map((_, k) => numeric5 ? toNumber(cats[k] ?? null) : k + 1);
|
|
18939
19112
|
});
|
|
18940
19113
|
const xs = series.flatMap((s) => s.xValues ?? []).filter((x) => x !== null);
|
|
18941
|
-
|
|
19114
|
+
const range2 = extentOf(xs);
|
|
19115
|
+
model2.xAxis = xs.length ? niceScale(range2.min, range2.max) : niceScale(0, 1);
|
|
18942
19116
|
}
|
|
18943
19117
|
if (type === "stock") model2.stock = stockView(chart.stock, ctx);
|
|
18944
19118
|
if (type === "bubble") bubbleView(chart, model2, ctx.evaluateRef);
|