@feedmepos/mf-report 5.27.45 → 5.27.46

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 (26) hide show
  1. package/dist/{App-qmp_wTqr.js → App-FfA0Wieg.js} +4 -4
  2. package/dist/{DateRangeSelect-DTc5W51W.js → DateRangeSelect-C_wtAXY4.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-Rfx_MV5j.js → Default.vue_vue_type_script_setup_true_lang-BwOQeJud.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CgQT7aVu.js → DynamicWidget.vue_vue_type_script_setup_true_lang-eqBy38_k.js} +1691 -1711
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ch8h7LYw.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DvdiNZep.js} +1277 -1162
  6. package/dist/{InsightView-DTXLQI3y.js → InsightView-Dpn068zp.js} +4 -4
  7. package/dist/{Integration-jDsdDTJe.js → Integration-CvyPuNQ2.js} +5 -5
  8. package/dist/{Integrations-Bw_gAgzo.js → Integrations-DGYwGgGf.js} +2 -2
  9. package/dist/{Layout-KsXHFW6a.js → Layout-DPY4m5oT.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-EX-uYhXm.js → MenuTab.vue_vue_type_script_setup_true_lang-D2fubpyx.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CjkhnFr1.js → NavigationTab.vue_vue_type_script_setup_true_lang-DlIBymYj.js} +3 -3
  12. package/dist/{OverviewView-8gQ9VC5f.js → OverviewView-iZ6v3Dfe.js} +4 -4
  13. package/dist/{Report-CyxE4Mk6.js → Report-t4NL8ihv.js} +207 -189
  14. package/dist/{ReportEditor-Bm5k5ZUc.js → ReportEditor-DkRI93tE.js} +6 -6
  15. package/dist/{ReportView-B_EjiBA3.js → ReportView-DBNFH8B5.js} +6 -6
  16. package/dist/{Setting-BEUoiP3V.js → Setting-DjS4GUGW.js} +3 -3
  17. package/dist/{Template-aCg-U8jo.js → Template-x6Hl6z48.js} +3 -3
  18. package/dist/{TileEditor-BKfGFwLu.js → TileEditor-BwhiEeGn.js} +5 -5
  19. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-C-x_Wda9.js → TilePageStack.vue_vue_type_script_setup_true_lang-DJPeCSDi.js} +2 -2
  20. package/dist/{TransitionFade-BEJ9_BKt.js → TransitionFade-CYqZ2pPL.js} +4 -4
  21. package/dist/{app-5pQ-88Qg.js → app-BdUHDzyB.js} +12 -12
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-C93JSHxi.js → formatChartData.worker-3v08gjzr.js} +54 -26
  24. package/dist/assets/{processTableData.worker-BsZijJg_.js → processTableData.worker-DF65vmST.js} +54 -26
  25. package/dist/{useRestaurantPermission-BIQpfucB.js → useRestaurantPermission-UY9t-Lef.js} +1 -1
  26. package/package.json +1 -1
