@feedmepos/mf-payment 1.10.10-dev → 1.10.12-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 (53) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-9WuuFDjT.js → Actions.vue_vue_type_script_setup_true_lang-DQ6b6ka6.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-ldlWrW9Q.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-o9d1MbP6.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-akhgShmK.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DPX2tK6O.js} +3 -3
  4. package/dist/{Chargeback-CtMcT0UY.js → Chargeback-BK3Knpvw.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-DcTe9_Kw.js → DocumentViewer.vue_vue_type_script_setup_true_lang-BHjfNVE1.js} +1 -1
  6. package/dist/ExternalTerminal-CjJ1_NWZ.js +611 -0
  7. package/dist/{OnboardForm-C1YdmeW-.js → OnboardForm-CC9evxPa.js} +6 -6
  8. package/dist/{OnboardForm-CIDn7WlN.js → OnboardForm-fd3VsDJx.js} +6 -6
  9. package/dist/{OnboardSubmission-CmVQtQJG.js → OnboardSubmission-Bq17sJEw.js} +3 -3
  10. package/dist/{OnboardSubmission-B3duCbsE.js → OnboardSubmission-Q3TFyj7q.js} +6 -6
  11. package/dist/{PaymentCheckout-7U8JxO5z.js → PaymentCheckout-DuBWXJ7J.js} +2 -2
  12. package/dist/{PayoutAccount-TAivPO00.js → PayoutAccount-BtpxwPIL.js} +7 -7
  13. package/dist/{PayoutAccount-BkxTsLX6.js → PayoutAccount-JuYzRI09.js} +5 -5
  14. package/dist/{PayoutAccountSetting-CDaWFEPa.js → PayoutAccountSetting-BUxg8C3e.js} +6 -6
  15. package/dist/{Restaurant-D6w0vJTh.js → Restaurant-CUXKmf5_.js} +4 -4
  16. package/dist/{RestaurantSetting-B-jZzQw2.js → RestaurantSetting-ahYgoZQu.js} +3 -3
  17. package/dist/{Settlement-CSbH4KiM.js → Settlement-CUV-HfVC.js} +3 -3
  18. package/dist/{Settlement-87K0HOpH.js → Settlement-DPb549PU.js} +4 -4
  19. package/dist/{SettlementTransactions-s2E_-8CH.js → SettlementTransactions-DNNLmFfY.js} +5 -5
  20. package/dist/{SettlementTransactions-CXxia4xu.js → SettlementTransactions-l3b8YO2c.js} +5 -5
  21. package/dist/{Status.vue_vue_type_script_setup_true_lang-BNHfv19U.js → Status.vue_vue_type_script_setup_true_lang-v7piP5aI.js} +1 -1
  22. package/dist/{Terminal-DVnNwm5e.js → Terminal-C8jwG3Cv.js} +6 -6
  23. package/dist/{TerminalSetting-Dq4ABFSO.js → TerminalSetting-wW8AIAGH.js} +89 -90
  24. package/dist/{TerminalTemplate-BJNexUYY.js → TerminalTemplate-DHiugzSC.js} +5 -5
  25. package/dist/{TerminalTemplateSetting-bN8ClI5N.js → TerminalTemplateSetting-DA50VCKg.js} +5 -5
  26. package/dist/{Transaction-BGx9Ipte.js → Transaction-CZRCv-3t.js} +12 -12
  27. package/dist/{Transaction-C4hbtZ91.js → Transaction-CzTTkQri.js} +10 -10
  28. package/dist/{TransactionOld-DGq4_O6h.js → TransactionOld-D-4iUrDw.js} +7 -7
  29. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-Bl8qusoC.js → TransactionStatus.vue_vue_type_script_setup_true_lang-CHcGrTSW.js} +1 -1
  30. package/dist/{app-0Fho9eki.js → app-BmFJOd-Z.js} +26 -26
  31. package/dist/app.js +1 -1
  32. package/dist/{assets-CQo4lzcb.js → assets-CTtKWVYg.js} +1 -1
  33. package/dist/{grafana-BqdRvJYT.js → grafana-DhemMHSo.js} +1 -1
  34. package/dist/{index-BF1GN-0Q.js → index-3wP84h0B.js} +1 -1
  35. package/dist/{index--59tM3Ls.js → index-BSmZ1Vyk.js} +1 -1
  36. package/dist/{index-B5qSd5kn.js → index-C8AxHnhC.js} +1 -1
  37. package/dist/{index-I2OCChpQ.js → index-CUSLUawv.js} +2 -2
  38. package/dist/{index-Bz9YYVw5.js → index-CVCyz5Yi.js} +1 -1
  39. package/dist/{index-BdafJZPj.js → index-D4pYdk0h.js} +1 -1
  40. package/dist/{index-DyIn6r7H.js → index-DjHETHgh.js} +1 -1
  41. package/dist/{index-CelDa-QS.js → index-Dtk_lPn7.js} +1 -1
  42. package/dist/{index-ClDlsfj-.js → index-RC1zD9dC.js} +1 -1
  43. package/dist/{index-BU7MW9VF.js → index-_O7z64Rk.js} +1 -1
  44. package/dist/{index-_bVFsKJt.js → index-fs6f3Sbe.js} +1 -1
  45. package/dist/{index.vue_vue_type_script_setup_true_lang-Cj4WYjoE.js → index.vue_vue_type_script_setup_true_lang-DuAmnioV.js} +1 -1
  46. package/dist/{onboard-submission-cOodl8vE.js → onboard-submission-D66nrLNT.js} +1 -1
  47. package/dist/package.json +1 -1
  48. package/dist/{payout-account-DqxT4m5x.js → payout-account-DZIq3q35.js} +3 -3
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/{useQuery-2ksfJQXW.js → useQuery-D4qzUQ-g.js} +1 -1
  51. package/dist/views/admin/external-terminal/config/BRITerminal.vue.d.ts +8 -0
  52. package/package.json +1 -1
  53. package/dist/ExternalTerminal-lOIxzrYN.js +0 -596
