@feedmepos/mf-report 5.5.12 → 5.5.13-beta.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 (28) hide show
  1. package/dist/{App-BYEvHkpj.js → App-BS0-_AhY.js} +42 -42
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-C3Dsnzzo.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-Bym218wx.js} +2 -2
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-HE3jlz2q.js → Default.vue_vue_type_script_setup_true_lang-BPyDSlSv.js} +2 -2
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BdzViho5.js +1134 -0
  5. package/dist/{InsightView-CArL6hDD.js → InsightView-BNTy2BY6.js} +6 -6
  6. package/dist/{Integration-LQ6ecL8C.js → Integration-carh07Vr.js} +3 -3
  7. package/dist/{Integrations-RluH7jrn.js → Integrations-CkNOG-0a.js} +3 -3
  8. package/dist/{Layout-BhKNg55v.js → Layout-BSSq5DmA.js} +1 -1
  9. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-B_N9ULY9.js → MenuTab.vue_vue_type_script_setup_true_lang-C27xOs2V.js} +3 -3
  10. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DULwCyXt.js → NavigationTab.vue_vue_type_script_setup_true_lang-BGj4JBTM.js} +5 -5
  11. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CCA1l-Cz.js → NoData.vue_vue_type_script_setup_true_lang-Ds28wS8h.js} +1 -1
  12. package/dist/{OverviewView-TazRQM9F.js → OverviewView-Bw5iTk3_.js} +5 -5
  13. package/dist/{Report-BcAsB4U_.js → Report-B-JUEWzb.js} +4 -4
  14. package/dist/{ReportEditor-BxurSooc.js → ReportEditor-DwJoE0yD.js} +5 -5
  15. package/dist/{ReportView-C41FJjRB.js → ReportView-Cxp3H0_E.js} +7 -7
  16. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-CXYvLXnR.js → SelectComponent.vue_vue_type_script_setup_true_lang-8tR4yk5A.js} +1 -1
  17. package/dist/{Setting-DC_StvBp.js → Setting-K0PpkSOk.js} +4 -4
  18. package/dist/TileEditor-cPwOTLfC.js +2707 -0
  19. package/dist/{TransitionFade-CWIc4Ee4.js → TransitionFade-B04L5pm3.js} +4 -4
  20. package/dist/app.js +123 -63
  21. package/dist/{global-loader-KvOGLx9k.js → global-loader-DfQXrz7M.js} +1700 -1713
  22. package/dist/{index-CW2xYO89.js → index-OX-gt0RL.js} +1 -1
  23. package/dist/{report-schema-Zw8e6-XZ.js → report-schema-Cnf7q4YC.js} +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/{v4-CHk_oNmT.js → v4-CKZZ3hoL.js} +264 -232
  26. package/package.json +2 -2
  27. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-tpHdjE7s.js +0 -1082
  28. package/dist/TileEditor-CAUxqyJ6.js +0 -2538
