@sheetxl/io-xlsx 0.7.23-beta.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.md +11 -0
- package/README.md +23 -0
- package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +1 -0
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +1 -0
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +1 -0
- package/browser/cjs/BE7AtU1GCShmJ8Yu.cjs +1 -0
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +6 -0
- package/browser/cjs/Chkqh5BZ-MJjAcPF.cjs +5 -0
- package/browser/cjs/D-8WoJkvdPf-79sB.cjs +2 -0
- package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +2 -0
- package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +1 -0
- package/browser/cjs/index.cjs +1 -0
- package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +1 -0
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +1 -0
- package/browser/esm/B20zuEvdeypuSU5s.mjs +3851 -0
- package/browser/esm/BVAAJynubTdvPOQA.mjs +24 -0
- package/browser/esm/CLo2oPoIised6GbD.mjs +3617 -0
- package/browser/esm/COSdjubnJ_UgB-Gr.mjs +111 -0
- package/browser/esm/CS1t46OUALKkZxTa.mjs +494 -0
- package/browser/esm/CS8eRkAhoCN8KdGO.mjs +52 -0
- package/browser/esm/CcXnQZ4Fk_nkbq2G.mjs +99 -0
- package/browser/esm/Ch5gA6g56cOtRvJA.mjs +2193 -0
- package/browser/esm/DRuB-nlH4kq_OQJ5.mjs +196 -0
- package/browser/esm/DoKP-E832M9vPWgU.mjs +4675 -0
- package/browser/esm/XoDWB6uCJVrra-pE.mjs +2623 -0
- package/browser/esm/index.mjs +8 -0
- package/licenses/dependencies.txt +60 -0
- package/node/esm/B3Hb3GSFs_FIoXoI.mjs +209 -0
- package/node/esm/BqwG-e5ddQ45fg8w.mjs +2702 -0
- package/node/esm/C81WoKHbCRwhcHWd.mjs +2413 -0
- package/node/esm/CIzCy_gyysEIa_HI.mjs +3700 -0
- package/node/esm/CL8002u21KKQkkL0.mjs +108 -0
- package/node/esm/DF893ovKIDS88O7b.mjs +2237 -0
- package/node/esm/DTuPlHBTHnbLGvxd.mjs +504 -0
- package/node/esm/DVJuJqAXDwgA-ge8.mjs +118 -0
- package/node/esm/index.mjs +52 -0
- package/package.json +55 -0
- package/types/index.d.ts +2 -0
- package/types/src/ConditionalFormatRules.d.ts +86 -0
- package/types/src/ConditionalFormatRules.d.ts.map +1 -0
- package/types/src/DataValidationRules.d.ts +59 -0
- package/types/src/DataValidationRules.d.ts.map +1 -0
- package/types/src/ExcelCompat.d.ts +142 -0
- package/types/src/ExcelCompat.d.ts.map +1 -0
- package/types/src/ExcelFunctionFacts.d.ts +375 -0
- package/types/src/ExcelFunctionFacts.d.ts.map +1 -0
- package/types/src/ExcelReservedNames.d.ts +67 -0
- package/types/src/ExcelReservedNames.d.ts.map +1 -0
- package/types/src/LegacyFormula.d.ts +74 -0
- package/types/src/LegacyFormula.d.ts.map +1 -0
- package/types/src/OOXMLEscape.d.ts +28 -0
- package/types/src/OOXMLEscape.d.ts.map +1 -0
- package/types/src/OOXMLExtensions.d.ts +53 -0
- package/types/src/OOXMLExtensions.d.ts.map +1 -0
- package/types/src/OperandLiterals.d.ts +34 -0
- package/types/src/OperandLiterals.d.ts.map +1 -0
- package/types/src/Plugin.d.ts +16 -0
- package/types/src/Plugin.d.ts.map +1 -0
- package/types/src/SourcePackage.d.ts +76 -0
- package/types/src/SourcePackage.d.ts.map +1 -0
- package/types/src/Types.d.ts +44 -0
- package/types/src/Types.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileReader.d.ts +73 -0
- package/types/src/cfb/CompoundFileReader.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileWriter.d.ts +57 -0
- package/types/src/cfb/CompoundFileWriter.d.ts.map +1 -0
- package/types/src/cfb/index.d.ts +3 -0
- package/types/src/cfb/index.d.ts.map +1 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts +8 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts +78 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts.map +1 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +30 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts.map +1 -0
- package/types/src/offcrypto/AgileCrypto.d.ts +85 -0
- package/types/src/offcrypto/AgileCrypto.d.ts.map +1 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts +109 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts.map +1 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts +18 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts +15 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/index.d.ts +5 -0
- package/types/src/offcrypto/index.d.ts.map +1 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +58 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts.map +1 -0
- package/types/src/reader/ReaderProfiler.d.ts +45 -0
- package/types/src/reader/ReaderProfiler.d.ts.map +1 -0
- package/types/src/reader/ReaderUtils.d.ts +66 -0
- package/types/src/reader/ReaderUtils.d.ts.map +1 -0
- package/types/src/reader/XLSXReader.d.ts +11 -0
- package/types/src/reader/XLSXReader.d.ts.map +1 -0
- package/types/src/reader/ZipReader.d.ts +62 -0
- package/types/src/reader/ZipReader.d.ts.map +1 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +22 -0
- package/types/src/reader/dom/DOMTransformer.d.ts.map +1 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts +8 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts.map +1 -0
- package/types/src/reader/dom/ExecutionContext.d.ts +78 -0
- package/types/src/reader/dom/ExecutionContext.d.ts.map +1 -0
- package/types/src/reader/dom/NumberUtils.d.ts +17 -0
- package/types/src/reader/dom/NumberUtils.d.ts.map +1 -0
- package/types/src/reader/dom/Types.d.ts +27 -0
- package/types/src/reader/dom/Types.d.ts.map +1 -0
- package/types/src/reader/dom/VisitContext.d.ts +10 -0
- package/types/src/reader/dom/VisitContext.d.ts.map +1 -0
- package/types/src/reader/dom/Visitor.d.ts +23 -0
- package/types/src/reader/dom/Visitor.d.ts.map +1 -0
- package/types/src/reader/dom/VisitorUtils.d.ts +16 -0
- package/types/src/reader/dom/VisitorUtils.d.ts.map +1 -0
- package/types/src/reader/dom/index.d.ts +7 -0
- package/types/src/reader/dom/index.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +25 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +12 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +37 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +32 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +22 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts +104 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts +3 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +28 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +20 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts +10 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts +6 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +30 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/index.d.ts +101 -0
- package/types/src/reader/domVisitors/index.d.ts.map +1 -0
- package/types/src/reader/sax/SaxParser.d.ts +34 -0
- package/types/src/reader/sax/SaxParser.d.ts.map +1 -0
- package/types/src/reader/sax/SaxVisitor.d.ts +59 -0
- package/types/src/reader/sax/SaxVisitor.d.ts.map +1 -0
- package/types/src/reader/sax/Saxes.d.ts +641 -0
- package/types/src/reader/sax/Saxes.d.ts.map +1 -0
- package/types/src/reader/sax/index.d.ts +3 -0
- package/types/src/reader/sax/index.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts +32 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts +52 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts +74 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts +29 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +54 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +22 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +25 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts.map +1 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts +37 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts.map +1 -0
- package/types/src/vba/VBAProject.d.ts +47 -0
- package/types/src/vba/VBAProject.d.ts.map +1 -0
- package/types/src/vba/index.d.ts +3 -0
- package/types/src/vba/index.d.ts.map +1 -0
- package/types/src/writer/XLSXWriter.d.ts +4 -0
- package/types/src/writer/XLSXWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ContentTypes.d.ts +18 -0
- package/types/src/writer/builder/ContentTypes.d.ts.map +1 -0
- package/types/src/writer/builder/Emitter.d.ts +25 -0
- package/types/src/writer/builder/Emitter.d.ts.map +1 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts +29 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts.map +1 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts +26 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts.map +1 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +148 -0
- package/types/src/writer/builder/PackageBuilder.d.ts.map +1 -0
- package/types/src/writer/builder/PartWriter.d.ts +24 -0
- package/types/src/writer/builder/PartWriter.d.ts.map +1 -0
- package/types/src/writer/builder/RelationshipSet.d.ts +18 -0
- package/types/src/writer/builder/RelationshipSet.d.ts.map +1 -0
- package/types/src/writer/builder/Types.d.ts +311 -0
- package/types/src/writer/builder/Types.d.ts.map +1 -0
- package/types/src/writer/builder/Utils.d.ts +63 -0
- package/types/src/writer/builder/Utils.d.ts.map +1 -0
- package/types/src/writer/builder/XmlWriter.d.ts +3 -0
- package/types/src/writer/builder/XmlWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ZipBackend.d.ts +21 -0
- package/types/src/writer/builder/ZipBackend.d.ts.map +1 -0
- package/types/src/writer/builder/_Types.d.ts +102 -0
- package/types/src/writer/builder/_Types.d.ts.map +1 -0
- package/types/src/writer/builder/index.d.ts +6 -0
- package/types/src/writer/builder/index.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +7 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts +14 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +46 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts +15 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts +8 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts +12 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts +8 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +28 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +10 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +13 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +17 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/TableEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts +16 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +11 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +18 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/index.d.ts +3 -0
- package/types/src/writer/emitters/index.d.ts.map +1 -0
- package/types/src/writer/utils/AutoFilter.d.ts +15 -0
- package/types/src/writer/utils/AutoFilter.d.ts.map +1 -0
- package/types/src/writer/utils/ColorUtils.d.ts +46 -0
- package/types/src/writer/utils/ColorUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +26 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DummyFunction.d.ts +66 -0
- package/types/src/writer/utils/DummyFunction.d.ts.map +1 -0
- package/types/src/writer/utils/DxfCollector.d.ts +22 -0
- package/types/src/writer/utils/DxfCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts +3 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts.map +1 -0
- package/types/src/writer/utils/IDUtils.d.ts +2 -0
- package/types/src/writer/utils/IDUtils.d.ts.map +1 -0
- package/types/src/writer/utils/MetadataCollector.d.ts +146 -0
- package/types/src/writer/utils/MetadataCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts +3 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts.map +1 -0
- package/types/src/writer/utils/RichValueCollector.d.ts +200 -0
- package/types/src/writer/utils/RichValueCollector.d.ts.map +1 -0
- package/types/src/writer/utils/TextUtils.d.ts +8 -0
- package/types/src/writer/utils/TextUtils.d.ts.map +1 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +19 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts.map +1 -0
- package/types/src/writer/utils/VersionUtils.d.ts +26 -0
- package/types/src/writer/utils/VersionUtils.d.ts.map +1 -0
|
@@ -0,0 +1,2702 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.23-beta.1
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { c as t, d as e, f as s, l as o, p as i, r, s as n, u as a } from "./CL8002u21KKQkkL0.mjs";
|
|
8
|
+
import { A as c, C as l, D as h, M as p, O as u, P as d, S as g, _ as m, a as f, b as T, f as y, h as b, i as x, j as v, l as w, n as S, o as C, p as k, r as P, t as A, u as E } from "./C81WoKHbCRwhcHWd.mjs";
|
|
9
|
+
import { BufferUtils as O, CommonUtils as I, ExpectedError as D } from "@sheetxl/utils";
|
|
10
|
+
import { AddressUtils as V, CommonUtils as L, CoordUtils as $, FormulaError as j, ICondition as N, IConditionalFormat as R, IRange as B, OutOfBoundsError as M, ResourceCollection as H, Theme as _, Tuple as z, Workbook as X } from "@sheetxl/sdk";
|
|
11
|
+
import { BlobReader as F, Uint8ArrayReader as q, Uint8ArrayWriter as W, ZipReader as U } from "@zip.js/zip.js";
|
|
12
|
+
var G = /* @__PURE__ */ new Uint8Array(0), Z = class t {
|
|
13
|
+
constructor(t, e, s) {
|
|
14
|
+
this.buffers = /* @__PURE__ */ new Map(), this.zip = t, this.entries = e, this.rawBuffer = s;
|
|
15
|
+
}
|
|
16
|
+
static normalize(t) {
|
|
17
|
+
return t.startsWith("/") ? t.slice(1) : t;
|
|
18
|
+
}
|
|
19
|
+
static async create(e) {
|
|
20
|
+
const s = e instanceof Blob ? G : e instanceof Uint8Array ? e : new Uint8Array(e), o = new U(e instanceof Blob ? new F(e) : new q(s)), i = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const t of await o.getEntries()) t.directory || i.set(t.filename, t);
|
|
22
|
+
return new t(o, i, s);
|
|
23
|
+
}
|
|
24
|
+
getNames() {
|
|
25
|
+
return [...this.entries.keys()];
|
|
26
|
+
}
|
|
27
|
+
has(e) {
|
|
28
|
+
return this.entries.has(t.normalize(e));
|
|
29
|
+
}
|
|
30
|
+
uncompressedSize(e) {
|
|
31
|
+
return this.entries.get(t.normalize(e))?.uncompressedSize ?? 0;
|
|
32
|
+
}
|
|
33
|
+
async getBuffer(e) {
|
|
34
|
+
const s = t.normalize(e), o = this.buffers.get(s);
|
|
35
|
+
if (o) return o;
|
|
36
|
+
const i = this.entries.get(s);
|
|
37
|
+
if (!i) return null;
|
|
38
|
+
const r = await i.getData(new W());
|
|
39
|
+
return this.buffers.set(s, r), r;
|
|
40
|
+
}
|
|
41
|
+
async prefetch(t) {
|
|
42
|
+
const e = [];
|
|
43
|
+
for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new W()).then((t) => {
|
|
44
|
+
this.buffers.set(s, t);
|
|
45
|
+
}));
|
|
46
|
+
await Promise.all(e);
|
|
47
|
+
}
|
|
48
|
+
getEntry(e) {
|
|
49
|
+
return this.buffers.get(t.normalize(e)) ?? null;
|
|
50
|
+
}
|
|
51
|
+
async getTextStream(e, s) {
|
|
52
|
+
const o = this.entries.get(t.normalize(e));
|
|
53
|
+
if (!o) return null;
|
|
54
|
+
const i = new TransformStream();
|
|
55
|
+
o.getData(i.writable).catch(() => {});
|
|
56
|
+
const r = i.readable.getReader(), n = new TextDecoder("utf-8");
|
|
57
|
+
return new ReadableStream({ async pull(t) {
|
|
58
|
+
const { value: e, done: o } = await r.read();
|
|
59
|
+
if (o) {
|
|
60
|
+
const e = n.decode();
|
|
61
|
+
e && t.enqueue(e), t.close();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
s?.(e.byteLength);
|
|
65
|
+
const i = n.decode(e, { stream: !0 });
|
|
66
|
+
i && t.enqueue(i);
|
|
67
|
+
} }).getReader();
|
|
68
|
+
}
|
|
69
|
+
getRawEntry(e) {
|
|
70
|
+
const s = this.entries.get(t.normalize(e));
|
|
71
|
+
if (!s || s.encrypted) return null;
|
|
72
|
+
const o = s.offset;
|
|
73
|
+
if (o + 30 > this.rawBuffer.byteLength) return null;
|
|
74
|
+
const i = new DataView(this.rawBuffer.buffer, this.rawBuffer.byteOffset + o, 30);
|
|
75
|
+
if (67324752 !== i.getUint32(0, !0)) return null;
|
|
76
|
+
const r = o + 30 + i.getUint16(26, !0) + i.getUint16(28, !0), n = r + s.compressedSize;
|
|
77
|
+
return n > this.rawBuffer.byteLength ? null : {
|
|
78
|
+
data: this.rawBuffer.subarray(r, n),
|
|
79
|
+
compressionMethod: s.compressionMethod,
|
|
80
|
+
signature: s.signature
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async close() {
|
|
84
|
+
await this.zip.close();
|
|
85
|
+
}
|
|
86
|
+
}, J = class {
|
|
87
|
+
constructor(t) {
|
|
88
|
+
this._sink = t, this._samples = [], this._t0 = Q(), this._tPrev = this._t0, this._heapPrev = K();
|
|
89
|
+
}
|
|
90
|
+
mark(t) {
|
|
91
|
+
const e = Q(), s = K(), o = {
|
|
92
|
+
label: t,
|
|
93
|
+
tMs: e - this._t0,
|
|
94
|
+
dtMs: e - this._tPrev,
|
|
95
|
+
heapBytes: s,
|
|
96
|
+
dHeapBytes: void 0 !== s && void 0 !== this._heapPrev ? s - this._heapPrev : void 0,
|
|
97
|
+
rssBytes: Y()
|
|
98
|
+
};
|
|
99
|
+
this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
|
|
100
|
+
}
|
|
101
|
+
samples() {
|
|
102
|
+
return this._samples;
|
|
103
|
+
}
|
|
104
|
+
toTable() {
|
|
105
|
+
return this._samples.map((t) => ({
|
|
106
|
+
phase: t.label,
|
|
107
|
+
tMs: Math.round(t.tMs),
|
|
108
|
+
dtMs: Math.round(t.dtMs),
|
|
109
|
+
heapMB: void 0 !== t.heapBytes ? tt(t.heapBytes / 1048576) : "—",
|
|
110
|
+
dHeapMB: void 0 !== t.dHeapBytes ? tt(t.dHeapBytes / 1048576) : "—",
|
|
111
|
+
rssMB: void 0 !== t.rssBytes ? tt(t.rssBytes / 1048576) : "—"
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}, Q = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
|
|
115
|
+
function K() {
|
|
116
|
+
const t = "object" == typeof performance ? performance.memory : void 0;
|
|
117
|
+
if (t && "number" == typeof t.usedJSHeapSize) return t.usedJSHeapSize;
|
|
118
|
+
const e = globalThis.process;
|
|
119
|
+
return "object" == typeof e && "function" == typeof e.memoryUsage ? e.memoryUsage().heapUsed : void 0;
|
|
120
|
+
}
|
|
121
|
+
function Y() {
|
|
122
|
+
const t = globalThis.process;
|
|
123
|
+
if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
|
|
124
|
+
}
|
|
125
|
+
function tt(t) {
|
|
126
|
+
return Math.round(10 * t) / 10;
|
|
127
|
+
}
|
|
128
|
+
var et = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", st = `-${et}.0-9·̀-ͯ‿-⁀`, ot = (new RegExp(`^[${et}]$`, "u"), new RegExp(`^[${st}]$`, "u"), new RegExp(`^[${et}][${st}]*$`, "u")), it = (new RegExp(`^[${st}]+$`, "u"), [
|
|
129
|
+
32,
|
|
130
|
+
10,
|
|
131
|
+
13,
|
|
132
|
+
9
|
|
133
|
+
]);
|
|
134
|
+
function rt(t) {
|
|
135
|
+
return t >= 65 && t <= 90 || t >= 97 && t <= 122 || 58 === t || 95 === t || 8204 === t || 8205 === t || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
136
|
+
}
|
|
137
|
+
var nt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", at = `-${nt}.0-9·̀-ͯ‿-⁀`;
|
|
138
|
+
new RegExp(`^[${nt}]$`, "u"), new RegExp(`^[${at}]$`, "u"), new RegExp(`^[${nt}][${at}]*$`, "u"), new RegExp(`^[${at}]+$`, "u");
|
|
139
|
+
var ct = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", lt = `-${ct}.0-9·̀-ͯ‿-⁀`, ht = (new RegExp(`^[${ct}]$`, "u"), new RegExp(`^[${lt}]$`, "u"), new RegExp(`^[${ct}][${lt}]*$`, "u"));
|
|
140
|
+
function pt(t) {
|
|
141
|
+
return t >= 65 && t <= 90 || 95 === t || t >= 97 && t <= 122 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
142
|
+
}
|
|
143
|
+
var ut = function(t) {
|
|
144
|
+
return 32 === t || 10 === t || 13 === t || 9 === t;
|
|
145
|
+
}, dt = function(t) {
|
|
146
|
+
return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
147
|
+
}, gt = rt, mt = function(t) {
|
|
148
|
+
return rt(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
149
|
+
}, ft = it, Tt = ot, yt = function(t) {
|
|
150
|
+
return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
151
|
+
}, bt = pt, xt = function(t) {
|
|
152
|
+
return pt(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
153
|
+
}, vt = ht, wt = "http://www.w3.org/XML/1998/namespace", St = "http://www.w3.org/2000/xmlns/", Ct = {
|
|
154
|
+
__proto__: null,
|
|
155
|
+
xml: wt,
|
|
156
|
+
xmlns: St
|
|
157
|
+
}, kt = {
|
|
158
|
+
__proto__: null,
|
|
159
|
+
amp: "&",
|
|
160
|
+
gt: ">",
|
|
161
|
+
lt: "<",
|
|
162
|
+
quot: "\"",
|
|
163
|
+
apos: "'"
|
|
164
|
+
}, Pt = -1, At = -2, Et = 13, Ot = 33, It = 10, Dt = 60, Vt = 61, Lt = 62, $t = 63, jt = 93, Nt = (t) => 34 === t || 39 === t, Rt = [34, 39], Bt = [
|
|
165
|
+
...Rt,
|
|
166
|
+
91,
|
|
167
|
+
Lt
|
|
168
|
+
], Mt = [
|
|
169
|
+
...Rt,
|
|
170
|
+
Dt,
|
|
171
|
+
jt
|
|
172
|
+
], Ht = [
|
|
173
|
+
Vt,
|
|
174
|
+
$t,
|
|
175
|
+
...ft
|
|
176
|
+
], _t = [
|
|
177
|
+
...ft,
|
|
178
|
+
Lt,
|
|
179
|
+
38,
|
|
180
|
+
Dt
|
|
181
|
+
];
|
|
182
|
+
function zt(t, e, s) {
|
|
183
|
+
switch (e) {
|
|
184
|
+
case "xml":
|
|
185
|
+
s !== wt && t.fail(`xml prefix must be bound to ${wt}.`);
|
|
186
|
+
break;
|
|
187
|
+
case "xmlns": s !== St && t.fail(`xmlns prefix must be bound to ${St}.`);
|
|
188
|
+
}
|
|
189
|
+
switch (s) {
|
|
190
|
+
case St:
|
|
191
|
+
t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${St}.`);
|
|
192
|
+
break;
|
|
193
|
+
case wt: switch (e) {
|
|
194
|
+
case "xml": break;
|
|
195
|
+
case "":
|
|
196
|
+
t.fail(`the default namespace may not be set to ${s}.`);
|
|
197
|
+
break;
|
|
198
|
+
default: t.fail("may not assign the xml namespace to another prefix.");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
203
|
+
xmldecl: "xmlDeclHandler",
|
|
204
|
+
text: "textHandler",
|
|
205
|
+
processinginstruction: "piHandler",
|
|
206
|
+
doctype: "doctypeHandler",
|
|
207
|
+
comment: "commentHandler",
|
|
208
|
+
opentagstart: "openTagStartHandler",
|
|
209
|
+
attribute: "attributeHandler",
|
|
210
|
+
opentag: "openTagHandler",
|
|
211
|
+
closetag: "closeTagHandler",
|
|
212
|
+
cdata: "cdataHandler",
|
|
213
|
+
error: "errorHandler",
|
|
214
|
+
end: "endHandler",
|
|
215
|
+
ready: "readyHandler"
|
|
216
|
+
}, Gt = class {
|
|
217
|
+
get closed() {
|
|
218
|
+
return this._closed;
|
|
219
|
+
}
|
|
220
|
+
constructor(t) {
|
|
221
|
+
this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
222
|
+
const e = this.xmlnsOpt = !!this.opt.xmlns;
|
|
223
|
+
if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, e) {
|
|
224
|
+
this.nameStartCheck = bt, this.nameCheck = xt, this.isName = qt, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
225
|
+
__proto__: null,
|
|
226
|
+
...Ct
|
|
227
|
+
};
|
|
228
|
+
const t = this.opt.additionalNamespaces;
|
|
229
|
+
null != t && (function(t, e) {
|
|
230
|
+
for (const s of Object.keys(e)) zt(t, s, e[s]);
|
|
231
|
+
}(this, t), Object.assign(this.ns, t));
|
|
232
|
+
} else this.nameStartCheck = gt, this.nameCheck = mt, this.isName = Wt, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
233
|
+
this.stateTable = [
|
|
234
|
+
this.sBegin,
|
|
235
|
+
this.sBeginWhitespace,
|
|
236
|
+
this.sDoctype,
|
|
237
|
+
this.sDoctypeQuote,
|
|
238
|
+
this.sDTD,
|
|
239
|
+
this.sDTDQuoted,
|
|
240
|
+
this.sDTDOpenWaka,
|
|
241
|
+
this.sDTDOpenWakaBang,
|
|
242
|
+
this.sDTDComment,
|
|
243
|
+
this.sDTDCommentEnding,
|
|
244
|
+
this.sDTDCommentEnded,
|
|
245
|
+
this.sDTDPI,
|
|
246
|
+
this.sDTDPIEnding,
|
|
247
|
+
this.sText,
|
|
248
|
+
this.sEntity,
|
|
249
|
+
this.sOpenWaka,
|
|
250
|
+
this.sOpenWakaBang,
|
|
251
|
+
this.sComment,
|
|
252
|
+
this.sCommentEnding,
|
|
253
|
+
this.sCommentEnded,
|
|
254
|
+
this.sCData,
|
|
255
|
+
this.sCDataEnding,
|
|
256
|
+
this.sCDataEnding2,
|
|
257
|
+
this.sPIFirstChar,
|
|
258
|
+
this.sPIRest,
|
|
259
|
+
this.sPIBody,
|
|
260
|
+
this.sPIEnding,
|
|
261
|
+
this.sXMLDeclNameStart,
|
|
262
|
+
this.sXMLDeclName,
|
|
263
|
+
this.sXMLDeclEq,
|
|
264
|
+
this.sXMLDeclValueStart,
|
|
265
|
+
this.sXMLDeclValue,
|
|
266
|
+
this.sXMLDeclSeparator,
|
|
267
|
+
this.sXMLDeclEnding,
|
|
268
|
+
this.sOpenTag,
|
|
269
|
+
this.sOpenTagSlash,
|
|
270
|
+
this.sAttrib,
|
|
271
|
+
this.sAttribName,
|
|
272
|
+
this.sAttribNameSawWhite,
|
|
273
|
+
this.sAttribValue,
|
|
274
|
+
this.sAttribValueQuoted,
|
|
275
|
+
this.sAttribValueClosed,
|
|
276
|
+
this.sAttribValueUnquoted,
|
|
277
|
+
this.sCloseTag,
|
|
278
|
+
this.sCloseTagSawWhite
|
|
279
|
+
], this._init();
|
|
280
|
+
}
|
|
281
|
+
_init() {
|
|
282
|
+
this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
|
|
283
|
+
const { fragmentOpt: t } = this;
|
|
284
|
+
this.state = t ? Et : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
|
|
285
|
+
let { defaultXMLVersion: e } = this.opt;
|
|
286
|
+
if (void 0 === e) {
|
|
287
|
+
if (!0 === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
|
|
288
|
+
e = "1.0";
|
|
289
|
+
}
|
|
290
|
+
this.setXMLVersion(e), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = {
|
|
291
|
+
version: void 0,
|
|
292
|
+
encoding: void 0,
|
|
293
|
+
standalone: void 0
|
|
294
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(kt), this.readyHandler?.();
|
|
295
|
+
}
|
|
296
|
+
get position() {
|
|
297
|
+
return this.chunkPosition + this.i;
|
|
298
|
+
}
|
|
299
|
+
get columnIndex() {
|
|
300
|
+
return this.position - this.positionAtNewLine;
|
|
301
|
+
}
|
|
302
|
+
on(t, e) {
|
|
303
|
+
this[Ut[t]] = e;
|
|
304
|
+
}
|
|
305
|
+
off(t) {
|
|
306
|
+
this[Ut[t]] = void 0;
|
|
307
|
+
}
|
|
308
|
+
makeError(t) {
|
|
309
|
+
let e = this.fileName ?? "";
|
|
310
|
+
return this.trackPosition && (e.length > 0 && (e += ":"), e += `${this.line}:${this.column}`), e.length > 0 && (e += ": "), new Error(e + t);
|
|
311
|
+
}
|
|
312
|
+
fail(t) {
|
|
313
|
+
const e = this.makeError(t), s = this.errorHandler;
|
|
314
|
+
if (void 0 === s) throw e;
|
|
315
|
+
return s(e), this;
|
|
316
|
+
}
|
|
317
|
+
write(t) {
|
|
318
|
+
if (this.closed) return this.fail("cannot write after close.");
|
|
319
|
+
let e = !1;
|
|
320
|
+
null === t ? (e = !0, t = "") : "object" == typeof t && (t = t.toString()), void 0 !== this.carriedFromPrevious && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
|
|
321
|
+
let s = t.length;
|
|
322
|
+
const o = t.charCodeAt(s - 1);
|
|
323
|
+
!e && (13 === o || o >= 55296 && o <= 56319) && (this.carriedFromPrevious = t[s - 1], s--, t = t.slice(0, s));
|
|
324
|
+
const { stateTable: i } = this;
|
|
325
|
+
for (this.chunk = t, this.i = 0; this.i < s;) i[this.state].call(this);
|
|
326
|
+
return this.chunkPosition += s, e ? this.end() : this;
|
|
327
|
+
}
|
|
328
|
+
close() {
|
|
329
|
+
return this.write(null);
|
|
330
|
+
}
|
|
331
|
+
getCode10() {
|
|
332
|
+
const t = this.chunk, e = this.i;
|
|
333
|
+
if (this.prevI = e, this.i++, e >= t.length) return Pt;
|
|
334
|
+
const s = t.charCodeAt(e);
|
|
335
|
+
if (this.column++, s < 55296) {
|
|
336
|
+
if (s >= 32 || 9 === s) return s;
|
|
337
|
+
switch (s) {
|
|
338
|
+
case It: return this.line++, this.column = 0, this.positionAtNewLine = this.position, It;
|
|
339
|
+
case 13: return t.charCodeAt(e + 1) === It && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, At;
|
|
340
|
+
default: return this.fail("disallowed character."), s;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (s > 56319) return s >= 57344 && s <= 65533 || this.fail("disallowed character."), s;
|
|
344
|
+
const o = 65536 + 1024 * (s - 55296) + (t.charCodeAt(e + 1) - 56320);
|
|
345
|
+
return this.i = e + 2, o > 1114111 && this.fail("disallowed character."), o;
|
|
346
|
+
}
|
|
347
|
+
getCode11() {
|
|
348
|
+
const { chunk: t, i: e } = this;
|
|
349
|
+
if (this.prevI = e, this.i = e + 1, e >= t.length) return Pt;
|
|
350
|
+
const s = t.charCodeAt(e);
|
|
351
|
+
if (this.column++, s < 55296) {
|
|
352
|
+
if (s > 31 && s < 127 || s > 159 && 8232 !== s || 9 === s) return s;
|
|
353
|
+
switch (s) {
|
|
354
|
+
case It: return this.line++, this.column = 0, this.positionAtNewLine = this.position, It;
|
|
355
|
+
case 13: {
|
|
356
|
+
const s = t.charCodeAt(e + 1);
|
|
357
|
+
s !== It && 133 !== s || (this.i = e + 2);
|
|
358
|
+
}
|
|
359
|
+
case 133:
|
|
360
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, At;
|
|
361
|
+
default: return this.fail("disallowed character."), s;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (s > 56319) return s >= 57344 && s <= 65533 || this.fail("disallowed character."), s;
|
|
365
|
+
const o = 65536 + 1024 * (s - 55296) + (t.charCodeAt(e + 1) - 56320);
|
|
366
|
+
return this.i = e + 2, o > 1114111 && this.fail("disallowed character."), o;
|
|
367
|
+
}
|
|
368
|
+
getCodeNorm() {
|
|
369
|
+
const t = this.getCode();
|
|
370
|
+
return t === At ? It : t;
|
|
371
|
+
}
|
|
372
|
+
unGet() {
|
|
373
|
+
this.i = this.prevI, this.column--;
|
|
374
|
+
}
|
|
375
|
+
captureTo(t) {
|
|
376
|
+
let { i: e } = this;
|
|
377
|
+
const { chunk: s } = this;
|
|
378
|
+
for (;;) {
|
|
379
|
+
const o = this.getCode(), i = o === At, r = i ? It : o;
|
|
380
|
+
if (r === Pt || t.includes(r)) return this.text += s.slice(e, this.prevI), r;
|
|
381
|
+
i && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
captureToChar(t) {
|
|
385
|
+
let { i: e } = this;
|
|
386
|
+
const { chunk: s } = this;
|
|
387
|
+
for (;;) {
|
|
388
|
+
let o = this.getCode();
|
|
389
|
+
switch (o) {
|
|
390
|
+
case At:
|
|
391
|
+
this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = It;
|
|
392
|
+
break;
|
|
393
|
+
case Pt: return this.text += s.slice(e), !1;
|
|
394
|
+
}
|
|
395
|
+
if (o === t) return this.text += s.slice(e, this.prevI), !0;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
captureNameChars() {
|
|
399
|
+
const { chunk: t, i: e } = this;
|
|
400
|
+
for (;;) {
|
|
401
|
+
const s = this.getCode();
|
|
402
|
+
if (s === Pt) return this.name += t.slice(e), Pt;
|
|
403
|
+
if (!mt(s)) return this.name += t.slice(e, this.prevI), s === At ? It : s;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
skipSpaces() {
|
|
407
|
+
for (;;) {
|
|
408
|
+
const t = this.getCodeNorm();
|
|
409
|
+
if (t === Pt || !ut(t)) return t;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
setXMLVersion(t) {
|
|
413
|
+
this.currentXMLVersion = t, "1.0" === t ? (this.isChar = dt, this.getCode = this.getCode10) : (this.isChar = yt, this.getCode = this.getCode11);
|
|
414
|
+
}
|
|
415
|
+
sBegin() {
|
|
416
|
+
65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
|
|
417
|
+
}
|
|
418
|
+
sBeginWhitespace() {
|
|
419
|
+
const t = this.i, e = this.skipSpaces();
|
|
420
|
+
switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
|
|
421
|
+
case Dt:
|
|
422
|
+
if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
|
|
423
|
+
break;
|
|
424
|
+
case Pt: break;
|
|
425
|
+
default: this.unGet(), this.state = Et, this.xmlDeclPossible = !1;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
sDoctype() {
|
|
429
|
+
const t = this.captureTo(Bt);
|
|
430
|
+
switch (t) {
|
|
431
|
+
case Lt:
|
|
432
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = Et, this.doctype = !0;
|
|
433
|
+
break;
|
|
434
|
+
case Pt: break;
|
|
435
|
+
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : Nt(t) && (this.state = 3, this.q = t);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
sDoctypeQuote() {
|
|
439
|
+
const t = this.q;
|
|
440
|
+
this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
|
|
441
|
+
}
|
|
442
|
+
sDTD() {
|
|
443
|
+
const t = this.captureTo(Mt);
|
|
444
|
+
t !== Pt && (this.text += String.fromCodePoint(t), t === jt ? this.state = 2 : t === Dt ? this.state = 6 : Nt(t) && (this.state = 5, this.q = t));
|
|
445
|
+
}
|
|
446
|
+
sDTDQuoted() {
|
|
447
|
+
const t = this.q;
|
|
448
|
+
this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
|
|
449
|
+
}
|
|
450
|
+
sDTDOpenWaka() {
|
|
451
|
+
const t = this.getCodeNorm();
|
|
452
|
+
switch (this.text += String.fromCodePoint(t), t) {
|
|
453
|
+
case 33:
|
|
454
|
+
this.state = 7, this.openWakaBang = "";
|
|
455
|
+
break;
|
|
456
|
+
case $t:
|
|
457
|
+
this.state = 11;
|
|
458
|
+
break;
|
|
459
|
+
default: this.state = 4;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
sDTDOpenWakaBang() {
|
|
463
|
+
const t = String.fromCodePoint(this.getCodeNorm()), e = this.openWakaBang += t;
|
|
464
|
+
this.text += t, "-" !== e && (this.state = "--" === e ? 8 : 4, this.openWakaBang = "");
|
|
465
|
+
}
|
|
466
|
+
sDTDComment() {
|
|
467
|
+
this.captureToChar(45) && (this.text += "-", this.state = 9);
|
|
468
|
+
}
|
|
469
|
+
sDTDCommentEnding() {
|
|
470
|
+
const t = this.getCodeNorm();
|
|
471
|
+
this.text += String.fromCodePoint(t), this.state = 45 === t ? 10 : 8;
|
|
472
|
+
}
|
|
473
|
+
sDTDCommentEnded() {
|
|
474
|
+
const t = this.getCodeNorm();
|
|
475
|
+
this.text += String.fromCodePoint(t), t === Lt ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
476
|
+
}
|
|
477
|
+
sDTDPI() {
|
|
478
|
+
this.captureToChar($t) && (this.text += "?", this.state = 12);
|
|
479
|
+
}
|
|
480
|
+
sDTDPIEnding() {
|
|
481
|
+
const t = this.getCodeNorm();
|
|
482
|
+
this.text += String.fromCodePoint(t), t === Lt && (this.state = 4);
|
|
483
|
+
}
|
|
484
|
+
sText() {
|
|
485
|
+
0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
|
|
486
|
+
}
|
|
487
|
+
sEntity() {
|
|
488
|
+
let { i: t } = this;
|
|
489
|
+
const { chunk: e } = this;
|
|
490
|
+
t: for (;;) switch (this.getCode()) {
|
|
491
|
+
case At:
|
|
492
|
+
this.entity += `${e.slice(t, this.prevI)}\n`, t = this.i;
|
|
493
|
+
break;
|
|
494
|
+
case 59: {
|
|
495
|
+
const { entityReturnState: s } = this, o = this.entity + e.slice(t, this.prevI);
|
|
496
|
+
let i;
|
|
497
|
+
this.state = s, "" === o ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(o), this.entity = ""), s === Et && void 0 === this.textHandler || (this.text += i);
|
|
498
|
+
break t;
|
|
499
|
+
}
|
|
500
|
+
case Pt:
|
|
501
|
+
this.entity += e.slice(t);
|
|
502
|
+
break t;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
sOpenWaka() {
|
|
506
|
+
const t = this.getCode();
|
|
507
|
+
if (gt(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
|
|
508
|
+
else switch (t) {
|
|
509
|
+
case 47:
|
|
510
|
+
this.state = 43, this.xmlDeclPossible = !1;
|
|
511
|
+
break;
|
|
512
|
+
case 33:
|
|
513
|
+
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
|
|
514
|
+
break;
|
|
515
|
+
case $t:
|
|
516
|
+
this.state = 23;
|
|
517
|
+
break;
|
|
518
|
+
default: this.fail("disallowed character in tag name"), this.state = Et, this.xmlDeclPossible = !1;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
sOpenWakaBang() {
|
|
522
|
+
switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
|
|
523
|
+
case "[CDATA[":
|
|
524
|
+
this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
|
|
525
|
+
break;
|
|
526
|
+
case "--":
|
|
527
|
+
this.state = 17, this.openWakaBang = "";
|
|
528
|
+
break;
|
|
529
|
+
case "DOCTYPE":
|
|
530
|
+
this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
|
|
531
|
+
break;
|
|
532
|
+
default: this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
sComment() {
|
|
536
|
+
this.captureToChar(45) && (this.state = 18);
|
|
537
|
+
}
|
|
538
|
+
sCommentEnding() {
|
|
539
|
+
const t = this.getCodeNorm();
|
|
540
|
+
45 === t ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
|
|
541
|
+
}
|
|
542
|
+
sCommentEnded() {
|
|
543
|
+
const t = this.getCodeNorm();
|
|
544
|
+
t !== Lt ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Et;
|
|
545
|
+
}
|
|
546
|
+
sCData() {
|
|
547
|
+
this.captureToChar(jt) && (this.state = 21);
|
|
548
|
+
}
|
|
549
|
+
sCDataEnding() {
|
|
550
|
+
const t = this.getCodeNorm();
|
|
551
|
+
t === jt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
|
|
552
|
+
}
|
|
553
|
+
sCDataEnding2() {
|
|
554
|
+
const t = this.getCodeNorm();
|
|
555
|
+
switch (t) {
|
|
556
|
+
case Lt:
|
|
557
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = Et;
|
|
558
|
+
break;
|
|
559
|
+
case jt:
|
|
560
|
+
this.text += "]";
|
|
561
|
+
break;
|
|
562
|
+
default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
sPIFirstChar() {
|
|
566
|
+
const t = this.getCodeNorm();
|
|
567
|
+
this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === $t || ut(t) ? (this.fail("processing instruction without a target."), this.state = t === $t ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
|
|
568
|
+
}
|
|
569
|
+
sPIRest() {
|
|
570
|
+
const { chunk: t, i: e } = this;
|
|
571
|
+
for (;;) {
|
|
572
|
+
const s = this.getCodeNorm();
|
|
573
|
+
if (s === Pt) return void (this.piTarget += t.slice(e));
|
|
574
|
+
if (!this.nameCheck(s)) {
|
|
575
|
+
this.piTarget += t.slice(e, this.prevI);
|
|
576
|
+
const o = s === $t;
|
|
577
|
+
o || ut(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Ot : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
sPIBody() {
|
|
583
|
+
if (0 === this.text.length) {
|
|
584
|
+
const t = this.getCodeNorm();
|
|
585
|
+
t === $t ? this.state = 26 : ut(t) || (this.text = String.fromCodePoint(t));
|
|
586
|
+
} else this.captureToChar($t) && (this.state = 26);
|
|
587
|
+
}
|
|
588
|
+
sPIEnding() {
|
|
589
|
+
const t = this.getCodeNorm();
|
|
590
|
+
if (t === Lt) {
|
|
591
|
+
const { piTarget: t } = this;
|
|
592
|
+
"xml" === t.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
|
|
593
|
+
target: t,
|
|
594
|
+
body: this.text
|
|
595
|
+
}), this.piTarget = this.text = "", this.state = Et;
|
|
596
|
+
} else t === $t ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
|
|
597
|
+
this.xmlDeclPossible = !1;
|
|
598
|
+
}
|
|
599
|
+
sXMLDeclNameStart() {
|
|
600
|
+
const t = this.skipSpaces();
|
|
601
|
+
t !== $t ? t !== Pt && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Ot;
|
|
602
|
+
}
|
|
603
|
+
sXMLDeclName() {
|
|
604
|
+
const t = this.captureTo(Ht);
|
|
605
|
+
if (t === $t) return this.state = Ot, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
606
|
+
if (ut(t) || t === Vt) {
|
|
607
|
+
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
608
|
+
case 0:
|
|
609
|
+
this.fail("did not expect any more name/value pairs.");
|
|
610
|
+
break;
|
|
611
|
+
case 1:
|
|
612
|
+
this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
|
|
613
|
+
break;
|
|
614
|
+
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
615
|
+
}
|
|
616
|
+
this.state = t === Vt ? 30 : 29;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
sXMLDeclEq() {
|
|
620
|
+
const t = this.getCodeNorm();
|
|
621
|
+
if (t === $t) return this.state = Ot, void this.fail("XML declaration is incomplete.");
|
|
622
|
+
ut(t) || (t !== Vt && this.fail("value required."), this.state = 30);
|
|
623
|
+
}
|
|
624
|
+
sXMLDeclValueStart() {
|
|
625
|
+
const t = this.getCodeNorm();
|
|
626
|
+
if (t === $t) return this.state = Ot, void this.fail("XML declaration is incomplete.");
|
|
627
|
+
ut(t) || (Nt(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
628
|
+
}
|
|
629
|
+
sXMLDeclValue() {
|
|
630
|
+
const t = this.captureTo([this.q, $t]);
|
|
631
|
+
if (t === $t) return this.state = Ot, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
632
|
+
if (t === Pt) return;
|
|
633
|
+
const e = this.text;
|
|
634
|
+
switch (this.text = "", this.name) {
|
|
635
|
+
case "version": {
|
|
636
|
+
this.xmlDeclExpects = ["encoding", "standalone"];
|
|
637
|
+
const t = e;
|
|
638
|
+
this.xmlDecl.version = t, /^1\.[0-9]+$/.test(t) ? this.opt.forceXMLVersion || this.setXMLVersion(t) : this.fail("version number must match /^1\\.[0-9]+$/.");
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
case "encoding":
|
|
642
|
+
/^[A-Za-z][A-Za-z0-9._-]*$/.test(e) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = e;
|
|
643
|
+
break;
|
|
644
|
+
case "standalone": "yes" !== e && "no" !== e && this.fail("standalone value must match \"yes\" or \"no\"."), this.xmlDeclExpects = [], this.xmlDecl.standalone = e;
|
|
645
|
+
}
|
|
646
|
+
this.name = "", this.state = 32;
|
|
647
|
+
}
|
|
648
|
+
sXMLDeclSeparator() {
|
|
649
|
+
const t = this.getCodeNorm();
|
|
650
|
+
t !== $t ? (ut(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Ot;
|
|
651
|
+
}
|
|
652
|
+
sXMLDeclEnding() {
|
|
653
|
+
this.getCodeNorm() === Lt ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = Et) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
|
|
654
|
+
}
|
|
655
|
+
sOpenTag() {
|
|
656
|
+
const t = this.captureNameChars();
|
|
657
|
+
if (t === Pt) return;
|
|
658
|
+
const e = this.tag = {
|
|
659
|
+
name: this.name,
|
|
660
|
+
attributes: Object.create(null)
|
|
661
|
+
};
|
|
662
|
+
switch (this.name = "", this.xmlnsOpt && (this.topNS = e.ns = Object.create(null)), this.openTagStartHandler?.(e), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
|
|
663
|
+
case Lt:
|
|
664
|
+
this.openTag();
|
|
665
|
+
break;
|
|
666
|
+
case 47:
|
|
667
|
+
this.state = 35;
|
|
668
|
+
break;
|
|
669
|
+
default: ut(t) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
sOpenTagSlash() {
|
|
673
|
+
this.getCode() === Lt ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
|
|
674
|
+
}
|
|
675
|
+
sAttrib() {
|
|
676
|
+
const t = this.skipSpaces();
|
|
677
|
+
t !== Pt && (gt(t) ? (this.unGet(), this.state = 37) : t === Lt ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
678
|
+
}
|
|
679
|
+
sAttribName() {
|
|
680
|
+
const t = this.captureNameChars();
|
|
681
|
+
t === Vt ? this.state = 39 : ut(t) ? this.state = 38 : t === Lt ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== Pt && this.fail("disallowed character in attribute name.");
|
|
682
|
+
}
|
|
683
|
+
sAttribNameSawWhite() {
|
|
684
|
+
const t = this.skipSpaces();
|
|
685
|
+
switch (t) {
|
|
686
|
+
case Pt: return;
|
|
687
|
+
case Vt:
|
|
688
|
+
this.state = 39;
|
|
689
|
+
break;
|
|
690
|
+
default: this.fail("attribute without value."), this.text = "", this.name = "", t === Lt ? this.openTag() : gt(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
sAttribValue() {
|
|
694
|
+
const t = this.getCodeNorm();
|
|
695
|
+
Nt(t) ? (this.q = t, this.state = 40) : ut(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
|
|
696
|
+
}
|
|
697
|
+
sAttribValueQuoted() {
|
|
698
|
+
const { q: t, chunk: e } = this;
|
|
699
|
+
let { i: s } = this;
|
|
700
|
+
for (;;) switch (this.getCode()) {
|
|
701
|
+
case t:
|
|
702
|
+
this.pushAttrib(this.name, this.text + e.slice(s, this.prevI)), this.name = this.text = "", this.q = null, this.state = 41;
|
|
703
|
+
return;
|
|
704
|
+
case 38:
|
|
705
|
+
this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
706
|
+
return;
|
|
707
|
+
case It:
|
|
708
|
+
case At:
|
|
709
|
+
case 9:
|
|
710
|
+
this.text += `${e.slice(s, this.prevI)} `, s = this.i;
|
|
711
|
+
break;
|
|
712
|
+
case Dt:
|
|
713
|
+
this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
|
|
714
|
+
return;
|
|
715
|
+
case Pt:
|
|
716
|
+
this.text += e.slice(s);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
sAttribValueClosed() {
|
|
721
|
+
const t = this.getCodeNorm();
|
|
722
|
+
ut(t) ? this.state = 36 : t === Lt ? this.openTag() : 47 === t ? this.state = 35 : gt(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
723
|
+
}
|
|
724
|
+
sAttribValueUnquoted() {
|
|
725
|
+
const t = this.captureTo(_t);
|
|
726
|
+
switch (t) {
|
|
727
|
+
case 38:
|
|
728
|
+
this.state = 14, this.entityReturnState = 42;
|
|
729
|
+
break;
|
|
730
|
+
case Dt:
|
|
731
|
+
this.fail("disallowed character.");
|
|
732
|
+
break;
|
|
733
|
+
case Pt: break;
|
|
734
|
+
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === Lt ? this.openTag() : this.state = 36;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
sCloseTag() {
|
|
738
|
+
const t = this.captureNameChars();
|
|
739
|
+
t === Lt ? this.closeTag() : ut(t) ? this.state = 44 : t !== Pt && this.fail("disallowed character in closing tag.");
|
|
740
|
+
}
|
|
741
|
+
sCloseTagSawWhite() {
|
|
742
|
+
switch (this.skipSpaces()) {
|
|
743
|
+
case Lt:
|
|
744
|
+
this.closeTag();
|
|
745
|
+
break;
|
|
746
|
+
case Pt: break;
|
|
747
|
+
default: this.fail("disallowed character in closing tag.");
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
handleTextInRoot() {
|
|
751
|
+
let { i: t, forbiddenState: e } = this;
|
|
752
|
+
const { chunk: s, textHandler: o } = this;
|
|
753
|
+
t: for (;;) switch (this.getCode()) {
|
|
754
|
+
case Dt:
|
|
755
|
+
if (this.state = 15, void 0 !== o) {
|
|
756
|
+
const { text: e } = this, i = s.slice(t, this.prevI);
|
|
757
|
+
0 !== e.length ? (o(e + i), this.text = "") : 0 !== i.length && o(i);
|
|
758
|
+
}
|
|
759
|
+
e = 0;
|
|
760
|
+
break t;
|
|
761
|
+
case 38:
|
|
762
|
+
this.state = 14, this.entityReturnState = Et, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
|
|
763
|
+
break t;
|
|
764
|
+
case jt:
|
|
765
|
+
switch (e) {
|
|
766
|
+
case 0:
|
|
767
|
+
e = 1;
|
|
768
|
+
break;
|
|
769
|
+
case 1:
|
|
770
|
+
e = 2;
|
|
771
|
+
break;
|
|
772
|
+
case 2: break;
|
|
773
|
+
default: throw new Error("impossible state");
|
|
774
|
+
}
|
|
775
|
+
break;
|
|
776
|
+
case Lt:
|
|
777
|
+
2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
|
|
778
|
+
break;
|
|
779
|
+
case At:
|
|
780
|
+
void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
|
|
781
|
+
break;
|
|
782
|
+
case Pt:
|
|
783
|
+
void 0 !== o && (this.text += s.slice(t));
|
|
784
|
+
break t;
|
|
785
|
+
default: e = 0;
|
|
786
|
+
}
|
|
787
|
+
this.forbiddenState = e;
|
|
788
|
+
}
|
|
789
|
+
handleTextOutsideRoot() {
|
|
790
|
+
let { i: t } = this;
|
|
791
|
+
const { chunk: e, textHandler: s } = this;
|
|
792
|
+
let o = !1;
|
|
793
|
+
t: for (;;) {
|
|
794
|
+
const i = this.getCode();
|
|
795
|
+
switch (i) {
|
|
796
|
+
case Dt:
|
|
797
|
+
if (this.state = 15, void 0 !== s) {
|
|
798
|
+
const { text: o } = this, i = e.slice(t, this.prevI);
|
|
799
|
+
0 !== o.length ? (s(o + i), this.text = "") : 0 !== i.length && s(i);
|
|
800
|
+
}
|
|
801
|
+
break t;
|
|
802
|
+
case 38:
|
|
803
|
+
this.state = 14, this.entityReturnState = Et, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
|
|
804
|
+
break t;
|
|
805
|
+
case At:
|
|
806
|
+
void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
|
|
807
|
+
break;
|
|
808
|
+
case Pt:
|
|
809
|
+
void 0 !== s && (this.text += e.slice(t));
|
|
810
|
+
break t;
|
|
811
|
+
default: ut(i) || (o = !0);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
o && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
|
|
815
|
+
}
|
|
816
|
+
pushAttribNS(t, e) {
|
|
817
|
+
const { prefix: s, local: o } = this.qName(t), i = {
|
|
818
|
+
name: t,
|
|
819
|
+
prefix: s,
|
|
820
|
+
local: o,
|
|
821
|
+
value: e
|
|
822
|
+
};
|
|
823
|
+
if (this.attribList.push(i), this.attributeHandler?.(i), "xmlns" === s) {
|
|
824
|
+
const t = e.trim();
|
|
825
|
+
"1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, zt(this, o, t);
|
|
826
|
+
} else if ("xmlns" === t) {
|
|
827
|
+
const t = e.trim();
|
|
828
|
+
this.topNS[""] = t, zt(this, "", t);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
pushAttribPlain(t, e) {
|
|
832
|
+
const s = {
|
|
833
|
+
name: t,
|
|
834
|
+
value: e
|
|
835
|
+
};
|
|
836
|
+
this.attribList.push(s), this.attributeHandler?.(s);
|
|
837
|
+
}
|
|
838
|
+
end() {
|
|
839
|
+
this.sawRoot || this.fail("document must contain a root element.");
|
|
840
|
+
const { tags: t } = this;
|
|
841
|
+
for (; t.length > 0;) {
|
|
842
|
+
const e = t.pop();
|
|
843
|
+
this.fail(`unclosed tag: ${e.name}`);
|
|
844
|
+
}
|
|
845
|
+
0 !== this.state && this.state !== Et && this.fail("unexpected end.");
|
|
846
|
+
const { text: e } = this;
|
|
847
|
+
return 0 !== e.length && (this.textHandler?.(e), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
|
|
848
|
+
}
|
|
849
|
+
resolve(t) {
|
|
850
|
+
let e = this.topNS[t];
|
|
851
|
+
if (void 0 !== e) return e;
|
|
852
|
+
const { tags: s } = this;
|
|
853
|
+
for (let o = s.length - 1; o >= 0; o--) if (e = s[o].ns[t], void 0 !== e) return e;
|
|
854
|
+
return e = this.ns[t], void 0 !== e ? e : this.opt.resolvePrefix?.(t);
|
|
855
|
+
}
|
|
856
|
+
qName(t) {
|
|
857
|
+
const e = t.indexOf(":");
|
|
858
|
+
if (-1 === e) return {
|
|
859
|
+
prefix: "",
|
|
860
|
+
local: t
|
|
861
|
+
};
|
|
862
|
+
const s = t.slice(e + 1), o = t.slice(0, e);
|
|
863
|
+
return ("" === o || "" === s || s.includes(":")) && this.fail(`malformed name: ${t}.`), {
|
|
864
|
+
prefix: o,
|
|
865
|
+
local: s
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
processAttribsNS() {
|
|
869
|
+
const { attribList: t } = this, e = this.tag;
|
|
870
|
+
{
|
|
871
|
+
const { prefix: t, local: s } = this.qName(e.name);
|
|
872
|
+
e.prefix = t, e.local = s;
|
|
873
|
+
const o = e.uri = this.resolve(t) ?? "";
|
|
874
|
+
"" !== t && ("xmlns" === t && this.fail("tags may not have \"xmlns\" as prefix."), "" === o && (this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`), e.uri = t));
|
|
875
|
+
}
|
|
876
|
+
if (0 === t.length) return;
|
|
877
|
+
const { attributes: s } = e, o = /* @__PURE__ */ new Set();
|
|
878
|
+
for (const e of t) {
|
|
879
|
+
const { name: t, prefix: i, local: r } = e;
|
|
880
|
+
let n, a;
|
|
881
|
+
"" === i ? (n = "xmlns" === t ? St : "", a = t) : (n = this.resolve(i), void 0 === n && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), n = i), a = `{${n}}${r}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = n, s[t] = e;
|
|
882
|
+
}
|
|
883
|
+
this.attribList = [];
|
|
884
|
+
}
|
|
885
|
+
processAttribsPlain() {
|
|
886
|
+
const { attribList: t } = this, e = this.tag.attributes;
|
|
887
|
+
for (const { name: s, value: o } of t) void 0 !== e[s] && this.fail(`duplicate attribute: ${s}.`), e[s] = o;
|
|
888
|
+
this.attribList = [];
|
|
889
|
+
}
|
|
890
|
+
openTag() {
|
|
891
|
+
this.processAttribs();
|
|
892
|
+
const { tags: t } = this, e = this.tag;
|
|
893
|
+
e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Et, this.name = "";
|
|
894
|
+
}
|
|
895
|
+
openSelfClosingTag() {
|
|
896
|
+
this.processAttribs();
|
|
897
|
+
const { tags: t } = this, e = this.tag;
|
|
898
|
+
e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = Et, this.name = "";
|
|
899
|
+
}
|
|
900
|
+
closeTag() {
|
|
901
|
+
const { tags: t, name: e } = this;
|
|
902
|
+
if (this.state = Et, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
|
|
903
|
+
const s = this.closeTagHandler;
|
|
904
|
+
let o = t.length;
|
|
905
|
+
for (; o-- > 0;) {
|
|
906
|
+
const o = this.tag = t.pop();
|
|
907
|
+
if (this.topNS = o.ns, s?.(o), o.name === e) break;
|
|
908
|
+
this.fail(`unexpected close tag: ${e}.`);
|
|
909
|
+
}
|
|
910
|
+
0 === o ? this.closedRoot = !0 : o < 0 && (this.fail(`unmatched closing tag: ${e}.`), this.text += `</${e}>`);
|
|
911
|
+
}
|
|
912
|
+
parseEntity(t) {
|
|
913
|
+
if ("#" !== t[0]) {
|
|
914
|
+
const e = this.ENTITIES[t];
|
|
915
|
+
return void 0 !== e ? e : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
|
|
916
|
+
}
|
|
917
|
+
let e = NaN;
|
|
918
|
+
return "x" === t[1] && /^#x[0-9a-f]+$/i.test(t) ? e = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (e = parseInt(t.slice(1), 10)), this.isChar(e) ? String.fromCodePoint(e) : (this.fail("malformed character entity."), `&${t};`);
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
(Ft = Xt || (Xt = {})).Events = {
|
|
922
|
+
XmlDecl: "xmldecl",
|
|
923
|
+
Text: "text",
|
|
924
|
+
ProcessingInstruction: "processinginstruction",
|
|
925
|
+
Doctype: "doctype",
|
|
926
|
+
Comment: "comment",
|
|
927
|
+
OpenTagStart: "opentagstart",
|
|
928
|
+
Attribute: "attribute",
|
|
929
|
+
OpenTag: "opentag",
|
|
930
|
+
CloseTag: "closetag",
|
|
931
|
+
CDdata: "cdata",
|
|
932
|
+
Error: "error",
|
|
933
|
+
End: "end",
|
|
934
|
+
Ready: "ready"
|
|
935
|
+
}, Ft.parseStream = async (t, e, s) => {
|
|
936
|
+
const o = new Gt({
|
|
937
|
+
position: !1,
|
|
938
|
+
...s
|
|
939
|
+
});
|
|
940
|
+
let i;
|
|
941
|
+
e.onOpenTagStart && o.on(Xt.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(Xt.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(Xt.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(Xt.Events.Attribute, e.onAttribute), e.onText && o.on(Xt.Events.Text, e.onText), e.onError && o.on(Xt.Events.Error, e.onError);
|
|
942
|
+
const r = e.onEnd;
|
|
943
|
+
if (r) {
|
|
944
|
+
const t = () => {
|
|
945
|
+
i = r();
|
|
946
|
+
};
|
|
947
|
+
o.on(Xt.Events.End, t);
|
|
948
|
+
}
|
|
949
|
+
for (;;) {
|
|
950
|
+
const { value: e, done: s } = await t.read();
|
|
951
|
+
if (s) break;
|
|
952
|
+
o.write(e);
|
|
953
|
+
}
|
|
954
|
+
return o.close(), i;
|
|
955
|
+
};
|
|
956
|
+
var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, Jt = (t) => {
|
|
957
|
+
const e = parseInt(t);
|
|
958
|
+
return isNaN(e) ? null : e;
|
|
959
|
+
}, Qt = (t) => {
|
|
960
|
+
const e = parseFloat(t);
|
|
961
|
+
return isNaN(e) ? null : e;
|
|
962
|
+
}, Kt = null, Yt = class {
|
|
963
|
+
constructor() {
|
|
964
|
+
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
965
|
+
}
|
|
966
|
+
registerVisitor(t) {
|
|
967
|
+
this._registeredVisitors.set(t.from, t);
|
|
968
|
+
}
|
|
969
|
+
createEventHandler(t, e, s) {
|
|
970
|
+
const o = this._registeredVisitors, i = [], r = [];
|
|
971
|
+
let n = null, a = null, c = null, l = null;
|
|
972
|
+
const h = [], p = {
|
|
973
|
+
key: null,
|
|
974
|
+
source: t,
|
|
975
|
+
parent: null
|
|
976
|
+
};
|
|
977
|
+
let u = null, d = !1;
|
|
978
|
+
const g = (t, e) => {
|
|
979
|
+
let s = c.attributes[t];
|
|
980
|
+
if (e) if (Array.isArray(e)) {
|
|
981
|
+
const t = e.length;
|
|
982
|
+
for (let o = 0; o < t; o++) {
|
|
983
|
+
if (null == s) return;
|
|
984
|
+
if (s = e[o](s), null == s) return;
|
|
985
|
+
}
|
|
986
|
+
} else {
|
|
987
|
+
if (null == s) return;
|
|
988
|
+
if (s = e(s), null == s) return;
|
|
989
|
+
}
|
|
990
|
+
return s;
|
|
991
|
+
}, m = {
|
|
992
|
+
getSource: () => u?.source ?? null,
|
|
993
|
+
setSource: (t) => {
|
|
994
|
+
u.source = t;
|
|
995
|
+
},
|
|
996
|
+
setKey: (t) => {
|
|
997
|
+
u.key = t;
|
|
998
|
+
},
|
|
999
|
+
getFrom: () => c,
|
|
1000
|
+
getAttribute: (t, e) => g(t, e) ?? null,
|
|
1001
|
+
hasAttribute: (t) => null !== m.getAttribute(t),
|
|
1002
|
+
getParent: () => {
|
|
1003
|
+
const t = h[h.length - 2];
|
|
1004
|
+
return t.parent ?? t.source;
|
|
1005
|
+
},
|
|
1006
|
+
getPath: () => {
|
|
1007
|
+
const t = [], e = r.length;
|
|
1008
|
+
for (let s = 0; s < e; s++) t.push(r[s].local);
|
|
1009
|
+
return t.join("\\");
|
|
1010
|
+
},
|
|
1011
|
+
parseAttribute: g,
|
|
1012
|
+
copyToObject: (t, e, s, o) => {
|
|
1013
|
+
const i = g(o ?? e, s);
|
|
1014
|
+
void 0 !== i && (t[e] = i);
|
|
1015
|
+
},
|
|
1016
|
+
copyTo: (t, e, s) => {
|
|
1017
|
+
const o = g(s ?? t, e);
|
|
1018
|
+
void 0 !== o && (u.source[t] = o);
|
|
1019
|
+
},
|
|
1020
|
+
warn: (t) => {
|
|
1021
|
+
s ? s?.(t) : console.warn(t);
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
return {
|
|
1025
|
+
onOpenTag: (t) => {
|
|
1026
|
+
let e = t.name;
|
|
1027
|
+
const s = e.indexOf(":");
|
|
1028
|
+
-1 !== s && (e = e.slice(s + 1));
|
|
1029
|
+
const g = (i.length > 0 ? i[i.length - 1] : o).get(e);
|
|
1030
|
+
if (n = {
|
|
1031
|
+
local: e,
|
|
1032
|
+
visitor: g,
|
|
1033
|
+
tag: t,
|
|
1034
|
+
destination: null
|
|
1035
|
+
}, d) return r.push(n), a = e, void (c = t);
|
|
1036
|
+
l = n?.visitor ?? null, a = e, c = t;
|
|
1037
|
+
let f = !!g && null === g.to;
|
|
1038
|
+
if (g && !f && g.scope) {
|
|
1039
|
+
const t = g.scope(m);
|
|
1040
|
+
null === t ? f = !0 : t && (i.push(t), n.pushedScope = !0);
|
|
1041
|
+
}
|
|
1042
|
+
g && (0 === r.length ? (u = p, n.destination = u, n.pushedDestination = !0, h.push(u)) : f ? (u = null, n.destination = null) : g.transparent ? n.destination = u : (u = {
|
|
1043
|
+
key: null,
|
|
1044
|
+
source: {},
|
|
1045
|
+
parent: null
|
|
1046
|
+
}, n.destination = u, n.pushedDestination = !0, h.push(u))), r.push(n), d = f;
|
|
1047
|
+
const T = l?.openTag?.(m);
|
|
1048
|
+
void 0 !== T && (u.parent = T);
|
|
1049
|
+
},
|
|
1050
|
+
onCloseTag: (t) => {
|
|
1051
|
+
let e = t.name;
|
|
1052
|
+
const o = e.indexOf(":");
|
|
1053
|
+
if (-1 !== o && (e = e.slice(o + 1)), e !== a) throw new Error(`mismatch open/close tag: '${e}'/'${a}'`);
|
|
1054
|
+
d || l?.closeTag?.(m);
|
|
1055
|
+
const g = r.pop() ?? null;
|
|
1056
|
+
n = r[r.length - 1] ?? null, g?.pushedScope && i.pop();
|
|
1057
|
+
const f = g?.destination;
|
|
1058
|
+
if (f && g.pushedDestination) {
|
|
1059
|
+
h.pop(), u = h[h.length - 1] ?? p;
|
|
1060
|
+
const t = g.visitor;
|
|
1061
|
+
t && t.to && void 0 !== f.source && (Array.isArray(t.to) ? u.source.push ? u.source.push(f.source) : s?.(`Unable to parse array for ${t.from} at ${m.getPath()}`) : f.key ? u.source[f.key] = f.source : "string" == typeof t.to && (u.source[t.to] = f.source));
|
|
1062
|
+
}
|
|
1063
|
+
a = n?.local ?? null, c = n?.tag ?? null, l = n?.visitor ?? null, d = !n?.destination;
|
|
1064
|
+
},
|
|
1065
|
+
onText: (t) => {
|
|
1066
|
+
l?.text?.(t, m);
|
|
1067
|
+
},
|
|
1068
|
+
onEnd: e
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
}, te = `IFERROR(${l}(`, ee = te.toUpperCase(), se = g.toUpperCase(), oe = { kind: "none" }, ie = { kind: "spilled" }, re = (t, e) => {
|
|
1072
|
+
if (34 !== t.charCodeAt(e)) return null;
|
|
1073
|
+
let s = "", o = e + 1;
|
|
1074
|
+
for (; o < t.length;) if (34 === t.charCodeAt(o)) {
|
|
1075
|
+
if (34 !== t.charCodeAt(o + 1)) return {
|
|
1076
|
+
value: s,
|
|
1077
|
+
end: o + 1
|
|
1078
|
+
};
|
|
1079
|
+
s += "\"", o += 2;
|
|
1080
|
+
} else s += t[o], o++;
|
|
1081
|
+
return null;
|
|
1082
|
+
}, ne = (t) => {
|
|
1083
|
+
const e = [];
|
|
1084
|
+
let s = 0;
|
|
1085
|
+
for (; s < t.length;) {
|
|
1086
|
+
const o = t.charCodeAt(s);
|
|
1087
|
+
if (34 === o) {
|
|
1088
|
+
const e = re(t, s);
|
|
1089
|
+
if (null === e) break;
|
|
1090
|
+
s = e.end;
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
if (!(o >= 65 && o <= 90 || o >= 97 && o <= 122 || 95 === o)) {
|
|
1094
|
+
s++;
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
let i = s + 1;
|
|
1098
|
+
for (; i < t.length;) {
|
|
1099
|
+
const e = t.charCodeAt(i);
|
|
1100
|
+
if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || 95 === e || 46 === e)) break;
|
|
1101
|
+
i++;
|
|
1102
|
+
}
|
|
1103
|
+
40 === t.charCodeAt(i) && e.push(t.slice(s, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), s = i;
|
|
1104
|
+
}
|
|
1105
|
+
return e;
|
|
1106
|
+
}, ae = (t) => {
|
|
1107
|
+
let e = 0, s = 0;
|
|
1108
|
+
for (let o = 0; o < t.length; o++) {
|
|
1109
|
+
const i = t[o];
|
|
1110
|
+
if ("\"" !== i && "'" !== i) {
|
|
1111
|
+
if ("[" === i) s++;
|
|
1112
|
+
else if ("]" === i) s > 0 && s--;
|
|
1113
|
+
else if (0 === s) {
|
|
1114
|
+
if ("(" === i) e++;
|
|
1115
|
+
else if (")" === i && (e--, e < 0)) return !1;
|
|
1116
|
+
}
|
|
1117
|
+
} else {
|
|
1118
|
+
for (o++; o < t.length;) {
|
|
1119
|
+
if (t[o] === i) {
|
|
1120
|
+
if (t[o + 1] === i) {
|
|
1121
|
+
o += 2;
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
o++;
|
|
1127
|
+
}
|
|
1128
|
+
if (o >= t.length) return !1;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
return 0 === e && 0 === s;
|
|
1132
|
+
}, ce = class {
|
|
1133
|
+
static {
|
|
1134
|
+
this.Collapsed = 1;
|
|
1135
|
+
}
|
|
1136
|
+
static {
|
|
1137
|
+
this.CustomFormat = 2;
|
|
1138
|
+
}
|
|
1139
|
+
static {
|
|
1140
|
+
this.CustomHeight = 4;
|
|
1141
|
+
}
|
|
1142
|
+
static {
|
|
1143
|
+
this.Hidden = 8;
|
|
1144
|
+
}
|
|
1145
|
+
static {
|
|
1146
|
+
this.Ht = 16;
|
|
1147
|
+
}
|
|
1148
|
+
static {
|
|
1149
|
+
this.OutlineLevel = 32;
|
|
1150
|
+
}
|
|
1151
|
+
static {
|
|
1152
|
+
this.Ph = 64;
|
|
1153
|
+
}
|
|
1154
|
+
static {
|
|
1155
|
+
this.R = 128;
|
|
1156
|
+
}
|
|
1157
|
+
static {
|
|
1158
|
+
this.S = 256;
|
|
1159
|
+
}
|
|
1160
|
+
static {
|
|
1161
|
+
this.Spans = 512;
|
|
1162
|
+
}
|
|
1163
|
+
static {
|
|
1164
|
+
this.ThickBot = 1024;
|
|
1165
|
+
}
|
|
1166
|
+
static {
|
|
1167
|
+
this.ThickTop = 2048;
|
|
1168
|
+
}
|
|
1169
|
+
}, le = (t, e, s) => {
|
|
1170
|
+
if (t[0].value[0] === t[1].value[0]) return e;
|
|
1171
|
+
}, he = {
|
|
1172
|
+
colStart: 0,
|
|
1173
|
+
colEnd: 0,
|
|
1174
|
+
rowStart: 0,
|
|
1175
|
+
rowEnd: 0
|
|
1176
|
+
}, pe = (t, e, s, o, i, r, n) => {
|
|
1177
|
+
let a = !1, c = !1, l = [], h = !1, u = null, d = null, g = null, m = null, f = null, T = null;
|
|
1178
|
+
const y = n?.get("richData") ?? L.EmptyArray, b = n?.get("dummyWrapped") ?? null, x = V.normalizeA1ToR1C1, v = $.createConflatingRanges(), w = /* @__PURE__ */ new Map(), S = [];
|
|
1179
|
+
let C = !1, k = !1, P = null;
|
|
1180
|
+
let A = !1;
|
|
1181
|
+
const E = $.createConflatingRanges();
|
|
1182
|
+
let O = !1, I = -1, D = -1, N = null, R = null, M = null;
|
|
1183
|
+
const H = [];
|
|
1184
|
+
let _ = null, z = -2, X = 0, F = "", q = "", W = "", U = "", G = "", Z = "", J = "", Q = "", K = "", Y = "", tt = "", et = "", st = "", ot = "", it = !0, rt = null, nt = !1, at = !1, ct = null, lt = 0;
|
|
1185
|
+
return {
|
|
1186
|
+
...s,
|
|
1187
|
+
onEnd: () => {
|
|
1188
|
+
H.length > 0 && (e.rows = V.runsToRefs(H, !1));
|
|
1189
|
+
let o = v.done(le);
|
|
1190
|
+
const i = o.length;
|
|
1191
|
+
if (i > 0) {
|
|
1192
|
+
const t = /* @__PURE__ */ new Set();
|
|
1193
|
+
for (let e = 0; e < S.length; e++) t.add(S[e][0].split(":")[0]);
|
|
1194
|
+
const s = new Array(i);
|
|
1195
|
+
for (let e = 0; e < i; e++) {
|
|
1196
|
+
const i = o[e], r = V.rangeToString(i), n = i.value[1];
|
|
1197
|
+
let a = V.resolveRelativeToA1(n, i.rowStart, i.colStart);
|
|
1198
|
+
a && !t.has(r.split(":")[0]) && ae(a) && (a = `${p}(${a})`), s[e] = [r, a];
|
|
1199
|
+
}
|
|
1200
|
+
e.formulas = s;
|
|
1201
|
+
}
|
|
1202
|
+
const r = E.done(!0), n = r.length;
|
|
1203
|
+
if (n > 0) {
|
|
1204
|
+
const t = new Array(n);
|
|
1205
|
+
for (let e = 0; e < n; e++) {
|
|
1206
|
+
const s = r[e];
|
|
1207
|
+
t[e] = V.rangeToString(s);
|
|
1208
|
+
}
|
|
1209
|
+
e.volatile = t;
|
|
1210
|
+
}
|
|
1211
|
+
S.length > 0 && (e.formulaArray = [...S]);
|
|
1212
|
+
const a = l.length;
|
|
1213
|
+
if (a > 0) {
|
|
1214
|
+
l.sort($.createRangeComparator(B.Axis.Column));
|
|
1215
|
+
let t = l[0], s = t.colStart, o = t.colEnd, i = t.rowEnd, r = t.value;
|
|
1216
|
+
const n = [];
|
|
1217
|
+
n.push(t);
|
|
1218
|
+
let c = null;
|
|
1219
|
+
for (let e = 1; e < a; e++) c = l[e], r !== c.value || s !== c.colStart || o !== c.colEnd || i + 1 !== c.rowEnd ? (n.push(c), t = c, s = t.colStart, o = t.colEnd, i = t.rowEnd, r = t.value) : (i = c.rowEnd, t.rowEnd = i);
|
|
1220
|
+
const h = n.length, p = new Array(h);
|
|
1221
|
+
for (let t = 0; t < h; t++) {
|
|
1222
|
+
const e = n[t];
|
|
1223
|
+
p[t] = [V.rangeToString(e), e.value];
|
|
1224
|
+
}
|
|
1225
|
+
e.directStyles = p;
|
|
1226
|
+
}
|
|
1227
|
+
const c = t.build();
|
|
1228
|
+
c && (e.data = c.tuples), s?.onEnd?.();
|
|
1229
|
+
},
|
|
1230
|
+
onOpenTag: (t) => {
|
|
1231
|
+
let o = t.name;
|
|
1232
|
+
const p = o.indexOf(":");
|
|
1233
|
+
if (-1 !== p && (o = o.slice(p + 1)), lt++, lt % 196608 == 0 && i?.(lt), R) {
|
|
1234
|
+
const e = t.attributes;
|
|
1235
|
+
switch (o) {
|
|
1236
|
+
case "v":
|
|
1237
|
+
c = !0;
|
|
1238
|
+
break;
|
|
1239
|
+
case "f":
|
|
1240
|
+
switch (h = !0, e.t ?? null) {
|
|
1241
|
+
case null:
|
|
1242
|
+
case "normal": break;
|
|
1243
|
+
case "shared":
|
|
1244
|
+
const t = e.si;
|
|
1245
|
+
d = e.ref, u = t;
|
|
1246
|
+
break;
|
|
1247
|
+
case "array":
|
|
1248
|
+
d = e.ref, P = d;
|
|
1249
|
+
break;
|
|
1250
|
+
case "datatable": d = e.ref, h = !0;
|
|
1251
|
+
}
|
|
1252
|
+
const t = e.ca;
|
|
1253
|
+
void 0 !== t && (A = "1" === t);
|
|
1254
|
+
break;
|
|
1255
|
+
case "is":
|
|
1256
|
+
O = !0;
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
O && !h && r?.onOpenTag?.(t);
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
if (a) {
|
|
1263
|
+
if ("c" === o) {
|
|
1264
|
+
R = t;
|
|
1265
|
+
const e = t.attributes, s = e.r;
|
|
1266
|
+
D = V.fastStringToCol(s);
|
|
1267
|
+
const o = e.t;
|
|
1268
|
+
void 0 === o ? M = null : (M = o, "str" === M && (O = !0));
|
|
1269
|
+
let i = e.s;
|
|
1270
|
+
void 0 === i && (null !== ct || at) && (i = "0"), void 0 !== i && (i = parseInt(i), rt && rt.value === i && rt.colEnd + 1 === D ? rt.colEnd = D : (rt = {
|
|
1271
|
+
colStart: D,
|
|
1272
|
+
rowStart: I,
|
|
1273
|
+
colEnd: D,
|
|
1274
|
+
rowEnd: I,
|
|
1275
|
+
value: i
|
|
1276
|
+
}, l.push(rt))), P = null, k = !1;
|
|
1277
|
+
const r = e.cm;
|
|
1278
|
+
C = void 0 !== r && ((t) => {
|
|
1279
|
+
const e = (n?.get("metadata"))?.cells;
|
|
1280
|
+
if (!e) return !1;
|
|
1281
|
+
const s = parseInt(t, 10);
|
|
1282
|
+
return !(!Number.isFinite(s) || s < 1) && !0 === (e[s - 1]?.get("XLDAPR"))?.fDynamic;
|
|
1283
|
+
})(r);
|
|
1284
|
+
const a = e.vm;
|
|
1285
|
+
if (void 0 !== a) {
|
|
1286
|
+
const t = y[parseInt(a) - 1];
|
|
1287
|
+
if (j.isError(t)) {
|
|
1288
|
+
const e = t.getCode();
|
|
1289
|
+
N = {
|
|
1290
|
+
t: "e",
|
|
1291
|
+
v: e
|
|
1292
|
+
}, C && e === j.Code.Spill && (k = !0);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
} else {
|
|
1297
|
+
if ("row" === o) {
|
|
1298
|
+
a = !0;
|
|
1299
|
+
const e = t.attributes.r;
|
|
1300
|
+
if (I = parseInt(e) - 1, X = 0, q = t.attributes.customHeight, void 0 !== q && (X |= ce.CustomHeight), q !== K && (it = !0, K = q), F = t.attributes.ht, void 0 !== F && (X |= ce.Ht), F !== Q && (it = !0, Q = F), W = t.attributes.hidden, void 0 !== W && (X |= ce.Hidden), W !== Y && (it = !0, Y = W), G = t.attributes.s, void 0 !== G && (X |= ce.S), G !== et && (it = !0, et = G), U = t.attributes.customFormat, void 0 !== U && (X |= ce.CustomFormat), U !== tt && (it = !0, tt = U), Z = t.attributes.outlineLevel, void 0 !== Z && (X |= ce.OutlineLevel), Z !== st && (it = !0, st = Z), J = t.attributes.collapsed, void 0 !== J && (X |= ce.Collapsed), J !== ot && (it = !0, ot = J), 0 !== X) if (z + 1 !== I || it) {
|
|
1301
|
+
const t = void 0 !== q && ("1" === q || "true" === q), e = void 0 !== U && ("1" === U || "true" === U);
|
|
1302
|
+
ct = e && void 0 !== G ? G : null, e && null === ct && (ct = "0"), _ = {
|
|
1303
|
+
min: I,
|
|
1304
|
+
max: I,
|
|
1305
|
+
value: {
|
|
1306
|
+
sz: void 0 === F ? -1 : parseFloat(F),
|
|
1307
|
+
csz: t,
|
|
1308
|
+
h: void 0 !== W && ("1" === W || "true" === W),
|
|
1309
|
+
s: null === ct ? void 0 : "0" === ct ? 0 : parseInt(ct),
|
|
1310
|
+
l: void 0 === Z || "0" === Z ? 0 : parseInt(Z),
|
|
1311
|
+
cl: void 0 !== J && ("1" === J || "true" === J)
|
|
1312
|
+
}
|
|
1313
|
+
}, H.push(_);
|
|
1314
|
+
} else _.max = I;
|
|
1315
|
+
z = I, it = !1;
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
if (!nt && "sheetData" === o) {
|
|
1319
|
+
nt = !0;
|
|
1320
|
+
const t = e.cols, s = t ? t.length : 0;
|
|
1321
|
+
for (let e = 0; !at && e < s; e++) t[e].v.s && (at = !0);
|
|
1322
|
+
}
|
|
1323
|
+
s?.onOpenTag?.(t);
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
onCloseTag: (e) => {
|
|
1327
|
+
let o = e.name;
|
|
1328
|
+
if (!h || "c" !== o && "f" !== o || (u && (m = w.get(u) ?? null), m && (v.append(I, D, m), A && E.append(I, D)), null !== P && S.push([P, C ? k ? "dynamicSpillError" : "dynamic" : "static"]), h = !1, m = null, u = null, d = null, c = !1, A = !1, P = null, C = !1, k = !1), R) {
|
|
1329
|
+
const s = o.indexOf(":");
|
|
1330
|
+
if (-1 !== s && (o = o.slice(s + 1)), O) if ("is" === o || "v" === o) {
|
|
1331
|
+
const e = r?.onEnd?.();
|
|
1332
|
+
null != e && t.pushAt(I, D, "" + e);
|
|
1333
|
+
} else "f" !== o && r?.onCloseTag?.(e);
|
|
1334
|
+
c && (c = !1), "c" === o && (R = null, O = !1);
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
if (a) return a = !1, void (rt = null);
|
|
1338
|
+
s?.onCloseTag?.(e);
|
|
1339
|
+
},
|
|
1340
|
+
onText: (i) => {
|
|
1341
|
+
const n = i.trim();
|
|
1342
|
+
if (c) {
|
|
1343
|
+
switch (N = null, M) {
|
|
1344
|
+
case null:
|
|
1345
|
+
case "n":
|
|
1346
|
+
N = parseFloat(n);
|
|
1347
|
+
break;
|
|
1348
|
+
case "b":
|
|
1349
|
+
N = "1" === n || "true" === n;
|
|
1350
|
+
break;
|
|
1351
|
+
case "s":
|
|
1352
|
+
N = n;
|
|
1353
|
+
break;
|
|
1354
|
+
case "e":
|
|
1355
|
+
if ("#VALUE!" === n) {
|
|
1356
|
+
const t = R.attributes.vm;
|
|
1357
|
+
if (void 0 !== t) {
|
|
1358
|
+
const e = y[parseInt(t) - 1];
|
|
1359
|
+
if (j.isError(e)) {
|
|
1360
|
+
N = {
|
|
1361
|
+
t: "e",
|
|
1362
|
+
v: e.getCode()
|
|
1363
|
+
};
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
const t = j.getBuiltInByLabel(n);
|
|
1369
|
+
t ? N = {
|
|
1370
|
+
t: "e",
|
|
1371
|
+
v: t.getCode()
|
|
1372
|
+
} : (N = n, o?.(`Unknown formula error '${n}' in cell ${V.cellToString({
|
|
1373
|
+
colIndex: D,
|
|
1374
|
+
rowIndex: I
|
|
1375
|
+
})}`));
|
|
1376
|
+
break;
|
|
1377
|
+
case "str":
|
|
1378
|
+
case "inlineStr": O = !0;
|
|
1379
|
+
}
|
|
1380
|
+
null !== N && t.pushAt(I, D, N);
|
|
1381
|
+
}
|
|
1382
|
+
if (u) {
|
|
1383
|
+
if (f === u) m = T;
|
|
1384
|
+
else {
|
|
1385
|
+
if (m = w.get(u) ?? null, !m) {
|
|
1386
|
+
const t = [];
|
|
1387
|
+
g = x(n, I, D, t), m = [
|
|
1388
|
+
g,
|
|
1389
|
+
t,
|
|
1390
|
+
n
|
|
1391
|
+
], w.set(u, m);
|
|
1392
|
+
}
|
|
1393
|
+
f = u, T = m;
|
|
1394
|
+
}
|
|
1395
|
+
u = null;
|
|
1396
|
+
}
|
|
1397
|
+
if (h) {
|
|
1398
|
+
if (null !== b) {
|
|
1399
|
+
const t = ((t) => {
|
|
1400
|
+
if (t.length < te.length) return oe;
|
|
1401
|
+
if (t.slice(0, te.length).toUpperCase() !== ee) return oe;
|
|
1402
|
+
const e = re(t, te.length);
|
|
1403
|
+
if (null === e) return oe;
|
|
1404
|
+
if (41 !== t.charCodeAt(e.end)) return oe;
|
|
1405
|
+
if (44 !== t.charCodeAt(e.end + 1)) return oe;
|
|
1406
|
+
if (41 !== t.charCodeAt(t.length - 1)) return oe;
|
|
1407
|
+
const s = e.value;
|
|
1408
|
+
return s.toUpperCase() === se ? ie : 0 === s.length ? oe : {
|
|
1409
|
+
kind: "formula",
|
|
1410
|
+
formula: s
|
|
1411
|
+
};
|
|
1412
|
+
})(n);
|
|
1413
|
+
"none" !== t.kind && b.push({
|
|
1414
|
+
sheet: e,
|
|
1415
|
+
rowIndex: I,
|
|
1416
|
+
colIndex: D,
|
|
1417
|
+
formula: "formula" === t.kind ? t.formula : null
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
const t = [];
|
|
1421
|
+
g = x(n, I, D, t), m = [
|
|
1422
|
+
g,
|
|
1423
|
+
t,
|
|
1424
|
+
n
|
|
1425
|
+
];
|
|
1426
|
+
}
|
|
1427
|
+
O ? r?.onText?.(i) : a || s?.onText?.(n);
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1430
|
+
}, ue = (t) => {
|
|
1431
|
+
const e = t.indexOf(":");
|
|
1432
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
1433
|
+
}, de = {
|
|
1434
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
1435
|
+
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
1436
|
+
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
1437
|
+
"application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
|
|
1438
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
|
|
1439
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
|
|
1440
|
+
"application/vnd.ms-excel.worksheet": "sheets",
|
|
1441
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
|
|
1442
|
+
"application/vnd.ms-excel.chartsheet": "charts",
|
|
1443
|
+
"application/vnd.ms-excel.macrosheet+xml": "macros",
|
|
1444
|
+
"application/vnd.ms-excel.macrosheet": "macros",
|
|
1445
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
|
|
1446
|
+
"application/vnd.ms-excel.dialogsheet": "dialogs",
|
|
1447
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
|
|
1448
|
+
"application/vnd.ms-excel.sharedStrings": "strs",
|
|
1449
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
|
|
1450
|
+
"application/vnd.ms-excel.styles": "styles",
|
|
1451
|
+
"application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
|
|
1452
|
+
"application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
|
|
1453
|
+
"application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
|
|
1454
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
|
|
1455
|
+
"application/vnd.ms-excel.comments": "comments",
|
|
1456
|
+
"application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
|
|
1457
|
+
"application/vnd.ms-excel.person+xml": "people",
|
|
1458
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
|
|
1459
|
+
"application/vnd.ms-excel.sheetMetadata": "metadata",
|
|
1460
|
+
"application/vnd.ms-excel.externalLink": "links",
|
|
1461
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
1462
|
+
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
1463
|
+
}, ge = (t) => t.startsWith("/") ? t.slice(1) : t, me = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, fe = async (l, p) => {
|
|
1464
|
+
const { password: g, onVBA: L, profile: $, createWorkbookOptions: j = {}, ...B } = p ?? {}, F = j.origin && "string" != typeof j.origin ? j.origin : null, q = $ ? new J("function" == typeof $ ? $ : void 0) : null, W = [], U = p?.progress, G = U?.onProgress ? U.onProgress.bind(U) : void 0, Q = l.byteLength;
|
|
1465
|
+
let K = 0, Y = 0;
|
|
1466
|
+
const tt = G ? (t) => {
|
|
1467
|
+
if (K <= 0) return;
|
|
1468
|
+
Y += t;
|
|
1469
|
+
const e = Math.min(Q, Math.round(Y / K * Q));
|
|
1470
|
+
G(e, Q);
|
|
1471
|
+
} : void 0, et = import("./DF893ovKIDS88O7b.mjs");
|
|
1472
|
+
let st = null;
|
|
1473
|
+
try {
|
|
1474
|
+
st = new DOMParser();
|
|
1475
|
+
} catch (t) {}
|
|
1476
|
+
let ot = null;
|
|
1477
|
+
try {
|
|
1478
|
+
ot = new XMLSerializer();
|
|
1479
|
+
} catch (t) {}
|
|
1480
|
+
let it, rt, nt, at = null;
|
|
1481
|
+
st || (at = import("@xmldom/xmldom"));
|
|
1482
|
+
try {
|
|
1483
|
+
const [t, e] = await Promise.all([at, et]);
|
|
1484
|
+
it = new e.DOMTransformer(), rt = st ?? new t.DOMParser(), nt = ot ?? new t.XMLSerializer();
|
|
1485
|
+
} catch (t) {
|
|
1486
|
+
throw new Error("Unable to load XLSX parser.", { cause: t });
|
|
1487
|
+
}
|
|
1488
|
+
const ct = (t) => nt.serializeToString(t);
|
|
1489
|
+
let lt;
|
|
1490
|
+
try {
|
|
1491
|
+
lt = await Z.create(l);
|
|
1492
|
+
} catch (t) {
|
|
1493
|
+
throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
|
|
1494
|
+
}
|
|
1495
|
+
q?.mark("zip-open");
|
|
1496
|
+
try {
|
|
1497
|
+
if (!lt.has("[Content_Types].xml")) throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
1498
|
+
const l = (t) => {
|
|
1499
|
+
const e = lt.getEntry(t);
|
|
1500
|
+
return e ? { content: e } : void 0;
|
|
1501
|
+
}, p = {
|
|
1502
|
+
workbooks: [],
|
|
1503
|
+
sheets: [],
|
|
1504
|
+
charts: [],
|
|
1505
|
+
dialogs: [],
|
|
1506
|
+
macros: [],
|
|
1507
|
+
strs: [],
|
|
1508
|
+
comments: [],
|
|
1509
|
+
threadedcomments: [],
|
|
1510
|
+
links: [],
|
|
1511
|
+
coreprops: [],
|
|
1512
|
+
extprops: [],
|
|
1513
|
+
custprops: [],
|
|
1514
|
+
themes: [],
|
|
1515
|
+
styles: [],
|
|
1516
|
+
metadata: [],
|
|
1517
|
+
people: [],
|
|
1518
|
+
sst: "",
|
|
1519
|
+
style: "",
|
|
1520
|
+
defaults: {}
|
|
1521
|
+
};
|
|
1522
|
+
{
|
|
1523
|
+
const t = ((t, e) => ({
|
|
1524
|
+
onOpenTag: (e) => {
|
|
1525
|
+
const s = ((t) => {
|
|
1526
|
+
const e = t.indexOf(":");
|
|
1527
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
1528
|
+
})(e.name), o = e.attributes;
|
|
1529
|
+
if ("Override" === s) {
|
|
1530
|
+
const e = o.ContentType, s = o.PartName;
|
|
1531
|
+
if (!e || !s) return;
|
|
1532
|
+
const i = de[e], r = i ? t[i] : void 0;
|
|
1533
|
+
Array.isArray(r) && r.push(s);
|
|
1534
|
+
} else if ("Default" === s) {
|
|
1535
|
+
const e = o.Extension, s = o.ContentType;
|
|
1536
|
+
e && (t.defaults[e.toLowerCase()] = s);
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
onEnd: () => {
|
|
1540
|
+
t.sst = t.strs.length > 0 ? t.strs[0] : "", t.style = t.styles.length > 0 ? t.styles[0] : "";
|
|
1541
|
+
},
|
|
1542
|
+
onError: (t) => {
|
|
1543
|
+
e?.(`Error parsing content types: ${t?.message ?? t}`);
|
|
1544
|
+
}
|
|
1545
|
+
}))(p, (t) => {
|
|
1546
|
+
W.push([t, "[Content_Types].xml"]);
|
|
1547
|
+
}), e = await lt.getTextStream("[Content_Types].xml");
|
|
1548
|
+
if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
|
|
1549
|
+
try {
|
|
1550
|
+
await Xt.parseStream(e, t, { xmlns: !1 });
|
|
1551
|
+
} catch (t) {
|
|
1552
|
+
throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
|
|
1553
|
+
}
|
|
1554
|
+
F && await lt.getBuffer("[Content_Types].xml");
|
|
1555
|
+
}
|
|
1556
|
+
q?.mark("content-types");
|
|
1557
|
+
const g = p.sst, B = /* @__PURE__ */ new Set();
|
|
1558
|
+
for (const t of p.sheets) B.add(ge(t));
|
|
1559
|
+
g && B.add(ge(g));
|
|
1560
|
+
for (const t of B) K += lt.uncompressedSize(t);
|
|
1561
|
+
if (await lt.prefetch((t) => !B.has(t) && !me.test(t)), q?.mark("prefetch-side-parts"), 0 === p.workbooks.length) {
|
|
1562
|
+
const t = n("_rels/.rels", l, rt, it), e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
1563
|
+
if (t) {
|
|
1564
|
+
for (const s of t.values()) if (s.type === e && s.target) {
|
|
1565
|
+
p.workbooks.push(s.target);
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
if (0 === p.workbooks.length) throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
1571
|
+
p.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], p.richdata = ["/xl/richData/rdrichvalue.xml"];
|
|
1572
|
+
const M = j?.resources ?? new H(), Z = M.beginPersist(), J = {}, Y = /* @__PURE__ */ new Set(), et = /* @__PURE__ */ new Map();
|
|
1573
|
+
et.set("richTypes", []);
|
|
1574
|
+
const st = [];
|
|
1575
|
+
et.set("dummyWrapped", st);
|
|
1576
|
+
const ot = a("metadata", p, l, rt, it).entries().next()?.value?.[1]?.metadata;
|
|
1577
|
+
ot && et.set("metadata", ot);
|
|
1578
|
+
const nt = /* @__PURE__ */ new Map(), at = [], ht = (t, e = nt) => {
|
|
1579
|
+
const s = t.lastIndexOf("/"), o = t.substring(0, s + 1) + "_rels/" + t.substring(s + 1, t.length) + ".rels";
|
|
1580
|
+
let i = e.get(o);
|
|
1581
|
+
return i || (i = n(o, l, rt, it, Tt), e.set(o, i)), i;
|
|
1582
|
+
}, pt = (n, a, c, h = nt) => {
|
|
1583
|
+
let p = ht(a, h).get(n), u = p?.target;
|
|
1584
|
+
if (!u) return null;
|
|
1585
|
+
if ("External" === p.targetMode) {
|
|
1586
|
+
if (!c) return p.target;
|
|
1587
|
+
const t = M.add({ source: { external: p.target } });
|
|
1588
|
+
return t.addReference(J), Y.add(t), Z.toResourceId(t);
|
|
1589
|
+
}
|
|
1590
|
+
const d = a.lastIndexOf("/"), g = a.substring(0, d + 1);
|
|
1591
|
+
u.startsWith("/") || (u = g + u), u = i(u);
|
|
1592
|
+
const v = it?.getVisitorParamsState().get("dxfs");
|
|
1593
|
+
let O = h.get(u);
|
|
1594
|
+
if (!O) {
|
|
1595
|
+
const i = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", n = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
|
|
1596
|
+
if (p.type === i) {
|
|
1597
|
+
const t = {};
|
|
1598
|
+
O = t;
|
|
1599
|
+
const o = async () => {
|
|
1600
|
+
const o = ((t, s, o, i, n, a, c, l) => {
|
|
1601
|
+
const h = new Yt(), p = new z.TransposedBuilder();
|
|
1602
|
+
let u = null;
|
|
1603
|
+
h.registerVisitor({
|
|
1604
|
+
from: "autoFilter",
|
|
1605
|
+
to: "autoTable",
|
|
1606
|
+
openTag: (t) => {
|
|
1607
|
+
const e = t.getAttribute("ref"), s = V.fastStringToRange(e);
|
|
1608
|
+
t.getSource().r = s, t.getSource().v = {};
|
|
1609
|
+
},
|
|
1610
|
+
closeTag: (t) => {
|
|
1611
|
+
const e = t.getSource(), s = e.v, o = s.hiddenButtons;
|
|
1612
|
+
if (Array.isArray(o)) {
|
|
1613
|
+
const t = o.length, i = e.r, r = i.colEnd - i.colStart + 1;
|
|
1614
|
+
0 === t ? s.hiddenButtons = !1 : t === r && (s.hiddenButtons = !0);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}), h.registerVisitor({
|
|
1618
|
+
from: "conditionalFormatting",
|
|
1619
|
+
to: {},
|
|
1620
|
+
openTag: (t) => {
|
|
1621
|
+
const e = t.getParent();
|
|
1622
|
+
e.conditionals || (e.conditionals = []);
|
|
1623
|
+
let s = t.getAttribute("sqref");
|
|
1624
|
+
s && (s = s.trim().split(/\s+/).join(","));
|
|
1625
|
+
const o = {
|
|
1626
|
+
r: s,
|
|
1627
|
+
conditionals: e.conditionals
|
|
1628
|
+
}, i = t.getAttribute("pivot", Zt);
|
|
1629
|
+
null !== i && (o.pivot = i), t.setSource(o);
|
|
1630
|
+
}
|
|
1631
|
+
}), h.registerVisitor({
|
|
1632
|
+
from: "cfRule",
|
|
1633
|
+
to: {},
|
|
1634
|
+
openTag: (t) => {
|
|
1635
|
+
const e = t.getParent();
|
|
1636
|
+
if (!e?.r) return;
|
|
1637
|
+
const s = t.getSource() ?? {};
|
|
1638
|
+
void 0 !== e.pivot && (s.pivot = e.pivot), e.conditionals.push({
|
|
1639
|
+
r: e.r,
|
|
1640
|
+
v: null,
|
|
1641
|
+
rule: s
|
|
1642
|
+
}), t.copyToObject(s, "type", Kt), t.copyToObject(s, "priority", Jt), t.copyToObject(s, "stopIfTrue", Zt);
|
|
1643
|
+
const o = t.getAttribute("dxfId", Jt);
|
|
1644
|
+
if (null !== o) {
|
|
1645
|
+
let e = i?.get(o);
|
|
1646
|
+
e || (a?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
|
|
1647
|
+
}
|
|
1648
|
+
t.copyToObject(s, "aboveAverage", Zt), t.copyToObject(s, "equalAverage", Zt), t.copyToObject(s, "stdDev", Jt), t.copyToObject(s, "bottom", Zt), t.copyToObject(s, "percent", Zt), t.copyToObject(s, "rank", Jt), t.copyToObject(s, "operator", Kt), t.copyToObject(s, "text", Kt), t.copyToObject(s, "timePeriod", Kt);
|
|
1649
|
+
},
|
|
1650
|
+
closeTag: (t) => {
|
|
1651
|
+
const e = t.getParent();
|
|
1652
|
+
if (!e?.r) return;
|
|
1653
|
+
const s = e.conditionals[e.conditionals.length - 1], o = s?.rule;
|
|
1654
|
+
if (!o) return;
|
|
1655
|
+
const i = {}, r = m(o, a);
|
|
1656
|
+
r && (i.condition = r), o.style && (i.style = o.style), o.scale && (i.scale = o.scale), o.stopIfTrue && (i.stopIfTrue = !0), o.pivot && (i.pivot = !0), s.v = i, s.priority = o.priority, o.x14Id && (s.x14Id = o.x14Id), delete s.rule;
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1659
|
+
const d = (t) => {
|
|
1660
|
+
const e = t.conditions ?? [], s = [];
|
|
1661
|
+
for (let t = 0; t < e.length; t++) {
|
|
1662
|
+
const o = e[t], i = {};
|
|
1663
|
+
o.type && (i.type = o.type), void 0 !== o.value && (i.value = o.value), o.exclusive && (i.exclusive = !0), s.push(i);
|
|
1664
|
+
}
|
|
1665
|
+
return s;
|
|
1666
|
+
};
|
|
1667
|
+
h.registerVisitor({
|
|
1668
|
+
from: "colorScale",
|
|
1669
|
+
to: {},
|
|
1670
|
+
openTag: (t) => {},
|
|
1671
|
+
closeTag: (t) => {
|
|
1672
|
+
const e = t.getSource(), s = e.colors ?? [], o = d(e);
|
|
1673
|
+
for (let t = 0; t < o.length; t++) o[t].color = s[t];
|
|
1674
|
+
t.getParent().scale = {
|
|
1675
|
+
type: R.ScaleType.ColorScale,
|
|
1676
|
+
stops: o
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
}), h.registerVisitor({
|
|
1680
|
+
from: "dataBar",
|
|
1681
|
+
to: {},
|
|
1682
|
+
openTag: (t) => {
|
|
1683
|
+
t.copyTo("maxLength", Jt), t.copyTo("minLength", Jt), t.copyTo("showValue", Zt);
|
|
1684
|
+
},
|
|
1685
|
+
closeTag: (t) => {
|
|
1686
|
+
const e = t.getSource(), s = {
|
|
1687
|
+
type: R.ScaleType.DataBar,
|
|
1688
|
+
stops: d(e)
|
|
1689
|
+
}, o = e.colors?.[0];
|
|
1690
|
+
o && (s.color = o), void 0 !== e.minLength && (s.minLength = e.minLength), void 0 !== e.maxLength && (s.maxLength = e.maxLength), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
|
|
1691
|
+
}
|
|
1692
|
+
}), h.registerVisitor({
|
|
1693
|
+
from: "iconSet",
|
|
1694
|
+
to: {},
|
|
1695
|
+
openTag: (t) => {
|
|
1696
|
+
t.copyTo("iconSet", Kt), t.copyTo("reverse", Zt), t.copyTo("showValue", Zt);
|
|
1697
|
+
},
|
|
1698
|
+
closeTag: (t) => {
|
|
1699
|
+
const e = t.getSource(), s = {
|
|
1700
|
+
type: R.ScaleType.IconSet,
|
|
1701
|
+
stops: d(e)
|
|
1702
|
+
};
|
|
1703
|
+
void 0 !== e.iconSet && (s.iconSet = e.iconSet), void 0 !== e.reverse && (s.reverse = e.reverse), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
|
|
1704
|
+
}
|
|
1705
|
+
}), h.registerVisitor({
|
|
1706
|
+
from: "formula",
|
|
1707
|
+
to: {},
|
|
1708
|
+
text: (t, e) => {
|
|
1709
|
+
const s = e.getParent();
|
|
1710
|
+
let o = s.formulas;
|
|
1711
|
+
o || (o = [], s.formulas = o), o.push(t);
|
|
1712
|
+
}
|
|
1713
|
+
}), h.registerVisitor({
|
|
1714
|
+
from: "cfvo",
|
|
1715
|
+
to: {},
|
|
1716
|
+
openTag: (t) => {
|
|
1717
|
+
const e = t.getParent();
|
|
1718
|
+
e.conditions || (e.conditions = []);
|
|
1719
|
+
const s = t.getSource();
|
|
1720
|
+
e.conditions.push(s), t.copyTo("type", Kt), s.type === R.ColorStopType.Formula ? t.copyTo("value", Kt, "val") : t.copyTo("value", Qt, "val"), !1 === t.getAttribute("gte", Zt) && (s.exclusive = !0);
|
|
1721
|
+
}
|
|
1722
|
+
}), h.registerVisitor({
|
|
1723
|
+
from: "color",
|
|
1724
|
+
to: {},
|
|
1725
|
+
openTag: (t) => {
|
|
1726
|
+
const s = t.getParent();
|
|
1727
|
+
s.colors || (s.colors = []);
|
|
1728
|
+
const o = e((e) => t.getAttribute(e));
|
|
1729
|
+
s.colors.push(o);
|
|
1730
|
+
}
|
|
1731
|
+
}), h.registerVisitor({
|
|
1732
|
+
from: "filterColumn",
|
|
1733
|
+
to: {},
|
|
1734
|
+
openTag: (t) => {
|
|
1735
|
+
const e = t.getParent().v, s = parseInt(t.getAttribute("colId")), o = t.getSource();
|
|
1736
|
+
o.index = s;
|
|
1737
|
+
let i = e.filter;
|
|
1738
|
+
i || (i = { conditions: [] }, e.filter = i);
|
|
1739
|
+
let r = i.conditions;
|
|
1740
|
+
if (r || (r = [], i.conditions = r), r.push(o), t.getAttribute("hiddenButton", Zt) && e) {
|
|
1741
|
+
let t = e.hiddenButtons;
|
|
1742
|
+
t || (t = [], e.hiddenButtons = t), t.push(s);
|
|
1743
|
+
}
|
|
1744
|
+
if (t.getAttribute("showButton", Zt) && e) {
|
|
1745
|
+
let t = e.showButtons;
|
|
1746
|
+
t || (t = [], e.showButtons = t), t.push(s);
|
|
1747
|
+
}
|
|
1748
|
+
return o;
|
|
1749
|
+
}
|
|
1750
|
+
}), h.registerVisitor({
|
|
1751
|
+
from: "colorFilter",
|
|
1752
|
+
openTag: (t) => {
|
|
1753
|
+
const e = t.getParent(), s = {};
|
|
1754
|
+
e.operator = N.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor"), t.copyToObject(s, "styleId", Jt, "dxfId");
|
|
1755
|
+
}
|
|
1756
|
+
}), h.registerVisitor({
|
|
1757
|
+
from: "iconFilter",
|
|
1758
|
+
openTag: (t) => {
|
|
1759
|
+
const e = t.getParent(), s = {};
|
|
1760
|
+
e.operator = N.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", Jt), t.copyToObject(s, "iconSet", Kt);
|
|
1761
|
+
}
|
|
1762
|
+
}), h.registerVisitor({
|
|
1763
|
+
from: "top10",
|
|
1764
|
+
openTag: (t) => {
|
|
1765
|
+
const e = t.getParent(), s = {};
|
|
1766
|
+
e.operator = N.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", Qt), t.copyToObject(s, "percent", Zt), t.copyToObject(s, "top", Zt), t.copyToObject(s, "limit", Qt, "val");
|
|
1767
|
+
}
|
|
1768
|
+
}), h.registerVisitor({
|
|
1769
|
+
from: "dynamicFilter",
|
|
1770
|
+
openTag: (t) => {
|
|
1771
|
+
const e = t.getParent(), s = {};
|
|
1772
|
+
e.operator = N.BuiltInOperatorNames.TimePeriod, e.param = s;
|
|
1773
|
+
let o = t.getAttribute("type");
|
|
1774
|
+
Object.values(N.AverageType).includes(o) ? (e.operator = N.BuiltInOperatorNames.Average, t.copyToObject(s, "stdDevs", Jt, "val")) : t.copyToObject(s, "anchorDate", Jt, "val"), t.copyToObject(s, "operator", Kt, "type"), t.copyToObject(s, "maxVal", Qt, "maxVal");
|
|
1775
|
+
}
|
|
1776
|
+
}), h.registerVisitor({
|
|
1777
|
+
from: "filters",
|
|
1778
|
+
to: {},
|
|
1779
|
+
openTag: (t) => {
|
|
1780
|
+
const e = t.getParent(), s = {};
|
|
1781
|
+
return e.operator = N.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", Zt), t.copyToObject(s, "calendarType", Kt), s;
|
|
1782
|
+
}
|
|
1783
|
+
}), h.registerVisitor({
|
|
1784
|
+
from: "filter",
|
|
1785
|
+
openTag: (t) => {
|
|
1786
|
+
const e = t.getParent();
|
|
1787
|
+
let s = e.items;
|
|
1788
|
+
s || (s = [], e.items = s), s.push(t.getAttribute("val", Kt));
|
|
1789
|
+
}
|
|
1790
|
+
}), h.registerVisitor({
|
|
1791
|
+
from: "dateGroupItem",
|
|
1792
|
+
to: {},
|
|
1793
|
+
openTag: (t) => {
|
|
1794
|
+
const e = t.getParent();
|
|
1795
|
+
let s = e.dateGroups;
|
|
1796
|
+
s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", Kt, "dateTimeGrouping"), t.copyTo("day", Jt), t.copyTo("hour", Jt), t.copyTo("minute", Jt), t.copyTo("month", Jt), t.copyTo("second", Jt), t.copyTo("year", Jt);
|
|
1797
|
+
}
|
|
1798
|
+
}), h.registerVisitor({
|
|
1799
|
+
from: "customFilters",
|
|
1800
|
+
openTag: (t) => {
|
|
1801
|
+
const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s;
|
|
1802
|
+
t.getAttribute("val");
|
|
1803
|
+
const i = [];
|
|
1804
|
+
return e.operator = o ? N.BuiltInOperatorNames.And : N.BuiltInOperatorNames.Or, e.param = { conditions: i }, t.setSource(e), i;
|
|
1805
|
+
},
|
|
1806
|
+
closeTag: (t) => {
|
|
1807
|
+
t.getSource().param.conditions.length;
|
|
1808
|
+
}
|
|
1809
|
+
}), h.registerVisitor({
|
|
1810
|
+
from: "customFilter",
|
|
1811
|
+
openTag: (t) => {
|
|
1812
|
+
const e = t.getParent();
|
|
1813
|
+
let s;
|
|
1814
|
+
Array.isArray(e) ? (s = {}, e.push(s)) : s = e, t.copyToObject(s, "operator"), t.copyToObject(s, "param", Kt, "val");
|
|
1815
|
+
}
|
|
1816
|
+
}), h.registerVisitor({
|
|
1817
|
+
from: "sortState",
|
|
1818
|
+
to: {},
|
|
1819
|
+
openTag: (t) => {
|
|
1820
|
+
const e = t.getParent();
|
|
1821
|
+
let s = e.v;
|
|
1822
|
+
s && (s.sort = {}, t.setSource(e));
|
|
1823
|
+
}
|
|
1824
|
+
}), h.registerVisitor({
|
|
1825
|
+
from: "sortCondition",
|
|
1826
|
+
to: {},
|
|
1827
|
+
openTag: (t) => {
|
|
1828
|
+
const e = t.getParent(), s = e.v;
|
|
1829
|
+
if (!s) return;
|
|
1830
|
+
const o = s.sort;
|
|
1831
|
+
if (!o) return;
|
|
1832
|
+
let i = o.sorts;
|
|
1833
|
+
i || (i = [], o.sorts = i);
|
|
1834
|
+
const r = t.getAttribute("ref");
|
|
1835
|
+
let n = 0;
|
|
1836
|
+
if (r) {
|
|
1837
|
+
const t = V.fastStringToRange(r, he).colStart, s = e.r, o = s.colStart;
|
|
1838
|
+
n = s ? t - o : t;
|
|
1839
|
+
}
|
|
1840
|
+
const a = {};
|
|
1841
|
+
t.copyToObject(a, "sortOn", Kt, "sortBy"), t.copyToObject(a, "dxfId", Kt, "sortBy"), t.copyToObject(a, "iconSet", Kt), t.copyToObject(a, "customList", Kt), a.reverse = t.getAttribute("descending", Zt) ?? !1;
|
|
1842
|
+
const c = {
|
|
1843
|
+
index: n,
|
|
1844
|
+
criteria: a
|
|
1845
|
+
};
|
|
1846
|
+
i.push(c);
|
|
1847
|
+
}
|
|
1848
|
+
}), h.registerVisitor({
|
|
1849
|
+
from: "AlternateContent",
|
|
1850
|
+
to: null
|
|
1851
|
+
});
|
|
1852
|
+
const g = (t) => {
|
|
1853
|
+
u = t.getSource(), t.copyTo("topLeft", Kt, "topLeftCell");
|
|
1854
|
+
const e = r(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
|
|
1855
|
+
null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", Zt), t.copyTo("showFormulas", Zt), t.copyTo("zoomScale", Jt), t.copyTo("showRowHeaders", Zt, "showRowColHeaders"), t.copyTo("showColumnHeaders", Zt, "showRowColHeaders"), t.copyTo("showRowGridlines", Zt, "showGridLines"), t.copyTo("showColumnGridlines", Zt, "showGridLines"), t.copyTo("rightToLeft", Zt);
|
|
1856
|
+
};
|
|
1857
|
+
h.registerVisitor({
|
|
1858
|
+
from: "sheetView",
|
|
1859
|
+
to: "view",
|
|
1860
|
+
openTag: (t) => {
|
|
1861
|
+
g(t);
|
|
1862
|
+
},
|
|
1863
|
+
closeTag: () => {
|
|
1864
|
+
u = null;
|
|
1865
|
+
}
|
|
1866
|
+
}), h.registerVisitor({
|
|
1867
|
+
from: "customSheetViews",
|
|
1868
|
+
to: "customSheetViews",
|
|
1869
|
+
openTag: (t) => {
|
|
1870
|
+
t.setSource([]);
|
|
1871
|
+
}
|
|
1872
|
+
}), h.registerVisitor({
|
|
1873
|
+
from: "customSheetView",
|
|
1874
|
+
to: [],
|
|
1875
|
+
openTag: (t) => {
|
|
1876
|
+
g(t);
|
|
1877
|
+
},
|
|
1878
|
+
closeTag: () => {
|
|
1879
|
+
u = null;
|
|
1880
|
+
}
|
|
1881
|
+
}), h.registerVisitor({
|
|
1882
|
+
from: "selection",
|
|
1883
|
+
to: "selection",
|
|
1884
|
+
openTag: (t) => {
|
|
1885
|
+
if (!u) return;
|
|
1886
|
+
t.copyTo("cell", Kt, "activeCell"), t.copyTo("rangeIndex", Jt, "activeCellId");
|
|
1887
|
+
const e = t.getAttribute("activeCell"), s = t.getAttribute("sqref");
|
|
1888
|
+
s && s !== e && (t.getSource().ranges = s.trim().split(/\s+/));
|
|
1889
|
+
}
|
|
1890
|
+
}), h.registerVisitor({
|
|
1891
|
+
from: "pane",
|
|
1892
|
+
to: null,
|
|
1893
|
+
openTag: (t) => {
|
|
1894
|
+
if (!u) return;
|
|
1895
|
+
if ("frozen" === t.getAttribute("state")) {
|
|
1896
|
+
const e = {};
|
|
1897
|
+
u.freezePanes = e, t.copyToObject(e, "topLeft", Kt, "topLeftCell");
|
|
1898
|
+
const s = (u.topLeft ? V.fastStringToCell(u.topLeft) : void 0) ?? {
|
|
1899
|
+
colIndex: 0,
|
|
1900
|
+
rowIndex: 0
|
|
1901
|
+
}, o = {
|
|
1902
|
+
colIndex: 0,
|
|
1903
|
+
rowIndex: 0
|
|
1904
|
+
};
|
|
1905
|
+
t.copyToObject(o, "colIndex", Jt, "xSplit"), t.copyToObject(o, "rowIndex", Jt, "ySplit");
|
|
1906
|
+
const i = {
|
|
1907
|
+
colIndex: s.colIndex + o.colIndex,
|
|
1908
|
+
rowIndex: s.rowIndex + o.rowIndex
|
|
1909
|
+
};
|
|
1910
|
+
e.coords = V.cellToString(i);
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
}), h.registerVisitor({
|
|
1914
|
+
from: "tabColor",
|
|
1915
|
+
to: null,
|
|
1916
|
+
openTag: (s) => {
|
|
1917
|
+
const o = e((t) => s.getAttribute(t));
|
|
1918
|
+
o && (t.tabColor = o);
|
|
1919
|
+
}
|
|
1920
|
+
}), h.registerVisitor({
|
|
1921
|
+
from: "pageSetUpPr",
|
|
1922
|
+
to: "pageSetUpPr",
|
|
1923
|
+
openTag: (t) => {}
|
|
1924
|
+
}), h.registerVisitor({
|
|
1925
|
+
from: "outlinePr",
|
|
1926
|
+
to: "outlinePr",
|
|
1927
|
+
openTag: (t) => {}
|
|
1928
|
+
}), h.registerVisitor({
|
|
1929
|
+
from: "pageMargins",
|
|
1930
|
+
to: "pageMargins",
|
|
1931
|
+
openTag: (t) => {
|
|
1932
|
+
t.copyTo("bottom", Qt), t.copyTo("footer", Qt), t.copyTo("header", Qt), t.copyTo("left", Qt), t.copyTo("right", Qt), t.copyTo("top", Qt), t.copyTo("bottom", Qt);
|
|
1933
|
+
}
|
|
1934
|
+
}), h.registerVisitor({
|
|
1935
|
+
from: "pageSetup",
|
|
1936
|
+
to: "pageSetup",
|
|
1937
|
+
openTag: (t) => {
|
|
1938
|
+
t.copyTo("blackAndWhite", Zt), t.copyTo("cellComments"), t.copyTo("copies", Jt), t.copyTo("draft", Zt), t.copyTo("errors"), t.copyTo("firstPageNumber", Jt), t.copyTo("fitToHeight", Jt), t.copyTo("fitToWidth", Jt), t.copyTo("horizontalDpi", Jt), t.copyTo("orientation"), t.copyTo("pageOrder"), t.copyTo("paperSize", Jt), t.copyTo("scale", Jt), t.copyTo("useFirstPageNumber", Zt), t.copyTo("usePrinterDefaults", Zt), t.copyTo("verticalDpi", Jt);
|
|
1939
|
+
}
|
|
1940
|
+
}), h.registerVisitor({
|
|
1941
|
+
from: "printOptions",
|
|
1942
|
+
to: "printOptions",
|
|
1943
|
+
openTag: (t) => {
|
|
1944
|
+
t.copyTo("gridLines", Zt), t.copyTo("gridLinesSet", Zt), t.copyTo("headings", Zt), t.copyTo("horizontalCentered", Zt), t.copyTo("verticalCentered", Zt);
|
|
1945
|
+
}
|
|
1946
|
+
}), h.registerVisitor({
|
|
1947
|
+
from: "headerFoot",
|
|
1948
|
+
to: "headerFoot",
|
|
1949
|
+
openTag: (t) => {}
|
|
1950
|
+
}), h.registerVisitor({
|
|
1951
|
+
from: "mergeCells",
|
|
1952
|
+
to: "merges",
|
|
1953
|
+
openTag: (t) => {
|
|
1954
|
+
t.setSource([]);
|
|
1955
|
+
}
|
|
1956
|
+
}), h.registerVisitor({
|
|
1957
|
+
from: "dataValidations",
|
|
1958
|
+
to: "validations",
|
|
1959
|
+
openTag: (t) => {
|
|
1960
|
+
t.setSource([]);
|
|
1961
|
+
}
|
|
1962
|
+
});
|
|
1963
|
+
const v = {
|
|
1964
|
+
from: "dataValidation",
|
|
1965
|
+
to: [],
|
|
1966
|
+
openTag: (t) => {
|
|
1967
|
+
let e = t.getAttribute("sqref");
|
|
1968
|
+
e && (e = e.trim().split(/\s+/).join(","));
|
|
1969
|
+
const s = {}, o = {
|
|
1970
|
+
r: e,
|
|
1971
|
+
v: s,
|
|
1972
|
+
rule: {
|
|
1973
|
+
type: t.getAttribute("type") ?? void 0,
|
|
1974
|
+
operator: t.getAttribute("operator") ?? void 0
|
|
1975
|
+
}
|
|
1976
|
+
};
|
|
1977
|
+
!0 === t.getAttribute("showDropDown", Zt) && (s.hideDropdown = !0), t.copyToObject(s, "alert", Kt, "error"), t.copyToObject(s, "alertTitle", Kt, "errorTitle"), t.copyToObject(s, "showAlertMessage", Zt, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", Zt, "showInputMessage"), t.setSource(o);
|
|
1978
|
+
},
|
|
1979
|
+
closeTag: (t) => {
|
|
1980
|
+
const e = t.getSource();
|
|
1981
|
+
if (!e?.rule) return;
|
|
1982
|
+
const s = b(e.rule, a);
|
|
1983
|
+
s && (t.getAttribute("allowBlank", Zt) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
|
|
1984
|
+
}
|
|
1985
|
+
};
|
|
1986
|
+
h.registerVisitor(v), h.registerVisitor({
|
|
1987
|
+
from: "formula1",
|
|
1988
|
+
to: {},
|
|
1989
|
+
text: (t, e) => {
|
|
1990
|
+
const s = e.getParent().rule;
|
|
1991
|
+
s?.type && (s.formula1 = k(t, s.type));
|
|
1992
|
+
}
|
|
1993
|
+
}), h.registerVisitor({
|
|
1994
|
+
from: "formula2",
|
|
1995
|
+
to: {},
|
|
1996
|
+
text: (t, e) => {
|
|
1997
|
+
const s = e.getParent().rule;
|
|
1998
|
+
s?.type && (s.formula2 = k(t, s.type));
|
|
1999
|
+
}
|
|
2000
|
+
}), h.registerVisitor({
|
|
2001
|
+
from: "picture",
|
|
2002
|
+
to: "picture",
|
|
2003
|
+
openTag: (t) => {
|
|
2004
|
+
const e = t.getAttribute("r:id");
|
|
2005
|
+
if (!e) return void console.warn("no rId found for picture", t.getPath());
|
|
2006
|
+
const o = s(e, !0);
|
|
2007
|
+
t.getSource().resId = o;
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
const O = {
|
|
2011
|
+
from: "slicer",
|
|
2012
|
+
to: {},
|
|
2013
|
+
openTag: (t) => {
|
|
2014
|
+
const e = t.getAttribute("r:id");
|
|
2015
|
+
if (!e) return void console.warn("no rId found for picture", t.getPath());
|
|
2016
|
+
const o = s(e)?.slicers, i = t.getParent();
|
|
2017
|
+
i.slicers || (i.slicers = {});
|
|
2018
|
+
const r = Object.keys(o);
|
|
2019
|
+
for (const t of r) i.slicers[t] = o[t];
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
h.registerVisitor(O);
|
|
2023
|
+
const I = (t, e) => ({
|
|
2024
|
+
from: t,
|
|
2025
|
+
to: {},
|
|
2026
|
+
openTag: (t) => {
|
|
2027
|
+
t.setSource("");
|
|
2028
|
+
},
|
|
2029
|
+
text: (t, e) => {
|
|
2030
|
+
e.setSource((e.getSource() ?? "") + t);
|
|
2031
|
+
},
|
|
2032
|
+
closeTag: (t) => {
|
|
2033
|
+
e(String(t.getSource() ?? ""), t);
|
|
2034
|
+
}
|
|
2035
|
+
}), D = /* @__PURE__ */ new Map();
|
|
2036
|
+
D.set("dataValidations", {
|
|
2037
|
+
from: "dataValidations",
|
|
2038
|
+
to: "validations",
|
|
2039
|
+
openTag: (t) => {
|
|
2040
|
+
const e = t.getParent();
|
|
2041
|
+
t.setSource(e.validations ?? []);
|
|
2042
|
+
},
|
|
2043
|
+
closeTag: (t) => {
|
|
2044
|
+
0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
|
|
2045
|
+
}
|
|
2046
|
+
}), D.set("dataValidation", {
|
|
2047
|
+
...v,
|
|
2048
|
+
closeTag: (t) => {
|
|
2049
|
+
v.closeTag(t);
|
|
2050
|
+
const e = t.getSource();
|
|
2051
|
+
e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
|
|
2052
|
+
}
|
|
2053
|
+
});
|
|
2054
|
+
const L = (t) => ({
|
|
2055
|
+
from: t,
|
|
2056
|
+
to: {},
|
|
2057
|
+
openTag: (e) => {
|
|
2058
|
+
e.setSource({
|
|
2059
|
+
rule: e.getParent()?.rule,
|
|
2060
|
+
key: t
|
|
2061
|
+
});
|
|
2062
|
+
}
|
|
2063
|
+
});
|
|
2064
|
+
D.set("formula1", L("formula1")), D.set("formula2", L("formula2")), D.set("f", I("f", (t, e) => {
|
|
2065
|
+
const s = e.getParent(), o = s?.rule;
|
|
2066
|
+
o && (o[s.key] = k(t, o.type));
|
|
2067
|
+
})), D.set("sqref", I("sqref", (t, e) => {
|
|
2068
|
+
const s = e.getParent(), o = t.trim();
|
|
2069
|
+
s && o && (s.r = o.split(/\s+/).join(","));
|
|
2070
|
+
}));
|
|
2071
|
+
const $ = /* @__PURE__ */ new Map(), j = [], B = /* @__PURE__ */ new Map();
|
|
2072
|
+
B.set("conditionalFormattings", {
|
|
2073
|
+
from: "conditionalFormattings",
|
|
2074
|
+
transparent: !0
|
|
2075
|
+
}), B.set("conditionalFormatting", {
|
|
2076
|
+
from: "conditionalFormatting",
|
|
2077
|
+
to: {},
|
|
2078
|
+
openTag: (t) => {
|
|
2079
|
+
t.setSource({ rules: [] });
|
|
2080
|
+
},
|
|
2081
|
+
closeTag: (t) => {
|
|
2082
|
+
const e = t.getSource(), s = e?.rules ?? [];
|
|
2083
|
+
for (let t = 0; t < s.length; t++) {
|
|
2084
|
+
const o = s[t];
|
|
2085
|
+
o.sqref = e.sqref, o.id ? $.set(o.id, o) : j.push(o);
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
}), B.set("cfRule", {
|
|
2089
|
+
from: "cfRule",
|
|
2090
|
+
to: {},
|
|
2091
|
+
openTag: (t) => {
|
|
2092
|
+
t.copyTo("id", Kt), t.copyTo("type", Kt), t.copyTo("priority", Jt);
|
|
2093
|
+
},
|
|
2094
|
+
closeTag: (t) => {
|
|
2095
|
+
const e = t.getSource();
|
|
2096
|
+
e && t.getParent()?.rules?.push(e);
|
|
2097
|
+
}
|
|
2098
|
+
}), B.set("sqref", I("sqref", (t, e) => {
|
|
2099
|
+
const s = e.getParent(), o = t.trim();
|
|
2100
|
+
s && o && (s.sqref = o);
|
|
2101
|
+
})), B.set("dataBar", {
|
|
2102
|
+
from: "dataBar",
|
|
2103
|
+
to: {},
|
|
2104
|
+
openTag: (t) => {
|
|
2105
|
+
t.copyTo("minLength", Jt), t.copyTo("maxLength", Jt), t.copyTo("gradient", Zt), t.copyTo("border", Zt), t.copyTo("direction", Kt), t.copyTo("axisPosition", Kt), t.copyTo("negativeBarColorSameAsPositive", Zt), t.copyTo("negativeBarBorderColorSameAsPositive", Zt);
|
|
2106
|
+
},
|
|
2107
|
+
closeTag: (t) => {
|
|
2108
|
+
t.getParent().dataBar = t.getSource();
|
|
2109
|
+
}
|
|
2110
|
+
}), B.set("iconSet", {
|
|
2111
|
+
from: "iconSet",
|
|
2112
|
+
to: {},
|
|
2113
|
+
openTag: (t) => {
|
|
2114
|
+
t.copyTo("iconSet", Kt), t.copyTo("custom", Zt), t.copyTo("reverse", Zt), t.copyTo("showValue", Zt);
|
|
2115
|
+
},
|
|
2116
|
+
closeTag: (t) => {
|
|
2117
|
+
t.getParent().iconSet = t.getSource();
|
|
2118
|
+
}
|
|
2119
|
+
}), B.set("cfvo", {
|
|
2120
|
+
from: "cfvo",
|
|
2121
|
+
to: {},
|
|
2122
|
+
openTag: (t) => {
|
|
2123
|
+
const e = t.getParent();
|
|
2124
|
+
e.conditions || (e.conditions = []);
|
|
2125
|
+
const s = t.getSource();
|
|
2126
|
+
e.conditions.push(s), t.copyTo("type", Kt), !1 === t.getAttribute("gte", Zt) && (s.exclusive = !0);
|
|
2127
|
+
}
|
|
2128
|
+
}), B.set("f", I("f", (t, e) => {
|
|
2129
|
+
const s = e.getParent();
|
|
2130
|
+
if (!s) return;
|
|
2131
|
+
const o = t.trim(), i = Number(o);
|
|
2132
|
+
s.value = o.length > 0 && Number.isFinite(i) ? i : t;
|
|
2133
|
+
}));
|
|
2134
|
+
const M = (t) => ({
|
|
2135
|
+
from: t,
|
|
2136
|
+
to: {},
|
|
2137
|
+
openTag: (s) => {
|
|
2138
|
+
const o = e((t) => s.getAttribute(t));
|
|
2139
|
+
o && (s.getParent()[t] = o);
|
|
2140
|
+
}
|
|
2141
|
+
});
|
|
2142
|
+
B.set("borderColor", M("borderColor")), B.set("negativeFillColor", M("negativeFillColor")), B.set("negativeBorderColor", M("negativeBorderColor")), B.set("axisColor", M("axisColor")), B.set("cfIcon", {
|
|
2143
|
+
from: "cfIcon",
|
|
2144
|
+
to: {},
|
|
2145
|
+
openTag: (t) => {
|
|
2146
|
+
const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", Jt);
|
|
2147
|
+
if (null === e || null === s) return;
|
|
2148
|
+
const o = t.getParent();
|
|
2149
|
+
o.icons || (o.icons = []), o.icons.push({
|
|
2150
|
+
set: e,
|
|
2151
|
+
id: s
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
});
|
|
2155
|
+
const H = /* @__PURE__ */ new Map();
|
|
2156
|
+
H.set("id", I("id", (t, e) => {
|
|
2157
|
+
const s = e.getParent(), o = t.trim();
|
|
2158
|
+
s && o && (s.x14Id = o);
|
|
2159
|
+
}));
|
|
2160
|
+
const _ = /* @__PURE__ */ new Map();
|
|
2161
|
+
_.set("slicerList", {
|
|
2162
|
+
from: "slicerList",
|
|
2163
|
+
transparent: !0
|
|
2164
|
+
}), _.set("slicer", O);
|
|
2165
|
+
const X = /* @__PURE__ */ new Map([
|
|
2166
|
+
[y(x), D],
|
|
2167
|
+
[y(S), B],
|
|
2168
|
+
[y(P), B],
|
|
2169
|
+
[y(A), H],
|
|
2170
|
+
[y(f), _],
|
|
2171
|
+
[y(C), _]
|
|
2172
|
+
]), F = /* @__PURE__ */ new Set();
|
|
2173
|
+
h.registerVisitor({
|
|
2174
|
+
from: "extLst",
|
|
2175
|
+
transparent: !0
|
|
2176
|
+
}), h.registerVisitor({
|
|
2177
|
+
from: "ext",
|
|
2178
|
+
transparent: !0,
|
|
2179
|
+
scope: (t) => {
|
|
2180
|
+
const e = t.getAttribute("uri"), s = y(e), o = X.get(s);
|
|
2181
|
+
if (o) return o;
|
|
2182
|
+
if (!w.has(s) && !F.has(s)) {
|
|
2183
|
+
F.add(s);
|
|
2184
|
+
const o = E[s];
|
|
2185
|
+
t.warn(o ? `Extension content '${o}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
|
|
2186
|
+
}
|
|
2187
|
+
return null;
|
|
2188
|
+
}
|
|
2189
|
+
}), h.registerVisitor({
|
|
2190
|
+
from: "mergeCell",
|
|
2191
|
+
to: [],
|
|
2192
|
+
openTag: (t) => {
|
|
2193
|
+
const e = t.getAttribute("ref");
|
|
2194
|
+
t.setSource(e);
|
|
2195
|
+
}
|
|
2196
|
+
}), h.registerVisitor({
|
|
2197
|
+
from: "hyperlinks",
|
|
2198
|
+
to: "hyperlinks",
|
|
2199
|
+
openTag: (t) => {
|
|
2200
|
+
t.setSource([]);
|
|
2201
|
+
}
|
|
2202
|
+
}), h.registerVisitor({
|
|
2203
|
+
from: "hyperlink",
|
|
2204
|
+
to: [],
|
|
2205
|
+
openTag: (t) => {
|
|
2206
|
+
const e = t.getAttribute("r:id"), o = t.getAttribute("ref");
|
|
2207
|
+
if (!o) return void console.warn("No ref found for hyperlink");
|
|
2208
|
+
t.setKey(o);
|
|
2209
|
+
let i = e ? s(e) : "";
|
|
2210
|
+
if ("string" != typeof i) return void console.warn("Invalid address ", i);
|
|
2211
|
+
i.endsWith("\\") && (i = i.substring(0, i.length - 1));
|
|
2212
|
+
const r = t.getAttribute("location");
|
|
2213
|
+
if (r && (i += "#" + r), !i) return void console.warn("No address found for hyperlink. r:id", e);
|
|
2214
|
+
let n;
|
|
2215
|
+
const a = t.getAttribute("tooltip");
|
|
2216
|
+
n = a ? {
|
|
2217
|
+
address: i,
|
|
2218
|
+
screenTip: a
|
|
2219
|
+
} : i, t.setSource({
|
|
2220
|
+
r: o,
|
|
2221
|
+
v: n
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
}), h.registerVisitor({
|
|
2225
|
+
from: "drawing",
|
|
2226
|
+
to: "movables",
|
|
2227
|
+
openTag: (t) => {
|
|
2228
|
+
const e = t.getAttribute("r:id");
|
|
2229
|
+
if (!e) return;
|
|
2230
|
+
const o = s(e);
|
|
2231
|
+
o ? t.setSource(o.movables) : console.warn("no drawing found for rId", e);
|
|
2232
|
+
}
|
|
2233
|
+
}), h.registerVisitor({
|
|
2234
|
+
from: "tableParts",
|
|
2235
|
+
to: "tables",
|
|
2236
|
+
openTag: (t) => {
|
|
2237
|
+
t.setSource([]);
|
|
2238
|
+
}
|
|
2239
|
+
}), h.registerVisitor({
|
|
2240
|
+
from: "tablePart",
|
|
2241
|
+
to: [],
|
|
2242
|
+
openTag: (t) => {
|
|
2243
|
+
const e = t.getAttribute("r:id");
|
|
2244
|
+
if (!e) return;
|
|
2245
|
+
const o = s(e);
|
|
2246
|
+
o ? t.setSource(o) : console.warn("no table found for rId", e);
|
|
2247
|
+
}
|
|
2248
|
+
});
|
|
2249
|
+
const q = (t, e) => {
|
|
2250
|
+
e.conditions?.length && (t.stops = d(e)), void 0 !== e.minLength && (t.minLength = e.minLength), void 0 !== e.maxLength && (t.maxLength = e.maxLength), (e.gradient ?? 1) && (t.gradient = !0), e.border && e.borderColor && (t.borderColor = e.borderColor), !e.negativeBarColorSameAsPositive && e.negativeFillColor && (t.negativeFillColor = e.negativeFillColor), !(e.negativeBarBorderColorSameAsPositive ?? 1) && e.negativeBorderColor && (t.negativeBorderColor = e.negativeBorderColor), e.axisColor && (t.axisColor = e.axisColor), "middle" !== e.axisPosition && "none" !== e.axisPosition || (t.axisPosition = e.axisPosition), "leftToRight" !== e.direction && "rightToLeft" !== e.direction || (t.direction = e.direction);
|
|
2251
|
+
}, W = (t, e) => {
|
|
2252
|
+
e.conditions?.length && (t.stops = d(e)), e.iconSet && e.iconSet !== t.iconSet && (t.iconSet = e.iconSet), e.icons?.length && (t.icon = e.icons), void 0 !== e.reverse && (t.reverse = e.reverse), void 0 !== e.showValue && (t.showValue = e.showValue);
|
|
2253
|
+
}, U = (t) => {
|
|
2254
|
+
if ("iconSet" !== t.type || !t.iconSet || !t.sqref) return null;
|
|
2255
|
+
const e = {
|
|
2256
|
+
type: R.ScaleType.IconSet,
|
|
2257
|
+
stops: []
|
|
2258
|
+
};
|
|
2259
|
+
return W(e, t.iconSet), {
|
|
2260
|
+
r: t.sqref.split(/\s+/).join(","),
|
|
2261
|
+
v: { scale: e },
|
|
2262
|
+
priority: t.priority
|
|
2263
|
+
};
|
|
2264
|
+
};
|
|
2265
|
+
h.registerVisitor({
|
|
2266
|
+
from: "worksheet",
|
|
2267
|
+
to: {},
|
|
2268
|
+
openTag: (t) => {},
|
|
2269
|
+
closeTag: (t) => {
|
|
2270
|
+
const e = t.getSource();
|
|
2271
|
+
let s = e?.conditionals;
|
|
2272
|
+
if (s) for (let t = 0; t < s.length; t++) {
|
|
2273
|
+
const e = s[t], o = e.x14Id;
|
|
2274
|
+
if (!o) continue;
|
|
2275
|
+
delete e.x14Id;
|
|
2276
|
+
const i = $.get(o);
|
|
2277
|
+
if (!i) continue;
|
|
2278
|
+
$.delete(o);
|
|
2279
|
+
const r = e.v?.scale;
|
|
2280
|
+
i.dataBar && r?.type === R.ScaleType.DataBar ? q(r, i.dataBar) : i.iconSet && r?.type === R.ScaleType.IconSet && W(r, i.iconSet);
|
|
2281
|
+
}
|
|
2282
|
+
const o = [...$.values(), ...j];
|
|
2283
|
+
for (let t = 0; t < o.length; t++) {
|
|
2284
|
+
const i = U(o[t]);
|
|
2285
|
+
i ? (s || (s = [], e.conditionals = s), s.push(i)) : a?.(`x14-only conditional formatting rule (type '${o[t].type ?? "unknown"}') is not read and will be lost on resave.`);
|
|
2286
|
+
}
|
|
2287
|
+
if (s) {
|
|
2288
|
+
s.length > 1 && s.sort((t, e) => (t.priority ?? Infinity) - (e.priority ?? Infinity));
|
|
2289
|
+
for (let t = 0; t < s.length; t++) delete s[t].priority;
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
}), h.registerVisitor({
|
|
2293
|
+
from: "customProperties",
|
|
2294
|
+
to: "customProperties",
|
|
2295
|
+
openTag: (t) => {
|
|
2296
|
+
t.setSource([]);
|
|
2297
|
+
},
|
|
2298
|
+
closeTag: (t) => {
|
|
2299
|
+
const e = t.getSource();
|
|
2300
|
+
e.length > 0 && (t.getParent().customProperties = e);
|
|
2301
|
+
}
|
|
2302
|
+
}), h.registerVisitor({
|
|
2303
|
+
from: "customPr",
|
|
2304
|
+
to: {},
|
|
2305
|
+
openTag: (t) => {
|
|
2306
|
+
const e = t.getParent();
|
|
2307
|
+
t.copyTo("name");
|
|
2308
|
+
const o = t.getAttribute("r:id");
|
|
2309
|
+
if (!o) return void console.warn("no rId found for customProperties", t.getPath());
|
|
2310
|
+
const i = s(o, !0), r = t.getSource();
|
|
2311
|
+
r.resId = i, e.push(r);
|
|
2312
|
+
}
|
|
2313
|
+
}), h.registerVisitor({
|
|
2314
|
+
from: "sheetProtection",
|
|
2315
|
+
to: "protection",
|
|
2316
|
+
openTag: (t) => {
|
|
2317
|
+
let e = !1;
|
|
2318
|
+
if (t.hasAttribute("sheet") && Zt(t.getAttribute("sheet")) && (e = !0), !e) return void t.setSource(void 0);
|
|
2319
|
+
const s = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null;
|
|
2320
|
+
t.copyTo("autoTable", s), t.copyTo("deleteColumns", s), t.copyTo("formatCells", s), t.copyTo("formatColumns", s), t.copyTo("formatRows", s), t.copyTo("insertColumns", s), t.copyTo("insertHyperlinks", s), t.copyTo("insertRows", s), t.copyTo("objects", s), t.copyTo("pivotTables", s), t.copyTo("scenarios", s), t.copyTo("selectLockedCells", s), t.copyTo("selectUnlockedCells", s), t.copyTo("sort", s);
|
|
2321
|
+
const o = {};
|
|
2322
|
+
t.copyToObject(o, "hash", Kt, "hashValue"), t.copyToObject(o, "algorithm", Kt, "algorithmName"), t.copyToObject(o, "salt", Kt, "saltValue"), t.copyToObject(o, "spinCount", Jt), Object.keys(o).length > 0 && (t.getSource().password = o);
|
|
2323
|
+
}
|
|
2324
|
+
}), h.registerVisitor({
|
|
2325
|
+
from: "protectedRanges",
|
|
2326
|
+
to: "protectedRanges",
|
|
2327
|
+
openTag: (t) => {
|
|
2328
|
+
t.setSource([]);
|
|
2329
|
+
}
|
|
2330
|
+
}), h.registerVisitor({
|
|
2331
|
+
from: "protectedRange",
|
|
2332
|
+
to: [],
|
|
2333
|
+
openTag: (t) => {
|
|
2334
|
+
let e = t.getAttribute("sqref");
|
|
2335
|
+
e && (e = e.trim().split(/\s+/).join(","));
|
|
2336
|
+
const s = {}, o = {
|
|
2337
|
+
r: e,
|
|
2338
|
+
v: s
|
|
2339
|
+
};
|
|
2340
|
+
t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
|
|
2341
|
+
const i = {};
|
|
2342
|
+
t.copyToObject(i, "hash", Kt, "hashValue"), t.copyToObject(i, "algorithm", Kt, "algorithmName"), t.copyToObject(i, "salt", Kt, "saltValue"), t.copyToObject(i, "spinCount", Jt), Object.keys(i).length > 0 && (s.password = i), t.setSource(o);
|
|
2343
|
+
},
|
|
2344
|
+
closeTag: (t) => {
|
|
2345
|
+
const e = t.getSource();
|
|
2346
|
+
e?.r && e.v.name || t.setSource(void 0);
|
|
2347
|
+
}
|
|
2348
|
+
}), h.registerVisitor({
|
|
2349
|
+
from: "sheetFormatPr",
|
|
2350
|
+
to: "sheetFormatPr",
|
|
2351
|
+
openTag: (e) => {
|
|
2352
|
+
e.copyToObject(t, "defaultColSize", Qt, "defaultColWidth"), e.copyToObject(t, "outlineLevelCol", Jt, "outlineLevelCol");
|
|
2353
|
+
const s = e.getAttribute("customHeight");
|
|
2354
|
+
"1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", Qt, "defaultRowHeight"), e.copyToObject(t, "outlineLevelRow", Jt, "outlineLevelRow");
|
|
2355
|
+
}
|
|
2356
|
+
}), h.registerVisitor({
|
|
2357
|
+
from: "cols",
|
|
2358
|
+
to: "cols",
|
|
2359
|
+
openTag: (t) => {
|
|
2360
|
+
t.setSource([]);
|
|
2361
|
+
}
|
|
2362
|
+
}), h.registerVisitor({
|
|
2363
|
+
from: "col",
|
|
2364
|
+
to: [],
|
|
2365
|
+
openTag: (t) => {
|
|
2366
|
+
const e = t.getSource(), s = t.getAttribute("min"), o = t.getAttribute("max"), i = void 0 === s ? 0 : parseInt(s) - 1, r = void 0 === o ? i : parseInt(o) - 1;
|
|
2367
|
+
e.r = V.runToString(i, r, !0);
|
|
2368
|
+
const n = {};
|
|
2369
|
+
e.v = n, t.copyToObject(n, "sz", Qt, "width"), t.copyToObject(n, "csz", Zt, "customWidth"), t.copyToObject(n, "h", Zt, "hidden"), t.copyToObject(n, "l", Jt, "outlineLevel"), t.copyToObject(n, "s", Jt, "style");
|
|
2370
|
+
}
|
|
2371
|
+
}), h.registerVisitor({
|
|
2372
|
+
from: "oleObjects",
|
|
2373
|
+
to: null,
|
|
2374
|
+
openTag: (t) => {
|
|
2375
|
+
t.warn("'OLE Objects' are not supported.");
|
|
2376
|
+
}
|
|
2377
|
+
});
|
|
2378
|
+
let G = !1, Z = !1, J = 0, Q = "";
|
|
2379
|
+
const K = (t) => {
|
|
2380
|
+
const e = t.indexOf(":");
|
|
2381
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
2382
|
+
};
|
|
2383
|
+
return pe(p, t, h.createEventHandler(t, n, a), a, c, {
|
|
2384
|
+
onOpenTag: (t) => {
|
|
2385
|
+
G = !0;
|
|
2386
|
+
const e = K(t.name);
|
|
2387
|
+
"t" === e || "v" === e ? 0 === J && (Z = !0) : "rPh" !== e && "phoneticPr" !== e || J++;
|
|
2388
|
+
},
|
|
2389
|
+
onText: (t) => {
|
|
2390
|
+
Z && (Q += t);
|
|
2391
|
+
},
|
|
2392
|
+
onCloseTag: (t) => {
|
|
2393
|
+
const e = K(t.name);
|
|
2394
|
+
"t" === e || "v" === e ? Z = !1 : "rPh" !== e && "phoneticPr" !== e || J > 0 && J--;
|
|
2395
|
+
},
|
|
2396
|
+
onEnd: () => {
|
|
2397
|
+
if (!G) return;
|
|
2398
|
+
const t = o(T(Q));
|
|
2399
|
+
return G = !1, Z = !1, J = 0, Q = "", t;
|
|
2400
|
+
},
|
|
2401
|
+
onError: (t) => {}
|
|
2402
|
+
}, l);
|
|
2403
|
+
})(t, (t, e = !1) => pt(t, u, e) ?? null, wt, v, () => {}, (t, e) => {
|
|
2404
|
+
const s = e ? `${e} (${u})` : u;
|
|
2405
|
+
W.push([t, s]);
|
|
2406
|
+
}, void 0, et), i = await lt.getTextStream(u, tt);
|
|
2407
|
+
if (i) try {
|
|
2408
|
+
await Xt.parseStream(i, o, { xmlns: !1 });
|
|
2409
|
+
} catch (t) {
|
|
2410
|
+
throw console.warn(`Error parsing sheet: '${u}'`, t), new Error(`Error parsing sheet: '${u}'`, { cause: t });
|
|
2411
|
+
}
|
|
2412
|
+
const n = ht(u, h);
|
|
2413
|
+
let a, c = /* @__PURE__ */ new Map();
|
|
2414
|
+
if (n) {
|
|
2415
|
+
const e = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
|
|
2416
|
+
let o;
|
|
2417
|
+
n.forEach((t, s) => {
|
|
2418
|
+
t.type === e && (a = pt(s, u, !1, h)?.comments, a && a.forEach((t) => {
|
|
2419
|
+
const e = t.v;
|
|
2420
|
+
c.set(e.id, t);
|
|
2421
|
+
}));
|
|
2422
|
+
});
|
|
2423
|
+
const i = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
2424
|
+
if (n.forEach((t, e) => {
|
|
2425
|
+
t.type === i && (o = pt(e, u, !1, h));
|
|
2426
|
+
}), o || a) {
|
|
2427
|
+
const e = a ?? [], i = o?.authors, r = o?.comments, n = r ? r.length : 0;
|
|
2428
|
+
if (r) for (let t = 0; t < n; t++) {
|
|
2429
|
+
const o = r[t];
|
|
2430
|
+
if (!o) continue;
|
|
2431
|
+
const n = o.v;
|
|
2432
|
+
let a = i && void 0 !== n.personId ? i[n.personId] : n.personId;
|
|
2433
|
+
if (a && a.startsWith("tc=") && (a = s(a.substring(3)), c.has(a))) continue;
|
|
2434
|
+
const l = ft({ displayName: a }), h = {
|
|
2435
|
+
id: I.uuidV4(),
|
|
2436
|
+
personId: l.id,
|
|
2437
|
+
done: !1,
|
|
2438
|
+
asNote: !0,
|
|
2439
|
+
content: n.content
|
|
2440
|
+
};
|
|
2441
|
+
e.push({
|
|
2442
|
+
r: o.r,
|
|
2443
|
+
v: h
|
|
2444
|
+
});
|
|
2445
|
+
}
|
|
2446
|
+
t.comments = e;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
};
|
|
2450
|
+
at.push(o());
|
|
2451
|
+
} else if (p.type === n) {
|
|
2452
|
+
const t = o(u, l, rt, it, Tt);
|
|
2453
|
+
if (t && 0 !== Object.keys(t).length) {
|
|
2454
|
+
const e = t, s = [];
|
|
2455
|
+
ht(u, h)?.forEach((t) => {
|
|
2456
|
+
"External" === t.targetMode && t.type && t.target && s.push({
|
|
2457
|
+
type: t.type,
|
|
2458
|
+
target: t.target
|
|
2459
|
+
});
|
|
2460
|
+
}), e.identity = s, O = e;
|
|
2461
|
+
} else O = null;
|
|
2462
|
+
} else O = c ? t(u, l, (t, e) => {
|
|
2463
|
+
const s = M.add({ source: { buffer: t } });
|
|
2464
|
+
return s.addReference(J), Y.add(s), Z.toResourceId(s);
|
|
2465
|
+
}, Tt) : o(u, l, rt, it, Tt);
|
|
2466
|
+
}
|
|
2467
|
+
return O;
|
|
2468
|
+
};
|
|
2469
|
+
a("coreprops", p, l, rt, it), a("extprops", p, l, rt, it);
|
|
2470
|
+
const ut = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map(), gt = a("people", p, l, rt, it);
|
|
2471
|
+
let mt = null;
|
|
2472
|
+
if (gt.size > 0 && (mt = gt.entries().next()?.value?.[1]?.persons, mt)) {
|
|
2473
|
+
const t = mt.length;
|
|
2474
|
+
for (let e = 0; e < t; e++) {
|
|
2475
|
+
const t = mt[e];
|
|
2476
|
+
ut.set(t.id, t), void 0 !== t.displayName && dt.set(t.displayName, t);
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
const ft = (t) => {
|
|
2480
|
+
if (!t) return;
|
|
2481
|
+
if (t.id && ut.has(t.id)) return ut.get(t.id);
|
|
2482
|
+
let e = t.displayName;
|
|
2483
|
+
if (!t.id) {
|
|
2484
|
+
if (e) {
|
|
2485
|
+
const t = dt.get(e);
|
|
2486
|
+
if (t) return t;
|
|
2487
|
+
}
|
|
2488
|
+
t.id = I.uuidV4();
|
|
2489
|
+
}
|
|
2490
|
+
const s = ut.get(t.id);
|
|
2491
|
+
if (s) return s;
|
|
2492
|
+
const o = t;
|
|
2493
|
+
return ut.set(t.id, o), e && dt.set(e, o), mt || (mt = []), mt.push(o), o;
|
|
2494
|
+
}, Tt = {
|
|
2495
|
+
paramMap: et,
|
|
2496
|
+
getRefs: ht,
|
|
2497
|
+
getRef: pt,
|
|
2498
|
+
parsedRefs: nt,
|
|
2499
|
+
addPerson: ft,
|
|
2500
|
+
serializeElement: ct
|
|
2501
|
+
}, yt = [];
|
|
2502
|
+
if (g) {
|
|
2503
|
+
const t = await lt.getTextStream(g, tt);
|
|
2504
|
+
if (t) {
|
|
2505
|
+
const e = ((t, e) => {
|
|
2506
|
+
let s = !1, o = !1, i = 0, r = "";
|
|
2507
|
+
return {
|
|
2508
|
+
onOpenTag: (t) => {
|
|
2509
|
+
const e = ue(t.name);
|
|
2510
|
+
"t" === e ? s && 0 === i && (o = !0) : "si" === e ? (s = !0, r = "", i = 0) : "rPh" !== e && "phoneticPr" !== e || i++;
|
|
2511
|
+
},
|
|
2512
|
+
onText: (t) => {
|
|
2513
|
+
o && (r += t);
|
|
2514
|
+
},
|
|
2515
|
+
onCloseTag: (e) => {
|
|
2516
|
+
const n = ue(e.name);
|
|
2517
|
+
"t" === n ? o = !1 : "si" === n ? (t(T(r)), s = !1, r = "") : "rPh" !== n && "phoneticPr" !== n || i > 0 && i--;
|
|
2518
|
+
},
|
|
2519
|
+
onError: (t) => {
|
|
2520
|
+
e?.(`Error parsing shared strings: ${t?.message ?? t}`);
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
})((t) => {
|
|
2524
|
+
yt.push(t);
|
|
2525
|
+
}, (t) => {
|
|
2526
|
+
W.push([t, g]);
|
|
2527
|
+
});
|
|
2528
|
+
try {
|
|
2529
|
+
await Xt.parseStream(t, e, { xmlns: !1 });
|
|
2530
|
+
} catch (t) {
|
|
2531
|
+
throw console.warn(`Error parsing shared strings: '${g}'`, t), new Error(`Error parsing shared strings: '${g}'`, { cause: t });
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
q?.mark("shared-strings");
|
|
2536
|
+
let bt = yt.length;
|
|
2537
|
+
const xt = /* @__PURE__ */ new Map();
|
|
2538
|
+
let vt = bt;
|
|
2539
|
+
const wt = (t) => {
|
|
2540
|
+
const e = xt.get(t);
|
|
2541
|
+
if (void 0 !== e) return e;
|
|
2542
|
+
const s = vt;
|
|
2543
|
+
return xt.set(t, vt++), yt.push(t), s;
|
|
2544
|
+
}, St = [];
|
|
2545
|
+
p.slicersCache = St;
|
|
2546
|
+
const Ct = lt.getNames(), kt = Ct.length;
|
|
2547
|
+
for (let t = 0; t < kt; t++) {
|
|
2548
|
+
const e = Ct[t];
|
|
2549
|
+
e && e.startsWith("xl/slicerCache") && St.push(`/${e}`);
|
|
2550
|
+
}
|
|
2551
|
+
const Pt = a("slicersCache", p, l, rt, it, Tt), At = /* @__PURE__ */ new Map();
|
|
2552
|
+
Pt.forEach((t) => {
|
|
2553
|
+
const e = t.name;
|
|
2554
|
+
delete t.name, At.set(e, t);
|
|
2555
|
+
}), et.set("slicerCaches", At), a("richstructure", p, l, rt, it, Tt), a("richdata", p, l, rt, it, Tt);
|
|
2556
|
+
const Et = a("themes", p, l, rt, it, Tt);
|
|
2557
|
+
let Ot = null;
|
|
2558
|
+
if (Et && Et.entries) {
|
|
2559
|
+
let t = Et.entries().next();
|
|
2560
|
+
t?.value?.[1] && (Ot = t.value[1]);
|
|
2561
|
+
}
|
|
2562
|
+
const It = new _(Ot);
|
|
2563
|
+
let Dt = a("styles", p, l, rt, it, Tt).entries().next()?.value?.[1];
|
|
2564
|
+
Dt && (Dt = JSON.parse(O.JSONStableStringify(Dt)));
|
|
2565
|
+
const Vt = a("workbooks", p, l, rt, it, Tt);
|
|
2566
|
+
q?.mark("side-parts-json"), await Promise.all(at), G && K > 0 && (G(Q, Q), await new Promise((t) => setTimeout(t, 0))), q?.mark("sheets");
|
|
2567
|
+
const Lt = {
|
|
2568
|
+
...Vt.entries().next().value?.[1],
|
|
2569
|
+
styles: Dt,
|
|
2570
|
+
theme: It.toJSON()
|
|
2571
|
+
};
|
|
2572
|
+
if (yt.length > 0 && (Lt.strings = yt), mt && mt.length > 0 && (Lt.people = mt), L) {
|
|
2573
|
+
const t = lt.getEntry("xl/vbaProject.bin");
|
|
2574
|
+
if (t) try {
|
|
2575
|
+
const { VBAProject: e } = await import("./B3Hb3GSFs_FIoXoI.mjs"), s = e.extract(t);
|
|
2576
|
+
s ? (L?.(s), Lt.vba = s) : W.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
2577
|
+
} catch (t) {
|
|
2578
|
+
W.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
let $t = null;
|
|
2582
|
+
const jt = {
|
|
2583
|
+
...j,
|
|
2584
|
+
resources: M,
|
|
2585
|
+
json: Lt,
|
|
2586
|
+
formulaTransform: d(() => $t?.getCalculation())
|
|
2587
|
+
};
|
|
2588
|
+
void 0 === jt.disableLoadAutoFit && (jt.disableLoadAutoFit = !1), q?.mark("json-assembled");
|
|
2589
|
+
const Nt = new X(jt);
|
|
2590
|
+
if ($t = Nt, q?.mark("workbook-constructed"), st.length > 0) {
|
|
2591
|
+
await Nt.whenCalculationReady();
|
|
2592
|
+
const t = /* @__PURE__ */ new Map(), e = Lt.sheets ?? [], s = Nt.getSheets().getItems();
|
|
2593
|
+
for (let o = 0; o < e.length; o++) {
|
|
2594
|
+
const i = e[o]?.sheet, r = s[o];
|
|
2595
|
+
i && r && t.set(i, r);
|
|
2596
|
+
}
|
|
2597
|
+
((t, e, s) => {
|
|
2598
|
+
if (0 === e.length) return;
|
|
2599
|
+
const o = t.getCalculation().getFunctions(), i = /* @__PURE__ */ new Map(), r = (t) => {
|
|
2600
|
+
let e = i.get(t);
|
|
2601
|
+
return void 0 === e && (e = null !== o.getByName(t), i.set(t, e)), e;
|
|
2602
|
+
}, n = /* @__PURE__ */ new Map();
|
|
2603
|
+
for (const t of e) {
|
|
2604
|
+
let e = n.get(t.sheet);
|
|
2605
|
+
e || (e = [], n.set(t.sheet, e)), e.push(t);
|
|
2606
|
+
}
|
|
2607
|
+
for (const [t, e] of n) {
|
|
2608
|
+
const o = s.get(t);
|
|
2609
|
+
if (!o) continue;
|
|
2610
|
+
const i = (t, e) => `${t},${e}`, n = /* @__PURE__ */ new Set();
|
|
2611
|
+
for (const t of e) null === t.formula && n.add(i(t.rowIndex, t.colIndex));
|
|
2612
|
+
for (const t of e) {
|
|
2613
|
+
if (null === t.formula) continue;
|
|
2614
|
+
const e = ne(t.formula);
|
|
2615
|
+
let s = !0;
|
|
2616
|
+
for (const t of e) if (!r(t)) {
|
|
2617
|
+
s = !1;
|
|
2618
|
+
break;
|
|
2619
|
+
}
|
|
2620
|
+
if (!s) continue;
|
|
2621
|
+
const a = [], c = [[t.rowIndex, t.colIndex]], l = /* @__PURE__ */ new Set([i(t.rowIndex, t.colIndex)]);
|
|
2622
|
+
for (; c.length > 0;) {
|
|
2623
|
+
const [t, e] = c.pop(), s = [
|
|
2624
|
+
[t + 1, e],
|
|
2625
|
+
[t - 1, e],
|
|
2626
|
+
[t, e + 1],
|
|
2627
|
+
[t, e - 1]
|
|
2628
|
+
];
|
|
2629
|
+
for (const [t, e] of s) {
|
|
2630
|
+
const s = i(t, e);
|
|
2631
|
+
!l.has(s) && n.has(s) && (l.add(s), a.push([t, e]), c.push([t, e]));
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
for (const [t, e] of a) n.delete(i(t, e)), o.getRange({
|
|
2635
|
+
rowStart: t,
|
|
2636
|
+
colStart: e,
|
|
2637
|
+
rowEnd: t,
|
|
2638
|
+
colEnd: e
|
|
2639
|
+
}).clear();
|
|
2640
|
+
o.getRange({
|
|
2641
|
+
rowStart: t.rowIndex,
|
|
2642
|
+
colStart: t.colIndex,
|
|
2643
|
+
rowEnd: t.rowIndex,
|
|
2644
|
+
colEnd: t.colIndex
|
|
2645
|
+
}).setValue("=" + t.formula);
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
})(Nt, st, t);
|
|
2649
|
+
}
|
|
2650
|
+
if (Y.forEach((t) => {
|
|
2651
|
+
t.deleteReference(J);
|
|
2652
|
+
}), Z.endPersist(), F) {
|
|
2653
|
+
c(F);
|
|
2654
|
+
const t = /* @__PURE__ */ new Map();
|
|
2655
|
+
let e = 0;
|
|
2656
|
+
for (const s of lt.getNames()) {
|
|
2657
|
+
const o = lt.getEntry(s);
|
|
2658
|
+
if (!o) continue;
|
|
2659
|
+
const i = lt.getRawEntry(s), r = i ? {
|
|
2660
|
+
data: o,
|
|
2661
|
+
uncompressedSize: lt.uncompressedSize(s),
|
|
2662
|
+
raw: {
|
|
2663
|
+
compressedData: i.data,
|
|
2664
|
+
compressionMethod: i.compressionMethod,
|
|
2665
|
+
signature: i.signature
|
|
2666
|
+
}
|
|
2667
|
+
} : {
|
|
2668
|
+
data: o,
|
|
2669
|
+
uncompressedSize: lt.uncompressedSize(s)
|
|
2670
|
+
};
|
|
2671
|
+
t.set(s, r), e += o.byteLength;
|
|
2672
|
+
}
|
|
2673
|
+
if (e > 67108864) W.push([`Source package too large to retain (${e} bytes, limit ${h}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
2674
|
+
else if (t.size > 0) {
|
|
2675
|
+
const e = new u(t);
|
|
2676
|
+
v(F, e);
|
|
2677
|
+
let s = Nt.getSheets().getItems();
|
|
2678
|
+
const o = Nt.getTransactions().addListener({ onCommitEnd: (t) => {
|
|
2679
|
+
const s = t.getOperation()?.name;
|
|
2680
|
+
"insertCells" !== s && "deleteCells" !== s || e.markStructuralChange();
|
|
2681
|
+
} }), i = Nt.addListeners({ onSheetsChange: () => {
|
|
2682
|
+
const t = Nt.getSheets().getItems();
|
|
2683
|
+
(t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
|
|
2684
|
+
} });
|
|
2685
|
+
Nt.addListeners({ onClose: () => {
|
|
2686
|
+
o(), i(), c(F);
|
|
2687
|
+
} });
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
if (W.length && U?.onWarning) for (const t of W) {
|
|
2691
|
+
const [e, s] = t;
|
|
2692
|
+
U.onWarning(e, s);
|
|
2693
|
+
}
|
|
2694
|
+
return q && !0 === $ && console.table(q.toTable()), Nt;
|
|
2695
|
+
} catch (t) {
|
|
2696
|
+
let e = "Unable to parse XLSX.";
|
|
2697
|
+
throw t instanceof M && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
|
|
2698
|
+
} finally {
|
|
2699
|
+
await lt.close().catch(() => {});
|
|
2700
|
+
}
|
|
2701
|
+
};
|
|
2702
|
+
export { fe as readXLSX };
|