@feedmepos/mf-connect 0.0.5-beta.20 → 0.0.5-beta.21

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.
Files changed (67) hide show
  1. package/dist/{Analytic-DUWe-WYz.js → Analytic-CVpCpEBl.js} +12 -13
  2. package/dist/{Broadcast-CAmI-dS9.js → Broadcast-C0SHdFpT.js} +11 -12
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CQbePPyW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B94-nKP4.js} +8 -8
  4. package/dist/Card-C5yXOEhK.js +827 -0
  5. package/dist/Collections-Ka_q_V3S.js +424 -0
  6. package/dist/{Credit-CxyIk-mH.js → Credit-CmTa3hjm.js} +11 -12
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-AGQwe70B.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CNSfNMA_.js} +23 -24
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-y263YYGy.js → EffectSheet.vue_vue_type_style_index_0_lang-BLfzJ46z.js} +5 -5
  9. package/dist/{Experience-DH6nbWal.js → Experience-yd4ZPBXy.js} +11 -12
  10. package/dist/{Game-BGMGl6Uw.js → Game-DYTplwOh.js} +22 -23
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rs3BEnpo.js → ImageInput.vue_vue_type_script_setup_true_lang-BuuYdlE4.js} +1 -1
  12. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BIwBZ7FH.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BfWuKa1w.js} +1 -1
  13. package/dist/{MainLayout-CjvNB4RK.js → MainLayout-8tc3ZtLI.js} +2 -2
  14. package/dist/{Marketing-BLbR9_KN.js → Marketing-D5Le-SWn.js} +19 -20
  15. package/dist/{Member-BqPHWUos.js → Member-CzY5Um_y.js} +2 -2
  16. package/dist/{MemberList-DoBv4aBY.js → MemberList-DpFa2ttF.js} +20 -21
  17. package/dist/{MemberTransactions-Cri3UCrX.js → MemberTransactions-CDKkRdfp.js} +4 -4
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang--qiv_ZUS.js → MessageInput.vue_vue_type_script_setup_true_lang-BD27S5wB.js} +4 -4
  19. package/dist/{Mission-BXRMH__V.js → Mission-9BmMMzyr.js} +25 -26
  20. package/dist/{Point-MS30HaX7.js → Point-IiWgZIyI.js} +11 -12
  21. package/dist/{Promotion-BuOELg3x.js → Promotion-BmEQ28sH.js} +42 -44
  22. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CAnO-3XN.js → RuleGroup.vue_vue_type_script_setup_true_lang-BhOoz0HL.js} +12 -12
  23. package/dist/{Segment-C9s9hDBX.js → Segment-D1ID4Rmt.js} +39 -40
  24. package/dist/{Setting-CHk3QEsN.js → Setting-B3WeabHJ.js} +17 -18
  25. package/dist/{Store-CQWAs4Ew.js → Store-CKFLaYKH.js} +18 -19
  26. package/dist/{StoreRewards-DJkh42Es.js → StoreRewards-DIQL173Q.js} +27 -28
  27. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2kjcViv.js +794 -0
  28. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CEBqSaBp.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C1QmPELI.js} +1 -1
  29. package/dist/{Tier-3zGwCsja.js → Tier-BvE47ciZ.js} +43 -43
  30. package/dist/{Title-TotAXw2n.js → Title-DfcczCHg.js} +42 -42
  31. package/dist/Transaction-CF0f3QCU.js +36 -0
  32. package/dist/Voucher-CCOZjT6k.js +481 -0
  33. package/dist/{app--rCS8dWb.js → app-B4oDOeXm.js} +1456 -1456
  34. package/dist/app.js +1 -1
  35. package/dist/{campaign-BPWXzTLO.js → campaign-BWwTQs_d.js} +2 -2
  36. package/dist/{collection.fn-NFB67-6j.js → collection.fn-C5XN0PPR.js} +2 -2
  37. package/dist/{dto-ChVvY7GG.js → dto-Ktuw3JiD.js} +138 -139
  38. package/dist/{effect-CbwZuhWY.js → effect-BM2dJl1a.js} +1 -1
  39. package/dist/export-LApNX--r.js +97 -0
  40. package/dist/{helper-D16-sxkv.js → helper-BUC1dAUX.js} +1 -1
  41. package/dist/{index-EmqFPQGb.js → index-B6GvsaDA.js} +1 -1
  42. package/dist/{index-DlqRXSLU.js → index-BZMMIcyM.js} +1 -1
  43. package/dist/{index-Blbjd5Y9.js → index-Bc-r4pik.js} +5 -5
  44. package/dist/{index-CGTaSvN6.js → index-Bt_xFt9g.js} +1 -1
  45. package/dist/{index-D-bPAs1d.js → index-C7qI5flU.js} +2 -2
  46. package/dist/{index-Dh6x04Wk.js → index-C86T8VON.js} +2 -2
  47. package/dist/{index-C7SZ9gvu.js → index-CvZ_MhCE.js} +7 -7
  48. package/dist/{index-vsgk07Y2.js → index-CzVShOLS.js} +1 -1
  49. package/dist/{index-BGAWJ6-h.js → index-DSUUVWFu.js} +3 -3
  50. package/dist/{index--VC0kdJZ.js → index-DVJQt0_Q.js} +2 -2
  51. package/dist/{plugins-Ccv9TIl4.js → loading-CM3ZyteE.js} +8204 -8108
  52. package/dist/{lodash-7Fz14kKI.js → lodash-DYMRs712.js} +1 -1
  53. package/dist/{membership-ByQds6Nb.js → membership-D0Z9EBWi.js} +3 -3
  54. package/dist/{money-DsiT1-aV.js → money-Cyt6uuok.js} +1 -1
  55. package/dist/{number-D4SI_vwy.js → number-CSBV_14_.js} +1 -1
  56. package/dist/{rule-NzJI8lrC.js → rule-C4ovkUox.js} +2 -2
  57. package/dist/{rule-builder-CNz0WgMq.js → rule-builder-DxDhft7B.js} +1 -1
  58. package/dist/{template-9wDwTGR-.js → template-Dd9xYS-m.js} +6 -6
  59. package/dist/{usePagination-CsZrmXsU.js → usePagination-cObe7G1g.js} +1 -1
  60. package/dist/{xlsx-CUa5ix7U.js → xlsx--baqnGDY.js} +1 -1
  61. package/package.json +1 -1
  62. package/dist/Card-DhgETjhz.js +0 -914
  63. package/dist/Collections-9fPXIR34.js +0 -424
  64. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-1GgzlIRZ.js +0 -693
  65. package/dist/Transaction-gV9vaJCR.js +0 -34
  66. package/dist/Voucher-BJ-pXo7Y.js +0 -449
  67. package/dist/loading-B5tUSWjN.js +0 -100