@@ -0,0 +1,2707 @@
1
+ import { defineComponent as q, mergeModels as X, useModel as le, computed as T, ref as E, resolveComponent as h, createElementBlock as $, openBlock as y, createVNode as d, createElementVNode as C, unref as a, withCtx as S, toDisplayString as I, Fragment as H, renderList as de, withModifiers as te, createTextVNode as se, watch as ce, createCommentVNode as x, createBlock as k, renderSlot as Ue, resolveDynamicComponent as Ne, normalizeClass as De, onMounted as je, normalizeStyle as Ae, isRef as Ee } from "vue";
2
+ import { useRoute as Pe, useRouter as ze } from "vue-router";
3
+ import { h as qe, d as be, S as Fe, W as He, a as Ye, T as Ge, _ as We } from "./TransitionFade-B04L5pm3.js";
4
+ import { W as D, a as Xe } from "./v4-CKZZ3hoL.js";
5
+ import { storeToRefs as ke } from "pinia";
6
+ import { u as $e } from "./message-dialog-UoMWOnil.js";
7
+ import { c as Ce, d as Oe, p as Je } from "./index-OX-gt0RL.js";
8
+ import { useSnackbar as Ke, useBreakpoints as Le, FmButtonColorThemeVariant as ve } from "@feedmepos/ui-library";
9
+ import { u as Ie } from "./report-schema-Cnf7q4YC.js";
10
+ import { _ as re } from "./BaseDialog.vue_vue_type_script_setup_true_lang-DTNiGKgd.js";
11
+ import { _ as Y } from "./SelectComponent.vue_vue_type_script_setup_true_lang-8tR4yk5A.js";
12
+ import { u as Z, d as ge } from "./global-loader-DfQXrz7M.js";
13
+ import { r as Q } from "./i18n-Cif1I9J2.js";
14
+ import { g as fe, L as ne, a as pe, _ as Be } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-BdzViho5.js";
15
+ import { _ as Re } from "./NoData.vue_vue_type_script_setup_true_lang-Ds28wS8h.js";
16
+ var ue = /* @__PURE__ */ ((m) => (m.DateTime = "DATE_TIME", m.Hour = "HOUR", m.Day = "DAY", m.Week = "WEEK", m.Month = "MONTH", m.TimeOfDay = "TIME_OF_DAY", m.HourOfDay = "HOUR_OF_DAY", m.DayOfWeek = "DAY_OF_WEEK", m.DayOfMonth = "DAY_OF_MONTH", m.MonthOfYear = "MONTH_OF_YEAR", m.Year = "YEAR", m))(ue || {}), he = /* @__PURE__ */ ((m) => (m.Asc = "ASC", m.Desc = "DESC", m))(he || {}), ae = /* @__PURE__ */ ((m) => (m.Equal = "EQUAL", m.NotEqual = "NOT_EQUAL", m.GreaterThan = "GREATER_THAN", m.LessThan = "LESS_THAN", m.GreaterThanOrEqual = "GREATER_THAN_OR_EQUAL", m.LessThanOrEqual = "LESS_THAN_OR_EQUAL", m.Between = "BETWEEN", m.Like = "LIKE", m.NotLike = "NOT_LIKE", m.And = "AND", m.Or = "OR", m))(ae || {}), ie = /* @__PURE__ */ ((m) => (m.String = "STRING", m.Timestamp = "TIMESTAMP", m.Bool = "BOOL", m.Numeric = "NUMERIC", m))(ie || {});
17
+ const _e = [
18
+ {
19
+ type: D.Circular,
20
+ maxDimension: null,
21
+ maxMetric: 1,
22
+ hasBreakdownDimension: !1,
23
+ canTranspose: !1,
24
+ isDrillConfigurable: !1,
25
+ hasChart: !0,
26
+ hasLabel: !0,
27
+ hasLegend: !0,
28
+ hasXy: !1,
29
+ canRollup: !1,
30
+ showRollupPosition: !1,
31
+ canSearch: !1
32
+ },
33
+ {
34
+ type: D.Table,
35
+ maxDimension: null,
36
+ maxMetric: null,
37
+ hasBreakdownDimension: !1,
38
+ canTranspose: !1,
39
+ isDrillConfigurable: !0,
40
+ hasChart: !1,
41
+ hasLabel: !1,
42
+ hasLegend: !1,
43
+ hasXy: !1,
44
+ canRollup: !0,
45
+ showRollupPosition: !0,
46
+ canSearch: !0
47
+ },
48
+ {
49
+ type: D.BarChart,
50
+ maxDimension: null,
51
+ maxMetric: 1,
52
+ hasBreakdownDimension: !0,
53
+ canTranspose: !0,
54
+ isDrillConfigurable: !1,
55
+ hasChart: !0,
56
+ hasLabel: !0,
57
+ hasLegend: !0,
58
+ hasXy: !0,
59
+ canRollup: !1,
60
+ showRollupPosition: !1,
61
+ canSearch: !1
62
+ },
63
+ {
64
+ type: D.LineChart,
65
+ maxDimension: null,
66
+ maxMetric: 1,
67
+ hasBreakdownDimension: !0,
68
+ canTranspose: !0,
69
+ isDrillConfigurable: !1,
70
+ hasChart: !0,
71
+ hasLabel: !0,
72
+ hasLegend: !0,
73
+ hasXy: !0,
74
+ canRollup: !1,
75
+ showRollupPosition: !1,
76
+ canSearch: !1
77
+ },
78
+ {
79
+ type: D.StackBarChart,
80
+ maxDimension: null,
81
+ maxMetric: 1,
82
+ hasBreakdownDimension: !0,
83
+ canTranspose: !0,
84
+ isDrillConfigurable: !1,
85
+ hasChart: !0,
86
+ hasLabel: !0,
87
+ hasLegend: !0,
88
+ hasXy: !0,
89
+ canRollup: !1,
90
+ showRollupPosition: !1,
91
+ canSearch: !1
92
+ },
93
+ {
94
+ type: D.StackLineChart,
95
+ maxDimension: null,
96
+ maxMetric: 1,
97
+ hasBreakdownDimension: !0,
98
+ canTranspose: !0,
99
+ isDrillConfigurable: !1,
100
+ hasChart: !0,
101
+ hasLabel: !0,
102
+ hasLegend: !0,
103
+ hasXy: !0,
104
+ canRollup: !1,
105
+ showRollupPosition: !1,
106
+ canSearch: !1
107
+ },
108
+ {
109
+ type: D.Scorecard,
110
+ maxDimension: null,
111
+ maxMetric: 1,
112
+ hasBreakdownDimension: !1,
113
+ canTranspose: !1,
114
+ isDrillConfigurable: !1,
115
+ hasChart: !1,
116
+ hasLabel: !1,
117
+ hasLegend: !1,
118
+ hasXy: !1,
119
+ canRollup: !1,
120
+ showRollupPosition: !1,
121
+ canSearch: !1
122
+ },
123
+ {
124
+ type: D.Spacer,
125
+ maxDimension: 0,
126
+ maxMetric: 0,
127
+ hasBreakdownDimension: !1,
128
+ canTranspose: !1,
129
+ isDrillConfigurable: !1,
130
+ hasChart: !1,
131
+ hasLabel: !1,
132
+ hasLegend: !1,
133
+ hasXy: !1,
134
+ canRollup: !1,
135
+ showRollupPosition: !1,
136
+ canSearch: !1
137
+ }
138
+ ], Qe = { class: "flex flex-col my-2 gap-8" }, Ze = { class: "fm-typo-en-body-lg-600" }, el = { class: "text-sm text-fm-color-neutral-gray-400" }, ll = ["onClick"], ol = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, al = /* @__PURE__ */ q({
139
+ __name: "SchemaSection",
140
+ props: /* @__PURE__ */ X({
141
+ options: {
142
+ type: Array,
143
+ default: () => []
144
+ },
145
+ label: {
146
+ type: String,
147
+ default: "Schema"
148
+ }
149
+ }, {
150
+ modelValue: { required: !0 },
151
+ modelModifiers: {}
152
+ }),
153
+ emits: ["update:modelValue"],
154
+ setup(m) {
155
+ const { t: r, te: e } = Z(), p = le(m, "modelValue"), c = m, { schemas: i } = ke(Ie()), g = T(
156
+ () => i.value.map((U) => ({
157
+ label: U.label,
158
+ value: U.name,
159
+ raw: U
160
+ }))
161
+ ), b = T(() => {
162
+ if (p.value.schemaNames.length === 0 || v.value === 0)
163
+ return g.value.filter((U) => !U.raw.isJoinOnly);
164
+ {
165
+ const U = p.value.schemaNames[0], F = i.value.find((u) => u.name === U), o = ((F == null ? void 0 : F.joins) || []).map((u) => u);
166
+ return g.value.filter((u) => o.includes(u.raw.name));
167
+ }
168
+ }), f = E(!1), l = E(""), v = E(), w = Ke();
169
+ function N(U) {
170
+ var F;
171
+ return Q(
172
+ r,
173
+ e,
174
+ (F = i.value.find((o) => o.name === U)) == null ? void 0 : F.label,
175
+ "schema"
176
+ );
177
+ }
178
+ function V(U) {
179
+ v.value = U, f.value = !0, U !== void 0 ? l.value = p.value.schemaNames[U] : l.value = "";
180
+ }
181
+ function B() {
182
+ l.value !== "" ? (v.value !== void 0 ? p.value.schemaNames[v.value] = l.value : p.value.schemaNames.push(l.value), f.value = !1) : w.open({ message: r("report.section.schema.nothingSelected"), type: "error" });
183
+ }
184
+ return (U, F) => {
185
+ const o = h("FmForm"), u = h("FmIcon"), n = h("FmField");
186
+ return y(), $("div", Qe, [
187
+ d(re, {
188
+ modelValue: f.value,
189
+ "onUpdate:modelValue": F[1] || (F[1] = (t) => f.value = t),
190
+ title: c.label,
191
+ "primary-button-label": a(r)("report.common.confirm"),
192
+ "secondary-button-label": a(r)("report.common.cancel"),
193
+ onConfirm: B
194
+ }, {
195
+ content: S(() => [
196
+ d(o, { ref: "form" }, {
197
+ default: S(() => [
198
+ d(Y, {
199
+ modelValue: l.value,
200
+ "onUpdate:modelValue": F[0] || (F[0] = (t) => l.value = t),
201
+ label: a(r)("report.section.schema.title"),
202
+ items: v.value === 0 ? g.value.map((t) => ({
203
+ label: a(Q)(a(r), a(e), t.label, "schema"),
204
+ value: t.value
205
+ })) : b.value.map((t) => ({
206
+ label: a(Q)(a(r), a(e), t.label, "schema"),
207
+ value: t.value
208
+ }))
209
+ }, null, 8, ["modelValue", "label", "items"])
210
+ ]),
211
+ _: 1
212
+ }, 512)
213
+ ]),
214
+ _: 1
215
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
216
+ C("div", null, [
217
+ C("p", Ze, I(a(r)("report.section.schema.title")), 1),
218
+ C("p", el, I(a(r)("report.section.schema.description")), 1)
219
+ ]),
220
+ (y(!0), $(H, null, de(p.value.schemaNames, (t, s) => (y(), $("div", {
221
+ key: s,
222
+ class: "flex flex-col gap-2 w-full"
223
+ }, [
224
+ C("div", {
225
+ class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
226
+ onClick: (O) => V(s)
227
+ }, [
228
+ C("p", ol, I(N(t)), 1),
229
+ F[3] || (F[3] = C("div", { class: "grow" }, null, -1)),
230
+ d(u, {
231
+ name: "close",
232
+ onClick: te(
233
+ () => {
234
+ p.value.schemaNames = a(qe)(p.value.schemaNames, s);
235
+ },
236
+ ["stop"]
237
+ )
238
+ }, null, 8, ["onClick"])
239
+ ], 8, ll)
240
+ ]))), 128)),
241
+ d(n, {
242
+ class: "text-fm-color-typo-tertiary",
243
+ onClick: F[2] || (F[2] = () => {
244
+ V();
245
+ })
246
+ }, {
247
+ default: S(() => [
248
+ se(I(a(r)("report.section.schema.add")), 1)
249
+ ]),
250
+ _: 1
251
+ })
252
+ ]);
253
+ };
254
+ }
255
+ }), tl = {
256
+ key: 0,
257
+ class: "flex flex-col my-2 gap-8"
258
+ }, nl = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, ul = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, il = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, ye = /* @__PURE__ */ q({
259
+ __name: "DimensionSection",
260
+ props: /* @__PURE__ */ X({
261
+ options: {
262
+ type: Array,
263
+ default: () => []
264
+ },
265
+ label: {
266
+ type: String,
267
+ default: "Dimension"
268
+ },
269
+ max: {
270
+ type: Number,
271
+ default: void 0
272
+ },
273
+ config: {
274
+ type: Object,
275
+ default: () => {
276
+ }
277
+ },
278
+ hasRowColumn: {
279
+ type: Boolean,
280
+ default: !1
281
+ }
282
+ }, {
283
+ modelValue: {
284
+ required: !1,
285
+ default: []
286
+ },
287
+ modelModifiers: {}
288
+ }),
289
+ emits: ["update:modelValue"],
290
+ setup(m) {
291
+ const { t: r, te: e } = Z(), p = le(m, "modelValue"), c = m, i = E(!1), g = T(
292
+ () => p.value.map((n, t) => ({
293
+ index: t,
294
+ labels: [n.label || n.name],
295
+ value: n
296
+ }))
297
+ ), b = E(p.value.length > 0 ? 0 : void 0);
298
+ function f(n) {
299
+ var t, s, O;
300
+ i.value = !0, l.value = n != null && n.value ? JSON.parse(
301
+ JSON.stringify({
302
+ ...n.value,
303
+ label: Q(r, e, (t = n.value) == null ? void 0 : t.label, "other")
304
+ })
305
+ ) : void 0, b.value = n == null ? void 0 : n.index, v.value = !!((s = l.value) != null && s.dataFormula || (O = l.value) != null && O.displayFormula);
306
+ }
307
+ const l = E(void 0), v = E(!1), w = T(
308
+ () => c.options.find(
309
+ (n) => {
310
+ var t, s;
311
+ return n.schemaName === ((t = l.value) == null ? void 0 : t.schemaName) && n.name === ((s = l.value) == null ? void 0 : s.name);
312
+ }
313
+ ) ?? {}
314
+ );
315
+ ce(
316
+ () => {
317
+ var n;
318
+ return (n = l.value) == null ? void 0 : n.option;
319
+ },
320
+ () => {
321
+ !N.value && l.value && (l.value.fillGap = !1);
322
+ }
323
+ );
324
+ const N = T(
325
+ () => {
326
+ var n, t, s;
327
+ return (s = (n = w.value) == null ? void 0 : n.fillGapDimensionOptions) == null ? void 0 : s.includes(((t = l.value) == null ? void 0 : t.option) || "");
328
+ }
329
+ );
330
+ function V(n) {
331
+ var t, s;
332
+ (n.schemaName !== ((t = l.value) == null ? void 0 : t.schemaName) || n.name !== ((s = l.value) == null ? void 0 : s.name)) && (l.value = {
333
+ schemaName: n.schemaName,
334
+ name: n.name,
335
+ option: n.dimensionOptions[0],
336
+ label: Q(r, e, n.label, "other"),
337
+ decimal: n.isNumericType ? 2 : void 0,
338
+ hide: !1
339
+ }, v.value = !1);
340
+ }
341
+ function B() {
342
+ if (!l.value) {
343
+ console.error("new field is undefined");
344
+ return;
345
+ }
346
+ const n = [...g.value.map((t) => t.value)];
347
+ b.value !== void 0 ? n[b.value] = l.value : n.push(l.value), p.value = n, i.value = !1;
348
+ }
349
+ function U(n) {
350
+ const s = [...g.value.map((O) => O.value)].filter((O, P) => P !== n);
351
+ p.value = s;
352
+ }
353
+ function F(n) {
354
+ l.value && (l.value.decimal = Number(n));
355
+ }
356
+ const o = T(
357
+ () => c.options.map((n) => ({
358
+ label: n.labels.join(" "),
359
+ value: n
360
+ }))
361
+ ), u = T(
362
+ () => c.label ? c.label : r(`report.section.dimension.${c.label}`)
363
+ );
364
+ return (n, t) => {
365
+ const s = h("FmTextField"), O = h("FmStepperField"), P = h("FmCheckbox"), J = h("FmTextarea"), R = h("FmForm"), A = h("FmIcon"), z = h("FmButton"), K = h("FmListItem"), G = h("FmList"), _ = h("FmField");
366
+ return m.max !== 0 ? (y(), $("div", tl, [
367
+ d(re, {
368
+ modelValue: i.value,
369
+ "onUpdate:modelValue": t[12] || (t[12] = (L) => i.value = L),
370
+ title: u.value,
371
+ "primary-button-label": a(r)("report.common.confirm"),
372
+ "secondary-button-label": a(r)("report.common.cancel"),
373
+ onConfirm: B
374
+ }, {
375
+ content: S(() => [
376
+ d(R, {
377
+ ref: "form",
378
+ class: "flex flex-col gap-2 w-[490px]"
379
+ }, {
380
+ default: S(() => {
381
+ var L, ee, oe, W, j, Te;
382
+ return [
383
+ d(Y, {
384
+ "model-value": w.value,
385
+ items: o.value,
386
+ placeholder: u.value,
387
+ label: u.value,
388
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => V(M))
389
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
390
+ l.value ? (y(), $(H, { key: 0 }, [
391
+ d(s, {
392
+ modelValue: l.value.label,
393
+ "onUpdate:modelValue": t[1] || (t[1] = (M) => l.value.label = M),
394
+ label: a(r)("report.section.dimension.label")
395
+ }, null, 8, ["modelValue", "label"]),
396
+ (((L = w.value) == null ? void 0 : L.dimensionOptions) || []).length > 0 ? (y(), k(Y, {
397
+ key: 0,
398
+ modelValue: l.value.option,
399
+ "onUpdate:modelValue": t[2] || (t[2] = (M) => l.value.option = M),
400
+ items: ((ee = w.value) == null ? void 0 : ee.dimensionOptions.map((M) => ({
401
+ label: a(Q)(a(r), a(e), M, "field"),
402
+ value: M
403
+ }))) ?? []
404
+ }, null, 8, ["modelValue", "items"])) : x("", !0),
405
+ (oe = w.value) != null && oe.isNumericType ? (y(), k(O, {
406
+ key: 1,
407
+ label: a(r)("report.common.decimal"),
408
+ "model-value": ((W = l.value) == null ? void 0 : W.decimal) ?? 2,
409
+ "onUpdate:modelValue": t[3] || (t[3] = (M) => {
410
+ F(M);
411
+ })
412
+ }, null, 8, ["label", "model-value"])) : x("", !0),
413
+ (j = w.value) != null && j.isNumericType ? (y(), k(Y, {
414
+ key: 2,
415
+ modelValue: l.value.timeFormatter,
416
+ "onUpdate:modelValue": t[4] || (t[4] = (M) => l.value.timeFormatter = M),
417
+ placeholder: a(r)("report.section.dimension.timeFormatter"),
418
+ label: a(r)("report.section.dimension.timeFormatter"),
419
+ items: w.value.timeFormatters.map((M) => ({ label: M, value: M }))
420
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : x("", !0),
421
+ N.value ? (y(), k(P, {
422
+ key: 3,
423
+ "model-value": l.value.fillGap ?? !1,
424
+ label: a(r)("report.section.dimension.fillGap"),
425
+ value: "",
426
+ placeholder: "Fill gap",
427
+ "onUpdate:modelValue": t[5] || (t[5] = (M) => {
428
+ l.value && (l.value.fillGap = M);
429
+ })
430
+ }, null, 8, ["model-value", "label"])) : x("", !0),
431
+ ((Te = w.value) == null ? void 0 : Te.type) === a(ie).Timestamp ? (y(), k(P, {
432
+ key: 4,
433
+ "model-value": l.value.dateComparison ?? !1,
434
+ label: a(r)("report.section.dimension.dateComparison"),
435
+ value: "",
436
+ "onUpdate:modelValue": t[6] || (t[6] = (M) => {
437
+ l.value && (l.value.dateComparison = M);
438
+ })
439
+ }, null, 8, ["model-value", "label"])) : x("", !0),
440
+ d(P, {
441
+ modelValue: l.value.hide,
442
+ "onUpdate:modelValue": t[7] || (t[7] = (M) => l.value.hide = M),
443
+ label: a(r)("report.section.dimension.hide"),
444
+ value: ""
445
+ }, null, 8, ["modelValue", "label"]),
446
+ c.hasRowColumn ? (y(), k(P, {
447
+ key: 5,
448
+ modelValue: l.value.moveToColumn,
449
+ "onUpdate:modelValue": t[8] || (t[8] = (M) => l.value.moveToColumn = M),
450
+ label: a(r)("report.section.dimension.moveToColumn"),
451
+ value: ""
452
+ }, null, 8, ["modelValue", "label"])) : x("", !0),
453
+ d(P, {
454
+ modelValue: v.value,
455
+ "onUpdate:modelValue": t[9] || (t[9] = (M) => v.value = M),
456
+ label: a(r)("report.section.dimension.advance"),
457
+ value: !0
458
+ }, null, 8, ["modelValue", "label"]),
459
+ v.value ? (y(), k(J, {
460
+ key: 6,
461
+ modelValue: l.value.dataFormula,
462
+ "onUpdate:modelValue": t[10] || (t[10] = (M) => l.value.dataFormula = M),
463
+ placeholder: a(r)("report.section.dimension.dataFormula")
464
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0),
465
+ v.value ? (y(), k(J, {
466
+ key: 7,
467
+ modelValue: l.value.displayFormula,
468
+ "onUpdate:modelValue": t[11] || (t[11] = (M) => l.value.displayFormula = M),
469
+ placeholder: a(r)("report.section.dimension.displayFormula")
470
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0)
471
+ ], 64)) : x("", !0)
472
+ ];
473
+ }),
474
+ _: 1
475
+ }, 512)
476
+ ]),
477
+ _: 1
478
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
479
+ C("div", null, [
480
+ C("p", nl, I(u.value), 1),
481
+ C("p", ul, I(a(r)("report.section.dimension.description")), 1)
482
+ ]),
483
+ d(G, null, {
484
+ default: S(() => [
485
+ d(a(be), {
486
+ list: p.value,
487
+ "item-key": "id",
488
+ class: "flex flex-col gap-2"
489
+ }, {
490
+ item: S(({ element: L, index: ee }) => [
491
+ d(K, {
492
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
493
+ onClick: te((oe) => f(g.value[ee]), ["stop"])
494
+ }, {
495
+ default: S(() => [
496
+ d(A, { name: "drag_handle" }),
497
+ C("p", il, I(a(Q)(a(r), a(e), L.label, "other")), 1),
498
+ t[14] || (t[14] = C("div", { class: "grow" }, null, -1)),
499
+ d(z, {
500
+ icon: "close",
501
+ size: "md",
502
+ variant: "tertiary",
503
+ onClick: te((oe) => U(ee), ["stop"])
504
+ }, null, 8, ["onClick"])
505
+ ]),
506
+ _: 2
507
+ }, 1032, ["onClick"])
508
+ ]),
509
+ _: 1
510
+ }, 8, ["list"])
511
+ ]),
512
+ _: 1
513
+ }),
514
+ d(_, {
515
+ class: "text-fm-color-typo-tertiary",
516
+ onClick: t[13] || (t[13] = () => {
517
+ f();
518
+ })
519
+ }, {
520
+ default: S(() => [
521
+ se(I(a(r)("report.section.dimension.add")), 1)
522
+ ]),
523
+ _: 1
524
+ })
525
+ ])) : x("", !0);
526
+ };
527
+ }
528
+ }), Ve = {
529
+ value: "_metric_name"
530
+ };
531
+ function sl(m, r, e) {
532
+ switch (m) {
533
+ case D.BarChart:
534
+ case D.StackBarChart:
535
+ case D.LineChart:
536
+ case D.StackLineChart:
537
+ case D.Circular:
538
+ return r.length > 1;
539
+ default:
540
+ return e;
541
+ }
542
+ }
543
+ function rl(m) {
544
+ var p;
545
+ const { rowIds: r, columnIds: e } = we(m.widget.config);
546
+ return {
547
+ ...m,
548
+ widget: {
549
+ ...m.widget,
550
+ config: {
551
+ ...m.widget.config,
552
+ rowIds: r,
553
+ columnIds: e,
554
+ isDrillable: sl(
555
+ m.widget.type,
556
+ m.widget.config.dimensions,
557
+ m.widget.config.isDrillable
558
+ ),
559
+ joinDatasources: (p = m.widget.config.joinDatasources) == null ? void 0 : p.map((c) => {
560
+ const { rowIds: i, columnIds: g } = we(c);
561
+ return {
562
+ ...c,
563
+ rowIds: i,
564
+ columnIds: g
565
+ };
566
+ })
567
+ }
568
+ }
569
+ };
570
+ }
571
+ function we(m) {
572
+ const r = m.dimensions.filter((g) => g.hide !== !0 && !g.moveToColumn).map((g) => fe(g)), e = m.dimensions.filter((g) => g.hide !== !0 && g.moveToColumn == !0).map((g) => fe(g)), p = m.metrics.length > 0;
573
+ p && m.metrics.find((g) => g.moveToRow == !0) ? r.push(Ve.value) : p && e.push(Ve.value);
574
+ const c = [], i = [];
575
+ for (const g of r)
576
+ c.push(g);
577
+ for (const g of e)
578
+ i.push(g);
579
+ return {
580
+ rowIds: c,
581
+ columnIds: i
582
+ };
583
+ }
584
+ const ml = { class: "flex flex-col my-2 gap-8" }, dl = { class: "fm-typo-en-body-lg-600" }, cl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, pl = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, vl = /* @__PURE__ */ q({
585
+ __name: "MetricSection",
586
+ props: /* @__PURE__ */ X({
587
+ options: {
588
+ type: Array,
589
+ default: () => []
590
+ },
591
+ label: {
592
+ type: String,
593
+ default: "Metric"
594
+ },
595
+ max: {
596
+ type: Number,
597
+ default: void 0
598
+ },
599
+ config: {
600
+ type: Object,
601
+ default: () => {
602
+ }
603
+ },
604
+ hasRowColumn: {
605
+ type: Boolean,
606
+ default: !1
607
+ }
608
+ }, {
609
+ modelValue: { required: !1, default: [] },
610
+ modelModifiers: {}
611
+ }),
612
+ emits: /* @__PURE__ */ X(["config"], ["update:modelValue"]),
613
+ setup(m, { emit: r }) {
614
+ const { t: e, te: p } = Z(), c = le(m, "modelValue"), i = m;
615
+ T(() => !!i.max && c.value.length === i.max);
616
+ const g = E(!1), b = T(
617
+ () => c.value.map((t, s) => ({
618
+ index: s,
619
+ labels: [t.label || t.name],
620
+ value: t
621
+ }))
622
+ ), f = E(c.value.length > 0 ? 0 : void 0);
623
+ function l(t) {
624
+ var s, O, P;
625
+ g.value = !0, v.value = t != null && t.value ? JSON.parse(
626
+ JSON.stringify({
627
+ ...t.value,
628
+ label: Q(e, p, t.value.label, "other")
629
+ })
630
+ ) : void 0, f.value = t == null ? void 0 : t.index, w.value = !!((s = v.value) != null && s.dataFormula || (O = v.value) != null && O.displayFormula), ((P = i.config.rowIds) == null ? void 0 : P.findIndex((J) => J === Ve.value)) !== -1 && v.value && (v.value.moveToRow = !0);
631
+ }
632
+ const v = E(void 0), w = E(!1), N = T(
633
+ () => i.options.find(
634
+ (t) => {
635
+ var s, O;
636
+ return t.schemaName === ((s = v.value) == null ? void 0 : s.schemaName) && t.name === ((O = v.value) == null ? void 0 : O.name);
637
+ }
638
+ ) ?? {}
639
+ );
640
+ function V(t, s) {
641
+ var O;
642
+ return (t == null ? void 0 : t.isNumericType) || ((O = t == null ? void 0 : t.isNumericAggregations) == null ? void 0 : O.includes(s || ""));
643
+ }
644
+ const B = T(
645
+ () => {
646
+ var t;
647
+ return V(N.value, (t = v.value) == null ? void 0 : t.aggregation);
648
+ }
649
+ );
650
+ ce(B, (t) => {
651
+ v.value && (t ? v.value.decimal = typeof v.value.decimal != "number" ? 2 : v.value.decimal : v.value.decimal = void 0);
652
+ });
653
+ function U(t) {
654
+ var s, O;
655
+ (t.schemaName !== ((s = v.value) == null ? void 0 : s.schemaName) || t.name !== ((O = v.value) == null ? void 0 : O.name)) && (v.value = {
656
+ schemaName: t.schemaName,
657
+ name: t.name,
658
+ aggregation: t.aggregations[0],
659
+ label: Q(e, p, t.label, "other"),
660
+ decimal: V(t, t.aggregations[0]) ? 2 : void 0,
661
+ moveToRow: !1,
662
+ hide: !1
663
+ }, w.value = !1);
664
+ }
665
+ function F() {
666
+ const t = [...b.value.map((s) => s.value)];
667
+ v.value && (f.value !== void 0 ? t[f.value] = v.value : t.push(v.value)), c.value = t, g.value = !1;
668
+ }
669
+ function o(t) {
670
+ const s = [...b.value.map((O) => O.value)];
671
+ s.splice(t, 1), c.value = s;
672
+ }
673
+ const u = T(
674
+ () => i.options.map((t) => ({
675
+ label: t.labels.join(" "),
676
+ value: t
677
+ }))
678
+ ), n = T(
679
+ () => i.label ? i.label : e(`report.section.metric.${i.label}`)
680
+ );
681
+ return (t, s) => {
682
+ const O = h("FmTextField"), P = h("FmStepperField"), J = h("FmCheckbox"), R = h("FmTextarea"), A = h("FmForm"), z = h("FmIcon"), K = h("FmButton"), G = h("FmListItem"), _ = h("FmList"), L = h("FmField");
683
+ return y(), $("div", ml, [
684
+ d(re, {
685
+ modelValue: g.value,
686
+ "onUpdate:modelValue": s[10] || (s[10] = (ee) => g.value = ee),
687
+ title: n.value,
688
+ onConfirm: F
689
+ }, {
690
+ content: S(() => [
691
+ d(A, {
692
+ ref: "form",
693
+ class: "flex flex-col gap-2 w-[490px]"
694
+ }, {
695
+ default: S(() => {
696
+ var ee, oe, W;
697
+ return [
698
+ d(Y, {
699
+ "model-value": N.value,
700
+ items: u.value,
701
+ placeholder: n.value,
702
+ label: n.value,
703
+ "onUpdate:modelValue": s[0] || (s[0] = (j) => U(j))
704
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
705
+ v.value ? (y(), $(H, { key: 0 }, [
706
+ d(O, {
707
+ modelValue: v.value.label,
708
+ "onUpdate:modelValue": s[1] || (s[1] = (j) => v.value.label = j),
709
+ label: a(e)("report.section.metric.label")
710
+ }, null, 8, ["modelValue", "label"]),
711
+ (((ee = N.value) == null ? void 0 : ee.aggregations) || []).length > 0 ? (y(), k(Y, {
712
+ key: 0,
713
+ modelValue: v.value.aggregation,
714
+ "onUpdate:modelValue": s[2] || (s[2] = (j) => v.value.aggregation = j),
715
+ label: a(e)("report.section.metric.aggregation"),
716
+ items: ((oe = N.value) == null ? void 0 : oe.aggregations.map((j) => ({
717
+ label: a(Q)(a(e), a(p), j, "field"),
718
+ value: j
719
+ }))) ?? []
720
+ }, null, 8, ["modelValue", "label", "items"])) : x("", !0),
721
+ B.value ? (y(), k(P, {
722
+ key: 1,
723
+ label: a(e)("report.common.decimal"),
724
+ "model-value": ((W = v.value) == null ? void 0 : W.decimal) ?? 2,
725
+ "onUpdate:modelValue": s[3] || (s[3] = (j) => {
726
+ v.value && (v.value.decimal = j);
727
+ })
728
+ }, null, 8, ["label", "model-value"])) : x("", !0),
729
+ B.value ? (y(), k(Y, {
730
+ key: 2,
731
+ modelValue: v.value.timeFormatter,
732
+ "onUpdate:modelValue": s[4] || (s[4] = (j) => v.value.timeFormatter = j),
733
+ placeholder: a(e)("report.section.metric.timeFormatter"),
734
+ label: a(e)("report.section.metric.timeFormatter"),
735
+ items: N.value.timeFormatters.map((j) => ({ label: j, value: j }))
736
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : x("", !0),
737
+ d(J, {
738
+ modelValue: v.value.hide,
739
+ "onUpdate:modelValue": s[5] || (s[5] = (j) => v.value.hide = j),
740
+ label: a(e)("report.section.metric.hide"),
741
+ value: ""
742
+ }, null, 8, ["modelValue", "label"]),
743
+ i.hasRowColumn ? (y(), k(J, {
744
+ key: 3,
745
+ modelValue: v.value.moveToRow,
746
+ "onUpdate:modelValue": s[6] || (s[6] = (j) => v.value.moveToRow = j),
747
+ label: a(e)("report.section.metric.moveToRow"),
748
+ value: ""
749
+ }, null, 8, ["modelValue", "label"])) : x("", !0),
750
+ d(J, {
751
+ modelValue: w.value,
752
+ "onUpdate:modelValue": s[7] || (s[7] = (j) => w.value = j),
753
+ label: a(e)("report.section.metric.advance"),
754
+ value: !0
755
+ }, null, 8, ["modelValue", "label"]),
756
+ w.value ? (y(), k(R, {
757
+ key: 4,
758
+ modelValue: v.value.dataFormula,
759
+ "onUpdate:modelValue": s[8] || (s[8] = (j) => v.value.dataFormula = j),
760
+ placeholder: a(e)("report.section.metric.dataFormula")
761
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0),
762
+ w.value ? (y(), k(R, {
763
+ key: 5,
764
+ modelValue: v.value.displayFormula,
765
+ "onUpdate:modelValue": s[9] || (s[9] = (j) => v.value.displayFormula = j),
766
+ placeholder: a(e)("report.section.metric.displayFormula")
767
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0)
768
+ ], 64)) : x("", !0)
769
+ ];
770
+ }),
771
+ _: 1
772
+ }, 512)
773
+ ]),
774
+ _: 1
775
+ }, 8, ["modelValue", "title"]),
776
+ C("div", null, [
777
+ C("p", dl, I(n.value), 1),
778
+ C("p", cl, I(a(e)("report.section.metric.description")), 1)
779
+ ]),
780
+ d(_, null, {
781
+ default: S(() => [
782
+ d(a(be), {
783
+ list: c.value,
784
+ "item-key": "id",
785
+ class: "flex flex-col gap-2 w-full"
786
+ }, {
787
+ item: S(({ element: ee, index: oe }) => [
788
+ d(G, {
789
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
790
+ onClick: te((W) => l(b.value[oe]), ["stop"])
791
+ }, {
792
+ default: S(() => [
793
+ d(z, { name: "drag_handle" }),
794
+ C("p", pl, I(a(Q)(a(e), a(p), ee.label, "other")), 1),
795
+ s[12] || (s[12] = C("div", { class: "grow" }, null, -1)),
796
+ d(K, {
797
+ icon: "close",
798
+ size: "md",
799
+ variant: "tertiary",
800
+ onClick: te((W) => o(oe), ["stop"])
801
+ }, null, 8, ["onClick"])
802
+ ]),
803
+ _: 2
804
+ }, 1032, ["onClick"])
805
+ ]),
806
+ _: 1
807
+ }, 8, ["list"])
808
+ ]),
809
+ _: 1
810
+ }),
811
+ d(L, {
812
+ class: "text-fm-color-typo-tertiary",
813
+ onClick: s[11] || (s[11] = () => {
814
+ l();
815
+ })
816
+ }, {
817
+ default: S(() => [
818
+ se(I(a(e)("report.section.metric.add")), 1)
819
+ ]),
820
+ _: 1
821
+ })
822
+ ]);
823
+ };
824
+ }
825
+ });
826
+ var me = /* @__PURE__ */ ((m) => (m.Select = "Select", m.TextField = "TextField", m.Timestamp = "Timestamp", m))(me || {});
827
+ function fl(m) {
828
+ let r = !1, e = 1;
829
+ switch (m) {
830
+ case ae.Equal:
831
+ case ae.NotEqual:
832
+ case ae.Like:
833
+ case ae.NotLike:
834
+ r = !1, e = 1;
835
+ break;
836
+ case ae.GreaterThan:
837
+ case ae.GreaterThanOrEqual:
838
+ case ae.LessThan:
839
+ case ae.LessThanOrEqual:
840
+ r = !0, e = 1;
841
+ break;
842
+ case ae.Between:
843
+ r = !0, e = 2;
844
+ break;
845
+ }
846
+ return {
847
+ fixed: r,
848
+ count: e
849
+ };
850
+ }
851
+ function bl({
852
+ operator: m,
853
+ dimensionOption: r,
854
+ dataType: e
855
+ }) {
856
+ const { fixed: p, count: c } = fl(m);
857
+ switch (e) {
858
+ case ie.String:
859
+ return {
860
+ type: "TextField",
861
+ fixed: p,
862
+ count: c,
863
+ dataType: void 0,
864
+ default: ""
865
+ };
866
+ case ie.Numeric:
867
+ return {
868
+ type: "TextField",
869
+ fixed: p,
870
+ count: c,
871
+ dataType: "number",
872
+ default: 0
873
+ };
874
+ case ie.Bool:
875
+ return {
876
+ type: "Select",
877
+ fixed: p,
878
+ count: c,
879
+ options: [
880
+ { label: "Yes", value: !0 },
881
+ { label: "No", value: !1 }
882
+ ],
883
+ default: !0
884
+ };
885
+ case ie.Timestamp:
886
+ switch (r) {
887
+ case ue.HourOfDay:
888
+ case ue.DayOfWeek:
889
+ case ue.DayOfMonth:
890
+ case ue.MonthOfYear:
891
+ return {
892
+ type: "TextField",
893
+ fixed: p,
894
+ count: c,
895
+ dataType: "number",
896
+ default: "0"
897
+ };
898
+ case ue.TimeOfDay:
899
+ return {
900
+ type: "Timestamp",
901
+ fixed: p,
902
+ count: c,
903
+ default: (/* @__PURE__ */ new Date()).toISOString()
904
+ };
905
+ }
906
+ }
907
+ return {
908
+ type: "TextField",
909
+ fixed: p,
910
+ count: c,
911
+ dataType: void 0,
912
+ default: ""
913
+ };
914
+ }
915
+ const gl = { class: "grow" }, yl = {
916
+ key: 2,
917
+ class: "w-full"
918
+ }, Fl = { key: 0 }, hl = /* @__PURE__ */ q({
919
+ __name: "FilterValueInput",
920
+ props: /* @__PURE__ */ X({
921
+ config: {
922
+ type: Object,
923
+ default: () => {
924
+ }
925
+ }
926
+ }, {
927
+ modelValue: { required: !0, default: () => [] },
928
+ modelModifiers: {}
929
+ }),
930
+ emits: ["update:modelValue"],
931
+ setup(m) {
932
+ const r = le(m, "modelValue"), e = m;
933
+ function p(b) {
934
+ return (b ? ge(b) : ge()).format("HH:mm");
935
+ }
936
+ function c({ hour: b, minute: f }) {
937
+ return ge().set("hour", b).set("minute", f).toISOString();
938
+ }
939
+ function i(b, f) {
940
+ var v;
941
+ const l = [...r.value];
942
+ ((v = e.config) == null ? void 0 : v.type) === me.Timestamp ? l[b] = c({
943
+ hour: Number(f.split(":")[0]),
944
+ minute: Number(f.split(":")[1])
945
+ }) : l[b] = f, r.value = l;
946
+ }
947
+ function g(b) {
948
+ if (b === 0)
949
+ r.value = [void 0, ...r.value];
950
+ else {
951
+ const f = [...r.value];
952
+ f.splice(b, 1), r.value = f;
953
+ }
954
+ }
955
+ return (b, f) => {
956
+ const l = h("FmSelect"), v = h("FmTextField"), w = h("FmTimePicker"), N = h("FmButton");
957
+ return y(!0), $(H, null, de(new Array(r.value.length !== 0 ? r.value.length : 1), (V, B) => {
958
+ var U, F, o, u;
959
+ return y(), $("div", {
960
+ key: B,
961
+ class: "flex flex-row align-center gap-2 w-full"
962
+ }, [
963
+ C("div", gl, [
964
+ ((U = e.config) == null ? void 0 : U.type) === a(me).Select ? (y(), k(l, {
965
+ key: 0,
966
+ "model-value": r.value[B],
967
+ items: e.config.options,
968
+ "onUpdate:modelValue": (n) => i(B, n)
969
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((F = e.config) == null ? void 0 : F.type) === a(me).TextField ? (y(), k(v, {
970
+ key: 1,
971
+ "model-value": r.value[B],
972
+ "onUpdate:modelValue": (n) => i(B, n)
973
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : ((o = e.config) == null ? void 0 : o.type) === a(me).Timestamp ? (y(), $("div", yl, [
974
+ d(w, {
975
+ "model-value": p(r.value[B]),
976
+ "onUpdate:modelValue": (n) => i(B, n)
977
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
978
+ ])) : x("", !0)
979
+ ]),
980
+ ((u = e.config) == null ? void 0 : u.fixed) === !1 ? (y(), $("div", Fl, [
981
+ d(N, {
982
+ icon: B === 0 ? "add" : "remove",
983
+ onClick: (n) => g(B)
984
+ }, null, 8, ["icon", "onClick"])
985
+ ])) : x("", !0)
986
+ ]);
987
+ }), 128);
988
+ };
989
+ }
990
+ }), Vl = { class: "flex flex-col my-2 gap-8" }, wl = { class: "fm-typo-en-body-lg-600" }, xl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, kl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Cl = /* @__PURE__ */ q({
991
+ __name: "FilterSection",
992
+ props: /* @__PURE__ */ X({
993
+ options: {
994
+ type: Array,
995
+ default: () => []
996
+ },
997
+ label: {
998
+ type: String,
999
+ default: "Filter"
1000
+ }
1001
+ }, {
1002
+ modelValue: { required: !1, default: () => [] },
1003
+ modelModifiers: {}
1004
+ }),
1005
+ emits: ["update:modelValue"],
1006
+ setup(m) {
1007
+ const { t: r } = Z(), e = le(m, "modelValue"), p = m, c = T(() => r(`report.section.filter.${p.label}`)), i = E(!1), g = T(
1008
+ () => e.value.map((u, n) => {
1009
+ const t = p.options.find(
1010
+ (s) => s.schemaName === u.schemaName && s.name === u.name
1011
+ );
1012
+ return {
1013
+ index: n,
1014
+ labels: (t == null ? void 0 : t.labels) || [u.schemaName, u.name],
1015
+ value: u
1016
+ };
1017
+ })
1018
+ ), b = E(e.value.length > 0 ? 0 : void 0);
1019
+ function f(u) {
1020
+ var n;
1021
+ i.value = !0, l.value = u != null && u.value ? JSON.parse(JSON.stringify(u.value)) : void 0, b.value = u == null ? void 0 : u.index, v.value = !!((n = l.value) != null && n.dataFormula), V();
1022
+ }
1023
+ const l = E(void 0), v = E(!1), w = E(void 0), N = T(
1024
+ () => p.options.find(
1025
+ (u) => {
1026
+ var n, t;
1027
+ return u.schemaName === ((n = l.value) == null ? void 0 : n.schemaName) && u.name === ((t = l.value) == null ? void 0 : t.name);
1028
+ }
1029
+ ) ?? {}
1030
+ );
1031
+ ce(
1032
+ () => {
1033
+ var u;
1034
+ return (u = l.value) == null ? void 0 : u.option;
1035
+ },
1036
+ (u, n) => {
1037
+ if (n !== void 0 && u !== n && l.value) {
1038
+ if (V(), !w.value)
1039
+ return;
1040
+ l.value = {
1041
+ ...l.value,
1042
+ values: (
1043
+ // only overwrite the value when it empty
1044
+ l.value.values.map((t) => {
1045
+ var s;
1046
+ return t === null ? (s = w.value) == null ? void 0 : s.default : t;
1047
+ })
1048
+ )
1049
+ };
1050
+ }
1051
+ }
1052
+ ), ce(
1053
+ () => {
1054
+ var u;
1055
+ return (u = l.value) == null ? void 0 : u.operator;
1056
+ },
1057
+ (u, n) => {
1058
+ if (u !== n && N.value && l.value) {
1059
+ if (V(), !w.value)
1060
+ return;
1061
+ const t = l.value.values.length - w.value.count;
1062
+ t > 0 && w.value.fixed ? l.value = {
1063
+ ...l.value,
1064
+ values: l.value.values.slice(0, w.value.count)
1065
+ } : t < 0 && (l.value = {
1066
+ ...l.value,
1067
+ values: [
1068
+ ...l.value.values,
1069
+ ...Array(Math.abs(t)).fill(w.value.default)
1070
+ ]
1071
+ });
1072
+ }
1073
+ },
1074
+ {
1075
+ deep: !0
1076
+ }
1077
+ );
1078
+ function V() {
1079
+ N.value && l.value && (w.value = bl({
1080
+ operator: l.value.operator,
1081
+ dataType: N.value.type,
1082
+ dimensionOption: l.value.option
1083
+ }));
1084
+ }
1085
+ function B(u) {
1086
+ var n, t, s;
1087
+ (u.schemaName !== ((n = l.value) == null ? void 0 : n.schemaName) || u.name !== ((t = l.value) == null ? void 0 : t.name)) && (l.value = {
1088
+ schemaName: u.schemaName,
1089
+ name: u.name,
1090
+ operator: u.filterOperators[0],
1091
+ option: u.filterDimensionOptions[0],
1092
+ values: []
1093
+ }, V(), l.value.values = [(s = w.value) == null ? void 0 : s.default]);
1094
+ }
1095
+ function U() {
1096
+ const u = [...g.value.map((n) => n.value)];
1097
+ l.value && (l.value.values = l.value.values.filter(
1098
+ (n) => n !== "" && n !== null
1099
+ ), b.value !== void 0 ? u[Number(b.value)] = l.value : u.push(l.value), e.value = u), i.value = !1;
1100
+ }
1101
+ function F(u) {
1102
+ const n = [...g.value.map((t) => t.value)];
1103
+ n.splice(u, 1), e.value = n, i.value = !1;
1104
+ }
1105
+ const o = T(
1106
+ () => p.options.map((u) => ({
1107
+ label: u.labels.join(" "),
1108
+ value: u
1109
+ }))
1110
+ );
1111
+ return (u, n) => {
1112
+ const t = h("FmCheckbox"), s = h("FmTextarea"), O = h("FmTextField"), P = h("FmForm"), J = h("FmIcon"), R = h("FmButton"), A = h("FmListItem"), z = h("FmList"), K = h("FmField");
1113
+ return y(), $("div", Vl, [
1114
+ d(re, {
1115
+ modelValue: i.value,
1116
+ "onUpdate:modelValue": n[6] || (n[6] = (G) => i.value = G),
1117
+ title: c.value,
1118
+ "primary-button-label": a(r)("report.common.confirm"),
1119
+ "secondary-button-label": a(r)("report.common.cancel"),
1120
+ onConfirm: U
1121
+ }, {
1122
+ content: S(() => [
1123
+ d(P, {
1124
+ ref: "form",
1125
+ class: "flex flex-col gap-2 w-[490px]"
1126
+ }, {
1127
+ default: S(() => {
1128
+ var G, _;
1129
+ return [
1130
+ d(Y, {
1131
+ "model-value": N.value,
1132
+ items: o.value,
1133
+ placeholder: c.value,
1134
+ label: c.value,
1135
+ "onUpdate:modelValue": n[0] || (n[0] = (L) => B(L))
1136
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
1137
+ l.value ? (y(), $(H, { key: 0 }, [
1138
+ d(t, {
1139
+ modelValue: v.value,
1140
+ "onUpdate:modelValue": n[1] || (n[1] = (L) => v.value = L),
1141
+ label: a(r)("report.section.filter.advance"),
1142
+ value: !0
1143
+ }, null, 8, ["modelValue", "label"]),
1144
+ v.value ? (y(), k(s, {
1145
+ key: 0,
1146
+ modelValue: l.value.dataFormula,
1147
+ "onUpdate:modelValue": n[2] || (n[2] = (L) => l.value.dataFormula = L),
1148
+ placeholder: a(r)("report.section.filter.dataFormula")
1149
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0),
1150
+ d(O, {
1151
+ modelValue: l.value.option,
1152
+ "onUpdate:modelValue": n[3] || (n[3] = (L) => l.value.option = L),
1153
+ placeholder: a(r)("report.section.filter.timeFormatter"),
1154
+ label: a(r)("report.section.filter.timeFormatter")
1155
+ }, null, 8, ["modelValue", "placeholder", "label"]),
1156
+ (((G = N.value) == null ? void 0 : G.filterOperators) || []).length > 0 ? (y(), k(Y, {
1157
+ key: 1,
1158
+ modelValue: l.value.operator,
1159
+ "onUpdate:modelValue": n[4] || (n[4] = (L) => l.value.operator = L),
1160
+ items: ((_ = N.value) == null ? void 0 : _.filterOperators.map((L) => ({ label: L, value: L }))) ?? []
1161
+ }, null, 8, ["modelValue", "items"])) : x("", !0),
1162
+ w.value ? (y(), k(hl, {
1163
+ key: 2,
1164
+ modelValue: l.value.values,
1165
+ "onUpdate:modelValue": n[5] || (n[5] = (L) => l.value.values = L),
1166
+ config: w.value
1167
+ }, null, 8, ["modelValue", "config"])) : x("", !0)
1168
+ ], 64)) : x("", !0)
1169
+ ];
1170
+ }),
1171
+ _: 1
1172
+ }, 512)
1173
+ ]),
1174
+ _: 1
1175
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
1176
+ C("div", null, [
1177
+ C("p", wl, I(c.value), 1),
1178
+ C("p", xl, I(a(r)("report.section.filter.description")), 1)
1179
+ ]),
1180
+ d(z, null, {
1181
+ default: S(() => [
1182
+ d(a(be), {
1183
+ list: e.value,
1184
+ "item-key": "id",
1185
+ class: "flex flex-col gap-2 w-full"
1186
+ }, {
1187
+ item: S(({ element: G, index: _ }) => [
1188
+ d(A, {
1189
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1190
+ onClick: te((L) => f(g.value[_]), ["stop"])
1191
+ }, {
1192
+ default: S(() => [
1193
+ d(J, { name: "drag_handle" }),
1194
+ C("p", kl, I(a(Ce)(G.name)), 1),
1195
+ n[8] || (n[8] = C("div", { class: "grow" }, null, -1)),
1196
+ d(R, {
1197
+ icon: "close",
1198
+ size: "md",
1199
+ variant: "tertiary",
1200
+ onClick: te((L) => F(_), ["stop"])
1201
+ }, null, 8, ["onClick"])
1202
+ ]),
1203
+ _: 2
1204
+ }, 1032, ["onClick"])
1205
+ ]),
1206
+ _: 1
1207
+ }, 8, ["list"])
1208
+ ]),
1209
+ _: 1
1210
+ }),
1211
+ d(K, {
1212
+ class: "text-fm-color-typo-tertiary",
1213
+ onClick: n[7] || (n[7] = () => {
1214
+ f();
1215
+ })
1216
+ }, {
1217
+ default: S(() => [
1218
+ se(I(a(r)("report.section.filter.add")), 1)
1219
+ ]),
1220
+ _: 1
1221
+ })
1222
+ ]);
1223
+ };
1224
+ }
1225
+ }), _l = { class: "flex flex-col my-2 gap-8" }, Tl = { class: "fm-typo-en-body-lg-600" }, Sl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Ul = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Nl = /* @__PURE__ */ q({
1226
+ __name: "SortSection",
1227
+ props: /* @__PURE__ */ X({
1228
+ options: {
1229
+ type: Array,
1230
+ default: () => []
1231
+ },
1232
+ label: {
1233
+ type: String,
1234
+ default: "Sort"
1235
+ }
1236
+ }, {
1237
+ modelValue: { required: !1, default: [] },
1238
+ modelModifiers: {}
1239
+ }),
1240
+ emits: ["update:modelValue"],
1241
+ setup(m) {
1242
+ const { t: r } = Z(), e = le(m, "modelValue"), p = m, c = T(
1243
+ () => p.label ? p.label : r(`report.section.sort.${p.label}`)
1244
+ ), i = E(!1), g = T(
1245
+ () => e.value.map((F, o) => {
1246
+ const u = p.options.find(
1247
+ (n) => n.schemaName === F.schemaName && n.name === F.name
1248
+ );
1249
+ return {
1250
+ index: o,
1251
+ labels: (u == null ? void 0 : u.labels) || [F.schemaName, F.name],
1252
+ value: F
1253
+ };
1254
+ })
1255
+ ), b = E(e.value.length > 0 ? 0 : void 0);
1256
+ function f(F) {
1257
+ var o;
1258
+ i.value = !0, l.value = F != null && F.value ? JSON.parse(JSON.stringify(F.value)) : void 0, b.value = F == null ? void 0 : F.index, v.value = !!((o = l.value) != null && o.dataFormula);
1259
+ }
1260
+ const l = E(void 0), v = E(!1), w = T(
1261
+ () => p.options.find(
1262
+ (F) => {
1263
+ var o, u;
1264
+ return F.schemaName === ((o = l.value) == null ? void 0 : o.schemaName) && F.name === ((u = l.value) == null ? void 0 : u.name);
1265
+ }
1266
+ ) ?? {}
1267
+ );
1268
+ function N(F) {
1269
+ var o, u;
1270
+ (F.schemaName !== ((o = l.value) == null ? void 0 : o.schemaName) || F.name !== ((u = l.value) == null ? void 0 : u.name)) && (l.value = {
1271
+ schemaName: F.schemaName,
1272
+ name: F.name,
1273
+ dimensionOption: F.dimensionOptions[0],
1274
+ aggregation: null,
1275
+ type: he.Asc
1276
+ });
1277
+ }
1278
+ function V() {
1279
+ if (!l.value) {
1280
+ console.log("new sort is undefined");
1281
+ return;
1282
+ }
1283
+ const F = [...g.value.map((o) => o.value)];
1284
+ b.value !== void 0 ? F[b.value] = l.value : F.push(l.value), e.value = F, i.value = !1;
1285
+ }
1286
+ function B(F) {
1287
+ const o = [...g.value.map((u) => u.value)];
1288
+ o.splice(F, 1), e.value = o, i.value = !1;
1289
+ }
1290
+ const U = T(
1291
+ () => p.options.map((F) => ({
1292
+ label: F.labels.join(" "),
1293
+ value: F
1294
+ }))
1295
+ );
1296
+ return (F, o) => {
1297
+ const u = h("FmCheckbox"), n = h("FmTextarea"), t = h("FmForm"), s = h("FmIcon"), O = h("FmButton"), P = h("FmListItem"), J = h("FmList"), R = h("FmField");
1298
+ return y(), $("div", _l, [
1299
+ d(re, {
1300
+ modelValue: i.value,
1301
+ "onUpdate:modelValue": o[6] || (o[6] = (A) => i.value = A),
1302
+ title: c.value,
1303
+ onConfirm: V
1304
+ }, {
1305
+ content: S(() => [
1306
+ d(t, {
1307
+ ref: "form",
1308
+ class: "flex flex-col gap-2 w-[490px]"
1309
+ }, {
1310
+ default: S(() => {
1311
+ var A, z, K, G;
1312
+ return [
1313
+ d(Y, {
1314
+ "model-value": w.value,
1315
+ items: U.value,
1316
+ placeholder: c.value,
1317
+ label: c.value,
1318
+ "onUpdate:modelValue": o[0] || (o[0] = (_) => N(_))
1319
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
1320
+ l.value ? (y(), $(H, { key: 0 }, [
1321
+ (((A = w.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (y(), k(Y, {
1322
+ key: 0,
1323
+ modelValue: l.value.dimensionOption,
1324
+ "onUpdate:modelValue": o[1] || (o[1] = (_) => l.value.dimensionOption = _),
1325
+ items: ((z = w.value) == null ? void 0 : z.dimensionOptions.map((_) => ({ label: _, value: _ }))) ?? [],
1326
+ placeholder: a(r)("report.section.sort.format"),
1327
+ label: a(r)("report.section.sort.format")
1328
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : x("", !0),
1329
+ (((K = w.value) == null ? void 0 : K.aggregations) || []).length > 0 ? (y(), k(Y, {
1330
+ key: 1,
1331
+ modelValue: l.value.aggregation,
1332
+ "onUpdate:modelValue": o[2] || (o[2] = (_) => l.value.aggregation = _),
1333
+ items: ((G = w.value) == null ? void 0 : G.aggregations.map((_) => ({ label: _, value: _ }))) ?? [],
1334
+ label: a(r)("report.section.sort.aggregation"),
1335
+ placeholder: a(r)("report.section.sort.aggregation")
1336
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])) : x("", !0),
1337
+ d(Y, {
1338
+ modelValue: l.value.type,
1339
+ "onUpdate:modelValue": o[3] || (o[3] = (_) => l.value.type = _),
1340
+ items: Object.values(a(he)).map((_) => ({ label: _, value: _ })),
1341
+ placeholder: a(r)("report.section.sort.order"),
1342
+ label: a(r)("report.section.sort.order")
1343
+ }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1344
+ d(u, {
1345
+ modelValue: v.value,
1346
+ "onUpdate:modelValue": o[4] || (o[4] = (_) => v.value = _),
1347
+ label: a(r)("report.section.sort.advance"),
1348
+ value: !0
1349
+ }, null, 8, ["modelValue", "label"]),
1350
+ v.value ? (y(), k(n, {
1351
+ key: 2,
1352
+ modelValue: l.value.dataFormula,
1353
+ "onUpdate:modelValue": o[5] || (o[5] = (_) => l.value.dataFormula = _),
1354
+ placeholder: a(r)("report.section.sort.dataFormula")
1355
+ }, null, 8, ["modelValue", "placeholder"])) : x("", !0)
1356
+ ], 64)) : x("", !0)
1357
+ ];
1358
+ }),
1359
+ _: 1
1360
+ }, 512)
1361
+ ]),
1362
+ _: 1
1363
+ }, 8, ["modelValue", "title"]),
1364
+ C("div", null, [
1365
+ C("p", Tl, I(c.value), 1),
1366
+ C("p", Sl, I(a(r)("report.section.sort.description")), 1)
1367
+ ]),
1368
+ d(J, null, {
1369
+ default: S(() => [
1370
+ d(a(be), {
1371
+ list: e.value,
1372
+ "item-key": "id",
1373
+ class: "flex flex-col gap-2 w-full"
1374
+ }, {
1375
+ item: S(({ element: A, index: z }) => [
1376
+ d(P, {
1377
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1378
+ onClick: te((K) => f(g.value[z]), ["stop"])
1379
+ }, {
1380
+ default: S(() => [
1381
+ d(s, { name: "drag_handle" }),
1382
+ C("p", Ul, I(a(Ce)(A.name)), 1),
1383
+ o[8] || (o[8] = C("div", { class: "grow" }, null, -1)),
1384
+ d(O, {
1385
+ icon: "close",
1386
+ size: "md",
1387
+ variant: "tertiary",
1388
+ onClick: te((K) => B(z), ["stop"])
1389
+ }, null, 8, ["onClick"])
1390
+ ]),
1391
+ _: 2
1392
+ }, 1032, ["onClick"])
1393
+ ]),
1394
+ _: 1
1395
+ }, 8, ["list"])
1396
+ ]),
1397
+ _: 1
1398
+ }),
1399
+ d(R, {
1400
+ class: "text-fm-color-typo-tertiary",
1401
+ onClick: o[7] || (o[7] = () => {
1402
+ f();
1403
+ })
1404
+ }, {
1405
+ default: S(() => [
1406
+ se(I(a(r)("report.section.sort.add")), 1)
1407
+ ]),
1408
+ _: 1
1409
+ })
1410
+ ]);
1411
+ };
1412
+ }
1413
+ }), Dl = { class: "fm-typo-en-body-lg-600" }, $l = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Ol = /* @__PURE__ */ q({
1414
+ __name: "LimitSection",
1415
+ props: {
1416
+ modelValue: { required: !0, default: null },
1417
+ modelModifiers: {}
1418
+ },
1419
+ emits: ["update:modelValue"],
1420
+ setup(m) {
1421
+ const { t: r } = Z(), e = le(m, "modelValue"), p = Oe((c) => {
1422
+ c !== "" ? e.value = c : e.value = null;
1423
+ }, 1e3);
1424
+ return (c, i) => {
1425
+ const g = h("FmTextField");
1426
+ return y(), $(H, null, [
1427
+ C("div", null, [
1428
+ C("p", Dl, I(a(r)("report.section.limit.title")), 1),
1429
+ C("p", $l, I(a(r)("report.section.limit.description")), 1)
1430
+ ]),
1431
+ d(g, {
1432
+ "model-value": e.value,
1433
+ inputmode: "numeric",
1434
+ placeholder: a(r)("report.section.limit.placeholder"),
1435
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => a(p)(b))
1436
+ }, null, 8, ["model-value", "placeholder"])
1437
+ ], 64);
1438
+ };
1439
+ }
1440
+ }), Ll = { class: "flex flex-col my-2 gap-8" }, Il = { class: "fm-typo-en-body-lg-600" }, Bl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Rl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Ml = /* @__PURE__ */ q({
1441
+ __name: "ConditionSection",
1442
+ props: /* @__PURE__ */ X({
1443
+ joinFieldOptions: {
1444
+ type: Array,
1445
+ default: () => []
1446
+ },
1447
+ mainFieldOptions: {
1448
+ type: Array,
1449
+ default: () => []
1450
+ }
1451
+ }, {
1452
+ modelValue: { required: !0 },
1453
+ modelModifiers: {}
1454
+ }),
1455
+ emits: ["update:modelValue"],
1456
+ setup(m) {
1457
+ const { t: r } = Z(), e = le(m, "modelValue"), p = m, c = E(!1), i = T(
1458
+ () => e.value.map((o, u) => {
1459
+ var n, t;
1460
+ return {
1461
+ index: u,
1462
+ labels: [(n = o.joinDimension) == null ? void 0 : n.schemaName, (t = o.joinDimension) == null ? void 0 : t.name],
1463
+ value: o
1464
+ };
1465
+ })
1466
+ ), g = E(e.value.length > 0 ? 0 : void 0);
1467
+ function b(o) {
1468
+ o ? (f.value = o != null && o.value ? JSON.parse(JSON.stringify(o.value)) : void 0, g.value = o == null ? void 0 : o.index) : (f.value = {
1469
+ joinDimension: null,
1470
+ operator: "",
1471
+ mainDimensions: []
1472
+ }, g.value = void 0), c.value = !0;
1473
+ }
1474
+ const f = E(void 0), l = T(
1475
+ () => p.joinFieldOptions.find(
1476
+ (o) => {
1477
+ var u, n;
1478
+ return o.schemaName === ((n = (u = f.value) == null ? void 0 : u.joinDimension) == null ? void 0 : n.schemaName) && o.name === f.value.joinDimension.name;
1479
+ }
1480
+ ) ?? {}
1481
+ ), v = T(
1482
+ () => {
1483
+ var o;
1484
+ return (((o = f.value) == null ? void 0 : o.mainDimensions) || []).map(
1485
+ (u) => p.mainFieldOptions.find(
1486
+ (n) => n.schemaName === (u == null ? void 0 : u.schemaName) && n.name === u.name
1487
+ ) ?? {}
1488
+ );
1489
+ }
1490
+ ), w = T(
1491
+ () => p.joinFieldOptions.map((o) => ({ label: o.labels.join(" "), value: o }))
1492
+ );
1493
+ function N(o) {
1494
+ var u, n, t, s;
1495
+ f.value && (f.value && o.schemaName !== ((n = (u = f.value) == null ? void 0 : u.joinDimension) == null ? void 0 : n.schemaName) || o.name !== ((s = (t = f.value) == null ? void 0 : t.joinDimension) == null ? void 0 : s.name)) && (f.value = {
1496
+ ...f.value,
1497
+ joinDimension: {
1498
+ schemaName: o.schemaName,
1499
+ name: o.name,
1500
+ option: o.dimensionOptions[0],
1501
+ label: o.label,
1502
+ hide: !0
1503
+ }
1504
+ }, o.joinConditionOperators.includes(f.value.operator) || B(o.joinConditionOperators[0]));
1505
+ }
1506
+ function V(o, u) {
1507
+ var n, t, s, O;
1508
+ if (f.value && u >= 0 && (f.value && o.schemaName !== ((t = (n = f.value) == null ? void 0 : n.mainDimensions[u]) == null ? void 0 : t.schemaName) || o.name !== ((O = (s = f.value) == null ? void 0 : s.mainDimensions[u]) == null ? void 0 : O.name))) {
1509
+ const P = [...f.value.mainDimensions];
1510
+ P[u] = {
1511
+ schemaName: o.schemaName,
1512
+ name: o.name,
1513
+ option: o.dimensionOptions[0],
1514
+ label: o.label,
1515
+ hide: !0
1516
+ }, f.value = {
1517
+ ...f.value,
1518
+ mainDimensions: P
1519
+ };
1520
+ }
1521
+ }
1522
+ function B(o) {
1523
+ if (f.value)
1524
+ switch (o) {
1525
+ case ae.Between:
1526
+ f.value = {
1527
+ ...f.value,
1528
+ operator: o,
1529
+ mainDimensions: [null, null]
1530
+ };
1531
+ break;
1532
+ default:
1533
+ f.value = {
1534
+ ...f.value,
1535
+ operator: o,
1536
+ mainDimensions: [null]
1537
+ };
1538
+ break;
1539
+ }
1540
+ }
1541
+ function U() {
1542
+ const o = [...i.value.map((u) => u.value)];
1543
+ f.value && (f.value.mainDimensions = f.value.mainDimensions.filter(
1544
+ (u) => u !== "" && u != null
1545
+ ), g.value !== void 0 ? o[g.value] = f.value : o.push(f.value)), e.value = o, c.value = !1;
1546
+ }
1547
+ function F(o) {
1548
+ const u = [...i.value.map((n) => n.value)];
1549
+ u.splice(o, 1), e.value = u;
1550
+ }
1551
+ return (o, u) => {
1552
+ const n = h("FmMenuDivider"), t = h("FmForm"), s = h("FmButton"), O = h("FmListItem"), P = h("FmList"), J = h("FmField");
1553
+ return y(), $("div", Ll, [
1554
+ d(re, {
1555
+ modelValue: c.value,
1556
+ "onUpdate:modelValue": u[2] || (u[2] = (R) => c.value = R),
1557
+ title: a(r)("report.section.condition.condition"),
1558
+ onConfirm: U
1559
+ }, {
1560
+ content: S(() => [
1561
+ d(t, {
1562
+ ref: "form",
1563
+ class: "flex flex-col gap-2 w-[490px]"
1564
+ }, {
1565
+ default: S(() => {
1566
+ var R, A, z, K, G;
1567
+ return [
1568
+ d(Y, {
1569
+ label: a(r)("report.section.condition.joinDatasource"),
1570
+ "model-value": l.value,
1571
+ items: w.value,
1572
+ placeholder: a(r)("report.section.condition.joinDimension"),
1573
+ "onUpdate:modelValue": u[0] || (u[0] = (_) => N(_))
1574
+ }, null, 8, ["label", "model-value", "items", "placeholder"]),
1575
+ d(n),
1576
+ (R = f.value) != null && R.joinDimension && (((A = l.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (y(), k(Y, {
1577
+ key: 0,
1578
+ modelValue: f.value.joinDimension.option,
1579
+ "onUpdate:modelValue": u[1] || (u[1] = (_) => f.value.joinDimension.option = _),
1580
+ label: a(r)("report.section.condition.format"),
1581
+ items: ((z = l.value) == null ? void 0 : z.dimensionOptions.map((_) => ({
1582
+ label: _,
1583
+ value: _
1584
+ }))) ?? []
1585
+ }, null, 8, ["modelValue", "label", "items"])) : x("", !0),
1586
+ f.value && (((K = l.value) == null ? void 0 : K.joinConditionOperators) || []).length > 0 ? (y(), k(Y, {
1587
+ key: 1,
1588
+ "model-value": f.value.operator,
1589
+ label: a(r)("report.section.condition.operator"),
1590
+ items: l.value.joinConditionOperators.map((_) => ({
1591
+ label: _,
1592
+ value: _
1593
+ })) ?? [],
1594
+ "onUpdate:modelValue": B
1595
+ }, null, 8, ["model-value", "label", "items"])) : x("", !0),
1596
+ (y(!0), $(H, null, de(((G = f.value) == null ? void 0 : G.mainDimensions) || [], (_, L) => {
1597
+ var ee, oe;
1598
+ return y(), $("div", {
1599
+ key: L,
1600
+ class: "flex flex-col gap-2"
1601
+ }, [
1602
+ d(Y, {
1603
+ "model-value": v.value[L],
1604
+ label: a(r)("report.section.condition.mainDatasource", { index: L + 1 }),
1605
+ items: p.mainFieldOptions.map((W) => ({
1606
+ label: W.labels.join(" "),
1607
+ value: W
1608
+ })),
1609
+ "onUpdate:modelValue": (W) => V(W, L)
1610
+ }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1611
+ _ && (((ee = v.value[L]) == null ? void 0 : ee.dimensionOptions) || []).length > 0 && _ ? (y(), k(Y, {
1612
+ key: 0,
1613
+ modelValue: _.option,
1614
+ "onUpdate:modelValue": (W) => _.option = W,
1615
+ items: (oe = v.value[L]) == null ? void 0 : oe.dimensionOptions.map((W) => ({
1616
+ label: W,
1617
+ value: W
1618
+ }))
1619
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : x("", !0),
1620
+ d(n)
1621
+ ]);
1622
+ }), 128))
1623
+ ];
1624
+ }),
1625
+ _: 1
1626
+ }, 512)
1627
+ ]),
1628
+ _: 1
1629
+ }, 8, ["modelValue", "title"]),
1630
+ C("div", null, [
1631
+ C("p", Il, I(a(r)("report.section.condition.condition")), 1),
1632
+ C("p", Bl, I(a(r)("report.section.condition.description")), 1)
1633
+ ]),
1634
+ d(P, { class: "flex flex-col gap-2" }, {
1635
+ default: S(() => [
1636
+ (y(!0), $(H, null, de(e.value, (R, A) => (y(), k(O, {
1637
+ key: A,
1638
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1639
+ onClick: (z) => b(i.value[A])
1640
+ }, {
1641
+ default: S(() => {
1642
+ var z, K;
1643
+ return [
1644
+ C("p", Rl, I(a(Je)(((z = R.joinDimension) == null ? void 0 : z.schemaName) ?? "")) + " " + I((K = R.joinDimension) == null ? void 0 : K.label), 1),
1645
+ u[4] || (u[4] = C("div", { class: "grow" }, null, -1)),
1646
+ d(s, {
1647
+ icon: "close",
1648
+ size: "md",
1649
+ variant: "tertiary",
1650
+ onClick: te((G) => F(A), ["stop"])
1651
+ }, null, 8, ["onClick"])
1652
+ ];
1653
+ }),
1654
+ _: 2
1655
+ }, 1032, ["onClick"]))), 128))
1656
+ ]),
1657
+ _: 1
1658
+ }),
1659
+ d(J, {
1660
+ class: "text-fm-color-typo-tertiary cursor-pointer",
1661
+ onClick: u[3] || (u[3] = (R) => b())
1662
+ }, {
1663
+ default: S(() => [
1664
+ se(I(a(r)("report.section.condition.add")), 1)
1665
+ ]),
1666
+ _: 1
1667
+ })
1668
+ ]);
1669
+ };
1670
+ }
1671
+ }), jl = { class: "legend-section space-y-2" }, Al = { class: "title-style-section space-y-2" }, El = /* @__PURE__ */ q({
1672
+ __name: "TitleSection",
1673
+ props: {
1674
+ model: {}
1675
+ },
1676
+ emits: ["update:model"],
1677
+ setup(m, { emit: r }) {
1678
+ const e = m, p = r, { t: c } = Z(), i = T({
1679
+ get: () => e.model,
1680
+ set: (g) => p("update:model", g)
1681
+ });
1682
+ return (g, b) => {
1683
+ const f = h("FmSwitch"), l = h("FmTextField");
1684
+ return y(), $("div", jl, [
1685
+ C("div", Al, [
1686
+ d(f, {
1687
+ label: a(c)("report.section.datasource.title.showTitle"),
1688
+ type: "number",
1689
+ "model-value": i.value.showTitle ?? !0,
1690
+ "onUpdate:modelValue": b[0] || (b[0] = (v) => i.value.showTitle = v)
1691
+ }, null, 8, ["label", "model-value"]),
1692
+ d(l, {
1693
+ label: a(c)("report.section.datasource.fontSize"),
1694
+ type: "number",
1695
+ "model-value": i.value.titleFontSize ?? 14,
1696
+ "onUpdate:modelValue": b[1] || (b[1] = (v) => {
1697
+ const w = Math.min(Number(v), 24);
1698
+ i.value = { ...i.value, titleFontSize: w };
1699
+ })
1700
+ }, null, 8, ["label", "model-value"]),
1701
+ d(f, {
1702
+ label: a(c)("report.section.datasource.title.bold"),
1703
+ "label-placement": "right",
1704
+ "model-value": i.value.titleBold ?? !1,
1705
+ "onUpdate:modelValue": b[2] || (b[2] = (v) => i.value.titleBold = v)
1706
+ }, null, 8, ["label", "model-value"]),
1707
+ d(f, {
1708
+ label: a(c)("report.section.datasource.title.italic"),
1709
+ "label-placement": "right",
1710
+ "model-value": i.value.titleItalic ?? !1,
1711
+ "onUpdate:modelValue": b[3] || (b[3] = (v) => i.value.titleItalic = v)
1712
+ }, null, 8, ["label", "model-value"]),
1713
+ d(f, {
1714
+ label: a(c)("report.section.datasource.title.underline"),
1715
+ "label-placement": "right",
1716
+ "model-value": i.value.titleUnderline ?? !1,
1717
+ "onUpdate:modelValue": b[4] || (b[4] = (v) => i.value.titleUnderline = v)
1718
+ }, null, 8, ["label", "model-value"])
1719
+ ])
1720
+ ]);
1721
+ };
1722
+ }
1723
+ }), Pl = /* @__PURE__ */ q({
1724
+ __name: "LabelSection",
1725
+ props: {
1726
+ model: {}
1727
+ },
1728
+ emits: ["update:model"],
1729
+ setup(m, { emit: r }) {
1730
+ const e = m, p = r, { t: c } = Z(), i = T({
1731
+ get: () => e.model,
1732
+ set: (f) => p("update:model", f)
1733
+ }), g = [
1734
+ { label: c("report.section.datasource.position.left"), value: ne.left },
1735
+ { label: c("report.section.datasource.position.center"), value: ne.center },
1736
+ { label: c("report.section.datasource.position.right"), value: ne.right },
1737
+ { label: c("report.section.datasource.position.start"), value: ne.start },
1738
+ { label: c("report.section.datasource.position.end"), value: ne.end },
1739
+ { label: c("report.section.datasource.position.top"), value: ne.top },
1740
+ { label: c("report.section.datasource.position.bottom"), value: ne.bottom }
1741
+ ], b = [
1742
+ { label: c("report.section.datasource.position.start"), value: pe.start },
1743
+ { label: c("report.section.datasource.position.center"), value: pe.center },
1744
+ { label: c("report.section.datasource.position.end"), value: pe.end }
1745
+ ];
1746
+ return (f, l) => {
1747
+ const v = h("FmSwitch"), w = h("FmSelect"), N = h("FmTextField");
1748
+ return y(), $(H, null, [
1749
+ d(v, {
1750
+ label: a(c)("report.section.datasource.label.showLabel"),
1751
+ "label-placement": "right",
1752
+ "model-value": i.value.showLabel ?? !1,
1753
+ "onUpdate:modelValue": l[0] || (l[0] = (V) => i.value.showLabel = V)
1754
+ }, null, 8, ["label", "model-value"]),
1755
+ i.value.showLabel ? (y(), $(H, { key: 0 }, [
1756
+ d(w, {
1757
+ label: a(c)("report.section.datasource.alignment.align"),
1758
+ items: g,
1759
+ "model-value": i.value.labelAlign ?? a(ne).center,
1760
+ "onUpdate:modelValue": l[1] || (l[1] = (V) => {
1761
+ i.value = { ...i.value, labelAlign: V };
1762
+ })
1763
+ }, null, 8, ["label", "model-value"]),
1764
+ d(w, {
1765
+ label: a(c)("report.section.datasource.alignment.anchor"),
1766
+ items: b,
1767
+ "model-value": i.value.labelAnchor ?? a(pe).center,
1768
+ "onUpdate:modelValue": l[2] || (l[2] = (V) => {
1769
+ i.value = { ...i.value, labelAnchor: V };
1770
+ })
1771
+ }, null, 8, ["label", "model-value"]),
1772
+ d(N, {
1773
+ label: a(c)("report.section.datasource.alignment.rotation"),
1774
+ type: "number",
1775
+ min: -180,
1776
+ max: 180,
1777
+ step: 1,
1778
+ "model-value": i.value.labelRotation ?? 0,
1779
+ "onUpdate:modelValue": l[3] || (l[3] = (V) => {
1780
+ i.value = { ...i.value, labelRotation: Number(V) };
1781
+ })
1782
+ }, null, 8, ["label", "model-value"]),
1783
+ d(N, {
1784
+ label: a(c)("report.section.datasource.alignment.offset"),
1785
+ type: "number",
1786
+ "model-value": i.value.labelOffset ?? 0,
1787
+ "onUpdate:modelValue": l[4] || (l[4] = (V) => {
1788
+ i.value = { ...i.value, labelOffset: Number(V) };
1789
+ })
1790
+ }, null, 8, ["label", "model-value"]),
1791
+ d(N, {
1792
+ label: a(c)("report.section.datasource.fontSize"),
1793
+ type: "number",
1794
+ "model-value": i.value.labelFontSize ?? 12,
1795
+ "onUpdate:modelValue": l[5] || (l[5] = (V) => {
1796
+ i.value = { ...i.value, labelFontSize: Number(V) };
1797
+ })
1798
+ }, null, 8, ["label", "model-value"])
1799
+ ], 64)) : x("", !0)
1800
+ ], 64);
1801
+ };
1802
+ }
1803
+ }), zl = /* @__PURE__ */ q({
1804
+ __name: "XySection",
1805
+ props: {
1806
+ model: {}
1807
+ },
1808
+ emits: ["update:model"],
1809
+ setup(m, { emit: r }) {
1810
+ const e = m, p = r, { t: c } = Z(), i = T({
1811
+ get: () => e.model,
1812
+ set: (f) => p("update:model", f)
1813
+ }), g = [
1814
+ { label: c("report.section.datasource.position.top"), value: "top" },
1815
+ { label: c("report.section.datasource.position.bottom"), value: "bottom" }
1816
+ ], b = [
1817
+ { label: c("report.section.datasource.position.left"), value: "left" },
1818
+ { label: c("report.section.datasource.position.right"), value: "right" }
1819
+ ];
1820
+ return (f, l) => {
1821
+ const v = h("FmSwitch"), w = h("FmSelect"), N = h("FmTextField");
1822
+ return y(), $(H, null, [
1823
+ d(v, {
1824
+ label: a(c)("report.section.datasource.axis.showX"),
1825
+ "label-placement": "right",
1826
+ "model-value": i.value.showX ?? !0,
1827
+ "onUpdate:modelValue": l[0] || (l[0] = (V) => i.value.showX = V)
1828
+ }, null, 8, ["label", "model-value"]),
1829
+ i.value.showX ?? !0 ? (y(), $(H, { key: 0 }, [
1830
+ d(w, {
1831
+ label: a(c)("report.section.datasource.position.showPosition"),
1832
+ items: g,
1833
+ "model-value": i.value.xPosition ?? "bottom",
1834
+ "onUpdate:modelValue": l[1] || (l[1] = (V) => i.value.xPosition = V)
1835
+ }, null, 8, ["label", "model-value"]),
1836
+ d(v, {
1837
+ label: a(c)("report.section.datasource.axis.showGrid"),
1838
+ "label-placement": "right",
1839
+ "model-value": i.value.showXGrid ?? !1,
1840
+ "onUpdate:modelValue": l[2] || (l[2] = (V) => i.value.showXGrid = V)
1841
+ }, null, 8, ["label", "model-value"]),
1842
+ d(v, {
1843
+ label: a(c)("report.section.datasource.axis.showTick"),
1844
+ "label-placement": "right",
1845
+ "model-value": i.value.showXTick ?? !0,
1846
+ "onUpdate:modelValue": l[3] || (l[3] = (V) => i.value.showXTick = V)
1847
+ }, null, 8, ["label", "model-value"]),
1848
+ i.value.showXTick ?? !0 ? (y(), k(N, {
1849
+ key: 0,
1850
+ label: a(c)("report.section.datasource.fontSize"),
1851
+ type: "number",
1852
+ "model-value": i.value.xTickFontSize ?? 12,
1853
+ "onUpdate:modelValue": l[4] || (l[4] = (V) => {
1854
+ i.value = { ...i.value, xTickFontSize: Number(V) };
1855
+ })
1856
+ }, null, 8, ["label", "model-value"])) : x("", !0)
1857
+ ], 64)) : x("", !0),
1858
+ d(v, {
1859
+ label: a(c)("report.section.datasource.axis.showY"),
1860
+ "label-placement": "right",
1861
+ "model-value": i.value.showY ?? !0,
1862
+ "onUpdate:modelValue": l[5] || (l[5] = (V) => i.value.showY = V)
1863
+ }, null, 8, ["label", "model-value"]),
1864
+ i.value.showY ?? !0 ? (y(), $(H, { key: 1 }, [
1865
+ d(w, {
1866
+ label: a(c)("report.section.datasource.position.showPosition"),
1867
+ items: b,
1868
+ "model-value": i.value.yPosition ?? "left",
1869
+ "onUpdate:modelValue": l[6] || (l[6] = (V) => i.value.yPosition = V)
1870
+ }, null, 8, ["label", "model-value"]),
1871
+ d(v, {
1872
+ label: a(c)("report.section.datasource.axis.showGrid"),
1873
+ "label-placement": "right",
1874
+ "model-value": i.value.showYGrid ?? !1,
1875
+ "onUpdate:modelValue": l[7] || (l[7] = (V) => i.value.showYGrid = V)
1876
+ }, null, 8, ["label", "model-value"]),
1877
+ d(v, {
1878
+ label: a(c)("report.section.datasource.axis.showTick"),
1879
+ "label-placement": "right",
1880
+ "model-value": i.value.showYTick ?? !0,
1881
+ "onUpdate:modelValue": l[8] || (l[8] = (V) => i.value.showYTick = V)
1882
+ }, null, 8, ["label", "model-value"]),
1883
+ i.value.showYTick ?? !0 ? (y(), k(N, {
1884
+ key: 0,
1885
+ label: a(c)("report.section.datasource.fontSize"),
1886
+ type: "number",
1887
+ "model-value": i.value.yTickFontSize ?? 12,
1888
+ "onUpdate:modelValue": l[9] || (l[9] = (V) => {
1889
+ i.value = { ...i.value, yTickFontSize: Number(V) };
1890
+ })
1891
+ }, null, 8, ["label", "model-value"])) : x("", !0)
1892
+ ], 64)) : x("", !0)
1893
+ ], 64);
1894
+ };
1895
+ }
1896
+ }), ql = { class: "legend-section space-y-2" }, Hl = /* @__PURE__ */ q({
1897
+ __name: "LegendSection",
1898
+ props: {
1899
+ model: {},
1900
+ isCircularWidget: { type: Boolean }
1901
+ },
1902
+ emits: ["update:model"],
1903
+ setup(m, { emit: r }) {
1904
+ const e = m, p = r, { t: c } = Z(), i = T({
1905
+ get: () => e.model,
1906
+ set: (f) => p("update:model", f)
1907
+ }), g = [
1908
+ { label: c("report.section.datasource.position.top"), value: "top" },
1909
+ { label: c("report.section.datasource.position.bottom"), value: "bottom" },
1910
+ { label: c("report.section.datasource.position.left"), value: "left" },
1911
+ { label: c("report.section.datasource.position.right"), value: "right" }
1912
+ ], b = T({
1913
+ get: () => i.value.showLegend !== void 0 ? i.value.showLegend : e.isCircularWidget === !0,
1914
+ set: (f) => {
1915
+ i.value.showLegend = f;
1916
+ }
1917
+ });
1918
+ return (f, l) => {
1919
+ const v = h("FmSwitch"), w = h("FmSelect");
1920
+ return y(), $("div", ql, [
1921
+ d(v, {
1922
+ label: a(c)("report.section.datasource.legend.showLegend"),
1923
+ "label-placement": "right",
1924
+ "model-value": b.value ?? !1,
1925
+ "onUpdate:modelValue": l[0] || (l[0] = (N) => b.value = N)
1926
+ }, null, 8, ["label", "model-value"]),
1927
+ b.value ? (y(), $(H, { key: 0 }, [
1928
+ d(w, {
1929
+ label: a(c)("report.section.datasource.position.showPosition"),
1930
+ items: g,
1931
+ "model-value": i.value.legendPosition ?? "top",
1932
+ "onUpdate:modelValue": l[1] || (l[1] = (N) => i.value.legendPosition = N)
1933
+ }, null, 8, ["label", "model-value"]),
1934
+ d(v, {
1935
+ label: a(c)("report.section.datasource.legend.usePointStyle"),
1936
+ "label-placement": "right",
1937
+ "model-value": i.value.usePointStyle ?? !0,
1938
+ "onUpdate:modelValue": l[2] || (l[2] = (N) => i.value.usePointStyle = N)
1939
+ }, null, 8, ["label", "model-value"])
1940
+ ], 64)) : x("", !0)
1941
+ ]);
1942
+ };
1943
+ }
1944
+ }), Yl = { class: "chart-size-section space-y-2" }, Gl = /* @__PURE__ */ q({
1945
+ __name: "ChartSizeSection",
1946
+ props: {
1947
+ model: {}
1948
+ },
1949
+ emits: ["update:model"],
1950
+ setup(m, { emit: r }) {
1951
+ const e = m, p = r, { t: c } = Z(), i = T({
1952
+ get: () => e.model,
1953
+ set: (g) => p("update:model", g)
1954
+ });
1955
+ return (g, b) => {
1956
+ const f = h("FmTextField");
1957
+ return y(), $("div", Yl, [
1958
+ d(f, {
1959
+ type: "number",
1960
+ label: a(c)("report.section.datasource.chartHeight"),
1961
+ "model-value": i.value.chartHeight,
1962
+ "onUpdate:modelValue": b[0] || (b[0] = (l) => i.value.chartHeight = l === "" ? void 0 : Number(l)),
1963
+ suffix: "px",
1964
+ min: "0",
1965
+ placeholder: "Auto"
1966
+ }, null, 8, ["label", "model-value"]),
1967
+ d(f, {
1968
+ type: "number",
1969
+ label: a(c)("report.section.datasource.chartWidth"),
1970
+ "model-value": i.value.chartWidth,
1971
+ "onUpdate:modelValue": b[1] || (b[1] = (l) => i.value.chartWidth = l === "" ? void 0 : Number(l)),
1972
+ suffix: "px",
1973
+ min: "0",
1974
+ placeholder: "Auto"
1975
+ }, null, 8, ["label", "model-value"])
1976
+ ]);
1977
+ };
1978
+ }
1979
+ }), Se = /* @__PURE__ */ q({
1980
+ __name: "Datasource",
1981
+ props: /* @__PURE__ */ X({
1982
+ label: {
1983
+ type: String,
1984
+ default: "Label"
1985
+ },
1986
+ config: {
1987
+ type: Object,
1988
+ default: null
1989
+ },
1990
+ closeable: {
1991
+ type: Boolean,
1992
+ default: !1
1993
+ },
1994
+ mainDatasourceConfig: {
1995
+ type: Object,
1996
+ default: () => {
1997
+ }
1998
+ },
1999
+ modelValue: {
2000
+ type: Object,
2001
+ default: () => {
2002
+ }
2003
+ }
2004
+ }, {
2005
+ modelValue: { required: !0 },
2006
+ modelModifiers: {}
2007
+ }),
2008
+ emits: /* @__PURE__ */ X(["click-close"], ["update:modelValue"]),
2009
+ setup(m, { emit: r }) {
2010
+ const e = le(m, "modelValue");
2011
+ ce(
2012
+ [() => e.value.dimensions, () => e.value.metrics],
2013
+ () => {
2014
+ const { rowIds: F, columnIds: o } = we(e.value);
2015
+ e.value.rowIds = F, e.value.columnIds = o;
2016
+ },
2017
+ { deep: !0 }
2018
+ );
2019
+ const p = m, c = r, { schemas: i } = ke(Ie()), { t: g, te: b } = Z(), f = T(() => !p.mainDatasourceConfig), l = T(
2020
+ () => [D.BarChart, D.LineChart, D.Scorecard].includes(p.config.type)
2021
+ ), v = T(() => {
2022
+ const F = [...e.value.dimensions].filter((o) => !o.hide);
2023
+ return F.sort(
2024
+ (o, u) => (e.value.rowIds || []).indexOf(fe(o)) - (e.value.rowIds || []).indexOf(fe(u))
2025
+ ), F;
2026
+ }), w = T(() => p.config.type === D.Scorecard), N = T(
2027
+ () => {
2028
+ var F;
2029
+ return (((F = p.mainDatasourceConfig) == null ? void 0 : F.schemaNames) || []).reduce(
2030
+ (o, u) => {
2031
+ const n = i.value.find((t) => t.name === u);
2032
+ return n && (o = [
2033
+ ...o,
2034
+ ...n.fields.map((t) => ({
2035
+ ...t,
2036
+ labels: [
2037
+ Q(g, b, n.label, "schema"),
2038
+ Q(g, b, t.label || t.name, "other")
2039
+ ]
2040
+ }))
2041
+ ]), o;
2042
+ },
2043
+ []
2044
+ );
2045
+ }
2046
+ ), V = T(
2047
+ () => e.value.schemaNames.reduce((F, o) => {
2048
+ const u = i.value.find((n) => n.name === o);
2049
+ return u && (F = [
2050
+ ...F,
2051
+ ...u.fields.map((n) => ({
2052
+ ...n,
2053
+ labels: [
2054
+ Q(g, b, u.label, "schema"),
2055
+ Q(g, b, n.label || n.name, "other")
2056
+ ]
2057
+ }))
2058
+ ]), F;
2059
+ }, [])
2060
+ ), B = T(() => [
2061
+ { label: g("report.section.datasource.none"), value: null },
2062
+ { label: g("report.section.datasource.grandTotal"), value: 0 },
2063
+ ...[...v.value].slice(0, v.value.length - 1).map((F, o) => ({
2064
+ label: Q(g, b, F.label, "other"),
2065
+ value: o + 1
2066
+ }))
2067
+ ]), U = T(() => p.config.type === D.Circular);
2068
+ return (F, o) => {
2069
+ const u = h("FmButton"), n = h("FmSwitch"), t = h("FmSelect");
2070
+ return y(), k(Fe, null, {
2071
+ header: S(() => [
2072
+ C("p", null, I(p.label), 1),
2073
+ o[22] || (o[22] = C("div", { class: "grow" }, null, -1)),
2074
+ p.closeable ? (y(), k(u, {
2075
+ key: 0,
2076
+ icon: "close",
2077
+ variant: "tertiary",
2078
+ size: "md",
2079
+ onClick: o[0] || (o[0] = te((s) => c("click-close"), ["stop"]))
2080
+ })) : x("", !0)
2081
+ ]),
2082
+ content: S(() => [
2083
+ d(al, {
2084
+ modelValue: e.value,
2085
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => e.value = s),
2086
+ label: a(g)("report.section.schema.title")
2087
+ }, null, 8, ["modelValue", "label"]),
2088
+ d(ye, {
2089
+ modelValue: e.value.dimensions,
2090
+ "onUpdate:modelValue": o[2] || (o[2] = (s) => e.value.dimensions = s),
2091
+ options: V.value,
2092
+ config: e.value,
2093
+ max: p.config.maxDimension,
2094
+ "has-row-column": !0,
2095
+ onConfig: o[3] || (o[3] = (s) => {
2096
+ e.value = s;
2097
+ })
2098
+ }, null, 8, ["modelValue", "options", "config", "max"]),
2099
+ d(n, {
2100
+ "label-placement": "right",
2101
+ label: a(g)("report.section.datasource.comparable"),
2102
+ "model-value": e.value.isComparable ?? !1,
2103
+ "onUpdate:modelValue": o[4] || (o[4] = (s) => {
2104
+ e.value.isComparable = s;
2105
+ })
2106
+ }, null, 8, ["label", "model-value"]),
2107
+ l.value ? (y(), k(n, {
2108
+ key: 0,
2109
+ "label-placement": "right",
2110
+ label: a(g)("report.section.datasource.cumulative"),
2111
+ "model-value": e.value.isCumulative ?? !1,
2112
+ "onUpdate:modelValue": o[5] || (o[5] = (s) => {
2113
+ e.value.isCumulative = s;
2114
+ })
2115
+ }, null, 8, ["label", "model-value"])) : x("", !0),
2116
+ p.config.isDrillConfigurable && f.value ? (y(), k(n, {
2117
+ key: 1,
2118
+ label: a(g)("report.section.datasource.drill"),
2119
+ "label-placement": "right",
2120
+ "model-value": e.value.isDrillable ?? !1,
2121
+ "onUpdate:modelValue": o[6] || (o[6] = (s) => {
2122
+ e.value.isDrillable = s;
2123
+ })
2124
+ }, null, 8, ["label", "model-value"])) : x("", !0),
2125
+ p.config.canRollup && f.value ? (y(), k(t, {
2126
+ key: 2,
2127
+ modelValue: e.value.rollup,
2128
+ "onUpdate:modelValue": o[7] || (o[7] = (s) => e.value.rollup = s),
2129
+ label: a(g)("report.section.datasource.subTotal"),
2130
+ items: B.value
2131
+ }, null, 8, ["modelValue", "label", "items"])) : x("", !0),
2132
+ p.config.canTranspose && f.value ? (y(), k(n, {
2133
+ key: 3,
2134
+ modelValue: e.value.isTransposed,
2135
+ "onUpdate:modelValue": o[8] || (o[8] = (s) => e.value.isTransposed = s),
2136
+ label: a(g)("report.section.datasource.transpose"),
2137
+ "label-placement": "right"
2138
+ }, null, 8, ["modelValue", "label"])) : x("", !0),
2139
+ d(El, {
2140
+ model: e.value,
2141
+ "onUpdate:model": o[9] || (o[9] = (s) => e.value = s)
2142
+ }, null, 8, ["model"]),
2143
+ p.config.hasChart ? (y(), k(Gl, {
2144
+ key: 4,
2145
+ model: e.value,
2146
+ "onUpdate:model": o[10] || (o[10] = (s) => e.value = s)
2147
+ }, null, 8, ["model"])) : x("", !0),
2148
+ p.config.hasLabel ? (y(), k(Pl, {
2149
+ key: 5,
2150
+ model: e.value,
2151
+ "onUpdate:model": o[11] || (o[11] = (s) => e.value = s)
2152
+ }, null, 8, ["model"])) : x("", !0),
2153
+ p.config.hasLegend ? (y(), k(Hl, {
2154
+ key: 6,
2155
+ model: e.value,
2156
+ "is-circular-widget": U.value,
2157
+ "onUpdate:model": o[12] || (o[12] = (s) => e.value = s)
2158
+ }, null, 8, ["model", "is-circular-widget"])) : x("", !0),
2159
+ p.config.hasXy ? (y(), k(zl, {
2160
+ key: 7,
2161
+ model: e.value,
2162
+ "onUpdate:model": o[13] || (o[13] = (s) => e.value = s)
2163
+ }, null, 8, ["model"])) : x("", !0),
2164
+ p.config.hasBreakdownDimension ? (y(), k(ye, {
2165
+ key: 8,
2166
+ "model-value": e.value.breakdownDimension ? [e.value.breakdownDimension] : [],
2167
+ label: a(g)("report.section.dimension.breakdownDimension"),
2168
+ max: 1,
2169
+ options: V.value,
2170
+ "onUpdate:modelValue": o[14] || (o[14] = (s) => {
2171
+ e.value.breakdownDimension = s[0];
2172
+ })
2173
+ }, null, 8, ["model-value", "label", "options"])) : x("", !0),
2174
+ w.value ? (y(), k(ye, {
2175
+ key: 9,
2176
+ "model-value": e.value.sparklineDimension ? [e.value.sparklineDimension] : [],
2177
+ label: a(g)("report.section.dimension.sparklineDimension"),
2178
+ max: 1,
2179
+ options: V.value,
2180
+ "onUpdate:modelValue": o[15] || (o[15] = (s) => {
2181
+ e.value.sparklineDimension = s[0];
2182
+ })
2183
+ }, null, 8, ["model-value", "label", "options"])) : x("", !0),
2184
+ d(vl, {
2185
+ modelValue: e.value.metrics,
2186
+ "onUpdate:modelValue": o[16] || (o[16] = (s) => e.value.metrics = s),
2187
+ options: V.value,
2188
+ max: p.config.maxMetric,
2189
+ config: e.value,
2190
+ "has-row-column": p.config.type === a(D).Table,
2191
+ onConfig: o[17] || (o[17] = (s) => {
2192
+ e.value = s;
2193
+ })
2194
+ }, null, 8, ["modelValue", "options", "max", "config", "has-row-column"]),
2195
+ d(Cl, {
2196
+ modelValue: e.value.filters,
2197
+ "onUpdate:modelValue": o[18] || (o[18] = (s) => e.value.filters = s),
2198
+ options: V.value
2199
+ }, null, 8, ["modelValue", "options"]),
2200
+ d(Nl, {
2201
+ modelValue: e.value.sorts,
2202
+ "onUpdate:modelValue": o[19] || (o[19] = (s) => e.value.sorts = s),
2203
+ options: V.value
2204
+ }, null, 8, ["modelValue", "options"]),
2205
+ d(Ol, {
2206
+ modelValue: e.value.limit,
2207
+ "onUpdate:modelValue": o[20] || (o[20] = (s) => e.value.limit = s)
2208
+ }, null, 8, ["modelValue"]),
2209
+ e.value.conditions ? (y(), k(Ml, {
2210
+ key: 10,
2211
+ modelValue: e.value.conditions,
2212
+ "onUpdate:modelValue": o[21] || (o[21] = (s) => e.value.conditions = s),
2213
+ "join-field-options": V.value,
2214
+ "main-field-options": N.value
2215
+ }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : x("", !0)
2216
+ ]),
2217
+ _: 1
2218
+ });
2219
+ };
2220
+ }
2221
+ }), Wl = { class: "fm-typo-en-title-sm-600" }, xe = /* @__PURE__ */ q({
2222
+ __name: "TileEditorTabHeader",
2223
+ props: /* @__PURE__ */ X({
2224
+ icon: {
2225
+ type: String,
2226
+ required: !0
2227
+ }
2228
+ }, {
2229
+ modelValue: { type: Boolean, required: !0, default: !1 },
2230
+ modelModifiers: {}
2231
+ }),
2232
+ emits: ["update:modelValue"],
2233
+ setup(m) {
2234
+ const { t: r } = Z(), e = le(m, "modelValue"), p = m;
2235
+ return (c, i) => {
2236
+ const g = h("FmIcon");
2237
+ return y(), $("div", {
2238
+ class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
2239
+ onClick: i[0] || (i[0] = (b) => e.value = !e.value)
2240
+ }, [
2241
+ C("p", Wl, I(a(r)("report.tile.setting")), 1),
2242
+ i[1] || (i[1] = C("div", { class: "grow" }, null, -1)),
2243
+ d(g, {
2244
+ name: p.icon
2245
+ }, null, 8, ["name"])
2246
+ ]);
2247
+ };
2248
+ }
2249
+ }), Xl = /* @__PURE__ */ q({
2250
+ __name: "TileEditorTabDesktop",
2251
+ props: {
2252
+ modelValue: { required: !0, default: !1 },
2253
+ modelModifiers: {}
2254
+ },
2255
+ emits: ["update:modelValue"],
2256
+ setup(m) {
2257
+ const r = le(m, "modelValue");
2258
+ return (e, p) => (y(), $(H, null, [
2259
+ d(xe, {
2260
+ modelValue: r.value,
2261
+ "onUpdate:modelValue": p[0] || (p[0] = (c) => r.value = c),
2262
+ icon: "keyboard_double_arrow_left"
2263
+ }, null, 8, ["modelValue"]),
2264
+ Ue(e.$slots, "default")
2265
+ ], 64));
2266
+ }
2267
+ }), Jl = { class: "fixed bottom-0 w-full" }, Kl = /* @__PURE__ */ q({
2268
+ __name: "TileEditorTabMobile",
2269
+ props: {
2270
+ modelValue: { required: !0, default: !1 },
2271
+ modelModifiers: {}
2272
+ },
2273
+ emits: ["update:modelValue"],
2274
+ setup(m) {
2275
+ const r = le(m, "modelValue");
2276
+ return (e, p) => {
2277
+ const c = h("FmTopSheet");
2278
+ return y(), $("div", Jl, [
2279
+ d(xe, {
2280
+ modelValue: r.value,
2281
+ "onUpdate:modelValue": p[0] || (p[0] = (i) => r.value = i),
2282
+ icon: "keyboard_double_arrow_up"
2283
+ }, null, 8, ["modelValue"]),
2284
+ d(c, {
2285
+ modelValue: r.value,
2286
+ "onUpdate:modelValue": p[2] || (p[2] = (i) => r.value = i),
2287
+ "fullscreen-size": "sm"
2288
+ }, {
2289
+ default: S(() => [
2290
+ d(xe, {
2291
+ modelValue: r.value,
2292
+ "onUpdate:modelValue": p[1] || (p[1] = (i) => r.value = i),
2293
+ icon: "keyboard_double_arrow_down"
2294
+ }, null, 8, ["modelValue"]),
2295
+ r.value ? Ue(e.$slots, "default", { key: 0 }) : x("", !0)
2296
+ ]),
2297
+ _: 3
2298
+ }, 8, ["modelValue"])
2299
+ ]);
2300
+ };
2301
+ }
2302
+ }), Ql = { class: "h-[40x]" }, Me = /* @__PURE__ */ q({
2303
+ __name: "TileEditorTab",
2304
+ props: /* @__PURE__ */ X({
2305
+ hideConfiguration: {
2306
+ type: Boolean,
2307
+ default: !1
2308
+ }
2309
+ }, {
2310
+ modelValue: {
2311
+ required: !0
2312
+ },
2313
+ modelModifiers: {}
2314
+ }),
2315
+ emits: /* @__PURE__ */ X(["hideConfiguration"], ["update:modelValue"]),
2316
+ setup(m, { emit: r }) {
2317
+ const e = le(m, "modelValue"), { breakpoints: p } = Le(), c = m, { promptMessage: i } = $e(), g = r, { t: b } = Z();
2318
+ function f(o) {
2319
+ e.value = rl(o);
2320
+ }
2321
+ function l() {
2322
+ const o = [...e.value.widget.config.joinDatasources || []];
2323
+ o.push({ ...Ye(e.value.widget.type), conditions: [] }), f({
2324
+ ...e.value,
2325
+ widget: {
2326
+ ...e.value.widget,
2327
+ config: {
2328
+ ...e.value.widget.config,
2329
+ joinDatasources: o
2330
+ }
2331
+ }
2332
+ });
2333
+ }
2334
+ async function v(o) {
2335
+ if (!await i({
2336
+ title: b("report.tile.datasource.remove"),
2337
+ message: b("report.tile.datasource.confirmRemove", { index: o + 1 })
2338
+ })) return;
2339
+ const n = [...e.value.widget.config.joinDatasources || []];
2340
+ n.splice(o, 1), f({
2341
+ ...e.value,
2342
+ widget: {
2343
+ ...e.value.widget,
2344
+ config: {
2345
+ ...e.value.widget.config,
2346
+ joinDatasources: n
2347
+ }
2348
+ }
2349
+ });
2350
+ }
2351
+ const w = (o, u) => {
2352
+ let n = 1, t = 1;
2353
+ switch (o) {
2354
+ case D.Scorecard:
2355
+ n = 1, t = 2;
2356
+ break;
2357
+ case D.BarChart:
2358
+ case D.StackBarChart:
2359
+ case D.LineChart:
2360
+ case D.StackLineChart:
2361
+ n = 4, t = 6;
2362
+ break;
2363
+ case D.Table:
2364
+ n = 4, t = 12;
2365
+ break;
2366
+ case D.Circular:
2367
+ n = 4, t = 4;
2368
+ break;
2369
+ case D.Spacer:
2370
+ n = 0, t = 12;
2371
+ break;
2372
+ }
2373
+ return {
2374
+ size: {
2375
+ height: n,
2376
+ width: t
2377
+ },
2378
+ widget: {
2379
+ ...u.widget,
2380
+ type: o
2381
+ }
2382
+ };
2383
+ }, N = T(
2384
+ () => _e.find((o) => o.type === e.value.widget.type)
2385
+ ), V = T(() => e.value.widget.config.joinDatasources), B = T(() => {
2386
+ switch (e.value.widget.type) {
2387
+ case D.Table:
2388
+ case D.BarChart:
2389
+ case D.LineChart:
2390
+ case D.StackBarChart:
2391
+ case D.StackLineChart:
2392
+ case D.Circular:
2393
+ return 4;
2394
+ case D.Scorecard:
2395
+ return 2;
2396
+ default:
2397
+ return 1;
2398
+ }
2399
+ }), U = T(() => {
2400
+ switch (e.value.widget.type) {
2401
+ case D.Table:
2402
+ case D.BarChart:
2403
+ case D.LineChart:
2404
+ case D.StackBarChart:
2405
+ case D.StackLineChart:
2406
+ case D.Circular:
2407
+ return 4;
2408
+ default:
2409
+ return 1;
2410
+ }
2411
+ }), F = Oe((o) => {
2412
+ e.value.widget.title = o;
2413
+ }, 500);
2414
+ return (o, u) => {
2415
+ const n = h("FmCircularProgress"), t = h("FmTextField"), s = h("FmTextarea"), O = h("FmStepperField"), P = h("FmButton"), J = h("FmForm");
2416
+ return y(), k(Ne(a(p).lg || a(p).md ? Xl : Kl), {
2417
+ "model-value": c.hideConfiguration,
2418
+ "onUpdate:modelValue": u[6] || (u[6] = (R) => g("hideConfiguration", R))
2419
+ }, {
2420
+ default: S(() => [
2421
+ e.value ? (y(), k(J, {
2422
+ key: 1,
2423
+ ref: "form",
2424
+ class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2425
+ }, {
2426
+ default: S(() => [
2427
+ d(Fe, null, {
2428
+ header: S(() => [
2429
+ C("p", null, I(a(b)("report.tile.widget.details")), 1),
2430
+ u[7] || (u[7] = C("div", { class: "grow" }, null, -1))
2431
+ ]),
2432
+ content: S(() => [
2433
+ d(t, {
2434
+ "model-value": e.value.widget.title,
2435
+ label: a(b)("report.tile.widget.title"),
2436
+ placeholder: a(b)("report.tile.widget.titlePlaceholder"),
2437
+ "onUpdate:modelValue": a(F)
2438
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2439
+ d(s, {
2440
+ modelValue: e.value.widget.description,
2441
+ "onUpdate:modelValue": u[0] || (u[0] = (R) => e.value.widget.description = R),
2442
+ disabled: e.value.widget.title === "",
2443
+ label: a(b)("report.tile.widget.description"),
2444
+ placeholder: a(b)("report.tile.widget.descriptionPlaceholder"),
2445
+ "helper-text": a(b)("report.tile.widget.descriptionHelper")
2446
+ }, null, 8, ["modelValue", "disabled", "label", "placeholder", "helper-text"]),
2447
+ C("div", {
2448
+ class: De(["flex flex-row", `${a(p).sm || a(p).xs ? "gap-16" : "gap-2"}`])
2449
+ }, [
2450
+ d(O, {
2451
+ modelValue: e.value.size.width,
2452
+ "onUpdate:modelValue": u[1] || (u[1] = (R) => e.value.size.width = R),
2453
+ label: a(b)("report.tile.widget.width"),
2454
+ min: B.value,
2455
+ max: 12
2456
+ }, null, 8, ["modelValue", "label", "min"]),
2457
+ d(O, {
2458
+ modelValue: e.value.size.height,
2459
+ "onUpdate:modelValue": u[2] || (u[2] = (R) => e.value.size.height = R),
2460
+ label: a(b)("report.tile.widget.height"),
2461
+ min: U.value,
2462
+ max: 12,
2463
+ disabled: e.value.widget.type === a(D).Scorecard
2464
+ }, null, 8, ["modelValue", "label", "min", "disabled"])
2465
+ ], 2)
2466
+ ]),
2467
+ _: 1
2468
+ }),
2469
+ d(Fe, null, {
2470
+ header: S(() => [
2471
+ C("p", null, I(a(b)("report.tile.widget.type")), 1),
2472
+ u[8] || (u[8] = C("div", { class: "grow" }, null, -1))
2473
+ ]),
2474
+ content: S(() => [
2475
+ d(He, {
2476
+ "is-list": !0,
2477
+ "model-value": e.value.widget.type,
2478
+ class: "grid grid-cols-1 gap-2",
2479
+ "child-class": "flex flex-row p-[8px] gap-2",
2480
+ "exclude-widge-type": [a(D).Spacer],
2481
+ "onUpdate:modelValue": u[3] || (u[3] = (R) => e.value = w(R, e.value))
2482
+ }, null, 8, ["model-value", "exclude-widge-type"])
2483
+ ]),
2484
+ _: 1
2485
+ }),
2486
+ d(Se, {
2487
+ modelValue: e.value.widget.config,
2488
+ "onUpdate:modelValue": u[4] || (u[4] = (R) => e.value.widget.config = R),
2489
+ label: a(b)("report.tile.datasource.main"),
2490
+ config: N.value
2491
+ }, null, 8, ["modelValue", "label", "config"]),
2492
+ V.value ? (y(!0), $(H, { key: 0 }, de(V.value, (R, A) => (y(), $("div", { key: A }, [
2493
+ d(Se, {
2494
+ modelValue: V.value[A],
2495
+ "onUpdate:modelValue": (z) => V.value[A] = z,
2496
+ label: a(b)("report.tile.datasource.join", { index: A + 1 }),
2497
+ config: N.value,
2498
+ "main-datasource-config": e.value.widget.config,
2499
+ closeable: !0,
2500
+ onClickClose: (z) => v(A)
2501
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2502
+ ]))), 128)) : x("", !0),
2503
+ C("div", Ql, [
2504
+ d(P, {
2505
+ label: a(b)("report.tile.datasource.joinButton"),
2506
+ variant: "secondary",
2507
+ icon: "add",
2508
+ "icon-position": "prepend",
2509
+ "border-color": a(ve).ColorPrimary,
2510
+ "text-color": a(ve).ColorPrimary,
2511
+ class: "w-full",
2512
+ onClick: u[5] || (u[5] = (R) => l())
2513
+ }, null, 8, ["label", "border-color", "text-color"])
2514
+ ])
2515
+ ]),
2516
+ _: 1
2517
+ }, 512)) : (y(), k(n, { key: 0 }))
2518
+ ]),
2519
+ _: 1
2520
+ }, 8, ["model-value"]);
2521
+ };
2522
+ }
2523
+ }), Zl = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[400px]" }, eo = { class: "flex bg-fm-color-neutral-white w-[88px]" }, lo = { class: "w-full overflow-y-auto" }, oo = {
2524
+ class: "grid grid-cols-12 w-full p-24",
2525
+ style: { backgroundColor: "#F6F8FC" }
2526
+ }, ao = /* @__PURE__ */ q({
2527
+ __name: "TileEditorDesktop",
2528
+ props: /* @__PURE__ */ X({
2529
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
2530
+ index: { type: Number, required: !0, default: 0 }
2531
+ }, {
2532
+ modelValue: {
2533
+ required: !0
2534
+ },
2535
+ modelModifiers: {}
2536
+ }),
2537
+ emits: /* @__PURE__ */ X(["hideConfiguration"], ["update:modelValue"]),
2538
+ setup(m, { emit: r }) {
2539
+ const e = le(m, "modelValue"), p = m, c = T(
2540
+ () => _e.find((g) => {
2541
+ var b;
2542
+ return g.type === ((b = e.value) == null ? void 0 : b.widget.type);
2543
+ })
2544
+ ), i = r;
2545
+ return (g, b) => {
2546
+ const f = h("FmCircularProgress"), l = h("FmButton");
2547
+ return y(), $("div", null, [
2548
+ e.value ? (y(), $(H, { key: 1 }, [
2549
+ d(Ge, {
2550
+ "model-value": !m.hideConfiguration
2551
+ }, {
2552
+ right: S(() => [
2553
+ C("div", Zl, [
2554
+ d(Me, {
2555
+ modelValue: e.value,
2556
+ "onUpdate:modelValue": b[0] || (b[0] = (v) => e.value = v),
2557
+ config: c.value,
2558
+ "hide-configuration": m.hideConfiguration,
2559
+ onHideConfiguration: b[1] || (b[1] = (v) => {
2560
+ i("hideConfiguration", v);
2561
+ })
2562
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
2563
+ ])
2564
+ ]),
2565
+ left: S(() => [
2566
+ C("div", eo, [
2567
+ d(l, {
2568
+ variant: "secondary",
2569
+ icon: "keyboard_double_arrow_right",
2570
+ "border-color": a(ve).ColorPrimary,
2571
+ "text-color": a(ve).ColorPrimary,
2572
+ class: "m-24 my-16",
2573
+ size: "md",
2574
+ onClick: b[2] || (b[2] = (v) => i("hideConfiguration", !p.hideConfiguration))
2575
+ }, null, 8, ["border-color", "text-color"])
2576
+ ])
2577
+ ]),
2578
+ _: 1
2579
+ }, 8, ["model-value"]),
2580
+ C("div", lo, [
2581
+ C("div", oo, [
2582
+ e.value ? (y(), k(Be, {
2583
+ key: 0,
2584
+ "model-value": e.value,
2585
+ index: p.index,
2586
+ "hide-export": !0
2587
+ }, null, 8, ["model-value", "index"])) : (y(), k(Re, { key: 1 }))
2588
+ ])
2589
+ ])
2590
+ ], 64)) : (y(), k(f, { key: 0 }))
2591
+ ]);
2592
+ };
2593
+ }
2594
+ }), to = {
2595
+ key: 0,
2596
+ class: "flex w-full justify-center items-center"
2597
+ }, no = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, uo = /* @__PURE__ */ q({
2598
+ __name: "TileEditorMobile",
2599
+ props: /* @__PURE__ */ X({
2600
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
2601
+ index: { type: Number, required: !0, default: 0 }
2602
+ }, {
2603
+ modelValue: {
2604
+ required: !0
2605
+ },
2606
+ modelModifiers: {}
2607
+ }),
2608
+ emits: /* @__PURE__ */ X(["hideConfiguration"], ["update:modelValue"]),
2609
+ setup(m, { emit: r }) {
2610
+ const e = le(m, "modelValue"), p = m, c = T(
2611
+ () => _e.find((g) => {
2612
+ var b;
2613
+ return g.type === ((b = e.value) == null ? void 0 : b.widget.type);
2614
+ })
2615
+ ), i = r;
2616
+ return (g, b) => {
2617
+ const f = h("FmCircularProgress");
2618
+ return y(), $("div", null, [
2619
+ e.value ? (y(), $(H, { key: 1 }, [
2620
+ C("div", no, [
2621
+ e.value ? (y(), k(Be, {
2622
+ key: 0,
2623
+ "model-value": e.value,
2624
+ index: p.index,
2625
+ "hide-export": !0
2626
+ }, null, 8, ["model-value", "index"])) : (y(), k(Re, { key: 1 }))
2627
+ ]),
2628
+ d(Me, {
2629
+ modelValue: e.value,
2630
+ "onUpdate:modelValue": b[0] || (b[0] = (l) => e.value = l),
2631
+ config: c.value,
2632
+ "hide-configuration": m.hideConfiguration,
2633
+ onHideConfiguration: b[1] || (b[1] = (l) => {
2634
+ i("hideConfiguration", l);
2635
+ })
2636
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
2637
+ ], 64)) : (y(), $("div", to, [
2638
+ d(f)
2639
+ ]))
2640
+ ]);
2641
+ };
2642
+ }
2643
+ }), io = {
2644
+ key: 0,
2645
+ class: "fm-typo-en-title-md-600"
2646
+ }, ko = /* @__PURE__ */ q({
2647
+ __name: "TileEditor",
2648
+ setup(m) {
2649
+ const r = Pe(), e = ze(), p = Xe(), { currentSelectWidgetType: c, editingReport: i, editingTile: g, editingIndex: b } = ke(p), { breakpoints: f } = Le(), { promptMessage: l } = $e(), { t: v } = Z(), w = E(!1);
2650
+ async function N() {
2651
+ var U;
2652
+ if (!i.value) return;
2653
+ await l({
2654
+ title: v("report.tile.save.title"),
2655
+ message: v("report.tile.save.confirm", { title: (U = g.value) == null ? void 0 : U.widget.title })
2656
+ }) && (g.value && (i.value.tiles[b.value] = g.value), c.value = void 0, e.back());
2657
+ }
2658
+ async function V() {
2659
+ var U;
2660
+ if (!i.value) return;
2661
+ await l({
2662
+ title: v("report.tile.cancel.title"),
2663
+ message: v("report.tile.cancel.confirm", { title: (U = g.value) == null ? void 0 : U.widget.title })
2664
+ }) && (c.value = void 0, e.back());
2665
+ }
2666
+ return je(() => {
2667
+ i.value || e.push({ name: "reports" });
2668
+ }), (B, U) => {
2669
+ const F = h("FmPageHead");
2670
+ return y(), k(We, null, {
2671
+ default: S(() => [
2672
+ d(F, {
2673
+ actions: [
2674
+ { label: "Cancel", value: "cancel", isPrimary: !1 },
2675
+ { label: "Save", value: "save", isPrimary: !0 }
2676
+ ],
2677
+ "onClick:action": U[0] || (U[0] = (o) => {
2678
+ o === "cancel" && V(), o === "save" && N();
2679
+ })
2680
+ }, {
2681
+ title: S(() => {
2682
+ var o;
2683
+ return [
2684
+ a(f).lg || a(f).md ? (y(), $("p", io, I(a(Ce)(((o = a(g)) == null ? void 0 : o.widget.type) ?? "New report")), 1)) : x("", !0)
2685
+ ];
2686
+ }),
2687
+ _: 1
2688
+ }),
2689
+ a(g) ? (y(), k(Ne(a(f).lg || a(f).md ? ao : uo), {
2690
+ key: 0,
2691
+ modelValue: a(g),
2692
+ "onUpdate:modelValue": U[1] || (U[1] = (o) => Ee(g) ? g.value = o : null),
2693
+ class: De(`${a(f).lg || a(f).md ? "flex" : ""} w-full`),
2694
+ style: Ae({ height: `calc( 100% - ${a(f).lg || a(f).md ? 72 : 64}px)` }),
2695
+ "hide-configuration": w.value,
2696
+ index: Number(a(r).params.tileIndex),
2697
+ onHideConfiguration: U[2] || (U[2] = (o) => w.value = o)
2698
+ }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : x("", !0)
2699
+ ]),
2700
+ _: 1
2701
+ });
2702
+ };
2703
+ }
2704
+ });
2705
+ export {
2706
+ ko as default
2707
+ };