@agile-team/mach-report 2.24.0 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/{ExcelBindingWizard-BV12hGiK.cjs → ExcelBindingWizard-BgJG-T6k.cjs} +1 -1
- package/dist/{ExcelBindingWizard-Cy_lPjWV.js → ExcelBindingWizard-NQ_v396s.js} +3 -3
- package/dist/{ParamEditor-DenKjvKu.cjs → ParamEditor-DEP38mBp.cjs} +1 -1
- package/dist/{ParamEditor-PyOqHzzw.js → ParamEditor-Z-3yodp5.js} +2 -2
- package/dist/{ReportBatchPanel-pQ6d0yqJ.cjs → ReportBatchPanel-D33LjMrA.cjs} +1 -1
- package/dist/{ReportBatchPanel-8EFtMrKk.js → ReportBatchPanel-DG8FV-5X.js} +2 -2
- package/dist/{ReportLabelStudio-HUeo2TsU.js → ReportLabelStudio-BZp23_hA.js} +3 -3
- package/dist/{ReportLabelStudio-B_KF3Zc_.cjs → ReportLabelStudio-Bz-xAayk.cjs} +1 -1
- package/dist/{ReportParamPanel-8xR85nz-.cjs → ReportParamPanel-B27IGJjk.cjs} +1 -1
- package/dist/{ReportParamPanel-DA-YpkvC.js → ReportParamPanel-DGXzBzl2.js} +1 -1
- package/dist/{ReportPreview-_wTJnsG1.js → ReportPreview-CilFAS9U.js} +2392 -2342
- package/dist/ReportPreview-dOOzPts2.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DH8jl9IF.js → ReportTemplateLibrary-DpSGgvFa.js} +1 -1
- package/dist/{ReportTemplateLibrary-CjArKxRG.cjs → ReportTemplateLibrary-uG1gENaW.cjs} +1 -1
- package/dist/{RuleEditor-GDydlEHz.js → RuleEditor-BONALh1Q.js} +2 -3
- package/dist/{RuleEditor-Bmj98oC4.cjs → RuleEditor-bLXiRcxL.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-B554_qk1.cjs → TemplateOutlinePanel-C3nfHuaR.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DjPqzU9h.js → TemplateOutlinePanel-JGBKeF3e.js} +2 -2
- package/dist/{TemplateReusePanel-D0628OYc.cjs → TemplateReusePanel-BKhgp6kg.cjs} +1 -1
- package/dist/{TemplateReusePanel-DtYbCN7U.js → TemplateReusePanel-DXQUO6nQ.js} +2 -2
- package/dist/{TemplateReviewPanel-CSwvCz3f.cjs → TemplateReviewPanel-5RWFUUEf.cjs} +1 -1
- package/dist/{TemplateReviewPanel-D_FR4ISq.js → TemplateReviewPanel-DhL7Hapy.js} +1 -1
- package/dist/analytics.d.cts +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/artifact-integrity.json +98 -98
- package/dist/{assets-B4AJIOTB.cjs → assets-BYdpkTIt.cjs} +1 -1
- package/dist/{assets-D0FbszhB.js → assets-C4MIvzQ4.js} +2 -2
- package/dist/{auto-C3mGqzJ8.cjs → auto-D-eDZa_V.cjs} +1 -1
- package/dist/{auto-BksreoKc.js → auto-umW_ozwr.js} +10 -10
- package/dist/{capabilities-lqDEZSq5.js → capabilities-CN_kSVjO.js} +7 -7
- package/dist/{capabilities-CTwlcl8q.cjs → capabilities-D4nfhcvB.cjs} +1 -1
- package/dist/cell-style-B6Qffrx8.js +37 -0
- package/dist/cell-style-y_uh1pZp.cjs +1 -0
- package/dist/{data-bar-BnGtnJ82.js → data-bar-Bfh54sT4.js} +1 -1
- package/dist/{data-bar-2NLRzOCQ.cjs → data-bar-DzceAVeR.cjs} +1 -1
- package/dist/{designer-BNf7NWd6.js → designer-CCyj5WYS.js} +2254 -2248
- package/dist/designer-Cj7fn4Hh.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +6 -6
- package/dist/designer.d.ts +6 -6
- package/dist/designer.js +1 -1
- package/dist/diagnostic-collector-gB07PHy2.js +392 -0
- package/dist/diagnostic-collector-wASg6Fzs.cjs +1 -0
- package/dist/dom-CXWMmwh-.cjs +1 -0
- package/dist/{dom-C90cTM6Y.js → dom-DxdCMLzs.js} +185 -185
- package/dist/{encoding-DSc9zv2F.js → encoding-CEkBtlUP.js} +2 -2
- package/dist/{encoding-CkziAnZI.cjs → encoding-Cipno7dq.cjs} +1 -1
- package/dist/{font-loader-i7lZbqH_.js → font-loader-D4NLIKJL.js} +1 -1
- package/dist/{font-loader-D-znWNWS.cjs → font-loader-p_SyTvqt.cjs} +1 -1
- package/dist/{grid-strokes-BPiV1WHe.js → grid-strokes-DkZEZvcI.js} +1 -1
- package/dist/{grid-strokes-DYf-6DMl.cjs → grid-strokes-RFMR91jn.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +137 -137
- package/dist/json-snapshot-DQdkA_At.cjs +2 -0
- package/dist/{json-snapshot-BJWZNryO.js → json-snapshot-x0JpllWL.js} +8 -8
- package/dist/{pdf-DWuq6uxx.cjs → pdf-C060D5UY.cjs} +2 -2
- package/dist/{pdf-0_5XiTCx.js → pdf-DU8HelKd.js} +17 -17
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-BQBz2vLG.cjs → plugin-B_k23hut.cjs} +1 -1
- package/dist/{plugin-B1ydqEmS.js → plugin-CttO46hc.js} +1 -1
- package/dist/{prefill-Cuzh1wxf.js → prefill-BkF9Fw_p.js} +2 -2
- package/dist/{prefill-2p9wrpn9.cjs → prefill-BvkuwooY.cjs} +1 -1
- package/dist/{prepared-DAwe8Il2.cjs → prepared-CSywIEAZ.cjs} +1 -1
- package/dist/{prepared-CVbgO9KR.js → prepared-Cyuh61fJ.js} +2 -2
- package/dist/protocol-BwbJNVZl.cjs +1 -0
- package/dist/protocol-DwtxjXzO.js +96 -0
- package/dist/record-bindings-B7djSjNs.cjs +1 -0
- package/dist/{record-bindings-fhav-NLG.js → record-bindings-Cv7lFiof.js} +47 -47
- package/dist/{region-binding-workflow-DWCUgjZl.cjs → region-binding-workflow-COD8nISZ.cjs} +1 -1
- package/dist/{region-binding-workflow-Cm4mqhih.js → region-binding-workflow-D8I4QWRh.js} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{rich-text-layout-YJHtCWQI.js → rich-text-layout-Ch_N0Ubu.js} +1 -1
- package/dist/{rich-text-layout-X9YOz1JD.cjs → rich-text-layout-yJGuThtC.cjs} +1 -1
- package/dist/runtime-BE30icyB.js +227 -0
- package/dist/runtime-DRSuy_SQ.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1695 -1661
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog--yBX169M.cjs → template-catalog-C0riwrx7.cjs} +1 -1
- package/dist/{template-catalog-Bu7s7ReF.js → template-catalog-D_gl93va.js} +3 -3
- package/dist/{template-fragments-5EzVn7bm.cjs → template-fragments-CgzPdFKB.cjs} +1 -1
- package/dist/{template-fragments-Di2vDFnx.js → template-fragments-D94ZZmPc.js} +2 -2
- package/dist/{template-registry-Bnh5aEYf.cjs → template-registry-BMScUmM4.cjs} +1 -1
- package/dist/{template-registry-BCBF2b8j.js → template-registry-DZOtRY7t.js} +10 -10
- package/dist/{textwrap-CmVkhMhx.js → textwrap-BywMBMXM.js} +1 -1
- package/dist/{textwrap-BPFxhpOw.cjs → textwrap-LhJkHWb1.cjs} +1 -1
- package/dist/vue/async.d.cts +4 -4
- package/dist/vue/async.d.ts +4 -4
- package/dist/vue/index.d.cts +6 -6
- package/dist/vue/index.d.ts +6 -6
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +7 -7
- package/dist/{workbook-session-BnPK3T58.cjs → workbook-session-DR2j6Hxm.cjs} +3 -3
- package/dist/{workbook-session-B6P_-5a4.js → workbook-session-SzfILBJJ.js} +106 -107
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx/node.d.cts +30 -1
- package/dist/xlsx/node.d.ts +30 -1
- package/dist/xlsx-node.cjs +42 -42
- package/dist/xlsx-node.js +3908 -3889
- package/dist/xlsx.cjs +2 -2
- package/dist/xlsx.d.cts +2 -2
- package/dist/xlsx.d.ts +2 -2
- package/dist/xlsx.js +151 -151
- package/package.json +1 -1
- package/dist/ReportPreview-CyUXJSVX.cjs +0 -6
- package/dist/designer-DWnZZ_ej.cjs +0 -2
- package/dist/diagnostic-collector-1sqd7DQP.js +0 -355
- package/dist/diagnostic-collector-D3rlvxm3.cjs +0 -1
- package/dist/dom-CxOkm_Sy.cjs +0 -1
- package/dist/json-snapshot-C7QZrRBf.cjs +0 -2
- package/dist/progress-BXzlVbIp.js +0 -29
- package/dist/progress-DJBd9Rb9.cjs +0 -1
- package/dist/protocol-BOri9qJL.js +0 -105
- package/dist/protocol-DD5dHSz-.cjs +0 -1
- package/dist/record-bindings-CAyM5tGg.cjs +0 -1
- package/dist/runtime-BpSAgOw1.js +0 -201
- package/dist/runtime-Cd2UTnwe.cjs +0 -1
package/dist/designer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-Cj7fn4Hh.cjs");exports.COLUMN_VISUAL_MESSAGES=E.COLUMN_VISUAL_MESSAGES;exports.ChartBindingInspector=E.ChartBindingInspector;exports.ColumnVisualEditor=E.ColumnVisualEditor;exports.DESIGNER_GUIDE_MESSAGES=E.DESIGNER_GUIDE_MESSAGES;exports.EXCEL_BINDING_MESSAGES=E.EXCEL_BINDING_MESSAGES;exports.ExcelBindingWizard=E.ExcelBindingWizard;exports.LABEL_STUDIO_MESSAGES=E.LABEL_STUDIO_MESSAGES;exports.PARAM_EDITOR_MESSAGES=E.PARAM_EDITOR_MESSAGES;exports.ParamEditor=E.ParamEditor;exports.REPORT_BATCH_MESSAGES=E.REPORT_BATCH_MESSAGES;exports.RULE_EDITOR_MESSAGES=E.DEFAULT_RULE_EDITOR_MESSAGES;exports.ReportBatchPanel=E.ReportBatchPanel;exports.ReportLabelStudio=E.ReportLabelStudio;exports.ReportTemplateEditor=E.ReportTemplateEditor;exports.ReportTemplateLibrary=E.ReportTemplateLibrary;exports.RuleEditor=E.RuleEditor;exports.TEMPLATE_EDITOR_MESSAGES=E.TEMPLATE_EDITOR_MESSAGES;exports.TEMPLATE_LIBRARY_MESSAGES=E.TEMPLATE_LIBRARY_MESSAGES;exports.TEMPLATE_PRODUCT_MESSAGES=E.TEMPLATE_PRODUCT_MESSAGES;exports.TEMPLATE_RECOVERY_MESSAGES=E.TEMPLATE_RECOVERY_MESSAGES;exports.TEMPLATE_REVIEW_MESSAGES=E.TEMPLATE_REVIEW_MESSAGES;exports.TemplateOutlinePanel=E.TemplateOutlinePanel;exports.TemplateReusePanel=E.TemplateReusePanel;exports.TemplateReviewPanel=E.TemplateReviewPanel;exports.createTemplateDraftStorage=E.createTemplateDraftStorage;exports.useTemplateWorkbench=E.useTemplateWorkbench;
|
package/dist/designer.d.cts
CHANGED
|
@@ -1145,11 +1145,11 @@ export declare interface LabelStudioOptions extends LabelStudioLayout {
|
|
|
1145
1145
|
messages?: Partial<LabelStudioMessages>;
|
|
1146
1146
|
}
|
|
1147
1147
|
export declare type LabelStudioPreset = "material" | "paired" | "warehouse";
|
|
1148
|
-
/** auto
|
|
1148
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1149
1149
|
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
1150
|
-
/** auto
|
|
1150
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1151
1151
|
declare type ListAlignment_2 = NonNullable<ComponentStyle_2["align"]> | "auto";
|
|
1152
|
-
/** auto
|
|
1152
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1153
1153
|
declare type ListAlignment_3 = NonNullable<ComponentStyle_3["align"]> | "auto";
|
|
1154
1154
|
declare interface ListColumn {
|
|
1155
1155
|
header: string;
|
|
@@ -1260,7 +1260,7 @@ declare interface ListComponent {
|
|
|
1260
1260
|
paddingMm?: number;
|
|
1261
1261
|
headerEveryPage?: boolean;
|
|
1262
1262
|
headerBackgroundColor?: string;
|
|
1263
|
-
/**
|
|
1263
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1264
1264
|
align?: ListAlignment;
|
|
1265
1265
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1266
1266
|
headerAlign?: ComponentStyle["align"];
|
|
@@ -1312,7 +1312,7 @@ declare interface ListComponent_2 {
|
|
|
1312
1312
|
paddingMm?: number;
|
|
1313
1313
|
headerEveryPage?: boolean;
|
|
1314
1314
|
headerBackgroundColor?: string;
|
|
1315
|
-
/**
|
|
1315
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1316
1316
|
align?: ListAlignment_2;
|
|
1317
1317
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1318
1318
|
headerAlign?: ComponentStyle_2["align"];
|
|
@@ -1364,7 +1364,7 @@ declare interface ListComponent_3 {
|
|
|
1364
1364
|
paddingMm?: number;
|
|
1365
1365
|
headerEveryPage?: boolean;
|
|
1366
1366
|
headerBackgroundColor?: string;
|
|
1367
|
-
/**
|
|
1367
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1368
1368
|
align?: ListAlignment_3;
|
|
1369
1369
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1370
1370
|
headerAlign?: ComponentStyle_3["align"];
|
package/dist/designer.d.ts
CHANGED
|
@@ -1145,11 +1145,11 @@ export declare interface LabelStudioOptions extends LabelStudioLayout {
|
|
|
1145
1145
|
messages?: Partial<LabelStudioMessages>;
|
|
1146
1146
|
}
|
|
1147
1147
|
export declare type LabelStudioPreset = "material" | "paired" | "warehouse";
|
|
1148
|
-
/** auto
|
|
1148
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1149
1149
|
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
1150
|
-
/** auto
|
|
1150
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1151
1151
|
declare type ListAlignment_2 = NonNullable<ComponentStyle_2["align"]> | "auto";
|
|
1152
|
-
/** auto
|
|
1152
|
+
/** auto:真实数字、显式数值格式、日期与布尔居中,其他内容居左。 */
|
|
1153
1153
|
declare type ListAlignment_3 = NonNullable<ComponentStyle_3["align"]> | "auto";
|
|
1154
1154
|
declare interface ListColumn {
|
|
1155
1155
|
header: string;
|
|
@@ -1260,7 +1260,7 @@ declare interface ListComponent {
|
|
|
1260
1260
|
paddingMm?: number;
|
|
1261
1261
|
headerEveryPage?: boolean;
|
|
1262
1262
|
headerBackgroundColor?: string;
|
|
1263
|
-
/**
|
|
1263
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1264
1264
|
align?: ListAlignment;
|
|
1265
1265
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1266
1266
|
headerAlign?: ComponentStyle["align"];
|
|
@@ -1312,7 +1312,7 @@ declare interface ListComponent_2 {
|
|
|
1312
1312
|
paddingMm?: number;
|
|
1313
1313
|
headerEveryPage?: boolean;
|
|
1314
1314
|
headerBackgroundColor?: string;
|
|
1315
|
-
/**
|
|
1315
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1316
1316
|
align?: ListAlignment_2;
|
|
1317
1317
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1318
1318
|
headerAlign?: ComponentStyle_2["align"];
|
|
@@ -1364,7 +1364,7 @@ declare interface ListComponent_3 {
|
|
|
1364
1364
|
paddingMm?: number;
|
|
1365
1365
|
headerEveryPage?: boolean;
|
|
1366
1366
|
headerBackgroundColor?: string;
|
|
1367
|
-
/**
|
|
1367
|
+
/** 内容默认对齐,列配置可覆盖,缺省为 auto。 */
|
|
1368
1368
|
align?: ListAlignment_3;
|
|
1369
1369
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
1370
1370
|
headerAlign?: ComponentStyle_3["align"];
|
package/dist/designer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { C as e, h as s, i as t, j as T, E as _, k as A, L as R, P as r, l as M, R as l, D as o, m as i, n as p, o as G, p as L, q as P, s as n, c as m, d as I, t as D, T as d, v as O, w as C, x as u, y as B, z as c } from "./designer-
|
|
2
|
+
import { C as e, h as s, i as t, j as T, E as _, k as A, L as R, P as r, l as M, R as l, D as o, m as i, n as p, o as G, p as L, q as P, s as n, c as m, d as I, t as D, T as d, v as O, w as C, x as u, y as B, z as c } from "./designer-CCyj5WYS.js";
|
|
3
3
|
export {
|
|
4
4
|
e as COLUMN_VISUAL_MESSAGES,
|
|
5
5
|
s as ChartBindingInspector,
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
const it = 1.35, at = 10.5, ct = '"Microsoft YaHei", sans-serif', ut = 0.75, G = "#333333", K = "#000000", V = "1.0.0-mach", ft = 25.4, lt = 96;
|
|
2
|
+
function R(t = 96) {
|
|
3
|
+
return t / 25.4;
|
|
4
|
+
}
|
|
5
|
+
function dt(t, e = 96) {
|
|
6
|
+
return (t || 0) * R(e);
|
|
7
|
+
}
|
|
8
|
+
function ht(t, e = 96) {
|
|
9
|
+
return t / R(e);
|
|
10
|
+
}
|
|
11
|
+
function q(t, e = 96) {
|
|
12
|
+
return t * e / 72;
|
|
13
|
+
}
|
|
14
|
+
function pt(t, e) {
|
|
15
|
+
const n = 10 ** e;
|
|
16
|
+
return Math.round(t * n) / n;
|
|
17
|
+
}
|
|
18
|
+
const mt = {
|
|
19
|
+
a3: { widthMm: 297, heightMm: 420 },
|
|
20
|
+
a4: { widthMm: 210, heightMm: 297 },
|
|
21
|
+
a5: { widthMm: 148, heightMm: 210 },
|
|
22
|
+
b4: { widthMm: 250, heightMm: 353 },
|
|
23
|
+
b5: { widthMm: 176, heightMm: 250 }
|
|
24
|
+
};
|
|
25
|
+
function gt(t, e = 96, n = 10.5) {
|
|
26
|
+
if (t?.fontSizePx != null)
|
|
27
|
+
return { fontSizePt: t.fontSizePx * 72 / e, fontSizePx: t.fontSizePx };
|
|
28
|
+
const o = t?.fontSize ?? n;
|
|
29
|
+
return { fontSizePt: o, fontSizePx: q(o, e) };
|
|
30
|
+
}
|
|
31
|
+
function bt(t, e = G) {
|
|
32
|
+
return {
|
|
33
|
+
color: t?.borderColor ?? t?.lineColor ?? e,
|
|
34
|
+
widthPt: t?.lineWidthPt ?? 0.75
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function St(t, e = K) {
|
|
38
|
+
return t?.color ?? e;
|
|
39
|
+
}
|
|
40
|
+
function yt(t) {
|
|
41
|
+
return t?.lineHeight ?? 1.35;
|
|
42
|
+
}
|
|
43
|
+
function Et(t) {
|
|
44
|
+
const e = t?.borderTop !== !1, n = t?.borderRight !== !1, o = t?.borderBottom !== !1, r = t?.borderLeft !== !1;
|
|
45
|
+
return { top: e, right: n, bottom: o, left: r, inner: e || n || o || r };
|
|
46
|
+
}
|
|
47
|
+
function W(t, e) {
|
|
48
|
+
const n = { ...t, ...e };
|
|
49
|
+
return e?.fontSize != null && e.fontSizePx == null && delete n.fontSizePx, e?.fontSizePx != null && e.fontSize == null && delete n.fontSize, n;
|
|
50
|
+
}
|
|
51
|
+
function X(t, e = !1) {
|
|
52
|
+
return e || typeof t == "boolean" || t instanceof Date || typeof t == "number" && Number.isFinite(t) ? "center" : "left";
|
|
53
|
+
}
|
|
54
|
+
function Y(t) {
|
|
55
|
+
return t !== void 0 && /[0#?]/.test(t.replace(/"[^"]*"|\\.|\[[^\]]*\]/g, ""));
|
|
56
|
+
}
|
|
57
|
+
function J(t, e) {
|
|
58
|
+
return e.style?.align ?? t?.align ?? X(
|
|
59
|
+
e.value,
|
|
60
|
+
e.valueType === "number" || e.valueType === "boolean" || e.value == null && Y(e.numberFormat)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function At(t, e) {
|
|
64
|
+
const n = W(t, e.style);
|
|
65
|
+
return n.align = J(t, e), n;
|
|
66
|
+
}
|
|
67
|
+
function Z(t, e) {
|
|
68
|
+
const n = t.length;
|
|
69
|
+
if (n === 0) return [];
|
|
70
|
+
const o = t.reduce((l, d) => l + d, 0), r = o > 0 && e > 0 ? e / o : 1, i = [];
|
|
71
|
+
let u = 0;
|
|
72
|
+
for (let l = 0; l < n; l++) {
|
|
73
|
+
const d = Math.max(0, t[l] * r);
|
|
74
|
+
i.push({ pos: u, size: d }), u += d;
|
|
75
|
+
}
|
|
76
|
+
return i;
|
|
77
|
+
}
|
|
78
|
+
function L(t, e, n) {
|
|
79
|
+
return t?.length ? Z(t, e) : Array.from({ length: n }, (o, r) => ({
|
|
80
|
+
pos: e * r / n,
|
|
81
|
+
size: e / n
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
function xt(t, e, n) {
|
|
85
|
+
const o = t.cells ?? [], r = Math.max(o.length, 1), i = t.colWidthsMm?.length ?? o.reduce((s, a) => Math.max(s, Array.isArray(a) ? a.length : 0), 1), u = L(t.colWidthsMm, e, i), l = (s) => s <= 0 ? 0 : s >= i ? u[u.length - 1].pos + u[u.length - 1].size : u[s].pos, d = L(t.rowHeightsMm, n, r), S = (s) => s <= 0 ? 0 : s >= r ? d[d.length - 1].pos + d[d.length - 1].size : d[s].pos, E = /* @__PURE__ */ new Set(), y = (s, a) => `${s}:${a}`, T = [], P = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set(), f = (s, a) => `v${s}:${a}`, p = (s, a) => `h${s}:${a}`;
|
|
86
|
+
o.forEach((s, a) => {
|
|
87
|
+
if (!Array.isArray(s)) return;
|
|
88
|
+
let c = 0;
|
|
89
|
+
for (const m of s) {
|
|
90
|
+
for (; c < i && E.has(y(a, c)); ) c++;
|
|
91
|
+
if (c >= i) break;
|
|
92
|
+
const H = Math.max(1, Math.min(m?.colSpan ?? 1, i - c)), U = Math.max(1, m?.rowSpan ?? 1), M = Math.min(r, a + U), A = Math.min(i, c + H);
|
|
93
|
+
for (let g = a; g < M; g++)
|
|
94
|
+
for (let b = c; b < A; b++)
|
|
95
|
+
E.add(y(g, b));
|
|
96
|
+
for (let g = c + 1; g < A; g++)
|
|
97
|
+
for (let b = a; b < M; b++) P.add(f(g, b));
|
|
98
|
+
for (let g = a + 1; g < M; g++)
|
|
99
|
+
for (let b = c; b < A; b++) _.add(p(g, b));
|
|
100
|
+
const I = l(c), v = S(a);
|
|
101
|
+
T.push({
|
|
102
|
+
ri: a,
|
|
103
|
+
ci: c,
|
|
104
|
+
cell: m ?? {},
|
|
105
|
+
xMm: I,
|
|
106
|
+
yMm: v,
|
|
107
|
+
widthMm: l(A) - I,
|
|
108
|
+
heightMm: S(M) - v
|
|
109
|
+
}), c = A;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const h = [];
|
|
113
|
+
for (let s = 1; s < i; s++) {
|
|
114
|
+
let a = -1;
|
|
115
|
+
for (let c = 0; c <= r; c++) {
|
|
116
|
+
const m = c < r && !P.has(f(s, c));
|
|
117
|
+
m && a < 0 && (a = c), !m && a >= 0 && (h.push({ kind: "v", pos: l(s), from: S(a), to: S(c) }), a = -1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (let s = 1; s < r; s++) {
|
|
121
|
+
let a = -1;
|
|
122
|
+
for (let c = 0; c <= i; c++) {
|
|
123
|
+
const m = c < i && !_.has(p(s, c));
|
|
124
|
+
m && a < 0 && (a = c), !m && a >= 0 && (h.push({ kind: "h", pos: S(s), from: l(a), to: l(c) }), a = -1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { columns: u, rows: d, cells: T, edges: h };
|
|
128
|
+
}
|
|
129
|
+
function wt(t) {
|
|
130
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
131
|
+
const { start: e, end: n, color: o } = t;
|
|
132
|
+
return typeof e == "number" && typeof n == "number" && Number.isFinite(e) && Number.isFinite(n) && e >= 0 && n <= 1 && e <= n && typeof o == "string" && /^#[0-9a-f]{6}$/i.test(o);
|
|
133
|
+
}
|
|
134
|
+
const Tt = V;
|
|
135
|
+
function Pt(t) {
|
|
136
|
+
return (t.kind === "image" || t.kind === "barcode" || t.kind === "qrcode" || t.kind === "chart") && !!t.imageData;
|
|
137
|
+
}
|
|
138
|
+
function _t(t) {
|
|
139
|
+
return t.kind === "text" && Array.isArray(t.richParagraphs) && t.richParagraphs.length > 0;
|
|
140
|
+
}
|
|
141
|
+
function O(t) {
|
|
142
|
+
return !!t && typeof t == "object";
|
|
143
|
+
}
|
|
144
|
+
function N(t, e, n, o, r) {
|
|
145
|
+
if (++r.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
146
|
+
if (O(t)) {
|
|
147
|
+
if (n > 64) return { path: e, message: "组件嵌套超过64层预算" };
|
|
148
|
+
if (o.has(t)) return { path: e, message: "组件树包含循环引用" };
|
|
149
|
+
if (!(!O(t.grid) || !Array.isArray(t.grid.cells))) {
|
|
150
|
+
o.add(t);
|
|
151
|
+
try {
|
|
152
|
+
for (const [i, u] of t.grid.cells.entries())
|
|
153
|
+
if (Array.isArray(u))
|
|
154
|
+
for (const [l, d] of u.entries()) {
|
|
155
|
+
if (++r.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
156
|
+
if (!(!O(d) || !Array.isArray(d.children)))
|
|
157
|
+
for (const [S, E] of d.children.entries()) {
|
|
158
|
+
const y = N(E, `${e}.grid.cells.${i}.${l}.children.${S}`, n + 1, o, r);
|
|
159
|
+
if (y) return y;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} finally {
|
|
163
|
+
o.delete(t);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function Q(t, e = "$.components", n = { nodes: 0 }) {
|
|
169
|
+
for (const [o, r] of t.entries()) {
|
|
170
|
+
const i = N(r, `${e}.${o}`, 0, /* @__PURE__ */ new Set(), n);
|
|
171
|
+
if (i) return i;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function tt(t) {
|
|
175
|
+
const e = { nodes: 0 };
|
|
176
|
+
for (const [n, o] of t.entries()) {
|
|
177
|
+
if (!O(o) || !Array.isArray(o.components)) continue;
|
|
178
|
+
const r = Q(o.components, `$.pages.${n}.components`, e);
|
|
179
|
+
if (r) return r;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function Mt(t) {
|
|
183
|
+
const e = tt(t.pages);
|
|
184
|
+
if (e) throw new TypeError(`${e.path}: ${e.message}`);
|
|
185
|
+
}
|
|
186
|
+
function w(t) {
|
|
187
|
+
if (t?.aborted) throw t.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
188
|
+
}
|
|
189
|
+
function et(t) {
|
|
190
|
+
try {
|
|
191
|
+
Promise.resolve(t()).catch(() => {
|
|
192
|
+
});
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function nt(t, e, n) {
|
|
197
|
+
w(t.signal), et(() => t.onProgress?.(e, n)), w(t.signal);
|
|
198
|
+
}
|
|
199
|
+
function Ot(t, e) {
|
|
200
|
+
const n = Promise.resolve(t);
|
|
201
|
+
return e?.aborted ? (n.catch(() => {
|
|
202
|
+
}), Promise.reject(e.reason ?? new DOMException("The operation was aborted.", "AbortError"))) : e ? new Promise((o, r) => {
|
|
203
|
+
const i = () => e.removeEventListener("abort", u), u = () => {
|
|
204
|
+
i(), r(e.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
205
|
+
};
|
|
206
|
+
e.addEventListener("abort", u, { once: !0 }), n.then((l) => {
|
|
207
|
+
i(), o(l);
|
|
208
|
+
}, (l) => {
|
|
209
|
+
i(), r(l);
|
|
210
|
+
}), e.aborted && u();
|
|
211
|
+
}) : n;
|
|
212
|
+
}
|
|
213
|
+
function Dt(t, e) {
|
|
214
|
+
const n = () => e.abort(t?.reason);
|
|
215
|
+
return t?.addEventListener("abort", n, { once: !0 }), t?.aborted && n(), () => t?.removeEventListener("abort", n);
|
|
216
|
+
}
|
|
217
|
+
async function Ct(t, e, n) {
|
|
218
|
+
nt(t, e, n), (t.signal || t.onProgress) && await new Promise((o) => setTimeout(o, 0)), w(t.signal);
|
|
219
|
+
}
|
|
220
|
+
function It(t) {
|
|
221
|
+
let e = 0, n = Date.now();
|
|
222
|
+
return (o = 1) => {
|
|
223
|
+
if (w(t.signal), e += o, !(e < 4096 && Date.now() - n < 8))
|
|
224
|
+
return e = 0, new Promise((r) => setTimeout(r, 0)).then(() => {
|
|
225
|
+
n = Date.now(), w(t.signal);
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const vt = 200, $ = 1e3, F = 128, x = "other", j = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), ot = {
|
|
230
|
+
"invalid-image-data": !0,
|
|
231
|
+
"image-budget-exceeded": !0,
|
|
232
|
+
"component-render-failed": !0,
|
|
233
|
+
"unsupported-text": !0,
|
|
234
|
+
"output-degraded": !0,
|
|
235
|
+
"missing-image": !0,
|
|
236
|
+
"unsupported-component": !0,
|
|
237
|
+
"unsupported-image-format": !0,
|
|
238
|
+
"unsupported-style": !0,
|
|
239
|
+
"rich-text-flattened": !0,
|
|
240
|
+
"nested-components-omitted": !0,
|
|
241
|
+
"async-image-required": !0,
|
|
242
|
+
"image-decode-failed": !0,
|
|
243
|
+
"asset-render-failed": !0,
|
|
244
|
+
"asset-budget-exceeded": !0
|
|
245
|
+
}, C = /* @__PURE__ */ new Set([...Object.keys(ot), "pdf-page", "pdf-font", "pdf-fidelity", "xlsx-fidelity", "xlsx-snapshot", "prepared-layout-preserved", "prepared-font-metrics", "layout"]);
|
|
246
|
+
function z(t) {
|
|
247
|
+
if (t === void 0) return 1 / 0;
|
|
248
|
+
if (!Number.isInteger(t) || t < 0 || t > $) throw new RangeError("diagnosticLimit must be an integer between 0 and 1000");
|
|
249
|
+
return t;
|
|
250
|
+
}
|
|
251
|
+
function Lt(t) {
|
|
252
|
+
const e = z(t), n = [], o = [], r = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ Object.create(null);
|
|
253
|
+
let l = 0, d = 0, S = 0;
|
|
254
|
+
function E(f, p) {
|
|
255
|
+
const h = f.length <= 128 && !j.has(f) && (r[f] !== void 0 || S < F || C.has(f)) ? f : x;
|
|
256
|
+
return r[h] === void 0 && S++, r[h] = (r[h] ?? 0) + p, h;
|
|
257
|
+
}
|
|
258
|
+
function y(f, p) {
|
|
259
|
+
if (e === 1 / 0) {
|
|
260
|
+
n.push(f);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const h = `${D(f) ? "e" : "o"}:${p}`;
|
|
264
|
+
if (n.length < e) {
|
|
265
|
+
n.push(f), o.push(h), i.set(h, (i.get(h) ?? 0) + 1);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (!(!e || i.has(h)))
|
|
269
|
+
for (let s = n.length - 1; s >= 0; s--) {
|
|
270
|
+
const a = o[s], c = i.get(a) ?? 0;
|
|
271
|
+
if (!(c <= 1)) {
|
|
272
|
+
n[s] = f, o[s] = h, i.set(a, c - 1), i.set(h, 1);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function T(f) {
|
|
278
|
+
d++;
|
|
279
|
+
const p = E(f.code, 1);
|
|
280
|
+
D(f) && (l++, u[p] = (u[p] ?? 0) + 1), y(f, p);
|
|
281
|
+
}
|
|
282
|
+
function P(f) {
|
|
283
|
+
d += f.total;
|
|
284
|
+
const p = /* @__PURE__ */ new Map();
|
|
285
|
+
for (const [s, a] of Object.entries(f.counts)) {
|
|
286
|
+
const c = E(s, a), m = f.explanations?.counts[s] ?? 0;
|
|
287
|
+
p.set(s, c), m && (l += m, u[c] = (u[c] ?? 0) + m);
|
|
288
|
+
}
|
|
289
|
+
if (e === 1 / 0) {
|
|
290
|
+
for (const s of f.entries) n.push(s);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const h = /* @__PURE__ */ new Map();
|
|
294
|
+
for (const s of f.entries) {
|
|
295
|
+
const a = B(f, s, h);
|
|
296
|
+
a !== void 0 && y(s, p.get(a));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function _() {
|
|
300
|
+
return { total: d, counts: { ...r }, entries: n.slice(), omitted: d - n.length, ...l ? { explanations: { total: l, counts: { ...u } } } : {} };
|
|
301
|
+
}
|
|
302
|
+
return { entries: n, push: T, merge: P, snapshot: _, get total() {
|
|
303
|
+
return d;
|
|
304
|
+
} };
|
|
305
|
+
}
|
|
306
|
+
function kt(t) {
|
|
307
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
308
|
+
const e = t;
|
|
309
|
+
if (!Number.isSafeInteger(e.total) || e.total < 0 || !Number.isSafeInteger(e.omitted) || e.omitted < 0 || !Array.isArray(e.entries) || e.entries.length > $ || e.total !== e.entries.length + e.omitted || !e.counts || typeof e.counts != "object" || Array.isArray(e.counts) || Object.keys(e.counts).some((o) => o.length > 128 || j.has(o))) return !1;
|
|
310
|
+
const n = Object.values(e.counts);
|
|
311
|
+
return n.length > F + C.size + 1 || n.some((o) => !Number.isSafeInteger(o) || o <= 0) || n.reduce((o, r) => o + r, 0) !== e.total ? !1 : st(e) && rt(e);
|
|
312
|
+
}
|
|
313
|
+
function rt(t) {
|
|
314
|
+
const e = /* @__PURE__ */ new Map();
|
|
315
|
+
return t.entries.every((n) => B(t, n, e) !== void 0);
|
|
316
|
+
}
|
|
317
|
+
function k(t, e, n, o) {
|
|
318
|
+
const r = `${n ? "e" : "o"}:${e}`, i = (o.get(r) ?? 0) + 1, u = t.explanations?.counts[e] ?? 0;
|
|
319
|
+
return (n ? u : (t.counts[e] ?? 0) - u) < i ? !1 : (o.set(r, i), !0);
|
|
320
|
+
}
|
|
321
|
+
function B(t, e, n) {
|
|
322
|
+
const o = e && typeof e == "object" && typeof e.code == "string" ? e.code : "unknown", r = Object.prototype.hasOwnProperty.call(t.counts, o) ? o : x, i = !!e && typeof e == "object" && D(e);
|
|
323
|
+
if (k(t, r, i, n)) return r;
|
|
324
|
+
if (r !== x && !C.has(o) && k(t, x, i, n)) return x;
|
|
325
|
+
}
|
|
326
|
+
function D(t) {
|
|
327
|
+
return t.valueState !== void 0;
|
|
328
|
+
}
|
|
329
|
+
function st(t) {
|
|
330
|
+
if (t.explanations === void 0) return !0;
|
|
331
|
+
const e = t.explanations;
|
|
332
|
+
if (!e || typeof e != "object" || Array.isArray(e) || !Number.isSafeInteger(e.total) || e.total < 0 || e.total > t.total || !e.counts || typeof e.counts != "object" || Array.isArray(e.counts)) return !1;
|
|
333
|
+
const n = Object.entries(e.counts);
|
|
334
|
+
return n.every(([o, r]) => Number.isSafeInteger(r) && r > 0 && r <= (t.counts[o] ?? 0)) && n.reduce((o, [, r]) => o + r, 0) === e.total;
|
|
335
|
+
}
|
|
336
|
+
function Rt(t, e) {
|
|
337
|
+
const n = z(t), o = [];
|
|
338
|
+
let r = 0;
|
|
339
|
+
return { entries: o, get total() {
|
|
340
|
+
return r;
|
|
341
|
+
}, push(...i) {
|
|
342
|
+
for (const u of i)
|
|
343
|
+
r++, o.length < n && o.push(u), e?.(u);
|
|
344
|
+
return r;
|
|
345
|
+
} };
|
|
346
|
+
}
|
|
347
|
+
export {
|
|
348
|
+
w as A,
|
|
349
|
+
nt as B,
|
|
350
|
+
lt as C,
|
|
351
|
+
ct as D,
|
|
352
|
+
wt as E,
|
|
353
|
+
Dt as F,
|
|
354
|
+
vt as G,
|
|
355
|
+
kt as H,
|
|
356
|
+
X as I,
|
|
357
|
+
Q as J,
|
|
358
|
+
tt as K,
|
|
359
|
+
it as L,
|
|
360
|
+
ft as M,
|
|
361
|
+
Mt as N,
|
|
362
|
+
Y as O,
|
|
363
|
+
mt as P,
|
|
364
|
+
Tt as R,
|
|
365
|
+
V as S,
|
|
366
|
+
gt as a,
|
|
367
|
+
At as b,
|
|
368
|
+
yt as c,
|
|
369
|
+
St as d,
|
|
370
|
+
bt as e,
|
|
371
|
+
Et as f,
|
|
372
|
+
_t as g,
|
|
373
|
+
K as h,
|
|
374
|
+
Pt as i,
|
|
375
|
+
ut as j,
|
|
376
|
+
at as k,
|
|
377
|
+
G as l,
|
|
378
|
+
W as m,
|
|
379
|
+
dt as n,
|
|
380
|
+
Ct as o,
|
|
381
|
+
q as p,
|
|
382
|
+
R as q,
|
|
383
|
+
xt as r,
|
|
384
|
+
ht as s,
|
|
385
|
+
pt as t,
|
|
386
|
+
J as u,
|
|
387
|
+
Rt as v,
|
|
388
|
+
Ot as w,
|
|
389
|
+
Lt as x,
|
|
390
|
+
It as y,
|
|
391
|
+
et as z
|
|
392
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const nt='"Microsoft YaHei", sans-serif';const N="#333333",k="#000000",H="1.0.0-mach";function M(t=96){return t/25.4}function ot(t,e=96){return(t||0)*M(e)}function rt(t,e=96){return t/M(e)}function $(t,e=96){return t*e/72}function st(t,e){const n=10**e;return Math.round(t*n)/n}const it={a3:{widthMm:297,heightMm:420},a4:{widthMm:210,heightMm:297},a5:{widthMm:148,heightMm:210},b4:{widthMm:250,heightMm:353},b5:{widthMm:176,heightMm:250}};function ct(t,e=96,n=10.5){if(t?.fontSizePx!=null)return{fontSizePt:t.fontSizePx*72/e,fontSizePx:t.fontSizePx};const o=t?.fontSize??n;return{fontSizePt:o,fontSizePx:$(o,e)}}function at(t,e=N){return{color:t?.borderColor??t?.lineColor??e,widthPt:t?.lineWidthPt??.75}}function ut(t,e=k){return t?.color??e}function ft(t){return t?.lineHeight??1.35}function lt(t){const e=t?.borderTop!==!1,n=t?.borderRight!==!1,o=t?.borderBottom!==!1,r=t?.borderLeft!==!1;return{top:e,right:n,bottom:o,left:r,inner:e||n||o||r}}function B(t,e){const n={...t,...e};return e?.fontSize!=null&&e.fontSizePx==null&&delete n.fontSizePx,e?.fontSizePx!=null&&e.fontSize==null&&delete n.fontSize,n}function U(t,e=!1){return e||typeof t=="boolean"||t instanceof Date||typeof t=="number"&&Number.isFinite(t)?"center":"left"}function z(t){return t!==void 0&&/[0#?]/.test(t.replace(/"[^"]*"|\\.|\[[^\]]*\]/g,""))}function j(t,e){return e.style?.align??t?.align??U(e.value,e.valueType==="number"||e.valueType==="boolean"||e.value==null&&z(e.numberFormat))}function dt(t,e){const n=B(t,e.style);return n.align=j(t,e),n}function pt(t,e){const n=t.length;if(n===0)return[];const o=t.reduce((l,d)=>l+d,0),r=o>0&&e>0?e/o:1,i=[];let u=0;for(let l=0;l<n;l++){const d=Math.max(0,t[l]*r);i.push({pos:u,size:d}),u+=d}return i}function v(t,e,n){return t?.length?pt(t,e):Array.from({length:n},(o,r)=>({pos:e*r/n,size:e/n}))}function ht(t,e,n){const o=t.cells??[],r=Math.max(o.length,1),i=t.colWidthsMm?.length??o.reduce((s,c)=>Math.max(s,Array.isArray(c)?c.length:0),1),u=v(t.colWidthsMm,e,i),l=s=>s<=0?0:s>=i?u[u.length-1].pos+u[u.length-1].size:u[s].pos,d=v(t.rowHeightsMm,n,r),E=s=>s<=0?0:s>=r?d[d.length-1].pos+d[d.length-1].size:d[s].pos,_=new Set,T=(s,c)=>`${s}:${c}`,P=[],O=new Set,x=new Set,f=(s,c)=>`v${s}:${c}`,h=(s,c)=>`h${s}:${c}`;o.forEach((s,c)=>{if(!Array.isArray(s))return;let a=0;for(const m of s){for(;a<i&&_.has(T(c,a));)a++;if(a>=i)break;const tt=Math.max(1,Math.min(m?.colSpan??1,i-a)),et=Math.max(1,m?.rowSpan??1),C=Math.min(r,c+et),A=Math.min(i,a+tt);for(let g=c;g<C;g++)for(let S=a;S<A;S++)_.add(T(g,S));for(let g=a+1;g<A;g++)for(let S=c;S<C;S++)O.add(f(g,S));for(let g=c+1;g<C;g++)for(let S=a;S<A;S++)x.add(h(g,S));const L=l(a),R=E(c);P.push({ri:c,ci:a,cell:m??{},xMm:L,yMm:R,widthMm:l(A)-L,heightMm:E(C)-R}),a=A}});const p=[];for(let s=1;s<i;s++){let c=-1;for(let a=0;a<=r;a++){const m=a<r&&!O.has(f(s,a));m&&c<0&&(c=a),!m&&c>=0&&(p.push({kind:"v",pos:l(s),from:E(c),to:E(a)}),c=-1)}}for(let s=1;s<r;s++){let c=-1;for(let a=0;a<=i;a++){const m=a<i&&!x.has(h(s,a));m&&c<0&&(c=a),!m&&c>=0&&(p.push({kind:"h",pos:E(s),from:l(c),to:l(a)}),c=-1)}}return{columns:u,rows:d,cells:P,edges:p}}function mt(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{start:e,end:n,color:o}=t;return typeof e=="number"&&typeof n=="number"&&Number.isFinite(e)&&Number.isFinite(n)&&e>=0&&n<=1&&e<=n&&typeof o=="string"&&/^#[0-9a-f]{6}$/i.test(o)}const gt=H;function St(t){return(t.kind==="image"||t.kind==="barcode"||t.kind==="qrcode"||t.kind==="chart")&&!!t.imageData}function Et(t){return t.kind==="text"&&Array.isArray(t.richParagraphs)&&t.richParagraphs.length>0}function D(t){return!!t&&typeof t=="object"}function G(t,e,n,o,r){if(++r.nodes>1e6)return{path:e,message:"组件树超过100万个结构节点预算"};if(D(t)){if(n>64)return{path:e,message:"组件嵌套超过64层预算"};if(o.has(t))return{path:e,message:"组件树包含循环引用"};if(!(!D(t.grid)||!Array.isArray(t.grid.cells))){o.add(t);try{for(const[i,u]of t.grid.cells.entries())if(Array.isArray(u))for(const[l,d]of u.entries()){if(++r.nodes>1e6)return{path:e,message:"组件树超过100万个结构节点预算"};if(!(!D(d)||!Array.isArray(d.children)))for(const[E,_]of d.children.entries()){const T=G(_,`${e}.grid.cells.${i}.${l}.children.${E}`,n+1,o,r);if(T)return T}}}finally{o.delete(t)}}}}function V(t,e="$.components",n={nodes:0}){for(const[o,r]of t.entries()){const i=G(r,`${e}.${o}`,0,new Set,n);if(i)return i}}function K(t){const e={nodes:0};for(const[n,o]of t.entries()){if(!D(o)||!Array.isArray(o.components))continue;const r=V(o.components,`$.pages.${n}.components`,e);if(r)return r}}function Tt(t){const e=K(t.pages);if(e)throw new TypeError(`${e.path}: ${e.message}`)}function b(t){if(t?.aborted)throw t.reason??new DOMException("The operation was aborted.","AbortError")}function X(t){try{Promise.resolve(t()).catch(()=>{})}catch{}}function W(t,e,n){b(t.signal),X(()=>t.onProgress?.(e,n)),b(t.signal)}function _t(t,e){const n=Promise.resolve(t);return e?.aborted?(n.catch(()=>{}),Promise.reject(e.reason??new DOMException("The operation was aborted.","AbortError"))):e?new Promise((o,r)=>{const i=()=>e.removeEventListener("abort",u),u=()=>{i(),r(e.reason??new DOMException("The operation was aborted.","AbortError"))};e.addEventListener("abort",u,{once:!0}),n.then(l=>{i(),o(l)},l=>{i(),r(l)}),e.aborted&&u()}):n}function bt(t,e){const n=()=>e.abort(t?.reason);return t?.addEventListener("abort",n,{once:!0}),t?.aborted&&n(),()=>t?.removeEventListener("abort",n)}async function At(t,e,n){W(t,e,n),(t.signal||t.onProgress)&&await new Promise(o=>setTimeout(o,0)),b(t.signal)}function yt(t){let e=0,n=Date.now();return(o=1)=>{if(b(t.signal),e+=o,!(e<4096&&Date.now()-n<8))return e=0,new Promise(r=>setTimeout(r,0)).then(()=>{n=Date.now(),b(t.signal)})}}const Pt=200,Y=1e3,q=128,y="other",Z=new Set(["__proto__","prototype","constructor"]),Ot={"invalid-image-data":!0,"image-budget-exceeded":!0,"component-render-failed":!0,"unsupported-text":!0,"output-degraded":!0,"missing-image":!0,"unsupported-component":!0,"unsupported-image-format":!0,"unsupported-style":!0,"rich-text-flattened":!0,"nested-components-omitted":!0,"async-image-required":!0,"image-decode-failed":!0,"asset-render-failed":!0,"asset-budget-exceeded":!0},w=new Set([...Object.keys(Ot),"pdf-page","pdf-font","pdf-fidelity","xlsx-fidelity","xlsx-snapshot","prepared-layout-preserved","prepared-font-metrics","layout"]);function J(t){if(t===void 0)return 1/0;if(!Number.isInteger(t)||t<0||t>Y)throw new RangeError("diagnosticLimit must be an integer between 0 and 1000");return t}function xt(t){const e=J(t),n=[],o=[],r=Object.create(null),i=new Map,u=Object.create(null);let l=0,d=0,E=0;function _(f,h){const p=f.length<=128&&!Z.has(f)&&(r[f]!==void 0||E<q||w.has(f))?f:y;return r[p]===void 0&&E++,r[p]=(r[p]??0)+h,p}function T(f,h){if(e===1/0){n.push(f);return}const p=`${I(f)?"e":"o"}:${h}`;if(n.length<e){n.push(f),o.push(p),i.set(p,(i.get(p)??0)+1);return}if(!(!e||i.has(p)))for(let s=n.length-1;s>=0;s--){const c=o[s],a=i.get(c)??0;if(!(a<=1)){n[s]=f,o[s]=p,i.set(c,a-1),i.set(p,1);return}}}function P(f){d++;const h=_(f.code,1);I(f)&&(l++,u[h]=(u[h]??0)+1),T(f,h)}function O(f){d+=f.total;const h=new Map;for(const[s,c]of Object.entries(f.counts)){const a=_(s,c),m=f.explanations?.counts[s]??0;h.set(s,a),m&&(l+=m,u[a]=(u[a]??0)+m)}if(e===1/0){for(const s of f.entries)n.push(s);return}const p=new Map;for(const s of f.entries){const c=Q(f,s,p);c!==void 0&&T(s,h.get(c))}}function x(){return{total:d,counts:{...r},entries:n.slice(),omitted:d-n.length,...l?{explanations:{total:l,counts:{...u}}}:{}}}return{entries:n,push:P,merge:O,snapshot:x,get total(){return d}}}function Ct(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;if(!Number.isSafeInteger(e.total)||e.total<0||!Number.isSafeInteger(e.omitted)||e.omitted<0||!Array.isArray(e.entries)||e.entries.length>Y||e.total!==e.entries.length+e.omitted||!e.counts||typeof e.counts!="object"||Array.isArray(e.counts)||Object.keys(e.counts).some(o=>o.length>128||Z.has(o)))return!1;const n=Object.values(e.counts);return n.length>q+w.size+1||n.some(o=>!Number.isSafeInteger(o)||o<=0)||n.reduce((o,r)=>o+r,0)!==e.total?!1:It(e)&&Dt(e)}function Dt(t){const e=new Map;return t.entries.every(n=>Q(t,n,e)!==void 0)}function F(t,e,n,o){const r=`${n?"e":"o"}:${e}`,i=(o.get(r)??0)+1,u=t.explanations?.counts[e]??0;return(n?u:(t.counts[e]??0)-u)<i?!1:(o.set(r,i),!0)}function Q(t,e,n){const o=e&&typeof e=="object"&&typeof e.code=="string"?e.code:"unknown",r=Object.prototype.hasOwnProperty.call(t.counts,o)?o:y,i=!!e&&typeof e=="object"&&I(e);if(F(t,r,i,n))return r;if(r!==y&&!w.has(o)&&F(t,y,i,n))return y}function I(t){return t.valueState!==void 0}function It(t){if(t.explanations===void 0)return!0;const e=t.explanations;if(!e||typeof e!="object"||Array.isArray(e)||!Number.isSafeInteger(e.total)||e.total<0||e.total>t.total||!e.counts||typeof e.counts!="object"||Array.isArray(e.counts))return!1;const n=Object.entries(e.counts);return n.every(([o,r])=>Number.isSafeInteger(r)&&r>0&&r<=(t.counts[o]??0))&&n.reduce((o,[,r])=>o+r,0)===e.total}function Mt(t,e){const n=J(t),o=[];let r=0;return{entries:o,get total(){return r},push(...i){for(const u of i)r++,o.length<n&&o.push(u),e?.(u);return r}}}exports.CSS_DPI=96;exports.DEFAULT_BORDER_PT=.75;exports.DEFAULT_DIAGNOSTIC_LIMIT=Pt;exports.DEFAULT_FONT_FAMILY=nt;exports.DEFAULT_FONT_PT=10.5;exports.DEFAULT_STROKE_COLOR=N;exports.DEFAULT_TEXT_COLOR=k;exports.LINE_HEIGHT=1.35;exports.MM_PER_INCH=25.4;exports.PAPER_SIZES=it;exports.RENDER_PLAN_SCHEMA_VERSION=gt;exports.SCHEMA_VERSION_MACH=H;exports.assertBoundedRenderTree=Tt;exports.assertOutputActive=b;exports.automaticCellAlignment=U;exports.componentTreeIssue=V;exports.createDiagnosticCollector=xt;exports.createDiagnosticMessages=Mt;exports.createOutputScheduler=yt;exports.forwardOutputAbort=bt;exports.gridCellAlignment=j;exports.hasNumericCellFormat=z;exports.isImageBackedComponent=St;exports.isRichText=Et;exports.mergeComponentStyles=B;exports.mmToPx=ot;exports.mmToPxFactor=M;exports.notifyOutputProgress=W;exports.observeOutput=X;exports.outputCheckpoint=At;exports.ptToPx=$;exports.pxToMm=rt;exports.renderTreeIssue=K;exports.resolveBoxBorders=lt;exports.resolveFontSize=ct;exports.resolveGridCellStyle=dt;exports.resolveGridLayout=ht;exports.resolveLineHeight=ft;exports.resolveStroke=at;exports.resolveTextColor=ut;exports.round=st;exports.validDataBar=mt;exports.validDiagnosticSummary=Ct;exports.waitForOutput=_t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const z=require("./template-serialization-CqQY4zDg.cjs"),V=require("./data-bar-DzceAVeR.cjs"),B=require("./dom-cell-address-DLD1mkTB.cjs"),f=require("./diagnostic-collector-wASg6Fzs.cjs"),D=require("./grid-strokes-RFMR91jn.cjs"),R=require("./capabilities-D4nfhcvB.cjs");function F(e){const t=/\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);return t?{pageIndex:Number(t[1]),...t[2]===void 0?{}:{componentIndex:Number(t[2])}}:{}}function q(e,t,r){return z.collectTemplateDatasetBindings(e).filter(n=>n.dataset===t).flatMap(n=>n.fields.filter(o=>o.field===r).map(o=>({...o,...F(o.path),dataset:t,kind:/\.computed\[/.test(o.path)?"calculation":/\.columns\[\d+\]\.field$/.test(o.path)?"display":"binding"})))}function j(e,t){const r=e.kind==="list"?e.title||e.dataset:e.binding?.field||e.text||e.nid;return`${e.kind} · ${(r||String(t+1)).replace(/\s+/g," ").slice(0,80)}`}function K(e){const t=z.collectTemplateDatasetBindings(e),r=new Map;for(const o of t)for(const l of o.fields){const a=/^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(l.path)?.[0];if(!a)continue;const s=r.get(a)??[];s.push({...l,dataset:o.dataset}),r.set(a,s)}const n=[];return e.pages.forEach((o,l)=>{const a=`$.template.pages[${l}]`;n.push({path:a,pageIndex:l,kind:"page",depth:0,title:typeof o.meta?.title=="string"?o.meta.title:`${l+1} · ${o.widthMm} × ${o.heightMm} mm`}),o.components.forEach((s,i)=>{const d=`${a}.components[${i}]`,h={pageIndex:l,componentIndex:i};n.push({path:d,...h,depth:1,kind:"component",title:j(s,i)}),s.kind==="list"&&(s.columns.forEach((m,p)=>n.push({path:`${d}.columns[${p}].field`,...h,depth:2,kind:"field",title:`${m.header} · ${m.field}`,field:m.field,dataset:s.dataset})),s.computed?.forEach((m,p)=>n.push({path:`${d}.computed[${p}]`,...h,depth:2,kind:"calculation",title:m.field,field:m.field,dataset:s.dataset})));const c=new Set;for(const m of r.get(d)??[])/\.columns\[\d+\]\.field$/.test(m.path)||c.has(m.path)||(c.add(m.path),n.push({...m,...h,depth:2,kind:"binding",title:m.field}))})}),n}function M(e,t,r){let n=0,o=e.length;for(;n<o;){const l=n+o>>>1;r(e[l])<t?n=l+1:o=l}return n}function G(e){if(![e.leftMm,e.topMm,e.widthMm,e.heightMm].every(Number.isFinite)||e.widthMm<0||e.heightMm<0)throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");return e}function U(e){const t=e.rows.map(()=>[]);for(const r of e.cells){const n=Math.min(t.length,r.ri+(r.cell.rowSpan??1));for(let o=r.ri;o<n;o++)t[o].push(r)}for(const r of t)r.sort((n,o)=>n.xMm-o.xMm);return{cells(r){G(r);const n=new Set,o=r.topMm+r.heightMm,l=r.leftMm+r.widthMm;let a=M(e.rows,r.topMm,s=>s.pos+s.size);for(;a<t.length&&e.rows[a].pos<=o;){const s=t[a++];let i=M(s,r.leftMm,d=>d.xMm+d.widthMm);for(;i<s.length&&s[i].xMm<=l;)n.add(s[i++])}return[...n].sort((s,i)=>s.ri-i.ri||s.ci-i.ci)}}}function _(e){const t=["h","v"].map(r=>e.filter(n=>n.kind===r).sort((n,o)=>n.pos-o.pos));return r=>{const n=[];return t.forEach((o,l)=>{const a=l===0?r.topMm:r.leftMm,s=a+(l===0?r.heightMm:r.widthMm),i=l===0?r.leftMm:r.topMm,d=i+(l===0?r.widthMm:r.heightMm);let h=M(o,a,c=>c.pos);for(;h<o.length&&o[h].pos<=s;){const c=o[h++];c.to>=i&&c.from<=d&&n.push(c)}}),n}}function W(){const e=[];return{mount(t){e.push(ee(t))},update(t,r,n,o){G(t);let l=!1;for(const a of e)l=a.update(t,a.component===r?n:void 0,o)||l;return l}}}function X(e,t){const r=Math.max(8,e.widthMm/4),n=Math.max(8,e.heightMm/4);return{leftMm:e.leftMm-t.leftMm-r,topMm:e.topMm-t.topMm-n,widthMm:e.widthMm+2*r,heightMm:e.heightMm+2*n}}function Y(e,t,r){let n=t.get(r);return n||(n=e.table.ownerDocument.createElement("tr"),n.className=e.rowClass,n.setAttribute("role","row"),n.setAttribute("aria-rowindex",String(r+1)),n.style.cssText="all:unset;display:contents;box-sizing:border-box",t.set(r,n)),n}function J(e,t,r,n){const o=new Set(t),l=new Set(t.map(i=>i.ri)),a=new Map;for(const[i,d]of r)if(!o.has(i)){d.remove(),r.delete(i);const h=e.reuseKey?.(i);if(h!==void 0){const c=a.get(h)??[];c.push(d),a.set(h,c)}}for(const[i,d]of n)l.has(i)||(d.remove(),n.delete(i));for(const i of t){let d=r.get(i);if(!d){const c=e.reuseKey?.(i),m=c===void 0?void 0:a.get(c)?.pop();d=m&&e.reuseCell?.(m,i)?m:e.drawCell(i),d.setAttribute("aria-colindex",String(i.ci+1)),r.set(i,d)}const h=Y(e,n,i.ri);d.parentElement!==h&&h.appendChild(d)}const s=new Map;for(const i of t){const d=s.get(i.ri)??[];d.push(r.get(i)),s.set(i.ri,d)}for(const[i,d]of s)A(n.get(i),d);A(e.body,[...l].sort((i,d)=>i-d).map(i=>n.get(i)))}function A(e,t){let r=e.firstElementChild;for(const n of t)n===r?r=r.nextElementSibling:e.insertBefore(n,r)}function Q(e,t){return e.table?.role==="header"?e.heightMm:t.rows[0]?.size??0}function Z(e,t,r,n){const o=[e],l=n.freezeHeaders&&(r.table?.role==="header"||!r.table),a=Q(r,t);l&&o.push({...e,topMm:0,heightMm:Math.max(0,a-1e-4)});const s=Math.max(0,Math.min(20,Math.floor(n.frozenColumns??0)))||0;if(!s||!t.columns.length)return o;const i=t.columns[Math.min(s,t.columns.length)-1],d={...e,leftMm:0,widthMm:Math.max(0,i.pos+i.size-1e-4)};return o.push(d),l&&o.push({...d,topMm:0,heightMm:Math.max(0,a-1e-4)}),o}function ee(e){const t=f.resolveGridLayout(e.grid,e.component.widthMm,e.component.heightMm),r=new Map(t.cells.map(h=>[`${h.ri}:${h.ci}`,h])),n=U(t),o=new Map,l=new Map,a=_(D.resolveGridStrokes(t,e.component));e.table.setAttribute("aria-rowcount",String(t.rows.length)),e.table.setAttribute("aria-colcount",String(t.columns.length));let s="",i="";function d(h,c){const m=new Set;for(const p of Z(h,t,e.component,c??{}))for(const w of n.cells(p))m.add(w);return[...m]}return{component:e.component,update(h,c,m){const p=X(h,e.component),w=d(p,m),y=c&&r.get(`${c.rowIndex}:${c.columnIndex}`);y&&!w.includes(y)&&w.push(y),w.sort((b,$)=>b.ri-$.ri||b.ci-$.ci);const C=w.map(b=>`${b.ri}:${b.ci}`).join(";"),S=a(p),v=S.map(b=>`${b.kind}:${b.pos}:${b.from}:${b.to}`).join(";"),E=C!==s,T=v!==i;return E&&(s=C,J(e,w,o,l)),T&&(i=v,e.edgeHost.replaceChildren(...e.drawEdges(S))),E||T}}}const L=new WeakMap,te={root:"mr-root",page:"mr-page",comp:"mr-comp",text:"mr-text",lines:"mr-lines",line:"mr-line",rich:"mr-rich",paragraph:"mr-paragraph",segment:"mr-segment",image:"mr-image",shape:"mr-shape",grid:"mr-grid",row:"mr-row",cell:"mr-cell",unknown:"mr-unknown"};function g(e,t){return t?.classNames?.[e]??te[e]}class ne{constructor(){this.props=[]}add(t,r){return r==null||r===!1||r===""?this:(this.props.push([t,String(r)]),this)}mm(t,r,n,o=2){return this.add(t,`${f.round(f.mmToPx(r,n),o)}px`)}toString(){let t="";for(const[r,n]of this.props)t+=`${r}:${n};`;return t}applyTo(t){const r=this.toString();r&&(t.style.cssText=r)}}function u(e,t="unset"){return new ne().add("all",t).add("display",e).add("box-sizing","border-box")}function H(e,t,r){e.add("color",t.color).add("font-family",t.fontFamily).add("font-weight",t.bold!=null?t.bold?"700":"400":void 0).add("font-style",t.italic!=null?t.italic?"italic":"normal":void 0).add("text-decoration",t.underline!=null?t.underline?"underline":"none":void 0).add("letter-spacing",t.letterSpacing!=null?`${t.letterSpacing}pt`:void 0).add("line-height",String(f.resolveLineHeight(t))).add("text-align",t.align);const n=f.resolveFontSize(t,r);e.add("font-size",`${f.round(n.fontSizePx,2)}px`)}function re(e,t,r){const n=t.style??{};H(e,n,r);const o=!t.grid&&(t.kind==="ellipse"||t.kind==="line");e.add("background-color",o?void 0:n.backgroundColor).add("opacity",n.opacity!=null?String(n.opacity):void 0).add("transform",n.rotateDeg?`rotate(${n.rotateDeg}deg)`:void 0)}function P(e,t,r,n,o,l){const a=e.cell,s=l.createElement("td");s.className=g("cell",o),B.setDomCellAddress(s,e.ri,e.ci),s.setAttribute("role",t.table?.role==="header"?"columnheader":"cell"),a.colSpan&&(s.colSpan=a.colSpan),a.rowSpan&&(s.rowSpan=a.rowSpan);const i=f.resolveGridCellStyle(t.style,a),d=u("block").add("position","absolute").mm("left",e.xMm,n).mm("top",e.yMm,n).mm("width",e.widthMm,n).mm("height",e.heightMm,n).add("background-color",i.backgroundColor).add("vertical-align",i.verticalAlign??"middle");H(d,i,n),d.applyTo(s);const h=V.dataBarBox(a.dataBar,e.widthMm,e.heightMm,r);if(h){const m=l.createElement("div");m.className="mr-cell-data-bar",m.setAttribute("aria-hidden","true"),u("block").add("position","absolute").mm("left",h.x,n).mm("top",h.y,n).mm("width",h.width,n).mm("height",h.height,n).add("background-color",h.color).add("opacity","0.35").add("pointer-events","none").applyTo(m),s.appendChild(m)}const c=l.createElement("div");c.className="mr-cell-content",u("flex").add("position","absolute").mm("left",r+(a.indentMm??0),n).mm("right",r,n).mm("top",r,n).mm("bottom",r,n).add("flex-direction","column").add("justify-content",i.verticalAlign==="top"?"flex-start":i.verticalAlign==="bottom"?"flex-end":"center").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(c),a.richParagraphs?.length?c.appendChild(I({...t,kind:"text",richParagraphs:a.richParagraphs},n,o,l)):a.text!=null&&c.append(a.text);for(const m of a.children??[])c.appendChild(x(m,n,o,l));return s.insertBefore(c,s.firstChild),s}function oe(e,t,r,n){return O(D.resolveGridStrokes(e,t),r,n)}function ie(e,t){const r=e.cell;if(!(r.children?.length||r.richParagraphs?.length||r.dataBar||(r.colSpan??1)!==1||(r.rowSpan??1)!==1))return JSON.stringify([r.style,r.indentMm,f.gridCellAlignment(t,r)])}function le(e,t,r){if(e.style.position!=="absolute"||e.style.zIndex||e.style.transform||e.children.length!==1)return!1;const n=e.firstElementChild;return!(n instanceof HTMLElement)||n.className!=="mr-cell-content"?!1:(B.setDomCellAddress(e,t.ri,t.ci),e.style.left=`${f.round(f.mmToPx(t.xMm,r),2)}px`,e.style.top=`${f.round(f.mmToPx(t.yMm,r),2)}px`,e.style.width=`${f.round(f.mmToPx(t.widthMm,r),2)}px`,e.style.height=`${f.round(f.mmToPx(t.heightMm,r),2)}px`,n.textContent=t.cell.text??"",!0)}function O(e,t,r){return e.map(n=>{const o=`${f.round(n.widthPt*t/72,2)}px solid ${n.color}`,l=r.createElement("div");l.className="mr-grid-edge",l.setAttribute("aria-hidden","true");const a=n.kind==="h";return u("block").add("position","absolute").add("pointer-events","none").mm("left",a?n.from:n.pos,t).mm("top",a?n.pos:n.from,t).mm("width",a?n.to-n.from:0,t).mm("height",a?0:n.to-n.from,t).add(a?"border-top":"border-left",o).applyTo(l),l})}function ae(e,t,r,n,o){const l=o.createElement("table");l.className=g("grid",n),l.setAttribute("role","table"),u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(l);const a=o.createElement("tbody");u("contents").applyTo(a),l.appendChild(a);const s=t.style?.rotateDeg?void 0:L.get(n);if(s){const c=o.createElement("div");u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(c);const m=o.createElement("div");return u("contents").applyTo(m),m.setAttribute("aria-hidden","true"),s.mount({grid:e,component:t,table:l,rowClass:g("row",n),body:a,edgeHost:m,drawCell:p=>P(p,t,e.paddingMm??.5,r,{...n},o),reuseKey:p=>ie(p,t.style),reuseCell:(p,w)=>le(p,w,r),drawEdges:p=>O(p,r,o)}),c.append(l,m),c}const i=f.resolveGridLayout(e,t.widthMm,t.heightMm),d=e.cells.map(()=>{const c=o.createElement("tr");return c.className=g("row",n),c.setAttribute("role","row"),u("contents").applyTo(c),a.appendChild(c),c});for(const c of i.cells)d[c.ri].appendChild(P(c,t,e.paddingMm??.5,r,n,o));const h=o.createElement("div");return u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(h),h.append(l,...oe(i,t,r,o)),h}function se(e,t,r,n){const o=n.createElement("div");o.className=g("paragraph",r),u("block").add("text-align",e.align).add("line-height",e.lineHeight!=null?String(e.lineHeight):void 0).mm("margin-top",e.spaceBeforeMm??0,t).mm("margin-bottom",e.spaceAfterMm??0,t).mm("text-indent",e.indentMm??0,t).applyTo(o);for(const l of e.segments||[]){const a=n.createElement("span");a.className=g("segment",r),a.textContent=l.kind==="field"?l.field??"":l.text??"";const s=u("inline");if(l.style){const i=l.style;s.add("color",i.color).add("background-color",i.backgroundColor).add("font-family",i.fontFamily).add("line-height",i.lineHeight).add("letter-spacing",i.letterSpacing==null?void 0:`${i.letterSpacing*t/72}px`).add("font-weight",i.bold!=null?i.bold?"700":"400":void 0).add("font-style",i.italic!=null?i.italic?"italic":"normal":void 0).add("text-decoration",i.underline!=null?i.underline?"underline":"none":void 0),(i.fontSize!=null||i.fontSizePx!=null)&&s.add("font-size",`${f.round(f.resolveFontSize(i,t).fontSizePx,2)}px`)}s.applyTo(a),o.appendChild(a)}return o}function I(e,t,r,n){if(f.isRichText(e)){const o=n.createElement("div");o.className=g("rich",r),u("block").applyTo(o);for(const l of e.richParagraphs)o.appendChild(se(l,t,r,n));return o}if(Array.isArray(e.lines)&&e.lines.length>0){const o=n.createElement("div");o.className=g("lines",r),u("block").applyTo(o);for(const l of e.lines){const a=n.createElement("div");a.className=g("line",r),a.textContent=l,u("block").add("white-space","pre").add("min-height","1lh").applyTo(a),o.appendChild(a)}return o}return e.text??""}function de(e,t,r,n){const o=n.createElement("div");o.className=g("text",r);const l=e.style||{};return u("flex").add("width","100%").add("height","100%").add("flex-direction","column").add("justify-content",l.verticalAlign==="middle"?"center":l.verticalAlign==="bottom"?"flex-end":"flex-start").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(o),o.append(I(e,t,r,n)),o}function ce(e,t,r){const n=r.createElement("img");return n.className=g("image",t),n.src=e.imageData,u("block").add("width","100%").add("height","100%").add("object-fit","contain").applyTo(n),n.alt=e.kind,n}function N(e,t,r,n){const o=n.createElement("div");o.className=g("shape",r);const l=e.style||{},a=f.resolveStroke(l),s=f.resolveBoxBorders(l),i=`${f.round(a.widthPt*t/72,2)}px solid ${a.color}`,d=u("block");return e.grid?d.add("position","relative"):e.kind==="rect"?(s.top&&d.add("border-top",i),s.right&&d.add("border-right",i),s.bottom&&d.add("border-bottom",i),s.left&&d.add("border-left",i)):e.kind==="ellipse"?(d.add("border-radius","50%"),s.inner&&d.add("border",i),l.backgroundColor&&d.add("background-color",l.backgroundColor)):e.kind==="line"&&d.add("height","0").add("border-top",i),d.add("box-sizing","border-box").add("width","100%").add("height","100%"),d.applyTo(o),o}function he(e,t,r){const n=r.createElementNS("http://www.w3.org/2000/svg","svg"),o=f.mmToPx(e.widthMm,t),l=f.mmToPx(e.heightMm,t);n.setAttribute("width",String(Math.max(1,o))),n.setAttribute("height",String(Math.max(1,l))),n.setAttribute("aria-hidden","true"),n.style.overflow="visible",n.style.display="block";const a=r.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1","0"),a.setAttribute("x2",String(o)),a.setAttribute("y1",e.lineDirection==="up"?String(l):"0"),a.setAttribute("y2",e.lineDirection==="up"?"0":String(l));const s=f.resolveStroke({...e.style,borderColor:e.style?.lineColor??e.style?.borderColor});return a.setAttribute("stroke",s.color),a.setAttribute("stroke-width",String(s.widthPt*t/72)),n.appendChild(a),n}function x(e,t,r,n){const o=n.createElement("div");o.className=`${g("comp",r)} mr-kind-${e.kind}`;const l=u("block").add("position","absolute").mm("left",e.leftMm,t).mm("top",e.topMm,t).mm("width",e.widthMm,t).mm("height",e.heightMm,t).add("box-sizing","border-box");if(re(l,e,t),l.applyTo(o),f.isImageBackedComponent(e))return o.appendChild(ce(e,r,n)),o;if(e.kind==="text")return o.appendChild(de(e,t,r,n)),o;if(e.grid){const s=N(e,t,r,n);return s.appendChild(ae(e.grid,e,t,r,n)),o.appendChild(s),o}if(e.kind==="line"&&e.lineDirection)return o.appendChild(he(e,t,n)),o;if(e.kind==="line"||e.kind==="rect"||e.kind==="ellipse")return o.appendChild(N(e,t,r,n)),o;const a=n.createElement("div");return a.className=g("unknown",r),u("block").applyTo(a),a.textContent=e.fallbackText??`[${e.kind}]`,a.dataset.mrUnsupported=e.kind,a.setAttribute("role","note"),o.appendChild(a),o}function k(e,t,r,n){const o=n.createElement("div");return o.className=g("page",r),u("block","initial").add("position","relative").add("font-family",f.DEFAULT_FONT_FAMILY).add("font-size",`${f.round(f.resolveFontSize(void 0,t).fontSizePx,2)}px`).add("line-height",String(f.resolveLineHeight(void 0))).add("white-space","pre-wrap").add("direction","ltr").mm("width",e.pageWidthMm,t).mm("height",e.pageHeightMm,t).add("background-color","#fff").add("color",f.DEFAULT_TEXT_COLOR).add("overflow","hidden").add("box-sizing","border-box").applyTo(o),e.components.forEach((l,a)=>{const s=x(l,t,r,n);s.dataset.mrComponentIndex=String(a),o.appendChild(s)}),o}function me(e,t,r={}){const n=r.dpi??96;R.reportOutputDiagnostics(e,"dom",r);const o=t.createElement("div");return o.className=g("root",r),u("block").applyTo(o),o.dataset.schemaVersion=e.schemaVersion,e.pages.forEach(l=>{o.appendChild(k(l,n,r,t))}),o}function fe(e,t,r,n){const o={...r},l=W();return L.set(o,l),{element:k(e,t,o,n),update(s,i,d){return l.update(s,i&&e.components[i.componentIndex],i,d)}}}exports.classOf=g;exports.collectTemplateOutline=K;exports.createPageViewportRenderer=fe;exports.inspectTemplateFieldUsage=q;exports.renderComponent=x;exports.renderPage=k;exports.renderPlan=me;exports.templatePathLocation=F;
|