@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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/package.json +1 -1
- package/dist/Analytic-BqvhYgCU.js +0 -427
- package/dist/App-Dtl_D0cH.js +0 -4630
- package/dist/Bin-y4ikpgPS.js +0 -166
- package/dist/Broadcast-DSROFwe4.js +0 -233
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
- package/dist/Card-BiSEPsZb.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CX-nN7Xj.js +0 -458
- package/dist/Credit-IiV9b4cB.js +0 -228
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
- package/dist/Experience-Cf-EMhKy.js +0 -229
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C8mfJn6W.js +0 -284
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
- package/dist/Index-DkvO1AoT.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-xJTIo3RF.js +0 -319
- package/dist/Member-DZkYoKW8.js +0 -279
- package/dist/MemberList-CAYEJnf3.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
- package/dist/Mission-C_NbNWZw.js +0 -302
- package/dist/Overview-DyxEwEfe.js +0 -1079
- package/dist/Point-CsEWk61V.js +0 -232
- package/dist/Promotion--pWgy9Dx.js +0 -289
- package/dist/Queue-k3qAQR7B.js +0 -260
- package/dist/Record-D5F5JyVA.js +0 -341
- package/dist/Reward-3FSrq5mX.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
- package/dist/Segment-BWJn6ODR.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
- package/dist/Setting-UiTXazZV.js +0 -1936
- package/dist/Store-BrvmHPCX.js +0 -1842
- package/dist/StoreRewards-D_7fr-Ef.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
- package/dist/Tier-C4wvx8F7.js +0 -895
- package/dist/Title-CPHT85Uj.js +0 -566
- package/dist/Transaction-6Ig2W00P.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
- package/dist/Voucher-Bbl-7gZ5.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BDVZwARN.js +0 -7057
- package/dist/app-CAEhNFRG.js +0 -57962
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -6
- package/dist/business-6C_ol5wd.js +0 -82
- package/dist/campaign-B13G6pZ3.js +0 -1810
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DrQp6qBu.js +0 -94
- package/dist/campaign.enum-DnTrlaNC.js +0 -20
- package/dist/campaign.fn-BZse90_k.js +0 -758
- package/dist/collectible.enum-633Me0yR.js +0 -19
- package/dist/collection.fn-C96855j5.js +0 -26
- package/dist/dto-2bMujqmZ.js +0 -216
- package/dist/effect-C7lAJwKh.js +0 -78
- package/dist/email-addresses-3ayN-9jv.js +0 -705
- package/dist/export-BNbDV7SC.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-CsfZ__dQ.js +0 -71
- package/dist/index-BLSAz0gK.js +0 -32
- package/dist/index-BY9I3Cer.js +0 -3
- package/dist/index-BdnRNcVO.js +0 -146
- package/dist/index-BmyNfpfG.js +0 -30076
- package/dist/index-CSBRkhKy.js +0 -38
- package/dist/index-Cf_fcvoS.js +0 -54
- package/dist/index-CqrO13uj.js +0 -76
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D4kdSzs9.js +0 -3070
- package/dist/index-DcJq7tl4.js +0 -32269
- package/dist/index-DdjSIwSL.js +0 -44
- package/dist/index-LKr2k8J2.js +0 -8861
- package/dist/index-XAxwm-1v.js +0 -2130
- package/dist/index-b82LrGSB.js +0 -121
- package/dist/index-tcAb0W5F.js +0 -31
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-BklqmujQ.js +0 -3069
- package/dist/loading-OXARGiqO.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-D1Vb1rUo.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-BpyAytEq.js +0 -15
- package/dist/number-C-PtPOOj.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BrLIKTmQ.js +0 -145
- package/dist/plugins-CjPWhNb2.js +0 -208
- package/dist/reward-DonQFzvW.js +0 -36
- package/dist/rule-AtNPBnbE.js +0 -1951
- package/dist/rule-builder-C0Q-3g6T.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-CNjE7eht.js +0 -190
- 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-CYbdI3q2.js +0 -1151
- 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-Bdi6n80h.js +0 -144
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-BwGm78n8.js +0 -54
- package/dist/vue-i18n-D1nTd69a.js +0 -2365
- package/dist/xlsx-DF5iW3wh.js +0 -15491
- package/dist/zod-Bg2FbC-D.js +0 -90
package/dist/Queue-k3qAQR7B.js
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, h as n, ref as A, watch as B, onBeforeMount as U, resolveComponent as V, openBlock as z, createElementBlock as O, Fragment as q, createVNode as m, unref as o, createElementVNode as f } from "vue";
|
|
2
|
-
import { u as L, _ as Y } from "./usePagination-Ds-cuHop.js";
|
|
3
|
-
import { _ as S } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
4
|
-
import { c as u, a as G } from "./plugins-CjPWhNb2.js";
|
|
5
|
-
import { useDialog as K, components as b } from "@feedmepos/ui-library";
|
|
6
|
-
import { D as c, c as d } from "./index-D4kdSzs9.js";
|
|
7
|
-
import "./index-LKr2k8J2.js";
|
|
8
|
-
import "./index-XAxwm-1v.js";
|
|
9
|
-
import "./index-CSBRkhKy.js";
|
|
10
|
-
import "./index-Cf_fcvoS.js";
|
|
11
|
-
import "./index-DcJq7tl4.js";
|
|
12
|
-
import { h as y } from "./moment-D7p2TMB-.js";
|
|
13
|
-
import { u as j } from "./vue-i18n-D1nTd69a.js";
|
|
14
|
-
import { u as H, v as W, w as $ } from "./index.esm2017-BklqmujQ.js";
|
|
15
|
-
import { useRoute as Q } from "vue-router";
|
|
16
|
-
import { g as J, S as X, u as Z } from "./index-BmyNfpfG.js";
|
|
17
|
-
import { o as ee } from "./objectId-dwaoBfJX.js";
|
|
18
|
-
const te = () => {
|
|
19
|
-
if (!X.getBusinessId()) throw new Error("Invalid business ID");
|
|
20
|
-
return Z("queues");
|
|
21
|
-
}, oe = {
|
|
22
|
-
async readImportMember(p, w) {
|
|
23
|
-
return J(
|
|
24
|
-
await te().get("", {
|
|
25
|
-
params: { ...p, ...w }
|
|
26
|
-
})
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var ae = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" };
|
|
31
|
-
const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-center justify-between" }, se = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, De = /* @__PURE__ */ h({
|
|
32
|
-
__name: "Queue",
|
|
33
|
-
setup(p) {
|
|
34
|
-
const x = Q().query.type, { t: D } = j(), E = K(), v = [
|
|
35
|
-
{
|
|
36
|
-
header: "ID",
|
|
37
|
-
accessorKey: "_id",
|
|
38
|
-
meta: {
|
|
39
|
-
maxWidth: "100px"
|
|
40
|
-
},
|
|
41
|
-
cell(t) {
|
|
42
|
-
return n("div", { class: "flex items-center" }, [
|
|
43
|
-
n(b.FmIcon, {
|
|
44
|
-
name: "content_copy",
|
|
45
|
-
outline: !0,
|
|
46
|
-
size: "sm",
|
|
47
|
-
class: "cursor-pointer mr-4",
|
|
48
|
-
onClick: (e) => {
|
|
49
|
-
e.preventDefault(), e.stopPropagation(), G(t.row.original._id.toString());
|
|
50
|
-
}
|
|
51
|
-
}),
|
|
52
|
-
n(
|
|
53
|
-
"div",
|
|
54
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
55
|
-
t.row.original._id.toString()
|
|
56
|
-
)
|
|
57
|
-
]);
|
|
58
|
-
},
|
|
59
|
-
enableSorting: !1
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
header: "Type",
|
|
63
|
-
accessorFn: (t) => u.title(t.type.replace("_", " ")),
|
|
64
|
-
enableSorting: !1
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
header: "Status",
|
|
68
|
-
accessorFn: (t) => {
|
|
69
|
-
var e;
|
|
70
|
-
return t.status ? u.title((e = t.status) == null ? void 0 : e.toString()) : "-";
|
|
71
|
-
},
|
|
72
|
-
cell(t) {
|
|
73
|
-
const e = t.row.original.status;
|
|
74
|
-
return n(b.FmChip, {
|
|
75
|
-
label: e ? u.title(e) : "-",
|
|
76
|
-
compact: !0,
|
|
77
|
-
class: F(e)
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
enableSorting: !1
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
header: "Ref",
|
|
84
|
-
accessorKey: "ref",
|
|
85
|
-
enableSorting: !1
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
header: "Created at",
|
|
89
|
-
accessorFn: (t) => y(ee(t._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
90
|
-
enableSorting: !0
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
header: "Context",
|
|
94
|
-
cell(t) {
|
|
95
|
-
var r, a;
|
|
96
|
-
const e = ((a = (r = t.row.original.context) == null ? void 0 : r.context) == null ? void 0 : a.file) || null;
|
|
97
|
-
return e != null && e.downloadUrl && (e != null && e.originalName) ? n(
|
|
98
|
-
"a",
|
|
99
|
-
{
|
|
100
|
-
class: "fm-typo-en-link-md-600",
|
|
101
|
-
href: e.downloadUrl,
|
|
102
|
-
download: e.originalName,
|
|
103
|
-
target: "_blank",
|
|
104
|
-
rel: "noopener"
|
|
105
|
-
},
|
|
106
|
-
e.originalName
|
|
107
|
-
) : e != null && e.originalName ? n("div", null, e.originalName) : n("div", null, "-");
|
|
108
|
-
},
|
|
109
|
-
enableSorting: !1
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
header: "Failed reason",
|
|
113
|
-
cell(t) {
|
|
114
|
-
return n(b.FmButton, {
|
|
115
|
-
icon: "visibility",
|
|
116
|
-
variant: "tertiary",
|
|
117
|
-
disabled: !t.row.original.failedReason,
|
|
118
|
-
onClick: (e) => {
|
|
119
|
-
e.preventDefault(), e.stopPropagation(), R(t.row.original.failedReason);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
enableSorting: !1
|
|
124
|
-
}
|
|
125
|
-
], F = (t) => {
|
|
126
|
-
switch (t) {
|
|
127
|
-
case c.enum.ACTIVE:
|
|
128
|
-
return "text-fm-color-typo-info bg-fm-color-system-info-100";
|
|
129
|
-
case c.enum.WAITING:
|
|
130
|
-
return "text-fm-color-typo-warning bg-fm-color-system-warning-100";
|
|
131
|
-
case c.enum.COMPLETED:
|
|
132
|
-
return "text-fm-color-typo-success bg-fm-color-system-success-100";
|
|
133
|
-
case c.enum.FAILED:
|
|
134
|
-
return "text-fm-color-typo-error bg-fm-color-system-error-100";
|
|
135
|
-
default:
|
|
136
|
-
return "text-fm-color-typo-primary bg-fm-color-system-primary-100";
|
|
137
|
-
}
|
|
138
|
-
}, C = h({
|
|
139
|
-
name: "FailedReasonDialog",
|
|
140
|
-
props: {
|
|
141
|
-
data: {
|
|
142
|
-
type: String,
|
|
143
|
-
required: !0
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
setup(t) {
|
|
147
|
-
return () => n("div", { class: "whitespace-pre-line" }, t.data);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
async function R(t) {
|
|
151
|
-
E.open({
|
|
152
|
-
title: "Failed Reason",
|
|
153
|
-
closeButton: !0,
|
|
154
|
-
dismissAway: !0,
|
|
155
|
-
contentComponent: C,
|
|
156
|
-
contentComponentProps: {
|
|
157
|
-
data: t
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
const T = async (t) => {
|
|
162
|
-
const e = H(void 0, ae.importFilesBucketUrl), r = W(e, t);
|
|
163
|
-
return await $(r);
|
|
164
|
-
}, M = c.options.map((t) => ({ label: u.title(t), value: t })), s = A({
|
|
165
|
-
type: x ?? [
|
|
166
|
-
d.enum.MEMBER_IMPORTED,
|
|
167
|
-
d.enum.SEGMENTATION_IMPORTED
|
|
168
|
-
],
|
|
169
|
-
status: []
|
|
170
|
-
}), { tableMeta: i, rowData: N, onSort: k, debouncedFetchData: g } = L(
|
|
171
|
-
async (t) => {
|
|
172
|
-
const e = {
|
|
173
|
-
...s.value
|
|
174
|
-
}, r = await oe.readImportMember(t, e);
|
|
175
|
-
return await Promise.all(
|
|
176
|
-
r.resources.map(async (a) => {
|
|
177
|
-
var _, I;
|
|
178
|
-
const l = (I = (_ = a.context) == null ? void 0 : _.context) == null ? void 0 : I.file;
|
|
179
|
-
if (y(a.context.emittedAt).diff(y(), "days") < 7 && l)
|
|
180
|
-
try {
|
|
181
|
-
l.downloadUrl = await T(l == null ? void 0 : l.fbFilePath);
|
|
182
|
-
} catch (P) {
|
|
183
|
-
console.log(P);
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
), {
|
|
187
|
-
resources: r.resources,
|
|
188
|
-
meta: r.meta
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
return B(
|
|
193
|
-
s,
|
|
194
|
-
() => {
|
|
195
|
-
g();
|
|
196
|
-
},
|
|
197
|
-
{ deep: !0 }
|
|
198
|
-
), U(async () => {
|
|
199
|
-
await g();
|
|
200
|
-
}), (t, e) => {
|
|
201
|
-
const r = V("FmPageHead");
|
|
202
|
-
return z(), O(q, null, [
|
|
203
|
-
m(r, {
|
|
204
|
-
title: o(D)("connect.queue.title")
|
|
205
|
-
}, null, 8, ["title"]),
|
|
206
|
-
f("div", re, [
|
|
207
|
-
f("div", ne, [
|
|
208
|
-
f("div", se, [
|
|
209
|
-
m(S, {
|
|
210
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
211
|
-
"right-icon": "keyboard_arrow_down",
|
|
212
|
-
modelValue: o(s).type,
|
|
213
|
-
"onUpdate:modelValue": e[0] || (e[0] = (a) => o(s).type = a),
|
|
214
|
-
label: "Type: ",
|
|
215
|
-
"show-item-label": !0,
|
|
216
|
-
items: [
|
|
217
|
-
{
|
|
218
|
-
label: "Member Imported",
|
|
219
|
-
value: o(d).enum.MEMBER_IMPORTED
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
label: "Segmentation Imported",
|
|
223
|
-
value: o(d).enum.SEGMENTATION_IMPORTED
|
|
224
|
-
}
|
|
225
|
-
]
|
|
226
|
-
}, null, 8, ["modelValue", "items"]),
|
|
227
|
-
m(S, {
|
|
228
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
229
|
-
"right-icon": "keyboard_arrow_down",
|
|
230
|
-
modelValue: o(s).status,
|
|
231
|
-
"onUpdate:modelValue": e[1] || (e[1] = (a) => o(s).status = a),
|
|
232
|
-
label: "Status: ",
|
|
233
|
-
"show-item-label": !0,
|
|
234
|
-
items: o(M)
|
|
235
|
-
}, null, 8, ["modelValue", "items"])
|
|
236
|
-
])
|
|
237
|
-
]),
|
|
238
|
-
m(Y, {
|
|
239
|
-
loading: o(i).isLoading,
|
|
240
|
-
"row-data": o(N),
|
|
241
|
-
"row-count": o(i).totalRows,
|
|
242
|
-
"column-defs": v,
|
|
243
|
-
"page-count": o(i).pageCount,
|
|
244
|
-
"page-index": o(i).pageIndex,
|
|
245
|
-
"page-size": o(i).pageSize,
|
|
246
|
-
"shrink-at": !1,
|
|
247
|
-
onSortChange: o(k),
|
|
248
|
-
onPageChange: e[2] || (e[2] = (a) => o(g)({
|
|
249
|
-
pageSize: a.pageSize,
|
|
250
|
-
pageIndex: a.pageIndex
|
|
251
|
-
}))
|
|
252
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
|
|
253
|
-
])
|
|
254
|
-
], 64);
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
export {
|
|
259
|
-
De as default
|
|
260
|
-
};
|
package/dist/Record-D5F5JyVA.js
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
var q = Object.defineProperty;
|
|
2
|
-
var G = (g, o, m) => o in g ? q(g, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[o] = m;
|
|
3
|
-
var z = (g, o, m) => G(g, typeof o != "symbol" ? o + "" : o, m);
|
|
4
|
-
import { defineComponent as T, ref as B, computed as H, resolveComponent as C, openBlock as I, createBlock as J, unref as n, isRef as Q, withCtx as X, createElementBlock as U, createVNode as w, withModifiers as Z, createCommentVNode as ee, createElementVNode as N, h, onMounted as re, Fragment as te } from "vue";
|
|
5
|
-
import { u as oe, _ as ae } from "./usePagination-Ds-cuHop.js";
|
|
6
|
-
import { g as A } from "./user-BwGm78n8.js";
|
|
7
|
-
import { components as R } from "@feedmepos/ui-library";
|
|
8
|
-
import "./index-DcJq7tl4.js";
|
|
9
|
-
import { u as j } from "./vue-i18n-D1nTd69a.js";
|
|
10
|
-
import { u as L } from "./loading-OXARGiqO.js";
|
|
11
|
-
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
12
|
-
import { r as v } from "./index-BLSAz0gK.js";
|
|
13
|
-
import { c as ie, a as ne } from "./object-qECH92oz.js";
|
|
14
|
-
import { u as ce } from "./membership-D1Vb1rUo.js";
|
|
15
|
-
import { a as le, c as de } from "./plugins-CjPWhNb2.js";
|
|
16
|
-
import { u as V, w as me } from "./xlsx-DF5iW3wh.js";
|
|
17
|
-
import { e as f } from "./index-vh86FiIQ.js";
|
|
18
|
-
import { h as ue } from "./moment-D7p2TMB-.js";
|
|
19
|
-
import { o as pe } from "./objectId-dwaoBfJX.js";
|
|
20
|
-
const fe = {
|
|
21
|
-
key: 0,
|
|
22
|
-
class: "flex justify-end mb-16"
|
|
23
|
-
}, ge = { class: "flex flex-col space-y-16 pr-12" }, he = /* @__PURE__ */ T({
|
|
24
|
-
__name: "UpdateCriteriaProgressSheet",
|
|
25
|
-
emits: ["refresh"],
|
|
26
|
-
setup(g, { expose: o, emit: m }) {
|
|
27
|
-
const y = m;
|
|
28
|
-
j();
|
|
29
|
-
const { minor: k } = L, l = B(!1), d = B({}), F = se(), S = [
|
|
30
|
-
{
|
|
31
|
-
header: "Criteria title",
|
|
32
|
-
accessorFn: (a) => a.name
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
header: "Status",
|
|
36
|
-
cell(a) {
|
|
37
|
-
var u;
|
|
38
|
-
const e = a.row.original, r = (u = d.value.criteria_progress) == null ? void 0 : u.find(
|
|
39
|
-
(_) => _.criteria === e._id
|
|
40
|
-
), i = r ? "Completed" : "Pending", c = r ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
|
|
41
|
-
return [
|
|
42
|
-
h(R.FmChip, {
|
|
43
|
-
label: i,
|
|
44
|
-
compact: !0,
|
|
45
|
-
class: c
|
|
46
|
-
})
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "actions",
|
|
52
|
-
cell(a) {
|
|
53
|
-
var i;
|
|
54
|
-
const e = a.row.original;
|
|
55
|
-
return [
|
|
56
|
-
!((i = d.value.criteria_progress) == null ? void 0 : i.some(
|
|
57
|
-
(c) => c.criteria === e._id
|
|
58
|
-
)) && e.type == "MANUAL" ? h(R.FmButton, {
|
|
59
|
-
variant: "secondary",
|
|
60
|
-
label: "Mark as completed",
|
|
61
|
-
size: "md",
|
|
62
|
-
onClick: (c) => {
|
|
63
|
-
c.stopPropagation(), x(e._id.toString());
|
|
64
|
-
}
|
|
65
|
-
}) : null
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
], M = H(() => {
|
|
70
|
-
var e, r, i, c;
|
|
71
|
-
return (((r = (e = d.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : r.filter(
|
|
72
|
-
(u) => {
|
|
73
|
-
var _;
|
|
74
|
-
return (_ = d.value) == null ? void 0 : _.criteria.some(
|
|
75
|
-
(P) => P._id.toString() === u.criteria.toString()
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
)) || []).length == ((i = d.value) == null ? void 0 : i.criteria.length) && ((c = d.value) == null ? void 0 : c.status) != "COMPLETED";
|
|
79
|
-
});
|
|
80
|
-
async function x(a) {
|
|
81
|
-
var r;
|
|
82
|
-
const e = ie(ne(d.value));
|
|
83
|
-
e.criteria_progress = [
|
|
84
|
-
{
|
|
85
|
-
criteria: a,
|
|
86
|
-
ref: `ADMIN:${(r = F.user) == null ? void 0 : r.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
87
|
-
completedAt: /* @__PURE__ */ new Date()
|
|
88
|
-
}
|
|
89
|
-
], k(
|
|
90
|
-
async () => {
|
|
91
|
-
await v.updateCriteriaProgress(
|
|
92
|
-
d.value._id,
|
|
93
|
-
e
|
|
94
|
-
), l.value = !1, y("refresh");
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
message: "Updating criteria progress",
|
|
98
|
-
successMessage: "Criteria progress updated successfully"
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
function t(a, e) {
|
|
103
|
-
l.value = a, d.value = e;
|
|
104
|
-
}
|
|
105
|
-
function s() {
|
|
106
|
-
l.value = !1;
|
|
107
|
-
}
|
|
108
|
-
return o({
|
|
109
|
-
showSheet: t,
|
|
110
|
-
hideSheet: s,
|
|
111
|
-
data: d
|
|
112
|
-
}), (a, e) => {
|
|
113
|
-
const r = C("FmButton"), i = C("FmTable"), c = C("FmSideSheet");
|
|
114
|
-
return I(), J(c, {
|
|
115
|
-
"max-width": 768,
|
|
116
|
-
modelValue: n(l),
|
|
117
|
-
"onUpdate:modelValue": e[1] || (e[1] = (u) => Q(l) ? l.value = u : null),
|
|
118
|
-
header: "Referee Criteria"
|
|
119
|
-
}, {
|
|
120
|
-
default: X(() => [
|
|
121
|
-
n(M) ? (I(), U("div", fe, [
|
|
122
|
-
w(r, {
|
|
123
|
-
icon: "refresh",
|
|
124
|
-
label: "Refresh",
|
|
125
|
-
onClick: e[0] || (e[0] = Z((u) => x(n(d)._id), ["stop"]))
|
|
126
|
-
})
|
|
127
|
-
])) : ee("", !0),
|
|
128
|
-
N("div", ge, [
|
|
129
|
-
w(i, {
|
|
130
|
-
"row-data": n(d).criteria,
|
|
131
|
-
"hide-footer": !0,
|
|
132
|
-
"page-size": 100,
|
|
133
|
-
"column-defs": S
|
|
134
|
-
}, null, 8, ["row-data"])
|
|
135
|
-
])
|
|
136
|
-
]),
|
|
137
|
-
_: 1
|
|
138
|
-
}, 8, ["modelValue"]);
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
class _e {
|
|
143
|
-
constructor() {
|
|
144
|
-
z(this, "data", []);
|
|
145
|
-
}
|
|
146
|
-
addRecord(o) {
|
|
147
|
-
this.data.push(o);
|
|
148
|
-
}
|
|
149
|
-
buildExcel() {
|
|
150
|
-
const o = V.book_new(), m = V.json_to_sheet(this.data);
|
|
151
|
-
return V.book_append_sheet(o, m, "Referrals"), o;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const we = { class: "flex items-center justify-end" }, $e = /* @__PURE__ */ T({
|
|
155
|
-
__name: "Record",
|
|
156
|
-
setup(g) {
|
|
157
|
-
const { t: o } = j();
|
|
158
|
-
ce();
|
|
159
|
-
const { minor: m } = L, y = B(null), k = [
|
|
160
|
-
{
|
|
161
|
-
header: "ID",
|
|
162
|
-
meta: {
|
|
163
|
-
maxWidth: "100px"
|
|
164
|
-
},
|
|
165
|
-
cell(t) {
|
|
166
|
-
return h("div", { class: "flex items-center" }, [
|
|
167
|
-
h(R.FmIcon, {
|
|
168
|
-
name: "content_copy",
|
|
169
|
-
outline: !0,
|
|
170
|
-
size: "sm",
|
|
171
|
-
class: "cursor-pointer mr-4",
|
|
172
|
-
onClick: (s) => {
|
|
173
|
-
s.preventDefault(), s.stopPropagation(), le(t.row.original._id.toString());
|
|
174
|
-
}
|
|
175
|
-
}),
|
|
176
|
-
h(
|
|
177
|
-
"div",
|
|
178
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
179
|
-
t.row.original._id.toString()
|
|
180
|
-
)
|
|
181
|
-
]);
|
|
182
|
-
},
|
|
183
|
-
enableSorting: !1
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
header: o("connect.referral.record.referer_info"),
|
|
187
|
-
enableSorting: !0,
|
|
188
|
-
cell(t) {
|
|
189
|
-
return t.row.original.pf_referer ? A(t.row.original.pf_referer, !0) : "N/A";
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
header: o("connect.referral.record.referee_info"),
|
|
194
|
-
enableSorting: !0,
|
|
195
|
-
cell(t) {
|
|
196
|
-
return t.row.original.pf_referee ? A(t.row.original.pf_referee, !0) : "N/A";
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
header: o("connect.referral.record.referee_criteria"),
|
|
201
|
-
accessorKey: "criteria",
|
|
202
|
-
id: "criteria",
|
|
203
|
-
cell(t) {
|
|
204
|
-
var r;
|
|
205
|
-
const a = (((r = t.row.original.criteria_progress) == null ? void 0 : r.filter(
|
|
206
|
-
(i) => t.row.original.criteria.some(
|
|
207
|
-
(c) => c._id.toString() === i.criteria.toString()
|
|
208
|
-
)
|
|
209
|
-
)) || []).length, e = t.row.original.criteria.length;
|
|
210
|
-
return e === 0 ? h("div", "No criteria") : h("div", `${a}/${e} completed criteria`);
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
header: o("connect.referral.record.status"),
|
|
215
|
-
id: "status",
|
|
216
|
-
cell(t) {
|
|
217
|
-
const s = t.row.original.status;
|
|
218
|
-
return h(R.FmChip, {
|
|
219
|
-
label: de.title(s.replace("_", " ")),
|
|
220
|
-
compact: !0,
|
|
221
|
-
class: s == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
], { tableMeta: l, rowData: d, onSort: F, debouncedFetchData: S, onSearch: M } = oe(v.readRecords);
|
|
226
|
-
async function x() {
|
|
227
|
-
const t = new _e(), s = (await v.readRecords({
|
|
228
|
-
limit: 1,
|
|
229
|
-
skip: 0,
|
|
230
|
-
sortBy: f.sortBy,
|
|
231
|
-
descending: f.descending
|
|
232
|
-
})).meta.totalResources ?? 0, a = f.rowsPerPage;
|
|
233
|
-
await m(
|
|
234
|
-
async () => {
|
|
235
|
-
var e, r, i, c;
|
|
236
|
-
for (let u = 0; u < s; u += a) {
|
|
237
|
-
const _ = {
|
|
238
|
-
...f,
|
|
239
|
-
limit: a,
|
|
240
|
-
skip: f.page - 1,
|
|
241
|
-
sortBy: f.sortBy,
|
|
242
|
-
descending: f.descending
|
|
243
|
-
}, P = await v.readRecords(_);
|
|
244
|
-
for (const p of P.resources) {
|
|
245
|
-
const E = (p.criteria || []).reduce(
|
|
246
|
-
(b, D) => {
|
|
247
|
-
var $;
|
|
248
|
-
const Y = (($ = p.criteria_progress) == null ? void 0 : $.filter(
|
|
249
|
-
(K) => p.criteria.some(
|
|
250
|
-
(W) => W._id.toString() === K.criteria.toString()
|
|
251
|
-
)
|
|
252
|
-
)) || [];
|
|
253
|
-
return b[D.name] = Y.length > 0 ? "Completed" : "In Progress", b;
|
|
254
|
-
},
|
|
255
|
-
{}
|
|
256
|
-
);
|
|
257
|
-
console.log(E);
|
|
258
|
-
const O = {
|
|
259
|
-
ID: p._id.toString(),
|
|
260
|
-
RefererName: ((e = p.pf_referer) == null ? void 0 : e.name) ?? "",
|
|
261
|
-
RefererPhone: ((r = p.pf_referer) == null ? void 0 : r.phoneNumber) ?? "",
|
|
262
|
-
RefereeName: ((i = p.pf_referee) == null ? void 0 : i.name) ?? "",
|
|
263
|
-
RefereePhone: ((c = p.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
|
|
264
|
-
ReferredAt: ue(pe(p._id)).format(
|
|
265
|
-
"DD/MM/YYYY"
|
|
266
|
-
),
|
|
267
|
-
Status: p.status,
|
|
268
|
-
Criteria: Object.entries(E).map(([b, D]) => `${b}: ${D}`).join(", ")
|
|
269
|
-
};
|
|
270
|
-
t.addRecord(O);
|
|
271
|
-
}
|
|
272
|
-
f.page++;
|
|
273
|
-
}
|
|
274
|
-
await me(
|
|
275
|
-
t.buildExcel(),
|
|
276
|
-
`referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
277
|
-
{
|
|
278
|
-
bookType: "xlsx",
|
|
279
|
-
bookSST: !1,
|
|
280
|
-
type: "array"
|
|
281
|
-
}
|
|
282
|
-
), f.page = 1;
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
message: "Exporting referral records...",
|
|
286
|
-
successMessage: "Referral record exported successfully"
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
return re(async () => {
|
|
291
|
-
await S();
|
|
292
|
-
}), (t, s) => {
|
|
293
|
-
const a = C("FmSearch"), e = C("FmButton");
|
|
294
|
-
return I(), U(te, null, [
|
|
295
|
-
N("div", null, [
|
|
296
|
-
N("div", we, [
|
|
297
|
-
w(a, {
|
|
298
|
-
class: "mt-4",
|
|
299
|
-
modelValue: n(l).searchValue,
|
|
300
|
-
"onUpdate:modelValue": [
|
|
301
|
-
s[0] || (s[0] = (r) => n(l).searchValue = r),
|
|
302
|
-
n(M)
|
|
303
|
-
],
|
|
304
|
-
placeholder: "Search",
|
|
305
|
-
collapsible: ""
|
|
306
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
307
|
-
w(e, {
|
|
308
|
-
icon: "ios_share",
|
|
309
|
-
variant: "tertiary",
|
|
310
|
-
onClick: x
|
|
311
|
-
})
|
|
312
|
-
]),
|
|
313
|
-
w(ae, {
|
|
314
|
-
loading: n(l).isLoading,
|
|
315
|
-
"row-data": n(d),
|
|
316
|
-
"row-count": n(l).totalRows,
|
|
317
|
-
"column-defs": k,
|
|
318
|
-
"shrink-at": !1,
|
|
319
|
-
"page-count": n(l).pageCount,
|
|
320
|
-
"page-index": n(l).pageIndex,
|
|
321
|
-
"page-size": n(l).pageSize,
|
|
322
|
-
onSortChange: n(F),
|
|
323
|
-
onPageChange: s[1] || (s[1] = (r) => n(S)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
|
|
324
|
-
onRowClick: s[2] || (s[2] = (r) => {
|
|
325
|
-
var i;
|
|
326
|
-
return (i = n(y)) == null ? void 0 : i.showSheet(!0, r.original);
|
|
327
|
-
})
|
|
328
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
|
|
329
|
-
]),
|
|
330
|
-
w(he, {
|
|
331
|
-
ref_key: "updateCriteriaProgressSheetRef",
|
|
332
|
-
ref: y,
|
|
333
|
-
onRefresh: n(S)
|
|
334
|
-
}, null, 8, ["onRefresh"])
|
|
335
|
-
], 64);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
export {
|
|
340
|
-
$e as default
|
|
341
|
-
};
|