@feedmepos/mf-report 5.27.25 → 5.27.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/{App-DjVs-2jP.js → App-C_04mBmg.js} +4 -4
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-BuO42-MR.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-CIStXVl_.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-8Lfk9D0S.js → Default.vue_vue_type_script_setup_true_lang-Go7gifP6.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BGD1_4cA.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DkUAO3Pw.js} +3 -3
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DXtWF7LP.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-C8BAjwYE.js} +1316 -1315
  6. package/dist/{InsightView-D6b8_QUl.js → InsightView-DxcA19xM.js} +4 -4
  7. package/dist/{Integration-D3swSuoZ.js → Integration-BjDMACOk.js} +3 -3
  8. package/dist/{Integrations-BipzHbPq.js → Integrations-C0ygYpUr.js} +2 -2
  9. package/dist/{Layout-D2KTFMYS.js → Layout-BZt9uxku.js} +1 -1
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-kFFnLTTQ.js +130 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-TBmbqppw.js → NavigationTab.vue_vue_type_script_setup_true_lang-C5oOG7nr.js} +3 -3
  12. package/dist/{OverviewView-D8eN2tXc.js → OverviewView-B413Q1mY.js} +4 -4
  13. package/dist/{Report-D7oY7MNR.js → Report-CpgL93uy.js} +3 -3
  14. package/dist/{ReportEditor-D4Sdv6-2.js → ReportEditor-CthLn0Wx.js} +479 -476
  15. package/dist/{ReportView-L_VETn4p.js → ReportView-B2D5Jl3u.js} +6 -6
  16. package/dist/{Setting-CC9wH9NT.js → Setting-BuSJoJVP.js} +3 -3
  17. package/dist/{Template-DHm7_rLJ.js → Template-BLh1du5v.js} +3 -3
  18. package/dist/{TileEditor-CQAqJkTy.js → TileEditor-VQxT6p51.js} +137 -137
  19. package/dist/{TileGrid.vue_vue_type_script_setup_true_lang-jbujDyFY.js → TileGrid.vue_vue_type_script_setup_true_lang-Bc2TNbmf.js} +1 -1
  20. package/dist/{TransitionFade-BYS_PD1Y.js → TransitionFade-DnF7WkzY.js} +4 -4
  21. package/dist/{app-dOrzXjgr.js → app-CZ1_gioS.js} +12 -12
  22. package/dist/app.js +1 -1
  23. package/dist/{useRestaurantPermission-BhsJdiXZ.js → useRestaurantPermission-DCs4m_N3.js} +1 -1
  24. package/package.json +1 -1
  25. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-CpLX_mmh.js +0 -107
@@ -1,19 +1,19 @@
1
- import { defineComponent as Ce, mergeModels as Se, useModel as De, ref as z, computed as g, resolveComponent as x, createBlock as S, openBlock as u, withCtx as _, createElementVNode as h, createVNode as i, unref as o, normalizeClass as Ue, createTextVNode as ze, toDisplayString as E, createElementBlock as R, Fragment as xe, renderSlot as ct, createCommentVNode as U, watch as ge, renderList as Be, onMounted as pt, onUnmounted as Vt, resolveDynamicComponent as Tt, isRef as vt, normalizeStyle as et } from "vue";
2
- import { W as $t, g as St, _ as Dt, a as Ot, e as Ie, d as ft, b as gt, S as Ae, T as Nt, c as It } from "./TransitionFade-BYS_PD1Y.js";
3
- import { C as Te, D as oe, c as Re, g as Rt, u as lt, M as bt, r as Mt, d as rt, n as Bt, e as Ut, f as qt, h as Et, i as Pt, a as zt, j as it, k as Qe, m as Lt, Q as We, o as Gt, l as At, b as st, p as Wt } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DXtWF7LP.js";
1
+ import { defineComponent as xe, mergeModels as Se, useModel as De, ref as z, computed as f, resolveComponent as F, createBlock as S, openBlock as d, withCtx as _, createElementVNode as h, createVNode as i, unref as o, normalizeClass as Ue, createTextVNode as ze, toDisplayString as E, createElementBlock as R, Fragment as Fe, renderSlot as ct, createCommentVNode as U, watch as be, renderList as Be, onMounted as pt, onUnmounted as Vt, resolveDynamicComponent as Tt, isRef as vt, normalizeStyle as et } from "vue";
2
+ import { W as $t, g as St, _ as Dt, a as Ot, e as Ie, d as ft, b as gt, S as Ae, T as Nt, c as It } from "./TransitionFade-DnF7WkzY.js";
3
+ import { C as Te, D as oe, d as Re, g as Rt, u as lt, M as bt, r as Mt, e as rt, n as Bt, f as Ut, h as qt, i as Et, j as Pt, a as zt, b as it, k as Qe, m as Lt, Q as We, o as Gt, l as At, c as st, p as Wt } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-C8BAjwYE.js";
4
4
  import { storeToRefs as Me } from "pinia";
5
5
  import { useRouter as ot, useRoute as at } from "vue-router";
6
6
  import { useBreakpoints as He, useSnackbar as yt, FmButtonColorThemeVariant as $e } from "@feedmepos/ui-library";
7
7
  import { u as nt } from "./message-dialog-UoMWOnil.js";
8
8
  import { u as qe, a as Ht } from "./_plugin-vue_export-helper-onplcgja.js";
9
9
  import { r as Le } from "./i18n-CI_sQ5d_.js";
10
- import { _ as Ye } from "./TileGrid.vue_vue_type_script_setup_true_lang-jbujDyFY.js";
10
+ import { _ as Ye } from "./TileGrid.vue_vue_type_script_setup_true_lang-Bc2TNbmf.js";
11
11
  import { a as Xe, _ as Ze } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGbb3b5G.js";
12
- import { i as jt } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-BGD1_4cA.js";
12
+ import { i as jt } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-DkUAO3Pw.js";
13
13
  import { useCoreStore as Jt } from "@feedmepos/mf-common";
