@feedmepos/mf-payment 1.7.12-dev → 1.7.13-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.
- package/dist/{Actions.vue_vue_type_script_setup_true_lang-DdBG90HC.js → Actions.vue_vue_type_script_setup_true_lang-DKbFt19d.js} +1 -1
- package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-C2J73WMk.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CYINzYbC.js} +3 -3
- package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-tYdz0j81.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DB8LUEfh.js} +18 -18
- package/dist/{Chargeback-D_wFz2p4.js → Chargeback-BwcZYKn5.js} +5 -5
- package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-CGNrd4fE.js → DocumentViewer.vue_vue_type_script_setup_true_lang-CODzsno1.js} +1 -1
- package/dist/{OnboardForm-B102bmRL.js → OnboardForm-CC7LXEtA.js} +5 -5
- package/dist/{OnboardForm-CMRWUCyg.js → OnboardForm-DCUIhVeC.js} +5 -5
- package/dist/{OnboardSubmission-CPMns68t.js → OnboardSubmission-CJh6pvlF.js} +6 -6
- package/dist/{OnboardSubmission-DpkSlN4r.js → OnboardSubmission-CSNvxuCL.js} +3 -3
- package/dist/{PayoutAccount-D6eA7HmO.js → PayoutAccount-BE5F8g4z.js} +7 -7
- package/dist/{PayoutAccount-BNGyzqNn.js → PayoutAccount-Bc-QXp9Z.js} +5 -5
- package/dist/{PayoutAccountSetting-DS78fsR3.js → PayoutAccountSetting-j0aKSx_-.js} +6 -6
- package/dist/{Restaurant-Cio7VUkb.js → Restaurant-D8YMArgh.js} +4 -4
- package/dist/{RestaurantSetting-B6gL7KQL.js → RestaurantSetting-C21MrBa_.js} +3 -3
- package/dist/{Settlement-Dp5vZd70.js → Settlement-BmaaEovM.js} +4 -4
- package/dist/{Settlement-DeFs2PQv.js → Settlement-DHG0DQQg.js} +3 -3
- package/dist/{SettlementTransactions-Dp8voo7Z.js → SettlementTransactions-CN3zXJbo.js} +5 -5
- package/dist/{SettlementTransactions-CIxhmKO6.js → SettlementTransactions-DDS1ErG2.js} +5 -5
- package/dist/{Status.vue_vue_type_script_setup_true_lang-pJqWxDgv.js → Status.vue_vue_type_script_setup_true_lang-DdRCQWrX.js} +1 -1
- package/dist/{Terminal-l_eDclB4.js → Terminal-DV1UrU5A.js} +5 -5
- package/dist/TerminalSetting-1mIdAGRo.js +4040 -0
- package/dist/{Transaction-Cquf2CrF.js → Transaction-CCFoCKuX.js} +11 -11
- package/dist/{Transaction-CY7_Dise.js → Transaction-m2ehBLF3.js} +10 -10
- package/dist/{TransactionOld-BP_TbT0Z.js → TransactionOld-BWyoWD2y.js} +7 -7
- package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-C949IMDd.js → TransactionStatus.vue_vue_type_script_setup_true_lang-CnN9VpnR.js} +1 -1
- package/dist/{app-C1R-s4Ra.js → app-DVh5BkiD.js} +36 -36
- package/dist/app.js +1 -1
- package/dist/{assets-C0Lm2EH8.js → assets-CKGbYt2a.js} +1 -1
- package/dist/{grafana-B85M84CD.js → grafana-mFYRCAIa.js} +1 -1
- package/dist/{index-BBVX5lcY.js → index-BkO4kBjb.js} +1 -1
- package/dist/{index-OIrlcwQj.js → index-Bt7DnAP_.js} +1 -1
- package/dist/{index-DW5Pjtqn.js → index-Cd7XRC_S.js} +1 -1
- package/dist/{index-DjwoAOnA.js → index-DVdShtXJ.js} +1 -1
- package/dist/{index-DpHk2KjO.js → index-Dj7yP-aF.js} +1 -1
- package/dist/{index-DYGKTL5K.js → index-DxnQ5ooP.js} +2 -2
- package/dist/{index-DrvpGxk3.js → index-UjyzGTcy.js} +1 -1
- package/dist/{index-Oou8q_A6.js → index-tVtzJEJC.js} +1 -1
- package/dist/{index-llYeDBcp.js → index-yMztvQQr.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-7YqB76ok.js → index.vue_vue_type_script_setup_true_lang-BtGRP3_c.js} +1 -1
- package/dist/{onboard-submission-BvMXI4-2.js → onboard-submission-DdlCGuJd.js} +1 -1
- package/dist/package.json +2 -2
- package/dist/{payout-account-DS6DzoQ6.js → payout-account-B7R3qzXg.js} +19 -19
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/TerminalSetting-xEgYGJQR.js +0 -6863
|
@@ -0,0 +1,4040 @@
|
|
|
1
|
+
import { defineComponent as H, openBlock as b, createElementBlock as R, Fragment as oe, createElementVNode as I, createTextVNode as Ve, toDisplayString as Re, ref as T, resolveComponent as _, createVNode as y, createCommentVNode as Y, unref as V, computed as $, isRef as Oe, createBlock as N, resolveDynamicComponent as vt, normalizeProps as gt, mergeProps as yt, watch as ne, onBeforeUnmount as ka, toRef as ce, onMounted as re, withCtx as ae, renderList as be, toRefs as Da, reactive as Ea, h as Va, getCurrentInstance as Rt, nextTick as ra, onUnmounted as Oa } from "vue";
|
|
2
|
+
import { u as ht, p as Ua, e as W } from "./index-DVdShtXJ.js";
|
|
3
|
+
import { useRouter as Ma } from "vue-router";
|
|
4
|
+
import { t as Ue } from "./index-tVtzJEJC.js";
|
|
5
|
+
import { _ as Pa } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
|
|
6
|
+
import { u as bt } from "./index-yMztvQQr.js";
|
|
7
|
+
import { useSnackbar as qt, useDialog as Aa } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as nt } from "./error-K1CakhA9.js";
|
|
9
|
+
import { useI18n as Ra, useCoreStore as _t } from "@feedmepos/mf-common";
|
|
10
|
+
import { o as qa } from "./index-DxnQ5ooP.js";
|
|
11
|
+
import { c as Ba } from "./index-MdV54cWO.js";
|
|
12
|
+
import { z as ia, a as sa } from "./validator-CTlVogBQ.js";
|
|
13
|
+
import { g as Ga } from "./assets-CKGbYt2a.js";
|
|
14
|
+
import { w as Ya } from "./Modal-DB8M9o1T.js";
|
|
15
|
+
import { _ as La } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
|
+
const $a = /* @__PURE__ */ H({
|
|
17
|
+
__name: "Information",
|
|
18
|
+
props: {
|
|
19
|
+
terminal: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: !0
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(e) {
|
|
25
|
+
return (a, t) => (b(), R(oe, null, [
|
|
26
|
+
t[0] || (t[0] = I("b", null, "Name", -1)),
|
|
27
|
+
Ve(": " + Re(e.terminal.name), 1),
|
|
28
|
+
t[1] || (t[1] = I("br", null, null, -1)),
|
|
29
|
+
t[2] || (t[2] = I("b", null, "Status", -1)),
|
|
30
|
+
Ve(": " + Re(e.terminal.status), 1),
|
|
31
|
+
t[3] || (t[3] = I("br", null, null, -1)),
|
|
32
|
+
t[4] || (t[4] = I("b", null, "Device ID", -1)),
|
|
33
|
+
Ve(": " + Re(e.terminal.deviceId ?? "-"), 1),
|
|
34
|
+
t[5] || (t[5] = I("br", null, null, -1)),
|
|
35
|
+
t[6] || (t[6] = I("b", null, "Device Type", -1)),
|
|
36
|
+
Ve(": " + Re(e.terminal.deviceType ?? "-"), 1),
|
|
37
|
+
t[7] || (t[7] = I("br", null, null, -1))
|
|
38
|
+
], 64));
|
|
39
|
+
}
|
|
40
|
+
}), ja = { key: 0 }, Ha = { class: "mt-6 space-x-6" }, Xa = /* @__PURE__ */ H({
|
|
41
|
+
__name: "KioskMode",
|
|
42
|
+
props: {
|
|
43
|
+
terminal: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: !0
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
setup(e) {
|
|
49
|
+
const { isLoading: a, startAsyncCall: t } = ht(!1), l = qt(), o = T({
|
|
50
|
+
enable: !1,
|
|
51
|
+
password: []
|
|
52
|
+
}), r = e;
|
|
53
|
+
function n() {
|
|
54
|
+
return o.value.enable && o.value.password.filter((p) => !!p).length !== 6 ? l.open({
|
|
55
|
+
type: "error",
|
|
56
|
+
message: "Unlock PIN is required when setting up kiosk mode for terminal."
|
|
57
|
+
}) : t(async () => {
|
|
58
|
+
const p = { enable: o.value.enable };
|
|
59
|
+
p.enable && Object.assign(p, {
|
|
60
|
+
password: o.value.password.join("")
|
|
61
|
+
});
|
|
62
|
+
const s = await Ue.kioskModeRequest(r.terminal._id, p);
|
|
63
|
+
if (s === "OK")
|
|
64
|
+
return l.open({ type: "info", message: "Kiosk mode applied successfully." });
|
|
65
|
+
let f = s;
|
|
66
|
+
return s === "client_not_connected" && (f = "Terminal not connected to the websocket server."), s.startsWith("terminal: ") && (f = s.replaceAll("terminal: ", "")), l.open({
|
|
67
|
+
type: "error",
|
|
68
|
+
message: f
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return (p, s) => {
|
|
73
|
+
const f = _("FmSwitch"), d = _("FmPinField"), m = _("FmButton");
|
|
74
|
+
return b(), R(oe, null, [
|
|
75
|
+
y(f, {
|
|
76
|
+
modelValue: o.value.enable,
|
|
77
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => o.value.enable = i),
|
|
78
|
+
label: "Enable Kiosk Mode?"
|
|
79
|
+
}, null, 8, ["modelValue"]),
|
|
80
|
+
o.value.enable ? (b(), R("div", ja, [
|
|
81
|
+
s[2] || (s[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
|
|
82
|
+
y(d, {
|
|
83
|
+
modelValue: o.value.password,
|
|
84
|
+
"onUpdate:modelValue": s[1] || (s[1] = (i) => o.value.password = i)
|
|
85
|
+
}, null, 8, ["modelValue"])
|
|
86
|
+
])) : Y("", !0),
|
|
87
|
+
I("div", Ha, [
|
|
88
|
+
y(m, {
|
|
89
|
+
variant: "primary",
|
|
90
|
+
label: "Send",
|
|
91
|
+
icon: "send",
|
|
92
|
+
loading: V(a),
|
|
93
|
+
onclick: n
|
|
94
|
+
}, null, 8, ["loading"])
|
|
95
|
+
])
|
|
96
|
+
], 64);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}), Ka = /* @__PURE__ */ H({
|
|
100
|
+
__name: "SettingRequest",
|
|
101
|
+
props: {
|
|
102
|
+
terminal: {
|
|
103
|
+
type: Object,
|
|
104
|
+
required: !0
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
setup(e) {
|
|
108
|
+
const { settingTab: a } = bt({
|
|
109
|
+
settingTab: "kiosk_mode"
|
|
110
|
+
}), t = [
|
|
111
|
+
{
|
|
112
|
+
label: "Kiosk Mode",
|
|
113
|
+
value: "kiosk_mode",
|
|
114
|
+
render: Xa
|
|
115
|
+
}
|
|
116
|
+
], l = e, o = $(() => t.find((r) => r.value === a.value));
|
|
117
|
+
return (r, n) => {
|
|
118
|
+
var s;
|
|
119
|
+
const p = _("FmTabs");
|
|
120
|
+
return b(), R(oe, null, [
|
|
121
|
+
n[1] || (n[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
|
|
122
|
+
I("b", null, "Note: "),
|
|
123
|
+
Ve(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
|
|
124
|
+
], -1)),
|
|
125
|
+
y(p, {
|
|
126
|
+
"model-value": V(a),
|
|
127
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => Oe(a) ? a.value = f : null),
|
|
128
|
+
class: "mb-6",
|
|
129
|
+
items: t
|
|
130
|
+
}, null, 8, ["model-value"]),
|
|
131
|
+
V(a) ? (b(), N(vt((s = o.value) == null ? void 0 : s.render), gt(yt({ key: 0 }, { terminal: l.terminal })), null, 16)) : Y("", !0)
|
|
132
|
+
], 64);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}), za = 2e3, Wa = 12e4, Qa = "Timed out waiting for the Tyro reader to sync. Please try again.";
|
|
136
|
+
function Ja(e) {
|
|
137
|
+
const { isLoading: a, startLoading: t, stopLoading: l } = ht(!1), { t: o } = Ra(), r = qt(), n = T(null), p = $(() => {
|
|
138
|
+
var q, Q;
|
|
139
|
+
const U = (q = e.value.gateways) == null ? void 0 : q.find(
|
|
140
|
+
(B) => B.gateway === "Tyro"
|
|
141
|
+
);
|
|
142
|
+
return ((Q = U == null ? void 0 : U.config) == null ? void 0 : Q.uniqueId) || "";
|
|
143
|
+
}), s = $(() => !!p.value), f = $(() => {
|
|
144
|
+
var U;
|
|
145
|
+
return ((U = n.value) == null ? void 0 : U.status) === "ready";
|
|
146
|
+
}), d = $(() => {
|
|
147
|
+
var U, q;
|
|
148
|
+
return f.value && !!((q = (U = n.value) == null ? void 0 : U.fields) != null && q.tyroLocationId) && !!e.value.deviceId && !s.value;
|
|
149
|
+
}), m = $(() => !f.value && !s.value), i = $(
|
|
150
|
+
() => o("payment.onboard-submission.tyro.syncDisabledHint")
|
|
151
|
+
), u = $(() => s.value ? "Synced" : "Sync");
|
|
152
|
+
async function v() {
|
|
153
|
+
if (!e.value.referenceId) {
|
|
154
|
+
n.value = null;
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
const U = await qa.getByRestaurant(
|
|
159
|
+
e.value.referenceId
|
|
160
|
+
);
|
|
161
|
+
n.value = U.find(
|
|
162
|
+
(q) => q.type === Ua.FdoOnboardType.enum.tyro
|
|
163
|
+
) ?? null;
|
|
164
|
+
} catch (U) {
|
|
165
|
+
n.value = null, r.open({
|
|
166
|
+
type: "error",
|
|
167
|
+
message: nt(U)
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const g = Ba({
|
|
172
|
+
intervalMs: za,
|
|
173
|
+
timeoutMs: Wa,
|
|
174
|
+
onTick: async ({ isCurrentRun: U, stop: q }) => {
|
|
175
|
+
var pe, J;
|
|
176
|
+
const Q = await Ue.readById(e.value._id);
|
|
177
|
+
if (!U())
|
|
178
|
+
return;
|
|
179
|
+
const B = (pe = Q.gateways) == null ? void 0 : pe.find((C) => C.gateway === "Tyro");
|
|
180
|
+
(B == null ? void 0 : B.gateway) === "Tyro" && ((J = B == null ? void 0 : B.config) != null && J.uniqueId) && (q({ invalidate: !1 }), l(), Object.assign(e.value, Q), r.open({
|
|
181
|
+
type: "success",
|
|
182
|
+
message: "Tyro reader created successfully"
|
|
183
|
+
}));
|
|
184
|
+
},
|
|
185
|
+
onTimeout: () => {
|
|
186
|
+
l(), r.open({
|
|
187
|
+
type: "error",
|
|
188
|
+
message: Qa
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
onError: (U) => {
|
|
192
|
+
l(), r.open({
|
|
193
|
+
type: "error",
|
|
194
|
+
message: nt(U)
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}), k = g.isPolling;
|
|
198
|
+
function c() {
|
|
199
|
+
g.stop(), l();
|
|
200
|
+
}
|
|
201
|
+
function w() {
|
|
202
|
+
c(), t(), g.start();
|
|
203
|
+
}
|
|
204
|
+
async function A() {
|
|
205
|
+
if (!d.value) {
|
|
206
|
+
r.open({
|
|
207
|
+
type: "error",
|
|
208
|
+
message: "Tyro reader sync is not available"
|
|
209
|
+
});
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
t(), await Ue.syncTyroReader(e.value._id), w();
|
|
214
|
+
} catch (U) {
|
|
215
|
+
c(), r.open({
|
|
216
|
+
type: "error",
|
|
217
|
+
message: nt(U)
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return ne(
|
|
222
|
+
() => e.value.referenceId,
|
|
223
|
+
async () => {
|
|
224
|
+
await v();
|
|
225
|
+
},
|
|
226
|
+
{ immediate: !0 }
|
|
227
|
+
), ka(() => {
|
|
228
|
+
c();
|
|
229
|
+
}), {
|
|
230
|
+
isLoading: a,
|
|
231
|
+
isPollingTyroReader: k,
|
|
232
|
+
uniqueId: p,
|
|
233
|
+
canSyncTyroReader: d,
|
|
234
|
+
showTyroSyncPopover: m,
|
|
235
|
+
tyroSyncPopoverMessage: i,
|
|
236
|
+
tyroSyncButtonLabel: u,
|
|
237
|
+
syncTyroReader: A
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
const Za = {
|
|
241
|
+
key: 0,
|
|
242
|
+
class: "text-sm text-gray-500"
|
|
243
|
+
}, en = { class: "flex mt-6 space-x-6" }, tn = { class: "flex-1" }, an = /* @__PURE__ */ H({
|
|
244
|
+
__name: "SoftposGateway",
|
|
245
|
+
props: {
|
|
246
|
+
terminal: {
|
|
247
|
+
type: Object,
|
|
248
|
+
required: !0
|
|
249
|
+
},
|
|
250
|
+
onUpdate: {
|
|
251
|
+
type: Function,
|
|
252
|
+
required: !0
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
setup(e) {
|
|
256
|
+
const a = e, t = _t().currentCountry, l = [
|
|
257
|
+
{
|
|
258
|
+
label: "Fiuu Malaysia",
|
|
259
|
+
value: "cc.feedme.payment.rms",
|
|
260
|
+
region: W.F_COUNTRY.enum.MY,
|
|
261
|
+
gateway: "Fiuu",
|
|
262
|
+
isLegacy: !0,
|
|
263
|
+
isOutdated: !0
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: "Fiuu Malaysia V2",
|
|
267
|
+
value: "cc.feedme.payment.fiuu_my",
|
|
268
|
+
region: W.F_COUNTRY.enum.MY,
|
|
269
|
+
gateway: "Fiuu",
|
|
270
|
+
isLegacy: !0
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
label: "Fiuu Singapore",
|
|
274
|
+
value: "cc.feedme.payment.fiuu_sg",
|
|
275
|
+
region: W.F_COUNTRY.enum.SG,
|
|
276
|
+
gateway: "Fiuu",
|
|
277
|
+
isLegacy: !0
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
label: "Softspace Malaysia",
|
|
281
|
+
value: "cc.feedme.payment.softspace_my",
|
|
282
|
+
gateway: "Softspace",
|
|
283
|
+
region: W.F_COUNTRY.enum.MY
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
label: "Digio Thailand",
|
|
287
|
+
value: "cc.feedme.payment.digio_th",
|
|
288
|
+
gateway: "Digio",
|
|
289
|
+
region: W.F_COUNTRY.enum.TH
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
label: "Tyro Australia",
|
|
293
|
+
value: "cc.feedme.payment.tyro_au",
|
|
294
|
+
gateway: "Tyro",
|
|
295
|
+
region: W.F_COUNTRY.enum.AU
|
|
296
|
+
}
|
|
297
|
+
], o = ce(() => a.terminal), r = T(), n = T({
|
|
298
|
+
packageId: "",
|
|
299
|
+
uniqueId: "",
|
|
300
|
+
developerId: "",
|
|
301
|
+
isUat: !1
|
|
302
|
+
}), p = () => {
|
|
303
|
+
n.value.uniqueId = "", n.value.packageId = "", n.value.developerId = "", n.value.isUat = !1;
|
|
304
|
+
}, s = $(() => l.filter((x) => x.region === t.value)), f = $(() => s.value.find(
|
|
305
|
+
(x) => x.value === n.value.packageId
|
|
306
|
+
)), d = $(
|
|
307
|
+
() => {
|
|
308
|
+
var x;
|
|
309
|
+
return ((x = f.value) == null ? void 0 : x.gateway) === "Tyro";
|
|
310
|
+
}
|
|
311
|
+
), {
|
|
312
|
+
isLoading: m,
|
|
313
|
+
isPollingTyroReader: i,
|
|
314
|
+
uniqueId: u,
|
|
315
|
+
canSyncTyroReader: v,
|
|
316
|
+
showTyroSyncPopover: g,
|
|
317
|
+
tyroSyncPopoverMessage: k,
|
|
318
|
+
tyroSyncButtonLabel: c,
|
|
319
|
+
syncTyroReader: w
|
|
320
|
+
} = Ja(o), A = $(() => d.value ? "button" : "submit"), U = $(() => d.value ? c.value : "Save"), q = $(() => d.value ? m.value : !1), Q = $(() => d.value ? !v.value || i.value : !1), B = () => {
|
|
321
|
+
if (!o.value.gateways || o.value.gateways.length === 0)
|
|
322
|
+
return p();
|
|
323
|
+
const x = o.value.gateways[0];
|
|
324
|
+
if (!x.config)
|
|
325
|
+
return p();
|
|
326
|
+
if (x.gateway === "Tyro") {
|
|
327
|
+
n.value = {
|
|
328
|
+
packageId: x.config.packageId,
|
|
329
|
+
uniqueId: x.config.uniqueId,
|
|
330
|
+
developerId: "",
|
|
331
|
+
isUat: !1
|
|
332
|
+
};
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
switch (x.gateway) {
|
|
336
|
+
case "Fiuu":
|
|
337
|
+
n.value = {
|
|
338
|
+
packageId: x.config.packageId,
|
|
339
|
+
uniqueId: x.config.uniqueId,
|
|
340
|
+
developerId: "",
|
|
341
|
+
isUat: !1
|
|
342
|
+
};
|
|
343
|
+
break;
|
|
344
|
+
case "Softspace":
|
|
345
|
+
case "Digio":
|
|
346
|
+
const E = JSON.parse(x.config.uniqueId);
|
|
347
|
+
n.value = {
|
|
348
|
+
packageId: x.config.packageId,
|
|
349
|
+
uniqueId: E.uniqueId,
|
|
350
|
+
developerId: E.developerId,
|
|
351
|
+
isUat: E.isUat
|
|
352
|
+
};
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
ne(o, B), re(B);
|
|
357
|
+
async function pe() {
|
|
358
|
+
const x = f.value;
|
|
359
|
+
if (!x)
|
|
360
|
+
return;
|
|
361
|
+
let E = n.value.uniqueId;
|
|
362
|
+
x.isLegacy || (E = JSON.stringify({
|
|
363
|
+
uniqueId: n.value.uniqueId,
|
|
364
|
+
developerId: n.value.developerId,
|
|
365
|
+
isUat: n.value.isUat
|
|
366
|
+
}));
|
|
367
|
+
const Z = {
|
|
368
|
+
gateway: x.gateway,
|
|
369
|
+
config: {
|
|
370
|
+
packageId: x.value,
|
|
371
|
+
uniqueId: E
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
(!o.value.gateways || o.value.gateways.length > 1) && (o.value.gateways = []), o.value.gateways[0] = Z, await a.onUpdate(o.value);
|
|
375
|
+
}
|
|
376
|
+
async function J(x) {
|
|
377
|
+
var E;
|
|
378
|
+
(E = o.value.gateways) == null || E.splice(x, 1), a.onUpdate(o.value);
|
|
379
|
+
}
|
|
380
|
+
function C() {
|
|
381
|
+
d.value && w();
|
|
382
|
+
}
|
|
383
|
+
return (x, E) => {
|
|
384
|
+
const Z = _("FmSelect"), P = _("FmTextField"), G = _("FmCheckbox"), X = _("FmButton"), z = _("FmTooltip"), Ce = _("FmForm");
|
|
385
|
+
return b(), N(Ce, {
|
|
386
|
+
ref: r.value,
|
|
387
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
388
|
+
onValidationSuccess: pe
|
|
389
|
+
}, {
|
|
390
|
+
default: ae(() => [
|
|
391
|
+
y(Z, {
|
|
392
|
+
modelValue: n.value.packageId,
|
|
393
|
+
"onUpdate:modelValue": E[0] || (E[0] = (ie) => n.value.packageId = ie),
|
|
394
|
+
label: "Package ID",
|
|
395
|
+
items: s.value
|
|
396
|
+
}, null, 8, ["modelValue", "items"]),
|
|
397
|
+
f.value ? (b(), R(oe, { key: 0 }, [
|
|
398
|
+
d.value ? (b(), N(P, {
|
|
399
|
+
key: 0,
|
|
400
|
+
"model-value": V(u),
|
|
401
|
+
label: "Unique ID (Reader ID)",
|
|
402
|
+
disabled: ""
|
|
403
|
+
}, null, 8, ["model-value"])) : f.value && f.value.isLegacy ? (b(), R(oe, { key: 1 }, [
|
|
404
|
+
y(P, {
|
|
405
|
+
modelValue: n.value.uniqueId,
|
|
406
|
+
"onUpdate:modelValue": E[1] || (E[1] = (ie) => n.value.uniqueId = ie),
|
|
407
|
+
label: "Unique ID (TID)"
|
|
408
|
+
}, null, 8, ["modelValue"]),
|
|
409
|
+
f.value.isOutdated ? (b(), R("span", Za, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : Y("", !0)
|
|
410
|
+
], 64)) : (b(), R(oe, { key: 2 }, [
|
|
411
|
+
y(P, {
|
|
412
|
+
modelValue: n.value.developerId,
|
|
413
|
+
"onUpdate:modelValue": E[2] || (E[2] = (ie) => n.value.developerId = ie),
|
|
414
|
+
label: "Developer ID (MID)"
|
|
415
|
+
}, null, 8, ["modelValue"]),
|
|
416
|
+
y(P, {
|
|
417
|
+
modelValue: n.value.uniqueId,
|
|
418
|
+
"onUpdate:modelValue": E[3] || (E[3] = (ie) => n.value.uniqueId = ie),
|
|
419
|
+
label: "Unique ID (TID)"
|
|
420
|
+
}, null, 8, ["modelValue"]),
|
|
421
|
+
y(G, {
|
|
422
|
+
modelValue: n.value.isUat,
|
|
423
|
+
"onUpdate:modelValue": E[4] || (E[4] = (ie) => n.value.isUat = ie),
|
|
424
|
+
label: "Is UAT (Test)",
|
|
425
|
+
value: "1"
|
|
426
|
+
}, null, 8, ["modelValue"])
|
|
427
|
+
], 64)),
|
|
428
|
+
I("div", en, [
|
|
429
|
+
o.value.gateways && o.value.gateways.length > 0 ? (b(), N(X, {
|
|
430
|
+
key: 0,
|
|
431
|
+
class: "flex-1",
|
|
432
|
+
variant: "secondary",
|
|
433
|
+
label: "Delete",
|
|
434
|
+
onclick: () => J(0)
|
|
435
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
436
|
+
d.value && V(g) && Q.value ? (b(), N(z, {
|
|
437
|
+
key: 1,
|
|
438
|
+
class: "flex-1",
|
|
439
|
+
variant: "plain",
|
|
440
|
+
placement: "top",
|
|
441
|
+
content: V(k)
|
|
442
|
+
}, {
|
|
443
|
+
default: ae(() => [
|
|
444
|
+
I("div", tn, [
|
|
445
|
+
y(X, {
|
|
446
|
+
type: A.value,
|
|
447
|
+
class: "w-full",
|
|
448
|
+
variant: "primary",
|
|
449
|
+
loading: q.value,
|
|
450
|
+
disabled: Q.value,
|
|
451
|
+
label: U.value,
|
|
452
|
+
onClick: C
|
|
453
|
+
}, null, 8, ["type", "loading", "disabled", "label"])
|
|
454
|
+
])
|
|
455
|
+
]),
|
|
456
|
+
_: 1
|
|
457
|
+
}, 8, ["content"])) : (b(), N(X, {
|
|
458
|
+
key: 2,
|
|
459
|
+
type: A.value,
|
|
460
|
+
class: "flex-1",
|
|
461
|
+
variant: "primary",
|
|
462
|
+
loading: q.value,
|
|
463
|
+
disabled: Q.value,
|
|
464
|
+
label: U.value,
|
|
465
|
+
onClick: C
|
|
466
|
+
}, null, 8, ["type", "loading", "disabled", "label"]))
|
|
467
|
+
])
|
|
468
|
+
], 64)) : Y("", !0)
|
|
469
|
+
]),
|
|
470
|
+
_: 1
|
|
471
|
+
}, 512);
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
}), nn = {
|
|
475
|
+
key: 0,
|
|
476
|
+
class: "flex items-center justify-center min-h-[80vh]"
|
|
477
|
+
}, ln = { class: "flex mt-6 space-x-6" }, on = /* @__PURE__ */ H({
|
|
478
|
+
__name: "TerminalGateway",
|
|
479
|
+
props: {
|
|
480
|
+
terminal: {
|
|
481
|
+
type: Object,
|
|
482
|
+
required: !0
|
|
483
|
+
},
|
|
484
|
+
onUpdate: {
|
|
485
|
+
type: Function,
|
|
486
|
+
required: !0
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
setup(e) {
|
|
490
|
+
const { isLoading: a, startAsyncCall: t } = ht(), l = e, o = ce(() => l.terminal), r = T(), n = T(), p = T(-1), s = T({
|
|
491
|
+
terminalId: ""
|
|
492
|
+
}), f = () => {
|
|
493
|
+
s.value.terminalId = "", p.value = -1;
|
|
494
|
+
}, d = () => {
|
|
495
|
+
if (t(async () => {
|
|
496
|
+
r.value = await Ue.getRestaurantTerminals(l.terminal.referenceId);
|
|
497
|
+
}), !l.terminal.ecrs)
|
|
498
|
+
return f();
|
|
499
|
+
const u = l.terminal.ecrs.findIndex((g) => g && g.gateway && g.gateway === "FeedMe");
|
|
500
|
+
if (u === -1)
|
|
501
|
+
return f();
|
|
502
|
+
p.value = u;
|
|
503
|
+
const v = l.terminal.ecrs.at(u);
|
|
504
|
+
v.gateway === "FeedMe" && v.config && (s.value = {
|
|
505
|
+
terminalId: v.config.terminalId
|
|
506
|
+
});
|
|
507
|
+
};
|
|
508
|
+
ne(o, d), re(d);
|
|
509
|
+
const m = $(() => (r.value ?? []).map((u) => ({
|
|
510
|
+
label: u.name ?? u._id,
|
|
511
|
+
value: u._id
|
|
512
|
+
})));
|
|
513
|
+
async function i(u) {
|
|
514
|
+
var v;
|
|
515
|
+
(v = l.terminal.ecrs) == null || v.splice(u, 1), l.onUpdate(l.terminal);
|
|
516
|
+
}
|
|
517
|
+
return (u, v) => {
|
|
518
|
+
const g = _("FmCircularProgress"), k = _("FmSelect"), c = _("FmButton"), w = _("FmForm");
|
|
519
|
+
return V(a) ? (b(), R("div", nn, [
|
|
520
|
+
y(g, { size: "xxl" })
|
|
521
|
+
])) : (b(), N(w, {
|
|
522
|
+
key: 1,
|
|
523
|
+
ref: n.value,
|
|
524
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
525
|
+
onValidationSuccess: v[1] || (v[1] = () => {
|
|
526
|
+
p.value > -1 ? o.value.ecrs[p.value] = { gateway: "FeedMe", config: s.value } : (o.value.ecrs || (o.value.ecrs = []), o.value.ecrs.push({ gateway: "FeedMe", config: s.value })), l.onUpdate(o.value);
|
|
527
|
+
})
|
|
528
|
+
}, {
|
|
529
|
+
default: ae(() => [
|
|
530
|
+
y(k, {
|
|
531
|
+
modelValue: s.value.terminalId,
|
|
532
|
+
"onUpdate:modelValue": v[0] || (v[0] = (A) => s.value.terminalId = A),
|
|
533
|
+
label: "Terminal ID",
|
|
534
|
+
items: m.value,
|
|
535
|
+
rules: V(ia)(V(sa).string())
|
|
536
|
+
}, null, 8, ["modelValue", "items", "rules"]),
|
|
537
|
+
I("div", ln, [
|
|
538
|
+
p.value > -1 ? (b(), N(c, {
|
|
539
|
+
key: 0,
|
|
540
|
+
class: "flex-1",
|
|
541
|
+
variant: "secondary",
|
|
542
|
+
label: "Delete",
|
|
543
|
+
onclick: () => i(p.value)
|
|
544
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
545
|
+
y(c, {
|
|
546
|
+
type: "submit",
|
|
547
|
+
class: "flex-1",
|
|
548
|
+
variant: "primary",
|
|
549
|
+
label: "Save"
|
|
550
|
+
})
|
|
551
|
+
])
|
|
552
|
+
]),
|
|
553
|
+
_: 1
|
|
554
|
+
}, 512));
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
}), rn = { class: "flex mt-6 space-x-6" }, sn = /* @__PURE__ */ H({
|
|
558
|
+
__name: "GhlGateway",
|
|
559
|
+
props: {
|
|
560
|
+
terminal: {
|
|
561
|
+
type: Object,
|
|
562
|
+
required: !0
|
|
563
|
+
},
|
|
564
|
+
onUpdate: {
|
|
565
|
+
type: Function,
|
|
566
|
+
required: !0
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
setup(e) {
|
|
570
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T({
|
|
571
|
+
merchantId: "",
|
|
572
|
+
terminalId: "",
|
|
573
|
+
privateKey: ""
|
|
574
|
+
}), n = () => {
|
|
575
|
+
r.value.merchantId = "", r.value.terminalId = "", r.value.privateKey = "", o.value = -1;
|
|
576
|
+
}, p = () => {
|
|
577
|
+
if (!t.value.ecrs)
|
|
578
|
+
return n();
|
|
579
|
+
const f = t.value.ecrs.findIndex((m) => m && m.gateway && m.gateway === "Ghl");
|
|
580
|
+
if (f === -1)
|
|
581
|
+
return n();
|
|
582
|
+
o.value = f;
|
|
583
|
+
const d = t.value.ecrs.at(f);
|
|
584
|
+
d.gateway === "Ghl" && d.config && (r.value = {
|
|
585
|
+
merchantId: d.config.merchantId,
|
|
586
|
+
terminalId: d.config.terminalId,
|
|
587
|
+
privateKey: d.config.privateKey || ""
|
|
588
|
+
});
|
|
589
|
+
};
|
|
590
|
+
ne(t, p), re(p);
|
|
591
|
+
async function s(f) {
|
|
592
|
+
var d;
|
|
593
|
+
(d = t.value.ecrs) == null || d.splice(f, 1), a.onUpdate(t.value);
|
|
594
|
+
}
|
|
595
|
+
return (f, d) => {
|
|
596
|
+
const m = _("FmTextField"), i = _("FmTextarea"), u = _("FmButton"), v = _("FmForm");
|
|
597
|
+
return b(), N(v, {
|
|
598
|
+
ref: l.value,
|
|
599
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
600
|
+
onValidationSuccess: d[3] || (d[3] = () => {
|
|
601
|
+
o.value > -1 ? t.value.ecrs[o.value] = { gateway: "Ghl", config: r.value } : (t.value.ecrs || (t.value.ecrs = []), t.value.ecrs.push({ gateway: "Ghl", config: r.value })), a.onUpdate(t.value);
|
|
602
|
+
})
|
|
603
|
+
}, {
|
|
604
|
+
default: ae(() => [
|
|
605
|
+
y(m, {
|
|
606
|
+
modelValue: r.value.merchantId,
|
|
607
|
+
"onUpdate:modelValue": d[0] || (d[0] = (g) => r.value.merchantId = g),
|
|
608
|
+
label: "Merchant ID"
|
|
609
|
+
}, null, 8, ["modelValue"]),
|
|
610
|
+
y(m, {
|
|
611
|
+
modelValue: r.value.terminalId,
|
|
612
|
+
"onUpdate:modelValue": d[1] || (d[1] = (g) => r.value.terminalId = g),
|
|
613
|
+
label: "Terminal ID"
|
|
614
|
+
}, null, 8, ["modelValue"]),
|
|
615
|
+
y(i, {
|
|
616
|
+
modelValue: r.value.privateKey,
|
|
617
|
+
"onUpdate:modelValue": d[2] || (d[2] = (g) => r.value.privateKey = g),
|
|
618
|
+
label: "Private Key",
|
|
619
|
+
"label-mark": "optional",
|
|
620
|
+
"label-info": "Default will use FeedMe Private Key"
|
|
621
|
+
}, null, 8, ["modelValue"]),
|
|
622
|
+
I("div", rn, [
|
|
623
|
+
o.value > -1 ? (b(), N(u, {
|
|
624
|
+
key: 0,
|
|
625
|
+
class: "flex-1",
|
|
626
|
+
variant: "secondary",
|
|
627
|
+
label: "Delete",
|
|
628
|
+
onclick: () => s(o.value)
|
|
629
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
630
|
+
y(u, {
|
|
631
|
+
type: "submit",
|
|
632
|
+
class: "flex-1",
|
|
633
|
+
variant: "primary",
|
|
634
|
+
label: "Save"
|
|
635
|
+
})
|
|
636
|
+
])
|
|
637
|
+
]),
|
|
638
|
+
_: 1
|
|
639
|
+
}, 512);
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
}), un = { class: "flex items-end" }, cn = { class: "flex flex-wrap gap-8 items-center mt-4" }, dn = { class: "flex mt-6 space-x-6" }, pn = /* @__PURE__ */ H({
|
|
643
|
+
__name: "MaybankGateway",
|
|
644
|
+
props: {
|
|
645
|
+
terminal: {
|
|
646
|
+
type: Object,
|
|
647
|
+
required: !0
|
|
648
|
+
},
|
|
649
|
+
onUpdate: {
|
|
650
|
+
type: Function,
|
|
651
|
+
required: !0
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
setup(e) {
|
|
655
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
656
|
+
ip: "",
|
|
657
|
+
receiptName: "",
|
|
658
|
+
cardTypes: []
|
|
659
|
+
}), p = () => {
|
|
660
|
+
n.value.ip = "", n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
661
|
+
}, s = () => {
|
|
662
|
+
var v;
|
|
663
|
+
if (!t.value.ecrIntegrations)
|
|
664
|
+
return p();
|
|
665
|
+
const m = t.value.ecrIntegrations, i = m.findIndex((g) => g && g.gateway && g.gateway === "Maybank");
|
|
666
|
+
if (i === -1)
|
|
667
|
+
return p();
|
|
668
|
+
o.value = i;
|
|
669
|
+
const u = m.at(i);
|
|
670
|
+
u.gateway === "Maybank" && u.config && (n.value = {
|
|
671
|
+
ip: u.config.ip ?? "",
|
|
672
|
+
receiptName: u.receiptName ?? "",
|
|
673
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
ne(t, s), re(s);
|
|
677
|
+
async function f(m) {
|
|
678
|
+
var i;
|
|
679
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
680
|
+
}
|
|
681
|
+
async function d() {
|
|
682
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
683
|
+
}
|
|
684
|
+
return (m, i) => {
|
|
685
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
686
|
+
return b(), N(k, {
|
|
687
|
+
ref: l.value,
|
|
688
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
689
|
+
onValidationSuccess: i[3] || (i[3] = () => {
|
|
690
|
+
var c, w;
|
|
691
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
692
|
+
gateway: "Maybank",
|
|
693
|
+
config: { ip: n.value.ip },
|
|
694
|
+
receiptName: n.value.receiptName,
|
|
695
|
+
dialogConfig: {
|
|
696
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
697
|
+
cardTypes: n.value.cardTypes
|
|
698
|
+
}
|
|
699
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
700
|
+
gateway: "Maybank",
|
|
701
|
+
config: { ip: n.value.ip },
|
|
702
|
+
receiptName: n.value.receiptName,
|
|
703
|
+
dialogConfig: {
|
|
704
|
+
cardTypes: n.value.cardTypes
|
|
705
|
+
}
|
|
706
|
+
})), a.onUpdate(t.value);
|
|
707
|
+
})
|
|
708
|
+
}, {
|
|
709
|
+
default: ae(() => [
|
|
710
|
+
y(u, {
|
|
711
|
+
modelValue: n.value.ip,
|
|
712
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.ip = c),
|
|
713
|
+
label: "IP Address"
|
|
714
|
+
}, null, 8, ["modelValue"]),
|
|
715
|
+
y(u, {
|
|
716
|
+
modelValue: n.value.receiptName,
|
|
717
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => n.value.receiptName = c),
|
|
718
|
+
label: "Receipt Payment Name",
|
|
719
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
720
|
+
}, null, 8, ["modelValue"]),
|
|
721
|
+
I("div", un, [
|
|
722
|
+
y(u, {
|
|
723
|
+
modelValue: r.value,
|
|
724
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => r.value = c),
|
|
725
|
+
label: "Fallback Card Types",
|
|
726
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
727
|
+
}, null, 8, ["modelValue"]),
|
|
728
|
+
y(v, {
|
|
729
|
+
class: "ml-4",
|
|
730
|
+
icon: "add",
|
|
731
|
+
onClick: d
|
|
732
|
+
})
|
|
733
|
+
]),
|
|
734
|
+
I("div", cn, [
|
|
735
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
736
|
+
key: c,
|
|
737
|
+
label: c,
|
|
738
|
+
removable: !0,
|
|
739
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
740
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
741
|
+
]),
|
|
742
|
+
I("div", dn, [
|
|
743
|
+
o.value > -1 ? (b(), N(v, {
|
|
744
|
+
key: 0,
|
|
745
|
+
class: "flex-1",
|
|
746
|
+
variant: "secondary",
|
|
747
|
+
label: "Delete",
|
|
748
|
+
onclick: () => f(o.value)
|
|
749
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
750
|
+
y(v, {
|
|
751
|
+
type: "submit",
|
|
752
|
+
class: "flex-1",
|
|
753
|
+
variant: "primary",
|
|
754
|
+
label: "Save"
|
|
755
|
+
})
|
|
756
|
+
])
|
|
757
|
+
]),
|
|
758
|
+
_: 1
|
|
759
|
+
}, 512);
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
}), mn = { class: "flex items-end" }, fn = { class: "flex flex-wrap gap-8 items-center mt-4" }, vn = { class: "flex mt-6 space-x-6" }, gn = /* @__PURE__ */ H({
|
|
763
|
+
__name: "Maybank2Gateway",
|
|
764
|
+
props: {
|
|
765
|
+
terminal: {
|
|
766
|
+
type: Object,
|
|
767
|
+
required: !0
|
|
768
|
+
},
|
|
769
|
+
onUpdate: {
|
|
770
|
+
type: Function,
|
|
771
|
+
required: !0
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
setup(e) {
|
|
775
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
776
|
+
ip: "",
|
|
777
|
+
receiptName: "",
|
|
778
|
+
cardTypes: []
|
|
779
|
+
}), p = () => {
|
|
780
|
+
n.value.ip = "", n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
781
|
+
}, s = () => {
|
|
782
|
+
var v;
|
|
783
|
+
if (!t.value.ecrIntegrations)
|
|
784
|
+
return p();
|
|
785
|
+
const m = t.value.ecrIntegrations, i = m.findIndex((g) => g && g.gateway && g.gateway === "Maybank2");
|
|
786
|
+
if (i === -1)
|
|
787
|
+
return p();
|
|
788
|
+
o.value = i;
|
|
789
|
+
const u = m.at(i);
|
|
790
|
+
u.gateway === "Maybank2" && u.config && (n.value = {
|
|
791
|
+
ip: u.config.ip ?? "",
|
|
792
|
+
receiptName: u.receiptName ?? "",
|
|
793
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
794
|
+
});
|
|
795
|
+
};
|
|
796
|
+
ne(t, s), re(s);
|
|
797
|
+
async function f(m) {
|
|
798
|
+
var i;
|
|
799
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
800
|
+
}
|
|
801
|
+
async function d() {
|
|
802
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
803
|
+
}
|
|
804
|
+
return (m, i) => {
|
|
805
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
806
|
+
return b(), N(k, {
|
|
807
|
+
ref: l.value,
|
|
808
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
809
|
+
onValidationSuccess: i[3] || (i[3] = () => {
|
|
810
|
+
var c, w;
|
|
811
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
812
|
+
gateway: "Maybank2",
|
|
813
|
+
config: { ip: n.value.ip },
|
|
814
|
+
receiptName: n.value.receiptName,
|
|
815
|
+
dialogConfig: {
|
|
816
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
817
|
+
cardTypes: n.value.cardTypes
|
|
818
|
+
}
|
|
819
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
820
|
+
gateway: "Maybank2",
|
|
821
|
+
config: { ip: n.value.ip },
|
|
822
|
+
receiptName: n.value.receiptName,
|
|
823
|
+
dialogConfig: {
|
|
824
|
+
cardTypes: n.value.cardTypes
|
|
825
|
+
}
|
|
826
|
+
})), a.onUpdate(t.value);
|
|
827
|
+
})
|
|
828
|
+
}, {
|
|
829
|
+
default: ae(() => [
|
|
830
|
+
y(u, {
|
|
831
|
+
modelValue: n.value.ip,
|
|
832
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.ip = c),
|
|
833
|
+
label: "IP Address"
|
|
834
|
+
}, null, 8, ["modelValue"]),
|
|
835
|
+
y(u, {
|
|
836
|
+
modelValue: n.value.receiptName,
|
|
837
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => n.value.receiptName = c),
|
|
838
|
+
label: "Receipt Payment Name",
|
|
839
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
840
|
+
}, null, 8, ["modelValue"]),
|
|
841
|
+
I("div", mn, [
|
|
842
|
+
y(u, {
|
|
843
|
+
modelValue: r.value,
|
|
844
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => r.value = c),
|
|
845
|
+
label: "Fallback Card Types",
|
|
846
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
847
|
+
}, null, 8, ["modelValue"]),
|
|
848
|
+
y(v, {
|
|
849
|
+
class: "ml-4",
|
|
850
|
+
icon: "add",
|
|
851
|
+
onClick: d
|
|
852
|
+
})
|
|
853
|
+
]),
|
|
854
|
+
I("div", fn, [
|
|
855
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
856
|
+
key: c,
|
|
857
|
+
label: c,
|
|
858
|
+
removable: !0,
|
|
859
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
860
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
861
|
+
]),
|
|
862
|
+
I("div", vn, [
|
|
863
|
+
o.value > -1 ? (b(), N(v, {
|
|
864
|
+
key: 0,
|
|
865
|
+
class: "flex-1",
|
|
866
|
+
variant: "secondary",
|
|
867
|
+
label: "Delete",
|
|
868
|
+
onclick: () => f(o.value)
|
|
869
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
870
|
+
y(v, {
|
|
871
|
+
type: "submit",
|
|
872
|
+
class: "flex-1",
|
|
873
|
+
variant: "primary",
|
|
874
|
+
label: "Save"
|
|
875
|
+
})
|
|
876
|
+
])
|
|
877
|
+
]),
|
|
878
|
+
_: 1
|
|
879
|
+
}, 512);
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
}), yn = { class: "flex items-end" }, hn = { class: "flex flex-wrap gap-8 items-center mt-4" }, bn = { class: "flex mt-6 space-x-6" }, _n = /* @__PURE__ */ H({
|
|
883
|
+
__name: "Maybank3Gateway",
|
|
884
|
+
props: {
|
|
885
|
+
terminal: {
|
|
886
|
+
type: Object,
|
|
887
|
+
required: !0
|
|
888
|
+
},
|
|
889
|
+
onUpdate: {
|
|
890
|
+
type: Function,
|
|
891
|
+
required: !0
|
|
892
|
+
}
|
|
893
|
+
},
|
|
894
|
+
setup(e) {
|
|
895
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
896
|
+
receiptName: "",
|
|
897
|
+
config: {},
|
|
898
|
+
cardTypes: []
|
|
899
|
+
}), p = () => {
|
|
900
|
+
n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
901
|
+
}, s = () => {
|
|
902
|
+
var v;
|
|
903
|
+
if (!t.value.ecrIntegrations)
|
|
904
|
+
return p();
|
|
905
|
+
const m = t.value.ecrIntegrations, i = m.findIndex((g) => g && g.gateway && g.gateway === "Maybank3");
|
|
906
|
+
if (i === -1)
|
|
907
|
+
return p();
|
|
908
|
+
o.value = i;
|
|
909
|
+
const u = m.at(i);
|
|
910
|
+
u.gateway === "Maybank3" && u.config && (n.value = {
|
|
911
|
+
config: u.config,
|
|
912
|
+
receiptName: u.receiptName ?? "",
|
|
913
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
ne(t, s), re(s);
|
|
917
|
+
async function f(m) {
|
|
918
|
+
var i;
|
|
919
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
920
|
+
}
|
|
921
|
+
async function d() {
|
|
922
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
923
|
+
}
|
|
924
|
+
return (m, i) => {
|
|
925
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
926
|
+
return b(), N(k, {
|
|
927
|
+
ref: l.value,
|
|
928
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
929
|
+
onValidationSuccess: i[2] || (i[2] = () => {
|
|
930
|
+
var c, w;
|
|
931
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
932
|
+
gateway: "Maybank3",
|
|
933
|
+
config: n.value.config,
|
|
934
|
+
receiptName: n.value.receiptName,
|
|
935
|
+
dialogConfig: {
|
|
936
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
937
|
+
cardTypes: n.value.cardTypes
|
|
938
|
+
}
|
|
939
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
940
|
+
gateway: "Maybank3",
|
|
941
|
+
config: n.value.config,
|
|
942
|
+
receiptName: n.value.receiptName,
|
|
943
|
+
dialogConfig: {
|
|
944
|
+
cardTypes: n.value.cardTypes
|
|
945
|
+
}
|
|
946
|
+
})), a.onUpdate(t.value);
|
|
947
|
+
})
|
|
948
|
+
}, {
|
|
949
|
+
default: ae(() => [
|
|
950
|
+
y(u, {
|
|
951
|
+
modelValue: n.value.receiptName,
|
|
952
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.receiptName = c),
|
|
953
|
+
label: "Receipt Payment Name",
|
|
954
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
955
|
+
}, null, 8, ["modelValue"]),
|
|
956
|
+
I("div", yn, [
|
|
957
|
+
y(u, {
|
|
958
|
+
modelValue: r.value,
|
|
959
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => r.value = c),
|
|
960
|
+
label: "Fallback Card Types",
|
|
961
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
962
|
+
}, null, 8, ["modelValue"]),
|
|
963
|
+
y(v, {
|
|
964
|
+
class: "ml-4",
|
|
965
|
+
icon: "add",
|
|
966
|
+
onClick: d
|
|
967
|
+
})
|
|
968
|
+
]),
|
|
969
|
+
I("div", hn, [
|
|
970
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
971
|
+
key: c,
|
|
972
|
+
label: c,
|
|
973
|
+
removable: !0,
|
|
974
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
975
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
976
|
+
]),
|
|
977
|
+
I("div", bn, [
|
|
978
|
+
o.value > -1 ? (b(), N(v, {
|
|
979
|
+
key: 0,
|
|
980
|
+
class: "flex-1",
|
|
981
|
+
variant: "secondary",
|
|
982
|
+
label: "Delete",
|
|
983
|
+
onclick: () => f(o.value)
|
|
984
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
985
|
+
y(v, {
|
|
986
|
+
type: "submit",
|
|
987
|
+
class: "flex-1",
|
|
988
|
+
variant: "primary",
|
|
989
|
+
label: "Save"
|
|
990
|
+
})
|
|
991
|
+
])
|
|
992
|
+
]),
|
|
993
|
+
_: 1
|
|
994
|
+
}, 512);
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
}), wn = { class: "flex items-end" }, Tn = { class: "flex flex-wrap gap-8 items-center mt-4" }, In = { class: "flex mt-6 space-x-6" }, xn = /* @__PURE__ */ H({
|
|
998
|
+
__name: "NetsGateway",
|
|
999
|
+
props: {
|
|
1000
|
+
terminal: {
|
|
1001
|
+
type: Object,
|
|
1002
|
+
required: !0
|
|
1003
|
+
},
|
|
1004
|
+
onUpdate: {
|
|
1005
|
+
type: Function,
|
|
1006
|
+
required: !0
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
setup(e) {
|
|
1010
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1011
|
+
ip: "",
|
|
1012
|
+
receiptName: "",
|
|
1013
|
+
cardTypes: []
|
|
1014
|
+
}), p = () => {
|
|
1015
|
+
n.value.ip = "", n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1016
|
+
}, s = () => {
|
|
1017
|
+
var v;
|
|
1018
|
+
if (!t.value.ecrIntegrations)
|
|
1019
|
+
return p();
|
|
1020
|
+
const m = t.value.ecrIntegrations, i = m.findIndex((g) => g && g.gateway && g.gateway === "Nets");
|
|
1021
|
+
if (i === -1)
|
|
1022
|
+
return p();
|
|
1023
|
+
o.value = i;
|
|
1024
|
+
const u = m.at(i);
|
|
1025
|
+
u.gateway === "Nets" && u.config && (n.value = {
|
|
1026
|
+
ip: u.config.ip ?? "",
|
|
1027
|
+
receiptName: u.receiptName ?? "",
|
|
1028
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
ne(t, s), re(s);
|
|
1032
|
+
async function f(m) {
|
|
1033
|
+
var i;
|
|
1034
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1035
|
+
}
|
|
1036
|
+
async function d() {
|
|
1037
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1038
|
+
}
|
|
1039
|
+
return (m, i) => {
|
|
1040
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1041
|
+
return b(), N(k, {
|
|
1042
|
+
ref: l.value,
|
|
1043
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1044
|
+
onValidationSuccess: i[3] || (i[3] = () => {
|
|
1045
|
+
var c, w;
|
|
1046
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1047
|
+
gateway: "Nets",
|
|
1048
|
+
config: { ip: n.value.ip },
|
|
1049
|
+
receiptName: n.value.receiptName,
|
|
1050
|
+
dialogConfig: {
|
|
1051
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1052
|
+
cardTypes: n.value.cardTypes
|
|
1053
|
+
}
|
|
1054
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1055
|
+
gateway: "Nets",
|
|
1056
|
+
config: { ip: n.value.ip },
|
|
1057
|
+
receiptName: n.value.receiptName,
|
|
1058
|
+
dialogConfig: {
|
|
1059
|
+
cardTypes: n.value.cardTypes
|
|
1060
|
+
}
|
|
1061
|
+
})), a.onUpdate(t.value);
|
|
1062
|
+
})
|
|
1063
|
+
}, {
|
|
1064
|
+
default: ae(() => [
|
|
1065
|
+
y(u, {
|
|
1066
|
+
modelValue: n.value.ip,
|
|
1067
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.ip = c),
|
|
1068
|
+
label: "IP Address"
|
|
1069
|
+
}, null, 8, ["modelValue"]),
|
|
1070
|
+
y(u, {
|
|
1071
|
+
modelValue: n.value.receiptName,
|
|
1072
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => n.value.receiptName = c),
|
|
1073
|
+
label: "Receipt Payment Name",
|
|
1074
|
+
"label-info": "Default receipt display will be 'TERMINAL_NETS'"
|
|
1075
|
+
}, null, 8, ["modelValue"]),
|
|
1076
|
+
I("div", wn, [
|
|
1077
|
+
y(u, {
|
|
1078
|
+
modelValue: r.value,
|
|
1079
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => r.value = c),
|
|
1080
|
+
label: "Fallback Card Types",
|
|
1081
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1082
|
+
}, null, 8, ["modelValue"]),
|
|
1083
|
+
y(v, {
|
|
1084
|
+
class: "ml-4",
|
|
1085
|
+
icon: "add",
|
|
1086
|
+
onClick: d
|
|
1087
|
+
})
|
|
1088
|
+
]),
|
|
1089
|
+
I("div", Tn, [
|
|
1090
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1091
|
+
key: c,
|
|
1092
|
+
label: c,
|
|
1093
|
+
removable: !0,
|
|
1094
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1095
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1096
|
+
]),
|
|
1097
|
+
I("div", In, [
|
|
1098
|
+
o.value > -1 ? (b(), N(v, {
|
|
1099
|
+
key: 0,
|
|
1100
|
+
class: "flex-1",
|
|
1101
|
+
variant: "secondary",
|
|
1102
|
+
label: "Delete",
|
|
1103
|
+
onclick: () => f(o.value)
|
|
1104
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1105
|
+
y(v, {
|
|
1106
|
+
type: "submit",
|
|
1107
|
+
class: "flex-1",
|
|
1108
|
+
variant: "primary",
|
|
1109
|
+
label: "Save"
|
|
1110
|
+
})
|
|
1111
|
+
])
|
|
1112
|
+
]),
|
|
1113
|
+
_: 1
|
|
1114
|
+
}, 512);
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
}), Cn = { class: "flex items-end" }, Fn = { class: "flex flex-wrap gap-8 items-center mt-4" }, Sn = { class: "flex mt-6 space-x-6" }, Nn = /* @__PURE__ */ H({
|
|
1118
|
+
__name: "KBankGateway",
|
|
1119
|
+
props: {
|
|
1120
|
+
terminal: {
|
|
1121
|
+
type: Object,
|
|
1122
|
+
required: !0
|
|
1123
|
+
},
|
|
1124
|
+
onUpdate: {
|
|
1125
|
+
type: Function,
|
|
1126
|
+
required: !0
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
setup(e) {
|
|
1130
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1131
|
+
receiptName: "",
|
|
1132
|
+
cardTypes: []
|
|
1133
|
+
}), p = () => {
|
|
1134
|
+
n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1135
|
+
}, s = () => {
|
|
1136
|
+
var v;
|
|
1137
|
+
if (!t.value.ecrIntegrations)
|
|
1138
|
+
return p();
|
|
1139
|
+
const m = t.value.ecrIntegrations, i = m.findIndex((g) => g && g.gateway && g.gateway === "Kbank");
|
|
1140
|
+
if (i === -1)
|
|
1141
|
+
return p();
|
|
1142
|
+
o.value = i;
|
|
1143
|
+
const u = m.at(i);
|
|
1144
|
+
u.gateway === "Kbank" && u.config && (n.value = {
|
|
1145
|
+
receiptName: u.receiptName ?? "",
|
|
1146
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1147
|
+
});
|
|
1148
|
+
};
|
|
1149
|
+
ne(t, s), re(s);
|
|
1150
|
+
async function f(m) {
|
|
1151
|
+
var i;
|
|
1152
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1153
|
+
}
|
|
1154
|
+
async function d() {
|
|
1155
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1156
|
+
}
|
|
1157
|
+
return (m, i) => {
|
|
1158
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1159
|
+
return b(), N(k, {
|
|
1160
|
+
ref: l.value,
|
|
1161
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1162
|
+
onValidationSuccess: i[2] || (i[2] = () => {
|
|
1163
|
+
var c, w;
|
|
1164
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1165
|
+
gateway: "Kbank",
|
|
1166
|
+
config: {},
|
|
1167
|
+
receiptName: n.value.receiptName,
|
|
1168
|
+
dialogConfig: {
|
|
1169
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1170
|
+
cardTypes: n.value.cardTypes
|
|
1171
|
+
}
|
|
1172
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1173
|
+
gateway: "Kbank",
|
|
1174
|
+
config: {},
|
|
1175
|
+
receiptName: n.value.receiptName,
|
|
1176
|
+
dialogConfig: {
|
|
1177
|
+
cardTypes: n.value.cardTypes
|
|
1178
|
+
}
|
|
1179
|
+
})), a.onUpdate(t.value);
|
|
1180
|
+
})
|
|
1181
|
+
}, {
|
|
1182
|
+
default: ae(() => [
|
|
1183
|
+
y(u, {
|
|
1184
|
+
modelValue: n.value.receiptName,
|
|
1185
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.receiptName = c),
|
|
1186
|
+
label: "Receipt Payment Name",
|
|
1187
|
+
"label-info": "Default receipt display will be 'TERMINAL_KBANK'"
|
|
1188
|
+
}, null, 8, ["modelValue"]),
|
|
1189
|
+
I("div", Cn, [
|
|
1190
|
+
y(u, {
|
|
1191
|
+
modelValue: r.value,
|
|
1192
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => r.value = c),
|
|
1193
|
+
label: "Fallback Card Types",
|
|
1194
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1195
|
+
}, null, 8, ["modelValue"]),
|
|
1196
|
+
y(v, {
|
|
1197
|
+
class: "ml-4",
|
|
1198
|
+
icon: "add",
|
|
1199
|
+
onClick: d
|
|
1200
|
+
})
|
|
1201
|
+
]),
|
|
1202
|
+
I("div", Fn, [
|
|
1203
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1204
|
+
key: c,
|
|
1205
|
+
label: c,
|
|
1206
|
+
removable: !0,
|
|
1207
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1208
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1209
|
+
]),
|
|
1210
|
+
I("div", Sn, [
|
|
1211
|
+
o.value > -1 ? (b(), N(v, {
|
|
1212
|
+
key: 0,
|
|
1213
|
+
class: "flex-1",
|
|
1214
|
+
variant: "secondary",
|
|
1215
|
+
label: "Delete",
|
|
1216
|
+
onclick: () => f(o.value)
|
|
1217
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1218
|
+
y(v, {
|
|
1219
|
+
type: "submit",
|
|
1220
|
+
class: "flex-1",
|
|
1221
|
+
variant: "primary",
|
|
1222
|
+
label: "Save"
|
|
1223
|
+
})
|
|
1224
|
+
])
|
|
1225
|
+
]),
|
|
1226
|
+
_: 1
|
|
1227
|
+
}, 512);
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
}), kn = { class: "flex mt-6 space-x-6" }, Dn = /* @__PURE__ */ H({
|
|
1231
|
+
__name: "Ghl2Gateway",
|
|
1232
|
+
props: {
|
|
1233
|
+
terminal: {
|
|
1234
|
+
type: Object,
|
|
1235
|
+
required: !0
|
|
1236
|
+
},
|
|
1237
|
+
onUpdate: {
|
|
1238
|
+
type: Function,
|
|
1239
|
+
required: !0
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
setup(e) {
|
|
1243
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T({
|
|
1244
|
+
ip: "",
|
|
1245
|
+
receiptName: ""
|
|
1246
|
+
}), n = () => {
|
|
1247
|
+
r.value.ip = "", r.value.receiptName = "", o.value = -1;
|
|
1248
|
+
}, p = () => {
|
|
1249
|
+
if (!t.value.ecrIntegrations)
|
|
1250
|
+
return n();
|
|
1251
|
+
const f = t.value.ecrIntegrations, d = f.findIndex((i) => i && i.gateway && i.gateway === "Ghl2");
|
|
1252
|
+
if (d === -1)
|
|
1253
|
+
return n();
|
|
1254
|
+
o.value = d;
|
|
1255
|
+
const m = f.at(d);
|
|
1256
|
+
m.gateway === "Ghl2" && m.config && (r.value = {
|
|
1257
|
+
ip: m.config.ip ?? "",
|
|
1258
|
+
receiptName: m.receiptName ?? ""
|
|
1259
|
+
});
|
|
1260
|
+
};
|
|
1261
|
+
ne(t, p), re(p);
|
|
1262
|
+
async function s(f) {
|
|
1263
|
+
var d;
|
|
1264
|
+
(d = t.value.ecrIntegrations) == null || d.splice(f, 1), a.onUpdate(t.value);
|
|
1265
|
+
}
|
|
1266
|
+
return (f, d) => {
|
|
1267
|
+
const m = _("FmTextField"), i = _("FmButton"), u = _("FmForm");
|
|
1268
|
+
return b(), N(u, {
|
|
1269
|
+
ref: l.value,
|
|
1270
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1271
|
+
onValidationSuccess: d[2] || (d[2] = () => {
|
|
1272
|
+
t.value.ecrIntegrations || (t.value.ecrIntegrations = []), o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1273
|
+
gateway: "Ghl2",
|
|
1274
|
+
config: { ip: r.value.ip },
|
|
1275
|
+
receiptName: r.value.receiptName
|
|
1276
|
+
} : t.value.ecrIntegrations.push({
|
|
1277
|
+
gateway: "Ghl2",
|
|
1278
|
+
config: { ip: r.value.ip },
|
|
1279
|
+
receiptName: r.value.receiptName
|
|
1280
|
+
}), a.onUpdate(t.value);
|
|
1281
|
+
})
|
|
1282
|
+
}, {
|
|
1283
|
+
default: ae(() => [
|
|
1284
|
+
y(m, {
|
|
1285
|
+
modelValue: r.value.ip,
|
|
1286
|
+
"onUpdate:modelValue": d[0] || (d[0] = (v) => r.value.ip = v),
|
|
1287
|
+
label: "IP Address"
|
|
1288
|
+
}, null, 8, ["modelValue"]),
|
|
1289
|
+
y(m, {
|
|
1290
|
+
modelValue: r.value.receiptName,
|
|
1291
|
+
"onUpdate:modelValue": d[1] || (d[1] = (v) => r.value.receiptName = v),
|
|
1292
|
+
label: "Receipt Payment Name",
|
|
1293
|
+
"label-info": "Default receipt display will be 'TERMINAL_GHL_2'"
|
|
1294
|
+
}, null, 8, ["modelValue"]),
|
|
1295
|
+
I("div", kn, [
|
|
1296
|
+
o.value > -1 ? (b(), N(i, {
|
|
1297
|
+
key: 0,
|
|
1298
|
+
class: "flex-1",
|
|
1299
|
+
variant: "secondary",
|
|
1300
|
+
label: "Delete",
|
|
1301
|
+
onclick: () => s(o.value)
|
|
1302
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1303
|
+
y(i, {
|
|
1304
|
+
type: "submit",
|
|
1305
|
+
class: "flex-1",
|
|
1306
|
+
variant: "primary",
|
|
1307
|
+
label: "Save"
|
|
1308
|
+
})
|
|
1309
|
+
])
|
|
1310
|
+
]),
|
|
1311
|
+
_: 1
|
|
1312
|
+
}, 512);
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
}), En = { class: "flex items-end" }, Vn = { class: "flex flex-wrap gap-8 items-center mt-4" }, On = { class: "flex mt-6 space-x-6" }, Un = /* @__PURE__ */ H({
|
|
1316
|
+
__name: "Ghl3Gateway",
|
|
1317
|
+
props: {
|
|
1318
|
+
terminal: {
|
|
1319
|
+
type: Object,
|
|
1320
|
+
required: !0
|
|
1321
|
+
},
|
|
1322
|
+
onUpdate: {
|
|
1323
|
+
type: Function,
|
|
1324
|
+
required: !0
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
setup(e) {
|
|
1328
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1329
|
+
receiptName: "",
|
|
1330
|
+
config: {},
|
|
1331
|
+
cardTypes: []
|
|
1332
|
+
}), p = () => {
|
|
1333
|
+
n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1334
|
+
}, s = () => {
|
|
1335
|
+
var v;
|
|
1336
|
+
if (!t.value.ecrIntegrations)
|
|
1337
|
+
return p();
|
|
1338
|
+
const m = t.value.ecrIntegrations, i = m.findIndex(
|
|
1339
|
+
(g) => g && g.gateway && g.gateway === "Ghl3"
|
|
1340
|
+
);
|
|
1341
|
+
if (i === -1)
|
|
1342
|
+
return p();
|
|
1343
|
+
o.value = i;
|
|
1344
|
+
const u = m.at(i);
|
|
1345
|
+
u.gateway === "Ghl3" && u.config && (n.value = {
|
|
1346
|
+
config: u.config,
|
|
1347
|
+
receiptName: u.receiptName ?? "",
|
|
1348
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1349
|
+
});
|
|
1350
|
+
};
|
|
1351
|
+
ne(t, s), re(s);
|
|
1352
|
+
async function f(m) {
|
|
1353
|
+
var i;
|
|
1354
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1355
|
+
}
|
|
1356
|
+
async function d() {
|
|
1357
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1358
|
+
}
|
|
1359
|
+
return (m, i) => {
|
|
1360
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1361
|
+
return b(), N(k, {
|
|
1362
|
+
ref: l.value,
|
|
1363
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1364
|
+
onValidationSuccess: i[2] || (i[2] = () => {
|
|
1365
|
+
var c, w;
|
|
1366
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1367
|
+
gateway: "Ghl3",
|
|
1368
|
+
config: n.value.config,
|
|
1369
|
+
receiptName: n.value.receiptName,
|
|
1370
|
+
dialogConfig: {
|
|
1371
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1372
|
+
cardTypes: n.value.cardTypes
|
|
1373
|
+
}
|
|
1374
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1375
|
+
gateway: "Ghl3",
|
|
1376
|
+
config: n.value.config,
|
|
1377
|
+
receiptName: n.value.receiptName,
|
|
1378
|
+
dialogConfig: {
|
|
1379
|
+
cardTypes: n.value.cardTypes
|
|
1380
|
+
}
|
|
1381
|
+
})), a.onUpdate(t.value);
|
|
1382
|
+
})
|
|
1383
|
+
}, {
|
|
1384
|
+
default: ae(() => [
|
|
1385
|
+
y(u, {
|
|
1386
|
+
modelValue: n.value.receiptName,
|
|
1387
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.receiptName = c),
|
|
1388
|
+
label: "Receipt Payment Name",
|
|
1389
|
+
"label-info": "Default receipt display will be 'TERMINAL_GHL'"
|
|
1390
|
+
}, null, 8, ["modelValue"]),
|
|
1391
|
+
I("div", En, [
|
|
1392
|
+
y(u, {
|
|
1393
|
+
modelValue: r.value,
|
|
1394
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => r.value = c),
|
|
1395
|
+
label: "Fallback Card Types",
|
|
1396
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1397
|
+
}, null, 8, ["modelValue"]),
|
|
1398
|
+
y(v, {
|
|
1399
|
+
class: "ml-4",
|
|
1400
|
+
icon: "add",
|
|
1401
|
+
onClick: d
|
|
1402
|
+
})
|
|
1403
|
+
]),
|
|
1404
|
+
I("div", Vn, [
|
|
1405
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1406
|
+
key: c,
|
|
1407
|
+
label: c,
|
|
1408
|
+
removable: !0,
|
|
1409
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1410
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1411
|
+
]),
|
|
1412
|
+
I("div", On, [
|
|
1413
|
+
o.value > -1 ? (b(), N(v, {
|
|
1414
|
+
key: 0,
|
|
1415
|
+
class: "flex-1",
|
|
1416
|
+
variant: "secondary",
|
|
1417
|
+
label: "Delete",
|
|
1418
|
+
onclick: () => f(o.value)
|
|
1419
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1420
|
+
y(v, {
|
|
1421
|
+
type: "submit",
|
|
1422
|
+
class: "flex-1",
|
|
1423
|
+
variant: "primary",
|
|
1424
|
+
label: "Save"
|
|
1425
|
+
})
|
|
1426
|
+
])
|
|
1427
|
+
]),
|
|
1428
|
+
_: 1
|
|
1429
|
+
}, 512);
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
}), Mn = { class: "flex items-end" }, Pn = { class: "flex flex-wrap gap-8 items-center mt-4" }, An = { class: "flex mt-6 space-x-6" }, Rn = /* @__PURE__ */ H({
|
|
1433
|
+
__name: "HlbbGateway",
|
|
1434
|
+
props: {
|
|
1435
|
+
terminal: {
|
|
1436
|
+
type: Object,
|
|
1437
|
+
required: !0
|
|
1438
|
+
},
|
|
1439
|
+
onUpdate: {
|
|
1440
|
+
type: Function,
|
|
1441
|
+
required: !0
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
setup(e) {
|
|
1445
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1446
|
+
receiptName: "",
|
|
1447
|
+
config: {},
|
|
1448
|
+
cardTypes: []
|
|
1449
|
+
}), p = () => {
|
|
1450
|
+
n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1451
|
+
}, s = () => {
|
|
1452
|
+
var v;
|
|
1453
|
+
if (!t.value.ecrIntegrations)
|
|
1454
|
+
return p();
|
|
1455
|
+
const m = t.value.ecrIntegrations, i = m.findIndex(
|
|
1456
|
+
(g) => g && g.gateway && g.gateway === "Hlbb"
|
|
1457
|
+
);
|
|
1458
|
+
if (i === -1)
|
|
1459
|
+
return p();
|
|
1460
|
+
o.value = i;
|
|
1461
|
+
const u = m.at(i);
|
|
1462
|
+
u.gateway === "Hlbb" && u.config && (n.value = {
|
|
1463
|
+
config: u.config,
|
|
1464
|
+
receiptName: u.receiptName ?? "",
|
|
1465
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1466
|
+
});
|
|
1467
|
+
};
|
|
1468
|
+
ne(t, s), re(s);
|
|
1469
|
+
async function f(m) {
|
|
1470
|
+
var i;
|
|
1471
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1472
|
+
}
|
|
1473
|
+
async function d() {
|
|
1474
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1475
|
+
}
|
|
1476
|
+
return (m, i) => {
|
|
1477
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1478
|
+
return b(), N(k, {
|
|
1479
|
+
ref: l.value,
|
|
1480
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1481
|
+
onValidationSuccess: i[2] || (i[2] = () => {
|
|
1482
|
+
var c, w;
|
|
1483
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1484
|
+
gateway: "Hlbb",
|
|
1485
|
+
config: n.value.config,
|
|
1486
|
+
receiptName: n.value.receiptName,
|
|
1487
|
+
dialogConfig: {
|
|
1488
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1489
|
+
cardTypes: n.value.cardTypes
|
|
1490
|
+
}
|
|
1491
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1492
|
+
gateway: "Hlbb",
|
|
1493
|
+
config: n.value.config,
|
|
1494
|
+
receiptName: n.value.receiptName,
|
|
1495
|
+
dialogConfig: {
|
|
1496
|
+
cardTypes: n.value.cardTypes
|
|
1497
|
+
}
|
|
1498
|
+
})), a.onUpdate(t.value);
|
|
1499
|
+
})
|
|
1500
|
+
}, {
|
|
1501
|
+
default: ae(() => [
|
|
1502
|
+
y(u, {
|
|
1503
|
+
modelValue: n.value.receiptName,
|
|
1504
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.receiptName = c),
|
|
1505
|
+
label: "Receipt Payment Name",
|
|
1506
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
1507
|
+
}, null, 8, ["modelValue"]),
|
|
1508
|
+
I("div", Mn, [
|
|
1509
|
+
y(u, {
|
|
1510
|
+
modelValue: r.value,
|
|
1511
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => r.value = c),
|
|
1512
|
+
label: "Fallback Card Types",
|
|
1513
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1514
|
+
}, null, 8, ["modelValue"]),
|
|
1515
|
+
y(v, {
|
|
1516
|
+
class: "ml-4",
|
|
1517
|
+
icon: "add",
|
|
1518
|
+
onClick: d
|
|
1519
|
+
})
|
|
1520
|
+
]),
|
|
1521
|
+
I("div", Pn, [
|
|
1522
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1523
|
+
key: c,
|
|
1524
|
+
label: c,
|
|
1525
|
+
removable: !0,
|
|
1526
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1527
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1528
|
+
]),
|
|
1529
|
+
I("div", An, [
|
|
1530
|
+
o.value > -1 ? (b(), N(v, {
|
|
1531
|
+
key: 0,
|
|
1532
|
+
class: "flex-1",
|
|
1533
|
+
variant: "secondary",
|
|
1534
|
+
label: "Delete",
|
|
1535
|
+
onclick: () => f(o.value)
|
|
1536
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1537
|
+
y(v, {
|
|
1538
|
+
type: "submit",
|
|
1539
|
+
class: "flex-1",
|
|
1540
|
+
variant: "primary",
|
|
1541
|
+
label: "Save"
|
|
1542
|
+
})
|
|
1543
|
+
])
|
|
1544
|
+
]),
|
|
1545
|
+
_: 1
|
|
1546
|
+
}, 512);
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
}), qn = { class: "flex items-end" }, Bn = { class: "flex flex-wrap gap-8 items-center mt-4" }, Gn = { class: "flex mt-6 space-x-6" }, Yn = /* @__PURE__ */ H({
|
|
1550
|
+
__name: "GlobalPaymentsGateway",
|
|
1551
|
+
props: {
|
|
1552
|
+
terminal: {
|
|
1553
|
+
type: Object,
|
|
1554
|
+
required: !0
|
|
1555
|
+
},
|
|
1556
|
+
onUpdate: {
|
|
1557
|
+
type: Function,
|
|
1558
|
+
required: !0
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
setup(e) {
|
|
1562
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1563
|
+
ip: "",
|
|
1564
|
+
receiptName: "",
|
|
1565
|
+
cardTypes: []
|
|
1566
|
+
}), p = () => {
|
|
1567
|
+
n.value.ip = "", n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1568
|
+
}, s = () => {
|
|
1569
|
+
var v;
|
|
1570
|
+
if (!t.value.ecrIntegrations)
|
|
1571
|
+
return p();
|
|
1572
|
+
const m = t.value.ecrIntegrations, i = m.findIndex(
|
|
1573
|
+
(g) => g && g.gateway && g.gateway === "GlobalPayments"
|
|
1574
|
+
);
|
|
1575
|
+
if (i === -1)
|
|
1576
|
+
return p();
|
|
1577
|
+
o.value = i;
|
|
1578
|
+
const u = m.at(i);
|
|
1579
|
+
u.gateway === "GlobalPayments" && u.config && (n.value = {
|
|
1580
|
+
ip: u.config.ip ?? "",
|
|
1581
|
+
receiptName: u.receiptName ?? "",
|
|
1582
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1583
|
+
});
|
|
1584
|
+
};
|
|
1585
|
+
ne(t, s), re(s);
|
|
1586
|
+
async function f(m) {
|
|
1587
|
+
var i;
|
|
1588
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1589
|
+
}
|
|
1590
|
+
async function d() {
|
|
1591
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1592
|
+
}
|
|
1593
|
+
return (m, i) => {
|
|
1594
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1595
|
+
return b(), N(k, {
|
|
1596
|
+
ref: l.value,
|
|
1597
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1598
|
+
onValidationSuccess: i[3] || (i[3] = () => {
|
|
1599
|
+
var c, w;
|
|
1600
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1601
|
+
gateway: "GlobalPayments",
|
|
1602
|
+
config: { ip: n.value.ip },
|
|
1603
|
+
receiptName: n.value.receiptName,
|
|
1604
|
+
dialogConfig: {
|
|
1605
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1606
|
+
cardTypes: n.value.cardTypes
|
|
1607
|
+
}
|
|
1608
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1609
|
+
gateway: "GlobalPayments",
|
|
1610
|
+
config: { ip: n.value.ip },
|
|
1611
|
+
receiptName: n.value.receiptName,
|
|
1612
|
+
dialogConfig: {
|
|
1613
|
+
cardTypes: n.value.cardTypes
|
|
1614
|
+
}
|
|
1615
|
+
})), a.onUpdate(t.value);
|
|
1616
|
+
})
|
|
1617
|
+
}, {
|
|
1618
|
+
default: ae(() => [
|
|
1619
|
+
y(u, {
|
|
1620
|
+
modelValue: n.value.ip,
|
|
1621
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.ip = c),
|
|
1622
|
+
label: "IP Address"
|
|
1623
|
+
}, null, 8, ["modelValue"]),
|
|
1624
|
+
y(u, {
|
|
1625
|
+
modelValue: n.value.receiptName,
|
|
1626
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => n.value.receiptName = c),
|
|
1627
|
+
label: "Receipt Payment Name",
|
|
1628
|
+
"label-info": "Default receipt display will be 'TERMINAL_GP'"
|
|
1629
|
+
}, null, 8, ["modelValue"]),
|
|
1630
|
+
I("div", qn, [
|
|
1631
|
+
y(u, {
|
|
1632
|
+
modelValue: r.value,
|
|
1633
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => r.value = c),
|
|
1634
|
+
label: "Fallback Card Types",
|
|
1635
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1636
|
+
}, null, 8, ["modelValue"]),
|
|
1637
|
+
y(v, {
|
|
1638
|
+
class: "ml-4",
|
|
1639
|
+
icon: "add",
|
|
1640
|
+
onClick: d
|
|
1641
|
+
})
|
|
1642
|
+
]),
|
|
1643
|
+
I("div", Bn, [
|
|
1644
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1645
|
+
key: c,
|
|
1646
|
+
label: c,
|
|
1647
|
+
removable: !0,
|
|
1648
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1649
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1650
|
+
]),
|
|
1651
|
+
I("div", Gn, [
|
|
1652
|
+
o.value > -1 ? (b(), N(v, {
|
|
1653
|
+
key: 0,
|
|
1654
|
+
class: "flex-1",
|
|
1655
|
+
variant: "secondary",
|
|
1656
|
+
label: "Delete",
|
|
1657
|
+
onclick: () => f(o.value)
|
|
1658
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1659
|
+
y(v, {
|
|
1660
|
+
type: "submit",
|
|
1661
|
+
class: "flex-1",
|
|
1662
|
+
variant: "primary",
|
|
1663
|
+
label: "Save"
|
|
1664
|
+
})
|
|
1665
|
+
])
|
|
1666
|
+
]),
|
|
1667
|
+
_: 1
|
|
1668
|
+
}, 512);
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
}), Ln = { class: "flex items-end" }, $n = { class: "flex flex-wrap gap-8 items-center mt-4" }, jn = { class: "flex mt-6 space-x-6" }, Hn = /* @__PURE__ */ H({
|
|
1672
|
+
__name: "OmaGateway",
|
|
1673
|
+
props: {
|
|
1674
|
+
terminal: {
|
|
1675
|
+
type: Object,
|
|
1676
|
+
required: !0
|
|
1677
|
+
},
|
|
1678
|
+
onUpdate: {
|
|
1679
|
+
type: Function,
|
|
1680
|
+
required: !0
|
|
1681
|
+
}
|
|
1682
|
+
},
|
|
1683
|
+
setup(e) {
|
|
1684
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1685
|
+
receiptName: "",
|
|
1686
|
+
cardTypes: []
|
|
1687
|
+
}), p = () => {
|
|
1688
|
+
n.value.receiptName = "", n.value.cardTypes = [], o.value = -1;
|
|
1689
|
+
}, s = () => {
|
|
1690
|
+
var v;
|
|
1691
|
+
if (!t.value.ecrIntegrations)
|
|
1692
|
+
return p();
|
|
1693
|
+
const m = t.value.ecrIntegrations, i = m.findIndex(
|
|
1694
|
+
(g) => g && g.gateway && g.gateway === "Oma"
|
|
1695
|
+
);
|
|
1696
|
+
if (i === -1)
|
|
1697
|
+
return p();
|
|
1698
|
+
o.value = i;
|
|
1699
|
+
const u = m.at(i);
|
|
1700
|
+
u.gateway === "Oma" && u.config && (n.value = {
|
|
1701
|
+
receiptName: u.receiptName ?? "",
|
|
1702
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1703
|
+
});
|
|
1704
|
+
};
|
|
1705
|
+
ne(t, s), re(s);
|
|
1706
|
+
async function f(m) {
|
|
1707
|
+
var i;
|
|
1708
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1709
|
+
}
|
|
1710
|
+
async function d() {
|
|
1711
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1712
|
+
}
|
|
1713
|
+
return (m, i) => {
|
|
1714
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1715
|
+
return b(), N(k, {
|
|
1716
|
+
ref: l.value,
|
|
1717
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1718
|
+
onValidationSuccess: i[2] || (i[2] = () => {
|
|
1719
|
+
var c, w;
|
|
1720
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1721
|
+
gateway: "Oma",
|
|
1722
|
+
config: {},
|
|
1723
|
+
receiptName: n.value.receiptName,
|
|
1724
|
+
dialogConfig: {
|
|
1725
|
+
...(w = (c = t.value.ecrIntegrations) == null ? void 0 : c[o.value]) == null ? void 0 : w.dialogConfig,
|
|
1726
|
+
cardTypes: n.value.cardTypes
|
|
1727
|
+
}
|
|
1728
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1729
|
+
gateway: "Oma",
|
|
1730
|
+
config: {},
|
|
1731
|
+
receiptName: n.value.receiptName,
|
|
1732
|
+
dialogConfig: {
|
|
1733
|
+
cardTypes: n.value.cardTypes
|
|
1734
|
+
}
|
|
1735
|
+
})), a.onUpdate(t.value);
|
|
1736
|
+
})
|
|
1737
|
+
}, {
|
|
1738
|
+
default: ae(() => [
|
|
1739
|
+
y(u, {
|
|
1740
|
+
modelValue: n.value.receiptName,
|
|
1741
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.receiptName = c),
|
|
1742
|
+
label: "Receipt Payment Name",
|
|
1743
|
+
"label-info": "Default receipt display will be 'TERMINAL_OMA'"
|
|
1744
|
+
}, null, 8, ["modelValue"]),
|
|
1745
|
+
I("div", Ln, [
|
|
1746
|
+
y(u, {
|
|
1747
|
+
modelValue: r.value,
|
|
1748
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => r.value = c),
|
|
1749
|
+
label: "Fallback Card Types",
|
|
1750
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1751
|
+
}, null, 8, ["modelValue"]),
|
|
1752
|
+
y(v, {
|
|
1753
|
+
class: "ml-4",
|
|
1754
|
+
icon: "add",
|
|
1755
|
+
onClick: d
|
|
1756
|
+
})
|
|
1757
|
+
]),
|
|
1758
|
+
I("div", $n, [
|
|
1759
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1760
|
+
key: c,
|
|
1761
|
+
label: c,
|
|
1762
|
+
removable: !0,
|
|
1763
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1764
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1765
|
+
]),
|
|
1766
|
+
I("div", jn, [
|
|
1767
|
+
o.value > -1 ? (b(), N(v, {
|
|
1768
|
+
key: 0,
|
|
1769
|
+
class: "flex-1",
|
|
1770
|
+
variant: "secondary",
|
|
1771
|
+
label: "Delete",
|
|
1772
|
+
onclick: () => f(o.value)
|
|
1773
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1774
|
+
y(v, {
|
|
1775
|
+
type: "submit",
|
|
1776
|
+
class: "flex-1",
|
|
1777
|
+
variant: "primary",
|
|
1778
|
+
label: "Save"
|
|
1779
|
+
})
|
|
1780
|
+
])
|
|
1781
|
+
]),
|
|
1782
|
+
_: 1
|
|
1783
|
+
}, 512);
|
|
1784
|
+
};
|
|
1785
|
+
}
|
|
1786
|
+
}), Xn = { class: "flex items-end" }, Kn = { class: "flex flex-wrap gap-8 items-center mt-4" }, zn = { class: "flex mt-6 space-x-6" }, Wn = /* @__PURE__ */ H({
|
|
1787
|
+
__name: "RevenueGateway",
|
|
1788
|
+
props: {
|
|
1789
|
+
terminal: {
|
|
1790
|
+
type: Object,
|
|
1791
|
+
required: !0
|
|
1792
|
+
},
|
|
1793
|
+
onUpdate: {
|
|
1794
|
+
type: Function,
|
|
1795
|
+
required: !0
|
|
1796
|
+
}
|
|
1797
|
+
},
|
|
1798
|
+
setup(e) {
|
|
1799
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T(), n = T({
|
|
1800
|
+
receiptName: "",
|
|
1801
|
+
ip: "",
|
|
1802
|
+
cardTypes: []
|
|
1803
|
+
}), p = () => {
|
|
1804
|
+
n.value.receiptName = "", n.value.ip = "", n.value.cardTypes = [], o.value = -1;
|
|
1805
|
+
}, s = () => {
|
|
1806
|
+
var v;
|
|
1807
|
+
if (!t.value.ecrIntegrations)
|
|
1808
|
+
return p();
|
|
1809
|
+
const m = t.value.ecrIntegrations, i = m.findIndex(
|
|
1810
|
+
(g) => g && g.gateway && g.gateway === "Revenue"
|
|
1811
|
+
);
|
|
1812
|
+
if (i === -1)
|
|
1813
|
+
return p();
|
|
1814
|
+
o.value = i;
|
|
1815
|
+
const u = m.at(i);
|
|
1816
|
+
u.gateway === "Revenue" && u.config && (n.value = {
|
|
1817
|
+
receiptName: u.receiptName ?? "",
|
|
1818
|
+
ip: u.config.ip ?? "",
|
|
1819
|
+
cardTypes: ((v = u.dialogConfig) == null ? void 0 : v.cardTypes) ?? []
|
|
1820
|
+
});
|
|
1821
|
+
};
|
|
1822
|
+
ne(t, s), re(s);
|
|
1823
|
+
async function f(m) {
|
|
1824
|
+
var i;
|
|
1825
|
+
(i = t.value.ecrIntegrations) == null || i.splice(m, 1), a.onUpdate(t.value);
|
|
1826
|
+
}
|
|
1827
|
+
async function d() {
|
|
1828
|
+
n.value.cardTypes.push(r.value), r.value = "";
|
|
1829
|
+
}
|
|
1830
|
+
return (m, i) => {
|
|
1831
|
+
const u = _("FmTextField"), v = _("FmButton"), g = _("FmChip"), k = _("FmForm");
|
|
1832
|
+
return b(), N(k, {
|
|
1833
|
+
ref: l.value,
|
|
1834
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1835
|
+
onValidationSuccess: i[3] || (i[3] = () => {
|
|
1836
|
+
var w, A;
|
|
1837
|
+
const c = {
|
|
1838
|
+
type: "tcp",
|
|
1839
|
+
ip: n.value.ip
|
|
1840
|
+
};
|
|
1841
|
+
o.value > -1 ? t.value.ecrIntegrations[o.value] = {
|
|
1842
|
+
gateway: "Revenue",
|
|
1843
|
+
config: c,
|
|
1844
|
+
receiptName: n.value.receiptName,
|
|
1845
|
+
dialogConfig: {
|
|
1846
|
+
...(A = (w = t.value.ecrIntegrations) == null ? void 0 : w[o.value]) == null ? void 0 : A.dialogConfig,
|
|
1847
|
+
cardTypes: n.value.cardTypes
|
|
1848
|
+
}
|
|
1849
|
+
} : (t.value.ecrIntegrations || (t.value.ecrIntegrations = []), t.value.ecrIntegrations.push({
|
|
1850
|
+
gateway: "Revenue",
|
|
1851
|
+
config: c,
|
|
1852
|
+
receiptName: n.value.receiptName,
|
|
1853
|
+
dialogConfig: {
|
|
1854
|
+
cardTypes: n.value.cardTypes
|
|
1855
|
+
}
|
|
1856
|
+
})), a.onUpdate(t.value);
|
|
1857
|
+
})
|
|
1858
|
+
}, {
|
|
1859
|
+
default: ae(() => [
|
|
1860
|
+
y(u, {
|
|
1861
|
+
modelValue: n.value.ip,
|
|
1862
|
+
"onUpdate:modelValue": i[0] || (i[0] = (c) => n.value.ip = c),
|
|
1863
|
+
label: "Terminal IP Address",
|
|
1864
|
+
"label-info": "Terminal WiFi IP with optional port, e.g. 192.168.1.50:8080 (defaults to port 8080)",
|
|
1865
|
+
rules: V(ia)(V(sa).string().min(1))
|
|
1866
|
+
}, null, 8, ["modelValue", "rules"]),
|
|
1867
|
+
y(u, {
|
|
1868
|
+
modelValue: n.value.receiptName,
|
|
1869
|
+
"onUpdate:modelValue": i[1] || (i[1] = (c) => n.value.receiptName = c),
|
|
1870
|
+
label: "Receipt Payment Name",
|
|
1871
|
+
"label-info": "Default receipt display will be 'TERMINAL_REVENUE'"
|
|
1872
|
+
}, null, 8, ["modelValue"]),
|
|
1873
|
+
I("div", Xn, [
|
|
1874
|
+
y(u, {
|
|
1875
|
+
modelValue: r.value,
|
|
1876
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => r.value = c),
|
|
1877
|
+
label: "Fallback Card Types",
|
|
1878
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1879
|
+
}, null, 8, ["modelValue"]),
|
|
1880
|
+
y(v, {
|
|
1881
|
+
class: "ml-4",
|
|
1882
|
+
icon: "add",
|
|
1883
|
+
onClick: d
|
|
1884
|
+
})
|
|
1885
|
+
]),
|
|
1886
|
+
I("div", Kn, [
|
|
1887
|
+
(b(!0), R(oe, null, be(n.value.cardTypes, (c) => (b(), N(g, {
|
|
1888
|
+
key: c,
|
|
1889
|
+
label: c,
|
|
1890
|
+
removable: !0,
|
|
1891
|
+
onChipClosed: () => n.value.cardTypes.splice(n.value.cardTypes.indexOf(c), 1)
|
|
1892
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1893
|
+
]),
|
|
1894
|
+
I("div", zn, [
|
|
1895
|
+
o.value > -1 ? (b(), N(v, {
|
|
1896
|
+
key: 0,
|
|
1897
|
+
class: "flex-1",
|
|
1898
|
+
variant: "secondary",
|
|
1899
|
+
label: "Delete",
|
|
1900
|
+
onclick: () => f(o.value)
|
|
1901
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
1902
|
+
y(v, {
|
|
1903
|
+
type: "submit",
|
|
1904
|
+
class: "flex-1",
|
|
1905
|
+
variant: "primary",
|
|
1906
|
+
label: "Save"
|
|
1907
|
+
})
|
|
1908
|
+
])
|
|
1909
|
+
]),
|
|
1910
|
+
_: 1
|
|
1911
|
+
}, 512);
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
}), Qn = { class: "flex items-center" }, Jn = { class: "w-[260px] self-start" }, Zn = { class: "flex-1" }, el = /* @__PURE__ */ H({
|
|
1915
|
+
__name: "EcrGateway",
|
|
1916
|
+
props: {
|
|
1917
|
+
terminal: {
|
|
1918
|
+
type: Object,
|
|
1919
|
+
required: !0
|
|
1920
|
+
},
|
|
1921
|
+
onUpdate: {
|
|
1922
|
+
type: Function,
|
|
1923
|
+
required: !0
|
|
1924
|
+
}
|
|
1925
|
+
},
|
|
1926
|
+
setup(e) {
|
|
1927
|
+
var p;
|
|
1928
|
+
const a = e, t = [
|
|
1929
|
+
{
|
|
1930
|
+
label: "FeedMe Terminal",
|
|
1931
|
+
value: "terminal",
|
|
1932
|
+
render: on
|
|
1933
|
+
},
|
|
1934
|
+
{
|
|
1935
|
+
label: "GHL Terminal",
|
|
1936
|
+
value: "ghl",
|
|
1937
|
+
render: sn,
|
|
1938
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
label: "GHL2 Terminal",
|
|
1942
|
+
value: "ghl2",
|
|
1943
|
+
render: Dn,
|
|
1944
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1945
|
+
},
|
|
1946
|
+
{
|
|
1947
|
+
label: "ITB Maybank Terminal",
|
|
1948
|
+
value: "mb-itb",
|
|
1949
|
+
render: pn,
|
|
1950
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
label: "PMA Maybank Terminal",
|
|
1954
|
+
value: "mb-pma",
|
|
1955
|
+
render: gn,
|
|
1956
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1957
|
+
},
|
|
1958
|
+
{
|
|
1959
|
+
label: "Paysys Maybank Terminal",
|
|
1960
|
+
value: "mb-paysys",
|
|
1961
|
+
render: _n,
|
|
1962
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
label: "Nets Terminal",
|
|
1966
|
+
value: "nets",
|
|
1967
|
+
render: xn,
|
|
1968
|
+
region: [W.F_COUNTRY.enum.SG]
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
label: "KBank Terminal",
|
|
1972
|
+
value: "kbank",
|
|
1973
|
+
render: Nn,
|
|
1974
|
+
region: [W.F_COUNTRY.enum.TH]
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
label: "GHL Terminal",
|
|
1978
|
+
value: "ghl3",
|
|
1979
|
+
render: Un,
|
|
1980
|
+
region: [W.F_COUNTRY.enum.TH]
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
label: "Paysys HLBB Terminal",
|
|
1984
|
+
value: "hlbb",
|
|
1985
|
+
render: Rn,
|
|
1986
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
1987
|
+
},
|
|
1988
|
+
{
|
|
1989
|
+
label: "GPAP Terminal",
|
|
1990
|
+
value: "globalpayments",
|
|
1991
|
+
render: Yn,
|
|
1992
|
+
region: [W.F_COUNTRY.enum.SG]
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
label: "OMA Terminal",
|
|
1996
|
+
value: "oma",
|
|
1997
|
+
render: Hn,
|
|
1998
|
+
region: [W.F_COUNTRY.enum.PK]
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
label: "Revenue PBB Terminal",
|
|
2002
|
+
value: "revenue",
|
|
2003
|
+
render: Wn,
|
|
2004
|
+
region: [W.F_COUNTRY.enum.MY]
|
|
2005
|
+
}
|
|
2006
|
+
], l = $(() => t.find((s) => s.value === n.value)), o = _t().currentCountry, r = $(() => t.filter(
|
|
2007
|
+
(s) => !s.region || s.region.includes(o.value ?? W.F_COUNTRY.enum.MY)
|
|
2008
|
+
)), { gatewayTab: n } = bt({
|
|
2009
|
+
gatewayTab: (p = r.value[0]) == null ? void 0 : p.value
|
|
2010
|
+
});
|
|
2011
|
+
return (s, f) => {
|
|
2012
|
+
var m;
|
|
2013
|
+
const d = _("FmTabs");
|
|
2014
|
+
return b(), R("div", Qn, [
|
|
2015
|
+
I("div", Jn, [
|
|
2016
|
+
y(d, {
|
|
2017
|
+
"model-value": V(n),
|
|
2018
|
+
"onUpdate:modelValue": f[0] || (f[0] = (i) => Oe(n) ? n.value = i : null),
|
|
2019
|
+
class: "mb-6",
|
|
2020
|
+
vertical: !0,
|
|
2021
|
+
items: r.value,
|
|
2022
|
+
"show-more-at": Number.POSITIVE_INFINITY
|
|
2023
|
+
}, null, 8, ["model-value", "items", "show-more-at"])
|
|
2024
|
+
]),
|
|
2025
|
+
I("div", Zn, [
|
|
2026
|
+
V(n) ? (b(), N(vt((m = l.value) == null ? void 0 : m.render), gt(yt({ key: 0 }, {
|
|
2027
|
+
terminal: a.terminal,
|
|
2028
|
+
onUpdate: a.onUpdate
|
|
2029
|
+
})), null, 16)) : Y("", !0)
|
|
2030
|
+
])
|
|
2031
|
+
]);
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
}), tl = { class: "flex mt-6 space-x-6" }, al = /* @__PURE__ */ H({
|
|
2035
|
+
__name: "PromptPayGateway",
|
|
2036
|
+
props: {
|
|
2037
|
+
terminal: {
|
|
2038
|
+
type: Object,
|
|
2039
|
+
required: !0
|
|
2040
|
+
},
|
|
2041
|
+
onUpdate: {
|
|
2042
|
+
type: Function,
|
|
2043
|
+
required: !0
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
setup(e) {
|
|
2047
|
+
const a = e, t = ce(() => a.terminal), l = T(), o = T(-1), r = T({
|
|
2048
|
+
account: "",
|
|
2049
|
+
receiptName: ""
|
|
2050
|
+
}), n = () => {
|
|
2051
|
+
r.value.account = "", r.value.receiptName = "", o.value = -1;
|
|
2052
|
+
}, p = () => {
|
|
2053
|
+
if (!t.value.qrIntegrations)
|
|
2054
|
+
return n();
|
|
2055
|
+
const f = t.value.qrIntegrations, d = f.findIndex((i) => i && i.gateway && i.gateway === "PROMPTPAY");
|
|
2056
|
+
if (d === -1)
|
|
2057
|
+
return n();
|
|
2058
|
+
o.value = d;
|
|
2059
|
+
const m = f.at(d);
|
|
2060
|
+
m.gateway === "PROMPTPAY" && m.config && (r.value = {
|
|
2061
|
+
account: m.config.account ?? "",
|
|
2062
|
+
receiptName: m.receiptName ?? ""
|
|
2063
|
+
});
|
|
2064
|
+
};
|
|
2065
|
+
ne(t, p), re(p);
|
|
2066
|
+
async function s(f) {
|
|
2067
|
+
var d;
|
|
2068
|
+
(d = t.value.qrIntegrations) == null || d.splice(f, 1), a.onUpdate(t.value);
|
|
2069
|
+
}
|
|
2070
|
+
return (f, d) => {
|
|
2071
|
+
const m = _("FmTextField"), i = _("FmButton"), u = _("FmForm");
|
|
2072
|
+
return b(), N(u, {
|
|
2073
|
+
ref: l.value,
|
|
2074
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
2075
|
+
onValidationSuccess: d[2] || (d[2] = () => {
|
|
2076
|
+
o.value > -1 ? t.value.qrIntegrations[o.value] = { gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName } : (t.value.qrIntegrations || (t.value.qrIntegrations = []), t.value.qrIntegrations.push({ gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName })), a.onUpdate(t.value);
|
|
2077
|
+
})
|
|
2078
|
+
}, {
|
|
2079
|
+
default: ae(() => [
|
|
2080
|
+
y(m, {
|
|
2081
|
+
modelValue: r.value.account,
|
|
2082
|
+
"onUpdate:modelValue": d[0] || (d[0] = (v) => r.value.account = v),
|
|
2083
|
+
label: "Thai Phone Number / Thai Naitonal ID",
|
|
2084
|
+
"label-info": "Thai Phone Number can be prefixed with 66 or 0 will be fine both will works well."
|
|
2085
|
+
}, null, 8, ["modelValue"]),
|
|
2086
|
+
y(m, {
|
|
2087
|
+
modelValue: r.value.receiptName,
|
|
2088
|
+
"onUpdate:modelValue": d[1] || (d[1] = (v) => r.value.receiptName = v),
|
|
2089
|
+
label: "Receipt Payment Name",
|
|
2090
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
2091
|
+
}, null, 8, ["modelValue"]),
|
|
2092
|
+
I("div", tl, [
|
|
2093
|
+
o.value > -1 ? (b(), N(i, {
|
|
2094
|
+
key: 0,
|
|
2095
|
+
class: "flex-1",
|
|
2096
|
+
variant: "secondary",
|
|
2097
|
+
label: "Delete",
|
|
2098
|
+
onclick: () => s(o.value)
|
|
2099
|
+
}, null, 8, ["onclick"])) : Y("", !0),
|
|
2100
|
+
y(i, {
|
|
2101
|
+
type: "submit",
|
|
2102
|
+
class: "flex-1",
|
|
2103
|
+
variant: "primary",
|
|
2104
|
+
label: "Save"
|
|
2105
|
+
})
|
|
2106
|
+
])
|
|
2107
|
+
]),
|
|
2108
|
+
_: 1
|
|
2109
|
+
}, 512);
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
}), nl = { class: "flex items-center" }, ll = { class: "w-[260px] self-start" }, ol = { class: "flex-1" }, rl = /* @__PURE__ */ H({
|
|
2113
|
+
__name: "QrGateway",
|
|
2114
|
+
props: {
|
|
2115
|
+
terminal: {
|
|
2116
|
+
type: Object,
|
|
2117
|
+
required: !0
|
|
2118
|
+
},
|
|
2119
|
+
onUpdate: {
|
|
2120
|
+
type: Function,
|
|
2121
|
+
required: !0
|
|
2122
|
+
}
|
|
2123
|
+
},
|
|
2124
|
+
setup(e) {
|
|
2125
|
+
var p;
|
|
2126
|
+
const a = e, t = [
|
|
2127
|
+
{
|
|
2128
|
+
label: "PromptPay",
|
|
2129
|
+
value: "promptpay",
|
|
2130
|
+
render: al,
|
|
2131
|
+
region: [W.F_COUNTRY.enum.TH]
|
|
2132
|
+
}
|
|
2133
|
+
], l = $(() => t.find((s) => s.value === n.value)), o = _t().currentCountry, r = $(() => t.filter((s) => !s.region || s.region.includes(o.value ?? W.F_COUNTRY.enum.MY))), { gatewayTab: n } = bt({
|
|
2134
|
+
gatewayTab: (p = r.value[0]) == null ? void 0 : p.value
|
|
2135
|
+
});
|
|
2136
|
+
return (s, f) => {
|
|
2137
|
+
var m;
|
|
2138
|
+
const d = _("FmTabs");
|
|
2139
|
+
return b(), R("div", nl, [
|
|
2140
|
+
I("div", ll, [
|
|
2141
|
+
y(d, {
|
|
2142
|
+
"model-value": V(n),
|
|
2143
|
+
"onUpdate:modelValue": f[0] || (f[0] = (i) => Oe(n) ? n.value = i : null),
|
|
2144
|
+
class: "mb-6",
|
|
2145
|
+
vertical: !0,
|
|
2146
|
+
items: r.value
|
|
2147
|
+
}, null, 8, ["model-value", "items"])
|
|
2148
|
+
]),
|
|
2149
|
+
I("div", ol, [
|
|
2150
|
+
V(n) ? (b(), N(vt((m = l.value) == null ? void 0 : m.render), gt(yt({ key: 0 }, {
|
|
2151
|
+
terminal: a.terminal,
|
|
2152
|
+
onUpdate: a.onUpdate
|
|
2153
|
+
})), null, 16)) : Y("", !0)
|
|
2154
|
+
])
|
|
2155
|
+
]);
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
var il = Object.defineProperty, ut = Object.getOwnPropertySymbols, ua = Object.prototype.hasOwnProperty, ca = Object.prototype.propertyIsEnumerable, Lt = (e, a, t) => a in e ? il(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, qe = (e, a) => {
|
|
2160
|
+
for (var t in a || (a = {}))
|
|
2161
|
+
ua.call(a, t) && Lt(e, t, a[t]);
|
|
2162
|
+
if (ut)
|
|
2163
|
+
for (var t of ut(a))
|
|
2164
|
+
ca.call(a, t) && Lt(e, t, a[t]);
|
|
2165
|
+
return e;
|
|
2166
|
+
}, da = (e, a) => {
|
|
2167
|
+
var t = {};
|
|
2168
|
+
for (var l in e)
|
|
2169
|
+
ua.call(e, l) && a.indexOf(l) < 0 && (t[l] = e[l]);
|
|
2170
|
+
if (e != null && ut)
|
|
2171
|
+
for (var l of ut(e))
|
|
2172
|
+
a.indexOf(l) < 0 && ca.call(e, l) && (t[l] = e[l]);
|
|
2173
|
+
return t;
|
|
2174
|
+
};
|
|
2175
|
+
const pa = "[vue-draggable-plus]: ";
|
|
2176
|
+
function sl(e) {
|
|
2177
|
+
console.warn(pa + e);
|
|
2178
|
+
}
|
|
2179
|
+
function ul(e) {
|
|
2180
|
+
console.error(pa + e);
|
|
2181
|
+
}
|
|
2182
|
+
function $t(e, a, t) {
|
|
2183
|
+
return t >= 0 && t < e.length && e.splice(t, 0, e.splice(a, 1)[0]), e;
|
|
2184
|
+
}
|
|
2185
|
+
function cl(e) {
|
|
2186
|
+
return e.replace(/-(\w)/g, (a, t) => t ? t.toUpperCase() : "");
|
|
2187
|
+
}
|
|
2188
|
+
function dl(e) {
|
|
2189
|
+
return Object.keys(e).reduce((a, t) => (typeof e[t] < "u" && (a[cl(t)] = e[t]), a), {});
|
|
2190
|
+
}
|
|
2191
|
+
function jt(e, a) {
|
|
2192
|
+
return Array.isArray(e) && e.splice(a, 1), e;
|
|
2193
|
+
}
|
|
2194
|
+
function Ht(e, a, t) {
|
|
2195
|
+
return Array.isArray(e) && e.splice(a, 0, t), e;
|
|
2196
|
+
}
|
|
2197
|
+
function pl(e) {
|
|
2198
|
+
return typeof e > "u";
|
|
2199
|
+
}
|
|
2200
|
+
function ml(e) {
|
|
2201
|
+
return typeof e == "string";
|
|
2202
|
+
}
|
|
2203
|
+
function Xt(e, a, t) {
|
|
2204
|
+
const l = e.children[t];
|
|
2205
|
+
e.insertBefore(a, l);
|
|
2206
|
+
}
|
|
2207
|
+
function It(e) {
|
|
2208
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
2209
|
+
}
|
|
2210
|
+
function fl(e, a = document) {
|
|
2211
|
+
var t;
|
|
2212
|
+
let l = null;
|
|
2213
|
+
return typeof (a == null ? void 0 : a.querySelector) == "function" ? l = (t = a == null ? void 0 : a.querySelector) == null ? void 0 : t.call(a, e) : l = document.querySelector(e), l || sl(`Element not found: ${e}`), l;
|
|
2214
|
+
}
|
|
2215
|
+
function vl(e, a, t = null) {
|
|
2216
|
+
return function(...l) {
|
|
2217
|
+
return e.apply(t, l), a.apply(t, l);
|
|
2218
|
+
};
|
|
2219
|
+
}
|
|
2220
|
+
function gl(e, a) {
|
|
2221
|
+
const t = qe({}, e);
|
|
2222
|
+
return Object.keys(a).forEach((l) => {
|
|
2223
|
+
t[l] ? t[l] = vl(e[l], a[l]) : t[l] = a[l];
|
|
2224
|
+
}), t;
|
|
2225
|
+
}
|
|
2226
|
+
function yl(e) {
|
|
2227
|
+
return e instanceof HTMLElement;
|
|
2228
|
+
}
|
|
2229
|
+
function Kt(e, a) {
|
|
2230
|
+
Object.keys(e).forEach((t) => {
|
|
2231
|
+
a(t, e[t]);
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
function hl(e) {
|
|
2235
|
+
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
2236
|
+
}
|
|
2237
|
+
const bl = Object.assign;
|
|
2238
|
+
/**!
|
|
2239
|
+
* Sortable 1.15.2
|
|
2240
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
2241
|
+
* @author owenm <owen23355@gmail.com>
|
|
2242
|
+
* @license MIT
|
|
2243
|
+
*/
|
|
2244
|
+
function zt(e, a) {
|
|
2245
|
+
var t = Object.keys(e);
|
|
2246
|
+
if (Object.getOwnPropertySymbols) {
|
|
2247
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
2248
|
+
a && (l = l.filter(function(o) {
|
|
2249
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
2250
|
+
})), t.push.apply(t, l);
|
|
2251
|
+
}
|
|
2252
|
+
return t;
|
|
2253
|
+
}
|
|
2254
|
+
function we(e) {
|
|
2255
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
2256
|
+
var t = arguments[a] != null ? arguments[a] : {};
|
|
2257
|
+
a % 2 ? zt(Object(t), !0).forEach(function(l) {
|
|
2258
|
+
_l(e, l, t[l]);
|
|
2259
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : zt(Object(t)).forEach(function(l) {
|
|
2260
|
+
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(t, l));
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
return e;
|
|
2264
|
+
}
|
|
2265
|
+
function lt(e) {
|
|
2266
|
+
"@babel/helpers - typeof";
|
|
2267
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? lt = function(a) {
|
|
2268
|
+
return typeof a;
|
|
2269
|
+
} : lt = function(a) {
|
|
2270
|
+
return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
|
|
2271
|
+
}, lt(e);
|
|
2272
|
+
}
|
|
2273
|
+
function _l(e, a, t) {
|
|
2274
|
+
return a in e ? Object.defineProperty(e, a, {
|
|
2275
|
+
value: t,
|
|
2276
|
+
enumerable: !0,
|
|
2277
|
+
configurable: !0,
|
|
2278
|
+
writable: !0
|
|
2279
|
+
}) : e[a] = t, e;
|
|
2280
|
+
}
|
|
2281
|
+
function Ie() {
|
|
2282
|
+
return Ie = Object.assign || function(e) {
|
|
2283
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
2284
|
+
var t = arguments[a];
|
|
2285
|
+
for (var l in t)
|
|
2286
|
+
Object.prototype.hasOwnProperty.call(t, l) && (e[l] = t[l]);
|
|
2287
|
+
}
|
|
2288
|
+
return e;
|
|
2289
|
+
}, Ie.apply(this, arguments);
|
|
2290
|
+
}
|
|
2291
|
+
function wl(e, a) {
|
|
2292
|
+
if (e == null)
|
|
2293
|
+
return {};
|
|
2294
|
+
var t = {}, l = Object.keys(e), o, r;
|
|
2295
|
+
for (r = 0; r < l.length; r++)
|
|
2296
|
+
o = l[r], !(a.indexOf(o) >= 0) && (t[o] = e[o]);
|
|
2297
|
+
return t;
|
|
2298
|
+
}
|
|
2299
|
+
function Tl(e, a) {
|
|
2300
|
+
if (e == null)
|
|
2301
|
+
return {};
|
|
2302
|
+
var t = wl(e, a), l, o;
|
|
2303
|
+
if (Object.getOwnPropertySymbols) {
|
|
2304
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
2305
|
+
for (o = 0; o < r.length; o++)
|
|
2306
|
+
l = r[o], !(a.indexOf(l) >= 0) && Object.prototype.propertyIsEnumerable.call(e, l) && (t[l] = e[l]);
|
|
2307
|
+
}
|
|
2308
|
+
return t;
|
|
2309
|
+
}
|
|
2310
|
+
var Il = "1.15.2";
|
|
2311
|
+
function Te(e) {
|
|
2312
|
+
if (typeof window < "u" && window.navigator)
|
|
2313
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
2314
|
+
}
|
|
2315
|
+
var xe = Te(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Qe = Te(/Edge/i), Wt = Te(/firefox/i), He = Te(/safari/i) && !Te(/chrome/i) && !Te(/android/i), ma = Te(/iP(ad|od|hone)/i), fa = Te(/chrome/i) && Te(/android/i), va = {
|
|
2316
|
+
capture: !1,
|
|
2317
|
+
passive: !1
|
|
2318
|
+
};
|
|
2319
|
+
function M(e, a, t) {
|
|
2320
|
+
e.addEventListener(a, t, !xe && va);
|
|
2321
|
+
}
|
|
2322
|
+
function O(e, a, t) {
|
|
2323
|
+
e.removeEventListener(a, t, !xe && va);
|
|
2324
|
+
}
|
|
2325
|
+
function ct(e, a) {
|
|
2326
|
+
if (a) {
|
|
2327
|
+
if (a[0] === ">" && (a = a.substring(1)), e)
|
|
2328
|
+
try {
|
|
2329
|
+
if (e.matches)
|
|
2330
|
+
return e.matches(a);
|
|
2331
|
+
if (e.msMatchesSelector)
|
|
2332
|
+
return e.msMatchesSelector(a);
|
|
2333
|
+
if (e.webkitMatchesSelector)
|
|
2334
|
+
return e.webkitMatchesSelector(a);
|
|
2335
|
+
} catch {
|
|
2336
|
+
return !1;
|
|
2337
|
+
}
|
|
2338
|
+
return !1;
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
function xl(e) {
|
|
2342
|
+
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
2343
|
+
}
|
|
2344
|
+
function he(e, a, t, l) {
|
|
2345
|
+
if (e) {
|
|
2346
|
+
t = t || document;
|
|
2347
|
+
do {
|
|
2348
|
+
if (a != null && (a[0] === ">" ? e.parentNode === t && ct(e, a) : ct(e, a)) || l && e === t)
|
|
2349
|
+
return e;
|
|
2350
|
+
if (e === t)
|
|
2351
|
+
break;
|
|
2352
|
+
} while (e = xl(e));
|
|
2353
|
+
}
|
|
2354
|
+
return null;
|
|
2355
|
+
}
|
|
2356
|
+
var Qt = /\s+/g;
|
|
2357
|
+
function me(e, a, t) {
|
|
2358
|
+
if (e && a)
|
|
2359
|
+
if (e.classList)
|
|
2360
|
+
e.classList[t ? "add" : "remove"](a);
|
|
2361
|
+
else {
|
|
2362
|
+
var l = (" " + e.className + " ").replace(Qt, " ").replace(" " + a + " ", " ");
|
|
2363
|
+
e.className = (l + (t ? " " + a : "")).replace(Qt, " ");
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
function F(e, a, t) {
|
|
2367
|
+
var l = e && e.style;
|
|
2368
|
+
if (l) {
|
|
2369
|
+
if (t === void 0)
|
|
2370
|
+
return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (t = e.currentStyle), a === void 0 ? t : t[a];
|
|
2371
|
+
!(a in l) && a.indexOf("webkit") === -1 && (a = "-webkit-" + a), l[a] = t + (typeof t == "string" ? "" : "px");
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
function Ge(e, a) {
|
|
2375
|
+
var t = "";
|
|
2376
|
+
if (typeof e == "string")
|
|
2377
|
+
t = e;
|
|
2378
|
+
else
|
|
2379
|
+
do {
|
|
2380
|
+
var l = F(e, "transform");
|
|
2381
|
+
l && l !== "none" && (t = l + " " + t);
|
|
2382
|
+
} while (!a && (e = e.parentNode));
|
|
2383
|
+
var o = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
2384
|
+
return o && new o(t);
|
|
2385
|
+
}
|
|
2386
|
+
function ga(e, a, t) {
|
|
2387
|
+
if (e) {
|
|
2388
|
+
var l = e.getElementsByTagName(a), o = 0, r = l.length;
|
|
2389
|
+
if (t)
|
|
2390
|
+
for (; o < r; o++)
|
|
2391
|
+
t(l[o], o);
|
|
2392
|
+
return l;
|
|
2393
|
+
}
|
|
2394
|
+
return [];
|
|
2395
|
+
}
|
|
2396
|
+
function _e() {
|
|
2397
|
+
var e = document.scrollingElement;
|
|
2398
|
+
return e || document.documentElement;
|
|
2399
|
+
}
|
|
2400
|
+
function te(e, a, t, l, o) {
|
|
2401
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
2402
|
+
var r, n, p, s, f, d, m;
|
|
2403
|
+
if (e !== window && e.parentNode && e !== _e() ? (r = e.getBoundingClientRect(), n = r.top, p = r.left, s = r.bottom, f = r.right, d = r.height, m = r.width) : (n = 0, p = 0, s = window.innerHeight, f = window.innerWidth, d = window.innerHeight, m = window.innerWidth), (a || t) && e !== window && (o = o || e.parentNode, !xe))
|
|
2404
|
+
do
|
|
2405
|
+
if (o && o.getBoundingClientRect && (F(o, "transform") !== "none" || t && F(o, "position") !== "static")) {
|
|
2406
|
+
var i = o.getBoundingClientRect();
|
|
2407
|
+
n -= i.top + parseInt(F(o, "border-top-width")), p -= i.left + parseInt(F(o, "border-left-width")), s = n + r.height, f = p + r.width;
|
|
2408
|
+
break;
|
|
2409
|
+
}
|
|
2410
|
+
while (o = o.parentNode);
|
|
2411
|
+
if (l && e !== window) {
|
|
2412
|
+
var u = Ge(o || e), v = u && u.a, g = u && u.d;
|
|
2413
|
+
u && (n /= g, p /= v, m /= v, d /= g, s = n + d, f = p + m);
|
|
2414
|
+
}
|
|
2415
|
+
return {
|
|
2416
|
+
top: n,
|
|
2417
|
+
left: p,
|
|
2418
|
+
bottom: s,
|
|
2419
|
+
right: f,
|
|
2420
|
+
width: m,
|
|
2421
|
+
height: d
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
function Jt(e, a, t) {
|
|
2426
|
+
for (var l = Ne(e, !0), o = te(e)[a]; l; ) {
|
|
2427
|
+
var r = te(l)[t], n = void 0;
|
|
2428
|
+
if (n = o >= r, !n)
|
|
2429
|
+
return l;
|
|
2430
|
+
if (l === _e())
|
|
2431
|
+
break;
|
|
2432
|
+
l = Ne(l, !1);
|
|
2433
|
+
}
|
|
2434
|
+
return !1;
|
|
2435
|
+
}
|
|
2436
|
+
function Ye(e, a, t, l) {
|
|
2437
|
+
for (var o = 0, r = 0, n = e.children; r < n.length; ) {
|
|
2438
|
+
if (n[r].style.display !== "none" && n[r] !== S.ghost && (l || n[r] !== S.dragged) && he(n[r], t.draggable, e, !1)) {
|
|
2439
|
+
if (o === a)
|
|
2440
|
+
return n[r];
|
|
2441
|
+
o++;
|
|
2442
|
+
}
|
|
2443
|
+
r++;
|
|
2444
|
+
}
|
|
2445
|
+
return null;
|
|
2446
|
+
}
|
|
2447
|
+
function Bt(e, a) {
|
|
2448
|
+
for (var t = e.lastElementChild; t && (t === S.ghost || F(t, "display") === "none" || a && !ct(t, a)); )
|
|
2449
|
+
t = t.previousElementSibling;
|
|
2450
|
+
return t || null;
|
|
2451
|
+
}
|
|
2452
|
+
function ge(e, a) {
|
|
2453
|
+
var t = 0;
|
|
2454
|
+
if (!e || !e.parentNode)
|
|
2455
|
+
return -1;
|
|
2456
|
+
for (; e = e.previousElementSibling; )
|
|
2457
|
+
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== S.clone && (!a || ct(e, a)) && t++;
|
|
2458
|
+
return t;
|
|
2459
|
+
}
|
|
2460
|
+
function Zt(e) {
|
|
2461
|
+
var a = 0, t = 0, l = _e();
|
|
2462
|
+
if (e)
|
|
2463
|
+
do {
|
|
2464
|
+
var o = Ge(e), r = o.a, n = o.d;
|
|
2465
|
+
a += e.scrollLeft * r, t += e.scrollTop * n;
|
|
2466
|
+
} while (e !== l && (e = e.parentNode));
|
|
2467
|
+
return [a, t];
|
|
2468
|
+
}
|
|
2469
|
+
function Cl(e, a) {
|
|
2470
|
+
for (var t in e)
|
|
2471
|
+
if (e.hasOwnProperty(t)) {
|
|
2472
|
+
for (var l in a)
|
|
2473
|
+
if (a.hasOwnProperty(l) && a[l] === e[t][l])
|
|
2474
|
+
return Number(t);
|
|
2475
|
+
}
|
|
2476
|
+
return -1;
|
|
2477
|
+
}
|
|
2478
|
+
function Ne(e, a) {
|
|
2479
|
+
if (!e || !e.getBoundingClientRect)
|
|
2480
|
+
return _e();
|
|
2481
|
+
var t = e, l = !1;
|
|
2482
|
+
do
|
|
2483
|
+
if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
|
|
2484
|
+
var o = F(t);
|
|
2485
|
+
if (t.clientWidth < t.scrollWidth && (o.overflowX == "auto" || o.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (o.overflowY == "auto" || o.overflowY == "scroll")) {
|
|
2486
|
+
if (!t.getBoundingClientRect || t === document.body)
|
|
2487
|
+
return _e();
|
|
2488
|
+
if (l || a)
|
|
2489
|
+
return t;
|
|
2490
|
+
l = !0;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
while (t = t.parentNode);
|
|
2494
|
+
return _e();
|
|
2495
|
+
}
|
|
2496
|
+
function Fl(e, a) {
|
|
2497
|
+
if (e && a)
|
|
2498
|
+
for (var t in a)
|
|
2499
|
+
a.hasOwnProperty(t) && (e[t] = a[t]);
|
|
2500
|
+
return e;
|
|
2501
|
+
}
|
|
2502
|
+
function xt(e, a) {
|
|
2503
|
+
return Math.round(e.top) === Math.round(a.top) && Math.round(e.left) === Math.round(a.left) && Math.round(e.height) === Math.round(a.height) && Math.round(e.width) === Math.round(a.width);
|
|
2504
|
+
}
|
|
2505
|
+
var Xe;
|
|
2506
|
+
function ya(e, a) {
|
|
2507
|
+
return function() {
|
|
2508
|
+
if (!Xe) {
|
|
2509
|
+
var t = arguments, l = this;
|
|
2510
|
+
t.length === 1 ? e.call(l, t[0]) : e.apply(l, t), Xe = setTimeout(function() {
|
|
2511
|
+
Xe = void 0;
|
|
2512
|
+
}, a);
|
|
2513
|
+
}
|
|
2514
|
+
};
|
|
2515
|
+
}
|
|
2516
|
+
function Sl() {
|
|
2517
|
+
clearTimeout(Xe), Xe = void 0;
|
|
2518
|
+
}
|
|
2519
|
+
function ha(e, a, t) {
|
|
2520
|
+
e.scrollLeft += a, e.scrollTop += t;
|
|
2521
|
+
}
|
|
2522
|
+
function ba(e) {
|
|
2523
|
+
var a = window.Polymer, t = window.jQuery || window.Zepto;
|
|
2524
|
+
return a && a.dom ? a.dom(e).cloneNode(!0) : t ? t(e).clone(!0)[0] : e.cloneNode(!0);
|
|
2525
|
+
}
|
|
2526
|
+
function _a(e, a, t) {
|
|
2527
|
+
var l = {};
|
|
2528
|
+
return Array.from(e.children).forEach(function(o) {
|
|
2529
|
+
var r, n, p, s;
|
|
2530
|
+
if (!(!he(o, a.draggable, e, !1) || o.animated || o === t)) {
|
|
2531
|
+
var f = te(o);
|
|
2532
|
+
l.left = Math.min((r = l.left) !== null && r !== void 0 ? r : 1 / 0, f.left), l.top = Math.min((n = l.top) !== null && n !== void 0 ? n : 1 / 0, f.top), l.right = Math.max((p = l.right) !== null && p !== void 0 ? p : -1 / 0, f.right), l.bottom = Math.max((s = l.bottom) !== null && s !== void 0 ? s : -1 / 0, f.bottom);
|
|
2533
|
+
}
|
|
2534
|
+
}), l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l;
|
|
2535
|
+
}
|
|
2536
|
+
var ve = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
2537
|
+
function Nl() {
|
|
2538
|
+
var e = [], a;
|
|
2539
|
+
return {
|
|
2540
|
+
captureAnimationState: function() {
|
|
2541
|
+
if (e = [], !!this.options.animation) {
|
|
2542
|
+
var t = [].slice.call(this.el.children);
|
|
2543
|
+
t.forEach(function(l) {
|
|
2544
|
+
if (!(F(l, "display") === "none" || l === S.ghost)) {
|
|
2545
|
+
e.push({
|
|
2546
|
+
target: l,
|
|
2547
|
+
rect: te(l)
|
|
2548
|
+
});
|
|
2549
|
+
var o = we({}, e[e.length - 1].rect);
|
|
2550
|
+
if (l.thisAnimationDuration) {
|
|
2551
|
+
var r = Ge(l, !0);
|
|
2552
|
+
r && (o.top -= r.f, o.left -= r.e);
|
|
2553
|
+
}
|
|
2554
|
+
l.fromRect = o;
|
|
2555
|
+
}
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
},
|
|
2559
|
+
addAnimationState: function(t) {
|
|
2560
|
+
e.push(t);
|
|
2561
|
+
},
|
|
2562
|
+
removeAnimationState: function(t) {
|
|
2563
|
+
e.splice(Cl(e, {
|
|
2564
|
+
target: t
|
|
2565
|
+
}), 1);
|
|
2566
|
+
},
|
|
2567
|
+
animateAll: function(t) {
|
|
2568
|
+
var l = this;
|
|
2569
|
+
if (!this.options.animation) {
|
|
2570
|
+
clearTimeout(a), typeof t == "function" && t();
|
|
2571
|
+
return;
|
|
2572
|
+
}
|
|
2573
|
+
var o = !1, r = 0;
|
|
2574
|
+
e.forEach(function(n) {
|
|
2575
|
+
var p = 0, s = n.target, f = s.fromRect, d = te(s), m = s.prevFromRect, i = s.prevToRect, u = n.rect, v = Ge(s, !0);
|
|
2576
|
+
v && (d.top -= v.f, d.left -= v.e), s.toRect = d, s.thisAnimationDuration && xt(m, d) && !xt(f, d) && // Make sure animatingRect is on line between toRect & fromRect
|
|
2577
|
+
(u.top - d.top) / (u.left - d.left) === (f.top - d.top) / (f.left - d.left) && (p = Dl(u, m, i, l.options)), xt(d, f) || (s.prevFromRect = f, s.prevToRect = d, p || (p = l.options.animation), l.animate(s, u, d, p)), p && (o = !0, r = Math.max(r, p), clearTimeout(s.animationResetTimer), s.animationResetTimer = setTimeout(function() {
|
|
2578
|
+
s.animationTime = 0, s.prevFromRect = null, s.fromRect = null, s.prevToRect = null, s.thisAnimationDuration = null;
|
|
2579
|
+
}, p), s.thisAnimationDuration = p);
|
|
2580
|
+
}), clearTimeout(a), o ? a = setTimeout(function() {
|
|
2581
|
+
typeof t == "function" && t();
|
|
2582
|
+
}, r) : typeof t == "function" && t(), e = [];
|
|
2583
|
+
},
|
|
2584
|
+
animate: function(t, l, o, r) {
|
|
2585
|
+
if (r) {
|
|
2586
|
+
F(t, "transition", ""), F(t, "transform", "");
|
|
2587
|
+
var n = Ge(this.el), p = n && n.a, s = n && n.d, f = (l.left - o.left) / (p || 1), d = (l.top - o.top) / (s || 1);
|
|
2588
|
+
t.animatingX = !!f, t.animatingY = !!d, F(t, "transform", "translate3d(" + f + "px," + d + "px,0)"), this.forRepaintDummy = kl(t), F(t, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), F(t, "transform", "translate3d(0,0,0)"), typeof t.animated == "number" && clearTimeout(t.animated), t.animated = setTimeout(function() {
|
|
2589
|
+
F(t, "transition", ""), F(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1;
|
|
2590
|
+
}, r);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
};
|
|
2594
|
+
}
|
|
2595
|
+
function kl(e) {
|
|
2596
|
+
return e.offsetWidth;
|
|
2597
|
+
}
|
|
2598
|
+
function Dl(e, a, t, l) {
|
|
2599
|
+
return Math.sqrt(Math.pow(a.top - e.top, 2) + Math.pow(a.left - e.left, 2)) / Math.sqrt(Math.pow(a.top - t.top, 2) + Math.pow(a.left - t.left, 2)) * l.animation;
|
|
2600
|
+
}
|
|
2601
|
+
var Me = [], Ct = {
|
|
2602
|
+
initializeByDefault: !0
|
|
2603
|
+
}, Je = {
|
|
2604
|
+
mount: function(e) {
|
|
2605
|
+
for (var a in Ct)
|
|
2606
|
+
Ct.hasOwnProperty(a) && !(a in e) && (e[a] = Ct[a]);
|
|
2607
|
+
Me.forEach(function(t) {
|
|
2608
|
+
if (t.pluginName === e.pluginName)
|
|
2609
|
+
throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
|
|
2610
|
+
}), Me.push(e);
|
|
2611
|
+
},
|
|
2612
|
+
pluginEvent: function(e, a, t) {
|
|
2613
|
+
var l = this;
|
|
2614
|
+
this.eventCanceled = !1, t.cancel = function() {
|
|
2615
|
+
l.eventCanceled = !0;
|
|
2616
|
+
};
|
|
2617
|
+
var o = e + "Global";
|
|
2618
|
+
Me.forEach(function(r) {
|
|
2619
|
+
a[r.pluginName] && (a[r.pluginName][o] && a[r.pluginName][o](we({
|
|
2620
|
+
sortable: a
|
|
2621
|
+
}, t)), a.options[r.pluginName] && a[r.pluginName][e] && a[r.pluginName][e](we({
|
|
2622
|
+
sortable: a
|
|
2623
|
+
}, t)));
|
|
2624
|
+
});
|
|
2625
|
+
},
|
|
2626
|
+
initializePlugins: function(e, a, t, l) {
|
|
2627
|
+
Me.forEach(function(n) {
|
|
2628
|
+
var p = n.pluginName;
|
|
2629
|
+
if (!(!e.options[p] && !n.initializeByDefault)) {
|
|
2630
|
+
var s = new n(e, a, e.options);
|
|
2631
|
+
s.sortable = e, s.options = e.options, e[p] = s, Ie(t, s.defaults);
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
for (var o in e.options)
|
|
2635
|
+
if (e.options.hasOwnProperty(o)) {
|
|
2636
|
+
var r = this.modifyOption(e, o, e.options[o]);
|
|
2637
|
+
typeof r < "u" && (e.options[o] = r);
|
|
2638
|
+
}
|
|
2639
|
+
},
|
|
2640
|
+
getEventProperties: function(e, a) {
|
|
2641
|
+
var t = {};
|
|
2642
|
+
return Me.forEach(function(l) {
|
|
2643
|
+
typeof l.eventProperties == "function" && Ie(t, l.eventProperties.call(a[l.pluginName], e));
|
|
2644
|
+
}), t;
|
|
2645
|
+
},
|
|
2646
|
+
modifyOption: function(e, a, t) {
|
|
2647
|
+
var l;
|
|
2648
|
+
return Me.forEach(function(o) {
|
|
2649
|
+
e[o.pluginName] && o.optionListeners && typeof o.optionListeners[a] == "function" && (l = o.optionListeners[a].call(e[o.pluginName], t));
|
|
2650
|
+
}), l;
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
function El(e) {
|
|
2654
|
+
var a = e.sortable, t = e.rootEl, l = e.name, o = e.targetEl, r = e.cloneEl, n = e.toEl, p = e.fromEl, s = e.oldIndex, f = e.newIndex, d = e.oldDraggableIndex, m = e.newDraggableIndex, i = e.originalEvent, u = e.putSortable, v = e.extraEventProperties;
|
|
2655
|
+
if (a = a || t && t[ve], !!a) {
|
|
2656
|
+
var g, k = a.options, c = "on" + l.charAt(0).toUpperCase() + l.substr(1);
|
|
2657
|
+
window.CustomEvent && !xe && !Qe ? g = new CustomEvent(l, {
|
|
2658
|
+
bubbles: !0,
|
|
2659
|
+
cancelable: !0
|
|
2660
|
+
}) : (g = document.createEvent("Event"), g.initEvent(l, !0, !0)), g.to = n || t, g.from = p || t, g.item = o || t, g.clone = r, g.oldIndex = s, g.newIndex = f, g.oldDraggableIndex = d, g.newDraggableIndex = m, g.originalEvent = i, g.pullMode = u ? u.lastPutMode : void 0;
|
|
2661
|
+
var w = we(we({}, v), Je.getEventProperties(l, a));
|
|
2662
|
+
for (var A in w)
|
|
2663
|
+
g[A] = w[A];
|
|
2664
|
+
t && t.dispatchEvent(g), k[c] && k[c].call(a, g);
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
var Vl = ["evt"], de = function(e, a) {
|
|
2668
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, l = t.evt, o = Tl(t, Vl);
|
|
2669
|
+
Je.pluginEvent.bind(S)(e, a, we({
|
|
2670
|
+
dragEl: h,
|
|
2671
|
+
parentEl: K,
|
|
2672
|
+
ghostEl: D,
|
|
2673
|
+
rootEl: L,
|
|
2674
|
+
nextEl: Ee,
|
|
2675
|
+
lastDownEl: ot,
|
|
2676
|
+
cloneEl: j,
|
|
2677
|
+
cloneHidden: Se,
|
|
2678
|
+
dragStarted: Le,
|
|
2679
|
+
putSortable: le,
|
|
2680
|
+
activeSortable: S.active,
|
|
2681
|
+
originalEvent: l,
|
|
2682
|
+
oldIndex: Be,
|
|
2683
|
+
oldDraggableIndex: Ke,
|
|
2684
|
+
newIndex: fe,
|
|
2685
|
+
newDraggableIndex: Fe,
|
|
2686
|
+
hideGhostForTarget: xa,
|
|
2687
|
+
unhideGhostForTarget: Ca,
|
|
2688
|
+
cloneNowHidden: function() {
|
|
2689
|
+
Se = !0;
|
|
2690
|
+
},
|
|
2691
|
+
cloneNowShown: function() {
|
|
2692
|
+
Se = !1;
|
|
2693
|
+
},
|
|
2694
|
+
dispatchSortableEvent: function(r) {
|
|
2695
|
+
ue({
|
|
2696
|
+
sortable: a,
|
|
2697
|
+
name: r,
|
|
2698
|
+
originalEvent: l
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
}, o));
|
|
2702
|
+
};
|
|
2703
|
+
function ue(e) {
|
|
2704
|
+
El(we({
|
|
2705
|
+
putSortable: le,
|
|
2706
|
+
cloneEl: j,
|
|
2707
|
+
targetEl: h,
|
|
2708
|
+
rootEl: L,
|
|
2709
|
+
oldIndex: Be,
|
|
2710
|
+
oldDraggableIndex: Ke,
|
|
2711
|
+
newIndex: fe,
|
|
2712
|
+
newDraggableIndex: Fe
|
|
2713
|
+
}, e));
|
|
2714
|
+
}
|
|
2715
|
+
var h, K, D, L, Ee, ot, j, Se, Be, fe, Ke, Fe, Ze, le, Ae = !1, dt = !1, pt = [], ke, ye, Ft, St, ea, ta, Le, Pe, ze, We = !1, et = !1, rt, se, Nt = [], Ot = !1, mt = [], wt = typeof document < "u", tt = ma, aa = Qe || xe ? "cssFloat" : "float", Ol = wt && !fa && !ma && "draggable" in document.createElement("div"), wa = function() {
|
|
2716
|
+
if (wt) {
|
|
2717
|
+
if (xe)
|
|
2718
|
+
return !1;
|
|
2719
|
+
var e = document.createElement("x");
|
|
2720
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
2721
|
+
}
|
|
2722
|
+
}(), Ta = function(e, a) {
|
|
2723
|
+
var t = F(e), l = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), o = Ye(e, 0, a), r = Ye(e, 1, a), n = o && F(o), p = r && F(r), s = n && parseInt(n.marginLeft) + parseInt(n.marginRight) + te(o).width, f = p && parseInt(p.marginLeft) + parseInt(p.marginRight) + te(r).width;
|
|
2724
|
+
if (t.display === "flex")
|
|
2725
|
+
return t.flexDirection === "column" || t.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
2726
|
+
if (t.display === "grid")
|
|
2727
|
+
return t.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
2728
|
+
if (o && n.float && n.float !== "none") {
|
|
2729
|
+
var d = n.float === "left" ? "left" : "right";
|
|
2730
|
+
return r && (p.clear === "both" || p.clear === d) ? "vertical" : "horizontal";
|
|
2731
|
+
}
|
|
2732
|
+
return o && (n.display === "block" || n.display === "flex" || n.display === "table" || n.display === "grid" || s >= l && t[aa] === "none" || r && t[aa] === "none" && s + f > l) ? "vertical" : "horizontal";
|
|
2733
|
+
}, Ul = function(e, a, t) {
|
|
2734
|
+
var l = t ? e.left : e.top, o = t ? e.right : e.bottom, r = t ? e.width : e.height, n = t ? a.left : a.top, p = t ? a.right : a.bottom, s = t ? a.width : a.height;
|
|
2735
|
+
return l === n || o === p || l + r / 2 === n + s / 2;
|
|
2736
|
+
}, Ml = function(e, a) {
|
|
2737
|
+
var t;
|
|
2738
|
+
return pt.some(function(l) {
|
|
2739
|
+
var o = l[ve].options.emptyInsertThreshold;
|
|
2740
|
+
if (!(!o || Bt(l))) {
|
|
2741
|
+
var r = te(l), n = e >= r.left - o && e <= r.right + o, p = a >= r.top - o && a <= r.bottom + o;
|
|
2742
|
+
if (n && p)
|
|
2743
|
+
return t = l;
|
|
2744
|
+
}
|
|
2745
|
+
}), t;
|
|
2746
|
+
}, Ia = function(e) {
|
|
2747
|
+
function a(o, r) {
|
|
2748
|
+
return function(n, p, s, f) {
|
|
2749
|
+
var d = n.options.group.name && p.options.group.name && n.options.group.name === p.options.group.name;
|
|
2750
|
+
if (o == null && (r || d))
|
|
2751
|
+
return !0;
|
|
2752
|
+
if (o == null || o === !1)
|
|
2753
|
+
return !1;
|
|
2754
|
+
if (r && o === "clone")
|
|
2755
|
+
return o;
|
|
2756
|
+
if (typeof o == "function")
|
|
2757
|
+
return a(o(n, p, s, f), r)(n, p, s, f);
|
|
2758
|
+
var m = (r ? n : p).options.group.name;
|
|
2759
|
+
return o === !0 || typeof o == "string" && o === m || o.join && o.indexOf(m) > -1;
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
var t = {}, l = e.group;
|
|
2763
|
+
(!l || lt(l) != "object") && (l = {
|
|
2764
|
+
name: l
|
|
2765
|
+
}), t.name = l.name, t.checkPull = a(l.pull, !0), t.checkPut = a(l.put), t.revertClone = l.revertClone, e.group = t;
|
|
2766
|
+
}, xa = function() {
|
|
2767
|
+
!wa && D && F(D, "display", "none");
|
|
2768
|
+
}, Ca = function() {
|
|
2769
|
+
!wa && D && F(D, "display", "");
|
|
2770
|
+
};
|
|
2771
|
+
wt && !fa && document.addEventListener("click", function(e) {
|
|
2772
|
+
if (dt)
|
|
2773
|
+
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), dt = !1, !1;
|
|
2774
|
+
}, !0);
|
|
2775
|
+
var De = function(e) {
|
|
2776
|
+
if (h) {
|
|
2777
|
+
e = e.touches ? e.touches[0] : e;
|
|
2778
|
+
var a = Ml(e.clientX, e.clientY);
|
|
2779
|
+
if (a) {
|
|
2780
|
+
var t = {};
|
|
2781
|
+
for (var l in e)
|
|
2782
|
+
e.hasOwnProperty(l) && (t[l] = e[l]);
|
|
2783
|
+
t.target = t.rootEl = a, t.preventDefault = void 0, t.stopPropagation = void 0, a[ve]._onDragOver(t);
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
}, Pl = function(e) {
|
|
2787
|
+
h && h.parentNode[ve]._isOutsideThisEl(e.target);
|
|
2788
|
+
};
|
|
2789
|
+
function S(e, a) {
|
|
2790
|
+
if (!(e && e.nodeType && e.nodeType === 1))
|
|
2791
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
|
|
2792
|
+
this.el = e, this.options = a = Ie({}, a), e[ve] = this;
|
|
2793
|
+
var t = {
|
|
2794
|
+
group: null,
|
|
2795
|
+
sort: !0,
|
|
2796
|
+
disabled: !1,
|
|
2797
|
+
store: null,
|
|
2798
|
+
handle: null,
|
|
2799
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
2800
|
+
swapThreshold: 1,
|
|
2801
|
+
// percentage; 0 <= x <= 1
|
|
2802
|
+
invertSwap: !1,
|
|
2803
|
+
// invert always
|
|
2804
|
+
invertedSwapThreshold: null,
|
|
2805
|
+
// will be set to same as swapThreshold if default
|
|
2806
|
+
removeCloneOnHide: !0,
|
|
2807
|
+
direction: function() {
|
|
2808
|
+
return Ta(e, this.options);
|
|
2809
|
+
},
|
|
2810
|
+
ghostClass: "sortable-ghost",
|
|
2811
|
+
chosenClass: "sortable-chosen",
|
|
2812
|
+
dragClass: "sortable-drag",
|
|
2813
|
+
ignore: "a, img",
|
|
2814
|
+
filter: null,
|
|
2815
|
+
preventOnFilter: !0,
|
|
2816
|
+
animation: 0,
|
|
2817
|
+
easing: null,
|
|
2818
|
+
setData: function(r, n) {
|
|
2819
|
+
r.setData("Text", n.textContent);
|
|
2820
|
+
},
|
|
2821
|
+
dropBubble: !1,
|
|
2822
|
+
dragoverBubble: !1,
|
|
2823
|
+
dataIdAttr: "data-id",
|
|
2824
|
+
delay: 0,
|
|
2825
|
+
delayOnTouchOnly: !1,
|
|
2826
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
2827
|
+
forceFallback: !1,
|
|
2828
|
+
fallbackClass: "sortable-fallback",
|
|
2829
|
+
fallbackOnBody: !1,
|
|
2830
|
+
fallbackTolerance: 0,
|
|
2831
|
+
fallbackOffset: {
|
|
2832
|
+
x: 0,
|
|
2833
|
+
y: 0
|
|
2834
|
+
},
|
|
2835
|
+
supportPointer: S.supportPointer !== !1 && "PointerEvent" in window && !He,
|
|
2836
|
+
emptyInsertThreshold: 5
|
|
2837
|
+
};
|
|
2838
|
+
Je.initializePlugins(this, e, t);
|
|
2839
|
+
for (var l in t)
|
|
2840
|
+
!(l in a) && (a[l] = t[l]);
|
|
2841
|
+
Ia(a);
|
|
2842
|
+
for (var o in this)
|
|
2843
|
+
o.charAt(0) === "_" && typeof this[o] == "function" && (this[o] = this[o].bind(this));
|
|
2844
|
+
this.nativeDraggable = a.forceFallback ? !1 : Ol, this.nativeDraggable && (this.options.touchStartThreshold = 1), a.supportPointer ? M(e, "pointerdown", this._onTapStart) : (M(e, "mousedown", this._onTapStart), M(e, "touchstart", this._onTapStart)), this.nativeDraggable && (M(e, "dragover", this), M(e, "dragenter", this)), pt.push(this.el), a.store && a.store.get && this.sort(a.store.get(this) || []), Ie(this, Nl());
|
|
2845
|
+
}
|
|
2846
|
+
S.prototype = /** @lends Sortable.prototype */
|
|
2847
|
+
{
|
|
2848
|
+
constructor: S,
|
|
2849
|
+
_isOutsideThisEl: function(e) {
|
|
2850
|
+
!this.el.contains(e) && e !== this.el && (Pe = null);
|
|
2851
|
+
},
|
|
2852
|
+
_getDirection: function(e, a) {
|
|
2853
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, a, h) : this.options.direction;
|
|
2854
|
+
},
|
|
2855
|
+
_onTapStart: function(e) {
|
|
2856
|
+
if (e.cancelable) {
|
|
2857
|
+
var a = this, t = this.el, l = this.options, o = l.preventOnFilter, r = e.type, n = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, p = (n || e).target, s = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || p, f = l.filter;
|
|
2858
|
+
if ($l(t), !h && !(/mousedown|pointerdown/.test(r) && e.button !== 0 || l.disabled) && !s.isContentEditable && !(!this.nativeDraggable && He && p && p.tagName.toUpperCase() === "SELECT") && (p = he(p, l.draggable, t, !1), !(p && p.animated) && ot !== p)) {
|
|
2859
|
+
if (Be = ge(p), Ke = ge(p, l.draggable), typeof f == "function") {
|
|
2860
|
+
if (f.call(this, e, p, this)) {
|
|
2861
|
+
ue({
|
|
2862
|
+
sortable: a,
|
|
2863
|
+
rootEl: s,
|
|
2864
|
+
name: "filter",
|
|
2865
|
+
targetEl: p,
|
|
2866
|
+
toEl: t,
|
|
2867
|
+
fromEl: t
|
|
2868
|
+
}), de("filter", a, {
|
|
2869
|
+
evt: e
|
|
2870
|
+
}), o && e.cancelable && e.preventDefault();
|
|
2871
|
+
return;
|
|
2872
|
+
}
|
|
2873
|
+
} else if (f && (f = f.split(",").some(function(d) {
|
|
2874
|
+
if (d = he(s, d.trim(), t, !1), d)
|
|
2875
|
+
return ue({
|
|
2876
|
+
sortable: a,
|
|
2877
|
+
rootEl: d,
|
|
2878
|
+
name: "filter",
|
|
2879
|
+
targetEl: p,
|
|
2880
|
+
fromEl: t,
|
|
2881
|
+
toEl: t
|
|
2882
|
+
}), de("filter", a, {
|
|
2883
|
+
evt: e
|
|
2884
|
+
}), !0;
|
|
2885
|
+
}), f)) {
|
|
2886
|
+
o && e.cancelable && e.preventDefault();
|
|
2887
|
+
return;
|
|
2888
|
+
}
|
|
2889
|
+
l.handle && !he(s, l.handle, t, !1) || this._prepareDragStart(e, n, p);
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
},
|
|
2893
|
+
_prepareDragStart: function(e, a, t) {
|
|
2894
|
+
var l = this, o = l.el, r = l.options, n = o.ownerDocument, p;
|
|
2895
|
+
if (t && !h && t.parentNode === o) {
|
|
2896
|
+
var s = te(t);
|
|
2897
|
+
if (L = o, h = t, K = h.parentNode, Ee = h.nextSibling, ot = t, Ze = r.group, S.dragged = h, ke = {
|
|
2898
|
+
target: h,
|
|
2899
|
+
clientX: (a || e).clientX,
|
|
2900
|
+
clientY: (a || e).clientY
|
|
2901
|
+
}, ea = ke.clientX - s.left, ta = ke.clientY - s.top, this._lastX = (a || e).clientX, this._lastY = (a || e).clientY, h.style["will-change"] = "all", p = function() {
|
|
2902
|
+
if (de("delayEnded", l, {
|
|
2903
|
+
evt: e
|
|
2904
|
+
}), S.eventCanceled) {
|
|
2905
|
+
l._onDrop();
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
l._disableDelayedDragEvents(), !Wt && l.nativeDraggable && (h.draggable = !0), l._triggerDragStart(e, a), ue({
|
|
2909
|
+
sortable: l,
|
|
2910
|
+
name: "choose",
|
|
2911
|
+
originalEvent: e
|
|
2912
|
+
}), me(h, r.chosenClass, !0);
|
|
2913
|
+
}, r.ignore.split(",").forEach(function(f) {
|
|
2914
|
+
ga(h, f.trim(), kt);
|
|
2915
|
+
}), M(n, "dragover", De), M(n, "mousemove", De), M(n, "touchmove", De), M(n, "mouseup", l._onDrop), M(n, "touchend", l._onDrop), M(n, "touchcancel", l._onDrop), Wt && this.nativeDraggable && (this.options.touchStartThreshold = 4, h.draggable = !0), de("delayStart", this, {
|
|
2916
|
+
evt: e
|
|
2917
|
+
}), r.delay && (!r.delayOnTouchOnly || a) && (!this.nativeDraggable || !(Qe || xe))) {
|
|
2918
|
+
if (S.eventCanceled) {
|
|
2919
|
+
this._onDrop();
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2922
|
+
M(n, "mouseup", l._disableDelayedDrag), M(n, "touchend", l._disableDelayedDrag), M(n, "touchcancel", l._disableDelayedDrag), M(n, "mousemove", l._delayedDragTouchMoveHandler), M(n, "touchmove", l._delayedDragTouchMoveHandler), r.supportPointer && M(n, "pointermove", l._delayedDragTouchMoveHandler), l._dragStartTimer = setTimeout(p, r.delay);
|
|
2923
|
+
} else
|
|
2924
|
+
p();
|
|
2925
|
+
}
|
|
2926
|
+
},
|
|
2927
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
2928
|
+
var a = e.touches ? e.touches[0] : e;
|
|
2929
|
+
Math.max(Math.abs(a.clientX - this._lastX), Math.abs(a.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
2930
|
+
},
|
|
2931
|
+
_disableDelayedDrag: function() {
|
|
2932
|
+
h && kt(h), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
2933
|
+
},
|
|
2934
|
+
_disableDelayedDragEvents: function() {
|
|
2935
|
+
var e = this.el.ownerDocument;
|
|
2936
|
+
O(e, "mouseup", this._disableDelayedDrag), O(e, "touchend", this._disableDelayedDrag), O(e, "touchcancel", this._disableDelayedDrag), O(e, "mousemove", this._delayedDragTouchMoveHandler), O(e, "touchmove", this._delayedDragTouchMoveHandler), O(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
2937
|
+
},
|
|
2938
|
+
_triggerDragStart: function(e, a) {
|
|
2939
|
+
a = a || e.pointerType == "touch" && e, !this.nativeDraggable || a ? this.options.supportPointer ? M(document, "pointermove", this._onTouchMove) : a ? M(document, "touchmove", this._onTouchMove) : M(document, "mousemove", this._onTouchMove) : (M(h, "dragend", this), M(L, "dragstart", this._onDragStart));
|
|
2940
|
+
try {
|
|
2941
|
+
document.selection ? it(function() {
|
|
2942
|
+
document.selection.empty();
|
|
2943
|
+
}) : window.getSelection().removeAllRanges();
|
|
2944
|
+
} catch {
|
|
2945
|
+
}
|
|
2946
|
+
},
|
|
2947
|
+
_dragStarted: function(e, a) {
|
|
2948
|
+
if (Ae = !1, L && h) {
|
|
2949
|
+
de("dragStarted", this, {
|
|
2950
|
+
evt: a
|
|
2951
|
+
}), this.nativeDraggable && M(document, "dragover", Pl);
|
|
2952
|
+
var t = this.options;
|
|
2953
|
+
!e && me(h, t.dragClass, !1), me(h, t.ghostClass, !0), S.active = this, e && this._appendGhost(), ue({
|
|
2954
|
+
sortable: this,
|
|
2955
|
+
name: "start",
|
|
2956
|
+
originalEvent: a
|
|
2957
|
+
});
|
|
2958
|
+
} else
|
|
2959
|
+
this._nulling();
|
|
2960
|
+
},
|
|
2961
|
+
_emulateDragOver: function() {
|
|
2962
|
+
if (ye) {
|
|
2963
|
+
this._lastX = ye.clientX, this._lastY = ye.clientY, xa();
|
|
2964
|
+
for (var e = document.elementFromPoint(ye.clientX, ye.clientY), a = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(ye.clientX, ye.clientY), e !== a); )
|
|
2965
|
+
a = e;
|
|
2966
|
+
if (h.parentNode[ve]._isOutsideThisEl(e), a)
|
|
2967
|
+
do {
|
|
2968
|
+
if (a[ve]) {
|
|
2969
|
+
var t = void 0;
|
|
2970
|
+
if (t = a[ve]._onDragOver({
|
|
2971
|
+
clientX: ye.clientX,
|
|
2972
|
+
clientY: ye.clientY,
|
|
2973
|
+
target: e,
|
|
2974
|
+
rootEl: a
|
|
2975
|
+
}), t && !this.options.dragoverBubble)
|
|
2976
|
+
break;
|
|
2977
|
+
}
|
|
2978
|
+
e = a;
|
|
2979
|
+
} while (a = a.parentNode);
|
|
2980
|
+
Ca();
|
|
2981
|
+
}
|
|
2982
|
+
},
|
|
2983
|
+
_onTouchMove: function(e) {
|
|
2984
|
+
if (ke) {
|
|
2985
|
+
var a = this.options, t = a.fallbackTolerance, l = a.fallbackOffset, o = e.touches ? e.touches[0] : e, r = D && Ge(D, !0), n = D && r && r.a, p = D && r && r.d, s = tt && se && Zt(se), f = (o.clientX - ke.clientX + l.x) / (n || 1) + (s ? s[0] - Nt[0] : 0) / (n || 1), d = (o.clientY - ke.clientY + l.y) / (p || 1) + (s ? s[1] - Nt[1] : 0) / (p || 1);
|
|
2986
|
+
if (!S.active && !Ae) {
|
|
2987
|
+
if (t && Math.max(Math.abs(o.clientX - this._lastX), Math.abs(o.clientY - this._lastY)) < t)
|
|
2988
|
+
return;
|
|
2989
|
+
this._onDragStart(e, !0);
|
|
2990
|
+
}
|
|
2991
|
+
if (D) {
|
|
2992
|
+
r ? (r.e += f - (Ft || 0), r.f += d - (St || 0)) : r = {
|
|
2993
|
+
a: 1,
|
|
2994
|
+
b: 0,
|
|
2995
|
+
c: 0,
|
|
2996
|
+
d: 1,
|
|
2997
|
+
e: f,
|
|
2998
|
+
f: d
|
|
2999
|
+
};
|
|
3000
|
+
var m = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")");
|
|
3001
|
+
F(D, "webkitTransform", m), F(D, "mozTransform", m), F(D, "msTransform", m), F(D, "transform", m), Ft = f, St = d, ye = o;
|
|
3002
|
+
}
|
|
3003
|
+
e.cancelable && e.preventDefault();
|
|
3004
|
+
}
|
|
3005
|
+
},
|
|
3006
|
+
_appendGhost: function() {
|
|
3007
|
+
if (!D) {
|
|
3008
|
+
var e = this.options.fallbackOnBody ? document.body : L, a = te(h, !0, tt, !0, e), t = this.options;
|
|
3009
|
+
if (tt) {
|
|
3010
|
+
for (se = e; F(se, "position") === "static" && F(se, "transform") === "none" && se !== document; )
|
|
3011
|
+
se = se.parentNode;
|
|
3012
|
+
se !== document.body && se !== document.documentElement ? (se === document && (se = _e()), a.top += se.scrollTop, a.left += se.scrollLeft) : se = _e(), Nt = Zt(se);
|
|
3013
|
+
}
|
|
3014
|
+
D = h.cloneNode(!0), me(D, t.ghostClass, !1), me(D, t.fallbackClass, !0), me(D, t.dragClass, !0), F(D, "transition", ""), F(D, "transform", ""), F(D, "box-sizing", "border-box"), F(D, "margin", 0), F(D, "top", a.top), F(D, "left", a.left), F(D, "width", a.width), F(D, "height", a.height), F(D, "opacity", "0.8"), F(D, "position", tt ? "absolute" : "fixed"), F(D, "zIndex", "100000"), F(D, "pointerEvents", "none"), S.ghost = D, e.appendChild(D), F(D, "transform-origin", ea / parseInt(D.style.width) * 100 + "% " + ta / parseInt(D.style.height) * 100 + "%");
|
|
3015
|
+
}
|
|
3016
|
+
},
|
|
3017
|
+
_onDragStart: function(e, a) {
|
|
3018
|
+
var t = this, l = e.dataTransfer, o = t.options;
|
|
3019
|
+
if (de("dragStart", this, {
|
|
3020
|
+
evt: e
|
|
3021
|
+
}), S.eventCanceled) {
|
|
3022
|
+
this._onDrop();
|
|
3023
|
+
return;
|
|
3024
|
+
}
|
|
3025
|
+
de("setupClone", this), S.eventCanceled || (j = ba(h), j.removeAttribute("id"), j.draggable = !1, j.style["will-change"] = "", this._hideClone(), me(j, this.options.chosenClass, !1), S.clone = j), t.cloneId = it(function() {
|
|
3026
|
+
de("clone", t), !S.eventCanceled && (t.options.removeCloneOnHide || L.insertBefore(j, h), t._hideClone(), ue({
|
|
3027
|
+
sortable: t,
|
|
3028
|
+
name: "clone"
|
|
3029
|
+
}));
|
|
3030
|
+
}), !a && me(h, o.dragClass, !0), a ? (dt = !0, t._loopId = setInterval(t._emulateDragOver, 50)) : (O(document, "mouseup", t._onDrop), O(document, "touchend", t._onDrop), O(document, "touchcancel", t._onDrop), l && (l.effectAllowed = "move", o.setData && o.setData.call(t, l, h)), M(document, "drop", t), F(h, "transform", "translateZ(0)")), Ae = !0, t._dragStartId = it(t._dragStarted.bind(t, a, e)), M(document, "selectstart", t), Le = !0, He && F(document.body, "user-select", "none");
|
|
3031
|
+
},
|
|
3032
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
3033
|
+
_onDragOver: function(e) {
|
|
3034
|
+
var a = this.el, t = e.target, l, o, r, n = this.options, p = n.group, s = S.active, f = Ze === p, d = n.sort, m = le || s, i, u = this, v = !1;
|
|
3035
|
+
if (Ot)
|
|
3036
|
+
return;
|
|
3037
|
+
function g(z, Ce) {
|
|
3038
|
+
de(z, u, we({
|
|
3039
|
+
evt: e,
|
|
3040
|
+
isOwner: f,
|
|
3041
|
+
axis: i ? "vertical" : "horizontal",
|
|
3042
|
+
revert: r,
|
|
3043
|
+
dragRect: l,
|
|
3044
|
+
targetRect: o,
|
|
3045
|
+
canSort: d,
|
|
3046
|
+
fromSortable: m,
|
|
3047
|
+
target: t,
|
|
3048
|
+
completed: c,
|
|
3049
|
+
onMove: function(ie, Tt) {
|
|
3050
|
+
return at(L, a, h, l, ie, te(ie), e, Tt);
|
|
3051
|
+
},
|
|
3052
|
+
changed: w
|
|
3053
|
+
}, Ce));
|
|
3054
|
+
}
|
|
3055
|
+
function k() {
|
|
3056
|
+
g("dragOverAnimationCapture"), u.captureAnimationState(), u !== m && m.captureAnimationState();
|
|
3057
|
+
}
|
|
3058
|
+
function c(z) {
|
|
3059
|
+
return g("dragOverCompleted", {
|
|
3060
|
+
insertion: z
|
|
3061
|
+
}), z && (f ? s._hideClone() : s._showClone(u), u !== m && (me(h, le ? le.options.ghostClass : s.options.ghostClass, !1), me(h, n.ghostClass, !0)), le !== u && u !== S.active ? le = u : u === S.active && le && (le = null), m === u && (u._ignoreWhileAnimating = t), u.animateAll(function() {
|
|
3062
|
+
g("dragOverAnimationComplete"), u._ignoreWhileAnimating = null;
|
|
3063
|
+
}), u !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (t === h && !h.animated || t === a && !t.animated) && (Pe = null), !n.dragoverBubble && !e.rootEl && t !== document && (h.parentNode[ve]._isOutsideThisEl(e.target), !z && De(e)), !n.dragoverBubble && e.stopPropagation && e.stopPropagation(), v = !0;
|
|
3064
|
+
}
|
|
3065
|
+
function w() {
|
|
3066
|
+
fe = ge(h), Fe = ge(h, n.draggable), ue({
|
|
3067
|
+
sortable: u,
|
|
3068
|
+
name: "change",
|
|
3069
|
+
toEl: a,
|
|
3070
|
+
newIndex: fe,
|
|
3071
|
+
newDraggableIndex: Fe,
|
|
3072
|
+
originalEvent: e
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), t = he(t, n.draggable, a, !0), g("dragOver"), S.eventCanceled)
|
|
3076
|
+
return v;
|
|
3077
|
+
if (h.contains(e.target) || t.animated && t.animatingX && t.animatingY || u._ignoreWhileAnimating === t)
|
|
3078
|
+
return c(!1);
|
|
3079
|
+
if (dt = !1, s && !n.disabled && (f ? d || (r = K !== L) : le === this || (this.lastPutMode = Ze.checkPull(this, s, h, e)) && p.checkPut(this, s, h, e))) {
|
|
3080
|
+
if (i = this._getDirection(e, t) === "vertical", l = te(h), g("dragOverValid"), S.eventCanceled)
|
|
3081
|
+
return v;
|
|
3082
|
+
if (r)
|
|
3083
|
+
return K = L, k(), this._hideClone(), g("revert"), S.eventCanceled || (Ee ? L.insertBefore(h, Ee) : L.appendChild(h)), c(!0);
|
|
3084
|
+
var A = Bt(a, n.draggable);
|
|
3085
|
+
if (!A || Bl(e, i, this) && !A.animated) {
|
|
3086
|
+
if (A === h)
|
|
3087
|
+
return c(!1);
|
|
3088
|
+
if (A && a === e.target && (t = A), t && (o = te(t)), at(L, a, h, l, t, o, e, !!t) !== !1)
|
|
3089
|
+
return k(), A && A.nextSibling ? a.insertBefore(h, A.nextSibling) : a.appendChild(h), K = a, w(), c(!0);
|
|
3090
|
+
} else if (A && ql(e, i, this)) {
|
|
3091
|
+
var U = Ye(a, 0, n, !0);
|
|
3092
|
+
if (U === h)
|
|
3093
|
+
return c(!1);
|
|
3094
|
+
if (t = U, o = te(t), at(L, a, h, l, t, o, e, !1) !== !1)
|
|
3095
|
+
return k(), a.insertBefore(h, U), K = a, w(), c(!0);
|
|
3096
|
+
} else if (t.parentNode === a) {
|
|
3097
|
+
o = te(t);
|
|
3098
|
+
var q = 0, Q, B = h.parentNode !== a, pe = !Ul(h.animated && h.toRect || l, t.animated && t.toRect || o, i), J = i ? "top" : "left", C = Jt(t, "top", "top") || Jt(h, "top", "top"), x = C ? C.scrollTop : void 0;
|
|
3099
|
+
Pe !== t && (Q = o[J], We = !1, et = !pe && n.invertSwap || B), q = Gl(e, t, o, i, pe ? 1 : n.swapThreshold, n.invertedSwapThreshold == null ? n.swapThreshold : n.invertedSwapThreshold, et, Pe === t);
|
|
3100
|
+
var E;
|
|
3101
|
+
if (q !== 0) {
|
|
3102
|
+
var Z = ge(h);
|
|
3103
|
+
do
|
|
3104
|
+
Z -= q, E = K.children[Z];
|
|
3105
|
+
while (E && (F(E, "display") === "none" || E === D));
|
|
3106
|
+
}
|
|
3107
|
+
if (q === 0 || E === t)
|
|
3108
|
+
return c(!1);
|
|
3109
|
+
Pe = t, ze = q;
|
|
3110
|
+
var P = t.nextElementSibling, G = !1;
|
|
3111
|
+
G = q === 1;
|
|
3112
|
+
var X = at(L, a, h, l, t, o, e, G);
|
|
3113
|
+
if (X !== !1)
|
|
3114
|
+
return (X === 1 || X === -1) && (G = X === 1), Ot = !0, setTimeout(Rl, 30), k(), G && !P ? a.appendChild(h) : t.parentNode.insertBefore(h, G ? P : t), C && ha(C, 0, x - C.scrollTop), K = h.parentNode, Q !== void 0 && !et && (rt = Math.abs(Q - te(t)[J])), w(), c(!0);
|
|
3115
|
+
}
|
|
3116
|
+
if (a.contains(h))
|
|
3117
|
+
return c(!1);
|
|
3118
|
+
}
|
|
3119
|
+
return !1;
|
|
3120
|
+
},
|
|
3121
|
+
_ignoreWhileAnimating: null,
|
|
3122
|
+
_offMoveEvents: function() {
|
|
3123
|
+
O(document, "mousemove", this._onTouchMove), O(document, "touchmove", this._onTouchMove), O(document, "pointermove", this._onTouchMove), O(document, "dragover", De), O(document, "mousemove", De), O(document, "touchmove", De);
|
|
3124
|
+
},
|
|
3125
|
+
_offUpEvents: function() {
|
|
3126
|
+
var e = this.el.ownerDocument;
|
|
3127
|
+
O(e, "mouseup", this._onDrop), O(e, "touchend", this._onDrop), O(e, "pointerup", this._onDrop), O(e, "touchcancel", this._onDrop), O(document, "selectstart", this);
|
|
3128
|
+
},
|
|
3129
|
+
_onDrop: function(e) {
|
|
3130
|
+
var a = this.el, t = this.options;
|
|
3131
|
+
if (fe = ge(h), Fe = ge(h, t.draggable), de("drop", this, {
|
|
3132
|
+
evt: e
|
|
3133
|
+
}), K = h && h.parentNode, fe = ge(h), Fe = ge(h, t.draggable), S.eventCanceled) {
|
|
3134
|
+
this._nulling();
|
|
3135
|
+
return;
|
|
3136
|
+
}
|
|
3137
|
+
Ae = !1, et = !1, We = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ut(this.cloneId), Ut(this._dragStartId), this.nativeDraggable && (O(document, "drop", this), O(a, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), He && F(document.body, "user-select", ""), F(h, "transform", ""), e && (Le && (e.cancelable && e.preventDefault(), !t.dropBubble && e.stopPropagation()), D && D.parentNode && D.parentNode.removeChild(D), (L === K || le && le.lastPutMode !== "clone") && j && j.parentNode && j.parentNode.removeChild(j), h && (this.nativeDraggable && O(h, "dragend", this), kt(h), h.style["will-change"] = "", Le && !Ae && me(h, le ? le.options.ghostClass : this.options.ghostClass, !1), me(h, this.options.chosenClass, !1), ue({
|
|
3138
|
+
sortable: this,
|
|
3139
|
+
name: "unchoose",
|
|
3140
|
+
toEl: K,
|
|
3141
|
+
newIndex: null,
|
|
3142
|
+
newDraggableIndex: null,
|
|
3143
|
+
originalEvent: e
|
|
3144
|
+
}), L !== K ? (fe >= 0 && (ue({
|
|
3145
|
+
rootEl: K,
|
|
3146
|
+
name: "add",
|
|
3147
|
+
toEl: K,
|
|
3148
|
+
fromEl: L,
|
|
3149
|
+
originalEvent: e
|
|
3150
|
+
}), ue({
|
|
3151
|
+
sortable: this,
|
|
3152
|
+
name: "remove",
|
|
3153
|
+
toEl: K,
|
|
3154
|
+
originalEvent: e
|
|
3155
|
+
}), ue({
|
|
3156
|
+
rootEl: K,
|
|
3157
|
+
name: "sort",
|
|
3158
|
+
toEl: K,
|
|
3159
|
+
fromEl: L,
|
|
3160
|
+
originalEvent: e
|
|
3161
|
+
}), ue({
|
|
3162
|
+
sortable: this,
|
|
3163
|
+
name: "sort",
|
|
3164
|
+
toEl: K,
|
|
3165
|
+
originalEvent: e
|
|
3166
|
+
})), le && le.save()) : fe !== Be && fe >= 0 && (ue({
|
|
3167
|
+
sortable: this,
|
|
3168
|
+
name: "update",
|
|
3169
|
+
toEl: K,
|
|
3170
|
+
originalEvent: e
|
|
3171
|
+
}), ue({
|
|
3172
|
+
sortable: this,
|
|
3173
|
+
name: "sort",
|
|
3174
|
+
toEl: K,
|
|
3175
|
+
originalEvent: e
|
|
3176
|
+
})), S.active && ((fe == null || fe === -1) && (fe = Be, Fe = Ke), ue({
|
|
3177
|
+
sortable: this,
|
|
3178
|
+
name: "end",
|
|
3179
|
+
toEl: K,
|
|
3180
|
+
originalEvent: e
|
|
3181
|
+
}), this.save()))), this._nulling();
|
|
3182
|
+
},
|
|
3183
|
+
_nulling: function() {
|
|
3184
|
+
de("nulling", this), L = h = K = D = Ee = j = ot = Se = ke = ye = Le = fe = Fe = Be = Ke = Pe = ze = le = Ze = S.dragged = S.ghost = S.clone = S.active = null, mt.forEach(function(e) {
|
|
3185
|
+
e.checked = !0;
|
|
3186
|
+
}), mt.length = Ft = St = 0;
|
|
3187
|
+
},
|
|
3188
|
+
handleEvent: function(e) {
|
|
3189
|
+
switch (e.type) {
|
|
3190
|
+
case "drop":
|
|
3191
|
+
case "dragend":
|
|
3192
|
+
this._onDrop(e);
|
|
3193
|
+
break;
|
|
3194
|
+
case "dragenter":
|
|
3195
|
+
case "dragover":
|
|
3196
|
+
h && (this._onDragOver(e), Al(e));
|
|
3197
|
+
break;
|
|
3198
|
+
case "selectstart":
|
|
3199
|
+
e.preventDefault();
|
|
3200
|
+
break;
|
|
3201
|
+
}
|
|
3202
|
+
},
|
|
3203
|
+
/**
|
|
3204
|
+
* Serializes the item into an array of string.
|
|
3205
|
+
* @returns {String[]}
|
|
3206
|
+
*/
|
|
3207
|
+
toArray: function() {
|
|
3208
|
+
for (var e = [], a, t = this.el.children, l = 0, o = t.length, r = this.options; l < o; l++)
|
|
3209
|
+
a = t[l], he(a, r.draggable, this.el, !1) && e.push(a.getAttribute(r.dataIdAttr) || Ll(a));
|
|
3210
|
+
return e;
|
|
3211
|
+
},
|
|
3212
|
+
/**
|
|
3213
|
+
* Sorts the elements according to the array.
|
|
3214
|
+
* @param {String[]} order order of the items
|
|
3215
|
+
*/
|
|
3216
|
+
sort: function(e, a) {
|
|
3217
|
+
var t = {}, l = this.el;
|
|
3218
|
+
this.toArray().forEach(function(o, r) {
|
|
3219
|
+
var n = l.children[r];
|
|
3220
|
+
he(n, this.options.draggable, l, !1) && (t[o] = n);
|
|
3221
|
+
}, this), a && this.captureAnimationState(), e.forEach(function(o) {
|
|
3222
|
+
t[o] && (l.removeChild(t[o]), l.appendChild(t[o]));
|
|
3223
|
+
}), a && this.animateAll();
|
|
3224
|
+
},
|
|
3225
|
+
/**
|
|
3226
|
+
* Save the current sorting
|
|
3227
|
+
*/
|
|
3228
|
+
save: function() {
|
|
3229
|
+
var e = this.options.store;
|
|
3230
|
+
e && e.set && e.set(this);
|
|
3231
|
+
},
|
|
3232
|
+
/**
|
|
3233
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
|
3234
|
+
* @param {HTMLElement} el
|
|
3235
|
+
* @param {String} [selector] default: `options.draggable`
|
|
3236
|
+
* @returns {HTMLElement|null}
|
|
3237
|
+
*/
|
|
3238
|
+
closest: function(e, a) {
|
|
3239
|
+
return he(e, a || this.options.draggable, this.el, !1);
|
|
3240
|
+
},
|
|
3241
|
+
/**
|
|
3242
|
+
* Set/get option
|
|
3243
|
+
* @param {string} name
|
|
3244
|
+
* @param {*} [value]
|
|
3245
|
+
* @returns {*}
|
|
3246
|
+
*/
|
|
3247
|
+
option: function(e, a) {
|
|
3248
|
+
var t = this.options;
|
|
3249
|
+
if (a === void 0)
|
|
3250
|
+
return t[e];
|
|
3251
|
+
var l = Je.modifyOption(this, e, a);
|
|
3252
|
+
typeof l < "u" ? t[e] = l : t[e] = a, e === "group" && Ia(t);
|
|
3253
|
+
},
|
|
3254
|
+
/**
|
|
3255
|
+
* Destroy
|
|
3256
|
+
*/
|
|
3257
|
+
destroy: function() {
|
|
3258
|
+
de("destroy", this);
|
|
3259
|
+
var e = this.el;
|
|
3260
|
+
e[ve] = null, O(e, "mousedown", this._onTapStart), O(e, "touchstart", this._onTapStart), O(e, "pointerdown", this._onTapStart), this.nativeDraggable && (O(e, "dragover", this), O(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(a) {
|
|
3261
|
+
a.removeAttribute("draggable");
|
|
3262
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), pt.splice(pt.indexOf(this.el), 1), this.el = e = null;
|
|
3263
|
+
},
|
|
3264
|
+
_hideClone: function() {
|
|
3265
|
+
if (!Se) {
|
|
3266
|
+
if (de("hideClone", this), S.eventCanceled)
|
|
3267
|
+
return;
|
|
3268
|
+
F(j, "display", "none"), this.options.removeCloneOnHide && j.parentNode && j.parentNode.removeChild(j), Se = !0;
|
|
3269
|
+
}
|
|
3270
|
+
},
|
|
3271
|
+
_showClone: function(e) {
|
|
3272
|
+
if (e.lastPutMode !== "clone") {
|
|
3273
|
+
this._hideClone();
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
if (Se) {
|
|
3277
|
+
if (de("showClone", this), S.eventCanceled)
|
|
3278
|
+
return;
|
|
3279
|
+
h.parentNode == L && !this.options.group.revertClone ? L.insertBefore(j, h) : Ee ? L.insertBefore(j, Ee) : L.appendChild(j), this.options.group.revertClone && this.animate(h, j), F(j, "display", ""), Se = !1;
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
};
|
|
3283
|
+
function Al(e) {
|
|
3284
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
3285
|
+
}
|
|
3286
|
+
function at(e, a, t, l, o, r, n, p) {
|
|
3287
|
+
var s, f = e[ve], d = f.options.onMove, m;
|
|
3288
|
+
return window.CustomEvent && !xe && !Qe ? s = new CustomEvent("move", {
|
|
3289
|
+
bubbles: !0,
|
|
3290
|
+
cancelable: !0
|
|
3291
|
+
}) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = a, s.from = e, s.dragged = t, s.draggedRect = l, s.related = o || a, s.relatedRect = r || te(a), s.willInsertAfter = p, s.originalEvent = n, e.dispatchEvent(s), d && (m = d.call(f, s, n)), m;
|
|
3292
|
+
}
|
|
3293
|
+
function kt(e) {
|
|
3294
|
+
e.draggable = !1;
|
|
3295
|
+
}
|
|
3296
|
+
function Rl() {
|
|
3297
|
+
Ot = !1;
|
|
3298
|
+
}
|
|
3299
|
+
function ql(e, a, t) {
|
|
3300
|
+
var l = te(Ye(t.el, 0, t.options, !0)), o = _a(t.el, t.options, D), r = 10;
|
|
3301
|
+
return a ? e.clientX < o.left - r || e.clientY < l.top && e.clientX < l.right : e.clientY < o.top - r || e.clientY < l.bottom && e.clientX < l.left;
|
|
3302
|
+
}
|
|
3303
|
+
function Bl(e, a, t) {
|
|
3304
|
+
var l = te(Bt(t.el, t.options.draggable)), o = _a(t.el, t.options, D), r = 10;
|
|
3305
|
+
return a ? e.clientX > o.right + r || e.clientY > l.bottom && e.clientX > l.left : e.clientY > o.bottom + r || e.clientX > l.right && e.clientY > l.top;
|
|
3306
|
+
}
|
|
3307
|
+
function Gl(e, a, t, l, o, r, n, p) {
|
|
3308
|
+
var s = l ? e.clientY : e.clientX, f = l ? t.height : t.width, d = l ? t.top : t.left, m = l ? t.bottom : t.right, i = !1;
|
|
3309
|
+
if (!n) {
|
|
3310
|
+
if (p && rt < f * o) {
|
|
3311
|
+
if (!We && (ze === 1 ? s > d + f * r / 2 : s < m - f * r / 2) && (We = !0), We)
|
|
3312
|
+
i = !0;
|
|
3313
|
+
else if (ze === 1 ? s < d + rt : s > m - rt)
|
|
3314
|
+
return -ze;
|
|
3315
|
+
} else if (s > d + f * (1 - o) / 2 && s < m - f * (1 - o) / 2)
|
|
3316
|
+
return Yl(a);
|
|
3317
|
+
}
|
|
3318
|
+
return i = i || n, i && (s < d + f * r / 2 || s > m - f * r / 2) ? s > d + f / 2 ? 1 : -1 : 0;
|
|
3319
|
+
}
|
|
3320
|
+
function Yl(e) {
|
|
3321
|
+
return ge(h) < ge(e) ? 1 : -1;
|
|
3322
|
+
}
|
|
3323
|
+
function Ll(e) {
|
|
3324
|
+
for (var a = e.tagName + e.className + e.src + e.href + e.textContent, t = a.length, l = 0; t--; )
|
|
3325
|
+
l += a.charCodeAt(t);
|
|
3326
|
+
return l.toString(36);
|
|
3327
|
+
}
|
|
3328
|
+
function $l(e) {
|
|
3329
|
+
mt.length = 0;
|
|
3330
|
+
for (var a = e.getElementsByTagName("input"), t = a.length; t--; ) {
|
|
3331
|
+
var l = a[t];
|
|
3332
|
+
l.checked && mt.push(l);
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
function it(e) {
|
|
3336
|
+
return setTimeout(e, 0);
|
|
3337
|
+
}
|
|
3338
|
+
function Ut(e) {
|
|
3339
|
+
return clearTimeout(e);
|
|
3340
|
+
}
|
|
3341
|
+
wt && M(document, "touchmove", function(e) {
|
|
3342
|
+
(S.active || Ae) && e.cancelable && e.preventDefault();
|
|
3343
|
+
});
|
|
3344
|
+
S.utils = {
|
|
3345
|
+
on: M,
|
|
3346
|
+
off: O,
|
|
3347
|
+
css: F,
|
|
3348
|
+
find: ga,
|
|
3349
|
+
is: function(e, a) {
|
|
3350
|
+
return !!he(e, a, e, !1);
|
|
3351
|
+
},
|
|
3352
|
+
extend: Fl,
|
|
3353
|
+
throttle: ya,
|
|
3354
|
+
closest: he,
|
|
3355
|
+
toggleClass: me,
|
|
3356
|
+
clone: ba,
|
|
3357
|
+
index: ge,
|
|
3358
|
+
nextTick: it,
|
|
3359
|
+
cancelNextTick: Ut,
|
|
3360
|
+
detectDirection: Ta,
|
|
3361
|
+
getChild: Ye
|
|
3362
|
+
};
|
|
3363
|
+
S.get = function(e) {
|
|
3364
|
+
return e[ve];
|
|
3365
|
+
};
|
|
3366
|
+
S.mount = function() {
|
|
3367
|
+
for (var e = arguments.length, a = new Array(e), t = 0; t < e; t++)
|
|
3368
|
+
a[t] = arguments[t];
|
|
3369
|
+
a[0].constructor === Array && (a = a[0]), a.forEach(function(l) {
|
|
3370
|
+
if (!l.prototype || !l.prototype.constructor)
|
|
3371
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(l));
|
|
3372
|
+
l.utils && (S.utils = we(we({}, S.utils), l.utils)), Je.mount(l);
|
|
3373
|
+
});
|
|
3374
|
+
};
|
|
3375
|
+
S.create = function(e, a) {
|
|
3376
|
+
return new S(e, a);
|
|
3377
|
+
};
|
|
3378
|
+
S.version = Il;
|
|
3379
|
+
var ee = [], $e, Mt, Pt = !1, Dt, Et, ft, je;
|
|
3380
|
+
function jl() {
|
|
3381
|
+
function e() {
|
|
3382
|
+
this.defaults = {
|
|
3383
|
+
scroll: !0,
|
|
3384
|
+
forceAutoScrollFallback: !1,
|
|
3385
|
+
scrollSensitivity: 30,
|
|
3386
|
+
scrollSpeed: 10,
|
|
3387
|
+
bubbleScroll: !0
|
|
3388
|
+
};
|
|
3389
|
+
for (var a in this)
|
|
3390
|
+
a.charAt(0) === "_" && typeof this[a] == "function" && (this[a] = this[a].bind(this));
|
|
3391
|
+
}
|
|
3392
|
+
return e.prototype = {
|
|
3393
|
+
dragStarted: function(a) {
|
|
3394
|
+
var t = a.originalEvent;
|
|
3395
|
+
this.sortable.nativeDraggable ? M(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? M(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? M(document, "touchmove", this._handleFallbackAutoScroll) : M(document, "mousemove", this._handleFallbackAutoScroll);
|
|
3396
|
+
},
|
|
3397
|
+
dragOverCompleted: function(a) {
|
|
3398
|
+
var t = a.originalEvent;
|
|
3399
|
+
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
3400
|
+
},
|
|
3401
|
+
drop: function() {
|
|
3402
|
+
this.sortable.nativeDraggable ? O(document, "dragover", this._handleAutoScroll) : (O(document, "pointermove", this._handleFallbackAutoScroll), O(document, "touchmove", this._handleFallbackAutoScroll), O(document, "mousemove", this._handleFallbackAutoScroll)), na(), st(), Sl();
|
|
3403
|
+
},
|
|
3404
|
+
nulling: function() {
|
|
3405
|
+
ft = Mt = $e = Pt = je = Dt = Et = null, ee.length = 0;
|
|
3406
|
+
},
|
|
3407
|
+
_handleFallbackAutoScroll: function(a) {
|
|
3408
|
+
this._handleAutoScroll(a, !0);
|
|
3409
|
+
},
|
|
3410
|
+
_handleAutoScroll: function(a, t) {
|
|
3411
|
+
var l = this, o = (a.touches ? a.touches[0] : a).clientX, r = (a.touches ? a.touches[0] : a).clientY, n = document.elementFromPoint(o, r);
|
|
3412
|
+
if (ft = a, t || this.options.forceAutoScrollFallback || Qe || xe || He) {
|
|
3413
|
+
Vt(a, this.options, n, t);
|
|
3414
|
+
var p = Ne(n, !0);
|
|
3415
|
+
Pt && (!je || o !== Dt || r !== Et) && (je && na(), je = setInterval(function() {
|
|
3416
|
+
var s = Ne(document.elementFromPoint(o, r), !0);
|
|
3417
|
+
s !== p && (p = s, st()), Vt(a, l.options, s, t);
|
|
3418
|
+
}, 10), Dt = o, Et = r);
|
|
3419
|
+
} else {
|
|
3420
|
+
if (!this.options.bubbleScroll || Ne(n, !0) === _e()) {
|
|
3421
|
+
st();
|
|
3422
|
+
return;
|
|
3423
|
+
}
|
|
3424
|
+
Vt(a, this.options, Ne(n, !1), !1);
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
}, Ie(e, {
|
|
3428
|
+
pluginName: "scroll",
|
|
3429
|
+
initializeByDefault: !0
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
function st() {
|
|
3433
|
+
ee.forEach(function(e) {
|
|
3434
|
+
clearInterval(e.pid);
|
|
3435
|
+
}), ee = [];
|
|
3436
|
+
}
|
|
3437
|
+
function na() {
|
|
3438
|
+
clearInterval(je);
|
|
3439
|
+
}
|
|
3440
|
+
var Vt = ya(function(e, a, t, l) {
|
|
3441
|
+
if (a.scroll) {
|
|
3442
|
+
var o = (e.touches ? e.touches[0] : e).clientX, r = (e.touches ? e.touches[0] : e).clientY, n = a.scrollSensitivity, p = a.scrollSpeed, s = _e(), f = !1, d;
|
|
3443
|
+
Mt !== t && (Mt = t, st(), $e = a.scroll, d = a.scrollFn, $e === !0 && ($e = Ne(t, !0)));
|
|
3444
|
+
var m = 0, i = $e;
|
|
3445
|
+
do {
|
|
3446
|
+
var u = i, v = te(u), g = v.top, k = v.bottom, c = v.left, w = v.right, A = v.width, U = v.height, q = void 0, Q = void 0, B = u.scrollWidth, pe = u.scrollHeight, J = F(u), C = u.scrollLeft, x = u.scrollTop;
|
|
3447
|
+
u === s ? (q = A < B && (J.overflowX === "auto" || J.overflowX === "scroll" || J.overflowX === "visible"), Q = U < pe && (J.overflowY === "auto" || J.overflowY === "scroll" || J.overflowY === "visible")) : (q = A < B && (J.overflowX === "auto" || J.overflowX === "scroll"), Q = U < pe && (J.overflowY === "auto" || J.overflowY === "scroll"));
|
|
3448
|
+
var E = q && (Math.abs(w - o) <= n && C + A < B) - (Math.abs(c - o) <= n && !!C), Z = Q && (Math.abs(k - r) <= n && x + U < pe) - (Math.abs(g - r) <= n && !!x);
|
|
3449
|
+
if (!ee[m])
|
|
3450
|
+
for (var P = 0; P <= m; P++)
|
|
3451
|
+
ee[P] || (ee[P] = {});
|
|
3452
|
+
(ee[m].vx != E || ee[m].vy != Z || ee[m].el !== u) && (ee[m].el = u, ee[m].vx = E, ee[m].vy = Z, clearInterval(ee[m].pid), (E != 0 || Z != 0) && (f = !0, ee[m].pid = setInterval((function() {
|
|
3453
|
+
l && this.layer === 0 && S.active._onTouchMove(ft);
|
|
3454
|
+
var G = ee[this.layer].vy ? ee[this.layer].vy * p : 0, X = ee[this.layer].vx ? ee[this.layer].vx * p : 0;
|
|
3455
|
+
typeof d == "function" && d.call(S.dragged.parentNode[ve], X, G, e, ft, ee[this.layer].el) !== "continue" || ha(ee[this.layer].el, X, G);
|
|
3456
|
+
}).bind({
|
|
3457
|
+
layer: m
|
|
3458
|
+
}), 24))), m++;
|
|
3459
|
+
} while (a.bubbleScroll && i !== s && (i = Ne(i, !1)));
|
|
3460
|
+
Pt = f;
|
|
3461
|
+
}
|
|
3462
|
+
}, 30), Fa = function(e) {
|
|
3463
|
+
var a = e.originalEvent, t = e.putSortable, l = e.dragEl, o = e.activeSortable, r = e.dispatchSortableEvent, n = e.hideGhostForTarget, p = e.unhideGhostForTarget;
|
|
3464
|
+
if (a) {
|
|
3465
|
+
var s = t || o;
|
|
3466
|
+
n();
|
|
3467
|
+
var f = a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : a, d = document.elementFromPoint(f.clientX, f.clientY);
|
|
3468
|
+
p(), s && !s.el.contains(d) && (r("spill"), this.onSpill({
|
|
3469
|
+
dragEl: l,
|
|
3470
|
+
putSortable: t
|
|
3471
|
+
}));
|
|
3472
|
+
}
|
|
3473
|
+
};
|
|
3474
|
+
function Gt() {
|
|
3475
|
+
}
|
|
3476
|
+
Gt.prototype = {
|
|
3477
|
+
startIndex: null,
|
|
3478
|
+
dragStart: function(e) {
|
|
3479
|
+
var a = e.oldDraggableIndex;
|
|
3480
|
+
this.startIndex = a;
|
|
3481
|
+
},
|
|
3482
|
+
onSpill: function(e) {
|
|
3483
|
+
var a = e.dragEl, t = e.putSortable;
|
|
3484
|
+
this.sortable.captureAnimationState(), t && t.captureAnimationState();
|
|
3485
|
+
var l = Ye(this.sortable.el, this.startIndex, this.options);
|
|
3486
|
+
l ? this.sortable.el.insertBefore(a, l) : this.sortable.el.appendChild(a), this.sortable.animateAll(), t && t.animateAll();
|
|
3487
|
+
},
|
|
3488
|
+
drop: Fa
|
|
3489
|
+
};
|
|
3490
|
+
Ie(Gt, {
|
|
3491
|
+
pluginName: "revertOnSpill"
|
|
3492
|
+
});
|
|
3493
|
+
function Yt() {
|
|
3494
|
+
}
|
|
3495
|
+
Yt.prototype = {
|
|
3496
|
+
onSpill: function(e) {
|
|
3497
|
+
var a = e.dragEl, t = e.putSortable, l = t || this.sortable;
|
|
3498
|
+
l.captureAnimationState(), a.parentNode && a.parentNode.removeChild(a), l.animateAll();
|
|
3499
|
+
},
|
|
3500
|
+
drop: Fa
|
|
3501
|
+
};
|
|
3502
|
+
Ie(Yt, {
|
|
3503
|
+
pluginName: "removeOnSpill"
|
|
3504
|
+
});
|
|
3505
|
+
S.mount(new jl());
|
|
3506
|
+
S.mount(Yt, Gt);
|
|
3507
|
+
function Hl(e) {
|
|
3508
|
+
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
3509
|
+
}
|
|
3510
|
+
function Xl(e) {
|
|
3511
|
+
Rt() && Oa(e);
|
|
3512
|
+
}
|
|
3513
|
+
function Kl(e) {
|
|
3514
|
+
Rt() ? re(e) : ra(e);
|
|
3515
|
+
}
|
|
3516
|
+
let Sa = null, Na = null;
|
|
3517
|
+
function la(e = null, a = null) {
|
|
3518
|
+
Sa = e, Na = a;
|
|
3519
|
+
}
|
|
3520
|
+
function zl() {
|
|
3521
|
+
return {
|
|
3522
|
+
data: Sa,
|
|
3523
|
+
clonedData: Na
|
|
3524
|
+
};
|
|
3525
|
+
}
|
|
3526
|
+
const oa = Symbol("cloneElement");
|
|
3527
|
+
function Wl(...e) {
|
|
3528
|
+
var a, t;
|
|
3529
|
+
const l = (a = Rt()) == null ? void 0 : a.proxy;
|
|
3530
|
+
let o = null;
|
|
3531
|
+
const r = e[0];
|
|
3532
|
+
let [, n, p] = e;
|
|
3533
|
+
Array.isArray(V(n)) || (p = n, n = null);
|
|
3534
|
+
let s = null;
|
|
3535
|
+
const {
|
|
3536
|
+
immediate: f = !0,
|
|
3537
|
+
clone: d = Hl,
|
|
3538
|
+
forceFallback: m,
|
|
3539
|
+
fallbackOnBody: i,
|
|
3540
|
+
customUpdate: u
|
|
3541
|
+
} = (t = V(p)) != null ? t : {};
|
|
3542
|
+
function v(C) {
|
|
3543
|
+
var x;
|
|
3544
|
+
const { from: E, oldIndex: Z, item: P } = C, G = Array.from(E.childNodes);
|
|
3545
|
+
o = m && !i ? G.slice(0, -1) : G;
|
|
3546
|
+
const X = V((x = V(n)) == null ? void 0 : x[Z]), z = d(X);
|
|
3547
|
+
la(X, z), P[oa] = z;
|
|
3548
|
+
}
|
|
3549
|
+
function g(C) {
|
|
3550
|
+
const x = C.item[oa];
|
|
3551
|
+
if (!pl(x)) {
|
|
3552
|
+
if (It(C.item), Oe(n)) {
|
|
3553
|
+
const E = [...V(n)];
|
|
3554
|
+
n.value = Ht(E, C.newDraggableIndex, x);
|
|
3555
|
+
return;
|
|
3556
|
+
}
|
|
3557
|
+
Ht(V(n), C.newDraggableIndex, x);
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
function k(C) {
|
|
3561
|
+
const { from: x, item: E, oldIndex: Z, oldDraggableIndex: P, pullMode: G, clone: X } = C;
|
|
3562
|
+
if (Xt(x, E, Z), G === "clone") {
|
|
3563
|
+
It(X);
|
|
3564
|
+
return;
|
|
3565
|
+
}
|
|
3566
|
+
if (Oe(n)) {
|
|
3567
|
+
const z = [...V(n)];
|
|
3568
|
+
n.value = jt(z, P);
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
jt(V(n), P);
|
|
3572
|
+
}
|
|
3573
|
+
function c(C) {
|
|
3574
|
+
if (u) {
|
|
3575
|
+
u(C);
|
|
3576
|
+
return;
|
|
3577
|
+
}
|
|
3578
|
+
const { from: x, item: E, oldIndex: Z, oldDraggableIndex: P, newDraggableIndex: G } = C;
|
|
3579
|
+
if (It(E), Xt(x, E, Z), Oe(n)) {
|
|
3580
|
+
const X = [...V(n)];
|
|
3581
|
+
n.value = $t(
|
|
3582
|
+
X,
|
|
3583
|
+
P,
|
|
3584
|
+
G
|
|
3585
|
+
);
|
|
3586
|
+
return;
|
|
3587
|
+
}
|
|
3588
|
+
$t(V(n), P, G);
|
|
3589
|
+
}
|
|
3590
|
+
function w(C) {
|
|
3591
|
+
const { newIndex: x, oldIndex: E, from: Z, to: P } = C;
|
|
3592
|
+
let G = null;
|
|
3593
|
+
const X = x === E && Z === P;
|
|
3594
|
+
try {
|
|
3595
|
+
if (X) {
|
|
3596
|
+
let z = null;
|
|
3597
|
+
o == null || o.some((Ce, ie) => {
|
|
3598
|
+
if (z && (o == null ? void 0 : o.length) !== P.childNodes.length)
|
|
3599
|
+
return Z.insertBefore(z, Ce.nextSibling), !0;
|
|
3600
|
+
const Tt = P.childNodes[ie];
|
|
3601
|
+
z = P == null ? void 0 : P.replaceChild(Ce, Tt);
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3604
|
+
} catch (z) {
|
|
3605
|
+
G = z;
|
|
3606
|
+
} finally {
|
|
3607
|
+
o = null;
|
|
3608
|
+
}
|
|
3609
|
+
ra(() => {
|
|
3610
|
+
if (la(), G)
|
|
3611
|
+
throw G;
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3614
|
+
const A = {
|
|
3615
|
+
onUpdate: c,
|
|
3616
|
+
onStart: v,
|
|
3617
|
+
onAdd: g,
|
|
3618
|
+
onRemove: k,
|
|
3619
|
+
onEnd: w
|
|
3620
|
+
};
|
|
3621
|
+
function U(C) {
|
|
3622
|
+
const x = V(r);
|
|
3623
|
+
return C || (C = ml(x) ? fl(x, l == null ? void 0 : l.$el) : x), C && !yl(C) && (C = C.$el), C || ul("Root element not found"), C;
|
|
3624
|
+
}
|
|
3625
|
+
function q() {
|
|
3626
|
+
var C;
|
|
3627
|
+
const x = (C = V(p)) != null ? C : {}, { immediate: E, clone: Z } = x, P = da(x, ["immediate", "clone"]);
|
|
3628
|
+
return Kt(P, (G, X) => {
|
|
3629
|
+
hl(G) && (P[G] = (z, ...Ce) => {
|
|
3630
|
+
const ie = zl();
|
|
3631
|
+
return bl(z, ie), X(z, ...Ce);
|
|
3632
|
+
});
|
|
3633
|
+
}), gl(
|
|
3634
|
+
n === null ? {} : A,
|
|
3635
|
+
P
|
|
3636
|
+
);
|
|
3637
|
+
}
|
|
3638
|
+
const Q = (C) => {
|
|
3639
|
+
C = U(C), s && B.destroy(), s = new S(C, q());
|
|
3640
|
+
};
|
|
3641
|
+
ne(
|
|
3642
|
+
() => p,
|
|
3643
|
+
() => {
|
|
3644
|
+
s && Kt(q(), (C, x) => {
|
|
3645
|
+
s == null || s.option(C, x);
|
|
3646
|
+
});
|
|
3647
|
+
},
|
|
3648
|
+
{ deep: !0 }
|
|
3649
|
+
);
|
|
3650
|
+
const B = {
|
|
3651
|
+
option: (C, x) => s == null ? void 0 : s.option(C, x),
|
|
3652
|
+
destroy: () => {
|
|
3653
|
+
s == null || s.destroy(), s = null;
|
|
3654
|
+
},
|
|
3655
|
+
save: () => s == null ? void 0 : s.save(),
|
|
3656
|
+
toArray: () => s == null ? void 0 : s.toArray(),
|
|
3657
|
+
closest: (...C) => s == null ? void 0 : s.closest(...C)
|
|
3658
|
+
}, pe = () => B == null ? void 0 : B.option("disabled", !0), J = () => B == null ? void 0 : B.option("disabled", !1);
|
|
3659
|
+
return Kl(() => {
|
|
3660
|
+
f && Q();
|
|
3661
|
+
}), Xl(B.destroy), qe({ start: Q, pause: pe, resume: J }, B);
|
|
3662
|
+
}
|
|
3663
|
+
const At = [
|
|
3664
|
+
"update",
|
|
3665
|
+
"start",
|
|
3666
|
+
"add",
|
|
3667
|
+
"remove",
|
|
3668
|
+
"choose",
|
|
3669
|
+
"unchoose",
|
|
3670
|
+
"end",
|
|
3671
|
+
"sort",
|
|
3672
|
+
"filter",
|
|
3673
|
+
"clone",
|
|
3674
|
+
"move",
|
|
3675
|
+
"change"
|
|
3676
|
+
], Ql = [
|
|
3677
|
+
"clone",
|
|
3678
|
+
"animation",
|
|
3679
|
+
"ghostClass",
|
|
3680
|
+
"group",
|
|
3681
|
+
"sort",
|
|
3682
|
+
"disabled",
|
|
3683
|
+
"store",
|
|
3684
|
+
"handle",
|
|
3685
|
+
"draggable",
|
|
3686
|
+
"swapThreshold",
|
|
3687
|
+
"invertSwap",
|
|
3688
|
+
"invertedSwapThreshold",
|
|
3689
|
+
"removeCloneOnHide",
|
|
3690
|
+
"direction",
|
|
3691
|
+
"chosenClass",
|
|
3692
|
+
"dragClass",
|
|
3693
|
+
"ignore",
|
|
3694
|
+
"filter",
|
|
3695
|
+
"preventOnFilter",
|
|
3696
|
+
"easing",
|
|
3697
|
+
"setData",
|
|
3698
|
+
"dropBubble",
|
|
3699
|
+
"dragoverBubble",
|
|
3700
|
+
"dataIdAttr",
|
|
3701
|
+
"delay",
|
|
3702
|
+
"delayOnTouchOnly",
|
|
3703
|
+
"touchStartThreshold",
|
|
3704
|
+
"forceFallback",
|
|
3705
|
+
"fallbackClass",
|
|
3706
|
+
"fallbackOnBody",
|
|
3707
|
+
"fallbackTolerance",
|
|
3708
|
+
"fallbackOffset",
|
|
3709
|
+
"supportPointer",
|
|
3710
|
+
"emptyInsertThreshold",
|
|
3711
|
+
"scroll",
|
|
3712
|
+
"forceAutoScrollFallback",
|
|
3713
|
+
"scrollSensitivity",
|
|
3714
|
+
"scrollSpeed",
|
|
3715
|
+
"bubbleScroll",
|
|
3716
|
+
"modelValue",
|
|
3717
|
+
"tag",
|
|
3718
|
+
"target",
|
|
3719
|
+
"customUpdate",
|
|
3720
|
+
...At.map((e) => `on${e.replace(/^\S/, (a) => a.toUpperCase())}`)
|
|
3721
|
+
], Jl = H({
|
|
3722
|
+
name: "VueDraggable",
|
|
3723
|
+
model: {
|
|
3724
|
+
prop: "modelValue",
|
|
3725
|
+
event: "update:modelValue"
|
|
3726
|
+
},
|
|
3727
|
+
props: Ql,
|
|
3728
|
+
emits: ["update:modelValue", ...At],
|
|
3729
|
+
setup(e, { slots: a, emit: t, expose: l, attrs: o }) {
|
|
3730
|
+
const r = At.reduce((d, m) => {
|
|
3731
|
+
const i = `on${m.replace(/^\S/, (u) => u.toUpperCase())}`;
|
|
3732
|
+
return d[i] = (...u) => t(m, ...u), d;
|
|
3733
|
+
}, {}), n = $(() => {
|
|
3734
|
+
const d = Da(e), { modelValue: m } = d, i = da(d, ["modelValue"]), u = Object.entries(i).reduce((v, [g, k]) => {
|
|
3735
|
+
const c = V(k);
|
|
3736
|
+
return c !== void 0 && (v[g] = c), v;
|
|
3737
|
+
}, {});
|
|
3738
|
+
return qe(qe({}, r), dl(qe(qe({}, o), u)));
|
|
3739
|
+
}), p = $({
|
|
3740
|
+
get: () => e.modelValue,
|
|
3741
|
+
set: (d) => t("update:modelValue", d)
|
|
3742
|
+
}), s = T(), f = Ea(
|
|
3743
|
+
Wl(e.target || s, p, n)
|
|
3744
|
+
);
|
|
3745
|
+
return l(f), () => {
|
|
3746
|
+
var d;
|
|
3747
|
+
return Va(e.tag || "div", { ref: s }, (d = a == null ? void 0 : a.default) == null ? void 0 : d.call(a, f));
|
|
3748
|
+
};
|
|
3749
|
+
}
|
|
3750
|
+
}), Zl = { class: "flex flex-col gap-6" }, eo = {
|
|
3751
|
+
key: 0,
|
|
3752
|
+
class: "text-sm text-gray-500 flex items-center gap-1.5 -mb-2"
|
|
3753
|
+
}, to = { class: "flex items-center justify-between" }, ao = { class: "flex items-center gap-3" }, no = ["src"], lo = { class: "text-xs font-semibold uppercase bg-gray-100 rounded px-2 py-1" }, oo = { class: "font-medium" }, ro = { class: "grid grid-cols-3 gap-4" }, io = {
|
|
3754
|
+
key: 1,
|
|
3755
|
+
class: "text-gray-500"
|
|
3756
|
+
}, so = {
|
|
3757
|
+
key: 2,
|
|
3758
|
+
class: "mt-2 flex gap-3"
|
|
3759
|
+
}, uo = /* @__PURE__ */ H({
|
|
3760
|
+
__name: "PaymentCheckout",
|
|
3761
|
+
props: {
|
|
3762
|
+
terminal: {
|
|
3763
|
+
type: Object,
|
|
3764
|
+
required: !0
|
|
3765
|
+
},
|
|
3766
|
+
onUpdate: {
|
|
3767
|
+
type: Function,
|
|
3768
|
+
required: !0
|
|
3769
|
+
}
|
|
3770
|
+
},
|
|
3771
|
+
setup(e) {
|
|
3772
|
+
const a = e, t = () => (a.terminal.paymentCheckouts ?? []).map((d) => ({ ...d })).sort((d, m) => (d.sortOrder ?? 0) - (m.sortOrder ?? 0)), l = T(t());
|
|
3773
|
+
ne(
|
|
3774
|
+
() => a.terminal.paymentCheckouts,
|
|
3775
|
+
() => {
|
|
3776
|
+
l.value = t();
|
|
3777
|
+
}
|
|
3778
|
+
);
|
|
3779
|
+
function o() {
|
|
3780
|
+
l.value.forEach((d, m) => {
|
|
3781
|
+
d.sortOrder = m;
|
|
3782
|
+
});
|
|
3783
|
+
}
|
|
3784
|
+
const r = {
|
|
3785
|
+
card: "Card",
|
|
3786
|
+
ecr: "ECR",
|
|
3787
|
+
ecr_qr: "ECR QR",
|
|
3788
|
+
qr: "QR",
|
|
3789
|
+
scanpay: "Scan Pay"
|
|
3790
|
+
}, n = (d) => d.action ? `${d.gateway} (${d.action})` : d.gateway;
|
|
3791
|
+
async function p() {
|
|
3792
|
+
await a.onUpdate({
|
|
3793
|
+
...a.terminal,
|
|
3794
|
+
paymentCheckouts: l.value
|
|
3795
|
+
});
|
|
3796
|
+
}
|
|
3797
|
+
const s = Aa();
|
|
3798
|
+
function f() {
|
|
3799
|
+
Ya(
|
|
3800
|
+
s,
|
|
3801
|
+
"Reset Payment Checkout",
|
|
3802
|
+
"This will clear all customizations (display name, subtitle, icon, payment description, payment tagline, sort order, enabled state) for every payment method on this terminal and restore the defaults. This action cannot be undone.",
|
|
3803
|
+
async () => {
|
|
3804
|
+
await a.onUpdate({
|
|
3805
|
+
...a.terminal,
|
|
3806
|
+
paymentCheckouts: []
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
);
|
|
3810
|
+
}
|
|
3811
|
+
return (d, m) => {
|
|
3812
|
+
const i = _("FmIcon"), u = _("FmTooltip"), v = _("FmSwitch"), g = _("FmTextField"), k = _("FmButton");
|
|
3813
|
+
return b(), R("div", Zl, [
|
|
3814
|
+
l.value.length > 0 ? (b(), R("p", eo, [
|
|
3815
|
+
m[1] || (m[1] = Ve(" Drag the ", -1)),
|
|
3816
|
+
y(i, {
|
|
3817
|
+
class: "text-gray-400 mx-0.5",
|
|
3818
|
+
name: "drag_indicator"
|
|
3819
|
+
}),
|
|
3820
|
+
m[2] || (m[2] = Ve(" handle to reorder payment checkouts ", -1))
|
|
3821
|
+
])) : Y("", !0),
|
|
3822
|
+
y(V(Jl), {
|
|
3823
|
+
modelValue: l.value,
|
|
3824
|
+
"onUpdate:modelValue": m[0] || (m[0] = (c) => l.value = c),
|
|
3825
|
+
handle: ".drag-handle",
|
|
3826
|
+
class: "flex flex-col gap-6",
|
|
3827
|
+
"drag-class": "dragging-card",
|
|
3828
|
+
"ghost-class": "sortable-ghost-card",
|
|
3829
|
+
onEnd: o
|
|
3830
|
+
}, {
|
|
3831
|
+
default: ae(() => [
|
|
3832
|
+
(b(!0), R(oe, null, be(l.value, (c) => (b(), R("div", {
|
|
3833
|
+
key: c.id,
|
|
3834
|
+
class: "border rounded-lg p-6 flex flex-col gap-4"
|
|
3835
|
+
}, [
|
|
3836
|
+
I("div", to, [
|
|
3837
|
+
I("div", ao, [
|
|
3838
|
+
y(i, {
|
|
3839
|
+
class: "drag-handle cursor-grab text-gray-400",
|
|
3840
|
+
name: "drag_indicator"
|
|
3841
|
+
}),
|
|
3842
|
+
y(u, {
|
|
3843
|
+
variant: "plain",
|
|
3844
|
+
placement: "top",
|
|
3845
|
+
content: c.gateway,
|
|
3846
|
+
"hide-arrow": !0
|
|
3847
|
+
}, {
|
|
3848
|
+
default: ae(() => [
|
|
3849
|
+
I("img", {
|
|
3850
|
+
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
|
3851
|
+
src: V(Ga)(c.gateway.toUpperCase())
|
|
3852
|
+
}, null, 8, no)
|
|
3853
|
+
]),
|
|
3854
|
+
_: 2
|
|
3855
|
+
}, 1032, ["content"]),
|
|
3856
|
+
I("span", lo, Re(r[c.type] ?? c.type), 1),
|
|
3857
|
+
I("span", oo, Re(n(c)), 1)
|
|
3858
|
+
]),
|
|
3859
|
+
y(v, {
|
|
3860
|
+
modelValue: c.enabled,
|
|
3861
|
+
"onUpdate:modelValue": (w) => c.enabled = w,
|
|
3862
|
+
label: "Enabled"
|
|
3863
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3864
|
+
]),
|
|
3865
|
+
I("div", ro, [
|
|
3866
|
+
y(g, {
|
|
3867
|
+
modelValue: c.displayName,
|
|
3868
|
+
"onUpdate:modelValue": (w) => c.displayName = w,
|
|
3869
|
+
label: "Display Name"
|
|
3870
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
3871
|
+
y(g, {
|
|
3872
|
+
modelValue: c.subtitle,
|
|
3873
|
+
"onUpdate:modelValue": (w) => c.subtitle = w,
|
|
3874
|
+
label: "Subtitle",
|
|
3875
|
+
"label-mark": "optional"
|
|
3876
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
3877
|
+
y(g, {
|
|
3878
|
+
modelValue: c.icon,
|
|
3879
|
+
"onUpdate:modelValue": (w) => c.icon = w,
|
|
3880
|
+
label: "Icon URL",
|
|
3881
|
+
"label-mark": "optional"
|
|
3882
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
3883
|
+
y(g, {
|
|
3884
|
+
modelValue: c.paymentDescription,
|
|
3885
|
+
"onUpdate:modelValue": (w) => c.paymentDescription = w,
|
|
3886
|
+
label: "Payment Description",
|
|
3887
|
+
"label-mark": "optional"
|
|
3888
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
3889
|
+
y(g, {
|
|
3890
|
+
modelValue: c.paymentTagline,
|
|
3891
|
+
"onUpdate:modelValue": (w) => c.paymentTagline = w,
|
|
3892
|
+
label: "Payment Tagline",
|
|
3893
|
+
"label-mark": "optional"
|
|
3894
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3895
|
+
])
|
|
3896
|
+
]))), 128))
|
|
3897
|
+
]),
|
|
3898
|
+
_: 1
|
|
3899
|
+
}, 8, ["modelValue"]),
|
|
3900
|
+
l.value.length === 0 ? (b(), R("div", io, " No payment methods configured for this terminal. ")) : Y("", !0),
|
|
3901
|
+
l.value.length > 0 ? (b(), R("div", so, [
|
|
3902
|
+
y(k, {
|
|
3903
|
+
variant: "secondary",
|
|
3904
|
+
label: "Reset",
|
|
3905
|
+
icon: "restart_alt",
|
|
3906
|
+
onclick: f
|
|
3907
|
+
}),
|
|
3908
|
+
y(k, {
|
|
3909
|
+
variant: "primary",
|
|
3910
|
+
label: "Save",
|
|
3911
|
+
icon: "save",
|
|
3912
|
+
onclick: p
|
|
3913
|
+
})
|
|
3914
|
+
])) : Y("", !0)
|
|
3915
|
+
]);
|
|
3916
|
+
};
|
|
3917
|
+
}
|
|
3918
|
+
}), co = /* @__PURE__ */ La(uo, [["__scopeId", "data-v-db4182d5"]]), So = /* @__PURE__ */ H({
|
|
3919
|
+
__name: "TerminalSetting",
|
|
3920
|
+
props: {
|
|
3921
|
+
terminalId: {
|
|
3922
|
+
type: String,
|
|
3923
|
+
required: !0
|
|
3924
|
+
}
|
|
3925
|
+
},
|
|
3926
|
+
setup(e) {
|
|
3927
|
+
const a = e, { tab: t } = bt({
|
|
3928
|
+
tab: "information"
|
|
3929
|
+
}), { isLoading: l, startAsyncCall: o } = ht(!0), r = Ma(), n = qt(), p = T();
|
|
3930
|
+
async function s(u) {
|
|
3931
|
+
o(async () => {
|
|
3932
|
+
try {
|
|
3933
|
+
await Ue.updateById(
|
|
3934
|
+
a.terminalId,
|
|
3935
|
+
{
|
|
3936
|
+
name: u.name,
|
|
3937
|
+
status: u.status,
|
|
3938
|
+
ecrs: u.ecrs ?? [],
|
|
3939
|
+
gateways: u.gateways ?? [],
|
|
3940
|
+
ecrIntegrations: u.ecrIntegrations ?? [],
|
|
3941
|
+
qrIntegrations: u.qrIntegrations ?? [],
|
|
3942
|
+
paymentCheckouts: u.paymentCheckouts ?? []
|
|
3943
|
+
}
|
|
3944
|
+
), p.value = await Ue.readById(a.terminalId), n.open({
|
|
3945
|
+
type: "success",
|
|
3946
|
+
message: "Terminal updated successfully"
|
|
3947
|
+
});
|
|
3948
|
+
} catch (v) {
|
|
3949
|
+
n.open({
|
|
3950
|
+
type: "error",
|
|
3951
|
+
title: "Error occurs when update terminal",
|
|
3952
|
+
message: nt(v)
|
|
3953
|
+
});
|
|
3954
|
+
}
|
|
3955
|
+
});
|
|
3956
|
+
}
|
|
3957
|
+
const f = [
|
|
3958
|
+
{
|
|
3959
|
+
label: "Information",
|
|
3960
|
+
value: "information",
|
|
3961
|
+
icon: "overview",
|
|
3962
|
+
render: $a
|
|
3963
|
+
},
|
|
3964
|
+
{
|
|
3965
|
+
label: "Setting Request",
|
|
3966
|
+
value: "settings",
|
|
3967
|
+
icon: "settings",
|
|
3968
|
+
render: Ka,
|
|
3969
|
+
onlyFor: ["TERMINAL"]
|
|
3970
|
+
},
|
|
3971
|
+
{
|
|
3972
|
+
label: "SoftPos Gateway",
|
|
3973
|
+
value: "softpos",
|
|
3974
|
+
icon: "payment",
|
|
3975
|
+
render: an
|
|
3976
|
+
},
|
|
3977
|
+
{
|
|
3978
|
+
label: "ECR Gateway",
|
|
3979
|
+
value: "ecr",
|
|
3980
|
+
icon: "point_of_sale",
|
|
3981
|
+
render: el,
|
|
3982
|
+
onlyFor: ["POS", "KIOSK"]
|
|
3983
|
+
},
|
|
3984
|
+
{
|
|
3985
|
+
label: "QR Gateway",
|
|
3986
|
+
value: "qr",
|
|
3987
|
+
icon: "qr_code",
|
|
3988
|
+
render: rl,
|
|
3989
|
+
onlyFor: ["POS", "KIOSK"]
|
|
3990
|
+
},
|
|
3991
|
+
{
|
|
3992
|
+
label: "Payment Checkout",
|
|
3993
|
+
value: "payment-checkout",
|
|
3994
|
+
icon: "tune",
|
|
3995
|
+
render: co,
|
|
3996
|
+
onlyFor: ["KIOSK", "POS", "TERMINAL"]
|
|
3997
|
+
}
|
|
3998
|
+
];
|
|
3999
|
+
_t().currentCountry;
|
|
4000
|
+
const d = $(() => {
|
|
4001
|
+
var u;
|
|
4002
|
+
return (u = f.find((v) => v.value === t.value)) == null ? void 0 : u.render;
|
|
4003
|
+
});
|
|
4004
|
+
async function m() {
|
|
4005
|
+
o(async () => {
|
|
4006
|
+
p.value = await Ue.readById(a.terminalId);
|
|
4007
|
+
});
|
|
4008
|
+
}
|
|
4009
|
+
const i = $(() => f.filter((u) => {
|
|
4010
|
+
var v;
|
|
4011
|
+
return !u.onlyFor || u.onlyFor.includes(((v = p.value) == null ? void 0 : v.deviceType) ?? "");
|
|
4012
|
+
}));
|
|
4013
|
+
return re(m), (u, v) => {
|
|
4014
|
+
var k, c;
|
|
4015
|
+
const g = _("FmTabs");
|
|
4016
|
+
return b(), N(Pa, {
|
|
4017
|
+
title: `${(k = p.value) == null ? void 0 : k.deviceType} (${(c = p.value) == null ? void 0 : c._id})`,
|
|
4018
|
+
loading: V(l),
|
|
4019
|
+
onBack: V(r).back
|
|
4020
|
+
}, {
|
|
4021
|
+
default: ae(() => [
|
|
4022
|
+
y(g, {
|
|
4023
|
+
"model-value": V(t),
|
|
4024
|
+
"onUpdate:modelValue": v[0] || (v[0] = (w) => Oe(t) ? t.value = w : null),
|
|
4025
|
+
class: "mb-6",
|
|
4026
|
+
items: i.value
|
|
4027
|
+
}, null, 8, ["model-value", "items"]),
|
|
4028
|
+
V(t) ? (b(), N(vt(d.value), gt(yt({ key: 0 }, {
|
|
4029
|
+
terminal: p.value,
|
|
4030
|
+
onUpdate: s
|
|
4031
|
+
})), null, 16)) : Y("", !0)
|
|
4032
|
+
]),
|
|
4033
|
+
_: 1
|
|
4034
|
+
}, 8, ["title", "loading", "onBack"]);
|
|
4035
|
+
};
|
|
4036
|
+
}
|
|
4037
|
+
});
|
|
4038
|
+
export {
|
|
4039
|
+
So as default
|
|
4040
|
+
};
|