@feedmepos/mf-payment 1.5.6-dev → 1.5.6

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 (70) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-Cwt13ALm.js → Actions.vue_vue_type_script_setup_true_lang-BLXnOuCw.js} +2 -2
  2. package/dist/{Chargeback-BdT_s3at.js → Chargeback-19afdT_4.js} +5 -5
  3. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-CTA026mA.js → DocumentViewer.vue_vue_type_script_setup_true_lang-C-5XOuTl.js} +1 -1
  4. package/dist/{OnboardForm-BGM0rOan.js → OnboardForm-Cnnx_Wje.js} +5 -5
  5. package/dist/{OnboardForm-BsgH4rQ8.js → OnboardForm-DBgi_Y2Q.js} +5 -5
  6. package/dist/{OnboardSubmission-DcFt464S.js → OnboardSubmission-BB383_k0.js} +5 -5
  7. package/dist/{OnboardSubmission-DrWzegfK.js → OnboardSubmission-BhW5esGJ.js} +2 -2
  8. package/dist/{PayoutAccount-5spM7Xnv.js → PayoutAccount-DNl7LXSp.js} +5 -5
  9. package/dist/{PayoutAccount-D1NqkA8w.js → PayoutAccount-OGJGX0YY.js} +4 -4
  10. package/dist/PayoutAccountSetting-DzkmUdgK.js +1318 -0
  11. package/dist/{Restaurant-DCycaRR7.js → Restaurant-ZiTHtFZJ.js} +4 -4
  12. package/dist/{RestaurantSetting-D6s1uPMz.js → RestaurantSetting-M1jYaGwx.js} +3 -3
  13. package/dist/{Settlement-DlplAJW2.js → Settlement-Cj2W8VfH.js} +3 -3
  14. package/dist/{Settlement-DHebMBfs.js → Settlement-D_nmqYEC.js} +3 -3
  15. package/dist/{SettlementTransactions-D1FZ4SvU.js → SettlementTransactions-DQZUsieX.js} +4 -4
  16. package/dist/{SettlementTransactions-BB3jFvdP.js → SettlementTransactions-DvO6XMC4.js} +4 -4
  17. package/dist/{Status.vue_vue_type_script_setup_true_lang-BsbxaRKL.js → Status.vue_vue_type_script_setup_true_lang-BP5m6Vic.js} +1 -1
  18. package/dist/{Terminal-DOf20nIw.js → Terminal-CoPPPePw.js} +5 -5
  19. package/dist/{TerminalSetting-fwdOkBMF.js → TerminalSetting-PWs1fyFe.js} +3 -3
  20. package/dist/{Transaction-BojSMumb.js → Transaction-C6CtVbqB.js} +6 -6
  21. package/dist/{Transaction-DRc7VdWm.js → Transaction-DHTahbbJ.js} +9 -9
  22. package/dist/{TransactionOld-CVid_gM_.js → TransactionOld-Cvqw-Osm.js} +6 -6
  23. package/dist/{app-DewutbV3.js → app-BtjXBDKJ.js} +518 -526
  24. package/dist/app.js +4 -5
  25. package/dist/{assets-BnwoyNOf.js → assets-V6CPweA9.js} +1 -1
  26. package/dist/{grafana-Bz7xSfdW.js → grafana-fZyobMgN.js} +1 -1
  27. package/dist/{index-DyEaoZ8f.js → index--K2ipr4H.js} +1 -1
  28. package/dist/{index-Dqk3bGgi.js → index-BJNCcdvT.js} +5504 -5503
  29. package/dist/{index-BcpQUz2-.js → index-C-YBwRQp.js} +1 -1
  30. package/dist/{index-BGliGchf.js → index-CMN40t8e.js} +1 -1
  31. package/dist/{index-Bi2r6bNV.js → index-CtkwL_6R.js} +1 -1
  32. package/dist/{index-DaMy_lQ6.js → index-D69RnDa7.js} +1 -1
  33. package/dist/{index-6TNmNay6.js → index-_u7l8cO3.js} +1 -1
  34. package/dist/{index-DqW_m_SE.js → index-eLZ3BErV.js} +1 -1
  35. package/dist/{index-D68osbqj.js → index-ysvBViCR.js} +26 -23
  36. package/dist/{index.vue_vue_type_script_setup_true_lang-D6hndvwu.js → index.vue_vue_type_script_setup_true_lang-zxkA_YTt.js} +1 -1
  37. package/dist/package.json +2 -2
  38. package/dist/{payout-account-BTAtskf1.js → payout-account-DKOx8gaG.js} +3 -3
  39. package/dist/stores/payoutAccount.d.ts +22 -30
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +22 -30
  42. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +22 -30
  43. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +22 -30
  44. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +24 -32
  45. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +22 -30
  46. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +22 -30
  47. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +8 -8
  48. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +8 -8
  49. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +8 -8
  50. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +8 -8
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +8 -8
  52. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +8 -8
  53. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +8 -8
  54. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +8 -8
  55. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +8 -8
  56. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +8 -8
  57. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +8 -8
  58. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +8 -8
  59. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +8 -8
  60. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +8 -8
  61. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +8 -8
  62. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +8 -8
  63. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +8 -8
  64. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +8 -8
  65. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +44 -60
  66. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +52 -52
  67. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +26 -26
  68. package/package.json +2 -2
  69. package/dist/PayoutAccountSetting-BSmvV6yF.js +0 -1359
  70. package/dist/views/admin/payout-account/cell/MinimumFeeInput.vue.d.ts +0 -6
