@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,39 +0,0 @@
1
- import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
2
- import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-Bb2sTsuA.js";
3
- import { u as C } from "./vue-i18n-CgMK-TaC.js";
4
- const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
5
- __name: "Transaction",
6
- setup(V) {
7
- const { t: n } = C(), a = [
8
- {
9
- label: n("connect.transaction.tabs.collection"),
10
- value: "collection"
11
- },
12
- {
13
- label: n("connect.transaction.tabs.store"),
14
- value: "store"
15
- }
16
- ], e = f(a[0]);
17
- return (B, c) => {
18
- const i = s("FmPageHead"), u = s("FmTabs");
19
- return t(), v(b, null, [
20
- r(i, {
21
- title: o(n)("connect.transaction.title")
22
- }, null, 8, ["title"]),
23
- k("div", T, [
24
- r(u, {
25
- "model-value": o(e).value,
26
- items: a,
27
- "onUpdate:modelValue": c[0] || (c[0] = (p) => e.value = a.find((_) => _.value === p))
28
- }, null, 8, ["model-value"]),
29
- (t(), l(x, null, [
30
- o(e).value == "collection" ? (t(), l(m(g), { key: 0 })) : o(e).value == "store" ? (t(), l(m(y), { key: 1 })) : F("", !0)
31
- ], 1024))
32
- ])
33
- ], 64);
34
- };
35
- }
36
- });
37
- export {
38
- P as default
39
- };
@@ -1,219 +0,0 @@
1
- import { defineStore as w } from "pinia";
2
- import { reactive as I, onMounted as b, ref as o } from "vue";
3
- import { g as a, S as l, b as d } from "./index-CWiaP-aV.js";
4
- const s = () => {
5
- const e = l.getBusinessId();
6
- if (!e) throw new Error("Invalid business ID");
7
- return d(`businesses/${e}/campaigns`, {
8
- // url: 'http://localhost:3000/portal/',
9
- });
10
- }, u = {
11
- async readAllGrouped(e) {
12
- const t = a(
13
- await s().get("grouped", { params: e })
14
- );
15
- return {
16
- meta: t.meta,
17
- resources: t.resources
18
- };
19
- },
20
- async readAll(e, t) {
21
- const n = a(
22
- await s().get("", {
23
- params: { ...e, ...t }
24
- })
25
- );
26
- return {
27
- meta: n.meta,
28
- resources: n.resources
29
- };
30
- },
31
- async readById(e) {
32
- return a(await s().get(`/${e}`));
33
- },
34
- async create(e) {
35
- return a(await s().post("", e));
36
- },
37
- async update(e, t) {
38
- return a(await s().put(e, t));
39
- },
40
- async delete(e) {
41
- return a(await s().delete(e));
42
- },
43
- async readCollectionsByCampaignId(e, t) {
44
- const n = a(
45
- await s().get(`/${e}/collections`, {
46
- params: t
47
- })
48
- );
49
- return {
50
- meta: n.meta,
51
- resources: n.resources
52
- };
53
- },
54
- async readTransactions(e) {
55
- return a(
56
- await s().get(
57
- `/${e}/collections/transactions`
58
- )
59
- );
60
- },
61
- async createCollectionByCampaignId(e, t) {
62
- return a(
63
- await s().post(`/${e}/collections`, t)
64
- );
65
- },
66
- async readGroups() {
67
- return a(await s().get("/groups")) ?? [];
68
- },
69
- async readStats(e) {
70
- return a(
71
- await s().get("/stats", { params: e })
72
- );
73
- },
74
- async createGroup(e) {
75
- return a(await s().post("/groups", e));
76
- },
77
- async updateGroup(e, t) {
78
- return a(
79
- await s().put(`/groups/${e}`, t)
80
- );
81
- },
82
- async deleteGroup(e) {
83
- return a(await s().delete(`/groups/${e}`));
84
- },
85
- async sendCollection(e, t) {
86
- return a(
87
- await s().post(
88
- `/${e}/collections/send`,
89
- t
90
- )
91
- );
92
- },
93
- async sendStamp(e, t) {
94
- return a(
95
- await s().post(
96
- `/${e}/collections/send-stamp`,
97
- t
98
- )
99
- );
100
- },
101
- async syncAllPromotion() {
102
- return a(await s().post("/promotion/sync"));
103
- },
104
- async readAllDeleted(e, t) {
105
- const n = a(
106
- await s().get("/bin", {
107
- params: { ...e, ...t }
108
- })
109
- );
110
- return {
111
- meta: n.meta,
112
- resources: n.resources
113
- };
114
- },
115
- async restore(e) {
116
- return a(
117
- await s().post(`/${e}/restore`)
118
- );
119
- },
120
- async getPromotionQueue() {
121
- return a(await s().get("/promotion/queue"));
122
- }
123
- }, p = () => {
124
- const e = l.getBusinessId();
125
- if (!e) throw new Error("Invalid business ID");
126
- return d(`businesses/${e}/campaigns`, {
127
- noIdRequired: !0
128
- });
129
- }, f = {
130
- async readAll() {
131
- return a(await p().get("templates"));
132
- },
133
- async readById(e) {
134
- return a(
135
- await p().get(`templates/${e}`)
136
- );
137
- }
138
- }, E = w("mf-connect-campaign", () => {
139
- const e = I({
140
- promotion: [],
141
- voucher: [],
142
- broadcast: [],
143
- experience: [],
144
- point: [],
145
- credit: [],
146
- token: [],
147
- mission: [],
148
- grab: [],
149
- all: []
150
- });
151
- b(() => {
152
- console.log("🔧 CampaignStore Installed");
153
- });
154
- const t = o([]), n = o([]), c = o([]);
155
- async function m(h) {
156
- const i = await u.readAll({
157
- limit: 1e3,
158
- skip: 0,
159
- sortBy: "_id",
160
- descending: !0
161
- });
162
- Object.keys(e).forEach((r) => {
163
- e[r] = [];
164
- }), e.all = i.resources.filter(
165
- (r) => r.type !== "MEMBERSHIP"
166
- );
167
- for (const r of i.resources)
168
- switch (r.type) {
169
- case "PROMOTION":
170
- e.promotion.push(r);
171
- break;
172
- case "VOUCHER":
173
- e.voucher.push(r), c.value.push(r);
174
- break;
175
- case "BROADCAST":
176
- ["SCHEDULE", "FEEDBACK"].includes(r.event.type) && e.broadcast.push(r);
177
- break;
178
- case "POINT":
179
- e.experience.push(r);
180
- break;
181
- case "COIN":
182
- e.point.push(r);
183
- break;
184
- case "CREDIT":
185
- e.credit.push(r);
186
- break;
187
- case "GAME":
188
- e.token.push(r);
189
- break;
190
- case "MISSION":
191
- e.mission.push(r);
192
- break;
193
- case "GRAB":
194
- e.grab.push(r);
195
- break;
196
- }
197
- }
198
- async function g() {
199
- n.value = await u.readGroups();
200
- }
201
- async function y() {
202
- t.value = await f.readAll();
203
- }
204
- return {
205
- // State
206
- campaigns: e,
207
- templates: t,
208
- groups: n,
209
- voucher: c,
210
- // Actions
211
- read: m,
212
- readGroups: g,
213
- readTemplates: y
214
- };
215
- });
216
- export {
217
- u as c,
218
- E as u
219
- };
@@ -1,277 +0,0 @@
1
- import "./index-CB7ytKOE.js";
2
- import "./index-Cl8t41Sk.js";
3
- import { h as s } from "./moment-D7p2TMB-.js";
4
- import "./index-DgzNGQgE.js";
5
- import { e as f } from "./effect-DM4AzeQl.js";
6
- import { components as l } from "@feedmepos/ui-library";
7
- import { i as h } from "./index-BrboOmPq.js";
8
- import { c as O } from "./rule-RVvPtAnk.js";
9
- import { u as C } from "./business-i0Gxk7gG.js";
10
- import { C as m } from "./campaign.fn-BjHSIDd1.js";
11
- import { c as g } from "./string-Gcy5IM_H.js";
12
- import { i as d } from "./plugins-D25PaNJk.js";
13
- import { h as p } from "vue";
14
- import { F as a } from "./campaign.enum-CbUTfxek.js";
15
- function E(e) {
16
- switch (e) {
17
- case "PROMOTION":
18
- return "Promotion";
19
- case "VOUCHER":
20
- return "Voucher";
21
- case "CREDIT":
22
- return "Credit";
23
- case "POINT":
24
- return "Experience";
25
- case "COIN":
26
- return "Point";
27
- case "GAME":
28
- return "Game";
29
- default:
30
- return e;
31
- }
32
- }
33
- const G = {
34
- formattedType: E
35
- }, o = d.global.t;
36
- function I() {
37
- const e = d.global.locale;
38
- return typeof e == "string" ? e : e.value;
39
- }
40
- function u(e) {
41
- return new Intl.DateTimeFormat(I(), {
42
- day: "2-digit",
43
- month: "short",
44
- year: "numeric"
45
- }).format(new Date(e));
46
- }
47
- function c(e) {
48
- return p(
49
- "div",
50
- {
51
- class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
52
- },
53
- [
54
- p(l.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
55
- p("span", { class: "fm-typo-en-body-md-600" }, e.name)
56
- ]
57
- );
58
- }
59
- const H = {
60
- [a.enum.CREDIT]: {
61
- chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
62
- icon: "local_activity",
63
- get name() {
64
- return o("connect.campaign.common.typeName.CREDIT");
65
- },
66
- chip() {
67
- return c(this);
68
- }
69
- },
70
- [a.enum.PROMOTION]: {
71
- chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
72
- icon: "loyalty",
73
- get name() {
74
- return o("connect.campaign.common.typeName.PROMOTION");
75
- },
76
- chip() {
77
- return c(this);
78
- }
79
- },
80
- [a.enum.VOUCHER]: {
81
- chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
82
- icon: "sell",
83
- get name() {
84
- return o("connect.campaign.common.typeName.VOUCHER");
85
- },
86
- chip() {
87
- return c(this);
88
- }
89
- },
90
- [a.enum.POINT]: {
91
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
92
- icon: "award_star",
93
- get name() {
94
- return o("connect.campaign.common.typeName.POINT");
95
- },
96
- chip() {
97
- return c(this);
98
- }
99
- },
100
- [a.enum.BROADCAST]: {
101
- chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
102
- icon: "campaign",
103
- get name() {
104
- return o("connect.campaign.common.typeName.BROADCAST");
105
- },
106
- chip() {
107
- return c(this);
108
- }
109
- },
110
- [a.enum.GAME]: {
111
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
112
- icon: "database",
113
- get name() {
114
- return o("connect.campaign.common.typeName.GAME");
115
- },
116
- chip() {
117
- return c(this);
118
- }
119
- },
120
- [a.enum.REWARD_POOL]: {
121
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
122
- icon: "editor_choice",
123
- get name() {
124
- return o("connect.campaign.common.typeName.REWARD_POOL");
125
- },
126
- chip() {
127
- return c(this);
128
- }
129
- },
130
- [a.enum.COIN]: {
131
- chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
132
- icon: "monetization_on",
133
- get name() {
134
- return o("connect.campaign.common.typeName.COIN");
135
- },
136
- chip() {
137
- return c(this);
138
- }
139
- },
140
- [a.enum.MEMBERSHIP]: {
141
- chipClass: "",
142
- icon: "",
143
- get name() {
144
- return o("connect.campaign.common.typeName.MEMBERSHIP");
145
- },
146
- chip() {
147
- return c(this);
148
- }
149
- },
150
- [a.enum.MISSION]: {
151
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
152
- icon: "editor_choice",
153
- get name() {
154
- return o("connect.campaign.common.typeName.MISSION");
155
- },
156
- chip() {
157
- return c(this);
158
- }
159
- },
160
- [a.enum.GRAB]: {
161
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
162
- icon: "editor_choice",
163
- name: "Grab",
164
- chip() {
165
- return c(this);
166
- }
167
- }
168
- };
169
- function U(e) {
170
- const t = R(e), r = {
171
- active: "text-fm-color-typo-success bg-fm-color-system-success-100",
172
- upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
173
- expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
174
- };
175
- return e.type == "VOUCHER" ? p(l.FmChip, {
176
- class: r[t],
177
- label: g.title(o(`connect.campaign.common.status.${t}`)),
178
- compact: !0
179
- }) : p(l.FmChip, {
180
- class: r[t],
181
- label: g.title(o(`connect.campaign.common.status.${t}`)),
182
- compact: !0
183
- });
184
- }
185
- function B(e) {
186
- const t = e.timeframeOptions;
187
- if (!t || !t.start && !t.end)
188
- return o("connect.campaign.common.always_active");
189
- if (!t.start && t.end)
190
- return o("connect.campaign.common.valid_until", {
191
- date: u(t.end)
192
- });
193
- const r = u(t.start), n = t.end ? u(t.end) : o("connect.campaign.common.unlimited");
194
- return `${r} -> ${n}`;
195
- }
196
- function F(e) {
197
- const { campaign: t } = e;
198
- function r(n) {
199
- if (!n || !n.start && !n.end)
200
- return "connect.campaign.common.always";
201
- const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
202
- return `${i} - ${y}`;
203
- }
204
- return {
205
- "connect.campaign.common.campaign_name": t.name,
206
- "connect.campaign.common.campaign_period": r(
207
- t.timeframeOptions
208
- ),
209
- get "connect.campaign.common.next_schedule_at"() {
210
- if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !h(t.event.rule))
211
- return;
212
- const n = O(
213
- t.event.rule.rules.g_schedule
214
- );
215
- return n ? s(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
216
- },
217
- get "connect.campaign.common.discount_type"() {
218
- if (t.type == "PROMOTION") return f(t.effect);
219
- if ("configs" in e && e.configs.type == "VOUCHER")
220
- return f(e.configs.extras.effect);
221
- },
222
- get "connect.campaign.common.available_at"() {
223
- return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
224
- (n) => C().locationItems.find((i) => i.value == n).label
225
- ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
226
- }
227
- };
228
- }
229
- function R(e) {
230
- return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? s().isBetween(
231
- e.timeframeOptions.start ?? s().subtract(1, "d"),
232
- e.timeframeOptions.end ?? s().add(1, "d")
233
- ) ? "active" : s().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
234
- }
235
- function V(e) {
236
- var t, r;
237
- switch (e.event.type) {
238
- case "BILL_COMPLETED":
239
- const n = `Spend to get ${m.formattedType(e.type)}`;
240
- switch (e.type) {
241
- case "POINT":
242
- case "CREDIT":
243
- case "COIN":
244
- return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
245
- case "VOUCHER":
246
- const i = (r = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : r.effect;
247
- return i ? `${n} - ${f(i)}` : n;
248
- default:
249
- return n;
250
- }
251
- case "FEEDBACK":
252
- return `Give feedback to receive ${m.formattedType(e.type)}`;
253
- case "SCHEDULE":
254
- return `Receive ${m.formattedType(e.type)} on scheduled time`;
255
- case "SIMPLE_CLAIM":
256
- return "Simple claim voucher";
257
- case "TIER_UPGRADED":
258
- return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
259
- case "MEMBERSHIP_JOINED":
260
- return `Receive ${m.formattedType(e.type)} when member joined`;
261
- case "MAKING_ORDER":
262
- return e.type !== "PROMOTION" ? void 0 : f(e.effect);
263
- default:
264
- throw new Error(
265
- `Not implemented ${JSON.stringify({ cause: e.event.type })}`
266
- );
267
- }
268
- }
269
- export {
270
- H as C,
271
- R as a,
272
- U as b,
273
- V as c,
274
- G as d,
275
- F as e,
276
- B as g
277
- };
@@ -1,97 +0,0 @@
1
- var g = Object.defineProperty;
2
- var b = (s, e, o) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
- var d = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
- import { u as a, w as f } from "./xlsx-_tQC9Ezf.js";
5
- import { u as h } from "./loading-DTKDhqew.js";
6
- import { h as x } from "./moment-D7p2TMB-.js";
7
- import { m as w } from "./index-CxdLExX0.js";
8
- class y {
9
- constructor() {
10
- d(this, "records", []);
11
- }
12
- addRecord(e) {
13
- this.records.push(e);
14
- }
15
- addRecords(e) {
16
- this.records.push(...e);
17
- }
18
- buildExcel() {
19
- const e = a.json_to_sheet(this.records), o = a.book_new();
20
- return a.book_append_sheet(o, e, "Sheet1"), o;
21
- }
22
- }
23
- class k extends y {
24
- }
25
- const r = {
26
- sortBy: "_id",
27
- descending: !1,
28
- rowsPerPage: 1e3,
29
- page: 1,
30
- rowsNumber: 0
31
- }, { minor: _ } = h;
32
- async function S({
33
- exporter: s,
34
- readFunction: e,
35
- transformRecord: o,
36
- filename: t
37
- }) {
38
- const c = (await e({
39
- limit: 1,
40
- skip: 0,
41
- sortBy: r.sortBy,
42
- descending: r.descending
43
- })).meta.totalResources ?? 0, n = r.rowsPerPage;
44
- await _(
45
- async () => {
46
- for (let i = 0; i < c; i += n) {
47
- const m = {
48
- ...r,
49
- limit: n,
50
- skip: r.page - 1,
51
- sortBy: r.sortBy,
52
- descending: r.descending
53
- }, p = await e(m);
54
- for (const l of p.resources) {
55
- const u = o(l);
56
- s.addRecord(u);
57
- }
58
- r.page++;
59
- }
60
- await f(
61
- s.buildExcel(),
62
- `${t}-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
63
- {
64
- bookType: "xlsx",
65
- bookSST: !1,
66
- type: "array"
67
- }
68
- ), r.page = 1;
69
- },
70
- {
71
- message: `Exporting ${t}...`,
72
- successMessage: `${t} exported successfully`
73
- }
74
- );
75
- }
76
- async function E() {
77
- return S({
78
- exporter: new k(),
79
- readFunction: w.readCards,
80
- transformRecord: (s) => {
81
- var e, o;
82
- return {
83
- CardNumber: s.serialNumber || "",
84
- MemberId: ((e = s.pf_member) == null ? void 0 : e._id.toString()) || "",
85
- Phone: ((o = s.pf_member) == null ? void 0 : o.phoneNumber) || "",
86
- RedeemedAt: s.redeemedAt ? x(s.redeemedAt).format("DD/MM/YYYY") : ""
87
- };
88
- },
89
- filename: "cards"
90
- });
91
- }
92
- export {
93
- y as B,
94
- k as C,
95
- E as a,
96
- S as e
97
- };
@@ -1,52 +0,0 @@
1
- import { g as n, S as r, b as c } from "./index-CWiaP-aV.js";
2
- const o = (e = "") => {
3
- const s = r.getBusinessId();
4
- if (!s) throw new Error("Invalid business ID");
5
- return c(`businesses/${s}/${e}`);
6
- }, g = {
7
- async listReviews(e) {
8
- const s = await o("reviews").get("", { params: e });
9
- return n(s);
10
- },
11
- async getSource() {
12
- const e = await o("reviews/config").get("");
13
- return n(e);
14
- },
15
- async connectGoogle(e, s, t) {
16
- const a = await o("reviews/config/google").post("", {
17
- code: e,
18
- redirectUri: s,
19
- state: t
20
- });
21
- return n(a);
22
- },
23
- async updateGoogleLocations(e) {
24
- const s = await o("reviews/config/google/locations").put("", { locations: e });
25
- return n(s);
26
- },
27
- async syncGoogleReviews() {
28
- const e = await o("reviews/config/google/sync").post("", {});
29
- return n(e);
30
- },
31
- async connectFacebook(e) {
32
- const s = await o("reviews/config/facebook").post("", { token: e });
33
- return n(s);
34
- },
35
- async updateFacebookPages(e) {
36
- const s = await o("reviews/config/facebook/pages").put("", { pages: e });
37
- return n(s);
38
- },
39
- async syncFacebookReviews() {
40
- const e = await o("reviews/config/facebook/sync").post("", {});
41
- return n(e);
42
- },
43
- async getOauthUrl(e, s) {
44
- const t = await o(`reviews/config/${e}/oauth`).get("", {
45
- params: { redirectUri: s }
46
- });
47
- return n(t);
48
- }
49
- };
50
- export {
51
- g as r
52
- };