@rowsncolumns/toolkit 24.4.2 → 24.4.4
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/dist/cjs/excel-parser/cfb-decryptor.d.ts +6 -0
- package/dist/cjs/excel-parser/cfb-decryptor.d.ts.map +1 -1
- package/dist/cjs/excel-parser/cfb-decryptor.js +6 -0
- package/dist/cjs/excel-parser/helpers.d.ts +9 -1
- package/dist/cjs/excel-parser/helpers.d.ts.map +1 -1
- package/dist/cjs/excel-parser/helpers.js +37 -0
- package/dist/cjs/excel-parser/interface.d.ts +15 -2
- package/dist/cjs/excel-parser/interface.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/base/index.d.ts +2 -0
- package/dist/cjs/excel-parser/plugins/base/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/base/index.js +3 -0
- package/dist/cjs/excel-parser/plugins/ods/index.d.ts +19 -0
- package/dist/cjs/excel-parser/plugins/ods/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/ods/index.js +676 -304
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts +43 -1
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/ods/styles.js +343 -45
- package/dist/cjs/excel-parser/plugins/xls/index.d.ts +55 -1
- package/dist/cjs/excel-parser/plugins/xls/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xls/index.js +518 -6
- package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts +4 -0
- package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsb/index.js +33 -14
- package/dist/cjs/excel-parser/plugins/xlsx/chartex.d.ts +37 -0
- package/dist/cjs/excel-parser/plugins/xlsx/chartex.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/chartex.js +244 -0
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts +10 -0
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/charts.js +68 -9
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts +28 -1
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.js +155 -20
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.d.ts +70 -0
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.js +295 -0
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts +35 -2
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/index.js +737 -257
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.js +125 -37
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts +3 -0
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.js +4 -1
- package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts +15 -1
- package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/styles.js +102 -6
- package/dist/cjs/excel-parser/registry.d.ts +7 -0
- package/dist/cjs/excel-parser/registry.d.ts.map +1 -1
- package/dist/cjs/excel-parser/registry.js +29 -0
- package/dist/cjs/excel-parser/types.d.ts +17 -2
- package/dist/cjs/excel-parser/types.d.ts.map +1 -1
- package/dist/cjs/excel-parser/workbook.d.ts +3 -0
- package/dist/cjs/excel-parser/workbook.d.ts.map +1 -1
- package/dist/cjs/excel-parser/workbook.js +24 -14
- package/dist/cjs/excel-parser/worker.js +131 -131
- package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -1
- package/dist/cjs/exporter/ods/ods-export.js +432 -175
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/chart-builder.js +215 -39
- package/dist/cjs/exporter/xlsx/chartex-builder.d.ts +36 -0
- package/dist/cjs/exporter/xlsx/chartex-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/chartex-builder.js +109 -0
- package/dist/cjs/exporter/xlsx/form-controls-builder.d.ts +61 -0
- package/dist/cjs/exporter/xlsx/form-controls-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/form-controls-builder.js +197 -0
- package/dist/cjs/exporter/xlsx/pivot-builder.d.ts +8 -0
- package/dist/cjs/exporter/xlsx/pivot-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/pivot-builder.js +141 -42
- package/dist/cjs/exporter/xlsx/style-builder.js +9 -3
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts +7 -1
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.js +15 -3
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts +11 -2
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/xlsx-export.js +991 -297
- package/dist/cjs/helpers/implicit-intersection.d.ts +16 -0
- package/dist/cjs/helpers/implicit-intersection.d.ts.map +1 -0
- package/dist/cjs/helpers/implicit-intersection.js +197 -0
- package/dist/cjs/print-settings.d.ts +105 -0
- package/dist/cjs/print-settings.d.ts.map +1 -0
- package/dist/cjs/print-settings.js +494 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/excel-parser/cfb-decryptor.d.ts +6 -0
- package/dist/esm/excel-parser/cfb-decryptor.d.ts.map +1 -1
- package/dist/esm/excel-parser/cfb-decryptor.js +6 -0
- package/dist/esm/excel-parser/helpers.d.ts +9 -1
- package/dist/esm/excel-parser/helpers.d.ts.map +1 -1
- package/dist/esm/excel-parser/helpers.js +34 -0
- package/dist/esm/excel-parser/interface.d.ts +15 -2
- package/dist/esm/excel-parser/interface.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/base/index.d.ts +2 -0
- package/dist/esm/excel-parser/plugins/base/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/base/index.js +3 -0
- package/dist/esm/excel-parser/plugins/ods/index.d.ts +19 -0
- package/dist/esm/excel-parser/plugins/ods/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/ods/index.js +347 -33
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts +43 -1
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/ods/styles.js +276 -2
- package/dist/esm/excel-parser/plugins/xls/index.d.ts +55 -1
- package/dist/esm/excel-parser/plugins/xls/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xls/index.js +441 -3
- package/dist/esm/excel-parser/plugins/xlsb/index.d.ts +4 -0
- package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsb/index.js +30 -9
- package/dist/esm/excel-parser/plugins/xlsx/chartex.d.ts +37 -0
- package/dist/esm/excel-parser/plugins/xlsx/chartex.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/chartex.js +199 -0
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts +10 -0
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/charts.js +69 -6
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts +28 -1
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/drawing.js +99 -0
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.d.ts +70 -0
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.js +246 -0
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts +35 -2
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/index.js +454 -32
- package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/pivots.js +86 -6
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts +3 -0
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.js +2 -0
- package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts +15 -1
- package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/styles.js +92 -2
- package/dist/esm/excel-parser/registry.d.ts +7 -0
- package/dist/esm/excel-parser/registry.d.ts.map +1 -1
- package/dist/esm/excel-parser/registry.js +19 -0
- package/dist/esm/excel-parser/types.d.ts +17 -2
- package/dist/esm/excel-parser/types.d.ts.map +1 -1
- package/dist/esm/excel-parser/workbook.d.ts +3 -0
- package/dist/esm/excel-parser/workbook.d.ts.map +1 -1
- package/dist/esm/excel-parser/workbook.js +19 -10
- package/dist/esm/excel-parser/worker.js +12 -18
- package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -1
- package/dist/esm/exporter/ods/ods-export.js +306 -35
- package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/chart-builder.js +161 -28
- package/dist/esm/exporter/xlsx/chartex-builder.d.ts +36 -0
- package/dist/esm/exporter/xlsx/chartex-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/chartex-builder.js +97 -0
- package/dist/esm/exporter/xlsx/form-controls-builder.d.ts +61 -0
- package/dist/esm/exporter/xlsx/form-controls-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/form-controls-builder.js +173 -0
- package/dist/esm/exporter/xlsx/pivot-builder.d.ts +8 -0
- package/dist/esm/exporter/xlsx/pivot-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/pivot-builder.js +104 -19
- package/dist/esm/exporter/xlsx/style-builder.js +9 -3
- package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts +7 -1
- package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/threaded-comments-builder.js +15 -3
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts +11 -2
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/xlsx-export.js +675 -64
- package/dist/esm/helpers/implicit-intersection.d.ts +16 -0
- package/dist/esm/helpers/implicit-intersection.d.ts.map +1 -0
- package/dist/esm/helpers/implicit-intersection.js +184 -0
- package/dist/esm/print-settings.d.ts +105 -0
- package/dist/esm/print-settings.d.ts.map +1 -0
- package/dist/esm/print-settings.js +422 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/xlsx.d.ts +14 -0
|
@@ -1,13 +1,32 @@
|
|
|
1
|
-
import type { CellFormat, Color, TextFormat } from "@rowsncolumns/spreadsheet";
|
|
1
|
+
import type { CellFormat, Color, PageMargins, PageSetup, PrintOptions, TextFormat } from "@rowsncolumns/spreadsheet";
|
|
2
2
|
type OdsRowStyle = {
|
|
3
3
|
height?: number;
|
|
4
4
|
hidden?: boolean;
|
|
5
5
|
format?: CellFormat;
|
|
6
|
+
/** `fo:break-before="page"` — a manual page break above this row. */
|
|
7
|
+
breakBefore?: boolean;
|
|
6
8
|
};
|
|
7
9
|
type OdsColumnStyle = {
|
|
8
10
|
width?: number;
|
|
9
11
|
hidden?: boolean;
|
|
10
12
|
format?: CellFormat;
|
|
13
|
+
/** `fo:break-before="page"` — a manual page break left of this column. */
|
|
14
|
+
breakBefore?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* `<style:page-layout>` mapped onto the sheet print facets. Margins are
|
|
18
|
+
* inches; `fo:page-width/height` resolve to the nearest ECMA paper-size code.
|
|
19
|
+
*/
|
|
20
|
+
export type OdsPageLayout = {
|
|
21
|
+
pageSetup?: PageSetup;
|
|
22
|
+
pageMargins?: PageMargins;
|
|
23
|
+
printOptions?: PrintOptions;
|
|
24
|
+
};
|
|
25
|
+
/** `<style:master-page>`: its page layout plus header/footer as Excel codes. */
|
|
26
|
+
export type OdsMasterPage = {
|
|
27
|
+
pageLayoutName?: string;
|
|
28
|
+
header?: string;
|
|
29
|
+
footer?: string;
|
|
11
30
|
};
|
|
12
31
|
export declare class OdsStyles {
|
|
13
32
|
private cellStyles;
|
|
@@ -22,9 +41,28 @@ export declare class OdsStyles {
|
|
|
22
41
|
private automaticTableStyles;
|
|
23
42
|
private numberFormats;
|
|
24
43
|
private chartStyles;
|
|
44
|
+
/** Table style name → `style:master-page-name`. */
|
|
45
|
+
private tableMasterPages;
|
|
46
|
+
private pageLayouts;
|
|
47
|
+
private masterPages;
|
|
48
|
+
/** `style:family="table"` styles whose `style:table-properties` carry a right-to-left `style:writing-mode`. */
|
|
49
|
+
private rightToLeftTableStyles;
|
|
50
|
+
/** Chart styles whose `style:chart-properties` carry `chart:three-dimensional="true"`. */
|
|
51
|
+
private threeDimensionalChartStyles;
|
|
25
52
|
constructor();
|
|
26
53
|
reset(): void;
|
|
27
54
|
parseStylesXml(stylesXml: any): void;
|
|
55
|
+
/**
|
|
56
|
+
* `<office:master-styles><style:master-page>` from the ORDER-PRESERVING
|
|
57
|
+
* parse of styles.xml — header/footer paragraphs are mixed content
|
|
58
|
+
* (`Page <text:page-number/> of <text:page-count/>`), which the unordered
|
|
59
|
+
* tree cannot represent.
|
|
60
|
+
*/
|
|
61
|
+
parseMasterPagesOrdered(stylesOrdered: any): void;
|
|
62
|
+
private processPageLayouts;
|
|
63
|
+
getTableMasterPageName(styleName: string): string | undefined;
|
|
64
|
+
getMasterPage(name: string): OdsMasterPage | undefined;
|
|
65
|
+
getPageLayout(name: string): OdsPageLayout | undefined;
|
|
28
66
|
parseContentXml(contentXml: any): void;
|
|
29
67
|
private processStyles;
|
|
30
68
|
private processNumberStyles;
|
|
@@ -33,6 +71,10 @@ export declare class OdsStyles {
|
|
|
33
71
|
getRowStyle(styleName: string): OdsRowStyle | undefined;
|
|
34
72
|
getColumnStyle(styleName: string): OdsColumnStyle | undefined;
|
|
35
73
|
getChartStyleColor(styleName?: string): Color | undefined;
|
|
74
|
+
/** Whether a chart style (plot-area) declares `chart:three-dimensional="true"`. */
|
|
75
|
+
isChartStyleThreeDimensional(styleName?: string): boolean;
|
|
76
|
+
/** Whether a `style:family="table"` style renders the sheet right-to-left. */
|
|
77
|
+
isTableStyleRightToLeft(styleName?: string): boolean;
|
|
36
78
|
getTableCellFormat(styleName: string): CellFormat | undefined;
|
|
37
79
|
getTextFormat(styleName?: string): TextFormat | undefined;
|
|
38
80
|
private convertToCellFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/ods/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,UAAU,EACV,KAAK,EAGL,UAAU,EACX,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/ods/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,UAAU,EACV,KAAK,EAGL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACX,MAAM,2BAA2B,CAAC;AAenC,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,qEAAqE;IACrE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,K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C,aAAa;IAQrB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,WAAW;IAuBnB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,qBAAqB;CAgB9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { get } from "lodash-es";
|
|
2
|
+
import { headerFooterZoneFromTokens, joinHeaderFooterZones, odsLengthToInches, paperSizeFromCm, parseOdsPrintTokens, parseOdsTableCentering, } from "../../../print-settings";
|
|
2
3
|
export class OdsStyles {
|
|
3
4
|
cellStyles = new Map();
|
|
4
5
|
automaticCellStyles = new Map();
|
|
@@ -12,6 +13,14 @@ export class OdsStyles {
|
|
|
12
13
|
automaticTableStyles = new Map();
|
|
13
14
|
numberFormats = new Map();
|
|
14
15
|
chartStyles = new Map();
|
|
16
|
+
/** Table style name → `style:master-page-name`. */
|
|
17
|
+
tableMasterPages = new Map();
|
|
18
|
+
pageLayouts = new Map();
|
|
19
|
+
masterPages = new Map();
|
|
20
|
+
/** `style:family="table"` styles whose `style:table-properties` carry a right-to-left `style:writing-mode`. */
|
|
21
|
+
rightToLeftTableStyles = new Set();
|
|
22
|
+
/** Chart styles whose `style:chart-properties` carry `chart:three-dimensional="true"`. */
|
|
23
|
+
threeDimensionalChartStyles = new Set();
|
|
15
24
|
constructor() { }
|
|
16
25
|
reset() {
|
|
17
26
|
this.cellStyles.clear();
|
|
@@ -26,6 +35,11 @@ export class OdsStyles {
|
|
|
26
35
|
this.automaticTableStyles.clear();
|
|
27
36
|
this.numberFormats.clear();
|
|
28
37
|
this.chartStyles.clear();
|
|
38
|
+
this.tableMasterPages.clear();
|
|
39
|
+
this.pageLayouts.clear();
|
|
40
|
+
this.masterPages.clear();
|
|
41
|
+
this.rightToLeftTableStyles.clear();
|
|
42
|
+
this.threeDimensionalChartStyles.clear();
|
|
29
43
|
}
|
|
30
44
|
parseStylesXml(stylesXml) {
|
|
31
45
|
if (!stylesXml)
|
|
@@ -42,6 +56,138 @@ export class OdsStyles {
|
|
|
42
56
|
this.processStyles(automaticStyles, false);
|
|
43
57
|
this.processNumberStyles(documentStyles, get(documentStyles, "office:styles") || get(documentStyles, "styles"), get(documentStyles, "office:automatic-styles") ||
|
|
44
58
|
get(documentStyles, "automatic-styles"));
|
|
59
|
+
this.processPageLayouts(get(documentStyles, "office:automatic-styles.style:page-layout") ||
|
|
60
|
+
get(documentStyles, "automatic-styles.page-layout"));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `<office:master-styles><style:master-page>` from the ORDER-PRESERVING
|
|
64
|
+
* parse of styles.xml — header/footer paragraphs are mixed content
|
|
65
|
+
* (`Page <text:page-number/> of <text:page-count/>`), which the unordered
|
|
66
|
+
* tree cannot represent.
|
|
67
|
+
*/
|
|
68
|
+
parseMasterPagesOrdered(stylesOrdered) {
|
|
69
|
+
const documentStyles = orderedChildren(stylesOrdered, "office:document-styles") ||
|
|
70
|
+
orderedChildren(stylesOrdered, "document-styles");
|
|
71
|
+
const masterStyles = orderedChildren(documentStyles, "office:master-styles") ||
|
|
72
|
+
orderedChildren(documentStyles, "master-styles");
|
|
73
|
+
if (!Array.isArray(masterStyles))
|
|
74
|
+
return;
|
|
75
|
+
for (const node of masterStyles) {
|
|
76
|
+
const children = node["style:master-page"] || node["master-page"];
|
|
77
|
+
if (!children)
|
|
78
|
+
continue;
|
|
79
|
+
const attrs = node[":@"] || {};
|
|
80
|
+
const name = attrs["@_style:name"] || attrs["@_name"];
|
|
81
|
+
if (!name)
|
|
82
|
+
continue;
|
|
83
|
+
const header = odsHeaderFooterToCode(orderedChildren(children, "style:header") ||
|
|
84
|
+
orderedChildren(children, "header"));
|
|
85
|
+
const footer = odsHeaderFooterToCode(orderedChildren(children, "style:footer") ||
|
|
86
|
+
orderedChildren(children, "footer"));
|
|
87
|
+
this.masterPages.set(name, {
|
|
88
|
+
pageLayoutName: attrs["@_style:page-layout-name"] || attrs["@_page-layout-name"],
|
|
89
|
+
header,
|
|
90
|
+
footer,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
processPageLayouts(layouts) {
|
|
95
|
+
if (!layouts)
|
|
96
|
+
return;
|
|
97
|
+
for (const layout of Array.isArray(layouts) ? layouts : [layouts]) {
|
|
98
|
+
const name = layout["@_style:name"] || layout["@_name"];
|
|
99
|
+
if (!name)
|
|
100
|
+
continue;
|
|
101
|
+
const props = this.getAttributes(layout["style:page-layout-properties"] ||
|
|
102
|
+
layout["page-layout-properties"]) || {};
|
|
103
|
+
const headerProps = this.getAttributes(get(layout, "style:header-style.style:header-footer-properties") ||
|
|
104
|
+
get(layout, "header-style.header-footer-properties"));
|
|
105
|
+
const footerProps = this.getAttributes(get(layout, "style:footer-style.style:header-footer-properties") ||
|
|
106
|
+
get(layout, "footer-style.header-footer-properties"));
|
|
107
|
+
const pageSetup = {};
|
|
108
|
+
const orientation = props["@_style:print-orientation"];
|
|
109
|
+
if (orientation === "landscape" || orientation === "portrait") {
|
|
110
|
+
pageSetup.orientation = orientation;
|
|
111
|
+
}
|
|
112
|
+
const widthIn = odsLengthToInches(props["@_fo:page-width"]);
|
|
113
|
+
const heightIn = odsLengthToInches(props["@_fo:page-height"]);
|
|
114
|
+
if (widthIn !== undefined && heightIn !== undefined) {
|
|
115
|
+
const code = paperSizeFromCm(widthIn * 2.54, heightIn * 2.54);
|
|
116
|
+
if (code !== undefined)
|
|
117
|
+
pageSetup.paperSize = code;
|
|
118
|
+
}
|
|
119
|
+
const scale = parseFloat(String(props["@_style:scale-to"] ?? ""));
|
|
120
|
+
if (Number.isFinite(scale) && scale > 0) {
|
|
121
|
+
pageSetup.scale = Math.round(scale);
|
|
122
|
+
}
|
|
123
|
+
const scaleToX = parseInt(props["@_loext:scale-to-X"] ?? "", 10);
|
|
124
|
+
const scaleToY = parseInt(props["@_loext:scale-to-Y"] ?? "", 10);
|
|
125
|
+
const scaleToPages = parseInt(props["@_style:scale-to-pages"] ?? "", 10);
|
|
126
|
+
if (Number.isFinite(scaleToX) || Number.isFinite(scaleToY)) {
|
|
127
|
+
pageSetup.fitToPage = true;
|
|
128
|
+
pageSetup.fitToWidth = Number.isFinite(scaleToX) ? scaleToX : 0;
|
|
129
|
+
pageSetup.fitToHeight = Number.isFinite(scaleToY) ? scaleToY : 0;
|
|
130
|
+
}
|
|
131
|
+
else if (Number.isFinite(scaleToPages)) {
|
|
132
|
+
// ODF's single "total pages" knob: 1 page ≡ Excel's 1×1 fit.
|
|
133
|
+
pageSetup.fitToPage = true;
|
|
134
|
+
pageSetup.fitToWidth = scaleToPages;
|
|
135
|
+
pageSetup.fitToHeight = scaleToPages === 1 ? 1 : 0;
|
|
136
|
+
}
|
|
137
|
+
const pageOrder = props["@_style:print-page-order"];
|
|
138
|
+
if (pageOrder === "ltr")
|
|
139
|
+
pageSetup.pageOrder = "overThenDown";
|
|
140
|
+
const firstPage = parseInt(props["@_style:first-page-number"] ?? "", 10);
|
|
141
|
+
if (Number.isFinite(firstPage) && firstPage > 0) {
|
|
142
|
+
pageSetup.firstPageNumber = firstPage;
|
|
143
|
+
pageSetup.useFirstPageNumber = true;
|
|
144
|
+
}
|
|
145
|
+
// ODF: header sits inside `fo:margin-top`; Excel: `header` is the edge
|
|
146
|
+
// → header distance and `top` the edge → body distance.
|
|
147
|
+
const marginTop = odsLengthToInches(props["@_fo:margin-top"]);
|
|
148
|
+
const marginBottom = odsLengthToInches(props["@_fo:margin-bottom"]);
|
|
149
|
+
const headerHeight = (odsLengthToInches(headerProps?.["@_fo:min-height"]) ?? 0) +
|
|
150
|
+
(odsLengthToInches(headerProps?.["@_fo:margin-bottom"]) ?? 0);
|
|
151
|
+
const footerHeight = (odsLengthToInches(footerProps?.["@_fo:min-height"]) ?? 0) +
|
|
152
|
+
(odsLengthToInches(footerProps?.["@_fo:margin-top"]) ?? 0);
|
|
153
|
+
const pageMargins = {};
|
|
154
|
+
const left = odsLengthToInches(props["@_fo:margin-left"]);
|
|
155
|
+
const right = odsLengthToInches(props["@_fo:margin-right"]);
|
|
156
|
+
if (left !== undefined)
|
|
157
|
+
pageMargins.left = roundInches(left);
|
|
158
|
+
if (right !== undefined)
|
|
159
|
+
pageMargins.right = roundInches(right);
|
|
160
|
+
if (marginTop !== undefined) {
|
|
161
|
+
pageMargins.header = roundInches(marginTop);
|
|
162
|
+
pageMargins.top = roundInches(marginTop + headerHeight);
|
|
163
|
+
}
|
|
164
|
+
if (marginBottom !== undefined) {
|
|
165
|
+
pageMargins.footer = roundInches(marginBottom);
|
|
166
|
+
pageMargins.bottom = roundInches(marginBottom + footerHeight);
|
|
167
|
+
}
|
|
168
|
+
const printOptions = {
|
|
169
|
+
...parseOdsPrintTokens(props["@_style:print"]),
|
|
170
|
+
...parseOdsTableCentering(props["@_style:table-centering"]),
|
|
171
|
+
};
|
|
172
|
+
const layoutEntry = {};
|
|
173
|
+
if (Object.keys(pageSetup).length)
|
|
174
|
+
layoutEntry.pageSetup = pageSetup;
|
|
175
|
+
if (Object.keys(pageMargins).length)
|
|
176
|
+
layoutEntry.pageMargins = pageMargins;
|
|
177
|
+
if (Object.keys(printOptions).length) {
|
|
178
|
+
layoutEntry.printOptions = printOptions;
|
|
179
|
+
}
|
|
180
|
+
this.pageLayouts.set(name, layoutEntry);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
getTableMasterPageName(styleName) {
|
|
184
|
+
return this.tableMasterPages.get(styleName);
|
|
185
|
+
}
|
|
186
|
+
getMasterPage(name) {
|
|
187
|
+
return this.masterPages.get(name);
|
|
188
|
+
}
|
|
189
|
+
getPageLayout(name) {
|
|
190
|
+
return this.pageLayouts.get(name);
|
|
45
191
|
}
|
|
46
192
|
parseContentXml(contentXml) {
|
|
47
193
|
if (!contentXml)
|
|
@@ -76,6 +222,19 @@ export class OdsStyles {
|
|
|
76
222
|
continue;
|
|
77
223
|
}
|
|
78
224
|
if (family === "table") {
|
|
225
|
+
const masterPageName = style["@_style:master-page-name"] || style["@_master-page-name"];
|
|
226
|
+
if (masterPageName) {
|
|
227
|
+
this.tableMasterPages.set(name, masterPageName);
|
|
228
|
+
}
|
|
229
|
+
// ODF has no per-sheet flag for right-to-left display; it is the
|
|
230
|
+
// table style's `style:writing-mode` (`rl-tb` / `rl`), the
|
|
231
|
+
// counterpart of OOXML `<sheetView rightToLeft="1">`.
|
|
232
|
+
const tableProps = this.getAttributes(style["style:table-properties"] || style["table-properties"]);
|
|
233
|
+
const writingMode = tableProps?.["@_style:writing-mode"] ?? tableProps?.["@_writing-mode"];
|
|
234
|
+
if (typeof writingMode === "string" &&
|
|
235
|
+
/^(rl|rl-tb|tb-rl)$/.test(writingMode)) {
|
|
236
|
+
this.rightToLeftTableStyles.add(name);
|
|
237
|
+
}
|
|
79
238
|
const format = this.normalizeCellFormat(this.convertToCellFormat(style));
|
|
80
239
|
if (format) {
|
|
81
240
|
(isAutomatic ? this.automaticTableStyles : this.tableStyles).set(name, format);
|
|
@@ -104,6 +263,12 @@ export class OdsStyles {
|
|
|
104
263
|
}
|
|
105
264
|
if (typeof family === "string" &&
|
|
106
265
|
(family.startsWith("chart") || family === "graphic")) {
|
|
266
|
+
const chartProps = this.getAttributes(style["style:chart-properties"] || style["chart:chart-properties"]);
|
|
267
|
+
const threeDimensional = chartProps?.["@_chart:three-dimensional"] ??
|
|
268
|
+
chartProps?.["@_three-dimensional"];
|
|
269
|
+
if (threeDimensional === "true" || threeDimensional === true) {
|
|
270
|
+
this.threeDimensionalChartStyles.add(name);
|
|
271
|
+
}
|
|
107
272
|
const color = this.convertChartStyle(style);
|
|
108
273
|
if (color) {
|
|
109
274
|
const displayName = style["@_style:display-name"] || style["@_display-name"];
|
|
@@ -174,6 +339,14 @@ export class OdsStyles {
|
|
|
174
339
|
return undefined;
|
|
175
340
|
return this.chartStyles.get(styleName);
|
|
176
341
|
}
|
|
342
|
+
/** Whether a chart style (plot-area) declares `chart:three-dimensional="true"`. */
|
|
343
|
+
isChartStyleThreeDimensional(styleName) {
|
|
344
|
+
return !!styleName && this.threeDimensionalChartStyles.has(styleName);
|
|
345
|
+
}
|
|
346
|
+
/** Whether a `style:family="table"` style renders the sheet right-to-left. */
|
|
347
|
+
isTableStyleRightToLeft(styleName) {
|
|
348
|
+
return !!styleName && this.rightToLeftTableStyles.has(styleName);
|
|
349
|
+
}
|
|
177
350
|
getTableCellFormat(styleName) {
|
|
178
351
|
return (this.automaticTableStyles.get(styleName) ||
|
|
179
352
|
this.tableStyles.get(styleName));
|
|
@@ -411,14 +584,16 @@ export class OdsStyles {
|
|
|
411
584
|
const hidden = visibility === "collapse" ||
|
|
412
585
|
visibility === "hidden" ||
|
|
413
586
|
visibility === "none";
|
|
587
|
+
const breakBefore = rowProps?.["@_fo:break-before"] === "page";
|
|
414
588
|
const format = this.normalizeCellFormat(this.convertToCellFormat(style));
|
|
415
|
-
if (height === undefined && !hidden && !format) {
|
|
589
|
+
if (height === undefined && !hidden && !format && !breakBefore) {
|
|
416
590
|
return undefined;
|
|
417
591
|
}
|
|
418
592
|
return {
|
|
419
593
|
height,
|
|
420
594
|
hidden,
|
|
421
595
|
format,
|
|
596
|
+
...(breakBefore ? { breakBefore } : {}),
|
|
422
597
|
};
|
|
423
598
|
}
|
|
424
599
|
convertColumnStyle(style) {
|
|
@@ -439,14 +614,16 @@ export class OdsStyles {
|
|
|
439
614
|
const hidden = visibility === "collapse" ||
|
|
440
615
|
visibility === "hidden" ||
|
|
441
616
|
visibility === "none";
|
|
617
|
+
const breakBefore = columnProps?.["@_fo:break-before"] === "page";
|
|
442
618
|
const format = this.normalizeCellFormat(this.convertToCellFormat(style));
|
|
443
|
-
if (width === undefined && !hidden && !format) {
|
|
619
|
+
if (width === undefined && !hidden && !format && !breakBefore) {
|
|
444
620
|
return undefined;
|
|
445
621
|
}
|
|
446
622
|
return {
|
|
447
623
|
width,
|
|
448
624
|
hidden,
|
|
449
625
|
format,
|
|
626
|
+
...(breakBefore ? { breakBefore } : {}),
|
|
450
627
|
};
|
|
451
628
|
}
|
|
452
629
|
convertChartStyle(style) {
|
|
@@ -730,3 +907,100 @@ export class OdsStyles {
|
|
|
730
907
|
return undefined;
|
|
731
908
|
}
|
|
732
909
|
}
|
|
910
|
+
const roundInches = (value) => Math.round(value * 1000) / 1000;
|
|
911
|
+
/** Children of the first `tagName` node in an order-preserving node list. */
|
|
912
|
+
const orderedChildren = (nodes, tagName) => {
|
|
913
|
+
if (!Array.isArray(nodes))
|
|
914
|
+
return undefined;
|
|
915
|
+
const found = nodes.find((node) => node && node[tagName]);
|
|
916
|
+
return found ? found[tagName] : undefined;
|
|
917
|
+
};
|
|
918
|
+
const ODS_FIELD_TAGS = {
|
|
919
|
+
"text:page-number": "page",
|
|
920
|
+
"text:page-count": "pages",
|
|
921
|
+
"text:date": "date",
|
|
922
|
+
"text:time": "time",
|
|
923
|
+
"text:sheet-name": "sheet",
|
|
924
|
+
"text:title": "sheet",
|
|
925
|
+
"text:file-name": "file",
|
|
926
|
+
};
|
|
927
|
+
/** One `<text:p>` (order-preserving children) → header/footer tokens. */
|
|
928
|
+
const odsParagraphToTokens = (children) => {
|
|
929
|
+
const tokens = [];
|
|
930
|
+
for (const child of children ?? []) {
|
|
931
|
+
if (!child || typeof child !== "object")
|
|
932
|
+
continue;
|
|
933
|
+
if (child["#text"] !== undefined) {
|
|
934
|
+
tokens.push({ type: "text", text: String(child["#text"]) });
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
const tag = Object.keys(child).find((key) => key !== ":@");
|
|
938
|
+
if (!tag)
|
|
939
|
+
continue;
|
|
940
|
+
const attrs = child[":@"] || {};
|
|
941
|
+
if (tag === "text:s") {
|
|
942
|
+
const count = parseInt(attrs["@_text:c"] ?? "1", 10);
|
|
943
|
+
tokens.push({ type: "text", text: " ".repeat(Number.isFinite(count) ? count : 1) });
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
if (tag === "text:tab") {
|
|
947
|
+
tokens.push({ type: "text", text: "\t" });
|
|
948
|
+
continue;
|
|
949
|
+
}
|
|
950
|
+
if (tag === "text:line-break") {
|
|
951
|
+
tokens.push({ type: "text", text: "\n" });
|
|
952
|
+
continue;
|
|
953
|
+
}
|
|
954
|
+
const field = ODS_FIELD_TAGS[tag];
|
|
955
|
+
if (field) {
|
|
956
|
+
// `<text:file-name text:display>`: `path` is the folder (`&Z`), `full`
|
|
957
|
+
// the folder + name (`&Z&F`); `name` / `name-and-extension` / absent
|
|
958
|
+
// is the file name (`&F`).
|
|
959
|
+
const display = field === "file" ? attrs["@_text:display"] : undefined;
|
|
960
|
+
if (display === "path" || display === "full") {
|
|
961
|
+
tokens.push({ type: "field", field: "path" });
|
|
962
|
+
}
|
|
963
|
+
if (display !== "path") {
|
|
964
|
+
tokens.push({ type: "field", field });
|
|
965
|
+
}
|
|
966
|
+
continue;
|
|
967
|
+
}
|
|
968
|
+
// `text:span`, `text:a`, … — descend.
|
|
969
|
+
tokens.push(...odsParagraphToTokens(child[tag]));
|
|
970
|
+
}
|
|
971
|
+
return tokens;
|
|
972
|
+
};
|
|
973
|
+
const odsRegionToCode = (children) => {
|
|
974
|
+
if (!Array.isArray(children))
|
|
975
|
+
return undefined;
|
|
976
|
+
const paragraphs = children
|
|
977
|
+
.filter((node) => node && (node["text:p"] || node["p"]))
|
|
978
|
+
.map((node) => headerFooterZoneFromTokens(odsParagraphToTokens(node["text:p"] || node["p"])));
|
|
979
|
+
const code = paragraphs.join("\n");
|
|
980
|
+
return code ? code : undefined;
|
|
981
|
+
};
|
|
982
|
+
/**
|
|
983
|
+
* `<style:header>` / `<style:footer>` (order-preserving children) → Excel
|
|
984
|
+
* header/footer code. Regions map to `&L` / `&C` / `&R`; paragraphs outside
|
|
985
|
+
* regions are the centre zone. `style:display="false"` yields nothing.
|
|
986
|
+
*/
|
|
987
|
+
const odsHeaderFooterToCode = (children) => {
|
|
988
|
+
if (!Array.isArray(children))
|
|
989
|
+
return undefined;
|
|
990
|
+
const zones = {};
|
|
991
|
+
const left = odsRegionToCode(orderedChildren(children, "style:region-left") ||
|
|
992
|
+
orderedChildren(children, "region-left"));
|
|
993
|
+
const center = odsRegionToCode(orderedChildren(children, "style:region-center") ||
|
|
994
|
+
orderedChildren(children, "region-center"));
|
|
995
|
+
const right = odsRegionToCode(orderedChildren(children, "style:region-right") ||
|
|
996
|
+
orderedChildren(children, "region-right"));
|
|
997
|
+
const plain = odsRegionToCode(children);
|
|
998
|
+
if (left)
|
|
999
|
+
zones.left = left;
|
|
1000
|
+
if (center || plain)
|
|
1001
|
+
zones.center = center ?? plain;
|
|
1002
|
+
if (right)
|
|
1003
|
+
zones.right = right;
|
|
1004
|
+
const code = joinHeaderFooterZones(zones);
|
|
1005
|
+
return code ? code : undefined;
|
|
1006
|
+
};
|
|
@@ -1,5 +1,59 @@
|
|
|
1
|
+
import type { NamedRange, Sheet, TableView } from "@rowsncolumns/spreadsheet";
|
|
2
|
+
import { type DefinedName } from "xlsx/xlsx.mjs";
|
|
3
|
+
import type { ProcessSheetDataResult } from "../../types";
|
|
1
4
|
import { BaseWorkbookPlugin } from "../base/index";
|
|
5
|
+
export declare const ZIP_SIGNATURE: number[];
|
|
6
|
+
export declare const CFB_SIGNATURE: number[];
|
|
7
|
+
export declare const readHeader: (source: ArrayBuffer | File, length: number) => Promise<Uint8Array>;
|
|
8
|
+
export declare const startsWith: (header: Uint8Array, signature: number[]) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* BIFF `NAME` records (SheetJS `Workbook.Names`) → `NamedRange`s. Builtin
|
|
11
|
+
* names (`_xlnm.Print_Area`, `_xlnm._FilterDatabase`, …) are print / filter
|
|
12
|
+
* metadata, not user names, and are skipped. A reference that parses as a
|
|
13
|
+
* range becomes `range` (pinned to the sheet the ref names, else the name's
|
|
14
|
+
* own sheet scope, else the first sheet); anything else is kept as a
|
|
15
|
+
* formula `value`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const mapDefinedNames: (names: ReadonlyArray<DefinedName | undefined>, sheets: ReadonlyArray<{
|
|
18
|
+
sheetId: number;
|
|
19
|
+
title: string;
|
|
20
|
+
}>) => NamedRange[];
|
|
21
|
+
/**
|
|
22
|
+
* Legacy `.xls` (BIFF8, Excel 97-2003) reader.
|
|
23
|
+
*
|
|
24
|
+
* The BIFF record stream is decoded by SheetJS (`xlsx`, already a toolkit
|
|
25
|
+
* dependency for the CFB container reader used by the password decryptor),
|
|
26
|
+
* and the decoded workbook is mapped onto the same plugin contract the
|
|
27
|
+
* xlsx / xlsb readers implement: sheet names + visibility, cell values with
|
|
28
|
+
* their number formats, formulas with their cached results, merges, column
|
|
29
|
+
* widths / row heights, hyperlinks, cell notes, defined names and the 1904
|
|
30
|
+
* date-system flag. Cell fonts / fills / borders are not decoded (BIFF XF
|
|
31
|
+
* styling is outside SheetJS's open-source decoder), so a `.xls` opens with
|
|
32
|
+
* its data and number formatting; export goes through XLSX like XLSB.
|
|
33
|
+
*
|
|
34
|
+
* `load` also keeps the previous routing guards: an OOXML package saved with a
|
|
35
|
+
* `.xls` name is rejected here so `WorkBook` hands it to the xlsx parser, an
|
|
36
|
+
* encrypted container still asks for a password, and an HTML / text export
|
|
37
|
+
* saved as `.xls` fails with an actionable message.
|
|
38
|
+
*/
|
|
2
39
|
export declare class XlsPlugin extends BaseWorkbookPlugin {
|
|
3
|
-
|
|
40
|
+
private sheets;
|
|
41
|
+
private namedRanges;
|
|
42
|
+
private cellXfs;
|
|
43
|
+
private formatIds;
|
|
44
|
+
private use1904;
|
|
45
|
+
load(buffer: ArrayBuffer | File, _password?: string): Promise<void>;
|
|
46
|
+
dispose(): void;
|
|
47
|
+
getSheetCount(): number;
|
|
48
|
+
getSheets(minRowCount?: number, minColumnCount?: number): Promise<[Sheet[], TableView[]]>;
|
|
49
|
+
getCellXfs(): Map<string | number, any>;
|
|
50
|
+
registerFormat(format: any): string;
|
|
51
|
+
getNamedRanges(): NamedRange[];
|
|
52
|
+
/** `WBProps.date1904` — Mac-origin workbooks shift every date serial. */
|
|
53
|
+
getUse1904Epoch(): boolean;
|
|
54
|
+
/** Formulas carry their BIFF cached results, so no load-time recalc. */
|
|
55
|
+
requiresRecalc(): boolean;
|
|
56
|
+
private toCellData;
|
|
57
|
+
processSheetData(chunkSize?: number, enableCellXfsRegistry?: boolean, _enableSharedStrings?: boolean): AsyncGenerator<ProcessSheetDataResult, void, unknown>;
|
|
4
58
|
}
|
|
5
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xls/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xls/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,UAAU,EACV,KAAK,EACL,SAAS,EACV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,KAAK,WAAW,EAGjB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,aAAa,UAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,UAAmD,CAAC;AAE9E,eAAO,MAAM,UAAU,GACrB,QAAQ,WAAW,GAAG,IAAI,EAC1B,QAAQ,MAAM,KACb,OAAO,CAAC,UAAU,CAMpB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,UAAU,EAAE,WAAW,MAAM,EAAE,YAER,CAAC;AAqC3D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,aAAa,CAAC,WAAW,GAAG,SAAS,CAAC,EAC7C,QAAQ,aAAa,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,KACxD,UAAU,EA+BT,CAAC;AAeL;;;;;;;;;;;;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