superapp-miniapp-invoke-native 1.0.49 → 1.0.51
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/lib/main.js +587 -2
- package/lib/main.umd.cjs +1 -1
- package/package.json +2 -3
- package/lib/chunk/16ebb4f1.js +0 -4
- package/lib/chunk/5643c678.js +0 -28
- package/lib/chunk/b68136c6.js +0 -473
- package/lib/chunk/cb9a50d4.js +0 -4
- package/lib/chunk/ecff8422.js +0 -4
- package/module.d.ts +0 -1
package/lib/main.js
CHANGED
|
@@ -1,4 +1,589 @@
|
|
|
1
|
-
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var me = Object.getPrototypeOf;
|
|
3
|
+
var fe = Reflect.get;
|
|
4
|
+
var we = (t, e, n) => e in t ? ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
5
|
+
var D = (t, e, n) => (we(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
6
|
+
var F = (t, e, n) => fe(me(t), n, e);
|
|
7
|
+
var o = (t, e, n) => new Promise((r, a) => {
|
|
8
|
+
var i = (u) => {
|
|
9
|
+
try {
|
|
10
|
+
s(n.next(u));
|
|
11
|
+
} catch (p) {
|
|
12
|
+
a(p);
|
|
13
|
+
}
|
|
14
|
+
}, d = (u) => {
|
|
15
|
+
try {
|
|
16
|
+
s(n.throw(u));
|
|
17
|
+
} catch (p) {
|
|
18
|
+
a(p);
|
|
19
|
+
}
|
|
20
|
+
}, s = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(i, d);
|
|
21
|
+
s((n = n.apply(t, e)).next());
|
|
22
|
+
});
|
|
23
|
+
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
24
|
+
const he = (t) => t.CapacitorPlatforms = ((e) => {
|
|
25
|
+
const n = /* @__PURE__ */ new Map();
|
|
26
|
+
n.set("web", { name: "web" });
|
|
27
|
+
const r = e.CapacitorPlatforms || { currentPlatform: { name: "web" }, platforms: n };
|
|
28
|
+
return r.addPlatform = (a, i) => {
|
|
29
|
+
r.platforms.set(a, i);
|
|
30
|
+
}, r.setPlatform = (a) => {
|
|
31
|
+
r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
|
|
32
|
+
}, r;
|
|
33
|
+
})(t), oe = he(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {});
|
|
34
|
+
var S;
|
|
35
|
+
oe.addPlatform, oe.setPlatform, function(t) {
|
|
36
|
+
t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
|
|
37
|
+
}(S || (S = {}));
|
|
38
|
+
class J extends Error {
|
|
39
|
+
constructor(e, n, r) {
|
|
40
|
+
super(e), this.message = e, this.code = n, this.data = r;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const ve = (t) => {
|
|
44
|
+
var e, n, r, a, i;
|
|
45
|
+
const d = t.CapacitorCustomPlatform || null, s = t.Capacitor || {}, u = s.Plugins = s.Plugins || {}, p = t.CapacitorPlatforms, h = ((e = p == null ? void 0 : p.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => d !== null ? d.name : ((l) => {
|
|
46
|
+
var c, m;
|
|
47
|
+
return l != null && l.androidBridge ? "android" : !((m = (c = l == null ? void 0 : l.webkit) === null || c === void 0 ? void 0 : c.messageHandlers) === null || m === void 0) && m.bridge ? "ios" : "web";
|
|
48
|
+
})(t)), w = ((n = p == null ? void 0 : p.currentPlatform) === null || n === void 0 ? void 0 : n.isNativePlatform) || (() => h() !== "web"), C = ((r = p == null ? void 0 : p.currentPlatform) === null || r === void 0 ? void 0 : r.isPluginAvailable) || ((l) => {
|
|
49
|
+
const c = v.get(l);
|
|
50
|
+
return !!(c != null && c.platforms.has(h())) || !!L(l);
|
|
51
|
+
}), L = ((a = p == null ? void 0 : p.currentPlatform) === null || a === void 0 ? void 0 : a.getPluginHeader) || ((l) => {
|
|
52
|
+
var c;
|
|
53
|
+
return (c = s.PluginHeaders) === null || c === void 0 ? void 0 : c.find((m) => m.name === l);
|
|
54
|
+
}), v = /* @__PURE__ */ new Map(), g = ((i = p == null ? void 0 : p.currentPlatform) === null || i === void 0 ? void 0 : i.registerPlugin) || ((l, c = {}) => {
|
|
55
|
+
const m = v.get(l);
|
|
56
|
+
if (m)
|
|
57
|
+
return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`), m.proxy;
|
|
58
|
+
const b = h(), N = L(l);
|
|
59
|
+
let A;
|
|
60
|
+
const W = (P) => {
|
|
61
|
+
let O;
|
|
62
|
+
const E = (...x) => {
|
|
63
|
+
const T = (() => o(void 0, null, function* () {
|
|
64
|
+
return !A && b in c ? A = A = typeof c[b] == "function" ? yield c[b]() : c[b] : d !== null && !A && "web" in c && (A = A = typeof c.web == "function" ? yield c.web() : c.web), A;
|
|
65
|
+
}))().then((I) => {
|
|
66
|
+
const re = ((_, H) => {
|
|
67
|
+
var z, G;
|
|
68
|
+
if (!N) {
|
|
69
|
+
if (_)
|
|
70
|
+
return (G = _[H]) === null || G === void 0 ? void 0 : G.bind(_);
|
|
71
|
+
throw new J(`"${l}" plugin is not implemented on ${b}`, S.Unimplemented);
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
const se = N == null ? void 0 : N.methods.find((M) => H === M.name);
|
|
75
|
+
if (se)
|
|
76
|
+
return se.rtype === "promise" ? (M) => s.nativePromise(l, H.toString(), M) : (M, pe) => s.nativeCallback(l, H.toString(), M, pe);
|
|
77
|
+
if (_)
|
|
78
|
+
return (z = _[H]) === null || z === void 0 ? void 0 : z.bind(_);
|
|
79
|
+
}
|
|
80
|
+
})(I, P);
|
|
81
|
+
if (re) {
|
|
82
|
+
const _ = re(...x);
|
|
83
|
+
return O = _ == null ? void 0 : _.remove, _;
|
|
84
|
+
}
|
|
85
|
+
throw new J(`"${l}.${P}()" is not implemented on ${b}`, S.Unimplemented);
|
|
86
|
+
});
|
|
87
|
+
return P === "addListener" && (T.remove = () => o(void 0, null, function* () {
|
|
88
|
+
return O();
|
|
89
|
+
})), T;
|
|
90
|
+
};
|
|
91
|
+
return E.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(E, "name", { value: P, writable: !1, configurable: !1 }), E;
|
|
92
|
+
}, te = W("addListener"), ae = W("removeListener"), ce = (P, O) => {
|
|
93
|
+
const E = te({ eventName: P }, O), x = () => o(void 0, null, function* () {
|
|
94
|
+
const I = yield E;
|
|
95
|
+
ae({ eventName: P, callbackId: I }, O);
|
|
96
|
+
}), T = new Promise((I) => E.then(() => I({ remove: x })));
|
|
97
|
+
return T.remove = () => o(void 0, null, function* () {
|
|
98
|
+
console.warn("Using addListener() without 'await' is deprecated."), yield x();
|
|
99
|
+
}), T;
|
|
100
|
+
}, q = new Proxy({}, { get(P, O) {
|
|
101
|
+
switch (O) {
|
|
102
|
+
case "$$typeof":
|
|
103
|
+
return;
|
|
104
|
+
case "toJSON":
|
|
105
|
+
return () => ({});
|
|
106
|
+
case "addListener":
|
|
107
|
+
return N ? ce : te;
|
|
108
|
+
case "removeListener":
|
|
109
|
+
return ae;
|
|
110
|
+
default:
|
|
111
|
+
return W(O);
|
|
112
|
+
}
|
|
113
|
+
} });
|
|
114
|
+
return u[l] = q, v.set(l, { name: l, proxy: q, platforms: /* @__PURE__ */ new Set([...Object.keys(c), ...N ? [b] : []]) }), q;
|
|
115
|
+
});
|
|
116
|
+
return s.convertFileSrc || (s.convertFileSrc = (l) => l), s.getPlatform = h, s.handleError = (l) => t.console.error(l), s.isNativePlatform = w, s.isPluginAvailable = C, s.pluginMethodNoop = (l, c, m) => Promise.reject(`${m} does not have an implementation of "${c}".`), s.registerPlugin = g, s.Exception = J, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
|
|
117
|
+
}, ge = (t) => t.Capacitor = ve(t), f = ge(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Z = f.registerPlugin;
|
|
118
|
+
f.Plugins;
|
|
119
|
+
class K {
|
|
120
|
+
constructor(e) {
|
|
121
|
+
this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
|
|
122
|
+
}
|
|
123
|
+
addListener(e, n) {
|
|
124
|
+
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(n);
|
|
125
|
+
const r = this.windowListeners[e];
|
|
126
|
+
r && !r.registered && this.addWindowListener(r);
|
|
127
|
+
const a = () => o(this, null, function* () {
|
|
128
|
+
return this.removeListener(e, n);
|
|
129
|
+
}), i = Promise.resolve({ remove: a });
|
|
130
|
+
return Object.defineProperty(i, "remove", { value: () => o(this, null, function* () {
|
|
131
|
+
console.warn("Using addListener() without 'await' is deprecated."), yield a();
|
|
132
|
+
}) }), i;
|
|
133
|
+
}
|
|
134
|
+
removeAllListeners() {
|
|
135
|
+
return o(this, null, function* () {
|
|
136
|
+
this.listeners = {};
|
|
137
|
+
for (const e in this.windowListeners)
|
|
138
|
+
this.removeWindowListener(this.windowListeners[e]);
|
|
139
|
+
this.windowListeners = {};
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
notifyListeners(e, n) {
|
|
143
|
+
const r = this.listeners[e];
|
|
144
|
+
r && r.forEach((a) => a(n));
|
|
145
|
+
}
|
|
146
|
+
hasListeners(e) {
|
|
147
|
+
return !!this.listeners[e].length;
|
|
148
|
+
}
|
|
149
|
+
registerWindowListener(e, n) {
|
|
150
|
+
this.windowListeners[n] = { registered: !1, windowEventName: e, pluginEventName: n, handler: (r) => {
|
|
151
|
+
this.notifyListeners(n, r);
|
|
152
|
+
} };
|
|
153
|
+
}
|
|
154
|
+
unimplemented(e = "not implemented") {
|
|
155
|
+
return new f.Exception(e, S.Unimplemented);
|
|
156
|
+
}
|
|
157
|
+
unavailable(e = "not available") {
|
|
158
|
+
return new f.Exception(e, S.Unavailable);
|
|
159
|
+
}
|
|
160
|
+
removeListener(e, n) {
|
|
161
|
+
return o(this, null, function* () {
|
|
162
|
+
const r = this.listeners[e];
|
|
163
|
+
if (!r)
|
|
164
|
+
return;
|
|
165
|
+
const a = r.indexOf(n);
|
|
166
|
+
this.listeners[e].splice(a, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
addWindowListener(e) {
|
|
170
|
+
window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
|
|
171
|
+
}
|
|
172
|
+
removeWindowListener(e) {
|
|
173
|
+
e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const ie = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), de = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
177
|
+
class be extends K {
|
|
178
|
+
getCookies() {
|
|
179
|
+
return o(this, null, function* () {
|
|
180
|
+
const e = document.cookie, n = {};
|
|
181
|
+
return e.split(";").forEach((r) => {
|
|
182
|
+
if (r.length <= 0)
|
|
183
|
+
return;
|
|
184
|
+
let [a, i] = r.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
|
185
|
+
a = de(a).trim(), i = de(i).trim(), n[a] = i;
|
|
186
|
+
}), n;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
setCookie(e) {
|
|
190
|
+
return o(this, null, function* () {
|
|
191
|
+
try {
|
|
192
|
+
const n = ie(e.key), r = ie(e.value), a = `; expires=${(e.expires || "").replace("expires=", "")}`, i = (e.path || "/").replace("path=", ""), d = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
|
193
|
+
document.cookie = `${n}=${r || ""}${a}; path=${i}; ${d};`;
|
|
194
|
+
} catch (n) {
|
|
195
|
+
return Promise.reject(n);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
deleteCookie(e) {
|
|
200
|
+
return o(this, null, function* () {
|
|
201
|
+
try {
|
|
202
|
+
document.cookie = `${e.key}=; Max-Age=0`;
|
|
203
|
+
} catch (n) {
|
|
204
|
+
return Promise.reject(n);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
clearCookies() {
|
|
209
|
+
return o(this, null, function* () {
|
|
210
|
+
try {
|
|
211
|
+
const e = document.cookie.split(";") || [];
|
|
212
|
+
for (const n of e)
|
|
213
|
+
document.cookie = n.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
|
|
214
|
+
} catch (e) {
|
|
215
|
+
return Promise.reject(e);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
clearAllCookies() {
|
|
220
|
+
return o(this, null, function* () {
|
|
221
|
+
try {
|
|
222
|
+
yield this.clearCookies();
|
|
223
|
+
} catch (e) {
|
|
224
|
+
return Promise.reject(e);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
Z("CapacitorCookies", { web: () => new be() });
|
|
230
|
+
const _e = (t, e = {}) => {
|
|
231
|
+
const n = Object.assign({ method: t.method || "GET", headers: t.headers }, e), r = ((a = {}) => {
|
|
232
|
+
const i = Object.keys(a);
|
|
233
|
+
return Object.keys(a).map((d) => d.toLocaleLowerCase()).reduce((d, s, u) => (d[s] = a[i[u]], d), {});
|
|
234
|
+
})(t.headers)["content-type"] || "";
|
|
235
|
+
if (typeof t.data == "string")
|
|
236
|
+
n.body = t.data;
|
|
237
|
+
else if (r.includes("application/x-www-form-urlencoded")) {
|
|
238
|
+
const a = new URLSearchParams();
|
|
239
|
+
for (const [i, d] of Object.entries(t.data || {}))
|
|
240
|
+
a.set(i, d);
|
|
241
|
+
n.body = a.toString();
|
|
242
|
+
} else if (r.includes("multipart/form-data")) {
|
|
243
|
+
const a = new FormData();
|
|
244
|
+
if (t.data instanceof FormData)
|
|
245
|
+
t.data.forEach((d, s) => {
|
|
246
|
+
a.append(s, d);
|
|
247
|
+
});
|
|
248
|
+
else
|
|
249
|
+
for (const d of Object.keys(t.data))
|
|
250
|
+
a.append(d, t.data[d]);
|
|
251
|
+
n.body = a;
|
|
252
|
+
const i = new Headers(n.headers);
|
|
253
|
+
i.delete("content-type"), n.headers = i;
|
|
254
|
+
} else
|
|
255
|
+
(r.includes("application/json") || typeof t.data == "object") && (n.body = JSON.stringify(t.data));
|
|
256
|
+
return n;
|
|
257
|
+
};
|
|
258
|
+
class ye extends K {
|
|
259
|
+
request(e) {
|
|
260
|
+
return o(this, null, function* () {
|
|
261
|
+
const n = _e(e, e.webFetchExtra), r = ((w, C = !0) => w ? Object.entries(w).reduce((L, v) => {
|
|
262
|
+
const [g, l] = v;
|
|
263
|
+
let c, m;
|
|
264
|
+
return Array.isArray(l) ? (m = "", l.forEach((b) => {
|
|
265
|
+
c = C ? encodeURIComponent(b) : b, m += `${g}=${c}&`;
|
|
266
|
+
}), m.slice(0, -1)) : (c = C ? encodeURIComponent(l) : l, m = `${g}=${c}`), `${L}&${m}`;
|
|
267
|
+
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), a = r ? `${e.url}?${r}` : e.url, i = yield fetch(a, n), d = i.headers.get("content-type") || "";
|
|
268
|
+
let s, u, { responseType: p = "text" } = i.ok ? e : {};
|
|
269
|
+
switch (d.includes("application/json") && (p = "json"), p) {
|
|
270
|
+
case "arraybuffer":
|
|
271
|
+
case "blob":
|
|
272
|
+
u = yield i.blob(), s = yield ((w) => o(this, null, function* () {
|
|
273
|
+
return new Promise((C, L) => {
|
|
274
|
+
const v = new FileReader();
|
|
275
|
+
v.onload = () => {
|
|
276
|
+
const g = v.result;
|
|
277
|
+
C(g.indexOf(",") >= 0 ? g.split(",")[1] : g);
|
|
278
|
+
}, v.onerror = (g) => L(g), v.readAsDataURL(w);
|
|
279
|
+
});
|
|
280
|
+
}))(u);
|
|
281
|
+
break;
|
|
282
|
+
case "json":
|
|
283
|
+
s = yield i.json();
|
|
284
|
+
break;
|
|
285
|
+
default:
|
|
286
|
+
s = yield i.text();
|
|
287
|
+
}
|
|
288
|
+
const h = {};
|
|
289
|
+
return i.headers.forEach((w, C) => {
|
|
290
|
+
h[C] = w;
|
|
291
|
+
}), { data: s, headers: h, status: i.status, url: i.url };
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
get(e) {
|
|
295
|
+
return o(this, null, function* () {
|
|
296
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
post(e) {
|
|
300
|
+
return o(this, null, function* () {
|
|
301
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
put(e) {
|
|
305
|
+
return o(this, null, function* () {
|
|
306
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
patch(e) {
|
|
310
|
+
return o(this, null, function* () {
|
|
311
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
delete(e) {
|
|
315
|
+
return o(this, null, function* () {
|
|
316
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function Q() {
|
|
321
|
+
return f.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
|
|
322
|
+
}
|
|
323
|
+
Z("CapacitorHttp", { web: () => new ye() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
|
|
324
|
+
Z("Portals", { web: () => Promise.resolve().then(function() {
|
|
325
|
+
return Pe;
|
|
326
|
+
}).then((t) => new t.PortalsWeb()) });
|
|
327
|
+
const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends K {
|
|
328
|
+
publishNative(t) {
|
|
329
|
+
return o(this, null, function* () {
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
} });
|
|
333
|
+
var j = ((t) => (t.DEV = "dev", t.SIT = "sit", t.UAT = "uat", t.PROD = "prod", t.TEST = "test", t))(j || {}), R = ((t) => (t.EU = "eu", t.ASIA = "asia", t))(R || {});
|
|
334
|
+
const X = (t) => {
|
|
335
|
+
var e, n, r;
|
|
336
|
+
if (typeof window != "undefined" && Q && ((e = Q()) != null && e.value)) {
|
|
337
|
+
const a = (r = (n = Q()) == null ? void 0 : n.value) != null ? r : null;
|
|
338
|
+
if (!a)
|
|
339
|
+
return void console.error("native initialContext is undefine");
|
|
340
|
+
if (!t)
|
|
341
|
+
return void console.error("initialContext call back is undefine");
|
|
342
|
+
t(a);
|
|
343
|
+
}
|
|
344
|
+
}, ke = (t) => new Promise((e) => o(void 0, null, function* () {
|
|
345
|
+
let n = null;
|
|
346
|
+
n = t != null && t.mockData ? t.mockData : ((r, { asiaUatData: a, euSitData: i, euUatData: d }) => {
|
|
347
|
+
var h, w;
|
|
348
|
+
const s = (h = r.mockServerInfo) == null ? void 0 : h.env, u = (w = r.mockServerInfo) == null ? void 0 : w.area;
|
|
349
|
+
let p = null;
|
|
350
|
+
return s && u && (R.ASIA === u ? j.UAT === s && (p = a) : R.EU === u && (j.SIT === s ? p = i : j.UAT === s && (p = d))), p;
|
|
351
|
+
})(t, { asiaUatData: yield Promise.resolve().then(() => Ee), euSitData: yield Promise.resolve().then(() => Se), euUatData: yield Promise.resolve().then(() => Ne) }), e(n ? n != null && n.default ? n == null ? void 0 : n.default : n : null);
|
|
352
|
+
})), U = class U {
|
|
353
|
+
constructor() {
|
|
354
|
+
D(this, "nativeAppInfoConfig");
|
|
355
|
+
this.nativeAppInfoConfig = U.defaultNativeAppInfoConfig;
|
|
356
|
+
}
|
|
357
|
+
getIsNativeHandle() {
|
|
358
|
+
return o(this, null, function* () {
|
|
359
|
+
return yield (() => {
|
|
360
|
+
let e = !1;
|
|
361
|
+
return X((n) => {
|
|
362
|
+
e = !!(n != null && n.isNative);
|
|
363
|
+
}), e;
|
|
364
|
+
})();
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
specifiedPageHandle(e) {
|
|
368
|
+
return o(this, null, function* () {
|
|
369
|
+
yield (({ cb: n }) => {
|
|
370
|
+
X((r) => {
|
|
371
|
+
var s;
|
|
372
|
+
if (!(r != null && r.params))
|
|
373
|
+
return void console.error("native params is undefine");
|
|
374
|
+
const a = (s = JSON.parse(r.params)) != null ? s : null;
|
|
375
|
+
if (!a)
|
|
376
|
+
return;
|
|
377
|
+
const { params: i, routeName: d } = a;
|
|
378
|
+
i && d && (n ? n(a) : console.error("call back is undefine"));
|
|
379
|
+
});
|
|
380
|
+
})(e);
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
nativeAppInfoHandle(e) {
|
|
384
|
+
return o(this, null, function* () {
|
|
385
|
+
return this.nativeAppInfoConfig = e != null && e.mockServerInfo || e != null && e.mockData ? e : U.defaultNativeAppInfoConfig, (yield this.getIsNativeHandle()) ? yield (() => {
|
|
386
|
+
let n = null;
|
|
387
|
+
return X((r) => {
|
|
388
|
+
n = r != null ? r : null;
|
|
389
|
+
}), n;
|
|
390
|
+
})() : yield ke(this.nativeAppInfoConfig);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
D(U, "defaultNativeAppInfoConfig", { mockServerInfo: { area: R.ASIA, env: j.UAT } });
|
|
395
|
+
let ee = U;
|
|
396
|
+
const ne = () => {
|
|
397
|
+
let t = null;
|
|
398
|
+
return t = typeof window == "undefined" ? {} : window, t;
|
|
399
|
+
}, V = "CommunicatePlugin", y = f.registerPlugin(V, { web: () => Promise.resolve().then(() => Te).then((t) => new t.PluginsWeb()) }), k = ne();
|
|
400
|
+
k.addListenerBackHandle = () => null;
|
|
401
|
+
const Ce = (t) => {
|
|
402
|
+
k != null && k.addListenerBackHandle && k.addListenerBackHandle(), setTimeout(() => {
|
|
403
|
+
((e) => o(void 0, null, function* () {
|
|
404
|
+
k != null && k.addListenerBackHandle && e && (k.addListenerBackHandle = yield ((n) => o(void 0, null, function* () {
|
|
405
|
+
if (f.addListener) {
|
|
406
|
+
const r = yield f.addListener(V, "nativeSendBack", (a) => n && n(a));
|
|
407
|
+
return r != null && r.remove ? r.remove : () => null;
|
|
408
|
+
}
|
|
409
|
+
}))(e));
|
|
410
|
+
}))(t);
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
let le;
|
|
414
|
+
const Y = (t) => {
|
|
415
|
+
le = (e) => {
|
|
416
|
+
t && t(e);
|
|
417
|
+
};
|
|
418
|
+
}, $ = ne();
|
|
419
|
+
$.addListenerHomeHandle = () => null;
|
|
420
|
+
const Oe = (t) => {
|
|
421
|
+
$.addListenerHomeHandle && $.addListenerHomeHandle(), setTimeout(() => {
|
|
422
|
+
((e) => o(void 0, null, function* () {
|
|
423
|
+
e && ($.addListenerHomeHandle = yield ((n) => o(void 0, null, function* () {
|
|
424
|
+
if (f.addListener) {
|
|
425
|
+
const r = yield f.addListener(V, "nativeSendHome", (a) => n && n(a));
|
|
426
|
+
return r != null && r.remove ? r.remove : () => null;
|
|
427
|
+
}
|
|
428
|
+
}))(e));
|
|
429
|
+
}))(t);
|
|
430
|
+
});
|
|
431
|
+
}, B = ne();
|
|
432
|
+
B.removeAddListenerFab = () => null;
|
|
433
|
+
const Ae = (t) => {
|
|
434
|
+
var n, r;
|
|
435
|
+
B.removeAddListenerFab && B.removeAddListenerFab();
|
|
436
|
+
const e = [];
|
|
437
|
+
(n = y.showFABMenu) == null || n.call(y, { fabMenu: e }), t && ((r = Object.keys(t)) != null && r.length) && (Object.keys(t).forEach((a) => {
|
|
438
|
+
e.push({ icon: t[a].icon, id: t[a].id, name: t[a].title });
|
|
439
|
+
}), queueMicrotask(() => {
|
|
440
|
+
var a;
|
|
441
|
+
(a = y.showFABMenu) == null || a.call(y, { fabMenu: e });
|
|
442
|
+
}), setTimeout(() => {
|
|
443
|
+
((a) => o(void 0, null, function* () {
|
|
444
|
+
a && (B.removeAddListenerFab = yield ((i) => o(void 0, null, function* () {
|
|
445
|
+
if (f.addListener) {
|
|
446
|
+
const d = yield f.addListener(V, "nativeSendFab", (s) => i && i(s));
|
|
447
|
+
return d != null && d.remove ? d.remove : () => null;
|
|
448
|
+
}
|
|
449
|
+
}))(a));
|
|
450
|
+
}))((a) => {
|
|
451
|
+
let i;
|
|
452
|
+
a && a.id && Object.keys(t).forEach((d) => {
|
|
453
|
+
a.id === t[d].id && (i = t[d].fn);
|
|
454
|
+
}), i && i();
|
|
455
|
+
});
|
|
456
|
+
}, 10));
|
|
457
|
+
};
|
|
458
|
+
class Le {
|
|
459
|
+
homeIsClick(e) {
|
|
460
|
+
return o(this, null, function* () {
|
|
461
|
+
y.homeIsClick(e);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
openMinApp(e) {
|
|
465
|
+
return o(this, null, function* () {
|
|
466
|
+
return yield y.openMinApp(e);
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
showTitle(e) {
|
|
470
|
+
return o(this, null, function* () {
|
|
471
|
+
return yield y.showTitle(e);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
showSubMask(e) {
|
|
475
|
+
return o(this, null, function* () {
|
|
476
|
+
return yield y.showSubMask(e);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
backBtnApiHooks(e) {
|
|
480
|
+
return (({ backBtnCb: n, router: r }) => ({ initBackBtnHandle: () => {
|
|
481
|
+
r && r.afterEach((a) => {
|
|
482
|
+
Ce(() => {
|
|
483
|
+
a != null && a.name && le(a.name);
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
}, registerBackBtnHandle: (a) => {
|
|
487
|
+
const { onMounted: i, onUnmounted: d } = a;
|
|
488
|
+
i(() => {
|
|
489
|
+
Y((s) => {
|
|
490
|
+
n && n(s);
|
|
491
|
+
});
|
|
492
|
+
}), d(() => {
|
|
493
|
+
Y && Y(() => "");
|
|
494
|
+
});
|
|
495
|
+
} }))(e);
|
|
496
|
+
}
|
|
497
|
+
homeHandle(e) {
|
|
498
|
+
Oe(e);
|
|
499
|
+
}
|
|
500
|
+
setFabHandle(e) {
|
|
501
|
+
Ae(e);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
const He = new class e extends ee {
|
|
505
|
+
constructor() {
|
|
506
|
+
super();
|
|
507
|
+
D(this, "communicatePlugins", new Le());
|
|
508
|
+
}
|
|
509
|
+
getIsNativeHandle() {
|
|
510
|
+
return o(this, null, function* () {
|
|
511
|
+
return yield F(e.prototype, this, "getIsNativeHandle").call(this);
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
specifiedPageHandle(n) {
|
|
515
|
+
return o(this, null, function* () {
|
|
516
|
+
return yield F(e.prototype, this, "specifiedPageHandle").call(this, n);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
nativeAppInfoHandle(n) {
|
|
520
|
+
return o(this, null, function* () {
|
|
521
|
+
return yield F(e.prototype, this, "nativeAppInfoHandle").call(this, n);
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
homeIsClick(n) {
|
|
525
|
+
return o(this, null, function* () {
|
|
526
|
+
this.communicatePlugins.homeIsClick(n);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
openMinApp(n) {
|
|
530
|
+
return o(this, null, function* () {
|
|
531
|
+
return yield this.communicatePlugins.openMinApp(n);
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
showTitle(n) {
|
|
535
|
+
return o(this, null, function* () {
|
|
536
|
+
return yield this.communicatePlugins.showTitle(n);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
showSubMask(n) {
|
|
540
|
+
return o(this, null, function* () {
|
|
541
|
+
return yield this.communicatePlugins.showSubMask(n);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
backBtnApiHooks(n) {
|
|
545
|
+
return this.communicatePlugins.backBtnApiHooks(n);
|
|
546
|
+
}
|
|
547
|
+
homeHandle(n) {
|
|
548
|
+
this.communicatePlugins.homeHandle(n);
|
|
549
|
+
}
|
|
550
|
+
setFabHandle(n) {
|
|
551
|
+
this.communicatePlugins.setFabHandle(n);
|
|
552
|
+
}
|
|
553
|
+
}(), Ee = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "WTCHK", tenants: [{ store_detail_list: [{ name: "APELDOORN HOOFDSTRAAT 136", code: "3462" }], name: "WTCHK", stores: ["3462"], timezone: "Europe/Amsterdam", code: "WTCHK" }] }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "asia", serverEnv: "uat" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { name: "APELDOORN HOOFDSTRAAT 3462", code: "3462" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Se = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Ne = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Te = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends K {
|
|
554
|
+
homeIsClick() {
|
|
555
|
+
return o(this, null, function* () {
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
openMinApp(t) {
|
|
559
|
+
return o(this, null, function* () {
|
|
560
|
+
return new Promise((e) => {
|
|
561
|
+
e(t);
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
showTitle(t) {
|
|
566
|
+
return o(this, null, function* () {
|
|
567
|
+
return new Promise((e) => {
|
|
568
|
+
e(t);
|
|
569
|
+
});
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
showFABMenu(t) {
|
|
573
|
+
return o(this, null, function* () {
|
|
574
|
+
return new Promise((e) => {
|
|
575
|
+
e(t);
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
showSubMask(t) {
|
|
580
|
+
return o(this, null, function* () {
|
|
581
|
+
return new Promise((e) => {
|
|
582
|
+
e(t);
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
} }, Symbol.toStringTag, { value: "Module" }));
|
|
2
587
|
export {
|
|
3
|
-
|
|
588
|
+
He as default
|
|
4
589
|
};
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,u){typeof exports=="object"&&typeof module<"u"?module.exports=u():typeof define=="function"&&define.amd?define(u):(w=typeof globalThis<"u"?globalThis:w||self).main=u()})(this,function(){"use strict";var Le=Object.defineProperty;var Ee=(w,u,m)=>u in w?Le(w,u,{enumerable:!0,configurable:!0,writable:!0,value:m}):w[u]=m;var V=(w,u,m)=>(Ee(w,typeof u!="symbol"?u+"":u,m),m);/*! Capacitor: https://capacitorjs.com/ - MIT License */const w=t=>t.CapacitorPlatforms=(e=>{const n=new Map;n.set("web",{name:"web"});const a=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:n};return a.addPlatform=(r,s)=>{a.platforms.set(r,s)},a.setPlatform=r=>{a.platforms.has(r)&&(a.currentPlatform=a.platforms.get(r))},a})(t),u=w(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});var m;u.addPlatform,u.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(m||(m={}));class W extends Error{constructor(e,n,a){super(e),this.message=e,this.code=n,this.data=a}}const le=t=>{var e,n,a,r,s;const i=t.CapacitorCustomPlatform||null,o=t.Capacitor||{},v=o.Plugins=o.Plugins||{},c=t.CapacitorPlatforms,b=((e=c==null?void 0:c.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>i!==null?i.name:(d=>{var l,p;return d!=null&&d.androidBridge?"android":!((p=(l=d==null?void 0:d.webkit)===null||l===void 0?void 0:l.messageHandlers)===null||p===void 0)&&p.bridge?"ios":"web"})(t)),h=((n=c==null?void 0:c.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||(()=>b()!=="web"),A=((a=c==null?void 0:c.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||(d=>{const l=_.get(d);return!!(l!=null&&l.platforms.has(b()))||!!S(d)}),S=((r=c==null?void 0:c.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||(d=>{var l;return(l=o.PluginHeaders)===null||l===void 0?void 0:l.find(p=>p.name===d)}),_=new Map,y=((s=c==null?void 0:c.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((d,l={})=>{const p=_.get(d);if(p)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),p.proxy;const P=b(),H=S(d);let E;const Y=O=>{let L;const N=(...K)=>{const j=(async()=>(!E&&P in l?E=E=typeof l[P]=="function"?await l[P]():l[P]:i!==null&&!E&&"web"in l&&(E=E=typeof l.web=="function"?await l.web():l.web),E))().then(M=>{const ie=((k,U)=>{var ee,te;if(!H){if(k)return(te=k[U])===null||te===void 0?void 0:te.bind(k);throw new W(`"${d}" plugin is not implemented on ${P}`,m.Unimplemented)}{const de=H==null?void 0:H.methods.find(x=>U===x.name);if(de)return de.rtype==="promise"?x=>o.nativePromise(d,U.toString(),x):(x,Ae)=>o.nativeCallback(d,U.toString(),x,Ae);if(k)return(ee=k[U])===null||ee===void 0?void 0:ee.bind(k)}})(M,O);if(ie){const k=ie(...K);return L=k==null?void 0:k.remove,k}throw new W(`"${d}.${O}()" is not implemented on ${P}`,m.Unimplemented)});return O==="addListener"&&(j.remove=async()=>L()),j};return N.toString=()=>`${O.toString()}() { [capacitor code] }`,Object.defineProperty(N,"name",{value:O,writable:!1,configurable:!1}),N},se=Y("addListener"),oe=Y("removeListener"),Oe=(O,L)=>{const N=se({eventName:O},L),K=async()=>{const M=await N;oe({eventName:O,callbackId:M},L)},j=new Promise(M=>N.then(()=>M({remove:K})));return j.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await K()},j},Z=new Proxy({},{get(O,L){switch(L){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return H?Oe:se;case"removeListener":return oe;default:return Y(L)}}});return v[d]=Z,_.set(d,{name:d,proxy:Z,platforms:new Set([...Object.keys(l),...H?[P]:[]])}),Z});return o.convertFileSrc||(o.convertFileSrc=d=>d),o.getPlatform=b,o.handleError=d=>t.console.error(d),o.isNativePlatform=h,o.isPluginAvailable=A,o.pluginMethodNoop=(d,l,p)=>Promise.reject(`${p} does not have an implementation of "${l}".`),o.registerPlugin=y,o.Exception=W,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},ce=t=>t.Capacitor=le(t),f=ce(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),q=f.registerPlugin;f.Plugins;class D{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(n);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a);const r=async()=>this.removeListener(e,n),s=Promise.resolve({remove:r});return Object.defineProperty(s,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await r()}}),s}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,n){const a=this.listeners[e];a&&a.forEach(r=>r(n))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:a=>{this.notifyListeners(n,a)}}}unimplemented(e="not implemented"){return new f.Exception(e,m.Unimplemented)}unavailable(e="not available"){return new f.Exception(e,m.Unavailable)}async removeListener(e,n){const a=this.listeners[e];if(!a)return;const r=a.indexOf(n);this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const ne=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ae=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class pe extends D{async getCookies(){const e=document.cookie,n={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[r,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=ae(r).trim(),s=ae(s).trim(),n[r]=s}),n}async setCookie(e){try{const n=ne(e.key),a=ne(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${a||""}${r}; path=${s}; ${i};`}catch(n){return Promise.reject(n)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}q("CapacitorCookies",{web:()=>new pe});const ue=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),a=((r={})=>{const s=Object.keys(r);return Object.keys(r).map(i=>i.toLocaleLowerCase()).reduce((i,o,v)=>(i[o]=r[s[v]],i),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(a.includes("application/x-www-form-urlencoded")){const r=new URLSearchParams;for(const[s,i]of Object.entries(t.data||{}))r.set(s,i);n.body=r.toString()}else if(a.includes("multipart/form-data")){const r=new FormData;if(t.data instanceof FormData)t.data.forEach((i,o)=>{r.append(o,i)});else for(const i of Object.keys(t.data))r.append(i,t.data[i]);n.body=r;const s=new Headers(n.headers);s.delete("content-type"),n.headers=s}else(a.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class me extends D{async request(e){const n=ue(e,e.webFetchExtra),a=((h,A=!0)=>h?Object.entries(h).reduce((S,_)=>{const[y,d]=_;let l,p;return Array.isArray(d)?(p="",d.forEach(P=>{l=A?encodeURIComponent(P):P,p+=`${y}=${l}&`}),p.slice(0,-1)):(l=A?encodeURIComponent(d):d,p=`${y}=${l}`),`${S}&${p}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),r=a?`${e.url}?${a}`:e.url,s=await fetch(r,n),i=s.headers.get("content-type")||"";let o,v,{responseType:c="text"}=s.ok?e:{};switch(i.includes("application/json")&&(c="json"),c){case"arraybuffer":case"blob":v=await s.blob(),o=await(async h=>new Promise((A,S)=>{const _=new FileReader;_.onload=()=>{const y=_.result;A(y.indexOf(",")>=0?y.split(",")[1]:y)},_.onerror=y=>S(y),_.readAsDataURL(h)}))(v);break;case"json":o=await s.json();break;default:o=await s.text()}const b={};return s.headers.forEach((h,A)=>{b[A]=h}),{data:o,headers:b,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}function z(){return f.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}q("CapacitorHttp",{web:()=>new me}),q("Portals",{web:()=>Promise.resolve().then(function(){return fe}).then(t=>new t.PortalsWeb)});const fe=Object.freeze({__proto__:null,PortalsWeb:class extends D{async publishNative(t){}}});var T=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(T||{}),F=(t=>(t.EU="eu",t.ASIA="asia",t))(F||{});const G=t=>{var e,n;if(typeof window<"u"&&z&&((e=z())!=null&&e.value)){const a=((n=z())==null?void 0:n.value)??null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}},he=t=>new Promise(async e=>{let n=null;n=t!=null&&t.mockData?t.mockData:((a,{asiaUatData:r,euSitData:s,euUatData:i})=>{var b,h;const o=(b=a.mockServerInfo)==null?void 0:b.env,v=(h=a.mockServerInfo)==null?void 0:h.area;let c=null;return o&&v&&(F.ASIA===v?T.UAT===o&&(c=r):F.EU===v&&(T.SIT===o?c=s:T.UAT===o&&(c=i))),c})(t,{asiaUatData:await Promise.resolve().then(()=>ye),euSitData:await Promise.resolve().then(()=>Pe),euUatData:await Promise.resolve().then(()=>ke)}),e(n?n!=null&&n.default?n==null?void 0:n.default:n:null)}),I=class I{constructor(){V(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=I.defaultNativeAppInfoConfig}async getIsNativeHandle(){return await(()=>{let e=!1;return G(n=>{e=!!(n!=null&&n.isNative)}),e})()}async specifiedPageHandle(e){await(({cb:n})=>{G(a=>{if(!(a!=null&&a.params))return void console.error("native params is undefine");const r=JSON.parse(a.params)??null;if(!r)return;const{params:s,routeName:i}=r;s&&i&&(n?n(r):console.error("call back is undefine"))})})(e)}async nativeAppInfoHandle(e){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:I.defaultNativeAppInfoConfig,await this.getIsNativeHandle()?await(()=>{let n=null;return G(a=>{n=a??null}),n})():await he(this.nativeAppInfoConfig)}};V(I,"defaultNativeAppInfoConfig",{mockServerInfo:{area:F.ASIA,env:T.UAT}});let J=I;const Q=()=>{let t=null;return t=typeof window>"u"?{}:window,t},$="CommunicatePlugin",g=f.registerPlugin($,{web:()=>Promise.resolve().then(()=>Ce).then(t=>new t.PluginsWeb)}),C=Q();C.addListenerBackHandle=()=>null;const we=t=>{C!=null&&C.addListenerBackHandle&&C.addListenerBackHandle(),setTimeout(()=>{(async e=>{C!=null&&C.addListenerBackHandle&&e&&(C.addListenerBackHandle=await(async n=>{if(f.addListener){const a=await f.addListener($,"nativeSendBack",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}})(e))})(t)})};let re;const X=t=>{re=e=>{t&&t(e)}},B=Q();B.addListenerHomeHandle=()=>null;const ge=t=>{B.addListenerHomeHandle&&B.addListenerHomeHandle(),setTimeout(()=>{(async e=>{e&&(B.addListenerHomeHandle=await(async n=>{if(f.addListener){const a=await f.addListener($,"nativeSendHome",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}})(e))})(t)})},R=Q();R.removeAddListenerFab=()=>null;const ve=t=>{var n,a;R.removeAddListenerFab&&R.removeAddListenerFab();const e=[];(n=g.showFABMenu)==null||n.call(g,{fabMenu:e}),t&&((a=Object.keys(t))!=null&&a.length)&&(Object.keys(t).forEach(r=>{e.push({icon:t[r].icon,id:t[r].id,name:t[r].title})}),queueMicrotask(()=>{var r;(r=g.showFABMenu)==null||r.call(g,{fabMenu:e})}),setTimeout(()=>{(async r=>{r&&(R.removeAddListenerFab=await(async s=>{if(f.addListener){const i=await f.addListener($,"nativeSendFab",o=>s&&s(o));return i!=null&&i.remove?i.remove:()=>null}})(r))})(r=>{let s;r&&r.id&&Object.keys(t).forEach(i=>{r.id===t[i].id&&(s=t[i].fn)}),s&&s()})},10))};class be{async homeIsClick(e){g.homeIsClick(e)}async openMinApp(e){return await g.openMinApp(e)}async showTitle(e){return await g.showTitle(e)}async showSubMask(e){return await g.showSubMask(e)}backBtnApiHooks(e){return(({backBtnCb:n,router:a})=>({initBackBtnHandle:()=>{a&&a.afterEach(r=>{we(()=>{r!=null&&r.name&&re(r.name)})})},registerBackBtnHandle:r=>{const{onMounted:s,onUnmounted:i}=r;s(()=>{X(o=>{n&&n(o)})}),i(()=>{X&&X(()=>"")})}}))(e)}homeHandle(e){ge(e)}setFabHandle(e){ve(e)}}const _e=new class extends J{constructor(){super();V(this,"communicatePlugins",new be)}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle(e){return await super.specifiedPageHandle(e)}async nativeAppInfoHandle(e){return await super.nativeAppInfoHandle(e)}async homeIsClick(e){this.communicatePlugins.homeIsClick(e)}async openMinApp(e){return await this.communicatePlugins.openMinApp(e)}async showTitle(e){return await this.communicatePlugins.showTitle(e)}async showSubMask(e){return await this.communicatePlugins.showSubMask(e)}backBtnApiHooks(e){return this.communicatePlugins.backBtnApiHooks(e)}homeHandle(e){this.communicatePlugins.homeHandle(e)}setFabHandle(e){this.communicatePlugins.setFabHandle(e)}},ye=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),ke=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ce=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends D{async homeIsClick(){}async openMinApp(t){return new Promise(e=>{e(t)})}async showTitle(t){return new Promise(e=>{e(t)})}async showFABMenu(t){return new Promise(e=>{e(t)})}async showSubMask(t){return new Promise(e=>{e(t)})}}},Symbol.toStringTag,{value:"Module"}));return _e});
|
|
1
|
+
(function(h,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m():typeof define=="function"&&define.amd?define(m):(h=typeof globalThis!="undefined"?globalThis:h||self).main=m()})(this,function(){"use strict";var Se=Object.defineProperty;var Ne=Object.getPrototypeOf;var Te=Reflect.get;var Ie=(h,m,p)=>m in h?Se(h,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):h[m]=p;var J=(h,m,p)=>(Ie(h,typeof m!="symbol"?m+"":m,p),p);var Q=(h,m,p)=>Te(Ne(h),p,m);var s=(h,m,p)=>new Promise((M,K)=>{var X=g=>{try{N(p.next(g))}catch(I){K(I)}},w=g=>{try{N(p.throw(g))}catch(I){K(I)}},N=g=>g.done?M(g.value):Promise.resolve(g.value).then(X,w);N((p=p.apply(h,m)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const h=n=>n.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const a=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return a.addPlatform=(r,i)=>{a.platforms.set(r,i)},a.setPlatform=r=>{a.platforms.has(r)&&(a.currentPlatform=a.platforms.get(r))},a})(n),m=h(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var p;m.addPlatform,m.setPlatform,function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"}(p||(p={}));class M extends Error{constructor(e,t,a){super(e),this.message=e,this.code=t,this.data=a}}const K=n=>{var e,t,a,r,i;const d=n.CapacitorCustomPlatform||null,o=n.Capacitor||{},_=o.Plugins=o.Plugins||{},u=n.CapacitorPlatforms,y=((e=u==null?void 0:u.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>d!==null?d.name:(l=>{var c,f;return l!=null&&l.androidBridge?"android":!((f=(c=l==null?void 0:l.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||f===void 0)&&f.bridge?"ios":"web"})(n)),v=((t=u==null?void 0:u.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||(()=>y()!=="web"),E=((a=u==null?void 0:u.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||(l=>{const c=P.get(l);return!!(c!=null&&c.platforms.has(y()))||!!H(l)}),H=((r=u==null?void 0:u.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||(l=>{var c;return(c=o.PluginHeaders)===null||c===void 0?void 0:c.find(f=>f.name===l)}),P=new Map,k=((i=u==null?void 0:u.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((l,c={})=>{const f=P.get(l);if(f)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),f.proxy;const C=y(),D=H(l);let T;const ae=L=>{let S;const j=(...G)=>{const F=(()=>s(this,null,function*(){return!T&&C in c?T=T=typeof c[C]=="function"?yield c[C]():c[C]:d!==null&&!T&&"web"in c&&(T=T=typeof c.web=="function"?yield c.web():c.web),T}))().then($=>{const pe=((O,B)=>{var se,oe;if(!D){if(O)return(oe=O[B])===null||oe===void 0?void 0:oe.bind(O);throw new M(`"${l}" plugin is not implemented on ${C}`,p.Unimplemented)}{const ue=D==null?void 0:D.methods.find(R=>B===R.name);if(ue)return ue.rtype==="promise"?R=>o.nativePromise(l,B.toString(),R):(R,Ee)=>o.nativeCallback(l,B.toString(),R,Ee);if(O)return(se=O[B])===null||se===void 0?void 0:se.bind(O)}})($,L);if(pe){const O=pe(...G);return S=O==null?void 0:O.remove,O}throw new M(`"${l}.${L}()" is not implemented on ${C}`,p.Unimplemented)});return L==="addListener"&&(F.remove=()=>s(this,null,function*(){return S()})),F};return j.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(j,"name",{value:L,writable:!1,configurable:!1}),j},le=ae("addListener"),ce=ae("removeListener"),Le=(L,S)=>{const j=le({eventName:L},S),G=()=>s(this,null,function*(){const $=yield j;ce({eventName:L,callbackId:$},S)}),F=new Promise($=>j.then(()=>$({remove:G})));return F.remove=()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield G()}),F},re=new Proxy({},{get(L,S){switch(S){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?Le:le;case"removeListener":return ce;default:return ae(S)}}});return _[l]=re,P.set(l,{name:l,proxy:re,platforms:new Set([...Object.keys(c),...D?[C]:[]])}),re});return o.convertFileSrc||(o.convertFileSrc=l=>l),o.getPlatform=y,o.handleError=l=>n.console.error(l),o.isNativePlatform=v,o.isPluginAvailable=E,o.pluginMethodNoop=(l,c,f)=>Promise.reject(`${f} does not have an implementation of "${c}".`),o.registerPlugin=k,o.Exception=M,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},X=n=>n.Capacitor=K(n),w=X(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),N=w.registerPlugin;w.Plugins;class g{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a);const r=()=>s(this,null,function*(){return this.removeListener(e,t)}),i=Promise.resolve({remove:r});return Object.defineProperty(i,"remove",{value:()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield r()})}),i}removeAllListeners(){return s(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,t){const a=this.listeners[e];a&&a.forEach(r=>r(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:a=>{this.notifyListeners(t,a)}}}unimplemented(e="not implemented"){return new w.Exception(e,p.Unimplemented)}unavailable(e="not available"){return new w.Exception(e,p.Unavailable)}removeListener(e,t){return s(this,null,function*(){const a=this.listeners[e];if(!a)return;const r=a.indexOf(t);this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])})}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const I=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class me extends g{getCookies(){return s(this,null,function*(){const e=document.cookie,t={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[r,i]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=ie(r).trim(),i=ie(i).trim(),t[r]=i}),t})}setCookie(e){return s(this,null,function*(){try{const t=I(e.key),a=I(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${a||""}${r}; path=${i}; ${d};`}catch(t){return Promise.reject(t)}})}deleteCookie(e){return s(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}})}clearCookies(){return s(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return s(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}N("CapacitorCookies",{web:()=>new me});const fe=(n,e={})=>{const t=Object.assign({method:n.method||"GET",headers:n.headers},e),a=((r={})=>{const i=Object.keys(r);return Object.keys(r).map(d=>d.toLocaleLowerCase()).reduce((d,o,_)=>(d[o]=r[i[_]],d),{})})(n.headers)["content-type"]||"";if(typeof n.data=="string")t.body=n.data;else if(a.includes("application/x-www-form-urlencoded")){const r=new URLSearchParams;for(const[i,d]of Object.entries(n.data||{}))r.set(i,d);t.body=r.toString()}else if(a.includes("multipart/form-data")){const r=new FormData;if(n.data instanceof FormData)n.data.forEach((d,o)=>{r.append(o,d)});else for(const d of Object.keys(n.data))r.append(d,n.data[d]);t.body=r;const i=new Headers(t.headers);i.delete("content-type"),t.headers=i}else(a.includes("application/json")||typeof n.data=="object")&&(t.body=JSON.stringify(n.data));return t};class he extends g{request(e){return s(this,null,function*(){const t=fe(e,e.webFetchExtra),a=((v,E=!0)=>v?Object.entries(v).reduce((H,P)=>{const[k,l]=P;let c,f;return Array.isArray(l)?(f="",l.forEach(C=>{c=E?encodeURIComponent(C):C,f+=`${k}=${c}&`}),f.slice(0,-1)):(c=E?encodeURIComponent(l):l,f=`${k}=${c}`),`${H}&${f}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),r=a?`${e.url}?${a}`:e.url,i=yield fetch(r,t),d=i.headers.get("content-type")||"";let o,_,{responseType:u="text"}=i.ok?e:{};switch(d.includes("application/json")&&(u="json"),u){case"arraybuffer":case"blob":_=yield i.blob(),o=yield(v=>s(this,null,function*(){return new Promise((E,H)=>{const P=new FileReader;P.onload=()=>{const k=P.result;E(k.indexOf(",")>=0?k.split(",")[1]:k)},P.onerror=k=>H(k),P.readAsDataURL(v)})}))(_);break;case"json":o=yield i.json();break;default:o=yield i.text()}const y={};return i.headers.forEach((v,E)=>{y[E]=v}),{data:o,headers:y,status:i.status,url:i.url}})}get(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function Y(){return w.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}N("CapacitorHttp",{web:()=>new he}),N("Portals",{web:()=>Promise.resolve().then(function(){return we}).then(n=>new n.PortalsWeb)});const we=Object.freeze({__proto__:null,PortalsWeb:class extends g{publishNative(n){return s(this,null,function*(){})}}});var U=(n=>(n.DEV="dev",n.SIT="sit",n.UAT="uat",n.PROD="prod",n.TEST="test",n))(U||{}),V=(n=>(n.EU="eu",n.ASIA="asia",n))(V||{});const Z=n=>{var e,t,a;if(typeof window!="undefined"&&Y&&((e=Y())!=null&&e.value)){const r=(a=(t=Y())==null?void 0:t.value)!=null?a:null;if(!r)return void console.error("native initialContext is undefine");if(!n)return void console.error("initialContext call back is undefine");n(r)}},ge=n=>new Promise(e=>s(this,null,function*(){let t=null;t=n!=null&&n.mockData?n.mockData:((a,{asiaUatData:r,euSitData:i,euUatData:d})=>{var y,v;const o=(y=a.mockServerInfo)==null?void 0:y.env,_=(v=a.mockServerInfo)==null?void 0:v.area;let u=null;return o&&_&&(V.ASIA===_?U.UAT===o&&(u=r):V.EU===_&&(U.SIT===o?u=i:U.UAT===o&&(u=d))),u})(n,{asiaUatData:yield Promise.resolve().then(()=>ke),euSitData:yield Promise.resolve().then(()=>Ce),euUatData:yield Promise.resolve().then(()=>Oe)}),e(t?t!=null&&t.default?t==null?void 0:t.default:t:null)})),x=class x{constructor(){J(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=x.defaultNativeAppInfoConfig}getIsNativeHandle(){return s(this,null,function*(){return yield(()=>{let e=!1;return Z(t=>{e=!!(t!=null&&t.isNative)}),e})()})}specifiedPageHandle(e){return s(this,null,function*(){yield(({cb:t})=>{Z(a=>{var o;if(!(a!=null&&a.params))return void console.error("native params is undefine");const r=(o=JSON.parse(a.params))!=null?o:null;if(!r)return;const{params:i,routeName:d}=r;i&&d&&(t?t(r):console.error("call back is undefine"))})})(e)})}nativeAppInfoHandle(e){return s(this,null,function*(){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:x.defaultNativeAppInfoConfig,(yield this.getIsNativeHandle())?yield(()=>{let t=null;return Z(a=>{t=a!=null?a:null}),t})():yield ge(this.nativeAppInfoConfig)})}};J(x,"defaultNativeAppInfoConfig",{mockServerInfo:{area:V.ASIA,env:U.UAT}});let ee=x;const te=()=>{let n=null;return n=typeof window=="undefined"?{}:window,n},W="CommunicatePlugin",b=w.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ae).then(n=>new n.PluginsWeb)}),A=te();A.addListenerBackHandle=()=>null;const ve=n=>{A!=null&&A.addListenerBackHandle&&A.addListenerBackHandle(),setTimeout(()=>{(e=>s(this,null,function*(){A!=null&&A.addListenerBackHandle&&e&&(A.addListenerBackHandle=yield(t=>s(this,null,function*(){if(w.addListener){const a=yield w.addListener(W,"nativeSendBack",r=>t&&t(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(n)})};let de;const ne=n=>{de=e=>{n&&n(e)}},q=te();q.addListenerHomeHandle=()=>null;const be=n=>{q.addListenerHomeHandle&&q.addListenerHomeHandle(),setTimeout(()=>{(e=>s(this,null,function*(){e&&(q.addListenerHomeHandle=yield(t=>s(this,null,function*(){if(w.addListener){const a=yield w.addListener(W,"nativeSendHome",r=>t&&t(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(n)})},z=te();z.removeAddListenerFab=()=>null;const _e=n=>{var t,a;z.removeAddListenerFab&&z.removeAddListenerFab();const e=[];(t=b.showFABMenu)==null||t.call(b,{fabMenu:e}),n&&((a=Object.keys(n))!=null&&a.length)&&(Object.keys(n).forEach(r=>{e.push({icon:n[r].icon,id:n[r].id,name:n[r].title})}),queueMicrotask(()=>{var r;(r=b.showFABMenu)==null||r.call(b,{fabMenu:e})}),setTimeout(()=>{(r=>s(this,null,function*(){r&&(z.removeAddListenerFab=yield(i=>s(this,null,function*(){if(w.addListener){const d=yield w.addListener(W,"nativeSendFab",o=>i&&i(o));return d!=null&&d.remove?d.remove:()=>null}}))(r))}))(r=>{let i;r&&r.id&&Object.keys(n).forEach(d=>{r.id===n[d].id&&(i=n[d].fn)}),i&&i()})},10))};class ye{homeIsClick(e){return s(this,null,function*(){b.homeIsClick(e)})}openMinApp(e){return s(this,null,function*(){return yield b.openMinApp(e)})}showTitle(e){return s(this,null,function*(){return yield b.showTitle(e)})}showSubMask(e){return s(this,null,function*(){return yield b.showSubMask(e)})}backBtnApiHooks(e){return(({backBtnCb:t,router:a})=>({initBackBtnHandle:()=>{a&&a.afterEach(r=>{ve(()=>{r!=null&&r.name&&de(r.name)})})},registerBackBtnHandle:r=>{const{onMounted:i,onUnmounted:d}=r;i(()=>{ne(o=>{t&&t(o)})}),d(()=>{ne&&ne(()=>"")})}}))(e)}homeHandle(e){be(e)}setFabHandle(e){_e(e)}}const Pe=new class e extends ee{constructor(){super();J(this,"communicatePlugins",new ye)}getIsNativeHandle(){return s(this,null,function*(){return yield Q(e.prototype,this,"getIsNativeHandle").call(this)})}specifiedPageHandle(t){return s(this,null,function*(){return yield Q(e.prototype,this,"specifiedPageHandle").call(this,t)})}nativeAppInfoHandle(t){return s(this,null,function*(){return yield Q(e.prototype,this,"nativeAppInfoHandle").call(this,t)})}homeIsClick(t){return s(this,null,function*(){this.communicatePlugins.homeIsClick(t)})}openMinApp(t){return s(this,null,function*(){return yield this.communicatePlugins.openMinApp(t)})}showTitle(t){return s(this,null,function*(){return yield this.communicatePlugins.showTitle(t)})}showSubMask(t){return s(this,null,function*(){return yield this.communicatePlugins.showSubMask(t)})}backBtnApiHooks(t){return this.communicatePlugins.backBtnApiHooks(t)}homeHandle(t){this.communicatePlugins.homeHandle(t)}setFabHandle(t){this.communicatePlugins.setFabHandle(t)}},ke=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ce=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Oe=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends g{homeIsClick(){return s(this,null,function*(){})}openMinApp(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showTitle(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showFABMenu(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showSubMask(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}}},Symbol.toStringTag,{value:"Module"}));return Pe});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superapp-miniapp-invoke-native",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.51",
|
|
5
5
|
"description": "Superapp中,小程序调用Native 接口的封装,如OSP项目中,需要调用Native的相机扫描,镭射扫描,获取RBAC的数据等",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"files": [
|
|
23
|
-
"lib"
|
|
24
|
-
"module.d.ts"
|
|
23
|
+
"lib"
|
|
25
24
|
],
|
|
26
25
|
"module": "./lib/main.js",
|
|
27
26
|
"main": "./lib/main.umd.cjs",
|
package/lib/chunk/16ebb4f1.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const e = { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } };
|
|
2
|
-
export {
|
|
3
|
-
e as default
|
|
4
|
-
};
|
package/lib/chunk/5643c678.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { W as n } from "./b68136c6.js";
|
|
2
|
-
class a extends n {
|
|
3
|
-
async homeIsClick() {
|
|
4
|
-
}
|
|
5
|
-
async openMinApp(e) {
|
|
6
|
-
return new Promise((s) => {
|
|
7
|
-
s(e);
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
async showTitle(e) {
|
|
11
|
-
return new Promise((s) => {
|
|
12
|
-
s(e);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
async showFABMenu(e) {
|
|
16
|
-
return new Promise((s) => {
|
|
17
|
-
s(e);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async showSubMask(e) {
|
|
21
|
-
return new Promise((s) => {
|
|
22
|
-
s(e);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
a as PluginsWeb
|
|
28
|
-
};
|
package/lib/chunk/b68136c6.js
DELETED
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
var de = Object.defineProperty;
|
|
2
|
-
var ue = (n, e, t) => e in n ? de(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var B = (n, e, t) => (ue(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
5
|
-
const me = (n) => n.CapacitorPlatforms = ((e) => {
|
|
6
|
-
const t = /* @__PURE__ */ new Map();
|
|
7
|
-
t.set("web", { name: "web" });
|
|
8
|
-
const a = e.CapacitorPlatforms || { currentPlatform: { name: "web" }, platforms: t };
|
|
9
|
-
return a.addPlatform = (i, r) => {
|
|
10
|
-
a.platforms.set(i, r);
|
|
11
|
-
}, a.setPlatform = (i) => {
|
|
12
|
-
a.platforms.has(i) && (a.currentPlatform = a.platforms.get(i));
|
|
13
|
-
}, a;
|
|
14
|
-
})(n), ie = me(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
15
|
-
var I;
|
|
16
|
-
ie.addPlatform, ie.setPlatform, function(n) {
|
|
17
|
-
n.Unimplemented = "UNIMPLEMENTED", n.Unavailable = "UNAVAILABLE";
|
|
18
|
-
}(I || (I = {}));
|
|
19
|
-
class _ extends Error {
|
|
20
|
-
constructor(e, t, a) {
|
|
21
|
-
super(e), this.message = e, this.code = t, this.data = a;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const pe = (n) => {
|
|
25
|
-
var e, t, a, i, r;
|
|
26
|
-
const o = n.CapacitorCustomPlatform || null, s = n.Capacitor || {}, f = s.Plugins = s.Plugins || {}, d = n.CapacitorPlatforms, w = ((e = d == null ? void 0 : d.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => o !== null ? o.name : ((l) => {
|
|
27
|
-
var c, u;
|
|
28
|
-
return l != null && l.androidBridge ? "android" : !((u = (c = l == null ? void 0 : l.webkit) === null || c === void 0 ? void 0 : c.messageHandlers) === null || u === void 0) && u.bridge ? "ios" : "web";
|
|
29
|
-
})(n)), p = ((t = d == null ? void 0 : d.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => w() !== "web"), L = ((a = d == null ? void 0 : d.currentPlatform) === null || a === void 0 ? void 0 : a.isPluginAvailable) || ((l) => {
|
|
30
|
-
const c = h.get(l);
|
|
31
|
-
return !!(c != null && c.platforms.has(w())) || !!E(l);
|
|
32
|
-
}), E = ((i = d == null ? void 0 : d.currentPlatform) === null || i === void 0 ? void 0 : i.getPluginHeader) || ((l) => {
|
|
33
|
-
var c;
|
|
34
|
-
return (c = s.PluginHeaders) === null || c === void 0 ? void 0 : c.find((u) => u.name === l);
|
|
35
|
-
}), h = /* @__PURE__ */ new Map(), v = ((r = d == null ? void 0 : d.currentPlatform) === null || r === void 0 ? void 0 : r.registerPlugin) || ((l, c = {}) => {
|
|
36
|
-
const u = h.get(l);
|
|
37
|
-
if (u)
|
|
38
|
-
return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`), u.proxy;
|
|
39
|
-
const g = w(), j = E(l);
|
|
40
|
-
let C;
|
|
41
|
-
const R = (P) => {
|
|
42
|
-
let A;
|
|
43
|
-
const H = (...T) => {
|
|
44
|
-
const O = (async () => (!C && g in c ? C = C = typeof c[g] == "function" ? await c[g]() : c[g] : o !== null && !C && "web" in c && (C = C = typeof c.web == "function" ? await c.web() : c.web), C))().then((S) => {
|
|
45
|
-
const te = ((b, U) => {
|
|
46
|
-
var G, J;
|
|
47
|
-
if (!j) {
|
|
48
|
-
if (b)
|
|
49
|
-
return (J = b[U]) === null || J === void 0 ? void 0 : J.bind(b);
|
|
50
|
-
throw new _(`"${l}" plugin is not implemented on ${g}`, I.Unimplemented);
|
|
51
|
-
}
|
|
52
|
-
{
|
|
53
|
-
const ae = j == null ? void 0 : j.methods.find(($) => U === $.name);
|
|
54
|
-
if (ae)
|
|
55
|
-
return ae.rtype === "promise" ? ($) => s.nativePromise(l, U.toString(), $) : ($, ce) => s.nativeCallback(l, U.toString(), $, ce);
|
|
56
|
-
if (b)
|
|
57
|
-
return (G = b[U]) === null || G === void 0 ? void 0 : G.bind(b);
|
|
58
|
-
}
|
|
59
|
-
})(S, P);
|
|
60
|
-
if (te) {
|
|
61
|
-
const b = te(...T);
|
|
62
|
-
return A = b == null ? void 0 : b.remove, b;
|
|
63
|
-
}
|
|
64
|
-
throw new _(`"${l}.${P}()" is not implemented on ${g}`, I.Unimplemented);
|
|
65
|
-
});
|
|
66
|
-
return P === "addListener" && (O.remove = async () => A()), O;
|
|
67
|
-
};
|
|
68
|
-
return H.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(H, "name", { value: P, writable: !1, configurable: !1 }), H;
|
|
69
|
-
}, ee = R("addListener"), ne = R("removeListener"), le = (P, A) => {
|
|
70
|
-
const H = ee({ eventName: P }, A), T = async () => {
|
|
71
|
-
const S = await H;
|
|
72
|
-
ne({ eventName: P, callbackId: S }, A);
|
|
73
|
-
}, O = new Promise((S) => H.then(() => S({ remove: T })));
|
|
74
|
-
return O.remove = async () => {
|
|
75
|
-
console.warn("Using addListener() without 'await' is deprecated."), await T();
|
|
76
|
-
}, O;
|
|
77
|
-
}, q = new Proxy({}, { get(P, A) {
|
|
78
|
-
switch (A) {
|
|
79
|
-
case "$$typeof":
|
|
80
|
-
return;
|
|
81
|
-
case "toJSON":
|
|
82
|
-
return () => ({});
|
|
83
|
-
case "addListener":
|
|
84
|
-
return j ? le : ee;
|
|
85
|
-
case "removeListener":
|
|
86
|
-
return ne;
|
|
87
|
-
default:
|
|
88
|
-
return R(A);
|
|
89
|
-
}
|
|
90
|
-
} });
|
|
91
|
-
return f[l] = q, h.set(l, { name: l, proxy: q, platforms: /* @__PURE__ */ new Set([...Object.keys(c), ...j ? [g] : []]) }), q;
|
|
92
|
-
});
|
|
93
|
-
return s.convertFileSrc || (s.convertFileSrc = (l) => l), s.getPlatform = w, s.handleError = (l) => n.console.error(l), s.isNativePlatform = p, s.isPluginAvailable = L, s.pluginMethodNoop = (l, c, u) => Promise.reject(`${u} does not have an implementation of "${c}".`), s.registerPlugin = v, s.Exception = _, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
|
|
94
|
-
}, fe = (n) => n.Capacitor = pe(n), m = fe(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), Q = m.registerPlugin;
|
|
95
|
-
m.Plugins;
|
|
96
|
-
class Y {
|
|
97
|
-
constructor(e) {
|
|
98
|
-
this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
|
|
99
|
-
}
|
|
100
|
-
addListener(e, t) {
|
|
101
|
-
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t);
|
|
102
|
-
const a = this.windowListeners[e];
|
|
103
|
-
a && !a.registered && this.addWindowListener(a);
|
|
104
|
-
const i = async () => this.removeListener(e, t), r = Promise.resolve({ remove: i });
|
|
105
|
-
return Object.defineProperty(r, "remove", { value: async () => {
|
|
106
|
-
console.warn("Using addListener() without 'await' is deprecated."), await i();
|
|
107
|
-
} }), r;
|
|
108
|
-
}
|
|
109
|
-
async removeAllListeners() {
|
|
110
|
-
this.listeners = {};
|
|
111
|
-
for (const e in this.windowListeners)
|
|
112
|
-
this.removeWindowListener(this.windowListeners[e]);
|
|
113
|
-
this.windowListeners = {};
|
|
114
|
-
}
|
|
115
|
-
notifyListeners(e, t) {
|
|
116
|
-
const a = this.listeners[e];
|
|
117
|
-
a && a.forEach((i) => i(t));
|
|
118
|
-
}
|
|
119
|
-
hasListeners(e) {
|
|
120
|
-
return !!this.listeners[e].length;
|
|
121
|
-
}
|
|
122
|
-
registerWindowListener(e, t) {
|
|
123
|
-
this.windowListeners[t] = { registered: !1, windowEventName: e, pluginEventName: t, handler: (a) => {
|
|
124
|
-
this.notifyListeners(t, a);
|
|
125
|
-
} };
|
|
126
|
-
}
|
|
127
|
-
unimplemented(e = "not implemented") {
|
|
128
|
-
return new m.Exception(e, I.Unimplemented);
|
|
129
|
-
}
|
|
130
|
-
unavailable(e = "not available") {
|
|
131
|
-
return new m.Exception(e, I.Unavailable);
|
|
132
|
-
}
|
|
133
|
-
async removeListener(e, t) {
|
|
134
|
-
const a = this.listeners[e];
|
|
135
|
-
if (!a)
|
|
136
|
-
return;
|
|
137
|
-
const i = a.indexOf(t);
|
|
138
|
-
this.listeners[e].splice(i, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
139
|
-
}
|
|
140
|
-
addWindowListener(e) {
|
|
141
|
-
window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
|
|
142
|
-
}
|
|
143
|
-
removeWindowListener(e) {
|
|
144
|
-
e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
const re = (n) => encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), se = (n) => n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
148
|
-
class we extends Y {
|
|
149
|
-
async getCookies() {
|
|
150
|
-
const e = document.cookie, t = {};
|
|
151
|
-
return e.split(";").forEach((a) => {
|
|
152
|
-
if (a.length <= 0)
|
|
153
|
-
return;
|
|
154
|
-
let [i, r] = a.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
|
155
|
-
i = se(i).trim(), r = se(r).trim(), t[i] = r;
|
|
156
|
-
}), t;
|
|
157
|
-
}
|
|
158
|
-
async setCookie(e) {
|
|
159
|
-
try {
|
|
160
|
-
const t = re(e.key), a = re(e.value), i = `; expires=${(e.expires || "").replace("expires=", "")}`, r = (e.path || "/").replace("path=", ""), o = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
|
161
|
-
document.cookie = `${t}=${a || ""}${i}; path=${r}; ${o};`;
|
|
162
|
-
} catch (t) {
|
|
163
|
-
return Promise.reject(t);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async deleteCookie(e) {
|
|
167
|
-
try {
|
|
168
|
-
document.cookie = `${e.key}=; Max-Age=0`;
|
|
169
|
-
} catch (t) {
|
|
170
|
-
return Promise.reject(t);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
async clearCookies() {
|
|
174
|
-
try {
|
|
175
|
-
const e = document.cookie.split(";") || [];
|
|
176
|
-
for (const t of e)
|
|
177
|
-
document.cookie = t.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
|
|
178
|
-
} catch (e) {
|
|
179
|
-
return Promise.reject(e);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
async clearAllCookies() {
|
|
183
|
-
try {
|
|
184
|
-
await this.clearCookies();
|
|
185
|
-
} catch (e) {
|
|
186
|
-
return Promise.reject(e);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
Q("CapacitorCookies", { web: () => new we() });
|
|
191
|
-
const he = (n, e = {}) => {
|
|
192
|
-
const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e), a = ((i = {}) => {
|
|
193
|
-
const r = Object.keys(i);
|
|
194
|
-
return Object.keys(i).map((o) => o.toLocaleLowerCase()).reduce((o, s, f) => (o[s] = i[r[f]], o), {});
|
|
195
|
-
})(n.headers)["content-type"] || "";
|
|
196
|
-
if (typeof n.data == "string")
|
|
197
|
-
t.body = n.data;
|
|
198
|
-
else if (a.includes("application/x-www-form-urlencoded")) {
|
|
199
|
-
const i = new URLSearchParams();
|
|
200
|
-
for (const [r, o] of Object.entries(n.data || {}))
|
|
201
|
-
i.set(r, o);
|
|
202
|
-
t.body = i.toString();
|
|
203
|
-
} else if (a.includes("multipart/form-data")) {
|
|
204
|
-
const i = new FormData();
|
|
205
|
-
if (n.data instanceof FormData)
|
|
206
|
-
n.data.forEach((o, s) => {
|
|
207
|
-
i.append(s, o);
|
|
208
|
-
});
|
|
209
|
-
else
|
|
210
|
-
for (const o of Object.keys(n.data))
|
|
211
|
-
i.append(o, n.data[o]);
|
|
212
|
-
t.body = i;
|
|
213
|
-
const r = new Headers(t.headers);
|
|
214
|
-
r.delete("content-type"), t.headers = r;
|
|
215
|
-
} else
|
|
216
|
-
(a.includes("application/json") || typeof n.data == "object") && (t.body = JSON.stringify(n.data));
|
|
217
|
-
return t;
|
|
218
|
-
};
|
|
219
|
-
class ve extends Y {
|
|
220
|
-
async request(e) {
|
|
221
|
-
const t = he(e, e.webFetchExtra), a = ((p, L = !0) => p ? Object.entries(p).reduce((E, h) => {
|
|
222
|
-
const [v, l] = h;
|
|
223
|
-
let c, u;
|
|
224
|
-
return Array.isArray(l) ? (u = "", l.forEach((g) => {
|
|
225
|
-
c = L ? encodeURIComponent(g) : g, u += `${v}=${c}&`;
|
|
226
|
-
}), u.slice(0, -1)) : (c = L ? encodeURIComponent(l) : l, u = `${v}=${c}`), `${E}&${u}`;
|
|
227
|
-
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), i = a ? `${e.url}?${a}` : e.url, r = await fetch(i, t), o = r.headers.get("content-type") || "";
|
|
228
|
-
let s, f, { responseType: d = "text" } = r.ok ? e : {};
|
|
229
|
-
switch (o.includes("application/json") && (d = "json"), d) {
|
|
230
|
-
case "arraybuffer":
|
|
231
|
-
case "blob":
|
|
232
|
-
f = await r.blob(), s = await (async (p) => new Promise((L, E) => {
|
|
233
|
-
const h = new FileReader();
|
|
234
|
-
h.onload = () => {
|
|
235
|
-
const v = h.result;
|
|
236
|
-
L(v.indexOf(",") >= 0 ? v.split(",")[1] : v);
|
|
237
|
-
}, h.onerror = (v) => E(v), h.readAsDataURL(p);
|
|
238
|
-
}))(f);
|
|
239
|
-
break;
|
|
240
|
-
case "json":
|
|
241
|
-
s = await r.json();
|
|
242
|
-
break;
|
|
243
|
-
default:
|
|
244
|
-
s = await r.text();
|
|
245
|
-
}
|
|
246
|
-
const w = {};
|
|
247
|
-
return r.headers.forEach((p, L) => {
|
|
248
|
-
w[L] = p;
|
|
249
|
-
}), { data: s, headers: w, status: r.status, url: r.url };
|
|
250
|
-
}
|
|
251
|
-
async get(e) {
|
|
252
|
-
return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
|
|
253
|
-
}
|
|
254
|
-
async post(e) {
|
|
255
|
-
return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
|
|
256
|
-
}
|
|
257
|
-
async put(e) {
|
|
258
|
-
return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
|
|
259
|
-
}
|
|
260
|
-
async patch(e) {
|
|
261
|
-
return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
|
|
262
|
-
}
|
|
263
|
-
async delete(e) {
|
|
264
|
-
return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
function K() {
|
|
268
|
-
return m.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
|
|
269
|
-
}
|
|
270
|
-
Q("CapacitorHttp", { web: () => new ve() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
|
|
271
|
-
Q("Portals", { web: () => Promise.resolve().then(function() {
|
|
272
|
-
return ge;
|
|
273
|
-
}).then((n) => new n.PortalsWeb()) });
|
|
274
|
-
const ge = Object.freeze({ __proto__: null, PortalsWeb: class extends Y {
|
|
275
|
-
async publishNative(n) {
|
|
276
|
-
}
|
|
277
|
-
} });
|
|
278
|
-
var x = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(x || {}), F = ((n) => (n.EU = "eu", n.ASIA = "asia", n))(F || {});
|
|
279
|
-
const V = (n) => {
|
|
280
|
-
var e, t;
|
|
281
|
-
if (typeof window < "u" && K && ((e = K()) != null && e.value)) {
|
|
282
|
-
const a = ((t = K()) == null ? void 0 : t.value) ?? null;
|
|
283
|
-
if (!a)
|
|
284
|
-
return void console.error("native initialContext is undefine");
|
|
285
|
-
if (!n)
|
|
286
|
-
return void console.error("initialContext call back is undefine");
|
|
287
|
-
n(a);
|
|
288
|
-
}
|
|
289
|
-
}, be = (n) => new Promise(async (e) => {
|
|
290
|
-
let t = null;
|
|
291
|
-
t = n != null && n.mockData ? n.mockData : ((a, { asiaUatData: i, euSitData: r, euUatData: o }) => {
|
|
292
|
-
var w, p;
|
|
293
|
-
const s = (w = a.mockServerInfo) == null ? void 0 : w.env, f = (p = a.mockServerInfo) == null ? void 0 : p.area;
|
|
294
|
-
let d = null;
|
|
295
|
-
return s && f && (F.ASIA === f ? x.UAT === s && (d = i) : F.EU === f && (x.SIT === s ? d = r : x.UAT === s && (d = o))), d;
|
|
296
|
-
})(n, { asiaUatData: await import("./ecff8422.js"), euSitData: await import("./cb9a50d4.js"), euUatData: await import("./16ebb4f1.js") }), e(t ? t != null && t.default ? t == null ? void 0 : t.default : t : null);
|
|
297
|
-
}), N = class N {
|
|
298
|
-
constructor() {
|
|
299
|
-
B(this, "nativeAppInfoConfig");
|
|
300
|
-
this.nativeAppInfoConfig = N.defaultNativeAppInfoConfig;
|
|
301
|
-
}
|
|
302
|
-
async getIsNativeHandle() {
|
|
303
|
-
return await (() => {
|
|
304
|
-
let e = !1;
|
|
305
|
-
return V((t) => {
|
|
306
|
-
e = !!(t != null && t.isNative);
|
|
307
|
-
}), e;
|
|
308
|
-
})();
|
|
309
|
-
}
|
|
310
|
-
async specifiedPageHandle(e) {
|
|
311
|
-
await (({ cb: t }) => {
|
|
312
|
-
V((a) => {
|
|
313
|
-
if (!(a != null && a.params))
|
|
314
|
-
return void console.error("native params is undefine");
|
|
315
|
-
const i = JSON.parse(a.params) ?? null;
|
|
316
|
-
if (!i)
|
|
317
|
-
return;
|
|
318
|
-
const { params: r, routeName: o } = i;
|
|
319
|
-
r && o && (t ? t(i) : console.error("call back is undefine"));
|
|
320
|
-
});
|
|
321
|
-
})(e);
|
|
322
|
-
}
|
|
323
|
-
async nativeAppInfoHandle(e) {
|
|
324
|
-
return this.nativeAppInfoConfig = e != null && e.mockServerInfo || e != null && e.mockData ? e : N.defaultNativeAppInfoConfig, await this.getIsNativeHandle() ? await (() => {
|
|
325
|
-
let t = null;
|
|
326
|
-
return V((a) => {
|
|
327
|
-
t = a ?? null;
|
|
328
|
-
}), t;
|
|
329
|
-
})() : await be(this.nativeAppInfoConfig);
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
B(N, "defaultNativeAppInfoConfig", { mockServerInfo: { area: F.ASIA, env: x.UAT } });
|
|
333
|
-
let X = N;
|
|
334
|
-
const Z = () => {
|
|
335
|
-
let n = null;
|
|
336
|
-
return n = typeof window > "u" ? {} : window, n;
|
|
337
|
-
}, W = "CommunicatePlugin", y = m.registerPlugin(W, { web: () => import("./5643c678.js").then((n) => new n.PluginsWeb()) }), k = Z();
|
|
338
|
-
k.addListenerBackHandle = () => null;
|
|
339
|
-
const ye = (n) => {
|
|
340
|
-
k != null && k.addListenerBackHandle && k.addListenerBackHandle(), setTimeout(() => {
|
|
341
|
-
(async (e) => {
|
|
342
|
-
k != null && k.addListenerBackHandle && e && (k.addListenerBackHandle = await (async (t) => {
|
|
343
|
-
if (m.addListener) {
|
|
344
|
-
const a = await m.addListener(W, "nativeSendBack", (i) => t && t(i));
|
|
345
|
-
return a != null && a.remove ? a.remove : () => null;
|
|
346
|
-
}
|
|
347
|
-
})(e));
|
|
348
|
-
})(n);
|
|
349
|
-
});
|
|
350
|
-
};
|
|
351
|
-
let oe;
|
|
352
|
-
const z = (n) => {
|
|
353
|
-
oe = (e) => {
|
|
354
|
-
n && n(e);
|
|
355
|
-
};
|
|
356
|
-
}, M = Z();
|
|
357
|
-
M.addListenerHomeHandle = () => null;
|
|
358
|
-
const Pe = (n) => {
|
|
359
|
-
M.addListenerHomeHandle && M.addListenerHomeHandle(), setTimeout(() => {
|
|
360
|
-
(async (e) => {
|
|
361
|
-
e && (M.addListenerHomeHandle = await (async (t) => {
|
|
362
|
-
if (m.addListener) {
|
|
363
|
-
const a = await m.addListener(W, "nativeSendHome", (i) => t && t(i));
|
|
364
|
-
return a != null && a.remove ? a.remove : () => null;
|
|
365
|
-
}
|
|
366
|
-
})(e));
|
|
367
|
-
})(n);
|
|
368
|
-
});
|
|
369
|
-
}, D = Z();
|
|
370
|
-
D.removeAddListenerFab = () => null;
|
|
371
|
-
const ke = (n) => {
|
|
372
|
-
var t, a;
|
|
373
|
-
D.removeAddListenerFab && D.removeAddListenerFab();
|
|
374
|
-
const e = [];
|
|
375
|
-
(t = y.showFABMenu) == null || t.call(y, { fabMenu: e }), n && ((a = Object.keys(n)) != null && a.length) && (Object.keys(n).forEach((i) => {
|
|
376
|
-
e.push({ icon: n[i].icon, id: n[i].id, name: n[i].title });
|
|
377
|
-
}), queueMicrotask(() => {
|
|
378
|
-
var i;
|
|
379
|
-
(i = y.showFABMenu) == null || i.call(y, { fabMenu: e });
|
|
380
|
-
}), setTimeout(() => {
|
|
381
|
-
(async (i) => {
|
|
382
|
-
i && (D.removeAddListenerFab = await (async (r) => {
|
|
383
|
-
if (m.addListener) {
|
|
384
|
-
const o = await m.addListener(W, "nativeSendFab", (s) => r && r(s));
|
|
385
|
-
return o != null && o.remove ? o.remove : () => null;
|
|
386
|
-
}
|
|
387
|
-
})(i));
|
|
388
|
-
})((i) => {
|
|
389
|
-
let r;
|
|
390
|
-
i && i.id && Object.keys(n).forEach((o) => {
|
|
391
|
-
i.id === n[o].id && (r = n[o].fn);
|
|
392
|
-
}), r && r();
|
|
393
|
-
});
|
|
394
|
-
}, 10));
|
|
395
|
-
};
|
|
396
|
-
class Le {
|
|
397
|
-
async homeIsClick(e) {
|
|
398
|
-
y.homeIsClick(e);
|
|
399
|
-
}
|
|
400
|
-
async openMinApp(e) {
|
|
401
|
-
return await y.openMinApp(e);
|
|
402
|
-
}
|
|
403
|
-
async showTitle(e) {
|
|
404
|
-
return await y.showTitle(e);
|
|
405
|
-
}
|
|
406
|
-
async showSubMask(e) {
|
|
407
|
-
return await y.showSubMask(e);
|
|
408
|
-
}
|
|
409
|
-
backBtnApiHooks(e) {
|
|
410
|
-
return (({ backBtnCb: t, router: a }) => ({ initBackBtnHandle: () => {
|
|
411
|
-
a && a.afterEach((i) => {
|
|
412
|
-
ye(() => {
|
|
413
|
-
i != null && i.name && oe(i.name);
|
|
414
|
-
});
|
|
415
|
-
});
|
|
416
|
-
}, registerBackBtnHandle: (i) => {
|
|
417
|
-
const { onMounted: r, onUnmounted: o } = i;
|
|
418
|
-
r(() => {
|
|
419
|
-
z((s) => {
|
|
420
|
-
t && t(s);
|
|
421
|
-
});
|
|
422
|
-
}), o(() => {
|
|
423
|
-
z && z(() => "");
|
|
424
|
-
});
|
|
425
|
-
} }))(e);
|
|
426
|
-
}
|
|
427
|
-
homeHandle(e) {
|
|
428
|
-
Pe(e);
|
|
429
|
-
}
|
|
430
|
-
setFabHandle(e) {
|
|
431
|
-
ke(e);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
const Ce = new class extends X {
|
|
435
|
-
constructor() {
|
|
436
|
-
super();
|
|
437
|
-
B(this, "communicatePlugins", new Le());
|
|
438
|
-
}
|
|
439
|
-
async getIsNativeHandle() {
|
|
440
|
-
return await super.getIsNativeHandle();
|
|
441
|
-
}
|
|
442
|
-
async specifiedPageHandle(e) {
|
|
443
|
-
return await super.specifiedPageHandle(e);
|
|
444
|
-
}
|
|
445
|
-
async nativeAppInfoHandle(e) {
|
|
446
|
-
return await super.nativeAppInfoHandle(e);
|
|
447
|
-
}
|
|
448
|
-
async homeIsClick(e) {
|
|
449
|
-
this.communicatePlugins.homeIsClick(e);
|
|
450
|
-
}
|
|
451
|
-
async openMinApp(e) {
|
|
452
|
-
return await this.communicatePlugins.openMinApp(e);
|
|
453
|
-
}
|
|
454
|
-
async showTitle(e) {
|
|
455
|
-
return await this.communicatePlugins.showTitle(e);
|
|
456
|
-
}
|
|
457
|
-
async showSubMask(e) {
|
|
458
|
-
return await this.communicatePlugins.showSubMask(e);
|
|
459
|
-
}
|
|
460
|
-
backBtnApiHooks(e) {
|
|
461
|
-
return this.communicatePlugins.backBtnApiHooks(e);
|
|
462
|
-
}
|
|
463
|
-
homeHandle(e) {
|
|
464
|
-
this.communicatePlugins.homeHandle(e);
|
|
465
|
-
}
|
|
466
|
-
setFabHandle(e) {
|
|
467
|
-
this.communicatePlugins.setFabHandle(e);
|
|
468
|
-
}
|
|
469
|
-
}();
|
|
470
|
-
export {
|
|
471
|
-
Y as W,
|
|
472
|
-
Ce as m
|
|
473
|
-
};
|
package/lib/chunk/cb9a50d4.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const e = { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } };
|
|
2
|
-
export {
|
|
3
|
-
e as default
|
|
4
|
-
};
|
package/lib/chunk/ecff8422.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const e = { data_info: { bu: { default_tenant_code: "WTCHK", tenants: [{ store_detail_list: [{ name: "APELDOORN HOOFDSTRAAT 136", code: "3462" }], name: "WTCHK", stores: ["3462"], timezone: "Europe/Amsterdam", code: "WTCHK" }] }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "asia", serverEnv: "uat" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { name: "APELDOORN HOOFDSTRAAT 3462", code: "3462" }, data_language: { code: "en", id: "en_US", name: "English" } };
|
|
2
|
-
export {
|
|
3
|
-
e as default
|
|
4
|
-
};
|
package/module.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module "superapp-miniapp-invoke-native";
|