@feedmepos/mf-report 5.28.5-beta.0 → 5.28.5

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 (30) hide show
  1. package/dist/{App-DGKt1n7o.js → App-Bc8Mp5vR.js} +37 -37
  2. package/dist/{DateRangeSelect-Y_Nn-osm.js → DateRangeSelect-cbSEHMzW.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-BlXGP4t_.js → Default.vue_vue_type_script_setup_true_lang-BpJFA_ET.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CEjHfVNa.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Dx-cxJP6.js} +5 -5
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DAZLziOO.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Cxrti7_L.js} +19 -16
  6. package/dist/{InsightView-BriTcgPJ.js → InsightView-Bo0Fb5QG.js} +5 -5
  7. package/dist/{Integration-D5ms6fn1.js → Integration-B4tC2MlL.js} +3 -3
  8. package/dist/{Integrations-DQvYF26T.js → Integrations-RB8iuvdJ.js} +2 -2
  9. package/dist/{Layout-BBLVmRJi.js → Layout-DBCPtUH7.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-S5P6mT78.js → LocationSelect.vue_vue_type_script_setup_true_lang-w2H9qOgJ.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DvwbNmby.js → MenuTab.vue_vue_type_script_setup_true_lang-BLVGUSWf.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-BvYT2Izx.js → NavigationTab.vue_vue_type_script_setup_true_lang-N31ee-oZ.js} +5 -5
  13. package/dist/{OverviewView-CCboDE2n.js → OverviewView-WKe6Zxe1.js} +4 -4
  14. package/dist/{Report-DeLOcjgU.js → Report-Di6GyP1r.js} +246 -244
  15. package/dist/{ReportCanvasView-DGwF-pyG.js → ReportCanvasView-Dg2ItHBO.js} +3 -3
  16. package/dist/{ReportEditor-ZoXssGrp.js → ReportEditor-BfNmiEVn.js} +7 -7
  17. package/dist/{ReportView-CPmqBn6n.js → ReportView-JWJ-6FCu.js} +6 -6
  18. package/dist/{ReportViewRoute-Ddd_509O.js → ReportViewRoute-BMjjJqN2.js} +2 -2
  19. package/dist/{Setting-DSnAtGwo.js → Setting-D13NIemB.js} +3 -3
  20. package/dist/{Template-iqP8PeTT.js → Template-D16bqzrx.js} +3 -3
  21. package/dist/{TileEditor-Dyk5r6FN.js → TileEditor-1Sn9ZSb2.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-CLBcYijT.js → TilePageStack.vue_vue_type_script_setup_true_lang-BOXsV7-r.js} +2 -2
  23. package/dist/{TransitionFade-DUNn6p37.js → TransitionFade-DwJkmMTb.js} +5 -5
  24. package/dist/{app-D_8mXWLj.js → app-CVBllEjW.js} +17 -13
  25. package/dist/app.js +1 -1
  26. package/dist/assets/{formatChartData.worker-DYtOUTAT.js → formatChartData.worker-DZp5dSDQ.js} +45 -41
  27. package/dist/assets/{processTableData.worker-XtLK-E3T.js → processTableData.worker-Kyuhw4lS.js} +45 -41
  28. package/dist/{report-C_upEzzb.js → report-Cn4Ik1zm.js} +1 -1
  29. package/dist/{useRestaurantPermission-Qu5NXD3o.js → useRestaurantPermission-C8bLPfk8.js} +1 -1
  30. package/package.json +1 -1