@@ -0,0 +1,611 @@
1
+ import { defineComponent as E, openBlock as g, createElementBlock as A, toDisplayString as Y, resolveComponent as v, createBlock as C, withCtx as B, createElementVNode as w, unref as s, computed as S, normalizeClass as ee, createVNode as c, createCommentVNode as R, ref as p, Fragment as H, useModel as te, watch as W, resolveDynamicComponent as Z, mergeModels as L, createTextVNode as N, normalizeProps as ae, guardReactiveProps as ne, isRef as re, h as O } from "vue";
2
+ import { h as le } from "./moment-h96o7c8I.js";
3
+ import { useCoreStore as G } from "@feedmepos/mf-common";
4
+ import { u as oe } from "./index-CVCyz5Yi.js";
5
+ import { _ as ie } from "./index.vue_vue_type_script_setup_true_lang-DuAmnioV.js";
6
+ import { _ as se } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
+ import { useSnackbar as Q, useDialogChild as ue, useDialog as me } from "@feedmepos/ui-library";
8
+ import { e as h } from "./index-BSmZ1Vyk.js";
9
+ import { c as de } from "./clipboard-4jh1WteU.js";
10
+ import { g as ce } from "./assets-CTtKWVYg.js";
11
+ import { z as V, a as T } from "./validator-CTlVogBQ.js";
12
+ import { _ as pe } from "./AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DPX2tK6O.js";
13
+ import { e as j, p as ve } from "./index-C8AxHnhC.js";
14
+ import { u as z } from "./error-K1CakhA9.js";
15
+ import { w as fe } from "./Modal-DB8M9o1T.js";
16
+ const ye = /* @__PURE__ */ E({
17
+ __name: "ID",
18
+ props: {
19
+ data: {}
20
+ },
21
+ setup(u) {
22
+ const o = u, l = Q();
23
+ function a() {
24
+ try {
25
+ de(o.data), l.open({ title: "Text copied to clipboard." }, 1e3);
26
+ } catch {
27
+ l.open({ title: "Clipboard API incompatible." }, 1e3);
28
+ }
29
+ }
30
+ return (i, r) => (g(), A("div", {
31
+ onClick: r[0] || (r[0] = (n) => {
32
+ n.stopPropagation(), a();
33
+ })
34
+ }, Y(u.data), 1));
35
+ }
36
+ }), _e = ["src"], ge = /* @__PURE__ */ E({
37
+ __name: "Provider",
38
+ props: {
39
+ row: {},
40
+ data: {}
41
+ },
42
+ setup(u) {
43
+ return (o, l) => {
44
+ const a = v("FmTooltip");
45
+ return g(), C(a, {
46
+ variant: "plain",
47
+ placement: "top",
48
+ content: u.data ?? u.row.original.type,
49
+ "hide-arrow": !0
50
+ }, {
51
+ default: B(() => [
52
+ w("img", {
53
+ class: "rounded-md border-transparent w-[32px] h-[32px]",
54
+ src: s(ce)(u.data ?? u.row.original.type)
55
+ }, null, 8, _e)
56
+ ]),
57
+ _: 1
58
+ }, 8, ["content"]);
59
+ };
60
+ }
61
+ }), xe = { class: "flex items-center gap-2" }, Fe = /* @__PURE__ */ E({
62
+ __name: "Status",
63
+ props: {
64
+ data: {}
65
+ },
66
+ setup(u) {
67
+ const o = u, l = S(
68
+ () => o.data === "READY" ? "bg-green-400" : "bg-amber-400"
69
+ );
70
+ return (a, i) => (g(), A("div", xe, [
71
+ w("div", {
72
+ class: ee(["w-[8px] h-[8px] rounded-full shrink-0", l.value])
73
+ }, null, 2),
74
+ w("div", null, Y(u.data), 1)
75
+ ]));
76
+ }
77
+ }), be = { class: "flex items-center justify-center" }, Ve = /* @__PURE__ */ E({
78
+ __name: "Actions",
79
+ props: {
80
+ data: {}
81
+ },
82
+ emits: ["pair", "edit", "delete"],
83
+ setup(u, { emit: o }) {
84
+ const l = o;
85
+ return (a, i) => {
86
+ const r = v("FmButton"), n = v("FmTooltip");
87
+ return g(), A("div", be, [
88
+ u.data.status === "NEW" ? (g(), C(n, {
89
+ key: 0,
90
+ variant: "plain",
91
+ placement: "top",
92
+ content: "Pair",
93
+ "hide-arrow": !0
94
+ }, {
95
+ default: B(() => [
96
+ c(r, {
97
+ variant: "plain",
98
+ "prepend-icon": "link",
99
+ onClick: i[0] || (i[0] = (m) => {
100
+ m.stopPropagation(), l("pair");
101
+ })
102
+ })
103
+ ]),
104
+ _: 1
105
+ })) : R("", !0),
106
+ c(r, {
107
+ variant: "plain",
108
+ "prepend-icon": "edit",
109
+ onClick: i[1] || (i[1] = (m) => {
110
+ m.stopPropagation(), l("edit");
111
+ })
112
+ }),
113
+ c(r, {
114
+ variant: "plain",
115
+ "prepend-icon": "delete",
116
+ onClick: i[2] || (i[2] = (m) => {
117
+ m.stopPropagation(), l("delete");
118
+ })
119
+ })
120
+ ]);
121
+ };
122
+ }
123
+ }), Te = /* @__PURE__ */ E({
124
+ __name: "BRITerminal",
125
+ props: {
126
+ initial: {
127
+ type: Object
128
+ }
129
+ },
130
+ setup(u, { expose: o }) {
131
+ var F, P, D, I, U;
132
+ const l = u, a = [
133
+ { label: "ZUS", value: "ZUS" },
134
+ { label: "Custom", value: "CUSTOM" }
135
+ ], i = p(
136
+ ((F = l.initial) == null ? void 0 : F.configType) ?? "ZUS"
137
+ ), r = p(((P = l.initial) == null ? void 0 : P.wsUrl) ?? ""), n = p(((D = l.initial) == null ? void 0 : D.mid) ?? ""), m = p(((I = l.initial) == null ? void 0 : I.apiKey) ?? ""), _ = p(((U = l.initial) == null ? void 0 : U.privateKey) ?? ""), x = S(() => i.value === "CUSTOM");
138
+ return o({
139
+ values: () => x.value ? {
140
+ configType: i.value,
141
+ wsUrl: r.value,
142
+ mid: n.value,
143
+ apiKey: m.value,
144
+ privateKey: _.value
145
+ } : { configType: i.value }
146
+ }), (t, e) => {
147
+ const y = v("FmSelect"), b = v("FmTextField"), f = v("FmTextarea");
148
+ return g(), A(H, null, [
149
+ c(y, {
150
+ modelValue: i.value,
151
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => i.value = d),
152
+ label: "Connection Config",
153
+ items: a,
154
+ rules: s(V)(s(T).string().min(1, "Connection config is required"))
155
+ }, null, 8, ["modelValue", "rules"]),
156
+ x.value ? (g(), A(H, { key: 0 }, [
157
+ c(b, {
158
+ modelValue: r.value,
159
+ "onUpdate:modelValue": e[1] || (e[1] = (d) => r.value = d),
160
+ label: "PVS WebSocket URL",
161
+ placeholder: "wss://...",
162
+ rules: s(V)(s(T).string().min(1, "WebSocket URL is required"))
163
+ }, null, 8, ["modelValue", "rules"]),
164
+ c(b, {
165
+ modelValue: n.value,
166
+ "onUpdate:modelValue": e[2] || (e[2] = (d) => n.value = d),
167
+ label: "Merchant ID (MID)",
168
+ rules: s(V)(s(T).string().min(1, "MID is required"))
169
+ }, null, 8, ["modelValue", "rules"]),
170
+ c(b, {
171
+ modelValue: m.value,
172
+ "onUpdate:modelValue": e[3] || (e[3] = (d) => m.value = d),
173
+ label: "API Key",
174
+ rules: s(V)(s(T).string().min(1, "API key is required"))
175
+ }, null, 8, ["modelValue", "rules"]),
176
+ c(f, {
177
+ modelValue: _.value,
178
+ "onUpdate:modelValue": e[4] || (e[4] = (d) => _.value = d),
179
+ label: "Private Key",
180
+ rows: 3,
181
+ placeholder: "PEM, or base64 of the PEM",
182
+ rules: s(V)(s(T).string().min(1, "Private key is required"))
183
+ }, null, 8, ["modelValue", "rules"])
184
+ ], 64)) : R("", !0)
185
+ ], 64);
186
+ };
187
+ }
188
+ }), Ce = /* @__PURE__ */ E({
189
+ __name: "ExternalTerminalSideSheet",
190
+ props: /* @__PURE__ */ L({
191
+ terminal: {
192
+ type: Object
193
+ }
194
+ }, {
195
+ modelValue: { type: Boolean, default: !1 },
196
+ modelModifiers: {}
197
+ }),
198
+ emits: /* @__PURE__ */ L(["submit"], ["update:modelValue"]),
199
+ setup(u, { emit: o }) {
200
+ const l = G(), a = u, i = o, r = te(u, "modelValue"), n = p(), m = p(), _ = p(""), x = p(""), F = p(), P = p({}), D = {
201
+ BEAM: [j.F_COUNTRY.enum.TH],
202
+ BRI: [j.F_COUNTRY.enum.ID]
203
+ }, I = {
204
+ BRI: Te
205
+ }, U = l.currentCountry, t = S(
206
+ () => ve.FdoExternalTerminalProvider.options.filter(
207
+ (f) => D[f].includes(U.value ?? j.F_COUNTRY.enum.MY)
208
+ ).map((f) => ({
209
+ label: f,
210
+ value: f
211
+ }))
212
+ ), e = S(() => {
213
+ var f;
214
+ return ((f = a.terminal) == null ? void 0 : f.type) ?? F.value;
215
+ }), y = S(
216
+ () => e.value ? I[e.value] : void 0
217
+ );
218
+ W(r, (f) => {
219
+ var d, M, $, q;
220
+ f && (_.value = ((d = a.terminal) == null ? void 0 : d.name) ?? "", x.value = ((M = a.terminal) == null ? void 0 : M.restaurantId) ?? "", F.value = ($ = a.terminal) == null ? void 0 : $.type, P.value = { ...((q = a.terminal) == null ? void 0 : q.providerData) ?? {} });
221
+ });
222
+ function b() {
223
+ i("submit", {
224
+ name: _.value,
225
+ restaurantId: x.value,
226
+ type: F.value,
227
+ providerData: m.value ? { ...P.value, ...m.value.values() } : void 0
228
+ }), r.value = !1;
229
+ }
230
+ return (f, d) => {
231
+ const M = v("FmSelect"), $ = v("FmTextField"), q = v("FmButton"), J = v("FmForm"), X = v("FmSideSheet");
232
+ return g(), C(X, {
233
+ modelValue: r.value,
234
+ "onUpdate:modelValue": d[3] || (d[3] = (K) => r.value = K),
235
+ header: a.terminal ? "Update External Terminal" : "Create New External Terminal",
236
+ "close-button": ""
237
+ }, {
238
+ default: B(() => [
239
+ c(J, {
240
+ ref: n.value,
241
+ class: "flex flex-col gap-16 px-4 py-6",
242
+ onValidationSuccess: b
243
+ }, {
244
+ default: B(() => {
245
+ var K;
246
+ return [
247
+ a.terminal ? R("", !0) : (g(), C(M, {
248
+ key: 0,
249
+ modelValue: F.value,
250
+ "onUpdate:modelValue": d[0] || (d[0] = (k) => F.value = k),
251
+ label: "Provider",
252
+ items: t.value,
253
+ rules: s(V)(s(T).string().min(1, "Provider is required"))
254
+ }, null, 8, ["modelValue", "items", "rules"])),
255
+ a.terminal ? R("", !0) : (g(), C(pe, {
256
+ key: 1,
257
+ modelValue: x.value,
258
+ "onUpdate:modelValue": d[1] || (d[1] = (k) => x.value = k),
259
+ label: "Restaurant",
260
+ "search-placeholder": "Search restaurants",
261
+ rules: s(V)(s(T).string().min(1, "Restaurant is required"))
262
+ }, null, 8, ["modelValue", "rules"])),
263
+ c($, {
264
+ modelValue: _.value,
265
+ "onUpdate:modelValue": d[2] || (d[2] = (k) => _.value = k),
266
+ label: "Terminal Name",
267
+ rules: s(V)(s(T).string().min(1))
268
+ }, null, 8, ["modelValue", "rules"]),
269
+ y.value ? (g(), C(Z(y.value), {
270
+ key: `${((K = a.terminal) == null ? void 0 : K._id) ?? "new"}-${e.value}`,
271
+ ref_key: "configForm",
272
+ ref: m,
273
+ initial: P.value
274
+ }, null, 8, ["initial"])) : R("", !0),
275
+ c(q, {
276
+ type: "submit",
277
+ label: a.terminal ? "Update" : "Create"
278
+ }, null, 8, ["label"])
279
+ ];
280
+ }),
281
+ _: 1
282
+ }, 512)
283
+ ]),
284
+ _: 1
285
+ }, 8, ["modelValue", "header"]);
286
+ };
287
+ }
288
+ }), we = { class: "t-caption" }, Ee = /* @__PURE__ */ E({
289
+ __name: "BeamTerminal",
290
+ props: {
291
+ terminal: {
292
+ type: Object,
293
+ required: !0
294
+ },
295
+ onPair: {
296
+ type: Function,
297
+ required: !0
298
+ }
299
+ },
300
+ setup(u) {
301
+ const o = u, l = p(), a = p("");
302
+ return (i, r) => {
303
+ const n = v("FmTextField"), m = v("FmButton"), _ = v("FmForm");
304
+ return g(), C(_, {
305
+ ref: l.value,
306
+ class: "flex flex-col gap-16 mb-6",
307
+ onValidationSuccess: r[1] || (r[1] = () => o.onPair({ type: "BEAM", pairCode: a.value }))
308
+ }, {
309
+ default: B(() => [
310
+ w("div", we, [
311
+ r[2] || (r[2] = N(" Enter the pairing code shown on ", -1)),
312
+ w("b", null, Y(o.terminal.name), 1),
313
+ r[3] || (r[3] = N(" to register it with Bolt Connect. ", -1))
314
+ ]),
315
+ c(n, {
316
+ modelValue: a.value,
317
+ "onUpdate:modelValue": r[0] || (r[0] = (x) => a.value = x),
318
+ label: "Pair Code",
319
+ "label-mark": "required",
320
+ rules: s(V)(s(T).string().min(1, "Pair code is required"))
321
+ }, null, 8, ["modelValue", "rules"]),
322
+ c(m, {
323
+ type: "submit",
324
+ label: "Pair"
325
+ })
326
+ ]),
327
+ _: 1
328
+ }, 512);
329
+ };
330
+ }
331
+ }), Pe = { class: "t-caption" }, Se = /* @__PURE__ */ E({
332
+ __name: "BRITerminal",
333
+ props: {
334
+ terminal: {
335
+ type: Object,
336
+ required: !0
337
+ },
338
+ onPair: {
339
+ type: Function,
340
+ required: !0
341
+ }
342
+ },
343
+ setup(u) {
344
+ const o = u, l = p(), a = p(""), i = p("");
345
+ return (r, n) => {
346
+ const m = v("FmTextField"), _ = v("FmButton"), x = v("FmForm");
347
+ return g(), C(x, {
348
+ ref: l.value,
349
+ class: "flex flex-col gap-16 mb-6",
350
+ onValidationSuccess: n[2] || (n[2] = () => o.onPair({ type: "BRI", pairCode: a.value, edcId: i.value }))
351
+ }, {
352
+ default: B(() => [
353
+ w("div", Pe, [
354
+ n[3] || (n[3] = N(" Enter the pairing code and EDC ID shown on ", -1)),
355
+ w("b", null, Y(o.terminal.name), 1),
356
+ n[4] || (n[4] = N(" to register it with BRI. ", -1))
357
+ ]),
358
+ c(m, {
359
+ modelValue: a.value,
360
+ "onUpdate:modelValue": n[0] || (n[0] = (F) => a.value = F),
361
+ label: "Pair Code",
362
+ "label-mark": "required",
363
+ rules: s(V)(s(T).string().min(1, "Pair code is required"))
364
+ }, null, 8, ["modelValue", "rules"]),
365
+ c(m, {
366
+ modelValue: i.value,
367
+ "onUpdate:modelValue": n[1] || (n[1] = (F) => i.value = F),
368
+ label: "EDC ID",
369
+ "label-mark": "required",
370
+ rules: s(V)(s(T).string().min(1, "EDC ID is required"))
371
+ }, null, 8, ["modelValue", "rules"]),
372
+ c(_, {
373
+ type: "submit",
374
+ label: "Pair"
375
+ })
376
+ ]),
377
+ _: 1
378
+ }, 512);
379
+ };
380
+ }
381
+ }), Be = /* @__PURE__ */ E({
382
+ __name: "ExternalTerminalPairDialog",
383
+ props: {
384
+ terminal: {
385
+ type: Object,
386
+ required: !0
387
+ }
388
+ },
389
+ setup(u) {
390
+ const o = u, l = ue(), a = {
391
+ BEAM: Ee,
392
+ BRI: Se
393
+ }, i = S(() => a[o.terminal.type]);
394
+ function r(n) {
395
+ l.emitData(n), l.emitAction("primary");
396
+ }
397
+ return (n, m) => (g(), C(Z(i.value), ae(ne({
398
+ terminal: o.terminal,
399
+ onPair: r
400
+ })), null, 16));
401
+ }
402
+ }), De = { class: "flex justify-between mb-6 items-center" }, Ie = { class: "flex space-x-4" }, Ue = { class: "flex space-x-4" }, We = /* @__PURE__ */ E({
403
+ __name: "ExternalTerminal",
404
+ setup(u) {
405
+ const o = p(), { searchKey: l } = oe({
406
+ searchKey: ""
407
+ });
408
+ let a;
409
+ W(l, async () => {
410
+ a && clearTimeout(a), a = setTimeout(() => {
411
+ var t;
412
+ return (t = o.value) == null ? void 0 : t.reset();
413
+ }, 700);
414
+ });
415
+ const i = G(), r = me(), n = Q();
416
+ S(
417
+ () => new Map(i.restaurants.value.map((t) => [t._id, t.profile.name]))
418
+ );
419
+ const m = p(!1), _ = p();
420
+ function x(t) {
421
+ _.value = t, m.value = !0;
422
+ }
423
+ async function F(t) {
424
+ var y;
425
+ const e = _.value;
426
+ try {
427
+ e ? await h.updateById(
428
+ e._id,
429
+ t.type === "BRI" ? {
430
+ type: "BRI",
431
+ name: t.name,
432
+ providerData: t.providerData
433
+ } : { type: "BEAM", name: t.name }
434
+ ) : await h.create(t), (y = o.value) == null || y.reset(), n.open({
435
+ type: "success",
436
+ message: e ? "External terminal updated successfully." : "External terminal created successfully."
437
+ });
438
+ } catch (b) {
439
+ n.open({
440
+ type: "error",
441
+ title: e ? "Error occurs when update external terminal" : "Error occurs when create external terminal",
442
+ message: z(b)
443
+ });
444
+ }
445
+ }
446
+ async function P(t) {
447
+ r.open({
448
+ title: "Pair External Terminal",
449
+ closeButton: !0,
450
+ overlay: !0,
451
+ contentComponent: Be,
452
+ contentComponentProps: { terminal: t }
453
+ }).onPrimary(async (e) => {
454
+ var y;
455
+ r.close();
456
+ try {
457
+ await h.pair(t._id, e), (y = o.value) == null || y.reset(), n.open({
458
+ type: "success",
459
+ message: "External terminal paired successfully."
460
+ });
461
+ } catch (b) {
462
+ n.open({
463
+ type: "error",
464
+ title: "Error occurs when pair external terminal",
465
+ message: z(b)
466
+ });
467
+ }
468
+ });
469
+ }
470
+ async function D(t) {
471
+ fe(
472
+ r,
473
+ "Delete External Terminal",
474
+ "Are you sure to delete this external terminal? This action cannot be revert!",
475
+ async () => {
476
+ var e;
477
+ try {
478
+ await h.delete(t), (e = o.value) == null || e.reset(), n.open({
479
+ type: "success",
480
+ message: "External terminal deleted successfully."
481
+ });
482
+ } catch (y) {
483
+ n.open({
484
+ type: "error",
485
+ title: "Error occurs when delete external terminal",
486
+ message: z(y)
487
+ });
488
+ }
489
+ }
490
+ );
491
+ }
492
+ const I = function(t) {
493
+ return {
494
+ id: t._id,
495
+ status: t.status,
496
+ name: t.name,
497
+ type: t.type,
498
+ restaurant: t.restaurantId,
499
+ updatedAt: le(t.updatedAt).format("YYYY-MM-DD HH:mm:ss")
500
+ };
501
+ }, U = [
502
+ {
503
+ accessorKey: "id",
504
+ header: () => "Terminal ID",
505
+ meta: {
506
+ textAlign: "right"
507
+ },
508
+ cell: ({ cell: t }) => O(ye, { data: t.getValue() })
509
+ },
510
+ {
511
+ accessorKey: "name",
512
+ header: () => "Name",
513
+ meta: {
514
+ textAlign: "left"
515
+ }
516
+ },
517
+ {
518
+ accessorKey: "type",
519
+ header: () => "Provider",
520
+ meta: {
521
+ textAlign: "left"
522
+ },
523
+ cell: ({ cell: t, row: e }) => O(ge, { row: e, data: t.getValue() })
524
+ },
525
+ {
526
+ accessorKey: "restaurant",
527
+ header: () => "Restaurant",
528
+ meta: {
529
+ textAlign: "left"
530
+ }
531
+ },
532
+ {
533
+ accessorKey: "status",
534
+ header: () => "Status",
535
+ meta: {
536
+ textAlign: "left"
537
+ },
538
+ cell: ({ cell: t }) => O(Fe, { data: t.getValue() })
539
+ },
540
+ {
541
+ accessorKey: "updatedAt",
542
+ header: () => "Last Updated",
543
+ meta: {
544
+ textAlign: "left"
545
+ }
546
+ },
547
+ {
548
+ accessorKey: "id",
549
+ header: () => "Actions",
550
+ meta: {
551
+ textAlign: "center"
552
+ },
553
+ cell: ({ row: t }) => {
554
+ var y;
555
+ const e = (y = o.value) == null ? void 0 : y.pageData().at(t.index);
556
+ return O(Ve, {
557
+ data: e,
558
+ onPair: () => P(e),
559
+ onEdit: () => x(e),
560
+ onDelete: () => D(e._id)
561
+ });
562
+ }
563
+ }
564
+ ];
565
+ return (t, e) => {
566
+ const y = v("FmSearch"), b = v("FmButton");
567
+ return g(), C(se, {
568
+ title: "External Terminals",
569
+ loading: !1
570
+ }, {
571
+ default: B(() => [
572
+ w("div", De, [
573
+ w("div", Ie, [
574
+ c(y, {
575
+ "model-value": s(l),
576
+ "onUpdate:modelValue": e[0] || (e[0] = (f) => re(l) ? l.value = f : null),
577
+ class: "mr-8",
578
+ label: "Search",
579
+ placeholder: "Search ..."
580
+ }, null, 8, ["model-value"])
581
+ ]),
582
+ w("div", Ue, [
583
+ c(b, {
584
+ label: "Create",
585
+ icon: "add",
586
+ onClick: e[1] || (e[1] = () => x())
587
+ })
588
+ ])
589
+ ]),
590
+ c(ie, {
591
+ ref_key: "controller",
592
+ ref: o,
593
+ "column-defs": U,
594
+ "rows-defs": I,
595
+ paginate: (f, d) => s(h).read({ searchKey: s(l), limit: f, cursor: d })
596
+ }, null, 8, ["paginate"]),
597
+ c(Ce, {
598
+ modelValue: m.value,
599
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => m.value = f),
600
+ terminal: _.value,
601
+ onSubmit: F
602
+ }, null, 8, ["modelValue", "terminal"])
603
+ ]),
604
+ _: 1
605
+ });
606
+ };
607
+ }
608
+ });
609
+ export {
610
+ We as default
611
+ };
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as gA, ref as d, computed as h, resolveComponent as N, openBlock as t, createElementBlock as l, createElementVNode as B, toDisplayString as $, renderSlot as mA, createCommentVNode as f, Fragment as AA, createBlock as S, withCtx as D, createVNode as i, unref as K, watch as CA, onMounted as zA, renderList as wA, createTextVNode as PA, nextTick as WA, h as HA, resolveDynamicComponent as JA } from "vue";
2
2
  import { z as V, a as e } from "./validator-CTlVogBQ.js";
