@feedmepos/mf-report 5.35.0 → 5.35.1

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