@feedmepos/mf-connect 0.1.98-beta.7 → 0.1.98-beta.71

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 (152) hide show
  1. package/dist/{App-BonFFUVJ.js → App-B-Onur9k.js} +812 -666
  2. package/dist/{AuditLogs-CaQisyMC.js → AuditLogs-BnEeKG1C.js} +14 -13
  3. package/dist/{Bin-Mu8gAiHw.js → Bin-BH9_nATR.js} +8 -8
  4. package/dist/Broadcast-Gt2ZLLpZ.js +302 -0
  5. package/dist/CampaignAnalytic-BT6zTgNk.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoLZVrCU.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js} +6 -5
  7. package/dist/Card-dD52oor7.js +1084 -0
  8. package/dist/{Collections-CByXxRW_.js → Collections-7bwYNl3M.js} +14 -13
  9. package/dist/Credit-qZdlqXqR.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js +4213 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BXsAX1Xa.js → EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js} +35 -35
  13. package/dist/{Experience-B7J-aqPK.js → Experience-CAaWgWXP.js} +112 -86
  14. package/dist/{FileSaver.min-D_F_MSZt.js → FileSaver.min-BpfY6VnX.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-fhrbFb_5.js +356 -0
  17. package/dist/GiftCardSetup-CTwmNKim.js +736 -0
  18. package/dist/{Grab-C45MmlD9.js → Grab-BnPfb92x.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CPPcB3PC.js → ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js} +1 -1
  20. package/dist/{Index-vQ6uP49O.js → Index-DRwvmm_j.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js → LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DU9eIein.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js} +1 -1
  23. package/dist/LoyaltyDashboard-8jn6SIWo.js +2865 -0
  24. package/dist/MainLayout-Bf42AcB1.js +143 -0
  25. package/dist/{Marketing-B6xMdQvW.js → Marketing-DruTMjiR.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-0cZN4bek.js → MarketingMaterialEdit-moEHd_gP.js} +15 -14
  27. package/dist/Member-C9VTQqIm.js +654 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js +1279 -0
  29. package/dist/MemberImportHistory-DZVwya9v.js +187 -0
  30. package/dist/MemberList-KusIfy1u.js +334 -0
  31. package/dist/{MemberTransactions-Bg-ziZy8.js → MemberTransactions-msyjdzlI.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jbDJkbZh.js → MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js} +5928 -5644
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js +40 -0
  34. package/dist/Mission-CUUxpBUF.js +360 -0
  35. package/dist/{Overview-nsyJGSCq.js → Overview-C9jyKXHX.js} +21 -20
  36. package/dist/Overview-CYKoF8Hp.js +1316 -0
  37. package/dist/Point-CPpQ07yp.js +288 -0
  38. package/dist/Promotion-CJ95m9Qb.js +423 -0
  39. package/dist/{Queue-Dkipt6fw.js → Queue-CX39ILh_.js} +14 -13
  40. package/dist/{Record-BFqx6vM-.js → Record-6I0qyXB5.js} +9 -9
  41. package/dist/Review-DoWu2XNT.js +45 -0
  42. package/dist/ReviewFacebookCallback-Co-5TnI7.js +238 -0
  43. package/dist/ReviewGoogleCallback-Ca7ZuMcF.js +213 -0
  44. package/dist/{Reward-DjFEE7I_.js → Reward-Cx_N6qBJ.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BzZ6VH80.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-A9jQX4jt.js → RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js} +196 -186
  47. package/dist/{Segment-BAjdUfZ6.js → Segment-Bx0EW966.js} +275 -276
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CAQPFzRH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js} +37 -36
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Gkz8jhES.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js} +4 -4
  50. package/dist/{Setting-BK7y0XC-.js → Setting-DzEK3dWj.js} +14 -14
  51. package/dist/{SettingAdvertisements-DfQ645xr.js → SettingAdvertisements-BNALbI88.js} +12 -12
  52. package/dist/Settings-Cw85-xzq.js +230 -0
  53. package/dist/Store-BSqW1gwf.js +2612 -0
  54. package/dist/{StoreRewards-usHKOGmB.js → StoreRewards-CJXnS8Qf.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrcWUZuR.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js} +2 -2
  57. package/dist/{Tier-BF3V430O.js → Tier-DfitNxp2.js} +2580 -754
  58. package/dist/{Title-DwPuqKfJ.js → Title-QCbtOvKB.js} +39 -37
  59. package/dist/Transaction-dOCzlidD.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DToNRTJS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js} +26 -26
  61. package/dist/{Voucher-DnhVIl_o.js → Voucher-BfoCDwjg.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Btb3UZCn.js → VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js} +118 -124
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-EFUW9DMY.js → ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js} +2 -2
  64. package/dist/{app-i3r-6ZVm.js → app-BxTElIm-.js} +45168 -37577
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-BmUK8hMh.js +75 -0
  67. package/dist/{business-i0Gxk7gG.js → business-DjAiT8tR.js} +5 -5
  68. package/dist/campaign-DlR3KF9m.js +368 -0
  69. package/dist/campaign-tAmQNoq7.js +100 -0
  70. package/dist/{campaign.enum-CbUTfxek.js → campaign.enum-BjwEQd11.js} +1 -1
  71. package/dist/{campaign.fn-BjHSIDd1.js → campaign.fn-C6kWWIQx.js} +53 -53
  72. package/dist/{collectible.enum-DN7E_kHg.js → collectible.enum-BrtXpT9S.js} +1 -1
  73. package/dist/collection.fn-CDhfM3Eq.js +26 -0
  74. package/dist/currency-10nX5QnT.js +7 -0
  75. package/dist/{duplicateCampaign-DmdJQEIA.js → duplicateCampaign-6oMZOvfM.js} +11 -11
  76. package/dist/{effect-DM4AzeQl.js → effect-T4YzuTc5.js} +1 -1
  77. package/dist/{email-addresses-BlqVJhwZ.js → email-addresses-BjODnJMM.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-CkdISSVP.js → helper-BCl5r5yZ.js} +1 -1
  80. package/dist/{index-DgzNGQgE.js → index-B9ZMIUMa.js} +2083 -2559
  81. package/dist/{index-CB7ytKOE.js → index-BBsK7TUw.js} +1588 -1522
  82. package/dist/index-BQk6zTgf.js +32437 -0
  83. package/dist/index-Bd4clHfr.js +901 -0
  84. package/dist/index-BeVWchv7.js +14550 -0
  85. package/dist/index-Bht1Z11w.js +72 -0
  86. package/dist/{index-FD50UHqf.js → index-BiolIgqR.js} +105 -123
  87. package/dist/{index-Cl8t41Sk.js → index-BxU--5J5.js} +5 -5
  88. package/dist/index-Bz6oSli7.js +151 -0
  89. package/dist/index-C5IfNJUl.js +53 -0
  90. package/dist/{index-BWsj6lCJ.js → index-CRvUvCMA.js} +14 -14
  91. package/dist/{index-B6xi1soU.js → index-CnaQt4Pn.js} +1 -1
  92. package/dist/{index-4EtrCy_K.js → index-Ctja--IE.js} +4 -4
  93. package/dist/{index-D6qeYVNz.js → index-D8rGhchh.js} +1 -1
  94. package/dist/{index-BrboOmPq.js → index-DJdTDF9C.js} +347 -216
  95. package/dist/index-DXiJa8Cw.js +137 -0
  96. package/dist/{index-CxdLExX0.js → index-DeQKLilv.js} +24 -9
  97. package/dist/{index-vI-ndGu_.js → index-DhtKt4OL.js} +5 -5
  98. package/dist/{index.esm2017-BX5CyKoc.js → index.esm2017-CEOegJjn.js} +132 -132
  99. package/dist/{loading-DTKDhqew.js → loading-Dx4SCvZY.js} +1 -1
  100. package/dist/{lodash-CCPBsqhe.js → lodash-Dq8OKCKK.js} +1 -1
  101. package/dist/member-import-DX-jn2uk.js +187 -0
  102. package/dist/membership-CltAa-gH.js +274 -0
  103. package/dist/{money-wMK3QkZ5.js → money-DsaAjJTI.js} +1 -1
  104. package/dist/{number-DjKVlWn0.js → number-DmhHKYgY.js} +1 -1
  105. package/dist/objectid-BdNv-dZX.js +145 -0
  106. package/dist/{plugins-D25PaNJk.js → plugins-BFKVM3uC.js} +13 -12
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-E63jqJHm.js → reward--SjvIeyy.js} +1 -1
  109. package/dist/{rule-RVvPtAnk.js → rule-CAKdNobZ.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-zNxOQaqe.js → template-Cfxc5eM8.js} +6 -6
  112. package/dist/timezone-D2b-V5XD.js +20 -0
  113. package/dist/transaction.fn-B5mLY7bz.js +71 -0
  114. package/dist/{trigger-BXV02FhP.js → trigger-DvYcjRBZ.js} +17 -17
  115. package/dist/useMarketingMaterialActions-DtqnjMSt.js +96 -0
  116. package/dist/{usePagination-BPcPhEnp.js → usePagination-DKX24g31.js} +1 -1
  117. package/dist/{user-Bd8S7R5u.js → user-fWb1NxGO.js} +1 -1
  118. package/dist/vue-i18n-wJReAVJw.js +2365 -0
  119. package/dist/{xlsx-_tQC9Ezf.js → xlsx-Mthhu4JR.js} +440 -440
  120. package/dist/{zod-C1j2GLZP.js → zod-CVpVUgBZ.js} +1 -1
  121. package/package.json +10 -6
  122. package/dist/Broadcast-Cy-i-WOT.js +0 -266
  123. package/dist/Card-f2XOtWxp.js +0 -910
  124. package/dist/Credit-CcZF4aQS.js +0 -260
  125. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7KZ8GMx.js +0 -3377
  127. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  128. package/dist/Game-CUW7NeVG.js +0 -330
  129. package/dist/LoyaltyDashboard-GqyUwvXz.js +0 -1082
  130. package/dist/MainLayout-R5NxIBR-.js +0 -41
  131. package/dist/Member-CC5F6Bmz.js +0 -280
  132. package/dist/MemberList-Cq4zxopX.js +0 -1601
  133. package/dist/Mission-DcCZ6tAG.js +0 -334
  134. package/dist/Point-D1vLd5hL.js +0 -262
  135. package/dist/Promotion-Cv7MW5RJ.js +0 -397
  136. package/dist/Review-CKhakUMe.js +0 -1123
  137. package/dist/ReviewFacebookCallback-xgRpXQAg.js +0 -243
  138. package/dist/ReviewGoogleCallback-Cqi_43qi.js +0 -208
  139. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DDqK4kV1.js +0 -181
  140. package/dist/Store-uTRQ6KbC.js +0 -1996
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bb2sTsuA.js +0 -1130
  142. package/dist/Transaction-CnTEfMGU.js +0 -39
  143. package/dist/campaign-CbMlARNI.js +0 -219
  144. package/dist/campaign-f7FT91GR.js +0 -277
  145. package/dist/export-DQR-0lmK.js +0 -97
  146. package/dist/index-COrXX9MR.js +0 -52
  147. package/dist/index-CWiaP-aV.js +0 -28900
  148. package/dist/index-jVfDVEtz.js +0 -85
  149. package/dist/membership-rifuatxU.js +0 -255
  150. package/dist/objectid-DjpWkCxH.js +0 -145
  151. package/dist/useMarketingMaterialActions-5TFNqZVo.js +0 -107
  152. package/dist/vue-i18n-CgMK-TaC.js +0 -2365
