@feedmepos/mf-payment 1.0.28 → 1.1.0-beta.2

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 (86) hide show
  1. package/dist/{PDFViewer-xrBtzrlR.js → PDFViewer-BQfgFexr.js} +2 -1
  2. package/dist/{PayoutAccount-QybE7meK.js → PayoutAccount-BpMu58oE.js} +5 -5
  3. package/dist/{PayoutAccount-C53rv89t.js → PayoutAccount-z-gdodfR.js} +361 -360
  4. package/dist/PayoutAccountSetting-jZJu4WWL.js +723 -0
  5. package/dist/{Restaurant-B1ed_oVp.js → Restaurant-DfBX5uPS.js} +56 -54
  6. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-hJAJYKmE.js +33 -0
  7. package/dist/{RestaurantSetting-CKG5jn2J.js → RestaurantSetting-KPtRoif-.js} +3 -3
  8. package/dist/{Settlement-Fh86ozFD.js → Settlement-DbMQAA0_.js} +9 -8
  9. package/dist/Settlement-smC2PDKA.js +445 -0
  10. package/dist/{SettlementTransactions-BSF2Jw-L.js → SettlementTransactions-Bs8Il-GO.js} +14 -14
  11. package/dist/SettlementTransactions-Cw9DnODr.js +291 -0
  12. package/dist/{Terminal-BUBkiYYw.js → Terminal-HLOGtr0x.js} +323 -342
  13. package/dist/{TerminalSetting-CfCa-6pK.js → TerminalSetting-DraCszpQ.js} +27 -27
  14. package/dist/Transaction-B8cHQbbP.js +250 -0
  15. package/dist/{Transaction-DWzZ31qR.js → Transaction-_CB4VTT9.js} +123 -105
  16. package/dist/TransactionOld-BhzUSu5h.js +99 -0
  17. package/dist/TransactionTable.vue_vue_type_script_setup_true_lang-UcnQKwQ5.js +304 -0
  18. package/dist/api/payout/index.d.ts +5 -1
  19. package/dist/api/terminal/index.d.ts +6 -10
  20. package/dist/api/transaction/index.d.ts +12 -11
  21. package/dist/{app-DC4HbItX.js → app-DWRPKvx2.js} +1115 -780
  22. package/dist/app.d.ts +278 -0
  23. package/dist/app.js +4 -3
  24. package/dist/{assets-BySnqkmr.js → assets-BImh8bhR.js} +208 -56
  25. package/dist/components/SourceSelector.vue.d.ts +12 -0
  26. package/dist/{grafana-b2ht7XmY.js → grafana-CPOGSE20.js} +2 -2
  27. package/dist/{index-d3nubgyT.js → index-8eCaI4jI.js} +1 -1
  28. package/dist/{index-iiG_kivD.js → index-CNZFZxie.js} +8163 -8081
  29. package/dist/{index-DXV5GQaF.js → index-D5DlMaeB.js} +1 -1
  30. package/dist/index-DtT3I2PI.js +45 -0
  31. package/dist/index-DuSw-EaU.js +66 -0
  32. package/dist/{index-CvJ2nft4.js → index-eznEOmAe.js} +1 -1
  33. package/dist/{index.vue_vue_type_script_setup_true_lang-Du3twb8U.js → index.vue_vue_type_script_setup_true_lang-DNXWZt8k.js} +8 -7
  34. package/dist/model/payout-account.d.ts +1 -1
  35. package/dist/model/transaction.d.ts +13 -5
  36. package/dist/package.json +9 -8
  37. package/dist/{payout-account-DPdwKVTr.js → payout-account-CjDkY3wf.js} +2 -2
  38. package/dist/router/index.d.ts +1 -0
  39. package/dist/stores/payoutAccount.d.ts +4 -4
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  42. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +133 -0
  43. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +133 -0
  44. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  45. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  46. package/dist/views/admin/payout-account/tabs/cell/Actions.vue.d.ts +8 -0
  47. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +10 -23
  48. package/dist/views/admin/{terminal-transaction/TerminalTransaction.vue.d.ts → payout-account/tabs/gateway/MacauPassGateway.vue.d.ts} +1 -1
  49. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +6 -6
  50. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +6 -6
  51. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  52. package/dist/views/admin/terminal/Terminal.vue.d.ts +4 -1
  53. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +2 -2
  54. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +2 -2
  55. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +2 -2
  56. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +2 -2
  57. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +2 -2
  58. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +2 -0
  59. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  60. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +16 -16
  61. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +8 -8
  62. package/dist/views/{admin/terminal-transaction → transaction}/cell/Actions.vue.d.ts +3 -3
  63. package/package.json +9 -8
  64. package/dist/PayoutAccountSetting-Zhkm_GN8.js +0 -426
  65. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js +0 -33
  66. package/dist/Settlement-SeGVEdZj.js +0 -444
  67. package/dist/SettlementTransactions-CHRsIcoh.js +0 -291
  68. package/dist/TerminalTransaction-DIM7WO_C.js +0 -589
  69. package/dist/TerminalTransaction-DQZnx7dy.js +0 -333
  70. package/dist/Transaction-DRYwBnHK.js +0 -247
  71. package/dist/TransactionOld-Pj412ujb.js +0 -99
  72. package/dist/TransactionTable.vue_vue_type_script_setup_true_lang-B3FGhKjA.js +0 -159
  73. package/dist/components/PayoutAccountSelector.vue.d.ts +0 -23
  74. package/dist/index-BJpE0YhF.js +0 -52
  75. package/dist/index-BqzuW2qa.js +0 -40
  76. package/dist/index-Dwv1hbHU.js +0 -77
  77. package/dist/transaction-CzLoSCVe.js +0 -136
  78. package/dist/views/admin/payout-account/tabs/gateway/GhlGateway.vue.d.ts +0 -50
  79. package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +0 -52
  80. package/dist/views/admin/terminal-transaction/cell/Gateway.vue.d.ts +0 -7
  81. package/dist/views/admin/terminal-transaction/cell/Method.vue.d.ts +0 -7
  82. package/dist/views/admin/terminal-transaction/cell/Status.vue.d.ts +0 -7
  83. package/dist/views/terminal-transaction/TerminalTransaction.vue.d.ts +0 -2
  84. package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +0 -7
  85. package/dist/views/terminal-transaction/cell/Method.vue.d.ts +0 -7
  86. package/dist/views/terminal-transaction/cell/Status.vue.d.ts +0 -7
