@feedmepos/mf-payment 1.2.1 → 1.2.3

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 (59) hide show
  1. package/dist/{PDFViewer-BQfgFexr.js → PDFViewer-xrBtzrlR.js} +1 -2
  2. package/dist/{PayoutAccount-D8R2kieb.js → PayoutAccount-CcD9G3tM.js} +6 -6
  3. package/dist/{PayoutAccount-CajKtGCP.js → PayoutAccount-DqbpQ8mY.js} +7 -7
  4. package/dist/PayoutAccountSetting-C2PsyDLM.js +956 -0
  5. package/dist/{Restaurant-Dbp_UTNd.js → Restaurant-C90F0Stw.js} +4 -4
  6. package/dist/RestaurantSetting-ECCLE0zj.js +501 -0
  7. package/dist/{Settlement-D47q_Wmh.js → Settlement-CD1Vm7TK.js} +3 -3
  8. package/dist/{Settlement-CIl7p5BM.js → Settlement-DxkW-ltZ.js} +3 -3
  9. package/dist/{SettlementTransactions-BSN_bqJ2.js → SettlementTransactions-Bj85X5dx.js} +3 -3
  10. package/dist/{SettlementTransactions-VhSpt9Ya.js → SettlementTransactions-D6dyfrsh.js} +3 -3
  11. package/dist/{Terminal-DhDp8CZP.js → Terminal-WFU6xb6H.js} +36 -36
  12. package/dist/{TerminalSetting-Z4Yf71s4.js → TerminalSetting-DSCFAQht.js} +218 -212
  13. package/dist/{Transaction-DodA1Rsr.js → Transaction-CB62_jSg.js} +7 -7
  14. package/dist/{Transaction-DfqdJTc4.js → Transaction-PRcVVkhp.js} +5 -5
  15. package/dist/{TransactionOld-BVC2EZES.js → TransactionOld-B0P4HXt8.js} +4 -4
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-BSQyjy9r.js → TransactionTable.vue_vue_type_script_setup_true_lang-jF4UYhQi.js} +3 -3
  17. package/dist/{app-DO-yUYMX.js → app-S42F2ZTb.js} +381 -381
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-Afjskent.js → assets-wSUxHhv6.js} +2 -2
  20. package/dist/{grafana-Bx1CNAeG.js → grafana-kQY3riiN.js} +1 -1
  21. package/dist/{index-eVDNyUp0.js → index-B-2fIhCU.js} +1 -1
  22. package/dist/{index-BG-pqgpq.js → index-Bj2Rs1vj.js} +2 -2
  23. package/dist/{index-DcA8mNkW.js → index-C3OElkUY.js} +7830 -7804
  24. package/dist/{index-9ImIPLpT.js → index-C_3jgmep.js} +1 -1
  25. package/dist/{index-DjMmMfFw.js → index-CiIXIJ1u.js} +1 -1
  26. package/dist/{index-CWjhBRl-.js → index-DcK-ntIi.js} +1 -1
  27. package/dist/{index-DJFB47Iu.js → index-JkEYKC8p.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-Pj1GGD11.js → index.vue_vue_type_script_setup_true_lang-C1ogwxl8.js} +1 -1
  29. package/dist/package.json +4 -4
  30. package/dist/{payout-account-1UTg_py3.js → payout-account-zISZXeYt.js} +3 -3
  31. package/dist/stores/payoutAccount.d.ts +54 -8
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +54 -8
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +26 -12
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +26 -12
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +54 -8
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +54 -8
  38. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +26 -12
  39. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  40. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +42 -1
  41. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  42. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  43. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  44. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +54 -0
  45. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +6 -6
  46. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +20 -20
  47. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +22 -20
  48. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +20 -20
  49. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +20 -20
  50. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +20 -20
  51. package/dist/views/admin/terminal/tabs/SoftspaceGateway.vue.d.ts +20 -20
  52. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +20 -20
  53. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +20 -20
  54. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +108 -16
  55. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +44 -44
  56. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +22 -22
  57. package/package.json +4 -4
  58. package/dist/PayoutAccountSetting-DQqH71Pj.js +0 -890
  59. package/dist/RestaurantSetting-dem9GccJ.js +0 -412
