@feedmepos/mf-report 5.18.2-beta.0 → 5.18.2-beta.2

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 (19) hide show
  1. package/dist/App-2aEdytBx.js +157 -0
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BrHd550j.js → BaseDialog.vue_vue_type_script_setup_true_lang-djyc20Cp.js} +58 -58
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-4V19EFBP.js → Default.vue_vue_type_script_setup_true_lang-DpSgAipe.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-B75aeM0i.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DKA5lLXB.js} +1 -1
  5. package/dist/{InsightView-DCIgjpGL.js → InsightView-CxCeRQ-P.js} +2 -2
  6. package/dist/{Layout-Dco__bZI.js → Layout-B2cpQx3C.js} +1 -1
  7. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BJM6sKQU.js → MenuTab.vue_vue_type_script_setup_true_lang-C8oiHuOX.js} +2 -2
  8. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-4v9iLIA2.js → NavigationTab.vue_vue_type_script_setup_true_lang-CDxb2Mjg.js} +1 -1
  9. package/dist/{OverviewView-CUPsimnH.js → OverviewView-D8mA0P3y.js} +4 -4
  10. package/dist/{Report-BljRc1xi.js → Report-Cg9Fen7g.js} +2 -2
  11. package/dist/{ReportEditor-DgAWdCZe.js → ReportEditor-Db1Ll1hk.js} +183 -182
  12. package/dist/ReportView-BQb_myNM.js +246 -0
  13. package/dist/{Setting-BciZnr8l.js → Setting-BxLdkt7x.js} +2 -2
  14. package/dist/{TileEditor-DgawblCV.js → TileEditor-DbbSibJa.js} +3 -3
  15. package/dist/{TransitionFade-1tV8-j1Z.js → TransitionFade-CiVLb7cy.js} +2 -2
  16. package/dist/app.js +9 -9
  17. package/package.json +1 -1
  18. package/dist/App-Cts_hjbs.js +0 -157
  19. package/dist/ReportView-CMRcpoTz.js +0 -252
