@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.61
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-u9mtlxSv.js +427 -0
- package/dist/{App-C2616cfr.js → App-BwTQE7Ft.js} +445 -420
- package/dist/AuditLogs-BVMRclSw.js +1886 -0
- package/dist/Bin-Cca-XOkz.js +166 -0
- package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DRQgpwdP.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CeUu_T1u.js} +6 -8
- package/dist/Card-CnbB_u31.js +896 -0
- package/dist/Collections-BjlfOSC3.js +459 -0
- package/dist/{Credit-CPcLgnsq.js → Credit-BoElrcx9.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CGfpziKs.js} +18 -18
- package/dist/{Experience-BoBikt-x.js → Experience-SdGBf4vU.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/{Game-DR8PyYZa.js → Game-ChLHibpB.js} +39 -37
- package/dist/Index-D7Kq6uyf.js +259 -0
- package/dist/Marketing-BDajIqR_.js +20071 -0
- package/dist/Member-BPZryqWL.js +317 -0
- package/dist/MemberList-C52Dop8Z.js +1598 -0
- package/dist/MemberTransactions-DHU78kgS.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-js1F2E4N.js} +83 -71
- package/dist/{Mission-CMpvz9zN.js → Mission-BQR3qjAu.js} +101 -87
- package/dist/Overview-BbLYWXjG.js +1078 -0
- package/dist/{Point-DkZn6p9s.js → Point-DbTcWJbQ.js} +55 -53
- package/dist/{Promotion-B7YzwPc_.js → Promotion-CIrpWBQD.js} +65 -57
- package/dist/Queue-B0Mfq2Vn.js +244 -0
- package/dist/Record-Z6ZrJeLc.js +340 -0
- package/dist/Reward-D6k0QFQA.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-GJ6j_jOh.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-gQxmX9ur.js +1637 -0
- package/dist/Segment-D6MF-EO8.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BWG-pz6F.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-HgorlHNz.js +147 -0
- package/dist/Setting--OFDS95z.js +1931 -0
- package/dist/Store-BqlRTC-c.js +1751 -0
- package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-BTu0IdDN.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BX053DJA.js +943 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BAkuqLwy.js} +1 -1
- package/dist/{Tier-CW-46oJS.js → Tier-CE9LYAEX.js} +327 -318
- package/dist/{Title-CE9rWVdi.js → Title-DOOASUMI.js} +199 -184
- package/dist/{Transaction-B21RrC4M.js → Transaction-DPxUOBP-.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CKwf0F_i.js +130 -0
- package/dist/Voucher-D69DD02z.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFL0Nsez.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Byh6_EJM.js} +1 -1
- package/dist/app-C2u1t47T.js +7059 -0
- package/dist/app-DgfmbHZe.js +33357 -0
- package/dist/app.js +1 -1
- package/dist/{business-aHhRUXc0.js → business-BqCJB_vA.js} +1 -1
- package/dist/{campaign-DH9NUNf_.js → campaign-CWMPCmmU.js} +2 -2
- package/dist/campaign-D0dTbl5b.js +1810 -0
- package/dist/campaign.enum-DhE8N4pA.js +20 -0
- package/dist/campaign.fn-BpO-RQih.js +758 -0
- package/dist/collectible.enum-rWEc6Tsw.js +19 -0
- package/dist/{collection.fn-CYlsA-kW.js → collection.fn-biX2iFDQ.js} +2 -2
- package/dist/dto-3m7xZwfI.js +214 -0
- package/dist/{effect-LSc9YanX.js → effect-ZMGRxKCZ.js} +9 -9
- package/dist/email-addresses-lgY03bkq.js +705 -0
- package/dist/{export-Cf0-C5Ly.js → export-BOzeYUy8.js} +5 -5
- package/dist/{helper-CiZpeMCM.js → helper-CO29wun4.js} +1 -1
- package/dist/index-B3V7krW_.js +29000 -0
- package/dist/index-BVbiAxW8.js +115 -0
- package/dist/{index-D_83JP2i.js → index-Bvch9tuP.js} +48 -4
- package/dist/index-CYOwwy3h.js +44 -0
- package/dist/{index-D6cEOHP4.js → index-CbYXYVYp.js} +1501 -1480
- package/dist/{index-DtsDOuDx.js → index-ChrOXJDq.js} +24 -21
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-DNGenFnf.js +32 -0
- package/dist/{index-BVb5-Ht8.js → index-Dd22X409.js} +259 -173
- package/dist/{index-kPhrD63q.js → index-LYAWIqjk.js} +1 -1
- package/dist/index-Xh9cW6Y9.js +54 -0
- package/dist/{index-gxwjKu3-.js → index-XhqaicYu.js} +2212 -871
- package/dist/{index-DW3PRjPL.js → index-YsC4VklJ.js} +1 -1
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-CJ1flA6S.js} +121 -121
- package/dist/loading-CUs_CN1k.js +71 -0
- package/dist/{membership-Dw1ylJ9Y.js → membership-D-GVacos.js} +54 -46
- package/dist/money-CMtSALkX.js +15 -0
- package/dist/number-CDwwgAYM.js +12 -0
- package/dist/objectid-Bf9yKD81.js +145 -0
- package/dist/{loading-7yq1tinq.js → plugins-9sQTEyth.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-DblXGhWc.js +36 -0
- package/dist/{rule-C0Q_SHow.js → rule-Cy8cTzuw.js} +180 -177
- package/dist/{rule-builder-iu17XIof.js → rule-builder-Cn5vZgFN.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CyOanTMu.js → template-Cal94dUy.js} +5 -5
- package/dist/trigger-C1nwLSP8.js +144 -0
- package/dist/user-ir4Rn5bP.js +54 -0
- package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-eOHBBaH5.js} +243 -243
- package/dist/{xlsx-BYO_bB9J.js → xlsx-DulnT75_.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-muDf0oMG.js +0 -622
- package/dist/Card-bhLoK0ZV.js +0 -825
- package/dist/Collections-DjtsAiol.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
- package/dist/Marketing-Dny2nMUl.js +0 -316
- package/dist/Member-CP_smyk8.js +0 -69
- package/dist/MemberList-CR3eYI9p.js +0 -1733
- package/dist/MemberTransactions-RTx_lKFb.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
- package/dist/Segment-Bb4gHt5V.js +0 -437
- package/dist/Setting-Xj0AVzh3.js +0 -1901
- package/dist/Store-BWRHQ6Ie.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
- package/dist/Voucher-KK9fBI0u.js +0 -490
- package/dist/app-CjhXHUQv.js +0 -53428
- package/dist/app-Dvf_JNMf.js +0 -5764
- package/dist/dto-DArfyZAI.js +0 -2770
- package/dist/index-Bi_LGEtY.js +0 -99
- package/dist/index-CiQDG7Cm.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DQfjSSMF.js +0 -206
- package/dist/index-DcxssxPi.js +0 -29193
- package/dist/index-DqJVH2kv.js +0 -298
- package/dist/money-CPd0XTNv.js +0 -15
- package/dist/number-BgXY4un8.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
|
|
2
|
-
import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as C } from "./vue-i18n-
|
|
2
|
+
import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BX053DJA.js";
|
|
3
|
+
import { u as C } from "./vue-i18n-eOHBBaH5.js";
|
|
4
4
|
const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
|
|
5
5
|
__name: "Transaction",
|
|
6
6
|
setup(V) {
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { defineComponent as y, computed as b, openBlock as i, createBlock as R, unref as l, ref as E, watch as k, resolveComponent as h, createElementBlock as g, createElementVNode as B, Fragment as O, renderList as T, createVNode as V, isRef as U, createCommentVNode as v } from "vue";
|
|
2
|
+
import "./index-CbYXYVYp.js";
|
|
3
|
+
import { i as C, R as e } from "./rule-builder-Cn5vZgFN.js";
|
|
4
|
+
import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-gQxmX9ur.js";
|
|
5
|
+
import { p as N } from "./plugins-9sQTEyth.js";
|
|
6
|
+
import { u as S } from "./membership-D-GVacos.js";
|
|
7
|
+
import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
|
|
8
|
+
import { u as x } from "./vue-i18n-eOHBBaH5.js";
|
|
9
|
+
const A = /* @__PURE__ */ y({
|
|
10
|
+
__name: "SegmentConfigurator",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:model-value"],
|
|
18
|
+
setup(n, { emit: f }) {
|
|
19
|
+
const o = n, m = b(() => {
|
|
20
|
+
var s;
|
|
21
|
+
const [u] = C(o.modelValue) ? Object.values(((s = o.modelValue) == null ? void 0 : s.rules) ?? {}) : [null];
|
|
22
|
+
return (u ?? e.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
23
|
+
}), r = f;
|
|
24
|
+
return (u, c) => (i(), R(j, {
|
|
25
|
+
multiselect: !0,
|
|
26
|
+
items: l(S)().segmentOptions,
|
|
27
|
+
"model-value": l(m),
|
|
28
|
+
"onUpdate:modelValue": c[0] || (c[0] = (s) => r(
|
|
29
|
+
"update:model-value",
|
|
30
|
+
l(e).setRuleToGroup(
|
|
31
|
+
l(e).scaffoldGroup("g_segment"),
|
|
32
|
+
l(e).constructEntry("user.segment", "_hasAny", s)
|
|
33
|
+
)
|
|
34
|
+
)),
|
|
35
|
+
label: "Select segment(s) to match"
|
|
36
|
+
}, null, 8, ["items", "model-value"]));
|
|
37
|
+
}
|
|
38
|
+
}), F = { class: "space-y-16" }, M = { key: 0 }, z = /* @__PURE__ */ y({
|
|
39
|
+
__name: "UserRuleGroup",
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:model-value"],
|
|
48
|
+
setup(n, { emit: f }) {
|
|
49
|
+
const { t: o } = x(), m = n, r = f, u = E(
|
|
50
|
+
m.modelValue ? e.getRules(m.modelValue.rules.g_user).length > 0 ? "custom" : e.getRules(m.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
51
|
+
), c = [
|
|
52
|
+
{
|
|
53
|
+
value: "all_users",
|
|
54
|
+
label: o("connect.template.rule.audience.all")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "segment",
|
|
58
|
+
label: o("connect.template.rule.audience.member_segment")
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "custom",
|
|
62
|
+
label: o("connect.template.rule.audience.custom_audience")
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
return k(u, async (s, t) => {
|
|
66
|
+
var p;
|
|
67
|
+
if (t != "all_users" && t != s && e.getRules(
|
|
68
|
+
(p = m.modelValue) == null ? void 0 : p.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
69
|
+
).length > 0) {
|
|
70
|
+
const d = await N.confirm(
|
|
71
|
+
o("connect.template.rule.audience.confirm_remove"),
|
|
72
|
+
o("connect.common.confirm"),
|
|
73
|
+
o("connect.common.confirm"),
|
|
74
|
+
o("connect.common.cancel")
|
|
75
|
+
);
|
|
76
|
+
d && r(
|
|
77
|
+
"update:model-value",
|
|
78
|
+
e.setRuleToGroup(
|
|
79
|
+
m.modelValue ?? e.scaffoldGroup(),
|
|
80
|
+
e.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
81
|
+
)
|
|
82
|
+
), u.value = d ? s : t;
|
|
83
|
+
}
|
|
84
|
+
}), (s, t) => {
|
|
85
|
+
var d, _;
|
|
86
|
+
const p = h("FmRadio");
|
|
87
|
+
return i(), g("div", F, [
|
|
88
|
+
B("div", null, [
|
|
89
|
+
(i(), g(O, null, T(c, (a) => V(p, {
|
|
90
|
+
key: a.value,
|
|
91
|
+
value: a.value,
|
|
92
|
+
label: a.label,
|
|
93
|
+
modelValue: l(u),
|
|
94
|
+
"onUpdate:modelValue": t[0] || (t[0] = (G) => U(u) ? u.value = G : null)
|
|
95
|
+
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
96
|
+
]),
|
|
97
|
+
l(u) == "segment" ? (i(), g("div", M, [
|
|
98
|
+
V(A, {
|
|
99
|
+
modelValue: ((d = n.modelValue) == null ? void 0 : d.rules.g_segment) ?? l(e).scaffoldGroup("g_segment"),
|
|
100
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => r(
|
|
101
|
+
"update:model-value",
|
|
102
|
+
l(e).setRuleToGroup(
|
|
103
|
+
n.modelValue ?? l(e).scaffoldGroup(),
|
|
104
|
+
a,
|
|
105
|
+
"&&"
|
|
106
|
+
)
|
|
107
|
+
))
|
|
108
|
+
}, null, 8, ["modelValue"])
|
|
109
|
+
])) : v("", !0),
|
|
110
|
+
l(u) == "custom" ? (i(), R(I, {
|
|
111
|
+
key: 1,
|
|
112
|
+
"include-only": "user",
|
|
113
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
114
|
+
"model-value": ((_ = n.modelValue) == null ? void 0 : _.rules.g_user) ?? l(e).scaffoldGroup("g_user"),
|
|
115
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => r(
|
|
116
|
+
"update:model-value",
|
|
117
|
+
l(e).setRuleToGroup(
|
|
118
|
+
n.modelValue ?? l(e).scaffoldGroup(),
|
|
119
|
+
a,
|
|
120
|
+
"&&"
|
|
121
|
+
)
|
|
122
|
+
))
|
|
123
|
+
}, null, 8, ["model-value"])) : v("", !0)
|
|
124
|
+
]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export {
|
|
129
|
+
z as _
|
|
130
|
+
};
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { defineComponent as z, ref as k, computed as Q, h as m, onMounted as Z, resolveComponent as d, openBlock as u, createElementBlock as S, Fragment as F, createVNode as s, unref as t, createElementVNode as r, withCtx as V, renderList as J, createBlock as y, resolveDynamicComponent as Y, toDisplayString as g, createCommentVNode as E } from "vue";
|
|
2
|
+
import { _ as ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as oe, components as f } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as A, a as te } from "./plugins-9sQTEyth.js";
|
|
5
|
+
import { useCoreStore as ae } from "@feedmepos/mf-common";
|
|
6
|
+
import { u as ne } from "./loading-CUs_CN1k.js";
|
|
7
|
+
import { u as ce } from "./business-BqCJB_vA.js";
|
|
8
|
+
import { u as re } from "./campaign-CWMPCmmU.js";
|
|
9
|
+
import { g as ie, a as B, b as O } from "./campaign-D0dTbl5b.js";
|
|
10
|
+
import "./index-LYAWIqjk.js";
|
|
11
|
+
import { u as se } from "./template-Cal94dUy.js";
|
|
12
|
+
import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js";
|
|
13
|
+
import { _ as me } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
14
|
+
import { _ as ue } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-HgorlHNz.js";
|
|
15
|
+
import { u as de } from "./vue-i18n-eOHBBaH5.js";
|
|
16
|
+
import { useRouter as pe } from "vue-router";
|
|
17
|
+
import { c as w } from "./index-BVbiAxW8.js";
|
|
18
|
+
import { R as H } from "./app-C2u1t47T.js";
|
|
19
|
+
var fe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
|
|
20
|
+
const he = { class: "px-24 flex flex-col gap-y-16" }, ye = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, _e = { class: "space-y-8" }, ve = { class: "flex w-full gap-4 items-center" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "space-y-4" }, be = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "flex gap-8 items-center" }, Se = { class: "flex flex-col gap-16 text-center" }, Fe = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ z({
|
|
21
|
+
__name: "Voucher",
|
|
22
|
+
setup(Ie) {
|
|
23
|
+
const { t: a } = de(), T = {
|
|
24
|
+
label: a("connect.voucher.createCampaign"),
|
|
25
|
+
value: "create",
|
|
26
|
+
isPrimary: !0,
|
|
27
|
+
prependIcon: "add"
|
|
28
|
+
}, I = oe(), $ = se("VOUCHER", I), K = ce(), p = re(), { global: N, minor: L } = ne, P = pe(), i = k({
|
|
29
|
+
searchKey: "",
|
|
30
|
+
location: null
|
|
31
|
+
}), _ = Q(
|
|
32
|
+
() => p.campaigns.voucher.filter(
|
|
33
|
+
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
34
|
+
)
|
|
35
|
+
), D = [
|
|
36
|
+
{
|
|
37
|
+
header: a("connect.voucher.voucherTitle"),
|
|
38
|
+
accessorFn: (e) => e.name
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: a("connect.voucher.status"),
|
|
42
|
+
accessorFn: (e) => ie(e),
|
|
43
|
+
cell(e) {
|
|
44
|
+
return B(e.row.original);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: a("connect.voucher.summary"),
|
|
49
|
+
accessorFn: (e) => O(e)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
header: a("connect.voucher.quota"),
|
|
53
|
+
accessorFn: (e) => {
|
|
54
|
+
var o;
|
|
55
|
+
return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
header: a("connect.voucher.claimed"),
|
|
60
|
+
accessorFn: (e) => {
|
|
61
|
+
var o;
|
|
62
|
+
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: a("connect.voucher.actions"),
|
|
67
|
+
cell(e) {
|
|
68
|
+
return m("div", { class: "flex items-center justify-end" }, [
|
|
69
|
+
m(f.FmButton, {
|
|
70
|
+
icon: "visibility",
|
|
71
|
+
variant: "tertiary",
|
|
72
|
+
iconColor: "neutral-gray-400",
|
|
73
|
+
onClick: async (o) => {
|
|
74
|
+
o.stopPropagation(), await P.push({
|
|
75
|
+
name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
76
|
+
params: { id: e.row.original._id }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
m(
|
|
81
|
+
f.FmMenu,
|
|
82
|
+
{
|
|
83
|
+
placement: "bottom-end",
|
|
84
|
+
onClick: (o) => {
|
|
85
|
+
o.stopPropagation();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"menu-button": () => m(f.FmButton, {
|
|
90
|
+
icon: "more_vert",
|
|
91
|
+
iconColor: "neutral-gray-400",
|
|
92
|
+
variant: "tertiary"
|
|
93
|
+
}),
|
|
94
|
+
default: () => {
|
|
95
|
+
const o = [
|
|
96
|
+
m(
|
|
97
|
+
f.FmMenuItem,
|
|
98
|
+
{
|
|
99
|
+
onClick: async (c) => {
|
|
100
|
+
c.stopPropagation(), M(e.row.original);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: m(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
108
|
+
},
|
|
109
|
+
a("connect.voucher.remove")
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
];
|
|
114
|
+
return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
|
|
115
|
+
m(f.FmMenuItem, {
|
|
116
|
+
label: a("connect.voucher.send"),
|
|
117
|
+
onClick: async (c) => {
|
|
118
|
+
var l;
|
|
119
|
+
c.stopPropagation(), (l = b.value) == null || l.showSheet({
|
|
120
|
+
campaignId: e.row.original._id
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
), o.unshift(
|
|
125
|
+
m(f.FmMenuItem, {
|
|
126
|
+
label: a("connect.voucher.share"),
|
|
127
|
+
onClick: async (c) => {
|
|
128
|
+
if (c.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
129
|
+
return await A.confirm(
|
|
130
|
+
"Cannot share a voucher that is not a simple claim.",
|
|
131
|
+
"Share Voucher",
|
|
132
|
+
"OK"
|
|
133
|
+
);
|
|
134
|
+
await te(
|
|
135
|
+
`https://${ae().currentBusiness.value._id}.${fe.appUrl}/vouchers/${e.row.original._id}`,
|
|
136
|
+
{
|
|
137
|
+
successMessage: "Voucher link copied to clipboard"
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
)), o;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
], U = k(), b = k();
|
|
150
|
+
async function M(e) {
|
|
151
|
+
await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await L(
|
|
152
|
+
async () => {
|
|
153
|
+
await w.delete(e._id), await p.read("VOUCHER");
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
message: a("connect.voucher.removing", { name: e.name }),
|
|
157
|
+
successMessage: a("connect.voucher.removedSuccessfully", {
|
|
158
|
+
name: e.name
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
async function v(e) {
|
|
164
|
+
e ? await o() : $.open(async (c) => {
|
|
165
|
+
await o(c);
|
|
166
|
+
});
|
|
167
|
+
async function o(c) {
|
|
168
|
+
var l;
|
|
169
|
+
(l = U.value) == null || l.showSheet(
|
|
170
|
+
!0,
|
|
171
|
+
"VOUCHER",
|
|
172
|
+
e ? await w.readById(e._id) : void 0,
|
|
173
|
+
c
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function j(e) {
|
|
178
|
+
e.campaign._id && await new Promise((o) => {
|
|
179
|
+
I.open({
|
|
180
|
+
title: "Confirmation",
|
|
181
|
+
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
182
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
183
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
184
|
+
}).onPrimary(async () => {
|
|
185
|
+
var c;
|
|
186
|
+
e.updateCollections = !0, (c = window.top) == null || c.postMessage("updateAllVoucher", "*"), o();
|
|
187
|
+
}).onSecondary(async () => {
|
|
188
|
+
o();
|
|
189
|
+
});
|
|
190
|
+
}), await L(
|
|
191
|
+
async () => {
|
|
192
|
+
e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
message: a(
|
|
196
|
+
e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
|
|
197
|
+
),
|
|
198
|
+
successMessage: a(
|
|
199
|
+
e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
return Z(async () => {
|
|
205
|
+
await N(async () => {
|
|
206
|
+
await p.read("VOUCHER");
|
|
207
|
+
});
|
|
208
|
+
}), (e, o) => {
|
|
209
|
+
const c = d("FmPageHead"), l = d("FmSearch"), q = d("FmTable"), C = d("FmButton"), G = d("FmListItem"), X = d("FmList"), W = d("FmCard");
|
|
210
|
+
return u(), S(F, null, [
|
|
211
|
+
s(c, {
|
|
212
|
+
title: t(a)("connect.voucher.title"),
|
|
213
|
+
actions: t(_).length > 0 ? [T] : [],
|
|
214
|
+
"onClick:action": o[0] || (o[0] = () => v())
|
|
215
|
+
}, null, 8, ["title", "actions"]),
|
|
216
|
+
r("div", he, [
|
|
217
|
+
s(l, {
|
|
218
|
+
modelValue: t(i).searchKey,
|
|
219
|
+
"onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
|
|
220
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
221
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
222
|
+
collapsible: ""
|
|
223
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
224
|
+
t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), S(F, { key: 0 }, [
|
|
225
|
+
r("div", ye, [
|
|
226
|
+
r("div", ge, [
|
|
227
|
+
s(me, {
|
|
228
|
+
modelValue: t(i).location,
|
|
229
|
+
"onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
|
|
230
|
+
label: t(a)("connect.voucher.location"),
|
|
231
|
+
"show-item-label": !0,
|
|
232
|
+
icon: "storefront",
|
|
233
|
+
placement: "bottom-start",
|
|
234
|
+
items: t(K).locationItems
|
|
235
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
236
|
+
]),
|
|
237
|
+
s(l, {
|
|
238
|
+
modelValue: t(i).searchKey,
|
|
239
|
+
"onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).searchKey = n),
|
|
240
|
+
class: "xs:hidden",
|
|
241
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
242
|
+
collapsible: ""
|
|
243
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
244
|
+
]),
|
|
245
|
+
s(q, {
|
|
246
|
+
class: "xs:hidden",
|
|
247
|
+
"row-data": t(_),
|
|
248
|
+
"column-defs": D,
|
|
249
|
+
"search-value": t(i).searchKey,
|
|
250
|
+
"column-filter": [],
|
|
251
|
+
onRowClick: o[4] || (o[4] = (n) => v(n.original)),
|
|
252
|
+
"hide-footer": t(_).length < 10
|
|
253
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
254
|
+
s(X, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
255
|
+
default: V(() => [
|
|
256
|
+
(u(!0), S(F, null, J(t(_).filter(
|
|
257
|
+
(n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
258
|
+
), (n) => (u(), y(G, {
|
|
259
|
+
key: n._id.toString(),
|
|
260
|
+
onClick: (x) => v(n),
|
|
261
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
262
|
+
}, {
|
|
263
|
+
default: V(() => {
|
|
264
|
+
var x;
|
|
265
|
+
return [
|
|
266
|
+
r("div", _e, [
|
|
267
|
+
r("div", ve, [
|
|
268
|
+
(u(), y(Y(t(B)(n)))),
|
|
269
|
+
r("div", Ce, g(((x = n.pf_collectible) == null ? void 0 : x.currentReceive) ?? 0) + " claimed ", 1)
|
|
270
|
+
]),
|
|
271
|
+
r("div", we, [
|
|
272
|
+
r("div", be, g(n.name), 1),
|
|
273
|
+
r("div", xe, g(t(O)(n)), 1)
|
|
274
|
+
])
|
|
275
|
+
]),
|
|
276
|
+
r("div", ke, [
|
|
277
|
+
n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
|
|
278
|
+
key: 0,
|
|
279
|
+
icon: "visibility",
|
|
280
|
+
"icon-color": "neutral-gray-400",
|
|
281
|
+
variant: "tertiary",
|
|
282
|
+
onClick: async (h) => {
|
|
283
|
+
h.stopPropagation(), await t(P).push({
|
|
284
|
+
name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
285
|
+
params: { id: n._id }
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}, null, 8, ["onClick"])) : E("", !0),
|
|
289
|
+
n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
|
|
290
|
+
key: 1,
|
|
291
|
+
icon: "send",
|
|
292
|
+
"icon-color": "neutral-gray-400",
|
|
293
|
+
variant: "tertiary",
|
|
294
|
+
onClick: (h) => {
|
|
295
|
+
var R;
|
|
296
|
+
h.stopPropagation(), (R = t(b)) == null || R.showSheet({
|
|
297
|
+
campaignId: n._id
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}, null, 8, ["onClick"])) : E("", !0),
|
|
301
|
+
s(C, {
|
|
302
|
+
icon: "delete",
|
|
303
|
+
"icon-color": "neutral-gray-400",
|
|
304
|
+
variant: "tertiary",
|
|
305
|
+
onClick: (h) => (h.stopPropagation(), M(n))
|
|
306
|
+
}, null, 8, ["onClick"])
|
|
307
|
+
])
|
|
308
|
+
];
|
|
309
|
+
}),
|
|
310
|
+
_: 2
|
|
311
|
+
}, 1032, ["onClick"]))), 128))
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
})
|
|
315
|
+
], 64)) : (u(), y(W, {
|
|
316
|
+
key: 1,
|
|
317
|
+
variant: "outlined",
|
|
318
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
319
|
+
}, {
|
|
320
|
+
default: V(() => [
|
|
321
|
+
o[6] || (o[6] = r("img", {
|
|
322
|
+
src: ee,
|
|
323
|
+
class: "aspect-square w-[150px]"
|
|
324
|
+
}, null, -1)),
|
|
325
|
+
r("div", Se, [
|
|
326
|
+
r("div", Fe, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
|
|
327
|
+
r("div", Ve, g(t(a)("connect.voucher.description")), 1)
|
|
328
|
+
]),
|
|
329
|
+
s(C, {
|
|
330
|
+
variant: "primary",
|
|
331
|
+
label: t(a)("connect.voucher.createVoucherCampaign"),
|
|
332
|
+
icon: "add",
|
|
333
|
+
onClick: o[5] || (o[5] = (n) => v())
|
|
334
|
+
}, null, 8, ["label"])
|
|
335
|
+
]),
|
|
336
|
+
_: 1
|
|
337
|
+
})),
|
|
338
|
+
s(le, {
|
|
339
|
+
ref_key: "sheetRef",
|
|
340
|
+
ref: U,
|
|
341
|
+
"onSubmit:modelValue": j
|
|
342
|
+
}, null, 512),
|
|
343
|
+
s(ue, {
|
|
344
|
+
ref_key: "sendVoucherSheetRef",
|
|
345
|
+
ref: b
|
|
346
|
+
}, null, 512)
|
|
347
|
+
])
|
|
348
|
+
], 64);
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
export {
|
|
353
|
+
Xe as default
|
|
354
|
+
};
|