@feedmepos/mf-payment 1.5.58 → 1.5.59-dev

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 (27) hide show
  1. package/dist/{OnboardForm-BvNciBBq.js → OnboardForm-JVgZ181b.js} +553 -481
  2. package/dist/{OnboardForm-9Mj8aGDQ.js → OnboardForm-zsULkQrh.js} +2 -2
  3. package/dist/{OnboardSubmission-DvWwQFy6.js → OnboardSubmission-BvUrpOC3.js} +336 -121
  4. package/dist/{OnboardSubmission-C2BYK2p1.js → OnboardSubmission-CR6o2zIK.js} +25 -25
  5. package/dist/{PayoutAccount-RW2zIZFf.js → PayoutAccount-3zLhh0ti.js} +1 -1
  6. package/dist/{PayoutAccount-DJaJFWll.js → PayoutAccount-B42ffsVM.js} +1 -1
  7. package/dist/{Terminal-Sfe6Nf9j.js → Terminal-DqSu2QTe.js} +1 -1
  8. package/dist/TerminalSetting-BCVX0Jdf.js +2102 -0
  9. package/dist/{Transaction-hVVgSn4x.js → Transaction-Cuh4qbT0.js} +1 -1
  10. package/dist/api/onboard-submission/index.d.ts +13 -0
  11. package/dist/api/terminal/index.d.ts +1 -0
  12. package/dist/{app-D0z9X0sH.js → app-B9xMyKhl.js} +270 -211
  13. package/dist/app.js +1 -1
  14. package/dist/composable/async-poller/index.d.ts +22 -0
  15. package/dist/index-BteYHCd3.js +63 -0
  16. package/dist/{index-CnN_MV2-.js → index-CQI_8W1T.js} +23 -8
  17. package/dist/index-MdV54cWO.js +58 -0
  18. package/dist/package.json +2 -2
  19. package/dist/{payout-account-DhM0zCjO.js → payout-account-BkGj6HJy.js} +1 -1
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +81 -0
  22. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +2 -2
  23. package/dist/views/admin/terminal/tabs/useTyroSoftposGateway.d.ts +10 -0
  24. package/dist/views/onboard-submission/tyro-submission-polling.d.ts +27 -0
  25. package/package.json +1 -1
  26. package/dist/TerminalSetting-KjacSx_V.js +0 -1958
  27. package/dist/index-XTdSN6CV.js +0 -60
