@feedmepos/mf-payment 1.1.14-beta.1 → 1.1.14

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 (55) hide show
  1. package/dist/{PayoutAccount-BjcP1n1D.js → PayoutAccount-B-XpzTqu.js} +7 -8
  2. package/dist/{PayoutAccount-BhC9GdVa.js → PayoutAccount-CuGn640K.js} +6 -7
  3. package/dist/{PayoutAccountSetting-61UI9TTU.js → PayoutAccountSetting-CmlqySTp.js} +3 -3
  4. package/dist/{Restaurant-BEjGTeZK.js → Restaurant-CbXVnwaT.js} +4 -4
  5. package/dist/{RestaurantSetting-CH5KXJd-.js → RestaurantSetting-DBgztIry.js} +3 -3
  6. package/dist/{Settlement-CpWtqcbV.js → Settlement-BskRF_Qk.js} +3 -3
  7. package/dist/{Settlement-Ekk7fPLv.js → Settlement-ChMZqkYo.js} +3 -3
  8. package/dist/{SettlementTransactions-DddCRhIs.js → SettlementTransactions-BvU4bVd3.js} +3 -3
  9. package/dist/{SettlementTransactions-CytrIXUM.js → SettlementTransactions-CiqJyr1g.js} +3 -3
  10. package/dist/{Terminal-5BRplzny.js → Terminal-C4rFd_FC.js} +6 -6
  11. package/dist/TerminalSetting-MNCHf9x9.js +497 -0
  12. package/dist/{Transaction-Bnm30wxt.js → Transaction-C5ULLdoi.js} +8 -9
  13. package/dist/{Transaction-D2qgyVJA.js → Transaction-DTe3ST6p.js} +5 -5
  14. package/dist/{TransactionOld-DL9vMDXr.js → TransactionOld-BTqo9lii.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-PXvQ-nrK.js → TransactionTable.vue_vue_type_script_setup_true_lang-D8HsRsbZ.js} +3 -3
  16. package/dist/{app--PNGHtZ3.js → app-Dit06Jr6.js} +253 -253
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-BAvqcM2y.js → assets-B7sgKcul.js} +28 -30
  19. package/dist/{grafana-XJlaGQ8C.js → grafana-wm93DnN2.js} +2 -2
  20. package/dist/{index-B4xE-ETp.js → index-C-M1CL9P.js} +12517 -13115
  21. package/dist/{index-s6srEUqZ.js → index-DP7VUbrW.js} +1 -1
  22. package/dist/{index-SqBpMlb0.js → index-DUM9Y_Ap.js} +1 -1
  23. package/dist/{index-pPbE76Vg.js → index-DcZShqtg.js} +1 -1
  24. package/dist/{index-DXzezAJQ.js → index-De79N6Ur.js} +3 -4
  25. package/dist/{index-DsT_D8r0.js → index-jDKnGfXk.js} +1 -1
  26. package/dist/{index.vue_vue_type_script_setup_true_lang-aFl1Lbk1.js → index.vue_vue_type_script_setup_true_lang-Du_N-XKk.js} +1 -1
  27. package/dist/model/transaction.d.ts +2 -1
  28. package/dist/package.json +2 -2
  29. package/dist/payout-account-COpn8ige.js +1819 -0
  30. package/dist/stores/payoutAccount.d.ts +4 -4
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  33. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +16 -16
  34. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +16 -16
  35. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  36. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  37. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  38. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  39. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +6 -6
  40. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  41. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +28 -22
  42. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +28 -22
  43. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +28 -22
  44. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +28 -22
  45. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +28 -22
  46. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +28 -22
  47. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +28 -22
  48. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  49. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +40 -40
  50. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +20 -20
  51. package/package.json +2 -2
  52. package/dist/TerminalSetting-D8nuI1Gv.js +0 -587
  53. package/dist/index-DtHh0OLe.js +0 -162
  54. package/dist/payout-account-TSBuddbd.js +0 -1953
  55. package/dist/views/admin/terminal/tabs/SoftspaceGateway.vue.d.ts +0 -90