14
- import { u as Kt, a as Qt } from "./app-dOrzXjgr.js";
15
- import { d as Yt } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BuO42-MR.js";
16
- const Xt = /* @__PURE__ */ Ce({
14
+ import { u as Kt, a as Qt } from "./app-CZ1_gioS.js";
15
+ import { d as Yt } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-CIStXVl_.js";
16
+ const Xt = /* @__PURE__ */ xe({
17
17
  __name: "WidgetDialog",
18
18
  props: /* @__PURE__ */ Se({
19
19
  isOpen: { type: Boolean }
@@ -22,19 +22,19 @@ const Xt = /* @__PURE__ */ Ce({
22
22
  modelModifiers: {}
23
23
  }),
24
24
  emits: /* @__PURE__ */ Se(["update:isOpen"], ["update:modelValue"]),
25
- setup(M, { emit: d }) {
26
- const { t: a } = qe(), { breakpoints: c } = He(), v = De(M, "modelValue"), b = M, B = d;
25
+ setup(M, { emit: u }) {
26
+ const { t: a } = qe(), { breakpoints: c } = He(), v = De(M, "modelValue"), g = M, B = u;
27
27
  function Y() {
28
28
  B("update:isOpen", !1);
29
29
  }
30
30
  function k() {
31
31
  y.value && (v.value = y.value, y.value = void 0, B("update:isOpen", !1));
32
32
  }
33
- const y = z(), C = g(() => !y.value);
33
+ const y = z(), x = f(() => !y.value);
34
34
  return (O, G) => {
35
- const D = x("FmButton"), V = x("FmDialog");
36
- return u(), S(V, {
37
- "model-value": b.isOpen
35
+ const D = F("FmButton"), T = F("FmDialog");
36
+ return d(), S(T, {
37
+ "model-value": g.isOpen
38
38
  }, {
39
39
  "dialog-header": _(() => [
40
40
  ze(E(o(a)("report.widget.type")), 1)
@@ -42,7 +42,7 @@ const Xt = /* @__PURE__ */ Ce({
42
42
  default: _(() => [
43
43
  i($t, {
44
44
  modelValue: y.value,
45
- "onUpdate:modelValue": G[0] || (G[0] = (T) => y.value = T),
45
+ "onUpdate:modelValue": G[0] || (G[0] = ($) => y.value = $),
46
46
  class: Ue(`grid ${o(c).lg || o(c).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
47
47
  "child-class": "p-[8px] flex flex-col"
48
48
  }, null, 8, ["modelValue", "class"])
@@ -56,7 +56,7 @@ const Xt = /* @__PURE__ */ Ce({
56
56
  }, null, 8, ["label"]),
57
57
  i(D, {
58
58
  label: o(a)("report.common.confirm"),
59
- disabled: C.value,
59
+ disabled: x.value,
60
60
  onClick: k
61
61
  }, null, 8, ["label", "disabled"])
62
62
  ]),
@@ -64,7 +64,7 @@ const Xt = /* @__PURE__ */ Ce({
64
64
  }, 8, ["model-value"]);
65
65
  };
66
66
  }
67
- }), Zt = { class: "fm-typo-en-body-lg-600" }, tt = /* @__PURE__ */ Ce({
67
+ }), Zt = { class: "fm-typo-en-body-lg-600" }, tt = /* @__PURE__ */ xe({
68
68
  __name: "ReportEditorTabHeader",
69
69
  props: /* @__PURE__ */ Se({
70
70
  icon: {
@@ -77,22 +77,22 @@ const Xt = /* @__PURE__ */ Ce({
77
77
  }),
78
78
  emits: ["update:modelValue"],
79
79
  setup(M) {
80
- const { t: d } = qe(), a = De(M, "modelValue"), c = M;
81
- return (v, b) => {
82
- const B = x("FmIcon");
83
- return u(), R("div", {
80
+ const { t: u } = qe(), a = De(M, "modelValue"), c = M;
81
+ return (v, g) => {
82
+ const B = F("FmIcon");
83
+ return d(), R("div", {
84
84
  class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
85
- onClick: b[0] || (b[0] = (Y) => a.value = !a.value)
85
+ onClick: g[0] || (g[0] = (Y) => a.value = !a.value)
86
86
  }, [
87
- h("p", Zt, E(o(d)("report.editor.customizeReport")), 1),
88
- b[1] || (b[1] = h("div", { class: "grow" }, null, -1)),
87
+ h("p", Zt, E(o(u)("report.editor.customizeReport")), 1),
88
+ g[1] || (g[1] = h("div", { class: "grow" }, null, -1)),
89
89
  i(B, {
90
90
  name: c.icon
91
91
  }, null, 8, ["name"])
92
92
  ]);
93
93
  };
94
94
  }
95
- }), el = /* @__PURE__ */ Ce({
95
+ }), el = /* @__PURE__ */ xe({
96
96
  __name: "ReportEditorTabDesktop",
97
97
  props: {
98
98
  modelValue: { required: !0, default: !1 },
@@ -100,17 +100,17 @@ const Xt = /* @__PURE__ */ Ce({
100
100
  },
101
101
  emits: ["update:modelValue"],
102
102
  setup(M) {
103
- const d = De(M, "modelValue");
104
- return (a, c) => (u(), R(xe, null, [
103
+ const u = De(M, "modelValue");
104
+ return (a, c) => (d(), R(Fe, null, [
105
105
  i(tt, {
106
- modelValue: d.value,
107
- "onUpdate:modelValue": c[0] || (c[0] = (v) => d.value = v),
106
+ modelValue: u.value,
107
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => u.value = v),
108
108
  icon: "keyboard_double_arrow_left"
109
109
  }, null, 8, ["modelValue"]),
110
110
  ct(a.$slots, "default")
111
111
  ], 64));
112
112
  }
113
- }), tl = /* @__PURE__ */ Ce({
113
+ }), tl = /* @__PURE__ */ xe({
114
114
  __name: "ReportEditorTabMobile",
115
115
  props: {
116
116
  modelValue: { required: !0, default: !1 },
@@ -118,28 +118,28 @@ const Xt = /* @__PURE__ */ Ce({
118
118
  },
119
119
  emits: ["update:modelValue"],
120
120
  setup(M) {
121
- const d = De(M, "modelValue");
121
+ const u = De(M, "modelValue");
122
122
  return (a, c) => {
123
- const v = x("FmTopSheet"), b = x("FmCard");
124
- return u(), S(b, { class: "fixed bottom-0 w-full" }, {
123
+ const v = F("FmTopSheet"), g = F("FmCard");
124
+ return d(), S(g, { class: "fixed bottom-0 w-full" }, {
125
125
  default: _(() => [
126
126
  i(tt, {
127
- modelValue: d.value,
128
- "onUpdate:modelValue": c[0] || (c[0] = (B) => d.value = B),
127
+ modelValue: u.value,
128
+ "onUpdate:modelValue": c[0] || (c[0] = (B) => u.value = B),
129
129
  icon: "keyboard_double_arrow_up"
130
130
  }, null, 8, ["modelValue"]),
131
131
  i(v, {
132
- modelValue: d.value,
133
- "onUpdate:modelValue": c[2] || (c[2] = (B) => d.value = B),
132
+ modelValue: u.value,
133
+ "onUpdate:modelValue": c[2] || (c[2] = (B) => u.value = B),
134
134
  "fullscreen-size": "sm"
135
135
  }, {
136
136
  default: _(() => [
137
137
  i(tt, {
138
- modelValue: d.value,
139
- "onUpdate:modelValue": c[1] || (c[1] = (B) => d.value = B),
138
+ modelValue: u.value,
139
+ "onUpdate:modelValue": c[1] || (c[1] = (B) => u.value = B),
140
140
  icon: "keyboard_double_arrow_down"
141
141
  }, null, 8, ["modelValue"]),
142
- d.value ? ct(a.$slots, "default", { key: 0 }) : U("", !0)
142
+ u.value ? ct(a.$slots, "default", { key: 0 }) : U("", !0)
143
143
  ]),
144
144
  _: 3
145
145
  }, 8, ["modelValue"])
@@ -160,7 +160,7 @@ const Xt = /* @__PURE__ */ Ce({
160
160
  }, sl = {
161
161
  key: 3,
162
162
  class: "flex flex-col gap-2"
163
- }, ul = /* @__PURE__ */ Ce({
163
+ }, ul = /* @__PURE__ */ xe({
164
164
  __name: "GlobalFilterDialog",
165
165
  props: /* @__PURE__ */ Se({
166
166
  schemas: {
@@ -181,66 +181,66 @@ const Xt = /* @__PURE__ */ Ce({
181
181
  }),
182
182
  emits: ["update:globalFilter", "update:isOpen"],
183
183
  setup(M) {
184
- const { t: d, te: a } = qe(), c = De(M, "globalFilter"), v = De(M, "isOpen"), b = yt(), B = M, Y = z(""), k = z(), y = z(), C = z(), O = z([]), G = z([]), D = z(!1), V = z([]), T = z([]), X = z(Te.Equal);
184
+ const { t: u, te: a } = qe(), c = De(M, "globalFilter"), v = De(M, "isOpen"), g = yt(), B = M, Y = z(""), k = z(), y = z(), x = z(), O = z([]), G = z([]), D = z(!1), T = z([]), $ = z([]), X = z(Te.Equal);
185
185
  function ae(l) {
186
186
  return JSON.parse(JSON.stringify(l));
187
187
  }
188
- function Fe(l, e) {
188
+ function Ce(l, e) {
189
189
  return { hour: l, minute: e };
190
190
  }
191
191
  function ue(l) {
192
192
  return l ? `${String(l.hour).padStart(2, "0")}:${String(l.minute).padStart(2, "0")}` : null;
193
193
  }
194
- function j(l) {
194
+ function J(l) {
195
195
  if (!l) return null;
196
196
  const [e, s] = l.split(":").map(Number);
197
197
  return Number.isNaN(e) || Number.isNaN(s) ? null : { hour: e, minute: s };
198
198
  }
199
- const w = g(() => y.value ? !(y.value.type === oe.Timestamp && C.value === Re.DateTime) : !1), Z = g(
199
+ const w = f(() => y.value ? !(y.value.type === oe.Timestamp && x.value === Re.DateTime) : !1), ee = f(
200
200
  () => {
201
201
  var l;
202
- return ((l = y.value) == null ? void 0 : l.type) === oe.Timestamp && C.value === Re.TimeOfDay;
202
+ return ((l = y.value) == null ? void 0 : l.type) === oe.Timestamp && x.value === Re.TimeOfDay;
203
203
  }
204
- ), ne = g(() => {
204
+ ), ne = f(() => {
205
205
  var l;
206
206
  return (((l = y.value) == null ? void 0 : l.filterOperators) ?? []).filter((e) => e !== Te.And && e !== Te.Or).map((e) => ({
207
- label: d(`report.section.comparisonOperator.${e}`),
207
+ label: u(`report.section.comparisonOperator.${e}`),
208
208
  value: e
209
209
  }));
210
210
  });
211
- function te() {
211
+ function le() {
212
212
  var e;
213
213
  const l = (e = ne.value[0]) == null ? void 0 : e.value;
214
214
  return l || (y.value ? H(
215
215
  y.value.type,
216
- C.value ?? null
216
+ x.value ?? null
217
217
  ) : Te.Equal);
218
218
  }
219
219
  function re(l) {
220
220
  if (y.value)
221
221
  return Rt({
222
- operator: l ?? te(),
222
+ operator: l ?? le(),
223
223
  dataType: y.value.type,
224
- dimensionOption: y.value.type === oe.Timestamp ? C.value ?? null : null,
225
- t: d
224
+ dimensionOption: y.value.type === oe.Timestamp ? x.value ?? null : null,
225
+ t: u
226
226
  });
227
227
  }
228
- function ce(l, e) {
229
- if (typeof (e == null ? void 0 : e.default) == "boolean" || l.length > 0 && l.every((F) => typeof F == "boolean")) {
230
- const F = l.reduce((I, J) => (typeof J == "boolean" && I.push(J), I), []);
228
+ function pe(l, e) {
229
+ if (typeof (e == null ? void 0 : e.default) == "boolean" || l.length > 0 && l.every((C) => typeof C == "boolean")) {
230
+ const C = l.reduce((I, j) => (typeof j == "boolean" && I.push(j), I), []);
231
231
  if (e)
232
- for (e.fixed && F.splice(e.count); F.length < e.count; )
233
- F.push(typeof e.default == "boolean" ? e.default : !1);
234
- return F;
232
+ for (e.fixed && C.splice(e.count); C.length < e.count; )
233
+ C.push(typeof e.default == "boolean" ? e.default : !1);
234
+ return C;
235
235
  }
236
- const p = l.reduce((F, I) => (typeof I == "string" && F.push(I), F), []);
236
+ const p = l.reduce((C, I) => (typeof I == "string" && C.push(I), C), []);
237
237
  if (e)
238
238
  for (e.fixed && p.splice(e.count); p.length < e.count; )
239
239
  p.push(typeof e.default == "string" ? e.default : "");
240
240
  return p;
241
241
  }
242
- function pe(l = X.value) {
243
- const e = re(l), s = ce(
242
+ function ve(l = X.value) {
243
+ const e = re(l), s = pe(
244
244
  e ? Array(e.count).fill(e.default) : [],
245
245
  e
246
246
  );
@@ -253,32 +253,32 @@ const Xt = /* @__PURE__ */ Ce({
253
253
  function q() {
254
254
  return {
255
255
  name: "",
256
- startTime: Fe(0, 0),
257
- endTime: Fe(23, 59)
256
+ startTime: Ce(0, 0),
257
+ endTime: Ce(23, 59)
258
258
  };
259
259
  }
260
260
  function L() {
261
261
  if (!(!w.value || !D.value)) {
262
- if (Z.value) {
263
- T.value.length === 0 && (T.value = [q()]);
262
+ if (ee.value) {
263
+ $.value.length === 0 && ($.value = [q()]);
264
264
  return;
265
265
  }
266
- V.value.length === 0 && (V.value = [pe()]);
266
+ T.value.length === 0 && (T.value = [ve()]);
267
267
  }
268
268
  }
269
269
  function K() {
270
- var s, p, F;
270
+ var s, p, C;
271
271
  const l = ae(((s = c.value) == null ? void 0 : s.customOptions) ?? []), e = ae(((p = c.value) == null ? void 0 : p.customTimeRanges) ?? []);
272
- X.value = ((F = l[0]) == null ? void 0 : F.operator) ?? te(), D.value = l.length > 0 || e.length > 0, V.value = l, T.value = e, L();
272
+ X.value = ((C = l[0]) == null ? void 0 : C.operator) ?? le(), D.value = l.length > 0 || e.length > 0, T.value = l, $.value = e, L();
273
273
  }
274
- function ve(l) {
275
- X.value = l, V.value = V.value.map((e, s) => {
276
- const p = V.value[s];
274
+ function fe(l) {
275
+ X.value = l, T.value = T.value.map((e, s) => {
276
+ const p = T.value[s];
277
277
  if (!p)
278
- return pe(l);
279
- const F = re(l), I = ce(
278
+ return ve(l);
279
+ const C = re(l), I = pe(
280
280
  Array.isArray(p.values) ? [...p.values] : [],
281
- F
281
+ C
282
282
  );
283
283
  return {
284
284
  ...p,
@@ -287,25 +287,25 @@ const Xt = /* @__PURE__ */ Ce({
287
287
  };
288
288
  });
289
289
  }
290
- function be() {
291
- V.value = [...V.value, pe()];
290
+ function ye() {
291
+ T.value = [...T.value, ve()];
292
292
  }
293
293
  function Q(l) {
294
- V.value.length <= 1 || (V.value = V.value.filter((e, s) => s !== l));
294
+ T.value.length <= 1 || (T.value = T.value.filter((e, s) => s !== l));
295
295
  }
296
296
  function ke() {
297
- T.value = [...T.value, q()];
297
+ $.value = [...$.value, q()];
298
298
  }
299
299
  function ie(l) {
300
- T.value.length <= 1 || (T.value = T.value.filter(
300
+ $.value.length <= 1 || ($.value = $.value.filter(
301
301
  (e, s) => s !== l
302
302
  ));
303
303
  }
304
- function fe(l, e, s) {
305
- const p = T.value[l];
306
- p && (T.value[l] = {
304
+ function ge(l, e, s) {
305
+ const p = $.value[l];
306
+ p && ($.value[l] = {
307
307
  ...p,
308
- [e]: j(s)
308
+ [e]: J(s)
309
309
  });
310
310
  }
311
311
  function Ve(l) {
@@ -313,95 +313,95 @@ const Xt = /* @__PURE__ */ Ce({
313
313
  }
314
314
  function Oe() {
315
315
  if (!D.value) return !0;
316
- if (Z.value) {
317
- const s = T.value.map((F) => F.name.trim()).filter(Boolean);
318
- return T.value.some(
319
- (F) => !F.name.trim() || !F.startTime || !F.endTime
320
- ) ? (b.open({
321
- message: d("report.section.filter.invalidCustomTimeRange"),
316
+ if (ee.value) {
317
+ const s = $.value.map((C) => C.name.trim()).filter(Boolean);
318
+ return $.value.some(
319
+ (C) => !C.name.trim() || !C.startTime || !C.endTime
320
+ ) ? (g.open({
321
+ message: u("report.section.filter.invalidCustomTimeRange"),
322
322
  type: "error"
323
- }), !1) : new Set(s).size !== s.length ? (b.open({
324
- message: d("report.section.filter.customTimeRangeNamesMustBeUnique"),
323
+ }), !1) : new Set(s).size !== s.length ? (g.open({
324
+ message: u("report.section.filter.customTimeRangeNamesMustBeUnique"),
325
325
  type: "error"
326
326
  }), !1) : !0;
327
327
  }
328
- const l = V.value.map((s) => s.label.trim()).filter(Boolean);
329
- return V.value.some(
328
+ const l = T.value.map((s) => s.label.trim()).filter(Boolean);
329
+ return T.value.some(
330
330
  (s) => !s.label.trim() || Ve(s.values)
331
- ) ? (b.open({ message: d("report.section.filter.invalidCustomOption"), type: "error" }), !1) : new Set(l).size !== l.length ? (b.open({
332
- message: d("report.section.filter.customOptionLabelsMustBeUnique"),
331
+ ) ? (g.open({ message: u("report.section.filter.invalidCustomOption"), type: "error" }), !1) : new Set(l).size !== l.length ? (g.open({
332
+ message: u("report.section.filter.customOptionLabelsMustBeUnique"),
333
333
  type: "error"
334
334
  }), !1) : !0;
335
335
  }
336
- ge(v, (l) => {
337
- var e, s, p, F, I;
336
+ be(v, (l) => {
337
+ var e, s, p, C, I;
338
338
  l && (Y.value = ((e = c.value) == null ? void 0 : e.label) || "", k.value = B.schemas.find(
339
- (J) => {
340
- var le;
341
- return J.name === ((le = c.value) == null ? void 0 : le.schemaName);
339
+ (j) => {
340
+ var Z;
341
+ return j.name === ((Z = c.value) == null ? void 0 : Z.schemaName);
342
342
  }
343
- ), y.value = (s = he.value.find(
344
- (J) => {
345
- var le;
346
- return J.value.name === ((le = c.value) == null ? void 0 : le.name);
343
+ ), y.value = (s = _e.value.find(
344
+ (j) => {
345
+ var Z;
346
+ return j.value.name === ((Z = c.value) == null ? void 0 : Z.name);
347
347
  }
348
- )) == null ? void 0 : s.value, C.value = (p = c.value) == null ? void 0 : p.option, O.value = ((F = c.value) == null ? void 0 : F.tileIds) || [], G.value = ((I = c.value) == null ? void 0 : I.filters) || [], K());
349
- }), ge(D, (l) => {
348
+ )) == null ? void 0 : s.value, x.value = (p = c.value) == null ? void 0 : p.option, O.value = ((C = c.value) == null ? void 0 : C.tileIds) || [], G.value = ((I = c.value) == null ? void 0 : I.filters) || [], K());
349
+ }), be(D, (l) => {
350
350
  var e;
351
- l && (X.value = ((e = V.value[0]) == null ? void 0 : e.operator) ?? te(), L());
352
- }), ge(w, (l) => {
351
+ l && (X.value = ((e = T.value[0]) == null ? void 0 : e.operator) ?? le(), L());
352
+ }), be(w, (l) => {
353
353
  if (!l) {
354
- D.value = !1, V.value = [], T.value = [];
354
+ D.value = !1, T.value = [], $.value = [];
355
355
  return;
356
356
  }
357
357
  L();
358
- }), ge(Z, () => {
358
+ }), be(ee, () => {
359
359
  L();
360
- }), ge(ne, (l) => {
360
+ }), be(ne, (l) => {
361
361
  var s;
362
362
  const e = (s = l[0]) == null ? void 0 : s.value;
363
- e && (l.some((p) => p.value === X.value) || ve(e));
363
+ e && (l.some((p) => p.value === X.value) || fe(e));
364
364
  });
365
- const ye = g(
365
+ const he = f(
366
366
  () => B.schemas.map((l) => ({
367
367
  label: l.label || l.name,
368
368
  value: l
369
369
  }))
370
- ), he = g(() => {
370
+ ), _e = f(() => {
371
371
  var l;
372
372
  return (((l = k.value) == null ? void 0 : l.fields) || []).filter((e) => e.type !== oe.Numeric).map((e) => ({
373
373
  label: e.label || e.name,
374
374
  value: e
375
375
  }));
376
- }), Ee = g(() => {
376
+ }), Ee = f(() => {
377
377
  var l;
378
- return ((l = y.value) == null ? void 0 : l.type) !== oe.Timestamp ? [] : St(d);
379
- }), n = g(() => B.tiles.reduce((l, e, s) => {
380
- var I, J, le, me, _e;
381
- const p = ((I = e.widget) == null ? void 0 : I.config.schemaNames) ?? [], F = (((J = e.widget) == null ? void 0 : J.config.joinDatasources) ?? []).flatMap(
378
+ return ((l = y.value) == null ? void 0 : l.type) !== oe.Timestamp ? [] : St(u);
379
+ }), n = f(() => B.tiles.reduce((l, e, s) => {
380
+ var I, j, Z, ce, we;
381
+ const p = ((I = e.widget) == null ? void 0 : I.config.schemaNames) ?? [], C = (((j = e.widget) == null ? void 0 : j.config.joinDatasources) ?? []).flatMap(
382
382
  (Ne) => Ne.schemaNames ?? []
383
383
  );
384
- return [...p, ...F].includes(((le = k.value) == null ? void 0 : le.name) || "") && l.push({
385
- label: (_e = (me = e.widget) == null ? void 0 : me.title) != null && _e.trim() ? e.widget.title : `Widget ${s + 1}`,
384
+ return [...p, ...C].includes(((Z = k.value) == null ? void 0 : Z.name) || "") && l.push({
385
+ label: (we = (ce = e.widget) == null ? void 0 : ce.title) != null && we.trim() ? e.widget.title : `Widget ${s + 1}`,
386
386
  value: e.id
387
387
  }), l;
388
- }, [])), m = g(
388
+ }, [])), m = f(
389
389
  () => B.schemas.flatMap(
390
390
  (l) => (l.fields ?? []).map((e) => ({
391
391
  ...e,
392
392
  labels: [
393
- Le(d, a, l.label, "schema"),
394
- Le(d, a, e.label || e.name, "other")
393
+ Le(u, a, l.label, "schema"),
394
+ Le(u, a, e.label || e.name, "other")
395
395
  ]
396
396
  }))
397
397
  )
398
398
  );
399
399
  function P(l) {
400
400
  var e;
401
- l.name !== ((e = k.value) == null ? void 0 : e.name) && (k.value = l, y.value = void 0, X.value = Te.Equal, D.value = !1, V.value = [], T.value = []);
401
+ l.name !== ((e = k.value) == null ? void 0 : e.name) && (k.value = l, y.value = void 0, X.value = Te.Equal, D.value = !1, T.value = [], $.value = []);
402
402
  }
403
- function ee(l) {
404
- y.value = l, C.value = l.type === oe.Timestamp ? Re.DateTime : void 0, X.value = te(), D.value = !1, V.value = [], T.value = [];
403
+ function te(l) {
404
+ y.value = l, x.value = l.type === oe.Timestamp ? Re.DateTime : void 0, X.value = le(), D.value = !1, T.value = [], $.value = [];
405
405
  }
406
406
  function H(l, e) {
407
407
  switch (l) {
@@ -417,20 +417,20 @@ const Xt = /* @__PURE__ */ Ce({
417
417
  }
418
418
  function A() {
419
419
  if (!k.value) {
420
- b.open({ message: d("report.section.filter.invalidSchema"), type: "error" });
420
+ g.open({ message: u("report.section.filter.invalidSchema"), type: "error" });
421
421
  return;
422
422
  }
423
423
  if (!y.value) {
424
- b.open({ message: d("report.section.filter.invalidDimension"), type: "error" });
424
+ g.open({ message: u("report.section.filter.invalidDimension"), type: "error" });
425
425
  return;
426
426
  }
427
- const l = G.value.filter((p) => p ? !ye.value.some((I) => I.value.name === p.schemaName) : !0);
427
+ const l = G.value.filter((p) => p ? !he.value.some((I) => I.value.name === p.schemaName) : !0);
428
428
  if (l.length > 0) {
429
- const p = l.filter((I) => !!I).map((I) => I.schemaName), F = l.some((I) => !I) ? `, ${d("report.section.filter.unknownFilters")}` : "";
430
- b.open({
431
- message: d("report.section.filter.invalidFiltersSchemaNotFound", {
429
+ const p = l.filter((I) => !!I).map((I) => I.schemaName), C = l.some((I) => !I) ? `, ${u("report.section.filter.unknownFilters")}` : "";
430
+ g.open({
431
+ message: u("report.section.filter.invalidFiltersSchemaNotFound", {
432
432
  schemas: p.join(", "),
433
- unknownFiltersSuffix: F
433
+ unknownFiltersSuffix: C
434
434
  }),
435
435
  type: "error"
436
436
  });
@@ -438,14 +438,14 @@ const Xt = /* @__PURE__ */ Ce({
438
438
  }
439
439
  if (!Oe())
440
440
  return;
441
- const e = D.value && !Z.value ? V.value.map((p) => ({
441
+ const e = D.value && !ee.value ? T.value.map((p) => ({
442
442
  label: p.label.trim(),
443
- operator: p.operator ?? te(),
444
- values: ce(
443
+ operator: p.operator ?? le(),
444
+ values: pe(
445
445
  [...p.values],
446
446
  re(p.operator)
447
447
  )
448
- })) : void 0, s = D.value && Z.value ? T.value.map((p) => ({
448
+ })) : void 0, s = D.value && ee.value ? $.value.map((p) => ({
449
449
  name: p.name.trim(),
450
450
  startTime: p.startTime,
451
451
  endTime: p.endTime
@@ -456,9 +456,9 @@ const Xt = /* @__PURE__ */ Ce({
456
456
  label: Y.value,
457
457
  operator: H(
458
458
  y.value.type,
459
- y.value.type === oe.Timestamp ? C.value ?? Re.DateTime : null
459
+ y.value.type === oe.Timestamp ? x.value ?? Re.DateTime : null
460
460
  ),
461
- option: y.value.type === oe.Timestamp ? C.value : null,
461
+ option: y.value.type === oe.Timestamp ? x.value : null,
462
462
  values: [],
463
463
  tileIds: [...O.value],
464
464
  filters: ae(G.value),
@@ -469,7 +469,7 @@ const Xt = /* @__PURE__ */ Ce({
469
469
  function W() {
470
470
  v.value = !1;
471
471
  }
472
- const se = g(() => {
472
+ const se = f(() => {
473
473
  var l;
474
474
  return [
475
475
  (l = k.value) == null ? void 0 : l.name,
@@ -477,37 +477,40 @@ const Xt = /* @__PURE__ */ Ce({
477
477
  ];
478
478
  });
479
479
  function de(l) {
480
- var t;
481
- const e = B.tiles.find((f) => f.id === l.value);
482
- if (!e || !k.value || !y.value) return !1;
483
- const s = (t = e == null ? void 0 : e.widget) == null ? void 0 : t.config, p = (s == null ? void 0 : s.schemaNames) ?? [], F = ((s == null ? void 0 : s.joinDatasources) ?? []).flatMap(
484
- (f) => f.schemaNames ?? []
485
- ), I = [...p, ...F];
486
- if (se.value.filter((f) => !!f).some((f) => !I.includes(f))) return !0;
487
- if (y.value.type === oe.Timestamp && C.value === Re.DateTime) return !1;
488
- const me = ((s == null ? void 0 : s.dimensions) ?? []).map((f) => ({
489
- schemaName: f.schemaName,
490
- name: f.name
491
- })), _e = ((s == null ? void 0 : s.joinDatasources) ?? []).flatMap(
492
- (f) => (f.dimensions ?? []).map(($) => ({
493
- schemaName: $.schemaName,
494
- name: $.name
480
+ var V;
481
+ const e = B.tiles.find((b) => b.id === l.value);
482
+ if (!e || !k.value || !y.value) return null;
483
+ const s = (V = e == null ? void 0 : e.widget) == null ? void 0 : V.config, p = (s == null ? void 0 : s.schemaNames) ?? [], C = ((s == null ? void 0 : s.joinDatasources) ?? []).flatMap(
484
+ (b) => b.schemaNames ?? []
485
+ ), I = [...p, ...C], j = se.value.filter((b) => !!b).some((b) => !I.includes(b)), Z = y.value.type === oe.Timestamp;
486
+ if (j)
487
+ return u(
488
+ Z ? "report.section.filter.missingFilterSchema" : "report.section.filter.missingFilterSchemaOrDimension"
489
+ );
490
+ if (Z) return null;
491
+ const ce = ((s == null ? void 0 : s.dimensions) ?? []).map((b) => ({
492
+ schemaName: b.schemaName,
493
+ name: b.name
494
+ })), we = ((s == null ? void 0 : s.joinDatasources) ?? []).flatMap(
495
+ (b) => (b.dimensions ?? []).map((me) => ({
496
+ schemaName: me.schemaName,
497
+ name: me.name
495
498
  }))
496
- ), Ne = [...me, ..._e], Pe = k.value.name, r = y.value.name;
497
- return !Ne.some(
498
- (f) => f.schemaName === Pe && f.name === r
499
- );
499
+ ), Ne = [...ce, ...we], Pe = k.value.name, r = y.value.name;
500
+ return Ne.some(
501
+ (b) => b.schemaName === Pe && b.name === r
502
+ ) ? null : u("report.section.filter.missingFilterSchemaOrDimension");
500
503
  }
501
504
  return (l, e) => {
502
- const s = x("FmTextField"), p = x("FmSelect"), F = x("FmCheckbox"), I = x("FmTimePicker"), J = x("FmButton"), le = x("FmLabel"), me = x("FmIcon"), _e = x("FmTooltip"), Ne = x("FmForm"), Pe = x("FmDialog");
503
- return u(), S(Pe, {
505
+ const s = F("FmTextField"), p = F("FmSelect"), C = F("FmCheckbox"), I = F("FmTimePicker"), j = F("FmButton"), Z = F("FmLabel"), ce = F("FmIcon"), we = F("FmTooltip"), Ne = F("FmForm"), Pe = F("FmDialog");
506
+ return d(), S(Pe, {
504
507
  modelValue: v.value,
505
508
  "onUpdate:modelValue": e[9] || (e[9] = (r) => v.value = r),
506
509
  overlay: !0,
507
510
  "z-index": 10
508
511
  }, {
509
512
  "dialog-header": _(() => [
510
- ze(E(o(d)("report.section.filter.globalFilter")), 1)
513
+ ze(E(o(u)("report.section.filter.globalFilter")), 1)
511
514
  ]),
512
515
  default: _(() => [
513
516
  i(Ne, {
@@ -520,112 +523,112 @@ const Xt = /* @__PURE__ */ Ce({
520
523
  i(s, {
521
524
  modelValue: Y.value,
522
525
  "onUpdate:modelValue": e[0] || (e[0] = (t) => Y.value = t),
523
- placeholder: o(d)("report.section.filter.displayName"),
524
- label: o(d)("report.section.filter.displayName"),
526
+ placeholder: o(u)("report.section.filter.displayName"),
527
+ label: o(u)("report.section.filter.displayName"),
525
528
  class: "mb-2"
526
529
  }, null, 8, ["modelValue", "placeholder", "label"]),
527
530
  i(Xe, {
528
531
  "model-value": k.value,
529
- items: ye.value,
530
- placeholder: o(d)("report.section.schema.title"),
531
- label: o(d)("report.section.schema.title"),
532
+ items: he.value,
533
+ placeholder: o(u)("report.section.schema.title"),
534
+ label: o(u)("report.section.schema.title"),
532
535
  "onUpdate:modelValue": e[1] || (e[1] = (t) => P(t))
533
536
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
534
537
  i(Xe, {
535
538
  "model-value": y.value,
536
- items: he.value,
537
- placeholder: o(d)("report.section.dimension.title"),
538
- label: o(d)("report.section.dimension.title"),
539
- "onUpdate:modelValue": e[2] || (e[2] = (t) => ee(t))
539
+ items: _e.value,
540
+ placeholder: o(u)("report.section.dimension.title"),
541
+ label: o(u)("report.section.dimension.title"),
542
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => te(t))
540
543
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
541
- ((r = y.value) == null ? void 0 : r.type) === o(oe).Timestamp ? (u(), S(p, {
544
+ ((r = y.value) == null ? void 0 : r.type) === o(oe).Timestamp ? (d(), S(p, {
542
545
  key: 0,
543
- modelValue: C.value,
544
- "onUpdate:modelValue": e[3] || (e[3] = (t) => C.value = t),
546
+ modelValue: x.value,
547
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => x.value = t),
545
548
  items: Ee.value,
546
- placeholder: o(d)("report.section.filter.timeFormatter"),
547
- label: o(d)("report.section.filter.timeFormatter")
549
+ placeholder: o(u)("report.section.filter.timeFormatter"),
550
+ label: o(u)("report.section.filter.timeFormatter")
548
551
  }, null, 8, ["modelValue", "items", "placeholder", "label"])) : U("", !0),
549
- w.value ? (u(), S(F, {
552
+ w.value ? (d(), S(C, {
550
553
  key: 1,
551
554
  modelValue: D.value,
552
555
  "onUpdate:modelValue": e[4] || (e[4] = (t) => D.value = t),
553
- label: o(d)("report.section.filter.customOptions"),
556
+ label: o(u)("report.section.filter.customOptions"),
554
557
  value: !0
555
558
  }, null, 8, ["modelValue", "label"])) : U("", !0),
556
- w.value && D.value ? (u(), R("div", ll, [
557
- Z.value ? (u(!0), R(xe, { key: 0 }, Be(T.value, (t, f) => (u(), R("div", {
558
- key: `custom-time-range-${f}`,
559
+ w.value && D.value ? (d(), R("div", ll, [
560
+ ee.value ? (d(!0), R(Fe, { key: 0 }, Be($.value, (t, V) => (d(), R("div", {
561
+ key: `custom-time-range-${V}`,
559
562
  class: "flex flex-col gap-2"
560
563
  }, [
561
564
  h("div", ol, [
562
565
  i(s, {
563
566
  modelValue: t.name,
564
- "onUpdate:modelValue": ($) => t.name = $,
565
- label: o(d)("report.section.filter.label")
567
+ "onUpdate:modelValue": (b) => t.name = b,
568
+ label: o(u)("report.section.filter.label")
566
569
  }, null, 8, ["modelValue", "onUpdate:modelValue", "label"]),
567
570
  i(I, {
568
571
  "model-value": ue(t.startTime),
569
- label: o(d)("report.date.startingTime"),
570
- "onUpdate:modelValue": ($) => fe(f, "startTime", $)
572
+ label: o(u)("report.date.startingTime"),
573
+ "onUpdate:modelValue": (b) => ge(V, "startTime", b)
571
574
  }, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
572
575
  i(I, {
573
576
  "model-value": ue(t.endTime),
574
- label: o(d)("report.date.endingTime"),
575
- "onUpdate:modelValue": ($) => fe(f, "endTime", $)
577
+ label: o(u)("report.date.endingTime"),
578
+ "onUpdate:modelValue": (b) => ge(V, "endTime", b)
576
579
  }, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
577
- T.value.length > 1 ? (u(), R("div", al, [
578
- i(J, {
580
+ $.value.length > 1 ? (d(), R("div", al, [
581
+ i(j, {
579
582
  icon: "delete",
580
583
  variant: "tertiary",
581
- onClick: ($) => ie(f)
584
+ onClick: (b) => ie(V)
582
585
  }, null, 8, ["onClick"])
583
586
  ])) : U("", !0)
584
587
  ])
585
- ]))), 128)) : (u(), R(xe, { key: 1 }, [
586
- h("p", nl, E(o(d)("report.section.filter.operator")), 1),
587
- ne.value.length > 0 ? (u(), S(Xe, {
588
+ ]))), 128)) : (d(), R(Fe, { key: 1 }, [
589
+ h("p", nl, E(o(u)("report.section.filter.operator")), 1),
590
+ ne.value.length > 0 ? (d(), S(Xe, {
588
591
  key: 0,
589
592
  "model-value": X.value,
590
593
  items: ne.value,
591
- placeholder: o(d)("report.section.filter.operator"),
592
- "onUpdate:modelValue": e[5] || (e[5] = (t) => ve(t))
594
+ placeholder: o(u)("report.section.filter.operator"),
595
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => fe(t))
593
596
  }, null, 8, ["model-value", "items", "placeholder"])) : U("", !0),
594
- (u(!0), R(xe, null, Be(V.value, (t, f) => (u(), R("div", {
595
- key: `custom-option-${f}`,
597
+ (d(!0), R(Fe, null, Be(T.value, (t, V) => (d(), R("div", {
598
+ key: `custom-option-${V}`,
596
599
  class: "flex flex-col gap-2"
597
600
  }, [
598
601
  h("div", {
599
602
  class: Ue(["grid grid-cols-1 gap-2 p-2 sm:items-end text-fm-color-typo-primary fm-typo-en-body-lg-600 border-neutral-300 rounded-md border", "sm:grid-cols-[1fr_1.6fr_auto]"])
600
603
  }, [
601
- h("span", rl, E(o(d)("report.section.filter.label")), 1),
604
+ h("span", rl, E(o(u)("report.section.filter.label")), 1),
602
605
  i(s, {
603
606
  modelValue: t.label,
604
- "onUpdate:modelValue": ($) => t.label = $
607
+ "onUpdate:modelValue": (b) => t.label = b
605
608
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
606
- (u(), S(Dt, {
607
- key: `custom-option-value-${f}-${t.operator ?? ""}-${C.value ?? ""}`,
609
+ (d(), S(Dt, {
610
+ key: `custom-option-value-${V}-${t.operator ?? ""}-${x.value ?? ""}`,
608
611
  modelValue: t.values,
609
- "onUpdate:modelValue": ($) => t.values = $,
612
+ "onUpdate:modelValue": (b) => t.values = b,
610
613
  config: re(t.operator),
611
- option: C.value
614
+ option: x.value
612
615
  }, null, 8, ["modelValue", "onUpdate:modelValue", "config", "option"])),
613
- V.value.length > 1 ? (u(), R("div", il, [
614
- i(J, {
616
+ T.value.length > 1 ? (d(), R("div", il, [
617
+ i(j, {
615
618
  icon: "delete",
616
619
  variant: "tertiary",
617
- onClick: ($) => Q(f)
620
+ onClick: (b) => Q(V)
618
621
  }, null, 8, ["onClick"])
619
622
  ])) : U("", !0)
620
623
  ])
621
624
  ]))), 128))
622
625
  ], 64)),
623
- i(J, {
626
+ i(j, {
624
627
  class: "w-full",
625
628
  variant: "primary",
626
629
  icon: "add",
627
630
  "icon-position": "prepend",
628
- onClick: e[6] || (e[6] = (t) => Z.value ? ke() : be())
631
+ onClick: e[6] || (e[6] = (t) => ee.value ? ke() : ye())
629
632
  })
630
633
  ])) : U("", !0),
631
634
  i(Ot, {
@@ -633,42 +636,42 @@ const Xt = /* @__PURE__ */ Ce({
633
636
  "onUpdate:modelValue": e[7] || (e[7] = (t) => G.value = t),
634
637
  options: m.value
635
638
  }, null, 8, ["modelValue", "options"]),
636
- i(le, { class: "mt-2 fm-typo-en-body-lg-600" }, {
639
+ i(Z, { class: "mt-2 fm-typo-en-body-lg-600" }, {
637
640
  default: _(() => [
638
- ze(E(o(d)("report.section.filter.applyWidget")), 1)
641
+ ze(E(o(u)("report.section.filter.applyWidget")), 1)
639
642
  ]),
640
643
  _: 1
641
644
  }),
642
- M.tiles.length > 0 ? (u(), R("div", sl, [
643
- (u(!0), R(xe, null, Be(n.value, (t) => (u(), R("div", {
645
+ M.tiles.length > 0 ? (d(), R("div", sl, [
646
+ (d(!0), R(Fe, null, Be(n.value, (t) => (d(), R("div", {
644
647
  key: t.value,
645
648
  class: "flex items-center"
646
649
  }, [
647
- i(F, {
650
+ i(C, {
648
651
  modelValue: O.value,
649
- "onUpdate:modelValue": e[8] || (e[8] = (f) => O.value = f),
652
+ "onUpdate:modelValue": e[8] || (e[8] = (V) => O.value = V),
650
653
  label: t.label,
651
654
  value: t.value
652
655
  }, null, 8, ["modelValue", "label", "value"]),
653
- de(t) ? (u(), S(_e, {
656
+ de(t) ? (d(), S(we, {
654
657
  key: 0,
655
- content: o(d)("report.section.filter.missingFilterSchemaOrDimension"),
658
+ content: de(t) ?? void 0,
656
659
  "z-index": 99,
657
660
  class: "ml-2"
658
661
  }, {
659
662
  default: _(() => [
660
- i(me, {
663
+ i(ce, {
661
664
  name: "warning",
662
665
  class: "text-fm-color-system-error-300"
663
666
  })
664
667
  ]),
665
- _: 1
666
- }, 8, ["content"])) : U("", !0)
668
+ _: 2
669
+ }, 1032, ["content"])) : U("", !0)
667
670
  ]))), 128))
668
- ])) : (u(), S(le, {
671
+ ])) : (d(), S(Z, {
669
672
  key: 4,
670
673
  class: "fm-typo-en-body-lg-400",
671
- label: o(d)("report.section.filter.noWidget")
674
+ label: o(u)("report.section.filter.noWidget")
672
675
  }, null, 8, ["label"]))
673
676
  ];
674
677
  }),
@@ -677,13 +680,13 @@ const Xt = /* @__PURE__ */ Ce({
677
680
  ]),
678
681
  "dialog-footer": _(() => [
679
682
  e[10] || (e[10] = h("div", { class: "grow" }, null, -1)),
680
- i(J, {
681
- label: o(d)("report.common.cancel"),
683
+ i(j, {
684
+ label: o(u)("report.common.cancel"),
682
685
  variant: "tertiary",
683
686
  onClick: W
684
687
  }, null, 8, ["label"]),
685
- i(J, {
686
- label: o(d)("report.common.confirm"),
688
+ i(j, {
689
+ label: o(u)("report.common.confirm"),
687
690
  onClick: A
688
691
  }, null, 8, ["label"])
689
692
  ]),
@@ -697,17 +700,17 @@ const Xt = /* @__PURE__ */ Ce({
697
700
  SG: { rate: 1.29, currency: "SGD", symbol: "S$" },
698
701
  ID: { rate: 17900, currency: "IDR", symbol: "Rp" }
699
702
  }, pl = { rate: 1, currency: "USD", symbol: "$" };
700
- function ut(M, d) {
701
- const a = M / ml * dl, { rate: c, currency: v, symbol: b } = cl[d] ?? pl;
703
+ function ut(M, u) {
704
+ const a = M / ml * dl, { rate: c, currency: v, symbol: g } = cl[u] ?? pl;
702
705
  return {
703
706
  amount: a * c,
704
707
  currency: v,
705
- symbol: b,
708
+ symbol: g,
706
709
  costUsd: a
707
710
  };
708
711
  }
709
- function dt(M, d) {
710
- return M < 0.01 ? `< ${d}0.01` : `${d}${M.toFixed(2)}`;
712
+ function dt(M, u) {
713
+ return M < 0.01 ? `< ${u}0.01` : `${u}${M.toFixed(2)}`;
711
714
  }
712
715
  const vl = { class: "flex flex-col gap-16" }, fl = {
713
716
  key: 0,
@@ -718,66 +721,66 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
718
721
  }, hl = ["onClick"], _l = ["title"], wl = {
719
722
  key: 0,
720
723
  class: "text-fm-color-typo-secondary"
721
- }, xl = { class: "text-fm-color-system-error-300" }, Cl = { class: "w-full text-left" }, Fl = /* @__PURE__ */ Ce({
724
+ }, Fl = { class: "text-fm-color-system-error-300" }, xl = { class: "w-full text-left" }, Cl = /* @__PURE__ */ xe({
722
725
  __name: "TileDrillPanel",
723
726
  props: {
724
727
  report: {}
725
728
  },
726
729
  emits: ["add-widget"],
727
- setup(M, { emit: d }) {
728
- const a = M, c = d, { t: v, te: b } = qe(), B = ot(), Y = at(), { promptMessage: k } = nt(), y = lt(), C = g(() => {
730
+ setup(M, { emit: u }) {
731
+ const a = M, c = u, { t: v, te: g } = qe(), B = ot(), Y = at(), { promptMessage: k } = nt(), y = lt(), x = f(() => {
729
732
  const n = [];
730
733
  let m = a.report.tiles;
731
734
  for (const P of Ie.value) {
732
- const ee = m.find((H) => H.id === P);
733
- if (!ee) break;
734
- n.push(ee), m = ee.tiles ?? [];
735
+ const te = m.find((H) => H.id === P);
736
+ if (!te) break;
737
+ n.push(te), m = te.tiles ?? [];
735
738
  }
736
739
  return n;
737
740
  });
738
- ge(C, (n) => {
741
+ be(x, (n) => {
739
742
  n.length !== Ie.value.length && (Ie.value = n.map((m) => m.id));
740
743
  });
741
- const O = g(() => C.value[C.value.length - 1] ?? null), G = g(() => C.value[C.value.length - 2] ?? null), D = g(
744
+ const O = f(() => x.value[x.value.length - 1] ?? null), G = f(() => x.value[x.value.length - 2] ?? null), D = f(
742
745
  () => O.value ? O.value.tiles ?? [] : a.report.tiles
743
- ), V = g(() => {
746
+ ), T = f(() => {
744
747
  var n;
745
748
  return ((n = O.value) == null ? void 0 : n.id) ?? null;
746
- }), T = g(() => C.value.length === 0), X = g(() => {
749
+ }), $ = f(() => x.value.length === 0), X = f(() => {
747
750
  var n;
748
751
  return ((n = O.value) == null ? void 0 : n.tab) === !0;
749
- }), ae = g(() => {
752
+ }), ae = f(() => {
750
753
  var n;
751
754
  return ((n = G.value) == null ? void 0 : n.tab) === !0;
752
- }), Fe = g(
753
- () => C.value.reduce((n, m) => m.tab ? n : n + 1, 1)
754
- ), ue = g(() => !X.value && Fe.value < bt), j = g(() => T.value);
755
+ }), Ce = f(
756
+ () => x.value.reduce((n, m) => m.tab ? n : n + 1, 1)
757
+ ), ue = f(() => !X.value && Ce.value < bt), J = f(() => $.value);
755
758
  function w(n) {
756
759
  n.widget || (Ie.value = [...Ie.value, n.id]);
757
760
  }
758
- function Z() {
761
+ function ee() {
759
762
  Ie.value = Ie.value.slice(0, -1);
760
763
  }
761
764
  function ne(n) {
762
765
  if (!n) return "";
763
766
  const m = `report.widget.types.${n.toLowerCase()}`;
764
- return b(m) ? v(m) : Le(v, b, n, "other");
767
+ return g(m) ? v(m) : Le(v, g, n, "other");
765
768
  }
766
- function te(n, m) {
769
+ function le(n, m) {
767
770
  return n.widget ? n.widget.title ? ne(n.widget.title) : v("report.editor.widget", { index: m + 1 }) : n.tabTitle !== void 0 ? n.tabTitle || v("report.editor.tab", { index: m + 1 }) : n.tab ? v("report.editor.tabGroup") : v("report.editor.group");
768
771
  }
769
772
  function re(n, m) {
770
- return !n.widget && X.value ? n.tabTitle || v("report.editor.tab", { index: m + 1 }) : te(n, m);
773
+ return !n.widget && X.value ? n.tabTitle || v("report.editor.tab", { index: m + 1 }) : le(n, m);
771
774
  }
772
- function ce(n) {
775
+ function pe(n) {
773
776
  var m;
774
777
  return ((m = n.tiles) == null ? void 0 : m.length) ?? 0;
775
778
  }
776
- const pe = g(
777
- () => C.value.map((n, m) => te(n, m)).join(" › ")
779
+ const ve = f(
780
+ () => x.value.map((n, m) => le(n, m)).join(" › ")
778
781
  );
779
782
  function q(n, m) {
780
- gt.value = V.value, y.editingTileIndex = m, y.editingTile = JSON.parse(JSON.stringify(n)), B.push({ name: "tileEditor", query: Y.query });
783
+ gt.value = T.value, y.editingTileIndex = m, y.editingTile = JSON.parse(JSON.stringify(n)), B.push({ name: "tileEditor", query: Y.query });
781
784
  }
782
785
  function L(n, m) {
783
786
  D.value.splice(m + 1, 0, Mt(n));
@@ -788,16 +791,16 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
788
791
  title: v("report.editor.deleteWidget"),
789
792
  message: v("report.editor.deleteWidgetConfirm", { title: re(n, m) })
790
793
  })) return;
791
- const ee = rt(n);
794
+ const te = rt(n);
792
795
  D.value.splice(m, 1), (H = a.report.globalFilters) == null || H.forEach((A) => {
793
796
  var W;
794
- A.tileIds = (W = A.tileIds) == null ? void 0 : W.filter((se) => !ee.includes(se));
797
+ A.tileIds = (W = A.tileIds) == null ? void 0 : W.filter((se) => !te.includes(se));
795
798
  });
796
799
  }
797
- function ve() {
800
+ function fe() {
798
801
  O.value && (O.value.tiles || (O.value.tiles = []), O.value.tiles.push(Bt(O.value.tiles.length + 1)));
799
802
  }
800
- function be() {
803
+ function ye() {
801
804
  D.value.push(Ut());
802
805
  }
803
806
  function Q() {
@@ -813,8 +816,8 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
813
816
  const m = Number((P = n.size) == null ? void 0 : P.height);
814
817
  n.size || (n.size = { width: 12, height: 12 }), !Number.isFinite(m) || m < 1 ? n.size.height = 1 : m > 12 && (n.size.height = 12);
815
818
  }
816
- const fe = z(!1), Ve = z(null), Oe = z([]);
817
- function ye(n) {
819
+ const ge = z(!1), Ve = z(null), Oe = z([]);
820
+ function he(n) {
818
821
  const m = [
819
822
  { parentId: null, label: v("report.editor.topLevel"), level: 1 }
820
823
  ], P = (H, A, W) => {
@@ -825,8 +828,8 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
825
828
  if (de.tab) {
826
829
  const e = `${W}${v("report.editor.tabGroup")}`;
827
830
  (l = de.tiles) == null || l.forEach((s, p) => {
828
- const F = `${e} › ${s.tabTitle || v("report.editor.tab", { index: p + 1 })}`;
829
- m.push({ parentId: s.id, label: F, level: A + 1 }), P(s.tiles ?? [], A + 1, `${F} › `);
831
+ const C = `${e} › ${s.tabTitle || v("report.editor.tab", { index: p + 1 })}`;
832
+ m.push({ parentId: s.id, label: C, level: A + 1 }), P(s.tiles ?? [], A + 1, `${C} › `);
830
833
  });
831
834
  } else {
832
835
  se += 1;
@@ -836,44 +839,44 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
836
839
  });
837
840
  };
838
841
  P(a.report.tiles, 1, "");
839
- const ee = new Set(rt(n));
842
+ const te = new Set(rt(n));
840
843
  return m.filter(
841
- (H) => H.parentId !== V.value && !(H.parentId && ee.has(H.parentId)) && Pt(n, H.level)
844
+ (H) => H.parentId !== T.value && !(H.parentId && te.has(H.parentId)) && Pt(n, H.level)
842
845
  );
843
846
  }
844
- function he(n) {
845
- Ve.value = n, Oe.value = ye(n), fe.value = !0;
847
+ function _e(n) {
848
+ Ve.value = n, Oe.value = he(n), ge.value = !0;
846
849
  }
847
850
  function Ee(n) {
848
851
  const m = Ve.value;
849
852
  if (!m) return;
850
853
  const P = D.value.indexOf(m);
851
- P >= 0 && D.value.splice(P, 1), Et(a.report.tiles, n.parentId).push(m), fe.value = !1, Ve.value = null;
854
+ P >= 0 && D.value.splice(P, 1), Et(a.report.tiles, n.parentId).push(m), ge.value = !1, Ve.value = null;
852
855
  }
853
856
  return (n, m) => {
854
- const P = x("FmButton"), ee = x("FmTextField"), H = x("FmIcon"), A = x("FmMenuItem"), W = x("FmMenu"), se = x("FmList"), de = x("FmListItem"), l = x("FmDialog");
855
- return u(), R("div", vl, [
856
- T.value ? U("", !0) : (u(), R("div", fl, [
857
+ const P = F("FmButton"), te = F("FmTextField"), H = F("FmIcon"), A = F("FmMenuItem"), W = F("FmMenu"), se = F("FmList"), de = F("FmListItem"), l = F("FmDialog");
858
+ return d(), R("div", vl, [
859
+ $.value ? U("", !0) : (d(), R("div", fl, [
857
860
  h("div", gl, [
858
861
  i(P, {
859
862
  icon: "arrow_back",
860
863
  variant: "tertiary",
861
864
  class: "-ml-8",
862
- onClick: Z
865
+ onClick: ee
863
866
  }),
864
867
  h("p", {
865
868
  class: "fm-typo-en-body-md-600 line-clamp-1 overflow-hidden break-all min-w-0 grow text-left",
866
- title: pe.value
867
- }, E(pe.value), 9, bl)
869
+ title: ve.value
870
+ }, E(ve.value), 9, bl)
868
871
  ]),
869
- ae.value && O.value ? (u(), S(ee, {
872
+ ae.value && O.value ? (d(), S(te, {
870
873
  key: 0,
871
874
  modelValue: O.value.tabTitle,
872
875
  "onUpdate:modelValue": m[0] || (m[0] = (e) => O.value.tabTitle = e),
873
876
  label: o(v)("report.editor.tabName"),
874
877
  placeholder: o(v)("report.editor.tabName")
875
878
  }, null, 8, ["modelValue", "label", "placeholder"])) : U("", !0),
876
- !ae.value && O.value ? (u(), S(ee, {
879
+ !ae.value && O.value ? (d(), S(te, {
877
880
  key: 1,
878
881
  modelValue: O.value.size.width,
879
882
  "onUpdate:modelValue": m[1] || (m[1] = (e) => O.value.size.width = e),
@@ -882,7 +885,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
882
885
  label: o(v)("report.editor.width"),
883
886
  onBlur: m[2] || (m[2] = (e) => ke(O.value))
884
887
  }, null, 8, ["modelValue", "label"])) : U("", !0),
885
- !ae.value && O.value ? (u(), S(ee, {
888
+ !ae.value && O.value ? (d(), S(te, {
886
889
  key: 2,
887
890
  modelValue: O.value.size.height,
888
891
  "onUpdate:modelValue": m[3] || (m[3] = (e) => O.value.size.height = e),
@@ -892,7 +895,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
892
895
  onBlur: m[4] || (m[4] = (e) => ie(O.value))
893
896
  }, null, 8, ["modelValue", "label"])) : U("", !0)
894
897
  ])),
895
- D.value.length === 0 ? (u(), R("div", yl, E(o(v)("report.editor.emptyLevel")), 1)) : (u(), S(se, { key: 2 }, {
898
+ D.value.length === 0 ? (d(), R("div", yl, E(o(v)("report.editor.emptyLevel")), 1)) : (d(), S(se, { key: 2 }, {
896
899
  default: _(() => [
897
900
  i(o(ft), {
898
901
  list: D.value,
@@ -914,9 +917,9 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
914
917
  title: re(e, s)
915
918
  }, [
916
919
  ze(E(re(e, s)) + " ", 1),
917
- e.widget ? U("", !0) : (u(), R("span", wl, " · " + E(ce(e)), 1))
920
+ e.widget ? U("", !0) : (d(), R("span", wl, " · " + E(pe(e)), 1))
918
921
  ], 8, _l),
919
- e.widget ? U("", !0) : (u(), S(H, {
922
+ e.widget ? U("", !0) : (d(), S(H, {
920
923
  key: 0,
921
924
  name: "chevron_right",
922
925
  class: "shrink-0"
@@ -934,15 +937,15 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
934
937
  })
935
938
  ]),
936
939
  default: _(() => [
937
- e.widget ? (u(), S(A, {
940
+ e.widget ? (d(), S(A, {
938
941
  key: 0,
939
942
  label: o(v)("report.common.edit"),
940
943
  onClick: (p) => q(e, s)
941
944
  }, null, 8, ["label", "onClick"])) : U("", !0),
942
- e.tab ? U("", !0) : (u(), S(A, {
945
+ e.tab ? U("", !0) : (d(), S(A, {
943
946
  key: 1,
944
947
  label: o(v)("report.editor.moveTo"),
945
- onClick: (p) => he(e)
948
+ onClick: (p) => _e(e)
946
949
  }, null, 8, ["label", "onClick"])),
947
950
  i(A, {
948
951
  label: o(v)("report.common.duplicate"),
@@ -952,7 +955,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
952
955
  onClick: (p) => K(e, s)
953
956
  }, {
954
957
  label: _(() => [
955
- h("p", xl, E(o(v)("report.common.remove")), 1)
958
+ h("p", Fl, E(o(v)("report.common.remove")), 1)
956
959
  ]),
957
960
  _: 2
958
961
  }, 1032, ["onClick"])
@@ -966,7 +969,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
966
969
  ]),
967
970
  _: 1
968
971
  })),
969
- X.value ? (u(), S(P, {
972
+ X.value ? (d(), S(P, {
970
973
  key: 3,
971
974
  label: o(v)("report.editor.addTab"),
972
975
  variant: "secondary",
@@ -974,8 +977,8 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
974
977
  "icon-position": "prepend",
975
978
  "border-color": o($e).ColorPrimary,
976
979
  "text-color": o($e).ColorPrimary,
977
- onClick: ve
978
- }, null, 8, ["label", "border-color", "text-color"])) : (u(), S(W, {
980
+ onClick: fe
981
+ }, null, 8, ["label", "border-color", "text-color"])) : (d(), S(W, {
979
982
  key: 4,
980
983
  trigger: "click",
981
984
  shift: !0
@@ -994,14 +997,14 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
994
997
  default: _(() => [
995
998
  i(A, {
996
999
  label: o(v)("report.editor.addWidget"),
997
- onClick: m[5] || (m[5] = (e) => c("add-widget", V.value))
1000
+ onClick: m[5] || (m[5] = (e) => c("add-widget", T.value))
998
1001
  }, null, 8, ["label"]),
999
- ue.value ? (u(), S(A, {
1002
+ ue.value ? (d(), S(A, {
1000
1003
  key: 0,
1001
1004
  label: o(v)("report.editor.addGroup"),
1002
- onClick: be
1005
+ onClick: ye
1003
1006
  }, null, 8, ["label"])) : U("", !0),
1004
- j.value ? (u(), S(A, {
1007
+ J.value ? (d(), S(A, {
1005
1008
  key: 1,
1006
1009
  label: o(v)("report.editor.addTabGroup"),
1007
1010
  onClick: Q
@@ -1010,8 +1013,8 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1010
1013
  _: 1
1011
1014
  })),
1012
1015
  i(l, {
1013
- modelValue: fe.value,
1014
- "onUpdate:modelValue": m[6] || (m[6] = (e) => fe.value = e),
1016
+ modelValue: ge.value,
1017
+ "onUpdate:modelValue": m[6] || (m[6] = (e) => ge.value = e),
1015
1018
  overlay: !0,
1016
1019
  "z-index": 10
1017
1020
  }, {
@@ -1021,12 +1024,12 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1021
1024
  default: _(() => [
1022
1025
  i(se, null, {
1023
1026
  default: _(() => [
1024
- (u(!0), R(xe, null, Be(Oe.value, (e) => (u(), S(de, {
1027
+ (d(!0), R(Fe, null, Be(Oe.value, (e) => (d(), S(de, {
1025
1028
  key: e.parentId ?? "root",
1026
1029
  onClick: (s) => Ee(e)
1027
1030
  }, {
1028
1031
  default: _(() => [
1029
- h("p", Cl, E(e.label), 1)
1032
+ h("p", xl, E(e.label), 1)
1030
1033
  ]),
1031
1034
  _: 2
1032
1035
  }, 1032, ["onClick"]))), 128))
@@ -1042,7 +1045,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1042
1045
  }), kl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Vl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Tl = { class: "flex items-center gap-8" }, $l = {
1043
1046
  key: 2,
1044
1047
  class: "flex flex-col gap-8 rounded-md border border-fm-color-border px-16 py-12"
1045
- }, Sl = { class: "fm-typo-en-body-sm-400" }, Dl = { class: "fm-typo-en-body-sm-400 font-bold" }, Ol = { class: "space-y-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Nl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Il = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, Rl = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, mt = /* @__PURE__ */ Ce({
1048
+ }, Sl = { class: "fm-typo-en-body-sm-400" }, Dl = { class: "fm-typo-en-body-sm-400 font-bold" }, Ol = { class: "space-y-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Nl = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Il = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, Rl = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, mt = /* @__PURE__ */ xe({
1046
1049
  __name: "ReportEditorTab",
1047
1050
  props: /* @__PURE__ */ Se({
1048
1051
  hideConfiguration: {
@@ -1054,38 +1057,38 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1054
1057
  modelModifiers: {}
1055
1058
  }),
1056
1059
  emits: /* @__PURE__ */ Se(["hideConfiguration"], ["update:modelValue"]),
1057
- setup(M, { emit: d }) {
1058
- const a = De(M, "modelValue"), { breakpoints: c } = He(), v = M, b = d, B = ot(), Y = at(), k = z(), {
1060
+ setup(M, { emit: u }) {
1061
+ const a = De(M, "modelValue"), { breakpoints: c } = He(), v = M, g = u, B = ot(), Y = at(), k = z(), {
1059
1062
  currentSelectWidgetType: y,
1060
- categories: C,
1063
+ categories: x,
1061
1064
  editingTile: O,
1062
1065
  editingTileIndex: G,
1063
1066
  editingGlobalFilter: D,
1064
- editingGlobalFilterIndex: V
1065
- } = Me(lt()), { schemas: T } = Me(zt()), { globalFilters: X } = Me(it()), { getGlobalFilterLabel: ae } = it(), { promptMessage: Fe } = nt(), ue = z(!1), j = z(!1), { t: w, te: Z, locale: ne } = qe(), te = z(void 0), re = g(() => {
1067
+ editingGlobalFilterIndex: T
1068
+ } = Me(lt()), { schemas: $ } = Me(zt()), { globalFilters: X } = Me(it()), { getGlobalFilterLabel: ae } = it(), { promptMessage: Ce } = nt(), ue = z(!1), J = z(!1), { t: w, te: ee, locale: ne } = qe(), le = z(void 0), re = f(() => {
1066
1069
  const r = Qe(a.value.tiles).flatMap((t) => {
1067
- var we;
1068
- const f = t.widget.config.schemaNames ?? [], $ = ((we = t.widget.config.joinDatasources) == null ? void 0 : we.flatMap((Ge) => Ge.schemaNames ?? [])) ?? [];
1069
- return [...f, ...$];
1070
+ var me;
1071
+ const V = t.widget.config.schemaNames ?? [], b = ((me = t.widget.config.joinDatasources) == null ? void 0 : me.flatMap((Ge) => Ge.schemaNames ?? [])) ?? [];
1072
+ return [...V, ...b];
1070
1073
  });
1071
- return [...new Set(r)].reduce((t, f) => {
1072
- const $ = T.value.find((we) => we.name === f);
1073
- return $ && t.push($), t;
1074
+ return [...new Set(r)].reduce((t, V) => {
1075
+ const b = $.value.find((me) => me.name === V);
1076
+ return b && t.push(b), t;
1074
1077
  }, []);
1075
- }), ce = z(null);
1076
- function pe(r) {
1077
- ce.value = r, j.value = !0;
1078
+ }), pe = z(null);
1079
+ function ve(r) {
1080
+ pe.value = r, J.value = !0;
1078
1081
  }
1079
- ge(
1082
+ be(
1080
1083
  () => y.value,
1081
1084
  () => {
1082
- y.value !== void 0 && (te.value = jt(y.value), O.value = te.value, G.value = -1, gt.value = ce.value, B.push({
1085
+ y.value !== void 0 && (le.value = jt(y.value), O.value = le.value, G.value = -1, gt.value = pe.value, B.push({
1083
1086
  name: "tileEditor",
1084
1087
  query: Y.query
1085
1088
  }));
1086
1089
  },
1087
1090
  { immediate: !0 }
1088
- ), ge(
1091
+ ), be(
1089
1092
  () => a.value.tiles,
1090
1093
  (r) => {
1091
1094
  Lt(r);
@@ -1099,7 +1102,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1099
1102
  variant: "tertiary",
1100
1103
  onClick: (r) => {
1101
1104
  var t;
1102
- V.value = r, D.value = JSON.parse(JSON.stringify((t = a.value.globalFilters) == null ? void 0 : t[r])), ue.value = !0;
1105
+ T.value = r, D.value = JSON.parse(JSON.stringify((t = a.value.globalFilters) == null ? void 0 : t[r])), ue.value = !0;
1103
1106
  }
1104
1107
  },
1105
1108
  {
@@ -1107,11 +1110,11 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1107
1110
  selected: !1,
1108
1111
  variant: "tertiary",
1109
1112
  onClick: (r) => {
1110
- var $;
1111
- const t = ($ = a.value.globalFilters) == null ? void 0 : $[r];
1113
+ var b;
1114
+ const t = (b = a.value.globalFilters) == null ? void 0 : b[r];
1112
1115
  if (!t) return;
1113
- const f = JSON.parse(JSON.stringify(t));
1114
- a.value.globalFilters || (a.value.globalFilters = []), a.value.globalFilters.push(f);
1116
+ const V = JSON.parse(JSON.stringify(t));
1117
+ a.value.globalFilters || (a.value.globalFilters = []), a.value.globalFilters.push(V);
1115
1118
  }
1116
1119
  },
1117
1120
  {
@@ -1119,26 +1122,26 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1119
1122
  selected: !1,
1120
1123
  variant: "destructive",
1121
1124
  onClick: async (r) => {
1122
- var $, we;
1123
- const t = ($ = a.value.globalFilters) == null ? void 0 : $[r];
1125
+ var b, me;
1126
+ const t = (b = a.value.globalFilters) == null ? void 0 : b[r];
1124
1127
  if (!t) return;
1125
- await Fe({
1128
+ await Ce({
1126
1129
  title: w("report.editor.deleteWidget"),
1127
1130
  message: w("report.editor.deleteWidgetConfirm", {
1128
1131
  title: ae(t)
1129
1132
  })
1130
- }) && ((we = a.value.globalFilters) == null || we.splice(r, 1));
1133
+ }) && ((me = a.value.globalFilters) == null || me.splice(r, 1));
1131
1134
  }
1132
1135
  }
1133
- ], L = g(() => C.value.map((r) => ({
1136
+ ], L = f(() => x.value.map((r) => ({
1134
1137
  label: w(`report.category.${r.name}`),
1135
1138
  value: r.id
1136
- }))), { sessionUser: K } = Jt(), ve = g(
1139
+ }))), { sessionUser: K } = Jt(), fe = f(
1137
1140
  () => {
1138
- var r, t, f, $;
1139
- return ((t = (r = K.value) == null ? void 0 : r.role) == null ? void 0 : t.isAdmin) === !0 || (($ = (f = K.value) == null ? void 0 : f.role) == null ? void 0 : $.isStaff) === !0;
1141
+ var r, t, V, b;
1142
+ return ((t = (r = K.value) == null ? void 0 : r.role) == null ? void 0 : t.isAdmin) === !0 || ((b = (V = K.value) == null ? void 0 : V.role) == null ? void 0 : b.isStaff) === !0;
1140
1143
  }
1141
- ), be = g({
1144
+ ), ye = f({
1142
1145
  get: () => a.value.queryVersion === "v2",
1143
1146
  set: (r) => {
1144
1147
  a.value.queryVersion = r ? "v2" : "v1", r ? a.value.queryDatasource = a.value.queryDatasource ?? We.Postgres : a.value.queryDatasource = void 0;
@@ -1150,16 +1153,16 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1150
1153
  { label: w("report.common.noBatch"), value: "none" },
1151
1154
  { label: w("report.common.days"), value: "days" },
1152
1155
  { label: w("report.common.locations"), value: "locations" }
1153
- ], ie = g({
1156
+ ], ie = f({
1154
1157
  get: () => {
1155
1158
  var r, t;
1156
1159
  return (r = a.value.batch) != null && r.days ? "days" : (t = a.value.batch) != null && t.locations ? "locations" : "none";
1157
1160
  },
1158
1161
  set: (r) => {
1159
- var t, f;
1160
- r === "none" ? a.value.batch = void 0 : r === "days" ? a.value.batch = { days: ((t = a.value.batch) == null ? void 0 : t.days) || 1 } : r === "locations" && (a.value.batch = { locations: ((f = a.value.batch) == null ? void 0 : f.locations) || 10 });
1162
+ var t, V;
1163
+ r === "none" ? a.value.batch = void 0 : r === "days" ? a.value.batch = { days: ((t = a.value.batch) == null ? void 0 : t.days) || 1 } : r === "locations" && (a.value.batch = { locations: ((V = a.value.batch) == null ? void 0 : V.locations) || 10 });
1161
1164
  }
1162
- }), fe = g({
1165
+ }), ge = f({
1163
1166
  get: () => {
1164
1167
  var r, t;
1165
1168
  if (ie.value === "days") return ((r = a.value.batch) == null ? void 0 : r.days) ?? 1;
@@ -1168,105 +1171,105 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1168
1171
  set: (r) => {
1169
1172
  r && (ie.value === "days" ? a.value.batch = { days: r } : ie.value === "locations" && (a.value.batch = { locations: r }));
1170
1173
  }
1171
- }), Ve = g({
1172
- get: () => Le(w, Z, a.value.name, "other"),
1174
+ }), Ve = f({
1175
+ get: () => Le(w, ee, a.value.name, "other"),
1173
1176
  set: (r) => {
1174
1177
  a.value.name = r;
1175
1178
  }
1176
1179
  }), { country: Oe } = Me(Kt()), {
1177
- dateRange: ye,
1178
- compareDateRange: he,
1180
+ dateRange: he,
1181
+ compareDateRange: _e,
1179
1182
  timeRange: Ee,
1180
1183
  selectedLocationIds: n,
1181
1184
  businessDataVersion: m,
1182
1185
  restaurants: P,
1183
- warehouses: ee
1184
- } = Me(Qt()), H = g(
1186
+ warehouses: te
1187
+ } = Me(Qt()), H = f(
1185
1188
  () => a.value.queryVersion === "v2" && a.value.queryDatasource === We.BigQuery
1186
- ), A = g(() => H.value && ve.value), W = z(null), se = z(!1), de = g(() => {
1187
- const r = ye.value.startDate ?? ye.value.endDate;
1189
+ ), A = f(() => H.value && fe.value), W = z(null), se = z(!1), de = f(() => {
1190
+ const r = he.value.startDate ?? he.value.endDate;
1188
1191
  return r ? {
1189
1192
  startDate: r,
1190
1193
  endDate: r
1191
- } : ye.value;
1192
- }), l = g(() => {
1193
- const r = he.value.startDate ?? he.value.endDate;
1194
+ } : he.value;
1195
+ }), l = f(() => {
1196
+ const r = _e.value.startDate ?? _e.value.endDate;
1194
1197
  return r ? {
1195
1198
  startDate: r,
1196
1199
  endDate: r
1197
- } : he.value;
1198
- }), e = g(() => {
1200
+ } : _e.value;
1201
+ }), e = f(() => {
1199
1202
  const r = a.value.batch;
1200
1203
  if (!r) return 1;
1201
1204
  if (r.locations) {
1202
- const t = P.value.length + ee.value.length;
1205
+ const t = P.value.length + te.value.length;
1203
1206
  return Math.max(1, Math.ceil(t / r.locations));
1204
1207
  }
1205
1208
  return 1;
1206
- }), s = g(() => {
1209
+ }), s = f(() => {
1207
1210
  if (W.value == null || W.value === 0) return null;
1208
1211
  const r = W.value * e.value;
1209
1212
  return ut(r, Oe.value);
1210
- }), p = g(() => W.value == null || W.value === 0 ? null : ut(W.value, Oe.value)), F = g(() => s.value ? dt(s.value.amount, s.value.symbol) : ""), I = g(() => p.value ? dt(p.value.amount, p.value.symbol) : ""), J = g(() => e.value === 1 ? w("report.common.estimatedCostBatchSingular") : w("report.common.estimatedCostBatchPlural")), le = g(() => se.value ? "..." : !F.value || !I.value ? "--" : w("report.common.estimatedCostFormula", {
1213
+ }), p = f(() => W.value == null || W.value === 0 ? null : ut(W.value, Oe.value)), C = f(() => s.value ? dt(s.value.amount, s.value.symbol) : ""), I = f(() => p.value ? dt(p.value.amount, p.value.symbol) : ""), j = f(() => e.value === 1 ? w("report.common.estimatedCostBatchSingular") : w("report.common.estimatedCostBatchPlural")), Z = f(() => se.value ? "..." : !C.value || !I.value ? "--" : w("report.common.estimatedCostFormula", {
1211
1214
  batchCount: e.value,
1212
- batchLabel: J.value,
1215
+ batchLabel: j.value,
1213
1216
  baseCost: I.value,
1214
- totalCost: F.value
1217
+ totalCost: C.value
1215
1218
  }));
1216
- let me = [];
1217
- const _e = Yt(async () => {
1219
+ let ce = [];
1220
+ const we = Yt(async () => {
1218
1221
  if (!A.value) return;
1219
1222
  const r = Qe(a.value.tiles).filter(
1220
1223
  (t) => {
1221
- var f;
1222
- return ((f = t.widget.config.schemaNames) == null ? void 0 : f.length) > 0;
1224
+ var V;
1225
+ return ((V = t.widget.config.schemaNames) == null ? void 0 : V.length) > 0;
1223
1226
  }
1224
1227
  );
1225
1228
  if (r.length === 0) {
1226
1229
  W.value = null;
1227
1230
  return;
1228
1231
  }
1229
- se.value = !0, me.forEach((t) => t.abort()), me = [];
1232
+ se.value = !0, ce.forEach((t) => t.abort()), ce = [];
1230
1233
  try {
1231
1234
  const t = await Promise.all(
1232
- r.map((f) => {
1233
- const $ = new AbortController();
1234
- return me.push($), Gt({
1235
- widget: f.widget,
1236
- signal: $.signal,
1237
- tileId: f.id,
1235
+ r.map((V) => {
1236
+ const b = new AbortController();
1237
+ return ce.push(b), Gt({
1238
+ widget: V.widget,
1239
+ signal: b.signal,
1240
+ tileId: V.id,
1238
1241
  scopedDateRange: de.value,
1239
1242
  scopedCompareDateRange: l.value
1240
1243
  });
1241
1244
  })
1242
1245
  );
1243
- W.value = t.reduce((f, $) => f + ($.totalBytesProcessed ?? 0), 0);
1246
+ W.value = t.reduce((V, b) => V + (b.totalBytesProcessed ?? 0), 0);
1244
1247
  } catch (t) {
1245
1248
  t.code !== "ERR_CANCELED" && (W.value = null);
1246
1249
  } finally {
1247
1250
  se.value = !1;
1248
1251
  }
1249
1252
  }, 1e3);
1250
- ge(
1253
+ be(
1251
1254
  [
1252
1255
  () => a.value.tiles,
1253
1256
  () => a.value.queryVersion,
1254
1257
  () => a.value.queryDatasource,
1255
1258
  () => a.value.batch,
1256
- () => ye.value,
1257
- () => Ee.value,
1258
1259
  () => he.value,
1260
+ () => Ee.value,
1261
+ () => _e.value,
1259
1262
  () => n.value,
1260
1263
  () => m.value
1261
1264
  ],
1262
1265
  () => {
1263
- _e();
1266
+ we();
1264
1267
  },
1265
1268
  { deep: !0 }
1266
1269
  ), pt(() => {
1267
- _e();
1270
+ we();
1268
1271
  }), Vt(() => {
1269
- me.forEach((r) => r.abort());
1272
+ ce.forEach((r) => r.abort());
1270
1273
  });
1271
1274
  function Ne(r) {
1272
1275
  var t;
@@ -1275,17 +1278,17 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1275
1278
  function Pe(r) {
1276
1279
  return !re.value.find((t) => t.name === r.schemaName);
1277
1280
  }
1278
- return ge(
1281
+ return be(
1279
1282
  () => a.value.globalFilters,
1280
1283
  (r) => {
1281
1284
  X.value = JSON.parse(JSON.stringify(r || []));
1282
1285
  },
1283
1286
  { deep: !0, immediate: !0 }
1284
1287
  ), (r, t) => {
1285
- const f = x("FmTextField"), $ = x("FmSelect"), we = x("FmSwitch"), Ge = x("FmButton"), je = x("FmIcon"), Je = x("FmTooltip"), ht = x("FmMenuItem"), _t = x("FmMenu"), wt = x("FmListItem"), xt = x("FmList"), Ct = x("FmForm");
1286
- return u(), S(Tt(o(c).lg || o(c).md ? el : tl), {
1288
+ const V = F("FmTextField"), b = F("FmSelect"), me = F("FmSwitch"), Ge = F("FmButton"), je = F("FmIcon"), Je = F("FmTooltip"), ht = F("FmMenuItem"), _t = F("FmMenu"), wt = F("FmListItem"), Ft = F("FmList"), xt = F("FmForm");
1289
+ return d(), S(Tt(o(c).lg || o(c).md ? el : tl), {
1287
1290
  "model-value": v.hideConfiguration,
1288
- "onUpdate:modelValue": t[12] || (t[12] = (N) => b("hideConfiguration", N))
1291
+ "onUpdate:modelValue": t[12] || (t[12] = (N) => g("hideConfiguration", N))
1289
1292
  }, {
1290
1293
  default: _(() => [
1291
1294
  i(ul, {
@@ -1295,16 +1298,16 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1295
1298
  tiles: o(Qe)(a.value.tiles),
1296
1299
  schemas: re.value,
1297
1300
  "onUpdate:globalFilter": t[1] || (t[1] = (N) => {
1298
- N && (a.value.globalFilters || (a.value.globalFilters = []), typeof o(V) == "number" && o(V) >= 0 ? a.value.globalFilters[o(V)] = N : a.value.globalFilters.push(N));
1301
+ N && (a.value.globalFilters || (a.value.globalFilters = []), typeof o(T) == "number" && o(T) >= 0 ? a.value.globalFilters[o(T)] = N : a.value.globalFilters.push(N));
1299
1302
  })
1300
1303
  }, null, 8, ["is-open", "global-filter", "tiles", "schemas"]),
1301
1304
  i(Xt, {
1302
1305
  modelValue: o(y),
1303
1306
  "onUpdate:modelValue": t[2] || (t[2] = (N) => vt(y) ? y.value = N : null),
1304
- "is-open": j.value,
1305
- "onUpdate:isOpen": t[3] || (t[3] = (N) => j.value = N)
1307
+ "is-open": J.value,
1308
+ "onUpdate:isOpen": t[3] || (t[3] = (N) => J.value = N)
1306
1309
  }, null, 8, ["modelValue", "is-open"]),
1307
- i(Ct, {
1310
+ i(xt, {
1308
1311
  ref_key: "form",
1309
1312
  ref: k,
1310
1313
  class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
@@ -1317,20 +1320,20 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1317
1320
  ]),
1318
1321
  content: _(() => [
1319
1322
  h("div", kl, [
1320
- i(f, {
1323
+ i(V, {
1321
1324
  modelValue: Ve.value,
1322
1325
  "onUpdate:modelValue": t[4] || (t[4] = (N) => Ve.value = N),
1323
1326
  label: o(w)("report.common.name"),
1324
1327
  placeholder: o(w)("report.common.name")
1325
1328
  }, null, 8, ["modelValue", "label", "placeholder"]),
1326
- (u(), S($, {
1329
+ (d(), S(b, {
1327
1330
  key: `category-${o(ne)}`,
1328
1331
  modelValue: a.value.category,
1329
1332
  "onUpdate:modelValue": t[5] || (t[5] = (N) => a.value.category = N),
1330
1333
  label: o(w)("report.common.category"),
1331
1334
  items: L.value
1332
1335
  }, null, 8, ["modelValue", "label", "items"])),
1333
- i(f, {
1336
+ i(V, {
1334
1337
  modelValue: a.value.description,
1335
1338
  "onUpdate:modelValue": t[6] || (t[6] = (N) => a.value.description = N),
1336
1339
  label: o(w)("report.common.description"),
@@ -1352,35 +1355,35 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1352
1355
  h("div", Vl, [
1353
1356
  h("div", Tl, [
1354
1357
  t[15] || (t[15] = h("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, "V2", -1)),
1355
- i(we, {
1356
- modelValue: be.value,
1357
- "onUpdate:modelValue": t[7] || (t[7] = (N) => be.value = N)
1358
+ i(me, {
1359
+ modelValue: ye.value,
1360
+ "onUpdate:modelValue": t[7] || (t[7] = (N) => ye.value = N)
1358
1361
  }, null, 8, ["modelValue"])
1359
1362
  ]),
1360
- be.value && ve.value ? (u(), S($, {
1363
+ ye.value && fe.value ? (d(), S(b, {
1361
1364
  key: 0,
1362
1365
  modelValue: a.value.queryDatasource,
1363
1366
  "onUpdate:modelValue": t[8] || (t[8] = (N) => a.value.queryDatasource = N),
1364
1367
  label: o(w)("report.common.queryDatasource"),
1365
1368
  items: Q
1366
1369
  }, null, 8, ["modelValue", "label"])) : U("", !0),
1367
- i($, {
1370
+ i(b, {
1368
1371
  modelValue: ie.value,
1369
1372
  "onUpdate:modelValue": t[9] || (t[9] = (N) => ie.value = N),
1370
1373
  label: o(w)("report.common.batch"),
1371
1374
  items: ke
1372
1375
  }, null, 8, ["modelValue", "label"]),
1373
- ie.value !== "none" ? (u(), S(f, {
1376
+ ie.value !== "none" ? (d(), S(V, {
1374
1377
  key: 1,
1375
- modelValue: fe.value,
1376
- "onUpdate:modelValue": t[10] || (t[10] = (N) => fe.value = N),
1378
+ modelValue: ge.value,
1379
+ "onUpdate:modelValue": t[10] || (t[10] = (N) => ge.value = N),
1377
1380
  modelModifiers: { number: !0 },
1378
1381
  label: ie.value === "days" ? o(w)("report.common.days") : o(w)("report.common.locations"),
1379
1382
  type: "number"
1380
1383
  }, null, 8, ["modelValue", "label"])) : U("", !0),
1381
- A.value ? (u(), R("div", $l, [
1384
+ A.value ? (d(), R("div", $l, [
1382
1385
  h("span", Sl, E(o(w)("report.common.estimatedBqCost")), 1),
1383
- h("p", Dl, E(le.value), 1),
1386
+ h("p", Dl, E(Z.value), 1),
1384
1387
  h("div", Ol, [
1385
1388
  h("div", null, "* " + E(o(w)("report.common.estimatedCostGuidelineBigQuery")), 1),
1386
1389
  h("div", null, "* " + E(o(w)("report.common.estimatedCostGuidelineDateRange")), 1),
@@ -1409,10 +1412,10 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1409
1412
  "border-color": o($e).ColorPrimary,
1410
1413
  "text-color": o($e).ColorPrimary,
1411
1414
  onClick: t[11] || (t[11] = () => {
1412
- V.value = null, D.value = null, ue.value = !0;
1415
+ T.value = null, D.value = null, ue.value = !0;
1413
1416
  })
1414
1417
  }, null, 8, ["label", "border-color", "text-color"]),
1415
- i(xt, null, {
1418
+ i(Ft, null, {
1416
1419
  default: _(() => [
1417
1420
  i(o(ft), {
1418
1421
  list: a.value.globalFilters,
@@ -1420,7 +1423,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1420
1423
  class: "flex flex-col gap-2 cursor-grab",
1421
1424
  handle: ".handle"
1422
1425
  }, {
1423
- item: _(({ element: N, index: Ft }) => [
1426
+ item: _(({ element: N, index: Ct }) => [
1424
1427
  i(wt, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
1425
1428
  default: _(() => [
1426
1429
  i(je, {
@@ -1438,7 +1441,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1438
1441
  ]),
1439
1442
  _: 2
1440
1443
  }, 1032, ["content"]),
1441
- Pe(N) ? (u(), S(Je, {
1444
+ Pe(N) ? (d(), S(Je, {
1442
1445
  key: 0,
1443
1446
  content: o(w)("report.section.filter.missingSchema"),
1444
1447
  "z-index": 99
@@ -1450,7 +1453,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1450
1453
  })
1451
1454
  ]),
1452
1455
  _: 1
1453
- }, 8, ["content"])) : Ne(N) ? (u(), S(Je, {
1456
+ }, 8, ["content"])) : Ne(N) ? (d(), S(Je, {
1454
1457
  key: 1,
1455
1458
  content: o(w)("report.section.filter.missingTileIds"),
1456
1459
  "z-index": 99
@@ -1477,9 +1480,9 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1477
1480
  })
1478
1481
  ]),
1479
1482
  default: _(() => [
1480
- (u(), R(xe, null, Be(q, (Ke, kt) => i(ht, {
1483
+ (d(), R(Fe, null, Be(q, (Ke, kt) => i(ht, {
1481
1484
  key: kt,
1482
- onClick: (Ql) => Ke.onClick(Ft)
1485
+ onClick: (Ql) => Ke.onClick(Ct)
1483
1486
  }, {
1484
1487
  label: _(() => [
1485
1488
  h("p", {
@@ -1512,9 +1515,9 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1512
1515
  t[18] || (t[18] = h("div", { class: "grow" }, null, -1))
1513
1516
  ]),
1514
1517
  content: _(() => [
1515
- i(Fl, {
1518
+ i(Cl, {
1516
1519
  report: a.value,
1517
- onAddWidget: pe
1520
+ onAddWidget: ve
1518
1521
  }, null, 8, ["report"])
1519
1522
  ]),
1520
1523
  _: 1
@@ -1543,7 +1546,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1543
1546
  }, Wl = {
1544
1547
  key: 0,
1545
1548
  class: "w-full grid grid-cols-12 gap-[24px] p-24"
1546
- }, Hl = /* @__PURE__ */ Ce({
1549
+ }, Hl = /* @__PURE__ */ xe({
1547
1550
  __name: "ReportEditorViewport",
1548
1551
  props: /* @__PURE__ */ Se({
1549
1552
  hideConfiguration: { type: Boolean, required: !1, default: !1 },
@@ -1556,27 +1559,27 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1556
1559
  modelModifiers: {}
1557
1560
  }),
1558
1561
  emits: /* @__PURE__ */ Se(["hideConfiguration"], ["update:modelValue"]),
1559
- setup(M, { emit: d }) {
1560
- const { breakpoints: a } = He(), c = De(M, "modelValue"), v = g(() => {
1562
+ setup(M, { emit: u }) {
1563
+ const { breakpoints: a } = He(), c = De(M, "modelValue"), v = f(() => {
1561
1564
  var y;
1562
1565
  return At((y = c.value) == null ? void 0 : y.tiles);
1563
- }), b = M, B = g(() => b.previewWidth > 0 && b.previewHeight > 0), Y = g(() => a.value.sm || a.value.xs), k = d;
1564
- return (y, C) => {
1565
- const O = x("FmCircularProgress"), G = x("FmButton"), D = x("FmMenuDivider"), V = x("FmCard");
1566
- return u(), R("div", Ml, [
1567
- c.value ? (u(), R(xe, { key: 1 }, [
1568
- B.value ? U("", !0) : (u(), S(Nt, {
1566
+ }), g = M, B = f(() => g.previewWidth > 0 && g.previewHeight > 0), Y = f(() => a.value.sm || a.value.xs), k = u;
1567
+ return (y, x) => {
1568
+ const O = F("FmCircularProgress"), G = F("FmButton"), D = F("FmMenuDivider"), T = F("FmCard");
1569
+ return d(), R("div", Ml, [
1570
+ c.value ? (d(), R(Fe, { key: 1 }, [
1571
+ B.value ? U("", !0) : (d(), S(Nt, {
1569
1572
  key: 0,
1570
- "model-value": !b.hideConfiguration
1573
+ "model-value": !g.hideConfiguration
1571
1574
  }, {
1572
1575
  right: _(() => [
1573
1576
  h("div", Bl, [
1574
- c.value ? (u(), S(mt, {
1577
+ c.value ? (d(), S(mt, {
1575
1578
  key: 0,
1576
1579
  modelValue: c.value,
1577
- "onUpdate:modelValue": C[0] || (C[0] = (T) => c.value = T),
1578
- "hide-configuration": b.hideConfiguration,
1579
- onHideConfiguration: C[1] || (C[1] = (T) => k("hideConfiguration", T))
1580
+ "onUpdate:modelValue": x[0] || (x[0] = ($) => c.value = $),
1581
+ "hide-configuration": g.hideConfiguration,
1582
+ onHideConfiguration: x[1] || (x[1] = ($) => k("hideConfiguration", $))
1580
1583
  }, null, 8, ["modelValue", "hide-configuration"])) : U("", !0)
1581
1584
  ])
1582
1585
  ]),
@@ -1589,7 +1592,7 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1589
1592
  "text-color": o($e).ColorPrimary,
1590
1593
  class: "m-24 my-16",
1591
1594
  size: "md",
1592
- onClick: C[2] || (C[2] = (T) => k("hideConfiguration", !b.hideConfiguration))
1595
+ onClick: x[2] || (x[2] = ($) => k("hideConfiguration", !g.hideConfiguration))
1593
1596
  }, null, 8, ["border-color", "text-color"])
1594
1597
  ])
1595
1598
  ]),
@@ -1599,8 +1602,8 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1599
1602
  vertical: "",
1600
1603
  style: { margin: "0px" }
1601
1604
  }),
1602
- !Y.value && !B.value ? (u(), R("div", ql, [
1603
- c.value.tiles.length > 0 ? (u(), R("div", El, [
1605
+ !Y.value && !B.value ? (d(), R("div", ql, [
1606
+ c.value.tiles.length > 0 ? (d(), R("div", El, [
1604
1607
  h("div", Pl, [
1605
1608
  i(st)
1606
1609
  ]),
@@ -1610,11 +1613,11 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1610
1613
  "leaf-index-by-id": v.value,
1611
1614
  "hide-export": !0
1612
1615
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
1613
- ])) : (u(), S(Ze, { key: 1 }))
1614
- ])) : Y.value && !B.value ? (u(), R("div", zl, [
1615
- i(V, { class: "px-5 pb-28" }, {
1616
+ ])) : (d(), S(Ze, { key: 1 }))
1617
+ ])) : Y.value && !B.value ? (d(), R("div", zl, [
1618
+ i(T, { class: "px-5 pb-28" }, {
1616
1619
  default: _(() => [
1617
- c.value.tiles.length > 0 ? (u(), R("div", Ll, [
1620
+ c.value.tiles.length > 0 ? (d(), R("div", Ll, [
1618
1621
  h("div", Gl, [
1619
1622
  i(st)
1620
1623
  ]),
@@ -1624,105 +1627,105 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1624
1627
  "leaf-index-by-id": v.value,
1625
1628
  "hide-export": !0
1626
1629
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
1627
- ])) : (u(), S(Ze, { key: 1 }))
1630
+ ])) : (d(), S(Ze, { key: 1 }))
1628
1631
  ]),
1629
1632
  _: 1
1630
1633
  }),
1631
- c.value ? (u(), S(mt, {
1634
+ c.value ? (d(), S(mt, {
1632
1635
  key: 0,
1633
1636
  modelValue: c.value,
1634
- "onUpdate:modelValue": C[3] || (C[3] = (T) => c.value = T),
1635
- "hide-configuration": b.hideConfiguration,
1636
- onHideConfiguration: C[4] || (C[4] = (T) => {
1637
- k("hideConfiguration", T);
1637
+ "onUpdate:modelValue": x[3] || (x[3] = ($) => c.value = $),
1638
+ "hide-configuration": g.hideConfiguration,
1639
+ onHideConfiguration: x[4] || (x[4] = ($) => {
1640
+ k("hideConfiguration", $);
1638
1641
  })
1639
1642
  }, null, 8, ["modelValue", "hide-configuration"])) : U("", !0)
1640
- ])) : (u(), R("div", Al, [
1643
+ ])) : (d(), R("div", Al, [
1641
1644
  h("div", {
1642
1645
  style: et({
1643
1646
  transformOrigin: "top center",
1644
- transform: `scale(${b.previewScale})`
1647
+ transform: `scale(${g.previewScale})`
1645
1648
  })
1646
1649
  }, [
1647
1650
  h("div", {
1648
1651
  class: "overflow-y-auto bg-white rounded-lg",
1649
1652
  style: et({
1650
- width: b.previewWidth + "px",
1651
- height: b.previewHeight + "px"
1653
+ width: g.previewWidth + "px",
1654
+ height: g.previewHeight + "px"
1652
1655
  })
1653
1656
  }, [
1654
- c.value.tiles.length > 0 ? (u(), R("div", Wl, [
1657
+ c.value.tiles.length > 0 ? (d(), R("div", Wl, [
1655
1658
  i(Ye, {
1656
1659
  tiles: c.value.tiles,
1657
1660
  "report-id": c.value.id || "editing",
1658
1661
  "leaf-index-by-id": v.value,
1659
1662
  "hide-export": !0,
1660
- "custom-screen-width": b.previewWidth
1663
+ "custom-screen-width": g.previewWidth
1661
1664
  }, null, 8, ["tiles", "report-id", "leaf-index-by-id", "custom-screen-width"])
1662
- ])) : (u(), S(Ze, { key: 1 }))
1665
+ ])) : (d(), S(Ze, { key: 1 }))
1663
1666
  ], 4)
1664
1667
  ], 4)
1665
1668
  ]))
1666
- ], 64)) : (u(), S(O, { key: 0 }))
1669
+ ], 64)) : (d(), S(O, { key: 0 }))
1667
1670
  ]);
1668
1671
  };
1669
1672
  }
1670
- }), jl = { class: "flex items-center gap-4" }, Jl = { class: "flex justify-center items-center gap-2 w-full" }, Kl = { class: "flex gap-4" }, po = /* @__PURE__ */ Ce({
1673
+ }), jl = { class: "flex items-center gap-4" }, Jl = { class: "flex justify-center items-center gap-2 w-full" }, Kl = { class: "flex gap-4" }, po = /* @__PURE__ */ xe({
1671
1674
  __name: "ReportEditor",
1672
1675
  setup(M) {
1673
- const d = ot(), a = at(), c = lt(), { promptLoader: v } = Ht(), { t: b, te: B } = qe(), { currentReport: Y, editingReport: k } = Me(c), { breakpoints: y } = He(), C = g(() => {
1676
+ const u = ot(), a = at(), c = lt(), { promptLoader: v } = Ht(), { t: g, te: B } = qe(), { currentReport: Y, editingReport: k } = Me(c), { breakpoints: y } = He(), x = f(() => {
1674
1677
  var q;
1675
1678
  return !((q = k.value) != null && q.editable);
1676
- }), O = g(() => {
1679
+ }), O = f(() => {
1677
1680
  var q;
1678
- return ((q = k.value) == null ? void 0 : q.name) ?? b("report.editor.newReport");
1679
- }), G = g(() => Le(b, B, O.value, "other")), D = yt(), { promptMessage: V } = nt(), T = z(!1), X = g(() => [
1680
- { label: b("report.common.cancel"), value: "cancel", isPrimary: !1 },
1681
- { label: b("report.common.save"), value: "save", isPrimary: !0, prependIcon: "download" }
1681
+ return ((q = k.value) == null ? void 0 : q.name) ?? g("report.editor.newReport");
1682
+ }), G = f(() => Le(g, B, O.value, "other")), D = yt(), { promptMessage: T } = nt(), $ = z(!1), X = f(() => [
1683
+ { label: g("report.common.cancel"), value: "cancel", isPrimary: !1 },
1684
+ { label: g("report.common.save"), value: "save", isPrimary: !0, prependIcon: "download" }
1682
1685
  ]);
1683
1686
  async function ae() {
1684
1687
  if (!k.value || k.value.tiles.length === 0) {
1685
- D.open({ message: b("report.messages.noWidget"), type: "error" });
1688
+ D.open({ message: g("report.messages.noWidget"), type: "error" });
1686
1689
  return;
1687
1690
  }
1688
1691
  if (Wt(k.value.tiles) > bt) {
1689
- D.open({ message: b("report.messages.tooDeepNesting"), type: "error" });
1692
+ D.open({ message: g("report.messages.tooDeepNesting"), type: "error" });
1690
1693
  return;
1691
1694
  }
1692
- const q = C.value ? b("report.common.clone") : b("report.common.save");
1693
- if (await V({
1694
- title: `${b("report.messages.saveReport")}`,
1695
- message: b("report.messages.confirmAction", { action: q, name: G.value })
1695
+ const q = x.value ? g("report.common.clone") : g("report.common.save");
1696
+ if (await T({
1697
+ title: `${g("report.messages.saveReport")}`,
1698
+ message: g("report.messages.confirmAction", { action: q, name: G.value })
1696
1699
  }))
1697
1700
  try {
1698
1701
  await v(async () => {
1699
- if (C.value) {
1702
+ if (x.value) {
1700
1703
  const K = JSON.parse(JSON.stringify(k.value));
1701
- K.editable = !0, K.id = "", K.name = `${K.name} ${b("report.common.duplicate")}`, K.isDefault = !1, await c.createOrUpdateReport(K);
1704
+ K.editable = !0, K.id = "", K.name = `${K.name} ${g("report.common.duplicate")}`, K.isDefault = !1, await c.createOrUpdateReport(K);
1702
1705
  } else
1703
1706
  k.value && await c.createOrUpdateReport(k.value);
1704
- d.push({
1707
+ u.push({
1705
1708
  name: "reportView",
1706
1709
  query: a.query
1707
1710
  });
1708
1711
  });
1709
1712
  } catch (K) {
1710
1713
  console.log(K), D.open({
1711
- message: b("report.messages.failedToAction", { action: q }),
1714
+ message: g("report.messages.failedToAction", { action: q }),
1712
1715
  type: "error"
1713
1716
  });
1714
1717
  }
1715
1718
  }
1716
- async function Fe() {
1719
+ async function Ce() {
1717
1720
  var L;
1718
1721
  if (!k.value) return;
1719
- await V({
1720
- title: b("report.common.report", 1),
1721
- message: b("report.editor.notSaved", { name: (L = k.value) == null ? void 0 : L.name })
1722
- }) && (k.value = JSON.parse(JSON.stringify(Y.value)), d.back());
1722
+ await T({
1723
+ title: g("report.common.report", 1),
1724
+ message: g("report.editor.notSaved", { name: (L = k.value) == null ? void 0 : L.name })
1725
+ }) && (k.value = JSON.parse(JSON.stringify(Y.value)), u.back());
1723
1726
  }
1724
1727
  pt(() => {
1725
- k.value || d.push({ name: "reports" });
1728
+ k.value || u.push({ name: "reports" });
1726
1729
  });
1727
1730
  const ue = [
1728
1731
  {
@@ -1745,26 +1748,26 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1745
1748
  width: 390,
1746
1749
  height: 859
1747
1750
  }
1748
- ], j = z(ue[0]), w = z(!1), Z = g(() => w.value ? Math.max(j.value.width || 0, j.value.height || 0) : Math.min(j.value.width || 0, j.value.height || 0)), ne = g(() => w.value ? Math.min(j.value.width || 0, j.value.height || 0) : Math.max(j.value.width || 0, j.value.height || 0)), te = g(() => window.innerHeight - 72 - 56), re = g(() => {
1749
- if (!Z.value) return 1;
1750
- let q = (te.value - 48) / Z.value, L = ne.value * q;
1751
+ ], J = z(ue[0]), w = z(!1), ee = f(() => w.value ? Math.max(J.value.width || 0, J.value.height || 0) : Math.min(J.value.width || 0, J.value.height || 0)), ne = f(() => w.value ? Math.min(J.value.width || 0, J.value.height || 0) : Math.max(J.value.width || 0, J.value.height || 0)), le = f(() => window.innerHeight - 72 - 56), re = f(() => {
1752
+ if (!ee.value) return 1;
1753
+ let q = (le.value - 48) / ee.value, L = ne.value * q;
1751
1754
  return L > window.innerWidth && (q = window.innerWidth / ne.value, L = ne.value * q), q > 1 ? 1 : q;
1752
1755
  });
1753
- function ce(q) {
1754
- j.value = q;
1756
+ function pe(q) {
1757
+ J.value = q;
1755
1758
  }
1756
- function pe() {
1759
+ function ve() {
1757
1760
  w.value = !w.value;
1758
1761
  }
1759
1762
  return (q, L) => {
1760
- const K = x("FmTooltip"), ve = x("FmButton"), be = x("FmPageHead");
1761
- return u(), S(It, null, {
1763
+ const K = F("FmTooltip"), fe = F("FmButton"), ye = F("FmPageHead");
1764
+ return d(), S(It, null, {
1762
1765
  default: _(() => [
1763
- i(be, {
1766
+ i(ye, {
1764
1767
  "data-editor-header": "true",
1765
1768
  actions: X.value,
1766
1769
  "onClick:action": L[0] || (L[0] = (Q) => {
1767
- Q === "cancel" && Fe(), Q === "save" && ae();
1770
+ Q === "cancel" && Ce(), Q === "save" && ae();
1768
1771
  })
1769
1772
  }, {
1770
1773
  title: _(() => [
@@ -1782,40 +1785,40 @@ const vl = { class: "flex flex-col gap-16" }, fl = {
1782
1785
  }, 8, ["content"]),
1783
1786
  h("div", Jl, [
1784
1787
  h("div", Kl, [
1785
- (u(), R(xe, null, Be(ue, (Q) => {
1788
+ (d(), R(Fe, null, Be(ue, (Q) => {
1786
1789
  var ke;
1787
- return i(ve, {
1790
+ return i(fe, {
1788
1791
  key: Q.labelKey,
1789
- label: o(b)(Q.labelKey),
1790
- variant: ((ke = j.value) == null ? void 0 : ke.labelKey) === Q.labelKey ? "primary" : "secondary",
1792
+ label: o(g)(Q.labelKey),
1793
+ variant: ((ke = J.value) == null ? void 0 : ke.labelKey) === Q.labelKey ? "primary" : "secondary",
1791
1794
  size: "md",
1792
- onClick: (ie) => ce(Q)
1795
+ onClick: (ie) => pe(Q)
1793
1796
  }, null, 8, ["label", "variant", "onClick"]);
1794
1797
  }), 64))
1795
1798
  ]),
1796
- i(ve, {
1799
+ i(fe, {
1797
1800
  icon: "screen_rotation",
1798
1801
  variant: "tertiary",
1799
1802
  size: "md",
1800
1803
  class: "text-fm-color-typo-primary",
1801
- onClick: pe
1804
+ onClick: ve
1802
1805
  })
1803
1806
  ])
1804
1807
  ])
1805
1808
  ]),
1806
1809
  _: 1
1807
1810
  }, 8, ["actions"]),
1808
- o(k) ? (u(), S(Hl, {
1811
+ o(k) ? (d(), S(Hl, {
1809
1812
  key: 0,
1810
1813
  modelValue: o(k),
1811
1814
  "onUpdate:modelValue": L[1] || (L[1] = (Q) => vt(k) ? k.value = Q : null),
1812
- style: et({ height: te.value + "px" }),
1815
+ style: et({ height: le.value + "px" }),
1813
1816
  class: Ue(o(y).lg || o(y).md ? "flex" : ""),
1814
- "hide-configuration": T.value,
1817
+ "hide-configuration": $.value,
1815
1818
  "preview-width": ne.value,
1816
- "preview-height": Z.value,
1819
+ "preview-height": ee.value,
1817
1820
  "preview-scale": re.value,
1818
- onHideConfiguration: L[2] || (L[2] = (Q) => T.value = Q)
1821
+ onHideConfiguration: L[2] || (L[2] = (Q) => $.value = Q)
1819
1822
  }, null, 8, ["modelValue", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : U("", !0)
1820
1823
  ]),
1821
1824
  _: 1