@agile-team/mach-report 2.23.1 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +10 -4
  2. package/dist/{ExcelBindingWizard-BrTmdo7f.cjs → ExcelBindingWizard-BgJG-T6k.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-CcDMLO8Q.js → ExcelBindingWizard-NQ_v396s.js} +3 -3
  4. package/dist/ParamEditor-DEP38mBp.cjs +1 -0
  5. package/dist/ParamEditor-Z-3yodp5.js +750 -0
  6. package/dist/{ReportBatchPanel-CHxBtG9R.cjs → ReportBatchPanel-D33LjMrA.cjs} +1 -1
  7. package/dist/{ReportBatchPanel-CJB67WNd.js → ReportBatchPanel-DG8FV-5X.js} +2 -2
  8. package/dist/{ReportLabelStudio-Tplc1TLJ.js → ReportLabelStudio-BZp23_hA.js} +68 -68
  9. package/dist/ReportLabelStudio-Bz-xAayk.cjs +1 -0
  10. package/dist/ReportParamPanel-B27IGJjk.cjs +1 -0
  11. package/dist/{ReportParamPanel-GI43aGa0.js → ReportParamPanel-DGXzBzl2.js} +328 -298
  12. package/dist/ReportPreview-CilFAS9U.js +7170 -0
  13. package/dist/ReportPreview-dOOzPts2.cjs +6 -0
  14. package/dist/{ReportTemplateLibrary-KqX4E2sN.js → ReportTemplateLibrary-DpSGgvFa.js} +28 -28
  15. package/dist/{ReportTemplateLibrary-BFQIX0sg.cjs → ReportTemplateLibrary-uG1gENaW.cjs} +1 -1
  16. package/dist/{RuleEditor-OPX1awrH.js → RuleEditor-BONALh1Q.js} +846 -835
  17. package/dist/RuleEditor-bLXiRcxL.cjs +1 -0
  18. package/dist/{TemplateOutlinePanel-CVYKVLv_.cjs → TemplateOutlinePanel-C3nfHuaR.cjs} +1 -1
  19. package/dist/{TemplateOutlinePanel-DQS-eOs6.js → TemplateOutlinePanel-JGBKeF3e.js} +10 -10
  20. package/dist/{TemplateReusePanel-CY6O93Zk.cjs → TemplateReusePanel-BKhgp6kg.cjs} +1 -1
  21. package/dist/{TemplateReusePanel-DKXiFTyB.js → TemplateReusePanel-DXQUO6nQ.js} +2 -2
  22. package/dist/TemplateReviewPanel-5RWFUUEf.cjs +1 -0
  23. package/dist/TemplateReviewPanel-DhL7Hapy.js +602 -0
  24. package/dist/analytics.d.cts +1 -1
  25. package/dist/analytics.d.ts +1 -1
  26. package/dist/artifact-integrity.json +98 -98
  27. package/dist/assets-BYdpkTIt.cjs +1 -0
  28. package/dist/assets-C4MIvzQ4.js +137 -0
  29. package/dist/auto-D-eDZa_V.cjs +1 -0
  30. package/dist/{auto-BB99S802.js → auto-umW_ozwr.js} +10 -10
  31. package/dist/capabilities-CN_kSVjO.js +121 -0
  32. package/dist/capabilities-D4nfhcvB.cjs +1 -0
  33. package/dist/cell-style-B6Qffrx8.js +37 -0
  34. package/dist/cell-style-y_uh1pZp.cjs +1 -0
  35. package/dist/{data-bar-IkI6VvMQ.js → data-bar-Bfh54sT4.js} +1 -1
  36. package/dist/data-bar-DzceAVeR.cjs +1 -0
  37. package/dist/designer-CCyj5WYS.js +7595 -0
  38. package/dist/designer-Cj7fn4Hh.cjs +2 -0
  39. package/dist/designer.cjs +1 -1
  40. package/dist/designer.d.cts +143 -10
  41. package/dist/designer.d.ts +143 -10
  42. package/dist/designer.js +5 -5
  43. package/dist/diagnostic-collector-gB07PHy2.js +392 -0
  44. package/dist/diagnostic-collector-wASg6Fzs.cjs +1 -0
  45. package/dist/dom-CXWMmwh-.cjs +1 -0
  46. package/dist/{dom-JWrchIre.js → dom-DxdCMLzs.js} +185 -185
  47. package/dist/{encoding-CEd-dq9A.js → encoding-CEkBtlUP.js} +2 -2
  48. package/dist/{encoding-7lquyj0w.cjs → encoding-Cipno7dq.cjs} +1 -1
  49. package/dist/{font-loader-CNWXomuV.js → font-loader-D4NLIKJL.js} +1 -1
  50. package/dist/{font-loader-D8pI87fL.cjs → font-loader-p_SyTvqt.cjs} +1 -1
  51. package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-DkZEZvcI.js} +1 -1
  52. package/dist/grid-strokes-RFMR91jn.cjs +1 -0
  53. package/dist/index.cjs +5 -5
  54. package/dist/index.d.cts +48 -9
  55. package/dist/index.d.ts +48 -9
  56. package/dist/index.js +137 -136
  57. package/dist/json-snapshot-DQdkA_At.cjs +2 -0
  58. package/dist/{json-snapshot-BRnzKudk.js → json-snapshot-x0JpllWL.js} +919 -791
  59. package/dist/{pdf-DpMkW72B.cjs → pdf-C060D5UY.cjs} +31 -31
  60. package/dist/{pdf-CJToa81Z.js → pdf-DU8HelKd.js} +2499 -2492
  61. package/dist/pdf.cjs +1 -1
  62. package/dist/pdf.d.cts +18 -0
  63. package/dist/pdf.d.ts +18 -0
  64. package/dist/pdf.js +2 -2
  65. package/dist/{plugin-BWTp-X7b.cjs → plugin-B_k23hut.cjs} +1 -1
  66. package/dist/{plugin-_BkUVc2z.js → plugin-CttO46hc.js} +1 -1
  67. package/dist/{prefill-CWGdnqQd.js → prefill-BkF9Fw_p.js} +13 -13
  68. package/dist/prefill-BvkuwooY.cjs +1 -0
  69. package/dist/prepared-CSywIEAZ.cjs +1 -0
  70. package/dist/prepared-Cyuh61fJ.js +128 -0
  71. package/dist/protocol-BwbJNVZl.cjs +1 -0
  72. package/dist/protocol-DwtxjXzO.js +96 -0
  73. package/dist/record-bindings-B7djSjNs.cjs +1 -0
  74. package/dist/{record-bindings-DatJZv_e.js → record-bindings-Cv7lFiof.js} +47 -47
  75. package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-COD8nISZ.cjs} +1 -1
  76. package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-D8I4QWRh.js} +2 -2
  77. package/dist/report-encoding-worker.cjs +1 -1
  78. package/dist/report-encoding-worker.js +1 -1
  79. package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-Ch_N0Ubu.js} +1 -1
  80. package/dist/rich-text-layout-yJGuThtC.cjs +3 -0
  81. package/dist/runtime-BE30icyB.js +227 -0
  82. package/dist/runtime-DRSuy_SQ.cjs +1 -0
  83. package/dist/sbom.cdx.json +1 -1
  84. package/dist/server/node.d.cts +55 -7
  85. package/dist/server/node.d.ts +55 -7
  86. package/dist/server-node.cjs +5 -5
  87. package/dist/server-node.js +2742 -2417
  88. package/dist/server.cjs +1 -1
  89. package/dist/server.d.cts +51 -16
  90. package/dist/server.d.ts +51 -16
  91. package/dist/server.js +8 -8
  92. package/dist/style.css +1 -1
  93. package/dist/{template-catalog-DtrtT1FY.cjs → template-catalog-C0riwrx7.cjs} +1 -1
  94. package/dist/{template-catalog-CRuZL3pi.js → template-catalog-D_gl93va.js} +3 -3
  95. package/dist/template-fragments-CgzPdFKB.cjs +1 -0
  96. package/dist/{template-fragments-CPpGpQoz.js → template-fragments-D94ZZmPc.js} +2 -2
  97. package/dist/template-registry-BMScUmM4.cjs +1 -0
  98. package/dist/{template-registry-O0hNIOfB.js → template-registry-DZOtRY7t.js} +19 -19
  99. package/dist/{textwrap-D4ZksyMK.js → textwrap-BywMBMXM.js} +1 -1
  100. package/dist/textwrap-LhJkHWb1.cjs +4 -0
  101. package/dist/vue/async.d.cts +101 -22
  102. package/dist/vue/async.d.ts +101 -22
  103. package/dist/vue/index.d.cts +133 -34
  104. package/dist/vue/index.d.ts +133 -34
  105. package/dist/vue-async.cjs +1 -1
  106. package/dist/vue-async.js +3 -3
  107. package/dist/vue.cjs +1 -1
  108. package/dist/vue.js +192 -162
  109. package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-DR2j6Hxm.cjs} +3 -3
  110. package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-SzfILBJJ.js} +106 -107
  111. package/dist/worker.cjs +1 -1
  112. package/dist/worker.d.cts +55 -7
  113. package/dist/worker.d.ts +55 -7
  114. package/dist/worker.js +4 -4
  115. package/dist/xlsx/node.d.cts +30 -1
  116. package/dist/xlsx/node.d.ts +30 -1
  117. package/dist/xlsx-node.cjs +42 -42
  118. package/dist/xlsx-node.js +3908 -3889
  119. package/dist/xlsx.cjs +4 -4
  120. package/dist/xlsx.d.cts +20 -3
  121. package/dist/xlsx.d.ts +20 -3
  122. package/dist/xlsx.js +302 -295
  123. package/package.json +1 -1
  124. package/dist/ParamEditor-BGjovFUe.js +0 -737
  125. package/dist/ParamEditor-CeNp4_zQ.cjs +0 -1
  126. package/dist/ReportLabelStudio-g8PkqJWn.cjs +0 -1
  127. package/dist/ReportParamPanel-C7fZTllk.cjs +0 -1
  128. package/dist/ReportPreview-BoGBGyRr.cjs +0 -6
  129. package/dist/ReportPreview-QLONCyci.js +0 -6257
  130. package/dist/RuleEditor-BZUP9yvL.cjs +0 -1
  131. package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +0 -1
  132. package/dist/TemplateReviewPanel-Dijwm9YE.js +0 -593
  133. package/dist/assets-D2gHc4Mz.cjs +0 -1
  134. package/dist/assets-T_gDeFaz.js +0 -132
  135. package/dist/auto-BrPWo7Xm.cjs +0 -1
  136. package/dist/capabilities-DiBj4Qgl.cjs +0 -1
  137. package/dist/capabilities-pg7j7VLT.js +0 -106
  138. package/dist/data-bar-CeZuFmYl.cjs +0 -1
  139. package/dist/designer-BZoVWTgl.js +0 -7172
  140. package/dist/designer-zS2uKJmY.cjs +0 -2
  141. package/dist/dom-ChE5D-L-.cjs +0 -1
  142. package/dist/grid-strokes-Be24LGuV.cjs +0 -1
  143. package/dist/json-snapshot-DNiIbpOr.cjs +0 -2
  144. package/dist/prefill-PaAy6wLk.cjs +0 -1
  145. package/dist/prepared-CJy_qk7d.js +0 -94
  146. package/dist/prepared-D0yCSxSO.cjs +0 -1
  147. package/dist/progress-BXzlVbIp.js +0 -29
  148. package/dist/progress-ByiOxUD3.js +0 -250
  149. package/dist/progress-DJBd9Rb9.cjs +0 -1
  150. package/dist/progress-WomPRP3B.cjs +0 -1
  151. package/dist/protocol-BG16rz6D.js +0 -90
  152. package/dist/protocol-wzhl1Fim.cjs +0 -1
  153. package/dist/record-bindings-MBxbeBsi.cjs +0 -1
  154. package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
  155. package/dist/runtime-DYMOS_gz.cjs +0 -1
  156. package/dist/runtime-PiCax9zQ.js +0 -171
  157. package/dist/template-fragments-GVjpew_q.cjs +0 -1
  158. package/dist/template-registry-DI59PXVK.cjs +0 -1
  159. package/dist/textwrap-DEHqAjKZ.cjs +0 -4
