@feedmepos/mf-connect 0.1.0-beta.33 → 0.1.0-beta.35

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 (83) hide show
  1. package/dist/{Analytic-COFvmYc_.js → Analytic-BMdB7x5F.js} +24 -23
  2. package/dist/{App-Di7kbEH7.js → App-AakWqQHx.js} +6 -6
  3. package/dist/{Broadcast-CAku3lNW.js → Broadcast-Bf5GOV7p.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1Ozu6-2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBTBapxi.js} +7 -7
  5. package/dist/{Card-CcRmp6aK.js → Card-DmxekNts.js} +15 -15
  6. package/dist/{Collections-BRLR37TF.js → Collections-CL7hOycU.js} +4 -4
  7. package/dist/{Credit-BEViCbtH.js → Credit-0eGxacBN.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BLWeJ73S.js} +27 -26
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CGBjH5AK.js → EffectSheet.vue_vue_type_style_index_0_lang-q7qJ9Ec5.js} +6 -6
  10. package/dist/{Experience-BL71InUh.js → Experience-NjmDx3_p.js} +8 -8
  11. package/dist/{Game-vmhBTg3f.js → Game-q19qmf8t.js} +8 -8
  12. package/dist/{Index-DGkT3yms.js → Index-BmzHphDm.js} +9 -9
  13. package/dist/{Marketing-BCqFnOrR.js → Marketing-BgL2CqkH.js} +5 -5
  14. package/dist/{Member-C7uOPBUa.js → Member-DXO7yer0.js} +4 -4
  15. package/dist/{MemberList-CaY2SRSx.js → MemberList-WGMopz-y.js} +14 -14
  16. package/dist/{MemberTransactions-v2sui0Sy.js → MemberTransactions-DmQgrLdy.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-za7Jz9uG.js → MessageInput.vue_vue_type_script_setup_true_lang-DFiCQcTe.js} +2 -2
  18. package/dist/{Mission-DZG8d3vM.js → Mission-DOdkoytR.js} +8 -8
  19. package/dist/Overview-Bizp0BGu.js +1064 -0
  20. package/dist/{Point-DW_SHWMs.js → Point-Bvyg1zuh.js} +8 -8
  21. package/dist/{Promotion-C8tygVa7.js → Promotion-B75LcnHm.js} +9 -9
  22. package/dist/{Record-D7XgEVn_.js → Record-BjAbPbiI.js} +5 -5
  23. package/dist/Reward-l1gt8pwu.js +432 -0
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dyj14jcj.js → RewardGroup.vue_vue_type_script_setup_true_lang-C76emk8A.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cmv-8YZd.js → RuleGroup.vue_vue_type_script_setup_true_lang-B4ak1Gem.js} +13 -13
  26. package/dist/{Segment-DAYnubHq.js → Segment-DJSkWWH8.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BviSuL4I.js → SelectItems.vue_vue_type_script_setup_true_lang-ByqgSxPo.js} +2 -2
  28. package/dist/{Setting-Dd-PlldV.js → Setting-DTV24iE5.js} +8 -8
  29. package/dist/{Store-DmBeTkdi.js → Store-C1obQwdr.js} +46 -46
  30. package/dist/{StoreRewards-VrmRII1r.js → StoreRewards-apMVv0Ca.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bx1AwHhj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DBzA_4gb.js} +17 -17
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DanZYVUH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-PxZ5Au5X.js} +1 -1
  33. package/dist/{Tier-h5t-OofQ.js → Tier-DSvMUZJG.js} +19 -19
  34. package/dist/{Title-BIGAZzv4.js → Title-CWoqOkd2.js} +19 -19
  35. package/dist/{Transaction-WfW0gCVl.js → Transaction-CaCsXoB5.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-KB8LAOv_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DaT8PyWl.js} +6 -6
  37. package/dist/{Voucher-CzA0AnCo.js → Voucher-BBtDXr9q.js} +11 -11
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BbYPy9pR.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BCSO2-oB.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js → ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js} +1 -1
  40. package/dist/{app-C2GiWW62.js → app-B8JBXu5M.js} +212 -186
  41. package/dist/{app-BhP-DVoF.js → app-D8kcy7_R.js} +1 -1
  42. package/dist/app.js +1 -1
  43. package/dist/{business-BjQMXRkL.js → business-DN4-BTel.js} +1 -1
  44. package/dist/{campaign-tqh1zOQn.js → campaign-Cf6jJz3e.js} +2 -2
  45. package/dist/campaign.enum-DVOwgVTa.js +20 -0
  46. package/dist/campaign.fn-D8apF_YE.js +758 -0
  47. package/dist/{collectible.enum-904x3SQw.js → collectible.enum-DPsEC03C.js} +1 -1
  48. package/dist/{collection.fn-B1wW3tQk.js → collection.fn-CzeGWVx2.js} +2 -2
  49. package/dist/dto-D94IgAXy.js +2018 -0
  50. package/dist/{effect-DlIXzIWd.js → effect-CDg44P_g.js} +1 -1
  51. package/dist/{email-addresses-bquAp7UR.js → email-addresses-CDozpvzz.js} +1 -1
  52. package/dist/{export-9ZU9HjO9.js → export-DQLXrn4F.js} +3 -3
  53. package/dist/{helper-D0S39he1.js → helper-DJMf--V-.js} +1 -1
  54. package/dist/{index-DN5WVCu6.js → index-B0n_PU3b.js} +1 -1
  55. package/dist/{index-BoJwjzpx.js → index-BUZR5Bkw.js} +1 -1
  56. package/dist/{index-kkystjJw.js → index-BbPavTej.js} +3 -3
  57. package/dist/{index-D4QKa9x3.js → index-BgXfVzZF.js} +7 -7
  58. package/dist/{index-l_74COL_.js → index-BmblCnlD.js} +1 -1
  59. package/dist/{index-DF3fzy-k.js → index-BnbkejyF.js} +1 -1
  60. package/dist/{index-Dszb1Xy-.js → index-CVV5I3bh.js} +1 -1
  61. package/dist/{index-B6SrZyMF.js → index-DFbITElv.js} +214 -228
  62. package/dist/{index-DTsmbmOR.js → index-Df84_Ww3.js} +3 -3
  63. package/dist/{index-DNa1m2cM.js → index-DrvefOT4.js} +3 -3
  64. package/dist/{index-DnGzf-f8.js → index-DvE5xL4s.js} +2 -2
  65. package/dist/{index-BwDwKkyV.js → index-V6yWwXYr.js} +1 -1
  66. package/dist/{index.esm2017-CNuwLU2a.js → index.esm2017-C90-ettH.js} +1 -1
  67. package/dist/{loading-CiI8Y9Fj.js → loading-B56wz_ef.js} +4 -4
  68. package/dist/{membership-CPNrhOk0.js → membership-CF1jgR11.js} +4 -4
  69. package/dist/{money-DnAxVjb7.js → money-BEEp2WdU.js} +1 -1
  70. package/dist/{number-B5VKL1Yu.js → number-u7HbwLPt.js} +1 -1
  71. package/dist/{objectid-C-IOC4JL.js → objectid-S3_nH1F7.js} +10 -10
  72. package/dist/{reward-D4RyiYb6.js → reward-BUY77BiP.js} +1 -1
  73. package/dist/{rule-DVMHVRWb.js → rule-BdAPBN8_.js} +3 -3
  74. package/dist/{rule-builder-CFUNraRE.js → rule-builder-z51VUtHk.js} +1 -1
  75. package/dist/{template-OBoSoTcO.js → template-B_J4Q9D6.js} +4 -4
  76. package/dist/{trigger-R6mF8LNa.js → trigger-CGrv0M0q.js} +4 -4
  77. package/dist/{user-BGP1BTAw.js → user-D02jOhtd.js} +1 -1
  78. package/dist/{vue-i18n-_ooGZZRG.js → vue-i18n-rCSjqg2P.js} +333 -333
  79. package/dist/{xlsx-ByJGlrKD.js → xlsx-CL102mzm.js} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Overview-egVspSvq.js +0 -1023
  82. package/dist/Reward-DqP89Pqb.js +0 -413
  83. package/dist/dto-C9SOa-xs.js +0 -2770
