@agile-team/mach-report 2.16.0 → 2.18.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 (177) hide show
  1. package/README.md +25 -12
  2. package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
  4. package/dist/ParamEditor-KzDQvbHY.js +732 -0
  5. package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
  6. package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
  7. package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
  8. package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
  9. package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
  10. package/dist/ReportPreview-BxWWTUL5.js +5583 -0
  11. package/dist/ReportPreview-Yf99omi3.cjs +6 -0
  12. package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
  14. package/dist/RuleEditor-CqxT1a-W.js +2337 -0
  15. package/dist/RuleEditor-D7YWigD9.cjs +1 -0
  16. package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
  17. package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
  18. package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
  19. package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
  20. package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
  21. package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.d.cts +163 -42
  24. package/dist/analytics.d.ts +163 -42
  25. package/dist/analytics.js +76 -141
  26. package/dist/artifact-integrity.json +110 -108
  27. package/dist/assets-2eC3mOcV.js +232 -0
  28. package/dist/assets-B0Hxn4l6.cjs +1 -0
  29. package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
  30. package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
  31. package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
  32. package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
  33. package/dist/charts-Dlv8j2AG.js +141 -0
  34. package/dist/charts-aCtoswXq.cjs +1 -0
  35. package/dist/codes.cjs +9 -9
  36. package/dist/codes.d.cts +54 -0
  37. package/dist/codes.d.ts +54 -0
  38. package/dist/codes.js +12097 -13668
  39. package/dist/column-visual-BpgQVWwT.js +238 -0
  40. package/dist/column-visual-CtYxnBCP.cjs +1 -0
  41. package/dist/component-tree-6TV7W6Yj.cjs +1 -0
  42. package/dist/component-tree-CvW4lzpv.js +67 -0
  43. package/dist/computed-4TnxzgIh.cjs +1 -0
  44. package/dist/computed-C8NRZQss.js +739 -0
  45. package/dist/data-bar-Ce38juRZ.cjs +1 -0
  46. package/dist/data-bar-PtjXhMgN.js +9 -0
  47. package/dist/dataset-DL83majE.js +161 -0
  48. package/dist/dataset-IrlXbUvh.cjs +1 -0
  49. package/dist/designer--TKECSEc.cjs +2 -0
  50. package/dist/designer-d6hJS41w.js +5683 -0
  51. package/dist/designer.cjs +1 -1
  52. package/dist/designer.d.cts +835 -45
  53. package/dist/designer.d.ts +835 -45
  54. package/dist/designer.js +23 -20
  55. package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
  56. package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
  57. package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
  58. package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
  59. package/dist/index-CPh6tqge.js +1575 -0
  60. package/dist/index-CUNw7dL9.cjs +1 -0
  61. package/dist/index.cjs +8 -8
  62. package/dist/index.d.cts +534 -16
  63. package/dist/index.d.ts +534 -16
  64. package/dist/index.js +1393 -955
  65. package/dist/json-snapshot-By4ZVVUt.js +1967 -0
  66. package/dist/json-snapshot-jiXff4lc.cjs +2 -0
  67. package/dist/matrix-0hywp0-F.cjs +1 -0
  68. package/dist/matrix-Dy-tyY7E.js +381 -0
  69. package/dist/param-validation-C-8sRJLq.cjs +1 -0
  70. package/dist/param-validation-CnDEd2l-.js +333 -0
  71. package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
  72. package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
  73. package/dist/pdf.cjs +1 -1
  74. package/dist/pdf.d.cts +66 -0
  75. package/dist/pdf.d.ts +66 -0
  76. package/dist/pdf.js +2 -2
  77. package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
  78. package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
  79. package/dist/prefill-B8H9qwE4.js +371 -0
  80. package/dist/prefill-D7EswyTI.cjs +1 -0
  81. package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
  82. package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
  83. package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
  84. package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
  85. package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
  86. package/dist/record-bindings-ehjnCDHt.cjs +1 -0
  87. package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
  88. package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
  89. package/dist/report-encoding-worker.cjs +1 -1
  90. package/dist/report-encoding-worker.js +1 -1
  91. package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
  92. package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
  93. package/dist/runtime-CDA6d263.cjs +1 -0
  94. package/dist/runtime-CEMvybO7.js +170 -0
  95. package/dist/sbom.cdx.json +1 -1
  96. package/dist/server/node.d.cts +121 -7
  97. package/dist/server/node.d.ts +121 -7
  98. package/dist/server-node.cjs +4 -4
  99. package/dist/server-node.js +3446 -2115
  100. package/dist/server.cjs +1 -1
  101. package/dist/server.d.cts +417 -29
  102. package/dist/server.d.ts +417 -29
  103. package/dist/server.js +787 -544
  104. package/dist/sha256-BDQ1Qk7A.js +158 -0
  105. package/dist/sha256-DgZAKXqI.cjs +1 -0
  106. package/dist/style.css +1 -1
  107. package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
  108. package/dist/template-bindings-TKnXM7ll.js +62 -0
  109. package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
  110. package/dist/template-catalog-Utu4GP09.cjs +1 -0
  111. package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
  112. package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
  113. package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
  114. package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
  115. package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
  116. package/dist/template-registry-DzWswQI5.cjs +1 -0
  117. package/dist/vue/async.d.cts +636 -35
  118. package/dist/vue/async.d.ts +636 -35
  119. package/dist/vue/index.d.cts +746 -67
  120. package/dist/vue/index.d.ts +746 -67
  121. package/dist/vue-async.cjs +1 -1
  122. package/dist/vue-async.js +3 -3
  123. package/dist/vue.cjs +1 -1
  124. package/dist/vue.js +94 -89
  125. package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
  126. package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
  127. package/dist/worker.cjs +1 -1
  128. package/dist/worker.d.cts +75 -7
  129. package/dist/worker.d.ts +75 -7
  130. package/dist/worker.js +4 -4
  131. package/dist/xlsx.cjs +4 -4
  132. package/dist/xlsx.d.cts +208 -15
  133. package/dist/xlsx.d.ts +208 -15
  134. package/dist/xlsx.js +288 -252
  135. package/package.json +1 -1
  136. package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
  137. package/dist/ParamEditor-OKesP_nO.js +0 -594
  138. package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
  139. package/dist/ReportPreview-BcDKCLiK.js +0 -4834
  140. package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
  141. package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
  142. package/dist/RuleEditor-CGl9XY2s.js +0 -2037
  143. package/dist/assets-CqIbfbTr.js +0 -126
  144. package/dist/assets-e4YSke8n.cjs +0 -1
  145. package/dist/capabilities-DDwXr_cA.js +0 -103
  146. package/dist/capabilities-DNLyZdNw.cjs +0 -1
  147. package/dist/component-tree-Ca6YYfHq.js +0 -61
  148. package/dist/component-tree-DkGLEfZC.cjs +0 -1
  149. package/dist/computed-C-4C2S5h.js +0 -521
  150. package/dist/computed-CGV2a809.cjs +0 -1
  151. package/dist/config-Dg_o8e7m.cjs +0 -1
  152. package/dist/config-XQ4qrQ7Q.js +0 -844
  153. package/dist/dataset-BkRmwgeJ.cjs +0 -1
  154. package/dist/dataset-H5pFuQGU.js +0 -121
  155. package/dist/designer-BfQSahxq.js +0 -5163
  156. package/dist/designer-CPPdeM5_.cjs +0 -2
  157. package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
  158. package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
  159. package/dist/drill-CsdjgkRM.cjs +0 -1
  160. package/dist/drill-DIGsZfyB.js +0 -145
  161. package/dist/json-snapshot-D6ioHth9.js +0 -1702
  162. package/dist/json-snapshot-DknkjvxP.cjs +0 -2
  163. package/dist/matrix-CGRGkn5s.js +0 -112
  164. package/dist/matrix-gEO7ZM_u.cjs +0 -1
  165. package/dist/param-validation-C3HlcLLO.cjs +0 -1
  166. package/dist/param-validation-Do7Eg8Zv.js +0 -181
  167. package/dist/record-bindings-DUX1VMlR.cjs +0 -1
  168. package/dist/runtime-BjKBI530.js +0 -168
  169. package/dist/runtime-CBFEPKEs.cjs +0 -1
  170. package/dist/sha256-BshdOkCC.cjs +0 -1
  171. package/dist/sha256-DTG-Gq8i.js +0 -157
  172. package/dist/template-bindings-C2SpvsMU.js +0 -58
  173. package/dist/template-bindings-CEtWyiLX.cjs +0 -1
  174. package/dist/template-catalog-C2NLdrwB.cjs +0 -1
  175. package/dist/template-registry-C62vpv4a.cjs +0 -1
  176. package/dist/tree-BX380Rr7.cjs +0 -1
  177. package/dist/tree-CjVZLRw7.js +0 -172
