@feedmepos/mf-payment 1.10.7 → 1.10.9-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 (91) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-Cb4w7Its.js → Actions.vue_vue_type_script_setup_true_lang-BlRSHTGm.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-B_-olj-A.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-e6WXRYGH.js} +3 -3
  3. package/dist/AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-qbJr0Fpx.js +135 -0
  4. package/dist/{Chargeback-B5MXERko.js → Chargeback-Bf8X5DpJ.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-DNrsl1TX.js → DocumentViewer.vue_vue_type_script_setup_true_lang-tvzC2-AN.js} +1 -1
  6. package/dist/{ExternalTerminal-bjMJ7qr-.js → ExternalTerminal-CJKc9YQu.js} +6 -6
  7. package/dist/{OnboardForm-CE0weADC.js → OnboardForm-Bc7PyOQu.js} +6 -6
  8. package/dist/{OnboardForm-BwFlXqV5.js → OnboardForm-Cs2frDsX.js} +6 -6
  9. package/dist/{OnboardSubmission-2s5PtLcm.js → OnboardSubmission-AzEqvWcF.js} +3 -3
  10. package/dist/{OnboardSubmission-C60-dPdV.js → OnboardSubmission-DLlDZDTp.js} +6 -6
  11. package/dist/PaymentCheckout-DmAAyMaB.js +1939 -0
  12. package/dist/{PayoutAccount-DnE00Tpx.js → PayoutAccount-CUNtHkkq.js} +5 -5
  13. package/dist/{PayoutAccount-PGN4vUiE.js → PayoutAccount-h9At-pUs.js} +7 -7
  14. package/dist/{PayoutAccountSetting-UxgmC_It.js → PayoutAccountSetting-DoxzEZrk.js} +6 -6
  15. package/dist/{Restaurant-DWs8l6IN.js → Restaurant-BQSBQlXV.js} +4 -4
  16. package/dist/{RestaurantSetting-CghN3Qij.js → RestaurantSetting-BWd81Nvi.js} +3 -3
  17. package/dist/{Settlement-DSAWgf1q.js → Settlement-BgDLErY_.js} +3 -3
  18. package/dist/{Settlement-BZG0nEhU.js → Settlement-DI1v2Lpr.js} +4 -4
  19. package/dist/{SettlementTransactions-5l9xe_rQ.js → SettlementTransactions-Btfe8TCX.js} +5 -5
  20. package/dist/{SettlementTransactions-dSH6mKX9.js → SettlementTransactions-sK3LTE7Z.js} +5 -5
  21. package/dist/{Status.vue_vue_type_script_setup_true_lang-CSz0sfMv.js → Status.vue_vue_type_script_setup_true_lang-CovSVk33.js} +1 -1
  22. package/dist/{Terminal-CU70aAqI.js → Terminal-DoTN1jZW.js} +6 -6
  23. package/dist/TerminalSetting-Bl0bfFAS.js +2785 -0
  24. package/dist/TerminalTemplate-BNHEOCY_.js +322 -0
  25. package/dist/TerminalTemplateSetting-BZ7K254Z.js +262 -0
  26. package/dist/{Transaction-9yHZiRAp.js → Transaction-4uK6M4p6.js} +10 -10
  27. package/dist/{Transaction-CHL7HVtl.js → Transaction-Ecs5btUl.js} +20 -19
  28. package/dist/{TransactionOld-Dk_5TVXm.js → TransactionOld-B3X3h7jS.js} +7 -7
  29. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-D4A7Hfk7.js → TransactionStatus.vue_vue_type_script_setup_true_lang-DA1zB5A4.js} +1 -1
  30. package/dist/api/terminal/index.d.ts +1 -0
  31. package/dist/api/terminal-template/index.d.ts +15 -0
  32. package/dist/{app-WOQvK6eu.js → app-dDZS3WjU.js} +389 -353
  33. package/dist/app.js +1 -1
  34. package/dist/assets-qEh2VGg_.js +96 -0
  35. package/dist/{grafana-BqnbcwyU.js → grafana-DiwfCX5L.js} +1 -1
  36. package/dist/index-BICW93bZ.js +43 -0
  37. package/dist/{index-Cwbpxr-3.js → index-BMpISrhv.js} +1 -1
  38. package/dist/{index--Svzj_Uq.js → index-BpmTCNi5.js} +1 -1
  39. package/dist/{index-DiYIJH8n.js → index-CFJQ_HmA.js} +2 -2
  40. package/dist/{index-BRCt0Wjb.js → index-CHinJgjY.js} +3073 -3030
  41. package/dist/{index-Cc7BGx40.js → index-Cajpi2wX.js} +1 -1
  42. package/dist/{index-Jo4g2Fvl.js → index-D8zuI51D.js} +1 -1
  43. package/dist/{index-BPTPINow.js → index-DErywACZ.js} +1 -1
  44. package/dist/{index-BSUOKl_R.js → index-DGAk2CT0.js} +1 -1
  45. package/dist/{index-XucAJsGV.js → index-DoobQn7j.js} +1 -1
  46. package/dist/index-abg_ZrfF.js +71 -0
  47. package/dist/{index.vue_vue_type_script_setup_true_lang-CQwRJloj.js → index.vue_vue_type_script_setup_true_lang-Gth5Pyzm.js} +1 -1
  48. package/dist/{onboard-submission-B7IRbUGm.js → onboard-submission-BC1A-2DE.js} +1 -1
  49. package/dist/package.json +2 -2
  50. package/dist/{payout-account-v0EWhJ79.js → payout-account-CR-f3mDu.js} +3 -3
  51. package/dist/style.css +1 -1
  52. package/dist/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/useQuery-B-FVTG9E.js +375 -0
  54. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +4 -4
  55. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +4 -4
  56. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +4 -4
  57. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  58. package/dist/views/admin/payout-account/tabs/gateway/BeamGateway.vue.d.ts +2 -2
  59. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  60. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  61. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +4 -4
  62. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  63. package/dist/views/admin/payout-account/tabs/gateway/TyroGateway.vue.d.ts +2 -2
  64. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  65. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  66. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  67. package/dist/views/admin/restaurant/tabs/gateway/BeamGateway.vue.d.ts +4 -4
  68. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  69. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  70. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  71. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
  72. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  73. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +6 -6
  74. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +6 -6
  75. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +6 -6
  76. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +8 -8
  77. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +6 -6
  78. package/dist/views/admin/terminal/TerminalApplyTemplateDialog.vue.d.ts +6 -0
  79. package/dist/views/admin/terminal/TerminalSaveTemplateDialog.vue.d.ts +2 -0
  80. package/dist/views/admin/terminal-template/TerminalTemplate.vue.d.ts +2 -0
  81. package/dist/views/admin/terminal-template/TerminalTemplateSetting.vue.d.ts +12 -0
  82. package/dist/views/admin/terminal-template/TerminalTemplateSideSheet.vue.d.ts +174 -0
  83. package/dist/views/admin/terminal-template/cell/Actions.vue.d.ts +12 -0
  84. package/dist/views/admin/terminal-template/cell/Default.vue.d.ts +5 -0
  85. package/dist/views/admin/terminal-template/tabs/EcrGateways.vue.d.ts +104 -0
  86. package/dist/views/admin/terminal-template/tabs/Information.vue.d.ts +95 -0
  87. package/package.json +2 -2
  88. package/dist/AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-KddyORH2.js +0 -505
  89. package/dist/TerminalSetting-Bc6HJqCW.js +0 -4521
  90. package/dist/assets-B_Ilda1K.js +0 -96
  91. package/dist/index-BR7n0dkV.js +0 -63
