superapp-miniapp-invoke-native 1.0.54 → 1.0.55

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