3
- import { _ as dA, P as xA } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-DcTe9_Kw.js";
3
+ import { _ as dA, P as xA } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-BHjfNVE1.js";
4
4
  import { useCoreStore as qA, useI18n as bA } from "@feedmepos/mf-common";
5
- import { o as FA } from "./index-I2OCChpQ.js";
6
- import { p as EA } from "./index-CelDa-QS.js";
5
+ import { o as FA } from "./index-CUSLUawv.js";
6
+ import { p as EA } from "./index-Dtk_lPn7.js";
7
7
  import { useSnackbar as IA, useFormChild as uA, useDialog as yA } from "@feedmepos/ui-library";
8
- import { u as lA } from "./index-B5qSd5kn.js";
8
+ import { u as lA } from "./index-C8AxHnhC.js";
9
9
  import { s as OA } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
- import { P as sA } from "./payout-account-DqxT4m5x.js";
11
- import { a as hA } from "./onboard-submission-cOodl8vE.js";
10
+ import { P as sA } from "./payout-account-DZIq3q35.js";
11
+ import { a as hA } from "./onboard-submission-D66nrLNT.js";
12
12
  import { useRouter as ZA } from "vue-router";
13
13
  import { _ as LA } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const _A = { class: "flex" }, $A = { class: "justify-self-center font-semibold" }, Ao = {
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as X, ref as j, computed as z, resolveComponent as N, openBlock as d, createElementBlock as w, createElementVNode as a, toDisplayString as F, createBlock as D, withCtx as f, createCommentVNode as $, createVNode as n, unref as e, Fragment as K, renderList as G, createTextVNode as J, onMounted as Ve, resolveDynamicComponent as ve } from "vue";
2
- import { o as M } from "./index-I2OCChpQ.js";
3
- import { u as ee, p as de } from "./index-B5qSd5kn.js";
2
+ import { o as M } from "./index-CUSLUawv.js";
3
+ import { u as ee, p as de } from "./index-C8AxHnhC.js";
4
4
  import { useRouter as fe } from "vue-router";
