@feedmepos/mf-connect 0.1.38-beta.9 → 0.1.38-beta.91

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 (162) hide show
  1. package/dist/{Analytic-3MN2saaU.js → Analytic-Drbkm5By.js} +31 -32
  2. package/dist/{App-Co8X5Wdy.js → App-C0cdcG5i.js} +741 -728
  3. package/dist/AuditLogs-BZZLtf2u.js +2013 -0
  4. package/dist/{Bin-8a56ZDib.js → Bin-DRV5lRmj.js} +10 -10
  5. package/dist/Broadcast-C90FN2LB.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVXlfq31.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsdxwjCn.js} +6 -6
  7. package/dist/{Card-B8_09LJu.js → Card-CWF84A1O.js} +145 -140
  8. package/dist/Collections-ja0gMaFf.js +540 -0
  9. package/dist/Credit-D8U2AJgq.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-YR62BvBG.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVbhDMqH.js +351 -0
  15. package/dist/Experience-DDXLGizu.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Dng61jiL.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-CMOilzsW.js +330 -0
  20. package/dist/Grab-tPVQB39R.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-BbtEXO4b.js} +49 -48
  22. package/dist/{Index-DLF71mx_.js → Index-Ch7wiShF.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DLO0jj6Z.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CplyhUFF.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-BMqnfxHh.js} +1 -1
  26. package/dist/Marketing-C0weDg-u.js +236 -0
  27. package/dist/MarketingMaterialEdit-BD-SyXVQ.js +1036 -0
  28. package/dist/{Member-Bkw4aqtv.js → Member-Bpf0amjr.js} +38 -37
  29. package/dist/{MemberList-a3PdVYB3.js → MemberList-cWYPEpL4.js} +485 -489
  30. package/dist/{MemberTransactions-CPDBd-n3.js → MemberTransactions-vzRUVwpO.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-pbN8pN1m.js → MessageInput.vue_vue_type_script_setup_true_lang-DY3L9CvB.js} +10392 -9967
  32. package/dist/Mission-HRwIp1QY.js +334 -0
  33. package/dist/{Overview-De97NDoe.js → Overview-D9cfX4Kr.js} +34 -34
  34. package/dist/Point-Dz-Z0_m9.js +262 -0
  35. package/dist/Promotion-Csb0bdI6.js +397 -0
  36. package/dist/{Queue-ISVZxCE2.js → Queue-CAVKh9bK.js} +18 -18
  37. package/dist/{Record-2FMByNC6.js → Record-bPnIoHnT.js} +15 -14
  38. package/dist/Review-D2DfvLqJ.js +621 -0
  39. package/dist/ReviewFacebookCallback-CI7V3xbp.js +243 -0
  40. package/dist/ReviewGoogleCallback-LA2S8FLZ.js +213 -0
  41. package/dist/{Reward-DPRyQ37x.js → Reward-DdHF5Pr7.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Ba7-3bL-.js → RewardGroup.vue_vue_type_script_setup_true_lang-DyZhWnI4.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B0OSLJVN.js +1912 -0
  44. package/dist/Segment-DV1zcWF7.js +1015 -0
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DZbyDVid.js → SelectItems.vue_vue_type_script_setup_true_lang-Df1HE9sL.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ioMFYIwK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0K9giqI.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzJL8Xl0.js +226 -0
  48. package/dist/Setting-DZiZy8A5.js +2039 -0
  49. package/dist/SettingAdvertisements-Bb9shWVJ.js +264 -0
  50. package/dist/Store-mymtMyho.js +1996 -0
  51. package/dist/StoreRewards-jcjZfSv7.js +537 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B-b5_TFL.js +1130 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-sCa1J_hq.js +7007 -0
  54. package/dist/{Tier-CwRj0oJ1.js → Tier-Ba6aHC3R.js} +562 -480
  55. package/dist/{Title-EII5OxSP.js → Title-C4uKD8E1.js} +151 -149
  56. package/dist/{Transaction-1MTkAfej.js → Transaction-Bf2uG6co.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlQVWQHJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3ttU-bw.js} +7 -7
  58. package/dist/Voucher-Lsc2pKCk.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-MA7tsTm-.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CTeGK4bk.js → ZodTextField.vue_vue_type_script_setup_true_lang-DEDavbCx.js} +2 -2
  61. package/dist/app-BRrGcz9U.js +59647 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-DjnN-J4U.js → business-TBSvPv65.js} +11 -8
  64. package/dist/campaign-CL95CZkI.js +219 -0
  65. package/dist/campaign-DxcuYXB7.js +254 -0
  66. package/dist/campaign.enum-DRydaoy9.js +26 -0
  67. package/dist/campaign.fn-BsoUwQ5N.js +776 -0
  68. package/dist/{collectible.enum-r6N115Lu.js → collectible.enum-CpTbpumt.js} +1 -1
  69. package/dist/{collection.fn-CSsfVv26.js → collection.fn-BNrPdDIr.js} +2 -2
  70. package/dist/dto-BGrkIVqX.js +222 -0
  71. package/dist/duplicateCampaign-DBaFROXd.js +51 -0
  72. package/dist/effect-fonU-1xO.js +89 -0
  73. package/dist/{email-addresses-D8uheCCF.js → email-addresses-WeV5Gvxa.js} +2 -2
  74. package/dist/{export-Ver6WiX6.js → export-DDXf8yf_.js} +4 -4
  75. package/dist/{helper-Bg4xoFbh.js → helper-DwnzJKxo.js} +22 -7
  76. package/dist/index-10x-WMiS.js +30289 -0
  77. package/dist/index-9Wt89ReU.js +3625 -0
  78. package/dist/{index-Bb0CHeNx.js → index-Brh5FXQ7.js} +3 -3
  79. package/dist/index-BxxNZQUc.js +8910 -0
  80. package/dist/{index-hJUxCNsF.js → index-CDAMmPIn.js} +1 -1
  81. package/dist/{index-CNhr0_Zx.js → index-Cg1vzNzf.js} +617 -191
  82. package/dist/{index-BZZ4iF4-.js → index-Cl7QnFc4.js} +23 -12
  83. package/dist/index-CuvNtC_M.js +61 -0
  84. package/dist/{index-BPQyQc4q.js → index-Cvw-xFek.js} +1 -1
  85. package/dist/index-DCJ_r_e2.js +85 -0
  86. package/dist/{index-Dn_bmcns.js → index-DLG8B-TK.js} +3 -3
  87. package/dist/{index-D4JOeJJJ.js → index-DWhh_u0L.js} +1 -1
  88. package/dist/index-DsQJTvKe.js +28900 -0
  89. package/dist/index-oR7xhhIt.js +48 -0
  90. package/dist/{index.esm2017-hK1Mi9yY.js → index.esm2017-CFvohTUs.js} +122 -122
  91. package/dist/{loading-kIQFOTwH.js → loading-DiD8J1Jc.js} +4 -3
  92. package/dist/{lodash-B5I3zXaY.js → lodash-BJgKlNEt.js} +1 -1
  93. package/dist/{membership--xR-HZoa.js → membership-C8HuK9_K.js} +38 -18
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-c-ITXnlg.js → money-DXl1-c0l.js} +1 -1
  96. package/dist/{number-DfZSBLOY.js → number-C6RGu6qp.js} +1 -1
  97. package/dist/objectid-8Boc1xMT.js +145 -0
  98. package/dist/{campaign-BpJ1O6KS.js → plugins-CxBcRdUi.js} +677 -699
  99. package/dist/remy-D_Deb3ue.js +13 -0
  100. package/dist/{reward-CE0ifMHS.js → reward-CEh2CA9Z.js} +1 -1
  101. package/dist/{rule-DrjdmpaB.js → rule-DEfU8NOO.js} +505 -487
  102. package/dist/rule-builder-BZIx2IzX.js +102 -0
  103. package/dist/string-Gcy5IM_H.js +32 -0
  104. package/dist/style.css +11 -2
  105. package/dist/template-Ba8NxY41.js +188 -0
  106. package/dist/timezone-DUqMvcwo.js +1156 -0
  107. package/dist/trigger-KQ-DPHv-.js +213 -0
  108. package/dist/useMarketingMaterialActions-DSI7Fpu9.js +96 -0
  109. package/dist/usePagination-BeTADCIt.js +220 -0
  110. package/dist/{user-Cl3IotYV.js → user-DN6_QE2j.js} +15 -14
  111. package/dist/vue-i18n-B4dOYJz4.js +2365 -0
  112. package/dist/{xlsx-BDBzdOuM.js → xlsx-BDFTkXYe.js} +1 -1
  113. package/dist/{zod-Bg2FbC-D.js → zod-B8WJKIxe.js} +32 -31
  114. package/package.json +14 -6
  115. package/dist/AuditLogs-DTq6IAuc.js +0 -1887
  116. package/dist/Broadcast-UreS5Kiq.js +0 -227
  117. package/dist/Collections-B0I5ULxR.js +0 -465
  118. package/dist/Credit-B4Ad8DWP.js +0 -222
  119. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  120. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js +0 -2185
  121. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-y5JnuIev.js +0 -347
  122. package/dist/Experience-xO5KpTTm.js +0 -223
  123. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  124. package/dist/Game-ChgrVvz5.js +0 -278
  125. package/dist/Marketing-BlmRXSGl.js +0 -20073
  126. package/dist/Mission-B07wK0HX.js +0 -296
  127. package/dist/Point-Ckj9QIeH.js +0 -226
  128. package/dist/Promotion-aGNCOeRN.js +0 -289
  129. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DWj-421v.js +0 -1751
  130. package/dist/Segment-CRMNJ11X.js +0 -882
  131. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js +0 -147
  132. package/dist/Setting-c0FWRZsD.js +0 -1936
  133. package/dist/Store-Bm1_15s8.js +0 -1842
  134. package/dist/StoreRewards-BCQHHfay.js +0 -423
  135. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfTF2l-D.js +0 -1029
  136. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-rvhoxo0w.js +0 -139
  137. package/dist/Voucher-CYvjCb-v.js +0 -384
  138. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-63Jr71dJ.js +0 -419
  139. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  140. package/dist/app-BJLHk8ao.js +0 -33357
  141. package/dist/app-BzIk1ojT.js +0 -7086
  142. package/dist/campaign-BHNS5kXt.js +0 -96
  143. package/dist/campaign.enum-CJDWE_Om.js +0 -20
  144. package/dist/campaign.fn-C0HQE9uh.js +0 -758
  145. package/dist/dto-Byq51uVH.js +0 -214
  146. package/dist/effect-Do3yTM-_.js +0 -78
  147. package/dist/index-B1V9UnI9.js +0 -76
  148. package/dist/index-BM9CWjC6.js +0 -38
  149. package/dist/index-CsaQJMAR.js +0 -66
  150. package/dist/index-D6VxioBg.js +0 -30038
  151. package/dist/index-DGKlRWn3.js +0 -32260
  152. package/dist/index-DLKyOu7W.js +0 -8861
  153. package/dist/index-DyYF6HYL.js +0 -121
  154. package/dist/index-UXtH44XQ.js +0 -3120
  155. package/dist/objectid-DKbha9-x.js +0 -145
  156. package/dist/plugins-DtakupKW.js +0 -208
  157. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  158. package/dist/rule-builder-B_hCyq3x.js +0 -89
  159. package/dist/template-WI4a-lFY.js +0 -190
  160. package/dist/trigger-DieDHht3.js +0 -144
  161. package/dist/usePagination-BeF5K3M7.js +0 -223
  162. package/dist/vue-i18n-DKh0SMhL.js +0 -2365