@@ -0,0 +1,723 @@
1
+ import { defineComponent as k, resolveComponent as y, openBlock as b, createElementBlock as A, Fragment as $, createElementVNode as l, createVNode as s, withCtx as F, createTextVNode as _, toDisplayString as h, createCommentVNode as S, createBlock as C, ref as V, watch as z, computed as M, unref as v, isRef as G, h as B, onMounted as L, resolveDynamicComponent as H, normalizeProps as Y, mergeProps as Q } from "vue";
2
+ import { p as P } from "./index-DuSw-EaU.js";
3
+ import { u as K, e as N } from "./index-CNZFZxie.js";
4
+ import { _ as W } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
5
+ import { useRouter as Z } from "vue-router";
6
+ import { u as D } from "./index-8eCaI4jI.js";
7
+ import { P as q, _ as J } from "./PDFViewer-BQfgFexr.js";
8
+ import { useSnackbar as j, components as X } from "@feedmepos/ui-library";
9
+ import { u as I } from "./error-K1CakhA9.js";
10
+ import { z as R, a as E } from "./validator-D5jtpt9A.js";
11
+ import { useCoreStore as ee } from "@feedmepos/mf-common";
12
+ const te = { class: "flex gap-16 mb-6" }, ne = ["src"], ae = /* @__PURE__ */ k({
13
+ __name: "Information",
14
+ props: {
15
+ payoutAccount: {
16
+ type: Object,
17
+ required: !0
18
+ }
19
+ },
20
+ setup(n) {
21
+ return (r, e) => {
22
+ const p = y("FmCardHeader"), c = y("FmCardSection"), o = y("FmCard");
23
+ return b(), A($, null, [
24
+ l("div", te, [
25
+ s(o, {
26
+ horizontal: "",
27
+ class: "flex-1 p-6",
28
+ variant: "elevated"
29
+ }, {
30
+ default: F(() => [
31
+ s(c, { class: "flex flex-col gap-16 justify-between" }, {
32
+ default: F(() => [
33
+ s(p, {
34
+ class: "p-0",
35
+ title: "Account Info",
36
+ subtitle: ""
37
+ }),
38
+ s(c, { class: "p-0" }, {
39
+ default: F(() => {
40
+ var u, f, d, a, t;
41
+ return [
42
+ e[0] || (e[0] = l("b", null, "For", -1)),
43
+ _(": " + h((f = (u = n.payoutAccount) == null ? void 0 : u.store) == null ? void 0 : f.event) + " ", 1),
44
+ e[1] || (e[1] = l("br", null, null, -1)),
45
+ e[2] || (e[2] = l("b", null, "Reference", -1)),
46
+ _(": " + h((a = (d = n.payoutAccount) == null ? void 0 : d.store) == null ? void 0 : a.id), 1),
47
+ e[3] || (e[3] = l("br", null, null, -1)),
48
+ e[4] || (e[4] = l("b", null, "Business", -1)),
49
+ _(": " + h((t = n.payoutAccount) == null ? void 0 : t.businessId), 1),
50
+ e[5] || (e[5] = l("br", null, null, -1))
51
+ ];
52
+ }),
53
+ _: 1
54
+ })
55
+ ]),
56
+ _: 1
57
+ })
58
+ ]),
59
+ _: 1
60
+ }),
61
+ s(o, {
62
+ horizontal: "",
63
+ class: "flex-1 p-6",
64
+ variant: "elevated"
65
+ }, {
66
+ default: F(() => [
67
+ s(c, { class: "flex flex-col gap-16 justify-between" }, {
68
+ default: F(() => [
69
+ s(p, {
70
+ class: "p-0",
71
+ title: "Key Person",
72
+ subtitle: ""
73
+ }),
74
+ s(c, { class: "p-0" }, {
75
+ default: F(() => {
76
+ var u, f, d, a, t, i, m, w;
77
+ return [
78
+ e[6] || (e[6] = l("b", null, "Email", -1)),
79
+ _(": " + h((d = (f = (u = n.payoutAccount) == null ? void 0 : u.store) == null ? void 0 : f.keyPerson) == null ? void 0 : d.email) + " ", 1),
80
+ e[7] || (e[7] = l("br", null, null, -1)),
81
+ e[8] || (e[8] = l("b", null, "Name", -1)),
82
+ _(": " + h((i = (t = (a = n.payoutAccount) == null ? void 0 : a.store) == null ? void 0 : t.keyPerson) == null ? void 0 : i.name), 1),
83
+ e[9] || (e[9] = l("br", null, null, -1)),
84
+ e[10] || (e[10] = l("b", null, "Phone", -1)),
85
+ _(": " + h((w = (m = n.payoutAccount) == null ? void 0 : m.store.keyPerson) == null ? void 0 : w.phone), 1),
86
+ e[11] || (e[11] = l("br", null, null, -1))
87
+ ];
88
+ }),
89
+ _: 1
90
+ })
91
+ ]),
92
+ _: 1
93
+ })
94
+ ]),
95
+ _: 1
96
+ })
97
+ ]),
98
+ e[12] || (e[12] = l("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
99
+ n.payoutAccount.store.exteriorPhoto ? (b(), A("img", {
100
+ key: 0,
101
+ src: n.payoutAccount.store.exteriorPhoto
102
+ }, null, 8, ne)) : S("", !0)
103
+ ], 64);
104
+ };
105
+ }
106
+ }), oe = { class: "flex gap-16" }, le = { class: "flex-1" }, ue = { class: "flex-1" }, se = /* @__PURE__ */ k({
107
+ __name: "Settlement",
108
+ props: {
109
+ payoutAccount: {
110
+ type: Object,
111
+ required: !0
112
+ }
113
+ },
114
+ setup(n) {
115
+ return (r, e) => {
116
+ const p = y("FmCardHeader"), c = y("FmCardSection"), o = y("FmCard");
117
+ return b(), A($, null, [
118
+ s(o, {
119
+ horizontal: "",
120
+ class: "flex-1 p-6 mx-6 mb-6",
121
+ variant: "elevated"
122
+ }, {
123
+ default: F(() => [
124
+ s(c, { class: "flex flex-col gap-16 justify-between" }, {
125
+ default: F(() => [
126
+ s(p, {
127
+ class: "p-0",
128
+ title: "Bank Info",
129
+ subtitle: ""
130
+ }),
131
+ s(c, { class: "p-0" }, {
132
+ default: F(() => {
133
+ var u, f, d, a, t, i;
134
+ return [
135
+ e[0] || (e[0] = l("b", null, "Bank", -1)),
136
+ _(": " + h((f = (u = n.payoutAccount) == null ? void 0 : u.store.bank) == null ? void 0 : f.name), 1),
137
+ e[1] || (e[1] = l("br", null, null, -1)),
138
+ e[2] || (e[2] = l("b", null, "Name", -1)),
139
+ _(": " + h((a = (d = n.payoutAccount) == null ? void 0 : d.store.bank) == null ? void 0 : a.holderName), 1),
140
+ e[3] || (e[3] = l("br", null, null, -1)),
141
+ e[4] || (e[4] = l("b", null, "Number", -1)),
142
+ _(": " + h((i = (t = n.payoutAccount) == null ? void 0 : t.store.bank) == null ? void 0 : i.accountNumber), 1)
143
+ ];
144
+ }),
145
+ _: 1
146
+ })
147
+ ]),
148
+ _: 1
149
+ })
150
+ ]),
151
+ _: 1
152
+ }),
153
+ l("div", oe, [
154
+ l("div", le, [
155
+ e[5] || (e[5] = l("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
156
+ n.payoutAccount.store.ssm ? (b(), C(q, {
157
+ key: 0,
158
+ pdf: n.payoutAccount.store.ssm,
159
+ "disable-text-layer": !0,
160
+ "disable-annotation-layer": !0
161
+ }, null, 8, ["pdf"])) : S("", !0)
162
+ ]),
163
+ l("div", ue, [
164
+ e[6] || (e[6] = l("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
165
+ n.payoutAccount.store.bankStatement ? (b(), C(q, {
166
+ key: 0,
167
+ pdf: n.payoutAccount.store.bankStatement,
168
+ "disable-text-layer": !0,
169
+ "disable-annotation-layer": !0
170
+ }, null, 8, ["pdf"])) : S("", !0)
171
+ ])
172
+ ])
173
+ ], 64);
174
+ };
175
+ }
176
+ }), re = /* @__PURE__ */ k({
177
+ __name: "RateInput",
178
+ props: {
179
+ data: {},
180
+ onChange: { type: Function }
181
+ },
182
+ setup(n) {
183
+ const r = n, e = V(r.data.toString());
184
+ return z(e, (p) => {
185
+ r.onChange(parseFloat(p));
186
+ }), (p, c) => {
187
+ const o = y("FmTextField");
188
+ return b(), C(o, {
189
+ inputmode: "decimal",
190
+ modelValue: e.value,
191
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => e.value = u)
192
+ }, {
193
+ append: F(() => c[1] || (c[1] = [
194
+ _("%")
195
+ ])),
196
+ _: 1
197
+ }, 8, ["modelValue"]);
198
+ };
199
+ }
200
+ }), ce = /* @__PURE__ */ k({
201
+ __name: "TPlusInput",
202
+ props: {
203
+ data: {},
204
+ onChange: { type: Function }
205
+ },
206
+ setup(n) {
207
+ const r = n, e = V(r.data.toString());
208
+ return z(e, (p) => {
209
+ r.onChange(parseInt(p));
210
+ }), (p, c) => {
211
+ const o = y("FmTextField");
212
+ return b(), C(o, {
213
+ inputmode: "numeric",
214
+ modelValue: e.value,
215
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => e.value = u)
216
+ }, null, 8, ["modelValue"]);
217
+ };
218
+ }
219
+ }), ie = { class: "flex gap-16 mt-6" }, de = { class: "flex-1" }, me = { class: "flex-1" }, pe = { class: "my-6 w-full flex justify-end" }, ye = { class: "w-[320px]" }, fe = /* @__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(n) {
232
+ const r = n, e = V(!1), p = j(), c = async (a) => {
233
+ try {
234
+ e.value = !0, await r.onUpdate(a), p.open({
235
+ type: "success",
236
+ title: "Payout account update succesfully"
237
+ });
238
+ } catch (t) {
239
+ p.open({
240
+ type: "error",
241
+ title: "Error occurs when updating payout account",
242
+ message: I(t)
243
+ });
244
+ } finally {
245
+ e.value = !1;
246
+ }
247
+ }, { search: o } = D({
248
+ search: ""
249
+ }), u = M(() => {
250
+ const { ssm: a, bank: t, bankStatement: i } = r.payoutAccount.store;
251
+ return a && t && t.name && t.accountNumber && t.holderName && i;
252
+ }), f = V(""), d = [
253
+ {
254
+ header: () => "Payment Method",
255
+ accessorKey: "issuer",
256
+ cell: (a) => `${a.row.original.issuer} (${a.row.original.variant})`
257
+ },
258
+ {
259
+ header: () => "Rate",
260
+ accessorKey: "rate",
261
+ cell: ({ row: a }) => {
262
+ let t = 0;
263
+ return a.original.rate && (t = a.original.rate.amount / Math.pow(10, a.original.rate.precision)), B(re, {
264
+ data: t,
265
+ onChange: (i) => {
266
+ const m = r.payoutAccount.methods.at(a.index);
267
+ m.rate || (m.rate = {
268
+ amount: 0,
269
+ precision: 4
270
+ }), m.rate.amount = i * Math.pow(10, m.rate.precision);
271
+ }
272
+ });
273
+ }
274
+ },
275
+ {
276
+ header: () => "T plus",
277
+ accessorKey: "tPlus",
278
+ cell: ({ row: a }) => B(ce, {
279
+ data: a.original.tPlus ?? 0,
280
+ onChange: (t) => {
281
+ const i = r.payoutAccount.methods.at(a.index);
282
+ i.tPlus = t;
283
+ }
284
+ })
285
+ }
286
+ ];
287
+ return (a, t) => {
288
+ const i = y("FmRadio"), m = y("FmRadioGroup"), w = y("FmSwitch"), T = y("FmSearch"), U = y("FmTable"), x = y("FmButton");
289
+ return b(), A($, null, [
290
+ l("div", ie, [
291
+ l("div", de, [
292
+ s(m, {
293
+ modelValue: n.payoutAccount.status,
294
+ "onUpdate:modelValue": t[0] || (t[0] = (g) => n.payoutAccount.status = g),
295
+ label: "Account Status"
296
+ }, {
297
+ default: F(() => [
298
+ s(i, {
299
+ value: "NEW",
300
+ label: "New"
301
+ }),
302
+ s(i, {
303
+ value: "PENDING",
304
+ label: "Pending"
305
+ }),
306
+ s(i, {
307
+ value: "APPROVED",
308
+ label: "Approved"
309
+ })
310
+ ]),
311
+ _: 1
312
+ }, 8, ["modelValue"])
313
+ ]),
314
+ l("div", me, [
315
+ s(w, {
316
+ modelValue: n.payoutAccount.enable,
317
+ "onUpdate:modelValue": t[1] || (t[1] = (g) => n.payoutAccount.enable = g),
318
+ disabled: !u.value,
319
+ label: "Enabled",
320
+ sublabel: "Merchant can use online features such as e-payment, settlement"
321
+ }, null, 8, ["modelValue", "disabled"])
322
+ ])
323
+ ]),
324
+ n.payoutAccount.enable ? (b(), A($, { key: 0 }, [
325
+ l("div", pe, [
326
+ l("div", ye, [
327
+ s(T, {
328
+ modelValue: v(o),
329
+ "onUpdate:modelValue": t[2] || (t[2] = (g) => G(o) ? o.value = g : null),
330
+ placeholder: "Search Method ..."
331
+ }, null, 8, ["modelValue"])
332
+ ])
333
+ ]),
334
+ s(U, {
335
+ class: "mt-6",
336
+ modelValue: f.value,
337
+ "onUpdate:modelValue": t[3] || (t[3] = (g) => f.value = g),
338
+ "shrink-at": !1,
339
+ "search-value": v(o),
340
+ "row-data": n.payoutAccount.methods,
341
+ "column-defs": d
342
+ }, null, 8, ["modelValue", "search-value", "row-data"])
343
+ ], 64)) : S("", !0),
344
+ s(x, {
345
+ class: "w-full mt-6",
346
+ variant: "primary",
347
+ label: "Save",
348
+ loading: e.value,
349
+ onclick: () => c(n.payoutAccount)
350
+ }, null, 8, ["loading", "onclick"])
351
+ ], 64);
352
+ };
353
+ }
354
+ }), be = { class: "flex" }, ve = /* @__PURE__ */ k({
355
+ __name: "Actions",
356
+ emits: ["edit", "delete"],
357
+ setup(n, { emit: r }) {
358
+ const e = r;
359
+ return (p, c) => {
360
+ const o = y("FmButton");
361
+ return b(), A("div", be, [
362
+ s(o, {
363
+ variant: "plain",
364
+ "prepend-icon": "delete",
365
+ onClick: c[0] || (c[0] = (u) => {
366
+ u.stopPropagation(), e("delete");
367
+ })
368
+ })
369
+ ]);
370
+ };
371
+ }
372
+ }), ge = { class: "flex justify-end px-6 pb-6" }, Fe = /* @__PURE__ */ k({
373
+ __name: "PaymentChannel",
374
+ props: {
375
+ payoutAccount: {
376
+ type: Object,
377
+ required: !0
378
+ }
379
+ },
380
+ setup(n) {
381
+ const r = j(), e = n, { isLoading: p, startAsyncCall: c } = K(), o = V([]);
382
+ function u() {
383
+ c(async () => {
384
+ o.value = await P.getChannels(e.payoutAccount._id);
385
+ });
386
+ }
387
+ L(u);
388
+ function f() {
389
+ c(async () => {
390
+ try {
391
+ await P.updateChannels(e.payoutAccount._id, o.value), r.open({
392
+ type: "success",
393
+ title: "Payout account channels update succesfully"
394
+ });
395
+ } catch (t) {
396
+ r.open({
397
+ type: "error",
398
+ title: "Error occurs when updating payout account channels",
399
+ message: I(t)
400
+ });
401
+ }
402
+ });
403
+ }
404
+ function d() {
405
+ c(async () => {
406
+ try {
407
+ await P.resetChannels(e.payoutAccount._id), o.value = await P.getChannels(e.payoutAccount._id), r.open({
408
+ type: "success",
409
+ title: "Payout account channels reset succesfully"
410
+ });
411
+ } catch (t) {
412
+ r.open({
413
+ type: "error",
414
+ title: "Error occurs when reset payout account channels",
415
+ message: I(t)
416
+ });
417
+ }
418
+ });
419
+ }
420
+ const a = [
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: t }) => B("img", { src: t.original.icon, width: 32, height: 32 })
433
+ },
434
+ {
435
+ header: () => "Label",
436
+ accessorKey: "label",
437
+ cell: ({ row: t }) => B(X.FmTextField, {
438
+ modelValue: t.original.label,
439
+ "onUpdate:modelValue": (i) => t.original.label = i
440
+ })
441
+ },
442
+ {
443
+ id: "actions",
444
+ header: () => "Actions",
445
+ cell: ({ row: t }) => B(ve, {
446
+ onDelete: () => o.value.splice(t.index, 1)
447
+ })
448
+ }
449
+ ];
450
+ return (t, i) => {
451
+ const m = y("FmButton"), w = y("FmTable");
452
+ return b(), A($, null, [
453
+ l("div", ge, [
454
+ s(m, {
455
+ class: "mx-4",
456
+ variant: "destructive",
457
+ size: "md",
458
+ icon: "history",
459
+ label: "Reset",
460
+ onClick: d
461
+ }),
462
+ s(m, {
463
+ variant: "primary",
464
+ size: "md",
465
+ icon: "save",
466
+ label: "Save",
467
+ onClick: f
468
+ })
469
+ ]),
470
+ s(w, {
471
+ loading: v(p),
472
+ "row-data": o.value,
473
+ "column-defs": a,
474
+ "shrink-at": !1
475
+ }, null, 8, ["loading", "row-data"])
476
+ ], 64);
477
+ };
478
+ }
479
+ }), xe = { class: "flex mt-6 space-x-6" }, _e = /* @__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(n) {
496
+ var p;
497
+ const e = V(((p = n.gateway) == null ? void 0 : p.config) || {
498
+ merchantId: "",
499
+ verifyKey: "",
500
+ secretKey: ""
501
+ });
502
+ return (c, o) => {
503
+ const u = y("FmTextField"), f = y("FmButton"), d = y("FmForm");
504
+ return b(), C(d, {
505
+ ref: "form",
506
+ class: "flex flex-col gap-16",
507
+ onValidationSuccess: o[3] || (o[3] = () => n.onUpdate(e.value))
508
+ }, {
509
+ default: F(() => [
510
+ s(u, {
511
+ modelValue: e.value.merchantId,
512
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => e.value.merchantId = a),
513
+ label: "Merchant ID",
514
+ rules: v(R)(v(E).string())
515
+ }, null, 8, ["modelValue", "rules"]),
516
+ s(u, {
517
+ modelValue: e.value.verifyKey,
518
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => e.value.verifyKey = a),
519
+ label: "Verify Key",
520
+ rules: v(R)(v(E).string())
521
+ }, null, 8, ["modelValue", "rules"]),
522
+ s(u, {
523
+ modelValue: e.value.secretKey,
524
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => e.value.secretKey = a),
525
+ label: "Secret Key",
526
+ rules: v(R)(v(E).string())
527
+ }, null, 8, ["modelValue", "rules"]),
528
+ l("div", xe, [
529
+ n.gateway ? (b(), C(f, {
530
+ key: 0,
531
+ class: "flex-1",
532
+ variant: "secondary",
533
+ label: "Delete",
534
+ onclick: () => n.onDelete()
535
+ }, null, 8, ["onclick"])) : S("", !0),
536
+ s(f, {
537
+ type: "submit",
538
+ class: "flex-1",
539
+ variant: "primary",
540
+ label: "Save"
541
+ })
542
+ ])
543
+ ]),
544
+ _: 1
545
+ }, 512);
546
+ };
547
+ }
548
+ }), we = {}, Ae = { class: "flex items-center justify-center h-screen" };
549
+ function Ce(n, r) {
550
+ return b(), A("div", Ae, r[0] || (r[0] = [
551
+ l("h1", { class: "text-4xl font-bold text-gray-800" }, "Coming Soon", -1)
552
+ ]));
553
+ }
554
+ const ke = /* @__PURE__ */ J(we, [["render", Ce]]), he = {
555
+ key: 0,
556
+ class: "flex items-center justify-center min-h-[80vh]"
557
+ }, Pe = /* @__PURE__ */ k({
558
+ __name: "PaymentGateway",
559
+ props: {
560
+ payoutAccount: {
561
+ type: Object,
562
+ required: !0
563
+ }
564
+ },
565
+ setup(n) {
566
+ const r = ee().currentCountry, e = j(), { isLoading: p, startAsyncCall: c } = K(), { gatewayTab: o } = D({
567
+ gatewayTab: ""
568
+ }), u = n, f = [
569
+ {
570
+ label: "Fiuu",
571
+ value: "RAZER_MERCHANT_SERVICE",
572
+ render: _e,
573
+ region: [N.F_COUNTRY.enum.SG]
574
+ },
575
+ {
576
+ label: "Macau Pass",
577
+ value: "MACAU_PASS",
578
+ render: ke,
579
+ region: [N.F_COUNTRY.enum.MO]
580
+ }
581
+ ], d = V(u.payoutAccount.gateways ?? []), a = M(() => f.find((i) => i.value === o.value));
582
+ async function t(i) {
583
+ await c(async () => {
584
+ try {
585
+ await P.updateGateway(u.payoutAccount._id, i), e.open({
586
+ type: "success",
587
+ title: "Payout account gateways update succesfully"
588
+ });
589
+ } catch (m) {
590
+ e.open({
591
+ type: "error",
592
+ title: "Error occurs when updating payout account gateways",
593
+ message: I(m)
594
+ });
595
+ }
596
+ });
597
+ }
598
+ return (i, m) => {
599
+ var U;
600
+ const w = y("FmCircularProgress"), T = y("FmTabs");
601
+ return b(), A($, null, [
602
+ m[1] || (m[1] = l("p", { className: "mt-1 my-6 text-gray-600" }, [
603
+ l("b", null, "Note: "),
604
+ _(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ")
605
+ ], -1)),
606
+ v(p) ? (b(), A("div", he, [
607
+ s(w, { size: "xxl" })
608
+ ])) : (b(), C(T, {
609
+ key: 1,
610
+ "model-value": v(o),
611
+ "onUpdate:modelValue": m[0] || (m[0] = (x) => G(o) ? o.value = x : null),
612
+ class: "mb-6",
613
+ items: f.filter((x) => x.region.includes(v(r) ?? v(N.F_COUNTRY).enum.MY))
614
+ }, null, 8, ["model-value", "items"])),
615
+ v(o) ? (b(), C(H((U = a.value) == null ? void 0 : U.render), Y(Q({ key: 2 }, {
616
+ gateway: d.value.find((x) => {
617
+ var g;
618
+ return x.paymentGateway === ((g = a.value) == null ? void 0 : g.value);
619
+ }),
620
+ onDelete: async () => {
621
+ d.value = d.value.filter((x) => {
622
+ var g;
623
+ return x.paymentGateway !== ((g = a.value) == null ? void 0 : g.value);
624
+ }), t(d.value);
625
+ },
626
+ onUpdate: (x) => {
627
+ d.value.find((g) => {
628
+ var O;
629
+ return g.paymentGateway === ((O = a.value) == null ? void 0 : O.value);
630
+ }).config = x, t(d.value);
631
+ }
632
+ })), null, 16)) : S("", !0)
633
+ ], 64);
634
+ };
635
+ }
636
+ }), Ge = /* @__PURE__ */ k({
637
+ __name: "PayoutAccountSetting",
638
+ props: {
639
+ accountId: {
640
+ type: String,
641
+ required: !0
642
+ }
643
+ },
644
+ setup(n) {
645
+ const r = n, { tab: e } = D({
646
+ tab: "information"
647
+ }), { isLoading: p, startAsyncCall: c } = K(!0), o = Z(), u = V();
648
+ async function f(i) {
649
+ await P.updateById(
650
+ r.accountId,
651
+ i
652
+ ), u.value = await P.readById(r.accountId);
653
+ }
654
+ const d = [
655
+ {
656
+ label: "Information",
657
+ value: "information",
658
+ icon: "overview",
659
+ render: ae
660
+ },
661
+ {
662
+ label: "Settlement",
663
+ value: "settlement",
664
+ icon: "payments",
665
+ render: se
666
+ },
667
+ {
668
+ label: "MDR Status",
669
+ value: "payment",
670
+ icon: "account_box",
671
+ render: fe
672
+ },
673
+ {
674
+ label: "Online Gateways",
675
+ value: "gateways",
676
+ icon: "account_balance",
677
+ render: Pe
678
+ },
679
+ {
680
+ label: "Online Channels",
681
+ value: "channels",
682
+ icon: "assured_workload",
683
+ render: Fe
684
+ }
685
+ ];
686
+ function a() {
687
+ c(async () => {
688
+ u.value = await P.readById(r.accountId);
689
+ });
690
+ }
691
+ L(a);
692
+ const t = M(() => {
693
+ var i;
694
+ return (i = d.find((m) => m.value === e.value)) == null ? void 0 : i.render;
695
+ });
696
+ return (i, m) => {
697
+ var T;
698
+ const w = y("FmTabs");
699
+ return b(), C(W, {
700
+ title: `Payout Account (${(T = u.value) == null ? void 0 : T._id})`,
701
+ loading: v(p),
702
+ onBack: v(o).back
703
+ }, {
704
+ default: F(() => [
705
+ s(w, {
706
+ "model-value": v(e),
707
+ "onUpdate:modelValue": m[0] || (m[0] = (U) => G(e) ? e.value = U : null),
708
+ class: "mb-6",
709
+ items: d
710
+ }, null, 8, ["model-value"]),
711
+ v(e) ? (b(), C(H(t.value), Y(Q({ key: 0 }, {
712
+ payoutAccount: u.value,
713
+ onUpdate: f
714
+ })), null, 16)) : S("", !0)
715
+ ]),
716
+ _: 1
717
+ }, 8, ["title", "loading", "onBack"]);
718
+ };
719
+ }
720
+ });
721
+ export {
722
+ Ge as default
723
+ };