5
5
  import { z as i, a as u } from "./validator-CTlVogBQ.js";
6
- import { P as ke } from "./payout-account-DqxT4m5x.js";
7
- import { a as Ce } from "./onboard-submission-cOodl8vE.js";
8
- import { _ as me } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-DcTe9_Kw.js";
6
+ import { P as ke } from "./payout-account-DZIq3q35.js";
7
+ import { a as Ce } from "./onboard-submission-D66nrLNT.js";
8
+ import { _ as me } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-BHjfNVE1.js";
9
9
  import { s as Ne } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
- import { _ as pe } from "./Status.vue_vue_type_script_setup_true_lang-BNHfv19U.js";
10
+ import { _ as pe } from "./Status.vue_vue_type_script_setup_true_lang-v7piP5aI.js";
11
11
  import { useSnackbar as oe } from "@feedmepos/ui-library";
12
12
  import { u as Q } from "./error-K1CakhA9.js";
13
13
  const Se = ["src"], re = ".png, .jpg, .jpeg", ie = ".pdf", P = /* @__PURE__ */ X({
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as pA, ref as Y, computed as W, onMounted as gA, watch as vA, onBeforeUnmount as PA, resolveComponent as T, openBlock as l, createBlock as R, unref as t, withCtx as Z, createElementVNode as o, createVNode as x, createElementBlock as f, Fragment as U, renderList as K, normalizeClass as BA, toDisplayString as a, createTextVNode as B, createCommentVNode as C } from "vue";
2
2
  import { _ as DA } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
3
- import { u as wA, p as u, e as iA } from "./index-B5qSd5kn.js";
3
+ import { u as wA, p as u, e as iA } from "./index-C8AxHnhC.js";
4
4
  import { u as N } from "./error-K1CakhA9.js";
5
5
  import { useI18n as xA, useCoreStore as HA } from "@feedmepos/mf-common";
6
6
  import { useSnackbar as LA } from "@feedmepos/ui-library";
7
7
  import { _ as TA } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-D08ykrWf.js";
8
- import { b as q } from "./onboard-submission-cOodl8vE.js";
9
- import { o as G } from "./index-I2OCChpQ.js";
8
+ import { b as q } from "./onboard-submission-D66nrLNT.js";
9
+ import { o as G } from "./index-CUSLUawv.js";
10
10
  import { useRouter as CA } from "vue-router";
11
11
  import { c as QA } from "./index-MdV54cWO.js";
12
12
  import { s as OA, t as zA } from "./tyro-BovmsorS.js";
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as S, ref as w, watch as c, computed as f, resolveComponent as y, openBlock as O, createBlock as k, withCtx as _, createElementVNode as K, createVNode as m, isRef as n, unref as o, h as F } from "vue";
2
- import { o as R } from "./index-I2OCChpQ.js";
3
- import { p as b } from "./index-B5qSd5kn.js";
4
- import { _ as C } from "./index.vue_vue_type_script_setup_true_lang-Cj4WYjoE.js";
2
+ import { o as R } from "./index-CUSLUawv.js";
3
+ import { p as b } from "./index-C8AxHnhC.js";
4
+ import { _ as C } from "./index.vue_vue_type_script_setup_true_lang-DuAmnioV.js";
5
5
  import { useRouter as D } from "vue-router";
6
6
  import { _ as E } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
7
  import { h as N } from "./moment-h96o7c8I.js";
8
- import { u as T } from "./index-Bz9YYVw5.js";
8
+ import { u as T } from "./index-CVCyz5Yi.js";
9
9
  import { _ as U } from "./SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js";
10
- import { _ as I } from "./Status.vue_vue_type_script_setup_true_lang-BNHfv19U.js";
11
- import { O as Y } from "./onboard-submission-cOodl8vE.js";
10
+ import { _ as I } from "./Status.vue_vue_type_script_setup_true_lang-v7piP5aI.js";
11
+ import { O as Y } from "./onboard-submission-D66nrLNT.js";
12
12
  const $ = { class: "flex items-start mb-6" }, X = /* @__PURE__ */ S({
13
13
  __name: "OnboardSubmission",
14
14
  setup(P) {