@@ -1,93 +1,93 @@
1
- import { defineComponent as $e, ref as j, watch as pe, computed as w, h as p, withModifiers as De, resolveComponent as S, createBlock as G, openBlock as A, withCtx as m, createVNode as c, createElementVNode as h, unref as e, normalizeStyle as Ie, normalizeClass as k, withDirectives as H, createElementBlock as Fe, Fragment as Oe, renderList as Le, toDisplayString as J, createTextVNode as Pe, vShow as Q } from "vue";
2
- import { storeToRefs as de } from "pinia";
3
- import { u as Ne } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ch8h7LYw.js";
4
- import { _ as Ve } from "./Default.vue_vue_type_script_setup_true_lang-Rfx_MV5j.js";
5
- import { u as Ae } from "./message-dialog-UoMWOnil.js";
6
- import { a as Je } from "./_plugin-vue_export-helper-kkiiQoKl.js";
7
- import { useSnackbar as ze, useBreakpoints as Be, components as Te, FmButtonColorThemeVariant as Ue } from "@feedmepos/ui-library";
8
- import { _ as Ee } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Ckn2p74A.js";
9
- import { c as Ke, a as fe, h as Me } from "./app-5pQ-88Qg.js";
10
- import { useRouter as Ye, useRoute as qe, onBeforeRouteLeave as je } from "vue-router";
11
- import { useI18n as Ge } from "@feedmepos/mf-common";
12
- import { r as W } from "./i18n-CI_sQ5d_.js";
13
- const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe = { class: "w-[343px]" }, We = { class: "fm-typo-en-body-md-600" }, mt = /* @__PURE__ */ $e({
1
+ import { defineComponent as Ie, ref as Q, watch as de, computed as h, h as d, withModifiers as Fe, resolveComponent as x, createBlock as W, openBlock as J, withCtx as m, createVNode as i, createElementVNode as g, unref as e, normalizeStyle as Oe, normalizeClass as y, withDirectives as fe, createElementBlock as Pe, Fragment as Le, renderList as Ne, toDisplayString as _, createTextVNode as Ve, vShow as ye } from "vue";
2
+ import { storeToRefs as ve } from "pinia";
3
+ import { u as Ae } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DvdiNZep.js";
4
+ import { _ as Je } from "./Default.vue_vue_type_script_setup_true_lang-BwOQeJud.js";
5
+ import { u as ze } from "./message-dialog-UoMWOnil.js";
6
+ import { a as Be } from "./_plugin-vue_export-helper-kkiiQoKl.js";
7
+ import { useSnackbar as Te, useBreakpoints as Ue, components as Ee, FmButtonColorThemeVariant as Ke } from "@feedmepos/ui-library";
8
+ import { _ as Me } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Ckn2p74A.js";
9
+ import { c as Ye, a as ge, h as qe } from "./app-BdUHDzyB.js";
10
+ import { useRouter as je, useRoute as Ge, onBeforeRouteLeave as He } from "vue-router";
11
+ import { useI18n as Qe } from "@feedmepos/mf-common";
12
+ import { r as X } from "./i18n-CI_sQ5d_.js";
13
+ const We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "w-[343px]" }, Ze = { class: "fm-typo-en-body-md-600" }, dt = /* @__PURE__ */ Ie({
14
14
  __name: "Report",
15
- setup(Xe) {
16
- const { t: a, te: z } = Ge(), X = Ye(), Z = qe(), d = Ne(), ve = Ke(), { business: ge } = de(fe()), {
17
- reports: f,
15
+ setup(et) {
16
+ const { t: a, te: z } = Qe(), Z = je(), ee = Ge(), f = Ae(), be = Ye(), { business: we } = ve(ge()), {
17
+ reports: p,
18
18
  overviewReport: B,
19
19
  categories: $,
20
- pinReport: D,
21
- isOpenAddReportDialog: ye,
22
- scrollPositionY: ee,
23
- customReportQuota: I,
24
- canCreateCustomReport: te
25
- } = de(d), { promptMessage: oe } = Ae(), { promptLoader: T } = Je(), i = ze(), { breakpoints: u } = Be(), { canRead: ae, canUpdate: re, canDuplicate: be, canDelete: ne, canCreateReport: we } = Me(), g = j();
26
- je(() => {
27
- g.value && (ee.value = g.value.$el.children[0].scrollTop);
28
- }), pe(g, () => {
29
- g.value && setTimeout(() => {
30
- g.value && (g.value.$el.children[0].scrollTop = ee.value);
20
+ pinReport: I,
21
+ isOpenAddReportDialog: Re,
22
+ scrollPositionY: te,
23
+ customReportQuota: F,
24
+ canCreateCustomReport: oe
25
+ } = ve(f), { promptMessage: ae } = ze(), { promptLoader: T } = Be(), c = Te(), { breakpoints: u } = Ue(), { canRead: re, canUpdate: ne, canDuplicate: se, canDelete: U, canCreateReport: he } = qe(), b = Q();
26
+ He(() => {
27
+ b.value && (te.value = b.value.$el.children[0].scrollTop);
28
+ }), de(b, () => {
29
+ b.value && setTimeout(() => {
30
+ b.value && (b.value.$el.children[0].scrollTop = te.value);
31
31
  }, 200);
32
32
  });
33
- const U = w(() => D.value && f.value ? f.value.filter((o) => {
33
+ const E = h(() => I.value && p.value ? p.value.filter((o) => {
34
34
  var t;
35
- return (t = D.value) == null ? void 0 : t.includes(o.id);
35
+ return (t = I.value) == null ? void 0 : t.includes(o.id);
36
36
  }) : []);
37
- pe(
38
- [() => ge.value],
37
+ de(
38
+ [() => we.value],
39
39
  () => {
40
- d.refreshPinReport();
40
+ f.refreshPinReport();
41
41
  },
42
42
  { immediate: !0 }
43
43
  );
44
- const se = w(() => U.value.length > 0 ? f.value.filter(
45
- (o) => U.value.findIndex((t) => t.id === o.id) === -1
46
- ) : f.value), { FmButton: he, FmMenu: E, FmMenuItem: C, FmIcon: K, FmChip: M } = Te, le = w(() => [
44
+ const le = h(() => E.value.length > 0 ? p.value.filter(
45
+ (o) => E.value.findIndex((t) => t.id === o.id) === -1
46
+ ) : p.value), { FmButton: Ce, FmMenu: K, FmMenuItem: C, FmIcon: M, FmChip: Y } = Ee, ce = h(() => [
47
47
  { value: void 0, label: "All" },
48
48
  ...$.value.map((o) => ({
49
49
  value: o.id,
50
50
  label: o.name
51
51
  }))
52
- ]), F = j(le.value[0]), Y = j(""), R = w(() => se.value.length === 0 || $.value.length === 0 ? [] : [
53
- ...U.value.map((t) => {
52
+ ]), O = Q(ce.value[0]), q = Q(""), S = h(() => le.value.length === 0 || $.value.length === 0 ? [] : [
53
+ ...E.value.map((t) => {
54
54
  const r = $.value.find((l) => l.id === t.category);
55
55
  return {
56
- name: W(a, z, t.name, "other"),
56
+ name: X(a, z, t.name, "other"),
57
57
  categoryId: (r == null ? void 0 : r.id) ?? "",
58
58
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
59
59
  reportId: t.id,
60
60
  editable: t.editable,
61
61
  description: t.description || "",
62
62
  pin: !0,
63
- canUpdate: re(t),
64
- canRead: ae(t)
63
+ canUpdate: ne(t),
64
+ canRead: re(t)
65
65
  };
66
66
  }),
67
- ...se.value.map((t) => {
67
+ ...le.value.map((t) => {
68
68
  const r = $.value.find((l) => l.id === t.category);
69
69
  return {
70
- name: W(a, z, t.name, "other"),
70
+ name: X(a, z, t.name, "other"),
71
71
  categoryId: (r == null ? void 0 : r.id) ?? "",
72
72
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
73
73
  reportId: t.id,
74
74
  editable: t.editable,
75
75
  description: t.description || "",
76
76
  pin: !1,
77
- canUpdate: re(t),
78
- canRead: ae(t)
77
+ canUpdate: ne(t),
78
+ canRead: re(t)
79
79
  };
80
80
  })
81
- ].filter((t) => F.value.value && t.categoryId !== F.value.value ? !1 : `${(t == null ? void 0 : t.name) || ""}${(t == null ? void 0 : t.description) || ""}`.toLowerCase().indexOf(Y.value.toLowerCase()) !== -1)), Ce = w(
82
- () => R.value.map((o) => `${o.name}${o.category}`).toString()
83
- ), Re = w(() => [
81
+ ].filter((t) => O.value.value && t.categoryId !== O.value.value ? !1 : `${(t == null ? void 0 : t.name) || ""}${(t == null ? void 0 : t.description) || ""}`.toLowerCase().indexOf(q.value.toLowerCase()) !== -1)), Se = h(
82
+ () => S.value.map((o) => `${o.name}${o.category}`).toString()
83
+ ), xe = h(() => [
84
84
  {
85
85
  accessorKey: "name",
86
86
  header: a("report.common.name"),
87
87
  enableSorting: !1,
88
88
  cell: (o) => {
89
89
  const t = o.row.original;
90
- return p(
90
+ return d(
91
91
  "span",
92
92
  { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
93
93
  o.getValue()
@@ -101,8 +101,8 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
101
101
  meta: {
102
102
  width: "100px"
103
103
  },
104
- cell: (o) => p(
105
- M,
104
+ cell: (o) => d(
105
+ Y,
106
106
  {
107
107
  // grey out chip text when user cannot read report
108
108
  class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${o.row.original.canRead ? "" : "opacity-40 cursor-not-allowed"} fm-typo-en-body-sm-600`,
@@ -117,7 +117,7 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
117
117
  enableSorting: !1,
118
118
  cell: (o) => {
119
119
  const t = o.row.original;
120
- return p(
120
+ return d(
121
121
  "span",
122
122
  { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
123
123
  o.getValue()
@@ -132,21 +132,21 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
132
132
  width: "80px"
133
133
  },
134
134
  cell: (o) => {
135
- var y;
136
- const t = o.row.original, r = t.reportId, l = f.value.find((s) => s.id === r), q = r === ((y = B.value) == null ? void 0 : y.id), N = !t.canRead, _ = l ? be(l) : !1, V = l ? ne(l) : !1, n = [
135
+ var w;
136
+ const t = o.row.original, r = t.reportId, l = p.value.find((s) => s.id === r), H = r === ((w = B.value) == null ? void 0 : w.id), V = !t.canRead, D = l ? se(l) : !1, A = l ? U(l) : !1, n = [
137
137
  {
138
138
  label: a("report.common.duplicate"),
139
139
  onClick: () => {
140
- l && _ ? ue(l) : _ || i.open({
140
+ l && D ? me(l) : D || c.open({
141
141
  message: a("report.messages.noPermissionDuplicateReport"),
142
142
  type: "error"
143
143
  });
144
144
  },
145
145
  variant: "",
146
- disabled: !_
146
+ disabled: !D
147
147
  },
148
148
  {
149
- label: a(q ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
149
+ label: a(H ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
150
150
  onClick: async () => {
151
151
  l && ie(l);
152
152
  },
@@ -156,36 +156,36 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
156
156
  {
157
157
  label: a("report.common.remove"),
158
158
  onClick: () => {
159
- l && (V ? ce(l) : i.open({
159
+ l && (A ? ue(l) : c.open({
160
160
  message: a("report.messages.noPermissionDeleteReport"),
161
161
  type: "error"
162
162
  }));
163
163
  },
164
164
  variant: "destructive",
165
- disabled: !t.editable || !V
165
+ disabled: !t.editable || !A
166
166
  }
167
167
  ];
168
- return p(
168
+ return d(
169
169
  "div",
170
170
  {
171
171
  class: `flex ${u.value.lg || u.value.md ? "justify-end" : ""} items-center`
172
172
  },
173
173
  {
174
174
  default: () => [
175
- p(
175
+ d(
176
176
  "button",
177
177
  {
178
- disabled: N,
179
- title: N ? a("report.messages.noPermission") : void 0,
180
- onClick: De(() => {
181
- l && me(l);
178
+ disabled: V,
179
+ title: V ? a("report.messages.noPermission") : void 0,
180
+ onClick: Fe(() => {
181
+ l && pe(l);
182
182
  }, ["stop"]),
183
183
  class: `text-fm-color-neutral-gray-400 ${t.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
184
184
  },
185
185
  {
186
186
  default: () => [
187
- p(
188
- K,
187
+ d(
188
+ M,
189
189
  {
190
190
  name: "keep",
191
191
  class: "px-12 p-8",
@@ -197,8 +197,8 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
197
197
  ]
198
198
  }
199
199
  ),
200
- p(
201
- E,
200
+ d(
201
+ K,
202
202
  {
203
203
  stopClickPropagation: !0,
204
204
  shift: !0,
@@ -206,7 +206,7 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
206
206
  },
207
207
  {
208
208
  default: () => n.map(
209
- (s) => p(
209
+ (s) => d(
210
210
  C,
211
211
  {
212
212
  onClick: s.disabled ? {} : s.onClick,
@@ -215,17 +215,17 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
215
215
  disabled: s.disabled
216
216
  },
217
217
  {
218
- label: () => p("p", s.label)
218
+ label: () => d("p", s.label)
219
219
  }
220
220
  )
221
221
  ),
222
- "menu-button": () => p(
223
- he,
222
+ "menu-button": () => d(
223
+ Ce,
224
224
  {
225
225
  variant: "tertiary",
226
226
  size: "md",
227
227
  icon: "more_vert",
228
- iconColor: Ue.NeutralGray400,
228
+ iconColor: Ke.NeutralGray400,
229
229
  disabled: !1
230
230
  },
231
231
  {}
@@ -243,17 +243,17 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
243
243
  var t;
244
244
  try {
245
245
  const r = o.id === ((t = B.value) == null ? void 0 : t.id);
246
- await d.updateDefaultReport(r ? null : o.id), i.open({
246
+ await f.updateDefaultReport(r ? null : o.id), c.open({
247
247
  message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
248
248
  type: "success"
249
249
  });
250
250
  } catch (r) {
251
- i.open({ message: JSON.stringify(r), type: "error" });
251
+ c.open({ message: JSON.stringify(r), type: "error" });
252
252
  }
253
253
  });
254
254
  }
255
- async function Se(o) {
256
- if (await oe({
255
+ async function ke(o) {
256
+ if (await ae({
257
257
  title: a("report.common.duplicate"),
258
258
  message: a("report.messages.confirmAction", {
259
259
  action: a("report.common.duplicate"),
@@ -263,86 +263,94 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
263
263
  const r = JSON.parse(JSON.stringify(o));
264
264
  r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, T(async () => {
265
265
  try {
266
- await d.createOrUpdateReport(r), i.open({
266
+ await f.createOrUpdateReport(r), c.open({
267
267
  message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
268
268
  type: "success"
269
269
  });
270
270
  } catch (l) {
271
- i.open({ message: JSON.stringify(l), type: "error" });
271
+ c.open({ message: JSON.stringify(l), type: "error" });
272
272
  }
273
273
  });
274
274
  }
275
275
  }
276
- async function ce(o) {
277
- if (!ne(o)) {
278
- i.open({
276
+ function j(o) {
277
+ const t = p.value.find((r) => r.id === o.reportId);
278
+ return !t || !se(t);
279
+ }
280
+ function G(o) {
281
+ const t = p.value.find((r) => r.id === o.reportId);
282
+ return !o.editable || !t || !U(t);
283
+ }
284
+ async function ue(o) {
285
+ if (!U(o)) {
286
+ c.open({
279
287
  message: a("report.messages.noPermissionDeleteReport"),
280
288
  type: "error"
281
289
  });
282
290
  return;
283
291
  }
284
- await oe({
292
+ await ae({
285
293
  title: a("report.messages.deleteReport"),
286
294
  message: a("report.messages.confirmDelete", { name: o.name })
287
295
  }) && T(async () => {
288
296
  try {
289
- await d.removeReport(o), i.open({
297
+ await f.removeReport(o), c.open({
290
298
  message: a("report.messages.deleteSuccess", { name: o.name }),
291
299
  type: "success"
292
300
  });
293
301
  } catch (r) {
294
- i.open({ message: JSON.stringify(r), type: "error" });
302
+ c.open({ message: JSON.stringify(r), type: "error" });
295
303
  }
296
304
  });
297
305
  }
298
- async function ue(o) {
299
- if (te.value)
300
- await Se(o);
306
+ async function me(o) {
307
+ if (oe.value)
308
+ await ke(o);
301
309
  else {
302
- let t = `Your current plan only support up to ${I.value} custom reports.`;
303
- I.value === 0 && (t = "Your current plan does not support custom report."), i.open({
310
+ let t = `Your current plan only support up to ${F.value} custom reports.`;
311
+ F.value === 0 && (t = "Your current plan does not support custom report."), c.open({
304
312
  message: t,
305
313
  type: "error"
306
314
  });
307
315
  }
308
316
  }
309
- function ke() {
310
- if (!we.value) {
311
- i.open({
317
+ function De() {
318
+ if (!he.value) {
319
+ c.open({
312
320
  message: a("report.messages.noPermission"),
313
321
  type: "error"
314
322
  });
315
323
  return;
316
324
  }
317
- if (te.value)
318
- ye.value = !0;
325
+ if (oe.value)
326
+ Re.value = !0;
319
327
  else {
320
- let o = `Your current plan only support up to ${I.value} custom reports.`;
321
- I.value === 0 && (o = "Your current plan does not support custom report."), i.open({
328
+ let o = `Your current plan only support up to ${F.value} custom reports.`;
329
+ F.value === 0 && (o = "Your current plan does not support custom report."), c.open({
322
330
  message: o,
323
331
  type: "error"
324
332
  });
325
333
  }
326
334
  }
327
- function me(o) {
328
- const t = W(a, z, o.name, "other") ?? "";
329
- D.value && D.value.includes(o.id) ? (i.open({
335
+ function pe(o) {
336
+ const t = X(a, z, o.name, "other") ?? "";
337
+ I.value && I.value.includes(o.id) ? (c.open({
330
338
  message: `${a("report.common.unpin")} ${t} ${a("report.common.successful")}`,
331
339
  type: "success"
332
- }), d.clearPinReport(o.id)) : (i.open({
340
+ }), f.clearPinReport(o.id)) : (c.open({
333
341
  message: `${a("report.common.pin")} ${t} ${a("report.common.successful")}`,
334
342
  type: "success"
335
- }), d.cachePinReport(o));
343
+ }), f.cachePinReport(o));
336
344
  }
337
- function xe(o) {
338
- F.value = o;
345
+ function _e(o) {
346
+ O.value = o;
339
347
  }
340
- const { selectedLocationIds: x, dateRange: O, compareDateRange: L, timeRange: v, locations: _e } = fe(), P = w(() => x.length === _e.length);
348
+ const { selectedLocationIds: k, dateRange: P, compareDateRange: L, timeRange: v, locations: $e } = ge(), N = h(() => k.length === $e.length);
341
349
  return (o, t) => {
342
- const r = S("FmPageHead"), l = S("FmSearch"), q = S("FmForm"), N = S("FmListItem"), _ = S("FmList"), V = S("FmTable");
343
- return A(), G(Ve, null, {
350
+ const r = x("FmPageHead"), l = x("FmSearch"), H = x("FmForm"), V = x("FmListItem"), D = x("FmList"), A = x("FmTable");
351
+ return J(), W(Je, null, {
344
352
  default: m(() => [
345
- c(r, {
353
+ i(r, {
346
354
  title: e(a)("report.common.report", 1),
347
355
  class: "h-[68px]",
348
356
  actions: [
@@ -353,208 +361,218 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
353
361
  prependIcon: "add"
354
362
  }
355
363
  ],
356
- "onClick:action": t[0] || (t[0] = (n) => ke())
364
+ "onClick:action": t[0] || (t[0] = (n) => De())
357
365
  }, null, 8, ["title", "actions"]),
358
- h("div", {
359
- class: k(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
360
- style: Ie({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
366
+ g("div", {
367
+ class: y(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
368
+ style: Oe({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
361
369
  }, [
362
- c(q, {
363
- class: k(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
370
+ i(H, {
371
+ class: y(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
364
372
  }, {
365
373
  default: m(() => [
366
- c(e(E), null, {
374
+ i(e(K), null, {
367
375
  "menu-button": m(() => [
368
- c(e(M), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
376
+ i(e(Y), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
369
377
  default: m(() => [
370
- h("p", null, J(e(a)(`report.category.${F.value.label}`)), 1),
371
- c(e(K), { name: "expand_more" })
378
+ g("p", null, _(e(a)(`report.category.${O.value.label}`)), 1),
379
+ i(e(M), { name: "expand_more" })
372
380
  ]),
373
381
  _: 1
374
382
  })
375
383
  ]),
376
384
  default: m(() => [
377
- (A(!0), Fe(Oe, null, Le(le.value, (n, y) => (A(), G(e(C), {
378
- key: y,
385
+ (J(!0), Pe(Le, null, Ne(ce.value, (n, w) => (J(), W(e(C), {
386
+ key: w,
379
387
  label: e(a)(`report.category.${n.label}`),
380
- onClick: () => xe(n)
388
+ onClick: () => _e(n)
381
389
  }, null, 8, ["label", "onClick"]))), 128))
382
390
  ]),
383
391
  _: 1
384
392
  }),
385
- h("div", {
386
- class: k(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
393
+ g("div", {
394
+ class: y(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
387
395
  }, [
388
- h("p", He, J(e(a)("report.common.results", { count: R.value.length })), 1)
396
+ g("p", We, _(e(a)("report.common.results", { count: S.value.length })), 1)
389
397
  ], 2),
390
- t[3] || (t[3] = h("div", { class: "grow" }, null, -1)),
391
- h("div", Qe, [
392
- c(l, {
393
- modelValue: Y.value,
394
- "onUpdate:modelValue": t[1] || (t[1] = (n) => Y.value = n),
395
- class: k(`${e(u).lg || e(u).md ? "grow" : ""}`)
398
+ t[3] || (t[3] = g("div", { class: "grow" }, null, -1)),
399
+ g("div", Xe, [
400
+ i(l, {
401
+ modelValue: q.value,
402
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => q.value = n),
403
+ class: y(`${e(u).lg || e(u).md ? "grow" : ""}`)
396
404
  }, null, 8, ["modelValue", "class"])
397
405
  ])
398
406
  ]),
399
407
  _: 1
400
408
  }, 8, ["class"]),
401
- H((A(), G(V, {
402
- key: Ce.value,
409
+ fe((J(), W(A, {
410
+ key: Se.value,
403
411
  ref_key: "table",
404
- ref: g,
405
- class: k([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
412
+ ref: b,
413
+ class: y([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
406
414
  style: { height: "calc(100% - 40px)" },
407
- "column-defs": Re.value,
408
- "row-data": R.value,
409
- "page-size": R.value.length,
415
+ "column-defs": xe.value,
416
+ "row-data": S.value,
417
+ "page-size": S.value.length,
410
418
  "hide-footer": !0,
411
419
  "row-class-name": "row",
412
420
  onRowClick: t[2] || (t[2] = (n) => {
413
421
  if (!n.original.canRead) {
414
- e(i).open({
422
+ e(c).open({
415
423
  message: e(a)("report.messages.noPermission"),
416
424
  type: "error"
417
425
  });
418
426
  return;
419
427
  }
420
- e(ve).suppressReportRouteSync = !0, e(d).updateCurrentReportId(n.original.reportId), e(X).push({
428
+ e(be).suppressReportRouteSync = !0, e(f).updateCurrentReportId(n.original.reportId), e(Z).push({
421
429
  name: "reportView",
422
430
  query: {
423
- ...e(Z).query,
431
+ ...e(ee).query,
424
432
  reportId: n.original.reportId,
425
- startDate: e(O).startDate,
426
- endDate: e(O).endDate,
433
+ startDate: e(P).startDate,
434
+ endDate: e(P).endDate,
427
435
  compareStartDate: e(L).startDate,
428
436
  compareEndDate: e(L).endDate,
429
437
  timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
430
438
  timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
431
- isAllLocation: P.value.toString(),
432
- locationIds: P.value ? void 0 : e(x) ? JSON.stringify(e(x)) : void 0
439
+ isAllLocation: N.value.toString(),
440
+ locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
433
441
  }
434
442
  });
435
443
  })
436
444
  }, {
437
445
  "list-row": m(({ original: n }) => [
438
- c(_, {
446
+ i(D, {
439
447
  onClick: () => {
440
448
  if (!n.canRead) {
441
- e(i).open({
449
+ e(c).open({
442
450
  message: e(a)("report.messages.noPermission"),
443
451
  type: "error"
444
452
  });
445
453
  return;
446
454
  }
447
- n.reportId && (e(d).updateCurrentReportId(n.reportId), e(X).push({
455
+ n.reportId && (e(f).updateCurrentReportId(n.reportId), e(Z).push({
448
456
  name: "reportView",
449
457
  query: {
450
- ...e(Z).query,
458
+ ...e(ee).query,
451
459
  reportId: n.reportId,
452
- startDate: e(O).startDate,
453
- endDate: e(O).endDate,
460
+ startDate: e(P).startDate,
461
+ endDate: e(P).endDate,
454
462
  compareStartDate: e(L).startDate,
455
463
  compareEndDate: e(L).endDate,
456
464
  timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
457
465
  timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
458
- isAllLocation: P.value.toString(),
459
- locationIds: P.value ? void 0 : e(x) ? JSON.stringify(e(x)) : void 0
466
+ isAllLocation: N.value.toString(),
467
+ locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
460
468
  }
461
469
  }));
462
470
  }
463
471
  }, {
464
472
  default: m(() => [
465
- c(N, {
473
+ i(V, {
466
474
  tag: "label",
467
- label: n.name,
468
475
  clickable: ""
469
476
  }, {
470
477
  append: m(() => [
471
- c(e(M), {
472
- class: k(
473
- n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
474
- ),
478
+ i(e(Y), {
479
+ class: y(`${n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${n.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
475
480
  compact: !0
476
481
  }, {
477
482
  default: m(() => [
478
- h("p", We, J(n.category), 1)
483
+ g("p", Ze, _(n.category), 1)
479
484
  ]),
480
485
  _: 2
481
486
  }, 1032, ["class"]),
482
- c(e(E), {
487
+ i(e(K), {
483
488
  placement: "left",
484
489
  "stop-click-propagation": !0
485
490
  }, {
486
491
  "menu-button": m(() => [
487
- c(e(K), {
492
+ i(e(M), {
488
493
  name: "more_vert",
489
494
  class: "btn-color"
490
495
  })
491
496
  ]),
492
497
  default: m(() => {
493
- var y;
498
+ var w;
494
499
  return [
495
- c(e(C), {
500
+ i(e(C), {
496
501
  label: n.pin ? "Unpin" : "Pin",
497
502
  onClick: () => {
498
- const s = e(f).find(
499
- (b) => b.id === n.reportId
503
+ const s = e(p).find(
504
+ (R) => R.id === n.reportId
500
505
  );
501
- s && me(s);
506
+ s && pe(s);
502
507
  }
503
508
  }, null, 8, ["label", "onClick"]),
504
- c(e(C), {
509
+ i(e(C), {
505
510
  label: e(a)("report.common.duplicate"),
511
+ disabled: j(n),
512
+ class: y(
513
+ j(n) ? "text-fm-color-typo-disabled" : ""
514
+ ),
506
515
  onClick: () => {
507
- const s = e(f).find(
508
- (b) => b.id === n.reportId
516
+ const s = e(p).find(
517
+ (R) => R.id === n.reportId
509
518
  );
510
- s && ue(s);
519
+ s && !j(n) ? me(s) : e(c).open({
520
+ message: e(a)("report.messages.noPermissionDuplicateReport"),
521
+ type: "error"
522
+ });
511
523
  }
512
- }, null, 8, ["label", "onClick"]),
513
- c(e(C), {
524
+ }, null, 8, ["label", "disabled", "class", "onClick"]),
525
+ i(e(C), {
514
526
  label: e(a)(
515
- n.reportId === ((y = e(B)) == null ? void 0 : y.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
527
+ n.reportId === ((w = e(B)) == null ? void 0 : w.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
516
528
  ),
517
529
  onClick: () => {
518
- const s = e(f).find(
519
- (b) => b.id === n.reportId
530
+ const s = e(p).find(
531
+ (R) => R.id === n.reportId
520
532
  );
521
533
  s && ie(s);
522
534
  }
523
535
  }, null, 8, ["label", "onClick"]),
524
- H(c(e(C), {
536
+ i(e(C), {
525
537
  label: e(a)("report.common.delete"),
526
- class: "text-fm-color-typo-error",
538
+ disabled: G(n),
539
+ class: y(
540
+ G(n) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
541
+ ),
527
542
  onClick: () => {
528
- const s = e(f).find(
529
- (b) => b.id === n.reportId
543
+ const s = e(p).find(
544
+ (R) => R.id === n.reportId
530
545
  );
531
- s && ce(s);
546
+ s && !G(n) && ue(s);
532
547
  }
533
548
  }, {
534
549
  label: m(() => [
535
- Pe(J(e(a)("report.common.delete")), 1)
550
+ Ve(_(e(a)("report.common.delete")), 1)
536
551
  ]),
537
552
  _: 2
538
- }, 1032, ["label", "onClick"]), [
539
- [Q, n.editable]
540
- ])
553
+ }, 1032, ["label", "disabled", "class", "onClick"])
541
554
  ];
542
555
  }),
543
556
  _: 2
544
557
  }, 1024)
545
558
  ]),
559
+ default: m(() => [
560
+ g("span", {
561
+ class: y(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", n.canRead ? "" : "opacity-40 cursor-not-allowed"])
562
+ }, _(n.name), 3)
563
+ ]),
546
564
  _: 2
547
- }, 1032, ["label"])
565
+ }, 1024)
548
566
  ]),
549
567
  _: 2
550
568
  }, 1032, ["onClick"])
551
569
  ]),
552
570
  _: 1
553
571
  }, 8, ["class", "column-defs", "row-data", "page-size"])), [
554
- [Q, R.value.length > 0]
572
+ [ye, S.value.length > 0]
555
573
  ]),
556
- H(c(Ee, null, null, 512), [
557
- [Q, R.value.length === 0]
574
+ fe(i(Me, null, null, 512), [
575
+ [ye, S.value.length === 0]
558
576
  ])
559
577
  ], 6)
560
578
  ]),
@@ -564,5 +582,5 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
564
582
  }
565
583
  });
566
584
  export {
567
- mt as default
585
+ dt as default
568
586
  };