@agile-team/mach-report 2.13.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/README.md +20 -7
  2. package/THIRD_PARTY_NOTICES.md +3 -1
  3. package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
  4. package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
  5. package/dist/ParamEditor-Da4akw6V.cjs +1 -0
  6. package/dist/ParamEditor-DoAhzJsm.js +594 -0
  7. package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
  8. package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
  9. package/dist/ReportPreview-ChV19HBp.js +4619 -0
  10. package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
  11. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
  12. package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
  13. package/dist/RuleEditor-C_Clasvd.js +2037 -0
  14. package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
  16. package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
  17. package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
  18. package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
  19. package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
  20. package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
  21. package/dist/analytics.cjs +1 -1
  22. package/dist/analytics.d.cts +3 -1
  23. package/dist/analytics.d.ts +3 -1
  24. package/dist/analytics.js +154 -60
  25. package/dist/artifact-integrity.json +135 -0
  26. package/dist/assets-B9ImAi6_.cjs +1 -0
  27. package/dist/assets-DEaz4qsp.js +124 -0
  28. package/dist/batch-BaP6pWDE.cjs +1 -0
  29. package/dist/batch-BfZHN1do.js +220 -0
  30. package/dist/batch-CGyt-b2W.js +273 -0
  31. package/dist/batch-CLpELXBl.cjs +1 -0
  32. package/dist/capabilities-CAh2Nrue.cjs +1 -0
  33. package/dist/capabilities-DskCHs3V.js +69 -0
  34. package/dist/codes.d.cts +2 -0
  35. package/dist/codes.d.ts +2 -0
  36. package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
  37. package/dist/config-BVsJXSqS.js +842 -0
  38. package/dist/config-D10us76d.cjs +1 -0
  39. package/dist/data-explanation-B8MZRYVS.js +16 -0
  40. package/dist/data-explanation-DE55G30w.cjs +1 -0
  41. package/dist/designer-2bDlcNXQ.js +5136 -0
  42. package/dist/designer-BT7XCdbW.cjs +2 -0
  43. package/dist/designer.cjs +1 -2
  44. package/dist/designer.d.cts +432 -17
  45. package/dist/designer.d.ts +432 -17
  46. package/dist/designer.js +21 -4312
  47. package/dist/drill-ByJviLXS.js +145 -0
  48. package/dist/drill-DYTxuL3A.cjs +1 -0
  49. package/dist/font-loader-B_UkxpzC.cjs +1 -0
  50. package/dist/font-loader-Q3bQjmrI.js +297 -0
  51. package/dist/index.cjs +8 -8
  52. package/dist/index.d.cts +239 -5
  53. package/dist/index.d.ts +239 -5
  54. package/dist/index.js +939 -893
  55. package/dist/json-snapshot-DFb2eWkf.js +1416 -0
  56. package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
  57. package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
  58. package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
  59. package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
  60. package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
  61. package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
  62. package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
  63. package/dist/licenses/_types_node-14.18.63.txt +22 -0
  64. package/dist/licenses/_types_pako-2.0.3.txt +22 -0
  65. package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
  66. package/dist/licenses/archiver-5.3.2.txt +23 -0
  67. package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
  68. package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
  69. package/dist/licenses/async-3.2.6.txt +20 -0
  70. package/dist/licenses/balanced-match-1.0.2.txt +22 -0
  71. package/dist/licenses/base64-js-1.5.1.txt +22 -0
  72. package/dist/licenses/big-integer-1.6.52.txt +25 -0
  73. package/dist/licenses/binary-0.3.0.txt +178 -0
  74. package/dist/licenses/bl-4.1.0.txt +14 -0
  75. package/dist/licenses/bluebird-3.4.7.txt +22 -0
  76. package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
  77. package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
  78. package/dist/licenses/buffer-5.7.1.txt +22 -0
  79. package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
  80. package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
  81. package/dist/licenses/buffers-0.1.1.txt +140 -0
  82. package/dist/licenses/chainsaw-0.1.0.txt +184 -0
  83. package/dist/licenses/compress-commons-4.1.2.txt +23 -0
  84. package/dist/licenses/concat-map-0.0.1.txt +19 -0
  85. package/dist/licenses/core-util-is-1.0.3.txt +20 -0
  86. package/dist/licenses/crc-32-1.2.2.txt +202 -0
  87. package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
  88. package/dist/licenses/dayjs-1.11.23.txt +22 -0
  89. package/dist/licenses/duplexer2-0.1.4.txt +27 -0
  90. package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
  91. package/dist/licenses/exceljs-4.4.0.txt +23 -0
  92. package/dist/licenses/fast-csv-4.3.6.txt +22 -0
  93. package/dist/licenses/fast-png-6.4.0.txt +22 -0
  94. package/dist/licenses/fs-constants-1.0.0.txt +22 -0
  95. package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
  96. package/dist/licenses/fstream-1.0.12.txt +16 -0
  97. package/dist/licenses/glob-7.2.3.txt +22 -0
  98. package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
  99. package/dist/licenses/ieee754-1.2.1.txt +12 -0
  100. package/dist/licenses/immediate-3.0.6.txt +21 -0
  101. package/dist/licenses/inflight-1.0.6.txt +16 -0
  102. package/dist/licenses/inherits-2.0.4.txt +17 -0
  103. package/dist/licenses/iobuffer-5.4.0.txt +23 -0
  104. package/dist/licenses/isarray-1.0.0.txt +61 -0
  105. package/dist/licenses/jszip-3.10.2.txt +652 -0
  106. package/dist/licenses/lazystream-1.0.1.txt +24 -0
  107. package/dist/licenses/lie-3.3.0.txt +8 -0
  108. package/dist/licenses/listenercount-1.0.1.txt +6 -0
  109. package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
  110. package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
  111. package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
  112. package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
  113. package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
  114. package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
  115. package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
  116. package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
  117. package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
  118. package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
  119. package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
  120. package/dist/licenses/lodash.union-4.6.0.txt +48 -0
  121. package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
  122. package/dist/licenses/minimatch-3.1.5.txt +16 -0
  123. package/dist/licenses/minimatch-5.1.9.txt +16 -0
  124. package/dist/licenses/minimist-1.2.8.txt +19 -0
  125. package/dist/licenses/mkdirp-0.5.6.txt +22 -0
  126. package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
  127. package/dist/licenses/normalize-path-3.0.0.txt +22 -0
  128. package/dist/licenses/once-1.4.0.txt +16 -0
  129. package/dist/licenses/pako-1.0.11.txt +22 -0
  130. package/dist/licenses/pako-2.2.0.txt +22 -0
  131. package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
  132. package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
  133. package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
  134. package/dist/licenses/readable-stream-2.3.8.txt +48 -0
  135. package/dist/licenses/readable-stream-3.6.2.txt +48 -0
  136. package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
  137. package/dist/licenses/rimraf-2.7.1.txt +16 -0
  138. package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
  139. package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
  140. package/dist/licenses/saxes-5.0.1.txt +397 -0
  141. package/dist/licenses/setimmediate-1.0.5.txt +21 -0
  142. package/dist/licenses/string_decoder-1.1.1.txt +49 -0
  143. package/dist/licenses/string_decoder-1.3.0.txt +49 -0
  144. package/dist/licenses/tar-stream-2.2.0.txt +22 -0
  145. package/dist/licenses/tmp-0.2.7.txt +22 -0
  146. package/dist/licenses/traverse-0.3.9.txt +25 -0
  147. package/dist/licenses/tslib-1.14.1.txt +13 -0
  148. package/dist/licenses/unzipper-0.10.14.txt +26 -0
  149. package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
  150. package/dist/licenses/uuid-11.1.1.txt +10 -0
  151. package/dist/licenses/wrappy-1.0.2.txt +16 -0
  152. package/dist/licenses/xmlchars-2.2.0.txt +19 -0
  153. package/dist/licenses/zip-stream-4.1.1.txt +23 -0
  154. package/dist/matrix-CGRGkn5s.js +112 -0
  155. package/dist/matrix-gEO7ZM_u.cjs +1 -0
  156. package/dist/media-B7vnpD8k.cjs +1 -0
  157. package/dist/media-Y90dHK9z.js +70 -0
  158. package/dist/param-validation-C3HlcLLO.cjs +1 -0
  159. package/dist/param-validation-Do7Eg8Zv.js +181 -0
  160. package/dist/pdf-BwNyeGpt.js +36352 -0
  161. package/dist/pdf-CvvrjPQg.cjs +103 -0
  162. package/dist/pdf.cjs +1 -101
  163. package/dist/pdf.d.cts +18 -3
  164. package/dist/pdf.d.ts +18 -3
  165. package/dist/pdf.js +9 -36579
  166. package/dist/plugin-Ca_XZG3l.js +22 -0
  167. package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
  168. package/dist/prepared-CFy9B75C.cjs +1 -0
  169. package/dist/prepared-ajM-H-9B.js +69 -0
  170. package/dist/progress-B0ctFpKf.cjs +1 -0
  171. package/dist/progress-D-OTpEav.js +52 -0
  172. package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
  173. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
  174. package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
  175. package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
  176. package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
  177. package/dist/sbom.cdx.json +3982 -0
  178. package/dist/server/node.d.cts +66 -12
  179. package/dist/server/node.d.ts +66 -12
  180. package/dist/server-node.cjs +1 -1
  181. package/dist/server-node.js +405 -381
  182. package/dist/server.cjs +1 -1
  183. package/dist/server.d.cts +878 -15
  184. package/dist/server.d.ts +878 -15
  185. package/dist/server.js +1034 -534
  186. package/dist/sha256-ArEYjaTI.cjs +1 -0
  187. package/dist/sha256-DPEuJ3nh.js +155 -0
  188. package/dist/style.css +1 -1
  189. package/dist/template-bindings-C2SpvsMU.js +58 -0
  190. package/dist/template-bindings-CEtWyiLX.cjs +1 -0
  191. package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
  192. package/dist/template-catalog-j2B1MJlL.js +414 -0
  193. package/dist/template-fragments-BGbQLGlV.js +187 -0
  194. package/dist/template-fragments-DcKeiylI.cjs +1 -0
  195. package/dist/template-outline-BwRV_eRo.cjs +1 -0
  196. package/dist/template-outline-cnWfT_LK.js +88 -0
  197. package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
  198. package/dist/template-registry-Co1zPq5e.cjs +1 -0
  199. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  200. package/dist/textwrap-DE1kgcJB.js +110 -0
  201. package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
  202. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  203. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  204. package/dist/vue/async.d.cts +190 -15
  205. package/dist/vue/async.d.ts +190 -15
  206. package/dist/vue/index.d.cts +274 -24
  207. package/dist/vue/index.d.ts +274 -24
  208. package/dist/vue-async.cjs +1 -1
  209. package/dist/vue-async.js +5 -5
  210. package/dist/vue.cjs +1 -1
  211. package/dist/vue.js +90 -81
  212. package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
  213. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
  214. package/dist/worker.cjs +1 -1
  215. package/dist/worker.d.cts +66 -12
  216. package/dist/worker.d.ts +66 -12
  217. package/dist/worker.js +61 -56
  218. package/dist/xlsx-node.cjs +34 -34
  219. package/dist/xlsx-node.js +878 -870
  220. package/dist/xlsx.cjs +3 -4
  221. package/dist/xlsx.d.cts +22 -10
  222. package/dist/xlsx.d.ts +22 -10
  223. package/dist/xlsx.js +261 -253
  224. package/package.json +2 -2
  225. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  226. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  227. package/dist/ParamEditor-BLaE5q5W.js +0 -522
  228. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  229. package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
  230. package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
  231. package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
  232. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  233. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  234. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  235. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  236. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  237. package/dist/assets-C2U-e-Sz.cjs +0 -4
  238. package/dist/assets-Q0wUwNrV.js +0 -217
  239. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  240. package/dist/batch-mRqhhhjt.js +0 -364
  241. package/dist/capabilities-CK_7hizc.js +0 -63
  242. package/dist/capabilities-CsZ-pNHR.cjs +0 -1
  243. package/dist/config-Bb7RiIO5.cjs +0 -1
  244. package/dist/config-XVwG87IA.js +0 -529
  245. package/dist/matrix-DVyWiYsd.cjs +0 -1
  246. package/dist/matrix-yZsGnldA.js +0 -227
  247. package/dist/page-window-index-CIuT4BAv.js +0 -43
  248. package/dist/page-window-index-DEjnM6IB.cjs +0 -1
  249. package/dist/param-validation-BlHHXs6u.js +0 -153
  250. package/dist/param-validation-DCK039V1.cjs +0 -1
  251. package/dist/plugin-D4wizDXB.js +0 -22
  252. package/dist/progress-7OSZbFok.js +0 -39
  253. package/dist/progress-BnLiS5eH.cjs +0 -1
  254. package/dist/task-events-DQ276fn2.cjs +0 -1
  255. package/dist/task-events-Dpsvf_t2.js +0 -47
  256. package/dist/template-registry-D3SjENi6.cjs +0 -1
  257. package/dist/template-review-DGwWOoCv.cjs +0 -2
  258. package/dist/template-review-PgEe_Wr9.js +0 -1742
  259. package/dist/validate-BJ5HIWY8.cjs +0 -1
  260. package/dist/validate-DbgEM1Hh.js +0 -163
