@feedmepos/mf-connect 0.1.10-prod → 0.1.12-prod
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.
- package/dist/{Analytic-CpSbitWV.js → Analytic-D_0-S9bm.js} +9 -9
- package/dist/{App-BPT8XzjX.js → App-CRUf3Y0S.js} +6 -6
- package/dist/{Broadcast-CJHpiQeN.js → Broadcast-B0pjSEvx.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUPqWdIm.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-k3T8QO9-.js} +7 -7
- package/dist/{Card-Bvn36zqZ.js → Card-DK6dhPcq.js} +15 -15
- package/dist/{Collections-Bq6OxsJC.js → Collections-C7dc9NQd.js} +5 -5
- package/dist/{Credit-Dno_g7dW.js → Credit-B2QhAnU7.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CWMtJS9Z.js} +28 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Ho7zwlbb.js → EffectSheet.vue_vue_type_style_index_0_lang-C09W42uh.js} +6 -6
- package/dist/{Experience-BC1qSIGO.js → Experience-4j5Hoeig.js} +8 -8
- package/dist/{Game-C_CKGMBW.js → Game-Dvc5v56r.js} +8 -8
- package/dist/{Index-BXFaWTfw.js → Index-vWNoadSH.js} +80 -77
- package/dist/{Marketing-Ni0WAie5.js → Marketing-DkkAcFb4.js} +5 -5
- package/dist/{Member-djnisrK1.js → Member-CM1b1duv.js} +4 -4
- package/dist/{MemberList-CclU-3B7.js → MemberList-b2Rlocct.js} +14 -14
- package/dist/{MemberTransactions-DVVsv3Ux.js → MemberTransactions-Fj2nJ4Ur.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-khyDg1m4.js → MessageInput.vue_vue_type_script_setup_true_lang-BZKudA25.js} +2 -2
- package/dist/{Mission-Z5somdo_.js → Mission-KLaXikD6.js} +8 -8
- package/dist/{Overview-BvMVz3lQ.js → Overview-BUc3n5O3.js} +400 -396
- package/dist/{Point-DdPukiTg.js → Point-hB9FCAw0.js} +8 -8
- package/dist/{Promotion-DCqdIwjG.js → Promotion-3yLTsHvx.js} +9 -9
- package/dist/Record-BZlaZcFg.js +338 -0
- package/dist/{Reward-CiJHGXfQ.js → Reward-CyO0pKoa.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CrGCBRmH.js → RewardGroup.vue_vue_type_script_setup_true_lang-UYD9G3y0.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-tnT6i0Jq.js → RuleGroup.vue_vue_type_script_setup_true_lang-DUKyzpZK.js} +13 -13
- package/dist/{Segment-CQb3j-o0.js → Segment-BXV6-vOS.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B7YqIU5D.js → SelectItems.vue_vue_type_script_setup_true_lang-3pUUUAKD.js} +2 -2
- package/dist/{Setting-91cK3ssU.js → Setting-CFZdsnpN.js} +8 -8
- package/dist/{Store-B-uldUKt.js → Store-7vr-PeY6.js} +18 -18
- package/dist/{StoreRewards-dDNeFlA9.js → StoreRewards-Cqth7AIJ.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BVb1X0aq.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D0L5FGVd.js} +18 -18
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Ds0WxGxr.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B79xzd2T.js} +1 -1
- package/dist/{Tier-_jMaLj3u.js → Tier-im_GyLWx.js} +19 -19
- package/dist/{Title-By7o67aT.js → Title-BhudgeSH.js} +19 -19
- package/dist/{Transaction-BLpEgeI2.js → Transaction-CnugRki7.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bf_nO9zH.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-m-_fdbTx.js} +6 -6
- package/dist/{Voucher-CG5tfibn.js → Voucher-WB5QSvGY.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DpQUoXyQ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DK0pDVj1.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-YwGR2En3.js → ZodTextField.vue_vue_type_script_setup_true_lang-DWV8fnLD.js} +1 -1
- package/dist/{app-vCqTQIeC.js → app-C3K2hDWf.js} +623 -490
- package/dist/{app-DDmTqTb7.js → app-NqsHFVEk.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-Cz78KGF2.js → business-CcRzjtxz.js} +1 -1
- package/dist/{campaign-BBd4o7F_.js → campaign-B67A_7OK.js} +2 -2
- package/dist/{campaign.enum-CIhi0b-m.js → campaign.enum-ByK4gMba.js} +1 -1
- package/dist/{campaign.fn-5silF1DK.js → campaign.fn-DzGsXCdF.js} +142 -142
- package/dist/{collectible.enum-cMIQ6ogq.js → collectible.enum-BqASpzzd.js} +1 -1
- package/dist/{collection.fn-BGc7Qeli.js → collection.fn-D2WvxL88.js} +2 -2
- package/dist/{dto-i04OPJfW.js → dto-Dw255bzd.js} +10 -10
- package/dist/{effect-D8UzkYRg.js → effect-BxPu1FzR.js} +1 -1
- package/dist/{email-addresses-u05o35hN.js → email-addresses-DcK0Q2zA.js} +1 -1
- package/dist/{export-BEXuPYEd.js → export-7jK-Ioe-.js} +3 -3
- package/dist/{helper-RptRJGv6.js → helper-lXhemocG.js} +1 -1
- package/dist/{index-g8EbRVnr.js → index-1l0_N69H.js} +1 -1
- package/dist/{index-BjHZUhiH.js → index-96KcJ-Wb.js} +1 -1
- package/dist/{index-hEE_ntHd.js → index-B9BSm7oO.js} +1 -1
- package/dist/{index-B8s-gucK.js → index-BC2jOmNm.js} +1 -1
- package/dist/{index-Bpu2DYUc.js → index-BhchMLq2.js} +2 -2
- package/dist/{index-DFAnoAe9.js → index-C8XNjc5V.js} +1 -1
- package/dist/{index-UfL5qRzR.js → index-CQL21tjK.js} +4 -4
- package/dist/{index-C6-rCMhD.js → index-D2P6nwsu.js} +3 -3
- package/dist/{index-DwzoqCt8.js → index-D42yBguK.js} +3 -3
- package/dist/{index-Dt6K2eG8.js → index-DG2-DF-P.js} +1 -1
- package/dist/{index-Cq_ZIbRm.js → index-D_uxupsH.js} +7 -7
- package/dist/{index-DbyJ6Nyn.js → index-DtMb1Vde.js} +3 -3
- package/dist/{index.esm2017-BSzW_yaL.js → index.esm2017-D1A8aO1S.js} +1 -1
- package/dist/{loading-DjEdwdnj.js → loading-D2WV28Cg.js} +4 -4
- package/dist/{membership-BL9Xs8lD.js → membership-YYMIuLdo.js} +3 -3
- package/dist/{money-D7lq0cx-.js → money-JypeKzEz.js} +1 -1
- package/dist/{number-BiDabTkI.js → number-B2nrtMri.js} +1 -1
- package/dist/{objectid-CXf0jb1W.js → objectid-9TjXs_6J.js} +11 -11
- package/dist/{reward-Cr8rbe5R.js → reward-DkpMRLGx.js} +1 -1
- package/dist/{rule-vkYJij4h.js → rule-Bpwn27Yr.js} +3 -3
- package/dist/{rule-builder-DPKFZ5UX.js → rule-builder-BQ6QcxJ2.js} +1 -1
- package/dist/{template-Bep5Y5ch.js → template-C-b_3Q0G.js} +4 -4
- package/dist/{trigger-fWhQ3bqv.js → trigger-DE5iEB5A.js} +4 -4
- package/dist/{usePagination-DSF5b4hM.js → usePagination-C_YZGKWk.js} +1 -1
- package/dist/{user-9UiaP0xs.js → user-VhJqEOJm.js} +1 -1
- package/dist/{vue-i18n-BhiDOB1j.js → vue-i18n-BfBJ65t0.js} +288 -288
- package/package.json +1 -1
- package/dist/Record-CvMxXm1B.js +0 -337
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as q, resolveComponent as w, openBlock as
|
|
1
|
+
import { defineComponent as q, resolveComponent as w, openBlock as C, createElementBlock as B, Fragment as Y, createVNode as c, withCtx as V, createElementVNode as a, toDisplayString as O, unref as r, renderSlot as _e, ref as $, computed as G, watch as ie, createBlock as j, isRef as J, resolveDynamicComponent as ne, renderList as re, normalizeClass as ce, createTextVNode as de, createCommentVNode as z, h as te, onMounted as ve } from "vue";
|
|
2
2
|
import { _ as ge } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { u as Z } from "./vue-i18n-
|
|
4
|
-
import { c as we, p as K, u as ue } from "./loading-
|
|
3
|
+
import { u as Z } from "./vue-i18n-BfBJ65t0.js";
|
|
4
|
+
import { c as we, p as K, u as ue } from "./loading-D2WV28Cg.js";
|
|
5
5
|
import { J as X } from "./JsonViewer-v8_C7l5N.js";
|
|
6
6
|
import { Z as N } from "./zod-Bg2FbC-D.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { u as me } from "./reward-
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import { k as le, l as se } from "./index-
|
|
13
|
-
import { a as be, b as xe } from "./index-
|
|
14
|
-
import "./index-
|
|
15
|
-
import "./index-
|
|
16
|
-
import { C as fe } from "./membership-
|
|
17
|
-
import { t as ee } from "./helper-
|
|
7
|
+
import { u as W } from "./app-wDQR6dpb.js";
|
|
8
|
+
import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-UYD9G3y0.js";
|
|
9
|
+
import { u as me } from "./reward-DkpMRLGx.js";
|
|
10
|
+
import "./index-D42yBguK.js";
|
|
11
|
+
import "./index-BhchMLq2.js";
|
|
12
|
+
import { k as le, l as se } from "./index-CQL21tjK.js";
|
|
13
|
+
import { a as be, b as xe } from "./index-D_uxupsH.js";
|
|
14
|
+
import "./index-B9BSm7oO.js";
|
|
15
|
+
import "./index-DtMb1Vde.js";
|
|
16
|
+
import { C as fe } from "./membership-YYMIuLdo.js";
|
|
17
|
+
import { t as ee } from "./helper-lXhemocG.js";
|
|
18
18
|
import { c as H } from "./object-qECH92oz.js";
|
|
19
|
-
import { useDialog as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { b as Se, _ as $e, a as
|
|
22
|
-
import { O as
|
|
23
|
-
import { r as pe } from "./index-
|
|
24
|
-
import { u as Pe } from "./business-
|
|
25
|
-
const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Te = { class: "flex-1" }, Ue = { class: "flex items-center gap-8" }, Ae = { class: "fm-typo-en-title-sm-800" }, Le = { class: "flex gap-8 items-center" }, Ee = { 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" }, Oe = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" },
|
|
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-DWV8fnLD.js";
|
|
21
|
+
import { b as Se, _ as $e, a as ke } from "./trigger-DE5iEB5A.js";
|
|
22
|
+
import { O as Fe } from "./objectid-9TjXs_6J.js";
|
|
23
|
+
import { r as pe } from "./index-1l0_N69H.js";
|
|
24
|
+
import { u as Pe } from "./business-CcRzjtxz.js";
|
|
25
|
+
const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Te = { class: "flex-1" }, Ue = { class: "flex items-center gap-8" }, Ae = { class: "fm-typo-en-title-sm-800" }, Le = { class: "flex gap-8 items-center" }, Ee = { 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" }, Oe = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, je = { class: "flex-1 space-y-4" }, De = { class: "fm-typo-en-body-lg-600" }, Ge = /* @__PURE__ */ q({
|
|
26
26
|
__name: "ReferralRewadGroupCard",
|
|
27
27
|
props: {
|
|
28
28
|
rewardGroup: {
|
|
@@ -35,13 +35,13 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
emits: ["edit", "addCount", "remove"],
|
|
38
|
-
setup(
|
|
39
|
-
const { t: I } = Z(), p =
|
|
38
|
+
setup(k, { emit: n }) {
|
|
39
|
+
const { t: I } = Z(), p = n;
|
|
40
40
|
return (g, m) => {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
onClick: m[4] || (m[4] = (
|
|
41
|
+
const l = w("FmButton"), d = w("FmListItem");
|
|
42
|
+
return C(), B(Y, null, [
|
|
43
|
+
c(d, {
|
|
44
|
+
onClick: m[4] || (m[4] = (u) => p("edit", k.level)),
|
|
45
45
|
class: "!p-0"
|
|
46
46
|
}, {
|
|
47
47
|
default: V(() => [
|
|
@@ -49,23 +49,23 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
49
49
|
a("div", Ie, [
|
|
50
50
|
a("div", Te, [
|
|
51
51
|
a("div", Ue, [
|
|
52
|
-
a("div", Ae, O(
|
|
52
|
+
a("div", Ae, O(k.rewardGroup.name), 1)
|
|
53
53
|
])
|
|
54
54
|
])
|
|
55
55
|
]),
|
|
56
56
|
a("div", Le, [
|
|
57
|
-
|
|
57
|
+
c(l, {
|
|
58
58
|
variant: "secondary",
|
|
59
|
-
label:
|
|
59
|
+
label: r(I)("connect.referral.reward.add_count"),
|
|
60
60
|
icon: "add",
|
|
61
|
-
onClick: m[0] || (m[0] = (
|
|
62
|
-
|
|
61
|
+
onClick: m[0] || (m[0] = (u) => {
|
|
62
|
+
u.stopPropagation(), p("addCount", k.level);
|
|
63
63
|
})
|
|
64
64
|
}, null, 8, ["label"]),
|
|
65
|
-
|
|
65
|
+
c(l, {
|
|
66
66
|
icon: "delete",
|
|
67
|
-
onClick: m[1] || (m[1] = (
|
|
68
|
-
|
|
67
|
+
onClick: m[1] || (m[1] = (u) => {
|
|
68
|
+
u.stopPropagation(), p("remove", k.level);
|
|
69
69
|
}),
|
|
70
70
|
variant: "tertiary"
|
|
71
71
|
})
|
|
@@ -74,25 +74,25 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
74
74
|
a("div", Ee, [
|
|
75
75
|
a("div", Be, [
|
|
76
76
|
a("div", Oe, [
|
|
77
|
-
a("div",
|
|
77
|
+
a("div", je, [
|
|
78
78
|
a("div", null, [
|
|
79
|
-
a("div",
|
|
79
|
+
a("div", De, O(k.rewardGroup.name), 1)
|
|
80
80
|
])
|
|
81
81
|
])
|
|
82
82
|
]),
|
|
83
|
-
|
|
83
|
+
c(l, {
|
|
84
84
|
variant: "tertiary",
|
|
85
85
|
icon: "delete",
|
|
86
|
-
onClick: m[2] || (m[2] = (
|
|
86
|
+
onClick: m[2] || (m[2] = (u) => (u.stopPropagation(), p("remove", k.level)))
|
|
87
87
|
})
|
|
88
88
|
]),
|
|
89
|
-
|
|
89
|
+
c(l, {
|
|
90
90
|
class: "w-full",
|
|
91
91
|
variant: "secondary",
|
|
92
92
|
label: "Add count",
|
|
93
93
|
disabled: !0,
|
|
94
94
|
icon: "add",
|
|
95
|
-
onClick: m[3] || (m[3] = (
|
|
95
|
+
onClick: m[3] || (m[3] = (u) => (u.stopPropagation(), p("addCount", k.level)))
|
|
96
96
|
})
|
|
97
97
|
])
|
|
98
98
|
]),
|
|
@@ -102,44 +102,44 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
102
102
|
], 64);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
}), Me = { class: "flex flex-col space-y-16 pr-12" }, Ne = { class: "flex gap-16 items-center" }, He =
|
|
105
|
+
}), Me = { class: "flex flex-col space-y-16 pr-12" }, Ne = { class: "flex gap-16 items-center" }, He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ze = { class: "fm-typo-en-title-sm-800" }, Ye = { class: "flex items-center gap-8" }, qe = /* @__PURE__ */ q({
|
|
106
106
|
__name: "EditReferralCountSheet",
|
|
107
107
|
emits: ["update"],
|
|
108
|
-
setup(
|
|
109
|
-
const { t: p } = Z(), g = I, m = $(!1),
|
|
110
|
-
var
|
|
111
|
-
const
|
|
112
|
-
v && e.threshold.from < v.threshold.from + 1 &&
|
|
108
|
+
setup(k, { expose: n, emit: I }) {
|
|
109
|
+
const { t: p } = Z(), g = I, m = $(!1), l = $({}), d = $(-1), u = $(-1), R = Q(), A = be.superRefine((e, t) => {
|
|
110
|
+
var F, U, P, x, _, E, ae;
|
|
111
|
+
const i = u.value == -1 ? ((P = (U = (F = R.referralProgram) == null ? void 0 : F.reward[d.value]) == null ? void 0 : U.rewards) == null ? void 0 : P.length) || 0 : u.value, v = (_ = (x = R.referralProgram) == null ? void 0 : x.reward[d.value]) == null ? void 0 : _.rewards[i - 1], b = (ae = (E = R.referralProgram) == null ? void 0 : E.reward[d.value]) == null ? void 0 : ae.rewards[i + 1];
|
|
112
|
+
v && e.threshold.from < v.threshold.from + 1 && t.addIssue({
|
|
113
113
|
code: "custom",
|
|
114
114
|
message: `The min referral must be at least ${v.threshold.from + 1}`,
|
|
115
115
|
path: ["option"]
|
|
116
|
-
}), b && e.threshold.to && b.threshold.to && e.threshold.to > b.threshold.to - 1 &&
|
|
116
|
+
}), b && e.threshold.to && b.threshold.to && e.threshold.to > b.threshold.to - 1 && t.addIssue({
|
|
117
117
|
code: "custom",
|
|
118
118
|
message: `The max referral must be at most ${b.threshold.to - 2}`,
|
|
119
119
|
path: ["option"]
|
|
120
120
|
});
|
|
121
121
|
}), T = G(() => {
|
|
122
|
-
const e = A.safeParse(
|
|
122
|
+
const e = A.safeParse(l.value);
|
|
123
123
|
return e.success ? [] : e.error.errors;
|
|
124
124
|
});
|
|
125
125
|
function M() {
|
|
126
|
-
const e = A.safeParse(
|
|
126
|
+
const e = A.safeParse(l.value);
|
|
127
127
|
e.success && g("update", {
|
|
128
128
|
groupIndex: d.value,
|
|
129
|
-
countIndex:
|
|
129
|
+
countIndex: u.value,
|
|
130
130
|
referralCount: e.data
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
134
|
-
var
|
|
135
|
-
if (m.value = e, e && typeof (
|
|
136
|
-
d.value =
|
|
137
|
-
(
|
|
133
|
+
async function D(e, t) {
|
|
134
|
+
var i, v, b, F, U, P;
|
|
135
|
+
if (m.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0)
|
|
136
|
+
d.value = t.groupIndex, u.value = t.countIndex, l.value = H(
|
|
137
|
+
(i = R.referralProgram) == null ? void 0 : i.reward[t.groupIndex].rewards[t.countIndex]
|
|
138
138
|
);
|
|
139
139
|
else {
|
|
140
|
-
d.value =
|
|
141
|
-
const x =
|
|
142
|
-
|
|
140
|
+
d.value = t.groupIndex, u.value = -1;
|
|
141
|
+
const x = u.value == -1 ? ((F = (b = (v = R.referralProgram) == null ? void 0 : v.reward[d.value]) == null ? void 0 : b.rewards) == null ? void 0 : F.length) || 0 : u.value, _ = (P = (U = R.referralProgram) == null ? void 0 : U.reward[d.value]) == null ? void 0 : P.rewards[x - 1];
|
|
142
|
+
l.value = {
|
|
143
143
|
threshold: {
|
|
144
144
|
from: _ != null && _.threshold ? _ != null && _.threshold.to ? _.threshold.to + 1 : (_ == null ? void 0 : _.threshold.from) + 1 : 1,
|
|
145
145
|
to: null
|
|
@@ -147,8 +147,8 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
147
147
|
rewards: []
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
h.value = [], h.value =
|
|
151
|
-
(x) =>
|
|
150
|
+
h.value = [], h.value = s.value.map(
|
|
151
|
+
(x) => l.value.rewards.includes(x.id)
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
154
|
function L() {
|
|
@@ -171,19 +171,19 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
171
171
|
header: "Description",
|
|
172
172
|
accessorFn: (e) => e.description,
|
|
173
173
|
cell(e) {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
return
|
|
174
|
+
const t = e.row.original;
|
|
175
|
+
if (t.collectible.type == "VOUCHER" || t.selectedReward == null)
|
|
176
|
+
return t.description;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
], f = me(), o = $([]),
|
|
180
|
-
let
|
|
179
|
+
], f = me(), o = $([]), s = G(() => f.rewards.map((e) => {
|
|
180
|
+
let t = "No expiry";
|
|
181
181
|
switch (e.option.type) {
|
|
182
182
|
case "VOUCHER":
|
|
183
|
-
|
|
183
|
+
t = `${e.option.collectibleConfig.options.maxUse} use(s), ${ee(e.option.collectibleConfig.options.validityOption || {})}`;
|
|
184
184
|
break;
|
|
185
185
|
case "LOYALTY":
|
|
186
|
-
|
|
186
|
+
t = `${e.option.earningOption.amount}, ${ee(e.option.validityOption || {})}`;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
189
|
return {
|
|
@@ -191,64 +191,64 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
191
191
|
name: e.name,
|
|
192
192
|
collectible: e.option,
|
|
193
193
|
collectibleConfig: e.collectibleConfig,
|
|
194
|
-
description:
|
|
194
|
+
description: t
|
|
195
195
|
};
|
|
196
196
|
}));
|
|
197
197
|
G(() => []);
|
|
198
198
|
function S() {
|
|
199
|
-
const e =
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
v && !
|
|
203
|
-
(b) => b !=
|
|
199
|
+
const e = s.value;
|
|
200
|
+
for (let t = 0; t < e.length; t++) {
|
|
201
|
+
const i = e[t], v = h.value[t];
|
|
202
|
+
v && !l.value.rewards.includes(i.id) && l.value.rewards.push(i.id), !v && l.value.rewards.includes(i.id) && (l.value.rewards = l.value.rewards.filter(
|
|
203
|
+
(b) => b != i.id
|
|
204
204
|
));
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
const h = $({});
|
|
208
|
-
return ie(h, S, { deep: !0 }),
|
|
209
|
-
showSheet:
|
|
208
|
+
return ie(h, S, { deep: !0 }), n({
|
|
209
|
+
showSheet: D,
|
|
210
210
|
hideSheet: L,
|
|
211
|
-
data:
|
|
212
|
-
}), (e,
|
|
213
|
-
const
|
|
214
|
-
return
|
|
211
|
+
data: l
|
|
212
|
+
}), (e, t) => {
|
|
213
|
+
const i = w("FmStepperField"), v = w("FmHelperText"), b = w("FmTable"), F = w("FmButton"), U = w("FmSideSheet");
|
|
214
|
+
return C(), j(U, {
|
|
215
215
|
"max-width": 1e3,
|
|
216
|
-
modelValue:
|
|
217
|
-
"onUpdate:modelValue":
|
|
218
|
-
header: `${
|
|
216
|
+
modelValue: r(m),
|
|
217
|
+
"onUpdate:modelValue": t[4] || (t[4] = (P) => J(m) ? m.value = P : null),
|
|
218
|
+
header: `${r(u) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
|
|
219
219
|
}, {
|
|
220
220
|
"side-sheet-footer": V(() => [
|
|
221
221
|
a("div", Ye, [
|
|
222
|
-
|
|
223
|
-
label:
|
|
222
|
+
c(F, {
|
|
223
|
+
label: r(p)("connect.editTierSheet.submit"),
|
|
224
224
|
onClick: M,
|
|
225
|
-
disabled:
|
|
226
|
-
loading:
|
|
225
|
+
disabled: r(T).length > 0 || r(W)().isLoading,
|
|
226
|
+
loading: r(W)().isLoading
|
|
227
227
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
228
|
-
|
|
229
|
-
label:
|
|
230
|
-
onClick:
|
|
228
|
+
c(F, {
|
|
229
|
+
label: r(p)("connect.editTierSheet.cancel"),
|
|
230
|
+
onClick: t[3] || (t[3] = (P) => L()),
|
|
231
231
|
variant: "tertiary"
|
|
232
232
|
}, null, 8, ["label"])
|
|
233
233
|
])
|
|
234
234
|
]),
|
|
235
235
|
default: V(() => [
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
c(X, { json: r(l) }, null, 8, ["json"]),
|
|
237
|
+
c(X, { json: r(T) }, null, 8, ["json"]),
|
|
238
238
|
a("div", Me, [
|
|
239
239
|
a("div", null, [
|
|
240
240
|
a("div", Ne, [
|
|
241
|
-
i
|
|
242
|
-
modelValue:
|
|
243
|
-
"onUpdate:modelValue":
|
|
241
|
+
c(i, {
|
|
242
|
+
modelValue: r(l).threshold.from,
|
|
243
|
+
"onUpdate:modelValue": t[0] || (t[0] = (P) => r(l).threshold.from = P),
|
|
244
244
|
"show-steppers": !1,
|
|
245
|
-
rules: [
|
|
245
|
+
rules: [r(N).ruleAtPath(r(A), "threshold.from")]
|
|
246
246
|
}, {
|
|
247
247
|
label: V(() => [
|
|
248
|
-
(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
(C(), j(ne(
|
|
249
|
+
r(N).toInputLabel(
|
|
250
|
+
r(N).typeAtPath(r(A), "threshold.from"),
|
|
251
|
+
r(p)(
|
|
252
252
|
"connect.referral.editReferralCountSheet.min_referral_count"
|
|
253
253
|
)
|
|
254
254
|
)
|
|
@@ -256,17 +256,17 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
256
256
|
]),
|
|
257
257
|
_: 1
|
|
258
258
|
}, 8, ["modelValue", "rules"]),
|
|
259
|
-
i
|
|
260
|
-
modelValue:
|
|
261
|
-
"onUpdate:modelValue":
|
|
259
|
+
c(i, {
|
|
260
|
+
modelValue: r(l).threshold.to,
|
|
261
|
+
"onUpdate:modelValue": t[1] || (t[1] = (P) => r(l).threshold.to = P),
|
|
262
262
|
"show-steppers": !1,
|
|
263
|
-
rules: [
|
|
263
|
+
rules: [r(N).ruleAtPath(r(A), "threshold.to")]
|
|
264
264
|
}, {
|
|
265
265
|
label: V(() => [
|
|
266
|
-
(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
(C(), j(ne(
|
|
267
|
+
r(N).toInputLabel(
|
|
268
|
+
r(N).typeAtPath(r(A), "threshold.to"),
|
|
269
|
+
r(p)(
|
|
270
270
|
"connect.referral.editReferralCountSheet.max_referral_count"
|
|
271
271
|
)
|
|
272
272
|
)
|
|
@@ -275,20 +275,22 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
275
275
|
_: 1
|
|
276
276
|
}, 8, ["modelValue", "rules"])
|
|
277
277
|
]),
|
|
278
|
-
|
|
279
|
-
text:
|
|
280
|
-
state:
|
|
278
|
+
c(v, {
|
|
279
|
+
text: r(N).helperText(r(T), "threshold"),
|
|
280
|
+
state: r(N).helperState(r(T), "threshold")
|
|
281
281
|
}, null, 8, ["text", "state"]),
|
|
282
|
-
He
|
|
282
|
+
a("div", He, O(r(p)(
|
|
283
|
+
"connect.referral.editReferralCountSheet.max_referral_count_description"
|
|
284
|
+
)), 1)
|
|
283
285
|
]),
|
|
284
|
-
a("div", ze, O(
|
|
285
|
-
|
|
286
|
-
modelValue:
|
|
287
|
-
"onUpdate:modelValue":
|
|
286
|
+
a("div", ze, O(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
|
|
287
|
+
c(b, {
|
|
288
|
+
modelValue: r(h),
|
|
289
|
+
"onUpdate:modelValue": t[2] || (t[2] = (P) => J(h) ? h.value = P : null),
|
|
288
290
|
selection: "multiple",
|
|
289
|
-
"column-filter":
|
|
291
|
+
"column-filter": r(o),
|
|
290
292
|
"column-defs": y,
|
|
291
|
-
"row-data":
|
|
293
|
+
"row-data": r(s),
|
|
292
294
|
"page-size": 10
|
|
293
295
|
}, null, 8, ["modelValue", "column-filter", "row-data"])
|
|
294
296
|
])
|
|
@@ -297,7 +299,7 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
297
299
|
}, 8, ["modelValue", "header"]);
|
|
298
300
|
};
|
|
299
301
|
}
|
|
300
|
-
}), Ke = { class: "space-y-16" },
|
|
302
|
+
}), Ke = { class: "space-y-16" }, Je = /* @__PURE__ */ 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), We = { class: "grid grid-cols-3 gap-16" }, Ze = { class: "fm-typo-en-title-sm-800" }, Qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ q({
|
|
301
303
|
__name: "CriteriaTriggerInput",
|
|
302
304
|
props: {
|
|
303
305
|
modelValue: {
|
|
@@ -309,32 +311,32 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
309
311
|
}
|
|
310
312
|
},
|
|
311
313
|
emits: ["update:model-value"],
|
|
312
|
-
setup(
|
|
313
|
-
const I =
|
|
314
|
+
setup(k, { emit: n }) {
|
|
315
|
+
const I = k, p = n, g = G(() => [
|
|
314
316
|
le.enum.BILL_COMPLETED,
|
|
315
317
|
le.enum.FEEDBACK
|
|
316
318
|
].map((m) => Se[m]));
|
|
317
|
-
return (m,
|
|
319
|
+
return (m, l) => {
|
|
318
320
|
const d = w("FmCard");
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
a("div",
|
|
322
|
-
(
|
|
323
|
-
key:
|
|
321
|
+
return C(), B("div", Ke, [
|
|
322
|
+
Je,
|
|
323
|
+
a("div", We, [
|
|
324
|
+
(C(!0), B(Y, null, re(r(g), (u) => (C(), j(d, {
|
|
325
|
+
key: u.name,
|
|
324
326
|
variant: "outlined",
|
|
325
327
|
disabled: I.disabled,
|
|
326
|
-
class:
|
|
327
|
-
"col-span-3":
|
|
328
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]":
|
|
329
|
-
"hover:bg-fm-color-opacity-sm":
|
|
328
|
+
class: ce(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
329
|
+
"col-span-3": r(g).length == 1,
|
|
330
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": k.modelValue == u.value,
|
|
331
|
+
"hover:bg-fm-color-opacity-sm": k.modelValue != u.value
|
|
330
332
|
}]),
|
|
331
333
|
onClick: () => {
|
|
332
|
-
I.modelValue !=
|
|
334
|
+
I.modelValue != u.value && !I.disabled && p("update:model-value", u.value);
|
|
333
335
|
}
|
|
334
336
|
}, {
|
|
335
337
|
default: V(() => [
|
|
336
|
-
a("div", Ze, O(
|
|
337
|
-
a("div", Qe, O(
|
|
338
|
+
a("div", Ze, O(u.name), 1),
|
|
339
|
+
a("div", Qe, O(u.description), 1)
|
|
338
340
|
]),
|
|
339
341
|
_: 2
|
|
340
342
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -342,17 +344,17 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
342
344
|
]);
|
|
343
345
|
};
|
|
344
346
|
}
|
|
345
|
-
}),
|
|
347
|
+
}), er = { class: "flex items-center gap-x-8" }, rr = { class: "flex flex-col space-y-16 pr-12" }, tr = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1), or = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1), ar = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1), nr = /* @__PURE__ */ a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1), lr = {
|
|
346
348
|
key: 0,
|
|
347
349
|
class: "space-y-16"
|
|
348
|
-
},
|
|
350
|
+
}, sr = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1), ir = {
|
|
349
351
|
key: 1,
|
|
350
352
|
class: "space-y-16"
|
|
351
|
-
},
|
|
353
|
+
}, cr = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Feedback Criteria", -1), dr = { class: "flex items-center gap-8" }, ur = /* @__PURE__ */ q({
|
|
352
354
|
__name: "EditCriteriaSheet",
|
|
353
355
|
emits: ["update"],
|
|
354
|
-
setup(
|
|
355
|
-
const { t: p } = Z(), g = I, m = $(!1),
|
|
356
|
+
setup(k, { expose: n, emit: I }) {
|
|
357
|
+
const { t: p } = Z(), g = I, m = $(!1), l = $(-1), d = $({}), u = Q(), R = xe.superRefine((y, f) => {
|
|
356
358
|
y.name.length >= 50 && f.addIssue({
|
|
357
359
|
code: "custom",
|
|
358
360
|
message: "Name must be less than 50 characters"
|
|
@@ -361,15 +363,15 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
361
363
|
message: "Name is required"
|
|
362
364
|
});
|
|
363
365
|
}), A = G(() => {
|
|
364
|
-
const y =
|
|
366
|
+
const y = R.safeParse(d.value);
|
|
365
367
|
return y.success ? [] : y.error.errors;
|
|
366
368
|
});
|
|
367
369
|
function T(y, f) {
|
|
368
370
|
var o;
|
|
369
|
-
m.value = y, y && typeof f == "number" && f >= 0 ? (
|
|
370
|
-
(o =
|
|
371
|
-
)) : (
|
|
372
|
-
_id: new
|
|
371
|
+
m.value = y, y && typeof f == "number" && f >= 0 ? (l.value = f, d.value = H(
|
|
372
|
+
(o = u.referralProgram) == null ? void 0 : o.criteria[f]
|
|
373
|
+
)) : (l.value = -1, d.value = {
|
|
374
|
+
_id: new Fe().toString(),
|
|
373
375
|
name: "",
|
|
374
376
|
type: "AUTO",
|
|
375
377
|
event: { type: "BILL_COMPLETED" }
|
|
@@ -378,72 +380,72 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
378
380
|
function M() {
|
|
379
381
|
m.value = !1;
|
|
380
382
|
}
|
|
381
|
-
function
|
|
382
|
-
const y =
|
|
383
|
-
y.success && g("update",
|
|
383
|
+
function D() {
|
|
384
|
+
const y = R.safeParse(d.value);
|
|
385
|
+
y.success && g("update", l.value, y.data);
|
|
384
386
|
}
|
|
385
387
|
function L(y) {
|
|
386
388
|
d.value.type = y, y == "AUTO" ? d.value.event = { type: "BILL_COMPLETED" } : d.value.event = void 0;
|
|
387
389
|
}
|
|
388
|
-
return
|
|
390
|
+
return n({
|
|
389
391
|
showSheet: T,
|
|
390
392
|
hideSheet: M,
|
|
391
393
|
data: d
|
|
392
394
|
}), (y, f) => {
|
|
393
|
-
const o = w("FmButton"),
|
|
394
|
-
return
|
|
395
|
+
const o = w("FmButton"), s = w("FmRadio"), S = w("FmRadioGroup"), h = w("FmSideSheet");
|
|
396
|
+
return C(), j(h, {
|
|
395
397
|
"max-width": 768,
|
|
396
|
-
modelValue:
|
|
397
|
-
"onUpdate:modelValue": f[6] || (f[6] = (e) =>
|
|
398
|
+
modelValue: r(m),
|
|
399
|
+
"onUpdate:modelValue": f[6] || (f[6] = (e) => J(m) ? m.value = e : null)
|
|
398
400
|
}, {
|
|
399
401
|
"side-sheet-header": V(() => [
|
|
400
|
-
a("div",
|
|
401
|
-
|
|
402
|
+
a("div", er, [
|
|
403
|
+
c(o, {
|
|
402
404
|
icon: "arrow_back",
|
|
403
405
|
variant: "tertiary",
|
|
404
406
|
onClick: f[0] || (f[0] = (e) => T(!1))
|
|
405
407
|
}),
|
|
406
|
-
|
|
408
|
+
de("Add Criteria ")
|
|
407
409
|
])
|
|
408
410
|
]),
|
|
409
411
|
"side-sheet-footer": V(() => [
|
|
410
|
-
a("div",
|
|
411
|
-
|
|
412
|
-
label:
|
|
413
|
-
onClick:
|
|
414
|
-
disabled:
|
|
415
|
-
loading:
|
|
412
|
+
a("div", dr, [
|
|
413
|
+
c(o, {
|
|
414
|
+
label: r(p)("connect.editTierSheet.submit"),
|
|
415
|
+
onClick: D,
|
|
416
|
+
disabled: r(A).length > 0 || r(W)().isLoading,
|
|
417
|
+
loading: r(W)().isLoading
|
|
416
418
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
417
|
-
|
|
418
|
-
label:
|
|
419
|
+
c(o, {
|
|
420
|
+
label: r(p)("connect.editTierSheet.cancel"),
|
|
419
421
|
onClick: f[5] || (f[5] = (e) => T(!1)),
|
|
420
422
|
variant: "tertiary"
|
|
421
423
|
}, null, 8, ["label"])
|
|
422
424
|
])
|
|
423
425
|
]),
|
|
424
426
|
default: V(() => [
|
|
425
|
-
|
|
426
|
-
a("div",
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
modelValue:
|
|
430
|
-
"onUpdate:modelValue": f[1] || (f[1] = (e) =>
|
|
431
|
-
label:
|
|
432
|
-
schema:
|
|
427
|
+
c(X, { json: r(d) }, null, 8, ["json"]),
|
|
428
|
+
a("div", rr, [
|
|
429
|
+
tr,
|
|
430
|
+
c(Re, {
|
|
431
|
+
modelValue: r(d).name,
|
|
432
|
+
"onUpdate:modelValue": f[1] || (f[1] = (e) => r(d).name = e),
|
|
433
|
+
label: r(p)("connect.referral.editReferralTierSheet.name"),
|
|
434
|
+
schema: r(N).typeAtPath(r(R), "name")
|
|
433
435
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
"model-value":
|
|
436
|
+
or,
|
|
437
|
+
c(S, {
|
|
438
|
+
"model-value": r(d).type,
|
|
437
439
|
label: "Verify status",
|
|
438
440
|
"onUpdate:modelValue": L
|
|
439
441
|
}, {
|
|
440
442
|
default: V(() => [
|
|
441
|
-
|
|
443
|
+
c(s, {
|
|
442
444
|
value: "AUTO",
|
|
443
445
|
label: "Auto",
|
|
444
446
|
sublabel: "Verify based on rule configuration"
|
|
445
447
|
}),
|
|
446
|
-
|
|
448
|
+
c(s, {
|
|
447
449
|
value: "MANUAL",
|
|
448
450
|
label: "Manual",
|
|
449
451
|
sublabel: "Verify based on manual inspection"
|
|
@@ -451,25 +453,25 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
451
453
|
]),
|
|
452
454
|
_: 1
|
|
453
455
|
}, 8, ["model-value"]),
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
"model-value":
|
|
459
|
-
"onUpdate:modelValue": f[2] || (f[2] = (e) =>
|
|
456
|
+
r(d).type == "AUTO" ? (C(), B(Y, { key: 0 }, [
|
|
457
|
+
ar,
|
|
458
|
+
nr,
|
|
459
|
+
c(Xe, {
|
|
460
|
+
"model-value": r(d).event.type,
|
|
461
|
+
"onUpdate:modelValue": f[2] || (f[2] = (e) => r(d).event.type = e)
|
|
460
462
|
}, null, 8, ["model-value"]),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
"model-value":
|
|
465
|
-
"onUpdate:modelValue": f[3] || (f[3] = (e) =>
|
|
463
|
+
r(d).event.type == r(se).enum.BILL_COMPLETED ? (C(), B("div", lr, [
|
|
464
|
+
sr,
|
|
465
|
+
c($e, {
|
|
466
|
+
"model-value": r(d).event.rule,
|
|
467
|
+
"onUpdate:modelValue": f[3] || (f[3] = (e) => r(d).event.rule = e)
|
|
466
468
|
}, null, 8, ["model-value"])
|
|
467
469
|
])) : z("", !0),
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
"model-value":
|
|
472
|
-
"onUpdate:modelValue": f[4] || (f[4] = (e) =>
|
|
470
|
+
r(d).event.type == r(se).enum.FEEDBACK ? (C(), B("div", ir, [
|
|
471
|
+
cr,
|
|
472
|
+
c(ke, {
|
|
473
|
+
"model-value": r(d).event.rule,
|
|
474
|
+
"onUpdate:modelValue": f[4] || (f[4] = (e) => r(d).event.rule = e)
|
|
473
475
|
}, null, 8, ["model-value"])
|
|
474
476
|
])) : z("", !0)
|
|
475
477
|
], 64)) : z("", !0)
|
|
@@ -481,51 +483,51 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
481
483
|
}
|
|
482
484
|
});
|
|
483
485
|
function he() {
|
|
484
|
-
const
|
|
486
|
+
const k = $(!1), n = Ce();
|
|
485
487
|
return {
|
|
486
488
|
confirmUpdateReferralRecord: async () => {
|
|
487
489
|
await new Promise((p) => {
|
|
488
|
-
|
|
490
|
+
n.open({
|
|
489
491
|
title: "Confirmation",
|
|
490
492
|
message: "This will change all referral settings? Would you like to update previous referral record?",
|
|
491
493
|
primaryActions: { text: "Update all", close: !0 },
|
|
492
494
|
secondaryActions: { text: "Update future only", close: !0 }
|
|
493
495
|
}).onPrimary(async () => {
|
|
494
|
-
|
|
496
|
+
k.value = !0, p();
|
|
495
497
|
}).onSecondary(async () => {
|
|
496
|
-
|
|
498
|
+
k.value = !1, p();
|
|
497
499
|
});
|
|
498
500
|
});
|
|
499
501
|
},
|
|
500
|
-
updateReferralRecord:
|
|
502
|
+
updateReferralRecord: k
|
|
501
503
|
};
|
|
502
504
|
}
|
|
503
|
-
const
|
|
505
|
+
const mr = { class: "flex flex-col space-y-16 mt-24" }, fr = { class: "flex justify-between items-center" }, pr = /* @__PURE__ */ a("div", null, [
|
|
504
506
|
/* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
|
|
505
507
|
/* @__PURE__ */ a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
|
|
506
|
-
], -1),
|
|
508
|
+
], -1), hr = /* @__PURE__ */ q({
|
|
507
509
|
__name: "ManageCriteriaSheet",
|
|
508
|
-
setup(
|
|
509
|
-
const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord: g, updateReferralRecord: m } = he(),
|
|
510
|
+
setup(k, { expose: n }) {
|
|
511
|
+
const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord: g, updateReferralRecord: m } = he(), l = $(!1), d = $({}), u = Q(), R = $(
|
|
510
512
|
null
|
|
511
513
|
), A = G(() => {
|
|
512
514
|
var o;
|
|
513
|
-
return (o =
|
|
515
|
+
return (o = u.referralProgram) == null ? void 0 : o.criteria;
|
|
514
516
|
});
|
|
515
517
|
async function T(o) {
|
|
516
518
|
await g(), await p(async () => {
|
|
517
519
|
await pe.update({
|
|
518
520
|
...o,
|
|
519
521
|
updateReferralRecord: m.value
|
|
520
|
-
}), await
|
|
522
|
+
}), await u.readReferralProgram();
|
|
521
523
|
});
|
|
522
524
|
}
|
|
523
|
-
async function M(o,
|
|
524
|
-
var e,
|
|
525
|
-
const S = o == -1 ? ((e =
|
|
526
|
-
h.criteria[S] =
|
|
525
|
+
async function M(o, s) {
|
|
526
|
+
var e, t;
|
|
527
|
+
const S = o == -1 ? ((e = u.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = H(u.referralProgram);
|
|
528
|
+
h.criteria[S] = s, await T(h), (t = R.value) == null || t.showSheet(!1);
|
|
527
529
|
}
|
|
528
|
-
async function
|
|
530
|
+
async function D(o) {
|
|
529
531
|
var h, e;
|
|
530
532
|
if (!await K.remove(
|
|
531
533
|
"Are you sure to remove criteria",
|
|
@@ -534,8 +536,8 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
534
536
|
I("connect.prompt.cancel")
|
|
535
537
|
))
|
|
536
538
|
return;
|
|
537
|
-
const
|
|
538
|
-
S.criteria.splice(
|
|
539
|
+
const s = o == -1 ? ((h = u.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, S = H(u.referralProgram);
|
|
540
|
+
S.criteria.splice(s, 1), await T(S), (e = R.value) == null || e.showSheet(!1);
|
|
539
541
|
}
|
|
540
542
|
const L = [
|
|
541
543
|
{
|
|
@@ -545,7 +547,7 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
545
547
|
{
|
|
546
548
|
header: "Validity method",
|
|
547
549
|
cell(o) {
|
|
548
|
-
return
|
|
550
|
+
return te(oe.FmChip, {
|
|
549
551
|
label: we.title(o.row.original.type),
|
|
550
552
|
variant: "plain"
|
|
551
553
|
});
|
|
@@ -555,12 +557,12 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
555
557
|
header: "Actions",
|
|
556
558
|
cell(o) {
|
|
557
559
|
return [
|
|
558
|
-
|
|
560
|
+
te(oe.FmButton, {
|
|
559
561
|
variant: "tertiary",
|
|
560
562
|
icon: "delete",
|
|
561
563
|
iconColor: "neutral-gray-400",
|
|
562
|
-
onClick: (
|
|
563
|
-
|
|
564
|
+
onClick: (s) => {
|
|
565
|
+
s.stopPropagation(), D(o.row.index);
|
|
564
566
|
}
|
|
565
567
|
})
|
|
566
568
|
];
|
|
@@ -568,72 +570,72 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
568
570
|
}
|
|
569
571
|
];
|
|
570
572
|
function y(o) {
|
|
571
|
-
|
|
573
|
+
l.value = o;
|
|
572
574
|
}
|
|
573
575
|
function f() {
|
|
574
|
-
|
|
576
|
+
l.value = !1;
|
|
575
577
|
}
|
|
576
|
-
return
|
|
578
|
+
return n({
|
|
577
579
|
showSheet: y,
|
|
578
580
|
hideSheet: f,
|
|
579
581
|
data: d
|
|
580
|
-
}), (o,
|
|
582
|
+
}), (o, s) => {
|
|
581
583
|
const S = w("FmButton"), h = w("FmTable"), e = w("FmSideSheet");
|
|
582
|
-
return
|
|
583
|
-
|
|
584
|
+
return C(), B(Y, null, [
|
|
585
|
+
c(e, {
|
|
584
586
|
"max-width": 768,
|
|
585
|
-
modelValue:
|
|
586
|
-
"onUpdate:modelValue":
|
|
587
|
+
modelValue: r(l),
|
|
588
|
+
"onUpdate:modelValue": s[2] || (s[2] = (t) => J(l) ? l.value = t : null),
|
|
587
589
|
header: "Manage Criteria"
|
|
588
590
|
}, {
|
|
589
591
|
default: V(() => [
|
|
590
|
-
a("div",
|
|
591
|
-
a("div",
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
a("div", mr, [
|
|
593
|
+
a("div", fr, [
|
|
594
|
+
pr,
|
|
595
|
+
c(S, {
|
|
594
596
|
label: "Add Criteria",
|
|
595
597
|
icon: "add",
|
|
596
598
|
variant: "secondary",
|
|
597
|
-
onClick:
|
|
598
|
-
var
|
|
599
|
-
return (
|
|
599
|
+
onClick: s[0] || (s[0] = (t) => {
|
|
600
|
+
var i;
|
|
601
|
+
return (i = r(R)) == null ? void 0 : i.showSheet(!0);
|
|
600
602
|
})
|
|
601
603
|
})
|
|
602
604
|
]),
|
|
603
|
-
|
|
604
|
-
"row-data":
|
|
605
|
+
c(h, {
|
|
606
|
+
"row-data": r(A),
|
|
605
607
|
"hide-footer": !0,
|
|
606
608
|
"page-size": 100,
|
|
607
609
|
"shrink-at": !1,
|
|
608
610
|
"column-defs": L,
|
|
609
|
-
onRowClick:
|
|
610
|
-
var
|
|
611
|
-
return (
|
|
611
|
+
onRowClick: s[1] || (s[1] = (t) => {
|
|
612
|
+
var i;
|
|
613
|
+
return (i = r(R)) == null ? void 0 : i.showSheet(!0, t.index);
|
|
612
614
|
})
|
|
613
615
|
}, null, 8, ["row-data"])
|
|
614
616
|
])
|
|
615
617
|
]),
|
|
616
618
|
_: 1
|
|
617
619
|
}, 8, ["modelValue"]),
|
|
618
|
-
|
|
620
|
+
c(ur, {
|
|
619
621
|
ref_key: "editCriteriaSheetRef",
|
|
620
|
-
ref:
|
|
622
|
+
ref: R,
|
|
621
623
|
onUpdate: M
|
|
622
624
|
}, null, 512)
|
|
623
625
|
], 64);
|
|
624
626
|
};
|
|
625
627
|
}
|
|
626
|
-
}),
|
|
628
|
+
}), _r = { class: "flex flex-col space-y-16 pr-12" }, vr = { class: "fm-typo-en-title-sm-800" }, gr = { class: "flex items-center gap-8" }, wr = /* @__PURE__ */ q({
|
|
627
629
|
__name: "EditRefereeRewardSheet",
|
|
628
630
|
emits: ["update"],
|
|
629
|
-
setup(
|
|
630
|
-
const { t: p } = Z(), g = I, m = $(!1),
|
|
631
|
-
function
|
|
632
|
-
g("update",
|
|
631
|
+
setup(k, { expose: n, emit: I }) {
|
|
632
|
+
const { t: p } = Z(), g = I, m = $(!1), l = $([]), d = Q();
|
|
633
|
+
function u() {
|
|
634
|
+
g("update", l.value);
|
|
633
635
|
}
|
|
634
|
-
async function
|
|
635
|
-
var
|
|
636
|
-
m.value = o,
|
|
636
|
+
async function R(o) {
|
|
637
|
+
var s, S;
|
|
638
|
+
m.value = o, l.value = ((S = (s = d.referralProgram) == null ? void 0 : s.refereeReward) == null ? void 0 : S.map((h) => h.toString())) || [], f.value = L.value.map((h) => l.value.includes(h.id));
|
|
637
639
|
}
|
|
638
640
|
function A() {
|
|
639
641
|
m.value = !1;
|
|
@@ -655,19 +657,19 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
655
657
|
header: "Description",
|
|
656
658
|
accessorFn: (o) => o.description,
|
|
657
659
|
cell(o) {
|
|
658
|
-
const
|
|
659
|
-
if (
|
|
660
|
-
return
|
|
660
|
+
const s = o.row.original;
|
|
661
|
+
if (s.collectible.type == "VOUCHER" || s.selectedReward == null)
|
|
662
|
+
return s.description;
|
|
661
663
|
}
|
|
662
664
|
}
|
|
663
|
-
], M = me(),
|
|
664
|
-
let
|
|
665
|
+
], M = me(), D = $([]), L = G(() => M.rewards.map((o) => {
|
|
666
|
+
let s = "No expiry";
|
|
665
667
|
switch (o.option.type) {
|
|
666
668
|
case "VOUCHER":
|
|
667
|
-
|
|
669
|
+
s = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
|
|
668
670
|
break;
|
|
669
671
|
case "LOYALTY":
|
|
670
|
-
|
|
672
|
+
s = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
|
|
671
673
|
break;
|
|
672
674
|
}
|
|
673
675
|
return {
|
|
@@ -675,56 +677,56 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
675
677
|
name: o.name,
|
|
676
678
|
collectible: o.option,
|
|
677
679
|
collectibleConfig: o.collectibleConfig,
|
|
678
|
-
description:
|
|
680
|
+
description: s
|
|
679
681
|
};
|
|
680
682
|
}));
|
|
681
683
|
G(() => []);
|
|
682
684
|
function y() {
|
|
683
685
|
const o = L.value;
|
|
684
|
-
for (let
|
|
685
|
-
const S = o[
|
|
686
|
-
h && !
|
|
686
|
+
for (let s = 0; s < o.length; s++) {
|
|
687
|
+
const S = o[s], h = f.value[s];
|
|
688
|
+
h && !l.value.includes(S.id) && l.value.push(S.id), !h && l.value.includes(S.id) && (l.value = l.value.filter((e) => e != S.id));
|
|
687
689
|
}
|
|
688
690
|
}
|
|
689
691
|
const f = $({});
|
|
690
|
-
return ie(f, y, { deep: !0 }),
|
|
691
|
-
showSheet:
|
|
692
|
+
return ie(f, y, { deep: !0 }), n({
|
|
693
|
+
showSheet: R,
|
|
692
694
|
hideSheet: A,
|
|
693
|
-
data:
|
|
694
|
-
}), (o,
|
|
695
|
+
data: l
|
|
696
|
+
}), (o, s) => {
|
|
695
697
|
const S = w("FmTable"), h = w("FmButton"), e = w("FmSideSheet");
|
|
696
|
-
return
|
|
698
|
+
return C(), j(e, {
|
|
697
699
|
"max-width": 1e3,
|
|
698
|
-
modelValue:
|
|
699
|
-
"onUpdate:modelValue":
|
|
700
|
+
modelValue: r(m),
|
|
701
|
+
"onUpdate:modelValue": s[2] || (s[2] = (t) => J(m) ? m.value = t : null),
|
|
700
702
|
header: "Referee reward"
|
|
701
703
|
}, {
|
|
702
704
|
"side-sheet-footer": V(() => [
|
|
703
|
-
a("div",
|
|
704
|
-
|
|
705
|
-
label:
|
|
706
|
-
onClick:
|
|
707
|
-
disabled:
|
|
708
|
-
loading:
|
|
705
|
+
a("div", gr, [
|
|
706
|
+
c(h, {
|
|
707
|
+
label: r(p)("connect.common.save"),
|
|
708
|
+
onClick: u,
|
|
709
|
+
disabled: r(W)().isLoading,
|
|
710
|
+
loading: r(W)().isLoading
|
|
709
711
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
710
|
-
|
|
711
|
-
label:
|
|
712
|
-
onClick:
|
|
712
|
+
c(h, {
|
|
713
|
+
label: r(p)("connect.common.cancel"),
|
|
714
|
+
onClick: s[1] || (s[1] = (t) => A()),
|
|
713
715
|
variant: "tertiary"
|
|
714
716
|
}, null, 8, ["label"])
|
|
715
717
|
])
|
|
716
718
|
]),
|
|
717
719
|
default: V(() => [
|
|
718
|
-
|
|
719
|
-
a("div",
|
|
720
|
-
a("div",
|
|
721
|
-
|
|
722
|
-
modelValue:
|
|
723
|
-
"onUpdate:modelValue":
|
|
720
|
+
c(X, { json: r(l) }, null, 8, ["json"]),
|
|
721
|
+
a("div", _r, [
|
|
722
|
+
a("div", vr, O(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
|
|
723
|
+
c(S, {
|
|
724
|
+
modelValue: r(f),
|
|
725
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => J(f) ? f.value = t : null),
|
|
724
726
|
selection: "multiple",
|
|
725
|
-
"column-filter":
|
|
727
|
+
"column-filter": r(D),
|
|
726
728
|
"column-defs": T,
|
|
727
|
-
"row-data":
|
|
729
|
+
"row-data": r(L),
|
|
728
730
|
"page-size": 10
|
|
729
731
|
}, null, 8, ["modelValue", "column-filter", "row-data"])
|
|
730
732
|
])
|
|
@@ -733,46 +735,48 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
733
735
|
}, 8, ["modelValue"]);
|
|
734
736
|
};
|
|
735
737
|
}
|
|
736
|
-
}),
|
|
738
|
+
}), yr = { class: "fm-typo-en-title-sm-600" }, br = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, xr = { class: "flex gap-x-8" }, Cr = { class: "fm-typo-body-lg-600 flex items-center gap-x-4" }, Rr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sr = { class: "mb-40" }, $r = {
|
|
737
739
|
key: 0,
|
|
738
740
|
class: "flex flex-col items-center justify-center gap-y-16 p-24"
|
|
739
|
-
},
|
|
741
|
+
}, kr = /* @__PURE__ */ a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
740
742
|
/* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
|
|
741
743
|
/* @__PURE__ */ 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 ")
|
|
742
|
-
], -1),
|
|
744
|
+
], -1), Fr = /* @__PURE__ */ a("img", {
|
|
743
745
|
src: ge,
|
|
744
746
|
class: "aspect-square w-[150px]"
|
|
745
|
-
}, null, -1),
|
|
747
|
+
}, null, -1), Pr = { class: "flex flex-col gap-16 text-center" }, Vr = { class: "fm-typo-en-title-sm-800" }, Ir = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tt = /* @__PURE__ */ q({
|
|
746
748
|
__name: "Overview",
|
|
747
|
-
setup(
|
|
748
|
-
const { t:
|
|
749
|
+
setup(k) {
|
|
750
|
+
const { t: n } = Z(), { minor: I } = ue, p = Pe(), g = Q(), { confirmUpdateReferralRecord: m, updateReferralRecord: l } = he(), d = G(() => {
|
|
749
751
|
var e;
|
|
750
752
|
return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
|
|
751
|
-
}),
|
|
753
|
+
}), u = $(null);
|
|
752
754
|
$(null);
|
|
753
|
-
const
|
|
754
|
-
var e,
|
|
755
|
+
const R = $(null), A = $(null), T = $(null), M = G(() => {
|
|
756
|
+
var e, t, i, v;
|
|
755
757
|
return [
|
|
756
758
|
{
|
|
757
759
|
label: "connect.referral.how_it_works.generate_link",
|
|
758
|
-
sublabel:
|
|
760
|
+
sublabel: n("connect.referral.how_it_works.generate_link_for_member"),
|
|
759
761
|
icon: "offline_share"
|
|
760
762
|
},
|
|
761
763
|
{
|
|
762
764
|
label: "connect.referral.how_it_works.referee_join_reward",
|
|
763
|
-
sublabel: `${((
|
|
764
|
-
action:
|
|
765
|
+
sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} ${n("connect.referral.how_it_works.reward")}`,
|
|
766
|
+
action: n("connect.referral.actions.manage_reward"),
|
|
765
767
|
onClick: () => {
|
|
766
768
|
var b;
|
|
767
769
|
return (b = T.value) == null ? void 0 : b.showSheet(!0);
|
|
768
770
|
},
|
|
769
|
-
helperText:
|
|
771
|
+
helperText: n(
|
|
772
|
+
"connect.referral.how_it_works.referee_join_reward_description"
|
|
773
|
+
),
|
|
770
774
|
icon: "group_add"
|
|
771
775
|
},
|
|
772
776
|
{
|
|
773
777
|
label: "connect.referral.how_it_works.referee_meet_criteria",
|
|
774
|
-
sublabel: `${(
|
|
775
|
-
action:
|
|
778
|
+
sublabel: `${(i = g.referralProgram) == null ? void 0 : i.criteria.length} ${n("connect.referral.how_it_works.criteria")}`,
|
|
779
|
+
action: n("connect.referral.actions.manage_criteria"),
|
|
776
780
|
onClick: () => {
|
|
777
781
|
var b;
|
|
778
782
|
return (b = A.value) == null ? void 0 : b.showSheet(!0);
|
|
@@ -781,75 +785,75 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
781
785
|
},
|
|
782
786
|
{
|
|
783
787
|
label: "connect.referral.how_it_works.referer_get_reward",
|
|
784
|
-
sublabel: `${(v = g.referralProgram) == null ? void 0 : v.reward.length}
|
|
785
|
-
helperText: "
|
|
788
|
+
sublabel: `${(v = g.referralProgram) == null ? void 0 : v.reward.length} ${n("connect.referral.how_it_works.reward_tier")}`,
|
|
789
|
+
helperText: n("connect.referral.how_it_works.referral_tier_description"),
|
|
786
790
|
icon: "featured_seasonal_and_gifts"
|
|
787
791
|
}
|
|
788
792
|
];
|
|
789
793
|
});
|
|
790
|
-
function
|
|
791
|
-
var
|
|
792
|
-
(
|
|
794
|
+
function D(e) {
|
|
795
|
+
var t;
|
|
796
|
+
(t = u.value) == null || t.onManageRewardGroup(e);
|
|
793
797
|
}
|
|
794
798
|
function L(e) {
|
|
795
|
-
var
|
|
796
|
-
(
|
|
799
|
+
var t;
|
|
800
|
+
(t = R.value) == null || t.showSheet(!0, {
|
|
797
801
|
groupIndex: e.groupIndex,
|
|
798
802
|
countIndex: e.countIndex
|
|
799
803
|
});
|
|
800
804
|
}
|
|
801
805
|
async function y(e) {
|
|
802
806
|
var P, x, _, E;
|
|
803
|
-
const
|
|
807
|
+
const t = e.countIndex == -1 ? ((x = (P = g.referralProgram) == null ? void 0 : P.reward[e.groupIndex]) == null ? void 0 : x.rewards.length) || 0 : e.countIndex || 0, i = e.referralCount, v = H(
|
|
804
808
|
g.referralProgram
|
|
805
809
|
), b = v.reward[e.groupIndex];
|
|
806
|
-
b.rewards[
|
|
807
|
-
const
|
|
808
|
-
if (
|
|
810
|
+
b.rewards[t] = e.referralCount;
|
|
811
|
+
const F = b.rewards[t - 1], U = b.rewards[t + 1];
|
|
812
|
+
if (F && F.threshold.to != i.threshold.from - 1) {
|
|
809
813
|
if (!await K.confirm(
|
|
810
|
-
|
|
814
|
+
n(
|
|
811
815
|
"connect.referral.referral_count.update.range_discontinuous.previous",
|
|
812
816
|
{
|
|
813
|
-
name:
|
|
814
|
-
from:
|
|
815
|
-
to:
|
|
816
|
-
newTo:
|
|
817
|
+
name: F.threshold.from,
|
|
818
|
+
from: F.threshold.from ?? 0,
|
|
819
|
+
to: F.threshold.to ?? 1 / 0,
|
|
820
|
+
newTo: i.threshold.from - 1
|
|
817
821
|
}
|
|
818
822
|
),
|
|
819
|
-
|
|
820
|
-
|
|
823
|
+
n("connect.referral.referral_count.title"),
|
|
824
|
+
n("connect.referral.referral_count.remove.next_range")
|
|
821
825
|
))
|
|
822
826
|
return;
|
|
823
|
-
|
|
827
|
+
F.threshold.to = i.threshold.from - 1;
|
|
824
828
|
}
|
|
825
|
-
if (U && U.threshold.from - 1 !=
|
|
829
|
+
if (U && U.threshold.from - 1 != i.threshold.to) {
|
|
826
830
|
if (!await K.confirm(
|
|
827
|
-
|
|
831
|
+
n("connect.program.tier.update.range_discontinuous.next", {
|
|
828
832
|
name: U.threshold.from,
|
|
829
833
|
from: U.threshold.from ?? 0,
|
|
830
834
|
to: U.threshold.to ?? 1 / 0,
|
|
831
|
-
newFrom:
|
|
835
|
+
newFrom: i.threshold.to ?? 1
|
|
832
836
|
}),
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
837
|
+
n("connect.program.tier.title"),
|
|
838
|
+
n("connect.program.tier.remove.next_range"),
|
|
839
|
+
n("connect.prompt.cancel")
|
|
836
840
|
))
|
|
837
841
|
return;
|
|
838
|
-
U.threshold.from = (
|
|
842
|
+
U.threshold.from = (i.threshold.to ?? 0) + 1;
|
|
839
843
|
}
|
|
840
|
-
!U && !((_ =
|
|
844
|
+
!U && !((_ = i.threshold) != null && _.to) && (i.threshold.to = void 0), await o(v), (E = R.value) == null || E.hideSheet();
|
|
841
845
|
}
|
|
842
846
|
async function f(e) {
|
|
843
|
-
var
|
|
844
|
-
const
|
|
845
|
-
|
|
847
|
+
var i;
|
|
848
|
+
const t = H(g.referralProgram);
|
|
849
|
+
t.refereeReward = e, await o(t), (i = T.value) == null || i.hideSheet();
|
|
846
850
|
}
|
|
847
851
|
async function o(e) {
|
|
848
852
|
await m(), await I(
|
|
849
853
|
async () => {
|
|
850
854
|
await pe.update({
|
|
851
855
|
...e,
|
|
852
|
-
updateReferralRecord:
|
|
856
|
+
updateReferralRecord: l.value
|
|
853
857
|
}), await g.readReferralProgram();
|
|
854
858
|
},
|
|
855
859
|
{
|
|
@@ -858,53 +862,53 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
858
862
|
}
|
|
859
863
|
);
|
|
860
864
|
}
|
|
861
|
-
async function
|
|
865
|
+
async function s(e) {
|
|
862
866
|
if (!await K.remove(
|
|
863
|
-
"
|
|
864
|
-
"
|
|
865
|
-
|
|
866
|
-
|
|
867
|
+
n("connect.referral.reward.confirm_remove_referral_tier"),
|
|
868
|
+
n("connect.referral.reward.remove_referral_tier"),
|
|
869
|
+
n("connect.prompt.confirm"),
|
|
870
|
+
n("connect.prompt.cancel")
|
|
867
871
|
))
|
|
868
872
|
return;
|
|
869
|
-
const
|
|
870
|
-
|
|
873
|
+
const t = H(g.referralProgram);
|
|
874
|
+
t.reward.splice(e, 1), await o(t);
|
|
871
875
|
}
|
|
872
|
-
async function S(e,
|
|
876
|
+
async function S(e, t) {
|
|
873
877
|
if (!await K.remove(
|
|
874
|
-
"
|
|
875
|
-
"
|
|
876
|
-
|
|
877
|
-
|
|
878
|
+
n("connect.referral.reward.confirm_remove_referral_count"),
|
|
879
|
+
n("connect.referral.reward.remove_referral_count"),
|
|
880
|
+
n("connect.prompt.confirm"),
|
|
881
|
+
n("connect.prompt.cancel")
|
|
878
882
|
))
|
|
879
883
|
return;
|
|
880
|
-
const
|
|
884
|
+
const i = H(g.referralProgram), v = i.reward[e].rewards[t + 1];
|
|
881
885
|
if (v) {
|
|
882
886
|
if (!await K.confirm(
|
|
883
|
-
|
|
887
|
+
n("connect.referral.referral_count.update.range_discontinuous.next", {
|
|
884
888
|
from: v.threshold.from ?? 0,
|
|
885
889
|
to: v.threshold.to ?? 1 / 0,
|
|
886
|
-
newFrom:
|
|
890
|
+
newFrom: i.reward[e].rewards[t].threshold.from
|
|
887
891
|
}),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
892
|
+
n("connect.referral.referral_count.remove.title"),
|
|
893
|
+
n("connect.referral.referral_count.remove.next_range"),
|
|
894
|
+
n("connect.prompt.cancel")
|
|
891
895
|
))
|
|
892
896
|
return;
|
|
893
|
-
v.threshold.from =
|
|
897
|
+
v.threshold.from = i.reward[e].rewards[t].threshold.from;
|
|
894
898
|
}
|
|
895
|
-
|
|
899
|
+
i.reward[e].rewards.splice(t, 1), await o(i);
|
|
896
900
|
}
|
|
897
901
|
const h = [
|
|
898
902
|
{
|
|
899
|
-
header: "
|
|
903
|
+
header: n("connect.referral.reward.table.count"),
|
|
900
904
|
accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
|
|
901
905
|
},
|
|
902
906
|
{
|
|
903
|
-
header: "
|
|
907
|
+
header: n("connect.referral.reward.table.reward"),
|
|
904
908
|
accessorKey: "type",
|
|
905
909
|
accessorFn: (e) => {
|
|
906
|
-
var
|
|
907
|
-
return `${((
|
|
910
|
+
var t;
|
|
911
|
+
return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
|
|
908
912
|
}
|
|
909
913
|
},
|
|
910
914
|
{
|
|
@@ -913,13 +917,13 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
913
917
|
textAlign: "right"
|
|
914
918
|
},
|
|
915
919
|
cell(e) {
|
|
916
|
-
return
|
|
920
|
+
return te(oe.FmButton, {
|
|
917
921
|
variant: "tertiary",
|
|
918
922
|
icon: "delete",
|
|
919
923
|
iconColor: "neutral-gray-400",
|
|
920
924
|
class: "ml-auto",
|
|
921
|
-
onClick: (
|
|
922
|
-
|
|
925
|
+
onClick: (t) => {
|
|
926
|
+
t.stopPropagation(), console.log(e.row), S(e.row.original.groupIndex, e.row.index);
|
|
923
927
|
}
|
|
924
928
|
});
|
|
925
929
|
}
|
|
@@ -927,36 +931,36 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
927
931
|
];
|
|
928
932
|
return ve(async () => {
|
|
929
933
|
await g.readReferralProgram();
|
|
930
|
-
}), (e,
|
|
931
|
-
const
|
|
932
|
-
return
|
|
934
|
+
}), (e, t) => {
|
|
935
|
+
const i = w("FmCard"), v = w("FmIcon"), b = w("FmTooltip"), F = w("FmButton"), U = w("FmTable"), P = w("FmList");
|
|
936
|
+
return C(), B(Y, null, [
|
|
933
937
|
z("", !0),
|
|
934
|
-
i
|
|
938
|
+
c(i, {
|
|
935
939
|
variant: "outlined",
|
|
936
940
|
class: "flex flex-col gap-16 p-16"
|
|
937
941
|
}, {
|
|
938
942
|
default: V(() => [
|
|
939
|
-
a("div",
|
|
940
|
-
a("div",
|
|
941
|
-
(
|
|
943
|
+
a("div", yr, O(r(n)("connect.referral.how_it_works.title")), 1),
|
|
944
|
+
a("div", br, [
|
|
945
|
+
(C(!0), B(Y, null, re(r(M), (x, _) => (C(), B("div", {
|
|
942
946
|
key: _,
|
|
943
|
-
class:
|
|
947
|
+
class: ce(["px-8", { "xs:!border-r": _ % 2 == 0 }])
|
|
944
948
|
}, [
|
|
945
|
-
a("div",
|
|
946
|
-
|
|
949
|
+
a("div", xr, [
|
|
950
|
+
c(v, {
|
|
947
951
|
name: x.icon,
|
|
948
952
|
color: "primary",
|
|
949
953
|
class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
|
|
950
954
|
}, null, 8, ["name"]),
|
|
951
955
|
a("div", null, [
|
|
952
|
-
a("div",
|
|
953
|
-
|
|
954
|
-
x.helperText ? (
|
|
956
|
+
a("div", Cr, [
|
|
957
|
+
de(O(r(n)(x.label)) + " ", 1),
|
|
958
|
+
x.helperText ? (C(), j(b, {
|
|
955
959
|
key: 0,
|
|
956
960
|
content: x.helperText
|
|
957
961
|
}, {
|
|
958
962
|
default: V(() => [
|
|
959
|
-
|
|
963
|
+
c(v, {
|
|
960
964
|
name: "help",
|
|
961
965
|
size: "sm",
|
|
962
966
|
outline: !0
|
|
@@ -965,12 +969,12 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
965
969
|
_: 2
|
|
966
970
|
}, 1032, ["content"])) : z("", !0)
|
|
967
971
|
]),
|
|
968
|
-
a("div",
|
|
969
|
-
x.action ? (
|
|
972
|
+
a("div", Rr, O(x.sublabel), 1),
|
|
973
|
+
x.action ? (C(), j(F, {
|
|
970
974
|
key: 0,
|
|
971
975
|
variant: "plain",
|
|
972
976
|
label: x.action,
|
|
973
|
-
disabled: !
|
|
977
|
+
disabled: !r(p).isPremium,
|
|
974
978
|
class: "fm-typo-en-body-md-400 !p-0",
|
|
975
979
|
onClick: x.onClick
|
|
976
980
|
}, null, 8, ["label", "disabled", "onClick"])) : z("", !0)
|
|
@@ -981,27 +985,27 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
981
985
|
]),
|
|
982
986
|
_: 1
|
|
983
987
|
}),
|
|
984
|
-
|
|
988
|
+
r(d) && r(d).length > 0 ? (C(), j(i, {
|
|
985
989
|
key: 1,
|
|
986
990
|
variant: "outlined",
|
|
987
991
|
class: "flex flex-col gap-16 p-16"
|
|
988
992
|
}, {
|
|
989
993
|
default: V(() => [
|
|
990
|
-
|
|
994
|
+
c(P, { separator: !0 }, {
|
|
991
995
|
default: V(() => [
|
|
992
|
-
(
|
|
996
|
+
(C(!0), B(Y, null, re(r(d), (x, _) => (C(), j(Ge, {
|
|
993
997
|
key: _,
|
|
994
998
|
"reward-group": x,
|
|
995
999
|
level: _,
|
|
996
|
-
onEdit: (E) =>
|
|
997
|
-
onRemove: (E) =>
|
|
998
|
-
onAddCount:
|
|
1000
|
+
onEdit: (E) => D(_),
|
|
1001
|
+
onRemove: (E) => s(_),
|
|
1002
|
+
onAddCount: t[0] || (t[0] = (E) => {
|
|
999
1003
|
L({ groupIndex: E, countIndex: -1 });
|
|
1000
1004
|
})
|
|
1001
1005
|
}, {
|
|
1002
1006
|
default: V(() => [
|
|
1003
|
-
a("div",
|
|
1004
|
-
|
|
1007
|
+
a("div", Sr, [
|
|
1008
|
+
c(U, {
|
|
1005
1009
|
"row-data": x.rewards.map((E) => ({ ...E, groupIndex: _ })),
|
|
1006
1010
|
"column-defs": h,
|
|
1007
1011
|
"hide-footer": !0,
|
|
@@ -1009,9 +1013,9 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
1009
1013
|
onRowClick: (E) => L({ groupIndex: _, countIndex: E.index })
|
|
1010
1014
|
}, null, 8, ["row-data", "onRowClick"])
|
|
1011
1015
|
]),
|
|
1012
|
-
x.rewards.length ? z("", !0) : (
|
|
1013
|
-
|
|
1014
|
-
|
|
1016
|
+
x.rewards.length ? z("", !0) : (C(), B("div", $r, [
|
|
1017
|
+
kr,
|
|
1018
|
+
c(F, {
|
|
1015
1019
|
variant: "secondary",
|
|
1016
1020
|
label: "Add count",
|
|
1017
1021
|
icon: "add",
|
|
@@ -1026,41 +1030,41 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
1026
1030
|
})
|
|
1027
1031
|
]),
|
|
1028
1032
|
_: 1
|
|
1029
|
-
})) : (
|
|
1033
|
+
})) : (C(), j(i, {
|
|
1030
1034
|
key: 2,
|
|
1031
1035
|
variant: "outlined",
|
|
1032
1036
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1033
1037
|
}, {
|
|
1034
1038
|
default: V(() => [
|
|
1035
|
-
|
|
1036
|
-
a("div",
|
|
1037
|
-
a("div",
|
|
1038
|
-
a("div",
|
|
1039
|
+
Fr,
|
|
1040
|
+
a("div", Pr, [
|
|
1041
|
+
a("div", Vr, O(r(n)("connect.referral.referral_tier_title")), 1),
|
|
1042
|
+
a("div", Ir, O(r(n)("connect.referral.referral_tier_description")), 1)
|
|
1039
1043
|
]),
|
|
1040
|
-
|
|
1044
|
+
c(F, {
|
|
1041
1045
|
variant: "primary",
|
|
1042
|
-
label:
|
|
1046
|
+
label: r(n)("connect.referral.add_referral_tier"),
|
|
1043
1047
|
icon: "add",
|
|
1044
|
-
disabled: !
|
|
1045
|
-
onClick:
|
|
1048
|
+
disabled: !r(p).isPremium,
|
|
1049
|
+
onClick: t[1] || (t[1] = (x) => D(-1))
|
|
1046
1050
|
}, null, 8, ["label", "disabled"])
|
|
1047
1051
|
]),
|
|
1048
1052
|
_: 1
|
|
1049
1053
|
})),
|
|
1050
|
-
|
|
1054
|
+
c(ye, {
|
|
1051
1055
|
ref_key: "rewardGroupRef",
|
|
1052
|
-
ref:
|
|
1056
|
+
ref: u
|
|
1053
1057
|
}, null, 512),
|
|
1054
|
-
|
|
1058
|
+
c(qe, {
|
|
1055
1059
|
ref_key: "editReferralCountSheetRef",
|
|
1056
|
-
ref:
|
|
1060
|
+
ref: R,
|
|
1057
1061
|
onUpdate: y
|
|
1058
1062
|
}, null, 512),
|
|
1059
|
-
|
|
1063
|
+
c(hr, {
|
|
1060
1064
|
ref_key: "manageCriteriaSheetRef",
|
|
1061
1065
|
ref: A
|
|
1062
1066
|
}, null, 512),
|
|
1063
|
-
|
|
1067
|
+
c(wr, {
|
|
1064
1068
|
ref_key: "editRefereeRewardSheetRef",
|
|
1065
1069
|
ref: T,
|
|
1066
1070
|
onUpdate: f
|
|
@@ -1070,5 +1074,5 @@ const mt = { class: "flex flex-col space-y-16 mt-24" }, ft = { class: "flex just
|
|
|
1070
1074
|
}
|
|
1071
1075
|
});
|
|
1072
1076
|
export {
|
|
1073
|
-
|
|
1077
|
+
tt as default
|
|
1074
1078
|
};
|