@@ -0,0 +1,956 @@
1
+ import { defineComponent as k, resolveComponent as p, openBlock as g, createElementBlock as A, Fragment as $, createElementVNode as c, createVNode as r, withCtx as _, createTextVNode as C, toDisplayString as T, createCommentVNode as h, createBlock as x, ref as V, watch as W, computed as G, unref as i, isRef as q, h as B, onMounted as J, resolveDynamicComponent as Y, normalizeProps as L, mergeProps as H } from "vue";
2
+ import { p as S } from "./index-Bj2Rs1vj.js";
3
+ import { u as j, e as R } from "./index-C3OElkUY.js";
4
+ import { _ as ee } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
5
+ import { useRouter as te } from "vue-router";
6
+ import { u as K } from "./index-C_3jgmep.js";
7
+ import { P as Q } from "./PDFViewer-xrBtzrlR.js";
8
+ import { useSnackbar as z, components as ae } from "@feedmepos/ui-library";
9
+ import { u as D } from "./error-K1CakhA9.js";
10
+ import { z as U, a as N } from "./validator-D5jtpt9A.js";
11
+ import { useCoreStore as X } from "@feedmepos/mf-common";
12
+ const ne = { class: "flex gap-16 mb-6" }, oe = ["src"], le = /* @__PURE__ */ k({
13
+ __name: "Information",
14
+ props: {
15
+ payoutAccount: {
16
+ type: Object,
17
+ required: !0
18
+ }
19
+ },
20
+ setup(a) {
21
+ return (m, e) => {
22
+ const f = p("FmCardHeader"), l = p("FmCardSection"), t = p("FmCard");
23
+ return g(), A($, null, [
24
+ c("div", ne, [
25
+ r(t, {
26
+ horizontal: "",
27
+ class: "flex-1 p-6",
28
+ variant: "elevated"
29
+ }, {
30
+ default: _(() => [
31
+ r(l, { class: "flex flex-col gap-16 justify-between" }, {
32
+ default: _(() => [
33
+ r(f, {
34
+ class: "p-0",
35
+ title: "Account Info",
36
+ subtitle: ""
37
+ }),
38
+ r(l, { class: "p-0" }, {
39
+ default: _(() => {
40
+ var s, v, u, n, o;
41
+ return [
42
+ e[0] || (e[0] = c("b", null, "For", -1)),
43
+ C(": " + T((v = (s = a.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.event) + " ", 1),
44
+ e[1] || (e[1] = c("br", null, null, -1)),
45
+ e[2] || (e[2] = c("b", null, "Reference", -1)),
46
+ C(": " + T((n = (u = a.payoutAccount) == null ? void 0 : u.store) == null ? void 0 : n.id), 1),
47
+ e[3] || (e[3] = c("br", null, null, -1)),
48
+ e[4] || (e[4] = c("b", null, "Business", -1)),
49
+ C(": " + T((o = a.payoutAccount) == null ? void 0 : o.businessId), 1),
50
+ e[5] || (e[5] = c("br", null, null, -1))
51
+ ];
52
+ }),
53
+ _: 1
54
+ })
55
+ ]),
56
+ _: 1
57
+ })
58
+ ]),
59
+ _: 1
60
+ }),
61
+ r(t, {
62
+ horizontal: "",
63
+ class: "flex-1 p-6",
64
+ variant: "elevated"
65
+ }, {
66
+ default: _(() => [
67
+ r(l, { class: "flex flex-col gap-16 justify-between" }, {
68
+ default: _(() => [
69
+ r(f, {
70
+ class: "p-0",
71
+ title: "Key Person",
72
+ subtitle: ""
73
+ }),
74
+ r(l, { class: "p-0" }, {
75
+ default: _(() => {
76
+ var s, v, u, n, o, y, d, b;
77
+ return [
78
+ e[6] || (e[6] = c("b", null, "Email", -1)),
79
+ C(": " + T((u = (v = (s = a.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.keyPerson) == null ? void 0 : u.email) + " ", 1),
80
+ e[7] || (e[7] = c("br", null, null, -1)),
81
+ e[8] || (e[8] = c("b", null, "Name", -1)),
82
+ C(": " + T((y = (o = (n = a.payoutAccount) == null ? void 0 : n.store) == null ? void 0 : o.keyPerson) == null ? void 0 : y.name), 1),
83
+ e[9] || (e[9] = c("br", null, null, -1)),
84
+ e[10] || (e[10] = c("b", null, "Phone", -1)),
85
+ C(": " + T((b = (d = a.payoutAccount) == null ? void 0 : d.store.keyPerson) == null ? void 0 : b.phone), 1),
86
+ e[11] || (e[11] = c("br", null, null, -1))
87
+ ];
88
+ }),
89
+ _: 1
90
+ })
91
+ ]),
92
+ _: 1
93
+ })
94
+ ]),
95
+ _: 1
96
+ })
97
+ ]),
98
+ e[12] || (e[12] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
99
+ a.payoutAccount.store.exteriorPhoto ? (g(), A("img", {
100
+ key: 0,
101
+ src: a.payoutAccount.store.exteriorPhoto
102
+ }, null, 8, oe)) : h("", !0)
103
+ ], 64);
104
+ };
105
+ }
106
+ }), ue = { class: "flex gap-16" }, se = { class: "flex-1" }, re = { class: "flex-1" }, ce = /* @__PURE__ */ k({
107
+ __name: "Settlement",
108
+ props: {
109
+ payoutAccount: {
110
+ type: Object,
111
+ required: !0
112
+ }
113
+ },
114
+ setup(a) {
115
+ return (m, e) => {
116
+ const f = p("FmCardHeader"), l = p("FmCardSection"), t = p("FmCard");
117
+ return g(), A($, null, [
118
+ r(t, {
119
+ horizontal: "",
120
+ class: "flex-1 p-6 mx-6 mb-6",
121
+ variant: "elevated"
122
+ }, {
123
+ default: _(() => [
124
+ r(l, { class: "flex flex-col gap-16 justify-between" }, {
125
+ default: _(() => [
126
+ r(f, {
127
+ class: "p-0",
128
+ title: "Bank Info",
129
+ subtitle: ""
130
+ }),
131
+ r(l, { class: "p-0" }, {
132
+ default: _(() => {
133
+ var s, v, u, n, o, y;
134
+ return [
135
+ e[0] || (e[0] = c("b", null, "Bank", -1)),
136
+ C(": " + T((v = (s = a.payoutAccount) == null ? void 0 : s.store.bank) == null ? void 0 : v.name), 1),
137
+ e[1] || (e[1] = c("br", null, null, -1)),
138
+ e[2] || (e[2] = c("b", null, "Name", -1)),
139
+ C(": " + T((n = (u = a.payoutAccount) == null ? void 0 : u.store.bank) == null ? void 0 : n.holderName), 1),
140
+ e[3] || (e[3] = c("br", null, null, -1)),
141
+ e[4] || (e[4] = c("b", null, "Number", -1)),
142
+ C(": " + T((y = (o = a.payoutAccount) == null ? void 0 : o.store.bank) == null ? void 0 : y.accountNumber), 1)
143
+ ];
144
+ }),
145
+ _: 1
146
+ })
147
+ ]),
148
+ _: 1
149
+ })
150
+ ]),
151
+ _: 1
152
+ }),
153
+ c("div", ue, [
154
+ c("div", se, [
155
+ e[5] || (e[5] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
156
+ a.payoutAccount.store.ssm ? (g(), x(Q, {
157
+ key: 0,
158
+ pdf: a.payoutAccount.store.ssm,
159
+ "disable-text-layer": !0,
160
+ "disable-annotation-layer": !0
161
+ }, null, 8, ["pdf"])) : h("", !0)
162
+ ]),
163
+ c("div", re, [
164
+ e[6] || (e[6] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
165
+ a.payoutAccount.store.bankStatement ? (g(), x(Q, {
166
+ key: 0,
167
+ pdf: a.payoutAccount.store.bankStatement,
168
+ "disable-text-layer": !0,
169
+ "disable-annotation-layer": !0
170
+ }, null, 8, ["pdf"])) : h("", !0)
171
+ ])
172
+ ])
173
+ ], 64);
174
+ };
175
+ }
176
+ }), ie = /* @__PURE__ */ k({
177
+ __name: "RateInput",
178
+ props: {
179
+ data: {},
180
+ onChange: { type: Function }
181
+ },
182
+ setup(a) {
183
+ const m = a, e = V(m.data.toString());
184
+ return W(e, (f) => {
185
+ m.onChange(parseFloat(f));
186
+ }), (f, l) => {
187
+ const t = p("FmTextField");
188
+ return g(), x(t, {
189
+ inputmode: "decimal",
190
+ modelValue: e.value,
191
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s)
192
+ }, {
193
+ append: _(() => l[1] || (l[1] = [
194
+ C("%")
195
+ ])),
196
+ _: 1
197
+ }, 8, ["modelValue"]);
198
+ };
199
+ }
200
+ }), de = /* @__PURE__ */ k({
201
+ __name: "TPlusInput",
202
+ props: {
203
+ data: {},
204
+ onChange: { type: Function }
205
+ },
206
+ setup(a) {
207
+ const m = a, e = V(m.data.toString());
208
+ return W(e, (f) => {
209
+ m.onChange(parseInt(f));
210
+ }), (f, l) => {
211
+ const t = p("FmTextField");
212
+ return g(), x(t, {
213
+ inputmode: "numeric",
214
+ modelValue: e.value,
215
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s)
216
+ }, null, 8, ["modelValue"]);
217
+ };
218
+ }
219
+ }), me = { class: "flex gap-16 mt-6" }, ye = { class: "flex-1" }, pe = { class: "flex-1" }, fe = { class: "my-6 w-full flex justify-end" }, ve = { class: "w-[320px]" }, ge = /* @__PURE__ */ k({
220
+ __name: "PaymentStatus",
221
+ props: {
222
+ onUpdate: {
223
+ type: Function,
224
+ required: !0
225
+ },
226
+ payoutAccount: {
227
+ type: Object,
228
+ required: !0
229
+ }
230
+ },
231
+ setup(a) {
232
+ const m = a, e = V(!1), f = z(), l = async (n) => {
233
+ try {
234
+ e.value = !0, await m.onUpdate(n), f.open({
235
+ type: "success",
236
+ title: "Payout account update succesfully"
237
+ });
238
+ } catch (o) {
239
+ f.open({
240
+ type: "error",
241
+ title: "Error occurs when updating payout account",
242
+ message: D(o)
243
+ });
244
+ } finally {
245
+ e.value = !1;
246
+ }
247
+ }, { search: t } = K({
248
+ search: ""
249
+ }), s = G(() => {
250
+ const { ssm: n, bank: o, bankStatement: y } = m.payoutAccount.store;
251
+ return n && o && o.name && o.accountNumber && o.holderName && y;
252
+ }), v = V(""), u = [
253
+ {
254
+ header: () => "Payment Method",
255
+ accessorKey: "issuer",
256
+ cell: (n) => `${n.row.original.issuer} (${n.row.original.variant})`
257
+ },
258
+ {
259
+ header: () => "Rate",
260
+ accessorKey: "rate",
261
+ cell: ({ row: n }) => {
262
+ let o = 0;
263
+ return n.original.rate && (o = n.original.rate.amount / Math.pow(10, n.original.rate.precision)), B(ie, {
264
+ data: o,
265
+ onChange: (y) => {
266
+ const d = m.payoutAccount.methods.at(n.index);
267
+ d.rate || (d.rate = {
268
+ amount: 0,
269
+ precision: 4
270
+ }), d.rate.amount = y * Math.pow(10, d.rate.precision);
271
+ }
272
+ });
273
+ }
274
+ },
275
+ {
276
+ header: () => "T plus",
277
+ accessorKey: "tPlus",
278
+ cell: ({ row: n }) => B(de, {
279
+ data: n.original.tPlus ?? 0,
280
+ onChange: (o) => {
281
+ const y = m.payoutAccount.methods.at(n.index);
282
+ y.tPlus = o;
283
+ }
284
+ })
285
+ }
286
+ ];
287
+ return (n, o) => {
288
+ const y = p("FmRadio"), d = p("FmRadioGroup"), b = p("FmSwitch"), P = p("FmSearch"), I = p("FmTable"), M = p("FmButton");
289
+ return g(), A($, null, [
290
+ c("div", me, [
291
+ c("div", ye, [
292
+ r(d, {
293
+ modelValue: a.payoutAccount.status,
294
+ "onUpdate:modelValue": o[0] || (o[0] = (F) => a.payoutAccount.status = F),
295
+ label: "Account Status"
296
+ }, {
297
+ default: _(() => [
298
+ r(y, {
299
+ value: "NEW",
300
+ label: "New"
301
+ }),
302
+ r(y, {
303
+ value: "PENDING",
304
+ label: "Pending"
305
+ }),
306
+ r(y, {
307
+ value: "APPROVED",
308
+ label: "Approved"
309
+ })
310
+ ]),
311
+ _: 1
312
+ }, 8, ["modelValue"])
313
+ ]),
314
+ c("div", pe, [
315
+ r(b, {
316
+ modelValue: a.payoutAccount.enable,
317
+ "onUpdate:modelValue": o[1] || (o[1] = (F) => a.payoutAccount.enable = F),
318
+ disabled: !s.value,
319
+ label: "Enabled",
320
+ sublabel: "Merchant can use online features such as e-payment, settlement"
321
+ }, null, 8, ["modelValue", "disabled"])
322
+ ])
323
+ ]),
324
+ a.payoutAccount.enable ? (g(), A($, { key: 0 }, [
325
+ c("div", fe, [
326
+ c("div", ve, [
327
+ r(P, {
328
+ modelValue: i(t),
329
+ "onUpdate:modelValue": o[2] || (o[2] = (F) => q(t) ? t.value = F : null),
330
+ placeholder: "Search Method ..."
331
+ }, null, 8, ["modelValue"])
332
+ ])
333
+ ]),
334
+ r(I, {
335
+ class: "mt-6",
336
+ modelValue: v.value,
337
+ "onUpdate:modelValue": o[3] || (o[3] = (F) => v.value = F),
338
+ "shrink-at": !1,
339
+ "search-value": i(t),
340
+ "row-data": a.payoutAccount.methods,
341
+ "column-defs": u
342
+ }, null, 8, ["modelValue", "search-value", "row-data"])
343
+ ], 64)) : h("", !0),
344
+ r(M, {
345
+ class: "w-full mt-6",
346
+ variant: "primary",
347
+ label: "Save",
348
+ loading: e.value,
349
+ onclick: () => l(a.payoutAccount)
350
+ }, null, 8, ["loading", "onclick"])
351
+ ], 64);
352
+ };
353
+ }
354
+ }), be = { class: "flex" }, Fe = /* @__PURE__ */ k({
355
+ __name: "Actions",
356
+ emits: ["edit", "delete"],
357
+ setup(a, { emit: m }) {
358
+ const e = m;
359
+ return (f, l) => {
360
+ const t = p("FmButton");
361
+ return g(), A("div", be, [
362
+ r(t, {
363
+ variant: "plain",
364
+ "prepend-icon": "delete",
365
+ onClick: l[0] || (l[0] = (s) => {
366
+ s.stopPropagation(), e("delete");
367
+ })
368
+ })
369
+ ]);
370
+ };
371
+ }
372
+ }), we = { class: "flex justify-end px-6 pb-6" }, xe = /* @__PURE__ */ k({
373
+ __name: "PaymentChannel",
374
+ props: {
375
+ payoutAccount: {
376
+ type: Object,
377
+ required: !0
378
+ }
379
+ },
380
+ setup(a) {
381
+ const m = z(), e = a, { isLoading: f, startAsyncCall: l } = j(), t = V([]);
382
+ function s() {
383
+ l(async () => {
384
+ t.value = await S.getChannels(e.payoutAccount._id);
385
+ });
386
+ }
387
+ J(s);
388
+ function v() {
389
+ l(async () => {
390
+ try {
391
+ await S.updateChannels(e.payoutAccount._id, t.value), m.open({
392
+ type: "success",
393
+ title: "Payout account channels update succesfully"
394
+ });
395
+ } catch (o) {
396
+ m.open({
397
+ type: "error",
398
+ title: "Error occurs when updating payout account channels",
399
+ message: D(o)
400
+ });
401
+ }
402
+ });
403
+ }
404
+ function u() {
405
+ l(async () => {
406
+ try {
407
+ await S.resetChannels(e.payoutAccount._id), t.value = await S.getChannels(e.payoutAccount._id), m.open({
408
+ type: "success",
409
+ title: "Payout account channels reset succesfully"
410
+ });
411
+ } catch (o) {
412
+ m.open({
413
+ type: "error",
414
+ title: "Error occurs when reset payout account channels",
415
+ message: D(o)
416
+ });
417
+ }
418
+ });
419
+ }
420
+ const n = [
421
+ {
422
+ header: () => "Gateway",
423
+ accessorKey: "gateway"
424
+ },
425
+ {
426
+ header: () => "Payment Type",
427
+ accessorKey: "type"
428
+ },
429
+ {
430
+ header: () => "Display",
431
+ accessorKey: "icon",
432
+ cell: ({ row: o }) => B("img", { src: o.original.icon, width: 32, height: 32 })
433
+ },
434
+ {
435
+ header: () => "Label",
436
+ accessorKey: "label",
437
+ cell: ({ row: o }) => B(ae.FmTextField, {
438
+ modelValue: o.original.label,
439
+ "onUpdate:modelValue": (y) => o.original.label = y
440
+ })
441
+ },
442
+ {
443
+ id: "actions",
444
+ header: () => "Actions",
445
+ cell: ({ row: o }) => B(Fe, {
446
+ onDelete: () => t.value.splice(o.index, 1)
447
+ })
448
+ }
449
+ ];
450
+ return (o, y) => {
451
+ const d = p("FmButton"), b = p("FmTable");
452
+ return g(), A($, null, [
453
+ c("div", we, [
454
+ r(d, {
455
+ class: "mx-4",
456
+ variant: "destructive",
457
+ size: "md",
458
+ icon: "history",
459
+ label: "Reset",
460
+ onClick: u
461
+ }),
462
+ r(d, {
463
+ variant: "primary",
464
+ size: "md",
465
+ icon: "save",
466
+ label: "Save",
467
+ onClick: v
468
+ })
469
+ ]),
470
+ r(b, {
471
+ loading: i(f),
472
+ "row-data": t.value,
473
+ "column-defs": n,
474
+ "shrink-at": !1
475
+ }, null, 8, ["loading", "row-data"])
476
+ ], 64);
477
+ };
478
+ }
479
+ }), _e = { class: "flex mt-6 space-x-6" }, ke = /* @__PURE__ */ k({
480
+ __name: "FiuuGateway",
481
+ props: {
482
+ gateway: {
483
+ type: Object,
484
+ required: !0
485
+ },
486
+ onUpdate: {
487
+ type: Function,
488
+ required: !0
489
+ },
490
+ onDelete: {
491
+ type: Function,
492
+ required: !0
493
+ }
494
+ },
495
+ setup(a) {
496
+ var f;
497
+ const e = V(((f = a.gateway) == null ? void 0 : f.config) || {
498
+ merchantId: "",
499
+ verifyKey: "",
500
+ secretKey: ""
501
+ });
502
+ return (l, t) => {
503
+ const s = p("FmTextField"), v = p("FmButton"), u = p("FmForm");
504
+ return g(), x(u, {
505
+ ref: "form",
506
+ class: "flex flex-col gap-16",
507
+ onValidationSuccess: t[3] || (t[3] = () => a.onUpdate(e.value))
508
+ }, {
509
+ default: _(() => [
510
+ r(s, {
511
+ modelValue: e.value.merchantId,
512
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.merchantId = n),
513
+ label: "Merchant ID",
514
+ rules: i(U)(i(N).string())
515
+ }, null, 8, ["modelValue", "rules"]),
516
+ r(s, {
517
+ modelValue: e.value.verifyKey,
518
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.verifyKey = n),
519
+ label: "Verify Key",
520
+ rules: i(U)(i(N).string())
521
+ }, null, 8, ["modelValue", "rules"]),
522
+ r(s, {
523
+ modelValue: e.value.secretKey,
524
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => e.value.secretKey = n),
525
+ label: "Secret Key",
526
+ rules: i(U)(i(N).string())
527
+ }, null, 8, ["modelValue", "rules"]),
528
+ c("div", _e, [
529
+ a.gateway ? (g(), x(v, {
530
+ key: 0,
531
+ class: "flex-1",
532
+ variant: "secondary",
533
+ label: "Delete",
534
+ onclick: () => a.onDelete()
535
+ }, null, 8, ["onclick"])) : h("", !0),
536
+ r(v, {
537
+ type: "submit",
538
+ class: "flex-1",
539
+ variant: "primary",
540
+ label: "Save"
541
+ })
542
+ ])
543
+ ]),
544
+ _: 1
545
+ }, 512);
546
+ };
547
+ }
548
+ }), Ce = { class: "flex mt-6 space-x-6" }, Ae = /* @__PURE__ */ k({
549
+ __name: "MacauPassGateway",
550
+ props: {
551
+ gateway: {
552
+ type: Object,
553
+ required: !0
554
+ },
555
+ onUpdate: {
556
+ type: Function,
557
+ required: !0
558
+ },
559
+ onDelete: {
560
+ type: Function,
561
+ required: !0
562
+ }
563
+ },
564
+ setup(a) {
565
+ var f;
566
+ const e = V(((f = a.gateway) == null ? void 0 : f.config) || {
567
+ merchantId: "",
568
+ merchantName: "",
569
+ merchantCategoryCode: ""
570
+ });
571
+ return (l, t) => {
572
+ const s = p("FmTextField"), v = p("FmButton"), u = p("FmForm");
573
+ return g(), x(u, {
574
+ ref: "form",
575
+ class: "flex flex-col gap-16",
576
+ onValidationSuccess: t[3] || (t[3] = () => a.onUpdate(e.value))
577
+ }, {
578
+ default: _(() => [
579
+ r(s, {
580
+ modelValue: e.value.merchantId,
581
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.merchantId = n),
582
+ label: "Merchant ID",
583
+ rules: i(U)(i(N).string())
584
+ }, null, 8, ["modelValue", "rules"]),
585
+ r(s, {
586
+ modelValue: e.value.merchantName,
587
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.merchantName = n),
588
+ label: "Merchant Name",
589
+ rules: i(U)(i(N).string())
590
+ }, null, 8, ["modelValue", "rules"]),
591
+ r(s, {
592
+ modelValue: e.value.merchantCategoryCode,
593
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => e.value.merchantCategoryCode = n),
594
+ label: "Merchant MCC",
595
+ rules: i(U)(i(N).string())
596
+ }, null, 8, ["modelValue", "rules"]),
597
+ c("div", Ce, [
598
+ a.gateway ? (g(), x(v, {
599
+ key: 0,
600
+ class: "flex-1",
601
+ variant: "secondary",
602
+ label: "Delete",
603
+ onclick: () => a.onDelete()
604
+ }, null, 8, ["onclick"])) : h("", !0),
605
+ r(v, {
606
+ type: "submit",
607
+ class: "flex-1",
608
+ variant: "primary",
609
+ label: "Save"
610
+ })
611
+ ])
612
+ ]),
613
+ _: 1
614
+ }, 512);
615
+ };
616
+ }
617
+ }), he = {
618
+ key: 0,
619
+ className: "mt-1 my-6 text-gray-600"
620
+ }, Ve = {
621
+ key: 1,
622
+ class: "flex items-center justify-center min-h-[80vh]"
623
+ }, Pe = /* @__PURE__ */ k({
624
+ __name: "PaymentGateway",
625
+ props: {
626
+ payoutAccount: {
627
+ type: Object,
628
+ required: !0
629
+ }
630
+ },
631
+ setup(a) {
632
+ const m = X().currentCountry, e = z(), { isLoading: f, startAsyncCall: l } = j(), { gatewayTab: t } = K({
633
+ gatewayTab: ""
634
+ }), s = a, v = [
635
+ {
636
+ label: "Fiuu",
637
+ value: "RAZER_MERCHANT_SERVICE",
638
+ render: ke,
639
+ region: [R.F_COUNTRY.enum.SG]
640
+ },
641
+ {
642
+ label: "Macau Pass",
643
+ value: "MACAU_PASS",
644
+ render: Ae,
645
+ region: [R.F_COUNTRY.enum.MO]
646
+ }
647
+ ], u = V(s.payoutAccount.gateways ?? []), n = G(() => v.find((d) => d.value === t.value)), o = G(() => v.filter((d) => d.region.includes(m.value ?? R.F_COUNTRY.enum.MY)));
648
+ async function y(d) {
649
+ await l(async () => {
650
+ try {
651
+ await S.updateGateway(s.payoutAccount._id, d), e.open({
652
+ type: "success",
653
+ title: "Payout account gateways update succesfully"
654
+ });
655
+ } catch (b) {
656
+ e.open({
657
+ type: "error",
658
+ title: "Error occurs when updating payout account gateways",
659
+ message: D(b)
660
+ });
661
+ }
662
+ });
663
+ }
664
+ return (d, b) => {
665
+ var M;
666
+ const P = p("FmCircularProgress"), I = p("FmTabs");
667
+ return g(), A($, null, [
668
+ i(m).value === i(R.F_COUNTRY).enum.MY ? (g(), A("p", he, b[1] || (b[1] = [
669
+ c("b", null, "Note: ", -1),
670
+ C(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ")
671
+ ]))) : h("", !0),
672
+ i(f) ? (g(), A("div", Ve, [
673
+ r(P, { size: "xxl" })
674
+ ])) : (g(), x(I, {
675
+ key: 2,
676
+ "model-value": i(t),
677
+ "onUpdate:modelValue": b[0] || (b[0] = (F) => q(t) ? t.value = F : null),
678
+ class: "mb-6",
679
+ items: o.value
680
+ }, null, 8, ["model-value", "items"])),
681
+ i(t) ? (g(), x(Y((M = n.value) == null ? void 0 : M.render), L(H({ key: 3 }, {
682
+ gateway: u.value.find((F) => {
683
+ var w;
684
+ return F.paymentGateway === ((w = n.value) == null ? void 0 : w.value);
685
+ }),
686
+ onDelete: async () => {
687
+ u.value = u.value.filter((F) => {
688
+ var w;
689
+ return F.paymentGateway !== ((w = n.value) == null ? void 0 : w.value);
690
+ }), y(u.value);
691
+ },
692
+ onUpdate: (F) => {
693
+ var E;
694
+ let w = u.value.find((O) => {
695
+ var Z;
696
+ return O.paymentGateway === ((Z = n.value) == null ? void 0 : Z.value);
697
+ });
698
+ w ? w.config = F : u.value.push({
699
+ paymentGateway: (E = n.value) == null ? void 0 : E.value,
700
+ config: F
701
+ }), y(u.value);
702
+ }
703
+ })), null, 16)) : h("", !0)
704
+ ], 64);
705
+ };
706
+ }
707
+ }), Te = { class: "flex mt-6 space-x-6" }, Se = /* @__PURE__ */ k({
708
+ __name: "GooglePayToken",
709
+ props: {
710
+ gateway: {
711
+ type: Object,
712
+ required: !0
713
+ },
714
+ onUpdate: {
715
+ type: Function,
716
+ required: !0
717
+ },
718
+ onDelete: {
719
+ type: Function,
720
+ required: !0
721
+ }
722
+ },
723
+ setup(a) {
724
+ const e = V(a.gateway || {
725
+ // hardcoded first since only 1 PSP supported
726
+ type: "googlePay",
727
+ gateway: "RAZER_MERCHANT_SERVICE",
728
+ config: {
729
+ paymentType: "googlePay",
730
+ gateway: {
731
+ gateway: "molpay",
732
+ gatewayMerchantId: "molpay"
733
+ }
734
+ }
735
+ });
736
+ return (f, l) => {
737
+ const t = p("FmTextField"), s = p("FmButton"), v = p("FmForm");
738
+ return g(), x(v, {
739
+ ref: "form",
740
+ class: "flex flex-col gap-16",
741
+ onValidationSuccess: l[3] || (l[3] = () => a.onUpdate(e.value))
742
+ }, {
743
+ default: _(() => [
744
+ r(t, {
745
+ modelValue: e.value.gateway,
746
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => e.value.gateway = u),
747
+ label: "Gateway",
748
+ disabled: !0,
749
+ rules: i(U)(i(N).string())
750
+ }, null, 8, ["modelValue", "rules"]),
751
+ r(t, {
752
+ modelValue: e.value.config.gateway.gateway,
753
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => e.value.config.gateway.gateway = u),
754
+ label: "Gateway ID",
755
+ disabled: !0,
756
+ rules: i(U)(i(N).string())
757
+ }, null, 8, ["modelValue", "rules"]),
758
+ r(t, {
759
+ modelValue: e.value.config.gateway.gatewayMerchantId,
760
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => e.value.config.gateway.gatewayMerchantId = u),
761
+ label: "Gateway Merchant ID",
762
+ disabled: !0,
763
+ rules: i(U)(i(N).string())
764
+ }, null, 8, ["modelValue", "rules"]),
765
+ c("div", Te, [
766
+ a.gateway ? (g(), x(s, {
767
+ key: 0,
768
+ class: "flex-1",
769
+ variant: "secondary",
770
+ label: "Delete",
771
+ onclick: () => a.onDelete()
772
+ }, null, 8, ["onclick"])) : h("", !0),
773
+ r(s, {
774
+ type: "submit",
775
+ class: "flex-1",
776
+ variant: "primary",
777
+ label: "Save"
778
+ })
779
+ ])
780
+ ]),
781
+ _: 1
782
+ }, 512);
783
+ };
784
+ }
785
+ }), Ue = {
786
+ key: 0,
787
+ class: "flex items-center justify-center min-h-[80vh]"
788
+ }, Ne = /* @__PURE__ */ k({
789
+ __name: "TokenGateway",
790
+ props: {
791
+ payoutAccount: {
792
+ type: Object,
793
+ required: !0
794
+ }
795
+ },
796
+ setup(a) {
797
+ const m = X().currentCountry, e = z(), { isLoading: f, startAsyncCall: l } = j(), { tokenTab: t } = K({
798
+ tokenTab: ""
799
+ }), s = a, v = [
800
+ {
801
+ label: "Google Pay",
802
+ value: "googlePay",
803
+ icon: "android",
804
+ render: Se,
805
+ region: [R.F_COUNTRY.enum.MY, R.F_COUNTRY.enum.SG]
806
+ }
807
+ ], u = V(s.payoutAccount.tokens ?? []), n = G(() => v.find((d) => d.value === t.value)), o = G(() => v.filter((d) => d.region.includes(m.value ?? R.F_COUNTRY.enum.MY)));
808
+ async function y(d) {
809
+ await l(async () => {
810
+ try {
811
+ await S.updateTokens(s.payoutAccount._id, d), e.open({
812
+ type: "success",
813
+ title: "Payout account tokens gateway update succesfully"
814
+ });
815
+ } catch (b) {
816
+ e.open({
817
+ type: "error",
818
+ title: "Error occurs when updating payout account tokens",
819
+ message: D(b)
820
+ });
821
+ }
822
+ });
823
+ }
824
+ return (d, b) => {
825
+ var M;
826
+ const P = p("FmCircularProgress"), I = p("FmTabs");
827
+ return g(), A($, null, [
828
+ b[1] || (b[1] = c("p", { className: "mt-1 my-6 text-gray-600" }, [
829
+ c("b", null, "Note: "),
830
+ C(" Token gateway always on the top of every other methods ( online channels ), and it's was branding requirements from each of the payment token gateway provider. For setting most of the time are the same and only need to select for which provider. ")
831
+ ], -1)),
832
+ i(f) ? (g(), A("div", Ue, [
833
+ r(P, { size: "xxl" })
834
+ ])) : (g(), x(I, {
835
+ key: 1,
836
+ "model-value": i(t),
837
+ "onUpdate:modelValue": b[0] || (b[0] = (F) => q(t) ? t.value = F : null),
838
+ class: "mb-6",
839
+ items: o.value
840
+ }, null, 8, ["model-value", "items"])),
841
+ i(t) ? (g(), x(Y((M = n.value) == null ? void 0 : M.render), L(H({ key: 2 }, {
842
+ gateway: u.value.find((F) => {
843
+ var w;
844
+ return F.type === ((w = n.value) == null ? void 0 : w.value);
845
+ }),
846
+ onDelete: async () => {
847
+ u.value = u.value.filter((F) => {
848
+ var w;
849
+ return F.type !== ((w = n.value) == null ? void 0 : w.value);
850
+ }), y(u.value);
851
+ },
852
+ onUpdate: (F) => {
853
+ let w = u.value.find((E) => {
854
+ var O;
855
+ return E.type === ((O = n.value) == null ? void 0 : O.value);
856
+ });
857
+ w ? w.config = F : u.value.push(F), y(u.value);
858
+ }
859
+ })), null, 16)) : h("", !0)
860
+ ], 64);
861
+ };
862
+ }
863
+ }), Ke = /* @__PURE__ */ k({
864
+ __name: "PayoutAccountSetting",
865
+ props: {
866
+ accountId: {
867
+ type: String,
868
+ required: !0
869
+ }
870
+ },
871
+ setup(a) {
872
+ const m = a, { tab: e } = K({
873
+ tab: "information"
874
+ }), { isLoading: f, startAsyncCall: l } = j(!0), t = te(), s = V();
875
+ async function v(y) {
876
+ await S.updateById(
877
+ m.accountId,
878
+ y
879
+ ), s.value = await S.readById(m.accountId);
880
+ }
881
+ const u = [
882
+ {
883
+ label: "Information",
884
+ value: "information",
885
+ icon: "overview",
886
+ render: le
887
+ },
888
+ {
889
+ label: "Settlement",
890
+ value: "settlement",
891
+ icon: "payments",
892
+ render: ce
893
+ },
894
+ {
895
+ label: "MDR Status",
896
+ value: "payment",
897
+ icon: "account_box",
898
+ render: ge
899
+ },
900
+ {
901
+ label: "Online Gateways",
902
+ icon: "assured_workload",
903
+ value: "gateways",
904
+ render: Pe
905
+ },
906
+ {
907
+ label: "Token Gateways",
908
+ value: "tokens",
909
+ icon: "wallet",
910
+ render: Ne
911
+ },
912
+ {
913
+ label: "Online Channels",
914
+ icon: "shopping_cart",
915
+ value: "channels",
916
+ render: xe
917
+ }
918
+ ];
919
+ function n() {
920
+ l(async () => {
921
+ s.value = await S.readById(m.accountId);
922
+ });
923
+ }
924
+ J(n);
925
+ const o = G(() => {
926
+ const y = u.reduce((d, b) => d || (b.children ? b.children.find((P) => P.value === e.value) || null : b.value === e.value ? b : null), null);
927
+ return y == null ? void 0 : y.render;
928
+ });
929
+ return (y, d) => {
930
+ var P;
931
+ const b = p("FmTabs");
932
+ return g(), x(ee, {
933
+ title: `Payout Account (${(P = s.value) == null ? void 0 : P._id})`,
934
+ loading: i(f),
935
+ onBack: i(t).back
936
+ }, {
937
+ default: _(() => [
938
+ r(b, {
939
+ "model-value": i(e),
940
+ "onUpdate:modelValue": d[0] || (d[0] = (I) => q(e) ? e.value = I : null),
941
+ class: "mb-6",
942
+ items: u
943
+ }, null, 8, ["model-value"]),
944
+ i(e) ? (g(), x(Y(o.value), L(H({ key: 0 }, {
945
+ payoutAccount: s.value,
946
+ onUpdate: v
947
+ })), null, 16)) : h("", !0)
948
+ ]),
949
+ _: 1
950
+ }, 8, ["title", "loading", "onBack"]);
951
+ };
952
+ }
953
+ });
954
+ export {
955
+ Ke as default
956
+ };