@feedmepos/mf-connect 0.1.82-prod → 0.1.83-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-D850nvXy.js → Analytic-1OYb8L9c.js} +11 -11
- package/dist/{App-Dwp2SQFt.js → App-oQ4_lEV2.js} +7 -7
- package/dist/{Bin-t3dMVk18.js → Bin-CQ8CYWAf.js} +8 -8
- package/dist/Broadcast-BLq5lca6.js +265 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFa7asTL.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-0BKgyMxn.js} +6 -6
- package/dist/{Card-DueuT99c.js → Card-BbcMCzvO.js} +19 -19
- package/dist/{Collections-D50oEyeZ.js → Collections-0LOyEUoF.js} +8 -8
- package/dist/Credit-Crrc3MSu.js +259 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-NtZKuPgi.js} +245 -241
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-L0-aFhRw.js → EffectSheet.vue_vue_type_style_index_0_lang-DQaMkTla.js} +6 -6
- package/dist/Experience-DJiUmONI.js +258 -0
- package/dist/{FileSaver.min-DH3eS7yi.js → FileSaver.min-CFEGc8v5.js} +1 -1
- package/dist/Game-ChHy4S4P.js +329 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BIKcbIag.js → ImageInput.vue_vue_type_script_setup_true_lang-BBavh70d.js} +1 -1
- package/dist/{Index-BucLJQqP.js → Index-CL5auUCN.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CIoZurPE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-H5IjhmOA.js} +1 -1
- package/dist/{MainLayout-DYGrSfgc.js → MainLayout-Bf4G5U5F.js} +1 -1
- package/dist/{Marketing-CsAIdNjF.js → Marketing-cNwSm-dt.js} +6 -6
- package/dist/{Member-D4HF_VGN.js → Member-fT7a7zFo.js} +11 -11
- package/dist/{MemberList-CPoA4ovd.js → MemberList-gEN36Erj.js} +27 -27
- package/dist/{MemberTransactions-AMv9NeIb.js → MemberTransactions-C4YgiUw-.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhhSwnK0.js → MessageInput.vue_vue_type_script_setup_true_lang-BNDrmYqp.js} +9 -9
- package/dist/Mission-Bz9P2pjX.js +333 -0
- package/dist/{Overview-ByO2p2Wx.js → Overview-BG3Z7Daz.js} +19 -19
- package/dist/Point-BBeSJ5p5.js +261 -0
- package/dist/Promotion-VmaOESn2.js +390 -0
- package/dist/{Queue-BD29Mmbf.js → Queue-DKtUhOBh.js} +11 -11
- package/dist/{Record-CNLiN6YR.js → Record-Cb45m9I8.js} +9 -9
- package/dist/{Reward-Ceo3M1yD.js → Reward-D_uvCEMe.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJWQEL9W.js → RewardGroup.vue_vue_type_script_setup_true_lang-yUUMGEUJ.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CWuWGs6r.js → RuleGroup.vue_vue_type_script_setup_true_lang-CIb7igvo.js} +15 -15
- package/dist/{Segment-BOQUlP-m.js → Segment-BJ8XUyeG.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BcXeiz0p.js → SelectItems.vue_vue_type_script_setup_true_lang-ht4qyiQM.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DC6OQ7Zb.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9emjG6Nc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-i_BRgBRC.js} +4 -4
- package/dist/{Setting-CWapXD31.js → Setting-CS1wSxO9.js} +14 -14
- package/dist/{SettingAdvertisements-QEf2eyem.js → SettingAdvertisements-CWP7VthZ.js} +12 -12
- package/dist/{Store-Bfm2olbH.js → Store-cy0uZfSE.js} +22 -22
- package/dist/{StoreRewards-DNDkyxxn.js → StoreRewards-DDAvmlEn.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-zKLbY4Qb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CevWXAb6.js} +20 -20
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D3-wIOQ7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CPJ4fCu-.js} +1 -1
- package/dist/{Tier-uC45o2AK.js → Tier-CUT_0eYp.js} +22 -22
- package/dist/{Title-zDjlDJCB.js → Title-DcelZU7H.js} +20 -20
- package/dist/{Transaction-Bo9FEjMQ.js → Transaction-CwcJnFIO.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BR5F0bWS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuDS-vUd.js} +6 -6
- package/dist/{Voucher-B7BTa4Vt.js → Voucher-z6o5rwFx.js} +162 -141
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjrjJW7x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-FVdeM5pH.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DeAkLgaX.js → ZodTextField.vue_vue_type_script_setup_true_lang-BGuVeHZU.js} +2 -2
- package/dist/{app-CkUBXnib.js → app-BUFlIAB5.js} +73 -43
- package/dist/app.js +1 -1
- package/dist/{business-C8P05bjQ.js → business-CEL6Cxr7.js} +1 -1
- package/dist/{campaign-DcLhSQVQ.js → campaign-Bz3O-DFr.js} +1 -1
- package/dist/{campaign-CyYAvl3p.js → campaign-CfB7ZWIg.js} +8 -8
- package/dist/{campaign.enum-h6B-mP82.js → campaign.enum-CCKHGvL9.js} +1 -1
- package/dist/{campaign.fn-CStjDAoU.js → campaign.fn-Cu0sRSpP.js} +114 -114
- package/dist/{collectible.enum-DT-wjl-a.js → collectible.enum-DeWSJ9OK.js} +1 -1
- package/dist/{collection.fn-14o3RW2e.js → collection.fn-hPDt2qvz.js} +2 -2
- package/dist/{dto-Bv09Baex.js → dto-BKwcpb4T.js} +4 -4
- package/dist/{effect-CF0s7QWQ.js → effect-D070CPN_.js} +1 -1
- package/dist/{email-addresses-B5qrHbxg.js → email-addresses-C0fE6EMy.js} +2 -2
- package/dist/{export-B6nvdBmg.js → export-CG1ypExs.js} +3 -3
- package/dist/{helper-B4-2ut7E.js → helper-C9NBolO7.js} +1 -1
- package/dist/{index-B-y0UTZw.js → index-4gCsL8Hl.js} +6 -6
- package/dist/{index-D5xt8OjL.js → index-6rFsv3Yg.js} +1 -1
- package/dist/{index-BebGg-0n.js → index-B30LtrWw.js} +1 -1
- package/dist/{index-DVb99_67.js → index-B613auFn.js} +1 -1
- package/dist/{index-HhVIn4Bn.js → index-BGi7UFjn.js} +1 -1
- package/dist/{index-DzQjej5Y.js → index-BXSp11TE.js} +4 -4
- package/dist/{index-DRX9TTMn.js → index-CM-qkxMr.js} +3 -3
- package/dist/{index-DesSizn4.js → index-CZoTFXja.js} +3 -3
- package/dist/{index-DG_Ej3ec.js → index-D7AT7i0e.js} +3 -3
- package/dist/{index-DIQ2MyWF.js → index-DDMr6_UT.js} +4 -4
- package/dist/{index-XDg25M5a.js → index-DGNPGZh4.js} +1 -1
- package/dist/{index-CR8brl_k.js → index-DLnZyneY.js} +1 -1
- package/dist/{index-Ct90ybe0.js → index-DcfdUpTw.js} +1 -1
- package/dist/{index.esm2017-1A2eV8x_.js → index.esm2017-D0u5JnGx.js} +1 -1
- package/dist/{loading-B0_BwPgo.js → loading-Rn4BXFlo.js} +1 -1
- package/dist/{lodash-DxIglhqk.js → lodash-Ds-QoR_N.js} +1 -1
- package/dist/{membership-H_whlbUP.js → membership-BjklIT2n.js} +3 -3
- package/dist/{money-DEE8QW6m.js → money-DMyZXL-e.js} +1 -1
- package/dist/{number-BmN5A4Cu.js → number-Cyny8l0t.js} +1 -1
- package/dist/{objectid-B8LZDZOt.js → objectid-Bs1Sha1n.js} +6 -6
- package/dist/{plugins-DTrOHd7d.js → plugins-BdQ8LmZm.js} +3 -3
- package/dist/{reward-CsJhkkaT.js → reward-ZGs3fpY1.js} +1 -1
- package/dist/{rule-ByMxYH4c.js → rule-BH0ICJcx.js} +3 -3
- package/dist/{rule-builder-DwGwUlV1.js → rule-builder-D2sz7Xd9.js} +1 -1
- package/dist/template-_QJbP7yG.js +236 -0
- package/dist/{timezone-Bpe-fhwZ.js → timezone-ulqdIvC-.js} +2 -2
- package/dist/{trigger-CEprJYiD.js → trigger-BiXZCT3j.js} +5 -5
- package/dist/{usePagination-Du6qS5aj.js → usePagination-Ck7buuI_.js} +1 -1
- package/dist/{user-Be8HNWuo.js → user-BWTfkoD6.js} +1 -1
- package/dist/{vue-i18n-fg0FtbNR.js → vue-i18n-CmMTYitu.js} +158 -158
- package/dist/{xlsx-CSQJ3YWk.js → xlsx-BF8PJO-P.js} +1 -1
- package/dist/{zod-BB7zZ5ec.js → zod-C5iXeYjP.js} +1 -1
- package/package.json +1 -1
- package/dist/Broadcast-DORnkgZc.js +0 -232
- package/dist/Credit-CIWSRGuJ.js +0 -225
- package/dist/Experience-qABtjxNP.js +0 -224
- package/dist/Game-D67q1zKd.js +0 -299
- package/dist/Mission-CRinLn7e.js +0 -303
- package/dist/Point-4JqzbNgP.js +0 -227
- package/dist/Promotion-DlWVF6hF.js +0 -358
- package/dist/template-Bdwy6QXF.js +0 -188
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as b, resolveComponent as u, openBlock as f, createBlock as F, unref as a, isRef as Y, withCtx as S, createElementVNode as l, createVNode as i, computed as Z, h as ee, onMounted as oe, createElementBlock as T, Fragment as V, renderList as te, resolveDynamicComponent as ne, toDisplayString as C } from "vue";
|
|
2
|
-
import { _ as ae } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as se, components as re } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as M, p as $ } from "./plugins-DTrOHd7d.js";
|
|
5
|
-
import { u as le } from "./loading-B0_BwPgo.js";
|
|
6
|
-
import { u as ie } from "./business-C8P05bjQ.js";
|
|
7
|
-
import { c as g, u as ce } from "./campaign-DcLhSQVQ.js";
|
|
8
|
-
import { u as me } from "./vue-i18n-fg0FtbNR.js";
|
|
9
|
-
import { g as ue, a as N } from "./campaign-CyYAvl3p.js";
|
|
10
|
-
import { e as j } from "./effect-CF0s7QWQ.js";
|
|
11
|
-
import { _ as de } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
|
|
12
|
-
import { u as pe } from "./template-Bdwy6QXF.js";
|
|
13
|
-
import { _ as q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
14
|
-
const fe = { class: "space-y-8" }, ye = /* @__PURE__ */ K({
|
|
15
|
-
__name: "QueueSheet",
|
|
16
|
-
emits: ["update:model-value"],
|
|
17
|
-
setup(U, { expose: n, emit: O }) {
|
|
18
|
-
const p = b(!1), h = b([]);
|
|
19
|
-
async function k() {
|
|
20
|
-
p.value = !0;
|
|
21
|
-
const r = await g.getPromotionQueue();
|
|
22
|
-
console.log(r, "jobs"), h.value = r;
|
|
23
|
-
}
|
|
24
|
-
const v = [
|
|
25
|
-
{
|
|
26
|
-
header: "Started At",
|
|
27
|
-
accessorFn: (r) => r.createdAt,
|
|
28
|
-
enableSorting: !0
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
header: "Campaigns",
|
|
32
|
-
accessorFn: (r) => r.campaigns
|
|
33
|
-
// cell(props) {
|
|
34
|
-
// const r = props.row.original;
|
|
35
|
-
// return h('div', {
|
|
36
|
-
// innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
|
|
37
|
-
// });
|
|
38
|
-
// },
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
return n({
|
|
42
|
-
showSheet: k
|
|
43
|
-
}), (r, m) => {
|
|
44
|
-
const _ = u("FmTable"), P = u("FmSideSheet");
|
|
45
|
-
return f(), F(P, {
|
|
46
|
-
"max-width": 550,
|
|
47
|
-
header: "Promotion Sync Queue",
|
|
48
|
-
modelValue: a(p),
|
|
49
|
-
"onUpdate:modelValue": [
|
|
50
|
-
m[1] || (m[1] = (s) => Y(p) ? p.value = s : null),
|
|
51
|
-
m[2] || (m[2] = (s) => p.value = s)
|
|
52
|
-
]
|
|
53
|
-
}, {
|
|
54
|
-
default: S(() => [
|
|
55
|
-
l("div", fe, [
|
|
56
|
-
m[3] || (m[3] = l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
|
|
57
|
-
i(_, {
|
|
58
|
-
modelValue: r.tableRef,
|
|
59
|
-
"onUpdate:modelValue": m[0] || (m[0] = (s) => r.tableRef = s),
|
|
60
|
-
"column-filter": r.jobFilters,
|
|
61
|
-
"column-defs": v,
|
|
62
|
-
"row-data": a(h),
|
|
63
|
-
"hide-footer": a(h).length <= 10
|
|
64
|
-
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
|
|
65
|
-
])
|
|
66
|
-
]),
|
|
67
|
-
_: 1
|
|
68
|
-
}, 8, ["modelValue"]);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
}), ge = { class: "px-24 flex flex-col gap-y-16" }, he = { class: "flex items-center justify-between w-full" }, _e = { class: "flex gap-8 overflow-x-auto" }, be = { class: "space-y-8" }, ve = { class: "flex w-full gap-4 items-center" }, we = { class: "space-y-4" }, xe = { class: "fm-typo-en-body-lg-600" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "flex flex-col gap-16 text-center" }, Se = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qe = /* @__PURE__ */ K({
|
|
72
|
-
__name: "Promotion",
|
|
73
|
-
setup(U) {
|
|
74
|
-
const { t: n } = me(), O = {
|
|
75
|
-
label: n("connect.promotion.createCampaign"),
|
|
76
|
-
value: "create",
|
|
77
|
-
isPrimary: !0,
|
|
78
|
-
prependIcon: "add"
|
|
79
|
-
}, p = {
|
|
80
|
-
label: "Force sync",
|
|
81
|
-
value: "sync",
|
|
82
|
-
isPrimary: !1,
|
|
83
|
-
prependIcon: "refresh"
|
|
84
|
-
}, h = {
|
|
85
|
-
label: "Queue",
|
|
86
|
-
value: "queue",
|
|
87
|
-
isPrimary: !1,
|
|
88
|
-
prependIcon: "work_history"
|
|
89
|
-
}, k = pe("PROMOTION", se()), v = ie(), r = ce(), { global: m, minor: _ } = le, P = [
|
|
90
|
-
{
|
|
91
|
-
label: "Bill promotion",
|
|
92
|
-
value: "BILL"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: "Item promotion",
|
|
96
|
-
value: "ITEM"
|
|
97
|
-
}
|
|
98
|
-
], s = b({
|
|
99
|
-
searchKey: "",
|
|
100
|
-
location: [],
|
|
101
|
-
effectType: []
|
|
102
|
-
});
|
|
103
|
-
function D(e) {
|
|
104
|
-
const o = s.value.location;
|
|
105
|
-
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((d) => {
|
|
106
|
-
var c;
|
|
107
|
-
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(d);
|
|
108
|
-
}) : e.targetLocation.includes(o);
|
|
109
|
-
}
|
|
110
|
-
function E(e) {
|
|
111
|
-
var c, x;
|
|
112
|
-
const o = s.value.effectType;
|
|
113
|
-
if (!o || o.length === 0) return !0;
|
|
114
|
-
const d = (x = (c = e.effect) == null ? void 0 : c.options) == null ? void 0 : x.target;
|
|
115
|
-
return o.includes(d);
|
|
116
|
-
}
|
|
117
|
-
const y = Z(
|
|
118
|
-
() => r.campaigns.promotion.filter(
|
|
119
|
-
(e) => D(e) && E(e)
|
|
120
|
-
)
|
|
121
|
-
), Q = [
|
|
122
|
-
{
|
|
123
|
-
header: n("connect.promotion.promotionTitle"),
|
|
124
|
-
accessorFn: (e) => e.name
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
header: n("connect.promotion.status"),
|
|
128
|
-
accessorFn: (e) => ue(e),
|
|
129
|
-
cell(e) {
|
|
130
|
-
return N(e.row.original);
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
header: n("connect.promotion.type"),
|
|
135
|
-
accessorFn: (e) => `${M.title(e.effect.options.target)} promotion`
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
header: n("connect.promotion.summary"),
|
|
139
|
-
accessorFn: (e) => j(e.effect)
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
header: n("connect.promotion.actions"),
|
|
143
|
-
cell(e) {
|
|
144
|
-
return ee(re.FmButton, {
|
|
145
|
-
variant: "tertiary",
|
|
146
|
-
icon: "delete",
|
|
147
|
-
iconColor: "neutral-gray-400",
|
|
148
|
-
onClick: (o) => {
|
|
149
|
-
o.stopPropagation(), R(e.row.original);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
], L = b(), I = b();
|
|
155
|
-
async function R(e) {
|
|
156
|
-
await $.remove(
|
|
157
|
-
n("connect.promotion.confirmRemove", { name: e.name })
|
|
158
|
-
) && await _(
|
|
159
|
-
async () => {
|
|
160
|
-
await g.delete(e._id), await r.read("PROMOTION");
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
message: n("connect.promotion.removing", { name: e.name }),
|
|
164
|
-
successMessage: n("connect.promotion.removedSuccessfully", {
|
|
165
|
-
name: e.name
|
|
166
|
-
})
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
async function w(e) {
|
|
171
|
-
e ? await o() : k.open(async (d) => {
|
|
172
|
-
await o(d);
|
|
173
|
-
});
|
|
174
|
-
async function o(d) {
|
|
175
|
-
var c;
|
|
176
|
-
(c = L.value) == null || c.showSheet(
|
|
177
|
-
!0,
|
|
178
|
-
"PROMOTION",
|
|
179
|
-
e ? await g.readById(e._id) : void 0,
|
|
180
|
-
d
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
async function H(e) {
|
|
185
|
-
await _(
|
|
186
|
-
async () => {
|
|
187
|
-
e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await r.read("PROMOTION");
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
message: n(
|
|
191
|
-
e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
|
|
192
|
-
),
|
|
193
|
-
successMessage: n(
|
|
194
|
-
e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
|
|
195
|
-
)
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
async function z(e) {
|
|
200
|
-
var o;
|
|
201
|
-
switch (e) {
|
|
202
|
-
case "create":
|
|
203
|
-
w();
|
|
204
|
-
break;
|
|
205
|
-
case "sync":
|
|
206
|
-
await $.confirm(
|
|
207
|
-
"Are you sure you want to synchronize all promotions to POS?",
|
|
208
|
-
"Force sync"
|
|
209
|
-
) && _(
|
|
210
|
-
async () => {
|
|
211
|
-
await g.syncAllPromotion();
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
message: "Syncing promotions...",
|
|
215
|
-
successMessage: "All promotions synced"
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
break;
|
|
219
|
-
case "queue":
|
|
220
|
-
(o = I.value) == null || o.showSheet();
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return oe(async () => {
|
|
225
|
-
await m(async () => {
|
|
226
|
-
await v.readLocations(), await r.read("PROMOTION");
|
|
227
|
-
});
|
|
228
|
-
}), (e, o) => {
|
|
229
|
-
const d = u("FmPageHead"), c = u("FmSearch"), x = u("FmTable"), G = u("FmChip"), B = u("FmButton"), J = u("FmListItem"), W = u("FmList"), X = u("FmCard");
|
|
230
|
-
return f(), T(V, null, [
|
|
231
|
-
i(d, {
|
|
232
|
-
title: a(n)("connect.promotion.title"),
|
|
233
|
-
actions: a(y).length > 0 ? [O, p, h] : [],
|
|
234
|
-
"onClick:action": z
|
|
235
|
-
}, null, 8, ["title", "actions"]),
|
|
236
|
-
l("div", ge, [
|
|
237
|
-
i(c, {
|
|
238
|
-
modelValue: s.value.searchKey,
|
|
239
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
|
|
240
|
-
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
241
|
-
placeholder: a(n)("connect.promotion.search"),
|
|
242
|
-
collapsible: ""
|
|
243
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
244
|
-
a(y) && a(y).length > 0 ? (f(), T(V, { key: 0 }, [
|
|
245
|
-
l("div", he, [
|
|
246
|
-
l("div", _e, [
|
|
247
|
-
i(q, {
|
|
248
|
-
label: `${a(n)("connect.common.location")}: `,
|
|
249
|
-
"right-icon": "keyboard_arrow_down",
|
|
250
|
-
modelValue: s.value.location,
|
|
251
|
-
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
|
|
252
|
-
icon: "storefront",
|
|
253
|
-
"show-item-label": !0,
|
|
254
|
-
items: a(v).locationOptions
|
|
255
|
-
}, null, 8, ["label", "modelValue", "items"]),
|
|
256
|
-
i(q, {
|
|
257
|
-
label: "Type:",
|
|
258
|
-
"right-icon": "keyboard_arrow_down",
|
|
259
|
-
modelValue: s.value.effectType,
|
|
260
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
|
|
261
|
-
icon: "filter_list",
|
|
262
|
-
"show-item-label": !0,
|
|
263
|
-
items: P
|
|
264
|
-
}, null, 8, ["modelValue"])
|
|
265
|
-
]),
|
|
266
|
-
i(c, {
|
|
267
|
-
modelValue: s.value.searchKey,
|
|
268
|
-
"onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
|
|
269
|
-
class: "xs:hidden sm:hidden",
|
|
270
|
-
placeholder: "search",
|
|
271
|
-
collapsible: ""
|
|
272
|
-
}, null, 8, ["modelValue"])
|
|
273
|
-
]),
|
|
274
|
-
i(x, {
|
|
275
|
-
class: "xs:hidden sm:hidden",
|
|
276
|
-
"row-data": a(y),
|
|
277
|
-
"column-defs": Q,
|
|
278
|
-
"search-value": s.value.searchKey,
|
|
279
|
-
"column-filter": [],
|
|
280
|
-
onRowClick: o[4] || (o[4] = (t) => w(t.original)),
|
|
281
|
-
"hide-footer": a(y).length < 10
|
|
282
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
283
|
-
i(W, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
284
|
-
default: S(() => [
|
|
285
|
-
(f(!0), T(V, null, te(a(y).filter(
|
|
286
|
-
(t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
|
|
287
|
-
), (t) => (f(), F(J, {
|
|
288
|
-
key: t._id.toString(),
|
|
289
|
-
onClick: (A) => w(t),
|
|
290
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
291
|
-
}, {
|
|
292
|
-
default: S(() => [
|
|
293
|
-
l("div", be, [
|
|
294
|
-
l("div", ve, [
|
|
295
|
-
(f(), F(ne(a(N)(t)))),
|
|
296
|
-
i(G, {
|
|
297
|
-
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
298
|
-
compact: !0,
|
|
299
|
-
label: `${a(M).title(t.effect.options.target)} promotion`
|
|
300
|
-
}, null, 8, ["label"])
|
|
301
|
-
]),
|
|
302
|
-
l("div", we, [
|
|
303
|
-
l("div", xe, C(t.name), 1),
|
|
304
|
-
l("div", Ce, C(a(j)(t.effect)), 1)
|
|
305
|
-
])
|
|
306
|
-
]),
|
|
307
|
-
i(B, {
|
|
308
|
-
icon: "delete",
|
|
309
|
-
"icon-color": "neutral-gray-400",
|
|
310
|
-
variant: "tertiary",
|
|
311
|
-
onClick: (A) => (A.stopPropagation(), R(t))
|
|
312
|
-
}, null, 8, ["onClick"])
|
|
313
|
-
]),
|
|
314
|
-
_: 2
|
|
315
|
-
}, 1032, ["onClick"]))), 128))
|
|
316
|
-
]),
|
|
317
|
-
_: 1
|
|
318
|
-
})
|
|
319
|
-
], 64)) : (f(), F(X, {
|
|
320
|
-
key: 1,
|
|
321
|
-
variant: "outlined",
|
|
322
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
323
|
-
}, {
|
|
324
|
-
default: S(() => [
|
|
325
|
-
o[6] || (o[6] = l("img", {
|
|
326
|
-
src: ae,
|
|
327
|
-
class: "aspect-square w-[150px]"
|
|
328
|
-
}, null, -1)),
|
|
329
|
-
l("div", Fe, [
|
|
330
|
-
l("div", Se, C(a(n)("connect.promotion.createPromotionCampaign")), 1),
|
|
331
|
-
l("div", ke, C(a(n)("connect.promotion.description")), 1)
|
|
332
|
-
]),
|
|
333
|
-
i(B, {
|
|
334
|
-
variant: "primary",
|
|
335
|
-
label: a(n)("connect.promotion.createPromotionCampaign"),
|
|
336
|
-
icon: "add",
|
|
337
|
-
onClick: o[5] || (o[5] = (t) => w())
|
|
338
|
-
}, null, 8, ["label"])
|
|
339
|
-
]),
|
|
340
|
-
_: 1
|
|
341
|
-
}))
|
|
342
|
-
]),
|
|
343
|
-
i(de, {
|
|
344
|
-
ref_key: "sheetRef",
|
|
345
|
-
ref: L,
|
|
346
|
-
"onSubmit:modelValue": H
|
|
347
|
-
}, null, 512),
|
|
348
|
-
i(ye, {
|
|
349
|
-
ref_key: "queueSheetRef",
|
|
350
|
-
ref: I
|
|
351
|
-
}, null, 512)
|
|
352
|
-
], 64);
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
export {
|
|
357
|
-
qe as default
|
|
358
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { defineComponent as V, openBlock as r, createBlock as C, resolveDynamicComponent as B, unref as e, ref as E, computed as j, onMounted as P, resolveComponent as d, withCtx as u, createElementVNode as l, createElementBlock as w, createVNode as a, normalizeClass as k, createTextVNode as S, toDisplayString as f, Fragment as L, renderList as N, createCommentVNode as q } from "vue";
|
|
2
|
-
import { u as J } from "./campaign-DcLhSQVQ.js";
|
|
3
|
-
import { useDialog as M } from "@feedmepos/ui-library";
|
|
4
|
-
import { F as A } from "./index-B-y0UTZw.js";
|
|
5
|
-
import { _ as G } from "./lodash-DxIglhqk.js";
|
|
6
|
-
import { C as H } from "./campaign-CyYAvl3p.js";
|
|
7
|
-
import { J as K } from "./JsonViewer-v8_C7l5N.js";
|
|
8
|
-
import { u as Q } from "./vue-i18n-fg0FtbNR.js";
|
|
9
|
-
import { u as R } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
|
|
10
|
-
const U = /* @__PURE__ */ V({
|
|
11
|
-
__name: "CampaignChip",
|
|
12
|
-
props: {
|
|
13
|
-
type: { type: String, required: !0 }
|
|
14
|
-
},
|
|
15
|
-
setup(_) {
|
|
16
|
-
const p = H[_.type];
|
|
17
|
-
return (i, g) => (r(), C(B(e(p).chip())));
|
|
18
|
-
}
|
|
19
|
-
}), W = { class: "flex flex-nowrap gap-x-2 grow h-full" }, X = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "p-8 w-1/4"
|
|
22
|
-
}, Y = { class: "flex flex-col grow p-24" }, Z = { class: "space-y-4" }, ee = { class: "fm-typo-en-title-sm-800" }, te = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, ne = { class: "grow pb-16 pr-16 pt-6 w-full max-h-[400px] overflow-y-auto" }, oe = { class: "gap-24 grid grid-cols-1 lg:grid-cols-2" }, le = { class: "gap-4 h-[22px] inline-flex items-center justify-center min-w-min rounded-md" }, se = { class: "fm-typo-en-title-sm-800" }, ae = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ie = { class: "flex gap-4 items-end justify-end py-8" }, ce = /* @__PURE__ */ V({
|
|
23
|
-
__name: "TemplateDialog",
|
|
24
|
-
props: {
|
|
25
|
-
campaignType: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: () => {
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
onOk: {
|
|
31
|
-
type: Function,
|
|
32
|
-
required: !0
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
setup(_) {
|
|
36
|
-
const { t: n } = Q(), { getLocaleText: p } = R(), i = M(), g = J(), c = _, o = E({
|
|
37
|
-
intention: null,
|
|
38
|
-
template: null
|
|
39
|
-
}), T = j(() => {
|
|
40
|
-
const m = (g.templates ?? []).filter(
|
|
41
|
-
() => !0
|
|
42
|
-
//t.intention && t.intention.length > 0
|
|
43
|
-
);
|
|
44
|
-
return c.campaignType ? m.filter(
|
|
45
|
-
(s) => {
|
|
46
|
-
var x, y;
|
|
47
|
-
return ((y = (x = s.defaultValue) == null ? void 0 : x.campaign) == null ? void 0 : y.type) === c.campaignType;
|
|
48
|
-
}
|
|
49
|
-
) : o.value.intention === null ? G.sampleSize(m, 7) : m.filter(
|
|
50
|
-
(s) => s.intention.includes(o.value.intention)
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
P(async () => {
|
|
54
|
-
await g.readTemplates();
|
|
55
|
-
});
|
|
56
|
-
function $() {
|
|
57
|
-
c.onOk(void 0), i.close();
|
|
58
|
-
}
|
|
59
|
-
function I() {
|
|
60
|
-
const m = o.value.template;
|
|
61
|
-
c.onOk(g.templates.find((s) => s._id === m)), i.close();
|
|
62
|
-
}
|
|
63
|
-
return (m, s) => {
|
|
64
|
-
const x = d("FmChip"), y = d("FmListItem"), O = d("FmList"), F = d("FmCard"), h = d("FmButton"), z = d("FmSpacer");
|
|
65
|
-
return r(), C(F, { class: "h-[534px] max-w-6xl" }, {
|
|
66
|
-
default: u(() => [
|
|
67
|
-
l("div", W, [
|
|
68
|
-
c.campaignType ? q("", !0) : (r(), w("div", X, [
|
|
69
|
-
a(O, null, {
|
|
70
|
-
default: u(() => [
|
|
71
|
-
a(y, {
|
|
72
|
-
class: k([{
|
|
73
|
-
"bg-fm-color-system-warning-100": e(o).intention === null
|
|
74
|
-
}, "rounded-sm"]),
|
|
75
|
-
onClick: s[0] || (s[0] = (t) => {
|
|
76
|
-
e(o).intention = null, e(o).template = null;
|
|
77
|
-
})
|
|
78
|
-
}, {
|
|
79
|
-
append: u(() => [
|
|
80
|
-
a(x, {
|
|
81
|
-
label: e(n)("connect.templateDialog.hot"),
|
|
82
|
-
variant: "critical"
|
|
83
|
-
}, null, 8, ["label"])
|
|
84
|
-
]),
|
|
85
|
-
default: u(() => [
|
|
86
|
-
S(f(e(n)("connect.templateDialog.mostPopular")) + " ", 1)
|
|
87
|
-
]),
|
|
88
|
-
_: 1
|
|
89
|
-
}, 8, ["class"]),
|
|
90
|
-
(r(!0), w(L, null, N(e(A).options, (t, b) => (r(), C(y, {
|
|
91
|
-
key: b,
|
|
92
|
-
class: k(["rounded-sm", {
|
|
93
|
-
"bg-fm-color-system-warning-100": e(o).intention === t
|
|
94
|
-
}]),
|
|
95
|
-
style: { padding: "8px 16px" },
|
|
96
|
-
onClick: (v) => {
|
|
97
|
-
e(o).intention = t, e(o).template = null;
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
default: u(() => [
|
|
101
|
-
S(f(e(n)(`connect.templateDialog.intention.${t}`)), 1)
|
|
102
|
-
]),
|
|
103
|
-
_: 2
|
|
104
|
-
}, 1032, ["class", "onClick"]))), 128))
|
|
105
|
-
]),
|
|
106
|
-
_: 1
|
|
107
|
-
})
|
|
108
|
-
])),
|
|
109
|
-
l("div", Y, [
|
|
110
|
-
l("div", Z, [
|
|
111
|
-
l("div", ee, f(c.campaignType ? e(n)(`connect.templateDialog.campaignType.${c.campaignType}`) : e(n)("connect.templateDialog.templateList")), 1),
|
|
112
|
-
l("div", te, f(e(n)("connect.templateDialog.subtitle")), 1)
|
|
113
|
-
]),
|
|
114
|
-
l("div", ne, [
|
|
115
|
-
a(K, { json: e(T) }, null, 8, ["json"]),
|
|
116
|
-
l("div", oe, [
|
|
117
|
-
(r(!0), w(L, null, N(e(T), (t, b) => (r(), C(F, {
|
|
118
|
-
key: b,
|
|
119
|
-
variant: "outlined",
|
|
120
|
-
class: k(["box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8", {
|
|
121
|
-
"bg-fm-color-system-warning-100 border-fm-color-primary border-2": e(o).template === t._id.toString()
|
|
122
|
-
}]),
|
|
123
|
-
onClick: (v) => e(o).template = t._id.toString()
|
|
124
|
-
}, {
|
|
125
|
-
default: u(() => {
|
|
126
|
-
var v, D;
|
|
127
|
-
return [
|
|
128
|
-
l("div", le, [
|
|
129
|
-
a(U, {
|
|
130
|
-
type: (D = (v = t.defaultValue) == null ? void 0 : v.campaign) == null ? void 0 : D.type
|
|
131
|
-
}, null, 8, ["type"])
|
|
132
|
-
]),
|
|
133
|
-
l("div", se, f(e(p)(t.name_locale, t.name)), 1),
|
|
134
|
-
l("p", ae, f(e(p)(t.description_locale, t.description ?? "")), 1)
|
|
135
|
-
];
|
|
136
|
-
}),
|
|
137
|
-
_: 2
|
|
138
|
-
}, 1032, ["class", "onClick"]))), 128))
|
|
139
|
-
])
|
|
140
|
-
]),
|
|
141
|
-
l("div", ie, [
|
|
142
|
-
a(h, {
|
|
143
|
-
class: "sm:w-full xs:w-full",
|
|
144
|
-
variant: "plain",
|
|
145
|
-
label: e(n)("connect.templateDialog.customCampaign"),
|
|
146
|
-
size: "md",
|
|
147
|
-
onClick: $
|
|
148
|
-
}, null, 8, ["label"]),
|
|
149
|
-
a(z, { class: "sm:hidden xs:hidden" }),
|
|
150
|
-
a(h, {
|
|
151
|
-
class: "sm:w-full xs:w-full",
|
|
152
|
-
variant: "tertiary",
|
|
153
|
-
label: e(n)("connect.templateDialog.cancel"),
|
|
154
|
-
size: "md",
|
|
155
|
-
onClick: s[1] || (s[1] = (t) => e(i).close())
|
|
156
|
-
}, null, 8, ["label"]),
|
|
157
|
-
a(h, {
|
|
158
|
-
class: "sm:w-full xs:w-full",
|
|
159
|
-
variant: "primary",
|
|
160
|
-
label: e(n)("connect.templateDialog.start"),
|
|
161
|
-
size: "md",
|
|
162
|
-
disabled: !e(o).template,
|
|
163
|
-
onClick: I
|
|
164
|
-
}, null, 8, ["label", "disabled"])
|
|
165
|
-
])
|
|
166
|
-
])
|
|
167
|
-
])
|
|
168
|
-
]),
|
|
169
|
-
_: 1
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}), xe = (_, n) => ({
|
|
174
|
-
open: async (p) => {
|
|
175
|
-
n.open({
|
|
176
|
-
title: "",
|
|
177
|
-
dialogComponent: ce,
|
|
178
|
-
dialogComponentProps: {
|
|
179
|
-
campaignType: _,
|
|
180
|
-
onOk: async (i) => (console.debug(i, "selected template"), await p(i))
|
|
181
|
-
},
|
|
182
|
-
overlay: !0
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
export {
|
|
187
|
-
xe as u
|
|
188
|
-
};
|