@agile-team/mach-report 2.8.4 → 2.9.1

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 (94) hide show
  1. package/README.md +27 -9
  2. package/dist/ExcelBindingWizard-DiaxvWpQ.cjs +1 -0
  3. package/dist/ExcelBindingWizard-RLJIXKKG.js +816 -0
  4. package/dist/{ReportPreview-DTWiCH5a.js → ReportPreview-B5ZNEasW.js} +22 -21
  5. package/dist/ReportPreview-DRtVPUYo.cjs +6 -0
  6. package/dist/RuleEditor-CskN5Fr3.cjs +1 -0
  7. package/dist/RuleEditor-CtJFzKuY.js +1578 -0
  8. package/dist/TemplateReviewPanel-C_Lmzis6.cjs +1 -0
  9. package/dist/TemplateReviewPanel-Cn32OY4_.js +173 -0
  10. package/dist/analytics.cjs +1 -1
  11. package/dist/analytics.d.cts +188 -5
  12. package/dist/analytics.d.ts +188 -5
  13. package/dist/analytics.js +68 -202
  14. package/dist/{assets-B9qJku3V.js → assets-DDsfEi8R.js} +3 -3
  15. package/dist/{assets-RZan7EyL.cjs → assets-ahTRUXRk.cjs} +1 -1
  16. package/dist/binding-preview-B5834rml.cjs +2 -0
  17. package/dist/binding-preview-ChXjN5L5.js +649 -0
  18. package/dist/{capabilities-joSutDF8.js → capabilities-Cm9hZ3uV.js} +5 -5
  19. package/dist/{capabilities-xGTpnPjJ.cjs → capabilities-DYzWL7KS.cjs} +1 -1
  20. package/dist/dataset-BkRmwgeJ.cjs +1 -0
  21. package/dist/dataset-H5pFuQGU.js +121 -0
  22. package/dist/defaults-DXhiM1ZD.js +10 -0
  23. package/dist/defaults-xhmcLLrf.cjs +1 -0
  24. package/dist/designer.cjs +2 -1
  25. package/dist/designer.d.cts +1373 -6
  26. package/dist/designer.d.ts +1373 -6
  27. package/dist/designer.js +2495 -767
  28. package/dist/grid-geometry-BNptEcMm.js +65 -0
  29. package/dist/grid-geometry-CZ_cYB6O.cjs +1 -0
  30. package/dist/import-template-CNMLJSQw.js +23030 -0
  31. package/dist/import-template-CpxunKVp.cjs +29 -0
  32. package/dist/index.cjs +7 -7
  33. package/dist/index.d.cts +202 -3
  34. package/dist/index.d.ts +202 -3
  35. package/dist/index.js +554 -535
  36. package/dist/matrix-CNPDJxED.js +745 -0
  37. package/dist/matrix-Div9Ilh3.cjs +1 -0
  38. package/dist/pdf.cjs +46 -46
  39. package/dist/pdf.d.cts +2 -0
  40. package/dist/pdf.d.ts +2 -0
  41. package/dist/pdf.js +17 -16
  42. package/dist/{plugin-CQmJXNcA.js → plugin-BWwIgZXV.js} +1 -1
  43. package/dist/{plugin-DSFu51Ua.cjs → plugin-Dg-J1Rbm.cjs} +1 -1
  44. package/dist/progress-7OSZbFok.js +39 -0
  45. package/dist/progress-BnLiS5eH.cjs +1 -0
  46. package/dist/render-plan-7xpGrCEl.cjs +1 -0
  47. package/dist/render-plan-Ck6koX9L.js +13 -0
  48. package/dist/server/node.d.cts +62 -0
  49. package/dist/server/node.d.ts +62 -0
  50. package/dist/server-node.cjs +1 -1
  51. package/dist/server-node.js +373 -145
  52. package/dist/server.cjs +1 -1
  53. package/dist/server.d.cts +311 -0
  54. package/dist/server.d.ts +311 -0
  55. package/dist/server.js +590 -186
  56. package/dist/{style-Dv5o_x6b.js → style-CQ1PK8ZB.js} +5 -5
  57. package/dist/style-UgIJSA1F.cjs +1 -0
  58. package/dist/style.css +1 -1
  59. package/dist/template-registry-CHMYZ7SD.cjs +1 -0
  60. package/dist/template-registry-R61AMCr0.js +433 -0
  61. package/dist/template-review-hvWWQFsi.js +1027 -0
  62. package/dist/template-review-jEcOfmGr.cjs +1 -0
  63. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  64. package/dist/{textwrap-DOl04hCQ.js → textwrap-DE1kgcJB.js} +1 -1
  65. package/dist/{validate-DfHPD8wX.cjs → validate-BDiMqkJC.cjs} +1 -1
  66. package/dist/{validate-S6CgIm5d.js → validate-DWPF7icl.js} +13 -13
  67. package/dist/vue/async.d.cts +186 -0
  68. package/dist/vue/async.d.ts +186 -0
  69. package/dist/vue/index.d.cts +271 -3
  70. package/dist/vue/index.d.ts +271 -3
  71. package/dist/vue-async.cjs +1 -1
  72. package/dist/vue-async.js +3 -3
  73. package/dist/vue.cjs +1 -1
  74. package/dist/vue.js +4 -4
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +2 -0
  77. package/dist/worker.d.ts +2 -0
  78. package/dist/worker.js +1 -1
  79. package/dist/xlsx.cjs +2 -30
  80. package/dist/xlsx.d.cts +268 -0
  81. package/dist/xlsx.d.ts +268 -0
  82. package/dist/xlsx.js +220 -23440
  83. package/package.json +1 -1
  84. package/dist/ReportPreview-DjGeWHY-.cjs +0 -6
  85. package/dist/progress-DD964VAB.js +0 -102
  86. package/dist/progress-KvhwXZ1Q.cjs +0 -1
  87. package/dist/render-plan-CckPEQyf.cjs +0 -1
  88. package/dist/render-plan-uzZYYSy1.js +0 -19
  89. package/dist/report-source-BXHNy_AD.js +0 -755
  90. package/dist/report-source-CCAvFE3t.cjs +0 -1
  91. package/dist/style-CpwiOPyB.cjs +0 -1
  92. package/dist/template-registry-DWExx0gU.cjs +0 -1
  93. package/dist/template-registry-NpOakidD.js +0 -354
  94. package/dist/textwrap-CnGsEum6.cjs +0 -4