@@ -1,4 +1,4 @@
1
- import { z as e } from "./index-DGKlRWn3.js";
1
+ import { z as e } from "./index-10x-WMiS.js";
2
2
  const E = e.enum([
3
3
  "VOUCHER",
4
4
  "CREDIT",
@@ -1,5 +1,5 @@
1
- import "./index-DLKyOu7W.js";
2
- import "./index-DGKlRWn3.js";
1
+ import "./index-BxxNZQUc.js";
2
+ import "./index-10x-WMiS.js";
3
3
  function r(e) {
4
4
  switch (e) {
5
5
  case "PROMOTION":
@@ -0,0 +1,222 @@
1
+ import { F as o, z as a } from "./index-10x-WMiS.js";
2
+ import { t as R, a as r, u as h } from "./index-9Wt89ReU.js";
3
+ import { F as u } from "./index-BxxNZQUc.js";
4
+ import { i as f, R as d } from "./rule-builder-BZIx2IzX.js";
5
+ function A(n, e) {
6
+ var p, l;
7
+ if (console.log(n, e), !n) return;
8
+ const t = n.campaign;
9
+ if (!t) return;
10
+ const i = t.event.rule;
11
+ if (!i || !f(i)) {
12
+ e.addIssue({
13
+ code: "custom",
14
+ path: ["campaign", "event", "rule"],
15
+ params: {
16
+ i18n: "connectZodCustom:campaign.rule_required",
17
+ type: t.event.type
18
+ }
19
+ });
20
+ return;
21
+ }
22
+ switch (t.type) {
23
+ case "MISSION": {
24
+ t.earningOption.amount > t.mission.end && e.addIssue({
25
+ code: "custom",
26
+ path: ["campaign", "earningOption"],
27
+ params: {
28
+ i18n: "connectZodCustom:campaign.earning_amount_exceed",
29
+ max: t.mission.end
30
+ }
31
+ });
32
+ break;
33
+ }
34
+ case "CREDIT": {
35
+ const c = (p = t.config) == null ? void 0 : p.validityOption;
36
+ (!c || ["validForDay", "validBefore"].every((g) => c[g] == null)) && e.addIssue({
37
+ code: "custom",
38
+ path: ["campaign", "config", "validityOption"],
39
+ params: {
40
+ i18n: "connectZodCustom:campaign.credit_validity_required"
41
+ }
42
+ });
43
+ }
44
+ }
45
+ switch (t.event.type) {
46
+ case "BILL_COMPLETED":
47
+ t.type === "MISSION" && t.rewards.length && (t.rewards.forEach((c, m) => {
48
+ (c.threshold < 0 || c.threshold > t.mission.end) && e.addIssue({
49
+ code: "custom",
50
+ path: ["campaign", "rewards", m, "threshold"],
51
+ params: {
52
+ i18n: "connectZodCustom:campaign.reward_threshold_range"
53
+ }
54
+ });
55
+ }), (l = t.config) != null && l.validityOption.followFirstReceive || e.addIssue({
56
+ code: "custom",
57
+ path: ["campaign", "config", "validityOption"],
58
+ params: {
59
+ i18n: "connectZodCustom:campaign.mission_first_receive"
60
+ }
61
+ }));
62
+ break;
63
+ case "SCHEDULE": {
64
+ if (!i.rules.g_schedule) {
65
+ e.addIssue({
66
+ code: "custom",
67
+ path: ["campaign", "event", "rule"],
68
+ params: {
69
+ i18n: "connectZodCustom:campaign.schedule_period_required"
70
+ },
71
+ fatal: !0
72
+ });
73
+ return;
74
+ }
75
+ const c = d.getRules(
76
+ i.rules.g_schedule
77
+ ), m = [
78
+ {
79
+ property: "trigger.date",
80
+ operator: ["_isOnDate", "_rrule"]
81
+ },
82
+ {
83
+ property: "trigger.time",
84
+ operator: ["_isOnTime"]
85
+ }
86
+ ];
87
+ m.length == c.length && m.every((O) => c.some((C) => {
88
+ const I = d.simplify(C);
89
+ return I.property === O.property && O.operator.includes(I.operator);
90
+ })) || e.addIssue({
91
+ code: "custom",
92
+ path: ["campaign", "event", "rule"],
93
+ params: {
94
+ i18n: "connectZodCustom:campaign.active_period_invalid"
95
+ }
96
+ });
97
+ break;
98
+ }
99
+ default: {
100
+ "earningOption" in t && t.earningOption.type != "FIXED" && e.addIssue({
101
+ code: "custom",
102
+ path: ["campaign", "earningOption"],
103
+ params: {
104
+ i18n: "connectZodCustom:campaign.fixed_earning_required"
105
+ }
106
+ });
107
+ break;
108
+ }
109
+ }
110
+ }
111
+ function N(n) {
112
+ var t;
113
+ if (n.campaign.type === "VOUCHER" && "configs" in n) {
114
+ const i = n.configs;
115
+ i.extras.targetLocation = n.campaign.targetLocation;
116
+ const p = Math.max(
117
+ n.campaign.earningOption.amount,
118
+ i.options.maxUse ?? 1
119
+ );
120
+ n.campaign.earningOption.amount = p, i.options.maxUse = p, n.campaign.earningOption = {
121
+ type: "FIXED",
122
+ amount: 1
123
+ };
124
+ }
125
+ if (n.campaign.type == "MISSION" && "configs" in n) {
126
+ const i = n.configs;
127
+ i.options.validityOption = (t = n.campaign.config) == null ? void 0 : t.validityOption;
128
+ }
129
+ const e = n.campaign.event;
130
+ return e.type != "BILL_COMPLETED" && e.rule && f(e.rule) && (e.rule = d.removeEntry(e.rule, "g_bill"), n.campaign.event = e), n;
131
+ }
132
+ function s(n) {
133
+ const e = h.optionsMap.get(n).extend({
134
+ _id: o.optional(),
135
+ collectible: a.string().nullish()
136
+ });
137
+ switch (n) {
138
+ case "VOUCHER":
139
+ return a.object({
140
+ campaign: e,
141
+ templateId: o,
142
+ configs: u,
143
+ updateCollections: a.boolean().optional(),
144
+ code: a.string().optional()
145
+ });
146
+ case "PROMOTION":
147
+ return a.object({
148
+ campaign: e,
149
+ templateId: o
150
+ });
151
+ case "POINT":
152
+ return a.object({
153
+ campaign: e,
154
+ templateId: o
155
+ });
156
+ case "CREDIT":
157
+ return a.object({
158
+ campaign: e,
159
+ templateId: o
160
+ });
161
+ case "BROADCAST":
162
+ return a.object({
163
+ campaign: e,
164
+ templateId: o
165
+ });
166
+ case "COIN":
167
+ return a.object({
168
+ campaign: e,
169
+ templateId: o
170
+ });
171
+ case "REWARD_POOL":
172
+ return a.object({
173
+ campaign: e,
174
+ templateId: o,
175
+ updateCollections: a.boolean().optional()
176
+ });
177
+ case "GAME":
178
+ return a.object({
179
+ campaign: e,
180
+ configs: u,
181
+ templateId: o,
182
+ updateCollections: a.boolean().optional()
183
+ });
184
+ case "MISSION":
185
+ return a.object({
186
+ campaign: e,
187
+ configs: u,
188
+ templateId: o,
189
+ updateCollections: a.boolean().optional()
190
+ });
191
+ case "GRAB":
192
+ return a.object({
193
+ campaign: e,
194
+ templateId: o
195
+ });
196
+ default:
197
+ throw new Error("Not implemented");
198
+ }
199
+ }
200
+ const D = R.extend({
201
+ _id: o.optional(),
202
+ name: a.string().min(1).max(300),
203
+ business: o.optional(),
204
+ campaigns: a.array(o).optional()
205
+ }), T = {
206
+ [r.enum.VOUCHER]: s("VOUCHER"),
207
+ [r.enum.PROMOTION]: s("PROMOTION"),
208
+ [r.enum.POINT]: s("POINT"),
209
+ [r.enum.CREDIT]: s("CREDIT"),
210
+ [r.enum.BROADCAST]: s("BROADCAST"),
211
+ [r.enum.COIN]: s("COIN"),
212
+ [r.enum.REWARD_POOL]: s("REWARD_POOL"),
213
+ [r.enum.GAME]: s("GAME"),
214
+ [r.enum.MISSION]: s("MISSION"),
215
+ [r.enum.GRAB]: s("GRAB")
216
+ };
217
+ export {
218
+ T as C,
219
+ D as F,
220
+ N as a,
221
+ A as c
222
+ };
@@ -0,0 +1,51 @@
1
+ import { p as l, i } from "./plugins-CxBcRdUi.js";
2
+ import { _ as r } from "./lodash-BJgKlNEt.js";
3
+ function A(e) {
4
+ return l.confirm(
5
+ i.global.t("connect.common.duplicate.confirmMessage", { name: e }),
6
+ i.global.t("connect.common.duplicate.title"),
7
+ i.global.t("connect.common.duplicate.proceed")
8
+ );
9
+ }
10
+ const f = ["LOYALTY", "NO_REWARD"], s = {
11
+ GAME: [(e) => {
12
+ var o;
13
+ return (o = e == null ? void 0 : e.game) == null ? void 0 : o.rewards;
14
+ }],
15
+ MISSION: [
16
+ (e) => e == null ? void 0 : e.rewards,
17
+ (e) => {
18
+ var o;
19
+ return (o = e == null ? void 0 : e.mission) == null ? void 0 : o.rewards;
20
+ }
21
+ ],
22
+ REWARD_POOL: [(e) => e == null ? void 0 : e.rewards]
23
+ };
24
+ function u(e, o) {
25
+ e && e.forEach((t) => {
26
+ o.includes(t.type ?? "") || (t.collectible = null, t.type === "VOUCHER" && t.collectibleConfig && (t.collectibleConfig._id = void 0));
27
+ });
28
+ }
29
+ function d(e) {
30
+ e._id = void 0;
31
+ }
32
+ function R(e, o) {
33
+ e.campaign && (e.campaign._id = void 0, e.campaign.currentReceive = void 0, o || (e.campaign.collectible = void 0));
34
+ }
35
+ function C(e, o) {
36
+ e.configs && (e.configs.currentReceive = void 0, o || (e.configs._id = void 0));
37
+ }
38
+ function E(e) {
39
+ const o = s[(e == null ? void 0 : e.type) ?? ""];
40
+ o && o.forEach((t) => {
41
+ u(t(e), f);
42
+ });
43
+ }
44
+ function v(e, o = {}) {
45
+ const t = r.cloneDeep(e), { keepCollectible: c = !1 } = o, n = t.campaign;
46
+ return d(t), R(t, c), C(t, c), E(n), t;
47
+ }
48
+ export {
49
+ A as c,
50
+ v as p
51
+ };
@@ -0,0 +1,89 @@
1
+ import { c as r } from "./index-DsQJTvKe.js";
2
+ function p(n) {
3
+ if (!n)
4
+ return null;
5
+ const o = r.Config.getCountry().currency.symbol;
6
+ function s(t) {
7
+ if (t.options.target === "ITEM" && t.options.strategy.type === "PRICE_CHANGE")
8
+ return null;
9
+ const e = r.Dinero.fromFdoDecimal({ decimal: t.adjustment.amount });
10
+ switch (t.adjustment.type) {
11
+ case "BY_PERCENTAGE":
12
+ return `${e.toObject().amount}% discount`;
13
+ case "BY_AMOUNT":
14
+ return `${o}${e.toUnit()} discount`;
15
+ case "TO_AMOUNT":
16
+ return `to ${o}${e.toUnit()}`;
17
+ }
18
+ }
19
+ function u(t) {
20
+ switch (t.options.target) {
21
+ case "BILL":
22
+ return "Bill Discount";
23
+ case "ITEM":
24
+ if (t.options.strategy.type === "PRICE_CHANGE") {
25
+ const e = t.options.strategy.key;
26
+ return e ? `Use ${e} price` : "Use different price";
27
+ } else {
28
+ if (t.options.strategy.type === "SIMPLE")
29
+ return "Item Discount";
30
+ if (t.options.strategy.type === "BUY_X_GET_Y")
31
+ return "Buy X Get Y (same product set)";
32
+ if (t.options.strategy.type === "BUY_X_GET_Y_V2")
33
+ return "Buy X Get Y (mixed product set)";
34
+ if (t.options.strategy.type === "BUY_X_ITEM_A_GET_Y_ITEM_B")
35
+ return "Buy X Get Y (different product set)";
36
+ if (t.options.strategy.type === "COMBO")
37
+ return "Combo";
38
+ }
39
+ break;
40
+ case "PAYMENT":
41
+ return "Payment";
42
+ default:
43
+ throw new Error("Invalid effect target");
44
+ }
45
+ }
46
+ function a(t) {
47
+ return t.options.target === "ITEM" && t.options.strategy.type === "PRICE_CHANGE" ? "Requires POS 7.12.18 or above" : null;
48
+ }
49
+ function c(t) {
50
+ if (t.options.target === "BILL" || t.options.target === "PAYMENT") {
51
+ const e = r.Dinero.fromFdoDecimal({
52
+ decimal: t.options.minPurchase
53
+ });
54
+ return e.toUnit() > 0 ? `min spend ${o}${e.toUnit()}` : "no min spend";
55
+ }
56
+ if (t.options.target === "ITEM" && t.options.minPurchase) {
57
+ const e = r.Dinero.fromFdoDecimal({
58
+ decimal: t.options.minPurchase
59
+ });
60
+ return e.toUnit() > 0 ? `min spend ${o}${e.toUnit()}` : "no min spend";
61
+ }
62
+ return "no min spend";
63
+ }
64
+ function m(t) {
65
+ var e;
66
+ if (((e = t.adjustmentRule) == null ? void 0 : e.type) == "CAPPED_AT") {
67
+ const i = r.Dinero.fromFdoDecimal({
68
+ decimal: t.adjustmentRule.amount
69
+ }).toPositive();
70
+ return i.toUnit() > 0 ? `cap at ${o}${i.toUnit()}` : null;
71
+ }
72
+ return null;
73
+ }
74
+ return {
75
+ type: u(n),
76
+ adjustment: s(n),
77
+ requirements: c(n),
78
+ maxCap: m(n),
79
+ posHint: a(n)
80
+ };
81
+ }
82
+ function l(n) {
83
+ const o = p(n);
84
+ return !n || !o ? null : Object.values(o).filter(Boolean).join(" | ");
85
+ }
86
+ export {
87
+ l as e,
88
+ p as s
89
+ };
@@ -1,8 +1,8 @@
1
1
  var ur = Object.defineProperty;
2
2
  var ir = (S, b, h) => b in S ? ur(S, b, { enumerable: !0, configurable: !0, writable: !0, value: h }) : S[b] = h;
3
3
  var pn = (S, b, h) => ir(S, typeof b != "symbol" ? b + "" : b, h);
4
- import { u as V } from "./xlsx-BDBzdOuM.js";
5
- import { g as ar } from "./_commonjsHelpers-BkfeUUK-.js";
4
+ import { u as V } from "./xlsx-BDFTkXYe.js";
5
+ import { g as ar } from "./app-BRrGcz9U.js";
6
6
  class fr {
7
7
  constructor() {
8
8
  pn(this, "data", []);
@@ -1,10 +1,10 @@
1
1
  var g = Object.defineProperty;
2
2
  var b = (s, e, o) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
3
  var d = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
- import { u as a, w as f } from "./xlsx-BDBzdOuM.js";
5
- import { u as h } from "./loading-kIQFOTwH.js";
6
- import { h as x } from "./moment-BWErdI6_.js";
7
- import { m as w } from "./index-hJUxCNsF.js";
4
+ import { u as a, w as f } from "./xlsx-BDFTkXYe.js";
5
+ import { u as h } from "./loading-DiD8J1Jc.js";
6
+ import { h as x } from "./moment-D7p2TMB-.js";
7
+ import { m as w } from "./index-CDAMmPIn.js";
8
8
  class y {
9
9
  constructor() {
10
10
  d(this, "records", []);
@@ -1,5 +1,5 @@
1
- import { o as i } from "./index-DLKyOu7W.js";
2
- function o(t, e) {
1
+ import { k as l } from "./index-BxxNZQUc.js";
2
+ function u(t, e) {
3
3
  switch (t) {
4
4
  case "COIN":
5
5
  case "CREDIT":
@@ -61,11 +61,26 @@ function o(t, e) {
61
61
  throw new Error("Invalid collectible type");
62
62
  }
63
63
  }
64
- function u(t) {
65
- const { validAfter: e, validBefore: a } = t, { validForDay: s } = t, n = i(e).toDate(), r = i(a).toDate();
66
- return e && a ? `${n.toLocaleDateString()} - ${r.toLocaleDateString()}` : e ? `Starts from ${n.toLocaleDateString()}` : a ? `Ends at ${r.toLocaleDateString()}` : s != null ? `Expires in ${s || "the same"} day${s > 1 ? "s" : ""} after claim` : "Always valid";
64
+ function c(t) {
65
+ const { validAfter: e, validBefore: s } = t, { validForDay: a } = t, n = l(e).toDate(), r = l(s).toDate();
66
+ return e && s ? `${n.toLocaleDateString()} - ${r.toLocaleDateString()}` : e ? `Starts from ${n.toLocaleDateString()}` : s ? `Ends at ${r.toLocaleDateString()}` : a != null ? `Expires in ${a || "the same"} day${a > 1 ? "s" : ""} after claim` : "Always valid";
67
67
  }
68
+ function i(t, e, s, a = !0) {
69
+ if (!t) return a;
70
+ const n = t[e];
71
+ return n ? n[s] ?? a : a;
72
+ }
73
+ function E(t, e) {
74
+ return t ? i(t, e, "selectable", !1) : e === "STORE_BUNDLE:DEFAULT";
75
+ }
76
+ const b = {
77
+ "STORE_BUNDLE:DEFAULT": { selectable: !1 },
78
+ "STORE_BUNDLE:FEEDVIBE": { selectable: !0, editable: !1, deletable: !1 }
79
+ };
68
80
  export {
69
- o as i,
70
- u as t
81
+ b as F,
82
+ E as a,
83
+ i as h,
84
+ u as i,
85
+ c as t
71
86
  };