@feedmepos/mf-report 5.19.8-beta.2 → 5.19.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/App-DTXCen66.js +234 -0
  2. package/dist/BaseDialog.vue_vue_type_script_setup_true_lang-CVrSaewm.js +11208 -0
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-CioHmHN6.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BjCJYhtZ.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-635FjOPP.js → Default.vue_vue_type_script_setup_true_lang-DEUZ4W4C.js} +2 -2
  5. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B3Ph6aYx.js +1625 -0
  6. package/dist/{InsightView-Cy75KuEh.js → InsightView-BEgpNnKD.js} +5 -5
  7. package/dist/{Integration-D6N9nftt.js → Integration-Crm_siri.js} +2 -2
  8. package/dist/{Integrations-ClCpYgsX.js → Integrations-DAOeCNIk.js} +3 -3
  9. package/dist/{Layout-DPQzsxqk.js → Layout-BRHpJV90.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-zwpO7Fxk.js → MenuTab.vue_vue_type_script_setup_true_lang-BC-vDJFi.js} +6 -6
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DpmOHFlh.js → NavigationTab.vue_vue_type_script_setup_true_lang-DaOoQ3gh.js} +6984 -6990
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CAGjM94B.js → NoData.vue_vue_type_script_setup_true_lang-BCtqN6Qb.js} +1 -1
  13. package/dist/{OverviewView-BUtFTF9C.js → OverviewView-zZsQ4CWc.js} +5 -5
  14. package/dist/{Report-W8-KjFN8.js → Report-BgZwKQnX.js} +4 -4
  15. package/dist/{ReportEditor-BekjtFjn.js → ReportEditor-eczfvuba.js} +6 -6
  16. package/dist/{ReportView-DgpQQiQ7.js → ReportView-T8_-ajax.js} +7 -7
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-wbYOXNgr.js → SelectComponent.vue_vue_type_script_setup_true_lang-DQaq02mG.js} +1 -1
  18. package/dist/{Setting-BXQIl_2E.js → Setting-MsoHV2Vm.js} +4 -4
  19. package/dist/{TileEditor-BslLk145.js → TileEditor-D49-DVKa.js} +7 -7
  20. package/dist/{TransitionFade-B9nowM3U.js → TransitionFade-CkyOk0I6.js} +92 -92
  21. package/dist/app.js +11 -11
  22. package/dist/assets/formatChartData.worker-2gP9DT2G.js +8 -0
  23. package/dist/{helper-BYQmOCI_.js → helper-DKVVGDb2.js} +1 -1
  24. package/dist/{vue-i18n-B-WkKyGH.js → vue-i18n-BU70cPPB.js} +1308 -1296
  25. package/package.json +3 -2
  26. package/dist/App-C1LB_Ksr.js +0 -226
  27. package/dist/BaseDialog.vue_vue_type_script_setup_true_lang-Wsp8VGv0.js +0 -19594
  28. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-D_bXyyNL.js +0 -1674
  29. package/dist/assets/formatChartData.worker-Cr9zHMoq.js +0 -106
  30. package/dist/assets/processTableData.worker-COqO3hgX.js +0 -106