@@ -0,0 +1,1578 @@
1
+ import { ref as A, computed as Z, watch as Y, defineComponent as _, openBlock as o, createElementBlock as n, createElementVNode as a, withDirectives as $, isRef as Q, vModelCheckbox as q, unref as l, createTextVNode as h, toDisplayString as t, Fragment as k, renderList as w, vModelSelect as D, vModelText as H, createCommentVNode as R, resolveComponent as me, normalizeClass as te, createVNode as ce, createBlock as ae } from "vue";
2
+ import { g as be, l as p, v as ve, d as ge } from "./matrix-CNPDJxED.js";
3
+ import { _ as ee } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { v as ye } from "./template-registry-R61AMCr0.js";
5
+ import { RULE_EDITOR_MESSAGES as fe } from "./designer.js";
6
+ const P = (e) => JSON.parse(JSON.stringify(e));
7
+ function he(e, J) {
8
+ const x = A(!1), O = A(""), c = A({
9
+ dataset: "",
10
+ parentKey: "",
11
+ foreignKey: "",
12
+ columns: []
13
+ }), i = A({
14
+ rowFields: [],
15
+ columnFields: [],
16
+ measures: []
17
+ }), v = A(), f = Z(() => [
18
+ .../* @__PURE__ */ new Set([
19
+ ...Object.keys(e.datasets ?? {}),
20
+ ...Object.keys(e.datasetSchemas ?? {})
21
+ ])
22
+ ]), C = Z(
23
+ () => N(e.list.dataset, e.datasetSchema)
24
+ ), G = Z(() => N(c.value.dataset));
25
+ function N(g, U) {
26
+ const F = /* @__PURE__ */ new Map();
27
+ for (const T of (U ?? e.datasetSchemas?.[g])?.fields ?? [])
28
+ F.set(T.field, T.label ?? T.field);
29
+ const B = e.datasets?.[g]?.[0];
30
+ for (const T of Object.keys(B ?? {}))
31
+ F.has(T) || F.set(T, T);
32
+ if (g === e.list.dataset)
33
+ for (const T of e.list.columns)
34
+ F.has(T.field) || F.set(T.field, T.header || T.field);
35
+ return [...F].map(([T, m]) => ({ field: T, label: m }));
36
+ }
37
+ function M() {
38
+ x.value = e.mode === "detail" ? !!e.list.detail : !!e.list.matrix;
39
+ const g = f.value.find((U) => U !== e.list.dataset) ?? "";
40
+ c.value = P(
41
+ e.list.detail ?? {
42
+ dataset: g,
43
+ parentKey: e.list.rowKey ?? e.datasetSchema?.rowKey ?? C.value[0]?.field ?? "",
44
+ foreignKey: "",
45
+ columns: [],
46
+ header: !0,
47
+ unmatched: "error"
48
+ }
49
+ ), i.value = P(
50
+ e.list.matrix ?? {
51
+ rowFields: [],
52
+ columnFields: [],
53
+ measures: [],
54
+ totals: !0
55
+ }
56
+ ), i.value.measures = i.value.measures.map((U) => ({ ...U, numeric: U.numeric ?? "number" })), O.value = "", v.value = void 0;
57
+ }
58
+ Y(() => [e.list, e.mode], M, { immediate: !0 });
59
+ function K(g) {
60
+ c.value.dataset = g, c.value.columns = [], c.value.foreignKey = G.value[0]?.field ?? "", c.value.rowKey = e.datasetSchemas?.[g]?.rowKey;
61
+ }
62
+ function j(g, U) {
63
+ if (U && !c.value.columns.some((F) => F.field === g)) {
64
+ const F = e.datasetSchemas?.[c.value.dataset]?.fields.find((B) => B.field === g);
65
+ c.value.columns.push({
66
+ field: g,
67
+ header: G.value.find((B) => B.field === g)?.label ?? g,
68
+ widthMm: 30,
69
+ align: "auto",
70
+ semanticRole: F?.semanticRole,
71
+ editable: !1
72
+ });
73
+ } else U || (c.value.columns = c.value.columns.filter(
74
+ (F) => F.field !== g
75
+ ));
76
+ }
77
+ function L(g, U, F) {
78
+ const B = i.value[g];
79
+ i.value[g] = F ? [.../* @__PURE__ */ new Set([...B, U])] : B.filter((T) => T !== U);
80
+ }
81
+ function r() {
82
+ i.value.measures = [
83
+ ...i.value.measures,
84
+ { field: C.value[0]?.field ?? "", op: "sum", numeric: "number" }
85
+ ];
86
+ }
87
+ function d(g) {
88
+ i.value.measures = i.value.measures.filter(
89
+ (U, F) => F !== g
90
+ );
91
+ }
92
+ function V() {
93
+ O.value = "", v.value = void 0;
94
+ try {
95
+ const g = e.datasets?.[e.list.dataset] ?? [];
96
+ if (!g.length) throw new Error(e.messages.noData);
97
+ const U = be(g.slice(0, 1e3), {
98
+ ...i.value,
99
+ maxInputRows: 1e3
100
+ });
101
+ v.value = {
102
+ columns: U.columns.slice(0, 5).map((F) => F.header),
103
+ rows: U.rows.slice(0, 5).map(
104
+ (F) => U.columns.slice(0, 5).map((B) => F[B.field])
105
+ )
106
+ };
107
+ } catch (g) {
108
+ O.value = g instanceof Error ? g.message : String(g);
109
+ }
110
+ }
111
+ function u() {
112
+ if (e.readonly) return;
113
+ const g = P(e.list);
114
+ e.mode === "detail" ? x.value ? (g.detail = P(c.value), delete g.matrix) : delete g.detail : x.value ? (g.matrix = P(i.value), delete g.detail, delete g.groups, delete g.groupBy, delete g.grandTotal) : delete g.matrix, J(g);
115
+ }
116
+ return {
117
+ enabled: x,
118
+ detail: c,
119
+ matrix: i,
120
+ datasets: f,
121
+ sourceFields: C,
122
+ childFields: G,
123
+ error: O,
124
+ preview: v,
125
+ chooseDataset: K,
126
+ toggleChildColumn: j,
127
+ toggleDimension: L,
128
+ addMeasure: r,
129
+ removeMeasure: d,
130
+ checkMatrix: V,
131
+ apply: u
132
+ };
133
+ }
134
+ const ke = { class: "mr-data-layout" }, Ve = { class: "mr-data-layout__check" }, $e = ["disabled"], Ce = { class: "mr-data-layout__hint" }, we = ["aria-label", "value", "disabled"], xe = {
135
+ value: "",
136
+ disabled: ""
137
+ }, Ue = ["value"], Se = { class: "mr-data-layout__pair" }, Me = ["aria-label", "disabled"], Fe = ["value"], Ee = ["aria-label", "disabled"], Re = {
138
+ value: "",
139
+ disabled: ""
140
+ }, Ke = ["value"], Ge = ["aria-label", "disabled"], De = { value: void 0 }, Ne = ["value"], Te = { class: "mr-data-layout__choices" }, Be = ["checked", "disabled", "onChange"], Ae = ["aria-label", "disabled"], Le = { class: "mr-data-layout__pair" }, We = ["aria-label", "disabled"], Ie = { value: "error" }, Oe = { value: "ignore" }, je = { class: "mr-data-layout__check" }, He = ["disabled"], Je = { class: "mr-data-layout__hint" }, Ze = ["checked", "disabled", "onChange"], ze = { class: "mr-data-layout__pair" }, qe = ["aria-label", "onUpdate:modelValue", "disabled"], Pe = ["value"], Qe = ["aria-label", "onUpdate:modelValue", "disabled"], Xe = ["value"], Ye = ["aria-label", "onUpdate:modelValue", "disabled", "placeholder"], _e = { key: 0 }, pe = ["aria-label", "onUpdate:modelValue", "disabled"], el = ["value"], ll = { class: "mr-data-layout__pair" }, al = ["aria-label", "onUpdate:modelValue", "disabled"], tl = { value: "number" }, sl = { value: "decimal" }, dl = ["aria-label", "onUpdate:modelValue", "disabled"], il = ["disabled", "onClick"], ol = ["disabled"], nl = { class: "mr-data-layout__check" }, ul = ["disabled"], rl = { class: "mr-data-layout__pair" }, ml = ["disabled"], cl = ["disabled"], bl = { class: "mr-data-layout__actions" }, vl = ["disabled"], gl = ["disabled"], yl = {
141
+ key: 2,
142
+ class: "mr-data-layout__preview"
143
+ }, fl = {
144
+ key: 3,
145
+ class: "mr-data-layout__error",
146
+ role: "alert"
147
+ }, hl = /* @__PURE__ */ _({
148
+ __name: "RuleDataLayout",
149
+ props: {
150
+ list: {},
151
+ mode: {},
152
+ datasets: {},
153
+ datasetSchema: {},
154
+ datasetSchemas: {},
155
+ readonly: { type: Boolean },
156
+ messages: {}
157
+ },
158
+ emits: ["change"],
159
+ setup(e, { emit: J }) {
160
+ const x = e, O = J, c = he(x, (L) => O("change", L)), {
161
+ enabled: i,
162
+ detail: v,
163
+ matrix: f,
164
+ datasets: C,
165
+ sourceFields: G,
166
+ childFields: N,
167
+ error: M,
168
+ preview: K
169
+ } = c, j = p();
170
+ return (L, r) => (o(), n("div", ke, [
171
+ a("label", Ve, [
172
+ $(a("input", {
173
+ "onUpdate:modelValue": r[0] || (r[0] = (d) => Q(i) ? i.value = d : null),
174
+ type: "checkbox",
175
+ disabled: e.readonly
176
+ }, null, 8, $e), [
177
+ [q, l(i)]
178
+ ]),
179
+ h(t(e.messages.enabled) + t(e.mode === "detail" ? e.messages.detail : e.messages.matrix), 1)
180
+ ]),
181
+ l(i) && e.mode === "detail" ? (o(), n(k, { key: 0 }, [
182
+ a("p", Ce, t(e.messages.detailHint), 1),
183
+ a("label", null, [
184
+ h(t(e.messages.childDataset), 1),
185
+ a("select", {
186
+ "aria-label": e.messages.childDataset,
187
+ value: l(v).dataset,
188
+ disabled: e.readonly,
189
+ onChange: r[1] || (r[1] = (d) => l(c).chooseDataset(d.target.value))
190
+ }, [
191
+ a("option", xe, t(e.messages.select), 1),
192
+ (o(!0), n(k, null, w(l(C), (d) => (o(), n("option", {
193
+ key: d,
194
+ value: d
195
+ }, t(d), 9, Ue))), 128))
196
+ ], 40, we)
197
+ ]),
198
+ a("div", Se, [
199
+ a("label", null, [
200
+ h(t(e.messages.parentKey), 1),
201
+ $(a("select", {
202
+ "aria-label": e.messages.parentKey,
203
+ "onUpdate:modelValue": r[2] || (r[2] = (d) => l(v).parentKey = d),
204
+ disabled: e.readonly
205
+ }, [
206
+ (o(!0), n(k, null, w(l(G), (d) => (o(), n("option", {
207
+ key: d.field,
208
+ value: d.field
209
+ }, t(d.label), 9, Fe))), 128))
210
+ ], 8, Me), [
211
+ [D, l(v).parentKey]
212
+ ])
213
+ ]),
214
+ a("label", null, [
215
+ h(t(e.messages.foreignKey), 1),
216
+ $(a("select", {
217
+ "aria-label": e.messages.foreignKey,
218
+ "onUpdate:modelValue": r[3] || (r[3] = (d) => l(v).foreignKey = d),
219
+ disabled: e.readonly
220
+ }, [
221
+ a("option", Re, t(e.messages.select), 1),
222
+ (o(!0), n(k, null, w(l(N), (d) => (o(), n("option", {
223
+ key: d.field,
224
+ value: d.field
225
+ }, t(d.label), 9, Ke))), 128))
226
+ ], 8, Ee), [
227
+ [D, l(v).foreignKey]
228
+ ])
229
+ ])
230
+ ]),
231
+ a("label", null, [
232
+ h(t(e.messages.rowKey), 1),
233
+ $(a("select", {
234
+ "aria-label": e.messages.rowKey,
235
+ "onUpdate:modelValue": r[4] || (r[4] = (d) => l(v).rowKey = d),
236
+ disabled: e.readonly
237
+ }, [
238
+ a("option", De, t(e.messages.noRowKey), 1),
239
+ (o(!0), n(k, null, w(l(N), (d) => (o(), n("option", {
240
+ key: d.field,
241
+ value: d.field
242
+ }, t(d.label), 9, Ne))), 128))
243
+ ], 8, Ge), [
244
+ [D, l(v).rowKey]
245
+ ])
246
+ ]),
247
+ a("fieldset", Te, [
248
+ a("legend", null, t(e.messages.childColumns), 1),
249
+ (o(!0), n(k, null, w(l(N), (d) => (o(), n("label", {
250
+ key: d.field
251
+ }, [
252
+ a("input", {
253
+ type: "checkbox",
254
+ checked: l(v).columns.some((V) => V.field === d.field),
255
+ disabled: e.readonly,
256
+ onChange: (V) => l(c).toggleChildColumn(
257
+ d.field,
258
+ V.target.checked
259
+ )
260
+ }, null, 40, Be),
261
+ h(t(d.label), 1)
262
+ ]))), 128))
263
+ ]),
264
+ a("label", null, [
265
+ h(t(e.messages.title), 1),
266
+ $(a("input", {
267
+ "aria-label": e.messages.title,
268
+ "onUpdate:modelValue": r[5] || (r[5] = (d) => l(v).label = d),
269
+ disabled: e.readonly
270
+ }, null, 8, Ae), [
271
+ [H, l(v).label]
272
+ ])
273
+ ]),
274
+ a("div", Le, [
275
+ a("label", null, [
276
+ h(t(e.messages.unmatched), 1),
277
+ $(a("select", {
278
+ "aria-label": e.messages.unmatched,
279
+ "onUpdate:modelValue": r[6] || (r[6] = (d) => l(v).unmatched = d),
280
+ disabled: e.readonly
281
+ }, [
282
+ a("option", Ie, t(e.messages.error), 1),
283
+ a("option", Oe, t(e.messages.ignore), 1)
284
+ ], 8, We), [
285
+ [D, l(v).unmatched]
286
+ ])
287
+ ]),
288
+ a("label", je, [
289
+ $(a("input", {
290
+ "onUpdate:modelValue": r[7] || (r[7] = (d) => l(v).header = d),
291
+ type: "checkbox",
292
+ disabled: e.readonly
293
+ }, null, 8, He), [
294
+ [q, l(v).header]
295
+ ]),
296
+ h(t(e.messages.childHeader), 1)
297
+ ])
298
+ ])
299
+ ], 64)) : l(i) ? (o(), n(k, { key: 1 }, [
300
+ a("p", Je, t(e.messages.matrixHint), 1),
301
+ (o(), n(k, null, w(["rowFields", "columnFields"], (d) => a("fieldset", {
302
+ key: d,
303
+ class: "mr-data-layout__choices"
304
+ }, [
305
+ a("legend", null, t(e.messages[d]), 1),
306
+ (o(!0), n(k, null, w(l(G), (V) => (o(), n("label", {
307
+ key: V.field
308
+ }, [
309
+ a("input", {
310
+ type: "checkbox",
311
+ checked: l(f)[d].includes(V.field),
312
+ disabled: e.readonly,
313
+ onChange: (u) => l(c).toggleDimension(
314
+ d,
315
+ V.field,
316
+ u.target.checked
317
+ )
318
+ }, null, 40, Ze),
319
+ h(t(V.label), 1)
320
+ ]))), 128))
321
+ ])), 64)),
322
+ (o(!0), n(k, null, w(l(f).measures, (d, V) => (o(), n("div", {
323
+ key: V,
324
+ class: "mr-data-layout__measure"
325
+ }, [
326
+ a("div", ze, [
327
+ a("label", null, [
328
+ h(t(e.messages.measure), 1),
329
+ $(a("select", {
330
+ "aria-label": e.messages.measure,
331
+ "onUpdate:modelValue": (u) => d.field = u,
332
+ disabled: e.readonly
333
+ }, [
334
+ (o(!0), n(k, null, w(l(G), (u) => (o(), n("option", {
335
+ key: u.field,
336
+ value: u.field
337
+ }, t(u.label), 9, Pe))), 128))
338
+ ], 8, qe), [
339
+ [D, d.field]
340
+ ])
341
+ ]),
342
+ a("label", null, [
343
+ h(t(e.messages.aggregate), 1),
344
+ $(a("select", {
345
+ "aria-label": e.messages.aggregate,
346
+ "onUpdate:modelValue": (u) => d.op = u,
347
+ disabled: e.readonly
348
+ }, [
349
+ (o(!0), n(k, null, w(l(j).aggregates, (u) => (o(), n("option", {
350
+ key: u,
351
+ value: u
352
+ }, t(e.messages[u]), 9, Xe))), 128))
353
+ ], 8, Qe), [
354
+ [D, d.op]
355
+ ])
356
+ ])
357
+ ]),
358
+ a("label", null, [
359
+ h(t(e.messages.measureLabel), 1),
360
+ $(a("input", {
361
+ "aria-label": e.messages.measureLabel,
362
+ "onUpdate:modelValue": (u) => d.label = u,
363
+ disabled: e.readonly,
364
+ placeholder: d.field
365
+ }, null, 8, Ye), [
366
+ [H, d.label]
367
+ ])
368
+ ]),
369
+ d.op === "weightedAvg" ? (o(), n("label", _e, [
370
+ h(t(e.messages.weight), 1),
371
+ $(a("select", {
372
+ "aria-label": e.messages.weight,
373
+ "onUpdate:modelValue": (u) => d.weightField = u,
374
+ disabled: e.readonly
375
+ }, [
376
+ (o(!0), n(k, null, w(l(G), (u) => (o(), n("option", {
377
+ key: u.field,
378
+ value: u.field
379
+ }, t(u.label), 9, el))), 128))
380
+ ], 8, pe), [
381
+ [D, d.weightField]
382
+ ])
383
+ ])) : R("", !0),
384
+ a("div", ll, [
385
+ a("label", null, [
386
+ h(t(e.messages.numeric), 1),
387
+ $(a("select", {
388
+ "aria-label": e.messages.numeric,
389
+ "onUpdate:modelValue": (u) => d.numeric = u,
390
+ disabled: e.readonly
391
+ }, [
392
+ a("option", tl, t(e.messages.number), 1),
393
+ a("option", sl, t(e.messages.decimal), 1)
394
+ ], 8, al), [
395
+ [D, d.numeric]
396
+ ])
397
+ ]),
398
+ a("label", null, [
399
+ h(t(e.messages.digits), 1),
400
+ $(a("input", {
401
+ "aria-label": e.messages.digits,
402
+ "onUpdate:modelValue": (u) => d.digits = u,
403
+ type: "number",
404
+ min: "0",
405
+ max: "100",
406
+ disabled: e.readonly
407
+ }, null, 8, dl), [
408
+ [
409
+ H,
410
+ d.digits,
411
+ void 0,
412
+ { number: !0 }
413
+ ]
414
+ ])
415
+ ])
416
+ ]),
417
+ a("button", {
418
+ type: "button",
419
+ disabled: e.readonly,
420
+ onClick: (u) => l(c).removeMeasure(V)
421
+ }, t(e.messages.remove), 9, il)
422
+ ]))), 128)),
423
+ a("button", {
424
+ type: "button",
425
+ disabled: e.readonly || l(f).measures.length >= 32,
426
+ onClick: r[8] || (r[8] = //@ts-ignore
427
+ (...d) => l(c).addMeasure && l(c).addMeasure(...d))
428
+ }, " + " + t(e.messages.addAggregate), 9, ol),
429
+ a("label", nl, [
430
+ $(a("input", {
431
+ "onUpdate:modelValue": r[9] || (r[9] = (d) => l(f).totals = d),
432
+ type: "checkbox",
433
+ disabled: e.readonly
434
+ }, null, 8, ul), [
435
+ [q, l(f).totals]
436
+ ]),
437
+ h(t(e.messages.totals), 1)
438
+ ]),
439
+ a("details", null, [
440
+ a("summary", null, t(e.messages.widthSettings), 1),
441
+ a("div", rl, [
442
+ a("label", null, [
443
+ h(t(e.messages.dimensionWidth), 1),
444
+ $(a("input", {
445
+ "onUpdate:modelValue": r[10] || (r[10] = (d) => l(f).rowWidthMm = d),
446
+ type: "number",
447
+ min: "1",
448
+ disabled: e.readonly,
449
+ placeholder: "40"
450
+ }, null, 8, ml), [
451
+ [
452
+ H,
453
+ l(f).rowWidthMm,
454
+ void 0,
455
+ { number: !0 }
456
+ ]
457
+ ])
458
+ ]),
459
+ a("label", null, [
460
+ h(t(e.messages.measureWidth), 1),
461
+ $(a("input", {
462
+ "onUpdate:modelValue": r[11] || (r[11] = (d) => l(f).columnWidthMm = d),
463
+ type: "number",
464
+ min: "1",
465
+ disabled: e.readonly,
466
+ placeholder: "28"
467
+ }, null, 8, cl), [
468
+ [
469
+ H,
470
+ l(f).columnWidthMm,
471
+ void 0,
472
+ { number: !0 }
473
+ ]
474
+ ])
475
+ ])
476
+ ])
477
+ ])
478
+ ], 64)) : R("", !0),
479
+ a("div", bl, [
480
+ l(i) && e.mode === "matrix" ? (o(), n("button", {
481
+ key: 0,
482
+ type: "button",
483
+ disabled: e.readonly,
484
+ onClick: r[12] || (r[12] = //@ts-ignore
485
+ (...d) => l(c).checkMatrix && l(c).checkMatrix(...d))
486
+ }, t(e.messages.check), 9, vl)) : R("", !0),
487
+ a("button", {
488
+ type: "button",
489
+ class: "mr-data-layout__primary",
490
+ disabled: e.readonly,
491
+ onClick: r[13] || (r[13] = //@ts-ignore
492
+ (...d) => l(c).apply && l(c).apply(...d))
493
+ }, t(e.messages.apply), 9, gl)
494
+ ]),
495
+ l(K) ? (o(), n("div", yl, [
496
+ a("p", null, t(e.messages.sample), 1),
497
+ a("table", null, [
498
+ a("thead", null, [
499
+ a("tr", null, [
500
+ (o(!0), n(k, null, w(l(K).columns, (d, V) => (o(), n("th", { key: V }, t(d), 1))), 128))
501
+ ])
502
+ ]),
503
+ a("tbody", null, [
504
+ (o(!0), n(k, null, w(l(K).rows, (d, V) => (o(), n("tr", { key: V }, [
505
+ (o(!0), n(k, null, w(d, (u, g) => (o(), n("td", { key: g }, t(u ?? "—"), 1))), 128))
506
+ ]))), 128))
507
+ ])
508
+ ])
509
+ ])) : R("", !0),
510
+ l(M) ? (o(), n("p", fl, t(l(M)), 1)) : R("", !0)
511
+ ]));
512
+ }
513
+ }), kl = /* @__PURE__ */ ee(hl, [["__scopeId", "data-v-57e89011"]]), Vl = { class: "mr-expression__row" }, $l = ["value", "disabled", "aria-label"], Cl = { value: "field" }, wl = { value: "constant" }, xl = {
514
+ key: 0,
515
+ value: "operation"
516
+ }, Ul = { value: "aggregate" }, Sl = ["value", "disabled", "aria-label"], Ml = ["value"], Fl = ["value", "disabled", "aria-label"], El = ["value"], Rl = ["value", "disabled", "aria-label"], Kl = ["value"], Gl = ["value", "disabled", "aria-label"], Dl = { value: "text" }, Nl = { value: "number" }, Tl = { value: "boolean" }, Bl = { value: "null" }, Al = ["value", "disabled", "aria-label"], Ll = {
517
+ key: 0,
518
+ value: ""
519
+ }, Wl = ["value"], Il = ["value", "disabled", "aria-label"], Ol = {
520
+ value: "",
521
+ disabled: ""
522
+ }, jl = ["value"], Hl = ["value", "disabled", "aria-label"], Jl = { value: "true" }, Zl = { value: "false" }, zl = ["type", "value", "disabled", "aria-label"], ql = ["disabled", "aria-label", "onClick"], Pl = ["disabled"], Ql = /* @__PURE__ */ _({
523
+ __name: "ReportExpressionEditor",
524
+ props: {
525
+ modelValue: {},
526
+ fields: {},
527
+ messages: {},
528
+ readonly: { type: Boolean },
529
+ depth: {}
530
+ },
531
+ emits: ["update:modelValue"],
532
+ setup(e, { emit: J }) {
533
+ const x = e, O = J, c = p(), i = Z(
534
+ () => "aggregate" in x.modelValue ? "aggregate" : "field" in x.modelValue ? "field" : "value" in x.modelValue ? "constant" : "operation"
535
+ ), v = A("text");
536
+ Y(
537
+ () => x.modelValue,
538
+ (r) => {
539
+ "value" in r && (v.value = r.value === null ? "null" : typeof r.value == "string" ? "text" : typeof r.value);
540
+ },
541
+ { immediate: !0 }
542
+ );
543
+ function f(r) {
544
+ x.readonly || O("update:modelValue", r);
545
+ }
546
+ function C(r) {
547
+ f(r === "aggregate" ? { aggregate: "sum", field: x.fields[0]?.field ?? "" } : r === "field" ? { field: x.fields[0]?.field ?? "" } : r === "constant" ? { value: "" } : {
548
+ op: "add",
549
+ args: [{ field: x.fields[0]?.field ?? "" }, { value: 0 }]
550
+ });
551
+ }
552
+ function G(r) {
553
+ const d = r, V = "args" in x.modelValue ? x.modelValue.args : [{ value: 0 }, { value: 0 }];
554
+ f({
555
+ op: d,
556
+ args: d === "divide" || d === "subtract" ? V.slice(0, 2) : V
557
+ });
558
+ }
559
+ function N(r, d) {
560
+ "args" in x.modelValue && f({
561
+ ...x.modelValue,
562
+ args: x.modelValue.args.map(
563
+ (V, u) => u === r ? d : V
564
+ )
565
+ });
566
+ }
567
+ function M(r) {
568
+ if (!("args" in x.modelValue)) return;
569
+ const d = r === void 0 ? [...x.modelValue.args, { value: 0 }] : x.modelValue.args.filter((V, u) => u !== r);
570
+ f({ ...x.modelValue, args: d });
571
+ }
572
+ function K(r) {
573
+ v.value = r, f({
574
+ value: r === "null" ? null : r === "boolean" ? !1 : r === "number" ? 0 : ""
575
+ });
576
+ }
577
+ function j(r) {
578
+ v.value === "number" ? r.trim() && Number.isFinite(Number(r)) && f({ value: Number(r) }) : f({ value: r });
579
+ }
580
+ function L(r, d) {
581
+ if (!("aggregate" in x.modelValue)) return;
582
+ const V = { ...x.modelValue, [r]: d };
583
+ r === "aggregate" && (V.aggregate = d), r === "field" && !d && delete V.field, f(V);
584
+ }
585
+ return (r, d) => {
586
+ const V = me("ReportExpressionEditor", !0);
587
+ return o(), n("div", {
588
+ class: te(["mr-expression", { "mr-expression--nested": (e.depth ?? 0) > 0 }])
589
+ }, [
590
+ a("div", Vl, [
591
+ a("select", {
592
+ value: i.value,
593
+ disabled: e.readonly,
594
+ "aria-label": e.messages.argument,
595
+ onChange: d[0] || (d[0] = (u) => C(u.target.value))
596
+ }, [
597
+ a("option", Cl, t(e.messages.field), 1),
598
+ a("option", wl, t(e.messages.constant), 1),
599
+ (e.depth ?? 0) < 12 ? (o(), n("option", xl, t(e.messages.operation), 1)) : R("", !0),
600
+ a("option", Ul, t(e.messages.aggregate), 1)
601
+ ], 40, $l),
602
+ "field" in e.modelValue && !("aggregate" in e.modelValue) ? (o(), n("select", {
603
+ key: 0,
604
+ value: e.modelValue.field,
605
+ disabled: e.readonly,
606
+ "aria-label": e.messages.field,
607
+ onChange: d[1] || (d[1] = (u) => f({ field: u.target.value }))
608
+ }, [
609
+ (o(!0), n(k, null, w(e.fields, (u) => (o(), n("option", {
610
+ key: u.field,
611
+ value: u.field
612
+ }, t(u.label), 9, Ml))), 128))
613
+ ], 40, Sl)) : "op" in e.modelValue ? (o(), n("select", {
614
+ key: 1,
615
+ value: e.modelValue.op,
616
+ disabled: e.readonly,
617
+ "aria-label": e.messages.operation,
618
+ onChange: d[2] || (d[2] = (u) => G(u.target.value))
619
+ }, [
620
+ (o(!0), n(k, null, w(l(c).operations, (u) => (o(), n("option", {
621
+ key: u,
622
+ value: u
623
+ }, t(e.messages[u]), 9, El))), 128))
624
+ ], 40, Fl)) : "aggregate" in e.modelValue ? (o(), n("select", {
625
+ key: 2,
626
+ value: e.modelValue.aggregate,
627
+ disabled: e.readonly,
628
+ "aria-label": e.messages.aggregate,
629
+ onChange: d[3] || (d[3] = (u) => L("aggregate", u.target.value))
630
+ }, [
631
+ (o(!0), n(k, null, w(l(c).aggregates, (u) => (o(), n("option", {
632
+ key: u,
633
+ value: u
634
+ }, t(e.messages[u]), 9, Kl))), 128))
635
+ ], 40, Rl)) : (o(), n("select", {
636
+ key: 3,
637
+ value: v.value,
638
+ disabled: e.readonly,
639
+ "aria-label": e.messages.resultType,
640
+ onChange: d[4] || (d[4] = (u) => K(u.target.value))
641
+ }, [
642
+ a("option", Dl, t(e.messages.text), 1),
643
+ a("option", Nl, t(e.messages.number), 1),
644
+ a("option", Tl, t(e.messages.boolean), 1),
645
+ a("option", Bl, t(e.messages.null), 1)
646
+ ], 40, Gl))
647
+ ]),
648
+ "aggregate" in e.modelValue ? (o(), n(k, { key: 0 }, [
649
+ a("select", {
650
+ value: e.modelValue.field ?? "",
651
+ disabled: e.readonly,
652
+ "aria-label": e.messages.measure,
653
+ onChange: d[5] || (d[5] = (u) => L("field", u.target.value))
654
+ }, [
655
+ e.modelValue.aggregate === "count" ? (o(), n("option", Ll, t(e.messages.allRows), 1)) : R("", !0),
656
+ (o(!0), n(k, null, w(e.fields, (u) => (o(), n("option", {
657
+ key: u.field,
658
+ value: u.field
659
+ }, t(u.label), 9, Wl))), 128))
660
+ ], 40, Al),
661
+ e.modelValue.aggregate === "weightedAvg" ? (o(), n("select", {
662
+ key: 0,
663
+ value: e.modelValue.weightField ?? "",
664
+ disabled: e.readonly,
665
+ "aria-label": e.messages.weight,
666
+ onChange: d[6] || (d[6] = (u) => L(
667
+ "weightField",
668
+ u.target.value
669
+ ))
670
+ }, [
671
+ a("option", Ol, t(e.messages.weight), 1),
672
+ (o(!0), n(k, null, w(e.fields, (u) => (o(), n("option", {
673
+ key: u.field,
674
+ value: u.field
675
+ }, t(u.label), 9, jl))), 128))
676
+ ], 40, Il)) : R("", !0)
677
+ ], 64)) : "value" in e.modelValue ? (o(), n(k, { key: 1 }, [
678
+ v.value === "boolean" ? (o(), n("select", {
679
+ key: 0,
680
+ value: String(e.modelValue.value),
681
+ disabled: e.readonly,
682
+ "aria-label": e.messages.constant,
683
+ onChange: d[7] || (d[7] = (u) => f({
684
+ value: u.target.value === "true"
685
+ }))
686
+ }, [
687
+ a("option", Jl, t(e.messages.true), 1),
688
+ a("option", Zl, t(e.messages.false), 1)
689
+ ], 40, Hl)) : v.value !== "null" ? (o(), n("input", {
690
+ key: 1,
691
+ type: v.value === "number" ? "number" : "text",
692
+ value: e.modelValue.value ?? "",
693
+ disabled: e.readonly,
694
+ "aria-label": e.messages.constant,
695
+ onInput: d[8] || (d[8] = (u) => j(u.target.value))
696
+ }, null, 40, zl)) : R("", !0)
697
+ ], 64)) : "args" in e.modelValue ? (o(), n(k, { key: 2 }, [
698
+ (o(!0), n(k, null, w(e.modelValue.args, (u, g) => (o(), n("div", {
699
+ key: g,
700
+ class: "mr-expression__argument"
701
+ }, [
702
+ ce(V, {
703
+ "model-value": u,
704
+ fields: e.fields,
705
+ messages: e.messages,
706
+ readonly: e.readonly,
707
+ depth: (e.depth ?? 0) + 1,
708
+ "onUpdate:modelValue": (U) => N(g, U)
709
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "depth", "onUpdate:modelValue"]),
710
+ e.modelValue.args.length > 2 ? (o(), n("button", {
711
+ key: 0,
712
+ type: "button",
713
+ disabled: e.readonly,
714
+ "aria-label": `${e.messages.remove} ${e.messages.argument} ${g + 1}`,
715
+ onClick: (U) => M(g)
716
+ }, " × ", 8, ql)) : R("", !0)
717
+ ]))), 128)),
718
+ !["subtract", "divide"].includes(e.modelValue.op) && e.modelValue.args.length < 16 ? (o(), n("button", {
719
+ key: 0,
720
+ type: "button",
721
+ disabled: e.readonly,
722
+ onClick: d[9] || (d[9] = (u) => M())
723
+ }, " + " + t(e.messages.addArgument), 9, Pl)) : R("", !0)
724
+ ], 64)) : R("", !0)
725
+ ], 2);
726
+ };
727
+ }
728
+ }), Xl = /* @__PURE__ */ ee(Ql, [["__scopeId", "data-v-84e5c0e5"]]), I = (e) => JSON.parse(JSON.stringify(e));
729
+ function Yl(e, J) {
730
+ const x = Z(() => ({
731
+ ...fe,
732
+ ...e.messages
733
+ })), O = A("computations"), c = A(""), i = A(""), v = A({
734
+ field: "",
735
+ expression: { field: "" },
736
+ scope: "row"
737
+ }), f = A([]), C = A(0), G = A(""), N = A(-1), M = A("style"), K = A({ field: "", op: ">", value: 0 }), j = A({
738
+ color: "#b91c1c",
739
+ backgroundColor: "#fff1f2",
740
+ bold: !1
741
+ }), L = A([]), r = Z(() => {
742
+ const b = /* @__PURE__ */ new Map();
743
+ for (const y of e.datasetSchema?.fields ?? [])
744
+ b.set(y.field, y.label ?? y.field);
745
+ for (const y of e.list.columns)
746
+ b.has(y.field) || b.set(y.field, y.header || y.field);
747
+ for (const y of Object.keys(
748
+ e.datasets?.[e.list.dataset]?.[0] ?? {}
749
+ ))
750
+ b.has(y) || b.set(y, y);
751
+ return [...b].map(([y, E]) => ({ field: y, label: E }));
752
+ }), d = Z(() => f.value[C.value]), V = Z(
753
+ () => e.list.columns.find((b) => b.field === G.value)
754
+ ), u = Z(() => ve(F()));
755
+ function g() {
756
+ f.value = I(
757
+ e.list.groups ?? (e.list.groupBy ? [e.list.groupBy] : [])
758
+ );
759
+ for (const b of f.value) for (const y of b.aggregates ?? []) y.numeric ??= "number";
760
+ e.list.columns.some((b) => b.field === G.value) || (G.value = e.list.columns[0]?.field ?? ""), c.value = "", L.value = [], U(i.value), le(-1);
761
+ }
762
+ Y(() => e.list, g, { immediate: !0 });
763
+ function U(b) {
764
+ i.value = b, v.value = I(
765
+ e.list.computed?.find((y) => y.field === b) ?? {
766
+ field: "",
767
+ expression: { field: r.value[0]?.field ?? "" },
768
+ scope: "row"
769
+ }
770
+ ), v.value.numeric ??= "number", L.value = [], c.value = "";
771
+ }
772
+ function F() {
773
+ return [
774
+ ...(e.list.computed ?? []).filter((y) => y.field !== i.value),
775
+ I(v.value)
776
+ ];
777
+ }
778
+ function B(b) {
779
+ if (e.readonly) return !1;
780
+ const y = ye({
781
+ pages: [
782
+ {
783
+ widthMm: Math.max(1, b.leftMm + b.widthMm),
784
+ heightMm: 297,
785
+ components: [b]
786
+ }
787
+ ]
788
+ });
789
+ return y.ok ? (c.value = "", J(b), !0) : (c.value = y.errors.map((E) => E.message).slice(0, 3).join(";"), !1);
790
+ }
791
+ function T() {
792
+ if (!v.value.field.trim()) {
793
+ c.value = x.value.missingTarget;
794
+ return;
795
+ }
796
+ const b = I(e.list);
797
+ b.computed = F(), b.columns.some((y) => y.field === v.value.field) || b.columns.push({
798
+ field: v.value.field,
799
+ header: v.value.field,
800
+ widthMm: 30,
801
+ semanticRole: "measure",
802
+ align: "right",
803
+ editable: !1,
804
+ format: {
805
+ kind: "number",
806
+ ...v.value.digits === void 0 ? {} : { digits: v.value.digits }
807
+ }
808
+ }), B(b) && (i.value = v.value.field);
809
+ }
810
+ function m() {
811
+ if (!i.value) return;
812
+ const b = I(e.list);
813
+ b.computed = (b.computed ?? []).filter(
814
+ (y) => y.field !== i.value
815
+ ), B(b) && U("");
816
+ }
817
+ function s() {
818
+ L.value = [], c.value = "";
819
+ const b = e.datasets?.[e.list.dataset];
820
+ if (!b?.length) {
821
+ c.value = x.value.noData;
822
+ return;
823
+ }
824
+ try {
825
+ const y = ge(b.slice(0, 1e3), {
826
+ fields: F(),
827
+ maxRows: 1e3,
828
+ maxCells: 2e6
829
+ });
830
+ L.value = y.rows.slice(0, 5).map((E, z) => ({
831
+ row: z + 1,
832
+ value: E[v.value.field]
833
+ }));
834
+ } catch (y) {
835
+ c.value = y instanceof Error ? y.message : String(y);
836
+ }
837
+ }
838
+ function W(b) {
839
+ v.value.expression = b;
840
+ }
841
+ function S(b, y) {
842
+ v.value.groupBy = y ? [...v.value.groupBy ?? [], b] : (v.value.groupBy ?? []).filter((E) => E !== b);
843
+ }
844
+ function se() {
845
+ f.value.push({
846
+ field: r.value[0]?.field ?? "",
847
+ headerTemplate: "{value}",
848
+ subtotalLabel: x.value.subtotalLabel,
849
+ aggregates: [],
850
+ keepWithNext: !0
851
+ }), C.value = f.value.length - 1;
852
+ }
853
+ function de(b) {
854
+ const y = C.value, E = y + b;
855
+ E < 0 || E >= f.value.length || ([f.value[y], f.value[E]] = [
856
+ f.value[E],
857
+ f.value[y]
858
+ ], C.value = E);
859
+ }
860
+ function ie() {
861
+ f.value.splice(C.value, 1), C.value = Math.max(
862
+ 0,
863
+ Math.min(C.value, f.value.length - 1)
864
+ );
865
+ }
866
+ function oe() {
867
+ d.value && (d.value.aggregates ??= []).push({
868
+ field: r.value[0]?.field ?? "",
869
+ op: "sum",
870
+ numeric: "number"
871
+ });
872
+ }
873
+ function ne() {
874
+ const b = I(e.list);
875
+ b.groups = I(f.value), delete b.groupBy, B(b);
876
+ }
877
+ function le(b) {
878
+ N.value = b;
879
+ const y = M.value === "cell" ? V.value?.visibleWhen : M.value === "rowVisibility" ? e.list.rowVisibleWhen : V.value?.rules?.[b]?.when;
880
+ K.value = I(y ?? { field: G.value, op: ">", value: 0 });
881
+ const E = V.value?.rules?.[b]?.style;
882
+ j.value = {
883
+ color: String(E?.color ?? "#b91c1c"),
884
+ backgroundColor: String(E?.backgroundColor ?? "#fff1f2"),
885
+ bold: E?.bold === !0
886
+ };
887
+ }
888
+ function ue(b) {
889
+ const y = e.datasetSchema?.fields.find(
890
+ (X) => X.field === K.value.field
891
+ ), E = e.datasets?.[e.list.dataset]?.find(
892
+ (X) => X[K.value.field] != null
893
+ )?.[K.value.field], z = y?.type === "number" || !y && typeof E == "number";
894
+ y?.type === "decimal" ? K.value.numeric = "decimal" : z ? K.value.numeric = "number" : delete K.value.numeric, K.value.value = z && b.trim() && Number.isFinite(Number(b)) ? Number(b) : b;
895
+ }
896
+ function re(b = !1) {
897
+ const y = I(e.list), E = y.columns.find((z) => z.field === G.value);
898
+ if (!E) {
899
+ c.value = x.value.noSelection;
900
+ return;
901
+ }
902
+ if (M.value === "rowVisibility")
903
+ b ? delete y.rowVisibleWhen : y.rowVisibleWhen = I(K.value);
904
+ else if (M.value === "cell")
905
+ b ? delete E.visibleWhen : E.visibleWhen = I(K.value);
906
+ else if (E.rules ??= [], b && N.value >= 0)
907
+ E.rules.splice(N.value, 1);
908
+ else {
909
+ if (b) return;
910
+ N.value < 0 ? E.rules.push({
911
+ when: I(K.value),
912
+ style: { ...j.value }
913
+ }) : E.rules[N.value] = {
914
+ when: I(K.value),
915
+ style: { ...j.value }
916
+ };
917
+ }
918
+ B(y);
919
+ }
920
+ return {
921
+ m: x,
922
+ tab: O,
923
+ fields: r,
924
+ formula: v,
925
+ groups: f,
926
+ groupIndex: C,
927
+ currentGroup: d,
928
+ column: G,
929
+ currentColumn: V,
930
+ conditionIndex: N,
931
+ effect: M,
932
+ when: K,
933
+ style: j,
934
+ error: c,
935
+ preview: L,
936
+ diagnostics: u,
937
+ selectedComputed: i,
938
+ loadComputed: U,
939
+ applyComputed: T,
940
+ removeComputed: m,
941
+ check: s,
942
+ setExpression: W,
943
+ toggleGroupField: S,
944
+ addGroup: se,
945
+ moveGroup: de,
946
+ removeGroup: ie,
947
+ addAggregate: oe,
948
+ applyGroups: ne,
949
+ loadCondition: le,
950
+ setThreshold: ue,
951
+ applyCondition: re,
952
+ applyLayout: B
953
+ };
954
+ }
955
+ const _l = ["aria-label"], pl = ["aria-label"], ea = ["aria-selected", "onClick"], la = { key: 0 }, aa = { key: 1 }, ta = {
956
+ key: 0,
957
+ class: "mr-rule-editor__panel"
958
+ }, sa = ["aria-label", "value", "disabled"], da = { value: "" }, ia = ["value"], oa = ["aria-label", "disabled"], na = { class: "mr-rule-editor__pair" }, ua = ["aria-label", "disabled"], ra = ["value"], ma = ["aria-label", "disabled"], ca = { value: "number" }, ba = { value: "decimal" }, va = {
959
+ key: 0,
960
+ class: "mr-rule-editor__checks"
961
+ }, ga = ["checked", "disabled", "onChange"], ya = {
962
+ key: 2,
963
+ class: "mr-rule-editor__hint"
964
+ }, fa = { class: "mr-rule-editor__advanced" }, ha = ["aria-label", "disabled"], ka = ["aria-label", "disabled"], Va = { value: "propagate" }, $a = { value: "error" }, Ca = ["aria-label", "disabled"], wa = { value: "error" }, xa = { value: "null" }, Ua = {
965
+ key: 3,
966
+ class: "mr-rule-editor__hint"
967
+ }, Sa = {
968
+ key: 4,
969
+ class: "mr-rule-editor__diagnostic"
970
+ }, Ma = { class: "mr-rule-editor__actions" }, Fa = ["disabled"], Ea = ["disabled"], Ra = ["disabled"], Ka = {
971
+ key: 5,
972
+ class: "mr-rule-editor__results"
973
+ }, Ga = {
974
+ key: 6,
975
+ class: "mr-rule-editor__error"
976
+ }, Da = {
977
+ key: 1,
978
+ class: "mr-rule-editor__panel"
979
+ }, Na = { class: "mr-rule-editor__pair" }, Ta = ["aria-label"], Ba = ["value"], Aa = {
980
+ key: 0,
981
+ value: 0
982
+ }, La = ["disabled"], Wa = ["aria-label", "disabled"], Ia = ["value"], Oa = { class: "mr-rule-editor__pair" }, ja = ["aria-label", "disabled"], Ha = ["aria-label", "disabled"], Ja = { class: "mr-rule-editor__checks" }, Za = ["disabled"], za = ["disabled"], qa = { class: "mr-rule-editor__pair" }, Pa = ["aria-label", "onUpdate:modelValue", "disabled"], Qa = ["value"], Xa = ["aria-label", "onUpdate:modelValue", "disabled"], Ya = ["value"], _a = ["aria-label", "onUpdate:modelValue", "disabled"], pa = { value: void 0 }, et = ["value"], lt = { key: 0 }, at = ["aria-label", "onUpdate:modelValue", "disabled"], tt = ["value"], st = { class: "mr-rule-editor__pair" }, dt = ["onUpdate:modelValue", "disabled", "aria-label"], it = { value: "number" }, ot = { value: "decimal" }, nt = ["disabled", "onClick"], ut = ["disabled"], rt = { class: "mr-rule-editor__actions" }, mt = ["disabled", "aria-label"], ct = ["disabled", "aria-label"], bt = ["disabled"], vt = ["disabled"], gt = {
983
+ key: 2,
984
+ class: "mr-rule-editor__panel"
985
+ }, yt = ["aria-label", "disabled"], ft = ["value"], ht = ["aria-label", "disabled"], kt = { value: "style" }, Vt = { value: "cell" }, $t = { value: "rowVisibility" }, Ct = { key: 0 }, wt = ["aria-label", "value", "disabled"], xt = { value: -1 }, Ut = ["value"], St = ["aria-label", "disabled"], Mt = ["value"], Ft = { class: "mr-rule-editor__pair" }, Et = ["aria-label", "disabled"], Rt = ["value"], Kt = ["value", "disabled"], Gt = { class: "mr-rule-editor__pair" }, Dt = ["disabled"], Nt = ["disabled"], Tt = { class: "mr-rule-editor__check" }, Bt = ["disabled"], At = { class: "mr-rule-editor__actions" }, Lt = ["disabled"], Wt = ["disabled"], It = {
986
+ key: 4,
987
+ class: "mr-rule-editor__error",
988
+ role: "alert"
989
+ }, Ot = /* @__PURE__ */ _({
990
+ __name: "RuleEditor",
991
+ props: {
992
+ list: {},
993
+ datasets: {},
994
+ datasetSchema: {},
995
+ datasetSchemas: {},
996
+ readonly: { type: Boolean },
997
+ messages: {}
998
+ },
999
+ emits: ["change"],
1000
+ setup(e, { emit: J }) {
1001
+ const x = e, O = J, c = Yl(x, (T) => O("change", T)), {
1002
+ m: i,
1003
+ tab: v,
1004
+ fields: f,
1005
+ formula: C,
1006
+ groups: G,
1007
+ groupIndex: N,
1008
+ currentGroup: M,
1009
+ column: K,
1010
+ currentColumn: j,
1011
+ conditionIndex: L,
1012
+ effect: r,
1013
+ when: d,
1014
+ style: V,
1015
+ error: u,
1016
+ preview: g,
1017
+ diagnostics: U,
1018
+ selectedComputed: F
1019
+ } = c, B = p();
1020
+ return (T, m) => (o(), n("section", {
1021
+ class: "mr-rule-editor",
1022
+ "aria-label": l(i).settings
1023
+ }, [
1024
+ a("div", {
1025
+ class: "mr-rule-editor__tabs",
1026
+ role: "tablist",
1027
+ "aria-label": l(i).settings
1028
+ }, [
1029
+ (o(), n(k, null, w([
1030
+ "computations",
1031
+ "groups",
1032
+ "conditions",
1033
+ "detail",
1034
+ "matrix"
1035
+ ], (s) => a("button", {
1036
+ key: s,
1037
+ type: "button",
1038
+ role: "tab",
1039
+ "aria-selected": l(v) === s,
1040
+ class: te({ "is-active": l(v) === s }),
1041
+ onClick: (W) => v.value = s
1042
+ }, [
1043
+ h(t(l(i)[s]), 1),
1044
+ s === "computations" && e.list.computed?.length ? (o(), n("span", la, t(e.list.computed.length), 1)) : R("", !0),
1045
+ s === "groups" && l(G).length ? (o(), n("span", aa, t(l(G).length), 1)) : R("", !0)
1046
+ ], 10, ea)), 64))
1047
+ ], 8, pl),
1048
+ l(v) === "computations" ? (o(), n("div", ta, [
1049
+ a("label", null, [
1050
+ h(t(l(i).existing), 1),
1051
+ a("select", {
1052
+ "aria-label": l(i).existing,
1053
+ value: l(F),
1054
+ disabled: e.readonly,
1055
+ onChange: m[0] || (m[0] = (s) => l(c).loadComputed(s.target.value))
1056
+ }, [
1057
+ a("option", da, "+ " + t(l(i).newField), 1),
1058
+ (o(!0), n(k, null, w(e.list.computed, (s) => (o(), n("option", {
1059
+ key: s.field,
1060
+ value: s.field
1061
+ }, t(s.field), 9, ia))), 128))
1062
+ ], 40, sa)
1063
+ ]),
1064
+ a("label", null, [
1065
+ h(t(l(i).target), 1),
1066
+ $(a("input", {
1067
+ "aria-label": l(i).target,
1068
+ "onUpdate:modelValue": m[1] || (m[1] = (s) => l(C).field = s),
1069
+ disabled: e.readonly,
1070
+ autocomplete: "off"
1071
+ }, null, 8, oa), [
1072
+ [H, l(C).field]
1073
+ ])
1074
+ ]),
1075
+ a("div", na, [
1076
+ a("label", null, [
1077
+ h(t(l(i).scope), 1),
1078
+ $(a("select", {
1079
+ "aria-label": l(i).scope,
1080
+ "onUpdate:modelValue": m[2] || (m[2] = (s) => l(C).scope = s),
1081
+ disabled: e.readonly
1082
+ }, [
1083
+ (o(!0), n(k, null, w(l(B).scopes, (s) => (o(), n("option", {
1084
+ key: s,
1085
+ value: s
1086
+ }, t(l(i)[s]), 9, ra))), 128))
1087
+ ], 8, ua), [
1088
+ [D, l(C).scope]
1089
+ ])
1090
+ ]),
1091
+ a("label", null, [
1092
+ h(t(l(i).numeric), 1),
1093
+ $(a("select", {
1094
+ "aria-label": l(i).numeric,
1095
+ "onUpdate:modelValue": m[3] || (m[3] = (s) => l(C).numeric = s),
1096
+ disabled: e.readonly
1097
+ }, [
1098
+ a("option", ca, t(l(i).number), 1),
1099
+ a("option", ba, t(l(i).decimal), 1)
1100
+ ], 8, ma), [
1101
+ [D, l(C).numeric]
1102
+ ])
1103
+ ])
1104
+ ]),
1105
+ l(C).scope === "group" ? (o(), n("fieldset", va, [
1106
+ a("legend", null, t(l(i).groupFields), 1),
1107
+ (o(!0), n(k, null, w(l(f), (s) => (o(), n("label", {
1108
+ key: s.field
1109
+ }, [
1110
+ a("input", {
1111
+ type: "checkbox",
1112
+ checked: l(C).groupBy?.includes(s.field),
1113
+ disabled: e.readonly,
1114
+ onChange: (W) => l(c).toggleGroupField(
1115
+ s.field,
1116
+ W.target.checked
1117
+ )
1118
+ }, null, 40, ga),
1119
+ h(t(s.label), 1)
1120
+ ]))), 128))
1121
+ ])) : R("", !0),
1122
+ typeof l(C).expression != "string" ? (o(), ae(Xl, {
1123
+ key: 1,
1124
+ "model-value": l(C).expression,
1125
+ fields: l(f),
1126
+ messages: l(i),
1127
+ readonly: e.readonly,
1128
+ "onUpdate:modelValue": l(c).setExpression
1129
+ }, null, 8, ["model-value", "fields", "messages", "readonly", "onUpdate:modelValue"])) : (o(), n("p", ya, t(l(C).expression), 1)),
1130
+ a("details", null, [
1131
+ a("summary", null, t(l(i).advanced), 1),
1132
+ a("div", fa, [
1133
+ a("label", null, [
1134
+ h(t(l(i).digits), 1),
1135
+ $(a("input", {
1136
+ "aria-label": l(i).digits,
1137
+ "onUpdate:modelValue": m[4] || (m[4] = (s) => l(C).digits = s),
1138
+ type: "number",
1139
+ min: "0",
1140
+ max: "100",
1141
+ disabled: e.readonly
1142
+ }, null, 8, ha), [
1143
+ [
1144
+ H,
1145
+ l(C).digits,
1146
+ void 0,
1147
+ { number: !0 }
1148
+ ]
1149
+ ])
1150
+ ]),
1151
+ a("label", null, [
1152
+ h(t(l(i).nulls), 1),
1153
+ $(a("select", {
1154
+ "aria-label": l(i).nulls,
1155
+ "onUpdate:modelValue": m[5] || (m[5] = (s) => l(C).nulls = s),
1156
+ disabled: e.readonly
1157
+ }, [
1158
+ a("option", Va, t(l(i).propagate), 1),
1159
+ a("option", $a, t(l(i).error), 1)
1160
+ ], 8, ka), [
1161
+ [D, l(C).nulls]
1162
+ ])
1163
+ ]),
1164
+ a("label", null, [
1165
+ h(t(l(i).division), 1),
1166
+ $(a("select", {
1167
+ "aria-label": l(i).division,
1168
+ "onUpdate:modelValue": m[6] || (m[6] = (s) => l(C).divisionByZero = s),
1169
+ disabled: e.readonly
1170
+ }, [
1171
+ a("option", wa, t(l(i).error), 1),
1172
+ a("option", xa, t(l(i).propagate), 1)
1173
+ ], 8, Ca), [
1174
+ [D, l(C).divisionByZero]
1175
+ ])
1176
+ ])
1177
+ ])
1178
+ ]),
1179
+ l(C).numeric === "decimal" ? (o(), n("p", Ua, t(l(i).decimalHint), 1)) : R("", !0),
1180
+ l(U).valid && l(C).field ? (o(), n("div", Sa, [
1181
+ h(t(l(i).dependencies), 1),
1182
+ a("strong", null, t(l(U).order.join(" → ")), 1)
1183
+ ])) : R("", !0),
1184
+ a("div", Ma, [
1185
+ a("button", {
1186
+ type: "button",
1187
+ disabled: e.readonly,
1188
+ onClick: m[7] || (m[7] = //@ts-ignore
1189
+ (...s) => l(c).check && l(c).check(...s))
1190
+ }, t(l(i).check), 9, Fa),
1191
+ a("button", {
1192
+ type: "button",
1193
+ class: "mr-rule-editor__primary",
1194
+ disabled: e.readonly || !l(U).valid,
1195
+ onClick: m[8] || (m[8] = //@ts-ignore
1196
+ (...s) => l(c).applyComputed && l(c).applyComputed(...s))
1197
+ }, t(l(i).apply), 9, Ea),
1198
+ l(F) ? (o(), n("button", {
1199
+ key: 0,
1200
+ type: "button",
1201
+ disabled: e.readonly,
1202
+ onClick: m[9] || (m[9] = //@ts-ignore
1203
+ (...s) => l(c).removeComputed && l(c).removeComputed(...s))
1204
+ }, t(l(i).remove), 9, Ra)) : R("", !0)
1205
+ ]),
1206
+ l(g).length ? (o(), n("div", Ka, [
1207
+ a("p", null, t(l(i).sample), 1),
1208
+ a("dl", null, [
1209
+ (o(!0), n(k, null, w(l(g), (s) => (o(), n(k, {
1210
+ key: s.row
1211
+ }, [
1212
+ a("dt", null, t(s.row), 1),
1213
+ a("dd", null, t(s.value ?? "—"), 1)
1214
+ ], 64))), 128))
1215
+ ])
1216
+ ])) : R("", !0),
1217
+ !l(U).valid && l(C).field ? (o(), n("p", Ga, t(l(U).errors.join(";")), 1)) : R("", !0)
1218
+ ])) : l(v) === "groups" ? (o(), n("div", Da, [
1219
+ a("div", Na, [
1220
+ $(a("select", {
1221
+ "onUpdate:modelValue": m[10] || (m[10] = (s) => Q(N) ? N.value = s : null),
1222
+ "aria-label": l(i).groups
1223
+ }, [
1224
+ (o(!0), n(k, null, w(l(G), (s, W) => (o(), n("option", {
1225
+ key: W,
1226
+ value: W
1227
+ }, t(W + 1) + " · " + t(s.field), 9, Ba))), 128)),
1228
+ l(G).length ? R("", !0) : (o(), n("option", Aa, t(l(i).noGroups), 1))
1229
+ ], 8, Ta), [
1230
+ [
1231
+ D,
1232
+ l(N),
1233
+ void 0,
1234
+ { number: !0 }
1235
+ ]
1236
+ ]),
1237
+ a("button", {
1238
+ type: "button",
1239
+ disabled: e.readonly || l(G).length >= 16,
1240
+ onClick: m[11] || (m[11] = //@ts-ignore
1241
+ (...s) => l(c).addGroup && l(c).addGroup(...s))
1242
+ }, " + " + t(l(i).addGroup), 9, La)
1243
+ ]),
1244
+ l(M) ? (o(), n(k, { key: 0 }, [
1245
+ a("label", null, [
1246
+ h(t(l(i).field), 1),
1247
+ $(a("select", {
1248
+ "aria-label": l(i).field,
1249
+ "onUpdate:modelValue": m[12] || (m[12] = (s) => l(M).field = s),
1250
+ disabled: e.readonly
1251
+ }, [
1252
+ (o(!0), n(k, null, w(l(f), (s) => (o(), n("option", {
1253
+ key: s.field,
1254
+ value: s.field
1255
+ }, t(s.label), 9, Ia))), 128))
1256
+ ], 8, Wa), [
1257
+ [D, l(M).field]
1258
+ ])
1259
+ ]),
1260
+ a("div", Oa, [
1261
+ a("label", null, [
1262
+ h(t(l(i).header), 1),
1263
+ $(a("input", {
1264
+ "aria-label": l(i).header,
1265
+ "onUpdate:modelValue": m[13] || (m[13] = (s) => l(M).headerTemplate = s),
1266
+ disabled: e.readonly,
1267
+ placeholder: "{value}"
1268
+ }, null, 8, ja), [
1269
+ [H, l(M).headerTemplate]
1270
+ ])
1271
+ ]),
1272
+ a("label", null, [
1273
+ h(t(l(i).footer), 1),
1274
+ $(a("input", {
1275
+ "aria-label": l(i).footer,
1276
+ "onUpdate:modelValue": m[14] || (m[14] = (s) => l(M).subtotalLabel = s),
1277
+ disabled: e.readonly
1278
+ }, null, 8, Ha), [
1279
+ [H, l(M).subtotalLabel]
1280
+ ])
1281
+ ])
1282
+ ]),
1283
+ a("div", Ja, [
1284
+ a("label", null, [
1285
+ $(a("input", {
1286
+ "onUpdate:modelValue": m[15] || (m[15] = (s) => l(M).keepWithNext = s),
1287
+ type: "checkbox",
1288
+ disabled: e.readonly
1289
+ }, null, 8, Za), [
1290
+ [q, l(M).keepWithNext]
1291
+ ]),
1292
+ h(t(l(i).orphan), 1)
1293
+ ]),
1294
+ a("label", null, [
1295
+ $(a("input", {
1296
+ "onUpdate:modelValue": m[16] || (m[16] = (s) => l(M).repeatHeader = s),
1297
+ type: "checkbox",
1298
+ disabled: e.readonly
1299
+ }, null, 8, za), [
1300
+ [q, l(M).repeatHeader]
1301
+ ]),
1302
+ h(t(l(i).repeat), 1)
1303
+ ])
1304
+ ]),
1305
+ (o(!0), n(k, null, w(l(M).aggregates, (s, W) => (o(), n("div", {
1306
+ key: W,
1307
+ class: "mr-rule-editor__aggregate"
1308
+ }, [
1309
+ a("div", qa, [
1310
+ a("label", null, [
1311
+ h(t(l(i).output), 1),
1312
+ $(a("select", {
1313
+ "aria-label": l(i).output,
1314
+ "onUpdate:modelValue": (S) => s.field = S,
1315
+ disabled: e.readonly
1316
+ }, [
1317
+ (o(!0), n(k, null, w(l(f), (S) => (o(), n("option", {
1318
+ key: S.field,
1319
+ value: S.field
1320
+ }, t(S.label), 9, Qa))), 128))
1321
+ ], 8, Pa), [
1322
+ [D, s.field]
1323
+ ])
1324
+ ]),
1325
+ a("label", null, [
1326
+ h(t(l(i).aggregate), 1),
1327
+ $(a("select", {
1328
+ "aria-label": l(i).aggregate,
1329
+ "onUpdate:modelValue": (S) => s.op = S,
1330
+ disabled: e.readonly
1331
+ }, [
1332
+ (o(!0), n(k, null, w(l(B).aggregates, (S) => (o(), n("option", {
1333
+ key: S,
1334
+ value: S
1335
+ }, t(l(i)[S]), 9, Ya))), 128))
1336
+ ], 8, Xa), [
1337
+ [D, s.op]
1338
+ ])
1339
+ ])
1340
+ ]),
1341
+ a("label", null, [
1342
+ h(t(l(i).measure), 1),
1343
+ $(a("select", {
1344
+ "aria-label": l(i).measure,
1345
+ "onUpdate:modelValue": (S) => s.valueField = S,
1346
+ disabled: e.readonly
1347
+ }, [
1348
+ a("option", pa, t(s.field), 1),
1349
+ (o(!0), n(k, null, w(l(f), (S) => (o(), n("option", {
1350
+ key: S.field,
1351
+ value: S.field
1352
+ }, t(S.label), 9, et))), 128))
1353
+ ], 8, _a), [
1354
+ [D, s.valueField]
1355
+ ])
1356
+ ]),
1357
+ s.op === "weightedAvg" ? (o(), n("label", lt, [
1358
+ h(t(l(i).weight), 1),
1359
+ $(a("select", {
1360
+ "aria-label": l(i).weight,
1361
+ "onUpdate:modelValue": (S) => s.weightField = S,
1362
+ disabled: e.readonly
1363
+ }, [
1364
+ (o(!0), n(k, null, w(l(f), (S) => (o(), n("option", {
1365
+ key: S.field,
1366
+ value: S.field
1367
+ }, t(S.label), 9, tt))), 128))
1368
+ ], 8, at), [
1369
+ [D, s.weightField]
1370
+ ])
1371
+ ])) : R("", !0),
1372
+ a("div", st, [
1373
+ $(a("select", {
1374
+ "onUpdate:modelValue": (S) => s.numeric = S,
1375
+ disabled: e.readonly,
1376
+ "aria-label": l(i).numeric
1377
+ }, [
1378
+ a("option", it, t(l(i).number), 1),
1379
+ a("option", ot, t(l(i).decimal), 1)
1380
+ ], 8, dt), [
1381
+ [D, s.numeric]
1382
+ ]),
1383
+ a("button", {
1384
+ type: "button",
1385
+ disabled: e.readonly,
1386
+ onClick: (S) => l(M).aggregates?.splice(W, 1)
1387
+ }, t(l(i).remove), 9, nt)
1388
+ ])
1389
+ ]))), 128)),
1390
+ a("button", {
1391
+ type: "button",
1392
+ disabled: e.readonly,
1393
+ onClick: m[17] || (m[17] = //@ts-ignore
1394
+ (...s) => l(c).addAggregate && l(c).addAggregate(...s))
1395
+ }, " + " + t(l(i).addAggregate), 9, ut),
1396
+ a("div", rt, [
1397
+ a("button", {
1398
+ type: "button",
1399
+ disabled: e.readonly || l(N) === 0,
1400
+ "aria-label": l(i).moveUp,
1401
+ onClick: m[18] || (m[18] = (s) => l(c).moveGroup(-1))
1402
+ }, " ↑ " + t(l(i).outer), 9, mt),
1403
+ a("button", {
1404
+ type: "button",
1405
+ disabled: e.readonly || l(N) >= l(G).length - 1,
1406
+ "aria-label": l(i).moveDown,
1407
+ onClick: m[19] || (m[19] = (s) => l(c).moveGroup(1))
1408
+ }, " ↓ " + t(l(i).inner), 9, ct),
1409
+ a("button", {
1410
+ type: "button",
1411
+ disabled: e.readonly,
1412
+ onClick: m[20] || (m[20] = //@ts-ignore
1413
+ (...s) => l(c).removeGroup && l(c).removeGroup(...s))
1414
+ }, t(l(i).remove), 9, bt)
1415
+ ])
1416
+ ], 64)) : R("", !0),
1417
+ a("button", {
1418
+ type: "button",
1419
+ class: "mr-rule-editor__primary",
1420
+ disabled: e.readonly,
1421
+ onClick: m[21] || (m[21] = //@ts-ignore
1422
+ (...s) => l(c).applyGroups && l(c).applyGroups(...s))
1423
+ }, t(l(i).apply), 9, vt)
1424
+ ])) : l(v) === "conditions" ? (o(), n("div", gt, [
1425
+ a("label", null, [
1426
+ h(t(l(i).column), 1),
1427
+ $(a("select", {
1428
+ "aria-label": l(i).column,
1429
+ "onUpdate:modelValue": m[22] || (m[22] = (s) => Q(K) ? K.value = s : null),
1430
+ disabled: e.readonly,
1431
+ onChange: m[23] || (m[23] = (s) => l(c).loadCondition(-1))
1432
+ }, [
1433
+ (o(!0), n(k, null, w(e.list.columns, (s) => (o(), n("option", {
1434
+ key: s.field,
1435
+ value: s.field
1436
+ }, t(s.header || s.field), 9, ft))), 128))
1437
+ ], 40, yt), [
1438
+ [D, l(K)]
1439
+ ])
1440
+ ]),
1441
+ a("label", null, [
1442
+ h(t(l(i).effect), 1),
1443
+ $(a("select", {
1444
+ "aria-label": l(i).effect,
1445
+ "onUpdate:modelValue": m[24] || (m[24] = (s) => Q(r) ? r.value = s : null),
1446
+ disabled: e.readonly,
1447
+ onChange: m[25] || (m[25] = (s) => l(c).loadCondition(-1))
1448
+ }, [
1449
+ a("option", kt, t(l(i).style), 1),
1450
+ a("option", Vt, t(l(i).cell), 1),
1451
+ a("option", $t, t(l(i).rowVisibility), 1)
1452
+ ], 40, ht), [
1453
+ [D, l(r)]
1454
+ ])
1455
+ ]),
1456
+ l(r) === "style" ? (o(), n("label", Ct, [
1457
+ h(t(l(i).existing), 1),
1458
+ a("select", {
1459
+ "aria-label": l(i).existing,
1460
+ value: l(L),
1461
+ disabled: e.readonly,
1462
+ onChange: m[26] || (m[26] = (s) => l(c).loadCondition(
1463
+ Number(s.target.value)
1464
+ ))
1465
+ }, [
1466
+ a("option", xt, "+ " + t(l(i).newCondition), 1),
1467
+ (o(!0), n(k, null, w(l(j)?.rules, (s, W) => (o(), n("option", {
1468
+ key: W,
1469
+ value: W
1470
+ }, t(W + 1) + " · " + t(s.when.field) + " " + t(s.when.op) + " " + t(s.when.value), 9, Ut))), 128))
1471
+ ], 40, wt)
1472
+ ])) : R("", !0),
1473
+ a("label", null, [
1474
+ h(t(l(i).condition), 1),
1475
+ $(a("select", {
1476
+ "aria-label": l(i).condition,
1477
+ "onUpdate:modelValue": m[27] || (m[27] = (s) => l(d).field = s),
1478
+ disabled: e.readonly
1479
+ }, [
1480
+ (o(!0), n(k, null, w(l(f), (s) => (o(), n("option", {
1481
+ key: s.field,
1482
+ value: s.field
1483
+ }, t(s.label), 9, Mt))), 128))
1484
+ ], 8, St), [
1485
+ [D, l(d).field]
1486
+ ])
1487
+ ]),
1488
+ a("div", Ft, [
1489
+ a("label", null, [
1490
+ h(t(l(i).comparison), 1),
1491
+ $(a("select", {
1492
+ "aria-label": l(i).comparison,
1493
+ "onUpdate:modelValue": m[28] || (m[28] = (s) => l(d).op = s),
1494
+ disabled: e.readonly
1495
+ }, [
1496
+ (o(), n(k, null, w([">", ">=", "<", "<=", "==", "!="], (s) => a("option", {
1497
+ key: s,
1498
+ value: s
1499
+ }, t(s), 9, Rt)), 64))
1500
+ ], 8, Et), [
1501
+ [D, l(d).op]
1502
+ ])
1503
+ ]),
1504
+ a("label", null, [
1505
+ h(t(l(i).threshold), 1),
1506
+ a("input", {
1507
+ value: l(d).value,
1508
+ disabled: e.readonly,
1509
+ onInput: m[29] || (m[29] = (s) => l(c).setThreshold(s.target.value))
1510
+ }, null, 40, Kt)
1511
+ ])
1512
+ ]),
1513
+ l(r) === "style" ? (o(), n(k, { key: 1 }, [
1514
+ a("div", Gt, [
1515
+ a("label", null, [
1516
+ h(t(l(i).color), 1),
1517
+ $(a("input", {
1518
+ "onUpdate:modelValue": m[30] || (m[30] = (s) => l(V).color = s),
1519
+ type: "color",
1520
+ disabled: e.readonly
1521
+ }, null, 8, Dt), [
1522
+ [H, l(V).color]
1523
+ ])
1524
+ ]),
1525
+ a("label", null, [
1526
+ h(t(l(i).background), 1),
1527
+ $(a("input", {
1528
+ "onUpdate:modelValue": m[31] || (m[31] = (s) => l(V).backgroundColor = s),
1529
+ type: "color",
1530
+ disabled: e.readonly
1531
+ }, null, 8, Nt), [
1532
+ [H, l(V).backgroundColor]
1533
+ ])
1534
+ ])
1535
+ ]),
1536
+ a("label", Tt, [
1537
+ $(a("input", {
1538
+ "onUpdate:modelValue": m[32] || (m[32] = (s) => l(V).bold = s),
1539
+ type: "checkbox",
1540
+ disabled: e.readonly
1541
+ }, null, 8, Bt), [
1542
+ [q, l(V).bold]
1543
+ ]),
1544
+ h(t(l(i).bold), 1)
1545
+ ])
1546
+ ], 64)) : R("", !0),
1547
+ a("div", At, [
1548
+ a("button", {
1549
+ type: "button",
1550
+ class: "mr-rule-editor__primary",
1551
+ disabled: e.readonly,
1552
+ onClick: m[33] || (m[33] = (s) => l(c).applyCondition())
1553
+ }, t(l(i).apply), 9, Lt),
1554
+ l(L) >= 0 || l(r) !== "style" ? (o(), n("button", {
1555
+ key: 0,
1556
+ type: "button",
1557
+ disabled: e.readonly,
1558
+ onClick: m[34] || (m[34] = (s) => l(c).applyCondition(!0))
1559
+ }, t(l(i).removeCondition), 9, Wt)) : R("", !0)
1560
+ ])
1561
+ ])) : (o(), ae(kl, {
1562
+ key: 3,
1563
+ list: e.list,
1564
+ mode: l(v) === "detail" ? "detail" : "matrix",
1565
+ datasets: e.datasets,
1566
+ "dataset-schema": e.datasetSchema,
1567
+ "dataset-schemas": e.datasetSchemas,
1568
+ readonly: e.readonly,
1569
+ messages: l(i),
1570
+ onChange: l(c).applyLayout
1571
+ }, null, 8, ["list", "mode", "datasets", "dataset-schema", "dataset-schemas", "readonly", "messages", "onChange"])),
1572
+ l(u) ? (o(), n("p", It, t(l(u)), 1)) : R("", !0)
1573
+ ], 8, _l));
1574
+ }
1575
+ }), qt = /* @__PURE__ */ ee(Ot, [["__scopeId", "data-v-d08a101e"]]);
1576
+ export {
1577
+ qt as default
1578
+ };