@feedmepos/mf-payment 1.3.4 → 1.3.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 (74) hide show
  1. package/dist/{OnboardForm-DiFkSYCY.js → OnboardForm-DK0gSj3m.js} +4 -4
  2. package/dist/OnboardForm-DP-aJ_9f.js +752 -0
  3. package/dist/{OnboardSubmission-DuoQ5dv7.js → OnboardSubmission-Bh1IlZSt.js} +2 -2
  4. package/dist/{OnboardSubmission-D2RCkW7k.js → OnboardSubmission-BvdOCwbB.js} +5 -5
  5. package/dist/{PayoutAccount-Lym1Za-n.js → PayoutAccount-B8oIp4cC.js} +5 -5
  6. package/dist/{PayoutAccount-D8Pfhz4C.js → PayoutAccount-zDcex7fB.js} +5 -5
  7. package/dist/{PayoutAccountSetting-DcuumyW4.js → PayoutAccountSetting-CHRrrPyM.js} +3 -3
  8. package/dist/{Restaurant-C8lLkTRk.js → Restaurant-B4_By3gk.js} +4 -4
  9. package/dist/{RestaurantSetting-IW965gti.js → RestaurantSetting-Dub_-JlB.js} +3 -3
  10. package/dist/{Settlement-D18xsXRd.js → Settlement-CZ8pzFMH.js} +3 -3
  11. package/dist/{Settlement-BQPbR8m-.js → Settlement-Y9WvXhNL.js} +3 -3
  12. package/dist/{SettlementTransactions-BQmJ_nZS.js → SettlementTransactions-CT7yHI03.js} +3 -3
  13. package/dist/{SettlementTransactions-DhKWeuuo.js → SettlementTransactions-CYKZ3qJR.js} +3 -3
  14. package/dist/{Status.vue_vue_type_script_setup_true_lang-Cp3akQew.js → Status.vue_vue_type_script_setup_true_lang-knGxQsIT.js} +1 -1
  15. package/dist/{Terminal-tg7f8Wue.js → Terminal-DpU8bG_E.js} +5 -5
  16. package/dist/TerminalSetting-ayjTqDOf.js +1252 -0
  17. package/dist/{Transaction-DFxizbZ7.js → Transaction-BglDJkA1.js} +6 -6
  18. package/dist/{Transaction-CQF5lDAd.js → Transaction-BhaE4B7P.js} +5 -5
  19. package/dist/{TransactionOld-uFMnygUK.js → TransactionOld-lu-6Wsl0.js} +4 -4
  20. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-CFr-DduC.js → TransactionTable.vue_vue_type_script_setup_true_lang-DwsA4v2y.js} +3 -3
  21. package/dist/{app-DlajGnF4.js → app-P6E0gWOn.js} +22 -22
  22. package/dist/app.js +1 -1
  23. package/dist/{assets-R7Pf2tcC.js → assets-CXWjWs3-.js} +1 -1
  24. package/dist/{grafana-DLVFFmRO.js → grafana-DMIeh04o.js} +1 -1
  25. package/dist/{index-CTPvAooK.js → index-0rtKjj7p.js} +2 -2
  26. package/dist/{index-C4T0m6DM.js → index-BUbV9yXt.js} +1 -1
  27. package/dist/{index-C_4l0JZj.js → index-CggStwHL.js} +8926 -8820
  28. package/dist/{index-BRcPRBkm.js → index-DXzy1nT_.js} +1 -1
  29. package/dist/{index-BUXnw6w4.js → index-DYisiI7M.js} +1 -1
  30. package/dist/{index-D7GUIvIW.js → index-JNNpGY70.js} +1 -1
  31. package/dist/{index-Cpsfcvcu.js → index-LG8BpXxO.js} +1 -1
  32. package/dist/{index.vue_vue_type_script_setup_true_lang-BIGL3hMd.js → index.vue_vue_type_script_setup_true_lang-roF28cJy.js} +1 -1
  33. package/dist/package.json +3 -3
  34. package/dist/{payout-account-BN3SUWK6.js → payout-account-Bu7qNTGV.js} +3 -3
  35. package/dist/{plugins-BJJ6gEom.js → plugins-DmySvFHd.js} +1 -1
  36. package/dist/stores/payoutAccount.d.ts +24 -24
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +24 -24
  39. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +42 -42
  40. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +42 -42
  41. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +24 -24
  42. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +24 -24
  43. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +42 -42
  44. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  45. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  46. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  47. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  48. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +6 -6
  49. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  50. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  51. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +6 -6
  52. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +8 -8
  53. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +6 -6
  54. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +6 -6
  55. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +26 -26
  56. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +26 -26
  57. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +26 -26
  58. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +26 -26
  59. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +26 -26
  60. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +26 -26
  61. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +26 -26
  62. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +26 -26
  63. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +26 -26
  64. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +26 -26
  65. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +26 -26
  66. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +26 -26
  67. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +26 -26
  68. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +26 -26
  69. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +48 -48
  70. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +60 -60
  71. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +30 -30
  72. package/package.json +3 -3
  73. package/dist/OnboardForm-0gm_drkY.js +0 -708
  74. package/dist/TerminalSetting-B5VdUivg.js +0 -1080
