@agile-team/mach-report 2.22.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +98 -45
- package/dist/designer.d.ts +98 -45
- package/dist/designer.js +3 -3
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1642 -1586
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +24 -0
- package/dist/vue/async.d.ts +24 -0
- package/dist/vue/index.d.cts +25 -1
- package/dist/vue/index.d.ts +25 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -1,81 +1,93 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!
|
|
1
|
+
function G(r, e, t) {
|
|
2
|
+
if (!Array.isArray(r) || Object.getPrototypeOf(r) !== Array.prototype || r.length > e) throw new TypeError(`${t}应为有界普通数组`);
|
|
3
|
+
if (Reflect.ownKeys(r).length !== r.length + 1) throw new TypeError(`${t}不支持自定义数组方法或迭代器`);
|
|
4
|
+
const n = [];
|
|
5
|
+
for (let o = 0; o < r.length; o++) {
|
|
6
|
+
const c = Object.getOwnPropertyDescriptor(r, String(o));
|
|
7
|
+
if (!c || !Object.prototype.hasOwnProperty.call(c, "value")) throw new TypeError(`${t}不支持空洞或访问器`);
|
|
8
|
+
n.push(c.value);
|
|
9
|
+
}
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
const b = 1e3;
|
|
13
|
+
function d(r) {
|
|
14
|
+
if (!Number.isSafeInteger(r) || r < 0 || r > b * 2)
|
|
3
15
|
throw new Error("十进制精度超出预算");
|
|
4
16
|
return 10n ** BigInt(r);
|
|
5
17
|
}
|
|
6
|
-
function
|
|
7
|
-
if (r.coefficient.toString().length >
|
|
18
|
+
function j(r) {
|
|
19
|
+
if (r.coefficient.toString().length > b * 2 || r.scale > b * 2)
|
|
8
20
|
throw new Error("十进制结果超出精度预算");
|
|
9
21
|
return r;
|
|
10
22
|
}
|
|
11
|
-
function
|
|
23
|
+
function u(r) {
|
|
12
24
|
if (typeof r != "string" && !(typeof r == "number" && Number.isFinite(r)))
|
|
13
25
|
throw new Error("十进制参数必须是有限数字或十进制文本");
|
|
14
26
|
const e = String(r);
|
|
15
|
-
if (e.length >
|
|
27
|
+
if (e.length > b) throw new Error("十进制文本超出精度预算");
|
|
16
28
|
const t = /^([+-]?)(\d+)(?:\.(\d*))?(?:[eE]([+-]?\d{1,4}))?$/.exec(
|
|
17
29
|
e
|
|
18
30
|
);
|
|
19
31
|
if (!t) throw new Error("无效十进制文本");
|
|
20
|
-
const n = t[3] ?? "",
|
|
32
|
+
const n = t[3] ?? "", o = Number(t[4] ?? 0), c = n.length - o, i = BigInt(
|
|
21
33
|
`${t[1] === "-" ? "-" : ""}${t[2]}${n}`
|
|
22
34
|
);
|
|
23
|
-
return
|
|
24
|
-
c < 0 ? { coefficient:
|
|
35
|
+
return j(
|
|
36
|
+
c < 0 ? { coefficient: i * d(-c), scale: 0 } : { coefficient: i, scale: c }
|
|
25
37
|
);
|
|
26
38
|
}
|
|
27
|
-
function
|
|
39
|
+
function L(r, e) {
|
|
28
40
|
const t = Math.max(r.scale, e.scale);
|
|
29
41
|
return [
|
|
30
|
-
r.coefficient *
|
|
31
|
-
e.coefficient *
|
|
42
|
+
r.coefficient * d(t - r.scale),
|
|
43
|
+
e.coefficient * d(t - e.scale),
|
|
32
44
|
t
|
|
33
45
|
];
|
|
34
46
|
}
|
|
35
|
-
function
|
|
36
|
-
const [t, n] =
|
|
47
|
+
function A(r, e) {
|
|
48
|
+
const [t, n] = L(r, e);
|
|
37
49
|
return t < n ? -1 : t > n ? 1 : 0;
|
|
38
50
|
}
|
|
39
|
-
function
|
|
40
|
-
const [t, n,
|
|
41
|
-
return
|
|
51
|
+
function O(r, e) {
|
|
52
|
+
const [t, n, o] = L(r, e);
|
|
53
|
+
return j({ coefficient: t + n, scale: o });
|
|
42
54
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
55
|
+
function P(r, e) {
|
|
56
|
+
return j({
|
|
45
57
|
coefficient: r.coefficient * e.coefficient,
|
|
46
58
|
scale: r.scale + e.scale
|
|
47
59
|
});
|
|
48
60
|
}
|
|
49
|
-
function
|
|
50
|
-
const t = r / e, n = r % e,
|
|
51
|
-
return
|
|
61
|
+
function H(r, e) {
|
|
62
|
+
const t = r / e, n = r % e, o = (c) => c < 0n ? -c : c;
|
|
63
|
+
return o(n) * 2n < o(e) ? t : t + (r < 0n == e < 0n ? 1n : -1n);
|
|
52
64
|
}
|
|
53
|
-
function
|
|
65
|
+
function h(r) {
|
|
54
66
|
if (!Number.isInteger(r) || r < 0 || r > 100)
|
|
55
67
|
throw new Error("十进制小数位应为 0–100 的整数");
|
|
56
68
|
}
|
|
57
|
-
function
|
|
58
|
-
if (
|
|
59
|
-
const n = e.scale - r.scale + t,
|
|
60
|
-
return
|
|
61
|
-
coefficient:
|
|
69
|
+
function k(r, e, t = 20) {
|
|
70
|
+
if (h(t), e.coefficient === 0n) throw new Error("不能除以零");
|
|
71
|
+
const n = e.scale - r.scale + t, o = r.coefficient * d(Math.max(0, n)), c = e.coefficient * d(Math.max(0, -n));
|
|
72
|
+
return j({
|
|
73
|
+
coefficient: H(o, c),
|
|
62
74
|
scale: t
|
|
63
75
|
});
|
|
64
76
|
}
|
|
65
|
-
function
|
|
77
|
+
function F(r, e) {
|
|
66
78
|
let t = r.coefficient, n = r.scale;
|
|
67
|
-
e !== void 0 && (
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
return e === void 0 && (
|
|
71
|
-
}
|
|
72
|
-
function
|
|
73
|
-
let
|
|
74
|
-
n && (
|
|
75
|
-
const [c,
|
|
76
|
-
return `${t ? c.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : c}${
|
|
77
|
-
}
|
|
78
|
-
const
|
|
79
|
+
e !== void 0 && (h(e), t = e >= n ? t * d(e - n) : H(t, d(n - e)), n = e);
|
|
80
|
+
const o = t < 0n, c = (o ? -t : t).toString().padStart(n + 1, "0");
|
|
81
|
+
let i = n ? c.slice(-n) : "";
|
|
82
|
+
return e === void 0 && (i = i.replace(/0+$/, "")), `${o ? "-" : ""}${n ? c.slice(0, -n) : c}${i ? `.${i}` : ""}`;
|
|
83
|
+
}
|
|
84
|
+
function Cr(r, e, t = !1, n = !1) {
|
|
85
|
+
let o = u(r);
|
|
86
|
+
n && (o = P(o, { coefficient: 100n, scale: 0 }));
|
|
87
|
+
const [c, i] = F(o, e).split(".");
|
|
88
|
+
return `${t ? c.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : c}${i === void 0 ? "" : `.${i}`}${n ? "%" : ""}`;
|
|
89
|
+
}
|
|
90
|
+
const er = [
|
|
79
91
|
"sum",
|
|
80
92
|
"count",
|
|
81
93
|
"avg",
|
|
@@ -83,143 +95,143 @@ const H = [
|
|
|
83
95
|
"max",
|
|
84
96
|
"weightedAvg"
|
|
85
97
|
];
|
|
86
|
-
function
|
|
98
|
+
function I(r) {
|
|
87
99
|
if (typeof r != "number" || !Number.isFinite(r))
|
|
88
100
|
throw new Error(
|
|
89
101
|
"聚合度量必须是有限数字,不能隐式转换;小数文本请显式选择 decimal"
|
|
90
102
|
);
|
|
91
103
|
return r;
|
|
92
104
|
}
|
|
93
|
-
function
|
|
105
|
+
function v(r, e) {
|
|
94
106
|
return e && Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
|
|
95
107
|
}
|
|
96
|
-
function
|
|
97
|
-
let e = 0, t = 0, n = 0,
|
|
108
|
+
function tr(r) {
|
|
109
|
+
let e = 0, t = 0, n = 0, o = 0, c = 1 / 0, i = -1 / 0;
|
|
98
110
|
const a = (s) => {
|
|
99
|
-
const f = s - n,
|
|
100
|
-
n =
|
|
111
|
+
const f = s - n, l = t + f;
|
|
112
|
+
n = l - t - f, t = l;
|
|
101
113
|
};
|
|
102
114
|
return {
|
|
103
115
|
add(s) {
|
|
104
|
-
const f =
|
|
116
|
+
const f = v(s, r.field);
|
|
105
117
|
if (r.op === "count") {
|
|
106
118
|
(!r.field || f != null) && e++;
|
|
107
119
|
return;
|
|
108
120
|
}
|
|
109
121
|
if (f == null) return;
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
if (r.op === "weightedAvg" &&
|
|
122
|
+
const l = I(f), g = r.op === "weightedAvg" ? v(s, r.weightField) : 1;
|
|
123
|
+
if (g == null) return;
|
|
124
|
+
const x = I(g);
|
|
125
|
+
if (r.op === "weightedAvg" && x < 0)
|
|
114
126
|
throw new Error("加权平均的权重不能为负数");
|
|
115
|
-
["sum", "avg", "weightedAvg"].includes(r.op) && a(
|
|
127
|
+
["sum", "avg", "weightedAvg"].includes(r.op) && a(l * x), o += x, c = Math.min(c, l), i = Math.max(i, l), e++;
|
|
116
128
|
},
|
|
117
129
|
value() {
|
|
118
130
|
if (r.op === "count") return e;
|
|
119
131
|
if (!e) return null;
|
|
120
|
-
const s = r.op === "min" ? c : r.op === "max" ?
|
|
132
|
+
const s = r.op === "min" ? c : r.op === "max" ? i : r.op === "avg" ? t / e : r.op === "weightedAvg" ? o === 0 ? null : t / o : t;
|
|
121
133
|
if (s !== null && !Number.isFinite(s))
|
|
122
134
|
throw new Error("聚合计算溢出");
|
|
123
135
|
return s;
|
|
124
136
|
}
|
|
125
137
|
};
|
|
126
138
|
}
|
|
127
|
-
function
|
|
128
|
-
let e = 0, t =
|
|
139
|
+
function nr(r) {
|
|
140
|
+
let e = 0, t = u("0"), n = u("0"), o, c;
|
|
129
141
|
return {
|
|
130
|
-
add(
|
|
131
|
-
const a =
|
|
142
|
+
add(i) {
|
|
143
|
+
const a = v(i, r.field);
|
|
132
144
|
if (r.op === "count") {
|
|
133
145
|
(!r.field || a != null) && e++;
|
|
134
146
|
return;
|
|
135
147
|
}
|
|
136
148
|
if (a == null) return;
|
|
137
|
-
const s = r.op === "weightedAvg" ?
|
|
149
|
+
const s = r.op === "weightedAvg" ? v(i, r.weightField) : "1";
|
|
138
150
|
if (s == null) return;
|
|
139
|
-
const f =
|
|
140
|
-
if (r.op === "weightedAvg" &&
|
|
151
|
+
const f = u(a), l = u(s);
|
|
152
|
+
if (r.op === "weightedAvg" && l.coefficient < 0n)
|
|
141
153
|
throw new Error("加权平均的权重不能为负数");
|
|
142
|
-
["sum", "avg", "weightedAvg"].includes(r.op) && (t =
|
|
154
|
+
["sum", "avg", "weightedAvg"].includes(r.op) && (t = O(t, P(f, l))), r.op === "weightedAvg" && (n = O(n, l)), (!o || A(f, o) < 0) && (o = f), (!c || A(f, c) > 0) && (c = f), e++;
|
|
143
155
|
},
|
|
144
156
|
value() {
|
|
145
157
|
if (r.op === "count") return e;
|
|
146
158
|
if (!e || r.op === "weightedAvg" && n.coefficient === 0n)
|
|
147
159
|
return null;
|
|
148
|
-
let
|
|
149
|
-
return r.op === "avg" && (
|
|
160
|
+
let i = r.op === "min" ? o : r.op === "max" ? c : t;
|
|
161
|
+
return r.op === "avg" && (i = k(t, u(e), r.digits)), r.op === "weightedAvg" && (i = k(t, n, r.digits)), F(i, r.digits);
|
|
150
162
|
}
|
|
151
163
|
};
|
|
152
164
|
}
|
|
153
|
-
function
|
|
154
|
-
if (r.digits !== void 0 &&
|
|
165
|
+
function C(r) {
|
|
166
|
+
if (r.digits !== void 0 && h(r.digits), r.numeric !== void 0 && r.numeric !== "number" && r.numeric !== "decimal")
|
|
155
167
|
throw new Error("未知聚合数值模式");
|
|
156
|
-
if (!
|
|
168
|
+
if (!er.includes(r.op)) throw new Error("未知聚合操作");
|
|
157
169
|
if (r.op !== "count" && !r.field)
|
|
158
170
|
throw new Error("聚合需要度量字段");
|
|
159
171
|
if (r.op === "weightedAvg" && !r.weightField)
|
|
160
172
|
throw new Error("加权平均需要权重字段");
|
|
161
|
-
return r.numeric === "decimal" ?
|
|
173
|
+
return r.numeric === "decimal" ? nr(r) : tr(r);
|
|
162
174
|
}
|
|
163
|
-
function
|
|
164
|
-
const t =
|
|
175
|
+
function U(r, e) {
|
|
176
|
+
const t = C(e);
|
|
165
177
|
for (const n of r) t.add(n);
|
|
166
178
|
return t.value();
|
|
167
179
|
}
|
|
168
|
-
const
|
|
169
|
-
function
|
|
180
|
+
const Q = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
181
|
+
function q(r) {
|
|
170
182
|
if (!r || typeof r != "object" || Array.isArray(r) || ![Object.prototype, null].includes(Object.getPrototypeOf(r))) throw new Error("条件应为普通声明式对象");
|
|
171
|
-
for (const [e, t] of Object.entries(Object.getOwnPropertyDescriptors(r))) if (
|
|
183
|
+
for (const [e, t] of Object.entries(Object.getOwnPropertyDescriptors(r))) if (Q.has(e) || !Object.prototype.hasOwnProperty.call(t, "value")) throw new Error("条件不允许访问器或不安全属性");
|
|
172
184
|
}
|
|
173
|
-
function
|
|
174
|
-
if (typeof r != "string" || !r.trim() || r.length > 512 ||
|
|
185
|
+
function V(r) {
|
|
186
|
+
if (typeof r != "string" || !r.trim() || r.length > 512 || Q.has(r)) throw new Error("条件字段应为安全的非空字段名");
|
|
175
187
|
}
|
|
176
188
|
function M(r) {
|
|
177
189
|
if (r !== null && typeof r != "boolean" && typeof r != "string" && !(typeof r == "number" && Number.isFinite(r))) throw new Error("条件常量应为有限 JSON 标量");
|
|
178
190
|
if (typeof r == "string" && r.length > 16384) throw new Error("条件文本超出预算");
|
|
179
191
|
}
|
|
180
|
-
function
|
|
192
|
+
function R(r) {
|
|
181
193
|
if (typeof r != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(r)) throw new Error("日期条件使用 YYYY-MM-DD 日历日");
|
|
182
|
-
const [e, t, n] = r.split("-").map(Number),
|
|
183
|
-
if (
|
|
194
|
+
const [e, t, n] = r.split("-").map(Number), o = /* @__PURE__ */ new Date(0);
|
|
195
|
+
if (o.setUTCFullYear(e, t - 1, n), o.setUTCHours(0, 0, 0, 0), o.getUTCFullYear() !== e || o.getUTCMonth() !== t - 1 || o.getUTCDate() !== n) throw new Error("无效日历日");
|
|
184
196
|
return r;
|
|
185
197
|
}
|
|
186
|
-
function
|
|
198
|
+
function W(r) {
|
|
187
199
|
return ["string", "boolean"].includes(typeof r) || typeof r == "number" && Number.isFinite(r);
|
|
188
200
|
}
|
|
189
|
-
function
|
|
201
|
+
function z(r) {
|
|
190
202
|
return r == null || r === "";
|
|
191
203
|
}
|
|
192
|
-
function
|
|
204
|
+
function or(r) {
|
|
193
205
|
const e = r.values?.[0] ?? (r.right && "value" in r.right ? r.right.value : r.value);
|
|
194
206
|
return r.valueType ?? r.numeric ?? (typeof e == "number" ? "decimal" : typeof e == "boolean" ? "boolean" : "text");
|
|
195
207
|
}
|
|
196
|
-
function
|
|
197
|
-
if (
|
|
198
|
-
const n =
|
|
208
|
+
function y(r, e, t) {
|
|
209
|
+
if (z(r) || z(e)) return;
|
|
210
|
+
const n = or(t);
|
|
199
211
|
try {
|
|
200
|
-
if (n === "decimal") return
|
|
212
|
+
if (n === "decimal") return A(u(r), u(e));
|
|
201
213
|
if (n === "number")
|
|
202
|
-
return !["number", "string"].includes(typeof r) || !["number", "string"].includes(typeof e) ? void 0 :
|
|
203
|
-
if (n === "date" && (r =
|
|
204
|
-
const
|
|
205
|
-
return
|
|
214
|
+
return !["number", "string"].includes(typeof r) || !["number", "string"].includes(typeof e) ? void 0 : A(u(r), u(e));
|
|
215
|
+
if (n === "date" && (r = R(r), e = R(e)), n === "boolean" && (typeof r != "boolean" || typeof e != "boolean") || n === "text" && (!W(r) || !W(e))) return;
|
|
216
|
+
const o = String(r), c = String(e);
|
|
217
|
+
return o < c ? -1 : o > c ? 1 : 0;
|
|
206
218
|
} catch {
|
|
207
219
|
return;
|
|
208
220
|
}
|
|
209
221
|
}
|
|
210
|
-
function
|
|
211
|
-
if (
|
|
222
|
+
function ir(r) {
|
|
223
|
+
if (V(r.field), ![">", ">=", "<", "<=", "==", "!=", "between", "contains", "isNull", "isNotNull"].includes(r.op)) throw new Error("未知条件运算符");
|
|
212
224
|
if (r.numeric !== void 0 && !["number", "decimal"].includes(r.numeric)) throw new Error("未知条件数值模式");
|
|
213
225
|
if (r.valueType !== void 0 && !["number", "decimal", "text", "date", "boolean"].includes(r.valueType)) throw new Error("未知条件值类型");
|
|
214
226
|
if (!(r.op === "isNull" || r.op === "isNotNull"))
|
|
215
227
|
if (r.op === "between") {
|
|
216
228
|
if (!Array.isArray(r.values) || r.values.length !== 2 || Object.keys(r.values).length !== 2) throw new Error("范围条件需要两个明确边界");
|
|
217
229
|
r.values.forEach(M);
|
|
218
|
-
const e =
|
|
230
|
+
const e = y(r.values[0], r.values[1], r);
|
|
219
231
|
if (e === void 0 || e > 0) throw new Error("范围边界无效或顺序颠倒");
|
|
220
232
|
} else if (r.right !== void 0) {
|
|
221
|
-
if (
|
|
222
|
-
if ("field" in r.right ?
|
|
233
|
+
if (q(r.right), Object.keys(r.right).length !== 1) throw new Error("条件 right 只能指定一个 field 或 value");
|
|
234
|
+
if ("field" in r.right ? V(r.right.field) : M(r.right.value), r.value !== void 0) throw new Error("条件不能同时指定 value 和 right");
|
|
223
235
|
} else M(r.value);
|
|
224
236
|
}
|
|
225
237
|
function D(r, e) {
|
|
@@ -241,45 +253,45 @@ function D(r, e) {
|
|
|
241
253
|
return !1;
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
256
|
+
function cr(r) {
|
|
257
|
+
ir(r), r = { ...r, right: r.right ? { ...r.right } : void 0, values: r.values ? [r.values[0], r.values[1]] : void 0 };
|
|
246
258
|
const e = (t, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : void 0;
|
|
247
259
|
return (t) => {
|
|
248
260
|
const n = e(t, r.field);
|
|
249
261
|
if (r.op === "isNull") return n == null;
|
|
250
262
|
if (r.op === "isNotNull") return n != null;
|
|
251
|
-
if (r.op === "between") return D(">=",
|
|
252
|
-
const
|
|
253
|
-
return r.op === "contains" ? typeof n == "string" && typeof
|
|
263
|
+
if (r.op === "between") return D(">=", y(n, r.values[0], r)) && D("<=", y(n, r.values[1], r));
|
|
264
|
+
const o = r.right ? "field" in r.right ? e(t, r.right.field) : r.right.value : r.value;
|
|
265
|
+
return r.op === "contains" ? typeof n == "string" && typeof o == "string" && n.includes(o) : D(r.op, y(n, o, r));
|
|
254
266
|
};
|
|
255
267
|
}
|
|
256
|
-
function
|
|
268
|
+
function w(r, e = { nodes: 0 }, t = 0) {
|
|
257
269
|
if (++e.nodes > 256 || t > 16) throw new Error("条件超出深度或节点预算");
|
|
258
|
-
if (
|
|
270
|
+
if (q(r), ["all", "any", "not", "field"].filter((o) => Object.prototype.hasOwnProperty.call(r, o)).length !== 1) throw new Error("条件只能指定一种组合或比较");
|
|
259
271
|
if ("not" in r) {
|
|
260
|
-
const
|
|
261
|
-
return (c) => !
|
|
272
|
+
const o = w(r.not, e, t + 1);
|
|
273
|
+
return (c) => !o(c);
|
|
262
274
|
}
|
|
263
275
|
if ("all" in r || "any" in r) {
|
|
264
|
-
const
|
|
265
|
-
if (!Array.isArray(
|
|
266
|
-
const c =
|
|
267
|
-
return "all" in r ? (
|
|
276
|
+
const o = "all" in r ? r.all : r.any;
|
|
277
|
+
if (!Array.isArray(o) || o.length < 1 || o.length > 256 || Object.keys(o).length !== o.length) throw new Error("组合条件需要有界、无空位的非空数组");
|
|
278
|
+
const c = o.map((i) => w(i, e, t + 1));
|
|
279
|
+
return "all" in r ? (i) => c.every((a) => a(i)) : (i) => c.some((a) => a(i));
|
|
268
280
|
}
|
|
269
|
-
return
|
|
281
|
+
return cr(r);
|
|
270
282
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
283
|
+
function Yr(r, e) {
|
|
284
|
+
return w(e)(r);
|
|
273
285
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
286
|
+
function ar(r) {
|
|
287
|
+
w(r);
|
|
276
288
|
const e = /* @__PURE__ */ new Set();
|
|
277
289
|
function t(n) {
|
|
278
290
|
"all" in n ? n.all.forEach(t) : "any" in n ? n.any.forEach(t) : "not" in n ? t(n.not) : (e.add(n.field), n.right && "field" in n.right && e.add(n.right.field));
|
|
279
291
|
}
|
|
280
292
|
return t(r), [...e];
|
|
281
293
|
}
|
|
282
|
-
const
|
|
294
|
+
const sr = [
|
|
283
295
|
{ name: "add", minArgs: 2, maxArgs: 256, input: "numeric", output: "numeric", example: "add(quantity, adjustment)" },
|
|
284
296
|
{ name: "subtract", minArgs: 2, maxArgs: 2, input: "numeric", output: "numeric", example: "subtract(input, output)" },
|
|
285
297
|
{ name: "multiply", minArgs: 2, maxArgs: 256, input: "numeric", output: "numeric", example: "multiply(quantity, price)" },
|
|
@@ -295,55 +307,55 @@ const or = [
|
|
|
295
307
|
{ name: "dateYear", minArgs: 1, maxArgs: 1, input: "YYYY-MM-DD", output: "number", example: "dateYear(reportDate)" },
|
|
296
308
|
{ name: "dateMonth", minArgs: 1, maxArgs: 1, input: "YYYY-MM-DD", output: "number", example: "dateMonth(reportDate)" },
|
|
297
309
|
{ name: "dateDay", minArgs: 1, maxArgs: 1, input: "YYYY-MM-DD", output: "number", example: "dateDay(reportDate)" }
|
|
298
|
-
],
|
|
299
|
-
function
|
|
310
|
+
], T = Object.freeze(sr.map((r) => Object.freeze(r)));
|
|
311
|
+
function fr(r, e, t, n, o) {
|
|
300
312
|
if (e.some((a) => a == null)) {
|
|
301
|
-
if (
|
|
313
|
+
if (o === "error") throw new Error("函数参数包含空值");
|
|
302
314
|
return null;
|
|
303
315
|
}
|
|
304
|
-
if (r === "round" || r === "abs") return
|
|
316
|
+
if (r === "round" || r === "abs") return lr(r, e, t, n);
|
|
305
317
|
if (r.startsWith("date")) {
|
|
306
|
-
const a =
|
|
318
|
+
const a = R(e[0]);
|
|
307
319
|
return Number(a.slice(r === "dateYear" ? 0 : r === "dateMonth" ? 5 : 8, r === "dateYear" ? 4 : r === "dateMonth" ? 7 : 10));
|
|
308
320
|
}
|
|
309
321
|
if (e.some((a) => typeof a != "string")) throw new Error("文本函数只接受文本,不隐式转换数字或空值");
|
|
310
322
|
if (e.reduce((a, s) => a + s.length, 0) > 1e6) throw new Error("计算文本超出长度预算");
|
|
311
|
-
const c = e[0],
|
|
312
|
-
if (
|
|
313
|
-
return
|
|
314
|
-
}
|
|
315
|
-
function
|
|
316
|
-
const
|
|
317
|
-
if (t !== "decimal" && (typeof
|
|
318
|
-
const c =
|
|
323
|
+
const c = e[0], i = r === "concat" ? e.join("") : r === "trim" ? c.trim() : r === "upper" ? c.toUpperCase() : c.toLowerCase();
|
|
324
|
+
if (i.length > 1e6) throw new Error("计算文本超出长度预算");
|
|
325
|
+
return i;
|
|
326
|
+
}
|
|
327
|
+
function lr(r, e, t, n) {
|
|
328
|
+
const o = e[0];
|
|
329
|
+
if (t !== "decimal" && (typeof o != "number" || !Number.isFinite(o))) throw new Error("普通数值函数需要有限数字");
|
|
330
|
+
const c = u(o);
|
|
319
331
|
r === "abs" && (c.coefficient = c.coefficient < 0n ? -c.coefficient : c.coefficient);
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
if (typeof
|
|
323
|
-
|
|
332
|
+
const i = r === "round" ? e.length === 2 ? e[1] : n ?? 0 : n;
|
|
333
|
+
if (i !== void 0) {
|
|
334
|
+
if (typeof i != "number") throw new Error("小数位必须为数字");
|
|
335
|
+
h(i);
|
|
324
336
|
}
|
|
325
|
-
const a =
|
|
337
|
+
const a = F(c, i), s = Number(a);
|
|
326
338
|
if (t !== "decimal" && !Number.isFinite(s)) throw new Error("计算结果不是有限数字");
|
|
327
339
|
return t === "decimal" ? a : s;
|
|
328
340
|
}
|
|
329
|
-
const
|
|
330
|
-
function
|
|
331
|
-
if (typeof r != "string" || !r.trim() ||
|
|
341
|
+
const ur = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
342
|
+
function m(r) {
|
|
343
|
+
if (typeof r != "string" || !r.trim() || ur.has(r))
|
|
332
344
|
throw new Error("计算字段应为安全的非空字段名");
|
|
333
345
|
}
|
|
334
|
-
function
|
|
346
|
+
function Y(r) {
|
|
335
347
|
return r === null || ["string", "boolean"].includes(typeof r) || typeof r == "number" && Number.isFinite(r);
|
|
336
348
|
}
|
|
337
|
-
function
|
|
349
|
+
function mr(r) {
|
|
338
350
|
if (r.some((e) => typeof e != "number" || !Number.isFinite(e)))
|
|
339
351
|
throw new Error("算术参数必须是有限数字;空值和小数文本不会隐式转换");
|
|
340
352
|
return r;
|
|
341
353
|
}
|
|
342
|
-
function
|
|
343
|
-
const t =
|
|
354
|
+
function gr(r, e) {
|
|
355
|
+
const t = mr(e);
|
|
344
356
|
let n;
|
|
345
|
-
if (r === "add") n = t.reduce((
|
|
346
|
-
else if (r === "multiply") n = t.reduce((
|
|
357
|
+
if (r === "add") n = t.reduce((o, c) => o + c, 0);
|
|
358
|
+
else if (r === "multiply") n = t.reduce((o, c) => o * c, 1);
|
|
347
359
|
else if (r === "subtract") n = t[0] - t[1];
|
|
348
360
|
else {
|
|
349
361
|
if (t[1] === 0) throw new Error("不能除以零");
|
|
@@ -352,19 +364,19 @@ function ur(r, e) {
|
|
|
352
364
|
if (!Number.isFinite(n)) throw new Error("计算结果不是有限数字");
|
|
353
365
|
return n;
|
|
354
366
|
}
|
|
355
|
-
function
|
|
356
|
-
const n = e.map(
|
|
357
|
-
let
|
|
358
|
-
return r === "add" ?
|
|
367
|
+
function pr(r, e, t) {
|
|
368
|
+
const n = e.map(u);
|
|
369
|
+
let o;
|
|
370
|
+
return r === "add" ? o = n.reduce(O) : r === "multiply" ? o = n.reduce(P) : r === "subtract" ? o = O(n[0], {
|
|
359
371
|
...n[1],
|
|
360
372
|
coefficient: -n[1].coefficient
|
|
361
|
-
}) :
|
|
373
|
+
}) : o = k(n[0], n[1], t), F(o, t);
|
|
362
374
|
}
|
|
363
|
-
function
|
|
364
|
-
return t.nulls !== "error" && e.some((n) => n == null) || r === "divide" && t.divisionByZero === "null" && (t.numeric === "decimal" ?
|
|
375
|
+
function dr(r, e, t) {
|
|
376
|
+
return t.nulls !== "error" && e.some((n) => n == null) || r === "divide" && t.divisionByZero === "null" && (t.numeric === "decimal" ? u(e[1]).coefficient === 0n : e[1] === 0) ? null : t.numeric === "decimal" ? pr(r, e, t.digits) : gr(r, e);
|
|
365
377
|
}
|
|
366
|
-
function
|
|
367
|
-
r.field !== void 0 &&
|
|
378
|
+
function wr(r, e) {
|
|
379
|
+
r.field !== void 0 && m(r.field), r.weightField !== void 0 && m(r.weightField);
|
|
368
380
|
const t = {
|
|
369
381
|
op: r.aggregate,
|
|
370
382
|
field: r.field,
|
|
@@ -372,217 +384,282 @@ function gr(r, e) {
|
|
|
372
384
|
numeric: e.numeric,
|
|
373
385
|
digits: e.digits
|
|
374
386
|
};
|
|
375
|
-
|
|
387
|
+
U([], t);
|
|
376
388
|
const n = /* @__PURE__ */ new WeakMap();
|
|
377
|
-
return (
|
|
378
|
-
let c = n.get(
|
|
389
|
+
return (o) => {
|
|
390
|
+
let c = n.get(o.rows);
|
|
379
391
|
if (!c) {
|
|
380
392
|
try {
|
|
381
|
-
c = { value:
|
|
382
|
-
} catch (
|
|
393
|
+
c = { value: U(o.rows, t) };
|
|
394
|
+
} catch (i) {
|
|
383
395
|
c = {
|
|
384
|
-
error:
|
|
396
|
+
error: i instanceof Error ? i : new Error(String(i))
|
|
385
397
|
};
|
|
386
398
|
}
|
|
387
|
-
n.set(
|
|
399
|
+
n.set(o.rows, c);
|
|
388
400
|
}
|
|
389
401
|
if (c.error) throw c.error;
|
|
390
402
|
return c.value;
|
|
391
403
|
};
|
|
392
404
|
}
|
|
393
|
-
function
|
|
405
|
+
function hr(r, e) {
|
|
394
406
|
for (const t of r) {
|
|
395
407
|
const n = t(e);
|
|
396
408
|
if (n != null) return n;
|
|
397
409
|
}
|
|
398
410
|
return null;
|
|
399
411
|
}
|
|
400
|
-
function
|
|
412
|
+
function B(r, e = {}, t = { nodes: 0 }, n = 0) {
|
|
401
413
|
if (++t.nodes > 256 || n > 16)
|
|
402
414
|
throw new Error("计算表达式超出深度或节点预算");
|
|
403
415
|
if (!r || typeof r != "object" || Array.isArray(r))
|
|
404
416
|
throw new Error("计算表达式应为声明式对象");
|
|
405
|
-
if ("aggregate" in r) return
|
|
417
|
+
if ("aggregate" in r) return wr(r, e);
|
|
406
418
|
if ("field" in r) {
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
return ({ row: c }) => Object.prototype.hasOwnProperty.call(c,
|
|
419
|
+
m(r.field);
|
|
420
|
+
const o = r.field;
|
|
421
|
+
return ({ row: c }) => Object.prototype.hasOwnProperty.call(c, o) ? c[o] : void 0;
|
|
410
422
|
}
|
|
411
423
|
if ("value" in r) {
|
|
412
|
-
if (!
|
|
424
|
+
if (!Y(r.value))
|
|
413
425
|
throw new Error("常量应为有限 JSON 标量");
|
|
414
426
|
return () => r.value;
|
|
415
427
|
}
|
|
416
|
-
return
|
|
428
|
+
return yr(r, e, t, n);
|
|
417
429
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
if (!
|
|
430
|
+
function yr(r, e, t, n) {
|
|
431
|
+
const o = T.find((a) => a.name === r.op);
|
|
432
|
+
if (!o || !Array.isArray(r.args)) throw new Error("未知计算操作");
|
|
421
433
|
if (r.args.length > 256 || Object.keys(r.args).length !== r.args.length) throw new Error("计算参数超出预算或包含空位");
|
|
422
|
-
if (r.args.length <
|
|
423
|
-
const c = r.op === "if" ?
|
|
434
|
+
if (r.args.length < o.minArgs || r.args.length > o.maxArgs) throw new Error("运算参数数量不正确");
|
|
435
|
+
const c = r.op === "if" ? w(r.condition, t, n + 1) : void 0;
|
|
424
436
|
if (r.op !== "if" && r.condition !== void 0) throw new Error("仅 IF 运算接受 condition");
|
|
425
|
-
const
|
|
426
|
-
(a) =>
|
|
437
|
+
const i = r.args.map(
|
|
438
|
+
(a) => B(a, e, t, n + 1)
|
|
427
439
|
);
|
|
428
|
-
return c ? (a) =>
|
|
440
|
+
return c ? (a) => i[c(a.row) ? 0 : 1](a) : ["add", "subtract", "multiply", "divide", "coalesce"].includes(r.op) ? r.op === "coalesce" ? (a) => hr(i, a) : (a) => dr(
|
|
429
441
|
r.op,
|
|
430
|
-
|
|
442
|
+
i.map((s) => s(a)),
|
|
431
443
|
e
|
|
432
|
-
) : (a) =>
|
|
444
|
+
) : (a) => fr(r.op, i.map((s) => s(a)), e.numeric, e.digits, e.nulls);
|
|
433
445
|
}
|
|
434
|
-
function
|
|
435
|
-
|
|
446
|
+
function Er(r) {
|
|
447
|
+
B(r);
|
|
436
448
|
const e = /* @__PURE__ */ new Set(), t = (n) => {
|
|
437
|
-
"field" in n && n.field && e.add(n.field), "aggregate" in n && n.weightField && e.add(n.weightField), "args" in n && (n.args.forEach(t), n.condition &&
|
|
449
|
+
"field" in n && n.field && e.add(n.field), "aggregate" in n && n.weightField && e.add(n.weightField), "args" in n && (n.args.forEach(t), n.condition && ar(n.condition).forEach((o) => e.add(o)));
|
|
438
450
|
};
|
|
439
451
|
return t(r), [...e];
|
|
440
452
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
if (
|
|
453
|
+
function N(r, e, t) {
|
|
454
|
+
if (r === void 0) return e;
|
|
455
|
+
if (!Number.isSafeInteger(r) || Number(r) < 1 || Number(r) > t) throw new RangeError("图表预算超出允许范围");
|
|
456
|
+
return Number(r);
|
|
457
|
+
}
|
|
458
|
+
function br(r) {
|
|
459
|
+
if (!r || typeof r != "object" || Array.isArray(r)) throw new TypeError("图表绑定应为对象");
|
|
460
|
+
if (m(r.dataset), m(r.categoryField), !["bar", "line", "stackedBar", "percentBar"].includes(r.type)) throw new TypeError("图表类型无效");
|
|
461
|
+
if (r.sort !== void 0 && !["asc", "desc"].includes(r.sort)) throw new TypeError("图表排序无效");
|
|
462
|
+
if (r.title !== void 0 && (typeof r.title != "string" || r.title.length > 512)) throw new TypeError("图表标题过长");
|
|
463
|
+
if (r.showValues !== void 0 && typeof r.showValues != "boolean") throw new TypeError("图表数值标签应为布尔值");
|
|
464
|
+
if (!Array.isArray(r.measures) || !r.measures.length || r.measures.length > 12) throw new RangeError("图表支持 1–12 个度量");
|
|
465
|
+
for (const e of G(r.measures, 12, "图表度量")) Ar(e);
|
|
466
|
+
N(r.maxRows, 1e5, 1e5), N(r.maxCategories, 200, 200);
|
|
467
|
+
}
|
|
468
|
+
function Ar(r) {
|
|
469
|
+
if (!r || typeof r != "object" || Array.isArray(r)) throw new TypeError("图表度量应为对象");
|
|
470
|
+
if (r.field !== void 0 && m(r.field), r.weightField !== void 0 && m(r.weightField), r.label !== void 0 && (typeof r.label != "string" || r.label.length > 256)) throw new TypeError("图表系列名称过长");
|
|
471
|
+
if (r.color !== void 0 && !/^#[\da-f]{6}$/i.test(r.color)) throw new TypeError("图表颜色应为 #RRGGBB");
|
|
472
|
+
C(r);
|
|
473
|
+
}
|
|
474
|
+
function Or(r) {
|
|
475
|
+
if (r == null) return { key: "null", label: "—" };
|
|
476
|
+
if (typeof r != "string" && typeof r != "boolean" && !(typeof r == "number" && Number.isFinite(r))) throw new TypeError("图表分类应为文本、布尔或有限数字");
|
|
477
|
+
const e = String(r);
|
|
478
|
+
if (e.length > 512) throw new RangeError("图表分类名称过长");
|
|
479
|
+
return { key: JSON.stringify([typeof r, r]), label: e };
|
|
480
|
+
}
|
|
481
|
+
function vr(r) {
|
|
482
|
+
if (r === null) return null;
|
|
483
|
+
const e = Number(r);
|
|
484
|
+
if (!Number.isFinite(e)) throw new RangeError("聚合结果超出图表有限数值范围");
|
|
485
|
+
return e;
|
|
486
|
+
}
|
|
487
|
+
function Br(r, e, t) {
|
|
488
|
+
if (t?.aborted) {
|
|
489
|
+
const a = new Error("图表数据处理已取消");
|
|
490
|
+
throw a.name = "AbortError", a;
|
|
491
|
+
}
|
|
492
|
+
br(e);
|
|
493
|
+
const n = G(e.measures, 12, "图表度量");
|
|
494
|
+
if (!Array.isArray(r) || r.length > N(e.maxRows, 1e5, 1e5)) throw new RangeError("图表数据超出行数预算");
|
|
495
|
+
const o = /* @__PURE__ */ new Map(), c = N(e.maxCategories, 200, 200);
|
|
496
|
+
for (let a = 0; a < r.length; a++) {
|
|
497
|
+
if (t?.aborted) {
|
|
498
|
+
const g = new Error("图表数据处理已取消");
|
|
499
|
+
throw g.name = "AbortError", g;
|
|
500
|
+
}
|
|
501
|
+
const s = r[a];
|
|
502
|
+
if (!s || typeof s != "object" || Array.isArray(s)) throw new TypeError("图表数据行应为对象");
|
|
503
|
+
const f = Or(Object.prototype.hasOwnProperty.call(s, e.categoryField) ? s[e.categoryField] : null);
|
|
504
|
+
let l = o.get(f.key);
|
|
505
|
+
if (!l) {
|
|
506
|
+
if (o.size >= c) throw new RangeError("图表分类超出预算,请明确筛选或聚合数据");
|
|
507
|
+
l = { label: f.label, accumulators: n.map(C) }, o.set(f.key, l);
|
|
508
|
+
}
|
|
509
|
+
l.accumulators.forEach((g) => g.add(s));
|
|
510
|
+
}
|
|
511
|
+
const i = [...o.values()];
|
|
512
|
+
return e.sort && i.sort((a, s) => (e.sort === "desc" ? -1 : 1) * (a.label < s.label ? -1 : a.label > s.label ? 1 : 0)), { categories: i.map((a) => a.label), series: n.map((a, s) => ({
|
|
513
|
+
name: a.label ?? `${a.field ?? "记录"} · ${a.op}`,
|
|
514
|
+
values: i.map((f) => vr(f.accumulators[s].value())),
|
|
515
|
+
...a.color ? { color: a.color } : {}
|
|
516
|
+
})) };
|
|
517
|
+
}
|
|
518
|
+
const Nr = 16, $ = 1024 * 1024, J = 5e5, S = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ Symbol("uncacheable-computation-definition");
|
|
519
|
+
function E(r, e, t = 0) {
|
|
520
|
+
if (++e.nodes > 1e4 || t > 32) throw p;
|
|
444
521
|
if (r == null) return [String(r)];
|
|
445
522
|
if (typeof r == "number") return ["number", Object.is(r, -0) ? "-0" : String(r)];
|
|
446
523
|
if (typeof r == "boolean") return ["boolean", r];
|
|
447
524
|
if (typeof r == "string") {
|
|
448
|
-
if (e.units += r.length, e.units >
|
|
525
|
+
if (e.units += r.length, e.units > $) throw p;
|
|
449
526
|
return ["string", r];
|
|
450
527
|
}
|
|
451
|
-
if (typeof r != "object") throw
|
|
528
|
+
if (typeof r != "object") throw p;
|
|
452
529
|
if (Array.isArray(r)) {
|
|
453
|
-
if (Object.getPrototypeOf(r) !== Array.prototype || Object.keys(r).length !== r.length) throw
|
|
454
|
-
return ["array", Array.from({ length: r.length }, (n,
|
|
530
|
+
if (Object.getPrototypeOf(r) !== Array.prototype || Object.keys(r).length !== r.length) throw p;
|
|
531
|
+
return ["array", Array.from({ length: r.length }, (n, o) => E(K(r, String(o)), e, t + 1))];
|
|
455
532
|
}
|
|
456
|
-
if (Object.getPrototypeOf(r) !== Object.prototype && Object.getPrototypeOf(r) !== null) throw
|
|
457
|
-
return ["object", Object.keys(r).map((n) => [
|
|
533
|
+
if (Object.getPrototypeOf(r) !== Object.prototype && Object.getPrototypeOf(r) !== null) throw p;
|
|
534
|
+
return ["object", Object.keys(r).map((n) => [E(n, e, t + 1), E(K(r, n), e, t + 1)])];
|
|
458
535
|
}
|
|
459
|
-
function
|
|
536
|
+
function K(r, e) {
|
|
460
537
|
const t = Object.getOwnPropertyDescriptor(r, e);
|
|
461
|
-
if (!t || t.get || t.set) throw
|
|
538
|
+
if (!t || t.get || t.set) throw p;
|
|
462
539
|
return t.value;
|
|
463
540
|
}
|
|
464
|
-
function
|
|
541
|
+
function Sr(r) {
|
|
465
542
|
try {
|
|
466
|
-
return JSON.stringify(
|
|
543
|
+
return JSON.stringify(E(r, { nodes: 0, units: 0 }));
|
|
467
544
|
} catch (e) {
|
|
468
|
-
if (e !==
|
|
545
|
+
if (e !== p) throw e;
|
|
469
546
|
return;
|
|
470
547
|
}
|
|
471
548
|
}
|
|
472
|
-
function
|
|
473
|
-
|
|
549
|
+
function _r(r) {
|
|
550
|
+
S.set(r, { programs: /* @__PURE__ */ new Map(), units: 0, slots: 0 });
|
|
474
551
|
}
|
|
475
|
-
function
|
|
476
|
-
const t =
|
|
552
|
+
function Ir(r, e) {
|
|
553
|
+
const t = S.get(r);
|
|
477
554
|
if (!t) return;
|
|
478
555
|
const n = { programs: /* @__PURE__ */ new Map(), units: t.units, slots: t.slots };
|
|
479
|
-
for (const [
|
|
480
|
-
const
|
|
556
|
+
for (const [o, c] of t.programs) {
|
|
557
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
481
558
|
e.forEach((a, s) => {
|
|
482
559
|
const f = c.rows.get(r[s]);
|
|
483
|
-
f &&
|
|
484
|
-
}), n.programs.set(
|
|
560
|
+
f && i.set(a, f);
|
|
561
|
+
}), n.programs.set(o, { ...c, rows: i });
|
|
485
562
|
}
|
|
486
|
-
|
|
563
|
+
S.set(e, n);
|
|
487
564
|
}
|
|
488
|
-
function
|
|
489
|
-
const n =
|
|
565
|
+
function jr(r, e, t) {
|
|
566
|
+
const n = S.get(r);
|
|
490
567
|
if (!n || e.some((f) => typeof f.expression == "string")) return;
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
const c = n.programs.get(
|
|
568
|
+
const o = Sr(e);
|
|
569
|
+
if (o === void 0 || o.length > $) return;
|
|
570
|
+
const c = n.programs.get(o);
|
|
494
571
|
if (c) return c;
|
|
495
|
-
const
|
|
572
|
+
const i = t(), a = r.length * i.reduce((f, l) => f + l.dependencies.length + 1, 0), s = { fields: i, rows: /* @__PURE__ */ new WeakMap(), slots: a, cacheRows: a <= J };
|
|
496
573
|
if (!s.cacheRows) return s;
|
|
497
|
-
for (; n.programs.size >=
|
|
574
|
+
for (; n.programs.size >= Nr || n.units + o.length > $ || n.slots + a > J; ) {
|
|
498
575
|
const f = n.programs.keys().next().value;
|
|
499
576
|
n.slots -= n.programs.get(f).slots, n.units -= f.length, n.programs.delete(f);
|
|
500
577
|
}
|
|
501
|
-
return n.programs.set(
|
|
578
|
+
return n.programs.set(o, s), n.units += o.length, n.slots += a, s;
|
|
502
579
|
}
|
|
503
|
-
function
|
|
580
|
+
function Fr(r, e, t, n) {
|
|
504
581
|
if ((t.definition.scope ?? "row") !== "row") return;
|
|
505
|
-
const
|
|
506
|
-
return
|
|
582
|
+
const o = r.program?.rows.get(e)?.get(t.definition.field);
|
|
583
|
+
return o?.dependencies.every((c, i) => Object.is(n[t.dependencies[i]], c)) ? o : void 0;
|
|
507
584
|
}
|
|
508
|
-
function
|
|
585
|
+
function xr(r, e, t, n, o) {
|
|
509
586
|
const c = r.program;
|
|
510
587
|
if (!c?.cacheRows || (t.definition.scope ?? "row") !== "row") return;
|
|
511
|
-
let
|
|
512
|
-
|
|
588
|
+
let i = r.writes.get(e);
|
|
589
|
+
i || (i = new Map(c.rows.get(e)), r.writes.set(e, i), c.rows.set(e, i)), i.set(t.definition.field, {
|
|
513
590
|
dependencies: t.dependencies.map((a) => n[a]),
|
|
514
591
|
value: n[t.definition.field],
|
|
515
|
-
...
|
|
592
|
+
...o ? { issue: { field: o.field, message: o.message } } : {}
|
|
516
593
|
});
|
|
517
594
|
}
|
|
518
|
-
function
|
|
519
|
-
if (
|
|
595
|
+
function Mr(r) {
|
|
596
|
+
if (m(r.field), r.scope !== void 0 && !["row", "group", "dataset"].includes(r.scope))
|
|
520
597
|
throw new Error("未知计算范围");
|
|
521
598
|
if (r.numeric !== void 0 && r.numeric !== "number" && r.numeric !== "decimal")
|
|
522
599
|
throw new Error("未知数值模式");
|
|
523
|
-
if (r.digits !== void 0 &&
|
|
600
|
+
if (r.digits !== void 0 && h(r.digits), r.nulls !== void 0 && r.nulls !== "propagate" && r.nulls !== "error")
|
|
524
601
|
throw new Error("未知空值规则");
|
|
525
602
|
if (r.divisionByZero !== void 0 && r.divisionByZero !== "null" && r.divisionByZero !== "error")
|
|
526
603
|
throw new Error("未知除零规则");
|
|
527
604
|
if (r.scope === "group" && (!Array.isArray(r.groupBy) || !r.groupBy.length))
|
|
528
605
|
throw new Error("分组计算需要 groupBy 字段");
|
|
529
|
-
|
|
606
|
+
Dr(r);
|
|
530
607
|
}
|
|
531
|
-
function
|
|
608
|
+
function Dr(r) {
|
|
532
609
|
if (r.groupBy !== void 0) {
|
|
533
610
|
if (!Array.isArray(r.groupBy) || r.groupBy.length > 16)
|
|
534
611
|
throw new Error("计算分组最多 16 级");
|
|
535
|
-
r.groupBy.forEach(
|
|
612
|
+
r.groupBy.forEach(m);
|
|
536
613
|
}
|
|
537
614
|
if (r.dependsOn !== void 0) {
|
|
538
615
|
if (!Array.isArray(r.dependsOn) || r.dependsOn.length > 2048)
|
|
539
616
|
throw new Error("计算依赖超出预算");
|
|
540
|
-
r.dependsOn.forEach(
|
|
617
|
+
r.dependsOn.forEach(m);
|
|
541
618
|
}
|
|
542
619
|
}
|
|
543
|
-
function
|
|
620
|
+
function _(r) {
|
|
544
621
|
return [
|
|
545
622
|
.../* @__PURE__ */ new Set([
|
|
546
|
-
...typeof r.expression == "string" ? r.dependsOn ?? [] :
|
|
623
|
+
...typeof r.expression == "string" ? r.dependsOn ?? [] : Er(r.expression),
|
|
547
624
|
...r.groupBy ?? []
|
|
548
625
|
])
|
|
549
626
|
];
|
|
550
627
|
}
|
|
551
|
-
function
|
|
628
|
+
function rr(r) {
|
|
552
629
|
if (!Array.isArray(r) || r.length > 2048)
|
|
553
630
|
throw new Error("计算字段应为数组且最多2048项");
|
|
554
631
|
const e = /* @__PURE__ */ new Map();
|
|
555
|
-
for (const
|
|
556
|
-
if (
|
|
557
|
-
e.set(
|
|
632
|
+
for (const i of r) {
|
|
633
|
+
if (Mr(i), e.has(i.field)) throw new Error(`计算字段重复:${i.field}`);
|
|
634
|
+
e.set(i.field, i);
|
|
558
635
|
}
|
|
559
|
-
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(),
|
|
560
|
-
function c(
|
|
561
|
-
if (!n.has(
|
|
562
|
-
if (t.has(
|
|
636
|
+
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), o = [];
|
|
637
|
+
function c(i) {
|
|
638
|
+
if (!n.has(i.field)) {
|
|
639
|
+
if (t.has(i.field))
|
|
563
640
|
throw new Error(
|
|
564
|
-
`计算字段存在循环依赖:${[...t,
|
|
641
|
+
`计算字段存在循环依赖:${[...t, i.field].join(" → ")}`
|
|
565
642
|
);
|
|
566
|
-
t.add(
|
|
567
|
-
for (const a of
|
|
643
|
+
t.add(i.field);
|
|
644
|
+
for (const a of _(i)) {
|
|
568
645
|
const s = e.get(a);
|
|
569
646
|
s && c(s);
|
|
570
647
|
}
|
|
571
|
-
t.delete(
|
|
648
|
+
t.delete(i.field), n.add(i.field), o.push(i);
|
|
572
649
|
}
|
|
573
650
|
}
|
|
574
|
-
return r.forEach(c),
|
|
651
|
+
return r.forEach(c), o;
|
|
575
652
|
}
|
|
576
|
-
function
|
|
653
|
+
function Ur(r) {
|
|
577
654
|
try {
|
|
578
|
-
const e =
|
|
655
|
+
const e = rr(r);
|
|
579
656
|
return {
|
|
580
657
|
valid: !0,
|
|
581
658
|
errors: [],
|
|
582
659
|
order: e.map((t) => t.field),
|
|
583
660
|
fields: r.map((t) => ({
|
|
584
661
|
field: t.field,
|
|
585
|
-
dependencies:
|
|
662
|
+
dependencies: _(t),
|
|
586
663
|
scope: t.scope ?? "row"
|
|
587
664
|
}))
|
|
588
665
|
};
|
|
@@ -595,11 +672,11 @@ function Ir(r) {
|
|
|
595
672
|
};
|
|
596
673
|
}
|
|
597
674
|
}
|
|
598
|
-
function
|
|
675
|
+
function Vr(r = []) {
|
|
599
676
|
return {
|
|
600
677
|
fields: r.map((e) => ({ ...e })),
|
|
601
|
-
functions:
|
|
602
|
-
operations:
|
|
678
|
+
functions: T,
|
|
679
|
+
operations: T.map((e) => e.name),
|
|
603
680
|
aggregates: ["sum", "count", "avg", "min", "max", "weightedAvg"],
|
|
604
681
|
scopes: ["row", "group", "dataset"],
|
|
605
682
|
numericModes: ["number", "decimal"],
|
|
@@ -614,14 +691,14 @@ function Pr(r = []) {
|
|
|
614
691
|
}
|
|
615
692
|
};
|
|
616
693
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
619
|
-
const t =
|
|
694
|
+
function X(r) {
|
|
695
|
+
return rr(r.fields).map((e) => {
|
|
696
|
+
const t = _(e);
|
|
620
697
|
if (typeof e.expression != "string")
|
|
621
698
|
return {
|
|
622
699
|
definition: e,
|
|
623
700
|
dependencies: t,
|
|
624
|
-
read:
|
|
701
|
+
read: B(e.expression, e)
|
|
625
702
|
};
|
|
626
703
|
if (!r.formula)
|
|
627
704
|
throw new Error("字符串公式需要显式配置 formula adapter");
|
|
@@ -629,39 +706,39 @@ function z(r) {
|
|
|
629
706
|
return {
|
|
630
707
|
definition: e,
|
|
631
708
|
dependencies: t,
|
|
632
|
-
read: (
|
|
709
|
+
read: (o) => r.formula.evaluate(n, o)
|
|
633
710
|
};
|
|
634
711
|
});
|
|
635
712
|
}
|
|
636
|
-
function
|
|
713
|
+
function kr(r, e) {
|
|
637
714
|
return JSON.stringify(
|
|
638
715
|
e.map((t) => {
|
|
639
716
|
const n = Object.prototype.hasOwnProperty.call(r, t) ? r[t] : null;
|
|
640
|
-
if (n != null && !
|
|
717
|
+
if (n != null && !Y(n))
|
|
641
718
|
throw new Error("分组字段应为有限 JSON 标量");
|
|
642
719
|
return [typeof n, n ?? null];
|
|
643
720
|
})
|
|
644
721
|
);
|
|
645
722
|
}
|
|
646
|
-
function
|
|
723
|
+
function Rr(r, e) {
|
|
647
724
|
if (e.scope === "dataset") return () => r;
|
|
648
725
|
if (e.scope !== "group") {
|
|
649
|
-
const
|
|
726
|
+
const o = /* @__PURE__ */ new WeakMap();
|
|
650
727
|
return (c) => {
|
|
651
|
-
let
|
|
652
|
-
return
|
|
728
|
+
let i = o.get(c);
|
|
729
|
+
return i || (i = [c], o.set(c, i)), i;
|
|
653
730
|
};
|
|
654
731
|
}
|
|
655
732
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new WeakMap();
|
|
656
|
-
for (const
|
|
657
|
-
const c =
|
|
658
|
-
n.set(
|
|
659
|
-
const
|
|
660
|
-
|
|
733
|
+
for (const o of r) {
|
|
734
|
+
const c = kr(o, e.groupBy);
|
|
735
|
+
n.set(o, c);
|
|
736
|
+
const i = t.get(c);
|
|
737
|
+
i ? i.push(o) : t.set(c, [o]);
|
|
661
738
|
}
|
|
662
|
-
return (
|
|
739
|
+
return (o) => t.get(n.get(o));
|
|
663
740
|
}
|
|
664
|
-
function
|
|
741
|
+
function Tr(r, e) {
|
|
665
742
|
const t = e.maxRows ?? 1e5, n = e.maxCells ?? 2e6;
|
|
666
743
|
if (!Array.isArray(r) || !Number.isSafeInteger(t) || t < 1 || r.length > t)
|
|
667
744
|
throw new Error("计算数据行数超出预算或输入不是数组");
|
|
@@ -670,70 +747,73 @@ function Mr(r, e) {
|
|
|
670
747
|
if (!Number.isSafeInteger(n) || n < 1 || r.length * e.fields.length > n)
|
|
671
748
|
throw new Error("计算单元格超出 maxCells 预算");
|
|
672
749
|
}
|
|
673
|
-
function
|
|
750
|
+
function Z(r) {
|
|
674
751
|
if (r?.aborted) {
|
|
675
752
|
const e = new Error("数据计算已取消");
|
|
676
753
|
throw e.name = "AbortError", e;
|
|
677
754
|
}
|
|
678
755
|
}
|
|
679
|
-
function
|
|
756
|
+
function $r(r, e, t, n, o, c) {
|
|
680
757
|
try {
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
758
|
+
const i = r.read({ row: e, rowIndex: t, rows: n });
|
|
759
|
+
if (i !== void 0 && !Y(i))
|
|
683
760
|
throw new Error("计算结果应为有限 JSON 标量,异步公式请先在数据源中求值");
|
|
684
|
-
e[r.definition.field] =
|
|
685
|
-
} catch (
|
|
686
|
-
const a =
|
|
687
|
-
if (
|
|
761
|
+
e[r.definition.field] = i ?? null;
|
|
762
|
+
} catch (i) {
|
|
763
|
+
const a = i instanceof Error ? i.message : String(i);
|
|
764
|
+
if (o.onError !== "null")
|
|
688
765
|
throw Object.assign(
|
|
689
766
|
new Error(`第 ${t + 1} 行 ${r.definition.field}:${a}`),
|
|
690
|
-
{ cause:
|
|
767
|
+
{ cause: i }
|
|
691
768
|
);
|
|
692
769
|
e[r.definition.field] = null, c.push({ rowIndex: t, field: r.definition.field, message: a });
|
|
693
770
|
}
|
|
694
771
|
}
|
|
695
|
-
function
|
|
696
|
-
const s =
|
|
697
|
-
if (s && (!s.issue ||
|
|
698
|
-
n[t.definition.field] = s.value, s.issue && a.push({ ...s.issue, rowIndex:
|
|
772
|
+
function Pr(r, e, t, n, o, c, i, a) {
|
|
773
|
+
const s = Fr(r, e, t, n);
|
|
774
|
+
if (s && (!s.issue || i.onError === "null")) {
|
|
775
|
+
n[t.definition.field] = s.value, s.issue && a.push({ ...s.issue, rowIndex: o });
|
|
699
776
|
return;
|
|
700
777
|
}
|
|
701
778
|
const f = a.length;
|
|
702
|
-
|
|
779
|
+
$r(t, n, o, c, i, a), xr(r, e, t, n, a.length > f ? a[a.length - 1] : void 0);
|
|
703
780
|
}
|
|
704
|
-
function
|
|
705
|
-
|
|
706
|
-
const t =
|
|
781
|
+
function Wr(r, e) {
|
|
782
|
+
Tr(r, e), Z(e.signal);
|
|
783
|
+
const t = jr(r, e.fields, () => X(e)), n = { program: t, writes: /* @__PURE__ */ new WeakMap() }, o = t?.fields ?? X(e), c = [], i = r.map((a, s) => {
|
|
707
784
|
if (!a || typeof a != "object" || Array.isArray(a))
|
|
708
785
|
throw new Error(`第 ${s + 1} 行应为对象`);
|
|
709
786
|
return { ...a };
|
|
710
787
|
});
|
|
711
|
-
for (const a of
|
|
712
|
-
const s =
|
|
713
|
-
|
|
714
|
-
|
|
788
|
+
for (const a of o) {
|
|
789
|
+
const s = Rr(i, a.definition);
|
|
790
|
+
i.forEach((f, l) => {
|
|
791
|
+
Z(e.signal), Pr(n, r[l], a, f, l, s(f), e, c);
|
|
715
792
|
});
|
|
716
793
|
}
|
|
717
|
-
return { rows:
|
|
794
|
+
return { rows: i, issues: c };
|
|
718
795
|
}
|
|
719
796
|
export {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
797
|
+
O as a,
|
|
798
|
+
U as b,
|
|
799
|
+
C as c,
|
|
800
|
+
A as d,
|
|
801
|
+
Wr as e,
|
|
802
|
+
Br as f,
|
|
803
|
+
h as g,
|
|
804
|
+
k as h,
|
|
805
|
+
Cr as i,
|
|
806
|
+
Vr as j,
|
|
807
|
+
F as k,
|
|
808
|
+
br as l,
|
|
809
|
+
P as m,
|
|
810
|
+
w as n,
|
|
734
811
|
Yr as o,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
Ir as
|
|
812
|
+
u as p,
|
|
813
|
+
m as q,
|
|
814
|
+
ar as r,
|
|
815
|
+
Ir as s,
|
|
816
|
+
_r as t,
|
|
817
|
+
G as u,
|
|
818
|
+
Ur as v
|
|
739
819
|
};
|