@feedmepos/mf-connect 0.1.58-prod → 0.1.59-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-1heLfSqq.js +427 -0
- package/dist/App-BOM2IfBO.js +4630 -0
- package/dist/Bin-BgYzSjrq.js +166 -0
- package/dist/Broadcast-DHeN_79K.js +233 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DFOIbmI6.js +121 -0
- package/dist/Card-CuJ7bMy5.js +911 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-D1FRwIRi.js +458 -0
- package/dist/Credit-CeYpgCod.js +228 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B8lOyyAc.js +2194 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-De2lhmbT.js +348 -0
- package/dist/Experience-D-tJxul7.js +229 -0
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-BOmYWwRj.js +284 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/Index-CRBYEPFf.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-D7WunOsO.js +319 -0
- package/dist/Member-iYAPEdoQ.js +279 -0
- package/dist/MemberList-CtR-UjtG.js +1607 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-BMQOdkr2.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DhJlcYpw.js +60553 -0
- package/dist/Mission-DSBH4Di0.js +302 -0
- package/dist/Overview-C0KCN3fH.js +1079 -0
- package/dist/Point-AN7wmCXY.js +232 -0
- package/dist/Promotion-Cbf4W6Vh.js +289 -0
- package/dist/Queue-Bo_RtLpU.js +260 -0
- package/dist/Record-BphvsxDb.js +341 -0
- package/dist/Reward-CgHUAB5V.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-DaBRd_Kw.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-C_65qxpU.js +1763 -0
- package/dist/Segment-Cc0D6nPj.js +882 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BxUG7_bX.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-bqKHjikC.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DA7bevEn.js +147 -0
- package/dist/Setting-DjVTTqky.js +1918 -0
- package/dist/SettingAdvertisements-BL81KD_S.js +262 -0
- package/dist/Store-DqXIQ9EY.js +1842 -0
- package/dist/StoreRewards-xlzAHJkc.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-OphuWknh.js +995 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DGSjAbol.js +139 -0
- package/dist/Tier-DadaaAEc.js +895 -0
- package/dist/Title-BDBxQMEm.js +566 -0
- package/dist/Transaction-BRGCw9Va.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-qe26FZBo.js +130 -0
- package/dist/Voucher-CtvWJfVU.js +384 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-dS7n6KJt.js +419 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-ndun9vf-.js +56 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-9QTXPjre.js +57962 -0
- package/dist/app-UNZJVzly.js +7094 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +6 -0
- package/dist/business-DtufpzhR.js +82 -0
- package/dist/campaign-63K4Xtsd.js +94 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-Dm85zK-z.js +1810 -0
- package/dist/campaign.enum-DBWgoidX.js +20 -0
- package/dist/campaign.fn-BpifzSGC.js +758 -0
- package/dist/collectible.enum-2_2_6r39.js +19 -0
- package/dist/collection.fn-B2rlSiv_.js +26 -0
- package/dist/dto-Df83CuN3.js +216 -0
- package/dist/effect-BUEqEGkq.js +78 -0
- package/dist/email-addresses-BUNKzO1f.js +705 -0
- package/dist/export-BzY3BDZJ.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-BaJdC23g.js +71 -0
- package/dist/index-BA5QwPCT.js +146 -0
- package/dist/index-BInlN52T.js +54 -0
- package/dist/index-BLjKPiBb.js +44 -0
- package/dist/index-BQTPw5fM.js +30076 -0
- package/dist/index-BSQCStAn.js +38 -0
- package/dist/index-Bzv6BHPk.js +32269 -0
- package/dist/index-C0XYFg_a.js +3077 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-D_hUHpqX.js +31 -0
- package/dist/index-DlwtDkgr.js +32 -0
- package/dist/index-DrAbySpd.js +8859 -0
- package/dist/index-JxOM03oW.js +3 -0
- package/dist/index-X9YonBq5.js +76 -0
- package/dist/index-gvl1UKmI.js +2134 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index-zy0pOMPl.js +121 -0
- package/dist/index.esm2017-WVBFvkg-.js +3069 -0
- package/dist/loading-CKbcLJje.js +71 -0
- package/dist/lodash-B5I3zXaY.js +3678 -0
- package/dist/membership-BMv4jrI_.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-iY-Nby0p.js +15 -0
- package/dist/number-CluL-GzZ.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-sIFo0b00.js +145 -0
- package/dist/plugins-BlvUeMc1.js +208 -0
- package/dist/reward-CZlHuvJJ.js +36 -0
- package/dist/rule-DMH3fchR.js +1951 -0
- package/dist/rule-builder-BvBTYyZq.js +102 -0
- package/dist/style.css +4 -0
- package/dist/template-CzqV_mzm.js +190 -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-Bo8HWoc4.js +1151 -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-BGG22zoh.js +144 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/user-DesAMEEX.js +54 -0
- package/dist/vue-i18n-CN3WXgAO.js +2365 -0
- package/dist/xlsx-BKuxyTY9.js +15491 -0
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { defineComponent as C, ref as F, computed as g, resolveComponent as s, openBlock as u, createBlock as m, unref as d, withCtx as c, createVNode as p, normalizeClass as i, createCommentVNode as V, createElementVNode as k, toDisplayString as b, renderSlot as q, createElementBlock as S, Fragment as I, renderList as M } from "vue";
|
|
2
|
+
const B = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, z = /* @__PURE__ */ C({
|
|
3
|
+
__name: "ChipMenu",
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: !1
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
showItemLabel: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
placement: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: !1,
|
|
20
|
+
default: "bottom-end"
|
|
21
|
+
},
|
|
22
|
+
class: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: !1
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: !1
|
|
29
|
+
},
|
|
30
|
+
items: {
|
|
31
|
+
type: Array,
|
|
32
|
+
required: !1
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: !1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["update:model-value"],
|
|
40
|
+
setup(a, { emit: f }) {
|
|
41
|
+
const e = a, v = f, r = F(!1), y = g(
|
|
42
|
+
() => {
|
|
43
|
+
var n, t;
|
|
44
|
+
return (t = (n = e.items) == null ? void 0 : n.find((o) => o.value === e.modelValue)) == null ? void 0 : t.label;
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return (n, t) => {
|
|
48
|
+
const o = s("FmIcon"), _ = s("FmChip"), h = s("FmMenuItem"), w = s("FmMenu");
|
|
49
|
+
return u(), m(w, {
|
|
50
|
+
placement: a.placement || "bottom-end",
|
|
51
|
+
disabled: a.disabled == !0,
|
|
52
|
+
"model-value": d(r),
|
|
53
|
+
onMenuChanged: t[0] || (t[0] = (l) => r.value = l)
|
|
54
|
+
}, {
|
|
55
|
+
"menu-button": c(() => [
|
|
56
|
+
p(_, {
|
|
57
|
+
label: e.label,
|
|
58
|
+
class: i(e.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
59
|
+
}, {
|
|
60
|
+
default: c(() => [
|
|
61
|
+
e.icon ? (u(), m(o, {
|
|
62
|
+
key: 0,
|
|
63
|
+
name: e.icon,
|
|
64
|
+
class: i(e.class),
|
|
65
|
+
outline: "",
|
|
66
|
+
size: "sm"
|
|
67
|
+
}, null, 8, ["name", "class"])) : V("", !0),
|
|
68
|
+
k("div", B, b(e.label) + " " + b(a.showItemLabel ? d(y) : ""), 1),
|
|
69
|
+
p(o, {
|
|
70
|
+
name: d(r) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
71
|
+
class: i(e.class),
|
|
72
|
+
outline: "",
|
|
73
|
+
size: "sm"
|
|
74
|
+
}, null, 8, ["name", "class"])
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["label", "class"])
|
|
78
|
+
]),
|
|
79
|
+
default: c(() => [
|
|
80
|
+
q(n.$slots, "default", {}, () => [
|
|
81
|
+
(u(!0), S(I, null, M(e.items ?? [], (l) => (u(), m(h, {
|
|
82
|
+
key: l.value,
|
|
83
|
+
value: l.value,
|
|
84
|
+
label: l.label,
|
|
85
|
+
"model-value": e.modelValue === l.value,
|
|
86
|
+
"onUpdate:modelValue": (x) => v("update:model-value", l.value)
|
|
87
|
+
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
_: 3
|
|
91
|
+
}, 8, ["placement", "disabled", "model-value"]);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export {
|
|
96
|
+
z as _
|
|
97
|
+
};
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
var te = Object.defineProperty;
|
|
2
|
+
var ae = (g, i, d) => i in g ? te(g, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[i] = d;
|
|
3
|
+
var K = (g, i, d) => ae(g, typeof i != "symbol" ? i + "" : i, d);
|
|
4
|
+
import { defineComponent as H, ref as f, computed as J, watch as T, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as h, createVNode as r, createElementBlock as R, Fragment as N, renderList as le, createCommentVNode as U, onMounted as ne, h as Y } from "vue";
|
|
5
|
+
import { h as G } from "./moment-D7p2TMB-.js";
|
|
6
|
+
import { components as se } from "@feedmepos/ui-library";
|
|
7
|
+
import "./index-Bzv6BHPk.js";
|
|
8
|
+
import { J as re } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
+
import { u as Q } from "./loading-CKbcLJje.js";
|
|
10
|
+
import { u as ie } from "./app-wDQR6dpb.js";
|
|
11
|
+
import { useRoute as W, useRouter as ue } from "vue-router";
|
|
12
|
+
import { c as P } from "./index-zy0pOMPl.js";
|
|
13
|
+
import { e as p } from "./index-vh86FiIQ.js";
|
|
14
|
+
import { u as $, w as de } from "./xlsx-BKuxyTY9.js";
|
|
15
|
+
import { g as ce } from "./user-DesAMEEX.js";
|
|
16
|
+
import { u as me, _ as pe } from "./usePagination-Ds-cuHop.js";
|
|
17
|
+
import { a as fe } from "./plugins-BlvUeMc1.js";
|
|
18
|
+
import { m as ge } from "./index-BA5QwPCT.js";
|
|
19
|
+
import { o as Ce } from "./objectId-dwaoBfJX.js";
|
|
20
|
+
const be = { class: "space-y-16" }, ve = { class: "gap-16 grid grid-cols-2" }, he = { class: "flex items-center gap-8" }, ye = /* @__PURE__ */ H({
|
|
21
|
+
__name: "CreateCollectionSheet",
|
|
22
|
+
emits: ["success"],
|
|
23
|
+
setup(g, { expose: i, emit: d }) {
|
|
24
|
+
const { minor: S } = Q, w = W(), F = f(), k = f(!1), q = d, C = f(!1);
|
|
25
|
+
function D(s) {
|
|
26
|
+
C.value = s, s && (a.value = {
|
|
27
|
+
quantity: 1,
|
|
28
|
+
code: "",
|
|
29
|
+
codeConfig: {
|
|
30
|
+
length: 8,
|
|
31
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
32
|
+
prefix: "",
|
|
33
|
+
suffix: "",
|
|
34
|
+
pattern: "########"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const a = f({
|
|
39
|
+
quantity: 1,
|
|
40
|
+
code: "",
|
|
41
|
+
codeConfig: {
|
|
42
|
+
length: 8,
|
|
43
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
44
|
+
prefix: "",
|
|
45
|
+
suffix: "",
|
|
46
|
+
pattern: "########"
|
|
47
|
+
}
|
|
48
|
+
}), E = [
|
|
49
|
+
{
|
|
50
|
+
label: "Bulk codes",
|
|
51
|
+
value: "bulk",
|
|
52
|
+
sublabel: "Bulk generate unique codes"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "Custom code",
|
|
56
|
+
value: "single",
|
|
57
|
+
sublabel: "Enter your own custom codes"
|
|
58
|
+
}
|
|
59
|
+
], B = [
|
|
60
|
+
{
|
|
61
|
+
label: "Alphanumeric",
|
|
62
|
+
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Alphabetic",
|
|
66
|
+
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
67
|
+
},
|
|
68
|
+
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
69
|
+
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
70
|
+
{ label: "Numbers", value: "0123456789" },
|
|
71
|
+
{ label: "Custom", value: "" }
|
|
72
|
+
], y = f(B[0].value), c = f("bulk"), V = f(!1), A = J(() => w.params.id);
|
|
73
|
+
async function n(s) {
|
|
74
|
+
var e;
|
|
75
|
+
await ((e = F.value) == null ? void 0 : e.validateInputs()), k.value && await S(
|
|
76
|
+
async () => {
|
|
77
|
+
await P.createCollectionByCampaignId(A.value, s), await q("success");
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
message: "Creating claim(s)",
|
|
81
|
+
successMessage: "Claim(s) created"
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
i({
|
|
86
|
+
showSheet: D
|
|
87
|
+
}), T(
|
|
88
|
+
() => c.value,
|
|
89
|
+
(s, e) => {
|
|
90
|
+
e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
function l(s) {
|
|
94
|
+
if (c.value !== "single") return !1;
|
|
95
|
+
const e = s.split(`
|
|
96
|
+
`).map((v) => v.trim()).filter(Boolean);
|
|
97
|
+
return new Set(e).size !== e.length;
|
|
98
|
+
}
|
|
99
|
+
function b(s) {
|
|
100
|
+
return /[ \t]/.test(s);
|
|
101
|
+
}
|
|
102
|
+
return T(
|
|
103
|
+
() => a.value.codeConfig.length,
|
|
104
|
+
(s, e) => {
|
|
105
|
+
s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
|
|
106
|
+
}
|
|
107
|
+
), T(
|
|
108
|
+
() => a.value.codeConfig.pattern,
|
|
109
|
+
(s, e) => {
|
|
110
|
+
s != e && (a.value.codeConfig.length = (a.value.codeConfig.pattern.match(/#/g) || []).length);
|
|
111
|
+
}
|
|
112
|
+
), (s, e) => {
|
|
113
|
+
const v = u("FmRadio"), M = u("FmRadioGroup"), m = u("FmSwitch"), L = u("FmStepperField"), X = u("FmSelect"), _ = u("FmTextField"), Z = u("FmTextarea"), ee = u("FmForm"), O = u("FmButton"), oe = u("FmSideSheet");
|
|
114
|
+
return x(), z(oe, {
|
|
115
|
+
"max-width": 560,
|
|
116
|
+
"dismiss-away": !0,
|
|
117
|
+
header: "Create collection",
|
|
118
|
+
modelValue: o(C),
|
|
119
|
+
"onUpdate:modelValue": [
|
|
120
|
+
e[14] || (e[14] = (t) => j(C) ? C.value = t : null),
|
|
121
|
+
e[15] || (e[15] = (t) => C.value = t)
|
|
122
|
+
]
|
|
123
|
+
}, {
|
|
124
|
+
"side-sheet-footer": I(() => [
|
|
125
|
+
h("div", he, [
|
|
126
|
+
r(O, {
|
|
127
|
+
label: "Save",
|
|
128
|
+
onClick: e[12] || (e[12] = (t) => n(o(a))),
|
|
129
|
+
loading: o(ie)().isLoading
|
|
130
|
+
}, null, 8, ["loading"]),
|
|
131
|
+
r(O, {
|
|
132
|
+
label: "Cancel",
|
|
133
|
+
type: "button",
|
|
134
|
+
variant: "tertiary",
|
|
135
|
+
onClick: e[13] || (e[13] = (t) => C.value = !1)
|
|
136
|
+
})
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
default: I(() => [
|
|
140
|
+
r(re, { json: o(a) }, null, 8, ["json"]),
|
|
141
|
+
r(ee, {
|
|
142
|
+
ref_key: "form",
|
|
143
|
+
ref: F,
|
|
144
|
+
class: "space-y-40",
|
|
145
|
+
onValidationSuccess: e[10] || (e[10] = (t) => k.value = !0),
|
|
146
|
+
onValidationFailed: e[11] || (e[11] = (t) => k.value = !1)
|
|
147
|
+
}, {
|
|
148
|
+
default: I(() => [
|
|
149
|
+
h("div", null, [
|
|
150
|
+
e[16] || (e[16] = h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
|
|
151
|
+
r(M, {
|
|
152
|
+
modelValue: o(c),
|
|
153
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
|
|
154
|
+
inline: !1
|
|
155
|
+
}, {
|
|
156
|
+
default: I(() => [
|
|
157
|
+
(x(), R(N, null, le(E, (t) => r(v, {
|
|
158
|
+
key: t.value,
|
|
159
|
+
value: t.value,
|
|
160
|
+
label: t.label,
|
|
161
|
+
sublabel: t.sublabel
|
|
162
|
+
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}, 8, ["modelValue"])
|
|
166
|
+
]),
|
|
167
|
+
h("div", be, [
|
|
168
|
+
e[17] || (e[17] = h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
|
|
169
|
+
o(c) === "bulk" ? (x(), R(N, { key: 0 }, [
|
|
170
|
+
r(m, {
|
|
171
|
+
"model-value": o(V),
|
|
172
|
+
"label-placement": "right",
|
|
173
|
+
value: "true",
|
|
174
|
+
label: "Advance code setting",
|
|
175
|
+
required: !0,
|
|
176
|
+
"onUpdate:modelValue": e[1] || (e[1] = () => V.value = !o(V))
|
|
177
|
+
}, null, 8, ["model-value"]),
|
|
178
|
+
o(V) ? (x(), R(N, { key: 0 }, [
|
|
179
|
+
r(L, {
|
|
180
|
+
modelValue: o(a).codeConfig.length,
|
|
181
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
|
|
182
|
+
label: "Code length",
|
|
183
|
+
max: 16,
|
|
184
|
+
min: 1,
|
|
185
|
+
rules: [
|
|
186
|
+
(t) => Number(t) >= 1 || "Code length must at least 1",
|
|
187
|
+
(t) => Number(t) <= 16 || "Code length must less than 16"
|
|
188
|
+
],
|
|
189
|
+
required: !0
|
|
190
|
+
}, null, 8, ["modelValue", "rules"]),
|
|
191
|
+
r(X, {
|
|
192
|
+
label: "Charset",
|
|
193
|
+
"model-value": o(y),
|
|
194
|
+
items: B,
|
|
195
|
+
"helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
|
|
196
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => {
|
|
197
|
+
y.value = t, o(a).codeConfig.charset = t;
|
|
198
|
+
})
|
|
199
|
+
}, null, 8, ["model-value", "helper-text"]),
|
|
200
|
+
o(y) === "" ? (x(), z(_, {
|
|
201
|
+
key: 0,
|
|
202
|
+
modelValue: o(a).codeConfig.charset,
|
|
203
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
|
|
204
|
+
label: "Custom Charset",
|
|
205
|
+
required: ""
|
|
206
|
+
}, null, 8, ["modelValue"])) : U("", !0),
|
|
207
|
+
h("div", ve, [
|
|
208
|
+
r(_, {
|
|
209
|
+
modelValue: o(a).codeConfig.prefix,
|
|
210
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
|
|
211
|
+
label: "Prefix (Optional)"
|
|
212
|
+
}, null, 8, ["modelValue"]),
|
|
213
|
+
r(_, {
|
|
214
|
+
modelValue: o(a).codeConfig.suffix,
|
|
215
|
+
"onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
|
|
216
|
+
label: "Suffix (Optional)"
|
|
217
|
+
}, null, 8, ["modelValue"])
|
|
218
|
+
]),
|
|
219
|
+
r(_, {
|
|
220
|
+
modelValue: o(a).codeConfig.pattern,
|
|
221
|
+
"onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
|
|
222
|
+
label: "Pattern",
|
|
223
|
+
required: !0
|
|
224
|
+
}, null, 8, ["modelValue"])
|
|
225
|
+
], 64)) : U("", !0),
|
|
226
|
+
r(_, {
|
|
227
|
+
modelValue: o(a).quantity,
|
|
228
|
+
"onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
|
|
229
|
+
label: "Number of code",
|
|
230
|
+
rules: [
|
|
231
|
+
(t) => t >= 1 || "Quantity cannot be less than 1",
|
|
232
|
+
(t) => t <= 1e4 || "Quantity cannot more than 10,000"
|
|
233
|
+
],
|
|
234
|
+
required: !0,
|
|
235
|
+
"helper-text": `${o(a).quantity} claim will be created`
|
|
236
|
+
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
237
|
+
], 64)) : U("", !0),
|
|
238
|
+
o(c) !== "bulk" ? (x(), z(Z, {
|
|
239
|
+
key: 1,
|
|
240
|
+
modelValue: o(a).code,
|
|
241
|
+
"onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
|
|
242
|
+
label: "Custom Code",
|
|
243
|
+
rules: [
|
|
244
|
+
(t) => o(c) != "single" || !!t || "Custom code is required",
|
|
245
|
+
(t) => !l(t) || "Custom code must be unique",
|
|
246
|
+
(t) => !b(t) || "Custom code must not contain space"
|
|
247
|
+
],
|
|
248
|
+
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
249
|
+
}, null, 8, ["modelValue", "rules"])) : U("", !0)
|
|
250
|
+
])
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
}, 512)
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 8, ["modelValue"]);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
class xe {
|
|
261
|
+
constructor() {
|
|
262
|
+
K(this, "data", []);
|
|
263
|
+
}
|
|
264
|
+
addRecord(i) {
|
|
265
|
+
this.data.push(i);
|
|
266
|
+
}
|
|
267
|
+
buildExcel() {
|
|
268
|
+
const i = $.book_new(), d = $.json_to_sheet(this.data);
|
|
269
|
+
return $.book_append_sheet(i, d, "Collection"), i;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const Ve = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Se = { class: "flex items-center justify-end py-4 xs:hidden" }, ze = /* @__PURE__ */ H({
|
|
273
|
+
__name: "Collections",
|
|
274
|
+
setup(g) {
|
|
275
|
+
const i = ue(), d = W(), S = f(), w = J(() => d.params.id), F = f(!1), { custom: k } = Q, q = [
|
|
276
|
+
{
|
|
277
|
+
header: "ID/Code",
|
|
278
|
+
accessorKey: "_id",
|
|
279
|
+
cell(n) {
|
|
280
|
+
return Y("div", { class: "flex items-center" }, [
|
|
281
|
+
Y(se.FmIcon, {
|
|
282
|
+
name: "content_copy",
|
|
283
|
+
outline: !0,
|
|
284
|
+
size: "sm",
|
|
285
|
+
class: "cursor-pointer mr-4",
|
|
286
|
+
onClick: (l) => {
|
|
287
|
+
l.preventDefault(), l.stopPropagation(), fe(
|
|
288
|
+
n.row.original.code || n.row.original._id.toString()
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
}),
|
|
292
|
+
Y(
|
|
293
|
+
"div",
|
|
294
|
+
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
295
|
+
n.row.original.code || n.row.original._id.toString()
|
|
296
|
+
)
|
|
297
|
+
]);
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
header: "User",
|
|
302
|
+
accessorKey: "user",
|
|
303
|
+
enableSorting: !1,
|
|
304
|
+
cell(n) {
|
|
305
|
+
const l = n.row.original.pf_user;
|
|
306
|
+
return ce(l);
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
header: "Phone",
|
|
311
|
+
accessorFn: (n) => {
|
|
312
|
+
var l;
|
|
313
|
+
return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
|
|
314
|
+
},
|
|
315
|
+
accessorKey: "pf_user.phoneNumber"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
header: "Balance",
|
|
319
|
+
accessorKey: "balance"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
header: "Created at",
|
|
323
|
+
accessorKey: "_id",
|
|
324
|
+
accessorFn: (n) => G(Ce(n._id.toString())).format("DD MMM YYYY")
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
header: "Nearest expired at",
|
|
328
|
+
accessorKey: "expiryBalance",
|
|
329
|
+
accessorFn: (n) => {
|
|
330
|
+
var l;
|
|
331
|
+
return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
], C = {
|
|
335
|
+
"$connect-STORE_REWARD_COLLECTIONS": ge.readCollectionsByRewardId,
|
|
336
|
+
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": P.readCollectionsByCampaignId
|
|
337
|
+
}, D = (n) => {
|
|
338
|
+
const l = C[d.name];
|
|
339
|
+
return (b) => l(n, b);
|
|
340
|
+
}, { tableMeta: a, rowData: E, onSort: B, debouncedFetchData: y, onSearch: c } = me(D(w.value));
|
|
341
|
+
async function V() {
|
|
342
|
+
var n;
|
|
343
|
+
await y(), (n = S.value) == null || n.showSheet(!1);
|
|
344
|
+
}
|
|
345
|
+
async function A() {
|
|
346
|
+
F.value || k(
|
|
347
|
+
async () => {
|
|
348
|
+
var s;
|
|
349
|
+
const n = new xe(), l = (await P.readCollectionsByCampaignId(w.value, {
|
|
350
|
+
limit: 1,
|
|
351
|
+
skip: 0,
|
|
352
|
+
sortBy: p.sortBy,
|
|
353
|
+
descending: p.descending
|
|
354
|
+
})).meta.totalResources ?? 0, b = p.rowsPerPage;
|
|
355
|
+
for (let e = 0; e < l; e += b) {
|
|
356
|
+
const v = {
|
|
357
|
+
...p,
|
|
358
|
+
limit: b,
|
|
359
|
+
skip: p.page - 1,
|
|
360
|
+
sortBy: p.sortBy,
|
|
361
|
+
descending: p.descending
|
|
362
|
+
}, M = await P.readCollectionsByCampaignId(
|
|
363
|
+
w.value,
|
|
364
|
+
v
|
|
365
|
+
);
|
|
366
|
+
for await (const m of M.resources) {
|
|
367
|
+
const L = {
|
|
368
|
+
Id: (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()) || "",
|
|
369
|
+
Balance: (m == null ? void 0 : m.balance) || 0
|
|
370
|
+
};
|
|
371
|
+
n.addRecord(L);
|
|
372
|
+
}
|
|
373
|
+
p.page++;
|
|
374
|
+
}
|
|
375
|
+
await de(
|
|
376
|
+
n.buildExcel(),
|
|
377
|
+
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
378
|
+
{
|
|
379
|
+
bookType: "xlsx",
|
|
380
|
+
bookSST: !1,
|
|
381
|
+
type: "array"
|
|
382
|
+
}
|
|
383
|
+
), p.page = 1;
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
isLoading: F
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
return ne(async () => {
|
|
391
|
+
await y();
|
|
392
|
+
}), (n, l) => {
|
|
393
|
+
const b = u("FmPageHead"), s = u("FmSearch");
|
|
394
|
+
return x(), R(N, null, [
|
|
395
|
+
r(b, {
|
|
396
|
+
title: "Collections",
|
|
397
|
+
"back-button": !0,
|
|
398
|
+
actions: [
|
|
399
|
+
{ label: "Export", value: "export", isPrimary: !1 },
|
|
400
|
+
{
|
|
401
|
+
label: "Create collection",
|
|
402
|
+
value: "create",
|
|
403
|
+
isPrimary: !0
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"onClick:back": l[0] || (l[0] = (e) => o(i).back()),
|
|
407
|
+
"onClick:action": l[1] || (l[1] = (e) => {
|
|
408
|
+
var v;
|
|
409
|
+
e === "create" && ((v = o(S)) == null || v.showSheet(!0)), e === "export" && A();
|
|
410
|
+
})
|
|
411
|
+
}),
|
|
412
|
+
h("div", Ve, [
|
|
413
|
+
r(s, {
|
|
414
|
+
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
415
|
+
modelValue: o(a).searchValue,
|
|
416
|
+
"onUpdate:modelValue": [
|
|
417
|
+
l[2] || (l[2] = (e) => o(a).searchValue = e),
|
|
418
|
+
o(c)
|
|
419
|
+
],
|
|
420
|
+
placeholder: "Search",
|
|
421
|
+
collapsible: ""
|
|
422
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
423
|
+
h("div", Se, [
|
|
424
|
+
r(s, {
|
|
425
|
+
modelValue: o(a).searchValue,
|
|
426
|
+
"onUpdate:modelValue": [
|
|
427
|
+
l[3] || (l[3] = (e) => o(a).searchValue = e),
|
|
428
|
+
o(c)
|
|
429
|
+
],
|
|
430
|
+
placeholder: "Search",
|
|
431
|
+
collapsible: ""
|
|
432
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
433
|
+
]),
|
|
434
|
+
r(pe, {
|
|
435
|
+
loading: o(a).isLoading,
|
|
436
|
+
"row-data": o(E),
|
|
437
|
+
"column-defs": q,
|
|
438
|
+
"row-count": o(a).totalRows,
|
|
439
|
+
"page-count": o(a).pageCount,
|
|
440
|
+
"page-index": o(a).pageIndex,
|
|
441
|
+
"page-size": o(a).pageSize,
|
|
442
|
+
"shrink-at": !1,
|
|
443
|
+
onSortChange: o(B),
|
|
444
|
+
onPageChange: l[4] || (l[4] = (e) => o(y)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
|
|
445
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
446
|
+
r(ye, {
|
|
447
|
+
ref_key: "sheetRef",
|
|
448
|
+
ref: S,
|
|
449
|
+
onSuccess: V
|
|
450
|
+
}, null, 512)
|
|
451
|
+
])
|
|
452
|
+
], 64);
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
export {
|
|
457
|
+
ze as default
|
|
458
|
+
};
|