@feedmepos/mf-report 5.27.33-beta.0 → 5.27.34-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 (25) hide show
  1. package/dist/{App-ClpSN6vJ.js → App-B4SgEjY2.js} +4 -4
  2. package/dist/{DateRangeSelect-Cmwmnb3f.js → DateRangeSelect-CzqX3gq7.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-Cyou6lL3.js → Default.vue_vue_type_script_setup_true_lang-BbK00CiA.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D3wfv5xt.js → DynamicWidget.vue_vue_type_script_setup_true_lang-CNaqWdP8.js} +2095 -2038
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang--cnvy8L7.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-D_ZSYm2r.js} +2 -2
  6. package/dist/{InsightView-D3uOWYgy.js → InsightView-DyV6KLai.js} +4 -4
  7. package/dist/{Integration-D06dvAa-.js → Integration-k972W1PU.js} +3 -3
  8. package/dist/{Integrations-CvrjQEwx.js → Integrations-rJ13kpk7.js} +2 -2
  9. package/dist/{Layout-BdemGwVq.js → Layout-BZNx-VHX.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DW8zEosG.js → MenuTab.vue_vue_type_script_setup_true_lang-CRdDmrGr.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-hF863NSx.js → NavigationTab.vue_vue_type_script_setup_true_lang-CS8my4zn.js} +3 -3
  12. package/dist/{OverviewView-CzN_eJfd.js → OverviewView-DxnJ2mhF.js} +4 -4
  13. package/dist/{Report-bFyYuwYR.js → Report-BmjXU-dl.js} +3 -3
  14. package/dist/{ReportEditor-BktvEI0n.js → ReportEditor-CgAfssnD.js} +6 -6
  15. package/dist/{ReportView-7hYNvjZi.js → ReportView-BZ58dRTm.js} +6 -6
  16. package/dist/{Setting-DuDtUFz6.js → Setting-C49a6Jax.js} +3 -3
  17. package/dist/{Template-Cc5hIhG4.js → Template-t_CzOl4l.js} +3 -3
  18. package/dist/TileEditor-CO3fueTi.js +4093 -0
  19. package/dist/{TileGrid.vue_vue_type_script_setup_true_lang-CfZGPU0x.js → TileGrid.vue_vue_type_script_setup_true_lang-jhP127e8.js} +1 -1
  20. package/dist/{TransitionFade-DwM7bX1H.js → TransitionFade-BG79C4mO.js} +4 -4
  21. package/dist/{app-CXGhDDy1.js → app-BoAhXbj8.js} +44 -16
  22. package/dist/app.js +1 -1
  23. package/dist/{useRestaurantPermission-CF-bS5QN.js → useRestaurantPermission-UfQ31mRY.js} +1 -1
  24. package/package.json +1 -1
  25. package/dist/TileEditor-DDwa5Z0-.js +0 -4079