@@ -0,0 +1,2785 @@
1
+ import { defineComponent as h, openBlock as g, createElementBlock as S, Fragment as D, createElementVNode as I, createTextVNode as W, toDisplayString as z, ref as _, resolveComponent as f, createBlock as F, withCtx as O, createVNode as y, unref as N, computed as V, createCommentVNode as U, isRef as ae, resolveDynamicComponent as te, normalizeProps as le, mergeProps as ne, watch as A, onBeforeUnmount as Te, toRef as G, onMounted as q, renderList as L } from "vue";
2
+ import { u as J, p as ve, e as P } from "./index-CHinJgjY.js";
3
+ import { useRouter as Ie } from "vue-router";
4
+ import { t as j } from "./index-abg_ZrfF.js";
5
+ import { t as pe } from "./index-BICW93bZ.js";
6
+ import { _ as Fe } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
7
+ import { u as oe } from "./index-D8zuI51D.js";
8
+ import { useDialogChild as ye, useSnackbar as me, useDialog as we } from "@feedmepos/ui-library";
9
+ import { w as xe } from "./Modal-DB8M9o1T.js";
10
+ import { u as Q } from "./error-K1CakhA9.js";
11
+ import { useI18n as re, useCoreStore as ie } from "@feedmepos/mf-common";
12
+ import { z as X, a as Z } from "./validator-CTlVogBQ.js";
13
+ import { o as Ce } from "./index-CFJQ_HmA.js";
14
+ import { c as ke } from "./index-MdV54cWO.js";
15
+ import { e as fe } from "./index-DErywACZ.js";
16
+ import { P as Ne } from "./PaymentCheckout-DmAAyMaB.js";
17
+ const Ve = /* @__PURE__ */ h({
18
+ __name: "Information",
19
+ props: {
20
+ terminal: {
21
+ type: Object,
22
+ required: !0
23
+ }
24
+ },
25
+ setup(T) {
26
+ return (p, a) => (g(), S(D, null, [
27
+ a[0] || (a[0] = I("b", null, "Name", -1)),
28
+ W(": " + z(T.terminal.name), 1),
29
+ a[1] || (a[1] = I("br", null, null, -1)),
30
+ a[2] || (a[2] = I("b", null, "Status", -1)),
31
+ W(": " + z(T.terminal.status), 1),
32
+ a[3] || (a[3] = I("br", null, null, -1)),
33
+ a[4] || (a[4] = I("b", null, "Device ID", -1)),
34
+ W(": " + z(T.terminal.deviceId ?? "-"), 1),
35
+ a[5] || (a[5] = I("br", null, null, -1)),
36
+ a[6] || (a[6] = I("b", null, "Device Type", -1)),
37
+ W(": " + z(T.terminal.deviceType ?? "-"), 1),
38
+ a[7] || (a[7] = I("br", null, null, -1))
39
+ ], 64));
40
+ }
41
+ }), Se = { class: "flex items-center gap-8 rounded-md bg-fm-color-neutral-gray-100 px-16 py-12" }, Ue = { class: "fm-typo-en-body-md-400" }, he = { class: "mt-auto pt-24 pb-24" }, Re = /* @__PURE__ */ h({
42
+ __name: "TerminalSaveTemplateDialog",
43
+ setup(T) {
44
+ const p = ye(), { t: a } = re(), b = _(), l = _(""), r = _(""), e = _(!1), d = () => {
45
+ p.emitData({
46
+ name: l.value,
47
+ description: r.value,
48
+ isDefault: e.value
49
+ }), p.emitAction("primary");
50
+ };
51
+ return (c, v) => {
52
+ const m = f("FmIcon"), s = f("FmTextField"), t = f("FmSwitch"), o = f("FmButton"), i = f("FmForm");
53
+ return g(), F(i, {
54
+ ref_key: "form",
55
+ ref: b,
56
+ class: "flex flex-col gap-16 min-h-[240px]",
57
+ onValidationSuccess: d
58
+ }, {
59
+ default: O(() => [
60
+ I("div", Se, [
61
+ y(m, {
62
+ name: "info",
63
+ class: "shrink-0"
64
+ }),
65
+ I("span", Ue, z(N(a)("payment.terminal_template.scope_info")), 1)
66
+ ]),
67
+ y(s, {
68
+ modelValue: l.value,
69
+ "onUpdate:modelValue": v[0] || (v[0] = (u) => l.value = u),
70
+ label: "Template Name",
71
+ "label-mark": "required",
72
+ rules: N(X)(N(Z).string().min(1, "Template name is required"))
73
+ }, null, 8, ["modelValue", "rules"]),
74
+ y(s, {
75
+ modelValue: r.value,
76
+ "onUpdate:modelValue": v[1] || (v[1] = (u) => r.value = u),
77
+ label: "Description",
78
+ "label-mark": "optional"
79
+ }, null, 8, ["modelValue"]),
80
+ y(t, {
81
+ modelValue: e.value,
82
+ "onUpdate:modelValue": v[2] || (v[2] = (u) => e.value = u),
83
+ label: "Set as default",
84
+ "label-info": "Applied automatically when a new device of this type binds for this business."
85
+ }, null, 8, ["modelValue"]),
86
+ I("div", he, [
87
+ y(o, {
88
+ class: "w-full",
89
+ type: "submit",
90
+ label: "Save"
91
+ })
92
+ ])
93
+ ]),
94
+ _: 1
95
+ }, 512);
96
+ };
97
+ }
98
+ }), Pe = { class: "flex flex-col gap-16 min-h-[240px]" }, Be = { class: "flex items-start gap-8 rounded-md bg-fm-color-neutral-gray-100 px-16 py-12" }, Oe = { class: "fm-typo-en-body-md-400" }, Me = {
99
+ key: 0,
100
+ class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-500"
101
+ }, Ae = {
102
+ key: 2,
103
+ class: "mt-auto pt-24 pb-24"
104
+ }, qe = /* @__PURE__ */ h({
105
+ __name: "TerminalApplyTemplateDialog",
106
+ props: {
107
+ templates: {}
108
+ },
109
+ setup(T) {
110
+ const p = T, a = ye(), { t: b } = re(), l = _(""), r = V(
111
+ () => p.templates.map((d) => ({
112
+ label: d.isDefault ? `${d.name} (default)` : d.name,
113
+ value: d._id
114
+ }))
115
+ ), e = () => {
116
+ a.emitData({ templateId: l.value }), a.emitAction("primary");
117
+ };
118
+ return (d, c) => {
119
+ const v = f("FmIcon"), m = f("FmSelect"), s = f("FmButton");
120
+ return g(), S("div", Pe, [
121
+ I("div", Be, [
122
+ y(v, {
123
+ name: "info",
124
+ class: "mt-4 shrink-0"
125
+ }),
126
+ I("div", Oe, z(N(b)("payment.terminal_template.scope_info")), 1)
127
+ ]),
128
+ r.value.length === 0 ? (g(), S("div", Me, " No setting template exists for this business and device type yet. ")) : (g(), F(m, {
129
+ key: 1,
130
+ modelValue: l.value,
131
+ "onUpdate:modelValue": c[0] || (c[0] = (t) => l.value = t),
132
+ label: "Template",
133
+ items: r.value
134
+ }, null, 8, ["modelValue", "items"])),
135
+ r.value.length > 0 ? (g(), S("div", Ae, [
136
+ y(s, {
137
+ class: "w-full",
138
+ label: "Apply",
139
+ disabled: !l.value,
140
+ onClick: e
141
+ }, null, 8, ["disabled"])
142
+ ])) : U("", !0)
143
+ ]);
144
+ };
145
+ }
146
+ }), Ge = { key: 0 }, De = { class: "mt-6 space-x-6" }, $e = /* @__PURE__ */ h({
147
+ __name: "KioskMode",
148
+ props: {
149
+ terminal: {
150
+ type: Object,
151
+ required: !0
152
+ }
153
+ },
154
+ setup(T) {
155
+ const { isLoading: p, startAsyncCall: a } = J(!1), b = me(), l = _({
156
+ enable: !1,
157
+ password: []
158
+ }), r = T;
159
+ function e() {
160
+ return l.value.enable && l.value.password.filter((d) => !!d).length !== 6 ? b.open({
161
+ type: "error",
162
+ message: "Unlock PIN is required when setting up kiosk mode for terminal."
163
+ }) : a(async () => {
164
+ const d = { enable: l.value.enable };
165
+ d.enable && Object.assign(d, {
166
+ password: l.value.password.join("")
167
+ });
168
+ const c = await j.kioskModeRequest(r.terminal._id, d);
169
+ if (c === "OK")
170
+ return b.open({ type: "info", message: "Kiosk mode applied successfully." });
171
+ let v = c;
172
+ return c === "client_not_connected" && (v = "Terminal not connected to the websocket server."), c.startsWith("terminal: ") && (v = c.replaceAll("terminal: ", "")), b.open({
173
+ type: "error",
174
+ message: v
175
+ });
176
+ });
177
+ }
178
+ return (d, c) => {
179
+ const v = f("FmSwitch"), m = f("FmPinField"), s = f("FmButton");
180
+ return g(), S(D, null, [
181
+ y(v, {
182
+ modelValue: l.value.enable,
183
+ "onUpdate:modelValue": c[0] || (c[0] = (t) => l.value.enable = t),
184
+ label: "Enable Kiosk Mode?"
185
+ }, null, 8, ["modelValue"]),
186
+ l.value.enable ? (g(), S("div", Ge, [
187
+ c[2] || (c[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
188
+ y(m, {
189
+ modelValue: l.value.password,
190
+ "onUpdate:modelValue": c[1] || (c[1] = (t) => l.value.password = t)
191
+ }, null, 8, ["modelValue"])
192
+ ])) : U("", !0),
193
+ I("div", De, [
194
+ y(s, {
195
+ variant: "primary",
196
+ label: "Send",
197
+ icon: "send",
198
+ loading: N(p),
199
+ onclick: e
200
+ }, null, 8, ["loading"])
201
+ ])
202
+ ], 64);
203
+ };
204
+ }
205
+ }), Ee = /* @__PURE__ */ h({
206
+ __name: "SettingRequest",
207
+ props: {
208
+ terminal: {
209
+ type: Object,
210
+ required: !0
211
+ }
212
+ },
213
+ setup(T) {
214
+ const { settingTab: p } = oe({
215
+ settingTab: "kiosk_mode"
216
+ }), a = [
217
+ {
218
+ label: "Kiosk Mode",
219
+ value: "kiosk_mode",
220
+ render: $e
221
+ }
222
+ ], b = T, l = V(() => a.find((r) => r.value === p.value));
223
+ return (r, e) => {
224
+ var c;
225
+ const d = f("FmTabs");
226
+ return g(), S(D, null, [
227
+ e[1] || (e[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
228
+ I("b", null, "Note: "),
229
+ W(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
230
+ ], -1)),
231
+ y(d, {
232
+ "model-value": N(p),
233
+ "onUpdate:modelValue": e[0] || (e[0] = (v) => ae(p) ? p.value = v : null),
234
+ class: "mb-6",
235
+ items: a
236
+ }, null, 8, ["model-value"]),
237
+ N(p) ? (g(), F(te((c = l.value) == null ? void 0 : c.render), le(ne({ key: 0 }, { terminal: b.terminal })), null, 16)) : U("", !0)
238
+ ], 64);
239
+ };
240
+ }
241
+ }), Le = 2e3, Ye = 12e4, je = "Timed out waiting for the Tyro reader to sync. Please try again.";
242
+ function Ke(T) {
243
+ const { isLoading: p, startLoading: a, stopLoading: b } = J(!1), { t: l } = re(), r = me(), e = _(null), d = V(() => {
244
+ var k, B;
245
+ const w = (k = T.value.gateways) == null ? void 0 : k.find(
246
+ ($) => $.gateway === "Tyro"
247
+ );
248
+ return ((B = w == null ? void 0 : w.config) == null ? void 0 : B.uniqueId) || "";
249
+ }), c = V(() => !!d.value), v = V(() => {
250
+ var w;
251
+ return ((w = e.value) == null ? void 0 : w.status) === "ready";
252
+ }), m = V(() => {
253
+ var w, k;
254
+ return v.value && !!((k = (w = e.value) == null ? void 0 : w.fields) != null && k.tyroLocationId) && !!T.value.deviceId && !c.value;
255
+ }), s = V(() => !v.value && !c.value), t = V(
256
+ () => l("payment.onboard-submission.tyro.syncDisabledHint")
257
+ ), o = V(() => c.value ? "Synced" : "Sync");
258
+ async function i() {
259
+ if (!T.value.referenceId) {
260
+ e.value = null;
261
+ return;
262
+ }
263
+ try {
264
+ const w = await Ce.getByRestaurant(
265
+ T.value.referenceId
266
+ );
267
+ e.value = w.find(
268
+ (k) => k.type === ve.FdoOnboardType.enum.tyro
269
+ ) ?? null;
270
+ } catch (w) {
271
+ e.value = null, r.open({
272
+ type: "error",
273
+ message: Q(w)
274
+ });
275
+ }
276
+ }
277
+ const u = ke({
278
+ intervalMs: Le,
279
+ timeoutMs: Ye,
280
+ onTick: async ({ isCurrentRun: w, stop: k }) => {
281
+ var K, H;
282
+ const B = await j.readById(T.value._id);
283
+ if (!w())
284
+ return;
285
+ const $ = (K = B.gateways) == null ? void 0 : K.find((se) => se.gateway === "Tyro");
286
+ ($ == null ? void 0 : $.gateway) === "Tyro" && ((H = $ == null ? void 0 : $.config) != null && H.uniqueId) && (k({ invalidate: !1 }), b(), Object.assign(T.value, B), r.open({
287
+ type: "success",
288
+ message: "Tyro reader created successfully"
289
+ }));
290
+ },
291
+ onTimeout: () => {
292
+ b(), r.open({
293
+ type: "error",
294
+ message: je
295
+ });
296
+ },
297
+ onError: (w) => {
298
+ b(), r.open({
299
+ type: "error",
300
+ message: Q(w)
301
+ });
302
+ }
303
+ }), C = u.isPolling;
304
+ function n() {
305
+ u.stop(), b();
306
+ }
307
+ function x() {
308
+ n(), a(), u.start();
309
+ }
310
+ async function E() {
311
+ if (!m.value) {
312
+ r.open({
313
+ type: "error",
314
+ message: "Tyro reader sync is not available"
315
+ });
316
+ return;
317
+ }
318
+ try {
319
+ a(), await j.syncTyroReader(T.value._id), x();
320
+ } catch (w) {
321
+ n(), r.open({
322
+ type: "error",
323
+ message: Q(w)
324
+ });
325
+ }
326
+ }
327
+ return A(
328
+ () => T.value.referenceId,
329
+ async () => {
330
+ await i();
331
+ },
332
+ { immediate: !0 }
333
+ ), Te(() => {
334
+ n();
335
+ }), {
336
+ isLoading: p,
337
+ isPollingTyroReader: C,
338
+ uniqueId: d,
339
+ canSyncTyroReader: m,
340
+ showTyroSyncPopover: s,
341
+ tyroSyncPopoverMessage: t,
342
+ tyroSyncButtonLabel: o,
343
+ syncTyroReader: E
344
+ };
345
+ }
346
+ const He = {
347
+ key: 0,
348
+ class: "text-sm text-gray-500"
349
+ }, ze = { class: "flex mt-6 space-x-6" }, Qe = { class: "flex-1" }, Je = /* @__PURE__ */ h({
350
+ __name: "SoftposGateway",
351
+ props: {
352
+ terminal: {
353
+ type: Object,
354
+ required: !0
355
+ },
356
+ onUpdate: {
357
+ type: Function,
358
+ required: !0
359
+ }
360
+ },
361
+ setup(T) {
362
+ const p = T, a = ie().currentCountry, b = [
363
+ {
364
+ label: "Fiuu Malaysia",
365
+ value: "cc.feedme.payment.rms",
366
+ region: P.F_COUNTRY.enum.MY,
367
+ gateway: "Fiuu",
368
+ isLegacy: !0,
369
+ isOutdated: !0
370
+ },
371
+ {
372
+ label: "Fiuu Malaysia V2",
373
+ value: "cc.feedme.payment.fiuu_my",
374
+ region: P.F_COUNTRY.enum.MY,
375
+ gateway: "Fiuu",
376
+ isLegacy: !0
377
+ },
378
+ {
379
+ label: "Fiuu Singapore",
380
+ value: "cc.feedme.payment.fiuu_sg",
381
+ region: P.F_COUNTRY.enum.SG,
382
+ gateway: "Fiuu",
383
+ isLegacy: !0
384
+ },
385
+ {
386
+ label: "Softspace Malaysia",
387
+ value: "cc.feedme.payment.softspace_my",
388
+ gateway: "Softspace",
389
+ region: P.F_COUNTRY.enum.MY
390
+ },
391
+ {
392
+ label: "Digio Thailand",
393
+ value: "cc.feedme.payment.digio_th",
394
+ gateway: "Digio",
395
+ region: P.F_COUNTRY.enum.TH
396
+ },
397
+ {
398
+ label: "Tyro Australia",
399
+ value: "cc.feedme.payment.tyro_au",
400
+ gateway: "Tyro",
401
+ region: P.F_COUNTRY.enum.AU
402
+ }
403
+ ], l = G(() => p.terminal), r = _(), e = _({
404
+ packageId: "",
405
+ uniqueId: "",
406
+ developerId: "",
407
+ isUat: !1
408
+ }), d = () => {
409
+ e.value.uniqueId = "", e.value.packageId = "", e.value.developerId = "", e.value.isUat = !1;
410
+ }, c = V(() => b.filter((R) => R.region === a.value)), v = V(() => c.value.find(
411
+ (R) => R.value === e.value.packageId
412
+ )), m = V(
413
+ () => {
414
+ var R;
415
+ return ((R = v.value) == null ? void 0 : R.gateway) === "Tyro";
416
+ }
417
+ ), {
418
+ isLoading: s,
419
+ isPollingTyroReader: t,
420
+ uniqueId: o,
421
+ canSyncTyroReader: i,
422
+ showTyroSyncPopover: u,
423
+ tyroSyncPopoverMessage: C,
424
+ tyroSyncButtonLabel: n,
425
+ syncTyroReader: x
426
+ } = Ke(l), E = V(() => m.value ? "button" : "submit"), w = V(() => m.value ? n.value : "Save"), k = V(() => m.value ? s.value : !1), B = V(() => m.value ? !i.value || t.value : !1), $ = () => {
427
+ if (!l.value.gateways || l.value.gateways.length === 0)
428
+ return d();
429
+ const R = l.value.gateways[0];
430
+ if (!R.config)
431
+ return d();
432
+ if (R.gateway === "Tyro") {
433
+ e.value = {
434
+ packageId: R.config.packageId,
435
+ uniqueId: R.config.uniqueId,
436
+ developerId: "",
437
+ isUat: !1
438
+ };
439
+ return;
440
+ }
441
+ switch (R.gateway) {
442
+ case "Fiuu":
443
+ e.value = {
444
+ packageId: R.config.packageId,
445
+ uniqueId: R.config.uniqueId,
446
+ developerId: "",
447
+ isUat: !1
448
+ };
449
+ break;
450
+ case "Softspace":
451
+ case "Digio":
452
+ const M = JSON.parse(R.config.uniqueId);
453
+ e.value = {
454
+ packageId: R.config.packageId,
455
+ uniqueId: M.uniqueId,
456
+ developerId: M.developerId,
457
+ isUat: M.isUat
458
+ };
459
+ return;
460
+ }
461
+ };
462
+ A(l, $), q($);
463
+ const K = () => {
464
+ e.value.uniqueId = "", e.value.developerId = "", e.value.isUat = !1;
465
+ };
466
+ async function H() {
467
+ const R = v.value;
468
+ if (!R)
469
+ return;
470
+ let M = e.value.uniqueId;
471
+ R.isLegacy || (M = JSON.stringify({
472
+ uniqueId: e.value.uniqueId,
473
+ developerId: e.value.developerId,
474
+ isUat: e.value.isUat
475
+ }));
476
+ const ue = {
477
+ gateway: R.gateway,
478
+ config: {
479
+ packageId: R.value,
480
+ uniqueId: M
481
+ }
482
+ };
483
+ (!l.value.gateways || l.value.gateways.length > 1) && (l.value.gateways = []), l.value.gateways[0] = ue, await p.onUpdate(l.value);
484
+ }
485
+ async function se(R) {
486
+ var M;
487
+ (M = l.value.gateways) == null || M.splice(R, 1), p.onUpdate(l.value);
488
+ }
489
+ function de() {
490
+ m.value && x();
491
+ }
492
+ return (R, M) => {
493
+ const ue = f("FmSelect"), ee = f("FmTextField"), ge = f("FmCheckbox"), ce = f("FmButton"), be = f("FmTooltip"), _e = f("FmForm");
494
+ return g(), F(_e, {
495
+ ref: r.value,
496
+ class: "flex flex-col gap-16 w-[500px]",
497
+ onValidationSuccess: H
498
+ }, {
499
+ default: O(() => [
500
+ y(ue, {
501
+ modelValue: e.value.packageId,
502
+ "onUpdate:modelValue": [
503
+ M[0] || (M[0] = (Y) => e.value.packageId = Y),
504
+ K
505
+ ],
506
+ label: "Package ID",
507
+ items: c.value
508
+ }, null, 8, ["modelValue", "items"]),
509
+ v.value ? (g(), S(D, { key: 0 }, [
510
+ m.value ? (g(), F(ee, {
511
+ key: 0,
512
+ "model-value": N(o),
513
+ label: "Unique ID (Reader ID)",
514
+ disabled: ""
515
+ }, null, 8, ["model-value"])) : v.value && v.value.isLegacy ? (g(), S(D, { key: 1 }, [
516
+ y(ee, {
517
+ modelValue: e.value.uniqueId,
518
+ "onUpdate:modelValue": M[1] || (M[1] = (Y) => e.value.uniqueId = Y),
519
+ label: "Unique ID (TID)"
520
+ }, null, 8, ["modelValue"]),
521
+ v.value.isOutdated ? (g(), S("span", He, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : U("", !0)
522
+ ], 64)) : (g(), S(D, { key: 2 }, [
523
+ y(ee, {
524
+ modelValue: e.value.developerId,
525
+ "onUpdate:modelValue": M[2] || (M[2] = (Y) => e.value.developerId = Y),
526
+ label: "Developer ID (MID)"
527
+ }, null, 8, ["modelValue"]),
528
+ y(ee, {
529
+ modelValue: e.value.uniqueId,
530
+ "onUpdate:modelValue": M[3] || (M[3] = (Y) => e.value.uniqueId = Y),
531
+ label: "Unique ID (TID)"
532
+ }, null, 8, ["modelValue"]),
533
+ y(ge, {
534
+ modelValue: e.value.isUat,
535
+ "onUpdate:modelValue": M[4] || (M[4] = (Y) => e.value.isUat = Y),
536
+ label: "Is UAT (Test)",
537
+ value: "1"
538
+ }, null, 8, ["modelValue"])
539
+ ], 64)),
540
+ I("div", ze, [
541
+ l.value.gateways && l.value.gateways.length > 0 ? (g(), F(ce, {
542
+ key: 0,
543
+ class: "flex-1",
544
+ variant: "secondary",
545
+ label: "Delete",
546
+ onclick: () => se(0)
547
+ }, null, 8, ["onclick"])) : U("", !0),
548
+ m.value && N(u) && B.value ? (g(), F(be, {
549
+ key: 1,
550
+ class: "flex-1",
551
+ variant: "plain",
552
+ placement: "top",
553
+ content: N(C)
554
+ }, {
555
+ default: O(() => [
556
+ I("div", Qe, [
557
+ y(ce, {
558
+ type: E.value,
559
+ class: "w-full",
560
+ variant: "primary",
561
+ loading: k.value,
562
+ disabled: B.value,
563
+ label: w.value,
564
+ onClick: de
565
+ }, null, 8, ["type", "loading", "disabled", "label"])
566
+ ])
567
+ ]),
568
+ _: 1
569
+ }, 8, ["content"])) : (g(), F(ce, {
570
+ key: 2,
571
+ type: E.value,
572
+ class: "flex-1",
573
+ variant: "primary",
574
+ loading: k.value,
575
+ disabled: B.value,
576
+ label: w.value,
577
+ onClick: de
578
+ }, null, 8, ["type", "loading", "disabled", "label"]))
579
+ ])
580
+ ], 64)) : U("", !0)
581
+ ]),
582
+ _: 1
583
+ }, 512);
584
+ };
585
+ }
586
+ }), We = {
587
+ key: 0,
588
+ class: "flex items-center justify-center min-h-[80vh]"
589
+ }, Xe = { class: "flex mt-6 space-x-6" }, Ze = /* @__PURE__ */ h({
590
+ __name: "TerminalGateway",
591
+ props: {
592
+ terminal: {
593
+ type: Object,
594
+ required: !0
595
+ },
596
+ onUpdate: {
597
+ type: Function,
598
+ required: !0
599
+ }
600
+ },
601
+ setup(T) {
602
+ const { isLoading: p, startAsyncCall: a } = J(), b = T, l = G(() => b.terminal), r = _(), e = _(), d = _(-1), c = _({
603
+ terminalId: ""
604
+ }), v = () => {
605
+ c.value.terminalId = "", d.value = -1;
606
+ }, m = () => {
607
+ if (a(async () => {
608
+ r.value = await j.getRestaurantTerminals(b.terminal.referenceId);
609
+ }), !b.terminal.ecrs)
610
+ return v();
611
+ const o = b.terminal.ecrs.findIndex((u) => u && u.gateway && u.gateway === "FeedMe");
612
+ if (o === -1)
613
+ return v();
614
+ d.value = o;
615
+ const i = b.terminal.ecrs.at(o);
616
+ i.gateway === "FeedMe" && i.config && (c.value = {
617
+ terminalId: i.config.terminalId
618
+ });
619
+ };
620
+ A(l, m), q(m);
621
+ const s = V(() => (r.value ?? []).map((o) => ({
622
+ label: o.name ?? o._id,
623
+ value: o._id
624
+ })));
625
+ async function t(o) {
626
+ var i;
627
+ (i = b.terminal.ecrs) == null || i.splice(o, 1), b.onUpdate(b.terminal);
628
+ }
629
+ return (o, i) => {
630
+ const u = f("FmCircularProgress"), C = f("FmSelect"), n = f("FmButton"), x = f("FmForm");
631
+ return N(p) ? (g(), S("div", We, [
632
+ y(u, { size: "xxl" })
633
+ ])) : (g(), F(x, {
634
+ key: 1,
635
+ ref: e.value,
636
+ class: "flex flex-col gap-16 w-[500px]",
637
+ onValidationSuccess: i[1] || (i[1] = () => {
638
+ d.value > -1 ? l.value.ecrs[d.value] = { gateway: "FeedMe", config: c.value } : (l.value.ecrs || (l.value.ecrs = []), l.value.ecrs.push({ gateway: "FeedMe", config: c.value })), b.onUpdate(l.value);
639
+ })
640
+ }, {
641
+ default: O(() => [
642
+ y(C, {
643
+ modelValue: c.value.terminalId,
644
+ "onUpdate:modelValue": i[0] || (i[0] = (E) => c.value.terminalId = E),
645
+ label: "Terminal ID",
646
+ items: s.value,
647
+ rules: N(X)(N(Z).string())
648
+ }, null, 8, ["modelValue", "items", "rules"]),
649
+ I("div", Xe, [
650
+ d.value > -1 ? (g(), F(n, {
651
+ key: 0,
652
+ class: "flex-1",
653
+ variant: "secondary",
654
+ label: "Delete",
655
+ onclick: () => t(d.value)
656
+ }, null, 8, ["onclick"])) : U("", !0),
657
+ y(n, {
658
+ type: "submit",
659
+ class: "flex-1",
660
+ variant: "primary",
661
+ label: "Save"
662
+ })
663
+ ])
664
+ ]),
665
+ _: 1
666
+ }, 512));
667
+ };
668
+ }
669
+ }), ea = { class: "flex mt-6 space-x-6" }, aa = /* @__PURE__ */ h({
670
+ __name: "GhlGateway",
671
+ props: {
672
+ terminal: {
673
+ type: Object,
674
+ required: !0
675
+ },
676
+ onUpdate: {
677
+ type: Function,
678
+ required: !0
679
+ }
680
+ },
681
+ setup(T) {
682
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _({
683
+ merchantId: "",
684
+ terminalId: "",
685
+ privateKey: ""
686
+ }), e = () => {
687
+ r.value.merchantId = "", r.value.terminalId = "", r.value.privateKey = "", l.value = -1;
688
+ }, d = () => {
689
+ if (!a.value.ecrs)
690
+ return e();
691
+ const v = a.value.ecrs.findIndex((s) => s && s.gateway && s.gateway === "Ghl");
692
+ if (v === -1)
693
+ return e();
694
+ l.value = v;
695
+ const m = a.value.ecrs.at(v);
696
+ m.gateway === "Ghl" && m.config && (r.value = {
697
+ merchantId: m.config.merchantId,
698
+ terminalId: m.config.terminalId,
699
+ privateKey: m.config.privateKey || ""
700
+ });
701
+ };
702
+ A(a, d), q(d);
703
+ async function c(v) {
704
+ var m;
705
+ (m = a.value.ecrs) == null || m.splice(v, 1), p.onUpdate(a.value);
706
+ }
707
+ return (v, m) => {
708
+ const s = f("FmTextField"), t = f("FmTextarea"), o = f("FmButton"), i = f("FmForm");
709
+ return g(), F(i, {
710
+ ref: b.value,
711
+ class: "flex flex-col gap-16 w-[500px]",
712
+ onValidationSuccess: m[3] || (m[3] = () => {
713
+ l.value > -1 ? a.value.ecrs[l.value] = { gateway: "Ghl", config: r.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: r.value })), p.onUpdate(a.value);
714
+ })
715
+ }, {
716
+ default: O(() => [
717
+ y(s, {
718
+ modelValue: r.value.merchantId,
719
+ "onUpdate:modelValue": m[0] || (m[0] = (u) => r.value.merchantId = u),
720
+ label: "Merchant ID"
721
+ }, null, 8, ["modelValue"]),
722
+ y(s, {
723
+ modelValue: r.value.terminalId,
724
+ "onUpdate:modelValue": m[1] || (m[1] = (u) => r.value.terminalId = u),
725
+ label: "Terminal ID"
726
+ }, null, 8, ["modelValue"]),
727
+ y(t, {
728
+ modelValue: r.value.privateKey,
729
+ "onUpdate:modelValue": m[2] || (m[2] = (u) => r.value.privateKey = u),
730
+ label: "Private Key",
731
+ "label-mark": "optional",
732
+ "label-info": "Default will use FeedMe Private Key"
733
+ }, null, 8, ["modelValue"]),
734
+ I("div", ea, [
735
+ l.value > -1 ? (g(), F(o, {
736
+ key: 0,
737
+ class: "flex-1",
738
+ variant: "secondary",
739
+ label: "Delete",
740
+ onclick: () => c(l.value)
741
+ }, null, 8, ["onclick"])) : U("", !0),
742
+ y(o, {
743
+ type: "submit",
744
+ class: "flex-1",
745
+ variant: "primary",
746
+ label: "Save"
747
+ })
748
+ ])
749
+ ]),
750
+ _: 1
751
+ }, 512);
752
+ };
753
+ }
754
+ }), ta = { class: "flex items-end" }, la = { class: "flex flex-wrap gap-8 items-center mt-4" }, na = { class: "flex mt-6 space-x-6" }, oa = /* @__PURE__ */ h({
755
+ __name: "MaybankGateway",
756
+ props: {
757
+ terminal: {
758
+ type: Object,
759
+ required: !0
760
+ },
761
+ onUpdate: {
762
+ type: Function,
763
+ required: !0
764
+ }
765
+ },
766
+ setup(T) {
767
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
768
+ ip: "",
769
+ receiptName: "",
770
+ cardTypes: []
771
+ }), d = () => {
772
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
773
+ }, c = () => {
774
+ var i;
775
+ if (!a.value.ecrIntegrations)
776
+ return d();
777
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Maybank");
778
+ if (t === -1)
779
+ return d();
780
+ l.value = t;
781
+ const o = s.at(t);
782
+ o.gateway === "Maybank" && o.config && (e.value = {
783
+ ip: o.config.ip ?? "",
784
+ receiptName: o.receiptName ?? "",
785
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
786
+ });
787
+ };
788
+ A(a, c), q(c);
789
+ async function v(s) {
790
+ var t;
791
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
792
+ }
793
+ async function m() {
794
+ e.value.cardTypes.push(r.value), r.value = "";
795
+ }
796
+ return (s, t) => {
797
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
798
+ return g(), F(C, {
799
+ ref: b.value,
800
+ class: "flex flex-col gap-16 w-[500px]",
801
+ onValidationSuccess: t[3] || (t[3] = () => {
802
+ var n, x;
803
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
804
+ gateway: "Maybank",
805
+ config: { ip: e.value.ip },
806
+ receiptName: e.value.receiptName,
807
+ dialogConfig: {
808
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
809
+ cardTypes: e.value.cardTypes
810
+ }
811
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
812
+ gateway: "Maybank",
813
+ config: { ip: e.value.ip },
814
+ receiptName: e.value.receiptName,
815
+ dialogConfig: {
816
+ cardTypes: e.value.cardTypes
817
+ }
818
+ })), p.onUpdate(a.value);
819
+ })
820
+ }, {
821
+ default: O(() => [
822
+ y(o, {
823
+ modelValue: e.value.ip,
824
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
825
+ label: "IP Address"
826
+ }, null, 8, ["modelValue"]),
827
+ y(o, {
828
+ modelValue: e.value.receiptName,
829
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
830
+ label: "Receipt Payment Name",
831
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
832
+ }, null, 8, ["modelValue"]),
833
+ I("div", ta, [
834
+ y(o, {
835
+ modelValue: r.value,
836
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
837
+ label: "Fallback Card Types",
838
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
839
+ }, null, 8, ["modelValue"]),
840
+ y(i, {
841
+ class: "ml-4",
842
+ icon: "add",
843
+ onClick: m
844
+ })
845
+ ]),
846
+ I("div", la, [
847
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
848
+ key: n,
849
+ label: n,
850
+ removable: !0,
851
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
852
+ }, null, 8, ["label", "onChipClosed"]))), 128))
853
+ ]),
854
+ I("div", na, [
855
+ l.value > -1 ? (g(), F(i, {
856
+ key: 0,
857
+ class: "flex-1",
858
+ variant: "secondary",
859
+ label: "Delete",
860
+ onclick: () => v(l.value)
861
+ }, null, 8, ["onclick"])) : U("", !0),
862
+ y(i, {
863
+ type: "submit",
864
+ class: "flex-1",
865
+ variant: "primary",
866
+ label: "Save"
867
+ })
868
+ ])
869
+ ]),
870
+ _: 1
871
+ }, 512);
872
+ };
873
+ }
874
+ }), ra = { class: "flex items-end" }, ia = { class: "flex flex-wrap gap-8 items-center mt-4" }, sa = { class: "flex mt-6 space-x-6" }, ua = /* @__PURE__ */ h({
875
+ __name: "Maybank2Gateway",
876
+ props: {
877
+ terminal: {
878
+ type: Object,
879
+ required: !0
880
+ },
881
+ onUpdate: {
882
+ type: Function,
883
+ required: !0
884
+ }
885
+ },
886
+ setup(T) {
887
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
888
+ ip: "",
889
+ receiptName: "",
890
+ cardTypes: []
891
+ }), d = () => {
892
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
893
+ }, c = () => {
894
+ var i;
895
+ if (!a.value.ecrIntegrations)
896
+ return d();
897
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Maybank2");
898
+ if (t === -1)
899
+ return d();
900
+ l.value = t;
901
+ const o = s.at(t);
902
+ o.gateway === "Maybank2" && o.config && (e.value = {
903
+ ip: o.config.ip ?? "",
904
+ receiptName: o.receiptName ?? "",
905
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
906
+ });
907
+ };
908
+ A(a, c), q(c);
909
+ async function v(s) {
910
+ var t;
911
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
912
+ }
913
+ async function m() {
914
+ e.value.cardTypes.push(r.value), r.value = "";
915
+ }
916
+ return (s, t) => {
917
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
918
+ return g(), F(C, {
919
+ ref: b.value,
920
+ class: "flex flex-col gap-16 w-[500px]",
921
+ onValidationSuccess: t[3] || (t[3] = () => {
922
+ var n, x;
923
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
924
+ gateway: "Maybank2",
925
+ config: { ip: e.value.ip },
926
+ receiptName: e.value.receiptName,
927
+ dialogConfig: {
928
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
929
+ cardTypes: e.value.cardTypes
930
+ }
931
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
932
+ gateway: "Maybank2",
933
+ config: { ip: e.value.ip },
934
+ receiptName: e.value.receiptName,
935
+ dialogConfig: {
936
+ cardTypes: e.value.cardTypes
937
+ }
938
+ })), p.onUpdate(a.value);
939
+ })
940
+ }, {
941
+ default: O(() => [
942
+ y(o, {
943
+ modelValue: e.value.ip,
944
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
945
+ label: "IP Address"
946
+ }, null, 8, ["modelValue"]),
947
+ y(o, {
948
+ modelValue: e.value.receiptName,
949
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
950
+ label: "Receipt Payment Name",
951
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
952
+ }, null, 8, ["modelValue"]),
953
+ I("div", ra, [
954
+ y(o, {
955
+ modelValue: r.value,
956
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
957
+ label: "Fallback Card Types",
958
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
959
+ }, null, 8, ["modelValue"]),
960
+ y(i, {
961
+ class: "ml-4",
962
+ icon: "add",
963
+ onClick: m
964
+ })
965
+ ]),
966
+ I("div", ia, [
967
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
968
+ key: n,
969
+ label: n,
970
+ removable: !0,
971
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
972
+ }, null, 8, ["label", "onChipClosed"]))), 128))
973
+ ]),
974
+ I("div", sa, [
975
+ l.value > -1 ? (g(), F(i, {
976
+ key: 0,
977
+ class: "flex-1",
978
+ variant: "secondary",
979
+ label: "Delete",
980
+ onclick: () => v(l.value)
981
+ }, null, 8, ["onclick"])) : U("", !0),
982
+ y(i, {
983
+ type: "submit",
984
+ class: "flex-1",
985
+ variant: "primary",
986
+ label: "Save"
987
+ })
988
+ ])
989
+ ]),
990
+ _: 1
991
+ }, 512);
992
+ };
993
+ }
994
+ }), ca = { class: "flex items-end" }, ma = { class: "flex flex-wrap gap-8 items-center mt-4" }, da = { class: "flex mt-6 space-x-6" }, pa = /* @__PURE__ */ h({
995
+ __name: "Maybank3Gateway",
996
+ props: {
997
+ terminal: {
998
+ type: Object,
999
+ required: !0
1000
+ },
1001
+ onUpdate: {
1002
+ type: Function,
1003
+ required: !0
1004
+ }
1005
+ },
1006
+ setup(T) {
1007
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1008
+ receiptName: "",
1009
+ config: {},
1010
+ cardTypes: []
1011
+ }), d = () => {
1012
+ e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1013
+ }, c = () => {
1014
+ var i;
1015
+ if (!a.value.ecrIntegrations)
1016
+ return d();
1017
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Maybank3");
1018
+ if (t === -1)
1019
+ return d();
1020
+ l.value = t;
1021
+ const o = s.at(t);
1022
+ o.gateway === "Maybank3" && o.config && (e.value = {
1023
+ config: o.config,
1024
+ receiptName: o.receiptName ?? "",
1025
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1026
+ });
1027
+ };
1028
+ A(a, c), q(c);
1029
+ async function v(s) {
1030
+ var t;
1031
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1032
+ }
1033
+ async function m() {
1034
+ e.value.cardTypes.push(r.value), r.value = "";
1035
+ }
1036
+ return (s, t) => {
1037
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1038
+ return g(), F(C, {
1039
+ ref: b.value,
1040
+ class: "flex flex-col gap-16 w-[500px]",
1041
+ onValidationSuccess: t[2] || (t[2] = () => {
1042
+ var n, x;
1043
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1044
+ gateway: "Maybank3",
1045
+ config: e.value.config,
1046
+ receiptName: e.value.receiptName,
1047
+ dialogConfig: {
1048
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1049
+ cardTypes: e.value.cardTypes
1050
+ }
1051
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1052
+ gateway: "Maybank3",
1053
+ config: e.value.config,
1054
+ receiptName: e.value.receiptName,
1055
+ dialogConfig: {
1056
+ cardTypes: e.value.cardTypes
1057
+ }
1058
+ })), p.onUpdate(a.value);
1059
+ })
1060
+ }, {
1061
+ default: O(() => [
1062
+ y(o, {
1063
+ modelValue: e.value.receiptName,
1064
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1065
+ label: "Receipt Payment Name",
1066
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1067
+ }, null, 8, ["modelValue"]),
1068
+ I("div", ca, [
1069
+ y(o, {
1070
+ modelValue: r.value,
1071
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1072
+ label: "Fallback Card Types",
1073
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1074
+ }, null, 8, ["modelValue"]),
1075
+ y(i, {
1076
+ class: "ml-4",
1077
+ icon: "add",
1078
+ onClick: m
1079
+ })
1080
+ ]),
1081
+ I("div", ma, [
1082
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1083
+ key: n,
1084
+ label: n,
1085
+ removable: !0,
1086
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1087
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1088
+ ]),
1089
+ I("div", da, [
1090
+ l.value > -1 ? (g(), F(i, {
1091
+ key: 0,
1092
+ class: "flex-1",
1093
+ variant: "secondary",
1094
+ label: "Delete",
1095
+ onclick: () => v(l.value)
1096
+ }, null, 8, ["onclick"])) : U("", !0),
1097
+ y(i, {
1098
+ type: "submit",
1099
+ class: "flex-1",
1100
+ variant: "primary",
1101
+ label: "Save"
1102
+ })
1103
+ ])
1104
+ ]),
1105
+ _: 1
1106
+ }, 512);
1107
+ };
1108
+ }
1109
+ }), va = { class: "flex items-end" }, ya = { class: "flex flex-wrap gap-8 items-center mt-4" }, fa = { class: "flex mt-6 space-x-6" }, ga = /* @__PURE__ */ h({
1110
+ __name: "NetsGateway",
1111
+ props: {
1112
+ terminal: {
1113
+ type: Object,
1114
+ required: !0
1115
+ },
1116
+ onUpdate: {
1117
+ type: Function,
1118
+ required: !0
1119
+ }
1120
+ },
1121
+ setup(T) {
1122
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1123
+ ip: "",
1124
+ receiptName: "",
1125
+ cardTypes: []
1126
+ }), d = () => {
1127
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1128
+ }, c = () => {
1129
+ var i;
1130
+ if (!a.value.ecrIntegrations)
1131
+ return d();
1132
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Nets");
1133
+ if (t === -1)
1134
+ return d();
1135
+ l.value = t;
1136
+ const o = s.at(t);
1137
+ o.gateway === "Nets" && o.config && (e.value = {
1138
+ ip: o.config.ip ?? "",
1139
+ receiptName: o.receiptName ?? "",
1140
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1141
+ });
1142
+ };
1143
+ A(a, c), q(c);
1144
+ async function v(s) {
1145
+ var t;
1146
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1147
+ }
1148
+ async function m() {
1149
+ e.value.cardTypes.push(r.value), r.value = "";
1150
+ }
1151
+ return (s, t) => {
1152
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1153
+ return g(), F(C, {
1154
+ ref: b.value,
1155
+ class: "flex flex-col gap-16 w-[500px]",
1156
+ onValidationSuccess: t[3] || (t[3] = () => {
1157
+ var n, x;
1158
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1159
+ gateway: "Nets",
1160
+ config: { ip: e.value.ip },
1161
+ receiptName: e.value.receiptName,
1162
+ dialogConfig: {
1163
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1164
+ cardTypes: e.value.cardTypes
1165
+ }
1166
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1167
+ gateway: "Nets",
1168
+ config: { ip: e.value.ip },
1169
+ receiptName: e.value.receiptName,
1170
+ dialogConfig: {
1171
+ cardTypes: e.value.cardTypes
1172
+ }
1173
+ })), p.onUpdate(a.value);
1174
+ })
1175
+ }, {
1176
+ default: O(() => [
1177
+ y(o, {
1178
+ modelValue: e.value.ip,
1179
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1180
+ label: "IP Address"
1181
+ }, null, 8, ["modelValue"]),
1182
+ y(o, {
1183
+ modelValue: e.value.receiptName,
1184
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1185
+ label: "Receipt Payment Name",
1186
+ "label-info": "Default receipt display will be 'TERMINAL_NETS'"
1187
+ }, null, 8, ["modelValue"]),
1188
+ I("div", va, [
1189
+ y(o, {
1190
+ modelValue: r.value,
1191
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1192
+ label: "Fallback Card Types",
1193
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1194
+ }, null, 8, ["modelValue"]),
1195
+ y(i, {
1196
+ class: "ml-4",
1197
+ icon: "add",
1198
+ onClick: m
1199
+ })
1200
+ ]),
1201
+ I("div", ya, [
1202
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1203
+ key: n,
1204
+ label: n,
1205
+ removable: !0,
1206
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1207
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1208
+ ]),
1209
+ I("div", fa, [
1210
+ l.value > -1 ? (g(), F(i, {
1211
+ key: 0,
1212
+ class: "flex-1",
1213
+ variant: "secondary",
1214
+ label: "Delete",
1215
+ onclick: () => v(l.value)
1216
+ }, null, 8, ["onclick"])) : U("", !0),
1217
+ y(i, {
1218
+ type: "submit",
1219
+ class: "flex-1",
1220
+ variant: "primary",
1221
+ label: "Save"
1222
+ })
1223
+ ])
1224
+ ]),
1225
+ _: 1
1226
+ }, 512);
1227
+ };
1228
+ }
1229
+ }), ba = { class: "flex items-end" }, _a = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ta = { class: "flex mt-6 space-x-6" }, Ia = /* @__PURE__ */ h({
1230
+ __name: "KBankGateway",
1231
+ props: {
1232
+ terminal: {
1233
+ type: Object,
1234
+ required: !0
1235
+ },
1236
+ onUpdate: {
1237
+ type: Function,
1238
+ required: !0
1239
+ }
1240
+ },
1241
+ setup(T) {
1242
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1243
+ receiptName: "",
1244
+ cardTypes: []
1245
+ }), d = () => {
1246
+ e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1247
+ }, c = () => {
1248
+ var i;
1249
+ if (!a.value.ecrIntegrations)
1250
+ return d();
1251
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Kbank");
1252
+ if (t === -1)
1253
+ return d();
1254
+ l.value = t;
1255
+ const o = s.at(t);
1256
+ o.gateway === "Kbank" && o.config && (e.value = {
1257
+ receiptName: o.receiptName ?? "",
1258
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1259
+ });
1260
+ };
1261
+ A(a, c), q(c);
1262
+ async function v(s) {
1263
+ var t;
1264
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1265
+ }
1266
+ async function m() {
1267
+ e.value.cardTypes.push(r.value), r.value = "";
1268
+ }
1269
+ return (s, t) => {
1270
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1271
+ return g(), F(C, {
1272
+ ref: b.value,
1273
+ class: "flex flex-col gap-16 w-[500px]",
1274
+ onValidationSuccess: t[2] || (t[2] = () => {
1275
+ var n, x;
1276
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1277
+ gateway: "Kbank",
1278
+ config: {},
1279
+ receiptName: e.value.receiptName,
1280
+ dialogConfig: {
1281
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1282
+ cardTypes: e.value.cardTypes
1283
+ }
1284
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1285
+ gateway: "Kbank",
1286
+ config: {},
1287
+ receiptName: e.value.receiptName,
1288
+ dialogConfig: {
1289
+ cardTypes: e.value.cardTypes
1290
+ }
1291
+ })), p.onUpdate(a.value);
1292
+ })
1293
+ }, {
1294
+ default: O(() => [
1295
+ y(o, {
1296
+ modelValue: e.value.receiptName,
1297
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1298
+ label: "Receipt Payment Name",
1299
+ "label-info": "Default receipt display will be 'TERMINAL_KBANK'"
1300
+ }, null, 8, ["modelValue"]),
1301
+ I("div", ba, [
1302
+ y(o, {
1303
+ modelValue: r.value,
1304
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1305
+ label: "Fallback Card Types",
1306
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1307
+ }, null, 8, ["modelValue"]),
1308
+ y(i, {
1309
+ class: "ml-4",
1310
+ icon: "add",
1311
+ onClick: m
1312
+ })
1313
+ ]),
1314
+ I("div", _a, [
1315
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1316
+ key: n,
1317
+ label: n,
1318
+ removable: !0,
1319
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1320
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1321
+ ]),
1322
+ I("div", Ta, [
1323
+ l.value > -1 ? (g(), F(i, {
1324
+ key: 0,
1325
+ class: "flex-1",
1326
+ variant: "secondary",
1327
+ label: "Delete",
1328
+ onclick: () => v(l.value)
1329
+ }, null, 8, ["onclick"])) : U("", !0),
1330
+ y(i, {
1331
+ type: "submit",
1332
+ class: "flex-1",
1333
+ variant: "primary",
1334
+ label: "Save"
1335
+ })
1336
+ ])
1337
+ ]),
1338
+ _: 1
1339
+ }, 512);
1340
+ };
1341
+ }
1342
+ }), Fa = { class: "flex mt-6 space-x-6" }, wa = /* @__PURE__ */ h({
1343
+ __name: "Ghl2Gateway",
1344
+ props: {
1345
+ terminal: {
1346
+ type: Object,
1347
+ required: !0
1348
+ },
1349
+ onUpdate: {
1350
+ type: Function,
1351
+ required: !0
1352
+ }
1353
+ },
1354
+ setup(T) {
1355
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _({
1356
+ ip: "",
1357
+ receiptName: ""
1358
+ }), e = () => {
1359
+ r.value.ip = "", r.value.receiptName = "", l.value = -1;
1360
+ }, d = () => {
1361
+ if (!a.value.ecrIntegrations)
1362
+ return e();
1363
+ const v = a.value.ecrIntegrations, m = v.findIndex((t) => t && t.gateway && t.gateway === "Ghl2");
1364
+ if (m === -1)
1365
+ return e();
1366
+ l.value = m;
1367
+ const s = v.at(m);
1368
+ s.gateway === "Ghl2" && s.config && (r.value = {
1369
+ ip: s.config.ip ?? "",
1370
+ receiptName: s.receiptName ?? ""
1371
+ });
1372
+ };
1373
+ A(a, d), q(d);
1374
+ async function c(v) {
1375
+ var m;
1376
+ (m = a.value.ecrIntegrations) == null || m.splice(v, 1), p.onUpdate(a.value);
1377
+ }
1378
+ return (v, m) => {
1379
+ const s = f("FmTextField"), t = f("FmButton"), o = f("FmForm");
1380
+ return g(), F(o, {
1381
+ ref: b.value,
1382
+ class: "flex flex-col gap-16 w-[500px]",
1383
+ onValidationSuccess: m[2] || (m[2] = () => {
1384
+ a.value.ecrIntegrations || (a.value.ecrIntegrations = []), l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1385
+ gateway: "Ghl2",
1386
+ config: { ip: r.value.ip },
1387
+ receiptName: r.value.receiptName
1388
+ } : a.value.ecrIntegrations.push({
1389
+ gateway: "Ghl2",
1390
+ config: { ip: r.value.ip },
1391
+ receiptName: r.value.receiptName
1392
+ }), p.onUpdate(a.value);
1393
+ })
1394
+ }, {
1395
+ default: O(() => [
1396
+ y(s, {
1397
+ modelValue: r.value.ip,
1398
+ "onUpdate:modelValue": m[0] || (m[0] = (i) => r.value.ip = i),
1399
+ label: "IP Address"
1400
+ }, null, 8, ["modelValue"]),
1401
+ y(s, {
1402
+ modelValue: r.value.receiptName,
1403
+ "onUpdate:modelValue": m[1] || (m[1] = (i) => r.value.receiptName = i),
1404
+ label: "Receipt Payment Name",
1405
+ "label-info": "Default receipt display will be 'TERMINAL_GHL_2'"
1406
+ }, null, 8, ["modelValue"]),
1407
+ I("div", Fa, [
1408
+ l.value > -1 ? (g(), F(t, {
1409
+ key: 0,
1410
+ class: "flex-1",
1411
+ variant: "secondary",
1412
+ label: "Delete",
1413
+ onclick: () => c(l.value)
1414
+ }, null, 8, ["onclick"])) : U("", !0),
1415
+ y(t, {
1416
+ type: "submit",
1417
+ class: "flex-1",
1418
+ variant: "primary",
1419
+ label: "Save"
1420
+ })
1421
+ ])
1422
+ ]),
1423
+ _: 1
1424
+ }, 512);
1425
+ };
1426
+ }
1427
+ }), xa = { class: "flex items-end" }, Ca = { class: "flex flex-wrap gap-8 items-center mt-4" }, ka = { class: "flex mt-6 space-x-6" }, Na = /* @__PURE__ */ h({
1428
+ __name: "Ghl3Gateway",
1429
+ props: {
1430
+ terminal: {
1431
+ type: Object,
1432
+ required: !0
1433
+ },
1434
+ onUpdate: {
1435
+ type: Function,
1436
+ required: !0
1437
+ }
1438
+ },
1439
+ setup(T) {
1440
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1441
+ receiptName: "",
1442
+ config: {},
1443
+ cardTypes: []
1444
+ }), d = () => {
1445
+ e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1446
+ }, c = () => {
1447
+ var i;
1448
+ if (!a.value.ecrIntegrations)
1449
+ return d();
1450
+ const s = a.value.ecrIntegrations, t = s.findIndex(
1451
+ (u) => u && u.gateway && u.gateway === "Ghl3"
1452
+ );
1453
+ if (t === -1)
1454
+ return d();
1455
+ l.value = t;
1456
+ const o = s.at(t);
1457
+ o.gateway === "Ghl3" && o.config && (e.value = {
1458
+ config: o.config,
1459
+ receiptName: o.receiptName ?? "",
1460
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1461
+ });
1462
+ };
1463
+ A(a, c), q(c);
1464
+ async function v(s) {
1465
+ var t;
1466
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1467
+ }
1468
+ async function m() {
1469
+ e.value.cardTypes.push(r.value), r.value = "";
1470
+ }
1471
+ return (s, t) => {
1472
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1473
+ return g(), F(C, {
1474
+ ref: b.value,
1475
+ class: "flex flex-col gap-16 w-[500px]",
1476
+ onValidationSuccess: t[2] || (t[2] = () => {
1477
+ var n, x;
1478
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1479
+ gateway: "Ghl3",
1480
+ config: e.value.config,
1481
+ receiptName: e.value.receiptName,
1482
+ dialogConfig: {
1483
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1484
+ cardTypes: e.value.cardTypes
1485
+ }
1486
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1487
+ gateway: "Ghl3",
1488
+ config: e.value.config,
1489
+ receiptName: e.value.receiptName,
1490
+ dialogConfig: {
1491
+ cardTypes: e.value.cardTypes
1492
+ }
1493
+ })), p.onUpdate(a.value);
1494
+ })
1495
+ }, {
1496
+ default: O(() => [
1497
+ y(o, {
1498
+ modelValue: e.value.receiptName,
1499
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1500
+ label: "Receipt Payment Name",
1501
+ "label-info": "Default receipt display will be 'TERMINAL_GHL'"
1502
+ }, null, 8, ["modelValue"]),
1503
+ I("div", xa, [
1504
+ y(o, {
1505
+ modelValue: r.value,
1506
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1507
+ label: "Fallback Card Types",
1508
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1509
+ }, null, 8, ["modelValue"]),
1510
+ y(i, {
1511
+ class: "ml-4",
1512
+ icon: "add",
1513
+ onClick: m
1514
+ })
1515
+ ]),
1516
+ I("div", Ca, [
1517
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1518
+ key: n,
1519
+ label: n,
1520
+ removable: !0,
1521
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1522
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1523
+ ]),
1524
+ I("div", ka, [
1525
+ l.value > -1 ? (g(), F(i, {
1526
+ key: 0,
1527
+ class: "flex-1",
1528
+ variant: "secondary",
1529
+ label: "Delete",
1530
+ onclick: () => v(l.value)
1531
+ }, null, 8, ["onclick"])) : U("", !0),
1532
+ y(i, {
1533
+ type: "submit",
1534
+ class: "flex-1",
1535
+ variant: "primary",
1536
+ label: "Save"
1537
+ })
1538
+ ])
1539
+ ]),
1540
+ _: 1
1541
+ }, 512);
1542
+ };
1543
+ }
1544
+ }), Va = { class: "flex items-end" }, Sa = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ua = { class: "flex mt-6 space-x-6" }, ha = /* @__PURE__ */ h({
1545
+ __name: "HlbbGateway",
1546
+ props: {
1547
+ terminal: {
1548
+ type: Object,
1549
+ required: !0
1550
+ },
1551
+ onUpdate: {
1552
+ type: Function,
1553
+ required: !0
1554
+ }
1555
+ },
1556
+ setup(T) {
1557
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1558
+ receiptName: "",
1559
+ config: {},
1560
+ cardTypes: []
1561
+ }), d = () => {
1562
+ e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1563
+ }, c = () => {
1564
+ var i;
1565
+ if (!a.value.ecrIntegrations)
1566
+ return d();
1567
+ const s = a.value.ecrIntegrations, t = s.findIndex(
1568
+ (u) => u && u.gateway && u.gateway === "Hlbb"
1569
+ );
1570
+ if (t === -1)
1571
+ return d();
1572
+ l.value = t;
1573
+ const o = s.at(t);
1574
+ o.gateway === "Hlbb" && o.config && (e.value = {
1575
+ config: o.config,
1576
+ receiptName: o.receiptName ?? "",
1577
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1578
+ });
1579
+ };
1580
+ A(a, c), q(c);
1581
+ async function v(s) {
1582
+ var t;
1583
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1584
+ }
1585
+ async function m() {
1586
+ e.value.cardTypes.push(r.value), r.value = "";
1587
+ }
1588
+ return (s, t) => {
1589
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1590
+ return g(), F(C, {
1591
+ ref: b.value,
1592
+ class: "flex flex-col gap-16 w-[500px]",
1593
+ onValidationSuccess: t[2] || (t[2] = () => {
1594
+ var n, x;
1595
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1596
+ gateway: "Hlbb",
1597
+ config: e.value.config,
1598
+ receiptName: e.value.receiptName,
1599
+ dialogConfig: {
1600
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1601
+ cardTypes: e.value.cardTypes
1602
+ }
1603
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1604
+ gateway: "Hlbb",
1605
+ config: e.value.config,
1606
+ receiptName: e.value.receiptName,
1607
+ dialogConfig: {
1608
+ cardTypes: e.value.cardTypes
1609
+ }
1610
+ })), p.onUpdate(a.value);
1611
+ })
1612
+ }, {
1613
+ default: O(() => [
1614
+ y(o, {
1615
+ modelValue: e.value.receiptName,
1616
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1617
+ label: "Receipt Payment Name",
1618
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1619
+ }, null, 8, ["modelValue"]),
1620
+ I("div", Va, [
1621
+ y(o, {
1622
+ modelValue: r.value,
1623
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1624
+ label: "Fallback Card Types",
1625
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1626
+ }, null, 8, ["modelValue"]),
1627
+ y(i, {
1628
+ class: "ml-4",
1629
+ icon: "add",
1630
+ onClick: m
1631
+ })
1632
+ ]),
1633
+ I("div", Sa, [
1634
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1635
+ key: n,
1636
+ label: n,
1637
+ removable: !0,
1638
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1639
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1640
+ ]),
1641
+ I("div", Ua, [
1642
+ l.value > -1 ? (g(), F(i, {
1643
+ key: 0,
1644
+ class: "flex-1",
1645
+ variant: "secondary",
1646
+ label: "Delete",
1647
+ onclick: () => v(l.value)
1648
+ }, null, 8, ["onclick"])) : U("", !0),
1649
+ y(i, {
1650
+ type: "submit",
1651
+ class: "flex-1",
1652
+ variant: "primary",
1653
+ label: "Save"
1654
+ })
1655
+ ])
1656
+ ]),
1657
+ _: 1
1658
+ }, 512);
1659
+ };
1660
+ }
1661
+ }), Ra = { class: "flex items-end" }, Pa = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ba = { class: "flex mt-6 space-x-6" }, Oa = /* @__PURE__ */ h({
1662
+ __name: "GlobalPaymentsGateway",
1663
+ props: {
1664
+ terminal: {
1665
+ type: Object,
1666
+ required: !0
1667
+ },
1668
+ onUpdate: {
1669
+ type: Function,
1670
+ required: !0
1671
+ }
1672
+ },
1673
+ setup(T) {
1674
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1675
+ ip: "",
1676
+ receiptName: "",
1677
+ cardTypes: []
1678
+ }), d = () => {
1679
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1680
+ }, c = () => {
1681
+ var i;
1682
+ if (!a.value.ecrIntegrations)
1683
+ return d();
1684
+ const s = a.value.ecrIntegrations, t = s.findIndex(
1685
+ (u) => u && u.gateway && u.gateway === "GlobalPayments"
1686
+ );
1687
+ if (t === -1)
1688
+ return d();
1689
+ l.value = t;
1690
+ const o = s.at(t);
1691
+ o.gateway === "GlobalPayments" && o.config && (e.value = {
1692
+ ip: o.config.ip ?? "",
1693
+ receiptName: o.receiptName ?? "",
1694
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1695
+ });
1696
+ };
1697
+ A(a, c), q(c);
1698
+ async function v(s) {
1699
+ var t;
1700
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1701
+ }
1702
+ async function m() {
1703
+ e.value.cardTypes.push(r.value), r.value = "";
1704
+ }
1705
+ return (s, t) => {
1706
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1707
+ return g(), F(C, {
1708
+ ref: b.value,
1709
+ class: "flex flex-col gap-16 w-[500px]",
1710
+ onValidationSuccess: t[3] || (t[3] = () => {
1711
+ var n, x;
1712
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1713
+ gateway: "GlobalPayments",
1714
+ config: { ip: e.value.ip },
1715
+ receiptName: e.value.receiptName,
1716
+ dialogConfig: {
1717
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1718
+ cardTypes: e.value.cardTypes
1719
+ }
1720
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1721
+ gateway: "GlobalPayments",
1722
+ config: { ip: e.value.ip },
1723
+ receiptName: e.value.receiptName,
1724
+ dialogConfig: {
1725
+ cardTypes: e.value.cardTypes
1726
+ }
1727
+ })), p.onUpdate(a.value);
1728
+ })
1729
+ }, {
1730
+ default: O(() => [
1731
+ y(o, {
1732
+ modelValue: e.value.ip,
1733
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1734
+ label: "IP Address"
1735
+ }, null, 8, ["modelValue"]),
1736
+ y(o, {
1737
+ modelValue: e.value.receiptName,
1738
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1739
+ label: "Receipt Payment Name",
1740
+ "label-info": "Default receipt display will be 'TERMINAL_GP'"
1741
+ }, null, 8, ["modelValue"]),
1742
+ I("div", Ra, [
1743
+ y(o, {
1744
+ modelValue: r.value,
1745
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1746
+ label: "Fallback Card Types",
1747
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1748
+ }, null, 8, ["modelValue"]),
1749
+ y(i, {
1750
+ class: "ml-4",
1751
+ icon: "add",
1752
+ onClick: m
1753
+ })
1754
+ ]),
1755
+ I("div", Pa, [
1756
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1757
+ key: n,
1758
+ label: n,
1759
+ removable: !0,
1760
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1761
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1762
+ ]),
1763
+ I("div", Ba, [
1764
+ l.value > -1 ? (g(), F(i, {
1765
+ key: 0,
1766
+ class: "flex-1",
1767
+ variant: "secondary",
1768
+ label: "Delete",
1769
+ onclick: () => v(l.value)
1770
+ }, null, 8, ["onclick"])) : U("", !0),
1771
+ y(i, {
1772
+ type: "submit",
1773
+ class: "flex-1",
1774
+ variant: "primary",
1775
+ label: "Save"
1776
+ })
1777
+ ])
1778
+ ]),
1779
+ _: 1
1780
+ }, 512);
1781
+ };
1782
+ }
1783
+ }), Ma = { class: "flex items-end" }, Aa = { class: "flex flex-wrap gap-8 items-center mt-4" }, qa = { class: "flex mt-6 space-x-6" }, Ga = /* @__PURE__ */ h({
1784
+ __name: "OmaGateway",
1785
+ props: {
1786
+ terminal: {
1787
+ type: Object,
1788
+ required: !0
1789
+ },
1790
+ onUpdate: {
1791
+ type: Function,
1792
+ required: !0
1793
+ }
1794
+ },
1795
+ setup(T) {
1796
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1797
+ receiptName: "",
1798
+ cardTypes: []
1799
+ }), d = () => {
1800
+ e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1801
+ }, c = () => {
1802
+ var i;
1803
+ if (!a.value.ecrIntegrations)
1804
+ return d();
1805
+ const s = a.value.ecrIntegrations, t = s.findIndex(
1806
+ (u) => u && u.gateway && u.gateway === "Oma"
1807
+ );
1808
+ if (t === -1)
1809
+ return d();
1810
+ l.value = t;
1811
+ const o = s.at(t);
1812
+ o.gateway === "Oma" && o.config && (e.value = {
1813
+ receiptName: o.receiptName ?? "",
1814
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1815
+ });
1816
+ };
1817
+ A(a, c), q(c);
1818
+ async function v(s) {
1819
+ var t;
1820
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1821
+ }
1822
+ async function m() {
1823
+ e.value.cardTypes.push(r.value), r.value = "";
1824
+ }
1825
+ return (s, t) => {
1826
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1827
+ return g(), F(C, {
1828
+ ref: b.value,
1829
+ class: "flex flex-col gap-16 w-[500px]",
1830
+ onValidationSuccess: t[2] || (t[2] = () => {
1831
+ var n, x;
1832
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1833
+ gateway: "Oma",
1834
+ config: {},
1835
+ receiptName: e.value.receiptName,
1836
+ dialogConfig: {
1837
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
1838
+ cardTypes: e.value.cardTypes
1839
+ }
1840
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1841
+ gateway: "Oma",
1842
+ config: {},
1843
+ receiptName: e.value.receiptName,
1844
+ dialogConfig: {
1845
+ cardTypes: e.value.cardTypes
1846
+ }
1847
+ })), p.onUpdate(a.value);
1848
+ })
1849
+ }, {
1850
+ default: O(() => [
1851
+ y(o, {
1852
+ modelValue: e.value.receiptName,
1853
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1854
+ label: "Receipt Payment Name",
1855
+ "label-info": "Default receipt display will be 'TERMINAL_OMA'"
1856
+ }, null, 8, ["modelValue"]),
1857
+ I("div", Ma, [
1858
+ y(o, {
1859
+ modelValue: r.value,
1860
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1861
+ label: "Fallback Card Types",
1862
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1863
+ }, null, 8, ["modelValue"]),
1864
+ y(i, {
1865
+ class: "ml-4",
1866
+ icon: "add",
1867
+ onClick: m
1868
+ })
1869
+ ]),
1870
+ I("div", Aa, [
1871
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
1872
+ key: n,
1873
+ label: n,
1874
+ removable: !0,
1875
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1876
+ }, null, 8, ["label", "onChipClosed"]))), 128))
1877
+ ]),
1878
+ I("div", qa, [
1879
+ l.value > -1 ? (g(), F(i, {
1880
+ key: 0,
1881
+ class: "flex-1",
1882
+ variant: "secondary",
1883
+ label: "Delete",
1884
+ onclick: () => v(l.value)
1885
+ }, null, 8, ["onclick"])) : U("", !0),
1886
+ y(i, {
1887
+ type: "submit",
1888
+ class: "flex-1",
1889
+ variant: "primary",
1890
+ label: "Save"
1891
+ })
1892
+ ])
1893
+ ]),
1894
+ _: 1
1895
+ }, 512);
1896
+ };
1897
+ }
1898
+ }), Da = { class: "flex items-end" }, $a = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ea = { class: "flex mt-6 space-x-6" }, La = /* @__PURE__ */ h({
1899
+ __name: "RevenueGateway",
1900
+ props: {
1901
+ terminal: {
1902
+ type: Object,
1903
+ required: !0
1904
+ },
1905
+ onUpdate: {
1906
+ type: Function,
1907
+ required: !0
1908
+ }
1909
+ },
1910
+ setup(T) {
1911
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
1912
+ receiptName: "",
1913
+ ip: "",
1914
+ cardTypes: []
1915
+ }), d = () => {
1916
+ e.value.receiptName = "", e.value.ip = "", e.value.cardTypes = [], l.value = -1;
1917
+ }, c = () => {
1918
+ var i;
1919
+ if (!a.value.ecrIntegrations)
1920
+ return d();
1921
+ const s = a.value.ecrIntegrations, t = s.findIndex(
1922
+ (u) => u && u.gateway && u.gateway === "Revenue"
1923
+ );
1924
+ if (t === -1)
1925
+ return d();
1926
+ l.value = t;
1927
+ const o = s.at(t);
1928
+ o.gateway === "Revenue" && o.config && (e.value = {
1929
+ receiptName: o.receiptName ?? "",
1930
+ ip: o.config.ip ?? "",
1931
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1932
+ });
1933
+ };
1934
+ A(a, c), q(c);
1935
+ async function v(s) {
1936
+ var t;
1937
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1938
+ }
1939
+ async function m() {
1940
+ e.value.cardTypes.push(r.value), r.value = "";
1941
+ }
1942
+ return (s, t) => {
1943
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
1944
+ return g(), F(C, {
1945
+ ref: b.value,
1946
+ class: "flex flex-col gap-16 w-[500px]",
1947
+ onValidationSuccess: t[3] || (t[3] = () => {
1948
+ var x, E;
1949
+ const n = {
1950
+ type: "tcp",
1951
+ ip: e.value.ip
1952
+ };
1953
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1954
+ gateway: "Revenue",
1955
+ config: n,
1956
+ receiptName: e.value.receiptName,
1957
+ dialogConfig: {
1958
+ ...(E = (x = a.value.ecrIntegrations) == null ? void 0 : x[l.value]) == null ? void 0 : E.dialogConfig,
1959
+ cardTypes: e.value.cardTypes
1960
+ }
1961
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1962
+ gateway: "Revenue",
1963
+ config: n,
1964
+ receiptName: e.value.receiptName,
1965
+ dialogConfig: {
1966
+ cardTypes: e.value.cardTypes
1967
+ }
1968
+ })), p.onUpdate(a.value);
1969
+ })
1970
+ }, {
1971
+ default: O(() => [
1972
+ y(o, {
1973
+ modelValue: e.value.ip,
1974
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1975
+ label: "Terminal IP Address",
1976
+ "label-info": "Terminal WiFi IP with optional port, e.g. 192.168.1.50:8080 (defaults to port 8080)",
1977
+ rules: N(X)(N(Z).string().min(1))
1978
+ }, null, 8, ["modelValue", "rules"]),
1979
+ y(o, {
1980
+ modelValue: e.value.receiptName,
1981
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1982
+ label: "Receipt Payment Name",
1983
+ "label-info": "Default receipt display will be 'TERMINAL_REVENUE'"
1984
+ }, null, 8, ["modelValue"]),
1985
+ I("div", Da, [
1986
+ y(o, {
1987
+ modelValue: r.value,
1988
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1989
+ label: "Fallback Card Types",
1990
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1991
+ }, null, 8, ["modelValue"]),
1992
+ y(i, {
1993
+ class: "ml-4",
1994
+ icon: "add",
1995
+ onClick: m
1996
+ })
1997
+ ]),
1998
+ I("div", $a, [
1999
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
2000
+ key: n,
2001
+ label: n,
2002
+ removable: !0,
2003
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
2004
+ }, null, 8, ["label", "onChipClosed"]))), 128))
2005
+ ]),
2006
+ I("div", Ea, [
2007
+ l.value > -1 ? (g(), F(i, {
2008
+ key: 0,
2009
+ class: "flex-1",
2010
+ variant: "secondary",
2011
+ label: "Delete",
2012
+ onclick: () => v(l.value)
2013
+ }, null, 8, ["onclick"])) : U("", !0),
2014
+ y(i, {
2015
+ type: "submit",
2016
+ class: "flex-1",
2017
+ variant: "primary",
2018
+ label: "Save"
2019
+ })
2020
+ ])
2021
+ ]),
2022
+ _: 1
2023
+ }, 512);
2024
+ };
2025
+ }
2026
+ }), Ya = {
2027
+ key: 0,
2028
+ class: "flex items-center justify-center min-h-[80vh]"
2029
+ }, ja = { class: "flex mt-6 space-x-6" }, Ka = /* @__PURE__ */ h({
2030
+ __name: "BeamGateway",
2031
+ props: {
2032
+ terminal: {
2033
+ type: Object,
2034
+ required: !0
2035
+ },
2036
+ onUpdate: {
2037
+ type: Function,
2038
+ required: !0
2039
+ }
2040
+ },
2041
+ setup(T) {
2042
+ const { isLoading: p, startAsyncCall: a } = J(), b = T, l = G(() => b.terminal), r = _(), e = _(), d = _(-1), c = _({
2043
+ externalTerminalId: ""
2044
+ }), v = () => {
2045
+ c.value.externalTerminalId = "", d.value = -1;
2046
+ }, m = () => {
2047
+ if (a(async () => {
2048
+ r.value = await fe.getRestaurantExternalTerminals(
2049
+ b.terminal.referenceId,
2050
+ "BEAM"
2051
+ );
2052
+ }), !b.terminal.ecrs)
2053
+ return v();
2054
+ const o = b.terminal.ecrs.findIndex((u) => u && u.gateway && u.gateway === "Beam");
2055
+ if (o === -1)
2056
+ return v();
2057
+ d.value = o;
2058
+ const i = b.terminal.ecrs.at(o);
2059
+ i.gateway === "Beam" && i.config && (c.value = {
2060
+ externalTerminalId: i.config.externalTerminalId
2061
+ });
2062
+ };
2063
+ A(l, m), q(m);
2064
+ const s = V(() => (r.value ?? []).map((o) => ({
2065
+ label: o.status === "READY" ? o.name : `${o.name} (unpaired)`,
2066
+ value: o._id
2067
+ })));
2068
+ async function t(o) {
2069
+ var i;
2070
+ (i = b.terminal.ecrs) == null || i.splice(o, 1), b.onUpdate(b.terminal);
2071
+ }
2072
+ return (o, i) => {
2073
+ const u = f("FmCircularProgress"), C = f("FmSelect"), n = f("FmButton"), x = f("FmForm");
2074
+ return N(p) ? (g(), S("div", Ya, [
2075
+ y(u, { size: "xxl" })
2076
+ ])) : (g(), F(x, {
2077
+ key: 1,
2078
+ ref: e.value,
2079
+ class: "flex flex-col gap-16 w-[500px]",
2080
+ onValidationSuccess: i[1] || (i[1] = () => {
2081
+ d.value > -1 ? l.value.ecrs[d.value] = { gateway: "Beam", config: c.value } : (l.value.ecrs || (l.value.ecrs = []), l.value.ecrs.push({ gateway: "Beam", config: c.value })), b.onUpdate(l.value);
2082
+ })
2083
+ }, {
2084
+ default: O(() => [
2085
+ y(C, {
2086
+ modelValue: c.value.externalTerminalId,
2087
+ "onUpdate:modelValue": i[0] || (i[0] = (E) => c.value.externalTerminalId = E),
2088
+ label: "External Terminal",
2089
+ items: s.value,
2090
+ rules: N(X)(N(Z).string().min(1, "External terminal is required"))
2091
+ }, null, 8, ["modelValue", "items", "rules"]),
2092
+ I("div", ja, [
2093
+ d.value > -1 ? (g(), F(n, {
2094
+ key: 0,
2095
+ class: "flex-1",
2096
+ variant: "secondary",
2097
+ label: "Delete",
2098
+ onclick: () => t(d.value)
2099
+ }, null, 8, ["onclick"])) : U("", !0),
2100
+ y(n, {
2101
+ type: "submit",
2102
+ class: "flex-1",
2103
+ variant: "primary",
2104
+ label: "Save"
2105
+ })
2106
+ ])
2107
+ ]),
2108
+ _: 1
2109
+ }, 512));
2110
+ };
2111
+ }
2112
+ }), Ha = {
2113
+ key: 0,
2114
+ class: "flex items-center justify-center min-h-[80vh]"
2115
+ }, za = { class: "flex mt-6 space-x-6" }, Qa = /* @__PURE__ */ h({
2116
+ __name: "BriGateway",
2117
+ props: {
2118
+ terminal: {
2119
+ type: Object,
2120
+ required: !0
2121
+ },
2122
+ onUpdate: {
2123
+ type: Function,
2124
+ required: !0
2125
+ }
2126
+ },
2127
+ setup(T) {
2128
+ const { isLoading: p, startAsyncCall: a } = J(), b = T, l = G(() => b.terminal), r = _(), e = _(), d = _(-1), c = _({
2129
+ externalTerminalId: ""
2130
+ }), v = () => {
2131
+ c.value.externalTerminalId = "", d.value = -1;
2132
+ }, m = () => {
2133
+ if (a(async () => {
2134
+ r.value = await fe.getRestaurantExternalTerminals(
2135
+ b.terminal.referenceId,
2136
+ "BRI"
2137
+ );
2138
+ }), !b.terminal.ecrs)
2139
+ return v();
2140
+ const i = b.terminal.ecrs.findIndex((C) => C && C.gateway && C.gateway === "Bri");
2141
+ if (i === -1)
2142
+ return v();
2143
+ d.value = i;
2144
+ const u = b.terminal.ecrs.at(i);
2145
+ u.gateway === "Bri" && u.config && (c.value = {
2146
+ externalTerminalId: u.config.externalTerminalId
2147
+ });
2148
+ };
2149
+ A(l, m), q(m);
2150
+ const s = V(() => (r.value ?? []).filter((i) => i.status === "READY").map((i) => ({ label: i.name, value: i._id }))), t = V(() => {
2151
+ if (s.value.length === 0)
2152
+ return "Please pair one BRI terminal under External Terminals before applying here.";
2153
+ });
2154
+ async function o(i) {
2155
+ var u;
2156
+ (u = b.terminal.ecrs) == null || u.splice(i, 1), b.onUpdate(b.terminal);
2157
+ }
2158
+ return (i, u) => {
2159
+ const C = f("FmCircularProgress"), n = f("FmSelect"), x = f("FmButton"), E = f("FmForm");
2160
+ return N(p) ? (g(), S("div", Ha, [
2161
+ y(C, { size: "xxl" })
2162
+ ])) : (g(), F(E, {
2163
+ key: 1,
2164
+ ref: e.value,
2165
+ class: "flex flex-col gap-16 w-[500px]",
2166
+ onValidationSuccess: u[1] || (u[1] = () => {
2167
+ d.value > -1 ? l.value.ecrs[d.value] = { gateway: "Bri", config: c.value } : (l.value.ecrs || (l.value.ecrs = []), l.value.ecrs.push({ gateway: "Bri", config: c.value })), b.onUpdate(l.value);
2168
+ })
2169
+ }, {
2170
+ default: O(() => [
2171
+ y(n, {
2172
+ modelValue: c.value.externalTerminalId,
2173
+ "onUpdate:modelValue": u[0] || (u[0] = (w) => c.value.externalTerminalId = w),
2174
+ label: "External Terminal",
2175
+ items: s.value,
2176
+ "helper-text": t.value,
2177
+ rules: N(X)(N(Z).string().min(1, "External terminal is required"))
2178
+ }, null, 8, ["modelValue", "items", "helper-text", "rules"]),
2179
+ I("div", za, [
2180
+ d.value > -1 ? (g(), F(x, {
2181
+ key: 0,
2182
+ class: "flex-1",
2183
+ variant: "secondary",
2184
+ label: "Delete",
2185
+ onclick: () => o(d.value)
2186
+ }, null, 8, ["onclick"])) : U("", !0),
2187
+ y(x, {
2188
+ type: "submit",
2189
+ class: "flex-1",
2190
+ variant: "primary",
2191
+ label: "Save"
2192
+ })
2193
+ ])
2194
+ ]),
2195
+ _: 1
2196
+ }, 512));
2197
+ };
2198
+ }
2199
+ }), Ja = { class: "flex items-end" }, Wa = { class: "flex flex-wrap gap-8 items-center mt-4" }, Xa = { class: "flex mt-6 space-x-6" }, Za = /* @__PURE__ */ h({
2200
+ __name: "PbbGateway",
2201
+ props: {
2202
+ terminal: {
2203
+ type: Object,
2204
+ required: !0
2205
+ },
2206
+ onUpdate: {
2207
+ type: Function,
2208
+ required: !0
2209
+ }
2210
+ },
2211
+ setup(T) {
2212
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _(), e = _({
2213
+ ip: "",
2214
+ receiptName: "",
2215
+ cardTypes: []
2216
+ }), d = () => {
2217
+ e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
2218
+ }, c = () => {
2219
+ var i;
2220
+ if (!a.value.ecrIntegrations)
2221
+ return d();
2222
+ const s = a.value.ecrIntegrations, t = s.findIndex((u) => u && u.gateway && u.gateway === "Pbb");
2223
+ if (t === -1)
2224
+ return d();
2225
+ l.value = t;
2226
+ const o = s.at(t);
2227
+ o.gateway === "Pbb" && o.config && (e.value = {
2228
+ ip: o.config.ip ?? "",
2229
+ receiptName: o.receiptName ?? "",
2230
+ cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
2231
+ });
2232
+ };
2233
+ A(a, c), q(c);
2234
+ async function v(s) {
2235
+ var t;
2236
+ (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
2237
+ }
2238
+ async function m() {
2239
+ e.value.cardTypes.push(r.value), r.value = "";
2240
+ }
2241
+ return (s, t) => {
2242
+ const o = f("FmTextField"), i = f("FmButton"), u = f("FmChip"), C = f("FmForm");
2243
+ return g(), F(C, {
2244
+ ref: b.value,
2245
+ class: "flex flex-col gap-16 w-[500px]",
2246
+ onValidationSuccess: t[3] || (t[3] = () => {
2247
+ var n, x;
2248
+ l.value > -1 ? a.value.ecrIntegrations[l.value] = {
2249
+ gateway: "Pbb",
2250
+ config: { ip: e.value.ip },
2251
+ receiptName: e.value.receiptName,
2252
+ dialogConfig: {
2253
+ ...(x = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : x.dialogConfig,
2254
+ cardTypes: e.value.cardTypes
2255
+ }
2256
+ } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
2257
+ gateway: "Pbb",
2258
+ config: { ip: e.value.ip },
2259
+ receiptName: e.value.receiptName,
2260
+ dialogConfig: {
2261
+ cardTypes: e.value.cardTypes
2262
+ }
2263
+ })), p.onUpdate(a.value);
2264
+ })
2265
+ }, {
2266
+ default: O(() => [
2267
+ y(o, {
2268
+ modelValue: e.value.ip,
2269
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
2270
+ label: "IP Address"
2271
+ }, null, 8, ["modelValue"]),
2272
+ y(o, {
2273
+ modelValue: e.value.receiptName,
2274
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
2275
+ label: "Receipt Payment Name",
2276
+ "label-info": "Default receipt display will be 'TERMINAL_PBB'"
2277
+ }, null, 8, ["modelValue"]),
2278
+ I("div", Ja, [
2279
+ y(o, {
2280
+ modelValue: r.value,
2281
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
2282
+ label: "Fallback Card Types",
2283
+ "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
2284
+ }, null, 8, ["modelValue"]),
2285
+ y(i, {
2286
+ class: "ml-4",
2287
+ icon: "add",
2288
+ onClick: m
2289
+ })
2290
+ ]),
2291
+ I("div", Wa, [
2292
+ (g(!0), S(D, null, L(e.value.cardTypes, (n) => (g(), F(u, {
2293
+ key: n,
2294
+ label: n,
2295
+ removable: !0,
2296
+ onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
2297
+ }, null, 8, ["label", "onChipClosed"]))), 128))
2298
+ ]),
2299
+ I("div", Xa, [
2300
+ l.value > -1 ? (g(), F(i, {
2301
+ key: 0,
2302
+ class: "flex-1",
2303
+ variant: "secondary",
2304
+ label: "Delete",
2305
+ onclick: () => v(l.value)
2306
+ }, null, 8, ["onclick"])) : U("", !0),
2307
+ y(i, {
2308
+ type: "submit",
2309
+ class: "flex-1",
2310
+ variant: "primary",
2311
+ label: "Save"
2312
+ })
2313
+ ])
2314
+ ]),
2315
+ _: 1
2316
+ }, 512);
2317
+ };
2318
+ }
2319
+ }), et = { class: "flex items-center" }, at = { class: "w-[260px] self-start" }, tt = { class: "flex-1" }, lt = /* @__PURE__ */ h({
2320
+ __name: "EcrGateway",
2321
+ props: {
2322
+ terminal: {
2323
+ type: Object,
2324
+ required: !0
2325
+ },
2326
+ onUpdate: {
2327
+ type: Function,
2328
+ required: !0
2329
+ }
2330
+ },
2331
+ setup(T) {
2332
+ var d;
2333
+ const p = T, a = [
2334
+ {
2335
+ label: "FeedMe Terminal",
2336
+ value: "terminal",
2337
+ render: Ze
2338
+ },
2339
+ {
2340
+ label: "GHL Terminal",
2341
+ value: "ghl",
2342
+ render: aa,
2343
+ region: [P.F_COUNTRY.enum.MY]
2344
+ },
2345
+ {
2346
+ label: "GHL2 Terminal",
2347
+ value: "ghl2",
2348
+ render: wa,
2349
+ region: [P.F_COUNTRY.enum.MY]
2350
+ },
2351
+ {
2352
+ label: "ITB Maybank Terminal",
2353
+ value: "mb-itb",
2354
+ render: oa,
2355
+ region: [P.F_COUNTRY.enum.MY]
2356
+ },
2357
+ {
2358
+ label: "PMA Maybank Terminal",
2359
+ value: "mb-pma",
2360
+ render: ua,
2361
+ region: [P.F_COUNTRY.enum.MY]
2362
+ },
2363
+ {
2364
+ label: "Paysys Maybank Terminal",
2365
+ value: "mb-paysys",
2366
+ render: pa,
2367
+ region: [P.F_COUNTRY.enum.MY]
2368
+ },
2369
+ {
2370
+ label: "Nets Terminal",
2371
+ value: "nets",
2372
+ render: ga,
2373
+ region: [P.F_COUNTRY.enum.SG]
2374
+ },
2375
+ {
2376
+ label: "KBank Terminal",
2377
+ value: "kbank",
2378
+ render: Ia,
2379
+ region: [P.F_COUNTRY.enum.TH]
2380
+ },
2381
+ {
2382
+ label: "GHL Terminal",
2383
+ value: "ghl3",
2384
+ render: Na,
2385
+ region: [P.F_COUNTRY.enum.TH]
2386
+ },
2387
+ {
2388
+ label: "Paysys HLBB Terminal",
2389
+ value: "hlbb",
2390
+ render: ha,
2391
+ region: [P.F_COUNTRY.enum.MY]
2392
+ },
2393
+ {
2394
+ label: "GPAP Terminal",
2395
+ value: "globalpayments",
2396
+ render: Oa,
2397
+ region: [P.F_COUNTRY.enum.SG]
2398
+ },
2399
+ {
2400
+ label: "OMA Terminal",
2401
+ value: "oma",
2402
+ render: Ga,
2403
+ region: [P.F_COUNTRY.enum.PK]
2404
+ },
2405
+ {
2406
+ label: "Revenue PBB Terminal",
2407
+ value: "revenue",
2408
+ render: La,
2409
+ region: [P.F_COUNTRY.enum.MY]
2410
+ },
2411
+ {
2412
+ label: "PBB Terminal",
2413
+ value: "pbb",
2414
+ render: Za,
2415
+ region: [P.F_COUNTRY.enum.MY]
2416
+ },
2417
+ {
2418
+ label: "Beam Terminal",
2419
+ value: "beam",
2420
+ render: Ka,
2421
+ region: [P.F_COUNTRY.enum.TH]
2422
+ },
2423
+ {
2424
+ label: "BRI Terminal",
2425
+ value: "bri",
2426
+ render: Qa,
2427
+ region: [P.F_COUNTRY.enum.ID]
2428
+ }
2429
+ ], b = V(() => a.find((c) => c.value === e.value)), l = ie().currentCountry, r = V(() => a.filter(
2430
+ (c) => !c.region || c.region.includes(l.value ?? P.F_COUNTRY.enum.MY)
2431
+ )), { gatewayTab: e } = oe({
2432
+ gatewayTab: (d = r.value[0]) == null ? void 0 : d.value
2433
+ });
2434
+ return (c, v) => {
2435
+ var s;
2436
+ const m = f("FmTabs");
2437
+ return g(), S("div", et, [
2438
+ I("div", at, [
2439
+ y(m, {
2440
+ "model-value": N(e),
2441
+ "onUpdate:modelValue": v[0] || (v[0] = (t) => ae(e) ? e.value = t : null),
2442
+ class: "mb-6",
2443
+ vertical: !0,
2444
+ items: r.value,
2445
+ "show-more-at": Number.POSITIVE_INFINITY
2446
+ }, null, 8, ["model-value", "items", "show-more-at"])
2447
+ ]),
2448
+ I("div", tt, [
2449
+ N(e) ? (g(), F(te((s = b.value) == null ? void 0 : s.render), le(ne({ key: 0 }, {
2450
+ terminal: p.terminal,
2451
+ onUpdate: p.onUpdate
2452
+ })), null, 16)) : U("", !0)
2453
+ ])
2454
+ ]);
2455
+ };
2456
+ }
2457
+ }), nt = { class: "flex mt-6 space-x-6" }, ot = /* @__PURE__ */ h({
2458
+ __name: "PromptPayGateway",
2459
+ props: {
2460
+ terminal: {
2461
+ type: Object,
2462
+ required: !0
2463
+ },
2464
+ onUpdate: {
2465
+ type: Function,
2466
+ required: !0
2467
+ }
2468
+ },
2469
+ setup(T) {
2470
+ const p = T, a = G(() => p.terminal), b = _(), l = _(-1), r = _({
2471
+ account: "",
2472
+ receiptName: ""
2473
+ }), e = () => {
2474
+ r.value.account = "", r.value.receiptName = "", l.value = -1;
2475
+ }, d = () => {
2476
+ if (!a.value.qrIntegrations)
2477
+ return e();
2478
+ const v = a.value.qrIntegrations, m = v.findIndex((t) => t && t.gateway && t.gateway === "PROMPTPAY");
2479
+ if (m === -1)
2480
+ return e();
2481
+ l.value = m;
2482
+ const s = v.at(m);
2483
+ s.gateway === "PROMPTPAY" && s.config && (r.value = {
2484
+ account: s.config.account ?? "",
2485
+ receiptName: s.receiptName ?? ""
2486
+ });
2487
+ };
2488
+ A(a, d), q(d);
2489
+ async function c(v) {
2490
+ var m;
2491
+ (m = a.value.qrIntegrations) == null || m.splice(v, 1), p.onUpdate(a.value);
2492
+ }
2493
+ return (v, m) => {
2494
+ const s = f("FmTextField"), t = f("FmButton"), o = f("FmForm");
2495
+ return g(), F(o, {
2496
+ ref: b.value,
2497
+ class: "flex flex-col gap-16 w-[500px]",
2498
+ onValidationSuccess: m[2] || (m[2] = () => {
2499
+ l.value > -1 ? a.value.qrIntegrations[l.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 })), p.onUpdate(a.value);
2500
+ })
2501
+ }, {
2502
+ default: O(() => [
2503
+ y(s, {
2504
+ modelValue: r.value.account,
2505
+ "onUpdate:modelValue": m[0] || (m[0] = (i) => r.value.account = i),
2506
+ label: "Thai Phone Number / Thai Naitonal ID",
2507
+ "label-info": "Thai Phone Number can be prefixed with 66 or 0 will be fine both will works well."
2508
+ }, null, 8, ["modelValue"]),
2509
+ y(s, {
2510
+ modelValue: r.value.receiptName,
2511
+ "onUpdate:modelValue": m[1] || (m[1] = (i) => r.value.receiptName = i),
2512
+ label: "Receipt Payment Name",
2513
+ "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
2514
+ }, null, 8, ["modelValue"]),
2515
+ I("div", nt, [
2516
+ l.value > -1 ? (g(), F(t, {
2517
+ key: 0,
2518
+ class: "flex-1",
2519
+ variant: "secondary",
2520
+ label: "Delete",
2521
+ onclick: () => c(l.value)
2522
+ }, null, 8, ["onclick"])) : U("", !0),
2523
+ y(t, {
2524
+ type: "submit",
2525
+ class: "flex-1",
2526
+ variant: "primary",
2527
+ label: "Save"
2528
+ })
2529
+ ])
2530
+ ]),
2531
+ _: 1
2532
+ }, 512);
2533
+ };
2534
+ }
2535
+ }), rt = { class: "flex items-center" }, it = { class: "w-[260px] self-start" }, st = { class: "flex-1" }, ut = /* @__PURE__ */ h({
2536
+ __name: "QrGateway",
2537
+ props: {
2538
+ terminal: {
2539
+ type: Object,
2540
+ required: !0
2541
+ },
2542
+ onUpdate: {
2543
+ type: Function,
2544
+ required: !0
2545
+ }
2546
+ },
2547
+ setup(T) {
2548
+ var d;
2549
+ const p = T, a = [
2550
+ {
2551
+ label: "PromptPay",
2552
+ value: "promptpay",
2553
+ render: ot,
2554
+ region: [P.F_COUNTRY.enum.TH]
2555
+ }
2556
+ ], b = V(() => a.find((c) => c.value === e.value)), l = ie().currentCountry, r = V(() => a.filter((c) => !c.region || c.region.includes(l.value ?? P.F_COUNTRY.enum.MY))), { gatewayTab: e } = oe({
2557
+ gatewayTab: (d = r.value[0]) == null ? void 0 : d.value
2558
+ });
2559
+ return (c, v) => {
2560
+ var s;
2561
+ const m = f("FmTabs");
2562
+ return g(), S("div", rt, [
2563
+ I("div", it, [
2564
+ y(m, {
2565
+ "model-value": N(e),
2566
+ "onUpdate:modelValue": v[0] || (v[0] = (t) => ae(e) ? e.value = t : null),
2567
+ class: "mb-6",
2568
+ vertical: !0,
2569
+ items: r.value
2570
+ }, null, 8, ["model-value", "items"])
2571
+ ]),
2572
+ I("div", st, [
2573
+ N(e) ? (g(), F(te((s = b.value) == null ? void 0 : s.render), le(ne({ key: 0 }, {
2574
+ terminal: p.terminal,
2575
+ onUpdate: p.onUpdate
2576
+ })), null, 16)) : U("", !0)
2577
+ ])
2578
+ ]);
2579
+ };
2580
+ }
2581
+ }), kt = /* @__PURE__ */ h({
2582
+ __name: "TerminalSetting",
2583
+ props: {
2584
+ terminalId: {
2585
+ type: String,
2586
+ required: !0
2587
+ }
2588
+ },
2589
+ setup(T) {
2590
+ const p = T, { tab: a } = oe({
2591
+ tab: "information"
2592
+ }), { isLoading: b, startAsyncCall: l } = J(!0), r = Ie(), e = me(), d = we(), { t: c } = re(), v = _();
2593
+ async function m(w, k) {
2594
+ l(async () => {
2595
+ try {
2596
+ await j.updateById(p.terminalId, {
2597
+ name: w.name,
2598
+ status: w.status,
2599
+ ecrs: w.ecrs ?? [],
2600
+ gateways: w.gateways ?? [],
2601
+ ecrIntegrations: w.ecrIntegrations ?? [],
2602
+ qrIntegrations: w.qrIntegrations ?? [],
2603
+ ...k ? { paymentCheckouts: k } : {}
2604
+ }), v.value = await j.readById(p.terminalId), e.open({
2605
+ type: "success",
2606
+ message: "Terminal updated successfully"
2607
+ });
2608
+ } catch (B) {
2609
+ e.open({
2610
+ type: "error",
2611
+ title: "Error occurs when update terminal",
2612
+ message: Q(B)
2613
+ });
2614
+ }
2615
+ });
2616
+ }
2617
+ const s = [
2618
+ {
2619
+ label: "Information",
2620
+ value: "information",
2621
+ icon: "overview",
2622
+ render: Ve
2623
+ },
2624
+ {
2625
+ label: "Setting Request",
2626
+ value: "settings",
2627
+ icon: "settings",
2628
+ render: Ee,
2629
+ onlyFor: ["TERMINAL"]
2630
+ },
2631
+ {
2632
+ label: "SoftPos Gateway",
2633
+ value: "softpos",
2634
+ icon: "payment",
2635
+ render: Je
2636
+ },
2637
+ {
2638
+ label: "ECR Gateway",
2639
+ value: "ecr",
2640
+ icon: "point_of_sale",
2641
+ render: lt,
2642
+ onlyFor: ["POS", "KIOSK"]
2643
+ },
2644
+ {
2645
+ label: "QR Gateway",
2646
+ value: "qr",
2647
+ icon: "qr_code",
2648
+ render: ut,
2649
+ onlyFor: ["POS", "KIOSK"]
2650
+ },
2651
+ {
2652
+ label: "Payment Checkout",
2653
+ value: "payment-checkout",
2654
+ icon: "tune",
2655
+ render: Ne,
2656
+ onlyFor: ["KIOSK", "POS"]
2657
+ }
2658
+ ], t = ve.FdoTerminalTemplateDeviceType.options, o = V(
2659
+ () => {
2660
+ var w;
2661
+ return t.includes(((w = v.value) == null ? void 0 : w.deviceType) ?? "");
2662
+ }
2663
+ );
2664
+ function i() {
2665
+ const w = v.value;
2666
+ d.open({
2667
+ title: "Save as Template",
2668
+ closeButton: !0,
2669
+ overlay: !0,
2670
+ contentComponent: Re
2671
+ }).onPrimary(async (k) => {
2672
+ d.close();
2673
+ try {
2674
+ await pe.create({
2675
+ name: k.name,
2676
+ description: k.description,
2677
+ businessId: w.restaurant.businessId,
2678
+ deviceType: w.deviceType,
2679
+ isDefault: k.isDefault,
2680
+ settings: {
2681
+ ecrs: (w.ecrs ?? []).map(({ gateway: B }) => ({ gateway: B })),
2682
+ ecrIntegrations: (w.ecrIntegrations ?? []).map(
2683
+ ({ gateway: B }) => ({ gateway: B })
2684
+ ),
2685
+ paymentCheckouts: w.paymentCheckouts ?? []
2686
+ }
2687
+ }), e.open({
2688
+ type: "success",
2689
+ message: "Setting template created successfully."
2690
+ });
2691
+ } catch (B) {
2692
+ e.open({
2693
+ type: "error",
2694
+ title: "Error occurs when create setting template",
2695
+ message: Q(B)
2696
+ });
2697
+ }
2698
+ });
2699
+ }
2700
+ async function u() {
2701
+ const w = v.value, k = await pe.readByBusiness(
2702
+ w.restaurant.businessId,
2703
+ w.deviceType
2704
+ );
2705
+ d.open({
2706
+ title: "Apply Template",
2707
+ closeButton: !0,
2708
+ overlay: !0,
2709
+ contentComponent: qe,
2710
+ contentComponentProps: { templates: k }
2711
+ }).onPrimary(async (B) => {
2712
+ d.close(), xe(
2713
+ d,
2714
+ "Apply Template",
2715
+ c("payment.terminal_template.scope_info"),
2716
+ async () => {
2717
+ l(async () => {
2718
+ try {
2719
+ await j.applyTemplate(p.terminalId, B.templateId), v.value = await j.readById(p.terminalId), e.open({
2720
+ type: "success",
2721
+ message: "Setting template applied successfully."
2722
+ });
2723
+ } catch ($) {
2724
+ e.open({
2725
+ type: "error",
2726
+ title: "Error occurs when apply setting template",
2727
+ message: Q($)
2728
+ });
2729
+ }
2730
+ });
2731
+ }
2732
+ );
2733
+ });
2734
+ }
2735
+ const C = V(
2736
+ () => o.value ? [
2737
+ { label: "Save as Template", fn: i },
2738
+ { label: "Apply Template", fn: u }
2739
+ ] : []
2740
+ );
2741
+ ie().currentCountry;
2742
+ const n = V(() => {
2743
+ var w;
2744
+ return (w = s.find((k) => k.value === a.value)) == null ? void 0 : w.render;
2745
+ });
2746
+ async function x() {
2747
+ l(async () => {
2748
+ v.value = await j.readById(p.terminalId);
2749
+ });
2750
+ }
2751
+ const E = V(() => s.filter(
2752
+ (w) => {
2753
+ var k;
2754
+ return !w.onlyFor || w.onlyFor.includes(((k = v.value) == null ? void 0 : k.deviceType) ?? "");
2755
+ }
2756
+ ));
2757
+ return q(x), (w, k) => {
2758
+ var $, K;
2759
+ const B = f("FmTabs");
2760
+ return g(), F(Fe, {
2761
+ title: `${($ = v.value) == null ? void 0 : $.deviceType} (${(K = v.value) == null ? void 0 : K._id})`,
2762
+ loading: N(b),
2763
+ actions: C.value,
2764
+ onBack: N(r).back
2765
+ }, {
2766
+ default: O(() => [
2767
+ y(B, {
2768
+ "model-value": N(a),
2769
+ "onUpdate:modelValue": k[0] || (k[0] = (H) => ae(a) ? a.value = H : null),
2770
+ class: "mb-6",
2771
+ items: E.value
2772
+ }, null, 8, ["model-value", "items"]),
2773
+ N(a) ? (g(), F(te(n.value), le(ne({ key: 0 }, {
2774
+ terminal: v.value,
2775
+ onUpdate: m
2776
+ })), null, 16)) : U("", !0)
2777
+ ]),
2778
+ _: 1
2779
+ }, 8, ["title", "loading", "actions", "onBack"]);
2780
+ };
2781
+ }
2782
+ });
2783
+ export {
2784
+ kt as default
2785
+ };