@@ -1,1958 +0,0 @@
1
- import { defineComponent as C, openBlock as y, createElementBlock as V, Fragment as G, createElementVNode as _, createTextVNode as $, toDisplayString as D, ref as b, resolveComponent as f, createVNode as v, createCommentVNode as N, unref as h, computed as P, isRef as B, createBlock as I, resolveDynamicComponent as Y, normalizeProps as L, mergeProps as K, toRef as O, watch as q, onMounted as S, withCtx as M, renderList as R } from "vue";
2
- import { u as H, e as k } from "./index-D0j1LZAB.js";
3
- import { useRouter as W } from "vue-router";
4
- import { t as A } from "./index-XTdSN6CV.js";
5
- import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
- import { u as E } from "./index-BkQ7t3F6.js";
7
- import { useSnackbar as Q } 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-DzjyJnvv.js";
11
- const le = /* @__PURE__ */ C({
12
- __name: "Information",
13
- props: {
14
- terminal: {
15
- type: Object,
16
- required: !0
17
- }
18
- },
19
- setup(F) {
20
- return (c, a) => (y(), V(G, null, [
21
- a[0] || (a[0] = _("b", null, "Name", -1)),
22
- $(": " + D(F.terminal.name), 1),
23
- a[1] || (a[1] = _("br", null, null, -1)),
24
- a[2] || (a[2] = _("b", null, "Status", -1)),
25
- $(": " + D(F.terminal.status), 1),
26
- a[3] || (a[3] = _("br", null, null, -1)),
27
- a[4] || (a[4] = _("b", null, "Device ID", -1)),
28
- $(": " + D(F.terminal.deviceId ?? "-"), 1),
29
- a[5] || (a[5] = _("br", null, null, -1)),
30
- a[6] || (a[6] = _("b", null, "Device Type", -1)),
31
- $(": " + D(F.terminal.deviceType ?? "-"), 1),
32
- a[7] || (a[7] = _("br", null, null, -1))
33
- ], 64));
34
- }
35
- }), te = { key: 0 }, ne = { class: "mt-6 space-x-6" }, oe = /* @__PURE__ */ C({
36
- __name: "KioskMode",
37
- props: {
38
- terminal: {
39
- type: Object,
40
- required: !0
41
- }
42
- },
43
- setup(F) {
44
- const { isLoading: c, startAsyncCall: a } = H(!1), T = Q(), n = b({
45
- enable: !1,
46
- password: []
47
- }), r = F;
48
- function e() {
49
- return n.value.enable && n.value.password.filter((m) => !!m).length !== 6 ? T.open({
50
- type: "error",
51
- message: "Unlock PIN is required when setting up kiosk mode for terminal."
52
- }) : a(async () => {
53
- const m = { enable: n.value.enable };
54
- m.enable && Object.assign(m, {
55
- password: n.value.password.join("")
56
- });
57
- const d = await A.kioskModeRequest(r.terminal._id, m);
58
- if (d === "OK")
59
- return T.open({ type: "info", message: "Kiosk mode applied successfully." });
60
- let g = d;
61
- return d === "client_not_connected" && (g = "Terminal not connected to the websocket server."), d.startsWith("terminal: ") && (g = d.replaceAll("terminal: ", "")), T.open({
62
- type: "error",
63
- message: g
64
- });
65
- });
66
- }
67
- return (m, d) => {
68
- const g = f("FmSwitch"), s = f("FmPinField"), u = f("FmButton");
69
- return y(), V(G, null, [
70
- v(g, {
71
- modelValue: n.value.enable,
72
- "onUpdate:modelValue": d[0] || (d[0] = (l) => n.value.enable = l),
73
- label: "Enable Kiosk Mode?"
74
- }, null, 8, ["modelValue"]),
75
- n.value.enable ? (y(), V("div", te, [
76
- d[2] || (d[2] = _("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
77
- v(s, {
78
- modelValue: n.value.password,
79
- "onUpdate:modelValue": d[1] || (d[1] = (l) => n.value.password = l)
80
- }, null, 8, ["modelValue"])
81
- ])) : N("", !0),
82
- _("div", ne, [
83
- v(u, {
84
- variant: "primary",
85
- label: "Send",
86
- icon: "send",
87
- loading: h(c),
88
- onclick: e
89
- }, null, 8, ["loading"])
90
- ])
91
- ], 64);
92
- };
93
- }
94
- }), re = /* @__PURE__ */ C({
95
- __name: "SettingRequest",
96
- props: {
97
- terminal: {
98
- type: Object,
99
- required: !0
100
- }
101
- },
102
- setup(F) {
103
- const { settingTab: c } = E({
104
- settingTab: "kiosk_mode"
105
- }), a = [
106
- {
107
- label: "Kiosk Mode",
108
- value: "kiosk_mode",
109
- render: oe
110
- }
111
- ], T = F, n = P(() => a.find((r) => r.value === c.value));
112
- return (r, e) => {
113
- var d;
114
- const m = f("FmTabs");
115
- return y(), V(G, null, [
116
- e[1] || (e[1] = _("p", { className: "mt-1 my-6 text-gray-600" }, [
117
- _("b", null, "Note: "),
118
- $(" 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
- v(m, {
121
- "model-value": h(c),
122
- "onUpdate:modelValue": e[0] || (e[0] = (g) => B(c) ? c.value = g : null),
123
- class: "mb-6",
124
- items: a
125
- }, null, 8, ["model-value"]),
126
- h(c) ? (y(), I(Y((d = n.value) == null ? void 0 : d.render), L(K({ key: 0 }, { terminal: T.terminal })), null, 16)) : N("", !0)
127
- ], 64);
128
- };
129
- }
130
- }), ie = {
131
- key: 0,
132
- class: "text-sm text-gray-500"
133
- }, ue = { class: "flex mt-6 space-x-6" }, se = /* @__PURE__ */ C({
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(F) {
146
- const c = F, a = j().currentCountry, T = [
147
- {
148
- label: "Fiuu Malaysia",
149
- value: "cc.feedme.payment.rms",
150
- region: k.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: k.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: k.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: k.F_COUNTRY.enum.MY
174
- },
175
- {
176
- label: "Digio Thailand",
177
- value: "cc.feedme.payment.digio_th",
178
- gateway: "Digio",
179
- region: k.F_COUNTRY.enum.TH
180
- }
181
- ], n = O(() => c.terminal), r = b(), e = b({
182
- packageId: "",
183
- uniqueId: "",
184
- developerId: "",
185
- isUat: !1
186
- }), m = () => {
187
- e.value.uniqueId = "", e.value.packageId = "", e.value.developerId = "";
188
- }, d = () => {
189
- if (!n.value.gateways || n.value.gateways.length === 0)
190
- return m();
191
- const l = n.value.gateways[0];
192
- if (!l.config)
193
- return m();
194
- switch (l.gateway) {
195
- case "Fiuu":
196
- e.value = {
197
- packageId: l.config.packageId,
198
- uniqueId: l.config.uniqueId,
199
- developerId: "",
200
- isUat: !1
201
- };
202
- break;
203
- case "Softspace":
204
- case "Digio":
205
- const t = JSON.parse(l.config.uniqueId);
206
- e.value = {
207
- packageId: l.config.packageId,
208
- uniqueId: t.uniqueId,
209
- developerId: t.developerId,
210
- isUat: t.isUat
211
- };
212
- return;
213
- }
214
- };
215
- q(n, d), S(d);
216
- async function g(l) {
217
- var t;
218
- (t = n.value.gateways) == null || t.splice(l, 1), c.onUpdate(n.value);
219
- }
220
- const s = P(() => T.filter((l) => l.region === a.value)), u = P(() => s.value.find((l) => l.value === e.value.packageId));
221
- return (l, t) => {
222
- const i = f("FmSelect"), p = f("FmTextField"), x = f("FmCheckbox"), o = f("FmButton"), w = f("FmForm");
223
- return y(), I(w, {
224
- ref: r.value,
225
- class: "flex flex-col gap-16 w-[500px]",
226
- onValidationSuccess: t[5] || (t[5] = () => {
227
- const U = u.value;
228
- if (!U)
229
- return;
230
- let z = e.value.uniqueId;
231
- U.isLegacy || (z = JSON.stringify({ uniqueId: e.value.uniqueId, developerId: e.value.developerId, isUat: e.value.isUat }));
232
- const J = {
233
- gateway: U.gateway,
234
- config: {
235
- packageId: U.value,
236
- uniqueId: z
237
- }
238
- };
239
- (!n.value.gateways || n.value.gateways.length > 1) && (n.value.gateways = []), n.value.gateways[0] = J, c.onUpdate(n.value);
240
- })
241
- }, {
242
- default: M(() => [
243
- v(i, {
244
- modelValue: e.value.packageId,
245
- "onUpdate:modelValue": t[0] || (t[0] = (U) => e.value.packageId = U),
246
- label: "Package ID",
247
- items: s.value
248
- }, null, 8, ["modelValue", "items"]),
249
- u.value && u.value.isLegacy ? (y(), V(G, { key: 0 }, [
250
- v(p, {
251
- modelValue: e.value.uniqueId,
252
- "onUpdate:modelValue": t[1] || (t[1] = (U) => e.value.uniqueId = U),
253
- label: "Unique ID (TID)"
254
- }, null, 8, ["modelValue"]),
255
- u.value.isOutdated ? (y(), V("span", ie, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : N("", !0)
256
- ], 64)) : (y(), V(G, { key: 1 }, [
257
- v(p, {
258
- modelValue: e.value.developerId,
259
- "onUpdate:modelValue": t[2] || (t[2] = (U) => e.value.developerId = U),
260
- label: "Developer ID (MID)"
261
- }, null, 8, ["modelValue"]),
262
- v(p, {
263
- modelValue: e.value.uniqueId,
264
- "onUpdate:modelValue": t[3] || (t[3] = (U) => e.value.uniqueId = U),
265
- label: "Unique ID (TID)"
266
- }, null, 8, ["modelValue"]),
267
- v(x, {
268
- modelValue: e.value.isUat,
269
- "onUpdate:modelValue": t[4] || (t[4] = (U) => e.value.isUat = U),
270
- label: "Is UAT (Test)",
271
- value: "1"
272
- }, null, 8, ["modelValue"])
273
- ], 64)),
274
- _("div", ue, [
275
- n.value.gateways && n.value.gateways.length > 0 ? (y(), I(o, {
276
- key: 0,
277
- class: "flex-1",
278
- variant: "secondary",
279
- label: "Delete",
280
- onclick: () => g(0)
281
- }, null, 8, ["onclick"])) : N("", !0),
282
- v(o, {
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" }, pe = /* @__PURE__ */ C({
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(F) {
310
- const { isLoading: c, startAsyncCall: a } = H(), T = F, n = O(() => T.terminal), r = b(), e = b(), m = b(-1), d = b({
311
- terminalId: ""
312
- }), g = () => {
313
- d.value.terminalId = "", m.value = -1;
314
- }, s = () => {
315
- if (a(async () => {
316
- r.value = await A.getRestaurantTerminals(T.terminal.referenceId);
317
- }), !T.terminal.ecrs)
318
- return g();
319
- const t = T.terminal.ecrs.findIndex((p) => p && p.gateway && p.gateway === "FeedMe");
320
- if (t === -1)
321
- return g();
322
- m.value = t;
323
- const i = T.terminal.ecrs.at(t);
324
- i.gateway === "FeedMe" && i.config && (d.value = {
325
- terminalId: i.config.terminalId
326
- });
327
- };
328
- q(n, s), S(s);
329
- const u = P(() => (r.value ?? []).map((t) => ({
330
- label: t.name ?? t._id,
331
- value: t._id
332
- })));
333
- async function l(t) {
334
- var i;
335
- (i = T.terminal.ecrs) == null || i.splice(t, 1), T.onUpdate(T.terminal);
336
- }
337
- return (t, i) => {
338
- const p = f("FmCircularProgress"), x = f("FmSelect"), o = f("FmButton"), w = f("FmForm");
339
- return h(c) ? (y(), V("div", ce, [
340
- v(p, { size: "xxl" })
341
- ])) : (y(), I(w, {
342
- key: 1,
343
- ref: e.value,
344
- class: "flex flex-col gap-16 w-[500px]",
345
- onValidationSuccess: i[1] || (i[1] = () => {
346
- m.value > -1 ? n.value.ecrs[m.value] = { gateway: "FeedMe", config: d.value } : (n.value.ecrs || (n.value.ecrs = []), n.value.ecrs.push({ gateway: "FeedMe", config: d.value })), T.onUpdate(n.value);
347
- })
348
- }, {
349
- default: M(() => [
350
- v(x, {
351
- modelValue: d.value.terminalId,
352
- "onUpdate:modelValue": i[0] || (i[0] = (U) => d.value.terminalId = U),
353
- label: "Terminal ID",
354
- items: u.value,
355
- rules: h(ee)(h(ae).string())
356
- }, null, 8, ["modelValue", "items", "rules"]),
357
- _("div", de, [
358
- m.value > -1 ? (y(), I(o, {
359
- key: 0,
360
- class: "flex-1",
361
- variant: "secondary",
362
- label: "Delete",
363
- onclick: () => l(m.value)
364
- }, null, 8, ["onclick"])) : N("", !0),
365
- v(o, {
366
- type: "submit",
367
- class: "flex-1",
368
- variant: "primary",
369
- label: "Save"
370
- })
371
- ])
372
- ]),
373
- _: 1
374
- }, 512));
375
- };
376
- }
377
- }), me = { class: "flex mt-6 space-x-6" }, ve = /* @__PURE__ */ C({
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(F) {
390
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b({
391
- merchantId: "",
392
- terminalId: "",
393
- privateKey: ""
394
- }), e = () => {
395
- r.value.merchantId = "", r.value.terminalId = "", r.value.privateKey = "", n.value = -1;
396
- }, m = () => {
397
- if (!a.value.ecrs)
398
- return e();
399
- const g = a.value.ecrs.findIndex((u) => u && u.gateway && u.gateway === "Ghl");
400
- if (g === -1)
401
- return e();
402
- n.value = g;
403
- const s = a.value.ecrs.at(g);
404
- s.gateway === "Ghl" && s.config && (r.value = {
405
- merchantId: s.config.merchantId,
406
- terminalId: s.config.terminalId,
407
- privateKey: s.config.privateKey || ""
408
- });
409
- };
410
- q(a, m), S(m);
411
- async function d(g) {
412
- var s;
413
- (s = a.value.ecrs) == null || s.splice(g, 1), c.onUpdate(a.value);
414
- }
415
- return (g, s) => {
416
- const u = f("FmTextField"), l = f("FmTextarea"), t = f("FmButton"), i = f("FmForm");
417
- return y(), I(i, {
418
- ref: T.value,
419
- class: "flex flex-col gap-16 w-[500px]",
420
- onValidationSuccess: s[3] || (s[3] = () => {
421
- n.value > -1 ? a.value.ecrs[n.value] = { gateway: "Ghl", config: r.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: r.value })), c.onUpdate(a.value);
422
- })
423
- }, {
424
- default: M(() => [
425
- v(u, {
426
- modelValue: r.value.merchantId,
427
- "onUpdate:modelValue": s[0] || (s[0] = (p) => r.value.merchantId = p),
428
- label: "Merchant ID"
429
- }, null, 8, ["modelValue"]),
430
- v(u, {
431
- modelValue: r.value.terminalId,
432
- "onUpdate:modelValue": s[1] || (s[1] = (p) => r.value.terminalId = p),
433
- label: "Terminal ID"
434
- }, null, 8, ["modelValue"]),
435
- v(l, {
436
- modelValue: r.value.privateKey,
437
- "onUpdate:modelValue": s[2] || (s[2] = (p) => r.value.privateKey = p),
438
- label: "Private Key",
439
- "label-mark": "optional",
440
- "label-info": "Default will use FeedMe Private Key"
441
- }, null, 8, ["modelValue"]),
442
- _("div", me, [
443
- n.value > -1 ? (y(), I(t, {
444
- key: 0,
445
- class: "flex-1",
446
- variant: "secondary",
447
- label: "Delete",
448
- onclick: () => d(n.value)
449
- }, null, 8, ["onclick"])) : N("", !0),
450
- v(t, {
451
- type: "submit",
452
- class: "flex-1",
453
- variant: "primary",
454
- label: "Save"
455
- })
456
- ])
457
- ]),
458
- _: 1
459
- }, 512);
460
- };
461
- }
462
- }), fe = { class: "flex items-end" }, ye = { class: "flex flex-wrap gap-8 items-center mt-4" }, ge = { class: "flex mt-6 space-x-6" }, be = /* @__PURE__ */ C({
463
- __name: "MaybankGateway",
464
- props: {
465
- terminal: {
466
- type: Object,
467
- required: !0
468
- },
469
- onUpdate: {
470
- type: Function,
471
- required: !0
472
- }
473
- },
474
- setup(F) {
475
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
476
- ip: "",
477
- receiptName: "",
478
- cardTypes: []
479
- }), m = () => {
480
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
481
- }, d = () => {
482
- var i;
483
- if (!a.value.ecrIntegrations)
484
- return m();
485
- const u = a.value.ecrIntegrations, l = u.findIndex((p) => p && p.gateway && p.gateway === "Maybank");
486
- if (l === -1)
487
- return m();
488
- n.value = l;
489
- const t = u.at(l);
490
- t.gateway === "Maybank" && t.config && (e.value = {
491
- ip: t.config.ip ?? "",
492
- receiptName: t.receiptName ?? "",
493
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
494
- });
495
- };
496
- q(a, d), S(d);
497
- async function g(u) {
498
- var l;
499
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
500
- }
501
- async function s() {
502
- e.value.cardTypes.push(r.value), r.value = "";
503
- }
504
- return (u, l) => {
505
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
506
- return y(), I(x, {
507
- ref: T.value,
508
- class: "flex flex-col gap-16 w-[500px]",
509
- onValidationSuccess: l[3] || (l[3] = () => {
510
- var o, w;
511
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
512
- gateway: "Maybank",
513
- config: { ip: e.value.ip },
514
- receiptName: e.value.receiptName,
515
- dialogConfig: {
516
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
517
- cardTypes: e.value.cardTypes
518
- }
519
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
520
- gateway: "Maybank",
521
- config: { ip: e.value.ip },
522
- receiptName: e.value.receiptName,
523
- dialogConfig: {
524
- cardTypes: e.value.cardTypes
525
- }
526
- })), c.onUpdate(a.value);
527
- })
528
- }, {
529
- default: M(() => [
530
- v(t, {
531
- modelValue: e.value.ip,
532
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.ip = o),
533
- label: "IP Address"
534
- }, null, 8, ["modelValue"]),
535
- v(t, {
536
- modelValue: e.value.receiptName,
537
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e.value.receiptName = o),
538
- label: "Receipt Payment Name",
539
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
540
- }, null, 8, ["modelValue"]),
541
- _("div", fe, [
542
- v(t, {
543
- modelValue: r.value,
544
- "onUpdate:modelValue": l[2] || (l[2] = (o) => r.value = o),
545
- label: "Fallback Card Types",
546
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
547
- }, null, 8, ["modelValue"]),
548
- v(i, {
549
- class: "ml-4",
550
- icon: "add",
551
- onClick: s
552
- })
553
- ]),
554
- _("div", ye, [
555
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
556
- key: o,
557
- label: o,
558
- removable: !0,
559
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
560
- }, null, 8, ["label", "onChipClosed"]))), 128))
561
- ]),
562
- _("div", ge, [
563
- n.value > -1 ? (y(), I(i, {
564
- key: 0,
565
- class: "flex-1",
566
- variant: "secondary",
567
- label: "Delete",
568
- onclick: () => g(n.value)
569
- }, null, 8, ["onclick"])) : N("", !0),
570
- v(i, {
571
- type: "submit",
572
- class: "flex-1",
573
- variant: "primary",
574
- label: "Save"
575
- })
576
- ])
577
- ]),
578
- _: 1
579
- }, 512);
580
- };
581
- }
582
- }), _e = { class: "flex items-end" }, Te = { class: "flex flex-wrap gap-8 items-center mt-4" }, Fe = { class: "flex mt-6 space-x-6" }, Ie = /* @__PURE__ */ C({
583
- __name: "Maybank2Gateway",
584
- props: {
585
- terminal: {
586
- type: Object,
587
- required: !0
588
- },
589
- onUpdate: {
590
- type: Function,
591
- required: !0
592
- }
593
- },
594
- setup(F) {
595
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
596
- ip: "",
597
- receiptName: "",
598
- cardTypes: []
599
- }), m = () => {
600
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
601
- }, d = () => {
602
- var i;
603
- if (!a.value.ecrIntegrations)
604
- return m();
605
- const u = a.value.ecrIntegrations, l = u.findIndex((p) => p && p.gateway && p.gateway === "Maybank2");
606
- if (l === -1)
607
- return m();
608
- n.value = l;
609
- const t = u.at(l);
610
- t.gateway === "Maybank2" && t.config && (e.value = {
611
- ip: t.config.ip ?? "",
612
- receiptName: t.receiptName ?? "",
613
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
614
- });
615
- };
616
- q(a, d), S(d);
617
- async function g(u) {
618
- var l;
619
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
620
- }
621
- async function s() {
622
- e.value.cardTypes.push(r.value), r.value = "";
623
- }
624
- return (u, l) => {
625
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
626
- return y(), I(x, {
627
- ref: T.value,
628
- class: "flex flex-col gap-16 w-[500px]",
629
- onValidationSuccess: l[3] || (l[3] = () => {
630
- var o, w;
631
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
632
- gateway: "Maybank2",
633
- config: { ip: e.value.ip },
634
- receiptName: e.value.receiptName,
635
- dialogConfig: {
636
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
637
- cardTypes: e.value.cardTypes
638
- }
639
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
640
- gateway: "Maybank2",
641
- config: { ip: e.value.ip },
642
- receiptName: e.value.receiptName,
643
- dialogConfig: {
644
- cardTypes: e.value.cardTypes
645
- }
646
- })), c.onUpdate(a.value);
647
- })
648
- }, {
649
- default: M(() => [
650
- v(t, {
651
- modelValue: e.value.ip,
652
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.ip = o),
653
- label: "IP Address"
654
- }, null, 8, ["modelValue"]),
655
- v(t, {
656
- modelValue: e.value.receiptName,
657
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e.value.receiptName = o),
658
- label: "Receipt Payment Name",
659
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
660
- }, null, 8, ["modelValue"]),
661
- _("div", _e, [
662
- v(t, {
663
- modelValue: r.value,
664
- "onUpdate:modelValue": l[2] || (l[2] = (o) => r.value = o),
665
- label: "Fallback Card Types",
666
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
667
- }, null, 8, ["modelValue"]),
668
- v(i, {
669
- class: "ml-4",
670
- icon: "add",
671
- onClick: s
672
- })
673
- ]),
674
- _("div", Te, [
675
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
676
- key: o,
677
- label: o,
678
- removable: !0,
679
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
680
- }, null, 8, ["label", "onChipClosed"]))), 128))
681
- ]),
682
- _("div", Fe, [
683
- n.value > -1 ? (y(), I(i, {
684
- key: 0,
685
- class: "flex-1",
686
- variant: "secondary",
687
- label: "Delete",
688
- onclick: () => g(n.value)
689
- }, null, 8, ["onclick"])) : N("", !0),
690
- v(i, {
691
- type: "submit",
692
- class: "flex-1",
693
- variant: "primary",
694
- label: "Save"
695
- })
696
- ])
697
- ]),
698
- _: 1
699
- }, 512);
700
- };
701
- }
702
- }), we = { class: "flex items-end" }, xe = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ne = { class: "flex mt-6 space-x-6" }, Ce = /* @__PURE__ */ C({
703
- __name: "Maybank3Gateway",
704
- props: {
705
- terminal: {
706
- type: Object,
707
- required: !0
708
- },
709
- onUpdate: {
710
- type: Function,
711
- required: !0
712
- }
713
- },
714
- setup(F) {
715
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
716
- receiptName: "",
717
- config: {},
718
- cardTypes: []
719
- }), m = () => {
720
- e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
721
- }, d = () => {
722
- var i;
723
- if (!a.value.ecrIntegrations)
724
- return m();
725
- const u = a.value.ecrIntegrations, l = u.findIndex((p) => p && p.gateway && p.gateway === "Maybank3");
726
- if (l === -1)
727
- return m();
728
- n.value = l;
729
- const t = u.at(l);
730
- t.gateway === "Maybank3" && t.config && (e.value = {
731
- config: t.config,
732
- receiptName: t.receiptName ?? "",
733
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
734
- });
735
- };
736
- q(a, d), S(d);
737
- async function g(u) {
738
- var l;
739
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
740
- }
741
- async function s() {
742
- e.value.cardTypes.push(r.value), r.value = "";
743
- }
744
- return (u, l) => {
745
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
746
- return y(), I(x, {
747
- ref: T.value,
748
- class: "flex flex-col gap-16 w-[500px]",
749
- onValidationSuccess: l[2] || (l[2] = () => {
750
- var o, w;
751
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
752
- gateway: "Maybank3",
753
- config: e.value.config,
754
- receiptName: e.value.receiptName,
755
- dialogConfig: {
756
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
757
- cardTypes: e.value.cardTypes
758
- }
759
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
760
- gateway: "Maybank3",
761
- config: e.value.config,
762
- receiptName: e.value.receiptName,
763
- dialogConfig: {
764
- cardTypes: e.value.cardTypes
765
- }
766
- })), c.onUpdate(a.value);
767
- })
768
- }, {
769
- default: M(() => [
770
- v(t, {
771
- modelValue: e.value.receiptName,
772
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.receiptName = o),
773
- label: "Receipt Payment Name",
774
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
775
- }, null, 8, ["modelValue"]),
776
- _("div", we, [
777
- v(t, {
778
- modelValue: r.value,
779
- "onUpdate:modelValue": l[1] || (l[1] = (o) => r.value = o),
780
- label: "Fallback Card Types",
781
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
782
- }, null, 8, ["modelValue"]),
783
- v(i, {
784
- class: "ml-4",
785
- icon: "add",
786
- onClick: s
787
- })
788
- ]),
789
- _("div", xe, [
790
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
791
- key: o,
792
- label: o,
793
- removable: !0,
794
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
795
- }, null, 8, ["label", "onChipClosed"]))), 128))
796
- ]),
797
- _("div", Ne, [
798
- n.value > -1 ? (y(), I(i, {
799
- key: 0,
800
- class: "flex-1",
801
- variant: "secondary",
802
- label: "Delete",
803
- onclick: () => g(n.value)
804
- }, null, 8, ["onclick"])) : N("", !0),
805
- v(i, {
806
- type: "submit",
807
- class: "flex-1",
808
- variant: "primary",
809
- label: "Save"
810
- })
811
- ])
812
- ]),
813
- _: 1
814
- }, 512);
815
- };
816
- }
817
- }), ke = { class: "flex items-end" }, Ve = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ue = { class: "flex mt-6 space-x-6" }, Se = /* @__PURE__ */ C({
818
- __name: "NetsGateway",
819
- props: {
820
- terminal: {
821
- type: Object,
822
- required: !0
823
- },
824
- onUpdate: {
825
- type: Function,
826
- required: !0
827
- }
828
- },
829
- setup(F) {
830
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
831
- ip: "",
832
- receiptName: "",
833
- cardTypes: []
834
- }), m = () => {
835
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
836
- }, d = () => {
837
- var i;
838
- if (!a.value.ecrIntegrations)
839
- return m();
840
- const u = a.value.ecrIntegrations, l = u.findIndex((p) => p && p.gateway && p.gateway === "Nets");
841
- if (l === -1)
842
- return m();
843
- n.value = l;
844
- const t = u.at(l);
845
- t.gateway === "Nets" && t.config && (e.value = {
846
- ip: t.config.ip ?? "",
847
- receiptName: t.receiptName ?? "",
848
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
849
- });
850
- };
851
- q(a, d), S(d);
852
- async function g(u) {
853
- var l;
854
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
855
- }
856
- async function s() {
857
- e.value.cardTypes.push(r.value), r.value = "";
858
- }
859
- return (u, l) => {
860
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
861
- return y(), I(x, {
862
- ref: T.value,
863
- class: "flex flex-col gap-16 w-[500px]",
864
- onValidationSuccess: l[3] || (l[3] = () => {
865
- var o, w;
866
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
867
- gateway: "Nets",
868
- config: { ip: e.value.ip },
869
- receiptName: e.value.receiptName,
870
- dialogConfig: {
871
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
872
- cardTypes: e.value.cardTypes
873
- }
874
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
875
- gateway: "Nets",
876
- config: { ip: e.value.ip },
877
- receiptName: e.value.receiptName,
878
- dialogConfig: {
879
- cardTypes: e.value.cardTypes
880
- }
881
- })), c.onUpdate(a.value);
882
- })
883
- }, {
884
- default: M(() => [
885
- v(t, {
886
- modelValue: e.value.ip,
887
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.ip = o),
888
- label: "IP Address"
889
- }, null, 8, ["modelValue"]),
890
- v(t, {
891
- modelValue: e.value.receiptName,
892
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e.value.receiptName = o),
893
- label: "Receipt Payment Name",
894
- "label-info": "Default receipt display will be 'TERMINAL_NETS'"
895
- }, null, 8, ["modelValue"]),
896
- _("div", ke, [
897
- v(t, {
898
- modelValue: r.value,
899
- "onUpdate:modelValue": l[2] || (l[2] = (o) => r.value = o),
900
- label: "Fallback Card Types",
901
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
902
- }, null, 8, ["modelValue"]),
903
- v(i, {
904
- class: "ml-4",
905
- icon: "add",
906
- onClick: s
907
- })
908
- ]),
909
- _("div", Ve, [
910
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
911
- key: o,
912
- label: o,
913
- removable: !0,
914
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
915
- }, null, 8, ["label", "onChipClosed"]))), 128))
916
- ]),
917
- _("div", Ue, [
918
- n.value > -1 ? (y(), I(i, {
919
- key: 0,
920
- class: "flex-1",
921
- variant: "secondary",
922
- label: "Delete",
923
- onclick: () => g(n.value)
924
- }, null, 8, ["onclick"])) : N("", !0),
925
- v(i, {
926
- type: "submit",
927
- class: "flex-1",
928
- variant: "primary",
929
- label: "Save"
930
- })
931
- ])
932
- ]),
933
- _: 1
934
- }, 512);
935
- };
936
- }
937
- }), Me = { class: "flex items-end" }, he = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ge = { class: "flex mt-6 space-x-6" }, Oe = /* @__PURE__ */ C({
938
- __name: "KBankGateway",
939
- props: {
940
- terminal: {
941
- type: Object,
942
- required: !0
943
- },
944
- onUpdate: {
945
- type: Function,
946
- required: !0
947
- }
948
- },
949
- setup(F) {
950
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
951
- receiptName: "",
952
- cardTypes: []
953
- }), m = () => {
954
- e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
955
- }, d = () => {
956
- var i;
957
- if (!a.value.ecrIntegrations)
958
- return m();
959
- const u = a.value.ecrIntegrations, l = u.findIndex((p) => p && p.gateway && p.gateway === "Kbank");
960
- if (l === -1)
961
- return m();
962
- n.value = l;
963
- const t = u.at(l);
964
- t.gateway === "Kbank" && t.config && (e.value = {
965
- receiptName: t.receiptName ?? "",
966
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
967
- });
968
- };
969
- q(a, d), S(d);
970
- async function g(u) {
971
- var l;
972
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
973
- }
974
- async function s() {
975
- e.value.cardTypes.push(r.value), r.value = "";
976
- }
977
- return (u, l) => {
978
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
979
- return y(), I(x, {
980
- ref: T.value,
981
- class: "flex flex-col gap-16 w-[500px]",
982
- onValidationSuccess: l[2] || (l[2] = () => {
983
- var o, w;
984
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
985
- gateway: "Kbank",
986
- config: {},
987
- receiptName: e.value.receiptName,
988
- dialogConfig: {
989
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
990
- cardTypes: e.value.cardTypes
991
- }
992
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
993
- gateway: "Kbank",
994
- config: {},
995
- receiptName: e.value.receiptName,
996
- dialogConfig: {
997
- cardTypes: e.value.cardTypes
998
- }
999
- })), c.onUpdate(a.value);
1000
- })
1001
- }, {
1002
- default: M(() => [
1003
- v(t, {
1004
- modelValue: e.value.receiptName,
1005
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.receiptName = o),
1006
- label: "Receipt Payment Name",
1007
- "label-info": "Default receipt display will be 'TERMINAL_KBANK'"
1008
- }, null, 8, ["modelValue"]),
1009
- _("div", Me, [
1010
- v(t, {
1011
- modelValue: r.value,
1012
- "onUpdate:modelValue": l[1] || (l[1] = (o) => r.value = o),
1013
- label: "Fallback Card Types",
1014
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1015
- }, null, 8, ["modelValue"]),
1016
- v(i, {
1017
- class: "ml-4",
1018
- icon: "add",
1019
- onClick: s
1020
- })
1021
- ]),
1022
- _("div", he, [
1023
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
1024
- key: o,
1025
- label: o,
1026
- removable: !0,
1027
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
1028
- }, null, 8, ["label", "onChipClosed"]))), 128))
1029
- ]),
1030
- _("div", Ge, [
1031
- n.value > -1 ? (y(), I(i, {
1032
- key: 0,
1033
- class: "flex-1",
1034
- variant: "secondary",
1035
- label: "Delete",
1036
- onclick: () => g(n.value)
1037
- }, null, 8, ["onclick"])) : N("", !0),
1038
- v(i, {
1039
- type: "submit",
1040
- class: "flex-1",
1041
- variant: "primary",
1042
- label: "Save"
1043
- })
1044
- ])
1045
- ]),
1046
- _: 1
1047
- }, 512);
1048
- };
1049
- }
1050
- }), qe = { class: "flex mt-6 space-x-6" }, Pe = /* @__PURE__ */ C({
1051
- __name: "Ghl2Gateway",
1052
- props: {
1053
- terminal: {
1054
- type: Object,
1055
- required: !0
1056
- },
1057
- onUpdate: {
1058
- type: Function,
1059
- required: !0
1060
- }
1061
- },
1062
- setup(F) {
1063
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b({
1064
- ip: "",
1065
- receiptName: ""
1066
- }), e = () => {
1067
- r.value.ip = "", r.value.receiptName = "", n.value = -1;
1068
- }, m = () => {
1069
- if (!a.value.ecrIntegrations)
1070
- return e();
1071
- const g = a.value.ecrIntegrations, s = g.findIndex((l) => l && l.gateway && l.gateway === "Ghl2");
1072
- if (s === -1)
1073
- return e();
1074
- n.value = s;
1075
- const u = g.at(s);
1076
- u.gateway === "Ghl2" && u.config && (r.value = {
1077
- ip: u.config.ip ?? "",
1078
- receiptName: u.receiptName ?? ""
1079
- });
1080
- };
1081
- q(a, m), S(m);
1082
- async function d(g) {
1083
- var s;
1084
- (s = a.value.ecrIntegrations) == null || s.splice(g, 1), c.onUpdate(a.value);
1085
- }
1086
- return (g, s) => {
1087
- const u = f("FmTextField"), l = f("FmButton"), t = f("FmForm");
1088
- return y(), I(t, {
1089
- ref: T.value,
1090
- class: "flex flex-col gap-16 w-[500px]",
1091
- onValidationSuccess: s[2] || (s[2] = () => {
1092
- a.value.ecrIntegrations || (a.value.ecrIntegrations = []), n.value > -1 ? a.value.ecrIntegrations[n.value] = {
1093
- gateway: "Ghl2",
1094
- config: { ip: r.value.ip },
1095
- receiptName: r.value.receiptName
1096
- } : a.value.ecrIntegrations.push({
1097
- gateway: "Ghl2",
1098
- config: { ip: r.value.ip },
1099
- receiptName: r.value.receiptName
1100
- }), c.onUpdate(a.value);
1101
- })
1102
- }, {
1103
- default: M(() => [
1104
- v(u, {
1105
- modelValue: r.value.ip,
1106
- "onUpdate:modelValue": s[0] || (s[0] = (i) => r.value.ip = i),
1107
- label: "IP Address"
1108
- }, null, 8, ["modelValue"]),
1109
- v(u, {
1110
- modelValue: r.value.receiptName,
1111
- "onUpdate:modelValue": s[1] || (s[1] = (i) => r.value.receiptName = i),
1112
- label: "Receipt Payment Name",
1113
- "label-info": "Default receipt display will be 'TERMINAL_GHL_2'"
1114
- }, null, 8, ["modelValue"]),
1115
- _("div", qe, [
1116
- n.value > -1 ? (y(), I(l, {
1117
- key: 0,
1118
- class: "flex-1",
1119
- variant: "secondary",
1120
- label: "Delete",
1121
- onclick: () => d(n.value)
1122
- }, null, 8, ["onclick"])) : N("", !0),
1123
- v(l, {
1124
- type: "submit",
1125
- class: "flex-1",
1126
- variant: "primary",
1127
- label: "Save"
1128
- })
1129
- ])
1130
- ]),
1131
- _: 1
1132
- }, 512);
1133
- };
1134
- }
1135
- }), Re = { class: "flex items-end" }, $e = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ae = { class: "flex mt-6 space-x-6" }, De = /* @__PURE__ */ C({
1136
- __name: "Ghl3Gateway",
1137
- props: {
1138
- terminal: {
1139
- type: Object,
1140
- required: !0
1141
- },
1142
- onUpdate: {
1143
- type: Function,
1144
- required: !0
1145
- }
1146
- },
1147
- setup(F) {
1148
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
1149
- receiptName: "",
1150
- config: {},
1151
- cardTypes: []
1152
- }), m = () => {
1153
- e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
1154
- }, d = () => {
1155
- var i;
1156
- if (!a.value.ecrIntegrations)
1157
- return m();
1158
- const u = a.value.ecrIntegrations, l = u.findIndex(
1159
- (p) => p && p.gateway && p.gateway === "Ghl3"
1160
- );
1161
- if (l === -1)
1162
- return m();
1163
- n.value = l;
1164
- const t = u.at(l);
1165
- t.gateway === "Ghl3" && t.config && (e.value = {
1166
- config: t.config,
1167
- receiptName: t.receiptName ?? "",
1168
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1169
- });
1170
- };
1171
- q(a, d), S(d);
1172
- async function g(u) {
1173
- var l;
1174
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
1175
- }
1176
- async function s() {
1177
- e.value.cardTypes.push(r.value), r.value = "";
1178
- }
1179
- return (u, l) => {
1180
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
1181
- return y(), I(x, {
1182
- ref: T.value,
1183
- class: "flex flex-col gap-16 w-[500px]",
1184
- onValidationSuccess: l[2] || (l[2] = () => {
1185
- var o, w;
1186
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
1187
- gateway: "Ghl3",
1188
- config: e.value.config,
1189
- receiptName: e.value.receiptName,
1190
- dialogConfig: {
1191
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
1192
- cardTypes: e.value.cardTypes
1193
- }
1194
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1195
- gateway: "Ghl3",
1196
- config: e.value.config,
1197
- receiptName: e.value.receiptName,
1198
- dialogConfig: {
1199
- cardTypes: e.value.cardTypes
1200
- }
1201
- })), c.onUpdate(a.value);
1202
- })
1203
- }, {
1204
- default: M(() => [
1205
- v(t, {
1206
- modelValue: e.value.receiptName,
1207
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.receiptName = o),
1208
- label: "Receipt Payment Name",
1209
- "label-info": "Default receipt display will be 'TERMINAL_GHL'"
1210
- }, null, 8, ["modelValue"]),
1211
- _("div", Re, [
1212
- v(t, {
1213
- modelValue: r.value,
1214
- "onUpdate:modelValue": l[1] || (l[1] = (o) => r.value = o),
1215
- label: "Fallback Card Types",
1216
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1217
- }, null, 8, ["modelValue"]),
1218
- v(i, {
1219
- class: "ml-4",
1220
- icon: "add",
1221
- onClick: s
1222
- })
1223
- ]),
1224
- _("div", $e, [
1225
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
1226
- key: o,
1227
- label: o,
1228
- removable: !0,
1229
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
1230
- }, null, 8, ["label", "onChipClosed"]))), 128))
1231
- ]),
1232
- _("div", Ae, [
1233
- n.value > -1 ? (y(), I(i, {
1234
- key: 0,
1235
- class: "flex-1",
1236
- variant: "secondary",
1237
- label: "Delete",
1238
- onclick: () => g(n.value)
1239
- }, null, 8, ["onclick"])) : N("", !0),
1240
- v(i, {
1241
- type: "submit",
1242
- class: "flex-1",
1243
- variant: "primary",
1244
- label: "Save"
1245
- })
1246
- ])
1247
- ]),
1248
- _: 1
1249
- }, 512);
1250
- };
1251
- }
1252
- }), Be = { class: "flex items-end" }, Ye = { class: "flex flex-wrap gap-8 items-center mt-4" }, Le = { class: "flex mt-6 space-x-6" }, Ke = /* @__PURE__ */ C({
1253
- __name: "HlbbGateway",
1254
- props: {
1255
- terminal: {
1256
- type: Object,
1257
- required: !0
1258
- },
1259
- onUpdate: {
1260
- type: Function,
1261
- required: !0
1262
- }
1263
- },
1264
- setup(F) {
1265
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
1266
- receiptName: "",
1267
- config: {},
1268
- cardTypes: []
1269
- }), m = () => {
1270
- e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
1271
- }, d = () => {
1272
- var i;
1273
- if (!a.value.ecrIntegrations)
1274
- return m();
1275
- const u = a.value.ecrIntegrations, l = u.findIndex(
1276
- (p) => p && p.gateway && p.gateway === "Hlbb"
1277
- );
1278
- if (l === -1)
1279
- return m();
1280
- n.value = l;
1281
- const t = u.at(l);
1282
- t.gateway === "Hlbb" && t.config && (e.value = {
1283
- config: t.config,
1284
- receiptName: t.receiptName ?? "",
1285
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1286
- });
1287
- };
1288
- q(a, d), S(d);
1289
- async function g(u) {
1290
- var l;
1291
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
1292
- }
1293
- async function s() {
1294
- e.value.cardTypes.push(r.value), r.value = "";
1295
- }
1296
- return (u, l) => {
1297
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
1298
- return y(), I(x, {
1299
- ref: T.value,
1300
- class: "flex flex-col gap-16 w-[500px]",
1301
- onValidationSuccess: l[2] || (l[2] = () => {
1302
- var o, w;
1303
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
1304
- gateway: "Hlbb",
1305
- config: e.value.config,
1306
- receiptName: e.value.receiptName,
1307
- dialogConfig: {
1308
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
1309
- cardTypes: e.value.cardTypes
1310
- }
1311
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1312
- gateway: "Hlbb",
1313
- config: e.value.config,
1314
- receiptName: e.value.receiptName,
1315
- dialogConfig: {
1316
- cardTypes: e.value.cardTypes
1317
- }
1318
- })), c.onUpdate(a.value);
1319
- })
1320
- }, {
1321
- default: M(() => [
1322
- v(t, {
1323
- modelValue: e.value.receiptName,
1324
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.receiptName = o),
1325
- label: "Receipt Payment Name",
1326
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1327
- }, null, 8, ["modelValue"]),
1328
- _("div", Be, [
1329
- v(t, {
1330
- modelValue: r.value,
1331
- "onUpdate:modelValue": l[1] || (l[1] = (o) => r.value = o),
1332
- label: "Fallback Card Types",
1333
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1334
- }, null, 8, ["modelValue"]),
1335
- v(i, {
1336
- class: "ml-4",
1337
- icon: "add",
1338
- onClick: s
1339
- })
1340
- ]),
1341
- _("div", Ye, [
1342
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
1343
- key: o,
1344
- label: o,
1345
- removable: !0,
1346
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
1347
- }, null, 8, ["label", "onChipClosed"]))), 128))
1348
- ]),
1349
- _("div", Le, [
1350
- n.value > -1 ? (y(), I(i, {
1351
- key: 0,
1352
- class: "flex-1",
1353
- variant: "secondary",
1354
- label: "Delete",
1355
- onclick: () => g(n.value)
1356
- }, null, 8, ["onclick"])) : N("", !0),
1357
- v(i, {
1358
- type: "submit",
1359
- class: "flex-1",
1360
- variant: "primary",
1361
- label: "Save"
1362
- })
1363
- ])
1364
- ]),
1365
- _: 1
1366
- }, 512);
1367
- };
1368
- }
1369
- }), Ee = { class: "flex items-end" }, je = { class: "flex flex-wrap gap-8 items-center mt-4" }, He = { class: "flex mt-6 space-x-6" }, ze = /* @__PURE__ */ C({
1370
- __name: "GlobalPaymentsGateway",
1371
- props: {
1372
- terminal: {
1373
- type: Object,
1374
- required: !0
1375
- },
1376
- onUpdate: {
1377
- type: Function,
1378
- required: !0
1379
- }
1380
- },
1381
- setup(F) {
1382
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
1383
- ip: "",
1384
- receiptName: "",
1385
- cardTypes: []
1386
- }), m = () => {
1387
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
1388
- }, d = () => {
1389
- var i;
1390
- if (!a.value.ecrIntegrations)
1391
- return m();
1392
- const u = a.value.ecrIntegrations, l = u.findIndex(
1393
- (p) => p && p.gateway && p.gateway === "GlobalPayments"
1394
- );
1395
- if (l === -1)
1396
- return m();
1397
- n.value = l;
1398
- const t = u.at(l);
1399
- t.gateway === "GlobalPayments" && t.config && (e.value = {
1400
- ip: t.config.ip ?? "",
1401
- receiptName: t.receiptName ?? "",
1402
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1403
- });
1404
- };
1405
- q(a, d), S(d);
1406
- async function g(u) {
1407
- var l;
1408
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
1409
- }
1410
- async function s() {
1411
- e.value.cardTypes.push(r.value), r.value = "";
1412
- }
1413
- return (u, l) => {
1414
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
1415
- return y(), I(x, {
1416
- ref: T.value,
1417
- class: "flex flex-col gap-16 w-[500px]",
1418
- onValidationSuccess: l[3] || (l[3] = () => {
1419
- var o, w;
1420
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
1421
- gateway: "GlobalPayments",
1422
- config: { ip: e.value.ip },
1423
- receiptName: e.value.receiptName,
1424
- dialogConfig: {
1425
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
1426
- cardTypes: e.value.cardTypes
1427
- }
1428
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1429
- gateway: "GlobalPayments",
1430
- config: { ip: e.value.ip },
1431
- receiptName: e.value.receiptName,
1432
- dialogConfig: {
1433
- cardTypes: e.value.cardTypes
1434
- }
1435
- })), c.onUpdate(a.value);
1436
- })
1437
- }, {
1438
- default: M(() => [
1439
- v(t, {
1440
- modelValue: e.value.ip,
1441
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.ip = o),
1442
- label: "IP Address"
1443
- }, null, 8, ["modelValue"]),
1444
- v(t, {
1445
- modelValue: e.value.receiptName,
1446
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e.value.receiptName = o),
1447
- label: "Receipt Payment Name",
1448
- "label-info": "Default receipt display will be 'TERMINAL_GP'"
1449
- }, null, 8, ["modelValue"]),
1450
- _("div", Ee, [
1451
- v(t, {
1452
- modelValue: r.value,
1453
- "onUpdate:modelValue": l[2] || (l[2] = (o) => r.value = o),
1454
- label: "Fallback Card Types",
1455
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1456
- }, null, 8, ["modelValue"]),
1457
- v(i, {
1458
- class: "ml-4",
1459
- icon: "add",
1460
- onClick: s
1461
- })
1462
- ]),
1463
- _("div", je, [
1464
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
1465
- key: o,
1466
- label: o,
1467
- removable: !0,
1468
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
1469
- }, null, 8, ["label", "onChipClosed"]))), 128))
1470
- ]),
1471
- _("div", He, [
1472
- n.value > -1 ? (y(), I(i, {
1473
- key: 0,
1474
- class: "flex-1",
1475
- variant: "secondary",
1476
- label: "Delete",
1477
- onclick: () => g(n.value)
1478
- }, null, 8, ["onclick"])) : N("", !0),
1479
- v(i, {
1480
- type: "submit",
1481
- class: "flex-1",
1482
- variant: "primary",
1483
- label: "Save"
1484
- })
1485
- ])
1486
- ]),
1487
- _: 1
1488
- }, 512);
1489
- };
1490
- }
1491
- }), Qe = { class: "flex items-end" }, Je = { class: "flex flex-wrap gap-8 items-center mt-4" }, We = { class: "flex mt-6 space-x-6" }, Xe = /* @__PURE__ */ C({
1492
- __name: "OmaGateway",
1493
- props: {
1494
- terminal: {
1495
- type: Object,
1496
- required: !0
1497
- },
1498
- onUpdate: {
1499
- type: Function,
1500
- required: !0
1501
- }
1502
- },
1503
- setup(F) {
1504
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b(), e = b({
1505
- receiptName: "",
1506
- cardTypes: []
1507
- }), m = () => {
1508
- e.value.receiptName = "", e.value.cardTypes = [], n.value = -1;
1509
- }, d = () => {
1510
- var i;
1511
- if (!a.value.ecrIntegrations)
1512
- return m();
1513
- const u = a.value.ecrIntegrations, l = u.findIndex(
1514
- (p) => p && p.gateway && p.gateway === "Oma"
1515
- );
1516
- if (l === -1)
1517
- return m();
1518
- n.value = l;
1519
- const t = u.at(l);
1520
- t.gateway === "Oma" && t.config && (e.value = {
1521
- receiptName: t.receiptName ?? "",
1522
- cardTypes: ((i = t.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1523
- });
1524
- };
1525
- q(a, d), S(d);
1526
- async function g(u) {
1527
- var l;
1528
- (l = a.value.ecrIntegrations) == null || l.splice(u, 1), c.onUpdate(a.value);
1529
- }
1530
- async function s() {
1531
- e.value.cardTypes.push(r.value), r.value = "";
1532
- }
1533
- return (u, l) => {
1534
- const t = f("FmTextField"), i = f("FmButton"), p = f("FmChip"), x = f("FmForm");
1535
- return y(), I(x, {
1536
- ref: T.value,
1537
- class: "flex flex-col gap-16 w-[500px]",
1538
- onValidationSuccess: l[2] || (l[2] = () => {
1539
- var o, w;
1540
- n.value > -1 ? a.value.ecrIntegrations[n.value] = {
1541
- gateway: "Oma",
1542
- config: {},
1543
- receiptName: e.value.receiptName,
1544
- dialogConfig: {
1545
- ...(w = (o = a.value.ecrIntegrations) == null ? void 0 : o[n.value]) == null ? void 0 : w.dialogConfig,
1546
- cardTypes: e.value.cardTypes
1547
- }
1548
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1549
- gateway: "Oma",
1550
- config: {},
1551
- receiptName: e.value.receiptName,
1552
- dialogConfig: {
1553
- cardTypes: e.value.cardTypes
1554
- }
1555
- })), c.onUpdate(a.value);
1556
- })
1557
- }, {
1558
- default: M(() => [
1559
- v(t, {
1560
- modelValue: e.value.receiptName,
1561
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.receiptName = o),
1562
- label: "Receipt Payment Name",
1563
- "label-info": "Default receipt display will be 'TERMINAL_OMA'"
1564
- }, null, 8, ["modelValue"]),
1565
- _("div", Qe, [
1566
- v(t, {
1567
- modelValue: r.value,
1568
- "onUpdate:modelValue": l[1] || (l[1] = (o) => r.value = o),
1569
- label: "Fallback Card Types",
1570
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1571
- }, null, 8, ["modelValue"]),
1572
- v(i, {
1573
- class: "ml-4",
1574
- icon: "add",
1575
- onClick: s
1576
- })
1577
- ]),
1578
- _("div", Je, [
1579
- (y(!0), V(G, null, R(e.value.cardTypes, (o) => (y(), I(p, {
1580
- key: o,
1581
- label: o,
1582
- removable: !0,
1583
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(o), 1)
1584
- }, null, 8, ["label", "onChipClosed"]))), 128))
1585
- ]),
1586
- _("div", We, [
1587
- n.value > -1 ? (y(), I(i, {
1588
- key: 0,
1589
- class: "flex-1",
1590
- variant: "secondary",
1591
- label: "Delete",
1592
- onclick: () => g(n.value)
1593
- }, null, 8, ["onclick"])) : N("", !0),
1594
- v(i, {
1595
- type: "submit",
1596
- class: "flex-1",
1597
- variant: "primary",
1598
- label: "Save"
1599
- })
1600
- ])
1601
- ]),
1602
- _: 1
1603
- }, 512);
1604
- };
1605
- }
1606
- }), Ze = { class: "flex items-center" }, ea = { class: "w-[260px] self-start" }, aa = { class: "flex-1" }, la = /* @__PURE__ */ C({
1607
- __name: "EcrGateway",
1608
- props: {
1609
- terminal: {
1610
- type: Object,
1611
- required: !0
1612
- },
1613
- onUpdate: {
1614
- type: Function,
1615
- required: !0
1616
- }
1617
- },
1618
- setup(F) {
1619
- var m;
1620
- const c = F, a = [
1621
- {
1622
- label: "FeedMe Terminal",
1623
- value: "terminal",
1624
- render: pe
1625
- },
1626
- {
1627
- label: "GHL Terminal",
1628
- value: "ghl",
1629
- render: ve,
1630
- region: [k.F_COUNTRY.enum.MY]
1631
- },
1632
- {
1633
- label: "GHL2 Terminal",
1634
- value: "ghl2",
1635
- render: Pe,
1636
- region: [k.F_COUNTRY.enum.MY]
1637
- },
1638
- {
1639
- label: "ITB Maybank Terminal",
1640
- value: "mb-itb",
1641
- render: be,
1642
- region: [k.F_COUNTRY.enum.MY]
1643
- },
1644
- {
1645
- label: "PMA Maybank Terminal",
1646
- value: "mb-pma",
1647
- render: Ie,
1648
- region: [k.F_COUNTRY.enum.MY]
1649
- },
1650
- {
1651
- label: "Paysys Maybank Terminal",
1652
- value: "mb-paysys",
1653
- render: Ce,
1654
- region: [k.F_COUNTRY.enum.MY]
1655
- },
1656
- {
1657
- label: "Nets Terminal",
1658
- value: "nets",
1659
- render: Se,
1660
- region: [k.F_COUNTRY.enum.SG]
1661
- },
1662
- {
1663
- label: "KBank Terminal",
1664
- value: "kbank",
1665
- render: Oe,
1666
- region: [k.F_COUNTRY.enum.TH]
1667
- },
1668
- {
1669
- label: "GHL Terminal",
1670
- value: "ghl3",
1671
- render: De,
1672
- region: [k.F_COUNTRY.enum.TH]
1673
- },
1674
- {
1675
- label: "Paysys HLBB Terminal",
1676
- value: "hlbb",
1677
- render: Ke,
1678
- region: [k.F_COUNTRY.enum.MY]
1679
- },
1680
- {
1681
- label: "GPAP Terminal",
1682
- value: "globalpayments",
1683
- render: ze,
1684
- region: [k.F_COUNTRY.enum.SG]
1685
- },
1686
- {
1687
- label: "OMA Terminal",
1688
- value: "oma",
1689
- render: Xe,
1690
- region: [k.F_COUNTRY.enum.PK]
1691
- }
1692
- ], T = P(() => a.find((d) => d.value === e.value)), n = j().currentCountry, r = P(() => a.filter(
1693
- (d) => !d.region || d.region.includes(n.value ?? k.F_COUNTRY.enum.MY)
1694
- )), { gatewayTab: e } = E({
1695
- gatewayTab: (m = r.value[0]) == null ? void 0 : m.value
1696
- });
1697
- return (d, g) => {
1698
- var u;
1699
- const s = f("FmTabs");
1700
- return y(), V("div", Ze, [
1701
- _("div", ea, [
1702
- v(s, {
1703
- "model-value": h(e),
1704
- "onUpdate:modelValue": g[0] || (g[0] = (l) => B(e) ? e.value = l : null),
1705
- class: "mb-6",
1706
- vertical: !0,
1707
- items: r.value,
1708
- "show-more-at": Number.POSITIVE_INFINITY
1709
- }, null, 8, ["model-value", "items", "show-more-at"])
1710
- ]),
1711
- _("div", aa, [
1712
- h(e) ? (y(), I(Y((u = T.value) == null ? void 0 : u.render), L(K({ key: 0 }, {
1713
- terminal: c.terminal,
1714
- onUpdate: c.onUpdate
1715
- })), null, 16)) : N("", !0)
1716
- ])
1717
- ]);
1718
- };
1719
- }
1720
- }), ta = { class: "flex mt-6 space-x-6" }, na = /* @__PURE__ */ C({
1721
- __name: "PromptPayGateway",
1722
- props: {
1723
- terminal: {
1724
- type: Object,
1725
- required: !0
1726
- },
1727
- onUpdate: {
1728
- type: Function,
1729
- required: !0
1730
- }
1731
- },
1732
- setup(F) {
1733
- const c = F, a = O(() => c.terminal), T = b(), n = b(-1), r = b({
1734
- account: "",
1735
- receiptName: ""
1736
- }), e = () => {
1737
- r.value.account = "", r.value.receiptName = "", n.value = -1;
1738
- }, m = () => {
1739
- if (!a.value.qrIntegrations)
1740
- return e();
1741
- const g = a.value.qrIntegrations, s = g.findIndex((l) => l && l.gateway && l.gateway === "PROMPTPAY");
1742
- if (s === -1)
1743
- return e();
1744
- n.value = s;
1745
- const u = g.at(s);
1746
- u.gateway === "PROMPTPAY" && u.config && (r.value = {
1747
- account: u.config.account ?? "",
1748
- receiptName: u.receiptName ?? ""
1749
- });
1750
- };
1751
- q(a, m), S(m);
1752
- async function d(g) {
1753
- var s;
1754
- (s = a.value.qrIntegrations) == null || s.splice(g, 1), c.onUpdate(a.value);
1755
- }
1756
- return (g, s) => {
1757
- const u = f("FmTextField"), l = f("FmButton"), t = f("FmForm");
1758
- return y(), I(t, {
1759
- ref: T.value,
1760
- class: "flex flex-col gap-16 w-[500px]",
1761
- onValidationSuccess: s[2] || (s[2] = () => {
1762
- n.value > -1 ? a.value.qrIntegrations[n.value] = { gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName } : (a.value.qrIntegrations || (a.value.qrIntegrations = []), a.value.qrIntegrations.push({ gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName })), c.onUpdate(a.value);
1763
- })
1764
- }, {
1765
- default: M(() => [
1766
- v(u, {
1767
- modelValue: r.value.account,
1768
- "onUpdate:modelValue": s[0] || (s[0] = (i) => r.value.account = i),
1769
- label: "Thai Phone Number / Thai Naitonal ID",
1770
- "label-info": "Thai Phone Number can be prefixed with 66 or 0 will be fine both will works well."
1771
- }, null, 8, ["modelValue"]),
1772
- v(u, {
1773
- modelValue: r.value.receiptName,
1774
- "onUpdate:modelValue": s[1] || (s[1] = (i) => r.value.receiptName = i),
1775
- label: "Receipt Payment Name",
1776
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1777
- }, null, 8, ["modelValue"]),
1778
- _("div", ta, [
1779
- n.value > -1 ? (y(), I(l, {
1780
- key: 0,
1781
- class: "flex-1",
1782
- variant: "secondary",
1783
- label: "Delete",
1784
- onclick: () => d(n.value)
1785
- }, null, 8, ["onclick"])) : N("", !0),
1786
- v(l, {
1787
- type: "submit",
1788
- class: "flex-1",
1789
- variant: "primary",
1790
- label: "Save"
1791
- })
1792
- ])
1793
- ]),
1794
- _: 1
1795
- }, 512);
1796
- };
1797
- }
1798
- }), oa = { class: "flex items-center" }, ra = { class: "w-[260px] self-start" }, ia = { class: "flex-1" }, ua = /* @__PURE__ */ C({
1799
- __name: "QrGateway",
1800
- props: {
1801
- terminal: {
1802
- type: Object,
1803
- required: !0
1804
- },
1805
- onUpdate: {
1806
- type: Function,
1807
- required: !0
1808
- }
1809
- },
1810
- setup(F) {
1811
- var m;
1812
- const c = F, a = [
1813
- {
1814
- label: "PromptPay",
1815
- value: "promptpay",
1816
- render: na,
1817
- region: [k.F_COUNTRY.enum.TH]
1818
- }
1819
- ], T = P(() => a.find((d) => d.value === e.value)), n = j().currentCountry, r = P(() => a.filter((d) => !d.region || d.region.includes(n.value ?? k.F_COUNTRY.enum.MY))), { gatewayTab: e } = E({
1820
- gatewayTab: (m = r.value[0]) == null ? void 0 : m.value
1821
- });
1822
- return (d, g) => {
1823
- var u;
1824
- const s = f("FmTabs");
1825
- return y(), V("div", oa, [
1826
- _("div", ra, [
1827
- v(s, {
1828
- "model-value": h(e),
1829
- "onUpdate:modelValue": g[0] || (g[0] = (l) => B(e) ? e.value = l : null),
1830
- class: "mb-6",
1831
- vertical: !0,
1832
- items: r.value
1833
- }, null, 8, ["model-value", "items"])
1834
- ]),
1835
- _("div", ia, [
1836
- h(e) ? (y(), I(Y((u = T.value) == null ? void 0 : u.render), L(K({ key: 0 }, {
1837
- terminal: c.terminal,
1838
- onUpdate: c.onUpdate
1839
- })), null, 16)) : N("", !0)
1840
- ])
1841
- ]);
1842
- };
1843
- }
1844
- }), _a = /* @__PURE__ */ C({
1845
- __name: "TerminalSetting",
1846
- props: {
1847
- terminalId: {
1848
- type: String,
1849
- required: !0
1850
- }
1851
- },
1852
- setup(F) {
1853
- const c = F, { tab: a } = E({
1854
- tab: "information"
1855
- }), { isLoading: T, startAsyncCall: n } = H(!0), r = W(), e = Q(), m = b();
1856
- async function d(t) {
1857
- n(async () => {
1858
- try {
1859
- await A.updateById(
1860
- c.terminalId,
1861
- {
1862
- name: t.name,
1863
- status: t.status,
1864
- ecrs: t.ecrs ?? [],
1865
- gateways: t.gateways ?? [],
1866
- ecrIntegrations: t.ecrIntegrations ?? [],
1867
- qrIntegrations: t.qrIntegrations ?? []
1868
- }
1869
- ), m.value = await A.readById(c.terminalId), e.open({
1870
- type: "success",
1871
- message: "Terminal updated successfully"
1872
- });
1873
- } catch (i) {
1874
- e.open({
1875
- type: "error",
1876
- title: "Error occurs when update terminal",
1877
- message: Z(i)
1878
- });
1879
- }
1880
- });
1881
- }
1882
- const g = [
1883
- {
1884
- label: "Information",
1885
- value: "information",
1886
- icon: "overview",
1887
- render: le
1888
- },
1889
- {
1890
- label: "Setting Request",
1891
- value: "settings",
1892
- icon: "settings",
1893
- render: re,
1894
- onlyFor: ["TERMINAL"]
1895
- },
1896
- {
1897
- label: "SoftPos Gateway",
1898
- value: "softpos",
1899
- icon: "payment",
1900
- render: se
1901
- },
1902
- {
1903
- label: "ECR Gateway",
1904
- value: "ecr",
1905
- icon: "point_of_sale",
1906
- render: la,
1907
- onlyFor: ["POS", "KIOSK"]
1908
- },
1909
- {
1910
- label: "QR Gateway",
1911
- value: "qr",
1912
- icon: "qr_code",
1913
- render: ua,
1914
- onlyFor: ["POS", "KIOSK"]
1915
- }
1916
- ];
1917
- j().currentCountry;
1918
- const s = P(() => {
1919
- var t;
1920
- return (t = g.find((i) => i.value === a.value)) == null ? void 0 : t.render;
1921
- });
1922
- async function u() {
1923
- n(async () => {
1924
- m.value = await A.readById(c.terminalId);
1925
- });
1926
- }
1927
- const l = P(() => g.filter((t) => {
1928
- var i;
1929
- return !t.onlyFor || t.onlyFor.includes(((i = m.value) == null ? void 0 : i.deviceType) ?? "");
1930
- }));
1931
- return S(u), (t, i) => {
1932
- var x, o;
1933
- const p = f("FmTabs");
1934
- return y(), I(X, {
1935
- title: `${(x = m.value) == null ? void 0 : x.deviceType} (${(o = m.value) == null ? void 0 : o._id})`,
1936
- loading: h(T),
1937
- onBack: h(r).back
1938
- }, {
1939
- default: M(() => [
1940
- v(p, {
1941
- "model-value": h(a),
1942
- "onUpdate:modelValue": i[0] || (i[0] = (w) => B(a) ? a.value = w : null),
1943
- class: "mb-6",
1944
- items: l.value
1945
- }, null, 8, ["model-value", "items"]),
1946
- h(a) ? (y(), I(Y(s.value), L(K({ key: 0 }, {
1947
- terminal: m.value,
1948
- onUpdate: d
1949
- })), null, 16)) : N("", !0)
1950
- ]),
1951
- _: 1
1952
- }, 8, ["title", "loading", "onBack"]);
1953
- };
1954
- }
1955
- });
1956
- export {
1957
- _a as default
1958
- };