@@ -0,0 +1,1318 @@
1
+ import { defineComponent as _, resolveComponent as i, openBlock as v, createElementBlock as P, Fragment as $, createElementVNode as d, createVNode as l, withCtx as V, createTextVNode as h, toDisplayString as R, ref as U, watch as te, createBlock as F, computed as K, isRef as q, unref as u, createCommentVNode as T, h as B, onMounted as ae, resolveDynamicComponent as Z, normalizeProps as Q, mergeProps as W } from "vue";
2
+ import { p as M } from "./index-D69RnDa7.js";
3
+ import { u as Y, e as S } from "./index-BJNCcdvT.js";
4
+ import { _ as oe } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
5
+ import { useRouter as ue } from "vue-router";
6
+ import { u as j } from "./index-CtkwL_6R.js";
7
+ import { _ as L } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-C-5XOuTl.js";
8
+ import { P as ee } from "./PDFViewer-CIPPbzWD.js";
9
+ import { useSnackbar as z, components as re } from "@feedmepos/ui-library";
10
+ import { u as E } from "./error-K1CakhA9.js";
11
+ import { z as x, a as w } from "./validator-DzjyJnvv.js";
12
+ import { useCoreStore as ne } from "@feedmepos/mf-common";
13
+ const se = { class: "flex gap-16 mb-6" }, ce = /* @__PURE__ */ _({
14
+ __name: "Information",
15
+ props: {
16
+ payoutAccount: {
17
+ type: Object,
18
+ required: !0
19
+ }
20
+ },
21
+ setup(a) {
22
+ return (y, e) => {
23
+ var r, p;
24
+ const m = i("FmCardHeader"), s = i("FmCardSection"), t = i("FmCard");
25
+ return v(), P($, null, [
26
+ d("div", se, [
27
+ l(t, {
28
+ horizontal: "",
29
+ class: "flex-1 p-6",
30
+ variant: "elevated"
31
+ }, {
32
+ default: V(() => [
33
+ l(s, { class: "flex flex-col gap-16 justify-between" }, {
34
+ default: V(() => [
35
+ l(m, {
36
+ class: "p-0",
37
+ title: "Account Info",
38
+ subtitle: ""
39
+ }),
40
+ l(s, { class: "p-0" }, {
41
+ default: V(() => {
42
+ var c, n, o, g, f;
43
+ return [
44
+ e[0] || (e[0] = d("b", null, "For", -1)),
45
+ h(": " + R((n = (c = a.payoutAccount) == null ? void 0 : c.store) == null ? void 0 : n.event) + " ", 1),
46
+ e[1] || (e[1] = d("br", null, null, -1)),
47
+ e[2] || (e[2] = d("b", null, "Reference", -1)),
48
+ h(": " + R((g = (o = a.payoutAccount) == null ? void 0 : o.store) == null ? void 0 : g.id), 1),
49
+ e[3] || (e[3] = d("br", null, null, -1)),
50
+ e[4] || (e[4] = d("b", null, "Business", -1)),
51
+ h(": " + R((f = a.payoutAccount) == null ? void 0 : f.businessId), 1),
52
+ e[5] || (e[5] = d("br", null, null, -1))
53
+ ];
54
+ }),
55
+ _: 1
56
+ })
57
+ ]),
58
+ _: 1
59
+ })
60
+ ]),
61
+ _: 1
62
+ }),
63
+ l(t, {
64
+ horizontal: "",
65
+ class: "flex-1 p-6",
66
+ variant: "elevated"
67
+ }, {
68
+ default: V(() => [
69
+ l(s, { class: "flex flex-col gap-16 justify-between" }, {
70
+ default: V(() => [
71
+ l(m, {
72
+ class: "p-0",
73
+ title: "Key Person",
74
+ subtitle: ""
75
+ }),
76
+ l(s, { class: "p-0" }, {
77
+ default: V(() => {
78
+ var c, n, o, g, f, b, C, k;
79
+ return [
80
+ e[6] || (e[6] = d("b", null, "Email", -1)),
81
+ h(": " + R((o = (n = (c = a.payoutAccount) == null ? void 0 : c.store) == null ? void 0 : n.keyPerson) == null ? void 0 : o.email) + " ", 1),
82
+ e[7] || (e[7] = d("br", null, null, -1)),
83
+ e[8] || (e[8] = d("b", null, "Name", -1)),
84
+ h(": " + R((b = (f = (g = a.payoutAccount) == null ? void 0 : g.store) == null ? void 0 : f.keyPerson) == null ? void 0 : b.name), 1),
85
+ e[9] || (e[9] = d("br", null, null, -1)),
86
+ e[10] || (e[10] = d("b", null, "Phone", -1)),
87
+ h(": " + R((k = (C = a.payoutAccount) == null ? void 0 : C.store.keyPerson) == null ? void 0 : k.phone), 1),
88
+ e[11] || (e[11] = d("br", null, null, -1))
89
+ ];
90
+ }),
91
+ _: 1
92
+ })
93
+ ]),
94
+ _: 1
95
+ })
96
+ ]),
97
+ _: 1
98
+ })
99
+ ]),
100
+ e[12] || (e[12] = d("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
101
+ l(L, {
102
+ document: a.payoutAccount.store.exteriorPhoto,
103
+ "restaurant-id": ((p = (r = a.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : p.event) === "ORDERING" ? a.payoutAccount.store.id : void 0
104
+ }, null, 8, ["document", "restaurant-id"])
105
+ ], 64);
106
+ };
107
+ }
108
+ }), ie = { class: "flex gap-16" }, de = { class: "flex-1" }, me = { class: "flex-1" }, pe = /* @__PURE__ */ _({
109
+ __name: "Settlement",
110
+ props: {
111
+ payoutAccount: {
112
+ type: Object,
113
+ required: !0
114
+ }
115
+ },
116
+ setup(a) {
117
+ return (y, e) => {
118
+ var r, p, c, n;
119
+ const m = i("FmCardHeader"), s = i("FmCardSection"), t = i("FmCard");
120
+ return v(), P($, null, [
121
+ l(t, {
122
+ horizontal: "",
123
+ class: "flex-1 p-6 mx-6 mb-6",
124
+ variant: "elevated"
125
+ }, {
126
+ default: V(() => [
127
+ l(s, { class: "flex flex-col gap-16 justify-between" }, {
128
+ default: V(() => [
129
+ l(m, {
130
+ class: "p-0",
131
+ title: "Bank Info",
132
+ subtitle: ""
133
+ }),
134
+ l(s, { class: "p-0" }, {
135
+ default: V(() => {
136
+ var o, g, f, b, C, k;
137
+ return [
138
+ e[0] || (e[0] = d("b", null, "Bank", -1)),
139
+ h(": " + R((g = (o = a.payoutAccount) == null ? void 0 : o.store.bank) == null ? void 0 : g.name), 1),
140
+ e[1] || (e[1] = d("br", null, null, -1)),
141
+ e[2] || (e[2] = d("b", null, "Name", -1)),
142
+ h(": " + R((b = (f = a.payoutAccount) == null ? void 0 : f.store.bank) == null ? void 0 : b.holderName), 1),
143
+ e[3] || (e[3] = d("br", null, null, -1)),
144
+ e[4] || (e[4] = d("b", null, "Number", -1)),
145
+ h(": " + R((k = (C = a.payoutAccount) == null ? void 0 : C.store.bank) == null ? void 0 : k.accountNumber), 1)
146
+ ];
147
+ }),
148
+ _: 1
149
+ })
150
+ ]),
151
+ _: 1
152
+ })
153
+ ]),
154
+ _: 1
155
+ }),
156
+ d("div", ie, [
157
+ d("div", de, [
158
+ e[5] || (e[5] = d("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
159
+ l(L, {
160
+ "restaurant-id": ((p = (r = a.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : p.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
161
+ document: a.payoutAccount.store.ssm
162
+ }, {
163
+ default: V(({ src: o }) => [
164
+ l(ee, {
165
+ pdf: o,
166
+ "disable-text-layer": !0,
167
+ "disable-annotation-layer": !0
168
+ }, null, 8, ["pdf"])
169
+ ]),
170
+ _: 1
171
+ }, 8, ["restaurant-id", "document"])
172
+ ]),
173
+ d("div", me, [
174
+ e[6] || (e[6] = d("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
175
+ l(L, {
176
+ "restaurant-id": ((n = (c = a.payoutAccount) == null ? void 0 : c.store) == null ? void 0 : n.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
177
+ document: a.payoutAccount.store.bankStatement
178
+ }, {
179
+ default: V(({ src: o }) => [
180
+ l(ee, {
181
+ pdf: o,
182
+ "disable-text-layer": !0,
183
+ "disable-annotation-layer": !0
184
+ }, null, 8, ["pdf"])
185
+ ]),
186
+ _: 1
187
+ }, 8, ["restaurant-id", "document"])
188
+ ])
189
+ ])
190
+ ], 64);
191
+ };
192
+ }
193
+ }), ye = /* @__PURE__ */ _({
194
+ __name: "RateInput",
195
+ props: {
196
+ data: {},
197
+ onChange: { type: Function }
198
+ },
199
+ setup(a) {
200
+ const y = a, e = U(y.data.toString());
201
+ return te(e, (m) => {
202
+ y.onChange(parseFloat(m));
203
+ }), (m, s) => {
204
+ const t = i("FmTextField");
205
+ return v(), F(t, {
206
+ inputmode: "decimal",
207
+ modelValue: e.value,
208
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
209
+ }, {
210
+ append: V(() => [...s[1] || (s[1] = [
211
+ h("%", -1)
212
+ ])]),
213
+ _: 1
214
+ }, 8, ["modelValue"]);
215
+ };
216
+ }
217
+ }), ve = /* @__PURE__ */ _({
218
+ __name: "TPlusInput",
219
+ props: {
220
+ data: {},
221
+ onChange: { type: Function }
222
+ },
223
+ setup(a) {
224
+ const y = a, e = U(y.data.toString());
225
+ return te(e, (m) => {
226
+ y.onChange(parseInt(m));
227
+ }), (m, s) => {
228
+ const t = i("FmTextField");
229
+ return v(), F(t, {
230
+ inputmode: "numeric",
231
+ modelValue: e.value,
232
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
233
+ }, null, 8, ["modelValue"]);
234
+ };
235
+ }
236
+ }), fe = { class: "flex gap-16 mt-6" }, ge = { class: "flex-1" }, be = { class: "flex-1" }, Fe = { class: "my-6 w-full flex justify-end" }, xe = { class: "w-[320px]" }, we = /* @__PURE__ */ _({
237
+ __name: "PaymentStatus",
238
+ props: {
239
+ onUpdate: {
240
+ type: Function,
241
+ required: !0
242
+ },
243
+ payoutAccount: {
244
+ type: Object,
245
+ required: !0
246
+ }
247
+ },
248
+ setup(a) {
249
+ const y = a, e = U(!1), m = z(), s = async (n) => {
250
+ try {
251
+ e.value = !0, await y.onUpdate(n), m.open({
252
+ type: "success",
253
+ title: "Payout account update succesfully"
254
+ });
255
+ } catch (o) {
256
+ m.open({
257
+ type: "error",
258
+ title: "Error occurs when updating payout account",
259
+ message: E(o)
260
+ });
261
+ } finally {
262
+ e.value = !1;
263
+ }
264
+ }, { search: t } = j({
265
+ search: ""
266
+ }), r = K(() => {
267
+ const { ssm: n, bank: o, bankStatement: g } = y.payoutAccount.store;
268
+ return n && o && o.name && o.accountNumber && o.holderName && g;
269
+ }), p = U(""), c = [
270
+ {
271
+ header: () => "Payment Method",
272
+ accessorKey: "issuer",
273
+ cell: (n) => `${n.row.original.issuer} (${n.row.original.variant})`
274
+ },
275
+ {
276
+ header: () => "Rate",
277
+ accessorKey: "rate",
278
+ cell: ({ row: n }) => {
279
+ let o = 0;
280
+ return n.original.rate && (o = n.original.rate.amount / Math.pow(10, n.original.rate.precision)), B(ye, {
281
+ data: o,
282
+ onChange: (g) => {
283
+ const f = y.payoutAccount.methods.at(n.index);
284
+ f.rate || (f.rate = {
285
+ amount: 0,
286
+ precision: 4
287
+ }), f.rate.amount = g * Math.pow(10, f.rate.precision);
288
+ }
289
+ });
290
+ }
291
+ },
292
+ {
293
+ header: () => "T plus",
294
+ accessorKey: "tPlus",
295
+ cell: ({ row: n }) => B(ve, {
296
+ data: n.original.tPlus ?? 0,
297
+ onChange: (o) => {
298
+ const g = y.payoutAccount.methods.at(n.index);
299
+ g.tPlus = o;
300
+ }
301
+ })
302
+ }
303
+ ];
304
+ return (n, o) => {
305
+ const g = i("FmRadio"), f = i("FmRadioGroup"), b = i("FmSwitch"), C = i("FmSearch"), k = i("FmTable"), I = i("FmButton");
306
+ return v(), P($, null, [
307
+ d("div", fe, [
308
+ d("div", ge, [
309
+ l(f, {
310
+ modelValue: a.payoutAccount.status,
311
+ "onUpdate:modelValue": o[0] || (o[0] = (A) => a.payoutAccount.status = A),
312
+ label: "Account Status"
313
+ }, {
314
+ default: V(() => [
315
+ l(g, {
316
+ value: "NEW",
317
+ label: "New"
318
+ }),
319
+ l(g, {
320
+ value: "PENDING",
321
+ label: "Pending"
322
+ }),
323
+ l(g, {
324
+ value: "APPROVED",
325
+ label: "Approved"
326
+ })
327
+ ]),
328
+ _: 1
329
+ }, 8, ["modelValue"])
330
+ ]),
331
+ d("div", be, [
332
+ l(b, {
333
+ modelValue: a.payoutAccount.enable,
334
+ "onUpdate:modelValue": o[1] || (o[1] = (A) => a.payoutAccount.enable = A),
335
+ disabled: !r.value,
336
+ label: "Enabled",
337
+ sublabel: "Merchant can use online features such as e-payment, settlement"
338
+ }, null, 8, ["modelValue", "disabled"])
339
+ ])
340
+ ]),
341
+ a.payoutAccount.enable ? (v(), P($, { key: 0 }, [
342
+ d("div", Fe, [
343
+ d("div", xe, [
344
+ l(C, {
345
+ modelValue: u(t),
346
+ "onUpdate:modelValue": o[2] || (o[2] = (A) => q(t) ? t.value = A : null),
347
+ placeholder: "Search Method ..."
348
+ }, null, 8, ["modelValue"])
349
+ ])
350
+ ]),
351
+ l(k, {
352
+ class: "mt-6",
353
+ modelValue: p.value,
354
+ "onUpdate:modelValue": o[3] || (o[3] = (A) => p.value = A),
355
+ "shrink-at": !1,
356
+ "search-value": u(t),
357
+ "row-data": a.payoutAccount.methods,
358
+ "column-defs": c
359
+ }, null, 8, ["modelValue", "search-value", "row-data"])
360
+ ], 64)) : T("", !0),
361
+ l(I, {
362
+ class: "w-full mt-6",
363
+ variant: "primary",
364
+ label: "Save",
365
+ loading: e.value,
366
+ onclick: () => s(a.payoutAccount)
367
+ }, null, 8, ["loading", "onclick"])
368
+ ], 64);
369
+ };
370
+ }
371
+ }), Ve = { class: "flex" }, ke = /* @__PURE__ */ _({
372
+ __name: "Actions",
373
+ emits: ["edit", "delete"],
374
+ setup(a, { emit: y }) {
375
+ const e = y;
376
+ return (m, s) => {
377
+ const t = i("FmButton");
378
+ return v(), P("div", Ve, [
379
+ l(t, {
380
+ variant: "plain",
381
+ "prepend-icon": "delete",
382
+ onClick: s[0] || (s[0] = (r) => {
383
+ r.stopPropagation(), e("delete");
384
+ })
385
+ })
386
+ ]);
387
+ };
388
+ }
389
+ }), Ae = { class: "flex justify-end px-6 pb-6" }, Ce = /* @__PURE__ */ _({
390
+ __name: "PaymentChannel",
391
+ props: {
392
+ payoutAccount: {
393
+ type: Object,
394
+ required: !0
395
+ }
396
+ },
397
+ setup(a) {
398
+ const y = z(), e = a, { isLoading: m, startAsyncCall: s } = Y(), t = U([]);
399
+ function r() {
400
+ s(async () => {
401
+ t.value = await M.getChannels(e.payoutAccount._id);
402
+ });
403
+ }
404
+ ae(r);
405
+ function p() {
406
+ s(async () => {
407
+ try {
408
+ await M.updateChannels(e.payoutAccount._id, t.value), y.open({
409
+ type: "success",
410
+ title: "Payout account channels update succesfully"
411
+ });
412
+ } catch (o) {
413
+ y.open({
414
+ type: "error",
415
+ title: "Error occurs when updating payout account channels",
416
+ message: E(o)
417
+ });
418
+ }
419
+ });
420
+ }
421
+ function c() {
422
+ s(async () => {
423
+ try {
424
+ await M.resetChannels(e.payoutAccount._id), t.value = await M.getChannels(e.payoutAccount._id), y.open({
425
+ type: "success",
426
+ title: "Payout account channels reset succesfully"
427
+ });
428
+ } catch (o) {
429
+ y.open({
430
+ type: "error",
431
+ title: "Error occurs when reset payout account channels",
432
+ message: E(o)
433
+ });
434
+ }
435
+ });
436
+ }
437
+ const n = [
438
+ {
439
+ header: () => "Gateway",
440
+ accessorKey: "gateway"
441
+ },
442
+ {
443
+ header: () => "Payment Type",
444
+ accessorKey: "type"
445
+ },
446
+ {
447
+ header: () => "Display",
448
+ accessorKey: "icon",
449
+ cell: ({ row: o }) => B("img", { src: o.original.icon, width: 32, height: 32 })
450
+ },
451
+ {
452
+ header: () => "Label",
453
+ accessorKey: "label",
454
+ cell: ({ row: o }) => B(re.FmTextField, {
455
+ modelValue: o.original.label,
456
+ "onUpdate:modelValue": (g) => o.original.label = g
457
+ })
458
+ },
459
+ {
460
+ id: "actions",
461
+ header: () => "Actions",
462
+ cell: ({ row: o }) => B(ke, {
463
+ onDelete: () => t.value.splice(o.index, 1)
464
+ })
465
+ }
466
+ ];
467
+ return (o, g) => {
468
+ const f = i("FmButton"), b = i("FmTable");
469
+ return v(), P($, null, [
470
+ d("div", Ae, [
471
+ l(f, {
472
+ class: "mx-4",
473
+ variant: "destructive",
474
+ size: "md",
475
+ icon: "history",
476
+ label: "Reset",
477
+ onClick: c
478
+ }),
479
+ l(f, {
480
+ variant: "primary",
481
+ size: "md",
482
+ icon: "save",
483
+ label: "Save",
484
+ onClick: p
485
+ })
486
+ ]),
487
+ l(b, {
488
+ loading: u(m),
489
+ "row-data": t.value,
490
+ "column-defs": n,
491
+ "shrink-at": !1
492
+ }, null, 8, ["loading", "row-data"])
493
+ ], 64);
494
+ };
495
+ }
496
+ }), _e = { class: "flex mt-6 space-x-6" }, Ue = /* @__PURE__ */ _({
497
+ __name: "FiuuGateway",
498
+ props: {
499
+ gateway: {
500
+ type: Object,
501
+ required: !0
502
+ },
503
+ onUpdate: {
504
+ type: Function,
505
+ required: !0
506
+ },
507
+ onDelete: {
508
+ type: Function,
509
+ required: !0
510
+ }
511
+ },
512
+ setup(a) {
513
+ var m;
514
+ const e = U(((m = a.gateway) == null ? void 0 : m.config) || {
515
+ merchantId: "",
516
+ verifyKey: "",
517
+ secretKey: ""
518
+ });
519
+ return (s, t) => {
520
+ const r = i("FmTextField"), p = i("FmButton"), c = i("FmForm");
521
+ return v(), F(c, {
522
+ ref: "form",
523
+ class: "flex flex-col gap-16",
524
+ onValidationSuccess: t[3] || (t[3] = () => a.onUpdate(e.value))
525
+ }, {
526
+ default: V(() => [
527
+ l(r, {
528
+ modelValue: e.value.merchantId,
529
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.merchantId = n),
530
+ label: "Merchant ID",
531
+ rules: u(x)(u(w).string())
532
+ }, null, 8, ["modelValue", "rules"]),
533
+ l(r, {
534
+ modelValue: e.value.verifyKey,
535
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.verifyKey = n),
536
+ label: "Verify Key",
537
+ rules: u(x)(u(w).string())
538
+ }, null, 8, ["modelValue", "rules"]),
539
+ l(r, {
540
+ modelValue: e.value.secretKey,
541
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => e.value.secretKey = n),
542
+ label: "Secret Key",
543
+ rules: u(x)(u(w).string())
544
+ }, null, 8, ["modelValue", "rules"]),
545
+ d("div", _e, [
546
+ a.gateway ? (v(), F(p, {
547
+ key: 0,
548
+ class: "flex-1",
549
+ variant: "secondary",
550
+ label: "Delete",
551
+ onclick: () => a.onDelete()
552
+ }, null, 8, ["onclick"])) : T("", !0),
553
+ l(p, {
554
+ type: "submit",
555
+ class: "flex-1",
556
+ variant: "primary",
557
+ label: "Save"
558
+ })
559
+ ])
560
+ ]),
561
+ _: 1
562
+ }, 512);
563
+ };
564
+ }
565
+ }), Te = { class: "flex mt-6 space-x-6" }, Ie = /* @__PURE__ */ _({
566
+ __name: "MacauPassGateway",
567
+ props: {
568
+ gateway: {
569
+ type: Object,
570
+ required: !0
571
+ },
572
+ onUpdate: {
573
+ type: Function,
574
+ required: !0
575
+ },
576
+ onDelete: {
577
+ type: Function,
578
+ required: !0
579
+ }
580
+ },
581
+ setup(a) {
582
+ var m;
583
+ const e = U(((m = a.gateway) == null ? void 0 : m.config) || {
584
+ merchantId: "",
585
+ merchantName: "",
586
+ merchantCategoryCode: "",
587
+ storeID: "",
588
+ storeName: ""
589
+ });
590
+ return (s, t) => {
591
+ const r = i("FmTextField"), p = i("FmButton"), c = i("FmForm");
592
+ return v(), F(c, {
593
+ ref: "form",
594
+ class: "flex flex-col gap-16",
595
+ onValidationSuccess: t[5] || (t[5] = () => a.onUpdate(e.value))
596
+ }, {
597
+ default: V(() => [
598
+ l(r, {
599
+ modelValue: e.value.merchantId,
600
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.merchantId = n),
601
+ label: "Merchant ID",
602
+ rules: u(x)(u(w).string())
603
+ }, null, 8, ["modelValue", "rules"]),
604
+ l(r, {
605
+ modelValue: e.value.merchantName,
606
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.merchantName = n),
607
+ label: "Merchant Name",
608
+ rules: u(x)(u(w).string())
609
+ }, null, 8, ["modelValue", "rules"]),
610
+ l(r, {
611
+ modelValue: e.value.merchantCategoryCode,
612
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => e.value.merchantCategoryCode = n),
613
+ label: "Merchant MCC",
614
+ rules: u(x)(u(w).string())
615
+ }, null, 8, ["modelValue", "rules"]),
616
+ l(r, {
617
+ modelValue: e.value.storeID,
618
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => e.value.storeID = n),
619
+ label: "Store ID",
620
+ rules: u(x)(u(w).string())
621
+ }, null, 8, ["modelValue", "rules"]),
622
+ l(r, {
623
+ modelValue: e.value.storeName,
624
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => e.value.storeName = n),
625
+ label: "Store Name",
626
+ rules: u(x)(u(w).string())
627
+ }, null, 8, ["modelValue", "rules"]),
628
+ d("div", Te, [
629
+ a.gateway ? (v(), F(p, {
630
+ key: 0,
631
+ class: "flex-1",
632
+ variant: "secondary",
633
+ label: "Delete",
634
+ onclick: () => a.onDelete()
635
+ }, null, 8, ["onclick"])) : T("", !0),
636
+ l(p, {
637
+ type: "submit",
638
+ class: "flex-1",
639
+ variant: "primary",
640
+ label: "Save"
641
+ })
642
+ ])
643
+ ]),
644
+ _: 1
645
+ }, 512);
646
+ };
647
+ }
648
+ }), Se = { class: "flex mt-6 space-x-6" }, he = /* @__PURE__ */ _({
649
+ __name: "DigioGateway",
650
+ props: {
651
+ gateway: {
652
+ type: Object,
653
+ required: !0
654
+ },
655
+ onUpdate: {
656
+ type: Function,
657
+ required: !0
658
+ },
659
+ onDelete: {
660
+ type: Function,
661
+ required: !0
662
+ }
663
+ },
664
+ setup(a) {
665
+ var m;
666
+ const e = U(((m = a.gateway) == null ? void 0 : m.config) || {
667
+ merchantId: "",
668
+ cardMerchantId: ""
669
+ });
670
+ return (s, t) => {
671
+ const r = i("FmTextField"), p = i("FmButton"), c = i("FmForm");
672
+ return v(), F(c, {
673
+ ref: "form",
674
+ class: "flex flex-col gap-16",
675
+ onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
676
+ }, {
677
+ default: V(() => [
678
+ l(r, {
679
+ modelValue: e.value.merchantId,
680
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.merchantId = n),
681
+ label: "Merchant ID",
682
+ rules: u(x)(u(w).string())
683
+ }, null, 8, ["modelValue", "rules"]),
684
+ l(r, {
685
+ modelValue: e.value.cardMerchantId,
686
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.cardMerchantId = n),
687
+ label: "Card Merchant ID",
688
+ rules: u(x)(u(w).string())
689
+ }, null, 8, ["modelValue", "rules"]),
690
+ d("div", Se, [
691
+ a.gateway ? (v(), F(p, {
692
+ key: 0,
693
+ class: "flex-1",
694
+ variant: "secondary",
695
+ label: "Delete",
696
+ onclick: () => a.onDelete()
697
+ }, null, 8, ["onclick"])) : T("", !0),
698
+ l(p, {
699
+ type: "submit",
700
+ class: "flex-1",
701
+ variant: "primary",
702
+ label: "Save"
703
+ })
704
+ ])
705
+ ]),
706
+ _: 1
707
+ }, 512);
708
+ };
709
+ }
710
+ }), Pe = { class: "flex mt-6 space-x-6" }, De = /* @__PURE__ */ _({
711
+ __name: "AdyenGateway",
712
+ props: {
713
+ gateway: {
714
+ type: Object,
715
+ required: !0
716
+ },
717
+ onUpdate: {
718
+ type: Function,
719
+ required: !0
720
+ },
721
+ onDelete: {
722
+ type: Function,
723
+ required: !0
724
+ }
725
+ },
726
+ setup(a) {
727
+ var m;
728
+ const e = U(((m = a.gateway) == null ? void 0 : m.config) || {
729
+ merchantAccount: "",
730
+ username: "",
731
+ apiKey: "",
732
+ clientKey: "",
733
+ endpoint: "",
734
+ hmacKey: ""
735
+ });
736
+ return (s, t) => {
737
+ const r = i("FmTextField"), p = i("FmButton"), c = i("FmForm");
738
+ return v(), F(c, {
739
+ ref: "form",
740
+ class: "flex flex-col gap-16",
741
+ onValidationSuccess: t[6] || (t[6] = () => a.onUpdate(e.value))
742
+ }, {
743
+ default: V(() => [
744
+ l(r, {
745
+ modelValue: e.value.endpoint,
746
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.endpoint = n),
747
+ label: "Endpoint",
748
+ rules: u(x)(u(w).string())
749
+ }, null, 8, ["modelValue", "rules"]),
750
+ l(r, {
751
+ modelValue: e.value.merchantAccount,
752
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.merchantAccount = n),
753
+ label: "Merchant Account",
754
+ rules: u(x)(u(w).string())
755
+ }, null, 8, ["modelValue", "rules"]),
756
+ l(r, {
757
+ modelValue: e.value.username,
758
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => e.value.username = n),
759
+ label: "Username",
760
+ rules: u(x)(u(w).string())
761
+ }, null, 8, ["modelValue", "rules"]),
762
+ l(r, {
763
+ modelValue: e.value.apiKey,
764
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => e.value.apiKey = n),
765
+ label: "API Key",
766
+ rules: u(x)(u(w).string())
767
+ }, null, 8, ["modelValue", "rules"]),
768
+ l(r, {
769
+ modelValue: e.value.clientKey,
770
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => e.value.clientKey = n),
771
+ label: "Client Key",
772
+ rules: u(x)(u(w).string())
773
+ }, null, 8, ["modelValue", "rules"]),
774
+ l(r, {
775
+ modelValue: e.value.hmacKey,
776
+ "onUpdate:modelValue": t[5] || (t[5] = (n) => e.value.hmacKey = n),
777
+ label: "HMac Key"
778
+ }, null, 8, ["modelValue"]),
779
+ d("div", Pe, [
780
+ a.gateway ? (v(), F(p, {
781
+ key: 0,
782
+ class: "flex-1",
783
+ variant: "secondary",
784
+ label: "Delete",
785
+ onclick: () => a.onDelete()
786
+ }, null, 8, ["onclick"])) : T("", !0),
787
+ l(p, {
788
+ type: "submit",
789
+ class: "flex-1",
790
+ variant: "primary",
791
+ label: "Save"
792
+ })
793
+ ])
794
+ ]),
795
+ _: 1
796
+ }, 512);
797
+ };
798
+ }
799
+ }), Ne = { class: "flex mt-6 space-x-6" }, Re = /* @__PURE__ */ _({
800
+ __name: "KsherGateway",
801
+ props: {
802
+ gateway: {
803
+ type: Object,
804
+ required: !0
805
+ },
806
+ onUpdate: {
807
+ type: Function,
808
+ required: !0
809
+ },
810
+ onDelete: {
811
+ type: Function,
812
+ required: !0
813
+ }
814
+ },
815
+ setup(a) {
816
+ var m;
817
+ const e = U(((m = a.gateway) == null ? void 0 : m.config) || {
818
+ appId: "",
819
+ privateKey: ""
820
+ });
821
+ return (s, t) => {
822
+ const r = i("FmTextField"), p = i("FmTextarea"), c = i("FmButton"), n = i("FmForm");
823
+ return v(), F(n, {
824
+ ref: "form",
825
+ class: "flex flex-col gap-16",
826
+ onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
827
+ }, {
828
+ default: V(() => [
829
+ l(r, {
830
+ modelValue: e.value.appId,
831
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => e.value.appId = o),
832
+ label: "App ID",
833
+ rules: u(x)(u(w).string())
834
+ }, null, 8, ["modelValue", "rules"]),
835
+ l(p, {
836
+ modelValue: e.value.privateKey,
837
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => e.value.privateKey = o),
838
+ label: "Private Key",
839
+ placeholder: "Paste your private key including BEGIN and END markers",
840
+ rules: u(x)(u(w).string())
841
+ }, null, 8, ["modelValue", "rules"]),
842
+ d("div", Ne, [
843
+ a.gateway ? (v(), F(c, {
844
+ key: 0,
845
+ class: "flex-1",
846
+ variant: "secondary",
847
+ label: "Delete",
848
+ onclick: () => a.onDelete()
849
+ }, null, 8, ["onclick"])) : T("", !0),
850
+ l(c, {
851
+ type: "submit",
852
+ class: "flex-1",
853
+ variant: "primary",
854
+ label: "Save"
855
+ })
856
+ ])
857
+ ]),
858
+ _: 1
859
+ }, 512);
860
+ };
861
+ }
862
+ }), Me = {
863
+ key: 0,
864
+ className: "mt-1 my-6 text-gray-600"
865
+ }, Ge = {
866
+ key: 1,
867
+ class: "flex items-center justify-center min-h-[80vh]"
868
+ }, $e = /* @__PURE__ */ _({
869
+ __name: "PaymentGateway",
870
+ props: {
871
+ payoutAccount: {
872
+ type: Object,
873
+ required: !0
874
+ }
875
+ },
876
+ setup(a) {
877
+ const y = ne().currentCountry, e = y.value, m = z(), { isLoading: s, startAsyncCall: t } = Y(), { gatewayTab: r } = j({
878
+ gatewayTab: ""
879
+ }), p = a, c = [
880
+ {
881
+ label: "Fiuu",
882
+ value: "RAZER_MERCHANT_SERVICE",
883
+ render: Ue,
884
+ region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
885
+ },
886
+ {
887
+ label: "Macau Pass",
888
+ value: "MACAU_PASS",
889
+ render: Ie,
890
+ region: [S.F_COUNTRY.enum.MO]
891
+ },
892
+ {
893
+ label: "Digio",
894
+ value: "DIGIO",
895
+ render: he,
896
+ region: [S.F_COUNTRY.enum.TH]
897
+ },
898
+ {
899
+ label: "Ksher",
900
+ value: "KSHER",
901
+ render: Re,
902
+ region: [S.F_COUNTRY.enum.TH]
903
+ },
904
+ {
905
+ label: "Adyen",
906
+ value: "ADYEN",
907
+ render: De,
908
+ region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
909
+ }
910
+ ], n = U(
911
+ p.payoutAccount.gateways ?? []
912
+ ), o = K(() => c.find((k) => k.value === r.value)), g = K(() => c.filter(
913
+ (k) => k.region.includes(y.value ?? S.F_COUNTRY.enum.MY)
914
+ ));
915
+ async function f(k) {
916
+ await t(async () => {
917
+ try {
918
+ await M.updateGateway(p.payoutAccount._id, k), m.open({
919
+ type: "success",
920
+ title: "Payout account gateways update succesfully"
921
+ }), b.value = k.length === 0;
922
+ } catch (I) {
923
+ m.open({
924
+ type: "error",
925
+ title: "Error occurs when updating payout account gateways",
926
+ message: E(I)
927
+ });
928
+ }
929
+ });
930
+ }
931
+ const b = U((p.payoutAccount.gateways ?? []).length === 0), C = K(() => e !== "MY" || !b.value);
932
+ return (k, I) => {
933
+ var O;
934
+ const A = i("FmCircularProgress"), D = i("FmSwitch"), H = i("FmTabs");
935
+ return v(), P($, null, [
936
+ u(e) ? (v(), P("p", Me, [...I[2] || (I[2] = [
937
+ d("b", null, "Note: ", -1),
938
+ h(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ", -1)
939
+ ])])) : T("", !0),
940
+ u(s) ? (v(), P("div", Ge, [
941
+ l(A, { size: "xxl" })
942
+ ])) : (v(), P($, { key: 2 }, [
943
+ u(e) === "MY" ? (v(), F(D, {
944
+ key: 0,
945
+ modelValue: b.value,
946
+ "onUpdate:modelValue": I[0] || (I[0] = (N) => b.value = N),
947
+ style: { "padding-bottom": "12px" },
948
+ label: "Use FeedMe's Fiuu Account?"
949
+ }, null, 8, ["modelValue"])) : T("", !0),
950
+ C.value ? (v(), F(H, {
951
+ key: 1,
952
+ "model-value": u(r),
953
+ "onUpdate:modelValue": I[1] || (I[1] = (N) => q(r) ? r.value = N : null),
954
+ class: "mb-6",
955
+ items: g.value
956
+ }, null, 8, ["model-value", "items"])) : T("", !0),
957
+ C.value && u(r) ? (v(), F(Z((O = o.value) == null ? void 0 : O.render), Q(W({ key: 2 }, {
958
+ gateway: n.value.find(
959
+ (N) => {
960
+ var G;
961
+ return N.paymentGateway === ((G = o.value) == null ? void 0 : G.value);
962
+ }
963
+ ),
964
+ onDelete: async () => {
965
+ n.value = n.value.filter(
966
+ (N) => {
967
+ var G;
968
+ return N.paymentGateway !== ((G = o.value) == null ? void 0 : G.value);
969
+ }
970
+ ), f(n.value);
971
+ },
972
+ onUpdate: (N) => {
973
+ var J;
974
+ let G = n.value.find(
975
+ (le) => {
976
+ var X;
977
+ return le.paymentGateway === ((X = o.value) == null ? void 0 : X.value);
978
+ }
979
+ );
980
+ G ? G.config = N : n.value.push({
981
+ paymentGateway: (J = o.value) == null ? void 0 : J.value,
982
+ config: N
983
+ }), f(n.value);
984
+ }
985
+ })), null, 16)) : T("", !0)
986
+ ], 64))
987
+ ], 64);
988
+ };
989
+ }
990
+ }), Ke = { class: "flex mt-6 space-x-6" }, Oe = /* @__PURE__ */ _({
991
+ __name: "GooglePayToken",
992
+ props: {
993
+ gateway: {
994
+ type: Object,
995
+ required: !0
996
+ },
997
+ onUpdate: {
998
+ type: Function,
999
+ required: !0
1000
+ },
1001
+ onDelete: {
1002
+ type: Function,
1003
+ required: !0
1004
+ }
1005
+ },
1006
+ setup(a) {
1007
+ const e = U(
1008
+ a.gateway || {
1009
+ type: "googlePay",
1010
+ gateway: "RAZER_MERCHANT_SERVICE",
1011
+ config: {
1012
+ gateway: "molpay",
1013
+ gatewayMerchantId: "molpay"
1014
+ }
1015
+ }
1016
+ );
1017
+ return (m, s) => {
1018
+ const t = i("FmTextField"), r = i("FmButton"), p = i("FmForm");
1019
+ return v(), F(p, {
1020
+ ref: "form",
1021
+ class: "flex flex-col gap-16",
1022
+ onValidationSuccess: s[3] || (s[3] = () => a.onUpdate(e.value))
1023
+ }, {
1024
+ default: V(() => [
1025
+ l(t, {
1026
+ modelValue: e.value.gateway,
1027
+ "onUpdate:modelValue": s[0] || (s[0] = (c) => e.value.gateway = c),
1028
+ label: "Gateway",
1029
+ disabled: !0,
1030
+ rules: u(x)(u(w).string())
1031
+ }, null, 8, ["modelValue", "rules"]),
1032
+ l(t, {
1033
+ modelValue: e.value.config.gateway,
1034
+ "onUpdate:modelValue": s[1] || (s[1] = (c) => e.value.config.gateway = c),
1035
+ label: "Gateway ID",
1036
+ disabled: !0,
1037
+ rules: u(x)(u(w).string())
1038
+ }, null, 8, ["modelValue", "rules"]),
1039
+ l(t, {
1040
+ modelValue: e.value.config.gatewayMerchantId,
1041
+ "onUpdate:modelValue": s[2] || (s[2] = (c) => e.value.config.gatewayMerchantId = c),
1042
+ label: "Gateway Merchant ID",
1043
+ disabled: !0,
1044
+ rules: u(x)(u(w).string())
1045
+ }, null, 8, ["modelValue", "rules"]),
1046
+ d("div", Ke, [
1047
+ a.gateway ? (v(), F(r, {
1048
+ key: 0,
1049
+ class: "flex-1",
1050
+ variant: "secondary",
1051
+ label: "Delete",
1052
+ onclick: () => a.onDelete()
1053
+ }, null, 8, ["onclick"])) : T("", !0),
1054
+ l(r, {
1055
+ type: "submit",
1056
+ class: "flex-1",
1057
+ variant: "primary",
1058
+ label: "Save"
1059
+ })
1060
+ ])
1061
+ ]),
1062
+ _: 1
1063
+ }, 512);
1064
+ };
1065
+ }
1066
+ }), Be = { class: "flex mt-6 space-x-6" }, Ee = /* @__PURE__ */ _({
1067
+ __name: "ApplePayToken",
1068
+ props: {
1069
+ gateway: {
1070
+ type: Object,
1071
+ required: !0
1072
+ },
1073
+ onUpdate: {
1074
+ type: Function,
1075
+ required: !0
1076
+ },
1077
+ onDelete: {
1078
+ type: Function,
1079
+ required: !0
1080
+ }
1081
+ },
1082
+ setup(a) {
1083
+ const e = U(
1084
+ a.gateway || {
1085
+ type: "applePay",
1086
+ gateway: "RAZER_MERCHANT_SERVICE",
1087
+ config: {
1088
+ merchantId: "FMfeedme"
1089
+ }
1090
+ }
1091
+ );
1092
+ return (m, s) => {
1093
+ const t = i("FmTextField"), r = i("FmButton"), p = i("FmForm");
1094
+ return v(), F(p, {
1095
+ ref: "form",
1096
+ class: "flex flex-col gap-16",
1097
+ onValidationSuccess: s[2] || (s[2] = () => a.onUpdate(e.value))
1098
+ }, {
1099
+ default: V(() => [
1100
+ l(t, {
1101
+ modelValue: e.value.gateway,
1102
+ "onUpdate:modelValue": s[0] || (s[0] = (c) => e.value.gateway = c),
1103
+ label: "Gateway",
1104
+ disabled: !0,
1105
+ rules: u(x)(u(w).string())
1106
+ }, null, 8, ["modelValue", "rules"]),
1107
+ l(t, {
1108
+ modelValue: e.value.config.merchantId,
1109
+ "onUpdate:modelValue": s[1] || (s[1] = (c) => e.value.config.merchantId = c),
1110
+ label: "Merchant ID",
1111
+ disabled: !0,
1112
+ rules: u(x)(u(w).string())
1113
+ }, null, 8, ["modelValue", "rules"]),
1114
+ d("div", Be, [
1115
+ a.gateway ? (v(), F(r, {
1116
+ key: 0,
1117
+ class: "flex-1",
1118
+ variant: "secondary",
1119
+ label: "Delete",
1120
+ onclick: () => a.onDelete()
1121
+ }, null, 8, ["onclick"])) : T("", !0),
1122
+ l(r, {
1123
+ type: "submit",
1124
+ class: "flex-1",
1125
+ variant: "primary",
1126
+ label: "Save"
1127
+ })
1128
+ ])
1129
+ ]),
1130
+ _: 1
1131
+ }, 512);
1132
+ };
1133
+ }
1134
+ }), qe = {
1135
+ key: 0,
1136
+ class: "flex items-center justify-center min-h-[80vh]"
1137
+ }, Ye = /* @__PURE__ */ _({
1138
+ __name: "TokenGateway",
1139
+ props: {
1140
+ payoutAccount: {
1141
+ type: Object,
1142
+ required: !0
1143
+ }
1144
+ },
1145
+ setup(a) {
1146
+ const y = ne().currentCountry, e = z(), { isLoading: m, startAsyncCall: s } = Y(), { tokenTab: t } = j({
1147
+ tokenTab: ""
1148
+ }), r = a, p = [
1149
+ {
1150
+ label: "Google Pay",
1151
+ value: "googlePay",
1152
+ icon: "android",
1153
+ render: Oe,
1154
+ region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1155
+ },
1156
+ {
1157
+ label: "Apple Pay",
1158
+ value: "applePay",
1159
+ icon: "iOS",
1160
+ render: Ee,
1161
+ region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1162
+ }
1163
+ ], c = U(r.payoutAccount.tokens ?? []), n = K(() => p.find((f) => f.value === t.value)), o = K(() => p.filter(
1164
+ (f) => f.region.includes(y.value ?? S.F_COUNTRY.enum.MY)
1165
+ ));
1166
+ async function g(f) {
1167
+ await s(async () => {
1168
+ try {
1169
+ await M.updateTokens(r.payoutAccount._id, f), e.open({
1170
+ type: "success",
1171
+ title: "Payout account tokens gateway update succesfully"
1172
+ });
1173
+ } catch (b) {
1174
+ e.open({
1175
+ type: "error",
1176
+ title: "Error occurs when updating payout account tokens",
1177
+ message: E(b)
1178
+ });
1179
+ }
1180
+ });
1181
+ }
1182
+ return (f, b) => {
1183
+ var I;
1184
+ const C = i("FmCircularProgress"), k = i("FmTabs");
1185
+ return v(), P($, null, [
1186
+ b[1] || (b[1] = d("p", { className: "mt-1 my-6 text-gray-600" }, [
1187
+ d("b", null, "Note: "),
1188
+ h(" Token gateways appear above other online payment channels to comply with provider branding requirements. Configuration is standardized, so you generally only need to select the provider. "),
1189
+ d("br"),
1190
+ d("br"),
1191
+ d("b", null, ` Token payments are automatically enabled for "Pay-First" merchants. You do not need to adjust settings here unless you're modifying for a non-Pay-First merchant who wishes to manually enable this feature. `),
1192
+ d("br")
1193
+ ], -1)),
1194
+ u(m) ? (v(), P("div", qe, [
1195
+ l(C, { size: "xxl" })
1196
+ ])) : (v(), F(k, {
1197
+ key: 1,
1198
+ "model-value": u(t),
1199
+ "onUpdate:modelValue": b[0] || (b[0] = (A) => q(t) ? t.value = A : null),
1200
+ class: "mb-6 mt-6",
1201
+ items: o.value
1202
+ }, null, 8, ["model-value", "items"])),
1203
+ u(t) ? (v(), F(Z((I = n.value) == null ? void 0 : I.render), Q(W({ key: 2 }, {
1204
+ gateway: c.value.find((A) => {
1205
+ var D;
1206
+ return A.type === ((D = n.value) == null ? void 0 : D.value);
1207
+ }),
1208
+ onDelete: async () => {
1209
+ c.value = c.value.filter((A) => {
1210
+ var D;
1211
+ return A.type !== ((D = n.value) == null ? void 0 : D.value);
1212
+ }), g(c.value);
1213
+ },
1214
+ onUpdate: (A) => {
1215
+ let D = c.value.find((H) => {
1216
+ var O;
1217
+ return H.type === ((O = n.value) == null ? void 0 : O.value);
1218
+ });
1219
+ D ? D.config = A : c.value.push(A), g(c.value);
1220
+ }
1221
+ })), null, 16)) : T("", !0)
1222
+ ], 64);
1223
+ };
1224
+ }
1225
+ }), nt = /* @__PURE__ */ _({
1226
+ __name: "PayoutAccountSetting",
1227
+ props: {
1228
+ accountId: {
1229
+ type: String,
1230
+ required: !0
1231
+ }
1232
+ },
1233
+ setup(a) {
1234
+ const y = a, { tab: e } = j({
1235
+ tab: "information"
1236
+ }), { isLoading: m, startAsyncCall: s } = Y(!0), t = ue(), r = U();
1237
+ async function p(g) {
1238
+ await M.updateById(
1239
+ y.accountId,
1240
+ g
1241
+ ), r.value = await M.readById(y.accountId);
1242
+ }
1243
+ const c = [
1244
+ {
1245
+ label: "Information",
1246
+ value: "information",
1247
+ icon: "overview",
1248
+ render: ce
1249
+ },
1250
+ {
1251
+ label: "Settlement",
1252
+ value: "settlement",
1253
+ icon: "payments",
1254
+ render: pe
1255
+ },
1256
+ {
1257
+ label: "MDR Status",
1258
+ value: "payment",
1259
+ icon: "account_box",
1260
+ render: we
1261
+ },
1262
+ {
1263
+ label: "Online Gateways",
1264
+ icon: "assured_workload",
1265
+ value: "gateways",
1266
+ render: $e
1267
+ },
1268
+ {
1269
+ label: "Token Gateways",
1270
+ value: "tokens",
1271
+ icon: "wallet",
1272
+ render: Ye
1273
+ },
1274
+ {
1275
+ label: "Online Channels",
1276
+ icon: "shopping_cart",
1277
+ value: "channels",
1278
+ render: Ce
1279
+ }
1280
+ ];
1281
+ function n() {
1282
+ s(async () => {
1283
+ r.value = await M.readById(y.accountId);
1284
+ });
1285
+ }
1286
+ ae(n);
1287
+ const o = K(() => {
1288
+ const g = c.reduce((f, b) => f || (b.children ? b.children.find((C) => C.value === e.value) || null : b.value === e.value ? b : null), null);
1289
+ return g == null ? void 0 : g.render;
1290
+ });
1291
+ return (g, f) => {
1292
+ var C;
1293
+ const b = i("FmTabs");
1294
+ return v(), F(oe, {
1295
+ title: `Payout Account (${(C = r.value) == null ? void 0 : C._id})`,
1296
+ loading: u(m),
1297
+ onBack: u(t).back
1298
+ }, {
1299
+ default: V(() => [
1300
+ l(b, {
1301
+ "model-value": u(e),
1302
+ "onUpdate:modelValue": f[0] || (f[0] = (k) => q(e) ? e.value = k : null),
1303
+ class: "mb-6",
1304
+ items: c
1305
+ }, null, 8, ["model-value"]),
1306
+ u(e) ? (v(), F(Z(o.value), Q(W({ key: 0 }, {
1307
+ payoutAccount: r.value,
1308
+ onUpdate: p
1309
+ })), null, 16)) : T("", !0)
1310
+ ]),
1311
+ _: 1
1312
+ }, 8, ["title", "loading", "onBack"]);
1313
+ };
1314
+ }
1315
+ });
1316
+ export {
1317
+ nt as default
1318
+ };