@@ -1,587 +0,0 @@
1
- import { defineComponent as T, openBlock as I, createElementBlock as C, Fragment as B, createElementVNode as w, createTextVNode as U, toDisplayString as G, toRef as N, ref as b, watch as R, onMounted as O, computed as Y, resolveComponent as f, unref as _, createVNode as F, createBlock as k, withCtx as M, createCommentVNode as V, isRef as P, resolveDynamicComponent as $, normalizeProps as j, mergeProps as L } from "vue";
2
- import { u as D, e as x } from "./index-B4xE-ETp.js";
3
- import { useRouter as H } from "vue-router";
4
- import { t as q } from "./index-s6srEUqZ.js";
5
- import { _ as Q } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { u as A } from "./index-SqBpMlb0.js";
7
- import { useSnackbar as E } from "@feedmepos/ui-library";
8
- import { u as W } from "./error-K1CakhA9.js";
9
- import { z as J, a as X } from "./validator-D5jtpt9A.js";
10
- import { useCoreStore as K } from "@feedmepos/mf-common";
11
- const Z = /* @__PURE__ */ T({
12
- __name: "Information",
13
- props: {
14
- terminal: {
15
- type: Object,
16
- required: !0
17
- }
18
- },
19
- setup(g) {
20
- return (s, a) => (I(), C(B, null, [
21
- a[0] || (a[0] = w("b", null, "Name", -1)),
22
- U(": " + G(g.terminal.name), 1),
23
- a[1] || (a[1] = w("br", null, null, -1)),
24
- a[2] || (a[2] = w("b", null, "Status", -1)),
25
- U(": " + G(g.terminal.status), 1),
26
- a[3] || (a[3] = w("br", null, null, -1)),
27
- a[4] || (a[4] = w("b", null, "Device ID", -1)),
28
- U(": " + G(g.terminal.deviceId ?? "-"), 1),
29
- a[5] || (a[5] = w("br", null, null, -1)),
30
- a[6] || (a[6] = w("b", null, "Device Type", -1)),
31
- U(": " + G(g.terminal.deviceType ?? "-"), 1),
32
- a[7] || (a[7] = w("br", null, null, -1))
33
- ], 64));
34
- }
35
- }), ee = {
36
- key: 0,
37
- class: "flex items-center justify-center min-h-[80vh]"
38
- }, ae = { class: "flex mt-6 space-x-6" }, te = /* @__PURE__ */ T({
39
- __name: "TerminalGateway",
40
- props: {
41
- terminal: {
42
- type: Object,
43
- required: !0
44
- },
45
- onUpdate: {
46
- type: Function,
47
- required: !0
48
- }
49
- },
50
- setup(g) {
51
- const { isLoading: s, startAsyncCall: a } = D(), p = g, e = N(() => p.terminal), i = b(), r = b(), t = b(-1), o = b({
52
- terminalId: ""
53
- }), m = () => {
54
- o.value.terminalId = "", t.value = -1;
55
- }, u = () => {
56
- if (a(async () => {
57
- i.value = await q.getRestaurantTerminals(p.terminal.referenceId);
58
- }), !p.terminal.ecrs)
59
- return m();
60
- const l = p.terminal.ecrs.findIndex((y) => y && y.gateway && y.gateway === "FeedMe");
61
- if (l === -1)
62
- return m();
63
- t.value = l;
64
- const d = p.terminal.ecrs.at(l);
65
- d.gateway === "FeedMe" && d.config && (o.value = {
66
- terminalId: d.config.terminalId
67
- });
68
- };
69
- R(e, u), O(u);
70
- const c = Y(() => (i.value ?? []).map((l) => ({
71
- label: l.name ?? l._id,
72
- value: l._id
73
- })));
74
- async function n(l) {
75
- var d;
76
- (d = p.terminal.ecrs) == null || d.splice(l, 1), p.onUpdate(p.terminal);
77
- }
78
- return (l, d) => {
79
- const y = f("FmCircularProgress"), S = f("FmSelect"), v = f("FmButton"), h = f("FmForm");
80
- return _(s) ? (I(), C("div", ee, [
81
- F(y, { size: "xxl" })
82
- ])) : (I(), k(h, {
83
- key: 1,
84
- ref: r.value,
85
- class: "flex flex-col gap-16 w-[500px]",
86
- onValidationSuccess: d[1] || (d[1] = () => {
87
- t.value > -1 ? e.value.ecrs[t.value] = { gateway: "FeedMe", config: o.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "FeedMe", config: o.value })), p.onUpdate(e.value);
88
- })
89
- }, {
90
- default: M(() => [
91
- F(S, {
92
- modelValue: o.value.terminalId,
93
- "onUpdate:modelValue": d[0] || (d[0] = (z) => o.value.terminalId = z),
94
- label: "Terminal ID",
95
- items: c.value,
96
- rules: _(J)(_(X).string())
97
- }, null, 8, ["modelValue", "items", "rules"]),
98
- w("div", ae, [
99
- t.value > -1 ? (I(), k(v, {
100
- key: 0,
101
- class: "flex-1",
102
- variant: "secondary",
103
- label: "Delete",
104
- onclick: () => n(t.value)
105
- }, null, 8, ["onclick"])) : V("", !0),
106
- F(v, {
107
- type: "submit",
108
- class: "flex-1",
109
- variant: "primary",
110
- label: "Save"
111
- })
112
- ])
113
- ]),
114
- _: 1
115
- }, 512));
116
- };
117
- }
118
- }), ne = { class: "flex mt-6 space-x-6" }, le = /* @__PURE__ */ T({
119
- __name: "FiuuGateway",
120
- props: {
121
- terminal: {
122
- type: Object,
123
- required: !0
124
- },
125
- onUpdate: {
126
- type: Function,
127
- required: !0
128
- }
129
- },
130
- setup(g) {
131
- const s = g, a = K().currentCountry, p = [
132
- {
133
- label: "Fiuu Malaysia",
134
- value: "cc.feedme.payment.rms",
135
- region: x.F_COUNTRY.enum.MY
136
- },
137
- {
138
- label: "Fiuu Malaysia V2",
139
- value: "cc.feedme.payment.fiuu_my",
140
- region: x.F_COUNTRY.enum.MY
141
- },
142
- {
143
- label: "Fiuu Singapore",
144
- value: "cc.feedme.payment.fiuu_sg",
145
- region: x.F_COUNTRY.enum.SG
146
- }
147
- ], e = N(() => s.terminal), i = b(), r = b(-1), t = b({
148
- packageId: "",
149
- uniqueId: ""
150
- }), o = () => {
151
- t.value.uniqueId = "", t.value.packageId = "", r.value = -1;
152
- }, m = () => {
153
- if (!e.value.gateways)
154
- return o();
155
- const c = e.value.gateways.findIndex((l) => l && l.gateway && l.gateway === "Fiuu");
156
- if (c === -1)
157
- return o();
158
- r.value = c;
159
- const n = e.value.gateways.at(c);
160
- n.gateway === "Fiuu" && n.config && (t.value = {
161
- packageId: n.config.packageId,
162
- uniqueId: n.config.uniqueId
163
- });
164
- };
165
- R(e, m), O(m);
166
- async function u(c) {
167
- var n;
168
- (n = e.value.gateways) == null || n.splice(c, 1), s.onUpdate(e.value);
169
- }
170
- return (c, n) => {
171
- const l = f("FmSelect"), d = f("FmTextField"), y = f("FmButton"), S = f("FmForm");
172
- return I(), k(S, {
173
- ref: i.value,
174
- class: "flex flex-col gap-16 w-[500px]",
175
- onValidationSuccess: n[2] || (n[2] = () => {
176
- r.value > -1 ? e.value.gateways[r.value] = { gateway: "Fiuu", config: t.value } : (e.value.gateways || (e.value.gateways = []), e.value.gateways.push({ gateway: "Fiuu", config: t.value })), s.onUpdate(e.value);
177
- })
178
- }, {
179
- default: M(() => [
180
- F(l, {
181
- modelValue: t.value.packageId,
182
- "onUpdate:modelValue": n[0] || (n[0] = (v) => t.value.packageId = v),
183
- label: "Package ID",
184
- items: p.filter((v) => v.region === _(a))
185
- }, null, 8, ["modelValue", "items"]),
186
- F(d, {
187
- modelValue: t.value.uniqueId,
188
- "onUpdate:modelValue": n[1] || (n[1] = (v) => t.value.uniqueId = v),
189
- label: "Unique ID"
190
- }, null, 8, ["modelValue"]),
191
- w("div", ne, [
192
- r.value > -1 ? (I(), k(y, {
193
- key: 0,
194
- class: "flex-1",
195
- variant: "secondary",
196
- label: "Delete",
197
- onclick: () => u(r.value)
198
- }, null, 8, ["onclick"])) : V("", !0),
199
- F(y, {
200
- type: "submit",
201
- class: "flex-1",
202
- variant: "primary",
203
- label: "Save"
204
- })
205
- ])
206
- ]),
207
- _: 1
208
- }, 512);
209
- };
210
- }
211
- }), oe = { class: "flex mt-6 space-x-6" }, re = /* @__PURE__ */ T({
212
- __name: "GhlGateway",
213
- props: {
214
- terminal: {
215
- type: Object,
216
- required: !0
217
- },
218
- onUpdate: {
219
- type: Function,
220
- required: !0
221
- }
222
- },
223
- setup(g) {
224
- const s = g, a = N(() => s.terminal), p = b(), e = b(-1), i = b({
225
- merchantId: "",
226
- terminalId: "",
227
- privateKey: ""
228
- }), r = () => {
229
- i.value.merchantId = "", i.value.terminalId = "", i.value.privateKey = "", e.value = -1;
230
- }, t = () => {
231
- if (!a.value.ecrs)
232
- return r();
233
- const m = a.value.ecrs.findIndex((c) => c && c.gateway && c.gateway === "Ghl");
234
- if (m === -1)
235
- return r();
236
- e.value = m;
237
- const u = a.value.ecrs.at(m);
238
- u.gateway === "Ghl" && u.config && (i.value = {
239
- merchantId: u.config.merchantId,
240
- terminalId: u.config.terminalId,
241
- privateKey: u.config.privateKey
242
- });
243
- };
244
- R(a, t), O(t);
245
- async function o(m) {
246
- var u;
247
- (u = a.value.ecrs) == null || u.splice(m, 1), s.onUpdate(a.value);
248
- }
249
- return (m, u) => {
250
- const c = f("FmTextField"), n = f("FmTextarea"), l = f("FmButton"), d = f("FmForm");
251
- return I(), k(d, {
252
- ref: p.value,
253
- class: "flex flex-col gap-16 w-[500px]",
254
- onValidationSuccess: u[3] || (u[3] = () => {
255
- e.value > -1 ? a.value.ecrs[e.value] = { gateway: "Ghl", config: i.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: i.value })), s.onUpdate(a.value);
256
- })
257
- }, {
258
- default: M(() => [
259
- F(c, {
260
- modelValue: i.value.merchantId,
261
- "onUpdate:modelValue": u[0] || (u[0] = (y) => i.value.merchantId = y),
262
- label: "Merchant ID"
263
- }, null, 8, ["modelValue"]),
264
- F(c, {
265
- modelValue: i.value.terminalId,
266
- "onUpdate:modelValue": u[1] || (u[1] = (y) => i.value.terminalId = y),
267
- label: "Terminal ID"
268
- }, null, 8, ["modelValue"]),
269
- F(n, {
270
- modelValue: i.value.privateKey,
271
- "onUpdate:modelValue": u[2] || (u[2] = (y) => i.value.privateKey = y),
272
- label: "Private Key"
273
- }, null, 8, ["modelValue"]),
274
- w("div", oe, [
275
- e.value > -1 ? (I(), k(l, {
276
- key: 0,
277
- class: "flex-1",
278
- variant: "secondary",
279
- label: "Delete",
280
- onclick: () => o(e.value)
281
- }, null, 8, ["onclick"])) : V("", !0),
282
- F(l, {
283
- type: "submit",
284
- class: "flex-1",
285
- variant: "primary",
286
- label: "Save"
287
- })
288
- ])
289
- ]),
290
- _: 1
291
- }, 512);
292
- };
293
- }
294
- }), ue = { key: 0 }, se = { class: "mt-6 space-x-6" }, ie = /* @__PURE__ */ T({
295
- __name: "KioskMode",
296
- props: {
297
- terminal: {
298
- type: Object,
299
- required: !0
300
- }
301
- },
302
- setup(g) {
303
- const { isLoading: s, startAsyncCall: a } = D(!1), p = E(), e = b({
304
- enable: !1,
305
- password: []
306
- }), i = g;
307
- function r() {
308
- return e.value.enable && e.value.password.filter((t) => !!t).length !== 6 ? p.open({
309
- type: "error",
310
- message: "Unlock PIN is required when setting up kiosk mode for terminal."
311
- }) : a(async () => {
312
- const t = { enable: e.value.enable };
313
- t.enable && Object.assign(t, {
314
- password: e.value.password.join("")
315
- });
316
- const o = await q.kioskModeRequest(i.terminal._id, t);
317
- if (o === "OK")
318
- return p.open({ type: "info", message: "Kiosk mode applied successfully." });
319
- let m = o;
320
- return o === "client_not_connected" && (m = "Terminal not connected to the websocket server."), o.startsWith("terminal: ") && (m = o.replaceAll("terminal: ", "")), p.open({
321
- type: "error",
322
- message: m
323
- });
324
- });
325
- }
326
- return (t, o) => {
327
- const m = f("FmSwitch"), u = f("FmPinField"), c = f("FmButton");
328
- return I(), C(B, null, [
329
- F(m, {
330
- modelValue: e.value.enable,
331
- "onUpdate:modelValue": o[0] || (o[0] = (n) => e.value.enable = n),
332
- label: "Enable Kiosk Mode?"
333
- }, null, 8, ["modelValue"]),
334
- e.value.enable ? (I(), C("div", ue, [
335
- o[2] || (o[2] = w("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
336
- F(u, {
337
- modelValue: e.value.password,
338
- "onUpdate:modelValue": o[1] || (o[1] = (n) => e.value.password = n)
339
- }, null, 8, ["modelValue"])
340
- ])) : V("", !0),
341
- w("div", se, [
342
- F(c, {
343
- variant: "primary",
344
- label: "Send",
345
- icon: "send",
346
- loading: _(s),
347
- onclick: r
348
- }, null, 8, ["loading"])
349
- ])
350
- ], 64);
351
- };
352
- }
353
- }), me = /* @__PURE__ */ T({
354
- __name: "SettingRequest",
355
- props: {
356
- terminal: {
357
- type: Object,
358
- required: !0
359
- }
360
- },
361
- setup(g) {
362
- const { settingTab: s } = A({
363
- settingTab: "kiosk_mode"
364
- }), a = [
365
- {
366
- label: "Kiosk Mode",
367
- value: "kiosk_mode",
368
- render: ie
369
- }
370
- ], p = g, e = Y(() => a.find((i) => i.value === s.value));
371
- return (i, r) => {
372
- var o;
373
- const t = f("FmTabs");
374
- return I(), C(B, null, [
375
- r[1] || (r[1] = w("p", { className: "mt-1 my-6 text-gray-600" }, [
376
- w("b", null, "Note: "),
377
- U(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
378
- ], -1)),
379
- F(t, {
380
- "model-value": _(s),
381
- "onUpdate:modelValue": r[0] || (r[0] = (m) => P(s) ? s.value = m : null),
382
- class: "mb-6",
383
- items: a
384
- }, null, 8, ["model-value"]),
385
- _(s) ? (I(), k($((o = e.value) == null ? void 0 : o.render), j(L({ key: 0 }, { terminal: p.terminal })), null, 16)) : V("", !0)
386
- ], 64);
387
- };
388
- }
389
- }), ce = { class: "flex mt-6 space-x-6" }, de = /* @__PURE__ */ T({
390
- __name: "SoftspaceGateway",
391
- props: {
392
- terminal: {
393
- type: Object,
394
- required: !0
395
- },
396
- onUpdate: {
397
- type: Function,
398
- required: !0
399
- }
400
- },
401
- setup(g) {
402
- const s = g, a = K().currentCountry, p = [
403
- {
404
- label: "Softspace Malaysia",
405
- value: "cc.feedme.payment.softspace_my",
406
- region: x.F_COUNTRY.enum.MY
407
- }
408
- ], e = N(() => s.terminal), i = b(), r = b(-1), t = b({
409
- packageId: "",
410
- uniqueId: ""
411
- }), o = () => {
412
- t.value.uniqueId = "", t.value.packageId = "", r.value = -1;
413
- }, m = () => {
414
- if (!e.value.gateways)
415
- return o();
416
- const c = e.value.gateways.findIndex((l) => l && l.gateway && l.gateway === "Softspace");
417
- if (c === -1)
418
- return o();
419
- r.value = c;
420
- const n = e.value.gateways.at(c);
421
- n.gateway === "Softspace" && n.config && (t.value = {
422
- packageId: n.config.packageId,
423
- uniqueId: n.config.uniqueId
424
- });
425
- };
426
- R(e, m), O(m);
427
- async function u(c) {
428
- var n;
429
- (n = e.value.gateways) == null || n.splice(c, 1), s.onUpdate(e.value);
430
- }
431
- return (c, n) => {
432
- const l = f("FmSelect"), d = f("FmTextField"), y = f("FmButton"), S = f("FmForm");
433
- return I(), k(S, {
434
- ref: i.value,
435
- class: "flex flex-col gap-16 w-[500px]",
436
- onValidationSuccess: n[2] || (n[2] = () => {
437
- r.value > -1 ? e.value.gateways[r.value] = { gateway: "Softspace", config: t.value } : (e.value.gateways || (e.value.gateways = []), e.value.gateways.push({ gateway: "Softspace", config: t.value })), s.onUpdate(e.value);
438
- })
439
- }, {
440
- default: M(() => [
441
- F(l, {
442
- modelValue: t.value.packageId,
443
- "onUpdate:modelValue": n[0] || (n[0] = (v) => t.value.packageId = v),
444
- label: "Package ID",
445
- items: p.filter((v) => v.region === _(a))
446
- }, null, 8, ["modelValue", "items"]),
447
- F(d, {
448
- modelValue: t.value.uniqueId,
449
- "onUpdate:modelValue": n[1] || (n[1] = (v) => t.value.uniqueId = v),
450
- label: "Unique ID"
451
- }, null, 8, ["modelValue"]),
452
- w("div", ce, [
453
- r.value > -1 ? (I(), k(y, {
454
- key: 0,
455
- class: "flex-1",
456
- variant: "secondary",
457
- label: "Delete",
458
- onclick: () => u(r.value)
459
- }, null, 8, ["onclick"])) : V("", !0),
460
- F(y, {
461
- type: "submit",
462
- class: "flex-1",
463
- variant: "primary",
464
- label: "Save"
465
- })
466
- ])
467
- ]),
468
- _: 1
469
- }, 512);
470
- };
471
- }
472
- }), ke = /* @__PURE__ */ T({
473
- __name: "TerminalSetting",
474
- props: {
475
- terminalId: {
476
- type: String,
477
- required: !0
478
- }
479
- },
480
- setup(g) {
481
- const s = g, { tab: a } = A({
482
- tab: "information"
483
- }), { isLoading: p, startAsyncCall: e } = D(!0), i = H(), r = E(), t = b();
484
- async function o(l) {
485
- e(async () => {
486
- try {
487
- await q.updateById(
488
- s.terminalId,
489
- {
490
- name: l.name,
491
- status: l.status,
492
- ecrs: l.ecrs ?? [],
493
- gateways: l.gateways ?? []
494
- }
495
- ), t.value = await q.readById(s.terminalId), r.open({
496
- type: "success",
497
- message: "Terminal updated successfully"
498
- });
499
- } catch (d) {
500
- r.open({
501
- type: "error",
502
- title: "Error occurs when update terminal",
503
- message: W(d)
504
- });
505
- }
506
- });
507
- }
508
- const m = [
509
- {
510
- label: "Information",
511
- value: "information",
512
- icon: "overview",
513
- render: Z
514
- },
515
- {
516
- label: "Setting Request",
517
- value: "settings",
518
- icon: "settings",
519
- render: me,
520
- onlyFor: ["TERMINAL"]
521
- },
522
- {
523
- label: "Fiuu",
524
- value: "fiuu",
525
- icon: "payment",
526
- render: le,
527
- region: [x.F_COUNTRY.enum.MY, x.F_COUNTRY.enum.SG]
528
- },
529
- {
530
- label: "Softspace",
531
- value: "softspace",
532
- icon: "payment",
533
- render: de,
534
- region: [x.F_COUNTRY.enum.MY, x.F_COUNTRY.enum.SG]
535
- },
536
- {
537
- label: "FeedMe Terminal",
538
- value: "terminal",
539
- icon: "shopping_cart_checkout",
540
- render: te,
541
- onlyFor: ["POS", "KIOSK"]
542
- },
543
- {
544
- label: "GHL Terminal (V2)",
545
- value: "ghl",
546
- icon: "shopping_cart_checkout",
547
- render: re,
548
- onlyFor: ["POS", "KIOSK"],
549
- region: [x.F_COUNTRY.enum.MY]
550
- }
551
- ], u = K().currentCountry, c = Y(() => {
552
- var l;
553
- return (l = m.find((d) => d.value === a.value)) == null ? void 0 : l.render;
554
- });
555
- async function n() {
556
- e(async () => {
557
- t.value = await q.readById(s.terminalId);
558
- });
559
- }
560
- return O(n), (l, d) => {
561
- var S;
562
- const y = f("FmTabs");
563
- return I(), k(Q, {
564
- title: `Terminal (${(S = t.value) == null ? void 0 : S._id})`,
565
- loading: _(p),
566
- onBack: _(i).back
567
- }, {
568
- default: M(() => [
569
- F(y, {
570
- "model-value": _(a),
571
- "onUpdate:modelValue": d[0] || (d[0] = (v) => P(a) ? a.value = v : null),
572
- class: "mb-6",
573
- items: m.filter((v) => !v.onlyFor || v.onlyFor.includes(t.value.deviceType)).filter((v) => !v.region || v.region.includes(_(u) ?? _(x.F_COUNTRY).enum.MY))
574
- }, null, 8, ["model-value", "items"]),
575
- _(a) ? (I(), k($(c.value), j(L({ key: 0 }, {
576
- terminal: t.value,
577
- onUpdate: o
578
- })), null, 16)) : V("", !0)
579
- ]),
580
- _: 1
581
- }, 8, ["title", "loading", "onBack"]);
582
- };
583
- }
584
- });
585
- export {
586
- ke as default
587
- };