@@ -0,0 +1,2337 @@
1
+ import { ref as G, computed as j, defineComponent as ce, resolveComponent as ye, openBlock as s, createElementBlock as d, normalizeClass as ve, createElementVNode as a, createTextVNode as k, toDisplayString as t, createCommentVNode as E, Fragment as C, renderList as x, createVNode as re, watch as te, withDirectives as F, isRef as oe, vModelCheckbox as de, unref as l, vModelSelect as L, vModelText as z, createBlock as fe, vShow as Ee } from "vue";
2
+ import { r as Ke, i as be, v as Te, e as Le } from "./computed-C8NRZQss.js";
3
+ import { _ as me } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { u as he, D as Be } from "./designer-d6hJS41w.js";
5
+ import { u as ue } from "./useLocalDraft-BnhcxXk_.js";
6
+ import { c as Oe } from "./matrix-Dy-tyY7E.js";
7
+ import { v as ke } from "./template-registry-BIhIHOab.js";
8
+ import { c as Ae } from "./column-visual-BpgQVWwT.js";
9
+ function $e(e, A = /* @__PURE__ */ new Set()) {
10
+ return typeof e == "string" || ("field" in e && e.field && A.add(e.field), "weightField" in e && e.weightField && A.add(e.weightField), "args" in e && e.condition && Ke(e.condition).forEach(($) => A.add($)), "args" in e && e.args.forEach(($) => $e($, A))), A;
11
+ }
12
+ function Ve(e, A) {
13
+ return typeof e == "string" ? e : "value" in e ? e.value === null ? A.null : String(e.value) : "aggregate" in e ? `${A[e.aggregate]}(${e.field ?? A.allRows})` : "field" in e ? e.field : `${A[e.op]}(${e.args.map(($) => Ve($, A)).join(", ")})`;
14
+ }
15
+ function Ie(e, A, $) {
16
+ const J = G("");
17
+ function V(S) {
18
+ const U = e.list.columns.find((T) => T.field === S)?.format;
19
+ return U && "digits" in U && U.digits !== void 0 ? `${U.digits} ${$.value.digits}` : void 0;
20
+ }
21
+ const m = j(() => {
22
+ const S = /* @__PURE__ */ new Map();
23
+ for (const U of e.datasetSchema?.fields ?? []) S.set(U.field, {
24
+ field: U.field,
25
+ label: U.label ?? U.field,
26
+ meta: [U.type, U.unit, V(U.field)].filter(Boolean).join(" · ")
27
+ });
28
+ for (const U of e.list.columns) S.has(U.field) || S.set(U.field, { field: U.field, label: U.header || U.field, meta: U.semanticRole ?? "" });
29
+ return [...S.values()];
30
+ }), i = j(() => {
31
+ const S = J.value.trim().toLocaleLowerCase();
32
+ return m.value.filter((U) => `${U.field} ${U.label} ${U.meta}`.toLocaleLowerCase().includes(S));
33
+ }), h = j(() => Ve(A.value.expression, $.value)), w = j(() => {
34
+ const S = [...$e(A.value.expression)];
35
+ return (e.datasets?.[e.list.dataset] ?? []).slice(0, 5).map((U, T) => ({
36
+ row: T + 1,
37
+ values: S.map((M) => `${M} = ${U[M] == null ? $.value.null : String(U[M])}`).join(" · ")
38
+ }));
39
+ });
40
+ return { query: J, matches: i, fieldWindow: j(() => i.value.slice(0, 50)), expression: h, sources: w };
41
+ }
42
+ const We = { class: "mr-predicate__mode" }, Ge = ["aria-label", "value", "disabled"], Je = { value: "comparison" }, He = {
43
+ key: 0,
44
+ value: "all"
45
+ }, je = {
46
+ key: 1,
47
+ value: "any"
48
+ }, Pe = {
49
+ key: 2,
50
+ value: "not"
51
+ }, ze = { class: "mr-predicate__pair" }, qe = ["aria-label", "value", "disabled"], Ze = ["value"], Qe = ["aria-label", "value", "disabled"], Xe = ["value"], Ye = ["value"], pe = ["aria-label", "value", "disabled"], _e = { value: "text" }, el = { value: "number" }, ll = { value: "decimal" }, al = { value: "date" }, tl = { value: "boolean" }, nl = {
52
+ key: 0,
53
+ class: "mr-predicate__pair"
54
+ }, il = ["value", "disabled"], sl = ["value", "disabled"], dl = ["aria-label", "value", "disabled"], ol = { value: "value" }, ul = { value: "field" }, rl = ["value", "aria-label", "disabled"], cl = ["value"], ml = ["value", "aria-label", "disabled"], vl = ["aria-label", "disabled", "onClick"], bl = ["disabled"], gl = /* @__PURE__ */ ce({
55
+ __name: "ReportPredicateEditor",
56
+ props: {
57
+ modelValue: {},
58
+ fields: {},
59
+ messages: {},
60
+ readonly: { type: Boolean },
61
+ depth: {}
62
+ },
63
+ emits: ["update:modelValue"],
64
+ setup(e, { emit: A }) {
65
+ const $ = e, J = A, V = j(() => "all" in $.modelValue ? "all" : "any" in $.modelValue ? "any" : "not" in $.modelValue ? "not" : "comparison"), m = j(() => "all" in $.modelValue ? $.modelValue.all : "any" in $.modelValue ? $.modelValue.any : "not" in $.modelValue ? [$.modelValue.not] : []), i = j(() => "field" in $.modelValue ? $.modelValue : void 0);
66
+ function h(n) {
67
+ $.readonly || J("update:modelValue", n);
68
+ }
69
+ function w() {
70
+ return { field: $.fields[0]?.field ?? "", op: ">", value: 0, valueType: "number" };
71
+ }
72
+ function S(n) {
73
+ const b = $.modelValue;
74
+ h(n === "all" ? { all: [b] } : n === "any" ? { any: [b] } : n === "not" ? { not: b } : w());
75
+ }
76
+ function U(n, b) {
77
+ const o = [...m.value];
78
+ b ? o[n] = b : o.splice(n, 1), h(V.value === "all" ? { all: o } : V.value === "any" ? { any: o } : { not: o[0] });
79
+ }
80
+ function T() {
81
+ const n = [...m.value, w()];
82
+ h(V.value === "all" ? { all: n } : { any: n });
83
+ }
84
+ function M(n) {
85
+ i.value && h({ ...i.value, ...n });
86
+ }
87
+ function W(n) {
88
+ if (!i.value) return;
89
+ const b = { ...i.value, op: n };
90
+ delete b.right, delete b.values, n === "between" ? (b.values = [0, 1], delete b.value) : n === "isNull" || n === "isNotNull" ? delete b.value : b.value = n === "contains" ? "" : 0, h(b);
91
+ }
92
+ function q(n) {
93
+ const b = i.value?.valueType ?? i.value?.numeric;
94
+ return b === "number" && n.trim() && Number.isFinite(Number(n)) ? Number(n) : b === "boolean" ? n === "true" : n;
95
+ }
96
+ function I(n, b) {
97
+ if (i.value)
98
+ if (b !== void 0) {
99
+ const o = [...i.value.values ?? [0, 1]];
100
+ o[b] = q(n), M({ values: o });
101
+ } else M({ value: q(n), right: void 0 });
102
+ }
103
+ function r(n) {
104
+ M(n === "field" ? { value: void 0, right: { field: $.fields[0]?.field ?? "" } } : { value: 0, right: void 0 });
105
+ }
106
+ return (n, b) => {
107
+ const o = ye("ReportPredicateEditor", !0);
108
+ return s(), d("div", {
109
+ class: ve(["mr-predicate", { "is-nested": (e.depth ?? 0) > 0 }])
110
+ }, [
111
+ a("label", We, [
112
+ k(t(e.messages.conditionGroup), 1),
113
+ a("select", {
114
+ "aria-label": e.messages.conditionGroup,
115
+ value: V.value,
116
+ disabled: e.readonly,
117
+ onChange: b[0] || (b[0] = (f) => S(f.target.value))
118
+ }, [
119
+ a("option", Je, t(e.messages.comparison), 1),
120
+ (e.depth ?? 0) < 8 ? (s(), d("option", He, t(e.messages.all), 1)) : E("", !0),
121
+ (e.depth ?? 0) < 8 ? (s(), d("option", je, t(e.messages.any), 1)) : E("", !0),
122
+ (e.depth ?? 0) < 8 ? (s(), d("option", Pe, t(e.messages.not), 1)) : E("", !0)
123
+ ], 40, Ge)
124
+ ]),
125
+ i.value ? (s(), d(C, { key: 0 }, [
126
+ a("div", ze, [
127
+ a("label", null, [
128
+ k(t(e.messages.field), 1),
129
+ a("select", {
130
+ "aria-label": e.messages.condition,
131
+ value: i.value.field,
132
+ disabled: e.readonly,
133
+ onChange: b[1] || (b[1] = (f) => M({ field: f.target.value }))
134
+ }, [
135
+ (s(!0), d(C, null, x(e.fields, (f) => (s(), d("option", {
136
+ key: f.field,
137
+ value: f.field
138
+ }, t(f.label), 9, Ze))), 128))
139
+ ], 40, qe)
140
+ ]),
141
+ a("label", null, [
142
+ k(t(e.messages.comparison), 1),
143
+ a("select", {
144
+ "aria-label": e.messages.comparison,
145
+ value: i.value.op,
146
+ disabled: e.readonly,
147
+ onChange: b[2] || (b[2] = (f) => W(f.target.value))
148
+ }, [
149
+ (s(), d(C, null, x([">", ">=", "<", "<=", "==", "!="], (f) => a("option", {
150
+ key: f,
151
+ value: f
152
+ }, t(f), 9, Xe)), 64)),
153
+ (s(), d(C, null, x(["between", "contains", "isNull", "isNotNull"], (f) => a("option", {
154
+ key: f,
155
+ value: f
156
+ }, t(e.messages[f]), 9, Ye)), 64))
157
+ ], 40, Qe)
158
+ ])
159
+ ]),
160
+ ["isNull", "isNotNull"].includes(i.value.op) ? E("", !0) : (s(), d(C, { key: 0 }, [
161
+ a("label", null, [
162
+ k(t(e.messages.valueKind), 1),
163
+ a("select", {
164
+ "aria-label": e.messages.valueKind,
165
+ value: i.value.valueType ?? i.value.numeric ?? (typeof i.value.value == "number" ? "number" : "text"),
166
+ disabled: e.readonly,
167
+ onChange: b[3] || (b[3] = (f) => M({ valueType: f.target.value }))
168
+ }, [
169
+ a("option", _e, t(e.messages.text), 1),
170
+ a("option", el, t(e.messages.number), 1),
171
+ a("option", ll, t(e.messages.decimal), 1),
172
+ a("option", al, t(e.messages.calendarDate), 1),
173
+ a("option", tl, t(e.messages.boolean), 1)
174
+ ], 40, pe)
175
+ ]),
176
+ i.value.op === "between" ? (s(), d("div", nl, [
177
+ a("label", null, [
178
+ k(t(e.messages.lowerBound), 1),
179
+ a("input", {
180
+ value: i.value.values?.[0],
181
+ disabled: e.readonly,
182
+ onInput: b[4] || (b[4] = (f) => I(f.target.value, 0))
183
+ }, null, 40, il)
184
+ ]),
185
+ a("label", null, [
186
+ k(t(e.messages.upperBound), 1),
187
+ a("input", {
188
+ value: i.value.values?.[1],
189
+ disabled: e.readonly,
190
+ onInput: b[5] || (b[5] = (f) => I(f.target.value, 1))
191
+ }, null, 40, sl)
192
+ ])
193
+ ])) : (s(), d(C, { key: 1 }, [
194
+ a("label", null, [
195
+ k(t(e.messages.threshold), 1),
196
+ a("select", {
197
+ "aria-label": e.messages.threshold,
198
+ value: i.value.right && "field" in i.value.right ? "field" : "value",
199
+ disabled: e.readonly,
200
+ onChange: b[6] || (b[6] = (f) => r(f.target.value))
201
+ }, [
202
+ a("option", ol, t(e.messages.compareValue), 1),
203
+ a("option", ul, t(e.messages.compareField), 1)
204
+ ], 40, dl)
205
+ ]),
206
+ i.value.right && "field" in i.value.right ? (s(), d("select", {
207
+ key: 0,
208
+ value: i.value.right.field,
209
+ "aria-label": e.messages.compareField,
210
+ disabled: e.readonly,
211
+ onChange: b[7] || (b[7] = (f) => M({ right: { field: f.target.value } }))
212
+ }, [
213
+ (s(!0), d(C, null, x(e.fields, (f) => (s(), d("option", {
214
+ key: f.field,
215
+ value: f.field
216
+ }, t(f.label), 9, cl))), 128))
217
+ ], 40, rl)) : (s(), d("input", {
218
+ key: 1,
219
+ value: i.value.right && "value" in i.value.right ? i.value.right.value : i.value.value,
220
+ "aria-label": e.messages.compareValue,
221
+ disabled: e.readonly,
222
+ onInput: b[8] || (b[8] = (f) => I(f.target.value))
223
+ }, null, 40, ml))
224
+ ], 64))
225
+ ], 64))
226
+ ], 64)) : (s(), d(C, { key: 1 }, [
227
+ (s(!0), d(C, null, x(m.value, (f, O) => (s(), d("div", {
228
+ key: O,
229
+ class: "mr-predicate__child"
230
+ }, [
231
+ re(o, {
232
+ "model-value": f,
233
+ fields: e.fields,
234
+ messages: e.messages,
235
+ readonly: e.readonly,
236
+ depth: (e.depth ?? 0) + 1,
237
+ "onUpdate:modelValue": (Z) => U(O, Z)
238
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
239
+ m.value.length > 1 ? (s(), d("button", {
240
+ key: 0,
241
+ type: "button",
242
+ "aria-label": e.messages.removeCondition,
243
+ disabled: e.readonly,
244
+ onClick: (Z) => U(O)
245
+ }, "×", 8, vl)) : E("", !0)
246
+ ]))), 128)),
247
+ V.value !== "not" && m.value.length < 8 ? (s(), d("button", {
248
+ key: 0,
249
+ type: "button",
250
+ disabled: e.readonly,
251
+ onClick: T
252
+ }, "+ " + t(e.messages.addCondition), 9, bl)) : E("", !0)
253
+ ], 64))
254
+ ], 2);
255
+ };
256
+ }
257
+ }), we = /* @__PURE__ */ me(gl, [["__scopeId", "data-v-33dda0dd"]]), ae = (e) => JSON.parse(JSON.stringify(e));
258
+ function yl(e, A) {
259
+ const $ = G(!1), J = G(""), V = G({
260
+ dataset: "",
261
+ parentKey: "",
262
+ foreignKey: "",
263
+ columns: []
264
+ }), m = G({
265
+ rowFields: [],
266
+ columnFields: [],
267
+ measures: []
268
+ }), i = G({ input: "flat", idField: "id", parentField: "parentId", labelField: "", parentValues: "source" }), h = ue(() => ({ enabled: $.value, detail: V.value, matrix: m.value, tree: i.value }));
269
+ let w;
270
+ const S = G(), U = j(() => [
271
+ .../* @__PURE__ */ new Set([
272
+ ...Object.keys(e.datasets ?? {}),
273
+ ...Object.keys(e.datasetSchemas ?? {})
274
+ ])
275
+ ]), T = j(
276
+ () => W(e.list.dataset, e.datasetSchema)
277
+ ), M = j(() => W(V.value.dataset));
278
+ function W(v, D) {
279
+ const R = /* @__PURE__ */ new Map();
280
+ for (const c of (D ?? e.datasetSchemas?.[v])?.fields ?? [])
281
+ R.set(c.field, c.label ?? c.field);
282
+ const N = e.datasets?.[v]?.[0];
283
+ for (const c of Object.keys(N ?? {}))
284
+ R.has(c) || R.set(c, c);
285
+ if (v === e.list.dataset)
286
+ for (const c of e.list.columns)
287
+ R.has(c.field) || R.set(c.field, c.header || c.field);
288
+ return [...R].map(([c, u]) => ({ field: c, label: u }));
289
+ }
290
+ function q() {
291
+ if (w === JSON.stringify(e.list)) {
292
+ w = void 0;
293
+ return;
294
+ }
295
+ $.value = !!e.list[e.mode];
296
+ const v = U.value.find((D) => D !== e.list.dataset) ?? "";
297
+ V.value = ae(
298
+ e.list.detail ?? {
299
+ dataset: v,
300
+ parentKey: e.list.rowKey ?? e.datasetSchema?.rowKey ?? T.value[0]?.field ?? "",
301
+ foreignKey: "",
302
+ columns: [],
303
+ header: !0,
304
+ unmatched: "error"
305
+ }
306
+ ), m.value = ae(
307
+ e.list.matrix ?? {
308
+ rowFields: [],
309
+ columnFields: [],
310
+ measures: [],
311
+ totals: !0
312
+ }
313
+ ), m.value.measures = m.value.measures.map((D) => ({ ...D, numeric: D.numeric ?? "number" })), i.value = ae(e.list.tree ?? { input: "flat", idField: e.list.rowKey ?? "id", parentField: "parentId", childrenField: "children", labelField: e.list.columns[0]?.field ?? "", parentValues: "source", orphan: "error", indentMm: 3, maxRows: 1e5, maxDepth: 64 }), J.value = "", S.value = void 0, h.accept();
314
+ }
315
+ te(() => [e.mode, e.list.dataset, e.list[e.mode]], q, { immediate: !0 });
316
+ function I(v) {
317
+ V.value.dataset = v, V.value.columns = [], V.value.foreignKey = M.value[0]?.field ?? "", V.value.rowKey = e.datasetSchemas?.[v]?.rowKey;
318
+ }
319
+ function r(v, D) {
320
+ if (D && !V.value.columns.some((R) => R.field === v)) {
321
+ const R = e.datasetSchemas?.[V.value.dataset]?.fields.find((N) => N.field === v);
322
+ V.value.columns.push({
323
+ field: v,
324
+ header: M.value.find((N) => N.field === v)?.label ?? v,
325
+ widthMm: 30,
326
+ align: "auto",
327
+ semanticRole: R?.semanticRole,
328
+ editable: !1
329
+ });
330
+ } else D || (V.value.columns = V.value.columns.filter(
331
+ (R) => R.field !== v
332
+ ));
333
+ }
334
+ function n(v, D, R) {
335
+ if (e.readonly) return;
336
+ const N = m.value[v];
337
+ b(v, R ? [.../* @__PURE__ */ new Set([...N, D])] : N.filter((c) => c !== D));
338
+ }
339
+ function b(v, D) {
340
+ const R = m.value[v];
341
+ m.value[v] = D;
342
+ const N = m.value.hierarchy?.[v === "rowFields" ? "row" : "column"];
343
+ N && (N.sort && (N.sort = D.map((c) => N.sort?.[R.indexOf(c)] ?? "source")), N.labels && (N.labels = D.map((c) => N.labels?.[R.indexOf(c)] ?? c)), N.subtotals && (N.subtotals = N.subtotals.map((c) => D.indexOf(R[c - 1]) + 1).filter((c) => c > 0 && c < D.length)));
344
+ }
345
+ function o(v, D, R) {
346
+ const N = [...m.value[v]], c = D + R;
347
+ e.readonly || D < 0 || D >= N.length || c < 0 || c >= N.length || ([N[D], N[c]] = [N[c], N[D]], b(v, N));
348
+ }
349
+ function f() {
350
+ m.value.measures = [
351
+ ...m.value.measures,
352
+ { field: T.value[0]?.field ?? "", op: "sum", numeric: "number" }
353
+ ];
354
+ }
355
+ function O(v) {
356
+ m.value.measures = m.value.measures.filter(
357
+ (D, R) => R !== v
358
+ );
359
+ }
360
+ function Z(v) {
361
+ e.readonly || (v ? m.value.hierarchy ??= {} : delete m.value.hierarchy);
362
+ }
363
+ function X(v, D, R) {
364
+ if (e.readonly || !m.value.hierarchy) return;
365
+ const N = m.value.hierarchy[v] ??= {}, u = (v === "row" ? m.value.rowFields : m.value.columnFields).map((H, B) => N.sort?.[B] ?? "source");
366
+ u[D] = R, N.sort = u;
367
+ }
368
+ function ee(v, D, R) {
369
+ if (e.readonly || !m.value.hierarchy) return;
370
+ const N = m.value.hierarchy[v] ??= {};
371
+ N.subtotals = [...new Set(R ? [...N.subtotals ?? [], D] : (N.subtotals ?? []).filter((c) => c !== D))];
372
+ }
373
+ function _() {
374
+ i.value.aggregates = [...i.value.aggregates ?? [], { field: T.value.find((v) => v.field !== i.value.labelField && v.field !== i.value.idField)?.field ?? "", op: "sum", numeric: "number" }];
375
+ }
376
+ function Y(v) {
377
+ i.value.aggregates = i.value.aggregates?.filter((D, R) => R !== v);
378
+ }
379
+ function le() {
380
+ J.value = "", S.value = void 0;
381
+ try {
382
+ const v = e.datasets?.[e.list.dataset] ?? [];
383
+ if (!v.length) throw new Error(e.messages.noData);
384
+ if (v.length > 1e3) throw new Error(e.messages.treeBudget);
385
+ const D = Ae(v, { ...i.value, aggregates: i.value.parentValues === "leaf-aggregate" ? i.value.aggregates : void 0, maxRows: 1e3 }), R = e.list.columns.slice(0, 5);
386
+ S.value = { columns: R.map((N) => N.header), rows: D.entries.slice(0, 8).map((N) => R.map((c) => c.field === i.value.labelField ? `${" ".repeat(Math.min(6, N.depth))}${N.row[c.field] ?? ""}` : N.row[c.field])) };
387
+ } catch (v) {
388
+ J.value = v instanceof Error ? v.message : String(v);
389
+ }
390
+ }
391
+ function p(v) {
392
+ if (!$.value) {
393
+ delete v.tree;
394
+ return;
395
+ }
396
+ v.tree = ae(i.value), v.tree.parentValues !== "leaf-aggregate" && delete v.tree.aggregates, v.rowKey = v.tree.idField, delete v.detail, delete v.matrix, delete v.groupBy, delete v.groups, delete v.rowVisibleWhen;
397
+ }
398
+ function ne() {
399
+ J.value = "", S.value = void 0;
400
+ try {
401
+ const v = e.datasets?.[e.list.dataset] ?? [];
402
+ if (!v.length) throw new Error(e.messages.noData);
403
+ const D = Oe(v.slice(0, 1e3), {
404
+ ...m.value,
405
+ maxInputRows: 1e3
406
+ });
407
+ S.value = {
408
+ columns: D.columns.slice(0, 5).map((R) => R.header),
409
+ rows: D.rows.slice(0, 5).map(
410
+ (R) => D.columns.slice(0, 5).map((N) => R[N.field])
411
+ )
412
+ };
413
+ } catch (v) {
414
+ J.value = v instanceof Error ? v.message : String(v);
415
+ }
416
+ }
417
+ function ie() {
418
+ if (e.readonly) return;
419
+ const v = ae(e.list);
420
+ e.mode === "tree" ? p(v) : e.mode === "detail" ? $.value ? (v.detail = ae(V.value), delete v.matrix, delete v.tree) : delete v.detail : $.value ? (v.matrix = ae(m.value), delete v.detail, delete v.tree, delete v.groups, delete v.groupBy, delete v.grandTotal) : delete v.matrix;
421
+ const D = ke({ pages: [{ widthMm: Math.max(1, v.leftMm + v.widthMm), heightMm: 297, components: [v] }] });
422
+ if (!D.ok) {
423
+ J.value = D.errors.slice(0, 3).map((R) => R.message).join(";");
424
+ return;
425
+ }
426
+ e.accept && !e.accept(v) || (w = JSON.stringify(v), e.accept || A(v), h.accept());
427
+ }
428
+ return he({ key: () => `${e.recoveryKey ?? "rules:0:0"}:${e.mode}`, baseline: () => JSON.stringify(e.list[e.mode]), pending: () => h.pending.value, snapshot: () => JSON.stringify({ enabled: $.value, detail: V.value, matrix: m.value, tree: i.value, baseline: h.baseline.value }), restore(v) {
429
+ const D = JSON.parse(v);
430
+ $.value = D.enabled, V.value = D.detail, m.value = D.matrix, i.value = D.tree, h.baseline.value = D.baseline;
431
+ } }), {
432
+ enabled: $,
433
+ pendingLocalChanges: h.pending,
434
+ detail: V,
435
+ matrix: m,
436
+ tree: i,
437
+ datasets: U,
438
+ sourceFields: T,
439
+ childFields: M,
440
+ error: J,
441
+ preview: S,
442
+ chooseDataset: I,
443
+ toggleChildColumn: r,
444
+ toggleDimension: n,
445
+ moveDimension: o,
446
+ addMeasure: f,
447
+ removeMeasure: O,
448
+ checkMatrix: ne,
449
+ toggleHierarchy: Z,
450
+ setDimensionSort: X,
451
+ toggleMatrixSubtotal: ee,
452
+ addTreeAggregate: _,
453
+ removeTreeAggregate: Y,
454
+ checkTree: le,
455
+ apply: ie
456
+ };
457
+ }
458
+ const fl = { class: "mr-data-layout" }, hl = { class: "mr-data-layout__check" }, kl = ["disabled"], $l = { class: "mr-data-layout__hint" }, Vl = ["aria-label", "value", "disabled"], wl = {
459
+ value: "",
460
+ disabled: ""
461
+ }, Cl = ["value"], Ul = { class: "mr-data-layout__pair" }, Fl = ["aria-label", "disabled"], Sl = ["value"], Ml = ["aria-label", "disabled"], Dl = {
462
+ value: "",
463
+ disabled: ""
464
+ }, xl = ["value"], Nl = ["aria-label", "disabled"], Rl = { value: void 0 }, El = ["value"], Kl = { class: "mr-data-layout__choices" }, Tl = ["checked", "disabled", "onChange"], Ll = ["aria-label", "disabled"], Bl = { class: "mr-data-layout__pair" }, Ol = ["aria-label", "disabled"], Al = { value: "error" }, Il = { value: "ignore" }, Wl = { class: "mr-data-layout__check" }, Gl = ["disabled"], Jl = { class: "mr-data-layout__hint" }, Hl = { class: "mr-data-layout__pair" }, jl = ["aria-label", "disabled"], Pl = { value: "flat" }, zl = { value: "nested" }, ql = ["aria-label", "disabled"], Zl = ["value"], Ql = { class: "mr-data-layout__pair" }, Xl = { key: 0 }, Yl = ["aria-label", "disabled"], pl = ["value"], _l = { key: 1 }, ea = ["aria-label", "disabled"], la = ["aria-label", "disabled"], aa = ["value"], ta = { class: "mr-data-layout__pair" }, na = ["aria-label", "disabled"], ia = { key: 0 }, sa = ["aria-label", "disabled"], da = { value: "error" }, oa = { value: "root" }, ua = ["aria-label", "disabled"], ra = { value: "source" }, ca = { value: "leaf-aggregate" }, ma = { class: "mr-data-layout__pair" }, va = ["onUpdate:modelValue", "aria-label", "disabled"], ba = ["value"], ga = ["onUpdate:modelValue", "aria-label", "disabled"], ya = ["value"], fa = { key: 0 }, ha = ["onUpdate:modelValue", "aria-label", "disabled"], ka = ["value"], $a = { class: "mr-data-layout__pair" }, Va = ["onUpdate:modelValue", "aria-label", "disabled"], wa = { value: "number" }, Ca = { value: "decimal" }, Ua = ["onUpdate:modelValue", "aria-label", "disabled"], Fa = ["disabled", "onClick"], Sa = ["disabled"], Ma = { class: "mr-data-layout__pair" }, Da = ["aria-label", "disabled"], xa = ["aria-label", "disabled"], Na = { class: "mr-data-layout__hint" }, Ra = { class: "mr-data-layout__hint" }, Ea = ["checked", "disabled", "onChange"], Ka = { class: "mr-data-layout__pair" }, Ta = ["aria-label", "onUpdate:modelValue", "disabled"], La = ["value"], Ba = ["aria-label", "onUpdate:modelValue", "disabled"], Oa = ["value"], Aa = ["aria-label", "onUpdate:modelValue", "disabled", "placeholder"], Ia = { key: 0 }, Wa = ["aria-label", "onUpdate:modelValue", "disabled"], Ga = ["value"], Ja = { class: "mr-data-layout__pair" }, Ha = ["aria-label", "onUpdate:modelValue", "disabled"], ja = { value: "number" }, Pa = { value: "decimal" }, za = ["aria-label", "onUpdate:modelValue", "disabled"], qa = ["disabled", "onClick"], Za = ["disabled"], Qa = { class: "mr-data-layout__check" }, Xa = ["disabled"], Ya = { class: "mr-data-layout__check" }, pa = ["checked", "disabled"], _a = { class: "mr-data-layout__hint" }, et = ["aria-label", "disabled"], lt = ["aria-label", "value", "disabled", "onChange"], at = { value: "source" }, tt = { value: "asc" }, nt = { value: "desc" }, it = ["aria-label", "disabled", "onClick"], st = ["aria-label", "disabled", "onClick"], dt = {
465
+ key: 0,
466
+ class: "mr-data-layout__check"
467
+ }, ot = ["checked", "disabled", "onChange"], ut = { class: "mr-data-layout__pair" }, rt = ["disabled"], ct = ["disabled"], mt = { class: "mr-data-layout__actions" }, vt = ["disabled"], bt = ["disabled"], gt = ["disabled"], yt = {
468
+ key: 3,
469
+ class: "mr-data-layout__preview"
470
+ }, ft = {
471
+ key: 4,
472
+ class: "mr-data-layout__error",
473
+ role: "alert"
474
+ }, ht = /* @__PURE__ */ ce({
475
+ __name: "RuleDataLayout",
476
+ props: {
477
+ recoveryKey: {},
478
+ list: {},
479
+ accept: { type: Function },
480
+ mode: {},
481
+ datasets: {},
482
+ datasetSchema: {},
483
+ datasetSchemas: {},
484
+ readonly: { type: Boolean },
485
+ messages: {}
486
+ },
487
+ emits: ["change", "dirty"],
488
+ setup(e, { emit: A }) {
489
+ const $ = e, J = A, V = yl($, (I) => J("change", I)), {
490
+ enabled: m,
491
+ detail: i,
492
+ matrix: h,
493
+ tree: w,
494
+ datasets: S,
495
+ sourceFields: U,
496
+ childFields: T,
497
+ error: M,
498
+ preview: W
499
+ } = V;
500
+ te([V.pendingLocalChanges, m, i, h, w], () => J("dirty", V.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
501
+ const q = be();
502
+ return (I, r) => (s(), d("div", fl, [
503
+ a("label", hl, [
504
+ F(a("input", {
505
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => oe(m) ? m.value = n : null),
506
+ type: "checkbox",
507
+ disabled: e.readonly
508
+ }, null, 8, kl), [
509
+ [de, l(m)]
510
+ ]),
511
+ k(t(e.messages.enabled) + t(e.messages[e.mode]), 1)
512
+ ]),
513
+ l(m) && e.mode === "detail" ? (s(), d(C, { key: 0 }, [
514
+ a("p", $l, t(e.messages.detailHint), 1),
515
+ a("label", null, [
516
+ k(t(e.messages.childDataset), 1),
517
+ a("select", {
518
+ "aria-label": e.messages.childDataset,
519
+ value: l(i).dataset,
520
+ disabled: e.readonly,
521
+ onChange: r[1] || (r[1] = (n) => l(V).chooseDataset(n.target.value))
522
+ }, [
523
+ a("option", wl, t(e.messages.select), 1),
524
+ (s(!0), d(C, null, x(l(S), (n) => (s(), d("option", {
525
+ key: n,
526
+ value: n
527
+ }, t(n), 9, Cl))), 128))
528
+ ], 40, Vl)
529
+ ]),
530
+ a("div", Ul, [
531
+ a("label", null, [
532
+ k(t(e.messages.parentKey), 1),
533
+ F(a("select", {
534
+ "aria-label": e.messages.parentKey,
535
+ "onUpdate:modelValue": r[2] || (r[2] = (n) => l(i).parentKey = n),
536
+ disabled: e.readonly
537
+ }, [
538
+ (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
539
+ key: n.field,
540
+ value: n.field
541
+ }, t(n.label), 9, Sl))), 128))
542
+ ], 8, Fl), [
543
+ [L, l(i).parentKey]
544
+ ])
545
+ ]),
546
+ a("label", null, [
547
+ k(t(e.messages.foreignKey), 1),
548
+ F(a("select", {
549
+ "aria-label": e.messages.foreignKey,
550
+ "onUpdate:modelValue": r[3] || (r[3] = (n) => l(i).foreignKey = n),
551
+ disabled: e.readonly
552
+ }, [
553
+ a("option", Dl, t(e.messages.select), 1),
554
+ (s(!0), d(C, null, x(l(T), (n) => (s(), d("option", {
555
+ key: n.field,
556
+ value: n.field
557
+ }, t(n.label), 9, xl))), 128))
558
+ ], 8, Ml), [
559
+ [L, l(i).foreignKey]
560
+ ])
561
+ ])
562
+ ]),
563
+ a("label", null, [
564
+ k(t(e.messages.rowKey), 1),
565
+ F(a("select", {
566
+ "aria-label": e.messages.rowKey,
567
+ "onUpdate:modelValue": r[4] || (r[4] = (n) => l(i).rowKey = n),
568
+ disabled: e.readonly
569
+ }, [
570
+ a("option", Rl, t(e.messages.noRowKey), 1),
571
+ (s(!0), d(C, null, x(l(T), (n) => (s(), d("option", {
572
+ key: n.field,
573
+ value: n.field
574
+ }, t(n.label), 9, El))), 128))
575
+ ], 8, Nl), [
576
+ [L, l(i).rowKey]
577
+ ])
578
+ ]),
579
+ a("fieldset", Kl, [
580
+ a("legend", null, t(e.messages.childColumns), 1),
581
+ (s(!0), d(C, null, x(l(T), (n) => (s(), d("label", {
582
+ key: n.field
583
+ }, [
584
+ a("input", {
585
+ type: "checkbox",
586
+ checked: l(i).columns.some((b) => b.field === n.field),
587
+ disabled: e.readonly,
588
+ onChange: (b) => l(V).toggleChildColumn(
589
+ n.field,
590
+ b.target.checked
591
+ )
592
+ }, null, 40, Tl),
593
+ k(t(n.label), 1)
594
+ ]))), 128))
595
+ ]),
596
+ a("label", null, [
597
+ k(t(e.messages.title), 1),
598
+ F(a("input", {
599
+ "aria-label": e.messages.title,
600
+ "onUpdate:modelValue": r[5] || (r[5] = (n) => l(i).label = n),
601
+ disabled: e.readonly
602
+ }, null, 8, Ll), [
603
+ [z, l(i).label]
604
+ ])
605
+ ]),
606
+ a("div", Bl, [
607
+ a("label", null, [
608
+ k(t(e.messages.unmatched), 1),
609
+ F(a("select", {
610
+ "aria-label": e.messages.unmatched,
611
+ "onUpdate:modelValue": r[6] || (r[6] = (n) => l(i).unmatched = n),
612
+ disabled: e.readonly
613
+ }, [
614
+ a("option", Al, t(e.messages.error), 1),
615
+ a("option", Il, t(e.messages.ignore), 1)
616
+ ], 8, Ol), [
617
+ [L, l(i).unmatched]
618
+ ])
619
+ ]),
620
+ a("label", Wl, [
621
+ F(a("input", {
622
+ "onUpdate:modelValue": r[7] || (r[7] = (n) => l(i).header = n),
623
+ type: "checkbox",
624
+ disabled: e.readonly
625
+ }, null, 8, Gl), [
626
+ [de, l(i).header]
627
+ ]),
628
+ k(t(e.messages.childHeader), 1)
629
+ ])
630
+ ])
631
+ ], 64)) : l(m) && e.mode === "tree" ? (s(), d(C, { key: 1 }, [
632
+ a("p", Jl, t(e.messages.treeHint), 1),
633
+ a("div", Hl, [
634
+ a("label", null, [
635
+ k(t(e.messages.treeInput), 1),
636
+ F(a("select", {
637
+ "onUpdate:modelValue": r[8] || (r[8] = (n) => l(w).input = n),
638
+ "aria-label": e.messages.treeInput,
639
+ disabled: e.readonly
640
+ }, [
641
+ a("option", Pl, t(e.messages.treeFlat), 1),
642
+ a("option", zl, t(e.messages.treeNested), 1)
643
+ ], 8, jl), [
644
+ [L, l(w).input]
645
+ ])
646
+ ]),
647
+ a("label", null, [
648
+ k(t(e.messages.treeId), 1),
649
+ F(a("select", {
650
+ "onUpdate:modelValue": r[9] || (r[9] = (n) => l(w).idField = n),
651
+ "aria-label": e.messages.treeId,
652
+ disabled: e.readonly
653
+ }, [
654
+ (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
655
+ key: n.field,
656
+ value: n.field
657
+ }, t(n.label), 9, Zl))), 128))
658
+ ], 8, ql), [
659
+ [L, l(w).idField]
660
+ ])
661
+ ])
662
+ ]),
663
+ a("div", Ql, [
664
+ l(w).input === "flat" ? (s(), d("label", Xl, [
665
+ k(t(e.messages.treeParent), 1),
666
+ F(a("select", {
667
+ "onUpdate:modelValue": r[10] || (r[10] = (n) => l(w).parentField = n),
668
+ "aria-label": e.messages.treeParent,
669
+ disabled: e.readonly
670
+ }, [
671
+ (s(!0), d(C, null, x(l(U), (n) => (s(), d("option", {
672
+ key: n.field,
673
+ value: n.field
674
+ }, t(n.label), 9, pl))), 128))
675
+ ], 8, Yl), [
676
+ [L, l(w).parentField]
677
+ ])
678
+ ])) : (s(), d("label", _l, [
679
+ k(t(e.messages.treeChildren), 1),
680
+ F(a("input", {
681
+ "onUpdate:modelValue": r[11] || (r[11] = (n) => l(w).childrenField = n),
682
+ "aria-label": e.messages.treeChildren,
683
+ disabled: e.readonly,
684
+ placeholder: "children"
685
+ }, null, 8, ea), [
686
+ [z, l(w).childrenField]
687
+ ])
688
+ ])),
689
+ a("label", null, [
690
+ k(t(e.messages.treeLabel), 1),
691
+ F(a("select", {
692
+ "onUpdate:modelValue": r[12] || (r[12] = (n) => l(w).labelField = n),
693
+ "aria-label": e.messages.treeLabel,
694
+ disabled: e.readonly
695
+ }, [
696
+ (s(!0), d(C, null, x(e.list.columns.filter((n) => !n.hidden), (n) => (s(), d("option", {
697
+ key: n.field,
698
+ value: n.field
699
+ }, t(n.header), 9, aa))), 128))
700
+ ], 8, la), [
701
+ [L, l(w).labelField]
702
+ ])
703
+ ])
704
+ ]),
705
+ a("div", ta, [
706
+ a("label", null, [
707
+ k(t(e.messages.treeIndent), 1),
708
+ F(a("input", {
709
+ "onUpdate:modelValue": r[13] || (r[13] = (n) => l(w).indentMm = n),
710
+ "aria-label": e.messages.treeIndent,
711
+ type: "number",
712
+ min: "0",
713
+ max: "20",
714
+ step: "0.5",
715
+ disabled: e.readonly
716
+ }, null, 8, na), [
717
+ [
718
+ z,
719
+ l(w).indentMm,
720
+ void 0,
721
+ { number: !0 }
722
+ ]
723
+ ])
724
+ ]),
725
+ l(w).input === "flat" ? (s(), d("label", ia, [
726
+ k(t(e.messages.treeOrphan), 1),
727
+ F(a("select", {
728
+ "onUpdate:modelValue": r[14] || (r[14] = (n) => l(w).orphan = n),
729
+ "aria-label": e.messages.treeOrphan,
730
+ disabled: e.readonly
731
+ }, [
732
+ a("option", da, t(e.messages.error), 1),
733
+ a("option", oa, t(e.messages.treeAsRoot), 1)
734
+ ], 8, sa), [
735
+ [L, l(w).orphan]
736
+ ])
737
+ ])) : E("", !0)
738
+ ]),
739
+ a("label", null, [
740
+ k(t(e.messages.treeValues), 1),
741
+ F(a("select", {
742
+ "onUpdate:modelValue": r[15] || (r[15] = (n) => l(w).parentValues = n),
743
+ "aria-label": e.messages.treeValues,
744
+ disabled: e.readonly
745
+ }, [
746
+ a("option", ra, t(e.messages.treeSource), 1),
747
+ a("option", ca, t(e.messages.treeLeaves), 1)
748
+ ], 8, ua), [
749
+ [L, l(w).parentValues]
750
+ ])
751
+ ]),
752
+ l(w).parentValues === "leaf-aggregate" ? (s(), d(C, { key: 0 }, [
753
+ (s(!0), d(C, null, x(l(w).aggregates, (n, b) => (s(), d("div", {
754
+ key: b,
755
+ class: "mr-data-layout__measure"
756
+ }, [
757
+ a("div", ma, [
758
+ a("label", null, [
759
+ k(t(e.messages.measure), 1),
760
+ F(a("select", {
761
+ "onUpdate:modelValue": (o) => n.field = o,
762
+ "aria-label": e.messages.measure,
763
+ disabled: e.readonly
764
+ }, [
765
+ (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
766
+ key: o.field,
767
+ value: o.field
768
+ }, t(o.label), 9, ba))), 128))
769
+ ], 8, va), [
770
+ [L, n.field]
771
+ ])
772
+ ]),
773
+ a("label", null, [
774
+ k(t(e.messages.aggregate), 1),
775
+ F(a("select", {
776
+ "onUpdate:modelValue": (o) => n.op = o,
777
+ "aria-label": e.messages.aggregate,
778
+ disabled: e.readonly
779
+ }, [
780
+ (s(!0), d(C, null, x(l(q).aggregates, (o) => (s(), d("option", {
781
+ key: o,
782
+ value: o
783
+ }, t(e.messages[o]), 9, ya))), 128))
784
+ ], 8, ga), [
785
+ [L, n.op]
786
+ ])
787
+ ])
788
+ ]),
789
+ n.op === "weightedAvg" ? (s(), d("label", fa, [
790
+ k(t(e.messages.weight), 1),
791
+ F(a("select", {
792
+ "onUpdate:modelValue": (o) => n.weightField = o,
793
+ "aria-label": e.messages.weight,
794
+ disabled: e.readonly
795
+ }, [
796
+ (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
797
+ key: o.field,
798
+ value: o.field
799
+ }, t(o.label), 9, ka))), 128))
800
+ ], 8, ha), [
801
+ [L, n.weightField]
802
+ ])
803
+ ])) : E("", !0),
804
+ a("div", $a, [
805
+ a("label", null, [
806
+ k(t(e.messages.numeric), 1),
807
+ F(a("select", {
808
+ "onUpdate:modelValue": (o) => n.numeric = o,
809
+ "aria-label": e.messages.numeric,
810
+ disabled: e.readonly
811
+ }, [
812
+ a("option", wa, t(e.messages.number), 1),
813
+ a("option", Ca, t(e.messages.decimal), 1)
814
+ ], 8, Va), [
815
+ [L, n.numeric]
816
+ ])
817
+ ]),
818
+ a("label", null, [
819
+ k(t(e.messages.digits), 1),
820
+ F(a("input", {
821
+ "onUpdate:modelValue": (o) => n.digits = o,
822
+ "aria-label": e.messages.digits,
823
+ type: "number",
824
+ min: "0",
825
+ max: "100",
826
+ disabled: e.readonly
827
+ }, null, 8, Ua), [
828
+ [
829
+ z,
830
+ n.digits,
831
+ void 0,
832
+ { number: !0 }
833
+ ]
834
+ ])
835
+ ])
836
+ ]),
837
+ a("button", {
838
+ type: "button",
839
+ disabled: e.readonly,
840
+ onClick: (o) => l(V).removeTreeAggregate(b)
841
+ }, t(e.messages.remove), 9, Fa)
842
+ ]))), 128)),
843
+ a("button", {
844
+ type: "button",
845
+ disabled: e.readonly || (l(w).aggregates?.length ?? 0) >= 32,
846
+ onClick: r[16] || (r[16] = //@ts-ignore
847
+ (...n) => l(V).addTreeAggregate && l(V).addTreeAggregate(...n))
848
+ }, "+ " + t(e.messages.addAggregate), 9, Sa)
849
+ ], 64)) : E("", !0),
850
+ a("details", null, [
851
+ a("summary", null, t(e.messages.advanced), 1),
852
+ a("div", Ma, [
853
+ a("label", null, [
854
+ k(t(e.messages.treeRows), 1),
855
+ F(a("input", {
856
+ "onUpdate:modelValue": r[17] || (r[17] = (n) => l(w).maxRows = n),
857
+ "aria-label": e.messages.treeRows,
858
+ type: "number",
859
+ min: "1",
860
+ max: "1000000",
861
+ disabled: e.readonly
862
+ }, null, 8, Da), [
863
+ [
864
+ z,
865
+ l(w).maxRows,
866
+ void 0,
867
+ { number: !0 }
868
+ ]
869
+ ])
870
+ ]),
871
+ a("label", null, [
872
+ k(t(e.messages.treeDepth), 1),
873
+ F(a("input", {
874
+ "onUpdate:modelValue": r[18] || (r[18] = (n) => l(w).maxDepth = n),
875
+ "aria-label": e.messages.treeDepth,
876
+ type: "number",
877
+ min: "1",
878
+ max: "256",
879
+ disabled: e.readonly
880
+ }, null, 8, xa), [
881
+ [
882
+ z,
883
+ l(w).maxDepth,
884
+ void 0,
885
+ { number: !0 }
886
+ ]
887
+ ])
888
+ ])
889
+ ])
890
+ ]),
891
+ a("p", Na, t(e.messages.treeReadonly), 1)
892
+ ], 64)) : l(m) ? (s(), d(C, { key: 2 }, [
893
+ a("p", Ra, t(e.messages.matrixHint), 1),
894
+ (s(), d(C, null, x(["rowFields", "columnFields"], (n) => a("fieldset", {
895
+ key: n,
896
+ class: "mr-data-layout__choices"
897
+ }, [
898
+ a("legend", null, t(e.messages[n]), 1),
899
+ (s(!0), d(C, null, x(l(U), (b) => (s(), d("label", {
900
+ key: b.field
901
+ }, [
902
+ a("input", {
903
+ type: "checkbox",
904
+ checked: l(h)[n].includes(b.field),
905
+ disabled: e.readonly,
906
+ onChange: (o) => l(V).toggleDimension(
907
+ n,
908
+ b.field,
909
+ o.target.checked
910
+ )
911
+ }, null, 40, Ea),
912
+ k(t(b.label), 1)
913
+ ]))), 128))
914
+ ])), 64)),
915
+ (s(!0), d(C, null, x(l(h).measures, (n, b) => (s(), d("div", {
916
+ key: b,
917
+ class: "mr-data-layout__measure"
918
+ }, [
919
+ a("div", Ka, [
920
+ a("label", null, [
921
+ k(t(e.messages.measure), 1),
922
+ F(a("select", {
923
+ "aria-label": e.messages.measure,
924
+ "onUpdate:modelValue": (o) => n.field = o,
925
+ disabled: e.readonly
926
+ }, [
927
+ (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
928
+ key: o.field,
929
+ value: o.field
930
+ }, t(o.label), 9, La))), 128))
931
+ ], 8, Ta), [
932
+ [L, n.field]
933
+ ])
934
+ ]),
935
+ a("label", null, [
936
+ k(t(e.messages.aggregate), 1),
937
+ F(a("select", {
938
+ "aria-label": e.messages.aggregate,
939
+ "onUpdate:modelValue": (o) => n.op = o,
940
+ disabled: e.readonly
941
+ }, [
942
+ (s(!0), d(C, null, x(l(q).aggregates, (o) => (s(), d("option", {
943
+ key: o,
944
+ value: o
945
+ }, t(e.messages[o]), 9, Oa))), 128))
946
+ ], 8, Ba), [
947
+ [L, n.op]
948
+ ])
949
+ ])
950
+ ]),
951
+ a("label", null, [
952
+ k(t(e.messages.measureLabel), 1),
953
+ F(a("input", {
954
+ "aria-label": e.messages.measureLabel,
955
+ "onUpdate:modelValue": (o) => n.label = o,
956
+ disabled: e.readonly,
957
+ placeholder: n.field
958
+ }, null, 8, Aa), [
959
+ [z, n.label]
960
+ ])
961
+ ]),
962
+ n.op === "weightedAvg" ? (s(), d("label", Ia, [
963
+ k(t(e.messages.weight), 1),
964
+ F(a("select", {
965
+ "aria-label": e.messages.weight,
966
+ "onUpdate:modelValue": (o) => n.weightField = o,
967
+ disabled: e.readonly
968
+ }, [
969
+ (s(!0), d(C, null, x(l(U), (o) => (s(), d("option", {
970
+ key: o.field,
971
+ value: o.field
972
+ }, t(o.label), 9, Ga))), 128))
973
+ ], 8, Wa), [
974
+ [L, n.weightField]
975
+ ])
976
+ ])) : E("", !0),
977
+ a("div", Ja, [
978
+ a("label", null, [
979
+ k(t(e.messages.numeric), 1),
980
+ F(a("select", {
981
+ "aria-label": e.messages.numeric,
982
+ "onUpdate:modelValue": (o) => n.numeric = o,
983
+ disabled: e.readonly
984
+ }, [
985
+ a("option", ja, t(e.messages.number), 1),
986
+ a("option", Pa, t(e.messages.decimal), 1)
987
+ ], 8, Ha), [
988
+ [L, n.numeric]
989
+ ])
990
+ ]),
991
+ a("label", null, [
992
+ k(t(e.messages.digits), 1),
993
+ F(a("input", {
994
+ "aria-label": e.messages.digits,
995
+ "onUpdate:modelValue": (o) => n.digits = o,
996
+ type: "number",
997
+ min: "0",
998
+ max: "100",
999
+ disabled: e.readonly
1000
+ }, null, 8, za), [
1001
+ [
1002
+ z,
1003
+ n.digits,
1004
+ void 0,
1005
+ { number: !0 }
1006
+ ]
1007
+ ])
1008
+ ])
1009
+ ]),
1010
+ a("button", {
1011
+ type: "button",
1012
+ disabled: e.readonly,
1013
+ onClick: (o) => l(V).removeMeasure(b)
1014
+ }, t(e.messages.remove), 9, qa)
1015
+ ]))), 128)),
1016
+ a("button", {
1017
+ type: "button",
1018
+ disabled: e.readonly || l(h).measures.length >= 32,
1019
+ onClick: r[19] || (r[19] = //@ts-ignore
1020
+ (...n) => l(V).addMeasure && l(V).addMeasure(...n))
1021
+ }, " + " + t(e.messages.addAggregate), 9, Za),
1022
+ a("label", Qa, [
1023
+ F(a("input", {
1024
+ "onUpdate:modelValue": r[20] || (r[20] = (n) => l(h).totals = n),
1025
+ type: "checkbox",
1026
+ disabled: e.readonly
1027
+ }, null, 8, Xa), [
1028
+ [de, l(h).totals]
1029
+ ]),
1030
+ k(t(e.messages.totals), 1)
1031
+ ]),
1032
+ a("details", null, [
1033
+ a("summary", null, t(e.messages.matrixHierarchy), 1),
1034
+ a("label", Ya, [
1035
+ a("input", {
1036
+ type: "checkbox",
1037
+ checked: !!l(h).hierarchy,
1038
+ disabled: e.readonly,
1039
+ onChange: r[21] || (r[21] = (n) => l(V).toggleHierarchy(n.target.checked))
1040
+ }, null, 40, pa),
1041
+ k(t(e.messages.enabled), 1)
1042
+ ]),
1043
+ l(h).hierarchy ? (s(), d(C, { key: 0 }, [
1044
+ a("p", _a, t(e.messages.matrixHierarchyHint), 1),
1045
+ a("label", null, [
1046
+ k(t(e.messages.matrixEmptyLabel), 1),
1047
+ F(a("input", {
1048
+ "onUpdate:modelValue": r[22] || (r[22] = (n) => l(h).hierarchy.emptyLabel = n),
1049
+ "aria-label": e.messages.matrixEmptyLabel,
1050
+ disabled: e.readonly,
1051
+ placeholder: "(空)"
1052
+ }, null, 8, et), [
1053
+ [z, l(h).hierarchy.emptyLabel]
1054
+ ])
1055
+ ]),
1056
+ (s(), d(C, null, x(["row", "column"], (n) => a("fieldset", {
1057
+ key: n,
1058
+ class: "mr-data-layout__choices"
1059
+ }, [
1060
+ a("legend", null, t(n === "row" ? e.messages.rowFields : e.messages.columnFields), 1),
1061
+ (s(!0), d(C, null, x(l(h)[n === "row" ? "rowFields" : "columnFields"], (b, o) => (s(), d("div", {
1062
+ key: b,
1063
+ class: "mr-data-layout__pair"
1064
+ }, [
1065
+ a("label", null, [
1066
+ k(t(b), 1),
1067
+ a("select", {
1068
+ "aria-label": `${b} · ${e.messages.matrixSort}`,
1069
+ value: l(h).hierarchy[n]?.sort?.[o] ?? "source",
1070
+ disabled: e.readonly,
1071
+ onChange: (f) => l(V).setDimensionSort(n, o, f.target.value)
1072
+ }, [
1073
+ a("option", at, t(e.messages.matrixSourceOrder), 1),
1074
+ a("option", tt, t(e.messages.matrixAscending), 1),
1075
+ a("option", nt, t(e.messages.matrixDescending), 1)
1076
+ ], 40, lt)
1077
+ ]),
1078
+ a("div", null, [
1079
+ a("button", {
1080
+ type: "button",
1081
+ "aria-label": `${b} · ${e.messages.moveUp}`,
1082
+ disabled: e.readonly || o === 0,
1083
+ onClick: (f) => l(V).moveDimension(n === "row" ? "rowFields" : "columnFields", o, -1)
1084
+ }, "↑", 8, it),
1085
+ a("button", {
1086
+ type: "button",
1087
+ "aria-label": `${b} · ${e.messages.moveDown}`,
1088
+ disabled: e.readonly || o === l(h)[n === "row" ? "rowFields" : "columnFields"].length - 1,
1089
+ onClick: (f) => l(V).moveDimension(n === "row" ? "rowFields" : "columnFields", o, 1)
1090
+ }, "↓", 8, st)
1091
+ ]),
1092
+ o < l(h)[n === "row" ? "rowFields" : "columnFields"].length - 1 ? (s(), d("label", dt, [
1093
+ a("input", {
1094
+ type: "checkbox",
1095
+ checked: l(h).hierarchy[n]?.subtotals?.includes(o + 1) ?? !1,
1096
+ disabled: e.readonly,
1097
+ onChange: (f) => l(V).toggleMatrixSubtotal(n, o + 1, f.target.checked)
1098
+ }, null, 40, ot),
1099
+ k(t(e.messages.matrixPrefixSubtotal), 1)
1100
+ ])) : E("", !0)
1101
+ ]))), 128))
1102
+ ])), 64))
1103
+ ], 64)) : E("", !0)
1104
+ ]),
1105
+ a("details", null, [
1106
+ a("summary", null, t(e.messages.widthSettings), 1),
1107
+ a("div", ut, [
1108
+ a("label", null, [
1109
+ k(t(e.messages.dimensionWidth), 1),
1110
+ F(a("input", {
1111
+ "onUpdate:modelValue": r[23] || (r[23] = (n) => l(h).rowWidthMm = n),
1112
+ type: "number",
1113
+ min: "1",
1114
+ disabled: e.readonly,
1115
+ placeholder: "40"
1116
+ }, null, 8, rt), [
1117
+ [
1118
+ z,
1119
+ l(h).rowWidthMm,
1120
+ void 0,
1121
+ { number: !0 }
1122
+ ]
1123
+ ])
1124
+ ]),
1125
+ a("label", null, [
1126
+ k(t(e.messages.measureWidth), 1),
1127
+ F(a("input", {
1128
+ "onUpdate:modelValue": r[24] || (r[24] = (n) => l(h).columnWidthMm = n),
1129
+ type: "number",
1130
+ min: "1",
1131
+ disabled: e.readonly,
1132
+ placeholder: "28"
1133
+ }, null, 8, ct), [
1134
+ [
1135
+ z,
1136
+ l(h).columnWidthMm,
1137
+ void 0,
1138
+ { number: !0 }
1139
+ ]
1140
+ ])
1141
+ ])
1142
+ ])
1143
+ ])
1144
+ ], 64)) : E("", !0),
1145
+ a("div", mt, [
1146
+ l(m) && e.mode === "matrix" ? (s(), d("button", {
1147
+ key: 0,
1148
+ type: "button",
1149
+ disabled: e.readonly,
1150
+ onClick: r[25] || (r[25] = //@ts-ignore
1151
+ (...n) => l(V).checkMatrix && l(V).checkMatrix(...n))
1152
+ }, t(e.messages.check), 9, vt)) : E("", !0),
1153
+ l(m) && e.mode === "tree" ? (s(), d("button", {
1154
+ key: 1,
1155
+ type: "button",
1156
+ disabled: e.readonly,
1157
+ onClick: r[26] || (r[26] = //@ts-ignore
1158
+ (...n) => l(V).checkTree && l(V).checkTree(...n))
1159
+ }, t(e.messages.check), 9, bt)) : E("", !0),
1160
+ a("button", {
1161
+ type: "button",
1162
+ class: "mr-data-layout__primary",
1163
+ disabled: e.readonly,
1164
+ onClick: r[27] || (r[27] = //@ts-ignore
1165
+ (...n) => l(V).apply && l(V).apply(...n))
1166
+ }, t(e.messages.apply), 9, gt)
1167
+ ]),
1168
+ l(W) ? (s(), d("div", yt, [
1169
+ a("p", null, t(e.messages.sample), 1),
1170
+ a("table", null, [
1171
+ a("thead", null, [
1172
+ a("tr", null, [
1173
+ (s(!0), d(C, null, x(l(W).columns, (n, b) => (s(), d("th", { key: b }, t(n), 1))), 128))
1174
+ ])
1175
+ ]),
1176
+ a("tbody", null, [
1177
+ (s(!0), d(C, null, x(l(W).rows, (n, b) => (s(), d("tr", { key: b }, [
1178
+ (s(!0), d(C, null, x(n, (o, f) => (s(), d("td", { key: f }, t(o ?? "—"), 1))), 128))
1179
+ ]))), 128))
1180
+ ])
1181
+ ])
1182
+ ])) : E("", !0),
1183
+ l(M) ? (s(), d("p", ft, t(l(M)), 1)) : E("", !0)
1184
+ ]));
1185
+ }
1186
+ }), kt = /* @__PURE__ */ me(ht, [["__scopeId", "data-v-c42e721c"]]), $t = { class: "mr-expression__row" }, Vt = ["value", "disabled", "aria-label"], wt = { value: "field" }, Ct = { value: "constant" }, Ut = {
1187
+ key: 0,
1188
+ value: "operation"
1189
+ }, Ft = { value: "aggregate" }, St = ["value", "disabled", "aria-label"], Mt = ["value"], Dt = ["value", "disabled", "aria-label"], xt = ["value"], Nt = ["value", "disabled", "aria-label"], Rt = ["value"], Et = ["value", "disabled", "aria-label"], Kt = { value: "text" }, Tt = { value: "number" }, Lt = { value: "boolean" }, Bt = { value: "null" }, Ot = ["value", "disabled", "aria-label"], At = {
1190
+ key: 0,
1191
+ value: ""
1192
+ }, It = ["value"], Wt = ["value", "disabled", "aria-label"], Gt = {
1193
+ value: "",
1194
+ disabled: ""
1195
+ }, Jt = ["value"], Ht = ["value", "disabled", "aria-label"], jt = { value: "true" }, Pt = { value: "false" }, zt = ["type", "value", "disabled", "aria-label"], qt = { class: "mr-expression__help" }, Zt = ["disabled", "aria-label", "onClick"], Qt = ["disabled"], Xt = /* @__PURE__ */ ce({
1196
+ __name: "ReportExpressionEditor",
1197
+ props: {
1198
+ modelValue: {},
1199
+ fields: {},
1200
+ messages: {},
1201
+ readonly: { type: Boolean },
1202
+ depth: {}
1203
+ },
1204
+ emits: ["update:modelValue"],
1205
+ setup(e, { emit: A }) {
1206
+ const $ = e, J = A, V = be(), m = j(() => "op" in $.modelValue ? V.functions.find((r) => r.name === $.modelValue.op) : void 0), i = j(
1207
+ () => "aggregate" in $.modelValue ? "aggregate" : "field" in $.modelValue ? "field" : "value" in $.modelValue ? "constant" : "operation"
1208
+ ), h = G("text");
1209
+ te(
1210
+ () => $.modelValue,
1211
+ (r) => {
1212
+ "value" in r && (h.value = r.value === null ? "null" : typeof r.value == "string" ? "text" : typeof r.value);
1213
+ },
1214
+ { immediate: !0 }
1215
+ );
1216
+ function w(r) {
1217
+ $.readonly || J("update:modelValue", r);
1218
+ }
1219
+ function S(r) {
1220
+ w(r === "aggregate" ? { aggregate: "sum", field: $.fields[0]?.field ?? "" } : r === "field" ? { field: $.fields[0]?.field ?? "" } : r === "constant" ? { value: "" } : {
1221
+ op: "add",
1222
+ args: [{ field: $.fields[0]?.field ?? "" }, { value: 0 }]
1223
+ });
1224
+ }
1225
+ function U(r) {
1226
+ const n = r, b = "args" in $.modelValue ? $.modelValue.args : [{ value: 0 }, { value: 0 }], o = V.functions.find((O) => O.name === n), f = [...b.slice(0, o.maxArgs)];
1227
+ for (; f.length < o.minArgs; ) f.push({ value: 0 });
1228
+ w({ op: n, args: f, ...n === "if" ? { condition: "args" in $.modelValue && $.modelValue.condition ? $.modelValue.condition : { field: $.fields[0]?.field ?? "", op: ">", value: 0 } } : {} });
1229
+ }
1230
+ function T(r, n) {
1231
+ "args" in $.modelValue && w({
1232
+ ...$.modelValue,
1233
+ args: $.modelValue.args.map(
1234
+ (b, o) => o === r ? n : b
1235
+ )
1236
+ });
1237
+ }
1238
+ function M(r) {
1239
+ if (!("args" in $.modelValue)) return;
1240
+ const n = r === void 0 ? [...$.modelValue.args, { value: 0 }] : $.modelValue.args.filter((b, o) => o !== r);
1241
+ w({ ...$.modelValue, args: n });
1242
+ }
1243
+ function W(r) {
1244
+ h.value = r, w({
1245
+ value: r === "null" ? null : r === "boolean" ? !1 : r === "number" ? 0 : ""
1246
+ });
1247
+ }
1248
+ function q(r) {
1249
+ h.value === "number" ? r.trim() && Number.isFinite(Number(r)) && w({ value: Number(r) }) : w({ value: r });
1250
+ }
1251
+ function I(r, n) {
1252
+ if (!("aggregate" in $.modelValue)) return;
1253
+ const b = { ...$.modelValue, [r]: n };
1254
+ r === "aggregate" && (b.aggregate = n), r === "field" && !n && delete b.field, w(b);
1255
+ }
1256
+ return (r, n) => {
1257
+ const b = ye("ReportExpressionEditor", !0);
1258
+ return s(), d("div", {
1259
+ class: ve(["mr-expression", { "mr-expression--nested": (e.depth ?? 0) > 0 }])
1260
+ }, [
1261
+ a("div", $t, [
1262
+ a("select", {
1263
+ value: i.value,
1264
+ disabled: e.readonly,
1265
+ "aria-label": e.messages.argument,
1266
+ onChange: n[0] || (n[0] = (o) => S(o.target.value))
1267
+ }, [
1268
+ a("option", wt, t(e.messages.field), 1),
1269
+ a("option", Ct, t(e.messages.constant), 1),
1270
+ (e.depth ?? 0) < 12 ? (s(), d("option", Ut, t(e.messages.operation), 1)) : E("", !0),
1271
+ a("option", Ft, t(e.messages.aggregate), 1)
1272
+ ], 40, Vt),
1273
+ "field" in e.modelValue && !("aggregate" in e.modelValue) ? (s(), d("select", {
1274
+ key: 0,
1275
+ value: e.modelValue.field,
1276
+ disabled: e.readonly,
1277
+ "aria-label": e.messages.field,
1278
+ onChange: n[1] || (n[1] = (o) => w({ field: o.target.value }))
1279
+ }, [
1280
+ (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1281
+ key: o.field,
1282
+ value: o.field
1283
+ }, t(o.label), 9, Mt))), 128))
1284
+ ], 40, St)) : "op" in e.modelValue ? (s(), d("select", {
1285
+ key: 1,
1286
+ value: e.modelValue.op,
1287
+ disabled: e.readonly,
1288
+ "aria-label": e.messages.operation,
1289
+ onChange: n[2] || (n[2] = (o) => U(o.target.value))
1290
+ }, [
1291
+ (s(!0), d(C, null, x(l(V).operations, (o) => (s(), d("option", {
1292
+ key: o,
1293
+ value: o
1294
+ }, t(e.messages[o]), 9, xt))), 128))
1295
+ ], 40, Dt)) : "aggregate" in e.modelValue ? (s(), d("select", {
1296
+ key: 2,
1297
+ value: e.modelValue.aggregate,
1298
+ disabled: e.readonly,
1299
+ "aria-label": e.messages.aggregate,
1300
+ onChange: n[3] || (n[3] = (o) => I("aggregate", o.target.value))
1301
+ }, [
1302
+ (s(!0), d(C, null, x(l(V).aggregates, (o) => (s(), d("option", {
1303
+ key: o,
1304
+ value: o
1305
+ }, t(e.messages[o]), 9, Rt))), 128))
1306
+ ], 40, Nt)) : (s(), d("select", {
1307
+ key: 3,
1308
+ value: h.value,
1309
+ disabled: e.readonly,
1310
+ "aria-label": e.messages.resultType,
1311
+ onChange: n[4] || (n[4] = (o) => W(o.target.value))
1312
+ }, [
1313
+ a("option", Kt, t(e.messages.text), 1),
1314
+ a("option", Tt, t(e.messages.number), 1),
1315
+ a("option", Lt, t(e.messages.boolean), 1),
1316
+ a("option", Bt, t(e.messages.null), 1)
1317
+ ], 40, Et))
1318
+ ]),
1319
+ "aggregate" in e.modelValue ? (s(), d(C, { key: 0 }, [
1320
+ a("select", {
1321
+ value: e.modelValue.field ?? "",
1322
+ disabled: e.readonly,
1323
+ "aria-label": e.messages.measure,
1324
+ onChange: n[5] || (n[5] = (o) => I("field", o.target.value))
1325
+ }, [
1326
+ e.modelValue.aggregate === "count" ? (s(), d("option", At, t(e.messages.allRows), 1)) : E("", !0),
1327
+ (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1328
+ key: o.field,
1329
+ value: o.field
1330
+ }, t(o.label), 9, It))), 128))
1331
+ ], 40, Ot),
1332
+ e.modelValue.aggregate === "weightedAvg" ? (s(), d("select", {
1333
+ key: 0,
1334
+ value: e.modelValue.weightField ?? "",
1335
+ disabled: e.readonly,
1336
+ "aria-label": e.messages.weight,
1337
+ onChange: n[6] || (n[6] = (o) => I(
1338
+ "weightField",
1339
+ o.target.value
1340
+ ))
1341
+ }, [
1342
+ a("option", Gt, t(e.messages.weight), 1),
1343
+ (s(!0), d(C, null, x(e.fields, (o) => (s(), d("option", {
1344
+ key: o.field,
1345
+ value: o.field
1346
+ }, t(o.label), 9, Jt))), 128))
1347
+ ], 40, Wt)) : E("", !0)
1348
+ ], 64)) : "value" in e.modelValue ? (s(), d(C, { key: 1 }, [
1349
+ h.value === "boolean" ? (s(), d("select", {
1350
+ key: 0,
1351
+ value: String(e.modelValue.value),
1352
+ disabled: e.readonly,
1353
+ "aria-label": e.messages.constant,
1354
+ onChange: n[7] || (n[7] = (o) => w({
1355
+ value: o.target.value === "true"
1356
+ }))
1357
+ }, [
1358
+ a("option", jt, t(e.messages.true), 1),
1359
+ a("option", Pt, t(e.messages.false), 1)
1360
+ ], 40, Ht)) : h.value !== "null" ? (s(), d("input", {
1361
+ key: 1,
1362
+ type: h.value === "number" ? "number" : "text",
1363
+ value: e.modelValue.value ?? "",
1364
+ disabled: e.readonly,
1365
+ "aria-label": e.messages.constant,
1366
+ onInput: n[8] || (n[8] = (o) => q(o.target.value))
1367
+ }, null, 40, zt)) : E("", !0)
1368
+ ], 64)) : "args" in e.modelValue ? (s(), d(C, { key: 2 }, [
1369
+ e.modelValue.op === "if" && e.modelValue.condition ? (s(), fe(we, {
1370
+ key: 0,
1371
+ "model-value": e.modelValue.condition,
1372
+ fields: e.fields,
1373
+ messages: e.messages,
1374
+ readonly: e.readonly,
1375
+ "onUpdate:modelValue": n[9] || (n[9] = (o) => w({ ...e.modelValue, condition: o }))
1376
+ }, null, 8, ["model-value", "fields", "messages", "readonly"])) : E("", !0),
1377
+ a("small", qt, t(m.value?.example), 1),
1378
+ (s(!0), d(C, null, x(e.modelValue.args, (o, f) => (s(), d("div", {
1379
+ key: f,
1380
+ class: "mr-expression__argument"
1381
+ }, [
1382
+ re(b, {
1383
+ "model-value": o,
1384
+ fields: e.fields,
1385
+ messages: e.messages,
1386
+ readonly: e.readonly,
1387
+ depth: (e.depth ?? 0) + 1,
1388
+ "onUpdate:modelValue": (O) => T(f, O)
1389
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
1390
+ e.modelValue.args.length > (m.value?.minArgs ?? 2) ? (s(), d("button", {
1391
+ key: 0,
1392
+ type: "button",
1393
+ disabled: e.readonly,
1394
+ "aria-label": `${e.messages.remove} ${e.messages.argument} ${f + 1}`,
1395
+ onClick: (O) => M(f)
1396
+ }, " × ", 8, Zt)) : E("", !0)
1397
+ ]))), 128)),
1398
+ e.modelValue.args.length < Math.min(16, m.value?.maxArgs ?? 16) ? (s(), d("button", {
1399
+ key: 1,
1400
+ type: "button",
1401
+ disabled: e.readonly,
1402
+ onClick: n[10] || (n[10] = (o) => M())
1403
+ }, " + " + t(e.messages.addArgument), 9, Qt)) : E("", !0)
1404
+ ], 64)) : E("", !0)
1405
+ ], 2);
1406
+ };
1407
+ }
1408
+ }), Yt = /* @__PURE__ */ me(Xt, [["__scopeId", "data-v-bfaf6bd5"]]), P = (e) => JSON.parse(JSON.stringify(e));
1409
+ function pt(e, A) {
1410
+ const $ = j(() => ({
1411
+ ...Be,
1412
+ ...e.messages
1413
+ })), J = G("computations"), V = G(""), m = G(""), i = G({
1414
+ field: "",
1415
+ expression: { field: "" },
1416
+ scope: "row"
1417
+ }), h = G([]), w = G(0), S = G(""), U = G(-1), T = G("style"), M = G({ field: "", op: ">", value: 0 }), W = G(null), q = j(() => W.value ?? M.value), I = G({
1418
+ color: "#b91c1c",
1419
+ backgroundColor: "#fff1f2",
1420
+ bold: !1
1421
+ }), r = G([]), n = ue(() => i.value), b = ue(() => h.value), o = ue(() => ({ when: M.value, composedWhen: W.value, style: I.value })), f = G(/* @__PURE__ */ new Map()), O = G(/* @__PURE__ */ new Map());
1422
+ let Z = "", X = !1;
1423
+ const ee = j(() => n.pending.value || b.pending.value || o.pending.value || f.value.size > 0 || O.value.size > 0);
1424
+ let _;
1425
+ const Y = j(() => {
1426
+ const g = /* @__PURE__ */ new Map();
1427
+ for (const y of e.datasetSchema?.fields ?? [])
1428
+ g.set(y.field, y.label ?? y.field);
1429
+ for (const y of e.list.columns)
1430
+ g.has(y.field) || g.set(y.field, y.header || y.field);
1431
+ for (const y of Object.keys(
1432
+ e.datasets?.[e.list.dataset]?.[0] ?? {}
1433
+ ))
1434
+ g.has(y) || g.set(y, y);
1435
+ return [...g].map(([y, K]) => ({ field: y, label: K }));
1436
+ }), le = j(() => h.value[w.value]), p = j(
1437
+ () => e.list.columns.find((g) => g.field === S.value)
1438
+ ), ne = j(() => Te(D()));
1439
+ function ie() {
1440
+ if (_ === JSON.stringify(e.list)) {
1441
+ _ = void 0;
1442
+ return;
1443
+ }
1444
+ X = !0, f.value = /* @__PURE__ */ new Map(), O.value = /* @__PURE__ */ new Map(), h.value = P(
1445
+ e.list.groups ?? (e.list.groupBy ? [e.list.groupBy] : [])
1446
+ );
1447
+ for (const g of h.value) for (const y of g.aggregates ?? []) y.numeric ??= "number";
1448
+ e.list.columns.some((g) => g.field === S.value) || (S.value = e.list.columns[0]?.field ?? ""), V.value = "", r.value = [], v(m.value), ge(-1), b.accept(), X = !1;
1449
+ }
1450
+ te(() => e.list, ie, { immediate: !0 }), te(i, () => {
1451
+ r.value = [];
1452
+ }, { deep: !0 }), te(() => e.datasets, () => {
1453
+ r.value = [];
1454
+ }, { deep: !0 });
1455
+ function v(g) {
1456
+ !X && n.pending.value && (f.value = new Map(f.value).set(m.value, P(i.value))), m.value = g, i.value = P(
1457
+ e.list.computed?.find((K) => K.field === g) ?? {
1458
+ field: "",
1459
+ expression: { field: Y.value[0]?.field ?? "" },
1460
+ scope: "row"
1461
+ }
1462
+ ), i.value.numeric ??= "number", r.value = [], V.value = "", n.accept();
1463
+ const y = f.value.get(g);
1464
+ if (y) {
1465
+ i.value = P(y);
1466
+ const K = new Map(f.value);
1467
+ K.delete(g), f.value = K;
1468
+ }
1469
+ }
1470
+ function D() {
1471
+ return [
1472
+ ...(e.list.computed ?? []).filter((y) => y.field !== m.value),
1473
+ P(i.value)
1474
+ ];
1475
+ }
1476
+ function R(g) {
1477
+ if (e.readonly) return !1;
1478
+ const y = ke({
1479
+ pages: [
1480
+ {
1481
+ widthMm: Math.max(1, g.leftMm + g.widthMm),
1482
+ heightMm: 297,
1483
+ components: [g]
1484
+ }
1485
+ ]
1486
+ });
1487
+ return y.ok ? (V.value = "", _ = JSON.stringify(g), A(g), !0) : (V.value = y.errors.map((K) => K.message).slice(0, 3).join(";"), !1);
1488
+ }
1489
+ function N() {
1490
+ if (!i.value.field.trim()) {
1491
+ V.value = $.value.missingTarget;
1492
+ return;
1493
+ }
1494
+ const g = P(e.list);
1495
+ if (g.computed = D(), g.columns.some((y) => y.field === i.value.field) || g.columns.push({
1496
+ field: i.value.field,
1497
+ header: i.value.field,
1498
+ widthMm: 30,
1499
+ semanticRole: "measure",
1500
+ align: "right",
1501
+ editable: !1,
1502
+ format: {
1503
+ kind: "number",
1504
+ ...i.value.digits === void 0 ? {} : { digits: i.value.digits }
1505
+ }
1506
+ }), R(g)) {
1507
+ const y = new Map(f.value);
1508
+ y.delete(m.value), y.delete(i.value.field), f.value = y, m.value = i.value.field, n.accept();
1509
+ }
1510
+ }
1511
+ function c() {
1512
+ if (!m.value) return;
1513
+ const g = P(e.list);
1514
+ if (g.computed = (g.computed ?? []).filter(
1515
+ (y) => y.field !== m.value
1516
+ ), R(g)) {
1517
+ const y = new Map(f.value);
1518
+ y.delete(m.value), f.value = y, n.accept(), v("");
1519
+ }
1520
+ }
1521
+ function u() {
1522
+ r.value = [], V.value = "";
1523
+ const g = e.datasets?.[e.list.dataset];
1524
+ if (!g?.length) {
1525
+ V.value = $.value.noData;
1526
+ return;
1527
+ }
1528
+ try {
1529
+ const y = Le(g.slice(0, 1e3), {
1530
+ fields: D(),
1531
+ maxRows: 1e3,
1532
+ maxCells: 2e6
1533
+ });
1534
+ r.value = y.rows.slice(0, 5).map((K, Q) => ({
1535
+ row: Q + 1,
1536
+ value: K[i.value.field]
1537
+ }));
1538
+ } catch (y) {
1539
+ V.value = y instanceof Error ? y.message : String(y);
1540
+ }
1541
+ }
1542
+ function H(g) {
1543
+ i.value.expression = g;
1544
+ }
1545
+ function B(g, y) {
1546
+ i.value.groupBy = y ? [...i.value.groupBy ?? [], g] : (i.value.groupBy ?? []).filter((K) => K !== g);
1547
+ }
1548
+ function Ce() {
1549
+ h.value.push({
1550
+ field: Y.value[0]?.field ?? "",
1551
+ headerTemplate: "{value}",
1552
+ subtotalLabel: $.value.subtotalLabel,
1553
+ aggregates: [],
1554
+ keepWithNext: !0
1555
+ }), w.value = h.value.length - 1;
1556
+ }
1557
+ function Ue(g) {
1558
+ const y = w.value, K = y + g;
1559
+ K < 0 || K >= h.value.length || ([h.value[y], h.value[K]] = [
1560
+ h.value[K],
1561
+ h.value[y]
1562
+ ], w.value = K);
1563
+ }
1564
+ function Fe() {
1565
+ h.value.splice(w.value, 1), w.value = Math.max(
1566
+ 0,
1567
+ Math.min(w.value, h.value.length - 1)
1568
+ );
1569
+ }
1570
+ function Se() {
1571
+ le.value && (le.value.aggregates ??= []).push({
1572
+ field: Y.value[0]?.field ?? "",
1573
+ op: "sum",
1574
+ numeric: "number"
1575
+ });
1576
+ }
1577
+ function Me() {
1578
+ const g = P(e.list);
1579
+ g.groups = P(h.value), delete g.groupBy, R(g) && b.accept();
1580
+ }
1581
+ function De(g) {
1582
+ W.value = g && !("field" in g) ? P(g) : null, M.value = P(g && "field" in g ? g : { field: S.value, op: ">", value: 0 });
1583
+ }
1584
+ function ge(g) {
1585
+ !X && o.pending.value && (O.value = new Map(O.value).set(Z, { when: P(M.value), composedWhen: P(W.value), style: { ...I.value } })), Z = `${S.value}|${T.value}|${g}`, U.value = g;
1586
+ const y = T.value === "cell" ? p.value?.visibleWhen : T.value === "rowVisibility" ? e.list.rowVisibleWhen : p.value?.rules?.[g]?.when;
1587
+ De(y);
1588
+ const K = p.value?.rules?.[g]?.style;
1589
+ I.value = {
1590
+ color: String(K?.color ?? "#b91c1c"),
1591
+ backgroundColor: String(K?.backgroundColor ?? "#fff1f2"),
1592
+ bold: K?.bold === !0
1593
+ }, o.accept();
1594
+ const Q = O.value.get(Z);
1595
+ if (Q) {
1596
+ M.value = P(Q.when), W.value = P(Q.composedWhen), I.value = { ...Q.style };
1597
+ const se = new Map(O.value);
1598
+ se.delete(Z), O.value = se;
1599
+ }
1600
+ }
1601
+ function xe(g) {
1602
+ const y = e.datasetSchema?.fields.find(
1603
+ (se) => se.field === M.value.field
1604
+ ), K = e.datasets?.[e.list.dataset]?.find(
1605
+ (se) => se[M.value.field] != null
1606
+ )?.[M.value.field], Q = y?.type === "number" || !y && typeof K == "number";
1607
+ y?.type === "decimal" ? M.value.numeric = "decimal" : Q ? M.value.numeric = "number" : delete M.value.numeric, M.value.value = Q && g.trim() && Number.isFinite(Number(g)) ? Number(g) : g;
1608
+ }
1609
+ function Ne(g = !1) {
1610
+ const y = P(e.list), K = y.columns.find((Q) => Q.field === S.value);
1611
+ if (!K) {
1612
+ V.value = $.value.noSelection;
1613
+ return;
1614
+ }
1615
+ if (T.value === "rowVisibility")
1616
+ g ? delete y.rowVisibleWhen : y.rowVisibleWhen = P(q.value);
1617
+ else if (T.value === "cell")
1618
+ g ? delete K.visibleWhen : K.visibleWhen = P(q.value);
1619
+ else if (K.rules ??= [], g && U.value >= 0)
1620
+ K.rules.splice(U.value, 1);
1621
+ else {
1622
+ if (g) return;
1623
+ U.value < 0 ? K.rules.push({
1624
+ when: P(q.value),
1625
+ style: { ...I.value }
1626
+ }) : K.rules[U.value] = {
1627
+ when: P(q.value),
1628
+ style: { ...I.value }
1629
+ };
1630
+ }
1631
+ if (R(y)) {
1632
+ const Q = new Map(O.value);
1633
+ Q.delete(Z), O.value = Q, o.accept();
1634
+ }
1635
+ }
1636
+ he({ key: () => e.recoveryKey ?? "rules:0:0", baseline: () => JSON.stringify(e.list), pending: () => ee.value, snapshot: () => JSON.stringify(Re()), restore(g) {
1637
+ const y = JSON.parse(g);
1638
+ i.value = y.formula, h.value = y.groups, M.value = y.when, W.value = y.composedWhen, I.value = y.style, m.value = y.selectedComputed, S.value = y.column, U.value = y.conditionIndex, Z = y.conditionKey, T.value = y.effect, J.value = y.tab, f.value = new Map(y.computedDrafts), O.value = new Map(y.conditionDrafts), n.baseline.value = y.formulaBaseline, b.baseline.value = y.groupBaseline, o.baseline.value = y.conditionBaseline;
1639
+ } });
1640
+ function Re() {
1641
+ return { formula: i.value, groups: h.value, when: M.value, composedWhen: W.value, style: I.value, selectedComputed: m.value, column: S.value, conditionIndex: U.value, conditionKey: Z, effect: T.value, tab: J.value, computedDrafts: [...f.value], conditionDrafts: [...O.value], formulaBaseline: n.baseline.value, groupBaseline: b.baseline.value, conditionBaseline: o.baseline.value };
1642
+ }
1643
+ return {
1644
+ m: $,
1645
+ pendingLocalChanges: ee,
1646
+ draftSnapshot: () => JSON.stringify({ formula: i.value, groups: h.value, when: M.value, composedWhen: W.value, style: I.value, computedDrafts: [...f.value], conditionDrafts: [...O.value] }),
1647
+ tab: J,
1648
+ fields: Y,
1649
+ formula: i,
1650
+ groups: h,
1651
+ groupIndex: w,
1652
+ currentGroup: le,
1653
+ column: S,
1654
+ currentColumn: p,
1655
+ conditionIndex: U,
1656
+ effect: T,
1657
+ when: M,
1658
+ condition: q,
1659
+ setCondition(g) {
1660
+ "field" in g ? (M.value = g, W.value = null) : W.value = g;
1661
+ },
1662
+ style: I,
1663
+ error: V,
1664
+ preview: r,
1665
+ diagnostics: ne,
1666
+ selectedComputed: m,
1667
+ loadComputed: v,
1668
+ applyComputed: N,
1669
+ removeComputed: c,
1670
+ check: u,
1671
+ setExpression: H,
1672
+ toggleGroupField: B,
1673
+ addGroup: Ce,
1674
+ moveGroup: Ue,
1675
+ removeGroup: Fe,
1676
+ addAggregate: Se,
1677
+ applyGroups: Me,
1678
+ loadCondition: ge,
1679
+ setThreshold: xe,
1680
+ applyCondition: Ne,
1681
+ applyLayout: R,
1682
+ resetDraft: () => {
1683
+ _ = void 0, ie();
1684
+ }
1685
+ };
1686
+ }
1687
+ const _t = ["aria-label"], en = { class: "mr-rule-editor__directory" }, ln = ["aria-label"], an = ["aria-selected", "onClick"], tn = { key: 0 }, nn = { key: 1 }, sn = { class: "mr-rule-editor__catalog" }, dn = ["disabled"], on = ["aria-label"], un = { class: "mr-rule-editor__field-list" }, rn = ["disabled", "title", "onClick"], cn = { key: 1 }, mn = {
1688
+ key: 0,
1689
+ class: "mr-rule-editor__panel"
1690
+ }, vn = ["aria-label", "value", "disabled"], bn = { value: "" }, gn = ["value"], yn = ["aria-label", "disabled"], fn = { class: "mr-rule-editor__pair" }, hn = ["aria-label", "disabled"], kn = ["value"], $n = ["aria-label", "disabled"], Vn = { value: "number" }, wn = { value: "decimal" }, Cn = {
1691
+ key: 0,
1692
+ class: "mr-rule-editor__checks"
1693
+ }, Un = ["checked", "disabled", "onChange"], Fn = {
1694
+ key: 2,
1695
+ class: "mr-rule-editor__hint"
1696
+ }, Sn = { class: "mr-rule-editor__advanced" }, Mn = ["aria-label", "disabled"], Dn = ["aria-label", "disabled"], xn = { value: "propagate" }, Nn = { value: "error" }, Rn = ["aria-label", "disabled"], En = { value: "error" }, Kn = { value: "null" }, Tn = {
1697
+ key: 3,
1698
+ class: "mr-rule-editor__hint"
1699
+ }, Ln = {
1700
+ key: 4,
1701
+ class: "mr-rule-editor__diagnostic"
1702
+ }, Bn = { class: "mr-rule-editor__actions" }, On = ["disabled"], An = ["disabled"], In = ["disabled"], Wn = {
1703
+ key: 5,
1704
+ class: "mr-rule-editor__error"
1705
+ }, Gn = {
1706
+ key: 1,
1707
+ class: "mr-rule-editor__panel"
1708
+ }, Jn = { class: "mr-rule-editor__pair" }, Hn = ["aria-label"], jn = ["value"], Pn = {
1709
+ key: 0,
1710
+ value: 0
1711
+ }, zn = ["disabled"], qn = ["aria-label", "disabled"], Zn = ["value"], Qn = { class: "mr-rule-editor__pair" }, Xn = ["aria-label", "disabled"], Yn = ["aria-label", "disabled"], pn = { class: "mr-rule-editor__checks" }, _n = ["disabled"], ei = ["disabled"], li = { class: "mr-rule-editor__pair" }, ai = ["aria-label", "onUpdate:modelValue", "disabled"], ti = ["value"], ni = ["aria-label", "onUpdate:modelValue", "disabled"], ii = ["value"], si = ["aria-label", "onUpdate:modelValue", "disabled"], di = { value: void 0 }, oi = ["value"], ui = { key: 0 }, ri = ["aria-label", "onUpdate:modelValue", "disabled"], ci = ["value"], mi = { class: "mr-rule-editor__pair" }, vi = ["onUpdate:modelValue", "disabled", "aria-label"], bi = { value: "number" }, gi = { value: "decimal" }, yi = ["disabled", "onClick"], fi = ["disabled"], hi = { class: "mr-rule-editor__actions" }, ki = ["disabled", "aria-label"], $i = ["disabled", "aria-label"], Vi = ["disabled"], wi = ["disabled"], Ci = {
1712
+ key: 2,
1713
+ class: "mr-rule-editor__panel"
1714
+ }, Ui = ["aria-label", "disabled"], Fi = ["value"], Si = ["aria-label", "disabled"], Mi = { value: "style" }, Di = { value: "cell" }, xi = { value: "rowVisibility" }, Ni = { key: 0 }, Ri = ["aria-label", "value", "disabled"], Ei = { value: -1 }, Ki = ["value"], Ti = { class: "mr-rule-editor__pair" }, Li = ["disabled"], Bi = ["disabled"], Oi = { class: "mr-rule-editor__check" }, Ai = ["disabled"], Ii = { class: "mr-rule-editor__actions" }, Wi = ["disabled"], Gi = ["disabled"], Ji = { class: "mr-rule-editor__explanation" }, Hi = { key: 0 }, ji = { class: "mr-rule-editor__results" }, Pi = { key: 0 }, zi = { key: 1 }, qi = {
1715
+ key: 1,
1716
+ class: "mr-rule-editor__error",
1717
+ role: "alert"
1718
+ }, Zi = /* @__PURE__ */ ce({
1719
+ __name: "RuleEditor",
1720
+ props: {
1721
+ recoveryKey: {},
1722
+ list: {},
1723
+ datasets: {},
1724
+ datasetSchema: {},
1725
+ datasetSchemas: {},
1726
+ readonly: { type: Boolean },
1727
+ messages: {}
1728
+ },
1729
+ emits: ["change", "dirty"],
1730
+ setup(e, { expose: A, emit: $ }) {
1731
+ const J = e, V = $, m = pt(J, (N) => V("change", N)), {
1732
+ m: i,
1733
+ tab: h,
1734
+ fields: w,
1735
+ formula: S,
1736
+ groups: U,
1737
+ groupIndex: T,
1738
+ currentGroup: M,
1739
+ column: W,
1740
+ currentColumn: q,
1741
+ conditionIndex: I,
1742
+ effect: r,
1743
+ condition: n,
1744
+ style: b,
1745
+ error: o,
1746
+ preview: f,
1747
+ diagnostics: O,
1748
+ selectedComputed: Z
1749
+ } = m, X = G({}), ee = G(0);
1750
+ function _() {
1751
+ m.resetDraft(), X.value = {}, ee.value++;
1752
+ }
1753
+ const Y = j(() => m.pendingLocalChanges.value || Object.values(X.value).some(Boolean));
1754
+ te([Y, m.draftSnapshot, X], () => V("dirty", Y.value), { immediate: !0, deep: !0, flush: "sync" }), A({ get pendingLocalChanges() {
1755
+ return Y.value;
1756
+ } });
1757
+ const le = Ie(J, m.formula, i), { query: p, matches: ne, fieldWindow: ie, expression: v, sources: D } = le, R = be();
1758
+ return (N, c) => (s(), d("section", {
1759
+ class: "mr-rule-editor",
1760
+ "aria-label": l(i).settings
1761
+ }, [
1762
+ a("aside", en, [
1763
+ a("div", {
1764
+ class: "mr-rule-editor__tabs",
1765
+ role: "tablist",
1766
+ "aria-label": l(i).settings
1767
+ }, [
1768
+ (s(), d(C, null, x([
1769
+ "computations",
1770
+ "groups",
1771
+ "conditions",
1772
+ "detail",
1773
+ "matrix",
1774
+ "tree"
1775
+ ], (u) => a("button", {
1776
+ key: u,
1777
+ type: "button",
1778
+ role: "tab",
1779
+ "aria-selected": l(h) === u,
1780
+ class: ve({ "is-active": l(h) === u }),
1781
+ onClick: (H) => h.value = u
1782
+ }, [
1783
+ k(t(l(i)[u]), 1),
1784
+ u === "computations" && e.list.computed?.length ? (s(), d("span", tn, t(e.list.computed.length), 1)) : E("", !0),
1785
+ u === "groups" && l(U).length ? (s(), d("span", nn, t(l(U).length), 1)) : E("", !0)
1786
+ ], 10, an)), 64))
1787
+ ], 8, ln),
1788
+ a("div", sn, [
1789
+ a("strong", null, t(l(i).catalog), 1),
1790
+ Y.value ? (s(), d("button", {
1791
+ key: 0,
1792
+ type: "button",
1793
+ disabled: e.readonly,
1794
+ onClick: _
1795
+ }, t(l(i).restoreDraft), 9, dn)) : E("", !0),
1796
+ a("label", null, [
1797
+ k(t(l(i).searchFields), 1),
1798
+ F(a("input", {
1799
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => oe(p) ? p.value = u : null),
1800
+ type: "search",
1801
+ "aria-label": l(i).searchFields
1802
+ }, null, 8, on), [
1803
+ [z, l(p)]
1804
+ ])
1805
+ ]),
1806
+ a("div", un, [
1807
+ (s(!0), d(C, null, x(l(ie), (u) => (s(), d("button", {
1808
+ key: u.field,
1809
+ type: "button",
1810
+ disabled: e.readonly || l(h) !== "computations",
1811
+ title: l(i).useField,
1812
+ onClick: (H) => l(m).setExpression({ field: u.field })
1813
+ }, [
1814
+ a("strong", null, t(u.label), 1),
1815
+ a("code", null, t(u.field), 1),
1816
+ a("small", null, t(u.meta), 1)
1817
+ ], 8, rn))), 128))
1818
+ ]),
1819
+ l(ne).length > 50 ? (s(), d("small", cn, t(l(i).shown) + " 50 / " + t(l(ne).length), 1)) : E("", !0)
1820
+ ])
1821
+ ]),
1822
+ l(h) === "computations" ? (s(), d("div", mn, [
1823
+ a("label", null, [
1824
+ k(t(l(i).existing), 1),
1825
+ a("select", {
1826
+ "aria-label": l(i).existing,
1827
+ value: l(Z),
1828
+ disabled: e.readonly,
1829
+ onChange: c[1] || (c[1] = (u) => l(m).loadComputed(u.target.value))
1830
+ }, [
1831
+ a("option", bn, "+ " + t(l(i).newField), 1),
1832
+ (s(!0), d(C, null, x(e.list.computed, (u) => (s(), d("option", {
1833
+ key: u.field,
1834
+ value: u.field
1835
+ }, t(u.field), 9, gn))), 128))
1836
+ ], 40, vn)
1837
+ ]),
1838
+ a("label", null, [
1839
+ k(t(l(i).target), 1),
1840
+ F(a("input", {
1841
+ "aria-label": l(i).target,
1842
+ "onUpdate:modelValue": c[2] || (c[2] = (u) => l(S).field = u),
1843
+ disabled: e.readonly,
1844
+ autocomplete: "off"
1845
+ }, null, 8, yn), [
1846
+ [z, l(S).field]
1847
+ ])
1848
+ ]),
1849
+ a("div", fn, [
1850
+ a("label", null, [
1851
+ k(t(l(i).scope), 1),
1852
+ F(a("select", {
1853
+ "aria-label": l(i).scope,
1854
+ "onUpdate:modelValue": c[3] || (c[3] = (u) => l(S).scope = u),
1855
+ disabled: e.readonly
1856
+ }, [
1857
+ (s(!0), d(C, null, x(l(R).scopes, (u) => (s(), d("option", {
1858
+ key: u,
1859
+ value: u
1860
+ }, t(l(i)[u]), 9, kn))), 128))
1861
+ ], 8, hn), [
1862
+ [L, l(S).scope]
1863
+ ])
1864
+ ]),
1865
+ a("label", null, [
1866
+ k(t(l(i).numeric), 1),
1867
+ F(a("select", {
1868
+ "aria-label": l(i).numeric,
1869
+ "onUpdate:modelValue": c[4] || (c[4] = (u) => l(S).numeric = u),
1870
+ disabled: e.readonly
1871
+ }, [
1872
+ a("option", Vn, t(l(i).number), 1),
1873
+ a("option", wn, t(l(i).decimal), 1)
1874
+ ], 8, $n), [
1875
+ [L, l(S).numeric]
1876
+ ])
1877
+ ])
1878
+ ]),
1879
+ l(S).scope === "group" ? (s(), d("fieldset", Cn, [
1880
+ a("legend", null, t(l(i).groupFields), 1),
1881
+ (s(!0), d(C, null, x(l(w), (u) => (s(), d("label", {
1882
+ key: u.field
1883
+ }, [
1884
+ a("input", {
1885
+ type: "checkbox",
1886
+ checked: l(S).groupBy?.includes(u.field),
1887
+ disabled: e.readonly,
1888
+ onChange: (H) => l(m).toggleGroupField(
1889
+ u.field,
1890
+ H.target.checked
1891
+ )
1892
+ }, null, 40, Un),
1893
+ k(t(u.label), 1)
1894
+ ]))), 128))
1895
+ ])) : E("", !0),
1896
+ typeof l(S).expression != "string" ? (s(), fe(Yt, {
1897
+ key: 1,
1898
+ "model-value": l(S).expression,
1899
+ fields: l(w),
1900
+ messages: l(i),
1901
+ readonly: e.readonly,
1902
+ "onUpdate:modelValue": l(m).setExpression
1903
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"])) : (s(), d("p", Fn, t(l(S).expression), 1)),
1904
+ a("details", null, [
1905
+ a("summary", null, t(l(i).advanced), 1),
1906
+ a("div", Sn, [
1907
+ a("label", null, [
1908
+ k(t(l(i).digits), 1),
1909
+ F(a("input", {
1910
+ "aria-label": l(i).digits,
1911
+ "onUpdate:modelValue": c[5] || (c[5] = (u) => l(S).digits = u),
1912
+ type: "number",
1913
+ min: "0",
1914
+ max: "100",
1915
+ disabled: e.readonly
1916
+ }, null, 8, Mn), [
1917
+ [
1918
+ z,
1919
+ l(S).digits,
1920
+ void 0,
1921
+ { number: !0 }
1922
+ ]
1923
+ ])
1924
+ ]),
1925
+ a("label", null, [
1926
+ k(t(l(i).nulls), 1),
1927
+ F(a("select", {
1928
+ "aria-label": l(i).nulls,
1929
+ "onUpdate:modelValue": c[6] || (c[6] = (u) => l(S).nulls = u),
1930
+ disabled: e.readonly
1931
+ }, [
1932
+ a("option", xn, t(l(i).propagate), 1),
1933
+ a("option", Nn, t(l(i).error), 1)
1934
+ ], 8, Dn), [
1935
+ [L, l(S).nulls]
1936
+ ])
1937
+ ]),
1938
+ a("label", null, [
1939
+ k(t(l(i).division), 1),
1940
+ F(a("select", {
1941
+ "aria-label": l(i).division,
1942
+ "onUpdate:modelValue": c[7] || (c[7] = (u) => l(S).divisionByZero = u),
1943
+ disabled: e.readonly
1944
+ }, [
1945
+ a("option", En, t(l(i).error), 1),
1946
+ a("option", Kn, t(l(i).propagate), 1)
1947
+ ], 8, Rn), [
1948
+ [L, l(S).divisionByZero]
1949
+ ])
1950
+ ])
1951
+ ])
1952
+ ]),
1953
+ l(S).numeric === "decimal" ? (s(), d("p", Tn, t(l(i).decimalHint), 1)) : E("", !0),
1954
+ l(O).valid && l(S).field ? (s(), d("div", Ln, [
1955
+ k(t(l(i).dependencies), 1),
1956
+ a("strong", null, t(l(O).order.join(" → ")), 1)
1957
+ ])) : E("", !0),
1958
+ a("div", Bn, [
1959
+ a("button", {
1960
+ type: "button",
1961
+ disabled: e.readonly,
1962
+ onClick: c[8] || (c[8] = //@ts-ignore
1963
+ (...u) => l(m).check && l(m).check(...u))
1964
+ }, t(l(i).check), 9, On),
1965
+ a("button", {
1966
+ type: "button",
1967
+ class: "mr-rule-editor__primary",
1968
+ disabled: e.readonly || !l(O).valid,
1969
+ onClick: c[9] || (c[9] = //@ts-ignore
1970
+ (...u) => l(m).applyComputed && l(m).applyComputed(...u))
1971
+ }, t(l(i).apply), 9, An),
1972
+ l(Z) ? (s(), d("button", {
1973
+ key: 0,
1974
+ type: "button",
1975
+ disabled: e.readonly,
1976
+ onClick: c[10] || (c[10] = //@ts-ignore
1977
+ (...u) => l(m).removeComputed && l(m).removeComputed(...u))
1978
+ }, t(l(i).remove), 9, In)) : E("", !0)
1979
+ ]),
1980
+ !l(O).valid && l(S).field ? (s(), d("p", Wn, t(l(O).errors.join(";")), 1)) : E("", !0)
1981
+ ])) : l(h) === "groups" ? (s(), d("div", Gn, [
1982
+ a("div", Jn, [
1983
+ F(a("select", {
1984
+ "onUpdate:modelValue": c[11] || (c[11] = (u) => oe(T) ? T.value = u : null),
1985
+ "aria-label": l(i).groups
1986
+ }, [
1987
+ (s(!0), d(C, null, x(l(U), (u, H) => (s(), d("option", {
1988
+ key: H,
1989
+ value: H
1990
+ }, t(H + 1) + " · " + t(u.field), 9, jn))), 128)),
1991
+ l(U).length ? E("", !0) : (s(), d("option", Pn, t(l(i).noGroups), 1))
1992
+ ], 8, Hn), [
1993
+ [
1994
+ L,
1995
+ l(T),
1996
+ void 0,
1997
+ { number: !0 }
1998
+ ]
1999
+ ]),
2000
+ a("button", {
2001
+ type: "button",
2002
+ disabled: e.readonly || l(U).length >= 16,
2003
+ onClick: c[12] || (c[12] = //@ts-ignore
2004
+ (...u) => l(m).addGroup && l(m).addGroup(...u))
2005
+ }, " + " + t(l(i).addGroup), 9, zn)
2006
+ ]),
2007
+ l(M) ? (s(), d(C, { key: 0 }, [
2008
+ a("label", null, [
2009
+ k(t(l(i).field), 1),
2010
+ F(a("select", {
2011
+ "aria-label": l(i).field,
2012
+ "onUpdate:modelValue": c[13] || (c[13] = (u) => l(M).field = u),
2013
+ disabled: e.readonly
2014
+ }, [
2015
+ (s(!0), d(C, null, x(l(w), (u) => (s(), d("option", {
2016
+ key: u.field,
2017
+ value: u.field
2018
+ }, t(u.label), 9, Zn))), 128))
2019
+ ], 8, qn), [
2020
+ [L, l(M).field]
2021
+ ])
2022
+ ]),
2023
+ a("div", Qn, [
2024
+ a("label", null, [
2025
+ k(t(l(i).header), 1),
2026
+ F(a("input", {
2027
+ "aria-label": l(i).header,
2028
+ "onUpdate:modelValue": c[14] || (c[14] = (u) => l(M).headerTemplate = u),
2029
+ disabled: e.readonly,
2030
+ placeholder: "{value}"
2031
+ }, null, 8, Xn), [
2032
+ [z, l(M).headerTemplate]
2033
+ ])
2034
+ ]),
2035
+ a("label", null, [
2036
+ k(t(l(i).footer), 1),
2037
+ F(a("input", {
2038
+ "aria-label": l(i).footer,
2039
+ "onUpdate:modelValue": c[15] || (c[15] = (u) => l(M).subtotalLabel = u),
2040
+ disabled: e.readonly
2041
+ }, null, 8, Yn), [
2042
+ [z, l(M).subtotalLabel]
2043
+ ])
2044
+ ])
2045
+ ]),
2046
+ a("div", pn, [
2047
+ a("label", null, [
2048
+ F(a("input", {
2049
+ "onUpdate:modelValue": c[16] || (c[16] = (u) => l(M).keepWithNext = u),
2050
+ type: "checkbox",
2051
+ disabled: e.readonly
2052
+ }, null, 8, _n), [
2053
+ [de, l(M).keepWithNext]
2054
+ ]),
2055
+ k(t(l(i).orphan), 1)
2056
+ ]),
2057
+ a("label", null, [
2058
+ F(a("input", {
2059
+ "onUpdate:modelValue": c[17] || (c[17] = (u) => l(M).repeatHeader = u),
2060
+ type: "checkbox",
2061
+ disabled: e.readonly
2062
+ }, null, 8, ei), [
2063
+ [de, l(M).repeatHeader]
2064
+ ]),
2065
+ k(t(l(i).repeat), 1)
2066
+ ])
2067
+ ]),
2068
+ (s(!0), d(C, null, x(l(M).aggregates, (u, H) => (s(), d("div", {
2069
+ key: H,
2070
+ class: "mr-rule-editor__aggregate"
2071
+ }, [
2072
+ a("div", li, [
2073
+ a("label", null, [
2074
+ k(t(l(i).output), 1),
2075
+ F(a("select", {
2076
+ "aria-label": l(i).output,
2077
+ "onUpdate:modelValue": (B) => u.field = B,
2078
+ disabled: e.readonly
2079
+ }, [
2080
+ (s(!0), d(C, null, x(l(w), (B) => (s(), d("option", {
2081
+ key: B.field,
2082
+ value: B.field
2083
+ }, t(B.label), 9, ti))), 128))
2084
+ ], 8, ai), [
2085
+ [L, u.field]
2086
+ ])
2087
+ ]),
2088
+ a("label", null, [
2089
+ k(t(l(i).aggregate), 1),
2090
+ F(a("select", {
2091
+ "aria-label": l(i).aggregate,
2092
+ "onUpdate:modelValue": (B) => u.op = B,
2093
+ disabled: e.readonly
2094
+ }, [
2095
+ (s(!0), d(C, null, x(l(R).aggregates, (B) => (s(), d("option", {
2096
+ key: B,
2097
+ value: B
2098
+ }, t(l(i)[B]), 9, ii))), 128))
2099
+ ], 8, ni), [
2100
+ [L, u.op]
2101
+ ])
2102
+ ])
2103
+ ]),
2104
+ a("label", null, [
2105
+ k(t(l(i).measure), 1),
2106
+ F(a("select", {
2107
+ "aria-label": l(i).measure,
2108
+ "onUpdate:modelValue": (B) => u.valueField = B,
2109
+ disabled: e.readonly
2110
+ }, [
2111
+ a("option", di, t(u.field), 1),
2112
+ (s(!0), d(C, null, x(l(w), (B) => (s(), d("option", {
2113
+ key: B.field,
2114
+ value: B.field
2115
+ }, t(B.label), 9, oi))), 128))
2116
+ ], 8, si), [
2117
+ [L, u.valueField]
2118
+ ])
2119
+ ]),
2120
+ u.op === "weightedAvg" ? (s(), d("label", ui, [
2121
+ k(t(l(i).weight), 1),
2122
+ F(a("select", {
2123
+ "aria-label": l(i).weight,
2124
+ "onUpdate:modelValue": (B) => u.weightField = B,
2125
+ disabled: e.readonly
2126
+ }, [
2127
+ (s(!0), d(C, null, x(l(w), (B) => (s(), d("option", {
2128
+ key: B.field,
2129
+ value: B.field
2130
+ }, t(B.label), 9, ci))), 128))
2131
+ ], 8, ri), [
2132
+ [L, u.weightField]
2133
+ ])
2134
+ ])) : E("", !0),
2135
+ a("div", mi, [
2136
+ F(a("select", {
2137
+ "onUpdate:modelValue": (B) => u.numeric = B,
2138
+ disabled: e.readonly,
2139
+ "aria-label": l(i).numeric
2140
+ }, [
2141
+ a("option", bi, t(l(i).number), 1),
2142
+ a("option", gi, t(l(i).decimal), 1)
2143
+ ], 8, vi), [
2144
+ [L, u.numeric]
2145
+ ]),
2146
+ a("button", {
2147
+ type: "button",
2148
+ disabled: e.readonly,
2149
+ onClick: (B) => l(M).aggregates?.splice(H, 1)
2150
+ }, t(l(i).remove), 9, yi)
2151
+ ])
2152
+ ]))), 128)),
2153
+ a("button", {
2154
+ type: "button",
2155
+ disabled: e.readonly,
2156
+ onClick: c[18] || (c[18] = //@ts-ignore
2157
+ (...u) => l(m).addAggregate && l(m).addAggregate(...u))
2158
+ }, " + " + t(l(i).addAggregate), 9, fi),
2159
+ a("div", hi, [
2160
+ a("button", {
2161
+ type: "button",
2162
+ disabled: e.readonly || l(T) === 0,
2163
+ "aria-label": l(i).moveUp,
2164
+ onClick: c[19] || (c[19] = (u) => l(m).moveGroup(-1))
2165
+ }, " ↑ " + t(l(i).outer), 9, ki),
2166
+ a("button", {
2167
+ type: "button",
2168
+ disabled: e.readonly || l(T) >= l(U).length - 1,
2169
+ "aria-label": l(i).moveDown,
2170
+ onClick: c[20] || (c[20] = (u) => l(m).moveGroup(1))
2171
+ }, " ↓ " + t(l(i).inner), 9, $i),
2172
+ a("button", {
2173
+ type: "button",
2174
+ disabled: e.readonly,
2175
+ onClick: c[21] || (c[21] = //@ts-ignore
2176
+ (...u) => l(m).removeGroup && l(m).removeGroup(...u))
2177
+ }, t(l(i).remove), 9, Vi)
2178
+ ])
2179
+ ], 64)) : E("", !0),
2180
+ a("button", {
2181
+ type: "button",
2182
+ class: "mr-rule-editor__primary",
2183
+ disabled: e.readonly,
2184
+ onClick: c[22] || (c[22] = //@ts-ignore
2185
+ (...u) => l(m).applyGroups && l(m).applyGroups(...u))
2186
+ }, t(l(i).apply), 9, wi)
2187
+ ])) : l(h) === "conditions" ? (s(), d("div", Ci, [
2188
+ a("label", null, [
2189
+ k(t(l(i).column), 1),
2190
+ F(a("select", {
2191
+ "aria-label": l(i).column,
2192
+ "onUpdate:modelValue": c[23] || (c[23] = (u) => oe(W) ? W.value = u : null),
2193
+ disabled: e.readonly,
2194
+ onChange: c[24] || (c[24] = (u) => l(m).loadCondition(-1))
2195
+ }, [
2196
+ (s(!0), d(C, null, x(e.list.columns, (u) => (s(), d("option", {
2197
+ key: u.field,
2198
+ value: u.field
2199
+ }, t(u.header || u.field), 9, Fi))), 128))
2200
+ ], 40, Ui), [
2201
+ [L, l(W)]
2202
+ ])
2203
+ ]),
2204
+ a("label", null, [
2205
+ k(t(l(i).effect), 1),
2206
+ F(a("select", {
2207
+ "aria-label": l(i).effect,
2208
+ "onUpdate:modelValue": c[25] || (c[25] = (u) => oe(r) ? r.value = u : null),
2209
+ disabled: e.readonly,
2210
+ onChange: c[26] || (c[26] = (u) => l(m).loadCondition(-1))
2211
+ }, [
2212
+ a("option", Mi, t(l(i).style), 1),
2213
+ a("option", Di, t(l(i).cell), 1),
2214
+ a("option", xi, t(l(i).rowVisibility), 1)
2215
+ ], 40, Si), [
2216
+ [L, l(r)]
2217
+ ])
2218
+ ]),
2219
+ l(r) === "style" ? (s(), d("label", Ni, [
2220
+ k(t(l(i).existing), 1),
2221
+ a("select", {
2222
+ "aria-label": l(i).existing,
2223
+ value: l(I),
2224
+ disabled: e.readonly,
2225
+ onChange: c[27] || (c[27] = (u) => l(m).loadCondition(
2226
+ Number(u.target.value)
2227
+ ))
2228
+ }, [
2229
+ a("option", Ei, "+ " + t(l(i).newCondition), 1),
2230
+ (s(!0), d(C, null, x(l(q)?.rules, (u, H) => (s(), d("option", {
2231
+ key: H,
2232
+ value: H
2233
+ }, t(H + 1) + " · " + t("field" in u.when ? u.when.field : l(i).conditionGroup), 9, Ki))), 128))
2234
+ ], 40, Ri)
2235
+ ])) : E("", !0),
2236
+ re(we, {
2237
+ "model-value": l(n),
2238
+ fields: l(w),
2239
+ messages: l(i),
2240
+ readonly: e.readonly,
2241
+ "onUpdate:modelValue": l(m).setCondition
2242
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"]),
2243
+ l(r) === "style" ? (s(), d(C, { key: 1 }, [
2244
+ a("div", Ti, [
2245
+ a("label", null, [
2246
+ k(t(l(i).color), 1),
2247
+ F(a("input", {
2248
+ "onUpdate:modelValue": c[28] || (c[28] = (u) => l(b).color = u),
2249
+ type: "color",
2250
+ disabled: e.readonly
2251
+ }, null, 8, Li), [
2252
+ [z, l(b).color]
2253
+ ])
2254
+ ]),
2255
+ a("label", null, [
2256
+ k(t(l(i).background), 1),
2257
+ F(a("input", {
2258
+ "onUpdate:modelValue": c[29] || (c[29] = (u) => l(b).backgroundColor = u),
2259
+ type: "color",
2260
+ disabled: e.readonly
2261
+ }, null, 8, Bi), [
2262
+ [z, l(b).backgroundColor]
2263
+ ])
2264
+ ])
2265
+ ]),
2266
+ a("label", Oi, [
2267
+ F(a("input", {
2268
+ "onUpdate:modelValue": c[30] || (c[30] = (u) => l(b).bold = u),
2269
+ type: "checkbox",
2270
+ disabled: e.readonly
2271
+ }, null, 8, Ai), [
2272
+ [de, l(b).bold]
2273
+ ]),
2274
+ k(t(l(i).bold), 1)
2275
+ ])
2276
+ ], 64)) : E("", !0),
2277
+ a("div", Ii, [
2278
+ a("button", {
2279
+ type: "button",
2280
+ class: "mr-rule-editor__primary",
2281
+ disabled: e.readonly,
2282
+ onClick: c[31] || (c[31] = (u) => l(m).applyCondition())
2283
+ }, t(l(i).apply), 9, Wi),
2284
+ l(I) >= 0 || l(r) !== "style" ? (s(), d("button", {
2285
+ key: 0,
2286
+ type: "button",
2287
+ disabled: e.readonly,
2288
+ onClick: c[32] || (c[32] = (u) => l(m).applyCondition(!0))
2289
+ }, t(l(i).removeCondition), 9, Gi)) : E("", !0)
2290
+ ])
2291
+ ])) : E("", !0),
2292
+ (s(), d(C, null, x(["detail", "matrix", "tree"], (u) => F(re(kt, {
2293
+ key: `${u}-${ee.value}`,
2294
+ list: e.list,
2295
+ "recovery-key": e.recoveryKey,
2296
+ mode: u,
2297
+ datasets: e.datasets,
2298
+ "dataset-schema": e.datasetSchema,
2299
+ "dataset-schemas": e.datasetSchemas,
2300
+ readonly: e.readonly,
2301
+ messages: l(i),
2302
+ accept: l(m).applyLayout,
2303
+ onDirty: (H) => X.value = { ...X.value, [u]: H }
2304
+ }, null, 8, ["list", "recovery-key", "mode", "datasets", "dataset-schema", "dataset-schemas", "readonly", "messages", "accept", "onDirty"]), [
2305
+ [Ee, l(h) === u]
2306
+ ])), 64)),
2307
+ a("aside", Ji, [
2308
+ a("header", null, [
2309
+ a("strong", null, t(l(i).explanation), 1),
2310
+ Y.value ? (s(), d("span", Hi, t(l(i).pending), 1)) : E("", !0)
2311
+ ]),
2312
+ a("p", null, t(l(i).sourceHint), 1),
2313
+ l(h) === "computations" ? (s(), d(C, { key: 0 }, [
2314
+ a("h4", null, t(l(i).expression), 1),
2315
+ a("code", null, t(l(v)), 1),
2316
+ a("div", ji, [
2317
+ a("h4", null, t(l(i).sourceValues) + " → " + t(l(i).result), 1),
2318
+ (s(!0), d(C, null, x(l(D), (u) => (s(), d("div", {
2319
+ key: u.row,
2320
+ class: "mr-rule-editor__trace"
2321
+ }, [
2322
+ a("small", null, "#" + t(u.row), 1),
2323
+ a("code", null, t(u.values), 1),
2324
+ a("strong", null, t(l(f).find((H) => H.row === u.row)?.value ?? (l(f).length ? "—" : l(i).notChecked)), 1)
2325
+ ]))), 128)),
2326
+ l(f).some((u) => u.value == null) ? (s(), d("p", Pi, t(l(i).nullReason), 1)) : E("", !0),
2327
+ l(f).length ? (s(), d("p", zi, t(l(i).sample), 1)) : E("", !0)
2328
+ ])
2329
+ ], 64)) : E("", !0),
2330
+ l(o) ? (s(), d("p", qi, t(l(o)), 1)) : E("", !0)
2331
+ ])
2332
+ ], 8, _t));
2333
+ }
2334
+ }), ns = /* @__PURE__ */ me(Zi, [["__scopeId", "data-v-436ee307"]]);
2335
+ export {
2336
+ ns as default
2337
+ };