@@ -152,7 +152,7 @@ export declare function createChartComponents(options: ReportChartOptions): Plan
152
152
  /** 通用交叉聚合;合计直接累计原始度量,平均值不会错误地平均各分组合计。 */
153
153
  export declare function createCrossTable(input: readonly Record<string, unknown>[], options: CrossTableOptions): CrossTableResult;
154
154
 
155
- /** Multi-dimension/multi-measure pivot; each total aggregates original rows, never averages averages. */
155
+ /** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
156
156
  export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): CrossTableResult;
157
157
 
158
158
  export declare interface CrossTableOptions {
@@ -406,6 +406,8 @@ export declare function printDecimal(value: DecimalValue, digits?: number): stri
406
406
 
407
407
  /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
408
408
  declare interface ReportCellSource {
409
+ /** Source identity across report occurrences; sharing must be explicitly declared. */
410
+ sourceScope?: string;
409
411
  datasetId: string;
410
412
  rowKey: string | number;
411
413
  field: string;
@@ -152,7 +152,7 @@ export declare function createChartComponents(options: ReportChartOptions): Plan
152
152
  /** 通用交叉聚合;合计直接累计原始度量,平均值不会错误地平均各分组合计。 */
153
153
  export declare function createCrossTable(input: readonly Record<string, unknown>[], options: CrossTableOptions): CrossTableResult;
154
154
 
155
- /** Multi-dimension/multi-measure pivot; each total aggregates original rows, never averages averages. */
155
+ /** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
156
156
  export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): CrossTableResult;
157
157
 
158
158
  export declare interface CrossTableOptions {
@@ -406,6 +406,8 @@ export declare function printDecimal(value: DecimalValue, digits?: number): stri
406
406
 
407
407
  /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
408
408
  declare interface ReportCellSource {
409
+ /** Source identity across report occurrences; sharing must be explicitly declared. */
410
+ sourceScope?: string;
409
411
  datasetId: string;
410
412
  rowKey: string | number;
411
413
  field: string;
