@agile-team/mach-report 2.7.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import { i as J, D as Y, a as Me, b as xe } from "./render-plan-uzZYYSy1.js";
2
- import { c as On, d as zn, e as jn, L as Hn, R as Wn, S as Bn } from "./render-plan-uzZYYSy1.js";
3
- import { v as Ge } from "./report-source-BXHNy_AD.js";
4
- import { P as Kn, R as Vn, c as qn, d as Gn, a as Un, e as Jn, f as Yn, p as Xn, b as Qn, t as Zn, g as er } from "./report-source-BXHNy_AD.js";
5
- import { r as O, a as z, b as X, c as H, d as Te, m as re, e as Ee, p as D, f as Se, P as G } from "./style-Dv5o_x6b.js";
6
- import { C as nr, M as rr, g as ir, h as or } from "./style-Dv5o_x6b.js";
7
- import { a as sr, v as lr, b as cr, c as dr } from "./validate-S6CgIm5d.js";
8
- import { h as ie, w as Ce } from "./textwrap-DOl04hCQ.js";
9
- import { c as mr, a as fr, b as hr, m as gr } from "./textwrap-DOl04hCQ.js";
10
- import { r as W, o as Ue } from "./progress-DD964VAB.js";
11
- import { r as Pe, a as oe } from "./assets-B9qJku3V.js";
12
- import { O as wr } from "./assets-B9qJku3V.js";
13
- import { r as B, n as ke, O as Je } from "./capabilities-joSutDF8.js";
14
- import { i as vr } from "./capabilities-joSutDF8.js";
15
- import { c as Ye } from "./page-window-index-CIuT4BAv.js";
16
- import { p as ne } from "./template-registry-NpOakidD.js";
17
- import { R as Mr, a as xr, c as Tr, d as Er, s as Sr, v as Cr, b as Pr } from "./template-registry-NpOakidD.js";
18
- import { R as Rr, a as Ir, i as Ar, r as $r, v as Nr, b as Lr } from "./param-validation-BWNjLcN0.js";
19
- import { f as Xe, i as Qe } from "./number-format-BA_KwrZe.js";
20
- const Ze = {
1
+ import { i as Q, D as ee, a as Pe, b as Re } from "./render-plan-uzZYYSy1.js";
2
+ import { c as or, d as ar, e as sr, L as lr, R as cr, S as dr } from "./render-plan-uzZYYSy1.js";
3
+ import { v as et } from "./report-source-BXHNy_AD.js";
4
+ import { P as mr, R as fr, c as hr, d as gr, a as pr, e as wr, f as br, p as vr, b as yr, t as xr, g as Mr } from "./report-source-BXHNy_AD.js";
5
+ import { r as H, a as j, b as te, c as B, d as Ae, m as se, e as ke, p as L, f as $e, P as Y } from "./style-Dv5o_x6b.js";
6
+ import { C as Sr, M as Tr, g as Cr, h as Ir } from "./style-Dv5o_x6b.js";
7
+ import { a as Rr, v as Ar, b as kr, c as $r } from "./validate-S6CgIm5d.js";
8
+ import { h as le, w as Ne } from "./textwrap-DOl04hCQ.js";
9
+ import { c as Fr, a as Or, b as Dr, m as Lr } from "./textwrap-DOl04hCQ.js";
10
+ import { r as K, o as tt } from "./progress-DD964VAB.js";
11
+ import { r as Fe, a as ce } from "./assets-B9qJku3V.js";
12
+ import { O as Hr } from "./assets-B9qJku3V.js";
13
+ import { r as V, n as Oe, O as nt } from "./capabilities-joSutDF8.js";
14
+ import { i as Wr } from "./capabilities-joSutDF8.js";
15
+ import { c as rt } from "./page-window-index-CIuT4BAv.js";
16
+ import { p as ae } from "./template-registry-NpOakidD.js";
17
+ import { R as _r, a as Kr, c as Vr, d as Gr, s as Ur, v as qr, b as Jr } from "./template-registry-NpOakidD.js";
18
+ import { R as Xr, a as Zr, i as Qr, r as ei, v as ti, b as ni } from "./param-validation-BWNjLcN0.js";
19
+ import { f as it, i as ot } from "./number-format-BA_KwrZe.js";
20
+ const at = {
21
21
  root: "mr-root",
22
22
  page: "mr-page",
23
23
  comp: "mr-comp",
@@ -34,10 +34,10 @@ const Ze = {
34
34
  cell: "mr-cell",
35
35
  unknown: "mr-unknown"
36
36
  };
37
- function S(e, t) {
38
- return t?.classNames?.[e] ?? Ze[e];
37
+ function C(e, t) {
38
+ return t?.classNames?.[e] ?? at[e];
39
39
  }
40
- class et {
40
+ class st {
41
41
  constructor() {
42
42
  this.props = [];
43
43
  }
@@ -45,7 +45,7 @@ class et {
45
45
  return n == null || n === !1 || n === "" ? this : (this.props.push([t, String(n)]), this);
46
46
  }
47
47
  mm(t, n, r, i = 2) {
48
- return this.add(t, `${O(re(n, r), i)}px`);
48
+ return this.add(t, `${H(se(n, r), i)}px`);
49
49
  }
50
50
  toString() {
51
51
  let t = "";
@@ -58,522 +58,522 @@ class et {
58
58
  n && (t.style.cssText = n);
59
59
  }
60
60
  }
61
- function y(e, t = "unset") {
62
- return new et().add("all", t).add("display", e).add("box-sizing", "border-box");
61
+ function x(e, t = "unset") {
62
+ return new st().add("all", t).add("display", e).add("box-sizing", "border-box");
63
63
  }
64
- function Re(e, t, n) {
65
- 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(X(t))).add("text-align", t.align);
66
- const r = z(t, n);
67
- e.add("font-size", `${O(r.fontSizePx, 2)}px`);
64
+ function De(e, t, n) {
65
+ 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(te(t))).add("text-align", t.align);
66
+ const r = j(t, n);
67
+ e.add("font-size", `${H(r.fontSizePx, 2)}px`);
68
68
  }
69
- function tt(e, t, n) {
69
+ function lt(e, t, n) {
70
70
  const r = t.style ?? {};
71
- Re(e, r, n), e.add("background-color", r.backgroundColor).add("opacity", r.opacity != null ? String(r.opacity) : void 0).add("transform", r.rotateDeg ? `rotate(${r.rotateDeg}deg)` : void 0);
72
- }
73
- function nt(e, t, n, r, i, l) {
74
- const o = e.cell, a = l.createElement("td");
75
- a.className = S("cell", i), a.dataset.mrRowIndex = String(e.ri), a.dataset.mrColumnIndex = String(e.ci), a.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), o.colSpan && (a.colSpan = o.colSpan), o.rowSpan && (a.rowSpan = o.rowSpan);
76
- const s = Ee(t.style, o.style), c = y("block").add("position", "absolute").mm("left", e.xMm, r).mm("top", e.yMm, r).mm("width", e.widthMm, r).mm("height", e.heightMm, r).add("background-color", s.backgroundColor).add("vertical-align", s.verticalAlign ?? "middle");
77
- Re(c, s, r), c.applyTo(a);
78
- const d = l.createElement("div");
79
- d.className = "mr-cell-content", y("flex").add("position", "absolute").mm("left", n, r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", s.verticalAlign === "top" ? "flex-start" : s.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(d), o.text != null && d.append(o.text);
80
- for (const u of o.children ?? []) d.appendChild(Ie(u, r, i, l));
81
- return a.appendChild(d), a;
82
- }
83
- function rt(e, t, n, r) {
84
- return Pe(e, t).map((i) => {
85
- const l = `${O(i.widthPt * n / 72, 2)}px solid ${i.color}`, o = r.createElement("div");
86
- o.className = "mr-grid-edge", o.setAttribute("aria-hidden", "true");
87
- const a = i.kind === "h";
88
- return y("block").add("position", "absolute").add("pointer-events", "none").mm("left", a ? i.from : i.pos, n).mm("top", a ? i.pos : i.from, n).mm("width", a ? i.to - i.from : 0, n).mm("height", a ? 0 : i.to - i.from, n).add(a ? "border-top" : "border-left", l).applyTo(o), o;
71
+ De(e, r, n), e.add("background-color", r.backgroundColor).add("opacity", r.opacity != null ? String(r.opacity) : void 0).add("transform", r.rotateDeg ? `rotate(${r.rotateDeg}deg)` : void 0);
72
+ }
73
+ function ct(e, t, n, r, i, s) {
74
+ const l = e.cell, o = s.createElement("td");
75
+ o.className = C("cell", i), o.dataset.mrRowIndex = String(e.ri), o.dataset.mrColumnIndex = String(e.ci), o.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), l.colSpan && (o.colSpan = l.colSpan), l.rowSpan && (o.rowSpan = l.rowSpan);
76
+ const a = ke(t.style, l.style), c = x("block").add("position", "absolute").mm("left", e.xMm, r).mm("top", e.yMm, r).mm("width", e.widthMm, r).mm("height", e.heightMm, r).add("background-color", a.backgroundColor).add("vertical-align", a.verticalAlign ?? "middle");
77
+ De(c, a, r), c.applyTo(o);
78
+ const d = s.createElement("div");
79
+ d.className = "mr-cell-content", x("flex").add("position", "absolute").mm("left", n, r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", a.verticalAlign === "top" ? "flex-start" : a.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(d), l.text != null && d.append(l.text);
80
+ for (const u of l.children ?? []) d.appendChild(Le(u, r, i, s));
81
+ return o.appendChild(d), o;
82
+ }
83
+ function dt(e, t, n, r) {
84
+ return Fe(e, t).map((i) => {
85
+ const s = `${H(i.widthPt * n / 72, 2)}px solid ${i.color}`, l = r.createElement("div");
86
+ l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
87
+ const o = i.kind === "h";
88
+ return x("block").add("position", "absolute").add("pointer-events", "none").mm("left", o ? i.from : i.pos, n).mm("top", o ? i.pos : i.from, n).mm("width", o ? i.to - i.from : 0, n).mm("height", o ? 0 : i.to - i.from, n).add(o ? "border-top" : "border-left", s).applyTo(l), l;
89
89
  });
90
90
  }
91
- function it(e, t, n, r, i) {
92
- const l = i.createElement("table");
93
- l.className = S("grid", r), l.setAttribute("role", "table"), y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(l);
94
- const o = W(e, t.widthMm, t.heightMm), a = i.createElement("tbody");
95
- y("contents").applyTo(a), l.appendChild(a);
96
- const s = e.cells.map(() => {
91
+ function ut(e, t, n, r, i) {
92
+ const s = i.createElement("table");
93
+ s.className = C("grid", r), s.setAttribute("role", "table"), x("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(s);
94
+ const l = K(e, t.widthMm, t.heightMm), o = i.createElement("tbody");
95
+ x("contents").applyTo(o), s.appendChild(o);
96
+ const a = e.cells.map(() => {
97
97
  const d = i.createElement("tr");
98
- return d.className = S("row", r), d.setAttribute("role", "row"), y("contents").applyTo(d), a.appendChild(d), d;
98
+ return d.className = C("row", r), d.setAttribute("role", "row"), x("contents").applyTo(d), o.appendChild(d), d;
99
99
  });
100
- for (const d of o.cells)
101
- s[d.ri].appendChild(nt(d, t, e.paddingMm ?? 0.5, n, r, i));
100
+ for (const d of l.cells)
101
+ a[d.ri].appendChild(ct(d, t, e.paddingMm ?? 0.5, n, r, i));
102
102
  const c = i.createElement("div");
103
- return y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(l, ...rt(o, t, n, i)), c;
103
+ return x("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(s, ...dt(l, t, n, i)), c;
104
104
  }
105
- function ot(e, t, n, r) {
105
+ function mt(e, t, n, r) {
106
106
  const i = r.createElement("div");
107
- i.className = S("paragraph", n), y("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(i);
108
- for (const l of e.segments || []) {
109
- const o = r.createElement("span");
110
- o.className = S("segment", n), o.textContent = l.kind === "field" ? l.field ?? "" : l.text ?? "";
111
- const a = y("inline");
112
- if (l.style) {
113
- const s = l.style;
114
- a.add("color", s.color).add("font-family", s.fontFamily).add("font-weight", s.bold != null ? s.bold ? "700" : "400" : void 0).add("font-style", s.italic != null ? s.italic ? "italic" : "normal" : void 0).add("text-decoration", s.underline != null ? s.underline ? "underline" : "none" : void 0), (s.fontSize != null || s.fontSizePx != null) && a.add("font-size", `${O(z(s, t).fontSizePx, 2)}px`);
107
+ i.className = C("paragraph", n), x("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(i);
108
+ for (const s of e.segments || []) {
109
+ const l = r.createElement("span");
110
+ l.className = C("segment", n), l.textContent = s.kind === "field" ? s.field ?? "" : s.text ?? "";
111
+ const o = x("inline");
112
+ if (s.style) {
113
+ const a = s.style;
114
+ o.add("color", a.color).add("font-family", a.fontFamily).add("font-weight", a.bold != null ? a.bold ? "700" : "400" : void 0).add("font-style", a.italic != null ? a.italic ? "italic" : "normal" : void 0).add("text-decoration", a.underline != null ? a.underline ? "underline" : "none" : void 0), (a.fontSize != null || a.fontSizePx != null) && o.add("font-size", `${H(j(a, t).fontSizePx, 2)}px`);
115
115
  }
116
- a.applyTo(o), i.appendChild(o);
116
+ o.applyTo(l), i.appendChild(l);
117
117
  }
118
118
  return i;
119
119
  }
120
- function at(e, t, n, r) {
121
- if (xe(e)) {
120
+ function ft(e, t, n, r) {
121
+ if (Re(e)) {
122
122
  const i = r.createElement("div");
123
- i.className = S("rich", n), y("block").applyTo(i);
124
- for (const l of e.richParagraphs) i.appendChild(ot(l, t, n, r));
123
+ i.className = C("rich", n), x("block").applyTo(i);
124
+ for (const s of e.richParagraphs) i.appendChild(mt(s, t, n, r));
125
125
  return i;
126
126
  }
127
127
  if (Array.isArray(e.lines) && e.lines.length > 0) {
128
128
  const i = r.createElement("div");
129
- i.className = S("lines", n), y("block").applyTo(i);
130
- for (const l of e.lines) {
131
- const o = r.createElement("div");
132
- o.className = S("line", n), o.textContent = l, y("block").add("white-space", "pre").add("min-height", "1lh").applyTo(o), i.appendChild(o);
129
+ i.className = C("lines", n), x("block").applyTo(i);
130
+ for (const s of e.lines) {
131
+ const l = r.createElement("div");
132
+ l.className = C("line", n), l.textContent = s, x("block").add("white-space", "pre").add("min-height", "1lh").applyTo(l), i.appendChild(l);
133
133
  }
134
134
  return i;
135
135
  }
136
136
  return e.text ?? "";
137
137
  }
138
- function st(e, t, n, r) {
138
+ function ht(e, t, n, r) {
139
139
  const i = r.createElement("div");
140
- i.className = S("text", n);
141
- const l = e.style || {};
142
- return y("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(i), i.append(at(e, t, n, r)), i;
140
+ i.className = C("text", n);
141
+ const s = e.style || {};
142
+ return x("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", s.verticalAlign === "middle" ? "center" : s.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(i), i.append(ft(e, t, n, r)), i;
143
143
  }
144
- function lt(e, t, n) {
144
+ function gt(e, t, n) {
145
145
  const r = n.createElement("img");
146
- return r.className = S("image", t), r.src = e.imageData, y("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
146
+ return r.className = C("image", t), r.src = e.imageData, x("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
147
147
  }
148
- function we(e, t, n, r) {
148
+ function Me(e, t, n, r) {
149
149
  const i = r.createElement("div");
150
- i.className = S("shape", n);
151
- const l = e.style || {}, o = H(l), a = Te(l), s = `${O(o.widthPt * t / 72, 2)}px solid ${o.color}`, c = y("block");
152
- return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top", s), a.right && c.add("border-right", s), a.bottom && c.add("border-bottom", s), a.left && c.add("border-left", s)) : e.kind === "ellipse" ? (a.inner && c.add("border", s).add("border-radius", "50%"), l.backgroundColor && c.add("background-color", l.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", s), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
153
- }
154
- function ct(e, t, n) {
155
- const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), i = re(e.widthMm, t), l = re(e.heightMm, t);
156
- r.setAttribute("width", String(Math.max(1, i))), r.setAttribute("height", String(Math.max(1, l))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
157
- const o = n.createElementNS("http://www.w3.org/2000/svg", "line");
158
- o.setAttribute("x1", "0"), o.setAttribute("x2", String(i)), o.setAttribute("y1", e.lineDirection === "up" ? String(l) : "0"), o.setAttribute("y2", e.lineDirection === "up" ? "0" : String(l));
159
- const a = H({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
160
- return o.setAttribute("stroke", a.color), o.setAttribute("stroke-width", String(a.widthPt * t / 72)), r.appendChild(o), r;
161
- }
162
- function Ie(e, t, n, r) {
150
+ i.className = C("shape", n);
151
+ const s = e.style || {}, l = B(s), o = Ae(s), a = `${H(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = x("block");
152
+ return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (o.top && c.add("border-top", a), o.right && c.add("border-right", a), o.bottom && c.add("border-bottom", a), o.left && c.add("border-left", a)) : e.kind === "ellipse" ? (o.inner && c.add("border", a).add("border-radius", "50%"), s.backgroundColor && c.add("background-color", s.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", a), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
153
+ }
154
+ function pt(e, t, n) {
155
+ const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), i = se(e.widthMm, t), s = se(e.heightMm, t);
156
+ r.setAttribute("width", String(Math.max(1, i))), r.setAttribute("height", String(Math.max(1, s))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
157
+ const l = n.createElementNS("http://www.w3.org/2000/svg", "line");
158
+ l.setAttribute("x1", "0"), l.setAttribute("x2", String(i)), l.setAttribute("y1", e.lineDirection === "up" ? String(s) : "0"), l.setAttribute("y2", e.lineDirection === "up" ? "0" : String(s));
159
+ const o = B({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
160
+ return l.setAttribute("stroke", o.color), l.setAttribute("stroke-width", String(o.widthPt * t / 72)), r.appendChild(l), r;
161
+ }
162
+ function Le(e, t, n, r) {
163
163
  const i = r.createElement("div");
164
- i.className = `${S("comp", n)} mr-kind-${e.kind}`;
165
- const l = y("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");
166
- if (tt(l, e, t), l.applyTo(i), J(e))
167
- return i.appendChild(lt(e, n, r)), i;
164
+ i.className = `${C("comp", n)} mr-kind-${e.kind}`;
165
+ const s = x("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");
166
+ if (lt(s, e, t), s.applyTo(i), Q(e))
167
+ return i.appendChild(gt(e, n, r)), i;
168
168
  if (e.kind === "text")
169
- return i.appendChild(st(e, t, n, r)), i;
169
+ return i.appendChild(ht(e, t, n, r)), i;
170
170
  if (e.grid) {
171
- const a = we(e, t, n, r);
172
- return a.appendChild(it(e.grid, e, t, n, r)), i.appendChild(a), i;
171
+ const o = Me(e, t, n, r);
172
+ return o.appendChild(ut(e.grid, e, t, n, r)), i.appendChild(o), i;
173
173
  }
174
174
  if (e.kind === "line" && e.lineDirection)
175
- return i.appendChild(ct(e, t, r)), i;
175
+ return i.appendChild(pt(e, t, r)), i;
176
176
  if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
177
- return i.appendChild(we(e, t, n, r)), i;
178
- const o = r.createElement("div");
179
- return o.className = S("unknown", n), y("block").applyTo(o), o.textContent = e.fallbackText ?? `[${e.kind}]`, o.dataset.mrUnsupported = e.kind, o.setAttribute("role", "note"), i.appendChild(o), i;
177
+ return i.appendChild(Me(e, t, n, r)), i;
178
+ const l = r.createElement("div");
179
+ return l.className = C("unknown", n), x("block").applyTo(l), l.textContent = e.fallbackText ?? `[${e.kind}]`, l.dataset.mrUnsupported = e.kind, l.setAttribute("role", "note"), i.appendChild(l), i;
180
180
  }
181
- function dt(e, t, n, r) {
181
+ function wt(e, t, n, r) {
182
182
  const i = r.createElement("div");
183
- return i.className = S("page", n), y("block", "initial").add("position", "relative").add("font-family", Y).add("font-size", `${O(z(void 0, t).fontSizePx, 2)}px`).add("line-height", String(X(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", Me).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((l, o) => {
184
- const a = Ie(l, t, n, r);
185
- a.dataset.mrComponentIndex = String(o), i.appendChild(a);
183
+ return i.className = C("page", n), x("block", "initial").add("position", "relative").add("font-family", ee).add("font-size", `${H(j(void 0, t).fontSizePx, 2)}px`).add("line-height", String(te(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", Pe).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((s, l) => {
184
+ const o = Le(s, t, n, r);
185
+ o.dataset.mrComponentIndex = String(l), i.appendChild(o);
186
186
  }), i;
187
187
  }
188
- function hn(e, t, n = {}) {
188
+ function On(e, t, n = {}) {
189
189
  const r = n.dpi ?? 96;
190
- B(e, "dom", n);
190
+ V(e, "dom", n);
191
191
  const i = t.createElement("div");
192
- return i.className = S("root", n), y("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((l) => {
193
- i.appendChild(dt(l, r, n, t));
192
+ return i.className = C("root", n), x("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((s) => {
193
+ i.appendChild(wt(s, r, n, t));
194
194
  }), i;
195
195
  }
196
- function R(e) {
196
+ function A(e) {
197
197
  if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
198
198
  }
199
- const ut = (e, t) => (R(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
200
- const i = new Image(), l = () => {
201
- i.onload = null, i.onerror = null, t?.removeEventListener("abort", o);
202
- }, o = () => {
203
- l(), i.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
199
+ const bt = (e, t) => (A(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
200
+ const i = new Image(), s = () => {
201
+ i.onload = null, i.onerror = null, t?.removeEventListener("abort", l);
202
+ }, l = () => {
203
+ s(), i.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
204
204
  };
205
205
  i.onload = () => {
206
- l(), n(i);
206
+ s(), n(i);
207
207
  }, i.onerror = () => {
208
- l(), r(new Error("Image could not be decoded for Canvas output."));
209
- }, t?.addEventListener("abort", o, { once: !0 }), i.src = e;
208
+ s(), r(new Error("Image could not be decoded for Canvas output."));
209
+ }, t?.addEventListener("abort", l, { once: !0 }), i.src = e;
210
210
  }) : Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));
211
- function mt(e, t, n) {
212
- return R(n), n ? new Promise((r, i) => {
213
- const l = () => i(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
214
- n.addEventListener("abort", l, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, i).finally(() => n.removeEventListener("abort", l));
211
+ function vt(e, t, n) {
212
+ return A(n), n ? new Promise((r, i) => {
213
+ const s = () => i(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
214
+ n.addEventListener("abort", s, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, i).finally(() => n.removeEventListener("abort", s));
215
215
  }) : e(t);
216
216
  }
217
- async function ft(e, t, n) {
217
+ async function yt(e, t, n) {
218
218
  const r = /* @__PURE__ */ new Map();
219
219
  for (const i of e.components)
220
- !J(i) || r.has(i.imageData) || r.set(i.imageData, await mt(t, i.imageData, n));
221
- return R(n), r;
220
+ !Q(i) || r.has(i.imageData) || r.set(i.imageData, await vt(t, i.imageData, n));
221
+ return A(n), r;
222
222
  }
223
- function ht(e, t, n, r, i, l) {
224
- const o = t, a = o.naturalWidth ?? o.width ?? i, s = o.naturalHeight ?? o.height ?? l;
225
- if (a <= 0 || s <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
226
- const c = Math.min(i / a, l / s), d = a * c, u = s * c;
227
- e.drawImage(t, n + (i - d) / 2, r + (l - u) / 2, d, u);
223
+ function xt(e, t, n, r, i, s) {
224
+ const l = t, o = l.naturalWidth ?? l.width ?? i, a = l.naturalHeight ?? l.height ?? s;
225
+ if (o <= 0 || a <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
226
+ const c = Math.min(i / o, s / a), d = o * c, u = a * c;
227
+ e.drawImage(t, n + (i - d) / 2, r + (s - u) / 2, d, u);
228
228
  }
229
- function gt(e) {
230
- return Ye(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
229
+ function Mt(e) {
230
+ return rt(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
231
231
  }
232
- const ae = 96 / 25.4;
233
- function se(e, t = 96) {
234
- const n = t / 96 * ae;
232
+ const de = 96 / 25.4;
233
+ function ue(e, t = 96) {
234
+ const n = t / 96 * de;
235
235
  return {
236
236
  widthPx: Math.max(1, Math.round(e.pageWidthMm * n)),
237
237
  heightPx: Math.max(1, Math.round(e.pageHeightMm * n))
238
238
  };
239
239
  }
240
- function Ae(e, t, n, r = 64e6) {
240
+ function ze(e, t, n, r = 64e6) {
241
241
  if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");
242
242
  if (!Number.isFinite(r) || r <= 0) throw new RangeError("maxCanvasPixels must be positive and finite.");
243
- const i = se(e, n), l = Math.round(i.widthPx * t), o = Math.round(i.heightPx * t);
244
- if (!Number.isSafeInteger(l) || !Number.isSafeInteger(o) || l * o > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
245
- return { width: l, height: o };
246
- }
247
- function $e(e, t, n, r) {
248
- const i = document.createElement("canvas"), { widthPx: l, heightPx: o } = se(e, n), a = Ae(e, t, n, r);
249
- i.width = a.width, i.height = a.height, i.style.width = `${l}px`, i.style.height = `${o}px`;
250
- const s = i.getContext("2d");
251
- if (!s)
243
+ const i = ue(e, n), s = Math.round(i.widthPx * t), l = Math.round(i.heightPx * t);
244
+ if (!Number.isSafeInteger(s) || !Number.isSafeInteger(l) || s * l > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
245
+ return { width: s, height: l };
246
+ }
247
+ function He(e, t, n, r) {
248
+ const i = document.createElement("canvas"), { widthPx: s, heightPx: l } = ue(e, n), o = ze(e, t, n, r);
249
+ i.width = o.width, i.height = o.height, i.style.width = `${s}px`, i.style.height = `${l}px`;
250
+ const a = i.getContext("2d");
251
+ if (!a)
252
252
  throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");
253
- return s.scale(t, t), s.fillStyle = "#ffffff", s.fillRect(0, 0, l, o), { canvas: i, ctx: s };
253
+ return a.scale(t, t), a.fillStyle = "#ffffff", a.fillRect(0, 0, s, l), { canvas: i, ctx: a };
254
254
  }
255
- function gn(e, t = 96) {
256
- return z(e, t).fontSizePx;
255
+ function Dn(e, t = 96) {
256
+ return j(e, t).fontSizePx;
257
257
  }
258
- function Ne(e, t, n, r, i, l, o, a = "top") {
259
- e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${o}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
260
- const s = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
261
- `), d = c.length * s;
258
+ function je(e, t, n, r, i, s, l, o = "top") {
259
+ e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${l}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
260
+ const a = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
261
+ `), d = c.length * a;
262
262
  let u = r;
263
- a === "middle" ? u = r + (l - d) / 2 : a === "bottom" && (u = r + l - d), c.forEach((m, f) => {
264
- pt(e, m, t, n, u + f * s + t.fontSizePx * 0.8, i);
263
+ o === "middle" ? u = r + (s - d) / 2 : o === "bottom" && (u = r + s - d), c.forEach((m, f) => {
264
+ Et(e, m, t, n, u + f * a + t.fontSizePx * 0.8, i);
265
265
  }), e.textAlign = "left";
266
266
  }
267
- function pt(e, t, n, r, i, l) {
268
- const o = Array.from(t), a = n.letterSpacingPx ?? 0;
269
- if (!a) {
267
+ function Et(e, t, n, r, i, s) {
268
+ const l = Array.from(t), o = n.letterSpacingPx ?? 0;
269
+ if (!o) {
270
270
  e.textAlign = n.align === "center" ? "center" : n.align === "right" ? "right" : "left";
271
- const u = n.align === "center" ? r + l / 2 : n.align === "right" ? r + l : r;
271
+ const u = n.align === "center" ? r + s / 2 : n.align === "right" ? r + s : r;
272
272
  e.fillText(t, u, i);
273
273
  return;
274
274
  }
275
- const s = e.measureText(t).width + Math.max(0, o.length - 1) * a, c = n.align === "center" ? r + (l - s) / 2 : n.align === "right" ? r + l - s : r;
275
+ const a = e.measureText(t).width + Math.max(0, l.length - 1) * o, c = n.align === "center" ? r + (s - a) / 2 : n.align === "right" ? r + s - a : r;
276
276
  e.textAlign = "left";
277
277
  let d = "";
278
- o.forEach((u, m) => {
279
- e.fillText(u, c + e.measureText(d).width + m * a, i), d += u;
278
+ l.forEach((u, m) => {
279
+ e.fillText(u, c + e.measureText(d).width + m * o, i), d += u;
280
280
  });
281
281
  }
282
- function wt(e, t, n, r, i, l, o) {
283
- for (const a of Pe(t, n))
284
- e.strokeStyle = a.color, e.lineWidth = D(a.widthPt, o), e.beginPath(), a.kind === "v" ? (e.moveTo(r + a.pos * l, i + a.from * l), e.lineTo(r + a.pos * l, i + a.to * l)) : (e.moveTo(r + a.from * l, i + a.pos * l), e.lineTo(r + a.to * l, i + a.pos * l)), e.stroke();
282
+ function St(e, t, n, r, i, s, l) {
283
+ for (const o of Fe(t, n))
284
+ e.strokeStyle = o.color, e.lineWidth = L(o.widthPt, l), e.beginPath(), o.kind === "v" ? (e.moveTo(r + o.pos * s, i + o.from * s), e.lineTo(r + o.pos * s, i + o.to * s)) : (e.moveTo(r + o.from * s, i + o.pos * s), e.lineTo(r + o.to * s, i + o.pos * s)), e.stroke();
285
285
  }
286
- function bt(e, t, n, r, i, l) {
287
- e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + i, r)), t.right && (e.moveTo(n + i, r), e.lineTo(n + i, r + l)), t.bottom && (e.moveTo(n + i, r + l), e.lineTo(n, r + l)), t.left && (e.moveTo(n, r + l), e.lineTo(n, r)), e.stroke();
286
+ function Tt(e, t, n, r, i, s) {
287
+ e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + i, r)), t.right && (e.moveTo(n + i, r), e.lineTo(n + i, r + s)), t.bottom && (e.moveTo(n + i, r + s), e.lineTo(n, r + s)), t.left && (e.moveTo(n, r + s), e.lineTo(n, r)), e.stroke();
288
288
  }
289
- function vt(e, t, n, r, i, l, o, a, s, c, d) {
290
- const u = W(t, l / a, o / a);
289
+ function Ct(e, t, n, r, i, s, l, o, a, c, d) {
290
+ const u = K(t, s / o, l / o);
291
291
  for (const f of u.cells) {
292
292
  const h = f.cell.style?.backgroundColor ?? n.style?.backgroundColor;
293
- h && (e.fillStyle = h, e.fillRect(r + f.xMm * a, i + f.yMm * a, f.widthMm * a, f.heightMm * a));
293
+ h && (e.fillStyle = h, e.fillRect(r + f.xMm * o, i + f.yMm * o, f.widthMm * o, f.heightMm * o));
294
294
  }
295
- wt(e, u, n, r, i, a, s);
295
+ St(e, u, n, r, i, o, a);
296
296
  const m = t.paddingMm ?? 0.5;
297
297
  for (const f of u.cells) {
298
298
  const h = f.cell.text ?? "";
299
299
  if (!h) continue;
300
- const g = Ee(n.style, f.cell.style), b = z(g, s), x = Math.max(0, f.widthMm - 2 * m), T = Ce(h, x, { fontSizePt: b.fontSizePt, bold: g.bold, italic: g.italic, fontFamily: g.fontFamily ?? c, letterSpacingPt: g.letterSpacing }, d).join(`
300
+ const g = ke(n.style, f.cell.style), b = j(g, a), E = Math.max(0, f.widthMm - 2 * m), S = Ne(h, E, { fontSizePt: b.fontSizePt, bold: g.bold, italic: g.italic, fontFamily: g.fontFamily ?? c, letterSpacingPt: g.letterSpacing }, d).join(`
301
301
  `);
302
- Ne(
302
+ je(
303
303
  e,
304
304
  {
305
- text: T,
305
+ text: S,
306
306
  fontSizePx: b.fontSizePx,
307
307
  bold: g.bold ?? !1,
308
308
  italic: g.italic,
309
- color: Se(g, Me),
309
+ color: $e(g, Pe),
310
310
  align: g.align ?? "left",
311
- lineHeight: X(g),
312
- letterSpacingPx: D(g.letterSpacing ?? 0, s)
311
+ lineHeight: te(g),
312
+ letterSpacingPx: L(g.letterSpacing ?? 0, a)
313
313
  },
314
- r + (f.xMm + m) * a,
315
- i + (f.yMm + m) * a,
316
- x * a,
317
- Math.max(0, f.heightMm - 2 * m) * a,
314
+ r + (f.xMm + m) * o,
315
+ i + (f.yMm + m) * o,
316
+ E * o,
317
+ Math.max(0, f.heightMm - 2 * m) * o,
318
318
  g.fontFamily ?? c,
319
319
  g.verticalAlign ?? "middle"
320
320
  );
321
321
  }
322
322
  }
323
- function yt(e, t, n, r, i, l, o, a, s) {
324
- const c = t.style ?? {}, d = z(c, o), u = xe(t) ? t.richParagraphs.map((m) => m.segments.map((f) => f.text ?? f.field ?? "").join("")).join(`
323
+ function It(e, t, n, r, i, s, l, o, a) {
324
+ const c = t.style ?? {}, d = j(c, l), u = Re(t) ? t.richParagraphs.map((m) => m.segments.map((f) => f.text ?? f.field ?? "").join("")).join(`
325
325
  `) : t.lines?.length ? t.lines.join(`
326
- `) : Ce(t.text ?? "", t.widthMm, { fontSizePt: d.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? a, letterSpacingPt: c.letterSpacing }, s).join(`
326
+ `) : Ne(t.text ?? "", t.widthMm, { fontSizePt: d.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? o, letterSpacingPt: c.letterSpacing }, a).join(`
327
327
  `);
328
- Ne(e, {
328
+ je(e, {
329
329
  text: u,
330
330
  fontSizePx: d.fontSizePx,
331
331
  bold: c.bold ?? !1,
332
332
  italic: c.italic,
333
- color: Se(c),
333
+ color: $e(c),
334
334
  align: c.align ?? "left",
335
- lineHeight: X(c),
336
- letterSpacingPx: D(c.letterSpacing ?? 0, o)
337
- }, n, r, i, l, c.fontFamily ?? a, c.verticalAlign);
338
- }
339
- function le(e, t, n, r, i, l, o) {
340
- const a = t.leftMm * n, s = t.topMm * n, c = t.widthMm * n, d = t.heightMm * n, u = t.style ?? {};
341
- if (J(t)) {
342
- const m = o?.get(t.imageData);
343
- m ? ht(e, m, a, s, c, d) : be(e, t, a, s, c, d);
335
+ lineHeight: te(c),
336
+ letterSpacingPx: L(c.letterSpacing ?? 0, l)
337
+ }, n, r, i, s, c.fontFamily ?? o, c.verticalAlign);
338
+ }
339
+ function me(e, t, n, r, i, s, l) {
340
+ const o = t.leftMm * n, a = t.topMm * n, c = t.widthMm * n, d = t.heightMm * n, u = t.style ?? {};
341
+ if (Q(t)) {
342
+ const m = l?.get(t.imageData);
343
+ m ? xt(e, m, o, a, c, d) : Ee(e, t, o, a, c, d);
344
344
  return;
345
345
  }
346
346
  if (t.grid) {
347
- vt(e, t.grid, t, a, s, c, d, n, r, i, l);
347
+ Ct(e, t.grid, t, o, a, c, d, n, r, i, s);
348
348
  return;
349
349
  }
350
350
  switch (t.kind) {
351
351
  case "text": {
352
- yt(e, t, a, s, c, d, r, i, l);
352
+ It(e, t, o, a, c, d, r, i, s);
353
353
  break;
354
354
  }
355
355
  case "rect": {
356
- const m = H(u), f = Te(u);
357
- u.backgroundColor && (e.fillStyle = u.backgroundColor, e.fillRect(a, s, c, d)), f.inner && (e.strokeStyle = m.color, e.lineWidth = D(m.widthPt, r), bt(e, f, a, s, c, d));
356
+ const m = B(u), f = Ae(u);
357
+ u.backgroundColor && (e.fillStyle = u.backgroundColor, e.fillRect(o, a, c, d)), f.inner && (e.strokeStyle = m.color, e.lineWidth = L(m.widthPt, r), Tt(e, f, o, a, c, d));
358
358
  break;
359
359
  }
360
360
  case "line": {
361
- const m = H({ ...u, borderColor: u.lineColor ?? u.borderColor });
362
- e.strokeStyle = m.color, e.lineWidth = D(m.widthPt, r), e.beginPath();
363
- const f = t.lineDirection === "up" ? s + d : t.lineDirection === "down" ? s : s + d / 2, h = t.lineDirection === "up" ? s : t.lineDirection === "down" ? s + d : s + d / 2;
364
- e.moveTo(a, f), e.lineTo(a + c, h), e.stroke();
361
+ const m = B({ ...u, borderColor: u.lineColor ?? u.borderColor });
362
+ e.strokeStyle = m.color, e.lineWidth = L(m.widthPt, r), e.beginPath();
363
+ const f = t.lineDirection === "up" ? a + d : t.lineDirection === "down" ? a : a + d / 2, h = t.lineDirection === "up" ? a : t.lineDirection === "down" ? a + d : a + d / 2;
364
+ e.moveTo(o, f), e.lineTo(o + c, h), e.stroke();
365
365
  break;
366
366
  }
367
367
  case "ellipse": {
368
- const m = H(u);
369
- e.strokeStyle = m.color, e.lineWidth = D(m.widthPt, r), u.backgroundColor && (e.fillStyle = u.backgroundColor, e.beginPath(), e.ellipse(a + c / 2, s + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(a + c / 2, s + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.stroke();
368
+ const m = B(u);
369
+ e.strokeStyle = m.color, e.lineWidth = L(m.widthPt, r), u.backgroundColor && (e.fillStyle = u.backgroundColor, e.beginPath(), e.ellipse(o + c / 2, a + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(o + c / 2, a + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.stroke();
370
370
  break;
371
371
  }
372
372
  default:
373
- be(e, t, a, s, c, d);
373
+ Ee(e, t, o, a, c, d);
374
374
  break;
375
375
  }
376
376
  }
377
- function be(e, t, n, r, i, l) {
378
- e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, i, l), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
377
+ function Ee(e, t, n, r, i, s) {
378
+ e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, i, s), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
379
379
  }
380
- async function pn(e, t = {}) {
380
+ async function Ln(e, t = {}) {
381
381
  if (typeof document > "u")
382
382
  throw new Error("renderPlanToImages 需要浏览器环境(SSR/Node 请在客户端钩子中调用)");
383
383
  const { format: n = "png", quality: r = 0.92, ...i } = t;
384
384
  if (n !== "png" && n !== "jpeg") throw new TypeError("Image format must be png or jpeg.");
385
385
  if (!Number.isFinite(r) || r < 0 || r > 1) throw new RangeError("Image quality must be between 0 and 1.");
386
- R(t.signal);
387
- const l = await oe(e, { ...t, format: "canvas" });
388
- e = l.plan;
389
- const o = [...l.diagnostics, ...B(e, "canvas", t)], a = n === "jpeg" ? "image/jpeg" : "image/png", s = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
386
+ A(t.signal);
387
+ const s = await ce(e, { ...t, format: "canvas" });
388
+ e = s.plan;
389
+ const l = [...s.diagnostics, ...V(e, "canvas", t)], o = n === "jpeg" ? "image/jpeg" : "image/png", a = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
390
390
  for (let d = Math.max(0, t.start ?? 0); d <= c; d++) {
391
- R(t.signal);
392
- const u = await Le(e.pages[d], d, i, o);
391
+ A(t.signal);
392
+ const u = await We(e.pages[d], d, i, l);
393
393
  try {
394
- s.push(await Mt(u, a, r, t.signal));
394
+ a.push(await Pt(u, o, r, t.signal));
395
395
  } finally {
396
396
  u.width = 0, u.height = 0;
397
397
  }
398
- await Ue(t, s.length, c - Math.max(0, t.start ?? 0) + 1);
398
+ await tt(t, a.length, c - Math.max(0, t.start ?? 0) + 1);
399
399
  }
400
- return R(t.signal), { blobs: s, diagnostics: o };
400
+ return A(t.signal), { blobs: a, diagnostics: l };
401
401
  }
402
- function Mt(e, t, n, r) {
403
- return R(r), new Promise((i, l) => {
404
- const o = () => l(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
405
- r?.addEventListener("abort", o, { once: !0 });
402
+ function Pt(e, t, n, r) {
403
+ return A(r), new Promise((i, s) => {
404
+ const l = () => s(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
405
+ r?.addEventListener("abort", l, { once: !0 });
406
406
  try {
407
- e.toBlob((a) => {
408
- r?.removeEventListener("abort", o), a ? i(a) : l(new Error("Canvas encoding failed; no empty image was emitted."));
407
+ e.toBlob((o) => {
408
+ r?.removeEventListener("abort", l), o ? i(o) : s(new Error("Canvas encoding failed; no empty image was emitted."));
409
409
  }, t, n);
410
- } catch (a) {
411
- r?.removeEventListener("abort", o), l(a);
410
+ } catch (o) {
411
+ r?.removeEventListener("abort", l), s(o);
412
412
  }
413
413
  });
414
414
  }
415
- function wn(e, t = {}) {
416
- if (R(t.signal), typeof document > "u")
415
+ function zn(e, t = {}) {
416
+ if (A(t.signal), typeof document > "u")
417
417
  throw new Error("renderPlanToCanvas 需要浏览器环境(SSR 请在客户端钩子中调用)");
418
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * ae, l = t.fontFamily ?? Y, o = t.measurer ?? ie, a = Math.max(0, t.start ?? 0), s = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], d = B(e, "canvas", t), u = xt(e, a, s);
418
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * de, s = t.fontFamily ?? ee, l = t.measurer ?? le, o = Math.max(0, t.start ?? 0), a = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], d = V(e, "canvas", t), u = Rt(e, o, a);
419
419
  for (const m of u)
420
- ke(m, t), d.push(m);
421
- if (t.fidelity === "strict" && u.length) throw new Je(d);
422
- for (let m = a; m <= s; m++) {
423
- R(t.signal);
424
- const f = e.pages[m], { canvas: h, ctx: g } = $e(f, n, r, t.maxCanvasPixels);
420
+ Oe(m, t), d.push(m);
421
+ if (t.fidelity === "strict" && u.length) throw new nt(d);
422
+ for (let m = o; m <= a; m++) {
423
+ A(t.signal);
424
+ const f = e.pages[m], { canvas: h, ctx: g } = He(f, n, r, t.maxCanvasPixels);
425
425
  for (const b of f.components)
426
- le(g, b, i, r, l, o);
426
+ me(g, b, i, r, s, l);
427
427
  c.push(h);
428
428
  }
429
429
  return { canvases: c, diagnostics: d };
430
430
  }
431
- function xt(e, t, n) {
432
- return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((l, o) => J(l) ? [{
431
+ function Rt(e, t, n) {
432
+ return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((s, l) => Q(s) ? [{
433
433
  code: "async-image-required",
434
434
  severity: "warning",
435
435
  format: "canvas",
436
436
  pageIndex: t + i,
437
- componentIndex: o,
438
- kind: l.kind,
439
- nid: l.nid,
437
+ componentIndex: l,
438
+ kind: s.kind,
439
+ nid: s.nid,
440
440
  message: "Use renderPlanToCanvasAsync or renderPlanToImages to decode and include images."
441
441
  }] : []));
442
442
  }
443
- async function bn(e, t = {}) {
443
+ async function Hn(e, t = {}) {
444
444
  if (typeof document > "u") throw new Error("renderPlanToCanvasAsync 需要浏览器环境(Node 请使用 PDF 或 XLSX 输出)");
445
- R(t.signal);
446
- const n = await oe(e, { ...t, format: "canvas" });
445
+ A(t.signal);
446
+ const n = await ce(e, { ...t, format: "canvas" });
447
447
  e = n.plan;
448
- const r = [...n.diagnostics, ...B(e, "canvas", t)], i = [], l = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
449
- for (let o = Math.max(0, t.start ?? 0); o <= l; o++)
450
- i.push(await Le(e.pages[o], o, t, r));
448
+ const r = [...n.diagnostics, ...V(e, "canvas", t)], i = [], s = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
449
+ for (let l = Math.max(0, t.start ?? 0); l <= s; l++)
450
+ i.push(await We(e.pages[l], l, t, r));
451
451
  return { canvases: i, diagnostics: r };
452
452
  }
453
- async function Le(e, t, n, r) {
454
- const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), l = n.dpi ?? 96, o = n.fontFamily ?? Y, a = await Fe(e, t, n, r);
455
- R(n.signal);
456
- const { canvas: s, ctx: c } = $e(e, i, l, n.maxCanvasPixels);
457
- for (const d of e.components) le(c, d, l / 25.4, l, o, n.measurer ?? ie, a);
458
- return s;
453
+ async function We(e, t, n, r) {
454
+ const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), s = n.dpi ?? 96, l = n.fontFamily ?? ee, o = await Be(e, t, n, r);
455
+ A(n.signal);
456
+ const { canvas: a, ctx: c } = He(e, i, s, n.maxCanvasPixels);
457
+ for (const d of e.components) me(c, d, s / 25.4, s, l, n.measurer ?? le, o);
458
+ return a;
459
459
  }
460
- async function Fe(e, t, n, r) {
461
- const i = n.imageLoader ?? ut;
462
- return ft(e, async (l, o) => {
460
+ async function Be(e, t, n, r) {
461
+ const i = n.imageLoader ?? bt;
462
+ return yt(e, async (s, l) => {
463
463
  try {
464
- return await i(l, o);
465
- } catch (a) {
466
- if (o?.aborted) throw a;
467
- const s = e.components.findIndex((u) => u.imageData === l), c = e.components[s], d = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: s, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
468
- throw r.push(d), ke(d, n), a;
464
+ return await i(s, l);
465
+ } catch (o) {
466
+ if (l?.aborted) throw o;
467
+ const a = e.components.findIndex((u) => u.imageData === s), c = e.components[a], d = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: a, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
468
+ throw r.push(d), Oe(d, n), o;
469
469
  }
470
470
  }, n.signal);
471
471
  }
472
- function vn(e, t = {}) {
473
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * ae, l = t.fontFamily ?? Y, o = t.measurer ?? ie, a = t.overscan ?? 1, s = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, d = e.pages.map((p) => p.pageHeightMm * i), u = Math.max(1, ...e.pages.map((p) => p.pageWidthMm * i)), m = { start: 0, end: -1 };
474
- let f = null, h = null, g = null, b = null, x = [], T = 0, k = [], _ = 0, j = new AbortController();
475
- const he = [];
476
- function _e() {
472
+ function jn(e, t = {}) {
473
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * de, s = t.fontFamily ?? ee, l = t.measurer ?? le, o = t.overscan ?? 1, a = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, d = e.pages.map((p) => p.pageHeightMm * i), u = Math.max(1, ...e.pages.map((p) => p.pageWidthMm * i)), m = { start: 0, end: -1 };
474
+ let f = null, h = null, g = null, b = null, E = [], S = 0, R = [], G = 0, W = new AbortController();
475
+ const ve = [];
476
+ function Ye() {
477
477
  const p = f;
478
- p.innerHTML = "", h = document.createElement("div"), h.style.cssText = `width:${u}px;margin:0 auto;`, g = document.createElement("div"), b = document.createElement("div"), h.appendChild(g), x = [];
479
- const E = Math.min(e.pages.length, 3 + a * 2);
480
- for (let N = 0; N < E; N++) {
481
- const v = document.createElement("div");
482
- v.style.cssText = `margin:0 auto ${s}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, h.appendChild(v), x.push(v);
478
+ p.innerHTML = "", h = document.createElement("div"), h.style.cssText = `width:${u}px;margin:0 auto;`, g = document.createElement("div"), b = document.createElement("div"), h.appendChild(g), E = [];
479
+ const T = Math.min(e.pages.length, 3 + o * 2);
480
+ for (let F = 0; F < T; F++) {
481
+ const y = document.createElement("div");
482
+ y.style.cssText = `margin:0 auto ${a}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, h.appendChild(y), E.push(y);
483
483
  }
484
484
  h.appendChild(b), p.appendChild(h);
485
485
  }
486
- async function Ke(p, E) {
487
- const N = _, v = await oe(e, { ...t, signal: j.signal, format: "canvas", start: E, end: E });
488
- he.push(...v.diagnostics);
489
- const C = v.plan.pages[E], q = await Fe(C, E, { ...t, signal: j.signal }, he);
490
- if (N !== _ || !f) return;
491
- const { widthPx: ee, heightPx: te } = se(C, r);
492
- let $ = p.firstElementChild;
493
- (!$ || $.tagName !== "CANVAS") && ($ = document.createElement("canvas"), p.innerHTML = "", p.appendChild($));
494
- const pe = Ae(C, n, r, t.maxCanvasPixels);
495
- $.width = pe.width, $.height = pe.height, $.style.width = `${ee}px`, $.style.height = `${te}px`;
496
- const F = $.getContext("2d");
497
- if (F) {
498
- F.setTransform(1, 0, 0, 1, 0, 0), F.scale(n, n), F.fillStyle = "#ffffff", F.fillRect(0, 0, ee, te);
499
- for (const qe of C.components)
500
- le(F, qe, i, r, l, o, q);
501
- $.dataset.canvasPage = String(E), p.style.height = `${te}px`, p.style.width = `${ee}px`;
486
+ async function Xe(p, T) {
487
+ const F = G, y = await ce(e, { ...t, signal: W.signal, format: "canvas", start: T, end: T });
488
+ ve.push(...y.diagnostics);
489
+ const I = y.plan.pages[T], J = await Be(I, T, { ...t, signal: W.signal }, ve);
490
+ if (F !== G || !f) return;
491
+ const { widthPx: ie, heightPx: oe } = ue(I, r);
492
+ let N = p.firstElementChild;
493
+ (!N || N.tagName !== "CANVAS") && (N = document.createElement("canvas"), p.innerHTML = "", p.appendChild(N));
494
+ const xe = ze(I, n, r, t.maxCanvasPixels);
495
+ N.width = xe.width, N.height = xe.height, N.style.width = `${ie}px`, N.style.height = `${oe}px`;
496
+ const D = N.getContext("2d");
497
+ if (D) {
498
+ D.setTransform(1, 0, 0, 1, 0, 0), D.scale(n, n), D.fillStyle = "#ffffff", D.fillRect(0, 0, ie, oe);
499
+ for (const Qe of I.components)
500
+ me(D, Qe, i, r, s, l, J);
501
+ N.dataset.canvasPage = String(T), p.style.height = `${oe}px`, p.style.width = `${ie}px`;
502
502
  }
503
503
  }
504
- function Ve(p) {
505
- _++, m.start = p.start, m.end = p.end, g.style.height = `${p.start * s + d.slice(0, p.start).reduce((v, C) => v + C, 0)}px`;
506
- const E = e.pages.length - 1 - p.end;
507
- b.style.height = `${E * s + d.slice(p.end + 1).reduce((v, C) => v + C, 0)}px`;
508
- const N = p.end - p.start + 1;
509
- x.forEach((v, C) => {
510
- if (C < N) {
511
- v.style.display = "";
512
- const q = p.start + C;
513
- v.style.height = `${d[q] ?? 0}px`;
504
+ function Ze(p) {
505
+ G++, m.start = p.start, m.end = p.end, g.style.height = `${p.start * a + d.slice(0, p.start).reduce((y, I) => y + I, 0)}px`;
506
+ const T = e.pages.length - 1 - p.end;
507
+ b.style.height = `${T * a + d.slice(p.end + 1).reduce((y, I) => y + I, 0)}px`;
508
+ const F = p.end - p.start + 1;
509
+ E.forEach((y, I) => {
510
+ if (I < F) {
511
+ y.style.display = "";
512
+ const J = p.start + I;
513
+ y.style.height = `${d[J] ?? 0}px`;
514
514
  } else
515
- v.style.display = "none";
516
- }), k = [];
517
- for (let v = p.start; v <= p.end; v++) {
518
- const C = x[v - p.start];
519
- if (!C) continue;
520
- C.firstElementChild?.dataset?.canvasPage !== String(v) && k.push(v);
515
+ y.style.display = "none";
516
+ }), R = [];
517
+ for (let y = p.start; y <= p.end; y++) {
518
+ const I = E[y - p.start];
519
+ if (!I) continue;
520
+ I.firstElementChild?.dataset?.canvasPage !== String(y) && R.push(y);
521
521
  }
522
- Z();
522
+ re();
523
523
  }
524
- function Z() {
525
- T || k.length === 0 || (T = requestAnimationFrame(() => {
526
- T = 0;
524
+ function re() {
525
+ S || R.length === 0 || (S = requestAnimationFrame(() => {
526
+ S = 0;
527
527
  let p = Math.max(1, c);
528
- for (; k.length > 0 && p-- > 0; ) {
529
- const E = k.shift(), N = x[E - m.start];
530
- N && Ke(N, E).catch(() => {
528
+ for (; R.length > 0 && p-- > 0; ) {
529
+ const T = R.shift(), F = E[T - m.start];
530
+ F && Xe(F, T).catch(() => {
531
531
  });
532
532
  }
533
- k.length > 0 && Z();
533
+ R.length > 0 && re();
534
534
  }));
535
535
  }
536
- function K() {
537
- T || (T = requestAnimationFrame(() => {
538
- T = 0;
539
- const p = f, E = gt({
536
+ function U() {
537
+ S || (S = requestAnimationFrame(() => {
538
+ S = 0;
539
+ const p = f, T = Mt({
540
540
  pageHeightsPx: d,
541
541
  viewportHeightPx: p.clientHeight,
542
542
  scrollTopPx: p.scrollTop,
543
- overscan: a,
544
- gapPx: s
543
+ overscan: o,
544
+ gapPx: a
545
545
  });
546
- E.start !== m.start || E.end !== m.end ? Ve(E) : Z();
546
+ T.start !== m.start || T.end !== m.end ? Ze(T) : re();
547
547
  }));
548
548
  }
549
- let V = null;
549
+ let q = null;
550
550
  return {
551
551
  attach(p) {
552
552
  if (typeof document > "u")
553
553
  throw new Error("createCanvasPager 需要浏览器环境(SSR 请在客户端钩子中调用 attach)");
554
- R(t.signal), j = new AbortController(), t.signal?.addEventListener("abort", ge, { once: !0 }), B(e, "canvas", t), f = p, _e(), p.addEventListener("scroll", K, { passive: !0 }), typeof ResizeObserver < "u" && (V = new ResizeObserver(() => K()), V.observe(p)), K();
554
+ A(t.signal), W = new AbortController(), t.signal?.addEventListener("abort", ye, { once: !0 }), V(e, "canvas", t), f = p, Ye(), p.addEventListener("scroll", U, { passive: !0 }), typeof ResizeObserver < "u" && (q = new ResizeObserver(() => U()), q.observe(p)), U();
555
555
  },
556
556
  destroy() {
557
- _++, j.abort(), t.signal?.removeEventListener("abort", ge), T && cancelAnimationFrame(T), T = 0, V?.disconnect(), V = null, f?.removeEventListener("scroll", K), k = [], h?.remove(), f = null;
557
+ G++, W.abort(), t.signal?.removeEventListener("abort", ye), S && cancelAnimationFrame(S), S = 0, q?.disconnect(), q = null, f?.removeEventListener("scroll", U), R = [], h?.remove(), f = null;
558
558
  },
559
559
  window() {
560
560
  return { ...m };
561
561
  }
562
562
  };
563
- function ge() {
564
- j.abort(t.signal?.reason);
563
+ function ye() {
564
+ W.abort(t.signal?.reason);
565
565
  }
566
566
  }
567
- function De(e, t, n) {
567
+ function _e(e, t, n) {
568
568
  let r, i;
569
569
  if (typeof e == "string") {
570
- const l = G[e];
571
- if (!l) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(G).join("/")})`);
572
- r = l.widthMm, i = l.heightMm;
570
+ const s = Y[e];
571
+ if (!s) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(Y).join("/")})`);
572
+ r = s.widthMm, i = s.heightMm;
573
573
  } else typeof e == "number" ? (r = e, i = t ?? 297) : (r = e.widthMm, i = e.heightMm);
574
574
  return n ? { widthMm: i, heightMm: r } : { widthMm: r, heightMm: i };
575
575
  }
576
- class Tt {
576
+ class At {
577
577
  constructor() {
578
578
  this.pages = [], this.pending = null, this.templateParams = void 0;
579
579
  }
@@ -602,18 +602,18 @@ class Tt {
602
602
  */
603
603
  page(t = "a4", n = {}, r) {
604
604
  this.collect();
605
- const l = r != null && !("margins" in r) && !("landscape" in r) && ("marginTopMm" in r || "marginBottomMm" in r || "marginLeftMm" in r || "marginRightMm" in r) ? { margins: r } : typeof n == "number" ? r ?? {} : n, { widthMm: o, heightMm: a } = De(
605
+ const s = r != null && !("margins" in r) && !("landscape" in r) && ("marginTopMm" in r || "marginBottomMm" in r || "marginLeftMm" in r || "marginRightMm" in r) ? { margins: r } : typeof n == "number" ? r ?? {} : n, { widthMm: l, heightMm: o } = _e(
606
606
  t,
607
607
  typeof n == "number" ? n : void 0,
608
- l.landscape
609
- ), s = l.margins ?? {};
610
- return this.pending = new Et(this, {
611
- widthMm: o,
612
- heightMm: a,
613
- marginTopMm: s.marginTopMm ?? 10,
614
- marginBottomMm: s.marginBottomMm ?? 10,
615
- marginLeftMm: s.marginLeftMm ?? 10,
616
- marginRightMm: s.marginRightMm ?? 10
608
+ s.landscape
609
+ ), a = s.margins ?? {};
610
+ return this.pending = new kt(this, {
611
+ widthMm: l,
612
+ heightMm: o,
613
+ marginTopMm: a.marginTopMm ?? 10,
614
+ marginBottomMm: a.marginBottomMm ?? 10,
615
+ marginLeftMm: a.marginLeftMm ?? 10,
616
+ marginRightMm: a.marginRightMm ?? 10
617
617
  }), this.pending;
618
618
  }
619
619
  collect() {
@@ -625,7 +625,7 @@ class Tt {
625
625
  return this.templateParams ? { params: this.templateParams, pages: this.pages } : { pages: this.pages };
626
626
  }
627
627
  }
628
- class Et {
628
+ class kt {
629
629
  constructor(t, n) {
630
630
  this.parent = t, this.page = n, this.components = [];
631
631
  }
@@ -694,26 +694,26 @@ class Et {
694
694
  return this.done().build();
695
695
  }
696
696
  }
697
- function yn() {
698
- return new Tt();
697
+ function Wn() {
698
+ return new At();
699
699
  }
700
- function Mn(e, t = {}) {
701
- return Ge([], e), e.fields.map((n) => ({
700
+ function Bn(e, t = {}) {
701
+ return et([], e), e.fields.map((n) => ({
702
702
  field: n.field,
703
703
  header: `${n.label ?? n.field}${n.unit ? ` (${n.unit})` : ""}`,
704
704
  semanticRole: n.semanticRole ?? (n.type === "number" || n.type === "decimal" ? "measure" : n.type === "date" ? "date" : n.enum ? "dimension" : "text"),
705
705
  ...t[n.field]
706
706
  }));
707
707
  }
708
- function I(e, t, n = !1) {
708
+ function k(e, t, n = !1) {
709
709
  if (!Number.isFinite(e) || (n ? e < 0 : e <= 0))
710
710
  throw new Error(`${t} 必须是有限${n ? "非负" : "正"}数`);
711
711
  }
712
- function U(e, t, n) {
712
+ function X(e, t, n) {
713
713
  if (e !== void 0 && !["left", "center", "right", "justify", ...n ? ["auto"] : []].includes(e))
714
714
  throw new Error(`${t} 必须是 left/center/right/justify${n ? "/auto" : ""}`);
715
715
  }
716
- function St(e) {
716
+ function $t(e) {
717
717
  const t = e.layout ?? "page";
718
718
  if (t !== "page" && t !== "wide")
719
719
  throw new Error("layout 必须是 page 或 wide");
@@ -722,18 +722,18 @@ function St(e) {
722
722
  if (t !== "wide" && e.columnWidthMm !== void 0)
723
723
  throw new Error('columnWidthMm 仅适用于 layout: "wide"');
724
724
  const n = e.columnWidthMm ?? 30;
725
- return I(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
725
+ return k(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
726
726
  }
727
- function Ct(e) {
727
+ function Nt(e) {
728
728
  const t = e.paper === void 0 ? "a4" : e.paper;
729
729
  if (typeof t != "string" && (typeof t != "object" || t === null) || e.landscape !== void 0 && typeof e.landscape != "boolean")
730
730
  throw new Error("paper 必须是纸张预设名或 { widthMm, heightMm } 对象,landscape 必须是布尔值");
731
- if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(G, t))
732
- throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(G).join("/")})`);
733
- const n = De(t, void 0, e.landscape), r = n.widthMm, i = n.heightMm;
734
- return I(r, "纸张 widthMm"), I(i, "纸张 heightMm"), { widthMm: r, heightMm: i };
731
+ if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(Y, t))
732
+ throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(Y).join("/")})`);
733
+ const n = _e(t, void 0, e.landscape), r = n.widthMm, i = n.heightMm;
734
+ return k(r, "纸张 widthMm"), k(i, "纸张 heightMm"), { widthMm: r, heightMm: i };
735
735
  }
736
- function Pt(e) {
736
+ function Ft(e) {
737
737
  if (e.margins !== void 0 && (!e.margins || typeof e.margins != "object" || Array.isArray(e.margins)))
738
738
  throw new Error("margins 必须是页边距对象");
739
739
  const t = e.margins ?? {}, n = {
@@ -742,79 +742,79 @@ function Pt(e) {
742
742
  marginLeftMm: t.marginLeftMm === void 0 ? 10 : t.marginLeftMm,
743
743
  marginRightMm: t.marginRightMm === void 0 ? 10 : t.marginRightMm
744
744
  };
745
- for (const [r, i] of Object.entries(n)) I(i, r, !0);
745
+ for (const [r, i] of Object.entries(n)) k(i, r, !0);
746
746
  return n;
747
747
  }
748
- function kt(e, t) {
748
+ function Ot(e, t) {
749
749
  const n = e.dataset === void 0 ? "detail" : e.dataset;
750
750
  if (typeof n != "string" || !n.trim())
751
751
  throw new Error("dataset 必须是非空字符串");
752
752
  if (e.title !== void 0 && typeof e.title != "string")
753
753
  throw new Error("title 必须是字符串");
754
754
  const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, i = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
755
- I(r, "titleHeightMm"), I(i, "titleGapMm", !0);
756
- const l = e.title !== void 0 && e.title.length > 0, o = l ? r + i : 0;
757
- if (o >= t)
755
+ k(r, "titleHeightMm"), k(i, "titleGapMm", !0);
756
+ const s = e.title !== void 0 && e.title.length > 0, l = s ? r + i : 0;
757
+ if (l >= t)
758
758
  throw new Error("标题高度与间距占满页面,必须为表格保留可用高度");
759
- return { dataset: n, titleHeightMm: r, hasTitle: l, titleSpaceMm: o };
759
+ return { dataset: n, titleHeightMm: r, hasTitle: s, titleSpaceMm: l };
760
760
  }
761
- function Rt(e) {
761
+ function Dt(e) {
762
762
  if (e.listOptions !== void 0 && (!e.listOptions || typeof e.listOptions != "object" || Array.isArray(e.listOptions)))
763
763
  throw new Error("listOptions 必须是列表配置对象");
764
764
  const t = e.listOptions ?? {};
765
- U(t.align, "listOptions.align", !0), U(t.headerAlign, "listOptions.headerAlign", !1);
765
+ X(t.align, "listOptions.align", !0), X(t.headerAlign, "listOptions.headerAlign", !1);
766
766
  for (const n of ["fontSizePt", "rowHeightMm", "paddingMm"]) {
767
767
  const r = t[n];
768
- r !== void 0 && I(r, `listOptions.${n}`, n === "paddingMm");
768
+ r !== void 0 && k(r, `listOptions.${n}`, n === "paddingMm");
769
769
  }
770
770
  return t;
771
771
  }
772
- function It(e) {
772
+ function Lt(e) {
773
773
  let t = 0, n = 0;
774
774
  for (const [r, i] of e.entries()) {
775
775
  if (!i || typeof i.header != "string" || typeof i.field != "string" || !i.field.trim())
776
776
  throw new Error(`columns[${r}] 需要字符串 header 与非空 field`);
777
- U(i.align, `columns[${r}].align`, !0), U(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 && I(i.flex, `columns[${r}].flex`), i.widthMm !== void 0 ? (I(i.widthMm, `columns[${r}].widthMm`), t += i.widthMm) : n = Math.max(n, i.flex ?? 1);
777
+ X(i.align, `columns[${r}].align`, !0), X(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 && k(i.flex, `columns[${r}].flex`), i.widthMm !== void 0 ? (k(i.widthMm, `columns[${r}].widthMm`), t += i.widthMm) : n = Math.max(n, i.flex ?? 1);
778
778
  }
779
779
  return { fixedWidthMm: t, maxFlex: n };
780
780
  }
781
- function At(e, t, n, r) {
782
- const { fixedWidthMm: i, maxFlex: l } = It(e.columns);
781
+ function zt(e, t, n, r) {
782
+ const { fixedWidthMm: i, maxFlex: s } = Lt(e.columns);
783
783
  if (t === "page" && i > r)
784
784
  throw new Error(`固定列宽 ${i}mm 超出页面可用宽度 ${r}mm`);
785
- const o = r - i;
786
- if (t === "page" && l > 0 && o <= 0)
785
+ const l = r - i;
786
+ if (t === "page" && s > 0 && l <= 0)
787
787
  throw new Error("固定列占满页面可用宽度,自动列需要正的剩余宽度");
788
- const a = l > 0 ? e.columns.reduce((c, d) => c + (d.widthMm === void 0 ? (d.flex ?? 1) / l : 0), 0) : 0;
788
+ const o = s > 0 ? e.columns.reduce((c, d) => c + (d.widthMm === void 0 ? (d.flex ?? 1) / s : 0), 0) : 0;
789
789
  return { columns: e.columns.map(({ widthMm: c, flex: d, ...u }, m) => {
790
- const f = c ?? (t === "wide" ? n * (d ?? 1) : o * ((d ?? 1) / l) / a);
791
- return I(f, `columns[${m}] 分配后的 widthMm`), { ...u, widthMm: f };
792
- }), fixedWidthMm: i, maxFlex: l };
790
+ const f = c ?? (t === "wide" ? n * (d ?? 1) : l * ((d ?? 1) / s) / o);
791
+ return k(f, `columns[${m}] 分配后的 widthMm`), { ...u, widthMm: f };
792
+ }), fixedWidthMm: i, maxFlex: s };
793
793
  }
794
- function xn(e) {
794
+ function _n(e) {
795
795
  if (!e || typeof e != "object")
796
796
  throw new Error("标准明细模板需要 options 对象");
797
797
  if (!Array.isArray(e.columns) || e.columns.length === 0)
798
798
  throw new Error("columns 至少需要一列");
799
- const { layout: t, columnWidthMm: n } = St(e), r = Ct(e);
799
+ const { layout: t, columnWidthMm: n } = $t(e), r = Nt(e);
800
800
  let i = r.widthMm;
801
- const l = r.heightMm, o = Pt(e);
802
- let a = i - o.marginLeftMm - o.marginRightMm;
803
- const s = l - o.marginTopMm - o.marginBottomMm;
804
- if (t === "page" && a <= 0 || s <= 0)
801
+ const s = r.heightMm, l = Ft(e);
802
+ let o = i - l.marginLeftMm - l.marginRightMm;
803
+ const a = s - l.marginTopMm - l.marginBottomMm;
804
+ if (t === "page" && o <= 0 || a <= 0)
805
805
  throw new Error("页边距占满纸张,必须保留正的可用宽度和高度");
806
- const { dataset: c, titleHeightMm: d, hasTitle: u, titleSpaceMm: m } = kt(e, s), f = Rt(e), { columns: h, fixedWidthMm: g, maxFlex: b } = At(e, t, n, a);
807
- t === "wide" && (a = h.reduce((T, k) => T + k.widthMm, 0), I(a, "宽表总列宽"), i = a + o.marginLeftMm + o.marginRightMm, I(i, "宽表总宽度"));
808
- const x = { widthMm: i, heightMm: l, ...o, components: [], ...t === "wide" ? { layout: t } : {} };
809
- return u && x.components.push({
806
+ const { dataset: c, titleHeightMm: d, hasTitle: u, titleSpaceMm: m } = Ot(e, a), f = Dt(e), { columns: h, fixedWidthMm: g, maxFlex: b } = zt(e, t, n, o);
807
+ t === "wide" && (o = h.reduce((S, R) => S + R.widthMm, 0), k(o, "宽表总列宽"), i = o + l.marginLeftMm + l.marginRightMm, k(i, "宽表总宽度"));
808
+ const E = { widthMm: i, heightMm: s, ...l, components: [], ...t === "wide" ? { layout: t } : {} };
809
+ return u && E.components.push({
810
810
  kind: "text",
811
811
  text: e.title,
812
- leftMm: o.marginLeftMm,
813
- topMm: o.marginTopMm,
814
- widthMm: a,
812
+ leftMm: l.marginLeftMm,
813
+ topMm: l.marginTopMm,
814
+ widthMm: o,
815
815
  heightMm: d,
816
816
  style: { fontSize: 16, bold: !0, align: "center", verticalAlign: "middle", ...e.titleStyle }
817
- }), x.components.push({
817
+ }), E.components.push({
818
818
  align: "auto",
819
819
  headerAlign: "center",
820
820
  ...f,
@@ -823,20 +823,20 @@ function xn(e) {
823
823
  ...u ? { title: e.title } : {},
824
824
  dataset: c,
825
825
  columns: h,
826
- leftMm: o.marginLeftMm,
827
- topMm: o.marginTopMm + m,
828
- widthMm: t === "wide" || b > 0 ? a : g
829
- }), e.params === void 0 ? { pages: [x] } : { params: e.params, pages: [x] };
826
+ leftMm: l.marginLeftMm,
827
+ topMm: l.marginTopMm + m,
828
+ widthMm: t === "wide" || b > 0 ? o : g
829
+ }), e.params === void 0 ? { pages: [E] } : { params: e.params, pages: [E] };
830
830
  }
831
- function Tn(e) {
831
+ function Kn(e) {
832
832
  return e;
833
833
  }
834
- class L extends Error {
834
+ class O extends Error {
835
835
  constructor(t, n) {
836
836
  super(n), this.code = t, this.name = "ReportTemplateStoreError";
837
837
  }
838
838
  }
839
- function A(e) {
839
+ function $(e) {
840
840
  return JSON.parse(JSON.stringify(e));
841
841
  }
842
842
  function P(e) {
@@ -844,120 +844,120 @@ function P(e) {
844
844
  const t = new Error("模板操作已取消");
845
845
  throw t.name = "AbortError", t;
846
846
  }
847
- function ve(e) {
847
+ function Se(e) {
848
848
  const t = e ? Number(e.revision) : 0;
849
- if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new L("history", "修订号无效或已达上限");
849
+ if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new O("history", "修订号无效或已达上限");
850
850
  return String(t + 1);
851
851
  }
852
- function En(e, t = {}) {
853
- const n = async (o, a) => {
854
- P(a);
855
- const s = await e.read(o, a);
856
- return P(a), s ? A(s) : void 0;
857
- }, r = async (o, a) => {
858
- const s = await n(o, a.signal);
859
- if ((s?.revision ?? null) !== a.expectedRevision) throw new L("conflict", "模板已变化,请重新读取后提交");
860
- return s;
861
- }, i = async (o, a, s) => {
862
- if (P(a.signal), !await e.compareAndSwap(o.id, a.expectedRevision, A(o), { signal: a.signal, ...s ? { publication: A(s) } : {} })) throw new L("conflict", "模板已被其他请求更新");
863
- return A(o);
864
- }, l = (o, a, s, c) => {
865
- const d = ve(o), u = ne({ ...a, revision: d }), m = { revision: d, document: u, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
866
- return c !== void 0 && (m.restoredFrom = c), i({ id: o.id, revision: d, publishedRevision: d, published: u }, s, m);
852
+ function Vn(e, t = {}) {
853
+ const n = async (l, o) => {
854
+ P(o);
855
+ const a = await e.read(l, o);
856
+ return P(o), a ? $(a) : void 0;
857
+ }, r = async (l, o) => {
858
+ const a = await n(l, o.signal);
859
+ if ((a?.revision ?? null) !== o.expectedRevision) throw new O("conflict", "模板已变化,请重新读取后提交");
860
+ return a;
861
+ }, i = async (l, o, a) => {
862
+ if (P(o.signal), !await e.compareAndSwap(l.id, o.expectedRevision, $(l), { signal: o.signal, ...a ? { publication: $(a) } : {} })) throw new O("conflict", "模板已被其他请求更新");
863
+ return $(l);
864
+ }, s = (l, o, a, c) => {
865
+ const d = Se(l), u = ae({ ...o, revision: d }), m = { revision: d, document: u, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
866
+ return c !== void 0 && (m.restoredFrom = c), i({ id: l.id, revision: d, publishedRevision: d, published: u }, a, m);
867
867
  };
868
868
  return {
869
- list: async (o) => {
870
- P(o);
871
- const a = await e.list(o);
872
- return P(o), A(a);
869
+ list: async (l) => {
870
+ P(l);
871
+ const o = await e.list(l);
872
+ return P(l), $(o);
873
873
  },
874
- get: async (o, a = {}) => {
875
- const s = await n(o, a.signal), c = a.draft ? s?.draft : s?.published;
876
- return c ? ne(c) : void 0;
874
+ get: async (l, o = {}) => {
875
+ const a = await n(l, o.signal), c = o.draft ? a?.draft : a?.published;
876
+ return c ? ae(c) : void 0;
877
877
  },
878
- history: async (o, a) => {
879
- P(a);
880
- const s = await e.history(o, a);
881
- return P(a), A(s);
878
+ history: async (l, o) => {
879
+ P(o);
880
+ const a = await e.history(l, o);
881
+ return P(o), $(a);
882
882
  },
883
- saveDraft: async (o, a) => {
884
- P(a.signal);
885
- const s = ne(t.migrate ? await t.migrate(o) : o), c = await r(s.id, a), d = ve(c);
883
+ saveDraft: async (l, o) => {
884
+ P(o.signal);
885
+ const a = ae(t.migrate ? await t.migrate(l) : l), c = await r(a.id, o), d = Se(c);
886
886
  return i({
887
- id: s.id,
887
+ id: a.id,
888
888
  revision: d,
889
- draft: { ...s, revision: d },
889
+ draft: { ...a, revision: d },
890
890
  ...c?.publishedRevision ? { publishedRevision: c.publishedRevision, published: c.published } : {}
891
- }, a);
891
+ }, o);
892
892
  },
893
- publish: async (o, a) => {
894
- const s = await r(o, a);
895
- if (!s) throw new L("missing", "模板不存在");
896
- if (!s.draft) throw new L("draft", "没有可发布的草稿");
897
- return l(s, s.draft, a);
893
+ publish: async (l, o) => {
894
+ const a = await r(l, o);
895
+ if (!a) throw new O("missing", "模板不存在");
896
+ if (!a.draft) throw new O("draft", "没有可发布的草稿");
897
+ return s(a, a.draft, o);
898
898
  },
899
- rollback: async (o, a, s) => {
900
- const c = await r(o, s);
901
- if (!c) throw new L("missing", "模板不存在");
902
- P(s.signal);
903
- const d = await e.getVersion(o, a, s.signal);
904
- if (!d) throw new L("history", "历史修订不存在");
905
- return l(c, d.document, s, a);
899
+ rollback: async (l, o, a) => {
900
+ const c = await r(l, a);
901
+ if (!c) throw new O("missing", "模板不存在");
902
+ P(a.signal);
903
+ const d = await e.getVersion(l, o, a.signal);
904
+ if (!d) throw new O("history", "历史修订不存在");
905
+ return s(c, d.document, a, o);
906
906
  }
907
907
  };
908
908
  }
909
- function Sn() {
909
+ function Gn() {
910
910
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
911
911
  return {
912
912
  read: async (n, r) => {
913
913
  P(r);
914
914
  const i = e.get(n);
915
- return i ? A(i) : void 0;
915
+ return i ? $(i) : void 0;
916
916
  },
917
- list: async (n) => (P(n), Array.from(e.values(), ({ id: r, revision: i, publishedRevision: l }) => ({ id: r, revision: i, ...l ? { publishedRevision: l } : {} }))),
918
- history: async (n, r) => (P(r), Array.from(t.get(n)?.values() ?? [], (i) => A(i))),
917
+ list: async (n) => (P(n), Array.from(e.values(), ({ id: r, revision: i, publishedRevision: s }) => ({ id: r, revision: i, ...s ? { publishedRevision: s } : {} }))),
918
+ history: async (n, r) => (P(r), Array.from(t.get(n)?.values() ?? [], (i) => $(i))),
919
919
  getVersion: async (n, r, i) => {
920
920
  P(i);
921
- const l = t.get(n)?.get(r);
922
- return l ? A(l) : void 0;
921
+ const s = t.get(n)?.get(r);
922
+ return s ? $(s) : void 0;
923
923
  },
924
- compareAndSwap: async (n, r, i, l) => {
925
- if (P(l.signal), (e.get(n)?.revision ?? null) !== r) return !1;
926
- if (i.id !== n) throw new L("history", "状态 ID 与存储 ID 不一致");
927
- const o = A(i), a = l.publication;
928
- if (a) {
929
- const s = t.get(n) ?? /* @__PURE__ */ new Map();
930
- if (s.has(a.revision) || a.revision !== i.revision || a.document.id !== n) throw new L("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
931
- s.set(a.revision, A(a)), t.set(n, s);
924
+ compareAndSwap: async (n, r, i, s) => {
925
+ if (P(s.signal), (e.get(n)?.revision ?? null) !== r) return !1;
926
+ if (i.id !== n) throw new O("history", "状态 ID 与存储 ID 不一致");
927
+ const l = $(i), o = s.publication;
928
+ if (o) {
929
+ const a = t.get(n) ?? /* @__PURE__ */ new Map();
930
+ if (a.has(o.revision) || o.revision !== i.revision || o.document.id !== n) throw new O("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
931
+ a.set(o.revision, $(o)), t.set(n, a);
932
932
  }
933
- return e.set(n, o), !0;
933
+ return e.set(n, l), !0;
934
934
  }
935
935
  };
936
936
  }
937
- function Oe(e) {
937
+ function Ke(e) {
938
938
  return !e || typeof e != "object" ? !1 : [e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex].every((t) => Number.isInteger(t) && t >= 0);
939
939
  }
940
- function ze(e, t, n) {
940
+ function Ve(e, t, n) {
941
941
  const r = e.grid;
942
942
  if (!r) return null;
943
943
  const i = r.cells[t];
944
944
  if (!i) return null;
945
- const o = W(r, e.widthMm, e.heightMm).cells.filter((s) => s.ri === t).findIndex((s) => s.ci === n), a = i[o];
946
- return a ? { cell: a, sourceColumnIndex: o } : null;
945
+ const l = K(r, e.widthMm, e.heightMm).cells.filter((a) => a.ri === t).findIndex((a) => a.ci === n), o = i[l];
946
+ return o ? { cell: o, sourceColumnIndex: l } : null;
947
947
  }
948
- function $t(e) {
948
+ function Ht(e) {
949
949
  return e.value !== void 0 ? e.value : e.rawText ?? e.text ?? null;
950
950
  }
951
- function Nt(e, t) {
951
+ function jt(e, t) {
952
952
  return e.valueType ? e.valueType : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t === null && e.numberFormat && /[0#?]/.test(e.numberFormat) ? "number" : "text";
953
953
  }
954
- function Lt(e, t) {
954
+ function Wt(e, t) {
955
955
  if (e.editable === !1) return "cell";
956
956
  if (e.formula !== void 0) return "formula";
957
957
  if (e.children?.length) return "complex";
958
958
  if (t.table && t.table.role !== "body" && e.editable !== !0) return "structure";
959
959
  }
960
- function Ft(e, t) {
960
+ function Bt(e, t) {
961
961
  const n = e.table;
962
962
  if (n)
963
963
  return {
@@ -967,53 +967,53 @@ function Ft(e, t) {
967
967
  columnKey: n.columnKeys[t.columnIndex]
968
968
  };
969
969
  }
970
- function Dt(e, t, n) {
970
+ function _t(e, t, n) {
971
971
  if (e.source) return { ...e.source };
972
972
  const r = t.table?.source, i = t.table?.columnKeys[n.columnIndex];
973
973
  if (!(!r || r.rowKey === void 0 || i === void 0))
974
974
  return { ...r, rowKey: r.rowKey, field: i };
975
975
  }
976
- function je(e, t, n) {
977
- const r = $t(n), i = Lt(n, e);
976
+ function Ge(e, t, n) {
977
+ const r = Ht(n), i = Wt(n, e);
978
978
  return {
979
979
  address: { ...t },
980
980
  cell: n,
981
981
  component: e,
982
982
  value: r,
983
- valueType: Nt(n, r),
984
- table: Ft(e, t),
985
- source: Dt(n, e, t),
983
+ valueType: jt(n, r),
984
+ table: Bt(e, t),
985
+ source: _t(n, e, t),
986
986
  editable: i === void 0,
987
987
  readOnlyReason: i
988
988
  };
989
989
  }
990
- function ce(e, t) {
991
- if (!Oe(t)) return null;
990
+ function fe(e, t) {
991
+ if (!Ke(t)) return null;
992
992
  const n = e.pages[t.pageIndex]?.components[t.componentIndex];
993
993
  if (!n) return null;
994
- const r = ze(n, t.rowIndex, t.columnIndex);
995
- return r ? je(n, t, r.cell) : null;
994
+ const r = Ve(n, t.rowIndex, t.columnIndex);
995
+ return r ? Ge(n, t, r.cell) : null;
996
996
  }
997
- function de(e) {
997
+ function he(e) {
998
998
  const t = /* @__PURE__ */ new Map();
999
999
  return (n) => {
1000
- if (!Oe(n)) return null;
1000
+ if (!Ke(n)) return null;
1001
1001
  const r = e.pages[n.pageIndex]?.components[n.componentIndex];
1002
1002
  if (!r?.grid) return null;
1003
1003
  let i = t.get(r);
1004
1004
  if (!i) {
1005
- const o = /* @__PURE__ */ new Map();
1005
+ const l = /* @__PURE__ */ new Map();
1006
1006
  i = /* @__PURE__ */ new Map();
1007
- for (const a of W(r.grid, r.widthMm, r.heightMm).cells) {
1008
- const s = o.get(a.ri) ?? 0;
1009
- o.set(a.ri, s + 1);
1010
- const c = r.grid.cells[a.ri]?.[s];
1011
- c && i.set(`${a.ri}:${a.ci}`, c);
1007
+ for (const o of K(r.grid, r.widthMm, r.heightMm).cells) {
1008
+ const a = l.get(o.ri) ?? 0;
1009
+ l.set(o.ri, a + 1);
1010
+ const c = r.grid.cells[o.ri]?.[a];
1011
+ c && i.set(`${o.ri}:${o.ci}`, c);
1012
1012
  }
1013
1013
  t.set(r, i);
1014
1014
  }
1015
- const l = i.get(`${n.rowIndex}:${n.columnIndex}`);
1016
- return l ? je(r, n, l) : null;
1015
+ const s = i.get(`${n.rowIndex}:${n.columnIndex}`);
1016
+ return s ? Ge(r, n, s) : null;
1017
1017
  };
1018
1018
  }
1019
1019
  class M extends Error {
@@ -1021,20 +1021,20 @@ class M extends Error {
1021
1021
  super(`Invalid report cell edit: ${t}`), this.code = t, this.name = "ReportCellEditError";
1022
1022
  }
1023
1023
  }
1024
- function Ot(e, t) {
1024
+ function Kt(e, t) {
1025
1025
  let n = e.trim();
1026
1026
  const r = t && n.endsWith("%");
1027
1027
  if (r && (n = n.slice(0, -1).trim()), /^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d*)?(?:[eE][+-]?\d+)?$/.test(n) && (n = n.replace(/,/g, "")), !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(n)) throw new M("number");
1028
1028
  return Number(n) / (r ? 100 : 1);
1029
1029
  }
1030
- function zt(e, t) {
1030
+ function Vt(e, t) {
1031
1031
  if (e === null || typeof e == "string" && e.trim() === "") return null;
1032
1032
  if (typeof e != "string" && typeof e != "number") throw new M("number");
1033
- const n = typeof e == "number" ? e : Ot(e, Qe(t.cell.numberFormat));
1033
+ const n = typeof e == "number" ? e : Kt(e, ot(t.cell.numberFormat));
1034
1034
  if (!Number.isFinite(n) || Number.isInteger(n) && !Number.isSafeInteger(n)) throw new M("number");
1035
1035
  return n;
1036
1036
  }
1037
- function jt(e) {
1037
+ function Gt(e) {
1038
1038
  if (e === null || typeof e == "string" && e.trim() === "") return null;
1039
1039
  if (typeof e == "boolean") return e;
1040
1040
  const t = String(e).trim().toLowerCase();
@@ -1042,24 +1042,24 @@ function jt(e) {
1042
1042
  if (["false", "no", "否", "0"].includes(t)) return !1;
1043
1043
  throw new M("boolean");
1044
1044
  }
1045
- function ue(e, t) {
1046
- return e.valueType === "number" ? zt(t, e) : e.valueType === "boolean" ? jt(t) : t === null ? null : String(t);
1045
+ function ge(e, t) {
1046
+ return e.valueType === "number" ? Vt(t, e) : e.valueType === "boolean" ? Gt(t) : t === null ? null : String(t);
1047
1047
  }
1048
- function Ht(e, t) {
1049
- const n = t.cell.text, i = [["是", "否"], ["TRUE", "FALSE"], ["True", "False"], ["true", "false"], ["1", "0"]].find((l) => l.includes(n ?? ""));
1048
+ function Ut(e, t) {
1049
+ const n = t.cell.text, i = [["是", "否"], ["TRUE", "FALSE"], ["True", "False"], ["true", "false"], ["1", "0"]].find((s) => s.includes(n ?? ""));
1050
1050
  return i ? i[e ? 0 : 1] : String(e);
1051
1051
  }
1052
- function Q(e, t) {
1053
- return t === null ? "" : typeof t == "boolean" ? Ht(t, e) : typeof t == "number" ? Xe(t, e.cell.numberFormat) : String(t);
1052
+ function ne(e, t) {
1053
+ return t === null ? "" : typeof t == "boolean" ? Ut(t, e) : typeof t == "number" ? it(t, e.cell.numberFormat) : String(t);
1054
1054
  }
1055
- function Cn(e, t, n) {
1056
- const r = ce(e, t);
1055
+ function Un(e, t, n) {
1056
+ const r = fe(e, t);
1057
1057
  if (!r) throw new M("missing");
1058
- return me(r, n);
1058
+ return pe(r, n);
1059
1059
  }
1060
- function me(e, t) {
1060
+ function pe(e, t) {
1061
1061
  if (!e.editable) throw new M("readonly");
1062
- const n = ue(e, t);
1062
+ const n = ge(e, t);
1063
1063
  return {
1064
1064
  address: { ...e.address },
1065
1065
  table: e.table,
@@ -1067,88 +1067,88 @@ function me(e, t) {
1067
1067
  previousValue: e.value,
1068
1068
  previousText: e.cell.text ?? "",
1069
1069
  value: n,
1070
- text: Q(e, n)
1070
+ text: ne(e, n)
1071
1071
  };
1072
1072
  }
1073
- function Wt(e, t) {
1073
+ function qt(e, t) {
1074
1074
  const n = e.table, r = t.table;
1075
1075
  return !n || !r || n.columnKey === void 0 ? !1 : n.id === r.id && n.rowIndex === r.rowIndex && n.role === r.role && n.columnKey === r.columnKey;
1076
1076
  }
1077
- function He(e, t, n) {
1078
- const r = e.grid, { rowIndex: i, columnIndex: l } = t.address, o = ze(e, i, l), a = [...r.cells], s = [...a[i]], c = Q(t, n.value), d = { ...o.cell, value: n.value, text: c, rawText: c };
1079
- return s[o.sourceColumnIndex] = d, a[i] = s, { ...e, grid: { ...r, cells: a } };
1077
+ function Ue(e, t, n) {
1078
+ const r = e.grid, { rowIndex: i, columnIndex: s } = t.address, l = Ve(e, i, s), o = [...r.cells], a = [...o[i]], c = ne(t, n.value), d = { ...l.cell, value: n.value, text: c, rawText: c };
1079
+ return a[l.sourceColumnIndex] = d, o[i] = a, { ...e, grid: { ...r, cells: o } };
1080
1080
  }
1081
- function Bt(e, t) {
1081
+ function Jt(e, t) {
1082
1082
  const n = e.table?.columnKeys, r = t.table?.columnKey;
1083
- return n && r !== void 0 ? n.flatMap((i, l) => i === r ? [l] : []) : [];
1083
+ return n && r !== void 0 ? n.flatMap((i, s) => i === r ? [s] : []) : [];
1084
1084
  }
1085
- function _t(e, t, n, r, i, l) {
1086
- const o = t.table, a = i.table;
1087
- if (!o || !a || o.id !== a.id || o.role !== a.role || !t.grid) return t;
1088
- const s = a.rowIndex - o.rowIndex;
1089
- if (s < 0 || s >= t.grid.cells.length) return t;
1085
+ function Yt(e, t, n, r, i, s) {
1086
+ const l = t.table, o = i.table;
1087
+ if (!l || !o || l.id !== o.id || l.role !== o.role || !t.grid) return t;
1088
+ const a = o.rowIndex - l.rowIndex;
1089
+ if (a < 0 || a >= t.grid.cells.length) return t;
1090
1090
  let c = t;
1091
- for (const d of Bt(t, i)) {
1092
- const u = ce(e, { pageIndex: n, componentIndex: r, rowIndex: s, columnIndex: d });
1093
- u?.editable && Wt(i, u) && (c = He(c, u, l));
1091
+ for (const d of Jt(t, i)) {
1092
+ const u = fe(e, { pageIndex: n, componentIndex: r, rowIndex: a, columnIndex: d });
1093
+ u?.editable && qt(i, u) && (c = Ue(c, u, s));
1094
1094
  }
1095
1095
  return c;
1096
1096
  }
1097
- function Kt(e, t, n, r, i, l) {
1098
- const o = i.address;
1099
- return i.table?.columnKey !== void 0 ? _t(e, t, n, r, i, l) : o.pageIndex === n && o.componentIndex === r ? He(t, i, l) : t;
1097
+ function Xt(e, t, n, r, i, s) {
1098
+ const l = i.address;
1099
+ return i.table?.columnKey !== void 0 ? Yt(e, t, n, r, i, s) : l.pageIndex === n && l.componentIndex === r ? Ue(t, i, s) : t;
1100
1100
  }
1101
- function We(e, t) {
1101
+ function qe(e, t) {
1102
1102
  const n = t.source;
1103
1103
  if (!n) return !1;
1104
1104
  const r = e.source;
1105
1105
  return !r || ["datasetId", "rowKey", "field", "revision", "sourceToken"].some((i) => !Object.is(r[i], n[i]));
1106
1106
  }
1107
- function Pn(e, t) {
1108
- const n = ce(e, t.address);
1107
+ function qn(e, t) {
1108
+ const n = fe(e, t.address);
1109
1109
  if (!n) throw new M("missing");
1110
1110
  if (!n.editable) throw new M("readonly");
1111
- if (We(n, t)) throw new M("conflict");
1111
+ if (qe(n, t)) throw new M("conflict");
1112
1112
  if (!Object.is(n.value, t.previousValue) || (n.cell.text ?? "") !== t.previousText) throw new M("conflict");
1113
- const r = ue(n, t.value), i = { ...t, value: r, text: Q(n, r) };
1113
+ const r = ge(n, t.value), i = { ...t, value: r, text: ne(n, r) };
1114
1114
  if (Object.is(r, n.value) && i.text === n.cell.text) return e;
1115
- const l = e.pages.map((o, a) => {
1116
- const s = o.components.map((c, d) => Kt(e, c, a, d, n, i));
1117
- return s.every((c, d) => c === o.components[d]) ? o : { ...o, components: s };
1115
+ const s = e.pages.map((l, o) => {
1116
+ const a = l.components.map((c, d) => Xt(e, c, o, d, n, i));
1117
+ return a.every((c, d) => c === l.components[d]) ? l : { ...l, components: a };
1118
1118
  });
1119
- return { ...e, pages: l };
1119
+ return { ...e, pages: s };
1120
1120
  }
1121
- function Vt(e) {
1121
+ function Zt(e) {
1122
1122
  return JSON.stringify([e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex]);
1123
1123
  }
1124
- function ye(e) {
1124
+ function Te(e) {
1125
1125
  const t = e.table;
1126
- return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) : Vt(e.address);
1126
+ return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) : Zt(e.address);
1127
1127
  }
1128
- function qt(e, t) {
1128
+ function Qt(e, t) {
1129
1129
  if (!t.length) return e;
1130
- const n = new Map(t.map((s) => [ye(s), s])), r = new Set(t.flatMap((s) => s.table ? [s.table.id] : [])), i = new Set(t.map((s) => `${s.address.pageIndex}:${s.address.componentIndex}`)), l = de(e);
1131
- function o(s, c, d) {
1132
- const u = s.grid;
1133
- if (!u || !i.has(`${c}:${d}`) && !r.has(s.table?.id ?? "")) return s;
1130
+ const n = new Map(t.map((a) => [Te(a), a])), r = new Set(t.flatMap((a) => a.table ? [a.table.id] : [])), i = new Set(t.map((a) => `${a.address.pageIndex}:${a.address.componentIndex}`)), s = he(e);
1131
+ function l(a, c, d) {
1132
+ const u = a.grid;
1133
+ if (!u || !i.has(`${c}:${d}`) && !r.has(a.table?.id ?? "")) return a;
1134
1134
  const m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1135
- for (const h of W(u, s.widthMm, s.heightMm).cells) {
1135
+ for (const h of K(u, a.widthMm, a.heightMm).cells) {
1136
1136
  const g = f.get(h.ri) ?? 0;
1137
1137
  f.set(h.ri, g + 1);
1138
- const b = l({ pageIndex: c, componentIndex: d, rowIndex: h.ri, columnIndex: h.ci }), x = b && n.get(ye(b));
1139
- if (!x || !b.editable) continue;
1140
- const T = m.get(h.ri) ?? [...u.cells[h.ri]], k = Q(b, x.value);
1141
- Object.is(b.value, x.value) && k === b.cell.text || (T[g] = { ...h.cell, value: x.value, text: k, rawText: k }, m.set(h.ri, T));
1138
+ const b = s({ pageIndex: c, componentIndex: d, rowIndex: h.ri, columnIndex: h.ci }), E = b && n.get(Te(b));
1139
+ if (!E || !b.editable) continue;
1140
+ const S = m.get(h.ri) ?? [...u.cells[h.ri]], R = ne(b, E.value);
1141
+ Object.is(b.value, E.value) && R === b.cell.text || (S[g] = { ...h.cell, value: E.value, text: R, rawText: R }, m.set(h.ri, S));
1142
1142
  }
1143
- return m.size ? { ...s, grid: { ...u, cells: u.cells.map((h, g) => m.get(g) ?? h) } } : s;
1143
+ return m.size ? { ...a, grid: { ...u, cells: u.cells.map((h, g) => m.get(g) ?? h) } } : a;
1144
1144
  }
1145
- const a = e.pages.map((s, c) => {
1146
- const d = s.components.map((u, m) => o(u, c, m));
1147
- return d.every((u, m) => u === s.components[m]) ? s : { ...s, components: d };
1145
+ const o = e.pages.map((a, c) => {
1146
+ const d = a.components.map((u, m) => l(u, c, m));
1147
+ return d.every((u, m) => u === a.components[m]) ? a : { ...a, components: d };
1148
1148
  });
1149
- return a.every((s, c) => s === e.pages[c]) ? e : { ...e, pages: a };
1149
+ return o.every((a, c) => a === e.pages[c]) ? e : { ...e, pages: o };
1150
1150
  }
1151
- function fe(e) {
1151
+ function we(e) {
1152
1152
  const t = e.source;
1153
1153
  if (t) return JSON.stringify([t.datasetId, t.rowKey, t.field]);
1154
1154
  const n = e.table;
@@ -1156,114 +1156,114 @@ function fe(e) {
1156
1156
  const r = e.address;
1157
1157
  return JSON.stringify([r.pageIndex, r.componentIndex, r.rowIndex, r.columnIndex]);
1158
1158
  }
1159
- function kn(e, t, n) {
1159
+ function Jn(e, t, n) {
1160
1160
  if (typeof n != "string" || !n.trim() || !Array.isArray(t)) throw new M("missing");
1161
1161
  if (t.length > 1e4) throw new M("limit");
1162
- const r = /* @__PURE__ */ new Set(), i = de(e), l = t.map(({ address: o, value: a }) => {
1163
- const s = i(o);
1164
- if (!s) throw new M("missing");
1165
- const c = me(s, a), d = fe(c);
1162
+ const r = /* @__PURE__ */ new Set(), i = he(e), s = t.map(({ address: l, value: o }) => {
1163
+ const a = i(l);
1164
+ if (!a) throw new M("missing");
1165
+ const c = pe(a, o), d = we(c);
1166
1166
  if (r.has(d)) throw new M("duplicate");
1167
1167
  return r.add(d), c;
1168
1168
  });
1169
- return { requestId: n, edits: l };
1169
+ return { requestId: n, edits: s };
1170
1170
  }
1171
- function Rn(e, t) {
1171
+ function Yn(e, t) {
1172
1172
  if (t.edits.length > 1e4) throw new M("limit");
1173
- const n = de(e), r = /* @__PURE__ */ new Set(), i = t.edits.map((l) => {
1174
- const o = n(l.address);
1175
- if (!o) throw new M("missing");
1176
- const a = fe(l);
1177
- if (r.has(a)) throw new M("duplicate");
1178
- if (r.add(a), We(o, l) || !Object.is(o.value, l.previousValue) || (o.cell.text ?? "") !== l.previousText) throw new M("conflict");
1179
- return me(o, l.value);
1173
+ const n = he(e), r = /* @__PURE__ */ new Set(), i = t.edits.map((s) => {
1174
+ const l = n(s.address);
1175
+ if (!l) throw new M("missing");
1176
+ const o = we(s);
1177
+ if (r.has(o)) throw new M("duplicate");
1178
+ if (r.add(o), qe(l, s) || !Object.is(l.value, s.previousValue) || (l.cell.text ?? "") !== s.previousText) throw new M("conflict");
1179
+ return pe(l, s.value);
1180
1180
  });
1181
- return qt(e, i);
1181
+ return Qt(e, i);
1182
1182
  }
1183
- function In(e) {
1183
+ function Xn(e) {
1184
1184
  const t = /* @__PURE__ */ new Map();
1185
1185
  for (const n of e) {
1186
- const r = fe(n), i = t.get(r), l = i ? { ...n, previousValue: i.previousValue, previousText: i.previousText } : { ...n };
1187
- Object.is(l.previousValue, l.value) ? t.delete(r) : t.set(r, l);
1186
+ const r = we(n), i = t.get(r), s = i ? { ...n, previousValue: i.previousValue, previousText: i.previousText } : { ...n };
1187
+ Object.is(s.previousValue, s.value) ? t.delete(r) : t.set(r, s);
1188
1188
  }
1189
1189
  return [...t.values()];
1190
1190
  }
1191
- function An(e) {
1191
+ function Zn(e) {
1192
1192
  return e.map((t) => t.map((n) => /[\t\r\n"]/.test(n) ? `"${n.replace(/"/g, '""')}"` : n).join(" ")).join(`\r
1193
1193
  `);
1194
1194
  }
1195
- function Gt(e, t) {
1195
+ function en(e, t) {
1196
1196
  const n = e[e.length - 1];
1197
1197
  e.length > 1 && n?.length === 1 && n[0] === "" && /[\r\n]$/.test(t) && e.pop();
1198
1198
  }
1199
- function $n(e, t = 1e4) {
1199
+ function Qn(e, t = 1e4) {
1200
1200
  if (e.length > 4 * 1024 * 1024) throw new Error("Clipboard text limit exceeded");
1201
1201
  const n = [[]];
1202
- let r = "", i = !1, l = !1, o = 0;
1203
- function a() {
1204
- if (++o > t) throw new Error("Clipboard cell limit exceeded");
1205
- n[n.length - 1].push(r), r = "", l = !1;
1202
+ let r = "", i = !1, s = !1, l = 0;
1203
+ function o() {
1204
+ if (++l > t) throw new Error("Clipboard cell limit exceeded");
1205
+ n[n.length - 1].push(r), r = "", s = !1;
1206
1206
  }
1207
- for (let s = 0; s < e.length; s++) {
1208
- const c = e[s];
1207
+ for (let a = 0; a < e.length; a++) {
1208
+ const c = e[a];
1209
1209
  if (i) {
1210
1210
  if (c !== '"') {
1211
1211
  r += c;
1212
1212
  continue;
1213
1213
  }
1214
- if (e[s + 1] === '"') {
1215
- r += '"', s++;
1214
+ if (e[a + 1] === '"') {
1215
+ r += '"', a++;
1216
1216
  continue;
1217
1217
  }
1218
- i = !1, l = !0;
1218
+ i = !1, s = !0;
1219
1219
  continue;
1220
1220
  }
1221
- if (c === '"' && !r && !l) {
1221
+ if (c === '"' && !r && !s) {
1222
1222
  i = !0;
1223
1223
  continue;
1224
1224
  }
1225
1225
  if (c === " ") {
1226
- a();
1226
+ o();
1227
1227
  continue;
1228
1228
  }
1229
1229
  if (c === "\r" || c === `
1230
1230
  `) {
1231
- a(), n.push([]), c === "\r" && e[s + 1] === `
1232
- ` && s++;
1231
+ o(), n.push([]), c === "\r" && e[a + 1] === `
1232
+ ` && a++;
1233
1233
  continue;
1234
1234
  }
1235
- if (l) throw new Error("Invalid quoted clipboard value");
1235
+ if (s) throw new Error("Invalid quoted clipboard value");
1236
1236
  r += c;
1237
1237
  }
1238
1238
  if (i) throw new Error("Unclosed clipboard quote");
1239
- return a(), Gt(n, e), n;
1239
+ return o(), en(n, e), n;
1240
1240
  }
1241
- function Nn(e, t, n) {
1241
+ function er(e, t, n) {
1242
1242
  if (!n || n.revision === void 0 && n.sourceToken === void 0) return e;
1243
- const r = new Set(t.edits.flatMap((o) => o.source ? [o.source.datasetId] : []));
1243
+ const r = new Set(t.edits.flatMap((l) => l.source ? [l.source.datasetId] : []));
1244
1244
  if (!r.size) return e;
1245
- function i(o) {
1246
- return !o.datasetId || !r.has(o.datasetId) || (n.revision === void 0 || Object.is(n.revision, o.revision)) && (n.sourceToken === void 0 || n.sourceToken === o.sourceToken) ? o : { ...o, ...n.revision !== void 0 ? { revision: n.revision } : {}, ...n.sourceToken !== void 0 ? { sourceToken: n.sourceToken } : {} };
1245
+ function i(l) {
1246
+ return !l.datasetId || !r.has(l.datasetId) || (n.revision === void 0 || Object.is(n.revision, l.revision)) && (n.sourceToken === void 0 || n.sourceToken === l.sourceToken) ? l : { ...l, ...n.revision !== void 0 ? { revision: n.revision } : {}, ...n.sourceToken !== void 0 ? { sourceToken: n.sourceToken } : {} };
1247
1247
  }
1248
- const l = e.pages.map((o) => {
1249
- const a = o.components.map((s) => {
1250
- const c = s.table?.source ? i(s.table.source) : void 0, d = s.table && c !== s.table.source ? { ...s.table, source: c } : s.table, u = s.grid?.cells.map((f) => {
1248
+ const s = e.pages.map((l) => {
1249
+ const o = l.components.map((a) => {
1250
+ const c = a.table?.source ? i(a.table.source) : void 0, d = a.table && c !== a.table.source ? { ...a.table, source: c } : a.table, u = a.grid?.cells.map((f) => {
1251
1251
  const h = f.map((g) => {
1252
1252
  if (!g?.source) return g;
1253
1253
  const b = i(g.source);
1254
1254
  return b === g.source ? g : { ...g, source: b };
1255
1255
  });
1256
1256
  return h.some((g, b) => g !== f[b]) ? h : f;
1257
- }), m = s.grid && u?.some((f, h) => f !== s.grid.cells[h]) ? { ...s.grid, cells: u } : s.grid;
1258
- return d !== s.table || m !== s.grid ? { ...s, table: d, grid: m } : s;
1257
+ }), m = a.grid && u?.some((f, h) => f !== a.grid.cells[h]) ? { ...a.grid, cells: u } : a.grid;
1258
+ return d !== a.table || m !== a.grid ? { ...a, table: d, grid: m } : a;
1259
1259
  });
1260
- return a.some((s, c) => s !== o.components[c]) ? { ...o, components: a } : o;
1260
+ return o.some((a, c) => a !== l.components[c]) ? { ...l, components: o } : l;
1261
1261
  });
1262
- return l.some((o, a) => o !== e.pages[a]) ? { ...e, pages: l } : e;
1262
+ return s.some((l, o) => l !== e.pages[o]) ? { ...e, pages: s } : e;
1263
1263
  }
1264
- class Ut extends Error {
1264
+ class tn extends Error {
1265
1265
  constructor(t, n, r) {
1266
- const i = typeof n.label == "string" ? n.label : "单元格", l = {
1266
+ const i = typeof n.label == "string" ? n.label : "单元格", s = {
1267
1267
  definition: `${i}的编辑器配置无效`,
1268
1268
  type: `${i}的编辑器与数据类型不一致`,
1269
1269
  required: `${i}不能为空`,
@@ -1274,154 +1274,352 @@ class Ut extends Error {
1274
1274
  choice: `${i}请选择有效选项`,
1275
1275
  date: `${i}请输入有效日期(YYYY-MM-DD)`
1276
1276
  };
1277
- super(l[t]), this.code = t, this.field = n, this.expected = r, this.name = "ReportCellFieldError";
1277
+ super(s[t]), this.code = t, this.field = n, this.expected = r, this.name = "ReportCellFieldError";
1278
1278
  }
1279
1279
  }
1280
1280
  function w(e, t, n) {
1281
- throw new Ut(t, e, n);
1281
+ throw new tn(t, e, n);
1282
1282
  }
1283
- function Be(e) {
1283
+ function Je(e) {
1284
1284
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
1285
1285
  const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
1286
1286
  return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
1287
1287
  }
1288
- function Jt(e) {
1288
+ function nn(e) {
1289
1289
  const [t = "", n = "0"] = String(e).toLowerCase().split("e");
1290
1290
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
1291
1291
  }
1292
- function Yt(e, t) {
1293
- e.min !== void 0 && t < e.min && w(e, "min", e.min), e.max !== void 0 && t > e.max && w(e, "max", e.max), e.precision !== void 0 && Jt(t) > e.precision && w(e, "precision", e.precision);
1292
+ function rn(e, t) {
1293
+ e.min !== void 0 && t < e.min && w(e, "min", e.min), e.max !== void 0 && t > e.max && w(e, "max", e.max), e.precision !== void 0 && nn(t) > e.precision && w(e, "precision", e.precision);
1294
1294
  }
1295
- function Xt(e, t) {
1296
- Be(t) || w(e, "date"), e.min !== void 0 && t < e.min && w(e, "min", e.min), e.max !== void 0 && t > e.max && w(e, "max", e.max);
1295
+ function on(e, t) {
1296
+ Je(t) || w(e, "date"), e.min !== void 0 && t < e.min && w(e, "min", e.min), e.max !== void 0 && t > e.max && w(e, "max", e.max);
1297
1297
  }
1298
- function Qt(e) {
1298
+ function an(e) {
1299
1299
  [e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) && w(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && w(e, "definition"), e.precision !== void 0 && (!Number.isInteger(e.precision) || e.precision < 0 || e.precision > 15) && w(e, "definition");
1300
1300
  }
1301
- function Zt(e) {
1302
- [e.min, e.max].some((t) => t !== void 0 && !Be(t)) && w(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && w(e, "definition");
1301
+ function sn(e) {
1302
+ [e.min, e.max].some((t) => t !== void 0 && !Je(t)) && w(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && w(e, "definition");
1303
1303
  }
1304
- function en(e, t) {
1304
+ function ln(e, t) {
1305
1305
  (!Array.isArray(t.options) || !t.options.length) && w(t, "definition");
1306
1306
  const n = e.valueType === "text" ? "string" : e.valueType, r = /* @__PURE__ */ new Set();
1307
1307
  for (const i of t.options)
1308
1308
  (!i || typeof i.value !== n || typeof i.value == "number" && !Number.isFinite(i.value)) && w(t, "definition"), i.label !== void 0 && typeof i.label != "string" && w(t, "definition"), r.has(i.value) && w(t, "definition"), r.add(i.value);
1309
1309
  }
1310
- function tn(e) {
1310
+ function cn(e) {
1311
1311
  e.required !== void 0 && typeof e.required != "boolean" && w(e, "definition"), [e.label, e.hint, e.unit].some((t) => t !== void 0 && typeof t != "string") && w(e, "definition"), e.type === "boolean" && [e.trueLabel, e.falseLabel].some((t) => t !== void 0 && typeof t != "string") && w(e, "definition");
1312
1312
  }
1313
- function nn(e, t) {
1314
- (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && w(t ?? { type: "text" }, "definition"), tn(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && w(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && w(t, "type"), t.type === "number" && Qt(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && w(t, "definition"), t.type === "date" && Zt(t), t.type === "enum" && en(e, t);
1313
+ function dn(e, t) {
1314
+ (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && w(t ?? { type: "text" }, "definition"), cn(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && w(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && w(t, "type"), t.type === "number" && an(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && w(t, "definition"), t.type === "date" && sn(t), t.type === "enum" && ln(e, t);
1315
1315
  }
1316
- function Ln(e, t, n) {
1316
+ function tr(e, t, n) {
1317
1317
  if (!e.editable) throw new M("readonly");
1318
- n && nn(e, n);
1319
- const r = ue(e, t);
1320
- return n ? (n.required && typeof r == "string" && !r.trim() && w(n, "required"), r === null || r === "" ? (n.required && w(n, "required"), r) : (n.type === "number" && Yt(n, r), n.type === "date" && Xt(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && w(n, "length", n.maxLength), n.type === "enum" && !n.options.some((i) => Object.is(i.value, r)) && w(n, "choice"), r)) : r;
1318
+ n && dn(e, n);
1319
+ const r = ge(e, t);
1320
+ return n ? (n.required && typeof r == "string" && !r.trim() && w(n, "required"), r === null || r === "" ? (n.required && w(n, "required"), r) : (n.type === "number" && rn(n, r), n.type === "date" && on(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && w(n, "length", n.maxLength), n.type === "enum" && !n.options.some((i) => Object.is(i.value, r)) && w(n, "choice"), r)) : r;
1321
+ }
1322
+ class v extends Error {
1323
+ constructor(t) {
1324
+ super(`Report calculation: ${t}`), this.code = t, this.name = "ReportCalculationError";
1325
+ }
1326
+ }
1327
+ function z(e) {
1328
+ if (!e?.aborted) return;
1329
+ const t = new Error("Calculation cancelled");
1330
+ throw t.name = "AbortError", t;
1331
+ }
1332
+ async function Z(e, t = 1) {
1333
+ const n = Math.floor(e.scanned / 2048);
1334
+ if (e.scanned += t, e.scanned > e.maxScanned) throw new v("limit");
1335
+ z(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), z(e.signal));
1336
+ }
1337
+ function be(e) {
1338
+ return e.table?.role === "header" ? -Math.max(1, e.grid?.cells.length ?? 1) : e.table?.rowIndex ?? 0;
1339
+ }
1340
+ function Ce(e, t, n) {
1341
+ if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((o) => Number.isSafeInteger(o) && o >= 0)) throw new v("selection");
1342
+ const r = e.pages[t.pageIndex]?.components[t.componentIndex];
1343
+ if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new v("selection");
1344
+ const i = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((o, a) => Math.max(o, a.length), 1);
1345
+ if (t.columnIndex >= i) throw new v("selection");
1346
+ const s = r.table, l = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
1347
+ if (s && l && s.id === l.id) {
1348
+ const o = l.columnKeys.indexOf(s.columnKeys[t.columnIndex] ?? "");
1349
+ if (o < 0) throw new v("selection");
1350
+ return { grid: s.id, row: be(r) + t.rowIndex, column: o };
1351
+ }
1352
+ return { grid: `${t.pageIndex}:${t.componentIndex}`, row: t.rowIndex, column: t.columnIndex };
1353
+ }
1354
+ function un(e, t, n) {
1355
+ const r = Ce(e, t.anchor, t.anchor), i = Ce(e, t.focus, t.anchor);
1356
+ if (r.grid !== i.grid) throw new v("selection");
1357
+ const s = (Math.abs(r.row - i.row) + 1) * (Math.abs(r.column - i.column) + 1);
1358
+ if (!Number.isSafeInteger(s) || s > n) throw new v("limit");
1359
+ return { grid: r.grid, rowStart: Math.min(r.row, i.row), rowEnd: Math.max(r.row, i.row), columnStart: Math.min(r.column, i.column), columnEnd: Math.max(r.column, i.column), origin: e.pages[t.anchor.pageIndex].components[t.anchor.componentIndex].table };
1360
+ }
1361
+ function mn(e) {
1362
+ if (!e) return !1;
1363
+ const t = e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "");
1364
+ return /[ymdhs]/i.test(t);
1365
+ }
1366
+ function fn(e) {
1367
+ if (e.valueType === "text" || e.valueType === "boolean" || mn(e.numberFormat)) return null;
1368
+ const t = e.value;
1369
+ if (typeof t != "number" || !Number.isFinite(t)) return null;
1370
+ if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new v("precision");
1371
+ return t;
1372
+ }
1373
+ function hn(e, t, n) {
1374
+ if (e.seen.has(n)) return;
1375
+ e.seen.add(n), e.selected++;
1376
+ const r = t ? fn(t) : null;
1377
+ r === null ? e.excluded++ : e.values.push(r);
1378
+ }
1379
+ function gn(e, t, n, r) {
1380
+ return r.origin ? e.table?.id === r.origin.id : `${t}:${n}` === r.grid;
1381
+ }
1382
+ function pn(e, t, n) {
1383
+ return n.origin ? n.origin.columnKeys.indexOf(e.table.columnKeys[t] ?? "") : t;
1384
+ }
1385
+ function wn(e, t, n, r) {
1386
+ const i = r.origin ? be(e) + t : t, s = pn(e, n, r);
1387
+ return i < r.rowStart || i > r.rowEnd || s < r.columnStart || s > r.columnEnd ? null : `${r.grid}:${i}:${s}`;
1388
+ }
1389
+ function bn(e, t) {
1390
+ const n = t.origin ? be(e) : 0, r = Math.max(0, t.rowStart - n), i = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
1391
+ return i > r ? i : 0;
1392
+ }
1393
+ async function vn(e, t, n, r, i) {
1394
+ const s = e.grid;
1395
+ if (t > r.maxScanned) throw new v("limit");
1396
+ const l = s.colWidthsMm?.length ?? s.cells.reduce((a, c) => Math.max(a, c.length), 1);
1397
+ if (l > r.maxScanned) throw new v("limit");
1398
+ const o = /* @__PURE__ */ new Map();
1399
+ for (let a = 0; a < t; a++) {
1400
+ a > 0 && a % 2048 === 0 && (await r.yieldToHost(), z(r.signal));
1401
+ let c = 0;
1402
+ for (const d of s.cells[a]) {
1403
+ for (await Z(r); c < l && (o.get(c) ?? 0) > a; ) c++;
1404
+ if (c >= l) break;
1405
+ const u = Math.max(1, Math.min(d?.colSpan ?? 1, l - c)), m = Math.min(s.cells.length, a + Math.max(1, d?.rowSpan ?? 1));
1406
+ u > 1 && await Z(r, u - 1);
1407
+ for (let h = c; h < c + u; h++) o.set(h, m);
1408
+ const f = wn(e, a, c, n);
1409
+ f && hn(i, d, f), c += u;
1410
+ }
1411
+ }
1412
+ }
1413
+ async function yn(e, t, n) {
1414
+ const r = { values: [], seen: /* @__PURE__ */ new Set(), excluded: 0, selected: 0 };
1415
+ for (let i = 0; i < e.pages.length; i++) {
1416
+ await Z(n);
1417
+ const s = e.pages[i];
1418
+ for (let l = 0; l < s.components.length; l++) {
1419
+ await Z(n);
1420
+ const o = s.components[l];
1421
+ if (!o.grid || !gn(o, i, l, t) || o.table && o.table.role !== "body") continue;
1422
+ const a = bn(o, t);
1423
+ a && await vn(o, a, t, n, r);
1424
+ }
1425
+ }
1426
+ return r;
1427
+ }
1428
+ function _(e) {
1429
+ if (!Number.isFinite(e)) throw new v("overflow");
1430
+ return e;
1431
+ }
1432
+ function xn(e) {
1433
+ let t = 0, n = 0;
1434
+ for (const r of e) {
1435
+ const i = r - n, s = _(t + i);
1436
+ n = s - t - i, t = s;
1437
+ }
1438
+ return t;
1439
+ }
1440
+ async function Ie(e, t) {
1441
+ let n = [...e], r = new Array(e.length);
1442
+ for (let s = 1; s < e.length; s *= 2) {
1443
+ for (let l = 0; l < e.length; l += s * 2) {
1444
+ const o = Math.min(l + s, e.length), a = Math.min(l + s * 2, e.length);
1445
+ let c = l, d = o;
1446
+ for (let u = l; u < a; u++)
1447
+ r[u] = d >= a || c < o && n[c] <= n[d] ? n[c++] : n[d++], u % 2048 === 0 && (await t.yieldToHost(), z(t.signal));
1448
+ }
1449
+ [n, r] = [r, n];
1450
+ }
1451
+ const i = Math.floor(n.length / 2);
1452
+ return n.length % 2 ? n[i] : _(n[i - 1] / 2 + n[i] / 2);
1453
+ }
1454
+ function Mn(e) {
1455
+ const t = xn(e);
1456
+ let n = 1 / 0, r = -1 / 0;
1457
+ for (const i of e)
1458
+ n = Math.min(n, i), r = Math.max(r, i);
1459
+ return { SUM: t, AVERAGE: t / e.length, AVG: t / e.length, MIN: n, MAX: r, COUNT: e.length };
1460
+ }
1461
+ function En(e, t) {
1462
+ if (typeof e != "string" || e.length > 256) throw new v("expression");
1463
+ const n = e.toUpperCase().match(/(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?|[A-Z_]+|[()+\-*/]|\S/g) ?? [];
1464
+ if (!n.length || n.length > 64) throw new v("expression");
1465
+ let r = 0;
1466
+ function i(o) {
1467
+ if (o > 16) throw new v("expression");
1468
+ const a = n[r++];
1469
+ if (a === "+" || a === "-") return (a === "-" ? -1 : 1) * i(o + 1);
1470
+ if (a === "(") {
1471
+ const c = s(0, o + 1);
1472
+ if (n[r++] !== ")") throw new v("expression");
1473
+ return c;
1474
+ }
1475
+ if (a && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(a) && Object.prototype.hasOwnProperty.call(t, a)) return _(t[a]);
1476
+ if (a && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(a)) return _(Number(a));
1477
+ throw new v("expression");
1478
+ }
1479
+ function s(o, a) {
1480
+ let c = i(a);
1481
+ for (; r < n.length; ) {
1482
+ const d = n[r], u = d === "+" || d === "-" ? 1 : d === "*" || d === "/" ? 2 : 0;
1483
+ if (!u || u < o) break;
1484
+ r++;
1485
+ const m = s(u + 1, a + 1);
1486
+ if (d === "/" && m === 0) throw new v("division");
1487
+ c = _(d === "+" ? c + m : d === "-" ? c - m : d === "*" ? c * m : c / m);
1488
+ }
1489
+ return c;
1490
+ }
1491
+ const l = s(1, 0);
1492
+ if (r !== n.length) throw new v("expression");
1493
+ return l;
1494
+ }
1495
+ function Sn(e) {
1496
+ const t = e.maxCells ?? 1e5, n = e.maxScannedCells ?? 2e5, r = e.precision ?? 2;
1497
+ if (![t, n].every((i) => Number.isSafeInteger(i) && i >= 1 && i <= 2e6)) throw new v("limit");
1498
+ if (!Number.isInteger(r) || r < 0 || r > 12) throw new v("precision");
1499
+ return { maxCells: t, maxScanned: n, precision: r };
1500
+ }
1501
+ async function nr(e, t, n = {}) {
1502
+ const r = Sn(n), i = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((a) => setTimeout(a, 0))) };
1503
+ z(i.signal);
1504
+ const s = await yn(e, un(e, t, r.maxCells), i), l = n.operation ?? "sum";
1505
+ if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new v("expression");
1506
+ let o = null;
1507
+ if (l === "count") o = s.values.length;
1508
+ else if (s.values.length)
1509
+ if (l === "median") o = await Ie(s.values, i);
1510
+ else {
1511
+ const a = Mn(s.values);
1512
+ l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (a.MEDIAN = await Ie(s.values, i)), o = En(n.expression ?? "", a)) : o = a[l.toUpperCase()];
1513
+ }
1514
+ if (z(i.signal), o !== null && Number.isInteger(o) && !Number.isSafeInteger(o)) throw new v("precision");
1515
+ return { value: o, formatted: o === null ? "—" : o.toFixed(r.precision), numericCells: s.values.length, excludedCells: s.excluded, selectedCells: s.selected, precision: r.precision };
1321
1516
  }
1322
1517
  export {
1323
- nr as CSS_DPI,
1324
- On as DEFAULT_BORDER_PT,
1325
- Y as DEFAULT_FONT_FAMILY,
1326
- zn as DEFAULT_FONT_PT,
1327
- jn as DEFAULT_STROKE_COLOR,
1328
- Me as DEFAULT_TEXT_COLOR,
1329
- Hn as LINE_HEIGHT,
1330
- rr as MM_PER_INCH,
1331
- wr as OutputAssetError,
1332
- Je as OutputFidelityError,
1333
- G as PAPER_SIZES,
1334
- Et as PageBuilder,
1335
- Kn as PaginatePageLimitError,
1336
- Wn as RENDER_PLAN_SCHEMA_VERSION,
1337
- Mr as REPORT_TEMPLATE_DOCUMENT_VERSION,
1518
+ Sr as CSS_DPI,
1519
+ or as DEFAULT_BORDER_PT,
1520
+ ee as DEFAULT_FONT_FAMILY,
1521
+ ar as DEFAULT_FONT_PT,
1522
+ sr as DEFAULT_STROKE_COLOR,
1523
+ Pe as DEFAULT_TEXT_COLOR,
1524
+ lr as LINE_HEIGHT,
1525
+ Tr as MM_PER_INCH,
1526
+ Hr as OutputAssetError,
1527
+ nt as OutputFidelityError,
1528
+ Y as PAPER_SIZES,
1529
+ kt as PageBuilder,
1530
+ mr as PaginatePageLimitError,
1531
+ cr as RENDER_PLAN_SCHEMA_VERSION,
1532
+ _r as REPORT_TEMPLATE_DOCUMENT_VERSION,
1533
+ v as ReportCalculationError,
1338
1534
  M as ReportCellEditError,
1339
- Ut as ReportCellFieldError,
1340
- Rr as ReportParamValidationError,
1341
- Vn as ReportSourceError,
1342
- xr as ReportTemplateError,
1343
- L as ReportTemplateStoreError,
1344
- Bn as SCHEMA_VERSION_MACH,
1345
- Tt as TemplateBuilder,
1346
- Pn as applyReportCellEdit,
1347
- Rn as applyReportCellEditBatch,
1348
- Nn as applyReportEditResult,
1349
- sr as assertRenderPlan,
1350
- Ir as assertReportParams,
1351
- mr as charWidthEm,
1352
- S as classOf,
1353
- Mn as columnsFromContract,
1354
- gt as computePageWindow,
1355
- fr as createCanvasMeasurer,
1356
- vn as createCanvasPager,
1357
- hr as createHeuristicMeasurer,
1358
- Sn as createMemoryTemplateStore,
1359
- Tn as createProviderReport,
1360
- Cn as createReportCellEdit,
1361
- kn as createReportCellEditBatch,
1362
- de as createReportCellResolver,
1363
- qn as createReportSource,
1364
- xn as createTableTemplate,
1365
- yn as createTemplate,
1366
- En as createTemplateManager,
1367
- Tr as createTemplateRegistry,
1368
- Gn as datasetJsonSchema,
1369
- Un as defineReport,
1370
- Er as defineReportTemplate,
1371
- Jn as evalStyleRule,
1372
- Q as formatReportCellEdit,
1373
- An as formatReportClipboard,
1374
- Yn as formatValue,
1375
- ce as getReportCellContext,
1376
- ie as heuristicMeasurer,
1377
- vr as inspectOutputCapabilities,
1378
- J as isImageBackedComponent,
1379
- Ar as isReportDate,
1380
- xe as isRichText,
1381
- se as measurePageSizePx,
1382
- gr as measureTextMm,
1383
- Ee as mergeComponentStyles,
1384
- re as mmToPx,
1385
- ir as mmToPxFactor,
1386
- Xn as paginateTemplate,
1387
- Qn as parseDateLocal,
1388
- Ln as parseReportCellFieldInput,
1389
- ue as parseReportCellInput,
1390
- $n as parseReportClipboard,
1391
- ne as parseReportTemplate,
1392
- gn as planFontSizePx,
1393
- D as ptToPx,
1394
- or as pxToMm,
1395
- Ie as renderComponent,
1396
- dt as renderPage,
1397
- hn as renderPlan,
1398
- wn as renderPlanToCanvas,
1399
- bn as renderPlanToCanvasAsync,
1400
- pn as renderPlanToImages,
1401
- fe as reportCellEditKey,
1402
- B as reportOutputDiagnostics,
1403
- $r as reportParamsJsonSchema,
1404
- Te as resolveBoxBorders,
1405
- z as resolveFontSize,
1406
- W as resolveGridLayout,
1407
- X as resolveLineHeight,
1408
- De as resolvePaper,
1409
- oe as resolvePlanAssets,
1410
- H as resolveStroke,
1411
- Se as resolveTextColor,
1412
- O as round,
1413
- Sr as serializeReportTemplate,
1414
- In as summarizeReportCellEdits,
1415
- Zn as toExcelNumberFormat,
1416
- er as toNumber,
1417
- lr as validateComponent,
1418
- Ge as validateDatasetRows,
1419
- cr as validatePage,
1420
- dr as validateRenderPlan,
1421
- nn as validateReportCellFieldDefinition,
1422
- Nr as validateReportParamDefinitions,
1423
- Lr as validateReportParams,
1424
- Cr as validateReportTemplate,
1425
- Pr as validateReportTemplateDocument,
1426
- Ce as wrapText
1535
+ tn as ReportCellFieldError,
1536
+ Xr as ReportParamValidationError,
1537
+ fr as ReportSourceError,
1538
+ Kr as ReportTemplateError,
1539
+ O as ReportTemplateStoreError,
1540
+ dr as SCHEMA_VERSION_MACH,
1541
+ At as TemplateBuilder,
1542
+ qn as applyReportCellEdit,
1543
+ Yn as applyReportCellEditBatch,
1544
+ er as applyReportEditResult,
1545
+ Rr as assertRenderPlan,
1546
+ Zr as assertReportParams,
1547
+ nr as calculateReportSelection,
1548
+ Fr as charWidthEm,
1549
+ C as classOf,
1550
+ Bn as columnsFromContract,
1551
+ Mt as computePageWindow,
1552
+ Or as createCanvasMeasurer,
1553
+ jn as createCanvasPager,
1554
+ Dr as createHeuristicMeasurer,
1555
+ Gn as createMemoryTemplateStore,
1556
+ Kn as createProviderReport,
1557
+ Un as createReportCellEdit,
1558
+ Jn as createReportCellEditBatch,
1559
+ he as createReportCellResolver,
1560
+ hr as createReportSource,
1561
+ _n as createTableTemplate,
1562
+ Wn as createTemplate,
1563
+ Vn as createTemplateManager,
1564
+ Vr as createTemplateRegistry,
1565
+ gr as datasetJsonSchema,
1566
+ pr as defineReport,
1567
+ Gr as defineReportTemplate,
1568
+ wr as evalStyleRule,
1569
+ En as evaluateReportAggregateExpression,
1570
+ ne as formatReportCellEdit,
1571
+ Zn as formatReportClipboard,
1572
+ br as formatValue,
1573
+ fe as getReportCellContext,
1574
+ le as heuristicMeasurer,
1575
+ Wr as inspectOutputCapabilities,
1576
+ Q as isImageBackedComponent,
1577
+ Qr as isReportDate,
1578
+ Re as isRichText,
1579
+ ue as measurePageSizePx,
1580
+ Lr as measureTextMm,
1581
+ ke as mergeComponentStyles,
1582
+ se as mmToPx,
1583
+ Cr as mmToPxFactor,
1584
+ vr as paginateTemplate,
1585
+ yr as parseDateLocal,
1586
+ tr as parseReportCellFieldInput,
1587
+ ge as parseReportCellInput,
1588
+ Qn as parseReportClipboard,
1589
+ ae as parseReportTemplate,
1590
+ Dn as planFontSizePx,
1591
+ L as ptToPx,
1592
+ Ir as pxToMm,
1593
+ Le as renderComponent,
1594
+ wt as renderPage,
1595
+ On as renderPlan,
1596
+ zn as renderPlanToCanvas,
1597
+ Hn as renderPlanToCanvasAsync,
1598
+ Ln as renderPlanToImages,
1599
+ we as reportCellEditKey,
1600
+ V as reportOutputDiagnostics,
1601
+ ei as reportParamsJsonSchema,
1602
+ Ae as resolveBoxBorders,
1603
+ j as resolveFontSize,
1604
+ K as resolveGridLayout,
1605
+ te as resolveLineHeight,
1606
+ _e as resolvePaper,
1607
+ ce as resolvePlanAssets,
1608
+ B as resolveStroke,
1609
+ $e as resolveTextColor,
1610
+ H as round,
1611
+ Ur as serializeReportTemplate,
1612
+ Xn as summarizeReportCellEdits,
1613
+ xr as toExcelNumberFormat,
1614
+ Mr as toNumber,
1615
+ Ar as validateComponent,
1616
+ et as validateDatasetRows,
1617
+ kr as validatePage,
1618
+ $r as validateRenderPlan,
1619
+ dn as validateReportCellFieldDefinition,
1620
+ ti as validateReportParamDefinitions,
1621
+ ni as validateReportParams,
1622
+ qr as validateReportTemplate,
1623
+ Jr as validateReportTemplateDocument,
1624
+ Ne as wrapText
1427
1625
  };