@@ -1,49 +1,49 @@
1
- import { defineComponent as Te, ref as $, watch as Se, computed as R, h as u, withModifiers as Ae, resolveComponent as I, createBlock as ae, openBlock as J, withCtx as f, createVNode as i, createElementVNode as v, unref as t, normalizeStyle as ze, normalizeClass as b, withDirectives as we, createElementBlock as Je, Fragment as Be, renderList as Ke, toDisplayString as k, createTextVNode as Ee, vShow as he } from "vue";
2
- import { storeToRefs as Re } from "pinia";
3
- import { u as je, s as Ye } from "./report-C_upEzzb.js";
4
- import { _ as qe } from "./Default.vue_vue_type_script_setup_true_lang-BlXGP4t_.js";
5
- import { u as He } from "./message-dialog-UoMWOnil.js";
6
- import { u as Ge } from "./global-loader-BuxFfehu.js";
7
- import { useSnackbar as Qe, useBreakpoints as We, components as Xe, FmButtonColorThemeVariant as Ze } from "@feedmepos/ui-library";
8
- import { _ as et } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
- import { c as tt, a as Pe, h as ot } from "./app-D_8mXWLj.js";
10
- import { useRouter as at, useRoute as st, onBeforeRouteLeave as rt } from "vue-router";
11
- import { useI18n as nt } from "@feedmepos/mf-common";
12
- import { r as se } from "./i18n-DbyciK4x.js";
13
- const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it = { class: "w-[343px]" }, ct = { class: "fm-typo-en-body-md-600" }, pt = ["tabindex", "aria-disabled", "onClick"], dt = { class: "fm-typo-en-body-md-400 max-w-[240px]" }, Ct = /* @__PURE__ */ Te({
1
+ import { defineComponent as Ae, ref as $, watch as we, computed as h, h as d, withModifiers as ze, resolveComponent as I, createBlock as se, openBlock as B, withCtx as m, createVNode as c, createElementVNode as v, unref as t, normalizeStyle as Je, normalizeClass as g, withDirectives as Re, createElementBlock as Be, Fragment as Ke, renderList as Ee, toDisplayString as k, createTextVNode as je, vShow as he } from "vue";
2
+ import { storeToRefs as Pe } from "pinia";
3
+ import { u as He, s as Ye } from "./report-Cn4Ik1zm.js";
4
+ import { _ as qe } from "./Default.vue_vue_type_script_setup_true_lang-BpJFA_ET.js";
5
+ import { u as Ge } from "./message-dialog-UoMWOnil.js";
6
+ import { u as Qe } from "./global-loader-BuxFfehu.js";
7
+ import { useSnackbar as We, useBreakpoints as Xe, components as Ze, FmButtonColorThemeVariant as et } from "@feedmepos/ui-library";
8
+ import { _ as tt } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
+ import { c as ot, a as xe, h as at } from "./app-CVBllEjW.js";
10
+ import { useRouter as st, useRoute as rt, onBeforeRouteLeave as nt } from "vue-router";
11
+ import { useI18n as lt } from "@feedmepos/mf-common";
12
+ import { r as re } from "./i18n-DbyciK4x.js";
13
+ const ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it = { class: "w-[343px]" }, pt = { class: "fm-typo-en-body-md-600" }, dt = ["tabindex", "aria-disabled", "onClick"], ut = { class: "fm-typo-en-body-md-400 max-w-[240px]" }, It = /* @__PURE__ */ Ae({
14
14
  __name: "Report",
15
- setup(ut) {
16
- const { t: a, te: B } = nt(), re = at(), ne = st(), S = je(), xe = tt(), { business: Ce } = Re(Pe()), {
17
- reports: y,
18
- overviewReport: K,
15
+ setup(mt) {
16
+ const { t: a, te: K } = lt(), ne = st(), le = rt(), S = He(), Ce = ot(), { business: Ie } = Pe(xe()), {
17
+ reports: f,
18
+ overviewReport: E,
19
19
  categories: O,
20
20
  pinReport: F,
21
- isOpenAddReportDialog: Ie,
22
- scrollPositionY: le,
23
- customReportQuota: L,
21
+ isOpenAddReportDialog: ke,
22
+ scrollPositionY: ce,
23
+ customReportQuota: T,
24
24
  canCreateCustomReport: ie
25
- } = Re(S), { promptMessage: ce } = He(), { promptLoader: E } = Ge(), l = Qe(), { breakpoints: d } = We(), { canRead: pe, canUpdate: j, canDuplicate: de, canDelete: Y, canCreateReport: ke } = ot(), h = $();
26
- rt(() => {
27
- h.value && (le.value = h.value.$el.children[0].scrollTop);
28
- }), Se(h, () => {
29
- h.value && setTimeout(() => {
30
- h.value && (h.value.$el.children[0].scrollTop = le.value);
25
+ } = Pe(S), { promptMessage: pe } = Ge(), { promptLoader: j } = Qe(), l = We(), { breakpoints: p } = Xe(), { canRead: de, canUpdate: H, canDuplicate: ue, canDelete: Y, canCreateReport: _e } = at(), R = $();
26
+ nt(() => {
27
+ R.value && (ce.value = R.value.$el.children[0].scrollTop);
28
+ }), we(R, () => {
29
+ R.value && setTimeout(() => {
30
+ R.value && (R.value.$el.children[0].scrollTop = ce.value);
31
31
  }, 200);
32
32
  });
33
- const q = R(() => F.value && y.value ? y.value.filter((o) => {
33
+ const q = h(() => F.value && f.value ? f.value.filter((o) => {
34
34
  var e;
35
35
  return (e = F.value) == null ? void 0 : e.includes(o.id);
36
36
  }) : []);
37
- Se(
38
- [() => Ce.value],
37
+ we(
38
+ [() => Ie.value],
39
39
  () => {
40
40
  S.refreshPinReport();
41
41
  },
42
42
  { immediate: !0 }
43
43
  );
44
- const ue = R(() => q.value.length > 0 ? y.value.filter(
44
+ const me = h(() => q.value.length > 0 ? f.value.filter(
45
45
  (o) => q.value.findIndex((e) => e.id === o.id) === -1
46
- ) : y.value), { FmButton: _e, FmMenu: H, FmMenuItem: P, FmIcon: G, FmChip: Q, FmTooltip: De, FmSwitch: me } = Xe, g = $(/* @__PURE__ */ new Set()), W = $(/* @__PURE__ */ new Map()), $e = /* @__PURE__ */ new Set([
46
+ ) : f.value), { FmButton: De, FmMenu: G, FmMenuItem: P, FmIcon: Q, FmChip: W, FmTooltip: $e, FmSwitch: fe } = Ze, b = $(/* @__PURE__ */ new Set()), X = $(/* @__PURE__ */ new Map()), Oe = /* @__PURE__ */ new Set([
47
47
  "closeup",
48
48
  "dailySales",
49
49
  "hourlySales",
@@ -59,61 +59,61 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
59
59
  "timesheet",
60
60
  "void_",
61
61
  "refund"
62
- ]), fe = R(() => [
62
+ ]), ye = h(() => [
63
63
  { value: void 0, label: "All" },
64
64
  ...O.value.map((o) => ({
65
65
  value: o.id,
66
66
  label: o.name
67
67
  }))
68
- ]), M = $(fe.value[0]), X = $("");
69
- function Z(o) {
70
- return o.isDefault && $e.has(o.permissionKey ?? "");
68
+ ]), L = $(ye.value[0]), Z = $("");
69
+ function ee(o) {
70
+ return o.isDefault && Oe.has(o.permissionKey ?? "");
71
71
  }
72
- const x = R(() => ue.value.length === 0 || O.value.length === 0 ? [] : [
72
+ const x = h(() => me.value.length === 0 || O.value.length === 0 ? [] : [
73
73
  ...q.value.map((e) => {
74
74
  const r = O.value.find((n) => n.id === e.category);
75
75
  return {
76
- name: se(a, B, e.name, "other"),
76
+ name: re(a, K, e.name, "other"),
77
77
  categoryId: (r == null ? void 0 : r.id) ?? "",
78
78
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
79
79
  reportId: e.id,
80
80
  editable: e.editable,
81
81
  description: e.description || "",
82
82
  pin: !0,
83
- canUpdate: j(e),
84
- canRead: pe(e),
85
- isSupportPos: !!e.isSupportPos,
86
- isMandatoryPosReport: Z(e),
83
+ canUpdate: H(e),
84
+ canRead: de(e),
85
+ isSupportPos: e.reportType === "canvas" ? !1 : !!e.isSupportPos,
86
+ isMandatoryPosReport: ee(e),
87
87
  reportType: e.reportType
88
88
  };
89
89
  }),
90
- ...ue.value.map((e) => {
90
+ ...me.value.map((e) => {
91
91
  const r = O.value.find((n) => n.id === e.category);
92
92
  return {
93
- name: se(a, B, e.name, "other"),
93
+ name: re(a, K, e.name, "other"),
94
94
  categoryId: (r == null ? void 0 : r.id) ?? "",
95
95
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
96
96
  reportId: e.id,
97
97
  editable: e.editable,
98
98
  description: e.description || "",
99
99
  pin: !1,
100
- canUpdate: j(e),
101
- canRead: pe(e),
102
- isSupportPos: !!e.isSupportPos,
103
- isMandatoryPosReport: Z(e),
100
+ canUpdate: H(e),
101
+ canRead: de(e),
102
+ isSupportPos: e.reportType === "canvas" ? !1 : !!e.isSupportPos,
103
+ isMandatoryPosReport: ee(e),
104
104
  reportType: e.reportType
105
105
  };
106
106
  })
107
- ].filter((e) => M.value.value && e.categoryId !== M.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(X.value.toLowerCase()) !== -1)), Oe = R(
107
+ ].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(Z.value.toLowerCase()) !== -1)), Fe = h(
108
108
  () => x.value.map((o) => `${o.name}${o.category}`).toString()
109
- ), Fe = R(() => [
109
+ ), Te = h(() => [
110
110
  {
111
111
  accessorKey: "name",
112
112
  header: a("report.common.name"),
113
113
  enableSorting: !1,
114
114
  cell: (o) => {
115
115
  const e = o.row.original;
116
- return u(
116
+ return d(
117
117
  "span",
118
118
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
119
119
  o.getValue()
@@ -127,8 +127,8 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
127
127
  meta: {
128
128
  width: "100px"
129
129
  },
130
- cell: (o) => u(
131
- Q,
130
+ cell: (o) => d(
131
+ W,
132
132
  {
133
133
  // grey out chip text when user cannot read report
134
134
  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`,
@@ -143,7 +143,7 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
143
143
  enableSorting: !1,
144
144
  cell: (o) => {
145
145
  const e = o.row.original;
146
- return u(
146
+ return d(
147
147
  "span",
148
148
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
149
149
  o.getValue()
@@ -158,8 +158,8 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
158
158
  width: "130px"
159
159
  },
160
160
  cell: (o) => {
161
- var m;
162
- const e = o.row.original, r = e.reportId, n = y.value.find((p) => p.id === r), oe = r === ((m = K.value) == null ? void 0 : m.id), A = !e.canRead, D = n ? de(n) : !1, z = n ? Y(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || g.value.has(r), C = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), c = [
161
+ var J;
162
+ const e = o.row.original, r = e.reportId, n = f.value.find((u) => u.id === r), ae = r === ((J = E.value) == null ? void 0 : J.id), A = !e.canRead, D = n ? ue(n) : !1, z = n ? Y(n) : !1, s = e.reportType === "canvas", C = !e.canUpdate || e.isMandatoryPosReport || s || b.value.has(r), i = s ? a("reportV5.reportList.canvasPosReportHint") : e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), y = [
163
163
  {
164
164
  label: a("report.common.duplicate"),
165
165
  onClick: () => {
@@ -172,9 +172,9 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
172
172
  disabled: !D
173
173
  },
174
174
  {
175
- label: a(oe ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
175
+ label: a(ae ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
176
176
  onClick: async () => {
177
- n && ye(n);
177
+ n && ve(n);
178
178
  },
179
179
  variant: "",
180
180
  disabled: !1
@@ -182,7 +182,7 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
182
182
  {
183
183
  label: a("report.common.remove"),
184
184
  onClick: () => {
185
- n && (z ? ve(n) : l.open({
185
+ n && (z ? be(n) : l.open({
186
186
  message: a("report.messages.noPermissionDeleteReport"),
187
187
  type: "error"
188
188
  }));
@@ -191,59 +191,59 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
191
191
  disabled: !e.editable || !z
192
192
  }
193
193
  ];
194
- return u(
194
+ return d(
195
195
  "div",
196
196
  {
197
- class: `flex ${d.value.lg || d.value.md ? "justify-end" : ""} items-center`
197
+ class: `flex ${p.value.lg || p.value.md ? "justify-end" : ""} items-center`
198
198
  },
199
199
  {
200
200
  default: () => [
201
- u(
202
- De,
203
- { content: C, placement: "bottom", zIndex: 2e3 },
201
+ d(
202
+ $e,
203
+ { content: i, placement: "bottom", zIndex: 2e3 },
204
204
  {
205
- default: () => u(
205
+ default: () => d(
206
206
  "div",
207
207
  {
208
208
  class: "pos-v8-control mr-2 flex items-center",
209
209
  "data-testid": "desktop-pos-v8-toggle",
210
- onClick: (p) => {
211
- e.isMandatoryPosReport && (p.stopPropagation(), n && V(n));
210
+ onClick: (u) => {
211
+ e.isMandatoryPosReport && (u.stopPropagation(), n && V(n));
212
212
  }
213
213
  },
214
214
  [
215
- u("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
216
- u(me, {
215
+ d("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
216
+ d(fe, {
217
217
  modelValue: e.isSupportPos,
218
- disabled: s,
218
+ disabled: C,
219
219
  "aria-label": a("report.common.showInPOS"),
220
220
  class: "pos-v8-switch",
221
221
  "onUpdate:modelValue": () => {
222
222
  n && V(n);
223
223
  },
224
- onClick: (p) => {
225
- p.stopPropagation(), e.isMandatoryPosReport && n && V(n);
224
+ onClick: (u) => {
225
+ u.stopPropagation(), e.isMandatoryPosReport && n && V(n);
226
226
  }
227
227
  })
228
228
  ]
229
229
  )
230
230
  }
231
231
  ),
232
- u(
232
+ d(
233
233
  "button",
234
234
  {
235
235
  disabled: A,
236
236
  title: A ? a("report.messages.noPermission") : void 0,
237
237
  "aria-label": e.pin ? "Unpin" : "Pin",
238
- onClick: Ae(() => {
239
- n && be(n);
238
+ onClick: ze(() => {
239
+ n && Se(n);
240
240
  }, ["stop"]),
241
241
  class: "text-fm-color-neutral-gray-400 hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center"
242
242
  },
243
243
  {
244
244
  default: () => [
245
- u(
246
- G,
245
+ d(
246
+ Q,
247
247
  {
248
248
  name: "keep",
249
249
  class: "px-12 p-8",
@@ -255,35 +255,35 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
255
255
  ]
256
256
  }
257
257
  ),
258
- u(
259
- H,
258
+ d(
259
+ G,
260
260
  {
261
261
  stopClickPropagation: !0,
262
262
  shift: !0,
263
263
  disabled: !1
264
264
  },
265
265
  {
266
- default: () => c.map(
267
- (p) => u(
266
+ default: () => y.map(
267
+ (u) => d(
268
268
  P,
269
269
  {
270
- onClick: p.disabled ? {} : p.onClick,
271
- label: p.label,
272
- class: p.disabled ? "text-fm-color-typo-disabled" : p.variant === "destructive" ? "text-fm-color-typo-error" : "",
273
- disabled: p.disabled
270
+ onClick: u.disabled ? {} : u.onClick,
271
+ label: u.label,
272
+ class: u.disabled ? "text-fm-color-typo-disabled" : u.variant === "destructive" ? "text-fm-color-typo-error" : "",
273
+ disabled: u.disabled
274
274
  },
275
275
  {
276
- label: () => u("p", p.label)
276
+ label: () => d("p", u.label)
277
277
  }
278
278
  )
279
279
  ),
280
- "menu-button": () => u(
281
- _e,
280
+ "menu-button": () => d(
281
+ De,
282
282
  {
283
283
  variant: "tertiary",
284
284
  size: "md",
285
285
  icon: "more_vert",
286
- iconColor: Ze.NeutralGray400,
286
+ iconColor: et.NeutralGray400,
287
287
  disabled: !1
288
288
  },
289
289
  {}
@@ -296,11 +296,11 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
296
296
  }
297
297
  }
298
298
  ]);
299
- async function ye(o) {
300
- await E(async () => {
299
+ async function ve(o) {
300
+ await j(async () => {
301
301
  var e;
302
302
  try {
303
- const r = o.id === ((e = K.value) == null ? void 0 : e.id);
303
+ const r = o.id === ((e = E.value) == null ? void 0 : e.id);
304
304
  await S.updateDefaultReport(r ? null : o.id), l.open({
305
305
  message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
306
306
  type: "success"
@@ -311,44 +311,46 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
311
311
  });
312
312
  }
313
313
  async function V(o) {
314
- if (Z(o)) {
315
- l.open({
316
- message: a("reportV5.reportList.cannotConfigureMandatoryReport"),
317
- type: "error"
318
- });
319
- return;
320
- }
321
- if (!j(o)) {
322
- l.open({
323
- message: a("report.messages.noPermissionUpdateReport"),
324
- type: "error"
325
- });
326
- return;
327
- }
328
- if (!g.value.has(o.id)) {
329
- g.value = new Set(g.value).add(o.id);
330
- try {
331
- const e = !o.isSupportPos;
332
- await Ye(o.id, e), o.isSupportPos = e, W.value = new Map(W.value).set(
333
- o.id,
334
- e
335
- );
336
- } catch (e) {
337
- console.log(e), l.open({
338
- message: a("report.messages.failedToAction", { action: a("report.common.update") }),
314
+ if (o.reportType !== "canvas") {
315
+ if (ee(o)) {
316
+ l.open({
317
+ message: a("reportV5.reportList.cannotConfigureMandatoryReport"),
339
318
  type: "error"
340
319
  });
341
- } finally {
342
- const e = new Set(g.value);
343
- e.delete(o.id), g.value = e;
320
+ return;
321
+ }
322
+ if (!H(o)) {
323
+ l.open({
324
+ message: a("report.messages.noPermissionUpdateReport"),
325
+ type: "error"
326
+ });
327
+ return;
328
+ }
329
+ if (!b.value.has(o.id)) {
330
+ b.value = new Set(b.value).add(o.id);
331
+ try {
332
+ const e = !o.isSupportPos;
333
+ await Ye(o.id, e), o.isSupportPos = e, X.value = new Map(X.value).set(
334
+ o.id,
335
+ e
336
+ );
337
+ } catch (e) {
338
+ console.log(e), l.open({
339
+ message: a("report.messages.failedToAction", { action: a("report.common.update") }),
340
+ type: "error"
341
+ });
342
+ } finally {
343
+ const e = new Set(b.value);
344
+ e.delete(o.id), b.value = e;
345
+ }
344
346
  }
345
347
  }
346
348
  }
347
349
  function Le(o, e) {
348
- return W.value.get(o) ?? e;
350
+ return X.value.get(o) ?? e;
349
351
  }
350
- async function Me(o) {
351
- if (await ce({
352
+ async function Ve(o) {
353
+ if (await pe({
352
354
  title: a("report.common.duplicate"),
353
355
  message: a("report.messages.confirmAction", {
354
356
  action: a("report.common.duplicate"),
@@ -356,7 +358,7 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
356
358
  })
357
359
  })) {
358
360
  const r = JSON.parse(JSON.stringify(o));
359
- r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, E(async () => {
361
+ r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, j(async () => {
360
362
  try {
361
363
  await S.createOrUpdateReport(r), l.open({
362
364
  message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
@@ -368,15 +370,15 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
368
370
  });
369
371
  }
370
372
  }
371
- function ee(o) {
372
- const e = y.value.find((r) => r.id === o.reportId);
373
- return !e || !de(e);
374
- }
375
373
  function te(o) {
376
- const e = y.value.find((r) => r.id === o.reportId);
374
+ const e = f.value.find((r) => r.id === o.reportId);
375
+ return !e || !ue(e);
376
+ }
377
+ function oe(o) {
378
+ const e = f.value.find((r) => r.id === o.reportId);
377
379
  return !o.editable || !e || !Y(e);
378
380
  }
379
- async function ve(o) {
381
+ async function be(o) {
380
382
  if (!Y(o)) {
381
383
  l.open({
382
384
  message: a("report.messages.noPermissionDeleteReport"),
@@ -384,10 +386,10 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
384
386
  });
385
387
  return;
386
388
  }
387
- await ce({
389
+ await pe({
388
390
  title: a("report.messages.deleteReport"),
389
391
  message: a("report.messages.confirmDelete", { name: o.name })
390
- }) && E(async () => {
392
+ }) && j(async () => {
391
393
  try {
392
394
  await S.removeReport(o), l.open({
393
395
  message: a("report.messages.deleteSuccess", { name: o.name }),
@@ -400,17 +402,17 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
400
402
  }
401
403
  async function ge(o) {
402
404
  if (ie.value)
403
- await Me(o);
405
+ await Ve(o);
404
406
  else {
405
- let e = `Your current plan only support up to ${L.value} custom reports.`;
406
- L.value === 0 && (e = "Your current plan does not support custom report."), l.open({
407
+ let e = `Your current plan only support up to ${T.value} custom reports.`;
408
+ T.value === 0 && (e = "Your current plan does not support custom report."), l.open({
407
409
  message: e,
408
410
  type: "error"
409
411
  });
410
412
  }
411
413
  }
412
- function Ve() {
413
- if (!ke.value) {
414
+ function Me() {
415
+ if (!_e.value) {
414
416
  l.open({
415
417
  message: a("report.messages.noPermission"),
416
418
  type: "error"
@@ -418,17 +420,17 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
418
420
  return;
419
421
  }
420
422
  if (ie.value)
421
- Ie.value = !0;
423
+ ke.value = !0;
422
424
  else {
423
- let o = `Your current plan only support up to ${L.value} custom reports.`;
424
- L.value === 0 && (o = "Your current plan does not support custom report."), l.open({
425
+ let o = `Your current plan only support up to ${T.value} custom reports.`;
426
+ T.value === 0 && (o = "Your current plan does not support custom report."), l.open({
425
427
  message: o,
426
428
  type: "error"
427
429
  });
428
430
  }
429
431
  }
430
- function be(o) {
431
- const e = se(a, B, o.name, "other") ?? "";
432
+ function Se(o) {
433
+ const e = re(a, K, o.name, "other") ?? "";
432
434
  F.value && F.value.includes(o.id) ? (l.open({
433
435
  message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
434
436
  type: "success"
@@ -438,14 +440,14 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
438
440
  }), S.cachePinReport(o));
439
441
  }
440
442
  function Ne(o) {
441
- M.value = o;
443
+ L.value = o;
442
444
  }
443
- const { selectedLocationIds: _, dateRange: N, compareDateRange: U, timeRange: w, locations: Ue } = Pe(), T = R(() => _.length === Ue.length);
445
+ const { selectedLocationIds: _, dateRange: M, compareDateRange: N, timeRange: w, locations: Ue } = xe(), U = h(() => _.length === Ue.length);
444
446
  return (o, e) => {
445
- const r = I("FmPageHead"), n = I("FmSearch"), oe = I("FmForm"), A = I("FmListItem"), D = I("FmList"), z = I("FmTable");
446
- return J(), ae(qe, null, {
447
- default: f(() => [
448
- i(r, {
447
+ const r = I("FmPageHead"), n = I("FmSearch"), ae = I("FmForm"), A = I("FmListItem"), D = I("FmList"), z = I("FmTable");
448
+ return B(), se(qe, null, {
449
+ default: m(() => [
450
+ c(r, {
449
451
  title: t(a)("report.common.report", 1),
450
452
  class: "h-[68px]",
451
453
  actions: [
@@ -456,28 +458,28 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
456
458
  prependIcon: "add"
457
459
  }
458
460
  ],
459
- "onClick:action": e[0] || (e[0] = (s) => Ve())
461
+ "onClick:action": e[0] || (e[0] = (s) => Me())
460
462
  }, null, 8, ["title", "actions"]),
461
463
  v("div", {
462
- class: b(`overflow-y-hidden flex flex-col gap-8 ${t(d).sm || t(d).xs ? "mb-20" : ""}`),
463
- style: ze({ height: `calc(100% - ${t(d).lg || t(d).md ? 72 : 64}px)` })
464
+ class: g(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
465
+ style: Je({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
464
466
  }, [
465
- i(oe, {
466
- class: b(`flex items-center gap-2 ${t(d).sm || t(d).xs ? "px-3" : "px-24"}`)
467
+ c(ae, {
468
+ class: g(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
467
469
  }, {
468
- default: f(() => [
469
- i(t(H), null, {
470
- "menu-button": f(() => [
471
- i(t(Q), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
472
- default: f(() => [
473
- v("p", null, k(t(a)(`report.category.${M.value.label}`)), 1),
474
- i(t(G), { name: "expand_more" })
470
+ default: m(() => [
471
+ c(t(G), null, {
472
+ "menu-button": m(() => [
473
+ c(t(W), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
474
+ default: m(() => [
475
+ v("p", null, k(t(a)(`report.category.${L.value.label}`)), 1),
476
+ c(t(Q), { name: "expand_more" })
475
477
  ]),
476
478
  _: 1
477
479
  })
478
480
  ]),
479
- default: f(() => [
480
- (J(!0), Je(Be, null, Ke(fe.value, (s, C) => (J(), ae(t(P), {
481
+ default: m(() => [
482
+ (B(!0), Be(Ke, null, Ee(ye.value, (s, C) => (B(), se(t(P), {
481
483
  key: C,
482
484
  label: t(a)(`report.category.${s.label}`),
483
485
  onClick: () => Ne(s)
@@ -486,28 +488,28 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
486
488
  _: 1
487
489
  }),
488
490
  v("div", {
489
- class: b(`flex ${t(d).sm || t(d).xs ? "justify-center items-center" : ""}`)
491
+ class: g(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
490
492
  }, [
491
- v("p", lt, k(t(a)("report.common.results", { count: x.value.length })), 1)
493
+ v("p", ct, k(t(a)("report.common.results", { count: x.value.length })), 1)
492
494
  ], 2),
493
495
  e[3] || (e[3] = v("div", { class: "grow" }, null, -1)),
494
496
  v("div", it, [
495
- i(n, {
496
- modelValue: X.value,
497
- "onUpdate:modelValue": e[1] || (e[1] = (s) => X.value = s),
498
- class: b(`${t(d).lg || t(d).md ? "grow" : ""}`)
497
+ c(n, {
498
+ modelValue: Z.value,
499
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => Z.value = s),
500
+ class: g(`${t(p).lg || t(p).md ? "grow" : ""}`)
499
501
  }, null, 8, ["modelValue", "class"])
500
502
  ])
501
503
  ]),
502
504
  _: 1
503
505
  }, 8, ["class"]),
504
- we((J(), ae(z, {
505
- key: Oe.value,
506
+ Re((B(), se(z, {
507
+ key: Fe.value,
506
508
  ref_key: "table",
507
- ref: h,
508
- class: b([t(d).sm || t(d).xs ? "px-0" : "px-24", "report-table"]),
509
+ ref: R,
510
+ class: g([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
509
511
  style: { height: "calc(100% - 40px)" },
510
- "column-defs": Fe.value,
512
+ "column-defs": Te.value,
511
513
  "row-data": x.value,
512
514
  "page-size": x.value.length,
513
515
  "hide-footer": !0,
@@ -520,25 +522,25 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
520
522
  });
521
523
  return;
522
524
  }
523
- t(xe).suppressReportRouteSync = !0, t(S).updateCurrentReportId(s.original.reportId), t(re).push({
525
+ t(Ce).suppressReportRouteSync = !0, t(S).updateCurrentReportId(s.original.reportId), t(ne).push({
524
526
  name: "reportView",
525
527
  query: {
526
- ...t(ne).query,
528
+ ...t(le).query,
527
529
  reportId: s.original.reportId,
528
- startDate: t(N).startDate,
529
- endDate: t(N).endDate,
530
- compareStartDate: t(U).startDate,
531
- compareEndDate: t(U).endDate,
530
+ startDate: t(M).startDate,
531
+ endDate: t(M).endDate,
532
+ compareStartDate: t(N).startDate,
533
+ compareEndDate: t(N).endDate,
532
534
  timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
533
535
  timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
534
- isAllLocation: T.value.toString(),
535
- locationIds: T.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
536
+ isAllLocation: U.value.toString(),
537
+ locationIds: U.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
536
538
  }
537
539
  });
538
540
  })
539
541
  }, {
540
- "list-row": f(({ original: s }) => [
541
- i(D, {
542
+ "list-row": m(({ original: s }) => [
543
+ c(D, {
542
544
  onClick: () => {
543
545
  if (!s.canRead) {
544
546
  t(l).open({
@@ -547,131 +549,131 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
547
549
  });
548
550
  return;
549
551
  }
550
- s.reportId && (t(S).updateCurrentReportId(s.reportId), t(re).push({
552
+ s.reportId && (t(S).updateCurrentReportId(s.reportId), t(ne).push({
551
553
  name: "reportView",
552
554
  query: {
553
- ...t(ne).query,
555
+ ...t(le).query,
554
556
  reportId: s.reportId,
555
- startDate: t(N).startDate,
556
- endDate: t(N).endDate,
557
- compareStartDate: t(U).startDate,
558
- compareEndDate: t(U).endDate,
557
+ startDate: t(M).startDate,
558
+ endDate: t(M).endDate,
559
+ compareStartDate: t(N).startDate,
560
+ compareEndDate: t(N).endDate,
559
561
  timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
560
562
  timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
561
- isAllLocation: T.value.toString(),
562
- locationIds: T.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
563
+ isAllLocation: U.value.toString(),
564
+ locationIds: U.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
563
565
  }
564
566
  }));
565
567
  }
566
568
  }, {
567
- default: f(() => [
568
- i(A, {
569
+ default: m(() => [
570
+ c(A, {
569
571
  tag: "label",
570
572
  clickable: ""
571
573
  }, {
572
- append: f(() => [
573
- i(t(Q), {
574
- class: b(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
574
+ append: m(() => [
575
+ c(t(W), {
576
+ class: g(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
575
577
  compact: !0
576
578
  }, {
577
- default: f(() => [
578
- v("p", ct, k(s.category), 1)
579
+ default: m(() => [
580
+ v("p", pt, k(s.category), 1)
579
581
  ]),
580
582
  _: 2
581
583
  }, 1032, ["class"]),
582
- i(t(H), {
584
+ c(t(G), {
583
585
  placement: "left",
584
586
  "stop-click-propagation": !0
585
587
  }, {
586
- "menu-button": f(() => [
587
- i(t(G), {
588
+ "menu-button": m(() => [
589
+ c(t(Q), {
588
590
  name: "more_vert",
589
591
  class: "btn-color"
590
592
  })
591
593
  ]),
592
- default: f(() => {
594
+ default: m(() => {
593
595
  var C;
594
596
  return [
595
- i(t(P), {
597
+ c(t(P), {
596
598
  label: s.pin ? "Unpin" : "Pin",
597
599
  onClick: () => {
598
- const c = t(y).find(
599
- (m) => m.id === s.reportId
600
+ const i = t(f).find(
601
+ (y) => y.id === s.reportId
600
602
  );
601
- c && be(c);
603
+ i && Se(i);
602
604
  }
603
605
  }, null, 8, ["label", "onClick"]),
604
606
  v("div", {
605
607
  role: "menuitem",
606
608
  "data-testid": "mobile-pos-v8-toggle",
607
- tabindex: !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId) ? void 0 : -1,
608
- "aria-disabled": !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId),
609
- class: b(
610
- !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId) ? "flex max-h-[78px] w-full cursor-not-allowed items-center justify-between gap-2 rounded px-3 py-2 pl-12 text-fm-color-typo-disabled" : "flex max-h-[78px] w-full cursor-pointer items-center justify-between gap-2 rounded px-3 py-2 pl-12 hover:bg-fm-color-opacity-sm"
609
+ tabindex: !s.canUpdate || s.isMandatoryPosReport || s.reportType === "canvas" || b.value.has(s.reportId) ? void 0 : -1,
610
+ "aria-disabled": !s.canUpdate || s.isMandatoryPosReport || s.reportType === "canvas" || b.value.has(s.reportId),
611
+ class: g(
612
+ !s.canUpdate || s.isMandatoryPosReport || s.reportType === "canvas" || b.value.has(s.reportId) ? "flex max-h-[78px] w-full cursor-not-allowed items-center justify-between gap-2 rounded px-3 py-2 pl-12 text-fm-color-typo-disabled" : "flex max-h-[78px] w-full cursor-pointer items-center justify-between gap-2 rounded px-3 py-2 pl-12 hover:bg-fm-color-opacity-sm"
611
613
  ),
612
- onClick: (c) => {
613
- c.stopPropagation();
614
- const m = t(y).find(
615
- (p) => p.id === s.reportId
614
+ onClick: (i) => {
615
+ i.stopPropagation();
616
+ const y = t(f).find(
617
+ (J) => J.id === s.reportId
616
618
  );
617
- m && V(m);
619
+ y && V(y);
618
620
  }
619
621
  }, [
620
- v("span", dt, k(t(a)("report.common.showInPOS")), 1),
622
+ v("span", ut, k(t(a)("report.common.showInPOS")), 1),
621
623
  v("span", null, [
622
- i(t(me), {
623
- "model-value": Le(
624
+ c(t(fe), {
625
+ "model-value": s.reportType === "canvas" ? !1 : Le(
624
626
  s.reportId,
625
627
  s.isSupportPos
626
628
  ),
627
- disabled: !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId),
629
+ disabled: !s.canUpdate || s.isMandatoryPosReport || s.reportType === "canvas" || b.value.has(s.reportId),
628
630
  "aria-label": "Show in POS v8",
629
631
  class: "pointer-events-none"
630
632
  }, null, 8, ["model-value", "disabled"])
631
633
  ])
632
- ], 10, pt),
633
- i(t(P), {
634
+ ], 10, dt),
635
+ c(t(P), {
634
636
  label: t(a)("report.common.duplicate"),
635
- disabled: ee(s),
636
- class: b(
637
- ee(s) ? "text-fm-color-typo-disabled" : ""
637
+ disabled: te(s),
638
+ class: g(
639
+ te(s) ? "text-fm-color-typo-disabled" : ""
638
640
  ),
639
641
  onClick: () => {
640
- const c = t(y).find(
641
- (m) => m.id === s.reportId
642
+ const i = t(f).find(
643
+ (y) => y.id === s.reportId
642
644
  );
643
- c && !ee(s) ? ge(c) : t(l).open({
645
+ i && !te(s) ? ge(i) : t(l).open({
644
646
  message: t(a)("report.messages.noPermissionDuplicateReport"),
645
647
  type: "error"
646
648
  });
647
649
  }
648
650
  }, null, 8, ["label", "disabled", "class", "onClick"]),
649
- i(t(P), {
651
+ c(t(P), {
650
652
  label: t(a)(
651
- s.reportId === ((C = t(K)) == null ? void 0 : C.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
653
+ s.reportId === ((C = t(E)) == null ? void 0 : C.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
652
654
  ),
653
655
  onClick: () => {
654
- const c = t(y).find(
655
- (m) => m.id === s.reportId
656
+ const i = t(f).find(
657
+ (y) => y.id === s.reportId
656
658
  );
657
- c && ye(c);
659
+ i && ve(i);
658
660
  }
659
661
  }, null, 8, ["label", "onClick"]),
660
- i(t(P), {
662
+ c(t(P), {
661
663
  label: t(a)("report.common.delete"),
662
- disabled: te(s),
663
- class: b(
664
- te(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
664
+ disabled: oe(s),
665
+ class: g(
666
+ oe(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
665
667
  ),
666
668
  onClick: () => {
667
- const c = t(y).find(
668
- (m) => m.id === s.reportId
669
+ const i = t(f).find(
670
+ (y) => y.id === s.reportId
669
671
  );
670
- c && !te(s) && ve(c);
672
+ i && !oe(s) && be(i);
671
673
  }
672
674
  }, {
673
- label: f(() => [
674
- Ee(k(t(a)("report.common.delete")), 1)
675
+ label: m(() => [
676
+ je(k(t(a)("report.common.delete")), 1)
675
677
  ]),
676
678
  _: 2
677
679
  }, 1032, ["label", "disabled", "class", "onClick"])
@@ -680,9 +682,9 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
680
682
  _: 2
681
683
  }, 1024)
682
684
  ]),
683
- default: f(() => [
685
+ default: m(() => [
684
686
  v("span", {
685
- class: b(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
687
+ class: g(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
686
688
  }, k(s.name), 3)
687
689
  ]),
688
690
  _: 2
@@ -695,7 +697,7 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
695
697
  }, 8, ["class", "column-defs", "row-data", "page-size"])), [
696
698
  [he, x.value.length > 0]
697
699
  ]),
698
- we(i(et, null, null, 512), [
700
+ Re(c(tt, null, null, 512), [
699
701
  [he, x.value.length === 0]
700
702
  ])
701
703
  ], 6)
@@ -706,5 +708,5 @@ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it
706
708
  }
707
709
  });
708
710
  export {
709
- Ct as default
711
+ It as default
710
712
  };