superapp-miniapp-invoke-native 1.0.54 → 1.0.56

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