@@ -1,693 +0,0 @@
1
- import { defineComponent as O, ref as I, computed as M, onMounted as A, resolveComponent as _, openBlock as x, createBlock as T, unref as e, withCtx as k, createVNode as g, normalizeClass as E, createCommentVNode as Z, createElementVNode as C, toDisplayString as z, createElementBlock as P, Fragment as ee, renderList as te, mergeModels as B, useModel as ae, watch as U, onBeforeMount as oe, h as c } from "vue";
2
- import { components as S } from "@feedmepos/ui-library";
3
- import { d as ne } from "./index-D-bPAs1d.js";
4
- import { c as q } from "./plugins-Ccv9TIl4.js";
5
- import { s as re } from "./index-Dbd4WA4r.js";
6
- import { h as b } from "./moment-BWErdI6_.js";
7
- import { s as L } from "./index-CuvNtC_M.js";
8
- import { f as le } from "./number-D4SI_vwy.js";
9
- import { d as Y, i as se, S as ie, f as ce, a as ue } from "./app--rCS8dWb.js";
10
- import { u as K, _ as H } from "./usePagination-CsZrmXsU.js";
11
- import { g as de } from "./user-Bm4KttFq.js";
12
- import { o as G } from "./objectId-dwaoBfJX.js";
13
- function me(o) {
14
- let s = "";
15
- switch (o) {
16
- case "PORTAL":
17
- s = "ADMIN";
18
- break;
19
- case "EXPIRED":
20
- s = "EXPIRED";
21
- break;
22
- case "BENEFIT":
23
- s = "MEMBERSHIP";
24
- break;
25
- case "ORDER":
26
- s = "ORDER";
27
- break;
28
- case "BILL":
29
- s = "SPENDING";
30
- break;
31
- case "CASHBACK":
32
- s = "CASHBACK";
33
- break;
34
- case "CYCLE":
35
- s = "EXPIRED";
36
- break;
37
- case "COUNTER_CONSUME":
38
- s = "COUNTER REDEEM";
39
- break;
40
- default:
41
- s = o;
42
- break;
43
- }
44
- return s;
45
- }
46
- function pe(o) {
47
- var s, l, p, t, u, y;
48
- switch ((s = o == null ? void 0 : o.pf_collectible) == null ? void 0 : s.type) {
49
- case "VOUCHER":
50
- return `${(l = o.pf_collectible) == null ? void 0 : l.type} (${(p = o.pf_collectible) == null ? void 0 : p.name})`;
51
- case "TITLE":
52
- return `${(t = o.pf_collectible) == null ? void 0 : t.type} (${(u = o.pf_collectible) == null ? void 0 : u.name})`;
53
- case "POINT":
54
- return "Experience";
55
- case "COIN":
56
- return "Point";
57
- default:
58
- return re((y = o == null ? void 0 : o.pf_collectible) == null ? void 0 : y.type);
59
- }
60
- }
61
- function ge(o) {
62
- switch (o) {
63
- case "ONLINE":
64
- return "Online";
65
- case "COIN":
66
- return "Point";
67
- default:
68
- return o;
69
- }
70
- }
71
- const R = {
72
- getReason: me,
73
- formattedType: pe,
74
- formattedPaymentType: ge
75
- }, fe = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, N = /* @__PURE__ */ O({
76
- __name: "FilterChip",
77
- props: {
78
- modelValue: {
79
- type: Array,
80
- required: !1
81
- },
82
- label: {
83
- type: String,
84
- required: !1,
85
- default: ""
86
- },
87
- showItemLabel: {
88
- type: Boolean,
89
- default: !1
90
- },
91
- placement: {
92
- type: String,
93
- required: !1,
94
- default: "bottom-end"
95
- },
96
- class: {
97
- type: String,
98
- required: !1
99
- },
100
- disabled: {
101
- type: Boolean,
102
- required: !1
103
- },
104
- items: {
105
- type: Array,
106
- required: !0
107
- },
108
- icon: {
109
- type: String,
110
- required: !1
111
- }
112
- },
113
- emits: ["update:model-value"],
114
- setup(o, { emit: s }) {
115
- const l = o, p = s, t = I(!1), u = I({}), y = M(() => {
116
- if (!u.value || Object.keys(u.value).length == l.items.length)
117
- return "All";
118
- {
119
- const a = Object.keys(u.value).length;
120
- return `${a > 0 ? a : "None"} selected`;
121
- }
122
- });
123
- function w(a) {
124
- u.value[a] ? delete u.value[a] : u.value[a] = !0, p("update:model-value", Object.keys(u.value));
125
- }
126
- function v() {
127
- Object.keys(u.value).length > 0 ? u.value = {} : u.value = l.items.reduce((a, i) => (a[i.value] = !0, a), {}), p("update:model-value", Object.keys(u.value));
128
- }
129
- return A(() => {
130
- u.value = l.modelValue.reduce(
131
- (a, i) => (a[i] = !0, a),
132
- {}
133
- ), l.modelValue.length == 0;
134
- }), (a, i) => {
135
- const h = _("FmIcon"), f = _("FmChip"), n = _("FmMenuItem"), r = _("FmMenu");
136
- return x(), T(r, {
137
- placement: o.placement || "bottom-end",
138
- disabled: o.disabled == !0,
139
- "model-value": e(t),
140
- onMenuChanged: i[0] || (i[0] = (m) => t.value = m),
141
- "close-on-click": !1
142
- }, {
143
- "menu-button": k(() => [
144
- g(f, {
145
- label: o.label,
146
- class: E(l.class || "text-fm-color-neutral-gray-400 cursor-pointer")
147
- }, {
148
- default: k(() => [
149
- l.icon ? (x(), T(h, {
150
- key: 0,
151
- name: l.icon,
152
- class: E(l.class),
153
- outline: "",
154
- size: "sm"
155
- }, null, 8, ["name", "class"])) : Z("", !0),
156
- C("div", fe, z(l.label) + " " + z(o.showItemLabel ? e(y) : ""), 1),
157
- g(h, {
158
- name: e(t) ? "keyboard_arrow_up" : "keyboard_arrow_down",
159
- class: E(l.class),
160
- outline: "",
161
- size: "sm"
162
- }, null, 8, ["name", "class"])
163
- ]),
164
- _: 1
165
- }, 8, ["label", "class"])
166
- ]),
167
- default: k(() => [
168
- g(n, {
169
- "model-value": Object.keys(e(u)).length === l.items.length,
170
- label: "All",
171
- "has-checkbox": !0,
172
- indeterminate: !0,
173
- onClick: v
174
- }, null, 8, ["model-value"]),
175
- (x(!0), P(ee, null, te(l.items ?? [], (m) => (x(), T(n, {
176
- key: m.value,
177
- value: m.value,
178
- label: m.label,
179
- "has-checkbox": !0,
180
- "model-value": e(u)[m.value],
181
- "onUpdate:modelValue": (d) => w(m.value)
182
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
183
- ]),
184
- _: 1
185
- }, 8, ["placement", "disabled", "model-value"]);
186
- };
187
- }
188
- }), V = "YYYY-MM-DD", X = /* @__PURE__ */ O({
189
- __name: "DateRangeChip",
190
- props: /* @__PURE__ */ B({
191
- modelValue: {
192
- type: Object,
193
- required: !0
194
- }
195
- }, {
196
- dateRange: {
197
- type: Object,
198
- default: () => ({
199
- startDate: b().subtract(7, "day").format(V),
200
- endDate: b().endOf("day").format(V)
201
- })
202
- },
203
- dateRangeModifiers: {}
204
- }),
205
- emits: /* @__PURE__ */ B(["update:model-value"], ["update:dateRange"]),
206
- setup(o, { emit: s }) {
207
- const l = o, p = s, t = ae(o, "dateRange"), u = M(() => t.value ? `${y.value.startDate ?? "Start"} - ${y.value.endDate ?? "End"}` : "No dates selected."), y = M(() => ({
208
- startDate: t.value.startDate ? b(t.value.startDate).format(V) : void 0,
209
- endDate: t.value.endDate ? b(t.value.endDate).format(V) : void 0
210
- }));
211
- return A(() => {
212
- t.value = l.modelValue;
213
- }), U(
214
- () => t.value,
215
- () => {
216
- p("update:model-value", y.value);
217
- }
218
- ), (w, v) => {
219
- const a = _("FmChip"), i = _("FmDateRangePicker");
220
- return x(), T(i, {
221
- modelValue: t.value,
222
- "onUpdate:modelValue": v[0] || (v[0] = (h) => t.value = h),
223
- "show-predefined-range": ""
224
- }, {
225
- "trigger-button": k(() => [
226
- g(a, {
227
- label: e(u),
228
- icon: "calendar_month",
229
- "right-icon": "keyboard_arrow_down",
230
- class: "text-fm-color-neutral-gray-400 cursor-pointer"
231
- }, null, 8, ["label"])
232
- ]),
233
- _: 1
234
- }, 8, ["modelValue"]);
235
- };
236
- }
237
- }), j = () => {
238
- const o = ie.getBusinessId();
239
- if (!o) throw new Error("Invalid business ID");
240
- return ce(`businesses/${o}/transactions`, {
241
- noIdRequired: !0
242
- });
243
- }, W = {
244
- async readAll(o, s) {
245
- const l = Y(
246
- await j().get("", {
247
- params: { ...o, ...s }
248
- })
249
- );
250
- return {
251
- meta: l.meta,
252
- resources: l.resources
253
- };
254
- },
255
- async readStoreTransactions(o, s) {
256
- const l = Y(
257
- await j().get("/store", {
258
- params: { ...o, ...s }
259
- })
260
- );
261
- return {
262
- meta: l.meta,
263
- resources: l.resources
264
- };
265
- },
266
- async readBills(o, s, l) {
267
- return (await se("").get(`/restaurants/${o}/receipt?start=${s}&end=${l}`)).data;
268
- }
269
- }, be = { class: "flex items-center justify-between" }, ye = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Oe = /* @__PURE__ */ O({
270
- __name: "CollectionTransactions",
271
- props: {
272
- user: {
273
- type: String
274
- }
275
- },
276
- setup(o) {
277
- const s = ue(), l = o, p = [
278
- {
279
- header: "Transaction ID",
280
- accessorKey: "_id",
281
- meta: {
282
- maxWidth: "100px"
283
- },
284
- cell(n) {
285
- return c("div", { class: "flex items-center" }, [
286
- c(S.FmIcon, {
287
- name: "content_copy",
288
- outline: !0,
289
- size: "sm",
290
- class: "cursor-pointer mr-4",
291
- onClick: (r) => {
292
- r.preventDefault(), r.stopPropagation(), q(n.row.original._id.toString());
293
- }
294
- }),
295
- c(
296
- "div",
297
- { class: "pr-2 text-ellipsis overflow-hidden" },
298
- n.row.original._id.toString()
299
- )
300
- ]);
301
- },
302
- enableSorting: !1
303
- },
304
- {
305
- header: "Created at",
306
- accessorKey: "_id",
307
- accessorFn: (n) => b(G(n._id.toString())).format("D MMM YYYY, hh:mmA"),
308
- enableSorting: !0
309
- },
310
- {
311
- header: "Amount",
312
- // accessorKey: 'totalAmount',
313
- enableSorting: !1,
314
- cell(n) {
315
- var d, D, F, $;
316
- const r = le(
317
- n.row.original.expiryAmount.reduce(
318
- (J, Q) => J + Q.amount,
319
- n.row.original.amount ?? 0
320
- ),
321
- 2
322
- ), m = (D = (d = n.row.original.expiryAmount) == null ? void 0 : d[0]) != null && D.expiredAt ? b(($ = (F = n.row.original.expiryAmount) == null ? void 0 : F[0]) == null ? void 0 : $.expiredAt).format(
323
- "D MMM YYYY"
324
- ) : "";
325
- return c("div", { class: "flex items-center" }, [
326
- c(
327
- "div",
328
- {
329
- class: [
330
- "pr-2",
331
- +r > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
332
- ]
333
- },
334
- r
335
- ),
336
- c("div", { class: "flex items-center" }, [
337
- n.row.original.expiryAmount.length > 0 ? c(
338
- S.FmTooltip,
339
- {
340
- content: `Expired on ${m}`
341
- },
342
- [
343
- c(S.FmIcon, {
344
- name: "info",
345
- outline: !0,
346
- size: "sm"
347
- })
348
- ]
349
- ) : c("div")
350
- ])
351
- ]);
352
- }
353
- },
354
- {
355
- header: "Type",
356
- accessorKey: "pf_collectible.type",
357
- accessorFn: (n) => R.formattedType(n),
358
- meta: {
359
- maxWidth: "200px"
360
- },
361
- cell(n) {
362
- const r = R.formattedType(n.row.original);
363
- return c("div", { class: "flex items-center" }, [
364
- c("div", { class: "truncate text-ellipsis" }, r),
365
- r.length > 20 ? c(
366
- S.FmTooltip,
367
- {
368
- content: r
369
- },
370
- [
371
- c(S.FmIcon, {
372
- name: "info",
373
- outline: !0,
374
- size: "sm"
375
- })
376
- ]
377
- ) : null
378
- ]);
379
- }
380
- },
381
- {
382
- header: "Source",
383
- accessorKey: "source",
384
- accessorFn: (n) => L(R.getReason(n.source))
385
- },
386
- {
387
- header: "User",
388
- accessorKey: "pf_user.name",
389
- cell(n) {
390
- return de(n.row.original.pf_user);
391
- }
392
- },
393
- {
394
- header: "Phone No.",
395
- accessorKey: "pf_user.phoneNumber",
396
- accessorFn: (n) => n.pf_user.phoneNumber
397
- },
398
- {
399
- accessorFn: (n) => n.ref,
400
- header: "References",
401
- accessorKey: "ref",
402
- cell(n) {
403
- var r, m;
404
- return c("div", { class: "flex items-center justify-between gap-4" }, [
405
- c("div", { class: "flex items-center" }, [
406
- (r = n.row.original.metadata) != null && r.remark ? c(
407
- S.FmTooltip,
408
- {
409
- content: (m = n.row.original.metadata) == null ? void 0 : m.remark
410
- },
411
- [
412
- c(S.FmIcon, {
413
- name: "info",
414
- outline: !0,
415
- size: "sm"
416
- })
417
- ]
418
- ) : c("div")
419
- ]),
420
- c("div", { class: "flex-1" }, n.row.original.ref)
421
- ]);
422
- }
423
- }
424
- ], t = I({
425
- search: "",
426
- "pf_collectible.type": [],
427
- "metadata.location": [],
428
- dateRange: {
429
- startDate: b().subtract(7, "day").toISOString(),
430
- endDate: b().endOf("day").toISOString()
431
- },
432
- source: []
433
- }), { tableMeta: u, rowData: y, onSort: w, debouncedFetchData: v, onSearch: a } = K(async (n) => {
434
- const r = {
435
- ...t.value,
436
- user: l.user,
437
- dateRange: {
438
- start: new Date(t.value.dateRange.startDate).toISOString(),
439
- end: new Date(t.value.dateRange.endDate).toISOString()
440
- }
441
- }, m = await W.readAll(n, r);
442
- return {
443
- resources: m.resources.map((d) => {
444
- const D = i.value.find((F) => F._id === d.ref);
445
- return { ...d, ref: (D == null ? void 0 : D.seqNumber) || d.ref };
446
- }),
447
- meta: m.meta
448
- };
449
- }), i = I([]), h = ne.options.map((n) => ({ label: L(R.getReason(n)), value: n })), f = s.locations.map((n) => ({ label: n.name, value: n._id }));
450
- return U(
451
- t,
452
- () => {
453
- v();
454
- },
455
- { deep: !0 }
456
- ), oe(async () => {
457
- await s.readLocations(), await v();
458
- }), (n, r) => {
459
- const m = _("FmSearch");
460
- return x(), P("div", null, [
461
- g(m, {
462
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
463
- modelValue: e(t).search,
464
- "onUpdate:modelValue": r[0] || (r[0] = (d) => e(t).search = d),
465
- placeholder: "Search",
466
- collapsible: ""
467
- }, null, 8, ["modelValue"]),
468
- C("div", be, [
469
- C("div", ye, [
470
- g(N, {
471
- class: "cursor-pointer text-fm-color-neutral-gray-400",
472
- "right-icon": "keyboard_arrow_down",
473
- modelValue: e(t)["metadata.location"],
474
- "onUpdate:modelValue": r[1] || (r[1] = (d) => e(t)["metadata.location"] = d),
475
- icon: "storefront",
476
- "show-item-label": !0,
477
- items: e(f)
478
- }, null, 8, ["modelValue", "items"]),
479
- g(N, {
480
- class: "cursor-pointer text-fm-color-neutral-gray-400",
481
- "right-icon": "keyboard_arrow_down",
482
- modelValue: e(t)["pf_collectible.type"],
483
- "onUpdate:modelValue": r[2] || (r[2] = (d) => e(t)["pf_collectible.type"] = d),
484
- label: "Type: ",
485
- "show-item-label": !0,
486
- items: [
487
- { label: "Point", value: "COIN" },
488
- { label: "Credit", value: "CREDIT" },
489
- { label: "Voucher", value: "VOUCHER" },
490
- { label: "Experience", value: "POINT" },
491
- { label: "Tier", value: "TIER" },
492
- { label: "Title", value: "TITLE" },
493
- { label: "Game", value: "GAME" },
494
- { label: "Stamp", value: "STAMP" }
495
- ]
496
- }, null, 8, ["modelValue"]),
497
- g(N, {
498
- class: "cursor-pointer text-fm-color-neutral-gray-400",
499
- "right-icon": "keyboard_arrow_down",
500
- modelValue: e(t).source,
501
- "onUpdate:modelValue": r[3] || (r[3] = (d) => e(t).source = d),
502
- label: "Source: ",
503
- "show-item-label": !0,
504
- items: e(h)
505
- }, null, 8, ["modelValue", "items"]),
506
- g(X, {
507
- "model-value": {
508
- startDate: e(t).dateRange.startDate,
509
- endDate: e(t).dateRange.endDate
510
- },
511
- "onUpdate:modelValue": r[4] || (r[4] = (d) => e(t).dateRange = {
512
- startDate: e(b)(d.startDate).startOf("d").toISOString(),
513
- endDate: e(b)(d.endDate).endOf("d").toISOString()
514
- })
515
- }, null, 8, ["model-value"])
516
- ]),
517
- g(m, {
518
- class: "xs:hidden",
519
- modelValue: e(t).search,
520
- "onUpdate:modelValue": r[5] || (r[5] = (d) => e(t).search = d),
521
- placeholder: "Search",
522
- collapsible: ""
523
- }, null, 8, ["modelValue"])
524
- ]),
525
- g(H, {
526
- loading: e(u).isLoading,
527
- "row-data": e(y),
528
- "row-count": e(u).totalRows,
529
- "column-defs": p.filter(
530
- (d) => !l.user || d.header !== "User" && d.header !== "Phone No."
531
- ),
532
- "page-count": e(u).pageCount,
533
- "page-index": e(u).pageIndex,
534
- "page-size": e(u).pageSize,
535
- "shrink-at": !1,
536
- onSortChange: e(w),
537
- onPageChange: r[6] || (r[6] = (d) => e(v)({
538
- pageSize: d.pageSize,
539
- pageIndex: d.pageIndex
540
- }))
541
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
542
- ]);
543
- };
544
- }
545
- }), he = { class: "flex items-center justify-between" }, ve = { class: "flex gap-8 items-center" }, Ee = /* @__PURE__ */ O({
546
- __name: "StoreTransactions",
547
- props: {
548
- user: {
549
- type: String
550
- }
551
- },
552
- setup(o) {
553
- const s = o, l = [
554
- {
555
- header: "Transaction ID",
556
- cell(a) {
557
- return c("div", { class: "flex items-center" }, [
558
- c(S.FmIcon, {
559
- name: "content_copy",
560
- outline: !0,
561
- size: "sm",
562
- class: "cursor-pointer mr-4",
563
- onClick: (i) => {
564
- i.preventDefault(), i.stopPropagation(), q(a.row.original._id.toString());
565
- }
566
- }),
567
- c("div", { class: "pr-2" }, a.row.original._id.toString())
568
- ]);
569
- }
570
- },
571
- {
572
- header: "Created at",
573
- accessorFn: (a) => b(G(a._id.toString())).format("D MMM YYYY, hh:mmA"),
574
- enableSorting: !0
575
- },
576
- {
577
- header: "Bundle",
578
- accessorFn: (a) => a.bundle.name
579
- },
580
- {
581
- header: "Location",
582
- accessorFn: (a) => a.location ? a.pf_location.name : "Online Store"
583
- },
584
- {
585
- header: "Payment Type",
586
- accessorFn: (a) => {
587
- var i;
588
- return ((i = a.paymentType) == null ? void 0 : i.type) ?? "N/A";
589
- },
590
- cell(a) {
591
- var i, h;
592
- return c("div", { class: "flex items-center gap-4" }, [
593
- c("div", { class: "flex items-center" }, [
594
- ((i = a.row.original.paymentType) == null ? void 0 : i.type) == "ONLINE" && a.row.original.paymentType.extra ? c(
595
- S.FmTooltip,
596
- {
597
- content: a.row.original.paymentType.extra
598
- },
599
- [
600
- c(S.FmIcon, {
601
- name: "info",
602
- outline: !0,
603
- size: "sm"
604
- })
605
- ]
606
- ) : c("div")
607
- ]),
608
- c(
609
- "div",
610
- { class: "flex-1" },
611
- ((h = a.row.original.paymentType) == null ? void 0 : h.type) ?? "N/A"
612
- )
613
- ]);
614
- }
615
- },
616
- {
617
- header: "User",
618
- accessorFn: (a) => a.pf_member.name
619
- },
620
- {
621
- header: "Phone No.",
622
- accessorFn: (a) => a.pf_member.phoneNumber
623
- },
624
- {
625
- header: "Status",
626
- accessorFn: (a) => a.status
627
- }
628
- ], p = I({
629
- searchValue: "",
630
- dateRange: {
631
- startDate: b().subtract(7, "day").toISOString(),
632
- endDate: b().toISOString()
633
- }
634
- }), { tableMeta: t, rowData: u, onSort: y, debouncedFetchData: w, onSearch: v } = K(async (a) => {
635
- const i = {
636
- ...p.value.dateRange,
637
- user: s.user
638
- };
639
- return await W.readStoreTransactions(a, i);
640
- });
641
- return U(
642
- p,
643
- () => {
644
- w();
645
- },
646
- { deep: !0 }
647
- ), A(async () => {
648
- await w();
649
- }), (a, i) => {
650
- const h = _("FmSearch");
651
- return x(), P("div", null, [
652
- C("div", he, [
653
- C("div", ve, [
654
- g(X, {
655
- modelValue: e(p).dateRange,
656
- "onUpdate:modelValue": i[0] || (i[0] = (f) => e(p).dateRange = f)
657
- }, null, 8, ["modelValue"])
658
- ]),
659
- g(h, {
660
- modelValue: e(t).searchValue,
661
- "onUpdate:modelValue": [
662
- i[1] || (i[1] = (f) => e(t).searchValue = f),
663
- e(v)
664
- ],
665
- placeholder: "Search",
666
- collapsible: ""
667
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
668
- ]),
669
- g(H, {
670
- loading: e(t).isLoading,
671
- "row-data": e(u),
672
- "row-count": e(t).totalRows,
673
- "column-defs": l.filter(
674
- (f) => !s.user || f.header !== "User" && f.header !== "Phone No."
675
- ),
676
- "page-count": e(t).pageCount,
677
- "page-index": e(t).pageIndex,
678
- "page-size": e(t).pageSize,
679
- "shrink-at": !1,
680
- onSortChange: e(y),
681
- onPageChange: i[2] || (i[2] = (f) => e(w)({
682
- pageSize: f.pageSize,
683
- pageIndex: f.pageIndex
684
- }))
685
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
686
- ]);
687
- };
688
- }
689
- });
690
- export {
691
- Oe as _,
692
- Ee as a
693
- };