@feedmepos/mf-connect 0.1.98-beta.3 → 0.1.98-beta.30

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 (123) hide show
  1. package/dist/{App-DEtGn29M.js → App-DUpK_Q7f.js} +808 -665
  2. package/dist/{AuditLogs-Mrm0iq9P.js → AuditLogs-DWYbj4lo.js} +9 -9
  3. package/dist/{Bin-D9Pu0L6h.js → Bin-DieOnDz0.js} +8 -8
  4. package/dist/{Broadcast-BZDQtN8x.js → Broadcast-UQ-vMYLl.js} +39 -36
  5. package/dist/CampaignAnalytic-CfvtyBoa.js +1656 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bxlbz-JW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CuJWOZ3o.js} +6 -5
  7. package/dist/{Card-BdMSuxr4.js → Card-Te7LGbdC.js} +18 -18
  8. package/dist/{Collections-D2IOFKrJ.js → Collections-C-QeTQej.js} +14 -13
  9. package/dist/Credit-B459_0Nt.js +286 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-jmfMQG79.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Dp3i8kku.js} +34 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BYQDCpXN.js → EffectSheet.vue_vue_type_style_index_0_lang-XgrUL64F.js} +6 -6
  12. package/dist/{Experience-Dm5TDsKH.js → Experience-BUiwaqiZ.js} +112 -86
  13. package/dist/{FileSaver.min-G6JMp965.js → FileSaver.min-BBLnxnqN.js} +1 -1
  14. package/dist/Game-iOJbGiNe.js +356 -0
  15. package/dist/{Grab-BXfBhrCM.js → Grab-bC6BeXxc.js} +32 -31
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C7EIMTui.js → ImageInput.vue_vue_type_script_setup_true_lang-eiJJrTiu.js} +1 -1
  17. package/dist/{Index-DfPPobH8.js → Index-Utb2MWAQ.js} +10 -10
  18. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cpx1HMpd.js → LocationPicker.vue_vue_type_script_setup_true_lang-B7iWGh2L.js} +1 -1
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Csse-q2U.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CppfUz1y.js} +1 -1
  20. package/dist/LoyaltyDashboard-BHSHnBpi.js +1345 -0
  21. package/dist/{MainLayout-DxAYEJg1.js → MainLayout-DMqkiGFT.js} +1 -1
  22. package/dist/{Marketing-CPQQG8Y9.js → Marketing-DGfDqW7v.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-ssilnzNw.js → MarketingMaterialEdit-p5QBPd83.js} +6 -6
  24. package/dist/{Member-DmoUk3Dx.js → Member-C2KIOib-.js} +11 -11
  25. package/dist/{MemberList-Cm2BWPrW.js → MemberList-Esp9384f.js} +36 -35
  26. package/dist/{MemberTransactions-Cxr87RMl.js → MemberTransactions-CKYG04pY.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DpUg4Uwi.js → MessageInput.vue_vue_type_script_setup_true_lang-CItc3B3N.js} +5434 -5279
  28. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  29. package/dist/Mission-BlckuFfz.js +360 -0
  30. package/dist/{Overview-CfigslHq.js → Overview-B5PSmDQr.js} +18 -18
  31. package/dist/Overview-suva6hd8.js +1104 -0
  32. package/dist/Point-CVexYech.js +288 -0
  33. package/dist/Promotion-VW7rqIn-.js +423 -0
  34. package/dist/{Queue-B7kxDPZV.js → Queue-Dh4C5OO9.js} +12 -12
  35. package/dist/{Record-BGULqygn.js → Record-CYGrQ_Cb.js} +9 -9
  36. package/dist/Review-mxbjxTB1.js +45 -0
  37. package/dist/ReviewFacebookCallback-C-pSgxeh.js +238 -0
  38. package/dist/ReviewGoogleCallback-CnNbGQdM.js +213 -0
  39. package/dist/{Reward-C0w5c1Th.js → Reward-CQ8AgV1m.js} +16 -16
  40. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CspVlyRZ.js → RewardGroup.vue_vue_type_script_setup_true_lang-DxaejEKe.js} +11 -11
  41. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-QYsK7vE4.js → RuleGroup.vue_vue_type_script_setup_true_lang-CxHheatc.js} +16 -15
  42. package/dist/{Segment-I_p06AoA.js → Segment-Crm395ad.js} +39 -37
  43. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DV79EJm9.js → SelectItems.vue_vue_type_script_setup_true_lang-CnA8A--R.js} +2 -2
  44. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUwwzTTV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dd-mYmBN.js} +12 -12
  45. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D2Nv32U5.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DgkPQA3H.js} +4 -4
  46. package/dist/{Setting-DOMSAMUz.js → Setting-AKRWf4zD.js} +40 -40
  47. package/dist/{SettingAdvertisements-IeGC6PHz.js → SettingAdvertisements-DD9U8S6N.js} +12 -12
  48. package/dist/Settings-D7c8sBA8.js +179 -0
  49. package/dist/{Store-DLzj0qGi.js → Store-BN3RP_u-.js} +21 -21
  50. package/dist/{StoreRewards-BPhAkGNl.js → StoreRewards-BXc96ZMM.js} +15 -15
  51. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DpcaOgdN.js → StoreTransactions.vue_vue_type_script_setup_true_lang-B76NSzNg.js} +190 -187
  52. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DUdAxdEO.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DnhMV2aq.js} +2 -2
  53. package/dist/{Tier-7MveQA4f.js → Tier-Bbktc4H8.js} +36 -34
  54. package/dist/{Title-kyAzLGqm.js → Title-BU8pzF9c.js} +39 -37
  55. package/dist/{Transaction-Chl3d3Ai.js → Transaction-B3_M0MMz.js} +2 -2
  56. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CZsaFtae.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DtFoQXUu.js} +6 -6
  57. package/dist/{Voucher-CxIPPul5.js → Voucher-CJruHWmd.js} +156 -133
  58. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BntA1IAx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DzIQ_1Nb.js} +12 -12
  59. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CiOmadge.js → ZodTextField.vue_vue_type_script_setup_true_lang-Lq5Z_Glg.js} +2 -2
  60. package/dist/{app-5YllsPJi.js → app-CmK_zWVU.js} +3356 -2864
  61. package/dist/app.js +1 -1
  62. package/dist/{business-C0zArPJj.js → business-Br3Sboxg.js} +1 -1
  63. package/dist/campaign-53KorSW_.js +100 -0
  64. package/dist/{campaign-BHl5a5Z1.js → campaign-Dz57HOfP.js} +74 -96
  65. package/dist/{campaign.enum-CHWTkc9k.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  66. package/dist/{campaign.fn-BtwnAETQ.js → campaign.fn-D-J5-IK0.js} +127 -127
  67. package/dist/{collectible.enum-BvoISTK3.js → collectible.enum-Liy2wH3s.js} +1 -1
  68. package/dist/collection.fn-cEP4Vjv6.js +26 -0
  69. package/dist/{duplicateCampaign-C27ikU2f.js → duplicateCampaign-bBnEmbXg.js} +2 -2
  70. package/dist/{effect-CARgKjhU.js → effect-RQs_nrvo.js} +1 -1
  71. package/dist/{email-addresses-CnTsfZHe.js → email-addresses-CAX-uL1B.js} +2 -2
  72. package/dist/{export-CO8-3Ob9.js → export-DSgRDjwv.js} +3 -3
  73. package/dist/google-C3S8u0mT.js +4 -0
  74. package/dist/{helper-C617AZcV.js → helper-DlEUDhaf.js} +1 -1
  75. package/dist/{index-CMfyVF2h.js → index-BA0GllA8.js} +105 -123
  76. package/dist/index-BHdJaRRQ.js +146 -0
  77. package/dist/{index-9AxeGyVh.js → index-BpXYj8xl.js} +272 -369
  78. package/dist/index-C8cXXcLk.js +45 -0
  79. package/dist/{index-Da8trM3D.js → index-CBvgQWbo.js} +1 -1
  80. package/dist/{index-gPrU9b68.js → index-CHmtKN0J.js} +8027 -10766
  81. package/dist/{index-hKv7PcTR.js → index-CJ0Ofs8g.js} +1 -1
  82. package/dist/{index-CFO8nwbC.js → index-CQ40sF6g.js} +8 -7
  83. package/dist/index-C_H8jFYf.js +2743 -0
  84. package/dist/{index-DMvP3cOz.js → index-CbBnibrX.js} +184 -210
  85. package/dist/{index-DIcwj1r2.js → index-Cm4hBY6K.js} +1 -1
  86. package/dist/{index-CtXx42Yb.js → index-D3obFXMZ.js} +1 -1
  87. package/dist/{index-B0BE7PIS.js → index-DJQCoy-g.js} +1 -1
  88. package/dist/{index-DNf6qgpV.js → index-DansV6RZ.js} +2 -2
  89. package/dist/{index-wL9aIsub.js → index-Dpyep_-G.js} +587 -578
  90. package/dist/{index-B2ZvboNZ.js → index-ZFdRmzK7.js} +1 -1
  91. package/dist/{index-CEJgFylS.js → index-fVWfEBZV.js} +26 -17
  92. package/dist/{index.esm2017-BFgbXDc8.js → index.esm2017-GDYw3ujs.js} +105 -105
  93. package/dist/{loading-BxpiUNaf.js → loading-CevzAqpQ.js} +1 -1
  94. package/dist/{lodash-rPOvq9te.js → lodash-CcmP-ZWD.js} +1 -1
  95. package/dist/{membership-lfX5TNVQ.js → membership-CP-ZGC-Y.js} +3 -3
  96. package/dist/{money-CuUoYzPn.js → money-B_CYilsX.js} +1 -1
  97. package/dist/{number-DMk8hvKt.js → number-CqWVPhp0.js} +1 -1
  98. package/dist/objectid-DkTaCd6K.js +145 -0
  99. package/dist/{plugins-CyYjHO_X.js → plugins-Br271boW.js} +3 -3
  100. package/dist/{reward-BxwaSc-X.js → reward-CKQRdG-H.js} +1 -1
  101. package/dist/{rule-76SluGaP.js → rule-D0Rv4CuV.js} +3 -3
  102. package/dist/rule-builder-BUn6UMwW.js +126 -0
  103. package/dist/{template-ByceGw-A.js → template-D5GB4cAl.js} +6 -6
  104. package/dist/timezone-DqRsL54X.js +20 -0
  105. package/dist/{trigger-CxM5x3Sj.js → trigger-Ci92pTJU.js} +5 -5
  106. package/dist/{useMarketingMaterialActions-CHXVZ61f.js → useMarketingMaterialActions-C_mu-ac8.js} +3 -3
  107. package/dist/{usePagination-BKfoMHBB.js → usePagination-CWQ2WXiM.js} +1 -1
  108. package/dist/{user-Cqjv0IpD.js → user-CeAfYeZW.js} +1 -1
  109. package/dist/{vue-i18n-Q-nKu_E3.js → vue-i18n-P_SZNhrt.js} +419 -419
  110. package/dist/{xlsx-D1LobU8O.js → xlsx-CTo0cmDn.js} +1 -1
  111. package/dist/{zod-B5vUvKbD.js → zod-CPa57Pxb.js} +1 -1
  112. package/package.json +3 -3
  113. package/dist/Credit-BWyLeJpj.js +0 -260
  114. package/dist/Game-BB81nS7Y.js +0 -330
  115. package/dist/LoyaltyDashboard-BWC3rDDk.js +0 -1082
  116. package/dist/Mission-ChWPNxbI.js +0 -334
  117. package/dist/Point-Ko81Ny1q.js +0 -262
  118. package/dist/Promotion-CfyscRNN.js +0 -397
  119. package/dist/Review-C7Nx6a5t.js +0 -959
  120. package/dist/ReviewFacebookCallback-DKmL0TYZ.js +0 -243
  121. package/dist/ReviewGoogleCallback-C6iFFEfS.js +0 -208
  122. package/dist/campaign-C_49MeEc.js +0 -219
  123. package/dist/objectid-VPzb0Etb.js +0 -145
@@ -0,0 +1,238 @@
1
+ import { defineComponent as C, computed as M, openBlock as l, createElementBlock as g, normalizeClass as j, createElementVNode as u, createBlock as T, unref as e, toDisplayString as h, createCommentVNode as S, createVNode as y, onMounted as B, ref as P, Fragment as $, renderList as U, resolveComponent as z, isRef as V } from "vue";
2
+ import { u as R } from "./vue-i18n-P_SZNhrt.js";
3
+ import { components as I } from "@feedmepos/ui-library";
4
+ import { r as L } from "./index-fVWfEBZV.js";
5
+ import { u as A } from "./business-Br3Sboxg.js";
6
+ import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-B7iWGh2L.js";
7
+ import { R as D } from "./app-CmK_zWVU.js";
8
+ import { useRouter as G } from "vue-router";
9
+ const O = ["src"], W = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, q = {
10
+ key: 2,
11
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
+ }, J = /* @__PURE__ */ C({
13
+ __name: "FacebookPageConfig",
14
+ props: {
15
+ page: {},
16
+ expanded: { type: Boolean },
17
+ availableLocations: {}
18
+ },
19
+ emits: ["toggleExpand", "toggleLocation"],
20
+ setup(s, { emit: n }) {
21
+ const _ = s, f = n, { t: i } = R(), m = M(() => _.page.locationIds);
22
+ return (w, p) => (l(), g("div", {
23
+ class: j([
24
+ "rounded-lg border overflow-hidden transition-colors",
25
+ s.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
26
+ ])
27
+ }, [
28
+ u("button", {
29
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
30
+ onClick: p[0] || (p[0] = (c) => f("toggleExpand"))
31
+ }, [
32
+ s.page.pageProfileImageUrl ? (l(), g("img", {
33
+ key: 0,
34
+ src: s.page.pageProfileImageUrl,
35
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
+ }, null, 8, O)) : (l(), T(e(I).FmIcon, {
37
+ key: 1,
38
+ name: "thumb_up",
39
+ class: "text-fm-color-neutral-gray-400 shrink-0"
40
+ })),
41
+ u("span", W, h(s.page.pageName), 1),
42
+ s.page.locationIds.length > 0 ? (l(), g("span", q, h(e(i)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : S("", !0),
43
+ y(e(I).FmIcon, {
44
+ name: s.expanded ? "expand_less" : "expand_more",
45
+ class: "text-fm-color-neutral-gray-400 shrink-0"
46
+ }, null, 8, ["name"])
47
+ ]),
48
+ s.expanded ? (l(), T(H, {
49
+ key: 0,
50
+ locations: s.availableLocations,
51
+ "selected-ids": e(m),
52
+ onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
+ }, null, 8, ["locations", "selected-ids"])) : S("", !0)
54
+ ], 2));
55
+ }
56
+ }), K = { class: "flex flex-col gap-8" }, Q = /* @__PURE__ */ C({
57
+ __name: "FacebookPageLocationMapping",
58
+ props: {
59
+ pages: {}
60
+ },
61
+ emits: ["update:pages"],
62
+ setup(s, { emit: n }) {
63
+ const _ = s, f = A();
64
+ B(() => f.readLocations());
65
+ const i = n, m = P(null), w = M(() => {
66
+ const r = /* @__PURE__ */ new Set();
67
+ for (const v of _.pages)
68
+ v.locationIds.forEach((a) => r.add(a));
69
+ return r;
70
+ });
71
+ function p(r) {
72
+ const v = new Set(r.locationIds);
73
+ return f.locations.filter((a) => {
74
+ const b = a._id.toString();
75
+ return !w.value.has(b) || v.has(b);
76
+ });
77
+ }
78
+ function c(r, v) {
79
+ const a = v._id.toString(), b = _.pages.map((o) => {
80
+ if (o.facebookPageId !== r) return o;
81
+ const t = o.locationIds.includes(a);
82
+ return {
83
+ ...o,
84
+ locationIds: t ? o.locationIds.filter((k) => k !== a) : [...o.locationIds, a]
85
+ };
86
+ });
87
+ i("update:pages", b);
88
+ }
89
+ function F(r) {
90
+ m.value = m.value === r ? null : r;
91
+ }
92
+ return (r, v) => (l(), g("div", K, [
93
+ (l(!0), g($, null, U(s.pages, (a) => (l(), T(J, {
94
+ key: a.facebookPageId,
95
+ page: a,
96
+ expanded: e(m) === a.facebookPageId,
97
+ "available-locations": p(a),
98
+ onToggleExpand: (b) => F(a.facebookPageId),
99
+ onToggleLocation: (b) => c(a.facebookPageId, b)
100
+ }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
+ ]));
102
+ }
103
+ }), X = { class: "flex flex-col min-h-full gap-16 p-24" }, Y = {
104
+ key: 0,
105
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
106
+ }, Z = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ee = {
107
+ key: 1,
108
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
109
+ }, oe = { class: "fm-typo-en-body-lg-600" }, te = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ne = {
110
+ key: 2,
111
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
112
+ }, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, le = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ C({
113
+ __name: "ReviewFacebookCallback",
114
+ setup(s) {
115
+ const { t: n } = R(), _ = G();
116
+ function f() {
117
+ return _.replace({ name: D["$connect-REVIEW_SETTINGS"] });
118
+ }
119
+ const i = P([]), m = P(!1), w = P(!1), p = P(!1), c = P(null), F = M(
120
+ () => i.value.some((o) => o.locationIds.length > 0)
121
+ );
122
+ function r(o, t) {
123
+ const k = new Map(
124
+ t.map((d) => [d.facebookPageId, d])
125
+ );
126
+ return o.map((d) => {
127
+ var x;
128
+ return {
129
+ ...d,
130
+ locationIds: ((x = k.get(d.facebookPageId)) == null ? void 0 : x.locationIds) ?? []
131
+ };
132
+ });
133
+ }
134
+ function v(o, t) {
135
+ return o instanceof Error ? o.message : t;
136
+ }
137
+ async function a() {
138
+ var d;
139
+ const o = window.location.hash;
140
+ if (!o) {
141
+ c.value = n("connect.review.noToken");
142
+ return;
143
+ }
144
+ const k = new URLSearchParams(o.slice(1)).get("access_token");
145
+ if (!k) {
146
+ c.value = n("connect.review.noToken");
147
+ return;
148
+ }
149
+ m.value = !0;
150
+ try {
151
+ const x = await L.getSource(), N = ((d = x == null ? void 0 : x.facebook) == null ? void 0 : d.pages) ?? [], E = await L.connectFacebook(k);
152
+ i.value = r((E == null ? void 0 : E.pages) ?? [], N), i.value.length === 0 && (c.value = n("connect.review.facebook.noPages"));
153
+ } catch (x) {
154
+ c.value = v(x, n("connect.review.facebook.failed"));
155
+ } finally {
156
+ m.value = !1;
157
+ }
158
+ }
159
+ async function b() {
160
+ const o = i.value.filter((t) => t.locationIds.length > 0).map((t) => ({
161
+ facebookPageId: t.facebookPageId,
162
+ locationIds: t.locationIds
163
+ }));
164
+ if (o.length === 0) {
165
+ c.value = n("connect.review.noMappings");
166
+ return;
167
+ }
168
+ w.value = !0;
169
+ try {
170
+ await L.updateFacebookPages(o), p.value = !0, setTimeout(f, 2e3);
171
+ } catch (t) {
172
+ c.value = v(t, n("connect.review.facebook.failed"));
173
+ } finally {
174
+ w.value = !1;
175
+ }
176
+ }
177
+ return B(a), (o, t) => {
178
+ const k = z("FmPageHead");
179
+ return l(), g($, null, [
180
+ y(k, {
181
+ title: e(n)("connect.navigation.review")
182
+ }, null, 8, ["title"]),
183
+ u("div", X, [
184
+ e(m) ? (l(), g("div", Y, [
185
+ y(e(I).FmIcon, {
186
+ name: "sync",
187
+ size: "xl",
188
+ class: "animate-spin text-fm-color-neutral-gray-400"
189
+ }),
190
+ u("p", Z, h(e(n)("connect.review.facebook.fetching")), 1)
191
+ ])) : e(p) ? (l(), g("div", ee, [
192
+ y(e(I).FmIcon, {
193
+ name: "check_circle",
194
+ size: "xl",
195
+ class: "text-fm-color-typo-success"
196
+ }),
197
+ u("p", oe, h(e(n)("connect.review.facebook.success")), 1),
198
+ u("p", te, h(e(n)("connect.review.redirecting")), 1)
199
+ ])) : e(c) ? (l(), g("div", ne, [
200
+ y(e(I).FmIcon, {
201
+ name: "error",
202
+ size: "xl",
203
+ class: "text-fm-color-system-error-500"
204
+ }),
205
+ u("p", ae, h(e(n)("connect.review.errorTitle")), 1),
206
+ u("p", se, h(e(c)), 1),
207
+ y(e(I).FmButton, {
208
+ label: e(n)("connect.review.goBack"),
209
+ onClick: t[0] || (t[0] = (d) => f())
210
+ }, null, 8, ["label"])
211
+ ])) : e(i).length > 0 ? (l(), g($, { key: 3 }, [
212
+ u("p", ce, h(e(n)("connect.review.facebook.selectPage")), 1),
213
+ y(Q, {
214
+ pages: e(i),
215
+ "onUpdate:pages": t[1] || (t[1] = (d) => V(i) ? i.value = d : null)
216
+ }, null, 8, ["pages"]),
217
+ u("div", le, [
218
+ y(e(I).FmButton, {
219
+ variant: "outlined",
220
+ label: e(n)("connect.review.cancel"),
221
+ onClick: t[2] || (t[2] = (d) => f())
222
+ }, null, 8, ["label"]),
223
+ y(e(I).FmButton, {
224
+ label: e(n)("connect.review.connect"),
225
+ disabled: !e(F),
226
+ loading: e(w),
227
+ onClick: b
228
+ }, null, 8, ["label", "disabled", "loading"])
229
+ ])
230
+ ], 64)) : S("", !0)
231
+ ])
232
+ ], 64);
233
+ };
234
+ }
235
+ });
236
+ export {
237
+ ve as default
238
+ };
@@ -0,0 +1,213 @@
1
+ import { defineComponent as E, onMounted as T, ref as w, computed as B, openBlock as d, createElementBlock as p, Fragment as F, renderList as j, normalizeClass as z, unref as e, createElementVNode as m, createVNode as u, toDisplayString as y, createCommentVNode as S, createBlock as P, resolveComponent as U, isRef as V } from "vue";
2
+ import { u as A } from "./vue-i18n-P_SZNhrt.js";
3
+ import { components as v } from "@feedmepos/ui-library";
4
+ import { r as C } from "./index-fVWfEBZV.js";
5
+ import { u as H } from "./business-Br3Sboxg.js";
6
+ import { _ as D } from "./LocationPicker.vue_vue_type_script_setup_true_lang-B7iWGh2L.js";
7
+ import { R as O } from "./app-CmK_zWVU.js";
8
+ import { useRouter as W } from "vue-router";
9
+ const q = { class: "flex flex-col gap-8" }, J = ["onClick"], K = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, Q = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
+ }, X = /* @__PURE__ */ E({
13
+ __name: "GoogleLocationMapping",
14
+ props: {
15
+ locations: {}
16
+ },
17
+ emits: ["update:locations"],
18
+ setup(k, { emit: a }) {
19
+ const N = k, b = a, i = H();
20
+ T(() => i.readLocations());
21
+ const g = w(null), h = B(() => {
22
+ const l = /* @__PURE__ */ new Set();
23
+ for (const r of N.locations)
24
+ r.locationId && l.add(r.locationId);
25
+ return l;
26
+ });
27
+ function L(l) {
28
+ return i.locations.filter((r) => {
29
+ const t = r._id.toString();
30
+ return !h.value.has(t) || l.locationId === t;
31
+ });
32
+ }
33
+ function f(l, r) {
34
+ const t = r._id.toString(), _ = N.locations.map((n) => {
35
+ if (n.googleLocationName !== l) return n;
36
+ const o = n.locationId === t;
37
+ return {
38
+ ...n,
39
+ locationId: o ? null : t,
40
+ locationName: o ? null : r.name
41
+ };
42
+ });
43
+ b("update:locations", _);
44
+ }
45
+ function I(l) {
46
+ g.value = g.value === l ? null : l;
47
+ }
48
+ return (l, r) => (d(), p("div", q, [
49
+ (d(!0), p(F, null, j(k.locations, (t) => (d(), p("div", {
50
+ key: t.googleLocationName,
51
+ class: z([
52
+ "rounded-lg border overflow-hidden transition-colors",
53
+ e(g) === t.googleLocationName ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
54
+ ])
55
+ }, [
56
+ m("button", {
57
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
58
+ onClick: (_) => I(t.googleLocationName)
59
+ }, [
60
+ u(e(v).FmIcon, {
61
+ name: "storefront",
62
+ class: "text-fm-color-neutral-gray-400 shrink-0"
63
+ }),
64
+ m("span", K, y(t.displayName || t.googleLocationName), 1),
65
+ t.locationName ? (d(), p("span", Q, y(t.locationName), 1)) : S("", !0),
66
+ u(e(v).FmIcon, {
67
+ name: e(g) === t.googleLocationName ? "expand_less" : "expand_more",
68
+ class: "text-fm-color-neutral-gray-400 shrink-0"
69
+ }, null, 8, ["name"])
70
+ ], 8, J),
71
+ e(g) === t.googleLocationName ? (d(), P(D, {
72
+ key: 0,
73
+ locations: L(t),
74
+ "selected-ids": t.locationId ? [t.locationId] : [],
75
+ onToggle: (_) => f(t.googleLocationName, _)
76
+ }, null, 8, ["locations", "selected-ids", "onToggle"])) : S("", !0)
77
+ ], 2))), 128))
78
+ ]));
79
+ }
80
+ }), Y = { class: "flex flex-col min-h-full gap-16 p-24" }, Z = {
81
+ key: 0,
82
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
83
+ }, ee = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, oe = {
84
+ key: 1,
85
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
86
+ }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ae = {
87
+ key: 2,
88
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
89
+ }, le = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, ie = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ E({
90
+ __name: "ReviewGoogleCallback",
91
+ setup(k) {
92
+ const { t: a } = A(), N = W();
93
+ function b() {
94
+ return N.replace({ name: O["$connect-REVIEW_SETTINGS"] });
95
+ }
96
+ const i = w([]), g = w(!1), h = w(!1), L = w(!1), f = w(null), I = B(
97
+ () => i.value.some((n) => n.locationId !== null)
98
+ );
99
+ function l(n, o) {
100
+ return n instanceof Error ? n.message : o;
101
+ }
102
+ function r(n, o) {
103
+ const x = new Map(
104
+ o.map((s) => [s.googleLocationName, s.location])
105
+ );
106
+ return n.map((s) => {
107
+ const c = x.get(s.googleLocationName) ?? null;
108
+ return {
109
+ googleLocationName: s.googleLocationName,
110
+ displayName: s.displayName,
111
+ locationId: (c == null ? void 0 : c._id) ?? null,
112
+ locationName: (c == null ? void 0 : c.name) ?? null
113
+ };
114
+ });
115
+ }
116
+ async function t() {
117
+ var s;
118
+ const n = new URLSearchParams(window.location.search), o = n.get("code"), x = n.get("state");
119
+ if (!o || !x) {
120
+ f.value = a("connect.review.noToken");
121
+ return;
122
+ }
123
+ g.value = !0;
124
+ try {
125
+ const c = await C.getSource(), R = ((s = c == null ? void 0 : c.google) == null ? void 0 : s.locations) ?? [], M = window.location.pathname.replace(/\/review(?:\/.*)?$/, ""), G = `${window.location.origin}${M}/review/google/callback`, $ = await C.connectGoogle(o, G, x);
126
+ i.value = r(($ == null ? void 0 : $.locations) ?? [], R), i.value.length === 0 && (f.value = a("connect.review.google.noLocations"));
127
+ } catch (c) {
128
+ f.value = l(c, a("connect.review.google.failed"));
129
+ } finally {
130
+ g.value = !1;
131
+ }
132
+ }
133
+ async function _() {
134
+ const n = i.value.map((o) => ({
135
+ googleLocationName: o.googleLocationName,
136
+ displayName: o.displayName,
137
+ locationId: o.locationId
138
+ }));
139
+ if (n.length === 0) {
140
+ f.value = a("connect.review.noMappings");
141
+ return;
142
+ }
143
+ h.value = !0;
144
+ try {
145
+ await C.updateGoogleLocations(n), L.value = !0, setTimeout(b, 2e3);
146
+ } catch (o) {
147
+ f.value = l(o, a("connect.review.google.failed"));
148
+ } finally {
149
+ h.value = !1;
150
+ }
151
+ }
152
+ return T(t), (n, o) => {
153
+ const x = U("FmPageHead");
154
+ return d(), p(F, null, [
155
+ u(x, {
156
+ title: e(a)("connect.navigation.review")
157
+ }, null, 8, ["title"]),
158
+ m("div", Y, [
159
+ e(g) ? (d(), p("div", Z, [
160
+ u(e(v).FmIcon, {
161
+ name: "sync",
162
+ size: "xl",
163
+ class: "animate-spin text-fm-color-neutral-gray-400"
164
+ }),
165
+ m("p", ee, y(e(a)("connect.review.google.fetching")), 1)
166
+ ])) : e(L) ? (d(), p("div", oe, [
167
+ u(e(v).FmIcon, {
168
+ name: "check_circle",
169
+ size: "xl",
170
+ class: "text-fm-color-typo-success"
171
+ }),
172
+ m("p", te, y(e(a)("connect.review.google.success")), 1),
173
+ m("p", ne, y(e(a)("connect.review.redirecting")), 1)
174
+ ])) : e(f) ? (d(), p("div", ae, [
175
+ u(e(v).FmIcon, {
176
+ name: "error",
177
+ size: "xl",
178
+ class: "text-fm-color-system-error-500"
179
+ }),
180
+ m("p", le, y(e(a)("connect.review.errorTitle")), 1),
181
+ m("p", se, y(e(f)), 1),
182
+ u(e(v).FmButton, {
183
+ label: e(a)("connect.review.goBack"),
184
+ onClick: o[0] || (o[0] = (s) => b())
185
+ }, null, 8, ["label"])
186
+ ])) : e(i).length > 0 ? (d(), p(F, { key: 3 }, [
187
+ m("p", ce, y(e(a)("connect.review.google.selectLocation")), 1),
188
+ u(X, {
189
+ locations: e(i),
190
+ "onUpdate:locations": o[1] || (o[1] = (s) => V(i) ? i.value = s : null)
191
+ }, null, 8, ["locations"]),
192
+ m("div", ie, [
193
+ u(e(v).FmButton, {
194
+ variant: "outlined",
195
+ label: e(a)("connect.review.cancel"),
196
+ onClick: o[2] || (o[2] = (s) => b())
197
+ }, null, 8, ["label"]),
198
+ u(e(v).FmButton, {
199
+ label: e(a)("connect.review.connect"),
200
+ disabled: !e(I),
201
+ loading: e(h),
202
+ onClick: _
203
+ }, null, 8, ["label", "disabled", "loading"])
204
+ ])
205
+ ], 64)) : S("", !0)
206
+ ])
207
+ ], 64);
208
+ };
209
+ }
210
+ });
211
+ export {
212
+ ve as default
213
+ };
@@ -1,26 +1,26 @@
1
1
  import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as O, onMounted as q, toDisplayString as B } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as Q, components as L } from "@feedmepos/ui-library";
4
- import { u as G } from "./loading-BxpiUNaf.js";
5
- import { u as J, C as ee } from "./membership-lfX5TNVQ.js";
6
- import { f as j, p as te } from "./plugins-CyYjHO_X.js";
7
- import { u as oe } from "./vue-i18n-Q-nKu_E3.js";
4
+ import { u as G } from "./loading-CevzAqpQ.js";
5
+ import { u as J, C as ee } from "./membership-CP-ZGC-Y.js";
6
+ import { f as j, p as te } from "./plugins-Br271boW.js";
7
+ import { u as oe } from "./vue-i18n-P_SZNhrt.js";
8
8
  import { c as ae } from "./object-BYyQ0PZp.js";
9
- import { Z as _ } from "./zod-B5vUvKbD.js";
10
- import "./index-wL9aIsub.js";
11
- import { F as N } from "./index-CFO8nwbC.js";
9
+ import { Z as _ } from "./zod-CPa57Pxb.js";
10
+ import "./index-Dpyep_-G.js";
11
+ import { F as N } from "./index-CQ40sF6g.js";
12
12
  import { useCoreStore as le } from "@feedmepos/mf-common";
13
- import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BntA1IAx.js";
14
- import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-BYQDCpXN.js";
13
+ import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DzIQ_1Nb.js";
14
+ import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-XgrUL64F.js";
15
15
  import { J as K } from "./JsonViewer-v8_C7l5N.js";
16
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CiOmadge.js";
17
- import { i as de } from "./helper-C617AZcV.js";
18
- import { u as pe, r as P } from "./reward-BxwaSc-X.js";
19
- import "./index-CtXx42Yb.js";
20
- import { C as ce } from "./campaign.fn-BtwnAETQ.js";
21
- import { e as me } from "./effect-CARgKjhU.js";
16
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Lq5Z_Glg.js";
17
+ import { i as de } from "./helper-DlEUDhaf.js";
18
+ import { u as pe, r as P } from "./reward-CKQRdG-H.js";
19
+ import "./index-D3obFXMZ.js";
20
+ import { C as ce } from "./campaign.fn-D-J5-IK0.js";
21
+ import { e as me } from "./effect-RQs_nrvo.js";
22
22
  import { useRouter as ue } from "vue-router";
23
- import { R as ye } from "./app-5YllsPJi.js";
23
+ import { R as ye } from "./app-CmK_zWVU.js";
24
24
  const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
25
25
  __name: "EditRewardSheet",
26
26
  emits: ["update"],
@@ -1,18 +1,18 @@
1
1
  import { ref as p, defineComponent as T, computed as x, resolveComponent as y, openBlock as U, createBlock as G, unref as e, isRef as $, withCtx as b, createElementVNode as v, createVNode as u, toDisplayString as j } from "vue";
2
- import { u as B } from "./loading-BxpiUNaf.js";
2
+ import { u as B } from "./loading-CevzAqpQ.js";
3
3
  import { J as P } from "./JsonViewer-v8_C7l5N.js";
4
- import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CiOmadge.js";
5
- import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CZsaFtae.js";
6
- import { Z as L } from "./zod-B5vUvKbD.js";
4
+ import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Lq5Z_Glg.js";
5
+ import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DtFoQXUu.js";
6
+ import { Z as L } from "./zod-CPa57Pxb.js";
7
7
  import { u as V } from "./app-wDQR6dpb.js";
8
8
  import { defineStore as N } from "pinia";
9
- import { r as k } from "./index-Da8trM3D.js";
10
- import { d as E } from "./index-9AxeGyVh.js";
11
- import "./index-DMvP3cOz.js";
12
- import "./index-wL9aIsub.js";
13
- import "./index-gPrU9b68.js";
14
- import "./index-CFO8nwbC.js";
15
- import { u as J } from "./vue-i18n-Q-nKu_E3.js";
9
+ import { r as k } from "./index-CBvgQWbo.js";
10
+ import { c as E } from "./index-BpXYj8xl.js";
11
+ import "./index-CbBnibrX.js";
12
+ import "./index-Dpyep_-G.js";
13
+ import "./index-CHmtKN0J.js";
14
+ import "./index-CQ40sF6g.js";
15
+ import { u as J } from "./vue-i18n-P_SZNhrt.js";
16
16
  import { c as C } from "./object-BYyQ0PZp.js";
17
17
  import { useDialog as Z } from "@feedmepos/ui-library";
18
18
  const A = N("mf-connect-referral", () => {
@@ -1,21 +1,22 @@
1
1
  import { defineComponent as P, computed as M, resolveComponent as k, openBlock as r, createElementBlock as V, createElementVNode as C, createVNode as v, unref as e, createTextVNode as ne, toDisplayString as A, withCtx as B, onMounted as Z, createBlock as g, createCommentVNode as N, ref as W, watch as pe, Fragment as q, renderList as $, normalizeClass as K, resolveDynamicComponent as me, onBeforeMount as ce, isRef as fe, createSlots as ye } from "vue";
2
- import { m as ge, C as _e, n as ke, a as he, o as Ee } from "./index-wL9aIsub.js";
3
- import { R as Y, a as Ve } from "./index-9AxeGyVh.js";
2
+ import { m as ge, C as _e, n as ke, a as he, o as Ee } from "./index-Dpyep_-G.js";
3
+ import { R as Y, a as Ve } from "./rule-builder-BUn6UMwW.js";
4
4
  import { useDialog as ue, useDialogChild as ve, useSnackbar as Te } from "@feedmepos/ui-library";
5
- import { u as G } from "./vue-i18n-Q-nKu_E3.js";
6
- import { a as Se, R as w, S as Fe, C as j, g as xe, W as Re, T as ie, O as de } from "./rule-76SluGaP.js";
7
- import { p as Ue } from "./plugins-CyYjHO_X.js";
5
+ import { u as G } from "./vue-i18n-P_SZNhrt.js";
6
+ import { a as Se, R as w, S as Fe, C as j, g as xe, W as Re, T as ie, O as de } from "./rule-D0Rv4CuV.js";
7
+ import { p as Ue } from "./plugins-Br271boW.js";
8
8
  import { h as ae } from "./moment-D7p2TMB-.js";
9
- import { z as Ce } from "./app-5YllsPJi.js";
10
- import { u as X } from "./membership-lfX5TNVQ.js";
11
- import { u as te } from "./business-C0zArPJj.js";
12
- import "./index-gPrU9b68.js";
9
+ import { z as Ce } from "./app-CmK_zWVU.js";
10
+ import { u as X } from "./membership-CP-ZGC-Y.js";
11
+ import { u as te } from "./business-Br3Sboxg.js";
12
+ import "./index-CHmtKN0J.js";
13
13
  import { _ as O } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
14
14
  import { c as be } from "./object-BYyQ0PZp.js";
15
- import { Z as le } from "./zod-B5vUvKbD.js";
16
- import { _ as Ye } from "./SelectItems.vue_vue_type_script_setup_true_lang-DV79EJm9.js";
17
- import "./index-DMvP3cOz.js";
18
- import "./index-CFO8nwbC.js";
15
+ import { Z as le } from "./zod-CPa57Pxb.js";
16
+ import { _ as Ye } from "./SelectItems.vue_vue_type_script_setup_true_lang-CnA8A--R.js";
17
+ import "./index-BpXYj8xl.js";
18
+ import "./index-CbBnibrX.js";
19
+ import "./index-CQ40sF6g.js";
19
20
  const Oe = { class: "flex items-center justify-between" }, De = { class: "flex items-center gap-8 xs:flex-wrap" }, we = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, qe = /* @__PURE__ */ P({
20
21
  __name: "RuleEntry",
21
22
  props: {
@@ -1819,7 +1820,7 @@ const Be = [
1819
1820
  });
1820
1821
  };
1821
1822
  }
1822
- }), Vt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $t = /* @__PURE__ */ P({
1823
+ }), Vt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ht = /* @__PURE__ */ P({
1823
1824
  __name: "RuleGroup",
1824
1825
  props: {
1825
1826
  triggerType: {
@@ -1906,6 +1907,6 @@ const Be = [
1906
1907
  }
1907
1908
  });
1908
1909
  export {
1909
- $t as _,
1910
+ Ht as _,
1910
1911
  re as a
1911
1912
  };