@@ -0,0 +1,234 @@
1
+ import { defineComponent as ee, resolveComponent as U, createBlock as te, openBlock as h, unref as u, isRef as Ie, withCtx as J, createElementVNode as K, createVNode as z, toDisplayString as P, createTextVNode as he, onMounted as ae, watch as R, ref as E, computed as H, onBeforeMount as Re, onBeforeUnmount as qe, createElementBlock as A, Fragment as Oe } from "vue";
2
+ import { detectLocale as k, useCoreStore as T } from "@feedmepos/mf-common";
3
+ import { u as Le, d as i, a as _e, b as X, c as be, e as we, f as Ce, s as Ee, g as ke } from "./vue-i18n-BU70cPPB.js";
4
+ import { storeToRefs as q } from "pinia";
5
+ import { u as Y, a as Ne, b as Be } from "./BaseDialog.vue_vue_type_script_setup_true_lang-CVrSaewm.js";
6
+ import { _ as Fe, u as $e } from "./NavigationTab.vue_vue_type_script_setup_true_lang-DaOoQ3gh.js";
7
+ import { u as Z } from "./message-dialog-UoMWOnil.js";
8
+ import { useRoute as xe, useRouter as Je } from "vue-router";
9
+ const Ae = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Te = /* @__PURE__ */ ee({
10
+ __name: "Dialog",
11
+ setup(O) {
12
+ const { t: r } = Le(), f = Z(), { isOpened: l, message: S, title: D } = q(Z());
13
+ return (L, g) => {
14
+ const _ = U("FmButton"), N = U("FmDialog");
15
+ return h(), te(N, {
16
+ modelValue: u(l),
17
+ "onUpdate:modelValue": g[0] || (g[0] = (B) => Ie(l) ? l.value = B : null),
18
+ overlay: "",
19
+ "close-button": !1
20
+ }, {
21
+ "dialog-header": J(() => [
22
+ he(P(u(D)), 1)
23
+ ]),
24
+ default: J(() => [
25
+ K("p", Ae, P(u(S)), 1)
26
+ ]),
27
+ "dialog-footer": J(() => [
28
+ g[1] || (g[1] = K("div", { class: "grow" }, null, -1)),
29
+ z(_, {
30
+ label: u(r)("report.common.cancel"),
31
+ variant: "tertiary",
32
+ onClick: u(f).dismiss
33
+ }, null, 8, ["label", "onClick"]),
34
+ z(_, {
35
+ label: u(r)("report.common.confirm"),
36
+ onClick: u(f).confirm
37
+ }, null, 8, ["label", "onClick"])
38
+ ]),
39
+ _: 1
40
+ }, 8, ["modelValue"]);
41
+ };
42
+ }
43
+ }), M = E(k());
44
+ function Ue() {
45
+ const O = (r) => {
46
+ switch (M.value = r, r) {
47
+ case "zh-CN":
48
+ i.locale("zh-cn");
49
+ break;
50
+ default:
51
+ i.locale("en");
52
+ break;
53
+ }
54
+ };
55
+ return ae(() => {
56
+ O(k());
57
+ }), R(() => k(), O, { deep: !0, immediate: !0 }), {
58
+ currentLocale: M
59
+ };
60
+ }
61
+ i.locale(k() === "zh-CN" ? "zh-cn" : "en");
62
+ const ze = ["src"], Qe = ["src"], et = /* @__PURE__ */ ee({
63
+ __name: "App",
64
+ setup(O) {
65
+ const { businessId: r, token: f, country: l } = q(_e()), { sessionUser: S, currentBusiness: D, currentCountry: L, registerSidebarComponent: g } = T(), { getRestaurantAndWarehouse: _, getBusinessSetting: N, beginBusinessLoad: B, completeBusinessLoad: ne } = X(), { getFeatureFlags: re } = be(), { version: p } = q(Y()), { getSettings: oe } = we(), { promptLoader: se } = Ce(), e = xe(), F = Je(), ie = Y(), { suppressReportRouteSync: b } = q(ie), ue = H(() => `https://portal-v1.feedmedev.cc/b/${r.value}/report/CLOSE_UP?showHeader=false&country=${l.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), le = H(() => `https://report-v4.feedmedev.cc?businessId=${r.value}&country=${l.value}&token=${f.value}&reportV3Button=true`);
66
+ R(
67
+ [() => D.value, () => S.value, () => L.value],
68
+ () => {
69
+ var t, o;
70
+ const a = ((t = D.value) == null ? void 0 : t.id) ?? "";
71
+ D.value && S.value && L.value && (Ee(l.value), r.value !== a && (r.value = a), f.value = ((o = S.value) == null ? void 0 : o.token) ?? "", l.value = L.value ?? "", e.query.businessId !== r.value && F.replace({
72
+ name: e.name,
73
+ params: e.params,
74
+ query: { ...e.query, businessId: r.value }
75
+ }));
76
+ },
77
+ { immediate: !0 }
78
+ );
79
+ function Q(a) {
80
+ if (typeof a.data == "string")
81
+ try {
82
+ const t = JSON.parse(a.data);
83
+ (t == null ? void 0 : t.token) !== "" && (t == null ? void 0 : t.token) !== void 0 && (f.value = t.token);
84
+ } catch (t) {
85
+ console.error(t);
86
+ }
87
+ }
88
+ function V(a) {
89
+ if (typeof a.data == "string")
90
+ try {
91
+ const t = JSON.parse(a.data);
92
+ (t == null ? void 0 : t.v5) === !0 ? p.value = $.value : (t == null ? void 0 : t.v3) === !0 && (p.value = "v3");
93
+ } catch (t) {
94
+ console.error(t);
95
+ }
96
+ }
97
+ R(p, () => {
98
+ ["v3", "v4"].includes(p.value) ? T().hideSidebarToggle(!0) : T().hideSidebarToggle(!1);
99
+ }), Re(() => {
100
+ g(Fe);
101
+ }), ae(() => {
102
+ console.log("5.19.9-beta.0", !0), window.addEventListener("message", Q), window.addEventListener("message", V);
103
+ });
104
+ const I = Ne(), W = $e(), n = X();
105
+ qe(() => {
106
+ window.removeEventListener("message", Q), window.removeEventListener("message", V), I.$dispose(), W.$dispose();
107
+ });
108
+ const { getReports: ce, getOverviewReport: de, getReportConfig: j, currentReportId: G } = I, { currentReportId: me, reports: fe } = q(I), { getSchema: pe } = Be(), { fetchSchedules: ge } = W, { init: ve } = ke(), $ = E("v5"), w = E(!1), x = E(!0);
109
+ function ye() {
110
+ const a = e.query.startDate ? i(e.query.startDate).startOf("day").toISOString() : void 0, t = e.query.endDate ? i(e.query.endDate).endOf("day").toISOString() : void 0, o = e.query.timeStart ? JSON.parse(e.query.timeStart) : void 0, c = e.query.timeEnd ? JSON.parse(e.query.timeEnd) : void 0, d = e.query.compareStartDate ? i(e.query.compareStartDate).startOf("day").toISOString() : void 0, v = e.query.compareEndDate ? i(e.query.compareEndDate).endOf("day").toISOString() : void 0, C = e.query.isAllLocation === "true";
111
+ let m = [];
112
+ C ? m = n.selectedLocationIds : m = e.query.locationIds ? JSON.parse(e.query.locationIds) : void 0;
113
+ let y = e.query.reportId || G;
114
+ if (fe.value.find((s) => s.id === y) || (y = G), y && y !== I.currentReportId && I.updateCurrentReportId(y), a || t) {
115
+ const s = n.dateRange;
116
+ (s.startDate !== a || s.endDate !== t) && n.setDateRange({ startDate: a, endDate: t });
117
+ }
118
+ if (o || c) {
119
+ const s = n.timeRange;
120
+ (s.start !== o || s.end !== c) && n.setTimeRange({ start: o, end: c });
121
+ }
122
+ if (d || v) {
123
+ const s = n.compareDateRange;
124
+ (s.startDate !== d || s.endDate !== v) && n.setCompareDateRange({
125
+ startDate: d,
126
+ endDate: v
127
+ });
128
+ }
129
+ if (!C && Array.isArray(m)) {
130
+ const s = n.selectedLocationIds;
131
+ s.length === m.length && s.every((Se, De) => Se === m[De]) || n.setSelectedLocationIds(m);
132
+ }
133
+ return {
134
+ // TODO: this returned value can used for getBusinessSetting
135
+ reportId: y,
136
+ startDate: e.query.startDate,
137
+ endDate: e.query.endDate,
138
+ timeStart: e.query.timeStart,
139
+ timeEnd: e.query.timeEnd,
140
+ compareStartDate: e.query.compareStartDate,
141
+ compareEndDate: e.query.compareEndDate,
142
+ locationIds: e.query.locationIds,
143
+ isAllLocation: e.query.isAllLocation
144
+ };
145
+ }
146
+ return R(
147
+ () => r.value,
148
+ async (a) => {
149
+ a !== "" && (w.value = !1, B(a), x.value || (n.setSelectedLocationIds([]), F.replace({
150
+ name: e.name,
151
+ params: e.params,
152
+ query: {
153
+ ...e.query,
154
+ locationIds: void 0,
155
+ isAllLocation: "true"
156
+ }
157
+ })), b.value !== void 0 && (b.value = !0), await se(async () => {
158
+ await ve({
159
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
160
+ url: "https://flag.feedme.farm/api/v1/",
161
+ enableAnalytics: !1,
162
+ cacheFlags: !1
163
+ });
164
+ const t = await j();
165
+ $.value = t.version, p.value = $.value, await Promise.all([
166
+ re(),
167
+ j(),
168
+ de(),
169
+ ce(),
170
+ pe(),
171
+ ge(),
172
+ _(
173
+ e.query.locationIds ? JSON.parse(e.query.locationIds) : null
174
+ ),
175
+ oe()
176
+ ]), await N(), ye(), ne(a);
177
+ }), w.value = !0, x.value && (x.value = !1));
178
+ },
179
+ {
180
+ immediate: !0
181
+ }
182
+ ), R(
183
+ () => (w.value, {
184
+ reportId: me.value,
185
+ selectedLocationIds: n.selectedLocationIds,
186
+ dateRange: n.dateRange,
187
+ timeRange: n.timeRange,
188
+ compareDateRange: n.compareDateRange
189
+ }),
190
+ (a) => {
191
+ if (!w.value || !a.reportId) return;
192
+ if (b.value) {
193
+ b.value = !1;
194
+ return;
195
+ }
196
+ const t = a.selectedLocationIds, o = a.dateRange, c = a.timeRange, d = a.compareDateRange, v = {
197
+ ...e.query,
198
+ reportId: a.reportId,
199
+ startDate: o.startDate ? i(o.startDate).startOf("day").toISOString() : void 0,
200
+ endDate: o.endDate ? i(o.endDate).endOf("day").toISOString() : void 0,
201
+ compareStartDate: d.startDate ? i(d.startDate).startOf("day").toISOString() : void 0,
202
+ compareEndDate: d.endDate ? i(d.endDate).endOf("day").toISOString() : void 0,
203
+ timeStart: c.start ? JSON.stringify(c.start) : void 0,
204
+ timeEnd: c.end ? JSON.stringify(c.end) : void 0,
205
+ locationIds: t.length === n.locations.length ? null : t.length > 0 ? JSON.stringify(t) : void 0,
206
+ isAllLocation: String(t.length === n.locations.length)
207
+ }, C = JSON.stringify(e.query), m = JSON.stringify(v);
208
+ C !== m && F.replace({
209
+ name: e.name,
210
+ params: e.params,
211
+ query: v
212
+ });
213
+ },
214
+ { deep: !0 }
215
+ ), Ue(), (a, t) => {
216
+ const o = U("router-view");
217
+ return h(), A(Oe, null, [
218
+ z(Te),
219
+ u(p) === "v3" ? (h(), A("iframe", {
220
+ key: 0,
221
+ class: "bg-white h-full w-full",
222
+ src: ue.value
223
+ }, null, 8, ze)) : u(p) === "v4" ? (h(), A("iframe", {
224
+ key: 1,
225
+ class: "bg-white h-full w-full",
226
+ src: le.value
227
+ }, null, 8, Qe)) : (h(), te(o, { key: 2 }))
228
+ ], 64);
229
+ };
230
+ }
231
+ });
232
+ export {
233
+ et as default
234
+ };