package/dist/analytics.js CHANGED
@@ -1,90 +1,184 @@
1
- import { a as A, b as S, c as z, d as F, e as N, f as R, g as T, h as W, i as B, m as G, p as L, j as O, v as P } from "./computed-Bvk0W15F.js";
2
- import { c as j, a as V, e as q, v as H } from "./matrix-yZsGnldA.js";
3
- const o = ["#2563eb", "#0d9488", "#d97706", "#7c3aed", "#dc2626", "#0284c7"];
4
- function w(e) {
1
+ import { c as v } from "./computed-C-4C2S5h.js";
2
+ import { a as W, b as B, d as G, e as H, f as I, g as J, h as V, i as q, m as K, p as Q, j as U, v as X } from "./computed-C-4C2S5h.js";
3
+ import { a as F } from "./matrix-CGRGkn5s.js";
4
+ import { c as Z, e as _, v as p } from "./matrix-CGRGkn5s.js";
5
+ const M = ["#2563eb", "#0d9488", "#d97706", "#7c3aed", "#dc2626", "#0284c7"];
6
+ function C(e) {
5
7
  if (e.type !== "bar" && e.type !== "line") throw new Error("图表 type 应为 bar 或 line");
6
8
  if (!Array.isArray(e.categories) || !Array.isArray(e.series) || !e.categories.length || e.categories.length > 200 || !e.series.length || e.series.length > 12) throw new Error("图表支持 1–200 个分类、1–12 个系列;大数据应先聚合");
7
9
  if (e.categories.some((t) => typeof t != "string")) throw new Error("图表分类应为字符串");
8
- b(e);
9
- for (const t of e.series) y(t, e.categories.length);
10
+ A(e);
11
+ for (const t of e.series) R(t, e.categories.length);
10
12
  }
11
- function b(e) {
13
+ function A(e) {
12
14
  for (const t of ["leftMm", "topMm", "widthMm", "heightMm"])
13
15
  if (!Number.isFinite(e[t]) || e[t] < 0) throw new Error(`${t} 应为有限非负数`);
14
16
  if (e.widthMm < 45 || e.heightMm < 35) throw new Error("图表至少需要 45×35mm");
15
17
  if (!Number.isFinite(e.leftMm + e.widthMm) || !Number.isFinite(e.topMm + e.heightMm)) throw new Error("图表几何范围溢出");
16
18
  }
17
- function y(e, t) {
19
+ function R(e, t) {
18
20
  if (!e || typeof e.name != "string" || !Array.isArray(e.values) || e.values.length !== t || e.values.some((r) => r !== null && !Number.isFinite(r))) throw new Error("图表系列应提供名称及逐分类的有限数字或 null");
19
21
  if (e.color !== void 0 && !/^#[\da-f]{6}$/i.test(e.color)) throw new Error("图表颜色应为 #RRGGBB");
20
22
  }
21
- function u(e, t, r, c, h, a = 0.8) {
22
- return { kind: "line", leftMm: Math.min(e, r), topMm: Math.min(t, c), widthMm: Math.abs(r - e), heightMm: Math.abs(c - t), lineDirection: c < t ? "up" : "down", style: { lineColor: h, lineWidthPt: a } };
23
+ function b(e, t, r, n, i, c = 0.8) {
24
+ return { kind: "line", leftMm: Math.min(e, r), topMm: Math.min(t, n), widthMm: Math.abs(r - e), heightMm: Math.abs(n - t), lineDirection: n < t ? "up" : "down", style: { lineColor: i, lineWidthPt: c } };
23
25
  }
24
- function M(e, t, r, c, h = "center") {
25
- return { kind: "text", text: e, leftMm: t, topMm: r, widthMm: c, heightMm: 5, style: { fontSize: 8, color: "#475569", align: h, verticalAlign: "middle" } };
26
+ function d(e, t, r, n, i = "center") {
27
+ return { kind: "text", text: e, leftMm: t, topMm: r, widthMm: n, heightMm: 5, style: { fontSize: 8, color: "#475569", align: i, verticalAlign: "middle" } };
26
28
  }
27
- function d(e) {
29
+ function x(e) {
28
30
  return Number(e.toPrecision(5)).toString();
29
31
  }
30
- function v(e) {
32
+ function D(e) {
31
33
  let t = 0, r = 0;
32
- for (const f of e.series) for (const n of f.values) n !== null && (t = Math.min(t, n), r = Math.max(r, n));
34
+ for (const f of e.series) for (const h of f.values) h !== null && (t = Math.min(t, h), r = Math.max(r, h));
33
35
  t === r && (r = t + 1);
34
- const c = e.leftMm + 13, h = e.topMm + 8, a = e.widthMm - 17, i = e.heightMm - 23, m = Math.max(Math.abs(t), Math.abs(r), 1), l = t / m, g = r / m - l;
35
- return { left: c, top: h, width: a, height: i, min: t, max: r, y: (f) => h + i * (1 - (f / m - l) / g) };
36
+ const n = e.leftMm + 13, i = e.topMm + 8, c = e.widthMm - 17, l = e.heightMm - 23, s = Math.max(Math.abs(t), Math.abs(r), 1), m = t / s, u = r / s - m;
37
+ return { left: n, top: i, width: c, height: l, min: t, max: r, y: (f) => i + l * (1 - (f / s - m) / u) };
36
38
  }
37
- function x(e, t) {
39
+ function L(e, t) {
38
40
  const r = [];
39
- e.title && r.push({ ...M(e.title, e.leftMm, e.topMm, e.widthMm), style: { fontSize: 10, bold: !0, align: "left" } });
40
- for (let a = 0; a <= 4; a++) {
41
- const i = a / 4, m = t.min * (1 - i) + t.max * i, l = t.y(m);
42
- r.push(u(t.left, l, t.left + t.width, l, "#e2e8f0", 0.4), M(d(m), e.leftMm, l - 2.5, 11, "right"));
41
+ e.title && r.push({ ...d(e.title, e.leftMm, e.topMm, e.widthMm), style: { fontSize: 10, bold: !0, align: "left" } });
42
+ for (let c = 0; c <= 4; c++) {
43
+ const l = c / 4, s = t.min * (1 - l) + t.max * l, m = t.y(s);
44
+ r.push(b(t.left, m, t.left + t.width, m, "#e2e8f0", 0.4), d(x(s), e.leftMm, m - 2.5, 11, "right"));
43
45
  }
44
- r.push(u(t.left, t.top, t.left, t.top + t.height, "#94a3b8"));
45
- const c = Math.max(1, Math.ceil(e.categories.length / Math.max(1, Math.floor(t.width / 14))));
46
- e.categories.forEach((a, i) => {
47
- i % c === 0 && r.push(M(a, t.left + (i + 0.5) * t.width / e.categories.length - 7, t.top + t.height + 1, 14));
46
+ r.push(b(t.left, t.top, t.left, t.top + t.height, "#94a3b8"));
47
+ const n = Math.max(1, Math.ceil(e.categories.length / Math.max(1, Math.floor(t.width / 14))));
48
+ e.categories.forEach((c, l) => {
49
+ l % n === 0 && r.push(d(c, t.left + (l + 0.5) * t.width / e.categories.length - 7, t.top + t.height + 1, 14));
48
50
  });
49
- const h = t.width / e.series.length;
50
- return e.series.forEach((a, i) => {
51
- r.push({ ...M(a.name, t.left + i * h, e.topMm + e.heightMm - 5, h), style: { fontSize: 8, color: a.color ?? o[i % o.length], align: "center" } });
51
+ const i = t.width / e.series.length;
52
+ return e.series.forEach((c, l) => {
53
+ r.push({ ...d(c.name, t.left + l * i, e.topMm + e.heightMm - 5, i), style: { fontSize: 8, color: c.color ?? M[l % M.length], align: "center" } });
52
54
  }), r;
53
55
  }
54
- function k(e, t, r, c) {
55
- const h = [], a = r.color ?? o[c % o.length], i = t.width / e.categories.length, m = i * 0.75 / e.series.length;
56
- let l;
57
- return r.values.forEach((g, f) => {
58
- if (g === null) {
59
- l = void 0;
56
+ function N(e, t, r, n) {
57
+ const i = [], c = r.color ?? M[n % M.length], l = t.width / e.categories.length, s = l * 0.75 / e.series.length;
58
+ let m;
59
+ return r.values.forEach((u, f) => {
60
+ if (u === null) {
61
+ m = void 0;
60
62
  return;
61
63
  }
62
- const n = t.left + (f + 0.5) * i, s = t.y(g);
63
- e.type === "bar" ? h.push({ kind: "rect", leftMm: t.left + f * i + i * 0.125 + c * m, topMm: Math.min(s, t.y(0)), widthMm: m, heightMm: Math.abs(t.y(0) - s), style: { backgroundColor: a, borderTop: !1, borderRight: !1, borderBottom: !1, borderLeft: !1 } }) : (l && h.push(u(l.x, l.y, n, s, a, 1.2)), h.push({ kind: "ellipse", leftMm: n - 0.7, topMm: s - 0.7, widthMm: 1.4, heightMm: 1.4, style: { backgroundColor: a, borderColor: a } }), l = { x: n, y: s }), e.showValues && h.push({ ...M(d(g), n - i / 2, Math.max(t.top, s - 5), i), style: { fontSize: 7, color: a, align: "center" } });
64
- }), h;
64
+ const h = t.left + (f + 0.5) * l, a = t.y(u);
65
+ e.type === "bar" ? i.push({ kind: "rect", leftMm: t.left + f * l + l * 0.125 + n * s, topMm: Math.min(a, t.y(0)), widthMm: s, heightMm: Math.abs(t.y(0) - a), style: { backgroundColor: c, borderTop: !1, borderRight: !1, borderBottom: !1, borderLeft: !1 } }) : (m && i.push(b(m.x, m.y, h, a, c, 1.2)), i.push({ kind: "ellipse", leftMm: h - 0.7, topMm: a - 0.7, widthMm: 1.4, heightMm: 1.4, style: { backgroundColor: c, borderColor: c } }), m = { x: h, y: a }), e.showValues && i.push({ ...d(x(u), h - l / 2, Math.max(t.top, a - 5), l), style: { fontSize: 7, color: c, align: "center" } });
66
+ }), i;
65
67
  }
66
- function C(e) {
67
- w(e);
68
- const t = v(e);
69
- return [...x(e, t), ...e.series.flatMap((r, c) => k(e, t, r, c))];
68
+ function T(e) {
69
+ C(e);
70
+ const t = D(e);
71
+ return [...L(e, t), ...e.series.flatMap((r, n) => N(e, t, r, n))];
72
+ }
73
+ function g(e, t) {
74
+ return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
75
+ }
76
+ function y(e) {
77
+ if (e == null) return "null";
78
+ if (typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e)))
79
+ throw new Error("交叉表维度应为字符串、布尔、有限数字或空值");
80
+ return JSON.stringify([typeof e, e]);
81
+ }
82
+ function E(e) {
83
+ return e == null ? "" : String(e);
84
+ }
85
+ function w(e, t) {
86
+ const r = e ?? t;
87
+ if (!Number.isInteger(r) || r < 1)
88
+ throw new Error("交叉表预算应为正整数");
89
+ return r;
90
+ }
91
+ function O(e, t, r, n) {
92
+ const i = r ? 1 : 0;
93
+ if ((e + i) * (t + 1 + i) > n)
94
+ throw new Error(
95
+ "交叉表输出单元格超出 maxCells 预算,请减少维度或服务端预聚合"
96
+ );
97
+ }
98
+ function $(e, t) {
99
+ if (!Array.isArray(e)) throw new Error("交叉表数据应为对象数组");
100
+ const r = t.aggregate ?? "sum";
101
+ if (!["sum", "count", "avg", "min", "max", "weightedAvg"].includes(r))
102
+ throw new Error("未知交叉表聚合类型");
103
+ if (!t.rowField || !t.columnField || r !== "count" && !t.valueField)
104
+ throw new Error("交叉表需要明确的行维度、列维度和度量字段");
105
+ if (e.length > w(t.maxInputRows, 1e5))
106
+ throw new Error("交叉表输入超出预算,请在服务端预聚合");
107
+ const n = w(t.maxRows, 1e3), i = w(t.maxColumns, 200), c = w(t.maxCells, 2e6), l = {
108
+ op: r,
109
+ field: r === "count" && t.countMode !== "nonNull" ? void 0 : t.valueField,
110
+ weightField: t.weightField,
111
+ numeric: t.numeric,
112
+ digits: t.digits
113
+ };
114
+ v(l);
115
+ const { groups: s, columns: m, columnTotals: u, totals: f } = F(e, {
116
+ row: (a) => ({ key: y(g(a, t.rowField)), label: E(g(a, t.rowField)) }),
117
+ column: (a) => ({ key: y(g(a, t.columnField)), label: E(g(a, t.columnField)) }),
118
+ measures: [l],
119
+ totals: t.totals,
120
+ check: (a, o) => {
121
+ if (a > n || o > i) throw new Error("交叉表维度数量超出预算");
122
+ O(a, o, t.totals, c);
123
+ }
124
+ }), h = {
125
+ columns: [
126
+ {
127
+ header: t.rowHeader ?? t.rowField,
128
+ field: "rowLabel",
129
+ semanticRole: "dimension"
130
+ },
131
+ ...[...m.values()].map(
132
+ (a, o) => ({
133
+ header: a,
134
+ field: `c${o}`,
135
+ semanticRole: "measure"
136
+ })
137
+ )
138
+ ],
139
+ rows: [...s.values()].map((a) => ({
140
+ rowLabel: a.label,
141
+ ...Object.fromEntries(
142
+ [...m.keys()].map((o, k) => [
143
+ `c${k}`,
144
+ a.cells.get(o)?.[0]?.value() ?? (r === "count" ? 0 : null)
145
+ ])
146
+ ),
147
+ ...t.totals ? { total: a.totals[0].value() } : {}
148
+ }))
149
+ };
150
+ return t.totals && (h.columns.push({
151
+ header: "合计",
152
+ field: "total",
153
+ semanticRole: "measure"
154
+ }), e.length && h.rows.push({
155
+ rowLabel: "合计",
156
+ ...Object.fromEntries(
157
+ [...m.keys()].map((a, o) => [
158
+ `c${o}`,
159
+ u.get(a)?.[0]?.value() ?? (r === "count" ? 0 : null)
160
+ ])
161
+ ),
162
+ total: f[0].value()
163
+ })), h;
70
164
  }
71
165
  export {
72
- A as addDecimal,
73
- S as aggregateRows,
74
- z as compareDecimal,
75
- F as computeDataset,
76
- N as createAggregateAccumulator,
77
- C as createChartComponents,
78
- j as createCrossTable,
79
- V as createMatrixTable,
80
- R as decimalDigits,
81
- T as divideDecimal,
82
- q as estimateMatrixTable,
83
- W as formatDecimal,
84
- B as getComputationMetadata,
85
- G as multiplyDecimal,
86
- L as parseDecimal,
87
- O as printDecimal,
88
- P as validateComputedFields,
89
- H as validateMatrixOptions
166
+ W as addDecimal,
167
+ B as aggregateRows,
168
+ G as compareDecimal,
169
+ H as computeDataset,
170
+ v as createAggregateAccumulator,
171
+ T as createChartComponents,
172
+ $ as createCrossTable,
173
+ Z as createMatrixTable,
174
+ I as decimalDigits,
175
+ J as divideDecimal,
176
+ _ as estimateMatrixTable,
177
+ V as formatDecimal,
178
+ q as getComputationMetadata,
179
+ K as multiplyDecimal,
180
+ Q as parseDecimal,
181
+ U as printDecimal,
182
+ X as validateComputedFields,
183
+ p as validateMatrixOptions
90
184
  };
@@ -0,0 +1,135 @@
1
+ {
2
+ "version": "2.15.0",
3
+ "algorithm": "sha256",
4
+ "files": {
5
+ "ExcelBindingWizard-BKH1nGNS.js": "c0b2ac7c91cfe52d2526895c0e5bb742bb7ce7c66f863d4f97b361fd31640e12",
6
+ "ExcelBindingWizard-Bs43BGNp.cjs": "ae0d966d20cdeb40e99005bd1c8bdbfa3784e3b5bfd299c3c916a9fc28931041",
7
+ "ParamEditor-Da4akw6V.cjs": "30330bf3d2643b6e640f7ddb0ec5d15e5398998d1534758b96558f1173b3c1c4",
8
+ "ParamEditor-DoAhzJsm.js": "5a3fef8f755469693ed2c231efd1f5ab9ab2c7029ce921f1fd29461c125f92d1",
9
+ "ReportBatchPanel-BMf6boMA.js": "c9de2d6e17bd0f0e301f561a6cc138c7ae53d2689d2707a0391772ca65cdd971",
10
+ "ReportBatchPanel-wP9m9Pj1.cjs": "c69ba9b1f4688e21e6ff11019bbeda4cbece0ff268a7ece8c1968b940fa32772",
11
+ "ReportPreview-ChV19HBp.js": "0798c40992f7c1507e60eb508b404806051eb2ee557fdb4b6380db04390bf19d",
12
+ "ReportPreview-DbLvvOUT.cjs": "cc4a36464df17c42bb83b55d0f4101230729cba4f4be8fda1f7542ae8196fc44",
13
+ "ReportTemplateLibrary-C9wutIiT.js": "824ff86e1a348ae8a0f3690213c04feee3bbbf4ac4ab5f90db34a84d02db023a",
14
+ "ReportTemplateLibrary-Sxr3eD0J.cjs": "14941edc6e4039a90640a62149cab4dfdd77d98d4b88061fe492d8ec6add2c24",
15
+ "RuleEditor-C_Clasvd.js": "990be121efea7fc70e1463fafe60353843a62a141f6a6989024a14928924ecef",
16
+ "RuleEditor-XhGHK8DE.cjs": "5ce41f04cc264ad355dec39deee8204733b6b8f623d179c18f014bc552930ad4",
17
+ "TemplateOutlinePanel-D6Bkny59.js": "b190187efd4536200805e0b4a2091f89912bbf047b3e388f3f814d7e02a4324f",
18
+ "TemplateOutlinePanel-JTSR53vJ.cjs": "c5a76e57d16192acae3e6aae6032c20c4d808050d568a106743eceaeebbd554c",
19
+ "TemplateReusePanel-Kx35S0Ql.cjs": "3d63b982380298233ff7100de1d561facd35470a4578d5c9d1872f55541f9ea4",
20
+ "TemplateReusePanel-rVuK1kTz.js": "3befc58f74566e3149dc71e7e14fee8f9e3dda6dbd7d092a45578ead36eb9a03",
21
+ "TemplateReviewPanel-B0ar9_zf.js": "cb893e6d378b5bc754f0f3ed0aa00b32af4b70513316d2364b9d3f4425ebe3db",
22
+ "TemplateReviewPanel-Dn6X9UmY.cjs": "7a35240d3e33803faf0771a28701419e62d0391ce18022a7d20d9aadccc42167",
23
+ "_commonjsHelpers-DKOUU3wS.cjs": "9fb4a8db4e3ab1aba23d44b6965615369004c05bfb5a323027ab5191080340d4",
24
+ "_commonjsHelpers-DaMA6jEr.js": "6d52e5d0f36d01714a54c94e082101e88ddce58c7189eeca8f2abc012a7cea12",
25
+ "_plugin-vue_export-helper-8SL1F89S.js": "233ffd200e30e23b8dad3eaee11bc8ef37724bf79606de66035c07f92dc5bd3d",
26
+ "_plugin-vue_export-helper-BLmdZLlg.cjs": "f7b5ccf7b4a1d92229cd7906bb614a43b84e50d340e80a509d64ac9a7b0b172d",
27
+ "analytics.cjs": "47659796d79cead758241fba2248cd138aee50e6ce53af688537cfbe403c1a98",
28
+ "analytics.js": "a777e2720a6d6687f699f7214b22e2835cee9383dd692bc1786148773bc6230b",
29
+ "assets-B9ImAi6_.cjs": "89e28147290a5b0f6091ce8089df5f7486fa3b26be55c4d9d6577e9d53639158",
30
+ "assets-DEaz4qsp.js": "04b013bae5a3d7ac7d090e3feb64e3b19be9cd37bba20fd9dc6f9886d8d979f3",
31
+ "batch-BaP6pWDE.cjs": "f800d14486f6056e67081e3ff9a04bfb0c8736d123bbd7c5f432eddc55e2ffa6",
32
+ "batch-BfZHN1do.js": "e2fb4375284e996b5673b4393acc9389196f9cfd331f4b2d5167036c246ab844",
33
+ "batch-CGyt-b2W.js": "513164b2f553bfaefb1e61d985ba1d8757a91a86e2b7273e06650f32e36a515c",
34
+ "batch-CLpELXBl.cjs": "de678fbf54209f36b959961ce78d7d8db2ce398d21222790c819ceae344e0f7b",
35
+ "capabilities-CAh2Nrue.cjs": "211cab7f9670f25d9f2280c306732b1fba6fb7e101c1e88195b80968eb822b31",
36
+ "capabilities-DskCHs3V.js": "c865b4ca8ea70817410466c24ee6bebd46ced78be093a80a33746574169a0032",
37
+ "code-options-BKXXY7NI.js": "67696253b923c214c5b628f86c65968d4de6e0812cb142bdb043806be6158038",
38
+ "code-options-BUTChiZZ.cjs": "19e0f584437bbc31c39a662e20ae288c32b6e27db7f0fd9a79fd8c2465673011",
39
+ "codes.cjs": "3edcb3b0418ab0b3ef2875ff4486cf3ed2c2763afee3bc50073998aa66d2109d",
40
+ "codes.js": "38e33033b1eaedc91330385891a39c052b4a226691dd48f6f192eb6bb64b4aab",
41
+ "computed-C-4C2S5h.js": "4bf37be1ff522d7751545434d1a0da8ea2971f88377edbac5833cfcbacb2f1df",
42
+ "computed-CGV2a809.cjs": "c9d9b8057d1e7cfa7cc5ca50b5c1daa8f4c2d4106c3be9275b5eb390ff17d8ea",
43
+ "config-BVsJXSqS.js": "b1084ac95aca8e5af13c88073d4e08322eb3f28579c79625369592d95d16ed04",
44
+ "config-D10us76d.cjs": "87393d0cab147b9a0cbc5af7896c83fd2331f83bb6dce0336799e0fa9f8a66ed",
45
+ "data-explanation-B8MZRYVS.js": "b64c128424c5c7f83c327bc65a83b60b81fc11dd3325d45e7c5785ad7fdf8eec",
46
+ "data-explanation-DE55G30w.cjs": "7b2e010ca1904759e02edc6b48ed03d1282572c6f5784441f78b2c13c3b9febc",
47
+ "dataset-BkRmwgeJ.cjs": "d75b78799113b23e5caf76d45e2a0686013a12f8e090b43aed27bc580901797a",
48
+ "dataset-H5pFuQGU.js": "d9c6df9fb2e4cb1f5dff027025ffc2e64494cfcd3202c731979371169148bad9",
49
+ "defaults-DXhiM1ZD.js": "a11281ca53f59075046485ad8d4b12dc676a1184776394ebb0a2cae819c9c2f8",
50
+ "defaults-xhmcLLrf.cjs": "c44735c94e55039c6c524b627029ec2c404e082a3e98aeaff94713924e745a41",
51
+ "designer-2bDlcNXQ.js": "e0f59bc7264476961cac8ea6bc7ba39d49fef38b67a5d8a34f92e06687eb2b08",
52
+ "designer-BT7XCdbW.cjs": "a2341c543c39fd4e4717b2b3bcb7209064c3c1cb5a259a14a9d5760e338bc194",
53
+ "designer.cjs": "8c4489997556ef0363bbbf2caa878ea4d0c6063d02fec6cb314576fb200cd2d8",
54
+ "designer.js": "9db0e3a32e0a00f9dc94184a3beb4a1386215686f5114a5a2a0f988ac3de9380",
55
+ "drill-ByJviLXS.js": "5ca637aefaffa5f36f2b99f58019d8b1ba91e61d3d418c2deddd63d0a3e35ce5",
56
+ "drill-DYTxuL3A.cjs": "986ba89a46234fdc5589ae96af6e826a23b9fef8991c32cfddf4410bfa19d1e4",
57
+ "font-loader-B_UkxpzC.cjs": "57dc350e45e64ba35b774b79a11264d5003be5aa0064f7c425376ac29eb0a541",
58
+ "font-loader-Q3bQjmrI.js": "ec844d311e08dbe3b395694e257fa9184e35cf8195942a4af570720ba4524f4a",
59
+ "grid-geometry-BNptEcMm.js": "180cc0308e198cde7e18018adf0471053fb72e9ac54abb26970fc6e4d480de6f",
60
+ "grid-geometry-CZ_cYB6O.cjs": "40affa6f5912a038b19c16e9371be139fe681c344ed3fd11d19e330feac682bf",
61
+ "grid-strokes-Cr7DwUux.cjs": "72b5e29a276efe5fca8a642c660a7490525d4470419e83abc4dd1be4ec1e7734",
62
+ "grid-strokes-DyyG1q_o.js": "a967a38f557b43a04eeead17059a8758b65e80b49b87dc05d299a27b915f6871",
63
+ "index.cjs": "5a428078eb0621808c6b50f2f6a58558c95ed204b697ee26d7434a1079ba1df6",
64
+ "index.js": "50158f989aabdfcf61cc655a10768a2cb270513f1ae44d02349aee36f0a30b33",
65
+ "injection-keys-Db_DyLkm.cjs": "0d656460efa0c48f6153aae745dd61a7907128938d98b358b5b6d413db5ec4ed",
66
+ "injection-keys-e85udZCp.js": "101e96fc627b33003ba295d281e7f7bfb2c077300556b2bf039cb1938e36f582",
67
+ "json-snapshot-DFb2eWkf.js": "c6adbd29621f0b69184a22f097c5543dbf872ce9052ad003bf4b9e1a1561e2cf",
68
+ "json-snapshot-WWSGlaHG.cjs": "8098d8bd5e85fd3dc326b8c62920496aa48ff42653a12021ab0bd9a5d2434f98",
69
+ "matrix-CGRGkn5s.js": "71db4bb0c563f1e101f8e9cde245ae37191f927f9c5d2346e6378b9e4dd907c2",
70
+ "matrix-gEO7ZM_u.cjs": "3c19aaff2d811ed7a816ee0b5d1dab38b4039528f21f98aeead2304cbd33e5ac",
71
+ "media-B7vnpD8k.cjs": "c667063f9745af571f35561ec272496f0e3d7b7d4ee003a823003337155497d9",
72
+ "media-Y90dHK9z.js": "5cefe7f0b0b6cd6e921af27b107f17c076479a8977bcb8ed4c84dc60e7af8408",
73
+ "number-format-BA_KwrZe.js": "0d508920bb83987e7bb73ebb1dcf985b06dde043b036e65c9907247e40ec1575",
74
+ "number-format-CZ2T_5kF.cjs": "bfbf7b30ddf4d27c80917f17c6609cb3a339436fc0a3d7a643ba5ac8faae0aec",
75
+ "param-validation-C3HlcLLO.cjs": "fe838546c8dd593a2e67a99e7d42bf4d0d24f3d7db74377f5ac1026c9d3153af",
76
+ "param-validation-Do7Eg8Zv.js": "3df7551a459a8f338f80431451913da39f156f7573a23ca5c951b03cd948fbc4",
77
+ "pdf-BwNyeGpt.js": "4c5f83f4700cf905dcb1a9827646ba3ef8f83b8e9eff44dda4a03a7c69bb55e9",
78
+ "pdf-CvvrjPQg.cjs": "3328fd2277e2554cc769af9b2909de22a60e16b0f9f7835631860105665c5d37",
79
+ "pdf.cjs": "4fbf7a24561989a47097eb189950f0db235b3e5c01f47ef3b7f90fe064fd5ff3",
80
+ "pdf.js": "ca60f65e2492c154a63553ee056343cd50dd146c2fd60561f6231193de72a13b",
81
+ "plugin-Ca_XZG3l.js": "d91f1f927600479cf9ec076a0f1108124e4be9a13fc94e2e9c26416ef0beee2f",
82
+ "plugin-DHO7X8z2.cjs": "5a5268133e6a202099fcd42d330b3bba89d60c80500605059255393aab68ff57",
83
+ "prepared-CFy9B75C.cjs": "f96ab5e4231502db5afaa2c3b1fb1b4d1b72c1a2df030618fb6d2a367f869973",
84
+ "prepared-ajM-H-9B.js": "36bc66698ec180802c3a989c5537f6286b506bce3df5534790db5754e8699984",
85
+ "progress-B0ctFpKf.cjs": "1bcb7711c2376494e34ac355853a2872a7401ca93f68d64b674546005fffff3d",
86
+ "progress-D-OTpEav.js": "3fe342dc30d8906d05b5c77521495928d02256e88bdeaddb0a074254bdf6cfc5",
87
+ "record-bindings-By_UKZ2g.cjs": "7efb8fcfb50b77a8823db791f3e1839a21eaab8364bf048df6ce7decd928571c",
88
+ "record-bindings-Do_b3h4V.js": "4a836d93212b79a65138580ae63e6c63f06cb36a602addaad0591b4f1b5b9ae2",
89
+ "region-binding-workflow-BMhK_TjP.js": "fca44c82041056e35fddeea104c11205cb0f83d0e66ebdcaba623e2c93f8c742",
90
+ "region-binding-workflow-DIYJdCUr.cjs": "9db88122ed4c28aee321508461b969a14cef491d778c8bd86f43e4affea1291b",
91
+ "render-plan-7xpGrCEl.cjs": "8ac441119a7c0f562631c0dac060b5995f619e993aba16a4387daac7caf0f3d2",
92
+ "render-plan-Ck6koX9L.js": "d334eb13d25e608ac5745c6a78aeeb0967035e8639272a84aa3adc76f5580888",
93
+ "report-params-B1RzkhJj.js": "208655467564d74a22ad6b28baf70fc93c42e917563c57165e7d54bb2ea94483",
94
+ "report-params-WDGrA4oP.cjs": "c4cac710e92e9a8199f8b74b1f9f593f15f01ab39c0a11a59e1550249ce8a8a9",
95
+ "server-node.cjs": "a0a5dab7d081647f880d32861d55333ee6e7d4bb6fb8b5e31a1e0ba073566298",
96
+ "server-node.js": "e9a4f1845d59e76e7b592ff1ce9d96b8ef16381e01de4acf2431ddb4eb04e0b0",
97
+ "server.cjs": "58c6cd76ebca0a8bfbbec4b6bfd5bde93db0052726ce9cfc6ac10aea89b20e6f",
98
+ "server.js": "13766bab66b8377324a88416ff4cc401df3b15d948da12124c475d95ee1a2f37",
99
+ "sha256-ArEYjaTI.cjs": "d42bf9be735724cd66bf623ff5fda6ec282c1f76dca7bcd94d7c8f686221d474",
100
+ "sha256-DPEuJ3nh.js": "c076f58d56d5a1068b5a6be61951864e5b4dddfefbb1b5563e4300b2a81f4fdf",
101
+ "sql.cjs": "3f6410be368c6f8e3677e5c8a10fa76943685c49da1ab725262def05b13872ff",
102
+ "sql.js": "8c44d864340e02ec5ee4512e31b787da5dd1d3e7be750ab8280cfe2d1d733c06",
103
+ "style-CQ1PK8ZB.js": "bd9a779f369ee66583096f8bff606b72bc07964d16e6a9f0cbe61148e7c10600",
104
+ "style-UgIJSA1F.cjs": "7eba440631cc9f35e3e5cfffa2847dd53c3d7357efc7c53ce8897632fd68a9af",
105
+ "style.css": "4ac758c8281c97ccce383af7c7f6be081726f7c63ff60c2c843261570a1cd8f6",
106
+ "template-bindings-C2SpvsMU.js": "cf9a5d0a52e56c3c8d2a247d8615b3cd2924dbf45d253b710a1564d813a20804",
107
+ "template-bindings-CEtWyiLX.cjs": "746726f0b6d3ddaaa3cc7a77b050d422090d9f71fe327d8e113f9a78208c79fa",
108
+ "template-catalog-FJE_c9Qe.cjs": "dcfb05f7f7de45abba8bf4853100e5f61857ac1f6979ad66cec0a394a7511257",
109
+ "template-catalog-j2B1MJlL.js": "657c1365e394362ebf7d2fda21ff50bedd41f0ae921427b1c0282297d98c4e37",
110
+ "template-fragments-BGbQLGlV.js": "a994e2ae73ebbdca22afe14a6fb669b36d803aecde1c63ce89b2a3545132e0ff",
111
+ "template-fragments-DcKeiylI.cjs": "75eabcce09bb86ed9c68dbbeb12918374e777ddc275e3dc939c16b84ed76712a",
112
+ "template-outline-BwRV_eRo.cjs": "3f6781876d65189382ed1eb466d05309d46d60e7223d3d5cc3c91f9d9346d46b",
113
+ "template-outline-cnWfT_LK.js": "cd4ad4f5b0e1ce59f3cbd58ae70773fc5d92cf48f277c10c35acf8d179a09b89",
114
+ "template-registry-BtaKPELV.js": "f24193e4d91922eaf2dc3c579021910352b63fb3cda71afda4a3adc8ff61af62",
115
+ "template-registry-Co1zPq5e.cjs": "8625cf15c6ab656b859eca4ffc9a9f43396b293e1fe1c5b4edbca5a0307b1d61",
116
+ "textwrap-CWHyzkBH.cjs": "aba74f8f94b77030e4f9a0ec6d8eed997e59d2b5e414960443e64358785d2783",
117
+ "textwrap-DE1kgcJB.js": "2619037e148f4a97668a788c735f86725d9e3608be1fbfd4094c60e5ff1674d9",
118
+ "tree-BX380Rr7.cjs": "c4c877dc23084f7ed8f811cea585e328c4c0dd8fcd113c18e5166d5247da6ae7",
119
+ "tree-CjVZLRw7.js": "77a2002b8e569423e0815d5fa2a6ea2559edcf9086f2f5b86d98de475cbe9677",
120
+ "useLocalDraft-BnhcxXk_.js": "4329b21ab9806f229ec5039c48d140184f1a8b17713972548016e36d8c5ad2a5",
121
+ "useLocalDraft-CioIfDb6.cjs": "4aecc84e63a2bef15f690937d5cea415a6e5c529b1d7a2575d738215c1ff908f",
122
+ "vue-async.cjs": "83296331440281d8f7600e3d4722dd737a36320e1e14911bddabc94e452b2286",
123
+ "vue-async.js": "3dfb372643696ab0297062566ee221c22808f558f80872f22b3270f5943d230f",
124
+ "vue.cjs": "2117c43a658c5bd9856a8a3a70e972295449652e526804a49bcde6aeb0b7c1cc",
125
+ "vue.js": "8daa74fa4a8f963a172a18c278d3effc8bb567367afe86d1e9e47bbb62714af6",
126
+ "workbook-session-Bjv1YCRK.cjs": "cc773f744470e4097aed03d995fec3b0b2e4eb2aa2a0d55535d042238502128e",
127
+ "workbook-session-BvToI-Fd.js": "9c26ed8c3ab1a51b680c3c83a3cbc3a5d1002e973dacffee26c0104633dfb905",
128
+ "worker.cjs": "0218c9bc584facf2aec7882db6b0551cf2d4ab80a6345d0b71f1d2e04bf8a9ab",
129
+ "worker.js": "7f57804ca4ad9bd49005ceb4abb145b0e47924a29e266c5f76a9268ef169e0db",
130
+ "xlsx-node.cjs": "cc7b9a891a914a44466819cb12f495680483518f916f2b889ee9a18ad9532672",
131
+ "xlsx-node.js": "a3ca957033da17dfd327529d2ecb65c74564f7a85dfc2130344ff6f55f76bee2",
132
+ "xlsx.cjs": "d38c3fbab9ef8756c8905ab154d1372e39ed2380c1c6e2686f016639d216ef1a",
133
+ "xlsx.js": "9bb94e4ad92d9d590c9cd445e0367b0434b44ab1424e8a5971425751aa37c84e"
134
+ }
135
+ }
@@ -0,0 +1 @@
1
+ "use strict";const w=require("./capabilities-CAh2Nrue.cjs"),y=require("./progress-B0ctFpKf.cjs"),b=require("./media-B7vnpD8k.cjs");class p extends Error{constructor(e,r){super(e.message),this.name="OutputAssetError",this.diagnostic=e,this.cause=r}}function h(n){if(n.aborted)throw n.reason??new DOMException("The operation was aborted.","AbortError")}function I(n){const e={maxAssets:1e3,maxImageBytes:33554432,maxTotalImageBytes:134217728,maxDurationMs:3e4,...n.assetBudget};for(const[r,i]of Object.entries(e))if(!Number.isSafeInteger(i)||i<=0||i>2147483647)throw new RangeError(`${r} must be a positive safe integer at most 2147483647.`);return e}function v(n){const e=/^data:image\/[a-z0-9.+-]+(;base64)?,(.*)$/is.exec(n);if(!e)throw new TypeError("Asset renderers must return an image data URL.");return e[1]?Math.ceil(e[2].length*3/4):new TextEncoder().encode(decodeURIComponent(e[2])).byteLength}function l(n,e,r,i,s){const t={code:r,message:i,severity:"warning",format:n.options.format??"dom",pageIndex:e.pageIndex,componentIndex:e.componentIndex,componentPath:e.componentPath,kind:e.component.kind,nid:e.component.nid};if(n.diagnostics.push(t),w.notifyOutputDiagnostic(t,{...n.options,signal:n.signal}),n.options.assetFailure!=="placeholder")throw new p(t,s)}async function E(n,e,r){const i=n.options.assetRenderers?.[e.kind];if(e.imageData||!i)return e.imageData;if(++n.rendered>n.budget.maxAssets)return l(n,r,"asset-budget-exceeded","Output exceeded the asset count budget.");let s;try{if(n.active=r,s=await y.waitForOutput(i({...r,signal:n.signal}),n.signal),h(n.signal),s.length>n.budget.maxImageBytes*4+1024)return l(n,r,"asset-budget-exceeded","Output exceeded the image payload byte budget.");const t=v(s);if(t>n.budget.maxImageBytes||n.bytes+t>n.budget.maxTotalImageBytes)return l(n,r,"asset-budget-exceeded","Output exceeded the encoded image byte budget.");/^data:image\/(png|jpe?g);base64,/i.test(s)&&n.inspectImage(s),n.bytes+=t}catch(t){if(n.signal.aborted||t instanceof p||t instanceof b.ImageMediaError&&t.code==="image-budget-exceeded")throw t;return l(n,r,"asset-render-failed",`Asset renderer failed for ${e.kind}; output was not silently omitted.`,t)}return s}function A(n,e){const r=n.active;if(!r){e.abort(new Error("Asset rendering exceeded maxDurationMs."));return}const i={code:"asset-budget-exceeded",message:"Asset rendering exceeded maxDurationMs.",severity:"warning",format:n.options.format??"dom",pageIndex:r.pageIndex,componentIndex:r.componentIndex,componentPath:r.componentPath,kind:r.component.kind,nid:r.component.nid};n.diagnostics.push(i);try{w.notifyOutputDiagnostic(i,{...n.options,signal:n.signal})}catch(s){e.abort(s);return}e.abort(new p(i))}async function D(n,e,r,i,s){if(!e?.children?.length)return e;const t=[];for(const[a,d]of e.children.entries())t.push(await x(n,d,{...r,component:d,componentPath:[...i,a]},s));return t.some((a,d)=>a!==e.children[d])?{...e,children:t}:e}async function x(n,e,r,i){if(h(n.signal),i.has(e))throw new TypeError("Cyclic grid children cannot be rendered.");let s=n.cache.get(e);s||(s=E(n,e,r),n.cache.set(e,s));const t=await s;h(n.signal);let a=e.grid;if(a){const d=new Set(i).add(e),c=[];for(const[g,o]of a.cells.entries()){const u=[];for(const[m,f]of o.entries())u.push(await D(n,f,r,[...r.componentPath,g,m],d));c.push(u)}c.some((g,o)=>g.some((u,m)=>u!==a.cells[o][m]))&&(a={...a,cells:c})}return t!==e.imageData||a!==e.grid?{...e,imageData:t,grid:a}:e}function O(n,e,r){const i=new Set,s=t=>{if(y.assertOutputActive(r),!i.has(t)){if(i.add(t),t.imageData&&/^data:image\/(png|jpe?g);base64,/i.test(t.imageData))try{e(t.imageData)}catch(a){if(!(a instanceof b.ImageMediaError)||a.code==="image-budget-exceeded")throw a}for(const a of t.grid?.cells??[])for(const d of a)for(const c of d?.children??[])s(c)}};for(const t of n.pages)for(const a of t.components)s(a)}async function M(n,e={}){const r=I(e),i=b.createImageMediaInspector(e);if(O(n,i,e.signal),e.signal?.aborted)throw e.signal.reason??new DOMException("The operation was aborted.","AbortError");const s=new AbortController,t=()=>s.abort(e.signal?.reason);if(e.signal?.addEventListener("abort",t,{once:!0}),!e.assetRenderers||!Object.keys(e.assetRenderers).length)return e.signal?.removeEventListener("abort",t),{plan:n,diagnostics:[]};const a={options:e,signal:s.signal,diagnostics:[],rendered:0,bytes:0,budget:r,cache:new WeakMap,inspectImage:i},d=setTimeout(()=>A(a,s),r.maxDurationMs);try{const c=[];for(const[g,o]of n.pages.entries()){if(g<(e.start??0)||g>(e.end??n.pages.length-1)){c.push(o);continue}const u=[];for(const[m,f]of o.components.entries())u.push(await x(a,f,{component:f,pageIndex:g,componentIndex:m,componentPath:[]},new Set));c.push(u.some((m,f)=>m!==o.components[f])?{...o,components:u}:o)}return h(a.signal),{plan:c.some((g,o)=>g!==n.pages[o])?{...n,pages:c}:n,diagnostics:a.diagnostics}}finally{clearTimeout(d),e.signal?.removeEventListener("abort",t)}}exports.OutputAssetError=p;exports.resolvePlanAssets=M;
@@ -0,0 +1,124 @@
1
+ import { n as b } from "./capabilities-DskCHs3V.js";
2
+ import { a as y, w as I } from "./progress-D-OTpEav.js";
3
+ import { c as v, I as w } from "./media-Y90dHK9z.js";
4
+ class p extends Error {
5
+ constructor(e, r) {
6
+ super(e.message), this.name = "OutputAssetError", this.diagnostic = e, this.cause = r;
7
+ }
8
+ }
9
+ function h(n) {
10
+ if (n.aborted) throw n.reason ?? new DOMException("The operation was aborted.", "AbortError");
11
+ }
12
+ function E(n) {
13
+ const e = { maxAssets: 1e3, maxImageBytes: 33554432, maxTotalImageBytes: 134217728, maxDurationMs: 3e4, ...n.assetBudget };
14
+ for (const [r, i] of Object.entries(e))
15
+ if (!Number.isSafeInteger(i) || i <= 0 || i > 2147483647) throw new RangeError(`${r} must be a positive safe integer at most 2147483647.`);
16
+ return e;
17
+ }
18
+ function A(n) {
19
+ const e = /^data:image\/[a-z0-9.+-]+(;base64)?,(.*)$/is.exec(n);
20
+ if (!e) throw new TypeError("Asset renderers must return an image data URL.");
21
+ return e[1] ? Math.ceil(e[2].length * 3 / 4) : new TextEncoder().encode(decodeURIComponent(e[2])).byteLength;
22
+ }
23
+ function l(n, e, r, i, s) {
24
+ const t = { code: r, message: i, severity: "warning", format: n.options.format ?? "dom", pageIndex: e.pageIndex, componentIndex: e.componentIndex, componentPath: e.componentPath, kind: e.component.kind, nid: e.component.nid };
25
+ if (n.diagnostics.push(t), b(t, { ...n.options, signal: n.signal }), n.options.assetFailure !== "placeholder") throw new p(t, s);
26
+ }
27
+ async function D(n, e, r) {
28
+ const i = n.options.assetRenderers?.[e.kind];
29
+ if (e.imageData || !i) return e.imageData;
30
+ if (++n.rendered > n.budget.maxAssets) return l(n, r, "asset-budget-exceeded", "Output exceeded the asset count budget.");
31
+ let s;
32
+ try {
33
+ if (n.active = r, s = await I(i({ ...r, signal: n.signal }), n.signal), h(n.signal), s.length > n.budget.maxImageBytes * 4 + 1024) return l(n, r, "asset-budget-exceeded", "Output exceeded the image payload byte budget.");
34
+ const t = A(s);
35
+ if (t > n.budget.maxImageBytes || n.bytes + t > n.budget.maxTotalImageBytes) return l(n, r, "asset-budget-exceeded", "Output exceeded the encoded image byte budget.");
36
+ /^data:image\/(png|jpe?g);base64,/i.test(s) && n.inspectImage(s), n.bytes += t;
37
+ } catch (t) {
38
+ if (n.signal.aborted || t instanceof p || t instanceof w && t.code === "image-budget-exceeded") throw t;
39
+ return l(n, r, "asset-render-failed", `Asset renderer failed for ${e.kind}; output was not silently omitted.`, t);
40
+ }
41
+ return s;
42
+ }
43
+ function O(n, e) {
44
+ const r = n.active;
45
+ if (!r) {
46
+ e.abort(new Error("Asset rendering exceeded maxDurationMs."));
47
+ return;
48
+ }
49
+ const i = { code: "asset-budget-exceeded", message: "Asset rendering exceeded maxDurationMs.", severity: "warning", format: n.options.format ?? "dom", pageIndex: r.pageIndex, componentIndex: r.componentIndex, componentPath: r.componentPath, kind: r.component.kind, nid: r.component.nid };
50
+ n.diagnostics.push(i);
51
+ try {
52
+ b(i, { ...n.options, signal: n.signal });
53
+ } catch (s) {
54
+ e.abort(s);
55
+ return;
56
+ }
57
+ e.abort(new p(i));
58
+ }
59
+ async function M(n, e, r, i, s) {
60
+ if (!e?.children?.length) return e;
61
+ const t = [];
62
+ for (const [a, d] of e.children.entries())
63
+ t.push(await x(n, d, { ...r, component: d, componentPath: [...i, a] }, s));
64
+ return t.some((a, d) => a !== e.children[d]) ? { ...e, children: t } : e;
65
+ }
66
+ async function x(n, e, r, i) {
67
+ if (h(n.signal), i.has(e)) throw new TypeError("Cyclic grid children cannot be rendered.");
68
+ let s = n.cache.get(e);
69
+ s || (s = D(n, e, r), n.cache.set(e, s));
70
+ const t = await s;
71
+ h(n.signal);
72
+ let a = e.grid;
73
+ if (a) {
74
+ const d = new Set(i).add(e), c = [];
75
+ for (const [g, o] of a.cells.entries()) {
76
+ const u = [];
77
+ for (const [m, f] of o.entries()) u.push(await M(n, f, r, [...r.componentPath, g, m], d));
78
+ c.push(u);
79
+ }
80
+ c.some((g, o) => g.some((u, m) => u !== a.cells[o][m])) && (a = { ...a, cells: c });
81
+ }
82
+ return t !== e.imageData || a !== e.grid ? { ...e, imageData: t, grid: a } : e;
83
+ }
84
+ function k(n, e, r) {
85
+ const i = /* @__PURE__ */ new Set(), s = (t) => {
86
+ if (y(r), !i.has(t)) {
87
+ if (i.add(t), t.imageData && /^data:image\/(png|jpe?g);base64,/i.test(t.imageData))
88
+ try {
89
+ e(t.imageData);
90
+ } catch (a) {
91
+ if (!(a instanceof w) || a.code === "image-budget-exceeded") throw a;
92
+ }
93
+ for (const a of t.grid?.cells ?? []) for (const d of a) for (const c of d?.children ?? []) s(c);
94
+ }
95
+ };
96
+ for (const t of n.pages) for (const a of t.components) s(a);
97
+ }
98
+ async function C(n, e = {}) {
99
+ const r = E(e), i = v(e);
100
+ if (k(n, i, e.signal), e.signal?.aborted) throw e.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
101
+ const s = new AbortController(), t = () => s.abort(e.signal?.reason);
102
+ if (e.signal?.addEventListener("abort", t, { once: !0 }), !e.assetRenderers || !Object.keys(e.assetRenderers).length)
103
+ return e.signal?.removeEventListener("abort", t), { plan: n, diagnostics: [] };
104
+ const a = { options: e, signal: s.signal, diagnostics: [], rendered: 0, bytes: 0, budget: r, cache: /* @__PURE__ */ new WeakMap(), inspectImage: i }, d = setTimeout(() => O(a, s), r.maxDurationMs);
105
+ try {
106
+ const c = [];
107
+ for (const [g, o] of n.pages.entries()) {
108
+ if (g < (e.start ?? 0) || g > (e.end ?? n.pages.length - 1)) {
109
+ c.push(o);
110
+ continue;
111
+ }
112
+ const u = [];
113
+ for (const [m, f] of o.components.entries()) u.push(await x(a, f, { component: f, pageIndex: g, componentIndex: m, componentPath: [] }, /* @__PURE__ */ new Set()));
114
+ c.push(u.some((m, f) => m !== o.components[f]) ? { ...o, components: u } : o);
115
+ }
116
+ return h(a.signal), { plan: c.some((g, o) => g !== n.pages[o]) ? { ...n, pages: c } : n, diagnostics: a.diagnostics };
117
+ } finally {
118
+ clearTimeout(d), e.signal?.removeEventListener("abort", t);
119
+ }
120
+ }
121
+ export {
122
+ p as O,
123
+ C as r
124
+ };
@@ -0,0 +1 @@
1
+ "use strict";const E=require("./grid-geometry-CZ_cYB6O.cjs"),O=require("./number-format-CZ2T_5kF.cjs");function F(e){return!e||typeof e!="object"?!1:[e.pageIndex,e.componentIndex,e.rowIndex,e.columnIndex].every(t=>Number.isInteger(t)&&t>=0)}function N(e,t,r){const n=e.grid;if(!n)return null;const o=n.cells[t];if(!o)return null;const u=E.resolveGridLayout(n,e.widthMm,e.heightMm).cells.filter(l=>l.ri===t).findIndex(l=>l.ci===r),s=o[u];return s?{cell:s,sourceColumnIndex:u}:null}function j(e){return e.value!==void 0?e.value:e.rawText??e.text??null}function k(e,t){return e.valueType?e.valueType:typeof t=="number"?"number":typeof t=="boolean"?"boolean":t===null&&e.numberFormat&&/[0#?]/.test(e.numberFormat)?"number":"text"}function z(e,t){if(e.derived)return"derived";if(e.editable===!1)return"cell";if(e.formula!==void 0)return"formula";if(e.children?.length)return"complex";if(t.table&&t.table.role!=="body"&&e.editable!==!0)return"structure"}function B(e,t){const r=e.table;if(r)return{id:r.id,rowIndex:r.rowIndex+t.rowIndex,role:r.role,columnKey:r.columnKeys[t.columnIndex]}}function G(e,t,r){if(e.derived)return;if(e.source)return{...e.source};const n=t.table?.source,o=t.table?.columnKeys[r.columnIndex];if(!(!n||n.rowKey===void 0||o===void 0))return{...n,rowKey:n.rowKey,field:o}}function $(e,t,r){const n=j(r),o=z(r,e);return{address:{...t},cell:r,component:e,value:n,valueType:k(r,n),table:B(e,t),source:G(r,e,t),editable:o===void 0,readOnlyReason:o}}function g(e,t){if(!F(t))return null;const r=e.pages[t.pageIndex]?.components[t.componentIndex];if(!r)return null;const n=N(r,t.rowIndex,t.columnIndex);return n?$(r,t,n.cell):null}function v(e){const t=new Map;return r=>{if(!F(r))return null;const n=e.pages[r.pageIndex]?.components[r.componentIndex];if(!n?.grid)return null;let o=t.get(n);if(!o){const u=new Map;o=new Map;for(const s of E.resolveGridLayout(n.grid,n.widthMm,n.heightMm).cells){const l=u.get(s.ri)??0;u.set(s.ri,l+1);const c=n.grid.cells[s.ri]?.[l];c&&o.set(`${s.ri}:${s.ci}`,c)}t.set(n,o)}const i=o.get(`${r.rowIndex}:${r.columnIndex}`);return i?$(n,r,i):null}}class a extends Error{constructor(t){super(`Invalid report cell edit: ${t}`),this.code=t,this.name="ReportCellEditError"}}function J(e,t){let r=e.trim();const n=t&&r.endsWith("%");if(n&&(r=r.slice(0,-1).trim()),/^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d*)?(?:[eE][+-]?\d+)?$/.test(r)&&(r=r.replace(/,/g,"")),!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(r))throw new a("number");return Number(r)/(n?100:1)}function L(e,t){if(e===null||typeof e=="string"&&e.trim()==="")return null;if(typeof e!="string"&&typeof e!="number")throw new a("number");const r=typeof e=="number"?e:J(e,O.isExcelPercentageFormat(t.cell.numberFormat));if(!Number.isFinite(r)||Number.isInteger(r)&&!Number.isSafeInteger(r))throw new a("number");return r}function A(e){if(e===null||typeof e=="string"&&e.trim()==="")return null;if(typeof e=="boolean")return e;const t=String(e).trim().toLowerCase();if(["true","yes","是","1"].includes(t))return!0;if(["false","no","否","0"].includes(t))return!1;throw new a("boolean")}function R(e,t){return e.valueType==="number"?L(t,e):e.valueType==="boolean"?A(t):t===null?null:String(t)}function P(e,t){const r=t.cell.text,o=[["是","否"],["TRUE","FALSE"],["True","False"],["true","false"],["1","0"]].find(i=>i.includes(r??""));return o?o[e?0:1]:String(e)}function b(e,t){return t===null?"":typeof t=="boolean"?P(t,e):typeof t=="number"?O.formatExcelNumber(t,e.cell.numberFormat):String(t)}function U(e,t,r){const n=g(e,t);if(!n)throw new a("missing");return I(n,r)}function I(e,t){if(!e.editable)throw new a("readonly");const r=R(e,t);return{address:{...e.address},table:e.table,source:e.source,previousValue:e.value,previousText:e.cell.text??"",value:r,text:b(e,r)}}function W(e,t){const r=e.table,n=t.table;return!r||!n||r.columnKey===void 0?!1:r.id===n.id&&r.rowIndex===n.rowIndex&&r.role===n.role&&r.columnKey===n.columnKey}function V(e,t,r){const n=e.grid,{rowIndex:o,columnIndex:i}=t.address,u=N(e,o,i),s=[...n.cells],l=[...s[o]],c=b(t,r.value),f={...u.cell,value:r.value,text:c,rawText:c};return l[u.sourceColumnIndex]=f,s[o]=l,{...e,grid:{...n,cells:s}}}function q(e,t){const r=e.table?.columnKeys,n=t.table?.columnKey;return r&&n!==void 0?r.flatMap((o,i)=>o===n?[i]:[]):[]}function D(e,t,r,n,o,i){const u=t.table,s=o.table;if(!u||!s||u.id!==s.id||u.role!==s.role||!t.grid)return t;const l=s.rowIndex-u.rowIndex;if(l<0||l>=t.grid.cells.length)return t;let c=t;for(const f of q(t,o)){const d=g(e,{pageIndex:r,componentIndex:n,rowIndex:l,columnIndex:f});d?.editable&&W(o,d)&&(c=V(c,d,i))}return c}function H(e,t,r,n,o,i){const u=o.address;return o.table?.columnKey!==void 0?D(e,t,r,n,o,i):u.pageIndex===r&&u.componentIndex===n?V(t,o,i):t}function K(e,t){const r=t.source;if(!r)return!1;const n=e.source;return!n||["sourceScope","datasetId","rowKey","field","revision","sourceToken"].some(o=>!Object.is(n[o],r[o]))}function Q(e,t){const r=g(e,t.address);if(!r)throw new a("missing");if(!r.editable)throw new a("readonly");if(K(r,t))throw new a("conflict");if(!Object.is(r.value,t.previousValue)||(r.cell.text??"")!==t.previousText)throw new a("conflict");const n=R(r,t.value),o={...t,value:n,text:b(r,n)};if(Object.is(n,r.value)&&o.text===r.cell.text)return e;const i=e.pages.map((u,s)=>{const l=u.components.map((c,f)=>H(e,c,s,f,r,o));return l.every((c,f)=>c===u.components[f])?u:{...u,components:l}});return{...e,pages:i}}function X(e){return JSON.stringify([e.pageIndex,e.componentIndex,e.rowIndex,e.columnIndex])}function M(e){const t=e.table;return t?.columnKey!==void 0?JSON.stringify([t.id,t.role,t.rowIndex,t.columnKey]):X(e.address)}function Y(e,t){if(!t.length)return e;const r=new Map(t.map(l=>[M(l),l])),n=new Set(t.flatMap(l=>l.table?[l.table.id]:[])),o=new Set(t.map(l=>`${l.address.pageIndex}:${l.address.componentIndex}`)),i=v(e);function u(l,c,f){const d=l.grid;if(!d||!o.has(`${c}:${f}`)&&!n.has(l.table?.id??""))return l;const p=new Map,S=new Map;for(const m of E.resolveGridLayout(d,l.widthMm,l.heightMm).cells){const y=S.get(m.ri)??0;S.set(m.ri,y+1);const w=i({pageIndex:c,componentIndex:f,rowIndex:m.ri,columnIndex:m.ci}),x=w&&r.get(M(w));if(!x||!w.editable)continue;const T=p.get(m.ri)??[...d.cells[m.ri]],C=b(w,x.value);Object.is(w.value,x.value)&&C===w.cell.text||(T[y]={...m.cell,value:x.value,text:C,rawText:C},p.set(m.ri,T))}return p.size?{...l,grid:{...d,cells:d.cells.map((m,y)=>p.get(y)??m)}}:l}const s=e.pages.map((l,c)=>{const f=l.components.map((d,p)=>u(d,c,p));return f.every((d,p)=>d===l.components[p])?l:{...l,components:f}});return s.every((l,c)=>l===e.pages[c])?e:{...e,pages:s}}function h(e){const t=e.source;if(t)return JSON.stringify([t.sourceScope,t.datasetId,t.rowKey,t.field]);const r=e.table;if(r?.columnKey!==void 0)return JSON.stringify([r.id,r.role,r.rowIndex,r.columnKey]);const n=e.address;return JSON.stringify([n.pageIndex,n.componentIndex,n.rowIndex,n.columnIndex])}function Z(e,t,r){if(typeof r!="string"||!r.trim()||!Array.isArray(t))throw new a("missing");if(t.length>1e4)throw new a("limit");const n=new Set,o=v(e),i=t.map(({address:u,value:s})=>{const l=o(u);if(!l)throw new a("missing");const c=I(l,s),f=h(c);if(n.has(f))throw new a("duplicate");return n.add(f),c});return{requestId:r,edits:i}}function _(e,t){if(t.edits.length>1e4)throw new a("limit");const r=v(e),n=new Set,o=t.edits.map(i=>{const u=r(i.address);if(!u)throw new a("missing");const s=h(i);if(n.has(s))throw new a("duplicate");if(n.add(s),K(u,i)||!Object.is(u.value,i.previousValue)||(u.cell.text??"")!==i.previousText)throw new a("conflict");return I(u,i.value)});return Y(e,o)}function ee(e){const t=new Map;for(const r of e){const n=h(r),o=t.get(n),i=o?{...r,previousValue:o.previousValue,previousText:o.previousText}:{...r};Object.is(i.previousValue,i.value)?t.delete(n):t.set(n,i)}return[...t.values()]}exports.ReportCellEditError=a;exports.applyReportCellEdit=Q;exports.applyReportCellEditBatch=_;exports.createReportCellEdit=U;exports.createReportCellEditBatch=Z;exports.createReportCellResolver=v;exports.editFromContext=I;exports.formatReportCellEdit=b;exports.getReportCellContext=g;exports.parseReportCellInput=R;exports.reportCellEditKey=h;exports.sourceChanged=K;exports.summarizeReportCellEdits=ee;