@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-D1vIDmhJ.js +620 -0
- package/dist/{App-SRz4257n.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-BwT3zE2a.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-CJ9-d8Zg.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-DZCpvg4q.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-Cg2pTZJK.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-Cw_qGw8y.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-winsqufa.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CI5Llblg.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-CdkrIYgX.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-DGxfief1.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-B8RqcTNu.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-Cw_aXFH6.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-wzdbEEcZ.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CjVmULNd.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-HZC9LLAX.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-OzicErwL.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-DAEmawcj.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-9w43_U1v.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-BaozRfWB.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-A34xEz20.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-BLACZ3-L.js → index-FvlaxwGB.js} +20 -20
- package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-DuEFUCwF.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-nsMtWeTC.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-CPIMqt1h.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSs5XRKP.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CJZoYavu.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-BZlnYinX.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-5QztrYSp.js +0 -622
- package/dist/Broadcast-DmkrJGp2.js +0 -223
- package/dist/Card-BsjFTVsH.js +0 -825
- package/dist/Collections-7wqZHOax.js +0 -453
- package/dist/Credit-CcNrq9qk.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js +0 -345
- package/dist/Experience-DNsQLzDH.js +0 -221
- package/dist/Game-DlzDerT7.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-BqhpaG4o.js +0 -316
- package/dist/Member-AFgZcdtz.js +0 -69
- package/dist/MemberList-BKgrLz2C.js +0 -1733
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js +0 -432
- package/dist/Mission-BTAia7AS.js +0 -261
- package/dist/Point-Ck8EG_3k.js +0 -222
- package/dist/Promotion-0v3kvsK3.js +0 -247
- package/dist/Segment-BenLupqV.js +0 -437
- package/dist/Setting-0fpREqpJ.js +0 -1901
- package/dist/Store-BDGwe4ar.js +0 -1511
- package/dist/StoreRewards-TDZt9H1V.js +0 -401
- package/dist/Transaction-DpnTxlbf.js +0 -39
- package/dist/Voucher-DsP_rh8I.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js +0 -56
- package/dist/app-DzAexOqx.js +0 -5639
- package/dist/dto-ozu1smC3.js +0 -2770
- package/dist/index-CZgQVRsm.js +0 -3
- package/dist/index-Oxr-mU6h.js +0 -29193
- package/dist/money-BGZPFtUc.js +0 -15
- package/dist/number-4J0xvXP9.js +0 -12
- package/dist/vue-i18n-CCyiVzOE.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Mission-BTAia7AS.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as V, computed as E, h as m, onMounted as A, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as b, createVNode as c, unref as t, createElementVNode as s, withCtx as w, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as G, components as v } from "@feedmepos/ui-library";
|
|
4
|
-
import { a as J, p as Q, u as W } from "./loading-DuEFUCwF.js";
|
|
5
|
-
import { u as X } from "./business-Cw_qGw8y.js";
|
|
6
|
-
import { u as Y } from "./campaign-winsqufa.js";
|
|
7
|
-
import { g as L, b as M } from "./dto-ozu1smC3.js";
|
|
8
|
-
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js";
|
|
10
|
-
import { u as oe } from "./template-CJZoYavu.js";
|
|
11
|
-
import { s as te } from "./index-CuvNtC_M.js";
|
|
12
|
-
import { u as ne } from "./vue-i18n-CCyiVzOE.js";
|
|
13
|
-
import { c as _ } from "./index-CjVmULNd.js";
|
|
14
|
-
const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ $({
|
|
15
|
-
__name: "Mission",
|
|
16
|
-
setup(_e) {
|
|
17
|
-
const { t: n } = ne(), B = {
|
|
18
|
-
label: n("connect.program.common.actions.create", {
|
|
19
|
-
type: n("connect.program.mission.title").toLowerCase()
|
|
20
|
-
}),
|
|
21
|
-
value: "create",
|
|
22
|
-
isPrimary: !0,
|
|
23
|
-
prependIcon: "add"
|
|
24
|
-
}, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, i = V({
|
|
25
|
-
searchKey: "",
|
|
26
|
-
location: null
|
|
27
|
-
}), u = E(
|
|
28
|
-
() => l.campaigns.mission.filter(
|
|
29
|
-
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
30
|
-
)
|
|
31
|
-
), R = [
|
|
32
|
-
{
|
|
33
|
-
header: n("connect.program.common.table.title"),
|
|
34
|
-
accessorKey: "name",
|
|
35
|
-
// accessorFn: (v) => v.name,
|
|
36
|
-
cell(e) {
|
|
37
|
-
return m("div", { class: "flex items-center justify-between gap-4" }, [
|
|
38
|
-
m("div", { class: "flex items-center" }, [
|
|
39
|
-
m(
|
|
40
|
-
v.FmTooltip,
|
|
41
|
-
{
|
|
42
|
-
content: e.row.original._id,
|
|
43
|
-
onClick: (o) => {
|
|
44
|
-
o.stopPropagation(), J(e.row.original._id);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
[
|
|
48
|
-
m(v.FmIcon, {
|
|
49
|
-
name: "info",
|
|
50
|
-
outline: !0,
|
|
51
|
-
size: "sm"
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
)
|
|
55
|
-
]),
|
|
56
|
-
m("div", { class: "flex-1" }, e.row.original.name)
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
header: n("connect.campaign.mission.type"),
|
|
62
|
-
accessorFn: (e) => te(e.mission.type)
|
|
63
|
-
//v.effect,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
header: n("connect.program.common.table.status"),
|
|
67
|
-
cell(e) {
|
|
68
|
-
return L(e.row.original);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
header: n("connect.program.common.table.summary"),
|
|
73
|
-
accessorFn: (e) => M(e)
|
|
74
|
-
//v.effect,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
header: n("connect.campaign.mission.received"),
|
|
78
|
-
accessorFn: (e) => {
|
|
79
|
-
var o;
|
|
80
|
-
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
header: n("connect.program.common.table.actions"),
|
|
85
|
-
cell(e) {
|
|
86
|
-
return m(v.FmButton, {
|
|
87
|
-
variant: "tertiary",
|
|
88
|
-
icon: "delete",
|
|
89
|
-
iconColor: "neutral-gray-400",
|
|
90
|
-
onClick: (o) => {
|
|
91
|
-
o.stopPropagation(), F(e.row.original);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
], S = V();
|
|
97
|
-
async function F(e) {
|
|
98
|
-
await Q.remove(
|
|
99
|
-
n("connect.program.common.remove.confirm", { name: e.name })
|
|
100
|
-
) && await C(
|
|
101
|
-
async () => {
|
|
102
|
-
await _.delete(e._id), await l.read("MISSION");
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
message: n("connect.program.common.remove.removing", { name: e.name }),
|
|
106
|
-
successMessage: n("connect.program.common.remove.removed", {
|
|
107
|
-
name: e.name
|
|
108
|
-
})
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
async function y(e) {
|
|
113
|
-
e ? await o() : K.open(async (f) => {
|
|
114
|
-
await o(f);
|
|
115
|
-
});
|
|
116
|
-
async function o(f) {
|
|
117
|
-
var g;
|
|
118
|
-
(g = S.value) == null || g.showSheet(
|
|
119
|
-
!0,
|
|
120
|
-
"MISSION",
|
|
121
|
-
e ? await _.readById(e._id) : void 0,
|
|
122
|
-
f
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
async function T(e) {
|
|
127
|
-
await C(
|
|
128
|
-
async () => {
|
|
129
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
message: n(
|
|
133
|
-
e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
|
|
134
|
-
{ type: "Mission" }
|
|
135
|
-
),
|
|
136
|
-
successMessage: n("connect.program.common.update.success", {
|
|
137
|
-
type: "Mission",
|
|
138
|
-
action: e.campaign._id ? "updated" : "created"
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
return A(async () => {
|
|
144
|
-
await P(async () => {
|
|
145
|
-
await l.read("MISSION"), console.log(u);
|
|
146
|
-
});
|
|
147
|
-
}), (e, o) => {
|
|
148
|
-
const f = r("FmPageHead"), g = r("FmSearch"), O = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
|
|
149
|
-
return d(), h(b, null, [
|
|
150
|
-
c(f, {
|
|
151
|
-
title: t(n)("connect.campaign.mission.title"),
|
|
152
|
-
actions: t(u).length > 0 ? [B] : [],
|
|
153
|
-
"onClick:action": o[0] || (o[0] = () => y())
|
|
154
|
-
}, null, 8, ["title", "actions"]),
|
|
155
|
-
s("div", ae, [
|
|
156
|
-
c(g, {
|
|
157
|
-
modelValue: t(i).searchKey,
|
|
158
|
-
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
|
|
159
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
160
|
-
placeholder: t(n)("connect.program.common.search"),
|
|
161
|
-
collapsible: ""
|
|
162
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
163
|
-
t(l).campaigns.mission && t(l).campaigns.mission.length > 0 ? (d(), h(b, { key: 0 }, [
|
|
164
|
-
s("div", se, [
|
|
165
|
-
s("div", ie, [
|
|
166
|
-
c(Z, {
|
|
167
|
-
modelValue: t(i).location,
|
|
168
|
-
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
|
|
169
|
-
label: t(n)("connect.program.common.location"),
|
|
170
|
-
"show-item-label": !0,
|
|
171
|
-
icon: "storefront",
|
|
172
|
-
placement: "bottom-start",
|
|
173
|
-
items: t(N).locationItems
|
|
174
|
-
}, null, 8, ["modelValue", "label", "items"])
|
|
175
|
-
]),
|
|
176
|
-
c(g, {
|
|
177
|
-
modelValue: t(i).searchKey,
|
|
178
|
-
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
|
|
179
|
-
class: "xs:hidden",
|
|
180
|
-
placeholder: "search",
|
|
181
|
-
collapsible: ""
|
|
182
|
-
}, null, 8, ["modelValue"])
|
|
183
|
-
]),
|
|
184
|
-
c(O, {
|
|
185
|
-
class: "xs:hidden",
|
|
186
|
-
"row-data": t(u),
|
|
187
|
-
"column-defs": R,
|
|
188
|
-
"search-value": t(i).searchKey,
|
|
189
|
-
"column-filter": [],
|
|
190
|
-
onRowClick: o[4] || (o[4] = (a) => y(a.original)),
|
|
191
|
-
"hide-footer": t(u).length < 10
|
|
192
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
193
|
-
c(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
194
|
-
default: w(() => [
|
|
195
|
-
(d(!0), h(b, null, H(t(u).filter(
|
|
196
|
-
(a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
197
|
-
), (a) => (d(), x(j, {
|
|
198
|
-
key: a._id.toString(),
|
|
199
|
-
onClick: (I) => y(a),
|
|
200
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
201
|
-
}, {
|
|
202
|
-
default: w(() => [
|
|
203
|
-
s("div", ce, [
|
|
204
|
-
s("div", re, [
|
|
205
|
-
(d(), x(q(t(L)(a)))),
|
|
206
|
-
s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
|
|
207
|
-
]),
|
|
208
|
-
s("div", me, [
|
|
209
|
-
s("div", de, p(a.name), 1),
|
|
210
|
-
s("div", pe, p(t(M)(a)), 1)
|
|
211
|
-
]),
|
|
212
|
-
s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
|
|
213
|
-
]),
|
|
214
|
-
c(k, {
|
|
215
|
-
icon: "delete",
|
|
216
|
-
"icon-color": "neutral-gray-400",
|
|
217
|
-
variant: "tertiary",
|
|
218
|
-
onClick: (I) => (I.stopPropagation(), F(a))
|
|
219
|
-
}, null, 8, ["onClick"])
|
|
220
|
-
]),
|
|
221
|
-
_: 2
|
|
222
|
-
}, 1032, ["onClick"]))), 128))
|
|
223
|
-
]),
|
|
224
|
-
_: 1
|
|
225
|
-
})
|
|
226
|
-
], 64)) : (d(), x(U, {
|
|
227
|
-
key: 1,
|
|
228
|
-
variant: "outlined",
|
|
229
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
230
|
-
}, {
|
|
231
|
-
default: w(() => [
|
|
232
|
-
o[6] || (o[6] = s("img", {
|
|
233
|
-
src: z,
|
|
234
|
-
class: "aspect-square w-[150px]"
|
|
235
|
-
}, null, -1)),
|
|
236
|
-
s("div", fe, [
|
|
237
|
-
s("div", ge, p(t(n)("connect.campaign.mission.createProgram")), 1),
|
|
238
|
-
s("div", ye, p(t(n)("connect.campaign.mission.description")), 1)
|
|
239
|
-
]),
|
|
240
|
-
c(k, {
|
|
241
|
-
variant: "primary",
|
|
242
|
-
label: t(n)("connect.campaign.mission.create"),
|
|
243
|
-
icon: "add",
|
|
244
|
-
onClick: o[5] || (o[5] = (a) => y())
|
|
245
|
-
}, null, 8, ["label"])
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
})),
|
|
249
|
-
c(ee, {
|
|
250
|
-
ref_key: "sheetRef",
|
|
251
|
-
ref: S,
|
|
252
|
-
"onSubmit:modelValue": T
|
|
253
|
-
}, null, 512)
|
|
254
|
-
])
|
|
255
|
-
], 64);
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
export {
|
|
260
|
-
Be as default
|
|
261
|
-
};
|
package/dist/Point-Ck8EG_3k.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent as q } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as Q, u as W } from "./loading-DuEFUCwF.js";
|
|
5
|
-
import { u as X } from "./business-Cw_qGw8y.js";
|
|
6
|
-
import { u as Y } from "./campaign-winsqufa.js";
|
|
7
|
-
import { g as I, b as P } from "./dto-ozu1smC3.js";
|
|
8
|
-
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js";
|
|
10
|
-
import { u as te } from "./template-CJZoYavu.js";
|
|
11
|
-
import { u as oe } from "./vue-i18n-CCyiVzOE.js";
|
|
12
|
-
import { c as _ } from "./index-CjVmULNd.js";
|
|
13
|
-
const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
|
|
14
|
-
__name: "Point",
|
|
15
|
-
setup(he) {
|
|
16
|
-
const { t: s } = oe(), B = {
|
|
17
|
-
label: s("connect.program.common.actions.create", {
|
|
18
|
-
type: s("connect.program.point.title").toLowerCase()
|
|
19
|
-
}),
|
|
20
|
-
value: "create",
|
|
21
|
-
isPrimary: !0,
|
|
22
|
-
prependIcon: "add"
|
|
23
|
-
}, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
|
|
24
|
-
searchKey: "",
|
|
25
|
-
location: null
|
|
26
|
-
}), u = A(
|
|
27
|
-
() => m.campaigns.point.filter(
|
|
28
|
-
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
29
|
-
)
|
|
30
|
-
), N = [
|
|
31
|
-
{
|
|
32
|
-
header: s("connect.program.common.table.title"),
|
|
33
|
-
accessorFn: (e) => e.name
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
header: s("connect.program.common.table.status"),
|
|
37
|
-
cell(e) {
|
|
38
|
-
return I(e.row.original);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
header: s("connect.program.common.table.summary"),
|
|
43
|
-
accessorFn: (e) => P(e)
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
header: s("connect.program.common.table.actions"),
|
|
47
|
-
cell(e) {
|
|
48
|
-
return E(J.FmButton, {
|
|
49
|
-
variant: "tertiary",
|
|
50
|
-
icon: "delete",
|
|
51
|
-
iconColor: "neutral-gray-400",
|
|
52
|
-
onClick: (o) => {
|
|
53
|
-
o.stopPropagation(), F(e.row.original);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
], v = V();
|
|
59
|
-
async function F(e) {
|
|
60
|
-
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
|
|
61
|
-
async () => {
|
|
62
|
-
await _.delete(e._id), await m.read("COIN");
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
message: `Removing ${e.name}`,
|
|
66
|
-
successMessage: `Removed ${e.name} successfully`
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
async function f(e) {
|
|
71
|
-
e ? await o() : $.open(async (p) => {
|
|
72
|
-
await o(p);
|
|
73
|
-
});
|
|
74
|
-
async function o(p) {
|
|
75
|
-
var y;
|
|
76
|
-
(y = v.value) == null || y.showSheet(
|
|
77
|
-
!0,
|
|
78
|
-
"COIN",
|
|
79
|
-
e ? await _.readById(e._id) : void 0,
|
|
80
|
-
p
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function R(e) {
|
|
85
|
-
await C(
|
|
86
|
-
async () => {
|
|
87
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
91
|
-
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return M(async () => {
|
|
96
|
-
await K(async () => {
|
|
97
|
-
await m.read("COIN");
|
|
98
|
-
});
|
|
99
|
-
}), (e, o) => {
|
|
100
|
-
const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
|
|
101
|
-
return d(), h(b, null, [
|
|
102
|
-
r(y, {
|
|
103
|
-
title: t(s)("connect.program.point.title"),
|
|
104
|
-
actions: t(u).length > 0 ? [B] : [],
|
|
105
|
-
"onClick:action": o[0] || (o[0] = () => f())
|
|
106
|
-
}, {
|
|
107
|
-
title: g(() => [
|
|
108
|
-
n("div", ae, [
|
|
109
|
-
n("span", ne, c(t(s)("connect.program.point.title")), 1),
|
|
110
|
-
r(p, { variant: "premium" })
|
|
111
|
-
])
|
|
112
|
-
]),
|
|
113
|
-
_: 1
|
|
114
|
-
}, 8, ["title", "actions"]),
|
|
115
|
-
n("div", se, [
|
|
116
|
-
r(k, {
|
|
117
|
-
modelValue: t(i).searchKey,
|
|
118
|
-
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
|
|
119
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
120
|
-
placeholder: "search",
|
|
121
|
-
collapsible: ""
|
|
122
|
-
}, null, 8, ["modelValue"]),
|
|
123
|
-
t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
|
|
124
|
-
n("div", ie, [
|
|
125
|
-
n("div", re, [
|
|
126
|
-
r(Z, {
|
|
127
|
-
modelValue: t(i).location,
|
|
128
|
-
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
|
|
129
|
-
label: "Location: ",
|
|
130
|
-
"show-item-label": !0,
|
|
131
|
-
icon: "storefront",
|
|
132
|
-
placement: "bottom-start",
|
|
133
|
-
items: t(x).locationItems
|
|
134
|
-
}, null, 8, ["modelValue", "items"])
|
|
135
|
-
]),
|
|
136
|
-
r(k, {
|
|
137
|
-
modelValue: t(i).searchKey,
|
|
138
|
-
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
|
|
139
|
-
class: "xs:hidden",
|
|
140
|
-
placeholder: "search",
|
|
141
|
-
collapsible: ""
|
|
142
|
-
}, null, 8, ["modelValue"])
|
|
143
|
-
]),
|
|
144
|
-
r(O, {
|
|
145
|
-
class: "xs:hidden",
|
|
146
|
-
"row-data": t(u),
|
|
147
|
-
"column-defs": N,
|
|
148
|
-
"search-value": t(i).searchKey,
|
|
149
|
-
"column-filter": [],
|
|
150
|
-
onRowClick: o[4] || (o[4] = (a) => f(a.original)),
|
|
151
|
-
"hide-footer": t(u).length < 10
|
|
152
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
153
|
-
r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
154
|
-
default: g(() => [
|
|
155
|
-
(d(!0), h(b, null, H(t(u).filter(
|
|
156
|
-
(a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
157
|
-
), (a) => (d(), w(U, {
|
|
158
|
-
key: a._id.toString(),
|
|
159
|
-
onClick: (L) => f(a),
|
|
160
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
161
|
-
}, {
|
|
162
|
-
default: g(() => [
|
|
163
|
-
n("div", le, [
|
|
164
|
-
n("div", ce, [
|
|
165
|
-
(d(), w(q(t(I)(a)))),
|
|
166
|
-
n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
|
|
167
|
-
]),
|
|
168
|
-
n("div", de, [
|
|
169
|
-
n("div", pe, c(a.name), 1),
|
|
170
|
-
n("div", ue, c(t(P)(a)), 1)
|
|
171
|
-
]),
|
|
172
|
-
n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
|
|
173
|
-
]),
|
|
174
|
-
r(S, {
|
|
175
|
-
icon: "delete",
|
|
176
|
-
"icon-color": "neutral-gray-400",
|
|
177
|
-
variant: "tertiary",
|
|
178
|
-
onClick: (L) => (L.stopPropagation(), F(a))
|
|
179
|
-
}, null, 8, ["onClick"])
|
|
180
|
-
]),
|
|
181
|
-
_: 2
|
|
182
|
-
}, 1032, ["onClick"]))), 128))
|
|
183
|
-
]),
|
|
184
|
-
_: 1
|
|
185
|
-
})
|
|
186
|
-
], 64)) : (d(), w(T, {
|
|
187
|
-
key: 1,
|
|
188
|
-
variant: "outlined",
|
|
189
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
190
|
-
}, {
|
|
191
|
-
default: g(() => [
|
|
192
|
-
o[6] || (o[6] = n("img", {
|
|
193
|
-
src: z,
|
|
194
|
-
class: "aspect-square w-[150px]"
|
|
195
|
-
}, null, -1)),
|
|
196
|
-
n("div", ye, [
|
|
197
|
-
n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
|
|
198
|
-
n("div", _e, c(t(s)("connect.program.point.empty_state.description")), 1)
|
|
199
|
-
]),
|
|
200
|
-
r(S, {
|
|
201
|
-
variant: "primary",
|
|
202
|
-
label: "Create point program",
|
|
203
|
-
disabled: !t(x).isPremium,
|
|
204
|
-
icon: "add",
|
|
205
|
-
onClick: o[5] || (o[5] = (a) => f())
|
|
206
|
-
}, null, 8, ["disabled"])
|
|
207
|
-
]),
|
|
208
|
-
_: 1
|
|
209
|
-
})),
|
|
210
|
-
r(ee, {
|
|
211
|
-
ref_key: "sheetRef",
|
|
212
|
-
ref: v,
|
|
213
|
-
"onSubmit:modelValue": R
|
|
214
|
-
}, null, 512)
|
|
215
|
-
])
|
|
216
|
-
], 64);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
export {
|
|
221
|
-
Be as default
|
|
222
|
-
};
|