@@ -1,132 +0,0 @@
1
- import { v as b, E as I, w as v } from "./progress-ByiOxUD3.js";
2
- import { n as w, O as E } from "./capabilities-pg7j7VLT.js";
3
- import { c as A, I as y } from "./media-Y90dHK9z.js";
4
- class p extends Error {
5
- constructor(n, r) {
6
- super(n.message), this.name = "OutputAssetError", this.diagnostic = n, this.cause = r;
7
- }
8
- }
9
- function h(e) {
10
- if (e.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
11
- }
12
- function O(e) {
13
- const n = { maxAssets: 1e3, maxImageBytes: 33554432, maxTotalImageBytes: 134217728, maxDurationMs: 3e4, ...e.assetBudget };
14
- for (const [r, a] of Object.entries(n))
15
- if (!Number.isSafeInteger(a) || a <= 0 || a > 2147483647) throw new RangeError(`${r} must be a positive safe integer at most 2147483647.`);
16
- return n;
17
- }
18
- function D(e) {
19
- const n = /^data:image\/[a-z0-9.+-]+(;base64)?,(.*)$/is.exec(e);
20
- if (!n) throw new TypeError("Asset renderers must return an image data URL.");
21
- return n[1] ? Math.ceil(n[2].length * 3 / 4) : new TextEncoder().encode(decodeURIComponent(n[2])).byteLength;
22
- }
23
- function l(e, n, r, a, i) {
24
- const t = { code: r, message: a, severity: "warning", format: e.options.format ?? "dom", pageIndex: n.pageIndex, componentIndex: n.componentIndex, componentPath: n.componentPath, kind: n.component.kind, nid: n.component.nid };
25
- if (e.diagnostics.push(t), w(t, { ...e.options, signal: e.signal }), e.options.assetFailure !== "placeholder") throw new p(t, i);
26
- }
27
- async function M(e, n, r) {
28
- const a = e.options.assetRegistry?.rendererFor(n) ?? e.options.assetRenderers?.[n.kind];
29
- if (n.imageData || !a) return n.imageData;
30
- if (++e.rendered > e.budget.maxAssets) return l(e, r, "asset-budget-exceeded", "Output exceeded the asset count budget.");
31
- let i;
32
- try {
33
- if (e.active = r, i = await v(a({ ...r, signal: e.signal }), e.signal), h(e.signal), i.length > e.budget.maxImageBytes * 4 + 1024) return l(e, r, "asset-budget-exceeded", "Output exceeded the image payload byte budget.");
34
- const t = D(i);
35
- if (t > e.budget.maxImageBytes || e.bytes + t > e.budget.maxTotalImageBytes) return l(e, r, "asset-budget-exceeded", "Output exceeded the encoded image byte budget.");
36
- /^data:image\/(png|jpe?g);base64,/i.test(i) && e.inspectImage(i), e.bytes += t;
37
- } catch (t) {
38
- if (e.signal.aborted || t instanceof p || t instanceof y && t.code === "image-budget-exceeded") throw t;
39
- return l(e, r, "asset-render-failed", `Asset renderer failed for ${n.kind}; output was not silently omitted.`, t);
40
- }
41
- return i;
42
- }
43
- function T(e, n) {
44
- const r = e.active;
45
- if (!r) {
46
- n.abort(new Error("Asset rendering exceeded maxDurationMs."));
47
- return;
48
- }
49
- const a = { code: "asset-budget-exceeded", message: "Asset rendering exceeded maxDurationMs.", severity: "warning", format: e.options.format ?? "dom", pageIndex: r.pageIndex, componentIndex: r.componentIndex, componentPath: r.componentPath, kind: r.component.kind, nid: r.component.nid };
50
- e.diagnostics.push(a);
51
- try {
52
- w(a, { ...e.options, signal: e.signal });
53
- } catch (i) {
54
- n.abort(i);
55
- return;
56
- }
57
- n.abort(new p(a));
58
- }
59
- async function k(e, n, r, a, i) {
60
- if (!n?.children?.length) return n;
61
- const t = [];
62
- for (const [s, c] of n.children.entries())
63
- t.push(await x(e, c, { ...r, component: c, componentPath: [...a, s] }, i));
64
- return t.some((s, c) => s !== n.children[c]) ? { ...n, children: t } : n;
65
- }
66
- async function x(e, n, r, a) {
67
- if (h(e.signal), a.has(n)) throw new TypeError("Cyclic grid children cannot be rendered.");
68
- let i = e.cache.get(n);
69
- i || (i = M(e, n, r), e.cache.set(n, i));
70
- const t = await i;
71
- h(e.signal);
72
- let s = n.grid;
73
- if (s) {
74
- const c = new Set(a).add(n), d = [];
75
- for (const [u, o] of s.cells.entries()) {
76
- if (!o.some((m) => m?.children?.length)) {
77
- d.push(o);
78
- continue;
79
- }
80
- const f = [];
81
- for (const [m, g] of o.entries()) f.push(g?.children?.length ? await k(e, g, r, [...r.componentPath, u, m], c) : g);
82
- d.push(f.some((m, g) => m !== o[g]) ? f : o);
83
- }
84
- d.some((u, o) => u !== s.cells[o]) && (s = { ...s, cells: d });
85
- }
86
- return t !== n.imageData || s !== n.grid ? { ...n, imageData: t, grid: s } : n;
87
- }
88
- function B(e, n, r) {
89
- const a = /* @__PURE__ */ new Set(), i = (t) => {
90
- if (b(r), !a.has(t)) {
91
- if (a.add(t), t.imageData && /^data:image\/(png|jpe?g);base64,/i.test(t.imageData))
92
- try {
93
- n(t.imageData);
94
- } catch (s) {
95
- if (!(s instanceof y) || s.code === "image-budget-exceeded") throw s;
96
- }
97
- for (const s of t.grid?.cells ?? []) for (const c of s) for (const d of c?.children ?? []) i(d);
98
- }
99
- };
100
- for (const t of e.pages) for (const s of t.components) i(s);
101
- }
102
- function R(e) {
103
- if (e.options.fidelity === "strict" && e.diagnostics.length) throw new E(e.diagnostics);
104
- }
105
- async function L(e, n = {}) {
106
- b(n.signal), I(e);
107
- const r = O(n), a = A(n);
108
- if (B(e, a, n.signal), n.signal?.aborted) throw n.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
109
- const i = new AbortController(), t = () => i.abort(n.signal?.reason);
110
- if (n.signal?.addEventListener("abort", t, { once: !0 }), !n.assetRegistry && (!n.assetRenderers || !Object.keys(n.assetRenderers).length))
111
- return n.signal?.removeEventListener("abort", t), { plan: e, diagnostics: [] };
112
- const s = { options: n, signal: i.signal, diagnostics: [], rendered: 0, bytes: 0, budget: r, cache: /* @__PURE__ */ new WeakMap(), inspectImage: a }, c = setTimeout(() => T(s, i), r.maxDurationMs);
113
- try {
114
- const d = [];
115
- for (const [u, o] of e.pages.entries()) {
116
- if (u < (n.start ?? 0) || u > (n.end ?? e.pages.length - 1)) {
117
- d.push(o);
118
- continue;
119
- }
120
- const f = [];
121
- for (const [m, g] of o.components.entries()) f.push(await x(s, g, { component: g, pageIndex: u, componentIndex: m, componentPath: [] }, /* @__PURE__ */ new Set()));
122
- d.push(f.some((m, g) => m !== o.components[g]) ? { ...o, components: f } : o);
123
- }
124
- return h(s.signal), R(s), { plan: d.some((u, o) => u !== e.pages[o]) ? { ...e, pages: d } : e, diagnostics: s.diagnostics };
125
- } finally {
126
- clearTimeout(c), n.signal?.removeEventListener("abort", t);
127
- }
128
- }
129
- export {
130
- p as O,
131
- L as r
132
- };
@@ -1 +0,0 @@
1
- "use strict";const O=require("./prepared-D0yCSxSO.cjs"),I=require("./json-snapshot-DNiIbpOr.cjs"),P=require("./protocol-wzhl1Fim.cjs"),j=require("./progress-WomPRP3B.cjs"),W=require("./runtime-DYMOS_gz.cjs"),l=require("./sha256-DgZAKXqI.cjs");class M extends Error{constructor(r){super("报表 Worker 无法启动"),this.cause=r,this.name="ReportWorkerStartError"}}let C=0;function F(e){const r=new Error("报表 Worker 任务已取消");return r.name="AbortError",Object.defineProperty(r,"cause",{value:e}),r}function U(e,r){if(!e||typeof e!="object")return;const t=e;return t.protocol===P.REPORT_WORKER_PROTOCOL&&t.id===r?t:void 0}function z(e,r={}){const t=r.timeoutMs??12e4;if(!Number.isFinite(t)||t<=0||t>2147483647)throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");const n=(o,s,a,d)=>a?.aborted?Promise.reject(F(a.reason)):new Promise((v,i)=>{let g;try{g=e()}catch(f){i(new M(f));return}const h=`mach-report-${Date.now()}-${++C}`;let b=!1,p=()=>{},R;const u=(f,c)=>{if(b)return;b=!0,R&&clearTimeout(R);let w;try{p()}catch(y){w=y}a?.removeEventListener("abort",k),f??=w,Promise.resolve().then(()=>g.terminate()).then(()=>f===void 0?v(c):i(f),y=>i(f??y))},k=()=>u(F(a?.reason)),m=f=>{const c=U(f,h);if(!(!c||b)){if("type"in c&&c.type==="event"){const w="event"in c?c.event:void 0;P.validReportWorkerEvent(w,s)?I.notifyReportTaskEvent(d,w,a):u(new Error("报表 Worker 返回无效阶段事件"));return}c.error&&typeof c.error.name=="string"&&typeof c.error.message=="string"?u(new P.ReportWorkerError(c.error)):P.validReportWorkerResult(c.result,o)&&(o==="prepare"||"format"in c.result&&"format"in s&&c.result.format===s.format)?u(void 0,c.result):u(new Error("报表 Worker 返回无效响应"))}};try{if(p=g.subscribe(m,f=>u(f??new Error("报表 Worker 执行失败"))),b){p();return}if(a?.addEventListener("abort",k,{once:!0}),R=setTimeout(()=>u(new P.ReportWorkerError({name:"ReportRuntimeError",code:"timeout",message:`报表 Worker 执行超过 ${t}ms`})),t),a?.aborted)k();else{const{onEvent:f,signal:c,...w}=s,y=N(w);g.postMessage({protocol:P.REPORT_WORKER_PROTOCOL,id:h,operation:o,input:w,...r.budget?{budget:r.budget}:{}},y)}}catch(f){u(f)}});return{exportPrepared:(o,s,a)=>n("exportPrepared",o,s,a),prepare:(o,s,a)=>n("prepare",o,s,a),export:(o,s,a)=>n("export",o,s,a)}}function N(e){return e.pdf?(e.pdf=O.snapshotPdfFonts(e.pdf),(e.pdf?.customFontFaces?Object.values(e.pdf.customFontFaces):[e.pdf?.customFontBytes]).filter(t=>t instanceof Uint8Array).map(t=>t.buffer)):[]}function _(e,r={}){return z(()=>{const t=e();return{postMessage:(n,o)=>t.postMessage(n,o),terminate:()=>t.terminate(),subscribe:(n,o)=>{const s=d=>n(d.data),a=d=>o(d instanceof ErrorEvent?new Error(d.message):new Error("报表 Worker 消息无法解码"));return t.addEventListener("message",s),t.addEventListener("error",a),t.addEventListener("messageerror",a),()=>{t.removeEventListener("message",s),t.removeEventListener("error",a),t.removeEventListener("messageerror",a)}}}},r)}const $={cells:2e4,pages:20,bytes:2e6};function T(e){return e.cells>=e.limits.cells||e.pages>=e.limits.pages||e.bytes>=e.limits.bytes||e.capped}function x(e){return++e.visits>=1e5&&(e.capped=!0),!T(e)}function E(e){return typeof e=="string"?e.length*2:0}function L(e,r){for(const t of e??[]){if(!x(r))return;for(const n of t.segments){if(!x(r))return;r.bytes+=E(n.text)}}}function S(e,r,t){if(t>32){r.capped=!0;return}if(x(r)){r.bytes+=E(e.text)+E(e.rawText)+E(e.imageData),L(e.richParagraphs,r);for(const n of e.lines??[]){if(!x(r))return;r.bytes+=E(n)}for(const n of e.grid?.cells??[]){if(!x(r))return;for(const o of n){if(!x(r))return;if(o){r.cells++,r.bytes+=E(o.text)+E(o.rawText)+E(o.value),L(o.richParagraphs,r);for(const s of o.children??[]){if(T(r))return;S(s,r,t+1)}}}}}}function H(e,r){if(e.format==="xlsx")for(const t of e.xlsx?.additionalSheets??[]){if(!x(r))return;r.bytes+=E(t?.name);for(const n of t?.rows??[]){if(!x(r))return;for(const o of n??[]){if(!x(r))return;r.cells++,r.bytes+=E(o)}}}}function G(e){const r={...$,...e.thresholds};for(const t of Object.values(r))if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("导出隔离阈值应为正安全整数");return r}function K(e,r){const t=G(r),n=e.pdf?.customFontFaces?Object.values(e.pdf.customFontFaces):[e.pdf?.customFontBytes],o={pages:e.prepared.plan.pages.length,cells:0,bytes:n.reduce((d,v)=>d+(v?.byteLength??0),0),visits:0,capped:!1,limits:t};for(const d of e.prepared.plan.pages){if(T(o))break;for(const v of d.components){if(T(o))break;S(v,o,0)}}H(e,o);let s=T(o)?"worker":"local",a=o.capped?"scan-limit":s==="worker"?"threshold":"small-task";return r.mode==="local"&&(s="local",a="explicit-local"),r.mode==="worker"&&(s="worker",a="explicit-worker"),Object.values(e.xlsx??{}).some(d=>typeof d=="function")&&(s="local",a="nonserializable-options"),{mode:s,reason:a,estimate:{pages:o.pages,cells:o.cells,bytes:o.bytes},hardCancellation:s==="worker"}}function X(e){if(e.mode!==void 0&&!["auto","local","worker"].includes(e.mode))throw new TypeError("无效的导出执行模式");if(e.fallback!==void 0&&!["local","error"].includes(e.fallback))throw new TypeError("无效的导出回退策略");l.validateBudget({...e.budget,maxDurationMs:e.timeoutMs??e.budget?.maxDurationMs??12e4})}function A(e,r){j.observeOutput(()=>e.onDecision?.({...r,estimate:{...r.estimate}}))}function B(e,r){return{...e,mode:"local",reason:r,hardCancellation:!1}}function D(e,r,t){l.assertBudget(t,"maxRows",e.stats.rows),l.assertBudget(t,"maxPages",e.stats.pages),l.assertBudget(t,"maxCells",e.stats.cells),l.assertBudget(t,"maxOutputBytes",e.bytes.byteLength),O.assertPreparedOutputBudget({...r,prepared:{...r.prepared,stats:e.stats}},t)}function J(e,r){const t={...l.DEFAULT_REPORT_RUNTIME_BUDGET,...r.budget},n=O.capturePreparedHandoff(e.prepared,t.maxPreparedBytes,e.signal),o={...e,prepared:n.prepared,pdf:O.snapshotPdfFonts(e.pdf),xlsx:O.snapshotXlsxOptions(e.xlsx)};return{request:o,forward:()=>({...o,prepared:n.forward()})}}function Q(e,r){X(e);const t={...e,thresholds:{...e.thresholds},budget:{...l.DEFAULT_REPORT_RUNTIME_BUDGET,...e.budget}},n=t.timeoutMs??t.budget.maxDurationMs??12e4,o=W.createReportRuntime({reports:{},budget:{...t.budget,maxDurationMs:n}}),s=new Set;let a=!1;const d=t.mode!=="worker"&&t.fallback!=="error";async function v(i,g){const h=Date.now(),b=()=>{const m=n-(Date.now()-h);if(m<=0)throw new l.ReportRuntimeError("timeout",`报表执行超过 ${n}ms`);return m};let p=K(i,t);if(p.reason==="nonserializable-options"&&t.mode==="worker")throw new TypeError("Worker 模式不接受函数选项;请使用本地模式或可序列化配置");if(p.mode==="worker"&&!r){if(!d)throw new M(new Error("未配置 workerFactory"));p=B(p,"worker-unavailable")}const R=J(i,t),u=R.request;if(A(t,p),l.throwIfAborted(i.signal),p.mode==="worker")try{const m=r(b());if(!m.exportPrepared)throw new TypeError("隔离执行器缺少 exportPrepared");const{signal:f,onEvent:c,...w}=u,y=await m.exportPrepared(w,f,c);return l.throwIfAborted(f),D(y,u,t.budget),{...y,execution:p}}catch(m){if(!(m instanceof M)||!d)throw m;l.throwIfAborted(i.signal),p=B(p,"worker-start-failed"),A(t,p)}g&&(u.prepared=W.enforcePrepared(u.prepared,t.budget),O.assertPreparedOutputBudget(u,t.budget));const k=g?await l.controlled(i.signal,b(),m=>g({...u,signal:m})):await l.controlled(i.signal,b(),m=>o.exportPrepared({...R.forward(),signal:m}));return l.throwIfAborted(i.signal),D(k,u,t.budget),{...k,execution:p}}return{async exportPrepared(i,g){if(a)throw new l.ReportRuntimeError("closed","导出执行器已释放");if(l.throwIfAborted(i.signal),s.size>=2)throw new l.ReportRuntimeError("queue-full","同时导出的任务已达 2 个,请等待完成后重试");const h=new AbortController;s.add(h);const b=()=>h.abort(i.signal?.reason);i.signal?.addEventListener("abort",b,{once:!0});try{return await v({...i,signal:h.signal},g)}finally{i.signal?.removeEventListener("abort",b),s.delete(h)}},cancel(){for(const i of s)i.abort()},dispose(){a=!0;for(const i of s)i.abort()}}}function q(e={}){const r=e.workerFactory,t={timeoutMs:e.timeoutMs??e.budget?.maxDurationMs,budget:{...e.budget}};return Q(e,r?n=>_(r,{...t,timeoutMs:n}):void 0)}const V=Object.freeze(Object.defineProperty({__proto__:null,createAutoReportExporter:q},Symbol.toStringTag,{value:"Module"}));exports.ReportWorkerStartError=M;exports.auto=V;exports.createAutoReportExporter=q;exports.createBrowserReportExecutor=_;
@@ -1 +0,0 @@
1
- "use strict";const c=require("./progress-WomPRP3B.cjs");function M(e,t){c.assertOutputActive(t.signal),c.observeOutput(()=>t.onDiagnostic?.(e)),c.assertOutputActive(t.signal)}class b extends Error{constructor(t){super(`Output contains ${t.length} known fidelity issue(s): ${t[0]?.code}`),this.diagnostics=t,this.code="output-fidelity",this.name="OutputFidelityError"}}const $=new Set(["text","rect","line","ellipse"]),k=new Set(["image","chart","barcode","qrcode"]);function m(e,t){if(!e.grid){if(c.isImageBackedComponent(e))return(t==="pdf"||t==="xlsx")&&!/^data:image\/(png|jpe?g);base64,/i.test(e.imageData)?{code:"unsupported-image-format",message:`${t.toUpperCase()} accepts PNG or JPEG data URLs; convert this image before exporting.`}:void 0;if(k.has(e.kind))return{code:"missing-image",message:`${e.kind} requires imageData or a renderer adapter before output.`};if(!$.has(e.kind))return{code:"unsupported-component",message:`Unsupported component kind: ${e.kind}.`};if(t==="xlsx"&&e.kind!=="text")return{code:"unsupported-component",message:`XLSX data export omits ${e.kind} geometry.`}}}function p(e,t,i,s,r){const o=Object.getOwnPropertyDescriptor(e,"meta")?.value,u=o&&Object.getOwnPropertyDescriptor(o,"componentExtension")?.value,n=u&&Object.getOwnPropertyDescriptor(u,"id")?.value,a=u&&Object.getOwnPropertyDescriptor(u,"version")?.value,d=typeof n=="string"&&n.length<=128&&typeof a=="string"&&a.length<=64?{id:n,version:a}:void 0;return{...r,severity:"warning",format:t,pageIndex:i,componentIndex:s,kind:e.kind,nid:e.nid,...d?{extension:d}:{}}}function h(e,t){if(!e||t==="dom")return;const i=[];return e.rotateDeg&&i.push("rotateDeg"),e.opacity!==void 0&&e.opacity!==1&&i.push("opacity"),t!=="xlsx"&&e.align==="justify"&&i.push("justify"),t==="xlsx"&&e.letterSpacing&&i.push("letterSpacing"),i.length?`${t} does not preserve these styles: ${i.join(", ")}.`:void 0}function x(e){if(!e)return;const t=["backgroundColor","align","verticalAlign","lineHeight","borderTop","borderRight","borderBottom","borderLeft","borderColor","lineColor","lineWidthPt"].filter(i=>e[i]!==void 0);return t.length?`XLSX rich text does not retain independent run styles: ${t.join(", ")}.`:void 0}function X(e){if(e.kind!=="text")return;const t=x(e.style);if(e.leftMm||e.topMm||t)return{code:"unsupported-style",message:`Nested XLSX text is retained as rich text in component order; absolute child offsets and independent paragraph styles are not retained.${t?` ${t}`:""}`}}function w(e,t,i,s,r,o){const u=n=>{r.push({...p(e,t,i,s,{code:"unsupported-style",message:n}),componentPath:o})};for(const n of e.richParagraphs??[]){t==="xlsx"&&(n.spaceBeforeMm||n.spaceAfterMm||n.indentMm||n.align||n.lineHeight)&&u("XLSX rich text preserves fonts and paragraph newlines; paragraph spacing, indentation and alignment are not retained.");const a=h({align:n.align},t);a&&u(a);for(const d of n.segments){const l=h(d.style,t)??(t==="xlsx"?x(d.style):void 0);l&&u(l)}}}function D(e,t,i,s,r,o,u){if(u.has(e))return;const n=new Set(u).add(e),a=m(e,t);a&&o.push({...p(e,t,i,s,a),componentPath:r});const d=h(e.style,t);d&&o.push({...p(e,t,i,s,{code:"unsupported-style",message:d}),componentPath:r}),w(e,t,i,s,o,r),j(e,t,i,s,r,o,n)}function B(e,t,i){if(e.grid)return{code:"nested-components-omitted",message:"XLSX cannot place a nested grid inside a single cell; the nested grid is omitted."};const s=X(e);if(s)return s;if(c.isImageBackedComponent(e)&&(e.leftMm<0||e.topMm<0||e.leftMm+e.widthMm>t+.001||e.topMm+e.heightMm>i+.001))return{code:"unsupported-style",message:"XLSX cannot clip a child image to a cell; it retains the original image dimensions."}}function C(e){let t;return(i,s,r,o)=>{t??=new Map(c.resolveGridLayout(e.grid,e.widthMm,e.heightMm).cells.map(a=>[`${a.ri}:${a.ci}`,a]));const u=t.get(`${s}:${r}`),n=2*(e.grid?.paddingMm??.5);return B(i,(u?.widthMm??0)-n-(o?.indentMm??0),(u?.heightMm??0)-n)}}function j(e,t,i,s,r,o,u){const n=C(e);for(const[a,d]of(e.grid?.cells??[]).entries())for(const[l,g]of d.entries()){g?.dataBar!==void 0&&!c.validDataBar(g.dataBar)&&o.push({...p(e,t,i,s,{code:"unsupported-style",message:"Invalid resolved data-bar geometry or color; visual data bars require ordered 0–1 ratios and #RRGGBB colors."}),componentPath:[...r,a,l]});const y=h(g?.style,t);y&&o.push({...p(e,t,i,s,{code:"unsupported-style",message:y}),componentPath:[...r,a,l]}),g?.richParagraphs?.length&&w({...e,richParagraphs:g.richParagraphs},t,i,s,o,[...r,a,l]);for(const[E,f]of(g?.children??[]).entries()){const v=[...r,a,l,E];if(t==="xlsx"){const O=n(f,a,l,g);if(O&&o.push({...p(f,t,i,s,O),componentPath:v}),f.grid)continue}D(f,t,i,s,v,o,u)}}}function S(e,t){c.assertBoundedRenderTree(e);const i=[];return e.pages.forEach((s,r)=>s.components.forEach((o,u)=>D(o,t,r,u,[],i,new Set))),i}function L(e,t,i){c.assertOutputActive(i.signal);const s=S(e,t);if(s.forEach(r=>M(r,i)),i.fidelity==="strict"&&s.length)throw new b(s);return s}exports.OutputFidelityError=b;exports.inspectOutputCapabilities=S;exports.notifyOutputDiagnostic=M;exports.reportOutputDiagnostics=L;
@@ -1,106 +0,0 @@
1
- import { v as h, u as D, E, i as M, y as $, r as k } from "./progress-ByiOxUD3.js";
2
- function m(e, t) {
3
- h(t.signal), D(() => t.onDiagnostic?.(e)), h(t.signal);
4
- }
5
- class X extends Error {
6
- constructor(t) {
7
- super(`Output contains ${t.length} known fidelity issue(s): ${t[0]?.code}`), this.diagnostics = t, this.code = "output-fidelity", this.name = "OutputFidelityError";
8
- }
9
- }
10
- const j = /* @__PURE__ */ new Set(["text", "rect", "line", "ellipse"]), B = /* @__PURE__ */ new Set(["image", "chart", "barcode", "qrcode"]);
11
- function L(e, t) {
12
- if (!e.grid) {
13
- if (M(e))
14
- return (t === "pdf" || t === "xlsx") && !/^data:image\/(png|jpe?g);base64,/i.test(e.imageData) ? { code: "unsupported-image-format", message: `${t.toUpperCase()} accepts PNG or JPEG data URLs; convert this image before exporting.` } : void 0;
15
- if (B.has(e.kind)) return { code: "missing-image", message: `${e.kind} requires imageData or a renderer adapter before output.` };
16
- if (!j.has(e.kind)) return { code: "unsupported-component", message: `Unsupported component kind: ${e.kind}.` };
17
- if (t === "xlsx" && e.kind !== "text") return { code: "unsupported-component", message: `XLSX data export omits ${e.kind} geometry.` };
18
- }
19
- }
20
- function g(e, t, s, i, r) {
21
- const o = Object.getOwnPropertyDescriptor(e, "meta")?.value, u = o && Object.getOwnPropertyDescriptor(o, "componentExtension")?.value, n = u && Object.getOwnPropertyDescriptor(u, "id")?.value, a = u && Object.getOwnPropertyDescriptor(u, "version")?.value, d = typeof n == "string" && n.length <= 128 && typeof a == "string" && a.length <= 64 ? { id: n, version: a } : void 0;
22
- return { ...r, severity: "warning", format: t, pageIndex: s, componentIndex: i, kind: e.kind, nid: e.nid, ...d ? { extension: d } : {} };
23
- }
24
- function f(e, t) {
25
- if (!e || t === "dom") return;
26
- const s = [];
27
- return e.rotateDeg && s.push("rotateDeg"), e.opacity !== void 0 && e.opacity !== 1 && s.push("opacity"), t !== "xlsx" && e.align === "justify" && s.push("justify"), t === "xlsx" && e.letterSpacing && s.push("letterSpacing"), s.length ? `${t} does not preserve these styles: ${s.join(", ")}.` : void 0;
28
- }
29
- function b(e) {
30
- if (!e) return;
31
- const t = ["backgroundColor", "align", "verticalAlign", "lineHeight", "borderTop", "borderRight", "borderBottom", "borderLeft", "borderColor", "lineColor", "lineWidthPt"].filter((s) => e[s] !== void 0);
32
- return t.length ? `XLSX rich text does not retain independent run styles: ${t.join(", ")}.` : void 0;
33
- }
34
- function C(e) {
35
- if (e.kind !== "text") return;
36
- const t = b(e.style);
37
- if (e.leftMm || e.topMm || t) return { code: "unsupported-style", message: `Nested XLSX text is retained as rich text in component order; absolute child offsets and independent paragraph styles are not retained.${t ? ` ${t}` : ""}` };
38
- }
39
- function w(e, t, s, i, r, o) {
40
- const u = (n) => {
41
- r.push({ ...g(e, t, s, i, { code: "unsupported-style", message: n }), componentPath: o });
42
- };
43
- for (const n of e.richParagraphs ?? []) {
44
- t === "xlsx" && (n.spaceBeforeMm || n.spaceAfterMm || n.indentMm || n.align || n.lineHeight) && u("XLSX rich text preserves fonts and paragraph newlines; paragraph spacing, indentation and alignment are not retained.");
45
- const a = f({ align: n.align }, t);
46
- a && u(a);
47
- for (const d of n.segments) {
48
- const l = f(d.style, t) ?? (t === "xlsx" ? b(d.style) : void 0);
49
- l && u(l);
50
- }
51
- }
52
- }
53
- function O(e, t, s, i, r, o, u) {
54
- if (u.has(e)) return;
55
- const n = new Set(u).add(e), a = L(e, t);
56
- a && o.push({ ...g(e, t, s, i, a), componentPath: r });
57
- const d = f(e.style, t);
58
- d && o.push({ ...g(e, t, s, i, { code: "unsupported-style", message: d }), componentPath: r }), w(e, t, s, i, o, r), R(e, t, s, i, r, o, n);
59
- }
60
- function P(e, t, s) {
61
- if (e.grid) return { code: "nested-components-omitted", message: "XLSX cannot place a nested grid inside a single cell; the nested grid is omitted." };
62
- const i = C(e);
63
- if (i) return i;
64
- if (M(e) && (e.leftMm < 0 || e.topMm < 0 || e.leftMm + e.widthMm > t + 1e-3 || e.topMm + e.heightMm > s + 1e-3)) return { code: "unsupported-style", message: "XLSX cannot clip a child image to a cell; it retains the original image dimensions." };
65
- }
66
- function G(e) {
67
- let t;
68
- return (s, i, r, o) => {
69
- t ??= new Map(k(e.grid, e.widthMm, e.heightMm).cells.map((a) => [`${a.ri}:${a.ci}`, a]));
70
- const u = t.get(`${i}:${r}`), n = 2 * (e.grid?.paddingMm ?? 0.5);
71
- return P(s, (u?.widthMm ?? 0) - n - (o?.indentMm ?? 0), (u?.heightMm ?? 0) - n);
72
- };
73
- }
74
- function R(e, t, s, i, r, o, u) {
75
- const n = G(e);
76
- for (const [a, d] of (e.grid?.cells ?? []).entries()) for (const [l, c] of d.entries()) {
77
- c?.dataBar !== void 0 && !$(c.dataBar) && o.push({ ...g(e, t, s, i, { code: "unsupported-style", message: "Invalid resolved data-bar geometry or color; visual data bars require ordered 0–1 ratios and #RRGGBB colors." }), componentPath: [...r, a, l] });
78
- const y = f(c?.style, t);
79
- y && o.push({ ...g(e, t, s, i, { code: "unsupported-style", message: y }), componentPath: [...r, a, l] }), c?.richParagraphs?.length && w({ ...e, richParagraphs: c.richParagraphs }, t, s, i, o, [...r, a, l]);
80
- for (const [S, p] of (c?.children ?? []).entries()) {
81
- const v = [...r, a, l, S];
82
- if (t === "xlsx") {
83
- const x = n(p, a, l, c);
84
- if (x && o.push({ ...g(p, t, s, i, x), componentPath: v }), p.grid) continue;
85
- }
86
- O(p, t, s, i, v, o, u);
87
- }
88
- }
89
- }
90
- function N(e, t) {
91
- E(e);
92
- const s = [];
93
- return e.pages.forEach((i, r) => i.components.forEach((o, u) => O(o, t, r, u, [], s, /* @__PURE__ */ new Set()))), s;
94
- }
95
- function T(e, t, s) {
96
- h(s.signal);
97
- const i = N(e, t);
98
- if (i.forEach((r) => m(r, s)), s.fidelity === "strict" && i.length) throw new X(i);
99
- return i;
100
- }
101
- export {
102
- X as O,
103
- N as i,
104
- m as n,
105
- T as r
106
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("./progress-WomPRP3B.cjs");function n(t,o,d,r){if(!e.validDataBar(t)||t.start===t.end)return;const a=Math.max(0,o-2*r);return{x:r+a*t.start,y:r,width:a*(t.end-t.start),height:Math.max(0,d-2*r),color:t.color}}exports.dataBarBox=n;