@@ -1,243 +0,0 @@
1
- import { defineComponent as S, computed as T, openBlock as d, createElementBlock as g, normalizeClass as z, createElementVNode as m, createBlock as C, unref as e, toDisplayString as k, createCommentVNode as $, createVNode as v, onMounted as B, ref as P, Fragment as E, renderList as N, resolveComponent as R, isRef as U } from "vue";
2
- import { u as M } from "./vue-i18n-CgMK-TaC.js";
3
- import { components as x } from "@feedmepos/ui-library";
4
- import { r as L } from "./index-COrXX9MR.js";
5
- import { u as V } from "./business-i0Gxk7gG.js";
6
- import { _ as A } from "./LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js";
7
- import { useRouter as H } from "vue-router";
8
- const D = ["src"], q = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, G = {
9
- key: 2,
10
- class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
11
- }, J = /* @__PURE__ */ S({
12
- __name: "FacebookPageConfig",
13
- props: {
14
- page: {},
15
- expanded: { type: Boolean },
16
- availableLocations: {}
17
- },
18
- emits: ["toggleExpand", "toggleLocation"],
19
- setup(c, { emit: n }) {
20
- const b = c, i = n, { t: h } = M(), f = T(
21
- () => b.page.locations.map((_) => _._id)
22
- );
23
- return (_, l) => (d(), g("div", {
24
- class: z([
25
- "rounded-lg border overflow-hidden transition-colors",
26
- c.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
27
- ])
28
- }, [
29
- m("button", {
30
- class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
31
- onClick: l[0] || (l[0] = (w) => i("toggleExpand"))
32
- }, [
33
- c.page.pageProfileImageUrl ? (d(), g("img", {
34
- key: 0,
35
- src: c.page.pageProfileImageUrl,
36
- class: "w-32 h-32 rounded-full shrink-0 object-cover"
37
- }, null, 8, D)) : (d(), C(e(x).FmIcon, {
38
- key: 1,
39
- name: "thumb_up",
40
- class: "text-fm-color-neutral-gray-400 shrink-0"
41
- })),
42
- m("span", q, k(c.page.pageName), 1),
43
- c.page.locations.length > 0 ? (d(), g("span", G, k(e(h)("connect.review.locationsSelected", c.page.locations.length)), 1)) : $("", !0),
44
- v(e(x).FmIcon, {
45
- name: c.expanded ? "expand_less" : "expand_more",
46
- class: "text-fm-color-neutral-gray-400 shrink-0"
47
- }, null, 8, ["name"])
48
- ]),
49
- c.expanded ? (d(), C(A, {
50
- key: 0,
51
- locations: c.availableLocations,
52
- "selected-ids": e(f),
53
- onToggle: l[1] || (l[1] = (w) => i("toggleLocation", w))
54
- }, null, 8, ["locations", "selected-ids"])) : $("", !0)
55
- ], 2));
56
- }
57
- }), K = { class: "flex flex-col gap-8" }, O = /* @__PURE__ */ S({
58
- __name: "FacebookPageLocationMapping",
59
- props: {
60
- pages: {}
61
- },
62
- emits: ["update:pages"],
63
- setup(c, { emit: n }) {
64
- const b = c, i = V();
65
- B(() => i.readLocations());
66
- const h = n, f = P(null), _ = T(() => {
67
- const r = /* @__PURE__ */ new Set();
68
- for (const p of b.pages)
69
- p.locations.forEach((a) => r.add(a._id));
70
- return r;
71
- });
72
- function l(r) {
73
- const p = new Set(r.locations.map((a) => a._id));
74
- return i.locations.filter((a) => {
75
- const t = a._id.toString();
76
- return !_.value.has(t) || p.has(t);
77
- });
78
- }
79
- function w(r, p) {
80
- const a = p._id.toString(), t = b.pages.map((o) => {
81
- if (o.facebookPageId !== r) return o;
82
- const u = o.locations.some(
83
- (s) => s._id === a
84
- );
85
- return {
86
- ...o,
87
- locations: u ? o.locations.filter((s) => s._id !== a) : [
88
- ...o.locations,
89
- {
90
- _id: a,
91
- name: p.name
92
- }
93
- ]
94
- };
95
- });
96
- h("update:pages", t);
97
- }
98
- function I(r) {
99
- f.value = f.value === r ? null : r;
100
- }
101
- return (r, p) => (d(), g("div", K, [
102
- (d(!0), g(E, null, N(c.pages, (a) => (d(), C(J, {
103
- key: a.facebookPageId,
104
- page: a,
105
- expanded: e(f) === a.facebookPageId,
106
- "available-locations": l(a),
107
- onToggleExpand: (t) => I(a.facebookPageId),
108
- onToggleLocation: (t) => w(a.facebookPageId, t)
109
- }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
110
- ]));
111
- }
112
- }), Q = { class: "flex flex-col min-h-full gap-16 p-24" }, W = {
113
- key: 0,
114
- class: "flex flex-col items-center justify-center flex-1 gap-16"
115
- }, X = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Y = {
116
- key: 1,
117
- class: "flex flex-col items-center justify-center flex-1 gap-16"
118
- }, Z = { class: "fm-typo-en-body-lg-600" }, ee = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, oe = {
119
- key: 2,
120
- class: "flex flex-col items-center justify-center flex-1 gap-16"
121
- }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "flex gap-8 justify-end mt-auto pt-8" }, ge = /* @__PURE__ */ S({
122
- __name: "ReviewFacebookCallback",
123
- setup(c) {
124
- const { t: n } = M(), b = H(), i = P([]), h = P(!1), f = P(!1), _ = P(!1), l = P(null), w = T(
125
- () => i.value.some((t) => t.locations.length > 0)
126
- );
127
- function I(t, o) {
128
- const u = new Map(
129
- o.map((s) => [s.facebookPageId, s])
130
- );
131
- return t.map((s) => {
132
- var y;
133
- return {
134
- ...s,
135
- locations: ((y = u.get(s.facebookPageId)) == null ? void 0 : y.locations) ?? []
136
- };
137
- });
138
- }
139
- function r(t, o) {
140
- return t instanceof Error ? t.message : o;
141
- }
142
- async function p() {
143
- var s;
144
- const t = window.location.hash;
145
- if (!t) {
146
- l.value = n("connect.review.noToken");
147
- return;
148
- }
149
- const u = new URLSearchParams(t.slice(1)).get("access_token");
150
- if (!u) {
151
- l.value = n("connect.review.noToken");
152
- return;
153
- }
154
- h.value = !0;
155
- try {
156
- const y = await L.getSource(), j = ((s = y == null ? void 0 : y.facebook) == null ? void 0 : s.pages) ?? [], F = await L.connectFacebook(u);
157
- i.value = I((F == null ? void 0 : F.pages) ?? [], j), i.value.length === 0 && (l.value = n("connect.review.facebook.noPages"));
158
- } catch (y) {
159
- l.value = r(y, n("connect.review.facebook.failed"));
160
- } finally {
161
- h.value = !1;
162
- }
163
- }
164
- async function a() {
165
- const t = i.value.filter((o) => o.locations.length > 0).map((o) => ({
166
- facebookPageId: o.facebookPageId,
167
- locationIds: o.locations.map((u) => u._id)
168
- }));
169
- if (t.length === 0) {
170
- l.value = n("connect.review.noMappings");
171
- return;
172
- }
173
- f.value = !0;
174
- try {
175
- await L.updateFacebookPages(t), _.value = !0, setTimeout(() => b.replace("/review"), 2e3);
176
- } catch (o) {
177
- l.value = r(o, n("connect.review.facebook.failed"));
178
- } finally {
179
- f.value = !1;
180
- }
181
- }
182
- return B(p), (t, o) => {
183
- const u = R("FmPageHead");
184
- return d(), g(E, null, [
185
- v(u, {
186
- title: e(n)("connect.navigation.review")
187
- }, null, 8, ["title"]),
188
- m("div", Q, [
189
- e(h) ? (d(), g("div", W, [
190
- v(e(x).FmIcon, {
191
- name: "sync",
192
- size: "xl",
193
- class: "animate-spin text-fm-color-neutral-gray-400"
194
- }),
195
- m("p", X, k(e(n)("connect.review.facebook.fetching")), 1)
196
- ])) : e(_) ? (d(), g("div", Y, [
197
- v(e(x).FmIcon, {
198
- name: "check_circle",
199
- size: "xl",
200
- class: "text-fm-color-typo-success"
201
- }),
202
- m("p", Z, k(e(n)("connect.review.facebook.success")), 1),
203
- m("p", ee, k(e(n)("connect.review.redirecting")), 1)
204
- ])) : e(l) ? (d(), g("div", oe, [
205
- v(e(x).FmIcon, {
206
- name: "error",
207
- size: "xl",
208
- class: "text-fm-color-system-error-500"
209
- }),
210
- m("p", te, k(e(n)("connect.review.errorTitle")), 1),
211
- m("p", ne, k(e(l)), 1),
212
- v(e(x).FmButton, {
213
- label: e(n)("connect.review.goBack"),
214
- onClick: o[0] || (o[0] = (s) => e(b).replace("/review"))
215
- }, null, 8, ["label"])
216
- ])) : e(i).length > 0 ? (d(), g(E, { key: 3 }, [
217
- m("p", ae, k(e(n)("connect.review.facebook.selectPage")), 1),
218
- v(O, {
219
- pages: e(i),
220
- "onUpdate:pages": o[1] || (o[1] = (s) => U(i) ? i.value = s : null)
221
- }, null, 8, ["pages"]),
222
- m("div", se, [
223
- v(e(x).FmButton, {
224
- variant: "outlined",
225
- label: e(n)("connect.review.cancel"),
226
- onClick: o[2] || (o[2] = (s) => e(b).replace("/review"))
227
- }, null, 8, ["label"]),
228
- v(e(x).FmButton, {
229
- label: e(n)("connect.review.connect"),
230
- disabled: !e(w),
231
- loading: e(f),
232
- onClick: a
233
- }, null, 8, ["label", "disabled", "loading"])
234
- ])
235
- ], 64)) : $("", !0)
236
- ])
237
- ], 64);
238
- };
239
- }
240
- });
241
- export {
242
- ge as default
243
- };
@@ -1,208 +0,0 @@
1
- import { defineComponent as S, onMounted as B, ref as h, computed as T, openBlock as d, createElementBlock as v, Fragment as F, renderList as z, normalizeClass as G, unref as e, createElementVNode as m, createVNode as u, toDisplayString as y, createCommentVNode as $, createBlock as P, resolveComponent as R, isRef as U } from "vue";
2
- import { u as V } from "./vue-i18n-CgMK-TaC.js";
3
- import { components as _ } from "@feedmepos/ui-library";
4
- import { r as C } from "./index-COrXX9MR.js";
5
- import { u as A } from "./business-i0Gxk7gG.js";
6
- import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js";
7
- import { useRouter as D } from "vue-router";
8
- const q = { class: "flex flex-col gap-8" }, J = ["onClick"], K = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, O = {
9
- key: 0,
10
- class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
11
- }, Q = /* @__PURE__ */ S({
12
- __name: "GoogleLocationMapping",
13
- props: {
14
- locations: {}
15
- },
16
- emits: ["update:locations"],
17
- setup(N, { emit: a }) {
18
- const x = N, i = a, w = A();
19
- B(() => w.readLocations());
20
- const g = h(null), b = T(() => {
21
- const s = /* @__PURE__ */ new Set();
22
- for (const r of x.locations)
23
- r.locationId && s.add(r.locationId);
24
- return s;
25
- });
26
- function f(s) {
27
- return w.locations.filter((r) => {
28
- const t = r._id.toString();
29
- return !b.value.has(t) || s.locationId === t;
30
- });
31
- }
32
- function k(s, r) {
33
- const t = r._id.toString(), n = x.locations.map((o) => {
34
- if (o.googleLocationName !== s) return o;
35
- const p = o.locationId === t;
36
- return {
37
- ...o,
38
- locationId: p ? null : t,
39
- locationName: p ? null : r.name
40
- };
41
- });
42
- i("update:locations", n);
43
- }
44
- function L(s) {
45
- g.value = g.value === s ? null : s;
46
- }
47
- return (s, r) => (d(), v("div", q, [
48
- (d(!0), v(F, null, z(N.locations, (t) => (d(), v("div", {
49
- key: t.googleLocationName,
50
- class: G([
51
- "rounded-lg border overflow-hidden transition-colors",
52
- e(g) === t.googleLocationName ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
53
- ])
54
- }, [
55
- m("button", {
56
- class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
57
- onClick: (n) => L(t.googleLocationName)
58
- }, [
59
- u(e(_).FmIcon, {
60
- name: "storefront",
61
- class: "text-fm-color-neutral-gray-400 shrink-0"
62
- }),
63
- m("span", K, y(t.displayName || t.googleLocationName), 1),
64
- t.locationName ? (d(), v("span", O, y(t.locationName), 1)) : $("", !0),
65
- u(e(_).FmIcon, {
66
- name: e(g) === t.googleLocationName ? "expand_less" : "expand_more",
67
- class: "text-fm-color-neutral-gray-400 shrink-0"
68
- }, null, 8, ["name"])
69
- ], 8, J),
70
- e(g) === t.googleLocationName ? (d(), P(H, {
71
- key: 0,
72
- locations: f(t),
73
- "selected-ids": t.locationId ? [t.locationId] : [],
74
- onToggle: (n) => k(t.googleLocationName, n)
75
- }, null, 8, ["locations", "selected-ids", "onToggle"])) : $("", !0)
76
- ], 2))), 128))
77
- ]));
78
- }
79
- }), W = { class: "flex flex-col min-h-full gap-16 p-24" }, X = {
80
- key: 0,
81
- class: "flex flex-col items-center justify-center flex-1 gap-16"
82
- }, Y = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Z = {
83
- key: 1,
84
- class: "flex flex-col items-center justify-center flex-1 gap-16"
85
- }, ee = { class: "fm-typo-en-body-lg-600" }, oe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, te = {
86
- key: 2,
87
- class: "flex flex-col items-center justify-center flex-1 gap-16"
88
- }, ne = { class: "fm-typo-en-body-lg-600" }, ae = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, le = { class: "fm-typo-en-body-lg-600" }, se = { class: "flex gap-8 justify-end mt-auto pt-8" }, fe = /* @__PURE__ */ S({
89
- __name: "ReviewGoogleCallback",
90
- setup(N) {
91
- const { t: a } = V(), x = D(), i = h([]), w = h(!1), g = h(!1), b = h(!1), f = h(null), k = T(
92
- () => i.value.some((n) => n.locationId !== null)
93
- );
94
- function L(n, o) {
95
- return n instanceof Error ? n.message : o;
96
- }
97
- function s(n, o) {
98
- const p = new Map(
99
- o.map((l) => [l.googleLocationName, l.location])
100
- );
101
- return n.map((l) => {
102
- const c = p.get(l.googleLocationName) ?? null;
103
- return {
104
- googleLocationName: l.googleLocationName,
105
- displayName: l.displayName,
106
- locationId: (c == null ? void 0 : c._id) ?? null,
107
- locationName: (c == null ? void 0 : c.name) ?? null
108
- };
109
- });
110
- }
111
- async function r() {
112
- var l;
113
- const n = new URLSearchParams(window.location.search), o = n.get("code"), p = n.get("state");
114
- if (!o || !p) {
115
- f.value = a("connect.review.noToken");
116
- return;
117
- }
118
- w.value = !0;
119
- try {
120
- const c = await C.getSource(), E = ((l = c == null ? void 0 : c.google) == null ? void 0 : l.locations) ?? [], M = window.location.pathname.replace(/\/review(?:\/.*)?$/, ""), j = `${window.location.origin}${M}/review/google/callback`, I = await C.connectGoogle(o, j, p);
121
- i.value = s((I == null ? void 0 : I.locations) ?? [], E), i.value.length === 0 && (f.value = a("connect.review.google.noLocations"));
122
- } catch (c) {
123
- f.value = L(c, a("connect.review.google.failed"));
124
- } finally {
125
- w.value = !1;
126
- }
127
- }
128
- async function t() {
129
- const n = i.value.map((o) => ({
130
- googleLocationName: o.googleLocationName,
131
- displayName: o.displayName,
132
- locationId: o.locationId
133
- }));
134
- if (n.length === 0) {
135
- f.value = a("connect.review.noMappings");
136
- return;
137
- }
138
- g.value = !0;
139
- try {
140
- await C.updateGoogleLocations(n), b.value = !0, setTimeout(() => x.replace("/review"), 2e3);
141
- } catch (o) {
142
- f.value = L(o, a("connect.review.google.failed"));
143
- } finally {
144
- g.value = !1;
145
- }
146
- }
147
- return B(r), (n, o) => {
148
- const p = R("FmPageHead");
149
- return d(), v(F, null, [
150
- u(p, {
151
- title: e(a)("connect.navigation.review")
152
- }, null, 8, ["title"]),
153
- m("div", W, [
154
- e(w) ? (d(), v("div", X, [
155
- u(e(_).FmIcon, {
156
- name: "sync",
157
- size: "xl",
158
- class: "animate-spin text-fm-color-neutral-gray-400"
159
- }),
160
- m("p", Y, y(e(a)("connect.review.google.fetching")), 1)
161
- ])) : e(b) ? (d(), v("div", Z, [
162
- u(e(_).FmIcon, {
163
- name: "check_circle",
164
- size: "xl",
165
- class: "text-fm-color-typo-success"
166
- }),
167
- m("p", ee, y(e(a)("connect.review.google.success")), 1),
168
- m("p", oe, y(e(a)("connect.review.redirecting")), 1)
169
- ])) : e(f) ? (d(), v("div", te, [
170
- u(e(_).FmIcon, {
171
- name: "error",
172
- size: "xl",
173
- class: "text-fm-color-system-error-500"
174
- }),
175
- m("p", ne, y(e(a)("connect.review.errorTitle")), 1),
176
- m("p", ae, y(e(f)), 1),
177
- u(e(_).FmButton, {
178
- label: e(a)("connect.review.goBack"),
179
- onClick: o[0] || (o[0] = (l) => e(x).replace("/review"))
180
- }, null, 8, ["label"])
181
- ])) : e(i).length > 0 ? (d(), v(F, { key: 3 }, [
182
- m("p", le, y(e(a)("connect.review.google.selectLocation")), 1),
183
- u(Q, {
184
- locations: e(i),
185
- "onUpdate:locations": o[1] || (o[1] = (l) => U(i) ? i.value = l : null)
186
- }, null, 8, ["locations"]),
187
- m("div", se, [
188
- u(e(_).FmButton, {
189
- variant: "outlined",
190
- label: e(a)("connect.review.cancel"),
191
- onClick: o[2] || (o[2] = (l) => e(x).replace("/review"))
192
- }, null, 8, ["label"]),
193
- u(e(_).FmButton, {
194
- label: e(a)("connect.review.connect"),
195
- disabled: !e(k),
196
- loading: e(g),
197
- onClick: t
198
- }, null, 8, ["label", "disabled", "loading"])
199
- ])
200
- ], 64)) : $("", !0)
201
- ])
202
- ], 64);
203
- };
204
- }
205
- });
206
- export {
207
- fe as default
208
- };
@@ -1,181 +0,0 @@
1
- import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
2
- import { F as D } from "./app-i3r-6ZVm.js";
3
- import "./index-Cl8t41Sk.js";
4
- import { c as E } from "./object-BYyQ0PZp.js";
5
- const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
- __name: "SelectItems",
7
- props: {
8
- initialValue: {
9
- type: Array,
10
- default: () => []
11
- },
12
- filterItems: {
13
- type: Function,
14
- default: void 0
15
- },
16
- onComplete: {
17
- type: Function,
18
- required: !0
19
- },
20
- maxHeight: {
21
- type: [String, Number],
22
- default: 380
23
- }
24
- },
25
- setup(j, { expose: O }) {
26
- const m = j, b = D(), w = f(() => b.menu.value || {
27
- _id: "",
28
- modules: {
29
- catalog: [],
30
- category: [],
31
- item: [],
32
- variant: [],
33
- group: [],
34
- takeaway: [],
35
- scheduler: [],
36
- printDepartment: [],
37
- recipe: [],
38
- sku: [],
39
- unit: [],
40
- cookingGuide: [],
41
- serveSequence: []
42
- }
43
- }), k = f(() => {
44
- const n = m.filterItems ?? ((t) => !!t.category);
45
- return w.value.modules.item.filter(n).reduce((t, l) => {
46
- const a = {
47
- id: l._id,
48
- category: l.category,
49
- name: (l.name2 || l.name).trim()
50
- };
51
- return t = [...t, a], t;
52
- }, []);
53
- }), C = f(() => {
54
- const n = w.value.modules.category.reduce((e, t) => (e[t._id] = {
55
- id: t._id,
56
- name: t.name,
57
- items: {}
58
- }, e), {});
59
- return k.value.reduce(
60
- (e, t) => {
61
- const l = t.category ?? "";
62
- return e[l].items = {
63
- ...e[l].items,
64
- [t.id]: t
65
- }, e;
66
- },
67
- {
68
- ...n,
69
- "": {
70
- id: "",
71
- name: "Addons",
72
- items: {}
73
- }
74
- }
75
- );
76
- }), v = f(() => {
77
- const n = y.value.toLowerCase();
78
- return n ? Object.entries(C.value).reduce((e, [t, l]) => {
79
- if (l.name.toLowerCase().includes(n))
80
- return e[t] = l, e;
81
- const a = Object.entries(l.items).reduce((d, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = o), d), {});
82
- return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
83
- }, {}) : C.value;
84
- }), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
85
- function I(n) {
86
- s.value = k.value.reduce((e, t) => (e[t.id] = n.includes(t.id), e), {});
87
- }
88
- H(async () => {
89
- await b.store.getMenu(), I(m.initialValue);
90
- });
91
- function h(n) {
92
- const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
93
- return t.length ? t.length === e.length ? !0 : null : !1;
94
- }
95
- function U(n) {
96
- const e = Object.keys(v.value[n].items), t = h(n), l = E(s.value);
97
- for (const a of e)
98
- l[a] = t !== !0;
99
- s.value = l;
100
- }
101
- function L(n) {
102
- s.value[n] = !s.value[n];
103
- }
104
- return O({
105
- onConfirm: () => {
106
- const n = Object.entries(s.value).filter(([, e]) => !!e).map(([e]) => e);
107
- m.onComplete(n);
108
- }
109
- }), (n, e) => {
110
- const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), g = _("fm-list");
111
- return c(), u("div", M, [
112
- i(a, {
113
- tag: "div",
114
- clickable: !1
115
- }, {
116
- default: F(() => [
117
- p("div", T, [
118
- p("div", $, [
119
- i(t, {
120
- icon: "sync",
121
- variant: "tertiary",
122
- onClick: e[0] || (e[0] = () => I([]))
123
- }),
124
- p("span", z, q(G.value) + " product(s) selected ", 1)
125
- ]),
126
- i(l, {
127
- modelValue: y.value,
128
- "onUpdate:modelValue": e[1] || (e[1] = (o) => y.value = o),
129
- placeholder: "Search",
130
- "leading-icon": { name: "search", color: "" },
131
- style: { width: "200px", "min-width": "200px" }
132
- }, null, 8, ["modelValue"])
133
- ])
134
- ]),
135
- _: 1
136
- }),
137
- i(g, {
138
- class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
139
- }, {
140
- default: F(() => [
141
- (c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
142
- key: o.id
143
- }, [
144
- Object.keys(o.items).length > 0 ? (c(), u("div", K, [
145
- p("div", J, [
146
- i(d, {
147
- "model-value": h(o.id) ?? !1,
148
- indeterminate: h(o.id) === null,
149
- label: o.name,
150
- value: "",
151
- name: "",
152
- sublabel: "",
153
- class: "w-full",
154
- "onUpdate:modelValue": () => U(o.id)
155
- }, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
156
- ]),
157
- (c(!0), u(x, null, S(o.items, (r) => (c(), u("div", {
158
- key: r.id,
159
- class: "pl-48"
160
- }, [
161
- i(d, {
162
- "model-value": s.value[r.id],
163
- label: r.name,
164
- value: r.id,
165
- name: r.name,
166
- class: "w-full",
167
- "onUpdate:modelValue": () => L(r.id)
168
- }, null, 8, ["model-value", "label", "value", "name", "onUpdate:modelValue"])
169
- ]))), 128))
170
- ])) : B("", !0)
171
- ], 64))), 128))
172
- ]),
173
- _: 1
174
- }, 8, ["class"])
175
- ]);
176
- };
177
- }
178
- });
179
- export {
180
- X as _
181
- };