@@ -1,1023 +0,0 @@
1
- import { defineComponent as Y, resolveComponent as _, openBlock as C, createElementBlock as B, Fragment as H, createVNode as d, withCtx as k, createElementVNode as a, toDisplayString as E, unref as r, renderSlot as pe, ref as x, computed as D, watch as se, createBlock as j, isRef as z, resolveDynamicComponent as ne, renderList as te, normalizeClass as ie, createTextVNode as he, createCommentVNode as Z, h as re, onMounted as ve } from "vue";
2
- import { _ as ge } from "./campaign-CpzFl8Vr.js";
3
- import { u as W } from "./vue-i18n-_ooGZZRG.js";
4
- import { c as we, p as K, u as de } from "./loading-CiI8Y9Fj.js";
5
- import { J as X } from "./JsonViewer-v8_C7l5N.js";
6
- import { Z as M } from "./zod-Bg2FbC-D.js";
7
- import { u as q } from "./app-wDQR6dpb.js";
8
- import { u as Q, _ as _e } from "./RewardGroup.vue_vue_type_script_setup_true_lang-Dyj14jcj.js";
9
- import { u as ce } from "./reward-D4RyiYb6.js";
10
- import "./index-DTsmbmOR.js";
11
- import "./index-DnGzf-f8.js";
12
- import { l as le, m as ye } from "./index-B6SrZyMF.js";
13
- import { a as be, b as xe } from "./index-D4QKa9x3.js";
14
- import "./index-DN5WVCu6.js";
15
- import "./index-kkystjJw.js";
16
- import { C as ue } from "./membership-CPNrhOk0.js";
17
- import { t as ee } from "./helper-D0S39he1.js";
18
- import { c as N } from "./object-qECH92oz.js";
19
- import { useDialog as Ce, components as oe } from "@feedmepos/ui-library";
20
- import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js";
21
- import { a as Se, _ as Fe } from "./trigger-R6mF8LNa.js";
22
- import { O as ke } from "./objectid-C-IOC4JL.js";
23
- import { r as me } from "./index-l_74COL_.js";
24
- import { u as $e } from "./business-BjQMXRkL.js";
25
- const Pe = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ve = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Ie = { class: "flex-1" }, Te = { class: "flex items-center gap-8" }, Ue = { class: "fm-typo-en-title-sm-800" }, Ae = { class: "flex gap-8 items-center" }, Le = { class: "space-y-4 hidden xs:block border-b border-fm-color-neutral-gray-100 px-16 flex-1 pb-24" }, Be = { class: "flex items-center justify-between" }, Ee = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Oe = { class: "flex-1 space-y-4" }, je = { class: "fm-typo-en-body-lg-600" }, De = /* @__PURE__ */ Y({
26
- __name: "ReferralRewadGroupCard",
27
- props: {
28
- rewardGroup: {
29
- type: Object,
30
- required: !0
31
- },
32
- level: {
33
- type: Number,
34
- required: !0
35
- }
36
- },
37
- emits: ["edit", "addCount", "remove"],
38
- setup(R, { emit: f }) {
39
- const { t: $ } = W(), p = f;
40
- return (g, m) => {
41
- const n = _("FmButton"), c = _("FmListItem");
42
- return C(), B(H, null, [
43
- d(c, {
44
- onClick: m[4] || (m[4] = (u) => p("edit", R.level)),
45
- class: "!p-0"
46
- }, {
47
- default: k(() => [
48
- a("div", Pe, [
49
- a("div", Ve, [
50
- a("div", Ie, [
51
- a("div", Te, [
52
- a("div", Ue, E(R.rewardGroup.name), 1)
53
- ])
54
- ])
55
- ]),
56
- a("div", Ae, [
57
- d(n, {
58
- variant: "secondary",
59
- label: r($)("connect.referral.reward.add_count"),
60
- icon: "add",
61
- onClick: m[0] || (m[0] = (u) => {
62
- u.stopPropagation(), p("addCount", R.level);
63
- })
64
- }, null, 8, ["label"]),
65
- d(n, {
66
- icon: "delete",
67
- onClick: m[1] || (m[1] = (u) => {
68
- u.stopPropagation(), p("remove", R.level);
69
- }),
70
- variant: "tertiary"
71
- })
72
- ])
73
- ]),
74
- a("div", Le, [
75
- a("div", Be, [
76
- a("div", Ee, [
77
- a("div", Oe, [
78
- a("div", null, [
79
- a("div", je, E(R.rewardGroup.name), 1)
80
- ])
81
- ])
82
- ]),
83
- d(n, {
84
- variant: "tertiary",
85
- icon: "delete",
86
- onClick: m[2] || (m[2] = (u) => (u.stopPropagation(), p("remove", R.level)))
87
- })
88
- ]),
89
- d(n, {
90
- class: "w-full",
91
- variant: "secondary",
92
- label: "Add count",
93
- disabled: !0,
94
- icon: "add",
95
- onClick: m[3] || (m[3] = (u) => (u.stopPropagation(), p("addCount", R.level)))
96
- })
97
- ])
98
- ]),
99
- _: 1
100
- }),
101
- pe(g.$slots, "default")
102
- ], 64);
103
- };
104
- }
105
- }), Ge = { class: "flex flex-col space-y-16 pr-12" }, Me = { class: "flex gap-16 items-center" }, Ne = { class: "fm-typo-en-title-sm-800" }, He = { class: "flex items-center gap-8" }, Ye = /* @__PURE__ */ Y({
106
- __name: "EditReferralCountSheet",
107
- emits: ["update"],
108
- setup(R, { expose: f, emit: $ }) {
109
- const { t: p } = W(), g = $, m = x(!1), n = x({}), c = x(-1), u = x(-1), S = Q(), V = be.superRefine((e, t) => {
110
- var U, A, v, I, L, J, ae;
111
- const i = u.value == -1 ? ((v = (A = (U = S.referralProgram) == null ? void 0 : U.reward[c.value]) == null ? void 0 : A.rewards) == null ? void 0 : v.length) || 0 : u.value, F = (L = (I = S.referralProgram) == null ? void 0 : I.reward[c.value]) == null ? void 0 : L.rewards[i - 1], b = (ae = (J = S.referralProgram) == null ? void 0 : J.reward[c.value]) == null ? void 0 : ae.rewards[i + 1];
112
- F && e.threshold.from < F.threshold.from + 1 && t.addIssue({
113
- code: "custom",
114
- message: `The min referral must be at least ${F.threshold.from + 1}`,
115
- path: ["option"]
116
- }), b && e.threshold.to && b.threshold.to && e.threshold.to > b.threshold.to - 1 && t.addIssue({
117
- code: "custom",
118
- message: `The max referral must be at most ${b.threshold.to - 2}`,
119
- path: ["option"]
120
- });
121
- }), P = D(() => {
122
- const e = V.safeParse(n.value);
123
- return e.success ? [] : e.error.errors;
124
- });
125
- function G() {
126
- const e = V.safeParse(n.value);
127
- e.success && g("update", {
128
- groupIndex: c.value,
129
- countIndex: u.value,
130
- referralCount: e.data
131
- });
132
- }
133
- async function O(e, t) {
134
- var i;
135
- m.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0 ? (c.value = t.groupIndex, u.value = t.countIndex, n.value = N(
136
- (i = S.referralProgram) == null ? void 0 : i.reward[t.groupIndex].rewards[t.countIndex]
137
- )) : (c.value = t.groupIndex, u.value = -1, n.value = {
138
- threshold: {
139
- from: 1,
140
- to: null
141
- },
142
- rewards: []
143
- }), h.value = [], h.value = l.value.map(
144
- (F) => n.value.rewards.includes(F.id)
145
- );
146
- }
147
- function T() {
148
- m.value = !1;
149
- }
150
- const w = [
151
- {
152
- header: "Reward title",
153
- accessorFn: (e) => e.name,
154
- enableSorting: !0
155
- },
156
- {
157
- id: "type",
158
- header: "Reward type",
159
- cell(e) {
160
- return ue[e.row.original.collectibleConfig.type].chip();
161
- }
162
- },
163
- {
164
- header: "Description",
165
- accessorFn: (e) => e.description,
166
- cell(e) {
167
- const t = e.row.original;
168
- if (t.collectible.type == "VOUCHER" || t.selectedReward == null)
169
- return t.description;
170
- }
171
- }
172
- ], s = ce(), o = x([]), l = D(() => s.rewards.map((e) => {
173
- let t = "No expiry";
174
- switch (e.option.type) {
175
- case "VOUCHER":
176
- t = `${e.option.collectibleConfig.options.maxUse} use(s), ${ee(e.option.collectibleConfig.options.validityOption || {})}`;
177
- break;
178
- case "LOYALTY":
179
- t = `${e.option.earningOption.amount}, ${ee(e.option.validityOption || {})}`;
180
- break;
181
- }
182
- return {
183
- id: e._id,
184
- name: e.name,
185
- collectible: e.option,
186
- collectibleConfig: e.collectibleConfig,
187
- description: t
188
- };
189
- }));
190
- D(() => []);
191
- function y() {
192
- const e = l.value;
193
- for (let t = 0; t < e.length; t++) {
194
- const i = e[t], F = h.value[t];
195
- F && !n.value.rewards.includes(i.id) && n.value.rewards.push(i.id), !F && n.value.rewards.includes(i.id) && (n.value.rewards = n.value.rewards.filter(
196
- (b) => b != i.id
197
- ));
198
- }
199
- }
200
- const h = x({});
201
- return se(h, y, { deep: !0 }), f({
202
- showSheet: O,
203
- hideSheet: T,
204
- data: n
205
- }), (e, t) => {
206
- const i = _("FmStepperField"), F = _("FmHelperText"), b = _("FmTable"), U = _("FmButton"), A = _("FmSideSheet");
207
- return C(), j(A, {
208
- "max-width": 1e3,
209
- modelValue: r(m),
210
- "onUpdate:modelValue": t[4] || (t[4] = (v) => z(m) ? m.value = v : null),
211
- header: `${r(u) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
212
- }, {
213
- "side-sheet-footer": k(() => [
214
- a("div", He, [
215
- d(U, {
216
- label: r(p)("connect.editTierSheet.submit"),
217
- onClick: G,
218
- disabled: r(P).length > 0 || r(q)().isLoading,
219
- loading: r(q)().isLoading
220
- }, null, 8, ["label", "disabled", "loading"]),
221
- d(U, {
222
- label: r(p)("connect.editTierSheet.cancel"),
223
- onClick: t[3] || (t[3] = (v) => T()),
224
- variant: "tertiary"
225
- }, null, 8, ["label"])
226
- ])
227
- ]),
228
- default: k(() => [
229
- d(X, { json: r(n) }, null, 8, ["json"]),
230
- d(X, { json: r(P) }, null, 8, ["json"]),
231
- a("div", Ge, [
232
- a("div", null, [
233
- a("div", Me, [
234
- d(i, {
235
- modelValue: r(n).threshold.from,
236
- "onUpdate:modelValue": t[0] || (t[0] = (v) => r(n).threshold.from = v),
237
- "show-steppers": !1,
238
- rules: [r(M).ruleAtPath(r(V), "threshold.from")]
239
- }, {
240
- label: k(() => [
241
- (C(), j(ne(
242
- r(M).toInputLabel(
243
- r(M).typeAtPath(r(V), "threshold.from"),
244
- r(p)(
245
- "connect.referral.editReferralCountSheet.min_referral_count"
246
- )
247
- )
248
- )))
249
- ]),
250
- _: 1
251
- }, 8, ["modelValue", "rules"]),
252
- d(i, {
253
- modelValue: r(n).threshold.to,
254
- "onUpdate:modelValue": t[1] || (t[1] = (v) => r(n).threshold.to = v),
255
- "show-steppers": !1,
256
- rules: [r(M).ruleAtPath(r(V), "threshold.to")]
257
- }, {
258
- label: k(() => [
259
- (C(), j(ne(
260
- r(M).toInputLabel(
261
- r(M).typeAtPath(r(V), "threshold.to"),
262
- r(p)(
263
- "connect.referral.editReferralCountSheet.max_referral_count"
264
- )
265
- )
266
- )))
267
- ]),
268
- _: 1
269
- }, 8, ["modelValue", "rules"])
270
- ]),
271
- d(F, {
272
- text: r(M).helperText(r(P), "option"),
273
- state: r(M).helperState(r(P), "option")
274
- }, null, 8, ["text", "state"]),
275
- t[5] || (t[5] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " When max. referral count is not set, it will default unlimited ", -1))
276
- ]),
277
- a("div", Ne, E(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
278
- d(b, {
279
- modelValue: r(h),
280
- "onUpdate:modelValue": t[2] || (t[2] = (v) => z(h) ? h.value = v : null),
281
- selection: "multiple",
282
- "column-filter": r(o),
283
- "column-defs": w,
284
- "row-data": r(l),
285
- "page-size": 10
286
- }, null, 8, ["modelValue", "column-filter", "row-data"])
287
- ])
288
- ]),
289
- _: 1
290
- }, 8, ["modelValue", "header"]);
291
- };
292
- }
293
- }), ze = { class: "space-y-16" }, qe = { class: "grid grid-cols-3 gap-16" }, We = { class: "fm-typo-en-title-sm-800" }, Je = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ Y({
294
- __name: "CriteriaTriggerInput",
295
- props: {
296
- modelValue: {
297
- type: String
298
- },
299
- disabled: {
300
- type: Boolean,
301
- default: !1
302
- }
303
- },
304
- emits: ["update:model-value"],
305
- setup(R, { emit: f }) {
306
- const $ = R, p = f, g = D(() => [
307
- le.enum.BILL_COMPLETED,
308
- le.enum.FEEDBACK
309
- ].map((m) => Se[m]));
310
- return (m, n) => {
311
- const c = _("FmCard");
312
- return C(), B("div", ze, [
313
- n[0] || (n[0] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
314
- a("div", qe, [
315
- (C(!0), B(H, null, te(r(g), (u) => (C(), j(c, {
316
- key: u.name,
317
- variant: "outlined",
318
- disabled: $.disabled,
319
- class: ie(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
320
- "col-span-3": r(g).length == 1,
321
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": R.modelValue == u.value,
322
- "hover:bg-fm-color-opacity-sm": R.modelValue != u.value
323
- }]),
324
- onClick: () => {
325
- $.modelValue != u.value && !$.disabled && p("update:model-value", u.value);
326
- }
327
- }, {
328
- default: k(() => [
329
- a("div", We, E(u.name), 1),
330
- a("div", Je, E(u.description), 1)
331
- ]),
332
- _: 2
333
- }, 1032, ["disabled", "class", "onClick"]))), 128))
334
- ])
335
- ]);
336
- };
337
- }
338
- }), Ze = { class: "flex items-center gap-x-8" }, Qe = { class: "flex flex-col space-y-16 pr-12" }, Xe = {
339
- key: 0,
340
- class: "space-y-16"
341
- }, et = { class: "flex items-center gap-8" }, tt = /* @__PURE__ */ Y({
342
- __name: "EditCriteriaSheet",
343
- emits: ["update"],
344
- setup(R, { expose: f, emit: $ }) {
345
- const { t: p } = W(), g = $, m = x(!1), n = x(-1), c = x({}), u = Q(), S = xe.superRefine((w, s) => {
346
- w.name.length >= 50 && s.addIssue({
347
- code: "custom",
348
- message: "Name must be less than 50 characters"
349
- }), w.name.length < 1 && s.addIssue({
350
- code: "custom",
351
- message: "Name is required"
352
- });
353
- }), V = D(() => {
354
- const w = S.safeParse(c.value);
355
- return w.success ? [] : w.error.errors;
356
- });
357
- function P(w, s) {
358
- var o;
359
- m.value = w, w && typeof s == "number" && s >= 0 ? (n.value = s, c.value = N(
360
- (o = u.referralProgram) == null ? void 0 : o.criteria[s]
361
- )) : (n.value = -1, c.value = {
362
- _id: new ke().toString(),
363
- name: "",
364
- type: "AUTO",
365
- event: { type: "BILL_COMPLETED" }
366
- });
367
- }
368
- function G() {
369
- m.value = !1;
370
- }
371
- function O() {
372
- const w = S.safeParse(c.value);
373
- w.success && g("update", n.value, w.data);
374
- }
375
- function T(w) {
376
- c.value.type = w, w == "AUTO" ? c.value.event = { type: "BILL_COMPLETED" } : c.value.event = void 0;
377
- }
378
- return f({
379
- showSheet: P,
380
- hideSheet: G,
381
- data: c
382
- }), (w, s) => {
383
- const o = _("FmButton"), l = _("FmRadio"), y = _("FmRadioGroup"), h = _("FmSideSheet");
384
- return C(), j(h, {
385
- "max-width": 768,
386
- modelValue: r(m),
387
- "onUpdate:modelValue": s[5] || (s[5] = (e) => z(m) ? m.value = e : null)
388
- }, {
389
- "side-sheet-header": k(() => [
390
- a("div", Ze, [
391
- d(o, {
392
- icon: "arrow_back",
393
- variant: "tertiary",
394
- onClick: s[0] || (s[0] = (e) => P(!1))
395
- }),
396
- s[6] || (s[6] = he("Add Criteria "))
397
- ])
398
- ]),
399
- "side-sheet-footer": k(() => [
400
- a("div", et, [
401
- d(o, {
402
- label: r(p)("connect.editTierSheet.submit"),
403
- onClick: O,
404
- disabled: r(V).length > 0 || r(q)().isLoading,
405
- loading: r(q)().isLoading
406
- }, null, 8, ["label", "disabled", "loading"]),
407
- d(o, {
408
- label: r(p)("connect.editTierSheet.cancel"),
409
- onClick: s[4] || (s[4] = (e) => P(!1)),
410
- variant: "tertiary"
411
- }, null, 8, ["label"])
412
- ])
413
- ]),
414
- default: k(() => [
415
- d(X, { json: r(c) }, null, 8, ["json"]),
416
- a("div", Qe, [
417
- s[10] || (s[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
418
- d(Re, {
419
- modelValue: r(c).name,
420
- "onUpdate:modelValue": s[1] || (s[1] = (e) => r(c).name = e),
421
- label: r(p)("connect.referral.editReferralTierSheet.name"),
422
- schema: r(M).typeAtPath(r(S), "name")
423
- }, null, 8, ["modelValue", "label", "schema"]),
424
- s[11] || (s[11] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
425
- d(y, {
426
- "model-value": r(c).type,
427
- label: "Verify status",
428
- "onUpdate:modelValue": T
429
- }, {
430
- default: k(() => [
431
- d(l, {
432
- value: "AUTO",
433
- label: "Auto",
434
- sublabel: "Verify based on rule configuration"
435
- }),
436
- d(l, {
437
- value: "MANUAL",
438
- label: "Manual",
439
- sublabel: "Verify based on manual inspection"
440
- })
441
- ]),
442
- _: 1
443
- }, 8, ["model-value"]),
444
- r(c).type == "AUTO" ? (C(), B(H, { key: 0 }, [
445
- s[8] || (s[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
446
- s[9] || (s[9] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
447
- d(Ke, {
448
- "model-value": r(c).event.type,
449
- "onUpdate:modelValue": s[2] || (s[2] = (e) => r(c).event.type = e)
450
- }, null, 8, ["model-value"]),
451
- r(c).event.type == r(ye).enum.BILL_COMPLETED ? (C(), B("div", Xe, [
452
- s[7] || (s[7] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
453
- d(Fe, {
454
- "model-value": r(c).event.rule,
455
- "onUpdate:modelValue": s[3] || (s[3] = (e) => r(c).event.rule = e)
456
- }, null, 8, ["model-value"])
457
- ])) : Z("", !0)
458
- ], 64)) : Z("", !0)
459
- ])
460
- ]),
461
- _: 1
462
- }, 8, ["modelValue"]);
463
- };
464
- }
465
- });
466
- function fe() {
467
- const R = x(!1), f = Ce();
468
- return {
469
- confirmUpdateReferralRecord: async () => {
470
- await new Promise((p) => {
471
- f.open({
472
- title: "Confirmation",
473
- message: "This will change all referral settings? Would you like to update previous referral record?",
474
- primaryActions: { text: "Update all", close: !0 },
475
- secondaryActions: { text: "Update future only", close: !0 }
476
- }).onPrimary(async () => {
477
- R.value = !0, p();
478
- }).onSecondary(async () => {
479
- R.value = !1, p();
480
- });
481
- });
482
- },
483
- updateReferralRecord: R
484
- };
485
- }
486
- const rt = { class: "flex flex-col space-y-16 mt-24" }, ot = { class: "flex justify-between items-center" }, at = /* @__PURE__ */ Y({
487
- __name: "ManageCriteriaSheet",
488
- setup(R, { expose: f }) {
489
- const { t: $ } = W(), { minor: p } = de, { confirmUpdateReferralRecord: g, updateReferralRecord: m } = fe(), n = x(!1), c = x({}), u = Q(), S = x(
490
- null
491
- ), V = D(() => {
492
- var o;
493
- return (o = u.referralProgram) == null ? void 0 : o.criteria;
494
- });
495
- async function P(o) {
496
- await g(), await p(async () => {
497
- await me.update({
498
- ...o,
499
- updateReferralRecord: m.value
500
- }), await u.readReferralProgram();
501
- });
502
- }
503
- async function G(o, l) {
504
- var e, t;
505
- const y = o == -1 ? ((e = u.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = N(u.referralProgram);
506
- h.criteria[y] = l, await P(h), (t = S.value) == null || t.showSheet(!1);
507
- }
508
- async function O(o) {
509
- var h, e;
510
- if (!await K.remove(
511
- "Are you sure to remove criteria",
512
- "Remove criteria",
513
- $("connect.prompt.confirm"),
514
- $("connect.prompt.cancel")
515
- ))
516
- return;
517
- const l = o == -1 ? ((h = u.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, y = N(u.referralProgram);
518
- y.criteria.splice(l, 1), await P(y), (e = S.value) == null || e.showSheet(!1);
519
- }
520
- const T = [
521
- {
522
- header: "Criteria title",
523
- accessorFn: (o) => o.name
524
- },
525
- {
526
- header: "Validity method",
527
- cell(o) {
528
- return re(oe.FmChip, {
529
- label: we.title(o.row.original.type),
530
- variant: "plain"
531
- });
532
- }
533
- },
534
- {
535
- header: "Actions",
536
- cell(o) {
537
- return [
538
- re(oe.FmButton, {
539
- variant: "tertiary",
540
- icon: "delete",
541
- iconColor: "neutral-gray-400",
542
- onClick: (l) => {
543
- l.stopPropagation(), O(o.row.index);
544
- }
545
- })
546
- ];
547
- }
548
- }
549
- ];
550
- function w(o) {
551
- n.value = o;
552
- }
553
- function s() {
554
- n.value = !1;
555
- }
556
- return f({
557
- showSheet: w,
558
- hideSheet: s,
559
- data: c
560
- }), (o, l) => {
561
- const y = _("FmButton"), h = _("FmTable"), e = _("FmSideSheet");
562
- return C(), B(H, null, [
563
- d(e, {
564
- "max-width": 768,
565
- modelValue: r(n),
566
- "onUpdate:modelValue": l[2] || (l[2] = (t) => z(n) ? n.value = t : null),
567
- header: "Manage Criteria"
568
- }, {
569
- default: k(() => [
570
- a("div", rt, [
571
- a("div", ot, [
572
- l[3] || (l[3] = a("div", null, [
573
- a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
574
- a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
575
- ], -1)),
576
- d(y, {
577
- label: "Add Criteria",
578
- icon: "add",
579
- variant: "secondary",
580
- onClick: l[0] || (l[0] = (t) => {
581
- var i;
582
- return (i = r(S)) == null ? void 0 : i.showSheet(!0);
583
- })
584
- })
585
- ]),
586
- d(h, {
587
- "row-data": r(V),
588
- "hide-footer": !0,
589
- "page-size": 100,
590
- "shrink-at": !1,
591
- "column-defs": T,
592
- onRowClick: l[1] || (l[1] = (t) => {
593
- var i;
594
- return (i = r(S)) == null ? void 0 : i.showSheet(!0, t.index);
595
- })
596
- }, null, 8, ["row-data"])
597
- ])
598
- ]),
599
- _: 1
600
- }, 8, ["modelValue"]),
601
- d(tt, {
602
- ref_key: "editCriteriaSheetRef",
603
- ref: S,
604
- onUpdate: G
605
- }, null, 512)
606
- ], 64);
607
- };
608
- }
609
- }), nt = { class: "flex flex-col space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-sm-800" }, st = { class: "flex items-center gap-8" }, it = /* @__PURE__ */ Y({
610
- __name: "EditRefereeRewardSheet",
611
- emits: ["update"],
612
- setup(R, { expose: f, emit: $ }) {
613
- const { t: p } = W(), g = $, m = x(!1), n = x([]), c = Q();
614
- function u() {
615
- g("update", n.value);
616
- }
617
- async function S(o) {
618
- var l, y;
619
- m.value = o, n.value = ((y = (l = c.referralProgram) == null ? void 0 : l.refereeReward) == null ? void 0 : y.map((h) => h.toString())) || [], s.value = T.value.map((h) => n.value.includes(h.id));
620
- }
621
- function V() {
622
- m.value = !1;
623
- }
624
- const P = [
625
- {
626
- header: "Reward title",
627
- accessorFn: (o) => o.name,
628
- enableSorting: !0
629
- },
630
- {
631
- id: "type",
632
- header: "Reward type",
633
- cell(o) {
634
- return ue[o.row.original.collectibleConfig.type].chip();
635
- }
636
- },
637
- {
638
- header: "Description",
639
- accessorFn: (o) => o.description,
640
- cell(o) {
641
- const l = o.row.original;
642
- if (l.collectible.type == "VOUCHER" || l.selectedReward == null)
643
- return l.description;
644
- }
645
- }
646
- ], G = ce(), O = x([]), T = D(() => G.rewards.map((o) => {
647
- let l = "No expiry";
648
- switch (o.option.type) {
649
- case "VOUCHER":
650
- l = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
651
- break;
652
- case "LOYALTY":
653
- l = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
654
- break;
655
- }
656
- return {
657
- id: o._id,
658
- name: o.name,
659
- collectible: o.option,
660
- collectibleConfig: o.collectibleConfig,
661
- description: l
662
- };
663
- }));
664
- D(() => []);
665
- function w() {
666
- const o = T.value;
667
- for (let l = 0; l < o.length; l++) {
668
- const y = o[l], h = s.value[l];
669
- h && !n.value.includes(y.id) && n.value.push(y.id), !h && n.value.includes(y.id) && (n.value = n.value.filter((e) => e != y.id));
670
- }
671
- }
672
- const s = x({});
673
- return se(s, w, { deep: !0 }), f({
674
- showSheet: S,
675
- hideSheet: V,
676
- data: n
677
- }), (o, l) => {
678
- const y = _("FmTable"), h = _("FmButton"), e = _("FmSideSheet");
679
- return C(), j(e, {
680
- "max-width": 1e3,
681
- modelValue: r(m),
682
- "onUpdate:modelValue": l[2] || (l[2] = (t) => z(m) ? m.value = t : null),
683
- header: "Referee reward"
684
- }, {
685
- "side-sheet-footer": k(() => [
686
- a("div", st, [
687
- d(h, {
688
- label: r(p)("connect.common.save"),
689
- onClick: u,
690
- disabled: r(q)().isLoading,
691
- loading: r(q)().isLoading
692
- }, null, 8, ["label", "disabled", "loading"]),
693
- d(h, {
694
- label: r(p)("connect.common.cancel"),
695
- onClick: l[1] || (l[1] = (t) => V()),
696
- variant: "tertiary"
697
- }, null, 8, ["label"])
698
- ])
699
- ]),
700
- default: k(() => [
701
- d(X, { json: r(n) }, null, 8, ["json"]),
702
- a("div", nt, [
703
- a("div", lt, E(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
704
- d(y, {
705
- modelValue: r(s),
706
- "onUpdate:modelValue": l[0] || (l[0] = (t) => z(s) ? s.value = t : null),
707
- selection: "multiple",
708
- "column-filter": r(O),
709
- "column-defs": P,
710
- "row-data": r(T),
711
- "page-size": 10
712
- }, null, 8, ["modelValue", "column-filter", "row-data"])
713
- ])
714
- ]),
715
- _: 1
716
- }, 8, ["modelValue"]);
717
- };
718
- }
719
- }), dt = { class: "fm-typo-en-title-sm-600" }, ct = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, ut = { class: "flex gap-x-8" }, mt = { class: "fm-typo-body-lg-600" }, ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pt = { class: "mb-40" }, ht = {
720
- key: 0,
721
- class: "flex flex-col items-center justify-center gap-y-16 p-24"
722
- }, vt = { class: "flex flex-col gap-16 text-center" }, gt = { class: "fm-typo-en-title-sm-800" }, wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = /* @__PURE__ */ Y({
723
- __name: "Overview",
724
- setup(R) {
725
- const { t: f } = W(), { minor: $ } = de, p = $e(), g = Q(), { confirmUpdateReferralRecord: m, updateReferralRecord: n } = fe(), c = D(() => {
726
- var e;
727
- return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
728
- }), u = x(null);
729
- x(null);
730
- const S = x(null), V = x(null), P = x(null), G = D(() => {
731
- var e, t, i, F;
732
- return [
733
- {
734
- label: "connect.referral.how_it_works.generate_link",
735
- sublabel: f("connect.referral.how_it_works.generate_link_for_member"),
736
- icon: "offline_share"
737
- },
738
- {
739
- label: "connect.referral.how_it_works.referee_join_reward",
740
- sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} reward(s)`,
741
- action: f("connect.referral.actions.manage_reward"),
742
- onClick: () => {
743
- var b;
744
- return (b = P.value) == null ? void 0 : b.showSheet(!0);
745
- },
746
- icon: "group_add"
747
- },
748
- {
749
- label: "connect.referral.how_it_works.referee_meet_criteria",
750
- sublabel: `${(i = g.referralProgram) == null ? void 0 : i.criteria.length} criteria`,
751
- action: f("connect.referral.actions.manage_criteria"),
752
- onClick: () => {
753
- var b;
754
- return (b = V.value) == null ? void 0 : b.showSheet(!0);
755
- },
756
- icon: "checklist_rtl"
757
- },
758
- {
759
- label: "connect.referral.how_it_works.referer_get_reward",
760
- sublabel: `${(F = g.referralProgram) == null ? void 0 : F.reward.length} configured tier(s)`,
761
- icon: "featured_seasonal_and_gifts"
762
- }
763
- ];
764
- });
765
- function O(e) {
766
- var t;
767
- (t = u.value) == null || t.onManageRewardGroup(e);
768
- }
769
- function T(e) {
770
- var t;
771
- (t = S.value) == null || t.showSheet(!0, {
772
- groupIndex: e.groupIndex,
773
- countIndex: e.countIndex
774
- });
775
- }
776
- async function w(e) {
777
- var v, I, L, J;
778
- const t = e.countIndex == -1 ? ((I = (v = g.referralProgram) == null ? void 0 : v.reward[e.groupIndex]) == null ? void 0 : I.rewards.length) || 0 : e.countIndex || 0, i = e.referralCount, F = N(
779
- g.referralProgram
780
- ), b = F.reward[e.groupIndex];
781
- b.rewards[t] = e.referralCount;
782
- const U = b.rewards[t - 1], A = b.rewards[t + 1];
783
- if (U && U.threshold.to != i.threshold.from - 1) {
784
- if (!await K.confirm(
785
- f("connect.program.tier.update.range_discontinuous.previous", {
786
- name: U.threshold.from,
787
- from: U.threshold.from ?? 0,
788
- to: U.threshold.to ?? 1 / 0,
789
- newTo: i.threshold.from - 1
790
- }),
791
- f("connect.program.tier.title"),
792
- f("connect.program.tier.remove.next_range")
793
- ))
794
- return;
795
- U.threshold.to = i.threshold.from - 1;
796
- }
797
- if (A && A.threshold.from - 1 != i.threshold.to) {
798
- if (!await K.confirm(
799
- f("connect.program.tier.update.range_discontinuous.next", {
800
- name: A.threshold.from,
801
- from: A.threshold.from ?? 0,
802
- to: A.threshold.to ?? 1 / 0,
803
- newFrom: i.threshold.to ?? 1
804
- }),
805
- f("connect.program.tier.title"),
806
- f("connect.program.tier.remove.next_range"),
807
- f("connect.prompt.cancel")
808
- ))
809
- return;
810
- A.threshold.from = (i.threshold.to ?? 0) + 1;
811
- }
812
- !A && !((L = i.threshold) != null && L.to) && (i.threshold.to = void 0), await o(F), (J = S.value) == null || J.hideSheet();
813
- }
814
- async function s(e) {
815
- var i;
816
- const t = N(g.referralProgram);
817
- t.refereeReward = e, await o(t), (i = P.value) == null || i.hideSheet();
818
- }
819
- async function o(e) {
820
- await m(), await $(
821
- async () => {
822
- await me.update({
823
- ...e,
824
- updateReferralRecord: n.value
825
- }), await g.readReferralProgram();
826
- },
827
- {
828
- message: "Updating referral program",
829
- successMessage: "Referral program updated successfully"
830
- }
831
- );
832
- }
833
- async function l(e) {
834
- if (!await K.remove(
835
- "Are you sure to remove referral tier",
836
- "Remove referral tier",
837
- f("connect.prompt.confirm"),
838
- f("connect.prompt.cancel")
839
- ))
840
- return;
841
- const t = N(g.referralProgram);
842
- t.reward.splice(e, 1), await o(t);
843
- }
844
- async function y(e, t) {
845
- if (!await K.remove(
846
- "Are you sure to remove referral count",
847
- "Remove referral tier",
848
- f("connect.prompt.confirm"),
849
- f("connect.prompt.cancel")
850
- ))
851
- return;
852
- const i = N(g.referralProgram);
853
- i.reward[e].rewards.splice(t, 1), await o(i);
854
- }
855
- const h = [
856
- {
857
- header: "Referral Count",
858
- accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
859
- },
860
- {
861
- header: "Rewards",
862
- accessorKey: "type",
863
- accessorFn: (e) => {
864
- var t;
865
- return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
866
- }
867
- },
868
- {
869
- id: "actions",
870
- meta: {
871
- textAlign: "right"
872
- },
873
- cell(e) {
874
- return re(oe.FmButton, {
875
- variant: "tertiary",
876
- icon: "delete",
877
- iconColor: "neutral-gray-400",
878
- class: "ml-auto",
879
- onClick: (t) => {
880
- t.stopPropagation(), console.log(e.row), y(e.row.original.groupIndex, e.row.index);
881
- }
882
- });
883
- }
884
- }
885
- ];
886
- return ve(async () => {
887
- await g.readReferralProgram();
888
- }), (e, t) => {
889
- const i = _("FmCard"), F = _("FmIcon"), b = _("FmButton"), U = _("FmTable"), A = _("FmList");
890
- return C(), B(H, null, [
891
- Z("", !0),
892
- d(i, {
893
- variant: "outlined",
894
- class: "flex flex-col gap-16 p-16"
895
- }, {
896
- default: k(() => [
897
- a("div", dt, E(r(f)("connect.referral.how_it_works.title")), 1),
898
- a("div", ct, [
899
- (C(!0), B(H, null, te(r(G), (v, I) => (C(), B("div", {
900
- key: I,
901
- class: ie(["px-8", { "xs:!border-r": I % 2 == 0 }])
902
- }, [
903
- a("div", ut, [
904
- d(F, {
905
- name: v.icon,
906
- color: "primary",
907
- class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
908
- }, null, 8, ["name"]),
909
- a("div", null, [
910
- a("div", mt, E(r(f)(v.label)), 1),
911
- a("div", ft, E(v.sublabel), 1),
912
- v.action ? (C(), j(b, {
913
- key: 0,
914
- variant: "plain",
915
- label: v.action,
916
- disabled: !r(p).isPremium,
917
- class: "fm-typo-en-body-md-400 !p-0",
918
- onClick: v.onClick
919
- }, null, 8, ["label", "disabled", "onClick"])) : Z("", !0)
920
- ])
921
- ])
922
- ], 2))), 128))
923
- ])
924
- ]),
925
- _: 1
926
- }),
927
- r(c) && r(c).length > 0 ? (C(), j(i, {
928
- key: 1,
929
- variant: "outlined",
930
- class: "flex flex-col gap-16 p-16"
931
- }, {
932
- default: k(() => [
933
- d(A, { separator: !0 }, {
934
- default: k(() => [
935
- (C(!0), B(H, null, te(r(c), (v, I) => (C(), j(De, {
936
- key: I,
937
- "reward-group": v,
938
- level: I,
939
- onEdit: (L) => O(I),
940
- onRemove: (L) => l(I),
941
- onAddCount: t[0] || (t[0] = (L) => {
942
- T({ groupIndex: L, countIndex: -1 });
943
- })
944
- }, {
945
- default: k(() => [
946
- a("div", pt, [
947
- d(U, {
948
- "row-data": v.rewards.map((L) => ({ ...L, groupIndex: I })),
949
- "column-defs": h,
950
- "hide-footer": !0,
951
- "page-size": 50,
952
- onRowClick: (L) => T({ groupIndex: I, countIndex: L.index })
953
- }, null, 8, ["row-data", "onRowClick"])
954
- ]),
955
- v.rewards.length ? Z("", !0) : (C(), B("div", ht, [
956
- t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
957
- a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
958
- a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Add referral count to configure progression reward to the referral program ")
959
- ], -1)),
960
- d(b, {
961
- variant: "secondary",
962
- label: "Add count",
963
- icon: "add",
964
- onClick: (L) => T({ groupIndex: I, countIndex: -1 })
965
- }, null, 8, ["onClick"])
966
- ]))
967
- ]),
968
- _: 2
969
- }, 1032, ["reward-group", "level", "onEdit", "onRemove"]))), 128))
970
- ]),
971
- _: 1
972
- })
973
- ]),
974
- _: 1
975
- })) : (C(), j(i, {
976
- key: 2,
977
- variant: "outlined",
978
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
979
- }, {
980
- default: k(() => [
981
- t[4] || (t[4] = a("img", {
982
- src: ge,
983
- class: "aspect-square w-[150px]"
984
- }, null, -1)),
985
- a("div", vt, [
986
- a("div", gt, E(r(f)("connect.referral.referral_tier_title")), 1),
987
- a("div", wt, E(r(f)("connect.referral.referral_tier_description")), 1)
988
- ]),
989
- d(b, {
990
- variant: "primary",
991
- label: r(f)("connect.referral.add_referral_tier"),
992
- icon: "add",
993
- disabled: !r(p).isPremium,
994
- onClick: t[1] || (t[1] = (v) => O(-1))
995
- }, null, 8, ["label", "disabled"])
996
- ]),
997
- _: 1
998
- })),
999
- d(_e, {
1000
- ref_key: "rewardGroupRef",
1001
- ref: u
1002
- }, null, 512),
1003
- d(Ye, {
1004
- ref_key: "editReferralCountSheetRef",
1005
- ref: S,
1006
- onUpdate: w
1007
- }, null, 512),
1008
- d(at, {
1009
- ref_key: "manageCriteriaSheetRef",
1010
- ref: V
1011
- }, null, 512),
1012
- d(it, {
1013
- ref_key: "editRefereeRewardSheetRef",
1014
- ref: P,
1015
- onUpdate: s
1016
- }, null, 512)
1017
- ], 64);
1018
- };
1019
- }
1020
- });
1021
- export {
1022
- Nt as default
1023
- };