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