@feedmepos/mf-connect 0.1.0-beta.49 → 0.1.0-beta.50
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-DTJ_SOI3.js → Analytic-D-yp03jJ.js} +11 -11
- package/dist/{App-Cls9g4sA.js → App-CeQWTGNK.js} +55 -51
- package/dist/{AuditLogs-xbOKPoQS.js → AuditLogs-2qzwcMXR.js} +8 -8
- package/dist/Bin-D1b2NbbA.js +191 -0
- package/dist/{Broadcast-UeoV6_0x.js → Broadcast-bKF9mIns.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPl_0m0I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -6
- package/dist/{Card-DSK_2b0H.js → Card-BCAyfBLi.js} +15 -15
- package/dist/{Collections-U63Y-tw8.js → Collections-Yz3F55bv.js} +5 -5
- package/dist/{Credit-CC1k4c10.js → Credit-Ceptt_g_.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BUPBXZWy.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js} +28 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DnjTCWUk.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +8 -8
- package/dist/{Experience-UBLCm5X8.js → Experience-DskHKzfo.js} +9 -9
- package/dist/{Game-DN8qNmAV.js → Game-IJ6X0AXM.js} +9 -9
- package/dist/{Index-Cp5Iqmgq.js → Index-CEl2y9X6.js} +93 -90
- package/dist/{Marketing-BTZSeQdq.js → Marketing-CWekLb4c.js} +6 -6
- package/dist/{Member-DKGZpaNY.js → Member-BUZPQ5Lb.js} +4 -4
- package/dist/{MemberList-BDv5O7_F.js → MemberList-BmVNqvbm.js} +24 -24
- package/dist/{MemberTransactions-Cp_g2uYy.js → MemberTransactions-B3XhEOK_.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-TBeUosVs.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +2 -2
- package/dist/{Mission-Cte8Jtyj.js → Mission-Ci9ed_ph.js} +9 -9
- package/dist/{Overview-COeyTvML.js → Overview-CU9uhC-k.js} +399 -395
- package/dist/{Point-Cu5_d5X1.js → Point-wuuR7AEb.js} +9 -9
- package/dist/{Promotion-Cf8ct95o.js → Promotion-BMi3kyE8.js} +10 -10
- package/dist/Record-Wmh-g8WY.js +340 -0
- package/dist/{Reward-Bcx7bCEh.js → Reward-BL4lxhIB.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CwApma5p.js → RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cg3bA1cc.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js} +12 -12
- package/dist/{Segment-BfMpM62H.js → Segment-DObdjyYi.js} +14 -14
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CqZIHzA3.js → SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js} +2 -2
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
- package/dist/{Setting-Btim3PZq.js → Setting-Dqgnd7TR.js} +10 -10
- package/dist/{Store-BbiTlkAz.js → Store--Z4So__g.js} +18 -18
- package/dist/{StoreRewards-hbNthA-_.js → StoreRewards-DPFVXWwm.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Dv58wFeO.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BJvBo7sT.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
- package/dist/{Tier-Ddj_dwc8.js → Tier-36IfhsnP.js} +19 -19
- package/dist/{Title-CA6b8UxN.js → Title-XH56OOug.js} +19 -19
- package/dist/{Transaction-yp6PDE_8.js → Transaction-BUQcSmBs.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoCmo4D7.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js} +6 -6
- package/dist/Voucher-CvmH0kcF.js +353 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-aYXqbp2E.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js} +15 -15
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bz77dtVR.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
- package/dist/{app-BpikVDEt.js → app-DeW5_DB0.js} +712 -547
- package/dist/{app-DG6xKzyo.js → app-TN8KEPMu.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-DPl8ug6e.js → business-D1mLhSME.js} +1 -1
- package/dist/{campaign-D9xub_rP.js → campaign-0tnkhu78.js} +11 -11
- package/dist/{campaign-CLF6bWG4.js → campaign-B-12Im0w.js} +2 -2
- package/dist/{campaign.enum-DJijW358.js → campaign.enum-C8m-HHZE.js} +1 -1
- package/dist/{campaign.fn-DgyMbDS2.js → campaign.fn-CxkhbK9i.js} +110 -110
- package/dist/{collectible.enum-q3RNa6ac.js → collectible.enum-6Syq-vQ6.js} +3 -3
- package/dist/{collection.fn-DQdOmMPm.js → collection.fn-BUj75Jp2.js} +2 -2
- package/dist/{dto-Gtphhk7f.js → dto-8wODhIIC.js} +7 -7
- package/dist/{effect-b6TK6WqX.js → effect-BEZEjcJu.js} +1 -1
- package/dist/{email-addresses-BOOXVJIb.js → email-addresses-PwjkdYYD.js} +1 -1
- package/dist/{export-DB-hJPwq.js → export-BB-0vgwy.js} +3 -3
- package/dist/{helper-DaoMEMRy.js → helper-DOt8-wns.js} +1 -1
- package/dist/{index-Dd_g3RuO.js → index-B1qUjniH.js} +1 -1
- package/dist/{index-tXvAp_RD.js → index-BTMIZz4v.js} +1 -1
- package/dist/{index-zaGTl_qB.js → index-By-GlmG7.js} +2 -2
- package/dist/index-C7zBkoZ4.js +115 -0
- package/dist/{index-CC24qW42.js → index-CNlHabtk.js} +1 -1
- package/dist/{index-BsYcA4d4.js → index-CXGiIgdK.js} +1 -1
- package/dist/{index-DplAli0B.js → index-Cjn1LVjC.js} +38 -35
- package/dist/{index-CGCV3Q39.js → index-CpfUrdgw.js} +3 -3
- package/dist/{index-rU6SAS58.js → index-DZuEmMyY.js} +3 -3
- package/dist/{index-lAMRbOeY.js → index-D_zwqIhq.js} +1 -1
- package/dist/{index-V4sEiiYS.js → index-DabUEw_c.js} +1 -1
- package/dist/{index-BeE1k0xs.js → index-X-FfC49l.js} +6 -6
- package/dist/{index.esm2017-BpKyZnrS.js → index.esm2017-DJOUiVjR.js} +1 -1
- package/dist/{loading-aAPveWkt.js → loading-aCWVsOPY.js} +1 -1
- package/dist/{membership-CdHkfBpk.js → membership-1etsHC5G.js} +6 -6
- package/dist/{money-yvgF4-JZ.js → money-DzWRURZ5.js} +1 -1
- package/dist/{number-5CZfadpH.js → number-BxIQO1i3.js} +1 -1
- package/dist/{objectid-Cz3ihSHZ.js → objectid-DjhmYkn-.js} +7 -7
- package/dist/{plugins-CFwYNZo0.js → plugins-CSPFAU50.js} +4 -4
- package/dist/{reward-DfX_2rEr.js → reward-Bh4Li9f0.js} +1 -1
- package/dist/{rule-D_HCGBXt.js → rule-CHTTTUFB.js} +3 -3
- package/dist/{rule-builder-DaJ2wADR.js → rule-builder-OHfUJTIA.js} +1 -1
- package/dist/{template-BFcHBZjo.js → template-ZGxXqkaC.js} +4 -4
- package/dist/{trigger-BnfqcoU-.js → trigger-Ogu5FDs0.js} +13 -13
- package/dist/{user-bXWIOEFL.js → user-DBuU81tO.js} +1 -1
- package/dist/{vue-i18n-kVKjcgAi.js → vue-i18n-CKpKQ6iE.js} +299 -299
- package/dist/{xlsx-C0oaHSzL.js → xlsx-DJDZBIeg.js} +1 -1
- package/package.json +1 -1
- package/dist/Record-BTsMyNzQ.js +0 -339
- package/dist/Voucher-CGB4koQI.js +0 -491
- package/dist/index-CSmO-8Va.js +0 -99
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as q, resolveComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { u as Z } from "./vue-i18n-
|
|
4
|
-
import { u as ue } from "./loading-
|
|
5
|
-
import { c 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 ve, ref as F, computed as G, watch as ie, createBlock as j, isRef as J, resolveDynamicComponent as ne, renderList as re, normalizeClass as de, createTextVNode as ce, createCommentVNode as z, h as te, onMounted as _e } from "vue";
|
|
2
|
+
import { _ as ge } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { u as Z } from "./vue-i18n-CKpKQ6iE.js";
|
|
4
|
+
import { u as ue } from "./loading-aCWVsOPY.js";
|
|
5
|
+
import { c as we, p as K } from "./plugins-CSPFAU50.js";
|
|
6
6
|
import { J as X } from "./JsonViewer-v8_C7l5N.js";
|
|
7
7
|
import { Z as N } from "./zod-Bg2FbC-D.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as me } from "./reward-
|
|
11
|
-
import { a as be, b as xe } from "./index-
|
|
12
|
-
import {
|
|
13
|
-
import "./index-
|
|
14
|
-
import "./index-
|
|
15
|
-
import "./index-
|
|
16
|
-
import { C as fe } from "./membership-
|
|
17
|
-
import { t as ee } from "./helper-
|
|
8
|
+
import { u as W } from "./app-wDQR6dpb.js";
|
|
9
|
+
import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js";
|
|
10
|
+
import { u as me } from "./reward-Bh4Li9f0.js";
|
|
11
|
+
import { a as be, b as xe } from "./index-X-FfC49l.js";
|
|
12
|
+
import { i as le, j as se } from "./index-Cjn1LVjC.js";
|
|
13
|
+
import "./index-By-GlmG7.js";
|
|
14
|
+
import "./index-B1qUjniH.js";
|
|
15
|
+
import "./index-DZuEmMyY.js";
|
|
16
|
+
import { C as fe } from "./membership-1etsHC5G.js";
|
|
17
|
+
import { t as ee } from "./helper-DOt8-wns.js";
|
|
18
18
|
import { c as H } from "./object-qECH92oz.js";
|
|
19
|
-
import { useDialog as
|
|
20
|
-
import { _ as
|
|
21
|
-
import {
|
|
22
|
-
import { O as $e } from "./objectid-
|
|
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-CcIcCt4N.js";
|
|
21
|
+
import { T as Se, _ as Fe, a as ke } from "./trigger-Ogu5FDs0.js";
|
|
22
|
+
import { O as $e } from "./objectid-DjhmYkn-.js";
|
|
23
|
+
import { r as pe } from "./index-DabUEw_c.js";
|
|
24
|
+
import { u as Pe } from "./business-D1mLhSME.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(k, { emit:
|
|
39
|
-
const { t: I } = Z(), p =
|
|
40
|
-
return (
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
onClick: f[4] || (f[4] = (
|
|
38
|
+
setup(k, { emit: l }) {
|
|
39
|
+
const { t: I } = Z(), p = l;
|
|
40
|
+
return (g, f) => {
|
|
41
|
+
const s = w("FmButton"), u = w("FmListItem");
|
|
42
|
+
return C(), B(Y, null, [
|
|
43
|
+
c(u, {
|
|
44
|
+
onClick: f[4] || (f[4] = (m) => p("edit", k.level)),
|
|
45
45
|
class: "!p-0"
|
|
46
46
|
}, {
|
|
47
47
|
default: V(() => [
|
|
@@ -54,18 +54,18 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
54
54
|
])
|
|
55
55
|
]),
|
|
56
56
|
a("div", Le, [
|
|
57
|
-
|
|
57
|
+
c(s, {
|
|
58
58
|
variant: "secondary",
|
|
59
|
-
label:
|
|
59
|
+
label: r(I)("connect.referral.reward.add_count"),
|
|
60
60
|
icon: "add",
|
|
61
|
-
onClick: f[0] || (f[0] = (
|
|
62
|
-
|
|
61
|
+
onClick: f[0] || (f[0] = (m) => {
|
|
62
|
+
m.stopPropagation(), p("addCount", k.level);
|
|
63
63
|
})
|
|
64
64
|
}, null, 8, ["label"]),
|
|
65
|
-
|
|
65
|
+
c(s, {
|
|
66
66
|
icon: "delete",
|
|
67
|
-
onClick: f[1] || (f[1] = (
|
|
68
|
-
|
|
67
|
+
onClick: f[1] || (f[1] = (m) => {
|
|
68
|
+
m.stopPropagation(), p("remove", k.level);
|
|
69
69
|
}),
|
|
70
70
|
variant: "tertiary"
|
|
71
71
|
})
|
|
@@ -74,72 +74,72 @@ 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(s, {
|
|
84
84
|
variant: "tertiary",
|
|
85
85
|
icon: "delete",
|
|
86
|
-
onClick: f[2] || (f[2] = (
|
|
86
|
+
onClick: f[2] || (f[2] = (m) => (m.stopPropagation(), p("remove", k.level)))
|
|
87
87
|
})
|
|
88
88
|
]),
|
|
89
|
-
|
|
89
|
+
c(s, {
|
|
90
90
|
class: "w-full",
|
|
91
91
|
variant: "secondary",
|
|
92
92
|
label: "Add count",
|
|
93
93
|
disabled: !0,
|
|
94
94
|
icon: "add",
|
|
95
|
-
onClick: f[3] || (f[3] = (
|
|
95
|
+
onClick: f[3] || (f[3] = (m) => (m.stopPropagation(), p("addCount", k.level)))
|
|
96
96
|
})
|
|
97
97
|
])
|
|
98
98
|
]),
|
|
99
99
|
_: 1
|
|
100
100
|
}),
|
|
101
|
-
ve(
|
|
101
|
+
ve(g.$slots, "default")
|
|
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 = { class: "fm-typo-en-title-sm-800" },
|
|
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(k, { expose:
|
|
109
|
-
const { t: p } = Z(),
|
|
108
|
+
setup(k, { expose: l, emit: I }) {
|
|
109
|
+
const { t: p } = Z(), g = I, f = F(!1), s = F({}), u = F(-1), m = F(-1), R = Q(), A = be.superRefine((e, t) => {
|
|
110
110
|
var $, U, P, x, v, E, ae;
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const d = m.value == -1 ? ((P = (U = ($ = R.referralProgram) == null ? void 0 : $.reward[u.value]) == null ? void 0 : U.rewards) == null ? void 0 : P.length) || 0 : m.value, _ = (v = (x = R.referralProgram) == null ? void 0 : x.reward[u.value]) == null ? void 0 : v.rewards[d - 1], b = (ae = (E = R.referralProgram) == null ? void 0 : E.reward[u.value]) == null ? void 0 : ae.rewards[d + 1];
|
|
112
|
+
_ && e.threshold.from < _.threshold.from + 1 && t.addIssue({
|
|
113
113
|
code: "custom",
|
|
114
|
-
message: `The min referral must be at least ${
|
|
114
|
+
message: `The min referral must be at least ${_.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(s.value);
|
|
123
123
|
return e.success ? [] : e.error.errors;
|
|
124
124
|
});
|
|
125
125
|
function M() {
|
|
126
|
-
const e = A.safeParse(
|
|
127
|
-
e.success &&
|
|
128
|
-
groupIndex:
|
|
129
|
-
countIndex:
|
|
126
|
+
const e = A.safeParse(s.value);
|
|
127
|
+
e.success && g("update", {
|
|
128
|
+
groupIndex: u.value,
|
|
129
|
+
countIndex: m.value,
|
|
130
130
|
referralCount: e.data
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
134
|
-
var
|
|
135
|
-
if (f.value = e, e && typeof (
|
|
136
|
-
|
|
137
|
-
(
|
|
133
|
+
async function D(e, t) {
|
|
134
|
+
var d, _, b, $, U, P;
|
|
135
|
+
if (f.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0)
|
|
136
|
+
u.value = t.groupIndex, m.value = t.countIndex, s.value = H(
|
|
137
|
+
(d = R.referralProgram) == null ? void 0 : d.reward[t.groupIndex].rewards[t.countIndex]
|
|
138
138
|
);
|
|
139
139
|
else {
|
|
140
|
-
|
|
141
|
-
const x =
|
|
142
|
-
|
|
140
|
+
u.value = t.groupIndex, m.value = -1;
|
|
141
|
+
const x = m.value == -1 ? (($ = (b = (_ = R.referralProgram) == null ? void 0 : _.reward[u.value]) == null ? void 0 : b.rewards) == null ? void 0 : $.length) || 0 : m.value, v = (P = (U = R.referralProgram) == null ? void 0 : U.reward[u.value]) == null ? void 0 : P.rewards[x - 1];
|
|
142
|
+
s.value = {
|
|
143
143
|
threshold: {
|
|
144
144
|
from: v != null && v.threshold ? v != null && v.threshold.to ? v.threshold.to + 1 : (v == null ? void 0 : v.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 = i.value.map(
|
|
151
|
+
(x) => s.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
|
-
], n = me(), o = F([]),
|
|
180
|
-
let
|
|
179
|
+
], n = me(), o = F([]), i = G(() => n.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
|
-
|
|
203
|
-
(b) => b !=
|
|
199
|
+
const e = i.value;
|
|
200
|
+
for (let t = 0; t < e.length; t++) {
|
|
201
|
+
const d = e[t], _ = h.value[t];
|
|
202
|
+
_ && !s.value.rewards.includes(d.id) && s.value.rewards.push(d.id), !_ && s.value.rewards.includes(d.id) && (s.value.rewards = s.value.rewards.filter(
|
|
203
|
+
(b) => b != d.id
|
|
204
204
|
));
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
const h = F({});
|
|
208
|
-
return ie(h, S, { deep: !0 }),
|
|
209
|
-
showSheet:
|
|
208
|
+
return ie(h, S, { deep: !0 }), l({
|
|
209
|
+
showSheet: D,
|
|
210
210
|
hideSheet: L,
|
|
211
|
-
data:
|
|
212
|
-
}), (e,
|
|
213
|
-
const
|
|
214
|
-
return
|
|
211
|
+
data: s
|
|
212
|
+
}), (e, t) => {
|
|
213
|
+
const d = w("FmStepperField"), _ = w("FmHelperText"), b = w("FmTable"), $ = 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(f),
|
|
217
|
+
"onUpdate:modelValue": t[4] || (t[4] = (P) => J(f) ? f.value = P : null),
|
|
218
|
+
header: `${r(m) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
|
|
219
219
|
}, {
|
|
220
220
|
"side-sheet-footer": V(() => [
|
|
221
|
-
a("div",
|
|
222
|
-
|
|
223
|
-
label:
|
|
221
|
+
a("div", Ye, [
|
|
222
|
+
c($, {
|
|
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($, {
|
|
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(s) }, 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
|
-
d
|
|
242
|
-
modelValue:
|
|
243
|
-
"onUpdate:modelValue":
|
|
241
|
+
c(d, {
|
|
242
|
+
modelValue: r(s).threshold.from,
|
|
243
|
+
"onUpdate:modelValue": t[0] || (t[0] = (P) => r(s).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
|
-
d
|
|
260
|
-
modelValue:
|
|
261
|
-
"onUpdate:modelValue":
|
|
259
|
+
c(d, {
|
|
260
|
+
modelValue: r(s).threshold.to,
|
|
261
|
+
"onUpdate:modelValue": t[1] || (t[1] = (P) => r(s).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(_, {
|
|
279
|
+
text: r(N).helperText(r(T), "threshold"),
|
|
280
|
+
state: r(N).helperState(r(T), "threshold")
|
|
281
281
|
}, null, 8, ["text", "state"]),
|
|
282
|
-
|
|
282
|
+
a("div", He, O(r(p)(
|
|
283
|
+
"connect.referral.editReferralCountSheet.max_referral_count_description"
|
|
284
|
+
)), 1)
|
|
283
285
|
]),
|
|
284
|
-
a("div",
|
|
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(i),
|
|
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
|
-
}),
|
|
302
|
+
}), Ke = { class: "space-y-16" }, Je = { class: "grid grid-cols-3 gap-16" }, We = { class: "fm-typo-en-title-sm-800" }, Ze = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qe = /* @__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(k, { emit:
|
|
313
|
-
const I = k, p =
|
|
314
|
+
setup(k, { emit: l }) {
|
|
315
|
+
const I = k, p = l, g = G(() => [
|
|
314
316
|
le.enum.BILL_COMPLETED,
|
|
315
317
|
le.enum.FEEDBACK
|
|
316
318
|
].map((f) => Se[f]));
|
|
317
|
-
return (f,
|
|
318
|
-
const
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
a("div",
|
|
322
|
-
(
|
|
323
|
-
key:
|
|
319
|
+
return (f, s) => {
|
|
320
|
+
const u = w("FmCard");
|
|
321
|
+
return C(), B("div", Ke, [
|
|
322
|
+
s[0] || (s[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)),
|
|
323
|
+
a("div", Je, [
|
|
324
|
+
(C(!0), B(Y, null, re(r(g), (m) => (C(), j(u, {
|
|
325
|
+
key: m.name,
|
|
324
326
|
variant: "outlined",
|
|
325
327
|
disabled: I.disabled,
|
|
326
328
|
class: de(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
327
|
-
"col-span-3":
|
|
328
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": k.modelValue ==
|
|
329
|
-
"hover:bg-fm-color-opacity-sm": k.modelValue !=
|
|
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 == m.value,
|
|
331
|
+
"hover:bg-fm-color-opacity-sm": k.modelValue != m.value
|
|
330
332
|
}]),
|
|
331
333
|
onClick: () => {
|
|
332
|
-
I.modelValue !=
|
|
334
|
+
I.modelValue != m.value && !I.disabled && p("update:model-value", m.value);
|
|
333
335
|
}
|
|
334
336
|
}, {
|
|
335
337
|
default: V(() => [
|
|
336
|
-
a("div", We, O(
|
|
337
|
-
a("div",
|
|
338
|
+
a("div", We, O(m.name), 1),
|
|
339
|
+
a("div", Ze, O(m.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
|
+
}), Xe = { class: "flex items-center gap-x-8" }, er = { class: "flex flex-col space-y-16 pr-12" }, rr = {
|
|
346
348
|
key: 0,
|
|
347
349
|
class: "space-y-16"
|
|
348
|
-
},
|
|
350
|
+
}, tr = {
|
|
349
351
|
key: 1,
|
|
350
352
|
class: "space-y-16"
|
|
351
|
-
},
|
|
353
|
+
}, or = { class: "flex items-center gap-8" }, ar = /* @__PURE__ */ q({
|
|
352
354
|
__name: "EditCriteriaSheet",
|
|
353
355
|
emits: ["update"],
|
|
354
|
-
setup(k, { expose:
|
|
355
|
-
const { t: p } = Z(),
|
|
356
|
+
setup(k, { expose: l, emit: I }) {
|
|
357
|
+
const { t: p } = Z(), g = I, f = F(!1), s = F(-1), u = F({}), m = Q(), R = xe.superRefine((y, n) => {
|
|
356
358
|
y.name.length >= 50 && n.addIssue({
|
|
357
359
|
code: "custom",
|
|
358
360
|
message: "Name must be less than 50 characters"
|
|
@@ -361,14 +363,14 @@ 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(u.value);
|
|
365
367
|
return y.success ? [] : y.error.errors;
|
|
366
368
|
});
|
|
367
369
|
function T(y, n) {
|
|
368
370
|
var o;
|
|
369
|
-
f.value = y, y && typeof n == "number" && n >= 0 ? (
|
|
370
|
-
(o =
|
|
371
|
-
)) : (
|
|
371
|
+
f.value = y, y && typeof n == "number" && n >= 0 ? (s.value = n, u.value = H(
|
|
372
|
+
(o = m.referralProgram) == null ? void 0 : o.criteria[n]
|
|
373
|
+
)) : (s.value = -1, u.value = {
|
|
372
374
|
_id: new $e().toString(),
|
|
373
375
|
name: "",
|
|
374
376
|
type: "AUTO",
|
|
@@ -378,27 +380,27 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
378
380
|
function M() {
|
|
379
381
|
f.value = !1;
|
|
380
382
|
}
|
|
381
|
-
function
|
|
382
|
-
const y =
|
|
383
|
-
y.success &&
|
|
383
|
+
function D() {
|
|
384
|
+
const y = R.safeParse(u.value);
|
|
385
|
+
y.success && g("update", s.value, y.data);
|
|
384
386
|
}
|
|
385
387
|
function L(y) {
|
|
386
|
-
|
|
388
|
+
u.value.type = y, y == "AUTO" ? u.value.event = { type: "BILL_COMPLETED" } : u.value.event = void 0;
|
|
387
389
|
}
|
|
388
|
-
return
|
|
390
|
+
return l({
|
|
389
391
|
showSheet: T,
|
|
390
392
|
hideSheet: M,
|
|
391
|
-
data:
|
|
393
|
+
data: u
|
|
392
394
|
}), (y, n) => {
|
|
393
|
-
const o =
|
|
394
|
-
return
|
|
395
|
+
const o = w("FmButton"), i = w("FmRadio"), S = w("FmRadioGroup"), h = w("FmSideSheet");
|
|
396
|
+
return C(), j(h, {
|
|
395
397
|
"max-width": 768,
|
|
396
|
-
modelValue:
|
|
397
|
-
"onUpdate:modelValue": n[6] || (n[6] = (e) =>
|
|
398
|
+
modelValue: r(f),
|
|
399
|
+
"onUpdate:modelValue": n[6] || (n[6] = (e) => J(f) ? f.value = e : null)
|
|
398
400
|
}, {
|
|
399
401
|
"side-sheet-header": V(() => [
|
|
400
|
-
a("div",
|
|
401
|
-
|
|
402
|
+
a("div", Xe, [
|
|
403
|
+
c(o, {
|
|
402
404
|
icon: "arrow_back",
|
|
403
405
|
variant: "tertiary",
|
|
404
406
|
onClick: n[0] || (n[0] = (e) => T(!1))
|
|
@@ -407,43 +409,43 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
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", or, [
|
|
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: n[5] || (n[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
|
+
c(X, { json: r(u) }, null, 8, ["json"]),
|
|
428
|
+
a("div", er, [
|
|
427
429
|
n[12] || (n[12] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
|
|
428
|
-
|
|
429
|
-
modelValue:
|
|
430
|
-
"onUpdate:modelValue": n[1] || (n[1] = (e) =>
|
|
431
|
-
label:
|
|
432
|
-
schema:
|
|
430
|
+
c(Re, {
|
|
431
|
+
modelValue: r(u).name,
|
|
432
|
+
"onUpdate:modelValue": n[1] || (n[1] = (e) => r(u).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
436
|
n[13] || (n[13] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
|
|
435
|
-
|
|
436
|
-
"model-value":
|
|
437
|
+
c(S, {
|
|
438
|
+
"model-value": r(u).type,
|
|
437
439
|
label: "Verify status",
|
|
438
440
|
"onUpdate:modelValue": L
|
|
439
441
|
}, {
|
|
440
442
|
default: V(() => [
|
|
441
|
-
|
|
443
|
+
c(i, {
|
|
442
444
|
value: "AUTO",
|
|
443
445
|
label: "Auto",
|
|
444
446
|
sublabel: "Verify based on rule configuration"
|
|
445
447
|
}),
|
|
446
|
-
|
|
448
|
+
c(i, {
|
|
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
|
-
|
|
456
|
+
r(u).type == "AUTO" ? (C(), B(Y, { key: 0 }, [
|
|
455
457
|
n[10] || (n[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
|
|
456
458
|
n[11] || (n[11] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
|
|
457
|
-
|
|
458
|
-
"model-value":
|
|
459
|
-
"onUpdate:modelValue": n[2] || (n[2] = (e) =>
|
|
459
|
+
c(Qe, {
|
|
460
|
+
"model-value": r(u).event.type,
|
|
461
|
+
"onUpdate:modelValue": n[2] || (n[2] = (e) => r(u).event.type = e)
|
|
460
462
|
}, null, 8, ["model-value"]),
|
|
461
|
-
|
|
463
|
+
r(u).event.type == r(se).enum.BILL_COMPLETED ? (C(), B("div", rr, [
|
|
462
464
|
n[8] || (n[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
|
|
463
|
-
|
|
464
|
-
"model-value":
|
|
465
|
-
"onUpdate:modelValue": n[3] || (n[3] = (e) =>
|
|
465
|
+
c(Fe, {
|
|
466
|
+
"model-value": r(u).event.rule,
|
|
467
|
+
"onUpdate:modelValue": n[3] || (n[3] = (e) => r(u).event.rule = e)
|
|
466
468
|
}, null, 8, ["model-value"])
|
|
467
469
|
])) : z("", !0),
|
|
468
|
-
|
|
470
|
+
r(u).event.type == r(se).enum.FEEDBACK ? (C(), B("div", tr, [
|
|
469
471
|
n[9] || (n[9] = a("div", { class: "fm-typo-en-title-sm-600" }, "Feedback Criteria", -1)),
|
|
470
|
-
|
|
471
|
-
"model-value":
|
|
472
|
-
"onUpdate:modelValue": n[4] || (n[4] = (e) =>
|
|
472
|
+
c(ke, {
|
|
473
|
+
"model-value": r(u).event.rule,
|
|
474
|
+
"onUpdate:modelValue": n[4] || (n[4] = (e) => r(u).event.rule = e)
|
|
473
475
|
}, null, 8, ["model-value"])
|
|
474
476
|
])) : z("", !0)
|
|
475
477
|
], 64)) : z("", !0)
|
|
@@ -481,11 +483,11 @@ const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie =
|
|
|
481
483
|
}
|
|
482
484
|
});
|
|
483
485
|
function he() {
|
|
484
|
-
const k = F(!1),
|
|
486
|
+
const k = F(!1), l = Ce();
|
|
485
487
|
return {
|
|
486
488
|
confirmUpdateReferralRecord: async () => {
|
|
487
489
|
await new Promise((p) => {
|
|
488
|
-
|
|
490
|
+
l.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 },
|
|
@@ -500,29 +502,29 @@ function he() {
|
|
|
500
502
|
updateReferralRecord: k
|
|
501
503
|
};
|
|
502
504
|
}
|
|
503
|
-
const
|
|
505
|
+
const nr = { class: "flex flex-col space-y-16 mt-24" }, lr = { class: "flex justify-between items-center" }, sr = /* @__PURE__ */ q({
|
|
504
506
|
__name: "ManageCriteriaSheet",
|
|
505
|
-
setup(k, { expose:
|
|
506
|
-
const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord:
|
|
507
|
+
setup(k, { expose: l }) {
|
|
508
|
+
const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord: g, updateReferralRecord: f } = he(), s = F(!1), u = F({}), m = Q(), R = F(
|
|
507
509
|
null
|
|
508
510
|
), A = G(() => {
|
|
509
511
|
var o;
|
|
510
|
-
return (o =
|
|
512
|
+
return (o = m.referralProgram) == null ? void 0 : o.criteria;
|
|
511
513
|
});
|
|
512
514
|
async function T(o) {
|
|
513
|
-
await
|
|
515
|
+
await g(), await p(async () => {
|
|
514
516
|
await pe.update({
|
|
515
517
|
...o,
|
|
516
518
|
updateReferralRecord: f.value
|
|
517
|
-
}), await
|
|
519
|
+
}), await m.readReferralProgram();
|
|
518
520
|
});
|
|
519
521
|
}
|
|
520
|
-
async function M(o,
|
|
521
|
-
var e,
|
|
522
|
-
const S = o == -1 ? ((e =
|
|
523
|
-
h.criteria[S] =
|
|
522
|
+
async function M(o, i) {
|
|
523
|
+
var e, t;
|
|
524
|
+
const S = o == -1 ? ((e = m.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = H(m.referralProgram);
|
|
525
|
+
h.criteria[S] = i, await T(h), (t = R.value) == null || t.showSheet(!1);
|
|
524
526
|
}
|
|
525
|
-
async function
|
|
527
|
+
async function D(o) {
|
|
526
528
|
var h, e;
|
|
527
529
|
if (!await K.remove(
|
|
528
530
|
"Are you sure to remove criteria",
|
|
@@ -531,8 +533,8 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
531
533
|
I("connect.prompt.cancel")
|
|
532
534
|
))
|
|
533
535
|
return;
|
|
534
|
-
const
|
|
535
|
-
S.criteria.splice(
|
|
536
|
+
const i = o == -1 ? ((h = m.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, S = H(m.referralProgram);
|
|
537
|
+
S.criteria.splice(i, 1), await T(S), (e = R.value) == null || e.showSheet(!1);
|
|
536
538
|
}
|
|
537
539
|
const L = [
|
|
538
540
|
{
|
|
@@ -543,7 +545,7 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
543
545
|
header: "Validity method",
|
|
544
546
|
cell(o) {
|
|
545
547
|
return te(oe.FmChip, {
|
|
546
|
-
label:
|
|
548
|
+
label: we.title(o.row.original.type),
|
|
547
549
|
variant: "plain"
|
|
548
550
|
});
|
|
549
551
|
}
|
|
@@ -556,8 +558,8 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
556
558
|
variant: "tertiary",
|
|
557
559
|
icon: "delete",
|
|
558
560
|
iconColor: "neutral-gray-400",
|
|
559
|
-
onClick: (
|
|
560
|
-
|
|
561
|
+
onClick: (i) => {
|
|
562
|
+
i.stopPropagation(), D(o.row.index);
|
|
561
563
|
}
|
|
562
564
|
})
|
|
563
565
|
];
|
|
@@ -565,75 +567,75 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
565
567
|
}
|
|
566
568
|
];
|
|
567
569
|
function y(o) {
|
|
568
|
-
|
|
570
|
+
s.value = o;
|
|
569
571
|
}
|
|
570
572
|
function n() {
|
|
571
|
-
|
|
573
|
+
s.value = !1;
|
|
572
574
|
}
|
|
573
|
-
return
|
|
575
|
+
return l({
|
|
574
576
|
showSheet: y,
|
|
575
577
|
hideSheet: n,
|
|
576
|
-
data:
|
|
577
|
-
}), (o,
|
|
578
|
-
const S =
|
|
579
|
-
return
|
|
580
|
-
|
|
578
|
+
data: u
|
|
579
|
+
}), (o, i) => {
|
|
580
|
+
const S = w("FmButton"), h = w("FmTable"), e = w("FmSideSheet");
|
|
581
|
+
return C(), B(Y, null, [
|
|
582
|
+
c(e, {
|
|
581
583
|
"max-width": 768,
|
|
582
|
-
modelValue:
|
|
583
|
-
"onUpdate:modelValue":
|
|
584
|
+
modelValue: r(s),
|
|
585
|
+
"onUpdate:modelValue": i[2] || (i[2] = (t) => J(s) ? s.value = t : null),
|
|
584
586
|
header: "Manage Criteria"
|
|
585
587
|
}, {
|
|
586
588
|
default: V(() => [
|
|
587
|
-
a("div",
|
|
588
|
-
a("div",
|
|
589
|
-
|
|
589
|
+
a("div", nr, [
|
|
590
|
+
a("div", lr, [
|
|
591
|
+
i[3] || (i[3] = a("div", null, [
|
|
590
592
|
a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
|
|
591
593
|
a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
|
|
592
594
|
], -1)),
|
|
593
|
-
|
|
595
|
+
c(S, {
|
|
594
596
|
label: "Add Criteria",
|
|
595
597
|
icon: "add",
|
|
596
598
|
variant: "secondary",
|
|
597
|
-
onClick:
|
|
598
|
-
var
|
|
599
|
-
return (
|
|
599
|
+
onClick: i[0] || (i[0] = (t) => {
|
|
600
|
+
var d;
|
|
601
|
+
return (d = r(R)) == null ? void 0 : d.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: i[1] || (i[1] = (t) => {
|
|
612
|
+
var d;
|
|
613
|
+
return (d = r(R)) == null ? void 0 : d.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(ar, {
|
|
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
|
+
}), ir = { class: "flex flex-col space-y-16 pr-12" }, dr = { class: "fm-typo-en-title-sm-800" }, cr = { class: "flex items-center gap-8" }, ur = /* @__PURE__ */ q({
|
|
627
629
|
__name: "EditRefereeRewardSheet",
|
|
628
630
|
emits: ["update"],
|
|
629
|
-
setup(k, { expose:
|
|
630
|
-
const { t: p } = Z(),
|
|
631
|
-
function
|
|
632
|
-
|
|
631
|
+
setup(k, { expose: l, emit: I }) {
|
|
632
|
+
const { t: p } = Z(), g = I, f = F(!1), s = F([]), u = Q();
|
|
633
|
+
function m() {
|
|
634
|
+
g("update", s.value);
|
|
633
635
|
}
|
|
634
|
-
async function
|
|
635
|
-
var
|
|
636
|
-
f.value = o,
|
|
636
|
+
async function R(o) {
|
|
637
|
+
var i, S;
|
|
638
|
+
f.value = o, s.value = ((S = (i = u.referralProgram) == null ? void 0 : i.refereeReward) == null ? void 0 : S.map((h) => h.toString())) || [], n.value = L.value.map((h) => s.value.includes(h.id));
|
|
637
639
|
}
|
|
638
640
|
function A() {
|
|
639
641
|
f.value = !1;
|
|
@@ -655,19 +657,19 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { 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 i = o.row.original;
|
|
661
|
+
if (i.collectible.type == "VOUCHER" || i.selectedReward == null)
|
|
662
|
+
return i.description;
|
|
661
663
|
}
|
|
662
664
|
}
|
|
663
|
-
], M = me(),
|
|
664
|
-
let
|
|
665
|
+
], M = me(), D = F([]), L = G(() => M.rewards.map((o) => {
|
|
666
|
+
let i = "No expiry";
|
|
665
667
|
switch (o.option.type) {
|
|
666
668
|
case "VOUCHER":
|
|
667
|
-
|
|
669
|
+
i = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
|
|
668
670
|
break;
|
|
669
671
|
case "LOYALTY":
|
|
670
|
-
|
|
672
|
+
i = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
|
|
671
673
|
break;
|
|
672
674
|
}
|
|
673
675
|
return {
|
|
@@ -675,56 +677,56 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
675
677
|
name: o.name,
|
|
676
678
|
collectible: o.option,
|
|
677
679
|
collectibleConfig: o.collectibleConfig,
|
|
678
|
-
description:
|
|
680
|
+
description: i
|
|
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 i = 0; i < o.length; i++) {
|
|
687
|
+
const S = o[i], h = n.value[i];
|
|
688
|
+
h && !s.value.includes(S.id) && s.value.push(S.id), !h && s.value.includes(S.id) && (s.value = s.value.filter((e) => e != S.id));
|
|
687
689
|
}
|
|
688
690
|
}
|
|
689
691
|
const n = F({});
|
|
690
|
-
return ie(n, y, { deep: !0 }),
|
|
691
|
-
showSheet:
|
|
692
|
+
return ie(n, y, { deep: !0 }), l({
|
|
693
|
+
showSheet: R,
|
|
692
694
|
hideSheet: A,
|
|
693
|
-
data:
|
|
694
|
-
}), (o,
|
|
695
|
-
const S =
|
|
696
|
-
return
|
|
695
|
+
data: s
|
|
696
|
+
}), (o, i) => {
|
|
697
|
+
const S = w("FmTable"), h = w("FmButton"), e = w("FmSideSheet");
|
|
698
|
+
return C(), j(e, {
|
|
697
699
|
"max-width": 1e3,
|
|
698
|
-
modelValue:
|
|
699
|
-
"onUpdate:modelValue":
|
|
700
|
+
modelValue: r(f),
|
|
701
|
+
"onUpdate:modelValue": i[2] || (i[2] = (t) => J(f) ? f.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", cr, [
|
|
706
|
+
c(h, {
|
|
707
|
+
label: r(p)("connect.common.save"),
|
|
708
|
+
onClick: m,
|
|
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: i[1] || (i[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(s) }, null, 8, ["json"]),
|
|
721
|
+
a("div", ir, [
|
|
722
|
+
a("div", dr, O(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
|
|
723
|
+
c(S, {
|
|
724
|
+
modelValue: r(n),
|
|
725
|
+
"onUpdate:modelValue": i[0] || (i[0] = (t) => J(n) ? n.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,40 +735,42 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
733
735
|
}, 8, ["modelValue"]);
|
|
734
736
|
};
|
|
735
737
|
}
|
|
736
|
-
}),
|
|
738
|
+
}), mr = { class: "fm-typo-en-title-sm-600" }, fr = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, pr = { class: "flex gap-x-8" }, hr = { class: "fm-typo-body-lg-600 flex items-center gap-x-4" }, vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _r = { class: "mb-40" }, gr = {
|
|
737
739
|
key: 0,
|
|
738
740
|
class: "flex flex-col items-center justify-center gap-y-16 p-24"
|
|
739
|
-
}, wr = { class: "flex flex-col gap-16 text-center" },
|
|
741
|
+
}, wr = { class: "flex flex-col gap-16 text-center" }, yr = { class: "fm-typo-en-title-sm-800" }, br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = /* @__PURE__ */ q({
|
|
740
742
|
__name: "Overview",
|
|
741
743
|
setup(k) {
|
|
742
|
-
const { t:
|
|
744
|
+
const { t: l } = Z(), { minor: I } = ue, p = Pe(), g = Q(), { confirmUpdateReferralRecord: f, updateReferralRecord: s } = he(), u = G(() => {
|
|
743
745
|
var e;
|
|
744
|
-
return ((e =
|
|
745
|
-
}),
|
|
746
|
+
return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
|
|
747
|
+
}), m = F(null);
|
|
746
748
|
F(null);
|
|
747
|
-
const
|
|
748
|
-
var e,
|
|
749
|
+
const R = F(null), A = F(null), T = F(null), M = G(() => {
|
|
750
|
+
var e, t, d, _;
|
|
749
751
|
return [
|
|
750
752
|
{
|
|
751
753
|
label: "connect.referral.how_it_works.generate_link",
|
|
752
|
-
sublabel:
|
|
754
|
+
sublabel: l("connect.referral.how_it_works.generate_link_for_member"),
|
|
753
755
|
icon: "offline_share"
|
|
754
756
|
},
|
|
755
757
|
{
|
|
756
758
|
label: "connect.referral.how_it_works.referee_join_reward",
|
|
757
|
-
sublabel: `${((
|
|
758
|
-
action:
|
|
759
|
+
sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} ${l("connect.referral.how_it_works.reward")}`,
|
|
760
|
+
action: l("connect.referral.actions.manage_reward"),
|
|
759
761
|
onClick: () => {
|
|
760
762
|
var b;
|
|
761
763
|
return (b = T.value) == null ? void 0 : b.showSheet(!0);
|
|
762
764
|
},
|
|
763
|
-
helperText:
|
|
765
|
+
helperText: l(
|
|
766
|
+
"connect.referral.how_it_works.referee_join_reward_description"
|
|
767
|
+
),
|
|
764
768
|
icon: "group_add"
|
|
765
769
|
},
|
|
766
770
|
{
|
|
767
771
|
label: "connect.referral.how_it_works.referee_meet_criteria",
|
|
768
|
-
sublabel: `${(
|
|
769
|
-
action:
|
|
772
|
+
sublabel: `${(d = g.referralProgram) == null ? void 0 : d.criteria.length} ${l("connect.referral.how_it_works.criteria")}`,
|
|
773
|
+
action: l("connect.referral.actions.manage_criteria"),
|
|
770
774
|
onClick: () => {
|
|
771
775
|
var b;
|
|
772
776
|
return (b = A.value) == null ? void 0 : b.showSheet(!0);
|
|
@@ -775,76 +779,76 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
775
779
|
},
|
|
776
780
|
{
|
|
777
781
|
label: "connect.referral.how_it_works.referer_get_reward",
|
|
778
|
-
sublabel: `${(
|
|
779
|
-
helperText: "
|
|
782
|
+
sublabel: `${(_ = g.referralProgram) == null ? void 0 : _.reward.length} ${l("connect.referral.how_it_works.reward_tier")}`,
|
|
783
|
+
helperText: l("connect.referral.how_it_works.referral_tier_description"),
|
|
780
784
|
icon: "featured_seasonal_and_gifts"
|
|
781
785
|
}
|
|
782
786
|
];
|
|
783
787
|
});
|
|
784
|
-
function
|
|
785
|
-
var
|
|
786
|
-
(
|
|
788
|
+
function D(e) {
|
|
789
|
+
var t;
|
|
790
|
+
(t = m.value) == null || t.onManageRewardGroup(e);
|
|
787
791
|
}
|
|
788
792
|
function L(e) {
|
|
789
|
-
var
|
|
790
|
-
(
|
|
793
|
+
var t;
|
|
794
|
+
(t = R.value) == null || t.showSheet(!0, {
|
|
791
795
|
groupIndex: e.groupIndex,
|
|
792
796
|
countIndex: e.countIndex
|
|
793
797
|
});
|
|
794
798
|
}
|
|
795
799
|
async function y(e) {
|
|
796
800
|
var P, x, v, E;
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
), b =
|
|
800
|
-
b.rewards[
|
|
801
|
-
const $ = b.rewards[
|
|
802
|
-
if ($ && $.threshold.to !=
|
|
801
|
+
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, d = e.referralCount, _ = H(
|
|
802
|
+
g.referralProgram
|
|
803
|
+
), b = _.reward[e.groupIndex];
|
|
804
|
+
b.rewards[t] = e.referralCount;
|
|
805
|
+
const $ = b.rewards[t - 1], U = b.rewards[t + 1];
|
|
806
|
+
if ($ && $.threshold.to != d.threshold.from - 1) {
|
|
803
807
|
if (!await K.confirm(
|
|
804
|
-
|
|
808
|
+
l(
|
|
805
809
|
"connect.referral.referral_count.update.range_discontinuous.previous",
|
|
806
810
|
{
|
|
807
811
|
name: $.threshold.from,
|
|
808
812
|
from: $.threshold.from ?? 0,
|
|
809
813
|
to: $.threshold.to ?? 1 / 0,
|
|
810
|
-
newTo:
|
|
814
|
+
newTo: d.threshold.from - 1
|
|
811
815
|
}
|
|
812
816
|
),
|
|
813
|
-
|
|
814
|
-
|
|
817
|
+
l("connect.referral.referral_count.title"),
|
|
818
|
+
l("connect.referral.referral_count.remove.next_range")
|
|
815
819
|
))
|
|
816
820
|
return;
|
|
817
|
-
$.threshold.to =
|
|
821
|
+
$.threshold.to = d.threshold.from - 1;
|
|
818
822
|
}
|
|
819
|
-
if (U && U.threshold.from - 1 !=
|
|
823
|
+
if (U && U.threshold.from - 1 != d.threshold.to) {
|
|
820
824
|
if (!await K.confirm(
|
|
821
|
-
|
|
825
|
+
l("connect.program.tier.update.range_discontinuous.next", {
|
|
822
826
|
name: U.threshold.from,
|
|
823
827
|
from: U.threshold.from ?? 0,
|
|
824
828
|
to: U.threshold.to ?? 1 / 0,
|
|
825
|
-
newFrom:
|
|
829
|
+
newFrom: d.threshold.to ?? 1
|
|
826
830
|
}),
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
831
|
+
l("connect.program.tier.title"),
|
|
832
|
+
l("connect.program.tier.remove.next_range"),
|
|
833
|
+
l("connect.prompt.cancel")
|
|
830
834
|
))
|
|
831
835
|
return;
|
|
832
|
-
U.threshold.from = (
|
|
836
|
+
U.threshold.from = (d.threshold.to ?? 0) + 1;
|
|
833
837
|
}
|
|
834
|
-
!U && !((v =
|
|
838
|
+
!U && !((v = d.threshold) != null && v.to) && (d.threshold.to = void 0), await o(_), (E = R.value) == null || E.hideSheet();
|
|
835
839
|
}
|
|
836
840
|
async function n(e) {
|
|
837
|
-
var
|
|
838
|
-
const
|
|
839
|
-
|
|
841
|
+
var d;
|
|
842
|
+
const t = H(g.referralProgram);
|
|
843
|
+
t.refereeReward = e, await o(t), (d = T.value) == null || d.hideSheet();
|
|
840
844
|
}
|
|
841
845
|
async function o(e) {
|
|
842
846
|
await f(), await I(
|
|
843
847
|
async () => {
|
|
844
848
|
await pe.update({
|
|
845
849
|
...e,
|
|
846
|
-
updateReferralRecord:
|
|
847
|
-
}), await
|
|
850
|
+
updateReferralRecord: s.value
|
|
851
|
+
}), await g.readReferralProgram();
|
|
848
852
|
},
|
|
849
853
|
{
|
|
850
854
|
message: "Updating referral program",
|
|
@@ -852,53 +856,53 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
852
856
|
}
|
|
853
857
|
);
|
|
854
858
|
}
|
|
855
|
-
async function
|
|
859
|
+
async function i(e) {
|
|
856
860
|
if (!await K.remove(
|
|
857
|
-
"
|
|
858
|
-
"
|
|
859
|
-
|
|
860
|
-
|
|
861
|
+
l("connect.referral.reward.confirm_remove_referral_tier"),
|
|
862
|
+
l("connect.referral.reward.remove_referral_tier"),
|
|
863
|
+
l("connect.prompt.confirm"),
|
|
864
|
+
l("connect.prompt.cancel")
|
|
861
865
|
))
|
|
862
866
|
return;
|
|
863
|
-
const
|
|
864
|
-
|
|
867
|
+
const t = H(g.referralProgram);
|
|
868
|
+
t.reward.splice(e, 1), await o(t);
|
|
865
869
|
}
|
|
866
|
-
async function S(e,
|
|
870
|
+
async function S(e, t) {
|
|
867
871
|
if (!await K.remove(
|
|
868
|
-
"
|
|
869
|
-
"
|
|
870
|
-
|
|
871
|
-
|
|
872
|
+
l("connect.referral.reward.confirm_remove_referral_count"),
|
|
873
|
+
l("connect.referral.reward.remove_referral_count"),
|
|
874
|
+
l("connect.prompt.confirm"),
|
|
875
|
+
l("connect.prompt.cancel")
|
|
872
876
|
))
|
|
873
877
|
return;
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
878
|
+
const d = H(g.referralProgram), _ = d.reward[e].rewards[t + 1];
|
|
879
|
+
if (_) {
|
|
876
880
|
if (!await K.confirm(
|
|
877
|
-
|
|
878
|
-
from:
|
|
879
|
-
to:
|
|
880
|
-
newFrom:
|
|
881
|
+
l("connect.referral.referral_count.update.range_discontinuous.next", {
|
|
882
|
+
from: _.threshold.from ?? 0,
|
|
883
|
+
to: _.threshold.to ?? 1 / 0,
|
|
884
|
+
newFrom: d.reward[e].rewards[t].threshold.from
|
|
881
885
|
}),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
886
|
+
l("connect.referral.referral_count.remove.title"),
|
|
887
|
+
l("connect.referral.referral_count.remove.next_range"),
|
|
888
|
+
l("connect.prompt.cancel")
|
|
885
889
|
))
|
|
886
890
|
return;
|
|
887
|
-
|
|
891
|
+
_.threshold.from = d.reward[e].rewards[t].threshold.from;
|
|
888
892
|
}
|
|
889
|
-
|
|
893
|
+
d.reward[e].rewards.splice(t, 1), await o(d);
|
|
890
894
|
}
|
|
891
895
|
const h = [
|
|
892
896
|
{
|
|
893
|
-
header: "
|
|
897
|
+
header: l("connect.referral.reward.table.count"),
|
|
894
898
|
accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
|
|
895
899
|
},
|
|
896
900
|
{
|
|
897
|
-
header: "
|
|
901
|
+
header: l("connect.referral.reward.table.reward"),
|
|
898
902
|
accessorKey: "type",
|
|
899
903
|
accessorFn: (e) => {
|
|
900
|
-
var
|
|
901
|
-
return `${((
|
|
904
|
+
var t;
|
|
905
|
+
return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
|
|
902
906
|
}
|
|
903
907
|
},
|
|
904
908
|
{
|
|
@@ -912,45 +916,45 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
912
916
|
icon: "delete",
|
|
913
917
|
iconColor: "neutral-gray-400",
|
|
914
918
|
class: "ml-auto",
|
|
915
|
-
onClick: (
|
|
916
|
-
|
|
919
|
+
onClick: (t) => {
|
|
920
|
+
t.stopPropagation(), console.log(e.row), S(e.row.original.groupIndex, e.row.index);
|
|
917
921
|
}
|
|
918
922
|
});
|
|
919
923
|
}
|
|
920
924
|
}
|
|
921
925
|
];
|
|
922
|
-
return
|
|
923
|
-
await
|
|
924
|
-
}), (e,
|
|
925
|
-
const
|
|
926
|
-
return
|
|
926
|
+
return _e(async () => {
|
|
927
|
+
await g.readReferralProgram();
|
|
928
|
+
}), (e, t) => {
|
|
929
|
+
const d = w("FmCard"), _ = w("FmIcon"), b = w("FmTooltip"), $ = w("FmButton"), U = w("FmTable"), P = w("FmList");
|
|
930
|
+
return C(), B(Y, null, [
|
|
927
931
|
z("", !0),
|
|
928
|
-
d
|
|
932
|
+
c(d, {
|
|
929
933
|
variant: "outlined",
|
|
930
934
|
class: "flex flex-col gap-16 p-16"
|
|
931
935
|
}, {
|
|
932
936
|
default: V(() => [
|
|
933
|
-
a("div",
|
|
934
|
-
a("div",
|
|
935
|
-
(
|
|
937
|
+
a("div", mr, O(r(l)("connect.referral.how_it_works.title")), 1),
|
|
938
|
+
a("div", fr, [
|
|
939
|
+
(C(!0), B(Y, null, re(r(M), (x, v) => (C(), B("div", {
|
|
936
940
|
key: v,
|
|
937
941
|
class: de(["px-8", { "xs:!border-r": v % 2 == 0 }])
|
|
938
942
|
}, [
|
|
939
|
-
a("div",
|
|
940
|
-
|
|
943
|
+
a("div", pr, [
|
|
944
|
+
c(_, {
|
|
941
945
|
name: x.icon,
|
|
942
946
|
color: "primary",
|
|
943
947
|
class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
|
|
944
948
|
}, null, 8, ["name"]),
|
|
945
949
|
a("div", null, [
|
|
946
|
-
a("div",
|
|
947
|
-
ce(O(
|
|
948
|
-
x.helperText ? (
|
|
950
|
+
a("div", hr, [
|
|
951
|
+
ce(O(r(l)(x.label)) + " ", 1),
|
|
952
|
+
x.helperText ? (C(), j(b, {
|
|
949
953
|
key: 0,
|
|
950
954
|
content: x.helperText
|
|
951
955
|
}, {
|
|
952
956
|
default: V(() => [
|
|
953
|
-
|
|
957
|
+
c(_, {
|
|
954
958
|
name: "help",
|
|
955
959
|
size: "sm",
|
|
956
960
|
outline: !0
|
|
@@ -959,12 +963,12 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
959
963
|
_: 2
|
|
960
964
|
}, 1032, ["content"])) : z("", !0)
|
|
961
965
|
]),
|
|
962
|
-
a("div",
|
|
963
|
-
x.action ? (
|
|
966
|
+
a("div", vr, O(x.sublabel), 1),
|
|
967
|
+
x.action ? (C(), j($, {
|
|
964
968
|
key: 0,
|
|
965
969
|
variant: "plain",
|
|
966
970
|
label: x.action,
|
|
967
|
-
disabled: !
|
|
971
|
+
disabled: !r(p).isPremium,
|
|
968
972
|
class: "fm-typo-en-body-md-400 !p-0",
|
|
969
973
|
onClick: x.onClick
|
|
970
974
|
}, null, 8, ["label", "disabled", "onClick"])) : z("", !0)
|
|
@@ -975,27 +979,27 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
975
979
|
]),
|
|
976
980
|
_: 1
|
|
977
981
|
}),
|
|
978
|
-
|
|
982
|
+
r(u) && r(u).length > 0 ? (C(), j(d, {
|
|
979
983
|
key: 1,
|
|
980
984
|
variant: "outlined",
|
|
981
985
|
class: "flex flex-col gap-16 p-16"
|
|
982
986
|
}, {
|
|
983
987
|
default: V(() => [
|
|
984
|
-
|
|
988
|
+
c(P, { separator: !0 }, {
|
|
985
989
|
default: V(() => [
|
|
986
|
-
(
|
|
990
|
+
(C(!0), B(Y, null, re(r(u), (x, v) => (C(), j(Ge, {
|
|
987
991
|
key: v,
|
|
988
992
|
"reward-group": x,
|
|
989
993
|
level: v,
|
|
990
|
-
onEdit: (E) =>
|
|
991
|
-
onRemove: (E) =>
|
|
992
|
-
onAddCount:
|
|
994
|
+
onEdit: (E) => D(v),
|
|
995
|
+
onRemove: (E) => i(v),
|
|
996
|
+
onAddCount: t[0] || (t[0] = (E) => {
|
|
993
997
|
L({ groupIndex: E, countIndex: -1 });
|
|
994
998
|
})
|
|
995
999
|
}, {
|
|
996
1000
|
default: V(() => [
|
|
997
|
-
a("div",
|
|
998
|
-
|
|
1001
|
+
a("div", _r, [
|
|
1002
|
+
c(U, {
|
|
999
1003
|
"row-data": x.rewards.map((E) => ({ ...E, groupIndex: v })),
|
|
1000
1004
|
"column-defs": h,
|
|
1001
1005
|
"hide-footer": !0,
|
|
@@ -1003,12 +1007,12 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
1003
1007
|
onRowClick: (E) => L({ groupIndex: v, countIndex: E.index })
|
|
1004
1008
|
}, null, 8, ["row-data", "onRowClick"])
|
|
1005
1009
|
]),
|
|
1006
|
-
x.rewards.length ? z("", !0) : (
|
|
1007
|
-
|
|
1010
|
+
x.rewards.length ? z("", !0) : (C(), B("div", gr, [
|
|
1011
|
+
t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
1008
1012
|
a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
|
|
1009
1013
|
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 ")
|
|
1010
1014
|
], -1)),
|
|
1011
|
-
|
|
1015
|
+
c($, {
|
|
1012
1016
|
variant: "secondary",
|
|
1013
1017
|
label: "Add count",
|
|
1014
1018
|
icon: "add",
|
|
@@ -1023,44 +1027,44 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
1023
1027
|
})
|
|
1024
1028
|
]),
|
|
1025
1029
|
_: 1
|
|
1026
|
-
})) : (
|
|
1030
|
+
})) : (C(), j(d, {
|
|
1027
1031
|
key: 2,
|
|
1028
1032
|
variant: "outlined",
|
|
1029
1033
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1030
1034
|
}, {
|
|
1031
1035
|
default: V(() => [
|
|
1032
|
-
|
|
1033
|
-
src:
|
|
1036
|
+
t[4] || (t[4] = a("img", {
|
|
1037
|
+
src: ge,
|
|
1034
1038
|
class: "aspect-square w-[150px]"
|
|
1035
1039
|
}, null, -1)),
|
|
1036
1040
|
a("div", wr, [
|
|
1037
|
-
a("div",
|
|
1038
|
-
a("div",
|
|
1041
|
+
a("div", yr, O(r(l)("connect.referral.referral_tier_title")), 1),
|
|
1042
|
+
a("div", br, O(r(l)("connect.referral.referral_tier_description")), 1)
|
|
1039
1043
|
]),
|
|
1040
|
-
|
|
1044
|
+
c($, {
|
|
1041
1045
|
variant: "primary",
|
|
1042
|
-
label:
|
|
1046
|
+
label: r(l)("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: m
|
|
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(sr, {
|
|
1060
1064
|
ref_key: "manageCriteriaSheetRef",
|
|
1061
1065
|
ref: A
|
|
1062
1066
|
}, null, 512),
|
|
1063
|
-
|
|
1067
|
+
c(ur, {
|
|
1064
1068
|
ref_key: "editRefereeRewardSheetRef",
|
|
1065
1069
|
ref: T,
|
|
1066
1070
|
onUpdate: n
|
|
@@ -1070,5 +1074,5 @@ const ar = { class: "flex flex-col space-y-16 mt-24" }, nr = { class: "flex just
|
|
|
1070
1074
|
}
|
|
1071
1075
|
});
|
|
1072
1076
|
export {
|
|
1073
|
-
|
|
1077
|
+
Yr as default
|
|
1074
1078
|
};
|