@@ -0,0 +1,4093 @@
1
+ import { defineComponent as de, mergeModels as ve, useModel as ge, computed as V, ref as te, resolveComponent as M, createElementBlock as P, openBlock as f, createVNode as p, createElementVNode as b, unref as l, withCtx as K, toDisplayString as q, Fragment as ue, renderList as Se, withModifiers as we, createTextVNode as Ie, watch as Ce, createCommentVNode as z, createBlock as R, renderSlot as wl, onBeforeUnmount as il, resolveDynamicComponent as Cl, normalizeClass as Fe, withDirectives as ke, vShow as $e, onMounted as xl, withKeys as cl, vModelText as zl, normalizeStyle as ol, isRef as Il } from "vue";
2
+ import { useRoute as Pl, useRouter as El } from "vue-router";
3
+ import { u as sl, f as rl, h as ze, F as je, d as Ke, S as al, a as Wl, W as Xl, T as Hl, c as ql, b as pl } from "./TransitionFade-BG79C4mO.js";
4
+ import { W as H, a as kl, q as Pe, D as Gl, S as vl, C as Yl, u as Fl, P as fl, b as Jl, c as Kl, i as Ql } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-D_ZSYm2r.js";
5
+ import { storeToRefs as Ne } from "pinia";
6
+ import { u as Vl } from "./message-dialog-UoMWOnil.js";
7
+ import { useSnackbar as Zl, useBreakpoints as Sl, FmButtonColorThemeVariant as Ue } from "@feedmepos/ui-library";
8
+ import { h as et, g as Ve, R as gl, d as lt, L as Ae, e as el, S as ie, f as fe, j as ll, k as yl, _ as _l } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-CNaqWdP8.js";
9
+ import { a as be, _ as Tl } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGbb3b5G.js";
10
+ import { u as pe, _ as $l } from "./_plugin-vue_export-helper-onplcgja.js";
11
+ import { r as re } from "./i18n-CI_sQ5d_.js";
12
+ import { a as Oe, d as qe } from "./DateRangeSelect-CzqX3gq7.js";
13
+ import { a as tt, d as He } from "./app-BoAhXbj8.js";
14
+ const Qe = [
15
+ {
16
+ type: H.Circular,
17
+ maxDimension: null,
18
+ maxMetric: 1,
19
+ hasBreakdownDimension: !1,
20
+ canTranspose: !1,
21
+ isDrillConfigurable: !1,
22
+ hasChart: !0,
23
+ hasTable: !1,
24
+ hasLabel: !0,
25
+ hasLegend: !0,
26
+ hasXy: !1,
27
+ canRollup: !1,
28
+ showRollupPosition: !1,
29
+ canSearch: !1,
30
+ periodType: null
31
+ },
32
+ {
33
+ type: H.Table,
34
+ maxDimension: null,
35
+ maxMetric: null,
36
+ hasBreakdownDimension: !1,
37
+ canTranspose: !1,
38
+ isDrillConfigurable: !0,
39
+ hasChart: !1,
40
+ hasTable: !0,
41
+ hasLabel: !1,
42
+ hasLegend: !1,
43
+ hasXy: !1,
44
+ canRollup: !0,
45
+ showRollupPosition: !0,
46
+ canSearch: !0,
47
+ periodType: null
48
+ },
49
+ {
50
+ type: H.BarChart,
51
+ maxDimension: null,
52
+ maxMetric: 1,
53
+ hasBreakdownDimension: !0,
54
+ canTranspose: !0,
55
+ isDrillConfigurable: !1,
56
+ hasChart: !0,
57
+ hasTable: !1,
58
+ hasLabel: !0,
59
+ hasLegend: !0,
60
+ hasXy: !0,
61
+ canRollup: !1,
62
+ showRollupPosition: !1,
63
+ canSearch: !1,
64
+ periodType: null
65
+ },
66
+ {
67
+ type: H.LineChart,
68
+ maxDimension: null,
69
+ maxMetric: 1,
70
+ hasBreakdownDimension: !0,
71
+ canTranspose: !0,
72
+ isDrillConfigurable: !1,
73
+ hasChart: !0,
74
+ hasTable: !1,
75
+ hasLabel: !0,
76
+ hasLegend: !0,
77
+ hasXy: !0,
78
+ canRollup: !1,
79
+ showRollupPosition: !1,
80
+ canSearch: !1,
81
+ periodType: null
82
+ },
83
+ {
84
+ type: H.StackBarChart,
85
+ maxDimension: null,
86
+ maxMetric: 1,
87
+ hasBreakdownDimension: !0,
88
+ canTranspose: !0,
89
+ isDrillConfigurable: !1,
90
+ hasChart: !0,
91
+ hasTable: !1,
92
+ hasLabel: !0,
93
+ hasLegend: !0,
94
+ hasXy: !0,
95
+ canRollup: !1,
96
+ showRollupPosition: !1,
97
+ canSearch: !1,
98
+ periodType: null
99
+ },
100
+ {
101
+ type: H.ClusteredStackBarChart,
102
+ maxDimension: null,
103
+ maxMetric: 1,
104
+ hasBreakdownDimension: !0,
105
+ canTranspose: !0,
106
+ isDrillConfigurable: !1,
107
+ hasChart: !0,
108
+ hasTable: !1,
109
+ hasLabel: !0,
110
+ hasLegend: !0,
111
+ hasXy: !0,
112
+ canRollup: !1,
113
+ showRollupPosition: !1,
114
+ canSearch: !1,
115
+ periodType: null
116
+ },
117
+ {
118
+ type: H.StackLineChart,
119
+ maxDimension: null,
120
+ maxMetric: 1,
121
+ hasBreakdownDimension: !0,
122
+ canTranspose: !0,
123
+ isDrillConfigurable: !1,
124
+ hasChart: !0,
125
+ hasTable: !1,
126
+ hasLabel: !0,
127
+ hasLegend: !0,
128
+ hasXy: !0,
129
+ canRollup: !1,
130
+ showRollupPosition: !1,
131
+ canSearch: !1,
132
+ periodType: null
133
+ },
134
+ {
135
+ type: H.Scorecard,
136
+ maxDimension: null,
137
+ maxMetric: 1,
138
+ hasBreakdownDimension: !1,
139
+ canTranspose: !1,
140
+ isDrillConfigurable: !1,
141
+ hasChart: !1,
142
+ hasTable: !1,
143
+ hasLabel: !1,
144
+ hasLegend: !1,
145
+ hasXy: !1,
146
+ canRollup: !1,
147
+ showRollupPosition: !1,
148
+ canSearch: !1,
149
+ periodType: null
150
+ },
151
+ {
152
+ type: H.Spacer,
153
+ maxDimension: 0,
154
+ maxMetric: 0,
155
+ hasBreakdownDimension: !1,
156
+ canTranspose: !1,
157
+ isDrillConfigurable: !1,
158
+ hasChart: !1,
159
+ hasTable: !1,
160
+ hasLabel: !1,
161
+ hasLegend: !1,
162
+ hasXy: !1,
163
+ canRollup: !1,
164
+ showRollupPosition: !1,
165
+ canSearch: !1,
166
+ periodType: null
167
+ }
168
+ ], ot = { class: "flex flex-col my-2 gap-8" }, at = { class: "fm-typo-en-body-lg-600" }, nt = { class: "text-sm text-fm-color-neutral-gray-400" }, it = ["onClick"], st = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, rt = /* @__PURE__ */ de({
169
+ __name: "SchemaSection",
170
+ props: /* @__PURE__ */ ve({
171
+ options: {
172
+ type: Array,
173
+ default: () => []
174
+ },
175
+ label: {
176
+ type: String,
177
+ default: "Schema"
178
+ }
179
+ }, {
180
+ modelValue: { required: !0 },
181
+ modelModifiers: {}
182
+ }),
183
+ emits: ["update:modelValue"],
184
+ setup(U) {
185
+ const { t: v, te: e } = pe(), n = ge(U, "modelValue"), o = U, { schemas: S } = Ne(kl()), C = V(
186
+ () => S.value.map((c) => ({
187
+ label: c.label,
188
+ value: c.name,
189
+ raw: c
190
+ }))
191
+ ), g = V(() => {
192
+ if (n.value.schemaNames.length === 0 || i.value === 0)
193
+ return C.value.filter((c) => !c.raw.isJoinOnly);
194
+ {
195
+ const c = n.value.schemaNames[0], u = S.value.find((L) => L.name === c), A = ((u == null ? void 0 : u.joins) || []).map((L) => L);
196
+ return C.value.filter((L) => A.includes(L.raw.name));
197
+ }
198
+ }), $ = te(!1), O = te(""), i = te(), s = Zl();
199
+ function y(c) {
200
+ var u;
201
+ return re(
202
+ v,
203
+ e,
204
+ (u = S.value.find((A) => A.name === c)) == null ? void 0 : u.label,
205
+ "schema"
206
+ );
207
+ }
208
+ function F(c) {
209
+ i.value = c, $.value = !0, c !== void 0 ? O.value = n.value.schemaNames[c] : O.value = "";
210
+ }
211
+ function B() {
212
+ O.value !== "" ? (i.value !== void 0 ? n.value.schemaNames[i.value] = O.value : n.value.schemaNames.push(O.value), $.value = !1) : s.open({ message: v("report.section.schema.nothingSelected"), type: "error" });
213
+ }
214
+ return (c, u) => {
215
+ const A = M("FmForm"), L = M("FmIcon"), h = M("FmField");
216
+ return f(), P("div", ot, [
217
+ p(Pe, {
218
+ modelValue: $.value,
219
+ "onUpdate:modelValue": u[1] || (u[1] = (r) => $.value = r),
220
+ title: o.label,
221
+ "primary-button-label": l(v)("report.common.confirm"),
222
+ "secondary-button-label": l(v)("report.common.cancel"),
223
+ onConfirm: B
224
+ }, {
225
+ content: K(() => [
226
+ p(A, { ref: "form" }, {
227
+ default: K(() => [
228
+ p(be, {
229
+ modelValue: O.value,
230
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => O.value = r),
231
+ label: l(v)("report.section.schema.title"),
232
+ items: i.value === 0 ? C.value.map((r) => ({
233
+ label: l(re)(l(v), l(e), r.label, "schema"),
234
+ value: r.value
235
+ })) : g.value.map((r) => ({
236
+ label: l(re)(l(v), l(e), r.label, "schema"),
237
+ value: r.value
238
+ }))
239
+ }, null, 8, ["modelValue", "label", "items"])
240
+ ]),
241
+ _: 1
242
+ }, 512)
243
+ ]),
244
+ _: 1
245
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
246
+ b("div", null, [
247
+ b("p", at, q(l(v)("report.section.schema.title")), 1),
248
+ b("p", nt, q(l(v)("report.section.schema.description")), 1)
249
+ ]),
250
+ (f(!0), P(ue, null, Se(n.value.schemaNames, (r, j) => (f(), P("div", {
251
+ key: j,
252
+ class: "flex flex-col gap-2 w-full"
253
+ }, [
254
+ b("div", {
255
+ class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
256
+ onClick: (Y) => F(j)
257
+ }, [
258
+ b("p", st, q(y(r)), 1),
259
+ u[3] || (u[3] = b("div", { class: "grow" }, null, -1)),
260
+ p(L, {
261
+ name: "close",
262
+ onClick: we(
263
+ () => {
264
+ n.value.schemaNames = l(et)(n.value.schemaNames, j);
265
+ },
266
+ ["stop"]
267
+ )
268
+ }, null, 8, ["onClick"])
269
+ ], 8, it)
270
+ ]))), 128)),
271
+ p(h, {
272
+ class: "text-fm-color-typo-tertiary",
273
+ onClick: u[2] || (u[2] = () => {
274
+ F();
275
+ })
276
+ }, {
277
+ default: K(() => [
278
+ Ie(q(l(v)("report.section.schema.add")), 1)
279
+ ]),
280
+ _: 1
281
+ })
282
+ ]);
283
+ };
284
+ }
285
+ }), ut = {
286
+ key: 0,
287
+ class: "flex flex-col my-2 gap-8"
288
+ }, dt = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, mt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, ct = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, tl = /* @__PURE__ */ de({
289
+ __name: "DimensionSection",
290
+ props: /* @__PURE__ */ ve({
291
+ options: {
292
+ type: Array,
293
+ default: () => []
294
+ },
295
+ label: {
296
+ type: String,
297
+ default: "title"
298
+ },
299
+ max: {
300
+ type: Number,
301
+ default: void 0
302
+ },
303
+ config: {
304
+ type: Object,
305
+ default: () => {
306
+ }
307
+ },
308
+ hasRowColumn: {
309
+ type: Boolean,
310
+ default: !1
311
+ }
312
+ }, {
313
+ modelValue: {
314
+ required: !1,
315
+ default: []
316
+ },
317
+ modelModifiers: {}
318
+ }),
319
+ emits: ["update:modelValue"],
320
+ setup(U) {
321
+ const { t: v, te: e } = pe(), n = ge(U, "modelValue"), o = U, S = V(() => v(`report.section.dimension.${o.label}`)), C = te(!1), g = V(
322
+ () => n.value.map((t, a) => ({
323
+ index: a,
324
+ labels: [t.label || t.name],
325
+ value: t
326
+ }))
327
+ ), $ = te(n.value.length > 0 ? 0 : void 0);
328
+ function O(t) {
329
+ var a, N, ae, se;
330
+ C.value = !0, i.value = t != null && t.value ? JSON.parse(
331
+ JSON.stringify({
332
+ ...t.value,
333
+ label: re(v, e, (a = t.value) == null ? void 0 : a.label, "other"),
334
+ moveToColumn: (((N = o.config) == null ? void 0 : N.columnIds) || []).includes(Ve(t.value))
335
+ })
336
+ ) : void 0, $.value = t == null ? void 0 : t.index, s.value = !!((ae = i.value) != null && ae.dataFormula || (se = i.value) != null && se.displayFormula), i.value && i.value.formatter === void 0 && t != null && t.value.timeFormatter && i.value.formatter === void 0 && (i.value.formatter = t == null ? void 0 : t.value.timeFormatter, i.value.timeFormatter = void 0);
337
+ }
338
+ const i = te(void 0), s = te(!1), y = V(
339
+ () => o.options.find(
340
+ (t) => {
341
+ var a, N;
342
+ return t.schemaName === ((a = i.value) == null ? void 0 : a.schemaName) && t.name === ((N = i.value) == null ? void 0 : N.name);
343
+ }
344
+ ) ?? {}
345
+ );
346
+ Ce(
347
+ () => {
348
+ var t;
349
+ return (t = i.value) == null ? void 0 : t.option;
350
+ },
351
+ () => {
352
+ !F.value && i.value && (i.value.fillGap = !1);
353
+ }
354
+ );
355
+ const F = V(
356
+ () => {
357
+ var t, a, N;
358
+ return (N = (t = y.value) == null ? void 0 : t.fillGapDimensionOptions) == null ? void 0 : N.includes(((a = i.value) == null ? void 0 : a.option) || "");
359
+ }
360
+ );
361
+ function B(t) {
362
+ var a, N;
363
+ (t.schemaName !== ((a = i.value) == null ? void 0 : a.schemaName) || t.name !== ((N = i.value) == null ? void 0 : N.name)) && (i.value = {
364
+ schemaName: t.schemaName,
365
+ name: t.name,
366
+ option: t.dimensionOptions[0],
367
+ label: re(v, e, t.label, "other"),
368
+ decimal: t.isNumericType ? 2 : void 0,
369
+ hide: !1
370
+ }, s.value = !1);
371
+ }
372
+ function c() {
373
+ if (!i.value) {
374
+ console.error("new field is undefined");
375
+ return;
376
+ }
377
+ const t = [...g.value.map((a) => a.value)];
378
+ s.value || (i.value.dataFormula = void 0, i.value.displayFormula = void 0), $.value !== void 0 ? t[$.value] = i.value : t.push(i.value), n.value = t, C.value = !1;
379
+ }
380
+ function u(t) {
381
+ const N = [...g.value.map((ae) => ae.value)].filter((ae, se) => se !== t);
382
+ n.value = N;
383
+ }
384
+ function A(t) {
385
+ i.value && (i.value.decimal = Number(t));
386
+ }
387
+ function L(t) {
388
+ const a = `report.section.filter.${Oe(t)}`;
389
+ return e(a) ? v(a) : re(v, e, t, "field");
390
+ }
391
+ function h(t) {
392
+ const a = `report.section.metric.formatterType.${t}`;
393
+ return e(a) ? v(a) : t;
394
+ }
395
+ function r(t) {
396
+ return Array.isArray(t) ? t.length > 0 : t;
397
+ }
398
+ const j = V(
399
+ () => o.options.map((t) => ({
400
+ label: t.labels.join(" "),
401
+ value: t
402
+ }))
403
+ );
404
+ function Y(t) {
405
+ return [t.schemaName, t.name, re(v, e, t.label, "other")].join(" ");
406
+ }
407
+ function w(t) {
408
+ return [t.schemaName, t.name, t.option, t.label || ""].join("__");
409
+ }
410
+ const m = V(() => {
411
+ var ae, se;
412
+ const t = /* @__PURE__ */ new Map(), a = i.value ? w(i.value) : "";
413
+ for (const me of ((ae = o.config) == null ? void 0 : ae.dimensions) ?? [])
414
+ a && w(me) === a || t.set(Ve(me), me);
415
+ const N = (se = o.config) == null ? void 0 : se.breakdownDimension;
416
+ return N && (!a || w(N) !== a) && t.set(Ve(N), N), i.value && t.set(Ve(i.value), i.value), Array.from(t.values());
417
+ }), { formulaFieldDataList: _, allowedFormulaFields: x } = sl({
418
+ options: V(() => o.options),
419
+ primaryFields: m,
420
+ secondaryFields: V(() => {
421
+ var t;
422
+ return ((t = o.config) == null ? void 0 : t.metrics) ?? [];
423
+ }),
424
+ getLabel: Y
425
+ }), { dataValidation: le, displayValidation: J, isDataValidating: G, isDisplayValidating: d } = rl({
426
+ getDataFormula: () => {
427
+ var t;
428
+ return (t = i.value) == null ? void 0 : t.dataFormula;
429
+ },
430
+ getDisplayFormula: () => {
431
+ var t;
432
+ return (t = i.value) == null ? void 0 : t.displayFormula;
433
+ },
434
+ getIsAdvance: () => s.value,
435
+ getAllowedFields: () => x.value
436
+ });
437
+ return (t, a) => {
438
+ const N = M("FmTextField"), ae = M("FmStepperField"), se = M("FmCheckbox"), me = M("FmForm"), Q = M("FmIcon"), Re = M("FmButton"), _e = M("FmListItem"), Be = M("FmList"), xe = M("FmField");
439
+ return U.max !== 0 ? (f(), P("div", ut, [
440
+ p(Pe, {
441
+ modelValue: C.value,
442
+ "onUpdate:modelValue": a[12] || (a[12] = (ye) => C.value = ye),
443
+ title: S.value,
444
+ "primary-button-label": l(v)("report.common.confirm"),
445
+ "secondary-button-label": l(v)("report.common.cancel"),
446
+ onConfirm: c
447
+ }, {
448
+ content: K(() => [
449
+ p(me, {
450
+ ref: "form",
451
+ class: "flex flex-col gap-2 w-[490px]"
452
+ }, {
453
+ default: K(() => {
454
+ var ye, he, Te, Z, Ee, We, Xe;
455
+ return [
456
+ p(be, {
457
+ "model-value": y.value,
458
+ items: j.value,
459
+ placeholder: S.value,
460
+ label: S.value,
461
+ "onUpdate:modelValue": a[0] || (a[0] = (ne) => B(ne))
462
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
463
+ i.value ? (f(), P(ue, { key: 0 }, [
464
+ p(N, {
465
+ modelValue: i.value.label,
466
+ "onUpdate:modelValue": a[1] || (a[1] = (ne) => i.value.label = ne),
467
+ label: l(v)("report.section.dimension.label")
468
+ }, null, 8, ["modelValue", "label"]),
469
+ (((ye = y.value) == null ? void 0 : ye.dimensionOptions) || []).length > 0 ? (f(), R(be, {
470
+ key: 0,
471
+ modelValue: i.value.option,
472
+ "onUpdate:modelValue": a[2] || (a[2] = (ne) => i.value.option = ne),
473
+ items: ((he = y.value) == null ? void 0 : he.dimensionOptions.map((ne) => ({
474
+ label: L(ne),
475
+ value: ne
476
+ }))) ?? []
477
+ }, null, 8, ["modelValue", "items"])) : z("", !0),
478
+ (Te = y.value) != null && Te.isNumericType ? (f(), R(ae, {
479
+ key: 1,
480
+ label: l(v)("report.common.decimal"),
481
+ "model-value": ((Z = i.value) == null ? void 0 : Z.decimal) ?? 2,
482
+ "onUpdate:modelValue": a[3] || (a[3] = (ne) => {
483
+ A(ne);
484
+ })
485
+ }, null, 8, ["label", "model-value"])) : z("", !0),
486
+ (((Ee = y.value) == null ? void 0 : Ee.formatters) || []).length > 0 ? (f(), R(be, {
487
+ key: 2,
488
+ modelValue: i.value.formatter,
489
+ "onUpdate:modelValue": a[4] || (a[4] = (ne) => i.value.formatter = ne),
490
+ placeholder: l(v)("report.section.dimension.formatter"),
491
+ label: l(v)("report.section.dimension.formatter"),
492
+ items: [
493
+ { label: l(v)("report.section.metric.formatterType.NONE"), value: null },
494
+ ...(((We = y.value) == null ? void 0 : We.formatters) || []).map((ne) => ({
495
+ label: h(ne),
496
+ value: ne
497
+ }))
498
+ ]
499
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : z("", !0),
500
+ F.value ? (f(), R(se, {
501
+ key: 3,
502
+ "model-value": i.value.fillGap ?? !1,
503
+ label: l(v)("report.section.dimension.fillGap"),
504
+ value: "",
505
+ placeholder: "Fill gap",
506
+ "onUpdate:modelValue": a[5] || (a[5] = (ne) => {
507
+ i.value && (i.value.fillGap = r(ne));
508
+ })
509
+ }, null, 8, ["model-value", "label"])) : z("", !0),
510
+ ((Xe = y.value) == null ? void 0 : Xe.type) === l(Gl).Timestamp ? (f(), R(se, {
511
+ key: 4,
512
+ "model-value": i.value.dateComparison ?? !1,
513
+ label: l(v)("report.section.dimension.dateComparison"),
514
+ value: "",
515
+ "onUpdate:modelValue": a[6] || (a[6] = (ne) => {
516
+ i.value && (i.value.dateComparison = r(ne));
517
+ })
518
+ }, null, 8, ["model-value", "label"])) : z("", !0),
519
+ p(se, {
520
+ modelValue: i.value.hide,
521
+ "onUpdate:modelValue": a[7] || (a[7] = (ne) => i.value.hide = ne),
522
+ label: l(v)("report.section.dimension.hide"),
523
+ value: ""
524
+ }, null, 8, ["modelValue", "label"]),
525
+ o.hasRowColumn ? (f(), R(se, {
526
+ key: 5,
527
+ "model-value": i.value.moveToColumn ?? !1,
528
+ label: l(v)("report.section.dimension.moveToColumn"),
529
+ value: "",
530
+ "onUpdate:modelValue": a[8] || (a[8] = (ne) => {
531
+ i.value && (i.value.moveToColumn = r(ne));
532
+ })
533
+ }, null, 8, ["model-value", "label"])) : z("", !0),
534
+ p(se, {
535
+ modelValue: s.value,
536
+ "onUpdate:modelValue": a[9] || (a[9] = (ne) => s.value = ne),
537
+ label: l(v)("report.section.dimension.advance"),
538
+ value: !0
539
+ }, null, 8, ["modelValue", "label"]),
540
+ s.value ? (f(), R(ze, {
541
+ key: 6,
542
+ modelValue: i.value.dataFormula,
543
+ "onUpdate:modelValue": a[10] || (a[10] = (ne) => i.value.dataFormula = ne),
544
+ placeholder: l(v)("report.section.dimension.dataFormula"),
545
+ "field-data-list": l(_),
546
+ "formula-field": l(je).Dimension,
547
+ "validation-result": l(le),
548
+ "is-validating": l(G),
549
+ "valid-formula-label": l(v)("report.common.validFormula")
550
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0),
551
+ s.value ? (f(), R(ze, {
552
+ key: 7,
553
+ modelValue: i.value.displayFormula,
554
+ "onUpdate:modelValue": a[11] || (a[11] = (ne) => i.value.displayFormula = ne),
555
+ placeholder: l(v)("report.section.dimension.displayFormula"),
556
+ "field-data-list": l(_),
557
+ "formula-field": l(je).Dimension,
558
+ "validation-result": l(J),
559
+ "is-validating": l(d),
560
+ "valid-formula-label": l(v)("report.common.validFormula")
561
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
562
+ ], 64)) : z("", !0)
563
+ ];
564
+ }),
565
+ _: 1
566
+ }, 512)
567
+ ]),
568
+ _: 1
569
+ }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
570
+ b("div", null, [
571
+ b("p", dt, q(S.value), 1),
572
+ b("p", mt, q(l(v)("report.section.dimension.description")), 1)
573
+ ]),
574
+ p(Be, null, {
575
+ default: K(() => [
576
+ p(l(Ke), {
577
+ list: n.value,
578
+ "item-key": (ye) => l(Ve)(ye),
579
+ class: "flex flex-col gap-2"
580
+ }, {
581
+ item: K(({ element: ye, index: he }) => [
582
+ p(_e, {
583
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
584
+ onClick: we((Te) => O(g.value[he]), ["stop"])
585
+ }, {
586
+ default: K(() => [
587
+ p(Q, { name: "drag_handle" }),
588
+ b("p", ct, q(l(re)(l(v), l(e), ye.label, "other")), 1),
589
+ a[14] || (a[14] = b("div", { class: "grow" }, null, -1)),
590
+ p(Re, {
591
+ icon: "close",
592
+ size: "md",
593
+ variant: "tertiary",
594
+ onClick: we((Te) => u(he), ["stop"])
595
+ }, null, 8, ["onClick"])
596
+ ]),
597
+ _: 2
598
+ }, 1032, ["onClick"])
599
+ ]),
600
+ _: 1
601
+ }, 8, ["list", "item-key"])
602
+ ]),
603
+ _: 1
604
+ }),
605
+ p(xe, {
606
+ class: "text-fm-color-typo-tertiary",
607
+ onClick: a[13] || (a[13] = () => {
608
+ O();
609
+ })
610
+ }, {
611
+ default: K(() => [
612
+ Ie(q(l(v)("report.section.dimension.add")), 1)
613
+ ]),
614
+ _: 1
615
+ })
616
+ ])) : z("", !0);
617
+ };
618
+ }
619
+ }), Ge = {
620
+ value: "_metric_name"
621
+ };
622
+ function pt(U, v, e) {
623
+ switch (U) {
624
+ case H.BarChart:
625
+ case H.StackBarChart:
626
+ case H.ClusteredStackBarChart:
627
+ case H.LineChart:
628
+ case H.StackLineChart:
629
+ case H.Circular:
630
+ return v.length > 1;
631
+ default:
632
+ return e;
633
+ }
634
+ }
635
+ function nl(U) {
636
+ var n;
637
+ if (!U.widget)
638
+ return U.tiles ? { ...U, tiles: U.tiles.map(nl) } : U;
639
+ const { rowIds: v, columnIds: e } = Ye(U.widget.config);
640
+ return {
641
+ ...U,
642
+ ...U.tiles ? { tiles: U.tiles.map(nl) } : {},
643
+ widget: {
644
+ ...U.widget,
645
+ config: {
646
+ ...U.widget.config,
647
+ rowIds: v,
648
+ columnIds: e,
649
+ isDrillable: pt(
650
+ U.widget.type,
651
+ U.widget.config.dimensions,
652
+ U.widget.config.isDrillable
653
+ ),
654
+ joinDatasources: (n = U.widget.config.joinDatasources) == null ? void 0 : n.map((o) => {
655
+ const { rowIds: S, columnIds: C } = Ye(o);
656
+ return {
657
+ ...o,
658
+ rowIds: S,
659
+ columnIds: C
660
+ };
661
+ })
662
+ }
663
+ }
664
+ };
665
+ }
666
+ function Ye(U) {
667
+ const v = U.dimensions.filter((C) => C.hide !== !0 && !C.moveToColumn).map((C) => Ve(C)), e = U.dimensions.filter((C) => C.hide !== !0 && C.moveToColumn == !0).map((C) => Ve(C)), n = U.metrics.length > 0;
668
+ n && U.metrics.find((C) => C.moveToRow == !0) ? v.push(Ge.value) : n && e.push(Ge.value);
669
+ const o = [], S = [];
670
+ for (const C of v)
671
+ o.push(C);
672
+ for (const C of e)
673
+ S.push(C);
674
+ return {
675
+ rowIds: o,
676
+ columnIds: S
677
+ };
678
+ }
679
+ const vt = { class: "flex flex-col my-2 gap-8" }, ft = { class: "fm-typo-en-body-lg-600" }, gt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, yt = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, bt = /* @__PURE__ */ de({
680
+ __name: "MetricSection",
681
+ props: /* @__PURE__ */ ve({
682
+ options: {
683
+ type: Array,
684
+ default: () => []
685
+ },
686
+ label: {
687
+ type: String,
688
+ default: "title"
689
+ },
690
+ max: {
691
+ type: Number,
692
+ default: void 0
693
+ },
694
+ config: {
695
+ type: Object,
696
+ default: () => {
697
+ }
698
+ },
699
+ hasRowColumn: {
700
+ type: Boolean,
701
+ default: !1
702
+ },
703
+ hasPercentOfTotal: {
704
+ type: Boolean,
705
+ default: !1
706
+ },
707
+ hasXy: {
708
+ type: Boolean,
709
+ default: !1
710
+ }
711
+ }, {
712
+ modelValue: { required: !1, default: [] },
713
+ modelModifiers: {}
714
+ }),
715
+ emits: /* @__PURE__ */ ve(["config"], ["update:modelValue"]),
716
+ setup(U, { emit: v }) {
717
+ const { t: e, te: n } = pe(), o = ge(U, "modelValue"), S = U;
718
+ V(() => !!S.max && o.value.length === S.max);
719
+ const C = V(() => e(`report.section.metric.${S.label}`)), g = te(!1), $ = V(
720
+ () => o.value.map((d, t) => ({
721
+ index: t,
722
+ labels: [d.label || d.name],
723
+ value: d
724
+ }))
725
+ ), O = te(o.value.length > 0 ? 0 : void 0);
726
+ function i(d) {
727
+ var t, a, N;
728
+ g.value = !0, s.value = d != null && d.value ? JSON.parse(
729
+ JSON.stringify({
730
+ ...d.value,
731
+ label: re(e, n, d.value.label, "other")
732
+ })
733
+ ) : void 0, O.value = d == null ? void 0 : d.index, y.value = !!((t = s.value) != null && t.dataFormula || (a = s.value) != null && a.displayFormula), s.value && s.value.formatter === void 0 && d != null && d.value.timeFormatter && s.value.formatter === void 0 && (s.value.formatter = d == null ? void 0 : d.value.timeFormatter, s.value.timeFormatter = void 0), S.hasRowColumn && ((N = S.config.rowIds) == null ? void 0 : N.includes(Ge.value)) === !0 && s.value && s.value.moveToRow === void 0 && (s.value.moveToRow = !0), s.value && (!S.hasXy || s.value.nullable === void 0) && (s.value.nullable = !1);
734
+ }
735
+ const s = te(void 0), y = te(!1), F = V(
736
+ () => S.options.find(
737
+ (d) => {
738
+ var t, a;
739
+ return d.schemaName === ((t = s.value) == null ? void 0 : t.schemaName) && d.name === ((a = s.value) == null ? void 0 : a.name);
740
+ }
741
+ ) ?? {}
742
+ );
743
+ function B(d, t) {
744
+ var a;
745
+ return (d == null ? void 0 : d.isNumericType) || ((a = d == null ? void 0 : d.isNumericAggregations) == null ? void 0 : a.includes(t || ""));
746
+ }
747
+ function c() {
748
+ var d, t;
749
+ if (o.value.length > 0) {
750
+ const a = (d = o.value[0]) == null ? void 0 : d.moveToRow;
751
+ if (typeof a == "boolean")
752
+ return a;
753
+ }
754
+ return ((t = S.config.rowIds) == null ? void 0 : t.includes(Ge.value)) === !0;
755
+ }
756
+ const u = V(
757
+ () => {
758
+ var d;
759
+ return B(F.value, (d = s.value) == null ? void 0 : d.aggregation);
760
+ }
761
+ );
762
+ Ce(u, (d) => {
763
+ s.value && (d ? s.value.decimal = typeof s.value.decimal != "number" ? 2 : s.value.decimal : s.value.decimal = void 0);
764
+ });
765
+ function A(d) {
766
+ var t, a;
767
+ (d.schemaName !== ((t = s.value) == null ? void 0 : t.schemaName) || d.name !== ((a = s.value) == null ? void 0 : a.name)) && (s.value = {
768
+ schemaName: d.schemaName,
769
+ name: d.name,
770
+ aggregation: d.aggregations[0],
771
+ label: re(e, n, d.label, "other"),
772
+ nullable: !1,
773
+ decimal: B(d, d.aggregations[0]) ? 2 : void 0,
774
+ moveToRow: c(),
775
+ hide: !1
776
+ }, y.value = !1);
777
+ }
778
+ function L() {
779
+ var t;
780
+ const d = [...$.value.map((a) => a.value)];
781
+ if (s.value && (y.value || (s.value.dataFormula = void 0, s.value.displayFormula = void 0), S.hasXy || (s.value.nullable = !1), O.value !== void 0 ? d[O.value] = s.value : d.push(s.value)), S.hasRowColumn && typeof ((t = s.value) == null ? void 0 : t.moveToRow) == "boolean")
782
+ for (const a of d)
783
+ a.moveToRow = s.value.moveToRow;
784
+ o.value = d, g.value = !1;
785
+ }
786
+ function h(d) {
787
+ const t = [...$.value.map((a) => a.value)];
788
+ t.splice(d, 1), o.value = t;
789
+ }
790
+ const r = V(
791
+ () => S.options.map((d) => ({
792
+ label: d.labels.join(" "),
793
+ value: d
794
+ }))
795
+ );
796
+ function j(d) {
797
+ return [d.schemaName, d.name, re(e, n, d.label, "other")].join(" ");
798
+ }
799
+ function Y(d) {
800
+ return [d.schemaName, d.name, d.aggregation, d.label || ""].join("__");
801
+ }
802
+ const w = V(() => {
803
+ var a;
804
+ const d = /* @__PURE__ */ new Map(), t = s.value ? Y(s.value) : "";
805
+ for (const N of ((a = S.config) == null ? void 0 : a.metrics) ?? [])
806
+ t && Y(N) === t || d.set(Ve(N), N);
807
+ return s.value && d.set(Ve(s.value), s.value), Array.from(d.values());
808
+ }), { formulaFieldDataList: m, allowedFormulaFields: _ } = sl({
809
+ options: V(() => S.options),
810
+ primaryFields: V(() => {
811
+ var d, t;
812
+ return [
813
+ ...((d = S.config) == null ? void 0 : d.dimensions) ?? [],
814
+ ...(t = S.config) != null && t.breakdownDimension ? [S.config.breakdownDimension] : []
815
+ ];
816
+ }),
817
+ secondaryFields: w,
818
+ getLabel: j
819
+ }), { dataValidation: x, displayValidation: le, isDataValidating: J, isDisplayValidating: G } = rl({
820
+ getDataFormula: () => {
821
+ var d;
822
+ return (d = s.value) == null ? void 0 : d.dataFormula;
823
+ },
824
+ getDisplayFormula: () => {
825
+ var d;
826
+ return (d = s.value) == null ? void 0 : d.displayFormula;
827
+ },
828
+ getIsAdvance: () => y.value,
829
+ getAllowedFields: () => _.value
830
+ });
831
+ return (d, t) => {
832
+ const a = M("FmTextField"), N = M("FmStepperField"), ae = M("FmCheckbox"), se = M("FmForm"), me = M("FmIcon"), Q = M("FmButton"), Re = M("FmListItem"), _e = M("FmList"), Be = M("FmField");
833
+ return f(), P("div", vt, [
834
+ p(Pe, {
835
+ modelValue: g.value,
836
+ "onUpdate:modelValue": t[12] || (t[12] = (xe) => g.value = xe),
837
+ title: C.value,
838
+ onConfirm: L
839
+ }, {
840
+ content: K(() => [
841
+ p(se, {
842
+ ref: "form",
843
+ class: "flex flex-col gap-2 w-[490px]"
844
+ }, {
845
+ default: K(() => {
846
+ var xe, ye, he, Te;
847
+ return [
848
+ p(be, {
849
+ "model-value": F.value,
850
+ items: r.value,
851
+ placeholder: C.value,
852
+ label: C.value,
853
+ "onUpdate:modelValue": t[0] || (t[0] = (Z) => A(Z))
854
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
855
+ s.value ? (f(), P(ue, { key: 0 }, [
856
+ p(a, {
857
+ modelValue: s.value.label,
858
+ "onUpdate:modelValue": t[1] || (t[1] = (Z) => s.value.label = Z),
859
+ label: l(e)("report.section.metric.label")
860
+ }, null, 8, ["modelValue", "label"]),
861
+ (((xe = F.value) == null ? void 0 : xe.aggregations) || []).length > 0 ? (f(), R(be, {
862
+ key: 0,
863
+ modelValue: s.value.aggregation,
864
+ "onUpdate:modelValue": t[2] || (t[2] = (Z) => s.value.aggregation = Z),
865
+ label: l(e)("report.section.metric.aggregation"),
866
+ items: ((ye = F.value) == null ? void 0 : ye.aggregations.map((Z) => ({
867
+ label: l(n)(`report.section.metric.aggregationType.${Z}`) ? l(e)(`report.section.metric.aggregationType.${Z}`) : l(re)(l(e), l(n), Z, "field"),
868
+ value: Z
869
+ }))) ?? []
870
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
871
+ u.value ? (f(), R(N, {
872
+ key: 1,
873
+ label: l(e)("report.common.decimal"),
874
+ "model-value": ((he = s.value) == null ? void 0 : he.decimal) ?? 2,
875
+ "onUpdate:modelValue": t[3] || (t[3] = (Z) => {
876
+ s.value && (s.value.decimal = Z);
877
+ })
878
+ }, null, 8, ["label", "model-value"])) : z("", !0),
879
+ u.value ? (f(), R(be, {
880
+ key: 2,
881
+ modelValue: s.value.formatter,
882
+ "onUpdate:modelValue": t[4] || (t[4] = (Z) => s.value.formatter = Z),
883
+ placeholder: l(e)("report.section.metric.formatter"),
884
+ label: l(e)("report.section.metric.formatter"),
885
+ items: [
886
+ { label: l(e)("report.section.metric.formatterType.NONE"), value: null },
887
+ ...(((Te = F.value) == null ? void 0 : Te.formatters) || []).map((Z) => ({
888
+ label: l(n)(`report.section.metric.formatterType.${Z}`) ? l(e)(`report.section.metric.formatterType.${Z}`) : l(re)(l(e), l(n), Z, "field"),
889
+ value: Z
890
+ }))
891
+ ]
892
+ }, null, 8, ["modelValue", "placeholder", "label", "items"])) : z("", !0),
893
+ p(ae, {
894
+ modelValue: s.value.hide,
895
+ "onUpdate:modelValue": t[5] || (t[5] = (Z) => s.value.hide = Z),
896
+ label: l(e)("report.section.metric.hide"),
897
+ value: ""
898
+ }, null, 8, ["modelValue", "label"]),
899
+ S.hasXy ? (f(), R(ae, {
900
+ key: 3,
901
+ "model-value": s.value.nullable ?? !1,
902
+ label: l(e)("report.section.metric.nullable"),
903
+ value: !0,
904
+ "onUpdate:modelValue": t[6] || (t[6] = (Z) => {
905
+ s.value && (s.value.nullable = Z);
906
+ })
907
+ }, null, 8, ["model-value", "label"])) : z("", !0),
908
+ S.hasRowColumn ? (f(), R(ae, {
909
+ key: 4,
910
+ "model-value": s.value.moveToRow ?? !1,
911
+ label: l(e)("report.section.metric.moveToRow"),
912
+ value: "",
913
+ "onUpdate:modelValue": t[7] || (t[7] = (Z) => {
914
+ s.value && (s.value.moveToRow = Array.isArray(Z) ? Z.length > 0 : Z);
915
+ })
916
+ }, null, 8, ["model-value", "label"])) : z("", !0),
917
+ S.hasRowColumn && S.hasPercentOfTotal ? (f(), R(ae, {
918
+ key: 5,
919
+ "model-value": s.value.percentOfTotal ?? !1,
920
+ label: l(e)("report.section.metric.percentOfTotal"),
921
+ value: "",
922
+ "onUpdate:modelValue": t[8] || (t[8] = (Z) => {
923
+ s.value && (s.value.percentOfTotal = Array.isArray(Z) ? Z.length > 0 : Z);
924
+ })
925
+ }, null, 8, ["model-value", "label"])) : z("", !0),
926
+ p(ae, {
927
+ modelValue: y.value,
928
+ "onUpdate:modelValue": t[9] || (t[9] = (Z) => y.value = Z),
929
+ label: l(e)("report.section.metric.advance"),
930
+ value: !0
931
+ }, null, 8, ["modelValue", "label"]),
932
+ y.value ? (f(), R(ze, {
933
+ key: 6,
934
+ modelValue: s.value.dataFormula,
935
+ "onUpdate:modelValue": t[10] || (t[10] = (Z) => s.value.dataFormula = Z),
936
+ placeholder: l(e)("report.section.metric.dataFormula"),
937
+ "field-data-list": l(m),
938
+ "formula-field": l(je).Metric,
939
+ "validation-result": l(x),
940
+ "is-validating": l(J),
941
+ "valid-formula-label": l(e)("report.common.validFormula")
942
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0),
943
+ y.value ? (f(), R(ze, {
944
+ key: 7,
945
+ modelValue: s.value.displayFormula,
946
+ "onUpdate:modelValue": t[11] || (t[11] = (Z) => s.value.displayFormula = Z),
947
+ placeholder: l(e)("report.section.metric.displayFormula"),
948
+ "field-data-list": l(m),
949
+ "formula-field": l(je).Metric,
950
+ "validation-result": l(le),
951
+ "is-validating": l(G),
952
+ "valid-formula-label": l(e)("report.common.validFormula")
953
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
954
+ ], 64)) : z("", !0)
955
+ ];
956
+ }),
957
+ _: 1
958
+ }, 512)
959
+ ]),
960
+ _: 1
961
+ }, 8, ["modelValue", "title"]),
962
+ b("div", null, [
963
+ b("p", ft, q(C.value), 1),
964
+ b("p", gt, q(l(e)("report.section.metric.description")), 1)
965
+ ]),
966
+ p(_e, null, {
967
+ default: K(() => [
968
+ p(l(Ke), {
969
+ list: o.value,
970
+ "item-key": "id",
971
+ class: "flex flex-col gap-2 w-full"
972
+ }, {
973
+ item: K(({ element: xe, index: ye }) => [
974
+ p(Re, {
975
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
976
+ onClick: we((he) => i($.value[ye]), ["stop"])
977
+ }, {
978
+ default: K(() => [
979
+ p(me, { name: "drag_handle" }),
980
+ b("p", yt, q(l(re)(l(e), l(n), xe.label, "other")), 1),
981
+ t[14] || (t[14] = b("div", { class: "grow" }, null, -1)),
982
+ p(Q, {
983
+ icon: "close",
984
+ size: "md",
985
+ variant: "tertiary",
986
+ onClick: we((he) => h(ye), ["stop"])
987
+ }, null, 8, ["onClick"])
988
+ ]),
989
+ _: 2
990
+ }, 1032, ["onClick"])
991
+ ]),
992
+ _: 1
993
+ }, 8, ["list"])
994
+ ]),
995
+ _: 1
996
+ }),
997
+ p(Be, {
998
+ class: "text-fm-color-typo-tertiary",
999
+ onClick: t[13] || (t[13] = () => {
1000
+ i();
1001
+ })
1002
+ }, {
1003
+ default: K(() => [
1004
+ Ie(q(l(e)("report.section.metric.add")), 1)
1005
+ ]),
1006
+ _: 1
1007
+ })
1008
+ ]);
1009
+ };
1010
+ }
1011
+ }), ht = { class: "flex flex-col my-2 gap-8" }, wt = { class: "fm-typo-en-body-lg-600" }, Ct = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, xt = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, kt = /* @__PURE__ */ de({
1012
+ __name: "SortSection",
1013
+ props: /* @__PURE__ */ ve({
1014
+ options: {
1015
+ type: Array,
1016
+ default: () => []
1017
+ },
1018
+ dimensions: {
1019
+ type: Array,
1020
+ default: () => []
1021
+ },
1022
+ breakdownDimension: {
1023
+ type: Object,
1024
+ default: void 0
1025
+ },
1026
+ metrics: {
1027
+ type: Array,
1028
+ default: () => []
1029
+ },
1030
+ label: {
1031
+ type: String,
1032
+ default: "title"
1033
+ }
1034
+ }, {
1035
+ modelValue: { required: !1, default: [] },
1036
+ modelModifiers: {}
1037
+ }),
1038
+ emits: ["update:modelValue"],
1039
+ setup(U) {
1040
+ const { t: v, te: e } = pe(), n = ge(U, "modelValue"), o = U, S = V(() => v(`report.section.sort.${o.label}`)), C = te(!1), g = V(
1041
+ () => n.value.map((w, m) => {
1042
+ const _ = o.options.find(
1043
+ (le) => le.schemaName === w.schemaName && le.name === w.name
1044
+ ), x = (_ == null ? void 0 : _.labels) || [w.schemaName, w.name];
1045
+ return {
1046
+ index: m,
1047
+ label: x.map((le) => re(v, e, le, "other")).join(" "),
1048
+ value: w
1049
+ };
1050
+ })
1051
+ ), $ = te(n.value.length > 0 ? 0 : void 0);
1052
+ function O(w) {
1053
+ var m;
1054
+ C.value = !0, i.value = w != null && w.value ? JSON.parse(JSON.stringify(w.value)) : void 0, $.value = w == null ? void 0 : w.index, s.value = !!((m = i.value) != null && m.dataFormula);
1055
+ }
1056
+ const i = te(void 0), s = te(!1), y = V(
1057
+ () => o.options.find(
1058
+ (w) => {
1059
+ var m, _;
1060
+ return w.schemaName === ((m = i.value) == null ? void 0 : m.schemaName) && w.name === ((_ = i.value) == null ? void 0 : _.name);
1061
+ }
1062
+ ) ?? {}
1063
+ );
1064
+ function F(w) {
1065
+ var m, _;
1066
+ (w.schemaName !== ((m = i.value) == null ? void 0 : m.schemaName) || w.name !== ((_ = i.value) == null ? void 0 : _.name)) && (i.value = {
1067
+ schemaName: w.schemaName,
1068
+ name: w.name,
1069
+ dimensionOption: w.dimensionOptions[0],
1070
+ aggregation: null,
1071
+ type: vl.Asc
1072
+ });
1073
+ }
1074
+ function B() {
1075
+ if (!i.value) {
1076
+ console.log("new sort is undefined");
1077
+ return;
1078
+ }
1079
+ const w = [...g.value.map((m) => m.value)];
1080
+ s.value || (i.value.dataFormula = void 0), $.value !== void 0 ? w[$.value] = i.value : w.push(i.value), n.value = w, C.value = !1;
1081
+ }
1082
+ function c(w) {
1083
+ const m = [...g.value.map((_) => _.value)];
1084
+ m.splice(w, 1), n.value = m, C.value = !1;
1085
+ }
1086
+ function u(w) {
1087
+ const m = `report.section.filter.${Oe(w)}`;
1088
+ return e(m) ? v(m) : re(v, e, w, "field");
1089
+ }
1090
+ const A = V(
1091
+ () => o.options.map((w) => ({
1092
+ label: w.labels.join(" "),
1093
+ value: w
1094
+ }))
1095
+ );
1096
+ function L(w) {
1097
+ return [w.schemaName, w.name, re(v, e, w.label, "other")].join(" ");
1098
+ }
1099
+ const { formulaFieldDataList: h, allowedFormulaFields: r } = sl({
1100
+ options: V(() => o.options),
1101
+ primaryFields: V(() => [
1102
+ ...o.dimensions,
1103
+ ...o.breakdownDimension ? [o.breakdownDimension] : []
1104
+ ]),
1105
+ secondaryFields: V(() => o.metrics),
1106
+ getLabel: L
1107
+ }), { dataValidation: j, isDataValidating: Y } = rl({
1108
+ getDataFormula: () => {
1109
+ var w;
1110
+ return (w = i.value) == null ? void 0 : w.dataFormula;
1111
+ },
1112
+ getDisplayFormula: () => {
1113
+ },
1114
+ getIsAdvance: () => s.value,
1115
+ getAllowedFields: () => r.value
1116
+ });
1117
+ return (w, m) => {
1118
+ const _ = M("FmCheckbox"), x = M("FmForm"), le = M("FmIcon"), J = M("FmButton"), G = M("FmListItem"), d = M("FmList"), t = M("FmField");
1119
+ return f(), P("div", ht, [
1120
+ p(Pe, {
1121
+ modelValue: C.value,
1122
+ "onUpdate:modelValue": m[6] || (m[6] = (a) => C.value = a),
1123
+ title: S.value,
1124
+ onConfirm: B
1125
+ }, {
1126
+ content: K(() => [
1127
+ p(x, {
1128
+ ref: "form",
1129
+ class: "flex flex-col gap-2 w-[490px]"
1130
+ }, {
1131
+ default: K(() => {
1132
+ var a, N, ae, se, me;
1133
+ return [
1134
+ p(be, {
1135
+ "model-value": y.value,
1136
+ items: A.value,
1137
+ placeholder: S.value,
1138
+ label: S.value,
1139
+ "onUpdate:modelValue": m[0] || (m[0] = (Q) => F(Q))
1140
+ }, null, 8, ["model-value", "items", "placeholder", "label"]),
1141
+ i.value ? (f(), P(ue, { key: 0 }, [
1142
+ (((a = y.value) == null ? void 0 : a.dimensionOptions) || []).length > 0 ? (f(), R(be, {
1143
+ key: 0,
1144
+ modelValue: i.value.dimensionOption,
1145
+ "onUpdate:modelValue": m[1] || (m[1] = (Q) => i.value.dimensionOption = Q),
1146
+ items: ((N = y.value) == null ? void 0 : N.dimensionOptions.map((Q) => ({
1147
+ label: u(Q),
1148
+ value: Q
1149
+ }))) ?? [],
1150
+ placeholder: l(v)("report.section.sort.format"),
1151
+ label: l(v)("report.section.sort.format")
1152
+ }, null, 8, ["modelValue", "items", "placeholder", "label"])) : z("", !0),
1153
+ (((ae = y.value) == null ? void 0 : ae.aggregations) || []).length > 0 ? (f(), R(be, {
1154
+ key: 1,
1155
+ modelValue: i.value.aggregation,
1156
+ "onUpdate:modelValue": m[2] || (m[2] = (Q) => i.value.aggregation = Q),
1157
+ items: ((se = y.value) == null ? void 0 : se.aggregations.map((Q) => ({
1158
+ label: l(e)(`report.section.metric.aggregationType.${Q}`) ? l(v)(`report.section.metric.aggregationType.${Q}`) : Q,
1159
+ value: Q
1160
+ }))) ?? [],
1161
+ label: l(v)("report.section.sort.aggregation"),
1162
+ placeholder: l(v)("report.section.sort.aggregation")
1163
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])) : z("", !0),
1164
+ p(be, {
1165
+ modelValue: i.value.type,
1166
+ "onUpdate:modelValue": m[3] || (m[3] = (Q) => i.value.type = Q),
1167
+ items: Object.values(l(vl)).map((Q) => ({
1168
+ label: l(e)(`report.section.sort.sortType.${Q}`) ? l(v)(`report.section.sort.sortType.${Q}`) : Q,
1169
+ value: Q
1170
+ })),
1171
+ placeholder: l(v)("report.section.sort.order"),
1172
+ label: l(v)("report.section.sort.order")
1173
+ }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1174
+ p(_, {
1175
+ modelValue: s.value,
1176
+ "onUpdate:modelValue": m[4] || (m[4] = (Q) => s.value = Q),
1177
+ label: l(v)("report.section.sort.advance"),
1178
+ value: !0
1179
+ }, null, 8, ["modelValue", "label"]),
1180
+ s.value ? (f(), R(ze, {
1181
+ key: 2,
1182
+ modelValue: i.value.dataFormula,
1183
+ "onUpdate:modelValue": m[5] || (m[5] = (Q) => i.value.dataFormula = Q),
1184
+ placeholder: l(v)("report.section.sort.dataFormula"),
1185
+ "field-data-list": l(h),
1186
+ "formula-field": ((me = y.value) == null ? void 0 : me.type) === "NUMERIC" ? l(je).Metric : l(je).Dimension,
1187
+ "validation-result": l(j),
1188
+ "is-validating": l(Y),
1189
+ "valid-formula-label": l(v)("report.common.validFormula")
1190
+ }, null, 8, ["modelValue", "placeholder", "field-data-list", "formula-field", "validation-result", "is-validating", "valid-formula-label"])) : z("", !0)
1191
+ ], 64)) : z("", !0)
1192
+ ];
1193
+ }),
1194
+ _: 1
1195
+ }, 512)
1196
+ ]),
1197
+ _: 1
1198
+ }, 8, ["modelValue", "title"]),
1199
+ b("div", null, [
1200
+ b("p", wt, q(S.value), 1),
1201
+ b("p", Ct, q(l(v)("report.section.sort.description")), 1)
1202
+ ]),
1203
+ p(d, null, {
1204
+ default: K(() => [
1205
+ p(l(Ke), {
1206
+ list: n.value,
1207
+ "item-key": "id",
1208
+ class: "flex flex-col gap-2 w-full"
1209
+ }, {
1210
+ item: K(({ element: a, index: N }) => [
1211
+ p(G, {
1212
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1213
+ onClick: we((ae) => O(g.value[N]), ["stop"])
1214
+ }, {
1215
+ default: K(() => [
1216
+ p(le, { name: "drag_handle" }),
1217
+ b("p", xt, q(g.value[N].label), 1),
1218
+ m[8] || (m[8] = b("div", { class: "grow" }, null, -1)),
1219
+ p(J, {
1220
+ icon: "close",
1221
+ size: "md",
1222
+ variant: "tertiary",
1223
+ onClick: we((ae) => c(N), ["stop"])
1224
+ }, null, 8, ["onClick"])
1225
+ ]),
1226
+ _: 2
1227
+ }, 1032, ["onClick"])
1228
+ ]),
1229
+ _: 1
1230
+ }, 8, ["list"])
1231
+ ]),
1232
+ _: 1
1233
+ }),
1234
+ p(t, {
1235
+ class: "text-fm-color-typo-tertiary",
1236
+ onClick: m[7] || (m[7] = () => {
1237
+ O();
1238
+ })
1239
+ }, {
1240
+ default: K(() => [
1241
+ Ie(q(l(v)("report.section.sort.add")), 1)
1242
+ ]),
1243
+ _: 1
1244
+ })
1245
+ ]);
1246
+ };
1247
+ }
1248
+ }), Ft = { class: "fm-typo-en-body-lg-600" }, Vt = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, St = /* @__PURE__ */ de({
1249
+ __name: "LimitSection",
1250
+ props: {
1251
+ modelValue: { required: !0, default: null },
1252
+ modelModifiers: {}
1253
+ },
1254
+ emits: ["update:modelValue"],
1255
+ setup(U) {
1256
+ const { t: v } = pe(), e = ge(U, "modelValue"), n = qe((o) => {
1257
+ o !== "" ? e.value = o : e.value = null;
1258
+ }, 1e3);
1259
+ return (o, S) => {
1260
+ const C = M("FmTextField");
1261
+ return f(), P(ue, null, [
1262
+ b("div", null, [
1263
+ b("p", Ft, q(l(v)("report.section.limit.title")), 1),
1264
+ b("p", Vt, q(l(v)("report.section.limit.description")), 1)
1265
+ ]),
1266
+ p(C, {
1267
+ "model-value": e.value,
1268
+ inputmode: "numeric",
1269
+ placeholder: l(v)("report.section.limit.placeholder"),
1270
+ "onUpdate:modelValue": S[0] || (S[0] = (g) => l(n)(g))
1271
+ }, null, 8, ["model-value", "placeholder"])
1272
+ ], 64);
1273
+ };
1274
+ }
1275
+ }), _t = { class: "flex flex-col my-2 gap-8" }, Tt = { class: "fm-typo-en-body-lg-600" }, $t = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Dt = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Ut = /* @__PURE__ */ de({
1276
+ __name: "ConditionSection",
1277
+ props: /* @__PURE__ */ ve({
1278
+ joinFieldOptions: {
1279
+ type: Array,
1280
+ default: () => []
1281
+ },
1282
+ mainFieldOptions: {
1283
+ type: Array,
1284
+ default: () => []
1285
+ },
1286
+ label: {
1287
+ type: String,
1288
+ default: "title"
1289
+ }
1290
+ }, {
1291
+ modelValue: { required: !0 },
1292
+ modelModifiers: {}
1293
+ }),
1294
+ emits: ["update:modelValue"],
1295
+ setup(U) {
1296
+ const { t: v, te: e } = pe(), n = ge(U, "modelValue"), o = U, S = V(() => v(`report.section.condition.${o.label}`)), C = te(!1), g = V(
1297
+ () => n.value.map((h, r) => {
1298
+ var w, m;
1299
+ const j = o.joinFieldOptions.find(
1300
+ (_) => {
1301
+ var x, le;
1302
+ return _.schemaName === ((x = h.joinDimension) == null ? void 0 : x.schemaName) && _.name === ((le = h.joinDimension) == null ? void 0 : le.name);
1303
+ }
1304
+ ), Y = (j == null ? void 0 : j.labels) || [
1305
+ (w = h.joinDimension) == null ? void 0 : w.schemaName,
1306
+ (m = h.joinDimension) == null ? void 0 : m.name
1307
+ ];
1308
+ return {
1309
+ index: r,
1310
+ label: Y.map((_) => re(v, e, _, "other")).join(" "),
1311
+ value: h
1312
+ };
1313
+ })
1314
+ ), $ = te(n.value.length > 0 ? 0 : void 0);
1315
+ function O(h) {
1316
+ h ? (i.value = h != null && h.value ? JSON.parse(JSON.stringify(h.value)) : void 0, $.value = h == null ? void 0 : h.index) : (i.value = {
1317
+ joinDimension: null,
1318
+ operator: "",
1319
+ mainDimensions: []
1320
+ }, $.value = void 0), C.value = !0;
1321
+ }
1322
+ const i = te(void 0), s = V(
1323
+ () => o.joinFieldOptions.find(
1324
+ (h) => {
1325
+ var r, j;
1326
+ return h.schemaName === ((j = (r = i.value) == null ? void 0 : r.joinDimension) == null ? void 0 : j.schemaName) && h.name === i.value.joinDimension.name;
1327
+ }
1328
+ ) ?? {}
1329
+ ), y = V(
1330
+ () => {
1331
+ var h;
1332
+ return (((h = i.value) == null ? void 0 : h.mainDimensions) || []).map(
1333
+ (r) => o.mainFieldOptions.find(
1334
+ (j) => j.schemaName === (r == null ? void 0 : r.schemaName) && j.name === r.name
1335
+ ) ?? {}
1336
+ );
1337
+ }
1338
+ ), F = V(
1339
+ () => o.joinFieldOptions.map((h) => ({ label: h.labels.join(" "), value: h }))
1340
+ );
1341
+ function B(h) {
1342
+ var r, j, Y, w;
1343
+ i.value && (i.value && h.schemaName !== ((j = (r = i.value) == null ? void 0 : r.joinDimension) == null ? void 0 : j.schemaName) || h.name !== ((w = (Y = i.value) == null ? void 0 : Y.joinDimension) == null ? void 0 : w.name)) && (i.value = {
1344
+ ...i.value,
1345
+ joinDimension: {
1346
+ schemaName: h.schemaName,
1347
+ name: h.name,
1348
+ option: h.dimensionOptions[0],
1349
+ label: `_${h.label}`,
1350
+ hide: !0
1351
+ }
1352
+ }, h.joinConditionOperators.includes(i.value.operator) || u(h.joinConditionOperators[0]));
1353
+ }
1354
+ function c(h, r) {
1355
+ var j, Y, w, m;
1356
+ if (i.value && r >= 0 && (i.value && h.schemaName !== ((Y = (j = i.value) == null ? void 0 : j.mainDimensions[r]) == null ? void 0 : Y.schemaName) || h.name !== ((m = (w = i.value) == null ? void 0 : w.mainDimensions[r]) == null ? void 0 : m.name))) {
1357
+ const _ = [...i.value.mainDimensions];
1358
+ _[r] = {
1359
+ schemaName: h.schemaName,
1360
+ name: h.name,
1361
+ option: h.dimensionOptions[0],
1362
+ label: h.label,
1363
+ hide: !0
1364
+ }, i.value = {
1365
+ ...i.value,
1366
+ mainDimensions: _
1367
+ };
1368
+ }
1369
+ }
1370
+ function u(h) {
1371
+ if (i.value)
1372
+ switch (h) {
1373
+ case Yl.Between:
1374
+ i.value = {
1375
+ ...i.value,
1376
+ operator: h,
1377
+ mainDimensions: [null, null]
1378
+ };
1379
+ break;
1380
+ default:
1381
+ i.value = {
1382
+ ...i.value,
1383
+ operator: h,
1384
+ mainDimensions: [null]
1385
+ };
1386
+ break;
1387
+ }
1388
+ }
1389
+ function A() {
1390
+ const h = [...g.value.map((r) => r.value)];
1391
+ i.value && (i.value.mainDimensions = i.value.mainDimensions.filter(
1392
+ (r) => r !== "" && r != null
1393
+ ), $.value !== void 0 ? h[$.value] = i.value : h.push(i.value)), n.value = h, C.value = !1;
1394
+ }
1395
+ function L(h) {
1396
+ const r = [...g.value.map((j) => j.value)];
1397
+ r.splice(h, 1), n.value = r;
1398
+ }
1399
+ return (h, r) => {
1400
+ const j = M("FmMenuDivider"), Y = M("FmForm"), w = M("FmIcon"), m = M("FmButton"), _ = M("FmListItem"), x = M("FmList"), le = M("FmField");
1401
+ return f(), P("div", _t, [
1402
+ p(Pe, {
1403
+ modelValue: C.value,
1404
+ "onUpdate:modelValue": r[2] || (r[2] = (J) => C.value = J),
1405
+ title: S.value,
1406
+ onConfirm: A
1407
+ }, {
1408
+ content: K(() => [
1409
+ p(Y, {
1410
+ ref: "form",
1411
+ class: "flex flex-col gap-2 w-[490px]"
1412
+ }, {
1413
+ default: K(() => {
1414
+ var J, G, d, t, a;
1415
+ return [
1416
+ p(be, {
1417
+ label: l(v)("report.section.condition.joinDatasource"),
1418
+ "model-value": s.value,
1419
+ items: F.value,
1420
+ placeholder: l(v)("report.section.condition.joinDimension"),
1421
+ "onUpdate:modelValue": r[0] || (r[0] = (N) => B(N))
1422
+ }, null, 8, ["label", "model-value", "items", "placeholder"]),
1423
+ p(j),
1424
+ (J = i.value) != null && J.joinDimension && (((G = s.value) == null ? void 0 : G.dimensionOptions) || []).length > 0 ? (f(), R(be, {
1425
+ key: 0,
1426
+ modelValue: i.value.joinDimension.option,
1427
+ "onUpdate:modelValue": r[1] || (r[1] = (N) => i.value.joinDimension.option = N),
1428
+ label: l(v)("report.section.condition.format"),
1429
+ items: ((d = s.value) == null ? void 0 : d.dimensionOptions.map((N) => ({
1430
+ label: l(e)(`report.section.filter.${l(Oe)(N)}`) ? l(v)(`report.section.filter.${l(Oe)(N)}`) : N,
1431
+ value: N
1432
+ }))) ?? []
1433
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1434
+ i.value && (((t = s.value) == null ? void 0 : t.joinConditionOperators) || []).length > 0 ? (f(), R(be, {
1435
+ key: 1,
1436
+ "model-value": i.value.operator,
1437
+ label: l(v)("report.section.condition.operator"),
1438
+ items: s.value.joinConditionOperators.map((N) => ({
1439
+ label: l(v)("report.section.comparisonOperator." + N),
1440
+ value: N
1441
+ })) ?? [],
1442
+ "onUpdate:modelValue": u
1443
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1444
+ (f(!0), P(ue, null, Se(((a = i.value) == null ? void 0 : a.mainDimensions) || [], (N, ae) => {
1445
+ var se, me;
1446
+ return f(), P("div", {
1447
+ key: ae,
1448
+ class: "flex flex-col gap-2"
1449
+ }, [
1450
+ p(be, {
1451
+ "model-value": y.value[ae],
1452
+ label: l(v)("report.section.condition.mainDatasource", { index: ae + 1 }),
1453
+ items: o.mainFieldOptions.map((Q) => ({
1454
+ label: Q.labels.join(" "),
1455
+ value: Q
1456
+ })),
1457
+ "onUpdate:modelValue": (Q) => c(Q, ae)
1458
+ }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1459
+ N && (((se = y.value[ae]) == null ? void 0 : se.dimensionOptions) || []).length > 0 && N ? (f(), R(be, {
1460
+ key: 0,
1461
+ modelValue: N.option,
1462
+ "onUpdate:modelValue": (Q) => N.option = Q,
1463
+ items: (me = y.value[ae]) == null ? void 0 : me.dimensionOptions.map((Q) => ({
1464
+ label: l(e)(`report.section.filter.${l(Oe)(Q)}`) ? l(v)(`report.section.filter.${l(Oe)(Q)}`) : Q,
1465
+ value: Q
1466
+ }))
1467
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : z("", !0),
1468
+ p(j)
1469
+ ]);
1470
+ }), 128))
1471
+ ];
1472
+ }),
1473
+ _: 1
1474
+ }, 512)
1475
+ ]),
1476
+ _: 1
1477
+ }, 8, ["modelValue", "title"]),
1478
+ b("div", null, [
1479
+ b("p", Tt, q(S.value), 1),
1480
+ b("p", $t, q(l(v)("report.section.condition.description")), 1)
1481
+ ]),
1482
+ p(x, { class: "flex flex-col gap-2" }, {
1483
+ default: K(() => [
1484
+ p(l(Ke), {
1485
+ list: n.value,
1486
+ "item-key": (J) => {
1487
+ var G, d;
1488
+ return `${(G = J.joinDimension) == null ? void 0 : G.schemaName}:${(d = J.joinDimension) == null ? void 0 : d.name}`;
1489
+ },
1490
+ class: "flex flex-col gap-2 w-full"
1491
+ }, {
1492
+ item: K(({
1493
+ element: J,
1494
+ index: G
1495
+ }) => [
1496
+ p(_, {
1497
+ class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1498
+ onClick: we((d) => O(g.value[G]), ["stop"])
1499
+ }, {
1500
+ default: K(() => [
1501
+ p(w, { name: "drag_handle" }),
1502
+ b("p", Dt, q(g.value[G].label), 1),
1503
+ r[4] || (r[4] = b("div", { class: "grow" }, null, -1)),
1504
+ p(m, {
1505
+ icon: "close",
1506
+ size: "md",
1507
+ variant: "tertiary",
1508
+ onClick: we((d) => L(G), ["stop"])
1509
+ }, null, 8, ["onClick"])
1510
+ ]),
1511
+ _: 2
1512
+ }, 1032, ["onClick"])
1513
+ ]),
1514
+ _: 1
1515
+ }, 8, ["list", "item-key"])
1516
+ ]),
1517
+ _: 1
1518
+ }),
1519
+ p(le, {
1520
+ class: "text-fm-color-typo-tertiary cursor-pointer",
1521
+ onClick: r[3] || (r[3] = (J) => O())
1522
+ }, {
1523
+ default: K(() => [
1524
+ Ie(q(l(v)("report.section.condition.add")), 1)
1525
+ ]),
1526
+ _: 1
1527
+ })
1528
+ ]);
1529
+ };
1530
+ }
1531
+ }), bl = /* @__PURE__ */ de({
1532
+ __name: "Datasource",
1533
+ props: /* @__PURE__ */ ve({
1534
+ label: {
1535
+ type: String,
1536
+ default: "Label"
1537
+ },
1538
+ config: {
1539
+ type: Object,
1540
+ default: null
1541
+ },
1542
+ closeable: {
1543
+ type: Boolean,
1544
+ default: !1
1545
+ },
1546
+ mainDatasourceConfig: {
1547
+ type: Object,
1548
+ default: () => {
1549
+ }
1550
+ },
1551
+ modelValue: {
1552
+ type: Object,
1553
+ default: () => {
1554
+ }
1555
+ }
1556
+ }, {
1557
+ modelValue: { required: !0 },
1558
+ modelModifiers: {}
1559
+ }),
1560
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
1561
+ setup(U, { emit: v }) {
1562
+ const e = ge(U, "modelValue");
1563
+ Ce(
1564
+ [() => e.value.dimensions, () => e.value.metrics],
1565
+ () => {
1566
+ const { rowIds: _, columnIds: x } = Ye(e.value);
1567
+ e.value.rowIds = _, e.value.columnIds = x;
1568
+ },
1569
+ { deep: !0 }
1570
+ );
1571
+ const n = U, o = v, { schemas: S } = Ne(kl()), { editingReport: C } = Ne(Fl()), g = V(() => {
1572
+ var _;
1573
+ return ((_ = C.value) == null ? void 0 : _.queryVersion) === "v2";
1574
+ }), { t: $, te: O, locale: i } = pe(), s = V(() => !n.mainDatasourceConfig), y = V(
1575
+ () => [H.BarChart, H.LineChart, H.Scorecard].includes(n.config.type)
1576
+ ), F = V(() => [...e.value.dimensions].filter((_) => !_.hide)), B = V(() => n.config.type === H.Scorecard), c = V(() => e.value.sparklineType === "PROGRESS"), u = V({
1577
+ get: () => e.value.sparklineTargetValue ?? null,
1578
+ set: (_) => {
1579
+ e.value.sparklineTargetValue = _ ?? void 0;
1580
+ }
1581
+ }), A = V(
1582
+ () => {
1583
+ var _;
1584
+ return (((_ = n.mainDatasourceConfig) == null ? void 0 : _.schemaNames) || []).reduce(
1585
+ (x, le) => {
1586
+ const J = S.value.find((G) => G.name === le);
1587
+ return J && (x = [
1588
+ ...x,
1589
+ ...J.fields.map((G) => ({
1590
+ ...G,
1591
+ labels: [
1592
+ re($, O, J.label, "schema"),
1593
+ re($, O, G.label || G.name, "other")
1594
+ ]
1595
+ }))
1596
+ ]), x;
1597
+ },
1598
+ []
1599
+ );
1600
+ }
1601
+ ), L = V(
1602
+ () => e.value.schemaNames.reduce((_, x) => {
1603
+ const le = S.value.find((J) => J.name === x);
1604
+ return le && (_ = [
1605
+ ..._,
1606
+ ...le.fields.map((J) => ({
1607
+ ...J,
1608
+ labels: [
1609
+ re($, O, le.label, "schema"),
1610
+ re($, O, J.label || J.name, "other")
1611
+ ]
1612
+ }))
1613
+ ]), _;
1614
+ }, [])
1615
+ ), h = V(() => [
1616
+ { label: $("report.section.datasource.none"), value: null },
1617
+ { label: $("report.section.datasource.grandTotal"), value: 0 },
1618
+ ...[...F.value].slice(0, F.value.length - 1).map((_, x) => ({
1619
+ label: re($, O, _.label, "other"),
1620
+ value: x + 1
1621
+ }))
1622
+ ]), r = V(() => [
1623
+ {
1624
+ label: $("report.section.datasource.position.top"),
1625
+ value: gl.top
1626
+ },
1627
+ {
1628
+ label: $("report.section.datasource.position.bottom"),
1629
+ value: gl.bottom
1630
+ }
1631
+ ]), j = V(
1632
+ () => `rollup-${i.value}-${F.value.map((_) => Ve(_)).join("|")}`
1633
+ ), Y = V(() => [
1634
+ {
1635
+ label: $("report.section.datasource.none"),
1636
+ value: null
1637
+ },
1638
+ ...Object.keys(fl).map((_) => ({
1639
+ label: O(`report.section.datasource.periodType.${_}`) ? $(`report.section.datasource.periodType.${_}`) : _,
1640
+ value: fl[_]
1641
+ }))
1642
+ ]), w = V(() => [
1643
+ { label: $("report.section.datasource.joinType.left"), value: "LEFT" },
1644
+ { label: $("report.section.datasource.joinType.fullOuter"), value: "FULL_OUTER" }
1645
+ ]), m = V(() => [
1646
+ { label: $("report.section.datasource.sparklineType.line"), value: "LINECHART" },
1647
+ { label: $("report.section.datasource.sparklineType.bar"), value: "BARCHART" },
1648
+ { label: $("report.section.datasource.sparklineType.stackedBar"), value: "STACKBARCHART" },
1649
+ { label: $("report.section.datasource.sparklineType.progress"), value: "PROGRESS" }
1650
+ ]);
1651
+ return (_, x) => {
1652
+ const le = M("FmButton"), J = M("FmSwitch"), G = M("FmSelect"), d = M("FmTextField"), t = M("FmStepperField");
1653
+ return f(), R(al, null, {
1654
+ header: K(() => [
1655
+ b("p", null, q(n.label), 1),
1656
+ x[25] || (x[25] = b("div", { class: "grow" }, null, -1)),
1657
+ n.closeable ? (f(), R(le, {
1658
+ key: 0,
1659
+ icon: "close",
1660
+ variant: "tertiary",
1661
+ size: "md",
1662
+ onClick: x[0] || (x[0] = we((a) => o("click-close"), ["stop"]))
1663
+ })) : z("", !0)
1664
+ ]),
1665
+ content: K(() => [
1666
+ p(rt, {
1667
+ modelValue: e.value,
1668
+ "onUpdate:modelValue": x[1] || (x[1] = (a) => e.value = a),
1669
+ label: l($)("report.section.schema.title")
1670
+ }, null, 8, ["modelValue", "label"]),
1671
+ p(tl, {
1672
+ modelValue: e.value.dimensions,
1673
+ "onUpdate:modelValue": x[2] || (x[2] = (a) => e.value.dimensions = a),
1674
+ options: L.value,
1675
+ config: e.value,
1676
+ max: n.config.maxDimension,
1677
+ "has-row-column": !0,
1678
+ onConfig: x[3] || (x[3] = (a) => {
1679
+ e.value = a;
1680
+ })
1681
+ }, null, 8, ["modelValue", "options", "config", "max"]),
1682
+ p(J, {
1683
+ "label-placement": "right",
1684
+ label: l($)("report.section.datasource.comparable"),
1685
+ "model-value": e.value.isComparable ?? !1,
1686
+ "onUpdate:modelValue": x[4] || (x[4] = (a) => {
1687
+ e.value.isComparable = a;
1688
+ })
1689
+ }, null, 8, ["label", "model-value"]),
1690
+ y.value ? (f(), R(J, {
1691
+ key: 0,
1692
+ "label-placement": "right",
1693
+ label: l($)("report.section.datasource.cumulative"),
1694
+ "model-value": e.value.isCumulative ?? !1,
1695
+ "onUpdate:modelValue": x[5] || (x[5] = (a) => {
1696
+ e.value.isCumulative = a;
1697
+ })
1698
+ }, null, 8, ["label", "model-value"])) : z("", !0),
1699
+ n.config.isDrillConfigurable && s.value ? (f(), R(J, {
1700
+ key: 1,
1701
+ label: l($)("report.section.datasource.drill"),
1702
+ "label-placement": "right",
1703
+ "model-value": e.value.isDrillable ?? !1,
1704
+ "onUpdate:modelValue": x[6] || (x[6] = (a) => {
1705
+ e.value.isDrillable = a;
1706
+ })
1707
+ }, null, 8, ["label", "model-value"])) : z("", !0),
1708
+ s.value ? (f(), R(J, {
1709
+ key: 2,
1710
+ modelValue: e.value.isBlend,
1711
+ "onUpdate:modelValue": x[7] || (x[7] = (a) => e.value.isBlend = a),
1712
+ label: l($)("report.section.datasource.blend"),
1713
+ "label-placement": "right"
1714
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1715
+ n.config.canRollup && s.value ? (f(), R(G, {
1716
+ key: j.value,
1717
+ modelValue: e.value.rollup,
1718
+ "onUpdate:modelValue": x[8] || (x[8] = (a) => e.value.rollup = a),
1719
+ label: l($)("report.section.datasource.subTotal"),
1720
+ items: h.value
1721
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1722
+ n.config.showRollupPosition && s.value ? (f(), R(G, {
1723
+ key: `rollup-position-${l(i)}`,
1724
+ modelValue: e.value.rollupPosition,
1725
+ "onUpdate:modelValue": x[9] || (x[9] = (a) => e.value.rollupPosition = a),
1726
+ label: l($)("report.section.datasource.position.showPosition"),
1727
+ items: r.value
1728
+ }, null, 8, ["modelValue", "label", "items"])) : z("", !0),
1729
+ n.config.type === l(H).Table && s.value ? (f(), R(d, {
1730
+ key: 5,
1731
+ modelValue: e.value.grandTotalLabel,
1732
+ "onUpdate:modelValue": x[10] || (x[10] = (a) => e.value.grandTotalLabel = a),
1733
+ label: l($)("report.section.datasource.grandTotalLabel"),
1734
+ placeholder: l($)("report.section.datasource.grandTotal")
1735
+ }, null, 8, ["modelValue", "label", "placeholder"])) : z("", !0),
1736
+ s.value ? z("", !0) : (f(), R(G, {
1737
+ key: `periodType-${l(i)}`,
1738
+ modelValue: e.value.periodType,
1739
+ "onUpdate:modelValue": x[11] || (x[11] = (a) => e.value.periodType = a),
1740
+ label: l($)("report.section.datasource.periodType.label"),
1741
+ items: Y.value
1742
+ }, null, 8, ["modelValue", "label", "items"])),
1743
+ n.config.canTranspose && s.value ? (f(), R(J, {
1744
+ key: 7,
1745
+ modelValue: e.value.isTransposed,
1746
+ "onUpdate:modelValue": x[12] || (x[12] = (a) => e.value.isTransposed = a),
1747
+ label: l($)("report.section.datasource.transpose"),
1748
+ "label-placement": "right"
1749
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1750
+ n.config.hasBreakdownDimension ? (f(), R(tl, {
1751
+ key: 8,
1752
+ "model-value": e.value.breakdownDimension ? [e.value.breakdownDimension] : [],
1753
+ label: "breakdownDimension",
1754
+ max: 1,
1755
+ options: L.value,
1756
+ config: e.value,
1757
+ "onUpdate:modelValue": x[13] || (x[13] = (a) => {
1758
+ e.value.breakdownDimension = a[0];
1759
+ })
1760
+ }, null, 8, ["model-value", "options", "config"])) : z("", !0),
1761
+ B.value && !c.value ? (f(), R(tl, {
1762
+ key: 9,
1763
+ "model-value": e.value.sparklineDimension ? [e.value.sparklineDimension] : [],
1764
+ label: "sparklineDimension",
1765
+ max: 1,
1766
+ options: L.value,
1767
+ config: e.value,
1768
+ "onUpdate:modelValue": x[14] || (x[14] = (a) => {
1769
+ e.value.sparklineDimension = a[0];
1770
+ })
1771
+ }, null, 8, ["model-value", "options", "config"])) : z("", !0),
1772
+ B.value && g.value ? (f(), R(G, {
1773
+ key: `sparklineType-${l(i)}`,
1774
+ "model-value": e.value.sparklineType ?? "LINECHART",
1775
+ label: l($)("report.section.datasource.sparklineType.label"),
1776
+ items: m.value,
1777
+ "onUpdate:modelValue": x[15] || (x[15] = (a) => {
1778
+ e.value.sparklineType = a, a !== "STACKBARCHART" && (e.value.sparklinePercentOfTotal = void 0);
1779
+ })
1780
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1781
+ B.value && g.value && e.value.sparklineType === "STACKBARCHART" ? (f(), R(J, {
1782
+ key: 11,
1783
+ "model-value": e.value.sparklinePercentOfTotal ?? !1,
1784
+ label: l($)("report.section.datasource.sparklinePercentOfTotal"),
1785
+ "label-placement": "right",
1786
+ "onUpdate:modelValue": x[16] || (x[16] = (a) => {
1787
+ e.value.sparklinePercentOfTotal = a;
1788
+ })
1789
+ }, null, 8, ["model-value", "label"])) : z("", !0),
1790
+ B.value && g.value && c.value ? (f(), R(t, {
1791
+ key: 12,
1792
+ modelValue: u.value,
1793
+ "onUpdate:modelValue": x[17] || (x[17] = (a) => u.value = a),
1794
+ label: l($)("report.section.datasource.sparklineTargetValue"),
1795
+ type: "number",
1796
+ min: 0
1797
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
1798
+ p(bt, {
1799
+ modelValue: e.value.metrics,
1800
+ "onUpdate:modelValue": x[18] || (x[18] = (a) => e.value.metrics = a),
1801
+ options: L.value,
1802
+ max: n.config.maxMetric,
1803
+ config: e.value,
1804
+ "has-row-column": n.config.type === l(H).Table,
1805
+ "has-percent-of-total": g.value,
1806
+ "has-xy": n.config.hasXy,
1807
+ onConfig: x[19] || (x[19] = (a) => {
1808
+ e.value = a;
1809
+ })
1810
+ }, null, 8, ["modelValue", "options", "max", "config", "has-row-column", "has-percent-of-total", "has-xy"]),
1811
+ p(Wl, {
1812
+ modelValue: e.value.filters,
1813
+ "onUpdate:modelValue": x[20] || (x[20] = (a) => e.value.filters = a),
1814
+ options: L.value,
1815
+ dimensions: e.value.dimensions,
1816
+ "breakdown-dimension": e.value.breakdownDimension,
1817
+ metrics: e.value.metrics
1818
+ }, null, 8, ["modelValue", "options", "dimensions", "breakdown-dimension", "metrics"]),
1819
+ p(kt, {
1820
+ modelValue: e.value.sorts,
1821
+ "onUpdate:modelValue": x[21] || (x[21] = (a) => e.value.sorts = a),
1822
+ options: L.value,
1823
+ dimensions: e.value.dimensions,
1824
+ "breakdown-dimension": e.value.breakdownDimension,
1825
+ metrics: e.value.metrics
1826
+ }, null, 8, ["modelValue", "options", "dimensions", "breakdown-dimension", "metrics"]),
1827
+ p(St, {
1828
+ modelValue: e.value.limit,
1829
+ "onUpdate:modelValue": x[22] || (x[22] = (a) => e.value.limit = a)
1830
+ }, null, 8, ["modelValue"]),
1831
+ e.value.conditions && g.value ? (f(), R(G, {
1832
+ key: 13,
1833
+ "model-value": e.value.joinType ?? "LEFT",
1834
+ label: l($)("report.section.datasource.joinType.label"),
1835
+ items: w.value,
1836
+ "onUpdate:modelValue": x[23] || (x[23] = (a) => {
1837
+ e.value.joinType = a;
1838
+ })
1839
+ }, null, 8, ["model-value", "label", "items"])) : z("", !0),
1840
+ e.value.conditions ? (f(), R(Ut, {
1841
+ key: 14,
1842
+ modelValue: e.value.conditions,
1843
+ "onUpdate:modelValue": x[24] || (x[24] = (a) => e.value.conditions = a),
1844
+ "join-field-options": L.value,
1845
+ "main-field-options": A.value
1846
+ }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : z("", !0)
1847
+ ]),
1848
+ _: 1
1849
+ });
1850
+ };
1851
+ }
1852
+ }), Bt = { class: "fm-typo-en-title-sm-600" }, Je = /* @__PURE__ */ de({
1853
+ __name: "TileEditorTabHeader",
1854
+ props: /* @__PURE__ */ ve({
1855
+ icon: {
1856
+ type: String,
1857
+ required: !0
1858
+ },
1859
+ title: {
1860
+ type: String,
1861
+ default: void 0
1862
+ }
1863
+ }, {
1864
+ modelValue: { type: Boolean, required: !0, default: !1 },
1865
+ modelModifiers: {}
1866
+ }),
1867
+ emits: ["update:modelValue"],
1868
+ setup(U) {
1869
+ const { t: v } = pe(), e = ge(U, "modelValue"), n = U, o = V(() => n.title || v("report.tile.setting"));
1870
+ return (S, C) => {
1871
+ const g = M("FmIcon");
1872
+ return f(), P("div", {
1873
+ class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1874
+ onClick: C[0] || (C[0] = ($) => e.value = !e.value)
1875
+ }, [
1876
+ b("p", Bt, q(o.value), 1),
1877
+ C[1] || (C[1] = b("div", { class: "grow" }, null, -1)),
1878
+ p(g, {
1879
+ name: n.icon
1880
+ }, null, 8, ["name"])
1881
+ ]);
1882
+ };
1883
+ }
1884
+ }), At = /* @__PURE__ */ de({
1885
+ __name: "TileEditorTabDesktop",
1886
+ props: {
1887
+ modelValue: { required: !0, default: !1 },
1888
+ modelModifiers: {}
1889
+ },
1890
+ emits: ["update:modelValue"],
1891
+ setup(U) {
1892
+ const v = ge(U, "modelValue"), { t: e } = pe();
1893
+ return (n, o) => (f(), P(ue, null, [
1894
+ p(Je, {
1895
+ modelValue: v.value,
1896
+ "onUpdate:modelValue": o[0] || (o[0] = (S) => v.value = S),
1897
+ icon: "keyboard_double_arrow_left",
1898
+ title: l(e)("report.tile.setupSetting")
1899
+ }, null, 8, ["modelValue", "title"]),
1900
+ wl(n.$slots, "default")
1901
+ ], 64));
1902
+ }
1903
+ }), Lt = { class: "fixed bottom-0 w-full" }, Mt = /* @__PURE__ */ de({
1904
+ __name: "TileEditorTabMobile",
1905
+ props: {
1906
+ modelValue: { required: !0, default: !1 },
1907
+ modelModifiers: {}
1908
+ },
1909
+ emits: ["update:modelValue"],
1910
+ setup(U) {
1911
+ const v = ge(U, "modelValue");
1912
+ return (e, n) => {
1913
+ const o = M("FmTopSheet");
1914
+ return f(), P("div", Lt, [
1915
+ p(Je, {
1916
+ modelValue: v.value,
1917
+ "onUpdate:modelValue": n[0] || (n[0] = (S) => v.value = S),
1918
+ icon: "keyboard_double_arrow_up"
1919
+ }, null, 8, ["modelValue"]),
1920
+ p(o, {
1921
+ modelValue: v.value,
1922
+ "onUpdate:modelValue": n[2] || (n[2] = (S) => v.value = S),
1923
+ "fullscreen-size": "sm"
1924
+ }, {
1925
+ default: K(() => [
1926
+ p(Je, {
1927
+ modelValue: v.value,
1928
+ "onUpdate:modelValue": n[1] || (n[1] = (S) => v.value = S),
1929
+ icon: "keyboard_double_arrow_down"
1930
+ }, null, 8, ["modelValue"]),
1931
+ v.value ? wl(e.$slots, "default", { key: 0 }) : z("", !0)
1932
+ ]),
1933
+ _: 3
1934
+ }, 8, ["modelValue"])
1935
+ ]);
1936
+ };
1937
+ }
1938
+ });
1939
+ function Dl(U, v = 600) {
1940
+ const e = te(null);
1941
+ function n() {
1942
+ U.value = !0, e.value && clearTimeout(e.value), e.value = setTimeout(() => {
1943
+ U.value = !1, e.value = null;
1944
+ }, v);
1945
+ }
1946
+ function o() {
1947
+ e.value && (clearTimeout(e.value), e.value = null), U.value = !1;
1948
+ }
1949
+ return il(() => {
1950
+ o();
1951
+ }), {
1952
+ markStyleEditing: n,
1953
+ resetStyleEditing: o
1954
+ };
1955
+ }
1956
+ const Ot = { class: "flex flex-col gap-5" }, jt = { class: "fm-typo-en-body-lg-600" }, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Rt = { class: "flex gap-16" }, zt = { class: "flex flex-col gap-8 max-w-[120px]" }, It = { class: "fm-typo-en-body-lg-600" }, Pt = { class: "flex flex-col gap-16" }, Et = { class: "fm-typo-en-body-lg-600" }, Wt = { class: "flex flex-row gap-8" }, Xt = /* @__PURE__ */ de({
1957
+ __name: "TitleSection",
1958
+ props: /* @__PURE__ */ ve({
1959
+ title: {},
1960
+ description: {},
1961
+ showSearchToggle: { type: Boolean },
1962
+ model: {}
1963
+ }, {
1964
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
1965
+ isEditingStyleModifiers: {}
1966
+ }),
1967
+ emits: /* @__PURE__ */ ve(["update:model", "update:title", "update:description"], ["update:isEditingStyle"]),
1968
+ setup(U, { emit: v }) {
1969
+ const e = ge(U, "isEditingStyle"), { markStyleEditing: n } = Dl(e), o = U, S = v, { t: C } = pe(), g = qe((u) => {
1970
+ S("update:title", u);
1971
+ }, 500), $ = V({
1972
+ get: () => o.title ?? "",
1973
+ set: (u) => {
1974
+ n(), g(u);
1975
+ }
1976
+ }), O = V({
1977
+ get: () => o.description ?? "",
1978
+ set: (u) => {
1979
+ n(), S("update:description", u);
1980
+ }
1981
+ }), i = V({
1982
+ get: () => o.model.showTitle ?? !0,
1983
+ set: (u) => {
1984
+ n(), S("update:model", { ...o.model, showTitle: u });
1985
+ }
1986
+ }), s = V({
1987
+ get: () => o.model.showSearchBar ?? !0,
1988
+ set: (u) => {
1989
+ n(), S("update:model", { ...o.model, showSearchBar: u });
1990
+ }
1991
+ }), y = V({
1992
+ get: () => o.model.titleFontSize ?? 14,
1993
+ set: (u) => {
1994
+ n(), S("update:model", { ...o.model, titleFontSize: Math.min(Number(u), 24) });
1995
+ }
1996
+ }), F = V({
1997
+ get: () => o.model.titleBold ?? !1,
1998
+ set: (u) => {
1999
+ n(), S("update:model", { ...o.model, titleBold: u });
2000
+ }
2001
+ }), B = V({
2002
+ get: () => o.model.titleItalic ?? !1,
2003
+ set: (u) => {
2004
+ n(), S("update:model", { ...o.model, titleItalic: u });
2005
+ }
2006
+ }), c = V({
2007
+ get: () => o.model.titleUnderline ?? !1,
2008
+ set: (u) => {
2009
+ n(), S("update:model", { ...o.model, titleUnderline: u });
2010
+ }
2011
+ });
2012
+ return (u, A) => {
2013
+ const L = M("FmTextField"), h = M("FmTextarea"), r = M("FmStepperField"), j = M("FmButton"), Y = M("FmSwitch");
2014
+ return f(), P(ue, null, [
2015
+ b("div", Ot, [
2016
+ p(L, {
2017
+ modelValue: $.value,
2018
+ "onUpdate:modelValue": A[0] || (A[0] = (w) => $.value = w),
2019
+ label: l(C)("report.tile.widget.title"),
2020
+ placeholder: l(C)("report.tile.widget.titlePlaceholder")
2021
+ }, null, 8, ["modelValue", "label", "placeholder"]),
2022
+ p(h, {
2023
+ modelValue: O.value,
2024
+ "onUpdate:modelValue": A[1] || (A[1] = (w) => O.value = w),
2025
+ disabled: $.value === "",
2026
+ placeholder: l(C)("report.tile.widget.descriptionPlaceholder"),
2027
+ "helper-text": l(C)("report.tile.widget.descriptionHelper")
2028
+ }, {
2029
+ label: K(() => [
2030
+ b("p", jt, q(l(C)("report.tile.widget.widgetDescription")), 1),
2031
+ b("p", Nt, " (" + q(l(C)("report.tile.widget.optional")) + ") ", 1)
2032
+ ]),
2033
+ _: 1
2034
+ }, 8, ["modelValue", "disabled", "placeholder", "helper-text"]),
2035
+ b("div", Rt, [
2036
+ b("div", zt, [
2037
+ b("p", It, q(l(C)("report.section.datasource.title.titleFontSize")), 1),
2038
+ p(r, {
2039
+ modelValue: y.value,
2040
+ "onUpdate:modelValue": A[2] || (A[2] = (w) => y.value = w),
2041
+ max: 24,
2042
+ min: 1,
2043
+ type: "number"
2044
+ }, null, 8, ["modelValue"])
2045
+ ]),
2046
+ b("div", Pt, [
2047
+ b("p", Et, q(l(C)("report.section.datasource.title.textStyleFormat")), 1),
2048
+ b("div", Wt, [
2049
+ p(j, {
2050
+ "append-icon": "format_bold",
2051
+ "model-value": u.model.titleBold ?? !1,
2052
+ variant: "tertiary",
2053
+ "icon-color": u.model.titleBold ? "neutral-gray-400" : "neutral-gray-300",
2054
+ "bg-color": u.model.titleBold ? "neutral-gray-100" : "neutral-white",
2055
+ class: "rounded-sm",
2056
+ onClick: A[3] || (A[3] = (w) => F.value = !F.value)
2057
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
2058
+ p(j, {
2059
+ "append-icon": "format_italic",
2060
+ "model-value": u.model.titleItalic ?? !1,
2061
+ "icon-color": u.model.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
2062
+ "bg-color": u.model.titleItalic ? "neutral-gray-100" : "neutral-white",
2063
+ class: "rounded-sm",
2064
+ onClick: A[4] || (A[4] = (w) => B.value = !B.value)
2065
+ }, null, 8, ["model-value", "icon-color", "bg-color"]),
2066
+ p(j, {
2067
+ "append-icon": "format_underlined",
2068
+ "model-value": u.model.titleUnderline ?? !1,
2069
+ "icon-color": u.model.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
2070
+ "bg-color": u.model.titleUnderline ? "neutral-gray-100" : "neutral-white",
2071
+ class: "rounded-sm",
2072
+ onClick: A[5] || (A[5] = (w) => c.value = !c.value)
2073
+ }, null, 8, ["model-value", "icon-color", "bg-color"])
2074
+ ])
2075
+ ])
2076
+ ])
2077
+ ]),
2078
+ p(Y, {
2079
+ modelValue: i.value,
2080
+ "onUpdate:modelValue": A[6] || (A[6] = (w) => i.value = w),
2081
+ label: l(C)("report.section.datasource.title.showTitle"),
2082
+ "label-placement": "right"
2083
+ }, null, 8, ["modelValue", "label"]),
2084
+ o.showSearchToggle ? (f(), R(Y, {
2085
+ key: 0,
2086
+ modelValue: s.value,
2087
+ "onUpdate:modelValue": A[7] || (A[7] = (w) => s.value = w),
2088
+ label: l(C)("report.section.datasource.title.showSearchBar"),
2089
+ "label-placement": "right"
2090
+ }, null, 8, ["modelValue", "label"])) : z("", !0)
2091
+ ], 64);
2092
+ };
2093
+ }
2094
+ }), Ht = { class: "flex gap-16 justify-center items-center" }, qt = { class: "fm-typo-en-title-sm-600" }, Gt = { class: "h-[40x]" }, hl = "YYYY-MM-DD", Ul = /* @__PURE__ */ de({
2095
+ __name: "TileEditorTab",
2096
+ props: /* @__PURE__ */ ve({
2097
+ hideConfiguration: {
2098
+ type: Boolean,
2099
+ default: !1
2100
+ }
2101
+ }, {
2102
+ modelValue: {
2103
+ required: !0
2104
+ },
2105
+ modelModifiers: {},
2106
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
2107
+ isEditingStyleModifiers: {}
2108
+ }),
2109
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue", "update:isEditingStyle"]),
2110
+ setup(U, { emit: v }) {
2111
+ var j, Y;
2112
+ const e = tt(), { dateRange: n, timezone: o } = Ne(e), S = {
2113
+ startDate: n.value.startDate,
2114
+ endDate: n.value.endDate
2115
+ }, C = te({
2116
+ startDate: (j = He(n.value.startDate)) == null ? void 0 : j.tz(o.value).format(hl),
2117
+ endDate: (Y = He(n.value.endDate)) == null ? void 0 : Y.tz(o.value).format(hl)
2118
+ });
2119
+ Ce(
2120
+ C,
2121
+ () => {
2122
+ C.value.endDate || (C.value.endDate = C.value.startDate);
2123
+ const w = {
2124
+ startDate: He.tz(C.value.startDate, o.value).startOf("day").utc().toISOString(),
2125
+ endDate: He.tz(C.value.endDate, o.value).endOf("day").utc().toISOString()
2126
+ };
2127
+ n.value = w;
2128
+ },
2129
+ { deep: !0 }
2130
+ ), il(() => {
2131
+ n.value = { ...S };
2132
+ });
2133
+ const g = ge(U, "modelValue"), $ = ge(U, "isEditingStyle"), { breakpoints: O } = Sl(), i = U, { promptMessage: s } = Vl(), y = v, { t: F, locale: B } = pe();
2134
+ function c(w) {
2135
+ g.value = nl(w);
2136
+ }
2137
+ function u() {
2138
+ const w = [...g.value.widget.config.joinDatasources || []];
2139
+ w.push({ ...lt(g.value.widget.type), conditions: [] }), c({
2140
+ ...g.value,
2141
+ widget: {
2142
+ ...g.value.widget,
2143
+ config: {
2144
+ ...g.value.widget.config,
2145
+ joinDatasources: w
2146
+ }
2147
+ }
2148
+ });
2149
+ }
2150
+ async function A(w) {
2151
+ if (!await s({
2152
+ title: F("report.tile.datasource.remove"),
2153
+ message: F("report.tile.datasource.confirmRemove", { index: w + 1 })
2154
+ })) return;
2155
+ const _ = [...g.value.widget.config.joinDatasources || []];
2156
+ _.splice(w, 1), c({
2157
+ ...g.value,
2158
+ widget: {
2159
+ ...g.value.widget,
2160
+ config: {
2161
+ ...g.value.widget.config,
2162
+ joinDatasources: _
2163
+ }
2164
+ }
2165
+ });
2166
+ }
2167
+ const L = (w, m) => {
2168
+ let _ = 1, x = 1;
2169
+ switch (w) {
2170
+ case H.Scorecard:
2171
+ _ = 1, x = 2;
2172
+ break;
2173
+ case H.BarChart:
2174
+ case H.StackBarChart:
2175
+ case H.ClusteredStackBarChart:
2176
+ case H.LineChart:
2177
+ case H.StackLineChart:
2178
+ _ = 4, x = 6;
2179
+ break;
2180
+ case H.Table:
2181
+ _ = 4, x = 12;
2182
+ break;
2183
+ case H.Circular:
2184
+ _ = 4, x = 4;
2185
+ break;
2186
+ case H.Spacer:
2187
+ _ = 0, x = 12;
2188
+ break;
2189
+ }
2190
+ return {
2191
+ id: m.id,
2192
+ size: {
2193
+ height: _,
2194
+ width: x
2195
+ },
2196
+ widget: {
2197
+ ...m.widget,
2198
+ type: w
2199
+ }
2200
+ };
2201
+ }, h = V(
2202
+ () => Qe.find((w) => w.type === g.value.widget.type)
2203
+ ), r = V(() => g.value.widget.config.joinDatasources);
2204
+ return Ce(
2205
+ () => g.value.size.height,
2206
+ (w) => {
2207
+ w < 1 && (g.value.size.height = 1), w > 12 && (g.value.size.height = 12);
2208
+ }
2209
+ ), Ce(
2210
+ () => g.value.size.width,
2211
+ (w) => {
2212
+ w < 1 && (g.value.size.width = 1), w > 12 && (g.value.size.width = 12);
2213
+ }
2214
+ ), (w, m) => {
2215
+ const _ = M("FmCircularProgress"), x = M("FmSimpleDateRangePicker"), le = M("FmStepperField"), J = M("FmButton"), G = M("FmForm");
2216
+ return f(), R(Cl(l(O).lg || l(O).md ? At : Mt), {
2217
+ "model-value": i.hideConfiguration,
2218
+ "onUpdate:modelValue": m[10] || (m[10] = (d) => y("hideConfiguration", d))
2219
+ }, {
2220
+ default: K(() => [
2221
+ g.value ? (f(), R(G, {
2222
+ key: 1,
2223
+ ref: "form",
2224
+ class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2225
+ }, {
2226
+ default: K(() => [
2227
+ b("div", Ht, [
2228
+ (f(), R(x, {
2229
+ key: `date-picker-${l(B)}`,
2230
+ modelValue: C.value,
2231
+ "onUpdate:modelValue": m[0] || (m[0] = (d) => C.value = d)
2232
+ }, null, 8, ["modelValue"]))
2233
+ ]),
2234
+ p(al, null, {
2235
+ header: K(() => [
2236
+ b("p", qt, q(l(F)("report.tile.widget.details")), 1),
2237
+ m[11] || (m[11] = b("div", { class: "grow" }, null, -1))
2238
+ ]),
2239
+ content: K(() => [
2240
+ p(Xt, {
2241
+ "is-editing-style": $.value,
2242
+ "onUpdate:isEditingStyle": m[1] || (m[1] = (d) => $.value = d),
2243
+ title: g.value.widget.title,
2244
+ description: g.value.widget.description,
2245
+ model: g.value.widget.config,
2246
+ "show-search-toggle": g.value.widget.type === l(H).Table,
2247
+ "onUpdate:title": m[2] || (m[2] = (d) => g.value.widget.title = d),
2248
+ "onUpdate:description": m[3] || (m[3] = (d) => g.value.widget.description = d),
2249
+ "onUpdate:model": m[4] || (m[4] = (d) => g.value.widget.config = d)
2250
+ }, null, 8, ["is-editing-style", "title", "description", "model", "show-search-toggle"]),
2251
+ b("div", {
2252
+ class: Fe(["flex flex-row", `${l(O).sm || l(O).xs ? "gap-16" : "gap-2"}`])
2253
+ }, [
2254
+ p(le, {
2255
+ modelValue: g.value.size.width,
2256
+ "onUpdate:modelValue": m[5] || (m[5] = (d) => g.value.size.width = d),
2257
+ label: l(F)("report.tile.widget.width"),
2258
+ min: 1,
2259
+ max: 12
2260
+ }, null, 8, ["modelValue", "label"]),
2261
+ p(le, {
2262
+ modelValue: g.value.size.height,
2263
+ "onUpdate:modelValue": m[6] || (m[6] = (d) => g.value.size.height = d),
2264
+ label: l(F)("report.tile.widget.height"),
2265
+ min: 1,
2266
+ max: 12
2267
+ }, null, 8, ["modelValue", "label"])
2268
+ ], 2)
2269
+ ]),
2270
+ _: 1
2271
+ }),
2272
+ p(al, null, {
2273
+ header: K(() => [
2274
+ b("p", null, q(l(F)("report.tile.widget.type")), 1),
2275
+ m[12] || (m[12] = b("div", { class: "grow" }, null, -1))
2276
+ ]),
2277
+ content: K(() => [
2278
+ p(Xl, {
2279
+ "is-list": !0,
2280
+ "model-value": g.value.widget.type,
2281
+ class: "grid grid-cols-1 gap-2",
2282
+ "child-class": "flex flex-row p-[8px] gap-2",
2283
+ "exclude-widge-type": [l(H).Spacer],
2284
+ "onUpdate:modelValue": m[7] || (m[7] = (d) => g.value = L(d, g.value))
2285
+ }, null, 8, ["model-value", "exclude-widge-type"])
2286
+ ]),
2287
+ _: 1
2288
+ }),
2289
+ p(bl, {
2290
+ modelValue: g.value.widget.config,
2291
+ "onUpdate:modelValue": m[8] || (m[8] = (d) => g.value.widget.config = d),
2292
+ label: l(F)("report.tile.datasource.main"),
2293
+ config: h.value
2294
+ }, null, 8, ["modelValue", "label", "config"]),
2295
+ r.value ? (f(!0), P(ue, { key: 0 }, Se(r.value, (d, t) => (f(), P("div", { key: t }, [
2296
+ p(bl, {
2297
+ modelValue: r.value[t],
2298
+ "onUpdate:modelValue": (a) => r.value[t] = a,
2299
+ label: l(F)("report.tile.datasource.join", { index: t + 1 }),
2300
+ config: h.value,
2301
+ "main-datasource-config": g.value.widget.config,
2302
+ closeable: !0,
2303
+ onClickClose: (a) => A(t)
2304
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2305
+ ]))), 128)) : z("", !0),
2306
+ b("div", Gt, [
2307
+ p(J, {
2308
+ label: l(F)("report.tile.datasource.joinButton"),
2309
+ variant: "secondary",
2310
+ icon: "add",
2311
+ "icon-position": "prepend",
2312
+ "border-color": "primary",
2313
+ "text-color": "primary",
2314
+ class: "w-full",
2315
+ onClick: m[9] || (m[9] = (d) => u())
2316
+ }, null, 8, ["label"])
2317
+ ])
2318
+ ]),
2319
+ _: 1
2320
+ }, 512)) : (f(), R(_, { key: 0 }))
2321
+ ]),
2322
+ _: 1
2323
+ }, 8, ["model-value"]);
2324
+ };
2325
+ }
2326
+ }), Yt = { class: "flex flex-col gap-8" }, Jt = { class: "pl-32 flex flex-col gap-8" }, Kt = { class: "fm-typo-en-body-lg-600" }, Qt = { class: "flex flex-row gap-8" }, Zt = { class: "fm-typo-en-body-lg-600" }, eo = { class: "flex flex-row gap-8" }, lo = /* @__PURE__ */ de({
2327
+ __name: "LabelSection",
2328
+ props: {
2329
+ model: {}
2330
+ },
2331
+ emits: ["update:model"],
2332
+ setup(U, { emit: v }) {
2333
+ const e = U, n = v, { t: o } = pe(), S = V({
2334
+ get: () => e.model.showLabel ?? !1,
2335
+ set: (F) => {
2336
+ n("update:model", { ...e.model, showLabel: F });
2337
+ }
2338
+ }), C = V({
2339
+ get: () => e.model.labelRotation ?? 0,
2340
+ set: (F) => n("update:model", { ...e.model, labelRotation: F })
2341
+ }), g = V({
2342
+ get: () => e.model.labelOffset ?? 0,
2343
+ set: (F) => n("update:model", { ...e.model, labelOffset: F })
2344
+ }), $ = V({
2345
+ get: () => e.model.labelFontSize ?? 12,
2346
+ set: (F) => n("update:model", { ...e.model, labelFontSize: F })
2347
+ }), O = (F) => {
2348
+ n("update:model", {
2349
+ ...e.model,
2350
+ labelAlign: e.model.labelAlign === F ? void 0 : F
2351
+ });
2352
+ }, i = (F) => {
2353
+ n("update:model", {
2354
+ ...e.model,
2355
+ labelAnchor: e.model.labelAnchor === F ? void 0 : F
2356
+ });
2357
+ }, s = [
2358
+ { icon: "align_horizontal_left", value: Ae.left, tooltip: "alignLeft" },
2359
+ { icon: "align_justify_center", value: Ae.center, tooltip: "alignCenter" },
2360
+ { icon: "align_horizontal_right", value: Ae.right, tooltip: "alignRight" },
2361
+ { icon: "align_justify_flex_start", value: Ae.start, tooltip: "alignStart" },
2362
+ { icon: "align_justify_flex_end", value: Ae.end, tooltip: "alignEnd" },
2363
+ { icon: "align_flex_start", value: Ae.top, tooltip: "alignTop" },
2364
+ { icon: "align_flex_end", value: Ae.bottom, tooltip: "alignBottom" }
2365
+ ], y = [
2366
+ { icon: "format_align_left", value: el.start, tooltip: "anchorStart" },
2367
+ { icon: "format_align_center", value: el.center, tooltip: "anchorCenter" },
2368
+ { icon: "format_align_right", value: el.end, tooltip: "anchorEnd" }
2369
+ ];
2370
+ return (F, B) => {
2371
+ const c = M("FmCheckbox"), u = M("FmButton"), A = M("FmTooltip"), L = M("FmTextField"), h = M("FmStepperField");
2372
+ return f(), P("div", Yt, [
2373
+ p(c, {
2374
+ modelValue: S.value,
2375
+ "onUpdate:modelValue": B[0] || (B[0] = (r) => S.value = r),
2376
+ value: !1,
2377
+ label: l(o)("report.section.datasource.label.showLabel"),
2378
+ "label-placement": "right",
2379
+ class: "fm-typo-en-body-lg-400"
2380
+ }, null, 8, ["modelValue", "label"]),
2381
+ ke(b("div", Jt, [
2382
+ b("p", Kt, q(l(o)("report.section.datasource.alignment.textAlignment")), 1),
2383
+ b("div", Qt, [
2384
+ (f(), P(ue, null, Se(s, ({ icon: r, value: j, tooltip: Y }) => p(A, {
2385
+ key: j,
2386
+ variant: "plain",
2387
+ placement: "top",
2388
+ content: l(o)(`report.section.datasource.alignment.alignOptions.${Y}`),
2389
+ "z-index": 50
2390
+ }, {
2391
+ default: K(() => [
2392
+ p(u, {
2393
+ "append-icon": r,
2394
+ variant: "tertiary",
2395
+ "icon-color": F.model.labelAlign === j ? "neutral-gray-400" : "neutral-gray-300",
2396
+ "bg-color": F.model.labelAlign === j ? "neutral-gray-100" : "neutral-white",
2397
+ class: "rounded-sm",
2398
+ onClick: (w) => O(j)
2399
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2400
+ ]),
2401
+ _: 2
2402
+ }, 1032, ["content"])), 64))
2403
+ ]),
2404
+ b("p", Zt, q(l(o)("report.section.datasource.alignment.anchor")), 1),
2405
+ b("div", eo, [
2406
+ (f(), P(ue, null, Se(y, ({ icon: r, value: j, tooltip: Y }) => p(A, {
2407
+ key: j,
2408
+ variant: "plain",
2409
+ placement: "top",
2410
+ content: l(o)(`report.section.datasource.alignment.anchorOptions.${Y}`),
2411
+ "z-index": 50
2412
+ }, {
2413
+ default: K(() => [
2414
+ p(u, {
2415
+ "append-icon": r,
2416
+ variant: "tertiary",
2417
+ "icon-color": F.model.labelAnchor === j ? "neutral-gray-400" : "neutral-gray-300",
2418
+ "bg-color": F.model.labelAnchor === j ? "neutral-gray-100" : "neutral-white",
2419
+ class: "rounded-sm",
2420
+ onClick: (w) => i(j)
2421
+ }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2422
+ ]),
2423
+ _: 2
2424
+ }, 1032, ["content"])), 64))
2425
+ ]),
2426
+ p(L, {
2427
+ modelValue: C.value,
2428
+ "onUpdate:modelValue": B[1] || (B[1] = (r) => C.value = r),
2429
+ label: l(o)("report.section.datasource.alignment.rotation"),
2430
+ type: "number",
2431
+ min: -180,
2432
+ max: 180,
2433
+ step: 1
2434
+ }, null, 8, ["modelValue", "label"]),
2435
+ p(L, {
2436
+ modelValue: g.value,
2437
+ "onUpdate:modelValue": B[2] || (B[2] = (r) => g.value = r),
2438
+ label: l(o)("report.section.datasource.alignment.offset"),
2439
+ type: "number"
2440
+ }, null, 8, ["modelValue", "label"]),
2441
+ p(h, {
2442
+ modelValue: $.value,
2443
+ "onUpdate:modelValue": B[3] || (B[3] = (r) => $.value = r),
2444
+ label: l(o)("report.section.datasource.fontSize"),
2445
+ type: "number",
2446
+ min: 1
2447
+ }, null, 8, ["modelValue", "label"])
2448
+ ], 512), [
2449
+ [$e, S.value]
2450
+ ])
2451
+ ]);
2452
+ };
2453
+ }
2454
+ }), to = { class: "flex flex-col gap-8" }, oo = { class: "pl-32 flex flex-col gap-8" }, ao = { class: "pl-32 flex flex-col gap-8" }, no = { class: "pl-32 flex flex-col gap-8" }, io = { class: "pl-32 flex flex-col gap-8" }, so = { class: "pl-32 flex flex-col gap-8" }, ro = { class: "pl-32 flex flex-col gap-8" }, uo = /* @__PURE__ */ de({
2455
+ __name: "XySection",
2456
+ props: {
2457
+ model: {}
2458
+ },
2459
+ emits: ["update:model"],
2460
+ setup(U, { emit: v }) {
2461
+ const e = U, n = v, { t: o } = pe(), S = V({
2462
+ get: () => e.model.showX ?? !0,
2463
+ set: (c) => {
2464
+ n("update:model", { ...e.model, showX: c });
2465
+ }
2466
+ }), C = V({
2467
+ get: () => e.model.showXGrid ?? !1,
2468
+ set: (c) => {
2469
+ n("update:model", { ...e.model, showXGrid: c });
2470
+ }
2471
+ }), g = V({
2472
+ get: () => e.model.showXTick ?? !0,
2473
+ set: (c) => {
2474
+ n("update:model", { ...e.model, showXTick: c });
2475
+ }
2476
+ }), $ = V({
2477
+ get: () => e.model.showY ?? !0,
2478
+ set: (c) => {
2479
+ n("update:model", { ...e.model, showY: c });
2480
+ }
2481
+ }), O = V({
2482
+ get: () => e.model.showYGrid ?? !1,
2483
+ set: (c) => {
2484
+ n("update:model", { ...e.model, showYGrid: c });
2485
+ }
2486
+ }), i = V({
2487
+ get: () => e.model.showYTick ?? !0,
2488
+ set: (c) => {
2489
+ n("update:model", { ...e.model, showYTick: c });
2490
+ }
2491
+ }), s = V({
2492
+ get: () => e.model.showXTitle ?? !1,
2493
+ set: (c) => {
2494
+ n("update:model", { ...e.model, showXTitle: c });
2495
+ }
2496
+ }), y = V({
2497
+ get: () => e.model.showYTitle ?? !1,
2498
+ set: (c) => {
2499
+ n("update:model", { ...e.model, showYTitle: c });
2500
+ }
2501
+ }), F = qe((c) => {
2502
+ n("update:model", { ...e.model, xTitle: c });
2503
+ }, 500), B = qe((c) => {
2504
+ n("update:model", { ...e.model, yTitle: c });
2505
+ }, 500);
2506
+ return xl(() => {
2507
+ var c, u, A, L;
2508
+ !e.model.xTitle && ((u = (c = e.model.metrics) == null ? void 0 : c[0]) != null && u.label) && F(e.model.metrics[0].label), !e.model.yTitle && ((L = (A = e.model.dimensions) == null ? void 0 : A[0]) != null && L.label) && B(e.model.dimensions[0].label);
2509
+ }), (c, u) => {
2510
+ const A = M("FmCheckbox"), L = M("FmStepperField"), h = M("FmTextField");
2511
+ return f(), P("div", to, [
2512
+ p(A, {
2513
+ modelValue: S.value,
2514
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => S.value = r),
2515
+ label: l(o)("report.section.datasource.axis.showX"),
2516
+ "label-placement": "right",
2517
+ value: !0
2518
+ }, null, 8, ["modelValue", "label"]),
2519
+ ke(b("div", oo, [
2520
+ p(A, {
2521
+ modelValue: C.value,
2522
+ "onUpdate:modelValue": u[1] || (u[1] = (r) => C.value = r),
2523
+ label: l(o)("report.section.datasource.axis.showGrid"),
2524
+ "label-placement": "right",
2525
+ value: !1
2526
+ }, null, 8, ["modelValue", "label"]),
2527
+ p(A, {
2528
+ modelValue: g.value,
2529
+ "onUpdate:modelValue": u[2] || (u[2] = (r) => g.value = r),
2530
+ label: l(o)("report.section.datasource.axis.showTick"),
2531
+ "label-placement": "right",
2532
+ value: !0
2533
+ }, null, 8, ["modelValue", "label"]),
2534
+ ke(b("div", ao, [
2535
+ p(L, {
2536
+ label: l(o)("report.section.datasource.fontSize"),
2537
+ type: "number",
2538
+ "model-value": c.model.xTickFontSize ?? 12,
2539
+ min: 1,
2540
+ "onUpdate:modelValue": u[3] || (u[3] = (r) => {
2541
+ n("update:model", { ...c.model, xTickFontSize: Number(r) });
2542
+ })
2543
+ }, null, 8, ["label", "model-value"])
2544
+ ], 512), [
2545
+ [$e, c.model.showXTick ?? !0]
2546
+ ]),
2547
+ p(A, {
2548
+ modelValue: s.value,
2549
+ "onUpdate:modelValue": u[4] || (u[4] = (r) => s.value = r),
2550
+ label: l(o)("report.section.datasource.axis.showTitle"),
2551
+ "label-placement": "right",
2552
+ value: !0
2553
+ }, null, 8, ["modelValue", "label"]),
2554
+ ke(b("div", no, [
2555
+ p(h, {
2556
+ "model-value": c.model.xTitle,
2557
+ label: l(o)("report.common.title"),
2558
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2559
+ "onUpdate:modelValue": l(F)
2560
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2561
+ p(L, {
2562
+ label: l(o)("report.section.datasource.fontSize"),
2563
+ type: "number",
2564
+ "model-value": c.model.xTitleFontSize ?? 12,
2565
+ min: 1,
2566
+ "onUpdate:modelValue": u[5] || (u[5] = (r) => {
2567
+ n("update:model", { ...c.model, xTitleFontSize: Number(r) });
2568
+ })
2569
+ }, null, 8, ["label", "model-value"])
2570
+ ], 512), [
2571
+ [$e, s.value]
2572
+ ])
2573
+ ], 512), [
2574
+ [$e, c.model.showX ?? !0]
2575
+ ]),
2576
+ p(A, {
2577
+ modelValue: $.value,
2578
+ "onUpdate:modelValue": u[6] || (u[6] = (r) => $.value = r),
2579
+ label: l(o)("report.section.datasource.axis.showY"),
2580
+ "label-placement": "right",
2581
+ value: !0
2582
+ }, null, 8, ["modelValue", "label"]),
2583
+ ke(b("div", io, [
2584
+ p(A, {
2585
+ modelValue: O.value,
2586
+ "onUpdate:modelValue": u[7] || (u[7] = (r) => O.value = r),
2587
+ label: l(o)("report.section.datasource.axis.showGrid"),
2588
+ "label-placement": "right",
2589
+ value: !1
2590
+ }, null, 8, ["modelValue", "label"]),
2591
+ p(A, {
2592
+ modelValue: i.value,
2593
+ "onUpdate:modelValue": u[8] || (u[8] = (r) => i.value = r),
2594
+ label: l(o)("report.section.datasource.axis.showTick"),
2595
+ "label-placement": "right",
2596
+ value: !0
2597
+ }, null, 8, ["modelValue", "label"]),
2598
+ ke(b("div", so, [
2599
+ p(L, {
2600
+ label: l(o)("report.section.datasource.fontSize"),
2601
+ type: "number",
2602
+ "model-value": c.model.yTickFontSize ?? 12,
2603
+ min: 1,
2604
+ "onUpdate:modelValue": u[9] || (u[9] = (r) => {
2605
+ n("update:model", { ...c.model, yTickFontSize: Number(r) });
2606
+ })
2607
+ }, null, 8, ["label", "model-value"])
2608
+ ], 512), [
2609
+ [$e, c.model.showYTick ?? !0]
2610
+ ]),
2611
+ p(A, {
2612
+ modelValue: y.value,
2613
+ "onUpdate:modelValue": u[10] || (u[10] = (r) => y.value = r),
2614
+ label: l(o)("report.section.datasource.axis.showTitle"),
2615
+ "label-placement": "right",
2616
+ value: !0
2617
+ }, null, 8, ["modelValue", "label"]),
2618
+ ke(b("div", ro, [
2619
+ p(h, {
2620
+ "model-value": c.model.yTitle,
2621
+ label: l(o)("report.common.title"),
2622
+ placeholder: l(o)("report.tile.widget.titlePlaceholder"),
2623
+ "onUpdate:modelValue": l(B)
2624
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2625
+ p(L, {
2626
+ label: l(o)("report.section.datasource.fontSize"),
2627
+ type: "number",
2628
+ "model-value": c.model.yTitleFontSize ?? 12,
2629
+ min: 1,
2630
+ "onUpdate:modelValue": u[11] || (u[11] = (r) => {
2631
+ n("update:model", { ...c.model, yTitleFontSize: Number(r) });
2632
+ })
2633
+ }, null, 8, ["label", "model-value"])
2634
+ ], 512), [
2635
+ [$e, y.value]
2636
+ ])
2637
+ ], 512), [
2638
+ [$e, c.model.showY ?? !0]
2639
+ ])
2640
+ ]);
2641
+ };
2642
+ }
2643
+ }), mo = { class: "flex flex-col gap-8" }, co = { class: "pl-32 flex flex-col gap-8" }, po = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, vo = ["onKeydown"], fo = /* @__PURE__ */ de({
2644
+ __name: "LegendSection",
2645
+ props: {
2646
+ model: {},
2647
+ isCircularWidget: { type: Boolean }
2648
+ },
2649
+ emits: ["update:model"],
2650
+ setup(U, { emit: v }) {
2651
+ const e = U, n = v, { t: o } = pe(), S = [
2652
+ { label: o("report.section.datasource.position.top"), value: "top" },
2653
+ { label: o("report.section.datasource.position.bottom"), value: "bottom" },
2654
+ { label: o("report.section.datasource.position.left"), value: "left" },
2655
+ { label: o("report.section.datasource.position.right"), value: "right" }
2656
+ ], C = V({
2657
+ get: () => e.model.showLegend !== void 0 ? e.model.showLegend : e.isCircularWidget === !0,
2658
+ set: (B) => {
2659
+ n("update:model", { ...e.model, showLegend: B });
2660
+ }
2661
+ }), g = V({
2662
+ get: () => e.model.usePointStyle ?? !0,
2663
+ set: (B) => {
2664
+ n("update:model", { ...e.model, usePointStyle: B });
2665
+ }
2666
+ }), $ = V({
2667
+ get: () => e.model.legendFontSize ?? null,
2668
+ set: (B) => {
2669
+ if (B == null) {
2670
+ n("update:model", { ...e.model, legendFontSize: void 0 });
2671
+ return;
2672
+ }
2673
+ n("update:model", { ...e.model, legendFontSize: Math.min(Number(B), 24) });
2674
+ }
2675
+ }), O = V(() => e.model.legendColor ?? "#6b6b6b"), i = te(O.value), s = te(null);
2676
+ Ce(
2677
+ () => e.model.legendColor,
2678
+ (B) => {
2679
+ i.value = B ?? "#6b6b6b";
2680
+ }
2681
+ );
2682
+ function y() {
2683
+ n("update:model", { ...e.model, legendColor: i.value });
2684
+ }
2685
+ function F() {
2686
+ var B;
2687
+ (B = s.value) == null || B.click();
2688
+ }
2689
+ return (B, c) => {
2690
+ const u = M("FmCheckbox"), A = M("FmSelect"), L = M("FmStepperField"), h = M("FmButton");
2691
+ return f(), P("div", mo, [
2692
+ p(u, {
2693
+ modelValue: C.value,
2694
+ "onUpdate:modelValue": c[0] || (c[0] = (r) => C.value = r),
2695
+ class: "fm-typo-en-body-lg-400",
2696
+ value: !1,
2697
+ label: l(o)("report.section.datasource.legend.showLegend")
2698
+ }, null, 8, ["modelValue", "label"]),
2699
+ ke(b("div", co, [
2700
+ p(u, {
2701
+ modelValue: g.value,
2702
+ "onUpdate:modelValue": c[1] || (c[1] = (r) => g.value = r),
2703
+ label: l(o)("report.section.datasource.legend.usePointStyle"),
2704
+ value: !1
2705
+ }, null, 8, ["modelValue", "label"]),
2706
+ p(A, {
2707
+ label: l(o)("report.section.datasource.position.showPosition"),
2708
+ items: S,
2709
+ "model-value": B.model.legendPosition ?? "top",
2710
+ "onUpdate:modelValue": c[2] || (c[2] = (r) => n("update:model", { ...B.model, legendPosition: r }))
2711
+ }, null, 8, ["label", "model-value"]),
2712
+ p(L, {
2713
+ modelValue: $.value,
2714
+ "onUpdate:modelValue": c[3] || (c[3] = (r) => $.value = r),
2715
+ label: l(o)("report.section.datasource.legend.fontSize"),
2716
+ max: 24,
2717
+ min: 1,
2718
+ type: "number",
2719
+ placeholder: "Auto"
2720
+ }, null, 8, ["modelValue", "label"]),
2721
+ b("p", po, q(l(o)("report.section.datasource.legend.color")), 1),
2722
+ b("div", {
2723
+ class: "fm-field fm-field--sm flex items-center justify-between gap-8 border rounded-md p-2 border-[#c7c7cc] cursor-pointer",
2724
+ role: "button",
2725
+ tabindex: "0",
2726
+ onClick: F,
2727
+ onKeydown: [
2728
+ cl(we(F, ["prevent"]), ["enter"]),
2729
+ cl(we(F, ["prevent"]), ["space"])
2730
+ ]
2731
+ }, [
2732
+ ke(b("input", {
2733
+ ref_key: "colorInputRef",
2734
+ ref: s,
2735
+ "onUpdate:modelValue": c[4] || (c[4] = (r) => i.value = r),
2736
+ type: "color",
2737
+ class: "legend-color-input cursor-pointer"
2738
+ }, null, 512), [
2739
+ [zl, i.value]
2740
+ ])
2741
+ ], 40, vo),
2742
+ p(h, {
2743
+ size: "md",
2744
+ label: l(o)("report.common.apply"),
2745
+ disabled: i.value === O.value,
2746
+ onClick: y
2747
+ }, null, 8, ["label", "disabled"])
2748
+ ], 512), [
2749
+ [$e, C.value]
2750
+ ])
2751
+ ]);
2752
+ };
2753
+ }
2754
+ }), go = /* @__PURE__ */ $l(fo, [["__scopeId", "data-v-0e072961"]]), yo = { class: "flex flex-col gap-8" }, bo = { class: "flex flex-col sm:flex-row items-center" }, ho = { class: "flex flex-col gap-8" }, wo = { class: "flex w-full gap-8 text-fm-color-system-info-300" }, Co = {
2755
+ key: 1,
2756
+ class: "grid grid-cols-1 gap-8 sm:grid-cols-2"
2757
+ }, xo = ["title"], ko = ["aria-label"], Fo = { class: "min-w-0 truncate text-[12px] uppercase leading-none tracking-[0.02em] text-[#6b6b6b]" }, Vo = ["value", "onInput", "onChange"], So = {
2758
+ key: 0,
2759
+ class: "flex items-center gap-8"
2760
+ }, _o = {
2761
+ key: 2,
2762
+ class: "flex flex-col gap-8"
2763
+ }, To = { class: "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white p-10" }, $o = { class: "mb-8 flex min-w-0 items-center gap-[8px] pb-8" }, Do = ["title"], Uo = ["title"], Bo = { class: "flex w-full items-center gap-8 sm:w-auto sm:shrink-0" }, Ao = ["aria-label"], Lo = { class: "min-w-0 truncate text-[12px] uppercase leading-none tracking-[0.02em]" }, Mo = ["value", "disabled", "onInput", "onChange"], Oo = {
2764
+ key: 0,
2765
+ class: "flex items-center gap-8"
2766
+ }, De = 10, jo = /* @__PURE__ */ de({
2767
+ __name: "ChartColorSection",
2768
+ props: {
2769
+ model: {},
2770
+ showLayerControl: { type: Boolean },
2771
+ limitToSeriesMode: { type: Boolean }
2772
+ },
2773
+ emits: ["update:model"],
2774
+ setup(U, { emit: v }) {
2775
+ const e = U, n = v, { t: o } = pe(), S = V(() => e.limitToSeriesMode ? [
2776
+ {
2777
+ label: o("report.section.datasource.styleTarget.series"),
2778
+ value: ie.series
2779
+ }
2780
+ ] : [
2781
+ {
2782
+ label: o("report.section.datasource.styleTarget.series"),
2783
+ value: ie.series
2784
+ },
2785
+ {
2786
+ label: o("report.section.datasource.styleTarget.metric"),
2787
+ value: ie.metric
2788
+ },
2789
+ {
2790
+ label: o("report.section.datasource.styleTarget.breakdown"),
2791
+ value: ie.breakdown
2792
+ }
2793
+ ]);
2794
+ function C(k) {
2795
+ return e.limitToSeriesMode ? ie.series : k === ie.breakdown ? ie.breakdown : k === ie.metric ? ie.metric : ie.series;
2796
+ }
2797
+ function g() {
2798
+ const k = Array.isArray(e.model.metrics) ? e.model.metrics : [];
2799
+ if (!e.model.isBlend)
2800
+ return k;
2801
+ const T = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
2802
+ (D) => Array.isArray(D == null ? void 0 : D.metrics) ? D.metrics : []
2803
+ ) : [];
2804
+ return [...k, ...T];
2805
+ }
2806
+ function $(k, T) {
2807
+ var I, X;
2808
+ return k ? ((I = k.label) == null ? void 0 : I.trim()) || ((X = k.name) == null ? void 0 : X.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${T + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${T + 1}`;
2809
+ }
2810
+ function O(k) {
2811
+ if (k === ie.breakdown)
2812
+ return [];
2813
+ if (k === ie.metric) {
2814
+ const T = g();
2815
+ if (T.length > 0)
2816
+ return T.map((D, I) => $(D, I));
2817
+ }
2818
+ return fe.map(
2819
+ (T, D) => `${o("report.section.datasource.chartColor.series")} ${D + 1}`
2820
+ );
2821
+ }
2822
+ function i(k) {
2823
+ return Array.from({ length: Math.max(1, k) }).map(
2824
+ (T, D) => `${o("report.section.datasource.chartColor.series")} ${D + 1}`
2825
+ );
2826
+ }
2827
+ function s(k, T) {
2828
+ const D = Array.isArray(k) ? k.length : 0, I = Array.isArray(T) ? T.length : 0;
2829
+ return Math.max(fe.length, D, I, 1);
2830
+ }
2831
+ const y = V(() => {
2832
+ const k = g();
2833
+ return k.length === 0 ? [o("report.section.datasource.styleTarget.metric")] : k.map((T, D) => $(T, D));
2834
+ }), F = te(fe.length), B = te(fe.length);
2835
+ function c(k, T) {
2836
+ const D = Math.max(1, T), I = Array.isArray(k) ? k.length : 0, X = I > 0 ? Math.ceil(I / D) : 0;
2837
+ return Math.max(fe.length, X, 1);
2838
+ }
2839
+ const u = V(() => {
2840
+ const k = Math.max(1, B.value);
2841
+ return Array.from({ length: k }).map(
2842
+ (T, D) => `${o("report.section.datasource.styleTarget.breakdown")} ${D + 1}`
2843
+ );
2844
+ });
2845
+ function A(k, T) {
2846
+ const D = Y(k) ?? "#000000", I = (X) => {
2847
+ const E = Number.parseInt(D.slice(X, X + 2), 16);
2848
+ return Math.round(E + (255 - E) * T).toString(16).padStart(2, "0").toUpperCase();
2849
+ };
2850
+ return `#${I(1)}${I(3)}${I(5)}`;
2851
+ }
2852
+ function L(k) {
2853
+ return Math.min(0.55 + (k - 1) * 0.18, 0.95);
2854
+ }
2855
+ function h(k, T, D) {
2856
+ return k * D + T;
2857
+ }
2858
+ function r(k, T, D, I) {
2859
+ const X = T.length;
2860
+ if (k.length === 0 || X <= 0)
2861
+ return [];
2862
+ const E = ll(k.length);
2863
+ return k.flatMap((W, oe) => {
2864
+ const ee = E[oe], ce = D == null ? void 0 : D[h(oe, 0, X)], Le = Y(ce) ?? ee;
2865
+ return T.map((Ze, Me) => {
2866
+ const Rl = h(oe, Me, X), ml = Me === 0 ? Le : A(Le, L(Me));
2867
+ return I && Me > 0 ? ml : Y(D == null ? void 0 : D[Rl]) ?? ml;
2868
+ });
2869
+ });
2870
+ }
2871
+ const j = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
2872
+ function Y(k) {
2873
+ if (!k)
2874
+ return null;
2875
+ const T = k.trim();
2876
+ if (!j.test(T))
2877
+ return null;
2878
+ if (T.length === 4) {
2879
+ const D = T.charAt(1), I = T.charAt(2), X = T.charAt(3);
2880
+ return `#${D}${D}${I}${I}${X}${X}`.toUpperCase();
2881
+ }
2882
+ return T.toUpperCase();
2883
+ }
2884
+ function w() {
2885
+ const k = () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0").toUpperCase();
2886
+ return `#${k()}${k()}${k()}`;
2887
+ }
2888
+ function m(k, T) {
2889
+ const D = ll(T);
2890
+ return !Array.isArray(k) || k.length === 0 ? D : Array.from({ length: T }).map((I, X) => {
2891
+ const E = D[X];
2892
+ return Y(k[X]) ?? E;
2893
+ });
2894
+ }
2895
+ function _(k, T) {
2896
+ if (T <= 0)
2897
+ return [];
2898
+ const D = Array.from({ length: T }, () => 0), I = /* @__PURE__ */ new Set();
2899
+ for (let E = 0; E < T; E++) {
2900
+ const W = Number(k == null ? void 0 : k[E]);
2901
+ Number.isInteger(W) && W >= 1 && W <= T && !I.has(W) && (D[E] = W, I.add(W));
2902
+ }
2903
+ let X = 1;
2904
+ for (let E = 0; E < T; E++)
2905
+ if (D[E] === 0) {
2906
+ for (; I.has(X) && X <= T; )
2907
+ X++;
2908
+ D[E] = Math.min(X, T), I.add(D[E]);
2909
+ }
2910
+ return D;
2911
+ }
2912
+ const x = V(() => N.value === ie.series ? i(F.value) : O(N.value)), le = V(
2913
+ () => Array.from({ length: x.value.length }).map((k, T) => ({
2914
+ label: `L${T + 1}`,
2915
+ value: T + 1
2916
+ }))
2917
+ ), J = V(() => typeof e.showLayerControl == "boolean" ? e.showLayerControl : !!e.model.stackBarOverlap), G = te([]), d = te([]), t = te([]), a = te(!0), N = te(ie.series), ae = te(!0), se = te(!1), me = te(!1);
2918
+ Ce(
2919
+ [
2920
+ () => e.model.chartColors,
2921
+ () => e.model.chartColorBinding,
2922
+ () => e.model.chartBreakdownColors,
2923
+ () => e.model.chartUseSecondaryMetricShades,
2924
+ () => e.model.metrics,
2925
+ () => e.model.isBlend,
2926
+ () => e.model.joinDatasources
2927
+ ],
2928
+ ([k, T]) => {
2929
+ se.value = !0, N.value = C(T), F.value = s(
2930
+ k,
2931
+ e.model.chartColorLayers
2932
+ ), B.value = c(
2933
+ e.model.chartBreakdownColors,
2934
+ Math.max(1, y.value.length)
2935
+ );
2936
+ const D = N.value === ie.series ? F.value : O(N.value).length;
2937
+ G.value = m(k, D), d.value = _(e.model.chartColorLayers, D), a.value = e.model.chartUseSecondaryMetricShades !== !1, t.value = r(
2938
+ u.value,
2939
+ y.value,
2940
+ e.model.chartBreakdownColors,
2941
+ a.value
2942
+ ), se.value = !1;
2943
+ },
2944
+ { immediate: !0, deep: !0 }
2945
+ );
2946
+ function Q() {
2947
+ const k = N.value === ie.series, T = N.value === ie.series ? fe.length : O(N.value).length, D = m(void 0, T), I = _(void 0, T), X = G.value.length === D.length && G.value.every((ee, ce) => ee === D[ce]), E = d.value.length === I.length && d.value.every((ee, ce) => ee === I[ce]), W = r(
2948
+ Array.from({ length: fe.length }, (ee, ce) => `breakdown-${ce + 1}`),
2949
+ y.value,
2950
+ void 0,
2951
+ a.value
2952
+ ), oe = t.value.length === W.length && t.value.every((ee, ce) => ee === W[ce]);
2953
+ return {
2954
+ ...e.model,
2955
+ chartColorBinding: k ? void 0 : N.value,
2956
+ chartColors: X ? void 0 : [...G.value],
2957
+ chartColorLayers: E ? void 0 : [...d.value],
2958
+ chartBreakdownColors: oe ? void 0 : [...t.value],
2959
+ chartUseSecondaryMetricShades: a.value
2960
+ };
2961
+ }
2962
+ function Re() {
2963
+ const k = Q();
2964
+ Ml(k) || n("update:model", k);
2965
+ }
2966
+ function _e() {
2967
+ se.value || me.value || Re();
2968
+ }
2969
+ Ce(
2970
+ [
2971
+ G,
2972
+ d,
2973
+ t,
2974
+ a,
2975
+ N,
2976
+ F,
2977
+ B
2978
+ ],
2979
+ () => {
2980
+ _e();
2981
+ },
2982
+ { deep: !0 }
2983
+ );
2984
+ function Be(k, T) {
2985
+ const D = [...G.value], I = ll(Math.max(D.length, k + 1))[k];
2986
+ D[k] = Y(T) ?? I, G.value = D;
2987
+ }
2988
+ function xe(k) {
2989
+ Be(k, w());
2990
+ }
2991
+ function ye(k) {
2992
+ if (e.limitToSeriesMode)
2993
+ return;
2994
+ const T = C(k);
2995
+ if (T === N.value)
2996
+ return;
2997
+ const D = T === ie.series ? F.value : O(T).length;
2998
+ N.value = T, G.value = m(G.value, D), d.value = _(d.value, D), T === ie.breakdown && (t.value = r(
2999
+ u.value,
3000
+ y.value,
3001
+ t.value,
3002
+ a.value
3003
+ ));
3004
+ }
3005
+ function he(k, T) {
3006
+ return k + 1 === T ? "add" : "remove";
3007
+ }
3008
+ function Te(k) {
3009
+ const T = Math.max(fe.length, F.value), D = k + 1;
3010
+ if (D === T) {
3011
+ const ee = T + De;
3012
+ F.value = ee, G.value = m(G.value, ee), d.value = _(d.value, ee);
3013
+ return;
3014
+ }
3015
+ if (T <= fe.length)
3016
+ return;
3017
+ const X = D, E = Math.max(fe.length, T - De), W = [...G.value], oe = [...d.value];
3018
+ W.splice(X, De), oe.splice(X, De), F.value = E, G.value = m(W, E), d.value = _(oe, E);
3019
+ }
3020
+ function Z(k) {
3021
+ const T = Math.max(fe.length, B.value), D = k + 1;
3022
+ if (D === T) {
3023
+ const Le = T + De;
3024
+ B.value = Le, t.value = r(
3025
+ Array.from({ length: Le }, (Ze, Me) => `breakdown-${Me + 1}`),
3026
+ y.value,
3027
+ t.value,
3028
+ a.value
3029
+ );
3030
+ return;
3031
+ }
3032
+ if (T <= fe.length)
3033
+ return;
3034
+ const X = Math.max(1, y.value.length), W = D * X, oe = De * X, ee = Math.max(fe.length, T - De), ce = [...t.value];
3035
+ ce.splice(W, oe), B.value = ee, t.value = r(
3036
+ Array.from({ length: ee }, (Le, Ze) => `breakdown-${Ze + 1}`),
3037
+ y.value,
3038
+ ce,
3039
+ a.value
3040
+ );
3041
+ }
3042
+ function Ee(k, T) {
3043
+ const D = d.value.length;
3044
+ if (D <= 0)
3045
+ return;
3046
+ const I = Number(T);
3047
+ if (!Number.isInteger(I) || I < 1 || I > D)
3048
+ return;
3049
+ const X = [...d.value], E = X[k];
3050
+ if (E === I)
3051
+ return;
3052
+ const W = X.findIndex(
3053
+ (oe, ee) => ee !== k && oe === I
3054
+ );
3055
+ W >= 0 && (X[W] = E), X[k] = I, d.value = X;
3056
+ }
3057
+ function We(k, T) {
3058
+ const D = T.target;
3059
+ D && (me.value = !0, Be(k, D.value));
3060
+ }
3061
+ function Xe(k, T) {
3062
+ const D = T.target;
3063
+ D && (Be(k, D.value), me.value = !1, _e());
3064
+ }
3065
+ function ne(k, T, D) {
3066
+ const I = D.target;
3067
+ if (!I)
3068
+ return;
3069
+ me.value = !0;
3070
+ const X = Y(I.value);
3071
+ if (!X)
3072
+ return;
3073
+ const E = y.value.length;
3074
+ if (E <= 0)
3075
+ return;
3076
+ const W = h(k, T, E), oe = [...t.value];
3077
+ if (oe[W] = X, a.value && T === 0)
3078
+ for (let ee = 1; ee < E; ee++) {
3079
+ const ce = h(k, ee, E);
3080
+ oe[ce] = A(X, L(ee));
3081
+ }
3082
+ t.value = oe;
3083
+ }
3084
+ function Bl(k, T, D) {
3085
+ const I = D.target;
3086
+ if (!I)
3087
+ return;
3088
+ const X = Y(I.value);
3089
+ if (!X) {
3090
+ me.value = !1, _e();
3091
+ return;
3092
+ }
3093
+ const E = y.value.length;
3094
+ if (E <= 0) {
3095
+ me.value = !1, _e();
3096
+ return;
3097
+ }
3098
+ const W = h(k, T, E), oe = [...t.value];
3099
+ if (oe[W] = X, a.value && T === 0)
3100
+ for (let ee = 1; ee < E; ee++) {
3101
+ const ce = h(k, ee, E);
3102
+ oe[ce] = A(X, L(ee));
3103
+ }
3104
+ t.value = oe, me.value = !1, _e();
3105
+ }
3106
+ function Al(k, T) {
3107
+ const D = w(), I = y.value.length;
3108
+ if (I <= 0)
3109
+ return;
3110
+ const X = h(k, T, I), E = [...t.value];
3111
+ if (E[X] = D, a.value && T === 0)
3112
+ for (let W = 1; W < I; W++) {
3113
+ const oe = h(k, W, I);
3114
+ E[oe] = A(D, L(W));
3115
+ }
3116
+ t.value = E;
3117
+ }
3118
+ function ul(k, T) {
3119
+ const D = Array.isArray(k) ? k : [], I = Array.isArray(T) ? T : [];
3120
+ return D.length !== I.length ? !1 : D.every((X, E) => X === I[E]);
3121
+ }
3122
+ function Ll(k, T) {
3123
+ const D = Array.isArray(k) ? k : [], I = Array.isArray(T) ? T : [];
3124
+ return D.length !== I.length ? !1 : D.every((X, E) => Number(X) === Number(I[E]));
3125
+ }
3126
+ function Ml(k) {
3127
+ return k.chartColorBinding === e.model.chartColorBinding && k.chartUseSecondaryMetricShades === e.model.chartUseSecondaryMetricShades && ul(k.chartColors, e.model.chartColors) && Ll(k.chartColorLayers, e.model.chartColorLayers) && ul(k.chartBreakdownColors, e.model.chartBreakdownColors);
3128
+ }
3129
+ function Ol(k) {
3130
+ a.value = k, t.value = r(
3131
+ Array.from({ length: B.value }, (T, D) => `breakdown-${D + 1}`),
3132
+ y.value,
3133
+ t.value,
3134
+ a.value
3135
+ );
3136
+ }
3137
+ function jl() {
3138
+ N.value = ie.series, F.value = fe.length, B.value = fe.length, G.value = m(void 0, fe.length), d.value = _(void 0, fe.length), a.value = !0, t.value = r(
3139
+ Array.from({ length: fe.length }, (k, T) => `breakdown-${T + 1}`),
3140
+ y.value,
3141
+ void 0,
3142
+ !0
3143
+ );
3144
+ }
3145
+ function Nl() {
3146
+ ae.value = !ae.value;
3147
+ }
3148
+ function dl(k) {
3149
+ return (k + 1) % De === 0;
3150
+ }
3151
+ return il(() => {
3152
+ me.value = !1;
3153
+ }), (k, T) => {
3154
+ const D = M("FmButton"), I = M("FmSelect"), X = M("FmCheckbox");
3155
+ return f(), P("div", yo, [
3156
+ b("div", bo, [
3157
+ p(D, {
3158
+ variant: "tertiary",
3159
+ size: "md",
3160
+ class: "min-w-0 w-full sm:flex-1 sm:w-auto !justify-start",
3161
+ label: l(o)("report.section.datasource.chartColor.title"),
3162
+ "prepend-icon": ae.value ? "expand_less" : "expand_more",
3163
+ "aria-expanded": ae.value ? "true" : "false",
3164
+ onClick: Nl
3165
+ }, null, 8, ["label", "prepend-icon", "aria-expanded"])
3166
+ ]),
3167
+ ke(b("div", ho, [
3168
+ p(I, {
3169
+ "model-value": N.value,
3170
+ items: S.value,
3171
+ "onUpdate:modelValue": ye
3172
+ }, null, 8, ["model-value", "items"]),
3173
+ b("div", wo, [
3174
+ p(D, {
3175
+ variant: "tertiary",
3176
+ "text-color": "text-fm-color-system-info-300",
3177
+ size: "md",
3178
+ class: "w-full",
3179
+ label: l(o)("report.section.datasource.chartColor.reset"),
3180
+ onClick: jl
3181
+ }, null, 8, ["label"])
3182
+ ]),
3183
+ N.value === l(ie).breakdown ? (f(), R(X, {
3184
+ key: 0,
3185
+ "model-value": a.value,
3186
+ value: !1,
3187
+ label: l(o)("report.section.datasource.chartColor.secondaryMetricAutoShade"),
3188
+ "onUpdate:modelValue": T[0] || (T[0] = (E) => Ol(!!E)),
3189
+ class: "p-4"
3190
+ }, null, 8, ["model-value", "label"])) : z("", !0),
3191
+ N.value !== l(ie).breakdown ? (f(), P("div", Co, [
3192
+ (f(!0), P(ue, null, Se(G.value, (E, W) => (f(), P(ue, {
3193
+ key: `series-color-${W}`
3194
+ }, [
3195
+ b("div", {
3196
+ class: Fe([
3197
+ "fm-shadow-light-100 rounded-md border border-fm-color-neutral-gray-100 p-10",
3198
+ J.value ? "flex flex-col gap-8" : "flex flex-col gap-8 sm:flex-row sm:items-center sm:justify-between sm:gap-12"
3199
+ ])
3200
+ }, [
3201
+ b("span", {
3202
+ class: Fe([
3203
+ "fm-typo-en-body-lg-600 min-w-0",
3204
+ J.value ? "line-clamp-2 break-words" : "whitespace-normal break-words sm:flex-1"
3205
+ ]),
3206
+ title: x.value[W] || `${l(o)("report.section.datasource.chartColor.color")} ${W + 1}`
3207
+ }, q(x.value[W] || `${l(o)("report.section.datasource.chartColor.color")} ${W + 1}`), 11, xo),
3208
+ b("div", {
3209
+ class: Fe([
3210
+ "flex items-center gap-8",
3211
+ J.value ? "justify-between" : "w-full flex-wrap items-center justify-between sm:w-auto sm:flex-nowrap sm:shrink-0"
3212
+ ])
3213
+ }, [
3214
+ J.value ? (f(), R(I, {
3215
+ key: 0,
3216
+ class: "min-w-[92px]",
3217
+ "model-value": d.value[W],
3218
+ items: le.value,
3219
+ "onUpdate:modelValue": (oe) => Ee(W, oe)
3220
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : z("", !0),
3221
+ b("label", {
3222
+ class: "relative inline-flex min-h-[34px] min-w-0 flex-1 cursor-pointer items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px] sm:flex-none",
3223
+ "aria-label": `Color ${W + 1}`
3224
+ }, [
3225
+ b("span", {
3226
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3227
+ style: ol({ backgroundColor: E })
3228
+ }, null, 4),
3229
+ b("span", Fo, q(E), 1),
3230
+ b("input", {
3231
+ type: "color",
3232
+ value: E,
3233
+ class: "absolute inset-0 cursor-pointer opacity-0",
3234
+ onInput: (oe) => We(W, oe),
3235
+ onChange: (oe) => Xe(W, oe)
3236
+ }, null, 40, Vo)
3237
+ ], 8, ko),
3238
+ p(D, {
3239
+ variant: "tertiary",
3240
+ size: "md",
3241
+ icon: "casino",
3242
+ onClick: (oe) => xe(W)
3243
+ }, null, 8, ["onClick"])
3244
+ ], 2)
3245
+ ], 2),
3246
+ dl(W) ? (f(), P("div", So, [
3247
+ p(D, {
3248
+ class: "w-full",
3249
+ size: "md",
3250
+ icon: he(W, F.value),
3251
+ onClick: (oe) => Te(W)
3252
+ }, null, 8, ["icon", "onClick"])
3253
+ ])) : z("", !0)
3254
+ ], 64))), 128))
3255
+ ])) : (f(), P("div", _o, [
3256
+ (f(!0), P(ue, null, Se(u.value, (E, W) => (f(), P(ue, {
3257
+ key: `breakdown-group-${W}`
3258
+ }, [
3259
+ b("div", To, [
3260
+ b("div", $o, [
3261
+ b("span", {
3262
+ class: "fm-typo-en-body-lg-600 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",
3263
+ title: E
3264
+ }, q(E), 9, Do)
3265
+ ]),
3266
+ (f(!0), P(ue, null, Se(y.value, (oe, ee) => (f(), P("div", {
3267
+ key: `${E}-${oe}-${ee}`,
3268
+ class: "flex flex-col items-stretch gap-8 py-4 sm:flex-row sm:items-center sm:justify-between"
3269
+ }, [
3270
+ b("span", {
3271
+ class: "fm-typo-en-body-md-400 min-w-0 flex-1 break-words sm:overflow-hidden sm:text-ellipsis sm:whitespace-nowrap",
3272
+ title: oe
3273
+ }, q(oe), 9, Uo),
3274
+ b("div", Bo, [
3275
+ b("label", {
3276
+ class: Fe(["relative inline-flex min-h-[34px] min-w-0 flex-1 items-center gap-[8px] rounded-[8px] border border-[#d8d8d8] bg-white py-[4px] pl-[4px] pr-[8px] sm:w-full sm:max-w-[126px]", {
3277
+ "cursor-not-allowed opacity-[0.55]": a.value && ee > 0,
3278
+ "cursor-pointer": !(a.value && ee > 0)
3279
+ }]),
3280
+ "aria-label": `Breakdown color ${W + 1}-${ee + 1}`
3281
+ }, [
3282
+ b("span", {
3283
+ class: "inline-block h-[20px] w-[28px] rounded-[4px] border border-[#cfcfcf]",
3284
+ style: ol({
3285
+ backgroundColor: t.value[h(W, ee, y.value.length)]
3286
+ })
3287
+ }, null, 4),
3288
+ b("span", Lo, q(t.value[h(W, ee, y.value.length)]), 1),
3289
+ b("input", {
3290
+ type: "color",
3291
+ value: t.value[h(W, ee, y.value.length)],
3292
+ class: Fe(["absolute inset-0 opacity-0", {
3293
+ "cursor-not-allowed": a.value && ee > 0,
3294
+ "cursor-pointer": !(a.value && ee > 0)
3295
+ }]),
3296
+ disabled: a.value && ee > 0,
3297
+ onInput: (ce) => ne(W, ee, ce),
3298
+ onChange: (ce) => Bl(W, ee, ce)
3299
+ }, null, 42, Mo)
3300
+ ], 10, Ao),
3301
+ p(D, {
3302
+ variant: "tertiary",
3303
+ size: "md",
3304
+ icon: "casino",
3305
+ class: "shrink-0",
3306
+ disabled: a.value && ee > 0,
3307
+ onClick: (ce) => Al(W, ee)
3308
+ }, null, 8, ["disabled", "onClick"])
3309
+ ])
3310
+ ]))), 128))
3311
+ ]),
3312
+ dl(W) ? (f(), P("div", Oo, [
3313
+ p(D, {
3314
+ class: "w-full",
3315
+ size: "md",
3316
+ icon: he(W, B.value),
3317
+ onClick: (oe) => Z(W)
3318
+ }, null, 8, ["icon", "onClick"])
3319
+ ])) : z("", !0)
3320
+ ], 64))), 128))
3321
+ ]))
3322
+ ], 512), [
3323
+ [$e, ae.value]
3324
+ ])
3325
+ ]);
3326
+ };
3327
+ }
3328
+ }), No = { class: "flex flex-col gap-8" }, Ro = { class: "flex items-center justify-between" }, zo = { class: "fm-typo-en-body-lg-600" }, Io = { class: "flex items-center gap-8 text-fm-color-system-info-300" }, Po = { class: "grid grid-cols-2 gap-8" }, Eo = { class: "flex items-center gap-8" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = /* @__PURE__ */ de({
3329
+ __name: "ChartLineStyleSection",
3330
+ props: {
3331
+ model: {}
3332
+ },
3333
+ emits: ["update:model"],
3334
+ setup(U, { emit: v }) {
3335
+ const e = U, n = v, { t: o } = pe(), S = V(() => [
3336
+ {
3337
+ label: o("report.section.datasource.styleTarget.series"),
3338
+ value: ie.series
3339
+ },
3340
+ {
3341
+ label: o("report.section.datasource.styleTarget.metric"),
3342
+ value: ie.metric
3343
+ }
3344
+ ]);
3345
+ function C(m) {
3346
+ return m && typeof m == "object" && "value" in m ? C(m.value) : m === ie.metric ? ie.metric : ie.series;
3347
+ }
3348
+ function g(m, _) {
3349
+ var le, J;
3350
+ return m ? ((le = m.label) == null ? void 0 : le.trim()) || ((J = m.name) == null ? void 0 : J.trim()) || `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}` : `${o("report.section.datasource.styleTarget.metric")} ${_ + 1}`;
3351
+ }
3352
+ function $() {
3353
+ const m = Array.isArray(e.model.metrics) ? e.model.metrics : [];
3354
+ if (!e.model.isBlend)
3355
+ return m;
3356
+ const _ = Array.isArray(e.model.joinDatasources) ? e.model.joinDatasources.flatMap(
3357
+ (x) => Array.isArray(x == null ? void 0 : x.metrics) ? x.metrics : []
3358
+ ) : [];
3359
+ return [...m, ..._];
3360
+ }
3361
+ function O(m) {
3362
+ if (m === ie.metric) {
3363
+ const _ = $();
3364
+ if (_.length > 0)
3365
+ return _.map((x, le) => g(x, le));
3366
+ }
3367
+ return fe.map(
3368
+ (_, x) => `${o("report.section.datasource.lineStyle.series")} ${x + 1}`
3369
+ );
3370
+ }
3371
+ const i = V(() => [
3372
+ {
3373
+ label: o("report.section.datasource.lineStyle.solid"),
3374
+ value: "solid"
3375
+ },
3376
+ {
3377
+ label: o("report.section.datasource.lineStyle.dashed"),
3378
+ value: "dashed"
3379
+ },
3380
+ {
3381
+ label: o("report.section.datasource.lineStyle.dotted"),
3382
+ value: "dotted"
3383
+ }
3384
+ ]);
3385
+ function s(m) {
3386
+ return m && typeof m == "object" && "value" in m ? s(m.value) : m === "dashed" || m === "DASHED" ? "dashed" : m === "dotted" || m === "DOTTED" ? "dotted" : "solid";
3387
+ }
3388
+ function y(m) {
3389
+ return m === "dashed" ? "line-style-icon--dashed" : m === "dotted" ? "line-style-icon--dotted" : "line-style-icon--solid";
3390
+ }
3391
+ function F(m, _) {
3392
+ return !Array.isArray(m) || m.length === 0 ? Array.from({ length: _ }).map(
3393
+ (x, le) => yl[le] ?? "solid"
3394
+ ) : Array.from({ length: _ }).map(
3395
+ (x, le) => s(m[le])
3396
+ );
3397
+ }
3398
+ const B = V(
3399
+ () => C(e.model.lineStyleBinding)
3400
+ ), c = V(() => O(L.value)), u = V(
3401
+ () => F(e.model.lineStyles, O(B.value).length)
3402
+ ), A = te([]), L = te(ie.series);
3403
+ Ce(
3404
+ [
3405
+ () => e.model.lineStyles,
3406
+ () => e.model.lineStyleBinding,
3407
+ () => e.model.metrics,
3408
+ () => e.model.isBlend,
3409
+ () => e.model.joinDatasources
3410
+ ],
3411
+ ([m, _]) => {
3412
+ L.value = C(_), A.value = F(
3413
+ m,
3414
+ O(L.value).length
3415
+ );
3416
+ },
3417
+ { immediate: !0, deep: !0 }
3418
+ );
3419
+ const h = V(() => L.value !== B.value || A.value.length !== u.value.length ? !0 : A.value.some((m, _) => m !== u.value[_]));
3420
+ function r(m, _) {
3421
+ const x = [...A.value];
3422
+ x[m] = s(_), A.value = x;
3423
+ }
3424
+ function j(m) {
3425
+ const _ = C(m);
3426
+ if (_ === L.value)
3427
+ return;
3428
+ const x = O(_).length;
3429
+ L.value = _, A.value = F(A.value, x);
3430
+ }
3431
+ function Y() {
3432
+ L.value = ie.series, A.value = [...yl];
3433
+ }
3434
+ function w() {
3435
+ const m = L.value === ie.series, _ = A.value.every((x) => x === "solid");
3436
+ n("update:model", {
3437
+ ...e.model,
3438
+ lineStyleBinding: m ? void 0 : L.value,
3439
+ lineStyles: _ ? void 0 : [...A.value]
3440
+ });
3441
+ }
3442
+ return (m, _) => {
3443
+ const x = M("FmButton"), le = M("FmSelect");
3444
+ return f(), P("div", No, [
3445
+ b("div", Ro, [
3446
+ b("p", zo, q(l(o)("report.section.datasource.lineStyle.title")), 1),
3447
+ b("div", Io, [
3448
+ p(x, {
3449
+ variant: "tertiary",
3450
+ "text-color": "text-fm-color-system-info-300",
3451
+ size: "md",
3452
+ label: l(o)("report.section.datasource.lineStyle.reset"),
3453
+ onClick: Y
3454
+ }, null, 8, ["label"])
3455
+ ])
3456
+ ]),
3457
+ p(le, {
3458
+ "model-value": L.value,
3459
+ items: S.value,
3460
+ label: l(o)("report.section.datasource.styleTarget.title"),
3461
+ "onUpdate:modelValue": j
3462
+ }, null, 8, ["model-value", "items", "label"]),
3463
+ b("div", Po, [
3464
+ (f(!0), P(ue, null, Se(A.value, (J, G) => (f(), P("div", {
3465
+ key: G,
3466
+ class: "flex items-center justify-between gap-8 rounded-md border border-fm-color-neutral-gray-100 px-8 py-6"
3467
+ }, [
3468
+ b("div", Eo, [
3469
+ b("span", {
3470
+ class: Fe(["line-style-icon", y(J)]),
3471
+ "aria-hidden": "true"
3472
+ }, null, 2),
3473
+ b("span", Wo, q(c.value[G] || `${l(o)("report.section.datasource.lineStyle.line")} ${G + 1}`), 1)
3474
+ ]),
3475
+ p(le, {
3476
+ "model-value": J,
3477
+ items: i.value,
3478
+ class: "w-[130px]",
3479
+ "onUpdate:modelValue": (d) => r(G, d)
3480
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
3481
+ ]))), 128))
3482
+ ]),
3483
+ p(x, {
3484
+ size: "md",
3485
+ label: l(o)("report.common.apply"),
3486
+ disabled: !h.value,
3487
+ onClick: w
3488
+ }, null, 8, ["label", "disabled"])
3489
+ ]);
3490
+ };
3491
+ }
3492
+ }), Ho = /* @__PURE__ */ $l(Xo, [["__scopeId", "data-v-f1c35513"]]), qo = { class: "flex flex-col gap-16" }, Go = {
3493
+ key: 1,
3494
+ class: "h-px w-full bg-fm-color-neutral-gray-100"
3495
+ }, Yo = { class: "flex flex-col gap-8" }, Jo = { class: "fm-typo-en-body-lg-600" }, Ko = { class: "flex flex-col gap-8" }, Qo = /* @__PURE__ */ de({
3496
+ __name: "StyleDatasource",
3497
+ props: /* @__PURE__ */ ve({
3498
+ label: {
3499
+ type: String,
3500
+ default: "Label"
3501
+ },
3502
+ config: {
3503
+ type: Object,
3504
+ default: null
3505
+ },
3506
+ closeable: {
3507
+ type: Boolean,
3508
+ default: !1
3509
+ },
3510
+ mainDatasourceConfig: {
3511
+ type: Object,
3512
+ default: () => {
3513
+ }
3514
+ },
3515
+ modelValue: {
3516
+ type: Object,
3517
+ default: () => {
3518
+ }
3519
+ }
3520
+ }, {
3521
+ modelValue: { required: !0 },
3522
+ modelModifiers: {}
3523
+ }),
3524
+ emits: /* @__PURE__ */ ve(["click-close"], ["update:modelValue"]),
3525
+ setup(U, { emit: v }) {
3526
+ const e = ge(U, "modelValue");
3527
+ Ce(
3528
+ [() => e.value.dimensions, () => e.value.metrics],
3529
+ () => {
3530
+ const { rowIds: s, columnIds: y } = Ye(e.value);
3531
+ e.value.rowIds = s, e.value.columnIds = y;
3532
+ },
3533
+ { deep: !0 }
3534
+ );
3535
+ const n = U, o = v, { t: S } = pe(), C = V(() => n.config.type === H.Circular), g = V(
3536
+ () => n.config.type === H.StackBarChart || n.config.type === H.ClusteredStackBarChart
3537
+ ), $ = V(
3538
+ () => n.config.type === H.LineChart || n.config.type === H.StackLineChart
3539
+ ), O = V({
3540
+ get: () => e.value.maxTooltipItems ?? null,
3541
+ set: (s) => {
3542
+ e.value = {
3543
+ ...e.value,
3544
+ maxTooltipItems: s ?? void 0
3545
+ };
3546
+ }
3547
+ }), i = V({
3548
+ get: () => e.value.stackBarOverlap ?? !1,
3549
+ set: (s) => {
3550
+ e.value = {
3551
+ ...e.value,
3552
+ stackBarOverlap: s
3553
+ };
3554
+ }
3555
+ });
3556
+ return (s, y) => {
3557
+ const F = M("FmButton"), B = M("FmCheckbox"), c = M("FmStepperField");
3558
+ return f(), P(ue, null, [
3559
+ y[9] || (y[9] = b("div", { class: "grow" }, null, -1)),
3560
+ n.closeable ? (f(), R(F, {
3561
+ key: 0,
3562
+ icon: "close",
3563
+ variant: "tertiary",
3564
+ size: "md",
3565
+ onClick: y[0] || (y[0] = we((u) => o("click-close"), ["stop"]))
3566
+ })) : z("", !0),
3567
+ b("div", qo, [
3568
+ n.config.hasChart ? (f(), R(jo, {
3569
+ key: 0,
3570
+ model: e.value,
3571
+ "show-layer-control": g.value && i.value,
3572
+ "limit-to-series-mode": C.value,
3573
+ "onUpdate:model": y[1] || (y[1] = (u) => e.value = u)
3574
+ }, null, 8, ["model", "show-layer-control", "limit-to-series-mode"])) : z("", !0),
3575
+ n.config.hasChart && $.value ? (f(), P("div", Go)) : z("", !0),
3576
+ n.config.hasChart && $.value ? (f(), R(Ho, {
3577
+ key: 2,
3578
+ model: e.value,
3579
+ "onUpdate:model": y[2] || (y[2] = (u) => e.value = u)
3580
+ }, null, 8, ["model"])) : z("", !0),
3581
+ y[8] || (y[8] = b("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
3582
+ b("div", Yo, [
3583
+ b("p", Jo, q(l(S)("report.section.style.configuration")), 1),
3584
+ b("div", Ko, [
3585
+ g.value ? (f(), R(B, {
3586
+ key: 0,
3587
+ modelValue: i.value,
3588
+ "onUpdate:modelValue": y[3] || (y[3] = (u) => i.value = u),
3589
+ class: "fm-typo-en-body-lg-400",
3590
+ label: l(S)("report.section.datasource.stackBar.overlapBars")
3591
+ }, null, 8, ["modelValue", "label"])) : z("", !0),
3592
+ n.config.hasLabel ? (f(), R(lo, {
3593
+ key: 1,
3594
+ model: e.value,
3595
+ "onUpdate:model": y[4] || (y[4] = (u) => e.value = u)
3596
+ }, null, 8, ["model"])) : z("", !0),
3597
+ n.config.hasLegend ? (f(), R(go, {
3598
+ key: 2,
3599
+ model: e.value,
3600
+ "is-circular-widget": C.value,
3601
+ "onUpdate:model": y[5] || (y[5] = (u) => e.value = u)
3602
+ }, null, 8, ["model", "is-circular-widget"])) : z("", !0),
3603
+ n.config.hasXy ? (f(), R(uo, {
3604
+ key: 3,
3605
+ model: e.value,
3606
+ "onUpdate:model": y[6] || (y[6] = (u) => e.value = u)
3607
+ }, null, 8, ["model"])) : z("", !0),
3608
+ n.config.hasXy ? (f(), R(c, {
3609
+ key: 4,
3610
+ modelValue: O.value,
3611
+ "onUpdate:modelValue": y[7] || (y[7] = (u) => O.value = u),
3612
+ type: "number",
3613
+ label: l(S)("report.section.datasource.tooltip.maxTooltipItems"),
3614
+ min: 2,
3615
+ max: 20,
3616
+ placeholder: "Auto"
3617
+ }, null, 8, ["modelValue", "label"])) : z("", !0)
3618
+ ])
3619
+ ])
3620
+ ])
3621
+ ], 64);
3622
+ };
3623
+ }
3624
+ }), Zo = { class: "flex flex-col gap-8" }, ea = { class: "flex flex-col border-fm-color-neutral-gray-200 p-12" }, la = { class: "flex items-center" }, ta = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, oa = { class: "flex flex-col gap-8" }, aa = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, na = { class: "flex flex-col border-fm-color-neutral-gray-200 p-12" }, ia = { class: "flex items-center" }, sa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ra = {
3625
+ key: 0,
3626
+ class: "flex flex-col gap-8"
3627
+ }, ua = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, da = {
3628
+ key: 1,
3629
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
3630
+ }, ma = /* @__PURE__ */ de({
3631
+ __name: "TableResizeSection",
3632
+ props: {
3633
+ layout: {},
3634
+ columns: {}
3635
+ },
3636
+ emits: ["update:layout"],
3637
+ setup(U, { emit: v }) {
3638
+ const { t: e } = pe(), n = U, o = v, S = V({
3639
+ get: () => {
3640
+ var y;
3641
+ return (y = n.layout) != null && y.rowHeight && n.layout.rowHeight >= 30 ? n.layout.rowHeight : null;
3642
+ },
3643
+ set: (y) => {
3644
+ var F;
3645
+ o("update:layout", {
3646
+ ...n.layout,
3647
+ rowHeight: y && y >= 30 ? y : null,
3648
+ colWidths: g((F = n.layout) == null ? void 0 : F.colWidths)
3649
+ });
3650
+ }
3651
+ }), C = V(() => {
3652
+ var y;
3653
+ return ((y = n.columns) == null ? void 0 : y.length) ?? 0;
3654
+ });
3655
+ function g(y) {
3656
+ if (!y) return null;
3657
+ const F = Object.entries(y).reduce(
3658
+ (B, c) => {
3659
+ const [u, A] = c;
3660
+ return A && A >= 40 ? B[u] = A : B[u] = null, B;
3661
+ },
3662
+ {}
3663
+ );
3664
+ return Object.values(F).some((B) => (B ?? 0) >= 40) ? F : null;
3665
+ }
3666
+ function $(y) {
3667
+ var F;
3668
+ return (F = n.columns) == null ? void 0 : F[y];
3669
+ }
3670
+ function O(y, F) {
3671
+ const B = F && F >= 40 ? F : null, c = { ...n.layout.colWidths ?? {} }, u = $(y);
3672
+ u != null && u.key && (c[u.key] = B), o("update:layout", {
3673
+ ...n.layout,
3674
+ rowHeight: S.value ?? null,
3675
+ colWidths: g(c)
3676
+ });
3677
+ }
3678
+ function i(y) {
3679
+ var c, u;
3680
+ const F = $(y), B = F != null && F.key ? (u = (c = n.layout) == null ? void 0 : c.colWidths) == null ? void 0 : u[F.key] : void 0;
3681
+ return B && B >= 40 ? B : null;
3682
+ }
3683
+ function s(y) {
3684
+ var F;
3685
+ return ((F = $(y)) == null ? void 0 : F.label) || "Column " + (y + 1);
3686
+ }
3687
+ return (y, F) => {
3688
+ const B = M("FmStepperField");
3689
+ return f(), P("div", Zo, [
3690
+ b("div", ea, [
3691
+ b("div", la, [
3692
+ b("p", ta, q(l(e)("report.section.datasource.rowHeight")), 1)
3693
+ ]),
3694
+ b("div", oa, [
3695
+ b("p", aa, q(l(e)("report.section.datasource.rowHeightHelper")), 1),
3696
+ p(B, {
3697
+ modelValue: S.value,
3698
+ "onUpdate:modelValue": F[0] || (F[0] = (c) => S.value = c),
3699
+ type: "number",
3700
+ suffix: "px",
3701
+ min: 30,
3702
+ placeholder: l(e)("report.common.auto")
3703
+ }, null, 8, ["modelValue", "placeholder"])
3704
+ ])
3705
+ ]),
3706
+ b("div", na, [
3707
+ b("div", ia, [
3708
+ b("p", sa, q(l(e)("report.section.datasource.columnWidth")), 1)
3709
+ ]),
3710
+ C.value > 0 ? (f(), P("div", ra, [
3711
+ b("p", ua, q(l(e)("report.section.datasource.columnWidthHelper")), 1),
3712
+ (f(!0), P(ue, null, Se(C.value, (c) => (f(), R(B, {
3713
+ key: s(c - 1),
3714
+ type: "number",
3715
+ "model-value": i(c - 1),
3716
+ label: s(c - 1),
3717
+ suffix: "px",
3718
+ min: 40,
3719
+ placeholder: l(e)("report.common.auto"),
3720
+ "onUpdate:modelValue": (u) => O(c - 1, Number(u) || null)
3721
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]))), 128))
3722
+ ])) : (f(), P("p", da, q(l(e)("report.section.datasource.columnWidthUnavailable")), 1))
3723
+ ])
3724
+ ]);
3725
+ };
3726
+ }
3727
+ }), ca = {
3728
+ key: 0,
3729
+ class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]"
3730
+ }, pa = {
3731
+ key: 1,
3732
+ class: "px-6 py-16 flex flex-col overflow-y-auto overflow-x-hidden"
3733
+ }, va = { class: "text-center" }, fa = /* @__PURE__ */ de({
3734
+ __name: "StyleEditorTab",
3735
+ props: /* @__PURE__ */ ve({
3736
+ tableResponse: {}
3737
+ }, {
3738
+ modelValue: {
3739
+ required: !0
3740
+ },
3741
+ modelModifiers: {},
3742
+ isEditingStyle: { type: Boolean, required: !1, default: !1 },
3743
+ isEditingStyleModifiers: {}
3744
+ }),
3745
+ emits: ["update:modelValue", "update:isEditingStyle"],
3746
+ setup(U) {
3747
+ const { t: v, locale: e } = pe(), n = ge(U, "modelValue"), o = V(
3748
+ () => Qe.find((h) => h.type === n.value.widget.type)
3749
+ ), S = ge(U, "isEditingStyle"), C = te(!1), { markStyleEditing: g, resetStyleEditing: $ } = Dl(S), O = U, i = [
3750
+ H.BarChart,
3751
+ H.StackBarChart,
3752
+ H.ClusteredStackBarChart,
3753
+ H.LineChart,
3754
+ H.StackLineChart,
3755
+ H.Circular
3756
+ ], s = V(() => i.includes(n.value.widget.type)), y = V(() => n.value.widget.type === H.Table), F = V(() => e.value.toLowerCase().startsWith("en")), B = V({
3757
+ get: () => ({
3758
+ rowHeight: n.value.widget.config.rowHeight,
3759
+ colWidths: n.value.widget.config.colWidths
3760
+ }),
3761
+ set: (h) => {
3762
+ g(), n.value.widget.config.rowHeight = h.rowHeight, n.value.widget.config.colWidths = h.colWidths;
3763
+ }
3764
+ }), c = V({
3765
+ get: () => n.value.widget.config,
3766
+ set: (h) => {
3767
+ g(), n.value.widget.config = h;
3768
+ }
3769
+ }), u = V(() => {
3770
+ var h, r;
3771
+ return y.value ? ((r = (h = O.tableResponse) == null ? void 0 : h.columns) == null ? void 0 : r.map((j) => ({
3772
+ key: j.key,
3773
+ label: j.label
3774
+ }))) ?? [] : [];
3775
+ });
3776
+ function A() {
3777
+ C.value = !0;
3778
+ }
3779
+ function L() {
3780
+ C.value = !1, $();
3781
+ }
3782
+ return (h, r) => {
3783
+ const j = M("FmCircularProgress"), Y = M("FmButton");
3784
+ return C.value ? (f(), P("div", ca, [
3785
+ p(Je, {
3786
+ "model-value": C.value,
3787
+ icon: "keyboard_double_arrow_right",
3788
+ title: l(v)("report.section.style.title"),
3789
+ "onUpdate:modelValue": r[0] || (r[0] = (w) => w ? A() : L())
3790
+ }, null, 8, ["model-value", "title"]),
3791
+ n.value ? (f(), P("div", pa, [
3792
+ s.value ? (f(), R(Qo, {
3793
+ key: 0,
3794
+ modelValue: c.value,
3795
+ "onUpdate:modelValue": r[1] || (r[1] = (w) => c.value = w),
3796
+ config: o.value
3797
+ }, null, 8, ["modelValue", "config"])) : z("", !0),
3798
+ y.value ? (f(), R(ma, {
3799
+ key: 1,
3800
+ layout: B.value,
3801
+ "onUpdate:layout": r[2] || (r[2] = (w) => B.value = w),
3802
+ columns: u.value
3803
+ }, null, 8, ["layout", "columns"])) : z("", !0)
3804
+ ])) : (f(), R(j, { key: 0 }))
3805
+ ])) : (f(), P("div", {
3806
+ key: 1,
3807
+ class: Fe([
3808
+ "bg-fm-color-neutral-white pt-16",
3809
+ F.value ? "flex h-full w-[156px] flex-col items-center justify-start gap-12 px-12" : "flex h-full w-[88px] flex-col items-center justify-start gap-16"
3810
+ ])
3811
+ }, [
3812
+ F.value ? (f(), P("button", {
3813
+ key: 0,
3814
+ class: "flex flex-col items-center gap-16 fm-typo-en-title-sm-600 text-fm-color-typo-primary",
3815
+ type: "button",
3816
+ onClick: A
3817
+ }, [
3818
+ p(Y, {
3819
+ variant: "secondary",
3820
+ icon: "keyboard_double_arrow_left",
3821
+ "border-color": l(Ue).ColorPrimary,
3822
+ "text-color": l(Ue).ColorPrimary,
3823
+ size: "md"
3824
+ }, null, 8, ["border-color", "text-color"]),
3825
+ b("span", va, q(l(v)("report.section.style.title")), 1)
3826
+ ])) : (f(), P(ue, { key: 1 }, [
3827
+ p(Y, {
3828
+ variant: "secondary",
3829
+ icon: "keyboard_double_arrow_left",
3830
+ "border-color": l(Ue).ColorPrimary,
3831
+ "text-color": l(Ue).ColorPrimary,
3832
+ size: "md",
3833
+ onClick: A
3834
+ }, null, 8, ["border-color", "text-color"]),
3835
+ b("button", {
3836
+ class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary [text-orientation:mixed] [writing-mode:vertical-rl]",
3837
+ type: "button",
3838
+ onClick: A
3839
+ }, q(l(v)("report.section.style.title")), 1)
3840
+ ], 64))
3841
+ ], 2));
3842
+ };
3843
+ }
3844
+ }), ga = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]" }, ya = { class: "text-center" }, ba = { class: "w-full overflow-y-auto" }, ha = {
3845
+ class: "grid grid-cols-12 w-full p-24",
3846
+ style: { backgroundColor: "#F6F8FC" }
3847
+ }, wa = /* @__PURE__ */ de({
3848
+ __name: "TileEditorDesktop",
3849
+ props: /* @__PURE__ */ ve({
3850
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
3851
+ index: { type: Number, required: !0, default: 0 }
3852
+ }, {
3853
+ modelValue: {
3854
+ required: !0
3855
+ },
3856
+ modelModifiers: {}
3857
+ }),
3858
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
3859
+ setup(U, { emit: v }) {
3860
+ const { locale: e, t: n } = pe(), o = ge(U, "modelValue"), S = U, C = V(
3861
+ () => Qe.find((B) => {
3862
+ var c, u;
3863
+ return B.type === ((u = (c = o.value) == null ? void 0 : c.widget) == null ? void 0 : u.type);
3864
+ })
3865
+ ), g = v, O = [...[
3866
+ H.BarChart,
3867
+ H.StackBarChart,
3868
+ H.ClusteredStackBarChart,
3869
+ H.LineChart,
3870
+ H.StackLineChart,
3871
+ H.Circular
3872
+ ], H.Table], i = V(() => O.includes(o.value.widget.type)), s = te(!1), y = te(null), F = V(() => e.value.toLowerCase().startsWith("en"));
3873
+ return (B, c) => {
3874
+ const u = M("FmCircularProgress"), A = M("FmButton");
3875
+ return f(), P("div", null, [
3876
+ o.value ? (f(), P(ue, { key: 1 }, [
3877
+ p(Hl, {
3878
+ "model-value": !U.hideConfiguration
3879
+ }, {
3880
+ right: K(() => [
3881
+ b("div", ga, [
3882
+ p(Ul, {
3883
+ modelValue: o.value,
3884
+ "onUpdate:modelValue": c[0] || (c[0] = (L) => o.value = L),
3885
+ "is-editing-style": s.value,
3886
+ "onUpdate:isEditingStyle": c[1] || (c[1] = (L) => s.value = L),
3887
+ config: C.value,
3888
+ "hide-configuration": U.hideConfiguration,
3889
+ onHideConfiguration: c[2] || (c[2] = (L) => {
3890
+ g("hideConfiguration", L);
3891
+ })
3892
+ }, null, 8, ["modelValue", "is-editing-style", "config", "hide-configuration"])
3893
+ ])
3894
+ ]),
3895
+ left: K(() => [
3896
+ b("div", {
3897
+ class: Fe([
3898
+ "bg-fm-color-neutral-white pt-16",
3899
+ F.value ? "flex h-full w-[156px] flex-col items-center justify-start gap-12 px-12" : "flex h-full w-[88px] flex-col items-center justify-start gap-16"
3900
+ ])
3901
+ }, [
3902
+ F.value ? (f(), P("button", {
3903
+ key: 0,
3904
+ class: "flex flex-col items-center gap-16 fm-typo-en-title-sm-600 text-fm-color-typo-primary",
3905
+ type: "button",
3906
+ onClick: c[3] || (c[3] = (L) => g("hideConfiguration", !S.hideConfiguration))
3907
+ }, [
3908
+ p(A, {
3909
+ variant: "secondary",
3910
+ icon: "keyboard_double_arrow_right",
3911
+ "border-color": l(Ue).ColorPrimary,
3912
+ "text-color": l(Ue).ColorPrimary,
3913
+ size: "md"
3914
+ }, null, 8, ["border-color", "text-color"]),
3915
+ b("span", ya, q(l(n)("report.tile.setupSetting")), 1)
3916
+ ])) : (f(), P(ue, { key: 1 }, [
3917
+ p(A, {
3918
+ variant: "secondary",
3919
+ icon: "keyboard_double_arrow_right",
3920
+ "border-color": l(Ue).ColorPrimary,
3921
+ "text-color": l(Ue).ColorPrimary,
3922
+ size: "md",
3923
+ onClick: c[4] || (c[4] = (L) => g("hideConfiguration", !S.hideConfiguration))
3924
+ }, null, 8, ["border-color", "text-color"]),
3925
+ b("button", {
3926
+ class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary [text-orientation:mixed] [writing-mode:vertical-rl]",
3927
+ type: "button",
3928
+ onClick: c[5] || (c[5] = (L) => g("hideConfiguration", !S.hideConfiguration))
3929
+ }, q(l(n)("report.tile.setupSetting")), 1)
3930
+ ], 64))
3931
+ ], 2)
3932
+ ]),
3933
+ _: 1
3934
+ }, 8, ["model-value"]),
3935
+ b("div", ba, [
3936
+ b("div", ha, [
3937
+ o.value ? (f(), R(_l, {
3938
+ key: 0,
3939
+ "model-value": o.value,
3940
+ index: S.index,
3941
+ "is-tile-editor": !0,
3942
+ "hide-export": !0,
3943
+ "is-editing-style": s.value,
3944
+ "onUpdate:tableResponse": c[6] || (c[6] = (L) => y.value = L)
3945
+ }, null, 8, ["model-value", "index", "is-editing-style"])) : (f(), R(Tl, { key: 1 }))
3946
+ ])
3947
+ ]),
3948
+ i.value ? (f(), R(fa, {
3949
+ key: 0,
3950
+ modelValue: o.value,
3951
+ "onUpdate:modelValue": c[7] || (c[7] = (L) => o.value = L),
3952
+ "is-editing-style": s.value,
3953
+ "onUpdate:isEditingStyle": c[8] || (c[8] = (L) => s.value = L),
3954
+ "table-response": y.value
3955
+ }, null, 8, ["modelValue", "is-editing-style", "table-response"])) : z("", !0)
3956
+ ], 64)) : (f(), R(u, { key: 0 }))
3957
+ ]);
3958
+ };
3959
+ }
3960
+ }), Ca = {
3961
+ key: 0,
3962
+ class: "flex w-full justify-center items-center"
3963
+ }, xa = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, ka = /* @__PURE__ */ de({
3964
+ __name: "TileEditorMobile",
3965
+ props: /* @__PURE__ */ ve({
3966
+ hideConfiguration: { type: Boolean, required: !0, default: !1 },
3967
+ index: { type: Number, required: !0, default: 0 }
3968
+ }, {
3969
+ modelValue: {
3970
+ required: !0
3971
+ },
3972
+ modelModifiers: {}
3973
+ }),
3974
+ emits: /* @__PURE__ */ ve(["hideConfiguration"], ["update:modelValue"]),
3975
+ setup(U, { emit: v }) {
3976
+ const e = ge(U, "modelValue"), n = U, o = V(
3977
+ () => Qe.find((C) => {
3978
+ var g, $;
3979
+ return C.type === (($ = (g = e.value) == null ? void 0 : g.widget) == null ? void 0 : $.type);
3980
+ })
3981
+ ), S = v;
3982
+ return (C, g) => {
3983
+ const $ = M("FmCircularProgress");
3984
+ return f(), P("div", null, [
3985
+ e.value ? (f(), P(ue, { key: 1 }, [
3986
+ b("div", xa, [
3987
+ e.value ? (f(), R(_l, {
3988
+ key: 0,
3989
+ "model-value": e.value,
3990
+ index: n.index,
3991
+ "is-tile-editor": !0,
3992
+ "hide-export": !0
3993
+ }, null, 8, ["model-value", "index"])) : (f(), R(Tl, { key: 1 }))
3994
+ ]),
3995
+ p(Ul, {
3996
+ modelValue: e.value,
3997
+ "onUpdate:modelValue": g[0] || (g[0] = (O) => e.value = O),
3998
+ config: o.value,
3999
+ "hide-configuration": U.hideConfiguration,
4000
+ onHideConfiguration: g[1] || (g[1] = (O) => {
4001
+ S("hideConfiguration", O);
4002
+ })
4003
+ }, null, 8, ["modelValue", "config", "hide-configuration"])
4004
+ ], 64)) : (f(), P("div", Ca, [
4005
+ p($)
4006
+ ]))
4007
+ ]);
4008
+ };
4009
+ }
4010
+ }), Fa = {
4011
+ key: 0,
4012
+ class: "fm-typo-en-title-md-600"
4013
+ }, Va = {
4014
+ key: 0,
4015
+ class: "flex items-start justify-start px-24 py-12 flex-wrap w-full"
4016
+ }, Ra = /* @__PURE__ */ de({
4017
+ __name: "TileEditor",
4018
+ setup(U) {
4019
+ const v = Pl(), e = El(), n = Fl(), { globalFilters: o } = Ne(Jl()), { currentSelectWidgetType: S, editingReport: C, editingTile: g, editingTileIndex: $ } = Ne(n), { breakpoints: O } = Sl(), { promptMessage: i } = Vl(), { t: s, te: y } = pe(), F = V(() => {
4020
+ var r, j;
4021
+ const L = (j = (r = g.value) == null ? void 0 : r.widget) == null ? void 0 : j.type;
4022
+ if (!L)
4023
+ return s("report.editor.newReport");
4024
+ const h = `report.widget.types.${L.toLowerCase()}`;
4025
+ return y(h) ? s(h) : L;
4026
+ }), B = te(!1);
4027
+ function c() {
4028
+ S.value = void 0, g.value = void 0, $.value = -1, pl.value = null, e.back();
4029
+ }
4030
+ async function u() {
4031
+ var h, r;
4032
+ if (!C.value) return;
4033
+ if (await i({
4034
+ title: s("report.tile.save.title"),
4035
+ message: s("report.tile.save.confirm", { title: ((r = (h = g.value) == null ? void 0 : h.widget) == null ? void 0 : r.title) ?? "" })
4036
+ }) && g.value) {
4037
+ const j = Ql(C.value.tiles, pl.value);
4038
+ $.value === -1 ? j.push(g.value) : j[$.value] = g.value, c();
4039
+ }
4040
+ }
4041
+ async function A() {
4042
+ var h, r;
4043
+ if (!C.value) return;
4044
+ await i({
4045
+ title: s("report.tile.cancel.title"),
4046
+ message: s("report.tile.cancel.confirm", { title: ((r = (h = g.value) == null ? void 0 : h.widget) == null ? void 0 : r.title) ?? "" })
4047
+ }) && c();
4048
+ }
4049
+ return xl(() => {
4050
+ C.value || e.push({ name: "reports" });
4051
+ }), (L, h) => {
4052
+ const r = M("FmPageHead");
4053
+ return f(), R(ql, null, {
4054
+ default: K(() => [
4055
+ p(r, {
4056
+ actions: [
4057
+ { label: l(s)("report.common.cancel"), value: "cancel", isPrimary: !1 },
4058
+ { label: l(s)("report.common.save"), value: "save", isPrimary: !0 }
4059
+ ],
4060
+ "onClick:action": h[0] || (h[0] = (j) => {
4061
+ j === "cancel" && A(), j === "save" && u();
4062
+ })
4063
+ }, {
4064
+ title: K(() => [
4065
+ l(O).lg || l(O).md ? (f(), P("p", Fa, q(F.value), 1)) : z("", !0)
4066
+ ]),
4067
+ _: 1
4068
+ }, 8, ["actions"]),
4069
+ l(g) && (l(o) || []).some((j) => {
4070
+ const Y = j.tileIds, w = l(g) && l(g).id;
4071
+ return Array.isArray(Y) && typeof w == "string" && Y.includes(w);
4072
+ }) ? (f(), P("div", Va, [
4073
+ p(Kl)
4074
+ ])) : z("", !0),
4075
+ l(g) ? (f(), R(Cl(l(O).lg || l(O).md ? wa : ka), {
4076
+ key: 1,
4077
+ modelValue: l(g),
4078
+ "onUpdate:modelValue": h[1] || (h[1] = (j) => Il(g) ? g.value = j : null),
4079
+ class: Fe(`${l(O).lg || l(O).md ? "flex" : ""} w-full`),
4080
+ style: ol({ height: `calc( 100% - ${l(O).lg || l(O).md ? 72 : 64}px)` }),
4081
+ "hide-configuration": B.value,
4082
+ index: Number(l(v).params.tileIndex),
4083
+ onHideConfiguration: h[2] || (h[2] = (j) => B.value = j)
4084
+ }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : z("", !0)
4085
+ ]),
4086
+ _: 1
4087
+ });
4088
+ };
4089
+ }
4090
+ });
4091
+ export {
4092
+ Ra as default
4093
+ };