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