@@ -0,0 +1,1252 @@
1
+ import { defineComponent as U, openBlock as f, createElementBlock as V, Fragment as q, createElementVNode as I, createTextVNode as D, toDisplayString as A, ref as F, resolveComponent as g, createVNode as p, createCommentVNode as C, unref as N, computed as M, isRef as B, createBlock as w, resolveDynamicComponent as Y, normalizeProps as h, mergeProps as L, toRef as R, watch as $, onMounted as O, withCtx as P, renderList as K } from "vue";
2
+ import { u as z, e as S } from "./index-CggStwHL.js";
3
+ import { useRouter as W } from "vue-router";
4
+ import { t as G } from "./index-JNNpGY70.js";
5
+ import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
+ import { u as E } from "./index-BUbV9yXt.js";
7
+ import { useSnackbar as H } from "@feedmepos/ui-library";
8
+ import { u as Z } from "./error-K1CakhA9.js";
9
+ import { useCoreStore as j } from "@feedmepos/mf-common";
10
+ import { z as ee, a as ae } from "./validator-D5jtpt9A.js";
11
+ const te = /* @__PURE__ */ U({
12
+ __name: "Information",
13
+ props: {
14
+ terminal: {
15
+ type: Object,
16
+ required: !0
17
+ }
18
+ },
19
+ setup(_) {
20
+ return (m, a) => (f(), V(q, null, [
21
+ a[0] || (a[0] = I("b", null, "Name", -1)),
22
+ D(": " + A(_.terminal.name), 1),
23
+ a[1] || (a[1] = I("br", null, null, -1)),
24
+ a[2] || (a[2] = I("b", null, "Status", -1)),
25
+ D(": " + A(_.terminal.status), 1),
26
+ a[3] || (a[3] = I("br", null, null, -1)),
27
+ a[4] || (a[4] = I("b", null, "Device ID", -1)),
28
+ D(": " + A(_.terminal.deviceId ?? "-"), 1),
29
+ a[5] || (a[5] = I("br", null, null, -1)),
30
+ a[6] || (a[6] = I("b", null, "Device Type", -1)),
31
+ D(": " + A(_.terminal.deviceType ?? "-"), 1),
32
+ a[7] || (a[7] = I("br", null, null, -1))
33
+ ], 64));
34
+ }
35
+ }), le = { key: 0 }, ne = { class: "mt-6 space-x-6" }, oe = /* @__PURE__ */ U({
36
+ __name: "KioskMode",
37
+ props: {
38
+ terminal: {
39
+ type: Object,
40
+ required: !0
41
+ }
42
+ },
43
+ setup(_) {
44
+ const { isLoading: m, startAsyncCall: a } = z(!1), b = H(), n = F({
45
+ enable: !1,
46
+ password: []
47
+ }), o = _;
48
+ function e() {
49
+ return n.value.enable && n.value.password.filter((d) => !!d).length !== 6 ? b.open({
50
+ type: "error",
51
+ message: "Unlock PIN is required when setting up kiosk mode for terminal."
52
+ }) : a(async () => {
53
+ const d = { enable: n.value.enable };
54
+ d.enable && Object.assign(d, {
55
+ password: n.value.password.join("")
56
+ });
57
+ const s = await G.kioskModeRequest(o.terminal._id, d);
58
+ if (s === "OK")
59
+ return b.open({ type: "info", message: "Kiosk mode applied successfully." });
60
+ let v = s;
61
+ return s === "client_not_connected" && (v = "Terminal not connected to the websocket server."), s.startsWith("terminal: ") && (v = s.replaceAll("terminal: ", "")), b.open({
62
+ type: "error",
63
+ message: v
64
+ });
65
+ });
66
+ }
67
+ return (d, s) => {
68
+ const v = g("FmSwitch"), c = g("FmPinField"), i = g("FmButton");
69
+ return f(), V(q, null, [
70
+ p(v, {
71
+ modelValue: n.value.enable,
72
+ "onUpdate:modelValue": s[0] || (s[0] = (t) => n.value.enable = t),
73
+ label: "Enable Kiosk Mode?"
74
+ }, null, 8, ["modelValue"]),
75
+ n.value.enable ? (f(), V("div", le, [
76
+ s[2] || (s[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
77
+ p(c, {
78
+ modelValue: n.value.password,
79
+ "onUpdate:modelValue": s[1] || (s[1] = (t) => n.value.password = t)
80
+ }, null, 8, ["modelValue"])
81
+ ])) : C("", !0),
82
+ I("div", ne, [
83
+ p(i, {
84
+ variant: "primary",
85
+ label: "Send",
86
+ icon: "send",
87
+ loading: N(m),
88
+ onclick: e
89
+ }, null, 8, ["loading"])
90
+ ])
91
+ ], 64);
92
+ };
93
+ }
94
+ }), re = /* @__PURE__ */ U({
95
+ __name: "SettingRequest",
96
+ props: {
97
+ terminal: {
98
+ type: Object,
99
+ required: !0
100
+ }
101
+ },
102
+ setup(_) {
103
+ const { settingTab: m } = E({
104
+ settingTab: "kiosk_mode"
105
+ }), a = [
106
+ {
107
+ label: "Kiosk Mode",
108
+ value: "kiosk_mode",
109
+ render: oe
110
+ }
111
+ ], b = _, n = M(() => a.find((o) => o.value === m.value));
112
+ return (o, e) => {
113
+ var s;
114
+ const d = g("FmTabs");
115
+ return f(), V(q, null, [
116
+ e[1] || (e[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
117
+ I("b", null, "Note: "),
118
+ D(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
119
+ ], -1)),
120
+ p(d, {
121
+ "model-value": N(m),
122
+ "onUpdate:modelValue": e[0] || (e[0] = (v) => B(m) ? m.value = v : null),
123
+ class: "mb-6",
124
+ items: a
125
+ }, null, 8, ["model-value"]),
126
+ N(m) ? (f(), w(Y((s = n.value) == null ? void 0 : s.render), h(L({ key: 0 }, { terminal: b.terminal })), null, 16)) : C("", !0)
127
+ ], 64);
128
+ };
129
+ }
130
+ }), ue = {
131
+ key: 0,
132
+ class: "text-sm text-gray-500"
133
+ }, se = { class: "flex mt-6 space-x-6" }, ie = /* @__PURE__ */ U({
134
+ __name: "SoftposGateway",
135
+ props: {
136
+ terminal: {
137
+ type: Object,
138
+ required: !0
139
+ },
140
+ onUpdate: {
141
+ type: Function,
142
+ required: !0
143
+ }
144
+ },
145
+ setup(_) {
146
+ const m = _, a = j().currentCountry, b = [
147
+ {
148
+ label: "Fiuu Malaysia",
149
+ value: "cc.feedme.payment.rms",
150
+ region: S.F_COUNTRY.enum.MY,
151
+ gateway: "Fiuu",
152
+ isLegacy: !0,
153
+ isOutdated: !0
154
+ },
155
+ {
156
+ label: "Fiuu Malaysia V2",
157
+ value: "cc.feedme.payment.fiuu_my",
158
+ region: S.F_COUNTRY.enum.MY,
159
+ gateway: "Fiuu",
160
+ isLegacy: !0
161
+ },
162
+ {
163
+ label: "Fiuu Singapore",
164
+ value: "cc.feedme.payment.fiuu_sg",
165
+ region: S.F_COUNTRY.enum.SG,
166
+ gateway: "Fiuu",
167
+ isLegacy: !0
168
+ },
169
+ {
170
+ label: "Softspace Malaysia",
171
+ value: "cc.feedme.payment.softspace_my",
172
+ gateway: "Softspace",
173
+ region: S.F_COUNTRY.enum.MY
174
+ },
175
+ {
176
+ label: "Digio Thailand",
177
+ value: "cc.feedme.payment.digio_th",
178
+ gateway: "Digio",
179
+ region: S.F_COUNTRY.enum.TH
180
+ }
181
+ ], n = R(() => m.terminal), o = F(), e = F({
182
+ packageId: "",
183
+ uniqueId: "",
184
+ developerId: "",
185
+ isUat: !1
186
+ }), d = () => {
187
+ e.value.uniqueId = "", e.value.packageId = "", e.value.developerId = "";
188
+ }, s = () => {
189
+ if (!n.value.gateways || n.value.gateways.length === 0)
190
+ return d();
191
+ const t = n.value.gateways[0];
192
+ if (!t.config)
193
+ return d();
194
+ switch (t.gateway) {
195
+ case "Fiuu":
196
+ e.value = {
197
+ packageId: t.config.packageId,
198
+ uniqueId: t.config.uniqueId,
199
+ developerId: "",
200
+ isUat: !1
201
+ };
202
+ break;
203
+ case "Softspace":
204
+ case "Digio":
205
+ const l = JSON.parse(t.config.uniqueId);
206
+ e.value = {
207
+ packageId: t.config.packageId,
208
+ uniqueId: l.uniqueId,
209
+ developerId: l.developerId,
210
+ isUat: l.isUat
211
+ };
212
+ return;
213
+ }
214
+ };
215
+ $(n, s), O(s);
216
+ async function v(t) {
217
+ var l;
218
+ (l = n.value.gateways) == null || l.splice(t, 1), m.onUpdate(n.value);
219
+ }
220
+ const c = M(() => b.filter((t) => t.region === a.value)), i = M(() => c.value.find((t) => t.value === e.value.packageId));
221
+ return (t, l) => {
222
+ const u = g("FmSelect"), y = g("FmTextField"), k = g("FmCheckbox"), r = g("FmButton"), x = g("FmForm");
223
+ return f(), w(x, {
224
+ ref: o.value,
225
+ class: "flex flex-col gap-16 w-[500px]",
226
+ onValidationSuccess: l[5] || (l[5] = () => {
227
+ const T = i.value;
228
+ if (!T)
229
+ return;
230
+ let Q = e.value.uniqueId;
231
+ T.isLegacy || (Q = JSON.stringify({ uniqueId: e.value.uniqueId, developerId: e.value.developerId, isUat: e.value.isUat }));
232
+ const J = {
233
+ gateway: T.gateway,
234
+ config: {
235
+ packageId: T.value,
236
+ uniqueId: Q
237
+ }
238
+ };
239
+ (!n.value.gateways || n.value.gateways.length > 1) && (n.value.gateways = []), n.value.gateways[0] = J, m.onUpdate(n.value);
240
+ })
241
+ }, {
242
+ default: P(() => [
243
+ p(u, {
244
+ modelValue: e.value.packageId,
245
+ "onUpdate:modelValue": l[0] || (l[0] = (T) => e.value.packageId = T),
246
+ label: "Package ID",
247
+ items: c.value
248
+ }, null, 8, ["modelValue", "items"]),
249
+ i.value && i.value.isLegacy ? (f(), V(q, { key: 0 }, [
250
+ p(y, {
251
+ modelValue: e.value.uniqueId,
252
+ "onUpdate:modelValue": l[1] || (l[1] = (T) => e.value.uniqueId = T),
253
+ label: "Unique ID (TID)"
254
+ }, null, 8, ["modelValue"]),
255
+ i.value.isOutdated ? (f(), V("span", ue, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : C("", !0)
256
+ ], 64)) : (f(), V(q, { key: 1 }, [
257
+ p(y, {
258
+ modelValue: e.value.developerId,
259
+ "onUpdate:modelValue": l[2] || (l[2] = (T) => e.value.developerId = T),
260
+ label: "Developer ID (MID)"
261
+ }, null, 8, ["modelValue"]),
262
+ p(y, {
263
+ modelValue: e.value.uniqueId,
264
+ "onUpdate:modelValue": l[3] || (l[3] = (T) => e.value.uniqueId = T),
265
+ label: "Unique ID (TID)"
266
+ }, null, 8, ["modelValue"]),
267
+ p(k, {
268
+ modelValue: e.value.isUat,
269
+ "onUpdate:modelValue": l[4] || (l[4] = (T) => e.value.isUat = T),
270
+ label: "Is UAT (Test)",
271
+ value: "1"
272
+ }, null, 8, ["modelValue"])
273
+ ], 64)),
274
+ I("div", se, [
275
+ n.value.gateways && n.value.gateways.length > 0 ? (f(), w(r, {
276
+ key: 0,
277
+ class: "flex-1",
278
+ variant: "secondary",
279
+ label: "Delete",
280
+ onclick: () => v(0)
281
+ }, null, 8, ["onclick"])) : C("", !0),
282
+ p(r, {
283
+ type: "submit",
284
+ class: "flex-1",
285
+ variant: "primary",
286
+ label: "Save"
287
+ })
288
+ ])
289
+ ]),
290
+ _: 1
291
+ }, 512);
292
+ };
293
+ }
294
+ }), ce = {
295
+ key: 0,
296
+ class: "flex items-center justify-center min-h-[80vh]"
297
+ }, de = { class: "flex mt-6 space-x-6" }, me = /* @__PURE__ */ U({
298
+ __name: "TerminalGateway",
299
+ props: {
300
+ terminal: {
301
+ type: Object,
302
+ required: !0
303
+ },
304
+ onUpdate: {
305
+ type: Function,
306
+ required: !0
307
+ }
308
+ },
309
+ setup(_) {
310
+ const { isLoading: m, startAsyncCall: a } = z(), b = _, n = R(() => b.terminal), o = F(), e = F(), d = F(-1), s = F({
311
+ terminalId: ""
312
+ }), v = () => {
313
+ s.value.terminalId = "", d.value = -1;
314
+ }, c = () => {
315
+ if (a(async () => {
316
+ o.value = await G.getRestaurantTerminals(b.terminal.referenceId);
317
+ }), !b.terminal.ecrs)
318
+ return v();
319
+ const l = b.terminal.ecrs.findIndex((y) => y && y.gateway && y.gateway === "FeedMe");
320
+ if (l === -1)
321
+ return v();
322
+ d.value = l;
323
+ const u = b.terminal.ecrs.at(l);
324
+ u.gateway === "FeedMe" && u.config && (s.value = {
325
+ terminalId: u.config.terminalId
326
+ });
327
+ };
328
+ $(n, c), O(c);
329
+ const i = M(() => (o.value ?? []).map((l) => ({
330
+ label: l.name ?? l._id,
331
+ value: l._id
332
+ })));
333
+ async function t(l) {
334
+ var u;
335
+ (u = b.terminal.ecrs) == null || u.splice(l, 1), b.onUpdate(b.terminal);
336
+ }
337
+ return (l, u) => {
338
+ const y = g("FmCircularProgress"), k = g("FmSelect"), r = g("FmButton"), x = g("FmForm");
339
+ return N(m) ? (f(), V("div", ce, [
340
+ p(y, { size: "xxl" })
341
+ ])) : (f(), w(x, {
342
+ key: 1,
343
+ ref: e.value,
344
+ class: "flex flex-col gap-16 w-[500px]",
345
+ onValidationSuccess: u[1] || (u[1] = () => {
346
+ d.value > -1 ? n.value.ecrs[d.value] = { gateway: "FeedMe", config: s.value } : (n.value.ecrs || (n.value.ecrs = []), n.value.ecrs.push({ gateway: "FeedMe", config: s.value })), b.onUpdate(n.value);
347
+ })
348
+ }, {
349
+ default: P(() => [
350
+ p(k, {
351
+ modelValue: s.value.terminalId,
352
+ "onUpdate:modelValue": u[0] || (u[0] = (T) => s.value.terminalId = T),
353
+ label: "Terminal ID",
354
+ items: i.value,
355
+ rules: N(ee)(N(ae).string())
356
+ }, null, 8, ["modelValue", "items", "rules"]),
357
+ I("div", de, [
358
+ d.value > -1 ? (f(), w(r, {
359
+ key: 0,
360
+ class: "flex-1",
361
+ variant: "secondary",
362
+ label: "Delete",
363
+ onclick: () => t(d.value)
364
+ }, null, 8, ["onclick"])) : C("", !0),
365
+ p(r, {
366
+ type: "submit",
367
+ class: "flex-1",
368
+ variant: "primary",
369
+ label: "Save"
370
+ })
371
+ ])
372
+ ]),
373
+ _: 1
374
+ }, 512));
375
+ };
376
+ }
377
+ }), pe = { class: "flex mt-6 space-x-6" }, ve = /* @__PURE__ */ U({
378
+ __name: "GhlGateway",
379
+ props: {
380
+ terminal: {
381
+ type: Object,
382
+ required: !0
383
+ },
384
+ onUpdate: {
385
+ type: Function,
386
+ required: !0
387
+ }
388
+ },
389
+ setup(_) {
390
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F({
391
+ merchantId: "",
392
+ terminalId: "",
393
+ privateKey: ""
394
+ }), e = () => {
395
+ o.value.merchantId = "", o.value.terminalId = "", o.value.privateKey = "", n.value = -1;
396
+ }, d = () => {
397
+ if (!a.value.ecrs)
398
+ return e();
399
+ const v = a.value.ecrs.findIndex((i) => i && i.gateway && i.gateway === "Ghl");
400
+ if (v === -1)
401
+ return e();
402
+ n.value = v;
403
+ const c = a.value.ecrs.at(v);
404
+ c.gateway === "Ghl" && c.config && (o.value = {
405
+ merchantId: c.config.merchantId,
406
+ terminalId: c.config.terminalId,
407
+ privateKey: c.config.privateKey
408
+ });
409
+ };
410
+ $(a, d), O(d);
411
+ async function s(v) {
412
+ var c;
413
+ (c = a.value.ecrs) == null || c.splice(v, 1), m.onUpdate(a.value);
414
+ }
415
+ return (v, c) => {
416
+ const i = g("FmTextField"), t = g("FmTextarea"), l = g("FmButton"), u = g("FmForm");
417
+ return f(), w(u, {
418
+ ref: b.value,
419
+ class: "flex flex-col gap-16 w-[500px]",
420
+ onValidationSuccess: c[3] || (c[3] = () => {
421
+ n.value > -1 ? a.value.ecrs[n.value] = { gateway: "Ghl", config: o.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: o.value })), m.onUpdate(a.value);
422
+ })
423
+ }, {
424
+ default: P(() => [
425
+ p(i, {
426
+ modelValue: o.value.merchantId,
427
+ "onUpdate:modelValue": c[0] || (c[0] = (y) => o.value.merchantId = y),
428
+ label: "Merchant ID"
429
+ }, null, 8, ["modelValue"]),
430
+ p(i, {
431
+ modelValue: o.value.terminalId,
432
+ "onUpdate:modelValue": c[1] || (c[1] = (y) => o.value.terminalId = y),
433
+ label: "Terminal ID"
434
+ }, null, 8, ["modelValue"]),
435
+ p(t, {
436
+ modelValue: o.value.privateKey,
437
+ "onUpdate:modelValue": c[2] || (c[2] = (y) => o.value.privateKey = y),
438
+ label: "Private Key"
439
+ }, null, 8, ["modelValue"]),
440
+ I("div", pe, [
441
+ n.value > -1 ? (f(), w(l, {
442
+ key: 0,
443
+ class: "flex-1",
444
+ variant: "secondary",
445
+ label: "Delete",
446
+ onclick: () => s(n.value)
447
+ }, null, 8, ["onclick"])) : C("", !0),
448
+ p(l, {
449
+ type: "submit",
450
+ class: "flex-1",
451
+ variant: "primary",
452
+ label: "Save"
453
+ })
454
+ ])
455
+ ]),
456
+ _: 1
457
+ }, 512);
458
+ };
459
+ }
460
+ }), ye = { class: "flex items-end" }, fe = { class: "flex flex-wrap gap-8 items-center mt-4" }, ge = { class: "flex mt-6 space-x-6" }, be = /* @__PURE__ */ U({
461
+ __name: "MaybankGateway",
462
+ props: {
463
+ terminal: {
464
+ type: Object,
465
+ required: !0
466
+ },
467
+ onUpdate: {
468
+ type: Function,
469
+ required: !0
470
+ }
471
+ },
472
+ setup(_) {
473
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F(), e = F({
474
+ ip: "",
475
+ receiptName: "",
476
+ cardTypes: []
477
+ }), d = () => {
478
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
479
+ }, s = () => {
480
+ var u;
481
+ if (!a.value.ecrIntegrations)
482
+ return d();
483
+ const i = a.value.ecrIntegrations, t = i.findIndex((y) => y && y.gateway && y.gateway === "Maybank");
484
+ if (t === -1)
485
+ return d();
486
+ n.value = t;
487
+ const l = i.at(t);
488
+ l.gateway === "Maybank" && l.config && (e.value = {
489
+ ip: l.config.ip ?? "",
490
+ receiptName: l.receiptName ?? "",
491
+ cardTypes: ((u = l.dialogConfig) == null ? void 0 : u.cardTypes) ?? []
492
+ });
493
+ };
494
+ $(a, s), O(s);
495
+ async function v(i) {
496
+ var t;
497
+ (t = a.value.ecrIntegrations) == null || t.splice(i, 1), m.onUpdate(a.value);
498
+ }
499
+ async function c() {
500
+ e.value.cardTypes.push(o.value), o.value = "";
501
+ }
502
+ return (i, t) => {
503
+ const l = g("FmTextField"), u = g("FmButton"), y = g("FmChip"), k = g("FmForm");
504
+ return f(), w(k, {
505
+ ref: b.value,
506
+ class: "flex flex-col gap-16 w-[500px]",
507
+ onValidationSuccess: t[3] || (t[3] = () => {
508
+ var r, x;
509
+ n.value > -1 ? a.value.ecrIntegrations[n.value] = {
510
+ gateway: "Maybank",
511
+ config: { ip: e.value.ip },
512
+ receiptName: e.value.receiptName,
513
+ dialogConfig: {
514
+ ...(x = (r = a.value.ecrIntegrations) == null ? void 0 : r[n.value]) == null ? void 0 : x.dialogConfig,
515
+ cardTypes: e.value.cardTypes
516
+ }
517
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
518
+ gateway: "Maybank",
519
+ config: { ip: e.value.ip },
520
+ receiptName: e.value.receiptName,
521
+ dialogConfig: {
522
+ cardTypes: e.value.cardTypes
523
+ }
524
+ })), m.onUpdate(a.value);
525
+ })
526
+ }, {
527
+ default: P(() => [
528
+ p(l, {
529
+ modelValue: e.value.ip,
530
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.ip = r),
531
+ label: "IP Address"
532
+ }, null, 8, ["modelValue"]),
533
+ p(l, {
534
+ modelValue: e.value.receiptName,
535
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.receiptName = r),
536
+ label: "Receipt Payment Name",
537
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
538
+ }, null, 8, ["modelValue"]),
539
+ I("div", ye, [
540
+ p(l, {
541
+ modelValue: o.value,
542
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
543
+ label: "Fallback Card Types",
544
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
545
+ }, null, 8, ["modelValue"]),
546
+ p(u, {
547
+ class: "ml-4",
548
+ icon: "add",
549
+ onClick: c
550
+ })
551
+ ]),
552
+ I("div", fe, [
553
+ (f(!0), V(q, null, K(e.value.cardTypes, (r) => (f(), w(y, {
554
+ key: r,
555
+ label: r,
556
+ removable: !0,
557
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(r), 1)
558
+ }, null, 8, ["label", "onChipClosed"]))), 128))
559
+ ]),
560
+ I("div", ge, [
561
+ n.value > -1 ? (f(), w(u, {
562
+ key: 0,
563
+ class: "flex-1",
564
+ variant: "secondary",
565
+ label: "Delete",
566
+ onclick: () => v(n.value)
567
+ }, null, 8, ["onclick"])) : C("", !0),
568
+ p(u, {
569
+ type: "submit",
570
+ class: "flex-1",
571
+ variant: "primary",
572
+ label: "Save"
573
+ })
574
+ ])
575
+ ]),
576
+ _: 1
577
+ }, 512);
578
+ };
579
+ }
580
+ }), Ie = { class: "flex items-end" }, _e = { class: "flex flex-wrap gap-8 items-center mt-4" }, Fe = { class: "flex mt-6 space-x-6" }, we = /* @__PURE__ */ U({
581
+ __name: "Maybank2Gateway",
582
+ props: {
583
+ terminal: {
584
+ type: Object,
585
+ required: !0
586
+ },
587
+ onUpdate: {
588
+ type: Function,
589
+ required: !0
590
+ }
591
+ },
592
+ setup(_) {
593
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F(), e = F({
594
+ ip: "",
595
+ receiptName: "",
596
+ cardTypes: []
597
+ }), d = () => {
598
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
599
+ }, s = () => {
600
+ var u;
601
+ if (!a.value.ecrIntegrations)
602
+ return d();
603
+ const i = a.value.ecrIntegrations, t = i.findIndex((y) => y && y.gateway && y.gateway === "Maybank2");
604
+ if (t === -1)
605
+ return d();
606
+ n.value = t;
607
+ const l = i.at(t);
608
+ l.gateway === "Maybank2" && l.config && (e.value = {
609
+ ip: l.config.ip ?? "",
610
+ receiptName: l.receiptName ?? "",
611
+ cardTypes: ((u = l.dialogConfig) == null ? void 0 : u.cardTypes) ?? []
612
+ });
613
+ };
614
+ $(a, s), O(s);
615
+ async function v(i) {
616
+ var t;
617
+ (t = a.value.ecrIntegrations) == null || t.splice(i, 1), m.onUpdate(a.value);
618
+ }
619
+ async function c() {
620
+ e.value.cardTypes.push(o.value), o.value = "";
621
+ }
622
+ return (i, t) => {
623
+ const l = g("FmTextField"), u = g("FmButton"), y = g("FmChip"), k = g("FmForm");
624
+ return f(), w(k, {
625
+ ref: b.value,
626
+ class: "flex flex-col gap-16 w-[500px]",
627
+ onValidationSuccess: t[3] || (t[3] = () => {
628
+ var r, x;
629
+ n.value > -1 ? a.value.ecrIntegrations[n.value] = {
630
+ gateway: "Maybank2",
631
+ config: { ip: e.value.ip },
632
+ receiptName: e.value.receiptName,
633
+ dialogConfig: {
634
+ ...(x = (r = a.value.ecrIntegrations) == null ? void 0 : r[n.value]) == null ? void 0 : x.dialogConfig,
635
+ cardTypes: e.value.cardTypes
636
+ }
637
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
638
+ gateway: "Maybank2",
639
+ config: { ip: e.value.ip },
640
+ receiptName: e.value.receiptName,
641
+ dialogConfig: {
642
+ cardTypes: e.value.cardTypes
643
+ }
644
+ })), m.onUpdate(a.value);
645
+ })
646
+ }, {
647
+ default: P(() => [
648
+ p(l, {
649
+ modelValue: e.value.ip,
650
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.ip = r),
651
+ label: "IP Address"
652
+ }, null, 8, ["modelValue"]),
653
+ p(l, {
654
+ modelValue: e.value.receiptName,
655
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.receiptName = r),
656
+ label: "Receipt Payment Name",
657
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
658
+ }, null, 8, ["modelValue"]),
659
+ I("div", Ie, [
660
+ p(l, {
661
+ modelValue: o.value,
662
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
663
+ label: "Fallback Card Types",
664
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
665
+ }, null, 8, ["modelValue"]),
666
+ p(u, {
667
+ class: "ml-4",
668
+ icon: "add",
669
+ onClick: c
670
+ })
671
+ ]),
672
+ I("div", _e, [
673
+ (f(!0), V(q, null, K(e.value.cardTypes, (r) => (f(), w(y, {
674
+ key: r,
675
+ label: r,
676
+ removable: !0,
677
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(r), 1)
678
+ }, null, 8, ["label", "onChipClosed"]))), 128))
679
+ ]),
680
+ I("div", Fe, [
681
+ n.value > -1 ? (f(), w(u, {
682
+ key: 0,
683
+ class: "flex-1",
684
+ variant: "secondary",
685
+ label: "Delete",
686
+ onclick: () => v(n.value)
687
+ }, null, 8, ["onclick"])) : C("", !0),
688
+ p(u, {
689
+ type: "submit",
690
+ class: "flex-1",
691
+ variant: "primary",
692
+ label: "Save"
693
+ })
694
+ ])
695
+ ]),
696
+ _: 1
697
+ }, 512);
698
+ };
699
+ }
700
+ }), Te = { class: "flex items-end" }, xe = { class: "flex flex-wrap gap-8 items-center mt-4" }, ke = { class: "flex mt-6 space-x-6" }, Ne = /* @__PURE__ */ U({
701
+ __name: "Maybank3Gateway",
702
+ props: {
703
+ terminal: {
704
+ type: Object,
705
+ required: !0
706
+ },
707
+ onUpdate: {
708
+ type: Function,
709
+ required: !0
710
+ }
711
+ },
712
+ setup(_) {
713
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F(), e = F({
714
+ ip: "",
715
+ receiptName: "",
716
+ cardTypes: []
717
+ }), d = () => {
718
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
719
+ }, s = () => {
720
+ var u;
721
+ if (!a.value.ecrIntegrations)
722
+ return d();
723
+ const i = a.value.ecrIntegrations, t = i.findIndex((y) => y && y.gateway && y.gateway === "Maybank3");
724
+ if (t === -1)
725
+ return d();
726
+ n.value = t;
727
+ const l = i.at(t);
728
+ l.gateway === "Maybank3" && l.config && (e.value = {
729
+ ip: l.config.ip ?? "",
730
+ receiptName: l.receiptName ?? "",
731
+ cardTypes: ((u = l.dialogConfig) == null ? void 0 : u.cardTypes) ?? []
732
+ });
733
+ };
734
+ $(a, s), O(s);
735
+ async function v(i) {
736
+ var t;
737
+ (t = a.value.ecrIntegrations) == null || t.splice(i, 1), m.onUpdate(a.value);
738
+ }
739
+ async function c() {
740
+ e.value.cardTypes.push(o.value), o.value = "";
741
+ }
742
+ return (i, t) => {
743
+ const l = g("FmTextField"), u = g("FmButton"), y = g("FmChip"), k = g("FmForm");
744
+ return f(), w(k, {
745
+ ref: b.value,
746
+ class: "flex flex-col gap-16 w-[500px]",
747
+ onValidationSuccess: t[3] || (t[3] = () => {
748
+ var r, x;
749
+ n.value > -1 ? a.value.ecrIntegrations[n.value] = {
750
+ gateway: "Maybank3",
751
+ config: { ip: e.value.ip },
752
+ receiptName: e.value.receiptName,
753
+ dialogConfig: {
754
+ ...(x = (r = a.value.ecrIntegrations) == null ? void 0 : r[n.value]) == null ? void 0 : x.dialogConfig,
755
+ cardTypes: e.value.cardTypes
756
+ }
757
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
758
+ gateway: "Maybank3",
759
+ config: { ip: e.value.ip },
760
+ receiptName: e.value.receiptName,
761
+ dialogConfig: {
762
+ cardTypes: e.value.cardTypes
763
+ }
764
+ })), m.onUpdate(a.value);
765
+ })
766
+ }, {
767
+ default: P(() => [
768
+ p(l, {
769
+ modelValue: e.value.ip,
770
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.ip = r),
771
+ label: "IP Address"
772
+ }, null, 8, ["modelValue"]),
773
+ p(l, {
774
+ modelValue: e.value.receiptName,
775
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.receiptName = r),
776
+ label: "Receipt Payment Name",
777
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
778
+ }, null, 8, ["modelValue"]),
779
+ I("div", Te, [
780
+ p(l, {
781
+ modelValue: o.value,
782
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
783
+ label: "Fallback Card Types",
784
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
785
+ }, null, 8, ["modelValue"]),
786
+ p(u, {
787
+ class: "ml-4",
788
+ icon: "add",
789
+ onClick: c
790
+ })
791
+ ]),
792
+ I("div", xe, [
793
+ (f(!0), V(q, null, K(e.value.cardTypes, (r) => (f(), w(y, {
794
+ key: r,
795
+ label: r,
796
+ removable: !0,
797
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(r), 1)
798
+ }, null, 8, ["label", "onChipClosed"]))), 128))
799
+ ]),
800
+ I("div", ke, [
801
+ n.value > -1 ? (f(), w(u, {
802
+ key: 0,
803
+ class: "flex-1",
804
+ variant: "secondary",
805
+ label: "Delete",
806
+ onclick: () => v(n.value)
807
+ }, null, 8, ["onclick"])) : C("", !0),
808
+ p(u, {
809
+ type: "submit",
810
+ class: "flex-1",
811
+ variant: "primary",
812
+ label: "Save"
813
+ })
814
+ ])
815
+ ]),
816
+ _: 1
817
+ }, 512);
818
+ };
819
+ }
820
+ }), Ve = { class: "flex items-end" }, Ce = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ue = { class: "flex mt-6 space-x-6" }, Se = /* @__PURE__ */ U({
821
+ __name: "NetsGateway",
822
+ props: {
823
+ terminal: {
824
+ type: Object,
825
+ required: !0
826
+ },
827
+ onUpdate: {
828
+ type: Function,
829
+ required: !0
830
+ }
831
+ },
832
+ setup(_) {
833
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F(), e = F({
834
+ ip: "",
835
+ receiptName: "",
836
+ cardTypes: []
837
+ }), d = () => {
838
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
839
+ }, s = () => {
840
+ var u;
841
+ if (!a.value.ecrIntegrations)
842
+ return d();
843
+ const i = a.value.ecrIntegrations, t = i.findIndex((y) => y && y.gateway && y.gateway === "Nets");
844
+ if (t === -1)
845
+ return d();
846
+ n.value = t;
847
+ const l = i.at(t);
848
+ l.gateway === "Nets" && l.config && (e.value = {
849
+ ip: l.config.ip ?? "",
850
+ receiptName: l.receiptName ?? "",
851
+ cardTypes: ((u = l.dialogConfig) == null ? void 0 : u.cardTypes) ?? []
852
+ });
853
+ };
854
+ $(a, s), O(s);
855
+ async function v(i) {
856
+ var t;
857
+ (t = a.value.ecrIntegrations) == null || t.splice(i, 1), m.onUpdate(a.value);
858
+ }
859
+ async function c() {
860
+ e.value.cardTypes.push(o.value), o.value = "";
861
+ }
862
+ return (i, t) => {
863
+ const l = g("FmTextField"), u = g("FmButton"), y = g("FmChip"), k = g("FmForm");
864
+ return f(), w(k, {
865
+ ref: b.value,
866
+ class: "flex flex-col gap-16 w-[500px]",
867
+ onValidationSuccess: t[3] || (t[3] = () => {
868
+ var r, x;
869
+ n.value > -1 ? a.value.ecrIntegrations[n.value] = {
870
+ gateway: "Nets",
871
+ config: { ip: e.value.ip },
872
+ receiptName: e.value.receiptName,
873
+ dialogConfig: {
874
+ ...(x = (r = a.value.ecrIntegrations) == null ? void 0 : r[n.value]) == null ? void 0 : x.dialogConfig,
875
+ cardTypes: e.value.cardTypes
876
+ }
877
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
878
+ gateway: "Nets",
879
+ config: { ip: e.value.ip },
880
+ receiptName: e.value.receiptName,
881
+ dialogConfig: {
882
+ cardTypes: e.value.cardTypes
883
+ }
884
+ })), m.onUpdate(a.value);
885
+ })
886
+ }, {
887
+ default: P(() => [
888
+ p(l, {
889
+ modelValue: e.value.ip,
890
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.ip = r),
891
+ label: "IP Address"
892
+ }, null, 8, ["modelValue"]),
893
+ p(l, {
894
+ modelValue: e.value.receiptName,
895
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.receiptName = r),
896
+ label: "Receipt Payment Name",
897
+ "label-info": "Default receipt display will be 'TERMINAL_NETS'"
898
+ }, null, 8, ["modelValue"]),
899
+ I("div", Ve, [
900
+ p(l, {
901
+ modelValue: o.value,
902
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
903
+ label: "Fallback Card Types",
904
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
905
+ }, null, 8, ["modelValue"]),
906
+ p(u, {
907
+ class: "ml-4",
908
+ icon: "add",
909
+ onClick: c
910
+ })
911
+ ]),
912
+ I("div", Ce, [
913
+ (f(!0), V(q, null, K(e.value.cardTypes, (r) => (f(), w(y, {
914
+ key: r,
915
+ label: r,
916
+ removable: !0,
917
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(r), 1)
918
+ }, null, 8, ["label", "onChipClosed"]))), 128))
919
+ ]),
920
+ I("div", Ue, [
921
+ n.value > -1 ? (f(), w(u, {
922
+ key: 0,
923
+ class: "flex-1",
924
+ variant: "secondary",
925
+ label: "Delete",
926
+ onclick: () => v(n.value)
927
+ }, null, 8, ["onclick"])) : C("", !0),
928
+ p(u, {
929
+ type: "submit",
930
+ class: "flex-1",
931
+ variant: "primary",
932
+ label: "Save"
933
+ })
934
+ ])
935
+ ]),
936
+ _: 1
937
+ }, 512);
938
+ };
939
+ }
940
+ }), Me = { class: "flex items-center" }, qe = { class: "w-[260px] self-start" }, Oe = { class: "flex-1" }, Pe = /* @__PURE__ */ U({
941
+ __name: "EcrGateway",
942
+ props: {
943
+ terminal: {
944
+ type: Object,
945
+ required: !0
946
+ },
947
+ onUpdate: {
948
+ type: Function,
949
+ required: !0
950
+ }
951
+ },
952
+ setup(_) {
953
+ var d;
954
+ const m = _, a = [
955
+ {
956
+ label: "FeedMe Terminal",
957
+ value: "terminal",
958
+ render: me
959
+ },
960
+ {
961
+ label: "GHL Terminal (V2)",
962
+ value: "ghl",
963
+ render: ve,
964
+ region: [S.F_COUNTRY.enum.MY]
965
+ },
966
+ {
967
+ label: "Maybank Terminal (ITB)",
968
+ value: "mb-itb",
969
+ render: be,
970
+ region: [S.F_COUNTRY.enum.MY]
971
+ },
972
+ {
973
+ label: "Maybank Terminal (PMA)",
974
+ value: "mb-pma",
975
+ render: we,
976
+ region: [S.F_COUNTRY.enum.MY]
977
+ },
978
+ {
979
+ label: "Maybank Terminal (Paysys)",
980
+ value: "mb-paysys",
981
+ render: Ne,
982
+ region: [S.F_COUNTRY.enum.MY]
983
+ },
984
+ {
985
+ label: "Nets Terminal",
986
+ value: "nets",
987
+ render: Se,
988
+ region: [S.F_COUNTRY.enum.SG]
989
+ }
990
+ ], b = M(() => a.find((s) => s.value === e.value)), n = j().currentCountry, o = M(() => a.filter((s) => !s.region || s.region.includes(n.value ?? S.F_COUNTRY.enum.MY))), { gatewayTab: e } = E({
991
+ gatewayTab: (d = o.value[0]) == null ? void 0 : d.value
992
+ });
993
+ return (s, v) => {
994
+ var i;
995
+ const c = g("FmTabs");
996
+ return f(), V("div", Me, [
997
+ I("div", qe, [
998
+ p(c, {
999
+ "model-value": N(e),
1000
+ "onUpdate:modelValue": v[0] || (v[0] = (t) => B(e) ? e.value = t : null),
1001
+ class: "mb-6",
1002
+ vertical: !0,
1003
+ items: o.value
1004
+ }, null, 8, ["model-value", "items"])
1005
+ ]),
1006
+ I("div", Oe, [
1007
+ N(e) ? (f(), w(Y((i = b.value) == null ? void 0 : i.render), h(L({ key: 0 }, {
1008
+ terminal: m.terminal,
1009
+ onUpdate: m.onUpdate
1010
+ })), null, 16)) : C("", !0)
1011
+ ])
1012
+ ]);
1013
+ };
1014
+ }
1015
+ }), Re = { class: "flex mt-6 space-x-6" }, $e = /* @__PURE__ */ U({
1016
+ __name: "PromptPayGateway",
1017
+ props: {
1018
+ terminal: {
1019
+ type: Object,
1020
+ required: !0
1021
+ },
1022
+ onUpdate: {
1023
+ type: Function,
1024
+ required: !0
1025
+ }
1026
+ },
1027
+ setup(_) {
1028
+ const m = _, a = R(() => m.terminal), b = F(), n = F(-1), o = F({
1029
+ account: "",
1030
+ receiptName: ""
1031
+ }), e = () => {
1032
+ o.value.account = "", o.value.receiptName = "", n.value = -1;
1033
+ }, d = () => {
1034
+ if (!a.value.qrIntegrations)
1035
+ return e();
1036
+ const v = a.value.qrIntegrations, c = v.findIndex((t) => t && t.gateway && t.gateway === "PromptPay");
1037
+ if (c === -1)
1038
+ return e();
1039
+ n.value = c;
1040
+ const i = v.at(c);
1041
+ i.gateway === "PromptPay" && i.config && (o.value = {
1042
+ account: i.config.account ?? "",
1043
+ receiptName: i.receiptName ?? ""
1044
+ });
1045
+ };
1046
+ $(a, d), O(d);
1047
+ async function s(v) {
1048
+ var c;
1049
+ (c = a.value.qrIntegrations) == null || c.splice(v, 1), m.onUpdate(a.value);
1050
+ }
1051
+ return (v, c) => {
1052
+ const i = g("FmTextField"), t = g("FmButton"), l = g("FmForm");
1053
+ return f(), w(l, {
1054
+ ref: b.value,
1055
+ class: "flex flex-col gap-16 w-[500px]",
1056
+ onValidationSuccess: c[2] || (c[2] = () => {
1057
+ n.value > -1 ? a.value.qrIntegrations[n.value] = { gateway: "PromptPay", config: { account: o.value.account }, receiptName: o.value.receiptName } : (a.value.qrIntegrations || (a.value.qrIntegrations = []), a.value.qrIntegrations.push({ gateway: "PromptPay", config: { account: o.value.account }, receiptName: o.value.receiptName })), m.onUpdate(a.value);
1058
+ })
1059
+ }, {
1060
+ default: P(() => [
1061
+ p(i, {
1062
+ modelValue: o.value.account,
1063
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => o.value.account = u),
1064
+ label: "Thai Account / Internal Number"
1065
+ }, null, 8, ["modelValue"]),
1066
+ p(i, {
1067
+ modelValue: o.value.receiptName,
1068
+ "onUpdate:modelValue": c[1] || (c[1] = (u) => o.value.receiptName = u),
1069
+ label: "Receipt Payment Name",
1070
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1071
+ }, null, 8, ["modelValue"]),
1072
+ I("div", Re, [
1073
+ n.value > -1 ? (f(), w(t, {
1074
+ key: 0,
1075
+ class: "flex-1",
1076
+ variant: "secondary",
1077
+ label: "Delete",
1078
+ onclick: () => s(n.value)
1079
+ }, null, 8, ["onclick"])) : C("", !0),
1080
+ p(t, {
1081
+ type: "submit",
1082
+ class: "flex-1",
1083
+ variant: "primary",
1084
+ label: "Save"
1085
+ })
1086
+ ])
1087
+ ]),
1088
+ _: 1
1089
+ }, 512);
1090
+ };
1091
+ }
1092
+ }), De = { class: "flex items-center" }, Ge = { class: "w-[260px] self-start" }, Ae = { class: "flex-1" }, Be = /* @__PURE__ */ U({
1093
+ __name: "QrGateway",
1094
+ props: {
1095
+ terminal: {
1096
+ type: Object,
1097
+ required: !0
1098
+ },
1099
+ onUpdate: {
1100
+ type: Function,
1101
+ required: !0
1102
+ }
1103
+ },
1104
+ setup(_) {
1105
+ var d;
1106
+ const m = _, a = [
1107
+ {
1108
+ label: "PromptPay",
1109
+ value: "promptpay",
1110
+ render: $e,
1111
+ region: [S.F_COUNTRY.enum.MY]
1112
+ }
1113
+ ], b = M(() => a.find((s) => s.value === e.value)), n = j().currentCountry, o = M(() => a.filter((s) => !s.region || s.region.includes(n.value ?? S.F_COUNTRY.enum.MY))), { gatewayTab: e } = E({
1114
+ gatewayTab: (d = o.value[0]) == null ? void 0 : d.value
1115
+ });
1116
+ return (s, v) => {
1117
+ var i;
1118
+ const c = g("FmTabs");
1119
+ return f(), V("div", De, [
1120
+ I("div", Ge, [
1121
+ p(c, {
1122
+ "model-value": N(e),
1123
+ "onUpdate:modelValue": v[0] || (v[0] = (t) => B(e) ? e.value = t : null),
1124
+ class: "mb-6",
1125
+ vertical: !0,
1126
+ items: o.value
1127
+ }, null, 8, ["model-value", "items"])
1128
+ ]),
1129
+ I("div", Ae, [
1130
+ N(e) ? (f(), w(Y((i = b.value) == null ? void 0 : i.render), h(L({ key: 0 }, {
1131
+ terminal: m.terminal,
1132
+ onUpdate: m.onUpdate
1133
+ })), null, 16)) : C("", !0)
1134
+ ])
1135
+ ]);
1136
+ };
1137
+ }
1138
+ }), We = /* @__PURE__ */ U({
1139
+ __name: "TerminalSetting",
1140
+ props: {
1141
+ terminalId: {
1142
+ type: String,
1143
+ required: !0
1144
+ }
1145
+ },
1146
+ setup(_) {
1147
+ const m = _, { tab: a } = E({
1148
+ tab: "information"
1149
+ }), { isLoading: b, startAsyncCall: n } = z(!0), o = W(), e = H(), d = F();
1150
+ async function s(l) {
1151
+ n(async () => {
1152
+ try {
1153
+ await G.updateById(
1154
+ m.terminalId,
1155
+ {
1156
+ name: l.name,
1157
+ status: l.status,
1158
+ ecrs: l.ecrs ?? [],
1159
+ gateways: l.gateways ?? [],
1160
+ ecrIntegrations: l.ecrIntegrations ?? [],
1161
+ qrIntegrations: l.qrIntegrations ?? []
1162
+ }
1163
+ ), d.value = await G.readById(m.terminalId), e.open({
1164
+ type: "success",
1165
+ message: "Terminal updated successfully"
1166
+ });
1167
+ } catch (u) {
1168
+ e.open({
1169
+ type: "error",
1170
+ title: "Error occurs when update terminal",
1171
+ message: Z(u)
1172
+ });
1173
+ }
1174
+ });
1175
+ }
1176
+ const v = [
1177
+ {
1178
+ label: "Information",
1179
+ value: "information",
1180
+ icon: "overview",
1181
+ render: te
1182
+ },
1183
+ {
1184
+ label: "Setting Request",
1185
+ value: "settings",
1186
+ icon: "settings",
1187
+ render: re,
1188
+ onlyFor: ["TERMINAL"]
1189
+ },
1190
+ {
1191
+ label: "SoftPos Gateway",
1192
+ value: "softpos",
1193
+ icon: "payment",
1194
+ render: ie
1195
+ },
1196
+ {
1197
+ label: "ECR Gateway",
1198
+ value: "ecr",
1199
+ icon: "point_of_sale",
1200
+ render: Pe,
1201
+ onlyFor: ["POS", "KIOSK"]
1202
+ },
1203
+ {
1204
+ label: "QR Gateway",
1205
+ value: "qr",
1206
+ icon: "qr_code",
1207
+ render: Be,
1208
+ onlyFor: ["POS", "KIOSK"]
1209
+ }
1210
+ ];
1211
+ j().currentCountry;
1212
+ const c = M(() => {
1213
+ var l;
1214
+ return (l = v.find((u) => u.value === a.value)) == null ? void 0 : l.render;
1215
+ });
1216
+ async function i() {
1217
+ n(async () => {
1218
+ d.value = await G.readById(m.terminalId);
1219
+ });
1220
+ }
1221
+ const t = M(() => v.filter((l) => {
1222
+ var u;
1223
+ return !l.onlyFor || l.onlyFor.includes(((u = d.value) == null ? void 0 : u.deviceType) ?? "");
1224
+ }));
1225
+ return O(i), (l, u) => {
1226
+ var k;
1227
+ const y = g("FmTabs");
1228
+ return f(), w(X, {
1229
+ title: `Terminal (${(k = d.value) == null ? void 0 : k._id})`,
1230
+ loading: N(b),
1231
+ onBack: N(o).back
1232
+ }, {
1233
+ default: P(() => [
1234
+ p(y, {
1235
+ "model-value": N(a),
1236
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => B(a) ? a.value = r : null),
1237
+ class: "mb-6",
1238
+ items: t.value
1239
+ }, null, 8, ["model-value", "items"]),
1240
+ N(a) ? (f(), w(Y(c.value), h(L({ key: 0 }, {
1241
+ terminal: d.value,
1242
+ onUpdate: s
1243
+ })), null, 16)) : C("", !0)
1244
+ ]),
1245
+ _: 1
1246
+ }, 8, ["title", "loading", "onBack"]);
1247
+ };
1248
+ }
1249
+ });
1250
+ export {
1251
+ We as default
1252
+ };