@feedmepos/mf-connect 0.1.98-beta.21 → 0.1.98-beta.23

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 (117) hide show
  1. package/dist/{App-B3f8GWoR.js → App-BIYX7Etx.js} +10 -9
  2. package/dist/{AuditLogs-LRHzzpqj.js → AuditLogs-DE4OshWT.js} +9 -9
  3. package/dist/{Bin-Y761Ua4-.js → Bin-Dij5sB7P.js} +8 -8
  4. package/dist/{Broadcast-CdRuG42N.js → Broadcast-LrxTPewm.js} +13 -12
  5. package/dist/CampaignAnalytic-Cd4NmVCa.js +1656 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsULDH9l.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-NOjmA60-.js} +6 -5
  7. package/dist/{Card-GZ3ZLnBl.js → Card-RUIOZRGb.js} +18 -18
  8. package/dist/{Collections-B59fL-oS.js → Collections-D0Dm4XVh.js} +14 -13
  9. package/dist/{Credit-DJxzXBam.js → Credit-04KV7cl_.js} +119 -93
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C3d8frgZ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D0_4f-Lw.js} +34 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DKUFvacX.js → EffectSheet.vue_vue_type_style_index_0_lang-GJYjey-R.js} +6 -6
  12. package/dist/{Experience-lzpvYFPP.js → Experience-Tnx0sYuU.js} +112 -86
  13. package/dist/{FileSaver.min-BXoEv5ve.js → FileSaver.min-DO-YYoNK.js} +1 -1
  14. package/dist/Game-BQF1HhbF.js +356 -0
  15. package/dist/{Grab-BQgS104D.js → Grab-CbpfBdSQ.js} +32 -31
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cz9iB9ox.js → ImageInput.vue_vue_type_script_setup_true_lang-Dm76lZPy.js} +1 -1
  17. package/dist/{Index-B5UTBbUy.js → Index-Bs2XB4kq.js} +10 -10
  18. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CLLhy4-v.js → LocationPicker.vue_vue_type_script_setup_true_lang--zUjb2sx.js} +1 -1
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BiIqs4zW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dix9t18W.js} +1 -1
  20. package/dist/LoyaltyDashboard-D-2cCqT1.js +1339 -0
  21. package/dist/{MainLayout-AvQ4_-oT.js → MainLayout-BtjswcYZ.js} +1 -1
  22. package/dist/{Marketing-Bn1ygF8d.js → Marketing-BX2dspqc.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-Cw-VPVqE.js → MarketingMaterialEdit-BnERWjgD.js} +6 -6
  24. package/dist/{Member-CpEXFHIF.js → Member-BH8ly91d.js} +11 -11
  25. package/dist/{MemberList-gSEw_idJ.js → MemberList-vNI7GD9Z.js} +36 -35
  26. package/dist/{MemberTransactions-DEMzj9-y.js → MemberTransactions-CQUJBCJK.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B4Y5KPpw.js → MessageInput.vue_vue_type_script_setup_true_lang-BzJzMifM.js} +4400 -4431
  28. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-B1Yj3odA.js +38 -0
  29. package/dist/Mission-Rzjonu46.js +360 -0
  30. package/dist/{Overview-CMudFYOc.js → Overview-B1b0Krzj.js} +3 -3
  31. package/dist/{Overview-DjNcF88f.js → Overview-BYCWa5kg.js} +18 -18
  32. package/dist/Point-LhcogofH.js +288 -0
  33. package/dist/Promotion-CyHJ_Rj7.js +423 -0
  34. package/dist/{Queue-BjoAJoVe.js → Queue-B3TbSBGL.js} +16 -16
  35. package/dist/{Record-CfZFuwy_.js → Record-CMaloGsO.js} +9 -9
  36. package/dist/{Review-pIAxbjVU.js → Review-Cht29ZqH.js} +2 -2
  37. package/dist/{ReviewFacebookCallback-BRW4T-5-.js → ReviewFacebookCallback-w9E0tBZK.js} +5 -5
  38. package/dist/{ReviewGoogleCallback-B-6EojXR.js → ReviewGoogleCallback-wyDB2Q4d.js} +5 -5
  39. package/dist/{Reward-_pdE2XZp.js → Reward-CHUkCgCF.js} +16 -16
  40. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-S5dh0IGc.js → RewardGroup.vue_vue_type_script_setup_true_lang-Dop7KXro.js} +11 -11
  41. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-C9B7NmF0.js → RuleGroup.vue_vue_type_script_setup_true_lang-pgKnyxcj.js} +16 -15
  42. package/dist/{Segment-B1EMe-LZ.js → Segment-CQM0X0t8.js} +39 -37
  43. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DAmjk8b3.js → SelectItems.vue_vue_type_script_setup_true_lang-Dgk1XFW-.js} +2 -2
  44. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7sgPf8l.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-WLoT1Yuh.js} +12 -12
  45. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVYTZr_E.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CiIXMw2K.js} +4 -4
  46. package/dist/{Setting-CQQ6zacB.js → Setting-BNb9cKHW.js} +40 -40
  47. package/dist/{SettingAdvertisements-9Wl9VWbM.js → SettingAdvertisements-DCfDKajW.js} +12 -12
  48. package/dist/{Settings-Bvj2ChDR.js → Settings-D9x31jyY.js} +5 -5
  49. package/dist/{Store-BdUZ22g6.js → Store-CHIRPbf9.js} +21 -21
  50. package/dist/{StoreRewards-DsUS_Lu1.js → StoreRewards-oDCchD1I.js} +15 -15
  51. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Zw-lIDCN.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bs6DBPCp.js} +21 -21
  52. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BECp3eqQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dg7rFNPR.js} +2 -2
  53. package/dist/{Tier-2-mJ3SNK.js → Tier-BnxtqLlp.js} +36 -34
  54. package/dist/{Title-BjeEDjxl.js → Title-Ca909tVJ.js} +39 -37
  55. package/dist/{Transaction--U_kJKec.js → Transaction-CXqSR6Vb.js} +2 -2
  56. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BkLyvjA5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DXKIcUhs.js} +6 -6
  57. package/dist/{Voucher-INa3N_6V.js → Voucher-0JvEJ4Jp.js} +156 -133
  58. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-4Quzmc7-.js → VoucherEditor.vue_vue_type_script_setup_true_lang-vBymX-zC.js} +12 -12
  59. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CPCnBExY.js → ZodTextField.vue_vue_type_script_setup_true_lang-CaLyPkwJ.js} +2 -2
  60. package/dist/{app-Dlqr-LX4.js → app-bITyvnZM.js} +3155 -3011
  61. package/dist/app.js +1 -1
  62. package/dist/{business-DWrfGEe_.js → business-eD0ch267.js} +1 -1
  63. package/dist/campaign-BFg0mmEh.js +100 -0
  64. package/dist/{campaign-DtNt-BqN.js → campaign-Ba602jpT.js} +74 -96
  65. package/dist/{campaign.enum-B9-ZpK0C.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  66. package/dist/{campaign.fn-COxaWmi_.js → campaign.fn-DF0snp1T.js} +62 -62
  67. package/dist/{collectible.enum-CF0VF-r7.js → collectible.enum-Liy2wH3s.js} +1 -1
  68. package/dist/collection.fn-CBfMIjXE.js +26 -0
  69. package/dist/{duplicateCampaign-8ciT68QF.js → duplicateCampaign-VP_ls1ud.js} +2 -2
  70. package/dist/{effect-CaSn-84h.js → effect-ddINAhuZ.js} +1 -1
  71. package/dist/{email-addresses-BiMQ8xIx.js → email-addresses-dgDgXrMO.js} +2 -2
  72. package/dist/{export-BwBNgCo5.js → export-Ds2K5BsU.js} +3 -3
  73. package/dist/{helper-CajV_0CM.js → helper-BuMn1yMd.js} +1 -1
  74. package/dist/{index-CjW6Mj-1.js → index-116bBmSO.js} +1 -1
  75. package/dist/{index-CQj9BQlQ.js → index-2WBZTpTO.js} +105 -123
  76. package/dist/{index-D1--K-QL.js → index-C7yjfEJp.js} +1 -1
  77. package/dist/index-C8cXXcLk.js +45 -0
  78. package/dist/{index-Bqcfsd4p.js → index-CDY4-3Oh.js} +8 -7
  79. package/dist/index-C_H8jFYf.js +2743 -0
  80. package/dist/{index-B6tm_U_M.js → index-CssCQw59.js} +18 -17
  81. package/dist/{index-DWBKko92.js → index-D-VV6TQr.js} +6 -6
  82. package/dist/{index-CQIciFrH.js → index-D5CuHi7m.js} +1 -1
  83. package/dist/{index-J8pSZ3WO.js → index-D7zaIqw5.js} +1 -1
  84. package/dist/{index-D1vhLY7l.js → index-DeBtRbNM.js} +1 -1
  85. package/dist/index-DtvL6ok7.js +146 -0
  86. package/dist/{index-D90p28Hr.js → index-Dvs0-jZv.js} +205 -229
  87. package/dist/{index-BP5rdioN.js → index-IC2b3X3d.js} +8027 -10766
  88. package/dist/{index-DBUTFa2h.js → index-KbYR_xHX.js} +2 -2
  89. package/dist/{index-B6ldAC8Y.js → index-ObbBk7ec.js} +1 -1
  90. package/dist/{index-B0ohh62P.js → index-uwROagPY.js} +230 -351
  91. package/dist/{index.esm2017-QlPanYiW.js → index.esm2017-skDxCJ1A.js} +1 -1
  92. package/dist/{loading-CqqkzWSm.js → loading-LvohTBxf.js} +1 -1
  93. package/dist/{lodash-DmbW2QhA.js → lodash-Di4dt__i.js} +1 -1
  94. package/dist/{membership-Dcwyu-rr.js → membership-7dDyl1PB.js} +3 -3
  95. package/dist/{money-DWr1gi--.js → money-DLO_8Rz5.js} +1 -1
  96. package/dist/{number-CHhHAd1q.js → number-DI2NyHxA.js} +1 -1
  97. package/dist/{objectid-BsiuHVH8.js → objectid-BR7nqOFr.js} +8 -8
  98. package/dist/{plugins-BxmMI8fo.js → plugins-DiV6DB6H.js} +3 -3
  99. package/dist/{reward-DX0FjsNT.js → reward-CEQA8YFb.js} +1 -1
  100. package/dist/{rule-DDLcqiHH.js → rule-CK-xQMWg.js} +3 -3
  101. package/dist/rule-builder-DW8QDYRH.js +126 -0
  102. package/dist/{template-C0lF82yv.js → template-ASiRYpll.js} +6 -6
  103. package/dist/timezone-Bt1TXRp3.js +20 -0
  104. package/dist/{trigger-CsJcg_RY.js → trigger-C1t6y-O_.js} +5 -5
  105. package/dist/{useMarketingMaterialActions-B0iV6YzB.js → useMarketingMaterialActions-CflpOyai.js} +3 -3
  106. package/dist/{usePagination-4EISkyGW.js → usePagination-BtKUQnLA.js} +1 -1
  107. package/dist/{user-DZuSeqRY.js → user-Dv4jKByC.js} +1 -1
  108. package/dist/{vue-i18n-BKcwYlp1.js → vue-i18n-xbxyJhj4.js} +436 -436
  109. package/dist/{xlsx-C-7dia55.js → xlsx-rKKsRfvM.js} +440 -440
  110. package/dist/{zod-DPxXVSRw.js → zod-DpLFpQ43.js} +1 -1
  111. package/package.json +1 -1
  112. package/dist/Game-KCxIpXEC.js +0 -330
  113. package/dist/LoyaltyDashboard-DPHWpaNJ.js +0 -1082
  114. package/dist/Mission-DMtpauNQ.js +0 -334
  115. package/dist/Point-CgdTrgXc.js +0 -262
  116. package/dist/Promotion-DDQodFDb.js +0 -397
  117. package/dist/campaign-un9Ji1KF.js +0 -219
@@ -0,0 +1,1656 @@
1
+ import { defineComponent as q, resolveComponent as _, openBlock as n, createBlock as f, withCtx as P, createElementBlock as b, createCommentVNode as v, createElementVNode as a, toDisplayString as d, resolveDynamicComponent as ve, Fragment as L, normalizeStyle as me, renderList as Z, createVNode as I, normalizeClass as J, ref as G, computed as E, unref as o, onMounted as fe } from "vue";
2
+ import { u as he } from "./vue-i18n-xbxyJhj4.js";
3
+ import { useCoreStore as ge } from "@feedmepos/mf-common";
4
+ import { c as V } from "./index-DtvL6ok7.js";
5
+ import { u as xe } from "./loading-LvohTBxf.js";
6
+ import { s as ke, b as we } from "./campaign-Ba602jpT.js";
7
+ import { C as ue } from "./timezone-Bt1TXRp3.js";
8
+ import { h as Re } from "./moment-D7p2TMB-.js";
9
+ import { _ as W } from "./MetricInfoTooltip.vue_vue_type_script_setup_true_lang-B1Yj3odA.js";
10
+ import { useRoute as Me, useRouter as _e } from "vue-router";
11
+ const Se = {
12
+ state: "populated",
13
+ reportRangeLabel: "Unavailable",
14
+ funnel: [],
15
+ cards: [],
16
+ trend: [],
17
+ breakdown: null,
18
+ outcomes: [],
19
+ metrics: []
20
+ }, Ie = {
21
+ state: "populated",
22
+ reportRangeLabel: "Unavailable",
23
+ funnel: [],
24
+ cards: [],
25
+ trend: [],
26
+ breakdown: {
27
+ dimension: "Outlet",
28
+ columns: [
29
+ "Applied members",
30
+ "Member bills",
31
+ "Non-member bills",
32
+ "Attributed bills",
33
+ "Exact sales",
34
+ "Promotion value used"
35
+ ],
36
+ rows: []
37
+ },
38
+ outcomes: [],
39
+ metrics: []
40
+ }, Ce = {
41
+ state: "populated",
42
+ reportRangeLabel: "Unavailable",
43
+ funnel: [],
44
+ cards: [],
45
+ trend: [],
46
+ breakdown: null,
47
+ breakdowns: [],
48
+ outcomes: [],
49
+ metrics: []
50
+ }, Oe = {
51
+ state: "populated",
52
+ reportRangeLabel: "Unavailable",
53
+ funnel: [],
54
+ cards: [],
55
+ trend: [],
56
+ breakdown: null,
57
+ breakdowns: [],
58
+ outcomes: [],
59
+ metrics: []
60
+ }, Pe = {
61
+ state: "populated",
62
+ reportRangeLabel: "Unavailable",
63
+ funnel: [],
64
+ cards: [],
65
+ trend: [],
66
+ breakdown: null,
67
+ breakdowns: [],
68
+ outcomes: [],
69
+ metrics: []
70
+ }, De = {
71
+ state: "populated",
72
+ reportRangeLabel: "Unavailable",
73
+ funnel: [],
74
+ cards: [],
75
+ trend: [],
76
+ breakdown: null,
77
+ breakdowns: [],
78
+ outcomes: [],
79
+ metrics: []
80
+ }, $e = {
81
+ state: "populated",
82
+ reportRangeLabel: "Unavailable",
83
+ funnel: [],
84
+ cards: [],
85
+ trend: [],
86
+ breakdown: null,
87
+ breakdowns: [],
88
+ outcomes: [],
89
+ metrics: []
90
+ }, Ee = {
91
+ VOUCHER: {
92
+ label: "Voucher",
93
+ icon: "confirmation_number",
94
+ objective: "Reactivation",
95
+ report: Se
96
+ },
97
+ PROMOTION: {
98
+ label: "Promotion",
99
+ icon: "percent",
100
+ objective: "Purchase conversion",
101
+ report: Ie
102
+ },
103
+ MISSION: {
104
+ label: "Mission",
105
+ icon: "flag",
106
+ objective: "Member engagement",
107
+ report: Ce
108
+ },
109
+ GAME: {
110
+ label: "Game",
111
+ icon: "sports_esports",
112
+ objective: "Member engagement",
113
+ report: Oe
114
+ },
115
+ COIN: {
116
+ label: "Point",
117
+ icon: "stars",
118
+ objective: "Member engagement",
119
+ report: Pe
120
+ },
121
+ POINT: {
122
+ label: "Experience",
123
+ icon: "trending_up",
124
+ objective: "Member engagement",
125
+ report: De
126
+ },
127
+ CREDIT: {
128
+ label: "Credit",
129
+ icon: "account_balance_wallet",
130
+ objective: "Member engagement",
131
+ report: $e
132
+ }
133
+ };
134
+ function Le(t) {
135
+ return Ee[t];
136
+ }
137
+ function C(t, i) {
138
+ return `${(t ?? 0).toLocaleString()} ${i}`;
139
+ }
140
+ function m(t) {
141
+ return (t ?? 0).toLocaleString();
142
+ }
143
+ function w(t) {
144
+ return t == null ? "—" : `RM ${t.toLocaleString("en-MY", {
145
+ minimumFractionDigits: 2,
146
+ maximumFractionDigits: 2
147
+ })}`;
148
+ }
149
+ function D(t, i) {
150
+ const e = i ?? 0;
151
+ return e ? Math.round((t ?? 0) / e * 1e3) / 10 : 0;
152
+ }
153
+ function N(t) {
154
+ const i = Re(t);
155
+ return i.isValid() ? i.format("D MMM YYYY") : t;
156
+ }
157
+ function Te(t, i, e) {
158
+ const { metrics: s, scope: l } = i, h = D(
159
+ s.redeemedMembers,
160
+ s.distributedMembers
161
+ ), r = D(
162
+ s.redeemedVouchers,
163
+ s.distributedVouchers
164
+ ), c = s.completedBills === 0 ? 0 : s.rewardValueUsed / s.completedBills, x = s.completedBills === 0 ? 0 : s.exactSales / s.completedBills, R = D(
165
+ s.expiredUnusedVouchers,
166
+ s.distributedVouchers
167
+ );
168
+ return {
169
+ ...t,
170
+ reportRangeLabel: l.startDate && l.endDate ? `${N(l.startDate)} – ${N(l.endDate)}` : "Unavailable",
171
+ audienceLabel: void 0,
172
+ funnel: [
173
+ {
174
+ key: "distributed",
175
+ label: "Distributed",
176
+ membersLabel: C(s.distributedMembers, "members"),
177
+ unitsLabel: C(s.distributedVouchers, "vouchers"),
178
+ valueLabel: w(s.distributedFixedValue),
179
+ helper: "Unique members who received at least one voucher"
180
+ },
181
+ {
182
+ key: "redeemed",
183
+ label: "Redeemed",
184
+ membersLabel: C(s.redeemedMembers, "members"),
185
+ unitsLabel: C(s.voucherUses, "voucher uses"),
186
+ ratePct: h,
187
+ rateLabel: `${h}% of distributed members`,
188
+ helper: "Distinct identified members who used the voucher"
189
+ },
190
+ {
191
+ key: "completedBills",
192
+ label: "Completed bills",
193
+ primaryLabel: C(s.completedBills, "completed bills"),
194
+ extra: "Includes direct guest voucher use",
195
+ helper: "Distinct completed bills where this voucher was used"
196
+ }
197
+ ],
198
+ cards: [
199
+ {
200
+ key: "distributedMembers",
201
+ label: "Distributed Members",
202
+ value: (s.distributedMembers ?? 0).toLocaleString(),
203
+ sub: C(s.distributedVouchers, "vouchers")
204
+ },
205
+ {
206
+ key: "redemptionRate",
207
+ label: "Redemption Rate",
208
+ value: `${h}%`,
209
+ sub: "of distributed members"
210
+ },
211
+ {
212
+ key: "exactSales",
213
+ label: "Exact Sales",
214
+ value: w(s.exactSales),
215
+ sub: C(s.completedBills, "completed bills")
216
+ },
217
+ {
218
+ key: "rewardValueUsed",
219
+ label: "Reward Value Used",
220
+ value: w(s.rewardValueUsed),
221
+ sub: "voucher discount used"
222
+ },
223
+ {
224
+ key: "unusedVoucherValue",
225
+ label: "Unused Voucher Value",
226
+ value: w(s.unusedVoucherValue),
227
+ sub: "issued, not yet redeemed"
228
+ }
229
+ ],
230
+ trend: qe(e),
231
+ breakdown: {
232
+ dimension: "Outlet",
233
+ columns: [
234
+ "Redeemed members",
235
+ "Voucher uses",
236
+ "Completed bills",
237
+ "Exact sales",
238
+ "Reward value used"
239
+ ],
240
+ rows: i.performanceDetails.map((p) => ({
241
+ name: p.restaurantName,
242
+ cells: [
243
+ p.redeemedMembers.toLocaleString(),
244
+ p.voucherUses.toLocaleString(),
245
+ p.completedBills.toLocaleString(),
246
+ w(p.exactSales),
247
+ w(p.rewardValueUsed)
248
+ ]
249
+ }))
250
+ },
251
+ outcomes: [
252
+ {
253
+ key: "exactSales",
254
+ label: "Exact Sales",
255
+ value: w(s.exactSales)
256
+ },
257
+ {
258
+ key: "attributedBills",
259
+ label: "Attributed Bills",
260
+ value: s.completedBills.toLocaleString()
261
+ },
262
+ {
263
+ key: "rewardValueUsed",
264
+ label: "Reward Value Used",
265
+ value: w(s.rewardValueUsed)
266
+ },
267
+ {
268
+ key: "averageBillValue",
269
+ label: "Average Bill Value",
270
+ value: w(x)
271
+ }
272
+ ],
273
+ metrics: [
274
+ {
275
+ key: "memberRedemptionRate",
276
+ label: "Member Redemption Rate",
277
+ value: `${h}%`,
278
+ helper: "Redeemed members ÷ distributed members"
279
+ },
280
+ {
281
+ key: "voucherUtilizationRate",
282
+ label: "Voucher Utilization Rate",
283
+ value: `${r}%`,
284
+ helper: "Redeemed vouchers ÷ distributed vouchers"
285
+ },
286
+ {
287
+ key: "averageDiscountPerBill",
288
+ label: "Average Discount per Bill",
289
+ value: w(c),
290
+ helper: "Reward value used ÷ completed bills"
291
+ },
292
+ {
293
+ key: "averageBillValue",
294
+ label: "Average Bill Value",
295
+ value: w(x),
296
+ helper: "Exact sales ÷ completed bills"
297
+ },
298
+ {
299
+ key: "breakageRate",
300
+ label: "Breakage Rate to date",
301
+ value: `${R}%`,
302
+ helper: "Expired unused vouchers ÷ distributed vouchers"
303
+ }
304
+ ]
305
+ };
306
+ }
307
+ function Be(t, i) {
308
+ const { metrics: e, scope: s } = i, l = D(
309
+ e.memberBills,
310
+ e.attributedBills
311
+ ), h = D(
312
+ e.nonMemberBills,
313
+ e.attributedBills
314
+ ), r = D(
315
+ e.memberSales,
316
+ e.exactSales
317
+ ), c = e.attributedBills ? e.promotionValueUsed / e.attributedBills : 0, x = e.attributedBills ? e.exactSales / e.attributedBills : 0;
318
+ return {
319
+ ...t,
320
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
321
+ audienceLabel: void 0,
322
+ funnel: [],
323
+ cards: [],
324
+ trend: [],
325
+ applicationMix: {
326
+ memberBills: m(e.memberBills),
327
+ appliedMembers: m(e.appliedMembers),
328
+ nonMemberBills: m(e.nonMemberBills),
329
+ memberSales: w(e.memberSales),
330
+ nonMemberSales: w(e.nonMemberSales),
331
+ memberBillSharePct: l,
332
+ nonMemberBillSharePct: h,
333
+ memberSalesSharePct: r,
334
+ summary: `Members account for ${l}% of attributed bills and ${r}% of attributed sales.`
335
+ },
336
+ breakdown: {
337
+ dimension: "Outlet",
338
+ columns: [
339
+ "Applied members",
340
+ "Member bills",
341
+ "Non-member bills",
342
+ "Attributed bills",
343
+ "Exact sales",
344
+ "Promotion value used"
345
+ ],
346
+ rows: i.performanceDetails.map((R) => ({
347
+ name: R.restaurantName,
348
+ cells: [
349
+ m(R.appliedMembers),
350
+ m(R.memberBills),
351
+ m(R.nonMemberBills),
352
+ m(R.attributedBills),
353
+ w(R.exactSales),
354
+ w(R.promotionValueUsed)
355
+ ]
356
+ }))
357
+ },
358
+ outcomes: [
359
+ {
360
+ key: "exactSales",
361
+ label: "Exact Sales",
362
+ value: w(e.exactSales)
363
+ },
364
+ {
365
+ key: "attributedBills",
366
+ label: "Attributed Bills",
367
+ value: m(e.attributedBills)
368
+ },
369
+ {
370
+ key: "promotionValueUsed",
371
+ label: "Promotion Value Used",
372
+ value: w(e.promotionValueUsed)
373
+ },
374
+ {
375
+ key: "averageBillValue",
376
+ label: "Average Bill Value",
377
+ value: w(x)
378
+ }
379
+ ],
380
+ metrics: [
381
+ {
382
+ key: "memberApplicationShare",
383
+ label: "Member Application Share",
384
+ value: `${l}%`,
385
+ helper: "Member bills ÷ attributed bills"
386
+ },
387
+ {
388
+ key: "nonMemberApplicationShare",
389
+ label: "Non-member Application Share",
390
+ value: `${h}%`,
391
+ helper: "Non-member bills ÷ attributed bills"
392
+ },
393
+ {
394
+ key: "memberSalesShare",
395
+ label: "Member Sales Share",
396
+ value: `${r}%`,
397
+ helper: "Member sales ÷ exact sales"
398
+ },
399
+ {
400
+ key: "averageDiscountPerBill",
401
+ label: "Average Discount per Bill",
402
+ value: w(c),
403
+ helper: "Promotion value used ÷ attributed bills"
404
+ },
405
+ {
406
+ key: "averageBillValue",
407
+ label: "Average Bill Value",
408
+ value: w(x),
409
+ helper: "Exact sales ÷ attributed bills"
410
+ }
411
+ ]
412
+ };
413
+ }
414
+ function Ne(t, i) {
415
+ const { metrics: e, scope: s } = i, l = e.participants ? e.stampsEarned / e.participants : 0, h = Math.max(
416
+ e.completionEvents - e.completedMembers,
417
+ 0
418
+ );
419
+ return {
420
+ ...t,
421
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
422
+ funnel: [],
423
+ cards: [
424
+ {
425
+ key: "participants",
426
+ label: "Participants",
427
+ value: m(e.participants),
428
+ sub: "members receiving stamps",
429
+ helper: "Distinct members receiving at least one campaign Stamp"
430
+ },
431
+ {
432
+ key: "stampsEarned",
433
+ label: "Stamps Earned",
434
+ value: m(e.stampsEarned),
435
+ sub: "stamps"
436
+ },
437
+ {
438
+ key: "stampTransactions",
439
+ label: "Stamp Transactions",
440
+ value: m(e.stampTransactions),
441
+ sub: "transactions"
442
+ },
443
+ {
444
+ key: "completedMembers",
445
+ label: "Completed Members",
446
+ value: m(e.completedMembers),
447
+ sub: "completed at least once",
448
+ helper: "Distinct participants completing the Mission at least once"
449
+ },
450
+ {
451
+ key: "completionEvents",
452
+ label: "Completion Events",
453
+ value: m(e.completionEvents),
454
+ sub: "includes repeat completions",
455
+ helper: "All Mission target crossings, including repeat completions"
456
+ }
457
+ ],
458
+ trend: [],
459
+ breakdown: null,
460
+ breakdowns: [
461
+ {
462
+ title: "Reward performance",
463
+ emptyMessage: "No reward activity was recorded for this campaign.",
464
+ breakdown: {
465
+ dimension: "Reward",
466
+ columns: [
467
+ "Reward type",
468
+ "Recipients",
469
+ "Issue transactions",
470
+ "Quantity issued"
471
+ ],
472
+ rows: i.rewards.map((r) => ({
473
+ name: r.rewardName,
474
+ cells: [
475
+ r.rewardType,
476
+ m(r.recipients),
477
+ m(r.issuanceTransactions),
478
+ m(r.quantityIssued)
479
+ ]
480
+ }))
481
+ }
482
+ },
483
+ {
484
+ title: "Performance by outlet",
485
+ emptyMessage: "No outlet activity was recorded for this campaign.",
486
+ breakdown: {
487
+ dimension: "Outlet",
488
+ columns: ["Participants", "Stamps earned", "Completion events"],
489
+ rows: i.performanceDetails.map((r) => ({
490
+ name: r.restaurantName || "Unattributed / online",
491
+ cells: [
492
+ m(r.participants),
493
+ m(r.stampsEarned),
494
+ m(r.completionEvents)
495
+ ]
496
+ }))
497
+ }
498
+ }
499
+ ],
500
+ outcomes: [
501
+ {
502
+ key: "rewardRecipients",
503
+ label: "Reward Recipients",
504
+ value: m(e.rewardRecipients)
505
+ },
506
+ {
507
+ key: "rewardIssueTransactions",
508
+ label: "Reward Issue Transactions",
509
+ value: m(e.rewardIssueTransactions)
510
+ }
511
+ ],
512
+ metrics: [
513
+ {
514
+ key: "completionReach",
515
+ label: "Completion Reach",
516
+ value: `${D(e.completedMembers, e.participants)}%`,
517
+ helper: "Completed members ÷ participants"
518
+ },
519
+ {
520
+ key: "rewardReach",
521
+ label: "Reward Reach",
522
+ value: `${D(e.rewardRecipients, e.participants)}%`,
523
+ helper: "Reward recipients ÷ participants"
524
+ },
525
+ {
526
+ key: "averageStampsPerParticipant",
527
+ label: "Average Stamps per Participant",
528
+ value: l.toLocaleString("en-MY", {
529
+ maximumFractionDigits: 2
530
+ }),
531
+ helper: "Stamps earned ÷ participants"
532
+ },
533
+ {
534
+ key: "repeatCompletionEvents",
535
+ label: "Repeat Completion Events",
536
+ value: m(h),
537
+ helper: "Completion events beyond the first completion per member"
538
+ }
539
+ ]
540
+ };
541
+ }
542
+ function Ve(t, i) {
543
+ const { metrics: e, scope: s } = i, l = D(e.players, e.tokenRecipients), h = D(e.plays, e.tokensIssued), r = D(
544
+ e.rewardRecipients,
545
+ e.players
546
+ ), c = e.players ? e.plays / e.players : 0;
547
+ return {
548
+ ...t,
549
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
550
+ audienceLabel: void 0,
551
+ funnel: [
552
+ {
553
+ key: "tokenRecipients",
554
+ label: "Token recipients",
555
+ membersLabel: C(e.tokenRecipients, "members"),
556
+ unitsLabel: C(e.tokensIssued, "tokens"),
557
+ extra: `${m(e.plays)} plays · ${h}% token utilization`,
558
+ helper: "Distinct members who received at least one game token"
559
+ },
560
+ {
561
+ key: "players",
562
+ label: "Players",
563
+ membersLabel: C(e.players, "members"),
564
+ unitsLabel: C(e.plays, "plays"),
565
+ ratePct: l,
566
+ rateLabel: `${l}% of token recipients`,
567
+ helper: "Distinct members who consumed at least one game token"
568
+ },
569
+ {
570
+ key: "rewardRecipients",
571
+ label: "Reward recipients",
572
+ membersLabel: C(e.rewardRecipients, "members"),
573
+ unitsLabel: C(
574
+ e.rewardIssueTransactions,
575
+ "reward issue transactions"
576
+ ),
577
+ ratePct: r,
578
+ rateLabel: `${r}% of players`,
579
+ helper: "Distinct players receiving at least one Reward Pool reward"
580
+ }
581
+ ],
582
+ cards: [
583
+ {
584
+ key: "tokenRecipients",
585
+ label: "Token Recipients",
586
+ value: m(e.tokenRecipients),
587
+ sub: "members"
588
+ },
589
+ {
590
+ key: "tokensIssued",
591
+ label: "Tokens Issued",
592
+ value: m(e.tokensIssued),
593
+ sub: "game tokens"
594
+ },
595
+ {
596
+ key: "players",
597
+ label: "Players",
598
+ value: m(e.players),
599
+ sub: "members"
600
+ },
601
+ {
602
+ key: "plays",
603
+ label: "Plays",
604
+ value: m(e.plays),
605
+ sub: "game plays"
606
+ }
607
+ ],
608
+ trend: [],
609
+ breakdown: null,
610
+ breakdowns: [
611
+ {
612
+ title: "Reward performance",
613
+ emptyMessage: "No reward activity was recorded for this campaign.",
614
+ breakdown: {
615
+ dimension: "Reward",
616
+ columns: [
617
+ "Reward type",
618
+ "Recipients",
619
+ "Issue transactions",
620
+ "Quantity issued"
621
+ ],
622
+ rows: i.rewards.map((x) => ({
623
+ name: x.rewardName || "Unnamed reward",
624
+ cells: [
625
+ x.rewardType,
626
+ m(x.recipients),
627
+ m(x.issuanceTransactions),
628
+ m(x.quantityIssued)
629
+ ]
630
+ }))
631
+ }
632
+ },
633
+ {
634
+ title: "Token distribution by outlet",
635
+ emptyMessage: "No token distribution activity was recorded for this campaign.",
636
+ breakdown: {
637
+ dimension: "Outlet",
638
+ columns: ["Recipients", "Tokens issued"],
639
+ rows: i.tokenDistributionDetails.map((x) => ({
640
+ name: x.restaurantName || "Unattributed / online",
641
+ cells: [
642
+ m(x.recipients),
643
+ m(x.tokensIssued)
644
+ ]
645
+ }))
646
+ }
647
+ }
648
+ ],
649
+ outcomes: [
650
+ {
651
+ key: "rewardRecipients",
652
+ label: "Reward Recipients",
653
+ value: m(e.rewardRecipients)
654
+ },
655
+ {
656
+ key: "rewardIssueTransactions",
657
+ label: "Reward Issue Transactions",
658
+ value: m(e.rewardIssueTransactions)
659
+ }
660
+ ],
661
+ metrics: [
662
+ {
663
+ key: "playerRate",
664
+ label: "Player Rate",
665
+ value: `${l}%`,
666
+ helper: "Players ÷ token recipients"
667
+ },
668
+ {
669
+ key: "tokenUtilizationRate",
670
+ label: "Token Utilization Rate",
671
+ value: `${h}%`,
672
+ helper: "Plays ÷ tokens issued"
673
+ },
674
+ {
675
+ key: "rewardRecipientRate",
676
+ label: "Reward Recipient Rate",
677
+ value: `${r}%`,
678
+ helper: "Reward recipients ÷ players"
679
+ },
680
+ {
681
+ key: "averagePlaysPerPlayer",
682
+ label: "Average Plays per Player",
683
+ value: c.toLocaleString("en-MY", {
684
+ maximumFractionDigits: 2
685
+ }),
686
+ helper: "Plays ÷ players"
687
+ }
688
+ ]
689
+ };
690
+ }
691
+ function Q(t, i) {
692
+ return i ? w(t ?? 0) : m(t);
693
+ }
694
+ function X(t, i) {
695
+ return t[i] ?? 0;
696
+ }
697
+ function ae(t, i, e) {
698
+ const { metrics: s, scope: l } = i, h = s.recipients ? X(s, e.quantityKey) / s.recipients : 0, r = s.issuanceTransactions ? X(s, e.quantityKey) / s.issuanceTransactions : 0, c = [
699
+ "Recipients",
700
+ ...e.includeSourceRecipientShare ? ["Recipient share"] : [],
701
+ "Issuance transactions",
702
+ e.quantityLabel
703
+ ], x = i.sourceDetails.map((p) => ({
704
+ name: p.source || "Unknown",
705
+ cells: [
706
+ m(p.recipients),
707
+ ...e.includeSourceRecipientShare ? [`${D(p.recipients, s.recipients)}%`] : [],
708
+ m(p.issuanceTransactions),
709
+ Q(
710
+ X(p, e.quantityKey),
711
+ e.currency
712
+ )
713
+ ]
714
+ })), R = [
715
+ {
716
+ key: "averagePerRecipient",
717
+ label: `Average ${e.quantityName} per Recipient`,
718
+ value: Q(h, e.currency),
719
+ helper: `${e.quantityLabel} ÷ recipients`
720
+ },
721
+ {
722
+ key: "averagePerIssue",
723
+ label: `Average ${e.quantityName} per Issue`,
724
+ value: Q(r, e.currency),
725
+ helper: `${e.quantityLabel} ÷ issuance transactions`
726
+ }
727
+ ];
728
+ return e.includeSourceRecipientShare && R.push({
729
+ key: "recipientShareBySource",
730
+ label: "Recipient Share by Source",
731
+ value: "See source breakdown",
732
+ helper: "Source recipients ÷ total recipients"
733
+ }), {
734
+ ...t,
735
+ reportRangeLabel: l.startDate && l.endDate ? `${N(l.startDate)} – ${N(l.endDate)}` : "Unavailable",
736
+ audienceLabel: void 0,
737
+ funnel: [],
738
+ cards: [
739
+ {
740
+ key: "recipients",
741
+ label: `${e.label} Recipients`,
742
+ value: m(s.recipients),
743
+ sub: "members",
744
+ helper: `Distinct members receiving ${e.quantityName.toLowerCase()}`
745
+ },
746
+ {
747
+ key: "issuanceTransactions",
748
+ label: "Issuance Transactions",
749
+ value: m(s.issuanceTransactions),
750
+ sub: "transactions"
751
+ },
752
+ {
753
+ key: e.quantityKey,
754
+ label: e.quantityLabel.replace(/^./, (p) => p.toUpperCase()),
755
+ value: Q(
756
+ X(s, e.quantityKey),
757
+ e.currency
758
+ ),
759
+ sub: e.quantityUnit
760
+ }
761
+ ],
762
+ trend: [],
763
+ breakdown: null,
764
+ breakdowns: [
765
+ {
766
+ title: "Distribution by source",
767
+ emptyMessage: "No source activity was recorded for this campaign.",
768
+ breakdown: {
769
+ dimension: "Source",
770
+ columns: c,
771
+ rows: x
772
+ }
773
+ },
774
+ {
775
+ title: "Performance by outlet",
776
+ emptyMessage: "No outlet activity was recorded for this campaign.",
777
+ breakdown: {
778
+ dimension: "Outlet",
779
+ columns: [
780
+ "Recipients",
781
+ "Issuance transactions",
782
+ e.quantityLabel
783
+ ],
784
+ rows: i.performanceDetails.map((p) => ({
785
+ name: p.restaurantName || "Unattributed / online",
786
+ cells: [
787
+ m(p.recipients),
788
+ m(p.issuanceTransactions),
789
+ Q(
790
+ X(p, e.quantityKey),
791
+ e.currency
792
+ )
793
+ ]
794
+ }))
795
+ }
796
+ }
797
+ ],
798
+ outcomes: [],
799
+ metrics: R
800
+ };
801
+ }
802
+ function Ue(t, i) {
803
+ return ae(t, i, {
804
+ label: "Point",
805
+ quantityName: "Points",
806
+ quantityLabel: "Points issued",
807
+ quantityUnit: "points",
808
+ quantityKey: "pointsIssued",
809
+ currency: !1,
810
+ includeSourceRecipientShare: !0
811
+ });
812
+ }
813
+ function Fe(t, i) {
814
+ return ae(t, i, {
815
+ label: "Experience",
816
+ quantityName: "Experience",
817
+ quantityLabel: "Experience issued",
818
+ quantityUnit: "experience",
819
+ quantityKey: "experienceIssued",
820
+ currency: !1,
821
+ includeSourceRecipientShare: !0
822
+ });
823
+ }
824
+ function Ae(t, i) {
825
+ return ae(t, i, {
826
+ label: "Credit",
827
+ quantityName: "Credit",
828
+ quantityLabel: "Credit issued",
829
+ quantityUnit: "credit",
830
+ quantityKey: "creditIssued",
831
+ currency: !0,
832
+ includeSourceRecipientShare: !1
833
+ });
834
+ }
835
+ function qe(t) {
836
+ if (!(t != null && t.categories.length)) return [];
837
+ const i = {
838
+ key: "members",
839
+ label: "Distributed members vs Redeemed members",
840
+ categories: t.categories,
841
+ series: [
842
+ { label: "Distributed members", values: t.distributedMembers },
843
+ { label: "Redeemed members", values: t.redeemedMembers }
844
+ ]
845
+ };
846
+ return t.distributedValue == null ? [i] : [
847
+ i,
848
+ {
849
+ key: "value",
850
+ label: "Distributed voucher value vs Reward value used",
851
+ categories: t.categories,
852
+ series: [
853
+ {
854
+ label: "Distributed voucher value",
855
+ values: t.distributedValue
856
+ },
857
+ { label: "Reward value used", values: t.rewardValueUsed }
858
+ ]
859
+ }
860
+ ];
861
+ }
862
+ function je(t) {
863
+ return [
864
+ {
865
+ header: t.dimension,
866
+ accessorFn: (i) => i.name
867
+ },
868
+ ...t.columns.map((i, e) => ({
869
+ header: i,
870
+ accessorFn: (s) => s.cells[e] ?? ""
871
+ }))
872
+ ];
873
+ }
874
+ const ze = {
875
+ key: 0,
876
+ class: "flex items-center gap-8 mb-8"
877
+ }, Ge = { class: "fm-typo-en-body-sm-600 text-fm-color-primary uppercase" }, He = { class: "flex items-center gap-12 mb-12 flex-wrap" }, Ke = { class: "fm-typo-en-title-lg-800 text-fm-color-typo-primary m-0" }, Ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-wrap gap-x-16 gap-y-4" }, Qe = {
878
+ key: 1,
879
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4"
880
+ }, Xe = /* @__PURE__ */ q({
881
+ __name: "CampaignAnalyticHeader",
882
+ props: {
883
+ campaignName: {},
884
+ datesLabel: {},
885
+ statusChip: {},
886
+ mechanicLabel: {},
887
+ icon: {},
888
+ objective: {},
889
+ reportRangeLabel: {},
890
+ audienceLabel: {},
891
+ demo: { type: Boolean }
892
+ },
893
+ setup(t) {
894
+ return (i, e) => {
895
+ const s = _("FmIcon"), l = _("FmChip"), h = _("FmCard");
896
+ return n(), f(h, {
897
+ variant: "outlined",
898
+ class: "p-24"
899
+ }, {
900
+ default: P(() => [
901
+ t.mechanicLabel ? (n(), b("div", ze, [
902
+ t.icon ? (n(), f(s, {
903
+ key: 0,
904
+ name: t.icon,
905
+ outline: "",
906
+ size: "sm",
907
+ class: "!text-fm-color-primary"
908
+ }, null, 8, ["name"])) : v("", !0),
909
+ a("span", Ge, d(t.objective ? `${t.mechanicLabel} · ${t.objective}` : t.mechanicLabel), 1)
910
+ ])) : v("", !0),
911
+ a("div", He, [
912
+ a("h1", Ke, d(t.campaignName), 1),
913
+ t.statusChip ? (n(), f(ve(t.statusChip), { key: 0 })) : v("", !0),
914
+ t.demo ? (n(), f(l, {
915
+ key: 1,
916
+ class: "!text-fm-color-typo-warning !bg-fm-color-system-warning-100",
917
+ compact: "",
918
+ label: "Demo data"
919
+ })) : v("", !0)
920
+ ]),
921
+ a("div", Ye, [
922
+ a("span", null, d(t.datesLabel), 1),
923
+ t.reportRangeLabel ? (n(), b(L, { key: 0 }, [
924
+ e[0] || (e[0] = a("span", { class: "text-fm-color-typo-disabled" }, "·", -1)),
925
+ a("span", null, "Reporting: " + d(t.reportRangeLabel), 1)
926
+ ], 64)) : v("", !0)
927
+ ]),
928
+ t.audienceLabel ? (n(), b("div", Qe, " Audience: " + d(t.audienceLabel), 1)) : v("", !0)
929
+ ]),
930
+ _: 1
931
+ });
932
+ };
933
+ }
934
+ }), Je = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16" }, We = { class: "min-w-0" }, Ze = { class: "fm-typo-en-title-sm-800 mt-8" }, et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, tt = { class: "min-w-0" }, at = { class: "fm-typo-en-title-sm-800 mt-8" }, st = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16 mt-16" }, rt = { class: "min-w-0" }, lt = { class: "fm-typo-en-title-sm-800 mt-8" }, nt = { class: "min-w-0" }, it = { class: "fm-typo-en-title-sm-800 mt-8" }, ot = ["aria-label"], ct = { class: "flex h-12 overflow-hidden rounded-xxxl bg-fm-color-neutral-gray-100" }, mt = { class: "flex justify-between gap-16 mt-8 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ut = { class: "mt-16 pt-12 border-t border-fm-color-neutral-gray-100 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, dt = /* @__PURE__ */ q({
935
+ __name: "PromotionApplicationMix",
936
+ props: {
937
+ mix: {}
938
+ },
939
+ setup(t) {
940
+ return (i, e) => {
941
+ const s = _("FmCard");
942
+ return n(), f(s, {
943
+ variant: "outlined",
944
+ class: "p-24"
945
+ }, {
946
+ default: P(() => [
947
+ e[4] || (e[4] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Application mix ", -1)),
948
+ e[5] || (e[5] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-16" }, " Completed bills attributed to this promotion ", -1)),
949
+ a("div", Je, [
950
+ a("div", We, [
951
+ e[0] || (e[0] = a("div", { class: "flex items-center gap-8" }, [
952
+ a("div", { class: "w-8 h-8 rounded-sm bg-fm-color-primary" }),
953
+ a("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member bills ")
954
+ ], -1)),
955
+ a("div", Ze, d(t.mix.memberBills), 1),
956
+ a("div", et, d(t.mix.appliedMembers) + " applied members ", 1)
957
+ ]),
958
+ a("div", tt, [
959
+ e[1] || (e[1] = a("div", { class: "flex items-center gap-8" }, [
960
+ a("div", { class: "w-8 h-8 rounded-sm bg-fm-color-neutral-gray-200" }),
961
+ a("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member bills ")
962
+ ], -1)),
963
+ a("div", at, d(t.mix.nonMemberBills), 1)
964
+ ])
965
+ ]),
966
+ a("div", st, [
967
+ a("div", rt, [
968
+ e[2] || (e[2] = a("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member sales ", -1)),
969
+ a("div", lt, d(t.mix.memberSales), 1)
970
+ ]),
971
+ a("div", nt, [
972
+ e[3] || (e[3] = a("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member sales ", -1)),
973
+ a("div", it, d(t.mix.nonMemberSales), 1)
974
+ ])
975
+ ]),
976
+ a("div", {
977
+ class: "mt-24",
978
+ role: "img",
979
+ "aria-label": t.mix.summary
980
+ }, [
981
+ a("div", ct, [
982
+ a("div", {
983
+ class: "h-full bg-fm-color-primary",
984
+ style: me({ width: t.mix.memberBillSharePct + "%" })
985
+ }, null, 4),
986
+ a("div", {
987
+ class: "h-full bg-fm-color-neutral-gray-200",
988
+ style: me({ width: t.mix.nonMemberBillSharePct + "%" })
989
+ }, null, 4)
990
+ ]),
991
+ a("div", mt, [
992
+ a("span", null, "Members " + d(t.mix.memberBillSharePct) + "%", 1),
993
+ a("span", null, "Non-members " + d(t.mix.nonMemberBillSharePct) + "%", 1)
994
+ ])
995
+ ], 8, ot),
996
+ a("div", ut, d(t.mix.summary), 1)
997
+ ]),
998
+ _: 1
999
+ });
1000
+ };
1001
+ }
1002
+ }), pt = { class: "flex xs:flex-col items-stretch" }, yt = { class: "flex-1 min-w-0 px-16 xs:px-4 xs:py-12" }, bt = { class: "flex items-center gap-4" }, vt = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, ft = {
1003
+ key: 0,
1004
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-disabled italic mt-8"
1005
+ }, ht = { class: "fm-typo-en-title-sm-800 text-fm-color-typo-primary mt-8" }, gt = {
1006
+ key: 0,
1007
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1008
+ }, xt = {
1009
+ key: 1,
1010
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1011
+ }, kt = {
1012
+ key: 2,
1013
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1014
+ }, wt = {
1015
+ key: 3,
1016
+ class: "mt-8"
1017
+ }, Rt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, Mt = {
1018
+ key: 0,
1019
+ class: "flex items-center justify-center px-4 xs:py-4"
1020
+ }, _t = /* @__PURE__ */ q({
1021
+ __name: "CampaignFunnel",
1022
+ props: {
1023
+ stages: {}
1024
+ },
1025
+ setup(t) {
1026
+ return (i, e) => {
1027
+ const s = _("FmProgressBar"), l = _("FmIcon"), h = _("FmCard");
1028
+ return n(), f(h, {
1029
+ variant: "outlined",
1030
+ class: "p-24"
1031
+ }, {
1032
+ default: P(() => [
1033
+ e[0] || (e[0] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign funnel ", -1)),
1034
+ e[1] || (e[1] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-16" }, " Campaign activity at each stage ", -1)),
1035
+ a("div", pt, [
1036
+ (n(!0), b(L, null, Z(t.stages, (r, c) => (n(), b("div", {
1037
+ key: r.key,
1038
+ class: "flex xs:flex-col flex-1 min-w-0 items-stretch"
1039
+ }, [
1040
+ a("div", yt, [
1041
+ a("div", bt, [
1042
+ a("span", vt, d(r.label), 1),
1043
+ r.helper ? (n(), f(W, {
1044
+ key: 0,
1045
+ description: r.helper
1046
+ }, null, 8, ["description"])) : v("", !0)
1047
+ ]),
1048
+ r.notSupported ? (n(), b("div", ft, d(r.helper), 1)) : (n(), b(L, { key: 1 }, [
1049
+ a("div", ht, d(r.primaryLabel ?? r.membersLabel ?? "—"), 1),
1050
+ r.unitsLabel ? (n(), b("div", gt, d(r.unitsLabel), 1)) : v("", !0),
1051
+ r.valueLabel ? (n(), b("div", xt, d(r.valueLabel), 1)) : v("", !0),
1052
+ r.extra ? (n(), b("div", kt, d(r.extra), 1)) : v("", !0),
1053
+ r.ratePct !== void 0 ? (n(), b("div", wt, [
1054
+ I(s, {
1055
+ value: r.ratePct,
1056
+ color: "primary",
1057
+ size: "sm"
1058
+ }, null, 8, ["value"]),
1059
+ a("div", Rt, d(r.rateLabel), 1)
1060
+ ])) : v("", !0)
1061
+ ], 64))
1062
+ ]),
1063
+ c < t.stages.length - 1 ? (n(), b("div", Mt, [
1064
+ I(l, {
1065
+ name: "chevron_right",
1066
+ size: "sm",
1067
+ class: "text-fm-color-neutral-gray-300 xs:rotate-90"
1068
+ })
1069
+ ])) : v("", !0)
1070
+ ]))), 128))
1071
+ ])
1072
+ ]),
1073
+ _: 1
1074
+ });
1075
+ };
1076
+ }
1077
+ }), St = { class: "grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] xs:grid-cols-1 gap-16" }, It = { class: "flex items-center gap-8" }, Ct = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, Ot = {
1078
+ key: 0,
1079
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1080
+ }, te = /* @__PURE__ */ q({
1081
+ __name: "CampaignMetricCards",
1082
+ props: {
1083
+ cards: {}
1084
+ },
1085
+ setup(t) {
1086
+ return (i, e) => {
1087
+ const s = _("FmCard");
1088
+ return n(), b("section", St, [
1089
+ (n(!0), b(L, null, Z(t.cards, (l) => (n(), f(s, {
1090
+ key: l.key,
1091
+ variant: "outlined",
1092
+ class: "flex flex-col gap-4 p-16 min-w-0 overflow-hidden"
1093
+ }, {
1094
+ default: P(() => [
1095
+ a("div", It, [
1096
+ a("span", Ct, d(l.label), 1),
1097
+ l.helper ? (n(), f(W, {
1098
+ key: 0,
1099
+ description: l.helper
1100
+ }, null, 8, ["description"])) : v("", !0)
1101
+ ]),
1102
+ a("div", {
1103
+ class: J([
1104
+ "fm-typo-en-title-sm-800 truncate",
1105
+ l.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1106
+ ])
1107
+ }, d(l.value), 3),
1108
+ l.sub ? (n(), b("div", Ot, d(l.sub), 1)) : v("", !0)
1109
+ ]),
1110
+ _: 2
1111
+ }, 1024))), 128))
1112
+ ]);
1113
+ };
1114
+ }
1115
+ }), Pt = { class: "flex items-center justify-between gap-12 flex-wrap mb-16 xs:flex-col xs:items-start" }, Dt = {
1116
+ key: 0,
1117
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary mb-12"
1118
+ }, $t = /* @__PURE__ */ q({
1119
+ __name: "CampaignTrendChart",
1120
+ props: {
1121
+ modes: {}
1122
+ },
1123
+ setup(t) {
1124
+ var R;
1125
+ const i = t, e = ["#FF7823", "#B2B3B6"], s = G(((R = i.modes[0]) == null ? void 0 : R.key) ?? ""), l = E(
1126
+ () => i.modes.map((p) => ({ label: p.label, value: p.key }))
1127
+ ), h = E(
1128
+ () => l.value.find((p) => p.value === s.value) ?? null
1129
+ ), r = E(
1130
+ () => i.modes.find((p) => p.key === s.value) ?? i.modes[0]
1131
+ ), c = E(
1132
+ () => {
1133
+ var p;
1134
+ return (((p = r.value) == null ? void 0 : p.series) ?? []).map((u, $) => ({
1135
+ label: u.label,
1136
+ data: u.values,
1137
+ color: e[$] ?? e[e.length - 1],
1138
+ dash: $ > 0
1139
+ }));
1140
+ }
1141
+ ), x = { display: !0 };
1142
+ return (p, u) => {
1143
+ const $ = _("FmButtonGroup"), M = _("FmLineChart"), k = _("FmCard");
1144
+ return n(), f(k, {
1145
+ variant: "outlined",
1146
+ class: "p-24"
1147
+ }, {
1148
+ default: P(() => [
1149
+ a("div", Pt, [
1150
+ u[1] || (u[1] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Funnel trend ", -1)),
1151
+ t.modes.length > 1 ? (n(), f($, {
1152
+ key: 0,
1153
+ items: o(l),
1154
+ "model-value": o(h),
1155
+ "onUpdate:modelValue": u[0] || (u[0] = (ee) => s.value = ee.value)
1156
+ }, null, 8, ["items", "model-value"])) : v("", !0)
1157
+ ]),
1158
+ o(r) ? (n(), b("div", Dt, d(o(r).label), 1)) : v("", !0),
1159
+ o(r) ? (n(), f(M, {
1160
+ key: 1,
1161
+ datasets: o(c),
1162
+ "x-axis": { categories: o(r).categories },
1163
+ "x-cfg": x,
1164
+ "y-cfg": x,
1165
+ legend: { display: !0 },
1166
+ height: "150px"
1167
+ }, null, 8, ["datasets", "x-axis"])) : v("", !0)
1168
+ ]),
1169
+ _: 1
1170
+ });
1171
+ };
1172
+ }
1173
+ }), Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Lt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-12" }, Tt = {
1174
+ key: 1,
1175
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1176
+ }, Bt = {
1177
+ key: 2,
1178
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1179
+ }, de = /* @__PURE__ */ q({
1180
+ __name: "CampaignBreakdownTable",
1181
+ props: {
1182
+ breakdown: {},
1183
+ title: { default: "Performance details" },
1184
+ emptyMessage: { default: "No outlet activity was recorded for this campaign." }
1185
+ },
1186
+ setup(t) {
1187
+ const i = t, e = E(
1188
+ () => i.breakdown ? je(i.breakdown) : []
1189
+ );
1190
+ return (s, l) => {
1191
+ const h = _("FmTable"), r = _("FmCard");
1192
+ return n(), f(r, {
1193
+ variant: "outlined",
1194
+ class: "p-24"
1195
+ }, {
1196
+ default: P(() => {
1197
+ var c;
1198
+ return [
1199
+ a("div", Et, d(t.title), 1),
1200
+ (c = t.breakdown) != null && c.rows.length ? (n(), b(L, { key: 0 }, [
1201
+ a("div", Lt, " By " + d(t.breakdown.dimension), 1),
1202
+ I(h, {
1203
+ "row-data": t.breakdown.rows,
1204
+ "column-defs": o(e),
1205
+ "column-filter": [],
1206
+ "hide-footer": ""
1207
+ }, null, 8, ["row-data", "column-defs"])
1208
+ ], 64)) : t.breakdown ? (n(), b("div", Tt, d(t.emptyMessage), 1)) : (n(), b("div", Bt, " No breakdown dimension is available for this campaign. "))
1209
+ ];
1210
+ }),
1211
+ _: 1
1212
+ });
1213
+ };
1214
+ }
1215
+ }), Nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vt = {
1216
+ key: 0,
1217
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-12"
1218
+ }, Ut = {
1219
+ key: 0,
1220
+ class: "px-16 py-12 rounded-lg bg-fm-color-neutral-gray-100 min-w-0"
1221
+ }, Ft = { class: "flex items-center gap-8" }, At = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, qt = {
1222
+ key: 1,
1223
+ class: "flex items-center justify-between gap-12 py-8 border-b border-fm-color-neutral-gray-100"
1224
+ }, jt = { class: "flex items-center gap-8 min-w-0" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary truncate" }, pe = /* @__PURE__ */ q({
1225
+ __name: "CampaignMetricList",
1226
+ props: {
1227
+ title: {},
1228
+ caption: {},
1229
+ items: {},
1230
+ variant: { default: "tile" }
1231
+ },
1232
+ setup(t) {
1233
+ return (i, e) => {
1234
+ const s = _("FmCard");
1235
+ return n(), f(s, {
1236
+ variant: "outlined",
1237
+ class: "p-24"
1238
+ }, {
1239
+ default: P(() => [
1240
+ a("div", Nt, d(t.title), 1),
1241
+ t.caption ? (n(), b("div", Vt, d(t.caption), 1)) : v("", !0),
1242
+ a("div", {
1243
+ class: J(["grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] xs:grid-cols-1", t.variant === "tile" ? "gap-16" : "gap-x-16"])
1244
+ }, [
1245
+ (n(!0), b(L, null, Z(t.items, (l) => (n(), b(L, {
1246
+ key: l.key
1247
+ }, [
1248
+ t.variant === "tile" ? (n(), b("div", Ut, [
1249
+ a("div", Ft, [
1250
+ a("span", At, d(l.label), 1),
1251
+ l.helper ? (n(), f(W, {
1252
+ key: 0,
1253
+ description: l.helper
1254
+ }, null, 8, ["description"])) : v("", !0)
1255
+ ]),
1256
+ a("div", {
1257
+ class: J([
1258
+ "fm-typo-en-body-lg-600 mt-4 truncate",
1259
+ l.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1260
+ ])
1261
+ }, d(l.value), 3)
1262
+ ])) : (n(), b("div", qt, [
1263
+ a("div", jt, [
1264
+ a("span", zt, d(l.label), 1),
1265
+ l.helper ? (n(), f(W, {
1266
+ key: 0,
1267
+ description: l.helper
1268
+ }, null, 8, ["description"])) : v("", !0)
1269
+ ]),
1270
+ a("span", {
1271
+ class: J([
1272
+ "fm-typo-en-body-md-600 whitespace-nowrap",
1273
+ l.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1274
+ ])
1275
+ }, d(l.value), 3)
1276
+ ]))
1277
+ ], 64))), 128))
1278
+ ], 2)
1279
+ ]),
1280
+ _: 1
1281
+ });
1282
+ };
1283
+ }
1284
+ }), Gt = { class: "flex items-center gap-8" }, Ht = { class: "px-24 flex flex-col gap-16 pb-24" }, Kt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Qt = {
1285
+ key: 0,
1286
+ class: "flex flex-col gap-12"
1287
+ }, Xt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jt = {
1288
+ key: 1,
1289
+ class: "flex flex-col gap-12"
1290
+ }, oa = /* @__PURE__ */ q({
1291
+ __name: "CampaignAnalytic",
1292
+ setup(t) {
1293
+ const { t: i } = he(), e = Me(), s = _e(), { global: l } = xe, h = ge(), r = G(), c = G(), x = G(), R = G(!1), p = G(!1), u = E(() => {
1294
+ var O;
1295
+ return (O = r.value) == null ? void 0 : O.campaign;
1296
+ }), $ = E(
1297
+ () => u.value ? Le(u.value.type) : void 0
1298
+ ), M = E(() => {
1299
+ var O;
1300
+ return (O = $.value) == null ? void 0 : O.report;
1301
+ }), k = E(() => {
1302
+ var O, g, j, z, T, B, U, S, y, F, A, H, K;
1303
+ return M.value && ((O = u.value) == null ? void 0 : O.type) === "COIN" ? Ue(
1304
+ M.value,
1305
+ ((g = c.value) == null ? void 0 : g.type) === "COIN" ? c.value : ne()
1306
+ ) : M.value && ((j = u.value) == null ? void 0 : j.type) === "POINT" ? Fe(
1307
+ M.value,
1308
+ ((z = c.value) == null ? void 0 : z.type) === "POINT" ? c.value : ie()
1309
+ ) : M.value && ((T = u.value) == null ? void 0 : T.type) === "CREDIT" ? Ae(
1310
+ M.value,
1311
+ ((B = c.value) == null ? void 0 : B.type) === "CREDIT" ? c.value : oe()
1312
+ ) : M.value && ((U = u.value) == null ? void 0 : U.type) === "GAME" ? Ve(
1313
+ M.value,
1314
+ ((S = c.value) == null ? void 0 : S.type) === "GAME" ? c.value : le()
1315
+ ) : M.value && ((y = u.value) == null ? void 0 : y.type) === "MISSION" ? Ne(
1316
+ M.value,
1317
+ ((F = c.value) == null ? void 0 : F.type) === "MISSION" ? c.value : re()
1318
+ ) : M.value && ((A = u.value) == null ? void 0 : A.type) === "PROMOTION" ? Be(
1319
+ M.value,
1320
+ ((H = c.value) == null ? void 0 : H.type) === "PROMOTION" ? c.value : se()
1321
+ ) : M.value && ((K = c.value) == null ? void 0 : K.type) === "VOUCHER" ? Te(
1322
+ M.value,
1323
+ c.value,
1324
+ x.value
1325
+ ) : M.value;
1326
+ }), ee = E(
1327
+ () => u.value ? i(ke(u.value.timeframeOptions)) : ""
1328
+ ), ye = E(
1329
+ () => u.value && u.value.type !== "MEMBERSHIP" ? we(u.value) : void 0
1330
+ );
1331
+ function be() {
1332
+ return {
1333
+ type: "VOUCHER",
1334
+ scope: { startDate: "", endDate: "" },
1335
+ metrics: {
1336
+ distributedMembers: 0,
1337
+ distributedVouchers: 0,
1338
+ distributedFixedValue: null,
1339
+ redeemedMembers: 0,
1340
+ redeemedVouchers: 0,
1341
+ voucherUses: 0,
1342
+ expiredUnusedVouchers: 0,
1343
+ completedBills: 0,
1344
+ exactSales: 0,
1345
+ rewardValueUsed: 0,
1346
+ unusedVoucherValue: null
1347
+ },
1348
+ performanceDetails: []
1349
+ };
1350
+ }
1351
+ function se() {
1352
+ return {
1353
+ type: "PROMOTION",
1354
+ scope: { startDate: "", endDate: "" },
1355
+ metrics: {
1356
+ appliedMembers: 0,
1357
+ memberBills: 0,
1358
+ nonMemberBills: 0,
1359
+ attributedBills: 0,
1360
+ memberSales: 0,
1361
+ nonMemberSales: 0,
1362
+ exactSales: 0,
1363
+ promotionValueUsed: 0
1364
+ },
1365
+ performanceDetails: []
1366
+ };
1367
+ }
1368
+ function re() {
1369
+ return {
1370
+ type: "MISSION",
1371
+ scope: { startDate: "", endDate: "" },
1372
+ metrics: {
1373
+ participants: 0,
1374
+ stampsEarned: 0,
1375
+ stampTransactions: 0,
1376
+ rewardRecipients: 0,
1377
+ rewardIssueTransactions: 0,
1378
+ completedMembers: 0,
1379
+ completionEvents: 0
1380
+ },
1381
+ rewards: [],
1382
+ performanceDetails: []
1383
+ };
1384
+ }
1385
+ function le() {
1386
+ return {
1387
+ type: "GAME",
1388
+ scope: { startDate: "", endDate: "" },
1389
+ metrics: {
1390
+ tokenRecipients: 0,
1391
+ tokensIssued: 0,
1392
+ players: 0,
1393
+ plays: 0,
1394
+ rewardRecipients: 0,
1395
+ rewardIssueTransactions: 0
1396
+ },
1397
+ rewards: [],
1398
+ tokenDistributionDetails: []
1399
+ };
1400
+ }
1401
+ function ne() {
1402
+ return {
1403
+ type: "COIN",
1404
+ scope: { startDate: "", endDate: "" },
1405
+ metrics: {
1406
+ recipients: 0,
1407
+ issuanceTransactions: 0,
1408
+ pointsIssued: 0
1409
+ },
1410
+ sourceDetails: [],
1411
+ performanceDetails: []
1412
+ };
1413
+ }
1414
+ function ie() {
1415
+ return {
1416
+ type: "POINT",
1417
+ scope: { startDate: "", endDate: "" },
1418
+ metrics: {
1419
+ recipients: 0,
1420
+ issuanceTransactions: 0,
1421
+ experienceIssued: 0
1422
+ },
1423
+ sourceDetails: [],
1424
+ performanceDetails: []
1425
+ };
1426
+ }
1427
+ function oe() {
1428
+ return {
1429
+ type: "CREDIT",
1430
+ scope: { startDate: "", endDate: "" },
1431
+ metrics: {
1432
+ recipients: 0,
1433
+ issuanceTransactions: 0,
1434
+ creditIssued: 0
1435
+ },
1436
+ sourceDetails: [],
1437
+ performanceDetails: []
1438
+ };
1439
+ }
1440
+ return fe(async () => {
1441
+ var O, g, j, z, T, B, U;
1442
+ try {
1443
+ await l(async () => {
1444
+ var F, A;
1445
+ r.value = await V.readById(e.params.id);
1446
+ const y = e.meta.campaignType;
1447
+ p.value = !!y && ((A = (F = r.value) == null ? void 0 : F.campaign) == null ? void 0 : A.type) !== y;
1448
+ });
1449
+ const S = {
1450
+ timezone: ue[h.currentCountry.value || "MY"] ?? ue.MY
1451
+ };
1452
+ ((O = r.value) == null ? void 0 : O.campaign.type) === "VOUCHER" ? (c.value = be(), await Promise.all([
1453
+ l(
1454
+ () => V.readAnalyticsOverview(e.params.id, {
1455
+ ...S
1456
+ })
1457
+ ).then((y) => {
1458
+ y.type === "VOUCHER" && (c.value = y);
1459
+ }).catch(() => {
1460
+ }),
1461
+ l(
1462
+ () => V.readAnalyticsTrend(e.params.id, S)
1463
+ ).then((y) => x.value = y).catch(() => {
1464
+ })
1465
+ ])) : ((g = r.value) == null ? void 0 : g.campaign.type) === "PROMOTION" ? (c.value = se(), await l(
1466
+ () => V.readAnalyticsOverview(e.params.id, S)
1467
+ ).then((y) => {
1468
+ y.type === "PROMOTION" && (c.value = y);
1469
+ }).catch(() => {
1470
+ })) : ((j = r.value) == null ? void 0 : j.campaign.type) === "MISSION" ? (c.value = re(), await l(
1471
+ () => V.readAnalyticsOverview(e.params.id, S)
1472
+ ).then((y) => {
1473
+ y.type === "MISSION" && (c.value = y);
1474
+ }).catch(() => {
1475
+ })) : ((z = r.value) == null ? void 0 : z.campaign.type) === "GAME" ? (c.value = le(), await l(
1476
+ () => V.readAnalyticsOverview(e.params.id, S)
1477
+ ).then((y) => {
1478
+ y.type === "GAME" && (c.value = y);
1479
+ }).catch(() => {
1480
+ })) : ((T = r.value) == null ? void 0 : T.campaign.type) === "COIN" ? (c.value = ne(), await l(
1481
+ () => V.readAnalyticsOverview(e.params.id, S)
1482
+ ).then((y) => {
1483
+ y.type === "COIN" && (c.value = y);
1484
+ }).catch(() => {
1485
+ })) : ((B = r.value) == null ? void 0 : B.campaign.type) === "POINT" ? (c.value = ie(), await l(
1486
+ () => V.readAnalyticsOverview(e.params.id, S)
1487
+ ).then((y) => {
1488
+ y.type === "POINT" && (c.value = y);
1489
+ }).catch(() => {
1490
+ })) : ((U = r.value) == null ? void 0 : U.campaign.type) === "CREDIT" && (c.value = oe(), await l(
1491
+ () => V.readAnalyticsOverview(e.params.id, S)
1492
+ ).then((y) => {
1493
+ y.type === "CREDIT" && (c.value = y);
1494
+ }).catch(() => {
1495
+ }));
1496
+ } catch {
1497
+ R.value = !0;
1498
+ }
1499
+ }), (O, g) => {
1500
+ var U, S, y, F, A, H, K, ce;
1501
+ const j = _("FmPill"), z = _("FmPageHead"), T = _("FmIcon"), B = _("FmCard");
1502
+ return n(), b(L, null, [
1503
+ I(z, {
1504
+ title: "Campaign analytic",
1505
+ "back-button": !0,
1506
+ "onClick:back": g[0] || (g[0] = (Y) => o(s).back())
1507
+ }, {
1508
+ title: P(() => [
1509
+ a("div", Gt, [
1510
+ g[1] || (g[1] = a("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2" }, " Campaign analytic ", -1)),
1511
+ I(j, { variant: "beta" })
1512
+ ])
1513
+ ]),
1514
+ _: 1
1515
+ }),
1516
+ a("div", Ht, [
1517
+ o(R) ? (n(), f(B, {
1518
+ key: 0,
1519
+ variant: "outlined",
1520
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1521
+ }, {
1522
+ default: P(() => [
1523
+ I(T, {
1524
+ name: "error",
1525
+ outline: "",
1526
+ size: "lg",
1527
+ class: "text-fm-color-neutral-gray-300"
1528
+ }),
1529
+ g[2] || (g[2] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Could not load this campaign ", -1)),
1530
+ g[3] || (g[3] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, " The campaign may have been deleted, or the link is no longer valid. ", -1))
1531
+ ]),
1532
+ _: 1
1533
+ })) : o(u) ? (n(), b(L, { key: 1 }, [
1534
+ I(Xe, {
1535
+ "campaign-name": o(u).name,
1536
+ "dates-label": o(ee),
1537
+ "status-chip": o(ye),
1538
+ "mechanic-label": (U = o($)) == null ? void 0 : U.label,
1539
+ icon: (S = o($)) == null ? void 0 : S.icon,
1540
+ objective: (y = o($)) == null ? void 0 : y.objective,
1541
+ "report-range-label": (F = o(k)) == null ? void 0 : F.reportRangeLabel,
1542
+ "audience-label": (A = o(k)) == null ? void 0 : A.audienceLabel
1543
+ }, null, 8, ["campaign-name", "dates-label", "status-chip", "mechanic-label", "icon", "objective", "report-range-label", "audience-label"]),
1544
+ o(p) ? (n(), f(B, {
1545
+ key: 0,
1546
+ variant: "outlined",
1547
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1548
+ }, {
1549
+ default: P(() => [
1550
+ I(T, {
1551
+ name: "wrong_location",
1552
+ outline: "",
1553
+ size: "lg",
1554
+ class: "text-fm-color-neutral-gray-300"
1555
+ }),
1556
+ g[4] || (g[4] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " This campaign does not belong here ", -1)),
1557
+ a("div", Kt, " It is a " + d(o(u).type) + " campaign. Open it from its own campaign list to see the right report. ", 1)
1558
+ ]),
1559
+ _: 1
1560
+ })) : o($) ? ((H = o(M)) == null ? void 0 : H.state) === "empty" ? (n(), f(B, {
1561
+ key: 2,
1562
+ variant: "outlined",
1563
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1564
+ }, {
1565
+ default: P(() => [
1566
+ I(T, {
1567
+ name: "inbox",
1568
+ outline: "",
1569
+ size: "lg",
1570
+ class: "text-fm-color-neutral-gray-300"
1571
+ }),
1572
+ g[6] || (g[6] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign activity has not started ", -1)),
1573
+ g[7] || (g[7] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, " Performance data will appear after members enter the campaign. ", -1))
1574
+ ]),
1575
+ _: 1
1576
+ })) : o(k) ? (n(), b(L, { key: 3 }, [
1577
+ o(u).type === "COIN" || o(u).type === "POINT" || o(u).type === "CREDIT" ? (n(), b("section", Qt, [
1578
+ a("div", null, [
1579
+ a("div", Xt, d((K = o($)) == null ? void 0 : K.label) + " distribution summary ", 1)
1580
+ ]),
1581
+ I(te, {
1582
+ cards: o(k).cards
1583
+ }, null, 8, ["cards"])
1584
+ ])) : v("", !0),
1585
+ o(u).type === "MISSION" ? (n(), b("section", Jt, [
1586
+ g[8] || (g[8] = a("div", null, [
1587
+ a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Mission participation and completion "),
1588
+ a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, " Campaign-lifetime member activity and completion ")
1589
+ ], -1)),
1590
+ I(te, {
1591
+ cards: o(k).cards
1592
+ }, null, 8, ["cards"])
1593
+ ])) : v("", !0),
1594
+ o(k).applicationMix ? (n(), f(dt, {
1595
+ key: 2,
1596
+ mix: o(k).applicationMix
1597
+ }, null, 8, ["mix"])) : o(u).type !== "MISSION" && o(k).funnel.length ? (n(), f(_t, {
1598
+ key: 3,
1599
+ stages: o(k).funnel
1600
+ }, null, 8, ["stages"])) : v("", !0),
1601
+ o(u).type !== "MISSION" && o(u).type !== "COIN" && o(u).type !== "POINT" && o(u).type !== "CREDIT" && o(k).cards.length ? (n(), f(te, {
1602
+ key: 4,
1603
+ cards: o(k).cards
1604
+ }, null, 8, ["cards"])) : v("", !0),
1605
+ o(k).trend.length ? (n(), f($t, {
1606
+ key: 5,
1607
+ modes: o(k).trend
1608
+ }, null, 8, ["modes"])) : v("", !0),
1609
+ (ce = o(k).breakdowns) != null && ce.length ? (n(!0), b(L, { key: 6 }, Z(o(k).breakdowns, (Y) => (n(), f(de, {
1610
+ key: Y.title,
1611
+ breakdown: Y.breakdown,
1612
+ title: Y.title,
1613
+ "empty-message": Y.emptyMessage
1614
+ }, null, 8, ["breakdown", "title", "empty-message"]))), 128)) : (n(), f(de, {
1615
+ key: 7,
1616
+ breakdown: o(k).breakdown
1617
+ }, null, 8, ["breakdown"])),
1618
+ o(k).outcomes.length ? (n(), f(pe, {
1619
+ key: 8,
1620
+ title: o(u).type === "MISSION" || o(u).type === "GAME" ? "Reward activity" : "Business outcome",
1621
+ caption: o(u).type === "MISSION" || o(u).type === "GAME" ? "Reward issuance attributed to this campaign" : "Financial and loyalty outcomes attributed to this campaign",
1622
+ items: o(k).outcomes,
1623
+ variant: "tile"
1624
+ }, null, 8, ["title", "caption", "items"])) : v("", !0),
1625
+ I(pe, {
1626
+ title: "Metric definitions",
1627
+ caption: "Hover a metric for its denominator and attribution method",
1628
+ items: o(k).metrics,
1629
+ variant: "row"
1630
+ }, null, 8, ["items"])
1631
+ ], 64)) : v("", !0) : (n(), f(B, {
1632
+ key: 1,
1633
+ variant: "outlined",
1634
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1635
+ }, {
1636
+ default: P(() => [
1637
+ I(T, {
1638
+ name: "query_stats",
1639
+ outline: "",
1640
+ size: "lg",
1641
+ class: "text-fm-color-neutral-gray-300"
1642
+ }),
1643
+ g[5] || (g[5] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Analytic is not available for this campaign type ", -1)),
1644
+ a("div", Yt, " Reporting has not been defined for " + d(o(u).type) + " campaigns yet. ", 1)
1645
+ ]),
1646
+ _: 1
1647
+ }))
1648
+ ], 64)) : v("", !0)
1649
+ ])
1650
+ ], 64);
1651
+ };
1652
+ }
1653
+ });
1654
+ export {
1655
+ oa as default
1656
+ };