@feedmepos/mf-connect 0.1.38-beta.70 → 0.1.38-beta.72
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/package.json +1 -1
- package/dist/Analytic-qVhEo_im.js +0 -761
- package/dist/App-Ixv1jrHc.js +0 -4638
- package/dist/AuditLogs-B2D62tMF.js +0 -1991
- package/dist/Bin-Lj7jtS9m.js +0 -166
- package/dist/Broadcast-BpP9VJsx.js +0 -267
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BB43gKXv.js +0 -121
- package/dist/Card-CjArjpou.js +0 -909
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CFzUAHxz.js +0 -540
- package/dist/Credit-D43x-T3d.js +0 -261
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js +0 -3167
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-9UhSzClJ.js +0 -351
- package/dist/Experience-BaUbRoHV.js +0 -260
- package/dist/FileSaver.min-BO_rbswB.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-DaVqgPWQ.js +0 -331
- package/dist/GenerateMaterial-DJM8fZyl.js +0 -589
- package/dist/Grab-CykZDrWI.js +0 -301
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-C51yGAp9.js +0 -145
- package/dist/Index-Do3WIIfM.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-BjdBaj4c.js +0 -18737
- package/dist/MainLayout-DD-OlYxZ.js +0 -41
- package/dist/Marketing-C9bsnUaQ.js +0 -145
- package/dist/MarketingMaterialEdit-CbSh8dpn.js +0 -746
- package/dist/Member-IcVRwAAS.js +0 -280
- package/dist/MemberList-C_A4PrQN.js +0 -1605
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-CBoaY-gv.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dx28XNPi.js +0 -60798
- package/dist/Mission-COY_uhwz.js +0 -335
- package/dist/Overview-DDSz2R4K.js +0 -1078
- package/dist/Point-C-KEwgx4.js +0 -263
- package/dist/Promotion-BpW9qWzf.js +0 -397
- package/dist/Queue-CO32O8i6.js +0 -259
- package/dist/Record-BrT5DR9L.js +0 -341
- package/dist/Reward-CbrEw-If.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CpNjlbjZ.js +0 -149
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BS5jsRiN.js +0 -1912
- package/dist/Segment-Cu9_qwXc.js +0 -881
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BH-hzxSs.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DGm3gujH.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DcUb8X-q.js +0 -147
- package/dist/Setting-CQKfb5b_.js +0 -1999
- package/dist/SettingAdvertisements-BxR6Gl-5.js +0 -263
- package/dist/Store-6TUpmqAr.js +0 -1995
- package/dist/StoreRewards-BOThAOWU.js +0 -534
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYD229dz.js +0 -1034
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CAamZtdf.js +0 -7005
- package/dist/Tier-MF-ad-xm.js +0 -969
- package/dist/Title-MkjTHBzb.js +0 -567
- package/dist/Transaction-trYJwTrc.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DwlNK1TC.js +0 -130
- package/dist/Voucher-BD5dTdht.js +0 -422
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BhR_s48Q.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CcTe5TJL.js +0 -56
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-CybjF-6Q.js +0 -59071
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-2hCbD0JX.js +0 -82
- package/dist/campaign-Bv-8uM2S.js +0 -100
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-h1J8NTAo.js +0 -253
- package/dist/campaign.enum-Dea0E4o1.js +0 -26
- package/dist/campaign.fn-DqxZMyu0.js +0 -776
- package/dist/collectible.enum-DOyAoz4F.js +0 -19
- package/dist/collection.fn-DU2HuZod.js +0 -26
- package/dist/dto-CT65-FHY.js +0 -222
- package/dist/duplicateCampaign-YJGHvOqb.js +0 -51
- package/dist/effect-XZ767UQ4.js +0 -89
- package/dist/email-addresses-DSgkxSnV.js +0 -705
- package/dist/export-4gx5C9s9.js +0 -96
- package/dist/feedme.ico +0 -0
- package/dist/helper-HOLsJca3.js +0 -86
- package/dist/index-BO7N-s4K.js +0 -8912
- package/dist/index-BfRa1sI3.js +0 -54
- package/dist/index-BnCtmlvU.js +0 -28897
- package/dist/index-C5VvGYtP.js +0 -56
- package/dist/index-CSzvYzf4.js +0 -3419
- package/dist/index-CrdkPXsx.js +0 -124
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-CxE-VVlL.js +0 -76
- package/dist/index-Djenbz3F.js +0 -3
- package/dist/index-IHteBJ_D.js +0 -32
- package/dist/index-dUhOAfj9.js +0 -2423
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index-wm4nGBB_.js +0 -30289
- package/dist/index-xTrAj026.js +0 -31
- package/dist/index-yViT18i_.js +0 -36
- package/dist/index.esm2017-Wq4FUMEv.js +0 -3069
- package/dist/loading-D22xapd8.js +0 -215
- package/dist/lodash-HM6bxuWV.js +0 -3678
- package/dist/membership-CX464ZBI.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-B3cPZAZu.js +0 -15
- package/dist/number-DT65dEZt.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-DZWw4iLL.js +0 -145
- package/dist/plugins-D-4BlIGs.js +0 -1817
- package/dist/remy-D_Deb3ue.js +0 -13
- package/dist/reward-C6B-kn0X.js +0 -36
- package/dist/rule-B94SrDX1.js +0 -1969
- package/dist/rule-builder-CQ3uHeX4.js +0 -102
- package/dist/style.css +0 -13
- package/dist/template-CXB2Ez2S.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- 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-D3NuV-rx.js +0 -1154
- 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-BsCVC_nU.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-BOZ0-D67.js +0 -223
- package/dist/user-Dxp7kluY.js +0 -55
- package/dist/vue-i18n-DpCWu1gI.js +0 -2365
- package/dist/xlsx-Cc2a2IL9.js +0 -15491
- package/dist/zod-BCSHGdXs.js +0 -91
package/dist/Bin-Lj7jtS9m.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, ref as c, h as s, onMounted as x, resolveComponent as d, openBlock as S, createElementBlock as B, Fragment as M, createVNode as l, unref as o, createElementVNode as u } from "vue";
|
|
2
|
-
import { components as p } from "@feedmepos/ui-library";
|
|
3
|
-
import { u as K } from "./loading-D22xapd8.js";
|
|
4
|
-
import { u as R } from "./business-2hCbD0JX.js";
|
|
5
|
-
import { C as A } from "./campaign-h1J8NTAo.js";
|
|
6
|
-
import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js";
|
|
7
|
-
import { _ as U } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
8
|
-
import { _ as Y } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-DcUb8X-q.js";
|
|
9
|
-
import { u as D } from "./vue-i18n-DpCWu1gI.js";
|
|
10
|
-
import { h as E } from "./moment-D7p2TMB-.js";
|
|
11
|
-
import { p as I } from "./plugins-D-4BlIGs.js";
|
|
12
|
-
import { c as g } from "./index-CrdkPXsx.js";
|
|
13
|
-
const T = { class: "px-24 flex flex-col gap-y-16" }, $ = { class: "flex items-center justify-between w-full" }, j = { class: "flex gap-8 overflow-x-auto" }, oe = /* @__PURE__ */ C({
|
|
14
|
-
__name: "Bin",
|
|
15
|
-
setup(H) {
|
|
16
|
-
const { t: n } = D(), y = R(), { global: _, minor: b } = K, a = c({
|
|
17
|
-
searchKey: "",
|
|
18
|
-
location: null
|
|
19
|
-
}), m = c([]), w = [
|
|
20
|
-
{
|
|
21
|
-
header: n("connect.campaign.common.title"),
|
|
22
|
-
accessorFn: (e) => e.name
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
header: n("connect.campaign.common.campaignType"),
|
|
26
|
-
cell(e) {
|
|
27
|
-
return A[e.row.original.type].chip();
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
header: n("connect.campaign.common.deletedAt"),
|
|
32
|
-
cell(e) {
|
|
33
|
-
return E(e.row.original.deletedAt).format("D MMM YYYY, hh:mmA");
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
header: n("connect.voucher.actions"),
|
|
38
|
-
cell(e) {
|
|
39
|
-
return s("div", { class: "flex items-center justify-end" }, [
|
|
40
|
-
s(
|
|
41
|
-
p.FmMenu,
|
|
42
|
-
{
|
|
43
|
-
placement: "bottom-end",
|
|
44
|
-
onClick: (t) => {
|
|
45
|
-
t.stopPropagation();
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"menu-button": () => s(p.FmButton, {
|
|
50
|
-
icon: "more_vert",
|
|
51
|
-
iconColor: "neutral-gray-400",
|
|
52
|
-
variant: "tertiary"
|
|
53
|
-
}),
|
|
54
|
-
default: () => [
|
|
55
|
-
s(
|
|
56
|
-
p.FmMenuItem,
|
|
57
|
-
{
|
|
58
|
-
icon: "restore",
|
|
59
|
-
onClick: async (i) => {
|
|
60
|
-
i.stopPropagation(), F(e.row.original);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: s(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
class: "fm-typo-en-body-md-400"
|
|
68
|
-
},
|
|
69
|
-
n("connect.campaign.common.actions.restore")
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
]);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
], v = c(), V = c();
|
|
80
|
-
async function F(e) {
|
|
81
|
-
await I.confirm(
|
|
82
|
-
n("connect.campaign.common.restore.confirm", { name: e.name })
|
|
83
|
-
) && await b(
|
|
84
|
-
async () => {
|
|
85
|
-
await g.restore(e._id), await f();
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
message: n("connect.campaign.common.restore.restoring", { name: e.name }),
|
|
89
|
-
successMessage: n("connect.campaign.common.restore.restored", {
|
|
90
|
-
name: e.name
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
async function f() {
|
|
96
|
-
const e = await g.readAllDeleted({
|
|
97
|
-
limit: 1e3,
|
|
98
|
-
skip: 0,
|
|
99
|
-
sortBy: "_id",
|
|
100
|
-
descending: !0
|
|
101
|
-
});
|
|
102
|
-
m.value = e.resources;
|
|
103
|
-
}
|
|
104
|
-
return x(async () => {
|
|
105
|
-
await _(async () => {
|
|
106
|
-
await f();
|
|
107
|
-
});
|
|
108
|
-
}), (e, t) => {
|
|
109
|
-
const i = d("FmPageHead"), h = d("FmSearch"), k = d("FmTable");
|
|
110
|
-
return S(), B(M, null, [
|
|
111
|
-
l(i, {
|
|
112
|
-
title: o(n)("connect.bin.title")
|
|
113
|
-
}, null, 8, ["title"]),
|
|
114
|
-
u("div", T, [
|
|
115
|
-
l(h, {
|
|
116
|
-
modelValue: o(a).searchKey,
|
|
117
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) => o(a).searchKey = r),
|
|
118
|
-
class: "hidden xs:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
119
|
-
placeholder: o(n)("connect.voucher.search"),
|
|
120
|
-
collapsible: ""
|
|
121
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
122
|
-
u("div", $, [
|
|
123
|
-
u("div", j, [
|
|
124
|
-
l(U, {
|
|
125
|
-
modelValue: o(a).location,
|
|
126
|
-
"onUpdate:modelValue": t[1] || (t[1] = (r) => o(a).location = r),
|
|
127
|
-
label: o(n)("connect.voucher.location"),
|
|
128
|
-
"show-item-label": !0,
|
|
129
|
-
icon: "storefront",
|
|
130
|
-
placement: "bottom-start",
|
|
131
|
-
items: o(y).locationItems
|
|
132
|
-
}, null, 8, ["modelValue", "label", "items"])
|
|
133
|
-
]),
|
|
134
|
-
l(h, {
|
|
135
|
-
modelValue: o(a).searchKey,
|
|
136
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) => o(a).searchKey = r),
|
|
137
|
-
class: "xs:hidden",
|
|
138
|
-
placeholder: o(n)("connect.voucher.search"),
|
|
139
|
-
collapsible: ""
|
|
140
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
141
|
-
]),
|
|
142
|
-
l(k, {
|
|
143
|
-
"row-data": o(m),
|
|
144
|
-
"column-defs": w,
|
|
145
|
-
"search-value": o(a).searchKey,
|
|
146
|
-
"column-filter": [],
|
|
147
|
-
onRowClick: t[3] || (t[3] = (r) => e.onEdit(r.original)),
|
|
148
|
-
"hide-footer": o(m).length < 10
|
|
149
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
150
|
-
l(P, {
|
|
151
|
-
ref_key: "sheetRef",
|
|
152
|
-
ref: v,
|
|
153
|
-
"onSubmit:modelValue": e.onUpdate
|
|
154
|
-
}, null, 8, ["onSubmit:modelValue"]),
|
|
155
|
-
l(Y, {
|
|
156
|
-
ref_key: "sendVoucherSheetRef",
|
|
157
|
-
ref: V
|
|
158
|
-
}, null, 512)
|
|
159
|
-
])
|
|
160
|
-
], 64);
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
export {
|
|
165
|
-
oe as default
|
|
166
|
-
};
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, ref as C, computed as q, onMounted as z, resolveComponent as m, openBlock as d, createElementBlock as h, Fragment as v, createVNode as i, unref as a, createElementVNode as n, withCtx as x, renderList as G, createBlock as S, resolveDynamicComponent as J, toDisplayString as u, createCommentVNode as Q, h as k } from "vue";
|
|
2
|
-
import { _ as W } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as X, components as L } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as Y } from "./plugins-D-4BlIGs.js";
|
|
5
|
-
import { u as Z } from "./loading-D22xapd8.js";
|
|
6
|
-
import { u as ee } from "./business-2hCbD0JX.js";
|
|
7
|
-
import { u as te } from "./campaign-Bv-8uM2S.js";
|
|
8
|
-
import { b as V, c as R, a as ae } from "./campaign-h1J8NTAo.js";
|
|
9
|
-
import { c as oe, p as ne } from "./duplicateCampaign-YJGHvOqb.js";
|
|
10
|
-
import { u as se } from "./vue-i18n-DpCWu1gI.js";
|
|
11
|
-
import { _ as ce } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
12
|
-
import { _ as ie } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js";
|
|
13
|
-
import { u as re } from "./template-CXB2Ez2S.js";
|
|
14
|
-
import { c as f } from "./index-CrdkPXsx.js";
|
|
15
|
-
const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, ue = { class: "flex w-full gap-4 items-center" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex items-center gap-8" }, we = { key: 0 }, be = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, Ce = { class: "flex flex-col gap-16 text-center" }, ve = { class: "fm-typo-en-title-sm-800" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, je = /* @__PURE__ */ H({
|
|
16
|
-
__name: "Broadcast",
|
|
17
|
-
setup(Se) {
|
|
18
|
-
const { t: s } = se(), O = {
|
|
19
|
-
label: s("connect.campaign.common.createCampaign"),
|
|
20
|
-
value: "create",
|
|
21
|
-
isPrimary: !0,
|
|
22
|
-
prependIcon: "add"
|
|
23
|
-
}, T = re("BROADCAST", X()), I = ee(), p = te(), { global: K, minor: F } = Z, B = C((/* @__PURE__ */ new Date()).toISOString()), r = C({
|
|
24
|
-
searchKey: "",
|
|
25
|
-
location: []
|
|
26
|
-
});
|
|
27
|
-
function P(e) {
|
|
28
|
-
const t = r.value.location;
|
|
29
|
-
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
|
|
30
|
-
var c;
|
|
31
|
-
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
|
|
32
|
-
}) : e.targetLocation.includes(t);
|
|
33
|
-
}
|
|
34
|
-
const g = q(
|
|
35
|
-
() => p.campaigns.broadcast.filter((e) => P(e))
|
|
36
|
-
), $ = [
|
|
37
|
-
{
|
|
38
|
-
header: "Broadcast title",
|
|
39
|
-
accessorFn: (e) => e.name
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
header: "Status",
|
|
43
|
-
accessorFn: (e) => ae(e),
|
|
44
|
-
cell(e) {
|
|
45
|
-
return V(e.row.original);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
header: "Summary",
|
|
50
|
-
accessorFn: (e) => R(e)
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
header: "Message sent",
|
|
54
|
-
accessorFn: (e) => e.currentReceive ?? "N/A"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
header: "Actions",
|
|
58
|
-
cell(e) {
|
|
59
|
-
return k("div", { class: "flex items-center gap-8 justify-end" }, [
|
|
60
|
-
k(L.FmButton, {
|
|
61
|
-
variant: "tertiary",
|
|
62
|
-
icon: "content_copy",
|
|
63
|
-
iconColor: "neutral-gray-400",
|
|
64
|
-
onClick: async (t) => {
|
|
65
|
-
t.stopPropagation(), await D(e.row.original);
|
|
66
|
-
}
|
|
67
|
-
}),
|
|
68
|
-
k(L.FmButton, {
|
|
69
|
-
variant: "tertiary",
|
|
70
|
-
icon: "delete",
|
|
71
|
-
iconColor: "neutral-gray-400",
|
|
72
|
-
onClick: (t) => {
|
|
73
|
-
t.stopPropagation(), A(e.row.original);
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
]);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
], w = C();
|
|
80
|
-
async function A(e) {
|
|
81
|
-
await Y.remove(
|
|
82
|
-
s("connect.campaign.common.remove.confirm", { name: e.name })
|
|
83
|
-
) && await F(
|
|
84
|
-
async () => {
|
|
85
|
-
await f.delete(e._id), await p.read("BROADCAST");
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
message: s("connect.campaign.common.remove.removing", { name: e.name }),
|
|
89
|
-
successMessage: s("connect.campaign.common.remove.removed", {
|
|
90
|
-
name: e.name
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
async function y(e) {
|
|
96
|
-
B.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : T.open(async (l) => {
|
|
97
|
-
await t(l);
|
|
98
|
-
});
|
|
99
|
-
async function t(l) {
|
|
100
|
-
var c;
|
|
101
|
-
(c = w.value) == null || c.showSheet(
|
|
102
|
-
!0,
|
|
103
|
-
"BROADCAST",
|
|
104
|
-
e ? await f.readById(e._id) : void 0,
|
|
105
|
-
l
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async function D(e) {
|
|
110
|
-
var c;
|
|
111
|
-
if (!await oe(e.name))
|
|
112
|
-
return;
|
|
113
|
-
B.value = (/* @__PURE__ */ new Date()).toISOString();
|
|
114
|
-
const t = await f.readById(e._id), l = ne(t);
|
|
115
|
-
(c = w.value) == null || c.showSheet(
|
|
116
|
-
!0,
|
|
117
|
-
"BROADCAST",
|
|
118
|
-
l,
|
|
119
|
-
t.template
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
async function j(e) {
|
|
123
|
-
await F(
|
|
124
|
-
async () => {
|
|
125
|
-
e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("BROADCAST");
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
message: s(
|
|
129
|
-
`connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
|
|
130
|
-
),
|
|
131
|
-
successMessage: s("connect.campaign.broadcast.update.success", {
|
|
132
|
-
action: e.campaign._id ? "updated" : "created"
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return z(async () => {
|
|
138
|
-
await K(async () => {
|
|
139
|
-
await p.read("BROADCAST");
|
|
140
|
-
});
|
|
141
|
-
}), (e, t) => {
|
|
142
|
-
const l = m("FmPageHead"), c = m("FmSearch"), M = m("FmTable"), b = m("FmButton"), N = m("FmListItem"), U = m("FmList"), E = m("FmCard");
|
|
143
|
-
return d(), h(v, null, [
|
|
144
|
-
i(l, {
|
|
145
|
-
title: a(s)("connect.campaign.broadcast.title"),
|
|
146
|
-
actions: a(g).length > 0 ? [O] : [],
|
|
147
|
-
"onClick:action": t[0] || (t[0] = () => y())
|
|
148
|
-
}, null, 8, ["title", "actions"]),
|
|
149
|
-
n("div", le, [
|
|
150
|
-
i(c, {
|
|
151
|
-
modelValue: a(r).searchKey,
|
|
152
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) => a(r).searchKey = o),
|
|
153
|
-
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
154
|
-
placeholder: a(s)("connect.campaign.common.search"),
|
|
155
|
-
collapsible: ""
|
|
156
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
157
|
-
a(p).campaigns.broadcast && a(p).campaigns.broadcast.length > 0 ? (d(), h(v, { key: 0 }, [
|
|
158
|
-
n("div", me, [
|
|
159
|
-
n("div", de, [
|
|
160
|
-
i(ce, {
|
|
161
|
-
label: `${a(s)("connect.campaign.common.location")}: `,
|
|
162
|
-
"right-icon": "keyboard_arrow_down",
|
|
163
|
-
modelValue: a(r).location,
|
|
164
|
-
"onUpdate:modelValue": t[2] || (t[2] = (o) => a(r).location = o),
|
|
165
|
-
icon: "storefront",
|
|
166
|
-
"show-item-label": !0,
|
|
167
|
-
items: a(I).locationOptions
|
|
168
|
-
}, null, 8, ["label", "modelValue", "items"])
|
|
169
|
-
]),
|
|
170
|
-
i(c, {
|
|
171
|
-
modelValue: a(r).searchKey,
|
|
172
|
-
"onUpdate:modelValue": t[3] || (t[3] = (o) => a(r).searchKey = o),
|
|
173
|
-
class: "xs:hidden sm:hidden",
|
|
174
|
-
placeholder: "search",
|
|
175
|
-
collapsible: ""
|
|
176
|
-
}, null, 8, ["modelValue"])
|
|
177
|
-
]),
|
|
178
|
-
i(M, {
|
|
179
|
-
class: "xs:hidden sm:hidden",
|
|
180
|
-
"row-data": a(g),
|
|
181
|
-
"column-defs": $,
|
|
182
|
-
"search-value": a(r).searchKey,
|
|
183
|
-
"column-filter": [],
|
|
184
|
-
onRowClick: t[4] || (t[4] = (o) => y(o.original)),
|
|
185
|
-
"hide-footer": !0
|
|
186
|
-
}, null, 8, ["row-data", "search-value"]),
|
|
187
|
-
i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
188
|
-
default: x(() => [
|
|
189
|
-
(d(!0), h(v, null, G(a(g).filter(
|
|
190
|
-
(o) => o.name.toLowerCase().includes(a(r).searchKey.toLowerCase())
|
|
191
|
-
), (o) => (d(), S(N, {
|
|
192
|
-
key: o._id.toString(),
|
|
193
|
-
onClick: (_) => y(o),
|
|
194
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
195
|
-
}, {
|
|
196
|
-
default: x(() => [
|
|
197
|
-
n("div", pe, [
|
|
198
|
-
n("div", ue, [
|
|
199
|
-
(d(), S(J(a(V)(o)))),
|
|
200
|
-
n("div", fe, u(o.currentReceive ?? 0) + " sent ", 1)
|
|
201
|
-
]),
|
|
202
|
-
n("div", ge, [
|
|
203
|
-
n("div", ye, u(o.name), 1),
|
|
204
|
-
n("div", _e, u(a(R)(o)), 1)
|
|
205
|
-
])
|
|
206
|
-
]),
|
|
207
|
-
n("div", he, [
|
|
208
|
-
i(b, {
|
|
209
|
-
icon: "content_copy",
|
|
210
|
-
"icon-color": "neutral-gray-400",
|
|
211
|
-
variant: "tertiary",
|
|
212
|
-
onClick: async (_) => {
|
|
213
|
-
_.stopPropagation(), await D(o);
|
|
214
|
-
}
|
|
215
|
-
}, null, 8, ["onClick"]),
|
|
216
|
-
i(b, {
|
|
217
|
-
icon: "delete",
|
|
218
|
-
"icon-color": "neutral-gray-400",
|
|
219
|
-
variant: "tertiary",
|
|
220
|
-
onClick: (_) => (_.stopPropagation(), A(o))
|
|
221
|
-
}, null, 8, ["onClick"])
|
|
222
|
-
])
|
|
223
|
-
]),
|
|
224
|
-
_: 2
|
|
225
|
-
}, 1032, ["onClick"]))), 128))
|
|
226
|
-
]),
|
|
227
|
-
_: 1
|
|
228
|
-
}),
|
|
229
|
-
a(g).length == 0 ? (d(), h("div", we, [
|
|
230
|
-
n("div", be, u(a(s)("connect.campaign.common.noResults")), 1)
|
|
231
|
-
])) : Q("", !0)
|
|
232
|
-
], 64)) : (d(), S(E, {
|
|
233
|
-
key: 1,
|
|
234
|
-
variant: "outlined",
|
|
235
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
236
|
-
}, {
|
|
237
|
-
default: x(() => [
|
|
238
|
-
t[6] || (t[6] = n("img", {
|
|
239
|
-
src: W,
|
|
240
|
-
class: "aspect-square w-[150px]"
|
|
241
|
-
}, null, -1)),
|
|
242
|
-
n("div", Ce, [
|
|
243
|
-
n("div", ve, u(a(s)("connect.campaign.broadcast.create.title")), 1),
|
|
244
|
-
n("div", xe, u(a(s)("connect.campaign.broadcast.create.description")), 1)
|
|
245
|
-
]),
|
|
246
|
-
i(b, {
|
|
247
|
-
variant: "primary",
|
|
248
|
-
label: a(s)("connect.campaign.broadcast.create.button"),
|
|
249
|
-
icon: "add",
|
|
250
|
-
onClick: t[5] || (t[5] = (o) => y())
|
|
251
|
-
}, null, 8, ["label"])
|
|
252
|
-
]),
|
|
253
|
-
_: 1
|
|
254
|
-
})),
|
|
255
|
-
i(ie, {
|
|
256
|
-
ref_key: "sheetRef",
|
|
257
|
-
ref: w,
|
|
258
|
-
"onSubmit:modelValue": j
|
|
259
|
-
}, null, 512)
|
|
260
|
-
])
|
|
261
|
-
], 64);
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
export {
|
|
266
|
-
je as default
|
|
267
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { R as RuleOperator, _ } from "./index-BO7N-s4K.js";
|
|
2
|
-
import { i as isRuleGroup } from "./rule-builder-CQ3uHeX4.js";
|
|
3
|
-
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
|
|
4
|
-
import { useDialog } from "@feedmepos/ui-library";
|
|
5
|
-
import "./index-dUhOAfj9.js";
|
|
6
|
-
import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-CSzvYzf4.js";
|
|
7
|
-
import "./index-wm4nGBB_.js";
|
|
8
|
-
import "./index-BfRa1sI3.js";
|
|
9
|
-
function validateRule(data, r, date) {
|
|
10
|
-
const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
|
|
11
|
-
function meetConditions(e) {
|
|
12
|
-
return Object.entries(e.conditions ?? {}).reduce(
|
|
13
|
-
(o, [n, t]) => {
|
|
14
|
-
const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
|
|
15
|
-
if (t == null)
|
|
16
|
-
return console.log("Bad data, ignoring rule", {
|
|
17
|
-
// property: r.property,
|
|
18
|
-
// source,
|
|
19
|
-
conditionKey: n,
|
|
20
|
-
equator: t
|
|
21
|
-
// raw: data,
|
|
22
|
-
}), o;
|
|
23
|
-
const i = rules[n](
|
|
24
|
-
l,
|
|
25
|
-
t
|
|
26
|
-
);
|
|
27
|
-
return o && i;
|
|
28
|
-
},
|
|
29
|
-
!0
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
function evaluateRuleResult(rr, logic) {
|
|
33
|
-
const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
|
|
34
|
-
return !logic || !!eval(target);
|
|
35
|
-
}
|
|
36
|
-
function getRuleResults(e) {
|
|
37
|
-
return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
|
|
38
|
-
...o,
|
|
39
|
-
[n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
|
|
40
|
-
}), {}) : {
|
|
41
|
-
[e.name]: meetConditions(e)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
|
|
45
|
-
}
|
|
46
|
-
const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = { class: "fm-typo-en-title-sm-600" }, _hoisted_3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
|
-
__name: "CampaignTypeDialog",
|
|
48
|
-
props: {
|
|
49
|
-
onSelect: {
|
|
50
|
-
type: Function,
|
|
51
|
-
required: !0
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
setup(e) {
|
|
55
|
-
const o = e, n = useDialog(), t = [
|
|
56
|
-
{
|
|
57
|
-
title: "Promotion",
|
|
58
|
-
description: "Special offers or deals made available for a limited time",
|
|
59
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: "Voucher",
|
|
63
|
-
description: "A digital coupon that can be redeemed for a discounts on future purchases.",
|
|
64
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
title: "Experience",
|
|
68
|
-
description: "Experience points help customers gain membership tiers.",
|
|
69
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
title: "Point",
|
|
73
|
-
description: "Points allow customers to purchase bundle items.",
|
|
74
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
title: "Game",
|
|
78
|
-
description: "The game feature adds a fun and encourage customers to engage more.",
|
|
79
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
title: "Credit",
|
|
83
|
-
description: "Credits are virtual money that customers can use to pay for their purchases.",
|
|
84
|
-
value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
|
|
85
|
-
}
|
|
86
|
-
];
|
|
87
|
-
function l(i) {
|
|
88
|
-
n.close(), o.onSelect(i);
|
|
89
|
-
}
|
|
90
|
-
return (i, a) => {
|
|
91
|
-
const c = resolveComponent("FmCard");
|
|
92
|
-
return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
|
|
93
|
-
default: withCtx(() => [
|
|
94
|
-
a[0] || (a[0] = createElementVNode("div", { class: "" }, [
|
|
95
|
-
createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
|
|
96
|
-
createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Select the benefit type that you want to reward the selected tier. ")
|
|
97
|
-
], -1)),
|
|
98
|
-
createElementVNode("div", _hoisted_1, [
|
|
99
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
|
|
100
|
-
variant: "outlined",
|
|
101
|
-
key: s.value,
|
|
102
|
-
onClick: (u) => l(s.value),
|
|
103
|
-
class: "p-16 space-y-8 cursor-pointer"
|
|
104
|
-
}, {
|
|
105
|
-
default: withCtx(() => [
|
|
106
|
-
createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
|
|
107
|
-
createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
|
|
108
|
-
]),
|
|
109
|
-
_: 2
|
|
110
|
-
}, 1032, ["onClick"])), 64))
|
|
111
|
-
])
|
|
112
|
-
]),
|
|
113
|
-
_: 1
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
export {
|
|
119
|
-
_sfc_main as _,
|
|
120
|
-
validateRule as v
|
|
121
|
-
};
|