@agile-team/mach-report 2.13.0 → 2.15.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 (260) hide show
  1. package/README.md +20 -7
  2. package/THIRD_PARTY_NOTICES.md +3 -1
  3. package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
  4. package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
  5. package/dist/ParamEditor-Da4akw6V.cjs +1 -0
  6. package/dist/ParamEditor-DoAhzJsm.js +594 -0
  7. package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
  8. package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
  9. package/dist/ReportPreview-ChV19HBp.js +4619 -0
  10. package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
  11. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
  12. package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
  13. package/dist/RuleEditor-C_Clasvd.js +2037 -0
  14. package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
  16. package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
  17. package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
  18. package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
  19. package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
  20. package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
  21. package/dist/analytics.cjs +1 -1
  22. package/dist/analytics.d.cts +3 -1
  23. package/dist/analytics.d.ts +3 -1
  24. package/dist/analytics.js +154 -60
  25. package/dist/artifact-integrity.json +135 -0
  26. package/dist/assets-B9ImAi6_.cjs +1 -0
  27. package/dist/assets-DEaz4qsp.js +124 -0
  28. package/dist/batch-BaP6pWDE.cjs +1 -0
  29. package/dist/batch-BfZHN1do.js +220 -0
  30. package/dist/batch-CGyt-b2W.js +273 -0
  31. package/dist/batch-CLpELXBl.cjs +1 -0
  32. package/dist/capabilities-CAh2Nrue.cjs +1 -0
  33. package/dist/capabilities-DskCHs3V.js +69 -0
  34. package/dist/codes.d.cts +2 -0
  35. package/dist/codes.d.ts +2 -0
  36. package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
  37. package/dist/config-BVsJXSqS.js +842 -0
  38. package/dist/config-D10us76d.cjs +1 -0
  39. package/dist/data-explanation-B8MZRYVS.js +16 -0
  40. package/dist/data-explanation-DE55G30w.cjs +1 -0
  41. package/dist/designer-2bDlcNXQ.js +5136 -0
  42. package/dist/designer-BT7XCdbW.cjs +2 -0
  43. package/dist/designer.cjs +1 -2
  44. package/dist/designer.d.cts +432 -17
  45. package/dist/designer.d.ts +432 -17
  46. package/dist/designer.js +21 -4312
  47. package/dist/drill-ByJviLXS.js +145 -0
  48. package/dist/drill-DYTxuL3A.cjs +1 -0
  49. package/dist/font-loader-B_UkxpzC.cjs +1 -0
  50. package/dist/font-loader-Q3bQjmrI.js +297 -0
  51. package/dist/index.cjs +8 -8
  52. package/dist/index.d.cts +239 -5
  53. package/dist/index.d.ts +239 -5
  54. package/dist/index.js +939 -893
  55. package/dist/json-snapshot-DFb2eWkf.js +1416 -0
  56. package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
  57. package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
  58. package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
  59. package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
  60. package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
  61. package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
  62. package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
  63. package/dist/licenses/_types_node-14.18.63.txt +22 -0
  64. package/dist/licenses/_types_pako-2.0.3.txt +22 -0
  65. package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
  66. package/dist/licenses/archiver-5.3.2.txt +23 -0
  67. package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
  68. package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
  69. package/dist/licenses/async-3.2.6.txt +20 -0
  70. package/dist/licenses/balanced-match-1.0.2.txt +22 -0
  71. package/dist/licenses/base64-js-1.5.1.txt +22 -0
  72. package/dist/licenses/big-integer-1.6.52.txt +25 -0
  73. package/dist/licenses/binary-0.3.0.txt +178 -0
  74. package/dist/licenses/bl-4.1.0.txt +14 -0
  75. package/dist/licenses/bluebird-3.4.7.txt +22 -0
  76. package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
  77. package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
  78. package/dist/licenses/buffer-5.7.1.txt +22 -0
  79. package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
  80. package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
  81. package/dist/licenses/buffers-0.1.1.txt +140 -0
  82. package/dist/licenses/chainsaw-0.1.0.txt +184 -0
  83. package/dist/licenses/compress-commons-4.1.2.txt +23 -0
  84. package/dist/licenses/concat-map-0.0.1.txt +19 -0
  85. package/dist/licenses/core-util-is-1.0.3.txt +20 -0
  86. package/dist/licenses/crc-32-1.2.2.txt +202 -0
  87. package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
  88. package/dist/licenses/dayjs-1.11.23.txt +22 -0
  89. package/dist/licenses/duplexer2-0.1.4.txt +27 -0
  90. package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
  91. package/dist/licenses/exceljs-4.4.0.txt +23 -0
  92. package/dist/licenses/fast-csv-4.3.6.txt +22 -0
  93. package/dist/licenses/fast-png-6.4.0.txt +22 -0
  94. package/dist/licenses/fs-constants-1.0.0.txt +22 -0
  95. package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
  96. package/dist/licenses/fstream-1.0.12.txt +16 -0
  97. package/dist/licenses/glob-7.2.3.txt +22 -0
  98. package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
  99. package/dist/licenses/ieee754-1.2.1.txt +12 -0
  100. package/dist/licenses/immediate-3.0.6.txt +21 -0
  101. package/dist/licenses/inflight-1.0.6.txt +16 -0
  102. package/dist/licenses/inherits-2.0.4.txt +17 -0
  103. package/dist/licenses/iobuffer-5.4.0.txt +23 -0
  104. package/dist/licenses/isarray-1.0.0.txt +61 -0
  105. package/dist/licenses/jszip-3.10.2.txt +652 -0
  106. package/dist/licenses/lazystream-1.0.1.txt +24 -0
  107. package/dist/licenses/lie-3.3.0.txt +8 -0
  108. package/dist/licenses/listenercount-1.0.1.txt +6 -0
  109. package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
  110. package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
  111. package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
  112. package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
  113. package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
  114. package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
  115. package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
  116. package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
  117. package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
  118. package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
  119. package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
  120. package/dist/licenses/lodash.union-4.6.0.txt +48 -0
  121. package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
  122. package/dist/licenses/minimatch-3.1.5.txt +16 -0
  123. package/dist/licenses/minimatch-5.1.9.txt +16 -0
  124. package/dist/licenses/minimist-1.2.8.txt +19 -0
  125. package/dist/licenses/mkdirp-0.5.6.txt +22 -0
  126. package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
  127. package/dist/licenses/normalize-path-3.0.0.txt +22 -0
  128. package/dist/licenses/once-1.4.0.txt +16 -0
  129. package/dist/licenses/pako-1.0.11.txt +22 -0
  130. package/dist/licenses/pako-2.2.0.txt +22 -0
  131. package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
  132. package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
  133. package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
  134. package/dist/licenses/readable-stream-2.3.8.txt +48 -0
  135. package/dist/licenses/readable-stream-3.6.2.txt +48 -0
  136. package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
  137. package/dist/licenses/rimraf-2.7.1.txt +16 -0
  138. package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
  139. package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
  140. package/dist/licenses/saxes-5.0.1.txt +397 -0
  141. package/dist/licenses/setimmediate-1.0.5.txt +21 -0
  142. package/dist/licenses/string_decoder-1.1.1.txt +49 -0
  143. package/dist/licenses/string_decoder-1.3.0.txt +49 -0
  144. package/dist/licenses/tar-stream-2.2.0.txt +22 -0
  145. package/dist/licenses/tmp-0.2.7.txt +22 -0
  146. package/dist/licenses/traverse-0.3.9.txt +25 -0
  147. package/dist/licenses/tslib-1.14.1.txt +13 -0
  148. package/dist/licenses/unzipper-0.10.14.txt +26 -0
  149. package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
  150. package/dist/licenses/uuid-11.1.1.txt +10 -0
  151. package/dist/licenses/wrappy-1.0.2.txt +16 -0
  152. package/dist/licenses/xmlchars-2.2.0.txt +19 -0
  153. package/dist/licenses/zip-stream-4.1.1.txt +23 -0
  154. package/dist/matrix-CGRGkn5s.js +112 -0
  155. package/dist/matrix-gEO7ZM_u.cjs +1 -0
  156. package/dist/media-B7vnpD8k.cjs +1 -0
  157. package/dist/media-Y90dHK9z.js +70 -0
  158. package/dist/param-validation-C3HlcLLO.cjs +1 -0
  159. package/dist/param-validation-Do7Eg8Zv.js +181 -0
  160. package/dist/pdf-BwNyeGpt.js +36352 -0
  161. package/dist/pdf-CvvrjPQg.cjs +103 -0
  162. package/dist/pdf.cjs +1 -101
  163. package/dist/pdf.d.cts +18 -3
  164. package/dist/pdf.d.ts +18 -3
  165. package/dist/pdf.js +9 -36579
  166. package/dist/plugin-Ca_XZG3l.js +22 -0
  167. package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
  168. package/dist/prepared-CFy9B75C.cjs +1 -0
  169. package/dist/prepared-ajM-H-9B.js +69 -0
  170. package/dist/progress-B0ctFpKf.cjs +1 -0
  171. package/dist/progress-D-OTpEav.js +52 -0
  172. package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
  173. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
  174. package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
  175. package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
  176. package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
  177. package/dist/sbom.cdx.json +3982 -0
  178. package/dist/server/node.d.cts +66 -12
  179. package/dist/server/node.d.ts +66 -12
  180. package/dist/server-node.cjs +1 -1
  181. package/dist/server-node.js +405 -381
  182. package/dist/server.cjs +1 -1
  183. package/dist/server.d.cts +878 -15
  184. package/dist/server.d.ts +878 -15
  185. package/dist/server.js +1034 -534
  186. package/dist/sha256-ArEYjaTI.cjs +1 -0
  187. package/dist/sha256-DPEuJ3nh.js +155 -0
  188. package/dist/style.css +1 -1
  189. package/dist/template-bindings-C2SpvsMU.js +58 -0
  190. package/dist/template-bindings-CEtWyiLX.cjs +1 -0
  191. package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
  192. package/dist/template-catalog-j2B1MJlL.js +414 -0
  193. package/dist/template-fragments-BGbQLGlV.js +187 -0
  194. package/dist/template-fragments-DcKeiylI.cjs +1 -0
  195. package/dist/template-outline-BwRV_eRo.cjs +1 -0
  196. package/dist/template-outline-cnWfT_LK.js +88 -0
  197. package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
  198. package/dist/template-registry-Co1zPq5e.cjs +1 -0
  199. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  200. package/dist/textwrap-DE1kgcJB.js +110 -0
  201. package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
  202. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  203. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  204. package/dist/vue/async.d.cts +190 -15
  205. package/dist/vue/async.d.ts +190 -15
  206. package/dist/vue/index.d.cts +274 -24
  207. package/dist/vue/index.d.ts +274 -24
  208. package/dist/vue-async.cjs +1 -1
  209. package/dist/vue-async.js +5 -5
  210. package/dist/vue.cjs +1 -1
  211. package/dist/vue.js +90 -81
  212. package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
  213. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
  214. package/dist/worker.cjs +1 -1
  215. package/dist/worker.d.cts +66 -12
  216. package/dist/worker.d.ts +66 -12
  217. package/dist/worker.js +61 -56
  218. package/dist/xlsx-node.cjs +34 -34
  219. package/dist/xlsx-node.js +878 -870
  220. package/dist/xlsx.cjs +3 -4
  221. package/dist/xlsx.d.cts +22 -10
  222. package/dist/xlsx.d.ts +22 -10
  223. package/dist/xlsx.js +261 -253
  224. package/package.json +2 -2
  225. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  226. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  227. package/dist/ParamEditor-BLaE5q5W.js +0 -522
  228. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  229. package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
  230. package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
  231. package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
  232. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  233. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  234. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  235. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  236. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  237. package/dist/assets-C2U-e-Sz.cjs +0 -4
  238. package/dist/assets-Q0wUwNrV.js +0 -217
  239. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  240. package/dist/batch-mRqhhhjt.js +0 -364
  241. package/dist/capabilities-CK_7hizc.js +0 -63
  242. package/dist/capabilities-CsZ-pNHR.cjs +0 -1
  243. package/dist/config-Bb7RiIO5.cjs +0 -1
  244. package/dist/config-XVwG87IA.js +0 -529
  245. package/dist/matrix-DVyWiYsd.cjs +0 -1
  246. package/dist/matrix-yZsGnldA.js +0 -227
  247. package/dist/page-window-index-CIuT4BAv.js +0 -43
  248. package/dist/page-window-index-DEjnM6IB.cjs +0 -1
  249. package/dist/param-validation-BlHHXs6u.js +0 -153
  250. package/dist/param-validation-DCK039V1.cjs +0 -1
  251. package/dist/plugin-D4wizDXB.js +0 -22
  252. package/dist/progress-7OSZbFok.js +0 -39
  253. package/dist/progress-BnLiS5eH.cjs +0 -1
  254. package/dist/task-events-DQ276fn2.cjs +0 -1
  255. package/dist/task-events-Dpsvf_t2.js +0 -47
  256. package/dist/template-registry-D3SjENi6.cjs +0 -1
  257. package/dist/template-review-DGwWOoCv.cjs +0 -2
  258. package/dist/template-review-PgEe_Wr9.js +0 -1742
  259. package/dist/validate-BJ5HIWY8.cjs +0 -1
  260. package/dist/validate-DbgEM1Hh.js +0 -163
