@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.76
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-BrBxRQue.js +761 -0
- package/dist/App-CE_19YJc.js +4642 -0
- package/dist/AuditLogs-CQtMmVIp.js +1991 -0
- package/dist/Bin-D9CHhiUb.js +166 -0
- package/dist/Broadcast-Dg6eBL_f.js +267 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js +121 -0
- package/dist/Card-BTkf67i1.js +910 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Czq4nsdu.js +541 -0
- package/dist/Credit-B3nX8aJA.js +261 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js +3120 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js +351 -0
- package/dist/Experience-B9Vn3NTH.js +260 -0
- package/dist/FileSaver.min-CJaOkSQt.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-DTx_EsM3.js +331 -0
- package/dist/GenerateMaterial-C3J9_YHw.js +589 -0
- package/dist/Grab-B29W7rka.js +301 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js +145 -0
- package/dist/Index-Fk8EP5dG.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js +48 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js +18737 -0
- package/dist/MainLayout-BFmqJkE_.js +41 -0
- package/dist/Marketing-BRHQHAWD.js +145 -0
- package/dist/MarketingMaterialEdit-7s3WEDyJ.js +746 -0
- package/dist/Member-DwPJNAo9.js +280 -0
- package/dist/MemberList-mS1W0qHY.js +1601 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-BV3xvFYS.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js +60799 -0
- package/dist/Mission-QmoURSu4.js +335 -0
- package/dist/Overview-CaTMLlq-.js +1078 -0
- package/dist/Point-CjG77Sma.js +263 -0
- package/dist/Promotion-C5I-1qPN.js +397 -0
- package/dist/Queue-BaIBCCaX.js +259 -0
- package/dist/Record-DqpGwZIU.js +341 -0
- package/dist/Review-Bq-edSOO.js +621 -0
- package/dist/ReviewFacebookCallback-yaC4rLki.js +243 -0
- package/dist/ReviewGoogleCallback-uxrrCQdu.js +213 -0
- package/dist/Reward-DGP65n5t.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js +149 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js +1912 -0
- package/dist/Segment-CNz0sR3c.js +881 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +147 -0
- package/dist/Setting-BKDSGYBR.js +2000 -0
- package/dist/SettingAdvertisements-B2GMFfN9.js +264 -0
- package/dist/Store-C6uLl_Ue.js +1996 -0
- package/dist/StoreRewards-D4728UDf.js +535 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js +1129 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js +7005 -0
- package/dist/Tier-BNzTa1_w.js +970 -0
- package/dist/Title-DY5knovF.js +568 -0
- package/dist/Transaction-Ct4yAJ9n.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js +130 -0
- package/dist/Voucher-DFTMRPT0.js +422 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js +421 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js +56 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-6lG4w5PT.js +59396 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +7 -0
- package/dist/business-CrfQ56D0.js +82 -0
- package/dist/campaign-B9fR7RwT.js +100 -0
- package/dist/campaign-B_iIaTKz.js +253 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign.enum-BAHf0dSv.js +26 -0
- package/dist/campaign.fn-DDEgBzH2.js +776 -0
- package/dist/collectible.enum-9os2zr5a.js +19 -0
- package/dist/collection.fn-7qP_m2MW.js +26 -0
- package/dist/dto-C2hLQKuu.js +222 -0
- package/dist/duplicateCampaign-C6RXfeWE.js +51 -0
- package/dist/effect-DGVfWyIc.js +89 -0
- package/dist/email-addresses-BHa_qQBd.js +705 -0
- package/dist/export-CRPfo4hq.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-0_zrz4kj.js +86 -0
- package/dist/index-4Vl1VXum.js +2639 -0
- package/dist/index-4bX0ewBJ.js +31 -0
- package/dist/index-Bj0TV_D5.js +36 -0
- package/dist/index-BpdSswT6.js +48 -0
- package/dist/index-By2wenzb.js +32 -0
- package/dist/index-C8L2jQ_6.js +28897 -0
- package/dist/index-CO5kQMIK.js +85 -0
- package/dist/index-CW_ub4cF.js +8912 -0
- package/dist/index-Cp8wkBus.js +124 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-D6Te1BQZ.js +54 -0
- package/dist/index-DbJGJ2fB.js +146 -0
- package/dist/index-DeaGdUSH.js +30289 -0
- package/dist/index-Dp1J9Fxa.js +3 -0
- package/dist/index-QUvYZydO.js +67 -0
- package/dist/index-lwxV5iX0.js +3431 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index.esm2017-ofRmIpjY.js +3069 -0
- package/dist/loading-8_73fcXo.js +71 -0
- package/dist/lodash-Bz_vrY3P.js +3678 -0
- package/dist/membership-CpB39vNW.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-DALHjzjF.js +15 -0
- package/dist/number-D_GJahxw.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-BZSH63yc.js +145 -0
- package/dist/plugins-A4jDcmfS.js +1817 -0
- package/dist/remy-D_Deb3ue.js +13 -0
- package/dist/reward-BqFB2Yn2.js +36 -0
- package/dist/rule-DNylZfIG.js +1969 -0
- package/dist/rule-builder-2iT04EOj.js +102 -0
- package/dist/style.css +13 -0
- package/dist/template-D7rpG7FN.js +188 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-BW17tvi2.js +1154 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-CbVrS2i6.js +213 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-dXSoqxfG.js +266 -0
- package/dist/user-Ck-m3cB3.js +55 -0
- package/dist/vue-i18n-BvqmcBWZ.js +2365 -0
- package/dist/xlsx-CkqDfUNs.js +15491 -0
- package/dist/zod-B0YxCfoE.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
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-CG09fJTP.js";
|
|
3
|
+
import { u as C } from "./vue-i18n-BvqmcBWZ.js";
|
|
4
|
+
const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
|
|
5
|
+
__name: "Transaction",
|
|
6
|
+
setup(V) {
|
|
7
|
+
const { t: n } = C(), a = [
|
|
8
|
+
{
|
|
9
|
+
label: n("connect.transaction.tabs.collection"),
|
|
10
|
+
value: "collection"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: n("connect.transaction.tabs.store"),
|
|
14
|
+
value: "store"
|
|
15
|
+
}
|
|
16
|
+
], e = f(a[0]);
|
|
17
|
+
return (B, c) => {
|
|
18
|
+
const i = s("FmPageHead"), u = s("FmTabs");
|
|
19
|
+
return t(), v(b, null, [
|
|
20
|
+
r(i, {
|
|
21
|
+
title: o(n)("connect.transaction.title")
|
|
22
|
+
}, null, 8, ["title"]),
|
|
23
|
+
k("div", T, [
|
|
24
|
+
r(u, {
|
|
25
|
+
"model-value": o(e).value,
|
|
26
|
+
items: a,
|
|
27
|
+
"onUpdate:modelValue": c[0] || (c[0] = (p) => e.value = a.find((_) => _.value === p))
|
|
28
|
+
}, null, 8, ["model-value"]),
|
|
29
|
+
(t(), l(x, null, [
|
|
30
|
+
o(e).value == "collection" ? (t(), l(m(g), { key: 0 })) : o(e).value == "store" ? (t(), l(m(y), { key: 1 })) : F("", !0)
|
|
31
|
+
], 1024))
|
|
32
|
+
])
|
|
33
|
+
], 64);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
P as default
|
|
39
|
+
};
|
|
@@ -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-CW_ub4cF.js";
|
|
3
|
+
import { i as C, R as e } from "./rule-builder-2iT04EOj.js";
|
|
4
|
+
import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js";
|
|
5
|
+
import { p as N } from "./plugins-A4jDcmfS.js";
|
|
6
|
+
import { u as S } from "./membership-CpB39vNW.js";
|
|
7
|
+
import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
|
|
8
|
+
import { u as x } from "./vue-i18n-BvqmcBWZ.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,422 @@
|
|
|
1
|
+
import { defineComponent as te, ref as U, computed as ne, h as m, onMounted as ae, resolveComponent as d, openBlock as u, createElementBlock as T, Fragment as P, createVNode as l, unref as t, createElementVNode as c, withCtx as R, renderList as re, createBlock as h, resolveDynamicComponent as ce, createCommentVNode as L, toDisplayString as v } from "vue";
|
|
2
|
+
import { _ as ie } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as se, components as p } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as H } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
5
|
+
import { a as le, p as me } from "./plugins-A4jDcmfS.js";
|
|
6
|
+
import { useCoreStore as ue } from "@feedmepos/mf-common";
|
|
7
|
+
import { u as de } from "./loading-8_73fcXo.js";
|
|
8
|
+
import { u as pe } from "./business-CrfQ56D0.js";
|
|
9
|
+
import { u as fe } from "./campaign-B9fR7RwT.js";
|
|
10
|
+
import { a as ye, b as $, c as D } from "./campaign-B_iIaTKz.js";
|
|
11
|
+
import { c as he, p as ge } from "./duplicateCampaign-C6RXfeWE.js";
|
|
12
|
+
import "./index-Dp1J9Fxa.js";
|
|
13
|
+
import { u as ve } from "./template-D7rpG7FN.js";
|
|
14
|
+
import { _ as _e } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js";
|
|
15
|
+
import { _ as Ce } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js";
|
|
16
|
+
import { u as we } from "./vue-i18n-BvqmcBWZ.js";
|
|
17
|
+
import { T as be } from "./trigger-CbVrS2i6.js";
|
|
18
|
+
import { useRouter as ke } from "vue-router";
|
|
19
|
+
import { c as _ } from "./index-Cp8wkBus.js";
|
|
20
|
+
import { R as K } from "./app-6lG4w5PT.js";
|
|
21
|
+
var xe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
22
|
+
const Fe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, Se = { class: "flex gap-8 overflow-x-auto" }, Ue = { class: "space-y-8" }, Te = { class: "flex w-full gap-4 items-center" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Le = { class: "fm-typo-en-body-lg-600" }, Ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Be = { class: "flex flex-col gap-16 text-center" }, Oe = { class: "fm-typo-en-title-sm-800" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ro = /* @__PURE__ */ te({
|
|
23
|
+
__name: "Voucher",
|
|
24
|
+
setup(Me) {
|
|
25
|
+
const { t: a } = we(), N = {
|
|
26
|
+
label: a("connect.voucher.createCampaign"),
|
|
27
|
+
value: "create",
|
|
28
|
+
isPrimary: !0,
|
|
29
|
+
prependIcon: "add"
|
|
30
|
+
}, I = se(), j = ve("VOUCHER", I), q = pe(), y = fe(), { global: G, minor: E } = de, B = ke(), s = U({
|
|
31
|
+
searchKey: "",
|
|
32
|
+
location: [],
|
|
33
|
+
triggerType: []
|
|
34
|
+
}), C = ne(
|
|
35
|
+
() => y.campaigns.voucher.filter(
|
|
36
|
+
(e) => W(e) && z(e)
|
|
37
|
+
)
|
|
38
|
+
), X = be.VOUCHER.map((e) => ({
|
|
39
|
+
label: e.name,
|
|
40
|
+
value: e.value
|
|
41
|
+
}));
|
|
42
|
+
function W(e) {
|
|
43
|
+
const o = s.value.location;
|
|
44
|
+
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
|
|
45
|
+
(r) => {
|
|
46
|
+
var i;
|
|
47
|
+
return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(r);
|
|
48
|
+
}
|
|
49
|
+
) : e.targetLocation.includes(o);
|
|
50
|
+
}
|
|
51
|
+
function k(e) {
|
|
52
|
+
return e.hideInApp === !1;
|
|
53
|
+
}
|
|
54
|
+
function x(e) {
|
|
55
|
+
return e.event.type === "SIMPLE_CLAIM" && !k(e);
|
|
56
|
+
}
|
|
57
|
+
function z(e) {
|
|
58
|
+
const o = s.value.triggerType;
|
|
59
|
+
if (!o || o.length === 0) return !0;
|
|
60
|
+
const r = e.event.type;
|
|
61
|
+
return o.includes(r);
|
|
62
|
+
}
|
|
63
|
+
const Q = [
|
|
64
|
+
{
|
|
65
|
+
header: a("connect.voucher.voucherTitle"),
|
|
66
|
+
accessorFn: (e) => e.name,
|
|
67
|
+
cell(e) {
|
|
68
|
+
const o = [e.row.original.name];
|
|
69
|
+
return k(e.row.original) && o.push(
|
|
70
|
+
m(p.FmChip, {
|
|
71
|
+
label: "Feedvibe",
|
|
72
|
+
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
73
|
+
compact: !0
|
|
74
|
+
})
|
|
75
|
+
), m("div", { class: "flex items-center gap-4" }, o);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
header: a("connect.voucher.status"),
|
|
80
|
+
accessorFn: (e) => ye(e),
|
|
81
|
+
cell(e) {
|
|
82
|
+
return $(e.row.original);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
header: a("connect.voucher.summary"),
|
|
87
|
+
accessorFn: (e) => D(e)
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
header: a("connect.voucher.quota"),
|
|
91
|
+
accessorFn: (e) => {
|
|
92
|
+
var o;
|
|
93
|
+
return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
header: a("connect.voucher.claimed"),
|
|
98
|
+
accessorFn: (e) => {
|
|
99
|
+
var o;
|
|
100
|
+
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
header: a("connect.voucher.actions"),
|
|
105
|
+
cell(e) {
|
|
106
|
+
return m("div", { class: "flex items-center justify-end" }, [
|
|
107
|
+
m(p.FmButton, {
|
|
108
|
+
icon: "visibility",
|
|
109
|
+
variant: "tertiary",
|
|
110
|
+
iconColor: "neutral-gray-400",
|
|
111
|
+
onClick: async (o) => {
|
|
112
|
+
o.stopPropagation(), await B.push({
|
|
113
|
+
name: K["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
114
|
+
params: { id: e.row.original._id }
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
m(
|
|
119
|
+
p.FmMenu,
|
|
120
|
+
{
|
|
121
|
+
placement: "bottom-end",
|
|
122
|
+
onClick: (o) => {
|
|
123
|
+
o.stopPropagation();
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"menu-button": () => m(p.FmButton, {
|
|
128
|
+
icon: "more_vert",
|
|
129
|
+
iconColor: "neutral-gray-400",
|
|
130
|
+
variant: "tertiary"
|
|
131
|
+
}),
|
|
132
|
+
default: () => {
|
|
133
|
+
const o = [
|
|
134
|
+
m(p.FmMenuItem, {
|
|
135
|
+
label: a("connect.voucher.duplicate"),
|
|
136
|
+
onClick: async (r) => {
|
|
137
|
+
r.stopPropagation(), await A(e.row.original);
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
m(
|
|
141
|
+
p.FmMenuItem,
|
|
142
|
+
{
|
|
143
|
+
onClick: async (r) => {
|
|
144
|
+
r.stopPropagation(), O(e.row.original);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: m(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
152
|
+
},
|
|
153
|
+
a("connect.voucher.remove")
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
];
|
|
158
|
+
return x(e.row.original) && (o.unshift(
|
|
159
|
+
m(p.FmMenuItem, {
|
|
160
|
+
label: a("connect.voucher.send"),
|
|
161
|
+
onClick: async (r) => {
|
|
162
|
+
var i;
|
|
163
|
+
r.stopPropagation(), (i = V.value) == null || i.showSheet({
|
|
164
|
+
campaignId: e.row.original._id
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
), o.unshift(
|
|
169
|
+
m(p.FmMenuItem, {
|
|
170
|
+
label: a("connect.voucher.share"),
|
|
171
|
+
onClick: async (r) => {
|
|
172
|
+
r.stopPropagation(), await le(
|
|
173
|
+
`https://${ue().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
|
|
174
|
+
{
|
|
175
|
+
successMessage: "Voucher link copied to clipboard"
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
)), o;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
], F = U(), V = U();
|
|
188
|
+
async function O(e) {
|
|
189
|
+
await me.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await E(
|
|
190
|
+
async () => {
|
|
191
|
+
await _.delete(e._id), await y.read("VOUCHER");
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
message: a("connect.voucher.removing", { name: e.name }),
|
|
195
|
+
successMessage: a("connect.voucher.removedSuccessfully", {
|
|
196
|
+
name: e.name
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
async function w(e) {
|
|
202
|
+
e ? await o(await _.readById(e._id)) : j.open(async (r) => {
|
|
203
|
+
await o(void 0, r);
|
|
204
|
+
});
|
|
205
|
+
async function o(r, i) {
|
|
206
|
+
var b;
|
|
207
|
+
(b = F.value) == null || b.showSheet(!0, "VOUCHER", r, i);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async function A(e) {
|
|
211
|
+
var i;
|
|
212
|
+
if (!await he(e.name))
|
|
213
|
+
return;
|
|
214
|
+
const o = await _.readById(e._id), r = ge(o);
|
|
215
|
+
(i = F.value) == null || i.showSheet(
|
|
216
|
+
!0,
|
|
217
|
+
"VOUCHER",
|
|
218
|
+
r,
|
|
219
|
+
o.template
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
async function Z(e) {
|
|
223
|
+
e.campaign._id && await new Promise((o) => {
|
|
224
|
+
I.open({
|
|
225
|
+
title: "Confirmation",
|
|
226
|
+
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
227
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
228
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
229
|
+
}).onPrimary(async () => {
|
|
230
|
+
var r;
|
|
231
|
+
e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
|
|
232
|
+
}).onSecondary(async () => {
|
|
233
|
+
o();
|
|
234
|
+
});
|
|
235
|
+
}), await E(
|
|
236
|
+
async () => {
|
|
237
|
+
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await y.read("VOUCHER");
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
message: a(
|
|
241
|
+
e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
|
|
242
|
+
),
|
|
243
|
+
successMessage: a(
|
|
244
|
+
e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
return ae(async () => {
|
|
250
|
+
await G(async () => {
|
|
251
|
+
await y.read("VOUCHER");
|
|
252
|
+
});
|
|
253
|
+
}), (e, o) => {
|
|
254
|
+
const r = d("FmPageHead"), i = d("FmSearch"), b = d("FmTable"), J = d("FmChip"), g = d("FmButton"), Y = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
|
|
255
|
+
return u(), T(P, null, [
|
|
256
|
+
l(r, {
|
|
257
|
+
title: t(a)("connect.voucher.title"),
|
|
258
|
+
actions: t(C).length > 0 ? [N] : [],
|
|
259
|
+
"onClick:action": o[0] || (o[0] = () => w())
|
|
260
|
+
}, null, 8, ["title", "actions"]),
|
|
261
|
+
c("div", Fe, [
|
|
262
|
+
l(i, {
|
|
263
|
+
modelValue: t(s).searchKey,
|
|
264
|
+
"onUpdate:modelValue": o[1] || (o[1] = (n) => t(s).searchKey = n),
|
|
265
|
+
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
266
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
267
|
+
collapsible: ""
|
|
268
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
269
|
+
t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (u(), T(P, { key: 0 }, [
|
|
270
|
+
c("div", Ve, [
|
|
271
|
+
c("div", Se, [
|
|
272
|
+
l(H, {
|
|
273
|
+
label: `${t(a)("connect.common.location")}: `,
|
|
274
|
+
"right-icon": "keyboard_arrow_down",
|
|
275
|
+
modelValue: t(s).location,
|
|
276
|
+
"onUpdate:modelValue": o[2] || (o[2] = (n) => t(s).location = n),
|
|
277
|
+
icon: "storefront",
|
|
278
|
+
"show-item-label": !0,
|
|
279
|
+
items: t(q).locationOptions
|
|
280
|
+
}, null, 8, ["label", "modelValue", "items"]),
|
|
281
|
+
l(H, {
|
|
282
|
+
label: "Type:",
|
|
283
|
+
"right-icon": "keyboard_arrow_down",
|
|
284
|
+
modelValue: t(s).triggerType,
|
|
285
|
+
"onUpdate:modelValue": o[3] || (o[3] = (n) => t(s).triggerType = n),
|
|
286
|
+
icon: "filter_list",
|
|
287
|
+
"show-item-label": !0,
|
|
288
|
+
items: t(X)
|
|
289
|
+
}, null, 8, ["modelValue", "items"])
|
|
290
|
+
]),
|
|
291
|
+
l(i, {
|
|
292
|
+
modelValue: t(s).searchKey,
|
|
293
|
+
"onUpdate:modelValue": o[4] || (o[4] = (n) => t(s).searchKey = n),
|
|
294
|
+
class: "xs:hidden sm:hidden",
|
|
295
|
+
placeholder: t(a)("connect.voucher.search"),
|
|
296
|
+
collapsible: ""
|
|
297
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
298
|
+
]),
|
|
299
|
+
l(b, {
|
|
300
|
+
class: "xs:hidden sm:hidden",
|
|
301
|
+
"row-data": t(C),
|
|
302
|
+
"column-defs": Q,
|
|
303
|
+
"search-value": t(s).searchKey,
|
|
304
|
+
"column-filter": [],
|
|
305
|
+
onRowClick: o[5] || (o[5] = (n) => w(n.original)),
|
|
306
|
+
"hide-footer": t(C).length < 10
|
|
307
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
308
|
+
l(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
309
|
+
default: R(() => [
|
|
310
|
+
(u(!0), T(P, null, re(t(C).filter(
|
|
311
|
+
(n) => n.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
|
|
312
|
+
), (n) => (u(), h(Y, {
|
|
313
|
+
key: n._id.toString(),
|
|
314
|
+
onClick: (S) => w(n),
|
|
315
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
316
|
+
}, {
|
|
317
|
+
default: R(() => {
|
|
318
|
+
var S;
|
|
319
|
+
return [
|
|
320
|
+
c("div", Ue, [
|
|
321
|
+
c("div", Te, [
|
|
322
|
+
(u(), h(ce(t($)(n)))),
|
|
323
|
+
k(n) ? (u(), h(J, {
|
|
324
|
+
key: 0,
|
|
325
|
+
label: "Feedvibe",
|
|
326
|
+
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
327
|
+
compact: ""
|
|
328
|
+
})) : L("", !0),
|
|
329
|
+
c("div", Pe, v(((S = n.pf_collectible) == null ? void 0 : S.currentReceive) ?? 0) + " claimed ", 1)
|
|
330
|
+
]),
|
|
331
|
+
c("div", Re, [
|
|
332
|
+
c("div", Le, v(n.name), 1),
|
|
333
|
+
c("div", Ie, v(t(D)(n)), 1)
|
|
334
|
+
])
|
|
335
|
+
]),
|
|
336
|
+
c("div", Ee, [
|
|
337
|
+
l(g, {
|
|
338
|
+
icon: "content_copy",
|
|
339
|
+
"icon-color": "neutral-gray-400",
|
|
340
|
+
variant: "tertiary",
|
|
341
|
+
onClick: async (f) => {
|
|
342
|
+
f.stopPropagation(), await A(n);
|
|
343
|
+
}
|
|
344
|
+
}, null, 8, ["onClick"]),
|
|
345
|
+
x(n) ? (u(), h(g, {
|
|
346
|
+
key: 0,
|
|
347
|
+
icon: "visibility",
|
|
348
|
+
"icon-color": "neutral-gray-400",
|
|
349
|
+
variant: "tertiary",
|
|
350
|
+
onClick: async (f) => {
|
|
351
|
+
f.stopPropagation(), await t(B).push({
|
|
352
|
+
name: t(K)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
353
|
+
params: { id: n._id }
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}, null, 8, ["onClick"])) : L("", !0),
|
|
357
|
+
x(n) ? (u(), h(g, {
|
|
358
|
+
key: 1,
|
|
359
|
+
icon: "send",
|
|
360
|
+
"icon-color": "neutral-gray-400",
|
|
361
|
+
variant: "tertiary",
|
|
362
|
+
onClick: (f) => {
|
|
363
|
+
var M;
|
|
364
|
+
f.stopPropagation(), (M = t(V)) == null || M.showSheet({
|
|
365
|
+
campaignId: n._id
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}, null, 8, ["onClick"])) : L("", !0),
|
|
369
|
+
l(g, {
|
|
370
|
+
icon: "delete",
|
|
371
|
+
"icon-color": "neutral-gray-400",
|
|
372
|
+
variant: "tertiary",
|
|
373
|
+
onClick: (f) => (f.stopPropagation(), O(n))
|
|
374
|
+
}, null, 8, ["onClick"])
|
|
375
|
+
])
|
|
376
|
+
];
|
|
377
|
+
}),
|
|
378
|
+
_: 2
|
|
379
|
+
}, 1032, ["onClick"]))), 128))
|
|
380
|
+
]),
|
|
381
|
+
_: 1
|
|
382
|
+
})
|
|
383
|
+
], 64)) : (u(), h(oe, {
|
|
384
|
+
key: 1,
|
|
385
|
+
variant: "outlined",
|
|
386
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
387
|
+
}, {
|
|
388
|
+
default: R(() => [
|
|
389
|
+
o[7] || (o[7] = c("img", {
|
|
390
|
+
src: ie,
|
|
391
|
+
class: "aspect-square w-[150px]"
|
|
392
|
+
}, null, -1)),
|
|
393
|
+
c("div", Be, [
|
|
394
|
+
c("div", Oe, v(t(a)("connect.voucher.createVoucherCampaign")), 1),
|
|
395
|
+
c("div", Ae, v(t(a)("connect.voucher.description")), 1)
|
|
396
|
+
]),
|
|
397
|
+
l(g, {
|
|
398
|
+
variant: "primary",
|
|
399
|
+
label: t(a)("connect.voucher.createVoucherCampaign"),
|
|
400
|
+
icon: "add",
|
|
401
|
+
onClick: o[6] || (o[6] = (n) => w())
|
|
402
|
+
}, null, 8, ["label"])
|
|
403
|
+
]),
|
|
404
|
+
_: 1
|
|
405
|
+
})),
|
|
406
|
+
l(_e, {
|
|
407
|
+
ref_key: "sheetRef",
|
|
408
|
+
ref: F,
|
|
409
|
+
"onSubmit:modelValue": Z
|
|
410
|
+
}, null, 512),
|
|
411
|
+
l(Ce, {
|
|
412
|
+
ref_key: "sendVoucherSheetRef",
|
|
413
|
+
ref: V
|
|
414
|
+
}, null, 512)
|
|
415
|
+
])
|
|
416
|
+
], 64);
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
export {
|
|
421
|
+
ro as default
|
|
422
|
+
};
|