@@ -0,0 +1,157 @@
1
+ import { defineComponent as x, resolveComponent as C, createBlock as T, openBlock as m, unref as r, isRef as Z, withCtx as b, createElementVNode as V, createVNode as $, toDisplayString as D, createTextVNode as M, onMounted as z, watch as g, ref as J, computed as O, onBeforeMount as ee, onBeforeUnmount as te, createElementBlock as w, Fragment as oe } from "vue";
2
+ import { detectLocale as h, useCoreStore as k } from "@feedmepos/mf-common";
3
+ import { u as re, d as F, a as ae, b as se, c as ne, e as le, f as ue, s as ie, g as ce } from "./vue-i18n-CTLGxUiF.js";
4
+ import { storeToRefs as B } from "pinia";
5
+ import { u as me, a as de, b as ve } from "./BaseDialog.vue_vue_type_script_setup_true_lang-djyc20Cp.js";
6
+ import { _ as pe, u as fe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CDxb2Mjg.js";
7
+ import { u as U } from "./message-dialog-UoMWOnil.js";
8
+ import { useRoute as ge, useRouter as he } from "vue-router";
9
+ const _e = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, ye = /* @__PURE__ */ x({
10
+ __name: "Dialog",
11
+ setup(d) {
12
+ const { t } = re(), s = U(), { isOpened: a, message: i, title: c } = B(U());
13
+ return (v, l) => {
14
+ const p = C("FmButton"), _ = C("FmDialog");
15
+ return m(), T(_, {
16
+ modelValue: r(a),
17
+ "onUpdate:modelValue": l[0] || (l[0] = (y) => Z(a) ? a.value = y : null),
18
+ overlay: "",
19
+ "close-button": !1
20
+ }, {
21
+ "dialog-header": b(() => [
22
+ M(D(r(c)), 1)
23
+ ]),
24
+ default: b(() => [
25
+ V("p", _e, D(r(i)), 1)
26
+ ]),
27
+ "dialog-footer": b(() => [
28
+ l[1] || (l[1] = V("div", { class: "grow" }, null, -1)),
29
+ $(p, {
30
+ label: r(t)("report.common.cancel"),
31
+ variant: "tertiary",
32
+ onClick: r(s).dismiss
33
+ }, null, 8, ["label", "onClick"]),
34
+ $(p, {
35
+ label: r(t)("report.common.confirm"),
36
+ onClick: r(s).confirm
37
+ }, null, 8, ["label", "onClick"])
38
+ ]),
39
+ _: 1
40
+ }, 8, ["modelValue"]);
41
+ };
42
+ }
43
+ }), q = J(h());
44
+ function Se() {
45
+ const d = (t) => {
46
+ switch (q.value = t, t) {
47
+ case "zh-CN":
48
+ F.locale("zh-cn");
49
+ break;
50
+ default:
51
+ F.locale("en");
52
+ break;
53
+ }
54
+ };
55
+ return z(() => {
56
+ d(h());
57
+ }), g(() => h(), d, { deep: !0, immediate: !0 }), {
58
+ currentLocale: q
59
+ };
60
+ }
61
+ F.locale(h() === "zh-CN" ? "zh-cn" : "en");
62
+ const be = ["src"], we = ["src"], Le = /* @__PURE__ */ x({
63
+ __name: "App",
64
+ setup(d) {
65
+ const { businessId: t, token: s, country: a } = B(ae()), { sessionUser: i, currentBusiness: c, currentCountry: v, registerSidebarComponent: l } = k(), { getRestaurantAndWarehouse: p, getBusinessSetting: _ } = se(), { getFeatureFlags: y } = ne(), { version: n } = B(me()), { getSettings: j } = le(), { promptLoader: A } = ue(), u = ge(), W = he(), G = O(() => `https://portal-v1.feedmedev.cc/b/${t.value}/report/CLOSE_UP?showHeader=false&country=${a.value.toUpperCase()}&menuOption=business-report&token=${s.value}&v2=true&reportV5Button=true`), K = O(() => `https://report-v4.feedmedev.cc?businessId=${t.value}&country=${a.value}&token=${s.value}&reportV3Button=true`);
66
+ g(
67
+ [() => c.value, () => i.value, () => v.value],
68
+ () => {
69
+ var e, f;
70
+ const o = ((e = c.value) == null ? void 0 : e.id) ?? "";
71
+ c.value && i.value && v.value && (ie(a.value), t.value !== o && (t.value = o), s.value = ((f = i.value) == null ? void 0 : f.token) ?? "", a.value = v.value ?? "", u.query.businessId !== t.value && W.replace({
72
+ name: u.name,
73
+ params: u.params,
74
+ query: { ...u.query, businessId: t.value }
75
+ }));
76
+ },
77
+ { immediate: !0 }
78
+ );
79
+ function R(o) {
80
+ if (typeof o.data == "string")
81
+ try {
82
+ const e = JSON.parse(o.data);
83
+ (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (s.value = e.token);
84
+ } catch (e) {
85
+ console.error(e);
86
+ }
87
+ }
88
+ function E(o) {
89
+ if (typeof o.data == "string")
90
+ try {
91
+ const e = JSON.parse(o.data);
92
+ (e == null ? void 0 : e.v5) === !0 ? n.value = S.value : (e == null ? void 0 : e.v3) === !0 && (n.value = "v3");
93
+ } catch (e) {
94
+ console.error(e);
95
+ }
96
+ }
97
+ g(n, () => {
98
+ ["v3", "v4"].includes(n.value) ? k().hideSidebarToggle(!0) : k().hideSidebarToggle(!1);
99
+ }), ee(() => {
100
+ l(pe);
101
+ }), z(() => {
102
+ console.log("5.18.2-beta.2", !0), window.addEventListener("message", R), window.addEventListener("message", E);
103
+ });
104
+ const I = de(), L = fe();
105
+ te(() => {
106
+ window.removeEventListener("message", R), window.removeEventListener("message", E), I.$dispose(), L.$dispose();
107
+ });
108
+ const { getReports: P, getOverviewReport: H, getReportConfig: N } = I, { getSchema: Q } = ve(), { fetchSchedules: X } = L, { init: Y } = ce(), S = J("v5");
109
+ return g(
110
+ () => t.value,
111
+ () => {
112
+ t.value !== "" && A(async () => {
113
+ await Y({
114
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
115
+ url: "https://flag.feedme.farm/api/v1/",
116
+ enableAnalytics: !1,
117
+ cacheFlags: !1
118
+ });
119
+ const o = await N();
120
+ S.value = o.version, n.value = S.value, await Promise.all([
121
+ y(),
122
+ N(),
123
+ H(),
124
+ P(),
125
+ Q(),
126
+ X(),
127
+ _(),
128
+ p(
129
+ u.query.locationIds ? JSON.parse(u.query.locationIds) : null
130
+ ),
131
+ j()
132
+ ]);
133
+ });
134
+ },
135
+ {
136
+ immediate: !0
137
+ }
138
+ ), Se(), (o, e) => {
139
+ const f = C("router-view");
140
+ return m(), w(oe, null, [
141
+ $(ye),
142
+ r(n) === "v3" ? (m(), w("iframe", {
143
+ key: 0,
144
+ class: "bg-white h-full w-full",
145
+ src: G.value
146
+ }, null, 8, be)) : r(n) === "v4" ? (m(), w("iframe", {
147
+ key: 1,
148
+ class: "bg-white h-full w-full",
149
+ src: K.value
150
+ }, null, 8, we)) : (m(), T(f, { key: 2 }))
151
+ ], 64);
152
+ };
153
+ }
154
+ });
155
+ export {
156
+ Le as default
157
+ };