package/dist/index.js CHANGED
@@ -1,28 +1,36 @@
1
- import { D as Z, a as xe } from "./defaults-DXhiM1ZD.js";
2
- import { b as Hn, c as _n, d as Bn, L as jn, S as Wn } from "./defaults-DXhiM1ZD.js";
3
- import { R as Un, e as Vn, f as qn, p as Yn, b as Jn, t as Kn, d as Xn } from "./record-bindings-D-5jQlTj.js";
4
- import { a as H, r as _, b as Q, c as j, d as Ee, m as ie, e as Te, p as O, f as Se, P as J } from "./style-CQ1PK8ZB.js";
5
- import { C as Qn, M as er, g as tr, h as nr } from "./style-CQ1PK8ZB.js";
6
- import { i as ee, a as Ce } from "./render-plan-Ck6koX9L.js";
7
- import { R as ir } from "./render-plan-Ck6koX9L.js";
8
- import { a as ar, v as sr, b as lr, c as cr } from "./validate-DbgEM1Hh.js";
9
- import { v as Ve } from "./dataset-H5pFuQGU.js";
10
- import { d as mr } from "./dataset-H5pFuQGU.js";
11
- import { h as oe, r as ae, w as Re } from "./assets-Q0wUwNrV.js";
12
- import { O as gr, c as ur, a as fr, b as pr, m as wr } from "./assets-Q0wUwNrV.js";
13
- import { R as se, d as qe, a as Ye, p as Je } from "./template-review-PgEe_Wr9.js";
14
- import { D as br, P as yr, b as Mr, c as xr, e as Er, f as Tr, g as Sr, h as Cr, i as Rr, j as Pr, k as Ar, l as kr, m as Ir, n as Nr, o as $r, q as Lr, r as Dr, s as Fr, t as Or, u as zr, v as Hr, w as _r, x as Br, y as jr, z as Wr } from "./template-review-PgEe_Wr9.js";
15
- import { r as Pe } from "./grid-geometry-BNptEcMm.js";
16
- import { r as Ae } from "./grid-strokes-DyyG1q_o.js";
17
- import { r as G, n as ke, O as Ke } from "./capabilities-CK_7hizc.js";
18
- import { i as Ur } from "./capabilities-CK_7hizc.js";
19
- import { o as Xe } from "./progress-7OSZbFok.js";
20
- import { c as Ze } from "./page-window-index-CIuT4BAv.js";
21
- import { v as Ie, R as Ne, p as I } from "./template-registry-BjE1VS6g.js";
22
- import { a as qr, c as Yr, d as Jr, s as Kr, b as Xr } from "./template-registry-BjE1VS6g.js";
23
- import { R as Qr, a as ei, f as ti, i as ni, b as ri, c as ii, p as oi, r as ai, v as si, d as li } from "./param-validation-BlHHXs6u.js";
24
- import { T as di, c as mi, v as hi } from "./tree-CqcQ99NM.js";
25
- const Qe = {
1
+ import { D as te, a as Te } from "./defaults-DXhiM1ZD.js";
2
+ import { b as Yn, c as Kn, d as Jn, L as Xn, S as Zn } from "./defaults-DXhiM1ZD.js";
3
+ import { R as er, e as tr, f as nr, p as rr, b as ar, t as ir, d as or } from "./record-bindings-Do_b3h4V.js";
4
+ import { a as j, r as _, b as ne, c as G, d as Ce, m as se, e as Re, p as W, f as Pe, P as Z } from "./style-CQ1PK8ZB.js";
5
+ import { C as lr, M as cr, g as mr, h as dr } from "./style-CQ1PK8ZB.js";
6
+ import { i as re, a as Ae } from "./render-plan-Ck6koX9L.js";
7
+ import { R as gr } from "./render-plan-Ck6koX9L.js";
8
+ import { v as $e, R as ke, p as U, a as Je } from "./template-registry-BtaKPELV.js";
9
+ import { b as ur, c as pr, d as wr, e as br, s as Mr, f as yr, g as vr, h as xr } from "./template-registry-BtaKPELV.js";
10
+ import { v as Xe } from "./dataset-H5pFuQGU.js";
11
+ import { d as Sr } from "./dataset-H5pFuQGU.js";
12
+ import { h as le, w as Ie } from "./textwrap-DE1kgcJB.js";
13
+ import { c as Cr, a as Rr, b as Pr, m as Ar } from "./textwrap-DE1kgcJB.js";
14
+ import { R as ce, d as Ze, s as Qe } from "./json-snapshot-DFb2eWkf.js";
15
+ import { D as kr, P as Ir, a as Nr, b as Lr, c as Dr, e as Fr, f as Or, g as Hr, h as zr, i as Wr, p as Br, j as jr, k as _r, r as Ur, l as Gr } from "./json-snapshot-DFb2eWkf.js";
16
+ import { r as Ne } from "./grid-geometry-BNptEcMm.js";
17
+ import { r as Le } from "./grid-strokes-DyyG1q_o.js";
18
+ import { r as q, n as De, O as et } from "./capabilities-DskCHs3V.js";
19
+ import { i as qr } from "./capabilities-DskCHs3V.js";
20
+ import { o as tt } from "./progress-D-OTpEav.js";
21
+ import { r as me } from "./assets-DEaz4qsp.js";
22
+ import { O as Kr } from "./assets-DEaz4qsp.js";
23
+ import { c as nt } from "./drill-ByJviLXS.js";
24
+ import { R as Xr, a as Zr, m as Qr, r as ea, v as ta } from "./drill-ByJviLXS.js";
25
+ import { R as ra, a as aa, f as ia, i as oa, b as sa, c as la, p as ca, r as ma, v as da, d as ha } from "./param-validation-Do7Eg8Zv.js";
26
+ import { c as fa, a as ua, d as pa, r as wa, b as ba } from "./template-catalog-j2B1MJlL.js";
27
+ import { h as ya, i as va, a as xa } from "./data-explanation-B8MZRYVS.js";
28
+ import { c as Sa, i as Ta, t as Ca } from "./template-outline-cnWfT_LK.js";
29
+ import { a as Pa, c as Aa, i as $a, b as ka } from "./template-fragments-BGbQLGlV.js";
30
+ import { R as rt, p as at } from "./batch-CGyt-b2W.js";
31
+ import { a as Na, b as La, c as Da, d as Fa, e as Oa, f as Ha, g as za, r as Wa, s as Ba } from "./batch-CGyt-b2W.js";
32
+ import { T as _a, c as Ua, v as Ga } from "./tree-CjVZLRw7.js";
33
+ const it = {
26
34
  root: "mr-root",
27
35
  page: "mr-page",
28
36
  comp: "mr-comp",
@@ -39,18 +47,18 @@ const Qe = {
39
47
  cell: "mr-cell",
40
48
  unknown: "mr-unknown"
41
49
  };
42
- function E(e, t) {
43
- return t?.classNames?.[e] ?? Qe[e];
50
+ function T(e, t) {
51
+ return t?.classNames?.[e] ?? it[e];
44
52
  }
45
- class et {
53
+ class ot {
46
54
  constructor() {
47
55
  this.props = [];
48
56
  }
49
57
  add(t, n) {
50
58
  return n == null || n === !1 || n === "" ? this : (this.props.push([t, String(n)]), this);
51
59
  }
52
- mm(t, n, r, i = 2) {
53
- return this.add(t, `${H(ie(n, r), i)}px`);
60
+ mm(t, n, r, a = 2) {
61
+ return this.add(t, `${j(se(n, r), a)}px`);
54
62
  }
55
63
  toString() {
56
64
  let t = "";
@@ -64,521 +72,521 @@ class et {
64
72
  }
65
73
  }
66
74
  function y(e, t = "unset") {
67
- return new et().add("all", t).add("display", e).add("box-sizing", "border-box");
75
+ return new ot().add("all", t).add("display", e).add("box-sizing", "border-box");
68
76
  }
69
- function $e(e, t, n) {
70
- 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(Q(t))).add("text-align", t.align);
77
+ function Fe(e, t, n) {
78
+ 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(ne(t))).add("text-align", t.align);
71
79
  const r = _(t, n);
72
- e.add("font-size", `${H(r.fontSizePx, 2)}px`);
80
+ e.add("font-size", `${j(r.fontSizePx, 2)}px`);
73
81
  }
74
- function tt(e, t, n) {
82
+ function st(e, t, n) {
75
83
  const r = t.style ?? {};
76
- $e(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);
77
- }
78
- function nt(e, t, n, r, i, o) {
79
- const s = e.cell, a = o.createElement("td");
80
- a.className = E("cell", i), a.dataset.mrRowIndex = String(e.ri), a.dataset.mrColumnIndex = String(e.ci), a.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), s.colSpan && (a.colSpan = s.colSpan), s.rowSpan && (a.rowSpan = s.rowSpan);
81
- const l = Te(t.style, s.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", l.backgroundColor).add("vertical-align", l.verticalAlign ?? "middle");
82
- $e(c, l, r), c.applyTo(a);
83
- const d = o.createElement("div");
84
- d.className = "mr-cell-content", y("flex").add("position", "absolute").mm("left", n + (s.indentMm ?? 0), r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", l.verticalAlign === "top" ? "flex-start" : l.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(d), s.text != null && d.append(s.text);
85
- for (const m of s.children ?? []) d.appendChild(Le(m, r, i, o));
86
- return a.appendChild(d), a;
87
- }
88
- function rt(e, t, n, r) {
89
- return Ae(e, t).map((i) => {
90
- const o = `${H(i.widthPt * n / 72, 2)}px solid ${i.color}`, s = r.createElement("div");
91
- s.className = "mr-grid-edge", s.setAttribute("aria-hidden", "true");
92
- const a = i.kind === "h";
93
- 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", o).applyTo(s), s;
84
+ Fe(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);
85
+ }
86
+ function lt(e, t, n, r, a, o) {
87
+ const l = e.cell, i = o.createElement("td");
88
+ i.className = T("cell", a), i.dataset.mrRowIndex = String(e.ri), i.dataset.mrColumnIndex = String(e.ci), i.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), l.colSpan && (i.colSpan = l.colSpan), l.rowSpan && (i.rowSpan = l.rowSpan);
89
+ const s = Re(t.style, l.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");
90
+ Fe(c, s, r), c.applyTo(i);
91
+ const m = o.createElement("div");
92
+ m.className = "mr-cell-content", y("flex").add("position", "absolute").mm("left", n + (l.indentMm ?? 0), 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(m), l.text != null && m.append(l.text);
93
+ for (const d of l.children ?? []) m.appendChild(Oe(d, r, a, o));
94
+ return i.appendChild(m), i;
95
+ }
96
+ function ct(e, t, n, r) {
97
+ return Le(e, t).map((a) => {
98
+ const o = `${j(a.widthPt * n / 72, 2)}px solid ${a.color}`, l = r.createElement("div");
99
+ l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
100
+ const i = a.kind === "h";
101
+ return y("block").add("position", "absolute").add("pointer-events", "none").mm("left", i ? a.from : a.pos, n).mm("top", i ? a.pos : a.from, n).mm("width", i ? a.to - a.from : 0, n).mm("height", i ? 0 : a.to - a.from, n).add(i ? "border-top" : "border-left", o).applyTo(l), l;
94
102
  });
95
103
  }
96
- function it(e, t, n, r, i) {
97
- const o = i.createElement("table");
98
- o.className = E("grid", r), o.setAttribute("role", "table"), y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(o);
99
- const s = Pe(e, t.widthMm, t.heightMm), a = i.createElement("tbody");
100
- y("contents").applyTo(a), o.appendChild(a);
101
- const l = e.cells.map(() => {
102
- const d = i.createElement("tr");
103
- return d.className = E("row", r), d.setAttribute("role", "row"), y("contents").applyTo(d), a.appendChild(d), d;
104
+ function mt(e, t, n, r, a) {
105
+ const o = a.createElement("table");
106
+ o.className = T("grid", r), o.setAttribute("role", "table"), y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(o);
107
+ const l = Ne(e, t.widthMm, t.heightMm), i = a.createElement("tbody");
108
+ y("contents").applyTo(i), o.appendChild(i);
109
+ const s = e.cells.map(() => {
110
+ const m = a.createElement("tr");
111
+ return m.className = T("row", r), m.setAttribute("role", "row"), y("contents").applyTo(m), i.appendChild(m), m;
104
112
  });
105
- for (const d of s.cells)
106
- l[d.ri].appendChild(nt(d, t, e.paddingMm ?? 0.5, n, r, i));
107
- const c = i.createElement("div");
108
- return y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(o, ...rt(s, t, n, i)), c;
109
- }
110
- function ot(e, t, n, r) {
111
- const i = r.createElement("div");
112
- i.className = E("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);
113
+ for (const m of l.cells)
114
+ s[m.ri].appendChild(lt(m, t, e.paddingMm ?? 0.5, n, r, a));
115
+ const c = a.createElement("div");
116
+ return y("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(o, ...ct(l, t, n, a)), c;
117
+ }
118
+ function dt(e, t, n, r) {
119
+ const a = r.createElement("div");
120
+ a.className = T("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(a);
113
121
  for (const o of e.segments || []) {
114
- const s = r.createElement("span");
115
- s.className = E("segment", n), s.textContent = o.kind === "field" ? o.field ?? "" : o.text ?? "";
116
- const a = y("inline");
122
+ const l = r.createElement("span");
123
+ l.className = T("segment", n), l.textContent = o.kind === "field" ? o.field ?? "" : o.text ?? "";
124
+ const i = y("inline");
117
125
  if (o.style) {
118
- const l = o.style;
119
- a.add("color", l.color).add("font-family", l.fontFamily).add("font-weight", l.bold != null ? l.bold ? "700" : "400" : void 0).add("font-style", l.italic != null ? l.italic ? "italic" : "normal" : void 0).add("text-decoration", l.underline != null ? l.underline ? "underline" : "none" : void 0), (l.fontSize != null || l.fontSizePx != null) && a.add("font-size", `${H(_(l, t).fontSizePx, 2)}px`);
126
+ const s = o.style;
127
+ i.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) && i.add("font-size", `${j(_(s, t).fontSizePx, 2)}px`);
120
128
  }
121
- a.applyTo(s), i.appendChild(s);
129
+ i.applyTo(l), a.appendChild(l);
122
130
  }
123
- return i;
124
- }
125
- function at(e, t, n, r) {
126
- if (Ce(e)) {
127
- const i = r.createElement("div");
128
- i.className = E("rich", n), y("block").applyTo(i);
129
- for (const o of e.richParagraphs) i.appendChild(ot(o, t, n, r));
130
- return i;
131
+ return a;
132
+ }
133
+ function ht(e, t, n, r) {
134
+ if (Ae(e)) {
135
+ const a = r.createElement("div");
136
+ a.className = T("rich", n), y("block").applyTo(a);
137
+ for (const o of e.richParagraphs) a.appendChild(dt(o, t, n, r));
138
+ return a;
131
139
  }
132
140
  if (Array.isArray(e.lines) && e.lines.length > 0) {
133
- const i = r.createElement("div");
134
- i.className = E("lines", n), y("block").applyTo(i);
141
+ const a = r.createElement("div");
142
+ a.className = T("lines", n), y("block").applyTo(a);
135
143
  for (const o of e.lines) {
136
- const s = r.createElement("div");
137
- s.className = E("line", n), s.textContent = o, y("block").add("white-space", "pre").add("min-height", "1lh").applyTo(s), i.appendChild(s);
144
+ const l = r.createElement("div");
145
+ l.className = T("line", n), l.textContent = o, y("block").add("white-space", "pre").add("min-height", "1lh").applyTo(l), a.appendChild(l);
138
146
  }
139
- return i;
147
+ return a;
140
148
  }
141
149
  return e.text ?? "";
142
150
  }
143
- function st(e, t, n, r) {
144
- const i = r.createElement("div");
145
- i.className = E("text", n);
151
+ function gt(e, t, n, r) {
152
+ const a = r.createElement("div");
153
+ a.className = T("text", n);
146
154
  const o = e.style || {};
147
- return y("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", o.verticalAlign === "middle" ? "center" : o.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(i), i.append(at(e, t, n, r)), i;
155
+ return y("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", o.verticalAlign === "middle" ? "center" : o.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(a), a.append(ht(e, t, n, r)), a;
148
156
  }
149
- function lt(e, t, n) {
157
+ function ft(e, t, n) {
150
158
  const r = n.createElement("img");
151
- return r.className = E("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;
152
- }
153
- function fe(e, t, n, r) {
154
- const i = r.createElement("div");
155
- i.className = E("shape", n);
156
- const o = e.style || {}, s = j(o), a = Ee(o), l = `${H(s.widthPt * t / 72, 2)}px solid ${s.color}`, c = y("block");
157
- return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top", l), a.right && c.add("border-right", l), a.bottom && c.add("border-bottom", l), a.left && c.add("border-left", l)) : e.kind === "ellipse" ? (a.inner && c.add("border", l).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", l), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
158
- }
159
- function ct(e, t, n) {
160
- const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), i = ie(e.widthMm, t), o = ie(e.heightMm, t);
161
- r.setAttribute("width", String(Math.max(1, i))), r.setAttribute("height", String(Math.max(1, o))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
162
- const s = n.createElementNS("http://www.w3.org/2000/svg", "line");
163
- s.setAttribute("x1", "0"), s.setAttribute("x2", String(i)), s.setAttribute("y1", e.lineDirection === "up" ? String(o) : "0"), s.setAttribute("y2", e.lineDirection === "up" ? "0" : String(o));
164
- const a = j({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
165
- return s.setAttribute("stroke", a.color), s.setAttribute("stroke-width", String(a.widthPt * t / 72)), r.appendChild(s), r;
166
- }
167
- function Le(e, t, n, r) {
168
- const i = r.createElement("div");
169
- i.className = `${E("comp", n)} mr-kind-${e.kind}`;
159
+ return r.className = T("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;
160
+ }
161
+ function be(e, t, n, r) {
162
+ const a = r.createElement("div");
163
+ a.className = T("shape", n);
164
+ const o = e.style || {}, l = G(o), i = Ce(o), s = `${j(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = y("block");
165
+ return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (i.top && c.add("border-top", s), i.right && c.add("border-right", s), i.bottom && c.add("border-bottom", s), i.left && c.add("border-left", s)) : e.kind === "ellipse" ? (i.inner && c.add("border", s).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.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(a), a;
166
+ }
167
+ function ut(e, t, n) {
168
+ const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), a = se(e.widthMm, t), o = se(e.heightMm, t);
169
+ r.setAttribute("width", String(Math.max(1, a))), r.setAttribute("height", String(Math.max(1, o))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
170
+ const l = n.createElementNS("http://www.w3.org/2000/svg", "line");
171
+ l.setAttribute("x1", "0"), l.setAttribute("x2", String(a)), l.setAttribute("y1", e.lineDirection === "up" ? String(o) : "0"), l.setAttribute("y2", e.lineDirection === "up" ? "0" : String(o));
172
+ const i = G({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
173
+ return l.setAttribute("stroke", i.color), l.setAttribute("stroke-width", String(i.widthPt * t / 72)), r.appendChild(l), r;
174
+ }
175
+ function Oe(e, t, n, r) {
176
+ const a = r.createElement("div");
177
+ a.className = `${T("comp", n)} mr-kind-${e.kind}`;
170
178
  const o = 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");
171
- if (tt(o, e, t), o.applyTo(i), ee(e))
172
- return i.appendChild(lt(e, n, r)), i;
179
+ if (st(o, e, t), o.applyTo(a), re(e))
180
+ return a.appendChild(ft(e, n, r)), a;
173
181
  if (e.kind === "text")
174
- return i.appendChild(st(e, t, n, r)), i;
182
+ return a.appendChild(gt(e, t, n, r)), a;
175
183
  if (e.grid) {
176
- const a = fe(e, t, n, r);
177
- return a.appendChild(it(e.grid, e, t, n, r)), i.appendChild(a), i;
184
+ const i = be(e, t, n, r);
185
+ return i.appendChild(mt(e.grid, e, t, n, r)), a.appendChild(i), a;
178
186
  }
179
187
  if (e.kind === "line" && e.lineDirection)
180
- return i.appendChild(ct(e, t, r)), i;
188
+ return a.appendChild(ut(e, t, r)), a;
181
189
  if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
182
- return i.appendChild(fe(e, t, n, r)), i;
183
- const s = r.createElement("div");
184
- return s.className = E("unknown", n), y("block").applyTo(s), s.textContent = e.fallbackText ?? `[${e.kind}]`, s.dataset.mrUnsupported = e.kind, s.setAttribute("role", "note"), i.appendChild(s), i;
185
- }
186
- function dt(e, t, n, r) {
187
- const i = r.createElement("div");
188
- return i.className = E("page", n), y("block", "initial").add("position", "relative").add("font-family", Z).add("font-size", `${H(_(void 0, t).fontSizePx, 2)}px`).add("line-height", String(Q(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", xe).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((o, s) => {
189
- const a = Le(o, t, n, r);
190
- a.dataset.mrComponentIndex = String(s), i.appendChild(a);
191
- }), i;
192
- }
193
- function wn(e, t, n = {}) {
190
+ return a.appendChild(be(e, t, n, r)), a;
191
+ const l = r.createElement("div");
192
+ return l.className = T("unknown", n), y("block").applyTo(l), l.textContent = e.fallbackText ?? `[${e.kind}]`, l.dataset.mrUnsupported = e.kind, l.setAttribute("role", "note"), a.appendChild(l), a;
193
+ }
194
+ function pt(e, t, n, r) {
195
+ const a = r.createElement("div");
196
+ return a.className = T("page", n), y("block", "initial").add("position", "relative").add("font-family", te).add("font-size", `${j(_(void 0, t).fontSizePx, 2)}px`).add("line-height", String(ne(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", Te).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(a), e.components.forEach((o, l) => {
197
+ const i = Oe(o, t, n, r);
198
+ i.dataset.mrComponentIndex = String(l), a.appendChild(i);
199
+ }), a;
200
+ }
201
+ function Rn(e, t, n = {}) {
194
202
  const r = n.dpi ?? 96;
195
- G(e, "dom", n);
196
- const i = t.createElement("div");
197
- return i.className = E("root", n), y("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((o) => {
198
- i.appendChild(dt(o, r, n, t));
199
- }), i;
203
+ q(e, "dom", n);
204
+ const a = t.createElement("div");
205
+ return a.className = T("root", n), y("block").applyTo(a), a.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((o) => {
206
+ a.appendChild(pt(o, r, n, t));
207
+ }), a;
200
208
  }
201
- function R(e) {
209
+ function $(e) {
202
210
  if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
203
211
  }
204
- const mt = (e, t) => (R(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
205
- const i = new Image(), o = () => {
206
- i.onload = null, i.onerror = null, t?.removeEventListener("abort", s);
207
- }, s = () => {
208
- o(), i.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
212
+ const wt = (e, t) => ($(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
213
+ const a = new Image(), o = () => {
214
+ a.onload = null, a.onerror = null, t?.removeEventListener("abort", l);
215
+ }, l = () => {
216
+ o(), a.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
209
217
  };
210
- i.onload = () => {
211
- o(), n(i);
212
- }, i.onerror = () => {
218
+ a.onload = () => {
219
+ o(), n(a);
220
+ }, a.onerror = () => {
213
221
  o(), r(new Error("Image could not be decoded for Canvas output."));
214
- }, t?.addEventListener("abort", s, { once: !0 }), i.src = e;
222
+ }, t?.addEventListener("abort", l, { once: !0 }), a.src = e;
215
223
  }) : Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));
216
- function ht(e, t, n) {
217
- return R(n), n ? new Promise((r, i) => {
218
- const o = () => i(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
219
- n.addEventListener("abort", o, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, i).finally(() => n.removeEventListener("abort", o));
224
+ function bt(e, t, n) {
225
+ return $(n), n ? new Promise((r, a) => {
226
+ const o = () => a(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
227
+ n.addEventListener("abort", o, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, a).finally(() => n.removeEventListener("abort", o));
220
228
  }) : e(t);
221
229
  }
222
- async function gt(e, t, n) {
230
+ async function Mt(e, t, n) {
223
231
  const r = /* @__PURE__ */ new Map();
224
- for (const i of e.components)
225
- !ee(i) || r.has(i.imageData) || r.set(i.imageData, await ht(t, i.imageData, n));
226
- return R(n), r;
227
- }
228
- function ut(e, t, n, r, i, o) {
229
- const s = t, a = s.naturalWidth ?? s.width ?? i, l = s.naturalHeight ?? s.height ?? o;
230
- if (a <= 0 || l <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
231
- const c = Math.min(i / a, o / l), d = a * c, m = l * c;
232
- e.drawImage(t, n + (i - d) / 2, r + (o - m) / 2, d, m);
233
- }
234
- function ft(e) {
235
- return Ze(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
236
- }
237
- const le = 96 / 25.4;
238
- function ce(e, t = 96) {
239
- const n = t / 96 * le;
232
+ for (const a of e.components)
233
+ !re(a) || r.has(a.imageData) || r.set(a.imageData, await bt(t, a.imageData, n));
234
+ return $(n), r;
235
+ }
236
+ function yt(e, t, n, r, a, o) {
237
+ const l = t, i = l.naturalWidth ?? l.width ?? a, s = l.naturalHeight ?? l.height ?? o;
238
+ if (i <= 0 || s <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
239
+ const c = Math.min(a / i, o / s), m = i * c, d = s * c;
240
+ e.drawImage(t, n + (a - m) / 2, r + (o - d) / 2, m, d);
241
+ }
242
+ function vt(e) {
243
+ return nt(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
244
+ }
245
+ const de = 96 / 25.4;
246
+ function he(e, t = 96) {
247
+ const n = t / 96 * de;
240
248
  return {
241
249
  widthPx: Math.max(1, Math.round(e.pageWidthMm * n)),
242
250
  heightPx: Math.max(1, Math.round(e.pageHeightMm * n))
243
251
  };
244
252
  }
245
- function De(e, t, n, r = 64e6) {
253
+ function He(e, t, n, r = 64e6) {
246
254
  if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");
247
255
  if (!Number.isFinite(r) || r <= 0) throw new RangeError("maxCanvasPixels must be positive and finite.");
248
- const i = ce(e, n), o = Math.round(i.widthPx * t), s = Math.round(i.heightPx * t);
249
- if (!Number.isSafeInteger(o) || !Number.isSafeInteger(s) || o * s > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
250
- return { width: o, height: s };
251
- }
252
- function Fe(e, t, n, r) {
253
- const i = document.createElement("canvas"), { widthPx: o, heightPx: s } = ce(e, n), a = De(e, t, n, r);
254
- i.width = a.width, i.height = a.height, i.style.width = `${o}px`, i.style.height = `${s}px`;
255
- const l = i.getContext("2d");
256
- if (!l)
256
+ const a = he(e, n), o = Math.round(a.widthPx * t), l = Math.round(a.heightPx * t);
257
+ if (!Number.isSafeInteger(o) || !Number.isSafeInteger(l) || o * l > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
258
+ return { width: o, height: l };
259
+ }
260
+ function ze(e, t, n, r) {
261
+ const a = document.createElement("canvas"), { widthPx: o, heightPx: l } = he(e, n), i = He(e, t, n, r);
262
+ a.width = i.width, a.height = i.height, a.style.width = `${o}px`, a.style.height = `${l}px`;
263
+ const s = a.getContext("2d");
264
+ if (!s)
257
265
  throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");
258
- return l.scale(t, t), l.fillStyle = "#ffffff", l.fillRect(0, 0, o, s), { canvas: i, ctx: l };
266
+ return s.scale(t, t), s.fillStyle = "#ffffff", s.fillRect(0, 0, o, l), { canvas: a, ctx: s };
259
267
  }
260
- function vn(e, t = 96) {
268
+ function Pn(e, t = 96) {
261
269
  return _(e, t).fontSizePx;
262
270
  }
263
- function Oe(e, t, n, r, i, o, s, a = "top") {
264
- e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${s}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
265
- const l = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
266
- `), d = c.length * l;
267
- let m = r;
268
- a === "middle" ? m = r + (o - d) / 2 : a === "bottom" && (m = r + o - d), c.forEach((h, g) => {
269
- pt(e, h, t, n, m + g * l + t.fontSizePx * 0.8, i);
271
+ function We(e, t, n, r, a, o, l, i = "top") {
272
+ 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";
273
+ const s = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
274
+ `), m = c.length * s;
275
+ let d = r;
276
+ i === "middle" ? d = r + (o - m) / 2 : i === "bottom" && (d = r + o - m), c.forEach((h, g) => {
277
+ xt(e, h, t, n, d + g * s + t.fontSizePx * 0.8, a);
270
278
  }), e.textAlign = "left";
271
279
  }
272
- function pt(e, t, n, r, i, o) {
273
- const s = Array.from(t), a = n.letterSpacingPx ?? 0;
274
- if (!a) {
280
+ function xt(e, t, n, r, a, o) {
281
+ const l = Array.from(t), i = n.letterSpacingPx ?? 0;
282
+ if (!i) {
275
283
  e.textAlign = n.align === "center" ? "center" : n.align === "right" ? "right" : "left";
276
- const m = n.align === "center" ? r + o / 2 : n.align === "right" ? r + o : r;
277
- e.fillText(t, m, i);
284
+ const d = n.align === "center" ? r + o / 2 : n.align === "right" ? r + o : r;
285
+ e.fillText(t, d, a);
278
286
  return;
279
287
  }
280
- const l = e.measureText(t).width + Math.max(0, s.length - 1) * a, c = n.align === "center" ? r + (o - l) / 2 : n.align === "right" ? r + o - l : r;
288
+ const s = e.measureText(t).width + Math.max(0, l.length - 1) * i, c = n.align === "center" ? r + (o - s) / 2 : n.align === "right" ? r + o - s : r;
281
289
  e.textAlign = "left";
282
- let d = "";
283
- s.forEach((m, h) => {
284
- e.fillText(m, c + e.measureText(d).width + h * a, i), d += m;
290
+ let m = "";
291
+ l.forEach((d, h) => {
292
+ e.fillText(d, c + e.measureText(m).width + h * i, a), m += d;
285
293
  });
286
294
  }
287
- function wt(e, t, n, r, i, o, s) {
288
- for (const a of Ae(t, n))
289
- e.strokeStyle = a.color, e.lineWidth = O(a.widthPt, s), e.beginPath(), a.kind === "v" ? (e.moveTo(r + a.pos * o, i + a.from * o), e.lineTo(r + a.pos * o, i + a.to * o)) : (e.moveTo(r + a.from * o, i + a.pos * o), e.lineTo(r + a.to * o, i + a.pos * o)), e.stroke();
295
+ function Et(e, t, n, r, a, o, l) {
296
+ for (const i of Le(t, n))
297
+ e.strokeStyle = i.color, e.lineWidth = W(i.widthPt, l), e.beginPath(), i.kind === "v" ? (e.moveTo(r + i.pos * o, a + i.from * o), e.lineTo(r + i.pos * o, a + i.to * o)) : (e.moveTo(r + i.from * o, a + i.pos * o), e.lineTo(r + i.to * o, a + i.pos * o)), e.stroke();
290
298
  }
291
- function vt(e, t, n, r, i, o) {
292
- 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 + o)), t.bottom && (e.moveTo(n + i, r + o), e.lineTo(n, r + o)), t.left && (e.moveTo(n, r + o), e.lineTo(n, r)), e.stroke();
299
+ function St(e, t, n, r, a, o) {
300
+ e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + a, r)), t.right && (e.moveTo(n + a, r), e.lineTo(n + a, r + o)), t.bottom && (e.moveTo(n + a, r + o), e.lineTo(n, r + o)), t.left && (e.moveTo(n, r + o), e.lineTo(n, r)), e.stroke();
293
301
  }
294
- function bt(e, t, n, r, i, o, s, a, l, c, d) {
295
- const m = Pe(t, o / a, s / a);
296
- for (const g of m.cells) {
302
+ function Tt(e, t, n, r, a, o, l, i, s, c, m) {
303
+ const d = Ne(t, o / i, l / i);
304
+ for (const g of d.cells) {
297
305
  const f = g.cell.style?.backgroundColor ?? n.style?.backgroundColor;
298
- f && (e.fillStyle = f, e.fillRect(r + g.xMm * a, i + g.yMm * a, g.widthMm * a, g.heightMm * a));
306
+ f && (e.fillStyle = f, e.fillRect(r + g.xMm * i, a + g.yMm * i, g.widthMm * i, g.heightMm * i));
299
307
  }
300
- wt(e, m, n, r, i, a, l);
308
+ Et(e, d, n, r, a, i, s);
301
309
  const h = t.paddingMm ?? 0.5;
302
- for (const g of m.cells) {
310
+ for (const g of d.cells) {
303
311
  const f = g.cell.text ?? "";
304
312
  if (!f) continue;
305
- const v = Te(n.style, g.cell.style), N = _(v, l), C = g.cell.indentMm ?? 0, T = Math.max(0, g.widthMm - 2 * h - C), A = Re(f, T, { fontSizePt: N.fontSizePt, bold: v.bold, italic: v.italic, fontFamily: v.fontFamily ?? c, letterSpacingPt: v.letterSpacing }, d).join(`
313
+ const w = Re(n.style, g.cell.style), C = _(w, s), x = g.cell.indentMm ?? 0, v = Math.max(0, g.widthMm - 2 * h - x), R = Ie(f, v, { fontSizePt: C.fontSizePt, bold: w.bold, italic: w.italic, fontFamily: w.fontFamily ?? c, letterSpacingPt: w.letterSpacing }, m).join(`
306
314
  `);
307
- Oe(
315
+ We(
308
316
  e,
309
317
  {
310
- text: A,
311
- fontSizePx: N.fontSizePx,
312
- bold: v.bold ?? !1,
313
- italic: v.italic,
314
- color: Se(v, xe),
315
- align: v.align ?? "left",
316
- lineHeight: Q(v),
317
- letterSpacingPx: O(v.letterSpacing ?? 0, l)
318
+ text: R,
319
+ fontSizePx: C.fontSizePx,
320
+ bold: w.bold ?? !1,
321
+ italic: w.italic,
322
+ color: Pe(w, Te),
323
+ align: w.align ?? "left",
324
+ lineHeight: ne(w),
325
+ letterSpacingPx: W(w.letterSpacing ?? 0, s)
318
326
  },
319
- r + (g.xMm + h + C) * a,
320
- i + (g.yMm + h) * a,
321
- T * a,
322
- Math.max(0, g.heightMm - 2 * h) * a,
323
- v.fontFamily ?? c,
324
- v.verticalAlign ?? "middle"
327
+ r + (g.xMm + h + x) * i,
328
+ a + (g.yMm + h) * i,
329
+ v * i,
330
+ Math.max(0, g.heightMm - 2 * h) * i,
331
+ w.fontFamily ?? c,
332
+ w.verticalAlign ?? "middle"
325
333
  );
326
334
  }
327
335
  }
328
- function yt(e, t, n, r, i, o, s, a, l) {
329
- const c = t.style ?? {}, d = _(c, s), m = Ce(t) ? t.richParagraphs.map((h) => h.segments.map((g) => g.text ?? g.field ?? "").join("")).join(`
336
+ function Ct(e, t, n, r, a, o, l, i, s) {
337
+ const c = t.style ?? {}, m = _(c, l), d = Ae(t) ? t.richParagraphs.map((h) => h.segments.map((g) => g.text ?? g.field ?? "").join("")).join(`
330
338
  `) : t.lines?.length ? t.lines.join(`
331
- `) : Re(t.text ?? "", t.widthMm, { fontSizePt: d.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? a, letterSpacingPt: c.letterSpacing }, l).join(`
339
+ `) : Ie(t.text ?? "", t.widthMm, { fontSizePt: m.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? i, letterSpacingPt: c.letterSpacing }, s).join(`
332
340
  `);
333
- Oe(e, {
334
- text: m,
335
- fontSizePx: d.fontSizePx,
341
+ We(e, {
342
+ text: d,
343
+ fontSizePx: m.fontSizePx,
336
344
  bold: c.bold ?? !1,
337
345
  italic: c.italic,
338
- color: Se(c),
346
+ color: Pe(c),
339
347
  align: c.align ?? "left",
340
- lineHeight: Q(c),
341
- letterSpacingPx: O(c.letterSpacing ?? 0, s)
342
- }, n, r, i, o, c.fontFamily ?? a, c.verticalAlign);
343
- }
344
- function de(e, t, n, r, i, o, s) {
345
- const a = t.leftMm * n, l = t.topMm * n, c = t.widthMm * n, d = t.heightMm * n, m = t.style ?? {};
346
- if (ee(t)) {
347
- const h = s?.get(t.imageData);
348
- h ? ut(e, h, a, l, c, d) : pe(e, t, a, l, c, d);
348
+ lineHeight: ne(c),
349
+ letterSpacingPx: W(c.letterSpacing ?? 0, l)
350
+ }, n, r, a, o, c.fontFamily ?? i, c.verticalAlign);
351
+ }
352
+ function ge(e, t, n, r, a, o, l) {
353
+ const i = t.leftMm * n, s = t.topMm * n, c = t.widthMm * n, m = t.heightMm * n, d = t.style ?? {};
354
+ if (re(t)) {
355
+ const h = l?.get(t.imageData);
356
+ h ? yt(e, h, i, s, c, m) : Me(e, t, i, s, c, m);
349
357
  return;
350
358
  }
351
359
  if (t.grid) {
352
- bt(e, t.grid, t, a, l, c, d, n, r, i, o);
360
+ Tt(e, t.grid, t, i, s, c, m, n, r, a, o);
353
361
  return;
354
362
  }
355
363
  switch (t.kind) {
356
364
  case "text": {
357
- yt(e, t, a, l, c, d, r, i, o);
365
+ Ct(e, t, i, s, c, m, r, a, o);
358
366
  break;
359
367
  }
360
368
  case "rect": {
361
- const h = j(m), g = Ee(m);
362
- m.backgroundColor && (e.fillStyle = m.backgroundColor, e.fillRect(a, l, c, d)), g.inner && (e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), vt(e, g, a, l, c, d));
369
+ const h = G(d), g = Ce(d);
370
+ d.backgroundColor && (e.fillStyle = d.backgroundColor, e.fillRect(i, s, c, m)), g.inner && (e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), St(e, g, i, s, c, m));
363
371
  break;
364
372
  }
365
373
  case "line": {
366
- const h = j({ ...m, borderColor: m.lineColor ?? m.borderColor });
367
- e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), e.beginPath();
368
- const g = t.lineDirection === "up" ? l + d : t.lineDirection === "down" ? l : l + d / 2, f = t.lineDirection === "up" ? l : t.lineDirection === "down" ? l + d : l + d / 2;
369
- e.moveTo(a, g), e.lineTo(a + c, f), e.stroke();
374
+ const h = G({ ...d, borderColor: d.lineColor ?? d.borderColor });
375
+ e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), e.beginPath();
376
+ const g = t.lineDirection === "up" ? s + m : t.lineDirection === "down" ? s : s + m / 2, f = t.lineDirection === "up" ? s : t.lineDirection === "down" ? s + m : s + m / 2;
377
+ e.moveTo(i, g), e.lineTo(i + c, f), e.stroke();
370
378
  break;
371
379
  }
372
380
  case "ellipse": {
373
- const h = j(m);
374
- e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), m.backgroundColor && (e.fillStyle = m.backgroundColor, e.beginPath(), e.ellipse(a + c / 2, l + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(a + c / 2, l + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.stroke();
381
+ const h = G(d);
382
+ e.strokeStyle = h.color, e.lineWidth = W(h.widthPt, r), d.backgroundColor && (e.fillStyle = d.backgroundColor, e.beginPath(), e.ellipse(i + c / 2, s + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(i + c / 2, s + m / 2, c / 2, m / 2, 0, 0, Math.PI * 2), e.stroke();
375
383
  break;
376
384
  }
377
385
  default:
378
- pe(e, t, a, l, c, d);
386
+ Me(e, t, i, s, c, m);
379
387
  break;
380
388
  }
381
389
  }
382
- function pe(e, t, n, r, i, o) {
383
- e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, i, o), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
390
+ function Me(e, t, n, r, a, o) {
391
+ e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, a, o), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
384
392
  }
385
- async function bn(e, t = {}) {
393
+ async function An(e, t = {}) {
386
394
  if (typeof document > "u")
387
395
  throw new Error("renderPlanToImages 需要浏览器环境(SSR/Node 请在客户端钩子中调用)");
388
- const { format: n = "png", quality: r = 0.92, ...i } = t;
396
+ const { format: n = "png", quality: r = 0.92, ...a } = t;
389
397
  if (n !== "png" && n !== "jpeg") throw new TypeError("Image format must be png or jpeg.");
390
398
  if (!Number.isFinite(r) || r < 0 || r > 1) throw new RangeError("Image quality must be between 0 and 1.");
391
- R(t.signal);
392
- const o = await ae(e, { ...t, format: "canvas" });
399
+ $(t.signal);
400
+ const o = await me(e, { ...t, format: "canvas" });
393
401
  e = o.plan;
394
- const s = [...o.diagnostics, ...G(e, "canvas", t)], a = n === "jpeg" ? "image/jpeg" : "image/png", l = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
395
- for (let d = Math.max(0, t.start ?? 0); d <= c; d++) {
396
- R(t.signal);
397
- const m = await ze(e.pages[d], d, i, s);
402
+ const l = [...o.diagnostics, ...q(e, "canvas", t)], i = n === "jpeg" ? "image/jpeg" : "image/png", s = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
403
+ for (let m = Math.max(0, t.start ?? 0); m <= c; m++) {
404
+ $(t.signal);
405
+ const d = await Be(e.pages[m], m, a, l);
398
406
  try {
399
- l.push(await Mt(m, a, r, t.signal));
407
+ s.push(await Rt(d, i, r, t.signal));
400
408
  } finally {
401
- m.width = 0, m.height = 0;
409
+ d.width = 0, d.height = 0;
402
410
  }
403
- await Xe(t, l.length, c - Math.max(0, t.start ?? 0) + 1);
411
+ await tt(t, s.length, c - Math.max(0, t.start ?? 0) + 1);
404
412
  }
405
- return R(t.signal), { blobs: l, diagnostics: s };
413
+ return $(t.signal), { blobs: s, diagnostics: l };
406
414
  }
407
- function Mt(e, t, n, r) {
408
- return R(r), new Promise((i, o) => {
409
- const s = () => o(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
410
- r?.addEventListener("abort", s, { once: !0 });
415
+ function Rt(e, t, n, r) {
416
+ return $(r), new Promise((a, o) => {
417
+ const l = () => o(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
418
+ r?.addEventListener("abort", l, { once: !0 });
411
419
  try {
412
- e.toBlob((a) => {
413
- r?.removeEventListener("abort", s), a ? i(a) : o(new Error("Canvas encoding failed; no empty image was emitted."));
420
+ e.toBlob((i) => {
421
+ r?.removeEventListener("abort", l), i ? a(i) : o(new Error("Canvas encoding failed; no empty image was emitted."));
414
422
  }, t, n);
415
- } catch (a) {
416
- r?.removeEventListener("abort", s), o(a);
423
+ } catch (i) {
424
+ r?.removeEventListener("abort", l), o(i);
417
425
  }
418
426
  });
419
427
  }
420
- function yn(e, t = {}) {
421
- if (R(t.signal), typeof document > "u")
428
+ function $n(e, t = {}) {
429
+ if ($(t.signal), typeof document > "u")
422
430
  throw new Error("renderPlanToCanvas 需要浏览器环境(SSR 请在客户端钩子中调用)");
423
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * le, o = t.fontFamily ?? Z, s = t.measurer ?? oe, a = Math.max(0, t.start ?? 0), l = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], d = G(e, "canvas", t), m = xt(e, a, l);
424
- for (const h of m)
425
- ke(h, t), d.push(h);
426
- if (t.fidelity === "strict" && m.length) throw new Ke(d);
427
- for (let h = a; h <= l; h++) {
428
- R(t.signal);
429
- const g = e.pages[h], { canvas: f, ctx: v } = Fe(g, n, r, t.maxCanvasPixels);
430
- for (const N of g.components)
431
- de(v, N, i, r, o, s);
431
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, a = r / 96 * de, o = t.fontFamily ?? te, l = t.measurer ?? le, i = Math.max(0, t.start ?? 0), s = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], m = q(e, "canvas", t), d = Pt(e, i, s);
432
+ for (const h of d)
433
+ De(h, t), m.push(h);
434
+ if (t.fidelity === "strict" && d.length) throw new et(m);
435
+ for (let h = i; h <= s; h++) {
436
+ $(t.signal);
437
+ const g = e.pages[h], { canvas: f, ctx: w } = ze(g, n, r, t.maxCanvasPixels);
438
+ for (const C of g.components)
439
+ ge(w, C, a, r, o, l);
432
440
  c.push(f);
433
441
  }
434
- return { canvases: c, diagnostics: d };
442
+ return { canvases: c, diagnostics: m };
435
443
  }
436
- function xt(e, t, n) {
437
- return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((o, s) => ee(o) ? [{
444
+ function Pt(e, t, n) {
445
+ return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, a) => r.components.flatMap((o, l) => re(o) ? [{
438
446
  code: "async-image-required",
439
447
  severity: "warning",
440
448
  format: "canvas",
441
- pageIndex: t + i,
442
- componentIndex: s,
449
+ pageIndex: t + a,
450
+ componentIndex: l,
443
451
  kind: o.kind,
444
452
  nid: o.nid,
445
453
  message: "Use renderPlanToCanvasAsync or renderPlanToImages to decode and include images."
446
454
  }] : []));
447
455
  }
448
- async function Mn(e, t = {}) {
456
+ async function kn(e, t = {}) {
449
457
  if (typeof document > "u") throw new Error("renderPlanToCanvasAsync 需要浏览器环境(Node 请使用 PDF 或 XLSX 输出)");
450
- R(t.signal);
451
- const n = await ae(e, { ...t, format: "canvas" });
458
+ $(t.signal);
459
+ const n = await me(e, { ...t, format: "canvas" });
452
460
  e = n.plan;
453
- const r = [...n.diagnostics, ...G(e, "canvas", t)], i = [], o = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
454
- for (let s = Math.max(0, t.start ?? 0); s <= o; s++)
455
- i.push(await ze(e.pages[s], s, t, r));
456
- return { canvases: i, diagnostics: r };
457
- }
458
- async function ze(e, t, n, r) {
459
- const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, s = n.fontFamily ?? Z, a = await He(e, t, n, r);
460
- R(n.signal);
461
- const { canvas: l, ctx: c } = Fe(e, i, o, n.maxCanvasPixels);
462
- for (const d of e.components) de(c, d, o / 25.4, o, s, n.measurer ?? oe, a);
463
- return l;
461
+ const r = [...n.diagnostics, ...q(e, "canvas", t)], a = [], o = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
462
+ for (let l = Math.max(0, t.start ?? 0); l <= o; l++)
463
+ a.push(await Be(e.pages[l], l, t, r));
464
+ return { canvases: a, diagnostics: r };
465
+ }
466
+ async function Be(e, t, n, r) {
467
+ const a = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, l = n.fontFamily ?? te, i = await je(e, t, n, r);
468
+ $(n.signal);
469
+ const { canvas: s, ctx: c } = ze(e, a, o, n.maxCanvasPixels);
470
+ for (const m of e.components) ge(c, m, o / 25.4, o, l, n.measurer ?? le, i);
471
+ return s;
464
472
  }
465
- async function He(e, t, n, r) {
466
- const i = n.imageLoader ?? mt;
467
- return gt(e, async (o, s) => {
473
+ async function je(e, t, n, r) {
474
+ const a = n.imageLoader ?? wt;
475
+ return Mt(e, async (o, l) => {
468
476
  try {
469
- return await i(o, s);
470
- } catch (a) {
471
- if (s?.aborted) throw a;
472
- const l = e.components.findIndex((m) => m.imageData === o), c = e.components[l], d = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: l, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
473
- throw r.push(d), ke(d, n), a;
477
+ return await a(o, l);
478
+ } catch (i) {
479
+ if (l?.aborted) throw i;
480
+ const s = e.components.findIndex((d) => d.imageData === o), c = e.components[s], m = { 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." };
481
+ throw r.push(m), De(m, n), i;
474
482
  }
475
483
  }, n.signal);
476
484
  }
477
- function xn(e, t = {}) {
478
- const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * le, o = t.fontFamily ?? Z, s = t.measurer ?? oe, a = t.overscan ?? 1, l = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, d = e.pages.map((u) => u.pageHeightMm * i), m = Math.max(1, ...e.pages.map((u) => u.pageWidthMm * i)), h = { start: 0, end: -1 };
479
- let g = null, f = null, v = null, N = null, C = [], T = 0, A = [], U = 0, B = new AbortController();
480
- const he = [];
481
- function je() {
485
+ function In(e, t = {}) {
486
+ const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, a = r / 96 * de, o = t.fontFamily ?? te, l = t.measurer ?? le, i = t.overscan ?? 1, s = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, m = e.pages.map((u) => u.pageHeightMm * a), d = Math.max(1, ...e.pages.map((u) => u.pageWidthMm * a)), h = { start: 0, end: -1 };
487
+ let g = null, f = null, w = null, C = null, x = [], v = 0, R = [], H = 0, N = new AbortController();
488
+ const ue = [];
489
+ function Ve() {
482
490
  const u = g;
483
- u.innerHTML = "", f = document.createElement("div"), f.style.cssText = `width:${m}px;margin:0 auto;`, v = document.createElement("div"), N = document.createElement("div"), f.appendChild(v), C = [];
484
- const M = Math.min(e.pages.length, 3 + a * 2);
485
- for (let D = 0; D < M; D++) {
486
- const b = document.createElement("div");
487
- b.style.cssText = `margin:0 auto ${l}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, f.appendChild(b), C.push(b);
491
+ u.innerHTML = "", f = document.createElement("div"), f.style.cssText = `width:${d}px;margin:0 auto;`, w = document.createElement("div"), C = document.createElement("div"), f.appendChild(w), x = [];
492
+ const E = Math.min(e.pages.length, 3 + i * 2);
493
+ for (let F = 0; F < E; F++) {
494
+ const M = document.createElement("div");
495
+ M.style.cssText = `margin:0 auto ${s}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, f.appendChild(M), x.push(M);
488
496
  }
489
- f.appendChild(N), u.appendChild(f);
497
+ f.appendChild(C), u.appendChild(f);
490
498
  }
491
- async function We(u, M) {
492
- const D = U, b = await ae(e, { ...t, signal: B.signal, format: "canvas", start: M, end: M });
493
- he.push(...b.diagnostics);
494
- const S = b.plan.pages[M], Y = await He(S, M, { ...t, signal: B.signal }, he);
495
- if (D !== U || !g) return;
496
- const { widthPx: ne, heightPx: re } = ce(S, r);
497
- let $ = u.firstElementChild;
498
- (!$ || $.tagName !== "CANVAS") && ($ = document.createElement("canvas"), u.innerHTML = "", u.appendChild($));
499
- const ue = De(S, n, r, t.maxCanvasPixels);
500
- $.width = ue.width, $.height = ue.height, $.style.width = `${ne}px`, $.style.height = `${re}px`;
501
- const F = $.getContext("2d");
502
- if (F) {
503
- F.setTransform(1, 0, 0, 1, 0, 0), F.scale(n, n), F.fillStyle = "#ffffff", F.fillRect(0, 0, ne, re);
504
- for (const Ue of S.components)
505
- de(F, Ue, i, r, o, s, Y);
506
- $.dataset.canvasPage = String(M), u.style.height = `${re}px`, u.style.width = `${ne}px`;
499
+ async function qe(u, E) {
500
+ const F = H, M = await me(e, { ...t, signal: N.signal, format: "canvas", start: E, end: E });
501
+ ue.push(...M.diagnostics);
502
+ const P = M.plan.pages[E], J = await je(P, E, { ...t, signal: N.signal }, ue);
503
+ if (F !== H || !g) return;
504
+ const { widthPx: ie, heightPx: oe } = he(P, r);
505
+ let L = u.firstElementChild;
506
+ (!L || L.tagName !== "CANVAS") && (L = document.createElement("canvas"), u.innerHTML = "", u.appendChild(L));
507
+ const we = He(P, n, r, t.maxCanvasPixels);
508
+ L.width = we.width, L.height = we.height, L.style.width = `${ie}px`, L.style.height = `${oe}px`;
509
+ const z = L.getContext("2d");
510
+ if (z) {
511
+ z.setTransform(1, 0, 0, 1, 0, 0), z.scale(n, n), z.fillStyle = "#ffffff", z.fillRect(0, 0, ie, oe);
512
+ for (const Ke of P.components)
513
+ ge(z, Ke, a, r, o, l, J);
514
+ L.dataset.canvasPage = String(E), u.style.height = `${oe}px`, u.style.width = `${ie}px`;
507
515
  }
508
516
  }
509
- function Ge(u) {
510
- U++, h.start = u.start, h.end = u.end, v.style.height = `${u.start * l + d.slice(0, u.start).reduce((b, S) => b + S, 0)}px`;
511
- const M = e.pages.length - 1 - u.end;
512
- N.style.height = `${M * l + d.slice(u.end + 1).reduce((b, S) => b + S, 0)}px`;
513
- const D = u.end - u.start + 1;
514
- C.forEach((b, S) => {
515
- if (S < D) {
516
- b.style.display = "";
517
- const Y = u.start + S;
518
- b.style.height = `${d[Y] ?? 0}px`;
517
+ function Ye(u) {
518
+ H++, h.start = u.start, h.end = u.end, w.style.height = `${u.start * s + m.slice(0, u.start).reduce((M, P) => M + P, 0)}px`;
519
+ const E = e.pages.length - 1 - u.end;
520
+ C.style.height = `${E * s + m.slice(u.end + 1).reduce((M, P) => M + P, 0)}px`;
521
+ const F = u.end - u.start + 1;
522
+ x.forEach((M, P) => {
523
+ if (P < F) {
524
+ M.style.display = "";
525
+ const J = u.start + P;
526
+ M.style.height = `${m[J] ?? 0}px`;
519
527
  } else
520
- b.style.display = "none";
521
- }), A = [];
522
- for (let b = u.start; b <= u.end; b++) {
523
- const S = C[b - u.start];
524
- if (!S) continue;
525
- S.firstElementChild?.dataset?.canvasPage !== String(b) && A.push(b);
528
+ M.style.display = "none";
529
+ }), R = [];
530
+ for (let M = u.start; M <= u.end; M++) {
531
+ const P = x[M - u.start];
532
+ if (!P) continue;
533
+ P.firstElementChild?.dataset?.canvasPage !== String(M) && R.push(M);
526
534
  }
527
- te();
535
+ ae();
528
536
  }
529
- function te() {
530
- T || A.length === 0 || (T = requestAnimationFrame(() => {
531
- T = 0;
537
+ function ae() {
538
+ v || R.length === 0 || (v = requestAnimationFrame(() => {
539
+ v = 0;
532
540
  let u = Math.max(1, c);
533
- for (; A.length > 0 && u-- > 0; ) {
534
- const M = A.shift(), D = C[M - h.start];
535
- D && We(D, M).catch(() => {
541
+ for (; R.length > 0 && u-- > 0; ) {
542
+ const E = R.shift(), F = x[E - h.start];
543
+ F && qe(F, E).catch(() => {
536
544
  });
537
545
  }
538
- A.length > 0 && te();
546
+ R.length > 0 && ae();
539
547
  }));
540
548
  }
541
- function V() {
542
- T || (T = requestAnimationFrame(() => {
543
- T = 0;
544
- const u = g, M = ft({
545
- pageHeightsPx: d,
549
+ function Y() {
550
+ v || (v = requestAnimationFrame(() => {
551
+ v = 0;
552
+ const u = g, E = vt({
553
+ pageHeightsPx: m,
546
554
  viewportHeightPx: u.clientHeight,
547
555
  scrollTopPx: u.scrollTop,
548
- overscan: a,
549
- gapPx: l
556
+ overscan: i,
557
+ gapPx: s
550
558
  });
551
- M.start !== h.start || M.end !== h.end ? Ge(M) : te();
559
+ E.start !== h.start || E.end !== h.end ? Ye(E) : ae();
552
560
  }));
553
561
  }
554
- let q = null;
562
+ let K = null;
555
563
  return {
556
564
  attach(u) {
557
565
  if (typeof document > "u")
558
566
  throw new Error("createCanvasPager 需要浏览器环境(SSR 请在客户端钩子中调用 attach)");
559
- R(t.signal), B = new AbortController(), t.signal?.addEventListener("abort", ge, { once: !0 }), G(e, "canvas", t), g = u, je(), u.addEventListener("scroll", V, { passive: !0 }), typeof ResizeObserver < "u" && (q = new ResizeObserver(() => V()), q.observe(u)), V();
567
+ $(t.signal), N = new AbortController(), t.signal?.addEventListener("abort", pe, { once: !0 }), q(e, "canvas", t), g = u, Ve(), u.addEventListener("scroll", Y, { passive: !0 }), typeof ResizeObserver < "u" && (K = new ResizeObserver(() => Y()), K.observe(u)), Y();
560
568
  },
561
569
  destroy() {
562
- U++, B.abort(), t.signal?.removeEventListener("abort", ge), T && cancelAnimationFrame(T), T = 0, q?.disconnect(), q = null, g?.removeEventListener("scroll", V), A = [], f?.remove(), g = null;
570
+ H++, N.abort(), t.signal?.removeEventListener("abort", pe), v && cancelAnimationFrame(v), v = 0, K?.disconnect(), K = null, g?.removeEventListener("scroll", Y), R = [], f?.remove(), g = null;
563
571
  },
564
572
  window() {
565
573
  return { ...h };
566
574
  }
567
575
  };
568
- function ge() {
569
- B.abort(t.signal?.reason);
576
+ function pe() {
577
+ N.abort(t.signal?.reason);
570
578
  }
571
579
  }
572
580
  function _e(e, t, n) {
573
- let r, i;
581
+ let r, a;
574
582
  if (typeof e == "string") {
575
- const o = J[e];
576
- if (!o) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(J).join("/")})`);
577
- r = o.widthMm, i = o.heightMm;
578
- } else typeof e == "number" ? (r = e, i = t ?? 297) : (r = e.widthMm, i = e.heightMm);
579
- return n ? { widthMm: i, heightMm: r } : { widthMm: r, heightMm: i };
583
+ const o = Z[e];
584
+ if (!o) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(Z).join("/")})`);
585
+ r = o.widthMm, a = o.heightMm;
586
+ } else typeof e == "number" ? (r = e, a = t ?? 297) : (r = e.widthMm, a = e.heightMm);
587
+ return n ? { widthMm: a, heightMm: r } : { widthMm: r, heightMm: a };
580
588
  }
581
- class Et {
589
+ class At {
582
590
  constructor() {
583
591
  this.pages = [], this.pending = null, this.templateParams = void 0;
584
592
  }
@@ -611,18 +619,18 @@ class Et {
611
619
  */
612
620
  page(t = "a4", n = {}, r) {
613
621
  this.collect();
614
- const o = 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: s, heightMm: a } = _e(
622
+ const o = 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: i } = _e(
615
623
  t,
616
624
  typeof n == "number" ? n : void 0,
617
625
  o.landscape
618
- ), l = o.margins ?? {};
619
- return this.pending = new Tt(this, {
620
- widthMm: s,
621
- heightMm: a,
622
- marginTopMm: l.marginTopMm ?? 10,
623
- marginBottomMm: l.marginBottomMm ?? 10,
624
- marginLeftMm: l.marginLeftMm ?? 10,
625
- marginRightMm: l.marginRightMm ?? 10
626
+ ), s = o.margins ?? {};
627
+ return this.pending = new $t(this, {
628
+ widthMm: l,
629
+ heightMm: i,
630
+ marginTopMm: s.marginTopMm ?? 10,
631
+ marginBottomMm: s.marginBottomMm ?? 10,
632
+ marginLeftMm: s.marginLeftMm ?? 10,
633
+ marginRightMm: s.marginRightMm ?? 10
626
634
  }), this.pending;
627
635
  }
628
636
  collect() {
@@ -638,7 +646,7 @@ class Et {
638
646
  };
639
647
  }
640
648
  }
641
- class Tt {
649
+ class $t {
642
650
  constructor(t, n) {
643
651
  this.parent = t, this.page = n, this.components = [];
644
652
  }
@@ -653,7 +661,7 @@ class Tt {
653
661
  style: r
654
662
  }), this;
655
663
  }
656
- list(t, n, r, i = {}) {
664
+ list(t, n, r, a = {}) {
657
665
  return this.components.push({
658
666
  kind: "list",
659
667
  leftMm: n.leftMm ?? 10,
@@ -661,20 +669,20 @@ class Tt {
661
669
  widthMm: n.widthMm ?? 180,
662
670
  dataset: t,
663
671
  columns: r,
664
- ...i
672
+ ...a
665
673
  }), this;
666
674
  }
667
675
  rect(t, n = {}) {
668
676
  return this.components.push({ kind: "rect", ...t, style: n }), this;
669
677
  }
670
- line(t, n, r, i = {}) {
678
+ line(t, n, r, a = {}) {
671
679
  return this.components.push({
672
680
  kind: "line",
673
681
  leftMm: t,
674
682
  topMm: n,
675
683
  widthMm: r,
676
684
  heightMm: 0.5,
677
- style: i
685
+ style: a
678
686
  }), this;
679
687
  }
680
688
  barcode(t, n) {
@@ -687,11 +695,11 @@ class Tt {
687
695
  fallbackText: t
688
696
  }), this;
689
697
  }
690
- qrcode(t, n, r, i) {
698
+ qrcode(t, n, r, a) {
691
699
  return this.components.push({
692
700
  kind: "qrcode",
693
701
  leftMm: r,
694
- topMm: i,
702
+ topMm: a,
695
703
  widthMm: n,
696
704
  heightMm: n,
697
705
  fallbackText: t
@@ -707,26 +715,26 @@ class Tt {
707
715
  return this.done().build();
708
716
  }
709
717
  }
710
- function En() {
711
- return new Et();
718
+ function Nn() {
719
+ return new At();
712
720
  }
713
- function Tn(e, t = {}) {
714
- return Ve([], e), e.fields.map((n) => ({
721
+ function Ln(e, t = {}) {
722
+ return Xe([], e), e.fields.map((n) => ({
715
723
  field: n.field,
716
724
  header: `${n.label ?? n.field}${n.unit ? ` (${n.unit})` : ""}`,
717
725
  semanticRole: n.semanticRole ?? (n.type === "number" || n.type === "decimal" ? "measure" : n.type === "date" ? "date" : n.enum ? "dimension" : "text"),
718
726
  ...t[n.field]
719
727
  }));
720
728
  }
721
- function P(e, t, n = !1) {
729
+ function k(e, t, n = !1) {
722
730
  if (!Number.isFinite(e) || (n ? e < 0 : e <= 0))
723
731
  throw new Error(`${t} 必须是有限${n ? "非负" : "正"}数`);
724
732
  }
725
- function K(e, t, n) {
733
+ function Q(e, t, n) {
726
734
  if (e !== void 0 && !["left", "center", "right", "justify", ...n ? ["auto"] : []].includes(e))
727
735
  throw new Error(`${t} 必须是 left/center/right/justify${n ? "/auto" : ""}`);
728
736
  }
729
- function St(e) {
737
+ function kt(e) {
730
738
  const t = e.layout ?? "page";
731
739
  if (t !== "page" && t !== "wide")
732
740
  throw new Error("layout 必须是 page 或 wide");
@@ -735,18 +743,18 @@ function St(e) {
735
743
  if (t !== "wide" && e.columnWidthMm !== void 0)
736
744
  throw new Error('columnWidthMm 仅适用于 layout: "wide"');
737
745
  const n = e.columnWidthMm ?? 30;
738
- return P(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
746
+ return k(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
739
747
  }
740
- function Ct(e) {
748
+ function It(e) {
741
749
  const t = e.paper === void 0 ? "a4" : e.paper;
742
750
  if (typeof t != "string" && (typeof t != "object" || t === null) || e.landscape !== void 0 && typeof e.landscape != "boolean")
743
751
  throw new Error("paper 必须是纸张预设名或 { widthMm, heightMm } 对象,landscape 必须是布尔值");
744
- if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(J, t))
745
- throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(J).join("/")})`);
746
- const n = _e(t, void 0, e.landscape), r = n.widthMm, i = n.heightMm;
747
- return P(r, "纸张 widthMm"), P(i, "纸张 heightMm"), { widthMm: r, heightMm: i };
752
+ if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(Z, t))
753
+ throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(Z).join("/")})`);
754
+ const n = _e(t, void 0, e.landscape), r = n.widthMm, a = n.heightMm;
755
+ return k(r, "纸张 widthMm"), k(a, "纸张 heightMm"), { widthMm: r, heightMm: a };
748
756
  }
749
- function Rt(e) {
757
+ function Nt(e) {
750
758
  if (e.margins !== void 0 && (!e.margins || typeof e.margins != "object" || Array.isArray(e.margins)))
751
759
  throw new Error("margins 必须是页边距对象");
752
760
  const t = e.margins ?? {}, n = {
@@ -755,722 +763,760 @@ function Rt(e) {
755
763
  marginLeftMm: t.marginLeftMm === void 0 ? 10 : t.marginLeftMm,
756
764
  marginRightMm: t.marginRightMm === void 0 ? 10 : t.marginRightMm
757
765
  };
758
- for (const [r, i] of Object.entries(n)) P(i, r, !0);
766
+ for (const [r, a] of Object.entries(n)) k(a, r, !0);
759
767
  return n;
760
768
  }
761
- function Pt(e, t) {
769
+ function Lt(e, t) {
762
770
  const n = e.dataset === void 0 ? "detail" : e.dataset;
763
771
  if (typeof n != "string" || !n.trim())
764
772
  throw new Error("dataset 必须是非空字符串");
765
773
  if (e.title !== void 0 && typeof e.title != "string")
766
774
  throw new Error("title 必须是字符串");
767
- const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, i = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
768
- P(r, "titleHeightMm"), P(i, "titleGapMm", !0);
769
- const o = e.title !== void 0 && e.title.length > 0, s = o ? r + i : 0;
770
- if (s >= t)
775
+ const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, a = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
776
+ k(r, "titleHeightMm"), k(a, "titleGapMm", !0);
777
+ const o = e.title !== void 0 && e.title.length > 0, l = o ? r + a : 0;
778
+ if (l >= t)
771
779
  throw new Error("标题高度与间距占满页面,必须为表格保留可用高度");
772
- return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm: s };
780
+ return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm: l };
773
781
  }
774
- function At(e) {
782
+ function Dt(e) {
775
783
  if (e.listOptions !== void 0 && (!e.listOptions || typeof e.listOptions != "object" || Array.isArray(e.listOptions)))
776
784
  throw new Error("listOptions 必须是列表配置对象");
777
785
  const t = e.listOptions ?? {};
778
- K(t.align, "listOptions.align", !0), K(t.headerAlign, "listOptions.headerAlign", !1);
786
+ Q(t.align, "listOptions.align", !0), Q(t.headerAlign, "listOptions.headerAlign", !1);
779
787
  for (const n of ["fontSizePt", "rowHeightMm", "paddingMm"]) {
780
788
  const r = t[n];
781
- r !== void 0 && P(r, `listOptions.${n}`, n === "paddingMm");
789
+ r !== void 0 && k(r, `listOptions.${n}`, n === "paddingMm");
782
790
  }
783
791
  return t;
784
792
  }
785
- function kt(e) {
793
+ function Ft(e) {
786
794
  let t = 0, n = 0;
787
- for (const [r, i] of e.entries()) {
788
- if (!i || typeof i.header != "string" || typeof i.field != "string" || !i.field.trim())
795
+ for (const [r, a] of e.entries()) {
796
+ if (!a || typeof a.header != "string" || typeof a.field != "string" || !a.field.trim())
789
797
  throw new Error(`columns[${r}] 需要字符串 header 与非空 field`);
790
- K(i.align, `columns[${r}].align`, !0), K(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 && P(i.flex, `columns[${r}].flex`), i.widthMm !== void 0 ? (P(i.widthMm, `columns[${r}].widthMm`), t += i.widthMm) : n = Math.max(n, i.flex ?? 1);
798
+ Q(a.align, `columns[${r}].align`, !0), Q(a.headerAlign, `columns[${r}].headerAlign`, !1), a.flex !== void 0 && k(a.flex, `columns[${r}].flex`), a.widthMm !== void 0 ? (k(a.widthMm, `columns[${r}].widthMm`), t += a.widthMm) : n = Math.max(n, a.flex ?? 1);
791
799
  }
792
800
  return { fixedWidthMm: t, maxFlex: n };
793
801
  }
794
- function It(e, t, n, r) {
795
- const { fixedWidthMm: i, maxFlex: o } = kt(e.columns);
796
- if (t === "page" && i > r)
797
- throw new Error(`固定列宽 ${i}mm 超出页面可用宽度 ${r}mm`);
798
- const s = r - i;
799
- if (t === "page" && o > 0 && s <= 0)
802
+ function Ot(e, t, n, r) {
803
+ const { fixedWidthMm: a, maxFlex: o } = Ft(e.columns);
804
+ if (t === "page" && a > r)
805
+ throw new Error(`固定列宽 ${a}mm 超出页面可用宽度 ${r}mm`);
806
+ const l = r - a;
807
+ if (t === "page" && o > 0 && l <= 0)
800
808
  throw new Error("固定列占满页面可用宽度,自动列需要正的剩余宽度");
801
- const a = o > 0 ? e.columns.reduce((c, d) => c + (d.widthMm === void 0 ? (d.flex ?? 1) / o : 0), 0) : 0;
802
- return { columns: e.columns.map(({ widthMm: c, flex: d, ...m }, h) => {
803
- const g = c ?? (t === "wide" ? n * (d ?? 1) : s * ((d ?? 1) / o) / a);
804
- return P(g, `columns[${h}] 分配后的 widthMm`), { ...m, widthMm: g };
805
- }), fixedWidthMm: i, maxFlex: o };
809
+ const i = o > 0 ? e.columns.reduce((c, m) => c + (m.widthMm === void 0 ? (m.flex ?? 1) / o : 0), 0) : 0;
810
+ return { columns: e.columns.map(({ widthMm: c, flex: m, ...d }, h) => {
811
+ const g = c ?? (t === "wide" ? n * (m ?? 1) : l * ((m ?? 1) / o) / i);
812
+ return k(g, `columns[${h}] 分配后的 widthMm`), { ...d, widthMm: g };
813
+ }), fixedWidthMm: a, maxFlex: o };
806
814
  }
807
- function Sn(e) {
815
+ function Dn(e) {
808
816
  if (!e || typeof e != "object")
809
817
  throw new Error("标准明细模板需要 options 对象");
810
818
  if (!Array.isArray(e.columns) || e.columns.length === 0)
811
819
  throw new Error("columns 至少需要一列");
812
- const { layout: t, columnWidthMm: n } = St(e), r = Ct(e);
813
- let i = r.widthMm;
814
- const o = r.heightMm, s = Rt(e);
815
- let a = i - s.marginLeftMm - s.marginRightMm;
816
- const l = o - s.marginTopMm - s.marginBottomMm;
817
- if (t === "page" && a <= 0 || l <= 0)
820
+ const { layout: t, columnWidthMm: n } = kt(e), r = It(e);
821
+ let a = r.widthMm;
822
+ const o = r.heightMm, l = Nt(e);
823
+ let i = a - l.marginLeftMm - l.marginRightMm;
824
+ const s = o - l.marginTopMm - l.marginBottomMm;
825
+ if (t === "page" && i <= 0 || s <= 0)
818
826
  throw new Error("页边距占满纸张,必须保留正的可用宽度和高度");
819
- const { dataset: c, titleHeightMm: d, hasTitle: m, titleSpaceMm: h } = Pt(e, l), g = At(e), { columns: f, fixedWidthMm: v, maxFlex: N } = It(e, t, n, a);
820
- t === "wide" && (a = f.reduce((T, A) => T + A.widthMm, 0), P(a, "宽表总列宽"), i = a + s.marginLeftMm + s.marginRightMm, P(i, "宽表总宽度"));
821
- const C = { widthMm: i, heightMm: o, ...s, components: [], ...t === "wide" ? { layout: t } : {} };
822
- return m && C.components.push({
827
+ const { dataset: c, titleHeightMm: m, hasTitle: d, titleSpaceMm: h } = Lt(e, s), g = Dt(e), { columns: f, fixedWidthMm: w, maxFlex: C } = Ot(e, t, n, i);
828
+ t === "wide" && (i = f.reduce((v, R) => v + R.widthMm, 0), k(i, "宽表总列宽"), a = i + l.marginLeftMm + l.marginRightMm, k(a, "宽表总宽度"));
829
+ const x = { widthMm: a, heightMm: o, ...l, components: [], ...t === "wide" ? { layout: t } : {} };
830
+ return d && x.components.push({
823
831
  kind: "text",
824
832
  text: e.title,
825
- leftMm: s.marginLeftMm,
826
- topMm: s.marginTopMm,
827
- widthMm: a,
828
- heightMm: d,
833
+ leftMm: l.marginLeftMm,
834
+ topMm: l.marginTopMm,
835
+ widthMm: i,
836
+ heightMm: m,
829
837
  style: { fontSize: 16, bold: !0, align: "center", verticalAlign: "middle", ...e.titleStyle }
830
- }), C.components.push({
838
+ }), x.components.push({
831
839
  align: "auto",
832
840
  headerAlign: "center",
833
841
  ...g,
834
842
  kind: "list",
835
843
  ...t === "wide" ? { layout: t } : {},
836
- ...m ? { title: e.title } : {},
844
+ ...d ? { title: e.title } : {},
837
845
  dataset: c,
838
846
  columns: f,
839
- leftMm: s.marginLeftMm,
840
- topMm: s.marginTopMm + h,
841
- widthMm: t === "wide" || N > 0 ? a : v
842
- }), e.params === void 0 ? { pages: [C] } : { params: e.params, pages: [C] };
847
+ leftMm: l.marginLeftMm,
848
+ topMm: l.marginTopMm + h,
849
+ widthMm: t === "wide" || C > 0 ? i : w
850
+ }), e.params === void 0 ? { pages: [x] } : { params: e.params, pages: [x] };
843
851
  }
844
- function Cn(e) {
852
+ function Fn(e) {
845
853
  if (e.components !== void 0 && e.pages !== void 0) throw new TypeError("标签 components 与 pages 只能选择一种");
846
- const { dataset: t, rowKey: n, copies: r, params: i } = e, o = e.pages ?? [{ components: e.components ?? [] }], s = {
854
+ const { dataset: t, rowKey: n, copies: r, params: a } = e, o = e.pages ?? [{ components: e.components ?? [] }], l = {
847
855
  repeat: { dataset: t, ...n === void 0 ? {} : { rowKey: n }, ...r === void 0 ? {} : { copies: r } },
848
- ...i === void 0 ? {} : { params: i },
849
- pages: o.map((l) => ({
850
- widthMm: l.widthMm ?? e.widthMm ?? 80,
851
- heightMm: l.heightMm ?? e.heightMm ?? 55,
856
+ ...a === void 0 ? {} : { params: a },
857
+ pages: o.map((s) => ({
858
+ widthMm: s.widthMm ?? e.widthMm ?? 80,
859
+ heightMm: s.heightMm ?? e.heightMm ?? 55,
852
860
  marginTopMm: 0,
853
861
  marginRightMm: 0,
854
862
  marginBottomMm: 0,
855
863
  marginLeftMm: 0,
856
- components: l.components,
857
- ...l.meta === void 0 ? {} : { meta: l.meta }
864
+ components: s.components,
865
+ ...s.meta === void 0 ? {} : { meta: s.meta }
858
866
  }))
859
- }, a = Ie(s);
860
- if (!a.ok) throw new Ne(a.errors);
861
- return JSON.parse(JSON.stringify(s));
867
+ }, i = $e(l);
868
+ if (!i.ok) throw new ke(i.errors);
869
+ return JSON.parse(JSON.stringify(l));
862
870
  }
863
- function Nt(e) {
871
+ function Ht(e) {
864
872
  if (!e || typeof e != "object" || !e.repeat)
865
- throw new se("config", "defineLabelReport 需要带 repeat 的固定标签模板");
866
- const t = Ie(e);
867
- if (!t.ok) throw new Ne(t.errors);
873
+ throw new ce("config", "defineLabelReport 需要带 repeat 的固定标签模板");
874
+ const t = $e(e);
875
+ if (!t.ok) throw new ke(t.errors);
868
876
  return e.repeat.dataset;
869
877
  }
870
- function we(e, t) {
871
- if (!Array.isArray(e)) throw new se("validate", "标签数据应为对象数组;请从业务响应中提取行数组");
878
+ function ye(e, t) {
879
+ if (!Array.isArray(e)) throw new ce("validate", "标签数据应为对象数组;请从业务响应中提取行数组");
872
880
  return { [t]: e };
873
881
  }
874
- function Rn(e) {
875
- const { template: t, rows: n, load: r, dataSchema: i, params: o, pagination: s, dataValidation: a } = e, l = Nt(t);
882
+ function On(e) {
883
+ const { template: t, rows: n, load: r, dataSchema: a, params: o, pagination: l, dataValidation: i } = e, s = Ht(t);
876
884
  if (n !== void 0 == (r !== void 0) || r !== void 0 && typeof r != "function")
877
- throw new se("config", "标签报表应且只能配置 rows 或 load 其中一种数据来源");
878
- const c = { template: t, params: o, pagination: s, dataValidation: a, ...i === void 0 ? {} : { dataSchema: { [l]: i } } };
879
- return r ? qe({ ...c, load: r, mapData: (d) => we(d, l) }) : { ...c, datasets: we(n, l) };
885
+ throw new ce("config", "标签报表应且只能配置 rows 或 load 其中一种数据来源");
886
+ const c = { template: t, params: o, pagination: l, dataValidation: i, ...a === void 0 ? {} : { dataSchema: { [s]: a } } };
887
+ return r ? Ze({ ...c, load: r, mapData: (m) => ye(m, s) }) : { ...c, datasets: ye(n, s) };
880
888
  }
881
- function Pn(e) {
889
+ function Hn(e) {
882
890
  return e;
883
891
  }
884
- class L extends Error {
892
+ class D extends Error {
885
893
  constructor(t, n) {
886
894
  super(n), this.code = t, this.name = "ReportTemplateStoreError";
887
895
  }
888
896
  }
889
- function k(e) {
897
+ function I(e) {
890
898
  return JSON.parse(JSON.stringify(e));
891
899
  }
892
- function x(e) {
900
+ function S(e) {
893
901
  if (!e?.aborted) return;
894
902
  const t = new Error("模板操作已取消");
895
903
  throw t.name = "AbortError", t;
896
904
  }
897
905
  function ve(e) {
898
906
  const t = e ? Number(e.revision) : 0;
899
- if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new L("history", "修订号无效或已达上限");
907
+ if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new D("history", "修订号无效或已达上限");
900
908
  return String(t + 1);
901
909
  }
902
- function An(e, t = {}) {
903
- const n = async (s, a) => {
904
- x(a);
905
- const l = await e.read(s, a);
906
- return x(a), l ? k(l) : void 0;
907
- }, r = async (s, a) => {
908
- const l = await n(s, a.signal);
909
- if ((l?.revision ?? null) !== a.expectedRevision) throw new L("conflict", "模板已变化,请重新读取后提交");
910
- return l;
911
- }, i = async (s, a, l) => {
912
- if (x(a.signal), !await e.compareAndSwap(s.id, a.expectedRevision, k(s), { signal: a.signal, ...l ? { publication: k(l) } : {} })) throw new L("conflict", "模板已被其他请求更新");
913
- return k(s);
914
- }, o = async (s, a, l, c) => {
910
+ function zn(e, t = {}) {
911
+ const n = async (l, i) => {
912
+ S(i);
913
+ const s = await e.read(l, i);
914
+ return S(i), s ? I(s) : void 0;
915
+ }, r = async (l, i) => {
916
+ const s = await n(l, i.signal);
917
+ if ((s?.revision ?? null) !== i.expectedRevision) throw new D("conflict", "模板已变化,请重新读取后提交");
918
+ return s;
919
+ }, a = async (l, i, s) => {
920
+ if (S(i.signal), !await e.compareAndSwap(l.id, i.expectedRevision, I(l), { signal: i.signal, ...s ? { publication: I(s) } : {} })) throw new D("conflict", "模板已被其他请求更新");
921
+ return I(l);
922
+ }, o = async (l, i, s, c) => {
915
923
  if (t.beforePublish) {
916
- x(l.signal);
917
- const g = await t.beforePublish({ document: I(a), previous: s.published ? I(s.published) : void 0, signal: l.signal });
918
- if (!g || g.ok !== !0) throw new L("review", g?.issues?.find((f) => f.severity === "error")?.message ?? "模板发布检查未通过");
919
- x(l.signal);
924
+ S(s.signal);
925
+ const g = await t.beforePublish({ document: U(i), previous: l.published ? U(l.published) : void 0, signal: s.signal });
926
+ if (!g || g.ok !== !0) throw new D("review", g?.issues?.find((f) => f.severity === "error")?.message ?? "模板发布检查未通过");
927
+ S(s.signal);
920
928
  }
921
- const d = ve(s), m = I({ ...a, revision: d }), h = { revision: d, document: m, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
922
- return c !== void 0 && (h.restoredFrom = c), i({ id: s.id, revision: d, publishedRevision: d, published: m }, l, h);
929
+ const m = ve(l), d = U({ ...i, revision: m }), h = { revision: m, document: d, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
930
+ return c !== void 0 && (h.restoredFrom = c), a({ id: l.id, revision: m, publishedRevision: m, published: d }, s, h);
923
931
  };
924
932
  return {
925
- list: async (s) => {
926
- x(s);
927
- const a = await e.list(s);
928
- return x(s), k(a);
933
+ list: async (l) => {
934
+ S(l);
935
+ const i = await e.list(l);
936
+ return S(l), I(i);
929
937
  },
930
- get: async (s, a = {}) => {
931
- const l = await n(s, a.signal), c = a.draft ? l?.draft : l?.published;
932
- return c ? I(c) : void 0;
938
+ get: async (l, i = {}) => {
939
+ const s = await n(l, i.signal), c = i.draft ? s?.draft : s?.published;
940
+ return c ? U(c) : void 0;
933
941
  },
934
- history: async (s, a) => {
935
- x(a);
936
- const l = await e.history(s, a);
937
- return x(a), k(l);
942
+ history: async (l, i) => {
943
+ S(i);
944
+ const s = await e.history(l, i);
945
+ return S(i), I(s);
938
946
  },
939
- saveDraft: async (s, a) => {
940
- a = { ...a }, x(a.signal);
941
- const l = I(t.migrate ? await t.migrate(s) : s), c = await r(l.id, a), d = ve(c);
942
- return i({
943
- id: l.id,
944
- revision: d,
945
- draft: { ...l, revision: d },
947
+ saveDraft: async (l, i) => {
948
+ i = { ...i }, S(i.signal);
949
+ const s = U(t.migrate ? await t.migrate(l) : l), c = await r(s.id, i), m = ve(c);
950
+ return a({
951
+ id: s.id,
952
+ revision: m,
953
+ draft: { ...s, revision: m },
946
954
  ...c?.publishedRevision ? { publishedRevision: c.publishedRevision, published: c.published } : {}
947
- }, a);
955
+ }, i);
948
956
  },
949
- publish: async (s, a) => {
950
- a = { ...a };
951
- const l = await r(s, a);
952
- if (!l) throw new L("missing", "模板不存在");
953
- if (!l.draft) throw new L("draft", "没有可发布的草稿");
954
- return o(l, l.draft, a);
957
+ publish: async (l, i) => {
958
+ i = { ...i };
959
+ const s = await r(l, i);
960
+ if (!s) throw new D("missing", "模板不存在");
961
+ if (!s.draft) throw new D("draft", "没有可发布的草稿");
962
+ return o(s, s.draft, i);
955
963
  },
956
- rollback: async (s, a, l) => {
957
- l = { ...l };
958
- const c = await r(s, l);
959
- if (!c) throw new L("missing", "模板不存在");
960
- x(l.signal);
961
- const d = await e.getVersion(s, a, l.signal);
962
- if (!d) throw new L("history", "历史修订不存在");
963
- return o(c, d.document, l, a);
964
+ rollback: async (l, i, s) => {
965
+ s = { ...s };
966
+ const c = await r(l, s);
967
+ if (!c) throw new D("missing", "模板不存在");
968
+ S(s.signal);
969
+ const m = await e.getVersion(l, i, s.signal);
970
+ if (!m) throw new D("history", "历史修订不存在");
971
+ return o(c, m.document, s, i);
964
972
  }
965
973
  };
966
974
  }
967
- function kn() {
975
+ function Wn() {
968
976
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
969
977
  return {
970
978
  read: async (n, r) => {
971
- x(r);
972
- const i = e.get(n);
973
- return i ? k(i) : void 0;
979
+ S(r);
980
+ const a = e.get(n);
981
+ return a ? I(a) : void 0;
974
982
  },
975
- list: async (n) => (x(n), Array.from(e.values(), ({ id: r, revision: i, publishedRevision: o }) => ({ id: r, revision: i, ...o ? { publishedRevision: o } : {} }))),
976
- history: async (n, r) => (x(r), Array.from(t.get(n)?.values() ?? [], (i) => k(i))),
977
- getVersion: async (n, r, i) => {
978
- x(i);
983
+ list: async (n) => (S(n), Array.from(e.values(), ({ id: r, revision: a, publishedRevision: o }) => ({ id: r, revision: a, ...o ? { publishedRevision: o } : {} }))),
984
+ history: async (n, r) => (S(r), Array.from(t.get(n)?.values() ?? [], (a) => I(a))),
985
+ getVersion: async (n, r, a) => {
986
+ S(a);
979
987
  const o = t.get(n)?.get(r);
980
- return o ? k(o) : void 0;
988
+ return o ? I(o) : void 0;
981
989
  },
982
- compareAndSwap: async (n, r, i, o) => {
983
- if (x(o.signal), (e.get(n)?.revision ?? null) !== r) return !1;
984
- if (i.id !== n) throw new L("history", "状态 ID 与存储 ID 不一致");
985
- const s = k(i), a = o.publication;
986
- if (a) {
987
- const l = t.get(n) ?? /* @__PURE__ */ new Map();
988
- if (l.has(a.revision) || a.revision !== i.revision || a.document.id !== n) throw new L("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
989
- l.set(a.revision, k(a)), t.set(n, l);
990
+ compareAndSwap: async (n, r, a, o) => {
991
+ if (S(o.signal), (e.get(n)?.revision ?? null) !== r) return !1;
992
+ if (a.id !== n) throw new D("history", "状态 ID 与存储 ID 不一致");
993
+ const l = I(a), i = o.publication;
994
+ if (i) {
995
+ const s = t.get(n) ?? /* @__PURE__ */ new Map();
996
+ if (s.has(i.revision) || i.revision !== a.revision || i.document.id !== n) throw new D("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
997
+ s.set(i.revision, I(i)), t.set(n, s);
990
998
  }
991
- return e.set(n, s), !0;
999
+ return e.set(n, l), !0;
992
1000
  }
993
1001
  };
994
1002
  }
995
- function $t(e, t) {
996
- const n = e.publishedRevision ?? e.published?.revision;
997
- for (const r of [e.draftRevision, n]) if (r !== void 0 && (typeof r != "string" || !r.trim())) throw new TypeError("模板生命周期修订应为非空字符串");
998
- if (e.draftRevision !== void 0 && e.draftRevision !== t.revision) throw new TypeError("可编辑文档应与草稿修订一致");
999
- if (e.published && (e.published.id !== t.id || e.published.revision !== n)) throw new TypeError("发布文档身份或修订不一致");
1000
- if (!e.published && n !== void 0 && n !== t.revision) throw new TypeError("发布修订需要对应的独立文档");
1001
- return { ...e.draftRevision === void 0 ? {} : { draftRevision: e.draftRevision }, ...n === void 0 ? {} : { publishedRevision: n } };
1002
- }
1003
- function In(e, t) {
1004
- const n = I(e);
1005
- if (t.id === n.id) throw new Error("复制模板应使用新的 ID");
1006
- const { revision: r, ...i } = n;
1007
- return I({ ...i, id: t.id, name: t.name });
1008
- }
1009
- function Nn(e) {
1010
- if (!Array.isArray(e) || e.length > 1e3) throw new RangeError("本地模板目录最多 1000 项");
1011
- const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = [];
1012
- for (const i of e) {
1013
- const o = I(i.document);
1014
- if (t.has(o.id)) throw new Error(`模板 ID 重复:${o.id}`);
1015
- if (i.category !== void 0 && (typeof i.category != "string" || i.category.length > 128) || i.tags !== void 0 && (!Array.isArray(i.tags) || i.tags.length > 20 || i.tags.some((c) => typeof c != "string" || c.length > 128))) throw new TypeError("模板分类和标签无效");
1016
- const s = $t(i, o), { template: a, ...l } = o;
1017
- t.set(o.id, o), i.published ? n.set(o.id, I(i.published)) : s.publishedRevision && n.set(o.id, I(o)), r.push({ ...l, ...s, ...i.category ? { category: i.category } : {}, ...i.tags ? { tags: [...i.tags] } : {} });
1018
- }
1019
- return r.sort((i, o) => i.id < o.id ? -1 : 1), {
1020
- search: async (i) => {
1021
- be(i.signal);
1022
- const o = i.limit ?? 30;
1023
- if (!Number.isSafeInteger(o) || o < 1 || o > 100) throw new RangeError("模板每页数量应为 1–100");
1024
- const s = i.query?.trim().toLocaleLowerCase() ?? "", a = r.filter((c) => (!i.category || c.category === i.category) && (!i.cursor || c.id > i.cursor) && (!s || [c.id, c.name, c.description, ...c.tags ?? []].some((d) => d?.toLocaleLowerCase().includes(s)))), l = /* @__PURE__ */ new Map();
1025
- for (const c of r) c.category && l.set(c.category, (l.get(c.category) ?? 0) + 1);
1026
- return JSON.parse(JSON.stringify({ items: a.slice(0, o), ...a.length > o ? { next: a[o - 1].id } : {}, categories: Array.from(l, ([c, d]) => ({ id: c, label: c, count: d })) }));
1027
- },
1028
- get: async (i, o) => {
1029
- be(o.signal);
1030
- const s = o.mode === "published" ? n.get(i) : t.get(i);
1031
- return s ? I(s) : void 0;
1032
- }
1033
- };
1034
- }
1035
- function be(e) {
1036
- if (!e?.aborted) return;
1037
- const t = new Error("模板目录操作已取消");
1038
- throw t.name = "AbortError", t;
1039
- }
1040
- function $n(e) {
1003
+ function Bn(e) {
1041
1004
  return e.map((t) => t.map((n) => /[\t\r\n"]/.test(n) ? `"${n.replace(/"/g, '""')}"` : n).join(" ")).join(`\r
1042
1005
  `);
1043
1006
  }
1044
- function Lt(e, t) {
1007
+ function zt(e, t) {
1045
1008
  const n = e[e.length - 1];
1046
1009
  e.length > 1 && n?.length === 1 && n[0] === "" && /[\r\n]$/.test(t) && e.pop();
1047
1010
  }
1048
- function Ln(e, t = 1e4) {
1011
+ function jn(e, t = 1e4) {
1049
1012
  if (e.length > 4 * 1024 * 1024) throw new Error("Clipboard text limit exceeded");
1050
1013
  const n = [[]];
1051
- let r = "", i = !1, o = !1, s = 0;
1052
- function a() {
1053
- if (++s > t) throw new Error("Clipboard cell limit exceeded");
1014
+ let r = "", a = !1, o = !1, l = 0;
1015
+ function i() {
1016
+ if (++l > t) throw new Error("Clipboard cell limit exceeded");
1054
1017
  n[n.length - 1].push(r), r = "", o = !1;
1055
1018
  }
1056
- for (let l = 0; l < e.length; l++) {
1057
- const c = e[l];
1058
- if (i) {
1019
+ for (let s = 0; s < e.length; s++) {
1020
+ const c = e[s];
1021
+ if (a) {
1059
1022
  if (c !== '"') {
1060
1023
  r += c;
1061
1024
  continue;
1062
1025
  }
1063
- if (e[l + 1] === '"') {
1064
- r += '"', l++;
1026
+ if (e[s + 1] === '"') {
1027
+ r += '"', s++;
1065
1028
  continue;
1066
1029
  }
1067
- i = !1, o = !0;
1030
+ a = !1, o = !0;
1068
1031
  continue;
1069
1032
  }
1070
1033
  if (c === '"' && !r && !o) {
1071
- i = !0;
1034
+ a = !0;
1072
1035
  continue;
1073
1036
  }
1074
1037
  if (c === " ") {
1075
- a();
1038
+ i();
1076
1039
  continue;
1077
1040
  }
1078
1041
  if (c === "\r" || c === `
1079
1042
  `) {
1080
- a(), n.push([]), c === "\r" && e[l + 1] === `
1081
- ` && l++;
1043
+ i(), n.push([]), c === "\r" && e[s + 1] === `
1044
+ ` && s++;
1082
1045
  continue;
1083
1046
  }
1084
1047
  if (o) throw new Error("Invalid quoted clipboard value");
1085
1048
  r += c;
1086
1049
  }
1087
- if (i) throw new Error("Unclosed clipboard quote");
1088
- return a(), Lt(n, e), n;
1050
+ if (a) throw new Error("Unclosed clipboard quote");
1051
+ return i(), zt(n, e), n;
1089
1052
  }
1090
- class Dt extends Error {
1053
+ class Wt extends Error {
1091
1054
  constructor(t, n, r) {
1092
- const i = typeof n.label == "string" ? n.label : "单元格", o = {
1093
- definition: `${i}的编辑器配置无效`,
1094
- type: `${i}的编辑器与数据类型不一致`,
1095
- required: `${i}不能为空`,
1096
- min: `${i}不能小于 ${r}`,
1097
- max: `${i}不能大于 ${r}`,
1098
- precision: `${i}最多保留 ${r} 位小数`,
1099
- length: `${i}最多允许 ${r} 个字符`,
1100
- choice: `${i}请选择有效选项`,
1101
- date: `${i}请输入有效日期(YYYY-MM-DD)`
1055
+ const a = typeof n.label == "string" ? n.label : "单元格", o = {
1056
+ definition: `${a}的编辑器配置无效`,
1057
+ type: `${a}的编辑器与数据类型不一致`,
1058
+ required: `${a}不能为空`,
1059
+ min: `${a}不能小于 ${r}`,
1060
+ max: `${a}不能大于 ${r}`,
1061
+ precision: `${a}最多保留 ${r} 位小数`,
1062
+ length: `${a}最多允许 ${r} 个字符`,
1063
+ choice: `${a}请选择有效选项`,
1064
+ date: `${a}请输入有效日期(YYYY-MM-DD)`
1102
1065
  };
1103
1066
  super(o[t]), this.code = t, this.field = n, this.expected = r, this.name = "ReportCellFieldError";
1104
1067
  }
1105
1068
  }
1106
1069
  function p(e, t, n) {
1107
- throw new Dt(t, e, n);
1070
+ throw new Wt(t, e, n);
1108
1071
  }
1109
- function Be(e) {
1072
+ function Ue(e) {
1110
1073
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
1111
1074
  const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
1112
1075
  return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
1113
1076
  }
1114
- function Ft(e) {
1077
+ function Bt(e) {
1115
1078
  const [t = "", n = "0"] = String(e).toLowerCase().split("e");
1116
1079
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
1117
1080
  }
1118
- function Ot(e, t) {
1119
- e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && Ft(t) > e.precision && p(e, "precision", e.precision);
1081
+ function jt(e, t) {
1082
+ e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && Bt(t) > e.precision && p(e, "precision", e.precision);
1120
1083
  }
1121
- function zt(e, t) {
1122
- Be(t) || p(e, "date"), e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max);
1084
+ function _t(e, t) {
1085
+ Ue(t) || p(e, "date"), e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max);
1123
1086
  }
1124
- function Ht(e) {
1087
+ function Ut(e) {
1125
1088
  [e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition"), e.precision !== void 0 && (!Number.isInteger(e.precision) || e.precision < 0 || e.precision > 15) && p(e, "definition");
1126
1089
  }
1127
- function _t(e) {
1128
- [e.min, e.max].some((t) => t !== void 0 && !Be(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition");
1090
+ function Gt(e) {
1091
+ [e.min, e.max].some((t) => t !== void 0 && !Ue(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition");
1129
1092
  }
1130
- function Bt(e, t) {
1093
+ function Vt(e, t) {
1131
1094
  (!Array.isArray(t.options) || !t.options.length) && p(t, "definition");
1132
1095
  const n = e.valueType === "text" ? "string" : e.valueType, r = /* @__PURE__ */ new Set();
1133
- for (const i of t.options)
1134
- (!i || typeof i.value !== n || typeof i.value == "number" && !Number.isFinite(i.value)) && p(t, "definition"), i.label !== void 0 && typeof i.label != "string" && p(t, "definition"), r.has(i.value) && p(t, "definition"), r.add(i.value);
1096
+ for (const a of t.options)
1097
+ (!a || typeof a.value !== n || typeof a.value == "number" && !Number.isFinite(a.value)) && p(t, "definition"), a.label !== void 0 && typeof a.label != "string" && p(t, "definition"), r.has(a.value) && p(t, "definition"), r.add(a.value);
1135
1098
  }
1136
- function jt(e) {
1099
+ function qt(e) {
1137
1100
  e.required !== void 0 && typeof e.required != "boolean" && p(e, "definition"), [e.label, e.hint, e.unit].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition"), e.type === "boolean" && [e.trueLabel, e.falseLabel].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition");
1138
1101
  }
1139
- function Wt(e, t) {
1140
- (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"), jt(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && p(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && p(t, "type"), t.type === "number" && Ht(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && p(t, "definition"), t.type === "date" && _t(t), t.type === "enum" && Bt(e, t);
1102
+ function Yt(e, t) {
1103
+ (!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"), qt(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && p(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && p(t, "type"), t.type === "number" && Ut(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && p(t, "definition"), t.type === "date" && Gt(t), t.type === "enum" && Vt(e, t);
1141
1104
  }
1142
- function Dn(e, t, n) {
1143
- if (!e.editable) throw new Ye("readonly");
1144
- n && Wt(e, n);
1145
- const r = Je(e, t);
1146
- return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" && Ot(n, r), n.type === "date" && zt(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && p(n, "length", n.maxLength), n.type === "enum" && !n.options.some((i) => Object.is(i.value, r)) && p(n, "choice"), r)) : r;
1105
+ function _n(e, t, n) {
1106
+ if (!e.editable) throw new rt("readonly");
1107
+ n && Yt(e, n);
1108
+ const r = at(e, t);
1109
+ return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" && jt(n, r), n.type === "date" && _t(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && p(n, "length", n.maxLength), n.type === "enum" && !n.options.some((a) => Object.is(a.value, r)) && p(n, "choice"), r)) : r;
1147
1110
  }
1148
- class w extends Error {
1111
+ class b extends Error {
1149
1112
  constructor(t) {
1150
1113
  super(`Report calculation: ${t}`), this.code = t, this.name = "ReportCalculationError";
1151
1114
  }
1152
1115
  }
1153
- function z(e) {
1116
+ function B(e) {
1154
1117
  if (!e?.aborted) return;
1155
1118
  const t = new Error("Calculation cancelled");
1156
1119
  throw t.name = "AbortError", t;
1157
1120
  }
1158
- async function X(e, t = 1) {
1121
+ async function ee(e, t = 1) {
1159
1122
  const n = Math.floor(e.scanned / 2048);
1160
- if (e.scanned += t, e.scanned > e.maxScanned) throw new w("limit");
1161
- z(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), z(e.signal));
1123
+ if (e.scanned += t, e.scanned > e.maxScanned) throw new b("limit");
1124
+ B(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), B(e.signal));
1162
1125
  }
1163
- function me(e) {
1126
+ function fe(e) {
1164
1127
  return e.table?.role === "header" ? -Math.max(1, e.grid?.cells.length ?? 1) : e.table?.rowIndex ?? 0;
1165
1128
  }
1166
- function ye(e, t, n) {
1167
- if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((a) => Number.isSafeInteger(a) && a >= 0)) throw new w("selection");
1129
+ function xe(e, t, n) {
1130
+ if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((i) => Number.isSafeInteger(i) && i >= 0)) throw new b("selection");
1168
1131
  const r = e.pages[t.pageIndex]?.components[t.componentIndex];
1169
- if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new w("selection");
1170
- const i = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((a, l) => Math.max(a, l.length), 1);
1171
- if (t.columnIndex >= i) throw new w("selection");
1172
- const o = r.table, s = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
1173
- if (o && s && o.id === s.id) {
1174
- const a = s.columnKeys.indexOf(o.columnKeys[t.columnIndex] ?? "");
1175
- if (a < 0) throw new w("selection");
1176
- return { grid: o.id, row: me(r) + t.rowIndex, column: a };
1132
+ if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new b("selection");
1133
+ const a = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((i, s) => Math.max(i, s.length), 1);
1134
+ if (t.columnIndex >= a) throw new b("selection");
1135
+ const o = r.table, l = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
1136
+ if (o && l && o.id === l.id) {
1137
+ const i = l.columnKeys.indexOf(o.columnKeys[t.columnIndex] ?? "");
1138
+ if (i < 0) throw new b("selection");
1139
+ return { grid: o.id, row: fe(r) + t.rowIndex, column: i };
1177
1140
  }
1178
1141
  return { grid: `${t.pageIndex}:${t.componentIndex}`, row: t.rowIndex, column: t.columnIndex };
1179
1142
  }
1180
- function Gt(e, t, n) {
1181
- const r = ye(e, t.anchor, t.anchor), i = ye(e, t.focus, t.anchor);
1182
- if (r.grid !== i.grid) throw new w("selection");
1183
- const o = (Math.abs(r.row - i.row) + 1) * (Math.abs(r.column - i.column) + 1);
1184
- if (!Number.isSafeInteger(o) || o > n) throw new w("limit");
1185
- 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 };
1143
+ function Kt(e, t, n) {
1144
+ const r = xe(e, t.anchor, t.anchor), a = xe(e, t.focus, t.anchor);
1145
+ if (r.grid !== a.grid) throw new b("selection");
1146
+ const o = (Math.abs(r.row - a.row) + 1) * (Math.abs(r.column - a.column) + 1);
1147
+ if (!Number.isSafeInteger(o) || o > n) throw new b("limit");
1148
+ return { grid: r.grid, rowStart: Math.min(r.row, a.row), rowEnd: Math.max(r.row, a.row), columnStart: Math.min(r.column, a.column), columnEnd: Math.max(r.column, a.column), origin: e.pages[t.anchor.pageIndex].components[t.anchor.componentIndex].table };
1186
1149
  }
1187
- function Ut(e) {
1150
+ function Jt(e) {
1188
1151
  if (!e) return !1;
1189
1152
  const t = e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "");
1190
1153
  return /[ymdhs]/i.test(t);
1191
1154
  }
1192
- function Vt(e) {
1193
- if (e.valueType === "text" || e.valueType === "boolean" || Ut(e.numberFormat)) return null;
1155
+ function Xt(e) {
1156
+ if (e.valueType === "text" || e.valueType === "boolean" || Jt(e.numberFormat)) return null;
1194
1157
  const t = e.value;
1195
1158
  if (typeof t != "number" || !Number.isFinite(t)) return null;
1196
- if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new w("precision");
1159
+ if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new b("precision");
1197
1160
  return t;
1198
1161
  }
1199
- function qt(e, t, n) {
1162
+ function Zt(e, t, n) {
1200
1163
  if (e.seen.has(n)) return;
1201
1164
  e.seen.add(n), e.selected++;
1202
- const r = t ? Vt(t) : null;
1165
+ const r = t ? Xt(t) : null;
1203
1166
  r === null ? e.excluded++ : e.values.push(r);
1204
1167
  }
1205
- function Yt(e, t, n, r) {
1168
+ function Qt(e, t, n, r) {
1206
1169
  return r.origin ? e.table?.id === r.origin.id : `${t}:${n}` === r.grid;
1207
1170
  }
1208
- function Jt(e, t, n) {
1171
+ function en(e, t, n) {
1209
1172
  return n.origin ? n.origin.columnKeys.indexOf(e.table.columnKeys[t] ?? "") : t;
1210
1173
  }
1211
- function Kt(e, t, n, r) {
1212
- const i = r.origin ? me(e) + t : t, o = Jt(e, n, r);
1213
- return i < r.rowStart || i > r.rowEnd || o < r.columnStart || o > r.columnEnd ? null : `${r.grid}:${i}:${o}`;
1174
+ function tn(e, t, n, r) {
1175
+ const a = r.origin ? fe(e) + t : t, o = en(e, n, r);
1176
+ return a < r.rowStart || a > r.rowEnd || o < r.columnStart || o > r.columnEnd ? null : `${r.grid}:${a}:${o}`;
1214
1177
  }
1215
- function Xt(e, t) {
1216
- const n = t.origin ? me(e) : 0, r = Math.max(0, t.rowStart - n), i = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
1217
- return i > r ? i : 0;
1178
+ function nn(e, t) {
1179
+ const n = t.origin ? fe(e) : 0, r = Math.max(0, t.rowStart - n), a = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
1180
+ return a > r ? a : 0;
1218
1181
  }
1219
- async function Zt(e, t, n, r, i) {
1182
+ async function rn(e, t, n, r, a) {
1220
1183
  const o = e.grid;
1221
- if (t > r.maxScanned) throw new w("limit");
1222
- const s = o.colWidthsMm?.length ?? o.cells.reduce((l, c) => Math.max(l, c.length), 1);
1223
- if (s > r.maxScanned) throw new w("limit");
1224
- const a = /* @__PURE__ */ new Map();
1225
- for (let l = 0; l < t; l++) {
1226
- l > 0 && l % 2048 === 0 && (await r.yieldToHost(), z(r.signal));
1184
+ if (t > r.maxScanned) throw new b("limit");
1185
+ const l = o.colWidthsMm?.length ?? o.cells.reduce((s, c) => Math.max(s, c.length), 1);
1186
+ if (l > r.maxScanned) throw new b("limit");
1187
+ const i = /* @__PURE__ */ new Map();
1188
+ for (let s = 0; s < t; s++) {
1189
+ s > 0 && s % 2048 === 0 && (await r.yieldToHost(), B(r.signal));
1227
1190
  let c = 0;
1228
- for (const d of o.cells[l]) {
1229
- for (await X(r); c < s && (a.get(c) ?? 0) > l; ) c++;
1230
- if (c >= s) break;
1231
- const m = Math.max(1, Math.min(d?.colSpan ?? 1, s - c)), h = Math.min(o.cells.length, l + Math.max(1, d?.rowSpan ?? 1));
1232
- m > 1 && await X(r, m - 1);
1233
- for (let f = c; f < c + m; f++) a.set(f, h);
1234
- const g = Kt(e, l, c, n);
1235
- g && qt(i, d, g), c += m;
1191
+ for (const m of o.cells[s]) {
1192
+ for (await ee(r); c < l && (i.get(c) ?? 0) > s; ) c++;
1193
+ if (c >= l) break;
1194
+ const d = Math.max(1, Math.min(m?.colSpan ?? 1, l - c)), h = Math.min(o.cells.length, s + Math.max(1, m?.rowSpan ?? 1));
1195
+ d > 1 && await ee(r, d - 1);
1196
+ for (let f = c; f < c + d; f++) i.set(f, h);
1197
+ const g = tn(e, s, c, n);
1198
+ g && Zt(a, m, g), c += d;
1236
1199
  }
1237
1200
  }
1238
1201
  }
1239
- async function Qt(e, t, n) {
1202
+ async function an(e, t, n) {
1240
1203
  const r = { values: [], seen: /* @__PURE__ */ new Set(), excluded: 0, selected: 0 };
1241
- for (let i = 0; i < e.pages.length; i++) {
1242
- await X(n);
1243
- const o = e.pages[i];
1244
- for (let s = 0; s < o.components.length; s++) {
1245
- await X(n);
1246
- const a = o.components[s];
1247
- if (!a.grid || !Yt(a, i, s, t) || a.table && a.table.role !== "body") continue;
1248
- const l = Xt(a, t);
1249
- l && await Zt(a, l, t, n, r);
1204
+ for (let a = 0; a < e.pages.length; a++) {
1205
+ await ee(n);
1206
+ const o = e.pages[a];
1207
+ for (let l = 0; l < o.components.length; l++) {
1208
+ await ee(n);
1209
+ const i = o.components[l];
1210
+ if (!i.grid || !Qt(i, a, l, t) || i.table && i.table.role !== "body") continue;
1211
+ const s = nn(i, t);
1212
+ s && await rn(i, s, t, n, r);
1250
1213
  }
1251
1214
  }
1252
1215
  return r;
1253
1216
  }
1254
- function W(e) {
1255
- if (!Number.isFinite(e)) throw new w("overflow");
1217
+ function V(e) {
1218
+ if (!Number.isFinite(e)) throw new b("overflow");
1256
1219
  return e;
1257
1220
  }
1258
- function en(e) {
1221
+ function on(e) {
1259
1222
  let t = 0, n = 0;
1260
1223
  for (const r of e) {
1261
- const i = r - n, o = W(t + i);
1262
- n = o - t - i, t = o;
1224
+ const a = r - n, o = V(t + a);
1225
+ n = o - t - a, t = o;
1263
1226
  }
1264
1227
  return t;
1265
1228
  }
1266
- async function Me(e, t) {
1229
+ async function Ee(e, t) {
1267
1230
  let n = [...e], r = new Array(e.length);
1268
1231
  for (let o = 1; o < e.length; o *= 2) {
1269
- for (let s = 0; s < e.length; s += o * 2) {
1270
- const a = Math.min(s + o, e.length), l = Math.min(s + o * 2, e.length);
1271
- let c = s, d = a;
1272
- for (let m = s; m < l; m++)
1273
- r[m] = d >= l || c < a && n[c] <= n[d] ? n[c++] : n[d++], m % 2048 === 0 && (await t.yieldToHost(), z(t.signal));
1232
+ for (let l = 0; l < e.length; l += o * 2) {
1233
+ const i = Math.min(l + o, e.length), s = Math.min(l + o * 2, e.length);
1234
+ let c = l, m = i;
1235
+ for (let d = l; d < s; d++)
1236
+ r[d] = m >= s || c < i && n[c] <= n[m] ? n[c++] : n[m++], d % 2048 === 0 && (await t.yieldToHost(), B(t.signal));
1274
1237
  }
1275
1238
  [n, r] = [r, n];
1276
1239
  }
1277
- const i = Math.floor(n.length / 2);
1278
- return n.length % 2 ? n[i] : W(n[i - 1] / 2 + n[i] / 2);
1240
+ const a = Math.floor(n.length / 2);
1241
+ return n.length % 2 ? n[a] : V(n[a - 1] / 2 + n[a] / 2);
1279
1242
  }
1280
- function tn(e) {
1281
- const t = en(e);
1243
+ function sn(e) {
1244
+ const t = on(e);
1282
1245
  let n = 1 / 0, r = -1 / 0;
1283
- for (const i of e)
1284
- n = Math.min(n, i), r = Math.max(r, i);
1246
+ for (const a of e)
1247
+ n = Math.min(n, a), r = Math.max(r, a);
1285
1248
  return { SUM: t, AVERAGE: t / e.length, AVG: t / e.length, MIN: n, MAX: r, COUNT: e.length };
1286
1249
  }
1287
- function nn(e, t) {
1288
- if (typeof e != "string" || e.length > 256) throw new w("expression");
1250
+ function ln(e, t) {
1251
+ if (typeof e != "string" || e.length > 256) throw new b("expression");
1289
1252
  const n = e.toUpperCase().match(/(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?|[A-Z_]+|[()+\-*/]|\S/g) ?? [];
1290
- if (!n.length || n.length > 64) throw new w("expression");
1253
+ if (!n.length || n.length > 64) throw new b("expression");
1291
1254
  let r = 0;
1292
- function i(a) {
1293
- if (a > 16) throw new w("expression");
1294
- const l = n[r++];
1295
- if (l === "+" || l === "-") return (l === "-" ? -1 : 1) * i(a + 1);
1296
- if (l === "(") {
1297
- const c = o(0, a + 1);
1298
- if (n[r++] !== ")") throw new w("expression");
1255
+ function a(i) {
1256
+ if (i > 16) throw new b("expression");
1257
+ const s = n[r++];
1258
+ if (s === "+" || s === "-") return (s === "-" ? -1 : 1) * a(i + 1);
1259
+ if (s === "(") {
1260
+ const c = o(0, i + 1);
1261
+ if (n[r++] !== ")") throw new b("expression");
1299
1262
  return c;
1300
1263
  }
1301
- if (l && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(l) && Object.prototype.hasOwnProperty.call(t, l)) return W(t[l]);
1302
- if (l && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(l)) return W(Number(l));
1303
- throw new w("expression");
1264
+ if (s && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(s) && Object.prototype.hasOwnProperty.call(t, s)) return V(t[s]);
1265
+ if (s && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(s)) return V(Number(s));
1266
+ throw new b("expression");
1304
1267
  }
1305
- function o(a, l) {
1306
- let c = i(l);
1268
+ function o(i, s) {
1269
+ let c = a(s);
1307
1270
  for (; r < n.length; ) {
1308
- const d = n[r], m = d === "+" || d === "-" ? 1 : d === "*" || d === "/" ? 2 : 0;
1309
- if (!m || m < a) break;
1271
+ const m = n[r], d = m === "+" || m === "-" ? 1 : m === "*" || m === "/" ? 2 : 0;
1272
+ if (!d || d < i) break;
1310
1273
  r++;
1311
- const h = o(m + 1, l + 1);
1312
- if (d === "/" && h === 0) throw new w("division");
1313
- c = W(d === "+" ? c + h : d === "-" ? c - h : d === "*" ? c * h : c / h);
1274
+ const h = o(d + 1, s + 1);
1275
+ if (m === "/" && h === 0) throw new b("division");
1276
+ c = V(m === "+" ? c + h : m === "-" ? c - h : m === "*" ? c * h : c / h);
1314
1277
  }
1315
1278
  return c;
1316
1279
  }
1317
- const s = o(1, 0);
1318
- if (r !== n.length) throw new w("expression");
1319
- return s;
1280
+ const l = o(1, 0);
1281
+ if (r !== n.length) throw new b("expression");
1282
+ return l;
1320
1283
  }
1321
- function rn(e) {
1284
+ function cn(e) {
1322
1285
  const t = e.maxCells ?? 1e5, n = e.maxScannedCells ?? 2e5, r = e.precision ?? 2;
1323
- if (![t, n].every((i) => Number.isSafeInteger(i) && i >= 1 && i <= 2e6)) throw new w("limit");
1324
- if (!Number.isInteger(r) || r < 0 || r > 12) throw new w("precision");
1286
+ if (![t, n].every((a) => Number.isSafeInteger(a) && a >= 1 && a <= 2e6)) throw new b("limit");
1287
+ if (!Number.isInteger(r) || r < 0 || r > 12) throw new b("precision");
1325
1288
  return { maxCells: t, maxScanned: n, precision: r };
1326
1289
  }
1327
- async function Fn(e, t, n = {}) {
1328
- const r = rn(n), i = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((l) => setTimeout(l, 0))) };
1329
- z(i.signal);
1330
- const o = await Qt(e, Gt(e, t, r.maxCells), i), s = n.operation ?? "sum";
1331
- if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(s)) throw new w("expression");
1332
- let a = null;
1333
- if (s === "count") a = o.values.length;
1290
+ async function Un(e, t, n = {}) {
1291
+ const r = cn(n), a = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((s) => setTimeout(s, 0))) };
1292
+ B(a.signal);
1293
+ const o = await an(e, Kt(e, t, r.maxCells), a), l = n.operation ?? "sum";
1294
+ if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new b("expression");
1295
+ let i = null;
1296
+ if (l === "count") i = o.values.length;
1334
1297
  else if (o.values.length)
1335
- if (s === "median") a = await Me(o.values, i);
1298
+ if (l === "median") i = await Ee(o.values, a);
1336
1299
  else {
1337
- const l = tn(o.values);
1338
- s === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (l.MEDIAN = await Me(o.values, i)), a = nn(n.expression ?? "", l)) : a = l[s.toUpperCase()];
1300
+ const s = sn(o.values);
1301
+ l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (s.MEDIAN = await Ee(o.values, a)), i = ln(n.expression ?? "", s)) : i = s[l.toUpperCase()];
1339
1302
  }
1340
- if (z(i.signal), a !== null && Number.isInteger(a) && !Number.isSafeInteger(a)) throw new w("precision");
1341
- return { value: a, formatted: a === null ? "—" : a.toFixed(r.precision), numericCells: o.values.length, excludedCells: o.excluded, selectedCells: o.selected, precision: r.precision };
1303
+ if (B(a.signal), i !== null && Number.isInteger(i) && !Number.isSafeInteger(i)) throw new b("precision");
1304
+ return { value: i, formatted: i === null ? "—" : i.toFixed(r.precision), numericCells: o.values.length, excludedCells: o.excluded, selectedCells: o.selected, precision: r.precision };
1305
+ }
1306
+ class A extends Error {
1307
+ constructor(t, n) {
1308
+ super(t), this.path = n, this.code = "label-sheet", this.name = "LabelSheetError";
1309
+ }
1310
+ }
1311
+ function X(e) {
1312
+ if (e?.aborted) {
1313
+ const t = new Error("标签拼版已取消");
1314
+ throw t.name = "AbortError", t;
1315
+ }
1316
+ }
1317
+ function O(e, t, n = !1) {
1318
+ if (!Number.isFinite(e) || e <= 0 || n && !Number.isSafeInteger(e)) throw new A("应为正有限数字,数量应为安全整数", t);
1319
+ return e;
1320
+ }
1321
+ function Se(e, t) {
1322
+ if (!Number.isFinite(e) || e < 0) throw new A("应为非负有限数字", t);
1323
+ return e;
1324
+ }
1325
+ function mn(e) {
1326
+ const t = typeof e.marginMm == "object" ? e.marginMm : { top: e.marginMm ?? 0, left: e.marginMm ?? 0, bottom: e.marginMm ?? 0, right: e.marginMm ?? 0 }, n = typeof e.gapMm == "object" ? e.gapMm : { horizontal: e.gapMm ?? 0, vertical: e.gapMm ?? 0 };
1327
+ for (const r of ["top", "left", "bottom", "right"]) Se(t?.[r], `$.marginMm.${r}`);
1328
+ for (const r of ["horizontal", "vertical"]) Se(n?.[r], `$.gapMm.${r}`);
1329
+ return { margin: t, gap: n };
1330
+ }
1331
+ function dn(e) {
1332
+ const t = e.paper === void 0 || e.paper === "a4" ? { widthMm: 210, heightMm: 297 } : e.paper;
1333
+ O(t.widthMm, "$.paper.widthMm"), O(t.heightMm, "$.paper.heightMm");
1334
+ const n = O(e.columns, "$.columns", !0), r = O(e.rows, "$.rows", !0), a = n * r;
1335
+ if (a > 1e3) throw new A("每张纸不能超过 1000 个位置", "$.columns");
1336
+ const { margin: o, gap: l } = mn(e), i = e.startSlot ?? 0, s = e.offsetMm ?? { x: 0, y: 0 };
1337
+ if (!Number.isSafeInteger(i) || i < 0 || i >= a) throw new A("起始位置应在首张纸的有效位置内", "$.startSlot");
1338
+ if (!Number.isFinite(s.x) || !Number.isFinite(s.y)) throw new A("校准偏移应为有限毫米值", "$.offsetMm");
1339
+ return { paper: t, columns: n, rows: r, capacity: a, margin: o, gap: l, startSlot: i, offset: s };
1340
+ }
1341
+ function Ge(e) {
1342
+ return 1 + (e.grid?.cells.reduce((t, n) => t + n.length + 1 + n.reduce((r, a) => r + (a?.children?.reduce((o, l) => o + Ge(l), 0) ?? 0), 0), 0) ?? 0);
1343
+ }
1344
+ function hn(e, t, n) {
1345
+ if (!Je(e).ok) throw new A("标签计划无效", "$.plan");
1346
+ const r = e.pages[0];
1347
+ if (!r) return;
1348
+ const { paper: a, columns: o, rows: l, margin: i, gap: s, offset: c } = n;
1349
+ if (i.left + c.x < 0 || i.top + c.y < 0 || i.left + c.x + o * r.pageWidthMm + (o - 1) * s.horizontal + i.right > a.widthMm + 1e-6 || i.top + c.y + l * r.pageHeightMm + (l - 1) * s.vertical + i.bottom > a.heightMm + 1e-6) throw new A("标签、间距、边距及校准偏移超过纸张尺寸;不会自动缩小标签", "$.paper");
1350
+ let m = 0;
1351
+ for (const [d, h] of e.pages.entries()) {
1352
+ if (X(t.signal), h.layout === "wide" || h.pageWidthMm !== r.pageWidthMm || h.pageHeightMm !== r.pageHeightMm) throw new A("拼版需要尺寸相同的固定标签页面", `$.pages.${d}`);
1353
+ if (m += h.components.reduce((g, f) => g + Ge(f), 0), m > O(t.maxComponents ?? 25e4, "$.maxComponents", !0)) throw new A("拼版组件总量超过预算", "$.maxComponents");
1354
+ for (const g of h.components) if (g.leftMm < 0 || g.topMm < 0 || g.leftMm + g.widthMm > h.pageWidthMm + 1e-6 || g.topMm + g.heightMm > h.pageHeightMm + 1e-6) throw new A("标签内容超出标签边界", `$.pages.${d}.components`);
1355
+ }
1356
+ }
1357
+ function Gn(e, t) {
1358
+ X(t.signal);
1359
+ const n = dn(t), { paper: r, columns: a, capacity: o, margin: l, gap: i, startSlot: s, offset: c } = n, m = e.pages.length ? Math.ceil((s + e.pages.length) / o) : 0;
1360
+ if (m > O(t.maxSheets ?? 1e4, "$.maxSheets", !0)) throw new A("拼版纸张数量超过预算", "$.maxSheets");
1361
+ O(t.maxComponents ?? 25e4, "$.maxComponents", !0), hn(e, t, n);
1362
+ const d = Qe(e, { maxBytes: O(t.maxSnapshotBytes ?? 64e6, "$.maxSnapshotBytes", !0), check: () => X(t.signal), error: (g, f) => new A(f, "$.maxSnapshotBytes") }), h = Array.from({ length: m }, () => ({ pageWidthMm: r.widthMm, pageHeightMm: r.heightMm, components: [], meta: { labelSheet: { columns: a, rows: n.rows, slots: [] } } }));
1363
+ for (const [g, f] of d.pages.entries()) {
1364
+ X(t.signal);
1365
+ const w = s + g, C = w % o, x = h[Math.floor(w / o)], v = l.left + c.x + C % a * (f.pageWidthMm + i.horizontal), R = l.top + c.y + Math.floor(C / a) * (f.pageHeightMm + i.vertical), H = { sourcePageIndex: g, slotIndex: C, xMm: v, yMm: R, widthMm: f.pageWidthMm, heightMm: f.pageHeightMm, ...f.meta ? { sourceMeta: f.meta } : {} };
1366
+ x.meta.labelSheet.slots.push(H), x.components.push(...f.components.map((N) => ({ ...N, leftMm: N.leftMm + v, topMm: N.topMm + R, meta: { ...N.meta, labelSheet: H } })));
1367
+ }
1368
+ return { ...d, pages: h };
1342
1369
  }
1343
1370
  export {
1344
- Qn as CSS_DPI,
1345
- Hn as DEFAULT_BORDER_PT,
1346
- Z as DEFAULT_FONT_FAMILY,
1347
- _n as DEFAULT_FONT_PT,
1348
- br as DEFAULT_LABEL_PAGE_LIMIT,
1349
- Bn as DEFAULT_STROKE_COLOR,
1350
- xe as DEFAULT_TEXT_COLOR,
1351
- jn as LINE_HEIGHT,
1352
- er as MM_PER_INCH,
1353
- gr as OutputAssetError,
1354
- Ke as OutputFidelityError,
1355
- J as PAPER_SIZES,
1356
- Tt as PageBuilder,
1357
- yr as PaginateCellLimitError,
1358
- Mr as PaginatePageLimitError,
1359
- ir as RENDER_PLAN_SCHEMA_VERSION,
1360
- qr as REPORT_TEMPLATE_DOCUMENT_VERSION,
1361
- Un as ReportBindingError,
1362
- w as ReportCalculationError,
1363
- Ye as ReportCellEditError,
1364
- Dt as ReportCellFieldError,
1365
- Qr as ReportParamValidationError,
1366
- se as ReportSourceError,
1367
- Ne as ReportTemplateError,
1368
- L as ReportTemplateStoreError,
1369
- Wn as SCHEMA_VERSION_MACH,
1370
- Et as TemplateBuilder,
1371
- di as TreeRowLimitError,
1372
- xr as applyReportCellEdit,
1373
- Er as applyReportCellEditBatch,
1374
- Tr as applyReportEditResult,
1375
- ar as assertRenderPlan,
1376
- ei as assertReportParams,
1377
- Fn as calculateReportSelection,
1378
- ur as charWidthEm,
1379
- E as classOf,
1380
- In as cloneReportTemplate,
1381
- Tn as columnsFromContract,
1382
- ft as computePageWindow,
1383
- Sr as countTemplatePages,
1384
- fr as createCanvasMeasurer,
1385
- xn as createCanvasPager,
1386
- pr as createHeuristicMeasurer,
1387
- Cn as createLabelTemplate,
1388
- Nn as createLocalTemplateCatalog,
1389
- kn as createMemoryTemplateStore,
1390
- Pn as createProviderReport,
1391
- Cr as createReportCellEdit,
1392
- Rr as createReportCellEditBatch,
1393
- Pr as createReportCellResolver,
1394
- Ar as createReportEditSession,
1395
- kr as createReportSource,
1396
- Sn as createTableTemplate,
1397
- En as createTemplate,
1398
- An as createTemplateManager,
1399
- Yr as createTemplateRegistry,
1400
- mi as createTreeTable,
1401
- mr as datasetJsonSchema,
1402
- Rn as defineLabelReport,
1403
- qe as defineReport,
1404
- Jr as defineReportTemplate,
1405
- Ir as diffReportTemplates,
1406
- Nr as estimateListLayoutCells,
1407
- Vn as evalStyleRule,
1408
- nn as evaluateReportAggregateExpression,
1409
- $r as formatReportCellEdit,
1410
- $n as formatReportClipboard,
1411
- ti as formatReportDateRange,
1412
- qn as formatValue,
1413
- Lr as getReportCellContext,
1414
- Dr as getReportEditSession,
1415
- oe as heuristicMeasurer,
1416
- Ur as inspectOutputCapabilities,
1417
- ee as isImageBackedComponent,
1418
- ni as isReportDate,
1419
- ri as isReportMonth,
1420
- ii as isReportYear,
1421
- Ce as isRichText,
1422
- ce as measurePageSizePx,
1423
- wr as measureTextMm,
1424
- Te as mergeComponentStyles,
1425
- ie as mmToPx,
1426
- tr as mmToPxFactor,
1427
- Fr as paginateTemplate,
1428
- Or as paginateTemplatePages,
1429
- Yn as parseDateLocal,
1430
- Dn as parseReportCellFieldInput,
1431
- Je as parseReportCellInput,
1432
- Ln as parseReportClipboard,
1433
- oi as parseReportDateRange,
1434
- I as parseReportTemplate,
1435
- vn as planFontSizePx,
1436
- zr as projectListColumns,
1437
- O as ptToPx,
1438
- nr as pxToMm,
1439
- Hr as registerReportEditSession,
1440
- _r as relocateReportCellEdits,
1441
- Le as renderComponent,
1442
- dt as renderPage,
1443
- wn as renderPlan,
1444
- yn as renderPlanToCanvas,
1445
- Mn as renderPlanToCanvasAsync,
1446
- bn as renderPlanToImages,
1447
- Br as reportCellEditKey,
1448
- G as reportOutputDiagnostics,
1449
- ai as reportParamsJsonSchema,
1450
- Ee as resolveBoxBorders,
1451
- Jn as resolveComponentBinding,
1371
+ lr as CSS_DPI,
1372
+ Yn as DEFAULT_BORDER_PT,
1373
+ te as DEFAULT_FONT_FAMILY,
1374
+ Kn as DEFAULT_FONT_PT,
1375
+ kr as DEFAULT_LABEL_PAGE_LIMIT,
1376
+ Jn as DEFAULT_STROKE_COLOR,
1377
+ Te as DEFAULT_TEXT_COLOR,
1378
+ Xn as LINE_HEIGHT,
1379
+ A as LabelSheetError,
1380
+ cr as MM_PER_INCH,
1381
+ Kr as OutputAssetError,
1382
+ et as OutputFidelityError,
1383
+ Z as PAPER_SIZES,
1384
+ $t as PageBuilder,
1385
+ Ir as PaginateCellLimitError,
1386
+ Nr as PaginatePageLimitError,
1387
+ gr as RENDER_PLAN_SCHEMA_VERSION,
1388
+ ur as REPORT_TEMPLATE_DOCUMENT_VERSION,
1389
+ er as ReportBindingError,
1390
+ b as ReportCalculationError,
1391
+ rt as ReportCellEditError,
1392
+ Wt as ReportCellFieldError,
1393
+ Xr as ReportDrillError,
1394
+ ra as ReportParamValidationError,
1395
+ ce as ReportSourceError,
1396
+ ke as ReportTemplateError,
1397
+ D as ReportTemplateStoreError,
1398
+ Zn as SCHEMA_VERSION_MACH,
1399
+ At as TemplateBuilder,
1400
+ _a as TreeRowLimitError,
1401
+ Na as applyReportCellEdit,
1402
+ La as applyReportCellEditBatch,
1403
+ Pa as applyReportDocumentStyle,
1404
+ Lr as applyReportEditResult,
1405
+ Dr as applyReportSourceMetadata,
1406
+ pr as assertRenderPlan,
1407
+ aa as assertReportParams,
1408
+ Un as calculateReportSelection,
1409
+ Aa as captureTemplateFragment,
1410
+ Cr as charWidthEm,
1411
+ T as classOf,
1412
+ fa as cloneReportTemplate,
1413
+ Sa as collectTemplateOutline,
1414
+ Ln as columnsFromContract,
1415
+ vt as computePageWindow,
1416
+ Fr as countTemplatePages,
1417
+ Rr as createCanvasMeasurer,
1418
+ In as createCanvasPager,
1419
+ Pr as createHeuristicMeasurer,
1420
+ Fn as createLabelTemplate,
1421
+ ua as createLocalTemplateCatalog,
1422
+ Wn as createMemoryTemplateStore,
1423
+ Hn as createProviderReport,
1424
+ Da as createReportCellEdit,
1425
+ Fa as createReportCellEditBatch,
1426
+ Oa as createReportCellResolver,
1427
+ Zr as createReportDrillRequest,
1428
+ Or as createReportEditSession,
1429
+ Hr as createReportSource,
1430
+ Dn as createTableTemplate,
1431
+ Nn as createTemplate,
1432
+ zn as createTemplateManager,
1433
+ wr as createTemplateRegistry,
1434
+ Ua as createTreeTable,
1435
+ Sr as datasetJsonSchema,
1436
+ On as defineLabelReport,
1437
+ Ze as defineReport,
1438
+ br as defineReportTemplate,
1439
+ pa as diffReportTemplates,
1440
+ zr as estimateListLayoutCells,
1441
+ tr as evalStyleRule,
1442
+ ln as evaluateReportAggregateExpression,
1443
+ Ha as formatReportCellEdit,
1444
+ Bn as formatReportClipboard,
1445
+ ia as formatReportDateRange,
1446
+ nr as formatValue,
1447
+ za as getReportCellContext,
1448
+ Wr as getReportEditSession,
1449
+ ya as hasValidDataExplanation,
1450
+ le as heuristicMeasurer,
1451
+ Gn as imposeLabelSheets,
1452
+ $a as insertTemplateFragment,
1453
+ qr as inspectOutputCapabilities,
1454
+ Ta as inspectTemplateFieldUsage,
1455
+ ka as inspectTemplateFragmentBindings,
1456
+ re as isImageBackedComponent,
1457
+ va as isReportDataTarget,
1458
+ oa as isReportDate,
1459
+ sa as isReportMonth,
1460
+ xa as isReportValueState,
1461
+ la as isReportYear,
1462
+ Ae as isRichText,
1463
+ Qr as matchReportDrillActions,
1464
+ he as measurePageSizePx,
1465
+ Ar as measureTextMm,
1466
+ Re as mergeComponentStyles,
1467
+ se as mmToPx,
1468
+ mr as mmToPxFactor,
1469
+ Br as paginateTemplate,
1470
+ jr as paginateTemplatePages,
1471
+ rr as parseDateLocal,
1472
+ _n as parseReportCellFieldInput,
1473
+ at as parseReportCellInput,
1474
+ jn as parseReportClipboard,
1475
+ ca as parseReportDateRange,
1476
+ U as parseReportTemplate,
1477
+ Pn as planFontSizePx,
1478
+ _r as projectListColumns,
1479
+ W as ptToPx,
1480
+ dr as pxToMm,
1481
+ Ur as registerReportEditSession,
1482
+ Gr as relocateReportCellEdits,
1483
+ Oe as renderComponent,
1484
+ pt as renderPage,
1485
+ Rn as renderPlan,
1486
+ $n as renderPlanToCanvas,
1487
+ kn as renderPlanToCanvasAsync,
1488
+ An as renderPlanToImages,
1489
+ Wa as reportCellEditKey,
1490
+ q as reportOutputDiagnostics,
1491
+ ma as reportParamsJsonSchema,
1492
+ Ce as resolveBoxBorders,
1493
+ ar as resolveComponentBinding,
1452
1494
  _ as resolveFontSize,
1453
- Pe as resolveGridLayout,
1454
- Q as resolveLineHeight,
1495
+ Ne as resolveGridLayout,
1496
+ ne as resolveLineHeight,
1455
1497
  _e as resolvePaper,
1456
- ae as resolvePlanAssets,
1457
- j as resolveStroke,
1458
- Se as resolveTextColor,
1459
- jr as reviewReportTemplate,
1460
- H as round,
1461
- Kr as serializeReportTemplate,
1462
- Wr as summarizeReportCellEdits,
1463
- Kn as toExcelNumberFormat,
1464
- Xn as toNumber,
1465
- sr as validateComponent,
1466
- Ve as validateDatasetRows,
1467
- lr as validatePage,
1468
- cr as validateRenderPlan,
1469
- Wt as validateReportCellFieldDefinition,
1470
- si as validateReportParamDefinitions,
1471
- li as validateReportParams,
1472
- Ie as validateReportTemplate,
1473
- Xr as validateReportTemplateDocument,
1474
- hi as validateTreeOptions,
1475
- Re as wrapText
1498
+ me as resolvePlanAssets,
1499
+ ea as resolveReportDrillReturn,
1500
+ G as resolveStroke,
1501
+ Pe as resolveTextColor,
1502
+ wa as reviewReportTemplate,
1503
+ ba as reviewReportTemplateAsync,
1504
+ j as round,
1505
+ Mr as serializeReportTemplate,
1506
+ Ba as summarizeReportCellEdits,
1507
+ Ca as templatePathLocation,
1508
+ ir as toExcelNumberFormat,
1509
+ or as toNumber,
1510
+ yr as validateComponent,
1511
+ Xe as validateDatasetRows,
1512
+ vr as validatePage,
1513
+ Je as validateRenderPlan,
1514
+ Yt as validateReportCellFieldDefinition,
1515
+ ta as validateReportDrillActions,
1516
+ da as validateReportParamDefinitions,
1517
+ ha as validateReportParams,
1518
+ $e as validateReportTemplate,
1519
+ xr as validateReportTemplateDocument,
1520
+ Ga as validateTreeOptions,
1521
+ Ie as wrapText
1476
1522
  };