@agile-team/mach-report 2.22.0 → 2.23.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 +7 -6
- package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +98 -45
- package/dist/designer.d.ts +98 -45
- package/dist/designer.js +3 -3
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1642 -1586
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +24 -0
- package/dist/vue/async.d.ts +24 -0
- package/dist/vue/index.d.cts +25 -1
- package/dist/vue/index.d.ts +25 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { b as P } from "./template-serialization-CWmHq7lX.js";
|
|
2
|
+
import { d as U } from "./data-bar-IkI6VvMQ.js";
|
|
3
|
+
import { s as B } from "./dom-cell-address-Fn-8nk7D.js";
|
|
4
|
+
import { r as D, i as _, d as F, e as W, l as y, s as b, b as G, a as k, f as X, m as Y, D as J, g as q } from "./progress-ByiOxUD3.js";
|
|
5
|
+
import { r as H } from "./grid-strokes-EoY66L2f.js";
|
|
6
|
+
import { r as Q } from "./capabilities-pg7j7VLT.js";
|
|
7
|
+
function Z(e) {
|
|
8
|
+
const t = /\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);
|
|
9
|
+
return t ? {
|
|
10
|
+
pageIndex: Number(t[1]),
|
|
11
|
+
...t[2] === void 0 ? {} : { componentIndex: Number(t[2]) }
|
|
12
|
+
} : {};
|
|
13
|
+
}
|
|
14
|
+
function $e(e, t, r) {
|
|
15
|
+
return P(e).filter((n) => n.dataset === t).flatMap(
|
|
16
|
+
(n) => n.fields.filter((o) => o.field === r).map((o) => ({
|
|
17
|
+
...o,
|
|
18
|
+
...Z(o.path),
|
|
19
|
+
dataset: t,
|
|
20
|
+
kind: /\.computed\[/.test(o.path) ? "calculation" : /\.columns\[\d+\]\.field$/.test(o.path) ? "display" : "binding"
|
|
21
|
+
}))
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function ee(e, t) {
|
|
25
|
+
const r = e.kind === "list" ? e.title || e.dataset : e.binding?.field || e.text || e.nid;
|
|
26
|
+
return `${e.kind} · ${(r || String(t + 1)).replace(/\s+/g, " ").slice(0, 80)}`;
|
|
27
|
+
}
|
|
28
|
+
function Te(e) {
|
|
29
|
+
const t = P(e), r = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const o of t)
|
|
31
|
+
for (const l of o.fields) {
|
|
32
|
+
const a = /^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(
|
|
33
|
+
l.path
|
|
34
|
+
)?.[0];
|
|
35
|
+
if (!a) continue;
|
|
36
|
+
const s = r.get(a) ?? [];
|
|
37
|
+
s.push({ ...l, dataset: o.dataset }), r.set(a, s);
|
|
38
|
+
}
|
|
39
|
+
const n = [];
|
|
40
|
+
return e.pages.forEach((o, l) => {
|
|
41
|
+
const a = `$.template.pages[${l}]`;
|
|
42
|
+
n.push({
|
|
43
|
+
path: a,
|
|
44
|
+
pageIndex: l,
|
|
45
|
+
kind: "page",
|
|
46
|
+
depth: 0,
|
|
47
|
+
title: typeof o.meta?.title == "string" ? o.meta.title : `${l + 1} · ${o.widthMm} × ${o.heightMm} mm`
|
|
48
|
+
}), o.components.forEach((s, i) => {
|
|
49
|
+
const d = `${a}.components[${i}]`, h = { pageIndex: l, componentIndex: i };
|
|
50
|
+
n.push({
|
|
51
|
+
path: d,
|
|
52
|
+
...h,
|
|
53
|
+
depth: 1,
|
|
54
|
+
kind: "component",
|
|
55
|
+
title: ee(s, i)
|
|
56
|
+
}), s.kind === "list" && (s.columns.forEach(
|
|
57
|
+
(m, g) => n.push({
|
|
58
|
+
path: `${d}.columns[${g}].field`,
|
|
59
|
+
...h,
|
|
60
|
+
depth: 2,
|
|
61
|
+
kind: "field",
|
|
62
|
+
title: `${m.header} · ${m.field}`,
|
|
63
|
+
field: m.field,
|
|
64
|
+
dataset: s.dataset
|
|
65
|
+
})
|
|
66
|
+
), s.computed?.forEach(
|
|
67
|
+
(m, g) => n.push({
|
|
68
|
+
path: `${d}.computed[${g}]`,
|
|
69
|
+
...h,
|
|
70
|
+
depth: 2,
|
|
71
|
+
kind: "calculation",
|
|
72
|
+
title: m.field,
|
|
73
|
+
field: m.field,
|
|
74
|
+
dataset: s.dataset
|
|
75
|
+
})
|
|
76
|
+
));
|
|
77
|
+
const c = /* @__PURE__ */ new Set();
|
|
78
|
+
for (const m of r.get(d) ?? [])
|
|
79
|
+
/\.columns\[\d+\]\.field$/.test(m.path) || c.has(m.path) || (c.add(m.path), n.push({
|
|
80
|
+
...m,
|
|
81
|
+
...h,
|
|
82
|
+
depth: 2,
|
|
83
|
+
kind: "binding",
|
|
84
|
+
title: m.field
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
}), n;
|
|
88
|
+
}
|
|
89
|
+
function x(e, t, r) {
|
|
90
|
+
let n = 0, o = e.length;
|
|
91
|
+
for (; n < o; ) {
|
|
92
|
+
const l = n + o >>> 1;
|
|
93
|
+
r(e[l]) < t ? n = l + 1 : o = l;
|
|
94
|
+
}
|
|
95
|
+
return n;
|
|
96
|
+
}
|
|
97
|
+
function L(e) {
|
|
98
|
+
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.");
|
|
99
|
+
return e;
|
|
100
|
+
}
|
|
101
|
+
function te(e) {
|
|
102
|
+
const t = e.rows.map(() => []);
|
|
103
|
+
for (const r of e.cells) {
|
|
104
|
+
const n = Math.min(t.length, r.ri + (r.cell.rowSpan ?? 1));
|
|
105
|
+
for (let o = r.ri; o < n; o++) t[o].push(r);
|
|
106
|
+
}
|
|
107
|
+
for (const r of t) r.sort((n, o) => n.xMm - o.xMm);
|
|
108
|
+
return {
|
|
109
|
+
cells(r) {
|
|
110
|
+
L(r);
|
|
111
|
+
const n = /* @__PURE__ */ new Set(), o = r.topMm + r.heightMm, l = r.leftMm + r.widthMm;
|
|
112
|
+
let a = x(e.rows, r.topMm, (s) => s.pos + s.size);
|
|
113
|
+
for (; a < t.length && e.rows[a].pos <= o; ) {
|
|
114
|
+
const s = t[a++];
|
|
115
|
+
let i = x(s, r.leftMm, (d) => d.xMm + d.widthMm);
|
|
116
|
+
for (; i < s.length && s[i].xMm <= l; ) n.add(s[i++]);
|
|
117
|
+
}
|
|
118
|
+
return [...n].sort((s, i) => s.ri - i.ri || s.ci - i.ci);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function ne(e) {
|
|
123
|
+
const t = ["h", "v"].map((r) => e.filter((n) => n.kind === r).sort((n, o) => n.pos - o.pos));
|
|
124
|
+
return (r) => {
|
|
125
|
+
const n = [];
|
|
126
|
+
return t.forEach((o, l) => {
|
|
127
|
+
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);
|
|
128
|
+
let h = x(o, a, (c) => c.pos);
|
|
129
|
+
for (; h < o.length && o[h].pos <= s; ) {
|
|
130
|
+
const c = o[h++];
|
|
131
|
+
c.to >= i && c.from <= d && n.push(c);
|
|
132
|
+
}
|
|
133
|
+
}), n;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function re() {
|
|
137
|
+
const e = [];
|
|
138
|
+
return {
|
|
139
|
+
mount(t) {
|
|
140
|
+
e.push(de(t));
|
|
141
|
+
},
|
|
142
|
+
update(t, r, n, o) {
|
|
143
|
+
L(t);
|
|
144
|
+
let l = !1;
|
|
145
|
+
for (const a of e) l = a.update(t, a.component === r ? n : void 0, o) || l;
|
|
146
|
+
return l;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function oe(e, t) {
|
|
151
|
+
const r = Math.max(8, e.widthMm / 4), n = Math.max(8, e.heightMm / 4);
|
|
152
|
+
return {
|
|
153
|
+
leftMm: e.leftMm - t.leftMm - r,
|
|
154
|
+
topMm: e.topMm - t.topMm - n,
|
|
155
|
+
widthMm: e.widthMm + 2 * r,
|
|
156
|
+
heightMm: e.heightMm + 2 * n
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function ie(e, t, r) {
|
|
160
|
+
let n = t.get(r);
|
|
161
|
+
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;
|
|
162
|
+
}
|
|
163
|
+
function le(e, t, r, n) {
|
|
164
|
+
const o = new Set(t), l = new Set(t.map((i) => i.ri)), a = /* @__PURE__ */ new Map();
|
|
165
|
+
for (const [i, d] of r) if (!o.has(i)) {
|
|
166
|
+
d.remove(), r.delete(i);
|
|
167
|
+
const h = e.reuseKey?.(i);
|
|
168
|
+
if (h !== void 0) {
|
|
169
|
+
const c = a.get(h) ?? [];
|
|
170
|
+
c.push(d), a.set(h, c);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
for (const [i, d] of n) l.has(i) || (d.remove(), n.delete(i));
|
|
174
|
+
for (const i of t) {
|
|
175
|
+
let d = r.get(i);
|
|
176
|
+
if (!d) {
|
|
177
|
+
const c = e.reuseKey?.(i), m = c === void 0 ? void 0 : a.get(c)?.pop();
|
|
178
|
+
d = m && e.reuseCell?.(m, i) ? m : e.drawCell(i), d.setAttribute("aria-colindex", String(i.ci + 1)), r.set(i, d);
|
|
179
|
+
}
|
|
180
|
+
const h = ie(e, n, i.ri);
|
|
181
|
+
d.parentElement !== h && h.appendChild(d);
|
|
182
|
+
}
|
|
183
|
+
const s = /* @__PURE__ */ new Map();
|
|
184
|
+
for (const i of t) {
|
|
185
|
+
const d = s.get(i.ri) ?? [];
|
|
186
|
+
d.push(r.get(i)), s.set(i.ri, d);
|
|
187
|
+
}
|
|
188
|
+
for (const [i, d] of s) A(n.get(i), d);
|
|
189
|
+
A(e.body, [...l].sort((i, d) => i - d).map((i) => n.get(i)));
|
|
190
|
+
}
|
|
191
|
+
function A(e, t) {
|
|
192
|
+
let r = e.firstElementChild;
|
|
193
|
+
for (const n of t)
|
|
194
|
+
n === r ? r = r.nextElementSibling : e.insertBefore(n, r);
|
|
195
|
+
}
|
|
196
|
+
function ae(e, t) {
|
|
197
|
+
return e.table?.role === "header" ? e.heightMm : t.rows[0]?.size ?? 0;
|
|
198
|
+
}
|
|
199
|
+
function se(e, t, r, n) {
|
|
200
|
+
const o = [e], l = n.freezeHeaders && (r.table?.role === "header" || !r.table), a = ae(r, t);
|
|
201
|
+
l && o.push({ ...e, topMm: 0, heightMm: Math.max(0, a - 1e-4) });
|
|
202
|
+
const s = Math.max(0, Math.min(20, Math.floor(n.frozenColumns ?? 0))) || 0;
|
|
203
|
+
if (!s || !t.columns.length) return o;
|
|
204
|
+
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) };
|
|
205
|
+
return o.push(d), l && o.push({ ...d, topMm: 0, heightMm: Math.max(0, a - 1e-4) }), o;
|
|
206
|
+
}
|
|
207
|
+
function de(e) {
|
|
208
|
+
const t = D(e.grid, e.component.widthMm, e.component.heightMm), r = new Map(t.cells.map((h) => [`${h.ri}:${h.ci}`, h])), n = te(t), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), a = ne(H(t, e.component));
|
|
209
|
+
e.table.setAttribute("aria-rowcount", String(t.rows.length)), e.table.setAttribute("aria-colcount", String(t.columns.length));
|
|
210
|
+
let s = "", i = "";
|
|
211
|
+
function d(h, c) {
|
|
212
|
+
const m = /* @__PURE__ */ new Set();
|
|
213
|
+
for (const g of se(h, t, e.component, c ?? {})) for (const w of n.cells(g)) m.add(w);
|
|
214
|
+
return [...m];
|
|
215
|
+
}
|
|
216
|
+
return { component: e.component, update(h, c, m) {
|
|
217
|
+
const g = oe(h, e.component), w = d(g, m), M = c && r.get(`${c.rowIndex}:${c.columnIndex}`);
|
|
218
|
+
M && !w.includes(M) && w.push(M), w.sort((p, T) => p.ri - T.ri || p.ci - T.ci);
|
|
219
|
+
const C = w.map((p) => `${p.ri}:${p.ci}`).join(";"), S = a(g), v = S.map((p) => `${p.kind}:${p.pos}:${p.from}:${p.to}`).join(";"), E = C !== s, $ = v !== i;
|
|
220
|
+
return E && (s = C, le(e, w, o, l)), $ && (i = v, e.edgeHost.replaceChildren(...e.drawEdges(S))), E || $;
|
|
221
|
+
} };
|
|
222
|
+
}
|
|
223
|
+
const I = /* @__PURE__ */ new WeakMap(), ce = {
|
|
224
|
+
root: "mr-root",
|
|
225
|
+
page: "mr-page",
|
|
226
|
+
comp: "mr-comp",
|
|
227
|
+
text: "mr-text",
|
|
228
|
+
lines: "mr-lines",
|
|
229
|
+
line: "mr-line",
|
|
230
|
+
rich: "mr-rich",
|
|
231
|
+
paragraph: "mr-paragraph",
|
|
232
|
+
segment: "mr-segment",
|
|
233
|
+
image: "mr-image",
|
|
234
|
+
shape: "mr-shape",
|
|
235
|
+
grid: "mr-grid",
|
|
236
|
+
row: "mr-row",
|
|
237
|
+
cell: "mr-cell",
|
|
238
|
+
unknown: "mr-unknown"
|
|
239
|
+
};
|
|
240
|
+
function u(e, t) {
|
|
241
|
+
return t?.classNames?.[e] ?? ce[e];
|
|
242
|
+
}
|
|
243
|
+
class he {
|
|
244
|
+
constructor() {
|
|
245
|
+
this.props = [];
|
|
246
|
+
}
|
|
247
|
+
add(t, r) {
|
|
248
|
+
return r == null || r === !1 || r === "" ? this : (this.props.push([t, String(r)]), this);
|
|
249
|
+
}
|
|
250
|
+
mm(t, r, n, o = 2) {
|
|
251
|
+
return this.add(t, `${b(y(r, n), o)}px`);
|
|
252
|
+
}
|
|
253
|
+
toString() {
|
|
254
|
+
let t = "";
|
|
255
|
+
for (const [r, n] of this.props)
|
|
256
|
+
t += `${r}:${n};`;
|
|
257
|
+
return t;
|
|
258
|
+
}
|
|
259
|
+
applyTo(t) {
|
|
260
|
+
const r = this.toString();
|
|
261
|
+
r && (t.style.cssText = r);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function f(e, t = "unset") {
|
|
265
|
+
return new he().add("all", t).add("display", e).add("box-sizing", "border-box");
|
|
266
|
+
}
|
|
267
|
+
function O(e, t, r) {
|
|
268
|
+
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(G(t))).add("text-align", t.align);
|
|
269
|
+
const n = k(t, r);
|
|
270
|
+
e.add("font-size", `${b(n.fontSizePx, 2)}px`);
|
|
271
|
+
}
|
|
272
|
+
function me(e, t, r) {
|
|
273
|
+
const n = t.style ?? {};
|
|
274
|
+
O(e, n, r);
|
|
275
|
+
const o = !t.grid && (t.kind === "ellipse" || t.kind === "line");
|
|
276
|
+
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);
|
|
277
|
+
}
|
|
278
|
+
function N(e, t, r, n, o, l) {
|
|
279
|
+
const a = e.cell, s = l.createElement("td");
|
|
280
|
+
s.className = u("cell", o), B(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);
|
|
281
|
+
const i = Y(t.style, a.style), d = f("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");
|
|
282
|
+
O(d, i, n), d.applyTo(s);
|
|
283
|
+
const h = U(a.dataBar, e.widthMm, e.heightMm, r);
|
|
284
|
+
if (h) {
|
|
285
|
+
const m = l.createElement("div");
|
|
286
|
+
m.className = "mr-cell-data-bar", m.setAttribute("aria-hidden", "true"), f("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);
|
|
287
|
+
}
|
|
288
|
+
const c = l.createElement("div");
|
|
289
|
+
c.className = "mr-cell-content", f("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(R({ ...t, kind: "text", richParagraphs: a.richParagraphs }, n, o, l)) : a.text != null && c.append(a.text);
|
|
290
|
+
for (const m of a.children ?? []) c.appendChild(j(m, n, o, l));
|
|
291
|
+
return s.insertBefore(c, s.firstChild), s;
|
|
292
|
+
}
|
|
293
|
+
function fe(e, t, r, n) {
|
|
294
|
+
return V(H(e, t), r, n);
|
|
295
|
+
}
|
|
296
|
+
function ue(e) {
|
|
297
|
+
const t = e.cell;
|
|
298
|
+
if (!(t.children?.length || t.richParagraphs?.length || t.dataBar || (t.colSpan ?? 1) !== 1 || (t.rowSpan ?? 1) !== 1))
|
|
299
|
+
return JSON.stringify([t.style, t.indentMm]);
|
|
300
|
+
}
|
|
301
|
+
function ge(e, t, r) {
|
|
302
|
+
if (e.style.position !== "absolute" || e.style.zIndex || e.style.transform || e.children.length !== 1) return !1;
|
|
303
|
+
const n = e.firstElementChild;
|
|
304
|
+
return !(n instanceof HTMLElement) || n.className !== "mr-cell-content" ? !1 : (B(e, t.ri, t.ci), e.style.left = `${b(y(t.xMm, r), 2)}px`, e.style.top = `${b(y(t.yMm, r), 2)}px`, e.style.width = `${b(y(t.widthMm, r), 2)}px`, e.style.height = `${b(y(t.heightMm, r), 2)}px`, n.textContent = t.cell.text ?? "", !0);
|
|
305
|
+
}
|
|
306
|
+
function V(e, t, r) {
|
|
307
|
+
return e.map((n) => {
|
|
308
|
+
const o = `${b(n.widthPt * t / 72, 2)}px solid ${n.color}`, l = r.createElement("div");
|
|
309
|
+
l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
|
|
310
|
+
const a = n.kind === "h";
|
|
311
|
+
return f("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;
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
function pe(e, t, r, n, o) {
|
|
315
|
+
const l = o.createElement("table");
|
|
316
|
+
l.className = u("grid", n), l.setAttribute("role", "table"), f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(l);
|
|
317
|
+
const a = o.createElement("tbody");
|
|
318
|
+
f("contents").applyTo(a), l.appendChild(a);
|
|
319
|
+
const s = t.style?.rotateDeg ? void 0 : I.get(n);
|
|
320
|
+
if (s) {
|
|
321
|
+
const c = o.createElement("div");
|
|
322
|
+
f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c);
|
|
323
|
+
const m = o.createElement("div");
|
|
324
|
+
return f("contents").applyTo(m), m.setAttribute("aria-hidden", "true"), s.mount({
|
|
325
|
+
grid: e,
|
|
326
|
+
component: t,
|
|
327
|
+
table: l,
|
|
328
|
+
rowClass: u("row", n),
|
|
329
|
+
body: a,
|
|
330
|
+
edgeHost: m,
|
|
331
|
+
drawCell: (g) => N(g, t, e.paddingMm ?? 0.5, r, { ...n }, o),
|
|
332
|
+
reuseKey: ue,
|
|
333
|
+
reuseCell: (g, w) => ge(g, w, r),
|
|
334
|
+
drawEdges: (g) => V(g, r, o)
|
|
335
|
+
}), c.append(l, m), c;
|
|
336
|
+
}
|
|
337
|
+
const i = D(e, t.widthMm, t.heightMm), d = e.cells.map(() => {
|
|
338
|
+
const c = o.createElement("tr");
|
|
339
|
+
return c.className = u("row", n), c.setAttribute("role", "row"), f("contents").applyTo(c), a.appendChild(c), c;
|
|
340
|
+
});
|
|
341
|
+
for (const c of i.cells)
|
|
342
|
+
d[c.ri].appendChild(N(c, t, e.paddingMm ?? 0.5, r, n, o));
|
|
343
|
+
const h = o.createElement("div");
|
|
344
|
+
return f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(h), h.append(l, ...fe(i, t, r, o)), h;
|
|
345
|
+
}
|
|
346
|
+
function be(e, t, r, n) {
|
|
347
|
+
const o = n.createElement("div");
|
|
348
|
+
o.className = u("paragraph", r), f("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);
|
|
349
|
+
for (const l of e.segments || []) {
|
|
350
|
+
const a = n.createElement("span");
|
|
351
|
+
a.className = u("segment", r), a.textContent = l.kind === "field" ? l.field ?? "" : l.text ?? "";
|
|
352
|
+
const s = f("inline");
|
|
353
|
+
if (l.style) {
|
|
354
|
+
const i = l.style;
|
|
355
|
+
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", `${b(k(i, t).fontSizePx, 2)}px`);
|
|
356
|
+
}
|
|
357
|
+
s.applyTo(a), o.appendChild(a);
|
|
358
|
+
}
|
|
359
|
+
return o;
|
|
360
|
+
}
|
|
361
|
+
function R(e, t, r, n) {
|
|
362
|
+
if (X(e)) {
|
|
363
|
+
const o = n.createElement("div");
|
|
364
|
+
o.className = u("rich", r), f("block").applyTo(o);
|
|
365
|
+
for (const l of e.richParagraphs) o.appendChild(be(l, t, r, n));
|
|
366
|
+
return o;
|
|
367
|
+
}
|
|
368
|
+
if (Array.isArray(e.lines) && e.lines.length > 0) {
|
|
369
|
+
const o = n.createElement("div");
|
|
370
|
+
o.className = u("lines", r), f("block").applyTo(o);
|
|
371
|
+
for (const l of e.lines) {
|
|
372
|
+
const a = n.createElement("div");
|
|
373
|
+
a.className = u("line", r), a.textContent = l, f("block").add("white-space", "pre").add("min-height", "1lh").applyTo(a), o.appendChild(a);
|
|
374
|
+
}
|
|
375
|
+
return o;
|
|
376
|
+
}
|
|
377
|
+
return e.text ?? "";
|
|
378
|
+
}
|
|
379
|
+
function we(e, t, r, n) {
|
|
380
|
+
const o = n.createElement("div");
|
|
381
|
+
o.className = u("text", r);
|
|
382
|
+
const l = e.style || {};
|
|
383
|
+
return f("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(R(e, t, r, n)), o;
|
|
384
|
+
}
|
|
385
|
+
function ye(e, t, r) {
|
|
386
|
+
const n = r.createElement("img");
|
|
387
|
+
return n.className = u("image", t), n.src = e.imageData, f("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(n), n.alt = e.kind, n;
|
|
388
|
+
}
|
|
389
|
+
function z(e, t, r, n) {
|
|
390
|
+
const o = n.createElement("div");
|
|
391
|
+
o.className = u("shape", r);
|
|
392
|
+
const l = e.style || {}, a = F(l), s = W(l), i = `${b(a.widthPt * t / 72, 2)}px solid ${a.color}`, d = f("block");
|
|
393
|
+
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;
|
|
394
|
+
}
|
|
395
|
+
function Me(e, t, r) {
|
|
396
|
+
const n = r.createElementNS("http://www.w3.org/2000/svg", "svg"), o = y(e.widthMm, t), l = y(e.heightMm, t);
|
|
397
|
+
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";
|
|
398
|
+
const a = r.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
399
|
+
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));
|
|
400
|
+
const s = F({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
|
|
401
|
+
return a.setAttribute("stroke", s.color), a.setAttribute("stroke-width", String(s.widthPt * t / 72)), n.appendChild(a), n;
|
|
402
|
+
}
|
|
403
|
+
function j(e, t, r, n) {
|
|
404
|
+
const o = n.createElement("div");
|
|
405
|
+
o.className = `${u("comp", r)} mr-kind-${e.kind}`;
|
|
406
|
+
const l = f("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");
|
|
407
|
+
if (me(l, e, t), l.applyTo(o), _(e))
|
|
408
|
+
return o.appendChild(ye(e, r, n)), o;
|
|
409
|
+
if (e.kind === "text")
|
|
410
|
+
return o.appendChild(we(e, t, r, n)), o;
|
|
411
|
+
if (e.grid) {
|
|
412
|
+
const s = z(e, t, r, n);
|
|
413
|
+
return s.appendChild(pe(e.grid, e, t, r, n)), o.appendChild(s), o;
|
|
414
|
+
}
|
|
415
|
+
if (e.kind === "line" && e.lineDirection)
|
|
416
|
+
return o.appendChild(Me(e, t, n)), o;
|
|
417
|
+
if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
|
|
418
|
+
return o.appendChild(z(e, t, r, n)), o;
|
|
419
|
+
const a = n.createElement("div");
|
|
420
|
+
return a.className = u("unknown", r), f("block").applyTo(a), a.textContent = e.fallbackText ?? `[${e.kind}]`, a.dataset.mrUnsupported = e.kind, a.setAttribute("role", "note"), o.appendChild(a), o;
|
|
421
|
+
}
|
|
422
|
+
function K(e, t, r, n) {
|
|
423
|
+
const o = n.createElement("div");
|
|
424
|
+
return o.className = u("page", r), f("block", "initial").add("position", "relative").add("font-family", J).add("font-size", `${b(k(void 0, t).fontSizePx, 2)}px`).add("line-height", String(G(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", q).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(o), e.components.forEach((l, a) => {
|
|
425
|
+
const s = j(l, t, r, n);
|
|
426
|
+
s.dataset.mrComponentIndex = String(a), o.appendChild(s);
|
|
427
|
+
}), o;
|
|
428
|
+
}
|
|
429
|
+
function Ae(e, t, r = {}) {
|
|
430
|
+
const n = r.dpi ?? 96;
|
|
431
|
+
Q(e, "dom", r);
|
|
432
|
+
const o = t.createElement("div");
|
|
433
|
+
return o.className = u("root", r), f("block").applyTo(o), o.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((l) => {
|
|
434
|
+
o.appendChild(K(l, n, r, t));
|
|
435
|
+
}), o;
|
|
436
|
+
}
|
|
437
|
+
function Ne(e, t, r, n) {
|
|
438
|
+
const o = { ...r }, l = re();
|
|
439
|
+
return I.set(o, l), { element: K(e, t, o, n), update(s, i, d) {
|
|
440
|
+
return l.update(s, i && e.components[i.componentIndex], i, d);
|
|
441
|
+
} };
|
|
442
|
+
}
|
|
443
|
+
export {
|
|
444
|
+
Te as a,
|
|
445
|
+
Ne as b,
|
|
446
|
+
u as c,
|
|
447
|
+
K as d,
|
|
448
|
+
Ae as e,
|
|
449
|
+
$e as i,
|
|
450
|
+
j as r,
|
|
451
|
+
Z as t
|
|
452
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=Symbol.for("@agile-team/mach-report/dom-cell-address");function d(e,t,s){e.dataset.mrRowIndex=String(t),e.dataset.mrColumnIndex=String(s),e[r]={rowIndex:t,columnIndex:s}}function o(e){return e[r]}exports.getDomCellAddress=o;exports.setDomCellAddress=d;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const r = /* @__PURE__ */ Symbol.for("@agile-team/mach-report/dom-cell-address");
|
|
2
|
+
function a(t, e, s) {
|
|
3
|
+
t.dataset.mrRowIndex = String(e), t.dataset.mrColumnIndex = String(s), t[r] = { rowIndex: e, columnIndex: s };
|
|
4
|
+
}
|
|
5
|
+
function o(t) {
|
|
6
|
+
return t[r];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
o as g,
|
|
10
|
+
a as s
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./runtime-
|
|
1
|
+
"use strict";const s=require("./runtime-DKlGd_D4.cjs"),e=require("./protocol-B9YgfQ_d.cjs");async function a(r,t){try{if(r.operation!=="exportPrepared")throw new TypeError("内置编码 Worker 仅接受 exportPrepared");return await e.runReportWorkerRequest(s.createReportRuntime({reports:{},budget:r.budget}),r,t)}catch(o){return{protocol:e.REPORT_WORKER_PROTOCOL,id:r.id,error:e.serializeError(o)}}}function R(r=globalThis){const t=o=>{if(!e.isReportWorkerRequest(o.data))return;const i=o.data;a(i,n=>r.postMessage({protocol:e.REPORT_WORKER_PROTOCOL,id:i.id,type:"event",event:n})).then(n=>r.postMessage(n,e.reportWorkerTransferList(n)))};return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}exports.serveReportEncodingWorker=R;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as n } from "./runtime-
|
|
2
|
-
import { i, a as p, r as d, R as a, s as R } from "./protocol-
|
|
1
|
+
import { c as n } from "./runtime-75Y5Oq5B.js";
|
|
2
|
+
import { i, a as p, r as d, R as a, s as R } from "./protocol-DxeUKGYG.js";
|
|
3
3
|
async function u(r, e) {
|
|
4
4
|
try {
|
|
5
5
|
if (r.operation !== "exportPrepared") throw new TypeError("内置编码 Worker 仅接受 exportPrepared");
|
|
@@ -139,7 +139,7 @@ function I(t) {
|
|
|
139
139
|
const a = String.fromCharCode(...t.subarray(0, 4));
|
|
140
140
|
if (!["\0\0\0", "true", "OTTO", "wOFF", "wOF2", "ttcf"].includes(a))
|
|
141
141
|
throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");
|
|
142
|
-
const { default: r } = await import("./pdf-
|
|
142
|
+
const { default: r } = await import("./pdf-aobetCsy.js").then((i) => i.f), o = r.create(t);
|
|
143
143
|
if (!Number.isFinite(o.unitsPerEm) || o.unitsPerEm <= 0 || !o.characterSet?.length || !o.numGlyphs)
|
|
144
144
|
throw new Error("字体结构无效或不含可嵌入的单字体;请提供有效的 TTF/OTF/WOFF 文件");
|
|
145
145
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=new Map;let b=0,d={maxFonts:8,maxBytes:64*1024*1024,maxFontBytes:24*1024*1024};function O(){for(;f.size>d.maxFonts||b>d.maxBytes;){const t=f.keys().next().value;b-=f.get(t).byteLength,f.delete(t)}}function W(t){const e={...d,...t};if(!Object.values(e).every(n=>Number.isSafeInteger(n)&&n>0))throw new Error("字体缓存预算应为正整数字节/数量");d=e;for(const[n,a]of f)a.byteLength>d.maxFontBytes&&B(n);O()}function p(){return{fonts:f.size,bytes:b,...d}}function j(t){const e=f.get(t);return e&&(f.delete(t),f.set(t,e)),e}function B(t){const e=f.get(t);e&&(b-=e.byteLength),f.delete(t)}function q(){f.clear(),b=0}function H(t,e){B(t),!(e.byteLength>d.maxBytes||e.byteLength>d.maxFontBytes)&&(f.set(t,e),b+=e.byteLength,O())}const V="mach-report-fonts",u="fonts";function $(){return new Promise((t,e)=>{const n=indexedDB.open(V,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(u)||n.result.createObjectStore(u)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error)})}function M(t){if(t instanceof Uint8Array)return{bytes:t,accessedAt:0};const e=t;return e?.bytes instanceof Uint8Array&&Number.isFinite(e.accessedAt)?e:void 0}async function C(t,e){if(typeof indexedDB>"u")return t;let n;try{return n=await $(),await e(n)}catch{return t}finally{n?.close()}}function G(t){return C(null,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u),i=o.get(t);let c=null;i.onsuccess=()=>{const s=M(i.result);s&&s.bytes.byteLength<=p().maxFontBytes?(c=s.bytes,o.put({bytes:s.bytes,accessedAt:Date.now()},t)):i.result!==void 0&&o.delete(t)},r.oncomplete=()=>n(c),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}function J(t,e,n,a){const r=p(),o=e.filter(s=>s.key!==n);t.delete(n),a.byteLength<=Math.min(r.maxFontBytes,r.maxBytes)&&o.unshift({key:n,bytes:a.byteLength,accessedAt:Date.now()}),o.sort((s,h)=>h.accessedAt-s.accessedAt);let i=0,c=0;for(const s of o){if(c>=r.maxFonts||i+s.bytes>r.maxBytes||s.bytes>r.maxFontBytes){t.delete(s.key);continue}i+=s.bytes,c++,s.key===n&&t.put({bytes:a,accessedAt:s.accessedAt},n)}}function _(t,e){return C(void 0,n=>new Promise((a,r)=>{const o=n.transaction(u,"readwrite"),i=o.objectStore(u),c=i.openCursor(),s=[];c.onsuccess=()=>{const h=c.result;if(!h){J(i,s,t,e);return}const x=M(h.value);x?s.push({key:h.key,bytes:x.bytes.byteLength,accessedAt:x.accessedAt}):h.delete(),h.continue()},o.oncomplete=()=>a(),o.onerror=()=>r(o.error),o.onabort=()=>r(o.error)}))}function D(t){return C(void 0,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u);t===void 0?o.clear():o.delete(t),r.oncomplete=()=>n(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}let L=0,S=0,v=Promise.resolve();const g=new Map;async function N(t){l.set(t,(l.get(t)??0)+1),B(t),w.delete(t);const e=g.get(t),n=(async()=>{await v,await e,await y.get(t),await D(t)})();g.set(t,n);try{await n}finally{g.get(t)===n&&g.delete(t)}}async function I(){L++,q(),w.clear(),l.clear();const t=v,e=(async()=>{await t,await Promise.all(y.values()),await D()})();v=e.catch(()=>{}),await e}const l=new Map,y=new Map,w=new Map,E=new Set;function k(){!S&&!E.size&&l.clear()}const T=new WeakMap;function K(t){const e=new TextDecoder().decode(t.subarray(0,256));return/^\s*(?:\uFEFF)?\s*<(?:!doctype\s+html|html|head|body)(?:\s|>)/i.test(e)}function R(t){if(t.byteLength===0)throw new Error("字体文件为空");if(K(t))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件")}function Q(t){const e=T.get(t);if(e)return e;const n=(async()=>{const a=String.fromCharCode(...t.subarray(0,4));if(!["\0\0\0","true","OTTO","wOFF","wOF2","ttcf"].includes(a))throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");const{default:r}=await Promise.resolve().then(()=>require("./pdf-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=new Map;let b=0,d={maxFonts:8,maxBytes:64*1024*1024,maxFontBytes:24*1024*1024};function O(){for(;f.size>d.maxFonts||b>d.maxBytes;){const t=f.keys().next().value;b-=f.get(t).byteLength,f.delete(t)}}function W(t){const e={...d,...t};if(!Object.values(e).every(n=>Number.isSafeInteger(n)&&n>0))throw new Error("字体缓存预算应为正整数字节/数量");d=e;for(const[n,a]of f)a.byteLength>d.maxFontBytes&&B(n);O()}function p(){return{fonts:f.size,bytes:b,...d}}function j(t){const e=f.get(t);return e&&(f.delete(t),f.set(t,e)),e}function B(t){const e=f.get(t);e&&(b-=e.byteLength),f.delete(t)}function q(){f.clear(),b=0}function H(t,e){B(t),!(e.byteLength>d.maxBytes||e.byteLength>d.maxFontBytes)&&(f.set(t,e),b+=e.byteLength,O())}const V="mach-report-fonts",u="fonts";function $(){return new Promise((t,e)=>{const n=indexedDB.open(V,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(u)||n.result.createObjectStore(u)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error)})}function M(t){if(t instanceof Uint8Array)return{bytes:t,accessedAt:0};const e=t;return e?.bytes instanceof Uint8Array&&Number.isFinite(e.accessedAt)?e:void 0}async function C(t,e){if(typeof indexedDB>"u")return t;let n;try{return n=await $(),await e(n)}catch{return t}finally{n?.close()}}function G(t){return C(null,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u),i=o.get(t);let c=null;i.onsuccess=()=>{const s=M(i.result);s&&s.bytes.byteLength<=p().maxFontBytes?(c=s.bytes,o.put({bytes:s.bytes,accessedAt:Date.now()},t)):i.result!==void 0&&o.delete(t)},r.oncomplete=()=>n(c),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}function J(t,e,n,a){const r=p(),o=e.filter(s=>s.key!==n);t.delete(n),a.byteLength<=Math.min(r.maxFontBytes,r.maxBytes)&&o.unshift({key:n,bytes:a.byteLength,accessedAt:Date.now()}),o.sort((s,h)=>h.accessedAt-s.accessedAt);let i=0,c=0;for(const s of o){if(c>=r.maxFonts||i+s.bytes>r.maxBytes||s.bytes>r.maxFontBytes){t.delete(s.key);continue}i+=s.bytes,c++,s.key===n&&t.put({bytes:a,accessedAt:s.accessedAt},n)}}function _(t,e){return C(void 0,n=>new Promise((a,r)=>{const o=n.transaction(u,"readwrite"),i=o.objectStore(u),c=i.openCursor(),s=[];c.onsuccess=()=>{const h=c.result;if(!h){J(i,s,t,e);return}const x=M(h.value);x?s.push({key:h.key,bytes:x.bytes.byteLength,accessedAt:x.accessedAt}):h.delete(),h.continue()},o.oncomplete=()=>a(),o.onerror=()=>r(o.error),o.onabort=()=>r(o.error)}))}function D(t){return C(void 0,e=>new Promise((n,a)=>{const r=e.transaction(u,"readwrite"),o=r.objectStore(u);t===void 0?o.clear():o.delete(t),r.oncomplete=()=>n(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)}))}let L=0,S=0,v=Promise.resolve();const g=new Map;async function N(t){l.set(t,(l.get(t)??0)+1),B(t),w.delete(t);const e=g.get(t),n=(async()=>{await v,await e,await y.get(t),await D(t)})();g.set(t,n);try{await n}finally{g.get(t)===n&&g.delete(t)}}async function I(){L++,q(),w.clear(),l.clear();const t=v,e=(async()=>{await t,await Promise.all(y.values()),await D()})();v=e.catch(()=>{}),await e}const l=new Map,y=new Map,w=new Map,E=new Set;function k(){!S&&!E.size&&l.clear()}const T=new WeakMap;function K(t){const e=new TextDecoder().decode(t.subarray(0,256));return/^\s*(?:\uFEFF)?\s*<(?:!doctype\s+html|html|head|body)(?:\s|>)/i.test(e)}function R(t){if(t.byteLength===0)throw new Error("字体文件为空");if(K(t))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件")}function Q(t){const e=T.get(t);if(e)return e;const n=(async()=>{const a=String.fromCharCode(...t.subarray(0,4));if(!["\0\0\0","true","OTTO","wOFF","wOF2","ttcf"].includes(a))throw new Error("文件内容不是支持的 TTF/OTF/WOFF 字体(可能返回了 JSON 或文本)");const{default:r}=await Promise.resolve().then(()=>require("./pdf-HiEeXe9H.cjs")).then(i=>i.fontkit_es),o=r.create(t);if(!Number.isFinite(o.unitsPerEm)||o.unitsPerEm<=0||!o.characterSet?.length||!o.numGlyphs)throw new Error("字体结构无效或不含可嵌入的单字体;请提供有效的 TTF/OTF/WOFF 文件")})();return T.set(t,n),n}function A(t,e,n=!1){const a=n?"字体加载超时,请检查网络或字体服务":e instanceof Error?e.message:String(e);return Object.assign(new Error(`PDF 字体 ${JSON.stringify(t)} 加载失败:${a}`),{cause:e})}function P(t,e){if(t>e)throw new Error(`字体文件超过单字体下载预算(${e}字节)`)}async function X(t,e,n){const a=Number(t.headers?.get("content-length"));try{Number.isFinite(a)&&P(a,e)}catch(r){throw t.body?.cancel(r).catch(()=>{}),r}if(!t.body){const r=new Uint8Array(await F(t.arrayBuffer(),n));return P(r.byteLength,e),r}return U(t.body,e,n)}async function U(t,e,n){const a=t.getReader(),r=[];let o=0;try{for(;;){const s=await F(a.read(),n);if(s.done)break;o+=s.value.byteLength,P(o,e),r.push(s.value)}const i=new Uint8Array(o);let c=0;for(const s of r)i.set(s,c),c+=s.byteLength;return i}catch(i){throw a.cancel(i).catch(()=>{}),i}finally{a.releaseLock()}}async function Y(t,e,n){if(t[0]!==31||t[1]!==139)return t;if(typeof DecompressionStream>"u")throw new Error("当前环境不支持 gzip 字体解压,请使用未压缩的字体 URL 或支持 DecompressionStream 的浏览器 / Node 环境");const r=new ReadableStream({start(o){o.enqueue(t),o.close()}}).pipeThrough(new DecompressionStream("gzip"));return U(r,e,n)}async function Z(t){const e=new AbortController;let n=!1;const a=setTimeout(()=>{n=!0,e.abort()},15e3);try{const r=await fetch(t,{signal:e.signal});if(!r.ok)throw new Error(`字体请求返回 HTTP ${r.status}`);if(/text\/html|application\/xhtml\+xml/i.test(r.headers?.get("content-type")??""))throw new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件");const o=p().maxFontBytes,i=await X(r,o,e.signal),c=await Y(i,o,e.signal);return R(c),{bytes:c,fromCache:!1}}catch(r){throw e.abort(),A(t,r,n)}finally{clearTimeout(a)}}async function tt(t){await v,await g.get(t);const e=await G(t);if(e)try{return R(e),{bytes:e,fromCache:!0}}catch{}return Z(t)}function et(t){const e=w.get(t);if(e)return e;const n=tt(t);w.set(t,n),E.add(n);const a=()=>{w.get(t)===n&&w.delete(t),E.delete(n),k()};return n.then(a,a),n}async function nt(t,e,n,a){if((l.get(t)??0)!==n||L!==a)return;H(t,e);const r=y.get(t);if(r){await r;return}const o=_(t,e);y.set(t,o),await o,y.get(t)===o&&y.delete(t)}function m(t){return t.reason??new DOMException("字体加载已取消","AbortError")}function F(t,e){return e?e.aborted?Promise.reject(m(e)):new Promise((n,a)=>{const r=()=>{e.removeEventListener("abort",r),a(m(e))};e.addEventListener("abort",r,{once:!0}),t.then(o=>{e.removeEventListener("abort",r),n(o)},o=>{e.removeEventListener("abort",r),a(o)})}):t}async function rt(t,e,n,a,r){try{return await F(Q(e.bytes),n.signal),e.bytes}catch(o){if(n.signal?.aborted)throw m(n.signal);if((l.get(t)??0)!==a||L!==r)throw A(t,o);if(await N(t),e.fromCache)return await z(t,n);throw A(t,o)}}async function z(t,e={}){if(e.signal?.aborted)throw m(e.signal);const n=l.get(t)??0,a=L,r=j(t);if(r&&!e.strict)return r;const o=r?void 0:et(t);S++;try{const i=r?{bytes:r,fromCache:!0}:await F(o,e.signal),c=e.strict?await rt(t,i,e,n,a):i.bytes;if(e.signal?.aborted)throw m(e.signal);return r||await F(nt(t,c,n,a),e.signal),c}catch(i){if(e.signal?.aborted)throw m(e.signal);if(e.strict)throw i;return null}finally{S--,k()}}exports.clearFontCache=I;exports.configureFontCache=W;exports.getFontCacheStats=p;exports.invalidateFontCache=N;exports.loadFontWithCache=z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("./progress-WomPRP3B.cjs"),w=["borderTop","borderRight","borderBottom","borderLeft","borderColor","lineColor","lineWidthPt"];function k(r,o){const s=h.resolveBoxBorders(o.style),e=s.inner?[...r.edges]:[];s.top&&e.push({kind:"h",pos:0,from:0,to:o.widthMm}),s.bottom&&e.push({kind:"h",pos:o.heightMm,from:0,to:o.widthMm}),s.left&&e.push({kind:"v",pos:0,from:0,to:o.heightMm}),s.right&&e.push({kind:"v",pos:o.widthMm,from:0,to:o.heightMm});const t=h.resolveStroke(o.style);return e.map(n=>({...n,...t}))}function g(r,o,s){const e=r.get(o);(!e||s.widthPt>e.widthPt)&&r.set(o,s)}function d(r,o,s,e,t,n){const l=s<o.rows.length?o.rows[s].pos:o.rows[o.rows.length-1].pos+o.rows[o.rows.length-1].size;for(let i=e;i<t;i++){const c=o.columns[i];g(r,`h:${s}:${i}`,{kind:"h",pos:l,from:c.pos,to:c.pos+c.size,...n})}}function m(r,o,s,e,t,n){const l=s<o.columns.length?o.columns[s].pos:o.columns[o.columns.length-1].pos+o.columns[o.columns.length-1].size;for(let i=e;i<t;i++){const c=o.rows[i];g(r,`v:${s}:${i}`,{kind:"v",pos:l,from:c.pos,to:c.pos+c.size,...n})}}function p(r,o,s,e){const t=Math.min(o.columns.length,s.ci+(s.cell.colSpan??1)),n=Math.min(o.rows.length,s.ri+(s.cell.rowSpan??1)),l=h.mergeComponentStyles(e,s.cell.style),i=h.resolveBoxBorders(l),c=h.resolveStroke(l);i.top&&d(r,o,s.ri,s.ci,t,c),i.bottom&&d(r,o,n,s.ci,t,c),i.left&&m(r,o,s.ci,s.ri,n,c),i.right&&m(r,o,t,s.ri,n,c)}function v(r){const o=[...r.values()].sort((e,t)=>e.kind.localeCompare(t.kind)||e.pos-t.pos||e.from-t.from),s=[];for(const e of o){const t=s[s.length-1];t&&t.kind===e.kind&&t.pos===e.pos&&Math.abs(t.to-e.from)<1e-6&&t.color===e.color&&t.widthPt===e.widthPt?t.to=e.to:s.push({...e})}return s}function S(r,o){if(!r.cells.some(({cell:n})=>w.some(l=>n.style?.[l]!==void 0)))return k(r,o);const s=new Map,e=new Set,t=r.columns.length;for(const n of r.cells){p(s,r,n,o.style);const l=Math.min(r.rows.length,n.ri+(n.cell.rowSpan??1)),i=Math.min(t,n.ci+(n.cell.colSpan??1));for(let c=n.ri;c<l;c++)for(let f=n.ci;f<i;f++)e.add(c*t+f)}for(let n=0;n<r.rows.length;n++)for(let l=0;l<t;l++)e.has(n*t+l)||p(s,r,{ri:n,ci:l,cell:{}},o.style);return v(s)}exports.resolveGridStrokes=S;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { e as p, d as g, m as k } from "./progress-ByiOxUD3.js";
|
|
2
|
+
const S = ["borderTop", "borderRight", "borderBottom", "borderLeft", "borderColor", "lineColor", "lineWidthPt"];
|
|
3
|
+
function v(r, o) {
|
|
4
|
+
const s = p(o.style), t = s.inner ? [...r.edges] : [];
|
|
5
|
+
s.top && t.push({ kind: "h", pos: 0, from: 0, to: o.widthMm }), s.bottom && t.push({ kind: "h", pos: o.heightMm, from: 0, to: o.widthMm }), s.left && t.push({ kind: "v", pos: 0, from: 0, to: o.heightMm }), s.right && t.push({ kind: "v", pos: o.widthMm, from: 0, to: o.heightMm });
|
|
6
|
+
const e = g(o.style);
|
|
7
|
+
return t.map((n) => ({ ...n, ...e }));
|
|
8
|
+
}
|
|
9
|
+
function w(r, o, s) {
|
|
10
|
+
const t = r.get(o);
|
|
11
|
+
(!t || s.widthPt > t.widthPt) && r.set(o, s);
|
|
12
|
+
}
|
|
13
|
+
function f(r, o, s, t, e, n) {
|
|
14
|
+
const l = s < o.rows.length ? o.rows[s].pos : o.rows[o.rows.length - 1].pos + o.rows[o.rows.length - 1].size;
|
|
15
|
+
for (let i = t; i < e; i++) {
|
|
16
|
+
const c = o.columns[i];
|
|
17
|
+
w(r, `h:${s}:${i}`, { kind: "h", pos: l, from: c.pos, to: c.pos + c.size, ...n });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function m(r, o, s, t, e, n) {
|
|
21
|
+
const l = s < o.columns.length ? o.columns[s].pos : o.columns[o.columns.length - 1].pos + o.columns[o.columns.length - 1].size;
|
|
22
|
+
for (let i = t; i < e; i++) {
|
|
23
|
+
const c = o.rows[i];
|
|
24
|
+
w(r, `v:${s}:${i}`, { kind: "v", pos: l, from: c.pos, to: c.pos + c.size, ...n });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function d(r, o, s, t) {
|
|
28
|
+
const e = Math.min(o.columns.length, s.ci + (s.cell.colSpan ?? 1)), n = Math.min(o.rows.length, s.ri + (s.cell.rowSpan ?? 1)), l = k(t, s.cell.style), i = p(l), c = g(l);
|
|
29
|
+
i.top && f(r, o, s.ri, s.ci, e, c), i.bottom && f(r, o, n, s.ci, e, c), i.left && m(r, o, s.ci, s.ri, n, c), i.right && m(r, o, e, s.ri, n, c);
|
|
30
|
+
}
|
|
31
|
+
function M(r) {
|
|
32
|
+
const o = [...r.values()].sort((t, e) => t.kind.localeCompare(e.kind) || t.pos - e.pos || t.from - e.from), s = [];
|
|
33
|
+
for (const t of o) {
|
|
34
|
+
const e = s[s.length - 1];
|
|
35
|
+
e && e.kind === t.kind && e.pos === t.pos && Math.abs(e.to - t.from) < 1e-6 && e.color === t.color && e.widthPt === t.widthPt ? e.to = t.to : s.push({ ...t });
|
|
36
|
+
}
|
|
37
|
+
return s;
|
|
38
|
+
}
|
|
39
|
+
function z(r, o) {
|
|
40
|
+
if (!r.cells.some(({ cell: n }) => S.some((l) => n.style?.[l] !== void 0))) return v(r, o);
|
|
41
|
+
const s = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), e = r.columns.length;
|
|
42
|
+
for (const n of r.cells) {
|
|
43
|
+
d(s, r, n, o.style);
|
|
44
|
+
const l = Math.min(r.rows.length, n.ri + (n.cell.rowSpan ?? 1)), i = Math.min(e, n.ci + (n.cell.colSpan ?? 1));
|
|
45
|
+
for (let c = n.ri; c < l; c++) for (let h = n.ci; h < i; h++) t.add(c * e + h);
|
|
46
|
+
}
|
|
47
|
+
for (let n = 0; n < r.rows.length; n++) for (let l = 0; l < e; l++)
|
|
48
|
+
t.has(n * e + l) || d(s, r, { ri: n, ci: l, cell: {} }, o.style);
|
|
49
|
+
return M(s);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
z as r
|
|
53
|
+
};
|